zcy 3 éve
szülő
commit
9d0c053730
2 módosított fájl, 21 hozzáadás és 10 törlés
  1. 3 3
      src/router/index.js
  2. 18 7
      src/views/security/stand/index.vue

+ 3 - 3
src/router/index.js

@@ -98,7 +98,7 @@ export const constantRoutes = [
   {
     path: '/security',
     component: Layout,
-    redirect: '/security/stand',
+    redirect: '/security/seStand',
     name: 'security',
     meta: {
       title: '安全工具管理',
@@ -106,9 +106,9 @@ export const constantRoutes = [
     },
     children: [
       {
-        path: 'stand',
+        path: 'seStand',
         component: () => import('@/views/security/stand/index'),
-        name: 'stand',
+        name: 'seStand',
         meta: { title: '安全工具台账', icon: 'el-icon-collection-tag' }
       },
       {

+ 18 - 7
src/views/security/stand/index.vue

@@ -60,20 +60,21 @@
     <div class="table-operator" style="margin: 15px 0">
       <a-button type="primary" icon="plus" @click="handleAdd">新增</a-button>
       <a-button ghost type="danger" @click="handleExportXls()">导出数据(含报废)</a-button>
-      <a-button ghost type="danger" @click="handleExportCode()">批量导出二维码</a-button>
-      <a-dropdown v-if="selectedRowKeys.length > 0">
+
+      <a-dropdown type="danger">
         <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel">
-            <a-icon type="delete" />
-            删除
+          <a-menu-item key="0" @click="handleExportCode()">
+            导出选中
+          </a-menu-item>
+          <a-menu-item key="1" @click="handleExportCodeAll()">
+            导出全部
           </a-menu-item>
         </a-menu>
         <a-button style="margin-left: 8px">
-          批量操作
+          批量导出二维码
           <a-icon type="down" />
         </a-button>
       </a-dropdown>
-
       <a-dropdown v-if="selectedRowKeys.length > 0">
         <a-menu slot="overlay">
           <a-menu-item key="1" @click="batchDel">
@@ -159,6 +160,7 @@ export default {
         delete: '/business/safetool/base/safety/tool/',
         exportXlsUrl: '/business/safetool/base/safety/tool/export',
         qrcode: '/st/export',
+        qrcodeAll: '/st/exportAll',
         tree: '/system/dept/treeSelect',
         importExcelUrl: `${process.env.VUE_APP_BASE_API}/importExcelUrl`
       }
@@ -200,6 +202,15 @@ export default {
           window.location.href = data.url
         }
       })
+    },
+    handleExportCodeAll() {
+      downFile(this.url.qrcodeAll).then((data) => {
+        if (data.code !== 200) {
+          this.$message.warning('文件下载失败')
+        } else {
+          window.location.href = data.url
+        }
+      })
     }
   }
 }