修改厂区登录后直接跳转到大屏页面

main
jinna 2 years ago
parent b24c28cd61
commit f01a3e5566
  1. 26
      src/page/login/userlogin.vue
  2. 24
      src/views/energySources/component/all.vue
  3. 16
      src/views/energySources/component/dmodal.vue
  4. 20
      src/views/energySources/component/dosage.vue
  5. 16
      src/views/energySources/component/emodal.vue
  6. 16
      src/views/energySources/component/equipmentAnalyze.vue
  7. 16
      src/views/energySources/component/equipmentLoad.vue
  8. 22
      src/views/energySources/component/equipmentStatus.vue
  9. 10
      src/views/energySources/component/header.vue
  10. 13
      src/views/energySources/component/load.vue
  11. 52
      src/views/energySources/index.vue

@ -62,7 +62,6 @@ import { info } from "@/api/system/tenant";
import { getCaptcha } from "@/api/user";
import { getTopUrl } from "@/util/util";
import { setStore, getStore, removeStore } from "@/util/store";
import {getDeptTree} from "@/api/system/dept"
export default {
name: "userlogin",
@ -151,6 +150,7 @@ export default {
},
checked: false,
deptData:[],
deptName:'',
};
},
created() {
@ -192,13 +192,6 @@ export default {
},
props: [],
methods: {
// getDept(){
// getDeptTree().then(res => {
// console.log('res ====>',res)
// // const column = this.findObject(this.option.column, "parentId");
// // column.dicData = res.data.data;
// });
// },
refreshCode() {
if (this.website.captchaMode) {
getCaptcha().then(res => {
@ -223,17 +216,7 @@ export default {
this.handleLogin();
done();
},
// getAllIds(tree, result) {
// // id
// for (const i in tree) {
// result.push(tree[i].id); //
// if (tree[i].children) {
// //
// getAllIds(tree[i].children, result);
// }
// }
// return result;
// },
handleLogin() {
this.$refs.loginForm.validate(valid => {
if (valid) {
@ -264,9 +247,12 @@ export default {
return false;
}
}
// console.log('user ==========>',this.userInfo)
console.log('user ==========>',this.userInfo)
if(this.userInfo.role_name == '政府大屏'){
this.$router.push({ path: '/energySourcesProvince/index' });
}else if(this.userInfo.role_name == '厂区大屏'){
this.$router.push({ path: '/energySources/index',query:{deptId:this.userInfo.dept_id} });
}else{
this.$router.push({ path: this.tagWel.value });
}

@ -86,6 +86,12 @@ import tit from "./tit.vue";
import { mapGetters } from "vuex";
import {getTotalElectricity,getMonthElectricity} from "@/api/energySources/energySources"
export default {
props: {
deptName: {
type: String,
default: "",
},
},
data() {
return {
num: 0,
@ -104,13 +110,15 @@ export default {
},
created() {
this.selectMonth = this.$moment().format('YYYY-MM')
this.getTotal()
this.$nextTick(() => {
this.getTrend()
})
this.timeFun = setInterval(() => {
if(this.deptName){
this.getTotal()
}, 300000)
this.$nextTick(() => {
this.getTrend()
})
this.timeFun = setInterval(() => {
this.getTotal()
}, 300000)
}
},
beforeDestroyed() {
clearInterval(this.timeFun)
@ -120,7 +128,7 @@ export default {
},
methods: {
getTotal(){
getTotalElectricity({manufacturerBrand:this.userInfo.dept_name}).then(res =>{
getTotalElectricity({manufacturerBrand:this.deptName}).then(res =>{
let data = res.data.data
this.yearNum = data.currentYear.toString().split('')
this.monthNum = data.currentMonth.toString().split('')
@ -131,7 +139,7 @@ export default {
getTrend(){
this.currentMonthData = [];
this.lastMonthData = []
getMonthElectricity({manufacturerBrand:this.userInfo.dept_name,currentMonth:this.selectMonth}).then(res =>{
getMonthElectricity({manufacturerBrand:this.deptName,currentMonth:this.selectMonth}).then(res =>{
let currData = res.data.data.currentMonth
let lastData = res.data.data.lastMonth
Object.keys(currData).forEach((key) => {

@ -43,6 +43,12 @@ import tit from "./tit.vue";
import { mapGetters } from "vuex";
import { getPeriodElectricity, getInstrumentRunDetail } from "@/api/energySources/energySources"
export default {
props: {
deptName: {
type: String,
default: "",
},
},
data() {
return {
tableData: [],
@ -77,18 +83,20 @@ export default {
...mapGetters(["userInfo", "permission"]),
},
created() {
this.getTableData()
if(this.deptName){
this.getTableData()
}
// this.getData()
},
methods: {
getTableData() {
getPeriodElectricity({ manufacturerBrand: this.userInfo.dept_name }).then(res => {
getPeriodElectricity({ manufacturerBrand: this.deptName }).then(res => {
this.options = res.data.data
// this.value = this.options[0].name
})
},
getData() {
getInstrumentRunDetail({ manufacturerBrand: this.userInfo.dept_name, today: this.selectDay, name: this.value }).then(res => {
getInstrumentRunDetail({ manufacturerBrand: this.deptName, today: this.selectDay, name: this.value }).then(res => {
console.log(res)
this.tableData = res.data.records
this.total = res.data.total
@ -96,7 +104,7 @@ export default {
},
getData() {
getInstrumentRunDetail({
manufacturerBrand: this.userInfo.dept_name,
manufacturerBrand: this.deptName,
today: this.selectDay,
name: this.value,
current: this.current,

@ -92,6 +92,12 @@ import dmodal from "./dmodal.vue";
import { mapGetters } from "vuex";
import { getPeriodElectricity } from "@/api/energySources/energySources"
export default {
props: {
deptName: {
type: String,
default: "",
},
},
data() {
return {
selectDay: '',
@ -106,14 +112,12 @@ export default {
},
created() {
this.selectDay = this.$moment().format('YYYY-MM-DD')
this.getPeriodData()
// this.$nextTick(() => {
// this.echartsInit()
// })
this.timeFun = setInterval(() => {
if(this.deptName){
this.getPeriodData()
}, 300000)
this.timeFun = setInterval(() => {
this.getPeriodData()
}, 300000)
}
},
beforeDestroyed() {
clearInterval(this.timeFun)
@ -148,7 +152,7 @@ export default {
}
},
getPeriodData() {
getPeriodElectricity({ manufacturerBrand: this.userInfo.dept_name, today: this.selectDay }).then(res => {
getPeriodElectricity({ manufacturerBrand: this.deptName, today: this.selectDay }).then(res => {
console.log('period =====>', res)
this.tableData = res.data.data
})

@ -43,6 +43,12 @@ import tit from "./tit.vue";
import { mapGetters } from "vuex";
import { getInstrumentActLoad, getInstrumentRunDetail } from "@/api/energySources/energySources"
export default {
props: {
deptName: {
type: String,
default: "",
},
},
data() {
return {
tableData: [],
@ -73,11 +79,15 @@ export default {
...mapGetters(["userInfo", "permission"]),
},
created() {
this.getTableData()
if(this.deptName){
this.getTableData()
}
},
methods: {
getTableData() {
getInstrumentActLoad({ manufacturerBrand: this.userInfo.dept_name }).then(res => {
getInstrumentActLoad({ manufacturerBrand: this.deptName }).then(res => {
this.options = res.data.data
// this.value = this.options[0].name
@ -85,7 +95,7 @@ export default {
},
getData() {
getInstrumentRunDetail({
manufacturerBrand: this.userInfo.dept_name,
manufacturerBrand: this.deptName,
today: this.$moment().format('yyyy-MM-DD'),
name: this.value,
current: this.current,

@ -56,6 +56,12 @@ import tit from "./tit.vue";
import { mapGetters } from "vuex";
import { getInstrumentDaylyLoad } from "@/api/energySources/energySources"
export default {
props: {
deptName: {
type: String,
default: "",
},
},
data() {
return {
selectDay: "",
@ -71,10 +77,12 @@ export default {
},
created() {
this.selectDay = this.$moment().format('YYYY-MM-DD')
this.getTotalData()
this.timeFun = setInterval(() => {
if(this.deptName){
this.getTotalData()
}, 300000)
this.timeFun = setInterval(() => {
this.getTotalData()
}, 300000)
}
},
beforeDestroyed() {
clearInterval(this.timeFun)
@ -84,7 +92,7 @@ export default {
this.getTotalData()
},
getTotalData() {
getInstrumentDaylyLoad({ manufacturerBrand: this.userInfo.dept_name, today: this.selectDay }).then(res => {
getInstrumentDaylyLoad({ manufacturerBrand: this.deptName, today: this.selectDay }).then(res => {
this.tableData = res.data.data;
// this.yearNum = data.currentYear.toString().split('')
// this.monthNum = data.currentMonth.toString().split('')

@ -31,6 +31,12 @@ import emodal from "./emodal.vue";
import { mapGetters } from "vuex";
import { getInstrumentActLoad } from "@/api/energySources/energySources"
export default {
props: {
deptName: {
type: String,
default: "",
},
},
data() {
return {
tableData: [],
@ -45,17 +51,19 @@ export default {
...mapGetters(["userInfo", "permission"]),
},
created() {
this.getTableData()
this.timeFun = setInterval(() => {
if(this.deptName){
this.getTableData()
}, 300000)
this.timeFun = setInterval(() => {
this.getTableData()
}, 300000)
}
},
beforeDestroyed() {
clearInterval(this.timeFun)
},
methods: {
getTableData() {
getInstrumentActLoad({ manufacturerBrand: this.userInfo.dept_name }).then(res => {
getInstrumentActLoad({ manufacturerBrand: this.deptName }).then(res => {
this.tableData = res.data.data
})
},

@ -13,6 +13,12 @@ import tit from "./tit.vue";
import { mapGetters } from "vuex";
import { getInstrumentRunStatus } from "@/api/energySources/energySources"
export default {
props: {
deptName: {
type: String,
default: "",
},
},
data() {
return {
funt: null
@ -22,14 +28,16 @@ export default {
tit
},
created() {
this.$nextTick(() => {
if(this.deptName){
this.getData()
this.funt = setInterval(() => {
this.getData()
}, 3600000)
})
this.$nextTick(() => {
this.getData()
this.funt = setInterval(() => {
this.getData()
}, 3600000)
})
}
},
beforeDestroyed() {
clearInterval(this.funt)
@ -42,7 +50,7 @@ export default {
},
methods: {
getData() {
getInstrumentRunStatus({ manufacturerBrand: this.userInfo.dept_name }).then(res => {
getInstrumentRunStatus({ manufacturerBrand: this.deptName }).then(res => {
// this.tableData = res.data.data;
// this.yearNum = data.currentYear.toString().split('')
// this.monthNum = data.currentMonth.toString().split('')

@ -23,11 +23,11 @@
<div class="htitle">
<div class="htitle-t">
{{ userInfo.dept_name }}实业公司能耗监测系统
{{ deptName }}实业公司能耗监测系统
</div>
<div class="htitle-b">
{{ userInfo.dept_name }}实业公司能耗监测系统
{{deptName }}实业公司能耗监测系统
</div>
</div>
</div>
@ -37,6 +37,12 @@
import { getWeather } from "@/api/energySourcesProvince/energySourcesProvince"
import { mapGetters } from "vuex";
export default {
props: {
deptName: {
type: String,
default: "",
},
},
data() {
return {
time: '',

@ -26,6 +26,12 @@ import tit from "./tit.vue";
import { mapGetters } from "vuex";
import { getDayElectricity, getWeekElectricity } from "@/api/energySources/energySources"
export default {
props: {
deptName: {
type: String,
default: "",
},
},
data() {
return {
radio: 0,
@ -39,6 +45,8 @@ export default {
},
created() {
this.selectDate = this.$moment().format('YYYY-MM-DD')
if(this.deptName){
this.getWeekData('created')
this.$nextTick(() => {
if (this.radio) {
@ -50,6 +58,7 @@ export default {
}
})
}
},
computed: {
...mapGetters(["userInfo", "permission"]),
@ -81,7 +90,7 @@ export default {
},
//
getDayData() {
getDayElectricity({ manufacturerBrand: this.userInfo.dept_name, today: this.selectDate }).then(res => {
getDayElectricity({ manufacturerBrand: this.deptName, today: this.selectDate }).then(res => {
console.log('res ======>', res)
let data = res.data.data
let xAxisArr = Array.from({ length: 24 }, (_, index) => index + 1);
@ -129,7 +138,7 @@ export default {
},
//
getWeekData(t) {
getWeekElectricity({ manufacturerBrand: this.userInfo.dept_name, today: this.selectDate }).then(res => {
getWeekElectricity({ manufacturerBrand: this.deptName, today: this.selectDate }).then(res => {
console.log('res1 ====>', res)
let data = res.data.data

@ -1,16 +1,16 @@
<template>
<div style="height: 100%">
<div class="modelBox">
<Header />
<all />
<Header v-if="deptName" :deptName="deptName" />
<all v-if="deptName" :deptName="deptName" />
<div class="box-two">
<load />
<dosage />
<load v-if="deptName" :deptName="deptName" />
<dosage v-if="deptName" :deptName="deptName" />
</div>
<div class="box-two">
<equipmentLoad />
<equipmentStatus />
<equipmentAnalyze />
<equipmentLoad v-if="deptName" :deptName="deptName" />
<equipmentStatus v-if="deptName" :deptName="deptName" />
<equipmentAnalyze v-if="deptName" :deptName="deptName" />
</div>
@ -36,10 +36,15 @@ import equipmentLoad from "./component/equipmentLoad.vue";
import equipmentStatus from "./component/equipmentStatus.vue";
import equipmentAnalyze from "./component/equipmentAnalyze.vue";
import { getEntrustDay, getDataAcquisition } from "@/api/monitoring/monitoring";
import {getDeptTree} from "@/api/system/dept"
import { mapGetters } from "vuex";
export default {
data() {
return {
deptId:'',
deptName:''
};
},
components: {
@ -51,8 +56,14 @@ export default {
equipmentStatus,
equipmentAnalyze,
},
computed:{
...mapGetters(["userInfo", "permission"]),
},
created() {
this.$nextTick(() => {
this.deptId = this.$route.query.deptId ? this.$route.query.deptId : this.userInfo.dept_id
console.log('dep ===>',this.deptId)
this.getDept()
this.setRemPc();
window.addEventListener('resize', this.setRemPc);//rem
})
@ -70,6 +81,33 @@ export default {
},
},
methods: {
getDept(id){
getDeptTree().then(res => {
this.deptName = this.getAllIds(res.data.data,'id',this.deptId)
});
},
getAllIds(data, key, value) {
let result = null
let fn = function (d) {
if (Array.isArray(d)) {
//
for (let i = 0; i < d.length; i++) {
const e = d[i]
console.log('e ===>',e)
if (e[key] == value) {
// id
result = e //
break
} else if (e.children) {
fn(e.children) //
}
}
}
}
fn(data) //
return result.title
},
setRemPc() {
/**
* @file: index.vue

Loading…
Cancel
Save