diff --git a/frontend/src/directives/modules/auth.ts b/frontend/src/directives/modules/auth.ts index 8745f7b..3872e4b 100644 --- a/frontend/src/directives/modules/auth.ts +++ b/frontend/src/directives/modules/auth.ts @@ -10,6 +10,8 @@ const auth: Directive = { const { value } = binding const authStore = useAuthStore() const currentPageRoles = authStore.authButtonListGet[authStore.routeName] ?? [] + console.log('1234',authStore.routeName) + console.log('123',currentPageRoles) if (value instanceof Array && value.length) { const hasPermission = value.every(item => currentPageRoles.includes(item)) if (!hasPermission) el.remove() diff --git a/frontend/src/layouts/components/Footer/index.vue b/frontend/src/layouts/components/Footer/index.vue index 6467635..a76ca37 100644 --- a/frontend/src/layouts/components/Footer/index.vue +++ b/frontend/src/layouts/components/Footer/index.vue @@ -24,8 +24,8 @@ 数字式模块 - 对比式模块比对式模块 diff --git a/frontend/src/routers/index.ts b/frontend/src/routers/index.ts index b57af3a..eb3a989 100644 --- a/frontend/src/routers/index.ts +++ b/frontend/src/routers/index.ts @@ -69,6 +69,7 @@ router.beforeEach(async (to, from, next) => { await initDynamicRouter() return next({ ...to, replace: true }) } + console.log(to) // 7.存储 routerName 做按钮权限筛选 authStore.setRouteName(to.name as string) diff --git a/frontend/src/views/analyse/index.vue b/frontend/src/views/analyse/index.vue deleted file mode 100644 index 8e8347f..0000000 --- a/frontend/src/views/analyse/index.vue +++ /dev/null @@ -1,13 +0,0 @@ - - - - - \ No newline at end of file diff --git a/frontend/src/views/authority/resource/components/resourcePopup.vue b/frontend/src/views/authority/resource/components/resourcePopup.vue index d70780b..2a48c80 100644 --- a/frontend/src/views/authority/resource/components/resourcePopup.vue +++ b/frontend/src/views/authority/resource/components/resourcePopup.vue @@ -192,6 +192,8 @@ const displayPid = computed({ // 打开弹窗,可能是新增,也可能是编辑 const open = async (sign: string, data: Function.ResFunction) => { + // 重置表单 + dialogFormRef.value?.resetFields() const response = await getFunctionListNoButton() functionList.value = response.data as unknown as Function.ResFunction[] titleType.value = sign diff --git a/frontend/src/views/authority/resource/index.vue b/frontend/src/views/authority/resource/index.vue index 0fe1e6d..8161315 100644 --- a/frontend/src/views/authority/resource/index.vue +++ b/frontend/src/views/authority/resource/index.vue @@ -53,7 +53,7 @@ { prop: 'code', label: '编码', - minWidth: 100, + minWidth: 120, }, { prop: 'type', @@ -75,7 +75,7 @@ { prop: 'icon', label: '图标', - minWidth: 100, + minWidth: 80, render: scope => { const customIcons: { [key: string]: any } = Icons const iconKey = scope.row.icon; // diff --git a/frontend/src/views/authority/role/components/rolePopup.vue b/frontend/src/views/authority/role/components/rolePopup.vue index 95f061b..86ee722 100644 --- a/frontend/src/views/authority/role/components/rolePopup.vue +++ b/frontend/src/views/authority/role/components/rolePopup.vue @@ -133,6 +133,8 @@ const close = () => { // 打开弹窗,可能是新增,也可能是编辑 const open = async (sign: string, data: Role.RoleBO) => { + // 重置表单 + dialogFormRef.value?.resetFields() titleType.value = sign dialogVisible.value = true diff --git a/frontend/src/views/authority/role/components/roleResourcePopup.vue b/frontend/src/views/authority/role/components/roleResourcePopup.vue index 2605152..74fc1f6 100644 --- a/frontend/src/views/authority/role/components/roleResourcePopup.vue +++ b/frontend/src/views/authority/role/components/roleResourcePopup.vue @@ -98,15 +98,20 @@ const close = () => { dialogFormRef.value?.validate(async (valid: boolean) => { if (valid) { if (formContent.value.id) { - // 获取勾选的节点 ID + // 获取半选中的节点 ID + const halfCheckedKeys = treeRef.value?.getHalfCheckedKeys() || []; + // 获取全选中的节点 ID const checkedKeys = treeRef.value?.getCheckedKeys() || []; - + // 将两个数组合并 + const allCheckedKeys = [...halfCheckedKeys, ...checkedKeys]; + // 将 checkedKeys 转换为字符串数组 - const checkedKeysAsString: string[] = checkedKeys.map(key => String(key)); + const checkedKeysAsString: string[] = allCheckedKeys.map(key => String(key)); // 假设 RoleFunctionId 是一个对象,且需要 id 属性 const roleFunctionIdObject: Role.RoleFunctionId = { id: checkedKeysAsString }; + const result = await assignFunction(formContent.value,roleFunctionIdObject); if(result.code != 'A0000'){ ElMessage.error({ message: result.message}) @@ -128,6 +133,8 @@ const close = () => { // 打开弹窗,可能是新增,也可能是编辑 const open = async (sign: string, data: Role.RoleBO, AllFunction: Function.ResFunction[]) => { + // 重置表单 + dialogFormRef.value?.resetFields() // 重置树状结构 functionList.value = [] checkedKeysRef.value = [] diff --git a/frontend/src/views/authority/user/components/passWordPopup.vue b/frontend/src/views/authority/user/components/passWordPopup.vue index 90cbda3..0dff840 100644 --- a/frontend/src/views/authority/user/components/passWordPopup.vue +++ b/frontend/src/views/authority/user/components/passWordPopup.vue @@ -121,6 +121,8 @@ const rules: Ref>> = ref({ // 打开弹窗是编辑 const open = async ( data: User.ResPassWordUser) => { + // 重置表单 + dialogFormRef.value?.resetFields() dialogVisible.value = true if (data.id) { formContent.value = { ...data } diff --git a/frontend/src/views/authority/user/components/userPopup.vue b/frontend/src/views/authority/user/components/userPopup.vue index 29959db..3804a81 100644 --- a/frontend/src/views/authority/user/components/userPopup.vue +++ b/frontend/src/views/authority/user/components/userPopup.vue @@ -151,6 +151,8 @@ // 打开弹窗,可能是新增,也可能是编辑 const open = async (sign: string, data: User.ResUser,roleParams: Role.RoleBO[]) => { + // 重置表单 + dialogFormRef.value?.resetFields() // 获取角色列表 roleList.value = roleParams titleType.value = sign diff --git a/frontend/src/views/authority/user/index.vue b/frontend/src/views/authority/user/index.vue index 8092689..56bdddb 100644 --- a/frontend/src/views/authority/user/index.vue +++ b/frontend/src/views/authority/user/index.vue @@ -8,8 +8,8 @@