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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "0.1.40",
3
+ "version": "0.1.42",
4
4
  "description": "基于 Ant Desgin Vue 的UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -1,10 +1,16 @@
1
1
  // 导入组件
2
2
  import BigTable from './src/BigTable.vue';
3
+ import Fieldset from './src/Fieldset.vue';
3
4
 
4
5
  // 为组件提供 install 安装方法,供按需引入
5
6
  BigTable.install = function(Vue) {
6
7
  Vue.component(BigTable.name, BigTable);
8
+ Vue.component(Fieldset.name, Fieldset);
7
9
  };
8
10
 
11
+ Object.assign(BigTable, {
12
+ Fieldset
13
+ });
14
+
9
15
  // 默认导出组件
10
16
  export default BigTable;
@@ -46,6 +46,7 @@
46
46
  </div>
47
47
  <c-grid
48
48
  border
49
+ show-overflow
49
50
  show-header-overflow
50
51
  highlight-hover-row
51
52
  highlight-current-row
@@ -71,6 +72,7 @@
71
72
  @sort-change="sortChange"
72
73
  @scroll="handlerScroll"
73
74
  @cell-mouseenter="handleCellMouseenter"
75
+ :tooltip-config="{ enterable: false }"
74
76
  :checkbox-config="{
75
77
  checkField: 'checked',
76
78
  labelField: 'checked',
@@ -152,6 +154,7 @@ import batchEditing from './utils/batchEditing';
152
154
  import EditForm from './components/edit-form/EditForm.vue';
153
155
 
154
156
  import nestTable from './utils/nestTable';
157
+ import bigTableProps from './utils/bigTableProps';
155
158
 
156
159
  let addInlineEditPrimaryKey = '';
157
160
  export default create({
@@ -172,93 +175,7 @@ export default create({
172
175
  [VideoList.name]: VideoList
173
176
  },
174
177
  mixins: [format, batchEditing, nestTable],
175
- props: {
176
- data: Array,
177
- MAX_CHECK_SIZE: [String, Number],
178
- showFooter: Boolean,
179
- sumData: Object,
180
- avgData: Object,
181
- columnConfig: {
182
- type: Object,
183
- default: () => {
184
- return {};
185
- }
186
- },
187
- refreshRow: Number,
188
- relatedItems: {
189
- type: Object,
190
- default: () => {
191
- return {
192
- triggerMethodPc: '', // 相关项打开方式
193
- triggerMethodField: '' // 相关项打开字段
194
- };
195
- }
196
- },
197
- pageVO: {
198
- type: Object,
199
- default: () => {
200
- return {
201
- pageIndex: 1, // 当前第几页
202
- pageSize: 20, // 每页几条数据
203
- total: 20 // 总数多少条
204
- };
205
- }
206
- },
207
- tableOptions: Object,
208
- quickSearchConfig: Array,
209
- primaryKey: String,
210
- tableDataCache: {
211
- type: Array,
212
- default: () => []
213
- },
214
- oldtableData: {
215
- // 原始数据
216
- type: Array,
217
- default: () => []
218
- },
219
- tableName: String,
220
- fieldListOriginal: Array,
221
- tableParams: Object,
222
- emptyItems: {
223
- type: Object,
224
- default: () => {
225
- return {
226
- noDataImg: 'nodata',
227
- noDataTip: ''
228
- };
229
- }
230
- },
231
- styleSetting: Object,
232
- sysImageSize: Array,
233
- height: String,
234
- groupCountFields: Array,
235
- groupCountMap: Object,
236
- listFormUnionSetting: Object,
237
- inlineEditFormConfig: Object,
238
- clickRowData: Object,
239
- btnList: Array,
240
- spinning: Boolean,
241
- rowGroupSetting: Object,
242
- inlineEditFormSubmitDone: Boolean,
243
- isInlineOperating: Boolean,
244
- inlineEditCurrentOperateBtnId: String,
245
- tableRefreshCache: Object, // 记录需要刷新的列表,当切换到当前列表时更新
246
- userInfo: Object,
247
- isInlineEditing: Boolean,
248
- isInlineAdding: Boolean,
249
- isInlineSave: Boolean,
250
- isInlineCancel: Boolean,
251
- resetInlineEdit: Function, // 重置状态(不包含编辑、新增状态)
252
- resetEditRowStatus: Function, // 重置编辑行保存表单相关状态
253
- pageIndexOldtableData: {
254
- // 原始数据
255
- type: Array,
256
- default: () => []
257
- },
258
- submitForm: Function,
259
- isMatchComponent: Boolean,
260
- asyncCount: Boolean
261
- },
178
+ props: Object.assign({}, bigTableProps),
262
179
  beforeCreate() {
263
180
  Vue.use(Button)
264
181
  .use(Checkbox)
@@ -362,7 +279,7 @@ export default create({
362
279
  };
363
280
  },
364
281
  treeConfig() {
365
- let result = {};
282
+ let result = null;
366
283
  switch (Number(this.isTree)) {
367
284
  case 1:
368
285
  case 3:
@@ -566,7 +483,6 @@ export default create({
566
483
  async loadData(data) {
567
484
  this.isShowEmpty = !data?.length;
568
485
 
569
- const startTime = Date.now();
570
486
  const list = JSON.parse(JSON.stringify(data));
571
487
 
572
488
  let table = this.$refs.xGrid;
@@ -595,7 +511,6 @@ export default create({
595
511
 
596
512
  this.setGroupTreeExpand();
597
513
  this.resetTableInlineEditStatus();
598
- console.log('--------------loadData-----------', Date.now() - startTime);
599
514
  },
600
515
  setGroupTreeExpand() {
601
516
  let isExpand = this.isTree == 1 && this.isExpand == 1 && this.total < 1001;
@@ -2252,10 +2167,10 @@ export default create({
2252
2167
  return { rowspan: 1, colspan: 0 };
2253
2168
  }
2254
2169
  },
2255
- handleCellMouseenter({ column }, evnt) {
2170
+ handleCellMouseenter({ column, $event }) {
2256
2171
  // vxe-table@2.10+ 触发tooltip给vxe-cell父节点设置了title 导致显示有误
2257
2172
  if (column.showOverflow === 'title') {
2258
- const target = evnt?.currentTarget;
2173
+ const target = $event?.currentTarget;
2259
2174
  const cls = target?.className;
2260
2175
  const bodyCls = ' vxe-body--column ';
2261
2176
  if (cls && ` ${cls} `.includes(bodyCls) && target && target.hasAttribute('title')) {
@@ -2662,7 +2577,7 @@ export default create({
2662
2577
  this.$refs.xGrid.setCurrentRow(row);
2663
2578
  this.$emit('setNestTableClick', this.isNestTable);
2664
2579
  this.$emit('setCurRowIndex', index);
2665
- this.$emit('linkDetail', row, col, row[this.handleRowId]);
2580
+ this.$emit('linkDetail', row, col, row[this.handleRowId], null, false, index);
2666
2581
  },
2667
2582
  // 按钮事件
2668
2583
  clickBtn(row, btn, index, e, j) {
@@ -2671,7 +2586,7 @@ export default create({
2671
2586
  this.recordClickBtnInfo(row, index);
2672
2587
  this.$emit('setNestTableClick', this.isNestTable);
2673
2588
  this.$emit('setCurRowIndex', index);
2674
- this.$emit('clickBtn', row, btn, row[this.handleRowId]);
2589
+ this.$emit('clickBtn', row, btn, row[this.handleRowId], index);
2675
2590
  // this.handleTopBtnTracher(btn, j);
2676
2591
  },
2677
2592
  recordClickBtnInfo(row, index) {
@@ -2999,11 +2914,13 @@ export default create({
2999
2914
  */
3000
2915
  tableUpdateData(data, oldIndex) {
3001
2916
  if (this.isNestTable) return;
2917
+ if (!this.originFormatList[oldIndex]) return;
3002
2918
  let formatData = this.setChecklist(data) || [];
3003
2919
  let vxeTable = this.$refs.xGrid;
3004
2920
  this.originFormatList.splice(oldIndex, 1, formatData[0]);
3005
2921
  vxeTable.loadData(this.originFormatList);
3006
2922
  this.$emit('triggerSpinning', false);
2923
+ this.$emit('handlerClickRow', formatData[0], oldIndex);
3007
2924
  }
3008
2925
  }
3009
2926
  });
@@ -295,10 +295,10 @@
295
295
  </template>
296
296
  <script>
297
297
  import draggable from 'vuedraggable';
298
-
298
+ import create from '@/core/create';
299
299
  const DEFLAYOUTPCNAME = '资料';
300
- export default {
301
- name: 'Fieldset',
300
+ export default create({
301
+ name: 'fieldset',
302
302
  props: {
303
303
  // tableId: String,
304
304
  fields: Array,
@@ -1545,7 +1545,7 @@ export default {
1545
1545
  return ele.sid != '0001' && find;
1546
1546
  }
1547
1547
  }
1548
- };
1548
+ });
1549
1549
  </script>
1550
1550
  <style scoped lang="less">
1551
1551
  ul {
@@ -0,0 +1,82 @@
1
+ const bigTableProps = {
2
+ data: { type: Array, default: () => [] },
3
+ MAX_CHECK_SIZE: [String, Number],
4
+ showFooter: Boolean,
5
+ sumData: { type: Object, default: () => ({}) },
6
+ avgData: { type: Object, default: () => ({}) },
7
+ columnConfig: {
8
+ type: Object,
9
+ default: () => {
10
+ return {};
11
+ }
12
+ },
13
+ refreshRow: Number,
14
+ relatedItems: {
15
+ type: Object,
16
+ default: () => {
17
+ return {
18
+ triggerMethodPc: '', // 相关项打开方式
19
+ triggerMethodField: '' // 相关项打开字段
20
+ };
21
+ }
22
+ },
23
+ pageVO: {
24
+ type: Object,
25
+ default: () => {
26
+ return {
27
+ pageIndex: 1, // 当前第几页
28
+ pageSize: 20, // 每页几条数据
29
+ total: 20 // 总数多少条
30
+ };
31
+ }
32
+ },
33
+ tableOptions: { type: Object, default: () => ({}) },
34
+ quickSearchConfig: { type: Array, default: () => [] },
35
+ primaryKey: String,
36
+ tableDataCache: { type: Array, default: () => [] },
37
+ oldtableData: { type: Array, default: () => [] }, // 原始数据
38
+ tableName: String,
39
+ fieldListOriginal: { type: Array, default: () => [] },
40
+ tableParams: { type: Object, default: () => ({}) },
41
+ emptyItems: {
42
+ type: Object,
43
+ default: () => {
44
+ return {
45
+ noDataImg: 'nodata',
46
+ noDataTip: ''
47
+ };
48
+ }
49
+ },
50
+ styleSetting: { type: Object, default: () => ({}) },
51
+ sysImageSize: { type: Array, default: () => [] },
52
+ height: String,
53
+ groupCountFields: { type: Array, default: () => [] },
54
+ groupCountMap: { type: Object, default: () => ({}) },
55
+ listFormUnionSetting: { type: Object, default: () => ({}) },
56
+ inlineEditFormConfig: { type: Object, default: () => ({}) },
57
+ clickRowData: { type: Object, default: () => ({}) },
58
+ btnList: { type: Array, default: () => [] },
59
+ spinning: Boolean,
60
+ rowGroupSetting: { type: Object, default: () => ({}) },
61
+ inlineEditFormSubmitDone: Boolean,
62
+ isInlineOperating: Boolean,
63
+ inlineEditCurrentOperateBtnId: String,
64
+ tableRefreshCache: { type: Object, default: () => ({}) }, // 记录需要刷新的列表,当切换到当前列表时更新
65
+ userInfo: { type: Object, default: () => ({}) },
66
+ isInlineEditing: Boolean,
67
+ isInlineAdding: Boolean,
68
+ isInlineSave: Boolean,
69
+ isInlineCancel: Boolean,
70
+ resetInlineEdit: Function, // 重置状态(不包含编辑、新增状态)
71
+ resetEditRowStatus: Function, // 重置编辑行保存表单相关状态
72
+ pageIndexOldtableData: {
73
+ // 原始数据
74
+ type: Array,
75
+ default: () => []
76
+ },
77
+ submitForm: Function,
78
+ isMatchComponent: Boolean,
79
+ asyncCount: Boolean
80
+ };
81
+
82
+ export default bigTableProps;
@@ -3,7 +3,7 @@
3
3
  <!-- 颜色显示小方块 -->
4
4
  <div class="colorBtn" v-bind:style="`background-color: ${showColor}`" @click="openPanel" v-bind:class="{ disabled: disabled }"></div>
5
5
  <!-- 颜色色盘 -->
6
- <div class="box" v-bind:class="{ open: openStatus }">
6
+ <div class="box" ref="colorPickerBox" v-clickoutside="handleClickOutside" v-bind:class="{ open: openStatus }">
7
7
  <div class="hd">
8
8
  <div class="colorView" v-bind:style="`background-color: ${showPanelColor}`"></div>
9
9
  <div class="defaultColor" @click="handleDefaultColor" @mouseover="hoveColor = defaultColor" @mouseout="hoveColor = null">
@@ -40,9 +40,14 @@
40
40
  * @desc 一个颜色选择器
41
41
  * @time 2021-05-11
42
42
  */
43
+
43
44
  import create from '@/core/create';
45
+
46
+ import Clickoutside from '@/utils/clickoutside';
47
+
44
48
  export default create({
45
49
  name: 'color-picker',
50
+ directives: { Clickoutside },
46
51
  props: {
47
52
  // 当前颜色值
48
53
  value: {
@@ -113,9 +118,13 @@ export default create({
113
118
  }
114
119
  },
115
120
  methods: {
116
- openPanel() {
121
+ openPanel(e) {
117
122
  if (this.disabled) return;
118
123
  this.openStatus = !this.openStatus;
124
+ const domNode = e.currentTarget;
125
+ const boxNode = this.$refs['colorPickerBox'];
126
+ const { left, bottom } = domNode && domNode.getBoundingClientRect();
127
+ boxNode.setAttribute('style', `left:${left}px;top:${bottom}px;`);
119
128
  },
120
129
  triggerHtml5Color() {
121
130
  this.$refs.html5Color.click();
@@ -169,6 +178,9 @@ export default create({
169
178
  gradientColorArr.push(this.rgbToHex(parseInt(rStep * i + sColor[0]), parseInt(gStep * i + sColor[1]), parseInt(bStep * i + sColor[2])));
170
179
  }
171
180
  return gradientColorArr;
181
+ },
182
+ handleClickOutside() {
183
+ this.openStatus = false;
172
184
  }
173
185
  }
174
186
  });
@@ -30,7 +30,7 @@
30
30
  padding-bottom: 5px;
31
31
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.15);
32
32
  opacity: 0;
33
- transition: all 0.3s ease;
33
+ transition: opacity 0.3s ease;
34
34
  box-sizing: content-box;
35
35
  h3 {
36
36
  margin: 0;
@@ -25,7 +25,6 @@
25
25
  <fabric-text-group
26
26
  v-if="hasXScalevalue"
27
27
  :templateData="templateData"
28
- :other="templateData.other"
29
28
  v-on="$listeners"
30
29
  ></fabric-text-group>
31
30
  <fabric-grid></fabric-grid>
@@ -33,7 +33,26 @@ const data = {
33
33
  strokeWidth: 1, // 描边宽度
34
34
  originX: 'center',
35
35
  originY: 'center'
36
- }
36
+ },
37
+ topSpaceHeight: 10, // templateData.top.spaceHeight
38
+ topSpaceGridNumber: 3, // templateData.top.xScalevalue.spaceGridNumber
39
+ leftSpaceGridNumber: 2, // templateData.left.leftYScalevalue.spaceGridNumber
40
+ rightSpaceGridNumber: 2, // templateData.right.rightYScalevalue.spaceGridNumber
41
+ topTotal: {
42
+ title: '总量',
43
+ width: 0,
44
+ style: {
45
+ fontFamily: '微软雅黑',
46
+ fontSize: 12,
47
+ fill: '#000',
48
+ lineHeight: 1
49
+ }
50
+ },
51
+ criticalStyle: { // 危急值样式
52
+ stroke: 'purple', // 颜色 默认 #999
53
+ strokeWidth: 1, // 线宽 默认 1
54
+ strokeDashArray: [0, 0] // 实线设置 默认[0, 0]
55
+ },
37
56
  };
38
57
 
39
58
  export default data;
@@ -7,11 +7,8 @@
7
7
 
8
8
  <script>
9
9
  import { fabric } from 'fabric';
10
+ import defaultVaule from '../const/defaultVaule';
10
11
 
11
- const topSpaceHeight = 10; // templateData.top.spaceHeight
12
- const topSpaceGridNumber = 3; // templateData.top.xScalevalue.spaceGridNumber
13
- const leftSpaceGridNumber = 2; // templateData.left.leftYScalevalue.spaceGridNumber
14
- const rightSpaceGridNumber = 2; // templateData.right.rightYScalevalue.spaceGridNumber
15
12
  export default {
16
13
  name: 'FabricCanvas',
17
14
  props: {
@@ -67,31 +64,31 @@ export default {
67
64
  endYTop: this.endYTop,
68
65
  treeList: this.treeList,
69
66
  xScaleList: this.xScaleList,
70
- // xScaleCell: this.xScaleCell,
71
67
  xScaleCellList: this.xScaleCellList,
72
68
  yScaleCellLeft: this.yScaleCellLeft,
73
69
  yScaleCellRight: this.yScaleCellRight,
74
70
  eventStyle: this.eventStyle,
71
+ topTotal: this.topTotal
75
72
  };
76
73
  }
77
74
  };
78
75
  },
79
- created() {
80
- if (!this.templateData.top) {
81
- try {
82
- throw new Error('缺少顶部数据对象, 无法生成水平方向刻度');
83
- } catch (error) {
84
- console.warn(error);
85
- }
76
+ created() {
77
+ if (!this.templateData.top) {
78
+ try {
79
+ throw new Error('缺少顶部数据对象, 无法生成水平方向刻度');
80
+ } catch (error) {
81
+ console.warn(error);
86
82
  }
87
- if (!this.templateData.left || !this.templateData.right) {
88
- try {
89
- throw new Error('缺少左/右侧数据对象, 无法生成垂直方向刻度');
90
- } catch (error) {
91
- console.warn(error);
92
- }
83
+ }
84
+ if (!this.templateData.left || !this.templateData.right) {
85
+ try {
86
+ throw new Error('缺少左/右侧数据对象, 无法生成垂直方向刻度');
87
+ } catch (error) {
88
+ console.warn(error);
93
89
  }
94
- },
90
+ }
91
+ },
95
92
  computed: {
96
93
  canvasWidth() {
97
94
  // 画布宽度
@@ -104,13 +101,16 @@ export default {
104
101
  treeTableminCellWidth() {
105
102
  return this.templateData.top?.treeTableminCellWidth || this.templateData.left?.titleWidth || 20;
106
103
  },
104
+ topTotal() {
105
+ return this.templateData.top?.total ? { ...defaultVaule.topTotal, ...this.templateData.top.total } : defaultVaule.topTotal;
106
+ },
107
107
  gridXNumber() {
108
108
  // 网格水平方向总数 如果设置了默认值就直接取用
109
109
  if (this.templateData.table.mainXCell && this.templateData.table.subXCell) {
110
110
  return this.templateData.table.mainXCell * this.templateData.table.subXCell;
111
111
  }
112
112
  // 如果没设置 就从顶部列表内自己计算一下 list遍历后将每一项完全展开后的数组长度存入topListLength取出最大值即可
113
- const spaceGridNumber = this.templateData.top?.xScalevalue?.spaceGridNumber || topSpaceGridNumber;
113
+ const spaceGridNumber = this.templateData.top?.xScalevalue?.spaceGridNumber || defaultVaule.topSpaceGridNumber;
114
114
  return (this.templateData.top?.xScalevalue?.list?.length || 1) * spaceGridNumber;
115
115
  },
116
116
  gridYNumber() {
@@ -127,12 +127,12 @@ export default {
127
127
  // 顶部列表高度 网格不需要的高度放到顶部,因为底部不一定存在列表
128
128
  const topHeight = this.endYTop;
129
129
  const residue = (this.endY - topHeight) % this.gridYNumber;
130
- return topHeight + residue + (this.templateData.top?.spaceHeight || topSpaceHeight);
130
+ return topHeight + residue + (this.templateData.top?.spaceHeight || defaultVaule.topSpaceHeight);
131
131
  },
132
132
  endX() {
133
133
  // 网格区域水平方向最大坐标值, 也是整个画布右侧列表坐标起始值,网格右下角x轴坐标值
134
- if (!this.templateData.right) return this.templateData.canvasWidth;
135
- return this.templateData.canvasWidth - this.templateData.right.width;
134
+ if (!this.templateData.right && !this.topTotal) return this.templateData.canvasWidth;
135
+ return this.templateData.canvasWidth - (this.templateData.right?.width || 20) - this.topTotal.width;
136
136
  },
137
137
  endY() {
138
138
  // 画布高度 - 底部列表高度 ,网格右下角y轴坐标值
@@ -152,7 +152,7 @@ export default {
152
152
  // 头部表格底部空白位置的高,用于显示x轴时间点
153
153
  const topHeight = this.endYTop;
154
154
  const residue = (this.endY - topHeight) % this.gridYNumber;
155
- return residue + (this.templateData.top?.spaceHeight || topSpaceHeight);
155
+ return residue + (this.templateData.top?.spaceHeight || defaultVaule.topSpaceHeight);
156
156
  },
157
157
  yCellHeightTop() {
158
158
  // 头部表格垂直方向网格高度
@@ -166,7 +166,7 @@ export default {
166
166
  const list = this.templateData.top?.xScalevalue?.list || [];
167
167
  return list.map(item => {
168
168
  return new Date(item).getTime();
169
- })
169
+ });
170
170
  },
171
171
  // x轴每个网格每1px的毫秒值和每个网格刻度对应的时间戳和每个网格对应的像素px值,返回一个list数组
172
172
  xScaleCellList() {
@@ -183,29 +183,24 @@ export default {
183
183
  time: v + i * cellTime, // 网格刻度对应的时间戳
184
184
  xScaleTime: scaleCellTime // 每个网格每1px的毫秒值
185
185
  });
186
- }
186
+ }
187
187
  }
188
- })
188
+ });
189
189
  return list;
190
190
  },
191
- // // x轴每分钟的宽度值,不能刻度list长度值除以总格子数计算,因为有可能刻度比较短,不能满足所有的格子
192
- // // x轴每毫秒的宽度值
193
- // xScaleCell() {
194
- // return this.xCellWidth / ((this.xScaleList[1] - this.xScaleList[0]) / this.templateData.top.xScalevalue.spaceGridNumber);
195
- // },
196
191
  // y轴每mmHg的脉搏/血压的高度值
197
192
  yScaleCellLeft() {
198
193
  const list = this.templateData.left?.leftYScalevalue?.list || [];
199
- return list?.length ? this.yCellHeight / ((parseInt(list[1]) - parseInt(list[0])) / (this.templateData.left?.leftYScalevalue?.spaceGridNumber || leftSpaceGridNumber)) : 10;
194
+ return list?.length ? this.yCellHeight / ((parseInt(list[1]) - parseInt(list[0])) / (this.templateData.left?.leftYScalevalue?.spaceGridNumber || defaultVaule.leftSpaceGridNumber)) : 10;
200
195
  },
201
196
  // y轴每摄氏度的高度值
202
197
  yScaleCellRight() {
203
198
  const list = this.templateData.right?.rightYScalevalue?.list || [];
204
- return list?.length ? this.yCellHeight / ((parseInt(list[1]) - parseInt(list[0])) / (this.templateData.right?.rightYScalevalue?.spaceGridNumber || rightSpaceGridNumber)) : 10;
199
+ return list?.length ? this.yCellHeight / ((parseInt(list[1]) - parseInt(list[0])) / (this.templateData.right?.rightYScalevalue?.spaceGridNumber || defaultVaule.rightSpaceGridNumber)) : 10;
205
200
  },
206
201
  eventStyle() {
207
- return this.templateData.table?.eventStyle || {selectable: true,evented: true};
208
- },
202
+ return this.templateData.table?.eventStyle || { selectable: true, evented: true };
203
+ }
209
204
  },
210
205
  mounted() {
211
206
  this.init();
@@ -227,7 +222,7 @@ export default {
227
222
  getGridYnumberTop(list) {
228
223
  // 头部表格垂直方向网格总数
229
224
  for (let i = 0; i < list.length; i++) {
230
- if (list[i].children?.length) {
225
+ if (list[i]?.children?.length) {
231
226
  this.getGridYnumberTop(list[i].children);
232
227
  } else {
233
228
  this.gridYnumberTop++;
@@ -245,24 +240,25 @@ export default {
245
240
  const arr = [];
246
241
  const { treeTableminCellWidth, treeTableminCellHeight } = this.templateData.top;
247
242
  for (let i = 0; i < list.length; i++) {
243
+ const node = list[i];
248
244
  const obj = {};
249
245
  Object.assign(obj, {
250
- title: list[i].title || '',
246
+ title: node.title || '',
251
247
  left: levelCol * treeTableminCellWidth,
252
248
  top: this.levelRow * treeTableminCellHeight
253
249
  });
254
250
  this.levelRow++;
255
- if (list[i].children?.length) {
251
+ if (node?.children?.length) {
256
252
  this.levelRow--;
257
253
  obj.title = obj.title.split('').join('\n'); // 如果有子级则文字竖形排列
258
254
  obj.width = treeTableminCellWidth;
259
- obj.children = this.setTreeStyle(list[i].children, levelCol + 1);
260
- obj.subSize = this.getChildrenSize(list[i].children);
255
+ obj.children = this.setTreeStyle(node.children, levelCol + 1);
256
+ obj.subSize = this.getChildrenSize(node.children);
261
257
  obj.height = obj.subSize * treeTableminCellHeight;
262
258
  } else {
263
259
  obj.width = this.originX - obj.left;
264
260
  obj.height = treeTableminCellHeight;
265
- obj.lineList = JSON.parse(JSON.stringify(list[i].lineList));
261
+ obj.lineList = JSON.parse(JSON.stringify(node.lineList));
266
262
  }
267
263
  arr.push(obj);
268
264
  }
@@ -271,7 +267,7 @@ export default {
271
267
  getChildrenSize(list) {
272
268
  let subSize = 0;
273
269
  for (let i = 0; i < list.length; i++) {
274
- if (list[i].children?.length) {
270
+ if (list[i]?.children?.length) {
275
271
  subSize += this.getChildrenSize(list[i].children);
276
272
  } else {
277
273
  subSize += 1;