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