cnhis-design-vue 0.1.40 → 0.1.42

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.
Files changed (44) hide show
  1. package/es/big-table/index.js +74 -67
  2. package/es/big-table/style.css +1 -1
  3. package/es/button/index.js +2 -2
  4. package/es/color-picker/index.js +1 -1
  5. package/es/color-picker/style.css +1 -1
  6. package/es/fabric-chart/index.js +4 -4
  7. package/es/fabric-chart/style.css +1 -1
  8. package/es/index/index.js +42 -42
  9. package/es/index/style.css +2 -2
  10. package/es/modal/index.js +4 -4
  11. package/es/select/index.js +7 -7
  12. package/es/select/style.css +1 -1
  13. package/es/table-filter/index.js +22 -22
  14. package/es/table-filter/style.css +1 -1
  15. package/lib/cui.common.js +4223 -1783
  16. package/lib/cui.umd.js +4223 -1783
  17. package/lib/cui.umd.min.js +52 -52
  18. package/package.json +1 -1
  19. package/packages/big-table/index.js +6 -0
  20. package/packages/big-table/src/BigTable.vue +11 -94
  21. package/packages/big-table/src/Fieldset.vue +4 -4
  22. package/packages/big-table/src/utils/bigTableProps.js +82 -0
  23. package/packages/color-picker/src/color-picker.vue +14 -2
  24. package/packages/color-picker/src/style.less +1 -1
  25. package/packages/fabric-chart/src/FabricChart.vue +0 -1
  26. package/packages/fabric-chart/src/const/defaultVaule.js +20 -1
  27. package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +39 -43
  28. package/packages/fabric-chart/src/fabric-chart/FabricLines.vue +46 -37
  29. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +169 -109
  30. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +111 -51
  31. package/packages/fabric-chart/src/fabric-chart2/FabricCenter.vue +8 -12
  32. package/packages/fabric-chart/src/mixins/{polylineCommon.js → eventCommon.js} +13 -3
  33. package/packages/index.js +6 -7
  34. package/packages/modal/index.js +6 -2
  35. package/packages/modal/src/Modal.js +7 -0
  36. package/packages/select/src/TableSelect/index.vue +138 -75
  37. package/packages/table-filter/src/base-search-com/BaseSearch.vue +30 -22
  38. package/packages/table-filter/src/classification/Classification-com.vue +6 -2
  39. package/packages/table-filter/src/components/multi-select/multi-select.vue +1 -1
  40. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +2 -0
  41. package/packages/table-filter/src/quick-search/QuickSearch.vue +25 -22
  42. package/src/style/style.less +2 -2
  43. package/src/utils/clickoutside.js +14 -13
  44. package/docs_20211021.zip +0 -0
@@ -10,7 +10,7 @@ import MouseRightClick from '../components/MouseRightClick';
10
10
  import FabricCommon from '../mixins/fabricCommon';
11
11
  import { isObject } from '../mixins/type';
12
12
  import DropPopup from '../components/DropPopup';
13
- import polylineCommon from '../mixins/polylineCommon';
13
+ import eventCommon from '../mixins/eventCommon';
14
14
 
15
15
  const rightClickNode = [
16
16
  { name: '修改', type: 'edit' },
@@ -18,7 +18,7 @@ const rightClickNode = [
18
18
  ];
19
19
  export default {
20
20
  name: 'fabric-lines',
21
- mixins: [FabricCommon, polylineCommon],
21
+ mixins: [FabricCommon, eventCommon],
22
22
  props: {
23
23
  linesObj: {
24
24
  type: Object,
@@ -27,7 +27,7 @@ export default {
27
27
  },
28
28
  components: {
29
29
  MouseRightClick,
30
- DropPopup,
30
+ DropPopup
31
31
  },
32
32
  data() {
33
33
  return {
@@ -42,6 +42,11 @@ export default {
42
42
  textMarginLeft: 5
43
43
  };
44
44
  },
45
+ computed: {
46
+ eventStyle() {
47
+ return this.linesObj?.eventStyle || { selectable: true, evented: true };
48
+ }
49
+ },
45
50
 
46
51
  watch: {
47
52
  // linesObj: {
@@ -68,7 +73,7 @@ export default {
68
73
  init() {
69
74
  this.getLineList(this.linesObj.list);
70
75
  this.createLine();
71
- this.createEvent();
76
+ this.eventStyle.evented && this.createEvent();
72
77
  },
73
78
  createEvent() {
74
79
  this.canvas.on('mouse:up', event => {
@@ -97,9 +102,6 @@ export default {
97
102
  },
98
103
  // 打开右键菜单
99
104
  openRightModal(event) {
100
- if (!this.propItems.eventStyle.evented) {
101
- return;
102
- }
103
105
  this.rightPos = {
104
106
  clientX: event.e.clientX || event.e.pageX,
105
107
  clientY: event.e.clientY || event.e.pageY
@@ -127,7 +129,7 @@ export default {
127
129
  // 递归返回一维数据
128
130
  getLineList(list) {
129
131
  list.forEach(item => {
130
- if (item.children && Array.isArray(item.children) && item.children.length > 0) {
132
+ if (item?.children?.length) {
131
133
  this.getLineList(item.children);
132
134
  } else {
133
135
  const obj = JSON.parse(JSON.stringify(item));
@@ -152,7 +154,7 @@ export default {
152
154
  let textArr = []; // 用于存放多个线段的文字内容,显示格式为:第一段线的文字—第二段线的文字
153
155
  const textList = [];
154
156
  lineList.forEach((item, j) => {
155
- if ( !item[0] || isObject(item[0])) return;
157
+ if (!item[0] || isObject(item[0])) return;
156
158
  const startMinute = new Date(item[0]).getTime();
157
159
  const endMinute = item[1] ? new Date(item[1]).getTime() : '';
158
160
  let x1 = this.cumputedX(item[0]);
@@ -164,7 +166,7 @@ export default {
164
166
  // 左边手柄竖线
165
167
  let leftLine;
166
168
  if (x1 && x1 >= originX && x1 <= endX) {
167
- leftLine = this.drawGroup(x1, x2, y1 + spaceHeight, y2 - spaceHeight, i, j, { position: 'left'});
169
+ leftLine = this.drawGroup(x1, x2, y1 + spaceHeight, y2 - spaceHeight, i, j, { position: 'left' });
168
170
  lineItemList.push(leftLine);
169
171
  } else if (x1 < originX) {
170
172
  x1 = originX;
@@ -181,7 +183,7 @@ export default {
181
183
 
182
184
  // 中间横线
183
185
  let centerLine;
184
- if (item[1] && (!(endMinute >= maxMinute && startMinute >= maxMinute) && !(endMinute <= minMinute && startMinute <= minMinute))) {
186
+ if (item[1] && !(endMinute >= maxMinute && startMinute >= maxMinute) && !(endMinute <= minMinute && startMinute <= minMinute)) {
185
187
  centerLine = this.drawLine([x1, y1 + yCellHeightTop / 2, x2, y1 + yCellHeightTop / 2], {
186
188
  ...this.linesObj.dataLineStyle,
187
189
  selectable: false,
@@ -208,7 +210,7 @@ export default {
208
210
  });
209
211
  centerRect.lockMovementX = centerRect.lockMovementY = true;
210
212
  centerRect.hasControls = centerRect.hasBorders = false;
211
- this.hoverEvent(centerRect, {textObj, startTime: item[0], endTime: item[1]});
213
+ this.hoverEvent(centerRect, { textObj, startTime: item[0], endTime: item[1] });
212
214
  lineItemList.push(centerRect);
213
215
  leftLine && leftLine.bringToFront();
214
216
  }
@@ -216,15 +218,15 @@ export default {
216
218
  // 右边手柄竖线
217
219
  let rightLine;
218
220
  if (item[1] && endMinute <= maxMinute && endMinute >= minMinute) {
219
- rightLine = this.drawGroup(x1, x2, y1 + spaceHeight, y2 - spaceHeight, i, j, { position: 'right'});
221
+ rightLine = this.drawGroup(x1, x2, y1 + spaceHeight, y2 - spaceHeight, i, j, { position: 'right' });
220
222
  lineItemList.push(rightLine);
221
223
  }
222
224
 
223
225
  // 文字内容
224
226
  const textTop = x2 ? (y1 + y2) / 2 : y1 + yCellHeightTop / 2;
225
227
  let textLimitRight;
226
- let text =
227
- ((endMinute === '' && leftLine) || (item[1] && (!(x1 === originX && x2 === originX) && !(x1 === endX && x2 === endX))))
228
+ let text =
229
+ (endMinute === '' && leftLine) || (item[1] && !(x1 === originX && x2 === originX) && !(x1 === endX && x2 === endX))
228
230
  ? this.drawLineText(textArr.concat([textContent]), textTop, i, j, centerLine, x1, x2)
229
231
  : null;
230
232
  // 文字内容居右侧竖线且超出当前线段右边界则移除
@@ -236,7 +238,7 @@ export default {
236
238
  text = null;
237
239
  } else {
238
240
  textArr = [];
239
- this.hoverEvent(text, {textObj, startTime: item[0], endTime: item[1]});
241
+ this.hoverEvent(text, { textObj, startTime: item[0], endTime: item[1] });
240
242
  textList.push(text);
241
243
  }
242
244
  }
@@ -266,8 +268,18 @@ export default {
266
268
  }
267
269
  }
268
270
 
269
- this.lineEvent({line: leftLine, line1: centerLine, text, textObj, limitX: leftLimit, startTime: item[0], endTime: item[1], preText: textList[text ? textList.length - 2 : textList.length - 1] || null, textLimitRight});
270
- this.lineEvent({line: rightLine, line2: centerLine, text, textObj, limitX: rightLimt, startTime: item[0], endTime: item[1], preText: null, textLimitRight: rightLimt.x2});
271
+ this.lineEvent({
272
+ line: leftLine,
273
+ line1: centerLine,
274
+ text,
275
+ textObj,
276
+ limitX: leftLimit,
277
+ startTime: item[0],
278
+ endTime: item[1],
279
+ preText: textList[text ? textList.length - 2 : textList.length - 1] || null,
280
+ textLimitRight
281
+ });
282
+ this.lineEvent({ line: rightLine, line2: centerLine, text, textObj, limitX: rightLimt, startTime: item[0], endTime: item[1], preText: null, textLimitRight: rightLimt.x2 });
271
283
  });
272
284
  this.canvas.add(...lineItemList, ...textList);
273
285
  this.canvas.requestRenderAll();
@@ -280,7 +292,7 @@ export default {
280
292
  // return `${v.currentSpeed || ''}${channel}${consistence}${total}`
281
293
  // }).join('—');
282
294
  const value = textArr.filter(v => v !== '').join('—');
283
-
295
+
284
296
  if (value === '') return null;
285
297
  const text = new this.fabric.Text(value, {
286
298
  top,
@@ -341,7 +353,6 @@ export default {
341
353
  evented: false
342
354
  });
343
355
 
344
- const eventStyle = this.linesObj?.eventStyle || {selectable: true,evented: true};
345
356
  return new this.fabric.Group([line, rect], {
346
357
  selectable: true,
347
358
  evented: true,
@@ -350,13 +361,13 @@ export default {
350
361
  id,
351
362
  rowIndex: i,
352
363
  colIndex: j,
353
- ...eventStyle,
364
+ ...this.eventStyle,
354
365
  ...others,
355
366
  lockMovementY: true // 锁定Y轴,即只能x轴方向移动
356
367
  });
357
368
  },
358
369
  hoverEvent(point, attr) {
359
- const {textObj, startTime, endTime} = attr;
370
+ const { textObj, startTime, endTime } = attr;
360
371
  startTime && (point.startTime = startTime);
361
372
  endTime && (point.endTime = endTime);
362
373
  textObj && (point.textObj = textObj);
@@ -368,7 +379,7 @@ export default {
368
379
  });
369
380
  },
370
381
  lineEvent(attr) {
371
- const {line, line1, line2, text, textObj, limitX, startTime, endTime, preText, textLimitRight} = attr;
382
+ const { line, line1, line2, text, textObj, limitX, startTime, endTime, preText, textLimitRight } = attr;
372
383
  if (line) {
373
384
  line.hasControls = line.hasBorders = false;
374
385
  line1 && (line.line1 = line1);
@@ -377,7 +388,7 @@ export default {
377
388
  line.limitX = limitX;
378
389
  preText && (line.preText = preText);
379
390
  textLimitRight && (line.textLimitRight = textLimitRight);
380
- this.hoverEvent(line, {textObj, startTime, endTime});
391
+ this.hoverEvent(line, { textObj, startTime, endTime });
381
392
  // 移动中 实时更新相关联的线的坐标
382
393
  line.on('moving', () => {
383
394
  this.lineMoveLimit(line);
@@ -403,11 +414,9 @@ export default {
403
414
  this.dropPos = {
404
415
  left: line.left,
405
416
  top: line.top,
406
- margin: { top: yCellHeightTop / 2 },
417
+ margin: { top: yCellHeightTop / 2 }
407
418
  };
408
- let startTime,
409
- endTime,
410
- obj;
419
+ let startTime, endTime, obj;
411
420
  if (line.limitX) {
412
421
  const { position } = line;
413
422
  const { lineObj, x } = this.updateData(line);
@@ -422,22 +431,22 @@ export default {
422
431
  this.dropVal = {
423
432
  title: obj.title || '',
424
433
  list: [
425
- {id: '1', name: '开始时间', value: startTime},
426
- {id: '2', name: '结束时间', value: endTime},
427
- {id: '3', name: '流速', value: line.textObj?.currentSpeed || ''},
428
- {id: '4', name: '浓度', value: line.textObj?.consistence || ''},
429
- {id: '5', name: '总量', value: line.textObj?.total || ''},
434
+ { id: '1', name: '开始时间', value: startTime },
435
+ { id: '2', name: '结束时间', value: endTime },
436
+ { id: '3', name: '流速', value: line.textObj?.currentSpeed || '' },
437
+ { id: '4', name: '浓度', value: line.textObj?.consistence || '' },
438
+ { id: '5', name: '总量', value: line.textObj?.total || '' }
430
439
  ]
431
440
  };
432
441
  },
433
442
  // 移动手柄竖线后,需要更新this.lines,便于后面重新渲染时重新计算其左右限制坐标点
434
443
  updateData(line, isHover) {
435
444
  if (!line) return;
436
- const { rowIndex, colIndex, position, left} = line;
445
+ const { rowIndex, colIndex, position, left } = line;
437
446
  const linesRow = this.lines[rowIndex];
438
447
  // isHover,只是鼠标移上去显示提示信息而不需要重新计算x值
439
448
  if (isHover) {
440
- return { lineObj: { title: linesRow.title, obj: linesRow.lineList[colIndex], rowIndex, index: colIndex} };
449
+ return { lineObj: { title: linesRow.title, obj: linesRow.lineList[colIndex], rowIndex, index: colIndex } };
441
450
  }
442
451
  const x = this.getXValue(left);
443
452
  if (position === 'left') {
@@ -445,7 +454,7 @@ export default {
445
454
  } else {
446
455
  linesRow.lineList[colIndex][1] = x;
447
456
  }
448
- return { lineObj: { title: linesRow.title, obj: linesRow.lineList[colIndex], val: x}, x };
457
+ return { lineObj: { title: linesRow.title, obj: linesRow.lineList[colIndex], val: x }, x };
449
458
  },
450
459
  // 直线数组更新后 移除旧的直线并绘制新的直线,处理拖动限制不能更新的问题
451
460
  updateLine(rowIndex) {
@@ -532,6 +541,6 @@ export default {
532
541
  this.createLine();
533
542
  }
534
543
  },
535
- beforeDestroy() {},
544
+ beforeDestroy() {}
536
545
  };
537
546
  </script>