页面刷新

This commit is contained in:
仲么了
2024-02-28 11:16:40 +08:00
parent 268b8547f2
commit 6443edfb43
11 changed files with 28 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
import { createRouter, createWebHashHistory } from 'vue-router'
import { createRouter, createWebHashHistory } from 'vue-router'
import staticRoutes from '@/router/static'
import { useAdminInfo } from '@/stores/adminInfo'
import NProgress from 'nprogress'
@@ -21,7 +21,7 @@ router.beforeEach((to, from, next) => {
// 登录或者注册才可以往下进行
next()
} else if (to.path == '/admin/center/homePage') {
window.open(window.location.origin + '/homePage')
window.open(window.location.origin + '/homePage/#/')
} else {
// 获取 token
const adminInfo = useAdminInfo()

View File

@@ -60,6 +60,7 @@ export default class TableStore {
}
index() {
this.table.beforeSearchFun && this.table.beforeSearchFun()
this.table.data = []
this.table.loading = true
// 重置用的数据数据
@@ -96,7 +97,6 @@ export default class TableStore {
[
'search',
() => {
this.table.beforeSearchFun && this.table.beforeSearchFun()
this.table.params.pageNum = 1
this.index()
}

View File

@@ -49,6 +49,7 @@ const options = ref({})
const init = () => {
loading.value = true
formData.lineIndex = monitoringPoint.state.lineId
formData.startTime = datePickerRef.value.timeValue[0]
formData.endTime = datePickerRef.value.timeValue[1]
getPlot(formData).then(

View File

@@ -49,6 +49,7 @@ const options = ref({})
const init = () => {
loading.value = true
formData.lineIndex = monitoringPoint.state.lineId
formData.startTime = datePickerRef.value.timeValue[0]
formData.endTime = datePickerRef.value.timeValue[1]
getPlot(formData).then(

View File

@@ -32,6 +32,7 @@ const options = ref({})
const init = () => {
loading.value = true
formData.lineIndex = monitoringPoint.state.lineId
formData.startTime = datePickerRef.value.timeValue[0]
formData.endTime = datePickerRef.value.timeValue[1]
getProbabilityDistribution(formData).then(

View File

@@ -90,6 +90,7 @@ const thirdData = ref([])
const chartsData = ref([])
const init = () => {
formData.lineIndex = monitoringPoint.state.lineId
formData.startTime = datePickerRef.value.timeValue[0]
formData.endTime = datePickerRef.value.timeValue[1]
loading.value = true

View File

@@ -45,6 +45,7 @@ const thirdData = ref<any>([])
const init = () => {
loading.value = true
formData.lineIndex = monitoringPoint.state.lineId
formData.startTime = datePickerRef.value.timeValue[0]
formData.endTime = datePickerRef.value.timeValue[1]
formData.flag = datePickerRef.value.interval

View File

@@ -32,6 +32,7 @@ const options = ref({})
const init = () => {
loading.value = true
formData.lineIndex = monitoringPoint.state.lineId
formData.startTime = datePickerRef.value.timeValue[0]
formData.endTime = datePickerRef.value.timeValue[1]
getProbabilityDistribution(formData).then(

View File

@@ -74,6 +74,10 @@ const tableStore = new TableStore({
]
}
],
beforeSearchFun: () => {
tableStore.table.params.lineId = monitoringPoint.state.lineId
console.log('beforeSearchFun')
},
loadCallback: () => {
tableStore.table.data.forEach((item: any) => {
item.eventTypeName = eventTypeOptions.find(item2 => item2.id === item.eventType)?.name
@@ -82,7 +86,6 @@ const tableStore = new TableStore({
}
})
provide('tableStore', tableStore)
tableStore.table.params.lineId = monitoringPoint.state.lineId
tableStore.table.params.searchState = 0
onMounted(() => {
// 加载数据

View File

@@ -4,13 +4,13 @@
<el-tab-pane label='导航' name='1' :style='height' lazy>
<Navigation @changeTab='changeTab' />
</el-tab-pane>
<el-tab-pane label='事件统计' name='2' lazy>
<el-tab-pane label='事件统计' name='2' lazy v-if='!isReload'>
<EventStatistics />
</el-tab-pane>
<el-tab-pane label='事件分析' name='3' lazy>
<el-tab-pane label='事件分析' name='3' lazy v-if='!isReload'>
<EventStudy />
</el-tab-pane>
<el-tab-pane label='运行情况' name='4' lazy :style='height'>
<el-tab-pane label='运行情况' name='4' lazy :style='height' v-if='!isReload'>
<RunningCondition />
</el-tab-pane>
</el-tabs>
@@ -18,7 +18,7 @@
</div>
</template>
<script setup lang='ts'>
import { defineOptions, ref, watch } from 'vue'
import { defineOptions, nextTick, ref, watch } from 'vue'
import Navigation from './navigation/index.vue'
import EventStatistics from './eventStatistics/index.vue'
import EventStudy from './eventStudy/index.vue'
@@ -30,6 +30,7 @@ import { useMonitoringPoint } from '@/views/pqs/voltageSags/monitoringPoint/onli
defineOptions({
name: 'Descentsystem/monitoringpoint'
})
const isReload = ref(false)
const monitoringPoint = useMonitoringPoint()
const height = mainHeight(82)
const activeName = ref('1')
@@ -43,6 +44,13 @@ watch(
},
{ immediate: true }
)
watch(() => monitoringPoint.state.lineId, () => {
// 刷新页面
isReload.value = true
nextTick(() => {
isReload.value = false
})
})
const changeTab = (e: string) => {
activeName.value = e
}

View File

@@ -24,7 +24,7 @@
</div>
</template>
<script setup lang='ts'>
import { nextTick, onMounted, reactive, ref } from 'vue'
import { nextTick, onMounted, reactive, ref, watch } from 'vue'
import DatePicker from '@/components/form/datePicker/index.vue'
import MyEchart from '@/components/echarts/MyEchart.vue'
import { useMonitoringPoint } from '@/views/pqs/voltageSags/monitoringPoint/online/store'
@@ -35,7 +35,7 @@ const datePickerRef = ref()
const loading = ref(true)
const monitoringPoint = useMonitoringPoint()
const formData = reactive({
id: monitoringPoint.state.lineId,
id: '',
searchBeginTime: '',
searchEndTime: '',
timeFlag: 1
@@ -45,10 +45,9 @@ const secondOptions = ref<any>({})
const firstData = ref<any>([])
const secondData = ref<any>([])
const init = () => {
loading.value = true
formData.id = monitoringPoint.state.lineId
formData.searchBeginTime = datePickerRef.value.timeValue[0]
formData.searchEndTime = datePickerRef.value.timeValue[1]
formData.timeFlag = datePickerRef.value.interval