【更新】修复授权移动端无按钮错误,优化前端移动端菜单模块等管理界面

pull/84/head
小诺 2023-02-05 03:12:07 +08:00 committed by 俞宝山
parent b34c427a5d
commit a901e2a4ff
6 changed files with 34 additions and 33 deletions

View File

@ -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

View File

@ -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
//

View File

@ -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-space>
<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" />-->
<span class="snowy xn-icons" :class="record.icon" ></span>
<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 = [

View File

@ -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 })

View File

@ -110,6 +110,12 @@
return res
})
}
//
const onSearch = () => {
if (searchFormState.searchKey) {
table.value.refresh(true)
}
}
//
const deleteModule = (record) => {
let params = [

View File

@ -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 ->
@ -404,7 +403,7 @@ public class MobileMenuServiceImpl extends ServiceImpl<MobileMenuMapper, MobileM
}
}
}
@Override
public List<MobileMenu> getChildListById(List<MobileMenu> originDataList, String id, boolean includeSelf) {
List<MobileMenu> resultList = CollectionUtil.newArrayList();