natasha 1 år sedan
förälder
incheckning
3d5eafcabb

+ 14 - 0
src/App.vue

@@ -89,6 +89,20 @@ export default {
                 });
             this.$store.commit('setProviceCity',provinceCityList)
             this.$store.commit('setProviceCityAll',provinceCityListAll)
+            let searchStatusList = [{
+                status:-1,
+                status_name:'全部'
+            }]
+            await getLogin('/OrgServer/DictManager/GetSysUserStatusList', {})
+            .then((res) => {
+                if(res.status===1){
+                    searchStatusList = searchStatusList.concat(res.status_list)
+                }
+            })
+            .catch(() => {
+                this.loading = false
+            });
+            this.$store.commit('setSearchStatusList',searchStatusList)
         }
     }         
   },

+ 5 - 1
src/store/index.js

@@ -59,7 +59,8 @@ const store = new Vuex.Store({
         },
         file_preview_url: 'https://docpreview.utschool.cn',
         $provinceCityListAll: [],
-        $provinceCityList: []
+        $provinceCityList: [],
+        $searchStatusList: []
     },
     mutations: {
         setStudyTypeAll(state, data) {
@@ -79,6 +80,9 @@ const store = new Vuex.Store({
         },
         setProviceCity(state, data) {
             state.$provinceCityList = data
+        },
+        setSearchStatusList(state, data) {
+            state.$searchStatusList = data
         }
     },
     modules: {

+ 0 - 1
src/utils/request.js

@@ -48,7 +48,6 @@ service.interceptors.response.use(
      */
     response => {
         const res = response.data
-        console.log(res)
         let msg = null
             // if the custom code is not 20000, it is judged as an error.
         if (res.status == 0 || res.status == -2) {

+ 7 - 20
src/views/organize_manage/PersonList.vue

@@ -41,10 +41,10 @@
                             <label>状态</label>
                             <el-select v-model="searchStatus" @change="getList(1)" placeholder="请选择">
                                 <el-option
-                                    v-for="item in searchStatusList"
-                                    :key="item.value"
-                                    :label="item.label"
-                                    :value="item.value">
+                                    v-for="item in $searchStatusList"
+                                    :key="item.status"
+                                    :label="item.status_name"
+                                    :value="item.status">
                                 </el-option>
                             </el-select>
                         </div>
@@ -350,6 +350,7 @@ import NavMenu from "../../components/NavMenu.vue"
 import Breadcrumb from '../../components/Breadcrumb.vue';
 import BatchImport from './BatchImport.vue'
 import { getLogin } from "@/api/ajax";
+import { mapState } from 'vuex';
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -402,21 +403,7 @@ export default {
                 value:2,
                 label:'已拒绝'
             }
-        ], // 审核状态列表
-        searchStatusList:[
-            {
-                value:-1,
-                label:'全部'
-            },
-            {
-                value:1,
-                label:'正常'
-            },
-            {
-                value:0,
-                label:'停用'
-            }
-        ],
+        ], 
         statusList:{
             1:{
                 text:'正常',
@@ -461,7 +448,7 @@ export default {
   },
   //计算属性 类似于data概念
   computed: {
-    
+    ...mapState(['$searchStatusList']),
   },
   //监控data中数据变化
   watch: {},

+ 5 - 19
src/views/organize_manage/index.vue

@@ -36,10 +36,10 @@
                         <label>状态</label>
                         <el-select v-model="searchStatus" @change="getList(1)" placeholder="请选择">
                             <el-option
-                                v-for="item in searchStatusList"
-                                :key="item.value"
-                                :label="item.label"
-                                :value="item.value">
+                                v-for="item in $searchStatusList"
+                                :key="item.status"
+                                :label="item.status_name"
+                                :value="item.status">
                             </el-option>
                         </el-select>
                     </div>
@@ -227,20 +227,6 @@ export default {
         searchStatus: -1,
         searchCreator: '', 
         searchArea:[],
-        searchStatusList:[
-            {
-                value:-1,
-                label:'全部'
-            },
-            {
-                value:1,
-                label:'正常'
-            },
-            {
-                value:0,
-                label:'停用'
-            }
-        ],
         statusList:{
             '1':{
                 text:'正常',
@@ -292,7 +278,7 @@ export default {
   },
   //计算属性 类似于data概念
   computed: {
-    ...mapState(['$orgTypeAll','$provinceCityListAll']),
+    ...mapState(['$orgTypeAll','$provinceCityListAll', '$searchStatusList']),
   },
   //监控data中数据变化
   watch: {},

+ 3 - 22
src/views/people_manage/index.vue

@@ -36,7 +36,7 @@
                         <label>状态</label>
                         <el-select v-model="searchStatus" @change="getList(1)" placeholder="请选择">
                             <el-option
-                                v-for="item in searchStatusList"
+                                v-for="item in $searchStatusList"
                                 :key="item.status"
                                 :label="item.status_name"
                                 :value="item.status">
@@ -166,6 +166,7 @@ import Header from "../../components/Header.vue";
 import NavMenu from "../../components/NavMenu.vue"
 import Breadcrumb from '../../components/Breadcrumb.vue';
 import { getLogin } from "@/api/ajax";
+import { mapState } from 'vuex';
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -196,12 +197,6 @@ export default {
                 account_type_name:'全部'
             }
         ],
-        searchStatusList:[
-            {
-                status:-1,
-                status_name:'全部'
-            }
-        ],
         statusList:{
             1:{
                 text:'正常',
@@ -237,7 +232,7 @@ export default {
   },
   //计算属性 类似于data概念
   computed: {
-    
+    ...mapState(['$searchStatusList']),
   },
   //监控data中数据变化
   watch: {},
@@ -349,19 +344,6 @@ export default {
         this.tableHeight = window.innerHeight - tableH;
       }
     },
-    // 用户状态列表
-    getUserStatusList(){
-        let MethodName = "/OrgServer/DictManager/GetSysUserStatusList";
-        getLogin(MethodName, {})
-        .then((res) => {
-            if(res.status===1){
-                this.searchStatusList = this.searchStatusList.concat(res.status_list)
-            }
-        })
-        .catch(() => {
-            this.loading = false
-        });
-    },
     // 用户类型列表
     getUserAccountTypeList(){
         let MethodName = "/OrgServer/DictManager/GetSysUserAccountTypeList";
@@ -379,7 +361,6 @@ export default {
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
     this.getTableHeight();
-    this.getUserStatusList()
     this.getUserAccountTypeList()
     this.getList()
   },