clearImgShow
This commit is contained in:
parent
3732936088
commit
6950f38926
|
|
@ -132,7 +132,10 @@
|
|||
</view>
|
||||
<view class="form-info">
|
||||
<view class="form-item " style="height: fit-content;">
|
||||
<view class="title">照片</view>
|
||||
<!-- <view class="title">照片</view> -->
|
||||
<view class="form-left">
|
||||
<text class="form-left-text">照片</text>
|
||||
</view>
|
||||
<view style="flex: 3;">
|
||||
<u-upload :action="vuex_apifile" :header="header" ref="uUpload"
|
||||
:file-list="fileList" max-count="9" @on-success="imgUpSuccess"></u-upload>
|
||||
|
|
@ -160,10 +163,11 @@
|
|||
return {
|
||||
formData: {
|
||||
id: "",
|
||||
operation: "",
|
||||
level:"",
|
||||
cate: "",
|
||||
start_time: null,
|
||||
end_time: null,
|
||||
operation: "",
|
||||
cate: "",
|
||||
dept_do: '',
|
||||
charger: '',
|
||||
monitor: '',
|
||||
|
|
@ -171,6 +175,7 @@
|
|||
other_risk: '',
|
||||
risks_checked: [],
|
||||
measures_checked: [],
|
||||
create_imgs:[],
|
||||
},
|
||||
header: {},
|
||||
oplId: null,
|
||||
|
|
@ -233,6 +238,13 @@
|
|||
this.formData.monitor = ids[0];
|
||||
this.monitor_name = names;
|
||||
},
|
||||
imgUpSuccess(data,index,lists){
|
||||
debugger;
|
||||
console.log(data)
|
||||
console.log(index)
|
||||
console.log(lists);
|
||||
this.fileList=lists;
|
||||
},
|
||||
getHeader() {
|
||||
this.header = {
|
||||
Authorization: "Bearer " + this.vuex_token
|
||||
|
|
@ -256,6 +268,16 @@
|
|||
that.dept_do_name = res.dept_do_.name;
|
||||
that.charger_name = res.charger_.name;
|
||||
that.monitor_name = res.monitor_.name;
|
||||
res.create_imgs_.forEach(item=>{
|
||||
that.fileList.push({
|
||||
url: that.vuex_host+item.path,
|
||||
progress: 0,
|
||||
id:item.id,
|
||||
error: false,
|
||||
file: item
|
||||
})
|
||||
})
|
||||
|
||||
this.getOplcates()
|
||||
});
|
||||
|
||||
|
|
@ -382,13 +404,26 @@
|
|||
},
|
||||
edit(row) {},
|
||||
saveSubmit() {
|
||||
debugger;
|
||||
// debugger;
|
||||
uni.showLoading({
|
||||
title: '提交中'
|
||||
});
|
||||
let that = this;
|
||||
let params = null;
|
||||
console.log(this.formData);
|
||||
that.formData.create_imgs = [];
|
||||
that.fileList.forEach(item=>{
|
||||
debugger;
|
||||
if(item.id){
|
||||
console.log(item.id);
|
||||
that.formData.create_imgs.push(item.id)
|
||||
}else{
|
||||
console.log(item.response.id)
|
||||
that.formData.create_imgs.push(item.response.id)
|
||||
}
|
||||
// let imgId = item.response.id?item.response.id:item.id;
|
||||
// that.formData.create_imgs.push(imgId)
|
||||
})
|
||||
|
||||
if (that.oplId !== null) {
|
||||
that.$u.api.oplUpdate(that.oplId, that.formData).then(res => {
|
||||
uni.hideLoading();
|
||||
|
|
|
|||
|
|
@ -265,6 +265,11 @@ export default {
|
|||
uploading: false
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
debugger;
|
||||
console.log(this.fileList);
|
||||
this.lists = this.fileList;
|
||||
},
|
||||
watch: {
|
||||
fileList: {
|
||||
immediate: true,
|
||||
|
|
@ -277,7 +282,7 @@ export default {
|
|||
return val.url == value.url;
|
||||
})
|
||||
// 如果内部没有这个图片(tmp为false),则添加到内部
|
||||
!tmp && this.lists.push({ url: value.url, error: false, progress: 100 });
|
||||
!tmp && this.lists.push({ url: value.url, error: false, progress: 100,id:value.id});
|
||||
});
|
||||
}
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue