zs 3 月之前
父節點
當前提交
8f16bc305f
共有 2 個文件被更改,包括 9 次插入8 次删除
  1. 5 0
      src/store/api/platform/matchReg.js
  2. 4 8
      src/views/center/parts/preliminaryMatch.vue

+ 5 - 0
src/store/api/platform/matchReg.js

@@ -30,11 +30,16 @@ export const MatchRegStore = defineStore('matchReg', () => {
     const res = await axios.$delete(`${url}/${payload}`)
     return res
   }
+  const exportReg = async (payload) => {
+    const res = await axios.$get(`${url}/export/${payload}`)
+    return res
+  }
   return {
     query,
     fetch,
     create,
     update,
+    exportReg,
     del
   }
 })

+ 4 - 8
src/views/center/parts/preliminaryMatch.vue

@@ -172,14 +172,10 @@ const handleRowSelectable = (row) => {
   return row.status == '1'
 }
 // 导出
-const toExport = () => {
-  if (selectionList.value && selectionList.value.length > 0) {
-    console.log('导出')
-  } else {
-    ElMessage({
-      message: '请选择要导出的数据!',
-      type: 'warning'
-    })
+const toExport = async () => {
+  const res = await store.exportReg(id.value)
+  if ($checkRes(res, true)) {
+    window.open(res.data)
   }
 }
 const toClose = async () => {