cnhis-design-vue 0.2.17-beta → 0.2.21-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 (71) hide show
  1. package/es/age/index.js +2 -2
  2. package/es/big-table/index.js +402 -178
  3. package/es/big-table/style.css +1 -1
  4. package/es/button/index.js +2299 -1517
  5. package/es/button/style.css +1 -1
  6. package/es/captcha/index.js +3 -3
  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/fabric-chart/index.js +9 -9
  12. package/es/index/index.js +4007 -2563
  13. package/es/index/style.css +1 -1
  14. package/es/input/index.js +1 -1
  15. package/es/map/index.js +1 -1
  16. package/es/multi-chat/index.js +602 -199
  17. package/es/multi-chat/style.css +1 -1
  18. package/es/multi-chat-client/index.js +516 -141
  19. package/es/multi-chat-client/style.css +1 -1
  20. package/es/multi-chat-history/index.js +4 -4
  21. package/es/multi-chat-record/index.js +4 -4
  22. package/es/multi-chat-setting/index.js +328 -77
  23. package/es/multi-chat-setting/style.css +1 -1
  24. package/es/multi-chat-sip/index.js +1 -1
  25. package/es/radio/index.js +1 -1
  26. package/es/scale-view/index.js +436 -362
  27. package/es/scale-view/style.css +1 -1
  28. package/es/select/index.js +3 -3
  29. package/es/select-label/index.js +312 -289
  30. package/es/select-label/style.css +1 -1
  31. package/es/select-person/index.js +2 -2
  32. package/es/table-filter/index.js +2546 -1697
  33. package/es/table-filter/style.css +1 -1
  34. package/es/tag/index.js +1 -1
  35. package/es/utils/UniRTCv2.js +586 -0
  36. package/es/verification-code/index.js +2 -2
  37. package/package.json +2 -2
  38. package/packages/big-table/src/BigTable.vue +72 -16
  39. package/packages/big-table/src/assets/style/table-base.less +10 -0
  40. package/packages/big-table/src/components/TextOverTooltip.vue +24 -11
  41. package/packages/big-table/src/utils/batchEditing.js +1 -1
  42. package/packages/big-table/src/utils/bigTableProps.js +2 -1
  43. package/packages/button/src/ButtonPrint/index.vue +65 -21
  44. package/packages/button/src/ButtonPrint/js/print.es.min.js +1 -2
  45. package/packages/multi-chat/chat/audio.vue +22 -0
  46. package/packages/multi-chat/chat/calling.vue +6 -0
  47. package/packages/multi-chat/chat/chatFooter.vue +43 -3
  48. package/packages/multi-chat/chat/client/clientChat.vue +13 -1
  49. package/packages/multi-chat/chat/index.vue +17 -4
  50. package/packages/multi-chat/chat/mixins/uniRTCAPI.js +77 -0
  51. package/packages/multi-chat/chat/multiVideo.vue +14 -0
  52. package/packages/multi-chat/chat/scrollList.vue +7 -1
  53. package/packages/multi-chat/chat/video.vue +4 -0
  54. package/packages/multi-chat/components/user-status.vue +50 -45
  55. package/packages/multi-chat/setting/baseInfo/index.vue +3 -3
  56. package/packages/multi-chat/setting/configuration/index.vue +38 -1
  57. package/packages/multi-chat/store/actions.js +76 -0
  58. package/packages/multi-chat/store/getters.js +9 -0
  59. package/packages/multi-chat/store/mutation.js +9 -0
  60. package/packages/multi-chat/store/state.js +4 -1
  61. package/packages/scale-view/answerParse.vue +27 -14
  62. package/packages/scale-view/scaleView.vue +51 -10
  63. package/packages/select-label/label-classify.vue +16 -8
  64. package/packages/select-label/labelFormContent.vue +137 -75
  65. package/packages/select-label/select-label.vue +56 -17
  66. package/packages/table-filter/src/base-search-com/BaseSearch.vue +100 -17
  67. package/packages/table-filter/src/classification/Classification-com.vue +49 -59
  68. package/packages/table-filter/src/components/search-modal/set-classification.vue +4 -1
  69. package/packages/table-filter/src/components/table-modal/TableModal.vue +10 -0
  70. package/packages/table-filter/src/quick-search/QuickSearch.vue +37 -23
  71. package/src/utils/UniRTCv2.js +561 -0
@@ -184,6 +184,7 @@ import { getSipUserId } from '@/utils/sip-device';
184
184
  import fetch, { qs } from '@/utils/chatFetch';
185
185
  import { Button, Modal, Popover, Tooltip } from 'ant-design-vue';
186
186
  import SvgIcon from '@/component/svg/index.vue';
187
+ import uniRTCAPI from './mixins/uniRTCAPI';
187
188
 
188
189
  const videoStatus = {
189
190
  1: '未接听',
@@ -195,6 +196,7 @@ const videoStatus = {
195
196
 
196
197
  export default {
197
198
  inject: ['store'],
199
+ mixins: [uniRTCAPI],
198
200
  components: {
199
201
  [Button.name]: Button,
200
202
  [Popover.name]: Popover,
@@ -468,6 +470,12 @@ export default {
468
470
  this.setRecordId(recordId);
469
471
  this.setVideoData(data.map);
470
472
  // this.appendVideoMessage();
473
+ // 江苏省
474
+ if (this.uniRTC) {
475
+ const targetList = data.map?.targetList || [];
476
+ this.checkStatus(targetList);
477
+ this.startCall(targetList);
478
+ }
471
479
  } else {
472
480
  data.resultMsg && this.$message.warning(data.resultMsg);
473
481
  }
@@ -850,6 +858,8 @@ export default {
850
858
  fetch.post('/chat/access/videoHangUp', qs.stringify(data)).then(({ data }) => {
851
859
  if (data.result === 'SUCCESS') {
852
860
  this.handleLeaveRoom();
861
+ // 江苏省主动挂断
862
+ this.uniRTC && this.hangUp();
853
863
  }
854
864
  });
855
865
  },
@@ -886,8 +896,12 @@ export default {
886
896
  if (accept == 0) {
887
897
  this.setMultiVideoShow(false);
888
898
  this.setVideoData({});
899
+ // 江苏省拒接
900
+ this.uniRTC && this.refuseCall();
889
901
  return;
890
902
  }
903
+ // 江苏省接听
904
+ this.uniRTC && this.acceptCall();
891
905
  let res = data.obj || data.map;
892
906
  let { token: userSig, roomId, recordId, caller, mode, type } = res;
893
907
  this.setCurrentSip(sip);
@@ -989,7 +989,7 @@ export default {
989
989
  ) : null}
990
990
 
991
991
  {isNoData && ((isEnd && !infiniteMsgShow) || !isEnd) ? (
992
- <div class="no-data">
992
+ <div class={[theme, 'no-data']}>
993
993
  <img src={require('../img/no-data2.png')} />
994
994
  <span>{this.i18nText('1.1.6.11')}</span>
995
995
  </div>
@@ -1010,10 +1010,16 @@ export default {
1010
1010
  & > img {
1011
1011
  width: 160px;
1012
1012
  }
1013
+ &.fold > img {
1014
+ width: 80%;
1015
+ }
1013
1016
  span {
1014
1017
  display: inline-block;
1015
1018
  font-size: 14px;
1016
1019
  }
1020
+ &.fold span {
1021
+ font-size: 12px;
1022
+ }
1017
1023
  }
1018
1024
  .chat-scroll-container {
1019
1025
  height: 100%;
@@ -54,9 +54,11 @@ import RtcClient from '../utils/rtc-client';
54
54
  import fetch, { qs } from '@/utils/chatFetch';
55
55
  import { Icon, Popconfirm, Tooltip } from 'ant-design-vue';
56
56
  import SvgIcon from '@/component/svg/index.vue';
57
+ import uniRTCAPI from './mixins/uniRTCAPI';
57
58
 
58
59
  export default {
59
60
  inject: ['store', 'i18nText'],
61
+ mixins: [uniRTCAPI],
60
62
  components: {
61
63
  [Popconfirm.name]: Popconfirm,
62
64
  [Tooltip.name]: Tooltip,
@@ -230,6 +232,8 @@ export default {
230
232
  this.setShowVideo(false);
231
233
  this.setVideoData({});
232
234
  }
235
+ // 江苏省会议挂断
236
+ this.uniRTC && this.hangUp();
233
237
  } else {
234
238
  this.$message.warning(data.resultMsg);
235
239
  }
@@ -1,20 +1,25 @@
1
1
  <template>
2
2
  <div>
3
3
  <a-dropdown
4
- v-if="type === 'right-top'"
5
- placement="bottomCenter"
4
+ :placement="placement"
6
5
  :getPopupContainer="
7
6
  triggerNode => {
8
7
  return triggerNode.parentNode || document.body;
9
8
  }
10
9
  "
11
10
  >
12
- <a-button>
11
+ <a-button v-if="placement === 'bottomCenter'">
13
12
  <svg-icon v-if="statusIcon" :icon-class="statusIcon" style="font-size: 16px"></svg-icon>
14
13
  <img v-else :src="getImg(status)" height="16" />
15
14
  {{ statusDesc }}
16
15
  <a-icon type="down" />
17
16
  </a-button>
17
+ <div v-else class="status-btn">
18
+ <svg-icon v-if="statusIcon" :icon-class="statusIcon" style="font-size: 16px"></svg-icon>
19
+ <img v-else :src="getImg(status)" height="16" />
20
+ {{ statusDesc }}
21
+ <a-icon type="up" />
22
+ </div>
18
23
  <a-menu slot="overlay">
19
24
  <a-menu-item v-for="{ title, status, description, icon } in statusList" :key="status" @click="handleStatusChange(status)">
20
25
  <template v-if="description">
@@ -41,7 +46,7 @@
41
46
  </a-menu-item>
42
47
  </a-menu>
43
48
  </a-dropdown>
44
- <template v-else>
49
+ <!-- <template v-else>
45
50
  <div class="status-btn">
46
51
  <svg-icon v-if="statusIcon" :icon-class="statusIcon" style="font-size: 16px"></svg-icon>
47
52
  <img v-else :src="getImg(status)" height="16" />
@@ -73,7 +78,7 @@
73
78
  </li>
74
79
  </ul>
75
80
  </div>
76
- </template>
81
+ </template> -->
77
82
  </div>
78
83
  </template>
79
84
  <script>
@@ -93,9 +98,9 @@ export default {
93
98
  SvgIcon
94
99
  },
95
100
  props: {
96
- type: {
101
+ placement: {
97
102
  type: String,
98
- default: 'right-top'
103
+ default: 'bottomCenter'
99
104
  },
100
105
  },
101
106
  computed: {
@@ -150,44 +155,44 @@ export default {
150
155
  <style lang="less" scoped>
151
156
  .status-btn {
152
157
  position: relative;
153
- padding-right: 10px;
154
- height: 26px;
155
- line-height: 26px;
158
+ // padding-right: 10px;
159
+ height: 28px;
160
+ line-height: 28px;
156
161
  cursor: pointer;
157
- .status-list {
158
- position: absolute;
159
- right: -85px;
160
- bottom: 8px;
161
- z-index: 2;
162
- display: none;
163
- padding: 4px 0;
164
- outline: none;
165
- list-style-type: none;
166
- border-radius: 4px;
167
- box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
168
- background-color: #fff;
169
- transition: all .5s;
170
- li {
171
- height: 32px;
172
- line-height: 32px;
173
- padding: 0 16px;
174
- display: flex;
175
- align-items: center;
176
- cursor: pointer;
177
- background: #fff;
178
- a {
179
- padding-right: 8px;
180
- color: rgba(0, 0, 0, 0.65);
181
- }
182
- &:hover {
183
- background: #f2f2f2;
184
- }
185
- }
186
- }
187
- &:hover {
188
- .status-list {
189
- display: block;
190
- }
191
- }
162
+ // .status-list {
163
+ // position: absolute;
164
+ // right: -85px;
165
+ // bottom: 8px;
166
+ // z-index: 2;
167
+ // display: none;
168
+ // padding: 4px 0;
169
+ // outline: none;
170
+ // list-style-type: none;
171
+ // border-radius: 4px;
172
+ // box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
173
+ // background-color: #fff;
174
+ // transition: all .5s;
175
+ // li {
176
+ // height: 32px;
177
+ // line-height: 32px;
178
+ // padding: 0 16px;
179
+ // display: flex;
180
+ // align-items: center;
181
+ // cursor: pointer;
182
+ // background: #fff;
183
+ // a {
184
+ // padding-right: 8px;
185
+ // color: rgba(0, 0, 0, 0.65);
186
+ // }
187
+ // &:hover {
188
+ // background: #f2f2f2;
189
+ // }
190
+ // }
191
+ // }
192
+ // &:hover {
193
+ // .status-list {
194
+ // display: block;
195
+ // }
196
+ // }
192
197
  }
193
198
  </style>
@@ -186,9 +186,9 @@
186
186
  <div class="functional-module" v-if="!isConference && !isStaff">
187
187
  <span class="title" style="display: inline-block;margin-bottom: 10px;">
188
188
  {{ i18nText('1.9.427') }}
189
- <a-checkbox @change="handleBotSettingShow" :checked="showBotSetting"></a-checkbox>
189
+ <!-- <a-checkbox @change="handleBotSettingShow" :checked="showBotSetting"></a-checkbox> -->
190
190
  </span>
191
- <a-row class="bot-setting" v-if="showBotSetting">
191
+ <!-- <a-row class="bot-setting" v-if="showBotSetting">
192
192
  <a-col :span="4">
193
193
  <a-form-item label="secretId">
194
194
  <a-input v-decorator="['secretId']" style="width: 150px;"></a-input>
@@ -205,7 +205,7 @@
205
205
  <a-form-item label="botId">
206
206
  <a-input v-decorator="['botId']" style="width: 150px;"></a-input>
207
207
  </a-form-item>
208
- </a-row>
208
+ </a-row> -->
209
209
  <a-row class="bot-setting">
210
210
  <a-form-item label="选择机器人">
211
211
  <a-select v-decorator="['robotId']" :placeholder="'选择机器人'" style="width: 200px;" allowClear showSearch :filterOption="filterOption">
@@ -39,7 +39,7 @@
39
39
  </a-row>
40
40
  </a-form-model>
41
41
 
42
- <div key="txy" v-if="obj.vendor == 1">
42
+ <div key="txy" v-if="obj.vendor == 1 || obj.vendor == 3">
43
43
  <div class="page-title">
44
44
  腾讯云API密钥
45
45
  <a-tooltip
@@ -105,6 +105,43 @@
105
105
  </a-row>
106
106
  </a-form-model>
107
107
  </div>
108
+ <div key="txy" v-if="obj.vendor == 3">
109
+ <div class="page-title">
110
+ 江苏省统一平台密钥
111
+ <a-tooltip
112
+ :arrowPointAtCenter="true"
113
+ placement="bottomRight"
114
+ :overlayStyle="{
115
+ width: '360px',
116
+ 'max-width': '360px'
117
+ }"
118
+ >
119
+ <template slot="title">
120
+ <div>
121
+ <div>江苏省统一平台密钥</div>
122
+ <p style="margin: 10px 0">
123
+ 江苏省统一平台。
124
+ </p>
125
+ </div>
126
+ </template>
127
+ <svg-icon class="icon" icon-class="xitongtubiaodaohangtubiaowenti" />
128
+ </a-tooltip>
129
+ </div>
130
+ <a-form-model :colon="false">
131
+ <a-row>
132
+ <a-col :span="col.lSpan">
133
+ <a-form-model-item label="appId">
134
+ <a-input v-model="obj.uniAppId"></a-input>
135
+ </a-form-model-item>
136
+ </a-col>
137
+ <a-col :span="col.rSpan" :offset="col.rOffset">
138
+ <a-form-model-item label="secretKey">
139
+ <a-input v-model="obj.uniSecretKey" type="password"></a-input>
140
+ </a-form-model-item>
141
+ </a-col>
142
+ </a-row>
143
+ </a-form-model>
144
+ </div>
108
145
  </div>
109
146
  <div class="footer-submit">
110
147
  <a-button type="primary" @click="handleSubmit">
@@ -2,6 +2,27 @@ import fetch, { qs } from '@/utils/chatFetch';
2
2
  import Vue from 'vue';
3
3
  import vexutils from '@/utils/vexutils';
4
4
  import { fmtRobotMessage } from '../utils';
5
+ import UniRTCObject from "@/utils/UniRTCv2";
6
+
7
+ const deepClone = source => {
8
+ let target;
9
+ if (typeof source === "object" && source) {
10
+ target = Array.isArray(source) ? [] : {};
11
+ for (let key in source) {
12
+ if (Object.prototype.hasOwnProperty.call(source, key)) {
13
+ // if (source.hasOwnProperty(key)) {
14
+ if (typeof source[key] !== "object") {
15
+ target[key] = source[key];
16
+ } else {
17
+ target[key] = deepClone(source[key]);
18
+ }
19
+ }
20
+ }
21
+ } else {
22
+ target = source;
23
+ }
24
+ return target;
25
+ };
5
26
 
6
27
  export default {
7
28
  /* 更新聊天记录 */
@@ -347,5 +368,60 @@ export default {
347
368
  commit('setVideoVoiceList', list);
348
369
  }
349
370
  });
371
+ },
372
+ async initUniRTC({ commit, state }, obj) {
373
+ const { uniAppId, uniSecretKey, params } = obj;
374
+ let uniRTC = null;
375
+ const getLoginToken = async () => {
376
+ let appSign;
377
+ const paramsData = {
378
+ clientType: '1',
379
+ deviceToken: uniRTC.deviceToken,
380
+ appId: uniAppId,
381
+ secretKey: uniSecretKey
382
+ };
383
+ try {
384
+ const { data } = await fetch.get('/chat/access/getMediaAuthSign', { params: paramsData });
385
+ if (data.result == 'SUCCESS') {
386
+ appSign = data.obj;
387
+ return appSign;
388
+ }
389
+ } catch (error) {
390
+ console.log('获取签名失败:', error);
391
+ return;
392
+ }
393
+ };
394
+ uniRTC = new UniRTCObject(uniAppId, getLoginToken);
395
+ uniRTC.onCallComing = incoming => {
396
+ commit("setIncoming", incoming);
397
+ console.log('onCallComing->', incoming);
398
+ };
399
+ uniRTC.onHangup = () => {
400
+ commit("setIncoming", null);
401
+ commit("setOuting", []);
402
+ };
403
+ // uniRTC.onCallTimeout = () => {
404
+ // commit("setIncoming", null);
405
+ // commit("setOuting", []);
406
+ // };
407
+ uniRTC.onCallRefused = outing => {
408
+ const index = state.outing.findIndex(v => v.target === outing.target);
409
+ if (index > -1) {
410
+ let cloneOuting = deepClone(state.outing);
411
+ cloneOuting.splice(index, 1);
412
+ commit("setOuting", cloneOuting);
413
+ }
414
+ };
415
+ commit("setUniRTC", uniRTC);
416
+ setTimeout(async () => {
417
+ console.log('本机设备token->', uniRTC.deviceToken);
418
+ const res = await fetch.post('/chat/service/registerDeviceToken', qs.stringify({
419
+ ...params,
420
+ deviceToken: uniRTC.deviceToken,
421
+ }));
422
+ if (res.data?.result !== 'SUCCESS') {
423
+ console.log(res.data.resultMsg);
424
+ }
425
+ }, 1500);
350
426
  }
351
427
  };
@@ -340,5 +340,14 @@ export default {
340
340
  },
341
341
  userStatus(state) {
342
342
  return state.userStatus;
343
+ },
344
+ uniRTC(state) {
345
+ return state.uniRTC;
346
+ },
347
+ incoming(state) {
348
+ return state.incoming;
349
+ },
350
+ outing(state) {
351
+ return state.outing;
343
352
  }
344
353
  };
@@ -266,4 +266,13 @@ export default {
266
266
  setUserStatus(state, userStatus) {
267
267
  state.userStatus = userStatus;
268
268
  },
269
+ setUniRTC(state, uniRTC) {
270
+ state.uniRTC = uniRTC;
271
+ },
272
+ setIncoming(state, incoming) {
273
+ state.incoming = incoming;
274
+ },
275
+ setOuting(state, outing) {
276
+ state.outing = outing;
277
+ }
269
278
  };
@@ -103,6 +103,9 @@ export default () => {
103
103
  isQuickReply: false,
104
104
  isRecorderVoice: false,
105
105
  msgRecordCache: {}, // 消息已读记录缓存
106
- userStatus: ''
106
+ userStatus: '',
107
+ uniRTC: null,
108
+ incoming: null,
109
+ outing: []
107
110
  };
108
111
  };
@@ -1,8 +1,11 @@
1
1
  <template>
2
2
  <div class="answerParse" :class="{ 'answerParse-success': answerSuccess }">
3
- <div class="answer-res">
4
- <svg-icon :iconClass="answerIcon"></svg-icon>
5
- {{ answerResText }}
3
+ <div class="answer-res-wrap">
4
+ <div class="answer-res">
5
+ <svg-icon :iconClass="answerIcon"></svg-icon>
6
+ {{ answerResText }}
7
+ </div>
8
+ <div v-if="answerSuccess"> 本题得分:{{ questionScore }}分 </div>
6
9
  </div>
7
10
  <div class="correct-answer" v-if="correctAnswer">
8
11
  <p>正确答案:</p>
@@ -62,19 +65,29 @@ export default {
62
65
  background: rgba(253, 246, 246, 0.6);
63
66
  margin-top: 6px;
64
67
  margin-bottom: 12px;
65
- .answer-res {
66
- display: inline-flex;
68
+ .answer-res-wrap {
69
+ display: flex;
70
+ justify-content: space-between;
67
71
  align-items: center;
68
- padding: 0 18px;
69
- line-height: 36px;
70
- color: #fff;
71
- background: #f06f64;
72
- border-radius: 18px;
73
72
  margin-bottom: 16px;
74
- font-weight: 700;
75
- svg {
76
- margin-right: 8px;
77
- font-size: 16px;
73
+ .answer-res {
74
+ display: inline-flex;
75
+ align-items: center;
76
+ padding: 0 18px;
77
+ line-height: 36px;
78
+ color: #fff;
79
+ background: #f06f64;
80
+ border-radius: 18px;
81
+ font-weight: 700;
82
+ svg {
83
+ margin-right: 8px;
84
+ font-size: 16px;
85
+ }
86
+ }
87
+ .answer-score {
88
+ font-size: 14px;
89
+ font-weight: 600;
90
+ color: #2e2e2e;
78
91
  }
79
92
  }
80
93
  .correct-answer {
@@ -36,15 +36,15 @@
36
36
  >
37
37
  <div class="totalScore-warp" v-if="hasScore">
38
38
  <div>
39
- 测评分数:<span>{{ config.totalScore }}分</span>
39
+ 测评总分:<span>{{ maxScore }}分</span>
40
40
  </div>
41
41
  <div>
42
- 测评总分:<span>{{ maxScore }}分</span>
42
+ 测评分数:<span :style="{ color: getEvaResColor }">{{ config.totalScore }}分</span>
43
43
  </div>
44
44
  <template v-if="hasEvaluateSetting">
45
45
  <div>
46
46
  测评结果:
47
- <span class="score-result">{{ config.evaluateResult }}</span>
47
+ <span class="score-result" :style="{ color: getEvaResColor }">{{ config.evaluateResult }}</span>
48
48
  </div>
49
49
  <div>
50
50
  结果说明:<span>{{ config.evaluateResultExplain }}</span>
@@ -462,12 +462,15 @@ export default create({
462
462
  }) || [];
463
463
  return valueArr.length;
464
464
  },
465
+ hasparamsEvaluate() {
466
+ return this.paramsEvaluate && Object.keys(this.paramsEvaluate).length;
467
+ },
465
468
  // url中是否有默认值
466
469
  hasDefault() {
467
470
  let hash = window.location.hash;
468
471
  let defaultVariable = ["evaname", "evadesc", "evast", "evadur", "evaan"];
469
472
  let hasDefault = defaultVariable.find(item => hash.includes(item));
470
- return hasDefault;
473
+ return this.paramsEvaluate || hasDefault;
471
474
  },
472
475
  // 是否有提交按钮
473
476
  showSaveBtn() {
@@ -514,6 +517,16 @@ export default create({
514
517
  return function(item) {
515
518
  return item.databaseTitle || item.title;
516
519
  };
520
+ },
521
+ getEvaResColor() {
522
+ let { evaluateResultConfig, totalScore } = this.config;
523
+ totalScore = +totalScore || 0;
524
+ if (!evaluateResultConfig.length || !totalScore) return "#2474FF";
525
+ let matchItem = evaluateResultConfig.find(
526
+ item => item.startScore <= totalScore && totalScore <= item.endScore
527
+ );
528
+ if (!matchItem) return "#2474FF";
529
+ return matchItem.color || "#2474FF";
517
530
  }
518
531
  },
519
532
  watch: {
@@ -521,6 +534,7 @@ export default create({
521
534
  immediate: true,
522
535
  deep: true,
523
536
  handler(newVal, oldVal) {
537
+ console.log(this.params, "---params");
524
538
  if (oldVal) {
525
539
  if (newVal.guage_id) {
526
540
  if (newVal.guage_id != oldVal.guage_id) {
@@ -583,7 +597,8 @@ export default create({
583
597
  banSubmit: false,
584
598
  isFinished: false,
585
599
  maxScore: 0,
586
- originConfig: {}
600
+ originConfig: {},
601
+ paramsEvaluate: null
587
602
  };
588
603
  },
589
604
  mounted() {
@@ -636,9 +651,16 @@ export default create({
636
651
 
637
652
  this.originConfig = JSON.parse(JSON.stringify(this.config));
638
653
 
654
+ if (this.params && Object.keys(this.params).length) {
655
+ let res = this.handleBtnParamsEvaluate(this.params);
656
+ res && Object.keys(res).length && (this.paramsEvaluate = res);
657
+ }
658
+
639
659
  this.handleEvaluateParams(this.config.evaluateResultSetting);
640
660
  this.handleShowEvaluate();
641
661
 
662
+ console.log(this.config.evaluateResultSetting);
663
+
642
664
  this.defaultFormArray = JSON.parse(JSON.stringify(list));
643
665
  let filterArr = this.filterArr;
644
666
  list = list.filter(v => !filterArr.includes(v.type));
@@ -648,6 +670,17 @@ export default create({
648
670
  this.fontSize = data.fontSize;
649
671
  this.spinning = false;
650
672
  },
673
+ handleBtnParamsEvaluate(params) {
674
+ let defaultVariable = ["evaname", "evadesc", "evast", "evadur", "evaan"];
675
+ let res = {};
676
+ for (let key in params) {
677
+ let value = params[key];
678
+ if (defaultVariable.includes(key) && value) {
679
+ res[key] = value;
680
+ }
681
+ }
682
+ return res;
683
+ },
651
684
  /** *
652
685
  * 解析测评参数
653
686
  */
@@ -655,6 +688,10 @@ export default create({
655
688
  if (!evaluateResultSetting || !Object.keys(evaluateResultSetting).length) return;
656
689
  // 分享测评量表链接URL支持传入测评名称-evaname 测评说明-evadesc 测评时间-evast 测评时长-evadur 固定参数
657
690
  let query = this.handleQueryParams();
691
+ // 按钮传参
692
+ if (this.hasparamsEvaluate) {
693
+ query = this.paramsEvaluate;
694
+ }
658
695
  let obj = {
659
696
  evaluateName: "evaname",
660
697
  evaluateExplain: "evadesc",
@@ -747,6 +784,10 @@ export default create({
747
784
  },
748
785
  setDefaultEvaluate(evaluateResultSetting) {
749
786
  let query = this.handleQueryParams();
787
+ // 按钮传参
788
+ if (this.hasparamsEvaluate) {
789
+ query = this.paramsEvaluate;
790
+ }
750
791
  if (query.evaname) {
751
792
  this.$set(evaluateResultSetting, "evaluateName", query.evaname);
752
793
  }
@@ -1211,12 +1252,12 @@ export default create({
1211
1252
  const { relation_logic_is, condition, relation_logic } = relationLogicObj;
1212
1253
  if (relation_logic_is) {
1213
1254
  const results = condition.map(c => {
1214
- const { title } = this.formArray.filter(f => f.seq == c.subject_seq)[0];
1215
- if (utils.isString(form[title])) {
1216
- return c.value.includes(form[title]);
1255
+ let key = this.formKey(this.formArray.filter(f => f.seq == c.subject_seq)[0]);
1256
+ if (utils.isString(form[key])) {
1257
+ return c.value.includes(form[key]);
1217
1258
  } else {
1218
- if (utils.isArray(form[title])) {
1219
- return form[title].some(v => c.value.includes(v));
1259
+ if (utils.isArray(form[key])) {
1260
+ return form[key].some(v => c.value.includes(v));
1220
1261
  }
1221
1262
  }
1222
1263
  });