|
|
@@ -0,0 +1,63 @@
|
|
|
+<template>
|
|
|
+ <div class="data-resend-page">
|
|
|
+ <a-card :bordered="false">
|
|
|
+ <a-row :gutter="[12, 12]" align="middle">
|
|
|
+ <a-col :xs="24" :md="8">
|
|
|
+ <StationSelector v-model:value="stationCode" :options="stationOptions" :multiple="false" />
|
|
|
+ </a-col>
|
|
|
+ <a-col :xs="24" :md="8">
|
|
|
+ <a-space>
|
|
|
+ <a-button type="primary" :loading="resending" :disabled="!stationCode" @click="handleResend">补传</a-button>
|
|
|
+ </a-space>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </a-card>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup name="DataResend">
|
|
|
+import {onMounted, ref} from 'vue';
|
|
|
+import {message} from 'ant-design-vue';
|
|
|
+import {listStation} from '@/api/config/station';
|
|
|
+import {reUpload} from '@/api/fileupload/reportLog';
|
|
|
+import StationSelector from '../components/StationSelector.vue';
|
|
|
+
|
|
|
+const resending = ref(false);
|
|
|
+const stationOptions = ref([]);
|
|
|
+const stationCode = ref(undefined);
|
|
|
+
|
|
|
+const loadStationOptions = async () => {
|
|
|
+ const res = await listStation({pageNum: 1, pageSize: 500});
|
|
|
+ const list = (res && res.rows) || [];
|
|
|
+ stationOptions.value = list.map((item) => ({label: item.stationName, value: item.stationCode}));
|
|
|
+ if (!stationCode.value && stationOptions.value.length) {
|
|
|
+ stationCode.value = stationOptions.value[0].value;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+const handleResend = async () => {
|
|
|
+ if (!stationCode.value) {
|
|
|
+ message.warning('请先选择场站');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ resending.value = true;
|
|
|
+ try {
|
|
|
+ const res = await reUpload(stationCode.value);
|
|
|
+ message.success(res.msg || '补传完成');
|
|
|
+ } catch (e) {
|
|
|
+ // request.js 已统一提示错误
|
|
|
+ } finally {
|
|
|
+ resending.value = false;
|
|
|
+ }
|
|
|
+};
|
|
|
+
|
|
|
+onMounted(async () => {
|
|
|
+ await loadStationOptions();
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.data-resend-page {
|
|
|
+ padding: 16px;
|
|
|
+}
|
|
|
+</style>
|