Commit 3516fae3 authored by 黄奎's avatar 黄奎

图片上传修改

parent f0cf845e
...@@ -1389,7 +1389,7 @@ export default { ...@@ -1389,7 +1389,7 @@ export default {
show: false, show: false,
}, },
CurrencyId:'', CurrencyId:'',
importFileUrl:this.domainManager().UploadFileUrl+'?cmd=User_post_FileUpload&fileType=1&fileLimit=10',
imageUrl:'', imageUrl:'',
uploadImgList:[], uploadImgList:[],
coinGetList:[], coinGetList:[],
......
...@@ -867,7 +867,7 @@ export default { ...@@ -867,7 +867,7 @@ export default {
AuditListData:{ AuditListData:{
AuditList:[] AuditList:[]
}, },
importFileUrl:this.domainManager().UploadFileUrl+'?cmd=User_post_FileUpload&fileType=1&fileLimit=10',
imageUrl:'', imageUrl:'',
uploadImgList:[], uploadImgList:[],
FuImgList:[], FuImgList:[],
......
...@@ -354,7 +354,9 @@ ...@@ -354,7 +354,9 @@
</el-input> </el-input>
</el-form-item> </el-form-item>
<el-form-item :label="$t('system.table_logoImg')"> <el-form-item :label="$t('system.table_logoImg')">
<el-upload class="avatar-uploader" :action="importFileUrl" :show-file-list="false" <el-upload class="avatar-uploader"
:http-request="UploadImage"
:show-file-list="false"
:on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload"> :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" class="avatar"> <img v-if="imageUrl" :src="imageUrl" class="avatar">
<i class="el-icon-upload2 avatar-uploader-icon"></i> <i class="el-icon-upload2 avatar-uploader-icon"></i>
...@@ -428,8 +430,7 @@ ...@@ -428,8 +430,7 @@
ticket_requirements: "", ticket_requirements: "",
ParentId: "0" ParentId: "0"
}, },
importFileUrl: this.domainManager().UploadFileUrl +
"?cmd=User_post_FileUpload&fileType=1&fileLimit=10",
defaultImg: 'this.src="' + require("../../assets/img/bg_z1@2x.png") + '"', defaultImg: 'this.src="' + require("../../assets/img/bg_z1@2x.png") + '"',
checkAll: false, checkAll: false,
checkedCities: [], checkedCities: [],
...@@ -477,6 +478,16 @@ ...@@ -477,6 +478,16 @@
}; };
}, },
methods: { methods: {
UploadImage(file) {
let newArr = [];
newArr.push(file.file);
let fileName = file.file.name;
var path = "/Upload/AirLine/";
this.UploadSelfFileT(path, newArr, x => {
this.imageUrl = this.domainManager().ViittoFileUrl + x.data.FilePath;
this.addMsg.image=x.data.FilePath;
});
},
getList() { getList() {
//获取数据分页 //获取数据分页
this.loading = true; this.loading = true;
......
...@@ -121,9 +121,9 @@ ...@@ -121,9 +121,9 @@
<el-form-item :label="$t('visa.v_yinzhang')"> <el-form-item :label="$t('visa.v_yinzhang')">
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
:action="importFileUrl" :http-request="UploadImage"
:show-file-list="false" :show-file-list="false"
:on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload"> :before-upload="beforeAvatarUpload">
<img v-if="imageUrl" :src="imageUrl" class="avatar"> <img v-if="imageUrl" :src="imageUrl" class="avatar">
<i class="el-icon-upload2 avatar-uploader-icon"></i> <i class="el-icon-upload2 avatar-uploader-icon"></i>
...@@ -198,7 +198,7 @@ export default { ...@@ -198,7 +198,7 @@ export default {
deleteID: "", deleteID: "",
typeList: "", typeList: "",
TypeOne: "", TypeOne: "",
importFileUrl:this.domainManager().UploadFileUrl+'?cmd=User_post_FileUpload&fileType=1&fileLimit=10',
imageUrl: '', imageUrl: '',
noData:false, noData:false,
msg: { msg: {
...@@ -253,6 +253,17 @@ export default { ...@@ -253,6 +253,17 @@ export default {
}; };
}, },
methods: { methods: {
//上传图片
UploadImage(file) {
let newArr = [];
newArr.push(file.file);
let fileName = file.file.name;
var path = "/Upload/Temporary/";
this.UploadSelfFileT(path, newArr, x => {
this.imageUrl = this.domainManager().ViittoFileUrl + x.data.FilePath;
this.addMsg.Icon=x.data.FilePath;
});
},
getVisaTempleteTypeList(){ // 获取模版类型枚举 getVisaTempleteTypeList(){ // 获取模版类型枚举
this.apipost("dmc_get_visa_GetVisaTempleteTypeList",{},res => { this.apipost("dmc_get_visa_GetVisaTempleteTypeList",{},res => {
if(res.data.resultCode==1){ if(res.data.resultCode==1){
...@@ -262,24 +273,9 @@ export default { ...@@ -262,24 +273,9 @@ export default {
} }
},err => {}); },err => {});
}, },
handleAvatarSuccess(res, file) { //上传
console.log('上传文件', res)
if(res.resultCode==1){
var img_path = res.data.FullFilePath
this.addMsg.Icon=res.data.FilePath
this.imageUrl = img_path
}
},
beforeAvatarUpload(file) { //上传- beforeAvatarUpload(file) { //上传-
// const isJPG = file.type === 'image/jpeg';
// const isLt2M = file.size / 1024 / 1024 < 2;
// if (!isJPG) {
// this.$message.error('上传头像图片只能是 JPG 格式!');
// }
// if (!isLt2M) {
// this.$message.error('上传头像图片大小不能超过 2MB!');
// }
// return isJPG && isLt2M;
}, },
handleCurrentChange(val) { handleCurrentChange(val) {
this.msg.pageIndex = val; this.msg.pageIndex = val;
......
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