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