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

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

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

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

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

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

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

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

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

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

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

@ -1,16 +1,16 @@
<template> <template>
<div style="height: 100%"> <div style="height: 100%">
<div class="modelBox"> <div class="modelBox">
<Header /> <Header v-if="deptName" :deptName="deptName" />
<all /> <all v-if="deptName" :deptName="deptName" />
<div class="box-two"> <div class="box-two">
<load /> <load v-if="deptName" :deptName="deptName" />
<dosage /> <dosage v-if="deptName" :deptName="deptName" />
</div> </div>
<div class="box-two"> <div class="box-two">
<equipmentLoad /> <equipmentLoad v-if="deptName" :deptName="deptName" />
<equipmentStatus /> <equipmentStatus v-if="deptName" :deptName="deptName" />
<equipmentAnalyze /> <equipmentAnalyze v-if="deptName" :deptName="deptName" />
</div> </div>
@ -36,10 +36,15 @@ import equipmentLoad from "./component/equipmentLoad.vue";
import equipmentStatus from "./component/equipmentStatus.vue"; import equipmentStatus from "./component/equipmentStatus.vue";
import equipmentAnalyze from "./component/equipmentAnalyze.vue"; import equipmentAnalyze from "./component/equipmentAnalyze.vue";
import { getEntrustDay, getDataAcquisition } from "@/api/monitoring/monitoring"; import { getEntrustDay, getDataAcquisition } from "@/api/monitoring/monitoring";
import {getDeptTree} from "@/api/system/dept"
import { mapGetters } from "vuex";
export default { export default {
data() { data() {
return { return {
deptId:'',
deptName:''
}; };
}, },
components: { components: {
@ -51,8 +56,14 @@ export default {
equipmentStatus, equipmentStatus,
equipmentAnalyze, equipmentAnalyze,
}, },
computed:{
...mapGetters(["userInfo", "permission"]),
},
created() { created() {
this.$nextTick(() => { 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(); this.setRemPc();
window.addEventListener('resize', this.setRemPc);//rem window.addEventListener('resize', this.setRemPc);//rem
}) })
@ -70,6 +81,33 @@ export default {
}, },
}, },
methods: { 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() { setRemPc() {
/** /**
* @file: index.vue * @file: index.vue

Loading…
Cancel
Save