更新
This commit is contained in:
parent
ea47028178
commit
b4985d4018
@ -34,6 +34,7 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
style="font-size: 24px; color: white; margin-right: 30px"
|
style="font-size: 24px; color: white; margin-right: 30px"
|
||||||
|
:disabled="!permission"
|
||||||
@click="goDetail">
|
@click="goDetail">
|
||||||
<svg-icon icon-class="list"></svg-icon>
|
<svg-icon icon-class="list"></svg-icon>
|
||||||
详细
|
详细
|
||||||
@ -273,7 +274,7 @@ export default {
|
|||||||
this.showTime = moment(new Date()).subtract(0, 'days').format('YYYY-MM-DD');
|
this.showTime = moment(new Date()).subtract(0, 'days').format('YYYY-MM-DD');
|
||||||
getUserProfile().then((response) => {
|
getUserProfile().then((response) => {
|
||||||
this.user = response.data;
|
this.user = response.data;
|
||||||
if (this.user.nickname !== '技术中心') {
|
if (this.user.roles[0].name !== 'dashborad') {
|
||||||
this.permission = true;
|
this.permission = true;
|
||||||
this.getData();
|
this.getData();
|
||||||
} else {
|
} else {
|
||||||
|
@ -42,7 +42,7 @@ export default {
|
|||||||
this.chart = null;
|
this.chart = null;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initChart() {
|
initChart(permission) {
|
||||||
var option = {
|
var option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
@ -231,7 +231,9 @@ export default {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
if(permission){
|
||||||
|
option.series[2]=[]
|
||||||
|
}
|
||||||
if (this.chart) {
|
if (this.chart) {
|
||||||
this.chart.setOption(option);
|
this.chart.setOption(option);
|
||||||
} else {
|
} else {
|
||||||
|
@ -140,6 +140,7 @@ import screenfull from 'screenfull';
|
|||||||
import { debounce } from '@/utils/debounce';
|
import { debounce } from '@/utils/debounce';
|
||||||
import baseTable from '../components/baseTable.vue';
|
import baseTable from '../components/baseTable.vue';
|
||||||
import BarChart from './BarChart.vue';
|
import BarChart from './BarChart.vue';
|
||||||
|
import { getUserProfile } from '@/api/system/user';
|
||||||
|
|
||||||
const tableProps1 = [
|
const tableProps1 = [
|
||||||
{
|
{
|
||||||
@ -246,11 +247,21 @@ export default {
|
|||||||
tableProps2,
|
tableProps2,
|
||||||
tableData2: [],
|
tableData2: [],
|
||||||
echartData: [],
|
echartData: [],
|
||||||
|
permission: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.init();
|
this.init();
|
||||||
this.initWebSocket();
|
this.permission = false;
|
||||||
|
getUserProfile().then((response) => {
|
||||||
|
const user = response.data;
|
||||||
|
if (user.roles[0].name !== 'dashborad') {
|
||||||
|
this.permission = true;
|
||||||
|
} else {
|
||||||
|
this.permission = false;
|
||||||
|
}
|
||||||
|
this.initWebSocket();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
destroy() {
|
destroy() {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
@ -341,17 +352,36 @@ export default {
|
|||||||
// 数据接收
|
// 数据接收
|
||||||
if ('factoryState' in dataJson) {
|
if ('factoryState' in dataJson) {
|
||||||
this.topData = dataJson.factoryState;
|
this.topData = dataJson.factoryState;
|
||||||
|
if(!this.permission){
|
||||||
|
this.topData.monthAreaCost = '***'
|
||||||
|
this.topData.monthSum = '***'
|
||||||
|
this.topData.yestodaySum = '***'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ('factoryCostTableList' in dataJson) {
|
if ('factoryCostTableList' in dataJson) {
|
||||||
this.tableData1 = dataJson.factoryCostTableList;
|
this.tableData1 = dataJson.factoryCostTableList;
|
||||||
|
if(!this.permission){
|
||||||
|
this.tableData1.forEach(item=>{
|
||||||
|
item.priceS = null
|
||||||
|
item.matPriceS = null
|
||||||
|
item.energyPriceS = null
|
||||||
|
item.otherPriceS = null
|
||||||
|
item.areaPriceS = null
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ('factoryEnergyTableList' in dataJson) {
|
if ('factoryEnergyTableList' in dataJson) {
|
||||||
this.tableData2 = dataJson.factoryEnergyTableList;
|
this.tableData2 = dataJson.factoryEnergyTableList;
|
||||||
|
if(!this.permission){
|
||||||
|
this.tableData2.forEach(item=>{
|
||||||
|
item.price = null
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ('factoryCostTrendList' in dataJson) {
|
if ('factoryCostTrendList' in dataJson) {
|
||||||
this.echartData = dataJson.factoryCostTrendList;
|
this.echartData = dataJson.factoryCostTrendList;
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.$refs.chartRef.initChart();
|
this.$refs.chartRef.initChart(!this.permission);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -48,7 +48,7 @@ export default {
|
|||||||
this.chart = null;
|
this.chart = null;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initChart() {
|
initChart(permission) {
|
||||||
var option = {
|
var option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
@ -292,6 +292,9 @@ export default {
|
|||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if(permission){
|
||||||
|
option.series[1]=[]
|
||||||
|
}
|
||||||
if (this.chart) {
|
if (this.chart) {
|
||||||
this.chart.setOption(option);
|
this.chart.setOption(option);
|
||||||
} else {
|
} else {
|
||||||
|
@ -110,6 +110,7 @@ import { debounce } from '@/utils/debounce';
|
|||||||
import baseTable from '../components/baseTable.vue';
|
import baseTable from '../components/baseTable.vue';
|
||||||
import BarChart from './BarChart.vue';
|
import BarChart from './BarChart.vue';
|
||||||
import interval from './interval.vue';
|
import interval from './interval.vue';
|
||||||
|
import { getUserProfile } from '@/api/system/user';
|
||||||
|
|
||||||
const tableProps1 = [
|
const tableProps1 = [
|
||||||
{
|
{
|
||||||
@ -224,12 +225,22 @@ export default {
|
|||||||
tableData2: [],
|
tableData2: [],
|
||||||
tableProps3,
|
tableProps3,
|
||||||
tableData3: [],
|
tableData3: [],
|
||||||
echartData: []
|
echartData: [],
|
||||||
|
permission: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.init();
|
this.init();
|
||||||
this.initWebSocket();
|
this.permission = false;
|
||||||
|
getUserProfile().then((response) => {
|
||||||
|
const user = response.data;
|
||||||
|
if (user.roles[0].name !== 'dashborad') {
|
||||||
|
this.permission = true;
|
||||||
|
} else {
|
||||||
|
this.permission = false;
|
||||||
|
}
|
||||||
|
this.initWebSocket();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
destroy() {
|
destroy() {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
@ -319,12 +330,27 @@ export default {
|
|||||||
// 数据接收
|
// 数据接收
|
||||||
if ('DeepState' in dataJson) {
|
if ('DeepState' in dataJson) {
|
||||||
this.topData = dataJson.DeepState;
|
this.topData = dataJson.DeepState;
|
||||||
|
if(!this.permission){
|
||||||
|
this.topData.yestodaySum = '***'
|
||||||
|
this.topData.monthSum = '***'
|
||||||
|
this.topData.monthAreaCost = '***'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ('DeepEnergyTableList' in dataJson) {
|
if ('DeepEnergyTableList' in dataJson) {
|
||||||
this.tableData1 = dataJson.DeepEnergyTableList;
|
this.tableData1 = dataJson.DeepEnergyTableList;
|
||||||
|
if(!this.permission){
|
||||||
|
this.tableData1.forEach(item=>{
|
||||||
|
item.elecPrice = null
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ('DeepCostTableList' in dataJson) {
|
if ('DeepCostTableList' in dataJson) {
|
||||||
this.tableData2 = dataJson.DeepCostTableList;
|
this.tableData2 = dataJson.DeepCostTableList;
|
||||||
|
if(!this.permission){
|
||||||
|
this.tableData2.forEach(item=>{
|
||||||
|
item.priceD = null
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ('DeepPdTables' in dataJson) {
|
if ('DeepPdTables' in dataJson) {
|
||||||
this.tableData3 = dataJson.DeepPdTables;
|
this.tableData3 = dataJson.DeepPdTables;
|
||||||
@ -332,7 +358,7 @@ export default {
|
|||||||
if ('DeepCostTrendList' in dataJson) {
|
if ('DeepCostTrendList' in dataJson) {
|
||||||
this.echartData = dataJson.DeepCostTrendList;
|
this.echartData = dataJson.DeepCostTrendList;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.chartRef.initChart();
|
this.$refs.chartRef.initChart(!this.permission);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -48,7 +48,7 @@ export default {
|
|||||||
this.chart = null;
|
this.chart = null;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initChart() {
|
initChart(permission) {
|
||||||
|
|
||||||
var option = {
|
var option = {
|
||||||
tooltip: {
|
tooltip: {
|
||||||
@ -293,6 +293,9 @@ export default {
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(permission){
|
||||||
|
option.series[1]=[]
|
||||||
|
}
|
||||||
if (this.chart) {
|
if (this.chart) {
|
||||||
this.chart.setOption(option);
|
this.chart.setOption(option);
|
||||||
} else {
|
} else {
|
||||||
|
@ -144,6 +144,7 @@ import screenfull from 'screenfull';
|
|||||||
import { debounce } from '@/utils/debounce';
|
import { debounce } from '@/utils/debounce';
|
||||||
import baseTable from '../components/baseTable.vue';
|
import baseTable from '../components/baseTable.vue';
|
||||||
import BarChart from './BarChart.vue';
|
import BarChart from './BarChart.vue';
|
||||||
|
import { getUserProfile } from '@/api/system/user';
|
||||||
|
|
||||||
const tableProps1 = [
|
const tableProps1 = [
|
||||||
{
|
{
|
||||||
@ -229,11 +230,21 @@ export default {
|
|||||||
tableProps2,
|
tableProps2,
|
||||||
tableData2: [],
|
tableData2: [],
|
||||||
echartData: [],
|
echartData: [],
|
||||||
|
permission: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.init();
|
this.init();
|
||||||
this.initWebSocket();
|
this.permission = false;
|
||||||
|
getUserProfile().then((response) => {
|
||||||
|
const user = response.data;
|
||||||
|
if (user.roles[0].name !== 'dashborad') {
|
||||||
|
this.permission = true;
|
||||||
|
} else {
|
||||||
|
this.permission = false;
|
||||||
|
}
|
||||||
|
this.initWebSocket();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
destroy() {
|
destroy() {
|
||||||
this.destroy();
|
this.destroy();
|
||||||
@ -324,17 +335,35 @@ export default {
|
|||||||
// 数据接收
|
// 数据接收
|
||||||
if ('OriginState' in dataJson) {
|
if ('OriginState' in dataJson) {
|
||||||
this.topData = dataJson.OriginState;
|
this.topData = dataJson.OriginState;
|
||||||
|
if(!this.permission){
|
||||||
|
this.topData.monthAreaCost = '***'
|
||||||
|
this.topData.monthMat = '***'
|
||||||
|
this.topData.yestodaySum = '***'
|
||||||
|
this.topData.yestodayMat = '***'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ('OriginEnergyTableList' in dataJson) {
|
if ('OriginEnergyTableList' in dataJson) {
|
||||||
this.tableData1 = dataJson.OriginEnergyTableList;
|
this.tableData1 = dataJson.OriginEnergyTableList;
|
||||||
|
if(!this.permission){
|
||||||
|
this.tableData1.forEach(item=>{
|
||||||
|
item.elecPrice = null
|
||||||
|
item.gasPrice = null
|
||||||
|
item.price = null
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ('OriginCostTableList' in dataJson) {
|
if ('OriginCostTableList' in dataJson) {
|
||||||
this.tableData2 = dataJson.OriginCostTableList;
|
this.tableData2 = dataJson.OriginCostTableList;
|
||||||
|
if(!this.permission){
|
||||||
|
this.tableData2.forEach(item=>{
|
||||||
|
item.priceO = null
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ('OriginCostTrendList' in dataJson) {
|
if ('OriginCostTrendList' in dataJson) {
|
||||||
this.echartData = dataJson.OriginCostTrendList;
|
this.echartData = dataJson.OriginCostTrendList;
|
||||||
this.$nextTick(()=>{
|
this.$nextTick(()=>{
|
||||||
this.$refs.chartRef.initChart();
|
this.$refs.chartRef.initChart(!this.permission);
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user