jsy-app/pages/dev-ops/station.vue
2024-12-28 21:29:59 +08:00

138 lines
3.3 KiB
Vue

<template>
<z-paging ref="paging" @query="queryList" v-model="dataList" :default-page-size="queryParams.pageSize"
:auto-show-system-loading="true" empty-view-text="抱歉,暂时还没有相关数据!">
<template #top>
<custom-nav-bar :left="true" title="基站"></custom-nav-bar>
</template>
<view class="index-container">
<view class="item-container" v-for="item in dataList">
<view style="display: flex; align-items: center; justify-content: space-between;">
<view class="flex-text" style="margin: 15px;">
<view class="flex-text-one" style="color: black;">基站:</view>
<view>{{ item.deviceCode}}</view>
</view>
<view style="margin-right: 5px;" v-hasPermi="['system:land:edit']">
<u-button type="primary" plain plainFill>
{{ item.status == 'online' ? '在线':'离线'}}
</u-button>
</view>
</view>
<u-gap height="1" bgColor="#D2D2D2"></u-gap>
<view style="display: flex;justify-content: space-between;align-items: center;"
@click="openStepPop(item)">
<view class="data">
<view class="flex-text global-font-size-1">
<view class="flex-text-one">版本:</view>
<view>{{ item.operSubject}}</view>
</view>
<u-button>修改频段</u-button>
<u-button>阀门列表</u-button>
</view>
</view>
</view>
</view>
</z-paging>
</template>
<script>
import * as DevOpsApi from "@/api/dev-ops/index.js"
export default {
data() {
return {
dataList: [],
landId: null,
}
},
onLoad(par) {
const cacheData = uni.getStorageSync("cacheData");
if (cacheData) {
this.landId = cacheData.land.id;
} else {
this.landId = -1;
}
},
onShow() {},
mounted() {},
methods: {
queryList(pageNo, pageSize) {
DevOpsApi.getStationList(this.landId).then(res => {
console.error("res:", res);
this.$refs.paging.completeByTotal(res.rows);
});
},
async openStepPop(item) {
let stepList = userlog.getSeqlistTemp();
let stepCurrent = 0;
this.stepList = [];
userlog.getSeqlist({
traceId: item.traceId
}).then(response => {
if (response.rows.length) {
response.rows.forEach(item => {
stepList[item.eventType - 1].description = item.occurTime;
stepList[item.eventType - 1].status = 'success';
if (item.eventType > stepCurrent) {
stepCurrent = item.eventType;
}
});
}
this.stepList = stepList;
this.stepCurrent = stepCurrent;
this.openPop = true;
});
},
// 数据排序
compareDataNew(file1) {
return function(b, a) {
if (b[file1] < a[file1]) {
return -1;
} else if (b[file1] > a[file1]) {
return 1;
}
}
},
}
}
</script>
<style lang="scss">
.index-container {
.list {
margin: 0px 10px;
}
.list-size {
display: flex;
padding: 5px 5px;
background: white;
justify-content: center;
}
.search {
background-color: white;
padding: 10px;
}
.item-container {
margin: 10px 10px;
background-color: white;
padding-bottom: 10px;
border-radius: 10px;
box-shadow: 1px 1px 2px 2px rgba(0, 0, 0, 0.05);
}
.flex-text {
display: flex;
align-items: center;
.flex-text-one {
color: #939393;
font-weight: bold;
}
}
.data {
margin: 10px 20px;
}
}
</style>