From b73b5dd97cbda40d0584f579ed9f65f4fcffe23f Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期一, 31 三月 2025 15:33:02 +0800 Subject: [PATCH] 测试完成 --- src/views/knowledge/questionnaire/index.vue | 375 +++++++++++++++++++++++++++++++++++----------------- 1 files changed, 251 insertions(+), 124 deletions(-) diff --git a/src/views/knowledge/questionnaire/index.vue b/src/views/knowledge/questionnaire/index.vue index e4c3562..dea53d9 100644 --- a/src/views/knowledge/questionnaire/index.vue +++ b/src/views/knowledge/questionnaire/index.vue @@ -3,8 +3,8 @@ <!-- 宸︿晶鏍� --> <div class="sidecolumn"> <div class="sidecolumn-top"> - <div class="top-wj">闂嵎绫诲瀷</div> - <div class="top-tj" @click="dialogFormVisible = true">+娣诲姞</div> + <div class="top-wj">闂嵎鍒嗙被</div> + <div class="top-tj" @click="Newcategory">+娣诲姞</div> </div> <div class="center-ss"> <el-input @@ -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> @@ -57,64 +68,49 @@ v-show="showSearch" label-width="98px" > - <el-form-item label="闂嵎鍚嶇О" prop="userName"> + <el-form-item label="闂嵎鍚嶇О" prop="svyname"> <el-input - v-model="queryParams.userName" + v-model="queryParams.svyname" placeholder="璇疯緭鍏�" clearable style="width: 200px" @keyup.enter.native="handleQuery" /> </el-form-item> - <el-form-item label="閫傜敤绉戝" prop="sickness"> - <el-cascader - v-model="queryParams.sickness" - :options="editableTabs" - :props="propss" - clearable - ></el-cascader> - </el-form-item> - <el-form-item label="閫氱煡鍐呭" prop="userName"> - <el-input - v-model="queryParams.userNamevalue" - placeholder="璇疯緭鍏�" - clearable - style="width: 200px" - @keyup.enter.native="handleQuery" - /> - </el-form-item> - <el-form-item label="閫傜敤鏂瑰紡" prop="shape"> - <el-cascader - v-model="queryParams.shapevalue" - :options="editableTabs" - :props="propss" - clearable - ></el-cascader> - </el-form-item> - <el-form-item label="鍐呭褰㈠紡" prop="classify"> + <el-form-item label="閫傜敤闄㈠尯" prop="region"> <el-select - v-model="queryParams.classifyvalue" - placeholder="璇烽�夋嫨" + v-model="campus" + size="medium" + multiple + filterable + placeholder="璇烽�夋嫨鍒嗙被" > <el-option - v-for="(item, index) in editableTabs" - :key="index++" - :label="item.title" - :value="index++" + v-for="item in courtyardlist" + :key="item.label" + :label="item.label" + :value="item.label" > </el-option> </el-select> </el-form-item> + <el-form-item label="闂嵎鎻忚堪" prop="userName"> + <el-input + v-model="queryParams.description" + placeholder="璇疯緭鍏�" + clearable + style="width: 200px" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鍙敤鐘舵��" prop="classify"> - <el-select - v-model="queryParams.classifyvalue" - placeholder="璇烽�夋嫨" - > + <el-select v-model="queryParams.isenable" placeholder="璇烽�夋嫨"> <el-option - v-for="(item, index) in editableTabs" - :key="index++" - :label="item.title" - :value="index++" + v-for="(item, index) in qyoptions" + :key="item.value" + :label="item.label" + :value="item.value" > </el-option> </el-select> @@ -145,7 +141,7 @@ icon="el-icon-plus" size="medium" @click="handleAdd" - v-hasPermi="['system:user:add']" + >鏂板</el-button > </el-col> @@ -158,7 +154,6 @@ size="medium" :disabled="multiple" @click="handleDelete" - v-hasPermi="['system:user:remove']" >鍒犻櫎</el-button > </el-col> @@ -170,36 +165,31 @@ @selection-change="handleSelectionChange" > <el-table-column type="selection" width="50" align="center" /> - <el-table-column + <!-- <el-table-column label="搴忓彿" + fixed align="center" key="svyid" prop="svyid" - /> + /> --> <el-table-column - label="闂嵎鏍囬" + label="闂嵎鍚嶇О" + fixed align="center" key="svyname" prop="svyname" width="160" :show-overflow-tooltip="true" /> - <el-table-column - label="鐗堟湰" - align="center" - key="version" - prop="version" - :show-overflow-tooltip="true" - /> <el-table-column - label="涓昏鍐呭" + label="闂嵎鎻忚堪" align="center" key="description" prop="description" width="260" /><el-table-column - label="閫傜敤鐤剧梾(缂�)" + label="閫傜敤鐤剧梾" align="center" key="Applicable" prop="Applicable" @@ -209,42 +199,30 @@ size="medium" type="text" @click="illnessUpdate(scope.row)" - v-hasPermi="['system:user:edit']" ><span class="button-textxg" ><i class="el-icon-date"></i>璇︽儏</span ></el-button > </template> </el-table-column> + <el-table-column - label="閫傜敤绉戝(缂�)" + label="鏍囩" align="center" - key="administrative" - prop="administrative" - width="120" - /> - <el-table-column - label="鏍囩(缂�)" - align="center" - key="tagList" - prop="tagList" + key="labelInfo" + prop="labelInfo" width="160" :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.svyLibTemplateTagList" + >{{ item.tagname }}銆� + </span> </template> </el-table-column> <el-table-column - label="璧勬枡褰㈠紡(缂�)" - align="center" - key="cphonenumaber" - prop="cphonenumaber" - width="120" - /> - <el-table-column - label="鍙敤" + label="鏄惁鍙敤" align="center" key="isenable" prop="isenable" @@ -264,6 +242,7 @@ <el-table-column label="鎿嶄綔" + fixed="right" align="center" width="300" class-name="small-padding fixed-width" @@ -273,26 +252,23 @@ size="medium" type="text" @click="goQRCode(scope.row)" - v-hasPermi="['system:user:edit']" > <span class="button-text" - ><i class="el-icon-edit"></i>浜岀淮鐮�</span + ><i class="el-icon-edit"></i>棰勮</span ></el-button > - <el-button + <!-- <el-button size="medium" type="text" @click="ViewQuestionnaire(scope.row)" - v-hasPermi="['system:user:edit']" ><span class="button-textck" ><i class="el-icon-edit"></i>鏌ョ湅</span ></el-button - > + > --> <el-button size="medium" type="text" @click="handleUpdate(scope.row)" - v-hasPermi="['system:user:edit']" ><span class="button-textxg" ><i class="el-icon-edit"></i>淇敼</span ></el-button @@ -301,7 +277,6 @@ size="medium" type="text" @click="handleDelete(scope.row)" - v-hasPermi="['system:user:remove']" ><span class="button-textsc" ><i class="el-icon-edit"></i>鍒犻櫎</span ></el-button @@ -336,21 +311,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> @@ -403,12 +375,79 @@ </span> </el-dialog> <!-- 浜岀淮鐮佸睍绀哄脊妗� --> - <el-dialog width="30%" :visible.sync="goQRCodeVisible"> + <!-- <el-dialog width="30%" :visible.sync="goQRCodeVisible"> <div class="qrcode-dialo"> <div class="qrcode-text"> {{ namequestionnaire }}<span>{{ haoquestionnaire }}</span> </div> - <div class="qrcode-img"></div> + <div class="qrcode-img"> + <el-image + src="D:/qrcode/fc9a1fa37e394ac3ac606bf6b77b17c3" + fit="cover" + ></el-image> + </div> + </div> + </el-dialog> --> + <!-- 闂嵎妯℃澘棰勮 --> + <el-dialog title="闅忚棰樼洰棰勮" :visible.sync="topicVisible" width="50%"> + <div class="preview-left"> + <!-- 鍗曢�� --> + <div v-for="item in topicform.svyTemplateLibScripts"> + <div + class="scriptTopic-dev" + :key="item.sort" + v-if="item.scriptType == 1" + > + <div class="dev-text"> + {{ item.sort }}銆乕鍗曢�塢<span>{{ item.scriptContent }}</span> + </div> + <div class="dev-xx"> + <el-radio-group v-model="item.remark"> + <el-radio + v-for="(items, index) in item.svyLibTemplateTargetoptions" + :key="index" + :label="index" + >{{ items.optioncontent }}</el-radio + > + </el-radio-group> + </div> + </div> + <!-- 澶氶�� --> + <div + class="scriptTopic-dev" + :key="item.sort" + v-if="item.scriptType == 2" + > + <div class="dev-text"> + {{ item.sort }}銆乕澶氶�塢<span>{{ item.scriptContent }}</span> + </div> + <div class="dev-xx"> + <el-checkbox-group v-model="qremark"> + <el-checkbox + v-for="(items, index) in item.svyLibTemplateTargetoptions" + :key="index" + :label="index" + > + {{ items.optioncontent }} + </el-checkbox> + </el-checkbox-group> + </div> + </div> + <!-- 濉┖ --> + <div + class="scriptTopic-dev" + :key="item.sort" + v-if="item.scriptType == 4" + > + <div class="dev-text"> + {{ item.sort }}銆乕闂瓟]<span>{{ item.scriptContent }}</span> + </div> + <div class="dev-xx"> + <el-input placeholder="璇疯緭鍏ョ瓟妗�" v-model="radioas" clearable> + </el-input> + </div> + </div> + </div> </div> </el-dialog> </div> @@ -421,8 +460,9 @@ getQtemplateclassify, delQtemplateclassify, addQtemplateclassify, + editQtemplateclassify, getQtemplatelist, - issueinfo, + getQtemplateobj, compileissue, delQtemplateinfo, Followupinfo, @@ -431,7 +471,10 @@ getillnesslist, illnesslistget, getillness, + getQRcode, } from "@/api/AiCentre/index"; +import { listDept } from "@/api/system/dept"; + import { getToken } from "@/utils/auth"; import Treeselect from "@riophae/vue-treeselect"; import "@riophae/vue-treeselect/dist/vue-treeselect.css"; @@ -445,6 +488,7 @@ loading: false, // 閫変腑鏁扮粍 ids: [], + qremark: [], // 闈炲崟涓鐢� single: true, // 闈炲涓鐢� @@ -455,9 +499,11 @@ total: 0, namequestionnaire: "", haoquestionnaire: "", + QRcodeurl: "", + courtyardlist: "", // 鐢ㄦ埛琛ㄦ牸鏁版嵁 userList: [], - + campus: [], // 鏃ユ湡鑼冨洿 dateRange: [], // 宀椾綅閫夐」 @@ -466,7 +512,7 @@ roleOptions: [], // 琛ㄥ崟鍙傛暟 form: {}, - + title: "鏂板绫诲埆", sidecolumnform: {}, //娣诲姞绫诲埆琛ㄥ崟 goQRCodeVisible: false, //浜岀淮鐮佸脊妗� sidecolumnval: "", //绫诲埆鎼滅储 @@ -474,10 +520,14 @@ idds: "", amendtag: false, //鏄惁淇敼绫诲埆 dialogFormVisible: false, //淇敼娣诲姞绫诲埆寮规 + topicVisible: false, // + topicform: {}, classifyform: {}, //绫诲埆琛ㄥ崟 indexid: null, inputValue: "", radio: "涓诲垎绫�", + zufon: true, + zifon: true, inputVisible: false, illnessVisible: false, //鎸囨爣鐤剧梾寮规 deptOptions: [], @@ -485,9 +535,11 @@ illnesslistapi: [], illnesslist: [], defaultProps: { - children: "svyLibTopicCategoryList", - label: "indexAssortName", + children: "svyLibTemplateCategoryList", + label: "name", }, + deptList: [], + props: { multiple: true, value: "deptId", label: "deptName" }, mode: [], languagelist: [], qyoptions: [], @@ -505,11 +557,12 @@ watch: {}, created() { this.getList(); - // this.getDeptTree(); + this.getDeptTree(); this.mode = store.getters.mode; this.languagelist = store.getters.languagelist; this.qyoptions = store.getters.usable; this.editableTabs = store.getters.editableTabs; + this.courtyardlist = store.getters.courtyardlist; }, methods: { @@ -521,12 +574,26 @@ this.total = response.total; this.loading = false; }); + listDept(this.queryParams).then((response) => { + this.deptList = this.handleTree(response.data, "deptId"); + }); }, goQRCode(row) { - this.goQRCodeVisible = true; - this.namequestionnaire = row.userName; - this.haoquestionnaire = row.nickName; + getQtemplateobj({ svyid: row.svyid }).then((res) => { + this.topicform = res.rows[0]; + console.log(this.topicform); + this.topicVisible = true; + }); + // getQRcode({ + // url: "/outsideChain?param1=KHRYDSSuTpwGWDhAS6OnpfxObRZf8fd/TIagYWPvDuyku+MjtrWt1efC1htoBDc+G4QP2UOWPNitAO4TwH4oIQ==¶m2=CP/xYqwqDhWACt2aQ/HOwhgRM62Lh4/1upwYDl7dmKSuiaa4zRzMgu7rmRztiwQj2YvJ1KAX1zBTpUAIdxPvUA==", + // }).then((res) => { + // console.log(res); + // this.QRcodeurl = "D:/qrcode/fc9a1fa37e394ac3ac606bf6b77b17c3"; + // }); + // this.goQRCodeVisible = true; + // this.namequestionnaire = row.userName; + // this.haoquestionnaire = row.nickName; }, // 琛ㄥ崟閲嶇疆 reset() { @@ -549,6 +616,7 @@ /** 鎼滅储鎸夐挳鎿嶄綔 */ handleQuery() { this.queryParams.pageNum = 1; + this.queryParams.campus = this.campus.join(","); this.getList(); }, /** 閲嶇疆鎸夐挳鎿嶄綔 */ @@ -568,13 +636,14 @@ /** 鏂板鎸夐挳鎿嶄綔 */ handleAdd() { this.$router.push({ - path: "/knowledge/questionnaire/compilequer/", + path: "/knowledge/questionnaireinfo/", + query: { categoryid: this.queryParams.categoryid }, }); }, /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { this.$router.push({ - path: "/knowledge/questionnaire/compilequer/", + path: "/knowledge/questionnaireinfo/", query: { id: row.svyid }, }); }, @@ -666,38 +735,50 @@ getDeptTree() { getQtemplateclassify({}).then((res) => { this.deptOptions = res.rows; - console.log(res); + this.dialogFormVisible = false; }); }, // 娣诲姞绫诲埆鏍� submitsidecolumn() { + if (this.classifyform.id) { + editQtemplateclassify(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 ); + console.log(this.deptOptions[index]); calssvalue = this.deptOptions[index]; - calssvalue.ivrLibaTemplateAssortList.push(this.classifyform); - } else if (this.radio == "涓诲垎绫�" && this.classifyform.indexAssortName) { + calssvalue.svyLibTemplateCategoryList.push(this.classifyform); + } else if (this.radio == "涓诲垎绫�" && this.classifyform.name) { this.classifyform.pid = null; - this.classifyform.ivrLibaTemplateAssortList = []; + this.classifyform.svyLibTemplateCategoryList = []; } else { return this.$modal.msgError("璇峰~鍐欏畬鏁翠俊鎭�"); } addQtemplateclassify(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 delQtemplateclassify(b.id); }) @@ -709,9 +790,7 @@ } else { this.$modal .confirm( - '鏄惁纭鍒犻櫎涓�绾у垎绫�"' + - b.indexAssortName + - '"锛熷垹闄ゅ悗鍏朵笅鍒嗙被灏嗗綊绫烩�樻湭鍒嗙被鈥�' + '鏄惁纭鍒犻櫎涓�绾у垎绫�"' + b.name + '"锛熷垹闄ゅ悗鍏朵笅鍒嗙被灏嗗綊绫烩�樻湭鍒嗙被鈥�' ) .then(() => { return delQtemplateclassify(b.id); @@ -723,14 +802,35 @@ .catch(() => {}); } }, + altertag(a, b) { + this.dialogFormVisible = true; + if (!b.pid) { + this.radio = "涓诲垎绫�"; + this.title = "淇敼涓诲垎绫�"; + this.zufon = false; + } else { + this.radio = "瀛愬垎绫�"; + this.title = "淇敼瀛愬垎绫�"; + this.zifon = false; + } + this.classifyform = b; + this.dialogFormVisible = true; + }, + Newcategory(){ + this.classifyform= {}, //绫诲埆琛ㄥ崟 + this.radio = "涓诲垎绫�"; + this.dialogFormVisible = true + this.zifon = true; + this.zufon = 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(); }, @@ -771,13 +871,6 @@ this.single = selection.length != 1; this.multiple = !selection.length; }, - /** 鏂板鎸夐挳鎿嶄綔 */ - handleAdd() { - this.$router.push({ - path: "/knowledge/verbaltrick/particulars/", - query: { id: "1" }, - }); - }, /** 鍒犻櫎鎸夐挳鎿嶄綔 */ handleDelete(row) { @@ -809,7 +902,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); @@ -913,6 +1006,22 @@ 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); + .scriptTopic-dev { + margin-bottom: 25px; + font-size: 20px !important; + .dev-text { + margin-bottom: 10px; + } + } +} ::v-deep .el-tree-node__content { display: -webkit-box; @@ -925,6 +1034,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