|
@@ -15,7 +15,7 @@
|
|
|
<tr>
|
|
|
<td class="ind">1</td>
|
|
|
<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>
|
|
|
<el-select v-if="!id" v-model="data.type" filterable placeholder="请选择" size="small">
|
|
@@ -29,7 +29,7 @@
|
|
|
<span v-else>{{data.type}}</span>
|
|
|
</td>
|
|
|
<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>
|
|
|
</tr>
|
|
|
</table>
|
|
@@ -45,7 +45,7 @@
|
|
|
<tr v-for="(item,index) in synonymous">
|
|
|
<td class="ind">{{index+1}}</td>
|
|
|
<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>
|
|
|
<!-- <el-select v-model="item.type" clearable placeholder="请选择">
|
|
@@ -59,7 +59,7 @@
|
|
|
{{data.type}}
|
|
|
</td>
|
|
|
<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 v-if="id">
|
|
|
<span @click="deleLine(index)" class="delete">删除</span>
|
|
@@ -89,26 +89,26 @@ import api from '@api/icss.js';
|
|
|
data:{
|
|
|
name:'',
|
|
|
type:'',
|
|
|
- mark:'',
|
|
|
- type:''
|
|
|
+ remark:'',
|
|
|
+ isConcept:1
|
|
|
},
|
|
|
typeList:[],
|
|
|
id:null,
|
|
|
synonymous:[//同义词
|
|
|
{
|
|
|
name:'',
|
|
|
- id:1,
|
|
|
- note:''
|
|
|
+ remark:'',
|
|
|
+ isConcept:0
|
|
|
},
|
|
|
{
|
|
|
name:'',
|
|
|
- id:2,
|
|
|
- note:''
|
|
|
+ remark:'',
|
|
|
+ isConcept:0
|
|
|
},
|
|
|
{
|
|
|
name:'',
|
|
|
- id:3,
|
|
|
- note:''
|
|
|
+ remark:'',
|
|
|
+ isConcept:0
|
|
|
},
|
|
|
],
|
|
|
colspan:4,
|
|
@@ -118,44 +118,37 @@ import api from '@api/icss.js';
|
|
|
},
|
|
|
created(){
|
|
|
this.getTypeList();
|
|
|
- const info = this.$route.params.info;
|
|
|
- if(info){
|
|
|
+ const id = this.$route.params.id;
|
|
|
+ if(id){
|
|
|
this.minTitle = '医学术语命名维护-修改';
|
|
|
- this.id = info.id;
|
|
|
- this.data.name = info.name;
|
|
|
- this.data.type = info.type;
|
|
|
- this.data.remark = info.remark;
|
|
|
+ this.id = id;
|
|
|
this.colspan = 5;
|
|
|
this.getDetail();
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
getDetail(){
|
|
|
- const params = {
|
|
|
- term:this.data.name,
|
|
|
- type:this.data.type
|
|
|
- }
|
|
|
- api.getMedicalDetail(params).then((res)=>{
|
|
|
- const result = res.data;
|
|
|
- if(result.code == 0){
|
|
|
- this.synonymous = result.data.medicalInfo;
|
|
|
- }else{
|
|
|
- this.$message({
|
|
|
- message:result.msg,
|
|
|
- type:'warning'
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
+ if(this.id){
|
|
|
+ api.getMedicalDetail({'conceptId':this.id}).then((res)=>{
|
|
|
+ const result = res.data;
|
|
|
+ if(result.code == 0){
|
|
|
+ this.data = result.data.libName[0];
|
|
|
+ this.synonymous = result.data.otherNames;
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message:result.msg,
|
|
|
+ type:'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
getTypeList(){
|
|
|
- const param = {
|
|
|
- current: this.currentPage,
|
|
|
- size: this.pageSize
|
|
|
- }
|
|
|
- api.allKnowledgeType(param).then((res)=>{
|
|
|
+ api.allKnowledgeType({'name':''}).then((res)=>{
|
|
|
const data = res.data;
|
|
|
if(data.code==0){
|
|
|
- this.typeList = data.data.records;
|
|
|
+ // this.typeList = data.data.records;
|
|
|
+ this.typeList = data.data;
|
|
|
}else{
|
|
|
this.$message({
|
|
|
message:data.msg,
|
|
@@ -166,21 +159,29 @@ import api from '@api/icss.js';
|
|
|
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(){
|
|
|
- // let index = this.synIndex;
|
|
|
- // index++
|
|
|
let singleSpan = {
|
|
|
- // index:index,
|
|
|
- term:'',
|
|
|
- id:null,
|
|
|
- type:'',
|
|
|
- mark:''
|
|
|
+ name:'',
|
|
|
+ remark:'',
|
|
|
+ isConcept:0
|
|
|
}
|
|
|
this.synonymous.push(singleSpan);
|
|
|
- // this.synIndex = index;
|
|
|
},
|
|
|
warning(msg,type){
|
|
|
this.$message({
|
|
@@ -198,27 +199,42 @@ import api from '@api/icss.js';
|
|
|
}).catch(() => {});
|
|
|
},
|
|
|
deleLine(index){
|
|
|
- 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);
|
|
|
- })
|
|
|
- });
|
|
|
+ // 只在界面删除数据,待点确认 后参才真正删除
|
|
|
+ this.synonymous.splice(index,1);
|
|
|
},
|
|
|
- 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);
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|