-
{{echartData.title}}
+
{{ echartData.title }}
@@ -13,6 +13,7 @@ import moment from "moment";
import { useStore } from "vuex";
import * as echarts from "echarts";
import bus from '../utils/bus.js'
+import myApi from "@/api/myApi.js";
export default {
name: "LineEchart",
@@ -27,114 +28,32 @@ export default {
});
onMounted(() => {
bus.on('foo', e => {
- console.log(e)
+ console.log(12)
getEchart();
})
- getEchart();
- });
- const getEchart = () => {
- if (store.state.selectDate === 1) {
- data = {
- legend: props.echartData.legend,
- color: props.echartData.color,
- xData: [
- "1",
- "2",
- "3",
- "4",
- "5",
- "6",
- "7",
- "8",
- "9",
- "10",
- "11",
- "12",
- "13",
- "14",
- "15",
- "16",
- "17",
- "18",
- "19",
- "20",
- "21",
- "22",
- "23",
- "24",
- "25",
- "26",
- "27",
- "28",
- "29",
- "30",
- ],
- Values: [
- 2.3, 5.3, 8.3, 5, 2.3, 5.3, 8.3, 5, 4, 5, 6, 7, 2.3, 5.3, 8.3, 5,
- 2.3, 5.3, 8.3, 5, 4, 5, 6, 7, 8.3, 5, 4, 5, 6, 7,
- ],
- type: ["bar"],
- };
- } else if (store.state.selectDate === 2) {
- data = {
- legend: props.echartData.legend,
- color: props.echartData.color,
- xData: [
- "1",
- "2",
- "3",
- "4",
- "5",
- "6",
- "7",
- "8",
- "9",
- "10",
- "11",
- "12",
- ],
- Values: [
- 2.3, 5.3, 8.3, 5, 2.3, 5.3, 8.3, 5, 4, 5, 6, 7
- ],
- type: ["bar"],
- };
- } else if (store.state.selectDate === 0) {
- var data = {
- legend: props.echartData.legend,
- color: props.echartData.color,
- xData: [
- "00",
- "01",
- "02",
- "03",
- "04",
- "05",
- "06",
- "07",
- "08",
- "09",
- "10",
- "11",
- "12",
- "13",
- "14",
- "15",
- "16",
- "17",
- "18",
- "19",
- "20",
- "21",
- "22",
- "23",
- ],
- Values: [
- 2.3, 5.3, 8.3, 5, 2.3, 5.3, 8.3, 5, 4, 5, 6, 7, 2.3, 5.3, 8.3, 5,
- 2.3, 5.3, 8.3, 5, 4, 5, 6, 7,
- ],
- type: ["bar"],
- };
+ })
+
+
+ const getEchart = async () => {
+ var xData = [];
+ var Values = [];
+ const param = {
+ filed: props.echartData.filed,
+ dataType: store.state.selectDate
}
+ const res = await myApi.getCommonHistogram(param);
+ res.data.forEach(ele => {
+ xData.push(ele.dateTime);
+ Values.push(ele.dataValue)
+ });
+
+ data = {
+ legend: props.echartData.legend,
+ color: props.echartData.color,
+ xData: xData,
+ Values: Values,
+ type: ["bar"],
+ };
let dom = document.getElementById(props.echartData.id);
if (dom) {
myChart = echarts.init(dom);
diff --git a/src/components/Date.vue b/src/components/Date.vue
index 9cac0a5..799c55e 100644
--- a/src/components/Date.vue
+++ b/src/components/Date.vue
@@ -5,7 +5,7 @@
+
+
+
\ No newline at end of file
diff --git a/src/components/ImageUpload.vue b/src/components/ImageUpload.vue
new file mode 100644
index 0000000..f9e9514
--- /dev/null
+++ b/src/components/ImageUpload.vue
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Index.vue b/src/components/Index.vue
index 20df4c1..25554e6 100644
--- a/src/components/Index.vue
+++ b/src/components/Index.vue
@@ -13,48 +13,48 @@
0.67kg