|
@@ -0,0 +1,611 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="96px">
|
|
|
+ <el-form-item label="事件名称" prop="eventName">
|
|
|
+ <el-input v-model="queryParams.eventName" placeholder="请输入事件名称" clearable style="width: 240px"
|
|
|
+ @keyup.enter.native="handleQuery"/>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="上报时间" prop="reportTimeRange">
|
|
|
+ <el-date-picker v-model="queryParams.reportTimeRange" start-placeholder="开始日期" end-placeholder="结束日期"
|
|
|
+ clearable
|
|
|
+ type="daterange" range-separator="-" value-format="yyyy-MM-dd" style="width: 240px"
|
|
|
+ @keyup.enter.native="handleQuery"></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
|
|
+ <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <el-table v-loading="loading" :data="eventcatalogueList" @selection-change="handleSelectionChange">
|
|
|
+ <el-table-column label="事件名称" align="center" prop="eventName" width="150"/>
|
|
|
+ <el-table-column label="事件描述" align="center" prop="eventDescription" width="150"/>
|
|
|
+ <el-table-column label="事件一类" align="center" prop="eventTypeLabel"/>
|
|
|
+ <el-table-column label="事件二类" align="center" prop="eventTypeXlLabel"/>
|
|
|
+ <el-table-column label="事件来源" align="center" prop="reportSource">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <dict-tag :options="dict.type.reporting_source" :value="scope.row.reportSource"/>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="上报人" align="center" prop="reportor"/>
|
|
|
+ <el-table-column label="上报时间" align="center" prop="createTime" width="150"/>
|
|
|
+ <el-table-column label="上报具体位置" align="center" prop="address" width="150"/>
|
|
|
+ <el-table-column label="事件状态" align="center" prop="eventStatus"/>
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)"
|
|
|
+ v-hasPermi="['eventcatalogue:eventcatalogue:query']">详情
|
|
|
+ </el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-document" @click="handleEventLog(scope.row)"
|
|
|
+ v-hasPermi="['eventcatalogue:eventcatalogue:query']">事件日志
|
|
|
+ </el-button>
|
|
|
+ <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
|
+ v-hasPermi="['system:collect:remove']">取消收藏
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
|
|
+ @pagination="getList"/>
|
|
|
+ <!-- 事件日志列表 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="openLogSee" width="900px" append-to-body>
|
|
|
+ <div class="block">
|
|
|
+ <el-timeline :reverse="reverse">
|
|
|
+ <el-timeline-item
|
|
|
+ v-for="(activity, index) in activities"
|
|
|
+ :key="index"
|
|
|
+ :timestamp="activity.createTime" placement="top">
|
|
|
+ <div>
|
|
|
+ <span>{{ activity.createName }}</span>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ {{ activity.logContent }}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <router-link to="#"
|
|
|
+ @click.native="clickFile(itemfile.fileUrl,itemfile.fileName,itemfile.fileType)"
|
|
|
+ v-for="(itemfile,indexfile) in activity.fileVOs">
|
|
|
+ <el-image :src="itemfile.fileUrl" v-if="itemfile.fileType=='image'"
|
|
|
+ :preview-src-list="assetTypeAnImage(activity.fileVOs)"
|
|
|
+ style="width:3rem; height:3rem;margin: 2px;"
|
|
|
+ :title="itemfile.fileName">
|
|
|
+ </el-image>
|
|
|
+ <img v-else-if="itemfile.fileType=='video'"
|
|
|
+ style="width:3rem; height:3rem;margin: 2px;"
|
|
|
+ :src="require('@/assets/fileTypeImage/mp4.png')"
|
|
|
+ :title="itemfile.fileName">
|
|
|
+ <img v-else
|
|
|
+ style="width:3rem; height:3rem;margin: 2px;"
|
|
|
+ :src="require('@/assets/fileTypeImage/file.png')"
|
|
|
+ :title="itemfile.fileName">
|
|
|
+ </router-link>
|
|
|
+ </div>
|
|
|
+ </el-timeline-item>
|
|
|
+ </el-timeline>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 事件详情对话框 -->
|
|
|
+ <el-dialog :title="title" :visible.sync="openSee" width="600px" append-to-body>
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="106px">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="事件名称" prop="eventName">
|
|
|
+ <el-input v-model="form.eventName" placeholder="请输入事件名称" :disabled="findView"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="事件描述" prop="eventDescription">
|
|
|
+ <el-input v-model="form.eventDescription" placeholder="请输入事件描述" type="textarea"
|
|
|
+ :disabled="findView"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="事件一类" prop="eventType">
|
|
|
+ <el-select v-model="form.eventType" placeholder="请选择事件一类" @change="detailflValue"
|
|
|
+ :disabled="findView">
|
|
|
+ <el-option v-for="dict in eventTypeList" :key="dict.id" :label="dict.eventTypeName"
|
|
|
+ :value="dict.id"/>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="事件二类" prop="eventTypeXl">
|
|
|
+ <el-select v-model="form.eventTypeXl" placeholder="请选择事件二类" @change="hgjValue"
|
|
|
+ :disabled="findView">
|
|
|
+ <el-option v-for="dict in eventTypeRlList" :key="dict.id" :label="dict.eventTypeName"
|
|
|
+ :value="dict.id"/>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="经度" prop="longitude" @dblclick.native="showMap">
|
|
|
+ <el-input v-model="form.longitude" placeholder="请输入经度"
|
|
|
+ @input="form.longitude=formatDecimal(form.longitude,50)" :disabled="findView"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="纬度" prop="latitude" @dblclick.native="showMap">
|
|
|
+ <el-input v-model="form.latitude" placeholder="请输入纬度"
|
|
|
+ @input="form.latitude=formatDecimal(form.latitude,50)" :disabled="findView"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="火灾半径" prop="fireRadius">
|
|
|
+ <el-input v-model="form.fireRadius" placeholder="请输入火灾半径" type="number" :disabled="findView"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="关联预案" prop="reserve">
|
|
|
+ <el-select v-model="form.reserve" placeholder="请选择关联预案" clearable :disabled="findView">
|
|
|
+ <el-option v-for="dict in reserveList" :key="dict.id" :label="dict.resTitle"
|
|
|
+ :value="dict.id"/>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="12" style="display: none">
|
|
|
+ <el-form-item label="行管局" prop="hgjDeptName">
|
|
|
+ <el-select v-model="form.hgjDeptName" placeholder="请选择行管局" clearable @change="hxKey"
|
|
|
+ :disabled="findView">
|
|
|
+ <el-option v-for="dict in hgjList" :key="dict.deptId" :label="dict.deptName"
|
|
|
+ :value="{key:dict.deptId,value:dict.deptName}"/>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="所属部门" prop="deptName">
|
|
|
+ <el-input v-model="form.deptName" :disabled="findView"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="上报具体位置" prop="address">
|
|
|
+ <el-input v-model="form.address" placeholder="请输入上报具体位置" :disabled="findView"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-form-item label="附件">
|
|
|
+ <!-- 遍历 form.attachId,显示图片附件 -->
|
|
|
+ <div v-for="item in form.attachId" class="attachment-item">
|
|
|
+ <el-image :src="item.attachPath" style="width:150px;height:150px;"
|
|
|
+ :preview-src-list="[item.attachPath]"/>
|
|
|
+ </div>
|
|
|
+ <!-- 遍历 filevedioList,显示视频文件并添加点击播放功能 -->
|
|
|
+ <div v-for="(item, index) in filevedioList" class="attachment-item"
|
|
|
+ style="display: inline-block; margin-right: 10px;">
|
|
|
+ <!-- 添加点击视频弹窗播放的功能 -->
|
|
|
+ <router-link to="#" @click.native="clickFile(item.attachPath, item.fileName, 'video')">
|
|
|
+ <!-- 使用 el-image 显示视频封面图 -->
|
|
|
+ <el-image v-if="item.fileType === 'video'" :src="require('@/assets/fileTypeImage/mp4.png')"
|
|
|
+ style="width:150px;height:150px;"></el-image>
|
|
|
+ <!-- 其他文件类型的处理 -->
|
|
|
+ <span v-else>{{ item.fileName }}</span>
|
|
|
+ </router-link>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="cancel">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ <!-- 图片,视频预览 -->
|
|
|
+ <el-dialog title="视频预览" :visible.sync="showTcPlayer" width="40%" customClass="customWidthMp4">
|
|
|
+ <TcPlayer ref="TcPlayer" :playVideo="playVideo" :widthHeigt="[100,100]"></TcPlayer>
|
|
|
+ </el-dialog>
|
|
|
+ <el-dialog title="" :visible.sync="showLongitude" append-to-body>
|
|
|
+ <el-input v-show="false" v-model="form.longitude"/>
|
|
|
+ <el-input v-show="false" v-model="form.latitude"/>
|
|
|
+ <Supermap style="width: 100%;height: 500px;" :mapDiv="'eventcatalogueSuperMap'" :mapSite="{doubleClickZoom:false}"
|
|
|
+ :codes="['9fa5']" :isSideBySide="false" :showLatLng="showLatLng"></Supermap>
|
|
|
+ <el-button type="primary" @click="showLongitude=false">确定</el-button>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import {
|
|
|
+ getEventcatalogue,
|
|
|
+ listcentereventtfirelog,
|
|
|
+ listHgjXl,
|
|
|
+ listSJfl,
|
|
|
+ listYuAn
|
|
|
+} from "@/api/event/eventcatalogue/eventcatalogue";
|
|
|
+import {listCollect, delCollect} from "@/api/event/collect/collect";
|
|
|
+import {eventhandleDownload} from "@/api/event/downloads/downloads";
|
|
|
+import {getConfigKey} from "@/api/system/config";
|
|
|
+import {listByParentId} from "@/api/event/eventtypemonitor/eventtypemonitor";
|
|
|
+import Deptselector from '@/views/components/deptselector';
|
|
|
+import FileUpload from '@/views/components/FileUpload/index';
|
|
|
+import Supermap from '@/views/components/supermap';
|
|
|
+import TcPlayer from '@/components/TcPlayer'; // 视频预览
|
|
|
+export default {
|
|
|
+ name: "Eventcatalogue",
|
|
|
+ components: {Deptselector, FileUpload, Supermap, TcPlayer},
|
|
|
+ dicts: ['reporting_source', 'forest_event_status', 'sys_isurge'],
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ srcList: [],
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 显示新增按钮
|
|
|
+ addBtn: false,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ reportSources: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 事件目录表格数据
|
|
|
+ eventcatalogueList: [],
|
|
|
+ eventfireLogList: [],
|
|
|
+ // 新增弹窗下拉列表
|
|
|
+ eventTypeList: [],
|
|
|
+ eventTypeRlList: [],
|
|
|
+ hgjList: [],
|
|
|
+ reserveList: [],
|
|
|
+ eventCode: null,
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ openSee: false,
|
|
|
+ detailSee: true,
|
|
|
+ // 是否禁用弹出层表单
|
|
|
+ findView: false,
|
|
|
+ showLongitude: false,
|
|
|
+ fileList: [],
|
|
|
+ filevedioList: [],
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ fileNames: [],
|
|
|
+ openLogSee: false,
|
|
|
+ reverse: false,
|
|
|
+ activities: [],
|
|
|
+ showTcPlayer: false,//视频预览弹窗
|
|
|
+ playVideo: '',//视频预览地址
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ defaultTypeXl: [],
|
|
|
+ eventName: undefined,
|
|
|
+ reportSource: undefined,
|
|
|
+ reportor: undefined,
|
|
|
+ reportTimeRange: null,
|
|
|
+ isUrged: undefined,
|
|
|
+ eventStatusValue: undefined,
|
|
|
+ eventTypeXls: []
|
|
|
+ },
|
|
|
+ // 表单校验
|
|
|
+ rules: {},
|
|
|
+ esflag: false,
|
|
|
+ defaultTypeXl: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ if (this.$route.query.pid == '') {
|
|
|
+ this.addBtn = true;
|
|
|
+ }
|
|
|
+ this.getList();
|
|
|
+ listYuAn().then(response => {
|
|
|
+ this.reserveList = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getNowTime() {
|
|
|
+ var now = new Date();
|
|
|
+ var year1 = now.getFullYear(); //得到年份
|
|
|
+ var month1 = now.getMonth(); //得到月份
|
|
|
+ var date1 = now.getDate(); //得到日期
|
|
|
+ month1 = month1 + 1;
|
|
|
+ month1 = month1.toString().padStart(2, "0");
|
|
|
+ date1 = date1.toString().padStart(2, "0");
|
|
|
+ now.setTime(now.getTime() + 24 * 60 * 60 * 1000); //得到明日
|
|
|
+ var year2 = now.getFullYear(); //得到年份
|
|
|
+ var month2 = now.getMonth(); //得到月份
|
|
|
+ var date2 = now.getDate(); //得到日期
|
|
|
+ month2 = month2 + 1;
|
|
|
+ month2 = month2.toString().padStart(2, "0");
|
|
|
+ date2 = date2.toString().padStart(2, "0");
|
|
|
+ return [`${year1}-${month1}-${date1}`, `${year1}-${month1}-${date1}`];
|
|
|
+ },
|
|
|
+ getUrl(url) {
|
|
|
+ this.form.fileUrl = url;
|
|
|
+ },
|
|
|
+ clickFile(fileUrl, fileName, fileType) {
|
|
|
+ console.log(this.filevedioList)
|
|
|
+ if (fileType == 'image') {
|
|
|
+ return
|
|
|
+ } else if (fileType == 'video') {
|
|
|
+ this.showTcPlayer = true
|
|
|
+ setTimeout(() => {
|
|
|
+ this.playVideo = fileUrl
|
|
|
+ }, 500)
|
|
|
+ } else {
|
|
|
+ let a = document.createElement('a')
|
|
|
+ a.download = fileName
|
|
|
+ a.href = fileUrl
|
|
|
+ a.target = '_blank'
|
|
|
+ a.click()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.reportSources = selection.map(item => item.reportSource)
|
|
|
+ this.single = selection.length !== 1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ // 返回图片列表
|
|
|
+ assetTypeAnImage(filePath) {
|
|
|
+ let imageList = []
|
|
|
+ if (filePath != null && filePath.length > 0) {
|
|
|
+ for (let i = 0; i < filePath.length; i++) {
|
|
|
+ if (filePath[i].fileType == 'image') {
|
|
|
+ imageList.push(filePath[i].fileUrl)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return imageList
|
|
|
+ },
|
|
|
+ setDataDeptId(e) {
|
|
|
+ this.form.deptId = e;
|
|
|
+ this.form.deptName = this.$refs["deptselector"].selectList.filter((item) => {
|
|
|
+ return e == item.deptId;
|
|
|
+ })[0].deptName;
|
|
|
+ },
|
|
|
+ showMap() {
|
|
|
+ this.showLongitude = true;
|
|
|
+ },
|
|
|
+ showLatLng(lat, lng) {
|
|
|
+ this.form.latitude = lat;
|
|
|
+ this.form.longitude = lng;
|
|
|
+ },
|
|
|
+ /** 查询事件目录列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listCollect(this.queryParams).then(response => {
|
|
|
+ this.eventcatalogueList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.openSee = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ dataStatus: "0",
|
|
|
+ eventName: undefined,
|
|
|
+ eventDescription: undefined,
|
|
|
+ eventType: undefined,
|
|
|
+ eventTypeXl: undefined,
|
|
|
+ hgjDeptId: undefined,
|
|
|
+ hgjDeptName: undefined,
|
|
|
+ deptId: undefined,
|
|
|
+ deptName: undefined,
|
|
|
+ longitude: undefined,
|
|
|
+ latitude: undefined,
|
|
|
+ fireRadius: undefined,
|
|
|
+ reserve: undefined,
|
|
|
+ address: undefined,
|
|
|
+ fileUrl: undefined,
|
|
|
+ fileName: undefined,
|
|
|
+ eventTypeXlName: undefined,
|
|
|
+ attach: []
|
|
|
+ };
|
|
|
+ this.fileNames = [];
|
|
|
+ this.fileList = [];
|
|
|
+ this.filevedioList = [];
|
|
|
+ this.resetForm("form");
|
|
|
+ },
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ console.log(row.id)
|
|
|
+ this.$modal.confirm('是否确认取消收藏所选数据?').then(function () {
|
|
|
+ return delCollect(row.id);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("取消成功");
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport(row) {
|
|
|
+ this.download('center-event/eventcatalogue/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `eventcatalogue_${new Date().getTime()}.xlsx`)
|
|
|
+ },
|
|
|
+ handleDownload(row) {
|
|
|
+ if (this.reportSources != 'reporting_source_1') {
|
|
|
+ this.$modal.alertWarning("只允许摄像头上报的可以下载!")
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ const id = row.id || this.ids
|
|
|
+ eventhandleDownload(id).then(response => {
|
|
|
+ if (response.data.code == 200) {
|
|
|
+ this.$modal.msgSuccess("下载成功");
|
|
|
+ } else {
|
|
|
+ if (response.data.msg == null) {
|
|
|
+ response.data.msg = "下载失败";
|
|
|
+ }
|
|
|
+ this.$modal.msgError(response.data.msg);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ flValue() {
|
|
|
+ listSJfl({parentId: this.form.eventType}).then(response => {
|
|
|
+ this.form.eventTypeXl = undefined;
|
|
|
+ this.form.hgjDeptName = undefined;
|
|
|
+ this.eventTypeRlList = response.data;
|
|
|
+ this.hgjList = [];
|
|
|
+ });
|
|
|
+ },
|
|
|
+ detailflValue() {
|
|
|
+ listSJfl({parentId: this.form.eventType}).then(response => {
|
|
|
+ this.form.hgjDeptName = undefined;
|
|
|
+ this.eventTypeRlList = response.data;
|
|
|
+ this.hgjList = [];
|
|
|
+ });
|
|
|
+ },
|
|
|
+ hgjValue() {
|
|
|
+ listHgjXl({eventTypeValue: this.form.eventTypeXl}).then(response => {
|
|
|
+ this.form.hgjDeptName = undefined;
|
|
|
+ this.hgjList = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ hxKey(selVal) {
|
|
|
+ this.form.hgjDeptId = selVal.key;
|
|
|
+ this.form.hgjDeptName = selVal.value;
|
|
|
+ },
|
|
|
+ formatDecimal(str, num) { //str当前输入值,num是想要保留的小数位数
|
|
|
+ str = String(str)
|
|
|
+ if (!str.trim()) {
|
|
|
+ return str;
|
|
|
+ }
|
|
|
+ var len1 = str.substr(0, 1);
|
|
|
+ var len2 = str.substr(1, 1);
|
|
|
+ // 如果第一位是0,第二位不是点,就用数字把点替换掉
|
|
|
+ if (str.length > 1 && len1 === 0 && len2 !== '.') {
|
|
|
+ str = str.substr(1, 1);
|
|
|
+ }
|
|
|
+ // 第一位不能是.
|
|
|
+ if (len1 === '.') {
|
|
|
+ str = '';
|
|
|
+ }
|
|
|
+ // 限制只能输入一个小数点
|
|
|
+ if (str.indexOf('.') !== -1) {
|
|
|
+ var str_ = str.substr(str.indexOf('.') + 1);
|
|
|
+ if (str_.indexOf('.') !== -1) {
|
|
|
+ str = str.substr(0, str.indexOf('.') + str_.indexOf('.') + 1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 正则替换
|
|
|
+ str = str.replace(/[^\d^.]+/g, '') // 保留数字和小数点
|
|
|
+ if (num || num === 0) {
|
|
|
+ var rest = str.split('.')[1];
|
|
|
+ if (rest && rest.length > num) {
|
|
|
+ rest = rest.substr(0, num)
|
|
|
+ str = str.split('.')[0] + '.' + rest;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return str;
|
|
|
+ },
|
|
|
+ //小数点校验
|
|
|
+ xsd(str) {
|
|
|
+ str = str.toString()
|
|
|
+ if (str.indexOf(".") == -1) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ if (str.indexOf(".") == str.length - 1) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ setFileName(fileName) {
|
|
|
+ let that = this;
|
|
|
+ that.fileNames.push(fileName);
|
|
|
+ },
|
|
|
+ removeFileName(index) {
|
|
|
+ let that = this;
|
|
|
+ that.fileNames.splice(index, 1);
|
|
|
+ let fileurls = that.form.fileUrl.split(",");
|
|
|
+ fileurls.splice(index, 1);
|
|
|
+ that.form.fileUrl = fileurls.toString();
|
|
|
+ },
|
|
|
+ /** 详情按钮操作 */
|
|
|
+ handleDetail(row) {
|
|
|
+ this.findView = true;
|
|
|
+ this.reset();
|
|
|
+ this.srcList = []
|
|
|
+ this.detailSee = true
|
|
|
+ const id = row.id || this.ids
|
|
|
+ getEventcatalogue(id).then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ const list = response.data.attach;
|
|
|
+ if (list.length == 0) {
|
|
|
+ this.detailSee = false;
|
|
|
+ }
|
|
|
+ for (let i = 0; i < list.length; i++) {
|
|
|
+ this.$set(list[i], "url", list[i].attachPath)
|
|
|
+ }
|
|
|
+ list.forEach(e => {
|
|
|
+ if (e.fileType == 'video') {
|
|
|
+ this.filevedioList.push(e);
|
|
|
+ } else {
|
|
|
+ this.fileList.push(e);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.form.attachId = this.fileList;
|
|
|
+ this.srcList = this.form.attachId.map(a => a.url)
|
|
|
+ this.detailflValue()
|
|
|
+ listSJfl({parentId: 0}).then(response => {
|
|
|
+ this.eventTypeList = response.data;
|
|
|
+ });
|
|
|
+ this.openSee = true;
|
|
|
+ this.submit = false;
|
|
|
+ this.title = "事件详情";
|
|
|
+ });
|
|
|
+ },
|
|
|
+ load() {
|
|
|
+ this.reset();
|
|
|
+ listcentereventtfirelog({eventCode: this.eventCode}).then(response => {
|
|
|
+ this.openLogSee = true;
|
|
|
+ this.title = "事件日志列表";
|
|
|
+ that.eventfireLogList = res.data.eventlog
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 详情日志按钮操作 */
|
|
|
+ handleEventLog(row) {
|
|
|
+ this.reset();
|
|
|
+ this.eventCode = row.eventCode;
|
|
|
+ listcentereventtfirelog({eventCode: this.eventCode}).then(res => {
|
|
|
+ this.openLogSee = true;
|
|
|
+ this.title = "事件日志列表";
|
|
|
+ this.activities = res.data.eventlog;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style>
|
|
|
+.attachment-item {
|
|
|
+ display: inline; /* 将样式改成行内元素 */
|
|
|
+ margin-right: 10px; /* 调整附件项之间的间距 */
|
|
|
+}
|
|
|
+</style>
|