Procházet zdrojové kódy

在线报告文档

zhuliu před 1 rokem
rodič
revize
764e12a00d

+ 1 - 1
src/views/analyse/custom/components/Charts/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div v-if="refresh">
-    <component :is="chartType.component" :width="width" :height="height"></component>
+    <component :is="chartType.component" :myId="myId" :formData="formData" :formCount="formCount" :selectedData="selectedData" :width="width" :height="height"></component>
   </div>
 </template>
 

+ 13 - 4
src/views/analyse/custom/mixins.js

@@ -6,12 +6,18 @@ import html2canvas from 'html2canvas'
 
 export const customPage = {
   props:{
+    formCount:{},
+    formData:{},
+    selectedData:{},
     editorForm:{},
-    editorSelected:{}
+    editorSelected:{},
+    myId:{
+      type:String
+    }
   },
   computed: {
     form() {
-      return this.editorForm||this.$store.state.chart.form
+      return this.editorForm || this.formData || this.$store.state.chart.form
     },
     changeNum() {
       return this.$store.state.chart.changeNum
@@ -26,13 +32,13 @@ export const customPage = {
       return this.$store.state.chart.treeKey
     },
     selected() {
-      return this.editorSelected || this.$store.state.chart.selected
+      return this.editorSelected || this.selectedData || this.$store.state.chart.selected
     },
     selectedLoad() {
       return this.$store.state.chart.selectedLoad
     },
     count() {
-      return this.$store.state.chart.count
+      return this.formCount || this.$store.state.chart.count
     },
     matrix() {
       return this.$store.state.chart.matrix
@@ -496,6 +502,9 @@ export const chartOption = {
 export const chartOptionMixins = {
   mixins: [chartOption],
   mounted() {
+    if(this.myId){
+      this.id = this.myId + '_' + this.id
+    }
     this.$nextTick(() => {
       this.initChart(this.id, this.getOption())
     })

+ 4 - 3
src/views/components/editor/index.vue

@@ -1,8 +1,7 @@
 <template>
-  <div>
+  <div style="height: 100%" v-loading="loading">
     <editor-zl
       ref="editor1"
-      v-if="!loading"
       :htmlData="htmlData"
       :editMode="editMode"
       :imageData="imageDatas"
@@ -54,7 +53,9 @@ export default {
     
   },
   methods: {
-    
+    showCharts(data){
+      this.$refs.editor1.showCharts(data);
+    },
   },
 };
 </script>

+ 2 - 3
src/views/components/editor/mixins/dataComponent.js

@@ -594,7 +594,6 @@ export default{
             dimensions.forEach((dimension) => {
               var form = this.form;
               var obj = form.schema[dimension];
-              this.loading = true;
               if (obj.fieldKind == 0) {
                 count.push({
                   field: "field",
@@ -669,8 +668,8 @@ export default{
                 type: 3,
               },
             };
-      
-            this.$refs.editor1.showCharts(data);
+            // this.$refs.editor1.showCharts(data);
+            this.showCharts(data)
           },
           imageData(imageData, edit) {
             if (!edit) {

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 283 - 8
src/views/components/editor/mixins/ready.js