|
@@ -87,8 +87,10 @@ import {
|
|
computed,
|
|
computed,
|
|
watch,
|
|
watch,
|
|
watchEffect,
|
|
watchEffect,
|
|
|
|
+ onBeforeMount,
|
|
} from 'vue'
|
|
} from 'vue'
|
|
import dataRaw from "@/assets/mock/history.json"
|
|
import dataRaw from "@/assets/mock/history.json"
|
|
|
|
+import { ElLoading } from 'element-plus'
|
|
|
|
|
|
export default {
|
|
export default {
|
|
name: 'HistoryView',
|
|
name: 'HistoryView',
|
|
@@ -107,6 +109,20 @@ export default {
|
|
const activeTimeIdx = ref(null)
|
|
const activeTimeIdx = ref(null)
|
|
const activeCorpId = ref('')
|
|
const activeCorpId = ref('')
|
|
|
|
|
|
|
|
+ // loading相关
|
|
|
|
+ const loadingInstance = ElLoading.service({
|
|
|
|
+ background: 'transparent',
|
|
|
|
+ })
|
|
|
|
+ function onIframeMessageForLoading(e) {
|
|
|
|
+ if (e.data === 'fetch data done') {
|
|
|
|
+ loadingInstance.close()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ window.addEventListener('message', onIframeMessageForLoading)
|
|
|
|
+ onBeforeUnmount(() => {
|
|
|
|
+ window.removeEventListener('message', onIframeMessageForLoading)
|
|
|
|
+ })
|
|
|
|
+
|
|
function onIframeMessage(e) {
|
|
function onIframeMessage(e) {
|
|
if (e.data.msg !== 'node-selected') {
|
|
if (e.data.msg !== 'node-selected') {
|
|
return
|
|
return
|