cnhis-design-vue 0.2.28-beta → 0.2.32-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 (105) 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 +89 -88
  11. package/es/big-table/style.css +1 -1
  12. package/es/breadcrumb/index.js +8 -8
  13. package/es/button/index.js +28 -28
  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 +50 -45
  29. package/es/drag-layout/style.css +1 -1
  30. package/es/drawer/index.js +8 -8
  31. package/es/dropdown/index.js +8 -8
  32. package/es/editor/index.js +297 -25
  33. package/es/editor/style.css +1 -1
  34. package/es/empty/index.js +8 -8
  35. package/es/fabric-chart/index.js +9 -9
  36. package/es/form/index.js +8 -8
  37. package/es/form-model/index.js +8 -8
  38. package/es/index/index.js +672 -525
  39. package/es/index/style.css +1 -1
  40. package/es/input/index.js +9 -9
  41. package/es/input-number/index.js +8 -8
  42. package/es/layout/index.js +8 -8
  43. package/es/list/index.js +8 -8
  44. package/es/locale-provider/index.js +8 -8
  45. package/es/map/index.js +9 -9
  46. package/es/mentions/index.js +8 -8
  47. package/es/menu/index.js +8 -8
  48. package/es/message/index.js +8 -8
  49. package/es/multi-chat/index.js +130 -104
  50. package/es/multi-chat-client/index.js +124 -98
  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 +77 -51
  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 +114 -95
  66. package/es/scale-view/style.css +1 -1
  67. package/es/select/index.js +11 -11
  68. package/es/select-label/index.js +66 -56
  69. package/es/select-label/style.css +1 -1
  70. package/es/select-person/index.js +2 -2
  71. package/es/skeleton/index.js +8 -8
  72. package/es/slider/index.js +8 -8
  73. package/es/space/index.js +8 -8
  74. package/es/spin/index.js +8 -8
  75. package/es/statistic/index.js +8 -8
  76. package/es/steps/index.js +8 -8
  77. package/es/switch/index.js +8 -8
  78. package/es/table-filter/index.js +74 -60
  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/utils-map.js +16 -4
  89. package/es/utils/vexutils.js +15 -1
  90. package/es/verification-code/index.js +2 -2
  91. package/lib/cui.common.js +778 -611
  92. package/lib/cui.umd.js +778 -611
  93. package/lib/cui.umd.min.js +69 -69
  94. package/package.json +2 -2
  95. package/packages/big-table/src/BigTable.vue +1 -0
  96. package/packages/drag-layout/drag-layout.vue +4 -0
  97. package/packages/editor/src/Editor.vue +76 -9
  98. package/packages/multi-chat/store/actions.js +22 -4
  99. package/packages/scale-view/scaleView.vue +13 -6
  100. package/packages/select-label/labelFormContent.vue +23 -14
  101. package/packages/select-label/select-label.vue +1 -1
  102. package/packages/table-filter/src/components/multi-select/multi-select.vue +1 -1
  103. package/packages/table-filter/src/mixins/mixins.js +13 -1
  104. package/src/utils/utils-map.js +15 -3
  105. package/src/utils/vexutils.js +13 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cnhis-design-vue",
3
- "version": "0.2.28-beta",
3
+ "version": "0.2.32-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
+ }
@@ -396,6 +396,7 @@ export default create({
396
396
  if (this.isNestTable) return;
397
397
  if (Object.keys(this.columnConfig).length > 0) {
398
398
  this.loadColumn(this.columnConfig);
399
+ this.loadData(this.data);
399
400
  this.setTalbeScrollTo();
400
401
  }
401
402
  },
@@ -422,6 +422,9 @@ export default create({
422
422
  created() {},
423
423
  mounted() {
424
424
  this.mountedInit();
425
+ this.$nextTick().then(() => {
426
+ this.$el.querySelector('.text-area').style.height = this.$el.clientHeight + 'px';
427
+ });
425
428
  },
426
429
  methods: {
427
430
  mountedInit() {
@@ -722,6 +725,7 @@ export default create({
722
725
  align-items: flex-start;
723
726
  padding: 0 12px 12px;
724
727
  box-sizing: border-box;
728
+ align-content: flex-start;
725
729
  li {
726
730
  width: 49%;
727
731
  text-align: center;
@@ -18,6 +18,17 @@ export default create({
18
18
  config: {
19
19
  type: Object,
20
20
  default: () => {}
21
+ },
22
+ isDisabled: {
23
+ type: Boolean,
24
+ default: false
25
+ },
26
+ value: {
27
+ type: String
28
+ },
29
+ uploadImgUrl: {
30
+ type: String,
31
+ default: '/hospitalUpload/picture'
21
32
  }
22
33
  },
23
34
  components: {},
@@ -26,7 +37,8 @@ export default create({
26
37
  data() {
27
38
  return {
28
39
  editor: null,
29
- editorWrapId:'editorWrapId'
40
+ editorWrapId: 'editorWrapId',
41
+ newHtml: ''
30
42
  };
31
43
  },
32
44
  mounted() {
@@ -48,11 +60,70 @@ export default create({
48
60
  return str;
49
61
  });
50
62
  };
51
-
63
+
52
64
  this.editor.config.colors = this.editor.config.colors.concat(colors);
53
- this.editor.config = Object.assign({}, this.editor.config, this.config);
65
+ this.editor.config = Object.assign(
66
+ {},
67
+ this.editor.config,
68
+ {
69
+ customUploadImg: this.customUploadImg,
70
+ onchange: this.onchange
71
+ },
72
+ this.config
73
+ );
54
74
  this.editor.create();
55
- this.$emit('ready')
75
+ this.$emit('ready');
76
+ this.setWatch();
77
+ },
78
+ setWatch() {
79
+ this.setContent(this.value || '');
80
+
81
+ this.disable(this.isDisabled);
82
+
83
+ this.$watch('isDisabled', val => {
84
+ this.disable(val);
85
+ });
86
+ this.$watch('value', val => {
87
+ if (this.newHtml != val) {
88
+ this.setContent(val);
89
+ }
90
+ });
91
+ },
92
+ /**
93
+ * 自定义图片上传
94
+ */
95
+ customUploadImg(resultFiles, insertImgFn) {
96
+ // resultFiles 是 input 中选中的文件列表
97
+ // insertImgFn 是获取图片 url 后,插入到编辑器的方法
98
+ // 上传图片,返回结果,将图片插入到编辑器中
99
+ let [file] = resultFiles || [];
100
+ let params = new FormData();
101
+ params.append('file', file);
102
+ console.log(this.axios, '-----------');
103
+ this.axios
104
+ .post(this.uploadImgUrl, params)
105
+ .then(({ data }) => {
106
+ if (data.result === 'SUCCESS') {
107
+ console.log(data);
108
+ let url = data?.map?.url;
109
+ url && insertImgFn(url);
110
+ } else {
111
+ this.$message.error(data.resultMsg || '上传失败!');
112
+ }
113
+ })
114
+ .catch(err => {
115
+ this.$message.error(err.resultMsg || '上传失败!');
116
+ });
117
+ },
118
+ /**
119
+ * 内容发生改变
120
+ */
121
+ onchange(newHtml) {
122
+ console.log('change 之后最新的 html', newHtml);
123
+ let res = newHtml;
124
+ this.newHtml = newHtml;
125
+ this.$emit('change', res);
126
+ this.$emit('input', res);
56
127
  },
57
128
  setContent(content) {
58
129
  this.editor.txt.html(content);
@@ -92,11 +163,7 @@ export default create({
92
163
  },
93
164
 
94
165
  randomId(len) {
95
- return (
96
- 'id'+ Math.random()
97
- .toString(36)
98
- .substr(3, len) + new Date().getTime()
99
- );
166
+ return 'id' + Math.random().toString(36).substr(3, len) + new Date().getTime();
100
167
  }
101
168
  },
102
169
  beforeDestroy() {
@@ -412,9 +412,10 @@ export default {
412
412
  commit("setOuting", cloneOuting);
413
413
  }
414
414
  };
415
- commit("setUniRTC", uniRTC);
416
- setTimeout(async () => {
417
- console.log('本机设备token->', uniRTC.deviceToken);
415
+
416
+ let timer = null;
417
+ let n = 0;
418
+ const registerDeviceToken = async () => {
418
419
  const res = await fetch.post('/chat/service/registerDeviceToken', qs.stringify({
419
420
  ...params,
420
421
  deviceToken: uniRTC.deviceToken,
@@ -422,6 +423,23 @@ export default {
422
423
  if (res.data?.result !== 'SUCCESS') {
423
424
  console.log(res.data.resultMsg);
424
425
  }
425
- }, 1500);
426
+ };
427
+
428
+ timer && clearInterval(timer);
429
+ timer = setInterval(() => {
430
+ console.log('轮询本机设备token->', uniRTC.deviceToken);
431
+ n++;
432
+ if (!uniRTC.deviceToken) {
433
+ if (n > 60) {
434
+ timer && clearInterval(timer);
435
+ return;
436
+ }
437
+ uniRTC.reconnect();
438
+ } else {
439
+ timer && clearInterval(timer);
440
+ registerDeviceToken();
441
+ }
442
+ }, 1000);
443
+ commit("setUniRTC", uniRTC);
426
444
  }
427
445
  };
@@ -1,9 +1,9 @@
1
1
  <template>
2
2
  <div class="r-scale">
3
3
  <slot v-if="spinning">
4
- <a-spin :indicator="indicator" />
4
+ <a-spin :indicator="indicator" tip="加载中..." />
5
5
  </slot>
6
- <slot v-else>
6
+ <slot v-if="!spinning && !hasFrontAddress">
7
7
  <div v-if="noData">暂无数据</div>
8
8
  <!-- <NoData v-if="noData" :noDataImg="noDataImg" :noDataTip="noDataTip"></NoData> -->
9
9
  <template v-else>
@@ -598,7 +598,8 @@ export default create({
598
598
  isFinished: false,
599
599
  maxScore: 0,
600
600
  originConfig: {},
601
- paramsEvaluate: null
601
+ paramsEvaluate: null,
602
+ hasFrontAddress: true
602
603
  };
603
604
  },
604
605
  mounted() {
@@ -618,6 +619,7 @@ export default create({
618
619
  this.initForm(configData);
619
620
  } catch (error) {
620
621
  this.spinning = false;
622
+ this.hasFrontAddress = false;
621
623
  this.setNoData(true, error?.resultMsg, error?.result);
622
624
  }
623
625
  },
@@ -627,7 +629,11 @@ export default create({
627
629
  },
628
630
  initForm(data) {
629
631
  let { list = [], map = {}, isFinished = false } = data;
630
- this.handleFrontAddress(list);
632
+ let curUrl = this.handleFrontAddress(list);
633
+ if (curUrl) {
634
+ window.location.href = curUrl;
635
+ return;
636
+ }
631
637
  map.maxScore && (this.maxScore = map.maxScore);
632
638
  this.isFinished = isFinished;
633
639
  if (data.isLackCustomer) {
@@ -670,13 +676,14 @@ export default create({
670
676
  this.rules = this.formatRules(this.formArray);
671
677
  this.fontSize = data.fontSize;
672
678
  this.spinning = false;
679
+ this.hasFrontAddress = false;
673
680
  },
674
681
  handleFrontAddress(list) {
675
682
  if (!list || !list.length) return;
676
683
  let matchItem = list.find(item => item.type === "FRONT_ADDRESS");
677
684
  if (!matchItem || !Object.keys(matchItem).length) return;
678
685
  let setting;
679
- if (matchItem.setting && this.$utils.isJSON(matchItem.setting)) {
686
+ if (matchItem.setting && utils.isJSON(matchItem.setting)) {
680
687
  setting = JSON.parse(matchItem.setting);
681
688
  }
682
689
  if (!setting || !Object.keys(setting).length) return;
@@ -691,7 +698,7 @@ export default create({
691
698
  preStr = "&";
692
699
  }
693
700
  let curUrl = `${frontAddress}${preStr}redirect_url=${encodeURIComponent(urlHref)}`;
694
- window.location.href = curUrl;
701
+ return curUrl;
695
702
  }
696
703
  },
697
704
  handleBtnParamsEvaluate(params) {
@@ -200,7 +200,8 @@ export default create({
200
200
  },
201
201
  SelectedList() {
202
202
  const { labelSelectedList = [], labelSelectedEdit = [] } = this;
203
- return labelSelectedList.concat(labelSelectedEdit);
203
+ let list = [].concat(labelSelectedEdit, labelSelectedList);
204
+ return this.uniqArrObj(list,'labelId')
204
205
  },
205
206
  selectLabelId() {
206
207
  const list = this?.SelectedList || [];
@@ -239,6 +240,14 @@ export default create({
239
240
  .substr(3, len);
240
241
  },
241
242
 
243
+ uniqArrObj(arr, name) {
244
+ let obj = {};
245
+ return arr.reduce((cur, next) => {
246
+ obj[next[name]] ? '' : (obj[next[name]] = true && cur.push(next));
247
+ return cur;
248
+ }, []);
249
+ },
250
+
242
251
  handleLabelInit() {
243
252
  if (this.isLock) return;
244
253
  this.cacheLabelConfig = { ...this.labelConfig };
@@ -248,8 +257,9 @@ export default create({
248
257
  // let olbKey = this?.cacheLabelConfig[key]?.curKey
249
258
  let typeId = copy[key]?.typeId || '';
250
259
  Object.assign(copy[key], {
251
- curKey: `${key}_${typeId}~${this.randomId()}`
260
+ curKey: `${key}_${typeId}}`
252
261
  });
262
+ // ~${this.randomId()
253
263
  }
254
264
  this.$set(this, 'labelConfig', copy);
255
265
  this.$nextTick(() => {
@@ -264,7 +274,7 @@ export default create({
264
274
  },
265
275
 
266
276
  hanldeBackfill() {
267
- const { labelConfig, SelectedList = [], selectLabelId} = this;
277
+ const { labelConfig, SelectedList = [], selectLabelId } = this;
268
278
  this.$set(this, 'labelSelectedEdit', SelectedList);
269
279
  if (typeof labelConfig === 'object') {
270
280
  let keys = Object.keys(labelConfig || {});
@@ -487,7 +497,7 @@ export default create({
487
497
  if (v.itemList?.length) {
488
498
  parentColor = v.itemList[0].parentColor || v.parentColor || '';
489
499
  } else {
490
- parentColor = v?.parentColor || "";
500
+ parentColor = v?.parentColor || '';
491
501
  }
492
502
 
493
503
  const params = {
@@ -740,26 +750,25 @@ export default create({
740
750
  > .ant-tabs-bar {
741
751
  border-color: #fff;
742
752
  .ant-tabs-tab {
743
- margin-right:0;
744
- border-radius:0;
753
+ margin-right: 0;
754
+ border-radius: 0;
745
755
  line-height: 30px;
746
756
  height: 30px;
747
757
 
748
- border-right: 1px solid #e8e8e8!important;
758
+ border-right: 1px solid #e8e8e8 !important;
749
759
  border-bottom: 1px solid #e8e8e8;
750
760
  border-top: none;
751
761
 
752
762
  // border-color: transparent;
753
- background: #F9F9F9;
754
- &:first-of-type{
755
- border-left: 1px solid #e8e8e8;
763
+ background: #f9f9f9;
764
+ &:first-of-type {
765
+ border-left: 1px solid #e8e8e8;
756
766
  }
757
767
  &.ant-tabs-tab-active {
758
- border-bottom-color: #fff;
759
- background: #fff;
760
- }
768
+ border-bottom-color: #fff;
769
+ background: #fff;
770
+ }
761
771
  }
762
-
763
772
  }
764
773
 
765
774
  .ant-tabs-bar;
@@ -308,7 +308,7 @@ export default create({
308
308
  },
309
309
 
310
310
  async handleGetLabelData(v, update) {
311
- const { rows, results } = await this.getLabelList(v);
311
+ const { rows, results } = await this.getLabelList(v, {update: update});
312
312
  // console.log(rows, results)
313
313
  const labelList = rows || [];
314
314
  const labelObj = {};
@@ -102,7 +102,7 @@ export default {
102
102
  // 有没有分页配置
103
103
  isnoPages(){
104
104
  const { searchPageConfig } = this.item || {};
105
- if(!searchPageConfig) return;
105
+ if(!searchPageConfig) return true;
106
106
 
107
107
  return searchPageConfig.page <= 1 && !searchPageConfig.hasNextPage;
108
108
  },
@@ -80,7 +80,19 @@ export const $utils = {
80
80
  $utils() {
81
81
  return {
82
82
  filterOption(input, option) {
83
- return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
83
+ try {
84
+ let text = option.componentOptions.children[0].text;
85
+ let lowText = text.toLowerCase();
86
+ let lowInput = input.toLowerCase();
87
+ let flag = false;
88
+ var reg = /^[a-zA-Z]+$/;
89
+ if (typeof text === 'string' && reg.test(input) && ''._toPinYin) {
90
+ flag = lowText._toPinYin().indexOf(lowInput) >= 0;
91
+ }
92
+ return flag || lowText.indexOf(lowInput) >= 0;
93
+ } catch (error) {
94
+ return false;
95
+ }
84
96
  },
85
97
  /**
86
98
  * 获取按钮自定义颜色
@@ -89,7 +89,19 @@ export default {
89
89
  },
90
90
 
91
91
  filterOption(input, option) {
92
- return option.componentOptions.children[0]?.text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
92
+ try {
93
+ let text = option.componentOptions.children[0].text;
94
+ let lowText = text.toLowerCase();
95
+ let lowInput = input.toLowerCase();
96
+ let flag = false;
97
+ var reg = /^[a-zA-Z]+$/;
98
+ if (typeof text === 'string' && reg.test(input) && ''._toPinYin) {
99
+ flag = lowText._toPinYin().indexOf(lowInput) >= 0;
100
+ }
101
+ return flag || lowText.indexOf(lowInput) >= 0;
102
+ } catch (error) {
103
+ return false;
104
+ }
93
105
  },
94
106
 
95
107
  // color 获取 alpha
@@ -415,9 +427,9 @@ export default {
415
427
 
416
428
  /**
417
429
  * 转换含有###的值
418
- * @param {*} item
430
+ * @param {*} item
419
431
  * @param {*} k key
420
- * @returns
432
+ * @returns
421
433
  */
422
434
  paramsToValue(item, k = "value") {
423
435
  if (this.isEmpty(item)) return;
@@ -680,7 +680,19 @@ XEUtils.mixin({
680
680
  .split('|');
681
681
  },
682
682
  filterOption(input, option) {
683
- return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0;
683
+ try {
684
+ let text = option.componentOptions.children[0].text;
685
+ let lowText = text.toLowerCase();
686
+ let lowInput = input.toLowerCase();
687
+ let flag = false;
688
+ var reg = /^[a-zA-Z]+$/;
689
+ if (typeof text === 'string' && reg.test(input) && ''._toPinYin) {
690
+ flag = lowText._toPinYin().indexOf(lowInput) >= 0;
691
+ }
692
+ return flag || lowText.indexOf(lowInput) >= 0;
693
+ } catch (error) {
694
+ return false;
695
+ }
684
696
  },
685
697
 
686
698
  /**