新增:导航栏目设计拆分简单和高级展示方式
This commit is contained in:
@@ -146,7 +146,7 @@
|
||||
import { ItemType } from 'ele-admin-pro/es/ele-image-upload/types';
|
||||
import { FormInstance } from 'ant-design-vue/es/form';
|
||||
import { FileRecord } from '@/api/system/file/model';
|
||||
import { addDomain } from '@/api/cms/domain';
|
||||
import { checkExistence } from '@/api/cms/domain';
|
||||
|
||||
// 是否是修改
|
||||
const isUpdate = ref(false);
|
||||
@@ -175,6 +175,7 @@
|
||||
const formRef = ref<FormInstance | null>(null);
|
||||
const images = ref<ItemType[]>([]);
|
||||
const websiteQrcode = ref<ItemType[]>([]);
|
||||
const oldDomain = ref();
|
||||
|
||||
// 用户信息
|
||||
const form = reactive<Website>({
|
||||
@@ -244,6 +245,31 @@
|
||||
// trigger: 'blur'
|
||||
// }
|
||||
// ],
|
||||
websiteCode: [
|
||||
{
|
||||
required: true,
|
||||
type: 'string',
|
||||
message: '该域名已存在',
|
||||
validator: (_rule: Rule, value: string) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
if (!value) {
|
||||
return reject('请输入二级域名');
|
||||
}
|
||||
checkExistence('domain', `${value}.wsdns.cn`)
|
||||
.then(() => {
|
||||
if (value === oldDomain.value) {
|
||||
return resolve();
|
||||
}
|
||||
reject('已存在');
|
||||
})
|
||||
.catch(() => {
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
},
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
adminUrl: [
|
||||
{
|
||||
required: true,
|
||||
@@ -342,6 +368,9 @@
|
||||
status: 'done'
|
||||
});
|
||||
}
|
||||
if (props.data.websiteCode) {
|
||||
oldDomain.value = props.data.websiteCode;
|
||||
}
|
||||
isUpdate.value = true;
|
||||
} else {
|
||||
isUpdate.value = false;
|
||||
|
||||
Reference in New Issue
Block a user