cnhis-design-vue 0.2.29-beta → 0.2.33-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 (49) hide show
  1. package/es/age/index.js +2 -2
  2. package/es/big-table/index.js +45 -44
  3. package/es/big-table/style.css +1 -1
  4. package/es/button/index.js +2 -2
  5. package/es/captcha/index.js +3 -3
  6. package/es/checkbox/index.js +1 -1
  7. package/es/color-picker/index.js +1 -1
  8. package/es/drag-layout/index.js +50 -45
  9. package/es/drag-layout/style.css +1 -1
  10. package/es/editor/index.js +297 -25
  11. package/es/editor/style.css +1 -1
  12. package/es/fabric-chart/index.js +9 -9
  13. package/es/index/index.js +486 -343
  14. package/es/index/style.css +1 -1
  15. package/es/input/index.js +1 -1
  16. package/es/map/index.js +1 -1
  17. package/es/multi-chat/index.js +79 -53
  18. package/es/multi-chat-client/index.js +73 -47
  19. package/es/multi-chat-history/index.js +4 -4
  20. package/es/multi-chat-record/index.js +4 -4
  21. package/es/multi-chat-setting/index.js +75 -49
  22. package/es/multi-chat-sip/index.js +1 -1
  23. package/es/radio/index.js +1 -1
  24. package/es/scale-view/index.js +112 -97
  25. package/es/scale-view/style.css +1 -1
  26. package/es/select/index.js +3 -3
  27. package/es/select-label/index.js +58 -48
  28. package/es/select-label/style.css +1 -1
  29. package/es/select-person/index.js +2 -2
  30. package/es/table-filter/index.js +42 -28
  31. package/es/tag/index.js +1 -1
  32. package/es/utils/utils-map.js +16 -4
  33. package/es/utils/vexutils.js +15 -1
  34. package/es/verification-code/index.js +2 -2
  35. package/lib/cui.common.js +668 -505
  36. package/lib/cui.umd.js +668 -505
  37. package/lib/cui.umd.min.js +31 -31
  38. package/package.json +1 -1
  39. package/packages/big-table/src/BigTable.vue +1 -0
  40. package/packages/drag-layout/drag-layout.vue +4 -0
  41. package/packages/editor/src/Editor.vue +76 -9
  42. package/packages/multi-chat/store/actions.js +22 -4
  43. package/packages/scale-view/scaleView.vue +13 -6
  44. package/packages/select-label/labelFormContent.vue +23 -14
  45. package/packages/select-label/select-label.vue +1 -1
  46. package/packages/table-filter/src/components/multi-select/multi-select.vue +1 -1
  47. package/packages/table-filter/src/mixins/mixins.js +13 -1
  48. package/src/utils/utils-map.js +15 -3
  49. 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.29-beta",
3
+ "version": "0.2.33-beta",
4
4
  "description": "基于 Ant Desgin Vue 的UI库",
5
5
  "keyword": "cnhis-design-vue vue cnhis",
6
6
  "homepage": "http://dv.cnhis.com/",
@@ -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
  };
@@ -534,7 +534,6 @@ export default create({
534
534
  immediate: true,
535
535
  deep: true,
536
536
  handler(newVal, oldVal) {
537
- console.log(this.params, "---params");
538
537
  if (oldVal) {
539
538
  if (newVal.guage_id) {
540
539
  if (newVal.guage_id != oldVal.guage_id) {
@@ -666,8 +665,6 @@ export default create({
666
665
  this.handleEvaluateParams(this.config.evaluateResultSetting);
667
666
  this.handleShowEvaluate();
668
667
 
669
- console.log(this.config.evaluateResultSetting);
670
-
671
668
  this.defaultFormArray = JSON.parse(JSON.stringify(list));
672
669
  let filterArr = this.filterArr;
673
670
  list = list.filter(v => !filterArr.includes(v.type));
@@ -865,10 +862,20 @@ export default create({
865
862
  if (urlKey) {
866
863
  let list = urlKey.split(",");
867
864
  if (list.length > 1) {
868
- defValue = list.map(l => decodeURIComponent(this.getQueryVariable(l)));
865
+ let val = list
866
+ .map(l => {
867
+ let tempV = this.getQueryVariable(l);
868
+ if (tempV) return decodeURIComponent(tempV);
869
+ return null;
870
+ })
871
+ .filter(Boolean);
872
+ val.length && (defValue = val);
869
873
  } else {
870
- let val = decodeURIComponent(this.getQueryVariable(list[0]));
871
- defValue = item.type == "CHECKBOX_BLOCK" ? val.split() : val;
874
+ let val = this.getQueryVariable(list[0]);
875
+ if (val) {
876
+ val = decodeURIComponent(val);
877
+ defValue = item.type == "CHECKBOX_BLOCK" ? val.split() : val;
878
+ }
872
879
  }
873
880
  }
874
881
  }
@@ -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
  /**