123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538 |
- <template>
- <view>
- <!-- 公共参数 -->
- <view class="common">
- <view class="section">
- <view class="item" v-for="(item,index) in data.common.position" :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="section">
- <view class="state" v-for="(item,index) in data.common.direction" :key="index">
- <view class="label">{{item.label}}</view>
- <!-- 1-开 2-关 -->
- <view class="value value_1" v-if="item.state == 1"></view>
- <view class="value value_2" v-if="item.state == 2"></view>
- </view>
- </view>
- </view>
- <!-- 提升机参数 -->
- <view class="content">
- <view class="hoist" v-for="(item,index) in data.hoist" :key="index">
- <view class="box" v-if="item.state == 1">
- <image src="./icon/hoist.jpg" mode=""></image>
- </view>
- <view class="box" v-if="item.state == 2">
- <image src="./icon/hoist.png" mode=""></image>
- </view>
- <view class="name">{{item.name}}</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.run_parameter" :key="index_2"
- @click="show_item(item_2)">
- <view class="label">{{item_2.label}}</view>
- <view class="value">{{item_2.value}}</view>
- <view class="unit">{{item_2.unit}}</view>
- </view>
- </view>
- </view>
- <!-- 提升机运行模式 -->
- <view class="state_section run_mode">
- <view class="title">
- <view class="icon">
- <image src="./icon/warn.png" mode=""></image>
- </view>
- <view class="text">提升机运行模式</view>
- </view>
- <view class="list">
- <view class="state" v-for="(item_2,index_2) in item.run_mode" :key="index_2" @click="show_label(item_2.label)">
- <view class="label">{{item_2.label}}</view>
- <!-- 1-开 2-关 -->
- <view class="value value_1" v-if="item_2.state == 1"></view>
- <view class="value value_2" v-if="item_2.state == 2"></view>
- </view>
- </view>
- </view>
- <!-- 提升机系统信号 -->
- <view class="state_section system_signal">
- <view class="title">
- <view class="icon">
- <image src="./icon/warn.png" mode=""></image>
- </view>
- <view class="text">提升机系统信号</view>
- </view>
- <view class="list">
- <view class="state" v-for="(item_2,index_2) in item.system_signal" :key="index_2" @click="show_label(item_2.label)">
- <view class="label">{{item_2.label}}</view>
- <!-- 1-开 2-关 -->
- <view class="value value_1" v-if="item_2.state == 1"></view>
- <view class="value value_2" v-if="item_2.state == 2"></view>
- </view>
- </view>
- </view>
-
- <!-- 提升机状态 -->
- <view class="state_section two_row_state">
- <view class="title">
- <view class="icon">
- <image src="./icon/warn.png" mode=""></image>
- </view>
- <view class="text">提升机状态</view>
- </view>
- <view class="list">
- <view class="state" v-for="(item_2,index_2) in item.hoist_state" :key="index_2" @click="show_label(item_2.label)">
- <view class="label">{{item_2.label}}</view>
- <!-- 1-开 2-关 -->
- <view class="value value_1" v-if="item_2.state == 1"></view>
- <view class="value value_2" v-if="item_2.state == 2"></view>
- </view>
- </view>
- </view>
-
- <!-- 提升机运行状态 -->
- <view class="state_section two_row_state">
- <view class="title">
- <view class="icon">
- <image src="./icon/warn.png" mode=""></image>
- </view>
- <view class="text">提升机运行状态</view>
- </view>
- <view class="list">
- <view class="state" v-for="(item_2,index_2) in item.hoist_run_state" :key="index_2" @click="show_label(item_2.label)">
- <view class="label">{{item_2.label}}</view>
- <!-- 1-开 2-关 -->
- <view class="value value_1" v-if="item_2.state == 1"></view>
- <view class="value value_2" v-if="item_2.state == 2"></view>
- </view>
- </view>
- </view>
-
- <!-- 小罐提升过程状态 -->
- <view class="state_section two_row_state">
- <view class="title">
- <view class="icon">
- <image src="./icon/warn.png" mode=""></image>
- </view>
- <view class="text">小罐提升过程状态</view>
- </view>
- <view class="list">
- <view class="state" v-for="(item_2,index_2) in item.small_lifting_process" :key="index_2" @click="show_label(item_2.label)">
- <view class="label">{{item_2.label}}</view>
- <!-- 1-开 2-关 -->
- <view class="value value_1" v-if="item_2.state == 1"></view>
- <view class="value value_2" v-if="item_2.state == 2"></view>
- </view>
- </view>
- </view>
-
- <!-- 大罐提升过程状态 -->
- <view class="state_section two_row_state">
- <view class="title">
- <view class="icon">
- <image src="./icon/warn.png" mode=""></image>
- </view>
- <view class="text">大罐提升过程状态</view>
- </view>
- <view class="list">
- <view class="state" v-for="(item_2,index_2) in item.big_lifting_process" :key="index_2" @click="show_label(item_2.label)">
- <view class="label">{{item_2.label}}</view>
- <!-- 1-开 2-关 -->
- <view class="value value_1" v-if="item_2.state == 1"></view>
- <view class="value value_2" v-if="item_2.state == 2"></view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import data from './hoist.json'
- export default {
- data() {
- return {
- mine_code:"",
- system_type:"",
-
- // 数据刷新定时器
- data_timer:{},
- data: {}
- };
- },
- onLoad(option) {
- // console.log(data)
- // this.data = data
-
- uni.setNavigationBarTitle({
- title:option.name
- })
- this.mine_code = option.mine_code
- this.system_type = option.system_type
-
- this.get_data()
- this.data_timer = setInterval(()=>{
- this.get_data()
- },5000)
- },
- onUnload() {
- clearInterval(this.data_timer)
- },
- methods: {
- get_data(){
- this.$api.unified_automation_system({
- mine_code: this.mine_code,
- system_type: this.system_type
- }).then((res)=>{
- console.log(res.data)
- this.data = res.data
- })
- },
- show_item(item) {
- uni.showToast({
- icon: "none",
- title: item.label + " " + item.value + " " + item.unit
- })
- },
- show_label(label){
- uni.showToast({
- icon: "none",
- title: label
- })
- }
- }
- }
- </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;
- justify-content: space-between;
- .section {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- .item {
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- color: #4CB1FF;
- font-size: 28rpx;
- .label {
- width: 120rpx;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .value {
- margin: 0 20rpx;
- 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: 100rpx;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- }
- .state {
- height: 60rpx;
- display: flex;
- align-items: center;
- .label {
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- width: 120rpx;
- 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: #E5E5E5;
- }
- }
- }
- }
- .content {
- margin-top: 40rpx;
- .hoist {
- margin: 0 auto;
- width: 700rpx;
- .box {
- text-align: center;
- image {
- width: 150rpx;
- height: 174rpx;
- }
- }
- .name {
- margin-top: 20rpx;
- text-align: center;
- color: #DEF1FF;
- font-size: 34rpx;
- font-weight: 700;
- }
- .parameter {
- box-sizing: border-box;
- margin-top: 40rpx;
- .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: 20rpx;
- image {
- width: 30rpx;
- height: 30rpx;
- }
- }
- .text {
- color: #00FFF6;
- font-size: 30rpx;
- }
- }
- .list {
- margin-top: 40rpx;
- .item {
- height: 60rpx;
- display: flex;
- color: #4CB1FF;
- font-size: 28rpx;
- .label {
- width: 200rpx;
- text-align: justify;
- text-align-last: justify;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .value {
- margin: 0 40rpx;
- width: 200rpx;
- 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: 100rpx;
- }
- }
- }
- }
- .state_section {
- margin-top: 40rpx;
- .title {
- margin: 20rpx auto;
- display: flex;
- justify-content: center;
- align-items: center;
- width: 300rpx;
- height: 60rpx;
- background-image: url(./icon/border.png);
- background-size: 100% 100%;
- background-repeat: no-repeat;
- .icon {
- margin-right: 20rpx;
- image {
- width: 30rpx;
- height: 30rpx;
- }
- }
- .text {
- color: #00FFF6;
- font-size: 30rpx;
- }
- }
- .list {
- overflow: hidden;
- .state {
- box-sizing: border-box;
- float: left;
- margin-right: 20rpx;
- width: 160rpx;
- height: 70rpx;
- display: flex;
- align-items: center;
- .label {
- width: 80rpx;
- color: #4CB1FF;
- font-size: 28rpx;
-
- text-align: justify;
- text-align-last: justify;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .value {
- margin-left: 20rpx;
- width: 40rpx;
- height: 40rpx;
- border-radius: 50%;
- }
- .value_1 {
- background-color: #00FF00;
- }
- .value_2 {
- background-color: #DCDCDC;
- }
- }
- .state:nth-child(4n) {
- margin-right: 0;
- }
- }
- }
- .system_signal {
- .list {
- overflow: hidden;
- .state {
- margin-right: 30rpx;
- width: 210rpx;
- .label {
- width: 140rpx;
- }
- }
- .state:nth-child(3n){
- margin-right: 0;
- }
- .state:nth-child(4n) {
- margin-right: 30rpx;
- }
- }
- }
-
- .two_row_state{
- .list {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- .state {
- margin-right: 0;
- width: 350rpx;
- .label {
- width: 200rpx;
- margin-right: 40rpx;
- }
- }
- }
- }
- }
- }
- </style>
|