修复商户Id读取及保存
This commit is contained in:
@@ -49,6 +49,7 @@ export interface Design {
|
|||||||
demoUrl?: string;
|
demoUrl?: string;
|
||||||
account?: string;
|
account?: string;
|
||||||
docUrl?: string;
|
docUrl?: string;
|
||||||
|
merchantId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ export interface Link {
|
|||||||
deleted?: number;
|
deleted?: number;
|
||||||
status?: number;
|
status?: number;
|
||||||
createTime?: number;
|
createTime?: number;
|
||||||
|
merchantId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ export interface Navigation {
|
|||||||
label?: string;
|
label?: string;
|
||||||
value?: number;
|
value?: number;
|
||||||
style?: string;
|
style?: string;
|
||||||
|
merchantId?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -52,5 +53,6 @@ export interface NavigationParam {
|
|||||||
path?: string;
|
path?: string;
|
||||||
authority?: string;
|
authority?: string;
|
||||||
parentId?: number;
|
parentId?: number;
|
||||||
|
merchantId?: number;
|
||||||
navigationId?: number;
|
navigationId?: number;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { listNavigation, pageNavigation } from '@/api/cms/navigation';
|
import { listNavigation } from '@/api/cms/navigation';
|
||||||
import { EleProTable } from 'ele-admin-pro';
|
import { EleProTable } from 'ele-admin-pro';
|
||||||
import { toTreeData, eachTreeData } from 'ele-admin-pro/es';
|
import { toTreeData, eachTreeData } from 'ele-admin-pro/es';
|
||||||
import type {
|
import type {
|
||||||
@@ -88,7 +88,7 @@
|
|||||||
EleProTableDone
|
EleProTableDone
|
||||||
} from 'ele-admin-pro/es/ele-pro-table/types';
|
} from 'ele-admin-pro/es/ele-pro-table/types';
|
||||||
import type { Navigation, NavigationParam } from '@/api/cms/navigation/model';
|
import type { Navigation, NavigationParam } from '@/api/cms/navigation/model';
|
||||||
import type { Menu } from '@/api/system/menu/model';
|
import { getMerchantId } from '@/utils/common';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
// 弹窗是否打开
|
// 弹窗是否打开
|
||||||
@@ -154,6 +154,7 @@
|
|||||||
where.bottom = 0;
|
where.bottom = 0;
|
||||||
}
|
}
|
||||||
where.isMpWeixin = false;
|
where.isMpWeixin = false;
|
||||||
|
where.merchantId = getMerchantId();
|
||||||
return listNavigation({ ...where });
|
return listNavigation({ ...where });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -334,7 +334,9 @@
|
|||||||
|
|
||||||
// 加载栏目数据
|
// 加载栏目数据
|
||||||
if (!navigationList.value) {
|
if (!navigationList.value) {
|
||||||
listNavigation({}).then((res) => {
|
listNavigation({
|
||||||
|
merchantId: getMerchantId()
|
||||||
|
}).then((res) => {
|
||||||
navigationList.value = toTreeData({
|
navigationList.value = toTreeData({
|
||||||
data: res?.map((d) => {
|
data: res?.map((d) => {
|
||||||
d.value = d.navigationId;
|
d.value = d.navigationId;
|
||||||
|
|||||||
@@ -98,7 +98,7 @@
|
|||||||
import type { Design, DesignParam } from '@/api/cms/design/model';
|
import type { Design, DesignParam } from '@/api/cms/design/model';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { toTreeData } from 'ele-admin-pro';
|
import { toTreeData } from 'ele-admin-pro';
|
||||||
import { openUrl } from '@/utils/common';
|
import { getMerchantId, openUrl } from '@/utils/common';
|
||||||
import { getSiteDomain } from '@/utils/domain';
|
import { getSiteDomain } from '@/utils/domain';
|
||||||
import { Navigation } from '@/api/cms/navigation/model';
|
import { Navigation } from '@/api/cms/navigation/model';
|
||||||
import { listNavigation } from '@/api/cms/navigation';
|
import { listNavigation } from '@/api/cms/navigation';
|
||||||
@@ -275,7 +275,7 @@
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
// 加载栏目数据
|
// 加载栏目数据
|
||||||
if (!navigationList.value) {
|
if (!navigationList.value) {
|
||||||
listNavigation({}).then((res) => {
|
listNavigation({ merchantId: getMerchantId() }).then((res) => {
|
||||||
navigationList.value = toTreeData({
|
navigationList.value = toTreeData({
|
||||||
data: res?.map((d) => {
|
data: res?.map((d) => {
|
||||||
d.value = d.navigationId;
|
d.value = d.navigationId;
|
||||||
|
|||||||
@@ -103,7 +103,7 @@
|
|||||||
import type { Link } from '@/api/cms/link/model';
|
import type { Link } from '@/api/cms/link/model';
|
||||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import { uploadFile } from '@/api/system/file';
|
import { uploadFile } from '@/api/system/file';
|
||||||
import { getDictionaryOptions } from '@/utils/common';
|
import { getDictionaryOptions, getMerchantId } from "@/utils/common";
|
||||||
import { FileRecord } from '@/api/system/file/model';
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
import { Navigation } from '@/api/cms/navigation/model';
|
import { Navigation } from '@/api/cms/navigation/model';
|
||||||
|
|
||||||
@@ -143,6 +143,7 @@
|
|||||||
sortNumber: 100,
|
sortNumber: 100,
|
||||||
linkType: undefined,
|
linkType: undefined,
|
||||||
categoryId: undefined,
|
categoryId: undefined,
|
||||||
|
merchantId: undefined,
|
||||||
comments: undefined
|
comments: undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -226,6 +227,7 @@
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
const saveOrUpdate = isUpdate.value ? updateLink : addLink;
|
const saveOrUpdate = isUpdate.value ? updateLink : addLink;
|
||||||
|
form.merchantId = getMerchantId();
|
||||||
saveOrUpdate(form)
|
saveOrUpdate(form)
|
||||||
.then((msg) => {
|
.then((msg) => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|||||||
@@ -81,7 +81,7 @@
|
|||||||
import { pageLink, removeLink } from '@/api/cms/link';
|
import { pageLink, removeLink } from '@/api/cms/link';
|
||||||
import { toTreeData } from 'ele-admin-pro';
|
import { toTreeData } from 'ele-admin-pro';
|
||||||
import type { Link, LinkParam } from '@/api/cms/link/model';
|
import type { Link, LinkParam } from '@/api/cms/link/model';
|
||||||
import { openSpmUrl, openUrl } from '@/utils/common';
|
import { getMerchantId, openSpmUrl, openUrl } from '@/utils/common';
|
||||||
import LinkSearch from './components/link-search.vue';
|
import LinkSearch from './components/link-search.vue';
|
||||||
import { listNavigation } from '@/api/cms/navigation';
|
import { listNavigation } from '@/api/cms/navigation';
|
||||||
import { Navigation } from '@/api/cms/navigation/model';
|
import { Navigation } from '@/api/cms/navigation/model';
|
||||||
@@ -146,6 +146,7 @@
|
|||||||
|
|
||||||
// 表格数据源
|
// 表格数据源
|
||||||
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
|
const datasource: DatasourceFunction = ({ page, limit, where, orders }) => {
|
||||||
|
where.merchantId = getMerchantId();
|
||||||
return pageLink({ ...where, ...orders, limit, page });
|
return pageLink({ ...where, ...orders, limit, page });
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -163,7 +164,7 @@
|
|||||||
|
|
||||||
// 加载栏目数据
|
// 加载栏目数据
|
||||||
if (!navigationList.value) {
|
if (!navigationList.value) {
|
||||||
listNavigation({}).then((res) => {
|
listNavigation({ merchantId: getMerchantId() }).then((res) => {
|
||||||
navigationList.value = toTreeData({
|
navigationList.value = toTreeData({
|
||||||
data: res?.map((d) => {
|
data: res?.map((d) => {
|
||||||
d.value = d.navigationId;
|
d.value = d.navigationId;
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ import TinymceEditor from "@/components/TinymceEditor/index.vue";
|
|||||||
import useFormData from "@/utils/use-form-data";
|
import useFormData from "@/utils/use-form-data";
|
||||||
import {removeSiteInfoCache} from "@/api/cms/website";
|
import {removeSiteInfoCache} from "@/api/cms/website";
|
||||||
import {FileRecord} from "@/api/system/file/model";
|
import {FileRecord} from "@/api/system/file/model";
|
||||||
import { openSpmUrl } from "@/utils/common";
|
import { getMerchantId, openSpmUrl } from "@/utils/common";
|
||||||
|
|
||||||
// 是否是修改
|
// 是否是修改
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
@@ -224,8 +224,8 @@ const { form, resetFields, assignFields } = useFormData<Design>({
|
|||||||
buyUrl: '',
|
buyUrl: '',
|
||||||
demoUrl: '',
|
demoUrl: '',
|
||||||
account: '',
|
account: '',
|
||||||
docUrl: ''
|
docUrl: '',
|
||||||
|
merchantId: undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
const editorRef = ref<InstanceType<typeof TinymceEditor> | null>(null);
|
const editorRef = ref<InstanceType<typeof TinymceEditor> | null>(null);
|
||||||
@@ -443,6 +443,7 @@ const save = () => {
|
|||||||
...form,
|
...form,
|
||||||
layout: JSON.stringify(form),
|
layout: JSON.stringify(form),
|
||||||
categoryId: props.categoryId,
|
categoryId: props.categoryId,
|
||||||
|
merchantId: getMerchantId(),
|
||||||
content: content.value,
|
content: content.value,
|
||||||
};
|
};
|
||||||
console.log(formData);
|
console.log(formData);
|
||||||
|
|||||||
@@ -162,7 +162,7 @@
|
|||||||
import { removeSiteInfoCache } from '@/api/cms/website';
|
import { removeSiteInfoCache } from '@/api/cms/website';
|
||||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||||
import { FileRecord } from '@/api/system/file/model';
|
import { FileRecord } from '@/api/system/file/model';
|
||||||
import { uuid } from '@/components/TinymceEditor/util';
|
import { getMerchantId } from '@/utils/common';
|
||||||
|
|
||||||
// 是否开启响应式布局
|
// 是否开启响应式布局
|
||||||
const themeStore = useThemeStore();
|
const themeStore = useThemeStore();
|
||||||
@@ -221,7 +221,8 @@
|
|||||||
articleCategoryId: 0,
|
articleCategoryId: 0,
|
||||||
articleId: 0,
|
articleId: 0,
|
||||||
pageName: '',
|
pageName: '',
|
||||||
isMpWeixin: false
|
isMpWeixin: false,
|
||||||
|
merchantId: undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
// 表单验证规则
|
// 表单验证规则
|
||||||
@@ -373,7 +374,8 @@
|
|||||||
.then(() => {
|
.then(() => {
|
||||||
const navigationForm = {
|
const navigationForm = {
|
||||||
...form,
|
...form,
|
||||||
parentId: form.parentId || 0
|
parentId: form.parentId || 0,
|
||||||
|
merchantId: getMerchantId()
|
||||||
};
|
};
|
||||||
const saveOrUpdate = isUpdate.value ? updateNavigation : addNavigation;
|
const saveOrUpdate = isUpdate.value ? updateNavigation : addNavigation;
|
||||||
saveOrUpdate(navigationForm)
|
saveOrUpdate(navigationForm)
|
||||||
|
|||||||
@@ -19,12 +19,7 @@
|
|||||||
>
|
>
|
||||||
<template #toolbar>
|
<template #toolbar>
|
||||||
<a-space>
|
<a-space>
|
||||||
<a-button
|
<a-button type="primary" class="ele-btn-icon" @click="openEdit()">
|
||||||
v-if="!merchantId"
|
|
||||||
type="primary"
|
|
||||||
class="ele-btn-icon"
|
|
||||||
@click="openEdit()"
|
|
||||||
>
|
|
||||||
<template #icon>
|
<template #icon>
|
||||||
<plus-outlined />
|
<plus-outlined />
|
||||||
</template>
|
</template>
|
||||||
@@ -140,7 +135,7 @@
|
|||||||
>
|
>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="column.key === 'action'">
|
<template v-else-if="column.key === 'action'">
|
||||||
<a-space v-if="!merchantId">
|
<a-space>
|
||||||
<a-tooltip :title="`配置SEO及页面内容`">
|
<a-tooltip :title="`配置SEO及页面内容`">
|
||||||
<a class="text-fuchsia-300" @click="openDesign(record)">设计</a>
|
<a class="text-fuchsia-300" @click="openDesign(record)">设计</a>
|
||||||
</a-tooltip>
|
</a-tooltip>
|
||||||
@@ -217,6 +212,7 @@
|
|||||||
import { Design } from '@/api/cms/design/model';
|
import { Design } from '@/api/cms/design/model';
|
||||||
import { getMerchantId } from '@/utils/merchant';
|
import { getMerchantId } from '@/utils/merchant';
|
||||||
import { removeSiteInfoCache } from '@/api/cms/website';
|
import { removeSiteInfoCache } from '@/api/cms/website';
|
||||||
|
import { getMerchant } from "@/api/shop/merchant";
|
||||||
|
|
||||||
// 表格实例
|
// 表格实例
|
||||||
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
const tableRef = ref<InstanceType<typeof EleProTable> | null>(null);
|
||||||
@@ -358,6 +354,7 @@
|
|||||||
where.bottom = undefined;
|
where.bottom = undefined;
|
||||||
}
|
}
|
||||||
where.isMpWeixin = false;
|
where.isMpWeixin = false;
|
||||||
|
where.merchantId = getMerchantId();
|
||||||
return listNavigation({ ...where });
|
return listNavigation({ ...where });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user