cnhis-design-vue 2.1.14 → 2.1.17

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 (46) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +84 -78
  4. package/es/big-table/style.css +1 -1
  5. package/es/button/index.js +1922 -2879
  6. package/es/button/style.css +1 -1
  7. package/es/captcha/index.js +3 -3
  8. package/es/checkbox/index.js +1 -1
  9. package/es/color-picker/index.js +1 -1
  10. package/es/drag-layout/index.js +3 -3
  11. package/es/editor/index.js +1 -1
  12. package/es/fabric-chart/index.js +121 -119
  13. package/es/fabric-chart/style.css +1 -1
  14. package/es/form-table/index.js +17 -17
  15. package/es/index/index.js +2253 -3181
  16. package/es/index/style.css +1 -1
  17. package/es/input/index.js +1 -1
  18. package/es/map/index.js +1 -1
  19. package/es/multi-chat/index.js +24 -24
  20. package/es/multi-chat-client/index.js +18 -18
  21. package/es/multi-chat-history/index.js +4 -4
  22. package/es/multi-chat-record/index.js +4 -4
  23. package/es/multi-chat-setting/index.js +20 -20
  24. package/es/multi-chat-sip/index.js +1 -1
  25. package/es/radio/index.js +1 -1
  26. package/es/scale-view/index.js +24 -24
  27. package/es/select/index.js +3 -3
  28. package/es/select-label/index.js +3 -3
  29. package/es/select-person/index.js +2 -2
  30. package/es/table-filter/index.js +1960 -2903
  31. package/es/table-filter/style.css +1 -1
  32. package/es/tag/index.js +1 -1
  33. package/es/verification-code/index.js +2 -2
  34. package/lib/cui.common.js +2378 -2945
  35. package/lib/cui.umd.js +2378 -2945
  36. package/lib/cui.umd.min.js +27 -25
  37. package/package.json +1 -1
  38. package/packages/big-table/src/BigTable.vue +23 -29
  39. package/packages/big-table/src/components/AutoLayoutButton.vue +1 -1
  40. package/packages/big-table/src/utils/batchEditing.js +34 -27
  41. package/packages/button/src/ButtonPrint/index.vue +4 -0
  42. package/packages/button/src/ButtonPrint/js/print.es.min.js +2792 -1
  43. package/packages/fabric-chart/src/FabricChart.vue +15 -36
  44. package/packages/fabric-chart/src/fabric-chart/FabricCanvas.vue +4 -3
  45. package/packages/fabric-chart/src/fabric-chart/FabricScaleValue.vue +8 -6
  46. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +21 -14
@@ -1,43 +1,22 @@
1
1
  <template>
2
- <div class="c-fabric-chart" :style="{'width': canvasWidth}">
3
- <component
4
- ref="canvasEle"
5
- :is="`FabricCanvas${templateData.type || ''}`"
6
- :id="id"
7
- :templateData="templateData"
8
- v-if="rendercanvas"
9
- >
2
+ <div class="c-fabric-chart" :style="{ width: canvasWidth }">
3
+ <component ref="canvasEle" :is="`FabricCanvas${templateData.type || ''}`" :id="id" :templateData="templateData" v-if="rendercanvas">
10
4
  <template v-if="templateData.type">
11
5
  <fabric-grid></fabric-grid>
12
6
  <fabric-top2 :templateData="templateData"></fabric-top2>
13
7
  <fabric-left2 :templateData="templateData"></fabric-left2>
14
8
  <fabric-right2 :templateData="templateData"></fabric-right2>
15
9
  <fabric-bottom2 :templateData="templateData"></fabric-bottom2>
16
- <fabric-center2
17
- :other="templateData.other"
18
- :polyline="templateData.left.leftYScalevalue"
19
- v-on="$listeners"
20
- @pointOperation="pointOperation"
21
- ></fabric-center2>
10
+ <fabric-center2 :other="templateData.other" :polyline="templateData.left.leftYScalevalue" v-on="$listeners" @pointOperation="pointOperation"></fabric-center2>
22
11
  </template>
23
12
 
24
13
  <template v-else>
25
- <fabric-text-group
26
- v-if="hasXScalevalue"
27
- :templateData="templateData"
28
- v-on="$listeners"
29
- ></fabric-text-group>
14
+ <fabric-text-group v-if="hasXScalevalue" :templateData="templateData" v-on="$listeners"></fabric-text-group>
30
15
  <fabric-grid></fabric-grid>
31
16
  <fabric-scale-value v-if="hasTable" :templateData="templateData"></fabric-scale-value>
32
17
  <fabric-lines v-if="hasTopTable" ref="lines" :linesObj="templateData.top" v-on="$listeners"></fabric-lines>
33
- <fabric-polylines ref="polylines"
34
- v-if="hasTable"
35
- :polyline="polylines"
36
- :other="templateData.left.other || {}"
37
- @pointOperation="pointOperation"
38
- v-on="$listeners"></fabric-polylines>
18
+ <fabric-polylines ref="polylines" v-if="hasTable" :polyline="polylines" :other="templateData.left.other || {}" @pointOperation="pointOperation" v-on="$listeners"></fabric-polylines>
39
19
  </template>
40
-
41
20
  </component>
42
21
  </div>
43
22
  </template>
@@ -74,7 +53,7 @@ export default create({
74
53
  templateData: {
75
54
  type: Object,
76
55
  required: true
77
- },
56
+ }
78
57
  },
79
58
  components: {
80
59
  FabricCanvas,
@@ -109,17 +88,17 @@ export default create({
109
88
  hasTable() {
110
89
  const hasLeft = this.templateData.left?.leftYScalevalue?.list?.length > 0;
111
90
  const hasRight = this.templateData.right?.rightYScalevalue?.list?.length > 0;
112
- return this.hasXScalevalue && hasLeft && hasRight;
91
+ return this.hasXScalevalue && (hasLeft || hasRight);
113
92
  },
114
93
  hasXScalevalue() {
115
94
  return this.templateData.top?.xScalevalue?.list?.length > 0;
116
- },
95
+ }
117
96
  },
118
97
  data() {
119
98
  return {
120
99
  rendercanvas: true,
121
100
  canvasWidth: 0
122
- }
101
+ };
123
102
  },
124
103
  mounted() {
125
104
  this.canvasWidth = `${this.templateData.canvasWidth}px` || '1000px';
@@ -159,21 +138,21 @@ export default create({
159
138
  // 在组件移除后,重新渲染组件
160
139
  // this.$nextTick可实现在DOM 状态更新后,执行传入的方法。
161
140
  this.$nextTick(() => {
162
- this.rendercanvas = true;
163
- })
141
+ this.rendercanvas = true;
142
+ });
164
143
  // this.$refs.canvasEle.renderCanvas();
165
144
  },
166
145
  removeSelectArea() {
167
146
  this.$nextTick(() => {
168
147
  this.$refs.polylines.removeSelectArea();
169
- })
148
+ });
170
149
  }
171
150
  }
172
151
  });
173
152
  </script>
174
153
 
175
154
  <style lang="less" scoped>
176
- .c-fabric-chart {
177
- position: relative;
178
- }
155
+ .c-fabric-chart {
156
+ position: relative;
157
+ }
179
158
  </style>
@@ -82,9 +82,10 @@ export default {
82
82
  console.warn(error);
83
83
  }
84
84
  }
85
- if (!this.templateData.left || !this.templateData.right) {
85
+ // if (!this.templateData.left || !this.templateData.right) {
86
+ if (!this.templateData.left) {
86
87
  try {
87
- throw new Error('缺少左/右侧数据对象, 无法生成垂直方向刻度');
88
+ throw new Error('缺少左侧数据对象, 无法生成垂直方向刻度');
88
89
  } catch (error) {
89
90
  console.warn(error);
90
91
  }
@@ -133,7 +134,7 @@ export default {
133
134
  endX() {
134
135
  // 网格区域水平方向最大坐标值, 也是整个画布右侧列表坐标起始值,网格右下角x轴坐标值
135
136
  if (!this.templateData.right && !this.topTotal) return this.templateData.canvasWidth;
136
- return this.templateData.canvasWidth - (this.templateData.right?.width || 20) - this.topTotal.width;
137
+ return this.templateData.canvasWidth - (this.templateData.right?.width ?? 20) - this.topTotal.width;
137
138
  },
138
139
  endY() {
139
140
  // 画布高度 - 底部列表高度 ,网格右下角y轴坐标值
@@ -65,7 +65,6 @@ export default {
65
65
  });
66
66
  return cur;
67
67
  }, '');
68
- console.log(textList);
69
68
  const group = new this.fabric.Group([...textList], {
70
69
  evented: false,
71
70
  selectable: false
@@ -74,6 +73,7 @@ export default {
74
73
  this.canvas.sendBackwards(group);
75
74
  },
76
75
  rightScaleValue(obj) {
76
+ if (!obj) return;
77
77
  const spaceGridNumber = obj.rightYScalevalue.spaceGridNumber || 2;
78
78
  const marginLeft = obj.rightYScalevalue.marginLeft || 3;
79
79
  const originX = this.propItems.endX + marginLeft;
@@ -95,13 +95,15 @@ export default {
95
95
  this.canvas.sendBackwards(group);
96
96
  },
97
97
  leftScaleValue(obj) {
98
+ const { endY, yCellHeight } = this.propItems;
98
99
  const spaceGridNumber = obj.leftYScalevalue.spaceGridNumber || 2;
99
- const marginRight = obj.leftYScalevalue.marginRight || 3;
100
+ const [titleMarginRight, titleMarginButton] = obj.leftYScalevalue?.titleMargin || [5, 30];
101
+ const listMarginRight = obj.leftYScalevalue.listMarginRight || 3;
100
102
  const style = obj.leftYScalevalue.style || {};
101
- const originX = this.propItems.originX - marginRight;
103
+ const originX = this.propItems.originX;
102
104
  let textList = [];
103
105
  obj.leftYScalevalue.list.forEach((item, index) => {
104
- textList.push(this.createText(item, originX, this.propItems.endY - index * this.propItems.yCellHeight * spaceGridNumber, 'right', style));
106
+ textList.push(this.createText(item, originX - listMarginRight, endY - index * yCellHeight * spaceGridNumber, 'right', style));
105
107
  });
106
108
 
107
109
  // 添加标题和单位
@@ -109,8 +111,8 @@ export default {
109
111
  txt = obj.leftYScalevalue.name || '';
110
112
  if (obj.leftYScalevalue.unit) txt += '\n' + obj.leftYScalevalue.unit;
111
113
  if (txt) {
112
- const top = this.propItems.endY - obj.leftYScalevalue.list.length * this.propItems.yCellHeight * spaceGridNumber;
113
- textList.push(this.createText(txt, originX, top, 'right', { ...style, textAlign: 'right', originY: 'bottom' }));
114
+ const top = endY - (obj.leftYScalevalue.list.length - 1) * yCellHeight * spaceGridNumber - titleMarginButton;
115
+ textList.push(this.createText(txt, originX - titleMarginRight, top, 'right', { ...style, textAlign: 'right', originY: 'bottom' }));
114
116
  }
115
117
  const group = new this.fabric.Group([...textList], {
116
118
  evented: false,
@@ -335,28 +335,17 @@ export default {
335
335
  // textList.push(title);
336
336
  const baseY = endY + 2; // 目前固定10像素的下边距
337
337
  const baseYLimit = endY - 2; // 目前固定10像素的上边距
338
- const lineHeight = (obj.iconStyle?.height && obj.iconStyle.height + 2) || 14; // 标志点的line-height值
338
+ const lineHeightText = (obj.style?.fontSize || 12) + 2;
339
+ const lineHeightImg = (obj.iconStyle?.height || 12) + 2;
340
+ const lineHeightSeq = (obj.seqStyle?.circle?.radius || 9) * 2 + 2;
339
341
  obj.list.forEach((item, index) => {
340
342
  let limitIndex = -1; // 标志点是否往上排列的标志,大于-1则表示需要往上排列
341
343
  let y = baseY;
342
344
  const x = this.cumputedX(item[0]);
343
345
  if (this.isLimit(item[0])) {
344
346
  item[1].forEach(async (v, i) => {
345
- if (!~limitIndex) {
346
- y += i === 0 ? lineHeight / 2 : lineHeight;
347
- if (y >= canvasHeight - lineHeight / 2) {
348
- limitIndex++;
349
- if (limitIndex === 0) {
350
- y = baseYLimit;
351
- y -= lineHeight / 2;
352
- }
353
- }
354
- } else {
355
- y -= lineHeight;
356
- }
357
347
  const common = {
358
348
  left: x,
359
- top: y,
360
349
  originX: 'center',
361
350
  originY: 'center',
362
351
  data: v.data || {},
@@ -365,6 +354,21 @@ export default {
365
354
  name: v.name,
366
355
  type: 'mark'
367
356
  };
357
+ function setTop(lineHeight) {
358
+ if (!~limitIndex) {
359
+ y += i === 0 ? lineHeight / 2 : lineHeight;
360
+ if (y >= canvasHeight - lineHeight / 2) {
361
+ limitIndex++;
362
+ if (limitIndex === 0) {
363
+ y = baseYLimit;
364
+ y -= lineHeight / 2;
365
+ }
366
+ }
367
+ } else {
368
+ y -= lineHeight;
369
+ }
370
+ common.top = y;
371
+ }
368
372
  const eventStyle = !this.eventStyle.evented
369
373
  ? {
370
374
  lockMovementX: true,
@@ -379,6 +383,7 @@ export default {
379
383
  this.canvas.requestRenderAll();
380
384
  };
381
385
  if (this.isObject(v) && !v.value) {
386
+ setTop(lineHeightImg);
382
387
  const option = Object.assign({}, obj.iconStyle || {}, v || {}, {
383
388
  ...common,
384
389
  ...eventStyle
@@ -394,6 +399,7 @@ export default {
394
399
  addCanvas(img);
395
400
  } else if (v.value) {
396
401
  if (v.seq) {
402
+ setTop(lineHeightSeq);
397
403
  // 标记增加序号
398
404
  const circle = await this.createPoint('circle', {
399
405
  ...common,
@@ -415,6 +421,7 @@ export default {
415
421
  });
416
422
  addCanvas(group);
417
423
  } else {
424
+ setTop(lineHeightText);
418
425
  const text = new this.fabric.Text(String(v.value), {
419
426
  ...defaultVaule.textStyle,
420
427
  ...obj.style,