Merge pull request '更新' (#428) from projects/zg-zwq into projects/zg-test

Reviewed-on: #428
This commit is contained in:
朱文强 2025-03-17 15:31:35 +08:00
commit 1e9bfee1e7
7 changed files with 106 additions and 12 deletions

View File

@ -34,6 +34,7 @@
size="mini"
type="text"
style="font-size: 24px; color: white; margin-right: 30px"
:disabled="!permission"
@click="goDetail">
<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');
getUserProfile().then((response) => {
this.user = response.data;
if (this.user.nickname !== '技术中心') {
if (this.user.roles[0].name !== 'dashborad') {
this.permission = true;
this.getData();
} else {

View File

@ -42,7 +42,7 @@ export default {
this.chart = null;
},
methods: {
initChart() {
initChart(permission) {
var option = {
tooltip: {
trigger: 'axis',
@ -231,7 +231,9 @@ export default {
},
],
};
if(permission){
option.series[2]=[]
}
if (this.chart) {
this.chart.setOption(option);
} else {

View File

@ -140,6 +140,7 @@ import screenfull from 'screenfull';
import { debounce } from '@/utils/debounce';
import baseTable from '../components/baseTable.vue';
import BarChart from './BarChart.vue';
import { getUserProfile } from '@/api/system/user';
const tableProps1 = [
{
@ -246,11 +247,21 @@ export default {
tableProps2,
tableData2: [],
echartData: [],
permission: false,
};
},
created() {
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() {
this.destroy();
@ -341,17 +352,36 @@ export default {
//
if ('factoryState' in dataJson) {
this.topData = dataJson.factoryState;
if(!this.permission){
this.topData.monthAreaCost = '***'
this.topData.monthSum = '***'
this.topData.yestodaySum = '***'
}
}
if ('factoryCostTableList' in dataJson) {
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) {
this.tableData2 = dataJson.factoryEnergyTableList;
if(!this.permission){
this.tableData2.forEach(item=>{
item.price = null
})
}
}
if ('factoryCostTrendList' in dataJson) {
this.echartData = dataJson.factoryCostTrendList;
this.$nextTick(()=>{
this.$refs.chartRef.initChart();
this.$refs.chartRef.initChart(!this.permission);
})
}
},

View File

@ -48,7 +48,7 @@ export default {
this.chart = null;
},
methods: {
initChart() {
initChart(permission) {
var option = {
tooltip: {
trigger: 'axis',
@ -292,6 +292,9 @@ export default {
],
};
if(permission){
option.series[1]=[]
}
if (this.chart) {
this.chart.setOption(option);
} else {

View File

@ -110,6 +110,7 @@ import { debounce } from '@/utils/debounce';
import baseTable from '../components/baseTable.vue';
import BarChart from './BarChart.vue';
import interval from './interval.vue';
import { getUserProfile } from '@/api/system/user';
const tableProps1 = [
{
@ -224,12 +225,22 @@ export default {
tableData2: [],
tableProps3,
tableData3: [],
echartData: []
echartData: [],
permission: false,
};
},
created() {
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() {
this.destroy();
@ -319,12 +330,27 @@ export default {
//
if ('DeepState' in dataJson) {
this.topData = dataJson.DeepState;
if(!this.permission){
this.topData.yestodaySum = '***'
this.topData.monthSum = '***'
this.topData.monthAreaCost = '***'
}
}
if ('DeepEnergyTableList' in dataJson) {
this.tableData1 = dataJson.DeepEnergyTableList;
if(!this.permission){
this.tableData1.forEach(item=>{
item.elecPrice = null
})
}
}
if ('DeepCostTableList' in dataJson) {
this.tableData2 = dataJson.DeepCostTableList;
if(!this.permission){
this.tableData2.forEach(item=>{
item.priceD = null
})
}
}
if ('DeepPdTables' in dataJson) {
this.tableData3 = dataJson.DeepPdTables;
@ -332,7 +358,7 @@ export default {
if ('DeepCostTrendList' in dataJson) {
this.echartData = dataJson.DeepCostTrendList;
this.$nextTick(() => {
this.$refs.chartRef.initChart();
this.$refs.chartRef.initChart(!this.permission);
});
}
},

View File

@ -48,7 +48,7 @@ export default {
this.chart = null;
},
methods: {
initChart() {
initChart(permission) {
var option = {
tooltip: {
@ -293,6 +293,9 @@ export default {
],
}
if(permission){
option.series[1]=[]
}
if (this.chart) {
this.chart.setOption(option);
} else {

View File

@ -144,6 +144,7 @@ import screenfull from 'screenfull';
import { debounce } from '@/utils/debounce';
import baseTable from '../components/baseTable.vue';
import BarChart from './BarChart.vue';
import { getUserProfile } from '@/api/system/user';
const tableProps1 = [
{
@ -229,11 +230,21 @@ export default {
tableProps2,
tableData2: [],
echartData: [],
permission: false,
};
},
created() {
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() {
this.destroy();
@ -324,17 +335,35 @@ export default {
//
if ('OriginState' in dataJson) {
this.topData = dataJson.OriginState;
if(!this.permission){
this.topData.monthAreaCost = '***'
this.topData.monthMat = '***'
this.topData.yestodaySum = '***'
this.topData.yestodayMat = '***'
}
}
if ('OriginEnergyTableList' in dataJson) {
this.tableData1 = dataJson.OriginEnergyTableList;
if(!this.permission){
this.tableData1.forEach(item=>{
item.elecPrice = null
item.gasPrice = null
item.price = null
})
}
}
if ('OriginCostTableList' in dataJson) {
this.tableData2 = dataJson.OriginCostTableList;
if(!this.permission){
this.tableData2.forEach(item=>{
item.priceO = null
})
}
}
if ('OriginCostTrendList' in dataJson) {
this.echartData = dataJson.OriginCostTrendList;
this.$nextTick(()=>{
this.$refs.chartRef.initChart();
this.$refs.chartRef.initChart(!this.permission);
})
}
},