整理商品管理模块
This commit is contained in:
@@ -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 }
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user