|
@@ -1,77 +1,79 @@
|
|
|
+
|
|
|
<template>
|
|
|
- <div class="app-container home">
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :sm="24" :lg="24">
|
|
|
- <h1>webaccess测试</h1>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- <el-row :gutter="20">
|
|
|
- <el-col :sm="24" :lg="24">
|
|
|
- <div>
|
|
|
- <label for="tagname">设备参数名: </label>
|
|
|
- <el-input v-model="tagname" type="text" style="width: 20%" />
|
|
|
-
|
|
|
- <el-button @click="get" type="primary">获取参数值</el-button>
|
|
|
- <!-- <el-button @click="exit" type="danger">断开</el-button> -->
|
|
|
- <br />
|
|
|
- <br />
|
|
|
- <label for="tagvalue">设备参数值: </label>
|
|
|
- <el-input v-model="tagvalue" type="text" style="width: 20%" />
|
|
|
- <el-button type="info" @click="set">设置参数值</el-button>
|
|
|
- <br />
|
|
|
- <br />
|
|
|
- <el-input type="textarea" v-model="message" :rows="9" /> 返回内容
|
|
|
- <br />
|
|
|
- <br />
|
|
|
- </div>
|
|
|
- </el-col>
|
|
|
- </el-row>
|
|
|
- </div>
|
|
|
+ <a-form-model ref="form" :model="model" :rules="validatorRules">
|
|
|
+ <a-form-model-item label="设备参数名" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <a-input v-model="tagname" style="width: 20%" />
|
|
|
+ <template>
|
|
|
+ <el-button @click="get" icon="reload" type="primary">获取参数值</el-button>
|
|
|
+ </template>
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item label="设备参数值" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <a-input v-model="tagvalue" style="width: 20%" />
|
|
|
+ <template>
|
|
|
+ <el-button type="info" icon="reload" @click="set">设置参数值</el-button>
|
|
|
+ </template>
|
|
|
+ </a-form-model-item>
|
|
|
+ <a-form-model-item label="返回内容" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
|
|
+ <a-textarea v-model="message" rows="9" />
|
|
|
+ </a-form-model-item>
|
|
|
+ </a-form-model>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getWATagNameValues, setWATagNameValues } from "@/api/datacoll/webaccess.js";
|
|
|
+import { getWATagNameValues, setWATagNameValues } from '@/api/datacoll/webaccess.js'
|
|
|
export default {
|
|
|
- name: "Index",
|
|
|
+ name: 'Index',
|
|
|
data() {
|
|
|
return {
|
|
|
- tagname: "40001",
|
|
|
- tagvalue: 1,
|
|
|
- message: "",
|
|
|
- };
|
|
|
+ model: {},
|
|
|
+ labelCol: {
|
|
|
+ xs: { span: 24 },
|
|
|
+ sm: { span: 5 },
|
|
|
+ },
|
|
|
+ wrapperCol: {
|
|
|
+ xs: { span: 24 },
|
|
|
+ sm: { span: 16 },
|
|
|
+ },
|
|
|
+ tagname: '设备状态',
|
|
|
+ tagvalue: 2,
|
|
|
+ message: '',
|
|
|
+ confirmLoading: false,
|
|
|
+ }
|
|
|
},
|
|
|
methods: {
|
|
|
get() {
|
|
|
- if (this.tagname == "" || this.tagname == null) {
|
|
|
- this.$modal.msgError("请输入设备参数名");
|
|
|
- return false;
|
|
|
+ console.log('获取参数')
|
|
|
+ if (this.tagname == '' || this.tagname == null) {
|
|
|
+ this.$modal.msgError('请输入设备参数名')
|
|
|
+ return false
|
|
|
}
|
|
|
getWATagNameValues({ tagName: this.tagname }).then((response) => {
|
|
|
- console.log(response);
|
|
|
- this.message = response.msg;
|
|
|
- });
|
|
|
+ console.log(response)
|
|
|
+ this.message = response.message
|
|
|
+ })
|
|
|
},
|
|
|
set() {
|
|
|
- if (this.tagname == "" || this.tagname == null) {
|
|
|
- this.$modal.msgError("请输入设备参数名");
|
|
|
- return false;
|
|
|
+ console.log('设置参数')
|
|
|
+ if (this.tagname == '' || this.tagname == null) {
|
|
|
+ this.$modal.msgError('请输入设备参数名')
|
|
|
+ return false
|
|
|
}
|
|
|
- if (this.tagvalue == "" || this.tagvalue == null) {
|
|
|
- this.$modal.msgError("请输入设备参数值");
|
|
|
- return false;
|
|
|
+ if (this.tagvalue == '' || this.tagvalue == null) {
|
|
|
+ this.$modal.msgError('请输入设备参数值')
|
|
|
+ return false
|
|
|
}
|
|
|
setWATagNameValues({ tagName: this.tagname, tagValue: this.tagvalue }).then((response) => {
|
|
|
- console.log(response.data);
|
|
|
- this.message = response.data.msg;
|
|
|
- });
|
|
|
+ console.log(response)
|
|
|
+ this.message = response.message
|
|
|
+ })
|
|
|
},
|
|
|
exit() {
|
|
|
if (this.ws) {
|
|
|
- this.ws.close();
|
|
|
- this.ws = null;
|
|
|
+ this.ws.close()
|
|
|
+ this.ws = null
|
|
|
}
|
|
|
},
|
|
|
},
|
|
|
-};
|
|
|
+}
|
|
|
</script>
|
|
|
|