🎉 排序

This commit is contained in:
32189 2023-03-03 09:42:33 +08:00
parent 5c27bce5ad
commit 975adaf104
19 changed files with 62 additions and 18 deletions

View File

@ -1,4 +1,5 @@
import request from "/@/utils/request";
import {getDetailsByPhone} from "/@/api/admin/user";
export const pageList = (params?: Object) => {
return request({
@ -54,6 +55,14 @@ export function getDetails(obj: Object) {
})
}
export function getDetailsByName(obj: Object) {
return request({
url: '/admin/appmenu/detailsByName/' + obj,
method: 'get'
})
}
export function validatePermission(rule: any, value: any, callback: any, isEdit: boolean) {
if (isEdit) {
return callback()
@ -69,4 +78,17 @@ export function validatePermission(rule: any, value: any, callback: any, isEdit:
})
}
export function validateByName(rule: any, value: any, callback: any, isEdit: boolean) {
if (isEdit) {
return callback()
}
getDetailsByName(value).then(response => {
const result = response.data
if (result !== null) {
callback(new Error('菜单名称已经存在'))
} else {
callback()
}
})
}

View File

@ -72,7 +72,8 @@ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
deptName: ''
},
isPage: false
isPage: false,
descs: ['create_time']
});

View File

@ -100,7 +100,8 @@ const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList
pageList: fetchList,
descs: ['create_time']
})
const {
getDataList,

View File

@ -77,7 +77,8 @@ const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList
pageList: fetchList,
descs: ['create_time']
})
// table hook

View File

@ -101,7 +101,8 @@
zhCn: '',
en: ''
},
pageList: fetchList
pageList: fetchList,
descs: ['create_time']
})
// table hook

View File

@ -100,7 +100,8 @@
createTime: ''
},
selectObjs: [],
pageList: pageList
pageList: pageList,
descs: ['create_time']
});
// table hook

View File

@ -112,7 +112,8 @@
queryForm: {
systemFlag: ''
},
pageList: fetchList
pageList: fetchList,
descs: ['create_time']
})
// table hook

View File

@ -110,7 +110,8 @@ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
roleName: ''
},
pageList: pageList // H
pageList: pageList, // H
descs: ['create_time']
});
const dictType = ref([{

View File

@ -91,7 +91,8 @@ const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList
pageList: fetchList,
descs: ['create_time']
})
// table hook

View File

@ -78,7 +78,8 @@ const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {
username: ''
},
pageList: fetchList
pageList: fetchList,
});
// table hook

View File

@ -141,7 +141,8 @@ const state: BasicTableProps = reactive<BasicTableProps>({
username: '',
phone: ''
},
pageList: pageList
pageList: pageList,
descs: ['create_time']
});
// 使

View File

@ -61,7 +61,7 @@
</template>
<script lang="ts" name="systemMenuDialog" setup>
import {addObj, info, pageList, update, validatePermission} from "/@/api/app/appmenu";
import {addObj, info, pageList, update, validateByName, validatePermission} from "/@/api/app/appmenu";
import {useMessage} from "/@/hooks/message";
import {rule} from "/@/utils/validate";
@ -120,7 +120,12 @@
};
const dataRules = reactive({
name: [{required: true, message: "菜单名称不能为空", trigger: "blur"}],
name: [{required: true, message: "菜单名称不能为空", trigger: "blur"}
, {
validator: (rule: any, value: any, callback: any) => {
validateByName(rule, value, callback, state.ruleForm.menuId !== '')
}, trigger: 'blur'
}],
path: [{required: true, message: "路由路径不能为空", trigger: "blur"}
, {validate: rule.noChinese, trigger: "blur"}],
permission: [{required: true, message: "权限标识不能为空", trigger: "blur"},

View File

@ -109,7 +109,8 @@
queryForm: {
roleName: ''
},
pageList: fetchList // H
pageList: fetchList ,// H
descs: ['create_time']
});

View File

@ -97,7 +97,8 @@
queryForm: {
type: ''
},
pageList: fetchList
pageList: fetchList,
descs: ['create_time']
})
// table hook

View File

@ -120,7 +120,8 @@
username: '',
phone: ''
},
pageList: fetchList
pageList: fetchList,
descs: ['create_time']
});

View File

@ -88,7 +88,8 @@ const multiple = ref(true)
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList
pageList: fetchList,
descs: ['create_time']
})
// table hook

View File

@ -84,7 +84,8 @@
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList
pageList: fetchList,
descs: ['create_time']
})
// table hook

View File

@ -88,6 +88,7 @@
},
pageList: fetchList,
createdIsNeed: false,
descs: ['create_time']
})
// table hook

View File

@ -107,7 +107,8 @@
const state: BasicTableProps = reactive<BasicTableProps>({
queryForm: {},
pageList: fetchList
pageList: fetchList,
descs: ['create_time']
})
// table hook