|
@@ -1,73 +1,80 @@
|
|
|
-<template>
|
|
|
- <div class="pageBox">
|
|
|
- <simple-line-chart :height="'100px'" v-for="(item, index) in chartData" :key="index" :title="item.title" :data="item.data" :color="item.color" :lineTitle="item.lineTitle" />
|
|
|
- </div>
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import SimpleLineChart from "../../components/chart/line/simple-line-chart.vue";
|
|
|
-export default {
|
|
|
- setup() {},
|
|
|
- components: { SimpleLineChart },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- chartData:[]
|
|
|
- };
|
|
|
- },
|
|
|
-
|
|
|
- created() {
|
|
|
- this.wtId = this.$route.params.wtId;
|
|
|
- this.wpId = this.$route.params.wpId;
|
|
|
- this.requestData();
|
|
|
- },
|
|
|
-
|
|
|
- methods:{
|
|
|
- requestData(){
|
|
|
- let that=this;
|
|
|
- that.API.requestData({
|
|
|
- method: "POST",
|
|
|
- subUrl: "healthsub/hsFjValueIndex",
|
|
|
- data:{
|
|
|
- wtId: that.wtId
|
|
|
- },
|
|
|
- success(res) {
|
|
|
-
|
|
|
- const color=["green","yellow","purple","blue","orange"];
|
|
|
- let chartData=[];
|
|
|
- let lineTitle=[];
|
|
|
-
|
|
|
- res.data.xData.forEach(ele=>{
|
|
|
- lineTitle.push(new Date(ele).formatDate("hh:mm"));
|
|
|
- });
|
|
|
-
|
|
|
- res.data.datasets.forEach((ele,index)=>{
|
|
|
- chartData.push({
|
|
|
- title:ele.name,
|
|
|
- data:ele.data,
|
|
|
- color:color[index],
|
|
|
- lineTitle
|
|
|
- });
|
|
|
- });
|
|
|
- that.chartData=chartData;
|
|
|
- },
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-};
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="less" scoped>
|
|
|
-.pageBox {
|
|
|
- width: 100%;
|
|
|
- height:calc(100% - 1.481vh * 2);
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
- justify-content: space-between;
|
|
|
- margin:1.481vh 0;
|
|
|
-
|
|
|
- .chart{
|
|
|
- width: 100%;
|
|
|
- height:25%;
|
|
|
- }
|
|
|
-}
|
|
|
+<template>
|
|
|
+ <div class="pageBox">
|
|
|
+ <wt-chooser @change="switchWt" :wpId="wpId" :wtId="wtId"></wt-chooser>
|
|
|
+ <simple-line-chart :height="'100px'" v-for="(item, index) in chartData" :key="index" :title="item.title" :data="item.data" :color="item.color" :lineTitle="item.lineTitle" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import SimpleLineChart from "../../components/chart/line/simple-line-chart.vue";
|
|
|
+import WtChooser from "@com/coms/wt-chooser/wt-chooser.vue"
|
|
|
+export default {
|
|
|
+ setup() {},
|
|
|
+ components: { SimpleLineChart ,WtChooser},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ chartData:[]
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+ created() {
|
|
|
+ this.wtId = this.$route.params.wtId;
|
|
|
+ this.wpId = this.$route.params.wpId;
|
|
|
+ this.requestData();
|
|
|
+ },
|
|
|
+
|
|
|
+ methods:{
|
|
|
+ switchWt(data){
|
|
|
+ this.$router.push(`/health/health4/healthLineChart/${data.wpId}/${data.wtId}`);
|
|
|
+ this.wtId = this.$route.params.wtId;
|
|
|
+ this.wpId = this.$route.params.wpId;
|
|
|
+ this.requestData();
|
|
|
+ },
|
|
|
+ requestData(){
|
|
|
+ let that=this;
|
|
|
+ that.API.requestData({
|
|
|
+ method: "POST",
|
|
|
+ subUrl: "healthsub/hsFjValueIndex",
|
|
|
+ data:{
|
|
|
+ wtId: that.wtId
|
|
|
+ },
|
|
|
+ success(res) {
|
|
|
+
|
|
|
+ const color=["green","yellow","purple","blue","orange"];
|
|
|
+ let chartData=[];
|
|
|
+ let lineTitle=[];
|
|
|
+
|
|
|
+ res.data.xData.forEach(ele=>{
|
|
|
+ lineTitle.push(new Date(ele).formatDate("hh:mm"));
|
|
|
+ });
|
|
|
+
|
|
|
+ res.data.datasets.forEach((ele,index)=>{
|
|
|
+ chartData.push({
|
|
|
+ title:ele.name,
|
|
|
+ data:ele.data,
|
|
|
+ color:color[index],
|
|
|
+ lineTitle
|
|
|
+ });
|
|
|
+ });
|
|
|
+ that.chartData=chartData;
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.pageBox {
|
|
|
+ width: 100%;
|
|
|
+ height:calc(100% - 1.481vh * 2);
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+
|
|
|
+ .chart{
|
|
|
+ width: 100%;
|
|
|
+ height:25%;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|