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

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

parent ff9c001f
......@@ -47,7 +47,7 @@
<a-button
type="link"
v-if="record.appFileUrl"
@click="handleDowload(record.appFileUrl)"
@click="handleDowload(record.appFileUrl, record.appName)"
>下载应用</a-button
>
<a-button type="link" @click="openDetails(record)">编辑</a-button>
......@@ -76,6 +76,7 @@ export default {
name: "PortalAdminVueAlerting",
data() {
return {
api: process.env.VUE_APP_API_IMG_URL,
tableHeaders: [
{
title: "序号",
......@@ -187,11 +188,12 @@ export default {
}
});
},
handleDowload(url) {
let arr = url.split("/");
handleDowload(url, fileName) {
let index = url.lastIndexOf(".");
let suffix = url.slice(index);
const a = document.createElement("a");
a.href = url;
a.download = arr[arr.length - 1];
a.href = this.api + url;
a.download = fileName + suffix;
a.click();
},
openDetails(item) {
......
......@@ -35,7 +35,7 @@
<a-button
type="link"
v-if="record.docFileUrl"
@click="handleDowload(record.docFileUrl)"
@click="handleDowload(record.docFileUrl, record.docName)"
>下载</a-button
>
<a-button type="link" @click="openDetails(record)">编辑</a-button>
......@@ -63,6 +63,7 @@ export default {
name: "PortalAdminVueAlerting",
data() {
return {
api: process.env.VUE_APP_API_IMG_URL,
tableHeaders: [
{
title: "序号",
......@@ -159,12 +160,12 @@ export default {
}
});
},
handleDowload(url) {
let arr = url.split("/");
console.log(process.env.VUE_APP_API_BASE_URL + "/" + url);
handleDowload(url, fileName) {
let index = url.lastIndexOf(".");
let suffix = url.slice(index);
const a = document.createElement("a");
a.href = url;
a.download = arr[arr.length - 1];
a.href = this.api + url;
a.download = fileName + suffix;
a.click();
},
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