Преглед изворни кода

feat: 新增导出按钮组件并优化交互逻辑

yusheng пре 1 месец
родитељ
комит
6221604195

+ 3 - 0
src/components/MaterialAdd.vue

@@ -228,6 +228,9 @@
 
       // 单击获取id
       cellClick(row) {
+        if (row.isBindMainDevice) {
+          return;
+        }
         this.current = row;
         this.radio = row.id;
       },

+ 45 - 0
src/components/upload/exportButton.vue

@@ -0,0 +1,45 @@
+<template>
+  <el-button
+    type="primary"
+    size="small"
+    icon="el-icon-download"
+    @click="exportFn"
+    >{{btnName}}</el-button
+  >
+</template>
+
+<script>
+  import { exportTable } from '@/api/system/file/index.js';
+  export default {
+    props: {
+      btnName: {
+        type: String,
+        default: '导出'
+      },
+      apiUrl: '',
+      fileName: '',
+      params: {
+        default: () => {
+          return {};
+        }
+      }
+    },
+    //注册组件
+    data() {
+      return {};
+    },
+
+    created() {},
+    methods: {
+      exportFn() {
+        exportTable({
+          api: this.apiUrl,
+          fileName: this.fileName,
+          data:this.params
+        });
+      }
+    }
+  };
+</script>
+
+<style lang="scss"></style>

+ 1 - 1
src/views/ledgerAssets/equipment/components/BOM-search.vue

@@ -90,7 +90,7 @@
         code: '',
         categoryCode: this.categoryCode,
         categoryName: '',
-        status: '1',
+        // status: '1',
 
       };
       return {