bri-components 1.3.27 → 1.3.28

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,6 +1,6 @@
1
1
  {
2
2
  "name": "bri-components",
3
- "version": "1.3.27",
3
+ "version": "1.3.28",
4
4
  "author": "dengshanghui",
5
5
  "description": "a component lib for vue project",
6
6
  "main": "src/index.js",
@@ -15,7 +15,7 @@
15
15
  'BriUpload-disabled': canEdit && !finalCanEdit,
16
16
  'BriUpload-readonly': !canEdit,
17
17
  'BriUpload-unit': !canEdit && isInTable,
18
- [`BriUpload-${showType}`]: true,
18
+ [`BriUpload-${showMode}`]: true,
19
19
  }"
20
20
  >
21
21
  <!-- 编辑 -->
@@ -40,11 +40,11 @@
40
40
  >
41
41
 
42
42
  <slot>
43
- <div :class="`BriUpload-${showType}-add`">
43
+ <div :class="`BriUpload-${showMode}-add`">
44
44
  <!-- 上传 -->
45
45
  <i-circle
46
46
  v-if="percent"
47
- :class="`BriUpload-${showType}-circle`"
47
+ :class="`BriUpload-${showMode}-circle`"
48
48
  :percent="percent"
49
49
  :stroke-color="percentColor"
50
50
  >
@@ -54,7 +54,7 @@
54
54
  type="ios-checkmark"
55
55
  ></Icon>
56
56
  <!-- 上传中 -->
57
- <span v-else-if="showType === 'old'">
57
+ <span v-else-if="showMode === 'old'">
58
58
  {{ percent }}%
59
59
  </span>
60
60
  </i-circle>
@@ -66,7 +66,7 @@
66
66
  @click="clickUpload"
67
67
  ></dsh-icons>
68
68
 
69
- <span v-if="showType !== 'inline'">
69
+ <span v-if="showMode !== 'inline'">
70
70
  点击上传{{ subType === 'image' ? "图片" : "文件" }}
71
71
  </span>
72
72
  </template>
@@ -80,7 +80,7 @@
80
80
  :canEdit="finalCanEdit"
81
81
  :files="curValList"
82
82
  :emptyShowVal="emptyShowVal"
83
- :showType="showType"
83
+ :showMode="showMode"
84
84
  :propsObj="propsObj"
85
85
  @deleteItem="clickDeteItem"
86
86
  ></upload-list>
@@ -138,7 +138,7 @@
138
138
  selfPropsObj () {
139
139
  return {
140
140
  _fileType: "file",
141
- _showType: this.isHeightAuto ? "old" : "inline", // 宽度为100%、且不在级联表格或内部表格里的 显示老版
141
+ _showMode: this.isHeightAuto ? "old" : "inline", // 宽度为100%、且不在级联表格或内部表格里的 显示老版
142
142
  // _multiple: true,
143
143
  _useType: "drag",
144
144
  _maxSize: 1024 * 1024,
@@ -153,8 +153,8 @@
153
153
  subType () {
154
154
  return this.selfPropsObj._fileType;
155
155
  },
156
- showType () {
157
- return this.isInTable ? "inline" : this.selfPropsObj._showType;
156
+ showMode () {
157
+ return this.isInTable ? "inline" : this.selfPropsObj._showMode;
158
158
  },
159
159
  useType () {
160
160
  return this.selfPropsObj._useType;
@@ -178,7 +178,7 @@
178
178
  [`${prefixCls}-select`]: this.useType === "select",
179
179
  [`${prefixCls}-drag`]: this.useType === "drag",
180
180
  [`${prefixCls}-dragOver`]: this.useType === "drag" && this.dragOver,
181
- [`BriUpload-${this.showType}-wrapper`]: true
181
+ [`BriUpload-${this.showMode}-wrapper`]: true
182
182
  };
183
183
  }
184
184
  },
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div
3
3
  class="uploadList"
4
- :class="`uploadList-${showType}`"
4
+ :class="`uploadList-${showMode}`"
5
5
  >
6
6
  <!-- 普通文本模式 -->
7
- <template v-if="showType ==='old'">
7
+ <template v-if="showMode ==='old'">
8
8
  <!-- 有值 -->
9
9
  <div
10
10
  v-if="files.length"
@@ -116,7 +116,7 @@
116
116
  return [];
117
117
  }
118
118
  },
119
- showType: {
119
+ showMode: {
120
120
  type: String,
121
121
  default: "old" // inline, old, normal
122
122
  },
@@ -5,7 +5,7 @@
5
5
  class="DshCascader"
6
6
  >
7
7
  <component
8
- :is="showTypeMap[showType]"
8
+ :is="showTypeMap[showMode]"
9
9
  v-model="showModal"
10
10
  :activeValue="curValList"
11
11
  :data="cascaderData"
@@ -77,7 +77,7 @@
77
77
  class="DshCascaders"
78
78
  >
79
79
  <component
80
- :is="showTypeMap[showType]"
80
+ :is="showTypeMap[showMode]"
81
81
  v-model="showModal"
82
82
  :multipleMode="multipleMode"
83
83
  :data="cascaderData"
@@ -40,11 +40,11 @@
40
40
  <div
41
41
  v-if="canUseModeSwitch"
42
42
  class="mode"
43
- @click="showMode = showMode === 'default' ? 'flat' : 'default'"
43
+ @click="searchMode = searchMode === 'default' ? 'flat' : 'default'"
44
44
  >
45
45
  <dsh-icons :list="[{ icon: 'md-swap' }]" />
46
46
  <span class="mode-name">
47
- {{ showMode === "default" ? "按层级" : "按平级" }}
47
+ {{ searchMode === "default" ? "按层级" : "按平级" }}
48
48
  </span>
49
49
  </div>
50
50
 
@@ -206,7 +206,7 @@
206
206
 
207
207
  search () {
208
208
  this.selectedValue = [];
209
- this.showMode = "default";
209
+ this.searchMode = "default";
210
210
  },
211
211
  clickItem (node) {
212
212
  // 避免重复点击
@@ -51,11 +51,11 @@
51
51
  <div
52
52
  v-if="canUseModeSwitch"
53
53
  class="mode"
54
- @click="showMode = showMode === 'default' ? 'flat' : 'default'"
54
+ @click="searchMode = searchMode === 'default' ? 'flat' : 'default'"
55
55
  >
56
56
  <dsh-icons :list="[{ icon: 'md-swap' }]" />
57
57
  <span class="mode-name">
58
- {{ showMode === "default" ? "按层级" : "按平级" }}
58
+ {{ searchMode === "default" ? "按层级" : "按平级" }}
59
59
  </span>
60
60
  </div>
61
61
 
@@ -243,7 +243,7 @@
243
243
 
244
244
  search () {
245
245
  this.selectedValue = [];
246
- this.showMode = "default";
246
+ this.searchMode = "default";
247
247
  this.curTabIndex = 0;
248
248
  },
249
249
  clickItem (node) {
@@ -261,7 +261,7 @@
261
261
  }
262
262
 
263
263
  // 区分展示方式
264
- if (this.showMode === "default" && node.children.length) {
264
+ if (this.searchMode === "default" && node.children.length) {
265
265
  this.curTabIndex = this.curTabIndex + 1;
266
266
  }
267
267
  }
@@ -191,13 +191,14 @@
191
191
  computed: {
192
192
  selfPropsObj () {
193
193
  return {
194
+ _showType: "marker", // "marker", "multipleMarker", "polyline", "polygon", "rectangle"
194
195
  _icon: "ios-map-outline",
195
196
 
196
197
  ...this.propsObj,
197
198
  ...this.commonDealPropsObj
198
199
  };
199
200
  },
200
- showType () {
201
+ showMode () {
201
202
  return this.selfPropsObj._showType;
202
203
  },
203
204
 
@@ -323,7 +324,7 @@
323
324
  if (!this.$isEmptyData(this.newVal)) {
324
325
  this.handleAddMarker(this.newVal.lnglat, true);
325
326
 
326
- if (this.showType === "multipleMarker") { // 多选打开绘图功能
327
+ if (this.showMode === "multipleMarker") { // 多选打开绘图功能
327
328
  this.finalCanEdit && this.handleOpenDraw();
328
329
  }
329
330
  } else {
@@ -332,10 +333,10 @@
332
333
  },
333
334
  handleMouseToolCallback (e) {
334
335
  if (e.obj.CLASS_NAME === "AMap.Marker") {
335
- if (this.showType === "marker") {
336
+ if (this.showMode === "marker") {
336
337
  this.plot = e.obj;
337
338
  this.handleCloseDraw();
338
- } else if (this.showType === "multipleMarker") {
339
+ } else if (this.showMode === "multipleMarker") {
339
340
  if (this.plot) {
340
341
  this.plot.push(e.obj);
341
342
  } else {
@@ -369,7 +370,7 @@
369
370
  }
370
371
  },
371
372
  // 打开绘图
372
- handleOpenDraw (type = this.showType) {
373
+ handleOpenDraw (type = this.showMode) {
373
374
  switch (type) {
374
375
  case "marker": {
375
376
  this.mouseTool.marker(markerOpt);
@@ -402,7 +403,7 @@
402
403
  this.mouseTool.close();
403
404
  },
404
405
  // 添加图形
405
- handleAddMarker (location, centerView = true, type = this.showType) {
406
+ handleAddMarker (location, centerView = true, type = this.showMode) {
406
407
  location = JSON.parse(JSON.stringify(location));
407
408
  // 分类型添加
408
409
  if (["polygon", "rectangle", "circle"].includes(type)) {
@@ -417,12 +418,12 @@
417
418
  !this.marker && (this.marker = new AMap.Marker());
418
419
  this.marker.setPosition(location);
419
420
  this.marker.setMap(this.map);
420
- if (this.showType === "marker") {
421
+ if (this.showMode === "marker") {
421
422
  this.handleRmoveMarker();
422
423
  this.handleCloseDraw();
423
424
  this.newVal.lnglat = [location];
424
425
  this.getRegeoCode();
425
- } else if (this.showType === "multipleMarker") {
426
+ } else if (this.showMode === "multipleMarker") {
426
427
  this.newVal.lnglat.push(location);
427
428
  this.getRegeoCode();
428
429
  }
@@ -445,7 +446,7 @@
445
446
  }
446
447
  },
447
448
  // 移除图形
448
- handleRmoveMarker (type = this.showType) {
449
+ handleRmoveMarker (type = this.showMode) {
449
450
  if (["default"].includes(type)) {
450
451
  this.marker && this.map.remove(this.marker);
451
452
  this.plot && this.map.remove(this.plot);
@@ -155,8 +155,8 @@
155
155
 
156
156
  &-edit {
157
157
  &-suffix {
158
- min-width: 32px;
159
- padding: 0px 6px;
158
+ min-width: 30px;
159
+ padding: 0px 5px;
160
160
  border-left: 1px solid @borderColor;
161
161
  background-color: #F0F0F0;
162
162
  text-align: center;
@@ -5,7 +5,7 @@
5
5
  class="DshCheckbox"
6
6
  >
7
7
  <!-- flat方式 -->
8
- <template v-if="showType === 'flat'">
8
+ <template v-if="showMode === 'flat'">
9
9
  <!-- 有选项 -->
10
10
  <template v-if="listData.length">
11
11
  <CheckboxGroup
@@ -5,7 +5,7 @@
5
5
  class="DshSelect"
6
6
  >
7
7
  <!-- flat方式 -->
8
- <template v-if="['flat', 'button'].includes(showType)">
8
+ <template v-if="['flat', 'button'].includes(showMode)">
9
9
  <!-- 有选项 -->
10
10
  <template v-if="listData.length">
11
11
  <RadioGroup
@@ -161,7 +161,7 @@
161
161
  };
162
162
  },
163
163
  radioGroupType () {
164
- return this.showType === "button" ? "button" : undefined;
164
+ return this.showMode === "button" ? "button" : undefined;
165
165
  }
166
166
  },
167
167
  created () {},
@@ -35,7 +35,7 @@ export default {
35
35
  _joinSymbol: _joinSymbol // 级联拼接符
36
36
  };
37
37
  },
38
- showType () {
38
+ showMode () {
39
39
  return this.selfPropsObj._showMode;
40
40
  },
41
41
  colorMap () {
@@ -33,7 +33,7 @@ export default {
33
33
  data () {
34
34
  return {
35
35
  searchName: "",
36
- showMode: "default", // "flat", "default"
36
+ searchMode: "default", // "flat", "default"
37
37
  maxFlatModeSearchNum: 80,
38
38
 
39
39
  inputStr: "",
@@ -102,7 +102,7 @@ export default {
102
102
  useFlatMode () {
103
103
  return this.filterable &&
104
104
  this.canUseModeSwitch &&
105
- this.showMode === "flat";
105
+ this.searchMode === "flat";
106
106
  },
107
107
  modeTip () {
108
108
  return `在搜索时,会出现层级和平级切换开关,但搜索出的结果超${this.maxFlatModeSearchNum}个时,\
@@ -132,7 +132,7 @@ export default {
132
132
  return {
133
133
  // TODO: 此处的请输入可能还有请选择之类的,待处理
134
134
  _placeholder: this.canEdit && this.propsObj._enterType !== "calculate"
135
- ? (this.propsObj._placeholder || `请${selectControlTypes.includes(this.controlType) ? "选择" : "输入"}${this.propsObj._name}`)
135
+ ? (this.propsObj._placeholder || `${selectControlTypes.includes(this.controlType) ? "选择" : "输入"}${this.propsObj._name}`)
136
136
  : undefined,
137
137
  _clearable: this.finalCanEdit && (this.propsObj._clearable === undefined ? true : this.propsObj._clearable),
138
138
  _disabled: this.propsObj._disabled || ["serialNumber"].includes(this.controlType) || !this.finalCanEdit
@@ -36,7 +36,7 @@ export default {
36
36
  nameKey () {
37
37
  return this.selfPropsObj._nameKey;
38
38
  },
39
- showType () {
39
+ showMode () {
40
40
  return this.selfPropsObj._optionKind;
41
41
  },
42
42
  colorMap () {
@@ -172,11 +172,21 @@
172
172
  _highSearch: false,
173
173
  _changeOnSelect: true,
174
174
  _searchString: "",
175
+ _reverseFilter: false,
176
+ _userDepartFilterVals: [],
175
177
 
176
178
  ...this.propsObj,
177
179
  ...this.commonDealPropsObj
178
180
  };
179
181
  },
182
+ // 反向过滤
183
+ reverseFilter () {
184
+ return this.selfPropsObj._reverseFilter;
185
+ },
186
+ // 禁止显示的部门以及部门下人员
187
+ listFilterVals () {
188
+ return this.selfPropsObj._userDepartFilterVals;
189
+ },
180
190
  highSearch () {
181
191
  return this.isOnSearch ? true : this.selfPropsObj._highSearch;
182
192
  },
@@ -295,7 +305,14 @@
295
305
  },
296
306
  callback: data => {
297
307
  this.loading = false;
298
- this.departmentList = data.list;
308
+ this.departmentList = this.listFilterVals.length
309
+ ? data.list.filter(
310
+ item =>
311
+ this.reverseFilter
312
+ ? !this.listFilterVals.includes(item._key)
313
+ : this.listFilterVals.includes(item._key)
314
+ )
315
+ : data.list;
299
316
  }
300
317
  });
301
318
  }
@@ -337,7 +337,6 @@
337
337
  };
338
338
  this.curDepartment = {};
339
339
  this.pagePropsObj.page = 1;
340
- this.getUserListData();
341
340
  this.getDepartmentListData();
342
341
  },
343
342
  search () {
@@ -421,11 +420,11 @@
421
420
  },
422
421
  loadingName: "loading",
423
422
  callback: data => {
424
- this.userList = this.listFilterVals.length
423
+ this.userList = this.allListFilterVals.length
425
424
  ? data.list.filter(item =>
426
425
  this.reverseFilter
427
- ? !this.listFilterVals.includes(item.departmentKey)
428
- : this.listFilterVals.includes(item.departmentKey)
426
+ ? !this.allListFilterVals.includes(item.departmentKey)
427
+ : this.allListFilterVals.includes(item.departmentKey)
429
428
  )
430
429
  : data.list;
431
430
  this.total = data.total;
@@ -471,6 +470,10 @@
471
470
  searchString: this.propsObj.searchString
472
471
  },
473
472
  callback: data => {
473
+ // 当前部门被过滤,所有子级部门同样过滤
474
+ const depts = data.list.filter(item => this.listFilterVals.includes(item._key));
475
+ this.allListFilterVals = this.getAllListFilterVals(depts).map(item => item._key);
476
+
474
477
  this.departmentList = [
475
478
  ...(
476
479
  this.highSearch
@@ -512,8 +515,20 @@
512
515
  : data.list
513
516
  )
514
517
  ];
518
+
519
+ this.getUserListData();
515
520
  }
516
521
  });
522
+ },
523
+
524
+ getAllListFilterVals (list) {
525
+ if (list.length) {
526
+ let stack = [...list];
527
+ return stack.reduce((prev, item) => {
528
+ return prev.concat(item.children && item.children.length ? this.getAllListFilterVals(item.children) : []);
529
+ }, stack);
530
+ }
531
+ return [];
517
532
  }
518
533
  },
519
534
  filters: {
@@ -196,6 +196,7 @@
196
196
  :key="dataItem._id"
197
197
  class="DshCrossTable-td-checkbox"
198
198
  :style="{
199
+ width: colWidth ? colWidth + 'px' : '200px',
199
200
  background: '#f4f4f4',
200
201
  textAlign: 'center'
201
202
  }"
@@ -217,6 +218,7 @@
217
218
  :key="dataItem._id"
218
219
  class="DshCrossTable-td-index"
219
220
  :style="{
221
+ width: colWidth ? colWidth + 'px' : '200px',
220
222
  background: '#f4f4f4',
221
223
  textAlign: 'center'
222
224
  }"
@@ -232,6 +234,9 @@
232
234
  <div
233
235
  v-if="showTable"
234
236
  class="DshCrossTable-right-body"
237
+ :style="showScrollX === false ? {
238
+ overflowX: 'hidden'
239
+ } : {}"
235
240
  @scroll="tableScroll($event)"
236
241
  >
237
242
  <!-- 无数据 -->
@@ -333,6 +338,7 @@
333
338
  :key="dataItem._id"
334
339
  class="DshCrossTable-td-operation"
335
340
  :style="{
341
+ width: colWidth ? colWidth + 'px' : '200px',
336
342
  background: '#f4f4f4',
337
343
  }"
338
344
  >
@@ -403,6 +409,7 @@
403
409
  rowWidth: 0,
404
410
  colWidth: 0,
405
411
  titleWidth: 200,
412
+ showScrollX: false,
406
413
  showTable: false,
407
414
  currentPage: 1,
408
415
  pagesize: 10,
@@ -557,14 +564,16 @@
557
564
  let that = this;
558
565
  erd.listenTo(document.getElementById("DshCrossTable-right"), function (element) {
559
566
  // 计算宽度
560
- let tableWidth = that.$refs["DshCrossTable-right"].clientWidth;
567
+ let tableWidth = that.$refs["DshCrossTable-right"].clientWidth - 10;
561
568
  let nums = tableWidth / 200;
562
569
  let dataTotal = that.data.length;
563
570
  if (nums >= dataTotal) {
564
571
  that.rowWidth = tableWidth;
565
- that.colWidth = (tableWidth - 10) / dataTotal;
572
+ that.colWidth = tableWidth / dataTotal;
573
+ that.showScrollX = false;
566
574
  } else {
567
575
  that.rowWidth = dataTotal * 200;
576
+ that.showScrollX = true;
568
577
  }
569
578
 
570
579
  // that.rowWidth = 200 * that.data.length;
@@ -410,7 +410,7 @@
410
410
  },
411
411
  // 整行校验结果
412
412
  getRowRuleResult (row, rowIndex) {
413
- this.filterColumns.every(col => this.getColRuleResult(col, row[col.nodeKey], rowIndex, true).bool);
413
+ return this.filterColumns.every(col => this.getColRuleResult(col, row[col.nodeKey], rowIndex).bool);
414
414
  },
415
415
  // 单元格校验结果
416
416
  getColRuleResult (col, row, rowIndex) {
@@ -52,7 +52,7 @@
52
52
  const treeData = this.getCalcuTree(this.data, this.filterColumns);
53
53
  return this.$getTreeFlatArr(treeData, node =>
54
54
  (this.searchFormList.length ? this.$isAdvRelyAccord(this.advSearchObj, node) : true) &&
55
- (node.level === 1 || node.__isShow__)
55
+ (node.level === 1 || node.__isRendered__)
56
56
  );
57
57
  },
58
58
  footerData () {
@@ -120,14 +120,11 @@
120
120
  cellStyleOption: {
121
121
  bodyCellClass: ({ row, column, rowIndex }) => {
122
122
  return "bri-table-td" +
123
- `${
124
- this.canEdit
125
- ? " bri-table-td-edit"
126
- : " bri-table-td-show"
127
- }` +
123
+ `${this.canEdit ? " bri-table-td-edit" : " bri-table-td-show"}` +
124
+ `${row.__isShow__ === false ? " bri-table-td-hide" : ""}` +
128
125
  `${
129
126
  ["__isExpand__"].includes(column._key)
130
- ? " bri-table-td-normal"
127
+ ? " bri-table-td-expand"
131
128
  : ["__index__"].includes(column._key)
132
129
  ? " bri-table-td-index"
133
130
  : ""
@@ -158,22 +155,22 @@
158
155
  _key: "__isExpand__",
159
156
  key: "__isExpand__",
160
157
  field: "__isExpand__",
161
- width: 46,
158
+ width: 48,
162
159
  align: "center",
163
160
  fixed: "left",
164
161
  renderBodyCell: ({ row, column, rowIndex }, h) => {
165
162
  return row.children && row.children.length
166
163
  ? h("Icon", {
167
164
  style: {
168
- width: "14px",
169
- height: "14px",
165
+ width: "16px",
166
+ height: "16px",
170
167
  cursor: "pointer",
171
168
  transform: row.__isExpand__ ? "rotate(90deg)" : "rotate(0deg)",
172
169
  transition: "transform 0.4s"
173
170
  },
174
171
  props: {
175
172
  type: "ios-arrow-forward",
176
- size: "14"
173
+ size: "18"
177
174
  },
178
175
  on: {
179
176
  click: () => {
@@ -252,12 +249,10 @@
252
249
  };
253
250
  },
254
251
  toggleExpand (row, bool = true) {
255
- this.$set(row, "__isRendered__", true);
256
-
252
+ this.$set(row, "__isRendered__", true);// 作用不大 可有可无
257
253
  this.$set(row, "__isExpand__", bool);
258
- row.children.forEach(subRow => {
259
- this.$set(subRow, "__isShow__", bool);
260
- });
254
+
255
+ this.toggleDescendantsShow(row, bool);
261
256
  },
262
257
  // 点击 -添加一行
263
258
  clickCreate (operationItem, row, rowIndex) {
@@ -273,48 +268,38 @@
273
268
  },
274
269
  // 点击 -删除行
275
270
  clickDelete (operationItem, row, rowIndex) {
276
- const parentNode = this.getParentNode(this.data, row);
277
- const index = parentNode.children.findIndex(childNode => childNode._id === row._id);
278
- parentNode.children.splice(index, 1);
279
- console.log(index);
280
- console.log(parentNode);
281
- // this.$Modal.confirm({
282
- // title: "警告",
283
- // content: "确定删除吗?",
284
- // onOk: () => {
285
-
286
- // }
287
- // });
271
+ this.$Modal.confirm({
272
+ title: "警告",
273
+ content: "确定删除吗?",
274
+ onOk: () => {
275
+ const parentNode = this.getParentNode(this.data, row);
276
+ const index = parentNode.children.findIndex(childNode => childNode._id === row._id);
277
+ parentNode.children.splice(index, 1);
278
+ console.log(index);
279
+ console.log(parentNode);
280
+ }
281
+ });
288
282
  },
289
283
 
284
+ /* ------ 工具方法 ------- */
290
285
  getCalcuTree (tree = [], columns) {
291
286
  const loop = (list = []) =>
292
287
  list.reduce((newList, node) => {
293
288
  if (node.children && node.children.length) {
294
289
  node.isLeaf = false;
295
-
296
290
  node.children = loop(node.children);
291
+
297
292
  columns.reduce((newNode, col) => {
298
- newNode[col._key] = col._type === "number" && ![undefined, null, "", "no"].includes(col._summaryType)
299
- ? this.$calNumList(
300
- node.children.map(subNode => subNode[col._key]),
301
- col._summaryType,
302
- { ...col, _defaultDigit: 2 },
303
- false
304
- )
305
- : newNode[col._key];
306
- // this.$set(
307
- // newNode,
308
- // col._key,
309
- // col._type === "number" && ![undefined, null, "", "no"].includes(col._summaryType)
310
- // ? this.$calNumList(
311
- // node.children.map(subNode => subNode[col._key]),
312
- // col._summaryType,
313
- // { ...col, _defaultDigit: 2 },
314
- // false
315
- // )
316
- // : newNode[col._key]
317
- // );
293
+ if (col._type === "number" && ![undefined, null, "", "no"].includes(col._summaryType)) {
294
+ newNode[col._key] = col._type === "number" && ![undefined, null, "", "no"].includes(col._summaryType)
295
+ ? this.$calNumList(
296
+ node.children.map(subNode => subNode[col._key]),
297
+ col._summaryType,
298
+ { ...col, _defaultDigit: 2 },
299
+ false
300
+ )
301
+ : newNode[col._key];
302
+ }
318
303
 
319
304
  return newNode;
320
305
  }, node);
@@ -353,6 +338,29 @@
353
338
  loop(tree);
354
339
  return parentNode;
355
340
  }
341
+ },
342
+ toggleDescendantsShow (node, bool) {
343
+ const loop = (node, isFirstSon) => {
344
+ if (node.children && node.children.length) {
345
+ node.children.forEach(subNode => {
346
+ if (isFirstSon) {
347
+ this.$set(subNode, "__isRendered__", true);
348
+ this.$set(subNode, "__isShow__", bool);
349
+ } else {
350
+ if (bool) {
351
+ this.$set(subNode, "__isShow__", subNode.__isTmpShow__);
352
+ } else {
353
+ this.$set(subNode, "__isTmpShow__", subNode.__isShow__);
354
+ this.$set(subNode, "__isShow__", false);
355
+ }
356
+ }
357
+
358
+ loop(subNode);
359
+ });
360
+ }
361
+ };
362
+
363
+ loop(node, true);
356
364
  }
357
365
  }
358
366
  };
@@ -53,7 +53,7 @@ export default {
53
53
  _heightAuto: false, // 单元格高度自适应
54
54
  _useSelection: false, // 使用选择列
55
55
  _useIndex: true, // 使用序号列
56
- _useSummary: true, // 使用汇总行
56
+ _useSummary: false, // 使用汇总行
57
57
  _disabledBtns: false, // 禁用增删按钮
58
58
  _disabledCreateBtn: false, // 置灰新增按钮,目前只内部使用,comp_web数据表配置页那块
59
59
  _disabledOldDataRow: false, // 置灰老数据行包含删除
@@ -37,34 +37,43 @@
37
37
  height: 100% !important;
38
38
 
39
39
  .ve-table-content-wrapper table.ve-table-content {
40
- thead.ve-table-header tr.ve-table-header-tr th.ve-table-header-th {
41
- padding: 4px 8px;
42
-
43
- .ve-table-filter .ve-table-filter-icon {
44
- &:hover {
45
- color: @themeColor;
40
+ thead.ve-table-header {
41
+ tr.ve-table-header-tr th.ve-table-header-th {
42
+ padding: 4px 8px;
43
+
44
+ .ve-table-filter .ve-table-filter-icon {
45
+ &:hover {
46
+ color: @themeColor;
47
+ }
46
48
  }
47
- }
48
-
49
- // 排序
50
- .ve-table-sort {
51
- position: absolute !important;
52
- top: 5px;
53
- right: 4px;
54
-
55
- .icon-vet-sort-top-arrow:before {
56
- content: "\e6347";
49
+
50
+ // 排序
51
+ .ve-table-sort {
52
+ position: absolute !important;
53
+ top: 5px;
54
+ right: 4px;
55
+
56
+ .icon-vet-sort-top-arrow:before {
57
+ content: "\e6347";
58
+ }
59
+
60
+ .icon-vet-sort-bottom-arrow:before {
61
+ content: "\e6349";
62
+ }
57
63
  }
64
+ }
65
+ }
66
+
67
+ tbody.ve-table-body {
68
+ tr.ve-table-body-tr,
69
+ tr.ve-table-expand-tr {
70
+ height: auto;
58
71
 
59
- .icon-vet-sort-bottom-arrow:before {
60
- content: "\e6349";
72
+ td.ve-table-body-td {
73
+ padding: 4px 16px;
61
74
  }
62
75
  }
63
76
  }
64
-
65
- // tbody.ve-table-body tr.ve-table-body-tr td.ve-table-body-td {
66
- // padding: 4px 12px;
67
- // }
68
77
  }
69
78
  }
70
79
 
@@ -91,7 +100,7 @@
91
100
  &-empty {
92
101
  width: 100%;
93
102
  height: 100%;
94
- padding: 9px 20px;
103
+ padding: 9px 16px;
95
104
  border: 1px solid @borderColor;
96
105
  border-top: none;
97
106
  // border-bottom-left-radius: @borderRadius;
@@ -115,12 +124,12 @@
115
124
  position: relative;
116
125
 
117
126
  &-tip {
118
- padding: 0px 0px 0px 20px;
127
+ padding: 0px 0px 0px 16px;
119
128
  font-size: 12px;
120
129
  line-height: 1;
121
130
  color: #ed4014;
122
131
  position: absolute;
123
- top: calc(100% - 13px);
132
+ top: calc(100% - 12px);
124
133
  left: 0px;
125
134
  }
126
135
 
@@ -142,19 +151,20 @@
142
151
  }
143
152
 
144
153
  &-edit {
145
- padding: 4px 20px 12px 20px!important;
154
+ padding: 4px 16px 12px 16px!important;
146
155
  }
147
156
  &-show {
148
- padding: 4px 20px!important;
149
- // padding: 4px 12px!important;
157
+
150
158
  }
151
- &-normal {
152
- padding: 4px 8px!important;
153
- // padding: 4px 12px!important;
159
+ &-hide {
160
+ display: none!important;
154
161
  }
155
162
  &-index {
156
163
  padding: 4px 16px 4px 12px!important;
157
164
  }
165
+ &-expand {
166
+
167
+ }
158
168
  }
159
169
  }
160
170
 
@@ -33,9 +33,6 @@
33
33
  font-weight: 600;
34
34
  color: @textColor;
35
35
  }
36
- .dsh-hide {
37
- display: none!important;
38
- }
39
36
  .dsh-subtip {
40
37
  width: 100%;
41
38
  text-align: center;
@@ -9,8 +9,8 @@ const getHeadRender = function (h, column, {
9
9
  style: {
10
10
  display: "inline-block",
11
11
  maxWidth: "100%",
12
- paddingLeft: "12px",
13
- paddingRight: column._description ? "30px" : "12px",
12
+ paddingLeft: "8px",
13
+ paddingRight: column._description ? "26px" : "8px",
14
14
  verticalAlign: "middle",
15
15
  position: "relative"
16
16
  }
@@ -19,7 +19,7 @@ const getHeadRender = function (h, column, {
19
19
  style: {
20
20
  position: "absolute",
21
21
  top: "0px",
22
- left: "0px",
22
+ left: "-2px",
23
23
  color: "#ed4014"
24
24
  }
25
25
  }, "*"),
@@ -41,7 +41,7 @@ const getHeadRender = function (h, column, {
41
41
  style: {
42
42
  position: "absolute",
43
43
  bottom: "1px",
44
- right: "12px",
44
+ right: "8px",
45
45
  cursor: "pointer"
46
46
  },
47
47
  props: {
@@ -68,6 +68,7 @@ const transformToColumns = function (form, {
68
68
  return form
69
69
  .map(col => {
70
70
  const typeData = this.$modFieldMap[col._type] || {};
71
+ const typeWidth = typeData.width + (col._type === "number" && col._unit ? col._unit.length * 16 : 0);
71
72
 
72
73
  return {
73
74
  title: col._name,
@@ -75,7 +76,7 @@ const transformToColumns = function (form, {
75
76
  key: col._key,
76
77
  align: col._align || typeData.align,
77
78
  fixed: col._fixed,
78
- width: col._width || typeData.width,
79
+ width: col._width || typeWidth,
79
80
  sortBy: showHeadFilter
80
81
  ? col._sortBy || typeData.sortBy
81
82
  : undefined,