This commit is contained in:
nisen
2023-09-04 18:01:13 +08:00
parent a99bf81b57
commit 61c8e18eeb
8 changed files with 83 additions and 40 deletions

View File

@@ -49,7 +49,7 @@
</div>
</template>
<script>
import { toolList } from '../../api/modules/grateful';
import { toolList, toolDown } from '../../api/modules/grateful';
export default {
data: () => {
return {
@@ -73,10 +73,22 @@ export default {
this.total = total
}
},
downLoad({ filePath }) {
if (!filePath) return;
console.log(process.env.VUE_APP_FILE_RELATIVE_PATH + filePath);
window.open(process.env.VUE_APP_FILE_RELATIVE_PATH + filePath)
downLoad(toolInfo) {
console.log(toolInfo);
toolDown({
urlStr: `${process.env.VUE_APP_BOE_WEB_URL}/upload${toolInfo.filePath}`,
fileName: toolInfo.name
}).then((result) => {
const link = document.createElement('a');// 创建a标签
let blob = new Blob([result.data], { type: '' }); // 设置文件类型
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
link.setAttribute("download", `${toolInfo.name}`);
document.body.appendChild(link);
link.click();
URL.revokeObjectURL(link.href);
document.body.removeChild(link);
})
},
getPic(index) {
return this.webBaseUrl + "/images/listblue0" + (index + 1) + ".png";
@@ -139,7 +151,7 @@ export default {
}
.modules-list {
// min-height: 555px;
min-height: 682px;
background: #ffffff;
border-radius: 8px;
@@ -151,8 +163,8 @@ export default {
.toolEvery {
height: 80px;
line-height: 80px;
height: 56px;
line-height: 56px;
font-size: 18px;
font-weight: 500;
color: #333333;