|
@@ -30,12 +30,6 @@
|
|
|
</a-button>
|
|
|
</a-upload>
|
|
|
</a-form-item>
|
|
|
- <a-form-item label="下载模板">
|
|
|
- <a-button :loading="downLoading" @click="downloadTpl">
|
|
|
- <template #icon> <svg-icon name="download"></svg-icon> </template>
|
|
|
- 下载模板
|
|
|
- </a-button>
|
|
|
- </a-form-item>
|
|
|
</a-form>
|
|
|
</a-modal>
|
|
|
</template>
|
|
@@ -46,7 +40,6 @@ import {
|
|
|
exportProjectCollege,
|
|
|
importProjectCollege,
|
|
|
} from "@/api/projectParamsManagementPage";
|
|
|
-import { downloadFileURL } from "@/utils/utils";
|
|
|
import { h } from "vue";
|
|
|
import { message } from "ant-design-vue";
|
|
|
import type { UploadProps } from "ant-design-vue";
|
|
@@ -104,7 +97,7 @@ async function handleImport() {
|
|
|
/* download */
|
|
|
const { loading: exportLoading, setLoading: setExportLoading } = useLoading();
|
|
|
async function toExport() {
|
|
|
- if (downLoading.value) return;
|
|
|
+ if (exportLoading.value) return;
|
|
|
setExportLoading(true);
|
|
|
let err = false;
|
|
|
await exportProjectCollege(props.projectId).catch(() => {
|
|
@@ -115,20 +108,4 @@ async function toExport() {
|
|
|
|
|
|
message.success("导出成功!");
|
|
|
}
|
|
|
-
|
|
|
-const { loading: downLoading, setLoading: setDownLoading } = useLoading();
|
|
|
-async function downloadTpl() {
|
|
|
- if (downLoading.value) return;
|
|
|
- setDownLoading(true);
|
|
|
- let err = false;
|
|
|
- await downloadFileURL("/api/ess/projectCourse/college/template", {
|
|
|
- projectId: props.projectId,
|
|
|
- }).catch(() => {
|
|
|
- err = true;
|
|
|
- });
|
|
|
- setDownLoading(false);
|
|
|
- if (err) return;
|
|
|
-
|
|
|
- message.success("下载成功!");
|
|
|
-}
|
|
|
</script>
|