Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 39093641d8 | |||
|
|
c88484caf7 |
@@ -8,12 +8,14 @@
|
||||
"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-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-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"
|
||||
|
||||
@@ -72,21 +72,21 @@ export function getDicTree() {
|
||||
}
|
||||
export function getDicTreeAdd(data) {
|
||||
return request({
|
||||
url: '/system-boot/dic/add',
|
||||
url: '/system-boot/dictTree/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function getDicTreeUpdate(data) {
|
||||
return request({
|
||||
url: '/system-boot/dic/update',
|
||||
url: '/system-boot/dictTree/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function getDicTreeDelete(data) {
|
||||
return request({
|
||||
url: '/system-boot/dic/delete',
|
||||
url: '/system-boot/dictTree/delete',
|
||||
method: 'delete',
|
||||
params: data
|
||||
})
|
||||
|
||||
@@ -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) {
|
||||
let { accessToken, pathname } = getURLParameter('accessToken')
|
||||
console.log('🚀 ~ accessToken:', accessToken, pathname)
|
||||
// getURLParameter
|
||||
if (accessToken) {
|
||||
// 超高压嵌入 接受父应用传参
|
||||
window.addEventListener(
|
||||
'message',
|
||||
event => {
|
||||
if (event.data && event.data.type === 'iframeNest') {
|
||||
let { accessToken, displayMode, theme } = event.data
|
||||
console.log('我是iframe,我接收到了数据:', accessToken)
|
||||
console.log('超高压嵌入')
|
||||
productionManagementCheck({
|
||||
token: accessToken
|
||||
}).then(res => {
|
||||
console.log('🚀 ~ receiveMessageFromOutside ~ res:', res)
|
||||
if (res.code == 'A0000') {
|
||||
proceed(to, from, next)
|
||||
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
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
if (process.env.VUE_APP_KEY == 'scqr') {
|
||||
flag = true
|
||||
next(to.path)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}, 500)
|
||||
})
|
||||
.catch(error => {
|
||||
@@ -238,9 +292,14 @@ async function proceed(to, from, next, HB_NAME) {
|
||||
})
|
||||
})
|
||||
})
|
||||
} else {
|
||||
if (process.env.VUE_APP_KEY == 'scqr') {
|
||||
flag = true
|
||||
next(to.path)
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getmuen(data) {
|
||||
|
||||
@@ -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 }
|
||||
},
|
||||
{
|
||||
|
||||
@@ -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'){
|
||||
|
||||
@@ -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
|
||||
},
|
||||
|
||||
@@ -38,11 +38,7 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<timeindex
|
||||
:id="id"
|
||||
ref="fff"
|
||||
:interval="interval"
|
||||
></timeindex>
|
||||
<timeindex :id="id" ref="fff" :interval="interval" :pushForward="true"></timeindex>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="querfromdata" icon="el-icon-search">查询</el-button>
|
||||
@@ -235,7 +231,7 @@
|
||||
<script>
|
||||
import { getheight } from '../../assets/commjs/common'
|
||||
import { A, B, C, AB, BC, CA } from '../../assets/commjs/color'
|
||||
import timeindex from'@/views/cgy-components/cgytree/TimeintervalTemplat.vue'
|
||||
import timeindex from '@/views/cgy-components/cgytree/TimeintervalTemplat.vue'
|
||||
import pagination from '@/views/cgy-components/pagination/index'
|
||||
import api from '@/api/harmonic/onlineData'
|
||||
import FileSaver from 'file-saver'
|
||||
@@ -351,7 +347,7 @@ export default {
|
||||
searchBeginTime: '',
|
||||
searchEndTime: ''
|
||||
},
|
||||
interval: 4,
|
||||
interval: 5,
|
||||
device: 1,
|
||||
limit: 8,
|
||||
limit2: 8,
|
||||
@@ -554,6 +550,8 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.vh = window.sessionStorage.getItem('appheight') - 120
|
||||
this.$refs.fff.buttonShow=false
|
||||
this.$refs.fff.interchange(5)
|
||||
this.querfromdata()
|
||||
},
|
||||
methods: {
|
||||
@@ -693,12 +691,10 @@ export default {
|
||||
|
||||
// this.formData.searchBeginTime = this.$refs.fff.timeValue[0];
|
||||
// this.formData.searchEndTime = this.$refs.fff.timeValue[1];
|
||||
this.formData.searchBeginTime =this.$refs.fff.intervald == 5
|
||||
? this.$refs.fff.DayTime
|
||||
: this.$refs.fff.timeValue[0]
|
||||
this.formData.searchEndTime =this.$refs.fff.intervald == 5
|
||||
? this.$refs.fff.DayTime
|
||||
: this.$refs.fff.timeValue[1]
|
||||
this.formData.searchBeginTime =
|
||||
this.$refs.fff.intervald == 5 ? this.$refs.fff.DayTime : this.$refs.fff.timeValue[0]
|
||||
this.formData.searchEndTime =
|
||||
this.$refs.fff.intervald == 5 ? this.$refs.fff.DayTime : this.$refs.fff.timeValue[1]
|
||||
this.formData.condition = this.value
|
||||
this.formData.inHarmonics = this.inharmonic
|
||||
if (this.number == 111) {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -25,8 +25,10 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (process.env.VUE_APP_MODE === 'cgyqr') {
|
||||
if (process.env.VUE_APP_KEY != 'scqr') {
|
||||
this.guanzhou()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
|
||||
@@ -335,8 +335,10 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (process.env.VUE_APP_MODE === 'cgyqr') {
|
||||
if (process.env.VUE_APP_KEY != 'scqr') {
|
||||
this.guanzhou()
|
||||
}
|
||||
}
|
||||
this.getIndexType()
|
||||
//this.time()
|
||||
},
|
||||
|
||||
@@ -31,8 +31,10 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (process.env.VUE_APP_MODE === 'cgyqr') {
|
||||
if (process.env.VUE_APP_KEY != 'scqr') {
|
||||
this.guanzhou()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
||||
@@ -1,57 +1,59 @@
|
||||
<template>
|
||||
<div class="pa10">
|
||||
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick" style="height:calc(100vh - 20px)">
|
||||
<el-tabs type="border-card" v-model="activeName" @tab-click="handleClick" style="height: calc(100vh - 20px)">
|
||||
<el-tab-pane label="监测点数据查询" name="first">
|
||||
<onlineData ></onlineData>
|
||||
<onlineData></onlineData>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="监测点台账信息" name="second">
|
||||
<devicemessage ></devicemessage>
|
||||
<devicemessage></devicemessage>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="终端台账信息" name="third">
|
||||
<terminalmessage > </terminalmessage>
|
||||
<terminalmessage></terminalmessage>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="数据完整性统计" name="sen">
|
||||
<integralitytable ></integralitytable>
|
||||
<integralitytable></integralitytable>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import onlineData from "@/views/cgy-harmonic-boot/monitor/onlineData";
|
||||
import terminalmessage from "@/views/cgy-harmonic-boot/runmange/terminalmessage";
|
||||
import devicemessage from "@/views/cgy-harmonic-boot/runmange/devicemessage";
|
||||
import integralitytable from "@/views/cgy-harmonic-boot/area/integralitytable";
|
||||
import onlineData from '@/views/cgy-harmonic-boot/monitor/onlineData'
|
||||
import terminalmessage from '@/views/cgy-harmonic-boot/runmange/terminalmessage'
|
||||
import devicemessage from '@/views/cgy-harmonic-boot/runmange/devicemessage'
|
||||
import integralitytable from '@/views/cgy-harmonic-boot/area/integralitytable'
|
||||
import api1 from '@/api/pollution/pollution'
|
||||
export default {
|
||||
components: {
|
||||
onlineData,
|
||||
devicemessage,
|
||||
terminalmessage,
|
||||
integralitytable,
|
||||
integralitytable
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeName:'first',
|
||||
vh:null
|
||||
};
|
||||
activeName: 'first',
|
||||
vh: null
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (process.env.VUE_APP_MODE === 'cgyqr') {
|
||||
if (process.env.VUE_APP_KEY != 'scqr') {
|
||||
this.guanzhou()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.vh = window.sessionStorage.getItem('appheight')-12+'px'
|
||||
this.vh = window.sessionStorage.getItem('appheight') - 12 + 'px'
|
||||
},
|
||||
methods: {
|
||||
guanzhou(){
|
||||
var data ={
|
||||
token:this.$route.query.token
|
||||
guanzhou() {
|
||||
var data = {
|
||||
token: this.$route.query.token
|
||||
}
|
||||
api1.guanzhou(data).then(res=>{
|
||||
if(res.code=='A0000'){
|
||||
api1.guanzhou(data).then(res => {
|
||||
if (res.code == 'A0000') {
|
||||
return
|
||||
}else{
|
||||
} else {
|
||||
this.$router.push('/error/massege/403')
|
||||
}
|
||||
})
|
||||
@@ -60,14 +62,14 @@ export default {
|
||||
// console.log(tab, event);
|
||||
this.activeName = tab.name
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.pa10 {
|
||||
padding: 10px;
|
||||
}
|
||||
::v-deep .el-tabs--border-card>.el-tabs__content {
|
||||
::v-deep .el-tabs--border-card > .el-tabs__content {
|
||||
padding: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -37,8 +37,11 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (process.env.VUE_APP_MODE === 'cgyqr') {
|
||||
// this.guanzhou()
|
||||
if (process.env.VUE_APP_KEY != 'scqr') {
|
||||
this.guanzhou()
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
|
||||
@@ -202,14 +202,14 @@
|
||||
type="danger"
|
||||
size="small"
|
||||
v-if="scope.row.type === 1"
|
||||
style="color: red"
|
||||
style="color: #008000"
|
||||
>开机策略</el-tag
|
||||
>
|
||||
<el-tag
|
||||
type="primary"
|
||||
size="small"
|
||||
v-if="scope.row.type === 2"
|
||||
style="color: green"
|
||||
style="color: #991717"
|
||||
>关机策略</el-tag
|
||||
>
|
||||
</template>
|
||||
@@ -256,7 +256,7 @@
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
<!-- <el-table-column
|
||||
width="150"
|
||||
align="center"
|
||||
prop="wind"
|
||||
@@ -268,7 +268,7 @@
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center" prop="sjfw" label="涉及范围" >
|
||||
<el-table-column align="center" prop="sjfw" label="涉及范围" >
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="scope.row.sjfw==0" @click="confingview(scope.row)" type="primary" size="mini">配置</el-button>
|
||||
<el-button v-if="scope.row.sjfw==1" type="primary" size="mini">查看</el-button>
|
||||
@@ -283,12 +283,18 @@
|
||||
>查看</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="scope.row.status === 0"
|
||||
type="primary"
|
||||
size="mini"
|
||||
@click="edit(scope.row.id)"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="scope.row.status === 1"
|
||||
type="primary"
|
||||
@click="stopAirStrategy(scope.row.id)"
|
||||
size="mini"
|
||||
>停止</el-button
|
||||
>
|
||||
<!-- <el-button
|
||||
v-if="scope.row.status !== 1"
|
||||
type="primary"
|
||||
@@ -303,20 +309,14 @@
|
||||
size="mini"
|
||||
>执行</el-button
|
||||
>
|
||||
<el-button
|
||||
v-if="scope.row.status === 1"
|
||||
type="primary"
|
||||
@click="stopAirStrategy(scope.row.id)"
|
||||
size="mini"
|
||||
>停止</el-button
|
||||
>-->
|
||||
|
||||
<el-button
|
||||
v-if="scope.row.status === 2"
|
||||
@click="querydata(scope.row)"
|
||||
type="primary"
|
||||
size="mini"
|
||||
>趋势查看
|
||||
</el-button>
|
||||
</el-button>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -1330,64 +1330,7 @@ export default {
|
||||
this.get_bodyHeight();
|
||||
this.connectMqtt();
|
||||
|
||||
this.globalMqtt.ws.on("connect", (e) => {
|
||||
this.$message.success("连接mqtt服务器成功!");
|
||||
console.log("mqtt客户端已连接....");
|
||||
this.globalMqtt.ws.subscribe("/platform/devack/#");
|
||||
});
|
||||
|
||||
this.globalMqtt.ws.on("error", (error) => {
|
||||
console.log("mqtt连接失败...", error);
|
||||
this.mqtt.end();
|
||||
});
|
||||
|
||||
this.globalMqtt.ws.on("close", function () {
|
||||
console.log("mqtt客户端已断开连接.....");
|
||||
});
|
||||
|
||||
let index = 0;
|
||||
this.globalMqtt.ws.on("message", (topic, message) => {
|
||||
let that = this;
|
||||
if (message) {
|
||||
let json = JSON.parse(message);
|
||||
if (json.code === 200) {
|
||||
if (json.param.action === "ACInMode") {
|
||||
this.$message.success("内机模式调节成功!");
|
||||
} else if (json.param.action === "ACInSpeed") {
|
||||
this.$message.success("内机风速调节成功!");
|
||||
} else if (json.param.action === "ACInSetTmp") {
|
||||
this.$message.success("内机温度调节成功!");
|
||||
} else if (json.param.action === "ACInStat") {
|
||||
this.$message.success("内机开关机操作成功!");
|
||||
} else {
|
||||
this.$message.success("操作成功!");
|
||||
}
|
||||
|
||||
window.setTimeout(function () {
|
||||
that.getStatisTemplateById();
|
||||
}, 10000);
|
||||
} else {
|
||||
this.$message.error(json.msg);
|
||||
if (this.userIndex === json.userId) {
|
||||
this.mqttSendCount++;
|
||||
if (this.mqttSendCount > 2) {
|
||||
return;
|
||||
} else {
|
||||
this.globalMqtt.ws.publish(
|
||||
"/platform/devcmd/v1/" + this.devInfo.ndid,
|
||||
JSON.stringify(this.mqttSendMsg)
|
||||
);
|
||||
}
|
||||
|
||||
console.log("错误+++进行重发" + this.mqttSendCount);
|
||||
}
|
||||
}
|
||||
|
||||
this.buttonDisable = false;
|
||||
}
|
||||
|
||||
console.log("收到消息:" + topic + message);
|
||||
});
|
||||
|
||||
//如果别的页面路由过来的进行路由参数处理
|
||||
},
|
||||
@@ -1412,10 +1355,11 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
connectMqtt() {
|
||||
this.globalMqtt.ws = {};
|
||||
let this_ = this
|
||||
this_.globalMqtt.ws = {};
|
||||
let mqttWs = null;
|
||||
|
||||
let userName = this.$store.state.user.userInfo.loginName;
|
||||
let userName = this_.$store.state.user.userInfo.loginName;
|
||||
const options = {
|
||||
qos: 2,
|
||||
clean: true,
|
||||
@@ -1424,9 +1368,69 @@ export default {
|
||||
username: "t_user",
|
||||
password: "njcnpqs",
|
||||
};
|
||||
const url = "wss://pqmcn.com:8087/mqtt";
|
||||
const url = "ws://192.168.1.24:8085/mqtt";
|
||||
mqttWs = mqtt.connect(url, options);
|
||||
this.globalMqtt.setWs(mqttWs);
|
||||
this_.globalMqtt.setWs(mqttWs);
|
||||
|
||||
|
||||
this_.globalMqtt.ws.on("connect", (e) => {
|
||||
this_.$message.success("连接mqtt服务器成功!");
|
||||
console.log("mqtt客户端已连接....");
|
||||
this_.globalMqtt.ws.subscribe("/platform/devack/#");
|
||||
});
|
||||
|
||||
this_.globalMqtt.ws.on("error", (error) => {
|
||||
console.log("mqtt连接失败...", error);
|
||||
this.mqtt.end();
|
||||
});
|
||||
|
||||
this_.globalMqtt.ws.on("close", function () {
|
||||
console.log("mqtt客户端已断开连接.....");
|
||||
});
|
||||
|
||||
|
||||
this_.globalMqtt.ws.on("message", (topic, message) => {
|
||||
let that = this;
|
||||
if (message) {
|
||||
let json = JSON.parse(message);
|
||||
if (json.code === 200) {
|
||||
if (json.param.action === "ACInMode") {
|
||||
this_.$message.success("内机模式调节成功!");
|
||||
} else if (json.param.action === "ACInSpeed") {
|
||||
this_.$message.success("内机风速调节成功!");
|
||||
} else if (json.param.action === "ACInSetTmp") {
|
||||
this_.$message.success("内机温度调节成功!");
|
||||
} else if (json.param.action === "ACInStat") {
|
||||
this_.$message.success("内机开关机操作成功!");
|
||||
} else {
|
||||
this_.$message.success("操作成功!");
|
||||
}
|
||||
|
||||
window.setTimeout(function () {
|
||||
that.getStatisTemplateById();
|
||||
}, 10000);
|
||||
} else {
|
||||
this_.$message.error(json.msg);
|
||||
if (this_.userIndex === json.userId) {
|
||||
this_.mqttSendCount++;
|
||||
if (this_.mqttSendCount > 2) {
|
||||
return;
|
||||
} else {
|
||||
this_.globalMqtt.ws.publish(
|
||||
"/platform/devcmd/v1/" + this.devInfo.ndid,
|
||||
JSON.stringify(this.mqttSendMsg)
|
||||
);
|
||||
}
|
||||
|
||||
console.log("错误+++进行重发" + this.mqttSendCount);
|
||||
}
|
||||
}
|
||||
|
||||
this_.buttonDisable = false;
|
||||
}
|
||||
|
||||
console.log("收到消息:" + topic + message);
|
||||
});
|
||||
},
|
||||
//子节点树点击事件
|
||||
getTreeText(data, level) {
|
||||
@@ -2009,7 +2013,7 @@ window.echartsArr.push(myChart);
|
||||
switchChange(item, type) {
|
||||
console.log(item);
|
||||
console.log(type);
|
||||
console.log(this.devInfo.ndid);
|
||||
|
||||
|
||||
let msg = {
|
||||
mid: 1,
|
||||
@@ -2025,10 +2029,14 @@ window.echartsArr.push(myChart);
|
||||
},
|
||||
};
|
||||
|
||||
this.globalMqtt.ws.publish(
|
||||
"/platform/devcmd/v1/" + this.devInfo.ndid,
|
||||
JSON.stringify(msg)
|
||||
);
|
||||
let topic = "/platform/devcmd/v1/" + this.devInfo.ndid;
|
||||
console.log(topic);
|
||||
this.globalMqtt.ws.publish(topic, JSON.stringify(msg), { qos: 0 }, (err) => {
|
||||
if (err) console.error("发送失败:", err);
|
||||
else console.log("发送成功");
|
||||
})
|
||||
|
||||
|
||||
|
||||
this.mqttSendMsg = msg;
|
||||
this.mqttSendCount = 0;
|
||||
|
||||
@@ -51,7 +51,9 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
if (process.env.VUE_APP_KEY != 'scqr') {
|
||||
this.guanzhou()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
|
||||
@@ -48,7 +48,9 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (process.env.VUE_APP_KEY != 'scqr') {
|
||||
this.guanzhou()
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.setHeight()
|
||||
|
||||
@@ -75,7 +75,9 @@ export default {
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.guanzhou();
|
||||
if (process.env.VUE_APP_KEY != 'scqr') {
|
||||
this.guanzhou()
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<el-button @click="queryData()" type="primary" size="mini" style="margin-left:1%;" icon="el-icon-search">查询</el-button> -->
|
||||
<el-form :inline="true" :model="form" class="demo-form-inline">
|
||||
<el-form-item>
|
||||
<el-button @click="AddTypeClick" type="primary" icon="el-icon-plus">新增字典类型</el-button>
|
||||
<el-button @click="AddTypeClick" type="primary" icon="el-icon-plus">新增字典树类型</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-select
|
||||
|
||||
@@ -18,7 +18,7 @@ module.exports = {
|
||||
// publicPath: 'https://fuphoenixes.github.io/example/dist/',
|
||||
//publicPath: "./",
|
||||
// publicPath: process.env.VUE_APP_PATH,
|
||||
publicPath: process.env.NODE_ENV === 'development' ? './' : process.env.VUE_APP_MODE == 'jbqr' ? './' : '/',
|
||||
publicPath: './', //process.env.NODE_ENV === 'development' ? './' : process.env.VUE_APP_MODE == 'jbqr' ? './' : '/',
|
||||
outputDir: 'dist',
|
||||
assetsDir: 'static',
|
||||
// lintOnSave: process.env.NODE_ENV === 'development',
|
||||
@@ -37,9 +37,9 @@ module.exports = {
|
||||
'/api': {
|
||||
// target: 'http://18028358809.gnway.cc', //hsw
|
||||
// target: 'http://192.168.120.210:10215', //hsw
|
||||
target: 'http://192.168.1.29:10215', //超高压
|
||||
// target: 'http://192.168.1.28:10215', //超高压
|
||||
// target: "'https://pqmcn.com:8092/api", //治理
|
||||
// target: 'http://192.168.1.24:10215', // 河北
|
||||
target: 'http://192.168.1.24:10215', // 河北
|
||||
// target: "http://192.168.1.31:10215", // 海南
|
||||
// target: "http://192.168.1.29:10215", // 冀北
|
||||
changeOrigin: true,
|
||||
|
||||
Reference in New Issue
Block a user