MrShi
2025-05-07 5b8b1b8fc2d69042720cbad9cd863e7d7a5061a1
提交
已修改2个文件
108 ■■■■ 文件已修改
admin/src/views/business/admissionStatistics.vue 51 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/business/carStatistics.vue 57 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
admin/src/views/business/admissionStatistics.vue
@@ -50,13 +50,14 @@
                        v-model="value"
                        :type="dateType"
                        size="mini"
                        :clearable="false"
                        @change="getRataLists()"
                        :value-format="dateType === 'month' ? 'yyyy-MM' : 'yyyy'"
                        style="margin-left: 20px; width: 130px;"
                        placeholder="请选择">
                    </el-date-picker>
                </div>
                <div id="echart2" ref="deptRef" v-if="listZB.length > 0"></div>
                <div class="echart2" ref="deptRef" v-if="listZB.length > 0"></div>
                <div style="width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;" v-else>
                    <img style="width: 200px;" src="@/assets/images/default_homeimg.png" alt="">
                </div>
@@ -74,6 +75,7 @@
                        <el-date-picker
                            v-model="date1"
                            :type="radio"
                            :clearable="false"
                            size="mini"
                            @change="getReportLists()"
                            :value-format="radio === 'month' ? 'yyyy-MM' : 'yyyy'"
@@ -88,16 +90,7 @@
                </div>
                <div class="table_box">
                    <div class="list_content" v-for="(item, index) in list" :key="index">
                        <div class="list_head_item">储运科</div>
                        <div class="list_head_item">联合工房</div>
                        <div class="list_head_item">232</div>
                        <div class="list_head_item">储运科</div>
                        <div class="list_head_item">联合工房</div>
                        <div class="list_head_item">232</div>
                        <div class="list_head_item">储运科</div>
                        <div class="list_head_item">联合工房</div>
                        <div class="list_head_item">232</div>
                        <div class="list_head_item">232</div>
                        <div class="list_head_item" v-for="(child, i) in item" :key="i">{{child}}</div>
                    </div>
                </div>
            </div>
@@ -106,8 +99,8 @@
                    <span>本年人员累计入园统计</span>
                </div>
                <div class="list_head">
                    <div class="list_head_item">车辆分类</div>
                    <div class="list_head_item">入局次数</div>
                    <div class="list_head_item">人员分类</div>
                    <div class="list_head_item">入园次数</div>
                </div>
                <div class="table_box">
                    <div class="list_content" v-for="(item, index) in info.yearSortList" :key="index">
@@ -155,7 +148,6 @@
      daochu() {
        reportExportExcel({ dateStr: this.date1, isGroupBy: this.isGroupBy, type: 1 }).then(res => {
          this.download(res)
          console.log(res.data)
        })
      },
      changeBB() {
@@ -175,19 +167,10 @@
      getReportLists() {
        getReportList({ dateStr: this.date1, isGroupBy: this.isGroupBy, type: 1 })
          .then(res => {
            console.log(res)
            if (res.length === 0) return
            this.column = res.data.map(item => item[0])
            const keys = res.data.map(row => row[0]); // 获取键名
            const values = res.data.map(row => row.slice(1, row.length)); // 获取值
            this.list = values[0].map((_, index) => {
              return keys.reduce((obj, key, i) => {
                obj[key] = values[i][index];
                return obj;
              }, {});
            });
            this.column = res[0]
            this.list = res.slice(1, res.length);
          })
      },
      changeDateType() {
@@ -207,7 +190,6 @@
      getRataLists() {
        getRataList({ dateStr: this.value, isGroupBy: this.isGroupBy, type: 1 })
          .then(res => {
            console.log(res)
            this.listZB = res
            this.$nextTick(() => {
              this.initDept()
@@ -240,6 +222,9 @@
            top: '20%',
            containLabel: true
          },
          tooltip: {
            trigger: 'item'
          },
          xAxis: {
            type: 'category',
            data: names
@@ -263,7 +248,7 @@
      initDept() {
        if (!this.listZB) return
        const myChart = echarts.init(document.querySelector('#echart2'))
        const myChart = echarts.init(document.querySelector('.echart2'))
        let data = this.listZB.map(item => {
          return {
@@ -273,6 +258,14 @@
        })
        let option = {
          tooltip: {
            trigger: 'item'
          },
          legend: {
            show: false,
            orient: 'vertical',
            left: 'left'
          },
          series : [
            {
              name: '访问来源',
@@ -527,7 +520,7 @@
                height: calc(100% - 20px);
                padding-left: 20px;
                #echart2 {
                .echart2 {
                    width: 100%;
                    height: calc(100% - 60px);
                }
admin/src/views/business/carStatistics.vue
@@ -50,13 +50,14 @@
                        v-model="value"
                        :type="dateType"
                        size="mini"
                        :clearable="false"
                        @change="getRataLists()"
                        :value-format="dateType === 'month' ? 'yyyy-MM' : 'yyyy'"
                        style="margin-left: 20px; width: 130px;"
                        placeholder="请选择">
                    </el-date-picker>
                </div>
                <div id="echart2" ref="deptRef" v-if="listZB.length > 0"></div>
                <div class="echart_2" ref="deptRef" v-if="listZB.length > 0"></div>
                <div style="width: 100%;height: 100%;display: flex;align-items: center;justify-content: center;" v-else>
                    <img style="width: 200px;" src="@/assets/images/default_homeimg.png" alt="">
                </div>
@@ -75,6 +76,7 @@
                                v-model="date1"
                                :type="radio"
                                size="mini"
                            :clearable="false"
                                @change="getReportLists()"
                                :value-format="radio === 'month' ? 'yyyy-MM' : 'yyyy'"
                                style="margin-left: 20px; width: 130px;"
@@ -88,16 +90,7 @@
                </div>
                <div class="table_box">
                    <div class="list_content" v-for="(item, index) in list" :key="index">
                        <div class="list_head_item">储运科</div>
                        <div class="list_head_item">联合工房</div>
                        <div class="list_head_item">232</div>
                        <div class="list_head_item">储运科</div>
                        <div class="list_head_item">联合工房</div>
                        <div class="list_head_item">232</div>
                        <div class="list_head_item">储运科</div>
                        <div class="list_head_item">联合工房</div>
                        <div class="list_head_item">232</div>
                        <div class="list_head_item">232</div>
                        <div class="list_head_item" v-for="(child, i) in item" :key="i">{{child}}</div>
                    </div>
                </div>
            </div>
@@ -107,7 +100,7 @@
                </div>
                <div class="list_head">
                    <div class="list_head_item">车辆分类</div>
                    <div class="list_head_item">入局次数</div>
                    <div class="list_head_item">入园次数</div>
                </div>
                <div class="table_box">
                    <div class="list_content" v-for="(item, index) in info.yearSortList" :key="index">
@@ -175,19 +168,12 @@
      getReportLists() {
        getReportList({ dateStr: this.date1, isGroupBy: this.isGroupBy, type: 0 })
            .then(res => {
              if (res.length === 0) return
              this.column = res[0]
              this.list = res.slice(1, res.length);
              console.log(res)
              this.column = res.data.map(item => item[0])
              const keys = res.data.map(row => row[0]); // 获取键名
              const values = res.data.map(row => row.slice(1, row.length)); // 获取值
              this.list = values[0].map((_, index) => {
                return keys.reduce((obj, key, i) => {
                  obj[key] = values[i][index];
                  return obj;
                }, {});
              });
            })
      },
      changeDateType() {
@@ -207,7 +193,6 @@
      getRataLists() {
        getRataList({ dateStr: this.value, isGroupBy: this.isGroupBy, type: 0 })
            .then(res => {
              console.log(res)
              this.listZB = res
              this.$nextTick(() => {
                this.initDept()
@@ -233,6 +218,14 @@
        let datas = this.info.cumulativeDataList.map(item => item.total)
        let option = {
          tooltip: {
            trigger: 'item'
          },
          legend: {
            show: false,
            orient: 'vertical',
            left: 'left'
          },
          grid: {
            left: '5%',
            right: '10%',
@@ -261,9 +254,9 @@
      },
      // 车辆分类统计
      initDept() {
        if (!this.listZB) return
        if (this.listZB.length === 0) return
        const myChart = echarts.init(document.querySelector('#echart2'))
        const myChart = echarts.init(document.querySelector('.echart_2'))
        let data = this.listZB.map(item => {
          return {
@@ -273,6 +266,14 @@
        })
        let option = {
          tooltip: {
            trigger: 'item'
          },
          legend: {
            show: false,
            orient: 'vertical',
            left: 'left'
          },
          series : [
            {
              name: '访问来源',
@@ -527,7 +528,7 @@
                height: calc(100% - 20px);
                padding-left: 20px;
                #echart2 {
                .echart_2 {
                    width: 100%;
                    height: calc(100% - 60px);
                }