邓洁: 站点接口及修改细节

This commit is contained in:
邓洁
2023-12-20 21:24:52 +08:00
parent a404f99385
commit 30384547af
10 changed files with 138 additions and 131 deletions

View File

@@ -16,7 +16,7 @@ steps:
- export NODE_MODULES_PATH=`pwd`/node_modules
- npm config set registry https://registry.npm.taobao.org
- set NODE_OPTIONS=--openssl-legacy-provider
- npm install
# - npm install
- npm run build
- echo $NODE_MODULES_PATH
- cp -r dist /app/build/$DRONE_REPO_NAME

View File

@@ -2,7 +2,7 @@ import request from '@/utils/request.js'
export const getSiteList = (params) => {
return request({
url: '/tunnel/site/screenlist',
url: '/tunnel/site/screen/list',
method: 'get',
params
})

View File

@@ -599,3 +599,11 @@ input[type="number"] {
font-size: 38px;
}
}
.el-pagination.is-background .btn-prev:disabled{
background-color: transparent!important;
color: #60DDDE!important;
}
.el-pagination.is-background .btn-next:disabled{
background-color: transparent!important;
color: #60DDDE!important;
}

View File

@@ -17,7 +17,7 @@
@click="handleOpenAirChart(item)"
/>
<div class="digital-tunnel">
<el-dialog v-model="isWindSpeedVisited" :title="'风速监控数据'" width="2175px" :modal="false">
<el-dialog :close-on-click-modal="false" v-model="isWindSpeedVisited" :title="'风速监控数据'" width="2175px" :modal="false">
<div class="left-top-icon"></div>
<div class="right-top-icon"></div>
<div class="chat-dialog">
@@ -36,7 +36,7 @@
</el-dialog>
</div>
<div class="digital-tunnel">
<el-dialog v-model="isAirVisited" :title="airTitle+'监控数据'" width="2175px" :modal="false">
<el-dialog :close-on-click-modal="false" v-model="isAirVisited" :title="airTitle+'监控数据'" width="2175px" :modal="false">
<div class="left-top-icon"></div>
<div class="right-top-icon"></div>
<div class="chat-dialog">

View File

@@ -14,6 +14,7 @@
<div class="digital-tunnel">
<el-dialog
:close-on-click-modal="false"
v-model="isBadGasVisited"
title="有害气体监控数据"
width="2175px"
@@ -48,7 +49,7 @@ import {getBadGasEchartsInfo} from "@/api/largeScreen";
const props = defineProps({
list: Array,
badGasData: Array,
tunnelId:Number
tunnelId: Number
});
const timeList = ref(["年", "月", "日"]);
const selectTimeButton = ref(2);
@@ -67,27 +68,27 @@ watch(
});
});
},
{ deep: true }
{deep: true}
);
watch(
() => props.badGasData,
(now) => {
if(now.sensorList===null){
badGasList.value=[]
}else {
if (now.sensorList === null) {
badGasList.value = []
} else {
getBadGasInfo(now.sensorList);
}
},
{ deep: true }
{deep: true}
);
watch(
() => props.tunnelId,
(now) => {
props.tunnelId=now
props.tunnelId = now
},
{ deep: true }
{deep: true}
);
const timeSelect = (index) => {
console.log("选择时间", index);
@@ -100,7 +101,7 @@ const timeSelect = (index) => {
}
};
const getBadGasInfo = (now) => {
if(now===null)return;
if (now === null) return;
let windPressureObj = {};
let windPressureArr = [];
now?.map((item) => {
@@ -129,7 +130,7 @@ const changeData = (item) => {
};
};
const getBadGasChartInfo = () => {
let id =props.tunnelId
let id = props.tunnelId
getBadGasEchartsInfo(id).then(res => {
if (res?.code === 1000) {
isBadGasVisited.value = true
@@ -180,11 +181,11 @@ const initChart = (type, values) => {
backgroundColor: "rgba(20,36,51,0.7)", // 设置背景颜色为透明
borderColor: "#6087BA", // 设置边框颜色为透明
padding: 0, // 设置内边距为0
borderWidth:2,
borderWidth: 2,
textStyle: {
fontSize: 40,
},
formatter: (params)=> {
formatter: (params) => {
let res = ` <div style="font-size: 52px;font-family: PingFang SC-Regular, PingFang SC;font-weight: 400;color: #EFEEEE;margin-bottom: -30px">${params[0].name}</div>` + '<br/>'
for (let i = 0; i < params.length; i++) {
res += `
@@ -238,7 +239,7 @@ const initChart = (type, values) => {
// "23:00",
// "24:00",
// ],
data:type,
data: type,
axisLabel: {
textStyle: {
fontSize: 45,
@@ -264,7 +265,7 @@ const initChart = (type, values) => {
// 56, 12, 89, 34, 71, 43, 67, 20, 98, 72, 19, 61, 3, 85, 47, 92, 17, 76,
// 69, 25, 31, 49, 81, 63,
// ],
data:values.carbonDioxideValues,
data: values.carbonDioxideValues,
type: "line",
smooth: true,
symbolSize: 24,
@@ -278,7 +279,7 @@ const initChart = (type, values) => {
// 96, 38, 75, 10, 62, 81, 41, 27, 69, 16, 33, 57, 73, 87, 22, 46, 11,
// 79, 51, 29, 60, 48, 83, 15,
// ],
data:values.carbonMonoxideValues,
data: values.carbonMonoxideValues,
type: "line",
smooth: true,
symbolSize: 24,
@@ -292,7 +293,7 @@ const initChart = (type, values) => {
// 53, 88, 10, 67, 92, 31, 74, 46, 20, 37, 85, 16, 63, 70, 41, 99, 25,
// 77, 82, 13, 68, 49, 55, 7, 39,
// ],
data:values.nitrogenDioxideValues,
data: values.nitrogenDioxideValues,
type: "line",
smooth: true,
symbolSize: 24,
@@ -306,7 +307,7 @@ const initChart = (type, values) => {
// 37, 19, 85, 62, 28, 91, 43, 76, 14, 68, 33, 52, 71, 26, 97, 49, 82,
// 17, 66, 30, 78, 55, 23, 47,
// ],
data:values.sulfurMonoxideValues,
data: values.sulfurMonoxideValues,
type: "line",
smooth: true,
symbolSize: 24,
@@ -320,7 +321,7 @@ const initChart = (type, values) => {
// 6, 30, 91, 77, 28, 51, 42, 83, 16, 65, 35, 72, 18, 96, 47, 79, 100,
// 23, 80, 44, 62, 59, 13, 86,
// ],
data:values.sulfurDioxideValues,
data: values.sulfurDioxideValues,
type: "line",
smooth: true,
symbolSize: 24,
@@ -334,7 +335,7 @@ const initChart = (type, values) => {
// 13, 27, 39, 51, 62, 73, 84, 95, 10, 20, 30, 40, 50, 60, 70, 80, 90,
// 100, 11, 21, 31, 41, 51,
// ],
data:values.hydrogenSulfideValues,
data: values.hydrogenSulfideValues,
type: "line",
smooth: true,
symbolSize: 24,
@@ -344,7 +345,7 @@ const initChart = (type, values) => {
},
],
};
myEcharts.setOption(option,true);
myEcharts.setOption(option, true);
//图表大小自适应窗口大小变化
window.onresize = () => {
myEcharts.resize();

View File

@@ -11,7 +11,7 @@
</div>
</div>
<div class="digital-tunnel">
<el-dialog v-model="isVisited" width="2175px" :modal="false">
<el-dialog :close-on-click-modal="false" v-model="isVisited" width="2175px" :modal="false">
<div class="left-top-icon"></div>
<div class="right-top-icon"></div>
<div class="top-tag">

View File

@@ -6,7 +6,7 @@
@click="handleOpenChart(item,index+1)"/>
</div>
<div class="digital-tunnel">
<el-dialog 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="right-top-icon"></div>
<div class="chat-dialog">

View File

@@ -27,7 +27,7 @@
<div class="box-center">
<div class="left-img"></div>
<div class="right-tunnel">
<div>隧道数量{{ item.info.tunnelNum }}
<div>隧道数量{{ item.tunnelList.length }}
</div>
<div>
<div class="tunnel" v-if="item.info.tunnelName">
@@ -57,7 +57,7 @@
<div style="cursor: pointer">添加站点</div>
</div>
</div>
<el-dialog v-model="isVisited" width="1958px">
<el-dialog :close-on-click-modal="false" v-model="isVisited" width="1958px">
<div class="siteId">
<span>{{ title }}</span>
</div>
@@ -101,41 +101,40 @@ import {ElMessage, ElMessageBox} from "element-plus";
const router = useRouter()
const siteList = ref([
{
siteName: '松江站',
info:{
tunnelNum: 1,
tunnelName: '一号隧道',
constructionLength: 500,
implementationLength: 10
}
},
{
siteName: '松江站',
info:{
tunnelNum: 1,
tunnelName: '二号隧道',
constructionLength: 500,
implementationLength: 10
}
},
{
siteName: '松江站',
info:{
tunnelNum: 1,
tunnelName: '三号隧道',
constructionLength: 500,
implementationLength: 10
}
}
// {
// siteName: '松江站',
// info:{
// tunnelNum: 1,
// tunnelName: '一号隧道',
// constructionLength: 500,
// implementationLength: 10
// }
// },
// {
// siteName: '松江站',
// info:{
// tunnelNum: 1,
// tunnelName: '二号隧道',
// constructionLength: 500,
// implementationLength: 10
// }
// },
// {
// siteName: '松江站',
// info:{
// tunnelNum: 1,
// tunnelName: '三号隧道',
// constructionLength: 500,
// implementationLength: 10
// }
// }
])
const siteIds = ref([])
const siteNameList = ref([])
const info = ref({
tunnelNum: 0,
tunnelName: '',
constructionLength: 0,
implementationLength: 0
totalLength: 0
})
const title = ref('新增站点')
const isClick = ref(false);
@@ -160,16 +159,18 @@ const getList = () => {
...pageInfo
}).then((res) => {
total.value = res.data.total;
showAddIcon.value = total.value !== 6;
showAddIcon.value = total.value % 6!==0;
res.data.rows.map(item => {
if (item.tunnelList === null || item.tunnelList === []) {
if (item.tunnelList === null || item.tunnelList.length === 0) {
item.info = info.value
}else{
item.info=item.tunnelList[0]
}
item.checked = false
})
// siteList.value = res.data.rows;
siteList.value = res.data.rows;
console.log('res',siteList.value)
});
}
getList()
@@ -191,8 +192,8 @@ const handleClickSite = (type) => {
}
}
const goToAddTunnel = (siteId) => {
// router.push('/tunnel/' + siteId)
router.push('/tunnel/1')
router.push('/tunnel/' + siteId)
// router.push('/tunnel/1')
}
//重置from表单
const restFrom = () => {
@@ -205,11 +206,11 @@ const restFrom = () => {
const handleEdit = (item) => {
title.value = '编辑站点'
restFrom()
// getSiteDetail(item.siteId).then((res) => {
// form.value = res.data;
getSiteDetail(item.siteId).then((res) => {
form.value = res.data;
form.value = item;
isVisited.value = true
// });
});
}
const handleAdd = () => {
@@ -218,21 +219,21 @@ const handleAdd = () => {
isVisited.value = true
}
const handleSubmit = (instance) => {
// if (!instance) return
// instance.validate(async (valid) => {
// if (!valid) return
// if (title.value === '编辑站点') {
// editSite(form.value).then(() => {
// isVisited.value = false
// getList()
// });
// } else {
// addSite(form.value).then(() => {
if (!instance) return
instance.validate(async (valid) => {
if (!valid) return
if (title.value === '编辑站点') {
editSite(form.value).then(() => {
isVisited.value = false
// getList()
// });
// }
// })
getList()
});
} else {
addSite(form.value).then(() => {
isVisited.value = false
getList()
});
}
})
}
const handleChooseAll=()=>{
siteList.value.map(item=>{
@@ -249,16 +250,16 @@ const handleMoreDelete = () => {
type: 'warning',
customClass: 'delBox'
}).then(() => {
// deleteSite(siteIds.value).then(res => {
// if (res.code === 1000) {
// ElMessage.success(res.msg)
// getList()
// siteIds.value = []
// siteNameList.value = []
// } else {
// ElMessage.error(res.msg)
// }
// })
deleteSite(siteIds.value).then(res => {
if (res.code === 1000) {
ElMessage.success(res.msg)
getList()
siteIds.value = []
siteNameList.value = []
} else {
ElMessage.error(res.msg)
}
})
})
}
}

View File

@@ -59,7 +59,7 @@
<div style="cursor: pointer">添加隧道</div>
</div>
</div>
<el-dialog v-model="isVisited" width="1958px">
<el-dialog :close-on-click-modal="false" v-model="isVisited" width="1958px">
<div class="siteId">
<span>{{ title }}</span>
</div>
@@ -602,16 +602,15 @@ const handleMoreDelete = () => {
:deep(.btn-prev) {
background-color: transparent;
font-size: 38px;
font-family: MicrosoftYaHei, MicrosoftYaHei;
font-weight: bold;
color: #60DDDE;
margin-right: 20px;
}
:deep(.btn-next) {
background-color: transparent;
font-size: 38px;
font-family: MicrosoftYaHei, MicrosoftYaHei;
font-weight: bold;
color: #60DDDE;
margin-left: 30px;
@@ -624,7 +623,6 @@ const handleMoreDelete = () => {
border-radius: 50%;
color: #071F40;
font-size: 38px;
font-family: MicrosoftYaHei, MicrosoftYaHei;
font-weight: bold;
}
@@ -639,7 +637,6 @@ const handleMoreDelete = () => {
border-radius: 50%;
background-color: transparent;
font-size: 38px;
font-family: MicrosoftYaHei, MicrosoftYaHei;
font-weight: bold;
color: #60DDDE;
}

View File

@@ -50,7 +50,7 @@
</div>
</div>
</div>
<el-dialog v-model="isVisited" width="1658px">
<el-dialog :close-on-click-modal="false" v-model="isVisited" width="1658px">
<div class="siteId">
<span>{{ title }}</span>
</div>