Merge pull request 'dev' (#309) from dev into master

Reviewed-on: http://git.feashow.cn/clay/tunnel-cloud-web/pulls/309
This commit is contained in:
2024-03-05 15:00:15 +00:00
11 changed files with 162 additions and 60 deletions

View File

@@ -18,6 +18,19 @@
body { body {
background-color: #f5f5f5; background-color: #f5f5f5;
} }
.allLoading.el-loading-mask.is-fullscreen{
.el-loading-spinner{
.circular{
width: 75px;
height: 75px;
}
.el-loading-text{
font-size: 26px;
letter-spacing: 2px;
}
}
}
.el-container { .el-container {
height: 100%; height: 100%;

View File

@@ -4,11 +4,11 @@
<div class="fan-speed"> <div class="fan-speed">
<div> <div>
<img src="@/assets/images/airInfo/fan-v-icon.png" alt=""/> <img src="@/assets/images/airInfo/fan-v-icon.png" alt=""/>
<div class="fan-info" @click="handleOpenChart(windSpeedId)"> <div class="fan-info" @click="handleOpenChart(windSpeedType,windSpeedId)">
<div class="input-fan"><span>风速</span>{{ windSpeed }}m/s</div> <div class="input-fan"><span>风速</span>{{ windSpeed }}m/s</div>
</div> </div>
</div> </div>
<div class="wind-direction-info" @click="handleOpenChart(windDirectionSpeedId)"> <div class="wind-direction-info" @click="handleOpenChart(windDirectionSpeedType,windDirectionSpeedId)">
<div class="input-fan"><span>风向</span>{{ windDirection }} °</div> <div class="input-fan"><span>风向</span>{{ windDirection }} °</div>
</div> </div>
</div> </div>
@@ -64,10 +64,12 @@ const props = defineProps({
const chooseDayRef = ref(); const chooseDayRef = ref();
const chooseMonthRef = ref(); const chooseMonthRef = ref();
const windSpeed = ref(0) const windSpeed = ref(0)
const windDirection = ref(0) const windDirection = ref(null)
const loadingText = ref('加载中...') const loadingText = ref('加载中...')
const windSpeedId = ref(0) const windSpeedId = ref(0)
const windSpeedType = ref(null)
const windDirectionSpeedId = ref(0) const windDirectionSpeedId = ref(0)
const windDirectionSpeedType = ref(null)
const dialogTitle = ref('风速') const dialogTitle = ref('风速')
const openDialogId = ref(0) const openDialogId = ref(0)
const airList = ref([]) const airList = ref([])
@@ -85,27 +87,34 @@ watch(() => props.list, (now) => {
}) })
}, {deep: true}); }, {deep: true});
watch(() => props.airData, (now) => { watch(() => props.airData, (now) => {
if (now.sensorList.length !== 0) { if (now.sensorList.length === 0) {
if (now.sensorList.length === 0) {
airList.value = []
} else {
getAirInfo(now.sensorList)
}
} else {
airList.value = [] airList.value = []
windSpeed.value = 0 windSpeed.value = null
windDirection.value = null
} else {
getAirInfo(now.sensorList)
} }
// if (now.sensorList.length !== 0) {
// if (now.sensorList.length === 0) {
// airList.value = []
// } else {
// getAirInfo(now.sensorList)
// }
// } else {
// airList.value = []
// windSpeed.value = 0
// }
}, {deep: true}); }, {deep: true});
const daySelect = (val) => { const daySelect = (val) => {
getChartInfo(openDialogId.value, 'day',val) getChartInfo(openDialogId.value, 'day', val)
} }
const monthSelect = (val) => { const monthSelect = (val) => {
getChartInfo(openDialogId.value, 'month',val) getChartInfo(openDialogId.value, 'month', val)
} }
const getChartInfo = (equipmentId, type = 'day',time='') => { const getChartInfo = (equipmentId, type = 'day', time = '') => {
isWindSpeedVisited.value = true isWindSpeedVisited.value = true
showSpeedLoading.value = true showSpeedLoading.value = true
getEchartsInfo(equipmentId,time, type).then(res => { getEchartsInfo(equipmentId, time, type).then(res => {
if (res?.code === 1000) { if (res?.code === 1000) {
showSpeedLoading.value = false showSpeedLoading.value = false
nextTick(() => { nextTick(() => {
@@ -121,11 +130,11 @@ const getChartInfo = (equipmentId, type = 'day',time='') => {
} }
const handleOpenChart = (id, type) => { const handleOpenChart = (id, type) => {
selectTimeButton.value = 2 selectTimeButton.value = 2
nextTick(()=>{ nextTick(() => {
if(chooseMonthRef.value){ if (chooseMonthRef.value) {
chooseMonthRef.value.clearData() chooseMonthRef.value.clearData()
} }
if(chooseDayRef.value){ if (chooseDayRef.value) {
chooseDayRef.value.clearData() chooseDayRef.value.clearData()
} }
}) })
@@ -134,13 +143,13 @@ const handleOpenChart = (id, type) => {
openDialogId.value = id.equipmentId openDialogId.value = id.equipmentId
getChartInfo(id.equipmentId, 'day') getChartInfo(id.equipmentId, 'day')
} else { } else {
if (id === 11) { if (id === "windDirection") {
dialogTitle.value = '风向' dialogTitle.value = '风向'
} else { } else {
dialogTitle.value = '风速' dialogTitle.value = '风速'
} }
openDialogId.value = id openDialogId.value = type
getChartInfo(id, 'day') getChartInfo(type, 'day')
} }
} }
@@ -188,9 +197,11 @@ const getAirInfo = (now) => {
airObj = changeData(item) airObj = changeData(item)
airArr.push(airObj) airArr.push(airObj)
} else if (item.equipmentType === "windSpeed") { } else if (item.equipmentType === "windSpeed") {
windSpeedType.value = item.equipmentType
windSpeedId.value = item.equipmentId windSpeedId.value = item.equipmentId
windSpeed.value = item.value windSpeed.value = item.value
} else if (item.equipmentType === "windDirection") { } else if (item.equipmentType === "windDirection") {
windDirectionSpeedType.value = item.equipmentType
windDirectionSpeedId.value = item.equipmentId windDirectionSpeedId.value = item.equipmentId
windDirection.value = item.value windDirection.value = item.value
} }

View File

@@ -1,6 +1,10 @@
<template> <template>
<div id="used-ele" :style="{ backgroundColor: bgImage }" @click="handleOpenChart"> <div id="used-ele" :style="{ backgroundColor: bgImage }" @click="handleOpenChart">
<div class="content"> <div v-if="electricityConsumptionMonthly===0&&monthlySavings===0" class="showNull ">
<div class="loading" v-if="loading===0"></div>
{{ loading === 0 ? '加载中...' : '暂无数据~' }}
</div>
<div v-else class="content">
<div class="item"> <div class="item">
<div class="container" ref="length"> <div class="container" ref="length">
<div class="value" ref="valueA"></div> <div class="value" ref="valueA"></div>
@@ -23,6 +27,7 @@
<div class="ele-right-bottom-icon"></div> <div class="ele-right-bottom-icon"></div>
</div> </div>
</div> </div>
<div class="digital-tunnel"> <div class="digital-tunnel">
<el-dialog :close-on-click-modal="false" 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="left-top-icon"></div>
@@ -88,7 +93,8 @@ import {getEleEchartsInfo} from "@/api/largeScreen";
const props = defineProps({ const props = defineProps({
list: Array, list: Array,
eleData: Array eleData: Array,
loading: Number
}); });
const loadingText = ref('加载中...') const loadingText = ref('加载中...')
@@ -114,20 +120,27 @@ const bgImage = computed(() =>
? "#2E5589" ? "#2E5589"
: "rgba(6,34,71,0.78)" : "rgba(6,34,71,0.78)"
); );
watch(() => props.loading, (now) => {
props.loading = now
}, {deep: true});
watch(() => props.eleData, (now) => { watch(() => props.eleData, (now) => {
if (now) { if (now) {
let fanObj = {} let fanObj = {}
now.frequencyChangerList.forEach(item => { now.frequencyChangerList.forEach(item => {
fanObj = { if (item.equipmentId === 22 || item.equipmentId === 23) {
value: item.equipmentId, fanObj = {
label: changeNum(item.equipmentId) value: item.equipmentId,
label: changeNum(item.equipmentId)
}
} }
fanList.value.push(fanObj) fanList.value.push(fanObj)
}) })
getBasicData(now.largeScreenElectricity) getBasicData(now.largeScreenElectricity)
} }
setValueA() nextTick(() => {
setValueB() setValueA()
setValueB()
})
}, {deep: true}); }, {deep: true});
// watch(() => props.list, (now) => { // watch(() => props.list, (now) => {
// console.log(now,props.eleData,'大V大V') // console.log(now,props.eleData,'大V大V')

View File

@@ -140,6 +140,9 @@ const getScreenInfo = (now) => {
} }
windPressureArr.push(windPressureObj) windPressureArr.push(windPressureObj)
}) })
if(windPressureArr.map(item=>item.equipmentName).includes('10号风压')){
windPressureArr.push(windPressureArr.shift())
}
wpList.value = windPressureArr wpList.value = windPressureArr
} }
/** /**

View File

@@ -283,7 +283,7 @@
</template> </template>
<script setup> <script setup>
import {ElMessage} from "element-plus"; import {ElLoading, ElMessage} from "element-plus";
import {getEquipmentList, editEquipment, getTunnelDetail} from "@/api/tunnelManage"; import {getEquipmentList, editEquipment, getTunnelDetail} from "@/api/tunnelManage";
import TunnelTitle from "@/components/tunnelTitle/index.vue"; import TunnelTitle from "@/components/tunnelTitle/index.vue";
const router = useRouter() const router = useRouter()
@@ -362,6 +362,12 @@ const handleChangeMenu = (e) => {
} }
const getList = () => { const getList = () => {
const loading = ElLoading.service({
lock: true,
text: '正在加载系统资源...',
background: 'rgba(0, 0, 0, 0.7)',
customClass:'allLoading'
})
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
@@ -384,6 +390,7 @@ const getList = () => {
} }
}) })
} }
loading.close()
}) })
} }
const getTunnel = () => { const getTunnel = () => {

View File

@@ -75,7 +75,7 @@
<script setup> <script setup>
import TunnelScene from "@/components/content/tunnelScene/TunnelScene.vue"; import TunnelScene from "@/components/content/tunnelScene/TunnelScene.vue";
import {editTunnel, getTunnelDetail} from "@/api/tunnelManage"; import {editTunnel, getTunnelDetail} from "@/api/tunnelManage";
import {ElMessage} from "element-plus"; import {ElLoading, ElMessage} from "element-plus";
import {initSceneData} from "@/api/tunnelScene"; import {initSceneData} from "@/api/tunnelScene";
import TunnelTitle from "@/components/tunnelTitle/index.vue"; import TunnelTitle from "@/components/tunnelTitle/index.vue";
@@ -97,10 +97,17 @@ const form = ref({
remarks: "", remarks: "",
}); });
const getTunnel = () => { const getTunnel = () => {
const loading = ElLoading.service({
lock: true,
text: '正在加载系统资源...',
background: 'rgba(0, 0, 0, 0.7)',
customClass:'allLoading'
})
getTunnelDetail(tunnelId).then((res) => { getTunnelDetail(tunnelId).then((res) => {
if (res?.code === 1000) { if (res?.code === 1000) {
form.value = res.data; form.value = res.data;
} }
loading.close()
}); });
}; };
getTunnel(); getTunnel();

View File

@@ -76,10 +76,11 @@ const handleLogin = (instance) => {
await authStore.userLogin(loginForm).then((res) => { await authStore.userLogin(loginForm).then((res) => {
if (res) { if (res) {
ElLoading.service({ ElLoading.service({
text: "正在加载系统资源",
background: "#409eff",
lock: true, lock: true,
}); text: '登录中...',
background: 'rgba(0, 0, 0, 0.7)',
customClass:'allLoading'
})
router.push("/"); router.push("/");
} else { } else {
getCode(); getCode();
@@ -89,14 +90,14 @@ const handleLogin = (instance) => {
}; };
getCode(); getCode();
onBeforeUnmount(() => { onBeforeUnmount(() => {
ElLoading.service({ ElLoading.service({
text: "正在加载系统资源",
background: "#409eff",
lock: true, lock: true,
}).close(); text: '登录中...',
}); background: 'rgba(0, 0, 0, 0.7)',
customClass:'allLoading'
}).close()
})
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View File

@@ -145,6 +145,7 @@ import {editSite, getSiteDetail, getSiteList, addSite, deleteSite} from "@/api/s
import {ElMessage, ElMessageBox} from "element-plus"; import {ElMessage, ElMessageBox} from "element-plus";
import TunnelTitle from "@/components/tunnelTitle/index.vue"; import TunnelTitle from "@/components/tunnelTitle/index.vue";
import {getToken} from '@/utils/auth' import {getToken} from '@/utils/auth'
import {ElLoading} from 'element-plus'
const router = useRouter() const router = useRouter()
const userId = reactive(router.currentRoute.value.params.userId) const userId = reactive(router.currentRoute.value.params.userId)
@@ -201,27 +202,35 @@ const handleGoHome = () => {
router.push('/' + 'siteToHome/' + siteId) router.push('/' + 'siteToHome/' + siteId)
} }
const getList = () => { const getList = () => {
const loading = ElLoading.service({
lock: true,
text: '正在加载系统资源...',
background: 'rgba(0, 0, 0, 0.7)',
customClass:'allLoading'
})
getSiteList({ getSiteList({
userId: userId, userId: userId,
...pageInfo ...pageInfo
}).then((res) => { }).then((res) => {
total.value = res.data.total; if (res.code === 1000) {
if (total.value == 0) { total.value = res.data.total;
if (total.value == 0) {
} else {
showAddIcon.value = total.value % 6 !== 0;
}
showFirst.value = total.value / pageInfo.pageSize > 1;
res.data.rows.map(item => {
if (item.tunnelList === null || item.tunnelList.length === 0) {
item.info = info.value
} else { } else {
item.info = item.tunnelList[0] showAddIcon.value = total.value % 6 !== 0;
} }
item.checked = false showFirst.value = total.value / pageInfo.pageSize > 1;
}) res.data.rows.map(item => {
if (item.tunnelList === null || item.tunnelList.length === 0) {
siteList.value = res.data.rows; item.info = info.value
} else {
item.info = item.tunnelList[0]
}
item.checked = false
})
siteList.value = res.data.rows;
}
loading.close()
}); });
} }
getList() getList()
@@ -259,10 +268,17 @@ const restFrom = () => {
const handleEdit = (item) => { const handleEdit = (item) => {
title.value = '编辑站点' title.value = '编辑站点'
restFrom() restFrom()
const loading = ElLoading.service({
lock: true,
text: '正在加载系统资源...',
background: 'rgba(0, 0, 0, 0.7)',
customClass:'allLoading'
})
getSiteDetail(item.siteId).then((res) => { getSiteDetail(item.siteId).then((res) => {
form.value = res.data; form.value = res.data;
form.value = item; form.value = item;
isVisited.value = true isVisited.value = true
loading.close()
}); });
} }
const handleUpload = (siteId) => { const handleUpload = (siteId) => {
@@ -786,8 +802,9 @@ const handleCurrentChange = (val) => {
color: #60DDDE; color: #60DDDE;
font-size: 38px; font-size: 38px;
font-weight: bold; font-weight: bold;
:deep(.el-pagination.is-background ) { :deep(.el-pagination.is-background ) {
.btn-next,.btn-prev { .btn-next, .btn-prev {
background-color: transparent; background-color: transparent;
} }

View File

@@ -160,7 +160,7 @@
</template> </template>
<script setup> <script setup>
import {ElMessage, ElMessageBox} from "element-plus"; import {ElLoading, ElMessage, ElMessageBox} from "element-plus";
import {getTunnelList, addTunnel, deleteTunnel} from "@/api/tunnelManage"; import {getTunnelList, addTunnel, deleteTunnel} from "@/api/tunnelManage";
import {getSiteDrawing, getSiteDetail} from "@/api/site"; import {getSiteDrawing, getSiteDetail} from "@/api/site";
import TunnelTitle from "@/components/tunnelTitle/index.vue"; import TunnelTitle from "@/components/tunnelTitle/index.vue";
@@ -323,6 +323,12 @@ const getTunnel = (id) => {
} }
getTunnel(siteId) getTunnel(siteId)
const getList = () => { const getList = () => {
const loading = ElLoading.service({
lock: true,
text: '正在加载系统资源...',
background: 'rgba(0, 0, 0, 0.7)',
customClass:'allLoading'
})
getTunnelList({ getTunnelList({
siteId: siteId, siteId: siteId,
...pageInfo ...pageInfo
@@ -335,6 +341,7 @@ const getList = () => {
} else { } else {
ElMessage.warning(res.msg) ElMessage.warning(res.msg)
} }
loading.close()
}) })
} }
getList() getList()

View File

@@ -42,7 +42,7 @@
:close-on-click-modal="false" :close-on-press-escape="false"> :close-on-click-modal="false" :close-on-press-escape="false">
<fan-info v-if="showFan" :list="socketData.leftData" :fan-data="largeScreenData" <fan-info v-if="showFan" :list="socketData.leftData" :fan-data="largeScreenData"
:transducer-data="largeScreenData" :loading="showFanLoading" :tunnel-id="tunnelId"/> :transducer-data="largeScreenData" :loading="showFanLoading" :tunnel-id="tunnelId"/>
<used-ele v-if="showFan" :list="socketData.leftData" :ele-data="largeScreenData"/> <used-ele v-if="showFan" :list="socketData.leftData" :loading="showUsedLoading" :ele-data="largeScreenData"/>
</el-drawer> </el-drawer>
<div v-if="drawerLeft" class="left-arrow" @click="closeLeft"></div> <div v-if="drawerLeft" class="left-arrow" @click="closeLeft"></div>
<div v-else class="shrink-left" @click="closeLeft"></div> <div v-else class="shrink-left" @click="closeLeft"></div>
@@ -52,7 +52,7 @@
:close-on-click-modal="false" :close-on-press-escape="false"> :close-on-click-modal="false" :close-on-press-escape="false">
<wind-pressure-list v-if="showFan" :list="socketData.windPressure" :win-data="largeScreenData" <wind-pressure-list v-if="showFan" :list="socketData.windPressure" :win-data="largeScreenData"
:loading="showWindLoading"/> :loading="showWindLoading"/>
<air-info v-if="showFan" :list="socketData.sensor" :air-data="largeScreenData"/> <air-info v-if="showFan" :list="socketData.sensor" :air-data="largeScreenData" />
<bad-gas-info v-if="showFan" :list="socketData.sensor" :bad-gas-data="largeScreenData" :tunnelId="tunnelId" <bad-gas-info v-if="showFan" :list="socketData.sensor" :bad-gas-data="largeScreenData" :tunnelId="tunnelId"
:loading="showBadLoading"/> :loading="showBadLoading"/>
</el-drawer> </el-drawer>
@@ -187,6 +187,7 @@ const loading = ref(false);
const tableEmptyText = ref("加载中~"); const tableEmptyText = ref("加载中~");
const initialIndex = ref(0) const initialIndex = ref(0)
const showFanLoading = ref(0) const showFanLoading = ref(0)
const showUsedLoading = ref(0)
const showWindLoading = ref(0) const showWindLoading = ref(0)
const showBadLoading = ref(0) const showBadLoading = ref(0)
const drawerRight = ref(true); const drawerRight = ref(true);
@@ -410,6 +411,12 @@ const getScreenInfo = (id) => {
} else { } else {
showFanLoading.value = 1 showFanLoading.value = 1
} }
const useEleData=res.data.largeScreenElectricity
if(useEleData.electricityConsumptionCount==null||useEleData.monthlySavings==null){
showUsedLoading.value = 0
}else {
showUsedLoading.value = 1
}
if (res.data.windPressureSensorList.length !== 0) { if (res.data.windPressureSensorList.length !== 0) {
res.data.windPressureSensorList.forEach((item) => { res.data.windPressureSensorList.forEach((item) => {
option = { option = {
@@ -476,7 +483,6 @@ const getList = () => {
} }
}) })
} }
//根据站点id获取隧道信息option
let largeScreen = computed(() => largeScreenData) let largeScreen = computed(() => largeScreenData)
const getTunnel = (id) => { const getTunnel = (id) => {
@@ -515,8 +521,10 @@ const changeTunnel = (e) => {
showBadLoading.value = 0 showBadLoading.value = 0
showWindLoading.value = 0 showWindLoading.value = 0
showFanLoading.value = 0 showFanLoading.value = 0
showUsedLoading.value = 0
pageInfo.pageNum = 1 pageInfo.pageNum = 1
getScreenInfo(newObj.value) getScreenInfo(newObj.value)
showFan.value = false
nextTick(() => { nextTick(() => {
showFan.value = true; showFan.value = true;
}); });

View File

@@ -143,7 +143,7 @@
<script setup> <script setup>
import {Search} from '@element-plus/icons-vue' import {Search} from '@element-plus/icons-vue'
import {addUser, editUser, getUser, getRoleOption, deleteUser, getUserDetail} from "@/api/user"; import {addUser, editUser, getUser, getRoleOption, deleteUser, getUserDetail} from "@/api/user";
import {ElMessage, ElMessageBox} from "element-plus"; import {ElLoading, ElMessage, ElMessageBox} from "element-plus";
import {getTunnelOption} from "@/api/tunnel"; import {getTunnelOption} from "@/api/tunnel";
import TunnelTitle from "@/components/tunnelTitle/index.vue"; import TunnelTitle from "@/components/tunnelTitle/index.vue";
@@ -214,16 +214,24 @@ const handleAddUser = () => {
} }
const handleEditUser = (row) => { const handleEditUser = (row) => {
reset() reset()
const loading = ElLoading.service({
lock: true,
text: '正在加载系统资源...',
background: 'rgba(0, 0, 0, 0.7)',
customClass:'allLoading'
})
getUserDetail(row.userId).then(res => { getUserDetail(row.userId).then(res => {
if (res.code === 1000) { if (res.code === 1000) {
getTunnel() getTunnel()
form.value = res.data.user form.value = res.data.user
form.value.roleId = res.data.roleIds[0] form.value.roleId = res.data.roleIds[0]
form.value.tunnelList = res.data.user.tunnelList form.value.tunnelList = res.data.user.tunnelList
title.value = '修改用户'
isVisited.value = true
} }
loading.close()
}) })
title.value = '修改用户'
isVisited.value = true
} }
const handleDelete = () => { const handleDelete = () => {
@@ -264,6 +272,12 @@ const getRoleOptionInfo = () => {
} }
getRoleOptionInfo() getRoleOptionInfo()
const getInfo = () => { const getInfo = () => {
const loading = ElLoading.service({
lock: true,
text: '正在加载系统资源...',
background: 'rgba(0, 0, 0, 0.7)',
customClass:'allLoading'
})
getUser({ getUser({
siteId: siteId, siteId: siteId,
userName: username.value, userName: username.value,
@@ -274,6 +288,7 @@ const getInfo = () => {
total.value = res.data.total total.value = res.data.total
showFirst.value = total.value / pageInfo.pageSize >= 1; showFirst.value = total.value / pageInfo.pageSize >= 1;
} }
loading.close()
}) })
} }
getInfo() getInfo()