update 重构 将下载excel工具提取到全局

This commit is contained in:
疯狂的狮子li 2021-08-23 18:28:33 +08:00
parent dea627f02c
commit f91ebd93d2
12 changed files with 14 additions and 24 deletions

View File

@ -16,7 +16,7 @@ import './assets/icons' // icon
import './permission' // permission control
import { getDicts } from "@/api/system/dict/data";
import { getConfigKey } from "@/api/system/config";
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi";
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, download, handleTree } from "@/utils/ruoyi";
import Pagination from "@/components/Pagination";
// 自定义表格工具组件
import RightToolbar from "@/components/RightToolbar"
@ -40,6 +40,7 @@ Vue.prototype.addDateRange = addDateRange
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.selectDictLabels = selectDictLabels
Vue.prototype.handleTree = handleTree
Vue.prototype.downLoadExcel = downLoadExcel
Vue.prototype.msgSuccess = function (msg) {
this.$message({ showClose: true, message: msg, type: "success" });

View File

@ -170,7 +170,6 @@
<script>
import { listDemo, pageDemo, getDemo, delDemo, addDemo, updateDemo } from "@/api/demo/demo";
import { downLoadExcel } from "@/utils/download";
export default {
name: "Demo",
@ -361,7 +360,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
downLoadExcel('/demo/demo/export', this.queryParams);
this.downLoadExcel('/demo/demo/export', this.queryParams);
}
}
};

View File

@ -281,7 +281,6 @@
<script>
import { listJob, getJob, delJob, addJob, updateJob, runJob, changeJobStatus } from "@/api/monitor/job";
import { downLoadExcel } from "@/utils/download";
export default {
name: "Job",
@ -506,7 +505,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
downLoadExcel('/monitor/job/export', this.queryParams);
this.downLoadExcel('/monitor/job/export', this.queryParams);
}
}
};

View File

@ -179,7 +179,6 @@
<script>
import { getJob } from "@/api/monitor/job";
import { listJobLog, delJobLog, cleanJobLog } from "@/api/monitor/jobLog";
import { downLoadExcel } from "@/utils/download";
export default {
name: "JobLog",
@ -311,7 +310,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
downLoadExcel('/monitor/jobLog/export', this.queryParams);
this.downLoadExcel('/monitor/jobLog/export', this.queryParams);
}
}
};

View File

@ -120,7 +120,6 @@
<script>
import { list, delLogininfor, cleanLogininfor } from "@/api/monitor/logininfor";
import { downLoadExcel } from "@/utils/download";
export default {
name: "Logininfor",
@ -229,7 +228,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
downLoadExcel('/monitor/logininfor/export', this.queryParams);
this.downLoadExcel('/monitor/logininfor/export', this.queryParams);
}
}
};

View File

@ -189,7 +189,6 @@
<script>
import { list, delOperlog, cleanOperlog } from "@/api/monitor/operlog";
import { downLoadExcel } from "@/utils/download";
export default {
name: "Operlog",
@ -317,7 +316,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
downLoadExcel('/monitor/operlog/export', this.queryParams);
this.downLoadExcel('/monitor/operlog/export', this.queryParams);
}
}
};

View File

@ -182,7 +182,6 @@
<script>
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
import { downLoadExcel } from "@/utils/download";
export default {
name: "Config",
@ -343,7 +342,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
downLoadExcel('/system/config/export', this.queryParams);
this.downLoadExcel('/system/config/export', this.queryParams);
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {

View File

@ -185,7 +185,6 @@
<script>
import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data";
import { listType, getType } from "@/api/system/dict/type";
import { downLoadExcel } from "@/utils/download";
export default {
name: "Data",
@ -389,7 +388,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
downLoadExcel('/system/dict/data/export', this.queryParams);
this.downLoadExcel('/system/dict/data/export', this.queryParams);
}
}
};

View File

@ -194,7 +194,6 @@
<script>
import { listType, getType, delType, addType, updateType, refreshCache } from "@/api/system/dict/type";
import { downLoadExcel } from "@/utils/download";
export default {
name: "Dict",
@ -347,7 +346,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
downLoadExcel('/system/dict/type/export', this.queryParams);
this.downLoadExcel('/system/dict/type/export', this.queryParams);
},
/** 刷新缓存按钮操作 */
handleRefreshCache() {

View File

@ -157,7 +157,6 @@
<script>
import { listPost, getPost, delPost, addPost, updatePost } from "@/api/system/post";
import { downLoadExcel } from "@/utils/download";
export default {
name: "Post",
@ -314,7 +313,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
downLoadExcel('/system/post/export', this.queryParams);
this.downLoadExcel('/system/post/export', this.queryParams);
}
}
};

View File

@ -262,7 +262,6 @@
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus } from "@/api/system/role";
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu";
import { treeselect as deptTreeselect, roleDeptTreeselect } from "@/api/system/dept";
import { downLoadExcel } from "@/utils/download";
export default {
name: "Role",
@ -626,7 +625,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
downLoadExcel('/system/role/export', this.queryParams);
this.downLoadExcel('/system/role/export', this.queryParams);
}
}
};

View File

@ -351,7 +351,6 @@ import { getToken } from "@/utils/auth";
import { treeselect } from "@/api/system/dept";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import { downLoadExcel } from "@/utils/download";
export default {
name: "User",
@ -661,7 +660,7 @@ export default {
},
/** 导出按钮操作 */
handleExport() {
downLoadExcel('/system/user/export', this.queryParams);
this.downLoadExcel('/system/user/export', this.queryParams);
},
/** 导入按钮操作 */
handleImport() {
@ -670,7 +669,7 @@ export default {
},
/** 下载模板操作 */
importTemplate() {
downLoadExcel('/system/user/importTemplate');
this.downLoadExcel('/system/user/importTemplate');
},
//
handleFileUploadProgress(event, file, fileList) {