Просмотр исходного кода

update 优化 岗位页面查询权限问题

疯狂的狮子Li 7 месяцев назад
Родитель
Сommit
b4a40c94dc
3 измененных файлов с 18 добавлено и 6 удалено
  1. 11 0
      src/api/system/post/index.ts
  2. 1 1
      src/api/system/user/index.ts
  3. 6 5
      src/views/system/post/index.vue

+ 11 - 0
src/api/system/post/index.ts

@@ -1,6 +1,7 @@
 import request from '@/utils/request';
 import { PostForm, PostQuery, PostVO } from './types';
 import { AxiosPromise } from 'axios';
+import { DeptTreeVO } from '../dept/types';
 
 // 查询岗位列表
 export function listPost(query: PostQuery): AxiosPromise<PostVO[]> {
@@ -56,3 +57,13 @@ export function delPost(postId: string | number | (string | number)[]) {
     method: 'delete'
   });
 }
+
+/**
+ * 查询部门下拉树结构
+ */
+export const deptTreeSelect = (): AxiosPromise<DeptTreeVO[]> => {
+  return request({
+    url: '/system/post/deptTree',
+    method: 'get'
+  });
+};

+ 1 - 1
src/api/system/user/index.ts

@@ -1,4 +1,4 @@
-import { DeptTreeVO, DeptVO } from './../dept/types';
+import { DeptTreeVO } from './../dept/types';
 import { RoleVO } from '@/api/system/role/types';
 import request from '@/utils/request';
 import { AxiosPromise } from 'axios';

+ 6 - 5
src/views/system/post/index.vue

@@ -170,10 +170,9 @@
 </template>
 
 <script setup name="Post" lang="ts">
-import { listPost, addPost, delPost, getPost, updatePost } from '@/api/system/post';
+import { listPost, addPost, delPost, getPost, updatePost, deptTreeSelect } from '@/api/system/post';
 import { PostForm, PostQuery, PostVO } from '@/api/system/post/types';
-import { DeptVO } from '@/api/system/dept/types';
-import api from '@/api/system/user';
+import { DeptTreeVO, DeptVO } from '@/api/system/dept/types';
 
 const { proxy } = getCurrentInstance() as ComponentInternalInstance;
 const { sys_normal_disable } = toRefs<any>(proxy?.useDict('sys_normal_disable'));
@@ -186,7 +185,7 @@ const single = ref(true);
 const multiple = ref(true);
 const total = ref(0);
 const deptName = ref('');
-const deptOptions = ref<DeptVO[]>([]);
+const deptOptions = ref<DeptTreeVO[]>([]);
 const deptTreeRef = ref<ElTreeInstance>();
 const postFormRef = ref<ElFormInstance>();
 const queryFormRef = ref<ElFormInstance>();
@@ -212,6 +211,8 @@ const data = reactive<PageData<PostForm, PostQuery>>({
   queryParams: {
     pageNum: 1,
     pageSize: 10,
+    deptId: undefined,
+    belongDeptId: undefined,
     postCode: '',
     postName: '',
     postCategory: '',
@@ -245,7 +246,7 @@ watchEffect(
 
 /** 查询部门下拉树结构 */
 const getTreeSelect = async () => {
-  const res = await api.deptTreeSelect();
+  const res = await deptTreeSelect();
   deptOptions.value = res.data;
 };