浏览代码

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

zhaoke 3 年之前
父节点
当前提交
2be8058280

+ 1 - 1
src/store/modules/user.js

@@ -103,7 +103,7 @@ const actions = {
 
   // user logout
   logout ({ commit, state }) {
-    console.log(state)
+    // console.log(state)
     return new Promise((resolve, reject) => {
       loginUp({ "UserId": state.UserId, "UserType": state.UserType }).then(result => {
         sessionStorage.removeItem("userName");

+ 2 - 2
src/views/accountGroupManagement/components/accountGroupHome.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2022-01-08 09:27:43
- * @LastEditTime: 2022-03-23 16:00:26
+ * @LastEditTime: 2022-03-24 10:49:51
  * @LastEditors: your name
  * @Description: 用户组管理
  * @FilePath: \Foshan4A2.0\src\views\accountGroupManagement\components\home.vue
@@ -239,7 +239,7 @@ export default {
     },
     currentKey: {
       handler (val) {
-        if (typeof val !== 'number') {
+        if (typeof val === 'object' && !val) {
           return
         }
         this.$nextTick(() => {

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

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-11-29 09:27:43
- * @LastEditTime: 2022-03-23 15:59:27
+ * @LastEditTime: 2022-03-24 10:49:35
  * @LastEditors: your name
  * @Description: 权限管理
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\home.vue
@@ -215,7 +215,7 @@ export default {
     },
     currentKey: {
       handler (val) {
-        if (typeof val !== 'number') {
+        if (typeof val === 'object' && !val) {
           return
         }
         this.$nextTick(() => {

+ 165 - 103
src/views/dashboard/index.vue

@@ -10,16 +10,21 @@
   <div class="dashboard">
     <!--分类信息-->
     <div class="flex-wrap tu-fl">
-      <div v-for="(item,index) in flList" :key="index" @click="toApp(item)" class="flex fl-list">
+      <div
+        v-for="(item, index) in flList"
+        :key="index"
+        @click="toApp(item)"
+        class="flex fl-list"
+      >
         <div class="fl-list-img">
           <template v-if="item.logo">
-            <img :alt="item.appName" :src="item.logo">
+            <img :alt="item.appName" :src="item.logo" />
           </template>
           <template v-else>
-            <img src="../../assets/index/log_default.png" :alt="item.appName">
+            <img src="../../assets/index/log_default.png" :alt="item.appName" />
           </template>
         </div>
-        <div class="fl-list-title flex1">{{item.appName}}</div>
+        <div class="fl-list-title flex1">{{ item.appName }}</div>
       </div>
     </div>
     <!--切换和搜索-->
@@ -32,17 +37,37 @@
       </div>
       <div class="search flex-wrap">
         <div class="search-input flex-wrap r24">
-          <el-select :style="inputFlag ? 'width:150px;':'width:200px;'" @change="handleChange" v-model="select" placeholder="功能菜单">
-            <el-option v-for="(item,index) in routes" :key="index" :label="item.meta.title" :value="item.path"></el-option>
+          <el-select
+            :style="inputFlag ? 'width:150px;' : 'width:200px;'"
+            @change="handleChange"
+            v-model="select"
+            placeholder="功能菜单"
+            @keyup.enter.native="searchByLink"
+          >
+            <el-option
+              v-for="(item, index) in routes"
+              :key="index"
+              :label="item.meta.title"
+              :value="item.path"
+            ></el-option>
           </el-select>
-          <el-input v-show="inputFlag" :style="inputFlag ? 'width:330px;':'width:280px;'" @keyup.enter.native="searchByLink" placeholder="如需搜索,请输入" v-model.trim="input" class="input-with-select">
+          <el-input
+            v-show="inputFlag"
+            :style="inputFlag ? 'width:330px;' : 'width:280px;'"
+            @keyup.enter.native="searchByLink"
+            placeholder="如需搜索,请输入"
+            v-model.trim="input"
+            class="input-with-select"
+          >
           </el-input>
           <!-- <el-select v-model="select" slot="prepend" placeholder="功能菜单">
             <el-option v-for="(item,index) in selectArr" :key="index" :label="item.name" :value="item.value"></el-option>
           </el-select> -->
         </div>
         <div class="search-btn">
-          <el-button @click="searchByLink" class="btn" type="primary">进入</el-button>
+          <el-button @click="searchByLink" class="btn" type="primary"
+            >进入</el-button
+          >
         </div>
       </div>
     </div>
@@ -54,15 +79,15 @@
 </template>
 
 <script>
-import { mapGetters } from 'vuex'
-import Analysis from './components/analysis.vue'
-import Journal from './components/journal.vue'
-import { GetOthSystem } from '@/api/apiHome'
-import axios from 'axios'
+import { mapGetters } from "vuex";
+import Analysis from "./components/analysis.vue";
+import Journal from "./components/journal.vue";
+import { GetOthSystem } from "@/api/apiHome";
+import axios from "axios";
 export default {
-  name: 'Dashboard',
+  name: "Dashboard",
   components: { Analysis, Journal },
-  data () {
+  data() {
     return {
       roleFlag: true,
       inputFlag: false,
@@ -118,152 +143,189 @@ export default {
       //分类信息
       flList: [],
       //切换
-      radio: '1',
+      radio: "1",
       flIndex: 0,
-      input: '',
-      select: ''
-    }
+      input: "",
+      select: "",
+    };
   },
   computed: {
-    ...mapGetters(['systemSet', 'UserType', 'UserId']),
-    routes () {
-      const arrs = this.$store.getters.permission_routes
-      const datas = arrs.filter(item => item.meta && item.meta.title != '首页')
-      return datas
-    }
+    ...mapGetters(["systemSet", "UserType", "UserId"]),
+    routes() {
+      const arrs = this.$store.getters.permission_routes;
+      const datas = arrs.filter(
+        (item) => item.meta && item.meta.title != "首页"
+      );
+      return datas;
+    },
   },
-  mounted () {
-    this.isPower()
-    this.getOthSystem()
+  mounted() {
+    this.isPower();
+    this.getOthSystem();
   },
   methods: {
     //搜索-跳转
-    searchByLink () {
-      const url = this.select
-      this.input ? this.$router.push({ path: url, query: { keyWords: this.input } }) : this.$router.push(url)
+    searchByLink() {
+      const url = this.select;
+      this.input
+        ? this.$router.push({ path: url, query: { keyWords: this.input } })
+        : this.$router.push(url);
     },
     //获取接入系统信息
-    async getOthSystem () {
+    async getOthSystem() {
       try {
         const result = await GetOthSystem({
           userId: Number(this.UserId),
-          userType: this.UserType
-        })
+          userType: this.UserType,
+        });
         if (result.code === 0 && result.returnData.length) {
-          this.flList = result.returnData
+          this.flList = result.returnData;
         } else {
-          this.$message.error(result.message)
+          this.$message.error(result.message);
         }
       } catch (error) {
-        console.log('网络错误:', error)
+        console.log("网络错误:", error);
       }
     },
     //判断页面展示权限
-    isPower () {
-      const obj = typeof (this.systemSet) === 'string' ? JSON.parse(this.systemSet) : this.systemSet
-      const { OpenGroup, OpenRole, UserOfficerMulti } = obj
+    isPower() {
+      const obj =
+        typeof this.systemSet === "string"
+          ? JSON.parse(this.systemSet)
+          : this.systemSet;
+      const { OpenGroup, OpenRole, UserOfficerMulti } = obj;
       if (!OpenGroup) {
         this.routes.forEach((item, index) => {
-          if (item.path === '/accountGroup') {
-            this.routes.splice(index, 1)
+          if (item.path === "/accountGroup") {
+            this.routes.splice(index, 1);
           }
-        })
+        });
       }
       if (!OpenRole) {
         this.routes.forEach((item, index) => {
-          if (item.path === '/role') {
-            this.routes.splice(index, 1)
+          if (item.path === "/role") {
+            this.routes.splice(index, 1);
           }
-        })
+        });
       }
       if (!UserOfficerMulti) {
         this.routes.forEach((item, index) => {
-          if (item.path === '/account') {
-            this.routes.splice(index, 1)
+          if (item.path === "/account") {
+            this.routes.splice(index, 1);
           }
-        })
+        });
       }
     },
-    handleChange (val) {
-      if (val !== '/systemManagement') {
-        this.inputFlag = true
+    handleChange(val) {
+      if (val !== "/systemManagement") {
+        this.inputFlag = true;
       } else {
-        this.inputFlag = false
+        this.inputFlag = false;
       }
     },
-    paramsType (t, num, url, name) {
-      let type = 'application/json'
-      let result = ''
-      if (t == 'json') {
-        type = 'application/json'
+    paramsType(t, num, url, name) {
+      let type = "application/json";
+      let result = "";
+      if (t == "json") {
+        type = "application/json";
       }
       if (num == 1) {
         result = axios.get(url, {
           params: {
-            [name]: sessionStorage.getItem('userName'),
+            [name]: sessionStorage.getItem("userName"),
           },
           data: {
-            unused: 0 //解决请求头无Content-Type
+            unused: 0, //解决请求头无Content-Type
           },
           headers: {
-            'token': sessionStorage.getItem('token'),
-            'Content-Type': type
-          }
-        })
+            token: sessionStorage.getItem("token"),
+            "Content-Type": type,
+          },
+        });
       } else {
-        result = axios.post(url, {
-          [name]: sessionStorage.getItem('userName')
-        }, {
-          headers: {
-            'token': sessionStorage.getItem('token'),
-            'Content-Type': type
+        result = axios.post(
+          url,
+          {
+            [name]: sessionStorage.getItem("userName"),
+          },
+          {
+            headers: {
+              token: sessionStorage.getItem("token"),
+              "Content-Type": type,
+            },
           }
-        })
+        );
       }
-      result.then(res => {
-        console.log(res)
-      }).catch(err => {
-        console.log(err)
-      })
+      result
+        .then((res) => {
+          console.log(res);
+        })
+        .catch((err) => {
+          console.log(err);
+        });
     },
     //应用跳转
-    toApp (item) {
+    toApp(item) {
       if (item.appUrl) {
-        window.open(item.appUrl)
-        const datas = item.inputs
-        const arrs = []
+        window.open(item.appUrl);
+        const datas = item.inputs;
+        const arrs = [];
         if (datas && datas.length) {
-          const [a1, a2] = [...datas]
+          const [a1, a2] = [...datas];
           if (item.requestType == 1) {
-            if (a1.AppInputName == 'token' && a1.AppInputSite == 'Header' && a2.AppInputSite == 'Body') {
-              this.paramsType(item.bodyType, item.requestType, item.appUrl, a2.AppInputName)
+            if (
+              a1.AppInputName == "token" &&
+              a1.AppInputSite == "Header" &&
+              a2.AppInputSite == "Body"
+            ) {
+              this.paramsType(
+                item.bodyType,
+                item.requestType,
+                item.appUrl,
+                a2.AppInputName
+              );
             } else {
-              datas.forEach(item => {
-                const obj = {}
-                if (item.AppInputName == 'token' || item.AppInputName == 'Token' || item.AppInputName == 'TOKEN') {
-                  obj[item.AppInputName] = sessionStorage.getItem('token')
-                } else if (item.AppInputName == 'loginName' || item.AppInputName == 'userName') {
-                  obj[item.AppInputName] = sessionStorage.getItem('userName')
+              datas.forEach((item) => {
+                const obj = {};
+                if (
+                  item.AppInputName == "token" ||
+                  item.AppInputName == "Token" ||
+                  item.AppInputName == "TOKEN"
+                ) {
+                  obj[item.AppInputName] = sessionStorage.getItem("token");
+                } else if (
+                  item.AppInputName == "loginName" ||
+                  item.AppInputName == "userName"
+                ) {
+                  obj[item.AppInputName] = sessionStorage.getItem("userName");
                 }
-                arrs.push(obj)
-              })
-              const getParams = Object.assign(...arrs)
-              axios.get(item.appUrl, {
-                params: getParams
-              }).then(res => {
-                console.log(res)
-              }).catch(err => {
-                console.log(err)
-              })
+                arrs.push(obj);
+              });
+              const getParams = Object.assign(...arrs);
+              axios
+                .get(item.appUrl, {
+                  params: getParams,
+                })
+                .then((res) => {
+                  console.log(res);
+                })
+                .catch((err) => {
+                  console.log(err);
+                });
             }
           } else if (item.requestType == 2) {
-            this.paramsType(item.bodyType, item.requestType, item.appUrl, a2.AppInputName)
+            this.paramsType(
+              item.bodyType,
+              item.requestType,
+              item.appUrl,
+              a2.AppInputName
+            );
           }
         }
       }
-    }
-  }
-}
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>

+ 2 - 2
src/views/organizationManagement/components/organizationHome.vue

@@ -1,7 +1,7 @@
 <!--
  * @Author: your name
  * @Date: 2021-11-29 09:27:43
- * @LastEditTime: 2022-03-23 16:31:35
+ * @LastEditTime: 2022-03-24 10:48:49
  * @LastEditors: your name
  * @Description: 权限管理
  * @FilePath: \Foshan4A2.0\src\views\authorityManagement\components\home.vue
@@ -255,7 +255,7 @@ export default {
     },
     currentKey: {
       handler (val) {
-        if (typeof val !== 'number') {
+        if (typeof val === 'object' && !val) {
           return
         }
         this.$nextTick(() => {

+ 29 - 17
src/views/systemManagement/EditSystem/index.vue

@@ -99,15 +99,15 @@
               v-model.trim="keyWordsUp"
               @keyup.enter.native="queryDatas"
             ></el-input>
-            <el-button @click="queryDatas()">搜索</el-button>
+            <el-button @click="queryDatas">搜索</el-button>
           </div>
         </div>
         <div class="center-box fpBox">
           <el-row class="scCont" :gutter="16">
             <el-col
               :span="4"
-              v-for="(item, index) in FormData.UseList"
-              :key="index"
+              v-for="item in FormData.UseList"
+              :key="item.UserId"
             >
               <el-card class="box-card">
                 <div class="lineTop"></div>
@@ -130,7 +130,7 @@
             </el-col>
           </el-row>
           <el-empty
-            v-if="FormData.UseList.length == 0"
+            v-if="FormData.UseList && FormData.UseList.length == 0"
             description="没有选取"
             style="margin: 0 auto"
           ></el-empty>
@@ -147,7 +147,7 @@
               v-model.trim="keyWords"
               @keyup.enter.native="queryData"
             ></el-input>
-            <el-button @click="queryData()">搜索</el-button>
+            <el-button @click="queryData">搜索</el-button>
           </div>
         </div>
         <div class="center-box">
@@ -178,7 +178,7 @@
             </el-col>
           </el-row>
           <el-empty
-            v-if="FormData.Unuselist.length == 0"
+            v-if="FormData.Unuselist && FormData.Unuselist.length == 0"
             description="没有内容"
             style="margin: 0 auto"
           ></el-empty>
@@ -289,15 +289,21 @@ export default {
   },
   components: { Dialog },
   watch: {
-    keyWords(val) {
-      if (this.keyWords.length == 0) {
-        this.FormData.Unuselist = this.FormData.Unuselists;
-      }
+    keyWords: {
+      handler(val) {
+        if (val.length == 0) {
+          const res = this.FormData.Unuselists;
+          this.FormData.Unuselist = res;
+        }
+      },
     },
-    keyWordsUp() {
-      if (this.keyWordsUp.length == 0) {
-        this.FormData.UseList = this.FormData.UseLists;
-      }
+    keyWordsUp: {
+      handler(val) {
+        if (val.length == 0) {
+          const res = this.FormData.UseLists;
+          this.FormData.UseList = res;
+        }
+      },
     },
   },
   methods: {
@@ -312,6 +318,8 @@ export default {
       this.keyWordsUp = this.keyWordsUp.replace(/\s+/g, "");
       const search = this.keyWordsUp;
       if (search) {
+        let res = this.FormData.UseLists;
+        this.FormData.UseList = res;
         this.FormData.UseList = findarrays(
           this.FormData.UseList,
           "UserName",
@@ -325,6 +333,8 @@ export default {
       this.keyWords = this.keyWords.replace(/\s+/g, "");
       const search = this.keyWords;
       if (search) {
+        let res = this.FormData.Unuselists;
+        this.FormData.Unuselist = res;
         this.FormData.Unuselist = findarrays(
           this.FormData.Unuselist,
           "UserName",
@@ -426,6 +436,7 @@ export default {
               that.FormData.Unuselist.forEach((res, index) => {
                 res.indexname = index;
               });
+              that.FormData.UseLists = that.FormData.UseList;
               that.FormData.Unuselists = that.FormData.Unuselist;
               that.Unuselist = that.FormData.Unuselist;
               that.boxArr = _.cloneDeep(that.FormData.Unuselist);
@@ -440,7 +451,8 @@ export default {
     changeChecked(val, index) {
       this.checkList = false;
       this.FormData.UseList.push(val);
-      this.FormData.UseLists = this.FormData.UseList;
+      const res = this.FormData.UseList;
+      this.FormData.UseLists = res;
       this.FormData.Unuselist.splice(index, 1);
       this.FormData.Unuselists = this.FormData.Unuselists.filter(
         (i) => i.UserId !== val.UserId
@@ -453,14 +465,14 @@ export default {
       this.FormData.Unuselist = this.FormData.Unuselist.sort(
         this.compare("indexname")
       );
-      // this.FormData.Unuselists.push(val);
+      this.FormData.Unuselists.push(val);
       this.FormData.Unuselists = this.FormData.Unuselists.sort(
         this.compare("indexname")
       );
       this.FormData.UseList.splice(index, 1);
       // this.FormData.UseLists.splice(index, 1);
       this.FormData.UseLists = this.FormData.UseLists.filter(
-        (i) => i.UserName !== val.UserName
+        (i) => i.UserId !== val.UserId
       );
     },
     dataChange: function (data) {

+ 12 - 0
src/views/systemManagement/LoginPolicy/index.vue

@@ -279,6 +279,18 @@ export default {
 </script>
 
 <style lang="scss" scoped>
+::-webkit-scrollbar-track-piece {
+  background: #d3dce6;
+}
+
+::-webkit-scrollbar {
+  width: 6px;
+}
+
+::-webkit-scrollbar-thumb {
+  background: #99a9bf;
+  border-radius: 20px;
+}
 .loger {
   width: 24px;
   height: 24px;

+ 43 - 21
src/views/systemManagement/addSystem/index.vue

@@ -97,7 +97,7 @@
               v-model.trim="keyWordsUp"
               @keyup.enter.native="queryDatas"
             ></el-input>
-            <el-button @click="queryDatas()">搜索</el-button>
+            <el-button @click="queryDatas">搜索</el-button>
           </div>
         </div>
         <div class="center-box fpBox">
@@ -148,7 +148,12 @@
             <el-button @click="getUserData">搜索</el-button>
           </div>
         </div>
-        <div class="center-box scrollbar" v-infinite-scroll="load" :infinite-scroll-distance="20" infinite-scroll-disabled="disabled">
+        <div
+          class="center-box scrollbar"
+          v-infinite-scroll="load"
+          :infinite-scroll-distance="20"
+          infinite-scroll-disabled="disabled"
+        >
           <el-row class="scCont" :gutter="16">
             <el-col
               :span="6"
@@ -264,7 +269,7 @@ export default {
         ],
       },
       pageNum: 1,
-      PageSize: 50,
+      PageSize: 40,
       loading: false,
       total: null,
       arrList: [],
@@ -291,12 +296,18 @@ export default {
   watch: {
     keyWords(val) {
       if (this.keyWords.length == 0) {
-        this.FormData.Unuselist = this.FormData.Unuselists;
+        this.arrList = [];
+        this.getUserList({
+          QueryName: this.keyWords,
+          PageSize: this.PageSize,
+          PageIndex: 1,
+        });
       }
     },
     keyWordsUp() {
       if (this.keyWordsUp.length == 0) {
-        this.FormData.UseList = this.FormData.UseLists;
+        const res = this.FormData.UseLists;
+        this.FormData.UseList = res;
       }
     },
   },
@@ -373,7 +384,7 @@ export default {
               const arrs = this.arrList.flat();
               const msgs = _.unionBy(arrs, "UserId");
               this.FormData.Unuselist = msgs;
-              this.FormData.Unuselists = msgs;
+              // this.FormData.Unuselists = msgs;
               this.copyList = msgs;
               this.FormData.Unuselist = this.FormData.Unuselist.filter(
                 (i) => i.UserName
@@ -381,12 +392,15 @@ export default {
               this.FormData.Unuselist.forEach((res, index) => {
                 res.indexname = index;
               });
-              this.FormData.Unuselists = this.FormData.Unuselists.filter(
-                (i) => i.UserName
-              );
-              this.FormData.Unuselists.forEach((res, index) => {
-                res.indexname = index;
-              });
+              if (this.FormData.UseLists.length > 0) {
+                this.FormData.UseLists.forEach((element) => {
+                  this.FormData.Unuselist.forEach((res, index) => {
+                    if (element.UserId == res.UserId) {
+                      this.FormData.Unuselist.splice(index, 1);
+                    }
+                  });
+                });
+              }
               this.dataList = msgs;
               this.total = num;
               this.loading = false;
@@ -402,7 +416,8 @@ export default {
     changeChecked(val, index) {
       this.checkList = false;
       this.FormData.UseList.push(val);
-      this.FormData.UseLists = this.FormData.UseList;
+      const res = this.FormData.UseList;
+      this.FormData.UseLists = res;
       this.FormData.Unuselist.splice(index, 1);
       // this.FormData.Unuselists.splice(index, 1);
       this.FormData.Unuselists = this.FormData.Unuselists.filter(
@@ -420,7 +435,6 @@ export default {
       this.UncheckList = true;
       this.FormData.Unuselist.push(val);
       // this.FormData.Unuselists.push(val);
-      console.log(this.FormData.Unuselists);
       this.FormData.Unuselist = this.FormData.Unuselist.sort(
         this.compare("indexname")
       );
@@ -453,6 +467,8 @@ export default {
       this.keyWordsUp = this.keyWordsUp.replace(/\s+/g, "");
       const search = this.keyWordsUp;
       if (search) {
+        let res = this.FormData.UseLists;
+        this.FormData.UseList = res;
         this.FormData.UseList = findarrays(
           this.FormData.UseList,
           "UserName",
@@ -465,13 +481,19 @@ export default {
     getUserData(val) {
       this.keyWords = this.keyWords.replace(/\s+/g, "");
       const search = this.keyWords;
-      if (search) {
-        this.FormData.Unuselist = findarrays(
-          this.FormData.Unuselist,
-          "UserName",
-          search
-        );
-      }
+      this.arrList = [];
+      this.getUserList({
+        QueryName: this.keyWords,
+        PageSize: this.PageSize,
+        PageIndex: 1,
+      });
+      // if (search) {
+      //   this.FormData.Unuselist = findarrays(
+      //     this.FormData.Unuselist,
+      //     "UserName",
+      //     search
+      //   );
+      // }
     },
     clearData() {
       this.arrList = [];