cnhis-design-vue 0.2.65-beta → 0.2.68-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.
- package/es/affix/index.js +8 -8
- package/es/age/index.js +10 -10
- package/es/alert/index.js +8 -8
- package/es/anchor/index.js +8 -8
- package/es/auto-complete/index.js +8 -8
- package/es/avatar/index.js +8 -8
- package/es/back-top/index.js +8 -8
- package/es/badge/index.js +8 -8
- package/es/base/index.js +8 -8
- package/es/big-table/index.js +1852 -1352
- package/es/big-table/style.css +1 -1
- package/es/breadcrumb/index.js +8 -8
- package/es/button/index.js +28 -28
- package/es/calendar/index.js +8 -8
- package/es/captcha/index.js +3 -3
- package/es/card/index.js +8 -8
- package/es/carousel/index.js +8 -8
- package/es/cascader/index.js +8 -8
- package/es/checkbox/index.js +9 -9
- package/es/col/index.js +8 -8
- package/es/collapse/index.js +8 -8
- package/es/color-picker/index.js +1 -1
- package/es/comment/index.js +8 -8
- package/es/config-provider/index.js +8 -8
- package/es/date-picker/index.js +8 -8
- package/es/descriptions/index.js +8 -8
- package/es/divider/index.js +8 -8
- package/es/drag-layout/index.js +3 -3
- package/es/drawer/index.js +8 -8
- package/es/dropdown/index.js +8 -8
- package/es/editor/index.js +1 -1
- package/es/empty/index.js +8 -8
- package/es/fabric-chart/index.js +9 -9
- package/es/form/index.js +8 -8
- package/es/form-model/index.js +8 -8
- package/es/form-table/index.js +62 -62
- package/es/index/index.js +3310 -2125
- package/es/index/style.css +1 -1
- package/es/input/index.js +9 -9
- package/es/input-number/index.js +8 -8
- package/es/layout/index.js +8 -8
- package/es/list/index.js +8 -8
- package/es/locale-provider/index.js +8 -8
- package/es/map/index.js +9 -9
- package/es/mentions/index.js +8 -8
- package/es/menu/index.js +8 -8
- package/es/message/index.js +8 -8
- package/es/multi-chat/index.js +75 -75
- package/es/multi-chat-client/index.js +69 -69
- package/es/multi-chat-history/index.js +4 -4
- package/es/multi-chat-record/index.js +14 -14
- package/es/multi-chat-setting/index.js +22 -22
- package/es/multi-chat-sip/index.js +1 -1
- package/es/notification/index.js +8 -8
- package/es/page-header/index.js +8 -8
- package/es/pagination/index.js +8 -8
- package/es/popconfirm/index.js +8 -8
- package/es/popover/index.js +8 -8
- package/es/progress/index.js +8 -8
- package/es/radio/index.js +9 -9
- package/es/rate/index.js +8 -8
- package/es/result/index.js +8 -8
- package/es/row/index.js +8 -8
- package/es/scale-view/index.js +1127 -408
- package/es/scale-view/style.css +1 -1
- package/es/select/index.js +11 -11
- package/es/select-label/index.js +11 -11
- package/es/select-person/index.js +2 -2
- package/es/skeleton/index.js +8 -8
- package/es/slider/index.js +8 -8
- package/es/space/index.js +8 -8
- package/es/spin/index.js +8 -8
- package/es/statistic/index.js +8 -8
- package/es/steps/index.js +8 -8
- package/es/switch/index.js +8 -8
- package/es/table-filter/index.js +199 -177
- package/es/table-filter/style.css +1 -1
- package/es/tabs/index.js +8 -8
- package/es/tag/index.js +9 -9
- package/es/time-picker/index.js +8 -8
- package/es/timeline/index.js +8 -8
- package/es/tooltip/index.js +8 -8
- package/es/transfer/index.js +8 -8
- package/es/tree/index.js +8 -8
- package/es/tree-select/index.js +8 -8
- package/es/upload/index.js +8 -8
- package/es/utils/utils-map.js +33 -0
- package/es/utils/vexutils.js +21 -0
- package/es/verification-code/index.js +2 -2
- package/lib/cui.common.js +5759 -4597
- package/lib/cui.umd.js +5759 -4597
- package/lib/cui.umd.min.js +81 -81
- package/package.json +1 -1
- package/packages/big-table/src/BigTable.vue +100 -221
- package/packages/big-table/src/assets/style/table-base.less +16 -0
- package/packages/big-table/src/components/TextOverTooltip.vue +1 -1
- package/packages/big-table/src/components/edit-form/EditForm.vue +27 -9
- package/packages/big-table/src/components/edit-form/edit-component/config-data/index.js +2 -1
- package/packages/big-table/src/components/edit-form/edit-component/edit-search/edit-search.vue +2 -3
- package/packages/big-table/src/components/edit-form/edit-component/edit-search-more/edit-search-more.vue +2 -2
- package/packages/big-table/src/components/edit-form/edit-component/edit-select/edit-select.vue +1 -1
- package/packages/big-table/src/components/edit-form/edit-component/edit-select-multiple/edit-select-multiple.vue +1 -1
- package/packages/big-table/src/components/edit-form/edit-component/edit-switch/edit-switch.vue +43 -0
- package/packages/big-table/src/components/edit-form/edit-component/mixins/dateType.js +5 -4
- package/packages/big-table/src/components/edit-form/edit-component/mixins/item-default.js +50 -5
- package/packages/big-table/src/components/edit-form/edit-component/mixins/search.js +202 -153
- package/packages/big-table/src/components/edit-form/edit-item/form-event.js +3 -2
- package/packages/big-table/src/components/edit-form/edit-item/validate-rules.js +6 -6
- package/packages/big-table/src/components/edit-form/edit-mixins/form-commom.js +25 -20
- package/packages/big-table/src/components/player-vod/video-list.vue +3 -2
- package/packages/big-table/src/utils/batchEditing.js +144 -75
- package/packages/big-table/src/utils/bigTableProps.js +9 -13
- package/packages/scale-view/NoData.vue +81 -0
- package/packages/scale-view/answerParse.vue +10 -1
- package/packages/scale-view/assets/img/failure.png +0 -0
- package/packages/scale-view/assets/img/no-permission.png +0 -0
- package/packages/scale-view/assets/img/nodata.png +0 -0
- package/packages/scale-view/assets/img/notfound.png +0 -0
- package/packages/scale-view/formitem/r-choice.vue +319 -99
- package/packages/scale-view/formitem/r-input.vue +10 -14
- package/packages/scale-view/mixin/NoData.js +16 -2
- package/packages/scale-view/mixin/evaluate.js +1 -1
- package/packages/scale-view/scaleView.vue +334 -139
- package/packages/table-filter/src/base-search-com/BaseSearch.vue +45 -47
- package/packages/table-filter/src/components/out-quick-search/out-quick-search.vue +3 -0
- package/packages/table-filter/src/components/search-condition/SearchCondition.vue +9 -4
- package/packages/table-filter/src/components/search-filter/SearchFilter.vue +11 -3
- package/src/utils/utils-map.js +34 -0
- package/src/utils/vexutils.js +96 -77
- package/packages/big-table/src/components/edit-form/edit-component/global-props.js +0 -33
- package/packages/big-table/src/components/edit-form/edit-component/index.js +0 -8
|
@@ -102,7 +102,7 @@ export default {
|
|
|
102
102
|
return cur >= endTime;
|
|
103
103
|
},
|
|
104
104
|
getTotalLen() {
|
|
105
|
-
let arrList = this.formArray?.filter(item => !this.filterArr.includes(item.type));
|
|
105
|
+
let arrList = this.formArray?.filter(item => !this.filterArr.includes(item.type) && !item.hide);
|
|
106
106
|
if (!arrList || !arrList.length) return;
|
|
107
107
|
this.totalLen = arrList.length;
|
|
108
108
|
},
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<a-spin :indicator="indicator" tip="加载中..." />
|
|
5
5
|
</slot>
|
|
6
6
|
<slot v-if="!spinning && !hasFrontAddress">
|
|
7
|
-
<div v-if="noData">暂无数据</div>
|
|
8
|
-
|
|
7
|
+
<!-- <div v-if="noData">暂无数据</div> -->
|
|
8
|
+
<NoData v-if="noData" :noDataImg="noDataImg" :noDataTip="noDataTip"></NoData>
|
|
9
9
|
<template v-else>
|
|
10
10
|
<evaluatePage
|
|
11
11
|
v-if="showEvaluateEntry"
|
|
@@ -133,6 +133,11 @@
|
|
|
133
133
|
<span class="evalute-label" v-if="showEvaluateLabel(item)">
|
|
134
134
|
{{ showEvaluateLabel(item) }}
|
|
135
135
|
</span>
|
|
136
|
+
<template v-if="showEvatip(item)">
|
|
137
|
+
<span class="evalute-tip" @click="showEvaTipModal(item)">
|
|
138
|
+
<svg-icon icon-class="a-xitongtubiaotishi" />查看提示
|
|
139
|
+
</span>
|
|
140
|
+
</template>
|
|
136
141
|
</span>
|
|
137
142
|
<!-- 输入框 -->
|
|
138
143
|
<MyInput
|
|
@@ -258,7 +263,7 @@
|
|
|
258
263
|
import {
|
|
259
264
|
Icon,
|
|
260
265
|
Checkbox,
|
|
261
|
-
Tree,
|
|
266
|
+
Tree,
|
|
262
267
|
Tooltip,
|
|
263
268
|
Input,
|
|
264
269
|
Spin,
|
|
@@ -281,6 +286,7 @@ import evaluatePage from "./evaluatePage.vue";
|
|
|
281
286
|
import evaluateCountdown from "./evaluateCountdown.vue";
|
|
282
287
|
import answerParse from "./answerParse.vue";
|
|
283
288
|
import vexutils from '@/utils/vexutils';
|
|
289
|
+
import NoData from './NoData.vue';
|
|
284
290
|
export default create({
|
|
285
291
|
name: "scale-view",
|
|
286
292
|
mixins: [judgeTypes, NoDataJs],
|
|
@@ -315,7 +321,11 @@ export default create({
|
|
|
315
321
|
extrasmall: 0.9
|
|
316
322
|
})
|
|
317
323
|
},
|
|
318
|
-
openType: { type: String, default: "" }
|
|
324
|
+
openType: { type: String, default: "" },
|
|
325
|
+
scaleApiConfig: {
|
|
326
|
+
type: Object,
|
|
327
|
+
default: () => ({})
|
|
328
|
+
}
|
|
319
329
|
},
|
|
320
330
|
components: {
|
|
321
331
|
MyChoice,
|
|
@@ -340,12 +350,19 @@ export default create({
|
|
|
340
350
|
[Tooltip.name]: Tooltip,
|
|
341
351
|
evaluatePage,
|
|
342
352
|
evaluateCountdown,
|
|
343
|
-
answerParse
|
|
353
|
+
answerParse,
|
|
354
|
+
NoData
|
|
344
355
|
},
|
|
345
356
|
computed: {
|
|
346
357
|
queryformBoldOpen() {
|
|
347
358
|
return this.$route.query?.formBoldOpen == 1;
|
|
348
359
|
},
|
|
360
|
+
showEvatip() {
|
|
361
|
+
return function (item) {
|
|
362
|
+
if (!this.isEvaluation(item.type)) return false;
|
|
363
|
+
return this.$route.query?.evatip == 1 || this.params?.evatip == 1;
|
|
364
|
+
};
|
|
365
|
+
},
|
|
349
366
|
isFormBoldOpen() {
|
|
350
367
|
return function(item) {
|
|
351
368
|
let res = item.required;
|
|
@@ -508,7 +525,8 @@ export default create({
|
|
|
508
525
|
},
|
|
509
526
|
showAnswerParse() {
|
|
510
527
|
return function(item) {
|
|
511
|
-
let { evaluateAnswer
|
|
528
|
+
let { evaluateAnswer, checkAnswerMode, evaluateStartTime, evaluateTime } =
|
|
529
|
+
this.config?.evaluateResultSetting || {};
|
|
512
530
|
let arr = [
|
|
513
531
|
"EVALUATE_RADIO_BLOCK",
|
|
514
532
|
"EVALUATE_CHECKBOX_BLOCK",
|
|
@@ -516,7 +534,18 @@ export default create({
|
|
|
516
534
|
"EVALUATE_INPUT"
|
|
517
535
|
];
|
|
518
536
|
let maxScore = item?.scoreConfigs || 0;
|
|
519
|
-
|
|
537
|
+
let isShow = evaluateAnswer && this.isFinished && arr.includes(item.type) && maxScore;
|
|
538
|
+
if (
|
|
539
|
+
!evaluateStartTime ||
|
|
540
|
+
!evaluateTime ||
|
|
541
|
+
(checkAnswerMode && checkAnswerMode == 1)
|
|
542
|
+
)
|
|
543
|
+
return isShow;
|
|
544
|
+
if (!vexutils.isValidDate(new Date(evaluateStartTime))) return isShow;
|
|
545
|
+
// 答案解析时间 考试时间结束后
|
|
546
|
+
let endTime = moment(evaluateStartTime).add(evaluateTime, "minutes");
|
|
547
|
+
let isRang = endTime.diff(moment(), "seconds", true);
|
|
548
|
+
return isShow && isRang <= 0;
|
|
520
549
|
};
|
|
521
550
|
},
|
|
522
551
|
tipMsg() {
|
|
@@ -607,7 +636,9 @@ export default create({
|
|
|
607
636
|
maxScore: 0,
|
|
608
637
|
originConfig: {},
|
|
609
638
|
paramsEvaluate: null,
|
|
610
|
-
hasFrontAddress: true
|
|
639
|
+
hasFrontAddress: true,
|
|
640
|
+
choiceComObj: {},
|
|
641
|
+
evatipMap: {} // 维护一个tip map避免重复请求
|
|
611
642
|
};
|
|
612
643
|
},
|
|
613
644
|
mounted() {
|
|
@@ -644,6 +675,12 @@ export default create({
|
|
|
644
675
|
}
|
|
645
676
|
map.maxScore && (this.maxScore = map.maxScore);
|
|
646
677
|
this.isFinished = isFinished;
|
|
678
|
+
if (data.isNotFilled) {
|
|
679
|
+
this.spinning = false;
|
|
680
|
+
this.hasFrontAddress = false;
|
|
681
|
+
this.setNoData(true, '未查询到量表填写记录')
|
|
682
|
+
return;
|
|
683
|
+
}
|
|
647
684
|
if (data.isLackCustomer) {
|
|
648
685
|
let _this = this;
|
|
649
686
|
// 校验用户环境
|
|
@@ -661,7 +698,12 @@ export default create({
|
|
|
661
698
|
this.config.evaluateResultConfig = JSON.parse(map.evaluateResultConfig);
|
|
662
699
|
}
|
|
663
700
|
if ("evaluateResultSetting" in map && utils.isJSON(map.evaluateResultSetting)) {
|
|
664
|
-
|
|
701
|
+
this.config.evaluateResultSetting = JSON.parse(map.evaluateResultSetting);
|
|
702
|
+
// 随机测评
|
|
703
|
+
if (this.config?.randomId && this.config.evaluateResultSetting) {
|
|
704
|
+
this.config.evaluateResultSetting.evaluateName = this.config.name;
|
|
705
|
+
this.config.evaluateResultSetting.evaluateExplain = this.config.remark;
|
|
706
|
+
}
|
|
665
707
|
}
|
|
666
708
|
|
|
667
709
|
this.originConfig = JSON.parse(JSON.stringify(this.config));
|
|
@@ -738,7 +780,9 @@ export default create({
|
|
|
738
780
|
};
|
|
739
781
|
for (let key in evaluateResultSetting) {
|
|
740
782
|
let value = evaluateResultSetting[key];
|
|
741
|
-
|
|
783
|
+
let isParseKey =
|
|
784
|
+
value && key != "evaluateAnswer" && typeof value === "string" && value.includes("${");
|
|
785
|
+
if (isParseKey) {
|
|
742
786
|
let parseValue = value.replace(/\$\{([^}]+)\}/g, (_v, $1) => {
|
|
743
787
|
let param;
|
|
744
788
|
if ($1.startsWith("form.")) {
|
|
@@ -991,10 +1035,11 @@ export default create({
|
|
|
991
1035
|
if (notIndexArr.indexOf(item.type) < 0 && !item.hide) {
|
|
992
1036
|
this.$set(item, "softcode", i++);
|
|
993
1037
|
}
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
1038
|
+
|
|
1039
|
+
|
|
1040
|
+
// "RADIO_BLOCK", "CHECKBOX_BLOCK" 将取值value改为key
|
|
997
1041
|
if (this.isChoice(item.type)) {
|
|
1042
|
+
this.handleFormatOptions(item.options, item.type);
|
|
998
1043
|
if (item.type != "SEARCH_CASCADE") {
|
|
999
1044
|
if (item.dbValue) {
|
|
1000
1045
|
this.nextLogicEvent(item.dbValue, item, results);
|
|
@@ -1005,6 +1050,18 @@ export default create({
|
|
|
1005
1050
|
}
|
|
1006
1051
|
}
|
|
1007
1052
|
}
|
|
1053
|
+
return item;
|
|
1054
|
+
});
|
|
1055
|
+
return results.map(item => {
|
|
1056
|
+
// 题目关联
|
|
1057
|
+
let relationLogicObj = utils.isString(item.relationLogic)
|
|
1058
|
+
? JSON.parse(item.relationLogic)
|
|
1059
|
+
: item.relationLogic;
|
|
1060
|
+
this.handleRelationLogic(list, relationLogicObj);
|
|
1061
|
+
|
|
1062
|
+
// 跳题逻辑
|
|
1063
|
+
this.handLenextLogic(item);
|
|
1064
|
+
|
|
1008
1065
|
// 自定义列表特殊处理
|
|
1009
1066
|
if (
|
|
1010
1067
|
item.type === "CHECKBOX_BLOCK" &&
|
|
@@ -1017,6 +1074,77 @@ export default create({
|
|
|
1017
1074
|
return item;
|
|
1018
1075
|
});
|
|
1019
1076
|
},
|
|
1077
|
+
/**
|
|
1078
|
+
* "RADIO_BLOCK", "CHECKBOX_BLOCK" 将取值value改为key, relationLogic需要重新处理
|
|
1079
|
+
*/
|
|
1080
|
+
handleRelationLogic(list, relationLogicObj) {
|
|
1081
|
+
let { condition } = relationLogicObj || {};
|
|
1082
|
+
if (!condition || !condition.length) return;
|
|
1083
|
+
condition.forEach(c => {
|
|
1084
|
+
let matchItem = list.find(f => f.seq == c.subject_seq);
|
|
1085
|
+
if (!matchItem) return;
|
|
1086
|
+
let isChoice = this.isRadioOrCheckBox(matchItem.options, matchItem.type);
|
|
1087
|
+
if (!isChoice) return;
|
|
1088
|
+
let value = c.value;
|
|
1089
|
+
if (Array.isArray(value)) {
|
|
1090
|
+
value = value.map(v => {
|
|
1091
|
+
return this.replaceConditionItem(matchItem.options, v);
|
|
1092
|
+
});
|
|
1093
|
+
c.value = value;
|
|
1094
|
+
} else {
|
|
1095
|
+
c.value = this.replaceConditionItem(matchItem.options, value);
|
|
1096
|
+
}
|
|
1097
|
+
});
|
|
1098
|
+
},
|
|
1099
|
+
/**
|
|
1100
|
+
* "RADIO_BLOCK", "CHECKBOX_BLOCK" 将取值value改为key, nextLogic需要重新处理
|
|
1101
|
+
*/
|
|
1102
|
+
handLenextLogic(item) {
|
|
1103
|
+
let { nextLogic, options, type } = item || {};
|
|
1104
|
+
let isChoice = this.isRadioOrCheckBox(options, type);
|
|
1105
|
+
if (!nextLogic || !isChoice) return;
|
|
1106
|
+
let { condition } = nextLogic || {};
|
|
1107
|
+
if (!condition || !condition.length) return;
|
|
1108
|
+
condition.forEach(c => {
|
|
1109
|
+
let value = c.value;
|
|
1110
|
+
if (Array.isArray(value)) {
|
|
1111
|
+
value = value.map(v => {
|
|
1112
|
+
return this.replaceConditionItem(options, v);
|
|
1113
|
+
});
|
|
1114
|
+
c.value = value;
|
|
1115
|
+
} else {
|
|
1116
|
+
c.value = this.replaceConditionItem(options, value);
|
|
1117
|
+
}
|
|
1118
|
+
});
|
|
1119
|
+
},
|
|
1120
|
+
replaceConditionItem(options, value) {
|
|
1121
|
+
let matchOption = options.find(v => value === v.value);
|
|
1122
|
+
if (!matchOption) return value;
|
|
1123
|
+
return matchOption.key;
|
|
1124
|
+
},
|
|
1125
|
+
isRadioOrCheckBox(options, type) {
|
|
1126
|
+
let typeArr = ["RADIO_BLOCK", "CHECKBOX_BLOCK"];
|
|
1127
|
+
if (!typeArr.includes(type)) return;
|
|
1128
|
+
if (!options) return;
|
|
1129
|
+
if (options && utils.isJSON(options)) {
|
|
1130
|
+
options = JSON.parse(options);
|
|
1131
|
+
}
|
|
1132
|
+
if (!options.length) return;
|
|
1133
|
+
return true;
|
|
1134
|
+
},
|
|
1135
|
+
handleFormatOptions(options, type) {
|
|
1136
|
+
let isChoice = this.isRadioOrCheckBox(options, type);
|
|
1137
|
+
if (!isChoice) return;
|
|
1138
|
+
|
|
1139
|
+
options.forEach((item, i) => {
|
|
1140
|
+
if (item.key !== "other") {
|
|
1141
|
+
item.key = i + 1;
|
|
1142
|
+
}
|
|
1143
|
+
if (item.prefix || item.suffix) {
|
|
1144
|
+
item.value = item.prefix || item.suffix;
|
|
1145
|
+
}
|
|
1146
|
+
});
|
|
1147
|
+
},
|
|
1020
1148
|
// 初始化rules
|
|
1021
1149
|
formatRules(formArray) {
|
|
1022
1150
|
const rules = {};
|
|
@@ -1066,6 +1194,18 @@ export default create({
|
|
|
1066
1194
|
validator: (rule, value, callback) => this[methodName](rule, value, callback, item),
|
|
1067
1195
|
trigger: "change"
|
|
1068
1196
|
});
|
|
1197
|
+
} else if (item.type === "RADIO_BLOCK") {
|
|
1198
|
+
this.choiceComObj[this.formKey(item)] = {};
|
|
1199
|
+
rules[newTitle].push({
|
|
1200
|
+
validator: (rule, value, callback) => this.checkRadio(rule, value, callback, item),
|
|
1201
|
+
trigger: "change"
|
|
1202
|
+
});
|
|
1203
|
+
} else if (item.type === "CHECKBOX_BLOCK") {
|
|
1204
|
+
this.choiceComObj[this.formKey(item)] = {};
|
|
1205
|
+
rules[newTitle].push({
|
|
1206
|
+
validator: (rule, value, callback) => this.checkCheckbox(rule, value, callback, item),
|
|
1207
|
+
trigger: "change"
|
|
1208
|
+
});
|
|
1069
1209
|
}
|
|
1070
1210
|
});
|
|
1071
1211
|
return rules;
|
|
@@ -1145,6 +1285,56 @@ export default create({
|
|
|
1145
1285
|
}
|
|
1146
1286
|
callback();
|
|
1147
1287
|
},
|
|
1288
|
+
checkRadio(rule, value, callback, item) {
|
|
1289
|
+
if (!value) return callback();
|
|
1290
|
+
let { options } = item;
|
|
1291
|
+
if (!options.length || value === "other") return callback();
|
|
1292
|
+
const key = this.formKey(item);
|
|
1293
|
+
let { optionsPreSuffixObj = {} } = this.choiceComObj[key] || {};
|
|
1294
|
+
let matchItem = options.find((o, i) => {
|
|
1295
|
+
if (i + 1 === value) {
|
|
1296
|
+
return true;
|
|
1297
|
+
}
|
|
1298
|
+
return false;
|
|
1299
|
+
});
|
|
1300
|
+
if (!matchItem || matchItem.importability) return callback();
|
|
1301
|
+
if (matchItem.prefix || matchItem.suffix) {
|
|
1302
|
+
let inputValue = optionsPreSuffixObj[value];
|
|
1303
|
+
if (!inputValue) {
|
|
1304
|
+
return callback(new Error(`请完善选项`));
|
|
1305
|
+
}
|
|
1306
|
+
}
|
|
1307
|
+
callback();
|
|
1308
|
+
},
|
|
1309
|
+
checkCheckbox(rule, value, callback, item) {
|
|
1310
|
+
if (!value || !value.length) return callback();
|
|
1311
|
+
let { options } = item;
|
|
1312
|
+
if (!options.length) return callback();
|
|
1313
|
+
let i = 0,
|
|
1314
|
+
len = value.length,
|
|
1315
|
+
v;
|
|
1316
|
+
const key = this.formKey(item);
|
|
1317
|
+
let { optionsPreSuffixObj = {} } = this.choiceComObj[key] || {};
|
|
1318
|
+
for (; i < len; i++) {
|
|
1319
|
+
v = value[i];
|
|
1320
|
+
if (v === "other") continue;
|
|
1321
|
+
let matchItem = options.find((o, j) => {
|
|
1322
|
+
if (j + 1 === v) {
|
|
1323
|
+
return true;
|
|
1324
|
+
}
|
|
1325
|
+
return false;
|
|
1326
|
+
});
|
|
1327
|
+
if (!matchItem || matchItem.importability) continue;
|
|
1328
|
+
|
|
1329
|
+
if (matchItem.prefix || matchItem.suffix) {
|
|
1330
|
+
let inputValue = optionsPreSuffixObj[v];
|
|
1331
|
+
if (!inputValue) {
|
|
1332
|
+
return callback(new Error(`请完善选项`));
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
}
|
|
1336
|
+
callback();
|
|
1337
|
+
},
|
|
1148
1338
|
handleMax(dateType, value, dateMaxValue) {
|
|
1149
1339
|
let curValue = "";
|
|
1150
1340
|
let tempValue = "";
|
|
@@ -1216,6 +1406,47 @@ export default create({
|
|
|
1216
1406
|
}
|
|
1217
1407
|
});
|
|
1218
1408
|
},
|
|
1409
|
+
async showEvaTipModal(item){
|
|
1410
|
+
if (this.evatipMap[item.id]) {
|
|
1411
|
+
this.evatipConfirm(this.evatipMap[item.id]);
|
|
1412
|
+
return;
|
|
1413
|
+
}
|
|
1414
|
+
let key = 'getSubjectAnswer'
|
|
1415
|
+
const fn = this.scaleApiConfig?.[key] || null;
|
|
1416
|
+
if(!fn || typeof fn !== 'function') {
|
|
1417
|
+
this.$message.error(`${key} Is not a function`)
|
|
1418
|
+
return
|
|
1419
|
+
}
|
|
1420
|
+
let obj = await fn(item.id)
|
|
1421
|
+
if(!obj) return;
|
|
1422
|
+
if (!this.evatipMap[item.id]) {
|
|
1423
|
+
this.evatipMap[item.id] = obj;
|
|
1424
|
+
this.evatipConfirm(obj);
|
|
1425
|
+
}
|
|
1426
|
+
},
|
|
1427
|
+
closeTip() {
|
|
1428
|
+
this.$destroyAll();
|
|
1429
|
+
},
|
|
1430
|
+
evatipConfirm(str) {
|
|
1431
|
+
let _this = this;
|
|
1432
|
+
let content = h => (
|
|
1433
|
+
<div class="evatip-container">
|
|
1434
|
+
<a-icon type="close" class="tip-content-close" on-click={_this.closeTip} />
|
|
1435
|
+
<span>答案解析:</span>
|
|
1436
|
+
<p>{str}</p>
|
|
1437
|
+
</div>
|
|
1438
|
+
);
|
|
1439
|
+
this.$confirm({
|
|
1440
|
+
title: "提示",
|
|
1441
|
+
icon: () => null,
|
|
1442
|
+
content,
|
|
1443
|
+
okText: "确定",
|
|
1444
|
+
cancelText: "关闭",
|
|
1445
|
+
onOk() {},
|
|
1446
|
+
onCancel() {},
|
|
1447
|
+
class: "evatip-modal-wrap"
|
|
1448
|
+
});
|
|
1449
|
+
},
|
|
1219
1450
|
// 选择组件
|
|
1220
1451
|
handleChoice(choiceValue, formItem) {
|
|
1221
1452
|
let { value = "", list = [] } = choiceValue;
|
|
@@ -1245,6 +1476,7 @@ export default create({
|
|
|
1245
1476
|
// 跳题逻辑
|
|
1246
1477
|
nextLogicEvent(choiceValue, formItem, formArray) {
|
|
1247
1478
|
const { nextLogic, seq } = formItem;
|
|
1479
|
+
if(!nextLogic) return;
|
|
1248
1480
|
if (nextLogic.next_logic_is) {
|
|
1249
1481
|
nextLogic.condition.some(con => {
|
|
1250
1482
|
const { value, next_subject } = con;
|
|
@@ -1312,16 +1544,15 @@ export default create({
|
|
|
1312
1544
|
? JSON.parse(formItem.relationLogic)
|
|
1313
1545
|
: formItem.relationLogic;
|
|
1314
1546
|
}
|
|
1547
|
+
if (!relationLogicObj || !Object.keys(relationLogicObj).length) return true;
|
|
1315
1548
|
const { relation_logic_is, condition, relation_logic } = relationLogicObj;
|
|
1316
1549
|
if (relation_logic_is) {
|
|
1317
1550
|
const results = condition.map(c => {
|
|
1318
1551
|
let key = this.formKey(this.formArray.filter(f => f.seq == c.subject_seq)[0]);
|
|
1319
|
-
if (utils.
|
|
1320
|
-
return c.value.includes(
|
|
1552
|
+
if (utils.isArray(form[key])) {
|
|
1553
|
+
return form[key].some(v => c.value.includes(v));
|
|
1321
1554
|
} else {
|
|
1322
|
-
|
|
1323
|
-
return form[key].some(v => c.value.includes(v));
|
|
1324
|
-
}
|
|
1555
|
+
return c.value.includes(form[key]);
|
|
1325
1556
|
}
|
|
1326
1557
|
});
|
|
1327
1558
|
if (relation_logic == "OR") {
|
|
@@ -1335,15 +1566,17 @@ export default create({
|
|
|
1335
1566
|
return formItem.isShow;
|
|
1336
1567
|
},
|
|
1337
1568
|
// 单选组件回调
|
|
1338
|
-
radioChange(val, item) {
|
|
1569
|
+
radioChange(val, item, obj) {
|
|
1339
1570
|
const key = this.formKey(item);
|
|
1340
1571
|
this.form[key] = val;
|
|
1572
|
+
item.type === "RADIO_BLOCK" && this.$set(this.choiceComObj, key, obj);
|
|
1341
1573
|
this.nextLogicEvent(val, item, this.formArray);
|
|
1342
1574
|
},
|
|
1343
1575
|
// 多选组件回调
|
|
1344
|
-
checkboxChange(val, item) {
|
|
1576
|
+
checkboxChange(val, item, obj) {
|
|
1345
1577
|
const key = this.formKey(item);
|
|
1346
1578
|
this.form[key] = val;
|
|
1579
|
+
item.type === "CHECKBOX_BLOCK" && this.$set(this.choiceComObj, key, obj);
|
|
1347
1580
|
this.nextLogicEvent(val, item, this.formArray);
|
|
1348
1581
|
},
|
|
1349
1582
|
// 标签组件回调
|
|
@@ -1473,7 +1706,8 @@ export default create({
|
|
|
1473
1706
|
if (utils.isJSON(hasSpreadParams.setting)) {
|
|
1474
1707
|
hasSpreadParams.setting = JSON.parse(hasSpreadParams.setting);
|
|
1475
1708
|
}
|
|
1476
|
-
|
|
1709
|
+
let spreadKey = this.formKey(hasSpreadParams);
|
|
1710
|
+
this.submitForm[spreadKey] = this.compileSpreadParams(
|
|
1477
1711
|
hasSpreadParams.setting.spreadParams
|
|
1478
1712
|
);
|
|
1479
1713
|
}
|
|
@@ -1495,10 +1729,11 @@ export default create({
|
|
|
1495
1729
|
scoreJson: JSON.stringify(scoreJson)
|
|
1496
1730
|
};
|
|
1497
1731
|
} else {
|
|
1498
|
-
const { guageId } = this.config;
|
|
1732
|
+
const { guageId, randomId } = this.config;
|
|
1499
1733
|
params = Object.assign(this.params, {
|
|
1500
1734
|
guageId,
|
|
1501
|
-
scoreJson: JSON.stringify(scoreJson)
|
|
1735
|
+
scoreJson: JSON.stringify(scoreJson),
|
|
1736
|
+
randomId
|
|
1502
1737
|
});
|
|
1503
1738
|
}
|
|
1504
1739
|
if (this.shareId) {
|
|
@@ -1528,26 +1763,14 @@ export default create({
|
|
|
1528
1763
|
*/
|
|
1529
1764
|
this.$emit("onSubmit", params, hasCallbackItem, isCallback);
|
|
1530
1765
|
|
|
1531
|
-
// if (hasCallbackItem && isCallback) {
|
|
1532
|
-
// let reqList = [this.saveGuageData(params)];
|
|
1533
|
-
// reqList.push(this.callBackEntrance(params));
|
|
1534
|
-
// Promise.all(reqList).then(res => {
|
|
1535
|
-
// let guageRes = res[0];
|
|
1536
|
-
// this.submitParams(guageRes);
|
|
1537
|
-
// });
|
|
1538
|
-
// } else {
|
|
1539
|
-
// this.saveGuageData(params).then(data => {
|
|
1540
|
-
// this.submitParams(data);
|
|
1541
|
-
// });
|
|
1542
|
-
// }
|
|
1543
1766
|
},
|
|
1544
1767
|
handleScoreJson() {
|
|
1545
1768
|
let tempObj = Object.assign({}, this.form, this.submitForm);
|
|
1546
1769
|
let res = {};
|
|
1547
1770
|
if (!Object.keys(tempObj).length) return {};
|
|
1548
1771
|
for (let key in tempObj) {
|
|
1549
|
-
|
|
1550
|
-
|
|
1772
|
+
let itemTemp = this.formArray.find(item => this.formKey(item) == key);
|
|
1773
|
+
if (key && itemTemp) {
|
|
1551
1774
|
let keyTemp;
|
|
1552
1775
|
if (itemTemp && itemTemp.databaseTitle) keyTemp = itemTemp.databaseTitle;
|
|
1553
1776
|
if (
|
|
@@ -1570,104 +1793,73 @@ export default create({
|
|
|
1570
1793
|
} else {
|
|
1571
1794
|
res[keyTemp || key] = !tempObj[key] ? null : tempObj[key];
|
|
1572
1795
|
}
|
|
1796
|
+
|
|
1797
|
+
|
|
1798
|
+
// 处理choice选项 将key替换为value
|
|
1799
|
+
let isChoice = ["RADIO_BLOCK", "CHECKBOX_BLOCK"].includes(itemTemp.type);
|
|
1800
|
+
if (isChoice) {
|
|
1801
|
+
let { options } = itemTemp;
|
|
1802
|
+
let useKey = this.formKey(itemTemp);
|
|
1803
|
+
let obj = this.choiceComObj[useKey];
|
|
1804
|
+
let value = tempObj[key];
|
|
1805
|
+
if (itemTemp.type === "RADIO_BLOCK" && value) {
|
|
1806
|
+
res[useKey] = this.handleChoiceItem(value, options, obj);
|
|
1807
|
+
}
|
|
1808
|
+
if (itemTemp.type === "CHECKBOX_BLOCK" && value?.length) {
|
|
1809
|
+
let resArr = this.handleCheckboxParams(value, options, obj);
|
|
1810
|
+
res[useKey] = resArr;
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
} else {
|
|
1814
|
+
res[key] = tempObj[key];
|
|
1573
1815
|
}
|
|
1574
1816
|
}
|
|
1575
1817
|
console.log("res", res);
|
|
1576
1818
|
return res;
|
|
1577
1819
|
},
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
// onCancel: onOk
|
|
1622
|
-
// });
|
|
1623
|
-
// });
|
|
1624
|
-
// }
|
|
1625
|
-
// }
|
|
1626
|
-
// this.$message.success({ content });
|
|
1627
|
-
// return Promise.resolve(true);
|
|
1628
|
-
// },
|
|
1629
|
-
// saveGuageData(params) {
|
|
1630
|
-
// let url;
|
|
1631
|
-
// if (this.type === "customList") {
|
|
1632
|
-
// url = "/definedTableList/saveDefinedListData";
|
|
1633
|
-
// } else {
|
|
1634
|
-
// url = "/guage/saveGuageData";
|
|
1635
|
-
// }
|
|
1636
|
-
// return new Promise((resolve, reject) => {
|
|
1637
|
-
// this.axios
|
|
1638
|
-
// .post(url, this.$qs.stringify(params))
|
|
1639
|
-
// .then(({ data }) => {
|
|
1640
|
-
// resolve(data);
|
|
1641
|
-
// if (data.result != "SUCCESS") {
|
|
1642
|
-
// this.$message.error(data.resultMsg);
|
|
1643
|
-
// reject(data);
|
|
1644
|
-
// } else {
|
|
1645
|
-
// resolve(data);
|
|
1646
|
-
// }
|
|
1647
|
-
// })
|
|
1648
|
-
// .catch(err => {
|
|
1649
|
-
// reject(err);
|
|
1650
|
-
// });
|
|
1651
|
-
// });
|
|
1652
|
-
// },
|
|
1653
|
-
// callBackEntrance(params) {
|
|
1654
|
-
// const url = "/guage/callBackEntrance";
|
|
1655
|
-
// return new Promise((resolve, reject) => {
|
|
1656
|
-
// this.axios
|
|
1657
|
-
// .post(url, this.$qs.stringify(params))
|
|
1658
|
-
// .then(({ data }) => {
|
|
1659
|
-
// if (data.result != "SUCCESS") {
|
|
1660
|
-
// this.$message.error(data.resultMsg);
|
|
1661
|
-
// reject(data);
|
|
1662
|
-
// } else {
|
|
1663
|
-
// resolve(data);
|
|
1664
|
-
// }
|
|
1665
|
-
// })
|
|
1666
|
-
// .catch(err => {
|
|
1667
|
-
// reject(err);
|
|
1668
|
-
// });
|
|
1669
|
-
// });
|
|
1670
|
-
// },
|
|
1820
|
+
handleCheckboxParams(value, options, obj) {
|
|
1821
|
+
let res = [];
|
|
1822
|
+
let i = 0,
|
|
1823
|
+
len = value.length,
|
|
1824
|
+
v;
|
|
1825
|
+
for (; i < len; i++) {
|
|
1826
|
+
v = value[i];
|
|
1827
|
+
let matchItem = options.find((o, i) => {
|
|
1828
|
+
if (i + 1 === v) {
|
|
1829
|
+
return true;
|
|
1830
|
+
}
|
|
1831
|
+
return false;
|
|
1832
|
+
});
|
|
1833
|
+
if (matchItem && !matchItem.prefix && !matchItem.suffix) {
|
|
1834
|
+
res.push(matchItem.value);
|
|
1835
|
+
continue;
|
|
1836
|
+
}
|
|
1837
|
+
let tempValue = this.handleChoiceItem(v, options, obj);
|
|
1838
|
+
res.push(tempValue);
|
|
1839
|
+
}
|
|
1840
|
+
return res;
|
|
1841
|
+
},
|
|
1842
|
+
handleChoiceItem(value, options, obj) {
|
|
1843
|
+
let { othersText, optionsPreSuffixObj = {} } = obj || {};
|
|
1844
|
+
if (value === "other") {
|
|
1845
|
+
return othersText || "其他";
|
|
1846
|
+
}
|
|
1847
|
+
let matchItem = options.find((o, i) => {
|
|
1848
|
+
if (i + 1 === value) {
|
|
1849
|
+
return true;
|
|
1850
|
+
}
|
|
1851
|
+
return false;
|
|
1852
|
+
});
|
|
1853
|
+
if(!matchItem) return;
|
|
1854
|
+
if (!matchItem.prefix && !matchItem.suffix) return matchItem.value;
|
|
1855
|
+
let resValue = optionsPreSuffixObj[value] || "";
|
|
1856
|
+
if (matchItem.prefix) {
|
|
1857
|
+
resValue = matchItem.prefix + resValue;
|
|
1858
|
+
} else {
|
|
1859
|
+
resValue += matchItem.suffix;
|
|
1860
|
+
}
|
|
1861
|
+
return resValue;
|
|
1862
|
+
},
|
|
1671
1863
|
resetForm() {
|
|
1672
1864
|
this.$refs.ruleForm.resetFields();
|
|
1673
1865
|
},
|
|
@@ -1677,15 +1869,6 @@ export default create({
|
|
|
1677
1869
|
handleEvaluationScore(ele) {
|
|
1678
1870
|
let { minScore = 0, maxScore = 0, scoreType } = ele.scoreConfigs || {};
|
|
1679
1871
|
return `(${maxScore}分)`;
|
|
1680
|
-
// if (scoreType === "correctAnswerScore") return `(${maxScore}分)`;
|
|
1681
|
-
// if (minScore === maxScore) return `(${maxScore}分)`;
|
|
1682
|
-
// if (ele.type === "EVALUATE_INPUT") {
|
|
1683
|
-
// if (maxScore == 0) {
|
|
1684
|
-
// return `(${maxScore}分)`;
|
|
1685
|
-
// }
|
|
1686
|
-
// return `(0-${maxScore}分)`;
|
|
1687
|
-
// }
|
|
1688
|
-
// return `(${minScore}-${maxScore}分)`;
|
|
1689
1872
|
}
|
|
1690
1873
|
}
|
|
1691
1874
|
});
|
|
@@ -1801,6 +1984,18 @@ export default create({
|
|
|
1801
1984
|
border: 1px solid rgba(45, 122, 255, 0.5);
|
|
1802
1985
|
background: rgba(45, 122, 255, 0.1);
|
|
1803
1986
|
}
|
|
1987
|
+
.evalute-tip {
|
|
1988
|
+
display: inline-block;
|
|
1989
|
+
padding: 0 5px;
|
|
1990
|
+
margin-left: 8px;
|
|
1991
|
+
color: #fe9626;
|
|
1992
|
+
border-radius: 2px;
|
|
1993
|
+
background: rgba(255, 194, 0, 0.15);
|
|
1994
|
+
cursor: pointer;
|
|
1995
|
+
.ant-icon {
|
|
1996
|
+
margin-right: 2px;
|
|
1997
|
+
}
|
|
1998
|
+
}
|
|
1804
1999
|
/deep/ .ant-form-item-label {
|
|
1805
2000
|
// white-space: break-spaces;
|
|
1806
2001
|
white-space: unset;
|