|
@@ -31,19 +31,19 @@
|
|
|
<button class="btn green" @click="search">搜索</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <Mlc height="650px" :list="chartData" :units="chartUnit" :showLegend="true" />
|
|
|
+ <NormalScatterChart height="650px" :data="chartData" :showLegend="true" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Mlc from "@com/chart/line/multiple-line-chart.vue";
|
|
|
+import NormalScatterChart from "@com/chart/scatter/normal-scatter-chart.vue";
|
|
|
export default {
|
|
|
// 名称
|
|
|
name: "cutAnalyse",
|
|
|
|
|
|
// 使用组件
|
|
|
components: {
|
|
|
- Mlc
|
|
|
+ NormalScatterChart
|
|
|
},
|
|
|
|
|
|
// 数据
|
|
@@ -57,11 +57,9 @@ export default {
|
|
|
wtId: "MG01_01",
|
|
|
recorddate:new Date((new Date().getTime() - 3600 * 1000 * 24)).formatDate("yyyy-MM-dd"),
|
|
|
chartData: [{
|
|
|
- title: "",
|
|
|
- yAxisIndex: 0,
|
|
|
+ title: "风资源分析",
|
|
|
value: []
|
|
|
- }],
|
|
|
- chartUnit: ["功率(万kw)"]
|
|
|
+ }]
|
|
|
};
|
|
|
},
|
|
|
|
|
@@ -103,33 +101,22 @@ export default {
|
|
|
let that = this;
|
|
|
that.API.requestData({
|
|
|
method: "POST",
|
|
|
- subUrl: "powersaturation/powersaturationamonutchart",
|
|
|
+ subUrl: "scatter/scatterAjax",
|
|
|
data: {
|
|
|
- wtId: that.wtId
|
|
|
+ wpId: that.wpId,
|
|
|
+ pjId: that.projectId,
|
|
|
+ lnId: "",
|
|
|
+ year: (that.recorddate ? new Date(that.recorddate).getFullYear() : ""),
|
|
|
+ month: (that.recorddate ? (new Date(that.recorddate).getMonth() + 1) : ""),
|
|
|
},
|
|
|
success (res) {
|
|
|
-
|
|
|
- const keyArray = [{
|
|
|
- key: "value1",
|
|
|
- title: "功率"
|
|
|
- }];
|
|
|
-
|
|
|
let chartData = [{
|
|
|
- title: "功率",
|
|
|
- yAxisIndex: 0,
|
|
|
- value: []
|
|
|
+ title: "风资源分析",
|
|
|
+ value: (res.data || [])
|
|
|
}];
|
|
|
-
|
|
|
- keyArray.forEach((keyEle, keyIndex) => {
|
|
|
- res.data.forEach(ele => {
|
|
|
- chartData[keyIndex].value.push({
|
|
|
- text: "",
|
|
|
- value: ele[keyEle.key]
|
|
|
- });
|
|
|
- });
|
|
|
+ that.$nextTick(()=>{
|
|
|
+ that.chartData = chartData;
|
|
|
});
|
|
|
-
|
|
|
- that.chartData = chartData;
|
|
|
}
|
|
|
});
|
|
|
},
|