| | |
| | | ></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 v-if="topicobj.scriptType != 4"> |
| | | <div class="headline"> |
| | | 选项设置<span style="margin-left: 30px" |
| | | ><el-button type="primary" round @click="addoption" |
| | | >+新增</el-button |
| | | ></span |
| | | > |
| | | </div> |
| | | <div> |
| | | <el-divider></el-divider> |
| | | <div v-if="topicobj.scriptType != 4"> |
| | | <div class="headline"> |
| | | 选项设置<span style="margin-left: 30px" |
| | | ><el-button type="primary" round @click="addoption" |
| | | >+新增</el-button |
| | | ></span |
| | | > |
| | | </div> |
| | | <div |
| | | class="topicxq" |
| | | v-for="item in topicobj.svyLibScriptOptions" |
| | | v-if="item.isoperation != 3" |
| | | > |
| | | <el-row :gutter="10"> |
| | | <el-col :span="11" |
| | | ><el-form-item label="选项名称"> |
| | | <el-input |
| | | type="text" |
| | | placeholder="请输入选项分值" |
| | | v-model="item.optioncontent" |
| | | show-word-limit |
| | | > |
| | | </el-input> </el-form-item |
| | | ></el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item v-if="topicobj.scoretype == 1" label="分值"> |
| | | <el-input |
| | | type="text" |
| | | placeholder="请输入选项分值" |
| | | v-model="item.score" |
| | | show-word-limit |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="topicobj.scoretype == 2" |
| | | label="ABC等级" |
| | | > |
| | | <el-radio-group v-model="item.score"> |
| | | <el-radio label="A">A</el-radio> |
| | | <el-radio label="B">B</el-radio> |
| | | <el-radio label="C">C</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="topicobj.scoretype == 3" |
| | | label="优良等级" |
| | | > |
| | | <el-radio-group v-model="item.score"> |
| | | <el-radio label="优">优</el-radio> |
| | | <el-radio label="良">良</el-radio> |
| | | <el-radio label="差">差</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <div |
| | | class="topicxq" |
| | | v-for="item in topicobj.svyLibScriptOptions" |
| | | v-if="item.isoperation != 3" |
| | | > |
| | | <el-row :gutter="10"> |
| | | <el-col :span="11" |
| | | ><el-form-item label="选项名称"> |
| | | <el-input |
| | | type="text" |
| | | placeholder="请输入选项分值" |
| | | v-model="item.optioncontent" |
| | | show-word-limit |
| | | > |
| | | </el-input> </el-form-item |
| | | ></el-col> |
| | | <el-col :span="11"> |
| | | <el-form-item v-if="topicobj.scoretype == 1" label="分值"> |
| | | <el-input |
| | | type="text" |
| | | placeholder="请输入选项分值" |
| | | v-model="item.score" |
| | | show-word-limit |
| | | > |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="topicobj.scoretype == 2" |
| | | label="ABC等级" |
| | | <el-col |
| | | :span="2" |
| | | :offsset="topicobj.scoretype == 4 ? 11 : 0" |
| | | > |
| | | <el-radio-group v-model="item.score"> |
| | | <el-radio label="A">A</el-radio> |
| | | <el-radio label="B">B</el-radio> |
| | | <el-radio label="C">C</el-radio> |
| | | <el-button |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | circle |
| | | @click="deletexuanx(item)" |
| | | ></el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="10"> |
| | | <el-form-item label="预警提醒"> |
| | | <el-radio-group v-model="item.isabnormal"> |
| | | <el-radio :label="1">是</el-radio> |
| | | <el-radio :label="0">否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item |
| | | v-else-if="topicobj.scoretype == 3" |
| | | label="优良等级" |
| | | > |
| | | <el-radio-group v-model="item.score"> |
| | | <el-radio label="优">优</el-radio> |
| | | <el-radio label="良">良</el-radio> |
| | | <el-radio label="差">差</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | <el-col :span="2" :offsset="topicobj.scoretype == 4 ? 11 : 0"> |
| | | <el-button |
| | | type="danger" |
| | | icon="el-icon-delete" |
| | | circle |
| | | @click="deletexuanx(item)" |
| | | ></el-button> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="10"> |
| | | <el-form-item label="预警提醒"> |
| | | <el-radio-group v-model="item.isabnormal"> |
| | | <el-radio :label="1">是</el-radio> |
| | | <el-radio :label="0">否</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-row> |
| | | <el-row :gutter="10"> |
| | | <el-form-item label="选中提示"> |
| | | <el-input |
| | | style="width: 40vw" |
| | | type="textarea" |
| | | autosize |
| | | placeholder="请输入内容" |
| | | v-model="item.prompt" |
| | | > |
| | | </el-input |
| | | ></el-form-item> |
| | | </el-row> |
| | | <el-form-item label="选项文件" prop="sickness"> |
| | | <div style="width: 40vw"> |
| | | <el-upload |
| | | class="upload-demo" |
| | | :action="uploadImgUrl" |
| | | :headers="headers" |
| | | accept=".jpg,.png,image/*" |
| | | :on-success="handleChange.bind(this, item)" |
| | | > |
| | | <el-button size="small" type="primary" |
| | | >点击上传</el-button |
| | | </el-row> |
| | | <el-row :gutter="10"> |
| | | <el-form-item label="选中提示"> |
| | | <el-input |
| | | style="width: 40vw" |
| | | type="textarea" |
| | | autosize |
| | | placeholder="请输入内容" |
| | | v-model="item.prompt" |
| | | > |
| | | </el-upload> |
| | | <div style="margin: 20px"> |
| | | <el-image |
| | | style="width: 100px; height: 100px" |
| | | :src="item.picturePath" |
| | | :preview-src-list="[...item.picturePath]" |
| | | </el-input |
| | | ></el-form-item> |
| | | </el-row> |
| | | <el-form-item label="选项文件" prop="sickness"> |
| | | <div style="width: 40vw"> |
| | | <el-upload |
| | | class="upload-demo" |
| | | :action="uploadImgUrl" |
| | | :headers="headers" |
| | | accept=".jpg,.png,image/*" |
| | | :on-success="handleChange.bind(this, item)" |
| | | > |
| | | </el-image> |
| | | <el-button size="small" type="primary" |
| | | >点击上传</el-button |
| | | > |
| | | </el-upload> |
| | | <div style="margin: 20px"> |
| | | <el-image |
| | | style="width: 100px; height: 100px" |
| | | :src="item.picturePath" |
| | | :preview-src-list="[...item.picturePath]" |
| | | > |
| | | </el-image> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | </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; |
| | | this.topicobj.categoryid = Number(this.$route.query.categoryid); |
| | | console.log(this.topicobj.categoryid); |
| | | |
| | | if (this.$route.query.categoryid) { |
| | | this.topicobj.categoryid = Number(this.$route.query.categoryid); |
| | | } |
| | | this.topicobj.isavailable = "1"; |
| | | this.topicobj.language = "普通话"; |
| | | // 分类 |
| | |
| | | // 判断分值 |
| | | Scorejudgment() { |
| | | let scorearr = this.topicobj.svyLibScriptOptions; |
| | | let isValid = scorearr.every((score) => { |
| | | if (score.score) { |
| | | console.log(Number(score.score), this.topicobj.score, "分值"); |
| | | if ( |
| | | Number(score.score) < 0 || |
| | | Number(score.score) > Number(this.topicobj.score) |
| | | ) { |
| | | console.log(score, "错误分值"); |
| | | let isValid = scorearr.every((score, index) => { |
| | | if (this.topicobj.scriptType == 1) { |
| | | if (score.score) { |
| | | if ( |
| | | Number(score.score) < 0 || |
| | | Number(score.score) > Number(this.topicobj.score) |
| | | ) { |
| | | console.log(score, "错误分值"); |
| | | this.$message({ |
| | | message: "选项分值必须在0到" + this.topicobj.score + "分之间", |
| | | type: "warning", |
| | | }); |
| | | return false; |
| | | } |
| | | return true; |
| | | } else { |
| | | this.$message({ |
| | | message: "选项分值必须在0到" + this.topicobj.score + "分之间", |
| | | message: "选项分值未设置", |
| | | type: "warning", |
| | | }); |
| | | 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; |
| | | } else if (this.topicobj.scriptType == 3) { |
| | | return true; |
| | | } else { |
| | | this.$message({ |
| | | message: "选项分值未设置", |
| | | type: "warning", |
| | | }); |
| | | return false; |
| | | } |
| | | }); |
| | | |
| | | 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); |