Merge branch 'pet' into dev

hyx_2024-9-25_tongbu
water_xu 2024-09-13 18:27:59 +08:00
commit 41d7b44c00
10 changed files with 9218 additions and 9123 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

View File

@ -30,13 +30,12 @@
<el-date-picker
:disabled="isDisabled"
v-model="infoForm.incidentDate"
type="date"
type="datetime"
placeholder="选择事故发生时间"
style="width: 100%;"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"/>
/>
</el-form-item>
<el-form-item :label-width="formLabelWidth" label="直接经济损失" prop="directLoss">
<el-form-item :label-width="formLabelWidth" label="直接经济损失(万元)" prop="directLoss">
<el-input v-model="infoForm.directLoss" :disabled="isDisabled" type="number" autocomplete="off"/>
</el-form-item>
<el-form-item :label-width="formLabelWidth" label="受伤人数" prop="injured">
@ -90,11 +89,9 @@
<el-date-picker
v-model="infoForm.reportDate"
:disabled="isDisabled"
type="date"
type="datetime"
placeholder="请选择报出日期"
style="width: 100%;"
format="yyyy-MM-dd HH:mm:ss"
value-format="yyyy-MM-dd HH:mm:ss"
/>
</el-form-item>
</el-form>
@ -162,8 +159,7 @@ export default {
rules: {
incidentNumber: [{ required: true, message: '事故案号不能为空', trigger: 'blur' }],
incidentName: [{ required: true, message: '事故名称不能为空', trigger: 'blur' }],
HIDDENTYPE: [{ required: true, message: '事故类型不能为空', trigger: 'blur' }],
incidentType: [{ required: true, message: '隐患类型不能为空', trigger: 'blur' }],
incidentType: [{ required: true, message: '事故类型不能为空', trigger: 'blur' }],
incidentLevel: [{ required: true, message: '事故级别不能为空', trigger: 'blur' }],
incidentNature: [{ required: true, message: '事故性质不能为空', trigger: 'blur' }],
location: [{ required: true, message: '事故发生地点不能为空', trigger: 'blur' }],
@ -339,6 +335,10 @@ export default {
* 表单确认按钮
*/
confirm() {
this.$refs.form.validate(valid => {
if (!valid) {
return false
}
const params = {
...this.infoForm,
photos: this.infoForm.fileList[0].remotePathName
@ -354,6 +354,7 @@ export default {
}).catch((error) => {
this.$message.error(this.tableName + '失败')
})
})
},
/**

View File

@ -4,20 +4,22 @@
<el-row :gutter="12">
<el-col :span="4">
<el-form-item label="事故名称" prop="incidentName">
<el-input v-model="searchForm.incidentName" placeholder="请输入隐患描述" class="filter-item"/>
<el-input v-model="searchForm.incidentName" placeholder="请输入事故名称" class="filter-item"/>
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="6">
<el-form-item label="发生时间" prop="incidentDates">
<el-date-picker
v-model="searchForm.incidentDates"
:default-time="['00:00:00', '23:59:59']"
value-format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd HH:mm:ss"
format="yyyy-MM-dd"
style="width: 100%"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期" />
end-placeholder="结束日期"
/>
</el-form-item>
</el-col>
<el-col :span="4">
@ -25,14 +27,14 @@
<el-input v-model="searchForm.location" placeholder="请输入发生地点" />
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="3">
<el-form-item label="事故类型" prop="incidentType">
<el-select v-model="searchForm.incidentType" placeholder="请选择">
<el-option v-for="item in incidentTypes" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-col :span="3">
<el-form-item label="事故等级" prop="incidentLevel">
<el-select v-model="searchForm.incidentLevel" placeholder="请选择">
<el-option v-for="item in incidentLevels" :key="item.id" :label="item.name" :value="item.id" />
@ -51,7 +53,6 @@
<el-col :span="24">
<el-button type="primary" icon="el-icon-circle-plus" @click="goView('', '新增')">新增</el-button>
<el-button icon="el-icon-s-promotion" @click="handleAllExport"></el-button>
<el-button icon="el-icon-refresh-left" @click="handleRefresh"></el-button>
<el-button type="danger" icon="el-icon-delete-solid" @click="handleBatchDel"></el-button>
</el-col>
</el-row>
@ -64,14 +65,19 @@
v-loading="listLoading"
ref="multipleTable"
:data="varList"
border
tooltip-effect="dark"
style="width: 100%"
@selection-change="handleSelectionChange">
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55"/>
<el-table-column label="事故名称" prop="incidentName"/>
<el-table-column label="所属公司" prop="companyName"/>
<el-table-column label="发生时间" prop="incidentDate"/>
<el-table-column label="发生时间" prop="incidentDate">
<template v-slot="{row}">
{{ formatDate(row.incidentDate,'YYYY-MM-DD HH:mm:ss') }}
</template>
</el-table-column>
<el-table-column label="发生地点" prop="location"/>
<el-table-column label="操作" width="300">
<template v-slot="{row}">
@ -93,6 +99,7 @@
<script>
import Pagination from '@/components/Pagination'
import waves from '@/directive/waves'
import formatDate from '@/utils/dateformat'
import { requestFN } from '../../../../utils/request'
export default {
@ -160,7 +167,7 @@ export default {
requestFN(url, { ...this.searchForm }).then((data) => {
this.listLoading = false
this.varList = data.varList
this.total = data.page.totalResult
this.listQuery.total = data.page.totalResult
}).catch((e) => {
this.listLoading = false
})
@ -171,13 +178,14 @@ export default {
*/
handleReset() {
this.searchForm = this.$options.data().searchForm
this.searchList()
},
/**
* 表格行选择器处理
*/
handleSelectionChange(val) {
this.multipleSelection.push(val)
this.multipleSelection = val
},
/**
@ -264,7 +272,7 @@ export default {
//
const selectedRows = this.multipleSelection
//
if (selectedRows.length === 0) {
if (this.multipleSelection === '' || selectedRows.length === 0) {
this.$message.warning('请选择要删除的行')
return
}
@ -275,15 +283,16 @@ export default {
type: 'warning'
}).then(() => {
// ID
const ids = selectedRows.map(row => row.id).join(',')
let ids = ''
selectedRows.forEach(row => { ids += row.id + ',' })
//
const url = '/accident/delete/' + '' + ids
requestFN(url).then((response) => {
//
this.$message.success('删除成功')
this.searchList()
// eslint-disable-next-line handle-callback-err
}).catch((error) => {
}).catch(() => {
this.$message.error('删除失败')
})
}).catch(() => {
@ -292,7 +301,6 @@ export default {
message: '已取消删除'
})
})
this.searchList()
},
/**
@ -314,6 +322,10 @@ export default {
).then((data) => {
this.incidentLevels = JSON.parse(data.zTreeNodes)
})
},
formatDate(date, format) {
return formatDate(date, format)
}
}
}

View File

@ -2,7 +2,6 @@
<div>
<List v-if="activeName === 'List'" ref="List" />
<Add v-if="activeName === 'AddOrEdit'" ref="AddOrEdit" />
<!-- <Detail v-if="activeName==='Detail'"/>-->
</div>
</template>
@ -14,7 +13,6 @@ export default {
components: {
List: List,
Add: Add
// Detail: Detail
},
data() {
return {

View File

@ -386,6 +386,18 @@ export default {
checkImg: require('../../assets/map/index/map_on.png'),
check: '',
label: '气象监测'
},
{
img: require('../../assets/map/index/sisetu.png'),
checkImg: require('../../assets/map/index/sisetu_on.png'),
check: false,
label: '四色图'
},
{
img: require('../../assets/map/index/bianjie.png'),
checkImg: require('../../assets/map/index/bianjie_on.png'),
check: false,
label: '边界'
}
],
myEntityCollection: {},
@ -1364,7 +1376,7 @@ export default {
this.bottomOptionsKey = Math.random()
this.bottomOptionsAnimationComplex = false
this.toCenter({ longitude, latitude, height })
drag.addPolygon(id)
// drag.addPolygon(id)
viewer.dataSources.removeAll()
this.poinEntity = {}
this.branchPoint = []
@ -1624,6 +1636,26 @@ export default {
this.dialog.corpInfoId = ''
this.dialog.infoname = ''
this.dialog.width = '96%'
} else if (index === 7) {
if (!this.gangkouActive) {
this.$message.warning('请先选择港口')
return
}
if (this.rightOptionsList[index].check) {
drag.addPolygon(this.gangkouActive, '')
} else {
drag.removeFourColorDiagram()
}
} else if (index === 8) {
if (!this.gangkouActive) {
this.$message.warning('请先选择港口')
return
}
if (this.rightOptionsList[index].check) {
drag.addPolygon(this.gangkouActive, 'wall')
} else {
drag.removeWall()
}
}
},
changeSceneMode(check) {
@ -1735,6 +1767,8 @@ export default {
this.poinEntity = {}
this.toCenter(this.initCenter)
this.dragAreaEntity(this.initPoint)
this.rightOptionsList[7].check = false
this.rightOptionsList[8].check = false
}
this.componentKey = Math.random()

View File

@ -80,6 +80,7 @@ const polygonMap = {
export default class DragEntity {
constructor(val) {
this.viewer = val.viewer
this.id = []
}
addEntity(value) {
@ -243,16 +244,24 @@ export default class DragEntity {
})
}
addPolygon(id) {
addPolygon(id, type) {
if (!polygonMap[id]) return
const loadMapBoxObj = polygonMap[id]()
if (type === 'wall') {
const loadMapBoxItem = loadMapBoxObj['wallList']
for (let i = 0; i < loadMapBoxItem.length; i++) {
this.addWall(this.formatPolygon(loadMapBoxItem[i]))
}
return
}
// 循环获取所有颜色
for (const loadMapBoxKey in loadMapBoxObj) {
// 获取每种颜色
const loadMapBoxItem = loadMapBoxObj[loadMapBoxKey]
if (loadMapBoxKey === 'wallList') continue
// 循环每种颜色里每一块创建多边形
for (let i = 0; i < loadMapBoxItem.length; i++) {
this.formatPolygon(loadMapBoxItem[i])
this.addFourColorDiagram(this.formatPolygon(loadMapBoxItem[i]), loadMapBoxItem[i])
}
}
}
@ -263,21 +272,17 @@ export default class DragEntity {
latitudeAndLongitude.push(item.x)
latitudeAndLongitude.push(item.y)
})
if (item.type === 'wall') {
const target = new Cesium.Entity({
wall: {
positions: Cesium.Cartesian3.fromDegreesArray(latitudeAndLongitude),
material: new Cesium.PolylineTrailLinkMaterialProperty({
color: Cesium.Color.fromBytes(201, 118, 243).withAlpha(0.5),
duration: 2000
}, this.viewer),
maximumHeights: new Array(latitudeAndLongitude.length).fill(40),
minimumHeights: new Array(latitudeAndLongitude.length).fill(0)
return latitudeAndLongitude
}
addFourColorDiagram(latitudeAndLongitude, item) {
const id = Cesium.createGuid()
this.id.push({
id,
key: 'FourColorDiagram'
})
this.viewer.entities.add(target)
} else {
const target = new Cesium.Entity({
id,
polygon: {
hierarchy: Cesium.Cartesian3.fromDegreesArray(latitudeAndLongitude),
extrudedHeight: item.stretchHeight,
@ -291,6 +296,45 @@ export default class DragEntity {
})
this.viewer.entities.add(target)
}
addWall(latitudeAndLongitude) {
const id = Cesium.createGuid()
this.id.push({
id,
key: 'Wall'
})
const target = new Cesium.Entity({
id,
wall: {
positions: Cesium.Cartesian3.fromDegreesArray(latitudeAndLongitude),
material: new Cesium.PolylineTrailLinkMaterialProperty({
color: Cesium.Color.fromBytes(201, 118, 243).withAlpha(0.5),
duration: 2000
}, this.viewer),
maximumHeights: new Array(latitudeAndLongitude.length).fill(40),
minimumHeights: new Array(latitudeAndLongitude.length).fill(0)
}
})
this.viewer.entities.add(target)
}
removeFourColorDiagram() {
for (let i = 0; i < this.id.length; i++) {
if (this.id[i].key === 'FourColorDiagram') {
this.viewer.entities.removeById(this.id[i].id)
this.id.splice(i, 1)
i--
}
}
}
removeWall() {
for (let i = 0; i < this.id.length; i++) {
if (this.id[i].key === 'Wall') {
this.viewer.entities.removeById(this.id[i].id)
this.id.splice(i, 1)
i--
}
}
}
}

File diff suppressed because it is too large Load Diff