This commit is contained in:
‘937886381’
2024-06-03 08:23:40 +08:00
parent 91fd1b09d5
commit 38665c38bd
39 changed files with 541 additions and 406 deletions

View File

@@ -7,7 +7,7 @@
<CopilotButton v-for="i in ['同比', '环比']" :key="i" :label="i" :active="i === than"
@click="() => $emit('update:than', i)" />
<div class="btn-group">
<button type="button" class="export-btn" />
<button type="button" class="export-btn" @click="handleExport" />
<button type="button" class="fullscreen-btn" :class="[isFullscreen ? 'exit-fullscreen' : '']"
@click="toggleFullScreen" />
</div>
@@ -25,6 +25,8 @@
import FactorySelect from "./FactorySelect.vue";
import screenfull from "screenfull";
import CopilotButton from "./button.vue";
import { exportFactoryDataExcel } from "@/api/produceData";
export default {
name: "FactoryDataHeader",
components: { CopilotButton, FactorySelect },
@@ -55,6 +57,15 @@ export default {
},
computed: {},
methods: {
handleExport() {
exportFactoryDataExcel({
factoryId: this.companyId,
timeSelection: this.period === 1 ? 0 : this.period === 2 ? 1 : this.period === 3 ? 2 : 3,
}).then(response => {
this.$download.excel(response, `${this.companyName}生产数据.xls`);
// this.exportLoading = false;
}).catch(() => { });
},
toggleFullScreen() {
this.isFullscreen = !this.isFullscreen;