Przeglądaj źródła

Merge branch 'master' of http://120.26.64.82:10880/BFFE/SMAirports

zhaoke 2 lat temu
rodzic
commit
89c037a4f0
1 zmienionych plików z 26 dodań i 44 usunięć
  1. 26 44
      src/views/newUserManagement/index.vue

+ 26 - 44
src/views/newUserManagement/index.vue

@@ -132,7 +132,7 @@
               label: 'role_name',
               children: 'role_ID',
             }" :default-checked-keys="checkedKeysTemp" @check="handleCheck" /> -->
-            <el-checkbox v-model="city.start"  v-for="city in tableCols" :key="city.index" @change="handleCheckedCitiesChange(city)">{{ city.role_name }}</el-checkbox>
+            <el-checkbox v-model="item.role_status"  v-for="(item, index) in tableCols" :key="index" @change="handleCheckedCitiesChange(item)">{{ item.role_name }}</el-checkbox>
         </div>
         <div class="foot right t30">
           <!-- <el-button size="medium" class="r24" type="primary" @click="onCheck">确定</el-button> -->
@@ -159,11 +159,12 @@
 <script>
 import pb from '@/layout/mixin/getPublicData'
 import Dialog from '@/layout/components/Dialog'
+import pf from '@/layout/mixin/publicFunc'
 import MD5 from 'blueimp-md5'
 export default {
   name: 'NewManageMent',
   components: { Dialog },
-  mixins: [pb],
+  mixins: [pb,pf],
   data () {
     return {
       data: [
@@ -228,11 +229,6 @@ export default {
   mounted () {
     this.getTreeData()
   },
-  computed: {
-    colsCheckClass() {
-      return this.tableCols.some(col => col.children?.length) ? 'has-children' : 'no-children'
-    }
-  },
   methods: {
     async getTreeData () {
       const result = await this.getQuery(this.queryId)
@@ -295,14 +291,14 @@ export default {
     async tableRemove () {
       let code = null
       if (this.rmType == '1') {
-        code = await this.generalDataReception(this.queryId, this.rmObj, 3)
+        code = await this.getChangeList(this.queryId, this.rmObj, 3)
         if (code) {
           this.getTreeData()
           this.rmObj = {}
           this.clearForm()
         }
       } else {
-        code = await this.generalDataReception(SERVICE_ID.getUserTableId, this.dataObj, 3)
+        code = await this.getChangeList(SERVICE_ID.getUserTableId, this.dataObj, 3)
         if (code) {
           const result = await this.getQuery(SERVICE_ID.getUserTableId, false, {
             user_group_id: this.dataObj.user_group_id
@@ -320,11 +316,11 @@ export default {
           let code = null
           const data = this.formInline
           if (this.type == 'add') {
-            code = await this.generalDataReception(this.queryId, data, 1)
+            code = await this.getChangeList(this.queryId, data, 1)
           } else {
             const id = this.formInline.user_group_id
             if (id) {
-              code = await this.generalDataReception(this.queryId, data, 2)
+              code = await this.getChangeList(this.queryId, data, 2)
             }
           }
           if (code) {
@@ -357,20 +353,20 @@ export default {
       const code = await this.getQuery(SERVICE_ID.userAuthorizationId, false, {
         user_id: row.user_id
       })
-      // console.log(code)
-      // console.log(result)
-      code.forEach(element => {
-        result.forEach(res => {
-          // res.user_id = row.user_id
-            if (res.role_ID === element.role_id) {
-              res.start = true
-            }
-          });
-        });
+      
       this.tableCols = result
       this.tableCols.forEach(element => {
         element.user_id = row.user_id
       });
+      code.forEach(element => {
+        this.tableCols.forEach(res => {
+          if (res.role_ID == element.role_id) {
+            res.role_status = true
+          }
+        });
+      });
+      console.log(this.tableCols)
+      console.log(code)
     },
     handleTablepaswod (row) {
       this.paswordFlag = true
@@ -388,34 +384,20 @@ export default {
       let code = null
       let arr = {}
       let event = null
-      if (data.start) {
+      if (data.role_status == true) {
         event = 1
         arr = {
-          value: {
-            role_id: data.role_ID,
-            user_id:  data.user_id
-          }
+          role_id: data.role_ID,
+          user_id:  data.user_id
         }
-      } else {
+      } else if (data.role_status == false){
         event = 3
         arr = {
-          filter: {
-            role_id: data.role_ID,
-            user_id:  data.user_id
-          }
+          role_id: data.role_ID,
+          user_id:  data.user_id
         }
       }
-      code = await this.generalDataReception(SERVICE_ID.userAuthorizationId,[arr], event)
-    },
-    async onCheck () {
-      let code = null
-      let arr = this.tableCols.filter(i => i.start === true)
-      let ar = []
-      arr.forEach(element => {
-        ar.push({value:element})
-      });
-      code = await this.generalDataReception(SERVICE_ID.userAuthorizationId,ar, 2)
-      this.dialogFlag = false
+      code = await this.getChangeList(SERVICE_ID.userAuthorizationId,arr, event)
     },
     hide () {
       this.dialogFlag = false
@@ -427,11 +409,11 @@ export default {
           const data = this.ruleForm
           this.ruleForm.user_pwd= MD5(this.ruleForm.user_pwd)
           if (this.dataType == 'add') {
-            code = await this.generalDataReception(SERVICE_ID.getUserTableId, data, 1)
+            code = await this.getChangeList(SERVICE_ID.getUserTableId, data, 1)
           } else {
             const id = this.ruleForm.user_group_id
             if (id) {
-              code = await this.generalDataReception(SERVICE_ID.getUserTableId, data, 2)
+              code = await this.getChangeList(SERVICE_ID.getUserTableId, data, 2)
             }
           }
           if (code) {