cnhis-design-vue 2.1.101 → 2.1.102

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 (49) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +23 -23
  4. package/es/big-table/style.css +1 -1
  5. package/es/button/index.js +2 -2
  6. package/es/captcha/index.js +3 -3
  7. package/es/card-reader-sdk/index.js +1 -1
  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/ellipsis/index.js +1 -1
  13. package/es/fabric-chart/index.js +138 -100
  14. package/es/form-table/index.js +20 -20
  15. package/es/index/index.js +547 -354
  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 +25 -25
  20. package/es/multi-chat-client/index.js +19 -19
  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-container/index.js +1 -1
  27. package/es/scale-view/index.js +27 -27
  28. package/es/select/index.js +4 -4
  29. package/es/select-label/index.js +3 -3
  30. package/es/select-person/index.js +2 -2
  31. package/es/select-tag/index.js +4 -4
  32. package/es/shortcut-setter/index.js +2 -2
  33. package/es/table-filter/index.js +270 -115
  34. package/es/table-filter/style.css +1 -1
  35. package/es/tag/index.js +1 -1
  36. package/es/verification-code/index.js +2 -2
  37. package/lib/cui.common.js +622 -404
  38. package/lib/cui.umd.js +622 -404
  39. package/lib/cui.umd.min.js +18 -18
  40. package/package.json +1 -1
  41. package/packages/big-table/src/assets/style/table-global.less +1 -0
  42. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +64 -54
  43. package/packages/table-filter/src/base-search-com/BaseSearch.vue +1 -0
  44. package/packages/table-filter/src/components/render-widget/components/Text.vue +58 -0
  45. package/packages/table-filter/src/components/render-widget/components/index.js +3 -2
  46. package/packages/table-filter/src/components/render-widget/index.vue +11 -3
  47. package/packages/table-filter/src/components/render-widget/widgetCfgMaps.js +5 -5
  48. package/packages/table-filter/src/mixins/renderWidget.js +21 -5
  49. package/packages/table-filter/src/quick-search/QuickSearch.vue +10 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.101",
3
+ "version": "2.1.102",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -18,6 +18,7 @@
18
18
  overflow: hidden;
19
19
  transition: width 2s;
20
20
  padding-top: 8px;
21
+ text-align: left;
21
22
  .sort-item {
22
23
  line-height: 32px;
23
24
  padding: 0 13px;
@@ -486,12 +486,7 @@ export default {
486
486
  const lineHeightText = (obj.style?.fontSize || 12) + 2;
487
487
  const lineHeightImg = (obj.iconStyle?.height || 12) + 2;
488
488
  const lineHeightSeq = (obj.seqStyle?.circle?.radius || 9) * 2 + 2;
489
- const addCanvas = point => {
490
- point.hasControls = point.hasBorders = false;
491
- this.pointEvent(point);
492
- this.canvas.add(point);
493
- // this.canvas.requestRenderAll();
494
- };
489
+
495
490
  const setTop = (lineHeight, i, condition) => {
496
491
  if (!~condition.limitIndex) {
497
492
  condition.y += i === 0 ? lineHeight / 2 : lineHeight;
@@ -514,6 +509,7 @@ export default {
514
509
  };
515
510
  const x = this.cumputedX(item[0]);
516
511
  if (this.isLimit(item[0])) {
512
+ const pointList = [];
517
513
  item[1].forEach(async (v, i) => {
518
514
  const common = {
519
515
  left: x,
@@ -527,66 +523,80 @@ export default {
527
523
  objectCaching: false
528
524
  };
529
525
 
530
- const eventStyle = !this.eventStyle.evented
531
- ? {
532
- lockMovementX: true,
533
- lockMovementY: true
534
- }
535
- : {};
536
-
537
526
  if (this.isObject(v) && !v.value) {
538
527
  common.top = setTop(lineHeightImg, i, condition);
539
- const option = Object.assign({}, obj.iconStyle || {}, v || {}, {
540
- ...common,
541
- ...eventStyle
542
- });
543
- let ele;
544
- if (v?.iconClassName) {
545
- ele = await this.createImage(v.iconClassName, v);
546
- }
547
- const img = await this.createPoint(v?.url || v?.iconClassName ? 'img' : v.type, {
548
- ele: ele || '',
549
- ...option
550
- });
551
- addCanvas(img);
528
+ const option = {
529
+ ...obj.iconStyle,
530
+ ...v,
531
+ ...common
532
+ };
533
+ pointList.push(this.drawMarkPoint(v, option, obj));
552
534
  } else if (v.value) {
553
535
  if (v.seq) {
554
536
  common.top = setTop(lineHeightSeq, i, condition);
555
- // 标记增加序号
556
- const circle = await this.createPoint('circle', {
557
- ...common,
558
- radius: 5,
559
- strokeWidth: 1,
560
- stroke: '#000',
561
- fill: 'transparent',
562
- ...(obj.seqStyle?.circle || {})
563
- });
564
- const text = new this.fabric.Text(String(v.value), {
565
- ...defaultVaule.textStyle,
566
- ...common,
567
- ...(obj.seqStyle?.text || {})
568
- });
569
- const group = new this.fabric.Group([circle, text], {
570
- ...common,
571
- // hoverCursor: 'default',
572
- ...eventStyle
573
- });
574
- addCanvas(group);
537
+ pointList.push(this.drawMarkPoint(v, common, obj));
575
538
  } else {
576
539
  common.top = setTop(lineHeightText, i, condition);
577
- const text = new this.fabric.Text(String(v.value), {
578
- ...defaultVaule.textStyle,
579
- ...obj.style,
580
- ...common,
581
- ...eventStyle
582
- });
583
- addCanvas(text);
540
+ pointList.push(this.drawMarkPoint(v, common, obj));
584
541
  }
585
542
  }
586
543
  });
544
+ Promise.all(pointList).then(res => this.canvas.add(...res));
587
545
  }
588
546
  });
589
- // this.canvas.add(...textList);
547
+ },
548
+ async drawMarkPoint(v, option, obj) {
549
+ let point;
550
+ const eventStyle = !this.eventStyle.evented
551
+ ? {
552
+ lockMovementX: true,
553
+ lockMovementY: true
554
+ }
555
+ : {};
556
+ if (this.isObject(v) && !v.value) {
557
+ let ele;
558
+ if (v?.iconClassName) {
559
+ ele = await this.createImage(v.iconClassName, v);
560
+ }
561
+ point = await this.createPoint(v?.url || v?.iconClassName ? 'img' : v.type, {
562
+ ele: ele || '',
563
+ ...option,
564
+ ...eventStyle
565
+ });
566
+ } else if (v.value) {
567
+ if (v.seq) {
568
+ // 标记增加序号
569
+ const circle = await this.createPoint('circle', {
570
+ ...option,
571
+ radius: 5,
572
+ strokeWidth: 1,
573
+ stroke: '#000',
574
+ fill: 'transparent',
575
+ ...(obj.seqStyle?.circle || {})
576
+ });
577
+ const text = new this.fabric.Text(String(v.value), {
578
+ ...defaultVaule.textStyle,
579
+ ...option,
580
+ ...(obj.seqStyle?.text || {})
581
+ });
582
+ point = await new this.fabric.Group([circle, text], {
583
+ ...option,
584
+ ...eventStyle
585
+ });
586
+ } else {
587
+ point = await new this.fabric.Text(String(v.value), {
588
+ ...defaultVaule.textStyle,
589
+ ...obj.style,
590
+ ...option,
591
+ ...eventStyle
592
+ });
593
+ }
594
+ }
595
+
596
+ point.hasControls = point.hasBorders = false;
597
+ this.pointEvent(point);
598
+
599
+ return point;
590
600
  },
591
601
  pointEvent(point) {
592
602
  this.setPopup(point);
@@ -1805,6 +1805,7 @@ export default create({
1805
1805
  this.outRelationQuickSearch = [];
1806
1806
  let mySearchFieldList = JSON.parse(JSON.stringify(this.searchFieldList)).filter(i => ((i.random_key = this.getFiledRandom_key(i)), i.isShowSearch == 1 && i.filterExplicit == 1));
1807
1807
  this.outSearchFieldList = mySearchFieldList;
1808
+ this.sourceTrigger = 'baseSearch'
1808
1809
  // 跨表
1809
1810
  let outRelationQuickSearch = this.relationTableList.map(item => {
1810
1811
  return {
@@ -0,0 +1,58 @@
1
+ <template>
2
+ <Input
3
+ v-bind="$attrs"
4
+ v-on="$listeners"
5
+ v-model="valueCp"
6
+ class="widget-input"
7
+ >
8
+ <template v-if="showPrefix" #prefix>
9
+ <Checkbox v-model="componentCfg.isAccurateSearch">精准查询</Checkbox>
10
+ </template>
11
+ </Input>
12
+ </template>
13
+
14
+ <script>
15
+ import { Input, Checkbox } from 'ant-design-vue';
16
+
17
+ export default {
18
+ inheritAttrs: false,
19
+ components: {
20
+ Input,
21
+ Checkbox
22
+ },
23
+ props: {
24
+ value: {
25
+ type: [Array, String, Number],
26
+ },
27
+ componentCfg: {
28
+ type: Object
29
+ },
30
+ isQuick: {type: Boolean, default: false}
31
+ },
32
+ model: {
33
+ prop: "value",
34
+ event: "update:value"
35
+ },
36
+ computed: {
37
+ valueCp: {
38
+ set(val) {
39
+ this.$emit("update:value", val);
40
+ },
41
+ get() {
42
+ return this.value;
43
+ }
44
+ },
45
+ showPrefix() {
46
+ return !this.isQuick && this.componentCfg?.widgetCfg?.accurateSearch?.switchEnable
47
+ }
48
+ },
49
+ methods: {},
50
+ }
51
+ </script>
52
+ <style lang='less'>
53
+ .widget-input {
54
+ .ant-input:not(:first-child) {
55
+ padding-left: 100px;
56
+ }
57
+ }
58
+ </style>
@@ -4,6 +4,7 @@ import NumberRange from './NumberRange.vue';
4
4
  import DateRangeQuick from './DateRangeQuick.vue';
5
5
  import SelectDynamic from './SelectDynamic.vue';
6
6
  import Label from './Label.vue';
7
- import SelectLabel from './SelectLabel.vue'
7
+ import SelectLabel from './SelectLabel.vue';
8
+ import Text from './Text.vue';
8
9
 
9
- export { CheckboxGroup, Select, NumberRange, DateRangeQuick, SelectDynamic, Label, SelectLabel };
10
+ export { CheckboxGroup, Select, NumberRange, DateRangeQuick, SelectDynamic, Label, SelectLabel, Text };
@@ -58,7 +58,15 @@ export default {
58
58
  if(cfg?.fieldType?.includes?.('DATE') && cfg?.widgetCfg?.rangeFilter) {
59
59
  defW = 350
60
60
  }
61
- return `${cfg.advanceColWidth||defW}px`;
61
+ const isInputSwitchEnable = cfg?.fieldType === WidgetTypeEnums.INPUT && cfg?.widgetCfg?.accurateSearch?.switchEnable
62
+ if(isInputSwitchEnable) {
63
+ defW = 300
64
+ }
65
+ let width = cfg.advanceColWidth;
66
+ if (width && !isNaN(+width) && isInputSwitchEnable) {
67
+ width = +width + 100;
68
+ }
69
+ return `${width||defW}px`;
62
70
  },
63
71
  getEleMinWidth(cfg){
64
72
  if(!this.isQuick) return `${cfg.advanceColWidth|| 195}px`;
@@ -76,11 +84,11 @@ export default {
76
84
  if (customPlaceholder) {
77
85
  Props.placeholder = customPlaceholder;
78
86
  }
79
- if(widgetType === 'SELECT_DYNAMIC') {
87
+ if(widgetType === WidgetTypeEnums.SELECT_DYNAMIC) {
80
88
  Props.dropdownVisibleChangeRender = this.dropdownVisibleChangeRender;
81
89
  Props.handleWordBookSearchRender = this.handleWordBookSearchRender;
82
90
  }
83
- if(widgetType === 'LABEL' || widgetType === 'SELECT_LABEL') {
91
+ if(widgetType === WidgetTypeEnums.LABEL || widgetType === WidgetTypeEnums.SELECT_LABEL) {
84
92
  Props.getLabelListMethodRender = this.getLabelListMethodRender;
85
93
  }
86
94
  this.initialProps = Props;
@@ -1,6 +1,6 @@
1
1
  import { WidgetTypeEnums, DatePresetValEnums } from './enums';
2
2
  import { InputNumber, Input, DatePicker } from 'ant-design-vue';
3
- import { CheckboxGroup, Select, NumberRange, DateRangeQuick, SelectDynamic, Label, SelectLabel } from './components';
3
+ import { CheckboxGroup, Select, NumberRange, DateRangeQuick, SelectDynamic, Label, SelectLabel, Text } from './components';
4
4
  import moment from 'moment';
5
5
  import { presetValToTimestamp } from './helpers/presetValToTimestamp';
6
6
 
@@ -34,7 +34,7 @@ export const WidgetCfgMaps = new Map([
34
34
  [
35
35
  WidgetTypeEnums.INPUT,
36
36
  {
37
- component: Input,
37
+ component: Text,
38
38
  props: {
39
39
  allowClear: true
40
40
  },
@@ -48,8 +48,8 @@ export const WidgetCfgMaps = new Map([
48
48
  }
49
49
  }
50
50
  ],
51
- handlerProps(props, { title } = {}) {
52
- const Props = { ...props, placeholder: `请输入${title}` };
51
+ handlerProps(props, { title, isQuick } = {}) {
52
+ const Props = { ...props, placeholder: `请输入${title}`, isQuick };
53
53
  return Props;
54
54
  },
55
55
  setDefaultValue: SetDefVal
@@ -284,5 +284,5 @@ export const WidgetCfgMaps = new Map([
284
284
  return defaultValue;
285
285
  }
286
286
  }
287
- ],
287
+ ]
288
288
  ]);
@@ -13,6 +13,11 @@ function randomkey() {
13
13
  const BlockEle = [WidgetTypeEnums.CHECKBOX_GROUP, WidgetTypeEnums.DATE_RANGE_QUICK, WidgetTypeEnums.CHECKBOX_GROUP, WidgetTypeEnums.LABEL];
14
14
 
15
15
  export default {
16
+ data() {
17
+ return {
18
+ sourceTrigger: ''
19
+ };
20
+ },
16
21
  methods: {
17
22
  isRender(cfg) {
18
23
  return cfg.widgetCfg?.isRender;
@@ -31,12 +36,18 @@ export default {
31
36
  const isRender = this.isRender(cfg);
32
37
  if (!isRender) return isRender;
33
38
 
34
- const { widgetType } = cfg.widgetCfg || {};
39
+ let { widgetType } = cfg.widgetCfg || {};
35
40
 
36
41
  this.$set(cfg, '_frontId', randomkey());
37
42
  this.$set(cfg, 'isRender', isRender);
38
43
  this.$set(cfg, 'widgetType', widgetType);
39
44
  this.$set(cfg, 'con', 'EQ');
45
+ // 高级筛选中不处理
46
+ let { switchEnable = false, searchKey = '' } = cfg.widgetCfg?.accurateSearch || {};
47
+ if (this.sourceTrigger === 'baseSearch' && cfg.widgetType === WidgetTypeEnums.INPUT && switchEnable) {
48
+ this.$set(cfg, 'isAccurateSearch', false);
49
+ this.$set(cfg, 'accurateSearchKey', searchKey);
50
+ }
40
51
 
41
52
  if (BlockEle.includes(widgetType)) this.$set(cfg, '_isBlock', true);
42
53
 
@@ -47,7 +58,7 @@ export default {
47
58
  getRenderSearchConObj(cfg) {
48
59
  const isRender = this.isRender(cfg);
49
60
  if (!isRender) return null;
50
- const { columnName, con, value, widgetType } = cfg;
61
+ const { columnName, con, value, widgetType, widgetCfg, isAccurateSearch, accurateSearchKey } = cfg;
51
62
 
52
63
  let unit = null;
53
64
  // 时间组件 unit 设置为自定义
@@ -57,13 +68,18 @@ export default {
57
68
  }
58
69
 
59
70
  const val = Array.isArray(value) ? value : value ? [value] : [];
60
-
61
- return {
71
+ let obj = {
62
72
  field_key: columnName,
63
73
  con,
64
74
  value: val.length > 0 ? val : null,
65
75
  unit
66
76
  };
77
+
78
+ if (widgetType === WidgetTypeEnums.INPUT && widgetCfg?.accurateSearch?.switchEnable) {
79
+ obj.isAccurateSearch = isAccurateSearch;
80
+ obj.accurateSearchKey = accurateSearchKey;
81
+ }
82
+ return obj;
67
83
  },
68
84
  getDefValByRenderConObj(conObj, cfg) {
69
85
  const isRender = this.isRender(cfg);
@@ -87,7 +103,7 @@ export default {
87
103
  resetRenderWidgetValue(cfg) {
88
104
  const isRender = this.isRender(cfg);
89
105
  if (!isRender) return isRender;
90
- if (cfg.widgetType == 'DATE_RANGE_QUICK') {
106
+ if (cfg.widgetType == WidgetTypeEnums.DATE_RANGE_QUICK) {
91
107
  cfg.con = undefined;
92
108
  }
93
109
  cfg.value = undefined;
@@ -826,6 +826,7 @@ export default create({
826
826
  return {
827
827
  modalVisible: this.visible,
828
828
  showInner: false,
829
+ showInnerOutFilterConOBj: [], // 保存到分类时, 携带外部条件
829
830
  quickSearch: [],
830
831
  relationTableList: [], // 跨表查询
831
832
  relationQuickSearch: [], // 跨表查询检索条件
@@ -851,6 +852,7 @@ export default create({
851
852
  showAdd: false,
852
853
  addVal: "",
853
854
  fetchingWordbook: false,
855
+
854
856
  ...dataOptions
855
857
  };
856
858
  },
@@ -1372,12 +1374,14 @@ export default create({
1372
1374
  this.isChangeWindow = false;
1373
1375
  },
1374
1376
  // 填写搜索设置条件后打开新增搜索分类名称弹框
1375
- openSaveToCalss() {
1377
+ openSaveToCalss(outFilterConOBj = []) {
1376
1378
  let conObj = this.getConObjParams();
1377
1379
  if (!conObj) return;
1378
1380
  if (conObj.length > 0) {
1379
1381
  if (!this.validConObj(conObj, this.searchFieldList, this.searchFieldLimit)) return;
1380
1382
  this.showInner = true;
1383
+ // 保存到分类时, 携带外部条件
1384
+ this.showInnerOutFilterConOBj = outFilterConOBj
1381
1385
  } else {
1382
1386
  this.$message.warning(this.getI18nText('1.1.6.18', '请设置搜索条件'), 2);
1383
1387
  }
@@ -1591,6 +1595,9 @@ export default create({
1591
1595
  conObj = [];
1592
1596
  }
1593
1597
  let displayCategory = this.parentNames.filter(item => item.selected)[0]?.value;
1598
+ if(this.showInnerOutFilterConOBj?.length) {
1599
+ conObj.push(...this.showInnerOutFilterConOBj)
1600
+ }
1594
1601
  let params = {
1595
1602
  tableId: this.$attrs.tableId || "",
1596
1603
  setting: JSON.stringify({
@@ -1672,6 +1679,7 @@ export default create({
1672
1679
  let res = await this.handleGetConfigApi(params, 'requestSaveTableCondiTion');
1673
1680
  if (!res) return;
1674
1681
  this.showInner = false;
1682
+ this.showInnerOutFilterConOBj = [];
1675
1683
  this.formInner.resetFields();
1676
1684
  this.$emit("updateTableCondiTion");
1677
1685
  this.clearData();
@@ -1682,6 +1690,7 @@ export default create({
1682
1690
  },
1683
1691
  cancelSaveToCalss() {
1684
1692
  this.showInner = false;
1693
+ this.showInnerOutFilterConOBj = [];
1685
1694
  },
1686
1695
  // 清空快速搜索设置条件
1687
1696
  clearData() {