张建平 3 yıl önce
ebeveyn
işleme
1207948996

+ 103 - 0
src/api/workbench/monitoring.js

@@ -0,0 +1,103 @@
+import request from '@/router/axios';
+
+export const getList = (current, size, params) => {
+  return request({
+    url: '/api/galaxy-test/rtu/base/list',
+    method: 'get',
+    params: {
+      current,
+      size,
+      ...params
+    }
+  })
+}
+
+
+export const getDetail = (params) => {
+  return request({
+    url: '/api/galaxy-test/rtu/base/detail',
+    method: 'get',
+    params: {
+
+      ...params
+    }
+  })
+}
+
+export const add = (params) => {
+  return request({
+    url: '/api/galaxy-test/rtu/base/save',
+    method: 'post',
+    data: {
+
+      ...params
+    }
+  })
+}
+
+export const update = (params) => {
+  return request({
+    url: '/api/galaxy-test/rtu/base/update',
+    method: 'post',
+    data: {
+
+      ...params
+    }
+  })
+}
+
+
+
+
+
+// 维修列表
+export const getOrderList = (current, size, params) => {
+  return request({
+    url: '/api/galaxy-test/rtu/check/order/page',
+    method: 'get',
+    params: {
+      current,
+      size,
+      ...params
+    }
+  })
+}
+
+// 维修列表
+export const getProcessList = (current, size, params) => {
+  return request({
+    url: '/api/galaxy-test/rtu/check/order/process/page',
+    method: 'get',
+    params: {
+      current,
+      size,
+      ...params
+    }
+  })
+}
+
+
+// 维修工单关闭
+export const close = (params) => {
+  return request({
+    url: '/api/galaxy-test/rtu/check/order/close',
+    method: 'post',
+    data: {
+      ...params
+    }
+  })
+}
+
+
+// 预警信息
+export const getWrningInfo = (params) => {
+  return request({
+    url: '/api/galaxy-test/rtu/warning/page',
+    method: 'post',
+    data: {
+      ...params
+    }
+  })
+}
+
+

+ 422 - 43
src/views/wel/index.vue

@@ -1,63 +1,442 @@
+<!--
+ * @Title: 
+ * @Description: 
+ * @Author: 893699165@qq.com
+ * @Date: 2022-08-24 10:49:21
+ * @LastEditors: 
+ * @LastEditTime: 2022-08-24 10:49:21
+-->
 <template>
   <div>
     <el-row>
-      <el-col :span="24">
-        <third-register></third-register>
-      </el-col>
-    </el-row>
-    <el-row>
-      <el-col :span="24">
-        <basic-container>
-        </basic-container>
+      <el-col :span="5">
+        <div class="box">
+          <!-- <el-scrollbar>
+          <basic-container>
+            <avue-tree
+              :option="treeOption"
+              :data="treeData"
+              @node-click="nodeClick"
+            />
+          </basic-container>
+        </el-scrollbar> -->
+        </div>
       </el-col>
-    </el-row>
-    <el-row>
-      <el-col :span="16">
+      <el-col :span="19">
         <basic-container>
-
+          <avue-crud
+            :option="option"
+            :table-loading="loading"
+            :data="data"
+            ref="crud"
+            v-model="form"
+            :permission="permissionList"
+            @row-del="rowDel"
+            @row-update="rowUpdate"
+            @row-save="rowSave"
+            @search-change="searchChange"
+            @search-reset="searchReset"
+            @selection-change="selectionChange"
+            @current-change="currentChange"
+            @size-change="sizeChange"
+            @refresh-change="refreshChange"
+            @on-load="onLoad"
+            @before-open="beforeOpen"
+          >
+            <template slot="state" slot-scope="{ row }">
+              <el-button type="text" @click="openConfig(row)"> 正常 </el-button>
+            </template>
+            <template slot-scope="{ row, index }" slot="menu">
+              <el-button
+                type="text"
+                size="small"
+                @click="$refs.crud.rowView(row, index)"
+                >预警配置
+              </el-button>
+              <el-button type="text" size="small" @click="openInfo"
+                >预警信息
+              </el-button>
+              <el-button type="text" size="small" @click="openOrder"
+                >维修工单
+              </el-button>
+            </template>
+          </avue-crud>
         </basic-container>
       </el-col>
-      <el-col :span="8">
-        <el-row>
-          <basic-container>
-          </basic-container>
-        </el-row>
-        <el-row>
-          <basic-container>
-
-          </basic-container>
-        </el-row>
-
-      </el-col>
     </el-row>
+    <el-dialog
+      title="预警配置"
+      :visible.sync="configDialog"
+      width="600px"
+      :before-close="handleClose"
+      :close-on-click-modal="false"
+      append-to-body
+    >
+      <el-form label-width="120px">
+        <el-form-item label="预警总开关">
+          <el-switch
+            v-model="warningConfig.configSw"
+            active-color="#13ce66"
+            inactive-color="#ff4949"
+            active-text="开"
+            inactive-text="关"
+          >
+          </el-switch>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="configDialog = false" size="small">取 消</el-button>
+        <el-button type="primary" @click="confirmConfig" size="small"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+    <el-dialog
+      title="预警信息"
+      :visible.sync="infoDialog"
+      width="80%"
+      :close-on-click-modal="false"
+      append-to-body
+    >
+      <warningInfo :id="id" ref="warningInfo"></warningInfo>
+    </el-dialog>
+    <el-dialog
+      title="维修工单"
+      :visible.sync="orderDialog"
+      width="80%"
+      :close-on-click-modal="false"
+      append-to-body
+    >
+      <maintainOrder :id="id" ref="maintainOrder"></maintainOrder>
+    </el-dialog>
   </div>
 </template>
 
 <script>
-  import {mapGetters} from "vuex";
+import { getList, getDetail, add, update } from "@/api/workbench/monitoring";
+import { mapGetters } from "vuex";
+import warningInfo from "./warningInfo.vue";
+import maintainOrder from "./maintainOrder.vue";
+export default {
+  components: {
+    warningInfo,
+    maintainOrder,
+  },
+  data() {
+    return {
+      orderDialog: false,
+      warningConfig: {
+        configSw: false,
+        code: "",
+      },
+      infoDialog: false,
+      configDialog: false,
+      id: "",
+      editForm: {},
+      editDialog: false,
+      form: {},
+      selectionList: [],
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      treeOption: {
+        nodeKey: "id",
+        lazy: true,
+        treeLoad: function (node, resolve) {
+          const parentId = node.level === 0 ? 0 : node.data.id;
+          getDeptLazyTree(parentId).then((res) => {
+            resolve(
+              res.data.data.map((item) => {
+                return {
+                  ...item,
+                  leaf: !item.hasChildren,
+                };
+              })
+            );
+          });
+        },
+        addBtn: false,
+        menu: false,
+        size: "small",
+        props: {
+          labelText: "标题",
+          label: "title",
+          value: "value",
+          children: "children",
+        },
+      },
+      option: {
+        labelWidth: 120,
+        viewLabelWidth: 100,
+        searchlabelWidth: 100,
+        height: "auto",
+        calcHeight: 30,
+        align: "center",
+        headerAlign: "center",
+        lazy: true,
+        tip: false,
+        simplePage: true,
+        searchShow: true,
+        searchMenuSpan: 6,
+        tree: true,
+        border: true,
+        index: true,
+        selection: true,
+        viewBtn: false,
+        viewTitle: "预警配置",
+        editBtn: false,
+        delBtn: false,
+        menuWidth: 220,
+        dialogType: "drawer",
+        dialogClickModal: false,
+        column: [
+          {
+            label: "测站名称",
+            prop: "rtuName",
+            search: true,
+            span: 12,
+          },
+          {
+            label: "测站编码",
+            prop: "rtuCode",
+            span: 12,
+            search: true,
+          },
+          {
+            label: "所属机构",
+            prop: "orgId",
+            span: 12,
+            hide: true,
+          },
+          {
+            label: "最后上线时间",
+            prop: "orgId",
+            span: 12,
+            addDisplay: false,
+          },
+          {
+            label: "运行状态",
+            prop: "state",
+            span: 12,
+            addDisplay: false,
+          },
+          {
+            label: "项目名称",
+            prop: "projectName",
+
+            span: 12,
+            hide: true,
+          },
+          {
+            label: "SIM卡号",
+            prop: "simId",
+
+            span: 8,
+            hide: true,
+          },
+          {
+            label: "经度",
+            prop: "lng",
+            span: 8,
+            hide: true,
+          },
+          {
+            label: "纬度",
+            prop: "lat",
+            span: 8,
+            hide: true,
+          },
+          {
+            label: "测站类型",
+            prop: "rtuKinds",
+
+            span: 24,
 
-  export default {
-    name: "wel",
-    data() {
+            type: "input",
+            hide: true,
+
+            // dicData: [
+            //   {
+            //     label: 1,
+            //     value: 1,
+            //   },
+            // ],
+          },
+          {
+            label: "备注说明",
+            prop: "remark",
+            span: 24,
+            type: "textarea",
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  computed: {
+    // ...mapGetters(["userInfo", "permission"]),
+    permissionList() {
       return {
-        activeNames: ['1', '2', '3', '5'],
-        logActiveNames: ['26']
+        // addBtn: this.vaildData(this.permission.docCategory_add, false),
+        // viewBtn: this.vaildData(this.permission.docCategory_view, false),
+        // delBtn: this.vaildData(this.permission.docCategory_delete, false),
+        // editBtn: this.vaildData(this.permission.docCategory_edit, false),
       };
     },
-    computed: {
-      ...mapGetters(["userInfo"]),
+    ids() {
+      let ids = [];
+      this.selectionList.forEach((ele) => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    },
+  },
+  mounted() {},
+  created() {},
+  methods: {
+    confirmConfig() {},
+    openConfig(item) {
+      this.configSw = item.configSw;
+      this.configDialog = true;
+    },
+    openInfo(item) {
+      this.id = item.id;
+      this.infoDialog = true;
+      this.$nextTick(() => {
+        this.$refs["warningInfo"].init();
+      });
+    },
+    openOrder(item) {
+      this.id = item.id;
+      this.orderDialog = true;
+      this.$nextTick(() => {
+        this.$refs["maintainOrder"].init();
+      });
+    },
+
+    rowSave(row, done, loading) {
+      add(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
     },
-    methods: {
-      handleChange(val) {
-        window.console.log(val);
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
       }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getDetail(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
     },
-  };
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query)
+      ).then((res) => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+  },
+};
 </script>
-
-<style>
-  .el-font-size {
-    font-size: 14px;
-  }
-</style>
-

+ 301 - 0
src/views/wel/maintainOrder.vue

@@ -0,0 +1,301 @@
+<!--
+ * @Title: 
+ * @Description: 
+ * @Author: 893699165@qq.com
+ * @Date: 2022-08-24 10:49:21
+ * @LastEditors: 
+ * @LastEditTime: 2022-08-24 10:49:21
+-->
+<template>
+  <div>
+    <basic-container>
+      <avue-crud
+        :option="option"
+        :table-loading="loading"
+        :data="data"
+        ref="crud"
+        v-model="form"
+        :permission="permissionList"
+        @row-del="rowDel"
+        @row-update="rowUpdate"
+        @row-save="rowSave"
+        @search-change="searchChange"
+        @search-reset="searchReset"
+        @selection-change="selectionChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+      >
+        <template slot-scope="{ row, index }" slot="menu">
+          <el-button type="text" size="small" @click="openDetail(row)"
+            >工单记录详情
+          </el-button>
+          <el-button type="text" size="small" @click="orderOff(row)"
+            >人工关闭
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <el-dialog
+      title="工单填报记录列表"
+      :visible.sync="recordDialog"
+      width="80%"
+      :close-on-click-modal="false"
+      append-to-body
+    >
+      <recordList :id="id" ref="recordList"></recordList>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import {
+  getOrderList,
+  close,
+  getProcessList,
+} from "@/api/workbench/monitoring";
+import { mapGetters } from "vuex";
+import recordList from "./recordList";
+export default {
+  components: {
+    recordList,
+  },
+  data() {
+    return {
+      recordDialog: false,
+      id: "",
+      editForm: {},
+      editDialog: false,
+      form: {},
+      selectionList: [],
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 5,
+        currentPage: 1,
+        total: 0,
+      },
+
+      option: {
+        labelWidth: 120,
+        viewLabelWidth: 100,
+        searchlabelWidth: 100,
+        height: "auto",
+        calcHeight: 30,
+        align: "center",
+        headerAlign: "center",
+
+        tip: false,
+        simplePage: true,
+        searchShow: false,
+        searchMenuSpan: 6,
+        addBtn: false,
+
+        border: true,
+        index: true,
+        height: 400,
+        editBtn: false,
+        delBtn: false,
+        menuWidth: 160,
+        dialogType: "drawer",
+
+        dialogClickModal: false,
+        column: [
+          {
+            label: "工单ID",
+            prop: "rtuName",
+            search: true,
+            span: 12,
+          },
+          {
+            label: "工单来源",
+            prop: "rtuCode",
+            span: 12,
+            search: true,
+          },
+          {
+            label: "工单创建时间",
+            prop: "orgId",
+            span: 12,
+          },
+          {
+            label: "工单更新时间",
+            prop: "orgId",
+            span: 12,
+          },
+          {
+            label: "工单说明",
+            prop: "orgId",
+            span: 12,
+          },
+          {
+            label: "处理人",
+            prop: "orgId",
+            span: 12,
+          },
+          {
+            label: "最新处理状态",
+            prop: "orgId",
+            span: 12,
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  prop: {
+    id: ["String"],
+  },
+
+  methods: {
+    init() {
+      // this.onLoad(this.page);
+    },
+    openDetail(item) {
+      this.recordDialog = true;
+      this.id = item.id;
+      this.$nextTick(() => {
+        this.$refs["recordList"].init();
+      });
+    },
+    orderOff(item) {
+      this.$prompt("备注", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+      })
+        .then(({ value }) => {
+          close({ id: item.id, orderDesc: value }).then((res) => {
+            if (res.data.code == 200) {
+              this.$message({
+                type: "info",
+                message: "操作成功",
+              });
+              this.refreshChange();
+            }
+          });
+        })
+        .catch(() => {});
+    },
+    rowSave(row, done, loading) {
+      add(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getDetail(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getOrderList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query)
+      ).then((res) => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+  },
+};
+</script>

+ 277 - 0
src/views/wel/monitoring copy.vue

@@ -0,0 +1,277 @@
+<!--
+ * @Title: 
+ * @Description: 
+ * @Author: 893699165@qq.com
+ * @Date: 2022-08-24 10:49:21
+ * @LastEditors: 
+ * @LastEditTime: 2022-08-24 10:49:21
+-->
+<template>
+  <basic-container>
+    <avue-crud
+      :option="option"
+      :table-loading="loading"
+      :data="data"
+      ref="crud"
+      v-model="form"
+      :permission="permissionList"
+      @row-del="rowDel"
+      @row-update="rowUpdate"
+      @row-save="rowSave"
+      @search-change="searchChange"
+      @search-reset="searchReset"
+      @selection-change="selectionChange"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+      @refresh-change="refreshChange"
+      @on-load="onLoad"
+    >
+    </avue-crud>
+  </basic-container>
+</template>
+
+<script>
+import { getList, getDetail, add, update } from "@/api/workbench/monitoring";
+import { mapGetters } from "vuex";
+export default {
+  data() {
+    return {
+      editForm: {},
+      editDialog: false,
+      form: {},
+      selectionList: [],
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      option: {
+        labelWidth: 100,
+        searchlabelWidth: 100,
+        height: "auto",
+        calcHeight: 30,
+        align: "center",
+        headerAlign: "center",
+        lazy: true,
+        tip: false,
+        simplePage: true,
+        searchShow: true,
+        searchMenuSpan: 6,
+        tree: true,
+        border: true,
+        index: true,
+        selection: true,
+        viewBtn: true,
+        menuWidth: 300,
+        dialogType: "drawer",
+        dialogClickModal: false,
+        column: [
+          {
+            label: "测站编码",
+            prop: "rtuCode",
+            span: 12,
+          },
+          {
+            label: "测站名称",
+            prop: "rtuName",
+            search: true,
+            span: 12,
+          },
+          {
+            label: "所属机构",
+            prop: "orgId",
+            search: true,
+            span: 12,
+          },
+          {
+            label: "项目名称",
+            prop: "projectName",
+            search: true,
+            span: 12,
+          },
+          {
+            label: "SIM卡号",
+            prop: "simId",
+            search: true,
+            span: 8,
+          },
+          {
+            label: "经度",
+            prop: "lng",
+            span: 8,
+          },
+          {
+            label: "纬度",
+            prop: "lat",
+            span: 8,
+          },
+          {
+            label: "测站类型",
+            prop: "rtuKinds",
+            search: true,
+            span: 24,
+            search: true,
+            type: "input",
+            // dicData: [
+            //   {
+            //     label: 1,
+            //     value: 1,
+            //   },
+            // ],
+          },
+          // {
+          //   label: "备注说明",
+          //   prop: "categoryTitle",
+          //   span: 24,
+          //   type: "textarea",
+          // },
+        ],
+      },
+      data: [],
+    };
+  },
+  computed: {
+    // ...mapGetters(["userInfo", "permission"]),
+    permissionList() {
+      return {
+        // addBtn: this.vaildData(this.permission.docCategory_add, false),
+        // viewBtn: this.vaildData(this.permission.docCategory_view, false),
+        // delBtn: this.vaildData(this.permission.docCategory_delete, false),
+        // editBtn: this.vaildData(this.permission.docCategory_edit, false),
+      };
+    },
+    ids() {
+      let ids = [];
+      this.selectionList.forEach((ele) => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    },
+  },
+  mounted() {},
+  created() {},
+  methods: {
+    rowSave(row, done, loading) {
+      add(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getDetail(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query)
+      ).then((res) => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+  },
+};
+</script>

+ 440 - 0
src/views/wel/monitoring.vue

@@ -0,0 +1,440 @@
+<!--
+ * @Title: 
+ * @Description: 
+ * @Author: 893699165@qq.com
+ * @Date: 2022-08-24 10:49:21
+ * @LastEditors: 
+ * @LastEditTime: 2022-08-24 10:49:21
+-->
+<template>
+  <div>
+    <el-row>
+      <el-col :span="5">
+        <div class="box">
+          <!-- <el-scrollbar>
+          <basic-container>
+            <avue-tree
+              :option="treeOption"
+              :data="treeData"
+              @node-click="nodeClick"
+            />
+          </basic-container>
+        </el-scrollbar> -->
+        </div>
+      </el-col>
+      <el-col :span="19">
+        <basic-container>
+          <avue-crud
+            :option="option"
+            :table-loading="loading"
+            :data="data"
+            ref="crud"
+            v-model="form"
+            :permission="permissionList"
+            @row-del="rowDel"
+            @row-update="rowUpdate"
+            @row-save="rowSave"
+            @search-change="searchChange"
+            @search-reset="searchReset"
+            @selection-change="selectionChange"
+            @current-change="currentChange"
+            @size-change="sizeChange"
+            @refresh-change="refreshChange"
+            @on-load="onLoad"
+            @before-open="beforeOpen"
+          >
+            <template slot="state" slot-scope="scope">
+              <el-tag @click="openConfig(scope.row)">正常</el-tag>
+            </template>
+            <template slot-scope="{ row, index }" slot="menu">
+              <el-button
+                type="text"
+                size="small"
+                @click="$refs.crud.rowView(row, index)"
+                >预警配置
+              </el-button>
+              <el-button type="text" size="small" @click="openInfo"
+                >预警信息
+              </el-button>
+              <el-button type="text" size="small" @click="openOrder"
+                >维修工单
+              </el-button>
+            </template>
+          </avue-crud>
+        </basic-container>
+      </el-col>
+    </el-row>
+    <el-dialog
+      title="预警配置"
+      :visible.sync="configDialog"
+      width="600px"
+      :before-close="handleClose"
+      :close-on-click-modal="false"
+      append-to-body
+    >
+      <el-form label-width="120px">
+        <el-form-item label="预警总开关">
+          <el-switch
+            v-model="warningConfig.configSw"
+            active-color="#13ce66"
+            inactive-color="#ff4949"
+            active-text="开"
+            inactive-text="关"
+          >
+          </el-switch>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="configDialog = false" size="small">取 消</el-button>
+        <el-button type="primary" @click="confirmConfig" size="small"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+    <el-dialog
+      title="预警信息"
+      :visible.sync="infoDialog"
+      width="80%"
+      :close-on-click-modal="false"
+      append-to-body
+    >
+      <warningInfo :id="id" ref="warningInfo"></warningInfo>
+    </el-dialog>
+    <el-dialog
+      title="维修工单"
+      :visible.sync="orderDialog"
+      width="80%"
+      :close-on-click-modal="false"
+      append-to-body
+    >
+      <maintainOrder :id="id" ref="maintainOrder"></maintainOrder>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getList, getDetail, add, update } from "@/api/workbench/monitoring";
+import { mapGetters } from "vuex";
+import warningInfo from "./warningInfo.vue";
+import maintainOrder from "./maintainOrder.vue";
+export default {
+  components: {
+    warningInfo,
+    maintainOrder,
+  },
+  data() {
+    return {
+      orderDialog:false,
+      warningConfig: {
+        configSw: false,
+        code: "",
+      },
+      infoDialog: false,
+      configDialog: false,
+      id: "",
+      editForm: {},
+      editDialog: false,
+      form: {},
+      selectionList: [],
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      treeOption: {
+        nodeKey: "id",
+        lazy: true,
+        treeLoad: function (node, resolve) {
+          const parentId = node.level === 0 ? 0 : node.data.id;
+          getDeptLazyTree(parentId).then((res) => {
+            resolve(
+              res.data.data.map((item) => {
+                return {
+                  ...item,
+                  leaf: !item.hasChildren,
+                };
+              })
+            );
+          });
+        },
+        addBtn: false,
+        menu: false,
+        size: "small",
+        props: {
+          labelText: "标题",
+          label: "title",
+          value: "value",
+          children: "children",
+        },
+      },
+      option: {
+        labelWidth: 120,
+        viewLabelWidth: 100,
+        searchlabelWidth: 100,
+        height: "auto",
+        calcHeight: 30,
+        align: "center",
+        headerAlign: "center",
+        lazy: true,
+        tip: false,
+        simplePage: true,
+        searchShow: true,
+        searchMenuSpan: 6,
+        tree: true,
+        border: true,
+        index: true,
+        selection: true,
+        viewBtn: false,
+        viewTitle: "预警配置",
+        editBtn: false,
+        delBtn: false,
+        menuWidth: 220,
+        dialogType: "drawer",
+        dialogClickModal: false,
+        column: [
+          {
+            label: "测站名称",
+            prop: "rtuName",
+            search: true,
+            span: 12,
+          },
+          {
+            label: "测站编码",
+            prop: "rtuCode",
+            span: 12,
+            search: true,
+          },
+          {
+            label: "所属机构",
+            prop: "orgId",
+            span: 12,
+            hide: true,
+          },
+          {
+            label: "最后上线时间",
+            prop: "orgId",
+            span: 12,
+            addDisplay: false,
+          },
+          {
+            label: "运行状态",
+            prop: "state",
+            span: 12,
+            addDisplay: false,
+          },
+          {
+            label: "项目名称",
+            prop: "projectName",
+
+            span: 12,
+            hide: true,
+          },
+          {
+            label: "SIM卡号",
+            prop: "simId",
+
+            span: 8,
+            hide: true,
+          },
+          {
+            label: "经度",
+            prop: "lng",
+            span: 8,
+            hide: true,
+          },
+          {
+            label: "纬度",
+            prop: "lat",
+            span: 8,
+            hide: true,
+          },
+          {
+            label: "测站类型",
+            prop: "rtuKinds",
+
+            span: 24,
+
+            type: "input",
+            hide: true,
+
+            // dicData: [
+            //   {
+            //     label: 1,
+            //     value: 1,
+            //   },
+            // ],
+          },
+          {
+            label: "备注说明",
+            prop: "remark",
+            span: 24,
+            type: "textarea",
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  computed: {
+    // ...mapGetters(["userInfo", "permission"]),
+    permissionList() {
+      return {
+        // addBtn: this.vaildData(this.permission.docCategory_add, false),
+        // viewBtn: this.vaildData(this.permission.docCategory_view, false),
+        // delBtn: this.vaildData(this.permission.docCategory_delete, false),
+        // editBtn: this.vaildData(this.permission.docCategory_edit, false),
+      };
+    },
+    ids() {
+      let ids = [];
+      this.selectionList.forEach((ele) => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    },
+  },
+  mounted() {},
+  created() {},
+  methods: {
+    confirmConfig() {},
+    openConfig(row, index) {
+      this.configSw = item.configSw;
+      this.configDialog = true;
+    },
+    openInfo(item) {
+      this.id = item.id;
+      this.infoDialog = true;
+      this.$refs.warningInfo.init();
+    },
+    openOrder(item) {
+      this.id = item.id;
+      this.orderDialog = true;
+      this.$nextTick(() => {
+        this.$refs["maintainOrder"].init();
+      });
+    },
+
+    rowSave(row, done, loading) {
+      add(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getDetail(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query)
+      ).then((res) => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+  },
+};
+</script>

+ 53 - 0
src/views/wel/recordDetail.vue

@@ -0,0 +1,53 @@
+<!--
+ * @Title: 
+ * @Description: 
+ * @Author: 893699165@qq.com
+ * @Date: 2022-08-24 10:49:21
+ * @LastEditors: 
+ * @LastEditTime: 2022-08-24 10:49:21
+-->
+<template>
+  <div>
+    <el-form ref="form" :model="form" label-width="80px">
+      <el-row>
+        <el-col :span="24">
+          <el-form-item label="处理说明" class="mb0"> </el-form-item>
+          <el-form-item label="" label-width="0" class="mb0">
+            <el-input v-model="form.name" type="textarea" :rows="4"></el-input>
+          </el-form-item>
+          <el-form-item label="" label-width="0" class="mb0">
+            <el-image
+              style="width: 100px; height: 100px"
+              src="https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg"
+              fit="contain"
+            ></el-image>
+          </el-form-item>
+        </el-col>
+      </el-row>
+    </el-form>
+  </div>
+</template>
+
+<script>
+import { getList, getDetail, add, update } from "@/api/workbench/monitoring";
+import { mapGetters } from "vuex";
+
+export default {
+  data() {
+    return {
+      id: "",
+      form: {},
+    };
+  },
+  prop: {
+    id: ["String"],
+  },
+
+  methods: {},
+};
+</script>
+<style>
+.mb0 {
+  margin-bottom: 0 !important;
+}
+</style>

+ 261 - 0
src/views/wel/recordList.vue

@@ -0,0 +1,261 @@
+<!--
+ * @Title: 
+ * @Description: 
+ * @Author: 893699165@qq.com
+ * @Date: 2022-08-24 10:49:21
+ * @LastEditors: 
+ * @LastEditTime: 2022-08-24 10:49:21
+-->
+<template>
+  <div>
+    <basic-container>
+      <avue-crud
+        :option="option"
+        :table-loading="loading"
+        :data="data"
+        ref="crud"
+        v-model="form"
+        :permission="permissionList"
+        @row-del="rowDel"
+        @row-update="rowUpdate"
+        @row-save="rowSave"
+        @search-change="searchChange"
+        @search-reset="searchReset"
+        @selection-change="selectionChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        @before-open="beforeOpen"
+      >
+        <template slot-scope="{ row }" slot="menu">
+          <el-button type="text" size="small" @click="openDetail(row)"
+            >详情
+          </el-button>
+          <el-button type="text" size="small" @click="openPicture(row)"
+            >图片
+          </el-button>
+        </template>
+      </avue-crud>
+    </basic-container>
+    <el-dialog
+      title="工单处理填报详情"
+      :visible.sync="detailDialog"
+      width="80%"
+      :close-on-click-modal="false"
+      append-to-body
+    >
+      <record-detail :id="id" ref="recordDetail"></record-detail>
+    </el-dialog>
+    <el-dialog
+      title="图片"
+      :visible.sync="pictureDialog"
+      width="80%"
+      :close-on-click-modal="false"
+      append-to-body
+    >
+      <record-picture :id="id" ref="recordPicture"></record-picture>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+import { getProcessList } from "@/api/workbench/monitoring";
+
+import recordDetail from "./recordDetail";
+import recordPicture from "./recordPicture.vue";
+export default {
+  components: { recordDetail, recordPicture },
+  data() {
+    return {
+      pictureDialog: false,
+      detailDialog: false,
+      id: "",
+      editForm: {},
+      editDialog: false,
+      form: {},
+      selectionList: [],
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 5,
+        currentPage: 1,
+        total: 0,
+      },
+
+      option: {
+        labelWidth: 120,
+        viewLabelWidth: 100,
+        searchlabelWidth: 100,
+        height: "auto",
+        calcHeight: 30,
+        align: "center",
+        headerAlign: "center",
+
+        tip: false,
+        simplePage: true,
+        searchShow: false,
+        searchMenuSpan: 6,
+        addBtn: false,
+
+        border: true,
+        index: true,
+        height: 400,
+        editBtn: false,
+        delBtn: false,
+        menuWidth: 160,
+        dialogType: "drawer",
+
+        dialogClickModal: false,
+        column: [
+          {
+            label: "填报时间",
+            prop: "createTime",
+            search: true,
+            span: 12,
+          },
+          {
+            label: "处理人",
+            prop: "rtuCode",
+            span: 12,
+            search: true,
+          },
+          {
+            label: "处理说明",
+            prop: "processDesc",
+            span: 12,
+          },
+          {
+            label: "RTU状态",
+            prop: "processDesc",
+            span: 12,
+          },
+          {
+            label: "雨量传感器",
+            prop: "processDesc",
+            span: 12,
+          },
+          {
+            label: "水位传感器",
+            prop: "processDesc",
+            span: 12,
+          },
+          {
+            label: "墒情传感器",
+            prop: "processDesc",
+            span: 12,
+          },
+          {
+            label: "供电",
+            prop: "processDesc",
+            span: 12,
+          },
+          {
+            label: "SIM卡",
+            prop: "processDesc",
+            span: 12,
+          },
+          {
+            label: "北斗通讯",
+            prop: "processDesc",
+            span: 12,
+          },
+          {
+            label: "处理状态",
+            prop: "status",
+            span: 12,
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  prop: {
+    id: ["String"],
+  },
+
+  methods: {
+    init() {
+      // this.onLoad(this.page);
+    },
+    openDetail(item) {
+      this.detailDialog = true;
+    },
+    openPicture() {
+      this.pictureDialog = true;
+      this.$nextTick(() => {});
+    },
+
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getDetail(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getProcessList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query)
+      ).then((res) => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+  },
+};
+</script>

+ 237 - 0
src/views/wel/recordPicture.vue

@@ -0,0 +1,237 @@
+<!--
+ * @Title: 
+ * @Description: 
+ * @Author: 893699165@qq.com
+ * @Date: 2022-08-24 10:49:21
+ * @LastEditors: 
+ * @LastEditTime: 2022-08-24 10:49:21
+-->
+<template>
+  <avue-crud
+    :option="option"
+    :table-loading="loading"
+    :data="data"
+    ref="crud"
+    v-model="form"
+    :permission="permissionList"
+    @search-change="searchChange"
+    @search-reset="searchReset"
+    @selection-change="selectionChange"
+    @current-change="currentChange"
+    @size-change="sizeChange"
+    @refresh-change="refreshChange"
+    @on-load="onLoad"
+  >
+    <template slot-scope="{ row }" slot="img">
+      <el-image :src="row.img" :preview-src-list="srcList"> </el-image>
+    </template>
+    <template slot-scope="{ row }" slot="menu">
+      <el-button type="text" size="small" @click="download(row)"
+        >下载
+      </el-button>
+    </template>
+  </avue-crud>
+</template>
+
+<script>
+import { getList, getDetail, add, update } from "@/api/workbench/monitoring";
+import { mapGetters } from "vuex";
+
+export default {
+  data() {
+    return {
+      srcList: [],
+      detailDialog: false,
+      id: "",
+      editForm: {},
+      editDialog: false,
+      form: {},
+      selectionList: [],
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 5,
+        currentPage: 1,
+        total: 0,
+      },
+
+      option: {
+        labelWidth: 120,
+        viewLabelWidth: 100,
+        searchlabelWidth: 100,
+        height: "auto",
+        calcHeight: 30,
+        align: "center",
+        headerAlign: "center",
+
+        tip: false,
+        simplePage: true,
+        searchShow: false,
+        searchMenuSpan: 6,
+        addBtn: false,
+
+        border: true,
+        index: true,
+        height: 400,
+        editBtn: false,
+        delBtn: false,
+        menuWidth: 160,
+        dialogType: "drawer",
+
+        dialogClickModal: false,
+        column: [
+          {
+            label: "拍照时间",
+            prop: "rtuName",
+            search: true,
+            span: 12,
+          },
+          {
+            label: "照片说明",
+            prop: "rtuCode",
+            span: 12,
+            search: true,
+          },
+          {
+            label: "图片缩略图",
+            prop: "orgId",
+            span: 12,
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  prop: {
+    id: ["String"],
+  },
+
+  methods: {
+    init() {
+      this.onLoad(this.page);
+    },
+    openDetail(item) {
+      this.detailDialog = true;
+    },
+    rowSave(row, done, loading) {
+      add(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getDetail(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query)
+      ).then((res) => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+  },
+};
+</script>

+ 439 - 0
src/views/wel/warningConfig.vue

@@ -0,0 +1,439 @@
+<!--
+* Date:
+* Title: 应急资料管理-资料目录
+* Description:对本文件的详细描述,原则上不能少于30字
+* @Author  galaxy
+* @Mender:(文件的修改者,文件创建者之外的人)
+* @Version 1.0
+* Remark:认为有必要的其他信息
+-->
+<template>
+  <basic-container>
+    <avue-crud
+      :option="option"
+      :table-loading="loading"
+      :data="data"
+      ref="crud"
+      v-model="form"
+      :permission="permissionList"
+      :before-open="beforeOpen"
+      :before-close="beforeClose"
+      @row-del="rowDel"
+      @row-update="rowUpdate"
+      @row-save="rowSave"
+      @search-change="searchChange"
+      @search-reset="searchReset"
+      @selection-change="selectionChange"
+      @current-change="currentChange"
+      @size-change="sizeChange"
+      @refresh-change="refreshChange"
+      @on-load="onLoad"
+      @tree-load="treeLoad"
+    >
+      <template slot="menuLeft">
+        <el-button
+          type="danger"
+          size="small"
+          icon="el-icon-delete"
+          v-if="permission.docCategory_delete"
+          plain
+          @click="handleDelete"
+          >删 除
+        </el-button>
+      </template>
+      <template slot-scope="scope" slot="menu">
+        <el-button
+          type="text"
+          icon="el-icon-circle-plus-outline"
+          size="small"
+          @click.stop="handleAdd(scope.row, scope.index)"
+          v-if="userInfo.role_name.includes('admin')"
+          >新增子项
+        </el-button>
+      </template>
+    </avue-crud>
+    <el-drawer
+      :title="1"
+      :visible.sync="editDialog"
+      direction="rtl"
+      custom-class="demo-drawer"
+      ref="drawer"
+      append-to-body
+      :wrapperClosable="false"
+      size="65%"
+    >
+      <div class="demo-drawer__content">
+        <docCategoryEdit ref="docCategoryEdit"></docCategoryEdit>
+      </div>
+    </el-drawer>
+  </basic-container>
+</template>
+
+<script>
+// import {
+//   add,
+//   get,
+//   getLazyList,
+//   getTree,
+//   remove,
+//   update,
+// } from "@/api/business/yjbz/yjzlgl/docCategory";
+import { mapGetters } from "vuex";
+export default {
+  data() {
+    //验证规则-排序号
+    const validateNumber = (rule, value, callback) => {
+      console.log(value);
+      if (!value || value <= 0) {
+        return callback(new Error("排序号格式不正确"));
+      } else {
+        callback();
+      }
+    };
+
+    return {
+      editForm: {},
+      editDialog: false,
+      form: {},
+      selectionList: [],
+      query: {},
+      loading: true,
+      parentId: 0,
+      page: {
+        pageSize: 10,
+        currentPage: 1,
+        total: 0,
+      },
+      option: {
+        labelWidth: 120,
+        height: "auto",
+        calcHeight: 30,
+        align: "center",
+        headerAlign: "center",
+        lazy: true,
+        tip: false,
+        simplePage: true,
+        searchShow: true,
+        searchMenuSpan: 6,
+        tree: true,
+        border: true,
+        index: true,
+        selection: true,
+        viewBtn: true,
+        menuWidth: 300,
+        dialogType: "drawer",
+        dialogClickModal: false,
+        column: [
+          {
+            label: "名称",
+            prop: "categoryTitle",
+            search: true,
+            align: "left",
+            span: 24,
+            rules: [
+              {
+                required: true,
+                message: "请输入名称",
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "上级类别",
+            prop: "parentId",
+            dicData: [],
+            type: "tree",
+            hide: true,
+            addDisabled: false,
+            props: {
+              label: "title",
+            },
+            rules: [
+              {
+                required: false,
+                message: "请选择上级类别",
+                trigger: "click",
+              },
+            ],
+          },
+          {
+            label: "排序号",
+            prop: "sort",
+            type: "number",
+            width: 120,
+            rules: [
+              {
+                required: true,
+                validator: validateNumber,
+                trigger: "blur",
+              },
+            ],
+          },
+          {
+            label: "是否同步到集团",
+            prop: "isShare",
+            type: "radio",
+            dataType: "number",
+            dicUrl: "/api/galaxy-system/dict/dictionary?code=yes_no",
+            props: {
+              label: "dictValue",
+              value: "dictKey",
+            },
+            width: 150,
+            hide: this.system,
+          },
+          {
+            label: "是否有效",
+            prop: "isValid",
+            type: "radio",
+            dataType: "number",
+            dicUrl: "/api/galaxy-system/dict-biz/dictionary?code=isvalid",
+            props: {
+              label: "dictValue",
+              value: "dictKey",
+            },
+            width: 150,
+          },
+          {
+            label: "备注",
+            prop: "categoryDesc",
+            type: "textarea",
+            span: 24,
+            rules: [
+              {
+                required: false,
+                message: "请输入备注",
+                trigger: "blur",
+              },
+            ],
+            hide: true,
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  computed: {
+    ...mapGetters(["userInfo", "permission"]),
+    system() {
+
+      console.log(this.$store.state.common.system != "JT")
+      return this.$store.state.common.system != "JT";
+    },
+    permissionList() {
+      return {
+        addBtn: this.vaildData(this.permission.docCategory_add, false),
+        viewBtn: this.vaildData(this.permission.docCategory_view, false),
+        delBtn: this.vaildData(this.permission.docCategory_delete, false),
+        editBtn: this.vaildData(this.permission.docCategory_edit, false),
+      };
+    },
+    ids() {
+      let ids = [];
+      this.selectionList.forEach((ele) => {
+        ids.push(ele.id);
+      });
+      return ids.join(",");
+    },
+  },
+  mounted() {
+    // this.editDialog = true;
+  },
+  created() {
+    // if (!this.system) {
+    //   let i = this.option.column.findIndex((e) => {
+    //     return e.label == "是否同步到集团";
+    //   });
+    //   if (i > -1) {
+    //     this.option.column.splice(i, 1);
+    //   }
+    // }
+  },
+  methods: {
+    initData() {
+      getTree().then((res) => {
+        const column = this.findObject(this.option.column, "parentId");
+        column.dicData = res.data.data;
+      });
+    },
+
+    handleAdd(row) {
+      this.parentId = row.id;
+      const column = this.findObject(this.option.column, "parentId");
+      column.value = row.id;
+      column.addDisabled = true;
+      this.$refs.crud.rowAdd();
+    },
+
+    rowSave(row, done, loading) {
+      add(row).then(
+        (res) => {
+          // 获取新增数据的相关字段
+          const data = res.data.data;
+          row.id = data.id;
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.data = [];
+          this.parentId = "";
+          this.refreshChange();
+          // 数据回调进行刷新
+          done(row);
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+
+    rowUpdate(row, index, done, loading) {
+      update(row).then(
+        () => {
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.data = [];
+          this.parentId = "";
+          this.refreshChange();
+          // 数据回调进行刷新
+          done(row);
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+
+    rowDel(row, index, done) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          // 数据回调进行刷新
+          done(row);
+        });
+    },
+
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          // 刷新表格数据并重载
+          this.data = [];
+          this.parentId = 0;
+          this.$refs.crud.refreshTable();
+          this.$refs.crud.toggleSelection();
+          // 表格数据重载
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+
+    searchReset() {
+      this.query = {};
+      this.parentId = 0;
+      this.onLoad(this.page);
+    },
+
+    searchChange(params, done) {
+      this.query = params;
+      this.parentId = "";
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+
+    beforeOpen(done, type) {
+      if (["add"].includes(type)) {
+        this.form.isValid = 2;
+        this.form.isShare = 1;
+      }
+
+      if (["add", "edit"].includes(type)) {
+        this.initData();
+      }
+      if (["edit", "view"].includes(type)) {
+        get(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+
+    beforeClose(done) {
+      this.parentId = "";
+      const column = this.findObject(this.option.column, "parentId");
+      column.value = "";
+      column.addDisabled = false;
+      done();
+    },
+
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getLazyList(this.parentId, Object.assign(params, this.query)).then(
+        (res) => {
+          this.data = res.data.data;
+          this.loading = false;
+          this.selectionClear();
+        }
+      );
+    },
+
+    treeLoad(tree, treeNode, resolve) {
+      const parentId = tree.id;
+      getLazyList(parentId).then((res) => {
+        resolve(res.data.data);
+      });
+    },
+  },
+};
+</script>
+
+<style></style>

+ 232 - 0
src/views/wel/warningInfo.vue

@@ -0,0 +1,232 @@
+<!--
+ * @Title: 
+ * @Description: 
+ * @Author: 893699165@qq.com
+ * @Date: 2022-08-24 10:49:21
+ * @LastEditors: 
+ * @LastEditTime: 2022-08-24 10:49:21
+-->
+<template>
+  <div>
+    <basic-container>
+      <avue-crud
+        :option="option"
+        :table-loading="loading"
+        :data="data"
+        ref="crud"
+        v-model="form"
+        :permission="permissionList"
+        @row-del="rowDel"
+        @row-update="rowUpdate"
+        @row-save="rowSave"
+        @search-change="searchChange"
+        @search-reset="searchReset"
+        @selection-change="selectionChange"
+        @current-change="currentChange"
+        @size-change="sizeChange"
+        @refresh-change="refreshChange"
+        @on-load="onLoad"
+        @before-open="beforeOpen"
+      >
+      </avue-crud>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import { getList, getDetail, add, update } from "@/api/workbench/monitoring";
+import { mapGetters } from "vuex";
+
+export default {
+  data() {
+    return {
+      id: "",
+      editForm: {},
+      editDialog: false,
+      form: {},
+      selectionList: [],
+      query: {},
+      loading: true,
+      page: {
+        pageSize: 5,
+        currentPage: 1,
+        total: 0,
+      },
+
+      option: {
+        labelWidth: 120,
+        viewLabelWidth: 100,
+        searchlabelWidth: 100,
+        height: "auto",
+        calcHeight: 30,
+        align: "center",
+        headerAlign: "center",
+
+        tip: false,
+        simplePage: true,
+        searchShow: true,
+        searchMenuSpan: 6,
+        addBtn: false,
+
+        border: true,
+        index: true,
+        height: 300,
+        editBtn: false,
+        delBtn: false,
+        menuWidth: 220,
+        dialogType: "drawer",
+        menu: false,
+        dialogClickModal: false,
+        column: [
+          {
+            label: "预警信息",
+            prop: "rtuName",
+            search: true,
+            span: 12,
+          },
+          {
+            label: "预警时间",
+            prop: "rtuCode",
+            span: 12,
+            search: true,
+          },
+          {
+            label: "恢复时间",
+            prop: "orgId",
+            span: 12,
+          },
+        ],
+      },
+      data: [],
+    };
+  },
+  prop: {
+    id: ["String"],
+  },
+
+  methods: {
+    init() {
+      this.onLoad(this.page);
+    },
+    rowSave(row, done, loading) {
+      add(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          window.console.log(error);
+          loading();
+        }
+      );
+    },
+    rowDel(row) {
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(row.id);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+        });
+    },
+    searchReset() {
+      this.query = {};
+      this.onLoad(this.page);
+    },
+    searchChange(params, done) {
+      this.query = params;
+      this.page.currentPage = 1;
+      this.onLoad(this.page, params);
+      done();
+    },
+    selectionChange(list) {
+      this.selectionList = list;
+    },
+    selectionClear() {
+      this.selectionList = [];
+      this.$refs.crud.toggleSelection();
+    },
+    handleDelete() {
+      if (this.selectionList.length === 0) {
+        this.$message.warning("请选择至少一条数据");
+        return;
+      }
+      this.$confirm("确定将选择数据删除?", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          return remove(this.ids);
+        })
+        .then(() => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          this.$refs.crud.toggleSelection();
+        });
+    },
+    beforeOpen(done, type) {
+      if (["edit", "view"].includes(type)) {
+        getDetail(this.form.id).then((res) => {
+          this.form = res.data.data;
+        });
+      }
+      done();
+    },
+    currentChange(currentPage) {
+      this.page.currentPage = currentPage;
+    },
+    sizeChange(pageSize) {
+      this.page.pageSize = pageSize;
+    },
+    refreshChange() {
+      this.onLoad(this.page, this.query);
+    },
+    onLoad(page, params = {}) {
+      this.loading = true;
+      getList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query)
+      ).then((res) => {
+        const data = res.data.data;
+        this.page.total = data.total;
+        this.data = data.records;
+        this.loading = false;
+        this.selectionClear();
+      });
+    },
+  },
+};
+</script>

+ 6 - 2
vue.config.js

@@ -22,7 +22,9 @@ module.exports = {
     entry.add('@/mock').end();
   },
   css: {
-    extract: { ignoreOrder: true }
+    extract: {
+      ignoreOrder: true
+    }
   },
   //开发模式反向代理配置,生产模式请使用Nginx部署并配置反向代理
   devServer: {
@@ -30,9 +32,11 @@ module.exports = {
     proxy: {
       '/api': {
         //本地服务接口地址
-        target: 'http://localhost:40004',
+        // target: 'http://localhost:40004',
         //远程演示服务地址,可用于直接启动项目
         // target: 'http://172.1.0.218:40004',
+        target: 'http://111.204.228.227:40004',
+
         ws: true,
         pathRewrite: {
           '^/api': '/'