cloud-web-corejs 1.0.61 → 1.0.62

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.61",
4
+ "version": "1.0.62",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -1008,36 +1008,44 @@ modules = {
1008
1008
  rows.forEach((value) => {
1009
1009
  value.leaf = !value.hasChild;
1010
1010
  });
1011
+ let items = [];
1011
1012
  if (node.level === 0) {
1013
+ let item = {
1014
+ parent: null,
1015
+ fileName: this.title,
1016
+ leaf: rows.length == 0,
1017
+ allFileBtn: true,
1018
+ id: 0,
1019
+ children: rows,
1020
+ };
1021
+ items.push(item);
1012
1022
  setTimeout(() => {
1013
1023
  this.$refs.tree.setCurrentKey(node.childNodes[0].data);
1014
1024
  this.handleNodeData(node.childNodes[0]);
1015
1025
  node.childNodes[0].expand();
1026
+ if (this.option.treeExpandAll) {
1027
+ //默认全部展开树分类
1028
+ node.childNodes[0].childNodes.forEach(item => {
1029
+ if (!item.data.leaf) item.expand();
1030
+ })
1031
+ }
1016
1032
  }, 200);
1017
1033
  this.$nextTick(() => {
1018
1034
  callback && callback();
1019
1035
  });
1020
1036
  this.searchEvent();
1021
1037
  } else {
1038
+ items = rows;
1022
1039
  this.$nextTick(() => {
1040
+ if (this.option.treeExpandAll) {
1041
+ //默认全部展开树分类
1042
+ node.childNodes.forEach(item => {
1043
+ if (!item.data.leaf) item.expand();
1044
+ })
1045
+ }
1023
1046
  callback && callback();
1024
1047
  });
1025
1048
  }
1026
- let items = [];
1027
- if (node.level === 0) {
1028
- let item = {
1029
- parent: null,
1030
- fileName: this.title,
1031
- leaf: rows.length == 0,
1032
- allFileBtn: true,
1033
- id: 0,
1034
- children: rows,
1035
- };
1036
- items.push(item);
1037
- } else {
1038
- items = rows;
1039
- }
1040
-
1041
1049
  resolve(items);
1042
1050
  },
1043
1051
  });
@@ -35,7 +35,7 @@
35
35
  </label>
36
36
  </el-popover>
37
37
  <el-popover
38
- :disabled="!value1 || cities.length==0"
38
+ :disabled="selectTopLevel || (!value1 || cities.length==0)"
39
39
  placement="bottom"
40
40
  width="486"
41
41
  trigger="click"
@@ -55,7 +55,7 @@
55
55
  </label>
56
56
  </el-popover>
57
57
  <el-popover
58
- :disabled="!value2 || districts.length==0"
58
+ :disabled="selectTopLevel || (!value2 || districts.length==0)"
59
59
  placement="bottom"
60
60
  width="486"
61
61
  trigger="click"
@@ -75,7 +75,7 @@
75
75
  </label>
76
76
  </el-popover>
77
77
  <el-popover
78
- :disabled="!value3 || counties.length == 0"
78
+ :disabled="selectTopLevel || (!value3 || counties.length == 0)"
79
79
  placement="bottom"
80
80
  width="486"
81
81
  trigger="click"
@@ -175,7 +175,7 @@ import {selectDialogMixins} from '@base/mixins/selectDialog/index.js';
175
175
 
176
176
  export default {
177
177
  name: 'areaDialog',
178
- props: ['visiable', 'multi', 'rows', 'param'],
178
+ props: ['visiable', 'multi', 'rows', 'param', 'selectTopLevel'],
179
179
  mixins: [selectDialogMixins],
180
180
  created() {
181
181
  this.initSetting();
@@ -329,7 +329,8 @@ export default {
329
329
  url: USER_PREFIX + '/area/getChildren',
330
330
  method: "post",
331
331
  data: {
332
- id: id
332
+ id: id,
333
+ enabled: true
333
334
  },
334
335
  success: res => {
335
336
  // const {level} = node;
@@ -396,7 +397,18 @@ export default {
396
397
  checkboxConfig: {
397
398
  checkStrictly: true,
398
399
  showHeader: this.selectMulti,
399
- trigger: 'row'
400
+ trigger: 'row',
401
+ checkMethod: ({row}) => {
402
+ if (this.selectTopLevel) {
403
+ if (row.parent) {
404
+ return false;
405
+ } else {
406
+ return true;
407
+ }
408
+ }
409
+
410
+ return true;
411
+ }
400
412
  }
401
413
  }
402
414
  };