flat: 暂存

This commit is contained in:
Apcallover
2024-04-08 19:32:21 +08:00
parent 6c2e40a21b
commit f7f13e119f
8 changed files with 71 additions and 35 deletions

View File

@@ -13,6 +13,19 @@ export const getList = (current, size, params) => {
}); });
}; };
export const exportList = (current, size, params) => {
return request({
url: "/api/jobslink-api/missions/mission/manage/export",
method: "get",
params: {
...params,
current,
size,
},
responseType: 'blob',
});
};
export const getZPView = (current, size, missionNo, params) => { export const getZPView = (current, size, missionNo, params) => {
return request({ return request({
url: "/api/jobslink-api/missions/mission/apply/manage/list", url: "/api/jobslink-api/missions/mission/apply/manage/list",

View File

@@ -59,6 +59,18 @@ export const getList = (current, size, params) => {
}, },
}); });
}; };
export const exportList = (current, size, params) => {
return request({
url: "/api/jobslink-api/jkWorks/jkWorks/export",
method: "get",
params: {
...params,
current,
size,
},
responseType: 'blob'
});
};
export const getZPView = (current, size, missionNo, params) => { export const getZPView = (current, size, missionNo, params) => {
return request({ return request({

View File

@@ -152,7 +152,7 @@
> >
</template> </template>
<template slot="menuRight"> <template slot="menuRight">
<el-button size="small" @click.stop="downRecords" type="primary" <el-button size="small" :disabled="downloadButton" @click.stop="downRecords" type="primary"
>导出</el-button >导出</el-button
> >
</template> </template>
@@ -186,8 +186,10 @@ import {
complet, complet,
getDetail, getDetail,
download, download,
Auditing Auditing,
exportList
} from "@/api/manage/mission"; } from "@/api/manage/mission";
import {downloadEcxel} from '@/util/util'
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import missionView from "@/views/util/mission-view"; import missionView from "@/views/util/mission-view";
import zpView from "./zpView"; import zpView from "./zpView";
@@ -211,6 +213,7 @@ export default {
recruitStatus, recruitStatus,
dataSourcesEnum, dataSourcesEnum,
educationState, educationState,
downloadButton: false,
view: {}, view: {},
form: {}, form: {},
selectionList: [], selectionList: [],
@@ -601,13 +604,21 @@ export default {
}) })
}, },
downRecords() { downRecords() {
if (this.query.time) { this.downloadButton = true
this.query.stime = this.query.time[0]; exportList(
this.query.etime = this.query.time[1]; this.page.currentPage,
// delete this.query.time; this.page.pageSize,
} this.query
window.open(download(this.query)); ).then((response) => {
const blob = window.URL.createObjectURL(new Blob([response.data], { type: response.headers['content-type']}));
let fileName = decodeURI(response.headers['content-disposition'].split(';')[1].split('filename=')[1])
let a = document.createElement('a')
let event = new MouseEvent('click')
a.download = fileName || Date.now() + '.xlsx'
a.href = blob
a.dispatchEvent(event)
this.downloadButton = false
})
}, },
}, },

View File

@@ -126,6 +126,11 @@
v-if="vaildData(permission.manage_mission_zpview, false)" v-if="vaildData(permission.manage_mission_zpview, false)"
>报名详情</el-button> --> >报名详情</el-button> -->
</template> </template>
<template slot="menuRight">
<el-button size="small" :disabled="downloadButton" @click.stop="downRecords" type="primary"
>导出</el-button
>
</template>
</avue-crud> </avue-crud>
<delay-dialog <delay-dialog
ref="delay" ref="delay"
@@ -146,6 +151,7 @@ import {
review, review,
getDetail, getDetail,
download, download,
exportList
} from "@/api/workstation/post"; } from "@/api/workstation/post";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import postView from "@/views/util/post-view"; import postView from "@/views/util/post-view";
@@ -179,6 +185,7 @@ export default {
recruitStatus, recruitStatus,
dataSourcesEnum, dataSourcesEnum,
educationState, educationState,
downloadButton: false,
view: {}, view: {},
form: {}, form: {},
selectionList: [], selectionList: [],
@@ -570,12 +577,21 @@ export default {
}) })
}, },
downRecords() { downRecords() {
if (this.query.time) { this.downloadButton = true
this.query.stime = this.query.time[0]; exportList(
this.query.etime = this.query.time[1]; this.page.currentPage,
// delete this.query.time; this.page.pageSize,
} this.query
window.open(download(this.query)); ).then((response) => {
const blob = window.URL.createObjectURL(new Blob([response.data], { type: response.headers['content-type']}));
let fileName = decodeURI(response.headers['content-disposition'].split(';')[1].split('filename=')[1])
let a = document.createElement('a')
let event = new MouseEvent('click')
a.download = fileName || Date.now() + '.xlsx'
a.href = blob
a.dispatchEvent(event)
this.downloadButton = false
})
}, },

View File

@@ -65,11 +65,7 @@ export default {
this.headTitle = res[0].name this.headTitle = res[0].name
this.search.serveId = res[0].id this.search.serveId = res[0].id
this.searchServeId = res[0].id this.searchServeId = res[0].id
this.getList().then((records) => { this.getList()
if(records.length) {
this.headTitle = records[0].name
}
})
} }
}) })
}, },

View File

@@ -66,11 +66,7 @@ export default {
this.headTitle = res[0].name this.headTitle = res[0].name
this.search.serveId = res[0].id this.search.serveId = res[0].id
this.searchServeId = res[0].id this.searchServeId = res[0].id
this.getList().then((records) => { this.getList()
if(records.length) {
this.headTitle = records[0].name
}
})
} }
}) })
}, },

View File

@@ -66,11 +66,7 @@ export default {
this.headTitle = res[0].name this.headTitle = res[0].name
this.search.serveId = res[0].id this.search.serveId = res[0].id
this.searchServeId = res[0].id this.searchServeId = res[0].id
this.getList().then((records) => { this.getList()
if(records.length) {
this.headTitle = records[0].name
}
})
} }
}) })
}, },

View File

@@ -67,11 +67,7 @@ export default {
this.headTitle = res[0].name this.headTitle = res[0].name
this.search.serveId = res[0].id this.search.serveId = res[0].id
this.searchServeId = res[0].id this.searchServeId = res[0].id
this.getList().then((records) => { this.getList()
if(records.length) {
this.headTitle = records[0].name
}
})
} }
}) })
}, },