Browse Source

Merge branch 'master' of http://120.26.64.82:3000/BFFE/CABaggageData2.0

zhongxiaoyu 2 years ago
parent
commit
6193e36bed

+ 1 - 0
package.json

@@ -15,6 +15,7 @@
   },
   "dependencies": {
     "axios": "0.18.1",
+    "blueimp-md5": "^2.19.0",
     "core-js": "3.6.5",
     "crypto-js": "^4.1.1",
     "echarts": "^5.2.0",

+ 21 - 7
public/config.js

@@ -16,6 +16,10 @@ const DATACONTENT_ID = {
   /***-----登录------***/
   loginId: 36, //登录-获取权限-id
 
+  /***-----高级查询------***/
+  baggageTypeId: 86, //高级查询-特殊行李类型下拉选项查询-id
+  advacedQueryId: 30, //高级查询-数据查询-id
+
   /***-----账号管理------***/
   accountTableId: 38, //账号管理-首页-列表
   accountRoleId: 43, //账号管理-根据id查角色
@@ -77,13 +81,20 @@ const DATACONTENT_ID = {
   bagTableId: 55, //基础数据-特殊行李维护-表格-id
 
   // 数据统计
-  inOrOutId:52,//获取进离岗下拉ID
-  AirlineId:53,//获取航线下拉ID
-  AreaId:54,//获取大区下拉ID
-  AirportId:55,//获取航站下拉ID
-  TerminalId:56,//获取航站楼下拉ID
-  byAreaId:50,//根据大区统计ID
-  byOtherId:49,//获取大区以外统计ID
+  // inOrOutId: 246,//获取进离岗下拉ID
+  // AirlineId: 247,//获取航线下拉ID
+  // AreaId: 248,//获取大区下拉ID
+  // AirportId: 249,//获取航站下拉ID
+  // TerminalId: 250,//获取航站楼下拉ID
+  // byAreaId: 244,//根据大区统计ID
+  // byOtherId: 243,//获取大区以外统计ID
+  inOrOutId: 52,//获取进离岗下拉ID
+  AirlineId: 53,//获取航线下拉ID
+  AreaId: 54,//获取大区下拉ID
+  AirportId: 55,//获取航站下拉ID
+  TerminalId: 56,//获取航站楼下拉ID
+  byAreaId: 50,//根据大区统计ID
+  byOtherId: 49,//获取大区以外统计ID
   baggageStatistics: 251, // 获取行李统计
   nodeStatistics: 252 // 获取节点统计
 };
@@ -92,8 +103,11 @@ const SERVICE_ID = {
   /***-----账号管理------***/
   accountScId: 17, //账号管理-增删改-id
   roleScId: 16, //账号管理-角色授权-增删改-id
+
   /***-----角色管理------***/
   roleMsgId: 14, //角色管理-增删改-id
+  roleMsgTreeId: 15, //角色管理-权限树-增删改-id
+  roleMsgAuthId: 20, //角色管理-权限树规则-增删改-id
 
   /***-----权限项管理------***/
   authScId: 13, //权限项管理-增删改-id

+ 4 - 0
src/App.vue

@@ -24,6 +24,10 @@ export default {
           sessionStorage.removeItem('collectionData')
           sessionStorage.removeItem('editIBMMQ')
         }
+        this.$store.dispatch("auth/changeAuthMsg", []);
+        this.$store.dispatch("auth/changeAuthArrs", []);
+        this.$store.dispatch("auth/changeAuthList", []);
+        this.$store.dispatch("auth/changeAuthId", null);
       },
       deep: true
     }

+ 2 - 2
src/api/newLogin.js

@@ -29,7 +29,7 @@ export function login (params) {
 //登出
 export function loginUp (params) {
   return request({
-    url: '/api/fs4a/Logout/v1',
+    url: '/foxlibc/sign-out',
     method: 'post',
     data: params
   })
@@ -38,7 +38,7 @@ export function loginUp (params) {
 //忘记密码
 export function changePassword (params) {
   return request({
-    url: '/api/fs4a/ForgetPwd/v1',
+    url: '/foxlibc/reset-passwd',
     method: 'post',
     data: params
   })

+ 28 - 55
src/components/permissiontree/index copy.vue

@@ -28,11 +28,7 @@
       <div class="paren_list">
         <ul>
           <li v-for="(item, index) in treeTitles" :key="index">
-            <div
-              class="up_type"
-              :class="active === index ? 'up_types' : 'up_type'"
-              @click="upActive(item, index)"
-            >
+            <div class="up_type" :class="active === index ? 'up_types' : 'up_type'" @click="upActive(item, index)">
               {{ item.AuthName }}
             </div>
           </li>
@@ -40,38 +36,16 @@
       </div>
       <div class="paren_cont">
         <el-scrollbar style="height: 100%">
-          <el-tree
-            :data="data"
-            show-checkbox
-            @check-change="currentChange"
-            @node-click="handleNodeClick"
-            :defaultProps="defaultProps"
-            :expand-on-click-node="false"
-            node-key="AuthId"
-            default-expand-all
-            ref="tree"
-            highlight-current
-          >
+          <el-tree :data="data" show-checkbox @check-change="currentChange" @node-click="handleNodeClick" :defaultProps="defaultProps" :expand-on-click-node="false" node-key="AuthId" default-expand-all ref="tree" highlight-current>
             <span class="custom-tree-node" slot-scope="{ data }">
               {{ data.AuthName }}
               <div class="logup">
-                <div
-                  class="one"
-                  v-if="
+                <div class="one" v-if="
                     data.AuthList != null && data.AuthList.ValidBegin != null
-                  "
-                ></div>
-                <div
-                  class="two"
-                  v-if="data.AuthList != null && data.AuthList.Action == '1'"
-                ></div>
-                <div
-                  class="four"
-                  v-if="data.AuthList != null && data.AuthList.Action == '2'"
-                ></div>
-                <div
-                  class="three"
-                  v-if="
+                  "></div>
+                <div class="two" v-if="data.AuthList != null && data.AuthList.Action == '1'"></div>
+                <div class="four" v-if="data.AuthList != null && data.AuthList.Action == '2'"></div>
+                <div class="three" v-if="
                     data.AuthList &&
                     (data.AuthList.EditCol ||
                       data.AuthList.DeleteRow ||
@@ -79,8 +53,7 @@
                       data.AuthList.NewCol ||
                       data.AuthList.QueryCol ||
                       data.AuthList.QueryRow)
-                  "
-                ></div>
+                  "></div>
               </div>
             </span>
           </el-tree>
@@ -104,7 +77,7 @@ export default {
       default: () => [],
     },
   },
-  data() {
+  data () {
     return {
       active: 0,
       data: [],
@@ -115,20 +88,20 @@ export default {
       },
       dataObj: {}, //上级权限指定树数据
       AuthArrList: [],//权限列表源数据
-      AuthList:[],//权限规则列表
-      checkedList:[]//选中的列表
+      AuthList: [],//权限规则列表
+      checkedList: []//选中的列表
     };
   },
   watch: {
     checkedKeys: {
-      handler(val) {
+      handler (val) {
         this.checkedList = val;
         this.$refs.tree.setCheckedKeys(val);
       },
       deep: true,
     },
     "$store.state.auth.authList": {
-      handler(val) {
+      handler (val) {
         this.AuthList = val;
         this.resetData();
       },
@@ -141,7 +114,7 @@ export default {
   },
   methods: {
     //获取权限列表
-    getDataList() {
+    getDataList () {
       GetAuthTree({ QueryName: "" }).then((result) => {
         if (result.code === 0 && result.returnData.length) {
           result.returnData.forEach((item) => {
@@ -156,16 +129,16 @@ export default {
       });
     },
     //数据转树形
-    toTree() {
+    toTree () {
       this.data = [];
       this.dataObj = {};
-      this.treeTitles =[];
+      this.treeTitles = [];
       let arr = null
       arr = translateDataToTreeAll(
-          this.AuthArrList,
-          "UpAuthId",
-          "AuthId"
-        )
+        this.AuthArrList,
+        "UpAuthId",
+        "AuthId"
+      )
       let items = null
       items = {
         AuthId: 0,
@@ -190,21 +163,21 @@ export default {
       this.treeTitles = datas;
     },
     //数据切换
-    upActive(item, index) {
+    upActive (item, index) {
       this.active = index;
       this.decompose([this.dataObj], item.AuthId);
       this.$refs.tree.setCheckedKeys(this.checkedList);
     },
     // 树节点选中
-    currentChange() {
+    currentChange () {
       this.checkedList = [],
-       this.$refs.tree.getCheckedNodes().forEach(item =>{
-         this.checkedList.push(item.AuthId);
-       })
+        this.$refs.tree.getCheckedNodes().forEach(item => {
+          this.checkedList.push(item.AuthId);
+        })
       this.$emit("getTreeData", this.$refs.tree.getCheckedNodes());
     },
     //获取指定数据
-    decompose(data, id) {
+    decompose (data, id) {
       for (let i = 0; i < data.length; i++) {
         if (data[i].AuthId == id) {
           this.data = [data[i]];
@@ -214,7 +187,7 @@ export default {
       }
     },
     //获取权限规则 从新组合数据
-    resetData() {
+    resetData () {
       this.AuthArrList.forEach((item1) => {
         item1["AuthList"] = null;
         this.AuthList.forEach((item2) => {
@@ -226,7 +199,7 @@ export default {
       this.toTree();
     },
     //获取点击目标
-    handleNodeClick(data){
+    handleNodeClick (data) {
       // this.toTree();
       this.$store.state.auth.authId = data;
     }

+ 134 - 69
src/components/permissiontree/index.vue

@@ -3,7 +3,7 @@
     <!-- 权限树 -->
     <div class="cont">
       <div class="paren_header">
-        <p class="manageTitle">{{ title }}</p>
+        <p>{{ title }}</p>
       </div>
       <div class="paren_type">
         <ul>
@@ -40,21 +40,22 @@
       </div> -->
       <div class="paren_cont">
         <el-scrollbar style="height: 100%">
-          <el-tree :data="data" show-checkbox @check-change="currentChange" @node-click="handleNodeClick" :defaultProps="defaultProps" node-key="auth_id" default-expand-all ref="tree" highlight-current>
+          <!-- <el-tree :data="data" show-checkbox :check-strictly="true" @check-change="currentChange" @node-click="handleNodeClick" :defaultProps="defaultProps" :expand-on-click-node="false" node-key="AuthId" default-expand-all ref="tree" highlight-current> -->
+          <el-tree :data="data" show-checkbox @check="currentChange" :default-expanded-keys="defaultExpandedKeys" @node-click="handleNodeClick" :defaultProps="defaultProps" node-key="auth_id" ref="tree" highlight-current>
             <span class="custom-tree-node" slot-scope="{ data }">
               {{ data.auth_name }}
               <div class="logup">
-                <div class="one" v-if="data.AuthList && data.AuthList.ValidBegin"></div>
+                <!-- <div class="one" v-if="data.AuthList && data.AuthList.ValidBegin"></div>
                 <div class="two" v-if="data.AuthList && data.AuthList.Action == '1'"></div>
-                <div class="four" v-if="data.AuthList && data.AuthList.Action == '2'"></div>
+                <div class="four" v-if="data.AuthList && data.AuthList.Action == '2'"></div> -->
                 <div class="three" v-if="
                     data.AuthList &&
-                    (data.AuthList.EditCol ||
-                      data.AuthList.DeleteRow ||
-                      data.AuthList.EditRow ||
-                      data.AuthList.NewCol ||
-                      data.AuthList.QueryCol ||
-                      data.AuthList.QueryRow)
+                    (data.AuthList.EditCol || data.EditCol ||
+                      data.AuthList.DeleteRow || data.DeleteRow ||
+                      data.AuthList.EditRow || data.EditRow ||
+                      data.AuthList.NewCol || data.NewCol ||
+                      data.AuthList.QueryCol || data.QueryCol ||
+                      data.AuthList.QueryRow || data.QueryRow)
                   "></div>
               </div>
             </span>
@@ -69,14 +70,19 @@
 import { translateDataToTreeAll, deteleObject } from "@/utils/validate";
 import { GetAuthTree } from "@/api/apiAuthority";
 import { GetAuthTreeByGroup } from "@/api/AccountGroup";
-import { Query, GeneralDataReception } from "@/api/dataIntegration";
 import { organizationUptree, postUptree } from "@/api/postInterface";
+import { GeneralDataReception, Query } from '@/api/dataIntegration';
 export default {
   props: {
     title: {
       type: String,
       default: "",
     },
+    checkedKeys: {
+      //已选中
+      type: Array,
+      default: () => [],
+    },
     //查询类型:queryType: all/获取全部权限树;job/根据岗位获取权限树;origin/根据组织获取权限树;group/根据帐号组获取权限树;
     queryType: {
       type: String,
@@ -89,7 +95,7 @@ export default {
     },
     queryIds: {
       type: Array,
-      default: () => [],
+      default: () => []
     },
     //要查询的查询ID
     isMainJob: {
@@ -104,7 +110,7 @@ export default {
       treeTitles: [],
       defaultProps: {
         children: "children",
-        label: "AuthName",
+        label: "auth_name",
       },
       searchId: "",
       dataObj: {}, //上级权限指定树数据
@@ -113,15 +119,16 @@ export default {
       checkedList: [], //选中的列表
       oldType: "",
       queryIdArr: [], //历史查询ID
-      MainJobId: "", //主岗ID
-      checkedKeys: []
+      MainJobId: "",//主岗ID
+      defaultExpandedKeys: [-1],
+      treeChecks: [],
     };
   },
   watch: {
     checkedKeys: {
       handler (val) {
         this.checkedList = val;
-        this.$refs.tree.setCheckedKeys(this.checkedList);
+        this.treeChecks = val;
       },
       deep: true,
     },
@@ -139,20 +146,49 @@ export default {
     },
     queryId: {
       handler (val) {
-        this.searchId = val;
-        this.getDefaultDataList();
+        if (this.queryType == "job") {
+          this.setDisabledAll();
+          let ids = val.split(",");
+          this.queryIdArr = [];
+          this.$refs.tree.setCheckedKeys([]);
+          if (this.isMainJob == true) {
+            this.MainJobId = val;
+          }
+          if (this.MainJobId != "") {
+            this.queryIdArr.push(this.MainJobId);
+          }
+          for (let i = 0; i < ids.length; i++) {
+            if (_.indexOf(this.queryIdArr, ids[i]) == -1) {
+              this.queryIdArr.push(ids[i]);
+            }
+          }
+          for (let j = 0; j < this.queryIdArr.length; j++) {
+            this.searchId = this.queryIdArr[j];
+            this.getDefaultDataList();
+          }
+        } else {
+          this.searchId = val;
+          this.getDefaultDataList();
+        }
       },
-      immediate: true,
       deep: true,
     },
     queryIds: {
       handler () {
-        this.getDefaultDataList();
+        this.getDefaultDataList()
       },
-      deep: true,
+      deep: true
     },
+    treeChecks: {
+      handler (val) {
+        if (val && val.length) {
+          this.$refs.tree.setCheckedKeys(val);
+        }
+      },
+      deep: true
+    }
   },
-  created: function () {
+  created () {
     this.getDataList();
     this.searchId = this.queryId;
   },
@@ -170,50 +206,59 @@ export default {
       }, 100);
     },
     //获取权限列表
-    async getDataList () {
-      const res = await Query({
-        id: 40,
-        dataContent: [""]
+    getDataList () {
+      Query({
+        id: DATACONTENT_ID.authTreeId,
+        dataContent: ['']
+      }).then((result) => {
+        // this.getDefaultDataList();
+        this.setUnDisabledData(result.returnData.listValues);
+        this.setData(result);
       });
-      if (res.code === "0") {
-        this.setData(res.returnData.listValues);
-      } else {
-        this.$message.error(res.message);
-        this.loading = false;
-      }
-      this.setData(res);
     },
     async getDefaultDataList () {
-      try {
-        const res = await Query({
-          id: DATACONTENT_ID.roleAuthId,
-          dataContent: [this.searchId]
+      if (this.queryType == "all" && this.searchId != "") {
+        //获取全部权限树
+        Query({
+          id: DATACONTENT_ID.authTreeId,
+          dataContent: ['']
+        }).then((result) => {
+          this.setUnDisabledData(result.returnData.listValues);
+        });
+      } else if (this.queryType == "job") {
+        //根据岗位获取权限树
+        postUptree({ JobId: this.searchId }).then((result) => {
+          this.setUnDisabledData(result.returnData.listValues);
+        });
+      } else if (this.queryType == "origin") {
+        //根据组织获取权限树
+        this.AuthList = [];
+        this.$refs.tree.setCheckedKeys([])
+        organizationUptree({ OrganId: this.searchId }).then((result) => {
+          this.setUnDisabledData(result.returnData.listValues);
         });
-        if (res.code == 0) {
-          this.checkedKeys = [];
-          res.returnData.listValues.forEach(item => {
-            this.checkedKeys.push(item.AuthId)
-            this.AuthArrList.forEach(item2 => {
-              if (item.AuthId == item2.auth_id) {
-                item2.AuthList = item
-              }
-            })
+      } else if (this.queryType == "group") {
+        //根据帐号组获取权限树
+        if (this.searchId) {
+          GetAuthTreeByGroup({ GroupIds: [this.searchId] }).then((result) => {
+            this.setUnDisabledData(result.returnData.listValues);
+          });
+        } else if (this.queryIds.length && this.queryIds[0] !== -1) {
+          GetAuthTreeByGroup({ GroupIds: this.queryIds }).then((result) => {
+            this.setUnDisabledData(result.returnData.listValues)
           })
-          this.toTree()
-        } else {
-          this.$message.error(res.message);
-          this.loading = false;
         }
-      } catch (error) {
-        console.log("出错了", error);
       }
     },
     setData (result) {
-      if (result.code === "0" && result.returnData.listValues.length) {
+      if (result.code == 0 && result.returnData.listValues.length) {
         this.AuthArrList = [];
         result.returnData.listValues.forEach((item) => {
-          item.flag = item.auth_status === true ? true : false;
+          item.flag = item.auth_status;
           item["AuthList"] = null;
+          if (this.queryType != "all") {
+            item["disabled"] = true;
+          }
         });
         this.AuthArrList = _.cloneDeep(result.returnData.listValues);
         this.toTree();
@@ -230,11 +275,13 @@ export default {
       arr = translateDataToTreeAll(this.AuthArrList, "up_auth_id", "auth_id");
       let items = null;
       items = {
-        auth_id: 0,
+        auth_id: -1,
         auth_name: "所有权限",
+        QueryTarget: 0,
         auth_status: 0,
-        up_auth_id: 0,
+        up_auth_id: -2,
         auth_type: 0,
+        disabled: true,
         children: arr,
       };
       this.dataObj = _.cloneDeep(items);
@@ -242,14 +289,13 @@ export default {
       let obj = null;
       obj = _.cloneDeep(items);
       let datas = null;
-      datas = obj.children.filter((item) => item.Type === 1);
+      datas = obj.children.filter((item) => item.auth_type == 1);
       datas.forEach((item) => {
         delete item.children;
       });
       delete obj.children;
       datas.unshift(obj);
       this.treeTitles = datas;
-      console.log(datas)
       if (this.$refs.tree) {
         this.$refs.tree.setCheckedKeys(this.checkedList);
       }
@@ -257,26 +303,46 @@ export default {
     //数据切换
     upActive (item, index) {
       this.active = index;
-      this.decompose([this.dataObj], item.AuthId);
+      this.decompose([this.dataObj], item.auth_id);
       this.$refs.tree.setCheckedKeys(this.checkedList);
     },
     // 树节点选中
     currentChange () {
       this.checkedList = [];
-      const arr = this.$refs.tree.getCheckedNodes();
-      arr.forEach((item) => {
+      const datas = this.$refs.tree.getCheckedNodes();
+      // const arr = this.$refs.tree.getCheckedNodes();
+      // const half = this.$refs.tree.getHalfCheckedNodes();
+      // const halfAll = half.filter(item => item.auth_id != -1 && item.auth_name != '所有权限');
+      // const datas = halfAll.concat(arr);
+      // if (this.treeChecks && this.treeChecks.length) {
+      //   const checks = [];
+      //   datas.forEach(item => {
+      //     checks.push(item.auth_id);
+      //   })
+      //   const handAll = [...checks, ...this.treeChecks].filter(t => {
+      //     return !(checks.includes(t) && this.treeChecks.includes(t));
+      //   })
+      //   setTimeout(() => {
+      //     handAll.map(item => {
+      //       this.$refs.tree.setChecked(item, false);
+      //       this.treeChecks = [];
+      //     })
+      //   }, 100);
+
+      // }
+      datas.forEach((item) => {
         // if(item.disabled==false){
-        this.checkedList.push(item.AuthId);
+        this.checkedList.push(item.auth_id);
         // }
       });
-      this.setDataObj(arr);
+      this.setDataObj(datas);
     },
     // 选中后设置初始数据
     setDataObj (arr) {
       arr.forEach((item) => {
         if (!item.AuthList) {
           item.AuthList = {
-            AuthId: item.AuthId,
+            AuthId: item.auth_id,
             ValidBegin: "",
             ValidEnd: "",
             Action: "1",
@@ -322,7 +388,7 @@ export default {
           item1.disabled = true;
         }
         ArrData.forEach((item2) => {
-          if (item1.AuthId == item2.AuthId && item1.Type != 1) {
+          if (item1.auth_id == item2.auth_id && item1.auth_type != 1) {
             item1.disabled = false;
           }
         });
@@ -333,7 +399,6 @@ export default {
     handleNodeClick (data) {
       // this.toTree();
       const arr = this.$store.getters.authArrs;
-      console.log(arr)
       arr.push(data);
       const datas = _.unionBy(arr, "auth_id");
       const newDatas = _.cloneDeep(datas);
@@ -342,10 +407,10 @@ export default {
       this.$store.dispatch("auth/changeAuthId", data.auth_id);
     },
     async setDisabledAll () {
-      this.AuthArrList.forEach((item) => {
+      this.AuthArrList.forEach(item => {
         item.disabled = true;
-      });
-    },
+      })
+    }
   },
 };
 </script>

+ 354 - 0
src/components/permissiontree/index1.vue

@@ -0,0 +1,354 @@
+<template>
+  <div class="bf-permissiontree">
+    <!-- 权限树 -->
+    <div class="cont">
+      <div class="paren_header">
+        <p class="manageTitle">{{ title }}</p>
+      </div>
+      <div class="paren_type">
+        <ul>
+          <li>
+            <div class="log"></div>
+            <p>时效规则有</p>
+          </li>
+          <li>
+            <div class="log"></div>
+            <p>数据规则有</p>
+          </li>
+          <li>
+            <div class="log"></div>
+            <p>显示及编辑权限</p>
+          </li>
+          <li>
+            <div class="log"></div>
+            <p>显示权限</p>
+          </li>
+        </ul>
+      </div>
+      <!-- <div class="paren_list">
+        <ul>
+          <li v-for="(item, index) in treeTitles" :key="index">
+            <div
+              class="up_type"
+              :class="active === index ? 'up_types' : 'up_type'"
+              @click="upActive(item, index)"
+            >
+              {{ item.AuthName }}
+            </div>
+          </li>
+        </ul>
+      </div> -->
+      <div class="paren_cont">
+        <el-scrollbar style="height: 100%">
+          <el-tree :data="data" show-checkbox @check-change="currentChange" @node-click="handleNodeClick" :defaultProps="defaultProps" node-key="auth_id" default-expand-all ref="tree" highlight-current>
+            <span class="custom-tree-node" slot-scope="{ data }">
+              {{ data.auth_name }}
+              <div class="logup">
+                <div class="one" v-if="data.AuthList && data.AuthList.ValidBegin"></div>
+                <div class="two" v-if="data.AuthList && data.AuthList.Action == '1'"></div>
+                <div class="four" v-if="data.AuthList && data.AuthList.Action == '2'"></div>
+                <div class="three" v-if="
+                    data.AuthList &&
+                    (data.AuthList.EditCol ||
+                      data.AuthList.DeleteRow ||
+                      data.AuthList.EditRow ||
+                      data.AuthList.NewCol ||
+                      data.AuthList.QueryCol ||
+                      data.AuthList.QueryRow)
+                  "></div>
+              </div>
+            </span>
+          </el-tree>
+        </el-scrollbar>
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+// import treeData from "@/views/authorityManagement/minixs/treeData";
+import { translateDataToTreeAll, deteleObject } from "@/utils/validate";
+import { GetAuthTree } from "@/api/apiAuthority";
+import { GetAuthTreeByGroup } from "@/api/AccountGroup";
+import { Query, GeneralDataReception } from "@/api/dataIntegration";
+import { organizationUptree, postUptree } from "@/api/postInterface";
+export default {
+  props: {
+    title: {
+      type: String,
+      default: "",
+    },
+    //查询类型:queryType: all/获取全部权限树;job/根据岗位获取权限树;origin/根据组织获取权限树;group/根据帐号组获取权限树;
+    queryType: {
+      type: String,
+      default: "all",
+    },
+    //要查询的查询ID
+    queryId: {
+      type: String | Number,
+      default: "",
+    },
+    queryIds: {
+      type: Array,
+      default: () => [],
+    },
+    //要查询的查询ID
+    isMainJob: {
+      type: Boolean,
+      default: true,
+    },
+  },
+  data () {
+    return {
+      active: 0,
+      data: [],
+      treeTitles: [],
+      defaultProps: {
+        children: "children",
+        label: "AuthName",
+      },
+      searchId: "",
+      dataObj: {}, //上级权限指定树数据
+      AuthArrList: [], //权限列表源数据
+      AuthList: [], //权限规则列表
+      checkedList: [], //选中的列表
+      oldType: "",
+      queryIdArr: [], //历史查询ID
+      MainJobId: "", //主岗ID
+      checkedKeys: []
+    };
+  },
+  watch: {
+    checkedKeys: {
+      handler (val) {
+        this.checkedList = val;
+        this.$refs.tree.setCheckedKeys(this.checkedList);
+      },
+      deep: true,
+    },
+    "$store.state.auth.authList": {
+      handler (val) {
+        if (val && val.length) {
+          this.AuthList = val;
+          this.resetData();
+        } else {
+          this.getAuthList();
+        }
+      },
+      immediate: true,
+      deep: true,
+    },
+    queryId: {
+      handler (val) {
+        this.searchId = val;
+        this.getDefaultDataList();
+      },
+      immediate: true,
+      deep: true,
+    },
+    queryIds: {
+      handler () {
+        this.getDefaultDataList();
+      },
+      deep: true,
+    },
+  },
+  created: function () {
+    this.getDataList();
+    this.searchId = this.queryId;
+  },
+  methods: {
+    getAuthList () {
+      let arr = [];
+      setTimeout(() => {
+        arr = this.$store.getters.authList;
+        if (arr && arr.length) {
+          this.AuthList = arr;
+          this.resetData();
+        } else {
+          this.getAuthList();
+        }
+      }, 100);
+    },
+    //获取权限列表
+    async getDataList () {
+      const res = await Query({
+        id: 40,
+        dataContent: [""]
+      });
+      if (res.code === "0") {
+        this.setData(res.returnData.listValues);
+      } else {
+        this.$message.error(res.message);
+        this.loading = false;
+      }
+      this.setData(res);
+    },
+    async getDefaultDataList () {
+      try {
+        const res = await Query({
+          id: DATACONTENT_ID.roleAuthId,
+          dataContent: [this.searchId]
+        });
+        if (res.code == 0) {
+          this.checkedKeys = [];
+          res.returnData.listValues.forEach(item => {
+            this.checkedKeys.push(item.AuthId)
+            this.AuthArrList.forEach(item2 => {
+              if (item.AuthId == item2.auth_id) {
+                item2.AuthList = item
+              }
+            })
+          })
+          this.toTree()
+        } else {
+          this.$message.error(res.message);
+          this.loading = false;
+        }
+      } catch (error) {
+        console.log("出错了", error);
+      }
+    },
+    setData (result) {
+      if (result.code === "0" && result.returnData.listValues.length) {
+        this.AuthArrList = [];
+        result.returnData.listValues.forEach((item) => {
+          item.flag = item.auth_status === true ? true : false;
+          item["AuthList"] = null;
+        });
+        this.AuthArrList = _.cloneDeep(result.returnData.listValues);
+        this.toTree();
+      } else {
+        this.$message.error(result.message);
+      }
+    },
+    //数据转树形
+    toTree () {
+      this.data = [];
+      this.dataObj = {};
+      this.treeTitles = [];
+      let arr = null;
+      arr = translateDataToTreeAll(this.AuthArrList, "up_auth_id", "auth_id");
+      let items = null;
+      items = {
+        auth_id: 0,
+        auth_name: "所有权限",
+        auth_status: 0,
+        up_auth_id: 0,
+        auth_type: 0,
+        children: arr,
+      };
+      this.dataObj = _.cloneDeep(items);
+      this.data = [items];
+      let obj = null;
+      obj = _.cloneDeep(items);
+      let datas = null;
+      datas = obj.children.filter((item) => item.Type === 1);
+      datas.forEach((item) => {
+        delete item.children;
+      });
+      delete obj.children;
+      datas.unshift(obj);
+      this.treeTitles = datas;
+      console.log(datas)
+      if (this.$refs.tree) {
+        this.$refs.tree.setCheckedKeys(this.checkedList);
+      }
+    },
+    //数据切换
+    upActive (item, index) {
+      this.active = index;
+      this.decompose([this.dataObj], item.AuthId);
+      this.$refs.tree.setCheckedKeys(this.checkedList);
+    },
+    // 树节点选中
+    currentChange () {
+      this.checkedList = [];
+      const arr = this.$refs.tree.getCheckedNodes();
+      arr.forEach((item) => {
+        // if(item.disabled==false){
+        this.checkedList.push(item.AuthId);
+        // }
+      });
+      this.setDataObj(arr);
+    },
+    // 选中后设置初始数据
+    setDataObj (arr) {
+      arr.forEach((item) => {
+        if (!item.AuthList) {
+          item.AuthList = {
+            AuthId: item.AuthId,
+            ValidBegin: "",
+            ValidEnd: "",
+            Action: "1",
+            QueryRow: "",
+            QueryCol: "",
+            NewCol: "",
+            EditRow: "",
+            EditCol: "",
+            DeleteRow: "",
+          };
+        }
+      });
+      this.$emit("getTreeData", arr);
+    },
+    //获取指定数据
+    decompose (data, id) {
+      for (let i = 0; i < data.length; i++) {
+        if (data[i].auth_id == id) {
+          this.data = [data[i]];
+        } else if (data[i].children && data[i].children.length > 0) {
+          this.decompose(data[i].children, id);
+        }
+      }
+    },
+    //获取权限规则 从新组合数据
+    resetData () {
+      if (this.AuthList) {
+        this.AuthArrList.forEach((item1) => {
+          item1["AuthList"] = null;
+          this.AuthList.forEach((item2) => {
+            if (item1.auth_id == item2.auth_id) {
+              item1.AuthList = item2;
+            }
+          });
+        });
+      }
+      this.toTree();
+    },
+    setUnDisabledData (data) {
+      const ArrData = _.cloneDeep(data);
+      this.AuthArrList.forEach((item1) => {
+        if (this.queryType != "job") {
+          item1.disabled = true;
+        }
+        ArrData.forEach((item2) => {
+          if (item1.AuthId == item2.AuthId && item1.Type != 1) {
+            item1.disabled = false;
+          }
+        });
+      });
+      this.toTree();
+    },
+    //获取点击目标
+    handleNodeClick (data) {
+      // this.toTree();
+      const arr = this.$store.getters.authArrs;
+      console.log(arr)
+      arr.push(data);
+      const datas = _.unionBy(arr, "auth_id");
+      const newDatas = _.cloneDeep(datas);
+      this.$store.dispatch("auth/changeAuthMsg", newDatas);
+      this.$store.dispatch("auth/changeAuthArrs", datas);
+      this.$store.dispatch("auth/changeAuthId", data.auth_id);
+    },
+    async setDisabledAll () {
+      this.AuthArrList.forEach((item) => {
+        item.disabled = true;
+      });
+    },
+  },
+};
+</script>
+<style lang="scss">
+@import "./permissiontree.scss";
+</style>

+ 29 - 74
src/components/rulesofcompetency/index.vue

@@ -4,89 +4,44 @@
     <div class="right">
       <div class="paren_header">
         <p class="manageTitle">{{ title }}</p>
-        <div class="header_right">
-          <el-radio
-            v-model="form.radio"
-            :label="item.id"
-            v-for="(item, index) in option"
-            :key="index"
-            >{{ item.label }}</el-radio
-          >
-        </div>
+        <!-- <div class="header_right">
+          <el-radio v-model="form.radio" :label="item.id" v-for="(item, index) in option" :key="index">{{ item.label }}</el-radio>
+        </div> -->
       </div>
       <div class="form">
-        <div class="juris_list" :style="{ marginBottom: marginB }">
+        <!-- <div class="juris_list" :style="{ marginBottom: marginB }">
           <p>时效范围起</p>
-          <el-date-picker
-            v-model="form.firstWeeks"
-            type="datetime"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            placeholder="选择时间"
-            size="small"
-            :picker-options="pickerOptionsStart"
-          >
+          <el-date-picker v-model="form.firstWeeks" type="datetime" value-format="yyyy-MM-dd HH:mm:ss" placeholder="选择时间" size="small" :picker-options="pickerOptionsStart">
           </el-date-picker>
         </div>
         <div class="juris_list" :style="{ marginBottom: marginB }">
           <p>时效范围至</p>
-          <el-date-picker
-            @change="setTime"
-            v-model="form.endWeeks"
-            value-format="yyyy-MM-dd HH:mm:ss"
-            type="datetime"
-            placeholder="选择时间"
-            size="small"
-            :picker-options="pickerOptionsEnd"
-          >
+          <el-date-picker @change="setTime" v-model="form.endWeeks" value-format="yyyy-MM-dd HH:mm:ss" type="datetime" placeholder="选择时间" size="small" :picker-options="pickerOptionsEnd">
           </el-date-picker>
-        </div>
+        </div> -->
         <div class="juris_list" :style="{ marginBottom: marginB }">
           <p>许可查询行</p>
-          <el-input
-            v-model="form.input1"
-            placeholder="请输入内容"
-            size="small"
-          ></el-input>
+          <el-input v-model="form.input1" placeholder="请输入内容" size="small"></el-input>
         </div>
         <div class="juris_list" :style="{ marginBottom: marginB }">
           <p>许可查询列</p>
-          <el-input
-            v-model="form.input2"
-            placeholder="请输入内容"
-            size="small"
-          ></el-input>
+          <el-input v-model="form.input2" placeholder="请输入内容" size="small"></el-input>
         </div>
         <div class="juris_list" :style="{ marginBottom: marginB }">
           <p>许可删除行</p>
-          <el-input
-            v-model="form.input3"
-            placeholder="请输入内容"
-            size="small"
-          ></el-input>
+          <el-input v-model="form.input3" placeholder="请输入内容" size="small"></el-input>
         </div>
         <div class="juris_list" :style="{ marginBottom: marginB }">
           <p>许可新增列</p>
-          <el-input
-            v-model="form.input4"
-            placeholder="请输入内容"
-            size="small"
-          ></el-input>
+          <el-input v-model="form.input4" placeholder="请输入内容" size="small"></el-input>
         </div>
         <div class="juris_list" :style="{ marginBottom: marginB }">
           <p>许可编辑行</p>
-          <el-input
-            v-model="form.input5"
-            placeholder="请输入内容"
-            size="small"
-          ></el-input>
+          <el-input v-model="form.input5" placeholder="请输入内容" size="small"></el-input>
         </div>
         <div class="juris_list" :style="{ marginBottom: marginB }">
           <p>许可编辑列</p>
-          <el-input
-            v-model="form.input6"
-            placeholder="请输入内容"
-            size="small"
-          ></el-input>
+          <el-input v-model="form.input6" placeholder="请输入内容" size="small"></el-input>
         </div>
       </div>
     </div>
@@ -105,14 +60,14 @@ export default {
     },
     authTo: {
       type: Object,
-      default: () => {},
+      default: () => { },
     },
     authList: {
       type: Array,
       default: () => [],
     },
   },
-  data() {
+  data () {
     return {
       pickerOptionsStart: {
         disabledDate: (time) => {
@@ -157,7 +112,7 @@ export default {
   },
   watch: {
     authTo: {
-      handler(obj) {
+      handler (obj) {
         const {
           Action,
           ValidBegin,
@@ -182,21 +137,21 @@ export default {
       deep: true,
     },
     form: {
-      handler() {
+      handler () {
         this.getData();
       },
       deep: true,
     },
     authList: {
-      handler(arr) {
+      handler (arr) {
         this.$store.dispatch("auth/changeAuthList", arr);
       },
       deep: true,
     },
     "$store.state.auth.authMsg": {
-      handler(arr) {
+      handler (arr) {
         const id = this.$store.getters.authId;
-        const obj = arr.filter((item) => item.AuthId === id)[0];
+        const obj = arr.filter((item) => item.auth_id === id)[0];
         this.clearFormData();
         this.setFormData(obj);
       },
@@ -204,13 +159,13 @@ export default {
     },
   },
   methods: {
-    setTime() {
+    setTime () {
       if (this.form.endWeeks <= this.form.firstWeeks) {
         this.form.endWeeks = "";
         this.$message.error("结束时间不能小于开始时间,请重新选择");
       }
     },
-    getData() {
+    getData () {
       const obj = {
         Action: this.form.radio,
         ValidBegin: this.form.firstWeeks,
@@ -224,28 +179,28 @@ export default {
       };
       this.$emit("getData", obj);
       const arr = this.$store.getters.authArrs;
-      const datas = _.unionBy(arr, "AuthId");
+      const datas = _.unionBy(arr, "auth_id");
       const id = this.$store.getters.authId;
       // console.log(datas)
       if (datas.length) {
         // const dat = datas[datas.length - 1]
         let dat = datas[datas.length - 1];
         datas.map((item) => {
-          if (item.AuthId == id) {
+          if (item.auth_id == id) {
             dat = item;
           }
         });
-        const { AuthId } = dat;
-        obj["AuthId"] = AuthId;
+        const { auth_id } = dat;
+        obj["AuthId"] = auth_id;
         datas.forEach((item) => {
-          if (item.AuthId == id) {
+          if (item.auth_id == id) {
             item.AuthList = obj;
           }
         });
         this.$store.dispatch("auth/changeAuthArrs", datas);
       }
     },
-    clearFormData() {
+    clearFormData () {
       this.form.radio = "";
       this.form.firstWeeks = "";
       this.form.endWeeks = "";
@@ -256,7 +211,7 @@ export default {
       this.form.input5 = "";
       this.form.input6 = "";
     },
-    setFormData(obj) {
+    setFormData (obj) {
       let data = {};
       if (obj.AuthList) {
         data = obj.AuthList;

+ 9 - 7
src/layout/index.vue

@@ -46,9 +46,10 @@
 import { Navbar, Sidebar, AppMain } from "./components";
 import ResizeMixin from "./mixin/ResizeHandler";
 import { mapGetters } from "vuex";
-import { EditPwd } from "@/api/apiHome";
+import { changePassword } from "@/api/newLogin";
 import { removeToken } from "@/utils/auth";
 import Dialog from "@/layout/components/Dialog";
+import MD5 from 'blueimp-md5'
 export default {
   name: "Layout",
   components: {
@@ -143,19 +144,20 @@ export default {
       } else {
         sessionStorage.removeItem("userName");
         this.$store.dispatch("app/toggleOutflag", false);
-        await this.$store.dispatch("user/logout");
+        const res = await this.$store.dispatch("user/logout");
         this.$router.push(`/login?redirect=${this.$route.fullPath}`);
       }
     },
     //修改密码
     async editPwd () {
       try {
-        const res = await EditPwd({
-          LoginName: this.name,
-          LoginPwd: this.dataForm.old,
-          LoginPwdNew: this.dataForm.again,
+        const res = await changePassword({
+          username: this.name,
+          originPassword: this.dataForm.old,
+          // passwd: MD5(this.dataForm.again),
+          newPassword: this.dataForm.again,
         });
-        if (res.code === 0) {
+        if (res.code == 0) {
           this.$message.success(res.message);
           this.$store.dispatch("app/togglePwdflag", false);
           setTimeout(() => {

+ 2 - 3
src/store/modules/user.js

@@ -1,5 +1,4 @@
-import { loginUp } from '@/api/login'
-import { login } from '@/api/newLogin'
+import { login, loginUp } from '@/api/newLogin'
 import { getToken, setToken, removeToken, setUserId, TokenKey } from '@/utils/auth'
 import { resetRouter } from '@/router'
 
@@ -99,7 +98,7 @@ const actions = {
   // user logout
   logout ({ commit, state }) {
     return new Promise((resolve, reject) => {
-      loginUp({ "UserId": state.UserId, "UserType": state.UserType }).then(result => {
+      loginUp().then(result => {
         // sessionStorage.removeItem("userName");
         // sessionStorage.removeItem("UserType");
         // sessionStorage.removeItem("User_Id");

+ 1 - 1
src/utils/request-new.js

@@ -35,7 +35,7 @@ service.interceptors.request.use(
       // let each request carry token
       // ['X-Token'] is a custom headers key
       // please modify it according to the actual situation
-      config.headers['Token'] = getToken()
+      config.headers['Authorization'] = getToken()
     }
     return config
   },

+ 29 - 15
src/views/accountManagement/components/accountHome.vue

@@ -8,23 +8,23 @@
         <div class="status3"><span class="icon" />禁用</div>
       </div>
       <Search :is-slot="true" :is-title="false" @getSearchData="getSearchData" @clearSearchData="clearSearchData">
-        <el-button v-is="['userlist_btn_add','admin']" class="btnAdd" @click="addAccount">新增</el-button>
+        <el-button class="btnAdd" @click="addAccount">新增</el-button>
       </Search>
     </div>
     <div class="content-box scrollbar">
       <template v-if="accountArr.length">
         <el-row v-infinite-scroll="load" :infinite-scroll-disabled="disabled" :infinite-scroll-distance="20" :gutter="24">
-          <el-col v-for="account in accountArr" :key="account.user_id" :xs="24" :sm="12" :md="8" :lg="4" class="account-box">
+          <el-col v-for="(account,index) in accountArr" :key="index" :xs="24" :sm="12" :md="8" :lg="4" class="account-box">
             <div class="account-box-wrap">
               <div :class="account.user_status == 1 ? 'headOnline' : account.user_status == 2 ? 'headOffline' : 'headDisabled'" />
               <div>
                 <div class="nameBox flex">
                   <div class="flex-wrap">
                     <div class="name">{{ account.user_name }}</div>
-                    <div v-is="['userlist_btn_update','admin']" class="loger" @click="toEdit(account.user_id)" />
+                    <div class="loger" @click="toEdit(account.user_id)" />
                     <div @click="authAccount(account)" class="loger cap-auth"></div>
                   </div>
-                  <div v-is="['userlist_btn_del','admin']" class="del" @click="deleteUser(account)">
+                  <div class="del" @click="deleteUser(account)">
                     <i class="el-icon-close" />
                   </div>
                 </div>
@@ -58,6 +58,9 @@
           <p v-if="noMore" class="center">没有更多数据了~</p>
         </template>
       </template>
+      <template v-else>
+        <NoData />
+      </template>
     </div>
     <Dialog :flag="dialogVisible">
       <div class="del-dialog">
@@ -107,12 +110,14 @@
 <script>
 import Search from '@/layout/components/Search'
 import Dialog from '@/layout/components/Dialog'
+import NoData from '@/components/nodata'
 import { GetAccountList, ChangeUserStatus, delAccount, getAccountDetails, editAccount, addAccount } from '@/api/Account'
 import { pwdProduce } from '@/utils/validate'
 import { mapGetters } from 'vuex'
 import { GeneralDataReception, Query } from '@/api/dataIntegration'
+import MD5 from 'blueimp-md5'
 export default {
-  components: { Search, Dialog },
+  components: { Search, Dialog, NoData },
   data () {
     return {
       pwdStruc: '',
@@ -147,7 +152,8 @@ export default {
         ],
       },
       ruleFormObj: {},
-      roleId: ''
+      roleId: '',
+      msgIndex: null
     }
   },
   computed: {
@@ -212,6 +218,7 @@ export default {
     // 新增账号
     async saveAddAccount () {
       try {
+        this.ruleForm.user_pwd = MD5(this.ruleForm.user_pwd)
         const res = await GeneralDataReception({
           serviceId: SERVICE_ID.accountScId,
           dataContent: JSON.stringify(this.ruleForm)
@@ -259,8 +266,8 @@ export default {
     },
     // 滚动加载
     load () {
-      // this.PageIndex += 1
-      // this.accountList()
+      this.PageIndex += 1
+      this.accountList()
     },
     // 回到第一页
     pageInit () {
@@ -277,6 +284,7 @@ export default {
     // 清除查询
     clearSearchData () {
       this.searchInfo = ''
+      this.pageInit()
     },
     // 修改状态
     async userActiveToggle (item) {
@@ -336,12 +344,17 @@ export default {
         if (result.code == 0) {
           this.loading = false
           const newDatas = result.returnData.listValues
-          // console.log(newDatas[0])
-          this.pages = result.returnData.pages
-          newDatas.forEach(element => {
-            element.Flag = element.user_status == 1 ? true : false
-            this.accountArr.push(element)
-          })
+          if (newDatas && newDatas.length) {
+            this.pages = result.returnData.pages
+            newDatas.forEach(element => {
+              element.Flag = element.user_status == 1 ? true : false
+              this.accountArr.push(element)
+            })
+            this.msgIndex = this.PageIndex
+          } else {
+            this.pages = this.msgIndex
+            this.PageIndex = this.msgIndex
+          }
         } else {
           this.$message.error(result.message)
         }
@@ -439,6 +452,7 @@ export default {
       }
     }
     .account-box {
+      min-height: 140px;
       margin-bottom: 24px;
       .account-box-wrap {
         position: relative;
@@ -459,7 +473,7 @@ export default {
         top: 0;
       }
       .headOnline {
-        background: #6f81bc;
+        background: #2d67e3;
         width: 100%;
         height: 4px;
         box-shadow: 0px 6px 7px 0px rgba(0, 0, 0, 0.06);

+ 66 - 251
src/views/advancedQuery/views/advancedHome.vue

@@ -25,30 +25,11 @@
             @change="endDateChangeHandler"
           />
         </div> -->
-        <el-date-picker
-          v-model="FlightDate"
-          size="small"
-          type="daterange"
-          value-format="yyyy-MM-dd"
-          start-placeholder="开始日期"
-          end-placeholder="结束日期"
-          :picker-options="dateRangePickerOptions"
-        />
+        <el-date-picker v-model="FlightDate" size="small" type="daterange" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="dateRangePickerOptions" />
       </div>
-      <Search
-        ref="search"
-        class="advanced-search"
-        :is-title="false"
-        :is-slot="true"
-        :search-tooltip="'请输入航班号(示例:CA1234)或行李牌号(示例:1234567890)'"
-        @getSearchData="getSearchData"
-        @clearSearchData="clearSearchData"
-      >
+      <Search ref="search" class="advanced-search" :is-title="false" :is-slot="true" :search-tooltip="'请输入航班号(示例:CA1234)或行李牌号(示例:1234567890)'" @getSearchData="getSearchData" @clearSearchData="clearSearchData">
         <div class="flex-wrap">
-          <button
-            class="btnAn"
-            @click="dialogShow"
-          >高级查询</button>
+          <button class="btnAn" @click="dialogShow">高级查询</button>
           <!-- <div
             class="setting"
             @click="show"
@@ -57,47 +38,11 @@
       </Search>
     </div>
     <!--表格-->
-    <div
-      v-loading="loading"
-      element-loading-text="拼命加载中"
-      element-loading-spinner="el-icon-loading"
-      element-loading-background="rgba(0, 0, 0, 0.8)"
-      class="advance__table"
-    >
-      <el-table
-        ref="table"
-        max-height="100%"
-        class="table"
-        :data="dealedTableData"
-        border
-        stripe
-        fit
-        height="calc(100vh - 158px)"
-        style="width: 100%"
-        show-summary
-        :summary-method="summaryRow(tableData.length)"
-        :header-cell-class-name="headerCellClass"
-        :row-class-name="tableRowClassName"
-        :cell-class-name="cellClass"
-        :span-method="objectSpanMethod"
-        @cell-click="cellClickHandler"
-      >
-        <el-table-column
-          v-for="col in tableCols"
-          :key="col.prop"
-          :prop="col.prop"
-          :label="col.label"
-          :width="col.width"
-          :fixed="col.fixed"
-        >
+    <div v-loading="loading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading" element-loading-background="rgba(0, 0, 0, 0.8)" class="advance__table">
+      <el-table ref="table" max-height="100%" class="table" :data="dealedTableData" border stripe fit height="calc(100vh - 158px)" style="width: 100%" show-summary :summary-method="summaryRow(tableData.length)" :header-cell-class-name="headerCellClass" :row-class-name="tableRowClassName" :cell-class-name="cellClass" :span-method="objectSpanMethod" @cell-click="cellClickHandler">
+        <el-table-column v-for="col in tableCols" :key="col.prop" :prop="col.prop" :label="col.label" :width="col.width" :fixed="col.fixed">
           <template #header>
-            <TableHeaderCell
-              :label="col.label"
-              :filter-options="tableDataFilters[col.prop]"
-              :filter-values.sync="filterValues[col.prop]"
-              :sortable="col.sortable"
-              :sort-rule.sync="tableDataSortRules[col.prop]"
-            />
+            <TableHeaderCell :label="col.label" :filter-options="tableDataFilters[col.prop]" :filter-values.sync="filterValues[col.prop]" :sortable="col.sortable" :sort-rule.sync="tableDataSortRules[col.prop]" />
           </template>
         </el-table-column>
       </el-table>
@@ -139,183 +84,61 @@
       </div>
     </Dialog> -->
     <!--高级查询-->
-    <Dialog
-      width="852px"
-      :flag="gjFlag"
-    >
-      <div
-        ref="dialog"
-        class="rowDialog"
-        :tabindex="0"
-        @keyup.enter="onCheckGj(true)"
-        @keyup.self.esc="gjFlag=false"
-      >
+    <Dialog width="852px" :flag="gjFlag">
+      <div ref="dialog" class="rowDialog" :tabindex="0" @keyup.enter="onCheckGj(true)" @keyup.self.esc="gjFlag=false">
         <div class="title">高级查询</div>
         <div class="content">
-          <el-form
-            ref="form"
-            :model="form"
-            :rules="rules"
-            label-width="100px"
-          >
+          <el-form ref="form" :model="form" :rules="rules" label-width="100px">
             <el-row :gutter="20">
-              <el-col
-                v-for="item in formItems"
-                :key="item.prop"
-                :span="item.span || 8"
-              >
-                <el-form-item
-                  :label="item.label"
-                  :prop="item.prop"
-                >
+              <el-col v-for="item in formItems" :key="item.prop" :span="item.span || 8">
+                <el-form-item :label="item.label" :prop="item.prop">
                   <template v-if="item.prop === 'FlightDate'">
-                    <el-date-picker
-                      v-model="FlightDate"
-                      size="small"
-                      type="daterange"
-                      value-format="yyyy-MM-dd"
-                      start-placeholder="开始日期"
-                      end-placeholder="结束日期"
-                      :picker-options="dateRangePickerOptions"
-                      @keyup.esc.native="dialogFocus"
-                    />
+                    <el-date-picker v-model="FlightDate" size="small" type="daterange" value-format="yyyy-MM-dd" start-placeholder="开始日期" end-placeholder="结束日期" :picker-options="dateRangePickerOptions" @keyup.esc.native="dialogFocus" />
                   </template>
                   <template v-else-if="item.prop === 'status'">
-                    <el-select
-                      v-model="form.status"
-                      size="small"
-                      filterable
-                      default-first-option
-                      clearable
-                      @keyup.esc.native="dialogFocus"
-                    >
-                      <el-option
-                        v-for="option in statusList"
-                        :key="option.ID"
-                        :label="option.StatusName"
-                        :value="option.StatusCode"
-                      />
+                    <el-select v-model="form.status" size="small" filterable default-first-option clearable @keyup.esc.native="dialogFocus">
+                      <el-option v-for="option in statusList" :key="option.ID" :label="option.StatusName" :value="option.StatusCode" />
                     </el-select>
                   </template>
                   <template v-else-if="item.prop === 'specialType'">
-                    <el-select
-                      v-model="form.specialType"
-                      size="small"
-                      filterable
-                      allow-create
-                      default-first-option
-                      clearable
-                      @keyup.esc.native="dialogFocus"
-                    >
-                      <el-option
-                        v-for="option in baggageTypeList"
-                        :key="option.ID"
-                        :label="option.TypeName"
-                        :value="option.TypeCode"
-                      />
+                    <el-select v-model="form.specialType" size="small" filterable allow-create default-first-option clearable @keyup.esc.native="dialogFocus">
+                      <el-option v-for="option in baggageTypeList" :key="option.ID" :label="option.TypeName" :value="option.TypeCode" />
                     </el-select>
                   </template>
                   <template v-else-if="item.prop === 'unLoad'">
-                    <el-select
-                      v-model="form.unLoad"
-                      size="small"
-                      clearable
-                      @keyup.esc.native="dialogFocus"
-                    >
-                      <el-option
-                        label="已翻减"
-                        :value="1"
-                      />
-                      <el-option
-                        label="待翻减"
-                        :value="0"
-                      />
+                    <el-select v-model="form.unLoad" size="small" clearable @keyup.esc.native="dialogFocus">
+                      <el-option label="已翻减" :value="1" />
+                      <el-option label="待翻减" :value="0" />
                     </el-select>
                   </template>
                   <template v-else-if="item.prop === 'checkIn'">
-                    <el-select
-                      v-model="form.checkIn"
-                      size="small"
-                      clearable
-                      @keyup.esc.native="dialogFocus"
-                    >
-                      <el-option
-                        label="是"
-                        :value="1"
-                      />
-                      <el-option
-                        label="否"
-                        :value="0"
-                      />
+                    <el-select v-model="form.checkIn" size="small" clearable @keyup.esc.native="dialogFocus">
+                      <el-option label="是" :value="1" />
+                      <el-option label="否" :value="0" />
                     </el-select>
                   </template>
                   <template v-else-if="item.prop === 'active'">
-                    <el-select
-                      v-model="form.active"
-                      size="small"
-                      clearable
-                      @keyup.esc.native="dialogFocus"
-                    >
-                      <el-option
-                        label="是"
-                        :value="1"
-                      />
-                      <el-option
-                        label="否"
-                        :value="0"
-                      />
+                    <el-select v-model="form.active" size="small" clearable @keyup.esc.native="dialogFocus">
+                      <el-option label="是" :value="1" />
+                      <el-option label="否" :value="0" />
                     </el-select>
                   </template>
                   <template v-else-if="item.prop === 'transferIn'">
-                    <el-select
-                      v-model="form.transferIn"
-                      size="small"
-                      clearable
-                      @keyup.esc.native="dialogFocus"
-                    >
-                      <el-option
-                        label="是"
-                        :value="1"
-                      />
-                      <el-option
-                        label="否"
-                        :value="0"
-                      />
+                    <el-select v-model="form.transferIn" size="small" clearable @keyup.esc.native="dialogFocus">
+                      <el-option label="是" :value="1" />
+                      <el-option label="否" :value="0" />
                     </el-select>
                   </template>
                   <template v-else-if="item.prop === 'canceled'">
-                    <el-select
-                      v-model="form.canceled"
-                      size="small"
-                      clearable
-                      @keyup.esc.native="dialogFocus"
-                    >
-                      <el-option
-                        label="是"
-                        :value="1"
-                      />
-                      <el-option
-                        label="否"
-                        :value="0"
-                      />
+                    <el-select v-model="form.canceled" size="small" clearable @keyup.esc.native="dialogFocus">
+                      <el-option label="是" :value="1" />
+                      <el-option label="否" :value="0" />
                     </el-select>
                   </template>
                   <template v-else>
-                    <el-popover
-                      v-model="item.hintVisible"
-                      placement="right"
-                      trigger="manual"
-                    >
+                    <el-popover v-model="item.hintVisible" placement="right" trigger="manual">
                       <span>{{ item.hintText }}</span>
-                      <el-input
-                        :ref="'input-' + item.prop"
-                        slot="reference"
-                        v-model="form[item.prop]"
-                        size="small"
-                        @focus="item.hintVisible = true"
-                        @blur="item.hintVisible = false"
-                        @keyup.esc.native="dialogFocus"
-                      />
+                      <el-input :ref="'input-' + item.prop" slot="reference" v-model="form[item.prop]" size="small" @focus="item.hintVisible = true" @blur="item.hintVisible = false" @keyup.esc.native="dialogFocus" />
                     </el-popover>
                   </template>
                 </el-form-item>
@@ -324,16 +147,8 @@
           </el-form>
         </div>
         <div class="foot right t30">
-          <el-button
-            size="medium"
-            class="r24"
-            type="primary"
-            @click="onCheckGj(true)"
-          >确定</el-button>
-          <el-button
-            size="medium"
-            @click="closeCheckGj"
-          >取消</el-button>
+          <el-button size="medium" class="r24" type="primary" @click="onCheckGj(true)">确定</el-button>
+          <el-button size="medium" @click="closeCheckGj">取消</el-button>
         </div>
       </div>
     </Dialog>
@@ -352,7 +167,7 @@ import { setTableFilters } from '@/utils/table'
 export default {
   name: 'Advance',
   components: { Search, Dialog, TableHeaderCell },
-  data() {
+  data () {
     return {
       loading: false,
       colDialogFlag: false,
@@ -645,7 +460,7 @@ export default {
   },
   computed: {
     ...mapGetters(['clickedCells', 'queryForm']),
-    dealedTableData() {
+    dealedTableData () {
       const filtered = this.tableData.filter(item => {
         let flag = true
         Object.entries(this.filterValues).forEach(([key, arr]) => {
@@ -671,7 +486,7 @@ export default {
   },
   watch: {
     FlightDate: {
-      handler(val) {
+      handler (val) {
         if (val === null) {
           this.FlightDate = ['', '']
         }
@@ -679,7 +494,7 @@ export default {
       deep: true
     },
     dealedTableData: {
-      handler(val) {
+      handler (val) {
         this.spanArr = []
         let contactDot = this.contactDot
         val.forEach((item, index, arr) => {
@@ -705,7 +520,7 @@ export default {
       deep: true
     }
   },
-  created() {
+  created () {
     Object.values(this.tableCols).forEach(({ prop, filterable, sortable }) => {
       if (filterable) {
         this.$set(this.tableDataFilters, prop, [])
@@ -723,7 +538,7 @@ export default {
     // }
     // this.statItemsQueryByStatMain(dataContent);
   },
-  mounted() {
+  mounted () {
     // window.addEventListener('keyup', () => {
     //   console.dir(document.activeElement)
     // })
@@ -754,13 +569,13 @@ export default {
       this.onCheckGj()
     }
   },
-  updated() {
+  updated () {
     // table数据更新
     this.$nextTick(() => {
       this.$refs.table.doLayout()
     })
   },
-  beforeDestroy() {
+  beforeDestroy () {
     // console.log(this.$route.matched.filter(item => item.name && item.meta.title))
     if (this.$route.matched.filter(item => item.name && item.meta.title).length > 1) {
       this.$store.dispatch('app/setQueryForm', {
@@ -772,13 +587,13 @@ export default {
     }
   },
   methods: {
-    dialogShow() {
+    dialogShow () {
       this.gjFlag = true
       this.$nextTick(() => {
         this.dialogFocus()
       })
     },
-    dialogFocus() {
+    dialogFocus () {
       this.$refs['dialog'].focus()
     },
     // startDateChangeHandler(val) {
@@ -811,17 +626,17 @@ export default {
     //     this.$message.info('时间跨度不能超过三天,请重新选择')
     //   }
     // },
-    dateRangePickHandler({ maxDate, minDate }) {
+    dateRangePickHandler ({ maxDate, minDate }) {
       if (!maxDate) {
         this.pickedDate = minDate
       } else {
         this.pickedDate = null
       }
     },
-    dateRangeDisabled(date) {
+    dateRangeDisabled (date) {
       return this.pickedDate ? Math.abs(date - this.pickedDate) > 2 * 24 * 60 * 60 * 1000 : false
     },
-    objectSpanMethod({ row, column, rowIndex, columnIndex }) {
+    objectSpanMethod ({ row, column, rowIndex, columnIndex }) {
       if (['PassengerNameUpcase', 'BagWeight'].includes(column.property)) {
         const _row = this.spanArr[rowIndex]
         const _col = _row > 0 ? 1 : 0
@@ -832,7 +647,7 @@ export default {
       }
     },
     // 给表头单元格加上 ascending 或 descending 使用 element 自带的排序箭头变色
-    headerCellClass({ row, column, rowIndex, columnIndex }) {
+    headerCellClass ({ row, column, rowIndex, columnIndex }) {
       const classes = []
       const rule = this.tableDataSortRules[column.property]
       if (rule) {
@@ -840,14 +655,14 @@ export default {
       }
       return classes.join(' ')
     },
-    tableRowClassName({ row, rowIndex }) {
+    tableRowClassName ({ row, rowIndex }) {
       const classes = []
       if (row.deleted === 'DEL') {
         classes.push('bgl-deleted')
       }
       return classes.join(' ')
     },
-    cellClass({ row, column, rowIndex, columnIndex }) {
+    cellClass ({ row, column, rowIndex, columnIndex }) {
       const classes = []
       if (['FlightNO', 'TransferFlightNO', 'BagSN'].includes(column.property)) {
         classes.push('cell-click')
@@ -864,7 +679,7 @@ export default {
       }
       return classes.join(' ')
     },
-    cellClickHandler(row, column, cell, event) {
+    cellClickHandler (row, column, cell, event) {
       if (['FlightNO', 'TransferFlightNO', 'BagSN'].includes(column.property)) {
         this.$store.dispatch('keepAlive/addClickedCell', {
           row,
@@ -906,7 +721,7 @@ export default {
       }
     },
     // 查询
-    getSearchData(val) {
+    getSearchData (val) {
       this.clearForm()
       if (this.FlightDate[0] === '' || this.FlightDate[1] === '' || val === '') {
         this.$message.error('请先输入完整查询信息')
@@ -940,18 +755,18 @@ export default {
       }
     },
     // 清除查询
-    clearSearchData() {
+    clearSearchData () {
       this.clearForm()
       this.tableData = []
     },
     // 清除表单
-    clearForm() {
+    clearForm () {
       Object.keys(this.form).forEach(key => {
         this.form[key] = ''
       })
     },
     // 高级查询-确定
-    onCheckGj(singleJump) {
+    onCheckGj (singleJump) {
       /* 参数顺序
       【航班开始日期,航班结束日期,航班号,航班号,行李牌号,行李牌号,起飞站,起飞站,目的站,目的站,特殊行李类型,特殊行李类型,旅客姓名大写拼音,旅客姓名大写拼音,
       PNR,PNR,值机号,值机号,中转进航班,中转进航班,中转出航班,中转出航班,容器编号,容器编号,
@@ -1010,10 +825,10 @@ export default {
         this.$message.error('请先选择要查询的时间')
       }
     },
-    closeCheckGj() {
+    closeCheckGj () {
       this.gjFlag = false
     },
-    setDataContent(...dataContent) {
+    setDataContent (...dataContent) {
       dataContent.forEach(target => {
         target = typeof target === 'string' ? target.trim() : target
         if ((target ?? '') !== '') {
@@ -1024,11 +839,11 @@ export default {
       })
     },
     // 数据查询
-    async statItemsQueryByStatMain(dataContent, singleJump) {
+    async statItemsQueryByStatMain (dataContent, singleJump) {
       this.loading = true
       this.tableData = []
       try {
-        const result = await myQuery(queryMap.advacedQuery, ...dataContent)
+        const result = await myQuery(DATACONTENT_ID.advacedQueryId, ...dataContent)
         if (result.length) {
           if (singleJump) {
             if (result.length === 1) {
@@ -1081,9 +896,9 @@ export default {
       this.loading = false
     },
     // 特殊行李类型下拉选项查询
-    async baggageTypeQuery() {
+    async baggageTypeQuery () {
       try {
-        const result = await myQuery(queryMap.baggageType)
+        const result = await myQuery(DATACONTENT_ID.baggageTypeId)
         this.baggageTypeList = result
       } catch (error) {
         console.log('出错了', error)
@@ -1106,7 +921,7 @@ export default {
     //   }
     // },
     // 统计行数
-    summaryRow(num) {
+    summaryRow (num) {
       return function () {
         return ['合计', `共${num}件`]
       }
@@ -1127,7 +942,7 @@ export default {
       width: 32px;
       cursor: pointer;
       background-size: 100% 100%;
-      background: url('../../../assets/baggage/ic_setting.png') no-repeat;
+      background: url("../../../assets/baggage/ic_setting.png") no-repeat;
       margin-left: 12px;
       position: relative;
       top: 2px;
@@ -1154,7 +969,7 @@ export default {
       padding: 0;
       text-align: center;
       font-size: 14px;
-      font-family: Helvetica, 'Microsoft YaHei';
+      font-family: Helvetica, "Microsoft YaHei";
       letter-spacing: 0;
     }
     .cell-click {

+ 2 - 2
src/views/authorityManagement/components/authorityHome.vue

@@ -55,8 +55,8 @@
                               {{ data.auth_name }}
                             </div>
                             <div v-if="data.auth_type > 0" class="icon">
-                              <el-tooltip effect="dark" content="修改应用" placement="bottom">
-                                <span title="修改应用" @click="renderEdit(data)" class="cap cap-edit"></span>
+                              <el-tooltip effect="dark" :content="`修改${data.auth_name}`" placement="bottom">
+                                <span @click="renderEdit(data)" class="cap cap-edit"></span>
                               </el-tooltip>
                             </div>
                           </div>

+ 124 - 20
src/views/authorityManagement/components/authorityRoleEdit.vue

@@ -28,7 +28,7 @@
           </div>
           <div class="addApp-form-content dialog-public-background">
             <el-form :inline="true" label-width="80px" ref="form" :rules="rules" class="form" :model="form">
-              <el-form-item prop="name" label="角色名称">
+              <el-form-item prop="role_name" label="角色名称">
                 <el-input placeholder="请输入角色名称" maxlength="32" v-model="form.role_name" disabled></el-input>
               </el-form-item>
               <el-form-item label="角色描述">
@@ -39,7 +39,7 @@
         </div>
       </div>
       <div class="r24 flex1 part">
-        <Permissiontree v-loading="loading" element-loading-text="数据加载中" :queryId="roleId" @getTreeData="getTreeData" :checkedKeys="checkedKeys" title="权限树" />
+        <Permissiontree v-loading="loading" element-loading-text="数据加载中" @getTreeData="getTreeData" :checkedKeys="checkedKeys" title="权限树" />
       </div>
       <div class="flex1 part">
         <Rulesofcompetency v-loading="loading" element-loading-text="数据加载中" :authList="authList" :authTo="authTo" title="权限规则" />
@@ -84,6 +84,7 @@ import Rolelist from "@/components/rolelist";
 import { RoleDetails, EditRole, RoleAuths } from "@/api/apiAuthority";
 import { Query, GeneralDataReception } from "@/api/dataIntegration";
 import roleData from "../minixs/roleData";
+import { mapGetters } from 'vuex'
 export default {
   name: "AuthorityRoleEdit",
   components: { Permissionlist, Rulesofcompetency, Permissiontree, Rolelist },
@@ -93,13 +94,12 @@ export default {
       radio: 1,
       form: {
         //应用表单
-        name: "",
-        id: "",
-        app: "",
+        role_name: "",
+        role_comment: "",
       },
       rules: {
         //表单验证
-        name: [{ required: true, message: "请输入角色名称", trigger: "blur" }],
+        role_name: [{ required: true, message: "请输入角色名称", trigger: "blur" }],
       },
       loading: false,
       permission: false,
@@ -115,31 +115,35 @@ export default {
       authTo: {},
       authList: [],
       authId: [],
+      msgArrs: [],
       type: null, //参数类型
       roleType: "",
+      msgIndex: 0
     };
   },
   created () {
     //this.getAuthTree();
-    const { RoleId, Status } = this.$route.query;
+    const { RoleId } = this.$route.query;
     this.roleId = RoleId;
-    this.Status = Status;
     this.roleDetails(RoleId);
-    // this.roleAuths(RoleId)
+    this.roleAuths(RoleId);
   },
   mounted () {
     this.roleType = "onlyRole";
   },
+  computed: {
+    ...mapGetters['authArrs']
+  },
   methods: {
     //角色明细
-    async roleDetails (id) {
+    async roleDetails (id = '') {
       try {
         this.loading = true;
         const res = await Query({
-          id:DATACONTENT_ID.roleDetailsId,
-          dataContent:[id]
+          id: DATACONTENT_ID.roleDetailsId,
+          dataContent: [id]
         });
-        if (res.code === "0") {
+        if (res.code == 0) {
           this.form = res.returnData.listValues[0];
           this.loading = false;
         } else {
@@ -158,6 +162,14 @@ export default {
     //获取权限树回调
     getTreeData (arr) {
       this.treeData = arr;
+      this.msgArrs.push(arr);
+      const data1 = this.msgArrs[this.msgArrs.length - 1] //最后一条数据
+      const data2 = this.msgArrs[this.msgArrs.length - 2] //倒数第二条数据
+      if (data1.length >= data2.length) {
+        this.checksBoxTs(data1, data2, 'add')
+      } else {
+        this.checksBoxTs(data2, data1, 'del')
+      }
     },
     //获取权限规则回调
     getData (obj) {
@@ -179,14 +191,24 @@ export default {
     async roleAuths (id) {
       try {
         const res = await Query({
-          id:42,
-          dataContent:[id]
+          id: DATACONTENT_ID.roleAuthId,
+          dataContent: [id]
         });
-        if (res.code === "0") {
+        if (res.code == 0) {
           this.checkedKeys = [];
-          res.returnData.listValues.forEach(item=>{
-            this.checkedKeys.push(item.AuthId)
-          })
+          const { listValues } = res.returnData
+          if (listValues && listValues.length) {
+            this.authList = listValues;
+            this.authTo = listValues[0];
+            listValues.forEach((item) => {
+              const obj = item
+              obj.auth_id = item.AuthId
+              this.checkedBoxs.push(item)
+              this.checkedKeys.push(item.AuthId)
+            });
+            // this.msgArrs.push([])
+          }
+          this.msgArrs.push(this.checkedBoxs)
         } else {
           this.$message.error(res.message);
           this.loading = false;
@@ -199,13 +221,95 @@ export default {
     saveBtn (formName) {
       this.$refs[formName].validate((valid) => {
         if (valid) {
-          this.editRole();
+          const data1 = this.msgArrs[this.msgArrs.length - 1] //最后一条数据
+          const data2 = this.msgArrs[this.msgArrs.length - 2] //倒数第二条数据
+          if (data1.length > data2.length) {
+            this.checksBoxTs(data1, data2, 'add')
+          } else {
+            this.checksBoxTs(data2, data1, 'del')
+          }
+          // this.editRole();
         } else {
           console.log("error submit!!");
           return false;
         }
       });
     },
+    async checksBoxTs (datas, arr, type) {
+      const res = [...datas, ...arr].filter(item => !(datas.some(p => item.auth_id == p.auth_id) && arr.some(c => item.auth_id == c.auth_id)))
+      if (res && res.length) {
+        for (let i = 0; i < res.length; i++) {
+          let obj = {
+            auth_id: res[i].auth_id || res[i].AuthId,
+            role_id: this.roleId
+          }
+          let authObj = res[i].AuthList ? Object.assign(_.cloneDeep(obj), res[i].AuthList) : Object.assign(_.cloneDeep(obj), res[i])
+          if (type == 'add') {
+            if (authObj.QueryRow) {
+              authObj.query_row_condition = authObj.QueryRow
+            }
+            if (authObj.QueryCol) {
+              authObj.query_col_condition = authObj.QueryCol
+            }
+            if (authObj.NewCol) {
+              authObj.new_col_condition = authObj.NewCol
+            }
+            if (authObj.EditCol) {
+              authObj.edit_col_condition = authObj.EditCol
+            }
+            if (authObj.EditRow) {
+              authObj.edit_row_condition = authObj.EditRow
+            }
+            if (authObj.DeleteRow) {
+              authObj.delete_row_condition = authObj.DeleteRow
+            }
+            obj.event = 1
+            authObj.event = 1
+          } else {
+            obj.event = 3
+            authObj.event = 3
+          }
+          GeneralDataReception({
+            serviceId: SERVICE_ID.roleMsgTreeId,
+            dataContent: JSON.stringify(obj)
+          }).then(result => {
+            if (result.code == 0) {
+              if (obj.event == 1) {
+                this.$message.success('添加权限', res.message)
+              } else {
+                this.$message.success('取消权限', res.message)
+              }
+            } else {
+              if (obj.event == 1) {
+                this.$message.success('添加权限', res.message)
+              } else {
+                this.$message.success('取消权限', res.message)
+              }
+            }
+          })
+          GeneralDataReception({
+            serviceId: SERVICE_ID.roleMsgAuthId,
+            dataContent: JSON.stringify(authObj)
+          }).then(result => {
+            if (result.code == 0) {
+              if (obj.event == 1) {
+                this.$message.success('添加规则', res.message)
+              } else {
+                this.$message.success('取消规则', res.message)
+              }
+            } else {
+              if (obj.event == 1) {
+                this.$message.success('添加规则', res.message)
+              } else {
+                this.$message.success('取消规则', res.message)
+              }
+            }
+          })
+        }
+      } else {
+        this.$message.error('未选中数据')
+      }
+    },
     //确认保存
     async editRole () {
       try {

+ 10 - 5
src/views/authorityManagement/components/authorityRoleHome.vue

@@ -66,7 +66,7 @@
         </template>
       </template>
       <template v-else>
-        <el-empty :image-size="1" description="暂无数据"></el-empty>
+        <NoData />
       </template>
     </div>
     <!--删除弹框-->
@@ -110,10 +110,11 @@
 import Search from "@/layout/components/Search";
 import Dialog from "@/layout/components/Dialog";
 import roleData from "../minixs/roleData";
+import NoData from '@/components/nodata';
 import { Query, GeneralDataReception } from "@/api/dataIntegration";
 export default {
   name: "AuthorityRole",
-  components: { Search, Dialog },
+  components: { Search, Dialog, NoData },
   mixins: [roleData],
   data () {
     return {
@@ -198,6 +199,11 @@ export default {
       this.roleId = item.role_id;
       this.ruleForm = JSON.parse(JSON.stringify(item));
     },
+    pageInit () {
+      this.needPage = 1
+      this.arrs = []
+      this.queryData()
+    },
     //新增角色
     async editRoles (params) {
       try {
@@ -208,8 +214,7 @@ export default {
         if (res.code === "0") {
           this.flag = false;
           this.$message.success(res.message);
-          this.needPage = 1;
-          this.queryData()
+          this.pageInit();
         } else {
           this.flag = false;
           this.$message.error(res.message);
@@ -265,7 +270,7 @@ export default {
     },
     //滚动加载数据
     load () {
-      this.needPage = this.needPage + 1
+      this.needPage += 1
       this.queryData()
     },
   },

+ 15 - 7
src/views/authorityManagement/minixs/roleData.js

@@ -7,12 +7,13 @@
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\minixs\roleData.js
  */
 import { QueryRole, DeleteRole } from '@/api/apiAuthority'
-import { Query,GeneralDataReception } from '@/api/dataIntegration'
+import { Query, GeneralDataReception } from '@/api/dataIntegration'
 
 export default {
   data () {
     return {
-      dataList: []
+      dataList: [],
+      msgIndex: null
     }
   },
   created () {
@@ -24,11 +25,18 @@ export default {
       try {
         this.loading = true
         const res = await Query(obj)
-        console.log(res)
-        if (res.code === "0") {
-
-          this.arrs = res.returnData.listValues
-          this.total = num
+        if (res.code == 0) {
+          const newDatas = res.returnData.listValues
+          if (newDatas && newDatas.length) {
+            this.total = res.returnData.pages
+            newDatas.forEach(element => {
+              this.arrs.push(element)
+            })
+            this.msgIndex = this.needPage
+          } else {
+            this.total = this.msgIndex
+            this.needPage = this.msgIndex
+          }
           this.loading = false
         } else {
           this.$message.error(res.message)

+ 57 - 160
src/views/baggageManagement/components/baggage/index.vue

@@ -7,62 +7,31 @@
 -->
 <template>
   <div class="baggage-view">
-    <div
-      ref="basicInfo"
-      class="part1"
-    >
+    <div ref="basicInfo" class="part1">
       <div class="title">
         <span>行李基本信息</span>
-        <el-radio-group
-          v-model="infoBtn"
-          class="radioBtn"
-          size="mini"
-          fill="#FFFFFF"
-          text-color="#28344D"
-        >
-          <el-radio-button
-            v-for="item in infoRadios"
-            :key="item"
-            :label="item"
-          />
+        <el-radio-group v-model="infoBtn" class="radioBtn" size="mini" fill="#FFFFFF" text-color="#28344D">
+          <el-radio-button v-for="item in infoRadios" :key="item" :label="item" />
         </el-radio-group>
       </div>
       <div class="part1_info">
         <el-row :gutter="12">
-          <el-col
-            v-for="(item, index) in baggageBasicInfoCols"
-            :key="index"
-            :xl="[1, 4, 5].includes(index % 7) ? 4 : 3"
-            :sm="6"
-            :xs="6"
-          >
-            <span class="label">{{ item.label }}:</span><span
-              class="content"
-              :title="formattedBaggageInfo(item.prop)"
-            >{{ formattedBaggageInfo(item.prop) }}</span>
+          <el-col v-for="(item, index) in baggageBasicInfoCols" :key="index" :xl="[1, 4, 5].includes(index % 7) ? 4 : 3" :sm="6" :xs="6">
+            <span class="label">{{ item.label }}:</span><span class="content" :title="formattedBaggageInfo(item.prop)">{{ formattedBaggageInfo(item.prop) }}</span>
           </el-col>
         </el-row>
       </div>
     </div>
-    <div
-      v-show="infoBtn === infoRadios[0]"
-      class="part2"
-    >
+    <div v-show="infoBtn === infoRadios[0]" class="part2">
       <div class="part2_info">
-        <div
-          style="width: 120px"
-          class="title"
-        >行李跟踪信息</div>
+        <div style="width: 120px" class="title">行李跟踪信息</div>
         <div class="type normal">
           {{ baggageBasicInfo.BagStatus }}
         </div>
         <div class="step">
           <div class="baggage-track-chart">
             <div class="stepLine">
-              <div
-                :style="{ width: lineWidth }"
-                class="stepLineBlue"
-              />
+              <div :style="{ width: lineWidth }" class="stepLineBlue" />
             </div>
             <!-- <el-popover
               v-for="(item, index) in stepData"
@@ -87,13 +56,7 @@
                 <span>{{ item.DealTime }}</span>
               </div>
             </el-popover> -->
-            <div
-              v-for="(item, index) in stepData"
-              :key="index"
-              :class="{ 'stepItem': true, activeItem: item.DealTime }"
-              @mouseenter="itemMouseEnterHandler(item)"
-              @mouseleave="itemMouseLeaveHandler(item)"
-            >
+            <div v-for="(item, index) in stepData" :key="index" :class="{ 'stepItem': true, activeItem: item.DealTime }" @mouseenter="itemMouseEnterHandler(item)" @mouseleave="itemMouseLeaveHandler(item)">
               <span class="head">
                 <!-- {{ item.airPort }} -->
                 <!-- <span v-if="item.airPort && item.nodeName !== ''">-</span> -->
@@ -106,24 +69,13 @@
         </div>
       </div>
       <div class="btns">
-        <img
-          class="btn-square btn-shadow"
-          src="../../../../assets/baggage/ic_export.png"
-        >
-        <img
-          class="btn-square btn-shadow"
-          src="../../../../assets/baggage/ic_setting.png"
-          @click="show"
-        >
+        <img class="btn-square btn-shadow" src="../../../../assets/baggage/ic_export.png">
+        <img class="btn-square btn-shadow" src="../../../../assets/baggage/ic_setting.png" @click="show">
       </div>
     </div>
-    <div
-      v-show="infoBtn == infoRadios[0]"
-      class="part3"
-      :style="{
+    <div v-show="infoBtn == infoRadios[0]" class="part3" :style="{
         'height': `calc(100vh - 80px - ${basicInfoHeight}px - 128px - 3 * 8px - 44px)`
-      }"
-    >
+      }">
       <!-- <el-popover
         trigger="hover"
         placement="top-start"
@@ -132,30 +84,8 @@
         :disabled="!messageTooltipVisible"
       >
         <div class="pre-line">{{ messageTooltip }}</div> -->
-      <el-table
-        ref="table"
-        :data="baggageTableData"
-        :height="`calc(100vh - 80px - ${basicInfoHeight}px - 128px - 3 * 8px - 44px)`"
-        size="mini"
-        border
-        fit
-        :header-cell-class-name="headerCellClass"
-        :header-cell-style="{ color: '#101116' }"
-        :cell-class-name="cellClass"
-        :span-method="tableSpanMethod"
-        @cell-mouse-enter="cellMouseEnterHandler"
-        @cell-mouse-leave="cellMouseLeaveHandler"
-        @cell-click="cellClickHandler"
-      >
-        <el-table-column
-          v-for="item in tableColsCopy"
-          :key="item.index"
-          :prop="item.prop"
-          :label="item.name"
-          :align="item.align || 'center'"
-          :width="item.width"
-          show-overflow-tooltip
-        >
+      <el-table ref="table" :data="baggageTableData" :height="`calc(100vh - 80px - ${basicInfoHeight}px - 128px - 3 * 8px - 44px)`" size="mini" border fit :header-cell-class-name="headerCellClass" :header-cell-style="{ color: '#101116' }" :cell-class-name="cellClass" :span-method="tableSpanMethod" @cell-mouse-enter="cellMouseEnterHandler" @cell-mouse-leave="cellMouseLeaveHandler" @cell-click="cellClickHandler">
+        <el-table-column v-for="item in tableColsCopy" :key="item.index" :prop="item.prop" :label="item.name" :align="item.align || 'center'" :width="item.width" show-overflow-tooltip>
           <template slot="header">
             <div class="cell-content">{{ item.name }}</div>
           </template>
@@ -167,13 +97,9 @@
       <!-- </el-popover> -->
     </div>
 
-    <div
-      v-show="infoBtn === infoRadios[1]"
-      class="part4"
-      :style="{
+    <div v-show="infoBtn === infoRadios[1]" class="part4" :style="{
         'height': `calc(100vh - 80px - ${basicInfoHeight}px - 2 * 8px - 44px)`
-      }"
-    >
+      }">
       <header class="head">
         <div class="title">行李跟踪信息</div>
         <div class="btns">
@@ -190,15 +116,8 @@
       </header>
       <main class="main">
         <template v-if="messageList.length">
-          <el-row
-            :gutter="24"
-            type="flex"
-          >
-            <el-col
-              v-for="(message, index) in messageList"
-              :key="index"
-              :span="6"
-            >
+          <el-row :gutter="24" type="flex">
+            <el-col v-for="(message, index) in messageList" :key="index" :span="6">
               <div class="card">
                 <div class="message-date">{{ message.date + ' UTC' }}</div>
                 <div class="message-content">
@@ -218,46 +137,23 @@
           </el-row>
         </template>
         <template v-else>
-          <el-empty
-            :image-size="1"
-            description="暂无数据"
-          />
+          <el-empty :image-size="1" description="暂无数据" />
         </template>
       </main>
     </div>
     <!--列设置-->
-    <Dialog
-      :flag="dialogFlag"
-      class="dialog-check-cols"
-    >
+    <Dialog :flag="dialogFlag" class="dialog-check-cols">
       <div class="col-dialog">
         <div class="title">列设置</div>
         <div class="content">
-          <el-tree
-            :data="tableCols"
-            :class="colsCheckClass"
-            show-checkbox
-            node-key="index"
-            :default-expand-all="true"
-            :props="{
+          <el-tree :data="tableCols" :class="colsCheckClass" show-checkbox node-key="index" :default-expand-all="true" :props="{
               label: 'name',
               children: 'children',
-            }"
-            :default-checked-keys="checkedKeysTemp"
-            @check="handleCheck"
-          />
+            }" :default-checked-keys="checkedKeysTemp" @check="handleCheck" />
         </div>
         <div class="foot right t30">
-          <el-button
-            size="medium"
-            class="r24"
-            type="primary"
-            @click="onCheck"
-          >确定</el-button>
-          <el-button
-            size="medium"
-            @click="hide"
-          >取消</el-button>
+          <el-button size="medium" class="r24" type="primary" @click="onCheck">确定</el-button>
+          <el-button size="medium" @click="hide">取消</el-button>
         </div>
       </div>
     </Dialog>
@@ -274,7 +170,7 @@ export default {
     Dialog
   },
   mixins: [tableColsMixin],
-  data() {
+  data () {
     return {
       departureAirport: '',
       landingAirport: '',
@@ -448,7 +344,7 @@ export default {
     }
   },
   computed: {
-    lineWidth() {
+    lineWidth () {
       for (let i = this.stepData.length - 1; i > -1; i--) {
         if (this.stepData[i].DealTime) {
           return (i * 100) / (this.stepData.length - 1) + '%'
@@ -470,7 +366,7 @@ export default {
     //     )
     //   }
     // },
-    formattedBaggageInfo() {
+    formattedBaggageInfo () {
       return function (prop) {
         const value = this.baggageBasicInfo[prop]
         if ((value ?? '') === '') {
@@ -499,7 +395,7 @@ export default {
     }
   },
   watch: {
-    infoBtn(val) {
+    infoBtn (val) {
       const that = this
       if (val === '跟踪报文') {
         clearInterval(this.loopEvent)
@@ -518,7 +414,7 @@ export default {
       }
     },
     hoveredRow: {
-      handler(row) {
+      handler (row) {
         this.stepData.forEach(item => {
           item.tableHover = row && item.resourceFile === row.resourceFile
         })
@@ -526,7 +422,7 @@ export default {
       deep: true
     }
   },
-  mounted() {
+  mounted () {
     this.queryData = this._.cloneDeep(this.$route.query)
     // console.log(this.queryData)
     const that = this
@@ -535,11 +431,11 @@ export default {
       that.queryBaggageAll()
     }, 3000)
   },
-  updated() {
+  updated () {
     this.basicInfoHeight = this.$refs['basicInfo'].offsetHeight
     this.$refs['table']?.doLayout()
   },
-  beforeDestroy() {
+  beforeDestroy () {
     clearInterval(this.loopEvent)
     this.loopEvent = null
     clearInterval(this.queryMessageLoop)
@@ -556,7 +452,7 @@ export default {
     //     }
     //   }
     // },
-    initTableData(tableData) {
+    initTableData (tableData) {
       const spanArr = []
       let pos = 0
       for (let i = 0; i < tableData.length; i++) {
@@ -580,12 +476,12 @@ export default {
       this.spanArr = spanArr
       this.pos = pos
     },
-    headerCellClass({ row, column, rowIndex, columnIndex }) {
+    headerCellClass ({ row, column, rowIndex, columnIndex }) {
       if (['departureAirport', 'landingAirport'].includes(column.property)) {
         return 'pre-line'
       }
     },
-    cellClass({ row, column, rowIndex, columnIndex }) {
+    cellClass ({ row, column, rowIndex, columnIndex }) {
       const classes = []
       if (column.property === 'flightNo') {
         classes.push('cell-click')
@@ -595,7 +491,7 @@ export default {
       }
       return classes.join(' ')
     },
-    cellClickHandler(row, column, cell, event) {
+    cellClickHandler (row, column, cell, event) {
       switch (column.property) {
         case 'flightNo':
           this.$router.push({
@@ -610,7 +506,7 @@ export default {
           break
       }
     },
-    tableSpanMethod({ row, column, rowIndex, columnIndex }) {
+    tableSpanMethod ({ row, column, rowIndex, columnIndex }) {
       if (['flightNo', 'flightDate', 'departureAirport', 'landingAirport'].includes(column['property'])) {
         const _row = this.spanArr[rowIndex]
         const _col = _row > 0 ? 1 : 0
@@ -620,25 +516,25 @@ export default {
         }
       }
     },
-    itemMouseEnterHandler(item) {
+    itemMouseEnterHandler (item) {
       if (item.resourceFile) {
         // this.checkBaggageMessage(item.resourceFile)
         item.hover = true
       }
     },
-    itemMouseLeaveHandler(item) {
+    itemMouseLeaveHandler (item) {
       item.hover = false
     },
-    cellMouseEnterHandler(row, column, cell, event) {
+    cellMouseEnterHandler (row, column, cell, event) {
       // if (row?.resourceFile) {
       //   this.checkBaggageMessage(row.resourceFile)
       // }
       this.hoveredRow = row
     },
-    cellMouseLeaveHandler() {
+    cellMouseLeaveHandler () {
       // this.hoveredRow = null
     },
-    async checkBaggageMessage(resourceFile) {
+    async checkBaggageMessage (resourceFile) {
       if (!this.messageTooltipList.some(message => message.resourceFile === resourceFile)) {
         const result = await this.queryMessage([resourceFile])
         this.messageTooltipList.push({
@@ -648,22 +544,22 @@ export default {
       }
     },
     // 行李详情基础信息
-    queryBaggageBasicInfo(dataContent) {
+    queryBaggageBasicInfo (dataContent) {
       return myQuery(queryMap.baggageBasicInfoByID, ...dataContent)
     },
     // 行李详情追踪链
-    queryBaggageTrack(dataContent) {
+    queryBaggageTrack (dataContent) {
       return myQuery(queryMap.baggageTrackByID, ...dataContent)
     },
     // 行李详情表格
-    queryBaggageDetails(dataContent) {
+    queryBaggageDetails (dataContent) {
       return myQuery(queryMap.baggageDetailsByID, ...dataContent)
     },
     // 原始报文
-    queryMessage(dataContent) {
+    queryMessage (dataContent) {
       return myQuery(queryMap.message, ...dataContent)
     },
-    async queryBaggageAll(queryData = this.queryData) {
+    async queryBaggageAll (queryData = this.queryData) {
       const { FlightNO, FlightDate, BagSN } = queryData
       const dataContent = [FlightNO, FlightDate, BagSN]
       try {
@@ -702,7 +598,7 @@ export default {
         console.log('错误', error)
       }
     },
-    async baggageMessageQuery() {
+    async baggageMessageQuery () {
       const { FlightNO, FlightDate, BagSN } = this.queryData
       const dataContent = [FlightNO, FlightDate, BagSN]
       try {
@@ -892,7 +788,7 @@ export default {
           padding: 0;
           word-spacing: 0;
           font-size: 14px;
-          font-family: Helvetica, 'Microsoft YaHei';
+          font-family: Helvetica, "Microsoft YaHei";
           font-weight: 400;
           color: #303133;
           .cell-content {
@@ -933,12 +829,12 @@ export default {
         .card {
           width: 100%;
           min-height: 440px;
-          padding: 24px 0 24px 32px;
+          padding: 20px;
           background: #ffffff;
           box-shadow: 0px 3px 2px 0px rgba(0, 0, 0, 0.29);
           margin-bottom: 24px;
           > .message-date {
-            width: 160px;
+            width: 180px;
             height: 26px;
             line-height: 14px;
             font-size: 14px;
@@ -952,6 +848,7 @@ export default {
             line-height: 24px;
             font-size: 14px;
             color: #303133;
+            word-break: break-all;
           }
         }
       }
@@ -979,16 +876,16 @@ export default {
     white-space: pre-line;
   }
 }
-.el-popper[x-placement^='top'].popover-dark .popper__arrow::after {
+.el-popper[x-placement^="top"].popover-dark .popper__arrow::after {
   border-top-color: #303133;
 }
-.el-popper[x-placement^='right'].popover-dark .popper__arrow::after {
+.el-popper[x-placement^="right"].popover-dark .popper__arrow::after {
   border-right-color: #303133;
 }
-.el-popper[x-placement^='bottom'].popover-dark .popper__arrow::after {
+.el-popper[x-placement^="bottom"].popover-dark .popper__arrow::after {
   border-bottom-color: #303133;
 }
-.el-popper[x-placement^='left'].popover-dark .popper__arrow::after {
+.el-popper[x-placement^="left"].popover-dark .popper__arrow::after {
   border-left-color: #303133;
 }
 </style>

+ 2 - 0
src/views/login/index.vue

@@ -73,6 +73,7 @@ import { Query } from "@/api/dataIntegration";
 // import { GetSystemSet } from "@/api/systemConfiguration";
 import { setCodeToken, setToken, TokenKey, getCodeToken } from '@/utils/auth';
 import { getAuthListByUser } from '@/api/Account';
+import MD5 from 'blueimp-md5'
 export default {
   name: "Login",
   components: { Identify, Dialog },
@@ -172,6 +173,7 @@ export default {
           this.loading = true;
           const params = {
             username: this.loginForm.username.replace(/\s+/g, ""),
+            // password: MD5(this.loginForm.password.replace(/\s+/g, "")),
             password: this.loginForm.password.replace(/\s+/g, ""),
             verificationCode: this.loginForm.identify.replace(/\s+/g, ""),
           };