.
This commit is contained in:
parent
1ef6d11a32
commit
c83fa6c108
14
App.vue
14
App.vue
@ -8,6 +8,12 @@
|
||||
import mqttUtil from "@/utils/mqttUtil.js"
|
||||
const mqttUrl = import.meta.env.VITE_BASE_MQTT;
|
||||
|
||||
// 引入插件包
|
||||
import {
|
||||
requestPermissions,
|
||||
goSetting
|
||||
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
@ -115,13 +121,7 @@
|
||||
break;
|
||||
default:
|
||||
// 消息通知
|
||||
if (params.success == dcMsgType.ok) {
|
||||
this.$modal.msgSuccess(params.message);
|
||||
} else if (params.success == dcMsgType.err) {
|
||||
this.$modal.msgError(params.message);
|
||||
} else {
|
||||
this.$modal.msgWarning(params.message);
|
||||
}
|
||||
this.$toast(params.message)
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
@ -18,7 +18,7 @@
|
||||
@click="handleExpandedChange(item)">
|
||||
<text :class="{'land-active':selectData?.id == item.id}">{{ item.label }}</text>
|
||||
</view>
|
||||
<uni-badge type="success" :text="item.node?.deviceCount" v-if="datamap[item.key].isLand"/>
|
||||
<uni-badge type="success" :text="item.node?.deviceCount" v-if="datamap[item.key].isLand" />
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
@ -108,7 +108,6 @@
|
||||
const data = deepClone(this.dataRef);
|
||||
this.datalist = [];
|
||||
this.handleTreeData(data);
|
||||
|
||||
// 展开第一个
|
||||
if (this.expandFirst && this.datalist.length) {
|
||||
this.handleExpandedChange(this.datalist[0]);
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<!-- 顶部导航栏 -->
|
||||
<custom-nav-bar :left="false" leftText="" @leftClick="" :title="title">
|
||||
<custom-nav-bar :left="false" leftText="" @leftClick="" :title="title || '田间'">
|
||||
<template v-slot:left>
|
||||
<view @click="$refs.landRef.open()">地块</view>
|
||||
</template>
|
||||
@ -449,8 +449,7 @@
|
||||
</u-popup>
|
||||
|
||||
<!-- 地块选择 -->
|
||||
<custom-select-land ref="landRef" :data="ijs.companys" :defaultSelect="ijs.land" @getLand="getLand"
|
||||
@select="landChange" />
|
||||
<custom-select-land ref="landRef" :data="ijs.companys" :defaultSelect="ijs.land" @getLand="getLand" @select="" />
|
||||
<!-- 角度 -->
|
||||
<custom-angle-slider ref="refAngleSlider" mode="bottom" @close="openPopup" @confirm="swiperConfirm" />
|
||||
<!-- ADC -->
|
||||
@ -472,20 +471,12 @@
|
||||
import {
|
||||
getOtherDevice
|
||||
} from "@/api/system/controlOtherInterface"
|
||||
// 引入插件包
|
||||
import {
|
||||
requestPermissions
|
||||
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
|
||||
// 前往设置页面 兼容安卓以及IOS
|
||||
import {
|
||||
goSetting
|
||||
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: store.state.user.user,
|
||||
title: "",
|
||||
title: null,
|
||||
ijs: getApp().ijs, // 首页公共js
|
||||
dc: getApp().dc, // 设备控制公共代码
|
||||
valveImg: imageAssets, //阀门图片
|
||||
@ -518,12 +509,12 @@
|
||||
}
|
||||
});
|
||||
getApp().on("land", "land_map", function(e) {
|
||||
this.mapOnload();
|
||||
that.title = that.ijs?.land?.landName || null;
|
||||
that.mapOnload();
|
||||
});
|
||||
},
|
||||
onShow() {
|
||||
this.title = this.ijs?.land?.landName || "田间";
|
||||
|
||||
// 监听控制角度弹窗通知
|
||||
uni.$off("open-angle-slider");
|
||||
uni.$on("open-angle-slider", (e) => {
|
||||
@ -545,10 +536,6 @@
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 地块选择回调
|
||||
landChange(e) {
|
||||
this.title = e.landName;
|
||||
},
|
||||
// 获取地块信息
|
||||
getLand(e) {
|
||||
this.ijs.getLand(e.node).then(res => {
|
||||
@ -1547,20 +1534,21 @@
|
||||
::v-deep.uni-navbar__header-container {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
|
||||
&>view {
|
||||
font-size: 36rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
::v-deep.uni-navbar__header-btns-left {
|
||||
font-size: 27rpx;
|
||||
}
|
||||
|
||||
|
||||
::v-deep.uni-navbar__header-btns-right .icon {
|
||||
font-size: 44rpx;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
// .icon {
|
||||
// width: 16px;
|
||||
// height: 16px;
|
||||
|
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<!-- 顶部导航栏 -->
|
||||
<custom-nav-bar :left="false" leftText="" @leftClick="" :title="title">
|
||||
<custom-nav-bar :left="false" leftText="" @leftClick="" :title="title || '田间'">
|
||||
<template v-slot:left>
|
||||
<view @click="$refs.landRef.open()">地块</view>
|
||||
</template>
|
||||
@ -96,7 +96,7 @@
|
||||
<view class="grey-box" style="border-radius: 0 0 15px 15px;">
|
||||
<!-- 基站 -->
|
||||
<view class="card">
|
||||
<uni-collapse ref="collapseRef" v-if="dc.wo.length">
|
||||
<uni-collapse ref="collapseStationRef" v-if="dc.wo.length">
|
||||
<uni-collapse-item title-border="none" :show-animation="true" :show-arrow="false">
|
||||
<template v-slot:title>
|
||||
<view class="jz-title fixed">
|
||||
@ -112,7 +112,8 @@
|
||||
<u-button type="success" size="small" text="一键刷新"
|
||||
:disabled="refreshAllDisabled" />
|
||||
</view>
|
||||
<view @click.stop="batchControl" style="margin-left: 5px;" v-hasPermi="['device:control']">
|
||||
<view @click.stop="batchControl" style="margin-left: 5px;"
|
||||
v-hasPermi="['device:control']">
|
||||
<u-button type="success" size="small" text="批量控制" />
|
||||
</view>
|
||||
</view>
|
||||
@ -538,8 +539,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 地块选择 -->
|
||||
<custom-select-land ref="landRef" :data="ijs.companys" :defaultSelect="ijs.land" @getLand="getLand"
|
||||
@select="landChange" />
|
||||
<custom-select-land ref="landRef" :data="ijs.companys" :defaultSelect="ijs.land" @getLand="getLand" @select="" />
|
||||
<!-- 角度 -->
|
||||
<custom-angle-slider ref="refAngleSlider" mode="bottom" @close="" @confirm="swiperConfirm" />
|
||||
<!-- ADC -->
|
||||
@ -552,20 +552,12 @@
|
||||
<script>
|
||||
import store from "@/store"
|
||||
import * as imageAssets from '@/utils/indexUtil/imageAssets.js'
|
||||
// 引入插件包
|
||||
import {
|
||||
requestPermissions
|
||||
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
|
||||
// 前往设置页面 兼容安卓以及IOS
|
||||
import {
|
||||
goSetting
|
||||
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
user: store.state.user.user,
|
||||
title: "",
|
||||
title: null,
|
||||
ijs: getApp().ijs, // 首页公共js
|
||||
dc: getApp().dc, // 设备控制公共代码
|
||||
valveImg: imageAssets, //阀门图片
|
||||
@ -597,10 +589,17 @@
|
||||
} else if (e.type == "msg") {}
|
||||
});
|
||||
getApp().on("land", "land_index", function(e) {
|
||||
that.title = that.ijs?.land?.landName || "田间";
|
||||
that.title = that.ijs?.land?.landName || null;
|
||||
that.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
that.$refs.collapseStationRef.resize();
|
||||
that.$refs.collapseRef.resize();
|
||||
}, 500)
|
||||
})
|
||||
});
|
||||
},
|
||||
onShow() {
|
||||
this.title = this.ijs?.land?.landName || "田间";
|
||||
// 监听控制角度弹窗通知
|
||||
uni.$off("open-angle-slider");
|
||||
uni.$on("open-angle-slider", (e) => {
|
||||
@ -629,10 +628,6 @@
|
||||
mqttSubscribes() {
|
||||
getApp().mqttSubscribes();
|
||||
},
|
||||
// 地块选择回调
|
||||
landChange(e) {
|
||||
this.title = e.landName;
|
||||
},
|
||||
// 获取地块信息
|
||||
getLand(e) {
|
||||
this.ijs.getLand(e.node).then(res => {
|
||||
@ -753,15 +748,18 @@
|
||||
if (!this.woloaded) {
|
||||
let woloaded = {};
|
||||
this.dc.wo.forEach((_item, _index) => {
|
||||
let time = 10;
|
||||
if (_item.children && _item.children.length) {
|
||||
time = _item.children.length * 10
|
||||
}
|
||||
woloaded[_index] = {
|
||||
loaded: false,
|
||||
open: false,
|
||||
time: _item.children.length * 10
|
||||
time: time
|
||||
}
|
||||
});
|
||||
this.woloaded = woloaded;
|
||||
}
|
||||
|
||||
// 关闭面板
|
||||
if (this.woloaded[index].open) {
|
||||
this.woloaded[index].open = false;
|
||||
|
@ -56,14 +56,6 @@
|
||||
uploadAvatar,
|
||||
uploadAvatarForUser
|
||||
} from "@/api/system/user"
|
||||
// 引入插件包
|
||||
import {
|
||||
requestPermissions
|
||||
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
|
||||
// 前往设置页面 兼容安卓以及IOS
|
||||
import {
|
||||
goSetting
|
||||
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
|
||||
|
||||
const baseUrl = config.baseUrl
|
||||
let sysInfo = uni.getSystemInfoSync()
|
||||
|
@ -114,14 +114,6 @@
|
||||
checkPermi
|
||||
} from "@/utils/permission"
|
||||
import plugin from "@/plugins"
|
||||
// 引入插件包
|
||||
import {
|
||||
requestPermissions
|
||||
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
|
||||
// 前往设置页面 兼容安卓以及IOS
|
||||
import {
|
||||
goSetting
|
||||
} from "@/js_sdk/yu-app-permission/yu-app-permission.js"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
Loading…
Reference in New Issue
Block a user