|
@@ -15,7 +15,7 @@
|
|
<tr>
|
|
<tr>
|
|
<td class="ind">1</td>
|
|
<td class="ind">1</td>
|
|
<td :title="data.name&&data.name.length>9?data.name:''">
|
|
<td :title="data.name&&data.name.length>9?data.name:''">
|
|
- <el-input v-model="data.name" placeholder="请输入术语" maxlength="30" size="small"></el-input>
|
|
|
|
|
|
+ <el-input v-model="data.name" placeholder="请输入术语" maxlength="30" size="small" @input="handleInput"></el-input>
|
|
</td>
|
|
</td>
|
|
<td>
|
|
<td>
|
|
<el-select v-if="!id" v-model="data.type" filterable placeholder="请选择" size="small">
|
|
<el-select v-if="!id" v-model="data.type" filterable placeholder="请选择" size="small">
|
|
@@ -29,7 +29,7 @@
|
|
<span v-else>{{data.type}}</span>
|
|
<span v-else>{{data.type}}</span>
|
|
</td>
|
|
</td>
|
|
<td class="desc">
|
|
<td class="desc">
|
|
- <el-input v-model="data.mark" placeholder="请输入术语说明" maxlength="120" size="small"></el-input>
|
|
|
|
|
|
+ <el-input v-model="data.remark" placeholder="请输入术语说明" maxlength="120" size="small" @input="handleRemark"></el-input>
|
|
</td>
|
|
</td>
|
|
</tr>
|
|
</tr>
|
|
</table>
|
|
</table>
|
|
@@ -45,7 +45,7 @@
|
|
<tr v-for="(item,index) in synonymous">
|
|
<tr v-for="(item,index) in synonymous">
|
|
<td class="ind">{{index+1}}</td>
|
|
<td class="ind">{{index+1}}</td>
|
|
<td :title="item.name&&item.name.length>9?item.name:''">
|
|
<td :title="item.name&&item.name.length>9?item.name:''">
|
|
- <el-input v-model="item.name" placeholder="请输入术语" maxlength="30" size="small"></el-input>
|
|
|
|
|
|
+ <el-input v-model="item.name" placeholder="请输入术语" maxlength="30" size="small" @input="handleInput(index,item.name)"></el-input>
|
|
</td>
|
|
</td>
|
|
<td>
|
|
<td>
|
|
<!-- <el-select v-model="item.type" clearable placeholder="请选择">
|
|
<!-- <el-select v-model="item.type" clearable placeholder="请选择">
|
|
@@ -59,7 +59,7 @@
|
|
{{data.type}}
|
|
{{data.type}}
|
|
</td>
|
|
</td>
|
|
<td class="desc">
|
|
<td class="desc">
|
|
- <el-input v-model="item.note" placeholder="请输入术语说明" maxlength="120" size="small"></el-input>
|
|
|
|
|
|
+ <el-input v-model="item.remark" placeholder="请输入术语说明" maxlength="120" size="small" @input="handleRemark(index,item.name)"></el-input>
|
|
</td>
|
|
</td>
|
|
<td v-if="id">
|
|
<td v-if="id">
|
|
<span @click="deleLine(index)" class="delete">删除</span>
|
|
<span @click="deleLine(index)" class="delete">删除</span>
|
|
@@ -89,25 +89,26 @@ import api from '@api/icss.js';
|
|
data:{
|
|
data:{
|
|
name:'',
|
|
name:'',
|
|
type:'',
|
|
type:'',
|
|
- mark:''
|
|
|
|
|
|
+ remark:'',
|
|
|
|
+ isConcept:1
|
|
},
|
|
},
|
|
typeList:[],
|
|
typeList:[],
|
|
id:null,
|
|
id:null,
|
|
synonymous:[//同义词
|
|
synonymous:[//同义词
|
|
{
|
|
{
|
|
name:'',
|
|
name:'',
|
|
- id:1,
|
|
|
|
- note:''
|
|
|
|
|
|
+ remark:'',
|
|
|
|
+ isConcept:0
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name:'',
|
|
name:'',
|
|
- id:2,
|
|
|
|
- note:''
|
|
|
|
|
|
+ remark:'',
|
|
|
|
+ isConcept:0
|
|
},
|
|
},
|
|
{
|
|
{
|
|
name:'',
|
|
name:'',
|
|
- id:3,
|
|
|
|
- note:''
|
|
|
|
|
|
+ remark:'',
|
|
|
|
+ isConcept:0
|
|
},
|
|
},
|
|
],
|
|
],
|
|
colspan:4,
|
|
colspan:4,
|
|
@@ -117,24 +118,16 @@ import api from '@api/icss.js';
|
|
},
|
|
},
|
|
created(){
|
|
created(){
|
|
this.getTypeList();
|
|
this.getTypeList();
|
|
- // const info = this.$route.params.info;
|
|
|
|
const id = this.$route.params.id;
|
|
const id = this.$route.params.id;
|
|
if(id){
|
|
if(id){
|
|
this.minTitle = '医学术语命名维护-修改';
|
|
this.minTitle = '医学术语命名维护-修改';
|
|
this.id = id;
|
|
this.id = id;
|
|
- // this.data.name = info.libName;
|
|
|
|
- // this.data.type = info.libType;
|
|
|
|
- // this.data.remark = info.remark;
|
|
|
|
this.colspan = 5;
|
|
this.colspan = 5;
|
|
this.getDetail();
|
|
this.getDetail();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
methods:{
|
|
methods:{
|
|
getDetail(){
|
|
getDetail(){
|
|
- // const params = {
|
|
|
|
- // term:this.data.name,
|
|
|
|
- // type:this.data.type
|
|
|
|
- // }
|
|
|
|
if(this.id){
|
|
if(this.id){
|
|
api.getMedicalDetail({'conceptId':this.id}).then((res)=>{
|
|
api.getMedicalDetail({'conceptId':this.id}).then((res)=>{
|
|
const result = res.data;
|
|
const result = res.data;
|
|
@@ -151,14 +144,11 @@ import api from '@api/icss.js';
|
|
}
|
|
}
|
|
},
|
|
},
|
|
getTypeList(){
|
|
getTypeList(){
|
|
- // const param = {
|
|
|
|
- // current: this.currentPage,
|
|
|
|
- // size: this.pageSize
|
|
|
|
- // }
|
|
|
|
api.allKnowledgeType({'name':''}).then((res)=>{
|
|
api.allKnowledgeType({'name':''}).then((res)=>{
|
|
const data = res.data;
|
|
const data = res.data;
|
|
if(data.code==0){
|
|
if(data.code==0){
|
|
- this.typeList = data.data.records;
|
|
|
|
|
|
+ // this.typeList = data.data.records;
|
|
|
|
+ this.typeList = data.data;
|
|
}else{
|
|
}else{
|
|
this.$message({
|
|
this.$message({
|
|
message:data.msg,
|
|
message:data.msg,
|
|
@@ -169,15 +159,27 @@ import api from '@api/icss.js';
|
|
console.log(error);
|
|
console.log(error);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- handleInput(){//限制输入类型
|
|
|
|
-
|
|
|
|
|
|
+ handleInput(index,name){
|
|
|
|
+ // 可输入内容:字母、数字、汉字、特殊字符:% —— 其余不可输入;
|
|
|
|
+ if(!name){//标准词输入
|
|
|
|
+ this.data.name = this.data.name.replace(/[^%0-9a-zA-Z\u4e00-\u9fa5]/g,'');
|
|
|
|
+ }else{
|
|
|
|
+ this.synonymous[index].name = this.synonymous[index].name.replace(/[^%0-9a-zA-Z\u4e00-\u9fa5]/g,'');
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleRemark(index,name){
|
|
|
|
+ //说明只能输入中文
|
|
|
|
+ if(!name){//标准词输入
|
|
|
|
+ this.data.remark = this.data.remark.replace(/[^\u4e00-\u9fa5]/g,'');
|
|
|
|
+ }else{
|
|
|
|
+ this.synonymous[index].remark = this.synonymous[index].remark.replace(/[^\u4e00-\u9fa5]/g,'');
|
|
|
|
+ }
|
|
},
|
|
},
|
|
addSpan(){
|
|
addSpan(){
|
|
let singleSpan = {
|
|
let singleSpan = {
|
|
- term:'',
|
|
|
|
- id:null,
|
|
|
|
- type:'',
|
|
|
|
- mark:''
|
|
|
|
|
|
+ name:'',
|
|
|
|
+ remark:'',
|
|
|
|
+ isConcept:0
|
|
}
|
|
}
|
|
this.synonymous.push(singleSpan);
|
|
this.synonymous.push(singleSpan);
|
|
},
|
|
},
|
|
@@ -199,27 +201,40 @@ import api from '@api/icss.js';
|
|
deleLine(index){
|
|
deleLine(index){
|
|
// 只在界面删除数据,待点确认 后参才真正删除
|
|
// 只在界面删除数据,待点确认 后参才真正删除
|
|
this.synonymous.splice(index,1);
|
|
this.synonymous.splice(index,1);
|
|
- /*const item = this.synonymous[index];
|
|
|
|
- const param = {
|
|
|
|
- term:item.term,
|
|
|
|
- type:item.type,
|
|
|
|
- id:item.id
|
|
|
|
- }
|
|
|
|
- this.showConfirmDialog('是否删除该同义词?',()=>{
|
|
|
|
- api.deletMedicalName(param).then((res)=>{
|
|
|
|
- if(res.data.code=='0'){
|
|
|
|
- this.warning(res.data.msg||'操作成功','success');
|
|
|
|
- this.getDetail();
|
|
|
|
- }else{
|
|
|
|
- this.warning(res.data.msg);
|
|
|
|
- }
|
|
|
|
- }).catch((error)=>{
|
|
|
|
- this.warning(error);
|
|
|
|
- })
|
|
|
|
- });*/
|
|
|
|
},
|
|
},
|
|
- comfirn(){
|
|
|
|
- console.log("修改数据:",this.synonymous);
|
|
|
|
|
|
+ comfirn(){
|
|
|
|
+ if(!this.data.name){
|
|
|
|
+ this.warning('请输入标准词');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ if(!this.data.type){
|
|
|
|
+ this.warning('请选择术语类型');
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+ // 过滤同义词空数据
|
|
|
|
+ let realData = this.synonymous.filter((item)=>{
|
|
|
|
+ return item.name;
|
|
|
|
+ })
|
|
|
|
+ let detailList = [];
|
|
|
|
+ detailList[0] = this.data;
|
|
|
|
+ for(let i=0; i<realData.length; i++){
|
|
|
|
+ realData[i].type = this.data.type;
|
|
|
|
+ detailList.push(realData[i]);
|
|
|
|
+ }
|
|
|
|
+ const params = {
|
|
|
|
+ 'name':this.data.name,
|
|
|
|
+ 'type':this.data.type,
|
|
|
|
+ 'detailList':detailList
|
|
|
|
+ }
|
|
|
|
+ api.addMedicalName(params).then((res)=>{
|
|
|
|
+ const result = res.data;
|
|
|
|
+ if(result.code==0){
|
|
|
|
+ this.warning(res.data.msg||'操作成功','success');
|
|
|
|
+ this.$router.push({name:'MedicalName'});
|
|
|
|
+ }else{
|
|
|
|
+ this.warning(res.data.msg);
|
|
|
|
+ }
|
|
|
|
+ })
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|