|
@@ -43,7 +43,6 @@
|
|
|
>
|
|
|
<SvgIcon name="iconfont icon-export" />
|
|
|
</el-button>
|
|
|
- <el-button v-if="exportLoading" :loading="exportLoading">导出中,请稍后。。。</el-button>
|
|
|
</slot>
|
|
|
<slot name="description"> </slot>
|
|
|
<slot name="tableBtn"></slot>
|
|
@@ -107,7 +106,7 @@
|
|
|
</el-table>
|
|
|
<!-- 分页组件 -->
|
|
|
<slot name="pagination">
|
|
|
- <div class="pagination-container">
|
|
|
+ <div class="pagination-container" v-if="pagination">
|
|
|
<el-pagination
|
|
|
:background="background"
|
|
|
v-model:current-page="pageIndex"
|
|
@@ -127,9 +126,10 @@
|
|
|
<col-setting-com v-if="toolButton" ref="colRef" v-model:col-setting="colSetting" @update:colSetting="updateColSetting" @changeRow="changeRow" />
|
|
|
</template>
|
|
|
|
|
|
-<script setup lang="ts" name="ProTable">
|
|
|
-import { ref, provide, onMounted, unref, computed, reactive, PropType, watch } from 'vue';
|
|
|
-import { ElMessageBox, ElTable } from 'element-plus';
|
|
|
+<script setup lang="tsx" name="ProTable">
|
|
|
+import { ref, provide, onMounted, unref, computed, reactive, PropType, watch,h } from 'vue';
|
|
|
+import { ElMessage, ElMessageBox, ElTable } from 'element-plus';
|
|
|
+import {Loading} from "@element-plus/icons-vue"
|
|
|
import { useSelection } from '@/hooks/useSelection';
|
|
|
import { ColumnProps, TypeProps } from '@/components/ProTable/interface';
|
|
|
import ColSettingCom from './components/ColSetting.vue';
|
|
@@ -492,6 +492,17 @@ const exportAll = () => {
|
|
|
columnInfos: exportNewColumns,
|
|
|
isExportAll: true,
|
|
|
};
|
|
|
+ const message = ElMessage({
|
|
|
+ message: (
|
|
|
+ <div class="flex-center-center">
|
|
|
+ 正在导出中,请稍后
|
|
|
+ <Loading class="el-icon is-loading ml5"/>
|
|
|
+ </div>
|
|
|
+ ),
|
|
|
+ type: 'info',
|
|
|
+ duration:0,
|
|
|
+ plain:true,
|
|
|
+ })
|
|
|
if (props.isSpecialExport) {
|
|
|
const specialRequest = {
|
|
|
...props.exportParams,
|
|
@@ -504,10 +515,12 @@ const exportAll = () => {
|
|
|
downloadFileByStream(res);
|
|
|
emit('exportAll', exportNewColumns);
|
|
|
exportLoading.value = false;
|
|
|
+ message.close();
|
|
|
})
|
|
|
.catch((e) => {
|
|
|
console.log(`导出失败:${e}`);
|
|
|
exportLoading.value = false;
|
|
|
+ message.close();
|
|
|
});
|
|
|
} else {
|
|
|
props.exportMethod &&
|
|
@@ -517,10 +530,12 @@ const exportAll = () => {
|
|
|
downloadFileByStream(res);
|
|
|
emit('exportAll', exportNewColumns);
|
|
|
exportLoading.value = false;
|
|
|
+ message.close();
|
|
|
})
|
|
|
.catch((e) => {
|
|
|
console.log(`导出失败:${e}`);
|
|
|
exportLoading.value = false;
|
|
|
+ message.close();
|
|
|
});
|
|
|
}
|
|
|
})
|