This commit is contained in:
Iruka 2025-01-16 17:25:51 +08:00
parent 1ef6d11a32
commit c83fa6c108
6 changed files with 36 additions and 67 deletions

14
App.vue
View File

@ -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;
}
},

View File

@ -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]);

View File

@ -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;

View File

@ -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;

View File

@ -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()

View File

@ -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() {