-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f30912e
commit 65cef0b
Showing
3 changed files
with
85 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
export const getCode = (templateID) => { | ||
return `<template> | ||
<!-- 导出组件 --> | ||
<ExportExcel templateId="${templateID}" :condition="condition" :limit="limit" :offset="offset" :order="order" /> | ||
<!-- 导入组件 handleSuccess为导入成功后的回调函数 --> | ||
<ImportExcel templateId="${templateID}" @on-success="handleSuccess" /> | ||
<!-- 导出模板 --> | ||
<ExportTemplate templateId="${templateID}" /> | ||
</template> | ||
<script setup> | ||
import { ref } from 'vue'; | ||
// 导出组件 | ||
import ExportExcel from '@/components/exportExcel/exportExcel.vue'; | ||
// 导入组件 | ||
import ImportExcel from '@/components/exportExcel/importExcel.vue'; | ||
// 导出模板组件 | ||
import ExportTemplate from '@/components/exportExcel/exportTemplate.vue'; | ||
const condition = ref({}); // 查询条件 | ||
const limit = ref(10); // 最大条数限制 | ||
const offset = ref(0); // 偏移量 | ||
const order = ref('id desc'); // 排序条件 | ||
const handleSuccess = (res) => { | ||
console.log(res); | ||
// 导入成功的回调函数 | ||
}; | ||
</script>` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters