xq commit:"修改了逆变器历史详情"
This commit is contained in:
@ -4,12 +4,14 @@ interface ProgramState {
|
||||
programID: string;
|
||||
personProgramTemp: any;
|
||||
totalArr: any;
|
||||
details: any;
|
||||
}
|
||||
const useProgram = defineStore('program', {
|
||||
state: (): ProgramState => ({
|
||||
programID: '',
|
||||
personProgramTemp: [],
|
||||
totalArr: []
|
||||
totalArr: [],
|
||||
details: null
|
||||
}),
|
||||
|
||||
actions: {
|
||||
@ -22,6 +24,9 @@ const useProgram = defineStore('program', {
|
||||
},
|
||||
updateTotalArr(arr: any) {
|
||||
this.totalArr = arr;
|
||||
},
|
||||
updateDetails(a: any) {
|
||||
this.details = a;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1803,11 +1803,10 @@ const handleCheckDetail = async (row?: InverterVO) => {
|
||||
chart6Value: chart6Value.value,
|
||||
chart6Index: chart6Index.value
|
||||
};
|
||||
localStorage.setItem('detail', JSON.stringify(detail));
|
||||
programState.updateDetails(detail);
|
||||
router.push({
|
||||
path: '/historyDetail',
|
||||
query: {
|
||||
detail: JSON.stringify(detail)
|
||||
}
|
||||
path: '/historyDetail'
|
||||
});
|
||||
// await nextTick(() => {
|
||||
// initChart(chart1Value.value, chart1Index.value, myChart1.value, '直流电流参数', 25, 'A');
|
||||
|
@ -2,9 +2,11 @@
|
||||
import moment from 'moment';
|
||||
import * as echarts from 'echarts';
|
||||
import { ref } from 'vue';
|
||||
import { useProgram } from '@/store/modules/program';
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const useStore = useProgram();
|
||||
const detail = ref();
|
||||
const activeName = ref();
|
||||
const myChart1 = ref(null);
|
||||
@ -15,7 +17,6 @@ const myChart5 = ref(null);
|
||||
const myChart6 = ref(null);
|
||||
|
||||
function dealData() {
|
||||
console.info(detail.value);
|
||||
detail.value = {
|
||||
...detail.value,
|
||||
dataTimestamp: moment(Number(detail.value.dataTimestamp)).format('YYYY-MM-DD HH:mm:ss'),
|
||||
@ -163,8 +164,11 @@ watch(
|
||||
);
|
||||
|
||||
onBeforeMount(() => {
|
||||
localStorage.setItem('detail', route.query.detail);
|
||||
if (!JSON.parse(localStorage.getItem('detail'))) {
|
||||
detail.value = useStore.details;
|
||||
} else {
|
||||
detail.value = JSON.parse(localStorage.getItem('detail'));
|
||||
}
|
||||
dealData();
|
||||
activeName.value = 'first';
|
||||
});
|
||||
|
Reference in New Issue
Block a user