修改设备节点类型是string时添加长度,其他类型自动删除长度参数
This commit is contained in:
2
.env
2
.env
@@ -19,4 +19,4 @@ VUE_APP_HSLSERVER_PASSWORD=123456
|
|||||||
|
|
||||||
#==true出现下拉,数据来源于MES
|
#==true出现下拉,数据来源于MES
|
||||||
#==false 手动输入,以及不渲染mes的设备编码
|
#==false 手动输入,以及不渲染mes的设备编码
|
||||||
VUE_APP_CHOOSABLE=true
|
VUE_APP_CHOOSABLE=false
|
||||||
@@ -248,11 +248,6 @@ export default {
|
|||||||
value: 'float',
|
value: 'float',
|
||||||
label: 'float (浮点数)'
|
label: 'float (浮点数)'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
value: 'short',
|
|
||||||
label: 'short'
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
{
|
||||||
value: 'bool',
|
value: 'bool',
|
||||||
label: 'bool (逻辑值)'
|
label: 'bool (逻辑值)'
|
||||||
@@ -280,8 +275,7 @@ export default {
|
|||||||
'@DisplayName': [{ required: true, type: 'string', message: '请输入显示名称', trigger: 'blur' }],
|
'@DisplayName': [{ required: true, type: 'string', message: '请输入显示名称', trigger: 'blur' }],
|
||||||
'@RequestType': [{ required: true, type: 'string', message: '请输入请求类型', trigger: 'blur' }],
|
'@RequestType': [{ required: true, type: 'string', message: '请输入请求类型', trigger: 'blur' }],
|
||||||
'@DataTypeCode': [{ required: true, type: 'string', message: '请选择类型', trigger: 'blur' }],
|
'@DataTypeCode': [{ required: true, type: 'string', message: '请选择类型', trigger: 'blur' }],
|
||||||
'@RequestInterval': [{ required: true, message: '请输入采集周期(ms)', trigger: 'blur' }],
|
'@RequestInterval': [{ required: true, message: '请输入采集周期(ms)', trigger: 'blur' }]
|
||||||
'@Length': [{ required: true, message: '请输入长度', trigger: 'blur' }]
|
|
||||||
},
|
},
|
||||||
serverData: {},
|
serverData: {},
|
||||||
devicePointData: [],
|
devicePointData: [],
|
||||||
@@ -481,6 +475,13 @@ export default {
|
|||||||
})
|
})
|
||||||
done(false)
|
done(false)
|
||||||
} else {
|
} else {
|
||||||
|
if (row['@DataTypeCode'] === 'string' && !row['@Length']) {
|
||||||
|
this.$message({
|
||||||
|
message: '数据类型为string,长度不能为空',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
return false
|
||||||
|
}
|
||||||
this.devicePointData.push(row)
|
this.devicePointData.push(row)
|
||||||
await this.setDeviceConfigure()
|
await this.setDeviceConfigure()
|
||||||
await this.getDevice()
|
await this.getDevice()
|
||||||
@@ -521,6 +522,9 @@ export default {
|
|||||||
if (this.devicePointData.length > 0) {
|
if (this.devicePointData.length > 0) {
|
||||||
let devicePointData = this.devicePointData
|
let devicePointData = this.devicePointData
|
||||||
devicePointData = each(devicePointData, (item) => {
|
devicePointData = each(devicePointData, (item) => {
|
||||||
|
if (item['@DataTypeCode'] !== 'string') {
|
||||||
|
unset(item, '@Length')
|
||||||
|
}
|
||||||
unset(item, 'id')
|
unset(item, 'id')
|
||||||
unset(item, 'showBindButton')
|
unset(item, 'showBindButton')
|
||||||
unset(item, 'showCopyButton')
|
unset(item, 'showCopyButton')
|
||||||
@@ -530,6 +534,7 @@ export default {
|
|||||||
})
|
})
|
||||||
deviceConfigureModelValue.RequestNode = devicePointData
|
deviceConfigureModelValue.RequestNode = devicePointData
|
||||||
}
|
}
|
||||||
|
|
||||||
deviceConfigureModelValue['@Name'] = this.deviceData[this.deviceActiveStatus].name
|
deviceConfigureModelValue['@Name'] = this.deviceData[this.deviceActiveStatus].name
|
||||||
let deviceNode = deviceConfigure.Content.Settings.GroupNode[0].DeviceNode || []
|
let deviceNode = deviceConfigure.Content.Settings.GroupNode[0].DeviceNode || []
|
||||||
let isExist = false
|
let isExist = false
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ export default {
|
|||||||
emit: 'set-device'
|
emit: 'set-device'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
text: '配置应用',
|
text: '重启服务',
|
||||||
size: 'small',
|
size: 'small',
|
||||||
emit: 'exec'
|
emit: 'exec'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -41,8 +41,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import tips from './tips.md'
|
import tips from './tips.md'
|
||||||
import jschardet from 'jschardet'
|
import jschardet from 'jschardet'
|
||||||
import { assign, each, map, pick, pickBy, startsWith, includes, every } from 'lodash'
|
import { assign, each, pick, pickBy, startsWith, includes, every } from 'lodash'
|
||||||
//import { getWorkingsubclassAll } from '@/api/basic/device'
|
// import { getWorkingsubclassAll } from '@/api/basic/device'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
|
|||||||
Reference in New Issue
Block a user