Jelajahi Sumber

修改角色授权下角色视角的人员列表接口,改为searchable传参

林倩 3 tahun lalu
induk
melakukan
2bfd07f02f

+ 2 - 2
config/dev.env.js

@@ -34,8 +34,8 @@ module.exports = merge(prodEnv, {
     PROXY_TABLE: JSON.stringify({
         "/dcucauth": {
             // target: "http://10.11.1.237:8861"
-            // target: "http://10.254.11.203:8861"
-             target: "http://192.168.10.2:8871"
+            target: "http://10.254.11.203:8861"
+            //  target: "http://192.168.10.2:8871"
             //    target: "http://192.168.6.133:3471"
 
         }

+ 1 - 4
src/api/data-auth.js

@@ -13,10 +13,7 @@ const baseUrl = "/authsvr/v2/dataauth";
 export function getBusinessTagTree(data) {
     return request({
         url: `${baseUrl}/businessTreeList`,
-        method: "POST",
-        data: {
-            name: ""
-        }
+        method: "get"
     });
 }
 

+ 14 - 12
src/api/role-auth-info.js

@@ -5,9 +5,9 @@
 
  */
 
-import axios from "@/utils/req";
-import Qs from "qs";
-
+import axios from '@/utils/req';
+import request from '@/utils/request';
+import handleSearchCondition from '@/utils/searchable';
 const base = `/authsvr/v2/roleauthinfo`;
 
 //人员视图 --人员列表
@@ -16,12 +16,12 @@ export const staffUserPage = `${base}/staffUserPage/_search`;
 // 人员视图--角色列表
 
 export function getStaffRoleList(data) {
-    return axios.get(`${base}/staffRoleList`, data);
+  return axios.get(`${base}/staffRoleList`, data);
 }
 
 // 保存人员角色
 export function saveRoleStaff(data) {
-    return axios.post(`${base}/staff`, data);
+  return axios.post(`${base}/staff`, data);
 }
 
 // 角色视图 -- 全部应用列表
@@ -31,22 +31,24 @@ export const roleViewApplication = `/authsvr/v2/applicationinfo/appQutoList/all`
 export const getRoleListByAppid = `${base}/roleRoleList/_search`;
 
 // 角色视图 -- 人员列表
-export function persionListByOrgRole(params) {
-    return axios.post(`${base}/roleStaffList/_search`, Qs.stringify(params), {
-        headers: { "Content-Type": "application/x-www-form-urlencoded" }
-    });
+export function persionListByOrgRole({page, size, searchCondition}) {
+  return request({
+    url: `${base}/roleStaffList/_search`,
+    method: 'POST',
+    data: handleSearchCondition({ page, size, searchCondition })
+  });
 }
 // 角色视图 --  勾选人员
 export function getChecked(params) {
-    return axios.get(`${base}/checked`, params);
+  return axios.get(`${base}/checked`, params);
 }
 
 // 角色视图 -保存
 export function savePersion(data) {
-    return axios.post(`${base}/role`, data);
+  return axios.post(`${base}/role`, data);
 }
 
 // 业务域
 export function getBusiness(value) {
-    return axios.get(`/duceap/v2/resource/codelist/code/DM_ROLE_LEVEL`);
+  return axios.get(`/duceap/v2/resource/codelist/code/DM_ROLE_LEVEL`);
 }

+ 50 - 15
src/pages/appfun-auth-manage/role-auth-manage/roleView.vue

@@ -34,15 +34,13 @@
         <dg-table
           ref="userConditionTable"
           :data="persionListData"
-          :pagination="false"
-          max-height="560px"
           row-key="id"
           @selection-change="handleSelectChange"
         >
           <dg-table-column type="selection" width="50"></dg-table-column>
           <dg-table-column prop="name" align="center" width="120" label="姓名"></dg-table-column>
           <dg-table-column prop="idcard" align="center" label="身份证号码"></dg-table-column>
-           <dg-table-column prop="orgName" align="center" label="单位名称"></dg-table-column>
+          <dg-table-column prop="orgName" align="center" label="单位名称"></dg-table-column>
           <dg-table-column prop="policeCategory" align="center" code="T_MD_POLICE_TYPE" label="警种"></dg-table-column>
           <dg-table-column prop="policeBusiness" align="center" label="业务域标签"></dg-table-column>
           <dg-table-column label="权限有效期" width="120" align="center">
@@ -103,18 +101,49 @@ export default {
       roleTableHeader: [
         { label: '角色名称', prop: 'name' },
         { label: '角色层级', prop: 'roleLevel', code: 'DM_ROLE_LEVEL' },
-         { label: '应用系统名称', prop: '' },
+        { label: '应用系统名称', prop: '' },
         { label: '警种', prop: 'policeCategory', code: 'T_MD_POLICE_TYPE' },
         { label: '业务域标签', prop: 'roleBusiness', code: 'DM_POLICE_BUSINESS' }
       ],
       roleTableUrl: roleAuthApi.getRoleListByAppid,
-      userConditionForm,
+      userConditionForm: [
+        {
+          label: '单位名称',
+          name: 'orgId',
+          op: '=',
+          value: '',
+          apiName: 'getTree',
+          nodeKey: 'id',
+          type: 'APP',
+          component: 'SelectOrgTree',
+          placeholder: '请选择单位名称'
+        },
+        {
+          label: '姓名',
+          name: 'name',
+          op: 'like',
+          value: '',
+          component: 'ElInput',
+          attr: {
+            style: 'width: 130px'
+          }
+        }
+      ],
       userOptList: ['保存'],
       persionListData: [],
       userCondition: {
-        orgId: '',
-        roleId: '',
-        name: ''
+        roleId: {
+          value: '',
+          op: '='
+        },
+        orgId: {
+          value: '',
+          op: '='
+        },
+        name: {
+          value: '',
+          op: 'like'
+        }
       },
       checkedPersionData: [],
       deleteIds: [],
@@ -128,7 +157,9 @@ export default {
         staffList: '',
         staffJson: '',
         delStaffJson: ''
-      }
+      },
+      page: 0, 
+      size: 10
     };
   },
   // 计算属性
@@ -151,15 +182,14 @@ export default {
     },
     receiveUserSearch(val) {
       for (const key in val) {
-        this.userCondition[key] = val[key].value;
+        this.userCondition[key].value = val[key].value;
       }
-      delete this.userCondition.name;
-      this.saveRoleAuthParams.orgId = this.userCondition.orgId;
+      this.saveRoleAuthParams.orgId = this.userCondition.orgId.value;
       this.handleUserSearch();
     },
 
     handleRoleRowClick({ id }) {
-      this.saveRoleAuthParams.roleId = this.userCondition.roleId = id;
+      this.saveRoleAuthParams.roleId = this.userCondition.roleId.value = id;
       // 如果选择机构
       if (this.saveRoleAuthParams.orgId) {
         this.handleUserSearch(); // 人员列表查询
@@ -193,17 +223,22 @@ export default {
         appId,
         type: 'role'
       };
+      const userParams = {
+        page: this.page,
+        size: this.size,
+        searchCondition: this.userCondition
+      }
 
       that.persionListData = [];
       that.checkedPersionData = [];
       that.deleteIds = [];
       // 人员列表和选中人员
       Promise.all([
-        roleAuthApi.persionListByOrgRole(this.userCondition),
+        roleAuthApi.persionListByOrgRole(userParams),
         roleAuthApi.getChecked(queryCheckedParams)
       ]).then((res) => {
         // console.log(res);
-        that.persionListData = res[0];
+        that.persionListData = res[0].data.content;
         that.persionListData.map((item) => {
           that.$set(item, 'activeTime', '长期');
           // item["activeTime"] = "长期"; //列表一开始写死