123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244 |
- <template>
- <div class="body-wrapper">
- <el-form class="form-wrapper" :inline="true" :model="formInline" style="margin-bottom: 20px;">
- <el-form-item label="行政区">
- <el-select clearable v-model="formInline.regionCode" placeholder="请选择" popper-class="cur-select">
- <el-option v-for="item in districtOptions" :key="item.label" :label="item.label" :value="item.value"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item clearable label="具体道路">
- <el-input v-model="formInline.streetName" placeholder="请输入"></el-input>
- </el-form-item>
- <el-form-item label="停车场">
- <el-select clearable v-model="formInline.parkId" placeholder="请选择" popper-class="cur-select">
- <el-option v-for="item in carOptions" :key="item.parkId" :label="item.carParkName" :value="item.parkId"></el-option>
- </el-select>
- </el-form-item>
- <el-form-item label="查询日期">
- <el-date-picker
- clearable
- v-model="formInline.time"
- type="daterange"
- range-separator="至"
- start-placeholder="开始日期"
- value-format="yyyy-MM-dd"
- :picker-options="{disabledDate: (time) => time.getTime() > Date.now()}"
- end-placeholder="结束日期">
- </el-date-picker>
- </el-form-item>
- <el-form-item>
- <el-button type="primary" @click="queryAll">查询</el-button>
- </el-form-item>
- </el-form>
- <div style="display: flex; justify-content: space-between;">
- <div style="width: 50%; height: 300px">
- <barchart
- class="side-chart"
- :autoStop="false"
- :colorArr="['#ffd201', '#00eacb', '#01b4ff', '#5d78ff']"
- legendIcon="react"
- :bottom="30"
- :xlabelFormat="xLabelFormat"
- :top="60"
- yAxisName="(个)"
- :tooltip="tooltipFormat"
- :dataset="bardata"
- :encode="[
- {x: 'month', y: 'hs', seriesName: '接入数量'},
- {x: 'month', y: 'cs', seriesName: '异常数量'}]"
- :labelSize="15"
- id="fxdqhszzt"
- />
- </div>
- <div style="width: 50%; height: 300px">
- <!-- <div align="center" style="color: white">漯河市财政局停车场</div>-->
- <piechart
- class="model-pie-body"
- id="chart1"
- :roseType="false"
- :radiusArr="['30%', '70%']"
- :colorArr="modelPieColor"
- :labelFormat="['{name|{b}}', '{sub|{@value}次 {d}%}', '{hr|}']"
- :dataset="modelData.list"
- :encode="{ itemName: 'name', value: 'value' }"
- />
- </div>
- </div>
- </div>
- </template>
- <script>
- import piechart from "@/components/pieChart";
- import barchart from "@/components/barChart";
- import api from "@/api/article_liao";
- import options from '@/util/options'
- export default {
- components: {
- piechart,
- barchart
- },
- data() {
- return {
- districtOptions: options.districtOptions,
- carOptions: [],
- formInline: {
- regionCode: '',
- streetName: '',
- parkId: '',
- time: [],
- },
- value: '',
- modelPieColor: ["#4382f6", "#9078f8", "#79a7db", "#FF9800", "#9C27B0"],
- modelData: {
- list: []
- },
- bardata: [],
- }
- },
- mounted() {
- this.getParkDic()
- this.queryAll()
- },
- watch: {},
- methods: {
- getParkDic() {
- api.parkDic().then(res => {
- this.carOptions = res.data || [];
- })
- },
- queryAll() {
- let params = {...this.formInline}
- if (
- this.formInline.time && this.formInline.time.length === 2 &&
- this.formInline.time[1] !== ""
- ) {
- this.formInline.time[0] = this.formInline.time[0].substring(0, 10) + " 00:00:00";
- this.formInline.time[1] = this.formInline.time[1].substring(0, 10) + " 23:59:59";
- params.begin= this.formInline.time[0]
- params.end = this.formInline.time[1]
- }
- delete params.time
- this.dashAccessDataAnalysisStat1(params)
- this.dashAccessDataAnalysisStat2(params)
- },
- tooltipFormat(params) {
- const type = params[0].seriesType;
- const data = params[0].data;
- // ${params[0].name || "--"}月:
- return `<div class="line-tooltip">
- <div>${params[0].seriesName}: ${
- params[0].data.hs || "--"}个</div>
- <div>${params[1].seriesName}: ${
- params[0].data.cs || "--"}个</div>
- </div>`;
- },
- xLabelFormat(name) {
- const nameArr = []
- for (let i = 0; i < name.length; i += 7) {
- nameArr.push(name.substring(i, i + 7))
- }
- return nameArr.join('\n');
- },
- dashAccessDataAnalysisStat1(params){
- api.dashAccessDataAnalysisStat1(params).then(res =>{
- this.bardata = res.data
- })
- },
- dashAccessDataAnalysisStat2(params){
- api.dashAccessDataAnalysisStat2(params).then(res =>{
- this.modelData.list = res.data
- })
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .form-wrapper {
- margin-bottom: 20px;
- }
- /deep/ .el-input__inner {
- background: #2d3744;
- border: none;
- border-radius: 0;
- }
- /deep/ .el-select {
- height: 40px;
- .el-input__inner {
- height: 40px;
- }
- .el-input__prefix, .el-input__suffix {
- height: 40px;
- }
- /* 下面设置右侧按钮居中 */
- .el-input__suffix {
- top: 0px;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-wrap: nowrap;
- flex-direction: row;
- align-content: flex-start;
- }
- /* 输入框加上上下边是 32px + 2px =34px */
- .el-input__icon {
- line-height: 0px;
- }
- }
- /deep/ .form-wrapper .el-button {
- background: linear-gradient(90deg,#0158d9,#3c97e4);
- width: 100px;
- height: 40px;
- }
- .body-wrapper {
- width: 100%;
- height: 100%;
- box-sizing: border-box;
- background: #0c0c0c;
- }
- .model-pie-body {
- width: 100%;
- height: 99%;
- }
- .form-wrapper {
- margin-bottom: 20px;
- }
- /deep/ .el-input__inner {
- background: #2d3744;
- border: none;
- border-radius: 0;
- }
- /deep/ .el-select {
- height: 40px;
- .el-input__inner {
- height: 40px;
- }
- .el-input__prefix, .el-input__suffix {
- height: 40px;
- }
- /* 下面设置右侧按钮居中 */
- .el-input__suffix {
- top: 0px;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-wrap: nowrap;
- flex-direction: row;
- align-content: flex-start;
- }
- /* 输入框加上上下边是 32px + 2px =34px */
- .el-input__icon {
- line-height: 0px;
- }
- }
- /deep/ .form-wrapper .el-button {
- background: linear-gradient(90deg,#0158d9,#3c97e4);
- width: 100px;
- height: 40px;
- }
- </style>
|