2 Commits 2804b8e400 ... 9590f9f30b

Author SHA1 Message Date
  zhangyaojie 9590f9f30b Merge branch 'main' of https://git.sxidc.com/kingdee_large_screen/pc_kingdee_large_screen 1 year ago
  zhangyaojie 38060e036b 合并代码 1 year ago
1 changed files with 25 additions and 181 deletions
  1. 25 181
      investmentNew/js/index.js

+ 25 - 181
investmentNew/js/index.js

@@ -413,8 +413,6 @@ let app = new Vue({
   },
   methods: {
     initChartR1() {
-      let that = this;
-      let sumA = 42;
       let right5 = [
         [
           ["山西焦煤", 43.8],
@@ -477,24 +475,7 @@ let app = new Vue({
           ["神农科技", 15.6],
         ],
       ];
-      // 所有在100范围外的全部变成0,其他值相应增加/减少sumA
-      right5.forEach((item) => {
-        item.forEach((item2) => {
-          if (Number(item2[1]) < 0) {
-            item2[1] = that.$set(item2, 1, Number(that.numSub(item2[1], sumA)));
-          } else if (Number(item2[1]) > 0) {
-            item2[1] = that.$set(item2, 1, Number(item2[1]) + sumA);
-          }
-          if (Number(item2[1]) < -100 - sumA) {
-            item2[1] = that.$set(item2, 1, 0);
-            item2[1] = that.$set(item2, 2, 0);
-          } else if (Number(item2[1]) > 100 + sumA) {
-            item2[1] = that.$set(item2, 1, 0);
-            item2[1] = that.$set(item2, 2, 0);
-          }
-        });
-      });
-
+      let that = this;
       const itemStyle = {
         // opacity: 0.8,
         shadowBlur: 10,
@@ -502,9 +483,8 @@ let app = new Vue({
         shadowOffsetY: 0,
         shadowColor: "rgba(0,0,0,0.3)",
       };
-      that.right2Chart = echarts.init(this.$refs["echartR1"]);
-      that.right2Chart.on("showTip", (params) => {
-        console.log(params);
+      let myChart = echarts.init(this.$refs["echartR1"]);
+      myChart.on("showTip", (params) => {
         // 如果是7或者15并且满足防抖则切换
         if (
           (params.dataIndex == 5 || params.dataIndex == 11) &&
@@ -514,7 +494,7 @@ let app = new Vue({
           setTimeout(() => {
             option.dataZoom[0].endValue = option.dataZoom[0].endValue + 6;
             option.dataZoom[0].startValue = option.dataZoom[0].startValue + 6;
-            that.right2Chart.setOption(option);
+            myChart.setOption(option);
             // 防止勿刷新做的防抖
             setTimeout(() => {
               that.echartR2Fd = true;
@@ -526,7 +506,7 @@ let app = new Vue({
           setTimeout(() => {
             option.dataZoom[0].endValue = 0;
             option.dataZoom[0].startValue = 5;
-            that.right2Chart.setOption(option);
+            myChart.setOption(option);
             // 防止勿刷新做的防抖
             setTimeout(() => {
               that.echartR2Fd = true;
@@ -535,7 +515,7 @@ let app = new Vue({
         }
       });
       let option = {
-        color: ["#04635E", "#697143", "#4A3042"],
+        color: ["#74a55d", "#cea446", "#b84b4b"],
         dataZoom: [
           {
             // start: 9,//默认为@
@@ -569,9 +549,7 @@ let app = new Vue({
           },
         ],
         legend: {
-          selectedMode: false,
           top: 10,
-          right: "6%",
           data: ["正偏差", "容差", "负偏差"],
           textStyle: {
             fontSize: 20,
@@ -591,21 +569,7 @@ let app = new Vue({
         //     fontFamily: "Microsoft YaHei",
         //   },
         //   formatter: (data) => {
-        //     return `${
-        //       data[0].value[0]
-        //     }<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${
-        //       data[0].color
-        //     }"></span> ${data[0].seriesName}:${that.numFormat(
-        //       data[0].data[2]
-        //     )}亿<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${
-        //       data[1].color
-        //     }"></span> ${data[1].seriesName}:${that.numFormat(
-        //       data[1].data[2]
-        //     )}亿<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${
-        //       data[2].color
-        //     }"></span> ${data[2].seriesName}:${that.numFormat(
-        //       data[2].data[2]
-        //     )}亿`;
+        //     return `${data[0].value[0]}<br /><span style="display:inline-block;border-radius:50%; width:14px;height:14px;background-color:${data[0].color}"></span> ${data[0].seriesName}:${data[0].data[1]}亿<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[1].color}"></span> ${data[1].seriesName}:${data[1].data[1]}亿<br /><span style="display:inline-block;border-radius:50%; width:7px;height:7px;background-color:${data[2].color}"></span> ${data[2].seriesName}:${data[2].data[1]}亿`;
         //   },
         //   axisPointer: {
         //     //  // type: 'cross',',
@@ -613,17 +577,14 @@ let app = new Vue({
         // },
         grid: {
           top: "10%",
-          right: "7%",
-          left: "7%",
-          bottom: "6%",
+          right: "4%",
+          left: "5%",
+          bottom: "5%",
         },
         yAxis: {
-          min: -101 - sumA,
-          max: 101 + sumA,
-          maxInterval: 1,
+          name: "亿元",
           splitLine: {
-            show: false,
-            // interval:,
+            show: true,
             lineStyle: {
               color: "#68b4dd66",
               type: "dashed",
@@ -632,23 +593,9 @@ let app = new Vue({
           axisLine: {
             show: false,
           },
-          axisTick: {
-            show: false,
-          },
           axisLabel: {
             show: true,
-            // formatter: '{value}',
-            formatter(data) {
-              if (data == 100 + sumA) {
-                return "100%";
-              } else if (data == -100 - sumA) {
-                return "-100%";
-              } else if (data == -5 - sumA) {
-                return "-5%";
-              } else if (data == 5 + sumA) {
-                return "5%";
-              }
-            },
+            formatter: "{value}",
             textStyle: {
               color: "#fff",
               fontSize: "20",
@@ -664,7 +611,7 @@ let app = new Vue({
         xAxis: {
           data: right5[0].map((item) => item[0]),
           axisLine: {
-            show: false, //隐藏X轴轴线
+            show: true, //隐藏X轴轴线
             lineStyle: {
               color: "#005094",
               width: 1,
@@ -678,15 +625,15 @@ let app = new Vue({
             },
           },
           axisTick: {
-            show: true, //隐藏X轴刻度
+            show: false, //隐藏X轴刻度
           },
           axisLabel: {
             show: true,
-            rotate: 20,
+            // rotate: 40,
             padding: [0, 0, 0, 0],
             textStyle: {
               color: "#fff", //X轴文字颜色
-              fontSize: 22,
+              fontSize: 20,
               fontFamily: "Microsoft YaHei",
             },
           },
@@ -698,77 +645,7 @@ let app = new Vue({
             itemStyle: itemStyle,
             data: right5[0],
             symbolSize: function (data) {
-              if ((data[2] > 0 && data[2] < 50) || data[2] == 50) {
-                return 40;
-              } else if ((data[2] > 50 && data[2] < 100) || data[2] == 100) {
-                return 70;
-              } else if (data[2] > 100) {
-                return 100;
-              }
-            },
-            markLine: {
-              symbol: "none",
-              data: [
-                {
-                  name: "100%",
-                  yAxis: 100 + sumA,
-                  lineStyle: {
-                    // color: '#fff',
-                  },
-                  label: {
-                    show: false,
-                    formatter: "{b}",
-                    position: "right",
-                    color: "#fff",
-                    fontSize: 20,
-                    label: {
-                      show: false,
-                    },
-                  },
-                },
-                {
-                  name: "5%",
-                  yAxis: 5 + sumA,
-                  lineStyle: {
-                    // color: '#fff',
-                  },
-                  label: {
-                    show: false,
-                    formatter: "{b}",
-                    position: "right",
-                    color: "#fff",
-                    fontSize: 20,
-                  },
-                },
-                {
-                  name: "-5%",
-                  yAxis: -5 - sumA,
-                  lineStyle: {
-                    // color: '#fff',
-                  },
-                  label: {
-                    show: false,
-                    formatter: "{b}",
-                    position: "right",
-                    color: "#fff",
-                    fontSize: 20,
-                  },
-                },
-                {
-                  name: "100%",
-                  yAxis: -100 - sumA,
-                  lineStyle: {
-                    // color: '#fff',
-                  },
-                  label: {
-                    show: false,
-                    formatter: "{b}",
-                    position: "right",
-                    color: "#fff",
-                    fontSize: 20,
-                  },
-                },
-              ],
+              return Math.sqrt(data[1]) * 9;
             },
           },
           {
@@ -777,13 +654,7 @@ let app = new Vue({
             itemStyle: itemStyle,
             data: right5[1],
             symbolSize: function (data) {
-              if ((data[2] > 0 && data[2] < 50) || data[2] == 50) {
-                return 40;
-              } else if ((data[2] > 50 && data[2] < 100) || data[2] == 100) {
-                return 70;
-              } else if (data[2] > 100) {
-                return 100;
-              }
+              return Math.sqrt(data[1]) * 8;
             },
           },
           {
@@ -792,44 +663,17 @@ let app = new Vue({
             itemStyle: itemStyle,
             data: right5[2],
             symbolSize: function (data) {
-              if ((data[2] > 0 && data[2] < 50) || data[2] == 50) {
-                return 40;
-              } else if ((data[2] > 50 && data[2] < 100) || data[2] == 100) {
-                return 70;
-              } else if (data[2] > 100) {
-                return 100;
-              }
+              return Math.sqrt(data[1]) * 7;
             },
           },
         ],
       };
-      that.right2Chart.on("click", function (param) {
-        if (that.versions) {
-          that.rightAdd.modelName = 1;
-          that.rightAdd.substraction =
-            param.seriesName == "正偏差"
-              ? 1
-              : param.seriesName == "容差"
-              ? 2
-              : 3;
-          that.rightAdd.projectStepCode = "";
-          that.projectNum = 313;
-          that.rightPenetrateTwo(
-            1,
-            param.seriesName == "正偏差"
-              ? 1
-              : param.seriesName == "容差"
-              ? 2
-              : 3,
-            that.findCode(param.name),
-            "right"
-          );
-        } else {
-          that.projectListTipShow = true;
-        }
+      myChart.on("click", function (param) {
+        // that.showChartLTipDouble(param.name)
+        that.projectListTipShow = true;
       });
-      that.right2Chart.setOption(option);
-      tools.loopShowTooltip(that.right2Chart, option, {
+      myChart.setOption(option);
+      tools.loopShowTooltip(myChart, option, {
         interval: 2000,
         loopSeries: true,
       });