zhengnaiwen_citu 2 هفته پیش
والد
کامیت
55ea084a10
2فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 1 1
      src/views/dataBook/components/mGraph.vue
  2. 3 0
      src/views/dataFactory/components/graph.vue

+ 1 - 1
src/views/dataBook/components/mGraph.vue

@@ -319,7 +319,7 @@ export default {
         })
         this.$nextTick(() => {
           this.$refs.graphRef.setOptions(this.graphOptions, async (graphInstance) => {
-            if (!this.$refs.graphRef.setJsonData) {
+            if (!this.$refs.graphRef || !this.$refs.graphRef.setJsonData) {
               return
             }
             this.$refs.graphRef.setJsonData(data, async (_graphInstance) => {

+ 3 - 0
src/views/dataFactory/components/graph.vue

@@ -101,6 +101,9 @@ export default {
     async init (data) {
       this.loading = true
       this.$refs.graphRef.setOptions(this.graphOptions, () => {
+        if (!this.$refs.graphRef || !this.$refs.graphRef.setJsonData) {
+          return
+        }
         this.$refs.graphRef.setJsonData(data, (graphInstance) => {
           this.loading = false
         })