1.添加实时报警和历史报警 2.添加云服务和局域网模式切换界面
| | |
| | | import Vue from 'vue'
|
| | |
|
| | | export default {
|
| | | //å
¨å±åé(åæ¥æ°æ®å¯ç¨å
¨å±åéï¼å¼æ¥æ°æ®ä½¿ç¨vuex)
|
| | | globalData: {
|
| | | token: ""
|
| | | token: "",
|
| | | //å½åéæ©tab
|
| | | selectTab: 0,
|
| | | //å½åç½ç»æ¨¡å¼ï¼cloud-äºæå¡ãlan-å±åç½ï¼
|
| | | mode: "",
|
| | | },
|
| | | onLaunch: function() {
|
| | |
|
| | |
| | |
|
| | | //æ¨éä»
æ¯æAndroid iosåçå¹³å°
|
| | | // #ifdef APP-PLUS
|
| | | console.log('APP-PLUS:')
|
| | | // æ¤å¤ä¸ºunipush1.0çæ¨éæ¹æ³
|
| | | plus.push.getClientInfoAsync((info) => {
|
| | | let cid = info["clientid"];
|
| | | console.log('客æ·ç«¯æ¨éæ è¯:', cid)
|
| | | this.$store.dispatch('setCid', cid); // ä½¿ç¨ action æ´æ° cid
|
| | | this.$store.dispatch('setClientPushId', cid); // ä½¿ç¨ action æ´æ° cid
|
| | |
|
| | | });
|
| | | // #endif
|
| | | uni.onPushMessage((res) => {
|
| | | console.log("æ¶å°æ¨éæ¶æ¯ï¼", res) //ç嬿¨éæ¶æ¯
|
| | | })
|
| | |
|
| | |
|
| | |
|
| | | uni.getSystemInfo({
|
| | | success: function(e) {
|
| | |
| | | if (this.$mqttTool.client) {
|
| | | console.log(this.$mqttTool.client.connected)
|
| | | }
|
| | | // if(this.$mqttTool.client){
|
| | | // this.$mqttTool.end().then(res =>{
|
| | | // console.log('ç»æ¢ï¼')
|
| | | // })
|
| | |
|
| | | // }
|
| | | }
|
| | |
|
| | | },
|
| | |
| | | fly
|
| | | } from '@/common/request/fly.js'
|
| | | //é
置请æ±åºå°å
|
| | | fly.config.baseURL = "http://192.168.12.20:9999"
|
| | | const url = uni.getStorageSync('baseurl');
|
| | | if (url) {
|
| | | fly.config.baseURL = url + "/herb"
|
| | | fly.config.baseURL = "http://192.168.12.47:9999"
|
| | | const ip = uni.getStorageSync('lan_ip');
|
| | | if (ip) {
|
| | | fly.config.baseURL = "http://" + ip + ":9999"
|
| | | } |
| | | |
| | | const mqttBaseUrl = "223.241.221.20"; |
| | | const mqttBaseUrl = "192.168.2.3";
|
| | | const emqxBaseUrl = "http://"+mqttBaseUrl +":18083/api/v5"
|
| | |
|
| | | // æµè¯
|
| | |
| | | return fly.get('/mobile/equ/list', params); |
| | | }
|
| | |
|
| | | //ä»
ç¨ä½ä¸æå·æ°ï¼æ å®é
æä¹
|
| | | function querySampleList(params) {
|
| | | fly.config.loading = true
|
| | | return fly.get('/mobile/sample/list', params);
|
| | | }
|
| | |
|
| | | //
|
| | | function getMonth(params) {
|
| | | fly.config.loading = true
|
| | |
| | | function sendCommand(params) {
|
| | | fly.config.loading = true
|
| | | return fly.post('/dry/real/sendCommand', params);
|
| | | }
|
| | |
|
| | | //å岿
éï¼æ¥è¯¢æè¿æ°æ®
|
| | | function queryHisFaultList(params) {
|
| | | fly.config.loading = true
|
| | | return fly.get('/mobile/fault/list', params);
|
| | | }
|
| | |
|
| | | //å岿
éï¼æ¥è¯¢å¾è¡¨éè¦æ°æ®
|
| | | function queryHisFaultChartList(params) {
|
| | | fly.config.loading = true
|
| | | return fly.get('/mobile/fault/chart', params);
|
| | | } |
| | | |
| | | |
| | |
| | | getAnalyList,
|
| | | getOrderList, |
| | | queryEquList,
|
| | | querySampleList,
|
| | | queryHisFaultList,
|
| | | queryHisFaultChartList,
|
| | | getMonth,
|
| | | sendCommand, |
| | | |
| | |
| | | const MOBILE_UP = "mobile/up"
|
| | | //è¯·æ±æ¥è¯¢è®¾å¤ç¶æ
|
| | | const MOBILE_QUERY_EQU_STATU = MOBILE_UP + "/query/equ/statu" |
| | | //è¯·æ±æ¥è¯¢è®¾å¤å®æ¶æ
é |
| | | const MOBILE_REQ_EQU_REAL_FAULT = MOBILE_UP + "/req/real/fault" |
| | | |
| | | |
| | | //åéæä½æä»¤ |
| | | const MOBILE_REQ_EQU_CMD = MOBILE_UP + "/req/equ/cmd"
|
| | |
| | | const SERVICE_BROADCAST_TENANT_REAL_FAULT = SERVICE_BROADCAST + "/real/fault/%s"
|
| | |
|
| | |
|
| | | const SERVICE_ONECE_TENANT_REAL_FAULT = "service/onece" + "/real/fault/%s"
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | /***********************EventBus function********************************/
|
| | |
| | |
|
| | | export default {
|
| | | MOBILE_QUERY_EQU_STATU, |
| | | |
| | | MOBILE_REQ_EQU_REAL_FAULT, |
| | | |
| | | SERVICE_RES_EQU_STATU, |
| | | SERVICE_DOWN, |
| | | MOBILE_REQ_EQU_CMD, |
| | | SERVICE_RES_EQU_CMD,
|
| | |
|
| | | SERVICE_BROADCAST_TENANT_REAL_FAULT,
|
| | | SERVICE_ONECE_TENANT_REAL_FAULT,
|
| | |
|
| | | MQTT_TOPIC_MESSAGE,
|
| | |
|
| | |
| | | if(!data || data == null) return "--";
|
| | | if(data & (!item || item == null)) return data; |
| | | let res = get(data, item) |
| | | return res == null ? "--" :res |
| | | return (res == null || res == "") ? "--" :res |
| | |
|
| | | } |
| | |
| | | var Fly = require("./wx.umd.min")
|
| | | var fly = new Fly
|
| | | const log = false
|
| | |
|
| | |
|
| | | fly.config.loading = true;
|
| | |
| | | fly.config.timeout=10000;
|
| | | //æ·»å æ¦æªå¨
|
| | | fly.interceptors.request.use((config, promise) => {
|
| | | console.info(fly.config.loading)
|
| | | if (fly.config.loading) {
|
| | | uni.showLoading({
|
| | | title: 'å è½½ä¸'
|
| | |
| | | if (userinfo) {
|
| | | config.headers["X-Tenant-Id"] = userinfo.loginTenantId;
|
| | | }
|
| | | if(log){ |
| | | console.log('========================================== ')
|
| | | console.log('== è¯·æ±æ°æ®ï¼' + JSON.stringify(config))
|
| | | console.log('=========================================== ')
|
| | | }
|
| | | return config;
|
| | | })
|
| | |
|
| | |
| | | fly.interceptors.response.use(
|
| | | (response) => {
|
| | |
|
| | | if(log){ |
| | | console.log('========================================')
|
| | | console.log('== ååºæ°æ®ï¼' + JSON.stringify(response.request.url))
|
| | | console.log('== ' + JSON.stringify(response.data))
|
| | | console.log('======================================== ')
|
| | | }
|
| | |
|
| | | //åªå°è¯·æ±ç»æçdataåæ®µè¿å
|
| | |
|
| | |
| | | <template>
|
| | | <view class="dropdown">
|
| | | <view class="item">
|
| | | <view class="item-title">设å¤</view>
|
| | | <view class="item-title" style="display: flex;justify-content: space-between;"> |
| | | <text>设å¤</text> |
| | | <text @click="closeMenu"><u-icon name="close"></u-icon></text> |
| | | </view>
|
| | | <view class="item-box">
|
| | | <view v-for="(item,index) in menuList" :key="item.code" :class="['item-menu',item.ck?'active':'']"
|
| | | @click="changeMenu(index)">{{item.name}}
|
| | |
| | | }
|
| | | }
|
| | | this.selectData.endTime = val;
|
| | | }, |
| | | closeMenu(){ |
| | | this.$emit('closeMenu') |
| | | }
|
| | | }
|
| | | }
|
| | |
| | | Vue.prototype.$mqttTool = mqttTool
|
| | |
|
| | |
|
| | | const EventBus = new Vue(); |
| | | Vue.prototype.$eventBus = EventBus |
| | | |
| | |
|
| | | //å
¨å±çæ§å®æ¶å¨ï¼å¨é¡µé¢ä½¿ç¨å±é¨å®æ¶å¨ä¼åºç°æ æ³å
³éé®é¢ï¼
|
| | | Vue.prototype.$monitorTimer = null |
| | | |
| | |
|
| | |
|
| | |
|
| | | Vue.config.productionTip = false |
| | | App.mpType = 'app' |
| | | |
| | |
| | | { |
| | | "name" : "æºè½ä¸èè¯å¹²ç¥æº", |
| | | "name" : "å
°æµ¦æºè½å¹²ç¥", |
| | | "appid" : "__UNI__1E83F66", |
| | | "description" : "", |
| | | "versionName" : "1.0.0", |
| | |
| | | "unipush" : { |
| | | "icons" : { |
| | | "small" : { |
| | | "ldpi" : "static/push/push_small_18.png", |
| | | "mdpi" : "static/push/push_small_24.png", |
| | | "hdpi" : "static/push/push_small_36.png", |
| | | "xhdpi" : "static/push/push_small_48.png", |
| | | "xxhdpi" : "static/push/push_small_72.png" |
| | | "ldpi" : "static/logo.png", |
| | | "mdpi" : "static/logo.png", |
| | | "hdpi" : "static/logo.png", |
| | | "xhdpi" : "static/logo.png", |
| | | "xxhdpi" : "static/logo.png" |
| | | } |
| | | } |
| | | } |
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | |
| | | export default {
|
| | | name: 'MqttView',
|
| | | data() {
|
| | |
| | | }
|
| | | },
|
| | | onReady() {
|
| | |
|
| | |
|
| | | },
|
| | | methods: {
|
| | |
| | | if (!deviceId) {
|
| | | deviceId = 'mobile-' + this.tenantId + '-' + Date.parse(new Date())
|
| | | }
|
| | | uni.setStorageSync(this.$constant.DEVICE_ID, 'mobile-' + this.tenantId + '-' + res.deviceId);
|
| | | uni.setStorageSync(this.$constant.DEVICE_ID, 'mobile-' + this.tenantId + '-' + res
|
| | | .deviceId);
|
| | | }
|
| | | })
|
| | | this.startConnect();
|
| | |
| | | password: account.password
|
| | | }
|
| | | if (!this.$mqttTool.client) {
|
| | | var client = await this.$mqttTool.connect(opts);
|
| | | this.$mqttTool.client = await this.$mqttTool.connect(opts);
|
| | | }
|
| | | //订é
æ¥è¯¢è®¾å¤ç¶æè¿åæ°æ®
|
| | | this.$mqttTool.subscribe({
|
| | |
| | | }).then(res => {
|
| | | console.error(res)
|
| | | })
|
| | | |
| | | //订é
设å¤å®æ¶æ
éï¼ä¸»å¨è¯·æ±åªåç»è¯·æ±è®¾å¤ï¼ |
| | | this.$mqttTool.subscribe({ |
| | | topic: this.$constant.SERVICE_ONECE_TENANT_REAL_FAULT.replace('%s', deviceid), |
| | | qos: 0 |
| | | }).then(res => { |
| | | console.error(res) |
| | | }) |
| | | |
| | | //订é
åéæä»¤è¿åç»æ
|
| | | // this.$mqttTool.subscribe({
|
| | | // topic: this.$constant.SERVICE_RES_EQU_CMD,
|
| | |
| | | // return false
|
| | | // }
|
| | | let that = this
|
| | | let client = this.$mqttTool.client
|
| | |
|
| | | client.on('connect', function(res) {
|
| | | console.error('è¿æ¥æå')
|
| | |
| | |
|
| | | })
|
| | | client.on('message', function(topic, message, buffer) {
|
| | | that.$eventBus.$emit(that.$constant.MQTT_TOPIC_MESSAGE, message);
|
| | | console.info(message)
|
| | | uni.$emit(that.$constant.MQTT_TOPIC_MESSAGE, message);
|
| | | console.error("æ¶å°messageï¼æ»ï¼ï¼"+topic)
|
| | |
|
| | |
|
| | | })
|
| | | },
|
| | |
| | | }, |
| | | { |
| | | "path" : "pages/tabBar/device", |
| | | "style" : |
| | | { |
| | | "style": {
|
| | | "navigationStyle": "custom", |
| | | "app-plus": { |
| | | "titleNView": false |
| | |
| | | },
|
| | | {
|
| | | "path" : "pages/tabBar/warning",
|
| | | "style" : |
| | | {
|
| | | "style": {
|
| | | "navigationStyle": "custom",
|
| | | "app-plus": {
|
| | | "titleNView": false
|
| | |
| | | }, |
| | | { |
| | | "path" : "pages/device/control", |
| | | "style" : |
| | | "style": {
|
| | | "navigationStyle": "custom",
|
| | | "app-plus": {
|
| | | "titleNView": false
|
| | | }
|
| | | }
|
| | | },
|
| | | { |
| | | "path": "pages/login/switchMode",
|
| | | "style": {
|
| | | "navigationStyle": "custom", |
| | | "app-plus": { |
| | | "titleNView": false |
| | |
| | | "pagePath": "pages/tabBar/device",
|
| | | "iconPath": "static/tabBar/shop.png",
|
| | | "selectedIconPath": "static/tabBar/shop_cur.png",
|
| | | "text": "çæ§"
|
| | | "text": "æºå°çæ§"
|
| | | }, {
|
| | | "pagePath": "pages/tabBar/warning",
|
| | | "iconPath": "static/tabBar/analy.png",
|
| | | "selectedIconPath": "static/tabBar/analy_cur.png",
|
| | | "text": "æ¥è¦"
|
| | | "text": "æ¥è¦éç¥"
|
| | | }, {
|
| | | "pagePath": "pages/tabBar/formula",
|
| | | "iconPath": "static/tabBar/order.png",
|
| | | "selectedIconPath": "static/tabBar/order_cur.png",
|
| | | "text": "é
æ¹"
|
| | | "text": "å¹²ç¥é
æ¹"
|
| | | }, {
|
| | | "pagePath": "pages/tabBar/me",
|
| | | "iconPath": "static/tabBar/me.png",
|
| | |
| | | export default {
|
| | | data() {
|
| | | return { |
| | | text: 'æºè½ä¸èè¯å¹²ç¥è®¾å¤é
å¥ç³»ç»',
|
| | | text: 'å
°æµ¦æºè½å¹²ç¥',
|
| | | cWidth: '',
|
| | | cHeight: '',
|
| | | pixelRatio: 1,
|
| | |
| | | let _this = this
|
| | | this.$mqttTool.client.on('message', function(topic, message, buffer) {
|
| | |
|
| | | console.error("è§£ææ°æ®")
|
| | | const msg = JSON.parse(message);
|
| | | console.error(topic)
|
| | | console.error(msg)
|
| | | console.error(msg.success)
|
| | | if (topic == _this.$constant.SERVICE_RES_EQU_STATU.replace('equ', _this.deviceId)) {
|
| | | if (msg.success) {
|
| | | _this.connected = msg.connected
|
| | |
| | | <template>
|
| | | <view class="contaier">
|
| | | <view class="top-bg">
|
| | | <view class="text-white text-bold text-xxxl">æºè½ä¸èè¯å¹²ç¥è®¾å¤é
å¥ç³»ç»</view>
|
| | | <view class="text-white text-bold text-xxxl">å
°æµ¦<text @longpress="showModal">æºè½</text>å¹²ç¥</view>
|
| | | <view class="margin-top-xs text-white">欢è¿ä½¿ç¨ï¼è¯·å
ç»å½</view>
|
| | | </view>
|
| | | <u-form labelPosition="left" :model="model" ref="form">
|
| | |
| | | <view class="padding margin-top-xs">
|
| | | <button @click="submit" class="cu-btn block round bg-login-zl margin-tb-sm lg">ç«å³ç»å½</button>
|
| | | <view class="text-gray flex justify-between padding-lr-sm">
|
| | | <text>注åè´¦å·</text>
|
| | | <text>å¿è®°å¯ç </text>
|
| | | <!-- <text @click="switchMode">å±åç½æ¨¡å¼</text> -->
|
| | | <!-- <text>å¿è®°å¯ç </text> -->
|
| | | </view>
|
| | | </view>
|
| | | </u-form>
|
| | |
|
| | | <u-modal :show="show" title="æç¤º" @confirm="handleSwitchMode">
|
| | | <view class="slot-content">
|
| | | <u-input v-model="pass" style="width: 100%;" placeholder="请è¾å
¥ç®¡çåå¯ç " border="surround" password
|
| | | clearable></u-input>
|
| | | </view>
|
| | | </u-modal>
|
| | |
|
| | | </view>
|
| | | </template>
|
| | | <script>
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | show: false,
|
| | | pass: "",
|
| | | model: {
|
| | | username: "tongjitang",
|
| | | password: "123456"
|
| | |
| | |
|
| | | };
|
| | | },
|
| | |
|
| | | onLoad() {
|
| | | const account = uni.getStorageSync('account');
|
| | | if (account) {
|
| | | this.model = account
|
| | | }
|
| | | let _that = this
|
| | | // uni-app客æ·ç«¯è·åpush客æ·ç«¯æ è®°
|
| | | // uni.getPushClientId({
|
| | | // success: (res) => {
|
| | | // let push_clientid = res.cid
|
| | | // _that.model.username = push_clientid
|
| | | // console.log('客æ·ç«¯æ¨éæ è¯:', push_clientid)
|
| | | // },
|
| | | // fail(err) {
|
| | | // _that.model.username = err
|
| | | // console.log(err)
|
| | | // }
|
| | | // })
|
| | |
|
| | | // uni.onPushMessage((res) => {
|
| | | // _that.model.username = JSON.stringify(res)
|
| | | // console.log("æ¶å°æ¨éæ¶æ¯ï¼", res) //ç嬿¨éæ¶æ¯
|
| | | // })
|
| | |
|
| | |
|
| | |
|
| | | },
|
| | | mounted() {
|
| | | setTimeout(() => {
|
| | | this.model.username = this.clientPushId
|
| | | }, 1000)
|
| | | },
|
| | | computed: {
|
| | | cid() {
|
| | | return this.$store.getters.getCid; // ä½¿ç¨ getter è·å cid
|
| | | clientPushId() {
|
| | | return this.$store.getters.getClientPushId;
|
| | |
|
| | | },
|
| | | },
|
| | | methods: {
|
| | |
|
| | | showModal() {
|
| | | this.pass = ""
|
| | | this.show = true
|
| | | },
|
| | | handleSwitchMode() {
|
| | | this.show = false
|
| | | if (this.pass === 'lanbaoit') {
|
| | | this.switchMode()
|
| | | }
|
| | | },
|
| | | switchMode() {
|
| | | uni.navigateTo({
|
| | | url: "/pages/login/switchMode"
|
| | | })
|
| | | },
|
| | | forget() {
|
| | | uni.navigateTo({
|
| | | url: "/pages/tabBar/demo"
|
| | | })
|
| | | },
|
| | | submit() {
|
| | | if (this.model.username.startsWith("http")) {
|
| | | uni.setStorageSync('baseurl', this.model.username);
|
| | | this.model.username = null
|
| | | uni.$u.toast('é
ç½®baseUrlæå,请éåºç¨åºéæ°å¯å¨~')
|
| | | return false;
|
| | | const mode = uni.getStorageSync('mode');
|
| | | //馿¬¡ç»å½æ²¡æé
ç½®ï¼é»è®¤ä¸ºäºæå¡æ¨¡å¼
|
| | | if (!mode) {
|
| | | uni.setStorageSync('mode', 'cloud');
|
| | | }
|
| | | const curMode = uni.getStorageSync('mode');
|
| | |
|
| | | getApp().globalData.mode = curMode;
|
| | |
|
| | |
|
| | |
|
| | | this.$refs.form.validate().then(res => {
|
| | | this.login()
|
| | |
| | | login() {
|
| | | this.$api.login(this.model).then((res) => {
|
| | | if (res.success) {
|
| | |
|
| | |
|
| | | console.log('request success', res)
|
| | | uni.showToast({
|
| | | title: 'ç»å½æå',
|
| | | icon: 'success',
|
| | | mask: true
|
| | | });
|
| | |
|
| | | //ç¼åä¿¡æ¯
|
| | | uni.setStorageSync('account', this.model);
|
| | | uni.setStorageSync('userinfo', res.result.userInfo);
|
| | | uni.setStorageSync('token', res.result.token);
|
| | |
|
| | |
|
| | |
|
| | | uni.switchTab({
|
| | | url: '/pages/tabBar/general'
|
| | |
| | | console.log('request fail', err);
|
| | | })
|
| | | },
|
| | | onReset(e) {
|
| | | console.log(e)
|
| | | }
|
| | |
|
| | | },
|
| | | onReady() {
|
| | | //onReady 为uni-appæ¯æççå½å¨æä¹ä¸
|
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <view class="app">
|
| | | <cu-custom bgColor="bg-gradual-blue" :isBack="true">
|
| | | <block slot="content">åæ¢æ¨¡å¼</block>
|
| | | </cu-custom>
|
| | |
|
| | | <view class="cu-bar bg-white margin-top">
|
| | | <view class="action sub-title">
|
| | | <text class="text-xl text-bold text-blue text-shadow">å½å模å¼</text>
|
| | | <text class="text-ABC text-blue">current</text>
|
| | | </view>
|
| | | </view>
|
| | | <u-form labelPosition="left" ref="form">
|
| | | <view class="padding-lr info-box">
|
| | |
|
| | | <view class="cover-view" @tap.catch="showSelect">
|
| | |
|
| | | </view>
|
| | |
|
| | | <view style="position: relative;">
|
| | | <u-form-item label="模å¼" prop="username" borderBottom>
|
| | | <u-input v-model="sModel" border="none" suffixIcon="arrow-right" readonly></u-input>
|
| | | </u-form-item>
|
| | | </view>
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | <u-form-item label="å°å" prop="password" borderBottom v-show="showIp">
|
| | | <u-input v-model="ip" placeholder="请è¾å
¥IPå°å,å¦:192.168.1.1" border="none" clearable>
|
| | | </u-input>
|
| | | </u-form-item>
|
| | |
|
| | | <view class="submitBtn" @click="saveMode">ä¿å</view>
|
| | | <view style="height: 20rpx;background-color: white"></view>
|
| | | </view>
|
| | | </u-form>
|
| | |
|
| | | <u-action-sheet :closeOnClickAction="true" @close="show=false" @select="selectMode" :safeAreaInsetBottom="true"
|
| | | :actions="switchList" title="éæ©æ¨¡å¼" cancelText="åæ¶" :show="show"></u-action-sheet>
|
| | |
|
| | | </view>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import {
|
| | | vShow
|
| | | } from "vue";
|
| | |
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | switchList: [{
|
| | | name: 'äºæå¡',
|
| | | index: 0
|
| | | }, {
|
| | | name: 'å±åç½',
|
| | | index: 1
|
| | | }],
|
| | | show: false,
|
| | | sModel: 'äºæå¡',
|
| | | ip: '',
|
| | | showIp: false,
|
| | | selectModeIndex: 0,
|
| | |
|
| | | };
|
| | | },
|
| | | mounted() {
|
| | | const mode = uni.getStorageSync('mode');
|
| | | const lan_ip = uni.getStorageSync('lan_ip');
|
| | | if (mode) {
|
| | | if (mode == 'cloud') {
|
| | | this.sModel = 'äºæå¡'
|
| | | this.showIp = false
|
| | | } else if (mode == 'lan') {
|
| | | this.sModel = 'å±åç½'
|
| | | this.showIp = true
|
| | | }
|
| | |
|
| | | if (this.sModel == 'å±åç½') {
|
| | | this.ip = lan_ip
|
| | | }
|
| | |
|
| | | }
|
| | | },
|
| | | methods: {
|
| | | showSelect() {
|
| | | this.show = true
|
| | | },
|
| | | selectMode(item) {
|
| | | this.sModel = item.name
|
| | | console.error(item.index)
|
| | | this.showIp = item.index === 1
|
| | | this.selectModeIndex = item.index
|
| | |
|
| | | },
|
| | | saveMode() {
|
| | | if (!this.ip | !this.isValidIPv4(this.ip)) {
|
| | |
|
| | | uni.$u.toast('请è¾å
¥æ£ç¡®IPå°å~')
|
| | | return false
|
| | |
|
| | | }
|
| | |
|
| | | if (this.selectModeIndex === 0) {
|
| | | uni.removeStorageSync('lan_ip')
|
| | | uni.setStorageSync('mode', 'cloud');
|
| | | } else if (this.selectModeIndex === 1) {
|
| | | uni.setStorageSync('mode', 'lan');
|
| | | uni.setStorageSync('lan_ip', this.ip);
|
| | | }
|
| | |
|
| | | uni.$u.toast('é
ç½®æå,请å®å
¨éåºç¨åºåéæ°å¯å¨~')
|
| | | },
|
| | | isValidIPv4(ip) {
|
| | | const ipv4Regex =
|
| | | /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/;
|
| | | return ipv4Regex.test(ip);
|
| | | }
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss">
|
| | | .cover-view {
|
| | | position: absolute;
|
| | | /* å¿
é¡»æ¯ç¸å¯¹å®ä½æç»å¯¹å®ä½ */
|
| | | z-index: 10;
|
| | | /* ç¡®ä¿ z-index å¼é«äº u-input */
|
| | | width: 100%;
|
| | | height: 80rpx;
|
| | | background-color: transparent;
|
| | | }
|
| | |
|
| | | .info-box {
|
| | | position: relative;
|
| | | background-color: white;
|
| | | }
|
| | |
|
| | | .distinguishBox {
|
| | | padding: 5rpx 30rpx 20rpx;
|
| | | background: white;
|
| | |
|
| | | view {
|
| | | margin-bottom: 20rpx;
|
| | | }
|
| | | }
|
| | |
|
| | | .disLabel {
|
| | | text-align-last: justify;
|
| | | text-align: justify;
|
| | | text-justify: distribute-all-lines;
|
| | | min-width: 142rpx;
|
| | | display: inline-block;
|
| | | margin-right: 5rpx;
|
| | | }
|
| | |
|
| | | .submitBtn {
|
| | | width: 90%;
|
| | | height: 90rpx;
|
| | | background: #007aec;
|
| | | line-height: 90rpx;
|
| | | margin: 50rpx auto;
|
| | | text-align: center;
|
| | | font-size: 34rpx;
|
| | | color: #fff;
|
| | | border-radius: 12rpx;
|
| | | }
|
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <view>
|
| | | <view class="card-box center dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">æè¿æ¥è¦</view>
|
| | | </view>
|
| | | <view>
|
| | | <text class="text-blue text-sm">æ´å¤></text>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | <view class="borderTop">
|
| | | <view class="h-table">
|
| | | <view class="h-tr h-tr-2 ">
|
| | | <view class="h-td">æºå°</view>
|
| | | <view class="h-td">æ
é</view>
|
| | | <view class="h-td">æ¶é´</view>
|
| | | <view class="h-td">ç±»å</view>
|
| | | </view>
|
| | | <view class="h-tr h-tr-2" v-for="(item,index) in faultList">
|
| | | <view class="h-td">{{item.equName}}</view>
|
| | | <view class="h-td text-ellipsis">{{item.faultName}}</view>
|
| | | <view class="h-td text-ellipsis">{{item.faultTimeStr}}</view>
|
| | | <view class="h-td">{{item.faultType===1?'æ
é':'åè¦'}}</view>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | </view>
|
| | |
|
| | | <view class="card-box center dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">æ¥è¦ç»è®¡</view>
|
| | | </view>
|
| | | <view>
|
| | | <text class="text-gray text-sm"></text>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | <view class="chartsMain" style="height: 400rpx;">
|
| | | <!-- <qiun-data-charts type="mount" :opts="opts" :ontouch='true' :animation="true" :chartData="mountData" /> -->
|
| | | <qiun-data-charts canvasId="chat1" type="column" :errorMessage="errorMessage1"
|
| | | :opts="opts" :ontouch='true' :animation="true" :chartData="statisData" />
|
| | |
|
| | | </view>
|
| | | </view>
|
| | |
|
| | |
|
| | | <view class="card-box center dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">æ¥è¦å¯¹æ¯</view>
|
| | | </view>
|
| | | <view>
|
| | | <text class="text-gray text-sm"></text>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | <view class="chartsMain">
|
| | | <qiun-data-charts canvasId="chat2" type="pie" :errorMessage="errorMessage2"
|
| | | :opts="optsPie" :ontouch='true' :animation="true" :chartData="pieData" />
|
| | |
|
| | | </view>
|
| | | </view>
|
| | |
|
| | |
|
| | |
|
| | | <view class="card-box center dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">æ¥è¦é¢ç</view>
|
| | | </view>
|
| | | <view>
|
| | | <text class="text-gray text-sm"></text>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | <view class="chartsMain" style="height: 500rpx;">
|
| | | <!-- <qiun-data-charts type="mount" :opts="{extra:{mount:{type:'mount',widthRatio:1.5}}}"
|
| | | :chartData="Mount" /> -->
|
| | | <qiun-data-charts canvasId="chat3" type="word" :errorMessage="errorMessage3"
|
| | | :chartData="wordData" />
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | <view class="card-box bot dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">æ¥è¦åæ</view>
|
| | | </view>
|
| | | <view>
|
| | | <text class="text-gray text-sm"></text>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | <view class="chartsMain" style="height: 500rpx;">
|
| | | <qiun-data-charts canvasId="chat4" type="line" :opts="optsStep"
|
| | | :errorMessage="errorMessage4" :ontouch='true' :animation="true" :chartData="statisData" />
|
| | |
|
| | | <!-- <qiun-data-charts type="radar" :opts="optsRadar" :chartData="dataRadar" /> -->
|
| | | </view>
|
| | | </view>
|
| | |
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import dayjs from 'dayjs'
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | "PieA": {
|
| | | "series": [{
|
| | | "data": [
|
| | |
|
| | | ]
|
| | | }]
|
| | | },
|
| | | errorMessage1: "",
|
| | | errorMessage2: "",
|
| | | errorMessage3: "",
|
| | | errorMessage4: "",
|
| | | faultList: [],
|
| | | pieData: {
|
| | | "series": [{
|
| | | "data": []
|
| | | }]
|
| | | },
|
| | | statisData: {
|
| | | series: [],
|
| | | categories: []
|
| | | },
|
| | | wordData: {
|
| | | series: []
|
| | | },
|
| | | optsStep: {
|
| | | enableScroll: true,
|
| | | xAxis: {
|
| | | marginTop: 10,
|
| | | itemCount: 8,
|
| | | rotateLabel: true
|
| | | },
|
| | | extra: {
|
| | | line: {
|
| | | type: 'step'
|
| | | }
|
| | | }
|
| | | },
|
| | | opts: {
|
| | | enableScroll: true,
|
| | | xAxis: {
|
| | | marginTop: 10,
|
| | | itemCount: 8,
|
| | | rotateLabel: true
|
| | | },
|
| | | legend: {
|
| | | show: false
|
| | | },
|
| | | yAxis: {
|
| | | data: [{
|
| | | min: 0
|
| | | }]
|
| | | },
|
| | | extra: {
|
| | | column: {
|
| | | width: 12,
|
| | | seriesGap: 5,
|
| | | barBorderRadius: [6, 6, 6, 6]
|
| | | }
|
| | | }
|
| | | },
|
| | | optsPie: {
|
| | | padding: [5, 5, 5, 5],
|
| | | legend: {
|
| | | show: false
|
| | | },
|
| | | fontSize: 12,
|
| | | extra: {
|
| | | pie: {
|
| | | activeOpacity: 0.5,
|
| | | activeRadius: 10,
|
| | | offsetAngle: 0,
|
| | | labelWidth: 1,
|
| | | border: true,
|
| | | borderWidth: 3,
|
| | | borderColor: "#FFFFFF",
|
| | | linearType: "custom"
|
| | | }
|
| | | }
|
| | | },
|
| | |
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | setTimeout(() => {
|
| | | this.init()
|
| | | }, 300)
|
| | | },
|
| | | methods: {
|
| | | init() { |
| | | // è·åN天åç0ç¹0å0ç§ |
| | | let daysAgo = dayjs().subtract(3, 'day').startOf('day').format('YYYY-MM-DD HH:mm:ss'); |
| | | // è·åä»å¤©ç23ç¹59å59ç§ |
| | | let today = dayjs().endOf('day').format('YYYY-MM-DD HH:mm:ss'); |
| | | |
| | | let params = {
|
| | | column: 'createTime',
|
| | | order: 'desc', |
| | | startTime_begin: daysAgo, |
| | | startTime_end: today,
|
| | | pageNo: 1,
|
| | | pageSize: 3
|
| | | }
|
| | | this.$api.queryHisFaultList(params).then((res) => {
|
| | | this.faultList = res.result.records
|
| | | }).catch(res => {
|
| | |
|
| | | })
|
| | | |
| | |
|
| | | let chartParam = {
|
| | | startTime_begin: daysAgo,
|
| | | startTime_end: today,
|
| | | } |
| | | this.statisData = {} |
| | | this.pieData = {} |
| | | this.wordData = {}
|
| | | this.$api.queryHisFaultChartList(chartParam).then((res) => {
|
| | |
|
| | | // æ±ç¶å¾
|
| | | const statis = {
|
| | | series: [],
|
| | | categories: []
|
| | | };
|
| | | //饼å¾
|
| | | const pieData = {
|
| | | series: [{
|
| | | data: []
|
| | | }]
|
| | | };
|
| | | //è¯äºå¾
|
| | | const wordData = {
|
| | | series: []
|
| | | };
|
| | | this.$emit('handleData', res)
|
| | | // æ£æ¥ res æ¯å¦ä¸º null æè
䏿¯ä¸ä¸ªæ°ç»
|
| | | if (!Array.isArray(res) || res === null || res.length === 0) {
|
| | |
|
| | | this.errorMessage1 = "ææ æ°æ®"+ dayjs().format('HH:mm:ss');
|
| | | this.errorMessage2 = "ææ æ°æ®"+ dayjs().format('HH:mm:ss');
|
| | | this.errorMessage3 = "ææ æ°æ®"+ dayjs().format('HH:mm:ss');
|
| | | this.errorMessage4 = "ææ æ°æ®"+ dayjs().format('HH:mm:ss');
|
| | | return;
|
| | | }
|
| | |
|
| | |
|
| | | console.error(res)
|
| | |
|
| | | // 忬¡éå resï¼åæ¶å¯»æ¾æå¤§ ecount å¹¶æå»º categoriesãdata å pieData
|
| | | const result = res.reduce((acc, item) => {
|
| | | if (item.faultType === 1) {
|
| | | acc.categories.push(item.faultName);
|
| | | const value = item.ecount;
|
| | | acc.data.push({
|
| | | value,
|
| | | color: undefined // å
ä¸è®¾å®é¢è²
|
| | | });
|
| | |
|
| | | }
|
| | | // æ´æ°æå¤§ ecount
|
| | | if (item.ecount > acc.maxEcount) {
|
| | | acc.maxEcount = item.ecount;
|
| | | }
|
| | |
|
| | | return acc;
|
| | | }, {
|
| | | maxEcount: 0,
|
| | | categories: [],
|
| | | data: []
|
| | | });
|
| | |
|
| | | // ç¬¬äºæ¬¡éå data æ°ç»ï¼ä¸ºæææå¤§ ecount 设置é¢è²
|
| | | result.data.forEach((item, index) => {
|
| | | if (item.value === result.maxEcount) {
|
| | | result.data[index].color = '#f04864';
|
| | | }
|
| | | });
|
| | |
|
| | | // å°å¤çç»æèµå¼ç» statis
|
| | | statis.series.push({
|
| | | name: "æ
é",
|
| | | data: result.data.map(item => 'color' in item ? item : item.value)
|
| | | });
|
| | | statis.categories = result.categories;
|
| | |
|
| | |
|
| | |
|
| | | res.filter(item => item.faultType == 1).forEach(item => {
|
| | | // æå»º pieData
|
| | | pieData.series[0].data.push({
|
| | | name: item.faultName,
|
| | | value: item.ecount,
|
| | | labelText: item.faultName + ":" + item.ecount + "次"
|
| | | });
|
| | | })
|
| | |
|
| | |
|
| | |
|
| | | // 设置å°ç»ä»¶å±æ§
|
| | | this.statisData = statis;
|
| | | this.pieData = pieData;
|
| | | if (this.statisData.series.length === 0) {
|
| | | this.errorMessage1 = "ææ æ°æ®"+ dayjs().format('HH:mm:ss');
|
| | | this.errorMessage4 = "ææ æ°æ®"+ dayjs().format('HH:mm:ss');
|
| | | }
|
| | |
|
| | | if (this.pieData.series[0].data.length === 0) {
|
| | | this.errorMessage2 = "ææ æ°æ®"+ dayjs().format('HH:mm:ss');
|
| | | }
|
| | |
|
| | |
|
| | | const cdata = res.filter(item => item.faultType === 1).map(item => ({
|
| | | faultName: item.faultName,
|
| | | ecount: item.ecount
|
| | | }));
|
| | | console.error(cdata)
|
| | | const wordCloudData = this.generateWordCloudData(cdata)
|
| | |
|
| | | wordData.series = wordCloudData
|
| | | this.wordData = wordData
|
| | | console.error(this.wordData)
|
| | | if (this.wordData.series.length === 0) {
|
| | | this.errorMessage3 = "ææ æ°æ®"+ dayjs().format('HH:mm:ss');
|
| | | }
|
| | |
|
| | |
|
| | | }).catch(res => {
|
| | |
|
| | | })
|
| | |
|
| | |
|
| | | },
|
| | | generateWordCloudData(data) {
|
| | | // å®ä¹åä½å¤§å°èå´
|
| | | const minFontSize = 10;
|
| | | const maxFontSize = 20;
|
| | |
|
| | | // å¦ææ°æ®ä¸ºç©ºæä¸æ¯æ°ç»ï¼åè¿å空æ°ç»
|
| | | if (!Array.isArray(data) || data.length === 0) {
|
| | | return [];
|
| | | }
|
| | |
|
| | | // æ¾å°æå¤§åæå°çæ
鿬¡æ°
|
| | | let minCount = Infinity;
|
| | | let maxCount = -Infinity;
|
| | |
|
| | | data.forEach(item => {
|
| | | if (item.ecount < minCount) minCount = item.ecount;
|
| | | if (item.ecount > maxCount) maxCount = item.ecount;
|
| | | });
|
| | |
|
| | | // å¦ææææ
鿬¡æ°é½ç¸åï¼åç´æ¥ä¸ºæ¯ä¸ªæ¡ç®è®¾ç½®ç¸åçåä½å¤§å°
|
| | | if (minCount === maxCount) {
|
| | | return data.map(item => ({
|
| | | name: item.faultName,
|
| | | textSize: maxFontSize
|
| | | }));
|
| | | }
|
| | |
|
| | | // è®¡ç®æ¯ä¸ªæ¡ç®çåä½å¤§å°
|
| | | const wordCloudData = data.map(item => {
|
| | | const fontSize = ((maxFontSize - minFontSize) * (item.ecount - minCount)) / (maxCount -
|
| | | minCount) + minFontSize;
|
| | | return {
|
| | | name: item.faultName,
|
| | | textSize: Math.round(fontSize) // å¯éï¼åèäºå
¥å°ææ¥è¿çæ´æ°
|
| | | };
|
| | | });
|
| | | return wordCloudData;
|
| | | },
|
| | |
|
| | |
|
| | | }
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | @import "components/table/helang-table";
|
| | |
|
| | | .app {}
|
| | |
|
| | | .card-box {
|
| | | margin: 20rpx;
|
| | | padding: 20rpx;
|
| | | box-sizing: border-box;
|
| | | background-color: white;
|
| | | border-radius: 20rpx;
|
| | | font-family: Helvetica Neue, Helvetica, sans-serif;
|
| | |
|
| | | }
|
| | |
|
| | | .text-ellipsis {
|
| | | white-space: nowrap;
|
| | | /* 鲿¢ææ¬æ¢è¡ */
|
| | | overflow: hidden;
|
| | | /* è¶
åºé¨åéè */
|
| | | text-overflow: ellipsis;
|
| | | /* è¶
åºé¨åç¨çç¥å·è¡¨ç¤º */
|
| | | max-width: 100%;
|
| | | /* 设置æå¤§å®½åº¦ */
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | .top {
|
| | | margin: 0 20rpx;
|
| | | border-radius: 0;
|
| | | border-top-left-radius: 20rpx;
|
| | | border-top-right-radius: 20rpx;
|
| | | border-bot-left-radius: 0;
|
| | | border-bot-right-radius: 0;
|
| | |
|
| | | }
|
| | |
|
| | | .center {
|
| | | margin: 0 20rpx;
|
| | | border-radius: 0;
|
| | |
|
| | | }
|
| | |
|
| | | .bot {
|
| | | margin: 0 20rpx 20rpx 20rpx;
|
| | | border-top-left-radius: 0;
|
| | | border-top-right-radius: 0;
|
| | | border-bot-left-radius: 20rpx;
|
| | | border-bot-right-radius: 20rpx;
|
| | | }
|
| | |
|
| | |
|
| | | .title-box {
|
| | | display: flex;
|
| | | flex-direction: row;
|
| | | align-items: center;
|
| | |
|
| | | .left {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .title {
|
| | | margin: 0 10rpx;
|
| | | font-weight: bold;
|
| | | }
|
| | | }
|
| | |
|
| | | .right {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .title {
|
| | | margin: 0 10rpx;
|
| | | font-weight: bold;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .info-box {
|
| | | margin-top: 20rpx;
|
| | | display: flex;
|
| | | flex-direction: row;
|
| | | align-items: center;
|
| | |
|
| | | .left {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .title {
|
| | | margin: 0 10rpx;
|
| | | }
|
| | | }
|
| | |
|
| | | .right {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .title {
|
| | | margin: 0 10rpx;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | .chartsMain {
|
| | | width: 100%;
|
| | | height: 320rpx;
|
| | | padding-top: 15rpx;
|
| | | background: #fff;
|
| | | margin-bottom: 24rpx;
|
| | | border-top: 2rpx solid #f2f2f2;
|
| | |
|
| | | .charts {
|
| | | width: 50%;
|
| | | height: 450rpx;
|
| | | box-sizing: border-box;
|
| | | }
|
| | | }
|
| | |
|
| | | .tab-box {
|
| | | display: flex;
|
| | | justify-content: center;
|
| | | /* å¼ºå¶æ°´å¹³å±
ä¸ */
|
| | | }
|
| | |
|
| | | .swiper {
|
| | | height: 2116rpx;
|
| | | }
|
| | |
|
| | | .swiper-item-view {
|
| | | height: 2116rpx;
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | .picBox {
|
| | | margin: 0 20rpx;
|
| | | background-color: white;
|
| | |
|
| | | image {
|
| | | border-radius: 8rpx;
|
| | | width: 100%;
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | .borderTop {
|
| | | border-top: 2rpx solid #f2f2f2;
|
| | | padding-top: 20rpx;
|
| | | }
|
| | |
|
| | | // å¼¹åºå±èæ¯é®ç½©start
|
| | | .dropdown-mask {
|
| | | background: rgba(0, 0, 0, 0.5);
|
| | | }
|
| | |
|
| | | .lock-page {
|
| | | height: 100vh;
|
| | | width: 100vw;
|
| | | position: fixed;
|
| | | top: 0;
|
| | | left: 0;
|
| | | right: 0;
|
| | | bottom: 0;
|
| | | z-index: 998;
|
| | | }
|
| | |
|
| | | // å¼¹åºå±èæ¯é®ç½©end
|
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template>
|
| | | <view>
|
| | | <view class="card-box center dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">è®¾å¤ </view>
|
| | | </view>
|
| | | <view>
|
| | | <!-- <text class="text-blue text-sm">æ´å¤></text> -->
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | | <view class="fault-box">
|
| | |
|
| | | <image style="width: 100%;border-radius: 20rpx; " src="../../../static/image/ganzaoji-x.png"
|
| | | mode="aspectFit">
|
| | | </image>
|
| | |
|
| | |
|
| | | <view class="fault-inner">
|
| | | <view class="fault-info" v-for="(item,index) in realFaults" :style="getFaultItemStyle(item)">
|
| | | <view :class="['fault-animal', item.type === 1 ? 'fault-marker' : 'warn-marker']"></view>
|
| | | <view :class="['fault-tag', item.type === 1 ? 'fault-text' : 'warn-text']">{{item.name}}</view>
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | |
|
| | | <view class="card-box center dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">宿¶æ¥è¦ </view>
|
| | | </view>
|
| | | <view>
|
| | | <text class="text-blue text-sm">{{refreshTime}}</text>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | | <view class="borderTop" v-for="(item,index) in dataList">
|
| | | <view style="height: 180rpx;display: flex;align-items: center;">
|
| | | <view>
|
| | | <image style="width: 80rpx;height: 80rpx;margin:20rpx;border-radius: 20rpx; "
|
| | | src="../../../static/image/pic_gz.jpg"></image>
|
| | | </view>
|
| | | <view
|
| | | style="display: flex;flex: 1;flex-direction: column; justify-content: space-between; ;height: 100%;padding: 20rpx;">
|
| | | <view class="text-bold">
|
| | | {{$lget(item,'faultName')}}
|
| | | </view>
|
| | | <view class="text-gray text-sm">
|
| | | 设å¤:{{$lget(item,'equName')}}
|
| | | </view>
|
| | | <view class="text-gray text-sm">
|
| | | ç±»å:{{checkFaultType($lget(item,'faultType'))}}
|
| | | </view>
|
| | | <view class="text-gray text-sm">
|
| | | æ
éæ¶é´:{{coverTime($lget(item,'startTime'))}}
|
| | | </view>
|
| | | </view>
|
| | | <view style="width: 100rpx;"></view>
|
| | |
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import dayjs from 'dayjs'
|
| | | export default {
|
| | | data() {
|
| | | return {
|
| | | dataList: [],
|
| | | //宿¶æ¥è¦æ°æ®æ´æ°æ¶é´ï¼ä¸è¬10sï¼
|
| | | refreshTime: '', |
| | | realFaults:[],
|
| | | allFaults: [{ id: 1, name: 'è®¾å¤æ¥åï¼æ»ï¼', type: 1, position: {top: 70,left: 230},show: false}, |
| | | { id: 2, name: '左忥å', type: 1, position: {top: 100,left: 250},show: false}, |
| | | { id: 3, name: 'åºææ¥å', type: 1, position: {top: 130,left: 230},show: false}, |
| | | { id: 4, name: '颿¿æ¥å', type: 1, position: {top: 160,left: 250},show: false}, |
| | | { id: 5, name: 'é£ç®±åè¶
æ¶', type: 1, position: {top: 190,left: 230},show: false}, |
| | | { id: 6, name: 'é£ç®±éè¶
æ¶', type: 1, position: {top: 220,left: 250},show: false}, |
| | | { id: 7, name: '飿ºè¿æµ', type: 1, position: {top: 250,left: 230},show: false}, |
| | | { id: 8, name: 'æ»çåè¶
æ¶', type: 1, position: {top: 280,left: 250},show: false}, |
| | | { id: 9, name: 'æ»çéè¶
æ¶', type: 1, position: {top: 310,left: 230},show: false}, |
| | | { id: 10, name: 'æ»ççµæºè¿æµ', type: 1, position: {top: 340,left: 250},show: false}, |
| | | { id: 11, name: '温度失æ§', type: 1, position: {top: 370,left: 230},show: false}, |
| | | |
| | | { id: 12, name: 'å·¦å鍿¥è¦', type: 2, position: {top: 100,left: 0},show: false}, |
| | | { id: 13, name: 'å·¦å鍿¥è¦', type: 2, position: {top: 130,left: 20},show: false}, |
| | | { id: 14, name: 'å³å鍿¥è¦', type: 2, position: {top: 160,left: 0},show: false}, |
| | | { id: 15, name: 'å³å鍿¥è¦', type: 2, position: {top: 190,left: 20},show: false}, |
| | | { id: 16, name: 'æ»çä¸å¨é«ä½', type: 2, position: {top: 220,left: 0},show: false}, |
| | | { id: 17, name: 'é£ç®±ä¸å¨é«ä½', type: 2, position: {top: 250,left: 20},show: false}, |
| | | { id: 18, name: 'é£ç®±ä¸å¨ä½ä½', type: 2, position: {top: 280,left: 0},show: false}, |
| | | { id: 19, name: 'å çä½ä¼ æå¨æ¥è¦', type: 2, position: {top: 310,left: 20},show: false}, |
| | | { id: 20, name: 'å·¦åé£ç®±é«ä½', type: 2, position: {top: 340,left: 0},show: false}, |
| | | { id: 21, name: 'å·¦åé£ç®±ä½ä½', type: 2, position: {top: 370,left: 20},show: false}, |
| | | { id: 22, name: 'å·¦åé£ç®±é«ä½', type: 2, position: {top: 100,left: 430},show: false}, |
| | | { id: 23, name: 'å·¦åé£ç®±ä½ä½', type: 2, position: {top: 130,left: 450},show: false}, |
| | | { id: 24, name: 'å³åé£ç®±é«ä½', type: 2, position: {top: 160,left: 430},show: false}, |
| | | { id: 25, name: 'å³åé£ç®±ä½ä½', type: 2, position: {top: 190,left: 450},show: false}, |
| | | { id: 26, name: 'å³åé£ç®±é«ä½', type: 2, position: {top: 220,left: 430},show: false}, |
| | | { id: 27, name: 'å³åé£ç®±ä½ä½', type: 2, position: {top: 250,left: 450},show: false}, |
| | | { id: 28, name: '左忻çä½ä½', type: 2, position: {top: 280,left: 430},show: false}, |
| | | { id: 29, name: '左忻çä½ä½', type: 2, position: {top: 310,left: 450},show: false}, |
| | | { id: 30, name: 'å³åæ»çä½ä½', type: 2, position: {top: 340,left: 430},show: false}, |
| | | { id: 31, name: 'å³åæ»çä½ä½', type: 2, position: {top: 370,left: 450},show: false}, |
| | | ],
|
| | | }
|
| | | },
|
| | | mounted() {
|
| | | this.mqttData()
|
| | |
|
| | |
|
| | | },
|
| | | methods: {
|
| | | mqttData() {
|
| | | //å¤ç宿¶æ¥è¦æ°æ®
|
| | | uni.$on(this.$constant.MQTT_TOPIC_MESSAGE, (data) => {
|
| | | let json = JSON.parse(data);
|
| | | if (json == null || json.data == null || json.topic == null) return false
|
| | | let wdata = json.data
|
| | | let topic = json.topic
|
| | | const realFaultTopic = this.$constant.SERVICE_BROADCAST_TENANT_REAL_FAULT.replace('%s', this
|
| | | .tenantId)
|
| | | const oneceFaultTopic = this.$constant.SERVICE_ONECE_TENANT_REAL_FAULT.replace('%s', this
|
| | | .deviceId)
|
| | | switch (topic) {
|
| | | //topic 宿¶æ¥è¦
|
| | | case realFaultTopic:
|
| | | case oneceFaultTopic:
|
| | | if (wdata.length === 0) return false;
|
| | | this.dataList = wdata
|
| | | this.refreshTime = "æ´æ°æ¶é´:" + dayjs().format('HH:mm:ss');
|
| | | |
| | | const realFaultNames = this.dataList.map(item => item.faultName); |
| | | const realFaults = this.allFaults.filter(item=> |
| | | realFaultNames.some(name => |
| | | name.startsWith(item.name) |
| | | )) |
| | | this.realFaults = realFaults |
| | | //å¤çæ°æ®ç»è®¡
|
| | | this.$emit('handleData', this.dataList)
|
| | | break
|
| | | }
|
| | | });
|
| | | },
|
| | | getFaultItemStyle(item) {
|
| | | return {
|
| | | position: 'absolute',
|
| | | top: `${item.position.top}rpx`,
|
| | | left: `${item.position.left}rpx`,
|
| | | fontSize: '24rpx',
|
| | | };
|
| | | },
|
| | |
|
| | | checkFaultType(type) {
|
| | | if (type === 1) {
|
| | | return "æ
é";
|
| | | } else if (type === 2) {
|
| | | return "æ¥è¦";
|
| | | }
|
| | | },
|
| | | coverTime(timestamp) {
|
| | | if (timestamp) {
|
| | | return dayjs(timestamp).format('YYYY-MM-DD HH:mm:ss')
|
| | | }
|
| | |
|
| | | },
|
| | | },
|
| | | computed: {
|
| | | tenantId() {
|
| | | const userinfo = uni.getStorageSync('userinfo');
|
| | | const tenantid = userinfo.loginTenantId
|
| | | return tenantid + "";
|
| | | },
|
| | | deviceId() {
|
| | | return uni.getStorageSync(this.$constant.DEVICE_ID);
|
| | | } |
| | |
|
| | | },
|
| | | }
|
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | @import "components/table/helang-table";
|
| | |
|
| | | .app {}
|
| | |
|
| | | .card-box {
|
| | | margin: 20rpx;
|
| | | padding: 20rpx;
|
| | | box-sizing: border-box;
|
| | | background-color: white;
|
| | | border-radius: 20rpx;
|
| | | font-family: Helvetica Neue, Helvetica, sans-serif;
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | .top {
|
| | | margin: 0 20rpx;
|
| | | border-radius: 0;
|
| | | border-top-left-radius: 20rpx;
|
| | | border-top-right-radius: 20rpx;
|
| | | border-bot-left-radius: 0;
|
| | | border-bot-right-radius: 0;
|
| | |
|
| | | }
|
| | |
|
| | | .center {
|
| | | margin: 0 20rpx;
|
| | | border-radius: 0;
|
| | |
|
| | | }
|
| | |
|
| | | .bot {
|
| | | margin: 0 20rpx 20rpx 20rpx;
|
| | | border-top-left-radius: 0;
|
| | | border-top-right-radius: 0;
|
| | | border-bot-left-radius: 20rpx;
|
| | | border-bot-right-radius: 20rpx;
|
| | | }
|
| | |
|
| | |
|
| | | .title-box {
|
| | | display: flex;
|
| | | flex-direction: row;
|
| | | align-items: center;
|
| | |
|
| | | .left {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .title {
|
| | | margin: 0 10rpx;
|
| | | font-weight: bold;
|
| | | }
|
| | | }
|
| | |
|
| | | .right {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .title {
|
| | | margin: 0 10rpx;
|
| | | font-weight: bold;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | .info-box {
|
| | | margin-top: 20rpx;
|
| | | display: flex;
|
| | | flex-direction: row;
|
| | | align-items: center;
|
| | |
|
| | | .left {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .title {
|
| | | margin: 0 10rpx;
|
| | | }
|
| | | }
|
| | |
|
| | | .right {
|
| | | display: flex;
|
| | | align-items: center;
|
| | |
|
| | | .title {
|
| | | margin: 0 10rpx;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | .chartsMain {
|
| | | width: 100%;
|
| | | height: 320rpx;
|
| | | padding-top: 15rpx;
|
| | | background: #fff;
|
| | | margin-bottom: 24rpx;
|
| | | border-top: 2rpx solid #f2f2f2;
|
| | |
|
| | | .charts {
|
| | | width: 50%;
|
| | | height: 450rpx;
|
| | | box-sizing: border-box;
|
| | | }
|
| | | }
|
| | |
|
| | | .tab-box {
|
| | | display: flex;
|
| | | justify-content: center;
|
| | | /* å¼ºå¶æ°´å¹³å±
ä¸ */
|
| | | }
|
| | |
|
| | | .swiper {
|
| | | height: 2116rpx;
|
| | | }
|
| | |
|
| | | .swiper-item-view {
|
| | | height: 2116rpx;
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | | .fault-box {
|
| | | width: 100%;
|
| | | height: 460rpx;
|
| | | position: relative;
|
| | |
|
| | |
|
| | | .fault-inner {
|
| | | position: absolute;
|
| | | top: 0;
|
| | | left: 0;
|
| | | right: 0;
|
| | | bottom: 0;
|
| | | padding: 20rpx 0;
|
| | | background: transparent; |
| | | overflow: hidden;
|
| | |
|
| | | .fault-info {
|
| | | position: absolute;
|
| | | display: flex;
|
| | | align-items: center;
|
| | | justify-content: center; |
| | | |
| | | }
|
| | |
|
| | | .fault-tag { |
| | | display: flex; |
| | | align-items: center; |
| | | margin-left: 6rpx;
|
| | | height: 28rpx; |
| | | padding: 0 10rpx;
|
| | | background: gray;
|
| | | border-radius: 5rpx; |
| | | font-size: 22rpx;
|
| | | font-weight: bold;
|
| | | color: red; |
| | | white-space: nowrap; /* 䏿¢è¡ */ |
| | | overflow: hidden; /* è¶
åºé¨åéè */ |
| | | text-overflow: ellipsis; /* è¶
åºé¨åç¨çç¥å·è¡¨ç¤º */
|
| | | }
|
| | | |
| | | .fault-marker{ |
| | | width: 20rpx; |
| | | height: 20rpx; |
| | | background: red; |
| | | border-radius: 50%; |
| | | } |
| | | .warn-marker{ |
| | | width: 24rpx; |
| | | height: 24rpx; |
| | | background: orange; |
| | | border-radius: 50%; |
| | | } |
| | | .fault-text{ |
| | | color: red; |
| | | } |
| | | .warn-text{ |
| | | color: orange; |
| | | } |
| | | |
| | | .fault-animal {
|
| | | |
| | | -webkit-animation: scaleout 2s infinite ease-in-out;
|
| | | animation: scaleout 2s infinite ease-in-out;
|
| | | }
|
| | |
|
| | | @-webkit-keyframes scaleout {
|
| | | 0% {
|
| | | -webkit-transform: scale(1);
|
| | | }
|
| | |
|
| | | 100% {
|
| | | -webkit-transform: scale(1.1);
|
| | | opacity: 0;
|
| | | }
|
| | | }
|
| | |
|
| | | @keyframes scaleout {
|
| | | 0% {
|
| | | transform: scale(1);
|
| | | -webkit-transform: scale(1);
|
| | | }
|
| | |
|
| | | 100% {
|
| | | transform: scale(1.1);
|
| | | -webkit-transform: scale(1.1);
|
| | | opacity: 0;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | .picBox {
|
| | | margin: 0 20rpx;
|
| | | background-color: white;
|
| | |
|
| | | image {
|
| | | border-radius: 8rpx;
|
| | | width: 100%;
|
| | |
|
| | | }
|
| | | }
|
| | |
|
| | | .borderTop {
|
| | | border-top: 2rpx solid #f2f2f2;
|
| | | padding-top: 20rpx;
|
| | | }
|
| | |
|
| | | // å¼¹åºå±èæ¯é®ç½©start
|
| | | .dropdown-mask {
|
| | | background: rgba(0, 0, 0, 0.5);
|
| | | }
|
| | |
|
| | | .lock-page {
|
| | | height: 100vh;
|
| | | width: 100vw;
|
| | | position: fixed;
|
| | | top: 0;
|
| | | left: 0;
|
| | | right: 0;
|
| | | bottom: 0;
|
| | | z-index: 998;
|
| | | }
|
| | |
|
| | | // å¼¹åºå±èæ¯é®ç½©end
|
| | | </style> |
| | |
| | |
|
| | |
|
| | |
|
| | | <u-skeleton class=" " rows="20" :loading="loading" :title="false">
|
| | | <u-skeleton rows="20" :loading="loading" :title="false">
|
| | | <!-- 妿叿å
¶ä»viewè·ç页颿»å¨ï¼å¯ä»¥æ¾å¨z-pagingæ ç¾å
-->
|
| | | <view class="card-box dynamic shadow" v-for="(item,index) in dataList" :key="index"
|
| | | @click="itemClick(item)">
|
| | |
| | | curDate:uni.$u.timeFormat(new Date(), 'yyyy-mm-dd'),
|
| | | }
|
| | | },
|
| | | onTabItemTap : function(e) { |
| | | getApp().globalData.selectTab = e.index |
| | | },
|
| | | methods: {
|
| | | queryList(pageNo, pageSize) {
|
| | | this.loading = true;
|
| | |
| | | computed: { |
| | | |
| | | }, |
| | | onTabItemTap : function(e) { |
| | | getApp().globalData.selectTab = e.index |
| | | }, |
| | | methods: { |
| | | showItem(item){ |
| | | console.info(item) |
| | |
| | | <template>
|
| | | <view class="app">
|
| | | <!-- <view class="cu-custom custom-bar" :style="[{height:CustomBar + 'px'}]">
|
| | | <view class="select-equ-box">
|
| | | <u-icon name="setting" color="rgb(255,255,255)" :size="20"></u-icon>
|
| | | <text style="margin-left: 10rpx;" @click="show">1å·å¹²ç¥æº</text>
|
| | | <u-icon name="arrow-right" color="rgb(255,255,255)" :size="12"></u-icon>
|
| | | </view>
|
| | | </view>
|
| | | <view class="blank" :style="[{height:CustomBar + 'px'}]">
|
| | | </view>
|
| | | |
| | | -->
|
| | | <cu-custom bgColor="bg-gradual-blue" :isBack="false">
|
| | | <block slot="content">æºè½ä¸èè¯</block>
|
| | | <block slot="content">å
°æµ¦æºè½å¹²ç¥</block>
|
| | | </cu-custom>
|
| | | <mqtt-view ref="mqttView"></mqtt-view>
|
| | | |
| | | <u-toast ref="uToast"></u-toast>
|
| | | <!-- <view class="card-box dynamic shadow cu-list menu">
|
| | | <view class="title-box">
|
| | | <view class="left">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">ç»è®¡</view>
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | <view class="cu-item" style="padding: 0;">
|
| | | <view class="content">
|
| | | <image src='/static/me/icon/bianqian.png' class='png' mode='aspectFit'></image>
|
| | | <text class="text-lg">çå¹²æ»é</text>
|
| | | </view>
|
| | | <view class="action">
|
| | | <view class="cu-tag radius bg-blue light">
|
| | | 1200kg
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | <view class="cu-item" style="padding: 0;">
|
| | | <view class="content">
|
| | | <image src='/static/me/icon/bianqian.png' class='png' mode='aspectFit'></image>
|
| | | <text class="text-lg">çå¹²æ¶é¿</text>
|
| | | </view>
|
| | | <view class="action">
|
| | | <view class="cu-tag radius bg-blue light">
|
| | | 300åé
|
| | | </view>
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | <view class="bxBox">
|
| | | <image src="/static/me/icon/bianqian.png" class="png" style="width: 48upx;
|
| | | height: 48upx;" mode="aspectFit"></image>
|
| | | <view style="padding-left: 10rpx;" class="text-lg">çå¹²è¯æ</view>
|
| | | </view>
|
| | |
|
| | | <view class='padding-bottom-sm flex flex-wrap bg-white' style="justify-content: flex-end;">
|
| | | <view class="cu-tag margin-right-xs bg-blue light radius">
|
| | | å½å½
|
| | | </view>
|
| | | <view class="cu-tag bg-purple light radius">
|
| | | 人å
|
| | | </view>
|
| | | <view class="cu-tag bg-brown light radius">
|
| | | é¾é¡»è
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | </view> -->
|
| | |
|
| | |
|
| | | <view class="card-box dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view class="left justify-between">
|
| | |
| | | <view class="title">æç»</view>
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | <u-skeleton rows="20" :loading="loading" :title="false">
|
| | | <view class="data-item" v-for="(item, index) in herbList" :key="item.id" style="padding: 0 10rpx;">
|
| | | <view class="flex justify-between text-lg align-center padding-tb-xs">
|
| | | <view class="flex">
|
| | |
| | | <u-line color="#f1f1f1" margin="15rpx 0 15rpx 0"></u-line>
|
| | | </view>
|
| | |
|
| | |
|
| | |
|
| | | </u-skeleton>
|
| | | </view>
|
| | | |
| | | |
| | | <mqtt-view ref="mqttView"></mqtt-view>
|
| | | <!--
|
| | | <view class="page-box" v-show="false">
|
| | | <view class="order" v-for="(res, index) in dataList" :key="res.id">
|
| | |
| | | </template>
|
| | |
|
| | | <script>
|
| | | |
| | | import get from 'lodash.get'
|
| | |
|
| | | export default {
|
| | |
|
| | |
| | | }],
|
| | | StatusBar: this.StatusBar,
|
| | | CustomBar: this.CustomBar,
|
| | | loading: true,
|
| | | percent: 50,
|
| | | activeColor: '#0081ff',
|
| | | monthList: [],
|
| | |
| | | }
|
| | | },
|
| | | onShow() {
|
| | | console.info('onShow')
|
| | | uni.showTabBarRedDot({
|
| | | index: 2 // æ¾ç¤ºç¬¬2个tabbar项ï¼ç´¢å¼ä»0å¼å§ï¼ç红ç¹
|
| | | });
|
| | |
|
| | |
|
| | | },
|
| | | mounted() {
|
| | |
| | |
|
| | | },
|
| | | onReady() {
|
| | | //æ¥æ¶æ¥è¦ä¿¡æ¯ï¼æ°æ®é¢å¤çï¼æªæå¼tabæ æ³æ¥æ¶æ°æ®ï¼
|
| | | uni.$on(this.$constant.MQTT_TOPIC_MESSAGE, (data) => {
|
| | | let json = JSON.parse(data);
|
| | | if (json == null || json.data == null || json.topic == null) {
|
| | | return false
|
| | | }
|
| | | //卿¥è¦é¡µé¢æ¶ä¸æ¾ç¤ºçº¢ç¹
|
| | | if (getApp().globalData.selectTab === 2) {
|
| | | uni.hideTabBarRedDot({
|
| | | index: 2
|
| | | });
|
| | | return false
|
| | | }
|
| | |
|
| | | let wdata = json.data
|
| | | let topic = json.topic
|
| | | switch (topic) {
|
| | | //topic 宿¶æ¥è¦
|
| | | case this.$constant.SERVICE_BROADCAST_TENANT_REAL_FAULT.replace('%s', this.tenantId):
|
| | | if (wdata.length > 0) {
|
| | | uni.showTabBarRedDot({
|
| | | index: 2 // æ¾ç¤ºç¬¬2个tabbar项ï¼ç´¢å¼ä»0å¼å§ï¼ç红ç¹
|
| | | });
|
| | | }
|
| | | break
|
| | | }
|
| | |
|
| | | });
|
| | |
|
| | | this.$refs.mqttView.initMqtt()
|
| | | |
| | | // uni.getSystemInfo({
|
| | | // success: (res) => {
|
| | | // let deviceId = res.deviceId
|
| | | // if (!deviceId) {
|
| | | // deviceId = 'mobile-' + this.tenantId + '-' + Date.parse(new Date())
|
| | | // }
|
| | | // uni.setStorageSync(this.$constant.DEVICE_ID, 'mobile-' + this.tenantId + '-' + res.deviceId);
|
| | | // }
|
| | | // })
|
| | | // this.startConnect();
|
| | |
|
| | |
|
| | |
|
| | | let month = uni.$u.timeFormat(new Date(), 'yyyy-mm')
|
| | | this.getMonth(month)
|
| | |
| | |
|
| | |
|
| | | },
|
| | | onLoad() {
|
| | | |
| | | onLoad() {},
|
| | | onTabItemTap: function(e) {
|
| | | getApp().globalData.selectTab = e.index
|
| | | },
|
| | | methods: {
|
| | |
|
| | |
| | | async startConnect() {
|
| | | var _this = this
|
| | | const account = uni.getStorageSync('account');
|
| | | const deviceid = uni.getStorageSync(this.$constant.DEVICE_ID);
|
| | |
|
| | |
|
| | | if (!account) {
|
| | |
|
| | |
| | | // #ifdef APP-PLUS
|
| | | url: 'wx://' + this.$api.mqttBaseUrl + ':8083/mqtt',
|
| | | // #endif
|
| | | clientId: deviceid,
|
| | | clientId: this.deviceId,
|
| | | username: account.username,
|
| | | password: account.password
|
| | | }
|
| | |
| | | console.error(res)
|
| | | })
|
| | |
|
| | | //订é
è®¾å¤æ
é广æï¼å¹¿æä¸å¨ä¹å®¢æ·ç«¯idï¼åéç»ç§æ·ä¸ææå¨çº¿ç设å¤ï¼
|
| | | //订é
设å¤å®æ¶æ
é广æï¼å¹¿æä¸å¨ä¹å®¢æ·ç«¯idï¼åéç»ç§æ·ä¸ææå¨çº¿ç设å¤ï¼
|
| | | this.$mqttTool.subscribe({
|
| | | topic: this.$constant.SERVICE_BROADCAST_TENANT_REAL_FAULT.replace('%s', this.tenantId),
|
| | | qos: 0
|
| | | }).then(res => {
|
| | | console.error(res)
|
| | | })
|
| | |
|
| | | //订é
设å¤å®æ¶æ
éï¼ä¸»å¨è¯·æ±åªåç»è¯·æ±è®¾å¤ï¼
|
| | | this.$mqttTool.subscribe({
|
| | | topic: this.$constant.SERVICE_BROADCAST_TENANT_REAL_FAULT.replace('%s', this.deviceId),
|
| | | qos: 0
|
| | | }).then(res => {
|
| | | console.error(res)
|
| | |
| | | },
|
| | | dayChange(dayInfo) { // ç¹å»æ¥æ
|
| | | this.model.date = dayInfo.date
|
| | | console.log("ç¹å»æ¥æ", JSON.parse(JSON.stringify(dayInfo)));
|
| | | this.getOrderList(dayInfo.date, dayInfo.date);
|
| | | },
|
| | | monthChange(monthInfo) { // 忢æä»½
|
| | | console.log("忢æä»½", JSON.parse(JSON.stringify(monthInfo)));
|
| | | let m = monthInfo.month
|
| | | if (m < 10) {
|
| | | m = '0' + m
|
| | | }
|
| | | let month = monthInfo.year + '-' + m
|
| | | console.info(month)
|
| | | this.getMonth(month)
|
| | | },
|
| | | showValue(value) {
|
| | |
| | | return "--"
|
| | | }
|
| | | return value
|
| | | },
|
| | | show(e) {
|
| | | console.info(this.CustomBar)
|
| | |
|
| | | },
|
| | | goCharts(e) {
|
| | | uni.navigateTo({
|
| | |
| | | "orderTime_begin": date1 + " 00:00:00",
|
| | | "orderTime_end": date2 + " 23:59:59",
|
| | | }
|
| | | this.loading = true;
|
| | | this.$api.getOrderList(params).then((res) => {
|
| | | setTimeout(()=>{ |
| | | this.loading = false |
| | | },200)
|
| | | if (res.success) {
|
| | | this.herbList = res.result.records
|
| | |
|
| | |
| | | this.model.batch = this.herbList.length
|
| | | this.model.weight = weight
|
| | | this.model.dryTime = dryTime
|
| | |
|
| | | console.info(this.model)
|
| | | }
|
| | | })
|
| | | },
|
| | |
| | | const userinfo = uni.getStorageSync('userinfo');
|
| | | const tenantid = userinfo.loginTenantId
|
| | | return tenantid;
|
| | | }
|
| | | },
|
| | | deviceId() {
|
| | |
|
| | | return uni.getStorageSync(this.$constant.DEVICE_ID);
|
| | | },
|
| | |
|
| | |
|
| | | }
|
| | |
|
| | |
| | | </script>
|
| | |
|
| | | <style lang="scss" scoped>
|
| | | .app {}
|
| | | .app {
|
| | | width: 100%;
|
| | | max-height: 100vh;
|
| | | overflow: hidden;
|
| | | }
|
| | |
|
| | | .custom-bar {
|
| | | background-image: linear-gradient(to right, #0381FF, #0381FF);
|
| | |
| | | }
|
| | | },
|
| | | mounted() {
|
| | |
|
| | | },
|
| | | onTabItemTap: function(e) {
|
| | | getApp().globalData.selectTab = e.index
|
| | | },
|
| | | methods: { |
| | | itemClick(mode){ |
| | |
| | | uni.reLaunch({ |
| | | url: '/pages/login/login' |
| | | });
|
| | | this.$mqttTool.end().then(res => {
|
| | | console.error(res)
|
| | | })
|
| | | },
|
| | | cancel() {
|
| | | this.show = false
|
| | |
| | | <template>
|
| | | <view class="app">
|
| | | <z-paging ref="paging" v-model="dataList" show-refresher-update-time @query="queryList">
|
| | | <!-- éè¦åºå®å¨é¡¶é¨ä¸æ»å¨çviewæ¾å¨slot="top"çviewä¸ï¼å¦æéè¦è·çæ»å¨ï¼åä¸è¦è®¾ç½®slot="top" -->
|
| | | <template #top>
|
| | | <cu-custom bgColor="bg-gradual-blue" :isBack="false" :isRight="true" @rightclick="rclick">
|
| | | <block slot="content">æ¥è¦</block>
|
| | |
|
| | | </cu-custom>
|
| | | <u-notice-bar text="12:20:10 1车é´GM001æºå°çµæºè¿æµ(çµæ°)æ¥è¦" mode="closable"></u-notice-bar>
|
| | |
|
| | | <!--å¼¹åºå±start-->
|
| | | <view style="width: 100%; position: absolute;z-index: 1000;top:300rpx;padding: 20rpx;" @touchmove.prevent >
|
| | | <dropdown-menu v-show="filterMenuShow"@reset='resetMenu' @change='changeMenu' :list='equList' ref='dropdownMenuRef'/>
|
| | | <view style="width: 100%; position: absolute;z-index: 1000;top:300rpx;padding: 20rpx;"
|
| | | @touchmove.prevent>
|
| | | <dropdown-menu v-show="filterMenuShow" @closeMenu="filterMenuShow = false " @reset='resetMenu' @change='changeMenu' :list='equList'
|
| | | ref='dropdownMenuRef' />
|
| | |
|
| | | </view>
|
| | | <view class="lock-page dropdown-mask" @touchmove.prevent @click.stop="1==1" v-if="filterMenuShow"></view>
|
| | | <view class="lock-page dropdown-mask" @touchmove.prevent v-if="filterMenuShow"></view>
|
| | |
|
| | | <!--å¼¹åºå±end-->
|
| | |
|
| | |
| | | <view class="title">æ»è§</view>
|
| | | </view>
|
| | | <view>
|
| | | <text class="text-gray text-sm">2024-10-01 è³ 2024-12-01</text>
|
| | | <text class="text-gray text-sm">{{curDate}}</text>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
| | | <view class="flex">
|
| | | <view class="flex-sub flex flex-direction">
|
| | | <text class="text-df">æ¥è¦æ»æ°</text>
|
| | | <text class="text-bold text-sl margin-top-xs text-red margin-top-sm">10
|
| | | <text class="text-bold text-sl margin-top-xs text-red margin-top-sm">{{count}}
|
| | | <text class="text-gray text-sm margin-left-xs">次</text></text>
|
| | |
|
| | | </view>
|
| | |
| | | <view class="flex-sub flex">
|
| | | <view class="flex flex-direction flex-sub">
|
| | | <text class="text-gray text-xs">æ¥è¦ä¿¡æ¯</text>
|
| | | <text class="text-black">
|
| | | <text class="text-black">æºæ¢°æ
é:</text>
|
| | | <text class="margin-lr-xs text-orange">0</text>
|
| | | <text class="text-gray text-xs">次</text>
|
| | | </text>
|
| | |
|
| | | <text class="text-black">æ
鿬¡æ°:</text>
|
| | | <text class="margin-lr-xs text-red text-bold text-xl">{{faultCount}}</text>
|
| | | <text class="text-gray text-xs"></text>
|
| | |
|
| | |
|
| | | </view>
|
| | | <view class="flex flex-direction flex-sub">
|
| | | <text class="text-white text-xs">çµæ°æ
é</text>
|
| | | <text class="text-black">
|
| | | <text class="text-black">çµæ°æ
é:</text>
|
| | | <text class="margin-lr-xs text-orange">1</text>
|
| | | <text class="text-gray text-xs">次</text>
|
| | | </text>
|
| | | <text class="text-gray text-xs">æºå°ä¿¡æ¯</text>
|
| | |
|
| | | <text class="text-black">æ
éæºå°:</text>
|
| | | <text class="margin-lr-xs text-red">{{faultEqus}}</text>
|
| | | <text class="text-gray text-xs"></text>
|
| | |
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | | <view class="flex-sub flex margin-top-sm">
|
| | | <view class="flex-sub flex">
|
| | | <view class="flex flex-direction flex-sub">
|
| | | <text class="text-gray text-xs">æ¥è¦ä¿¡æ¯</text>
|
| | | <text>
|
| | | <text class="text-black">éä¿¡æ
é:</text>
|
| | | <text class="margin-lr-xs text-orange">4</text>
|
| | | <text class="text-gray text-xs">次</text>
|
| | | </text>
|
| | | <text class="text-white text-xs">æ¥è¦ä¿¡æ¯</text>
|
| | |
|
| | | <text class="text-black">åè¦æ¬¡æ°:</text>
|
| | | <text class="margin-lr-xs text-orange text-bold text-xl">{{alarmCount}}</text>
|
| | | <text class="text-gray text-xs"></text>
|
| | |
|
| | |
|
| | | </view>
|
| | | <view class="flex flex-direction flex-sub">
|
| | | <text class="text-white text-xs">å
¶ä»æ
é</text>
|
| | | <text class="text-cyan">
|
| | | <text class="text-black">å
¶ä»æ
é:</text>
|
| | | <text class="margin-lr-xs text-orange">5</text>
|
| | | <text class="text-gray text-xs">次</text>
|
| | | </text>
|
| | | <text class="text-white text-xs">æºå°ä¿¡æ¯</text>
|
| | | <text class="text-black">åè¦æºå°:</text>
|
| | | <text class="margin-lr-xs text-orange">{{alarmEqus}}</text>
|
| | | <text class="text-gray text-xs"></text>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
| | | </view>
|
| | |
|
| | | </view>
|
| | | <view class="margin-top">
|
| | | <view>
|
| | | <u-scroll-list>
|
| | |
|
| | | </u-scroll-list>
|
| | |
| | |
|
| | | </view>
|
| | |
|
| | | <u-sticky>
|
| | | </template>
|
| | |
|
| | | <view class="tab-box card-box top dynamic shadow">
|
| | | <z-tabs ref="tabs" :active-style="{'font-size':'30rpx','font-weight':'bold'}" :current="tabCurrent"
|
| | | :list="tabList" @change="tabsChange">
|
| | |
|
| | | <u-tabs :list="tabList" @click="tabsChange"></u-tabs>
|
| | | <!-- <z-tabs ref="tabs" :active-style="{'font-size':'30rpx','font-weight':'bold'}" :current="tabCurrent"
|
| | | :list="tabList" @change="tabsChange"> -->
|
| | | <!-- èªå®ä¹å³ä¾§ææ§½ -->
|
| | | <!-- <template v-slot:right>
|
| | | <u-icon name="setting" ></u-icon>
|
| | | </template> -->
|
| | | </z-tabs>
|
| | | </view>
|
| | | </u-sticky>
|
| | | <!-- å¯éè¿è®¾ç½®bar-animate-mode="worm"å¼å¯æ¯æ¯è«æ¨¡å¼-->
|
| | | <swiper :style="'height:' + swiperItemHeight[tabCurrent] + 'rpx;'" :current="tabCurrent"
|
| | | @transition="swiperTransition" @animationfinish="swiperAnimationfinish">
|
| | | <swiper-item :key="0">
|
| | | <view :style="'height:' + swiperItemHeight[0] + 'rpx;'">
|
| | |
|
| | | <view class="card-box center dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">è®¾å¤ </view>
|
| | | </view>
|
| | | <view>
|
| | | <!-- <text class="text-blue text-sm">æ´å¤></text> -->
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | | <view class="borderTop">
|
| | | <image style="width: 100%;border-radius: 20rpx; " src="../../static/image/pic_gz.jpg"
|
| | | mode="aspectFit"></image>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | <view class="card-box center dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">宿¶æ¥è¦ </view>
|
| | | </view>
|
| | | <view>
|
| | | <!-- <text class="text-blue text-sm">æ´å¤></text> -->
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | | <view class="borderTop" v-for="i in 10">
|
| | | <view style="height: 180rpx;display: flex;align-items: center;">
|
| | | <view>
|
| | | <image style="width: 80rpx;height: 80rpx;margin:20rpx;border-radius: 20rpx; "
|
| | | src="../../static/image/pic_gz.jpg"></image>
|
| | | </view>
|
| | | <view
|
| | | style="display: flex;flex: 1;flex-direction: column; justify-content: space-between; ;height: 100%;padding: 20rpx;">
|
| | | <view class="text-bold">
|
| | | æ»ççµæºè¿æµæ¥è¦
|
| | | </view>
|
| | | <view class="text-gray text-sm">
|
| | | 设å¤:1å·å¹²ç¥æº
|
| | | </view>
|
| | |
|
| | | <view class="text-gray text-sm">
|
| | | æè¿°:åæµå 1å·æ»ççµæºè¿æµæ¥è¦ï¼éè¦xxxxå¤çï¼ä¸æ¹èªç©ºçæ¢å¤å¾å¿«çåå¤
|
| | | </view>
|
| | |
|
| | | </view>
|
| | | <view style="width: 100rpx;">{{i}}</view>
|
| | |
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | <view class="card-box bot dynamic shadow">
|
| | | <view style="height: 20rpx;"></view>
|
| | | </view>
|
| | | </view>
|
| | | </swiper-item>
|
| | | <swiper-item :key="1">
|
| | | <view :style="'height:' + swiperItemHeight[1] + 'rpx;'">
|
| | | <view class="card-box center dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">æè¿æ¥è¦</view>
|
| | | </view>
|
| | | <view>
|
| | | <text class="text-blue text-sm">æ´å¤></text>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | | <!-- 妿叿å
¶ä»viewè·ç页颿»å¨ï¼å¯ä»¥æ¾å¨z-pagingæ ç¾å
-->
|
| | | <real-warning ref="realWarining" v-if="tabCurrent === 0" @handleData="realHandleData"></real-warning>
|
| | | <his-warning ref="hisWarining" v-else @handleData="hisHandleData"></his-warning>
|
| | |
|
| | |
|
| | | <view class="borderTop">
|
| | | <view class="h-table">
|
| | | <view class="h-tr h-tr-2 ">
|
| | | <view class="h-td">车é´</view>
|
| | | <view class="h-td">æºå°</view>
|
| | | <view class="h-td">æ¶é´</view>
|
| | | <view class="h-td">ç±»å</view>
|
| | | <view class="h-td">ç级</view>
|
| | |
|
| | |
|
| | | </view>
|
| | | <view class="h-tr h-tr-2">
|
| | | <view class="h-td">001</view>
|
| | | <view class="h-td">GM001</view>
|
| | | <view class="h-td">12:00:00</view>
|
| | | <view class="h-td">æºæ¢°</view>
|
| | | <view class="h-td">é«</view>
|
| | |
|
| | | </view>
|
| | | <view class="h-tr h-tr-2">
|
| | | <view class="h-td">001</view>
|
| | | <view class="h-td">GM001</view>
|
| | | <view class="h-td">12:00:00</view>
|
| | | <view class="h-td">éä¿¡</view>
|
| | | <view class="h-td">ä¸</view>
|
| | |
|
| | | </view>
|
| | | <view class="h-tr h-tr-2">
|
| | | <view class="h-td">001</view>
|
| | | <view class="h-td">GM001</view>
|
| | | <view class="h-td">12:00:00</view>
|
| | | <view class="h-td">çµæ°</view>
|
| | | <view class="h-td">é«</view>
|
| | |
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | </view>
|
| | |
|
| | | <view class="card-box center dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">æ¥è¦ç»è®¡</view>
|
| | | </view>
|
| | | <view>
|
| | | <text class="text-gray text-sm"></text>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | <view class="chartsMain">
|
| | | <qiun-data-charts type="mount" :opts="opts" :animation="true" :chartData="Mount" />
|
| | | </view>
|
| | | </view>
|
| | |
|
| | |
|
| | | <view class="card-box center dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">æ¥è¦å¯¹æ¯</view>
|
| | | </view>
|
| | | <view>
|
| | | <text class="text-gray text-sm"></text>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | <view class="chartsMain">
|
| | |
|
| | | <qiun-data-charts type="pie" :opts="optsPie" :chartData="PieA" />
|
| | |
|
| | | </view>
|
| | | </view>
|
| | |
|
| | |
|
| | |
|
| | | <view class="card-box center dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">æ¥è¦é¢ç</view>
|
| | | </view>
|
| | | <view>
|
| | | <text class="text-gray text-sm"></text>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | <view class="chartsMain">
|
| | | <!-- <qiun-data-charts type="mount" :opts="{extra:{mount:{type:'mount',widthRatio:1.5}}}"
|
| | | :chartData="Mount" /> -->
|
| | | <qiun-data-charts type="word" :chartData="Word" />
|
| | | </view>
|
| | | </view>
|
| | |
|
| | | <view class="card-box bot dynamic shadow">
|
| | | <view class="title-box margin-bottom-sm">
|
| | | <view style="width: 100vw;" class="left justify-between">
|
| | | <view class="flex align-center">
|
| | | <uni-text class="cuIcon-titles text-blue"></uni-text>
|
| | | <view class="title">æ¥è¦åæ</view>
|
| | | </view>
|
| | | <view>
|
| | | <text class="text-gray text-sm"></text>
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | | </view>
|
| | |
|
| | |
|
| | | <view class="chartsMain">
|
| | |
|
| | | <qiun-data-charts type="radar" :opts="optsRadar" :chartData="dataRadar" />
|
| | | </view>
|
| | | </view>
|
| | |
|
| | |
|
| | | </view>
|
| | | </swiper-item>
|
| | | </swiper>
|
| | |
|
| | |
|
| | | </z-paging>
|
| | | </view>
|
| | | </template>
|
| | |
|
| | | <script>
|
| | | import dropdownMenu from '@/components/drop-down-menu/index.vue'
|
| | | import realWarning from './components/realWarning.vue'
|
| | | import hisWarning from './components/hisWarning.vue'
|
| | | import dayjs from 'dayjs'
|
| | | export default {
|
| | | components: {
|
| | | dropdownMenu
|
| | | dropdownMenu,
|
| | | realWarning,
|
| | | hisWarning
|
| | | },
|
| | | data() {
|
| | | return {
|
| | | loading: true,
|
| | | // v-modelç»å®çè¿ä¸ªåéä¸è¦å¨å页请æ±ç»æä¸èªå·±èµå¼ï¼ï¼ï¼
|
| | | dataList: [],
|
| | | curDate: dayjs().format('YYYY-MM-DD'),
|
| | | tabList: [{
|
| | | name: '宿¶æ¥è¦',
|
| | | // badge: {
|
| | | // count: 6
|
| | | // }
|
| | | }, {
|
| | | name: 'æ¥è¦ç»è®¡',
|
| | | }],
|
| | | equList: [{
|
| | | code: 1,
|
| | | name: '1#å¹²ç¥æº'
|
| | |
| | | name: '2#å¹²ç¥æº'
|
| | | }
|
| | | ],
|
| | | model: {},
|
| | |
|
| | | //çéæ¡
|
| | | filterMenuShow: false,
|
| | | //å½åéä¸tab
|
| | | tabCurrent: 0,
|
| | | swiperItemHeight: [2800, 2140],
|
| | | tabList: [{
|
| | | name: '宿¶æ¥è¦',
|
| | | badge: {
|
| | | count: 6
|
| | | }
|
| | | }, {
|
| | | name: 'æ¥è¦ç»è®¡',
|
| | | }],
|
| | | PieA: {
|
| | | "series": [{
|
| | | "data": [{
|
| | | "name": "æºæ¢°",
|
| | | "value": 50,
|
| | | "labelText": "æºæ¢°:50次"
|
| | | }, {
|
| | | "name": "çµæ°",
|
| | | "value": 30,
|
| | | "labelText": "çµæ°:30次"
|
| | | }, {
|
| | | "name": "éä¿¡",
|
| | | "value": 20,
|
| | | "labelText": "éä¿¡:20次"
|
| | | }, {
|
| | | "name": "å
¶ä»",
|
| | | "value": 18,
|
| | | "labelText": "å
¶ä»:18次"
|
| | | }]
|
| | | }]
|
| | | },
|
| | | dataRadar: {
|
| | |
|
| | | categories: ["æºæ¢°", "çµæ°", "éä¿¡", "å
¶ä»"],
|
| | | series: [{
|
| | | name: "æ¥è¦å æ¯",
|
| | | data: [99, 30, 18, 73]
|
| | | }]
|
| | |
|
| | | },
|
| | |
|
| | | Mount: {
|
| | | "series": [{
|
| | |
|
| | | "data": [{
|
| | | "name": "æºæ¢°",
|
| | | "value": 82
|
| | | }, {
|
| | | "name": "çµæ°",
|
| | | "value": 63
|
| | | }, {
|
| | | "name": "éä¿¡",
|
| | | "value": 86
|
| | | }, {
|
| | | "name": "å
¶ä»",
|
| | | "value": 65
|
| | | }]
|
| | | }]
|
| | | },
|
| | | Word: {
|
| | | "series": [{
|
| | | "name": "飿ºè¿æµ",
|
| | | "textSize": 25
|
| | | }, {
|
| | | "name": "å鍿ªå
³é",
|
| | | "textSize": 20
|
| | | }, {
|
| | | "name": "é£ç®±åå¼å¸¸",
|
| | | "textSize": 20
|
| | | }, {
|
| | | "name": "çµæºè¿æµ",
|
| | | "textSize": 20
|
| | | }, {
|
| | | "name": "å çä½ä¼ æå¨",
|
| | | "textSize": 20
|
| | | }, {
|
| | | "name": "å çæ¶é´å¼å¸¸",
|
| | | "textSize": 20
|
| | | }, {
|
| | | "name": "æ»çåå¼å¸¸",
|
| | | "textSize": 20
|
| | | }, {
|
| | | "name": "é£ç®±ä¸å¨å çä½",
|
| | | "textSize": 20
|
| | | }, {
|
| | | "name": "æ»çä¸å¨å çä½",
|
| | | "textSize": 10
|
| | | }]
|
| | | },
|
| | | opts: {
|
| | | color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
| | | "#ea7ccc"
|
| | | ],
|
| | | padding: [15, 15, 0, 5],
|
| | | enableScroll: false,
|
| | | legend: {
|
| | | show: true
|
| | | },
|
| | |
|
| | | xAxis: {
|
| | | disableGrid: true
|
| | | },
|
| | | yAxis: {
|
| | | gridColor: "rgba(230,230,230,0.6)",
|
| | |
|
| | | data: [
|
| | |
|
| | | {
|
| | | min: 0
|
| | | }
|
| | | ]
|
| | | },
|
| | | extra: {
|
| | | mount: {
|
| | | type: "bar",
|
| | | widthRatio: 0.3,
|
| | | borderWidth: 0,
|
| | | barBorderRadius: [
|
| | | 50,
|
| | | 50,
|
| | | 50,
|
| | | 50
|
| | | ],
|
| | | linearType: "custom"
|
| | | }
|
| | | //宿¶æ¥è¦æ°æ®æ´æ°æ¶é´ï¼ä¸è¬10sï¼
|
| | | refreshTime: '',
|
| | | //æ¥è¦æ»æ°
|
| | | count: 0,
|
| | | //åè¦æ»æ°
|
| | | alarmCount: 0,
|
| | | //æ
éæ»æ°
|
| | | faultCount: 0, |
| | | //æ
éæºå°
|
| | | faultEqus: "", |
| | | //åè¦æºå°
|
| | | alarmEqus: "",
|
| | | }
|
| | | },
|
| | | optsPie: {
|
| | | color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
| | | "#ea7ccc"
|
| | | ],
|
| | | padding: [5, 5, 5, 5],
|
| | | enableScroll: false,
|
| | | extra: {
|
| | | pie: {
|
| | | activeOpacity: 0.5,
|
| | | activeRadius: 10,
|
| | | offsetAngle: 0,
|
| | | labelWidth: 1,
|
| | | border: true,
|
| | | borderWidth: 3,
|
| | | borderColor: "#FFFFFF",
|
| | | linearType: "custom"
|
| | | onTabItemTap: function(e) {
|
| | | getApp().globalData.selectTab = e.index
|
| | | },
|
| | | onShow() {
|
| | | // //宿¶æ
é
|
| | | // if(this.tabCurrent === 0){
|
| | | // this.$nextTick(()=>{
|
| | | // this.$refs.realWarining.queryRealFaultData()
|
| | | // })
|
| | | // }
|
| | |
|
| | | //宿¶æ
é
|
| | | if (this.tabCurrent === 0) {
|
| | | this.queryRealFaultData()
|
| | | }
|
| | | }
|
| | | },
|
| | | optsRadar: {
|
| | | color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
|
| | | "#ea7ccc"
|
| | | ],
|
| | | padding: [5, 5, 5, 5],
|
| | | dataLabel: true,
|
| | | dataPointShape: false,
|
| | | enableScroll: false,
|
| | | legend: {
|
| | | show: false,
|
| | | position: "right",
|
| | | lineHeight: 25
|
| | | },
|
| | | extra: {
|
| | | radar: {
|
| | | gridType: "circle",
|
| | | gridColor: "#CCCCCC",
|
| | | gridCount: 3,
|
| | | opacity: 1,
|
| | | max: 100,
|
| | | labelShow: true,
|
| | | linearType: "custom",
|
| | | border: false
|
| | | }
|
| | | }
|
| | | },
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | }
|
| | | },
|
| | | computed: {
|
| | |
|
| | |
|
| | | },
|
| | | created() {
|
| | | |
| | | },
|
| | | beforeDestroy() {
|
| | | onReady() { |
| | |
|
| | | },
|
| | | methods: {
|
| | | mqttTopicMessage(){
|
| | | //å¤çæ¶æ¯é»è¾
|
| | | switch(topic){
|
| | | case _this.$constant.SERVICE_BROADCAST_TENANT_REAL_FAULT.replace('%s', that.tenantId):
|
| | | console.error(that.$constant.SERVICE_BROADCAST_TENANT_REAL_FAULT.replace('%s', that.tenantId))
|
| | | console.error("æ¶å°å¹¿æ")
|
| | |
|
| | | break
|
| | | queryList(pageNo, pageSize) {
|
| | | this.loading = true;
|
| | | // ç»ä»¶å è½½æ¶ä¼èªå¨è§¦åæ¤æ¹æ³ï¼å æ¤é»è®¤é¡µé¢å è½½æ¶ä¼èªå¨è§¦åï¼æ éæå¨è°ç¨
|
| | | // è¿éçpageNoåpageSizeä¼èªå¨è®¡ç®å¥½ï¼ç´æ¥ä¼ ç»æå¡å¨å³å¯
|
| | | // 模æè¯·æ±æå¡å¨è·ååé¡µæ°æ®ï¼è¯·æ¿æ¢æèªå·±çç½ç»è¯·æ±
|
| | | const params = {
|
| | | pageNo: pageNo,
|
| | | pageSize: pageSize,
|
| | | }
|
| | | //
|
| | |
|
| | |
|
| | | this.$api.querySampleList(params).then((res) => {
|
| | | // // å°è¯·æ±çç»ææ°ç»ä¼ éç»z-paging
|
| | | //宿¶æ
é
|
| | | if (this.tabCurrent === 0) {
|
| | | this.queryRealFaultData()
|
| | | }else if(this.tabCurrent === 1){ |
| | | this.$refs.hisWarining.init(); |
| | | }
|
| | |
|
| | | this.$refs.paging.complete(res.result.records);
|
| | | this.loading = false
|
| | | }).catch(res => {
|
| | | // å¦æè¯·æ±å¤±è´¥åthis.$refs.paging.complete(false);
|
| | | // 注æï¼æ¯æ¬¡é½éè¦å¨catchä¸åè¿å¥è¯å¾éº»ç¦ï¼z-pagingæä¾äºæ¹æ¡å¯ä»¥å
¨å±ç»ä¸å¤ç
|
| | | // å¨åºå±çç½ç»è¯·æ±æåºå¼å¸¸æ¶ï¼åuni.$emit('z-paging-error-emit');å³å¯
|
| | | this.$refs.paging.complete(false);
|
| | | this.loading = false
|
| | | })
|
| | |
|
| | |
|
| | | },
|
| | | //tabséç¥swiper忢
|
| | | tabsChange(item) {
|
| | | this.tabCurrent = item.index;
|
| | | //éç½®æ
éç»è®¡æ°æ®
|
| | | this.count = 0;
|
| | | this.alarmCount = 0;
|
| | | this.faultCount = 0;
|
| | | this.faultEqus = "";
|
| | | this.alarmEqus = "";
|
| | | //宿¶æ
é
|
| | | if (this.tabCurrent === 0) {
|
| | | // this.$nextTick(()=>{
|
| | | // this.$refs.realWarining.queryRealFaultData()
|
| | |
|
| | | // })
|
| | | this.queryRealFaultData() |
| | | |
| | | this.curDate = dayjs().format('YYYY-MM-DD');
|
| | | }else if(this.tabCurrent === 1){ |
| | | this.curDate = dayjs().subtract(3, 'day').format('YYYY-MM-DD') +" - "+ dayjs().format('YYYY-MM-DD'); |
| | | |
| | | }
|
| | |
|
| | |
|
| | | },
|
| | | realHandleData(data) {
|
| | | if (!data) return false
|
| | | this.count = data.length
|
| | | this.faultCount = data.filter(item => item.faultType === 1).length;
|
| | | this.alarmCount = data.filter(item => item.faultType === 2).length;
|
| | |
|
| | | const faultEquList = [...new Set(
|
| | | data
|
| | | .filter(item => item.faultType === 1) // æ ¹æ®æ
éç±»åè¿æ»¤
|
| | | .map(item => {
|
| | | const match = item.equName.match(/(\d+#)/);
|
| | | return match ? match[0] : null; // 妿å¹é
æåï¼åè¿åå¹é
çç¼å·ï¼å¦åè¿ånull
|
| | | })
|
| | | .filter(Boolean) // 忬¡è¿æ»¤æå¯è½åå¨çnullå¼
|
| | | )];
|
| | | if (faultEquList) {
|
| | | this.faultEqus = faultEquList.join(',');
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | | const alarmEquList = [...new Set(
|
| | | data
|
| | | .filter(item => item.faultType === 2) // æ ¹æ®æ
éç±»åè¿æ»¤
|
| | | .map(item => {
|
| | | const match = item.equName.match(/(\d+#)/);
|
| | | return match ? match[0] : null; // 妿å¹é
æåï¼åè¿åå¹é
çç¼å·ï¼å¦åè¿ånull
|
| | | })
|
| | | .filter(Boolean) // 忬¡è¿æ»¤æå¯è½åå¨çnullå¼
|
| | | )];
|
| | |
|
| | | if (alarmEquList) {
|
| | | this.alarmEqus = alarmEquList.join(',')
|
| | | }
|
| | |
|
| | |
|
| | | }, |
| | | hisHandleData(data){ |
| | | if (!data) return false |
| | | this.count = data.reduce((sum, item) => sum + item.ecount, 0); |
| | | this.faultCount = data.filter(item => item.faultType === 1).reduce((sum, item) => sum + item.ecount, 0); |
| | | this.alarmCount = data.filter(item => item.faultType === 2).reduce((sum, item) => sum + item.ecount, 0); |
| | | |
| | | },
|
| | | changeMenu(selectData){
|
| | | console.info(selectData)
|
| | |
| | | },
|
| | | rclick() {
|
| | | this.filterMenuShow=!this.filterMenuShow
|
| | | },
|
| | | //tabséç¥swiper忢
|
| | | tabsChange(index) {
|
| | | this.tabCurrent = index;
|
| | | },
|
| | | //swiperæ»å¨ä¸
|
| | | swiperTransition(e) {
|
| | | this.$refs.tabs.setDx(e.detail.dx);
|
| | | },
|
| | | //swiperæ»å¨ç»æ
|
| | | swiperAnimationfinish(e) {
|
| | | this.tabCurrent = e.detail.current;
|
| | | this.$refs.tabs.unlockDx();
|
| | | if (this.filterMenuShow) {
|
| | | uni.pageScrollTo({
|
| | | scrollTop: 0,
|
| | | duration: 300 // æ»å¨å¨ç»æç»æ¶é´ï¼åä½ä¸ºæ¯«ç§
|
| | | });
|
| | | }
|
| | | },
|
| | |
|
| | | queryRealFaultData() {
|
| | | //åéæ°æ®
|
| | | const message = {
|
| | | req: this.deviceId,
|
| | | tenantId: this.tenantId,
|
| | | timeStamp: new Date(),
|
| | |
|
| | | }
|
| | | let opts = {
|
| | | topic: this.$constant.MOBILE_REQ_EQU_REAL_FAULT,
|
| | | message: JSON.stringify(message),
|
| | | }
|
| | |
|
| | | this.$mqttTool.publish(opts).then(res => {
|
| | | //console.error(res)
|
| | | })
|
| | | },
|
| | |
|
| | |
|
| | |
|
| | | },
|
| | | onReady() {
|
| | |
|
| | | },
|
| | | computed: {
|
| | | tenantId() {
|
| | | const userinfo = uni.getStorageSync('userinfo');
|
| | | const tenantid = userinfo.loginTenantId
|
| | | return tenantid + "";
|
| | | },
|
| | | deviceId() {
|
| | | return uni.getStorageSync(this.$constant.DEVICE_ID);
|
| | | },
|
| | |
|
| | |
|
| | | },
|
| | | }
|
| | | </script>
|
| | |
|
| | |
| | | @import "components/table/helang-table";
|
| | |
|
| | | .app {
|
| | | position: relative;
|
| | | width: 100%;
|
| | | max-height: 100vh;
|
| | | overflow: hidden;
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | | .card-box {
|
| | | margin: 20rpx;
|
| | |
| | | .dropdown-mask {
|
| | | background: rgba(0, 0, 0, 0.5);
|
| | | }
|
| | |
|
| | | .lock-page {
|
| | | height: 100vh;
|
| | | width: 100vw;
|
| | |
| | | bottom: 0;
|
| | | z-index: 998;
|
| | | }
|
| | |
|
| | | // å¼¹åºå±èæ¯é®ç½©end
|
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | 注æäºé¡¹ |
| | | ä¸ããäºæå¡ãåãå±åç½ãä¸å模å¼ä¸é¨åæ¥å£ææä¸å |
| | | 1. |
| | |
| | |
|
| | | const store = new Vuex.Store({ |
| | | state: {
|
| | | // å®ä¹cidé»è®¤å¼ |
| | | cid: null |
| | | // 设å¤å¯ä¸æ è¯ï¼æ¨éä½¿ç¨ |
| | | clientPushId: null, |
| | | |
| | | }, |
| | | mutations: { |
| | | setCid(state, cid) {
|
| | | state.cid = cid;
|
| | | setClientPushId(state, clientPushId) {
|
| | | state.clientPushId = clientPushId;
|
| | | }, |
| | | |
| | | }, |
| | | actions: { |
| | | setCid({ commit }, cid) {
|
| | | commit('setCid', cid);
|
| | | setClientPushId({ commit }, clientPushId) {
|
| | | commit('setClientPushId', clientPushId);
|
| | | }, |
| | | |
| | | }, |
| | | getters: { |
| | | getCid(state) { |
| | | return state.cid; |
| | | } |
| | | getClientPushId(state) { |
| | | return state.clientPushId; |
| | | }, |
| | | |
| | | } |
| | | }); |
| | | |