优化:把网站设置、参数配置、域名管理放到概览页面

This commit is contained in:
2024-09-04 00:25:55 +08:00
parent aa85c133e3
commit 4b2c4bd9e6
9 changed files with 176 additions and 89 deletions
@@ -14,7 +14,7 @@
>
<template #extra>
<a-button type="primary" style="margin-right: 8px" @click="save">保存</a-button>
<a-button @click="onPreview">预览</a-button>
<a-button @click="openSpmUrl(`${form.path}`)">预览</a-button>
</template>
<a-form
ref="formRef"
@@ -166,6 +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";
// 是否是修改
const isUpdate = ref(false);
@@ -162,6 +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';
// 是否开启响应式布局
const themeStore = useThemeStore();
@@ -197,9 +198,9 @@
// 表单数据
const { form, resetFields, assignFields } = useFormData<Navigation>({
navigationId: undefined,
model: 'custom',
model: undefined,
code: undefined,
modelName: '单页模型',
modelName: undefined,
type: 0,
title: '',
parentId: 0,
@@ -312,7 +313,6 @@
});
const chooseModel = (item: any) => {
console.log(item);
form.model = `${item.value}`;
form.modelName = `${item.label}`;
if (item.value == 'custom') {
@@ -325,6 +325,11 @@
form.component = `/pages/${item.value}/index.vue`;
return;
}
if (!isUpdate.value) {
form.path = undefined;
form.component = `/pages/${item.value}/index.vue`;
return;
}
form.path = `/${item.value}/${form.navigationId}`;
form.component = `/pages/${item.value}/index.vue`;
};