mirror of
https://gitee.com/log4j/pig-ui.git
synced 2024-12-23 05:40:20 +08:00
🎉 排序
This commit is contained in:
parent
5c27bce5ad
commit
975adaf104
@ -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()
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -72,7 +72,8 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
deptName: ''
|
||||
},
|
||||
isPage: false
|
||||
isPage: false,
|
||||
descs: ['create_time']
|
||||
});
|
||||
|
||||
|
||||
|
@ -100,7 +100,8 @@ const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
pageList: fetchList,
|
||||
descs: ['create_time']
|
||||
})
|
||||
const {
|
||||
getDataList,
|
||||
|
@ -77,7 +77,8 @@ const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
pageList: fetchList,
|
||||
descs: ['create_time']
|
||||
})
|
||||
|
||||
// table hook
|
||||
|
@ -101,7 +101,8 @@
|
||||
zhCn: '',
|
||||
en: ''
|
||||
},
|
||||
pageList: fetchList
|
||||
pageList: fetchList,
|
||||
descs: ['create_time']
|
||||
})
|
||||
|
||||
// table hook
|
||||
|
@ -100,7 +100,8 @@
|
||||
createTime: ''
|
||||
},
|
||||
selectObjs: [],
|
||||
pageList: pageList
|
||||
pageList: pageList,
|
||||
descs: ['create_time']
|
||||
});
|
||||
|
||||
// table hook
|
||||
|
@ -112,7 +112,8 @@
|
||||
queryForm: {
|
||||
systemFlag: ''
|
||||
},
|
||||
pageList: fetchList
|
||||
pageList: fetchList,
|
||||
descs: ['create_time']
|
||||
})
|
||||
|
||||
// table hook
|
||||
|
@ -110,7 +110,8 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
roleName: ''
|
||||
},
|
||||
pageList: pageList // H
|
||||
pageList: pageList, // H
|
||||
descs: ['create_time']
|
||||
});
|
||||
|
||||
const dictType = ref([{
|
||||
|
@ -91,7 +91,8 @@ const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
pageList: fetchList,
|
||||
descs: ['create_time']
|
||||
})
|
||||
|
||||
// table hook
|
||||
|
@ -78,7 +78,8 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {
|
||||
username: ''
|
||||
},
|
||||
pageList: fetchList
|
||||
pageList: fetchList,
|
||||
|
||||
});
|
||||
|
||||
// table hook
|
||||
|
@ -141,7 +141,8 @@ const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
username: '',
|
||||
phone: ''
|
||||
},
|
||||
pageList: pageList
|
||||
pageList: pageList,
|
||||
descs: ['create_time']
|
||||
});
|
||||
|
||||
// 部门树使用的数据
|
||||
|
@ -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"},
|
||||
|
@ -109,7 +109,8 @@
|
||||
queryForm: {
|
||||
roleName: ''
|
||||
},
|
||||
pageList: fetchList // H
|
||||
pageList: fetchList ,// H
|
||||
descs: ['create_time']
|
||||
});
|
||||
|
||||
|
||||
|
@ -97,7 +97,8 @@
|
||||
queryForm: {
|
||||
type: ''
|
||||
},
|
||||
pageList: fetchList
|
||||
pageList: fetchList,
|
||||
descs: ['create_time']
|
||||
})
|
||||
|
||||
// table hook
|
||||
|
@ -120,7 +120,8 @@
|
||||
username: '',
|
||||
phone: ''
|
||||
},
|
||||
pageList: fetchList
|
||||
pageList: fetchList,
|
||||
descs: ['create_time']
|
||||
});
|
||||
|
||||
|
||||
|
@ -88,7 +88,8 @@ const multiple = ref(true)
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
pageList: fetchList,
|
||||
descs: ['create_time']
|
||||
})
|
||||
|
||||
// table hook
|
||||
|
@ -84,7 +84,8 @@
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
pageList: fetchList,
|
||||
descs: ['create_time']
|
||||
})
|
||||
|
||||
// table hook
|
||||
|
@ -88,6 +88,7 @@
|
||||
},
|
||||
pageList: fetchList,
|
||||
createdIsNeed: false,
|
||||
descs: ['create_time']
|
||||
})
|
||||
|
||||
// table hook
|
||||
|
@ -107,7 +107,8 @@
|
||||
|
||||
const state: BasicTableProps = reactive<BasicTableProps>({
|
||||
queryForm: {},
|
||||
pageList: fetchList
|
||||
pageList: fetchList,
|
||||
descs: ['create_time']
|
||||
})
|
||||
|
||||
// table hook
|
||||
|
Loading…
Reference in New Issue
Block a user