fix : 修复数据loading加载
This commit is contained in:
@@ -283,7 +283,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {ElMessage} from "element-plus";
|
||||
import {ElLoading, ElMessage} from "element-plus";
|
||||
import {getEquipmentList, editEquipment, getTunnelDetail} from "@/api/tunnelManage";
|
||||
import TunnelTitle from "@/components/tunnelTitle/index.vue";
|
||||
const router = useRouter()
|
||||
@@ -362,8 +362,14 @@ const handleChangeMenu = (e) => {
|
||||
}
|
||||
|
||||
const getList = () => {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '正在加载系统资源',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
getEquipmentList(tunnelId).then(res => {
|
||||
if (res.code === 1000) {
|
||||
loading.close()
|
||||
fanData.value = res.data.frequencyChangerList
|
||||
res.data.windPressureSensorList.forEach(item => {
|
||||
item.offset = item.offset + 4000
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
<script setup>
|
||||
import TunnelScene from "@/components/content/tunnelScene/TunnelScene.vue";
|
||||
import {editTunnel, getTunnelDetail} from "@/api/tunnelManage";
|
||||
import {ElMessage} from "element-plus";
|
||||
import {ElLoading, ElMessage} from "element-plus";
|
||||
import {initSceneData} from "@/api/tunnelScene";
|
||||
import TunnelTitle from "@/components/tunnelTitle/index.vue";
|
||||
|
||||
@@ -97,8 +97,14 @@ const form = ref({
|
||||
remarks: "",
|
||||
});
|
||||
const getTunnel = () => {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '正在加载系统资源',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
getTunnelDetail(tunnelId).then((res) => {
|
||||
if (res?.code === 1000) {
|
||||
loading.close()
|
||||
form.value = res.data;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -145,6 +145,7 @@ import {editSite, getSiteDetail, getSiteList, addSite, deleteSite} from "@/api/s
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import TunnelTitle from "@/components/tunnelTitle/index.vue";
|
||||
import {getToken} from '@/utils/auth'
|
||||
import {ElLoading} from 'element-plus'
|
||||
|
||||
const router = useRouter()
|
||||
const userId = reactive(router.currentRoute.value.params.userId)
|
||||
@@ -201,28 +202,36 @@ const handleGoHome = () => {
|
||||
router.push('/' + 'siteToHome/' + siteId)
|
||||
}
|
||||
const getList = () => {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '正在加载系统资源',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
getSiteList({
|
||||
userId: userId,
|
||||
...pageInfo
|
||||
}).then((res) => {
|
||||
total.value = res.data.total;
|
||||
if (total.value == 0) {
|
||||
if (res.code === 1000) {
|
||||
loading.close()
|
||||
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 {
|
||||
item.info = item.tunnelList[0]
|
||||
showAddIcon.value = total.value % 6 !== 0;
|
||||
}
|
||||
item.checked = false
|
||||
})
|
||||
|
||||
siteList.value = res.data.rows;
|
||||
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 {
|
||||
item.info = item.tunnelList[0]
|
||||
}
|
||||
item.checked = false
|
||||
})
|
||||
siteList.value = res.data.rows;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
getList()
|
||||
const handleClickSite = (type) => {
|
||||
@@ -786,8 +795,9 @@ const handleCurrentChange = (val) => {
|
||||
color: #60DDDE;
|
||||
font-size: 38px;
|
||||
font-weight: bold;
|
||||
|
||||
:deep(.el-pagination.is-background ) {
|
||||
.btn-next,.btn-prev {
|
||||
.btn-next, .btn-prev {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {ElMessage, ElMessageBox} from "element-plus";
|
||||
import {ElLoading, ElMessage, ElMessageBox} from "element-plus";
|
||||
import {getTunnelList, addTunnel, deleteTunnel} from "@/api/tunnelManage";
|
||||
import {getSiteDrawing, getSiteDetail} from "@/api/site";
|
||||
import TunnelTitle from "@/components/tunnelTitle/index.vue";
|
||||
@@ -323,11 +323,17 @@ const getTunnel = (id) => {
|
||||
}
|
||||
getTunnel(siteId)
|
||||
const getList = () => {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '正在加载系统资源',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
getTunnelList({
|
||||
siteId: siteId,
|
||||
...pageInfo
|
||||
}).then(res => {
|
||||
if (res.code === 1000) {
|
||||
loading.close()
|
||||
total.value = res.data.total
|
||||
tunnelList.value = res.data.rows
|
||||
showFirst.value = total.value / pageInfo.pageSize >= 1;
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
:close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<fan-info v-if="showFan" :list="socketData.leftData" :fan-data="largeScreenData"
|
||||
: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>
|
||||
<div v-if="drawerLeft" class="left-arrow" @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">
|
||||
<wind-pressure-list v-if="showFan" :list="socketData.windPressure" :win-data="largeScreenData"
|
||||
: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"
|
||||
:loading="showBadLoading"/>
|
||||
</el-drawer>
|
||||
@@ -187,6 +187,7 @@ const loading = ref(false);
|
||||
const tableEmptyText = ref("加载中~");
|
||||
const initialIndex = ref(0)
|
||||
const showFanLoading = ref(0)
|
||||
const showUsedLoading = ref(0)
|
||||
const showWindLoading = ref(0)
|
||||
const showBadLoading = ref(0)
|
||||
const drawerRight = ref(true);
|
||||
@@ -410,6 +411,12 @@ const getScreenInfo = (id) => {
|
||||
} else {
|
||||
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) {
|
||||
res.data.windPressureSensorList.forEach((item) => {
|
||||
option = {
|
||||
@@ -476,7 +483,6 @@ const getList = () => {
|
||||
}
|
||||
})
|
||||
}
|
||||
//根据站点id获取隧道信息option
|
||||
|
||||
let largeScreen = computed(() => largeScreenData)
|
||||
const getTunnel = (id) => {
|
||||
|
||||
@@ -143,7 +143,7 @@
|
||||
<script setup>
|
||||
import {Search} from '@element-plus/icons-vue'
|
||||
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 TunnelTitle from "@/components/tunnelTitle/index.vue";
|
||||
|
||||
@@ -264,12 +264,18 @@ const getRoleOptionInfo = () => {
|
||||
}
|
||||
getRoleOptionInfo()
|
||||
const getInfo = () => {
|
||||
const loading = ElLoading.service({
|
||||
lock: true,
|
||||
text: '正在加载系统资源',
|
||||
background: 'rgba(0, 0, 0, 0.7)',
|
||||
})
|
||||
getUser({
|
||||
siteId: siteId,
|
||||
userName: username.value,
|
||||
...pageInfo
|
||||
}).then(res => {
|
||||
if (res.code === 1000) {
|
||||
loading.close()
|
||||
userData.value = res.data.rows
|
||||
total.value = res.data.total
|
||||
showFirst.value = total.value / pageInfo.pageSize >= 1;
|
||||
|
||||
Reference in New Issue
Block a user