|
@@ -1,5 +1,5 @@
|
|
<template>
|
|
<template>
|
|
- <div class="symptomTagGroupWrapper clearfix">
|
|
|
|
|
|
+ <div class="symptomTagGroupWrapper commomSymptom clearfix">
|
|
<div class="bottomPartLeft">
|
|
<div class="bottomPartLeft">
|
|
<p class="poolTitle">标签池</p>
|
|
<p class="poolTitle">标签池</p>
|
|
<div class="pool">
|
|
<div class="pool">
|
|
@@ -31,7 +31,7 @@
|
|
</div>
|
|
</div>
|
|
<div class="bottomPartRight ">
|
|
<div class="bottomPartRight ">
|
|
<p class="poolTitle">操作界面:</p>
|
|
<p class="poolTitle">操作界面:</p>
|
|
- <ul class="tagList operationPool">
|
|
|
|
|
|
+ <ul class="tagList operationPool" :class="(type == 1 && isSymp == 0)?'':'operationPools'">
|
|
<li class = "tagItem"
|
|
<li class = "tagItem"
|
|
v-for="(item) in rightTagsList2"
|
|
v-for="(item) in rightTagsList2"
|
|
:key='item.id'
|
|
:key='item.id'
|
|
@@ -47,30 +47,31 @@
|
|
</el-input>
|
|
</el-input>
|
|
</div>
|
|
</div>
|
|
<p v-if="item.tagName" class="tagName ellipsis" :title="'[ '+item.tagName+' ]'">{{item.tagName}} </p>
|
|
<p v-if="item.tagName" class="tagName ellipsis" :title="'[ '+item.tagName+' ]'">{{item.tagName}} </p>
|
|
- <div class="attributeBox">
|
|
|
|
|
|
+ <div class="attributeBox" v-if="item.symptomType === 1 || item.symptomType === 2">
|
|
<p v-if="item.symptomType === 1" class="tagAttribute" @click.stop>跟主症状 <span @click="closeTagAttribute(item)" class="closeTagAttribute"><i class="el-icon-error"></i></span></p>
|
|
<p v-if="item.symptomType === 1" class="tagAttribute" @click.stop>跟主症状 <span @click="closeTagAttribute(item)" class="closeTagAttribute"><i class="el-icon-error"></i></span></p>
|
|
<p v-if="item.symptomType === 2" class="tagAttribute" @click.stop>跟伴随症状<span @click="closeTagAttribute(item)" class="closeTagAttribute"><i class="el-icon-error"></i></span></p>
|
|
<p v-if="item.symptomType === 2" class="tagAttribute" @click.stop>跟伴随症状<span @click="closeTagAttribute(item)" class="closeTagAttribute"><i class="el-icon-error"></i></span></p>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</li>
|
|
</ul>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
- <div class="buttonBox" v-if="type == 1 && isSymp == 0">
|
|
|
|
- <div class="mainButton">
|
|
|
|
|
|
+ <div class="buttonBox">
|
|
|
|
+ <div class="mainButton" v-if="type == 1 && isSymp == 0">
|
|
<el-button type="primary" @click="mainSymptom">跟主症状</el-button>
|
|
<el-button type="primary" @click="mainSymptom">跟主症状</el-button>
|
|
</div>
|
|
</div>
|
|
- <div class="followButton">
|
|
|
|
|
|
+ <div class="followButton" v-if="type == 1 && isSymp == 0">
|
|
<el-button type="primary" @click="followSymptom">跟伴随症状</el-button>
|
|
<el-button type="primary" @click="followSymptom">跟伴随症状</el-button>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="bottomPartMid bottomPartMidss fl" :class="(type == 1 && isSymp == 0)?'':'bottomPartMids'">
|
|
|
|
+ <p><span class="el-icon-arrow-up" @click="toggleTopDownList(1)"></span></p>
|
|
|
|
+ <p><span class="el-icon-arrow-down" @click="toggleTopDownList(2)"></span></p>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
- <!-- <div class="bottomPartMid fl">
|
|
|
|
- <p><span class="el-icon-arrow-right" @click="toRightList"></span></p>
|
|
|
|
- <p><span class="el-icon-arrow-left" @click="toLeftList"></span></p>
|
|
|
|
- </div> -->
|
|
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script>
|
|
<script>
|
|
import api from '@api/icss.js';
|
|
import api from '@api/icss.js';
|
|
import utils from '@api/utils.js';
|
|
import utils from '@api/utils.js';
|
|
|
|
+import { constants } from 'fs';
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: "SymptomTagGroup",
|
|
name: "SymptomTagGroup",
|
|
@@ -174,22 +175,22 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
selectRightTag(tag) {
|
|
selectRightTag(tag) {
|
|
- // if(tag.type == 'input'){
|
|
|
|
- // return;
|
|
|
|
- // }
|
|
|
|
- // let tmpArr = [];
|
|
|
|
- // tmpArr.push(tag);
|
|
|
|
- // if (this.selectRightTagsList.length > 0 && tag.id == this.selectRightTagsList[0].id) {
|
|
|
|
- // this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
|
|
|
|
- // }else{
|
|
|
|
- // this.selectRightTagsList = tmpArr;
|
|
|
|
- // }
|
|
|
|
- const hasTag = this.isHasTag(tag, this.selectRightTagsList)
|
|
|
|
- if (hasTag) {
|
|
|
|
- this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
|
|
|
|
- } else {
|
|
|
|
- this.selectRightTagsList.push(tag);
|
|
|
|
|
|
+ if(tag.type == 'input'){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ let tmpArr = [];
|
|
|
|
+ tmpArr.push(tag);
|
|
|
|
+ if (this.selectRightTagsList.length > 0 && tag.id == this.selectRightTagsList[0].id) {
|
|
|
|
+ this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
|
|
|
|
+ }else{
|
|
|
|
+ this.selectRightTagsList = tmpArr;
|
|
}
|
|
}
|
|
|
|
+ // const hasTag = this.isHasTag(tag, this.selectRightTagsList)
|
|
|
|
+ // if (hasTag) {
|
|
|
|
+ // this.selectRightTagsList = this.selectRightTagsList.filter(item => item.id !== tag.id)
|
|
|
|
+ // } else {
|
|
|
|
+ // this.selectRightTagsList.push(tag);
|
|
|
|
+ // }
|
|
},
|
|
},
|
|
isHasTag(item, arr) {
|
|
isHasTag(item, arr) {
|
|
for ( let i = 0; i <arr.length; i++) {
|
|
for ( let i = 0; i <arr.length; i++) {
|
|
@@ -208,6 +209,52 @@ export default {
|
|
// return utils.filterArr(this.selectRightTagsList,item,2)
|
|
// return utils.filterArr(this.selectRightTagsList,item,2)
|
|
return this.isHasTag(item, this.selectRightTagsList)
|
|
return this.isHasTag(item, this.selectRightTagsList)
|
|
},
|
|
},
|
|
|
|
+ toggleTopDownList(type){
|
|
|
|
+ if(this.selectRightTagsList.length == 0 || this.rightTagsList2.length == 0){
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ const tmpRightSelect = JSON.parse(JSON.stringify(this.selectRightTagsList))
|
|
|
|
+ const tmpRightLis = JSON.parse(JSON.stringify(this.rightTagsList2))
|
|
|
|
+ const numLen = tmpRightLis.length
|
|
|
|
+ const numId = tmpRightSelect[0].id
|
|
|
|
+ if(type == 1){
|
|
|
|
+ for(let i = 0;i < tmpRightLis.length;i++){
|
|
|
|
+ if(numId === tmpRightLis[i].id){//选中的是第几个
|
|
|
|
+ if(i == 1){//第一个不能往上移动
|
|
|
|
+ return;
|
|
|
|
+ }else{//先把这个元素和后面的输入框从数组中删除,再添加到数组里
|
|
|
|
+ let tmp1 = tmpRightLis[i]
|
|
|
|
+ let tmp2 = tmpRightLis[i+1]
|
|
|
|
+ tmpRightLis.splice(i,1)
|
|
|
|
+ tmpRightLis.splice(i,1)
|
|
|
|
+ tmpRightLis.splice(i-2,0,tmp1)
|
|
|
|
+ tmpRightLis.splice(i-1,0,tmp2)
|
|
|
|
+ this.rightTagsList2 = [...tmpRightLis]
|
|
|
|
+ this.$emit('changeActionData',this.rightTagsList2, false);
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }else if(type == 2){
|
|
|
|
+ for(let i = 0;i < tmpRightLis.length;i++){
|
|
|
|
+ if(numId === tmpRightLis[i].id){
|
|
|
|
+ if(i == numLen-1){
|
|
|
|
+ return;
|
|
|
|
+ }else{
|
|
|
|
+ let tmp1 = tmpRightLis[i]
|
|
|
|
+ let tmp2 = tmpRightLis[i+1]
|
|
|
|
+ tmpRightLis.splice(i,1)
|
|
|
|
+ tmpRightLis.splice(i,1)
|
|
|
|
+ tmpRightLis.splice(i+2,0,tmp1)
|
|
|
|
+ tmpRightLis.splice(i+3,0,tmp2)
|
|
|
|
+ this.rightTagsList2 = [...tmpRightLis]
|
|
|
|
+ this.$emit('changeActionData',this.rightTagsList2, false);
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ },
|
|
toLeftList() {
|
|
toLeftList() {
|
|
// if(!this.searchVal) {
|
|
// if(!this.searchVal) {
|
|
// this.leftTagsList = this.searchTagList()
|
|
// this.leftTagsList = this.searchTagList()
|
|
@@ -334,6 +381,17 @@ export default {
|
|
|
|
|
|
<style lang="less" >
|
|
<style lang="less" >
|
|
@import '../../less/common.less';
|
|
@import '../../less/common.less';
|
|
|
|
+.commomSymptom {
|
|
|
|
+ .tagList.operationPools {
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
|
|
+ div.bottomPartMids {
|
|
|
|
+ margin-left: 20px;
|
|
|
|
+ }
|
|
|
|
+ div.bottomPartMidss {
|
|
|
|
+ margin-top: 30px;
|
|
|
|
+ }
|
|
|
|
+}
|
|
.symptomTagGroupWrapper {
|
|
.symptomTagGroupWrapper {
|
|
.bottomPartLeft {
|
|
.bottomPartLeft {
|
|
width: 30%;
|
|
width: 30%;
|
|
@@ -412,6 +470,7 @@ export default {
|
|
.buttonBox {
|
|
.buttonBox {
|
|
width: 10%;
|
|
width: 10%;
|
|
float: left;
|
|
float: left;
|
|
|
|
+ margin-top: 30px;
|
|
}
|
|
}
|
|
.followButton {
|
|
.followButton {
|
|
margin-top: 20px;
|
|
margin-top: 20px;
|