|
@@ -62,17 +62,17 @@
|
|
|
</el-form>
|
|
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
-<!-- <el-col :span="1.5">-->
|
|
|
-<!-- <el-button-->
|
|
|
-<!-- type="warning"-->
|
|
|
-<!-- plain-->
|
|
|
-<!-- icon="el-icon-download"-->
|
|
|
-<!-- size="mini"-->
|
|
|
-<!-- :loading="exportLoading"-->
|
|
|
-<!-- @click="handleExport"-->
|
|
|
-<!-- v-hasPermi="['course:courseRedPacketLog:export']"-->
|
|
|
-<!-- >导出</el-button>-->
|
|
|
-<!-- </el-col>-->
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ plain
|
|
|
+ icon="el-icon-download"
|
|
|
+ size="mini"
|
|
|
+ :loading="exportLoading"
|
|
|
+ @click="handleExport"
|
|
|
+ v-hasPermi="['course:courseRedPacketLog:export']"
|
|
|
+ >导出</el-button>
|
|
|
+ </el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
<el-tabs type="card" v-model="activeName" @tab-click="handleClick">
|
|
@@ -160,7 +160,7 @@ export default {
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
|
// 导出遮罩层
|
|
|
- // exportLoading: false,
|
|
|
+ exportLoading: false,
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
// 非单个禁用
|
|
@@ -353,20 +353,37 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
/** 导出按钮操作 */
|
|
|
- // handleExport() {
|
|
|
- // const queryParams = this.queryParams;
|
|
|
- // this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
|
|
|
- // confirmButtonText: "确定",
|
|
|
- // cancelButtonText: "取消",
|
|
|
- // type: "warning"
|
|
|
- // }).then(() => {
|
|
|
- // this.exportLoading = true;
|
|
|
- // return exportCourseRedPacketLog(queryParams);
|
|
|
- // }).then(response => {
|
|
|
- // this.download(response.msg);
|
|
|
- // this.exportLoading = false;
|
|
|
- // }).catch(() => {});
|
|
|
- // }
|
|
|
+ handleExport() {
|
|
|
+ const queryParams = this.queryParams;
|
|
|
+
|
|
|
+ // 定义要排除的字段
|
|
|
+ const excludeFields = ['pageNum', 'pageSize']
|
|
|
+
|
|
|
+ // 检查除排除字段外是否有非null值
|
|
|
+ const hasQueryParams = Object.keys(queryParams).some(key => {
|
|
|
+ return !excludeFields.includes(key) && queryParams[key] !== null &&
|
|
|
+ queryParams[key] !== ''
|
|
|
+ })
|
|
|
+
|
|
|
+ if (!hasQueryParams) {
|
|
|
+ return this.$message.warning({
|
|
|
+ message: '导出失败,请选择至少一个查询条件再试!',
|
|
|
+ duration: 3000
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$confirm('是否确认导出所有短链课程看课记录数据项?', "警告", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ }).then(() => {
|
|
|
+ this.exportLoading = true;
|
|
|
+ return exportCourseRedPacketLog(queryParams);
|
|
|
+ }).then(response => {
|
|
|
+ this.download(response.msg);
|
|
|
+ this.exportLoading = false;
|
|
|
+ }).catch(() => {});
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|