朱鑫波 преди 4 години
родител
ревизия
52c9484c46
променени са 2 файла, в които са добавени 11 реда и са изтрити 4 реда
  1. 9 2
      src/views/modules/crowd-control/components/tree-select/tree-select.vue
  2. 2 2
      vue.config.js

+ 9 - 2
src/views/modules/crowd-control/components/tree-select/tree-select.vue

@@ -69,7 +69,8 @@ export default {
             applyTypeOption: [],
             selectRightData: new Set(),
             spinning: true,
-            leftTreeNoData: false
+            leftTreeNoData: false,
+            middleValue: []
         };
     },
     mounted() {
@@ -146,6 +147,12 @@ export default {
         onChange(e) {
             const value = e.target.value;
             this.treeData = value !== '' ? this.getNewTreeData(this.updateTreeData, value) : [...this.updateTreeData];
+            if(value !== '') {
+                this.middleValue = this.checkedKeys.filter(item=>typeof item === 'number')
+            }
+            else {
+                this.middleValue = []
+            }
             if (!this.treeData.length) {
                 this.spinning = false;
                 this.leftTreeNoData = true;
@@ -233,7 +240,7 @@ export default {
             // this.checkedKeys = checkedKeys;
             this.nodes(this.treeData, checkedKeys);
             const filterCheckKey = this.checkedKeys.filter(item=>typeof item ==='number');
-            let filterCheckKeySet = new Set(filterCheckKey);
+            let filterCheckKeySet = new Set(filterCheckKey.concat(this.middleValue));
             let selectRightDataSet = new Set(this.selectRightData);
             let difference = new Set([...selectRightDataSet].filter((item) => !filterCheckKeySet.has(item.key)));
             this.selectRightData.delete(...difference);

+ 2 - 2
vue.config.js

@@ -80,13 +80,13 @@ module.exports = {
         // target: 'http://192.168.1.219:8080', //请求本地 需要jeecg-boot后台项目  赵西安
         // target: 'http://192.168.1.193:8080', //请求本地 需要jeecg-boot后台项目  李煜一
         // target: 'http://192.168.1.193:31012', //请求本地 需要jeecg-boot后台项目  李煜一
-        //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
+         target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目
         // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目
         //  target: 'http://adsp.tjyourong.com.cn/', //请求本地 需要jeecg-boot后台项目
         // target: 'http://192.168.1.251/', //请求本地 需要jeecg-boot后台项目 
         // target:'http://118.24.244.213:8804',
-       target:'http://139.186.165.84:8806', //测试
+      //  target:'http://139.186.165.84:8806', //测试
 
         ws: false,