liukangdong
2025-02-08 c7d99f5e11c4cf0667f67b8170e1c585db2e2016
admin/src/views/project/components/houseDetails.vue
@@ -121,10 +121,6 @@
                                            label="签订日">
                                        </el-table-column>
                                        <el-table-column
                                            prop="address"
                                            label="合同来源">
                                        </el-table-column>
                                        <el-table-column
                                            label="合同状态">
                                            <template slot-scope="{row}">
                                                <span class="primaryColor" v-if="row.status === 0">待执行</span>
@@ -254,10 +250,14 @@
                        <div class="xm">
                            <div class="xm_chat">
                                <el-card class="xm_chat_row">
                                    <div id="chat1"></div>
                                    <div class="xm_chat_row_info">
                                        <span>总计</span>
                                        <span>{{amount}}</span>
                                    </div>
                                    <div id="chat1" v-if="activeName === 'third'"></div>
                                </el-card>
                                <el-card class="xm_chat_row">
                                    <div id="chat2"></div>
                                    <div id="chat2" v-if="activeName === 'third'"></div>
                                </el-card>
                            </div>
                            <el-card style="margin-top: 20px;">
@@ -387,7 +387,8 @@
        categaryList: [],
        deviceList: [],
        showDetail: false,
        showEdit1: false
        showEdit1: false,
        amount: 0
      }
    },
    methods: {
@@ -408,6 +409,7 @@
          this.$refs.EditRef.param.rooms = [this.info.projectId, this.info.buildingId, this.info.floor, this.info.id]
          this.$refs.EditRef.isShowModal = true
          this.$refs.EditRef.changeProject()
          this.$refs.EditRef.getHouseVal([this.info.projectId, this.info.buildingId, this.info.floor, this.info.id])
        })
      },
      handleDetail(row) {
@@ -435,6 +437,7 @@
                  { value: res.exceptionAmount || 0, name: '异常' },
                  { value: res.errAmount || 0, name: '报废' }
                ]
                this.amount = res.amount
                this.reand()
              })
            })
@@ -582,13 +585,7 @@
            {
              name: '设备状态',
              type: 'pie',
              radius: ['40%', '80%'],
              label: {
                show: true,
                position: 'center',
                fontWeight: 'bold',
                fontSize: 22
              },
              radius: ['50%', '80%'],
              data: this.deviceList
            }
          ]
@@ -599,51 +596,24 @@
        var chartDom = document.getElementById('chat2');
        var myChart = echarts.init(chartDom);
        var option;
        const rawData = [
          [100, 302, 301, 334, 390, 330, 320],
          [320, 132, 101, 134, 90, 230, 210],
          [220, 182, 191, 234, 290, 330, 310],
          [150, 212, 201, 154, 190, 330, 410],
          [820, 832, 901, 934, 1290, 1330, 1320]
        ];
        const totalData = [];
        for (let i = 0; i < rawData[0].length; ++i) {
          let sum = 0;
          for (let j = 0; j < rawData.length; ++j) {
            sum += rawData[j][i];
          }
          totalData.push(sum);
        }
        const series = [
          'Direct',
          'Mail Ad',
          'Affiliate Ad',
          'Video Ad',
          'Search Engine'
        ].map((name, sid) => {
          return {
            name,
        let seriesArr = []
        this.categaryList.forEach((one, index) => {
          one.ywDeviceCateDataVOList.forEach(two => {
            let data = []
            this.categaryList.forEach(item => {
              data.push(0)
            })
            data[index] = two.deviceAmount
            seriesArr.push({
              name: two.cateName,
            type: 'bar',
            stack: 'total',
            barWidth: '60%',
            data: rawData[sid].map((d, did) =>
              totalData[did] <= 0 ? 0 : d / totalData[did]
            )
          };
        });
        let seriesArr = this.categaryList.map(item => {
          return {
            name: item.cateName,
            type: 'bar',
            stack: 'total',
            barWidth: '60%',
            data: item.ywDeviceCateDataVOList.map((child) =>
              child.deviceAmount
            )
          }
              barGap:-1,
              stack: one.cateName,
              data
            })
          })
        })
        let xAxisData = this.categaryList.map(item => item.cateName)
        console.log(series)
        console.log(seriesArr)
        console.log(xAxisData)
        option = {
@@ -660,15 +630,30 @@
            trigger: 'axis',
            axisPointer: {
              type: 'shadow'
            },
            formatter: params => {
              var res = `${params[0].name} <br/>`
              for (const item of params) {
                if (item.value !== 0) {
                  res += `<span style="background: ${item.color}; height:10px; width: 10px; border-radius: 50%;display: inline-block;margin-right:10px;"></span> ${item.seriesName} :${item.value}<br/>`
                }
              }
              return res
            }
          },
          yAxis: {
            type: 'value'
          },
          xAxis: {
          xAxis: [
            {
            type: 'category',
              position: 'bottom',
            data: xAxisData
          },
            }
          ],
          yAxis: [
            {
              type: 'value',
              data: Array.from({ length: 100 }, (_, i) => i + 1)
            }
          ],
          series: seriesArr
        };
@@ -870,6 +855,28 @@
                    .xm_chat_row {
                        width: 49%;
                        height: 300px;
                        position: relative;
                        .xm_chat_row_info {
                            position: absolute;
                            top: 50%;
                            left: 50%;
                            transform: translate(-50%, -50%);
                            display: flex;
                            flex-direction: column;
                            align-items: center;
                            justify-content: center;
                            span {
                                &:nth-child(1) {
                                    font-size: 20px;
                                    color: #222222;
                                }
                                &:nth-child(2) {
                                    font-size: 28px;
                                    color: #222222;
                                    font-weight: bold;
                                }
                            }
                        }
                        #chat1 {
                            width: 100%;
                            height: 260px;