cnhis-design-vue 0.1.81-beta → 0.1.85-beta

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 (103) hide show
  1. package/es/affix/index.js +8 -8
  2. package/es/age/index.js +10 -10
  3. package/es/alert/index.js +8 -8
  4. package/es/anchor/index.js +8 -8
  5. package/es/auto-complete/index.js +8 -8
  6. package/es/avatar/index.js +8 -8
  7. package/es/back-top/index.js +8 -8
  8. package/es/badge/index.js +8 -8
  9. package/es/base/index.js +8 -8
  10. package/es/big-table/index.js +107 -98
  11. package/es/big-table/style.css +1 -1
  12. package/es/breadcrumb/index.js +8 -8
  13. package/es/button/index.js +20 -20
  14. package/es/calendar/index.js +8 -8
  15. package/es/captcha/index.js +3 -3
  16. package/es/card/index.js +8 -8
  17. package/es/carousel/index.js +8 -8
  18. package/es/cascader/index.js +8 -8
  19. package/es/checkbox/index.js +9 -9
  20. package/es/col/index.js +8 -8
  21. package/es/collapse/index.js +8 -8
  22. package/es/color-picker/index.js +1 -1
  23. package/es/comment/index.js +8 -8
  24. package/es/config-provider/index.js +8 -8
  25. package/es/date-picker/index.js +8 -8
  26. package/es/descriptions/index.js +8 -8
  27. package/es/divider/index.js +8 -8
  28. package/es/drag-layout/index.js +3 -3
  29. package/es/drawer/index.js +8 -8
  30. package/es/dropdown/index.js +8 -8
  31. package/es/editor/index.js +1 -1
  32. package/es/empty/index.js +8 -8
  33. package/es/fabric-chart/index.js +9 -9
  34. package/es/form/index.js +8 -8
  35. package/es/form-model/index.js +8 -8
  36. package/es/index/index.js +589 -531
  37. package/es/index/style.css +1 -1
  38. package/es/input/index.js +9 -9
  39. package/es/input-number/index.js +8 -8
  40. package/es/layout/index.js +8 -8
  41. package/es/list/index.js +8 -8
  42. package/es/locale-provider/index.js +8 -8
  43. package/es/map/index.js +9 -9
  44. package/es/mentions/index.js +8 -8
  45. package/es/menu/index.js +8 -8
  46. package/es/message/index.js +8 -8
  47. package/es/multi-chat/index.js +144 -121
  48. package/es/multi-chat/style.css +1 -1
  49. package/es/multi-chat-client/index.js +137 -114
  50. package/es/multi-chat-client/style.css +1 -1
  51. package/es/multi-chat-history/index.js +4 -4
  52. package/es/multi-chat-record/index.js +14 -14
  53. package/es/multi-chat-setting/index.js +22 -22
  54. package/es/multi-chat-sip/index.js +1 -1
  55. package/es/notification/index.js +8 -8
  56. package/es/page-header/index.js +8 -8
  57. package/es/pagination/index.js +8 -8
  58. package/es/popconfirm/index.js +8 -8
  59. package/es/popover/index.js +8 -8
  60. package/es/progress/index.js +8 -8
  61. package/es/radio/index.js +9 -9
  62. package/es/rate/index.js +8 -8
  63. package/es/result/index.js +8 -8
  64. package/es/row/index.js +8 -8
  65. package/es/scale-view/index.js +100 -73
  66. package/es/scale-view/style.css +1 -1
  67. package/es/select/index.js +11 -11
  68. package/es/select-label/index.js +10 -10
  69. package/es/select-person/index.js +2 -2
  70. package/es/skeleton/index.js +8 -8
  71. package/es/slider/index.js +8 -8
  72. package/es/space/index.js +8 -8
  73. package/es/spin/index.js +8 -8
  74. package/es/statistic/index.js +8 -8
  75. package/es/steps/index.js +8 -8
  76. package/es/switch/index.js +8 -8
  77. package/es/table-filter/index.js +136 -137
  78. package/es/table-filter/style.css +1 -1
  79. package/es/tabs/index.js +8 -8
  80. package/es/tag/index.js +9 -9
  81. package/es/time-picker/index.js +8 -8
  82. package/es/timeline/index.js +8 -8
  83. package/es/tooltip/index.js +8 -8
  84. package/es/transfer/index.js +8 -8
  85. package/es/tree/index.js +8 -8
  86. package/es/tree-select/index.js +8 -8
  87. package/es/upload/index.js +8 -8
  88. package/es/utils/vexutils.js +93 -0
  89. package/es/verification-code/index.js +2 -2
  90. package/lib/cui.common.js +1745 -1097
  91. package/lib/cui.umd.js +1745 -1097
  92. package/lib/cui.umd.min.js +94 -94
  93. package/package.json +2 -2
  94. package/packages/big-table/src/BigTable.vue +19 -9
  95. package/packages/multi-chat/chat/chatFooter.vue +18 -5
  96. package/packages/multi-chat/chat/scrollList.vue +1 -1
  97. package/packages/scale-view/formitem/r-choice.vue +8 -1
  98. package/packages/scale-view/scaleView.vue +19 -5
  99. package/packages/table-filter/src/base-search-com/BaseSearch.vue +1 -1
  100. package/packages/table-filter/src/components/multi-select/multi-select.vue +2 -2
  101. package/packages/table-filter/src/mixins/wordBookutils.js +2 -1
  102. package/packages/table-filter/src/quick-search/QuickSearch.vue +9 -9
  103. package/src/utils/vexutils.js +70 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "0.1.81-beta",
3
+ "version": "0.1.85-beta",
4
4
  "description": "基于 Ant Desgin Vue 的UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -93,4 +93,4 @@
93
93
  "commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
94
94
  }
95
95
  }
96
- }
96
+ }
@@ -285,6 +285,9 @@ export default create({
285
285
  }
286
286
  return this.primaryKey || 'theUniqueKey';
287
287
  },
288
+ handlePrimaryKey() {
289
+ return this.isTree > 0 ? this.primaryKey || "theUniqueKey" : "theUniqueKey";
290
+ },
288
291
  handleName() {
289
292
  return function(item, key = 'name') {
290
293
  return item.alias || item[key];
@@ -1465,6 +1468,8 @@ export default create({
1465
1468
  };
1466
1469
  },
1467
1470
  setFilterStatus() {
1471
+ // 表头没有过滤字段 不需要设置
1472
+ if(!this.filterFields || !Object.keys(this.filterFields).length) return;
1468
1473
  let val = this.quickSearchConfig;
1469
1474
 
1470
1475
  if (!val || !val.length) {
@@ -1477,17 +1482,22 @@ export default create({
1477
1482
  // 修复 val长度和this.filterFields个数对不上 会少清空选中项
1478
1483
  for (let key in this.filterFields) {
1479
1484
  let item = this.filterFields[key];
1480
- this.$set(item, 'CONVERT', []);
1485
+ item && this.$set(item, 'CONVERT', []);
1481
1486
  }
1482
1487
 
1483
1488
  val.forEach(item => {
1484
- if (!this.filterFields[item.field_key]) {
1485
- this.$set(this.filterFields[item.field_key], 'CONVERT', []);
1486
- return false;
1487
- }
1489
+ let itemKey = item.field_key;
1490
+ // 参与搜索的字段必须在 filterFields中
1491
+ if (itemKey in this.filterFields) {
1488
1492
 
1489
- let value = item.value.map(item => JSON.stringify(item));
1490
- this.$set(this.filterFields[item.field_key], 'CONVERT', value);
1493
+ if (!this.filterFields[item.field_key]) {
1494
+ this.$set(this.filterFields[item.field_key], 'CONVERT', []);
1495
+ return false;
1496
+ }
1497
+
1498
+ let value = item.value.map(item => JSON.stringify(item));
1499
+ this.$set(this.filterFields[item.field_key], 'CONVERT', value);
1500
+ }
1491
1501
  });
1492
1502
  },
1493
1503
  handlerInitSearchItem(arr) {
@@ -2619,7 +2629,7 @@ export default create({
2619
2629
  this.$refs.xGrid.setCurrentRow(row);
2620
2630
  this.$emit('setNestTableClick', this.isNestTable);
2621
2631
  this.$emit('setCurRowIndex', index);
2622
- this.$emit('linkDetail', row, col, row[this.handleRowId], null, false, index);
2632
+ this.$emit('linkDetail', row, col, row[this.handlePrimaryKey], null, false, index);
2623
2633
  },
2624
2634
  // 按钮事件
2625
2635
  clickBtn(row, btn, index, e, j) {
@@ -2628,7 +2638,7 @@ export default create({
2628
2638
  this.recordClickBtnInfo(row, index);
2629
2639
  this.$emit('setNestTableClick', this.isNestTable);
2630
2640
  this.$emit('setCurRowIndex', index);
2631
- this.$emit('clickBtn', row, btn, row[this.handleRowId], index);
2641
+ this.$emit('clickBtn', row, btn, row[this.handlePrimaryKey], index);
2632
2642
  // this.handleTopBtnTracher(btn, j);
2633
2643
  },
2634
2644
  recordClickBtnInfo(row, index) {
@@ -167,6 +167,7 @@ import QuickReply from './quickReply';
167
167
  import voice from './voice';
168
168
  import ModalUserTransfer from '../components/modal-user-transfer';
169
169
  import ModalRefuseReason from '../components/modal-refuse-reason';
170
+ import vexutils from '@/utils/vexutils';
170
171
  export default {
171
172
  inject: ['store', 'i18nText', 'dispatchEvent', 'registerEvent', 'unregisterEvent'],
172
173
  components: {
@@ -226,7 +227,9 @@ export default {
226
227
  curToolbarItem: {},
227
228
  showVoice: false,
228
229
  transferVisible: false,
229
- refuseVisible: false
230
+ refuseVisible: false,
231
+
232
+ apiResult: {}, // 前置条件的返回值
230
233
  };
231
234
  },
232
235
  computed: {
@@ -307,9 +310,9 @@ export default {
307
310
  },
308
311
  // 拦截url
309
312
  accessInterceptUrl() {
310
- const { accessInterceptObj: obj } = this;
313
+ const { accessInterceptObj: obj, apiResult } = this;
311
314
  if (obj) {
312
- return this.getLinkAddress(obj);
315
+ return this.getLinkAddress(obj,{result:apiResult});
313
316
  }
314
317
  return '';
315
318
  },
@@ -830,18 +833,25 @@ export default {
830
833
  this.modalShow = false;
831
834
  window.removeEventListener('message', this.iframeEvent);
832
835
  },
833
- getLinkAddress(item) {
836
+ getLinkAddress(item,paramsData= {}) {
837
+ let t = {talbe:{},form:{},sys:{}};
838
+ Object.assign(t,paramsData ||{})
834
839
  let { address = '', params = [] } = item;
835
840
  let urlParams = [];
836
841
  params.forEach(({ p_name, p_value }) => {
837
842
  let value;
838
843
  if (p_value.startsWith('form.')) {
839
844
  value = this.clientParams[p_value.slice(5)];
845
+ } else if( /\${result.(.*?)\}/g.test(p_value)) {
846
+ value = vexutils.handleSysParams(p_value,t)
840
847
  } else {
841
848
  value = p_value;
842
849
  }
843
850
  urlParams.push(`${p_name}=${value}`);
844
851
  });
852
+ if(/\${result.(.*?)\}/g.test(address)){
853
+ address = vexutils.handleSysParams(address,t)
854
+ }
845
855
  let { actionType } = this.curToolbarItem;
846
856
  actionType && urlParams.push(`actionType=${actionType}`);
847
857
  if (address.includes('?')) {
@@ -1033,6 +1043,7 @@ export default {
1033
1043
  },
1034
1044
  /* 客服点击接入按钮进入会话 */
1035
1045
  async handleAccess() {
1046
+ this.apiResult = {};
1036
1047
  let accessInterceptValidate = this.handleAccessInterceptValue();
1037
1048
  let data = null; // 接口参数
1038
1049
  if (accessInterceptValidate && this.accessInterceptUrl) {
@@ -1087,12 +1098,14 @@ export default {
1087
1098
  data
1088
1099
  };
1089
1100
  }
1101
+ this.apiResult = {};
1090
1102
  const accessInterceptSetting = this.assemblySetting.accessInterceptSetting || [];
1091
1103
  const setting = accessInterceptSetting.find(item => item.source == 'PC' && item.isChecked == 'Y' && item.precondition);
1092
1104
  if (setting) {
1093
1105
  const precondition = setting.precondition;
1094
1106
  try {
1095
- const res = await this.requestPreCondition(precondition);
1107
+ let res = await this.requestPreCondition(precondition);
1108
+ this.apiResult = res?.data?.map || {};
1096
1109
  if (res.data.result === 'SUCCESS') {
1097
1110
  let value = res.data.map?.result;
1098
1111
  value = value ? JSON.parse(value) : {};
@@ -380,7 +380,7 @@ export default {
380
380
  const dateParams = this.dateParams;
381
381
  if (dateParams?.length) {
382
382
  const fmt = 'YYYY-MM-DD';
383
- params.beginDate = dateParams[0].format(fmt) + ' 00:00:00';
383
+ params.startDate = dateParams[0].format(fmt) + ' 00:00:00';
384
384
  params.endDate = dateParams[1].format(fmt) + ' 23:59:59';
385
385
  }
386
386
  return params;
@@ -79,7 +79,7 @@
79
79
  :disabled="isLock"
80
80
  @search="handleSearch"
81
81
  @change="handleSelectChange"
82
- :getPopupContainer="triggerNode => triggerNode.parentNode"
82
+ :getPopupContainer="getPopupContainer"
83
83
  :filterOption="filterOption"
84
84
  :notFoundContent="fetching ? undefined : '暂无数据'"
85
85
  >
@@ -131,6 +131,7 @@ export default {
131
131
  type: Function,
132
132
  default: () => Promise.resolve([])
133
133
  },
134
+ openType: { type: String, default: "" }
134
135
  },
135
136
  components: {
136
137
  // TextOverTooltip,
@@ -428,6 +429,12 @@ export default {
428
429
  },
429
430
  filterOption(input, option) {
430
431
  return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
432
+ },
433
+ getPopupContainer(triggerNode) {
434
+ if(this.openType == 'formIframe') {
435
+ return document.body;
436
+ }
437
+ return triggerNode.parentNode;
431
438
  }
432
439
  }
433
440
  };
@@ -153,6 +153,7 @@
153
153
  :item="item"
154
154
  :isLock="componentDisable"
155
155
  :curIndex="index"
156
+ :openType="openType"
156
157
  @change="handleChoice($event, item)"
157
158
  @radioChange="radioChange"
158
159
  @checkboxChange="checkboxChange"
@@ -313,7 +314,8 @@ export default create({
313
314
  small: 1,
314
315
  extrasmall: 0.9
315
316
  })
316
- }
317
+ },
318
+ openType: { type: String, default: "" }
317
319
  },
318
320
  components: {
319
321
  MyChoice,
@@ -1294,19 +1296,31 @@ export default create({
1294
1296
  this.confirmSubmit("确认要提交吗?");
1295
1297
  return;
1296
1298
  }
1299
+
1297
1300
  // 包含测评组件,不包含考试时长,点击提交,弹出二次确认对话框,确认要结束测评吗?
1298
1301
  // 判断有无测评配置 并且在测评时间内
1299
- // 无倒计时
1300
1302
  let { evaluateResultSetting } = this.config;
1301
- let countdownDom = this.$refs.evaluateCountdown;
1302
1303
  if (
1303
1304
  !evaluateResultSetting ||
1304
- (!Object.keys(evaluateResultSetting).length && !this.showEvaluateEntry) ||
1305
- !countdownDom?.showEvaluateCountdown
1305
+ (!Object.keys(evaluateResultSetting).length && !this.showEvaluateEntry)
1306
1306
  ) {
1307
1307
  this.confirmSubmit("确认要结束测评吗?");
1308
1308
  return;
1309
1309
  }
1310
+
1311
+ // 表单内嵌量表, 没有开始答题, 不需要调用保存接口
1312
+ if (this.openType == "formIframe" && this.showEvaluateEntry) {
1313
+ this.$emit("submitNoRequest");
1314
+ return;
1315
+ }
1316
+
1317
+ // 无倒计时
1318
+ let countdownDom = this.$refs.evaluateCountdown;
1319
+ if(!countdownDom?.showEvaluateCountdown) {
1320
+ this.confirmSubmit("确认要结束测评吗?");
1321
+ return;
1322
+ }
1323
+
1310
1324
  // 在倒计时内
1311
1325
  let message = "确认要提前结束测评吗?";
1312
1326
  let setAnswered = this.$refs.evaluateCountdown?.setAnswered;
@@ -1773,7 +1773,7 @@ export default create({
1773
1773
  try {
1774
1774
  const print = { formatId, number };
1775
1775
  // 执行打印后置条件
1776
- const result = await this.postStepRule(printBtn.settingObj, {
1776
+ const result = await this.printConfig.postStepRule(printBtn.settingObj, {
1777
1777
  result: res,
1778
1778
  print: print
1779
1779
  });
@@ -24,7 +24,7 @@
24
24
  v-for="(sea, k) in item.dataSource"
25
25
  :key="item.sid + sea.myName"
26
26
  :value="sea.myName"
27
- :title="sea.showKeys || sea.myName"
27
+ :title="sea._show_title || sea.showKeys || sea.myName"
28
28
  :disabled="k === 0 && hasShowKeys && item.hasFieldList"
29
29
  >
30
30
  <div
@@ -37,7 +37,7 @@
37
37
  <span style="flex: 1;" v-for="(v1, k1) in sea.showKeys.split('<&=&>')" :key="k1" class="c-s-content-item">{{ v1 }}</span>
38
38
  </div>
39
39
  <span v-else>
40
- {{ sea.showKeys || sea.myName }}
40
+ {{sea._show_title || sea.showKeys || sea.myName }}
41
41
  </span>
42
42
  </a-select-option>
43
43
  </template>
@@ -40,7 +40,8 @@ const formatWordbookDataUtils = {
40
40
  let name = vexutils.stringToValue(row[item.setting.wordbook.field_key],'value')
41
41
  return Object.assign(row, {
42
42
  myName: name,
43
- showKeys: showKeysStr.join(SYMBOL)
43
+ showKeys: showKeysStr.join(SYMBOL),
44
+ _show_title: showKeysStr.join(" ")
44
45
  });
45
46
  });
46
47
  // 数组对象去重
@@ -975,7 +975,7 @@ export default create({
975
975
  if (el.setting) {
976
976
  // el.seting 可能是 string / object
977
977
  el.setting = typeof el.setting == "string" ? JSON.parse(el.setting) : el.setting;
978
- if (!this.$utils.isEmpty(el.setting.wordbook)) {
978
+ if (!vexutils.isEmpty(el.setting.wordbook)) {
979
979
  this.$set(el, "con", "QUOTE");
980
980
  this.$set(el, "dataSource", []);
981
981
  this.$set(el, "QUOTE", []);
@@ -1261,12 +1261,12 @@ export default create({
1261
1261
  if (item.EVALUATEAttr) {
1262
1262
  value = item.selecteds.join("|#|");
1263
1263
  }
1264
- } else if (item.con == "QUOTE" && !this.$utils.isEmpty(item.value)) {
1264
+ } else if (item.con == "QUOTE" && !vexutils.isEmpty(item.value)) {
1265
1265
  // value = item.QUOTE.join("|#|");
1266
1266
  value = item.value.join("|#|");
1267
- } else if (!this.$utils.isEmpty(item.CONVERT)) {
1267
+ } else if (!vexutils.isEmpty(item.CONVERT)) {
1268
1268
  value = item.CONVERT.map(item => {
1269
- if (item && this.$utils.isJSON(item)) {
1269
+ if (item && vexutils.isJSON(item)) {
1270
1270
  return JSON.parse(item);
1271
1271
  }
1272
1272
  return item;
@@ -1301,7 +1301,7 @@ export default create({
1301
1301
 
1302
1302
  // 校验
1303
1303
  if (item.BIRTHDAY.start_val) {
1304
- let res = this.$utils.validateBirthday(
1304
+ let res = vexutils.validateBirthday(
1305
1305
  item.BIRTHDAY.start_val,
1306
1306
  item.title,
1307
1307
  item.BIRTHDAY.unit
@@ -1309,7 +1309,7 @@ export default create({
1309
1309
  if (!res) return;
1310
1310
  }
1311
1311
  if (item.BIRTHDAY.end_val) {
1312
- let res = this.$utils.validateBirthday(
1312
+ let res = vexutils.validateBirthday(
1313
1313
  item.BIRTHDAY.end_val,
1314
1314
  item.title,
1315
1315
  item.BIRTHDAY.unit
@@ -1349,7 +1349,7 @@ export default create({
1349
1349
  }
1350
1350
  }
1351
1351
  // 删除字符串前后空格
1352
- if (value && this.$utils.isString(value)) {
1352
+ if (value && vexutils.isString(value)) {
1353
1353
  value = value.trim();
1354
1354
  }
1355
1355
  let temp = {
@@ -1519,10 +1519,10 @@ export default create({
1519
1519
  if (item.EQ || item.CL) {
1520
1520
  item.EQ = "";
1521
1521
  item.CL = "";
1522
- } else if (item.con == "QUOTE" && !this.$utils.isEmpty(item.value)) {
1522
+ } else if (item.con == "QUOTE" && !vexutils.isEmpty(item.value)) {
1523
1523
  item.QUOTE = [];
1524
1524
  item.value = [];
1525
- } else if (!this.$utils.isEmpty(item.CONVERT)) {
1525
+ } else if (!vexutils.isEmpty(item.CONVERT)) {
1526
1526
  item.CONVERT = [];
1527
1527
  } else if (item.DATE) {
1528
1528
  item.showDate = false;
@@ -698,6 +698,76 @@ XEUtils.mixin({
698
698
  }
699
699
  return item;
700
700
  },
701
+
702
+ notEmpty(text) {
703
+ return XEUtils.isBoolean(text) || String(text) === "0" || !!text;
704
+ },
705
+
706
+ /**
707
+ * 变量转换
708
+ * @param {string} str
709
+ * @param {object} obj
710
+ * @param {string | number} noval // 没有值,默认赋值
711
+ */
712
+ handleSysParams(str, obj = {}, noval = "") {
713
+ let p = {
714
+ ...obj
715
+ };
716
+ const that = this;
717
+ // 解析变量
718
+ const getValList = (plsList = [], obj = {}) => {
719
+ var l = [];
720
+ var o = obj;
721
+ plsList.forEach(v => {
722
+ let c = v;
723
+ // xx.xx
724
+ if (v.includes(".")) {
725
+ try {
726
+ // 使用 eval 解析 'result.map.map.filed'
727
+ eval(`c=o.${v}`);
728
+ } catch (error) {
729
+ c = "";
730
+ }
731
+ }
732
+ if (XEUtils.notEmpty(c)) {
733
+ l.push(c);
734
+ }
735
+ });
736
+ return l;
737
+ };
738
+ const getVal = (t, r, k) => {
739
+ return t.replace(r, function() {
740
+ var pKey = arguments[1];
741
+ // 切割
742
+ var pls = pKey.split("!");
743
+ // 取值
744
+ var l = getValList(pls, p);
745
+ var f = l.find(v => XEUtils.notEmpty(v));
746
+ var res = f;
747
+ res = XEUtils.notEmpty(res) ? res : noval;
748
+ return res;
749
+ });
750
+ };
751
+ if (typeof str === "string") {
752
+ if (str.includes("form")) {
753
+ str = getVal(str, /\${(.*?)\}/g, "form");
754
+ }
755
+ if (str.includes("sys")) {
756
+ str = getVal(str, /\${(.*?)\}/g, "sys");
757
+ }
758
+ if (str.includes("db")) {
759
+ str = getVal(str, /\${(.*?)\}/g, "db");
760
+ }
761
+ if (str.includes("table")) {
762
+ str = getVal(str, /\${(.*?)\}/g, "table");
763
+ }
764
+ if (str.includes("result")) {
765
+ str = getVal(str, /\${(.*?)\}/g, "result");
766
+ }
767
+ }
768
+ return str;
769
+ },
770
+
701
771
  });
702
772
 
703
773
  export default XEUtils;