Merge pull request '邓洁: 修复bug' (#196) from dengjie into dev
Reviewed-on: http://git.feashow.cn/clay/tunnel-cloud-web/pulls/196
This commit is contained in:
@@ -35,3 +35,10 @@ export const getBadGasEchartsInfo = (tunnelId) => {
|
|||||||
method: 'get'
|
method: 'get'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
//电流监控数据
|
||||||
|
export const getFanEchartsInfo = (equipmentId) => {
|
||||||
|
return request({
|
||||||
|
url: `/tunnel/large/screen/echarts/current/${equipmentId}`,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,10 +10,7 @@ export const getTunnelList = (params) => {
|
|||||||
export const getTunnelDetail = (tunnelId) => {
|
export const getTunnelDetail = (tunnelId) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/tunnel/tunnel/${tunnelId}`,
|
url: `/tunnel/tunnel/${tunnelId}`,
|
||||||
method: 'get',
|
method: 'get'
|
||||||
params:{
|
|
||||||
tunnelId:tunnelId
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
export const addTunnel = (data) => {
|
export const addTunnel = (data) => {
|
||||||
|
|||||||
@@ -298,6 +298,11 @@ body,
|
|||||||
height: 1160px;
|
height: 1160px;
|
||||||
//width: 1300px;
|
//width: 1300px;
|
||||||
}
|
}
|
||||||
|
#containerFan {
|
||||||
|
flex: 1;
|
||||||
|
height: 1160px;
|
||||||
|
//width: 1300px;
|
||||||
|
}
|
||||||
|
|
||||||
#containerBad {
|
#containerBad {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
|
|||||||
@@ -64,17 +64,38 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="current">
|
<div class="current" @click="handleOpenChart(item)">
|
||||||
<fan-info-item :wp="transducerData[index]"/>
|
<fan-info-item :wp="transducerData[index]" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="digital-tunnel">
|
||||||
|
<el-dialog :close-on-click-modal="false" v-model="isVisited" :title="'电流监控数据'" width="2175px"
|
||||||
|
:modal="false">
|
||||||
|
<div class="left-top-icon"></div>
|
||||||
|
<div class="right-top-icon"></div>
|
||||||
|
<div class="chat-dialog">
|
||||||
|
<div id="containerFan"></div>
|
||||||
|
<div style="width: 1px;"></div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="time-select">-->
|
||||||
|
<!-- <time-range-btn-->
|
||||||
|
<!-- :buttonList="timeList"-->
|
||||||
|
<!-- v-model="selectTimeButton"-->
|
||||||
|
<!-- @select="timeSelect"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<div class="left-bottom-icon"></div>
|
||||||
|
<div class="right-bottom-icon"></div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import * as echarts from "echarts";
|
import * as echarts from "echarts";
|
||||||
import FanInfoItem from "./FanInfoItem.vue";
|
import FanInfoItem from "./FanInfoItem.vue";
|
||||||
|
import {getFanEchartsInfo} from "../../../api/largeScreen";
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
list: Array,
|
list: Array,
|
||||||
@@ -89,6 +110,8 @@ const transducerData = ref([])
|
|||||||
const stateA = ref(false)
|
const stateA = ref(false)
|
||||||
const stateB = ref(false)
|
const stateB = ref(false)
|
||||||
const stateC = ref(false)
|
const stateC = ref(false)
|
||||||
|
const isVisited = ref(false)
|
||||||
|
let myEcharts = reactive({});
|
||||||
watch(() => props.transducerData, (now) => {
|
watch(() => props.transducerData, (now) => {
|
||||||
getTransData(now.frequencyChangerList)
|
getTransData(now.frequencyChangerList)
|
||||||
}, {deep: true});
|
}, {deep: true});
|
||||||
@@ -122,7 +145,19 @@ watch(() => props.list, (now) => {
|
|||||||
})
|
})
|
||||||
handleOnMounted()
|
handleOnMounted()
|
||||||
}, {deep: true});
|
}, {deep: true});
|
||||||
|
const getFanInfo = (equipmentId) => {
|
||||||
|
getFanEchartsInfo(equipmentId).then(res => {
|
||||||
|
if (res?.code === 1000) {
|
||||||
|
isVisited.value = true
|
||||||
|
nextTick(() => {
|
||||||
|
initChart(res.data.dates, res.data.currentsA,res.data.currentsB,res.data.currentsC)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const handleOpenChart = (item) => {
|
||||||
|
getFanInfo(item.equipmentId)
|
||||||
|
}
|
||||||
const getTransData = (data) => {
|
const getTransData = (data) => {
|
||||||
let tranObj = {}
|
let tranObj = {}
|
||||||
let tranArr = []
|
let tranArr = []
|
||||||
@@ -306,6 +341,128 @@ const getImageUrl = (name) => {
|
|||||||
let icon = getImage(name)
|
let icon = getImage(name)
|
||||||
return new URL(`../../../assets/images/fanInfo/${icon}`, import.meta.url).href
|
return new URL(`../../../assets/images/fanInfo/${icon}`, import.meta.url).href
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 初始化echarts实例方法
|
||||||
|
*/
|
||||||
|
const initChart = (type, valueA,valueB,valueC) => {
|
||||||
|
//3.初始化container容器
|
||||||
|
myEcharts = echarts.init(document.getElementById('containerFan'));
|
||||||
|
//5.传入数据
|
||||||
|
let option = {
|
||||||
|
//图例
|
||||||
|
legend: {
|
||||||
|
left: 0,
|
||||||
|
textStyle: {
|
||||||
|
color: '#FFFFFF',
|
||||||
|
fontSize: 45
|
||||||
|
},
|
||||||
|
itemWidth: 30,
|
||||||
|
itemHeight: 30,
|
||||||
|
icon: "circle",
|
||||||
|
},
|
||||||
|
//离容器四侧的距离
|
||||||
|
grid: {
|
||||||
|
left: 0, // 左边距
|
||||||
|
right: 20, // 右边距
|
||||||
|
top: 80, // 顶边距
|
||||||
|
bottom: 0, // 底边距
|
||||||
|
containLabel: true,
|
||||||
|
},
|
||||||
|
//提示框组件
|
||||||
|
tooltip: {
|
||||||
|
show: true,
|
||||||
|
trigger: 'axis',
|
||||||
|
backgroundColor: "transparent", // 设置背景颜色为透明
|
||||||
|
borderColor: "transparent", // 设置边框颜色为透明
|
||||||
|
padding: 0, // 设置内边距为0
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 40
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
let content = `
|
||||||
|
<div style="background: linear-gradient(180deg, #254062 0%, rgba(20,36,51,0.3) 100%);;border: 2px solid #6087BA;border-radius: 4px;padding: 8px 16px;">
|
||||||
|
<div style="font-size: 52px;font-family: PingFang SC-Regular, PingFang SC;font-weight: 400;color: #EFEEEE;margin-bottom: 8px;">${params[0].name}</div>
|
||||||
|
<div style="font-size: 52px;line-height: 48px;font-family: Bebas Neue-Regular, Bebas Neue;font-weight: 400;margin-top: 20px"><span style="background: linear-gradient(180deg, #F5B85F 0%, #FFFFFF 100%);background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;">${params[0].value}</span></div>
|
||||||
|
</div>`;
|
||||||
|
return content;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
toolbox: {
|
||||||
|
show: false,
|
||||||
|
right: 10,
|
||||||
|
feature: {
|
||||||
|
dataZoom: {
|
||||||
|
yAxisIndex: 'none'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dataZoom: [{
|
||||||
|
type: 'inside'
|
||||||
|
}],
|
||||||
|
//X轴
|
||||||
|
xAxis: {
|
||||||
|
type: 'category',
|
||||||
|
// data: ['00:00', '01:00', '02:00', '03:00', '04:00', '05:00', '06:00','07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00','19:00', '20:00', '21:00', '22:00', '23:00','24:00'],
|
||||||
|
data: type,
|
||||||
|
axisLabel: {
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 45,
|
||||||
|
color: '#D6F1FA'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
//Y轴
|
||||||
|
yAxis: {
|
||||||
|
type: 'value',
|
||||||
|
axisLabel: {
|
||||||
|
textStyle: {
|
||||||
|
fontSize: 45,
|
||||||
|
color: '#D6F1FA'
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
//配置项
|
||||||
|
series: [
|
||||||
|
{
|
||||||
|
// data: [56, 12, 89, 34, 71, 43, 67, 20, 98, 72, 19, 61, 3, 85, 47, 92, 17, 76, 69, 25, 31, 49, 81, 63],
|
||||||
|
name:'A相电流',
|
||||||
|
data: valueA,
|
||||||
|
type: 'line',
|
||||||
|
smooth: true,
|
||||||
|
symbolSize: 24,
|
||||||
|
lineStyle: {
|
||||||
|
width: 5
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:'B相电流',
|
||||||
|
data: valueB,
|
||||||
|
type: 'line',
|
||||||
|
smooth: true,
|
||||||
|
symbolSize: 24,
|
||||||
|
lineStyle: {
|
||||||
|
width: 5
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name:'C相电流',
|
||||||
|
data: valueC,
|
||||||
|
type: 'line',
|
||||||
|
smooth: true,
|
||||||
|
symbolSize: 24,
|
||||||
|
lineStyle: {
|
||||||
|
width: 5
|
||||||
|
},
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
myEcharts.setOption(option);
|
||||||
|
//图表大小自适应窗口大小变化
|
||||||
|
window.onresize = () => {
|
||||||
|
myEcharts.resize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@@ -608,6 +765,7 @@ input[type="number"] {
|
|||||||
height: 37px;
|
height: 37px;
|
||||||
font-size: 28px;
|
font-size: 28px;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
@click="handleOpenChart(item)"/>
|
@click="handleOpenChart(item)"/>
|
||||||
</div>
|
</div>
|
||||||
<div class="digital-tunnel">
|
<div class="digital-tunnel">
|
||||||
<el-dialog :close-on-click-modal="false" v-model="isVisited" :title="windSort+'监控数据'" width="2175px" :modal="false">
|
<el-dialog :close-on-click-modal="false" v-model="isVisited" :title="windSort+'监控数据'" width="2175px"
|
||||||
|
:modal="false">
|
||||||
<div class="left-top-icon"></div>
|
<div class="left-top-icon"></div>
|
||||||
<div class="right-top-icon"></div>
|
<div class="right-top-icon"></div>
|
||||||
<div class="chat-dialog">
|
<div class="chat-dialog">
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ const routes = [
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/edit/:tunnelId(\\d+)/:type',
|
path: '/edit/:tunnelId(\\d+)/:type/:userId(\\d+)',
|
||||||
name: 'tunneledit',
|
name: 'tunneledit',
|
||||||
component: () => import('@/views/edit/edit.vue'),
|
component: () => import('@/views/edit/edit.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
@@ -42,7 +42,7 @@ const routes = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/site',
|
path: '/site/:userId(\\d+)',
|
||||||
name: 'site',
|
name: 'site',
|
||||||
component: () => import('@/views/site/index.vue'),
|
component: () => import('@/views/site/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
@@ -60,7 +60,7 @@ const routes = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/tunnel/:siteId(\\d+)/:type',
|
path: '/tunnel/:siteId(\\d+)/:type/:userId(\\d+)',
|
||||||
name: 'tunnel',
|
name: 'tunnel',
|
||||||
component: () => import('@/views/tunnel-manage/index.vue'),
|
component: () => import('@/views/tunnel-manage/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
@@ -69,7 +69,7 @@ const routes = [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/device/:tunnelId(\\d+)/:type',
|
path: '/device/:tunnelId(\\d+)/:type/:userId(\\d+)',
|
||||||
name: 'device',
|
name: 'device',
|
||||||
component: () => import('@/views/device-manage/index.vue'),
|
component: () => import('@/views/device-manage/index.vue'),
|
||||||
meta: {
|
meta: {
|
||||||
|
|||||||
@@ -51,19 +51,22 @@
|
|||||||
:header-cell-style="{backgroundColor: '#064B66',color: '#fff',fontSize: '40px',borderBottom: 'none' }"
|
:header-cell-style="{backgroundColor: '#064B66',color: '#fff',fontSize: '40px',borderBottom: 'none' }"
|
||||||
:cell-style="{textAlign: 'center',borderBottom: 'none'}" :data="fanData">
|
:cell-style="{textAlign: 'center',borderBottom: 'none'}" :data="fanData">
|
||||||
<el-table-column prop="equipmentName" label="设备名称" align="center"/>
|
<el-table-column prop="equipmentName" label="设备名称" align="center"/>
|
||||||
<el-table-column prop="phaseCurrentAOffset" label="A电流" align="center">
|
<el-table-column prop="phaseCurrentAOffset" label="A电流偏移量" align="center"/>
|
||||||
|
<el-table-column prop="avoltageValue" label="A电流阈值" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input placeholder="请输入A电流" v-model="scope.row.phaseCurrentAOffset"></el-input>
|
<el-input placeholder="A电流" v-model="scope.row.avoltageValue"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="phaseCurrentBOffset" label="B电流" align="center">
|
<el-table-column prop="phaseCurrentBOffset" label="B电流偏移量" align="center"/>
|
||||||
|
<el-table-column prop="bvoltageValue" label="B电流阈值" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input placeholder="请输入B电流" v-model="scope.row.phaseCurrentBOffset"></el-input>
|
<el-input placeholder="B电流" v-model="scope.row.bvoltageValue"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="phaseCurrentCOffset" label="C电流" align="center">
|
<el-table-column prop="phaseCurrentCOffset" label="C电流偏移量" align="center"/>
|
||||||
|
<el-table-column prop="cvoltageValue" label="C电流阈值" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input placeholder="请输入C电流" v-model="scope.row.phaseCurrentCOffset"></el-input>
|
<el-input placeholder="C电流" v-model="scope.row.cvoltageValue"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="state" label="状态" align="center">
|
<el-table-column prop="state" label="状态" align="center">
|
||||||
@@ -118,17 +121,17 @@
|
|||||||
<el-table-column prop="offset" label="偏移量" align="center"/>
|
<el-table-column prop="offset" label="偏移量" align="center"/>
|
||||||
<el-table-column prop="unit" label="单位" align="center">
|
<el-table-column prop="unit" label="单位" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input placeholder="请输入单位" v-model="scope.row.unit"></el-input>
|
<el-input placeholder="单位" v-model="scope.row.unit"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="alarmValue" label="阈值" align="center">
|
<el-table-column prop="alarmValue" label="阈值" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input placeholder="请输入阈值" v-model="scope.row.alarmValue"></el-input>
|
<el-input placeholder="阈值" v-model="scope.row.alarmValue"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="state" label="状态" align="center">
|
<el-table-column prop="state" label="状态" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div class="switch">
|
<div class="switch wind-switch">
|
||||||
<div
|
<div
|
||||||
:class="{ active: scope.row.state }"
|
:class="{ active: scope.row.state }"
|
||||||
@click=" scope.row.state = 1;"
|
@click=" scope.row.state = 1;"
|
||||||
@@ -178,17 +181,17 @@
|
|||||||
<el-table-column prop="offset" label="偏移量" align="center"/>
|
<el-table-column prop="offset" label="偏移量" align="center"/>
|
||||||
<el-table-column prop="unit" label="单位" align="center">
|
<el-table-column prop="unit" label="单位" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input placeholder="请输入单位" v-model="scope.row.unit"></el-input>
|
<el-input placeholder="单位" v-model="scope.row.unit"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="alarmValue" label="阈值" align="center">
|
<el-table-column prop="alarmValue" label="阈值" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input placeholder="请输入阈值" v-model="scope.row.alarmValue"></el-input>
|
<el-input placeholder="阈值" v-model="scope.row.alarmValue"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="state" label="状态" align="center">
|
<el-table-column prop="state" label="状态" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<div class="switch">
|
<div class="switch wind-switch">
|
||||||
<div
|
<div
|
||||||
:class="{ active: scope.row.state }"
|
:class="{ active: scope.row.state }"
|
||||||
@click=" scope.row.state = 1;"
|
@click=" scope.row.state = 1;"
|
||||||
@@ -238,7 +241,7 @@
|
|||||||
<el-table-column prop="offset" label="偏移量" align="center"/>
|
<el-table-column prop="offset" label="偏移量" align="center"/>
|
||||||
<el-table-column prop="thresholdValue" label="阈值" align="center">
|
<el-table-column prop="thresholdValue" label="阈值" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-input placeholder="请输入阈值" v-model="scope.row.thresholdValue"></el-input>
|
<el-input placeholder="阈值" v-model="scope.row.thresholdValue"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="state" label="状态" align="center">
|
<el-table-column prop="state" label="状态" align="center">
|
||||||
@@ -282,6 +285,7 @@ import {editEquipment, getTunnelDetail} from "@/api/tunnelManage";
|
|||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const tunnelId = reactive(router.currentRoute.value.params.tunnelId)
|
const tunnelId = reactive(router.currentRoute.value.params.tunnelId)
|
||||||
|
const userId = reactive(router.currentRoute.value.params.userId)
|
||||||
const type = reactive(router.currentRoute.value.params.type)
|
const type = reactive(router.currentRoute.value.params.type)
|
||||||
const collectionFrequency = ref(0)
|
const collectionFrequency = ref(0)
|
||||||
const changeIndex = ref(1)
|
const changeIndex = ref(1)
|
||||||
@@ -479,7 +483,7 @@ const handleEditFan = () => {
|
|||||||
editFan(data).then(res => {
|
editFan(data).then(res => {
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
ElMessage.success('修改成功')
|
ElMessage.success('修改成功')
|
||||||
router.push('/tunnel/' + siteId.value + '/' + type)
|
router.push('/tunnel/' + siteId.value + '/' + type + '/' + userId)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -490,7 +494,13 @@ const getList = () => {
|
|||||||
getEquipmentList(tunnelId).then(res => {
|
getEquipmentList(tunnelId).then(res => {
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
fanData.value = res.data.frequencyChangerList
|
fanData.value = res.data.frequencyChangerList
|
||||||
|
res.data.windPressureSensorList.forEach(item => {
|
||||||
|
item.offset = item.offset + 4000
|
||||||
|
})
|
||||||
winData.value = res.data.windPressureSensorList
|
winData.value = res.data.windPressureSensorList
|
||||||
|
res.data.sensorList.forEach(item => {
|
||||||
|
item.offset = item.offset + 4000
|
||||||
|
})
|
||||||
otherData.value = res.data.sensorList
|
otherData.value = res.data.sensorList
|
||||||
res.data.acquisitionList.map(item => {
|
res.data.acquisitionList.map(item => {
|
||||||
if (item.tunnelId == tunnelId) {
|
if (item.tunnelId == tunnelId) {
|
||||||
@@ -511,7 +521,7 @@ const getTunnel = () => {
|
|||||||
}
|
}
|
||||||
getTunnel()
|
getTunnel()
|
||||||
const handleGoTunnelMgr = () => {
|
const handleGoTunnelMgr = () => {
|
||||||
router.push('/tunnel/' + siteId.value + '/' + type)
|
router.push('/tunnel/' + siteId.value + '/' + type + '/' + userId)
|
||||||
}
|
}
|
||||||
getList()
|
getList()
|
||||||
</script>
|
</script>
|
||||||
@@ -676,16 +686,20 @@ getList()
|
|||||||
|
|
||||||
.device-table {
|
.device-table {
|
||||||
margin-top: 50px;
|
margin-top: 50px;
|
||||||
margin-left: 97px;
|
margin-left: 60px;
|
||||||
|
|
||||||
.active {
|
.active {
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
background: #0f7da9;
|
background: #0f7da9;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.wind-switch {
|
||||||
|
margin-left: 65px;
|
||||||
|
}
|
||||||
|
|
||||||
.switch {
|
.switch {
|
||||||
margin-top: 22px;
|
margin-top: 22px;
|
||||||
margin-left: 60px;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
width: 200px;
|
width: 200px;
|
||||||
height: 50px;
|
height: 50px;
|
||||||
@@ -704,7 +718,7 @@ getList()
|
|||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-table--fit) {
|
:deep(.el-table--fit) {
|
||||||
width: 1700px !important;
|
width: 1780px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.cell) {
|
:deep(.cell) {
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ import {ElMessage} from "element-plus";
|
|||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const tunnelId = reactive(router.currentRoute.value.params.tunnelId)
|
const tunnelId = reactive(router.currentRoute.value.params.tunnelId)
|
||||||
|
const userId = reactive(router.currentRoute.value.params.userId)
|
||||||
const type = reactive(router.currentRoute.value.params.type)
|
const type = reactive(router.currentRoute.value.params.type)
|
||||||
const store = useModelSceneStore();
|
const store = useModelSceneStore();
|
||||||
const form = ref({
|
const form = ref({
|
||||||
@@ -77,7 +78,7 @@ const handleGotoDevice = () => {
|
|||||||
router.push('/device/' + tunnelId)
|
router.push('/device/' + tunnelId)
|
||||||
}
|
}
|
||||||
const handleGoTunnelMgr=()=>{
|
const handleGoTunnelMgr=()=>{
|
||||||
router.push('/tunnel/' + form.value.siteId+'/'+type)
|
router.push('/tunnel/' + form.value.siteId+'/'+type+'/'+userId)
|
||||||
}
|
}
|
||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
const data = {
|
const data = {
|
||||||
@@ -94,7 +95,7 @@ const handleSave = async () => {
|
|||||||
editTunnel(data).then((res) => {
|
editTunnel(data).then((res) => {
|
||||||
if (res?.code === 1000) {
|
if (res?.code === 1000) {
|
||||||
ElMessage.success(res.msg)
|
ElMessage.success(res.msg)
|
||||||
router.push('/tunnel/' + form.value.siteId+'/'+type)
|
router.push('/tunnel/' + form.value.siteId+'/'+type+'/'+userId)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,7 +22,8 @@
|
|||||||
<div class="site-box" v-for="item in siteList" :key="item.siteId">
|
<div class="site-box" v-for="item in siteList" :key="item.siteId">
|
||||||
<div class="top">
|
<div class="top">
|
||||||
<span>站点名称:{{ item.siteName }}</span>
|
<span>站点名称:{{ item.siteName }}</span>
|
||||||
<el-checkbox v-model="item.checked" size="large" @change="handleClickSite(item)"/>
|
<el-checkbox v-if="!item.isDefault" v-model="item.checked" size="large" @change="handleClickSite(item)"/>
|
||||||
|
<span v-else>默认</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-center">
|
<div class="box-center">
|
||||||
<div class="left-img"></div>
|
<div class="left-img"></div>
|
||||||
@@ -106,6 +107,7 @@ import {editSite, getSiteDetail, getSiteList, addSite, deleteSite} from "@/api/s
|
|||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
import {ElMessage, ElMessageBox} from "element-plus";
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
const userId = reactive(router.currentRoute.value.params.userId)
|
||||||
const siteList = ref([
|
const siteList = ref([
|
||||||
// {
|
// {
|
||||||
// siteName: '松江站',
|
// siteName: '松江站',
|
||||||
@@ -143,7 +145,6 @@ const info = ref({
|
|||||||
totalLength: 0
|
totalLength: 0
|
||||||
})
|
})
|
||||||
const title = ref('新增站点')
|
const title = ref('新增站点')
|
||||||
const isClick = ref(false);
|
|
||||||
const isVisited = ref(false);
|
const isVisited = ref(false);
|
||||||
const total = ref(10);
|
const total = ref(10);
|
||||||
const showAddIcon = ref(true)
|
const showAddIcon = ref(true)
|
||||||
@@ -163,6 +164,7 @@ const formRules = ref({
|
|||||||
const formInstance = ref()
|
const formInstance = ref()
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
getSiteList({
|
getSiteList({
|
||||||
|
userId:userId,
|
||||||
...pageInfo
|
...pageInfo
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
total.value = res.data.total;
|
total.value = res.data.total;
|
||||||
@@ -199,7 +201,7 @@ const handleClickSite = (type) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const goToAddTunnel = (siteId) => {
|
const goToAddTunnel = (siteId) => {
|
||||||
router.push('/tunnel/' + siteId+'/s')
|
router.push('/tunnel/' + siteId+'/s'+'/'+userId)
|
||||||
}
|
}
|
||||||
|
|
||||||
//重置from表单
|
//重置from表单
|
||||||
@@ -258,7 +260,6 @@ const handleMoreDelete = () => {
|
|||||||
siteList.value.map(item=>{
|
siteList.value.map(item=>{
|
||||||
siteIds.value.map(siteItem=>{
|
siteIds.value.map(siteItem=>{
|
||||||
if(item.siteId===siteItem){
|
if(item.siteId===siteItem){
|
||||||
console.log('item.tunnelList',item.tunnelList)
|
|
||||||
if(item.tunnelList.length!==0){
|
if(item.tunnelList.length!==0){
|
||||||
ElMessage.error('该站点下存在隧道,不能删除!')
|
ElMessage.error('该站点下存在隧道,不能删除!')
|
||||||
flag=false
|
flag=false
|
||||||
@@ -508,12 +509,12 @@ const handleCurrentChange = (val) => {
|
|||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
line-height: 42px;
|
line-height: 42px;
|
||||||
|
|
||||||
> div:last-child {
|
|
||||||
cursor: pointer;
|
> span:last-child {
|
||||||
width: 40px;
|
padding:1px 8px;
|
||||||
height: 40px;
|
font-size: 32px;
|
||||||
border: 2px solid #05FEFF;
|
border: 2px solid #05FEFF;
|
||||||
border-radius: 25px;
|
border-radius:10px;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<span>返回</span>
|
<span>返回</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="site-name">
|
<div class="site-name">
|
||||||
{{siteName}}
|
{{ siteName }}
|
||||||
</div>
|
</div>
|
||||||
<div class="tunnel-title"></div>
|
<div class="tunnel-title"></div>
|
||||||
<div class="all-del-btn">
|
<div class="all-del-btn">
|
||||||
@@ -26,7 +26,8 @@
|
|||||||
<div class="top">
|
<div class="top">
|
||||||
<span>{{ item.tunnelName }}</span>
|
<span>{{ item.tunnelName }}</span>
|
||||||
<span>施工长度{{ item.constructionLength }}米 隧道长度{{ item.totalLength }}米</span>
|
<span>施工长度{{ item.constructionLength }}米 隧道长度{{ item.totalLength }}米</span>
|
||||||
<el-checkbox v-model="item.checked" size="large" @change="handleClickSite(item)"/>
|
<el-checkbox v-if="!item.isDefault" v-model="item.checked" size="large" @change="handleClickSite(item)"/>
|
||||||
|
<span v-else>默认</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-center">
|
<div class="box-center">
|
||||||
<div>
|
<div>
|
||||||
@@ -106,13 +107,14 @@
|
|||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
import {ElMessage, ElMessageBox} from "element-plus";
|
||||||
import {getTunnelList,addTunnel, deleteTunnel} from "@/api/tunnelManage";
|
import {getTunnelList, addTunnel, deleteTunnel} from "@/api/tunnelManage";
|
||||||
import {onMounted} from "vue";
|
import {onMounted} from "vue";
|
||||||
import { getSiteDetail} from "@/api/site";
|
import {getSiteDetail} from "@/api/site";
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const showAddIcon = ref(true)
|
const showAddIcon = ref(true)
|
||||||
const siteId = reactive(router.currentRoute.value.params.siteId)
|
const siteId = reactive(router.currentRoute.value.params.siteId)
|
||||||
|
const userId = reactive(router.currentRoute.value.params.userId)
|
||||||
const type = reactive(router.currentRoute.value.params.type)
|
const type = reactive(router.currentRoute.value.params.type)
|
||||||
const formRules = ref({
|
const formRules = ref({
|
||||||
tunnelName: [{required: true, message: '请输入隧道名称', trigger: 'blur'}],
|
tunnelName: [{required: true, message: '请输入隧道名称', trigger: 'blur'}],
|
||||||
@@ -247,7 +249,7 @@ const form = ref({
|
|||||||
serialNumber: '',
|
serialNumber: '',
|
||||||
totalLength: '',
|
totalLength: '',
|
||||||
remarks: '',
|
remarks: '',
|
||||||
isDefault:false
|
isDefault: false
|
||||||
});
|
});
|
||||||
const isEdit = ref(false)
|
const isEdit = ref(false)
|
||||||
const pageInfo = reactive({
|
const pageInfo = reactive({
|
||||||
@@ -255,22 +257,22 @@ const pageInfo = reactive({
|
|||||||
pageSize: 12
|
pageSize: 12
|
||||||
});
|
});
|
||||||
const total = ref(10);
|
const total = ref(10);
|
||||||
onMounted(()=>{
|
onMounted(() => {
|
||||||
getSiteDetail(siteId).then((res) => {
|
getSiteDetail(siteId).then((res) => {
|
||||||
siteName.value = res.data.siteName
|
siteName.value = res.data.siteName
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
const handleGoSiteOrIndex=()=>{
|
const handleGoSiteOrIndex = () => {
|
||||||
if(type==='s'){
|
if (type === 's') {
|
||||||
router.push('/site')
|
router.push('/site/'+userId)
|
||||||
}else if(type==='i'){
|
} else if (type === 'i') {
|
||||||
router.push('/')
|
router.push('/')
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
const getList = () => {
|
const getList = () => {
|
||||||
getTunnelList({
|
getTunnelList({
|
||||||
siteId:siteId,
|
siteId: siteId,
|
||||||
...pageInfo
|
...pageInfo
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
@@ -291,30 +293,29 @@ const handleSubmit = (instance) => {
|
|||||||
// instance.validate(async (valid) => {
|
// instance.validate(async (valid) => {
|
||||||
// console.log('valid',valid)
|
// console.log('valid',valid)
|
||||||
// if (!valid) return
|
// if (!valid) return
|
||||||
const data={
|
const data = {
|
||||||
siteId:siteId,
|
siteId: siteId,
|
||||||
tunnelId:12,
|
...form.value
|
||||||
...form.value
|
}
|
||||||
}
|
if (form.value.tunnelName && form.value.serialNumber && form.value.totalLength) {
|
||||||
if(form.value.tunnelName&&form.value.serialNumber&&form.value.totalLength){
|
addTunnel(data).then(res => {
|
||||||
addTunnel(data).then(res => {
|
if (res.code === 1000) {
|
||||||
if (res.code === 1000) {
|
ElMessage.success('新增成功')
|
||||||
ElMessage.success('新增成功')
|
getList()
|
||||||
getList()
|
isVisited.value = false
|
||||||
isVisited.value = false
|
}
|
||||||
}
|
})
|
||||||
})
|
} else {
|
||||||
}else {
|
ElMessage.warning('请先完善信息再新增')
|
||||||
ElMessage.warning('请先完善信息再新增')
|
}
|
||||||
}
|
|
||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
const handleGoToEditTunnel = (tunnelId) => {
|
const handleGoToEditTunnel = (tunnelId) => {
|
||||||
isEdit.value = true
|
isEdit.value = true
|
||||||
if(type==='s'){
|
if (type === 's') {
|
||||||
router.push('/edit/' + tunnelId+'/s')
|
router.push('/edit/' + tunnelId + '/s/'+userId)
|
||||||
}else if(type==='i'){
|
} else if (type === 'i') {
|
||||||
router.push('/edit/' + tunnelId+'/i')
|
router.push('/edit/' + tunnelId + '/i/'+userId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleChooseAll = () => {
|
const handleChooseAll = () => {
|
||||||
@@ -323,10 +324,10 @@ const handleChooseAll = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
const handleEditDevice = (tunnelId) => {
|
const handleEditDevice = (tunnelId) => {
|
||||||
if(type==='s'){
|
if (type === 's') {
|
||||||
router.push('/device/' + tunnelId+'/s')
|
router.push('/device/' + tunnelId + '/s/'+userId)
|
||||||
}else if(type==='i'){
|
} else if (type === 'i') {
|
||||||
router.push('/device/' + tunnelId+'/i')
|
router.push('/device/' + tunnelId + '/i/'+userId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const restFrom = () => {
|
const restFrom = () => {
|
||||||
@@ -335,7 +336,7 @@ const restFrom = () => {
|
|||||||
serialNumber: '',
|
serialNumber: '',
|
||||||
totalLength: '',
|
totalLength: '',
|
||||||
remarks: '',
|
remarks: '',
|
||||||
isDefault:false
|
isDefault: false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const handleAdd = () => {
|
const handleAdd = () => {
|
||||||
@@ -367,21 +368,6 @@ const handleMoreDelete = () => {
|
|||||||
if (tunnelIds.value.length === 0) {
|
if (tunnelIds.value.length === 0) {
|
||||||
ElMessage.warning('请先选择隧道进行删除')
|
ElMessage.warning('请先选择隧道进行删除')
|
||||||
} else {
|
} else {
|
||||||
let flag=false
|
|
||||||
siteList.value.map(item=>{
|
|
||||||
siteIds.value.map(siteItem=>{
|
|
||||||
if(item.siteId===siteItem){
|
|
||||||
console.log('item.tunnelList',item.tunnelList)
|
|
||||||
if(item.tunnelList.length!==0){
|
|
||||||
ElMessage.error('该站点下存在隧道,不能删除!')
|
|
||||||
flag=false
|
|
||||||
}else {
|
|
||||||
flag=true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
if(flag){
|
|
||||||
ElMessageBox.confirm(`是否确定删除该隧道`, '系统提示', {
|
ElMessageBox.confirm(`是否确定删除该隧道`, '系统提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
@@ -399,7 +385,6 @@ const handleMoreDelete = () => {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -417,6 +402,7 @@ const handleMoreDelete = () => {
|
|||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
line-height: 61px;
|
line-height: 61px;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-radio-group) {
|
:deep(.el-radio-group) {
|
||||||
margin-top: 10px;
|
margin-top: 10px;
|
||||||
}
|
}
|
||||||
@@ -448,6 +434,7 @@ const handleMoreDelete = () => {
|
|||||||
height: 18px;
|
height: 18px;
|
||||||
background: #05FEFF;
|
background: #05FEFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
:deep(.el-dialog) {
|
:deep(.el-dialog) {
|
||||||
border: 2px solid #05FEFF;
|
border: 2px solid #05FEFF;
|
||||||
background: #0D6578;
|
background: #0D6578;
|
||||||
@@ -619,23 +606,13 @@ const handleMoreDelete = () => {
|
|||||||
color: #5CE4F2;
|
color: #5CE4F2;
|
||||||
}
|
}
|
||||||
|
|
||||||
> div:last-child {
|
|
||||||
cursor: pointer;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
border: 2px solid #05FEFF;
|
|
||||||
border-radius: 25px;
|
|
||||||
position: relative;
|
|
||||||
|
|
||||||
.clickColor {
|
> span:last-child {
|
||||||
position: absolute;
|
padding:1px 8px;
|
||||||
top: 7px;
|
font-size: 32px;
|
||||||
left: 6.5px;
|
border: 2px solid #05FEFF;
|
||||||
width: 25px;
|
border-radius:10px;
|
||||||
height: 25px;
|
position: relative;
|
||||||
background-color: #05FEFF;
|
|
||||||
border-radius: 25px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ const currentSiteId = ref(0);
|
|||||||
const currentSite = ref("");
|
const currentSite = ref("");
|
||||||
const siteList = ref([])
|
const siteList = ref([])
|
||||||
const currentUser = ref("");
|
const currentUser = ref("");
|
||||||
|
const currentUserId = ref(0);
|
||||||
const currentDate = ref(dateFormat());
|
const currentDate = ref(dateFormat());
|
||||||
const tunnelBtn = ref();
|
const tunnelBtn = ref();
|
||||||
const tunnelList = ref([]);
|
const tunnelList = ref([]);
|
||||||
@@ -124,6 +125,7 @@ onMounted(() => {
|
|||||||
const getUser = () => {
|
const getUser = () => {
|
||||||
getUserInfo().then(res => {
|
getUserInfo().then(res => {
|
||||||
currentUser.value = res.data.user.userName
|
currentUser.value = res.data.user.userName
|
||||||
|
currentUserId.value = res.data.user.userId
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
const getDefaultSite=(siteId)=>{
|
const getDefaultSite=(siteId)=>{
|
||||||
@@ -179,9 +181,9 @@ const changeTunnel = (e) => {
|
|||||||
const manageSelect = (index) => {
|
const manageSelect = (index) => {
|
||||||
console.log("首页点击-", index);
|
console.log("首页点击-", index);
|
||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
router.push("/site");
|
router.push("/site"+'/'+currentUserId.value);
|
||||||
} else if (index === 1) {
|
} else if (index === 1) {
|
||||||
router.push("/tunnel/" + currentSiteId.value+'/i');
|
router.push("/tunnel/" + currentSiteId.value+'/i'+'/'+currentUserId.value);
|
||||||
} else if (index === 2) {
|
} else if (index === 2) {
|
||||||
router.push("/user/" + currentSiteId.value);
|
router.push("/user/" + currentSiteId.value);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user