整理商品管理模块

This commit is contained in:
2024-07-25 19:20:53 +08:00
parent 717c89a58e
commit cf0961afdd
48 changed files with 1814 additions and 965 deletions
+24 -11
View File
@@ -77,6 +77,7 @@
<MpFieldEdit
v-model:visible="showEdit"
:data="current"
:pageId="pageId"
@done="reload"
/>
</div>
@@ -100,6 +101,7 @@
updateMpField
} from '@/api/cms/mpField';
import { copyText, getPageTitle } from '@/utils/common';
import router from '@/router';
const props = defineProps<{
mpId: any;
@@ -113,10 +115,15 @@
const current = ref<MpField | null>(null);
// 是否显示编辑弹窗
const showEdit = ref(false);
const pageId = ref(0);
// 表格数据源
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
// 搜索条件
if (pageId.value > 0) {
where.pageId = pageId.value;
}
// where.pageId = router.currentRoute.value.params.id;
return pageMpField({
...where,
...orders,
@@ -137,13 +144,13 @@
dataIndex: 'value',
key: 'value'
},
{
title: '位置',
dataIndex: 'pageId',
key: 'pageId',
width: 180,
align: 'center'
},
// {
// title: '位置',
// dataIndex: 'pageId',
// key: 'pageId',
// width: 180,
// align: 'center'
// },
{
title: '排序',
dataIndex: 'sortNumber',
@@ -226,11 +233,17 @@
};
watch(
() => props.mpId,
(mpId) => {
if (mpId) {
reload();
() => router.currentRoute.value.params.id,
(id) => {
if (id) {
console.log(router.currentRoute);
if (id == ':id') {
pageId.value = 0;
} else {
pageId.value = Number(id);
}
}
reload();
},
{ immediate: true }
);