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