邓洁: 修改细节

This commit is contained in:
邓洁
2024-01-03 16:41:44 +08:00
parent 317ceacf23
commit 89c137c7b4
4 changed files with 40 additions and 140 deletions

View File

@@ -106,6 +106,9 @@ watch(() => props.airData, (now) => {
} else {
getAirInfo(now.sensorList)
}
}else {
airList.value = []
windSpeed.value = 0
}
}, {deep: true});
const getChartInfo = (equipmentId) => {

View File

@@ -63,7 +63,6 @@ const props = defineProps({
let myEcharts = reactive({});
const isVisited = ref(false);
const showLoading = ref(false)
const eleData = ref([])
const electricityConsumptionMonthly = ref(0)
const monthlySavings = ref(4000)
const length = ref(null);
@@ -79,18 +78,15 @@ watch(() => props.eleData, (now) => {
setValueA()
}, {deep: true});
watch(() => props.list, (now) => {
eleData.value.forEach(item => {
now.forEach(newItem => {
if (item.equipmentId === newItem.equipmentId) {
if (newItem.electricityConsumptionDay) {
electricityConsumptionMonthly.value = newItem.electricityConsumptionMonthly
// item.electricityConsumptionDay = newItem.electricityConsumptionDay
// item.electricityConsumptionMonthly = newItem.electricityConsumptionMonthly
// item.electricityConsumptionTotal = newItem.electricityConsumptionTotal
}
}
})
})
// props.eleData.forEach(item => {
// now.forEach(newItem => {
// if (item.equipmentId === newItem.equipmentId) {
// if (newItem.electricityConsumptionDay) {
// electricityConsumptionMonthly.value = newItem.electricityConsumptionMonthly
// }
// }
// })
// })
setValueA()
}, {deep: true});
onMounted(() => {
@@ -108,25 +104,13 @@ const setValueB = () => {
valueB.value.style.height = `${width}px`;
}
const getBasicData = (data) => {
let tranObj = {}
let tranArr = []
data?.map(item => {
electricityConsumptionMonthly.value = item.electricityConsumptionMonthly,
tranObj = {
equipmentId: item.equipmentId,
// equipmentName: item.equipmentName,
// electricityConsumptionDay: item.electricityConsumptionDay,
// electricityConsumptionMonthly: item.electricityConsumptionMonthly,
// electricityConsumptionTotal: item.electricityConsumptionTotal,
}
tranArr.push(tranObj)
})
eleData.value = tranArr
if(data!==null){
electricityConsumptionMonthly.value = data[0].electricityConsumptionMonthly
}
}
const handleOpenChart = () => {
console.log('用电量弹窗')
isVisited.value = true
// showLoading.value=true
nextTick(() => {
initChart()
})

View File

@@ -5,11 +5,11 @@
<div class="back-icon"></div>
<span>返回</span>
</div>
<!-- <div class="site-name">-->
<!-- {{ siteName }}-->
<!-- </div>-->
<div class="site-name">
{{ siteName }}
</div>
<div class="tunnel-title"></div>
<div class="all-del-btn">
<div class="all-del-btn" v-if="showOperation">
<div class="all-btn" style=" margin-right: 40px;" v-if="!showAddIcon" @click="handleAdd">
添加
</div>
@@ -31,7 +31,7 @@
</div>
<div class="box-center">
<div>
<div class="left-img"></div>
<div class="left-img" @click="handlePreview"></div>
<div>
<div class="edit-btn" @click.stop="handleGoToEditTunnel(item.tunnelId)">
<div class="edit-icon"></div>
@@ -57,7 +57,7 @@
</div>
</div>
</div>
<div class="site-box add-box" @click="handleAdd">
<div class="site-box add-box" @click="handleAdd" v-if="showOperation">
<div class="add-icon"></div>
<div style="cursor: pointer">添加隧道</div>
</div>
@@ -121,75 +121,9 @@ const formRules = ref({
serialNumber: [{required: true, message: '请输入序列号', trigger: 'blur'}]
})
const showFirst = ref(true)
const showOperation = ref(true)
const formInstance = ref()
const tunnelList = ref([
{
tunnelName: '一号隧道',
num: 1,
constructionLength: 500,
implementationLength: 10
},
{
tunnelName: '二号隧道',
num: 1,
constructionLength: 500,
implementationLength: 10
},
{
tunnelName: '三号隧道',
num: 1,
constructionLength: 500,
implementationLength: 10
},
{
tunnelName: '三号隧道',
num: 1,
constructionLength: 500,
implementationLength: 10
},
{
tunnelName: '三号隧道',
num: 1,
constructionLength: 500,
implementationLength: 10
},
{
tunnelName: '三号隧道',
num: 1,
constructionLength: 500,
implementationLength: 10
},
{
tunnelName: '三号隧道',
num: 1,
constructionLength: 500,
implementationLength: 10
},
{
tunnelName: '三号隧道',
num: 1,
constructionLength: 500,
implementationLength: 10
},
{
tunnelName: '三号隧道',
num: 1,
constructionLength: 500,
implementationLength: 10
},
{
tunnelName: '三号隧道',
num: 1,
constructionLength: 500,
implementationLength: 10
},
{
tunnelName: '三号隧道',
num: 1,
constructionLength: 500,
implementationLength: 10
}
])
const tunnelList = ref([])
const iconsList = ref([
{
icon: 'sd_icon_fj.png',
@@ -244,7 +178,7 @@ const title = ref('新增隧道')
const isVisited = ref(false);
const tunnelIds = ref([])
const tunnelNameList = ref([])
const siteName = ref('')
const siteName = ref(localStorage.getItem('site'))
const form = ref({
tunnelName: '',
serialNumber: '',
@@ -258,10 +192,8 @@ const pageInfo = reactive({
pageSize: 12
});
const total = ref(10);
onMounted(() => {
// getSiteDetail(siteId).then((res) => {
// siteName.value = res.data.siteName
// });
onMounted(()=>{
showOperation.value = localStorage.getItem('roleKey') !== 'tunnel_admin';
})
const handleGoSiteOrIndex = () => {
if (type === 's') {
@@ -322,6 +254,10 @@ const handleSubmit = (instance) => {
ElMessage.warning('请先完善信息再新增')
}
// })
}
//预览隧道
const handlePreview=()=>{
}
const handleGoToEditTunnel = (tunnelId) => {
isEdit.value = true

View File

@@ -162,15 +162,11 @@ const getUser = () => {
getUserInfo().then(res => {
currentUser.value = res.data.user.userName
currentUserId.value = res.data.user.userId
localStorage.setItem('roleKey', res.data.user.roles[0].roleKey)
localStorage.setItem('userId', currentUserId.value)
})
}
const getDefaultSite = (siteId) => {
// console.log('siteList.value',siteList.value)
// getSiteDetail(siteId).then((res) => {
// console.log('res',res)
// });
}
const getOtherInfo = () => {
getLargeScreenInfo().then((res) => {
if (res?.code === 1000) {
@@ -198,19 +194,17 @@ const getScreenInfo = (id) => {
tunnelId.value = id
getLargeScreen(id).then((res) => {
if (res?.code === 1000) {
console.log('res',res.data)
if(res.data.frequencyChangerList.length!==0){
if(res.data.frequencyChangerList!==null&&res.data.frequencyChangerList.length!==0){
showFanLoading.value=0
}else {
showFanLoading.value=1
}
if(res.data.windPressureSensorList.length!==0){
if(res.data.windPressureSensorList!==null&&res.data.windPressureSensorList.length!==0){
showWindLoading.value=0
}else {
showWindLoading.value=1
}
if(res.data.sensorList.length!==0){
if(res.data.sensorList!==null&&res.data.sensorList.length!==0){
res.data.sensorList.forEach((item,index)=>{
if (
item.equipmentType === "carbonDioxide" ||
@@ -229,6 +223,7 @@ const getScreenInfo = (id) => {
showBadLoading.value=1
}
largeScreenData.value = res.data;
console.log('largeScreenData.value',largeScreenData.value)
} else {
ElMessage.warning(res.msg)
}
@@ -243,18 +238,21 @@ const getScreenInfo = (id) => {
const getTunnel = (id) => {
getTunnelBySiteId(id).then((res) => {
if (res?.code === 1000) {
tunnelList.value = res.data
getScreenInfo(res.data[0]?.value)
}
});
}
const changeTunnel = (e) => {
console.log('tunnelList.value',e,tunnelList.value)
let newObj = {}
tunnelList.value.forEach((item, index) => {
if (index === e) {
newObj = item
}
})
showBadLoading.value=0
showWindLoading.value=0
showFanLoading.value=0
getScreenInfo(newObj.value)
nextTick(() => {
showFan.value = true;
@@ -347,28 +345,7 @@ const initWebSocket = () => {
socket.send(JSON.stringify(send));
}, 30000);
};
const closeSocket = () => {
socket.close();
};
initWebSocket();
// watch(
// () => tunnelId.value,
// (now) => {
// tunnelId.value = now
// },
// { deep: true }
// )
// const getTunnelPreview = () => {
// getTunnelDetail(tunnelId).then((res) => {
// if (res?.code === 1000) {
// form.value = res.data;
// }
// });
// };
// getTunnelPreview();
</script>
<style lang="scss">
.el-drawer__header {