Просмотр исходного кода

Merge branch 'feature/tyler-3368'

kevin_zhangl 2 лет назад
Родитель
Сommit
37b6afe235

+ 20 - 19
.env.development

@@ -1,19 +1,20 @@
-# just a flag
-ENV='development'
-
-# base api
-#VUE_APP_BASE_API=''
-#VUE_APP_BASE_DO_API='http://local.ng.frontend.api.com'
-#VUE_APP_CDN_API='http://16.163.228.151:8041'
-#VUE_APP_BASE_WEBSITE='http://local.ng.frontend.ele.com'
-#VUE_APP_BASE_PAY_STACK_PUBLIC_KEY='pk_test_2eed10135c4a958c5073795b22854ded9d1a6c55'
-#VUE_APP_ACCESS_TOKEN_PREFIX='Bearer '
-
-
-
-#VUE_APP_BASE_API=''
-#VUE_APP_BASE_DO_API='http://16.163.228.151:8043'
-#VUE_APP_CDN_API='http://16.163.228.151:8041'
-#VUE_APP_BASE_WEBSITE='http://16.163.228.151:8045'
-#VUE_APP_BASE_PAY_STACK_PUBLIC_KEY='pk_test_2eed10135c4a958c5073795b22854ded9d1a6c55'
-#VUE_APP_ACCESS_TOKEN_PREFIX='Bearer '
+# just a flag
+ENV='development'
+
+# base api
+#VUE_APP_BASE_API=''
+#VUE_APP_BASE_DO_API='http://local.ng.frontend.api.com'
+#VUE_APP_CDN_API='http://16.163.228.151:8041'
+#VUE_APP_BASE_WEBSITE='http://local.ng.frontend.ele.com'
+#VUE_APP_BASE_PAY_STACK_PUBLIC_KEY='pk_test_2eed10135c4a958c5073795b22854ded9d1a6c55'
+#VUE_APP_ACCESS_TOKEN_PREFIX='Bearer '
+
+
+
+# base api
+VUE_APP_BASE_API=''
+VUE_APP_BASE_DO_API='http://16.163.228.151:8043'
+VUE_APP_CDN_API='http://16.163.228.151:8041'
+VUE_APP_BASE_WEBSITE='http://16.163.228.151:8045'
+VUE_APP_BASE_PAY_STACK_PUBLIC_KEY='pk_test_2eed10135c4a958c5073795b22854ded9d1a6c55'
+VUE_APP_ACCESS_TOKEN_PREFIX='Bearer '

+ 16 - 16
.env.staging

@@ -7,22 +7,22 @@ VUE_APP_BASE_PAY_STACK_PUBLIC_KEY='pk_test_2eed10135c4a958c5073795b22854ded9d1a6
 VUE_APP_ACCESS_TOKEN_PREFIX='Bearer '
 
 # mips
-# api请求地址
-#VUE_APP_BASE_API='http://16.163.228.151:8043'
-# 文件下载地址
-#VUE_APP_BASE_DO_API='http://16.163.228.151:8043'
-# CDN文件地址
-#VUE_APP_CDN_API='http://16.163.228.151:8016'
-# 会员页面地址
-#VUE_APP_BASE_WEBSITE='http://16.163.228.151:8045'
+api请求地址
+VUE_APP_BASE_API=''
+文件下载地址
+VUE_APP_BASE_DO_API='http://16.163.228.151:8043'
+CDN文件地址
+VUE_APP_CDN_API='http://16.163.228.151:8016'
+会员页面地址
+VUE_APP_BASE_WEBSITE='http://16.163.228.151:8045'
 
 
 # test
-# api请求地址
-VUE_APP_BASE_API='http://16.163.228.151:8018'
-# 文件下载地址
-VUE_APP_BASE_DO_API='http://16.163.228.151:8018'
-# CDN文件地址
-VUE_APP_CDN_API='http://16.163.228.151:8021'
-# 会员页面地址
-VUE_APP_BASE_WEBSITE='http://16.163.228.151:8017'
+# # api请求地址
+# VUE_APP_BASE_API='http://16.163.228.151:8018'
+# # 文件下载地址
+# VUE_APP_BASE_DO_API='http://16.163.228.151:8018'
+# # CDN文件地址
+# VUE_APP_CDN_API='http://16.163.228.151:8021'
+# # 会员页面地址
+# VUE_APP_BASE_WEBSITE='http://16.163.228.151:8017'

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "vue-element-admin",
-  "version": "4.3.2",
+  "version": "4.3.1",
   "description": "A magical vue admin. An out-of-box UI solution for enterprise applications. Newest development stack of vue. Lots of awesome features",
   "author": "Pan <panfree23@gmail.com>",
   "scripts": {

+ 420 - 122
src/components/TreeChart/index.vue

@@ -1,191 +1,489 @@
 <template>
-  <div class="echarts-container" />
+  <div id="main" class="echarts-container" />
 </template>
 <script>
-import * as echarts from 'echarts/core'
-import { TooltipComponent } from 'echarts/components'
-import { TreeChart } from 'echarts/charts'
-import { CanvasRenderer } from 'echarts/renderers'
-echarts.use([TooltipComponent, TreeChart, CanvasRenderer])
-let myChart
-let option
+import { TreeChart } from "echarts/charts";
+import { TooltipComponent } from "echarts/components";
+import * as echarts from "echarts/core";
+import { CanvasRenderer } from "echarts/renderers";
+
+echarts.use([TooltipComponent, TreeChart, CanvasRenderer]);
+// let this.myChart;
+let option;
+
+var treeNodePadding = 50; //节点间最小间隔
+
+var treeTopPadding = 120; //tree距顶端的距离
+
+var rightNode; //最右侧节点,用于计算偏移量
 export default {
-  name: 'TreeChart',
+  name: "TreeChart",
+  data() {
+    return {
+      myChart: null,
+      centerLoca: [],
+      fontSize: 6,
+      chartWidth: 0,
+      chartHeight: 0,
+      center: [this.chartWidth, "50%"],
+    };
+  },
   props: {
     treeData: {
       type: Object,
       default: () => {
-        return {}
-      }
-    }
+        return {};
+      },
+    },
+    topDeep: Number,
+    type: String,
+    clickNodeList: Array,
+  },
+  watch: {
+    clickNodeList: {
+      handler(newValue, old) {
+        if (newValue) {
+          this.init();
+        }
+      },
+    },
+    treeData: {
+      handler(newValue, old) {
+        console.log(newValue);
+        if (newValue) {
+          this.init();
+        }
+      },
+    },
+    chartWidth: {
+      handler(newValue, old) {
+        console.log(newValue);
+        if (newValue) {
+          this.init();
+        }
+      },
+    },
   },
   mounted() {
-    this.init()
+    this.init();
     // 监听树图节点的点击事件
-    myChart.on('click', (e) => {
-      // console.log('e:', e)
-      this.$emit('clickNode', e)
-    })
+    this.myChart.on("click", (e) => {
+      console.log("e:", e);
+      this.$emit("clickNode", e);
+    });
   },
   methods: {
     init() {
+      const that = this;
       // console.log('$el:', this.$el)
-      myChart = echarts.init(this.$el)
+      that.myChart = echarts.init(this.$el);
+      that.myChart.clear();
       option = {
-        tooltip: { // 提示框浮层设置
-          trigger: 'item',
-          triggerOn: 'mousemove', // 提示框触发条件
+        tooltip: {
+          // 提示框浮层设置
+          trigger: "item",
+          triggerOn: "mousemove", // 提示框触发条件
           enterable: true, // 鼠标是否可进入提示框浮层中,默认false
           confine: true, // 是否将tooltip框限制在图表的区域内
-          formatter: function(params) { // 提示框浮层内容格式器,支持字符串模板和回调函数两种形式
-            // console.log('params:', params)
-            return params.marker + params.name + '<br/>' + '$ ' + (params.value || '--')
+          padding: [5, 10],
+          formatter: function (params) {
+            // 提示框浮层内容格式器,支持字符串模板和回调函数两种形式
+            const relationStr =
+              "<div style='display: flex;flex-direction: column;'>" +
+              "<div>" +
+              '<span style="color: #606266;">' +
+              that.$t("atlas.numberLayers") +
+              ": " +
+              "</span>" +
+              '<span style="color: #000000;">' +
+              (Number(params.data.TOP_NETWORK_DEEP) - Number(that.topDeep)) +
+              "</span>" +
+              "</div>" +
+              "<div>" +
+              '<span style="color: #606266;">' +
+              that.$t("atlas.memberCode") +
+              ": " +
+              "</span>" +
+              '<span style="color: #000000;">' +
+              params.data.USER_NAME +
+              "</span>" +
+              "</div>" +
+              "<div>" +
+              '<span style="color: #606266;">' +
+              that.$t("atlas.name") +
+              ": " +
+              "</span>" +
+              '<span style="color: #000000;">' +
+              params.data.REAL_NAME +
+              "</span>" +
+              "</div>" +
+              "<div>" +
+              '<span style="color: #606266;">' +
+              that.$t("atlas.level") +
+              ": " +
+              "</span>" +
+              '<span style="color: #000000;">' +
+              params.data.DEC_LV_NAME +
+              "</span>" +
+              "</div>" +
+              "<div>" +
+              '<span style="color: #606266;">' +
+              that.$t("atlas.highest") +
+              ": " +
+              "</span>" +
+              '<span style="color: #000000;">' +
+              params.data.EMP_LV_NAME +
+              "," +
+              params.data.CROWN_LV_NAME +
+              "</span>" +
+              "</div>" +
+              "<div>" +
+              '<span style="color: #606266;">' +
+              that.$t("atlas.periodNumber") +
+              ": " +
+              "</span>" +
+              '<span style="color: #000000;">' +
+              params.data.PERIOD_AT +
+              "</span>" +
+              "</div>" +
+              "</div>";
+            const networkStr =
+              "<div style='display: flex;flex-direction: column;'>" +
+              "<div>" +
+              '<span style="color: #606266;">' +
+              that.$t("atlas.memberCode") +
+              ": " +
+              "</span>" +
+              '<span style="color: #000000;">' +
+              params.data.USER_NAME +
+              "</span>" +
+              "</div>" +
+              "<div>" +
+              '<span style="color: #606266;">' +
+              that.$t("atlas.name") +
+              ": " +
+              "</span>" +
+              '<span style="color: #000000;">' +
+              params.data.REAL_NAME +
+              "</span>" +
+              "</div>" +
+              "<div>" +
+              '<span style="color: #606266;">' +
+              that.$t("atlas.level") +
+              ": " +
+              "</span>" +
+              '<span style="color: #000000;">' +
+              params.data.DEC_LV_NAME +
+              "</span>" +
+              "</div>" +
+              "<div>" +
+              '<span style="color: #606266;">' +
+              that.$t("atlas.highest") +
+              ": " +
+              "</span>" +
+              '<span style="color: #000000;">' +
+              params.data.EMP_LV_NAME +
+              "," +
+              params.data.CROWN_LV_NAME +
+              "</span>" +
+              "</div>" +
+              "<div>" +
+              '<span style="color: #606266;">' +
+              that.$t("atlas.periodNumber") +
+              ": " +
+              "</span>" +
+              '<span style="color: #000000;">' +
+              params.data.PERIOD_AT +
+              "</span>" +
+              "</div>" +
+              "</div>";
+
+            return that.type === "placement" ? relationStr : networkStr;
           },
           // valueFormatter: function (value) { // tooltip 中数值显示部分的格式化回调函数
           //   return '$' + value.toFixed(2)
           // },
-          backgroundColor: '#FFF', // 提示框浮层的背景颜色
-          borderColor: '#1890FF', // 提示框浮层的边框颜色
-          borderWidth: 1, // 提示框浮层的边框宽
+          backgroundColor: "rgba(250,250,250,0.99)", // 提示框浮层的背景颜色
+          borderColor: "#1890FF", // 提示框浮层的边框颜色
+          borderWidth: 0.5, // 提示框浮层的边框宽
           borderRadius: 8, // 提示框浮层圆角
-          padding: [6, 8], // 提示框浮层的内边距
-          textStyle: { // 提示框浮层的文本样式
-            color: '#333', // 文字颜色
-            fontWeight: 400, // 字体粗细
-            fontSize: 16, // 字体大小
-            lineHeight: 20, // 行高
-            width: 60, // 文本显示宽度
+          textStyle: {
+            // 提示框浮层的文本样式
+            color: "#333", // 文字颜色
+            // fontWeight: 400, // 字体粗细
+            // fontSize: that.fontSize, // 字体大小
+            // lineHeight: 20, // 行高
+            // width: 60, // 文本显示宽度
             // 文字超出宽度是否截断或者换行;只有配置width时有效
-            overflow: 'breakAll', // truncate截断,并在末尾显示ellipsis配置的文本,默认为...;break换行;breakAll换行,并强制单词内换行
-            ellipsis: '...'
+            overflow: "breakAll", // truncate截断,并在末尾显示ellipsis配置的文本,默认为...;break换行;breakAll换行,并强制单词内换行
+            ellipsis: "...",
+          },
+          extraCssText:
+            "min-height:100px;box-shadow: 0 0 9px rgba(0, 0, 0, 0.3);text-align: left;", // 额外添加到浮层的css样式
+          axisPointer: {
+            type: "shadow",
+            shadowStyle: {
+              color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
+                { offset: 0, color: "rgba(255, 255, 255, 0)" },
+                { offset: 1, color: "rgba(37, 107, 230, 0.18)" },
+              ]),
+            },
           },
-          extraCssText: 'box-shadow: 0 0 9px rgba(0, 0, 0, 0.3);text-align: right;' // 额外添加到浮层的css样式
         },
         series: [
           {
-            width: '100%',
-            height: '100%',
-            type: 'tree',
+            width: that.chartWidth + "px",
+            height: "100%",
+            type: "tree",
             data: [this.treeData],
-            name: '树图',
-            top: '10%', // 组件离容器上侧的距离,像素值20,或相对容器的百分比20%
-            left: '5%', // 组件离容器左侧的距离
-            bottom: '1%', // 组件离容器下侧的距离
-            right: '2%', // 组件离容器右侧的距离
-            layout: 'orthogonal', // 树图的布局,正交orthogonal和径向radial两种
-            orient: 'TB', // 树图中正交布局的方向,'LR','RL','TB','BT',只有布局是正交时才生效
-            edgeShape: 'polyline', // 树图边的形状,有曲线curve和折线polyline两种,只有正交布局下生效
+            name: "树图",
+            top: "1%", // 组件离容器上侧的距离,像素值20,或相对容器的百分比
+            left: "1%", // 组件离容器左侧的距离
+            bottom: "1%", // 组件离容器下侧的距离
+            right: "1%", // 组件离容器右侧的距离
+            layout: "orthogonal", // 树图的布局,正交orthogonal和径向radial两种
+            orient: "TB", // 树图中正交布局的方向,'LR','RL','TB','BT',只有布局是正交时才生效
+            edgeShape: "polyline", // 树图边的形状,有曲线curve和折线polyline两种,只有正交布局下生效
+            // edgeForkPosition:"10%",
             roam: true, // 是否开启鼠标缩放或平移,默认false
+            zoom: 0.5,
             scaleLimit: {
               min: 0.5,
-              max: 10
+              max: 10,
+            },
+            center: that.center || null,
+            // center: [5, 5],
+            initialTreeDepth: -1, // 树图初始的展开层级(深度),根节点是0,不设置时全部展开
+            // symbol: 'emptyCircle', // 标记的图形,默认是emptyCircle;circle,rect,roundRect,triangle,diamond,pin,arrow,none
+            symbol: function (value, params) {
+              // params.data节点的所有数据
+              if (params.data.leaf == true) {
+                return "emptyCircle";
+              } else if (params.data.leaf == false) {
+                return "circle";
+              }
             },
-            initialTreeDepth: 5, // 树图初始的展开层级(深度),根节点是0,不设置时全部展开
-            // symbol: 'arrow', // 标记的图形,默认是emptyCircle;circle,rect,roundRect,triangle,diamond,pin,arrow,none
-            symbolRotate: 270, // 配合arrow图形使用效果较好
-            symbolSize: 16, // 大于0时是圆圈,等于0时不展示,标记的大小
-            itemStyle: { // 树图中每个节点的样式
-              color: '#1890FF', // 节点未展开时的填充色
-              borderColor: 'rgba(255, 144, 0, 1)', // 图形的描边颜色
-              borderWidth: 1, // 描边线宽,为0时无描边
-              borderType: 'dotted', // 描边类型
-              borderCap: 'square', // 指定线段末端的绘制方式butt方形结束,round圆形结束,square
-              shadowColor: 'rgba(0,121,221,0.3)', // 阴影颜色
-              shadowBlur: 16, // 图形阴影的模糊大小
-              opacity: 1 // 图形透明度
+            // symbolRotate: 270, // 配合arrow图形使用效果较好
+            symbolSize: 10, // 大于0时是圆圈,等于0时不展示,标记的大小
+            itemStyle: {
+              // 树图中每个节点的样式
+              color: "#1890FF", // 节点未展开时的填充色
+              borderColor: "rgba(255, 144, 0, 1)", // 图形的描边颜色
+              borderWidth: 0.5, // 描边线宽,为0时无描边
+              borderType: "dotted", // 描边类型
+              borderCap: "square", // 指定线段末端的绘制方式butt方形结束,round圆形结束,square
+              shadowColor: "rgba(0,121,221,0.3)", // 阴影颜色
+              shadowBlur: 12, // 图形阴影的模糊大小
+              opacity: 1, // 图形透明度
             },
-            label: { // 每个节点对应的文本标签样式
+            label: {
+              // 每个节点对应的文本标签样式
               show: true, // 是否显示标签
-              distance: 8, // 文本距离图形元素的距离
-              position: 'left', // 标签位置
-              verticalAlign: 'middle', // 文字垂直对齐方式,默认自动,top,middle,bottom
-              align: 'center', // 文字水平对齐方式,默认自动,left,right,center
-              fontSize: 16, // 字体大小
-              color: '#333', // 字体颜色
-              backgroundColor: '#F0F5FA', // 文字块的背景颜色
-              borderColor: '#1890FF', // 文字块边框颜色
-              borderWidth: 1, // 文字块边框宽度
-              borderType: 'solid', // 文字块边框描边类型 solid dashed dotted
-              borderRadius: 4, // 文字块的圆角
-              padding: [6, 12], // 文字块内边距
-              shadowColor: 'rgba(0,121,221,0.3)', // 文字块的背景阴影颜色
+              // distance: 22, // 文本距离图形元素的距离
+              position: "bottom", // 标签位置
+              verticalAlign: "middle", // 文字垂直对齐方式,默认自动,top,middle,bottom
+              align: "center", // 文字水平对齐方式,默认自动,left,right,center
+              fontSize: that.fontSize, // 字体大小
+              color: "#333", // 字体颜色
+              backgroundColor: "#F0F5FA", // 文字块的背景颜色
+              borderColor: "#1890FF", // 文字块边框颜色
+              borderWidth: 0.5, // 文字块边框宽度
+              borderType: "solid", // 文字块边框描边类型 solid dashed dotted
+              borderRadius: 6, // 文字块的圆角
+              padding: [5, 6], // 文字块内边距
+              shadowColor: "rgba(0,121,221,0.6)", // 文字块的背景阴影颜色
               shadowBlur: 6, // 文字块的背景阴影长度
-              width: 60,
+              width: 80,
               // 文字超出宽度是否截断或者换行;只有配置width时有效
-              overflow: 'truncate', // truncate截断,并在末尾显示ellipsis配置的文本,默认为...;break换行;breakAll换行,并强制单词内换行
-              ellipsis: '...'
+              overflow: "truncate", // truncate截断,并在末尾显示ellipsis配置的文本,默认为...;break换行;breakAll换行,并强制单词内换行
+              ellipsis: "...",
+              formatter: function (params) {
+                return (
+                  params.data.USER_NAME + "\n" + "\n" + params.data.REAL_NAME
+                );
+                // return params.data.REAL_NAME
+              },
             },
-            lineStyle: { // 树图边的样式
-              color: 'rgba(0,0,0,.35)', // 树图边的颜色
-              width: 2, // 树图边的宽度
+
+            lineStyle: {
+              // 树图边的样式
+              color: "rgba(0,0,0,.35)", // 树图边的颜色
+              width: 1, // 树图边的宽度
               curveness: 0.5, // 树图边的曲度
-              shadowColor: 'rgba(0, 0, 0, 0.5)', // 阴影颜色
-              shadowBlur: 10 // 图形阴影的模糊大小
+              shadowColor: "rgba(0, 0, 0, 0.5)", // 阴影颜色
+              shadowBlur: 10, // 图形阴影的模糊大小
             },
-            emphasis: { // 树图中图形和标签高亮的样式
+            emphasis: {
+              // 树图中图形和标签高亮的样式
               disabled: false, // 是否关闭高亮状态,默认false
               // 在高亮图形时,是否淡出其它数据的图形已达到聚焦的效果
-              focus: 'self', // none不淡出其他图形(默认);self只聚焦当前高亮的数据图形;series聚焦当前高亮的数据所在系列的所有图形;ancestor聚焦所有祖先节点;descendant聚焦所有子孙节点;relative聚焦所有子孙和祖先节点
-              blurScope: 'coordinateSystem', // 开启focus时,配置淡出的范围,coordinateSystem淡出范围为坐标系(默认);series淡出范围为系列;global淡出范围为全局
-              itemStyle: { // 该节点的样式
-                color: '#1890FF', // 图形的颜色
+              focus: "relative", // none不淡出其他图形(默认);self只聚焦当前高亮的数据图形;series聚焦当前高亮的数据所在系列的所有图形;ancestor聚焦所有祖先节点;descendant聚焦所有子孙节点;relative聚焦所有子孙和祖先节点
+              blurScope: "coordinateSystem", // 开启focus时,配置淡出的范围,coordinateSystem淡出范围为坐标系(默认);series淡出范围为系列;global淡出范围为全局
+              itemStyle: {
+                // 该节点的样式
+                color: "#1890FF", // 图形的颜色
                 // borderColor: 'rgba(255, 144, 0, 1)', // 图形的描边颜色
-                borderWidth: 1, // 描边线宽,为0时无描边
-                borderType: 'solid', // 描边类型 solid dashed dotted
-                borderCap: 'square', // 指定线段末端的绘制方式butt方形结束,round圆形结束,square
-                shadowColor: 'rgba(0,121,221,0.3)', // 阴影颜色
+                // borderWidth: 1, // 描边线宽,为0时无描边
+                borderType: "solid", // 描边类型 solid dashed dotted
+                borderCap: "square", // 指定线段末端的绘制方式butt方形结束,round圆形结束,square
+                shadowColor: "rgba(0,121,221,0.3)", // 阴影颜色
                 shadowBlur: 12, // 图形阴影的模糊大小
-                opacity: 1 // 图形透明度
+                opacity: 1, // 图形透明度
               },
-              lineStyle: { // 树图边的样式
-                color: 'rgba(0,0,0,.45)', // 树图边的颜色
+              lineStyle: {
+                // 树图边的样式
+                color: "rgba(0,0,0,.45)", // 树图边的颜色
                 width: 2, // 树图边的宽度
                 curveness: 0.5, // 树图边的曲度
-                shadowColor: 'rgba(0, 0, 0, 0.5)', // 阴影颜色
-                shadowBlur: 6 // 图形阴影的模糊大小
+                shadowColor: "rgba(0, 0, 0, 0.5)", // 阴影颜色
+                shadowBlur: 6, // 图形阴影的模糊大小
+              },
+              label: {
+                // 高亮标签的文本样式
+                color: "#333",
+                fontWeight: 600,
               },
-              label: { // 高亮标签的文本样式
-                color: '#333',
-                fontWeight: 600
-              }
             },
-            blur: { // 淡出状态的相关配置,开启emphasis.focus后有效
+            blur: {
+              // 淡出状态的相关配置,开启emphasis.focus后有效
               itemStyle: {}, // 节点的样式
               lineStyle: {}, // 树图边的样式
-              label: {} // 淡出标签的文本样式
+              label: {}, // 淡出标签的文本样式
             },
-            leaves: { // 叶子节点的特殊配置
-              label: { // 叶子节点的文本标签样式
-                distance: 8,
+            leaves: {
+              // 叶子节点的特殊配置
+              label: {
+                // 叶子节点的文本标签样式
+                // distance: 22,
                 // color: '#1890FF',
-                position: 'right',
-                verticalAlign: 'middle',
-                align: 'left'
+                position: "bottom",
+                verticalAlign: "middle",
+                align: "center",
               },
               itemStyle: {}, // 叶子节点的样式
               emphasis: {}, // 叶子节点高亮状态的配置
               blur: {}, // 叶子节点淡出状态的配置
-              select: {} // 叶子节点选中状态的配置
+              select: {}, // 叶子节点选中状态的配置
             },
             animation: true, // 是否开启动画
             expandAndCollapse: true, // 子树折叠和展开的交互,默认打开
-            animationDuration: 550, // 初始动画的时长
-            animationEasing: 'linear', // 初始动画的缓动效果
+            animationDuration: 500, // 初始动画的时长
+            animationEasing: "linear", // 初始动画的缓动效果
             animationDelay: 0, // 初始动画的延迟
-            animationDurationUpdate: 750, // 数据更新动画的时长
-            animationEasingUpdate: 'cubicInOut', // 数据更新动画的缓动效果
-            animationDelayUpdate: 0 // 数据更新动画的延迟
+            animationDurationUpdate: 500, // 数据更新动画的时长
+            animationEasingUpdate: "cubicInOut", // 数据更新动画的缓动效果
+            animationDelayUpdate: 0, // 数据更新动画的延迟
+          },
+        ],
+      };
+
+      option && that.myChart.setOption(option, true);
+      that.resize();
+
+      // that.adjustTreeView();
+      that.myChart.getZr().off("mousewheel");
+      that.myChart.getZr().on("mousewheel", (param) => {
+        let currentOption = that.myChart.getOption();
+        // console.log(currentOption);
+        if (currentOption.series[0]) {
+          let zoom = currentOption.series[0].zoom;
+          // that.fontSize = 10 * zoom
+          currentOption.textStyle.fontSize = 10 * zoom;
+          currentOption.series[0].label.fontSize = 8 * 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);
+        }
+      });
+    },
+
+    resize() {
+      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; //层级之间的高度
+      let currentHeight = layer_height * (dep + 1) || layer_height;
+      let newHeight = Math.max(currentHeight, layer_height);
+      this.chartHeight = newHeight + "px";
+      let layer_width = 90; // 兄弟节点之间的距离
+      let currentWidth = layer_width * (elesArr.length - 1) || layer_width;
+      let newWidth = Math.max(currentWidth, layer_width);
+      console.log(newWidth);
+      if (newWidth < 200) {
+        this.center[0] = '-70%';
+        this.center[1] = (dep * 2) + '0%';
+
+      }else if (newWidth > 200 && newWidth < 500) {
+        this.center[0] = '-56%';
+        this.center[1] = (dep * 1.5) + '0%';
+
+      }else if (newWidth > 500 && newWidth < 1000) {
+        this.center[0] = '-30%';
+        this.center[1] = (dep) + '0%';
+
+      } else if (newWidth > 1000){
+        this.center[0] = elesArr.length > 60 ? newWidth * 1.5 : newWidth * 1.2;
+        this.center[1] = (dep ) + '0%';
+      }
+      this.chartWidth = newWidth;
+
+      window.addEventListener("resize", () => {
+        this.myChart.resize();
+      });
+    },
+
+    doGlobalTreeChart(ec, data) {
+      // this.myChart.setOption(getGlobalTreeOption());
+      //生成图表后做调整
+      this.adjustTreeView();
+    },
+
+    //调整tree显示
+    adjustTreeView() {
+      var zr = this.myChart.getZr();
+      var domWidth = zr.painter.getWidth();
+      var treeWidth = this.getTreeWidth(zr);
+      if (treeWidth <= domWidth) return;
+    },
+
+    //计算最左边节点和最右边节点(symbol为image或icon)的间隔即为树图宽度
+
+    getTreeWidth(zr) {
+      var nodes = zr.storage._roots;
+      console.log(nodes);
+      let max = 0;
+      let min = 0;
+      for (var i = 0; i < nodes.length; i++) {
+        if (nodes[i].type == "image" || nodes[i].type == "icon") {
+          var nodeX = nodes[i].style.x;
+
+          if (nodeX > max) {
+            max = nodeX;
+
+            rightNode = nodes[i];
+
+            continue;
+          }
+
+          if (nodeX < min) {
+            min = nodeX;
           }
-        ]
+        }
       }
-      myChart.setOption(option)
-    }
-  }
-}
+
+      return max - min;
+    },
+  },
+};
 </script>
 <style lang="scss" scoped>
 .echarts-container {
   width: 100%;
-  height: calc( 100vh - 100px )
+  height: calc(100vh - 105px);
 }
 </style>
+

+ 4 - 1
src/lang/en.js

@@ -114,7 +114,9 @@ export default {
     resetPassword: 'Reset Password',
     // 二级菜单/接口-networkChart
     placementNetwork: 'Placement Network',
+    placementNetworkEx: 'Placement Network Ex',
     sponsorNetwork: 'Sponsor Network',
+    sponsorNetworkEx: 'Sponsor Network Ex',
     brandAmbassadorList: 'Brand Ambassador List',
     // 二级菜单/接口-bonusManagement
     myAccount: 'My Account',
@@ -367,7 +369,8 @@ export default {
     lgaName: 'Local Government Area',
     cityName: 'City',
     address: 'Detailed Address',
-    memberNotFound: 'Member Not Found'
+    memberNotFound: 'Member Not Found',
+    declarationCenterNumber:'Sponsor Code'
   },
 
   user: {

+ 6 - 1
src/lang/zh.js

@@ -114,7 +114,9 @@ export default {
     resetPassword: '重设密码',
     // 二级菜单/接口-networkChart
     placementNetwork: '安置网络',
+    placementNetworkEx: '安置网络Ex',
     sponsorNetwork: '推荐网路',
+    sponsorNetworkEx: '推荐网路Ex',
     brandAmbassadorList: 'BA会员',
     // 二级菜单/接口-bonusManagement
     myAccount: '我的账户',
@@ -365,7 +367,10 @@ export default {
     lgaName: '行政区',
     cityName: '城市',
     address: '详细地址',
-    memberNotFound: '找不到这个用户'
+    memberNotFound: '找不到这个用户',
+    declarationCenterNumber:'报单中心编号'
+
+
   },
   user: {
     email: '电子邮箱',

+ 3 - 3
src/layout/components/Sidebar/SidebarItem.vue

@@ -25,12 +25,12 @@
 </template>
 
 <script>
-import path from 'path'
-import { generateTitle,generateTitleWiki } from '@/utils/i18n'
+import { generateTitle, generateTitleWiki } from '@/utils/i18n'
 import { isExternal } from '@/utils/validate'
+import path from 'path'
+import FixiOSBug from './FixiOSBug'
 import Item from './Item'
 import AppLink from './Link'
-import FixiOSBug from './FixiOSBug'
 
 export default {
   name: 'SidebarItem',

+ 2 - 2
src/router/modules/atlas.js

@@ -21,13 +21,13 @@ const atlasRouter = {
     {
       path: 'network-ex', // 安置网络Ex
       component: () => import('@/views/atlas/placement-network-ex'),
-      name: 'PlacementNetworkEx',
+      name: 'placementNetworkEx',
       meta: { title: 'Placement Network Ex', icon: 'user', noCache: true }
     },
     {
       path: 'relation-ex', // 推荐网络Ex
       component: () => import('@/views/atlas/sponsor-network-ex'),
-      name: 'SponsorNetworkEx',
+      name: 'sponsorNetworkEx',
       meta: { title: 'Sponsor Network Ex', icon: 'user', noCache: true }
     },
     {

+ 8 - 5
src/store/modules/user.js

@@ -1,8 +1,8 @@
-import {backendQuickLogin, getBaseInfo, getMessageData, getUserInfo, isLoginVerify, login} from '@/api/user'
-import {getToken, removeToken, setToken} from '@/utils/auth'
-import router, {resetRouter} from '@/router'
-import usersInfo from '@/utils/usersInfo'
-import {Message} from "element-ui";
+import { backendQuickLogin, getBaseInfo, getMessageData, getUserInfo, isLoginVerify, login } from '@/api/user';
+import router, { resetRouter } from '@/router';
+import { getToken, removeToken, setToken } from '@/utils/auth';
+import usersInfo from '@/utils/usersInfo';
+import { Message } from "element-ui";
 
 const state = {
   token: getToken(),
@@ -128,6 +128,9 @@ const actions = {
     return new Promise((resolve, reject) => {
       getBaseInfo({version: 'v2'}).then(response => {
         let ret = response.data
+        console.log(ret)
+        ret.menu[3].child[2].routePath = 'atlas/network-ex'
+        ret.menu[3].child[3].routePath = 'atlas/relation-ex'
         usersInfo.clearBaseInfo()
         usersInfo.setBaseInfo(ret)
         resolve(response)

+ 109 - 106
src/views/atlas/placement-network-ex.vue

@@ -1,14 +1,46 @@
 
 <template>
-  <div>
+  <div v-loading="loading" class="treeCharBody">
+    <div class="filter-user" style="margin: 5px 0" @keyup.enter="getMainData()">
+      <el-input
+        v-model="mainUserName"
+        size="small"
+        class="top-member"
+        style="width: 300px; margin-top: 10px"
+      >
+        <template slot="prepend">{{ $t("atlas.topMember") }}</template>
+      </el-input>
+      <el-input
+        v-model="expandDeep"
+        size="small"
+        style="width: 200px; margin-top: 10px"
+        class="spread-depth"
+      >
+        <template slot="prepend">{{ $t("atlas.spreadDepth") }}</template>
+      </el-input>
+      <el-input
+        v-show="false"
+        v-model="periodNum"
+        size="small"
+        style="width: 150px"
+      >
+        <template slot="prepend">{{ $t("atlas.periodNumber") }}</template>
+      </el-input>
+      <el-button
+        type="primary"
+        size="small"
+        style="margin-top: 10px"
+        @click="getMainData()"
+      >{{ $t("common.confirm") }}</el-button>
+    </div>
     <div v-if="treeChartShow" class="tree-chart">
-      <tree-chart :tree-data="treeData" @clickNode="getNodeData" />
+      <tree-chart :tree-data="treeData" :top-deep="topDeep" type="placement" :click-node-list="clickNodeList" @clickNode="getNodeData" />
     </div>
   </div>
 </template>
 <script>
-import treeChart from '@/components/TreeChart/index.vue'
 import { fetchMainUserInfo, fetchPlacementNetwork, fetchPlacementNetworkList } from '@/api/atlas'
+import treeChart from '@/components/TreeChart/index.vue'
 import tool from '@/utils/tool'
 
 export default {
@@ -38,68 +70,29 @@ export default {
       },
       listTopDeep: 0,
       loading: false,
-      children: [
-        {
-          name: '比较',
-          value: 29,
-          children: [
-            {
-              name: '折线图',
-              value: 1
-            },
-            {
-              name: '面积图',
-              value: 2
-            },
-            {
-              name: '柱状图',
-              value: 3
-            }
-          ]
-        },
-        {
-          name: '趋势趋势趋势趋势趋势趋势趋势趋势趋势趋势',
-          value: 9,
-          children: [
-            {
-              name: '折线图',
-              value: 1
-            },
-            {
-              name: '阶梯图',
-              value: 2
-            },
-            {
-              name: '面积图',
-              value: 3
-            },
-            {
-              name: '堆叠面积图',
-              value: 4
-            }
-          ]
-        },
-        {
-          name: '组成'
-        }
-      ]
+      clickNodeList: [],
+      clickNodeUserId: null
     }
   },
-  mounted() {
-    // this.getList()
+  created() {
     this.getMainData(null, true)
   },
+  mounted() {},
   methods: {
     getNodeData(e) {
-      console.log(e)
-      if (e.collapsed === false) {
+      // console.log(e)
+      if (e.collapsed === false && e.data.children == null) {
         console.log(e.name + '---节点展开')
       }
+      if (e.data.children == null) {
+        this.clickNodeUserId = e.data.USER_ID
+        this.getChildData(e.data, 'clickNode')
+      }
     },
     getList() {
       this.treeData = {
-        name: 'test',
-        children: this.children
+        name: null,
+        children: []
       }
     },
     getMainData(userName = null, getList = false) {
@@ -114,101 +107,111 @@ export default {
         params = { userName: that.mainUserName, periodNum: that.periodNum }
       }
       this.loading = true
-      fetchMainUserInfo(params).then(response => {
+      fetchMainUserInfo(params).then((response) => {
         const treeData = Object.assign(response.data[0])
         console.log(treeData)
         that.treeData = {
-          name: treeData.USER_NAME
+          ...treeData
         }
-
         that.topDeep = Number(treeData.TOP_NETWORK_DEEP)
         that.listPeriodNum = treeData.listPeriodNum
         if (getList) {
           // that.getListData()
-          that.getChildData(treeData)
         }
-
-        setTimeout(() => {
-          that.loading = false
-          // that.treeChartShow = true
-        }, 1.5 * 1000)
+        this.getChildData(treeData)
       })
     },
-    getChildData(data, node) {
+    getChildData(data, type) {
       const that = this
       const userId = data.USER_ID
-      // const that = data
-      // if (that.leaf) {
-      //   return ''
-      // }
-      // if (that.isExpanded) {
-      //   return ''
-      // }
+      if (data.leaf) {
+        return ''
+      }
+      if (data.isExpanded) {
+        return ''
+      }
       if (data.children !== null && data.children.length > 0) {
         return ''
       }
-      // that.displayNone = ''
+      that.loading = true
+      that.treeChartShow = false
+      fetchPlacementNetwork({
+        id: userId,
+        deep: this.expandDeep,
+        periodNum: this.periodNum
+      }).then((response) => {
+        that.listPeriodNum = response.data.periodNum
+        that.isExpanded = true
+        const resAllData = response.data.allData
 
-      this.loading = true
-      fetchPlacementNetwork({ id: userId, deep: this.expandDeep, periodNum: this.periodNum }).then(response => {
-        // this.$refs.tree.updateKeyChildren(userId, response.data.allData)
-        this.listPeriodNum = response.data.periodNum
-        // that.displayNone = 'display-none'
-        data.isExpanded = true
-        const allData = response.data.allData
-        // const allData = that.traversalTree(data,that)
-        allData.forEach((item) => {
-          console.log(item)
-          item.name = item.USER_NAME
-          if (item.children && item.children.length > 0) {
-            console.log(item.children)
-            item.children.forEach((child) => {
-              child.name = child.USER_NAME
-            })
-          }
-        })
-        // that.treeData.children = that.traversalTree( allData )
-        console.log(that.traversalTree(allData))
-        that.treeData.children = allData
+        if (type === 'clickNode') {
+          this.clickNodeList = resAllData
+          that.treeData.children = that.treeAddNode(that.treeData.children)
+        } else {
+          that.treeData.children = that.traversalTree(resAllData, that)
+        }
 
         that.treeChartShow = true
-        setTimeout(() => {
-          this.loading = false
-        }, 1.5 * 1000)
+        this.loading = false
       })
     },
     traversalTree(tree) {
       const that = this
-      console.log(tree)
       tree.forEach((item) => {
-        console.log(item)
         item.name = item.USER_NAME
         if (item.children && item.children.length > 0) {
-          console.log(item.children)
-          item.children.forEach((child) => {
-            that.traversalTree(child)
-          })
+          that.traversalTree(item.children)
+        }
+      })
+      return tree
+    },
+    treeAddNode(tree) {
+      const that = this
+      tree.forEach((item) => {
+        if (item.USER_ID == that.clickNodeUserId) {
+          item.children = this.clickNodeList
+        }
+        if (item.children && item.children.length > 0) {
+          that.treeAddNode(item.children)
         }
       })
+      return tree
     },
     getListData(page, pageSize) {
       this.filterForm.page = page
       this.filterForm.pageSize = pageSize
-      fetchPlacementNetworkList(this.filterForm).then(response => {
+      fetchPlacementNetworkList(this.filterForm).then((response) => {
         this.allData = response.data
         this.listTopDeep = response.data.listTopDeep
-        // this.treeData.children = response.data.list
+        this.treeData.children = response.data.list
         setTimeout(() => {
           this.loading = false
         }, 1.5 * 1000)
       })
     }
   }
-
 }
 </script>
 <style lang="scss" scoped>
-.tree-chart{
+.treeCharBody {
+  min-height: calc(100vh - 100px);
+}
+.filter-user {
+  font-size: 14px;
+  margin-bottom: 20px;
+  padding: 0px 20px;
+
+}
+.filter-user:after {
+  content: "";
+  display: table;
+  clear: both;
+}
+.filter-user .el-input-group {
+  float: left;
+  margin-right: 15px;
+}
+.tree-chart {
   width: 100%;
   height: 100%;
 }

+ 193 - 6
src/views/atlas/sponsor-network-ex.vue

@@ -1,28 +1,215 @@
 
 <template>
-  <div>
-    <TreeChart :tree-data="treeData" @clickNode="getNodeData" />
+  <div v-loading="loading" class="treeCharBody">
+    <div class="filter-user" style="margin: 5px 0" @keyup.enter="getMainData()">
+      <el-input
+        v-model="mainUserName"
+        size="small"
+        class="top-member"
+        style="width: 300px; margin-top: 10px"
+      >
+        <template slot="prepend">{{ $t("atlas.topMember") }}</template>
+      </el-input>
+      <el-input
+        v-model="expandDeep"
+        size="small"
+        style="width: 200px; margin-top: 10px"
+        class="spread-depth"
+      >
+        <template slot="prepend">{{ $t("atlas.spreadDepth") }}</template>
+      </el-input>
+      <el-input
+        v-show="false"
+        v-model="periodNum"
+        size="small"
+        style="width: 150px"
+      >
+        <template slot="prepend">{{ $t("atlas.periodNumber") }}</template>
+      </el-input>
+      <el-button
+        type="primary"
+        size="small"
+        style="margin-top: 10px"
+        @click="getMainData()"
+      >{{ $t("common.confirm") }}</el-button>
+    </div>
+    <div v-if="treeChartShow" class="tree-chart">
+      <tree-chart :tree-data="treeData" :top-deep="topDeep" type="sponsor" @clickNode="getNodeData" />
+    </div>
   </div>
 </template>
 <script>
+
+import { fetchMainUserInfo, fetchSponsorNetwork, fetchSponsorNetworkList } from '@/api/atlas'
 import treeChart from '@/components/TreeChart/index.vue'
+import tool from '@/utils/tool'
+
 export default {
-  name: 'SponsorNetworkEx',
+  name: 'sponsorNetworkEx',
   components: {
     treeChart
   },
   data() {
     return {
-      treeData: {}
+      treeChartShow: false,
+      treeData: {
+        name: null,
+        children: null
+      },
+      tool: tool,
+      expandDeep: 5,
+      topDeep: 0,
+      mainUserName: '',
+      periodNum: null,
+      listPeriodNum: null,
+      filterForm: {
+        userName: null,
+        deep: 5,
+        periodNum: null,
+        page: 1,
+        pageSize: 20
+      },
+      listTopDeep: 0,
+      loading: false
     }
   },
+  created() {
+    this.getMainData(null, true)
+  },
+  mounted() {},
   methods: {
-    getNodeData() {
+    getNodeData(e) {
+      console.log(e)
+      if (e.collapsed === false) {
+        console.log(e.name + '---节点展开')
+      }
+      if (e.data.children == null) {
+        this.clickNodeUserId = e.data.USER_ID
+        this.getChildData(e.data, 'clickNode')
+      }
+    },
+    getList() {
+      this.treeData = {
+        name: null,
+        children: []
+      }
+    },
+    getMainData(userName = null, getList = false) {
+      const that = this
+      this.$message({
+        message: that.$t('common.awaitData')
+      })
+      let params = {
+        periodNum: that.periodNum
+      }
+      if (that.mainUserName !== null) {
+        params = { userName: that.mainUserName, periodNum: that.periodNum }
+      }
+      this.loading = true
+      fetchMainUserInfo(params).then((response) => {
+        const treeData = Object.assign(response.data[0])
+        console.log(treeData)
+        that.treeData = {
+          ...treeData
+        }
+        that.topDeep = Number(treeData.TOP_NETWORK_DEEP)
+        that.listPeriodNum = treeData.listPeriodNum
+        if (getList) {
+          // that.getListData()
+        }
+        this.getChildData(treeData)
+      })
+    },
+    getChildData(data, type) {
+      const that = this
+      const userId = data.USER_ID
+      if (data.leaf) {
+        return ''
+      }
+      if (data.isExpanded) {
+        return ''
+      }
+      if (data.children !== null && data.children.length > 0) {
+        return ''
+      }
+      that.loading = true
+      that.treeChartShow = false
+      fetchSponsorNetwork({
+        id: userId,
+        deep: this.expandDeep,
+        periodNum: this.periodNum
+      }).then((response) => {
+        that.listPeriodNum = response.data.periodNum
+        const resAllData = response.data.allData
+        if (type === 'clickNode') {
+          this.clickNodeList = resAllData
+          that.treeData.children = that.treeAddNode(that.treeData.children)
+        } else {
+          that.treeData.children = that.traversalTree(resAllData, that)
+        }
+
+        that.treeChartShow = true
+        that.loading = false
+      })
+    },
+    traversalTree(tree) {
+      const that = this
+      tree.forEach((item) => {
+        item.name = item.USER_NAME
+        if (item.children && item.children.length > 0) {
+          that.traversalTree(item.children)
+        }
+      })
+      return tree
+    },
+    treeAddNode(tree) {
+      const that = this
+      tree.forEach((item) => {
+        if (item.USER_ID == that.clickNodeUserId) {
+          item.children = this.clickNodeList
+        }
+        if (item.children && item.children.length > 0) {
+          that.treeAddNode(item.children)
+        }
+      })
+      return tree
+    },
+    getListData(page, pageSize) {
+      this.filterForm.page = page
+      this.filterForm.pageSize = pageSize
+      fetchSponsorNetworkList(this.filterForm).then((response) => {
+        this.allData = response.data
+        this.listTopDeep = response.data.listTopDeep
+        this.treeData.children = response.data.list
+        setTimeout(() => {
+          this.loading = false
+        }, 1.5 * 1000)
+      })
     }
   }
-
 }
 </script>
 <style lang="scss" scoped>
+.treeCharBody {
+  min-height: calc(100vh - 100px);
+}
+.filter-user {
+  font-size: 14px;
+  margin-bottom: 20px;
+  padding: 0px 20px;
 
+}
+.filter-user:after {
+  content: "";
+  display: table;
+  clear: both;
+}
+.filter-user .el-input-group {
+  float: left;
+  margin-right: 15px;
+}
+.tree-chart {
+  width: 100%;
+  height: 100%;
+}
 </style>

+ 4 - 5
src/views/shop/order-list.vue

@@ -110,11 +110,11 @@
 </template>
 
 <script>
-import {downloadOrder, fetchOrderList} from '@/api/shop'
+import { downloadOrder, fetchOrderList } from '@/api/shop'
+import Pagination from '@/components/Pagination'
 import waves from '@/directive/waves'
+import { getScreenWidth } from "@/utils"
 import tool from '@/utils/tool'
-import Pagination from '@/components/Pagination'
-import {formatAmount, getScreenWidth} from "@/utils"
 
 export default {
   name: 'OrderList',
@@ -163,8 +163,7 @@ export default {
       this.listLoading = true
       fetchOrderList(this.listQuery).then(response => {
         this.tableData = response.data.list
-        this.total = +response.data.totalCount
-
+        this.total = +response.data.totalCount 
         setTimeout(() => {
           this.listLoading = false
         }, 0.5 * 1000)

+ 26 - 3
src/views/shop/standard-products.vue

@@ -102,6 +102,12 @@
               </el-row>
             </div>
             <el-divider />
+            <el-form>
+              <el-form-item :label="$t('shop.declarationCenterNumber')">
+                <el-input v-model="recUserName" :disabled="isDec == '1'" />
+              </el-form-item>
+            </el-form>
+            
             <!-- 支付方式/账户余额 {{ cashCurrency }}:  -->
             <div class="" style="margin: 15px 0;">
               <el-row :gutter="20" type="flex" style="flex-wrap: wrap;">
@@ -321,7 +327,8 @@ export default {
               value: 'userOrder'
             }
           ]
-        }
+        },
+        
       },
       payStackScreenWidth: getScreenWidth() > 500 ? '450px' : getScreenWidth() + 'px',
 
@@ -344,7 +351,11 @@ export default {
         TAX_RATE: 0,
         taxAmount: 0
       },
-      imageStyle: 'margin-top: -50px;'
+      imageStyle: 'margin-top: -50px;',
+      recRealName:null,
+      // recUserName:usersInfo.userName(),
+      recUserName:null,
+      isDec:null
     }
   },
   computed: {
@@ -358,6 +369,15 @@ export default {
       return text
     }
   },
+     watch: {
+     isDec: {
+       handler(newValue, old) {
+         if (newValue == '1') {
+            this.recUserName = usersInfo.userName();
+         }
+       },
+     }
+   },
   created() {
     this.getList()
   },
@@ -522,6 +542,8 @@ export default {
         this.freeShipping = response.data.freeShipping
         // 运费
         this.freight = response.data.freight
+        //是否是报单中心
+        this.isDec = response.data.isDec
       })
     },
     // 支付
@@ -573,7 +595,8 @@ export default {
           email: this.form.email,
           addressId: this.addressId,
           address: this.address,
-          payType: this.payType
+          payType: this.payType,
+          userName:this.recUserName
         }
         if (this.payType === 'pay_stack') {
           // PayStack支付

+ 6 - 6
src/views/user/brand-ambassador.vue

@@ -184,15 +184,15 @@
 </template>
 
 <script>
-import {fetchBrandAmbassador, createBrandAmbassador, fetchFullInfo} from '@/api/user'
-import waves from '@/directive/waves'
-import {formatAmount, getScreenWidth} from "@/utils"
+import { deleteApproachOrder } from "@/api/shop"
+import { createBrandAmbassador, fetchBrandAmbassador, fetchFullInfo } from '@/api/user'
 import Pagination from '@/components/Pagination'
-import paystack from 'vue-paystack'
+import waves from '@/directive/waves'
+import region from "@/store/modules/region"
+import { getScreenWidth } from "@/utils"
 import tool from "@/utils/tool"
 import usersInfo from "@/utils/usersInfo"
-import {deleteApproachOrder} from "@/api/shop"
-import region from "@/store/modules/region"
+import paystack from 'vue-paystack'
 
 export default {
   name: 'brandAmbassador',

+ 17 - 4
src/views/user/welcome-pack.vue

@@ -22,7 +22,7 @@
               </el-select>
             </el-form-item>
             <el-form-item :label="$t('user.stockistCode')">
-              <el-input v-model="form.decUserName" readonly />
+              <el-input v-model="form.decUserName"  :disabled="isDec == 1"/>
             </el-form-item>
 
             <el-form-item>
@@ -105,6 +105,8 @@
             <el-form-item :label="$t('shop.memberName')">
               <el-input v-model="form.realName" />
             </el-form-item>
+         
+
             <el-form-item :label="$t('shop.phoneNumber')">
               <el-input v-model="form.mobile" />
             </el-form-item>
@@ -365,7 +367,7 @@ export default {
         realName: '',
         decLv: '',
         insertUserName: '',
-        decUserName: usersInfo.userName(),
+        decUserName: '',
         recUserName: '',
         conUserName: '',
         insertUserIdCard: '',
@@ -406,7 +408,8 @@ export default {
       allDecLevel: usersInfo.getBaseInfo().decLevels,
       allOpenBank: [],
 
-      activeName: 'product'
+      activeName: 'product',
+      isDec:null
     }
   },
   computed: {
@@ -420,6 +423,15 @@ export default {
       return text
     }
   },
+     watch: {
+     isDec: {
+      handler(newValue, old) {
+         if (newValue == '1') {
+            this.form.decUserName = usersInfo.userName();
+         }
+       },
+     }
+   },
   created() {
     const regionInfo = this.$store.getters.regionInfo
     // console.log(this.$store.state.region)
@@ -436,7 +448,8 @@ export default {
         this.allGoods = response.data.allGoods
         this.userBalance = response.data.userBalance
         this.categoryType = 1
-
+          //是否是报单中心
+          this.isDec = response.data.isDec
         const settingObj = this.allGoods
         for (const i in this.allGoods) {
           this.storeNums[i] = 1