From e416429087c94e2247bd143715b10fb1a124286a Mon Sep 17 00:00:00 2001
From: wangxiaoshuang <825034831@qq.com>
Date: Fri, 10 May 2024 14:54:24 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BB=B2=E8=A3=81=E8=A7=84=E5=88=99=E6=B7=BB?=
=?UTF-8?q?=E5=8A=A0=E9=85=8D=E7=BD=AE=E9=A1=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/ArbitrationRules.vue | 85 ++++++++++++++++---
1 file changed, 75 insertions(+), 10 deletions(-)
diff --git a/src/views/trials/trials-panel/setting/reading-unit/components/ArbitrationRules.vue b/src/views/trials/trials-panel/setting/reading-unit/components/ArbitrationRules.vue
index 0e9cc260..dd2729d8 100644
--- a/src/views/trials/trials-panel/setting/reading-unit/components/ArbitrationRules.vue
+++ b/src/views/trials/trials-panel/setting/reading-unit/components/ArbitrationRules.vue
@@ -26,7 +26,7 @@
{{ $t('common:button:reset') }}
-
+ JudgeTypeChange(val,index)">
{{ item.label }}
@@ -102,7 +102,9 @@
- {{ item.label }}
+
+ {{ item.label }}
+
{{ item }}
@@ -127,6 +129,13 @@
+
+
+
+
+
+
+
@@ -145,15 +154,23 @@
- {{ item }}
- {{ item.label }}
+
+ {{ item }}
+
+
+ {{ item.label }}
+
- {{ item }}
- {{ item.label }}
+
+ {{ item }}
+
+
+ {{ item.label }}
+
@@ -206,7 +223,35 @@ export default {
OtherInfo: {
IsSign: true
},
- JudgyInfo: {}
+ JudgyInfo: {},
+ JudgeDifferenceValueQRules:{
+ JudgeDifferenceValue:[
+ {
+ required: true,
+ message: this.$t(
+ "trials:trials-list:setitng:JudgeDifferenceValueRequired"
+ ),
+ trigger: "blur",
+ },
+ {
+ pattern: /^[0-9]+(.[0-9]{2})?$/,
+ message: this.$t(
+ "trials:trials-list:setitng:JudgeDifferenceValue"
+ ),
+ trigger: "blur",
+ },
+ {
+ validator: (rule, value, callback) => {
+ if (value <= 0) {
+ callback(new Error(this.$t("trials:trials-list:setitng:JudgeDifferenceValueMin")));
+ } else {
+ callback();
+ }
+ },
+ trigger: "blur",
+ },
+ ]
+ },
}
},
watch: {
@@ -240,6 +285,16 @@ export default {
this.getTrialJudgyInfo()
},
methods: {
+ JudgeTypeChange(value,index){
+ this.$nextTick(()=>{
+ if(value===4||value===5){
+ if(this.$refs['JudgeDifferenceValue'+value+index][0]){
+ this.$refs['JudgeDifferenceValue'+value+index][0].resetFields();
+ // this.QuestionList[index].JudgeDifferenceValue = 0;
+ }
+ }
+ })
+ },
saveAllSync() {
return new Promise((resolve, reject) => {
var arr = []
@@ -379,7 +434,8 @@ export default {
ReadingQuestionTrialId: ReadingQuestionTrialId,
AnswerGroup: [],
AnswerCombination: [],
- JudgeType: 0
+ JudgeType: 0,
+ JudgeDifferenceValue:0,
}).then(res => {
this.$set(this.QuestionList[index], 'AnswerGroup2List', [])
this.$set(this.QuestionList[index], 'AnswerGroupList', [])
@@ -393,7 +449,7 @@ export default {
})
})
},
- apply(ReadingQuestionTrialId, index) {
+ async apply(ReadingQuestionTrialId, index) {
if (this.QuestionList[index].JudgeType === 0) {
this.$alert(this.$t('trials:adRules:message:msg8'))// '请先配置规则才能应用'
return
@@ -406,13 +462,22 @@ export default {
this.$alert(this.$t('trials:adRules:message:msg8'))
return
}
+ if (this.QuestionList[index].JudgeType === 4||this.QuestionList[index].JudgeType === 5) {
+ try{
+ let validate = await this.$refs['JudgeDifferenceValue'+this.QuestionList[index].JudgeType+index][0].validate();
+ if(!validate) return;
+ }catch(err){
+ return;
+ }
+ }
this.btnLoading = true
this.loading = true
setTrialCriterionJudgeQuestionAnswerGroup({
ReadingQuestionTrialId: ReadingQuestionTrialId,
AnswerGroup: this.QuestionList[index].AnswerGroup2List,
AnswerCombination: this.QuestionList[index].AnswerGroupList,
- JudgeType: this.QuestionList[index].JudgeType
+ JudgeType: this.QuestionList[index].JudgeType,
+ JudgeDifferenceValue:Number(this.QuestionList[index].JudgeDifferenceValue),
}).then(res => {
this.$message.success(this.$t('trials:adRules:message:msg9'))// '应用成功'
this.btnLoading = false