123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451 |
- <template>
- <!-- 注射针 -->
- <view class="equipmentDtl">
- <commons-header title=" 注射针"></commons-header>
- <view class="equ-img">
- <image src="../../static/img_jbj.png" mode=""></image>
- <!-- <view class="err-modal">
- <image src="../../static/icon_jb@2x.png" mode=""></image>
- </view> -->
- </view>
- <view class="state">
- <view class="state-box">
- <image src="../../static/icon_sbzt.png" mode=""></image>
- <view class="text">
- <view class="label">
- 设备状态
- </view>
- <view class="state-text" style="color: #3FBF31;">
- {{swichType ? '在线' : '离线'}}
- </view>
- </view>
- </view>
- <view class="state-box">
- <image src="../../static/icon_gzms.png" mode=""></image>
- <view class="text">
- <view class="label">
- 工作模式
- </view>
- <view class="state-text" style="color:#FF8800">
- 自动
- </view>
- </view>
- </view>
-
- </view>
- <view class="ebc-content">
- <view class="commons-title">
- 上座
- </view>
- <ul>
- <li>
- <view class="list-long">
- <view class="" style="display: flex;">
- <image src="../../static/icon_yxzt.png" mode=""></image>
- <view class="list-label" style="line-height: 80rpx;color: #666666;">运行状态</view>
- </view>
- <view class="list-val" style="line-height: 80rpx;">
- 正常
- </view>
- </view>
- </li>
- <li>
- <view class="list-long">
- <view class="" style="display: flex;">
- <image src="../../static/icon_yxms.png" mode=""></image>
- <view class="list-label" style="line-height: 80rpx;color: #666666;">运行模式</view>
- </view>
- <view class="list-val" style="line-height: 80rpx;">
- 自动
- </view>
- </view>
- </li>
- <li>
- <view class="list-long">
- <view class="" style="display: flex;">
- <image src="../../static/icon_kjsj.png" mode=""></image>
- <view class="list-label" style="line-height: 80rpx;color: #666666;">开机时间</view>
- </view>
- <view class="list-val" style="line-height: 80rpx;">
- 6.5H
- </view>
- </view>
- </li>
- </ul>
- </view>
- </view>
- </template>
- <script>
- import {
- getInfo
- } from "@/util/api.js";
- import Vue from 'vue'
- import commonsHeader from '../../components/commons-header/index.vue'
- export default {
- components: {
- commonsHeader
- },
- data() {
- return {
- userInfoData: [],
- notificationData: [],
-
- equData:{
- properties:{
- status:{
- main_speed:0,
- bu_len:0,
- },
- parameter:{
- max_bulen:0,
- },
- },
-
- },
- axisData:[],
- swichType:false,
- }
- },
- onLoad(option) {
- const v = this
- //v.getData(option.id)
- },
- methods: {
- getData(_id){
- const v = this
-
- v.$post('/api/syringe-production/factoryProduct/getData',{equipmentNo:_id}).then(res => {
- console.log(res.data)
- this.axisData = []
-
- for (let key in res.data.properties.parameter) {
- if(key.substring(0,11) === 'axis_allnum'){
- this.axisData.push({
- axis:res.data.properties.parameter[key],
- index:key.substring(12,13),
- curr:res.data.properties.status['curr_num_' + key.substring(12,13)] || 0,
- time:res.data.properties.status['left_time_' + key.substring(12,13)] || 0,
- })
- }
- }
- function up(x,y){
- return x.index -y.index;
- }
- this.axisData.sort(up)
- v.equData = res.data
- const time1 = new Date(res.data.eventTime).getTime()
- const time2 = new Date().getTime()
- if(time1 + 600000 > time2){
- this.swichType = true
- }else{
- this.swichType = false
- }
- console.log(time1,time2)
- })
- setTimeout(()=>{
- if(v.equData) v.getData(_id)
- },5000)
- },
- toRouter(j) {
- console.log(j)
- uni.navigateTo({
- url: '/pages/' + j.menuKey + '/' + j.menuKey
- })
- },
- },
- }
- </script>
- <style lang="less">
- .equipmentDtl {
- background-color: #f0f0f0;
- min-height: 100vh;
- margin-top: 128rpx;
- .ebc-content{
- background-color: #fff;
- margin: 24rpx 24rpx;
- border-radius: 10rpx;
- padding-bottom: 24rpx;
- padding-top:8rpx;
- .list-long{
- height: 122rpx;
- margin: 24rpx 24rpx 0;
- display: flex;
- justify-content: space-between;
- background-color: #F1F1F1;
- padding: 24rpx 24rpx;
- box-sizing: border-box;
- border-radius: 10rpx;
- font-size: 24rpx;
- .list-val{
- font-size: 32rpx;
-
- }
- image{
- width: 80rpx;
- height: 80rpx;
- margin-right: 24rpx;
- }
- }
- .list-bc{
- display: flex;
- justify-content: space-between;
- padding: 0 24rpx;
- .bc-box{
- height: 112rpx;
- width: 48%;
- display: flex;
- background-color: #F1F1F1;
- padding: 18rpx 24rpx;
- box-sizing: border-box;
- border-radius: 10rpx;
- font-size: 24rpx;
- .list-val{
- font-size: 32rpx;
- font-weight: bold;
- }
- image{
- width: 80rpx;
- height: 80rpx;
- margin-right: 24rpx;
- }
- }
- }
- }
- .action{
- display: flex;
- justify-content: space-between;
- margin: 24rpx 24rpx 0;
-
- li{
- width: 32%;
- text-align: center;
- background-color: #fff;
- font-size: 28rpx;
- border-radius: 10rpx;
- padding: 24rpx 0;
- image{
- width: 100rpx;
- height: 100rpx;
- }
- .state-text{
- text-align: center;
- }
- }
- }
- .rate-warp{
- margin-top: 20rpx;
- .sm-rate{
- display: flex;
- justify-content: space-between;
- flex-wrap: wrap;
- padding: 0 24rpx;
- li{
-
- background-color: #fff;
- border-radius: 10rpx;
- height: 120rpx;
- display: flex;
- justify-content: space-between;
- margin-top: 24rpx;
- align-items: center;
- padding: 0 24rpx;
- width: 296rpx;
- font-size: 28rpx;
- color: #666;
- .right-box{
- font-size: 32rpx;
- color: #333;
- .line{
- width: 70rpx;
- height: 8rpx;
- background: rgba(238,238,238,1);
- border-radius: 4rpx;
- margin-top: 6rpx;
- .box{
- width:50%;
- background-color: #BB99F6;
- height: 100%;
- border-radius: 12rpx;
- }
- }
- }
- }
- }
- .big-rate{
- li{
- margin-top: 24rpx;
- height: 128rpx;
- display: flex;
- align-items: center;
- background-color: #fff;
- margin: 0 24rpx;
- border-radius: 10rpx;
- padding: 0 24rpx;
-
- .text{
- font-weight: 500;
- font-size: 28rpx;
- color: #333;
- }
- .line{
- width: 240rpx;
- margin-left: 90rpx;
- height: 24rpx;
- background: rgba(238,238,238,1);
- margin-right: 40rpx;
- border-radius: 12rpx;
-
- .box{
- width:50%;
- background-color: rgba(255,175,83,1);
- height: 100%;
- border-radius: 12rpx;
- }
- }
- }
- }
-
- }
- .parts-list{
- padding: 0 24rpx;
- margin-top: 24rpx;
- ul{
- display: flex;
- justify-content: space-between;
- }
- li{
- width: 32%;
- padding: 30rpx 0;
- text-align: center;
- position: relative;
- background-color: #fff;
- image{
- width: 60rpx;
- height: 60rpx;
- display: block;
- margin: 0 auto 20rpx;
- }
- }
- .before{
- width: 30rpx;
- height: 30rpx;
- border-radius: 50%;
- background-color: rgba(204,204,204,0.2);
-
- display: block;
- position: absolute;
- right: 16rpx;
- top: 16rpx;
-
- }
- .before::before{
- position: absolute;
- display: block;
- top: 7rpx;
- left: 7rpx;
- width: 19rpx;
- height: 19rpx;
- border-radius: 50%;
- content:" ";
- background: #cccccc;
-
- }
- .before.succes{
- background-color: rgba(63,191,49,0.2);
- }
- .before.succes::before{
- background: #3FBF31;
- }
- }
- .echarts {
- background: #fff;
- margin: 24rpx 24rpx 0;
- .content{
-
- .text{
- font-size: 28rpx;
- font-weight: 700;
- color: #333;
- text-align: center;
- margin-bottom: 40rpx;
- }
- }
- .title{
- font-size: 28rpx;
- height: 90rpx;
- line-height: 90rpx;
- display: flex;
- padding: 0 24rpx;
- font-weight: 500;
- image{
- width: 40rpx;
- height: 40rpx;
- margin-top: 25rpx;
- margin-right: 16rpx;
- }
- }
- }
- .parts-list {}
- .equ-img {
- padding: 24rpx;
- background-color: #ffffff;
- position: relative;
- image {
- width: 100%;
- height: 395rpx;
- }
- .err-modal{
- position: absolute;
- left: 0;
- right: 0;
- bottom: 0;
- top: 0;
- background: rgba(0,0,0,0.60);
- text-align: center;
- display: flex;
- align-items: center;
-
- image{
- width: 160rpx;
- height: 160rpx;
- margin: 0 auto;
- }
- }
- }
- .state {
- display: flex;
- justify-content: space-between;
- margin: 24rpx 24rpx 0;
- .state-box {
- padding: 20rpx;
- width: 48%;
- background-color: #fff;
- display: flex;
- box-sizing: border-box;
- border-radius: 10rpx;
- .text{
- padding: 12rpx 0;
- }
- .state-text{
- font-size: 32rpx;
- font-weight: bold;
- margin-top: 5rpx;
- }
- .label{
- font-weight: 400;
- font-size: 28rpx;
- }
- image {
- width: 110rpx;
- height: 110rpx;
- }
- }
- }
- }
- </style>
|