Commit 151f2366 authored by wanghao's avatar wanghao

1 阀井/调压箱 修改时之前图片重复显示, 有的不显示问题修复。

parent 1be08101
...@@ -146,18 +146,18 @@ public class TDeviceInfoController extends BaseController ...@@ -146,18 +146,18 @@ public class TDeviceInfoController extends BaseController
public AjaxResult edit(@RequestBody TDeviceInfo tDeviceInfo) public AjaxResult edit(@RequestBody TDeviceInfo tDeviceInfo)
{ {
TDeviceInfo tDeviceInfos = tDeviceInfoService.selectTDeviceInfoById(tDeviceInfo.getDeviceId()); TDeviceInfo tDeviceInfos = tDeviceInfoService.selectTDeviceInfoById(tDeviceInfo.getDeviceId());
//文件删除 //文件删除 20240731 wh 调整去掉删除
if (tDeviceInfos.getIconUrl()!=null){ // if (tDeviceInfos.getIconUrl()!=null){
// 上传文件路径 // // 上传文件路径
String filePath = GassafetyProgressConfig.getUploadPath(); // String filePath = GassafetyProgressConfig.getUploadPath();
String[] strs = tDeviceInfos.getIconUrl().split("upload"); // String[] strs = tDeviceInfos.getIconUrl().split("upload");
//删除图片 // //删除图片
File file = new File(filePath+strs[1].toString()); // File file = new File(filePath+strs[1].toString());
// 上传文件路径 // // 上传文件路径
if(file.isFile()){ // if(file.isFile()){
file.delete(); // file.delete();
} // }
} // }
//根据企业id查询企业名称 //根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tDeviceInfo.getBeyondEnterpriseId()); String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tDeviceInfo.getBeyondEnterpriseId());
tDeviceInfo.setBeyondEnterpriseName(EnterpriseName); tDeviceInfo.setBeyondEnterpriseName(EnterpriseName);
......
...@@ -115,7 +115,7 @@ ...@@ -115,7 +115,7 @@
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="照片" align="center" > <!-- <el-table-column label="照片" align="center" >
<template slot-scope="List"> <template slot-scope="List">
<img :src="List.row.iconUrl" width="100px"> <img :src="List.row.iconUrl" width="100px">
</template> </template>
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
</span> </span>
<span v-else>-</span> <span v-else>-</span>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
...@@ -519,6 +519,7 @@ export default { ...@@ -519,6 +519,7 @@ export default {
relationImg: require('@/assets/project/relation.png'), relationImg: require('@/assets/project/relation.png'),
//头像 //头像
fileList: [], fileList: [],
pictureUrlList:[],
/**弹出层*/ /**弹出层*/
//下级设备数据数组 //下级设备数据数组
tableData: [], tableData: [],
...@@ -657,8 +658,9 @@ export default { ...@@ -657,8 +658,9 @@ export default {
methods: { methods: {
/**上传头像*/ /**上传头像*/
getFileInfo(res){ getFileInfo(res){
this.form.dealPlan = res.fileName; this.pictureUrlList.push(res.url)
this.form.iconUrl = res.url; // this.form.iconUrl = res.url;
this.form.iconUrl=this.pictureUrlList.join(",");
this.form.burl=res.burl; this.form.burl=res.burl;
this.fileList.push({ this.fileList.push({
name: res.fileName, name: res.fileName,
...@@ -671,7 +673,30 @@ export default { ...@@ -671,7 +673,30 @@ export default {
}, },
listRemove(e) { listRemove(e) {
this.form.dealPlan = ""; this.form.dealPlan = "";
this.fileList = []; let deleteIndex = -1;
for(var i = 0; i < this.fileList.length; i++){
const item = this.fileList[i];
if (item.uid == e.uid) {
deleteIndex = i;
}
}
if (deleteIndex > -1) {
this.form.iconUrl = "";
this.fileList.splice(deleteIndex,1);
this.pictureUrlList = [];
if (this.fileList.length > 0) {
for(var i = 0; i < this.fileList.length; i++){
const item = this.fileList[i] ;
console.log("item.url" + item.url);
this.pictureUrlList.push(item.url);
this.form.iconUrl=this.pictureUrlList.join(",");
}
}
}
console.log("this.form.iconUrl = " + this.form.iconUrl);
// this.fileList = [];
}, },
/** 查询设备信息列表 */ /** 查询设备信息列表 */
getList() { getList() {
...@@ -784,12 +809,20 @@ export default { ...@@ -784,12 +809,20 @@ export default {
this.loadings = false; this.loadings = false;
}); });
// 隐患信息 上传照片清空
this.fileList = [];
this.pictureUrlList = [];
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加设备信息"; this.title = "添加设备信息";
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
// 隐患信息 上传照片清空
this.fileList = [];
this.pictureUrlList = [];
//查询企业名称下拉框数据 //查询企业名称下拉框数据
selectTEnterprise().then(response => { selectTEnterprise().then(response => {
this.test = response.data; this.test = response.data;
...@@ -811,11 +844,15 @@ export default { ...@@ -811,11 +844,15 @@ export default {
this.form = response.data; this.form = response.data;
//图片回显 //图片回显
if (this.form.iconUrl) { if (this.form.iconUrl) {
for(var i = 0; i < this.form.iconUrl.split(',').length; i++){
console.log("this.form.iconUrl.split(',')" + i+ "=== " + this.form.iconUrl.split(',')[i]);
this.pictureUrlList.push(this.form.iconUrl.split(',')[i])
this.fileList.push({ this.fileList.push({
name: '照片', name: '照片',
url: this.form.iconUrl, url: this.form.iconUrl.split(',')[i],
}); });
} }
}
this.open = true; this.open = true;
this.title = "修改设备信息"; this.title = "修改设备信息";
this.devicePos = [response.data.longitude, response.data.latitude]; this.devicePos = [response.data.longitude, response.data.latitude];
......
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