소스 검색

站点管理 等

ming 3 년 전
부모
커밋
a88a22cafb

+ 0 - 354
.history/src/views/siteManage/variableList/index_20211018102819.vue

@@ -1,354 +0,0 @@
-<template>
-  <div class="siteManage-main variableList">
-    <!-- 筛选start -->
-    <div class="filter-container mb-20">
-      <div class="left">
-        <div>
-          <a class="" style="margin-right: 30px">【测试站点1】站点的所有变量</a>
-          <el-button icon="el-icon-plus" type="success" @click="addItem()"
-            >新增</el-button
-          >
-          <el-button icon="el-icon-refresh" type="primary"
-            >同步配置到采集器</el-button
-          >
-        </div>
-
-        <div style="margin-top: 20px">
-          <el-button @click="select=1" :type="select==1 ? 'primary' : ''" >模拟量</el-button>
-          <el-button @click="select=2"  :type="select==2 ? 'primary' : ''">状态量</el-button>
-          <el-button @click="select=3" :type="select==3 ? 'primary' : ''">参数量</el-button>
-          <el-input
-            placeholder="搜索变量或编码"
-            style="width: 200px"
-          ></el-input>
-          <el-button type="primary" icon="el-icon-search" class="search-button"
-            >搜索</el-button
-          >
-        </div>
-        <!-- <el-radio-group v-model="tabPosition" style="margin-top: 20px">
-          <el-radio-button label="one">模拟量</el-radio-button>
-          <el-radio-button label="two">状态量</el-radio-button>
-          <el-radio-button label="three">参数量</el-radio-button>
-        </el-radio-group> -->
-      </div>
-
-      <div class="right">
-        <el-button type="primary">导入</el-button>
-        <el-button type="primary">导出</el-button>
-      </div>
-    </div>
-    <!-- 筛选end -->
-
-    <!-- 表格start -->
-    <el-table :data="tableData" border stripe :header-cell-style="headClass" :default-sort="{prop: 'date', order: 'descending'}">
-      <el-table-column
-        fixed
-        prop="watchStatus"
-        label="状态"
-        width="50"
-        align="center"
-      >
-        <template #default >
-          <el-avatar class="status"></el-avatar>
-        </template>
-      </el-table-column>
-      <el-table-column prop="watchName" label="序号" width="" sortable>
-      </el-table-column>
-      <el-table-column prop="watchCode" label="变量名" width="" sortable>
-      </el-table-column>
-      <el-table-column prop="ratedVoltage" label="变量编号" width="" sortable>
-      </el-table-column>
-      <el-table-column prop="ratedCurrent" label="监控设备" width="">
-      </el-table-column>
-      <el-table-column prop="fzlMx" label="通信设备" width="">
-      </el-table-column>
-      <el-table-column prop="powerAnalysis" label="数据地址" width="">
-      </el-table-column>
-      <el-table-column prop="watchAddress" label="数据类型" width="">
-      </el-table-column>
-      <el-table-column prop="watchAddress" label="系数" width="">
-      </el-table-column>
-      <el-table-column prop="watchAddress" label="存盘周期" width="">
-      </el-table-column>
-      <el-table-column fixed="right" label="操作" width="180">
-        <template #default="scope">
-          <el-button
-            type="text"
-            size="small"
-            @click.prevent="editRow(scope.row)"
-            >修改</el-button
-          >
-          <el-button
-            @click="handleDelete(scope.$index, scope.row)"
-            type="text"
-            size="small"
-            class="delete-text"
-            >删除</el-button
-          >
-        </template>
-      </el-table-column>
-    </el-table>
-    <!-- 表格end -->
-
-    <!-- 分页start -->
-    <div class="paginationBlock">
-      <el-pagination
-        
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage4"
-        :page-sizes="[100, 200, 300, 400]"
-        :page-size="100"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="400"
-      >
-      </el-pagination>
-    </div>
-
-    <!-- 分页end -->
-
-    <!--弹框组件开始-----------------------start-->
-    <dialog-component
-      v-if="showDialog"
-      ref="dialogComponent"
-      :dialog-title="dialogTitle"
-      :item-info="tableItem"
-      @closeDialog="closeDialog"
-    ></dialog-component>
-    <!--弹框组件开始-----------------------end-->
-  </div>
-</template>
-
-<script>
-import DialogComponent from "./dialogComponent";
-
-export default {
-  name: "VariableList",
-
-  components: { DialogComponent },
-
-  data() {
-    return {
-       select:1,
-      currentPage4: 4,
-
-      showDialog: false,
-      tabPosition: "one",
-
-      input: "请输入状态",
-      tableData: [
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-      ],
-    };
-  },
-  methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
-    },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
-    },
-
-    // 表头样式设置
-    goVariableList() {
-      // 跳转至订单列表页面传参
-      this.$router.push({
-        path: "../siteManage/variableList/index.vue",
-      });
-      // this.$router.push({ name:'variableList'})
-    },
-    headClass() {
-      return "background:#FAFAFA;";
-    },
-
-    // 添加操作
-    addItem() {
-      this.tableItem = {
-        id: "",
-        stationName: "",
-        watchName: "",
-        watchCode: "",
-        siteList: [],
-        done: "",
-        guaZai: "",
-        checked: true,
-      };
-      this.dialogTitle = "新增";
-      this.showDialog = true;
-      this.$nextTick(() => {
-        this.$refs["dialogComponent"].showDialog = true;
-      });
-    },
-    // 编辑操作
-    editRow(row) {
-      console.log(row);
-      this.tableItem = row;
-      this.dialogTitle = "编辑";
-      this.showDialog = true;
-      this.$nextTick(() => {
-        this.$refs["dialogComponent"].showDialog = true;
-      });
-    },
-    // 关闭操作
-    closeDialog(flag) {
-      if (flag) {
-        // 重新刷新表格内容
-        this.fetchData();
-      }
-      this.showDialog = false;
-    },
-
-    //删除操作
-    handleDelete(index, row) {
-      console.log(index, row);
-      alert(index);
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-</style>

+ 0 - 354
.history/src/views/siteManage/variableList/index_20211018134335.vue

@@ -1,354 +0,0 @@
-<template>
-  <div class="siteManage-main variableList">
-    <!-- 筛选start -->
-    <div class="filter-container mb-20">
-      <div class="left">
-        <div>
-          <a class="" style="margin-right: 30px">【测试站点1】站点的所有变量</a>
-          <el-button icon="el-icon-plus" type="success" @click="addItem()"
-            >新增</el-button
-          >
-          <el-button icon="el-icon-refresh" type="primary"
-            >同步配置到采集器</el-button
-          >
-        </div>
-
-        <div style="margin-top: 20px">
-          <el-button @click="select=1" :type="select==1 ? 'primary' : ''" >模拟量</el-button>
-          <el-button @click="select=2"  :type="select==2 ? 'primary' : ''" style="margin-right:20px">状态量</el-button>
-          <el-button @click="select=3" :type="select==3 ? 'primary' : ''">参数量</el-button>
-          <el-input
-            placeholder="搜索变量或编码"
-            style="width: 200px"
-          ></el-input>
-          <el-button type="primary" icon="el-icon-search" class="search-button"
-            >搜索</el-button
-          >
-        </div>
-        <!-- <el-radio-group v-model="tabPosition" style="margin-top: 20px">
-          <el-radio-button label="one">模拟量</el-radio-button>
-          <el-radio-button label="two">状态量</el-radio-button>
-          <el-radio-button label="three">参数量</el-radio-button>
-        </el-radio-group> -->
-      </div>
-
-      <div class="right">
-        <el-button type="primary">导入</el-button>
-        <el-button type="primary">导出</el-button>
-      </div>
-    </div>
-    <!-- 筛选end -->
-
-    <!-- 表格start -->
-    <el-table :data="tableData" border stripe :header-cell-style="headClass" :default-sort="{prop: 'date', order: 'descending'}">
-      <el-table-column
-        fixed
-        prop="watchStatus"
-        label="状态"
-        width="50"
-        align="center"
-      >
-        <template #default >
-          <el-avatar class="status"></el-avatar>
-        </template>
-      </el-table-column>
-      <el-table-column prop="watchName" label="序号" width="" sortable>
-      </el-table-column>
-      <el-table-column prop="watchCode" label="变量名" width="" sortable>
-      </el-table-column>
-      <el-table-column prop="ratedVoltage" label="变量编号" width="" sortable>
-      </el-table-column>
-      <el-table-column prop="ratedCurrent" label="监控设备" width="">
-      </el-table-column>
-      <el-table-column prop="fzlMx" label="通信设备" width="">
-      </el-table-column>
-      <el-table-column prop="powerAnalysis" label="数据地址" width="">
-      </el-table-column>
-      <el-table-column prop="watchAddress" label="数据类型" width="">
-      </el-table-column>
-      <el-table-column prop="watchAddress" label="系数" width="">
-      </el-table-column>
-      <el-table-column prop="watchAddress" label="存盘周期" width="">
-      </el-table-column>
-      <el-table-column fixed="right" label="操作" width="180">
-        <template #default="scope">
-          <el-button
-            type="text"
-            size="small"
-            @click.prevent="editRow(scope.row)"
-            >修改</el-button
-          >
-          <el-button
-            @click="handleDelete(scope.$index, scope.row)"
-            type="text"
-            size="small"
-            class="delete-text"
-            >删除</el-button
-          >
-        </template>
-      </el-table-column>
-    </el-table>
-    <!-- 表格end -->
-
-    <!-- 分页start -->
-    <div class="paginationBlock">
-      <el-pagination
-        
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage4"
-        :page-sizes="[100, 200, 300, 400]"
-        :page-size="100"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="400"
-      >
-      </el-pagination>
-    </div>
-
-    <!-- 分页end -->
-
-    <!--弹框组件开始-----------------------start-->
-    <dialog-component
-      v-if="showDialog"
-      ref="dialogComponent"
-      :dialog-title="dialogTitle"
-      :item-info="tableItem"
-      @closeDialog="closeDialog"
-    ></dialog-component>
-    <!--弹框组件开始-----------------------end-->
-  </div>
-</template>
-
-<script>
-import DialogComponent from "./dialogComponent";
-
-export default {
-  name: "VariableList",
-
-  components: { DialogComponent },
-
-  data() {
-    return {
-       select:1,
-      currentPage4: 4,
-
-      showDialog: false,
-      tabPosition: "one",
-
-      input: "请输入状态",
-      tableData: [
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-      ],
-    };
-  },
-  methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
-    },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
-    },
-
-    // 表头样式设置
-    goVariableList() {
-      // 跳转至订单列表页面传参
-      this.$router.push({
-        path: "../siteManage/variableList/index.vue",
-      });
-      // this.$router.push({ name:'variableList'})
-    },
-    headClass() {
-      return "background:#FAFAFA;";
-    },
-
-    // 添加操作
-    addItem() {
-      this.tableItem = {
-        id: "",
-        stationName: "",
-        watchName: "",
-        watchCode: "",
-        siteList: [],
-        done: "",
-        guaZai: "",
-        checked: true,
-      };
-      this.dialogTitle = "新增";
-      this.showDialog = true;
-      this.$nextTick(() => {
-        this.$refs["dialogComponent"].showDialog = true;
-      });
-    },
-    // 编辑操作
-    editRow(row) {
-      console.log(row);
-      this.tableItem = row;
-      this.dialogTitle = "编辑";
-      this.showDialog = true;
-      this.$nextTick(() => {
-        this.$refs["dialogComponent"].showDialog = true;
-      });
-    },
-    // 关闭操作
-    closeDialog(flag) {
-      if (flag) {
-        // 重新刷新表格内容
-        this.fetchData();
-      }
-      this.showDialog = false;
-    },
-
-    //删除操作
-    handleDelete(index, row) {
-      console.log(index, row);
-      alert(index);
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-</style>

+ 0 - 354
.history/src/views/siteManage/variableList/index_20211018134355.vue

@@ -1,354 +0,0 @@
-<template>
-  <div class="siteManage-main variableList">
-    <!-- 筛选start -->
-    <div class="filter-container mb-20">
-      <div class="left">
-        <div>
-          <a class="" style="margin-right: 30px">【测试站点1】站点的所有变量</a>
-          <el-button icon="el-icon-plus" type="success" @click="addItem()"
-            >新增</el-button
-          >
-          <el-button icon="el-icon-refresh" type="primary"
-            >同步配置到采集器</el-button
-          >
-        </div>
-
-        <div style="margin-top: 20px">
-          <el-button @click="select=1" :type="select==1 ? 'primary' : ''" >模拟量</el-button>
-          <el-button @click="select=2"  :type="select==2 ? 'primary' : ''" >状态量</el-button>
-          <el-button @click="select=3" :type="select==3 ? 'primary' : ''">参数量</el-button>
-          <el-input
-            placeholder="搜索变量或编码"
-            style="width: 200px;margin-left:20px"
-          ></el-input>
-          <el-button type="primary" icon="el-icon-search" class="search-button"
-            >搜索</el-button
-          >
-        </div>
-        <!-- <el-radio-group v-model="tabPosition" style="margin-top: 20px">
-          <el-radio-button label="one">模拟量</el-radio-button>
-          <el-radio-button label="two">状态量</el-radio-button>
-          <el-radio-button label="three">参数量</el-radio-button>
-        </el-radio-group> -->
-      </div>
-
-      <div class="right">
-        <el-button type="primary">导入</el-button>
-        <el-button type="primary">导出</el-button>
-      </div>
-    </div>
-    <!-- 筛选end -->
-
-    <!-- 表格start -->
-    <el-table :data="tableData" border stripe :header-cell-style="headClass" :default-sort="{prop: 'date', order: 'descending'}">
-      <el-table-column
-        fixed
-        prop="watchStatus"
-        label="状态"
-        width="50"
-        align="center"
-      >
-        <template #default >
-          <el-avatar class="status"></el-avatar>
-        </template>
-      </el-table-column>
-      <el-table-column prop="watchName" label="序号" width="" sortable>
-      </el-table-column>
-      <el-table-column prop="watchCode" label="变量名" width="" sortable>
-      </el-table-column>
-      <el-table-column prop="ratedVoltage" label="变量编号" width="" sortable>
-      </el-table-column>
-      <el-table-column prop="ratedCurrent" label="监控设备" width="">
-      </el-table-column>
-      <el-table-column prop="fzlMx" label="通信设备" width="">
-      </el-table-column>
-      <el-table-column prop="powerAnalysis" label="数据地址" width="">
-      </el-table-column>
-      <el-table-column prop="watchAddress" label="数据类型" width="">
-      </el-table-column>
-      <el-table-column prop="watchAddress" label="系数" width="">
-      </el-table-column>
-      <el-table-column prop="watchAddress" label="存盘周期" width="">
-      </el-table-column>
-      <el-table-column fixed="right" label="操作" width="180">
-        <template #default="scope">
-          <el-button
-            type="text"
-            size="small"
-            @click.prevent="editRow(scope.row)"
-            >修改</el-button
-          >
-          <el-button
-            @click="handleDelete(scope.$index, scope.row)"
-            type="text"
-            size="small"
-            class="delete-text"
-            >删除</el-button
-          >
-        </template>
-      </el-table-column>
-    </el-table>
-    <!-- 表格end -->
-
-    <!-- 分页start -->
-    <div class="paginationBlock">
-      <el-pagination
-        
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage4"
-        :page-sizes="[100, 200, 300, 400]"
-        :page-size="100"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="400"
-      >
-      </el-pagination>
-    </div>
-
-    <!-- 分页end -->
-
-    <!--弹框组件开始-----------------------start-->
-    <dialog-component
-      v-if="showDialog"
-      ref="dialogComponent"
-      :dialog-title="dialogTitle"
-      :item-info="tableItem"
-      @closeDialog="closeDialog"
-    ></dialog-component>
-    <!--弹框组件开始-----------------------end-->
-  </div>
-</template>
-
-<script>
-import DialogComponent from "./dialogComponent";
-
-export default {
-  name: "VariableList",
-
-  components: { DialogComponent },
-
-  data() {
-    return {
-       select:1,
-      currentPage4: 4,
-
-      showDialog: false,
-      tabPosition: "one",
-
-      input: "请输入状态",
-      tableData: [
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-        {
-          ratedVoltage: "10KV",
-          watchName: "测试设备1",
-          watchCode: "cssb1",
-          ratedCurrent: "58A",
-          fzlMx: "80%",
-          powerAnalysis: "开启",
-          watchAddress: "1",
-        },
-      ],
-    };
-  },
-  methods: {
-    handleSizeChange(val) {
-      console.log(`每页 ${val} 条`);
-    },
-    handleCurrentChange(val) {
-      console.log(`当前页: ${val}`);
-    },
-
-    // 表头样式设置
-    goVariableList() {
-      // 跳转至订单列表页面传参
-      this.$router.push({
-        path: "../siteManage/variableList/index.vue",
-      });
-      // this.$router.push({ name:'variableList'})
-    },
-    headClass() {
-      return "background:#FAFAFA;";
-    },
-
-    // 添加操作
-    addItem() {
-      this.tableItem = {
-        id: "",
-        stationName: "",
-        watchName: "",
-        watchCode: "",
-        siteList: [],
-        done: "",
-        guaZai: "",
-        checked: true,
-      };
-      this.dialogTitle = "新增";
-      this.showDialog = true;
-      this.$nextTick(() => {
-        this.$refs["dialogComponent"].showDialog = true;
-      });
-    },
-    // 编辑操作
-    editRow(row) {
-      console.log(row);
-      this.tableItem = row;
-      this.dialogTitle = "编辑";
-      this.showDialog = true;
-      this.$nextTick(() => {
-        this.$refs["dialogComponent"].showDialog = true;
-      });
-    },
-    // 关闭操作
-    closeDialog(flag) {
-      if (flag) {
-        // 重新刷新表格内容
-        this.fetchData();
-      }
-      this.showDialog = false;
-    },
-
-    //删除操作
-    handleDelete(index, row) {
-      console.log(index, row);
-      alert(index);
-    },
-  },
-};
-</script>
-
-<style lang="scss" scoped>
-</style>

+ 20 - 20
src/views/siteManage/index.vue

@@ -44,9 +44,7 @@
         default-expand-all
         :filter-node-method="filterNode"
         ref="tree"
-
         :current-node-key="defaultExpand"
-
       >
         <template #default="{ node, data }">
           <span
@@ -82,16 +80,20 @@
     <!-- 树形组件end -->
 
     <!-- 站点主题start -->
-    <div class="grid-content nestingDom" style="width: calc(100% - 300px)" v-if="flag2">
+    <div
+      class="grid-content nestingDom"
+      style="width: calc(100% - 300px)"
+      v-if="flag2"
+    >
       <el-tabs
         v-if="treeLevel == 3 || groupingId == 0"
         v-model="activeName"
         type="card"
       >
         <el-tab-pane label="基本信息" name="first">
-          <basic-info class="basicInfo" :siteId="siteId" ></basic-info>
+          <basic-info class="basicInfo" :siteId="siteId"></basic-info>
         </el-tab-pane>
-        <el-tab-pane label="监控设备" name="second" >
+        <el-tab-pane label="监控设备" name="second">
           <watch-dog
             v-on:success="success(res)"
             :avtiveName="activeName"
@@ -100,9 +102,9 @@
           ></watch-dog>
         </el-tab-pane>
         <el-tab-pane label="变量列表" name="third">
-          <variable-list :activeName="activeName" ></variable-list>
+          <variable-list :activeName="activeName"></variable-list>
         </el-tab-pane>
-        <el-tab-pane label="摄像头" name="five" >
+        <el-tab-pane label="摄像头" name="five">
           <camera :siteId="siteId"></camera>
         </el-tab-pane>
         <el-tab-pane label="电能质量评分配置" name="six">
@@ -142,7 +144,7 @@
 </template>
 
 <script>
-import { defineComponent, ref, reactive, watch, onMounted,nextTick } from 'vue'
+import { defineComponent, ref, reactive, watch, onMounted, nextTick } from 'vue'
 
 import basicInfo from './basicInfo'
 import WatchDog from './watchDog'
@@ -169,9 +171,9 @@ export default defineComponent({
     addSiteCom,
   },
   setup() {
-    const flag2=ref(false)
+    const flag2 = ref(false)
     const showTree = ref(true)
-    const defaultExpand=ref(0)
+    const defaultExpand = ref(0)
     const showDialog = ref(false)
     const showDialog2 = ref(false)
     const dialogTitle = ref('')
@@ -179,7 +181,7 @@ export default defineComponent({
     const groupingId = ref(1)
     const siteId = ref(368)
     const label = ref('')
-    const activeName = ref('first')
+    const activeName = ref('third')
     const filterText = ref('')
     const data = ref([
       {
@@ -250,12 +252,12 @@ export default defineComponent({
     }
     const handleNodeClick = (data, obj, node) => {
       data, node
-      flag2.value=true
+      flag2.value = true
       console.log(obj.data)
       treeLevel.value = obj.level
       groupingId.value = obj.data.grouping_id
       label.value = obj.data.label
-       console.log('obj.data')
+      console.log('obj.data')
       console.log(obj.data)
 
       if (treeLevel.value == 3) {
@@ -282,7 +284,7 @@ export default defineComponent({
       showDialog.value = false
       showDialog2.value = false
       siteTreeList()
-      flag2.value=false
+      flag2.value = false
 
       treeLevel.value = 3
     }
@@ -341,15 +343,13 @@ export default defineComponent({
     }
     onMounted(() => {
       // console.log(groupingId.value)
-      siteTreeList();
-
-    
+      siteTreeList()
     })
 
     nextTick(() => {
-          // defaultExpand.value = data.value[0].children.id
-          // tree.value.setCurrentKey(tree[0].node.id)
-        })
+      // defaultExpand.value = data.value[0].children.id
+      // tree.value.setCurrentKey(tree[0].node.id)
+    })
 
     return {
       showDialog,

+ 210 - 0
src/views/siteManage/variableList/dialogComponent copy.vue

@@ -0,0 +1,210 @@
+<template>
+  <transition name="dialog-fade">
+    <el-dialog
+
+      :title="dialogTitle"
+
+      v-model="showDialog"
+      width="640px"
+      @close="closeDialog(0)"
+       @open="open"
+    >
+      <el-form
+        ref="formInfo"
+        :model="form"
+        class="demo-form-inline"
+        label-width="100px"
+        :rules="rules"
+      >
+        <el-form-item label="设备名称:" prop="watchName">
+          <el-input v-model="form.watchName"></el-input>
+        </el-form-item>
+        <el-form-item label="设备编号:" prop="watchCode">
+          <el-input v-model="form.watchCode"></el-input>
+        </el-form-item>
+        <el-form-item label="回路表记地址:" prop="routeAddress">
+          <el-select
+            v-model="form.routeAddress"
+            multiple
+            filterable
+            collapse-tags
+            placeholder="请选择"
+          >
+            <el-option
+              v-for="item in options"
+              :key="item.value"
+              :label="item.label"
+              :value="item.value"
+            >
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="额定电压(kV):" prop="ratedVoltage">
+          <el-input v-model="form.ratedVoltage"></el-input>
+          <div class="remarksTxt">(数值为线电压)</div>
+        </el-form-item>
+        <el-form-item label="额定电流(A):" prop="stationAddress">
+          <el-input v-model="form.ratedCurrent"></el-input>
+        </el-form-item>
+        <el-form-item label="电流负载率门限:" prop="fzlMx">
+          <el-input v-model="form.fzlMx"></el-input>
+           <div class="remarksTxt">(0-100之间的数字)</div>
+        </el-form-item>
+        <el-form-item label="设备能力:" prop="ability">
+          <el-checkbox v-model="checked">电能质量分析</el-checkbox>
+          <div class="remarksTxt">(如果未勾选,该设备不参与电能质量分析)</div>
+        </el-form-item>
+        
+        <br />
+        <br />
+        <br />
+        <div style="text-align: right">
+          <el-button @click="closeDialog(0)">取消</el-button>
+          <el-button type="primary" @click="submitForm()"
+            >保存</el-button
+          >
+        </div>
+      </el-form>
+    </el-dialog>
+  </transition>
+</template>
+
+<script>
+
+export default {
+  name: "DialogComponent",
+  props: {
+    dialogTitle: {
+      type: String,
+      default: "新增",
+    },
+    itemInfo: {
+      type: Object,
+      default: function () {
+        return {};
+      },
+    },
+  },
+  data() {
+    return {
+       checked: true,
+      showDialog: false,
+      formInfo: JSON.parse(JSON.stringify(this.itemInfo)),
+      options: [
+        {
+          value: "选项1",
+          label: "站点一",
+        },
+        {
+          value: "选项2",
+          label: "站点二",
+        },
+        {
+          value: "选项3",
+          label: "站点三",
+        },
+        {
+          value: "选项4",
+          label: "站点四",
+        },
+        {
+          value: "选项5",
+          label: "站点五",
+        },
+      ],
+
+      rules: {
+        watchName: [
+          // required  是否为必填项, trigger:表单验证的触发时机,失去焦点进行验证
+          { required: true, message: "请输入设备名称", trigger: "blur" },
+          {
+            min: 3,
+            max: 6,
+            message: "用户名长度在 3 到 6 个字符",
+            trigger: "blur",
+          },
+        ],
+        watchCode: [
+          { required: true, message: "请输入设备编号", trigger: "blur" },
+          {
+            min: 3,
+            max: 6,
+            message: "用户名长度在 3 到 6 个字符",
+            trigger: "blur",
+          },
+        ],
+        routeAddress: [
+          { required: true, message: "请选则回路表记地址", trigger: "change" },
+         
+        ],
+        ratedVoltage: [
+          { required: true, message: '请选择站点列表', trigger: 'change'}
+        
+        ],
+        ratedCurrent: [
+          { required: true, message: "请输入已选站点个数", trigger: "blur" },
+          { trigger: "blur" },
+        ],
+        fzlMx: [
+          { required: true, message: "请输入挂载设备个数", trigger: "blur" },
+          { trigger: "blur" },
+        ],
+      },
+    };
+  },
+  methods: {
+    roleValid(rule, value, callback) {
+      rule
+      if (value.length === 0) {
+        callback(new Error("角色不能为空"));
+      } else {
+        callback();
+      }
+    },
+
+    // onSelectedDrug(event) {
+    //   this.routeAddress = event;
+    //   console.log(this.routeAddress);
+    // },
+    // 保存操作
+    submitForm(formName) {
+      const params = Object.assign(this.formInfo, {});
+      params
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          // 走保存请求
+          this.$message({
+            message: "操作成功!",
+            type: "success",
+          });
+          this.closeDialog(1);
+        } else {
+          return false;
+        }
+      });
+    },
+    // 关闭弹框
+    closeDialog(flag) {
+      this.$refs["formInfo"].resetFields();
+      this.showDialog = false;
+      this.$emit("closeDialog", flag);
+    },
+  },
+};
+</script>
+ 
+<style scoped lang="scss">
+.el-input,
+.el-select {
+  width: 240px;
+}
+
+// label样式
+.el-form-item__label {
+    width: 150px
+}
+.el-form-item__content {
+    margin-left: 150px
+}
+</style>

+ 221 - 163
src/views/siteManage/variableList/dialogComponent.vue

@@ -1,198 +1,256 @@
 <template>
-  <transition name="dialog-fade">
-    <el-dialog
-      v-if="showDialog"
-      :title="dialogTitle"
-      class="dialog-component"
-      v-model="showDialog"
-      width="640px"
-      @close="closeDialog(0)"
+  <el-dialog
+    :title="dialogTitle"
+    v-model="dialogVisible"
+    width="640px"
+    @close="closeDialog()"
+    @open="open"
+  >
+    <el-form
+      ref="formInfo"
+      :model="form"
+      class="demo-form-inline"
+      label-width="100px"
+      :rules="rules"
     >
-      <el-form
-        ref="formInfo"
-        :model="formInfo"
-        class="demo-form-inline"
-        label-width="100px"
-        :rules="rules"
-      >
-        <el-form-item label="设备名称:" prop="watchName">
-          <el-input v-model="formInfo.watchName"></el-input>
-        </el-form-item>
-        <el-form-item label="设备编号:" prop="watchCode">
-          <el-input v-model="formInfo.watchCode"></el-input>
-        </el-form-item>
-        <el-form-item label="回路表记地址:" prop="routeAddress">
-          <el-select
-            v-model="formInfo.routeAddress"
-            multiple
-            filterable
-            collapse-tags
-            placeholder="请选择"
-          >
-            <el-option
-              v-for="item in options"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
-        </el-form-item>
-
-        <el-form-item label="额定电压(kV):" prop="ratedVoltage">
-          <el-input v-model="formInfo.ratedVoltage"></el-input>
-          <div class="remarksTxt">(数值为线电压)</div>
-        </el-form-item>
-        <el-form-item label="额定电流(A):" prop="stationAddress">
-          <el-input v-model="formInfo.ratedCurrent"></el-input>
-        </el-form-item>
-        <el-form-item label="电流负载率门限:" prop="fzlMx">
-          <el-input v-model="formInfo.fzlMx"></el-input>
-           <div class="remarksTxt">(0-100之间的数字)</div>
-        </el-form-item>
-        <el-form-item label="设备能力:" prop="ability">
-          <el-checkbox v-model="checked">电能质量分析</el-checkbox>
-          <div class="remarksTxt">(如果未勾选,该设备不参与电能质量分析)</div>
-        </el-form-item>
-        
-        <br />
-        <br />
-        <br />
-        <div style="text-align: right">
-          <el-button @click="closeDialog(0)">取消</el-button>
-          <el-button type="primary" @click="submitForm('formInfo')"
-            >保存</el-button
-          >
-        </div>
-      </el-form>
-    </el-dialog>
-  </transition>
+      <el-form-item label="设备编号:" prop="deviceCode">
+        <el-input v-model="form.watchCode"></el-input>
+      </el-form-item>
+      <el-form-item label="变量名:" prop="variableName">
+        <el-input v-model="form.ratedVoltage"></el-input>
+      </el-form-item>
+      <el-form-item label="变量编码:" prop="variableCoding">
+        <el-input v-model="form.ratedCurrent"></el-input>
+      </el-form-item>
+
+      <el-form-item label="监控设备:" prop="routeAddress">
+        <el-select
+          v-model="form.routeAddress"
+          filterable
+          collapse-tags
+          placeholder="请选择"
+        >
+          <el-option
+            v-for="item in options"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="通信设备:" prop="routeAddress">
+        <el-select
+          v-model="form.routeAddress"
+          filterable
+          collapse-tags
+          placeholder="请选择"
+        >
+          <el-option
+            v-for="item in options"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+
+      <el-form-item label="数据地址:" prop="fzlMx">
+        <el-input v-model="form.dataAddress"></el-input>
+      </el-form-item>
+      <el-form-item label="数据类型:" prop="ability">
+        <el-input v-model="form.dataType"></el-input>
+      </el-form-item>
+      <el-form-item label="系数:" prop="ability">
+        <el-input v-model="form.coefficient"></el-input>
+      </el-form-item>
+      <el-form-item label="存盘周期(分钟):" prop="ability">
+        <el-input v-model="form.saveCycle"></el-input>
+      </el-form-item>
+      <el-form-item label="状态:" prop="ability">
+        <el-radio-group v-model="form.dataArea">
+          <el-radio label="1">模拟量</el-radio>
+          <el-radio label="2">状态量</el-radio>
+          <el-radio label="3">参数量</el-radio>
+        </el-radio-group>
+      </el-form-item>
+
+      <br />
+      <br />
+      <br />
+      <div style="text-align: right">
+        <el-button @click="closeDialog(0)">取消</el-button>
+        <el-button type="primary" @click="submitForm()">保存</el-button>
+      </div>
+    </el-form>
+  </el-dialog>
 </template>
 
 <script>
+// import { useStore } from 'vuex'
+import { defineComponent, ref, watchEffect } from 'vue'
+import * as api from '@/api/siteManage/watchDog.js' //待修改
+import { ElMessage } from 'element-plus'
 
-export default {
-  name: "DialogComponent",
+export default defineComponent({
+  name: 'DialogComponent',
+  emits: ['closeDialog'],
   props: {
-    dialogTitle: {
-      type: String,
-      default: "新增",
-    },
-    itemInfo: {
-      type: Object,
-      default: function () {
-        return {};
-      },
-    },
+    flag: Boolean,
+    dialogTitle: String,
+    itemInfo: Object,
   },
-  data() {
-    return {
-       checked: true,
-      showDialog: false,
-      formInfo: JSON.parse(JSON.stringify(this.itemInfo)),
-      options: [
-        {
-          value: "选项1",
-          label: "站点一",
-        },
-        {
-          value: "选项2",
-          label: "站点二",
-        },
-        {
-          value: "选项3",
-          label: "站点三",
-        },
-        {
-          value: "选项4",
-          label: "站点四",
-        },
-        {
-          value: "选项5",
-          label: "站点五",
-        },
-      ],
+  setup(props, context) {
+    context
+    // const store = useStore()
+    const dialogVisible = ref(false)
+    const formInfo = ref(null)
+
+    const form = ref([])
+
+    const siteList = ref([])
+
+    // open(): Dialog弹窗打开之前做的事
+    const open = () => {
+      form.value = props.itemInfo.value
+      // siteList.value = store.state.siteList
+      console.log('props.itemInfo.value')
+      console.log(props.itemInfo.value)
+    }
+
+    const options = [
+      {
+        value: '选项1',
+        label: '站点一',
+      },
+      {
+        value: '选项2',
+        label: '站点二',
+      },
+      {
+        value: '选项3',
+        label: '站点三',
+      },
+      {
+        value: '选项4',
+        label: '站点四',
+      },
+      {
+        value: '选项5',
+        label: '站点五',
+      },
+    ]
+
+    // 关闭弹框
+    const closeDialog = () => {
+      context.emit('closeDialog', false)
+      dialogVisible.value = false
+    }
+
+    watchEffect((fn, options) => {
+      fn, options
+      dialogVisible.value = props.flag
+    })
+
+    const roleValid = (rule, value, callback) => {
+      rule
+      if (value.length === 0) {
+        callback(new Error('角色不能为空'))
+      } else {
+        callback()
+      }
+    }
+
+    // 保存-修改操作
+    const submitForm = () => {
+      formInfo.value.validate((valid) => {
+        if (valid) {
+          form.value.qualityAnalysis =
+            form.value.qualityAnalysis == true
+              ? (form.value.qualityAnalysis = '是')
+              : (form.value.qualityAnalysis = '否')
 
+          if (props.dialogTitle === '新增') {
+            api.deviceNewsAdd(form.value).then((requset) => {
+              if (requset.status === 'SUCCESS') {
+                ElMessage.success({
+                  message: '新增成功',
+                  type: 'success',
+                })
+                closeDialog()
+              } else {
+                ElMessage.error(requset.msg)
+              }
+            })
+          } else {
+            api.deviceNewsUpdate(form.value).then((requset) => {
+              if (requset.status === 'SUCCESS') {
+                ElMessage.success({
+                  message: '修改成功',
+                  type: 'success',
+                })
+                closeDialog()
+              } else {
+                ElMessage.error(requset.msg)
+              }
+            })
+          }
+        } else {
+          console.log('error submit!!')
+          return false
+        }
+      })
+    }
+
+    return {
+      closeDialog,
+      dialogVisible,
+      options,
+      roleValid,
+      formInfo,
+      siteList,
+      form,
+      open,
+      submitForm,
       rules: {
         watchName: [
           // required  是否为必填项, trigger:表单验证的触发时机,失去焦点进行验证
-          { required: true, message: "请输入设备名称", trigger: "blur" },
+          { required: true, message: '请输入设备名称', trigger: 'blur' },
           {
             min: 3,
             max: 6,
-            message: "用户名长度在 3 到 6 个字符",
-            trigger: "blur",
+            message: '用户名长度在 3 到 6 个字符',
+            trigger: 'blur',
           },
         ],
         watchCode: [
-          { required: true, message: "请输入设备编号", trigger: "blur" },
+          { required: true, message: '请输入设备编号', trigger: 'blur' },
           {
             min: 3,
             max: 6,
-            message: "用户名长度在 3 到 6 个字符",
-            trigger: "blur",
+            message: '用户名长度在 3 到 6 个字符',
+            trigger: 'blur',
           },
         ],
         routeAddress: [
-          { required: true, message: "请选则回路表记地址", trigger: "change" },
-         
+          { required: true, message: '请选则回路表记地址', trigger: 'change' },
         ],
         ratedVoltage: [
-          { required: true, message: '请选择站点列表', trigger: 'change'}
-        
+          { required: true, message: '请选择站点列表', trigger: 'change' },
         ],
         ratedCurrent: [
-          { required: true, message: "请输入已选站点个数", trigger: "blur" },
-          { trigger: "blur" },
+          { required: true, message: '请输入已选站点个数', trigger: 'blur' },
+          { trigger: 'blur' },
         ],
         fzlMx: [
-          { required: true, message: "请输入挂载设备个数", trigger: "blur" },
-          { trigger: "blur" },
+          { required: true, message: '请输入挂载设备个数', trigger: 'blur' },
+          { trigger: 'blur' },
         ],
       },
-    };
-  },
-  methods: {
-    roleValid(rule, value, callback) {
-      rule
-      if (value.length === 0) {
-        callback(new Error("角色不能为空"));
-      } else {
-        callback();
-      }
-    },
-
-    // onSelectedDrug(event) {
-    //   this.routeAddress = event;
-    //   console.log(this.routeAddress);
-    // },
-    // 保存操作
-    submitForm(formName) {
-      const params = Object.assign(this.formInfo, {});
-      params
-      this.$refs[formName].validate((valid) => {
-        if (valid) {
-          // 走保存请求
-          this.$message({
-            message: "操作成功!",
-            type: "success",
-          });
-          this.closeDialog(1);
-        } else {
-          return false;
-        }
-      });
-    },
-    // 关闭弹框
-    closeDialog(flag) {
-      this.$refs["formInfo"].resetFields();
-      this.showDialog = false;
-      this.$emit("closeDialog", flag);
-    },
+    }
   },
-};
+})
 </script>
- 
 <style scoped lang="scss">
 .el-input,
 .el-select {
@@ -201,9 +259,9 @@ export default {
 
 // label样式
 .el-form-item__label {
-    width: 150px
+  width: 150px;
 }
 .el-form-item__content {
-    margin-left: 150px
+  margin-left: 150px;
 }
 </style>

+ 13 - 17
src/views/siteManage/variableList/index.vue

@@ -148,15 +148,16 @@
         :total="total"
       ></el-pagination>
     </div>
-
     <!-- 分页end -->
 
     <!--弹框组件开始-----------------------start-->
     <dialog-component
-      :dialog-title="dialogTitle"
-      :item-info="tableItem"
+      :dialogTitle="dialogTitle"
+      :itemInfo="tableItem"
       @closeDialog="closeDialog"
-      :show_Dialog="showDialog"
+      :flag="showDialog"
+
+
     ></dialog-component>
     <!--弹框组件开始-----------------------end-->
   </div>
@@ -165,7 +166,7 @@
 <script>
 import DialogComponent from './dialogComponent'
 import * as api from '@/api/siteManage/variableList'
-import { defineComponent, onMounted, ref } from 'vue'
+import { defineComponent, onMounted,reactive, ref } from 'vue'
 import { ElMessage } from 'element-plus'
 
 export default defineComponent({
@@ -174,7 +175,7 @@ export default defineComponent({
   components: { DialogComponent },
 
   setup() {
-    const tableItem = ref()
+    const tableItem = reactive([])
     const tableData = ref()
     const currentPage = ref(1)
     const pageSize = ref(15)
@@ -245,8 +246,8 @@ export default defineComponent({
     // 添加操作
     const addItem = () => {
       tableItem.value = {
-        id: '',
-        stationName: '',
+        // id: '',
+        // stationName: '',
         watchName: '',
         watchCode: '',
         siteList: [],
@@ -256,19 +257,14 @@ export default defineComponent({
       }
       dialogTitle.value = '新增'
       showDialog.value = true
-      // this.$nextTick(() => {
-      //   this.$refs['dialogComponent'].showDialog = true
-      // })
     }
     // 编辑操作
     const editRow = (row) => {
       console.log(row)
-      this.tableItem = row
-      this.dialogTitle = '编辑'
-      this.showDialog = true
-      this.$nextTick(() => {
-        this.$refs['dialogComponent'].showDialog = true
-      })
+      tableItem.value = row
+      dialogTitle.value = '编辑'
+      showDialog.value = true
+      
     }
     // 关闭操作
     const closeDialog = (flag) => {

+ 0 - 1
src/views/siteManage/watchDog/index.vue

@@ -181,7 +181,6 @@ export default defineComponent({
     function deviceNewsList() {
       api
         .deviceNewsList({
-          // siteId: 1,    //字段写活?
           siteId:props.siteId,
           size: pageSize.value,
           current: currentPage.value,