| | |
| | | ></el-col> |
| | | <el-col :span="8" |
| | | ><el-form-item label="是否可用"> |
| | | <el-radio-group v-model="topicobj.isAvailable"> |
| | | <el-radio-group v-model="topicobj.isavailable"> |
| | | <el-radio |
| | | v-for="(item, index) in usable" |
| | | :label="item.value" |
| | |
| | | topicobj.targetname ? "修改指标" : "+选择指标" |
| | | }}</el-button></span |
| | | > |
| | | <span style="margin-left: 30px" |
| | | ><el-button type="primary" @click="Saveproblem" |
| | | >保 存</el-button |
| | | > |
| | | </span> |
| | | </div> |
| | | <el-divider></el-divider> |
| | | <el-form ref="form"> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div> |
| | | <el-divider></el-divider> |
| | | <div v-if="topicobj.scriptType != 4"> |
| | | <div class="headline"> |
| | | 选项设置<span style="margin-left: 30px" |
| | |
| | | ></span |
| | | > |
| | | </div> |
| | | <el-divider></el-divider> |
| | | |
| | | <div |
| | | class="topicxq" |
| | | v-for="item in topicobj.svyLibScriptOptions" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="2" :offsset="topicobj.scoretype == 4 ? 11 : 0"> |
| | | <el-col |
| | | :span="2" |
| | | :offsset="topicobj.scoretype == 4 ? 11 : 0" |
| | | > |
| | | <el-button |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | <div v-else class="topicxq"> |
| | | <el-input |
| | |
| | | <el-table-column |
| | | label="是否可用" |
| | | align="center" |
| | | key="isAvailable" |
| | | prop="isAvailable" |
| | | key="isavailable" |
| | | prop="isavailable" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <dict-tag :options="usable" :value="scope.row.isAvailable" /> |
| | | <dict-tag :options="usable" :value="scope.row.isavailable" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | |
| | | { value: "scriptTopic", table: "scriptTopic" }, |
| | | ], |
| | | inputValueillness: "", |
| | | testgovalue: "", |
| | | required: [], |
| | | themelist: [], |
| | | languagelist: [], |
| | |
| | | // 获取数据 |
| | | getissueinfo() { |
| | | this.id = this.$route.query.id; |
| | | if (this.$route.query.categoryid) { |
| | | this.topicobj.categoryid = Number(this.$route.query.categoryid); |
| | | console.log(this.topicobj.categoryid); |
| | | |
| | | } |
| | | this.topicobj.isavailable = "1"; |
| | | this.topicobj.language = "普通话"; |
| | | // 分类 |
| | |
| | | // 判断分值 |
| | | Scorejudgment() { |
| | | let scorearr = this.topicobj.svyLibScriptOptions; |
| | | let isValid = scorearr.every((score) => { |
| | | let isValid = scorearr.every((score, index) => { |
| | | if (this.topicobj.scriptType == 1) { |
| | | if (score.score) { |
| | | console.log(Number(score.score), this.topicobj.score, "分值"); |
| | | if ( |
| | | Number(score.score) < 0 || |
| | | Number(score.score) > Number(this.topicobj.score) |
| | |
| | | return false; |
| | | } |
| | | return true; |
| | | } else if (this.topicobj.scriptType == 3) { |
| | | return true; |
| | | } else { |
| | | this.$message({ |
| | | message: "选项分值未设置", |
| | |
| | | }); |
| | | return false; |
| | | } |
| | | } else if (this.topicobj.scriptType == 2) { |
| | | // 累加分值 |
| | | const totalScore = scorearr.reduce((acc, score) => { |
| | | if (score.score) { |
| | | return acc + Number(score.score); |
| | | } |
| | | return acc; // 如果 score.score 不存在,不累加 |
| | | }, 0); |
| | | |
| | | // 检查累加的分值是否等于 this.topicobj.score |
| | | if (totalScore !== Number(this.topicobj.score)) { |
| | | this.$message({ |
| | | message: |
| | | "多选题选项分值总和必须等于 " + this.topicobj.score + " 分", |
| | | type: "warning", |
| | | }); |
| | | return false; |
| | | } |
| | | return true; // 如果总分正确,返回 true |
| | | } else if (this.topicobj.scriptType == 4) { |
| | | return true; |
| | | } |
| | | }); |
| | | |
| | | if (isValid) { |
| | | this.compileissue(); |
| | | // console.log("到保存了"); |
| | | } |
| | | }, |
| | | Saveproblem() { |
| | |
| | | // 判断指标 |
| | | changefn(item) { |
| | | console.log(item); |
| | | |
| | | if (this.topicobj.targetname || this.topicobj.svyLibScriptOptions[0]) { |
| | | this.$modal |
| | | .confirm("更改类型后选项将清空是否继续?") |
| | | .then(() => { |
| | | this.scriptTypels = this.topicobj.scriptType; |
| | | this.topicobj.svyLibScriptOptions = []; |
| | | this.topicobj.svyLibScriptOptions.forEach((item) => { |
| | | item.isoperation = 3; |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | this.topicobj.scriptType = this.scriptTypels; |
| | |
| | | console.log(this.topicobj.svyLibScriptOptions); |
| | | |
| | | if (this.topicobj.svyLibScriptOptions[index].id) { |
| | | console.log(2); |
| | | |
| | | this.topicobj.svyLibScriptOptions[index].isoperation = 3; |
| | | } else { |
| | | this.topicobj.svyLibScriptOptions.splice(index, 1); |
| | |
| | | tagcategoryid: "0", |
| | | }; |
| | | listtag(tagqueryParams).then((response) => { |
| | | console.log(response, "待选标签"); |
| | | this.optionstag = response.rows; |
| | | }); |
| | | }, |
| | | handleClosetag(tag) { |
| | | console.log(tag); |
| | | console.log(this.dynamicTags.indexOf(tag)); |
| | | const lindex = this.dynamicTags.indexOf(tag); |
| | | this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1); |
| | |
| | | border-radius: 4px; |
| | | margin-top: 15px; |
| | | margin-left: 10%; |
| | | padding-left: 20px; |
| | | padding-top: 15px; |
| | | padding: 20px; |
| | | border: 1px solid #dcdfe6; |
| | | -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), |
| | | 0 0 6px 0 rgba(0, 0, 0, 0.04); |