优化代码&删除多余的请求
This commit is contained in:
@@ -96,12 +96,15 @@ export default ({ service, request, serviceForMock, requestForMock, mock, faker,
|
||||
},
|
||||
GET_DEVICE_POINT_VALUE (url, deviceName, data, type) {
|
||||
return request({
|
||||
validateStatus: (status) => {
|
||||
return status === 404 ? 200 : status
|
||||
},
|
||||
auth: {
|
||||
username: 'admin',
|
||||
password: process.env.VUE_APP_HSLSERVER_PASSWORD
|
||||
},
|
||||
data: {
|
||||
'address':data
|
||||
address: data
|
||||
},
|
||||
method: 'post',
|
||||
url: url + '/' + deviceName + '/Read' + type + '32'
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@
|
||||
<el-form :inline="true" size="mini" :model="deviceConfigureModelValue" ref="form" :rules="rules"
|
||||
label-position="right" class="demo-form-inline">
|
||||
<el-form-item label="设备">
|
||||
<el-select @change="deviceChange" v-model="defaultDeviceTypeNameValue" placeholder="请选择">
|
||||
<el-select @change="deviceChange" filterable v-model="defaultDeviceTypeNameValue" placeholder="请选择">
|
||||
<el-option v-for="item in deviceTypeData" :key="item" :label="item" :value="item">
|
||||
</el-option>
|
||||
</el-select>
|
||||
@@ -124,7 +124,7 @@ export default {
|
||||
// if (this.choosable === 'true') {
|
||||
// deviceConfigureModelValue["@ParentDeviceCode"] = val["@ParentDeviceCode"]
|
||||
// }
|
||||
deviceConfigureModelValue["@ParentDeviceCode"] = val["@ParentDeviceCode"] || ''
|
||||
deviceConfigureModelValue['@ParentDeviceCode'] = val['@ParentDeviceCode'] || ''
|
||||
each(deviceConfigureFormItemData[this.defaultDeviceTypeNameValue], (item) => {
|
||||
if (item.type === 'time') {
|
||||
deviceConfigureModelValue[item.key] = val[item.key] ? val[item.key] : new Date()
|
||||
|
||||
@@ -195,7 +195,7 @@ export default {
|
||||
labelPosition: 'left',
|
||||
saveLoading: false,
|
||||
saveButtonText: '测试',
|
||||
saveButtonType: 'text',
|
||||
saveButtonType: 'text'
|
||||
},
|
||||
addRules: {
|
||||
deviceName: [{ required: true, type: 'string', message: '服务名称不可为空', trigger: 'blur' }],
|
||||
@@ -239,7 +239,7 @@ export default {
|
||||
// 定义测试动作
|
||||
if (this.formOptions.saveButtonText === '测试') {
|
||||
this.serverSettings = await this.$api.VERIFY_SERVER(
|
||||
'http://' + row.url + ':' + row.port,
|
||||
'http://' + row.url + ':' + row.port
|
||||
)
|
||||
if (this.serverSettings) {
|
||||
this.$message({
|
||||
@@ -289,7 +289,7 @@ export default {
|
||||
},
|
||||
async handleRowEdit ({ index, row }, done) {
|
||||
this.formOptions.saveLoading = true
|
||||
let serverSettings = await this.$api.VERIFY_SERVER(
|
||||
const serverSettings = await this.$api.VERIFY_SERVER(
|
||||
'http://' + row.url + ':' + row.port
|
||||
)
|
||||
serverSettings.Content.ServerInfoConfig.CaptureURL = row.address
|
||||
@@ -321,7 +321,6 @@ export default {
|
||||
done()
|
||||
},
|
||||
setServerExec ({ row }) {
|
||||
|
||||
this.$confirm('是否要重启动该服务', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
@@ -345,9 +344,8 @@ export default {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已重启动该服务'
|
||||
});
|
||||
});
|
||||
|
||||
})
|
||||
})
|
||||
},
|
||||
handleDialogCancel (done) {
|
||||
this.$message({
|
||||
|
||||
Reference in New Issue
Block a user