Merge branch 'main' of https://git.jsspisoft.com/ry-das
This commit is contained in:
commit
b9cf44d179
@ -609,13 +609,14 @@ const initTrendChart = (type: 'day' | 'month') => {
|
||||
const samePeriod: number[] = type === 'day' ? TrendDataForDay.samePeriod.value : TrendDataForMonth.map((item) => item.samePeriod)
|
||||
const xAxisdata: string[] = type === 'day' ? TrendDataForDay.currentPeriod.time : TrendDataForMonth.map((item) => item.generationTime)
|
||||
const trendChart = state.charts?.trendChart ?? echarts.init(trendChartRef.value as unknown as HTMLElement)
|
||||
const legend = type === 'day' ? ['当天', '环比'] : ['本月', '环比']
|
||||
|
||||
const option = {
|
||||
grid: {
|
||||
top: 30,
|
||||
right: 10,
|
||||
bottom: 20,
|
||||
left: 100,
|
||||
left: 70,
|
||||
borderColor: '#dadada',
|
||||
},
|
||||
tooltip: {
|
||||
@ -679,14 +680,14 @@ const initTrendChart = (type: 'day' | 'month') => {
|
||||
},
|
||||
],
|
||||
legend: {
|
||||
data: ['本期', '同期'],
|
||||
data: legend,
|
||||
textStyle: {
|
||||
color: '#73767a',
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '本期',
|
||||
name: legend[0],
|
||||
data: currentPeriod,
|
||||
type: 'bar',
|
||||
smooth: true,
|
||||
@ -695,7 +696,7 @@ const initTrendChart = (type: 'day' | 'month') => {
|
||||
},
|
||||
},
|
||||
{
|
||||
name: '同期',
|
||||
name: legend[1],
|
||||
data: samePeriod,
|
||||
type: 'bar',
|
||||
smooth: true,
|
||||
@ -1021,9 +1022,6 @@ const createRealTimeData = async () => {
|
||||
temperatureChartsData[1].value = getCutDecimalsValue(realData.itempnacelle_1sec)
|
||||
temperatureChartsData[2].value = getCutDecimalsValue(realData.itempoutdoor_1sec)
|
||||
|
||||
const ipitchangle = Math.min(realData.ipitchangle1, realData.ipitchangle2, realData.ipitchangle3)
|
||||
realTimeDataForSingle.value.ipitchangle = ipitchangle / 1 === 0 ? ipitchangle : Math.floor(ipitchangle * 1000) / 1000
|
||||
|
||||
const overviewDatakeys: any = Object.keys(overviewData)
|
||||
const sigleDataKeys: any = Object.keys(realTimeDataForSingle.value)
|
||||
|
||||
@ -1201,22 +1199,13 @@ const getThisDayChartData = () => {
|
||||
})
|
||||
}
|
||||
|
||||
const getLastYearTodayTimestamp = () => {
|
||||
const now = new Date()
|
||||
const lastYear = now.getFullYear() - 1
|
||||
const lastYearToday = new Date(lastYear, now.getMonth(), now.getDate())
|
||||
return lastYearToday.getTime()
|
||||
}
|
||||
|
||||
const getLastYearChartData = () => {
|
||||
const getLastMonthThisDayChartData = () => {
|
||||
return new Promise((resolve) => {
|
||||
const start = getLastYearTodayTimestamp()
|
||||
const end = new Date()
|
||||
end.setFullYear(end.getFullYear() - 1)
|
||||
|
||||
const start = dayjs().subtract(1, 'month').startOf('day').valueOf()
|
||||
const end = dayjs().subtract(1, 'month').valueOf()
|
||||
getChartData<'iKWhThisDay'>({
|
||||
startTime: start,
|
||||
endTime: end.getTime(),
|
||||
endTime: end,
|
||||
attr: ['iKWhThisDay'],
|
||||
interval: '1h',
|
||||
}).then(({ times, val }) => {
|
||||
@ -1272,7 +1261,7 @@ const getAllChartData = (type: ('power' | 'trend' | 'frequency')[] = ['power', '
|
||||
})
|
||||
}
|
||||
if (type.includes('trend')) {
|
||||
const trendDataForLastYear = getLastYearChartData()
|
||||
const trendDataForLastYear = getLastMonthThisDayChartData()
|
||||
const trendDataForThisDay = getThisDayChartForHourData()
|
||||
Promise.all([trendDataForLastYear, trendDataForThisDay]).then(() => {
|
||||
initTrendChart(trendChartType.value)
|
||||
|
@ -284,6 +284,14 @@ export const excelDefaultConfig: any = {
|
||||
label: '寄存器地址',
|
||||
code: 'registerAddr',
|
||||
},
|
||||
{
|
||||
label: '启用变量',
|
||||
code: 'variableEnable',
|
||||
},
|
||||
{
|
||||
label: '变量名称',
|
||||
code: 'variableName',
|
||||
},
|
||||
{
|
||||
label: '上界',
|
||||
code: 'upBound',
|
||||
@ -341,6 +349,10 @@ export const excelDefaultConfig: any = {
|
||||
"8. 16位BCD数据",
|
||||
"9. 8位归一化值"
|
||||
], // 数据类型的提示
|
||||
R0C7:[
|
||||
"0. 不启用",
|
||||
"1. 启用"
|
||||
]
|
||||
},
|
||||
//遥控147 CONTROL
|
||||
147: {
|
||||
|
Loading…
Reference in New Issue
Block a user