|
@@ -4,41 +4,75 @@
|
|
<div class="contents">
|
|
<div class="contents">
|
|
<div class="content">
|
|
<div class="content">
|
|
<h3>选择标签</h3>
|
|
<h3>选择标签</h3>
|
|
- <p>{{name}}</p>
|
|
|
|
|
|
+ <p :class="['ename',{'name':flag}]">{{name}}</p>
|
|
|
|
+ <div v-if="!flag" class="searchBox">
|
|
|
|
+ <input type="text" name="" v-model="searchStr" class="name">
|
|
|
|
+ <span class="search" @click="search">搜索</span>
|
|
|
|
+ <ul v-if="showFlag">
|
|
|
|
+ <li v-for="it in searchDatas" :key="it.id" @click="choose(it)" :title="it.tagName.length>10?it.tagName:''">{{it.tagName}}</li>
|
|
|
|
+ </ul>
|
|
|
|
+ </div>
|
|
|
|
+ <span></span>
|
|
<h3>添加别名</h3>
|
|
<h3>添加别名</h3>
|
|
- <p>本体添加:</p>
|
|
|
|
|
|
+ <p class="subtitle">本体添加:</p>
|
|
<table class="deptbox">
|
|
<table class="deptbox">
|
|
<tr>
|
|
<tr>
|
|
<td>本体</td>
|
|
<td>本体</td>
|
|
<td>拼音</td>
|
|
<td>拼音</td>
|
|
</tr>
|
|
</tr>
|
|
- <tr v-for="item in questionName">
|
|
|
|
- <td class="desc">{{item.retrievalName}}</td>
|
|
|
|
- <td>{{item.retrievalSpell}}</td>
|
|
|
|
|
|
+ <tr v-if="flag" v-for="item in selfName">
|
|
|
|
+ <!-- <td class="desc">{{item.retrievalName}}</td>
|
|
|
|
+ <td>{{item.retrievalSpell}}</td> -->
|
|
|
|
+ <td><input type="text" name="" v-model="item.retrievalName"></td>
|
|
|
|
+ <td><input type="text" name="" v-model="item.retrievalSpell"></td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr v-if="!flag" v-for="(i,index) in selfEmpty">
|
|
|
|
+ <td><input type="text" name="" v-model="selfEmpty[index].retrievalName"></td>
|
|
|
|
+ <td><input type="text" name="" v-model="selfEmpty[index].retrievalSpell"></td>
|
|
</tr>
|
|
</tr>
|
|
</table>
|
|
</table>
|
|
- <p>别名添加:</p>
|
|
|
|
|
|
+ <p class="subtitle">别名添加:</p>
|
|
<table class="deptbox">
|
|
<table class="deptbox">
|
|
<tr>
|
|
<tr>
|
|
<td>别名</td>
|
|
<td>别名</td>
|
|
<td>拼音</td>
|
|
<td>拼音</td>
|
|
</tr>
|
|
</tr>
|
|
<tr v-if="retrievalNames.length>0" v-for="it in retrievalNames">
|
|
<tr v-if="retrievalNames.length>0" v-for="it in retrievalNames">
|
|
- <td class="desc">{{it.retrievalName}}</td>
|
|
|
|
- <td>{{it.retrievalSpell}}</td>
|
|
|
|
|
|
+ <td><input type="text" name="" v-model="it.retrievalName"></td>
|
|
|
|
+ <td><input type="text" name="" v-model="it.retrievalSpell"></td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr v-for="(i,index) in retrievalEmpty">
|
|
|
|
+ <td><input type="text" name="" v-model="retrievalEmpty[index].retrievalName"></td>
|
|
|
|
+ <td><input type="text" name="" v-model="retrievalEmpty[index].retrievalSpell"></td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr @click="addSpan(2)">
|
|
|
|
+ <td colspan="2" class="addSpan">+</td>
|
|
</tr>
|
|
</tr>
|
|
</table>
|
|
</table>
|
|
- <p>子项添加:</p>
|
|
|
|
|
|
+ <p class="subtitle">子项添加:</p>
|
|
<table class="deptbox">
|
|
<table class="deptbox">
|
|
<tr>
|
|
<tr>
|
|
<td>子项</td>
|
|
<td>子项</td>
|
|
<td>拼音</td>
|
|
<td>拼音</td>
|
|
</tr>
|
|
</tr>
|
|
<tr v-if="retrievalSonNames.length>0" v-for="v in retrievalSonNames">
|
|
<tr v-if="retrievalSonNames.length>0" v-for="v in retrievalSonNames">
|
|
- <td class="desc">{{v.retrievalName}}</td>
|
|
|
|
- <td>{{v.retrievalSpell}}</td>
|
|
|
|
|
|
+ <td><input type="text" name="" v-model="v.retrievalName"></td>
|
|
|
|
+ <td><input type="text" name="" v-model="v.retrievalSpell"></td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr v-for="(k,index) in sonEmpty">
|
|
|
|
+ <td><input type="text" name="" v-model="sonEmpty[index].retrievalName"></td>
|
|
|
|
+ <td><input type="text" name="" v-model="sonEmpty[index].retrievalSpell"></td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr @click="addSpan(3)">
|
|
|
|
+ <td colspan="2" class="addSpan">+</td>
|
|
</tr>
|
|
</tr>
|
|
</table>
|
|
</table>
|
|
|
|
+ <div class="btn">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="comfirn"
|
|
|
|
+ >确 定</el-button>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -49,18 +83,55 @@
|
|
name:'AddSimilarName',
|
|
name:'AddSimilarName',
|
|
data(){
|
|
data(){
|
|
return{
|
|
return{
|
|
- questionName:[], //本体
|
|
|
|
- retrievalNames:[], //同义词
|
|
|
|
|
|
+ selfName:[], //本体
|
|
|
|
+ retrievalNames:[], //别名
|
|
retrievalSonNames:[], //子项
|
|
retrievalSonNames:[], //子项
|
|
id:null,
|
|
id:null,
|
|
name:"",
|
|
name:"",
|
|
- minTitle:"别名维护-添加别名"
|
|
|
|
|
|
+ minTitle:"别名维护-添加别名",
|
|
|
|
+ toast:'',
|
|
|
|
+ flag:false, //添加修改的标识,true-修改
|
|
|
|
+ selfEmpty:[ //本体 新增
|
|
|
|
+ {
|
|
|
|
+ questionName: '',
|
|
|
|
+ questionId:'',
|
|
|
|
+ retrievalName:'',
|
|
|
|
+ retrievalSpell:'',
|
|
|
|
+ retrievalType:1
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ retrievalEmpty:[ //别名新增
|
|
|
|
+ {
|
|
|
|
+ questionName:'',
|
|
|
|
+ questionId:'',
|
|
|
|
+ retrievalName:'',
|
|
|
|
+ retrievalSpell:'',
|
|
|
|
+ retrievalType:2
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ sonEmpty:[ //子项新增
|
|
|
|
+ {
|
|
|
|
+ questionName:'',
|
|
|
|
+ questionId:'',
|
|
|
|
+ retrievalName:'',
|
|
|
|
+ retrievalSpell:'',
|
|
|
|
+ retrievalType:3
|
|
|
|
+ }
|
|
|
|
+ ],
|
|
|
|
+ searchDatas:[],
|
|
|
|
+ searchStr:'',
|
|
|
|
+ showFlag:false
|
|
}
|
|
}
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
- this.id = this.$route.params.id;
|
|
|
|
- this.name = this.$route.params.name;
|
|
|
|
- if(this.id){
|
|
|
|
|
|
+ const id = this.$route.params.id;
|
|
|
|
+ if(id){
|
|
|
|
+ this.id = id;
|
|
|
|
+ this.name = this.$route.params.name;
|
|
|
|
+ this.selfEmpty[0].questionId = this.retrievalEmpty[0].questionId = this.sonEmpty[0].questionId = this.$route.params.id;
|
|
|
|
+ this.selfEmpty[0].questionName = this.retrievalEmpty[0].questionName = this.sonEmpty[0].questionName = this.$route.params.name;
|
|
|
|
+ this.flag = true;
|
|
|
|
+ this.minTitle = "别名维护-修改别名";
|
|
this.getDetail();
|
|
this.getDetail();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -71,11 +142,10 @@
|
|
api.similarNameDetl(param).then((res)=>{
|
|
api.similarNameDetl(param).then((res)=>{
|
|
let result = res.data;
|
|
let result = res.data;
|
|
if(result.code==0){
|
|
if(result.code==0){
|
|
- // this.data = result.data;
|
|
|
|
const data = result.data;
|
|
const data = result.data;
|
|
for(let i in data){
|
|
for(let i in data){
|
|
if(i==1){
|
|
if(i==1){
|
|
- this.questionName = data[i];
|
|
|
|
|
|
+ this.selfName = data[i];
|
|
}else if(i==2){
|
|
}else if(i==2){
|
|
this.retrievalNames = data[i];
|
|
this.retrievalNames = data[i];
|
|
}else if(i==3){
|
|
}else if(i==3){
|
|
@@ -86,6 +156,79 @@
|
|
console.log(result.msg);
|
|
console.log(result.msg);
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+ },
|
|
|
|
+ addSpan(type){
|
|
|
|
+ let emptySpan = {
|
|
|
|
+ questionName:this.name,
|
|
|
|
+ questionId:this.id,
|
|
|
|
+ retrievalName:'',
|
|
|
|
+ retrievalSpell:'',
|
|
|
|
+ retrievalType:type
|
|
|
|
+ }
|
|
|
|
+ if(type == 2){
|
|
|
|
+ this.retrievalEmpty.push(emptySpan);
|
|
|
|
+ }else if(type == 3){
|
|
|
|
+ this.sonEmpty.push(emptySpan);
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ comfirn(){
|
|
|
|
+ const {selfName,selfEmpty,retrievalNames,retrievalEmpty,retrievalSonNames,sonEmpty} = this;
|
|
|
|
+ let dataList = [];
|
|
|
|
+ if(this.flag){ //修改
|
|
|
|
+ dataList = selfName.concat(retrievalNames,retrievalEmpty,retrievalSonNames,sonEmpty);
|
|
|
|
+ this.toast = "修改成功";
|
|
|
|
+ }else{
|
|
|
|
+ dataList = selfEmpty.concat(retrievalNames,retrievalEmpty,retrievalSonNames,sonEmpty);
|
|
|
|
+ this.toast = "添加成功";
|
|
|
|
+ }
|
|
|
|
+ console.log(111,dataList);
|
|
|
|
+ const params = {
|
|
|
|
+ 'itemList':dataList,
|
|
|
|
+ 'questionId':this.id,
|
|
|
|
+ 'questionName':this.name
|
|
|
|
+ }
|
|
|
|
+ api.addSimilarName(params).then((res)=>{
|
|
|
|
+ const result = res.data;
|
|
|
|
+ if(result.code==0){
|
|
|
|
+ this.$message({
|
|
|
|
+ message: this.toast,
|
|
|
|
+ type: 'success',
|
|
|
|
+ });
|
|
|
|
+ this.$router.push({path:'LT-YXSJWH-BMWH'});
|
|
|
|
+ }else{
|
|
|
|
+ console.log(result.msg);
|
|
|
|
+ this.$message.error(result.msg);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ search(){
|
|
|
|
+ const param = {
|
|
|
|
+ 'tagName':this.searchStr,
|
|
|
|
+ 'notTagType':[8,10,11]
|
|
|
|
+ }
|
|
|
|
+ api.searchLable(param).then((res)=>{
|
|
|
|
+ const result = res.data;
|
|
|
|
+ console.log(123,result);
|
|
|
|
+ if(result.code==0){
|
|
|
|
+ this.searchDatas = result.data;
|
|
|
|
+ if(result.data.length>0){
|
|
|
|
+ this.showFlag = true;
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ console.log(result.msg);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ choose(item){
|
|
|
|
+ console.log(item);
|
|
|
|
+ this.name = item.tagName;
|
|
|
|
+ this.id = item.id;
|
|
|
|
+ this.showFlag = false;
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ watch:{
|
|
|
|
+ name:function(newVal,oldVal){
|
|
|
|
+ this.selfEmpty[0].questionName = this.retrievalEmpty[0].questionName = this.sonEmpty[0].questionName = newVal;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -94,29 +237,87 @@
|
|
@import "../../less/admin.less";
|
|
@import "../../less/admin.less";
|
|
.content{
|
|
.content{
|
|
background: #fff;
|
|
background: #fff;
|
|
- padding: 20px 10px 30px;
|
|
|
|
|
|
+ padding: 20px 20px 30px;
|
|
|
|
+ color: #545455;
|
|
|
|
+ }
|
|
|
|
+ .name{
|
|
|
|
+ width: 221px;
|
|
|
|
+ height: 30px;
|
|
|
|
+ margin:20px 0 30px 0;
|
|
|
|
+ padding-left: 7px;
|
|
|
|
+ }
|
|
|
|
+ .search{
|
|
|
|
+ display: inline-block;
|
|
|
|
+ width: 56px;
|
|
|
|
+ height: 32px;
|
|
|
|
+ border-left: 1px solid #ccc;
|
|
|
|
+ position: relative;
|
|
|
|
+ left: -57px;
|
|
|
|
+ vertical-align: middle;
|
|
|
|
+ line-height: 32px;
|
|
|
|
+ bottom: 2px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ cursor: default;
|
|
|
|
+ }
|
|
|
|
+ h3{
|
|
|
|
+ font-size: 16px;
|
|
|
|
+ }
|
|
|
|
+ .subtitle{
|
|
|
|
+ // font-size: 12px;
|
|
|
|
+ margin: 21px 0 10px 0;
|
|
}
|
|
}
|
|
.deptbox{
|
|
.deptbox{
|
|
// width: 100%;
|
|
// width: 100%;
|
|
background: #fff;
|
|
background: #fff;
|
|
padding: 20px 10px 30px;
|
|
padding: 20px 10px 30px;
|
|
font-size: 14px;
|
|
font-size: 14px;
|
|
- // color: #545455;
|
|
|
|
text-align: left;
|
|
text-align: left;
|
|
|
|
+ border-collapse: collapse;
|
|
>tr{
|
|
>tr{
|
|
height: 30px;
|
|
height: 30px;
|
|
- // width: 111px;
|
|
|
|
- /* td:first-child{
|
|
|
|
- text-align: right;
|
|
|
|
- width: 75px;
|
|
|
|
- } */
|
|
|
|
td{
|
|
td{
|
|
width: 111px;
|
|
width: 111px;
|
|
border: 1px solid #666;
|
|
border: 1px solid #666;
|
|
|
|
+ padding-left: 7px;
|
|
|
|
+ }
|
|
|
|
+ input{
|
|
|
|
+ border:none;
|
|
|
|
+ width: 100%;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .addSpan{
|
|
|
|
+ text-align: center;
|
|
|
|
+ cursor: pointer;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ .btn {
|
|
|
|
+ text-align: right;
|
|
|
|
+ }
|
|
|
|
+ .ename{
|
|
|
|
+ height: 20px;
|
|
|
|
+ margin-top: 10px;
|
|
|
|
+ }
|
|
|
|
+ .searchBox{
|
|
|
|
+ position: relative;
|
|
|
|
+ ul{
|
|
|
|
+ width: 175px;
|
|
|
|
+ position: absolute;
|
|
|
|
+ top: 55px;
|
|
|
|
+ border:1px solid #ccc;
|
|
|
|
+ background: #fff;
|
|
|
|
+ // margin-left: 5px;
|
|
|
|
+ li{
|
|
|
|
+ border:1px solid #fff;
|
|
|
|
+ padding-left: 7px;
|
|
|
|
+ height: 27px;
|
|
|
|
+ line-height: 27px;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
+ }
|
|
|
|
+ li:hover{
|
|
|
|
+ border-color:#22ccc8;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- .desc{
|
|
|
|
- // vertical-align: top;
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|