|
@@ -51,7 +51,7 @@
|
|
|
></el-input>
|
|
|
</div>
|
|
|
<el-tag v-if="it.exclusion" type="info" size="mini">互斥项</el-tag>
|
|
|
- <el-tag v-if="it.exclusionCon" 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>
|
|
|
</el-col>
|
|
|
<el-button @click="addRow">+</el-button>
|
|
|
<div class="bottomPartMid bottomPartMidss">
|
|
@@ -62,6 +62,10 @@
|
|
|
<span class="el-icon-arrow-down" @click="orderUpDown(1)"></span>
|
|
|
</p>
|
|
|
</div>
|
|
|
+ <div class="connected-qas" v-if="showQas.length>0">
|
|
|
+ <p style="margin-bottom: 10px;">关联的问题:</p>
|
|
|
+ <p v-for="(qa,i) in showQas">{{i+1}}. {{qa.name}}</p>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
<div class="main-area sigle-row" v-if="type==3">
|
|
|
<el-col v-for="(it,i) in rows" :key="i">
|
|
@@ -123,8 +127,21 @@
|
|
|
</template>
|
|
|
<style lang="less">
|
|
|
@import "../../less/common.less";
|
|
|
+.tag-active{
|
|
|
+ background: #ccc;
|
|
|
+}
|
|
|
.main-area {
|
|
|
position: relative;
|
|
|
+ .connected-qas{
|
|
|
+ width:190px;
|
|
|
+ height:200px;
|
|
|
+ background: #fff;
|
|
|
+ position: absolute;
|
|
|
+ top:29px;
|
|
|
+ right: -150px;
|
|
|
+ border:1px #ccc solid;
|
|
|
+ padding:5px;
|
|
|
+ }
|
|
|
.bottomPartMid {
|
|
|
position: absolute;
|
|
|
top: 29px;
|
|
@@ -252,6 +269,9 @@ export default {
|
|
|
searchVal: "",
|
|
|
leftTagsList: [],
|
|
|
selectLeftTagsList:[],
|
|
|
+ tagActive:-1,
|
|
|
+ connectedQas:{},
|
|
|
+ showQas:[],
|
|
|
styles: {
|
|
|
background: "#eae7e7"
|
|
|
},
|
|
@@ -296,6 +316,41 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ getConnectedQas(ids,n){
|
|
|
+ if(this.tagActive===n){
|
|
|
+ this.tagActive=-1;
|
|
|
+ this.showQas=[];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.tagActive=n;
|
|
|
+ const idArr=ids.split(",");
|
|
|
+ let idsA = [],qa={};
|
|
|
+ this.showQas=[];
|
|
|
+ idArr.map((it)=>{
|
|
|
+ qa=this.connectedQas[it];
|
|
|
+ if(!qa){
|
|
|
+ idsA.push(it);
|
|
|
+ }else{
|
|
|
+ this.showQas.push(qa);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if(idsA.length===0){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const param = {
|
|
|
+ age:'',
|
|
|
+ ids:idsA,
|
|
|
+ sexType:this.sexType
|
|
|
+ };
|
|
|
+ api.getByIds(param).then((res)=>{
|
|
|
+ if(res.data.code=='0'){
|
|
|
+ this.connectedQas=Object.assign({},this.connectedQas,res.data.data);
|
|
|
+ idsA.map((q)=>{
|
|
|
+ this.showQas.push(this.connectedQas[q]);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
selectLeftTag(tag) {
|
|
|
const hasTag = this.isHasTag(tag, this.selectLeftTagsList);
|
|
|
if (hasTag) {
|