From 43bb1026f5e6b04e790662361711c40f3499c2a9 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期三, 10 七月 2024 16:02:35 +0800 Subject: [PATCH] 测试完成 --- src/views/knowledge/questionbank/particulars/index.vue | 96 +++++++++++++++++++++++++++++++++++++----------- 1 files changed, 74 insertions(+), 22 deletions(-) diff --git a/src/views/knowledge/questionbank/particulars/index.vue b/src/views/knowledge/questionbank/particulars/index.vue index f7e1da4..b8c97b5 100644 --- a/src/views/knowledge/questionbank/particulars/index.vue +++ b/src/views/knowledge/questionbank/particulars/index.vue @@ -6,9 +6,9 @@ <div class="headline"> 棰樼洰璁剧疆璇︽儏 <span style="margin-left: 30px" - ><el-button type="primary" @click="compileissue" + ><el-button type="primary" @click="Saveproblem" >淇� 瀛�</el-button - ></span + > </span ><span style="margin-left: 30px" ><el-button type="success" round @click="drawer = true" >+閫夋嫨鎸囨爣</el-button @@ -17,7 +17,7 @@ </div> <div style="margin-left: 8%"> <el-row :gutter="10"> - <el-col :span="10"> + <el-col :span="8"> <el-form-item label="闂鍒嗙被"> <el-select v-model="topicobj.categoryid" @@ -41,7 +41,7 @@ </el-select> </el-form-item> </el-col> - <el-col :span="10"> + <el-col :span="8"> <el-form-item label="璇勪环绫诲瀷"> <el-select v-model="topicobj.scoretype" @@ -57,13 +57,21 @@ </el-select> </el-form-item> </el-col> + <el-col :span="8" v-if="topicobj.scoretype == 1"> + <el-form-item label="棰樼洰寰楀垎"> + <el-input + v-model="topicobj.score" + placeholder="璇疯緭鍏ュ垎鏁�" + ></el-input> + </el-form-item> + </el-col> </el-row> <el-row :gutter="10"> <el-col :span="8" ><el-form-item label="棰樼洰鏍囬"> <el-input - v-model="topicobj.topic" + v-model="topicobj.scriptTopic" placeholder="璇疯緭鍏ユ爣棰�" ></el-input> </el-form-item ></el-col> @@ -126,7 +134,7 @@ <el-col :span="8" ><el-form-item label="棰樼洰绫诲瀷"> <el-select - v-model="topicobj.scripttype" + v-model="topicobj.scriptType" size="medium" filterable placeholder="璇烽�夋嫨鍒嗙被" @@ -164,9 +172,9 @@ <el-input style="width: 40vw" type="textarea" - id="script" - v-model="topicobj.script" - @focus="handleInput('script')" + id="scriptContent" + v-model="topicobj.scriptContent" + @focus="handleInput('scriptContent')" placeholder="璇疯緭鍏ラ鐩唴瀹�" ></el-input> </el-form-item> @@ -174,7 +182,7 @@ <el-input style="width: 40vw" type="textarea" - v-model="topicobj.scriptContent" + v-model="topicobj.scriptDesc" placeholder="璇疯緭鍏ヨ鏄�" ></el-input> </el-form-item> @@ -314,7 +322,7 @@ </el-col></el-row > --> </div> - <div v-if="topicobj.valueType == 1"> + <div v-if="topicobj.scriptType != 3"> <div class="headline"> 閫夐」璁剧疆<span style="margin-left: 30px" ><el-button type="primary" round @click="addoption" @@ -526,9 +534,9 @@ isavailable: "", }, optionlist: [ - { value: "topic", table: "topic" }, - { value: "topic", table: "topic" }, - { value: "topic", table: "topic" }, + { value: "scriptTopic", table: "scriptTopic" }, + { value: "scriptTopic", table: "scriptTopic" }, + { value: "scriptTopic", table: "scriptTopic" }, ], inputValueillness: "", required: [], @@ -559,7 +567,6 @@ created() { this.gettabList(); this.getissueinfo(); - this.test(); this.gettargetInfo(); this.mode = store.getters.mode; this.languagelist = store.getters.languagelist; @@ -626,7 +633,6 @@ }, // 鏂板鎴栦慨鏀硅鎯� compileissue() { - console.log(11223); this.topicobj.svyLibScriptOptions = this.topicobj.svyLibScriptOptions.map( (item) => { if (item.isoperation != 1 && item.isoperation != 3) { @@ -680,6 +686,52 @@ deltargetillness(this.illnesslistapi.join(",")).then((res) => {}); } }, + // 鍒ゆ柇鍒嗗�� + 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, "閿欒鍒嗗��"); + this.$message({ + message: "閫夐」鍒嗗�煎繀椤诲ぇ浜�0灏忎簬绛変簬" + this.topicobj.score + "鍒�", + type: "warning", + }); + return false; + } + 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() { + if (this.topicobj.scoretype == 1) { + console.log(321); + this.Scorejudgment(); + } else { + this.compileissue(); + } + }, + // 鍒犻櫎鏍囩 + handleClose(tag) { + this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1); + }, // 鍒犻櫎閫夐」 deletexuanx(row) { const index = this.getIndexInArray( @@ -709,7 +761,7 @@ .then(() => { console.log(row); console.log(this.topicobj); - this.topicobj.topic = row.targetname; + this.topicobj.scriptTopic = row.targetname; this.topicobj.valueType = row.valueType; this.topicobj.scriptContent = row.targetdesc; this.topicobj.isavailable = "0"; @@ -846,8 +898,8 @@ let inputValueArr = ""; let el = document.querySelector("#" + this.currentInputId); //el.selectionStart; 杩欏氨鏄綋鍓嶅厜鏍囨墍鍦ㄧ殑浣嶇疆锛堝瓧绗︿覆涓瓧绗︾殑index锛� - if (this.currentInputId == "script") { - inputValueArr = this.topicobj.script.split(""); + if (this.currentInputId == "scriptContent") { + inputValueArr = this.topicobj.scriptContent.split(""); console.log(123); } else if (this.currentInputId == "nomatchtext") { inputValueArr = this.topicobj.nomatchtext.split(""); @@ -869,8 +921,8 @@ // 鎶婃暟缁勯噸鏂拌浆鎹负瀛楃涓插苟璧嬪�� inputValueArr = inputValueArr.join(""); console.log(inputValueArr); - if (this.currentInputId == "script") { - this.topicobj.script = inputValueArr; + if (this.currentInputId == "scriptContent") { + this.topicobj.scriptContent = inputValueArr; } else if (this.currentInputId == "nomatchtext") { this.topicobj.nomatchtext = inputValueArr; } else if (this.currentInputId == "sliencetext") { @@ -1025,7 +1077,7 @@ 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); - .topic-dev { + .scriptTopic-dev { margin-bottom: 25px; font-size: 20px !important; .dev-text { -- Gitblit v1.9.3