Explorar el Código

Merge branch 'master' of http://112.74.164.79:3000/chenying/X-web

chenying hace 4 años
padre
commit
bdd4f45043

+ 15 - 8
src/views/modules/org/org-add-or-update.vue

@@ -15,7 +15,7 @@
           <el-tree
             :data="orgList"
             :props="menuListTreeProps"
-            node-key="menuId"
+            node-key="orgId"
             ref="menuListTree"
             @current-change="menuListTreeCurrentChangeHandle"
             :default-expand-all="true"
@@ -92,13 +92,11 @@
               method: 'get',
               params: this.$http.adornParams()
             }).then(({data}) => {
-              if (data && data.code === 0) {
-                this.dataForm.userName = data.user.username
-                this.dataForm.salt = data.user.salt
-                this.dataForm.email = data.user.email
-                this.dataForm.mobile = data.user.mobile
-                this.dataForm.roleIdList = data.user.roleIdList
-                this.dataForm.status = data.user.status
+              if (data && data.code === '200') {
+                this.dataForm.name = data.data.name
+                this.dataForm.parentId = data.data.parentId
+                this.dataForm.orderNum = data.data.orderNum
+                this.menuListTreeSetCurrentNode()
               }
             })
           }
@@ -108,6 +106,15 @@
         this.dataForm.parentId = data.orgId
         this.dataForm.parentName = data.name
       },
+      // 菜单树设置当前选中节点
+      menuListTreeSetCurrentNode () {
+        this.$refs.menuListTree.setCurrentKey(this.dataForm.parentId)
+        if (this.dataForm.parentId === '0') {
+          this.dataForm.parentName = ''
+        } else {
+          this.dataForm.parentName = (this.$refs.menuListTree.getCurrentNode() || {})['name']
+        }
+      },
       // 表单提交
       dataFormSubmit () {
         this.$refs['dataForm'].validate((valid) => {

+ 2 - 3
src/views/modules/org/org.vue

@@ -37,17 +37,16 @@
         prop="parentName"
         header-align="center"
         align="center"
-        width="120"
         label="上级机构">
       </el-table-column>
-      <el-table-column
+      <!-- <el-table-column
         prop="orgId"
         header-align="center"
         align="center"
         min-width="100"
         :show-overflow-tooltip="true"
         label="机构ID">
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column
         header-align="center"
         align="center"

+ 2 - 2
src/views/modules/sys/log.vue

@@ -13,13 +13,13 @@
       border
       v-loading="dataListLoading"
       style="width: 100%">
-      <el-table-column
+      <!-- <el-table-column
         prop="id"
         header-align="center"
         align="center"
         width="80"
         label="ID">
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column
         prop="username"
         header-align="center"

+ 26 - 3
src/views/modules/sys/role-add-or-update.vue

@@ -24,8 +24,8 @@
           <el-tree
             :data="orgList"
             :props="orgListTreeProps"
-            node-key="menuId"
-            ref="menuListTree"
+            node-key="orgId"
+            ref="orgListTree"
             @current-change="menuListTreeCurrentChangeHandle"
             :default-expand-all="true"
             :highlight-current="true"
@@ -44,6 +44,17 @@
           show-checkbox>
         </el-tree>
       </el-form-item>
+      <el-form-item size="mini" label="数据权限">
+        <el-tree
+          :data="orgList"
+          :props="orgListTreeProps"
+          node-key="orgId"
+          ref="orgListDatta"
+          :default-expand-all="true"
+          :highlight-current="true"
+          show-checkbox>
+        </el-tree>
+      </el-form-item>
     </el-form>
     <span slot="footer" class="dialog-footer">
       <el-button @click="visible = false">取消</el-button>
@@ -112,6 +123,7 @@
           this.$nextTick(() => {
             this.$refs['dataForm'].resetFields()
             this.$refs.menuListTree.setCheckedKeys([])
+            this.$refs.orgListDatta.setCheckedKeys([])
           })
         }).then(() => {
           if (this.dataForm.id) {
@@ -125,11 +137,13 @@
                 this.dataForm.remark = data.data.remark
                 // this.dataForm.isCommon = data.data.isCommon
                 this.dataForm.orgId = data.data.orgId
+                this.menuListTreeSetCurrentNode()
                 var idx = data.data.menuIdList.indexOf(this.tempKey)
                 if (idx !== -1) {
                   data.data.menuIdList.splice(idx, data.data.menuIdList.length - idx)
                 }
                 this.$refs.menuListTree.setCheckedKeys(data.data.menuIdList)
+                this.$refs.orgListDatta.setCheckedKeys(data.data.orgIdList)
               }
             })
           }
@@ -139,6 +153,14 @@
         this.dataForm.orgId = data.orgId
         this.dataForm.orgName = data.name
       },
+      menuListTreeSetCurrentNode () {
+        this.$refs.orgListTree.setCurrentKey(this.dataForm.orgId)
+        if (this.dataForm.orgId === '0') {
+          this.dataForm.orgName = ''
+        } else {
+          this.dataForm.orgName = (this.$refs.orgListTree.getCurrentNode() || {})['name']
+        }
+      },
       // 表单提交
       dataFormSubmit () {
         this.$refs['dataForm'].validate((valid) => {
@@ -152,7 +174,8 @@
                 'remark': this.dataForm.remark,
                 'isCommon': this.dataForm.isCommon,
                 'orgId': this.dataForm.orgId,
-                'menuIdList': [].concat(this.$refs.menuListTree.getCheckedKeys(), [this.tempKey], this.$refs.menuListTree.getHalfCheckedKeys())
+                'menuIdList': [].concat(this.$refs.menuListTree.getCheckedKeys()),
+                'orgIdList': [].concat(this.$refs.orgListDatta.getCheckedKeys())
               })
             }).then(({data}) => {
               if (data && data.code === '200') {

+ 2 - 3
src/views/modules/sys/role.vue

@@ -22,13 +22,13 @@
         align="center"
         width="50">
       </el-table-column>
-      <el-table-column
+      <!-- <el-table-column
         prop="roleId"
         header-align="center"
         align="center"
         width="80"
         label="ID">
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column
         prop="roleName"
         header-align="center"
@@ -45,7 +45,6 @@
         prop="createTime"
         header-align="center"
         align="center"
-        width="180"
         label="创建时间">
       </el-table-column>
       <el-table-column

+ 2 - 2
src/views/modules/sys/user.vue

@@ -22,13 +22,13 @@
         align="center"
         width="50">
       </el-table-column>
-      <el-table-column
+      <!-- <el-table-column
         prop="userId"
         header-align="center"
         align="center"
         width="80"
         label="ID">
-      </el-table-column>
+      </el-table-column> -->
       <el-table-column
         prop="username"
         header-align="center"