Jelajahi Sumber

新增知识管理

chenminghua 3 tahun lalu
induk
melakukan
10099f7b53

+ 10 - 0
src/router/index.js

@@ -203,6 +203,16 @@ const routes = [
     name: 'health8',
     component: () => import(/* webpackChunkName: "health8" */  '../views/HealthControl/Health8.vue'),
   },
+  {
+    path: '/knowledge',
+    name: 'knowledge1',
+    component: () => import('../views/Knowledge/Knowledge1.vue'),
+  },  
+  {
+    path: '/knowledge2',
+    name: 'knowledge2',
+    component: () => import('../views/Knowledge/Knowledge2.vue'),
+  }
 ]
 
 const router = createRouter({

+ 208 - 0
src/views/Knowledge/Knowledge1.vue

@@ -0,0 +1,208 @@
+<template>
+  <div class="knowledge-1">
+    <div class="query mg-b-8">
+      <div class="query-items">
+        <div class="query-item">
+          <div class="lable">故障等级:</div>
+          <div class="search-input">
+            <el-select
+              v-model="level"
+              clearable
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in faultLevels"
+                :key="item"
+                :label="item"
+                :value="item"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="query-item">
+          <div class="lable">停机类型:</div>
+          <div class="search-input">
+            <el-select
+              v-model="type"
+              placeholder="请选择"
+              popper-class="select"
+            >
+              <el-option
+                v-for="item in downTypes"
+                :key="item"
+                :label="item"
+                :value="item"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <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: 800px">
+        <button class="btn green" @click="onClickSearch">搜索</button>
+      </div>
+    </div>
+    <div class="table-box">
+      <ComTable :data="tableData" height="85vh"></ComTable>
+    </div>
+    <div class="dialog-box">
+      <el-dialog
+        title="详细信息"
+        v-model="dialogVisible"
+        custom-class="modal"
+        :close-on-click-modal="false"
+      >
+        <know-info :data="infoData"></know-info>
+      </el-dialog>
+    </div>
+  </div>
+</template>
+
+<script>
+import ComTable from "@com/coms/table/table.vue";
+import KnowInfo from "./knowinfo.vue";
+
+export default {
+  components: { ComTable, KnowInfo },
+  data() {
+    const that = this;
+    return {
+      faultLevels: ["1级", "2级", "3级", "4级", "5级"], // 故障等级
+      downTypes: ["正常停机", "快速停机", "紧急停机"], // 停机类型
+      level: "",
+      type: "",
+      content: "",
+      tableData: {
+        column: [
+          {
+            name: "故障编码",
+            field: "code",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "故障名称",
+            field: "name",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "故障类别",
+            field: "category",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "故障级别",
+            field: "faultlevel",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "停机类型",
+            field: "halttype",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "设备类型",
+            field: "devicemodel",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "故障标识",
+            field: "faultid",
+            is_num: false,
+            is_light: false,
+          },
+          {
+            name: "操作",
+            field: "",
+            is_num: false,
+            is_light: false,
+            template() {
+              return "<el-button type='text' style='cursor: pointer;'>详细信息</el-button>";
+            },
+            click(e, row) {
+              that.getInformation(row);
+            },
+          },
+        ],
+        data: [],
+      },
+      infoData: "",
+      dialogVisible: false,
+    };
+  },
+  created() {
+    this.level = this.faultLevels[0];
+    this.type = this.downTypes[0];
+    this.requestInfoList();
+  },
+  methods: {
+    // 搜索按钮
+    onClickSearch() {
+      this.requestInfoList();
+    },
+    // 查看详细信息
+    getInformation(item) {
+      this.dialogVisible = true;
+      this.infoData = item;
+    },
+    // 获取故障知识列表
+    requestInfoList() {
+      let that = this;
+      this.API.requestData({
+        method: "GET",
+        baseURL: "http://10.155.32.4:8034/",
+        subUrl: "/experienceBase/gzzs",
+        data: {
+          gzjb: that.level.substring(0, 1),
+          tjlx: that.type,
+          cxnr: that.content,
+          pageNum: 1,
+          pageSize: 1000,
+        }, // 请求所携带参数,默认为空,可缺省
+        success(res) {
+          if (res.code == 200) {
+            that.tableData.data = res.data;
+          }
+        },
+      });
+    },
+  },
+};
+</script>
+
+<style lang="less" scope>
+@titleGray: #9ca5a8;
+@rowGray: #606769;
+@darkBack: #536268;
+.knowledge-1 {
+  .el-select {
+    width: 200px;
+  }
+  .el-input {
+    width: 200px;
+  }
+  .dialog-box {
+    height: 100%;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+  }
+  .el-dialog {
+    min-width: 500px;
+    min-height: 500px;
+  }
+}
+</style>

+ 135 - 0
src/views/Knowledge/Knowledge2.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>

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


+ 79 - 0
src/views/Knowledge/knowinfo.vue

@@ -0,0 +1,79 @@
+<template>
+  <div class="know-info">
+    <table class="table-card">
+      <tr>
+        <th>故障代码</th>
+        <td>{{ infoObj.code }}</td>
+        <th>故障标识</th>
+        <td>{{ infoObj.faultid }}</td>
+      </tr>
+      <tr>
+        <th>停机类型</th>
+        <td>{{ infoObj.halttype }}</td>
+        <th>故障名称</th>
+        <td>{{ infoObj.name }}</td>
+      </tr>
+      <tr>
+        <th>故障原因</th>
+        <td colspan="3">{{ infoObj.cause }}</td>
+      </tr>
+      <tr>
+        <th>处理方法</th>
+        <td colspan="3">{{ infoObj.treatmentmeasure }}</td>
+      </tr>
+    </table>
+  </div>
+</template>
+
+<script>
+export default {
+  name: "know-info",
+  props: {
+    data: Object,
+  },
+  data() {
+    return {
+      infoObj: "",
+    };
+  },
+
+  mounted() {
+    this.infoObj = this.data;
+  },
+
+  watch: {
+    data(value) {
+      this.infoObj = value;
+      console.log(value);
+    },
+  },
+};
+</script>
+
+
+<style lang="less" scoped>
+.know-info {
+  .table-card {
+    border-collapse: collapse;
+    width: 100%;
+    color: @white;
+
+    tr {
+      font-size: 12px;
+      th {
+        width: 120px;
+        height: 60px;
+        border: 0.093vh solid @darkgray;
+        line-height: 27px;
+        padding: 0 4px;
+      }
+      td {
+        height: 60px;
+        border: 0.093vh solid @darkgray;
+        line-height: 27px;
+        padding: 0 4px;
+      }
+    }
+  }
+}
+</style>

+ 0 - 103
src/views/Login/Login.vue

@@ -1,103 +0,0 @@
-<template>
-  <div class="login-container">
-    <div class="login-box">
-      <!-- 登录表单区域 -->
-      <div class="login-form">
-        <!-- 用户名 -->
-        <div class="login-item">
-          <el-input v-model="username" placeholder="用户名"></el-input>
-        </div>
-        <!-- 密码 -->
-        <div class="login-item">
-          <el-input
-            v-model="password"
-            placeholder="密码"
-            show-password
-          ></el-input>
-        </div>
-        <!-- 登录按钮 -->
-        <div class="login-item">
-          <el-button class="mt" type="primary" @click="onClickLogin"
-            >登录</el-button
-          >
-        </div>
-      </div>
-    </div>
-  </div>
-</template>
-<script>
-import tool from '@tools/basicTool.js';
-
-export default {
-  data() {
-    return {
-      username: "admin",
-      password: "admin",
-    };
-  },
-
-  created() {},
-
-  methods: {
-    //登录按钮
-    onClickLogin() {
-      this.requestLogin();
-    },
-    requestLogin() {
-      let that = this;
-      that.API.requestData({
-        method: "POST", // 请求方式,默认为 GET ,可缺省
-        subUrl: "admin/loginvue", // 请求接口地址,必传项
-        data: {
-          username: that.username,
-          password: that.password,
-        },
-        success(res) {
-          if (res.code == 200) {
-            localStorage.setItem("authToken", res.data.authToken);
-            localStorage.setItem("username", res.data.user.laborName);
-            that.BASE.showMsg({
-              msg: "登录成功",
-              type: "success",
-            });
-            that.$store.commit('setToken', res.data.authToken)
-            that.$router.replace("/"); // 跳转到首页
-            tool.requestFullscreen()
-          } else {
-            that.BASE.showMsg({
-              msg: "用户名或密码错误",
-              type: "success",
-            });
-          }
-        },
-      });
-    },
-  },
-};
-</script>
-<style scoped>
-.login-container {
-  height: 100%;
-  display: flex;
-  justify-content: center;
-  align-items: center;
-}
-.login-box {
-  width: 300px;
-  height: 350px;
-  background-color: #122c1dea;
-  border-radius: 5px;
-}
-.login-form {
-  padding: 50px 40px;
-}
-.login-item {
-  margin-top: 20px;
-}
-.el-button {
-  width: 100%;
-}
-.mt {
-  margin-top: 40px;
-}
-</style>

+ 12 - 1
src/views/layout/Menu.vue

@@ -227,7 +227,18 @@ export default {
         {
           id: "knowledge",
           text: "知识管理",
-          data: [],
+          data: [
+            {
+              text: "故障知识列表",
+              icon: "svg-matrix",
+              path: "/knowledge",
+            },
+            {
+              text: "安全措施知识",
+              icon: "svg-matrix",
+              path: "/knowledge2",
+            },
+          ],
         },
         {
           id: "report",