diff --git a/src/assets/404_images/404.png b/src/assets/404_images/404.png new file mode 100644 index 0000000..3d8e230 Binary files /dev/null and b/src/assets/404_images/404.png differ diff --git a/src/assets/404_images/404_cloud.png b/src/assets/404_images/404_cloud.png new file mode 100644 index 0000000..c6281d0 Binary files /dev/null and b/src/assets/404_images/404_cloud.png differ diff --git a/src/router/index.js b/src/router/index.js index da97b62..98586a2 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -32,6 +32,18 @@ const routes = [ title: '登录界面' } }, + { + path:'/404', + name:'404', + component:() =>import('@/views/error/404'), + meta: { + title: '404' + } + }, + { + path: '*', + redirect: '/404' + }, ] diff --git a/src/views/Brand.vue b/src/views/Brand.vue index 515a949..0eb7745 100644 --- a/src/views/Brand.vue +++ b/src/views/Brand.vue @@ -29,7 +29,7 @@ 收费金额 - + @@ -139,8 +139,13 @@ import { BiApi } from "@/api/form"; import "@/assets/js/flexible"; import "@/assets/js/china"; import countTo from "vue-count-to"; -// console.log(window.location.href); -const authCode = "712110694685872129"; + +const paramsArr = window.location.href.split('?') +let authCode = '' +if (paramsArr.length > 1) { + authCode = paramsArr[1].split('=')[1]; //获取授权号 +} + export default { name: "Brand", @@ -161,7 +166,6 @@ export default { todayCarUse: [], // 开放统计-车辆使用统计 useCarCon: {}, - authCode: '', nowTime: '', week: '', date: '', @@ -192,15 +196,21 @@ export default { }, computed: {}, created() { - this.authCode = '712110694681677824' - this.getData(); - }, mounted() { - this.heart(); - setTimeout(() => { + if (authCode && typeof +authCode === 'number') { + this.heart(); + setTimeout(() => { this.getEchart(); }, 800); + } else { + // console.log('授权码为空', authCode); + alert('授权码为空,请从系统调用页面!') + this.$router.push({ + path: '/404' + }) + return + } }, methods: { /** @@ -220,115 +230,53 @@ export default { this.heartTimes += 1; this.formatNowTimes(); //放外面就每一秒执行一次 if (this.heartTimes === 1 || this.heartTimes % 10 === 0) { // 首次加载和每10秒执行一次 - this.getTodayTrade(); - this.getRealTimeInOutRecord(); + this.getData(); } }, + getData() { + // 今日交易金额-笔数数据 + BiApi.getTodayTrade({ authCode }).then((res) => { + // console.log(res); + if (res.code === 200) { + const { totalAmount, totalNum } = res.data + this.startNumber = this.endNumber; + this.startAmount = this.endAmount; + this.endNumber = +totalNum; + this.endAmount = +totalAmount; + } + }); + // 实时进出信息 + BiApi.getRealTimeInOutRecord({ authCode, pageNum: 1, pageSize: 10 }).then((res) => { + if (res.code === 200) { + this.realTimeInOutRecord = res.rows + } + }); // 开放统计-车场排行 - BiApi.getParkingRanking({ authCode: this.authCode }).then((res) => { + BiApi.getParkingRanking({ authCode }).then((res) => { this.rankData = res.data }) // 开放统计-支付统计 - BiApi.paymentStatistics({ authCode: this.authCode }).then((res) => { + BiApi.paymentStatistics({ authCode }).then((res) => { this.payData = res.data }) // 开放统计-收费车辆统计 - BiApi.amountCartStatistics({ authCode: this.authCode }).then((res) => { + BiApi.amountCartStatistics({ authCode }).then((res) => { this.payDataCar = res.data }) // 开放统计-24小时车流统计 - BiApi.todayTrafficStatistics({ authCode: this.authCode }).then((res) => { + BiApi.todayTrafficStatistics({ authCode }).then((res) => { this.todayTraffic = res.data }) // 开放统计-24小时车辆使用统计 - BiApi.todayCarUseStatistics({ authCode: this.authCode }).then((res) => { + BiApi.todayCarUseStatistics({ authCode }).then((res) => { this.todayCarUse = res.data }) - BiApi.useCarStatistics({ authCode: this.authCode }).then((res) => { + BiApi.useCarStatistics({ authCode }).then((res) => { this.useCarCon = res.data }) - BiApi.parkingCarNum({ authCode: this.authCode }).then((res) => { - // this.useCarCon = res.data - for(var i=0;i { - // console.log(res); - if (res.code === 200) { - const { totalAmount, totalNum } = res.data - this.startNumber = this.endNumber; - this.startAmount = this.endAmount; - this.endNumber = +totalNum; - this.endAmount = +totalAmount; - } - - }); - - }, - /** - * 实时进出信息 - * */ - getRealTimeInOutRecord() { - const query = { - authCode, - pageNum: 1, - pageSize: 10, - } - BiApi.getRealTimeInOutRecord(query).then((res) => { - if (res.code === 200) { - this.realTimeInOutRecord = res.rows - } - }); - }, - - convertData(data) { - // 地图数据转换 - let res = []; - for (let i = 0; i < data.length; i++) { - let dataItem = data[i]; - let fromCoord = this.geoCoordMap[dataItem[0].name]; - let toCoord = this.geoCoordMap[dataItem[1].name]; - if (fromCoord && toCoord) { - res.push({ - fromName: dataItem[0].name, - toName: dataItem[1].name, - coords: [fromCoord, toCoord], - value: dataItem[1].value, - }); - } - } - return res; - }, - getEchart() { - // 初始化地图数据 - // eslint-disable-next-line no-undef - let myChart = echarts.init(document.getElementById("chart_map")); - - this.geoCoordMap = { - 宝安体育馆停车场: [113.884791, 22.560888], + BiApi.parkingCarNum({ authCode }).then((res) => { + this.geoCoordMap = { 上海: [121.4648, 31.2891], 东莞: [113.8953, 22.901], 东营: [118.7073, 37.5513], @@ -445,8 +393,58 @@ export default { 韶关: [113.7964, 24.7028], }; - let planePath = - "path://M1705.06,1318.313v-89.254l-319.9-221.799l0.073-208.063c0.521-84.662-26.629-121.796-63.961-121.491c-37.332-0.305-64.482,36.829-63.961,121.491l0.073,208.063l-319.9,221.799v89.254l330.343-157.288l12.238,241.308l-134.449,92.931l0.531,42.034l175.125-42.917l175.125,42.917l0.531-42.034l-134.449-92.931l12.238-241.308L1705.06,1318.313z"; + // this.useCarCon = res.data + for(var i=0;i { if (params.seriesType == "effectScatter") { - return "线路:" + params.data.name + "" + params.data.value[2]; + return "车位数量:" + params.data.name + " " + params.data.value[2]+"个"; } else if (params.seriesType == "lines") { return ( params.data.fromName + @@ -584,6 +582,7 @@ export default { }; myChart.setOption(option, true); + // eslint-disable-next-line no-undef var dataList = echarts.getMap("china").geoJson.features; // console.log("dataList:", dataList); // 鼠标事件 diff --git a/src/views/error/404.vue b/src/views/error/404.vue new file mode 100644 index 0000000..a04f393 --- /dev/null +++ b/src/views/error/404.vue @@ -0,0 +1,245 @@ + + + + +