From 55f9876e876c7ddfcc2a7a2b870dfc224c9467a6 Mon Sep 17 00:00:00 2001
From: WXL (wul) <wl_5969728@163.com>
Date: 星期三, 01 四月 2026 17:28:43 +0800
Subject: [PATCH] 测试完成
---
src/views/knowledge/questionbank/particulars/index.vue | 268 ++++++++++++++++++++++++++++++-----------------------
1 files changed, 152 insertions(+), 116 deletions(-)
diff --git a/src/views/knowledge/questionbank/particulars/index.vue b/src/views/knowledge/questionbank/particulars/index.vue
index bf5f9c8..880f6bd 100644
--- a/src/views/knowledge/questionbank/particulars/index.vue
+++ b/src/views/knowledge/questionbank/particulars/index.vue
@@ -23,7 +23,13 @@
</div>
<div v-if="Editprogress == 1">
<el-card class="box-card">
- <el-form :inline="true" ref="topicobj" :model="topicobj" :rules="rules" class="demo-form-inline">
+ <el-form
+ :inline="true"
+ ref="topicobj"
+ :model="topicobj"
+ :rules="rules"
+ class="demo-form-inline"
+ >
<div class="headline">
鍩虹淇℃伅閰嶇疆
<span style="margin-left: 30px"
@@ -40,6 +46,24 @@
<el-divider></el-divider>
<div style="margin-left: 8%">
+ <el-form-item label="闂鍐呭" prop="scriptContent">
+ <el-input
+ style="width: 40vw"
+ type="textarea"
+ id="scriptContent"
+ v-model="topicobj.scriptContent"
+ @focus="handleInput('scriptContent')"
+ placeholder="璇疯緭鍏ラ棶棰樺唴瀹�"
+ ></el-input>
+ </el-form-item>
+ <el-form-item label="闂璇存槑" prop="targetname">
+ <el-input
+ style="width: 40vw"
+ type="textarea"
+ v-model="topicobj.scriptDesc"
+ placeholder="璇疯緭鍏ヨ鏄�"
+ ></el-input>
+ </el-form-item>
<el-row :gutter="10">
<el-col :span="8">
<el-form-item label="闂鍒嗙被" prop="categoryid">
@@ -47,6 +71,7 @@
v-model="topicobj.categoryid"
size="medium"
filterable
+ @change="categoryidChange"
placeholder="璇烽�夋嫨鍒嗙被"
>
<el-option-group
@@ -69,7 +94,7 @@
<el-form-item label="璇勪环绫诲瀷" prop="scoretype">
<el-select
v-model="topicobj.scoretype"
- placeholder="璇烽�夋嫨鍒嗙被"
+ placeholder="璇烽�夋嫨绫诲瀷"
>
<el-option
v-for="group in appraiselist"
@@ -82,7 +107,7 @@
</el-form-item>
</el-col>
<el-col :span="8" v-if="topicobj.scoretype == 1">
- <el-form-item label="棰樼洰寰楀垎" prop="score">
+ <el-form-item label="闂寰楀垎" prop="score">
<el-input
v-model="topicobj.score"
placeholder="璇疯緭鍏ュ垎鏁�"
@@ -93,7 +118,7 @@
<el-row :gutter="10">
<el-col :span="8"
- ><el-form-item label="棰樼洰鏍囬" prop="scriptTopic">
+ ><el-form-item label="闂鏍囬" prop="scriptTopic">
<el-input
v-model="topicobj.scriptTopic"
placeholder="璇疯緭鍏ユ爣棰�"
@@ -103,7 +128,7 @@
><el-form-item label="鏄惁鍙敤" prop="isavailable">
<el-radio-group v-model="topicobj.isavailable">
<el-radio
- @change="$forceUpdate()"
+ @change="$forceUpdate()"
v-for="(item, index) in usable"
:label="item.value"
>{{ item.label }}</el-radio
@@ -125,33 +150,14 @@
</el-col> -->
</el-row>
<el-row :gutter="10">
- <el-col :span="8">
- <el-form-item label="璇█" prop="language">
- <el-select
- v-model="topicobj.language"
- size="medium"
- filterable
- placeholder="璇烽�夋嫨鍒嗙被"
- >
- <el-option
- class="topicobjaa"
- v-for="item in languagelist"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- >
- </el-option>
- </el-select>
- </el-form-item>
- </el-col>
<el-col :span="8"
- ><el-form-item label="棰樼洰绫诲瀷" prop="scriptType">
+ ><el-form-item label="闂绫诲瀷" prop="scriptType">
<el-select
v-model="topicobj.scriptType"
@change="changefn"
size="medium"
filterable
- placeholder="璇烽�夋嫨鍒嗙被"
+ placeholder="璇烽�夋嫨绫诲瀷"
>
<el-option
class="topicobjaa"
@@ -179,17 +185,27 @@
>
</el-option> </el-select></el-form-item
></el-col>
+ <el-col :span="8">
+ <el-form-item label="璇█" prop="language">
+ <el-select
+ v-model="topicobj.language"
+ size="medium"
+ filterable
+ placeholder="璇烽�夋嫨"
+ >
+ <el-option
+ class="topicobjaa"
+ v-for="item in languagelist"
+ :key="item.value"
+ :label="item.label"
+ :value="item.value"
+ >
+ </el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
</el-row>
- <el-form-item label="棰樼洰鍐呭" prop="scriptContent">
- <el-input
- style="width: 40vw"
- type="textarea"
- id="scriptContent"
- v-model="topicobj.scriptContent"
- @focus="handleInput('scriptContent')"
- placeholder="璇疯緭鍏ラ鐩唴瀹�"
- ></el-input>
- </el-form-item>
+
<!-- <el-form-item
label=""
prop="scriptContent"
@@ -235,14 +251,6 @@
</el-form-item>
</el-col>
</el-row> -->
- <el-form-item label="棰樼洰璇存槑" prop="targetname">
- <el-input
- style="width: 40vw"
- type="textarea"
- v-model="topicobj.scriptDesc"
- placeholder="璇疯緭鍏ヨ鏄�"
- ></el-input>
- </el-form-item>
<!-- <el-form-item label="閫変腑鎸囨爣锛�">
<span style="margin-left: 30px"
@@ -325,7 +333,9 @@
<el-image
style="width: 100px; height: 100px"
:src="topicobj.picturePath"
- :preview-src-list="[...topicobj.picturePath]"
+ :preview-src-list="
+ topicobj.picturePath ? [topicobj.picturePath] : []
+ "
>
</el-image>
</div>
@@ -337,7 +347,12 @@
</div>
<div v-if="Editprogress == 2">
<el-card class="box-card">
- <el-form :inline="true" :model="topicobj" class="demo-form-inline">
+ <el-form
+ :inline="true"
+ ref="topicobj"
+ :model="topicobj"
+ class="demo-form-inline"
+ >
<div class="headline">
鎸囨爣璁剧疆璇︽儏
<span v-if="topicobj.targetname" style="margin-left: 30px"
@@ -383,7 +398,7 @@
<el-row>
<el-col :span="10">
- <el-form-item label="鍊肩被鍨�">
+ <el-form-item label="缁撴灉绫诲瀷">
<el-radio-group
:disabled="true"
v-model="topicobj.valueType"
@@ -395,7 +410,7 @@
</el-form-item>
</el-col>
<el-col :span="12">
- <el-form-item label="棰樼洰绫诲瀷">
+ <el-form-item label="闂棰樺瀷">
<el-radio-group
:disabled="true"
v-model="topicobj.scriptType"
@@ -449,9 +464,9 @@
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 :label="1">A</el-radio>
+ <el-radio :label="2">B</el-radio>
+ <el-radio :label="3">C</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item
@@ -479,7 +494,7 @@
</el-col>
</el-row>
<el-row :gutter="10">
- <el-form-item label="棰勮鎻愰啋">
+ <el-form-item label="寮傚父鎻愰啋">
<el-radio-group v-model="item.isabnormal">
<el-radio :label="1">鏄�</el-radio>
<el-radio :label="0">鍚�</el-radio>
@@ -515,7 +530,9 @@
<el-image
style="width: 100px; height: 100px"
:src="item.picturePath"
- :preview-src-list="[...item.picturePath]"
+ :preview-src-list="
+ item.picturePath ? [item.picturePath] : []
+ "
>
</el-image>
</div>
@@ -666,7 +683,7 @@
/>
</div>
</el-drawer>
- <el-dialog title="棰樼洰棰勮" :visible.sync="topicVisible" width="50%">
+ <el-dialog title="闂棰勮" :visible.sync="topicVisible" width="50%">
<div class="preview-left">
<div class="dev-text">
<span>{{ topicobj.scriptContent }}</span>
@@ -724,8 +741,8 @@
svyLibScriptOptions: [],
svyLibScriptTagList: [],
suitway: "1",
- scoretype:'4',
- language:'鏅�氳瘽',
+ scoretype: "4",
+ language: "鏅�氳瘽",
},
headers: {
Authorization: "Bearer " + getToken(),
@@ -808,19 +825,19 @@
{ required: true, message: "鍙敤鐘舵�佷笉鑳戒负绌�", trigger: "blur" },
],
scriptTopic: [
- { required: true, message: "棰樼洰鏍囬涓嶈兘涓虹┖", trigger: "blur" },
+ { required: true, message: "闂鏍囬涓嶈兘涓虹┖", trigger: "blur" },
],
ismandatory: [
{ required: true, message: "鏄惁蹇呭~涓嶈兘涓虹┖", trigger: "blur" },
],
scriptType: [
- { required: true, message: "棰樼洰绫诲瀷涓嶈兘涓虹┖", trigger: "blur" },
+ { required: true, message: "闂绫诲瀷涓嶈兘涓虹┖", trigger: "blur" },
],
suitway: [
{ required: true, message: "閫傜敤鏂瑰紡涓嶈兘涓虹┖", trigger: "blur" },
],
scriptContent: [
- { required: true, message: "棰樼洰鍐呭涓嶈兘涓虹┖", trigger: "blur" },
+ { required: true, message: "闂鍐呭涓嶈兘涓虹┖", trigger: "blur" },
],
},
};
@@ -865,13 +882,13 @@
// 鑾峰彇鏁版嵁
getissueinfo() {
this.id = this.$route.query.id;
- if (this.$route.query.categoryid) {
- this.topicobj.categoryid = Number(this.$route.query.categoryid);
- }
// 鍒嗙被
getissueclassify({}).then((res) => {
this.classifylist = res.rows;
+ if (this.$route.query.categoryid) {
+ this.topicobj.categoryid = Number(this.$route.query.categoryid);
+ }
});
if (!this.id) {
return;
@@ -911,75 +928,94 @@
this.drawer = true;
});
},
+ // categoryidChange(id) {
+ // // 閬嶅巻鎵�鏈夊垎缁勶紝鍦ㄦ瘡涓垎缁勭殑 svyLibScriptCategoryList 涓煡鎵�
+ // let targetOption = null;
+ // for (const group of this.classifylist) {
+ // targetOption = group.svyLibScriptCategoryList.find(item => item.id == id);
+ // if (targetOption) break;
+ // }
+
+ // if (targetOption) {
+ // console.log('閫変腑鐨勯�夐」:', targetOption);
+ // // 娉ㄦ剰锛氳繖閲� targetOption.name 鏄�夐」鍚嶏紝濡傗�滀綇闄㈡弧鎰忓害璋冩煡鈥�
+ // if (targetOption.name.includes('浣忛櫌')) {
+ // this.topicobj.type = "zymyd";
+ // } else if (targetOption.name.includes('闂ㄨ瘖')) {
+ // this.topicobj.type = "mzmyd";
+ // } else if (targetOption.name.includes('鍑洪櫌')) {
+ // this.topicobj.type = "cymyd";
+ // } else if (targetOption.name.includes('甯哥敤')) {
+ // this.topicobj.type = "cymyd"; // 娉ㄦ剰锛氳繖閲屽拰鈥滃嚭闄⑩�濋噸澶嶄簡锛岀‘璁ゆ槸鍚﹂渶鍖哄垎
+ // }
+ // }
+ // },
// 鏂板鎴栦慨鏀硅鎯�
compileissue() {
this.$refs["topicobj"].validate((valid) => {
if (valid) {
- this.topicobj.svyLibScriptOptions = this.topicobj.svyLibScriptOptions.map(
- (item) => {
- if (item.isoperation != 1 && item.isoperation != 3) {
- item.isoperation = 2;
- }
- return item;
- }
- );
- this.topicobj.targetoptions = this.topicobj.svyLibScriptOptions
- .filter((item) => item.isoperation != 3)
- .map((item) => item.optioncontent)
- .join(", ");
- this.topicobj.otherdata = JSON.stringify(this.variablelist);
- if (this.id) {
- this.topicobj.isoperation = 2;
- compileissue(this.topicobj).then((res) => {
- if (res.code == 200) {
- this.$message({
- message: "淇敼鎴愬姛",
- type: "success",
+ this.topicobj.svyLibScriptOptions =
+ this.topicobj.svyLibScriptOptions.map((item) => {
+ if (item.isoperation != 1 && item.isoperation != 3) {
+ item.isoperation = 2;
+ }
+ return item;
});
- this.$router.go(-1);
+ this.topicobj.targetoptions = this.topicobj.svyLibScriptOptions
+ .filter((item) => item.isoperation != 3)
+ .map((item) => item.optioncontent)
+ .join(", ");
+ this.topicobj.otherdata = JSON.stringify(this.variablelist);
+ if (this.id) {
+ this.topicobj.isoperation = 2;
+ compileissue(this.topicobj).then((res) => {
+ if (res.code == 200) {
+ this.$message({
+ message: "淇敼鎴愬姛",
+ type: "success",
+ });
+ this.$router.go(-1);
+ } else {
+ this.$message({
+ message: "淇敼澶辫触",
+ type: "error",
+ });
+ }
+ });
} else {
- this.$message({
- message: "淇敼澶辫触",
- type: "error",
+ this.topicobj.isoperation = 1;
+ compileissue(this.topicobj).then((res) => {
+ if (res.code == 200) {
+ this.$message({
+ message: "鏂板鎴愬姛",
+ type: "success",
+ });
+ this.$router.go(-1);
+ } else {
+ this.$message({
+ message: "鏂板澶辫触",
+ type: "error",
+ });
+ }
});
}
- });
- } else {
- this.topicobj.isoperation = 1;
- compileissue(this.topicobj).then((res) => {
- if (res.code == 200) {
- this.$message({
- message: "鏂板鎴愬姛",
- type: "success",
- });
- this.$router.go(-1);
- } else {
- this.$message({
- message: "鏂板澶辫触",
- type: "error",
- });
+ this.illnesslist.forEach((item, index) => {
+ if (!item.id) {
+ addtargetillness(item).then((res) => {});
+ }
+ });
+ if (this.illnesslistapi.length) {
+ deltargetillness(this.illnesslistapi.join(",")).then((res) => {});
}
- });
- }
- this.illnesslist.forEach((item, index) => {
- if (!item.id) {
- addtargetillness(item).then((res) => {});
}
});
- if (this.illnesslistapi.length) {
- deltargetillness(this.illnesslistapi.join(",")).then((res) => {});
- }
- }
- })
-
-
},
// 鍒ゆ柇鍒嗗��
Scorejudgment() {
let scorearr = this.topicobj.svyLibScriptOptions;
let isValid = scorearr.every((score, index) => {
if (this.topicobj.scriptType == 1) {
- if (score.score) {
+ if (score.score || score.score == 0) {
if (
Number(score.score) < 0 ||
Number(score.score) > Number(this.topicobj.score)
@@ -1084,10 +1120,10 @@
)
.then(() => {
console.log(row);
- this.topicobj.scriptTopic = row.targetname;
+ // this.topicobj.scriptTopic = row.targetname;
this.topicobj.valueType = row.valueType;
this.topicobj.scriptType = row.scriptType;
- this.topicobj.scriptContent = row.targetdesc;
+ // this.topicobj.scriptContent = row.targetdesc;
this.topicobj.targetid = row.id;
this.topicobj.targetname = row.targetname;
this.topicobj.svyLibScriptOptions = [];
--
Gitblit v1.9.3