|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <div class="single-container">
|
|
|
+ <div class="single-container" @click="hideQas">
|
|
|
<el-form>
|
|
|
<div class="operation-row">
|
|
|
<el-checkbox-group size="small">
|
|
@@ -51,7 +51,7 @@
|
|
|
></el-input>
|
|
|
</div>
|
|
|
<el-tag v-if="it.exclusion" type="info" size="mini">互斥项</el-tag>
|
|
|
- <span :class="tagActive===i?'tag-active el-tag--mini el-tag el-tag--info':'el-tag--mini el-tag el-tag--info'" v-if="it.exclusionCon" @click="getConnectedQas(it.subQuestion,i)">已关联</span>
|
|
|
+ <span :class="tagActive===i?'tag-active el-tag--mini el-tag el-tag--info':'el-tag--mini el-tag el-tag--info'" v-if="it.exclusionCon" @click="getConnectedQas($event,it.subQuestion,i)">已关联</span>
|
|
|
</el-col>
|
|
|
<el-button @click="addRow">+</el-button>
|
|
|
<div class="bottomPartMid bottomPartMidss">
|
|
@@ -62,7 +62,7 @@
|
|
|
<span class="el-icon-arrow-down" @click="orderUpDown(1)"></span>
|
|
|
</p>
|
|
|
</div>
|
|
|
- <div class="connected-qas" v-if="showQas.length>0">
|
|
|
+ <div class="connected-qas" @click.stop v-if="showQas.length>0">
|
|
|
<p style="margin-bottom: 10px;">关联的问题:</p>
|
|
|
<p v-for="(qa,i) in showQas">{{i+1}}. {{qa.name}}</p>
|
|
|
</div>
|
|
@@ -91,7 +91,7 @@
|
|
|
</p>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div v-if="type==1||type==2" class="bottomPartLeft">
|
|
|
+ <div v-if="(type==1||type==2)&&hasPool" class="bottomPartLeft">
|
|
|
<p class="poolTitle">标签池</p>
|
|
|
<div class="pool">
|
|
|
<el-input placeholder="请输入搜索内容" v-model="searchVal">
|
|
@@ -202,7 +202,7 @@
|
|
|
margin: 20px 150px 20px 30%;
|
|
|
.bottomPartMid {
|
|
|
top: 0;
|
|
|
- right: 40%;
|
|
|
+ right: 5%;
|
|
|
}
|
|
|
}
|
|
|
.inps {
|
|
@@ -255,10 +255,11 @@ import Vue from "vue";
|
|
|
const initRow = { orderNo: 0, name: "", description: "", exclusion: 0 };
|
|
|
const initRows = utils.getInitRow(initRow, 4);
|
|
|
export default {
|
|
|
- props: ["type", "options", "ascription", "sexType","hasId"],
|
|
|
+ props: ["type", "options", "ascription", "sexType","hasId","hasPool"],
|
|
|
data() {
|
|
|
return {
|
|
|
rows: [...initRows],
|
|
|
+ selectIndex: -1,
|
|
|
checkedExc: false,
|
|
|
checkedCon: false,
|
|
|
focusOn: -1, //聚焦的行index
|
|
@@ -305,8 +306,10 @@ export default {
|
|
|
this.searchTagList();
|
|
|
},
|
|
|
focusOn(newVal) {
|
|
|
+ this.selectIndex = newVal
|
|
|
this.checkedExc = this.rows[newVal].exclusion === 1;
|
|
|
this.checkedCon = this.rows[newVal].exclusionCon === 1;
|
|
|
+ this.searchTagList()
|
|
|
},
|
|
|
/*type() {
|
|
|
this.initData();
|
|
@@ -316,10 +319,10 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- getConnectedQas(ids,n){
|
|
|
+ getConnectedQas(e,ids,n){
|
|
|
+ e.stopPropagation();
|
|
|
if(this.tagActive===n){
|
|
|
- this.tagActive=-1;
|
|
|
- this.showQas=[];
|
|
|
+ this.hideQas()
|
|
|
return;
|
|
|
}
|
|
|
this.tagActive=n;
|
|
@@ -351,6 +354,10 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ hideQas(){
|
|
|
+ this.tagActive=-1;
|
|
|
+ this.showQas =[]
|
|
|
+ },
|
|
|
selectLeftTag(tag) {
|
|
|
const hasTag = this.isHasTag(tag, this.selectLeftTagsList);
|
|
|
if (hasTag) {
|
|
@@ -376,7 +383,7 @@ export default {
|
|
|
searchTagList() {
|
|
|
let ids = []
|
|
|
this.rows.map((it, x) => {
|
|
|
- if (it.subQuestion) {
|
|
|
+ if (it.subQuestion&&this.selectIndex===x) {
|
|
|
ids=ids.concat(it.subQuestion.split(','))
|
|
|
}
|
|
|
});
|