修改视图组件

This commit is contained in:
liaozetao
2024-01-02 18:20:30 +08:00
parent 988a7bd035
commit 44e72bfd71

View File

@@ -328,7 +328,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-2 control-label">其他视图文件:</label> <label class="col-sm-2 control-label">其他视图文件:</label>
<div class="col-sm-10"> <div class="col-sm-10">
<img src="" id="viewFile" style="width:250px;height:90px;" alt=""> <video src="" id="viewFile" style="width:250px;height:90px;" alt=""></video>
<input type="file" id="viewUploadFile" name="file"> <input type="file" id="viewUploadFile" name="file">
<button class="btn btn-success" type="button" id="viewFileUploadBtn">上传</button> <button class="btn btn-success" type="button" id="viewFileUploadBtn">上传</button>
<span>如果上面已经上传svga素材此处不要再上传</span> <span>如果上面已经上传svga素材此处不要再上传</span>
@@ -957,6 +957,7 @@ export default {
} }
}); });
$('#picUploadBtn').on('click', function () { $('#picUploadBtn').on('click', function () {
showLoading();
$.ajaxFileUpload({ $.ajaxFileUpload({
fileElementId: 'picUploadFile', //需要上传的文件域的ID即<input type="file">的ID。 fileElementId: 'picUploadFile', //需要上传的文件域的ID即<input type="file">的ID。
url: '/admin/gift/upload', //后台方法的路径 url: '/admin/gift/upload', //后台方法的路径
@@ -974,9 +975,11 @@ export default {
$("#picImgInfo").html('未上传成功'); $("#picImgInfo").html('未上传成功');
} }
console.log(json.path); console.log(json.path);
hideLoading();
} else { } else {
$("#tipMsg").text(json.msg); $("#tipMsg").text(json.msg);
$("#tipModal").modal('show'); $("#tipModal").modal('show');
hideLoading();
} }
}, },
error: function (data, status, e) { //提交失败自动执行的处理函数。 error: function (data, status, e) { //提交失败自动执行的处理函数。
@@ -985,6 +988,7 @@ export default {
}); });
}) })
$('#vggUploadBtn').on('click', function () { $('#vggUploadBtn').on('click', function () {
showLoading();
$.ajaxFileUpload({ $.ajaxFileUpload({
url: '/admin/gift/upload',//后台请求地址 url: '/admin/gift/upload',//后台请求地址
type: 'post',//请求方式 当要提交自定义参数时这个参数要设置成post type: 'post',//请求方式 当要提交自定义参数时这个参数要设置成post
@@ -1002,14 +1006,17 @@ export default {
$("#vggImgInfo").html('未上传成功'); $("#vggImgInfo").html('未上传成功');
} }
console.log(json.path); console.log(json.path);
hideLoading();
} else { } else {
$("#tipMsg").text(json.msg); $("#tipMsg").text(json.msg);
$("#tipModal").modal('show'); $("#tipModal").modal('show');
hideLoading();
} }
} }
}); });
}) })
$('#svgaUploadBtn').on('click', function () { $('#svgaUploadBtn').on('click', function () {
showLoading();
$.ajaxFileUpload({ $.ajaxFileUpload({
url: '/admin/gift/upload',//后台请求地址 url: '/admin/gift/upload',//后台请求地址
type: 'post',//请求方式 当要提交自定义参数时这个参数要设置成post type: 'post',//请求方式 当要提交自定义参数时这个参数要设置成post
@@ -1026,9 +1033,11 @@ export default {
$("#svgaImgInfo").html('未上传成功'); $("#svgaImgInfo").html('未上传成功');
} }
console.log(json.path); console.log(json.path);
hideLoading();
} else { } else {
$("#tipMsg").text(json.msg); $("#tipMsg").text(json.msg);
$("#tipModal").modal('show'); $("#tipModal").modal('show');
hideLoading();
} }
} }
}); });