|
@@ -50,7 +50,7 @@
|
|
|
<template v-if="!formData.isEDB">
|
|
|
<el-form-item label="上级目录" v-if="formData.level>0">
|
|
|
<el-tooltip class="item" effect="dark" :content="getParentName" placement="top">
|
|
|
- <span>{{getParentName}}</span>
|
|
|
+ <span class="parentStr">{{getParentName}}</span>
|
|
|
</el-tooltip>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="目录名称" prop="levelVal">
|
|
@@ -136,11 +136,12 @@ export default {
|
|
|
},
|
|
|
computed:{
|
|
|
getParentName(){
|
|
|
- let str=''
|
|
|
- if(this.formData.parentArr){
|
|
|
-
|
|
|
- }
|
|
|
- return str
|
|
|
+ const arr=this.formData.parentArr||[]
|
|
|
+ let strArr=arr.reverse().map(item=>{
|
|
|
+ return item.classifyName
|
|
|
+ })
|
|
|
+
|
|
|
+ return strArr.join('/')
|
|
|
}
|
|
|
},
|
|
|
data () {
|
|
@@ -186,33 +187,21 @@ export default {
|
|
|
|
|
|
if(this.title==='添加') {
|
|
|
res = await dataBaseInterface.nodeAdd({
|
|
|
- ClassifyName: this.formData.level === 0
|
|
|
- ? this.formData.level_1
|
|
|
- : this.formData.level === 1
|
|
|
- ? this.formData.level_2
|
|
|
- : this.formData.level === 2
|
|
|
- ? this.formData.level_3
|
|
|
- :'',
|
|
|
+ ClassifyName: this.formData.levelVal||'',
|
|
|
ParentId:this.formData.parent_id || 0,
|
|
|
Level: this.formData.level
|
|
|
})
|
|
|
}else if(this.title==='编辑') {
|
|
|
- res = this.formData.level===4
|
|
|
+ res = this.formData.isEDB
|
|
|
? await dataBaseInterface.targetEdit({
|
|
|
ClassifyId: this.formData.level_menu[this.formData.level_menu.length - 1],
|
|
|
EdbInfoId: this.formData.edbinfo_id,
|
|
|
- EdbName: this.formData.level_4,
|
|
|
+ EdbName: this.formData.levelVal,
|
|
|
Frequency: this.formData.frequency,
|
|
|
Unit: this.formData.unit
|
|
|
})
|
|
|
: await dataBaseInterface.nodeEdit({
|
|
|
- ClassifyName: this.formData.level === 1
|
|
|
- ? this.formData.level_1
|
|
|
- : this.formData.level === 2
|
|
|
- ? this.formData.level_2
|
|
|
- : this.formData.level === 3
|
|
|
- ?this.formData.level_3
|
|
|
- :'',
|
|
|
+ ClassifyName: this.formData.levelVal||'',
|
|
|
ClassifyId:this.formData.classify_id || 0
|
|
|
})
|
|
|
}
|
|
@@ -220,8 +209,8 @@ export default {
|
|
|
this.$message.success(res.Msg);
|
|
|
|
|
|
if(this.title==='添加') this.callbackHandle('add');
|
|
|
- else if(this.title==='编辑' && this.formData.level===4) this.callbackHandle('update');
|
|
|
- else if(this.title==='编辑' && this.formData.level!==4) this.callbackHandle();
|
|
|
+ else if(this.title==='编辑' && this.formData.isEDB) this.callbackHandle('update');
|
|
|
+ else if(this.title==='编辑' && !this.formData.isEDB) this.callbackHandle();
|
|
|
|
|
|
|
|
|
},
|
|
@@ -261,6 +250,13 @@ export default {
|
|
|
</script>
|
|
|
<style lang='scss'>
|
|
|
.Dialog-box {
|
|
|
+ .parentStr{
|
|
|
+ display: block;
|
|
|
+ width: 304px;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ }
|
|
|
.dialog-main {
|
|
|
padding-left: 50px;
|
|
|
}
|