|
@@ -30,11 +30,11 @@
|
|
|
icon="el-icon-search"
|
|
|
size="mini"
|
|
|
@click="handleQuery"
|
|
|
- >搜索</el-button
|
|
|
- >
|
|
|
+ >搜索
|
|
|
+ </el-button>
|
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
|
|
- >重置</el-button
|
|
|
- >
|
|
|
+ >重置
|
|
|
+ </el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
@@ -47,8 +47,8 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['system:engineering:add']"
|
|
|
- >新增</el-button
|
|
|
- >
|
|
|
+ >新增
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -59,8 +59,8 @@
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
v-hasPermi="['system:engineering:edit']"
|
|
|
- >修改</el-button
|
|
|
- >
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -71,8 +71,8 @@
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
v-hasPermi="['system:engineering:remove']"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -82,8 +82,8 @@
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['system:engineering:export']"
|
|
|
- >导出</el-button
|
|
|
- >
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -91,10 +91,10 @@
|
|
|
plain
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
- @click="handleDownload"
|
|
|
+ @click="handleDownloadEnd"
|
|
|
v-hasPermi="['system:engineering:download']"
|
|
|
- >下载</el-button
|
|
|
- >
|
|
|
+ >下载
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar
|
|
|
:showSearch.sync="showSearch"
|
|
@@ -285,6 +285,35 @@ export default {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleDownloadEnd(row) {
|
|
|
+ this.loading = true;
|
|
|
+ let applicationType = "application/zip";
|
|
|
+ var fileTheName = "123";
|
|
|
+
|
|
|
+ downloadEngineering().then((res) => {
|
|
|
+ if (res) {
|
|
|
+ const content = res;
|
|
|
+ const blob = new Blob([content], { type: applicationType });
|
|
|
+ const fileName = fileTheName;
|
|
|
+ if ("download" in document.createElement("a")) {
|
|
|
+ // 非IE下载
|
|
|
+ const elink = document.createElement("a");
|
|
|
+ elink.download = fileName;
|
|
|
+ elink.style.display = "none";
|
|
|
+ elink.href = URL.createObjectURL(blob);
|
|
|
+ document.body.appendChild(elink);
|
|
|
+ elink.click();
|
|
|
+ URL.revokeObjectURL(elink.href); // 释放URL 对象
|
|
|
+ document.body.removeChild(elink);
|
|
|
+ this.loading = false;
|
|
|
+ } else {
|
|
|
+ // IE10+下载
|
|
|
+ navigator.msSaveBlob(blob, fileName);
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 查询工程部署列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
@@ -450,8 +479,14 @@ export default {
|
|
|
spinner: "el-icon-loading",
|
|
|
background: "rgba(0, 0, 0, 0.7)",
|
|
|
});
|
|
|
- return axios
|
|
|
- .get(url, { responseType: "blob" })
|
|
|
+ return service
|
|
|
+ .get(url, params, {
|
|
|
+ headers: {
|
|
|
+ "Content-Disposition": `attachment;filename="${filename}"`,
|
|
|
+ "Content-Type": `application/zip`,
|
|
|
+ },
|
|
|
+ responseType: "blob",
|
|
|
+ })
|
|
|
.then(async (data) => {
|
|
|
const isBlob = blobValidate(data);
|
|
|
if (isBlob) {
|