Explorar o código

3368 网络图end01

tyler %!s(int64=2) %!d(string=hai) anos
pai
achega
37cf608bcd
Modificáronse 2 ficheiros con 11 adicións e 10 borrados
  1. 9 8
      src/components/TreeChart/index.vue
  2. 2 2
      src/views/shop/standard-products.vue

+ 9 - 8
src/components/TreeChart/index.vue

@@ -390,7 +390,7 @@ export default {
           // that.fontSize = 10 * zoom
           currentOption.textStyle.fontSize = 10 * zoom;
           currentOption.series[0].label.fontSize = 8 * zoom;
-          currentOption.series[0].label.width = 100 * zoom;
+          currentOption.series[0].label.width = 110 * zoom;
           currentOption.series[0].label.distance = 18 * zoom;
           currentOption.series[0].leaves.distance = 18 * zoom;
           option && that.myChart.setOption(currentOption);
@@ -402,6 +402,7 @@ export default {
       let elesArr = Array.from(
         new Set(this.myChart._chartsViews[0]._data._graphicEls)
       );
+      console.log(elesArr.length)
       let dep = this.myChart._chartsViews[0]._data.tree.root.height; //获取树高
       console.log(dep);
       let layer_height = 90; //层级之间的高度
@@ -416,16 +417,16 @@ export default {
         this.center[0] = '-70%';
         this.center[1] = (dep * 2) + '0%';
 
-      }else if (newWidth < 500) {
-        this.center[0] = '-50%';
-        this.center[1] = (dep) + '0%';
+      }else if (newWidth > 200 && newWidth < 500) {
+        this.center[0] = '-56%';
+        this.center[1] = (dep * 1.5) + '0%';
 
-      }else if (newWidth < 1000) {
+      }else if (newWidth > 500 && newWidth < 1000) {
         this.center[0] = '-10%';
-        this.center[1] = (dep ) + '0%';
+        this.center[1] = (dep) + '0%';
 
-      } else {
-        this.center[0] = newWidth * 1.2;
+      } else if (newWidth > 1000){
+        this.center[0] = elesArr.length > 60 ? newWidth * 1.2 : newWidth * 0.6;
         this.center[1] = (dep ) + '0%';
       }
       this.chartWidth = newWidth;

+ 2 - 2
src/views/shop/standard-products.vue

@@ -104,7 +104,7 @@
             <el-divider />
             <el-form>
               <el-form-item :label="$t('shop.declarationCenterNumber')">
-                <el-input v-model="recUserName"   />
+                <el-input v-model="recUserName" />
               </el-form-item>
             </el-form>
             
@@ -353,7 +353,7 @@ export default {
       },
       imageStyle: 'margin-top: -50px;',
       recRealName:null,
-      recUserName:null,
+      recUserName:usersInfo.userName(),
     }
   },
   computed: {