|
@@ -0,0 +1,77 @@
|
|
|
+<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>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import { getWATagNameValues, setWATagNameValues } from "@/api/datacoll/webaccess.js";
|
|
|
+export default {
|
|
|
+ name: "Index",
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tagname: "40001",
|
|
|
+ tagvalue: 1,
|
|
|
+ message: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ get() {
|
|
|
+ if (this.tagname == "" || this.tagname == null) {
|
|
|
+ this.$modal.msgError("请输入设备参数名");
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ getWATagNameValues({ tagName: this.tagname }).then((response) => {
|
|
|
+ console.log(response);
|
|
|
+ this.message = response.msg;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ set() {
|
|
|
+ if (this.tagname == "" || this.tagname == 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;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ exit() {
|
|
|
+ if (this.ws) {
|
|
|
+ this.ws.close();
|
|
|
+ this.ws = null;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|