<template>
  <div class="material-manage main-page">
    <el-col :span="18" class="h100">
      <module-one-2-3 label="近期工单" class="h66"> </module-one-2-3>

      <module-one-1-3 label="混凝土使用情况" class="h33"> </module-one-1-3>
    </el-col>

    <el-col :span="6" class="h100">
      <module-one-3-1 label="超耗情况" class="labor-base h100" style="height: cacl(100% - 20px)"></module-one-3-1>
    </el-col>
  </div>
</template>

<script>
import debounce from "lodash.debounce";
import request from "@/utils/request";
export default {
  data() {
    return {
      dpi: "",
      selProject: null,
    };
  },
  mounted() {
    this.$store.dispatch("ChangeNav", 802);
    this.$bus.$on(
      "projectChange",
      debounce((prj) => {
        this.selProject = prj;
        this.init();
      })
    );
    this.selProject = this.$store.getters.selProject;
    this.init();
    this.dpi = this.$dpi();
    window.addEventListener("resize", () => {
      if (this.dpi != this.$dpi()) {
        this.dpi = this.$dpi();
        this.resize();
      }
    });
    this.resize();
  },
  methods: {
    resize() {
      let is1K = this.$dpi() == "1K";
      let is2K = this.$dpi() == "2K";
      this.chartKey++;
    },
    init() {
      if (!this.selProject) {
        return;
      }
      let data={
        projectId:this.selProject.id,
        startTime:this.$dt("2025-01-01").format("YYYY-MM-DD HH:mm:ss"),
        endTime:this.$dt(new Date()).format("YYYY-MM-DD HH:mm:ss"),
      }
      this.$api.machMater.materGetConcreteMaterialActQuantityBuildingNoInfoService(data).then(d=>{
        console.log("====>",d)
      })
    },
  },
};
</script>

<style lang="less">
.material-manage {
  .screen-module {
    &.h66 {
      height: calc(66% - 20px);
    }
    &.h100 {
      height: calc(100% - 20px);
    }
    &.h33 {
      height: calc(33% - 20px);
    }
  }
}
</style>
