From 9f4da363a401c3624fa57a87fb50193b59bc6a35 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期三, 24 七月 2024 10:28:32 +0800
Subject: [PATCH] 测试完成
---
src/views/knowledge/questionbank/index.vue | 219 ++++++++++++++++++++++++++++++++++++++++++------------
1 files changed, 171 insertions(+), 48 deletions(-)
diff --git a/src/views/knowledge/questionbank/index.vue b/src/views/knowledge/questionbank/index.vue
index a2f1567..b7a6709 100644
--- a/src/views/knowledge/questionbank/index.vue
+++ b/src/views/knowledge/questionbank/index.vue
@@ -29,7 +29,7 @@
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<span>{{ node.label }}</span>
- <span>
+ <span v-if="data.id > 0">
<el-button
type="text"
icon="el-icon-delete"
@@ -37,6 +37,17 @@
size="mini"
@click="() => remove(node, data)"
>
+ </el-button>
+ </span>
+ <span v-if="data.id > 0">
+ <el-button
+ type="text"
+ circle
+ size="mini"
+ @click="() => altertag(node, data)"
+ ><span class="button-textxg"
+ ><i class="el-icon-edit-outline"></i
+ ></span>
</el-button>
</span>
</span>
@@ -88,8 +99,11 @@
</el-option>
</el-select>
</el-form-item>
- <el-form-item label="鏄惁鍙敤" prop="status">
- <el-select v-model="queryParams.status" placeholder="璇烽�夋嫨">
+ <el-form-item label="鏄惁鍙敤" prop="isavailable">
+ <el-select
+ v-model="queryParams.isavailable"
+ placeholder="璇烽�夋嫨"
+ >
<el-option
v-for="item in qyoptions"
:key="item.value"
@@ -149,39 +163,50 @@
:border="true"
@selection-change="handleSelectionChange"
>
- <el-table-column type="selection" width="50" align="center" />
+ <el-table-column
+ type="selection"
+ fixed
+ width="50"
+ align="center"
+ />
<el-table-column
label="搴忓彿"
+ fixed
align="center"
- key="topicid"
- prop="topicid"
+ key="id"
+ prop="id"
/>
<el-table-column
label="棰樼洰鏍囬"
+ fixed
align="center"
- key="topic"
- prop="topic"
+ key="scriptTopic"
+ prop="scriptTopic"
width="200"
:show-overflow-tooltip="true"
/>
<el-table-column
- label="棰樼洰鍐呭(缂�)"
+ label="棰樼洰鍐呭"
align="center"
- key="nickName"
- prop="nickName"
+ key="scriptContent"
+ prop="scriptContent"
width="200"
:show-overflow-tooltip="true"
/>
/><el-table-column
- label="閫傜敤鏂瑰紡(缂�)"
+ label="閫傜敤鏂瑰紡"
align="center"
- key="application"
- prop="application"
+ key="suitway"
+ prop="suitway"
width="120"
- />
+ >
+ <template slot-scope="scope">
+ <dict-tag :options="mode" :value="scope.row.suitway" />
+ </template>
+ </el-table-column>
/><el-table-column
- label="閫傜敤鐤剧梾(缂�)"
+ label="閫傜敤鐤剧梾"
align="center"
key="Applicable"
prop="Applicable"
@@ -200,7 +225,7 @@
</template>
</el-table-column>
<el-table-column
- label="鏍囩(缂�)"
+ label="鏍囩"
align="center"
key="tagList"
prop="tagList"
@@ -208,17 +233,26 @@
:show-overflow-tooltip="true"
>
<template slot-scope="scope">
- <span v-for="item in scope.row.tagList">{{ item }} </span>
+ <span v-for="item in scope.row.tag.split(',')"
+ >{{ item }}銆�
+ </span>
</template>
</el-table-column>
<el-table-column
- label="鍙敤(缂�)"
+ label="鍙敤"
align="center"
- key="usable"
- prop="usable"
+ key="isavailable"
+ prop="isavailable"
width="120"
- />
+ >
+ <template slot-scope="scope">
+ <dict-tag
+ :options="qyoptions"
+ :value="scope.row.isavailable"
+ />
+ </template>
+ </el-table-column>
<el-table-column
label="鏈�杩戜慨鏀�"
align="center"
@@ -229,6 +263,7 @@
<el-table-column
label="鎿嶄綔"
+ fixed="right"
align="center"
width="250"
class-name="small-padding fixed-width"
@@ -255,7 +290,7 @@
<el-button
size="medium"
type="text"
- @click="handleDelete(scope.row)"
+ @click="topicpreview(scope.row)"
v-hasPermi="['system:user:remove']"
><span class="button-text"
><i class="el-icon-view"></i>棰勮</span
@@ -291,21 +326,18 @@
<el-option
v-for="item in deptOptions"
:key="item.id"
- :label="item.indexAssortName"
+ :label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item label="璇疯緭鍏ョ被鍒悕绉�">
- <el-input
- v-model="classifyform.indexAssortName"
- autocomplete="off"
- ></el-input>
+ <el-input v-model="classifyform.name" autocomplete="off"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
- <el-button @click="dialogFormVisible = false">鍙� 娑�</el-button>
+ <el-button @click="getDeptTree()">鍙� 娑�</el-button>
<el-button type="primary" @click="submitsidecolumn">纭� 瀹�</el-button>
</div>
</el-dialog>
@@ -357,6 +389,32 @@
<el-button type="primary" @click="confirmillness">纭� 瀹�</el-button>
</span>
</el-dialog>
+ <el-dialog title="棰樼洰棰勮" :visible.sync="topicVisible" width="50%">
+ <div class="preview-left">
+ <div class="dev-text">
+ <span>{{ topicform.scriptContent }}</span>
+ </div>
+
+ <div class="dev-xx" v-if="topicform.valueType == 1">
+ <el-radio-group v-model="topicform.asrtext">
+ <el-radio
+ v-for="(topicforms, index) in topicform.svyLibScriptOptions"
+ :key="topicforms.optioncontent"
+ :label="topicforms.optioncontent"
+ >{{ topicforms.optioncontent }}</el-radio
+ >
+ </el-radio-group>
+ </div>
+ <div v-else>
+ <el-input
+ type="textarea"
+ placeholder="璇疯緭鍏ュ唴瀹�"
+ v-model.sync="topicform.asrtext"
+ :rows="2"
+ />
+ </div>
+ </div>
+ </el-dialog>
</div>
</template>
@@ -366,6 +424,7 @@
getissueclassify,
delissueclassify,
addissueclassify,
+ editissueclassify,
getissuelist,
issueinfo,
compileissue,
@@ -401,9 +460,13 @@
namequestionnaire: "",
haoquestionnaire: "",
idds: "",
+ topicform: {
+ scriptContent: "",
+ },
amendtag: false, //鏄惁淇敼绫诲埆
dialogFormVisible: false, //淇敼娣诲姞绫诲埆寮规
deleteVisible: false, //鍒嗙被鍒犻櫎寮规
+ topicVisible: false, //棰勮寮规
deletefenl: "楂樿鍘�", //鍒犻櫎椤�
classifyform: {
categoryname: "",
@@ -411,6 +474,7 @@
// 琛ㄦ牸鏁版嵁
userList: [],
// 寮瑰嚭灞傛爣棰�
+ tag: "",
title: "",
// 鏄惁鏄剧ず寮瑰嚭灞�
open: false,
@@ -440,7 +504,7 @@
illnesslist: [],
defaultProps: {
children: "svyLibTopicCategoryList",
- label: "indexAssortName",
+ label: "name",
},
mode: [],
languagelist: [],
@@ -449,6 +513,7 @@
queryParams: {
pageNum: 1,
pageSize: 10,
+ isavailable: "",
},
// 琛ㄥ崟鏍¢獙
rules: {},
@@ -457,6 +522,7 @@
watch: {},
created() {
this.getList();
+ this.getDeptTree();
this.mode = store.getters.mode;
this.languagelist = store.getters.languagelist;
this.qyoptions = store.getters.usable;
@@ -477,13 +543,13 @@
compileUpdate(row) {
this.$router.push({
path: "/knowledge/questionbank/particulars/",
- query: { id: row.topicid },
+ query: { id: row.id },
});
},
// 鐤剧梾-----------------------
illnessUpdate(row) {
this.illnessVisible = true;
- this.indexid = row.topicid;
+ this.indexid = row.id;
this.illnesslistapi = [];
const illnessqueryParams = {
pageNum: 1,
@@ -493,7 +559,7 @@
console.log(response);
this.optionsillness = response.rows;
});
- getillness({ outid: row.topicid, type: 4 }).then((res) => {
+ getillness({ outid: row.id, type: 4 }).then((res) => {
this.illnesslist = res.rows;
console.log(res);
});
@@ -564,38 +630,49 @@
getDeptTree() {
getissueclassify({}).then((res) => {
this.deptOptions = res.rows;
- console.log(res);
+ this.dialogFormVisible = false;
});
},
// 娣诲姞绫诲埆鏍�
submitsidecolumn() {
+ if (this.classifyform.id) {
+ editissueclassify(this.classifyform).then((res) => {
+ this.getDeptTree();
+ this.$modal.msgSuccess("淇敼鎴愬姛");
+ this.classifyform = {};
+ this.dialogFormVisible = false;
+ });
+ return;
+ }
let calssvalue = {};
if (
this.classifyform.pid &&
- this.classifyform.indexAssortName &&
+ this.classifyform.name &&
this.radio == "瀛愬垎绫�"
) {
const index = this.deptOptions.findIndex(
(obj) => obj.id == this.classifyform.pid
);
calssvalue = this.deptOptions[index];
- calssvalue.ivrLibaTemplateAssortList.push(this.classifyform);
- } else if (this.radio == "涓诲垎绫�" && this.classifyform.indexAssortName) {
+ calssvalue.svyLibTopicCategoryList.push(this.classifyform);
+ } else if (this.radio == "涓诲垎绫�" && this.classifyform.name) {
this.classifyform.pid = null;
- this.classifyform.ivrLibaTemplateAssortList = [];
+ this.classifyform.svyLibTopicCategoryList = [];
} else {
return this.$modal.msgError("璇峰~鍐欏畬鏁翠俊鎭�");
}
addissueclassify(this.classifyform).then((res) => {
this.getDeptTree();
this.$modal.msgSuccess("鏂板鎴愬姛");
+ this.classifyform = {};
+ this.dialogFormVisible = false;
});
},
remove(a, b) {
if (b.pid) {
this.$modal
- .confirm('鏄惁纭鍒犻櫎鍒嗙被椤逛负"' + b.indexAssortName + '"鐨勬暟鎹」锛�')
+ .confirm('鏄惁纭鍒犻櫎鍒嗙被椤逛负"' + b.name + '"鐨勬暟鎹」锛�')
.then(function () {
return delissueclassify(b.id);
})
@@ -607,9 +684,7 @@
} else {
this.$modal
.confirm(
- '鏄惁纭鍒犻櫎涓�绾у垎绫�"' +
- b.indexAssortName +
- '"锛熷垹闄ゅ悗鍏朵笅鍒嗙被灏嗗綊绫烩�樻湭鍒嗙被鈥�'
+ '鏄惁纭鍒犻櫎涓�绾у垎绫�"' + b.name + '"锛熷垹闄ゅ悗鍏朵笅鍒嗙被灏嗗綊绫烩�樻湭鍒嗙被鈥�'
)
.then(() => {
return delissueclassify(b.id);
@@ -621,21 +696,31 @@
.catch(() => {});
}
},
+ altertag(a, b) {
+ this.dialogFormVisible = true;
+ if (!b.pid) {
+ this.radio = "涓诲垎绫�";
+ } else {
+ this.radio = "瀛愬垎绫�";
+ }
+ this.classifyform = b;
+ this.dialogFormVisible = true;
+ },
// 绛涢�夎妭鐐�
filterNode(value, data) {
if (!value) return true;
- return data.indexAssortName.indexOf(value) !== -1;
+ return data.name.indexOf(value) !== -1;
},
handleNodeClick(data) {
- this.queryParams.assortid = data.id;
+ this.queryParams.categoryid = data.id;
this.getList();
},
// 琛ㄥ崟閲嶇疆
reset() {
this.form = {
- topicid: undefined,
+ id: undefined,
deptId: undefined,
userName: undefined,
nickName: undefined,
@@ -665,7 +750,7 @@
},
// 澶氶�夋閫変腑鏁版嵁
handleSelectionChange(selection) {
- this.ids = selection.map((item) => item.topicid);
+ this.ids = selection.map((item) => item.id);
this.single = selection.length != 1;
this.multiple = !selection.length;
},
@@ -685,7 +770,8 @@
/** 鍒犻櫎鎸夐挳鎿嶄綔 */
handleDelete(row) {
- const topicids = row.topicid || this.ids;
+ console.log(this.ids);
+ const topicids = row.id || this.ids;
this.$modal
.confirm('鏄惁纭鍒犻櫎鐢ㄦ埛缂栧彿涓�"' + topicids + '"鐨勬暟鎹」锛�')
.then(function () {
@@ -696,6 +782,10 @@
this.$modal.msgSuccess("鍒犻櫎鎴愬姛");
})
.catch(() => {});
+ },
+ topicpreview(row) {
+ this.topicform = row;
+ this.topicVisible = true;
},
},
};
@@ -713,7 +803,7 @@
margin-top: 20px;
margin: 20px;
padding: 30px;
- background: #edf1f7;
+ background: #fff;
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);
@@ -832,6 +922,21 @@
vertical-align: bottom;
}
}
+.preview-left {
+ margin: 20px;
+ // margin: 20px;
+ padding: 30px;
+ // background: #ffff;
+ 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);
+
+ .dev-text {
+ margin-bottom: 10px;
+ text-align: left;
+ font-size: 22px;
+ }
+}
::v-deep .el-tree-node__content {
display: -webkit-box;
@@ -844,6 +949,24 @@
font-size: 20px;
cursor: pointer;
}
+::v-deep .el-tree {
+ position: relative;
+ cursor: default;
+ border-radius: 5px;
+ background: #eff8fe;
+ color: #606266;
+ border: 1px solid #bbe1fa;
+ // 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);
+}
+::v-deep
+ .el-tree--highlight-current
+ .el-tree-node.is-current
+ > .el-tree-node__content {
+ background-color: #7799fb;
+ color: #fff;
+}
::v-deep .el-button--mini.is-circle {
padding: 7px;
margin: 0;
--
Gitblit v1.9.3