|
@@ -46,7 +46,7 @@
|
|
|
@click="selectPart(0)"
|
|
|
v-else
|
|
|
>
|
|
|
- <span class="hzx ellipsis" v-for="item in poolDetailList[0][0].questionDetailList" :title="'[ '+item.name+' ]'" v-show="choose == 'multiple'" :key="item.id">{{item.name}}</span>
|
|
|
+ <span :class="['hzx','ellipsis',{'redWordTip':isRed(poolDetailList[0][0].sexType)}]" v-for="item in poolDetailList[0][0].questionDetailList" :title="'[ '+item.name+' ]'" v-show="choose == 'multiple'" :key="item.id">{{item.name}}</span>
|
|
|
</div>
|
|
|
<div class="onlyBottom pubList">
|
|
|
<ul class="clearfix">
|
|
@@ -59,20 +59,20 @@
|
|
|
>
|
|
|
<ul v-if="choose == 'single'">
|
|
|
<template v-for="item in poolDetailList[n]">
|
|
|
- <li class="partDetail ellipsis" v-for="part in item.questionDetailList" :title="'[ '+item.name+' ]'" :key="part.id">
|
|
|
+ <li :class="['partDetail','ellipsis',{'redWordTip':isRed(item.sexType)}]" v-for="part in item.questionDetailList" :title="'[ '+item.name+' ]'" :key="part.id">
|
|
|
{{part.name}}
|
|
|
</li>
|
|
|
</template>
|
|
|
</ul>
|
|
|
<ul v-else>
|
|
|
<template v-if="n == 1">
|
|
|
- <li class="partDetail ellipsis" v-for="item in poolDetailList[n][0].questionDetailList" :style="getStyleR(item.id)?styleR:null" :title="'[ '+item.name+' ]'" :key="item.id">
|
|
|
- [ {{item.name}} ]
|
|
|
+ <li :class="['partDetail','ellipsis',{'redWordTip':isRed(poolDetailList[n][0].sexType)}]" v-for="item in poolDetailList[n][0].questionDetailList" :style="getStyleR(item.id)?styleR:null" :title="'[ '+item.name+' ]'" :key="item.id">
|
|
|
+ [ {{item.name}}{{poolDetailList[n][0].sexType}} ]
|
|
|
</li>
|
|
|
</template>
|
|
|
<template v-if="n == 2 || n == 3 || n == 4 || n == 5">
|
|
|
- <li class="partDetail ellipsis" v-for="item in poolDetailList[n]" :style="getStyleR(item.id)?styleR:null" :title="'[ '+item.tagName+' ]'" :key="item.tagName" @click="selectTagOne($event,item.id,n)">
|
|
|
- [ {{item.tagName}} ]
|
|
|
+ <li :class="['partDetail','ellipsis',{'redWordTip':isRed(item.sexType)}]" v-for="item in poolDetailList[n]" :style="getStyleR(item.id)?styleR:null" :title="'[ '+item.tagName+' ]'" :key="item.tagName" @click="selectTagOne($event,item.id,n)">
|
|
|
+ [ {{item.tagName}}{{item.sexType}} ]
|
|
|
</li>
|
|
|
</template>
|
|
|
</ul>
|
|
@@ -129,6 +129,10 @@ export default {
|
|
|
default: 'single', //multiple 多选 single 单选
|
|
|
type: String
|
|
|
},
|
|
|
+ isEditOrCopy: {
|
|
|
+ default: false,
|
|
|
+ type: Boolean
|
|
|
+ },
|
|
|
options: {
|
|
|
default: () => [],
|
|
|
type: Array
|
|
@@ -236,7 +240,8 @@ export default {
|
|
|
},
|
|
|
sexType(newVal, preVal) {
|
|
|
if (newVal != preVal) {
|
|
|
- if (JSON.stringify(newVal) != JSON.stringify(preVal) && this.tmpNum != 1) {
|
|
|
+ this.searchTagList()
|
|
|
+ if (JSON.stringify(newVal) != JSON.stringify(preVal) && this.tmpNum != 1&&!this.isEditOrCopy) {
|
|
|
this.clearData()
|
|
|
}
|
|
|
}
|
|
@@ -260,6 +265,17 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ isRed(sexType){
|
|
|
+ if(this.sexType == 3){
|
|
|
+ return false;
|
|
|
+ }else if(this.sexType != 3&&sexType == 3){
|
|
|
+ return false;
|
|
|
+ }else if(this.sexType != 3&&this.sexType == sexType){
|
|
|
+ return false;
|
|
|
+ }else{
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ },
|
|
|
clearData(){
|
|
|
this.poolDetailList = [[{questionDetailList:[]}],[{questionDetailList:[]}],[],[],[],[]]
|
|
|
this.poolDetailListTips = [[],[],[],[],[],[]]
|
|
@@ -518,7 +534,7 @@ export default {
|
|
|
this.selectArr.map((flg,idx)=>{ //判断右侧有没有选中
|
|
|
if(flg){ //有选中
|
|
|
if(idx == 0 || idx == 1){
|
|
|
- if(tmpArr.length > 1){
|
|
|
+ if(tmpArr.length > 1){ //选中超过两个标签不能添加到0,1位置
|
|
|
this.$message({
|
|
|
showClose: true,
|
|
|
message: '添加的数据有误',
|
|
@@ -619,6 +635,9 @@ export default {
|
|
|
</script>
|
|
|
<style lang="less">
|
|
|
@import "../../less/common.less";
|
|
|
+.redWordTip {
|
|
|
+ color: red;
|
|
|
+}
|
|
|
.bottomPart {
|
|
|
box-sizing: border-box;
|
|
|
padding-right: 100px;
|