diff --git a/README.md b/README.md index ee7d0ee..34ae250 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ @@ -725,4 +725,10 @@ update `2023.10.10` update - 问卷调查 - - 增加 答题完成返回错误后如果是从随手精灵公众号调过来的用户,则第6题文字变红 \ No newline at end of file + - 增加 答题完成返回错误后如果是从随手精灵公众号调过来的用户,则第6题文字变红 + +## v1.0.91 +`2023.10.13` +feature +- 增加 c1后台设备功耗查看页面 +- 增加 cell,echarts和table组件 diff --git a/src/api/core.js b/src/api/core.js index 9c8668f..ac8d41b 100644 --- a/src/api/core.js +++ b/src/api/core.js @@ -1,7 +1,7 @@ /* * @Date: 2021-12-18 15:49:01 * @LastEditors: JinxChen - * @LastEditTime: 2023-03-27 15:29:01 + * @LastEditTime: 2023-10-12 11:37:52 * @FilePath: \TelpoH5FrontendWeb\src\api\core.js * @description: * b端的接口, 每次调用前先获取token @@ -12,6 +12,7 @@ const baseUrl = process.env.VUE_APP_BASE_API + 'gateway'; const service = axios.create({ baseURL: baseUrl, }); +const HTTP_PREFIX_CORE = process.env.VUE_APP_BASE_API + 'gateway/' + 'core'; service.interceptors.request.use( request => { if (localStorage.getItem(prefix + 'gatewayToken')) { @@ -30,6 +31,30 @@ export const APICore = { cardPackageList, //零川基础套餐列表 devicePayPackage, drownReportFilterAdd,//添加过滤危险水域区域 + setLocationConfig, //设置设备定位控制参数 + getLocationConfig, //获取设备定位控制参数 + getHealthConfig, //获取设备健康控制参数(心率、血氧、测温) + setHealthConfig, //设置设备健康控制参数(心率、血氧、测温) + setUploadConfig, //置设备上报周期参数 + getUploadConfig, //取设备上报周期参数 + setDrownConfig, //设置设备防溺水参数 + getDrownConfig, //获取设备防溺水参数 + setNowearConfig, //设置设备未佩戴检测参数 + getNowearConfig, //获取设备未佩戴检测参数 + setWatchConfig , //手表模式设置参数(平台) + getWatchConfig , //查看手表模式设置参数 + getDrownReportFilterQuery, //获取水域告警白名单 + drownReportFilterDelete, ////删除过滤危险水域区域 + setAutoPlayConfigOfDiba, //设置迪爸自动播放参数接口 + getAutoPlayConfigOfDiba, //获取迪爸自动播放列表接口 + getBloodPressList, //获取血压数据列表 + getBloodPressConfig, //获取设备血压周期性检测参数 + setBloodPressConfig, //设置设备血压周期性检测参数 + setPsychAbilityConfig, //心理监测能力开通(下发参数) + getPsychAbilityConfig,//获取心理监测能力开通参数 + setIotCtlMode, //设置设备iot连接控制属性 + getIotCtlMode, //获取设备iot连接控制属性 + checkImei, //检查设备关联的物联网厂商信息 } /* const headerAuth = this.$store.getters.gatewayToken; */ // 获取告警详情 @@ -101,4 +126,187 @@ function drownReportFilterAdd(data) { data, }); } + +function setLocationConfig(params) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/SetLocationConfig`, + method: 'post', + data: params, + }); +} +function getLocationConfig({imei}) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/GetLocationConfig`, + method: 'get', + params: {imei}, + }) +} +function setHealthConfig(params) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/SetHealthConfig`, + method: 'post', + headers: {authKey: 'key1'}, + data: params, + }); +} +function getHealthConfig({imei}) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/GetHealthConfig`, + method: 'get', + params: {imei}, + }) +} + +function setUploadConfig(params) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/SetUploadConfig`, + method: 'post', + data: params, + }); +} +function getUploadConfig({imei}) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/GetUploadConfig`, + method: 'get', + params: {imei}, + }) +} +function setAutoPlayConfigOfDiba(params) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/OpenAbility/Diba/setConfig`, + method: 'post', + data: params, + }); +} + +function getAutoPlayConfigOfDiba({imei}) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/OpenAbility/Diba/getConfig`, + method: 'get', + params: {imei}, + }) +} + +function setDrownConfig(params) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/SetDrownConfig`, + method: 'post', + data: params, + }); +} +function getDrownConfig({imei}) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/GetDrownConfig`, + method: 'get', + params: {imei}, + }) +} + +function setNowearConfig(params) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/SetNowearConfig`, + method: 'post', + data: params, + }); +} +function getNowearConfig({imei}) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/GetNowearConfig`, + method: 'get', + params: {imei}, + }) +} + +function setWatchConfig(params) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/Device/SetWatchConfig`, + method: 'post', + data: params, + }); +} +function getWatchConfig({imei}) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/Device/GetWatchConfig`, + method: 'get', + params: {imei}, + }) +} +function getDrownReportFilterQuery({imei}) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/Device/DrownReportFilterQuery`, + method: 'get', + params: {imei}, + }) +} + +function drownReportFilterDelete(data) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/Device/DrownReportFilterDelete`, + method: 'get', + params: data, + }) +} + +function getBloodPressList(params) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/healthy/BloodPressQuery`, + method: 'post', + data: params , + }); +} + +function getBloodPressConfig(data) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/GetBloodPressConfig`, + method: 'get', + params: data, + }) +} + +function setBloodPressConfig(params) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/SetBloodPressConfig`, + method: 'post', + data: params , + }); +} + +function getPsychAbilityConfig(data) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/GetPsychAbilityConfig`, + method: 'get', + params: data, + }) +} + +function setPsychAbilityConfig(params) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/SetPsychAbilityConfig`, + method: 'post', + data: params , + }); +} +function setIotCtlMode(params) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/SetIotCtlMode`, + method: 'post', + data: params, + }) +} +function getIotCtlMode(imei) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/open/OpenIot/GetIotCtlMode`, + method: 'get', + params: { imei }, + }) +} + +function checkImei(params) { + return service({ + url: `${HTTP_PREFIX_CORE}/api/v1/Device/CheckImei`, + method: 'post', + data: params, + }) +} + export default APICore; diff --git a/src/api/iot.js b/src/api/iot.js new file mode 100644 index 0000000..36b00bc --- /dev/null +++ b/src/api/iot.js @@ -0,0 +1,25 @@ +import axios from 'axios'; +import prefix from '@/store/prefix'; +const baseUrl = process.env.VUE_APP_BASE_API; +const service = axios.create({ + baseURL: baseUrl, +}); +service.interceptors.request.use( + request => { + /* if (localStorage.getItem(prefix + 'gatewayToken')) { + request.headers.AccessToken = localStorage.getItem(prefix + 'gatewayToken'); + } */ + return request; + }, +); +export const APIIot = { + getdeviceinfo +} +function getdeviceinfo(params) { + return service({ + url: `${baseUrl}iotservice/getdeviceinfo`, + method: 'post', + data: params + }) +} +export default APIIot; diff --git a/src/components/custom-cell/index.scss b/src/components/custom-cell/index.scss new file mode 100644 index 0000000..d016831 --- /dev/null +++ b/src/components/custom-cell/index.scss @@ -0,0 +1,16 @@ +.custom-cell { + .van-cell { + padding: 10px 5px !important; + .van-cell__title { + width: 150px !important; + text-align: left !important; + } + .van-cell__value { + /* width: 200px !important; */ + /* height: 60px !important; */ + text-align: left !important; + padding-left: 10px; + /* overflow: scroll; */ + } + } +} \ No newline at end of file diff --git a/src/components/custom-cell/index.vue b/src/components/custom-cell/index.vue new file mode 100644 index 0000000..861056d --- /dev/null +++ b/src/components/custom-cell/index.vue @@ -0,0 +1,58 @@ + + + + + + diff --git a/src/components/echarts/index.scss b/src/components/echarts/index.scss new file mode 100644 index 0000000..30efbe1 --- /dev/null +++ b/src/components/echarts/index.scss @@ -0,0 +1,12 @@ +.charDom { + position: relative; + //屏幕大于750 或者小于1440 + @media screen and (max-width: 1920px) and (min-width: 750px){ + height: 100px; + width: 100%; + } + @media screen and (max-width: 750px) and (min-width: 200px){ + height: 300px; + width: 100%; + } +} \ No newline at end of file diff --git a/src/components/echarts/index.vue b/src/components/echarts/index.vue new file mode 100644 index 0000000..d486275 --- /dev/null +++ b/src/components/echarts/index.vue @@ -0,0 +1,67 @@ + + + + + + diff --git a/src/components/tables/index.scss b/src/components/tables/index.scss new file mode 100644 index 0000000..e439d39 --- /dev/null +++ b/src/components/tables/index.scss @@ -0,0 +1,37 @@ +.table-container { + table { + position: relative; + width: 100%; + border-collapse: collapse; + border-spacing: 0; + empty-cells: show; + border: .5px solid #e9e9e9; + overflow: scroll; + } + + table th { + background: #f7f7f7; + color: #5c6b77; + font-weight: 600; + white-space: nowrap; + + } + + table td, + table th { + border: .5px solid #e9e9e9; + text-align: left; + @media screen and (max-width: 1920px) and (min-width: 550px){ + padding: 4px; + } + @media screen and (max-width: 550px) and (min-width: 200px){ + font-size: 16px; + padding: 8px; + } + } + tbody { + height: 50px; + overflow: scroll; + } + +} \ No newline at end of file diff --git a/src/components/tables/index.vue b/src/components/tables/index.vue new file mode 100644 index 0000000..1bcf74d --- /dev/null +++ b/src/components/tables/index.vue @@ -0,0 +1,74 @@ + + + + + + diff --git a/src/config/models.js b/src/config/models.js index ec7c520..bbae4f6 100644 --- a/src/config/models.js +++ b/src/config/models.js @@ -1,11 +1,11 @@ /* * @Date: 2021-11-20 10:26:39 * @LastEditors: JinxChen - * @LastEditTime: 2023-10-09 09:38:30 + * @LastEditTime: 2023-10-16 09:34:24 * @FilePath: \TelpoH5FrontendWeb\src\config\models.js * @description: */ -export const VERSION_MODEL = '1.0.90F'; //版本号 +export const VERSION_MODEL = '1.0.91F'; //版本号 export const IMAGE_URL = { production: 'http://zfb.ssjlai.com/web/', test: 'http://zfb.ssjlai.com/web/', @@ -60,4 +60,27 @@ export const EmotionModel = { }; //心理健康相关接口地址 -export const PsyBaseUrl = process.env.NODE_ENV === 'production' ? 'https://dbmq.rzliot.com/auth_heart' : 'https://dbmq.rzliot.com/heart'; \ No newline at end of file +export const PsyBaseUrl = process.env.NODE_ENV === 'production' ? 'https://dbmq.rzliot.com/auth_heart' : 'https://dbmq.rzliot.com/heart'; + + +// 设备耗电情况 +export const DEVICE_POWER = { + // 电量 + BatteryLevel: { + title: '设备电量值', + value: 'BatteryLevel', + type: 1, + }, + // 信号强度 + status: { + title: '信号强度', + value: 'status', + type: 2, + }, + // 离线行为 + Offline: { + title: '设备离线行为', + value: 'offline', + type: 3, + } +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index e32b116..6a66672 100644 --- a/src/main.js +++ b/src/main.js @@ -1,7 +1,7 @@ /* * @Date: 2022-01-19 10:08:26 * @LastEditors: JinxChen - * @LastEditTime: 2023-09-20 14:15:47 + * @LastEditTime: 2023-10-11 15:36:55 * @FilePath: \TelpoH5FrontendWeb\src\main.js * @description: */ @@ -58,6 +58,9 @@ import { Toast, ActionSheet, Progress, + DropdownMenu, + DropdownItem, + TreeSelect, } from 'vant'; //按需加载vant组件 Vue @@ -101,6 +104,9 @@ Vue .use(Toast) .use(ActionSheet) .use(Progress) +.use(DropdownMenu) +.use(DropdownItem ) +.use(TreeSelect) Vue.config.productionTip = false; Vue.config.devtools = true; diff --git a/src/router/index.js b/src/router/index.js index 428bb46..2540538 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -1,7 +1,14 @@ +/* + * @Date: 2023-09-21 09:54:53 + * @LastEditors: JinxChen + * @LastEditTime: 2023-10-13 11:30:23 + * @FilePath: \TelpoH5FrontendWeb\src\router\index.js + * @description: + */ /* * @Date: 2023-06-01 18:41:50 * @LastEditors: JinxChen - * @LastEditTime: 2023-09-20 11:15:50 + * @LastEditTime: 2023-10-10 15:56:50 * @FilePath: \TelpoH5FrontendWeb\src\router\index.js * @description: */ @@ -59,6 +66,12 @@ const routes = [ { path: '/aiCallAlarm', name: 'aiCallAlarm', component: resolve => require(['@/views/ai-call-alarm'], resolve) }, // 物联网卡错误页 { path: '/iotcardError', name: 'iotcardError', component: resolve => require(['@/views/error-pages/iotcard-error'], resolve) }, + // c1(4g管理后台)设备耗电情况页面 + { path: '/devicePower', name: 'devicePower', component: resolve => require(['@/views/gps-card-frontend/device-power'], resolve) }, + // c1(4g管理后台)设备设置页面 + { path: '/deviceSetting', name: 'deviceSetting', component: resolve => require(['@/views/gps-card-frontend/device-setting'], resolve) }, + // c1(4g管理后台)涉水区域白名单 + { path: '/drownWhiteList', name: 'drownWhiteList', component: resolve => require(['@/views/gps-card-frontend/drown-white-list'], resolve) }, ]; const router = new VueRouter({ diff --git a/src/store/index.js b/src/store/index.js index 99df87e..0681b86 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -1,7 +1,7 @@ /* * @Date: 2022-08-17 16:18:02 * @LastEditors: JinxChen - * @LastEditTime: 2023-06-19 11:26:22 + * @LastEditTime: 2023-10-13 14:45:16 * @FilePath: \TelpoH5FrontendWeb\src\store\index.js * @description: */ @@ -13,7 +13,7 @@ import { isNotNull } from '@/utils'; Vue.use(Vuex); export default new Vuex.Store({ state: { - imei: '', //例子 + imei: '', // gatewayToken: '', //gateway接口token token: '', wxAuthCode: '', @@ -22,6 +22,7 @@ export default new Vuex.Store({ isFromWx: null, ssjlToken: '', fromSsjl: '', + active: null, //点击左边树形图下标 }, mutations: { imei(state, imei) { @@ -60,6 +61,10 @@ export default new Vuex.Store({ state.fromSsjl = fromSsjl; window.localStorage[prefix + 'fromSsjl'] = fromSsjl; }, + active(state, active) { + state.active = active; + window.localStorage[prefix + 'active'] = active; + }, }, getters: { imei: state => { @@ -98,6 +103,10 @@ export default new Vuex.Store({ if (state.fromSsjl != '') return state.fromSsjl; return window.localStorage[prefix + 'fromSsjl'] == null ? '' : window.localStorage[prefix + 'fromSsjl']; }, + active: state => { + if (state.active != '') return state.active; + return window.localStorage[prefix + 'active'] == null ? '' : window.localStorage[prefix + 'active']; + }, }, actions: {}, modules: {} diff --git a/src/views/gps-card-frontend/device-power/index.scss b/src/views/gps-card-frontend/device-power/index.scss new file mode 100644 index 0000000..ff104d0 --- /dev/null +++ b/src/views/gps-card-frontend/device-power/index.scss @@ -0,0 +1,59 @@ +.device-power { + position: relative; + /* overflow: hidden; */ + overflow: hidden; + height: 100vh; + background-color: #fff; + .top { + padding: 10px 15px; + text-align: left; + @media screen and (max-width: 550px) and (min-width: 200px){ + font-size: 16px; + } + } + .action { + display: flex; + justify-content: space-between; + @media screen and (max-width: 550px) and (min-width: 200px){ + justify-content: space-around; + } + align-items: center; + padding: 0 10px; + .left { + border: .5px solid $lineGray;; + .van-dropdown-menu { + .van-dropdown-menu__bar { + /* border: .5px solid #000; */ + .van-dropdown-menu__item { + min-width: 150px !important; + } + } + } + } + .right { + .btn { + &.active { + color: $blue; + border: .5px solid $blue; + } + } + } + } + .details-container{ + position: relative; + padding: 10px; + + @media screen and (max-width: 1920px) and (min-width: 550px){ + height: 100px; + overflow: scroll; + } + @media screen and (max-width: 550px) and (min-width: 200px){ + max-height: 500px; + overflow: scroll; + } + .echart { + height: 30%; + padding: 0 5px; + } + } +} \ No newline at end of file diff --git a/src/views/gps-card-frontend/device-power/index.vue b/src/views/gps-card-frontend/device-power/index.vue new file mode 100644 index 0000000..052da50 --- /dev/null +++ b/src/views/gps-card-frontend/device-power/index.vue @@ -0,0 +1,328 @@ + + + + + + diff --git a/src/views/gps-card-frontend/device-setting/index.scss b/src/views/gps-card-frontend/device-setting/index.scss new file mode 100644 index 0000000..8143e14 --- /dev/null +++ b/src/views/gps-card-frontend/device-setting/index.scss @@ -0,0 +1,15 @@ +.device-setting { + position: relative; + height: 100vh; + width: 100%; + overflow: hidden; + background-color: #fff; + .tree-select { + position: relative; + padding: 10px; + @media screen and (max-width: 550px) and (min-width: 200px){ + font-size: 16px; + } + + } +} \ No newline at end of file diff --git a/src/views/gps-card-frontend/device-setting/index.vue b/src/views/gps-card-frontend/device-setting/index.vue new file mode 100644 index 0000000..c444dff --- /dev/null +++ b/src/views/gps-card-frontend/device-setting/index.vue @@ -0,0 +1,449 @@ + + + + + + + diff --git a/src/views/gps-card-frontend/drown-white-list/index.scss b/src/views/gps-card-frontend/drown-white-list/index.scss new file mode 100644 index 0000000..e69de29 diff --git a/src/views/gps-card-frontend/drown-white-list/index.vue b/src/views/gps-card-frontend/drown-white-list/index.vue new file mode 100644 index 0000000..60366b6 --- /dev/null +++ b/src/views/gps-card-frontend/drown-white-list/index.vue @@ -0,0 +1,151 @@ + + + + + diff --git a/vue.config.js b/vue.config.js index 088b3fd..d98d7ae 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,7 +1,7 @@ /* * @Author: your name * @Date: 2020-04-15 10:00:32 - * @LastEditTime: 2023-06-14 17:10:10 + * @LastEditTime: 2023-10-12 17:24:41 * @LastEditors: JinxChen * @Description: In User Settings Edit * @FilePath: \TelpoH5FrontendWeb\vue.config.js @@ -14,10 +14,10 @@ const pxtorem = require('postcss-pxtorem'); // 把代码中px转为rem const CompressionPlugin = require("compression-webpack-plugin"); const port = process.env.port || process.env.npm_config_port || 8080;/* 7788 */ // dev port -/* const proxy = process.env.NODE_ENV === 'development' ?{ +const proxy = process.env.NODE_ENV === 'development' ?{ // 调试完毕需要把这个代理注释掉,否则发布到线上会有问题产生 - '/api/id': { - target: 'https://id.ssjlai.com/watersoutboundapi/', + /* '/api/id': { + target: 'http://id.ssjlai.com/iotservice', changeOrigin: true, pathRewrite: { '^/api/id': '' @@ -29,9 +29,9 @@ const port = process.env.port || process.env.npm_config_port || 8080;/* 7788 */ pathRewrite: { '^/api/ai': '' } - } + } */ } -: null; */ +: null; module.exports = { // 注意: 多页面配置 不再使用全路径,单页面时可以开启 publicPath: './', @@ -46,7 +46,7 @@ module.exports = { warnings: false, errors: true }, - /* proxy: proxy, */ + /* proxy: proxy, */ //开启代理后必须也要把这个开启,否则不生效 /* host: '192.168.3.186', */// 原为: hotst: 'localhost', 可在同一ip局域网下通过网址生成二维码的方式调试h5, 注意:调试完毕请注释 //disableHostCheck: true, //真机调试开启 },