diff --git a/package.json b/package.json index 47f4f4e..abcbc14 100644 --- a/package.json +++ b/package.json @@ -1,166 +1,168 @@ { - "name": "vue-pc-admin", - "version": "0.1.0", - "description": "这是一个基于 vue admin 管理后台", - "author": "caojinwei", - "license": "NJCN", - "scripts": { - "dev": "vue-cli-service serve", - "dev-zoom": "cross-env VUE_APP_ZOOM=1 vue-cli-service serve", - "dev-cgyqr": "cross-env VUE_APP_MODE=cgyqr vue-cli-service serve", - "dev-hbqr": "cross-env VUE_APP_MODE=cgyqr VUE_APP_HB=hbqr vue-cli-service serve", - "dev-jbqr": "cross-env VUE_APP_MODE=jbqr vue-cli-service serve", - "build": "vue-cli-service build", - "build-zoom": "cross-env VUE_APP_ZOOM=1 vue-cli-service build", - "build-hbqr": "cross-env VUE_APP_MODE=cgyqr VUE_APP_HB=hbqr vue-cli-service build", - "build-cgyqr": "cross-env VUE_APP_MODE=cgyqr vue-cli-service build", - "build-jbqr": "cross-env VUE_APP_MODE=jbqr vue-cli-service build", - "preview": "node build/index.js --preview", - "deploy-18": "cross-env VUE_APP_ZOOM=1 vue-cli-service build && ./upload_script/upload_18.sh" - }, - "dependencies": { - "@ckeditor/ckeditor5-vue": "^1.0.1", - "@jiaminghi/data-view": "^2.10.0", - "@riophae/vue-treeselect": "^0.4.0", - "@toast-ui/editor": "^2.0.1", - "@toast-ui/vue-editor": "^2.0.1", - "@vue/composition-api": "^1.3.0", - "@wangeditor/editor": "^5.1.23", - "@wangeditor/editor-for-vue": "^1.0.2", - "axios": "^0.27.2", - "baidu-map": "^0.1.4", - "bpmn-js": "^11.1.0", - "bpmn-js-bpmnlint": "^0.15.0", - "bpmnlint": "^6.4.0", - "bpmnlint-loader": "^0.1.4", - "codemirror": "5.39.2", - "core-js": "^2.6.12", - "cross-storage": "^1.0.0", - "crypto-js": "^4.2.0", - "deepmerge": "^4.2.2", - "driver.js": "^0.9.8", - "echarts": "^5.4.3", - "echarts-gl": "^2.0.9", - "echarts-liquidfill": "^3.1.0", - "el-tree-transfer": "^2.4.7", - "element-resize-detector": "^1.2.4", - "element-ui": "^2.15.9", - "exceljs": "^4.3.0", - "fabric": "^5.3.0", - "file-saver": "^2.0.5", - "form-gen-parser": "^1.0.3", - "highcharts": "^10.0.0", - "highcharts-vue": "^1.4.0", - "html2canvas": "^1.4.1", - "jquery": "^3.6.0", - "jquery.panzoom": "^3.2.3", - "js-cookie": "2.2.0", - "json2csv": "^5.0.6", - "less": "^4.1.2", - "less-loader": "^5.0.0", - "lib-flexible": "^0.3.2", - "lodash.clonedeep": "^4.5.0", - "luckyexcel": "^1.0.1", - "mqtt": "^4.3.6", - "normalize.css": "7.0.0", - "nprogress": "0.2.0", - "path-to-regexp": "2.4.0", - "qiniu-js": "^3.1.2", - "qrcodejs2": "^0.0.2", - "sanitizer": "^0.1.3", - "screenfull": "^5.0.2", - "session-storage-sync": "^0.6.0", - "sortablejs": "^1.10.2", - "spin.js": "^4.1.1", - "sync-session-storage": "^0.0.13", - "throttle-debounce": "^1.1.0", - "timeline-slider-vue": "^1.0.6", - "umy-ui": "^1.1.6", - "v-loading-plugin": "^1.0.7", - "vue": "2.6.10", - "vue-baidu-map": "^0.21.22", - "vue-drag-resize": "^1.5.4", - "vue-echarts": "^6.6.2", - "vue-grid-layout": "^2.3.12", - "vue-jsonp": "^2.0.0", - "vue-masonry": "^0.16.0", - "vue-particles": "^1.0.9", - "vue-resize-observer": "^2.0.16", - "vue-router": "3.0.6", - "vue-slider-component": "^3.2.24", - "vue-svg-filler": "^1.0.6", - "vuedraggable": "^2.24.3", - "vuex": "3.1.0", - "vxe-table": "3.6.6", - "vxe-table-plugin-export-xlsx": "2.2.2", - "webpack-theme-color-replacer": "^1.3.7", - "xe-utils": "^3.5.14", - "xlsx": "^0.15.6" - }, - "devDependencies": { - "@babel/core": "7.0.0", - "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", - "@babel/plugin-proposal-optional-chaining": "^7.21.0", - "@babel/plugin-transform-modules-commonjs": "^7.9.0", - "@babel/register": "7.0.0", - "@vue/cli-plugin-babel": "3.6.0", - "@vue/cli-service": "^3.12.1", - "@vue/test-utils": "1.0.0-beta.29", - "autoprefixer": "^9.5.1", - "babel-core": "7.0.0-bridge.0", - "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", - "babel-plugin-transform-remove-console": "^6.9.4", - "chalk": "2.4.2", - "compression-webpack-plugin": "^3.1.0", - "connect": "3.6.6", - "cross-env": "^7.0.3", - "css-properties-sorting": "^1.0.10", - "d3": "^7.1.1", - "default-passive-events": "^2.0.0", - "highlight.js": "9.18.5", - "html-webpack-plugin": "3.2.0", - "less": "^4.1.1", - "less-loader": "^5.0.0", - "lint-staged": "8.1.5", - "open": "^7.0.3", - "postcss-loader": "^3.0.0", - "px2rem-loader": "^0.1.9", - "raw-loader": "^0.5.1", - "runjs": "^4.3.2", - "sass": "^1.62.0", - "sass-loader": "^7.1.0", - "sass-resources-loader": "^2.0.3", - "script-ext-html-webpack-plugin": "2.1.3", - "script-loader": "0.7.2", - "serve-static": "^1.13.2", - "stylelint": "^12.0.1", - "stylelint-config-standard": "^20.0.0", - "stylelint-order": "^4.1.0", - "stylelint-scss": "^3.18.0", - "svg-sprite-loader": "4.1.3", - "svgo": "1.2.2", - "vkbeautify": "^0.99.3", - "vue-particles": "^1.0.9", - "vue-template-compiler": "2.6.10", - "vue2-ace-editor": "^0.0.15", - "xcrud": "^0.4.19" - }, - "lint-staged": { - "src/**/*.{js,vue}": [ - "git add" - ], - "src/**/*.{html,vue,css,sass,scss}": [ - "stylelint --fix", - "git add" + "name": "vue-pc-admin", + "version": "0.1.0", + "description": "这是一个基于 vue admin 管理后台", + "author": "caojinwei", + "license": "NJCN", + "scripts": { + "dev": "vue-cli-service serve", + "dev-zoom": "cross-env VUE_APP_ZOOM=1 vue-cli-service serve", + "dev-cgyqr": "cross-env VUE_APP_MODE=cgyqr vue-cli-service serve", + "dev-cgyqr1": "cross-env VUE_APP_MODE=cgyqr VUE_APP_KEY=scqr vue-cli-service serve", + "dev-hbqr": "cross-env VUE_APP_MODE=cgyqr VUE_APP_HB=hbqr VUE_APP_KEY=scqr vue-cli-service serve", + "dev-jbqr": "cross-env VUE_APP_MODE=jbqr vue-cli-service serve", + "build": "vue-cli-service build", + "build-zoom": "cross-env VUE_APP_ZOOM=1 vue-cli-service build", + "build-hbqr": "cross-env VUE_APP_MODE=cgyqr VUE_APP_HB=hbqr VUE_APP_KEY=scqr vue-cli-service build", + "build-cgyqr": "cross-env VUE_APP_MODE=cgyqr vue-cli-service build", + "build-cgyqr1": "cross-env VUE_APP_MODE=cgyqr VUE_APP_KEY=scqr vue-cli-service build", + "build-jbqr": "cross-env VUE_APP_MODE=jbqr vue-cli-service build", + "preview": "node build/index.js --preview", + "deploy-18": "cross-env VUE_APP_ZOOM=1 vue-cli-service build && ./upload_script/upload_18.sh" + }, + "dependencies": { + "@ckeditor/ckeditor5-vue": "^1.0.1", + "@jiaminghi/data-view": "^2.10.0", + "@riophae/vue-treeselect": "^0.4.0", + "@toast-ui/editor": "^2.0.1", + "@toast-ui/vue-editor": "^2.0.1", + "@vue/composition-api": "^1.3.0", + "@wangeditor/editor": "^5.1.23", + "@wangeditor/editor-for-vue": "^1.0.2", + "axios": "^0.27.2", + "baidu-map": "^0.1.4", + "bpmn-js": "^11.1.0", + "bpmn-js-bpmnlint": "^0.15.0", + "bpmnlint": "^6.4.0", + "bpmnlint-loader": "^0.1.4", + "codemirror": "5.39.2", + "core-js": "^2.6.12", + "cross-storage": "^1.0.0", + "crypto-js": "^4.2.0", + "deepmerge": "^4.2.2", + "driver.js": "^0.9.8", + "echarts": "^5.4.3", + "echarts-gl": "^2.0.9", + "echarts-liquidfill": "^3.1.0", + "el-tree-transfer": "^2.4.7", + "element-resize-detector": "^1.2.4", + "element-ui": "^2.15.9", + "exceljs": "^4.3.0", + "fabric": "^5.3.0", + "file-saver": "^2.0.5", + "form-gen-parser": "^1.0.3", + "highcharts": "^10.0.0", + "highcharts-vue": "^1.4.0", + "html2canvas": "^1.4.1", + "jquery": "^3.6.0", + "jquery.panzoom": "^3.2.3", + "js-cookie": "2.2.0", + "json2csv": "^5.0.6", + "less": "^4.1.2", + "less-loader": "^5.0.0", + "lib-flexible": "^0.3.2", + "lodash.clonedeep": "^4.5.0", + "luckyexcel": "^1.0.1", + "mqtt": "^4.3.6", + "normalize.css": "7.0.0", + "nprogress": "0.2.0", + "path-to-regexp": "2.4.0", + "qiniu-js": "^3.1.2", + "qrcodejs2": "^0.0.2", + "sanitizer": "^0.1.3", + "screenfull": "^5.0.2", + "session-storage-sync": "^0.6.0", + "sortablejs": "^1.10.2", + "spin.js": "^4.1.1", + "sync-session-storage": "^0.0.13", + "throttle-debounce": "^1.1.0", + "timeline-slider-vue": "^1.0.6", + "umy-ui": "^1.1.6", + "v-loading-plugin": "^1.0.7", + "vue": "2.6.10", + "vue-baidu-map": "^0.21.22", + "vue-drag-resize": "^1.5.4", + "vue-echarts": "^6.6.2", + "vue-grid-layout": "^2.3.12", + "vue-jsonp": "^2.0.0", + "vue-masonry": "^0.16.0", + "vue-particles": "^1.0.9", + "vue-resize-observer": "^2.0.16", + "vue-router": "3.0.6", + "vue-slider-component": "^3.2.24", + "vue-svg-filler": "^1.0.6", + "vuedraggable": "^2.24.3", + "vuex": "3.1.0", + "vxe-table": "3.6.6", + "vxe-table-plugin-export-xlsx": "2.2.2", + "webpack-theme-color-replacer": "^1.3.7", + "xe-utils": "^3.5.14", + "xlsx": "^0.15.6" + }, + "devDependencies": { + "@babel/core": "7.0.0", + "@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6", + "@babel/plugin-proposal-optional-chaining": "^7.21.0", + "@babel/plugin-transform-modules-commonjs": "^7.9.0", + "@babel/register": "7.0.0", + "@vue/cli-plugin-babel": "3.6.0", + "@vue/cli-service": "^3.12.1", + "@vue/test-utils": "1.0.0-beta.29", + "autoprefixer": "^9.5.1", + "babel-core": "7.0.0-bridge.0", + "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2", + "babel-plugin-transform-remove-console": "^6.9.4", + "chalk": "2.4.2", + "compression-webpack-plugin": "^3.1.0", + "connect": "3.6.6", + "cross-env": "^7.0.3", + "css-properties-sorting": "^1.0.10", + "d3": "^7.1.1", + "default-passive-events": "^2.0.0", + "highlight.js": "9.18.5", + "html-webpack-plugin": "3.2.0", + "less": "^4.1.1", + "less-loader": "^5.0.0", + "lint-staged": "8.1.5", + "open": "^7.0.3", + "postcss-loader": "^3.0.0", + "px2rem-loader": "^0.1.9", + "raw-loader": "^0.5.1", + "runjs": "^4.3.2", + "sass": "^1.62.0", + "sass-loader": "^7.1.0", + "sass-resources-loader": "^2.0.3", + "script-ext-html-webpack-plugin": "2.1.3", + "script-loader": "0.7.2", + "serve-static": "^1.13.2", + "stylelint": "^12.0.1", + "stylelint-config-standard": "^20.0.0", + "stylelint-order": "^4.1.0", + "stylelint-scss": "^3.18.0", + "svg-sprite-loader": "4.1.3", + "svgo": "1.2.2", + "vkbeautify": "^0.99.3", + "vue-particles": "^1.0.9", + "vue-template-compiler": "2.6.10", + "vue2-ace-editor": "^0.0.15", + "xcrud": "^0.4.19" + }, + "lint-staged": { + "src/**/*.{js,vue}": [ + "git add" + ], + "src/**/*.{html,vue,css,sass,scss}": [ + "stylelint --fix", + "git add" + ] + }, + "engines": { + "node": ">=8.9", + "npm": ">= 3.0.0" + }, + "browserslist": [ + "> 1%", + "last 2 versions", + "not ie <= 11" ] - }, - "engines": { - "node": ">=8.9", - "npm": ">= 3.0.0" - }, - "browserslist": [ - "> 1%", - "last 2 versions", - "not ie <= 11" - ] } diff --git a/src/permission.js b/src/permission.js index eea8552..e66e048 100644 --- a/src/permission.js +++ b/src/permission.js @@ -18,7 +18,12 @@ const cgyList = [ '/Statistical-analysis/baselineLevelAssessment', '/Statistical-analysis/substationBackgroundHarmonic', '/Statistical-analysis/steadyStateIndicators', - '/Statistical-analysis/transientIndicators' + '/Statistical-analysis/transientIndicators', + '/harmonicWave/homePage', + '/harmonicWave/pointmonitoring', + '/harmonicWave/regionalmonitoring', + '/harmonicWave/comprehensiveanalysis', + '/harmonicWave/CVT' ] // 免登录判断 import { sm2, encrypt } from '@/assets/commjs/sm2.js' @@ -26,7 +31,11 @@ import { sm3Digest } from '@/assets/commjs/sm3' import { setDictype, setSysConfig } from '@/utils/auth' import { gongkey, CodeSr, heBeiToken, menulist, updateFirstPassword, dictypeData, getSysConfig } from '@/api/user' let routerPath = '' +let flag = false router.beforeEach(async (to, from, next) => { + console.log('🚀 ~ to:', to) + console.log('🚀 ~ getURLParameter ~ window.location.href:', window.location.href) + // start progress bar // NProgress.start() @@ -42,6 +51,10 @@ router.beforeEach(async (to, from, next) => { // 超高压河北免登录功能 if (process.env.VUE_APP_MODE === 'cgyqr') { + if (flag) { + flag = false + return next() + } if (process.env.VUE_APP_HB == 'hbqr') { // let data = JSON.parse(sessionStorage.getItem('userInfo1')) // if (data.userToken == sessionStorage.getItem('HB_TOKEN')) { @@ -53,7 +66,10 @@ router.beforeEach(async (to, from, next) => { // window.sessionStorage.removeItem('cntoken') // sessionStorage.setItem('HB_TOKEN', data.userToken) // setTimeout(() => { - proceed(to, from, next, 'cdf') + + // console.log('🚀 ~ getURLParameter ~ url:', url) + + proceed({ path: window.location.href.split('#')[1].split('&')[0] }, from, next, 'cdf') // }, 10) // } @@ -86,30 +102,22 @@ router.beforeEach(async (to, from, next) => { // }) // } } else { - const response = await fetch('/') - const flag = response.headers.get('X-Xbqr') - console.log('🚀 ~ flag:', flag) + // const response = await fetch('/') + // const flag = response.headers.get('X-Xbqr') - if (flag) { - // 超高压嵌入 接受父应用传参 - window.addEventListener( - 'message', - event => { - if (event.data && event.data.type === 'iframeNest') { - let { accessToken, displayMode, theme } = event.data - console.log('我是iframe,我接收到了数据:', accessToken) - productionManagementCheck({ - token: accessToken - }).then(res => { - console.log('🚀 ~ receiveMessageFromOutside ~ res:', res) - if (res.code == 'A0000') { - proceed(to, from, next) - } - }) + let { accessToken, pathname } = getURLParameter('accessToken') + console.log('🚀 ~ accessToken:', accessToken, pathname) + // getURLParameter + if (accessToken) { + // 超高压嵌入 接受父应用传参 + console.log('超高压嵌入') + productionManagementCheck({ + token: accessToken + }).then(res => { + if (res.code == 'A0000') { + proceed({ path: pathname || to.path }, from, next, 'cdf1') } - }, - false - ) + }) } else { proceed(to, from, next) } @@ -156,6 +164,45 @@ router.beforeEach(async (to, from, next) => { } } }) +// 解析 URL 参数 +function getURLParameter(name) { + // 获取当前页面的 URL + const url = window.location.href + // console.log('🚀 ~ getURLParameter ~ url:', url) + + // 使用 URL 对象解析 URL + const urlObj = new URL(url) + console.log('🚀 ~ getURLParameter ~ urlObj:', urlObj) + + // 获取查询参数 + const params = new URLSearchParams(urlObj.search) + console.log(params.get(name)) // 输出: 123 + console.log('pathname', urlObj.pathname) // 输出: 123 + // 获取 id 参数 + return { + accessToken: params.get('accessToken'), + pathname: urlObj.pathname + } +} +function getURLParameterHb(name) { + // 获取当前页面的 URL + const url = window.location.href + // console.log('🚀 ~ getURLParameter ~ url:', url) + + // 使用 URL 对象解析 URL + const urlObj = new URL(url) + console.log('🚀 ~ getURLParameter ~ urlObj:', urlObj) + + // 获取查询参数 + const params = new URLSearchParams(urlObj.search) + console.log(params.get(name)) // 输出: 123 + console.log('pathname', urlObj.pathname) // 输出: 123 + // 获取 id 参数 + return { + accessToken: params.get('accessToken'), + pathname: urlObj.pathname + } +} async function proceed(to, from, next, HB_NAME) { // 打印当前 name 和 sessionStorage 中 cntoken 是否为空的日志 @@ -222,12 +269,19 @@ async function proceed(to, from, next, HB_NAME) { // cgyList.indexOf(to.path) !== -1 store.dispatch('user/getmenu').then(async response => { await getmuen(response.data[0]) + router.push({ path: cgyList.indexOf(to.path) !== -1 ? to.path : to.path //routerPath }) }) } - next() + + if (process.env.VUE_APP_KEY == 'scqr') { + flag = true + next(to.path) + } else { + next() + } }, 500) }) .catch(error => { @@ -239,7 +293,12 @@ async function proceed(to, from, next, HB_NAME) { }) }) } else { - next() + if (process.env.VUE_APP_KEY == 'scqr') { + flag = true + next(to.path) + } else { + next() + } } } diff --git a/src/router/index.js b/src/router/index.js index 784623a..9d50c1d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -86,6 +86,37 @@ export const constantRoutes = [ component: () => import('@/views/cgy-harmonic-boot/UPHomePage'), meta: { title: '信息概览', icon: 'user' } }, + // 生产管控 + { + path: '/harmonicWave/pointmonitoring', + name: 'pointmonitoring', + component: () => import('@/views/cgy-harmonic-boot/line/pointmonitoring'), + meta: { title: '详细数据', icon: '' } + }, + { + path: '/harmonicWave/regionalmonitoring', + name: 'regionalmonitoring', + component: () => import('@/views/cgy-harmonic-boot/region/regionalmonitoring'), + meta: { title: '告警统计', icon: '' } + }, + { + path: '/harmonicWave/comprehensiveanalysis', + name: 'comprehensiveanalysis', + component: () => import('@/views/cgy-harmonic-boot/comper/comprehensiveanalysis'), + meta: { title: '综合分析', icon: '' } + }, + { + path: '/harmonicWave/CVT', + name: 'CVT', + component: () => import('@/views/cgy-harmonic-boot/CVT'), + meta: { title: 'CVT台账管理', icon: '' } + }, + { + path: '/harmonicWave/homePage', + name: 'homePage', + component: () => import('@/views/cgy-harmonic-boot/UPHomePage'), + meta: { title: '信息概览', icon: 'user' } + }, // 冀北嵌入 { @@ -192,9 +223,9 @@ export const asyncRoutes = [ path: '/dashboard/index', name: 'index', component: () => - // import ("@/views/dashboard/index"), - import('@/views/harmonic-boot/detailed/qypowerpollutionzs'), - //import('@/views/energy-system/operationalCenter/airManageReadOnly.vue'), + import ("@/views/dashboard/index"), + // import('@/views/harmonic-boot/detailed/qypowerpollutionzs'), + // import('@/views/energy-system/operationalCenter/airManageReadOnly.vue'), meta: { title: '首页概览', icon: '', affix: true } }, { diff --git a/src/utils/request.js b/src/utils/request.js index 94ff173..ed54c9c 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -7,10 +7,11 @@ import { CodeSr } from '@/api/user' axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8' const service = axios.create({ + // baseURL: '/harmonicWaveApi',//超高压生产嵌入 + // baseURL: '/PMS3/Application/third/aqcp-dnzl/harmonicWaveApi',//河北嵌入 baseURL: '/api', timeout: 150000 }) - // service.interceptors.request.use( // config => { // if(config.url !=='/pqs-oauth2/oauth/token' || config.params.grant_type=='refresh_token'){ diff --git a/src/views/Statistical-analysis/indicatorClassification/SubstationsClassification.vue b/src/views/Statistical-analysis/indicatorClassification/SubstationsClassification.vue index 7c7fbb2..af06472 100644 --- a/src/views/Statistical-analysis/indicatorClassification/SubstationsClassification.vue +++ b/src/views/Statistical-analysis/indicatorClassification/SubstationsClassification.vue @@ -539,7 +539,7 @@ export default { } option1 = { title: { - text: '变电站稳态超标数量', + text: '变电站暂态超标数量', left: 'center', top: 10 }, @@ -777,7 +777,7 @@ export default { } option2 = { title: { - text: '变电站稳态超标天数', + text: '变电站暂态超标天数', left: 'center', top: 20 }, diff --git a/src/views/cgy-components/abnormaldataalarm.vue b/src/views/cgy-components/abnormaldataalarm.vue index 327dea2..3fc1105 100644 --- a/src/views/cgy-components/abnormaldataalarm.vue +++ b/src/views/cgy-components/abnormaldataalarm.vue @@ -38,11 +38,7 @@ - + 查询 @@ -93,7 +89,7 @@