Просмотр исходного кода

feat(题目管理): 添加下载Excel模板功能

tanshanming 6 месяцев назад
Родитель
Сommit
a7bc13dfe6
1 измененных файлов с 5 добавлено и 0 удалено
  1. 5 0
      src/views/exm/question/index.vue

+ 5 - 0
src/views/exm/question/index.vue

@@ -56,6 +56,7 @@
 				<a-upload :customRequest="handleImportExcel" :showUploadList="false" accept=".xlsx,.xls" class="link-left">
 				<a-upload :customRequest="handleImportExcel" :showUploadList="false" accept=".xlsx,.xls" class="link-left">
 					<a-button type="primary">导入Excel</a-button>
 					<a-button type="primary">导入Excel</a-button>
 				</a-upload>
 				</a-upload>
+				<a-button type="primary" class="link-left" @click="downloadTemplate">下载模板</a-button>
 			</a-form-item>
 			</a-form-item>
 		</a-form>
 		</a-form>
 		<a-table
 		<a-table
@@ -165,6 +166,7 @@
 	import { StarFilled, StarOutlined } from '@ant-design/icons-vue'
 	import { StarFilled, StarOutlined } from '@ant-design/icons-vue'
 	import { Modal, message } from 'ant-design-vue'
 	import { Modal, message } from 'ant-design-vue'
 	import { parseTime } from '@/utils/exam'
 	import { parseTime } from '@/utils/exam'
+	import config from '@/config'
 	const bankTypeEnum = computed(() => examStore.getBankTypeEnum)
 	const bankTypeEnum = computed(() => examStore.getBankTypeEnum)
 	const examStore = useExamStore()
 	const examStore = useExamStore()
 
 
@@ -338,6 +340,9 @@
 		// 	console.error('检查失败:', error)
 		// 	console.error('检查失败:', error)
 		// })
 		// })
 	}
 	}
+	const downloadTemplate = () => {
+		window.open(`${config.API_URL}/api/webapp/dev/file/download?id=1955542101022437377`)
+	}
 </script>
 </script>
 
 
 <style lang="less" scoped>
 <style lang="less" scoped>