|
@@ -10,13 +10,13 @@
|
|
</template>
|
|
</template>
|
|
<template #extra>
|
|
<template #extra>
|
|
<HcTooltip keys="write_weather_print">
|
|
<HcTooltip keys="write_weather_print">
|
|
- <el-button hc-btn>
|
|
|
|
|
|
+ <el-button hc-btn :loading="printLoading" @click="batchPrint">
|
|
<HcIcon name="printer"/>
|
|
<HcIcon name="printer"/>
|
|
<span>打印</span>
|
|
<span>打印</span>
|
|
</el-button>
|
|
</el-button>
|
|
</HcTooltip>
|
|
</HcTooltip>
|
|
</template>
|
|
</template>
|
|
- <HcTable :column="tableWeatherColumn" :datas="tableWeatherData" :loading="tableWeatherLoading">
|
|
|
|
|
|
+ <HcTable :column="tableWeatherColumn" :datas="tableWeatherData" :loading="tableWeatherLoading" isCheck @selection-change="tableWeatherSelection">
|
|
<template #tempLow="{row}">{{ row['tempLow'] }} ~ {{ row['tempHigh'] }}</template>
|
|
<template #tempLow="{row}">{{ row['tempLow'] }} ~ {{ row['tempHigh'] }}</template>
|
|
<template #action="{row}">
|
|
<template #action="{row}">
|
|
<HcTooltip keys="write_weather_edit">
|
|
<HcTooltip keys="write_weather_edit">
|
|
@@ -72,6 +72,7 @@
|
|
import {ref, nextTick} from "vue";
|
|
import {ref, nextTick} from "vue";
|
|
import {deepClone, formValidate, getArrValue} from "vue-utils-plus"
|
|
import {deepClone, formValidate, getArrValue} from "vue-utils-plus"
|
|
import weatherApi from '~api/ledger/weather';
|
|
import weatherApi from '~api/ledger/weather';
|
|
|
|
+import queryApi from '~api/data-fill/query';
|
|
|
|
|
|
//参数
|
|
//参数
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
@@ -231,4 +232,32 @@ const saveWeatherClick = async () => {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+//多选
|
|
|
|
+const tableweatherKeys = ref([]);
|
|
|
|
+const tableWeatherSelection = (rows) => {
|
|
|
|
+ tableweatherKeys.value = rows.filter((item) => {
|
|
|
|
+ return (item??'') !== '';
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+//拼接ID
|
|
|
|
+const rowsToId = (rows) => {
|
|
|
|
+ return rows.map((obj) => {
|
|
|
|
+ return obj.id;
|
|
|
|
+ }).join(",")
|
|
|
|
+}
|
|
|
|
+//打印
|
|
|
|
+const printLoading = ref(false)
|
|
|
|
+const batchPrint = async () => {
|
|
|
|
+ const rows = tableweatherKeys.value;
|
|
|
|
+ const ids = rowsToId(rows)
|
|
|
|
+ //批量下载
|
|
|
|
+ printLoading.value = true
|
|
|
|
+ const {error, code, data} = await queryApi.batchPrint({ids: ids})
|
|
|
|
+ //处理数据
|
|
|
|
+ printLoading.value = false
|
|
|
|
+ const res = isString(data) ? data ?? '' : ''
|
|
|
|
+ if (!error && code === 200 && res) {
|
|
|
|
+ window.open(res, '_blank')
|
|
|
|
+ }
|
|
|
|
+}
|
|
</script>
|
|
</script>
|