Commit b5ff07d4 authored by wuqinghua's avatar wuqinghua

2022-3-14 吴卿华

parent d5c8f9ad
package com.zehong.web.controller.supervise;
import java.io.File;
import java.util.List;
import java.util.Map;
import com.zehong.common.config.GassafetyProgressConfig;
import com.zehong.system.domain.Listaw;
import com.zehong.system.domain.TDetailInfoList;
import com.zehong.system.domain.TDeviceInfoS;
......@@ -110,6 +112,19 @@ public class TDeviceInfoController extends BaseController
@PutMapping
public AjaxResult edit(@RequestBody TDeviceInfo tDeviceInfo)
{
TDeviceInfo tDeviceInfos = tDeviceInfoService.selectTDeviceInfoById(tDeviceInfo.getDeviceId());
//文件删除
if (tDeviceInfos.getIconUrl()!=null){
// 上传文件路径
String filePath = GassafetyProgressConfig.getUploadPath();
String[] strs = tDeviceInfos.getIconUrl().split("upload");
//删除图片
File file = new File(filePath+strs[1].toString());
// 上传文件路径
if(file.isFile()){
file.delete();
}
}
//根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tDeviceInfo.getBeyondEnterpriseId());
tDeviceInfo.setBeyondEnterpriseName(EnterpriseName);
......
......@@ -57,9 +57,20 @@ public class TSiteStationInfo extends BaseEntity
@Excel(name = "备注")
private String remarks;
/**图片地址*/
private String pictureAddress;
/** 关联设备类型 1设备 2场站*/
private String relationDeviceType;
public String getPictureAddress() {
return pictureAddress;
}
public void setPictureAddress(String pictureAddress) {
this.pictureAddress = pictureAddress;
}
public static long getSerialVersionUID() {
return serialVersionUID;
}
......@@ -186,6 +197,7 @@ public class TSiteStationInfo extends BaseEntity
", latitude=" + latitude +
", isDel='" + isDel + '\'' +
", remarks='" + remarks + '\'' +
", pictureAddress='" + pictureAddress + '\'' +
", relationDeviceType='" + relationDeviceType + '\'' +
'}';
}
......
......@@ -20,10 +20,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateTime" column="update_time" />
<result property="isDel" column="is_del" />
<result property="remarks" column="remarks" />
<result property="pictureAddress" column="picture_address" />
</resultMap>
<sql id="selectTSiteStationInfoVo">
select site_station_id,(CASE site_station_type WHEN '1' THEN '加气站' WHEN '2' THEN '门站'WHEN '3' THEN '调压站' WHEN '4' THEN '储备站'WHEN '5' THEN '气化站'end ) as site_station_type,
select site_station_id,picture_address,(CASE site_station_type WHEN '1' THEN '加气站' WHEN '2' THEN '门站'WHEN '3' THEN '调压站' WHEN '4' THEN '储备站'WHEN '5' THEN '气化站'end ) as site_station_type,
site_station_name, build_date, build_unit, beyond_enterprise_id, beyond_enterprise_name, longitude, latitude,
create_by, create_time, update_by, update_time, is_del, remarks from t_site_station_info
</sql>
......@@ -40,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="selectTSiteStationInfoById" parameterType="Long" resultMap="TSiteStationInfoResult">
select site_station_id,site_station_type,
select site_station_id,picture_address,site_station_type,
site_station_name, build_date, build_unit, beyond_enterprise_id, beyond_enterprise_name, longitude, latitude,
create_by, create_time, update_by, update_time, is_del, remarks from t_site_station_info
where site_station_id = #{siteStationId} and is_del='0'
......@@ -71,6 +72,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time,</if>
<if test="isDel != null">is_del,</if>
<if test="remarks != null">remarks,</if>
<if test="pictureAddress != null">picture_address,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="siteStationType != null">#{siteStationType},</if>
......@@ -87,6 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">#{updateTime},</if>
<if test="isDel != null">#{isDel},</if>
<if test="remarks != null">#{remarks},</if>
<if test="pictureAddress != null">#{pictureAddress},</if>
</trim>
</insert>
......@@ -107,6 +110,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="isDel != null">is_del = #{isDel},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="pictureAddress != null">picture_address = #{pictureAddress},</if>
</trim>
where site_station_id = #{siteStationId}
</update>
......
......@@ -84,6 +84,11 @@
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="设备id" align="center" prop="deviceId" />-->
<el-table-column label="照片" align="center" >
<template scope="List">
<img :src="List.row.iconUrl" width="100px">
</template>
</el-table-column>
<el-table-column label="设备名称" align="center" prop="deviceName" />
<el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="所在地址" align="center" prop="deviceAddr" />
......@@ -95,6 +100,18 @@
<span>{{ parseTime(scope.row.installationTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="照片" align="center" >
<template slot-scope="List">
<span
class="dbtn"
@click="checkFile(List.row.iconUrl)"
v-if="List.row.iconUrl != ''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -374,11 +391,15 @@
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="设备图片路径" prop="iconUrl">
<el-input v-model="form.iconUrl" type="textarea" placeholder="请输入图片路径" />
<el-form-item label="上传照片">
<FileUpload
listType="picture"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList">
</FileUpload>
</el-form-item>
</el-col>
</el-row>
......@@ -469,14 +490,17 @@
<script>
import { listDevice, getDevice, delDevice, addDevice, updateDevice, exportDevice, selectTEnterprise,getDdeviceDetailInfo,addDetailInfos,deleteDetailInfo,deleteeListDetailInfo,selectDetailInfoList,deleteDeviceDetailInfo,updateDetailInfoLists} from "@/api/regulation/device";
import GetPos from '@/components/GetPos';
import { EditorMap } from "@/utils/mapClass/getPath.js";
import FileUpload from '@/components/FileSuperviseUpload';
export default {
name: "Device",
components: {
GetPos
GetPos,
FileUpload,
},
data() {
return {
//头像
fileList: [],
/**弹出层*/
//下级设备数据数组
tableData: [],
......@@ -613,6 +637,24 @@ export default {
this.getList();
},
methods: {
/**上传头像*/
getFileInfo(res){
this.form.dealPlan = res.fileName;
this.form.iconUrl = res.url;
this.form.burl=res.burl;
this.fileList.push({
name: res.fileName,
url: uploadfile,
burl:res.burl,
});
},
checkFile(url) {
window.open(url,'_blank');
},
listRemove(e) {
this.form.dealPlan = "";
this.fileList = [];
},
/** 查询设备信息列表 */
getList() {
......@@ -640,6 +682,7 @@ export default {
cancel() {
this.open = false;
this.reset();
this.fileList = [];
},
// 表单重置
reset() {
......@@ -748,6 +791,13 @@ export default {
getDevice(deviceId).then(response => {
this.form = response.data;
//图片回显
if (this.form.iconUrl) {
this.fileList.push({
name: '照片',
url: this.form.iconUrl,
});
}
this.open = true;
this.title = "修改设备信息";
this.devicePos = [response.data.longitude, response.data.latitude];
......@@ -987,3 +1037,20 @@ export default {
}
};
</script>
<style>
.dbtn {
display: inline-block;
line-height: normal;
padding-left: 2px;
padding-right: 2px;
cursor: pointer;
border-radius: 3px;
border-style: solid;
border-width: 0;
color: rgb(48, 180, 107);
}
.dbtn:hover {
border-width: 1px;
border-color: rgb(48, 180, 107);
}
</style>
......@@ -83,6 +83,11 @@
<el-table v-loading="loading" :data="stationList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="照片" align="center" >
<template scope="List">
<img :src="List.row.pictureAddress" width="100px">
</template>
</el-table-column>
<el-table-column label="场站类型" align="center" prop="siteStationType" />
<el-table-column label="场站名称" align="center" prop="siteStationName" />
<el-table-column label="建设年代" align="center" prop="buildDate" width="180">
......@@ -96,6 +101,18 @@
<el-table-column label="经度" align="center" prop="longitude" />
<el-table-column label="纬度" align="center" prop="latitude" />
<el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="照片" align="center" >
<template slot-scope="List">
<span
class="dbtn"
@click="checkFile(List.row.pictureAddress)"
v-if="List.row.pictureAddress != ''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
......@@ -169,6 +186,7 @@
</el-form-item>
</el-col>
</el-row>
<!-- <el-form-item label="权属单位" prop="beyondEnterpriseId">-->
<!-- <el-input v-model="form.beyondEnterpriseId" placeholder="请输入权属单位" />-->
<!-- </el-form-item>-->
......@@ -206,6 +224,19 @@
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="上传照片">
<FileUpload
listType="picture"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList">
</FileUpload>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="22">
<el-form-item label="场站名称" prop="siteStationName">
......@@ -411,13 +442,17 @@
import { listStation, getStation, delStation, addStation, updateStation, exportStation ,selectTEnterprise} from "@/api/regulation/station";
import { getDdeviceDetailInfo,addDetailInfos,deleteDetailInfo,deleteeListDetailInfo,selectDetailInfoList,deleteDeviceDetailInfo,updateDetailInfoLists} from "@/api/regulation/device";
import GetPos from '@/components/GetPos';
import FileUpload from '@/components/FileSuperviseUpload';
export default {
name: "Station",
components: {
GetPos
GetPos,
FileUpload,
},
data() {
return {
//头像
fileList: [],
/**-------------------弹出框所用数据-------------------------------*/
//下级设备数据数组
tableData: [],
......@@ -524,6 +559,25 @@ export default {
});
},
methods: {
/**上传头像*/
getFileInfo(res){
this.form.dealPlan = res.fileName;
this.form.pictureAddress = res.url;
this.form.burl=res.burl;
this.fileList.push({
name: res.fileName,
url: uploadfile,
burl:res.burl,
});
},
checkFile(url) {
window.open(url,'_blank');
},
listRemove(e) {
this.form.dealPlan = "";
this.fileList = [];
},
/** 查询场站信息列表 */
getList() {
this.loading = true;
......@@ -541,6 +595,7 @@ export default {
cancel() {
this.open = false;
this.reset();
this.fileList = [];
},
// 表单重置
reset() {
......@@ -561,6 +616,7 @@ export default {
isDel: null,
remarks: null,
relationDeviceType:'2',
pictureAddress:null,
};
this.resetForm("form");
},
......@@ -623,6 +679,13 @@ export default {
getStation(siteStationId).then(response => {
this.form = response.data;
this.open = true;
//图片回显
if (this.form.pictureAddress) {
this.fileList.push({
name: '照片',
url: this.form.pictureAddress,
});
}
this.title = "修改场站信息";
this.devicePos = [response.data.longitude, response.data.latitude];
});
......@@ -906,3 +969,20 @@ export default {
}
};
</script>
<style>
.dbtn {
display: inline-block;
line-height: normal;
padding-left: 2px;
padding-right: 2px;
cursor: pointer;
border-radius: 3px;
border-style: solid;
border-width: 0;
color: rgb(48, 180, 107);
}
.dbtn:hover {
border-width: 1px;
border-color: rgb(48, 180, 107);
}
</style>
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