This commit is contained in:
姚宇浩 2024-06-18 10:37:02 +08:00
parent 1853dc9e12
commit 5d53cfb827
5 changed files with 112 additions and 67 deletions

View File

@ -121,7 +121,7 @@
</div>
<div
v-if="data.tab == '1'"
style="width: 100%; height: 70vh"
style="width: 100%; height: 550px;"
>
<tL
:list1="data.list1"

View File

@ -44,7 +44,7 @@
/>
</div>
</div>
<div style="width: 100%; height: 70vh">
<div style="width: 100%; height: 600px">
<eL
:list1="data.list1"
:list2="data.list2"

View File

@ -3,7 +3,7 @@
</template>
<script setup >
import { onBeforeMount, reactive, ref } from "vue";
import { onBeforeMount, reactive, ref, watch } from "vue";
// echarts
import * as echarts from "echarts";
@ -123,7 +123,7 @@ const getOption = () => {
width: 1,
},
},
min: 0, // Y
min: 0, // Y
max: function (value) {
// Y
return Math.ceil(Math.max(value.max, value.max * 1.6) / 2) * 2;
@ -208,7 +208,34 @@ const getOption = () => {
],
};
};
watch(
() => props.list1,
() => {
data.list1 = props.list1;
data.list2 = props.list2;
data.year = props.year;
data.bg = [];
data.year.forEach(() => {
data.bg.push(0);
});
getOption();
setChart();
}
);
watch(
() => props.list2,
() => {
data.list1 = props.list1;
data.list2 = props.list2;
data.year = props.year;
data.bg = [];
data.year.forEach(() => {
data.bg.push(0);
});
getOption();
setChart();
}
);
const setChart = () => {
// Vue3
var myChart = echarts.init(chart.value);
@ -224,6 +251,7 @@ onBeforeMount(() => {
data.list1 = props.list1;
data.list2 = props.list2;
data.year = props.year;
data.bg=[];
data.year.forEach(() => {
data.bg.push(0);
});

View File

@ -3,7 +3,7 @@
</template>
<script setup >
import { onBeforeMount, reactive, ref } from "vue";
import { onBeforeMount, reactive, ref,watch } from "vue";
// echarts
import * as echarts from "echarts";
@ -143,7 +143,19 @@ const getOption = () => {
],
};
};
watch(
() => props.list1,
() => {
data.list1 = props.list1;
data.year = props.year;
data.bg=[];
data.year.forEach(() => {
data.bg.push(0);
});
getOption();
setChart();
}
);
const setChart = () => {
// Vue3
var myChart = echarts.init(chart.value);
@ -158,6 +170,7 @@ onBeforeMount(() => {
setTimeout(() => {
data.list1 = props.list1;
data.year = props.year;
data.bg=[];
data.year.forEach(() => {
data.bg.push(0);
});

View File

@ -254,18 +254,18 @@
</div>
<div class="dailyActivity" v-if="choose == '1'">
<div class="dailyActivityBox">
<div class="dailyActivitybottom">
<div class="dailyActivitybottom">
<img src="../assets/images/sy/dropDown.png" />
<span>浙里办平均日活</span>
</div>
<span style="margin-right: 20px;">8135</span>
<span style="margin-right: 20px">8135</span>
</div>
<div class="dailyActivityBox">
<div class="dailyActivitybottom">
<img src="../assets/images/sy/dropDown.png" />
<span>龙游通平均日活</span>
</div>
<span style="margin-right: 20px;" >2714</span>
<span style="margin-right: 20px">2714</span>
</div>
</div>
<el-table
@ -553,7 +553,7 @@
:title="dataEc.title"
:list1="dataEc.list1"
:list2="dataEc.list2"
:year="dataEc.year"
:year="dataEc.times"
@close="close"
>
</DialogEc>
@ -562,13 +562,18 @@
:title="dataTab.title"
:list1="dataTab.list1"
:list2="dataTab.list2"
:year="dataTab.year"
:year="dataTab.times"
:columns="dataTab.columns"
:tableData="dataTab.data"
:pagination="pagination"
@handle="handlePagination"
@handle="handlePaginationTab"
@close="close"
>
<template #dd="{ currentCol, currentData }">
<div>
{{currentData.dd.substring(0,currentData.dd.indexOf("."))}}
</div>
</template>
</DialogTab>
</div>
</template>
@ -755,13 +760,15 @@ const pagination = reactive({
pageSize: 10,
currentPage: 1,
});
//
const handlePagination = (current) => {
pagination.currentPage = current;
// if (tableType.title == "") {
// getTable2(tableType.url, pagination.currentPage);
// } else {
getTable(tableType.url, pagination.currentPage);
// }
getTable(tableType.url, pagination.currentPage);
};
//Tab
const handlePaginationTab = (current) => {
pagination.currentPage = current;
getTableTab(dataTab.url, pagination.currentPage);
};
const showDialog = (title, url) => {
tableType.title = title;
@ -784,7 +791,7 @@ const showDialog2 = (title, url) => {
tableType.title = title;
tableType.url = url;
tableType.columns = ylws_columns.value;
dialogShow.value = true;
dialogShow.value = true;
// getTable(url, pagination.currentPage);
}
};
@ -798,6 +805,7 @@ const dataEc = reactive({
});
// -
const dataTab = reactive({
url: "",
title: "",
list1: [],
list2: [],
@ -805,15 +813,16 @@ const dataTab = reactive({
columns: [
{
label: "班次",
property: "bc",
property: "cc",
},
{
label: "始发站-终点站",
property: "sfzd",
property: "qqz",
},
{
label: "始发时间",
property: "time",
type: "slot",
property: "dd",
},
],
data: [],
@ -1262,10 +1271,14 @@ const getData = async () => {
data.tysyList[index].value = res.data.whtysy[key];
});
//
data.jtsyList[1].key1_value = res.data.transportation.electricbicycle.cyclingFrequency
data.jtsyList[1].key2_value = res.data.transportation.electricbicycle.cyclingDduration
data.jtsyList[4].key1_value = res.data.transportation.highSpeedRail.trainSchedule
data.jtsyList[4].key2_value = res.data.transportation.highSpeedRail.passengerFlow
data.jtsyList[1].key1_value =
res.data.transportation.electricbicycle.cyclingFrequency;
data.jtsyList[1].key2_value =
res.data.transportation.electricbicycle.cyclingDduration;
data.jtsyList[4].key1_value =
res.data.transportation.highSpeedRail.trainSchedule;
data.jtsyList[4].key2_value =
res.data.transportation.highSpeedRail.passengerFlow;
}
});
};
@ -1281,17 +1294,18 @@ const getTable = (url, currentPage) => {
}
});
};
const getTable2 = (url, currentPage) => {
dialogShow.value = true;
// http
// .get(`${url}?page=${currentPage}&size=${pagination.pageSize}`)
// .then((res) => {
// if (res.code == 200) {
// tableType.data = res.data;
// pagination.total = res.count;
// dialogShow.value = true;
// }
// });
//-
const getTableTab = (url, currentPage) => {
dataTab.url = url;
http
.get(`${url}?page=${currentPage}&size=${pagination.pageSize}`)
.then((res) => {
if (res.code == 200) {
dataTab.data = res.data;
pagination.total = res.count;
dialogShowTab.value = true;
}
});
};
//
const qyfyList = reactive([
@ -1333,14 +1347,18 @@ const showEc = (val) => {
case "公共自行车":
dataEc.list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 122];
dataEc.list2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 112];
dataEc.year = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
dataEc.times = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
dialogShowEc.value = true;
break;
case "电动单车":
dataEc.list1 = [11, 21, 31, 41, 5, 6, 7, 8, 9, 10, 11, 122];
dataEc.list2 = [11, 21, 31, 4, 51, 61, 7, 8, 9, 10, 11, 112];
dataEc.year = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
dialogShowEc.value = true;
http.get("/api/ggfwyth/ddcList").then((res) => {
if(res.code == 200){
dataEc.list1=res.data.qxcs;
dataEc.list2=res.data.qxsc;
dataEc.times=res.data.times;
dialogShowEc.value = true;
}
});
break;
default:
break;
@ -1349,12 +1367,12 @@ const showEc = (val) => {
const showTab = (val) => {
dataTab.title = val;
dataTab.list1 = [];
dataTab.year = [];
dataTab.times = [];
dataTab.data = [];
switch (val) {
case "公共汽车":
dataTab.list1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 122];
dataTab.year = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
dataTab.times = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
dataTab.data = [
{
bc: "G13214",
@ -1376,7 +1394,7 @@ const showTab = (val) => {
break;
case "长途汽车":
dataTab.list1 = [11, 21, 31, 4, 51, 6, 7, 81, 91, 10, 11, 122];
dataTab.year = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
dataTab.times = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
dataTab.data = [
{
bc: "D6456",
@ -1397,26 +1415,13 @@ const showTab = (val) => {
dialogShowTab.value = true;
break;
case "高铁":
dataTab.list1 = [1, 222, 333, 444, 5, 6, 7, 8, 9, 10, 11, 122];
dataTab.year = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12];
dataTab.data = [
{
bc: "G13214",
sfzd: "A-B",
time: "2024-06-12",
},
{
bc: "G13214",
sfzd: "A-B",
time: "2024-06-13",
},
{
bc: "G4564",
sfzd: "A-B",
time: "2024-06-14",
},
];
dialogShowTab.value = true;
getTableTab("/api/ggfwyth/lyzlcskList", pagination.currentPage);
http.get(`/api/ggfwyth/lckll`).then((res) => {
if (res.code == 200) {
dataTab.list1=res.data.data;
dataTab.times=res.data.times;
}
});
break;
default:
break;
@ -2407,7 +2412,7 @@ const showTab = (val) => {
align-items: center;
justify-content: space-between;
width: 50%;
.dailyActivitybottom{
.dailyActivitybottom {
display: flex;
align-items: center;
}
@ -2424,7 +2429,6 @@ const showTab = (val) => {
font-style: normal;
display: inline-block;
}
}
}
//