@ -1,7 +1,12 @@
< template >
< template >
< div class = "paramBindingBox" >
< div class = "paramBindingBox" >
< div class = "leftTree" >
< div class = "leftTree" >
< h3 > 设备列表 < / h3 >
< h3 >
设备列表
< el -button type = "primary" @click ="generate" size = "mini"
> 生成rptparamindex < / e l - b u t t o n
>
< / h3 >
< div class = "treeBox" >
< div class = "treeBox" >
< el -tree
< el -tree
ref = "tree"
ref = "tree"
@ -64,9 +69,40 @@
> < / e l - o p t i o n >
> < / e l - o p t i o n >
< / e l - s e l e c t >
< / e l - s e l e c t >
< / div >
< / div >
< el -button
: disabled = "ljName == '' || iedName == ''"
@ click = "saveBind"
type = "primary"
style = "margin-left: 16px"
>
保存
< / e l - b u t t o n >
< / div >
< / div >
< el -divider > < / e l - d i v i d e r >
< el -divider > < / e l - d i v i d e r >
{ { bindInfo } }
< p class = "warnMsg" >
< el -tag
type = "warning"
v - for = "(item, index) in warnMsg"
: key = "index"
> { { item } } < / e l - t a g
>
< / p >
< div class = "showMsgBox" >
< p class = "outsideLabel" v-for ="(item, index) in bindInfoArray" >
< span
> { { item . comment } }
< b > ( { { item . name } } ) < / b >
< / span >
< span >
< em
v - for = "(item2, index2) in previewData"
: key = "index2"
v - if = "item.name == item2.colName"
> { { item2 . lastName } } < / e m
> < / s p a n
>
< / p >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
@ -78,6 +114,8 @@ import {
getBindApi ,
getBindApi ,
iedListApi ,
iedListApi ,
previewApi ,
previewApi ,
bindApi ,
generateParamindexApi ,
} from "@/utils/api/index" ;
} from "@/utils/api/index" ;
export default {
export default {
name : "paramBinding" ,
name : "paramBinding" ,
@ -97,14 +135,19 @@ export default {
label : "mc" ,
label : "mc" ,
} ,
} ,
bindInfo : "" , / / 绑 定 信 息
bindInfo : "" , / / 绑 定 信 息
bindInfoArray : "" ,
iedName : "" , / / 选 中 的 i e d n a m e
iedName : "" , / / 选 中 的 i e d n a m e
iedOptions : [ ] ,
iedOptions : [ ] ,
ljName : "" ,
ljName : "" ,
ljOptions : [ ] ,
ljOptions : [ ] ,
icdid : "" ,
icdid : "" ,
previewData : [ ] ,
defaultShow : true , / / 默 认 显 示
drawer : false ,
warnMsg : "" ,
} ;
} ;
} ,
} ,
watch : { } ,
computed : { } ,
computed : { } ,
created ( ) {
created ( ) {
this . getParamTreeList ( ) ;
this . getParamTreeList ( ) ;
@ -149,6 +192,17 @@ export default {
. then ( ( res ) => {
. then ( ( res ) => {
console . log ( res ) ;
console . log ( res ) ;
this . bindInfo = res . data ;
this . bindInfo = res . data ;
if ( res . data . columnList != null ) {
this . bindInfoArray = res . data . columnList ;
this . previewData = res . data . attList ;
this . iedName = res . data . iedName ;
this . icdid = res . data . icdid ;
this . changeIedname ( this . iedName ) ;
} else {
this . iedName = "" ;
this . ljOptions = [ ] ;
this . ljName = "" ;
}
} )
} )
. catch ( ( err ) => {
. catch ( ( err ) => {
console . log ( err ) ; / / 代 码 错 误 、 请 求 失 败 捕 获
console . log ( err ) ; / / 代 码 错 误 、 请 求 失 败 捕 获
@ -180,6 +234,13 @@ export default {
. then ( ( res ) => {
. then ( ( res ) => {
console . log ( res ) ;
console . log ( res ) ;
this . ljOptions = res . data ;
this . ljOptions = res . data ;
if ( this . icdid !== null ) {
this . ljName = this . ljOptions . find (
( item ) => item . id === this . icdid
) . paramIndex ;
} else {
this . ljName = "" ;
}
} )
} )
. catch ( ( err ) => {
. catch ( ( err ) => {
console . log ( err ) ; / / 代 码 错 误 、 请 求 失 败 捕 获
console . log ( err ) ; / / 代 码 错 误 、 请 求 失 败 捕 获
@ -196,7 +257,59 @@ export default {
} )
} )
. then ( ( res ) => {
. then ( ( res ) => {
console . log ( res ) ;
console . log ( res ) ;
this . ljOptions = res . data ;
this . previewData = res . data ;
this . warnMsg = res . warnMsg . split ( "\n\r" ) ;
console . log ( this . bindInfoArray ) ;
console . log ( this . previewData ) ;
} )
. catch ( ( err ) => {
console . log ( err ) ; / / 代 码 错 误 、 请 求 失 败 捕 获
} ) ;
} ,
/ / 保 存
saveBind ( ) {
bindApi ( {
eqmid : this . currentNodeKey ,
icdid : this . icdid ,
} )
. then ( ( res ) => {
console . log ( res ) ;
if ( res . success ) {
this . $message ( {
showClose : true ,
message : "保存成功" ,
type : "success" ,
} ) ;
} else {
this . $message ( {
showClose : true ,
message : res . errorMsg ,
type : "warning" ,
} ) ;
}
} )
. catch ( ( err ) => {
console . log ( err ) ; / / 代 码 错 误 、 请 求 失 败 捕 获
} ) ;
} ,
generate ( ) {
generateParamindexApi ( )
. then ( ( res ) => {
console . log ( res ) ;
if ( res . success ) {
this . $message ( {
showClose : true ,
message : "生成成功" ,
type : "success" ,
} ) ;
} else {
this . $message ( {
showClose : true ,
message : res . data ,
type : "error" ,
} ) ;
}
} )
} )
. catch ( ( err ) => {
. catch ( ( err ) => {
console . log ( err ) ; / / 代 码 错 误 、 请 求 失 败 捕 获
console . log ( err ) ; / / 代 码 错 误 、 请 求 失 败 捕 获
@ -227,6 +340,9 @@ export default {
font - weight : normal ;
font - weight : normal ;
height : 40 px ;
height : 40 px ;
line - height : 40 px ;
line - height : 40 px ;
display : flex ;
justify - content : space - between ;
align - items : center ;
}
}
. treeBox {
. treeBox {
width : 100 % ;
width : 100 % ;
@ -376,6 +492,52 @@ export default {
. el - divider -- horizontal {
. el - divider -- horizontal {
margin : 12 px 0 px ;
margin : 12 px 0 px ;
}
}
. warnMsg {
padding : 0 px 12 px 0 px 12 px ;
. el - tag {
margin - right : 12 px ;
margin - bottom : 12 px ;
}
}
. showMsgBox {
width : calc ( 100 % - 80 px ) ;
max - height : calc ( 100 % - 64 px ) ;
padding : 0 px 40 px ;
overflow : auto ;
display : flex ;
flex - direction : row ;
flex - wrap : wrap ;
justify - content : space - between ;
. outsideLabel {
height : 40 px ;
line - height : 40 px ;
display : flex ;
align - items : center ;
margin - bottom : 12 px ;
margin - top : 2 px ;
span {
height : 40 px ;
line - height : 40 px ;
min - width : 280 px ;
padding : 0 px 12 px ;
width : max - content ;
border : 1 px solid # ededed ;
text - align : center ;
b {
font - weight : normal ;
font - size : 12 px ;
color : # 666 ;
}
& : last - child {
width : 200 px ;
}
em {
font - style : normal ;
}
}
}
}
}
}
}
}
}
}