上传文件增加遮罩层

This commit is contained in:
liaozetao
2023-11-20 16:20:36 +08:00
parent a2f10cc41f
commit 80f5f05ea0
2 changed files with 11 additions and 0 deletions

View File

@@ -153,6 +153,7 @@
import { getResourcePage, delResource, saveResource, effective } from "@/api/resource/resource";
import { getResourceRuleList } from '@/api/resource/resourceRule';
import { uploadFile } from '@/api/common/upload';
import { hideLoading, showLoading } from "@/utils/maintainer";
export default {
name: "ResourceView",
@@ -213,12 +214,15 @@ export default {
let file = $('#iconFile').val();
console.log(file);
if (file && file.length > 0) {
showLoading();
$('#iconUploadBtn').click(function () {
uploadFile('iconFile').then(res => {
if (res.path) {
$this.resource.icon = res.path;
$('#iconUploadInfo').html('上传成功');
}
}).finally(() => {
hideLoading();
});
});
}
@@ -228,6 +232,7 @@ export default {
let file = $('#urlFile').val();
console.log(file);
if (file && file.length > 0) {
showLoading();
$('#urlUploadBtn').click(function () {
uploadFile('urlFile').then(res => {
if (res.path) {
@@ -235,6 +240,8 @@ export default {
$('#urlUploadInfo').html('上传成功');
}
});
}).finally(() => {
hideLoading();
});
}
},

View File

@@ -119,6 +119,7 @@
import { getResourcePage, delResource, saveResource, effective } from "@/api/resource/resource";
import { getResourceRuleList } from '@/api/resource/resourceRule';
import { uploadFile } from '@/api/common/upload';
import { hideLoading, showLoading } from "@/utils/maintainer";
export default {
name: "SplashView",
@@ -178,6 +179,7 @@ export default {
let file = $('#urlFile').val();
console.log(file);
if (file && file.length > 0) {
showLoading();
$('#urlUploadBtn').click(function () {
uploadFile('urlFile').then(res => {
if (res.path) {
@@ -185,6 +187,8 @@ export default {
$('#urlUploadInfo').html('上传成功');
}
});
}).finally(() => {
hideLoading();
});
}
},