修复商户Id读取及保存

This commit is contained in:
2024-10-19 16:03:12 +08:00
parent 28e7ce4015
commit e82029456e
11 changed files with 31 additions and 21 deletions
@@ -166,7 +166,7 @@ import TinymceEditor from "@/components/TinymceEditor/index.vue";
import useFormData from "@/utils/use-form-data";
import {removeSiteInfoCache} from "@/api/cms/website";
import {FileRecord} from "@/api/system/file/model";
import { openSpmUrl } from "@/utils/common";
import { getMerchantId, openSpmUrl } from "@/utils/common";
// 是否是修改
const isUpdate = ref(false);
@@ -224,8 +224,8 @@ const { form, resetFields, assignFields } = useFormData<Design>({
buyUrl: '',
demoUrl: '',
account: '',
docUrl: ''
docUrl: '',
merchantId: undefined
});
const editorRef = ref<InstanceType<typeof TinymceEditor> | null>(null);
@@ -443,6 +443,7 @@ const save = () => {
...form,
layout: JSON.stringify(form),
categoryId: props.categoryId,
merchantId: getMerchantId(),
content: content.value,
};
console.log(formData);
@@ -162,7 +162,7 @@
import { removeSiteInfoCache } from '@/api/cms/website';
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
import { FileRecord } from '@/api/system/file/model';
import { uuid } from '@/components/TinymceEditor/util';
import { getMerchantId } from '@/utils/common';
// 是否开启响应式布局
const themeStore = useThemeStore();
@@ -221,7 +221,8 @@
articleCategoryId: 0,
articleId: 0,
pageName: '',
isMpWeixin: false
isMpWeixin: false,
merchantId: undefined
});
// 表单验证规则
@@ -373,7 +374,8 @@
.then(() => {
const navigationForm = {
...form,
parentId: form.parentId || 0
parentId: form.parentId || 0,
merchantId: getMerchantId()
};
const saveOrUpdate = isUpdate.value ? updateNavigation : addNavigation;
saveOrUpdate(navigationForm)
+4 -7
View File
@@ -19,12 +19,7 @@
>
<template #toolbar>
<a-space>
<a-button
v-if="!merchantId"
type="primary"
class="ele-btn-icon"
@click="openEdit()"
>
<a-button type="primary" class="ele-btn-icon" @click="openEdit()">
<template #icon>
<plus-outlined />
</template>
@@ -140,7 +135,7 @@
>
</template>
<template v-else-if="column.key === 'action'">
<a-space v-if="!merchantId">
<a-space>
<a-tooltip :title="`配置SEO及页面内容`">
<a class="text-fuchsia-300" @click="openDesign(record)">设计</a>
</a-tooltip>
@@ -217,6 +212,7 @@
import { Design } from '@/api/cms/design/model';
import { getMerchantId } from '@/utils/merchant';
import { removeSiteInfoCache } from '@/api/cms/website';
import { getMerchant } from "@/api/shop/merchant";
// 表格实例
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
@@ -358,6 +354,7 @@
where.bottom = undefined;
}
where.isMpWeixin = false;
where.merchantId = getMerchantId();
return listNavigation({ ...where });
};