Merge remote-tracking branch 'origin/main'

This commit is contained in:
2026-08-26 18:08:17 +08:00
2 changed files with 21 additions and 1 deletions
@@ -49,6 +49,9 @@
<el-col :span="1.5">
<el-button type="info" plain icon="el-icon-upload2" size="mini" @click="openImport">导入</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleDownloadTemplate">模板下载</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@@ -149,8 +152,9 @@
</template>
<script>
import { listOffice, addOffice, updateOffice, disableOffice } from "@/api/teachOffice/office"
import { listOffice, addOffice, updateOffice, disableOffice, downloadOfficeTemplate } from "@/api/teachOffice/office"
import { getToken } from '@/utils/auth'
import { saveAs } from 'file-saver'
export default {
name: "Office",
@@ -339,6 +343,13 @@ export default {
/** 导入失败 */
handleImportError() {
this.$modal.msgError('导入失败,请稍后重试')
},
/** 下载导入模板 */
handleDownloadTemplate() {
downloadOfficeTemplate().then(blob => {
saveAs(blob, '教研室导入模板.xlsx')
this.$modal.msgSuccess('模板下载成功')
}).catch(() => {})
}
}
}