3.27
This commit is contained in:
parent
d9766f43e8
commit
5b328629f8
361
manifest.json
361
manifest.json
@ -1,182 +1,183 @@
|
||||
{
|
||||
"name" : "芯程物联",
|
||||
"appid" : "__UNI__BEE3050",
|
||||
"description" : "开源物联网平台",
|
||||
"versionName" : "2.2.0",
|
||||
"versionCode" : 200,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"kernel" : {
|
||||
"ios" : "WKWebview"
|
||||
},
|
||||
"usingComponents" : true,
|
||||
"nvueCompiler" : "uni-app",
|
||||
"compilerVersion" : 3,
|
||||
"splashscreen" : {
|
||||
"alwaysShowBeforeRender" : true,
|
||||
"waiting" : true,
|
||||
"autoclose" : true,
|
||||
"delay" : 0
|
||||
},
|
||||
"modules" : {
|
||||
"Barcode" : {},
|
||||
"OAuth" : {},
|
||||
"Camera" : {}
|
||||
},
|
||||
"distribute" : {
|
||||
"android" : {
|
||||
"permissions" : [
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.INTERNET\"/>"
|
||||
],
|
||||
"minSdkVersion" : 22,
|
||||
"targetSdkVersion" : 30,
|
||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ],
|
||||
"permissionExternalStorage" : {
|
||||
"request" : "none",
|
||||
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储权限,请允许。"
|
||||
},
|
||||
"permissionPhoneState" : {
|
||||
"request" : "none",
|
||||
"prompt" : "为保证您正常、安全地使用,需要获取设备识别码使用权限,请允许。"
|
||||
}
|
||||
},
|
||||
"ios" : {
|
||||
"idfa" : true,
|
||||
"privacyDescription" : {
|
||||
"NSLocationAlwaysUsageDescription" : "便于您使用该功能获取当前位置天气情况、WIFI列表等场景。",
|
||||
"NSLocationAlwaysAndWhenInUseUsageDescription" : "便于您使用该功能获取当前位置天气情况、WIFI列表等场景。",
|
||||
"NSLocalNetworkUsageDescription" : "允许访问蜂窝网络,用于扫码/关联式添加设备",
|
||||
"NSLocationWhenInUseUsageDescription" : "便于您使用该功能获取当前位置天气情况、WIFI列表等场景。"
|
||||
},
|
||||
"dSYMs" : false
|
||||
},
|
||||
"sdkConfigs" : {
|
||||
"push" : {},
|
||||
"statics" : {},
|
||||
"maps" : {},
|
||||
"ad" : {},
|
||||
"oauth" : {
|
||||
"weixin" : {
|
||||
"appid" : "wx6be3f0d7bf7154e1",
|
||||
"appsecret" : "b6c1d0da60bd5250857d211cdc64fdc9",
|
||||
"UniversalLinks" : ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"splashscreen" : {
|
||||
"iosStyle" : "common",
|
||||
"androidStyle" : "common",
|
||||
"alwaysShowBeforeRender" : false,
|
||||
"waiting" : true,
|
||||
"autoclose" : false,
|
||||
"delay" : 0,
|
||||
"android" : {
|
||||
"hdpi" : "./static/logo.9.png",
|
||||
"xhdpi" : "./static/logo.9.png",
|
||||
"xxhdpi" : "./static/logo.9.png"
|
||||
}
|
||||
},
|
||||
"icons" : {
|
||||
"android" : {
|
||||
"hdpi" : "unpackage/res/icons/72x72.png",
|
||||
"xhdpi" : "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi" : "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi" : "unpackage/res/icons/192x192.png"
|
||||
},
|
||||
"ios" : {
|
||||
"appstore" : "unpackage/res/icons/1024x1024.png",
|
||||
"ipad" : {
|
||||
"app" : "unpackage/res/icons/76x76.png",
|
||||
"app@2x" : "unpackage/res/icons/152x152.png",
|
||||
"notification" : "unpackage/res/icons/20x20.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x" : "unpackage/res/icons/167x167.png",
|
||||
"settings" : "unpackage/res/icons/29x29.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"spotlight" : "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png"
|
||||
},
|
||||
"iphone" : {
|
||||
"app@2x" : "unpackage/res/icons/120x120.png",
|
||||
"app@3x" : "unpackage/res/icons/180x180.png",
|
||||
"notification@2x" : "unpackage/res/icons/40x40.png",
|
||||
"notification@3x" : "unpackage/res/icons/60x60.png",
|
||||
"settings@2x" : "unpackage/res/icons/58x58.png",
|
||||
"settings@3x" : "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x" : "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x" : "unpackage/res/icons/120x120.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"nativePlugins" : {}
|
||||
},
|
||||
"quickapp" : {},
|
||||
"mp-weixin" : {
|
||||
"appid" : "wx5bfbadf52adc17f3",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
"minified" : true
|
||||
},
|
||||
"usingComponents" : true,
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"optimization" : {
|
||||
"subPackages" : true
|
||||
},
|
||||
"permission" : {
|
||||
"scope.userLocation" : {
|
||||
"desc" : "便于您使用该功能获取当前位置天气情况、WIFI列表等场景。"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos" : [ "getLocation" ],
|
||||
"lazyCodeLoading" : "requiredComponents"
|
||||
},
|
||||
"mp-alipay" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-baidu" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"mp-toutiao" : {
|
||||
"usingComponents" : true
|
||||
},
|
||||
"uniStatistics" : {
|
||||
"enable" : false
|
||||
},
|
||||
"h5" : {
|
||||
"title" : "芯程物联",
|
||||
"router" : {
|
||||
"mode" : "hash",
|
||||
"base" : "./"
|
||||
},
|
||||
"devServer" : {
|
||||
"port" : 8090
|
||||
},
|
||||
"optimization" : {
|
||||
"treeShaking" : {
|
||||
"enable" : false
|
||||
}
|
||||
},
|
||||
"template" : "uni_modules/jessibuca/hybrid/index.html",
|
||||
"sdkConfigs" : {
|
||||
"maps" : {
|
||||
"qqmap" : {
|
||||
"key" : "4PDBZ-4KQKU-AX6VO-GU7NB-INDZJ-YBFXC"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
"name": "芯程物联",
|
||||
"appid": "__UNI__BEE3050",
|
||||
"description": "开源物联网平台",
|
||||
"versionName": "2.2.0",
|
||||
"versionCode": 200,
|
||||
"transformPx": false,
|
||||
"app-plus": {
|
||||
"kernel": {
|
||||
"ios": "WKWebview"
|
||||
},
|
||||
"usingComponents": true,
|
||||
"nvueCompiler": "uni-app",
|
||||
"compilerVersion": 3,
|
||||
"splashscreen": {
|
||||
"alwaysShowBeforeRender": true,
|
||||
"waiting": true,
|
||||
"autoclose": true,
|
||||
"delay": 0
|
||||
},
|
||||
"modules": {
|
||||
"Barcode": {},
|
||||
"OAuth": {},
|
||||
"Camera": {}
|
||||
},
|
||||
"distribute": {
|
||||
"android": {
|
||||
"permissions": [
|
||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||
"<uses-permission android:name=\"android.permission.INTERNET\"/>"
|
||||
],
|
||||
"minSdkVersion": 22,
|
||||
"targetSdkVersion": 30,
|
||||
"abiFilters": ["armeabi-v7a", "arm64-v8a"],
|
||||
"permissionExternalStorage": {
|
||||
"request": "none",
|
||||
"prompt": "应用保存运行状态等信息,需要获取读写手机存储权限,请允许。"
|
||||
},
|
||||
"permissionPhoneState": {
|
||||
"request": "none",
|
||||
"prompt": "为保证您正常、安全地使用,需要获取设备识别码使用权限,请允许。"
|
||||
}
|
||||
},
|
||||
"ios": {
|
||||
"idfa": true,
|
||||
"privacyDescription": {
|
||||
"NSLocationAlwaysUsageDescription": "便于您使用该功能获取当前位置天气情况、WIFI列表等场景。",
|
||||
"NSLocationAlwaysAndWhenInUseUsageDescription": "便于您使用该功能获取当前位置天气情况、WIFI列表等场景。",
|
||||
"NSLocalNetworkUsageDescription": "允许访问蜂窝网络,用于扫码/关联式添加设备",
|
||||
"NSLocationWhenInUseUsageDescription": "便于您使用该功能获取当前位置天气情况、WIFI列表等场景。"
|
||||
},
|
||||
"dSYMs": false
|
||||
},
|
||||
"sdkConfigs": {
|
||||
"push": {},
|
||||
"statics": {},
|
||||
"maps": {},
|
||||
"ad": {},
|
||||
"oauth": {
|
||||
"weixin": {
|
||||
"appid": "wx6be3f0d7bf7154e1",
|
||||
"appsecret": "b6c1d0da60bd5250857d211cdc64fdc9",
|
||||
"UniversalLinks": ""
|
||||
}
|
||||
}
|
||||
},
|
||||
"splashscreen": {
|
||||
"iosStyle": "common",
|
||||
"androidStyle": "common",
|
||||
"alwaysShowBeforeRender": false,
|
||||
"waiting": true,
|
||||
"autoclose": false,
|
||||
"delay": 0,
|
||||
"android": {
|
||||
"hdpi": "./static/logo.9.png",
|
||||
"xhdpi": "./static/logo.9.png",
|
||||
"xxhdpi": "./static/logo.9.png"
|
||||
}
|
||||
},
|
||||
"icons": {
|
||||
"android": {
|
||||
"hdpi": "unpackage/res/icons/72x72.png",
|
||||
"xhdpi": "unpackage/res/icons/96x96.png",
|
||||
"xxhdpi": "unpackage/res/icons/144x144.png",
|
||||
"xxxhdpi": "unpackage/res/icons/192x192.png"
|
||||
},
|
||||
"ios": {
|
||||
"appstore": "unpackage/res/icons/1024x1024.png",
|
||||
"ipad": {
|
||||
"app": "unpackage/res/icons/76x76.png",
|
||||
"app@2x": "unpackage/res/icons/152x152.png",
|
||||
"notification": "unpackage/res/icons/20x20.png",
|
||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||
"proapp@2x": "unpackage/res/icons/167x167.png",
|
||||
"settings": "unpackage/res/icons/29x29.png",
|
||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||
"spotlight": "unpackage/res/icons/40x40.png",
|
||||
"spotlight@2x": "unpackage/res/icons/80x80.png"
|
||||
},
|
||||
"iphone": {
|
||||
"app@2x": "unpackage/res/icons/120x120.png",
|
||||
"app@3x": "unpackage/res/icons/180x180.png",
|
||||
"notification@2x": "unpackage/res/icons/40x40.png",
|
||||
"notification@3x": "unpackage/res/icons/60x60.png",
|
||||
"settings@2x": "unpackage/res/icons/58x58.png",
|
||||
"settings@3x": "unpackage/res/icons/87x87.png",
|
||||
"spotlight@2x": "unpackage/res/icons/80x80.png",
|
||||
"spotlight@3x": "unpackage/res/icons/120x120.png"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"uniStatistics": {
|
||||
"enable": false
|
||||
},
|
||||
"nativePlugins": {}
|
||||
},
|
||||
"quickapp": {},
|
||||
"mp-weixin": {
|
||||
"appid": "wx5bfbadf52adc17f3",
|
||||
"setting": {
|
||||
"urlCheck": false,
|
||||
"minified": true
|
||||
},
|
||||
"usingComponents": true,
|
||||
"uniStatistics": {
|
||||
"enable": false
|
||||
},
|
||||
"optimization": {
|
||||
"subPackages": true
|
||||
},
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
"desc": "便于您使用该功能获取当前位置天气情况、WIFI列表等场景。"
|
||||
}
|
||||
},
|
||||
"requiredPrivateInfos": ["getLocation"],
|
||||
"lazyCodeLoading": "requiredComponents"
|
||||
},
|
||||
"mp-alipay": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-baidu": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"mp-toutiao": {
|
||||
"usingComponents": true
|
||||
},
|
||||
"uniStatistics": {
|
||||
"enable": false
|
||||
},
|
||||
"sassImplementationName": "node-sass",
|
||||
"h5": {
|
||||
"title": "芯程物联",
|
||||
"router": {
|
||||
"mode": "hash",
|
||||
"base": "./"
|
||||
},
|
||||
"devServer": {
|
||||
"port": 8090
|
||||
},
|
||||
"optimization": {
|
||||
"treeShaking": {
|
||||
"enable": false
|
||||
}
|
||||
},
|
||||
"template": "uni_modules/jessibuca/hybrid/index.html",
|
||||
"sdkConfigs": {
|
||||
"maps": {
|
||||
"qqmap": {
|
||||
"key": "4PDBZ-4KQKU-AX6VO-GU7NB-INDZJ-YBFXC"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -113,14 +113,14 @@
|
||||
} from '@/apis/modules/scene';
|
||||
|
||||
export default {
|
||||
beforeRouteEnter (to, from, next) {
|
||||
beforeRouteEnter(to, from, next) {
|
||||
// 在进入路由前执行一些操作,例如加载数据等
|
||||
next(vm => {
|
||||
// 这里可以访问组件实例 `vm`
|
||||
vm.onLoad() // 执行加载操作
|
||||
})
|
||||
},
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
deleteId: '',
|
||||
isDelete: false,
|
||||
@ -152,13 +152,13 @@
|
||||
loadmoreStatus: 'loadmore', // 刷新和加载相关
|
||||
};
|
||||
},
|
||||
onLoad () {
|
||||
onLoad() {
|
||||
this.getToken();
|
||||
if (this.token != '' && this.token != null) {
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
onShow () {
|
||||
onShow() {
|
||||
// #ifdef MP-WEIXIN
|
||||
// 检查用户是否登录
|
||||
if (!this.isLogin()) {
|
||||
@ -183,7 +183,7 @@
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
getToken () {
|
||||
getToken() {
|
||||
// 本地缓存获取token
|
||||
this.token = uni.getStorageSync('token');
|
||||
// vuex存储token
|
||||
@ -191,13 +191,13 @@
|
||||
console.log(this.token)
|
||||
},
|
||||
//删除
|
||||
handleDelete (item) {
|
||||
handleDelete(item) {
|
||||
this.isDelete = true;
|
||||
this.deleteId = item.sceneId;
|
||||
this.deleteContent = `确定删除“${item.sceneName}”?`
|
||||
},
|
||||
// 确认删除
|
||||
handleConfirmDelete () {
|
||||
handleConfirmDelete() {
|
||||
delScene(this.deleteId).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.list = [];
|
||||
@ -215,7 +215,7 @@
|
||||
});
|
||||
},
|
||||
//判断是否登录
|
||||
isLogin () {
|
||||
isLogin() {
|
||||
if (this.token == '' || this.token == null) {
|
||||
return false;
|
||||
} else {
|
||||
@ -223,21 +223,21 @@
|
||||
}
|
||||
},
|
||||
// 场景状态改变事件
|
||||
handleStatusChange (item) {
|
||||
handleStatusChange(item) {
|
||||
this.list = [];
|
||||
this.queryParams.enable = item.id;
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
// 场景列表
|
||||
goToSceneList () {
|
||||
goToSceneList() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesA/scene/list'
|
||||
});
|
||||
this.isMenu = false;
|
||||
},
|
||||
// 新增场景
|
||||
handleAddScene () {
|
||||
handleAddScene() {
|
||||
// 使用vuex会导致小程序性能问题所以存储本地
|
||||
let sceneData = {
|
||||
sceneId: null,
|
||||
@ -264,7 +264,7 @@
|
||||
});
|
||||
},
|
||||
// 场景详情
|
||||
handleSceneDetail (id) {
|
||||
handleSceneDetail(id) {
|
||||
const storage = uni.getStorageSync('sceneData');
|
||||
if (storage) {
|
||||
uni.removeStorageSync('sceneData');
|
||||
@ -290,7 +290,7 @@
|
||||
});
|
||||
},
|
||||
// 获取条件
|
||||
getCondName (cond) {
|
||||
getCondName(cond) {
|
||||
if (cond === 1) {
|
||||
return this.$tt('scene.anyCondition')
|
||||
} else if (cond === 2) {
|
||||
@ -301,7 +301,7 @@
|
||||
return this.$tt('scene.unknown')
|
||||
}
|
||||
},
|
||||
getExecuteModeName (mode) {
|
||||
getExecuteModeName(mode) {
|
||||
if (mode === 1) {
|
||||
return this.$tt('scene.serial')
|
||||
} else if (mode === 2) {
|
||||
@ -311,7 +311,7 @@
|
||||
}
|
||||
},
|
||||
// 获取场景列表
|
||||
getList () {
|
||||
getList() {
|
||||
listScene(this.queryParams)
|
||||
.then(res => {
|
||||
const {
|
||||
@ -327,16 +327,16 @@
|
||||
});
|
||||
},
|
||||
// 搜索
|
||||
handleSearch () {
|
||||
handleSearch() {
|
||||
this.list = [];
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleClearSearch () {
|
||||
handleClearSearch() {
|
||||
this.handleSearch();
|
||||
},
|
||||
// 下拉刷新
|
||||
onPullDownRefresh () {
|
||||
onPullDownRefresh() {
|
||||
console.log('下拉刷新');
|
||||
this.list = [];
|
||||
this.total = 0;
|
||||
@ -348,7 +348,7 @@
|
||||
}, 1000);
|
||||
},
|
||||
// 上拉加载
|
||||
onReachBottom () {
|
||||
onReachBottom() {
|
||||
console.log('上拉加载');
|
||||
this.loadmoreStatus = 'loading';
|
||||
this.queryParams.pageNum = ++this.queryParams.pageNum;
|
||||
@ -363,7 +363,7 @@
|
||||
}, 1000);
|
||||
},
|
||||
//执行一次
|
||||
handleRunOnce (data) {
|
||||
handleRunOnce(data) {
|
||||
const params = {
|
||||
sceneId: data.sceneId
|
||||
};
|
||||
@ -375,7 +375,7 @@
|
||||
});
|
||||
},
|
||||
// 切换状态
|
||||
handleSwitchStatus (data) {
|
||||
handleSwitchStatus(data) {
|
||||
const params = {
|
||||
sceneId: data.sceneId,
|
||||
enable: data.enable,
|
||||
@ -488,7 +488,7 @@
|
||||
}
|
||||
|
||||
// 小程序中popup坑
|
||||
/deep/ .u-safe-bottom {
|
||||
::v-deep .u-safe-bottom {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
@ -144,13 +144,22 @@
|
||||
|
||||
<script>
|
||||
import projectConfig from '@/env.config.js';
|
||||
import { mapState, mapMutations } from 'vuex';
|
||||
import { logout, secureBind, wechatBind } from '@/apis/modules/common';
|
||||
import { deviceRelateUser } from '@/apis/modules/device';
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
} from 'vuex';
|
||||
import {
|
||||
logout,
|
||||
secureBind,
|
||||
wechatBind
|
||||
} from '@/apis/modules/common';
|
||||
import {
|
||||
deviceRelateUser
|
||||
} from '@/apis/modules/device';
|
||||
|
||||
export default {
|
||||
components: {},
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
avatarUrl: '', // 头像
|
||||
// 扫码模态窗
|
||||
@ -171,7 +180,7 @@
|
||||
token: '',
|
||||
};
|
||||
},
|
||||
onShow () {
|
||||
onShow() {
|
||||
//小程序tabBar导航国际化特殊性
|
||||
// #ifdef MP-WEIXIN
|
||||
uni.setTabBarItem({
|
||||
@ -199,7 +208,7 @@
|
||||
computed: {
|
||||
...mapState(['isLoggedIn']) // 获取登录状态
|
||||
},
|
||||
onLoad () {
|
||||
onLoad() {
|
||||
this.getToken();
|
||||
if (this.token != '' && this.token != null) {
|
||||
this.getProfile();
|
||||
@ -207,7 +216,7 @@
|
||||
|
||||
},
|
||||
methods: {
|
||||
getToken () {
|
||||
getToken() {
|
||||
// 本地缓存获取token
|
||||
this.token = uni.getStorageSync('token');
|
||||
// vuex存储token
|
||||
@ -215,15 +224,15 @@
|
||||
},
|
||||
...mapMutations(['setLoggedIn']),
|
||||
// 退出系统
|
||||
handleExit () {
|
||||
handleExit() {
|
||||
this.show = true;
|
||||
},
|
||||
// 取消退出系统
|
||||
cancelExit () {
|
||||
cancelExit() {
|
||||
this.show = false;
|
||||
},
|
||||
// 确认退出系统
|
||||
confirmExit () {
|
||||
confirmExit() {
|
||||
logout().then(() => {
|
||||
this.clearToken();
|
||||
this.setLoggedIn(false);
|
||||
@ -234,16 +243,16 @@
|
||||
});
|
||||
},
|
||||
//移动端微信解绑
|
||||
handleAppSecureBind () {
|
||||
handleAppSecureBind() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesB/user/secureBind'
|
||||
});
|
||||
},
|
||||
gotoAccount () {
|
||||
gotoAccount() {
|
||||
uni.$u.route('/pagesB/user/account');
|
||||
},
|
||||
//跳转信息
|
||||
gotoMessageList () {
|
||||
gotoMessageList() {
|
||||
if (this.token != '' && this.token != null) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesB/list/user/message'
|
||||
@ -252,13 +261,13 @@
|
||||
this.showModel = true;
|
||||
}
|
||||
},
|
||||
gotoLanguage () {
|
||||
gotoLanguage() {
|
||||
//this.clearToken()
|
||||
uni.navigateTo({
|
||||
url: '/pagesB/language/index'
|
||||
})
|
||||
},
|
||||
gotoEmulator () {
|
||||
gotoEmulator() {
|
||||
if (this.token != '' && this.token != null) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesB/list/user/message'
|
||||
@ -267,7 +276,7 @@
|
||||
this.showModel = true;
|
||||
}
|
||||
},
|
||||
gotoScene () {
|
||||
gotoScene() {
|
||||
if (this.token != '' && this.token != null) {
|
||||
uni.switchTab({
|
||||
url: '/pages/tabBar/scene/index'
|
||||
@ -277,18 +286,18 @@
|
||||
}
|
||||
},
|
||||
//确定去登录
|
||||
confirmGotoLogin () {
|
||||
confirmGotoLogin() {
|
||||
// this.clearToken();
|
||||
uni.reLaunch({
|
||||
url: '/pagesB/login/waitLogin'
|
||||
});
|
||||
this.showModel = false;
|
||||
},
|
||||
handleGotoLogin () {
|
||||
handleGotoLogin() {
|
||||
this.showModel = true;
|
||||
},
|
||||
// 设备分组
|
||||
gotoGroup () {
|
||||
gotoGroup() {
|
||||
if (this.token != '' && this.token != null) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesB/user/deviceGroup/index'
|
||||
@ -298,10 +307,10 @@
|
||||
}
|
||||
},
|
||||
// 清除token
|
||||
clearToken () {
|
||||
clearToken() {
|
||||
uni.setStorageSync('token', '');
|
||||
},
|
||||
getProfile () {
|
||||
getProfile() {
|
||||
// 调用用户信息接口
|
||||
this.$api.common.getProfile().then(res => {
|
||||
//存储用户信息,TODO 需要调用一次,不然其他页面调用返回空
|
||||
@ -313,29 +322,29 @@
|
||||
});
|
||||
},
|
||||
// 注销账户
|
||||
handleUnsubscribe () {
|
||||
handleUnsubscribe() {
|
||||
this.isUnsubscribe = true;
|
||||
},
|
||||
//跳转密码修改
|
||||
gotoResetPsd () {
|
||||
gotoResetPsd() {
|
||||
/*uni.navigateTo({
|
||||
url:"/pagesB/user/resetPsd"
|
||||
})*/
|
||||
uni.$u.route('/pagesB/user/resetPsd');
|
||||
},
|
||||
openhpLink () {
|
||||
openhpLink() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/webview/index?url=http://www.hpiot.cn/'
|
||||
});
|
||||
},
|
||||
gotoAbout () {
|
||||
gotoAbout() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesB/user/about'
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
confirmUnsubscribe () {
|
||||
confirmUnsubscribe() {
|
||||
logout().then(() => {
|
||||
this.clearToken();
|
||||
// 跳转
|
||||
@ -345,7 +354,7 @@
|
||||
});
|
||||
},
|
||||
//跳转个人信息
|
||||
handleToAvatar () {
|
||||
handleToAvatar() {
|
||||
if (this.token != '' && this.token != null) {
|
||||
const source = {
|
||||
album: '从手机相册选择',
|
||||
@ -393,11 +402,11 @@
|
||||
}
|
||||
},
|
||||
// 开通会员
|
||||
handleVipUpgrade () {
|
||||
handleVipUpgrade() {
|
||||
this.isVipModel = true;
|
||||
},
|
||||
//独立组态
|
||||
gotoScada () {
|
||||
gotoScada() {
|
||||
if (this.token != '' && this.token != null) {
|
||||
uni.navigateTo({
|
||||
url: '/pagesB/user/scada/indeScada'
|
||||
@ -406,27 +415,27 @@
|
||||
this.showModel = true;
|
||||
}
|
||||
},
|
||||
openappLink () {
|
||||
openappLink() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/common/webview/index?url=https://gitee.com/beecue/fastbee-app/tree/master/app'
|
||||
});
|
||||
},
|
||||
// 解绑微信
|
||||
handleUnbindWeChart () {
|
||||
handleUnbindWeChart() {
|
||||
uni.navigateTo({
|
||||
url: '/pagesB/user/secureBind'
|
||||
});
|
||||
},
|
||||
// 绑定微信
|
||||
handleBindWeChart () {
|
||||
handleBindWeChart() {
|
||||
this.isBindWeChart = true;
|
||||
},
|
||||
confirmBindWeChart () {
|
||||
confirmBindWeChart() {
|
||||
this.isBindWeChart = false;
|
||||
let that = this;
|
||||
uni.login({
|
||||
provider: 'weixin',
|
||||
success: function (res) {
|
||||
success: function(res) {
|
||||
if (res) {
|
||||
console.log('用户授权成功');
|
||||
// #ifdef APP-PLUS
|
||||
@ -705,14 +714,14 @@
|
||||
/* 设置文字颜色 */
|
||||
}
|
||||
|
||||
/deep/.uni-list-item__content-title[data-v-296a3d7e] {
|
||||
::v-deep.uni-list-item__content-title[data-v-296a3d7e] {
|
||||
font-size: 30rpx;
|
||||
color: #333;
|
||||
overflow: hidden;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/deep/.uni-list-item__container {
|
||||
::v-deep .uni-list-item__container {
|
||||
padding: 30rpx;
|
||||
}
|
||||
|
||||
|
@ -78,9 +78,15 @@
|
||||
import moment from 'moment';
|
||||
import uniDataCheckbox from '@/pagesA/components/uni-data-checkbox/index.vue';
|
||||
import uniPagination from '@/pagesA/components/uni-pagination/index.vue';
|
||||
import { getSubGatewayList } from '@/apis/modules/gateway.js';
|
||||
import { listThingsModel } from '@/apis/modules/device.js';
|
||||
import { getHistoryList } from '@/apis/modules/deviceLog.js';
|
||||
import {
|
||||
getSubGatewayList
|
||||
} from '@/apis/modules/gateway.js';
|
||||
import {
|
||||
listThingsModel
|
||||
} from '@/apis/modules/device.js';
|
||||
import {
|
||||
getHistoryList
|
||||
} from '@/apis/modules/deviceLog.js';
|
||||
|
||||
export default {
|
||||
name: 'deviceHistory',
|
||||
@ -97,10 +103,10 @@
|
||||
type: Number
|
||||
},
|
||||
watch: {
|
||||
device: function (newVal, oldVal) {
|
||||
device: function(newVal, oldVal) {
|
||||
this.deviceInfo = newVal;
|
||||
},
|
||||
type (val) {
|
||||
type(val) {
|
||||
if (val === 3) {
|
||||
// const { deviceType } = this.deviceInfo || {};
|
||||
// if (deviceType === 2) {
|
||||
@ -110,7 +116,7 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
data () {
|
||||
data() {
|
||||
const beginTime = new Date().getTime() - 3600 * 1000 * 24;
|
||||
const endTime = new Date().getTime();
|
||||
|
||||
@ -193,7 +199,7 @@
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
tableCom () {
|
||||
tableCom() {
|
||||
const start = (this.devPageNum - 1) * this.devPageSize;
|
||||
const end = start + this.devPageSize;
|
||||
return this.tableComTemp.slice(start, end);
|
||||
@ -201,7 +207,7 @@
|
||||
},
|
||||
methods: {
|
||||
// 快捷时间选择
|
||||
handleTimeShortcutChange (val) {
|
||||
handleTimeShortcutChange(val) {
|
||||
if (val === 3) {
|
||||
return;
|
||||
}
|
||||
@ -220,7 +226,7 @@
|
||||
this.getHistory();
|
||||
},
|
||||
// 格式化时间
|
||||
formatDate (strTime) {
|
||||
formatDate(strTime) {
|
||||
const times = strTime.split('-');
|
||||
const beginTime = new Date(Number(times[0]));
|
||||
const endTime = new Date(Number(times[1]));
|
||||
@ -235,8 +241,11 @@
|
||||
return `${beginMonth}-${beginDay} ${beginHours}:${beginMinutes} - ${endMonth}-${endDay} ${endHours}:${endMinutes}`;
|
||||
},
|
||||
// 日期选择
|
||||
handleDateTimeClick () {
|
||||
const { beginTime, endTime } = this.queryParams;
|
||||
handleDateTimeClick() {
|
||||
const {
|
||||
beginTime,
|
||||
endTime
|
||||
} = this.queryParams;
|
||||
if (this.dateTimeIndex === 1) {
|
||||
this.$refs.datetimePicker.innerValue = beginTime;
|
||||
} else {
|
||||
@ -245,8 +254,11 @@
|
||||
this.isDateTime = true;
|
||||
},
|
||||
// 时间选择下一步/确定
|
||||
handleConfirmDateTime (e) {
|
||||
const { beginTime, endTime } = this.queryParams;
|
||||
handleConfirmDateTime(e) {
|
||||
const {
|
||||
beginTime,
|
||||
endTime
|
||||
} = this.queryParams;
|
||||
if (this.dateTimeIndex === 1) {
|
||||
this.queryParams.beginTime = e.value;
|
||||
this.dateTimeIndex = this.dateTimeIndex + 1;
|
||||
@ -266,19 +278,19 @@
|
||||
}
|
||||
},
|
||||
// 取消日期选择
|
||||
handleCancelDateTime () {
|
||||
handleCancelDateTime() {
|
||||
this.isDateTime = false;
|
||||
},
|
||||
// 点击遮取消日期选择
|
||||
handleCloseDateTime () {
|
||||
handleCloseDateTime() {
|
||||
this.isDateTime = false;
|
||||
},
|
||||
// 筛选
|
||||
handleFilterClick () {
|
||||
handleFilterClick() {
|
||||
this.isFilter = true;
|
||||
},
|
||||
// 变量选择
|
||||
handleIdentifierCheck (e) {
|
||||
handleIdentifierCheck(e) {
|
||||
const value = e.detail.value;
|
||||
const length = value.length;
|
||||
if (length > 9) {
|
||||
@ -290,8 +302,10 @@
|
||||
}
|
||||
},
|
||||
// 筛选确认
|
||||
handleConfirmFilter () {
|
||||
const { identifiers } = this.queryParams;
|
||||
handleConfirmFilter() {
|
||||
const {
|
||||
identifiers
|
||||
} = this.queryParams;
|
||||
if (identifiers.length === 0) {
|
||||
uni.showToast({
|
||||
icon: 'none',
|
||||
@ -303,15 +317,20 @@
|
||||
}
|
||||
},
|
||||
// 获取子设备列表数据
|
||||
getSlaveDatas () {
|
||||
const { deviceId } = this.deviceInfo;
|
||||
getSlaveDatas() {
|
||||
const {
|
||||
deviceId
|
||||
} = this.deviceInfo;
|
||||
const params = {
|
||||
gwDeviceId: deviceId,
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
};
|
||||
getSubGatewayList(params).then(res => {
|
||||
const { code, rows } = res;
|
||||
const {
|
||||
code,
|
||||
rows
|
||||
} = res;
|
||||
if (code === 200) {
|
||||
this.slaveList = rows.map(item => ({
|
||||
text: item.subDeviceName,
|
||||
@ -322,15 +341,20 @@
|
||||
});
|
||||
},
|
||||
// 获取物模型
|
||||
getIdentifierList () {
|
||||
const { deviceId } = this.deviceInfo;
|
||||
getIdentifierList() {
|
||||
const {
|
||||
deviceId
|
||||
} = this.deviceInfo;
|
||||
const params = {
|
||||
deviceId: deviceId,
|
||||
pageNum: 1,
|
||||
pageSize: 9999,
|
||||
};
|
||||
listThingsModel(params).then((res) => {
|
||||
const { code, rows } = res;
|
||||
const {
|
||||
code,
|
||||
rows
|
||||
} = res;
|
||||
if (code === 200) {
|
||||
this.identifierList = rows.map(item => ({
|
||||
text: item.modelName,
|
||||
@ -342,14 +366,22 @@
|
||||
});
|
||||
},
|
||||
// 获取统计数据
|
||||
getData () {
|
||||
getData() {
|
||||
this.getIdentifierList();
|
||||
this.getHistory(); // 获取统计数据
|
||||
},
|
||||
// 获取统计数据
|
||||
getHistory () {
|
||||
const { identifiers, beginTime, endTime, slaveId } = this.queryParams;
|
||||
const { deviceId, serialNumber } = this.deviceInfo;
|
||||
getHistory() {
|
||||
const {
|
||||
identifiers,
|
||||
beginTime,
|
||||
endTime,
|
||||
slaveId
|
||||
} = this.queryParams;
|
||||
const {
|
||||
deviceId,
|
||||
serialNumber
|
||||
} = this.deviceInfo;
|
||||
if (identifiers.length !== 0) {
|
||||
const idenList = identifiers.map((item) => {
|
||||
const iden = this.identifierList.find((chil) => chil.value === item);
|
||||
@ -374,7 +406,7 @@
|
||||
}
|
||||
},
|
||||
// 获取折线图数据
|
||||
getChartDatas () {
|
||||
getChartDatas() {
|
||||
const categories = this.historys.map((item) => Object.keys(item)[0]);
|
||||
const series = this.queryParams.identifiers.map((item) => {
|
||||
return {
|
||||
@ -391,7 +423,7 @@
|
||||
}
|
||||
},
|
||||
// 获取表格数据
|
||||
getTableDatas () {
|
||||
getTableDatas() {
|
||||
this.tableHeaders = this.queryParams.identifiers.map((item) => ({
|
||||
name: this.identifierList.find((chil) => chil.value === item).text,
|
||||
value: item,
|
||||
@ -410,7 +442,7 @@
|
||||
this.devTotal = this.historys.length;
|
||||
},
|
||||
// 获取设备列表数据
|
||||
getTableComsList (e) {
|
||||
getTableComsList(e) {
|
||||
this.devPageNum = e.current;
|
||||
},
|
||||
},
|
||||
@ -434,7 +466,7 @@
|
||||
.time-shortcut {
|
||||
width: 190rpx;
|
||||
|
||||
/deep/ .uni-select {
|
||||
::v-deep .uni-select {
|
||||
height: 70rpx;
|
||||
}
|
||||
}
|
||||
|
@ -1410,7 +1410,7 @@
|
||||
padding: 0px 18px;
|
||||
border-radius: 5px;
|
||||
|
||||
/deep/ .u-line:first-child {
|
||||
::v-deep .u-line:first-child {
|
||||
border-bottom: transparent !important;
|
||||
}
|
||||
}
|
||||
|
@ -19,10 +19,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { updateDevice } from '@/apis/modules/device';
|
||||
import {
|
||||
updateDevice
|
||||
} from '@/apis/modules/device';
|
||||
|
||||
export default {
|
||||
data () {
|
||||
data() {
|
||||
return {
|
||||
model: {
|
||||
name: '',
|
||||
@ -45,25 +47,28 @@
|
||||
data: null
|
||||
};
|
||||
},
|
||||
onReady () {
|
||||
onReady() {
|
||||
//如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则。
|
||||
this.$refs.form.setRules(this.rules)
|
||||
},
|
||||
onLoad (option) {
|
||||
onLoad(option) {
|
||||
this.data = JSON.parse(decodeURIComponent(option.item));
|
||||
const { deviceName, firmwareVersion } = this.data;
|
||||
const {
|
||||
deviceName,
|
||||
firmwareVersion
|
||||
} = this.data;
|
||||
this.model.name = deviceName;
|
||||
this.model.version = firmwareVersion;
|
||||
},
|
||||
methods: {
|
||||
handleSaveClick () {
|
||||
handleSaveClick() {
|
||||
this.$refs.form.validate().then(res => {
|
||||
this.updateDeviceData();
|
||||
}).catch(errors => {
|
||||
console.log('校验失败');
|
||||
})
|
||||
},
|
||||
updateDeviceData () {
|
||||
updateDeviceData() {
|
||||
let device = {
|
||||
...this.data,
|
||||
deviceId: this.data.deviceId,
|
||||
@ -102,7 +107,7 @@
|
||||
.modbus-edit-wrap {
|
||||
padding: 10px;
|
||||
|
||||
/deep/ .u-form-item__body__left__content__required {
|
||||
::v-deep .u-form-item__body__left__content__required {
|
||||
left: 5px;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user