From 1be7d1dc4426a005621ddb14c96960ca4280bed1 Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期四, 20 六月 2024 09:51:11 +0800
Subject: [PATCH] 测试完成
---
src/views/knowledge/questionnaire/compilequer/index.vue | 204 ++++++++++++++++++++++++++++++++++++--------------
1 files changed, 147 insertions(+), 57 deletions(-)
diff --git a/src/views/knowledge/questionnaire/compilequer/index.vue b/src/views/knowledge/questionnaire/compilequer/index.vue
index d01a149..195ccbd 100644
--- a/src/views/knowledge/questionnaire/compilequer/index.vue
+++ b/src/views/knowledge/questionnaire/compilequer/index.vue
@@ -2,14 +2,27 @@
<div class="Questionnairemanagement">
<!-- 宸︿晶鏍� -->
<div class="sidecolumn">
- <div style="height: 400px">
- <el-steps direction="vertical" :active="Editprogress">
- <el-step title="鍩虹淇℃伅"></el-step>
- <el-step title="闂嵎棰樼洰"></el-step>
- <el-step
- title="闂嵎棰勮"
- description="鏌ョ湅闂嵎棰勮锛屽彲瀵煎嚭PDF"
- ></el-step>
+ <div>
+ <el-steps finish-status="success" :active="Editprogress" simple>
+ <el-step>
+ <template slot="title">
+ <span style="cursor: pointer" @click="Editprogress = 1"
+ >鍩虹淇℃伅</span
+ >
+ </template>
+ </el-step>
+ <el-step>
+ <template slot="title">
+ <span style="cursor: pointer" @click="Editprogress = 2"
+ >闂嵎棰樼洰</span
+ >
+ </template>
+ </el-step>
+ <el-step description="鏌ョ湅闂嵎棰勮锛屽彲瀵煎嚭PDF">
+ <span slot="title" style="cursor: pointer" @click="Editprogress = 3"
+ >闂嵎棰勮</span
+ >
+ </el-step>
</el-steps>
</div>
</div>
@@ -33,14 +46,19 @@
filterable
placeholder="璇烽�夋嫨鍒嗙被"
>
- <el-option
- class="ruleFormaa"
- v-for="item in optionsclass"
- :key="item.id"
- :label="item.name"
- :value="item.id"
+ <el-option-group
+ v-for="group in optionsclass"
+ :key="group.id"
+ :label="group.name"
>
- </el-option>
+ <el-option
+ v-for="item in group.svyLibTemplateCategoryList"
+ :key="item.id"
+ :label="item.name"
+ :value="item.id"
+ >
+ </el-option>
+ </el-option-group>
</el-select>
</el-form-item>
<el-form-item label="闂嵎鏍囬" prop="name">
@@ -261,47 +279,58 @@
<div class="presentation">
<div class="presentation-left">
<el-card class="box-card" style="min-height: 688px">
- <el-table v-loading="loading" :data="ruleForm.svyLibTopics">
+ <el-table v-loading="loading" :data="ruleForm.svyLibScripts">
<el-table-column
label="搴忓彿"
align="center"
- key="topicid"
- prop="topicid"
+ key="guid"
+ prop="guid"
/>
<el-table-column
- label="棰樼洰"
+ label="棰樼洰鏍囬"
align="center"
key="topic"
prop="topic"
:show-overflow-tooltip="true"
/>
<el-table-column
- label="涓昏鍐呭"
+ label="棰樼洰鍐呭"
align="center"
- key="topicContent"
- prop="topicContent"
+ key="script"
+ prop="script"
:show-overflow-tooltip="true"
/>
<el-table-column
label="鎿嶄綔"
align="center"
- width="200"
+ width="250"
class-name="small-padding fixed-width"
>
<template slot-scope="scope">
<el-button
icon="el-icon-edit"
type="primary"
- round
+ circle
@click="handleUpdate(scope.row)"
- >淇敼</el-button
- >
+ ></el-button>
<el-button
type="danger"
icon="el-icon-delete"
circle
@click="handleDelete(scope.row)"
+ ></el-button>
+ <el-button
+ @click="syioption(scope.row)"
+ type="success"
+ icon="el-icon-top"
+ circle
+ ></el-button>
+ <el-button
+ @click="xiayioption(scope.row)"
+ type="success"
+ icon="el-icon-bottom"
+ circle
></el-button>
</template>
</el-table-column>
@@ -364,7 +393,7 @@
<div class="headline">閫夐」璁剧疆</div>
<div
class="topicxq"
- v-for="item in topicobj.svyLibTopicoptions"
+ v-for="item in topicobj.svyLibTemplateTargetoptions"
>
<el-row :gutter="10">
<el-col :span="11"
@@ -441,7 +470,9 @@
>
<el-button type="primary" @click="laststep()">涓婁竴姝�</el-button>
<el-button type="info" @click="closeFm('ruleForm')">鍏抽棴</el-button>
- <el-button @click="submitForm('ruleForm')">淇濆瓨棰樼洰鏁版嵁</el-button>
+ <el-button @click="Departmenttreatment('ruleForm')"
+ >淇濆瓨棰樼洰鏁版嵁</el-button
+ >
</div>
<!-- 闂嵎棰勮 -->
<div v-if="Editprogress == 3">
@@ -502,7 +533,7 @@
title="娣诲姞棰樼洰"
:visible.sync="drawer"
custom-class="demo-drawer"
- width="50%"
+ size="50%"
>
<div class="preview-left">
<el-form
@@ -512,9 +543,9 @@
:inline="true"
label-width="98px"
>
- <el-form-item label="鏍囬" prop="userName">
+ <el-form-item label="闂鏍囬" prop="topic">
<el-input
- v-model="queryParams.userName"
+ v-model="queryParams.topic"
placeholder="璇疯緭鍏�"
clearable
style="width: 200px"
@@ -546,8 +577,8 @@
<el-table-column
label="闂鍐呭"
align="center"
- key="topicContent"
- prop="topicContent"
+ key="script"
+ prop="script"
width="200"
:show-overflow-tooltip="true"
/>
@@ -566,6 +597,13 @@
</template>
</el-table-column>
</el-table>
+ <pagination
+ v-show="total > 0"
+ :total="total"
+ :page.sync="queryParams.pageNum"
+ :limit.sync="queryParams.pageSize"
+ @pagination="getaddtopiclist"
+ />
</div>
</el-drawer>
</div>
@@ -585,6 +623,7 @@
compileissue,
delQtemplateinfo,
Followupinfo,
+ issueinfo,
getissuelist,
deltargetillness,
addtargetillness,
@@ -597,7 +636,7 @@
data() {
return {
sidecolumnrabs: "left", //鏂瑰悜
- Editprogress: 2, //缂栬緫杩涘害
+ Editprogress: 1, //缂栬緫杩涘害
currentVersion: "1.2.3", //褰撳墠鐗堟湰
loading: false, // 閬僵灞�
drawer: false, //鎺у埗灞曞紑
@@ -659,11 +698,12 @@
illnessVisible: false, //鎸囨爣鐤剧梾寮规
deptOptions: [],
optionsillness: [],
+ delScriptVOList: [],
illnesslistapi: [],
illnesslist: [],
tempDetpRelevanceslist: [],
optionstag: [],
- xjxsoptions: [],
+ valuetype: [],
usable: [],
required: [],
mode: [], //鏂瑰紡
@@ -678,18 +718,34 @@
created() {
this.gettabList();
this.getissueinfo();
- this.mode = store.getters.mode;
+ this.mode = store.getters.Askmode;
this.languagelist = store.getters.languagelist;
this.usable = store.getters.usable;
this.required = store.getters.required;
- this.xjxsoptions = store.getters.xjxsoptions;
+ this.valuetype = store.getters.valuetype;
this.courtyardlist = store.getters.courtyardlist;
},
methods: {
+ // 鍏叡鏂规硶---------------
getIndexInArray(arr, obj) {
return arr.indexOf(obj);
},
+ // 閫掑綊鎵佸钩鍖�
+ flattenArray(arr) {
+ let result = [];
+ arr.forEach((item) => {
+ result.push(item);
+ if (item.svyLibTemplateCategoryList) {
+ result = result.concat(
+ this.flattenArray(item.svyLibTemplateCategoryList)
+ );
+ delete item.svyLibTemplateCategoryList;
+ }
+ });
+ return result;
+ },
+ // -----------------------------
// 鑾峰彇鏁版嵁
getissueinfo() {
this.id = this.$route.query.id;
@@ -712,7 +768,9 @@
listDept(this.queryParams).then((response) => {
this.deptList = this.handleTree(response.data, "deptId");
});
+ // 鍒嗙被
getQtemplateclassify({}).then((res) => {
+ // this.optionsclass = this.flattenArray(res.rows);
this.optionsclass = res.rows;
});
},
@@ -738,10 +796,14 @@
Departmenttreatment() {
this.ruleForm.deptNames = JSON.stringify(this.tempDetpRelevanceslist);
console.log(this.tempDetpRelevanceslist);
+ this.ruleForm.svyLibScripts = this.ruleForm.svyLibScripts.concat(
+ this.delScriptVOList
+ );
+ console.log(this.ruleForm.svyLibScripts, "this.ruleForm.svyLibScripts");
const result = this.tempDetpRelevanceslist.map(
(subArr) => subArr[subArr.length - 1]
);
- console.log(result);
+ console.log(result, "result");
// id鏁扮粍鏌ユ暟缁勫璞�
result.forEach((item) => {
const condition = this.ruleForm.tempDetpRelevances.some(
@@ -760,6 +822,7 @@
this.ruleForm.tempDetpRelevances.forEach((item) => {
const condition = result.some((obj) => obj === item.deptId);
if (!condition) {
+ console.log(condition);
const index = this.ruleForm.tempDetpRelevances.indexOf(item);
this.ruleForm.tempDetpRelevances[index].delFlag = 1;
}
@@ -768,7 +831,6 @@
setTimeout(() => {
this.submitForm();
}, 1000);
- // this.submitForm();
},
// 涓嬩竴姝�
nextstep() {
@@ -810,21 +872,54 @@
// 鏂板棰樼洰
addtopic(row) {
row.isoperation = 1;
- this.ruleForm.svyLibTopics.push(row);
+ row.svyLibTemplateTargetoptions.forEach((item) => {
+ item.isoperation = 1;
+ });
+ this.ruleForm.svyLibScripts.push(row);
},
handleDelete(row) {
- this.ruleForm.svyLibTopics.splice(
- this.ruleForm.svyLibTopics.indexOf(row),
- 1
- );
+ let index = this.ruleForm.svyLibScripts.indexOf(row);
+ this.ruleForm.svyLibScripts.splice(index, 1);
+ row.isoperation = 3;
+ this.delScriptVOList.push(row);
+ this.sortFn();
},
handleUpdate(row) {
console.log(row);
this.topicobj = row;
+ // getissuelist({ svyid: row.svyid }).then((res) => {
+ // });
+ },
+ syioption(row) {
+ const index = this.getIndexInArray(this.ruleForm.svyLibScripts, row);
+ const item = this.ruleForm.svyLibScripts.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓�
+ this.ruleForm.svyLibScripts.splice(index - 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣�
+ this.sortFn();
+ },
+ xiayioption(row) {
+ const index = this.getIndexInArray(this.ruleForm.svyLibScripts, row);
+ const item = this.ruleForm.svyLibScripts.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓�
+ this.ruleForm.svyLibScripts.splice(index + 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣�
+ this.sortFn();
+ },
+ sortFn() {
+ this.ruleForm.svyLibScripts = this.ruleForm.svyLibScripts.map(
+ (item, index) => {
+ return {
+ guid: index + 1,
+ svyid: item.svyid,
+ script: item.script,
+ script: item.script,
+ };
+ }
+ );
+ console.log(this.ruleForm.svyLibScripts);
},
// 淇敼棰樼洰淇℃伅
- Submittopicobj() {},
+ Submittopicobj() {
+
+ },
// 鏂板鍙橀噺
addvariable() {
this.variablelist.push({
@@ -974,28 +1069,23 @@
<style lang="scss" scoped>
.Questionnairemanagement {
- display: flex;
+ // display: flex;
}
.sidecolumn {
- width: 300px;
- min-height: 100vh;
- text-align: center;
- // display: flex;
- // margin-top: 20px;
margin: 20px;
margin-bottom: 0;
- padding: 30px;
+ padding: 20px;
background: #edf1f7;
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);
}
.leftvlue {
- // display: flex;
- // flex: 1;
- width: 80%;
- margin-top: 20px;
- // margin: 20px;
+ // // display: flex;
+ // // flex: 1;
+ // width: 80%;
+ // margin-top: 20px;
+ margin: 20px;
padding: 30px;
background: #ffff;
border: 1px solid #dcdfe6;
--
Gitblit v1.9.3