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