Commit 04e58e9c authored by 王晓倩's avatar 王晓倩

Merge remote-tracking branch 'origin/master'

parents 2be046af 0e4218dd
...@@ -106,6 +106,7 @@ ...@@ -106,6 +106,7 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!--<el-table-column label="事件id" align="center" prop="eventId" />--> <!--<el-table-column label="事件id" align="center" prop="eventId" />-->
<el-table-column label="事件名称" align="center" prop="eventTitle" /> <el-table-column label="事件名称" align="center" prop="eventTitle" />
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseName" />
<el-table-column label="事件类型" align="center" prop="eventType" :formatter="eventTypeFormat" /> <el-table-column label="事件类型" align="center" prop="eventType" :formatter="eventTypeFormat" />
<el-table-column label="事件等级" align="center" prop="eventLevel" :formatter="eventLevelFormat" /> <el-table-column label="事件等级" align="center" prop="eventLevel" :formatter="eventLevelFormat" />
<el-table-column label="事件地点" align="center" prop="eventLocation" /> <el-table-column label="事件地点" align="center" prop="eventLocation" />
...@@ -117,7 +118,6 @@ ...@@ -117,7 +118,6 @@
<el-table-column label="报案人" align="center" prop="reportPerson" /> <el-table-column label="报案人" align="center" prop="reportPerson" />
<el-table-column label="事件处置信息" align="center" prop="eventDeal" /> <el-table-column label="事件处置信息" align="center" prop="eventDeal" />
<el-table-column label="事件评估信息" align="center" prop="eventAssessment" /> <el-table-column label="事件评估信息" align="center" prop="eventAssessment" />
<el-table-column label="所属企业" align="center" prop="beyondEnterpriseName" />
<el-table-column label="备注" align="center" prop="remarks" /> <el-table-column label="备注" align="center" prop="remarks" />
<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">
...@@ -155,7 +155,7 @@ ...@@ -155,7 +155,7 @@
/> />
<!-- 添加或修改事件处置对话框 --> <!-- 添加或修改事件处置对话框 -->
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<div class="division"> <div class="division">
<div style="width: 45%"> <div style="width: 45%">
...@@ -185,21 +185,7 @@ ...@@ -185,21 +185,7 @@
<el-form-item label="事件地点" prop="eventLocation"> <el-form-item label="事件地点" prop="eventLocation">
<el-input v-model="form.eventLocation" placeholder="请输入事件地点" :disabled="readonly"/> <el-input v-model="form.eventLocation" placeholder="请输入事件地点" :disabled="readonly"/>
</el-form-item> </el-form-item>
<el-form-item label="图片上传" prop="iconUrl">
<el-upload
:action="uploadImgUrl"
list-type="picture-card"
:on-preview="handlePictureCardPreview"
:on-success ="uploadsuccess"
:on-remove="handleRemove"
:file-list="fileList">
<i class="el-icon-plus"></i>
</el-upload>
<el-dialog :visible.sync="dialogVisible">
<img width="100%" :src="dialogImageUrl" alt="">
</el-dialog>
<!--<el-input v-model="form.iconUrl" type="textarea" placeholder="请输入内容" />-->
</el-form-item>
</div> </div>
<div style="width: 50%"> <div style="width: 50%">
<el-form-item label="所属企业" prop="beyondEnterpriseId"> <el-form-item label="所属企业" prop="beyondEnterpriseId">
...@@ -236,8 +222,27 @@ ...@@ -236,8 +222,27 @@
<el-form-item label="事件评估信息" prop="eventAssessment" style="width: 60%"> <el-form-item label="事件评估信息" prop="eventAssessment" style="width: 60%">
<el-input v-model="form.eventAssessment" type="textarea" placeholder="请输入事件评估信息" :disabled="readonly"/> <el-input v-model="form.eventAssessment" type="textarea" placeholder="请输入事件评估信息" :disabled="readonly"/>
</el-form-item> </el-form-item>
<el-form-item label="事件附件" prop="iconUrl" :style="display" >
<FileUpload
listType="picture"
@resFun="getFileInfo"
@remove="listRemove"
:fileArr="fileList"
style="width: 70%"
/>
<el-input v-show="false" disabled v-model="form.iconUrl"></el-input>
<!--<el-input v-model="form.iconUrl" type="textarea" placeholder="请输入内容" />-->
</el-form-item>
<el-form-item label="事件附件" prop="iconUrl" :style="display1">
<span
class="dbtn"
@click="checkFile(form.iconUrl)"
v-if="form.iconUrl != ''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
</el-form-item>
<!--<el-form-item label="所属企业名称" prop="beyondEnterpriseName">--> <!--<el-form-item label="所属企业名称" prop="beyondEnterpriseName">-->
<!--<el-input v-model="form.beyondEnterpriseName" placeholder="请输入所属企业名称" />--> <!--<el-input v-model="form.beyondEnterpriseName" placeholder="请输入所属企业名称" />-->
<!--</el-form-item>--> <!--</el-form-item>-->
...@@ -255,10 +260,12 @@ ...@@ -255,10 +260,12 @@
<script> <script>
import { listEventInfo, getEventInfo, delEventInfo, addEventInfo, updateEventInfo, exportEventInfo ,enterpriseList} from "@/api/system/eventInfo"; import { listEventInfo, getEventInfo, delEventInfo, addEventInfo, updateEventInfo, exportEventInfo ,enterpriseList} from "@/api/system/eventInfo";
import FileUpload from '@/components/FileUpload';
let uploadfile = require("@/assets/uploadfile.png");
export default { export default {
name: "EventInfo", name: "EventInfo",
components: { components: {
FileUpload
}, },
data() { data() {
return { return {
...@@ -284,10 +291,10 @@ export default { ...@@ -284,10 +291,10 @@ export default {
enterpriseList:[], enterpriseList:[],
// 弹出层标题 // 弹出层标题
title: "", title: "",
display:"",
display1:"display:none",
// 是否显示弹出层 // 是否显示弹出层
open: false, open: false,
dialogImageUrl: '',
dialogVisible: false,
fileList:[], fileList:[],
// 事件类型:1.泄漏 2.火灾 3.爆炸字典 // 事件类型:1.泄漏 2.火灾 3.爆炸字典
eventTypeOptions: [], eventTypeOptions: [],
...@@ -356,20 +363,20 @@ export default { ...@@ -356,20 +363,20 @@ export default {
}); });
}, },
//上传 //上传
handleRemove(file, fileList) { getFileInfo(res){
//console.log(file, fileList); //this.form.dealPlan = res.fileName;
document.getElementsByClassName("el-upload")[0].style.display="" this.form.iconUrl = res.url;
this.fileList.push({
name: res.fileName,
url: uploadfile,
});
}, },
uploadsuccess(response){ listRemove(e) {
this.form.iconUrl=response.url; this.form.dealPlan = "";
console.log(document.getElementsByClassName("el-upload")[0]) this.fileList = [];
this.$nextTick(()=>{
document.getElementsByClassName("el-upload")[0].style.display="none"
})
}, },
handlePictureCardPreview(file) { checkFile(url) {
this.dialogImageUrl = file.url; window.open(url,'_blank');
this.dialogVisible = true;
}, },
qiyechang(value){ qiyechang(value){
let obj = {}; let obj = {};
...@@ -440,9 +447,8 @@ export default { ...@@ -440,9 +447,8 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加事件处置"; this.title = "添加事件处置";
this.$nextTick(()=>{ this.display="";
document.getElementsByClassName("el-upload")[0].style.display="" this.display1="display:none";
})
}, },
handleDtail(row){ handleDtail(row){
this.fileList = []; this.fileList = [];
...@@ -454,9 +460,10 @@ export default { ...@@ -454,9 +460,10 @@ export default {
this.form = response.data; this.form = response.data;
this.title = "修改事件处置"; this.title = "修改事件处置";
if(row.iconUrl!=null){ if(row.iconUrl!=null){
this.fileList = [{name: 'file', url: row.iconUrl}]; this.fileList = [{name: '附件', url: uploadfile}];
} }
document.getElementsByClassName("el-upload")[0].style.display="none" this.display="display:none";
this.display1="";
}); });
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
...@@ -470,11 +477,10 @@ export default { ...@@ -470,11 +477,10 @@ export default {
this.open = true; this.open = true;
this.title = "修改事件处置"; this.title = "修改事件处置";
if(row.iconUrl!=null){ if(row.iconUrl!=null){
this.fileList = [{name: 'file', url: row.iconUrl}]; this.fileList = [{name: '附件', url: uploadfile}];
this.$nextTick(()=>{
document.getElementsByClassName("el-upload")[0].style.display="none"
})
} }
this.display="";
this.display1="display:none";
}); });
}, },
/** 提交按钮 */ /** 提交按钮 */
...@@ -535,6 +541,17 @@ export default { ...@@ -535,6 +541,17 @@ export default {
flex-direction:row; flex-direction:row;
justify-content:flex-start; justify-content:flex-start;
} }
.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);
}
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .el-select{ ::v-deep .el-select{
......
...@@ -97,11 +97,23 @@ ...@@ -97,11 +97,23 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<!--<el-table-column label="预案id" align="center" prop="planId" />--> <!--<el-table-column label="预案id" align="center" prop="planId" />-->
<el-table-column label="预案标题" align="center" prop="planTitle" /> <el-table-column label="预案标题" align="center" prop="planTitle" />
<el-table-column label="所属企业名称" align="center" prop="beyondEnterpriseName" />
<el-table-column label="预案类型" align="center" prop="planType" :formatter="planTypeFormat"/> <el-table-column label="预案类型" align="center" prop="planType" :formatter="planTypeFormat"/>
<el-table-column label="预案等级" align="center" prop="planLevel" :formatter="planLevelFormat"/> <el-table-column label="预案等级" align="center" prop="planLevel" :formatter="planLevelFormat"/>
<el-table-column label="所属企业名称" align="center" prop="beyondEnterpriseName" /> <!--<el-table-column label="应急方案" align="center" prop="planContents" />-->
<el-table-column label="应急方案" align="center" prop="planContents" />
<el-table-column label="应急设备及车辆" align="center" prop="planEquipment" /> <el-table-column label="应急设备及车辆" align="center" prop="planEquipment" />
<el-table-column label="方案附件" align="center" prop="dealPlanUrl" width="150px">
<template slot-scope="scope">
<span
class="dbtn"
@click="checkFile(scope.row.iconUrl)"
v-if="scope.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" prop="createTime" width="180"> <el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span> <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
...@@ -147,6 +159,7 @@ ...@@ -147,6 +159,7 @@
<el-form ref="form" :model="form" :rules="rules" label-width="100px"> <el-form ref="form" :model="form" :rules="rules" label-width="100px">
<div class="division"> <div class="division">
<div style="width: 40%;"> <div style="width: 40%;">
<div class="titletitle">预案基本信息</div>
<el-form-item label="预案标题" prop="planTitle" > <el-form-item label="预案标题" prop="planTitle" >
<el-input v-model="form.planTitle" placeholder="请输入预案标题" :disabled="readonly"/> <el-input v-model="form.planTitle" placeholder="请输入预案标题" :disabled="readonly"/>
</el-form-item> </el-form-item>
...@@ -187,31 +200,37 @@ ...@@ -187,31 +200,37 @@
<el-input v-model="form.remarks" placeholder="请输入备注" :disabled="readonly" /> <el-input v-model="form.remarks" placeholder="请输入备注" :disabled="readonly" />
</el-form-item> </el-form-item>
<el-form-item label="预案附件" id="fujian" prop="iconUrl"> <el-form-item label="预案附件" id="fujian" prop="iconUrl">
<el-upload <FileUpload
:action="uploadImgUrl" listType="picture"
list-type="picture-card" @resFun="getFileInfo"
:on-success ="uploadsuccess" @remove="listRemove"
:on-remove="handleRemove" :fileArr="fileList"
:file-list="fileList"> />
<i class="el-icon-plus"></i> <el-input v-show="false" disabled v-model="form.iconUrl"></el-input>
<!--<div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>-->
</el-upload>
<!--<el-dialog :visible.sync="dialogVisible">--> <!--<el-dialog :visible.sync="dialogVisible">-->
<!--<img width="100%" :src="dialogImageUrl" alt="">--> <!--<img width="100%" :src="dialogImageUrl" alt="">-->
<!--</el-dialog>--> <!--</el-dialog>-->
</el-form-item> </el-form-item>
<el-form-item label="预案附件" id="fujianxia" prop="iconUrl" style="display: none"> <el-form-item label="预案附件" id="fujianxia" prop="iconUrl" style="display: none">
<a @click="downloadFile" style="color: blue">下载附件>></a> <span
class="dbtn"
@click="checkFile(form.iconUrl)"
v-if="form.iconUrl != ''"
>
<i class="el-icon el-icon-view"></i>查看/下载
</span>
<span v-else>-</span>
<!--<el-input v-model="fileurl" placeholder="" />--> <!--<el-input v-model="fileurl" placeholder="" />-->
</el-form-item> </el-form-item>
</div> </div>
<div style="width: 60%;"> <div style="width: 58%;margin-left: 2%">
<el-form-item label="应急方案" prop="planContents"> <div class="titletitle">方案内容</div>
<!--<el-form-item label="应急方案" prop="planContents">-->
<!--<el-input v-model="form.planContents" placeholder="" />--> <!--<el-input v-model="form.planContents" placeholder="" />-->
<editor v-model="form.planContents" style="height: 300px;" :readOnly="readonly"/> <editor v-model="form.planContents" style="height: 300px;" :readOnly="readonly"/>
<!--<textarea id="editorA" v-model="form.planContents" height="100%"></textarea>--> <!--<textarea id="editorA" v-model="form.planContents" height="100%"></textarea>-->
</el-form-item> <!--</el-form-item>-->
</div> </div>
</div> </div>
...@@ -235,14 +254,15 @@ ...@@ -235,14 +254,15 @@
<script> <script>
import { listPlanInfo, getPlanInfo, delPlanInfo, addPlanInfo, updatePlanInfo, exportPlanInfo,enterpriseList } from "@/api/system/planInfo"; import { listPlanInfo, getPlanInfo, delPlanInfo, addPlanInfo, updatePlanInfo, exportPlanInfo,enterpriseList } from "@/api/system/planInfo";
import Editor from '@/components/Editor'; import Editor from '@/components/Editor';
import FileUpload from '@/components/FileUpload';
let uploadfile = require("@/assets/uploadfile.png");
export default { export default {
name: "PlanInfo", name: "PlanInfo",
components: { components: {
Editor Editor,FileUpload
}, },
data() { data() {
return { return {
uploadImgUrl: process.env.VUE_APP_BASE_API + "/common/upload", // 上传的图片服务器地址
// 遮罩层 // 遮罩层
loading: true, loading: true,
readonly: true, readonly: true,
...@@ -334,19 +354,21 @@ export default { ...@@ -334,19 +354,21 @@ export default {
this.form.beyondEnterpriseName = obj.enterpriseName; this.form.beyondEnterpriseName = obj.enterpriseName;
this.form.beyondEnterpriseId = value; this.form.beyondEnterpriseId = value;
}, },
//上传图片 //上传
uploadsuccess(response){ getFileInfo(res){
this.form.iconUrl=response.url; //this.form.dealPlan = res.fileName;
console.log(this.fileList) this.form.iconUrl = res.url;
//console.log(document.getElementsByClassName("el-upload--picture-card")) this.fileList.push({
document.getElementsByClassName("el-upload--picture-card")[0].style.display="none"; name: res.fileName,
url: uploadfile,
});
}, },
handleRemove(file, fileList) { listRemove(e) {
document.getElementsByClassName("el-upload--picture-card")[0].style.display=""; this.form.dealPlan = "";
this.fileList = [];
}, },
handlePictureCardPreview(file) { checkFile(url) {
this.dialogImageUrl = file.url; window.open(url,'_blank');
this.dialogVisible = true;
}, },
// 取消按钮 // 取消按钮
cancel() { cancel() {
...@@ -434,7 +456,7 @@ export default { ...@@ -434,7 +456,7 @@ export default {
this.form = response.data; this.form = response.data;
this.title = "应急预案详情"; this.title = "应急预案详情";
this.fileList = [{name: 'file', url: row.iconUrl}]; this.fileList = [{name: 'file', url:uploadfile}];
this.fileurl = row.iconUrl; this.fileurl = row.iconUrl;
document.getElementById("yesbutton").style.display="none" ; document.getElementById("yesbutton").style.display="none" ;
document.getElementById("fujian").style.display="none" document.getElementById("fujian").style.display="none"
...@@ -452,7 +474,7 @@ export default { ...@@ -452,7 +474,7 @@ export default {
this.open = true; this.open = true;
this.title = "修改应急预案"; this.title = "修改应急预案";
if(row.iconUrl!=null||row.iconUrl==""){ if(row.iconUrl!=null||row.iconUrl==""){
this.fileList = [{name: 'file', url: row.iconUrl}]; this.fileList = [{name: 'file', url:uploadfile}];
this.$nextTick(()=>{ this.$nextTick(()=>{
document.getElementsByClassName("el-upload--picture-card")[0].style.display="none" document.getElementsByClassName("el-upload--picture-card")[0].style.display="none"
document.getElementById("yesbutton").style.display="" ; document.getElementById("yesbutton").style.display="" ;
...@@ -530,6 +552,24 @@ export default { ...@@ -530,6 +552,24 @@ export default {
flex-direction:row; flex-direction:row;
justify-content:flex-start; justify-content:flex-start;
} }
.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);
}
.titletitle{
background: #1c84c6;
color: white;height:
20px;line-height:
20px;text-align: center;
margin-bottom: 10px;
}
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep .el-select{ ::v-deep .el-select{
......
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