From 10049ebb95cfe0b918b4065ff585d936349c81f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=89=E8=99=B9=E7=9D=BF?= <297504645@qq.com> Date: Mon, 17 Jul 2023 10:51:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BA=E5=BC=B9=E7=AA=97=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E6=9A=82=E5=AD=98=E5=B0=81=E8=A3=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Code/Fe/src/components/exportDrop/index.vue | 89 +++++++++++++++++++ Code/Fe/src/mixins/LoadingMixins.js | 3 +- Code/Fe/src/mixins/TableHeaderMixins.js | 73 ++++++--------- Code/Fe/src/utils/utils.js | 4 +- .../src/views/interfaceBoard/TestSchool.vue | 6 ++ 5 files changed, 127 insertions(+), 48 deletions(-) create mode 100644 Code/Fe/src/components/exportDrop/index.vue diff --git a/Code/Fe/src/components/exportDrop/index.vue b/Code/Fe/src/components/exportDrop/index.vue new file mode 100644 index 0000000..f773a3f --- /dev/null +++ b/Code/Fe/src/components/exportDrop/index.vue @@ -0,0 +1,89 @@ + + + + \ No newline at end of file diff --git a/Code/Fe/src/mixins/LoadingMixins.js b/Code/Fe/src/mixins/LoadingMixins.js index ef83937..efc9f06 100644 --- a/Code/Fe/src/mixins/LoadingMixins.js +++ b/Code/Fe/src/mixins/LoadingMixins.js @@ -18,7 +18,8 @@ export const LoadingMixins = { screenDialog: false, //筛选 AddNewDialog: false, //选择数据弹出框 scanningDialog: false, //扫描 - importDialog: false, //导出 + importDialog: false, //导入 + exportDialog: false, //导出 handleFromDialog: false, //执行生成 }, } diff --git a/Code/Fe/src/mixins/TableHeaderMixins.js b/Code/Fe/src/mixins/TableHeaderMixins.js index 370ca0a..6a1e19e 100644 --- a/Code/Fe/src/mixins/TableHeaderMixins.js +++ b/Code/Fe/src/mixins/TableHeaderMixins.js @@ -30,6 +30,32 @@ export const TableHeaderMixins = { } }, methods: { + // 关闭导出弹窗 + closeExportDrop(){ + this.displayDialog.exportDialog = false + }, + // 导出功能 + exportDropSubmit(type,form){ + const name = this.$route.meta.title + let _params = { + isRedundance:Boolean(form.isRedundance), + isDetailExport:Boolean(form.isDetail), + userId:JSON.parse(localStorage.getItem("currentUserInfo")).id + } + let _exportUrl = this.URLOption_export ? this.URLOption_export : this.URLOption_base; + let _special = this.URLOption_export ? true : false + let _data = JSON.parse(JSON.stringify(this.PageListParams)) + // 全部导出处理 + if(type && type == 'all'){ _data.MaxResultCount = this.totalCount} + this.closeExportDrop() + this.Loading.appMainLoading = true + postExport(_params,_data, _exportUrl, _special).then(res => { + this.blob(res, name)//使用前端导出名称 + this.Loading.appMainLoading = false + }).catch(err => { + this.Loading.appMainLoading = false + }) + }, // 点击常用按钮 topbutton(val,item) { // 更新 @@ -63,52 +89,7 @@ export const TableHeaderMixins = { // } // 导出 else if (val == 'export') { - const name = this.$route.meta.title - let _params = { - isRedundance:Boolean(item.isRedundance), - isDetailExport:Boolean(item.isDetailExport), - userId:JSON.parse(localStorage.getItem("currentUserInfo")).id - } - let _exportUrl = this.URLOption_export ? this.URLOption_export : this.URLOption_base; - let _special = this.URLOption_export ? true : false - this.$confirm('您将进行导出操作, 是否继续?', '提示', { - confirmButtonText: '本页导出', - cancelButtonText: '全部导出', - distinguishCancelAndClose: true, - closeOnClickModal: false, - closeOnPressEscape: false, - type: 'warning' - }).then(() => { - // 本页导出 - this.Loading.appMainLoading = true - // this.PageListParams.company = window.SITE_CONFIG['company'] - // this.PageListParams.function = name - //自定义导出url - // this.PageListParams.route = item.url ? item.url : this.URLOption_base + '/export'; - postExport(_params,this.PageListParams, _exportUrl, _special).then(res => { - this.blob(res, name)//使用前端导出名称 - this.Loading.appMainLoading = false - }).catch(err => { - this.Loading.appMainLoading = false - }) - }).catch((action) => { - if (action === 'cancel') { - // 全部导出 - this.Loading.appMainLoading = true - let params = JSON.parse(JSON.stringify(this.PageListParams)) - params.MaxResultCount = this.totalCount - this.Loading.appMainLoading = true - // params.company = window.SITE_CONFIG['company'] - // params.route = this.URLOption_base + '/export' - // params.function = name - postExport(_params,params, _exportUrl, _special).then(res => { - this.blob(res, name)//使用前端导出名称 - this.Loading.appMainLoading = false - }).catch(err => { - this.Loading.appMainLoading = false - }) - } - }); + this.displayDialog.exportDialog = true } // 导入 else if (val == 'import') { diff --git a/Code/Fe/src/utils/utils.js b/Code/Fe/src/utils/utils.js index 4555d89..5493136 100644 --- a/Code/Fe/src/utils/utils.js +++ b/Code/Fe/src/utils/utils.js @@ -54,7 +54,8 @@ import currenDrawer from "@/components/commonTabel-drawer"; //抽屉 import currenButton from "@/components/currenButton" //按钮 import currenTable from "@/components/currenTable" //table import tablePagination from "@/components/tablePagination"; //第一视图集成 -import importFile from "@/components/importFile" //导出 +import importFile from "@/components/importFile" //导入 +import exportDrop from "@/components/exportDrop" //导出 import pagination from "@/components/Pagination" //分页器 import conditionFilters from "@/components/conditionFilters" //高级筛选 import searchPage from '@/components/searchPage' //autocomplete拉取数据探弹窗 @@ -108,6 +109,7 @@ Vue.component('currenButton', currenButton) Vue.component('currenTable', currenTable) Vue.component('tablePagination', tablePagination) Vue.component('importFile', importFile) +Vue.component('exportDrop', exportDrop) Vue.component('pagination', pagination) Vue.component('conditionFilters', conditionFilters) Vue.component('searchPage', searchPage) diff --git a/Code/Fe/src/views/interfaceBoard/TestSchool.vue b/Code/Fe/src/views/interfaceBoard/TestSchool.vue index 8a98178..b31e52f 100644 --- a/Code/Fe/src/views/interfaceBoard/TestSchool.vue +++ b/Code/Fe/src/views/interfaceBoard/TestSchool.vue @@ -69,6 +69,12 @@ > + +