瀏覽代碼

修改标段授权组织

zhaoke 2 年之前
父節點
當前提交
ccb1e1c50f
共有 2 個文件被更改,包括 30 次插入70 次删除
  1. 29 69
      src/components/organization/index.vue
  2. 1 1
      src/views/lotAuthorization/components/home.vue

+ 29 - 69
src/components/organization/index.vue

@@ -5,45 +5,18 @@
       <div class="paren_header">
         <p>{{ title }}</p>
         <template>
-          <div
-            v-show="vice"
-            class="column"
-          >
-            <div
-              v-for="(item, index) in colType"
-              :key="index"
-              :class="active == index ? 'column_childs' : 'column_child'"
-              @click="upStart(index)"
-            >
+          <div v-show="vice" class="column">
+            <div v-for="(item, index) in colType" :key="index" :class="active == index ? 'column_childs' : 'column_child'" @click="upStart(index)">
               {{ item.name }}
             </div>
           </div>
         </template>
       </div>
       <div class="paren_content">
-        <div
-          v-show="active == 0"
-          class="dptBox"
-        >
+        <div v-show="active == 0" class="dptBox">
           <el-scrollbar style="height: 100%">
-            <el-tree
-              ref="tree"
-              :data="data"
-              :check-strictly="true"
-              :default-expanded-keys="defaultExpandedKeys"
-              show-checkbox
-              :props="defaultProps"
-              :default-checked-keys="checkedKeys"
-              :node-key="nodeKey"
-              highlight-current
-              @node-click="nodeClick"
-              @check-change="currentChange"
-            >
-              <span
-                slot-scope="{ data }"
-                :title="data[defaultProps.label]"
-                class="org-data-tree-node"
-              >
+            <el-tree ref="tree" :data="data" :check-strictly="true" :default-expanded-keys="defaultExpandedKeys" show-checkbox :props="defaultProps" :default-checked-keys="checkedKeys" :node-key="nodeKey" highlight-current @node-click="nodeClick" @check-change="currentChange">
+              <span slot-scope="{ data }" :title="data[defaultProps.label]" class="org-data-tree-node">
                 {{ data[defaultProps.label] }}
               </span>
             </el-tree>
@@ -52,27 +25,10 @@
         <!-- <div class="dptBox" v-if="doesJobShow" v-show="active == 1">
           <Rolelist :type="true" @radioChange="radioChange" :radioCheck="radioCheck" :number="8" :active="true" class="lessData" :mainData="mainData" />
         </div> -->
-        <div
-          v-show="active == 1"
-          class="dptBox duoBox"
-        >
+        <div v-show="active == 1" class="dptBox duoBox">
           <el-scrollbar style="height: 100%">
-            <el-tree
-              ref="treeDuo"
-              :data="data"
-              show-checkbox
-              :default-expanded-keys="defaultExpandedKeys"
-              :props="defaultProps"
-              :default-checked-keys="checkedKeysDuo"
-              :node-key="nodeKey"
-              highlight-current
-              @check-change="currentChangeDuo"
-            >
-              <span
-                slot-scope="{ data }"
-                :title="data[defaultProps.label]"
-                class="org-data-tree-node"
-              >
+            <el-tree ref="treeDuo" :data="data" show-checkbox :check-strictly="checkStrictly" :default-expanded-keys="defaultExpandedKeys" :props="defaultProps" :default-checked-keys="checkedKeysDuo" :node-key="nodeKey" highlight-current @check-change="currentChangeDuo">
+              <span slot-scope="{ data }" :title="data[defaultProps.label]" class="org-data-tree-node">
                 {{ data[defaultProps.label] }}
               </span>
             </el-tree>
@@ -109,7 +65,7 @@ export default {
     },
     defaultProps: {
       type: Object,
-      default: () => {}
+      default: () => { }
     },
     checkedKeys: {
       // 已选中
@@ -146,9 +102,13 @@ export default {
     defaultMultiple: {
       type: Boolean,
       default: false
+    },
+    checkStrictly: {
+      type: Boolean,
+      default: false
     }
   },
-  data() {
+  data () {
     return {
       active: 0,
       colType: [
@@ -167,7 +127,7 @@ export default {
   },
   watch: {
     checkedKeys: {
-      handler(val) {
+      handler (val) {
         this.checkedList = val
         this.$refs.tree.setCheckedKeys(val)
         this.getExpandedKeysStep.splice(0, 1, true)
@@ -175,19 +135,19 @@ export default {
       deep: true
     },
     checkedKeysDuo: {
-      handler(val) {
+      handler (val) {
         this.$refs.tree.setCheckedKeys(val)
       },
       deep: true
     },
     orgList: {
-      handler() {
+      handler () {
         this.getExpandedKeysStep.splice(1, 1, true)
       },
       deep: true
     },
     getExpandedKeysStep: {
-      handler(val) {
+      handler (val) {
         if (val.every(v => v)) {
           this.defaultExpandedKeys = [-1]
           this.checkedKeys.forEach(key => {
@@ -206,7 +166,7 @@ export default {
       deep: true
     }
   },
-  mounted() {
+  mounted () {
     if (this.data != null) {
       this.data = this.formatData(this.data)
     }
@@ -216,11 +176,11 @@ export default {
   },
   methods: {
     // 点击选择
-    upStart(index) {
+    upStart (index) {
       this.active = index
       this.$emit('getTreeindex', index)
     },
-    formatData(params) {
+    formatData (params) {
       const data = params
       data.forEach(item => {
         if (Object.hasOwnProperty.call(item, 'children')) {
@@ -230,7 +190,7 @@ export default {
       })
       return data
     },
-    currentChange(data, isChecked) {
+    currentChange (data, isChecked) {
       const key = data[this.nodeKey]
       this.$emit('getTreeData', this.$refs.tree.getCheckedNodes())
       if (isChecked) {
@@ -238,12 +198,12 @@ export default {
         this.$refs.tree.setCheckedKeys(checked)
       }
     },
-    currentChangeDuo() {
+    currentChangeDuo () {
       const arr = this.$refs.treeDuo.getCheckedNodes()
       this.$emit('getTreeDataDuo', arr)
     },
     // 选中后设置初始数据
-    setDataObj(arr) {
+    setDataObj (arr) {
       arr.forEach(item => {
         if (!item.children) {
           item.children = {
@@ -262,17 +222,17 @@ export default {
       })
       this.$emit('getTreeData', arr)
     },
-    nodeClick(data) {
+    nodeClick (data) {
       this.$emit('getTreeDatas', data)
     },
-    radioChange(val) {
+    radioChange (val) {
       this.$emit('radioChange', val)
     },
     // 多选框
-    checkChange(arr) {
+    checkChange (arr) {
       this.$emit('checkChange', arr)
     },
-    checkClick(item) {
+    checkClick (item) {
       this.$emit('checkClick', item)
     }
   }
@@ -280,7 +240,7 @@ export default {
 </script>
 
 <style lang="scss">
-@import './organization.scss';
+@import "./organization.scss";
 .DBox {
   cursor: not-allowed;
 }

+ 1 - 1
src/views/lotAuthorization/components/home.vue

@@ -27,7 +27,7 @@
           <MultipleTree ref="organizationTree" :default-props="{
               children: 'children',
               label: 'OrganName'
-            }" :data="orgTree" :checked-keys-duo="orgCheckedKeys" :org-list="orgList" :default-multiple="true" node-key="OrganId" up-node-key="OrganUpid" title="选择组织" @getTreeDataDuo="orgCheckChangeHandler" />
+            }" :data="orgTree" :checked-keys-duo="orgCheckedKeys" :check-strictly="true" :org-list="orgList" :default-multiple="true" node-key="OrganId" up-node-key="OrganUpid" title="选择组织" @getTreeDataDuo="orgCheckChangeHandler" />
         </div>
       </el-col>
     </el-row>