projects/mescc/develop #24
@@ -87,7 +87,6 @@ function splitCurrentAndPrevious(factoryListResponse, targetListResponse) {
 | 
				
			|||||||
  const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init();
 | 
					  const { chipInvest, ftoInvest, chipOutput, stdOutput, bipvOutput } = init();
 | 
				
			||||||
  if (factoryListResponse) {
 | 
					  if (factoryListResponse) {
 | 
				
			||||||
    for (const factory of factoryListResponse) {
 | 
					    for (const factory of factoryListResponse) {
 | 
				
			||||||
      debugger;
 | 
					 | 
				
			||||||
      const fId = getFactoryId(factory);
 | 
					      const fId = getFactoryId(factory);
 | 
				
			||||||
      // 获取目标值
 | 
					      // 获取目标值
 | 
				
			||||||
      if (targetListResponse) {
 | 
					      if (targetListResponse) {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,7 @@
 | 
				
			|||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <DoubleRingWrapperVue :data-source="dataBundle" :period="period" />
 | 
					  <DoubleRingWrapperVue data-source="BIPV产出" :period="period" />
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
@@ -22,7 +22,7 @@ export default {
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  data() {
 | 
					  data() {
 | 
				
			||||||
    return { dataBundle: null };
 | 
					    return {};
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,7 @@
 | 
				
			|||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <DoubleRingWrapperVue :data-source="dataBundle" :period="period" />
 | 
					  <DoubleRingWrapperVue data-source="芯片产出" :period="period" />
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
@@ -22,7 +22,7 @@ export default {
 | 
				
			|||||||
    },
 | 
					    },
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  data() {
 | 
					  data() {
 | 
				
			||||||
    return { dataBundle: null };
 | 
					    return {};
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -44,8 +44,8 @@ export default {
 | 
				
			|||||||
          const year = new Date().getFullYear();
 | 
					          const year = new Date().getFullYear();
 | 
				
			||||||
          const month = new Date().getMonth() + 1;
 | 
					          const month = new Date().getMonth() + 1;
 | 
				
			||||||
          return [
 | 
					          return [
 | 
				
			||||||
            { label: `${year}年${month}月`, color: "#12f7f1" },
 | 
					            { label: `${year - 1}年${month}月`, color: "#12f7f1" },
 | 
				
			||||||
            { label: `${year - 1}年${month}月`, color: "#58adfa" },
 | 
					            { label: `${year}年${month}月`, color: "#58adfa" },
 | 
				
			||||||
          ];
 | 
					          ];
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        case "年": {
 | 
					        case "年": {
 | 
				
			||||||
@@ -63,59 +63,45 @@ export default {
 | 
				
			|||||||
      }
 | 
					      }
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    series() {
 | 
					    series() {
 | 
				
			||||||
      const template =
 | 
					      const { ftoInvest } = this.$store.getters.copilot.yield;
 | 
				
			||||||
        this.period == "日" || this.period == "周"
 | 
					      let dataList = null;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      switch (this.period) {
 | 
				
			||||||
 | 
					        case "日":
 | 
				
			||||||
 | 
					        case "周":
 | 
				
			||||||
 | 
					          dataList = ftoInvest?.current;
 | 
				
			||||||
 | 
					          break;
 | 
				
			||||||
 | 
					        default:
 | 
				
			||||||
 | 
					          dataList = [];
 | 
				
			||||||
 | 
					          dataList[0] = ftoInvest?.pervious;
 | 
				
			||||||
 | 
					          dataList[1] = ftoInvest?.current;
 | 
				
			||||||
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      return getTemplate(this.period, dataList);
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					  },
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					function getTemplate(period, dataList) {
 | 
				
			||||||
 | 
					  const year = new Date().getFullYear();
 | 
				
			||||||
 | 
					  const month = new Date().getMonth() + 1;
 | 
				
			||||||
 | 
					  return period == "日" || period == "周"
 | 
				
			||||||
    ? [
 | 
					    ? [
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
                name: "样例数据--2023年",
 | 
					          name: period == "日" ? "昨天" : "本周",
 | 
				
			||||||
                data: Array.from({ length: 7 }, () =>
 | 
					          data: dataList ?? [],
 | 
				
			||||||
                  Math.floor(Math.random() * 1000)
 | 
					 | 
				
			||||||
                ),
 | 
					 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
      ]
 | 
					      ]
 | 
				
			||||||
    : [
 | 
					    : [
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
                name: "样例数据--2023年",
 | 
					          name: period == "年" ? `${year - 1}年` : `${year - 1}年${month}月`,
 | 
				
			||||||
                data: Array.from({ length: 7 }, () =>
 | 
					          data: dataList ? dataList[0] : [],
 | 
				
			||||||
                  Math.floor(Math.random() * 1000)
 | 
					 | 
				
			||||||
                ),
 | 
					 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
                name: "样例数据--2024年",
 | 
					          name: period == "年" ? `${year}年` : `${year}年${month}月`,
 | 
				
			||||||
                data: Array.from({ length: 7 }, () =>
 | 
					          data: dataList ? dataList[1] : [],
 | 
				
			||||||
                  Math.floor(Math.random() * 1000)
 | 
					          // : Array.from({ length: 7 }, () => Math.floor(Math.random() * 1000)),
 | 
				
			||||||
                ),
 | 
					 | 
				
			||||||
        },
 | 
					        },
 | 
				
			||||||
      ];
 | 
					      ];
 | 
				
			||||||
      const ftoInvest = this.$store.getters.home.ftoInvest;
 | 
					}
 | 
				
			||||||
      if (!ftoInvest || !ftoInvest.current || !ftoInvest.previous) {
 | 
					 | 
				
			||||||
        return [
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            name: "样例数据--2023年",
 | 
					 | 
				
			||||||
            data: Array.from({ length: 7 }, () =>
 | 
					 | 
				
			||||||
              Math.floor(Math.random() * 1000)
 | 
					 | 
				
			||||||
            ),
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
          {
 | 
					 | 
				
			||||||
            name: "样例数据--2024年",
 | 
					 | 
				
			||||||
            data: Array.from({ length: 7 }, () =>
 | 
					 | 
				
			||||||
              Math.floor(Math.random() * 1000)
 | 
					 | 
				
			||||||
            ),
 | 
					 | 
				
			||||||
          },
 | 
					 | 
				
			||||||
        ];
 | 
					 | 
				
			||||||
      }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
      return [
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          name: `${new Date().getFullYear() - 1}年`,
 | 
					 | 
				
			||||||
          data: ftoInvest.previous,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
        {
 | 
					 | 
				
			||||||
          name: `${new Date().getFullYear()}年`,
 | 
					 | 
				
			||||||
          data: ftoInvest.current,
 | 
					 | 
				
			||||||
        },
 | 
					 | 
				
			||||||
      ];
 | 
					 | 
				
			||||||
    },
 | 
					 | 
				
			||||||
  },
 | 
					 | 
				
			||||||
};
 | 
					 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,7 +6,7 @@
 | 
				
			|||||||
-->
 | 
					-->
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<template>
 | 
					<template>
 | 
				
			||||||
  <DoubleRingWrapperVue data-source="标准组件输出" :period="period" />
 | 
					  <DoubleRingWrapperVue data-source="标准组件产出" :period="period" />
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script>
 | 
					<script>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -197,8 +197,8 @@ export default {
 | 
				
			|||||||
      const actualOptions = JSON.parse(JSON.stringify(this.options));
 | 
					      const actualOptions = JSON.parse(JSON.stringify(this.options));
 | 
				
			||||||
      actualOptions.series[0].data = val[0].data;
 | 
					      actualOptions.series[0].data = val[0].data;
 | 
				
			||||||
      actualOptions.series[0].name = val[0].name;
 | 
					      actualOptions.series[0].name = val[0].name;
 | 
				
			||||||
      actualOptions.series[1].data = val[1].data;
 | 
					      actualOptions.series[1].data = val?.[1]?.data || [];
 | 
				
			||||||
      actualOptions.series[1].name = val[1].name;
 | 
					      actualOptions.series[1].name = val?.[1]?.name || '';
 | 
				
			||||||
      this.actualOptions = actualOptions;
 | 
					      this.actualOptions = actualOptions;
 | 
				
			||||||
      this.initOptions(actualOptions);
 | 
					      this.initOptions(actualOptions);
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,13 +57,13 @@ export default {
 | 
				
			|||||||
    headquarterValue() {
 | 
					    headquarterValue() {
 | 
				
			||||||
      let getterName = "";
 | 
					      let getterName = "";
 | 
				
			||||||
      switch (this.dataSource) {
 | 
					      switch (this.dataSource) {
 | 
				
			||||||
        case "标准组件输出":
 | 
					        case "标准组件产出":
 | 
				
			||||||
          getterName = "stdOutput";
 | 
					          getterName = "stdOutput";
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case "芯片输出":
 | 
					        case "芯片产出":
 | 
				
			||||||
          getterName = "chipOutput";
 | 
					          getterName = "chipOutput";
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case "BIPV输出":
 | 
					        case "BIPV产出":
 | 
				
			||||||
          getterName = "bipvOutput";
 | 
					          getterName = "bipvOutput";
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
@@ -74,13 +74,13 @@ export default {
 | 
				
			|||||||
    cities() {
 | 
					    cities() {
 | 
				
			||||||
      let getterName = "";
 | 
					      let getterName = "";
 | 
				
			||||||
      switch (this.dataSource) {
 | 
					      switch (this.dataSource) {
 | 
				
			||||||
        case "标准组件输出":
 | 
					        case "标准组件产出":
 | 
				
			||||||
          getterName = "stdOutput";
 | 
					          getterName = "stdOutput";
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case "芯片输出":
 | 
					        case "芯片产出":
 | 
				
			||||||
          getterName = "chipOutput";
 | 
					          getterName = "chipOutput";
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
        case "BIPV输出":
 | 
					        case "BIPV产出":
 | 
				
			||||||
          getterName = "bipvOutput";
 | 
					          getterName = "bipvOutput";
 | 
				
			||||||
          break;
 | 
					          break;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user