cnhis-design-vue 2.1.147 → 2.1.148

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 (45) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/es/age/index.js +2 -2
  3. package/es/big-table/index.js +26 -26
  4. package/es/button/index.js +4 -4
  5. package/es/captcha/index.js +3 -3
  6. package/es/card-reader-sdk/index.js +1 -1
  7. package/es/checkbox/index.js +1 -1
  8. package/es/color-picker/index.js +1 -1
  9. package/es/drag-layout/index.js +3 -3
  10. package/es/editor/index.js +1 -1
  11. package/es/ellipsis/index.js +1 -1
  12. package/es/fabric-chart/index.js +46 -20
  13. package/es/form-table/index.js +20 -20
  14. package/es/full-calendar/index.js +4 -4
  15. package/es/index/index.js +423 -281
  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/slider-tree/index.js +1 -1
  34. package/es/table-filter/index.js +233 -117
  35. package/es/table-filter/style.css +1 -1
  36. package/es/tag/index.js +1 -1
  37. package/es/verification-code/index.js +2 -2
  38. package/lib/cui.common.js +469 -327
  39. package/lib/cui.umd.js +469 -327
  40. package/lib/cui.umd.min.js +13 -13
  41. package/package.json +1 -1
  42. package/packages/fabric-chart/src/fabric-chart/FabricTextGroup.vue +15 -0
  43. package/packages/fabric-chart/src/mixins/eventCommon.js +5 -2
  44. package/packages/table-filter/src/classification/Classification-com.vue +6 -1
  45. package/packages/table-filter/src/components/search-condition/SearchCondition.vue +101 -7
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "2.1.147",
3
+ "version": "2.1.148",
4
4
  "description": "前端业务UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -84,6 +84,12 @@ export default {
84
84
  mounted() {
85
85
  setTimeout(() => {
86
86
  document.addEventListener('keydown', this.handleInputBoxEnterEvent, true);
87
+
88
+ const _style = this.fabric.document.createElement('style');
89
+ _style.type = 'text/css';
90
+ const cssContent = this.fabric.document.createTextNode('.fabric-chart__hiddenTextarea { top:var(--fabric-chart-hiddenTextarea-height) !important }');
91
+ _style.appendChild(cssContent);
92
+ this.fabric.document.head.appendChild(_style);
87
93
  });
88
94
  },
89
95
  computed: {
@@ -167,6 +173,10 @@ export default {
167
173
  });
168
174
  this.canvas.add(this.inputObj).setActiveObject(this.inputObj);
169
175
  this.inputObj.enterEditing();
176
+ this.$nextTick().then(() => {
177
+ this.handleScroll();
178
+ this.inputObj.hiddenTextarea.classList.add('fabric-chart__hiddenTextarea');
179
+ });
170
180
  if (content) {
171
181
  this.inputObj.setSelectionEnd(content.length);
172
182
  }
@@ -197,6 +207,11 @@ export default {
197
207
 
198
208
  Bus.$on('deleteOther', otherList => this.$emit('deleteOther', otherList));
199
209
  },
210
+ handleScroll(e) {
211
+ this.isRightVisible = false;
212
+ const wrapperElTop = this.canvas?.wrapperEl.getBoundingClientRect().top;
213
+ this.inputObj?.hiddenTextarea?.style?.setProperty('--fabric-chart-hiddenTextarea-height', `${wrapperElTop + this.inputObj.top + this.inputObj.height}px`);
214
+ },
200
215
  handleInputBoxEnterEvent(e) {
201
216
  if (!this.inputObj || ![13, 27].includes(e.keyCode)) return;
202
217
  if (e.keyCode === 27) {
@@ -33,7 +33,7 @@ export default {
33
33
  mounted() {
34
34
  if (this.eventStyle.evented) {
35
35
  document.addEventListener('click', this.handleClickAndScroll, true);
36
- document.addEventListener('scroll', this.handleClickAndScroll, true);
36
+ document.addEventListener('scroll', this.handleScroll, true);
37
37
  }
38
38
  },
39
39
  methods: {
@@ -91,6 +91,9 @@ export default {
91
91
  },
92
92
  handleClickAndScroll(e) {
93
93
  this.isRightVisible = false;
94
+ },
95
+ handleScroll(e) {
96
+ this.handleClickAndScroll(e);
94
97
  }
95
98
  },
96
99
  beforeDestroy() {
@@ -98,7 +101,7 @@ export default {
98
101
  const upperCanvas = this.canvas.wrapperEl;
99
102
  upperCanvas && upperCanvas.removeEventListener('contextmenu', this.addEventListenerContextmenu, true);
100
103
  document.removeEventListener('click', this.handleClickAndScroll, true);
101
- document.removeEventListener('scroll', this.handleClickAndScroll, true);
104
+ document.removeEventListener('scroll', this.handleScroll, true);
102
105
  }
103
106
  }
104
107
  };
@@ -420,6 +420,7 @@
420
420
  :tableId="tableId"
421
421
  :classifyModal="classifyModal"
422
422
  :filterApiConfig="filterApiConfig"
423
+ :isCrm="isCrm"
423
424
  >
424
425
  <template #searchCondition="{ attrs, listeners }">
425
426
  <slot name="searchCondition" :attrs="attrs" :listeners="listeners"></slot>
@@ -514,9 +515,13 @@ export default create({
514
515
  searchFieldList: {
515
516
  type: Array,
516
517
  default: () => []
517
- }
518
+ },
519
+ libSource: {type: String, default: ''},
518
520
  },
519
521
  computed: {
522
+ isCrm() {
523
+ return this.libSource === 'crm';
524
+ },
520
525
  dynamicStyle() {
521
526
  if (this.classificationIndex === 0) {
522
527
  return {
@@ -117,6 +117,23 @@
117
117
  <a-input v-else v-model="item.value" :disabled="item.isIllegalField || item.is_compatibility" class="form-item" />
118
118
  </slot>
119
119
  </span>
120
+ <!-- 标签下拉 -->
121
+ <a-select
122
+ v-if="item.showLabelSelect"
123
+ class="val-label-wrap"
124
+ :filterOption="filterOption"
125
+ :disabled="item.isIllegalField"
126
+ v-model="item.value"
127
+ style="width: 160px"
128
+ showSearch
129
+ @dropdownVisibleChange="dropdownVisibleChangeLable($event, item)"
130
+ @select=" handleSelectLable($event, item)"
131
+ @deselect="handleDeSelectLable($event, item)"
132
+ >
133
+ <a-select-option v-for="v in item.labelList" :key="v.labelId" :value="v.labelId" >
134
+ {{ v.labelName}}
135
+ </a-select-option>
136
+ </a-select>
120
137
  <a-select
121
138
  class="val-select-wrap"
122
139
  v-if="item.showSearch"
@@ -328,7 +345,15 @@ export default create({
328
345
  openType: {
329
346
  type: String,
330
347
  default: ''
331
- }
348
+ },
349
+ isCrm: {
350
+ type: Boolean,
351
+ default: false
352
+ },
353
+ filterApiConfig: {
354
+ type: Object,
355
+ default: () => {}
356
+ },
332
357
  },
333
358
  data() {
334
359
  return {
@@ -595,11 +620,12 @@ export default create({
595
620
  let end_val = '';
596
621
  let limit_date = [];
597
622
  let ageValue = {};
598
- if (item?.settingObj?.attr === 'PERCENTAGE') {
623
+ let curAttr = item?.settingObj?.attr;
624
+ if (curAttr === 'PERCENTAGE') {
599
625
  if (item.value) {
600
626
  item.value = Number(item.value) * 100;
601
627
  }
602
- } else if (item && item.settingObj && item.settingObj.attr == 'BIRTHDAY') {
628
+ } else if (curAttr == 'BIRTHDAY') {
603
629
  start_val = item.start_val ? item.start_val : '';
604
630
  end_val = item.end_val ? item.end_val : '';
605
631
  if (item.limit_date) {
@@ -628,7 +654,7 @@ export default create({
628
654
  }
629
655
  }
630
656
  }
631
- } else if (item && item.settingObj && item.settingObj.attr == 'AGE') {
657
+ } else if (curAttr == 'AGE') {
632
658
  this.$set(item, 'AGEAttr', true);
633
659
  start_val = item.start_val;
634
660
  end_val = item.end_val;
@@ -686,7 +712,12 @@ export default create({
686
712
  is_compare_field: item.is_compare_field || false,
687
713
  selectList: item.selectList || [],
688
714
  customInput: false, // 自定义输入
689
- compare_field: item.compare_field // 选择的值
715
+ compare_field: item.compare_field, // 选择的值
716
+ labelList: [],
717
+ _labelListMap: {},
718
+ _labelName: item.value, // 标签入参存labelName, 但是可能会重复, 所以下拉的时候用labelId
719
+ isRequestLabel: false,
720
+ showLabelSelect: false
690
721
  };
691
722
  });
692
723
  this.actionList.forEach(item => {
@@ -791,9 +822,9 @@ export default create({
791
822
  let start_val = '';
792
823
  let end_val = '';
793
824
  let limit_date = [];
794
- if (item.settingObj && item.settingObj.attr == 'PERCENTAGE') {
825
+ if (attrType == 'PERCENTAGE') {
795
826
  value = Number(value) / 100;
796
- } else if (item.settingObj && item.settingObj.attr == 'BIRTHDAY') {
827
+ } else if (attrType == 'BIRTHDAY') {
797
828
  if (item.start_val) {
798
829
  let res = utils.validateBirthday(item.start_val, item.title, item.unit);
799
830
  if (!res) return;
@@ -815,6 +846,8 @@ export default create({
815
846
  start_val = item.start_val;
816
847
  end_val = item.end_val;
817
848
  value = item.value;
849
+ } else if (attrType === 'LABEL' && this.isCrm && item._labelName) {
850
+ value = item._labelName;
818
851
  } else {
819
852
  start_val = item.start_val ? item.start_val.format('YYYY-MM-DD HH:mm:ss') : '';
820
853
  end_val = item.end_val ? item.end_val.format('YYYY-MM-DD HH:mm:ss') : '';
@@ -929,10 +962,16 @@ export default create({
929
962
  action.fieldType = f?.fieldType || undefined;
930
963
  this.$set(action, 'wordValue', []);
931
964
  this.$set(action, 'wordbookData', []);
965
+ this.$set(action, 'labelList', []);
966
+ this.$set(action, 'isRequestLabel', false);
932
967
  this.formatData(value, action);
933
968
  this.handleHideItem(action);
934
969
  this.handleHideCompareField(action);
935
970
  this.$set(action, 'isIllegalField', value && !this.searchListKey.includes(value));
971
+ let isCrmLabel = this.isCrm && action?.settingObj?.attr === "LABEL"
972
+ if(isCrmLabel) {
973
+ this.getLableData(action)
974
+ }
936
975
  },
937
976
  // 数据处理
938
977
  formatData(value, action) {
@@ -943,6 +982,7 @@ export default create({
943
982
  action.settingObj = sea.settingObj;
944
983
  let attrType = sea?.settingObj?.attr || '';
945
984
  let format = sea?.settingObj?.format || '';
985
+ let isCrmLabel = this.isCrm && attrType === "LABEL"
946
986
  action.title = sea.title || '';
947
987
  if (sea.setting) {
948
988
  utils.isPlainObject(sea.setting) ? '' : (sea.setting = JSON.parse(sea.setting));
@@ -1070,6 +1110,40 @@ export default create({
1070
1110
  return res;
1071
1111
  });
1072
1112
  },
1113
+ getLableData(item){
1114
+ // 请求过label就不再请求了
1115
+ let type = item.settingObj?.labelType
1116
+ if(!type || item.isRequestLabel) return;
1117
+ let requestedLabel = this.filterApiConfig?.requestedLabel
1118
+ if (!requestedLabel || typeof requestedLabel !== 'function') return;
1119
+ this.handleGetConfigApi(type, 'requestedLabel').then(list => {
1120
+ let _labelListMap = {}
1121
+ list.map(v => {
1122
+ _labelListMap[v.labelId] = v;
1123
+ })
1124
+ let mItem = list.find(v => v.labelName === item.value)
1125
+ mItem && (item.value = mItem.labelId);
1126
+ this.$set(item, 'labelList', list || []);
1127
+ this.$set(item, '_labelListMap', _labelListMap);
1128
+ this.$set(item, 'isRequestLabel', true);
1129
+ })
1130
+ },
1131
+ dropdownVisibleChangeLable(open, item){
1132
+ if(!open) return;
1133
+ this.getLableData(item)
1134
+ },
1135
+ handleSelectLable(val, item){
1136
+ let option = item._labelListMap?.[val] || {}
1137
+ let name = option?.labelName;
1138
+ this.$set(item, 'value', val);
1139
+ this.$set(item, '_labelName', name);
1140
+ },
1141
+ handleDeSelectLable(val, item){
1142
+ this.$set(item, 'value', '');
1143
+ this.$set(item, '_labelName', '');
1144
+ },
1145
+
1146
+
1073
1147
  handleWordbookData(item, data) {
1074
1148
  let { settingObj = {} } = item;
1075
1149
  let { showKeys = [], defaultValue, defaultValueTitle } = settingObj.wordbook || {};
@@ -1199,13 +1273,24 @@ export default create({
1199
1273
  item.showRangeAge = false; // 年龄范围
1200
1274
  item.showAgeCom = false; // 年龄范围
1201
1275
  let inRelation = ['QUOTE_IN', 'QUOTE_NOTIN'];
1276
+ // 标签 等于和不等于,自定义输入后面文本框,修改为下拉框进行选择
1277
+ let isCrmLabel = this.isCrm && attr === 'LABEL' &&['EQ', 'NEQ'].includes(value);
1202
1278
  if (arr.includes(value)) {
1203
1279
  item.showInput = false;
1204
1280
  item.showSelect = false;
1205
1281
  item.showDate = false;
1206
1282
  item.showSearch = false;
1207
1283
  item.showRelation = false;
1284
+ item.showLabelSelect = false;
1208
1285
  this.initBirthdayParams(item);
1286
+ } else if(isCrmLabel) {
1287
+ item.showSelect = false;
1288
+ item.showDate = false;
1289
+ item.showInput = false;
1290
+ item.showSearch = false;
1291
+ item.showRelation = false;
1292
+ item.showLabelSelect = true;
1293
+ item._labelName = "";
1209
1294
  } else if (['IN_THE_PAST', 'IN_THE_FUTURE', 'N_', 'L_', 'IN_THE_PAST_DI', 'IN_THE_FUTURE_DI'].includes(value)) {
1210
1295
  // 以前、以后、过去内、未来内
1211
1296
  // L_ N_ IN_THE_PAST IN_THE_FUTURE 添加小时
@@ -1216,6 +1301,7 @@ export default create({
1216
1301
  item.showDate = false;
1217
1302
  item.showSearch = false;
1218
1303
  item.showRelation = false;
1304
+ item.showLabelSelect = false;
1219
1305
  if (value == 'IN_THE_PAST_DI' || value == 'IN_THE_FUTURE_DI') {
1220
1306
  this.$set(item, 'dateList', this.dateList);
1221
1307
  } else {
@@ -1242,12 +1328,14 @@ export default create({
1242
1328
  item.showInput = false;
1243
1329
  item.showSearch = false;
1244
1330
  item.showRelation = false;
1331
+ item.showLabelSelect = false;
1245
1332
  } else if (value == 'CONVERT' || value == 'QUOTE' || value == 'QUOTE_NOT') {
1246
1333
  item.showDate = false;
1247
1334
  item.showSelect = false;
1248
1335
  item.showInput = false;
1249
1336
  item.showSearch = true;
1250
1337
  item.showRelation = false;
1338
+ item.showLabelSelect = false;
1251
1339
  this.initBirthdayParams(item);
1252
1340
  let showSetting = false;
1253
1341
  if (item.settingObj?.showSetting?.length) {
@@ -1264,8 +1352,10 @@ export default create({
1264
1352
  item.showSelect = false;
1265
1353
  item.showDate = false;
1266
1354
  item.showSearch = false;
1355
+ item.showLabelSelect = false;
1267
1356
  this.initBirthdayParams(item);
1268
1357
  } else if (attr == 'AGE') {
1358
+ item.showLabelSelect = false;
1269
1359
  if (ageList.includes(value)) {
1270
1360
  item.showAgeCom = true;
1271
1361
  }
@@ -1279,6 +1369,7 @@ export default create({
1279
1369
  }
1280
1370
  item.showSearch = false;
1281
1371
  item.showRelation = false;
1372
+ item.showLabelSelect = false;
1282
1373
  this.initBirthdayParams(item);
1283
1374
  }
1284
1375
 
@@ -1340,6 +1431,9 @@ export default create({
1340
1431
  item.showDate = false;
1341
1432
  item.showSearch = false;
1342
1433
  item.showRelation = false;
1434
+ item.showLabelSelect = false;
1435
+ item._labelName = '';
1436
+ item._labelListMap = {};
1343
1437
 
1344
1438
  // item.value = "";
1345
1439
  // this.$set(item, 'value', '');