From 4fb12efd2e19ed835a47112a1eb937eccb80a549 Mon Sep 17 00:00:00 2001
From: spring <2396852758@qq.com>
Date: 星期二, 01 四月 2025 13:31:34 +0800
Subject: [PATCH] 完成标准库变更记录页面

---
 src/views/standard/standardLibrary/audit.vue |  151 +++++++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 135 insertions(+), 16 deletions(-)

diff --git a/src/views/standard/standardLibrary/audit.vue b/src/views/standard/standardLibrary/audit.vue
index 831a4f5..8e8ba20 100644
--- a/src/views/standard/standardLibrary/audit.vue
+++ b/src/views/standard/standardLibrary/audit.vue
@@ -1,34 +1,153 @@
 <template>
   <div class="capacity-scope">
     <div class="search">
-      <div>
-        <el-form :model="queryParams" ref="queryParams" size="small" :inline="true">
-          <el-form-item label="妯℃澘鍚嶇О" prop="name">
-            <el-input v-model="queryParams.name" clearable placeholder="璇疯緭鍏�" size="small"
-              @keyup.enter.native="refreshTable()"></el-input>
-          </el-form-item>
-          <el-form-item>
-            <el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</el-button>
-            <el-button size="mini" @click="refresh">閲嶇疆</el-button>
-          </el-form-item>
-        </el-form>
-      </div>
+      <el-form :model="queryParams" ref="queryParams" size="small" :inline="true">
+        <el-form-item label="鏇存柊浜�" prop="name">
+          <el-input v-model="queryParams.name" clearable placeholder="璇疯緭鍏�" size="small"
+            @keyup.enter.native="refreshTable()"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" size="mini" @click="refreshTable">鏌ヨ</el-button>
+          <el-button size="mini" @click="refresh">閲嶇疆</el-button>
+        </el-form-item>
+      </el-form>
     </div>
+    <lims-table :tableData="tableData" :column="column" :page="page" :tableLoading="tableLoading"
+      :height="'calc(100vh - 250px)'" @pagination="pagination"></lims-table>
   </div>
 </template>
 
 <script>
+import limsTable from "@/components/Table/lims-table.vue";
 export default {
+  components: {
+    limsTable,
+  },
   data() {
     return {
-      queryParams: {}
+      queryParams: {},
+      tableData: [],
+      column: [
+        { label: "鏇存柊鍘熷洜", prop: "number" },
+        { label: "鏇存柊鏃堕棿", prop: "name" },
+        { label: "鏇存柊浜�", prop: "remark" },
+        { label: "鐘舵��", prop: "remark" },
+        {
+          dataType: "action",
+          label: "鎿嶄綔",
+          operation: [
+            {
+              name: "涓婁紶闄勪欢",
+              type: "upload",
+              accept: '.jpg,.jpeg,.png,.gif,.doc,.docx,.xls,.xlsx,.pdf',
+              url: '/insReport/inReport',
+              uploadIdFun: (row) => {
+                return row.id
+              }
+            },
+            {
+              name: "瀹℃壒",
+              type: "text",
+              clickFun: (row) => {
+                this.handleCheck(row);
+              },
+              // showHide: (row) => {
+              //   return this.checkPermi(["standard:model:del"]);
+              // },
+            },
+            {
+              name: "鏌ョ湅",
+              type: "text",
+              clickFun: (row) => {
+                this.handleLook(row);
+              },
+            },
+            {
+              name: "涓嬭浇闄勪欢",
+              type: "text",
+              clickFun: (row) => {
+                this.handleDown(row);
+              },
+            },
+          ],
+        },
+      ],
+      page: {
+        total: 0,
+        size: 10,
+        current: 0,
+      },
+      tableLoading: false,
     }
   },
   methods: {
-    refreshTable() { },
-    refresh() { }
+    getList() {
+      this.tableLoading = true;
+      let param = { ...this.queryParams, ...this.page };
+      delete param.total;
+      selectStandardTemplatePageList({ ...param })
+        .then((res) => {
+          this.tableLoading = false;
+          if (res.code === 200) {
+            this.tableData = res.data.records;
+            this.page.total = res.data.total;
+          }
+        })
+        .catch((err) => {
+          this.tableLoading = false;
+        });
+    },
+    pagination({ page, limit }) {
+      this.page.current = page;
+      this.page.size = limit;
+      this.getList();
+    },
+    refreshTable(e) {
+      this.page.current = 1;
+      this.getList();
+    },
+    refresh() {
+      this.queryParams = {};
+      this.page.current = 1;
+      this.getList();
+    },
+    // 瀹℃牳
+    handleCheck(row) {
+      this.$confirm("鏄惁瀹℃牳閫氳繃?", "瀹℃牳", {
+        confirmButtonText: "閫氳繃",
+        cancelButtonText: "涓嶉�氳繃",
+        type: "warning",
+        closeOnClickModal: false, // 绂佹鐐瑰嚮閬僵灞傚叧闂�
+        distinguishCancelAndClose: true,
+        beforeClose: (action, instance, done) => {
+          if (action === 'confirm') {
+            // 閫氳繃
+            this.refresh();
+          } else if (action === 'cancel') {
+            // 涓嶉�氳繃
+            this.refresh();
+          } else if (action === 'close') {
+            // 鐐瑰嚮鈥溍椻�濇寜閽紝涓嶅厑璁稿叧闂�
+            done();
+            console.log("脳鎸夐挳鐐瑰嚮浜嬩欢锛屼笉鍏抽棴寮规");
+          }
+        }
+      })
+    },
+    // 鏌ョ湅
+    handleLook(row) { },
+    // 涓嬭浇闄勪欢
+    handleDown(row) {
+      this.$download.saveAs(row.fileUrl, row.fileName);
+    },
   }
 }
 </script>
 
-<style scoped></style>
\ No newline at end of file
+<style scoped>
+.search {
+  height: 46px;
+  display: flex;
+  justify-content: space-between;
+}
+</style>
\ No newline at end of file

--
Gitblit v1.9.3