mirror of https://gitee.com/xiaonuobase/snowy
【更新】修复授权移动端无按钮错误,优化前端移动端菜单模块等管理界面
parent
b34c427a5d
commit
a901e2a4ff
|
@ -48,13 +48,11 @@
|
|||
formRef.value.resetFields()
|
||||
visible = false
|
||||
}
|
||||
|
||||
// 默认要校验的
|
||||
const formRules = {
|
||||
title: [required('请输入按钮名称')],
|
||||
code: [required('请输入按钮编码')]
|
||||
}
|
||||
|
||||
// 验证并提交数据
|
||||
const onSubmit = () => {
|
||||
formRef.value
|
||||
|
@ -62,7 +60,6 @@
|
|||
.then(() => {
|
||||
const defParam = {
|
||||
category: 'BUTTON',
|
||||
// module: recordData.value.module,
|
||||
parentId: recordData.value.id
|
||||
}
|
||||
const param = Object.assign(defParam, formData.value)
|
||||
|
@ -72,7 +69,6 @@
|
|||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 调用这个函数将子组件的一些数据和方法暴露出去
|
||||
defineExpose({
|
||||
onOpen
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<a-drawer
|
||||
:title="formData.id ? '编辑移动端菜单' : '增加移动端菜单'"
|
||||
:width="500"
|
||||
:width="600"
|
||||
:visible="visible"
|
||||
:destroy-on-close="true"
|
||||
:footer-style="{ textAlign: 'right' }"
|
||||
|
@ -73,19 +73,18 @@
|
|||
<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
|
||||
<a-button type="primary" @click="onSubmit" :loading="submitLoading">保存</a-button>
|
||||
</template>
|
||||
<!-- <Icon-selector ref="iconSelector" @iconCallBack="iconCallBack" />-->
|
||||
<icon-mobile-selector ref="iconSelector" @iconCallBack="iconCallBack" />
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
<script setup name="mobileMenuForm">
|
||||
import tool from '@/utils/tool'
|
||||
import { message } from 'ant-design-vue'
|
||||
import SnowflakeId from 'snowflake-id'
|
||||
import { cloneDeep } from 'lodash-es'
|
||||
import { required } from '@/utils/formRules'
|
||||
import mobileMenuApi from '@/api/mobile/resource/menuApi'
|
||||
import ColorPicker from '@/components/ColorPicker/index.vue'
|
||||
// import IconSelector from '@/components/Selector/iconSelector.vue'
|
||||
import IconMobileSelector from '@/components/Selector/iconMobileSelector.vue'
|
||||
// 抽屉状态
|
||||
const visible = ref(false)
|
||||
|
@ -122,6 +121,10 @@
|
|||
|
||||
// 打开抽屉
|
||||
const onOpen = (record, module) => {
|
||||
if (!module) {
|
||||
message.warning('请先添加菜单所属模块')
|
||||
return
|
||||
}
|
||||
moduleId.value = module
|
||||
visible.value = true
|
||||
// 设置默认的
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<template>
|
||||
<a-card :bordered="false">
|
||||
<a-space class="mb-3">
|
||||
<a-card :bordered="false" :body-style="{ 'padding-bottom': '0px' }" class="mb-2">
|
||||
<a-form ref="searchFormRef" name="advanced_search" :model="searchFormState" class="ant-advanced-search-form">
|
||||
<a-space style="align-items: normal">
|
||||
<a-radio-group v-model:value="module" button-style="solid">
|
||||
<a-radio-button
|
||||
v-for="module in moduleList"
|
||||
|
@ -12,15 +13,17 @@
|
|||
{{ module.title }}</a-radio-button
|
||||
>
|
||||
</a-radio-group>
|
||||
|
||||
<a-input-search
|
||||
v-model:value="searchFormState.searchKey"
|
||||
placeholder="请输入菜单名称关键词"
|
||||
enter-button
|
||||
allowClear
|
||||
@search="onSearch"
|
||||
/>
|
||||
<a-form-item name="searchKey">
|
||||
<a-space>
|
||||
<a-input v-model:value="searchFormState.searchKey" placeholder="请输入模块名称关键词"></a-input>
|
||||
<a-button type="primary" @click="table.refresh(true)">查询</a-button>
|
||||
<a-button style="margin: 0 8px" @click="() => searchFormRef.resetFields()">重置</a-button>
|
||||
</a-space>
|
||||
</a-form-item>
|
||||
</a-space>
|
||||
</a-form>
|
||||
</a-card>
|
||||
<a-card :bordered="false">
|
||||
<s-table
|
||||
ref="table"
|
||||
:columns="columns"
|
||||
|
@ -47,8 +50,9 @@
|
|||
<span v-else>{{record.path}}</span>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'icon'">
|
||||
<!-- <component :is="record.icon" />-->
|
||||
<a-tag :color="record.color">
|
||||
<span class="snowy xn-icons" :class="record.icon" ></span>
|
||||
</a-tag>
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'regType'">
|
||||
{{ $TOOL.dictTypeData('MOBILE_REG_TYPE', record.regType) }}
|
||||
|
@ -101,9 +105,9 @@
|
|||
let searchFormState = reactive({})
|
||||
let moduleList = ref([])
|
||||
const module = ref()
|
||||
const searchFormRef = ref()
|
||||
const table = ref()
|
||||
const formRef = ref()
|
||||
const searchFormRef = ref()
|
||||
const changeModuleFormRef = ref()
|
||||
const button = ref()
|
||||
const toolConfig = { refresh: true, height: true, columnSetting: true, striped: false }
|
||||
|
@ -184,13 +188,6 @@
|
|||
searchFormState.module = value
|
||||
table.value.refresh(true)
|
||||
}
|
||||
|
||||
// 查询
|
||||
const onSearch = () => {
|
||||
if (searchFormState.searchKey) {
|
||||
table.value.refresh(true)
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
const deleteMobileMenu = (record) => {
|
||||
let params = [
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<a-button style="margin-right: 8px" @click="onClose">关闭</a-button>
|
||||
<a-button type="primary" @click="onSubmit">保存</a-button>
|
||||
</template>
|
||||
<Icon-selector ref="iconSelector" @iconCallBack="iconCallBack" />
|
||||
<icon-mobile-selector ref="iconSelector" @iconCallBack="iconCallBack" />
|
||||
</a-drawer>
|
||||
</template>
|
||||
|
||||
|
@ -35,7 +35,7 @@
|
|||
import ColorPicker from '@/components/ColorPicker/index.vue'
|
||||
import { required } from '@/utils/formRules'
|
||||
import moduleApi from '@/api/mobile/resource/moduleApi'
|
||||
import IconSelector from '@/components/Selector/iconSelector.vue'
|
||||
import IconMobileSelector from '@/components/Selector/iconMobileSelector.vue'
|
||||
// 默认是关闭状态
|
||||
let visible = $ref(false)
|
||||
const emit = defineEmits({ successful: null })
|
||||
|
|
|
@ -110,6 +110,12 @@
|
|||
return res
|
||||
})
|
||||
}
|
||||
// 查询
|
||||
const onSearch = () => {
|
||||
if (searchFormState.searchKey) {
|
||||
table.value.refresh(true)
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
const deleteModule = (record) => {
|
||||
let params = [
|
||||
|
|
|
@ -206,7 +206,6 @@ public class MobileMenuServiceImpl extends ServiceImpl<MobileMenuMapper, MobileM
|
|||
@Override
|
||||
public List<JSONObject> mobileMenuTreeSelector() {
|
||||
LambdaQueryWrapper<MobileMenu> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.in(MobileMenu::getCategory, MobileResourceCategoryEnum.MODULE.getValue(), MobileResourceCategoryEnum.MENU.getValue());
|
||||
List<MobileMenu> allModuleAndMenuList = this.list(lambdaQueryWrapper);
|
||||
List<MobileMenu> mobileModuleList = CollectionUtil.newArrayList();
|
||||
List<MobileMenu> mobileMenuList = CollectionUtil.newArrayList();
|
||||
|
@ -218,7 +217,7 @@ public class MobileMenuServiceImpl extends ServiceImpl<MobileMenuMapper, MobileM
|
|||
allModuleAndMenuList.forEach(mobileMenu -> {
|
||||
if (mobileMenu.getCategory().equals(MobileResourceCategoryEnum.MODULE.getValue())) mobileModuleList.add(mobileMenu);
|
||||
if (mobileMenu.getCategory().equals(MobileResourceCategoryEnum.MENU.getValue())) mobileMenuList.add(mobileMenu);
|
||||
if (mobileMenu.getCategory().equals(MobileResourceCategoryEnum.BUTTON.getValue())) mobileMenuList.add(mobileMenu);
|
||||
if (mobileMenu.getCategory().equals(MobileResourceCategoryEnum.BUTTON.getValue())) mobileButtonList.add(mobileMenu);
|
||||
});
|
||||
List<JSONObject> leafMenuList = CollectionUtil.newArrayList();
|
||||
List<TreeNode<String>> treeNodeList = mobileMenuList.stream().map(mobileMenu ->
|
||||
|
|
Loading…
Reference in New Issue