优化小程序菜单管理功能
This commit is contained in:
@@ -57,6 +57,27 @@
|
||||
v-model:value="form.target"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="菜单类型" name="type">
|
||||
<a-select
|
||||
v-model:value="form.type"
|
||||
placeholder="菜单类型"
|
||||
:style="`width: 200px`"
|
||||
>
|
||||
<a-select-option :value="0">会员功能</a-select-option>
|
||||
<a-select-option :value="1">订单管理</a-select-option>
|
||||
<a-select-option :value="2">首页导航</a-select-option>
|
||||
<a-select-option :value="3">商城导航</a-select-option>
|
||||
<a-select-option :value="4">管理中心</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="管理人员可见" name="adminShow">
|
||||
<a-switch
|
||||
checked-children="是"
|
||||
un-checked-children="否"
|
||||
:checked="form.adminShow === 1"
|
||||
@update:checked="updateAdminShow"
|
||||
/>
|
||||
</a-form-item>
|
||||
<a-form-item label="排序" name="sortNumber">
|
||||
<a-input-number
|
||||
:min="0"
|
||||
@@ -127,6 +148,7 @@
|
||||
position: undefined,
|
||||
active: undefined,
|
||||
userId: 0,
|
||||
adminShow: undefined,
|
||||
home: undefined,
|
||||
sortNumber: 100,
|
||||
comments: '',
|
||||
@@ -172,6 +194,10 @@
|
||||
form.icon = '';
|
||||
};
|
||||
|
||||
const updateAdminShow = (value: boolean) => {
|
||||
form.adminShow = value ? 1 : 0;
|
||||
};
|
||||
|
||||
// 预设颜色
|
||||
const predefineColors = ref([
|
||||
'#40a9ff',
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
>菜单类型</span
|
||||
>
|
||||
<a-radio-group v-model:value="where.type" @change="handleSearch">
|
||||
<a-radio-button :value="0">功能图标</a-radio-button>
|
||||
<a-radio-button :value="0">会员功能</a-radio-button>
|
||||
<a-radio-button :value="4">管理中心</a-radio-button>
|
||||
<a-radio-button :value="1">订单图标</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-space>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { createVNode, ref, unref, watch } from 'vue';
|
||||
import { createVNode, ref } from 'vue';
|
||||
import { message, Modal } from 'ant-design-vue';
|
||||
import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import type { EleProTable } from 'ele-admin-pro';
|
||||
@@ -108,8 +108,6 @@
|
||||
const showEdit = ref(false);
|
||||
// 是否显示批量移动弹窗
|
||||
const showMove = ref(false);
|
||||
// 加载状态
|
||||
const loading = ref(true);
|
||||
// 页面标题
|
||||
const title = getPageTitle();
|
||||
const type = ref<number>(2);
|
||||
@@ -121,8 +119,6 @@
|
||||
showOrderCard: true,
|
||||
showToolsCard: true
|
||||
});
|
||||
// 菜单列表
|
||||
const list = ref<any[]>();
|
||||
|
||||
// 表格数据源
|
||||
const datasource: DatasourceFunction = ({
|
||||
@@ -135,7 +131,6 @@
|
||||
if (filters) {
|
||||
where.status = filters.status;
|
||||
}
|
||||
where.type = type.value;
|
||||
return pageMpMenu({
|
||||
...where,
|
||||
...orders,
|
||||
@@ -195,7 +190,11 @@
|
||||
|
||||
/* 搜索 */
|
||||
const reload = (where?: MpMenuParam) => {
|
||||
type.value = Number(where?.type) || 0;
|
||||
if (where?.type) {
|
||||
type.value = Number(where?.type);
|
||||
} else {
|
||||
type.value = 0;
|
||||
}
|
||||
refresh.value = !refresh.value;
|
||||
selection.value = [];
|
||||
tableRef?.value?.reload({ where: where });
|
||||
|
||||
Reference in New Issue
Block a user