diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 0cdbb7d..372ef0e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 0cdbb7d..372ef0e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasDetectorData.vue b/src/views/deviceManage/components/listGasDetectorData.vue new file mode 100644 index 0000000..2f282a1 --- /dev/null +++ b/src/views/deviceManage/components/listGasDetectorData.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 0cdbb7d..372ef0e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasDetectorData.vue b/src/views/deviceManage/components/listGasDetectorData.vue new file mode 100644 index 0000000..2f282a1 --- /dev/null +++ b/src/views/deviceManage/components/listGasDetectorData.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/deviceManage/components/listHydrantData.vue b/src/views/deviceManage/components/listHydrantData.vue index 8ba6cee..823201e 100644 --- a/src/views/deviceManage/components/listHydrantData.vue +++ b/src/views/deviceManage/components/listHydrantData.vue @@ -63,13 +63,13 @@ needIndex: false }, // 是否需要序号列 columns: [ - { text: '上报时间', value: 'logTime', align: 'center' }, + { text: '上报时间', value: 'logtime', align: 'center' }, { text: '消防栓状态', value: 'descn', align: 'center' } ], // 显示列 headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 0cdbb7d..372ef0e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasDetectorData.vue b/src/views/deviceManage/components/listGasDetectorData.vue new file mode 100644 index 0000000..2f282a1 --- /dev/null +++ b/src/views/deviceManage/components/listGasDetectorData.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/deviceManage/components/listHydrantData.vue b/src/views/deviceManage/components/listHydrantData.vue index 8ba6cee..823201e 100644 --- a/src/views/deviceManage/components/listHydrantData.vue +++ b/src/views/deviceManage/components/listHydrantData.vue @@ -63,13 +63,13 @@ needIndex: false }, // 是否需要序号列 columns: [ - { text: '上报时间', value: 'logTime', align: 'center' }, + { text: '上报时间', value: 'logtime', align: 'center' }, { text: '消防栓状态', value: 'descn', align: 'center' } ], // 显示列 headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listLiquidData.vue b/src/views/deviceManage/components/listLiquidData.vue index 3b77db0..3bae830 100644 --- a/src/views/deviceManage/components/listLiquidData.vue +++ b/src/views/deviceManage/components/listLiquidData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '液位值', value: 'liquiddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 0cdbb7d..372ef0e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasDetectorData.vue b/src/views/deviceManage/components/listGasDetectorData.vue new file mode 100644 index 0000000..2f282a1 --- /dev/null +++ b/src/views/deviceManage/components/listGasDetectorData.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/deviceManage/components/listHydrantData.vue b/src/views/deviceManage/components/listHydrantData.vue index 8ba6cee..823201e 100644 --- a/src/views/deviceManage/components/listHydrantData.vue +++ b/src/views/deviceManage/components/listHydrantData.vue @@ -63,13 +63,13 @@ needIndex: false }, // 是否需要序号列 columns: [ - { text: '上报时间', value: 'logTime', align: 'center' }, + { text: '上报时间', value: 'logtime', align: 'center' }, { text: '消防栓状态', value: 'descn', align: 'center' } ], // 显示列 headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listLiquidData.vue b/src/views/deviceManage/components/listLiquidData.vue index 3b77db0..3bae830 100644 --- a/src/views/deviceManage/components/listLiquidData.vue +++ b/src/views/deviceManage/components/listLiquidData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '液位值', value: 'liquiddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listNoiseData.vue b/src/views/deviceManage/components/listNoiseData.vue index 1fb0f32..bc1024d 100644 --- a/src/views/deviceManage/components/listNoiseData.vue +++ b/src/views/deviceManage/components/listNoiseData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '噪声值', value: 'ddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 0cdbb7d..372ef0e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasDetectorData.vue b/src/views/deviceManage/components/listGasDetectorData.vue new file mode 100644 index 0000000..2f282a1 --- /dev/null +++ b/src/views/deviceManage/components/listGasDetectorData.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/deviceManage/components/listHydrantData.vue b/src/views/deviceManage/components/listHydrantData.vue index 8ba6cee..823201e 100644 --- a/src/views/deviceManage/components/listHydrantData.vue +++ b/src/views/deviceManage/components/listHydrantData.vue @@ -63,13 +63,13 @@ needIndex: false }, // 是否需要序号列 columns: [ - { text: '上报时间', value: 'logTime', align: 'center' }, + { text: '上报时间', value: 'logtime', align: 'center' }, { text: '消防栓状态', value: 'descn', align: 'center' } ], // 显示列 headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listLiquidData.vue b/src/views/deviceManage/components/listLiquidData.vue index 3b77db0..3bae830 100644 --- a/src/views/deviceManage/components/listLiquidData.vue +++ b/src/views/deviceManage/components/listLiquidData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '液位值', value: 'liquiddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listNoiseData.vue b/src/views/deviceManage/components/listNoiseData.vue index 1fb0f32..bc1024d 100644 --- a/src/views/deviceManage/components/listNoiseData.vue +++ b/src/views/deviceManage/components/listNoiseData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '噪声值', value: 'ddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listTempData.vue b/src/views/deviceManage/components/listTempData.vue index bf8136e..d2e6272 100644 --- a/src/views/deviceManage/components/listTempData.vue +++ b/src/views/deviceManage/components/listTempData.vue @@ -22,7 +22,15 @@ - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 0cdbb7d..372ef0e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasDetectorData.vue b/src/views/deviceManage/components/listGasDetectorData.vue new file mode 100644 index 0000000..2f282a1 --- /dev/null +++ b/src/views/deviceManage/components/listGasDetectorData.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/deviceManage/components/listHydrantData.vue b/src/views/deviceManage/components/listHydrantData.vue index 8ba6cee..823201e 100644 --- a/src/views/deviceManage/components/listHydrantData.vue +++ b/src/views/deviceManage/components/listHydrantData.vue @@ -63,13 +63,13 @@ needIndex: false }, // 是否需要序号列 columns: [ - { text: '上报时间', value: 'logTime', align: 'center' }, + { text: '上报时间', value: 'logtime', align: 'center' }, { text: '消防栓状态', value: 'descn', align: 'center' } ], // 显示列 headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listLiquidData.vue b/src/views/deviceManage/components/listLiquidData.vue index 3b77db0..3bae830 100644 --- a/src/views/deviceManage/components/listLiquidData.vue +++ b/src/views/deviceManage/components/listLiquidData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '液位值', value: 'liquiddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listNoiseData.vue b/src/views/deviceManage/components/listNoiseData.vue index 1fb0f32..bc1024d 100644 --- a/src/views/deviceManage/components/listNoiseData.vue +++ b/src/views/deviceManage/components/listNoiseData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '噪声值', value: 'ddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listTempData.vue b/src/views/deviceManage/components/listTempData.vue index bf8136e..d2e6272 100644 --- a/src/views/deviceManage/components/listTempData.vue +++ b/src/views/deviceManage/components/listTempData.vue @@ -22,7 +22,15 @@ - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 0cdbb7d..372ef0e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasDetectorData.vue b/src/views/deviceManage/components/listGasDetectorData.vue new file mode 100644 index 0000000..2f282a1 --- /dev/null +++ b/src/views/deviceManage/components/listGasDetectorData.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/deviceManage/components/listHydrantData.vue b/src/views/deviceManage/components/listHydrantData.vue index 8ba6cee..823201e 100644 --- a/src/views/deviceManage/components/listHydrantData.vue +++ b/src/views/deviceManage/components/listHydrantData.vue @@ -63,13 +63,13 @@ needIndex: false }, // 是否需要序号列 columns: [ - { text: '上报时间', value: 'logTime', align: 'center' }, + { text: '上报时间', value: 'logtime', align: 'center' }, { text: '消防栓状态', value: 'descn', align: 'center' } ], // 显示列 headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listLiquidData.vue b/src/views/deviceManage/components/listLiquidData.vue index 3b77db0..3bae830 100644 --- a/src/views/deviceManage/components/listLiquidData.vue +++ b/src/views/deviceManage/components/listLiquidData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '液位值', value: 'liquiddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listNoiseData.vue b/src/views/deviceManage/components/listNoiseData.vue index 1fb0f32..bc1024d 100644 --- a/src/views/deviceManage/components/listNoiseData.vue +++ b/src/views/deviceManage/components/listNoiseData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '噪声值', value: 'ddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listTempData.vue b/src/views/deviceManage/components/listTempData.vue index bf8136e..d2e6272 100644 --- a/src/views/deviceManage/components/listTempData.vue +++ b/src/views/deviceManage/components/listTempData.vue @@ -22,7 +22,15 @@ - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 0cdbb7d..372ef0e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasDetectorData.vue b/src/views/deviceManage/components/listGasDetectorData.vue new file mode 100644 index 0000000..2f282a1 --- /dev/null +++ b/src/views/deviceManage/components/listGasDetectorData.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/deviceManage/components/listHydrantData.vue b/src/views/deviceManage/components/listHydrantData.vue index 8ba6cee..823201e 100644 --- a/src/views/deviceManage/components/listHydrantData.vue +++ b/src/views/deviceManage/components/listHydrantData.vue @@ -63,13 +63,13 @@ needIndex: false }, // 是否需要序号列 columns: [ - { text: '上报时间', value: 'logTime', align: 'center' }, + { text: '上报时间', value: 'logtime', align: 'center' }, { text: '消防栓状态', value: 'descn', align: 'center' } ], // 显示列 headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listLiquidData.vue b/src/views/deviceManage/components/listLiquidData.vue index 3b77db0..3bae830 100644 --- a/src/views/deviceManage/components/listLiquidData.vue +++ b/src/views/deviceManage/components/listLiquidData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '液位值', value: 'liquiddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listNoiseData.vue b/src/views/deviceManage/components/listNoiseData.vue index 1fb0f32..bc1024d 100644 --- a/src/views/deviceManage/components/listNoiseData.vue +++ b/src/views/deviceManage/components/listNoiseData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '噪声值', value: 'ddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listTempData.vue b/src/views/deviceManage/components/listTempData.vue index bf8136e..d2e6272 100644 --- a/src/views/deviceManage/components/listTempData.vue +++ b/src/views/deviceManage/components/listTempData.vue @@ -22,7 +22,15 @@ - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 0cdbb7d..372ef0e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasDetectorData.vue b/src/views/deviceManage/components/listGasDetectorData.vue new file mode 100644 index 0000000..2f282a1 --- /dev/null +++ b/src/views/deviceManage/components/listGasDetectorData.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/deviceManage/components/listHydrantData.vue b/src/views/deviceManage/components/listHydrantData.vue index 8ba6cee..823201e 100644 --- a/src/views/deviceManage/components/listHydrantData.vue +++ b/src/views/deviceManage/components/listHydrantData.vue @@ -63,13 +63,13 @@ needIndex: false }, // 是否需要序号列 columns: [ - { text: '上报时间', value: 'logTime', align: 'center' }, + { text: '上报时间', value: 'logtime', align: 'center' }, { text: '消防栓状态', value: 'descn', align: 'center' } ], // 显示列 headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listLiquidData.vue b/src/views/deviceManage/components/listLiquidData.vue index 3b77db0..3bae830 100644 --- a/src/views/deviceManage/components/listLiquidData.vue +++ b/src/views/deviceManage/components/listLiquidData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '液位值', value: 'liquiddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listNoiseData.vue b/src/views/deviceManage/components/listNoiseData.vue index 1fb0f32..bc1024d 100644 --- a/src/views/deviceManage/components/listNoiseData.vue +++ b/src/views/deviceManage/components/listNoiseData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '噪声值', value: 'ddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listTempData.vue b/src/views/deviceManage/components/listTempData.vue index bf8136e..d2e6272 100644 --- a/src/views/deviceManage/components/listTempData.vue +++ b/src/views/deviceManage/components/listTempData.vue @@ -22,7 +22,15 @@ - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 0cdbb7d..372ef0e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasDetectorData.vue b/src/views/deviceManage/components/listGasDetectorData.vue new file mode 100644 index 0000000..2f282a1 --- /dev/null +++ b/src/views/deviceManage/components/listGasDetectorData.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/deviceManage/components/listHydrantData.vue b/src/views/deviceManage/components/listHydrantData.vue index 8ba6cee..823201e 100644 --- a/src/views/deviceManage/components/listHydrantData.vue +++ b/src/views/deviceManage/components/listHydrantData.vue @@ -63,13 +63,13 @@ needIndex: false }, // 是否需要序号列 columns: [ - { text: '上报时间', value: 'logTime', align: 'center' }, + { text: '上报时间', value: 'logtime', align: 'center' }, { text: '消防栓状态', value: 'descn', align: 'center' } ], // 显示列 headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listLiquidData.vue b/src/views/deviceManage/components/listLiquidData.vue index 3b77db0..3bae830 100644 --- a/src/views/deviceManage/components/listLiquidData.vue +++ b/src/views/deviceManage/components/listLiquidData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '液位值', value: 'liquiddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listNoiseData.vue b/src/views/deviceManage/components/listNoiseData.vue index 1fb0f32..bc1024d 100644 --- a/src/views/deviceManage/components/listNoiseData.vue +++ b/src/views/deviceManage/components/listNoiseData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '噪声值', value: 'ddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listTempData.vue b/src/views/deviceManage/components/listTempData.vue index bf8136e..d2e6272 100644 --- a/src/views/deviceManage/components/listTempData.vue +++ b/src/views/deviceManage/components/listTempData.vue @@ -22,7 +22,15 @@ - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/package.json b/package.json index 08fc1f3..4b4e458 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ }, "dependencies": { "@amap/amap-jsapi-loader": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", "@riophae/vue-treeselect": "^0.4.0", "animate.css": "^4.1.1", "axios": "^0.21.1", @@ -29,6 +30,7 @@ "nprogress": "^0.2.0", "uppercamelcase": "^3.0.0", "v-charts": "^1.19.0", + "v-viewer": "^1.6.4", "vue": "^2.6.11", "vue-amap": "^0.5.10", "vue-router": "^3.2.0", diff --git a/src/api/data/data.js b/src/api/data/data.js index d87e74a..c437d7b 100644 --- a/src/api/data/data.js +++ b/src/api/data/data.js @@ -97,7 +97,7 @@ // 管盯数据查询 export function getTubeData(params) { return request({ - url: 'tubedata/list', + url: 'tubedata/list-page', method: 'get', params }) diff --git a/src/main.js b/src/main.js index cb309a1..1ceea3c 100644 --- a/src/main.js +++ b/src/main.js @@ -38,6 +38,11 @@ // 引入v-charts import VCharts from 'v-charts' Vue.use(VCharts) + +// 引入datav +import dataV from '@jiaminghi/data-view' +Vue.use(dataV) + // 引入音频文件 import audio from '@/assets/audio/alarm.mp3' diff --git a/src/permission.js b/src/permission.js index 96e5f73..ea80a31 100644 --- a/src/permission.js +++ b/src/permission.js @@ -3,9 +3,10 @@ import NProgress from 'nprogress' // progress bar 进度条 import 'nprogress/nprogress.css' // progress bar style 进度条样式 // import { Message } from 'element-ui' -import { getToken } from '@/utils/auth' // getToken from cookie -import { loginByToken, isSubSystem, sysCode } from './settings' +import { getToken, getUser, setUser } from '@/utils/auth' // getToken from cookie +import { loginByToken, isSubSystem, sysCode, loginByUsername } from './settings' import Vue from 'vue' +import { RSAencrypt } from '@/utils/security' NProgress.configure({ showSpinner: false })// NProgress configuration @@ -27,70 +28,89 @@ }).catch(() => { next('/401') // 否则全部重定向到401没有权限页面 }) - } - // 如果cookie中已有token,直接进行下一步 - if (oldToken) { - // 登录后进入登录页 - if (to.path === '/login') { - next({ path: '/' }) - NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 如果链接中有用户名和密码 + const oldUser = getUser() + const username = to.query.username + const password = to.query.pwd + debugger + if (loginByUsername && username && password && !oldUser) { // 登陆后跳转 + const loginForm = { + username: username, + password: RSAencrypt(password) + } + store.dispatch('Login', loginForm).then(() => { + setUser(username) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) } else { - // 当进入非登陆页时 - if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 - try { - store.dispatch('GetInfo').then(() => { - // 如果是子系统,参数为setting文件中的sysCode属性 - if (isSubSystem) { - store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + // 如果cookie中已有token,直接进行下一步 + if (oldToken) { + // 登录后进入登录页 + if (to.path === '/login') { + next({ path: '/' }) + NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it + } else { + // 当进入非登陆页时 + if (store.getters.roleList && store.getters.roleList.length === 0) { // 判断当前用户是否已拉取完user_info信息 + try { + store.dispatch('GetInfo').then(() => { + // 如果是子系统,参数为setting文件中的sysCode属性 + if (isSubSystem) { + store.dispatch('GetMenus', { code: sysCode }).then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } else { // 否则直接获取全部菜单权限 + store.dispatch('GetMenus').then((accessRoute) => { + router.addRoutes(accessRoute) + next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + }) + } }) - } else { // 否则直接获取全部菜单权限 - store.dispatch('GetMenus').then((accessRoute) => { - router.addRoutes(accessRoute) - next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 ,set the replace: true so the navigation will not leave a history record + } catch (err) { + store.dispatch('FedLogOut').then(() => { + // Message.error(err || '权限验证失败,请重新登录系统') + next({ path: '/' }) }) } - }) - } catch (err) { - store.dispatch('FedLogOut').then(() => { - // Message.error(err || '权限验证失败,请重新登录系统') - next({ path: '/' }) - }) + } else { // 角色不为空 + next() + } } - } else { // 角色不为空 - next() - } - } - } else { - // has no token - // 免登录白名单,直接进入 - if (whiteList.indexOf(to.path) !== -1) { - next() - } else { - // 如果允许通过链接上的token登录 - // 获取链接里的token - const token = to.query.token - console.log('form other system token:' + to.query.token) - if (loginByToken && token) { - // 调用自动登录接口,否则跳转到登录页 - store.dispatch('TokenLogin', token).then(() => { - console.log('自动登录成功') - console.log(to.path) - next({ ...to, replace: true }) // 登录成功继续 - }).catch(() => { - next('/401') // 否则全部重定向到401没有权限页面 - }) } else { - // 判断是独立运行的子系统还是和其他基础子系统一起的 - const config = Vue.prototype.baseConfig - if (config.singleSys) { - next(`/login`) // 重定向到本系统登录页 - } else { // 跳转到配置的主页 - window.location.href = config.mainPage + // has no token + // 免登录白名单,直接进入 + if (whiteList.indexOf(to.path) !== -1) { + next() + } else { + // 如果允许通过链接上的token登录 + // 获取链接里的token + const token = to.query.token + console.log('form other system token:' + to.query.token) + if (loginByToken && token) { + // 调用自动登录接口,否则跳转到登录页 + store.dispatch('TokenLogin', token).then(() => { + console.log('自动登录成功') + console.log(to.path) + next({ ...to, replace: true }) // 登录成功继续 + }).catch(() => { + next('/401') // 否则全部重定向到401没有权限页面 + }) + } else { + // 判断是独立运行的子系统还是和其他基础子系统一起的 + const config = Vue.prototype.baseConfig + if (config.singleSys) { + next(`/login`) // 重定向到本系统登录页 + } else { // 跳转到配置的主页 + window.location.href = config.mainPage + } + } + NProgress.done() } } - NProgress.done() } } }) diff --git a/src/router/index.js b/src/router/index.js index 4935f4a..e247d73 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -42,8 +42,12 @@ }, // 登录页面 { path: '/login', component: () => import('@/views/login/index_2'), hidden: true }, - // 3d地图 + // 3d地图-赣州 { path: '/3doverview', component: () => import('@/views/overview/overview3d'), hidden: true }, + // 章丘地图页 + { path: '/3doverviewzq', component: () => import('@/views/overview/overview3dzq'), hidden: true }, + // 章丘首页 + { path: '/zqindex', component: () => import('@/views/zhangqiu/zqindex'), hidden: true }, // 404错误页面 { path: '/404', component: () => import('@/views/errorPage/404'), hidden: true }, // 401 错误页面 diff --git a/src/router/modules/config.js b/src/router/modules/config.js index c33329b..eccd5c6 100644 --- a/src/router/modules/config.js +++ b/src/router/modules/config.js @@ -13,10 +13,10 @@ }, children: [ { - path: '/tenantConfig', - name: 'TenantConfig', - component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), - meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } + path: '/responsibleUser', + name: 'ResponsibleUser', + component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), + meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } }, { path: '/alarmConfig', @@ -31,28 +31,16 @@ meta: { title: '外观配置', icon: 'function', permission: ['/viewsConfig'] } }, { - path: '/responsibleUser', - name: 'ResponsibleUser', - component: () => import('@/views/systemConfig/responsibleUser/listResponsibleUser'), - meta: { title: '联系人配置', icon: 'function', permission: ['/responsibleUser'] } - }, - { - path: '/alarmLevel', - name: 'AlarmLevel', - component: () => import('@/views/systemConfig/alarmLevel/listLevel'), - meta: { title: '告警等级配置', icon: 'function', permission: ['/alarmLevel'] } - }, - { - path: '/alarmContent', - name: 'AlarmContent', - component: () => import('@/views/systemConfig/alarmContent/listContent'), - meta: { title: '告警内容配置', icon: 'function', permission: ['/alarmContent'] } - }, - { path: '/deptPermission', name: 'DeptPermission', component: () => import('@/views/systemConfig/deptPermission/deptPermission'), meta: { title: '组织权限配置', icon: 'function', permission: ['/deptPermission/list'] } + }, + { + path: '/tenantConfig', + name: 'TenantConfig', + component: () => import('@/views/systemConfig/tenantConfig/tenantConfig'), + meta: { title: '项目配置', icon: 'function', permission: ['/tenantConfig'] } } ] }] diff --git a/src/settings.js b/src/settings.js index 58b4117..e639076 100644 --- a/src/settings.js +++ b/src/settings.js @@ -40,7 +40,12 @@ * @type {Boolean} * @description 是否允许token登录 */ - loginByToken: false, + loginByToken: true, + /** + * @type {Boolean} + * @description 是否允许用户名+密码登录 + */ + loginByUsername: true, /** * @type {Boolean}, * @description 是否是某个子系统 diff --git a/src/utils/auth.js b/src/utils/auth.js index 65691f6..28fee48 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -1,6 +1,7 @@ import Cookies from 'js-cookie' const TokenKey = 'token' // token:cookie中 +const UserKey = 'user' // token:cookie中 const PublicKey = 'public_key' // 公钥:localStorage中 const CurrentSystem = 'current_system' // 当前系统,未必每个项目都有用:localStorage中 const WsUrl = 'ws_url' @@ -17,6 +18,18 @@ return Cookies.remove(TokenKey) } +export function getUser() { + return Cookies.get(UserKey) +} + +export function setUser(user) { + return Cookies.set(UserKey, user) +} + +export function removeUser() { + return Cookies.remove(UserKey) +} + export function getPublicKey() { return window.localStorage.getItem(PublicKey) } diff --git a/src/views/dataManage/deviceData/listGasdectorData.vue b/src/views/dataManage/deviceData/listGasdectorData.vue index b4ecd07..f16815e 100644 --- a/src/views/dataManage/deviceData/listGasdectorData.vue +++ b/src/views/dataManage/deviceData/listGasdectorData.vue @@ -86,8 +86,8 @@ { text: '设备编号', value: 'devcode', align: 'center' }, { text: '点位编号', value: 'wellCode', align: 'center' }, { text: '设备类型', value: 'deviceTypeName', align: 'center' }, - { text: '可燃气体浓度(%LEL)', value: 'strength', align: 'center', filter: true }, - { text: '电量(%)', value: 'cell', width: 80, align: 'center', checkCell: true }, + { text: '可燃气体浓度(%LEL)', value: 'gasSampleValue', align: 'center', filter: true }, + { text: '电量(%)', value: 'batteryValue', width: 80, align: 'center', checkCell: true }, // {text: '状态描述',value: 'descn', align: 'center'}, { text: '权属单位', value: 'deptName', align: 'center' }, { text: '上传时间', value: 'uptime', width: 170, align: 'center' } diff --git a/src/views/dataManage/deviceData/listH2SData.vue b/src/views/dataManage/deviceData/listH2SData.vue index 1dbe14d..9eb7af5 100644 --- a/src/views/dataManage/deviceData/listH2SData.vue +++ b/src/views/dataManage/deviceData/listH2SData.vue @@ -71,8 +71,6 @@ data() { return { listQuery: { - devcode: '', // 设备编号 - wellCode: '', // 点位编号 beginTime: '', // 开始时间 endTime: '', // 结束时间 keywords: '', // 关键字 diff --git a/src/views/dataManage/deviceData/listTubeData.vue b/src/views/dataManage/deviceData/listTubeData.vue index e0e6ab8..b56fb95 100644 --- a/src/views/dataManage/deviceData/listTubeData.vue +++ b/src/views/dataManage/deviceData/listTubeData.vue @@ -166,7 +166,7 @@ this.handleDateTime() getTubeData(this.listQuery).then(response => { this.list = response.data.rows - this.total = parseInt(response.data.total) + this.total = response.data.total this.listLoading = false }) }, diff --git a/src/views/deviceManage/components/listDigData.vue b/src/views/deviceManage/components/listDigData.vue index 1467b49..87e2b94 100644 --- a/src/views/deviceManage/components/listDigData.vue +++ b/src/views/deviceManage/components/listDigData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasData.vue b/src/views/deviceManage/components/listGasData.vue index 0cdbb7d..372ef0e 100644 --- a/src/views/deviceManage/components/listGasData.vue +++ b/src/views/deviceManage/components/listGasData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listGasDetectorData.vue b/src/views/deviceManage/components/listGasDetectorData.vue new file mode 100644 index 0000000..2f282a1 --- /dev/null +++ b/src/views/deviceManage/components/listGasDetectorData.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/src/views/deviceManage/components/listHydrantData.vue b/src/views/deviceManage/components/listHydrantData.vue index 8ba6cee..823201e 100644 --- a/src/views/deviceManage/components/listHydrantData.vue +++ b/src/views/deviceManage/components/listHydrantData.vue @@ -63,13 +63,13 @@ needIndex: false }, // 是否需要序号列 columns: [ - { text: '上报时间', value: 'logTime', align: 'center' }, + { text: '上报时间', value: 'logtime', align: 'center' }, { text: '消防栓状态', value: 'descn', align: 'center' } ], // 显示列 headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listLiquidData.vue b/src/views/deviceManage/components/listLiquidData.vue index 3b77db0..3bae830 100644 --- a/src/views/deviceManage/components/listLiquidData.vue +++ b/src/views/deviceManage/components/listLiquidData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '液位值', value: 'liquiddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listNoiseData.vue b/src/views/deviceManage/components/listNoiseData.vue index 1fb0f32..bc1024d 100644 --- a/src/views/deviceManage/components/listNoiseData.vue +++ b/src/views/deviceManage/components/listNoiseData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '噪声值', value: 'ddata', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listTempData.vue b/src/views/deviceManage/components/listTempData.vue index bf8136e..d2e6272 100644 --- a/src/views/deviceManage/components/listTempData.vue +++ b/src/views/deviceManage/components/listTempData.vue @@ -22,7 +22,15 @@ - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + + - + + + 温度 + + + 湿度 + + + a.uptime < b.uptime ? -1 : 1) this.list = data this.chartData.rows = data + this.chartData2.rows = data this.listLoading = false }).catch(_ => this.listLoading = false) }, diff --git a/src/views/deviceManage/components/listTempPressData.vue b/src/views/deviceManage/components/listTempPressData.vue new file mode 100644 index 0000000..c41efa3 --- /dev/null +++ b/src/views/deviceManage/components/listTempPressData.vue @@ -0,0 +1,175 @@ + + + + + diff --git a/src/views/deviceManage/components/listTubeData.vue b/src/views/deviceManage/components/listTubeData.vue index 0bdd2bb..9cd3930 100644 --- a/src/views/deviceManage/components/listTubeData.vue +++ b/src/views/deviceManage/components/listTubeData.vue @@ -69,7 +69,7 @@ { text: '上报时间', value: 'uptime', align: 'center' }, { text: '燃气浓度(%LEL)', value: 'strength', align: 'center' } ], // 显示列 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellLocaData.vue b/src/views/deviceManage/components/listWellLocaData.vue index 12aa64d..f1dc9de 100644 --- a/src/views/deviceManage/components/listWellLocaData.vue +++ b/src/views/deviceManage/components/listWellLocaData.vue @@ -70,7 +70,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/components/listWellcoverData.vue b/src/views/deviceManage/components/listWellcoverData.vue index a1d5ebc..5e3d69b 100644 --- a/src/views/deviceManage/components/listWellcoverData.vue +++ b/src/views/deviceManage/components/listWellcoverData.vue @@ -69,7 +69,7 @@ headConfig: { show: false }, // 表格头配置 - list: [], // 里诶博爱数据 + list: [], // 列表数据 listLoading: false, pickerOptions: { disabledDate(time) { // 限制只能选100天内的时间 diff --git a/src/views/deviceManage/detailDevice.vue b/src/views/deviceManage/detailDevice.vue index f67d504..d51a8ce 100644 --- a/src/views/deviceManage/detailDevice.vue +++ b/src/views/deviceManage/detailDevice.vue @@ -20,6 +20,10 @@ {{ deviceForm.onlineStateName }} + + {{ deviceForm.cell }} + + {{ deviceForm.installHeight?deviceForm.installHeight+' m':'--' }} @@ -56,10 +60,12 @@ import listHydrantData from './components/listHydrantData' import listWellLocaData from './components/listWellLocaData' import ListH2SData from './components/listH2SData' +import SingleGasDetectorData from '@/views/deviceManage/components/listGasDetectorData' export default { name: 'EditDevice', components: { + SingleGasDetectorData, ListH2SData, listDigData, listGasData, @@ -104,6 +110,7 @@ '11': 'list-hydrant-data', '12': 'list-tube-data', '14': 'list-h2-s-data' + // '101': 'single-gas-detector-data' } // 组件对照表 } }, diff --git a/src/views/deviceManage/editDevice.vue b/src/views/deviceManage/editDevice.vue index d87cf41..1dbb51b 100644 --- a/src/views/deviceManage/editDevice.vue +++ b/src/views/deviceManage/editDevice.vue @@ -2,17 +2,29 @@ - - - - - + + + + + + + + + + + + - - - - - - - - - @@ -49,8 +47,6 @@ - - @@ -61,13 +57,13 @@ - - - - - - - + + + + + + +