|
@@ -1,7 +1,7 @@
|
|
|
import { FormSchema } from '/@/components/Form';
|
|
|
import {ref} from "vue";
|
|
|
import {ComponentTypes} from "@/views/system/menu/menu/menu.data";
|
|
|
-import {checkMenuInfoisExist} from "@/views/appmanage/AppBaseInfo.api";
|
|
|
+import {checkAppNameisExist, checkMenuInfoisExist} from "@/views/appmanage/AppBaseInfo.api";
|
|
|
|
|
|
|
|
|
export const menuInfoisshow = ref(false)
|
|
@@ -29,7 +29,6 @@ const isValidIpAddress = (ip) => {
|
|
|
};
|
|
|
|
|
|
export const checkMenuInfo = async (_rule, value, callback) => {
|
|
|
- console.log("菜单信息:"+value)
|
|
|
const res = await checkMenuInfoisExist(value)
|
|
|
if (res === '该值可用!') {
|
|
|
callback(); // 校验通过
|
|
@@ -38,12 +37,24 @@ export const checkMenuInfo = async (_rule, value, callback) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+// 检查应用名字是否已经存在
|
|
|
+export const checkAppName = async (_rule, value, callback) => {
|
|
|
+ const res = await checkAppNameisExist(value)
|
|
|
+ if (res === '检查通过') {
|
|
|
+ callback(); // 校验通过
|
|
|
+ } else {
|
|
|
+ callback(new Error(res)); // 校验失败
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
export const step1Schemas: FormSchema[] = [
|
|
|
{
|
|
|
field: 'name',
|
|
|
component: 'Input',
|
|
|
label: '应用名称',
|
|
|
required: true,
|
|
|
+ ifShow: ({ values }) => !(values.component === ComponentTypes.IFrame && values.internalOrExternal),
|
|
|
+ rules:[{ validator: checkAppName, trigger: 'blur'}],
|
|
|
componentProps: {
|
|
|
placeholder:"请输入应用名称"
|
|
|
},
|