Commit a75175ab authored by dlkong's avatar dlkong

Merge branch 'develop' of http://git.censoft.com.cn/rongtong/ruoyi-ui into develop

parents 474c04a5 b01edaf0
......@@ -42,6 +42,7 @@
"axios": "0.24.0",
"clipboard": "2.0.8",
"core-js": "3.25.3",
"d3": "^7.8.5",
"echarts": "5.4.0",
"echarts-gl": "^2.0.9",
"element-ui": "2.15.13",
......
......@@ -181,6 +181,20 @@ export const dynamicRoutes = [
},
],
},
{
path: "/riskLedger/detail",
component: Layout,
hidden: true,
permissions: ["system:dict:list"],
children: [
{
path: "riskDetail",
component: () => import("@/views/riskLedger/detail"),
name: "riskDetail",
meta: { title: "风险台账", activeMenu: "/riskLedger/detail" },
},
],
},
{
path: "/risk/plan/inherentdata",
component: Layout,
......
......@@ -7,12 +7,13 @@
<div :class="{ 'active': accessType == 0 }" @click="accessType = 0">评估</div>
<div :class="{ 'active': accessType == 1 }" @click="accessType = 1">巡查</div>
</div>
<div v-for="(item, index) in accessData" :key="item" style="width: 30%; display: inline-block"
class="content-assess-item">
<div class="content-assess-title">{{ item.name }}</div>
<div :id="'leftTop' + index" style="height: 95px;" class="content-assess-echarts"></div>
<div class="content-assess-num">
<div class="content-assess-num-txt">{{ item.count }}<span>{{ item.unit }}</span></div>
<div class="content-assess-group">
<div v-for="(item, index) in accessData" :key="item" class="content-assess-item">
<span class="snow" v-for="item in 20" :key="item" :style="random()"></span>
<div class="content-assess-num">
<div class="content-assess-num-txt">{{ item.count }}<span>{{ item.unit }}</span></div>
</div>
<div class="content-assess-title"><span>{{ item.name }}</span></div>
</div>
</div>
</map-item-container>
......@@ -56,16 +57,9 @@
<highcharts :options="levelStaticOptions" :updateArgs="[false, true]" class="level-static">
</highcharts>
</map-item-container>
<map-item-container title="事故类型统计">
<div class="echarts-accident" id="circleEchart">
<div v-for="(item, index) in accidentEchartsList" :data-group="item.g" :key="item.typeName" :style="[{
'--width': item.w + 'px',
'--left': item.l + 'px',
'--top': item.t + 'px',
'--bg-color': getColors(index % 5)
}]">
<span>{{ item.typeName }}</span>
</div>
<map-item-container title="事故类型统计" id="accident">
<div class="echarts-accident">
<div id="circleEchart"></div>
</div>
</map-item-container>
<map-item-container title="项目风险级别排名">
......@@ -97,6 +91,7 @@ import axios from "axios";
import { mapTable, mapItemContainer, echartMap } from "./components/index";
import Highcharts from 'highcharts'
import { leftEvaluation, centerStatistic, leftRiskSort, leftAnnualSort, rightlevelStatic, rightAccessLevel, rightAccidentType, centerMap } from '@/api/map'
import * as d3 from 'd3';
export default {
name: "echarts",
components: {
......@@ -119,7 +114,7 @@ export default {
return {
accessType: 0,
assessLevelType: 0,
assessLevelColors: [[227, 101, 88], [215, 162, 92], [108, 203, 137], [68, 150, 245], [139, 61, 241]],
assessLevelColors: [[215, 162, 92], [108, 203, 137]],
assessEchartsOptions: {
series: [
{
......@@ -343,61 +338,6 @@ export default {
},
],
},
// annualOptions: {
// // 直角坐标系内绘图网格,设置组件距离容器的距离
// grid: {
// left: 50,
// top: 50,
// right: 50,
// bottom: 50
// },
// // 设置鼠标移入的提示,默认显示
// tooltip: {},
// // 设置图例
// legend: {
// textStyle: {
// color: '#999'
// }
// },
// // 设置x轴
// xAxis: {
// data: [],
// // 显示x轴
// axisLine: {
// show: true
// },
// // 设置x轴的颜色和偏移量
// axisLabel: {
// color: '#999',
// rotate: 0
// },
// // 不显示x轴刻度
// axisTick: {
// show: false
// }
// },
// // 设置y轴
// yAxis: {
// // 显示y轴
// axisLine: {
// show: true
// },
// // 设置y轴的颜色
// axisLabel: {
// color: '#999',
// },
// // 不显示y轴刻度
// axisTick: {
// show: false
// },
// // 不显示分隔线
// splitLine: {
// show: false
// }
// },
// 表示不同系列的列表
// series: []
// },
areaName: "",
colums: [
{
......@@ -443,6 +383,20 @@ export default {
}
},
methods: {
random() {
const x = Math.random() * 100 + 10;
const y = Math.random() * 30 + 20;
const size = Math.random() * 3 + 1;
const opacity = Math.random();
const duration = Math.random() * 5 + 5;
return {
'--snow-x': x + 'px',
'--snow-y': y + 'px',
'--snow-s': size + 'px',
'--snow-o': opacity,
"--snow-d": duration + 's'
}
},
getMapData(id, name) {
centerMap({
level: this.level,
......@@ -454,10 +408,10 @@ export default {
})
},
getColors(index) {
return this.assessLevelColors[index]?.join(',') || '227, 101, 88'
return this.assessLevelColors[index % 2]?.join(',') || '227, 101, 88'
},
getColors1(index) {
return this.assessLevelColors[index].map((x, index) => index == 1 ? x : x + 50).join(',') || '227, 101, 88'
return this.assessLevelColors[index % 2].map((x, index) => index == 1 ? x : x + 50).join(',') || '227, 101, 88'
},
initAll() {
this.getAssess()
......@@ -495,8 +449,8 @@ export default {
layout: "vertical",
floating: true,
align: 'right',
verticalAlign: 'top',
itemMarginTop: 10,
verticalAlign: 'middle',
itemMarginBottom: 10,
itemMarginLeft: 20,
itemStyle: {
color: "#fff"
......@@ -516,7 +470,8 @@ export default {
showInLegend: true,
dataLabels: {
enabled: false
}
},
center: ['35%', '50%']
}
},
series: [{
......@@ -531,7 +486,7 @@ export default {
this.accessData.forEach(val => {
val.count = res.data[val.key + 'Num']
})
this.assessEcharts();
// this.assessEcharts();
})
},
assessEcharts() {
......@@ -552,25 +507,97 @@ export default {
accidentType() {
rightAccidentType({ areaName: this.areaName, type: '' }).then(res => {
this.accidentEchartsList = res.data.slice(0, 11);
const maxNum = res.data[0].typeNum;
const max = 80, min = 40;
let group = 0, groupW = 0, groupH = 0;
const groupList = [[]];
this.accidentEchartsList.forEach(val => {
val.g = group;
val.l = group == 0 ? 140 : groupW;
val.w = Math.max(max * val.typeNum / maxNum, min);
val.t = groupH;
groupW += (val.w + (Math.random() * 10))
groupList[group].push(val)
if (groupW > 300 || group == 0) {
group++;
groupW = (3 - group) * 20
groupH = group == 0 ? val.w : Math.max.apply(null, groupList[group - 1].map(x => x.t + x.w))
groupList[group] = []
const max = 60, min = 20;
// 使用D3.js库中的circlePack布局
const ele = document.querySelector('#accident')
console.log(ele.offsetWidth);
const containerWidth = ele.offsetWidth, containerHeight = ele.offsetHeight + 40;
const circles = res.data.map(x => {
return {
radius: Math.max(max * x.typeNum / maxNum, min),
name: x.typeName,
num: x.typeNum
}
})
});
const pack = d3.pack()
.size([containerWidth, containerHeight])
.padding(10); // 可选项,设置圆之间的间距
const root = d3.hierarchy({ children: circles })
.sum(d => d.radius * 2); // 根据圆的直径来计算面积
pack(root);
// 渲染结果
const svg = d3.select("#circleEchart")
.append("svg")
.attr("width", containerWidth)
.attr("height", containerHeight);
const groupElements = svg.selectAll("g")
.data(root.descendants().slice(1))
.enter()
.append("g")
.attr('class', (d, i) => {
return 'g'
})
.attr("transform", d => `translate(${d.x}, ${d.y})`)
const d3Color = ['#5e63be', '#3779b3', '#5d3437', '#646f43', '#310b6a', '#8d6b46', '#061097', '#5f8c5d'];
groupElements.append("circle")
.attr("r", d => d.r)
.attr("fill-opacity", 0.8)
.attr("fill", (d, index) => d3Color[index % d3Color.length])
// // // 添加文本元素
const text = groupElements.append("text")
.style("text-anchor", "middle")
.style("dominant-baseline", "middle")
.style("fill", "white") // 设置文本颜色
.style('font-size', '12px')
// tspan
text.append("tspan")
.attr("x", 0)
.attr("y", '-0.3em')
.text(d => d.data.name);
text.append("tspan")
.attr("x", 0)
.attr("y", '1em')
.text(d => d.data.num);
// var textLabels = groupElements.append("text")
// .attr("x", function (d) { return d.x; })
// .attr("y", function (d) { return d.y; })
// .style("text-anchor", "middle")
// .style("dominant-baseline", "middle")
// .style("font-size", "12px")
// .style("fill", "white")
// .text(function (d) {
// return [d.data.name, d.data.num].map(function (line, index) {
// return "<tspan x='0' dy='" + (index ? "1.2em" : "0") + "'>" + 111222 + "</tspan>";
// }).join("");
// });
let run = () => {
groupElements.transition()
.duration(() => {
return Math.floor(Math.random() * 3 + 2) * 100
})
.ease(d3.easeLinear)
.style("transform", (d, i) => `translate(${d.x}px, ${d.y + 3}px)`)
.transition()
.duration(300)
.ease(d3.easeLinear)
.style("transform", (d, i) => `translate(${d.x}px, ${d.y - 3}px)`)
.transition()
.on('end', (d) => {
groupElements.style("transform", (d, i) => `translate(${d.x}px, ${d.y - 3}px)`)
run()
})
}
run()
})
},
......@@ -592,86 +619,6 @@ export default {
bar.setOption(this.annualOptions)
})
},
initDta(xData, yData) {
// 设置顶部和底部的值
let symbolData = [], newShadowHight = []
let heights = 0
yData.forEach(item => {
symbolData.push(1)
heights += item
})
newShadowHight = yData.map(item => heights)
options.xAxis.data = xData
options.series = [
// 底部
{
z: 2,
type: 'pictorialBar',
symbol: 'diamond',
symbolOffset: ['0%', '50%'],
symbolSize: [30, 12],
toolltip: {
show: false
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: '#1f7eff' }, { offset: 1, color: '#64adff' }])
},
data: symbolData, // [1,1,1,1,1]
},
// 内容区域
{
z: 1,
type: 'bar',
barWidth: 30,
data: yData
},
// 内容的顶部
{
z: 3,
type: 'pictorialBar',
symbol: 'diamond',
symbolPosition: 'end',
symbolOffset: ['0%', '-50%'],
symbolSize: [30, 12],
toolltip: {
show: false
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: '#1f7eff' }, { offset: 1, color: '#64adff' }])
},
data: yData,
},
// 阴影区域
{
z: 0,
type: 'bar',
barWidth: 30,
data: newShadowHight, // [400, 400, 400, 400, 400]
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: '#9cc1ff' }, { offset: 1, color: '#ecf5ff' }])
}
}
, // 阴影的顶部
{
z: 3,
type: 'pictorialBar',
symbol: 'diamond',
symbolPosition: 'end',
symbolOffset: ['0%', '-50%'],
symbolSize: [30, 12],
toolltip: {
show: false
},
itemStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{ offset: 0, color: '#1f7eff' }, { offset: 1, color: '#64adff' }])
},
data: newShadowHight,
}
]
// 设置配置项
bar.setOption(options)
},
assessLevel() {
rightAccessLevel({ areaName: this.areaName, level: this.assessLevelType, type: '' }).then(res => {
this.terminalList = res.data
......@@ -1237,11 +1184,30 @@ export default {
&-left-wrap {
margin-left: 20px;
height: 100%;
.map-content-item:first-child,
.map-content-item:last-child {
width: 110%;
}
.map-content-item:first-child {
height: 25%;
}
.map-content-item:nth-of-type(2) {
height: 40%;
}
}
&-right-wrap {
margin-right: 40px;
height: 100%;
.map-content-item:first-child,
.map-content-item:last-child {
width: 110%;
transform: translateX(-10%);
}
}
}
......@@ -1328,6 +1294,18 @@ export default {
animation: circleAnimation 1.2s infinite;
}
@keyframes snow {
0% {
opacity: var(--snow-o);
top: var(--snow-y);
}
100% {
opacity: 0;
top: 80%;
}
}
@keyframes circleAnimation {
0% {
transform: translateY(0);
......@@ -1349,38 +1327,64 @@ export default {
// 评估数据
.content-assess-item {
display: inline-block;
width: 40%;
text-align: center;
width: 30%;
height: 100%;
background: url("../../assets/map/content-assess-bottom.jpg") center center no-repeat;
background-size: 85%;
position: relative;
overflow: hidden;
.snow {
display: flex;
width: var(--snow-s);
height: var(--snow-s);
background: #fff;
position: absolute;
animation: snow var(--snow-d) ease-in infinite;
top: var(--snow-y);
left: var(--snow-x);
opacity: var(--snow-o);
border-radius: 50%;
}
.content-assess-title {
height: 60px;
width: 100%;
background: url("../../assets/map/content-assess-title.png") center center;
background-size: 100% 100%;
text-align: center;
line-height: 60px;
color: #fff;
font-weight: bold;
font-size: 12px;
font-size: 13px;
color: #48aefb;
span {
background-image: -webkit-linear-gradient(bottom, #fff 20%, #aaa 60%, #fff 20%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
}
.content-assess-echarts {}
.content-assess-num {
width: 100%;
height: 30px;
margin: 0 auto;
background: url("../../assets/map/content-assess-bottom.png") center bottom;
background-size: 100% 100%;
font-size: 22px;
color: #48aefb;
font-size: 21px;
position: relative;
margin-top: 15%;
&-txt {
font-weight: bolder;
background-image: -webkit-linear-gradient(bottom, #eee, #eee, #8dc4ff, #eee, #eee);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
display: inline-block;
transform: translateY(-20px);
}
}
}
.content-assess-group {
height: 100%;
display: flex;
justify-content: space-around;
}
.content-assess-tab {
......@@ -1422,6 +1426,10 @@ export default {
position: relative;
text-align: center;
#circleEchart {
transform: translate(-2%, -15%);
}
>div {
width: var(--width);
height: var(--width);
......@@ -1439,16 +1447,16 @@ export default {
// animation: pathAnimation 0.3s infinite;
}
>div:nth-of-type(2n) {
animation: pathAnimation 0.6s infinite;
}
// >div:nth-of-type(2n) {
// animation: pathAnimation 0.6s infinite;
// }
>div:nth-of-type(2n+1) {
animation: pathAnimation 0.4s infinite;
}
// >div:nth-of-type(2n+1) {
// animation: pathAnimation 0.4s infinite;
// }
>div:nth-of-type(3n) {
animation: pathAnimation 0.3s ease-in-out infinite;
}
// >div:nth-of-type(3n) {
// animation: pathAnimation 0.3s ease-in-out infinite;
// }
}
</style>
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="90px"
>
<el-form-item label="区域公司" prop="deptName">
<el-input
v-model="queryParams.deptName"
placeholder="请输入区域公司"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="项目名称" prop="projectName">
<el-input
v-model="queryParams.projectName"
placeholder="请输入项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="所属城市" prop="city">
<el-input
v-model="queryParams.city"
placeholder="请输入所属城市"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="项目业态" prop="businessFormat">
<el-input
v-model="queryParams.businessFormat"
placeholder="请输入项目业态"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="固有风险危险源名称" prop="inherentName">
<el-input
v-model="queryParams.inherentName"
placeholder="请输入固有风险危险源名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="固有风险风险等级" prop="inherentLevel">
<el-select
v-model="queryParams.inherentLevel"
placeholder="请选择固有风险风险等级"
clearable
>
<el-option
v-for="dict in dict.type.risk_plan_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="现有风险危险源名称" prop="existingName">
<el-input
v-model="queryParams.existingName"
placeholder="请输入现有风险危险源名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="现有风险风险等级" prop="existingLevel">
<el-select
v-model="queryParams.existingLevel"
placeholder="请选择现有风险风险等级"
clearable
>
<el-option
v-for="dict in dict.type.risk_plan_level"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="风险点位置" prop="presenceLocation">
<el-input
v-model="queryParams.presenceLocation"
placeholder="请输入风险点位置"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="可能导致的事故后果" prop="listType">
<el-input
v-model="queryParams.listType"
placeholder="请输入可能导致的事故后果"
clearable
@keyup.enter.native="handleQuery"
/>
</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-row class="mb8">
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button
>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList">
</right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="inherentList"
@selection-change="handleSelectionChange"
>
<el-table-column label="项目信息" align="center" fixed width="500">
<el-table-column
label="区域公司"
align="center"
prop="deptName"
width="100"
/>
<el-table-column
label="项目名称"
align="center"
prop="projectName"
width="100"
>
<template slot-scope="scope">
<el-popover
placement="top-start"
title="项目名称"
width="200"
trigger="hover"
:content="scope.row.projectName"
>
<span slot="reference">{{
scope.row.projectName.length > 10
? scope.row.projectName.substring(0, 10) + "..."
: scope.row.projectName
}}</span>
</el-popover>
</template>
</el-table-column>
<el-table-column
label="所属城市"
align="center"
prop="city"
width="100"
/>
<el-table-column
label="项目业态"
align="center"
prop="businessFormat"
width="100"
/>
<el-table-column
label="项目类型"
align="center"
prop="type"
width="100"
/>
</el-table-column>
<el-table-column label="项目风险清单" align="center">
<el-table-column label="固有风险" align="center">
<el-table-column
label="危险源名称"
align="center"
prop="inherentName"
width="100"
/>
<el-table-column
label="风险等级"
align="center"
prop="inherentLevel"
width="100"
/>
</el-table-column>
<el-table-column label="现有风险" align="center">
<el-table-column
label="危险源名称"
align="center"
prop="existingName"
width="100"
/>
<el-table-column
label="风险等级"
align="center"
prop="existingLevel"
width="100"
/>
</el-table-column>
<el-table-column
label="风险点位置"
align="center"
prop="presenceLocation"
width="100"
/>
<el-table-column
label="可能导致的事故后果"
align="center"
prop="listType"
width="100"
>
<template slot-scope="scope">
<el-popover
placement="top-start"
title="项目名称"
width="200"
trigger="hover"
:content="scope.row.listType"
>
<span slot="reference">{{
scope.row.listType.length > 10
? scope.row.listType.substring(0, 10) + "..."
: scope.row.listType
}}</span>
</el-popover>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="项目整体风险等级" align="center">
<el-table-column
label="固有风险"
align="center"
prop="inherentProjectLevel"
width="100"
/>
<el-table-column
label="现状风险"
align="center"
prop="existingProjectLevel"
width="100"
/>
</el-table-column>
<el-table-column label="风险管控" align="center">
<el-table-column
label="应采取的管控措施"
align="center"
prop="inherentMeasuresAdministration"
width="100"
>
<template slot-scope="scope">
<el-popover
placement="top-start"
title="应采取的管控措施"
width="200"
trigger="hover"
:content="scope.row.inherentMeasuresAdministration"
>
<span slot="reference">{{
scope.row.inherentMeasuresAdministration &&
scope.row.inherentMeasuresAdministration.length > 10
? scope.row.inherentMeasuresAdministration.substring(0, 10) +
"..."
: scope.row.inherentMeasuresAdministration
}}</span>
</el-popover>
</template>
</el-table-column>
<el-table-column
label="已采取的管控措施"
align="center"
prop="existingMeasuresAdministration"
width="100"
>
<template slot-scope="scope">
<el-popover
placement="top-start"
title="已采取的管控措施"
width="200"
trigger="hover"
:content="scope.row.existingMeasuresAdministration"
>
<span slot="reference">{{
scope.row.existingMeasuresAdministration &&
scope.row.existingMeasuresAdministration.length > 10
? scope.row.existingMeasuresAdministration.substring(0, 10) +
"..."
: scope.row.existingMeasuresAdministration
}}</span>
</el-popover>
</template>
</el-table-column>
<el-table-column label="分级管控" align="center">
<el-table-column
label="管控责任单位"
align="center"
prop="measuresDeptName"
width="100"
/>
<el-table-column
label="管控责任人"
align="center"
prop="measuresUserName"
width="100"
/>
<el-table-column
label="人员联系方式"
align="center"
prop="measuresUserPhone"
width="100"
/>
</el-table-column>
</el-table-column>
<el-table-column label="重大危险源管理" align="center">
<el-table-column
label="是否存在重大危险源"
align="center"
prop="majorHazardSource"
width="100"
/>
<el-table-column
label="重大危险源名称"
align="center"
prop="hazardSourceName"
width="100"
/>
<el-table-column
label="重大危险源描述"
align="center"
prop="majorHazardDescription"
width="100"
/>
</el-table-column>
<el-table-column
label="判定依据"
align="center"
prop="referenceBasis"
width="100"
/>
<el-table-column label="操作" align="center" prop="describe">
<template slot-scope="scope">
<div>
<router-link
:to="'/risk/plan/inherentdata/index/' + scope.row.id"
class="link-type"
>
<el-button size="mini" type="text" icon="el-icon-view"
>详情</el-button
>
</router-link>
</div>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
</div>
</template>
<script>
import { inherentListList } from "@/api/risk/existing";
export default {
name: "inherent",
dicts: ["risk_plan_level"],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 固有风险清单库表格数据
inherentList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
buildingName: null,
floorName: null,
roomName: null,
level: null,
factor: null,
type: null,
presenceLocation: null,
},
// 表单参数
form: {},
// 表单校验
rules: {},
};
},
created() {
this.getList();
},
methods: {
/** 查询固有风险清单库列表 */
getList() {
this.loading = true;
inherentListList(this.queryParams).then((response) => {
this.inherentList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
name: null,
buildingName: null,
floorName: null,
roomName: null,
level: null,
factor: null,
type: null,
level: null,
riskLikelihood: null,
riskSeverity: null,
presenceLocation: null,
pictureFileIds: null,
measuresProject: null,
measuresProjectFileIds: null,
measuresAdministration: null,
measuresDeptName: null,
measuresUserName: null,
measuresUserPhone: null,
measuresAdministrationFileIds: null,
hazardSourceName: null,
majorHazardSource: null,
majorHazardSourceDescription: null,
measuresEmergency: null,
measuresEmergencyFileIds: null,
referenceBasis: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map((item) => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
},
exportList(id) {
this.download("system/risk/plan/exportWord/riskNotification/" + id, {});
},
showDrawCanvas(floorId) {
this.$router.push({
name: "drawCanvas",
params: {
floorId: floorId,
},
});
},
/** 导出按钮操作 */
handleExport() {
this.download(
"/system/risk/plan/exportExcel/InherentList",
{
...this.queryParams,
},
`固有风险台账_${new Date().getTime()}.xls`
);
},
},
};
</script>
<template>
<div class="app-container">
<el-form
:model="queryParams"
ref="queryForm"
size="small"
:inline="true"
v-show="showSearch"
label-width="68px"
>
<el-form-item label="项目名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入项目名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="经营状态" prop="businessStatus">
<el-input
v-model="queryParams.businessStatus"
placeholder="请输入经营状态"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="项目业态" prop="business">
<el-select
v-model="queryParams.business"
placeholder="请选择项目业态"
clearable
>
<el-option
v-for="dict in dict.type.risk_project_business"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="所属区域" prop="deptId">
<treeselect
v-model="queryParams.deptId"
:options="deptOptions"
:show-count="true"
placeholder="请选择所属区域"
style="width: 250px"
/>
</el-form-item>
<el-form-item label="所在城市" prop="city">
<el-input
v-model="queryParams.city"
placeholder="请输入所在城市"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="详细地址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入详细地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="物业" prop="propertyManagement">
<el-select
v-model="queryParams.propertyManagement"
placeholder="请选择是否为物业"
clearable
>
<el-option key="1" label="是" value="true" />
<el-option key="0" label="否" value="false" />
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select
v-model="queryParams.status"
placeholder="请选择状态"
clearable
>
<el-option
v-for="dict in dict.type.sys_normal_disable"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</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-row>
<right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table
v-loading="loading"
:data="projectList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center">
<template slot-scope="scope">
<span>{{ scope.$index + 1 }}</span>
</template>
</el-table-column>
<el-table-column label="项目名称" align="center" prop="name" />
<el-table-column label="项目类型" align="center" prop="type" />
<el-table-column label="项目业态" align="center" prop="business" />
<el-table-column label="所属区域" align="center" prop="deptName" />
<el-table-column label="所在城市" align="center" prop="city" />
<el-table-column label="详细地址" align="center" prop="address" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag
:options="dict.type.sys_normal_disable"
:value="scope.row.status"
/>
</template>
</el-table-column>
<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-edit"
@click="showDetail(scope.row)"
>查看风险台账</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"
/>
</div>
</template>
<script>
import { listProject } from "@/api/ledger/project/";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
export default {
name: "Project",
dicts: ["sys_normal_disable", "data_source", "risk_project_business"],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
userTotal: 0,
// 基础数据-项目表格数据
projectList: [],
// 部门树选项
deptOptions: undefined,
// 弹出层标题
title: "",
// 用户表格数据
userList: null,
// 是否显示弹出层
open: false,
powerOpen: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
type: null,
deptId: null,
city: null,
address: null,
source: null,
status: null,
},
queryUserParams: {
pageNum: 1,
pageSize: 10,
projectId: undefined,
userName: undefined,
},
// 表单参数
form: {
businessStatus: "",
},
// 表单校验
rules: {},
projectId: "",
userPost: null,
postList: [],
userInfoData: {},
};
},
watch: {
// 根据名称筛选部门树
deptName(val) {
this.$refs.tree.filter(val);
},
},
created() {
this.getList();
},
methods: {
/** 查询基础数据-项目列表 */
getList() {
this.loading = true;
listProject(this.queryParams).then((response) => {
this.projectList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
name: null,
type: null,
deptId: null,
city: null,
address: null,
source: null,
status: null,
delFlag: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
showDetail(obj) {
this.$router.push({
name: "/riskLe",
params: {
projectId: obj.id,
},
});
},
},
};
</script>
......@@ -37,10 +37,10 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: "http://192.168.10.137:8080/",
// target: `http://192.168.4.232:8080`, //服务器地址
target: `http://192.168.4.232:8080`, //服务器地址
// target: `http://192.168.15.230:8081`, //晓晋本地地址
// target: `http://192.168.15.152:8081`, //鲍德本地地址
target: `http://127.0.0.1:8080`, //本地地址
// target: `http://127.0.0.1:8080`, //本地地址
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "",
......
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