Browse Source

新增知识管理模块面面

chenminghua 3 years ago
parent
commit
b42419513d

+ 17 - 2
src/router/index.js

@@ -214,14 +214,29 @@ const routes = [
     component: () => import('../views/windAnalysis/index.vue'),
   },
   {
-    path: '/knowledge',
+    path: '/knowledge',   //故障知识列表
     name: 'knowledge1',
     component: () => import('../views/Knowledge/Knowledge1.vue'),
   },  
   {
-    path: '/knowledge2',
+    path: '/knowledge2',  //安全措施知识
     name: 'knowledge2',
     component: () => import('../views/Knowledge/Knowledge2.vue'),
+  },
+  {
+    path: '/knowledge3',   //风险辨识知识
+    name: 'knowledge3',
+    component: () => import('../views/Knowledge/Knowledge3.vue'),
+  },
+  {
+    path: '/knowledge4',   //作业指导知识
+    name: 'knowledge4',
+    component: () => import('../views/Knowledge/Knowledge4.vue'),
+  },
+  {
+    path: '/knowledge5',   //特征参数
+    name: 'knowledge5',
+    component: () => import('../views/Knowledge/Knowledge5.vue'),
   }
 ]
 

+ 135 - 0
src/views/Knowledge/Knowledge3.vue

@@ -0,0 +1,135 @@
+<template>
+  <div class="knowledge-2">
+    <div class="query mg-b-8">
+      <div class="query-items">
+        <div class="query-item">
+          <div class="lable">查询内容:</div>
+          <div class="search-input">
+            <el-input v-model="content" placeholder="请输入查询内容"></el-input>
+          </div>
+        </div>
+      </div>
+      <div class="query-actions" style="margin-right: 1500px">
+        <button class="btn green" @click="onClickSearch">搜索</button>
+      </div>
+    </div>
+    <div>
+      <ComTable :data="tableData"></ComTable>
+    </div>
+  </div>
+</template>
+
+<script>
+import ComTable from "@com/coms/table/table.vue";
+
+export default {
+  components: { ComTable },
+  data() {
+    return {
+      content: "",
+      tableData: {
+        column: [
+          {
+            name: "序号",
+            field: "id",
+            is_num: true,
+            is_light: false,
+          },
+          {
+            name: "按错内容",
+            field: "safecontent",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "故障按错内容描述",
+            field: "describe",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "负责人",
+            field: "principal",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "添加时间",
+            field: "addtime",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "类型",
+            field: "type",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "其他",
+            field: "other",
+            is_num: false,
+            is_light: false,
+          },
+        ],
+        data: [],
+      },
+    };
+  },
+  created() {
+    this.requestSafeList();
+  },
+  methods: {
+    // 搜索按钮
+    onClickSearch() {
+      this.requestSafeList();
+    },
+    // 获取按错内容
+    requestSafeList() {
+      let that = this;
+      this.API.requestData({
+        method: "GET",
+        baseURL: "http://10.155.32.4:8034/",
+        subUrl: "/experienceBase/aqcszs",
+        data: {
+          name: that.content,
+          pageNum: 1,
+          pageSize: 1000,
+        }, // 请求所携带参数,默认为空,可缺省
+        success(res) {
+          if (res.code == 200) {
+            that.tableData.data = [];
+            let data = res.data;
+            for (var i = 0; i < data.length; i++) {
+              let obj = {
+                id: i + 1,
+                safecontent: data[i].safecontent,
+                describe: data[i].describe,
+                principal: data[i].principal,
+                addtime: new Date(data[i].addtime).formatDate("yyyy-MM-dd"),
+                type: data[i].type,
+                other: data[i].other,
+              };
+              that.tableData.data.push(obj);
+            }
+          }
+        },
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scope>
+@titleGray: #9ca5a8;
+@rowGray: #606769;
+@darkBack: #536268;
+.knowledge-2 {
+  .el-select {
+    width: 200px;
+  }
+  .el-input {
+    width: 200px;
+  }
+}
+</style>

+ 129 - 0
src/views/Knowledge/Knowledge4.vue

@@ -0,0 +1,129 @@
+<template>
+  <div class="knowledge-2">
+    <div class="query mg-b-8">
+      <div class="query-items">
+        <div class="query-item">
+          <div class="lable">查询内容:</div>
+          <div class="search-input">
+            <el-input v-model="content" placeholder="请输入查询内容"></el-input>
+          </div>
+        </div>
+      </div>
+      <div class="query-actions" style="margin-right: 1500px">
+        <button class="btn green" @click="onClickSearch">搜索</button>
+      </div>
+    </div>
+    <div>
+      <ComTable :data="tableData"></ComTable>
+    </div>
+  </div>
+</template>
+
+<script>
+import ComTable from "@com/coms/table/table.vue";
+
+export default {
+  components: { ComTable },
+  data() {
+    return {
+      content: "",
+      tableData: {
+        column: [
+          {
+            name: "所属类型",
+            field: "station",
+            is_num: true,
+            is_light: false,
+          },
+          {
+            name: "位置",
+            field: "location",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "工作内容",
+            field: "content",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "描述",
+            field: "describe",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "添加时间",
+            field: "addtime",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "状态",
+            field: "state",
+            is_num: false,
+            is_light: false,
+          },
+        ],
+        data: [],
+      },
+    };
+  },
+  created() {
+    this.requestSafeList();
+  },
+  methods: {
+    // 搜索按钮
+    onClickSearch() {
+      this.requestSafeList();
+    },
+    // 获取按错内容
+    requestSafeList() {
+      let that = this;
+      this.API.requestData({
+        method: "GET",
+        baseURL: "http://10.155.32.4:8034/",
+        subUrl: "/experienceBase/zyzdzs",
+        data: {
+          name: that.content,
+          pageNum: 1,
+          pageSize: 1000,
+        }, // 请求所携带参数,默认为空,可缺省
+        success(res) {
+          if (res.code == 200) {
+            that.tableData.data = [];
+          //   let data = res.data;
+          //   for (var i = 0; i < data.length; i++) {
+          //     let obj = {
+          //       id: i + 1,
+          //       safecontent: data[i].safecontent,
+          //       describe: data[i].describe,
+          //       principal: data[i].principal,
+          //       addtime: new Date(data[i].addtime).formatDate("yyyy-MM-dd"),
+          //       type: data[i].type,
+          //       other: data[i].other,
+          //     };
+              that.tableData.data = res.data;
+          //   }
+          }
+        },
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scope>
+@titleGray: #9ca5a8;
+@rowGray: #606769;
+@darkBack: #536268;
+.knowledge-2 {
+  .el-select {
+    width: 200px;
+  }
+  .el-input {
+    width: 200px;
+  }
+}
+</style>

+ 162 - 0
src/views/Knowledge/Knowledge5.vue

@@ -0,0 +1,162 @@
+<template>
+  <div class="knowledge-2">
+    <div class="query mg-b-8">
+      <div class="query-items">
+        <div class="query-item">
+          <div class="lable">查询内容:</div>
+          <div class="search-input">
+            <el-input v-model="content" placeholder="请输入查询内容"></el-input>
+          </div>
+        </div>
+      </div>
+      <div class="query-actions" style="margin-right: 1500px">
+        <button class="btn green" @click="onClickSearch">搜索</button>
+      </div>
+    </div>
+    <div>
+      <ComTable :data="tableData"></ComTable>
+    </div>
+  </div>
+</template>
+
+<script>
+import ComTable from "@com/coms/table/table.vue";
+
+export default {
+  components: { ComTable },
+  data() {
+    return {
+      content: "",
+      tableData: {
+        column: [
+          {
+            name: "设备类型",
+            field: "modelid",
+            is_num: true,
+            is_light: false,
+          },
+          {
+            name: "特征名称",
+            field: "name",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "特征描述",
+            field: "description",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "设备结构",
+            field: "structureid",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "设备结构组成",
+            field: "componentid",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "测点统一编码",
+            field: "uniformcode",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "最小值",
+            field: "minvalue",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "最大值",
+            field: "maxvalue",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "正常范围下限",
+            field: "normalmin",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "正常范围上限",
+            field: "normalmax",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "预警值",
+            field: "prealertvalue",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "报警值",
+            field: "alertvalue",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "是否启用",
+            field: "enable",
+            is_num: false,
+            is_light: false,
+          },
+        ],
+        data: [],
+      },
+    };
+  },
+  created() {
+    this.requestSafeList();
+  },
+  methods: {
+    // 搜索按钮
+    onClickSearch() {
+      this.requestSafeList();
+    },
+    // 获取按错内容
+    requestSafeList() {
+      let that = this;
+      this.API.requestData({
+        method: "GET",
+        baseURL: "http://10.155.32.4:8034/",
+        subUrl: "/experienceBase/tzcs",
+        data: {
+          name: that.content,
+          pageNum: 1,
+          pageSize: 1000,
+        }, // 请求所携带参数,默认为空,可缺省
+        success(res) {
+          if (res.code == 200) {
+            that.tableData.data = [];
+            res.data.forEach((item) => {
+              item.enable = item.enable == 0 ? "启用" : "停止";
+              that.tableData.data.push(item);
+            });
+          }
+        },
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scope>
+@titleGray: #9ca5a8;
+@rowGray: #606769;
+@darkBack: #536268;
+.knowledge-2 {
+  .el-select {
+    width: 200px;
+  }
+  .el-input {
+    width: 200px;
+  }
+}
+</style>

+ 15 - 0
src/views/layout/Menu.vue

@@ -255,6 +255,21 @@ export default {
               icon: "svg-matrix",
               path: "/knowledge2",
             },
+            {
+              text: "风险辨识知识",
+              icon: "svg-matrix",
+              path: "/knowledge3",
+            },
+            {
+              text: "作业指导知识",
+              icon: "svg-matrix",
+              path: "/knowledge4",
+            },
+            {
+              text: "特征参数",
+              icon: "svg-matrix",
+              path: "/knowledge5",
+            },
           ],
         },
         {