Commit e09647a5 authored by “yiyousong”'s avatar “yiyousong”

pref:修改下载应用文档和应用

parent ff9c001f
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
<a-button <a-button
type="link" type="link"
v-if="record.appFileUrl" v-if="record.appFileUrl"
@click="handleDowload(record.appFileUrl)" @click="handleDowload(record.appFileUrl, record.appName)"
>下载应用</a-button >下载应用</a-button
> >
<a-button type="link" @click="openDetails(record)">编辑</a-button> <a-button type="link" @click="openDetails(record)">编辑</a-button>
...@@ -76,6 +76,7 @@ export default { ...@@ -76,6 +76,7 @@ export default {
name: "PortalAdminVueAlerting", name: "PortalAdminVueAlerting",
data() { data() {
return { return {
api: process.env.VUE_APP_API_IMG_URL,
tableHeaders: [ tableHeaders: [
{ {
title: "序号", title: "序号",
...@@ -187,11 +188,12 @@ export default { ...@@ -187,11 +188,12 @@ export default {
} }
}); });
}, },
handleDowload(url) { handleDowload(url, fileName) {
let arr = url.split("/"); let index = url.lastIndexOf(".");
let suffix = url.slice(index);
const a = document.createElement("a"); const a = document.createElement("a");
a.href = url; a.href = this.api + url;
a.download = arr[arr.length - 1]; a.download = fileName + suffix;
a.click(); a.click();
}, },
openDetails(item) { openDetails(item) {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
<a-button <a-button
type="link" type="link"
v-if="record.docFileUrl" v-if="record.docFileUrl"
@click="handleDowload(record.docFileUrl)" @click="handleDowload(record.docFileUrl, record.docName)"
>下载</a-button >下载</a-button
> >
<a-button type="link" @click="openDetails(record)">编辑</a-button> <a-button type="link" @click="openDetails(record)">编辑</a-button>
...@@ -63,6 +63,7 @@ export default { ...@@ -63,6 +63,7 @@ export default {
name: "PortalAdminVueAlerting", name: "PortalAdminVueAlerting",
data() { data() {
return { return {
api: process.env.VUE_APP_API_IMG_URL,
tableHeaders: [ tableHeaders: [
{ {
title: "序号", title: "序号",
...@@ -159,12 +160,12 @@ export default { ...@@ -159,12 +160,12 @@ export default {
} }
}); });
}, },
handleDowload(url) { handleDowload(url, fileName) {
let arr = url.split("/"); let index = url.lastIndexOf(".");
console.log(process.env.VUE_APP_API_BASE_URL + "/" + url); let suffix = url.slice(index);
const a = document.createElement("a"); const a = document.createElement("a");
a.href = url; a.href = this.api + url;
a.download = arr[arr.length - 1]; a.download = fileName + suffix;
a.click(); a.click();
}, },
openDetails(item) { openDetails(item) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment