|
@@ -1,8 +1,8 @@
|
|
|
<!--steps3的左侧-->
|
|
|
<template>
|
|
|
<div class="steps3-dialog-main">
|
|
|
- <select-one @check="typeCheck" :renderData="typeArr" :isSelected="true" isCheckInfo="EquipmentMarkStandardized" infosKey="EquipmentType" :name="'原始点位描述中识别的设备类型'"></select-one>
|
|
|
- <select-one @check="paramCheck" :renderData="identifyArr" infosKey="ownMess" :name="'已标准化的设备标识'"></select-one>
|
|
|
+ <select-one @check="typeCheck" :renderData="typeArr" :isSelected="true" isCheckInfo="EquipmentMarkStandardized" infosKey="EquipmentType" :name="'原始点位描述中识别的设备类型'"></select-one>
|
|
|
+ <select-one @check="paramCheck" :renderData="identifyArr" infosKey="ownMess" :name="'已标准化的设备标识'"></select-one>
|
|
|
<div class="own-collape">
|
|
|
<ident-collape v-if="!isNull" ref="ident" @saved="resetTwo" :renderData="identDataArr"></ident-collape>
|
|
|
<div v-else class="h100">
|
|
@@ -58,27 +58,28 @@
|
|
|
},
|
|
|
mounted() {},
|
|
|
methods: {
|
|
|
- getData(){
|
|
|
+ getData() {
|
|
|
getStandType({
|
|
|
data: {
|
|
|
DataSourceId: this.datasourceId
|
|
|
},
|
|
|
type: this.protocolType
|
|
|
- },res => {
|
|
|
+ }, res => {
|
|
|
this.typeArr = res.Content
|
|
|
})
|
|
|
},
|
|
|
- resetTwo(){
|
|
|
+ resetTwo() {
|
|
|
console.log("触发回调")
|
|
|
- this.getParamList(this.Typs)
|
|
|
+ this.getData()
|
|
|
+ // this.getParamList(this.Typs)
|
|
|
},
|
|
|
- typeCheck(item){
|
|
|
- console.log(item,"item")
|
|
|
+ typeCheck(item) {
|
|
|
+ console.log(item, "item")
|
|
|
this.getParamList(item)
|
|
|
},
|
|
|
- paramCheck(param){
|
|
|
+ paramCheck(param) {
|
|
|
this.paramData = param
|
|
|
- if(!!param.EquipmentMark && param.EquipmentMark == "空"){
|
|
|
+ if (!!param.EquipmentMark && param.EquipmentMark == "空") {
|
|
|
//空查询分组信息
|
|
|
getNullofParam({
|
|
|
data: {
|
|
@@ -86,12 +87,12 @@
|
|
|
KeyEquipmentType: this.KeyEquipmentType
|
|
|
},
|
|
|
type: this.protocolType
|
|
|
- },res =>{
|
|
|
+ }, res => {
|
|
|
console.log(res)
|
|
|
this.isNull = false
|
|
|
this.identDataArr = res.Content
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
//不是空的情况查询点位列表
|
|
|
console.log(param)
|
|
|
queryPoint({
|
|
@@ -105,57 +106,223 @@
|
|
|
PageSize: 100
|
|
|
},
|
|
|
type: this.protocolType
|
|
|
- },res => {
|
|
|
+ }, res => {
|
|
|
this.isNull = true
|
|
|
this.identDataArr = res.Content
|
|
|
- let allData = this.identDataArr,data = {
|
|
|
- data: allData,
|
|
|
- colHeaders: ['设备标识','原始点位描述','位置标签','备注'],
|
|
|
- columns: [
|
|
|
+ let headers = {
|
|
|
+ "modbus-tcp": [{
|
|
|
+ InfoPointName: "*slave_id",
|
|
|
+ InfoPointCode: "SlaveId",
|
|
|
+ InputMode: "B1",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
+ },
|
|
|
{
|
|
|
- data: 'EquipmentMark'
|
|
|
+ InfoPointName: "*registers_address ",
|
|
|
+ InfoPointCode: "RegistersAddress",
|
|
|
+ InputMode: "B1",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
},
|
|
|
{
|
|
|
- data: 'Description',
|
|
|
- readOnly:true,
|
|
|
+ InfoPointName: "*registers_quality",
|
|
|
+ InfoPointCode: "RegistersQuality",
|
|
|
+ InputMode: "B1",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
},
|
|
|
{
|
|
|
- data: 'LocationFlag',
|
|
|
- readOnly:true,
|
|
|
+ InfoPointName: "*convert_type",
|
|
|
+ InfoPointCode: "ConvertType",
|
|
|
+ InputMode: "select",
|
|
|
+ DataSource: [{
|
|
|
+ Code: "1",
|
|
|
+ Name: "位"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Code: "2",
|
|
|
+ Name: "单字"
|
|
|
+ }, {
|
|
|
+ Code: "3",
|
|
|
+ Name: "双字"
|
|
|
+ }, {
|
|
|
+ Code: "4",
|
|
|
+ Name: "四字"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
},
|
|
|
{
|
|
|
- data: 'Remarks',
|
|
|
- readOnly:true,
|
|
|
+ InfoPointName: "*翻转规则",
|
|
|
+ InfoPointCode: "RevertRule",
|
|
|
+ InputMode: "B1",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
}
|
|
|
],
|
|
|
- maxRows: allData.length,
|
|
|
- }
|
|
|
- if(this.protocolType == 'knx'){
|
|
|
- data.colHeaders.splice(2,0,'原始点位地址')
|
|
|
- data.columns.splice(2,0,{
|
|
|
- data: 'GroupAddress',
|
|
|
- readOnly: true
|
|
|
- })
|
|
|
+ "bacnet-ip": [{
|
|
|
+ InfoPointName: "*device_id",
|
|
|
+ InfoPointCode: "DeviceId",
|
|
|
+ InputMode: "B1",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
+ },
|
|
|
+ {
|
|
|
+ InfoPointName: "*instance_number",
|
|
|
+ InfoPointCode: "InstanceNumber",
|
|
|
+ InputMode: "B1",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
+ },
|
|
|
+ {
|
|
|
+ InfoPointName: "*data_type",
|
|
|
+ InfoPointCode: "DataType",
|
|
|
+ DataSource: [{
|
|
|
+ Code: "analogInput",
|
|
|
+ Name: "analogInput"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Code: "analogOutput",
|
|
|
+ Name: "analogOutput"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Code: "analogValue",
|
|
|
+ Name: "analogValue"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Code: "binaryInput",
|
|
|
+ Name: "binaryInput"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Code: "binaryOutput",
|
|
|
+ Name: "binaryOutput"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Code: "binaryValue",
|
|
|
+ Name: "binaryValue"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Code: "multiStateInput",
|
|
|
+ Name: "multiStateInput"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Code: "multiStateOutput",
|
|
|
+ Name: "multiStateOutput"
|
|
|
+ },
|
|
|
+ {
|
|
|
+ Code: "multiStateValue",
|
|
|
+ Name: "multiStateValue"
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ InputMode: "select",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ "opc": [{
|
|
|
+ InfoPointName: "*item",
|
|
|
+ InfoPointCode: "Item",
|
|
|
+ InputMode: "B1",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
+ }],
|
|
|
+ "knx": [{
|
|
|
+ InfoPointName: "*group_address",
|
|
|
+ InfoPointCode: "GroupAddress",
|
|
|
+ InputMode: "B1",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
+ }],
|
|
|
+ "mqtt": [{
|
|
|
+ InfoPointName: "*topic",
|
|
|
+ InfoPointCode: "Topic",
|
|
|
+ InputMode: "B1",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
+ }],
|
|
|
+ "amqp": [{
|
|
|
+ InfoPointName: "*exchange",
|
|
|
+ InfoPointCode: "Exchange",
|
|
|
+ InputMode: "B1",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
+ },
|
|
|
+ {
|
|
|
+ InfoPointName: "*type",
|
|
|
+ InfoPointCode: "Type",
|
|
|
+ InputMode: "B1",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
+ },
|
|
|
+ {
|
|
|
+ InfoPointName: "*routing_key ",
|
|
|
+ InfoPointCode: "RoutingKey",
|
|
|
+ InputMode: "B1",
|
|
|
+ Visible: true,
|
|
|
+ FirstTag: ""
|
|
|
+ }
|
|
|
+ ]
|
|
|
}
|
|
|
- if(this.protocolType == 'modbus-tcp'){
|
|
|
- data.colHeaders.splice(2,0,'原始点位地址')
|
|
|
- data.columns.splice(2,0,{
|
|
|
- data: 'RegistersAddress',
|
|
|
- readOnly: true
|
|
|
+ let allData = this.identDataArr,
|
|
|
+ data = {
|
|
|
+ data: allData,
|
|
|
+ colHeaders: [],
|
|
|
+ columns: [],
|
|
|
+ maxRows: allData.length,
|
|
|
+ }
|
|
|
+ headers[this.protocolType].map(item => {
|
|
|
+ data.columns.push({
|
|
|
+ data: item.InfoPointCode,
|
|
|
+ readOnly: true,
|
|
|
})
|
|
|
- }
|
|
|
- console.log(this.activeName,this.$refs.handsontable)
|
|
|
+ data.colHeaders.push(item.InfoPointName)
|
|
|
+ })
|
|
|
+ data.columns.splice(0, 0, {
|
|
|
+ data: 'Description',
|
|
|
+ readOnly: true
|
|
|
+ })
|
|
|
+ data.columns.splice(0, 0, {
|
|
|
+ data: 'EquipmentMark'
|
|
|
+ })
|
|
|
+ data.colHeaders.splice(0, 0, '原始点位描述')
|
|
|
+ data.colHeaders.splice(0, 0, '设备标识')
|
|
|
+ data.columns.push({
|
|
|
+ data: 'LocationFlag',
|
|
|
+ readOnly: true
|
|
|
+ })
|
|
|
+ data.columns.push({
|
|
|
+ data: 'Remarks',
|
|
|
+ readOnly: true
|
|
|
+ })
|
|
|
+ data.colHeaders.push('位置标签')
|
|
|
+ data.colHeaders.push('备注')
|
|
|
this.$nextTick(_ => {
|
|
|
- this.$refs.handsontable.init(data)
|
|
|
- })
|
|
|
+ this.$refs.handsontable.init(data)
|
|
|
+ })
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- saveData(){
|
|
|
- console.log(this.identDataArr,222)
|
|
|
+ saveData() {
|
|
|
+ console.log(this.identDataArr, 222)
|
|
|
+ let data = this.identDataArr.map(item => {
|
|
|
+ return {
|
|
|
+ EquipmentMark: !!item.EquipmentMark ? item.EquipmentMark : null,
|
|
|
+ Id: item.Id,
|
|
|
+ }
|
|
|
+ })
|
|
|
+ updatePoint({
|
|
|
+ data: {
|
|
|
+ Content: data
|
|
|
+ },
|
|
|
+ type: this.protocolType
|
|
|
+ }, res => {
|
|
|
+ this.$message.success("保存成功")
|
|
|
+ this.resetTwo()
|
|
|
+ })
|
|
|
},
|
|
|
//通过type获取param的list
|
|
|
- getParamList(item){
|
|
|
+ getParamList(item) {
|
|
|
this.Typs = item
|
|
|
console.log(item)
|
|
|
this.KeyEquipmentType = item.EquipmentType
|
|
@@ -165,8 +332,8 @@
|
|
|
KeyEquipmentType: item.EquipmentType
|
|
|
},
|
|
|
type: this.protocolType
|
|
|
- },res => {
|
|
|
- console.log(res,"res")
|
|
|
+ }, res => {
|
|
|
+ console.log(res, "res")
|
|
|
this.identifyArr = res.Content.map(item => {
|
|
|
item.ownMess = item.EquipmentMark + '(涉及原始点位:' + item.PointCount + ')'
|
|
|
return item
|
|
@@ -185,7 +352,7 @@
|
|
|
<style lang="scss" scoped>
|
|
|
.steps3-dialog-main {
|
|
|
height: 400px;
|
|
|
- .own-table-view{
|
|
|
+ .own-table-view {
|
|
|
height: calc(100% - 50px);
|
|
|
}
|
|
|
.own-collape {
|