|
@@ -1,5 +1,366 @@
|
|
|
<template>
|
|
|
- <div>区域交易情况</div>
|
|
|
+ <div class="main">
|
|
|
+ <div class="title">{{ year }}各区域交易情况</div>
|
|
|
+ <div class="content">
|
|
|
+ <div class="contentLeft">
|
|
|
+ <div class="item">
|
|
|
+ <div class="detail">
|
|
|
+ <div>{{ saveAmount }}</div>
|
|
|
+ <div>亿元</div>
|
|
|
+ </div>
|
|
|
+ <div class="title">节约金额</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="contentCenter">
|
|
|
+ <div id="map"></div>
|
|
|
+ </div>
|
|
|
+ <div class="contentRight">
|
|
|
+ <div class="item">
|
|
|
+ <div class="detail">
|
|
|
+ <div>{{ transactionCount }}</div>
|
|
|
+ <div>宗</div>
|
|
|
+ </div>
|
|
|
+ <div class="title">交易宗数</div>
|
|
|
+ </div>
|
|
|
+ <div class="item">
|
|
|
+ <div class="detail">
|
|
|
+ <div>{{ transactionAmount }}</div>
|
|
|
+ <div>亿元</div>
|
|
|
+ </div>
|
|
|
+ <div class="title">交易金额</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
-<script></script>
|
|
|
-<style scoped></style>
|
|
|
+<script>
|
|
|
+import { publicpversightApi } from "../index.js";
|
|
|
+import bazhong from "./baZhongMap.json";
|
|
|
+export default {
|
|
|
+ name: "regionalTransactions",
|
|
|
+ props: {
|
|
|
+ year: {
|
|
|
+ type: String,
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ getSetting: [],
|
|
|
+ allData: [
|
|
|
+ // 0:南江县,1:通江县,2;巴州区,3:恩阳区,4:平昌县
|
|
|
+ // { regionType: '巴州区', order: 1 },
|
|
|
+ { id: 0, regionType: "南江县", order: 1 },
|
|
|
+ { id: 1, regionType: "通江县", order: 1 },
|
|
|
+ { id: 2, regionType: "市本级", order: 1 },
|
|
|
+ { id: 3, regionType: "恩阳区", order: 1 },
|
|
|
+ { id: 4, regionType: "平昌县", order: 1 },
|
|
|
+ ],
|
|
|
+ ifLoop: true,
|
|
|
+ areaName: "",
|
|
|
+ saveAmount: 0,
|
|
|
+ transactionCount: 0,
|
|
|
+ transactionAmount: 0,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ // this.getCurrentAreaTradeInfo();
|
|
|
+ this.drawLine();
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ year(newYear) {
|
|
|
+ this.getCurrentAreaTradeInfo();
|
|
|
+ },
|
|
|
+ areaName(newAreaName) {
|
|
|
+ this.getCurrentAreaTradeInfo();
|
|
|
+ },
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getCurrentAreaTradeInfo() {
|
|
|
+ publicpversightApi
|
|
|
+ .getCurrentAreaTradeInfo({
|
|
|
+ areaName: this.areaName,
|
|
|
+ year: this.year,
|
|
|
+ })
|
|
|
+ .then((res) => {
|
|
|
+ if (res.data.code === 200) {
|
|
|
+ this.saveAmount = res.data.result.saveAmount;
|
|
|
+ this.transactionCount = res.data.result.transactionCount;
|
|
|
+ this.transactionAmount = res.data.result.transactionAmount;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ drawLine() {
|
|
|
+ var allData = [];
|
|
|
+ allData = this.allData;
|
|
|
+ var regionType = [],
|
|
|
+ serisData = [],
|
|
|
+ order = [];
|
|
|
+ for (var i = 0; i < this.allData.length; i++) {
|
|
|
+ regionType[i] = this.allData[i].regionType;
|
|
|
+ order[i] = this.allData[i].order;
|
|
|
+ serisData.push({
|
|
|
+ name: regionType[i],
|
|
|
+ value: order[i],
|
|
|
+ });
|
|
|
+ }
|
|
|
+ let myCharts = this.$echarts.init(document.getElementById("map"));
|
|
|
+ this.$echarts.registerMap("BaZhong", bazhong);
|
|
|
+ var that = this;
|
|
|
+ let option = {
|
|
|
+ borderColor: "white",
|
|
|
+ tooltip: {
|
|
|
+ trigger: "item",
|
|
|
+ formatter: function (param) {
|
|
|
+ that.ifLoop = false;
|
|
|
+ return param.name;
|
|
|
+ },
|
|
|
+ },
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ type: "map",
|
|
|
+ map: "BaZhong",
|
|
|
+ x: "23%",
|
|
|
+ y: "12%",
|
|
|
+ showAllSymbol: true,
|
|
|
+ showLegendSymbol: true,
|
|
|
+ hoverAnimation: false,
|
|
|
+ showSymbol: true,
|
|
|
+ coordinateSystem: "geo",
|
|
|
+ itemStyle: {
|
|
|
+ normal: {
|
|
|
+ borderColor: "#ffffff",
|
|
|
+ borderWidth: 1,
|
|
|
+ },
|
|
|
+ emphasis: {
|
|
|
+ //高亮时样式
|
|
|
+ hoverAnimation: false,
|
|
|
+ // borderColor: '#ffffff',
|
|
|
+ borderWidth: 2,
|
|
|
+ shadowColor: "white",
|
|
|
+ shadowBlur: 25,
|
|
|
+ areaColor: "#2a3890",
|
|
|
+ label: {
|
|
|
+ color: "white",
|
|
|
+ shadowColor: "#fff", //默认透明
|
|
|
+ shadowBlur: 10,
|
|
|
+ show: true,
|
|
|
+ formatter: function (param) {
|
|
|
+ if (param.name === "市本级")
|
|
|
+ return "{a|" + "\n\n\n市本级●" + "}";
|
|
|
+ else return param.name;
|
|
|
+ },
|
|
|
+ rich: {
|
|
|
+ a: {
|
|
|
+ fontWeight: "bold",
|
|
|
+ fontSize: "120%",
|
|
|
+ color: "#f45197",
|
|
|
+ top: "12",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ zoom: 1.1, //地图大小
|
|
|
+ data: (function () {
|
|
|
+ var res = [];
|
|
|
+ var len = -1;
|
|
|
+
|
|
|
+ while (len++ < allData.length - 1) {
|
|
|
+ res.push({
|
|
|
+ name: allData[len].regionType,
|
|
|
+ value: allData[len].order,
|
|
|
+ selected: ifSelect(len, allData[len].regionType, 1),
|
|
|
+ });
|
|
|
+ }
|
|
|
+ res.push({
|
|
|
+ name: allData[1].regionType,
|
|
|
+ value: allData[1].order,
|
|
|
+ selected: true,
|
|
|
+ });
|
|
|
+ return res;
|
|
|
+ })(),
|
|
|
+ label: {
|
|
|
+ //地图上的文字
|
|
|
+ normal: {
|
|
|
+ show: true,
|
|
|
+ textStyle: {
|
|
|
+ fontWeight: "bold",
|
|
|
+ fontSize: "100%",
|
|
|
+ color: "#ffffff",
|
|
|
+ textShadowColor: "black", //文字阴影
|
|
|
+ textShadowBlur: "4", //文字阴影长度
|
|
|
+ },
|
|
|
+ formatter: function (param) {
|
|
|
+ if (param.name === "市本级")
|
|
|
+ return "{a|" + "\n\n\n市本级●" + "}";
|
|
|
+ else return param.name;
|
|
|
+ },
|
|
|
+ rich: {
|
|
|
+ a: {
|
|
|
+ fontWeight: "bold",
|
|
|
+ fontSize: "80%",
|
|
|
+ color: "#f45197",
|
|
|
+ top: "12",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ data: [
|
|
|
+ { name: "南江县", value: 0 },
|
|
|
+ { name: "通江县", value: 1 },
|
|
|
+ { name: "巴州区", value: 2 },
|
|
|
+ { name: "恩阳区", value: 3 },
|
|
|
+ { name: "平昌县", value: 4 },
|
|
|
+ ],
|
|
|
+ dataRange: {
|
|
|
+ splitList: [{ start: 1, end: 1, label: "南江县", color: "#0071a7" }],
|
|
|
+ symbol: "circle",
|
|
|
+ symbolSize: 4,
|
|
|
+ itemGap: 20,
|
|
|
+ itemWidth: 15,
|
|
|
+ itemHeight: 15,
|
|
|
+ show: false,
|
|
|
+ itemStyle: {
|
|
|
+ shadowColor: "white",
|
|
|
+ shadowBlur: 5,
|
|
|
+ },
|
|
|
+ textStyle: {
|
|
|
+ color: "white",
|
|
|
+ fontSize: 15,
|
|
|
+ },
|
|
|
+ },
|
|
|
+ };
|
|
|
+ myCharts.setOption(option);
|
|
|
+ const highlightOrder = ["通江县", "市本级", "恩阳区", "平昌县", "南江县"];
|
|
|
+ let curIndx = 0;
|
|
|
+ if (this.ifLoop) {
|
|
|
+ app.timeTicket = setInterval(() => {
|
|
|
+ let data = allData.map(item => ({
|
|
|
+ name: item.regionType,
|
|
|
+ value: item.order,
|
|
|
+ selected: false,
|
|
|
+ }));
|
|
|
+
|
|
|
+ if (curIndx < highlightOrder.length) {
|
|
|
+ // 高亮当前区域
|
|
|
+ data = data.map(item => ({
|
|
|
+ ...item,
|
|
|
+ selected: item.name === highlightOrder[curIndx],
|
|
|
+ }));
|
|
|
+ if (highlightOrder[curIndx] === "市本级") {
|
|
|
+ that.areaName = "巴州区";
|
|
|
+ } else {
|
|
|
+ that.areaName = highlightOrder[curIndx];
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 高亮所有区域
|
|
|
+ data = data.map(item => ({
|
|
|
+ ...item,
|
|
|
+ selected: true,
|
|
|
+ }));
|
|
|
+ that.areaName = "";
|
|
|
+ }
|
|
|
+
|
|
|
+ myCharts.setOption({
|
|
|
+ series: [
|
|
|
+ {
|
|
|
+ hoverAnimation: false,
|
|
|
+ data: data,
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ });
|
|
|
+
|
|
|
+ curIndx = (curIndx + 1) % (highlightOrder.length + 1);
|
|
|
+ }, 5000);
|
|
|
+ }
|
|
|
+ var flag = false;
|
|
|
+ function ifSelect(num, name, mm) {
|
|
|
+ if (mm) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
+ if (num == curIndx) {
|
|
|
+ flag = true;
|
|
|
+ } else {
|
|
|
+ flag = false;
|
|
|
+ }
|
|
|
+ return flag;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+.main {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ background: rgba(72, 104, 210, 0.444);
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
+.title {
|
|
|
+ line-height: 20px;
|
|
|
+ color: #8dbbfb;
|
|
|
+ font-size: 22px;
|
|
|
+ font-weight: 700;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.content {
|
|
|
+ flex: 1;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ gap: 10px;
|
|
|
+}
|
|
|
+.contentLeft {
|
|
|
+ width: 25%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-around;
|
|
|
+}
|
|
|
+.contentCenter {
|
|
|
+ width: 40%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+#map {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+.contentRight {
|
|
|
+ width: 25%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-around;
|
|
|
+}
|
|
|
+.item {
|
|
|
+ width: 200px;
|
|
|
+}
|
|
|
+.detail {
|
|
|
+ width: 100%;
|
|
|
+ height: 50px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-around;
|
|
|
+ color: #8dbbfb;
|
|
|
+ font-size: 38px;
|
|
|
+ font-weight: 900;
|
|
|
+ padding: 20px;
|
|
|
+ background: linear-gradient(
|
|
|
+ to bottom,
|
|
|
+ rgba(3, 9, 26, 0.444),
|
|
|
+ rgba(132, 145, 191, 0.444)
|
|
|
+ );
|
|
|
+ border-radius: 10px 10px 0 0;
|
|
|
+ font-family: "Times New Roman", Times, serif;
|
|
|
+}
|
|
|
+.title {
|
|
|
+ color: white;
|
|
|
+ font-size: 26px;
|
|
|
+ /* font-weight: 700; */
|
|
|
+ margin-top: 10px;
|
|
|
+}
|
|
|
+</style>
|