123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303 |
- <template>
- <view>
- <!-- 公共参数 -->
- <view class="common" v-if="data.common">
- <view class="item" v-for="(item,index) in data.common" :key="index" @click="show_item(item)">
- <view class="label">{{item.label}}</view>
- <view class="value">{{item.value}}</view>
- <view class="unit">{{item.unit}}</view>
- </view>
- </view>
- <!-- 水泵 -->
- <view class="pump_list">
- <view class="pump" v-for="(item,index) in data.water_pump" :key="index">
- <view class="icon" v-if="item.state == 1">
- <image src="./icon/water_pump_kai.jpg" mode=""></image>
- </view>
- <view class="icon" v-else>
- <image src="./icon/water_pump.png" mode=""></image>
- </view>
- <view class="name">{{item.label}}</view>
- <view class="state">
- <view class="label">状态</view>
- <!-- 1-开 2-关 -->
- <view class="value value_1" v-if="item.state == 1"></view>
- <view class="value value_2" v-else></view>
- </view>
- <!-- 运行参数 -->
- <view class="parameter run_parameter">
- <view class="title">
- <view class="icon">
- <image src="./icon/canshu.png" mode=""></image>
- </view>
- <view class="text">运行参数</view>
- </view>
- <view class="list">
- <view class="item" v-for="(item_2,index_2) in item.parameter" :key="index_2" @click="show_item(item_2)">
- <view class="label">{{item_2.label}}</view>
- <view class="value" :style="{width: item_2.unit?'120rpx':'190rpx'}">{{item_2.value}}</view>
- <view class="unit" :style="{width: item_2.unit?'70rpx':'0rpx'}">{{item_2.unit}}</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import data from './drainage.json'
- export default {
- data() {
- return {
- mine_code:"",
- system_type:"",
-
- // 数据刷新定时器
- data_timer:{},
- data: {}
- };
- },
- onLoad(option) {
- uni.setNavigationBarTitle({
- title:option.name
- })
- this.mine_code = option.mine_code
- this.system_type = option.system_type
- // console.log(data)
- // this.data = data
- this.get_data()
- this.data_timer = setInterval(()=>{
- this.get_data()
- },5000)
- },
- onUnload() {
- clearInterval(this.data_timer)
- },
- methods: {
- show_item(item) {
- uni.showToast({
- icon: "none",
- title: item.label + " " + item.value + " " + item.unit
- })
- },
- get_data(){
- if(this.mine_code == "jinfeng"){
- this.$api.opcdata_getTurboData({
- mine_code: this.mine_code,
- system_type: this.system_type
- }).then((res)=>{
- this.data = res.data.sys_point
- })
- }else{
- this.$api.unified_automation_system({
- mine_code: this.mine_code,
- system_type: this.system_type
- }).then((res)=>{
- this.data = res.data
- })
- }
- }
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #0B163B;
- box-sizing: border-box;
- padding: 30rpx 10rpx;
- }
- .common {
- margin: 0 auto;
- width: 700rpx;
- background-image: url(./icon/common.png);
- background-size: 100% 100%;
- background-repeat: no-repeat;
- box-sizing: border-box;
- padding: 40rpx;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- .item {
- width: 300rpx;
- height: 50rpx;
- display: flex;
- justify-content: space-between;
- color: #4CB1FF;
- font-size: 28rpx;
- .label {
- width: 110rpx;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .value {
- width: 110rpx;
- height: 40rpx;
- box-sizing: border-box;
- padding: 0 10rpx;
- background: rgba(0, 4, 15, 0.36);
- border: 2rpx solid #3D55A5;
- color: #FFF600;
- font-size: 24rpx;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .unit {
- width: 50rpx;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- }
- }
- .pump_list {
- margin-top: 20rpx;
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- .pump {
- margin-bottom: 40rpx;
- width: 360rpx;
- .icon {
- text-align: center;
- image {
- width: 164rpx;
- height: 138rpx;
- }
- }
- .name {
- margin-top: 20rpx;
- text-align: center;
- color: #DEF1FF;
- font-size: 34rpx;
- font-weight: 700;
- }
- .state {
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- .label {
- color: #4CB1FF;
- font-size: 28rpx;
- }
- .value {
- margin-left: 20rpx;
- width: 40rpx;
- height: 40rpx;
- border-radius: 50%;
- }
- .value_1 {
- background-color: #00FF00;
- }
- .value_2 {
- background-color: #DCDCDC;
- }
- }
- .parameter {
- box-sizing: border-box;
- margin-top: 20rpx;
- .title {
- margin: 0 auto;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 230rpx;
- height: 60rpx;
- background-image: url(./icon/border.png);
- background-size: 100% 100%;
- background-repeat: no-repeat;
- .icon {
- margin-right: 10rpx;
- image {
- width: 30rpx;
- height: 30rpx;
- }
- }
- .text {
- color: #00FFF6;
- font-size: 30rpx;
- }
- }
- .list {
- margin-top: 40rpx;
- .item {
- height: 60rpx;
- display: flex;
- justify-content: space-between;
- color: #4CB1FF;
- font-size: 28rpx;
- .label {
- margin-left: 10rpx;
- width: 130rpx;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .value {
- width: 120rpx;
- height: 40rpx;
- box-sizing: border-box;
- padding: 0 10rpx;
- background: rgba(0, 4, 15, 0.36);
- border: 2rpx solid #3D55A5;
- color: #FFF600;
- font-size: 24rpx;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .unit {
- width: 70rpx;
- }
- }
- }
- }
- }
-
- .pump:nth-child(Odd) {
- .parameter {
- border-right: 2rpx solid;
- border-image: linear-gradient(#0B163B, #00B7F5, #0B163B) 10;
- }
- }
- }
- </style>
|