cnhis-design-vue 2.1.21 → 2.1.24

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 (42) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +64 -54
  4. package/es/big-table/style.css +1 -1
  5. package/es/button/index.js +32 -25
  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 +115 -77
  13. package/es/form-table/index.js +17 -17
  14. package/es/index/index.js +439 -353
  15. package/es/index/style.css +1 -1
  16. package/es/input/index.js +1 -1
  17. package/es/map/index.js +1 -1
  18. package/es/multi-chat/index.js +24 -24
  19. package/es/multi-chat-client/index.js +18 -18
  20. package/es/multi-chat-history/index.js +4 -4
  21. package/es/multi-chat-record/index.js +4 -4
  22. package/es/multi-chat-setting/index.js +20 -20
  23. package/es/multi-chat-sip/index.js +1 -1
  24. package/es/radio/index.js +1 -1
  25. package/es/scale-view/index.js +24 -24
  26. package/es/select/index.js +3 -3
  27. package/es/select-label/index.js +3 -3
  28. package/es/select-person/index.js +63 -40
  29. package/es/select-person/style.css +1 -1
  30. package/es/table-filter/index.js +95 -80
  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 +533 -447
  35. package/lib/cui.umd.js +533 -447
  36. package/lib/cui.umd.min.js +23 -23
  37. package/package.json +1 -1
  38. package/packages/big-table/src/BigTable.vue +6 -1
  39. package/packages/button/src/ButtonPrint/index.vue +42 -31
  40. package/packages/fabric-chart/src/fabric-chart/FabricPolylines.vue +50 -39
  41. package/packages/select-person/select-person.vue +29 -7
  42. package/packages/table-filter/src/base-search-com/BaseSearch.vue +84 -78
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.21",
3
+ "version": "2.1.24",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -593,6 +593,11 @@ export default create({
593
593
  setCurrentRow(row) {
594
594
  this.$refs.xGrid.setCurrentRow(row);
595
595
  },
596
+ setDefCheckboxRow(row) {
597
+ const vxeTable = this.$refs.xGrid;
598
+ let { tableData } = vxeTable.getTableData();
599
+ this.$refs.xGrid?.setCheckboxRow([tableData?.[0] || row], true);
600
+ },
596
601
  // 加载表格头部
597
602
  loadColumn(config) {
598
603
  this.isLoadColumn = false;
@@ -1288,7 +1293,7 @@ export default create({
1288
1293
  this.fieldKeyMap = {};
1289
1294
  const currentColumns = fieldList.map((item, index) => {
1290
1295
  this.fieldKeyMap[item.columnName] = item;
1291
- let filterField = item?.fieldSetting?.mapping?.type === 'manual' && item.isMerge != 1;
1296
+ let filterField = item?.fieldSetting?.mapping?.type === 'manual' && item.isMerge != 1 && item.notParticipatingSearch != 1;
1292
1297
  // 是否排序 1 不可排序
1293
1298
  let notParticipatingSort = item?.fieldSetting?.notParticipatingSort || '';
1294
1299
  // 有子列表fixed会遮盖 所以主表不设置fixed
@@ -136,7 +136,12 @@ export default create({
136
136
  default: () => ({})
137
137
  },
138
138
  // 1 为his老版,2 为新版 3为his更老版本
139
- versionType: { type: [Number, String], default: '2' }
139
+ versionType: { type: [Number, String], default: '2' },
140
+ // 用于获取用户信息的token
141
+ token: {
142
+ type: String,
143
+ default: ''
144
+ }
140
145
  },
141
146
  computed: {
142
147
  currentFormatItem() {
@@ -166,14 +171,17 @@ export default create({
166
171
  };
167
172
  },
168
173
  beforeCreate() {
169
- Vue.use(Button).use(Dropdown).use(Menu).use(Icon);
174
+ Vue.use(Button)
175
+ .use(Dropdown)
176
+ .use(Menu)
177
+ .use(Icon);
170
178
  },
171
179
  mounted() {
172
180
  this.isInited = false;
173
181
  },
174
182
  beforeDestroy() {
175
183
  // 创建Print实例的时候会在webview中注册一个事件, 需要调用printInstance.destroy()手动清除
176
- printInstance?.destroy?.()
184
+ printInstance?.destroy?.();
177
185
  },
178
186
  watch: {
179
187
  // 监听变化, 重新格式化printParams
@@ -409,7 +417,10 @@ export default create({
409
417
  /* */
410
418
  getPrintParams(index = 0) {
411
419
  const params = this.printParams[index];
412
- return JSON.stringify(params);
420
+ return JSON.stringify({
421
+ ...(params || {}),
422
+ ...(this.token ? { token: this.token } : {})
423
+ });
413
424
  },
414
425
  getTemplateIdByFormatId(id) {
415
426
  let find = this.formatList.find(item => item.id === id);
@@ -460,7 +471,7 @@ export default create({
460
471
  })
461
472
  .then(() => {
462
473
  if (this.versionType == 1 || this.versionType == 3) {
463
- const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint'
474
+ const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint';
464
475
  if (this.strategy === 'MULTI') {
465
476
  for (let i = 0; i < this.params.length; i++) {
466
477
  const params = this.getHisParams(i);
@@ -529,7 +540,7 @@ export default create({
529
540
  const { templateParams, hisParams, params } = this;
530
541
  const { reportid = '280' } = hisParams;
531
542
  const { id, name } = templateParams;
532
- const obj = {}
543
+ const obj = {};
533
544
  Object.keys(params[0]).forEach(v => {
534
545
  obj[v] = [];
535
546
  params.forEach(k => {
@@ -555,7 +566,7 @@ export default create({
555
566
  .then(() => {
556
567
  if (this.versionType == 1 || this.versionType == 3) {
557
568
  const params = this.strategy === 'MULTI' ? this.getHisParams() : this.getOnceHisParams();
558
- const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint'
569
+ const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint';
559
570
  printInstance[printFn](8, params)
560
571
  .then(res => {
561
572
  console.log(res, 88888888);
@@ -565,7 +576,7 @@ export default create({
565
576
  });
566
577
  } else {
567
578
  const IS_MULTI = this.strategy === 'MULTI';
568
- if(IS_MULTI){
579
+ if (IS_MULTI) {
569
580
  // 循环多条
570
581
  for (let i = 0; i < this.printParams.length; i++) {
571
582
  const queryParams = {
@@ -574,26 +585,26 @@ export default create({
574
585
  params: this.getPrintParams(i)
575
586
  };
576
587
  printInstance.preview(
577
- queryParams,
578
- res => {
579
- this.callLocalServicesSuccessCb(res, 'preview');
580
- },
581
- this.callLocalServicesErrorCb
582
- );
588
+ queryParams,
589
+ res => {
590
+ this.callLocalServicesSuccessCb(res, 'preview');
591
+ },
592
+ this.callLocalServicesErrorCb
593
+ );
583
594
  }
584
595
  } else {
585
- const queryParams = {
586
- formatId: this.currentFormatId,
587
- templateId: this.getTemplateIdByFormatId(this.currentFormatId),
588
- params: this.getOnceParams()
589
- };
590
- printInstance.preview(
591
- queryParams,
592
- res => {
593
- this.callLocalServicesSuccessCb(res, 'preview');
594
- },
595
- this.callLocalServicesErrorCb
596
- );
596
+ const queryParams = {
597
+ formatId: this.currentFormatId,
598
+ templateId: this.getTemplateIdByFormatId(this.currentFormatId),
599
+ params: this.getOnceParams()
600
+ };
601
+ printInstance.preview(
602
+ queryParams,
603
+ res => {
604
+ this.callLocalServicesSuccessCb(res, 'preview');
605
+ },
606
+ this.callLocalServicesErrorCb
607
+ );
597
608
  }
598
609
  }
599
610
  })
@@ -612,7 +623,7 @@ export default create({
612
623
  .then(() => {
613
624
  if (this.versionType == 1 || this.versionType == 3) {
614
625
  const params = this.strategy === 'MULTI' ? this.getHisParams() : this.getOnceHisParams();
615
- const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint'
626
+ const printFn = this.versionType == 1 ? 'handleHisPrint' : 'handleOldHisPrint';
616
627
  printInstance[printFn](9, params)
617
628
  .then(res => {
618
629
  console.log(res, 999999);
@@ -669,12 +680,12 @@ export default create({
669
680
  /**
670
681
  * 获取 axios 自定义配置
671
682
  */
672
- getCustomCofing(customCofing){
673
- let cCofing = {}
683
+ getCustomCofing(customCofing) {
684
+ let cCofing = {};
674
685
  let type = typeof customCofing;
675
- if(type === 'function'){
686
+ if (type === 'function') {
676
687
  cCofing = customCofing();
677
- } else if(type === 'object'){
688
+ } else if (type === 'object') {
678
689
  cCofing = customCofing;
679
690
  }
680
691
  return cCofing;
@@ -14,6 +14,32 @@ import MouseRightClick from '../components/MouseRightClick';
14
14
  import DropPopup from '../components/DropPopup';
15
15
  import defaultVaule from '../const/defaultVaule';
16
16
 
17
+ /**
18
+ * @description: 递归遍历节点,设置颜色属性
19
+ * @param {fabric.Object[]} pointArr
20
+ * @param {string}} color
21
+ * @return {*}
22
+ */
23
+
24
+ function resetPointColor(pointArr, color) {
25
+ pointArr.forEach(point => {
26
+ const { fill, stroke } = point;
27
+ if (fill && !fill.includes('#fff') && fill !== 'transparent') {
28
+ point.set({ fill: color });
29
+ }
30
+ if (stroke && !stroke.includes('#fff') && stroke !== 'transparent') {
31
+ point.set({ stroke: color });
32
+ }
33
+ if (point._objects?.length) {
34
+ resetPointColor(point._objects, color);
35
+ }
36
+ });
37
+ }
38
+ const setPointLineColor = (point, color, conditionHasLine2) => {
39
+ point.line1?.set({ stroke: color });
40
+ conditionHasLine2 && point.line2?.set({ stroke: color });
41
+ };
42
+
17
43
  const isEffectiveNode = node => {
18
44
  return node?.time && (node?.value || node?.value === 0);
19
45
  };
@@ -470,13 +496,7 @@ export default {
470
496
  polylineTypeId,
471
497
  polylineIndex,
472
498
  pointerList,
473
- pointStyle: {
474
- fill: res[0].fill,
475
- stroke: res[0].stroke
476
- },
477
- lineStyle: {
478
- stroke: lineAttr.stroke
479
- },
499
+ color: lineAttr.stroke,
480
500
  pointList: res
481
501
  });
482
502
  }
@@ -583,13 +603,18 @@ export default {
583
603
  const position = this.polyline[point.polylineTypeId].position;
584
604
  // 如果是重合/连线节点
585
605
  if (point.get('scaleX') !== point.scale) {
586
- this.addPointList.splice(-1, 1, {
606
+ const addOjb = {
587
607
  ...lastPoint,
588
608
  value: {
589
609
  time: this.getXValue(this._concatPoint?.left),
590
610
  value: this.getYValue(position, this._concatPoint?.top)
591
611
  }
592
- });
612
+ };
613
+ if (lastPoint.value.time == addOjb.value.time) {
614
+ this.addPointList.splice(-1, 1, addOjb);
615
+ } else {
616
+ this.addPointList.push(addOjb);
617
+ }
593
618
  this.addPointList.forEach(v => Object.assign(v, { isConcat: true, concatIndex: this._concatIndex }));
594
619
  } else if (point.line2 || (point.nextPoint && lastPoint.left >= point.nextPoint.left)) {
595
620
  // 1、存在右连线 2、无右侧连线,并且存在下一个节点的情况
@@ -679,13 +704,7 @@ export default {
679
704
  // 复制点和线
680
705
  if (conditionNoLine2 || conditionHasLine2) {
681
706
  // point.line1 && this.removePolyline(point.line1.id);
682
- point.line1?.set({
683
- stroke: 'transparent'
684
- });
685
- conditionHasLine2 &&
686
- point.line2?.set({
687
- stroke: 'transparent'
688
- });
707
+ setPointLineColor(point, 'transparent', conditionHasLine2);
689
708
  // if (i === 1) {
690
709
  this.addPointList.length == 0 && (await this.clonePoint(point, [point.line1 ? point.line1.x1 : originLeft, point.line1 ? point.line1.y1 : originTop, originLeft, originTop]));
691
710
  // }
@@ -725,10 +744,10 @@ export default {
725
744
  }
726
745
 
727
746
  // 检查是否显示重合连线放大节点的标识
728
- // if (conditionHasLine2) {
747
+ const { polylineTypeId, polylineIndex } = point;
748
+ const polylineObj = this.polylinePointList.find(v => v.polylineTypeId == polylineTypeId && v.polylineIndex == polylineIndex);
749
+ polylineObj?.pointList.forEach(v => v.bringToFront());
729
750
  if (point.nextPoint) {
730
- const { polylineTypeId, polylineIndex } = point;
731
- const polylineObj = this.polylinePointList.find(v => v.polylineTypeId == polylineTypeId && v.polylineIndex == polylineIndex);
732
751
  this._concatIndex = polylineObj?.pointerList.findIndex(v => v + n > left && v > originLeft);
733
752
  if (!~this._concatIndex) {
734
753
  point.set({
@@ -739,41 +758,33 @@ export default {
739
758
  concatPoint(polylineObj?.pointList[this._concatIndex]);
740
759
  }
741
760
  this._concatPoint = polylineObj?.pointList?.[this._concatIndex] || null;
761
+
762
+ // 被覆盖节点置灰配置
742
763
  polylineObj?.pointerList.forEach((v, i) => {
743
764
  const obj = polylineObj?.pointList[i];
744
765
  if (v > originLeft && v < left) {
745
- const { fill, stroke } = polylineObj.pointStyle;
746
- const setColor = color => {
747
- return color && (color !== '#fff' || color !== 'transparent') ? '#999' : color;
748
- };
749
766
  // 此处需要递归遍历group节点的所有子节点,然后更改其颜色
750
- // 待完善
751
- obj.set({ fill: setColor(fill), stroke: setColor(stroke) });
752
- // obj.line2?.set({ fill: setColor(fill), stroke: setColor(stroke) });
767
+ resetPointColor([obj], '#999');
768
+ obj.line2?.set({ stroke: '#999' });
753
769
  } else {
754
- obj.set(polylineObj.pointStyle);
755
- // obj.line2?.set(polylineObj.lineStyle);
770
+ resetPointColor([obj], polylineObj.color);
771
+ obj.line2?.set({ stroke: polylineObj.color });
756
772
  }
757
773
  });
774
+ if ((point.line1 || point.line2) && left < originLeft + spaceWidth) {
775
+ setPointLineColor(point, polylineObj.color, true);
776
+ } else {
777
+ setPointLineColor(point, 'transparent', true);
778
+ }
758
779
  }
759
780
 
760
- // } else {
761
- // point.nextPoint && concatPoint(point.nextPoint);
762
- // }
763
-
764
781
  // 如果往回拖动则删除经过的已存在的节点
765
782
  if (startLength > 0 && currentLeft <= this.addPointList[startLength - 1].left) {
766
783
  this.removePolyline('increasePointBatch', left);
767
784
  this.addPointList = this.addPointList.filter(v => v.left < left);
768
785
  const endLength = this.addPointList.length;
769
786
  if (endLength === 0) {
770
- point.line1?.set({
771
- stroke: point.stroke
772
- });
773
- conditionHasLine2 &&
774
- point.line2?.set({
775
- stroke: point.stroke
776
- });
787
+ setPointLineColor(point, polylineObj?.color, conditionHasLine2);
777
788
  this.removePolyline('increasePointBatch', originLeft);
778
789
  }
779
790
  if (endLength > 0) {
@@ -44,7 +44,7 @@
44
44
  checkable
45
45
  :expandedKeys="expandedKeys"
46
46
  :autoExpandParent="autoExpandParent"
47
- :checkStrictly="false"
47
+ :checkStrictly="checkStrictly"
48
48
  :selectable="false"
49
49
  :treeData="treeData.temp"
50
50
  :load-data="getLoadChildData"
@@ -209,6 +209,14 @@ export default create({
209
209
  type: Boolean,
210
210
  default: false
211
211
  },
212
+ checkStrictly: {
213
+ type: Boolean,
214
+ default: false
215
+ },
216
+ needFilterParentDept: {
217
+ type: Boolean,
218
+ default: true
219
+ },
212
220
  queryMainTreeData: Function, // 主树请求
213
221
  queryLoadChildData: Function, // 懒加载请求
214
222
  queryTreeSearch: Function // 检索请求
@@ -331,9 +339,14 @@ export default create({
331
339
  let { key } = item;
332
340
  let showKeys = [...this.checkedKeys.dept, ...otherItems];
333
341
  let checked = showKeys.includes(key);
334
- // 只展示最后一级的科室
335
342
  item.itemType = 'dept';
336
- return checked && item.type == 1 && (!item.children || (item.children && !item.children.length));
343
+ // 只展示最后一级的科室
344
+ if (this.needFilterParentDept) {
345
+ return checked && item.type == 1 && (!item.children || (item.children && !item.children.length));
346
+ } else {
347
+ // 不过滤
348
+ return checked && item.type == 1;
349
+ }
337
350
  });
338
351
  let roleItems = this.dataList.role.filter(item => {
339
352
  let showKeys = [...this.checkedKeys.role, ...otherItems];
@@ -430,6 +443,7 @@ export default create({
430
443
  const deptIds = this.defaultList.filter(item => item.itemType === 'dept').map(item => item.id);
431
444
  const roleIds = this.defaultList.filter(item => item.itemType === 'role').map(item => item.id);
432
445
  const key = ['main', 'dept', 'role'][this.typeActiveIndex];
446
+ console.log(deptIds, key, '666 init');
433
447
  this.checkedKeys.main = userIds;
434
448
  this.checkedKeys.dept = deptIds;
435
449
  this.checkedKeys.role = roleIds;
@@ -451,7 +465,8 @@ export default create({
451
465
  },
452
466
  getDeptData(data) {
453
467
  // 把data里面的人员过滤掉
454
- const copyData = JSON.parse(JSON.stringify(data));
468
+ let copyData = JSON.parse(JSON.stringify(data));
469
+ copyData = copyData.filter(item => item.type === 1);
455
470
  vexutils.searchTree(copyData, item => {
456
471
  if (item.type === 1 && item.children && item.children.length) {
457
472
  item.children = item.children.filter(child => child.type === 1);
@@ -1319,6 +1334,9 @@ export default create({
1319
1334
  this.isAllCheck(checkedKeys);
1320
1335
  },
1321
1336
  onTreeCheck(checkedKeys, { checked, node }) {
1337
+ if (this.checkStrictly) {
1338
+ checkedKeys = checkedKeys.checked;
1339
+ }
1322
1340
  // 断掉了父子关系 要不然当存在一二级科室的时候 搜索二级科室 再选中会把一级也选中 ; 后续与产品沟通 不需要断 只取最后一级科室
1323
1341
  const propStr = ['main', 'dept', 'role'][this.typeActiveIndex];
1324
1342
  let totalCheckedKeys = [];
@@ -1353,8 +1371,9 @@ export default create({
1353
1371
  vexutils.searchTree(keyData.children, item => {
1354
1372
  childKeys.push(item.key);
1355
1373
  });
1356
- const allParentIds = getAllParentId(this.treeData[propStr], node.eventKey).filter(Boolean);
1357
- totalCheckedKeys = [...new Set(preChecked.concat(checkedKeys, childKeys))].filter(id => !allParentIds.includes(id));
1374
+ // const allParentIds = getAllParentId(this.treeData[propStr], node.eventKey).filter(Boolean);
1375
+ // totalCheckedKeys = [...new Set(preChecked.concat(checkedKeys, childKeys))].filter(id => !allParentIds.includes(id));
1376
+ totalCheckedKeys = [...new Set(preChecked.concat(checkedKeys, childKeys))];
1358
1377
  } else {
1359
1378
  // 如果是取消从之前的选择中把当前点击的及其子级去除选中作为temp值(兼容搜索的情况)
1360
1379
  let keyData = {};
@@ -1369,7 +1388,10 @@ export default create({
1369
1388
  needCancelKeys.push(item.key);
1370
1389
  });
1371
1390
  const allParentIds = getAllParentId(this.treeData[propStr], node.eventKey).filter(Boolean);
1372
- totalCheckedKeys = [...new Set(preChecked.filter(key => !needCancelKeys.includes(key)))].filter(id => !allParentIds.includes(id));
1391
+ totalCheckedKeys = [...new Set(preChecked.filter(key => !needCancelKeys.includes(key)))];
1392
+ if (!this.checkStrictly) {
1393
+ totalCheckedKeys = totalCheckedKeys.filter(id => !allParentIds.includes(id));
1394
+ }
1373
1395
  }
1374
1396
  this.checkedKeys.temp = totalCheckedKeys;
1375
1397
  this.checkedKeys[propStr] = totalCheckedKeys;