hejianhao
2026-01-20 6485bc10d1d20b432ce46698ac3f8a6f08f7db03
Merge branch 'main' of http://120.76.84.145:10101/gitblit/r/H5/smartBuilding
1个文件已添加
5个文件已修改
503 ■■■■■ 已修改文件
screen/.env.development 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen/src/utils/request.js 4 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen/src/view/equipmentList/index.vue 281 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen/src/view/equipmentList/service.js 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen/src/view/projectHome/index.vue 169 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen/src/view/projectHome/service.js 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
screen/.env.development
@@ -1,2 +1,3 @@
VUE_APP_BASE_URL=http://192.168.110.34:9908
VUE_APP_BASE_URL=http://192.168.110.111:9908
# VUE_APP_BASE_URL=http://221.182.45.100:8180
VUE_APP_IMAGE_BASE_URL=http://192.168.110.111:11225/images/
screen/src/utils/request.js
@@ -28,7 +28,7 @@
      return
    }
    const res = response
    if (res.data.code === 200) {
    if (res.data.code === 200 || res.data.status==='OK') {
      if (!res.data.data) {
        return Promise.resolve({})
      }
@@ -55,4 +55,4 @@
  }
)
export default service
export default service
screen/src/view/equipmentList/index.vue
@@ -4,210 +4,92 @@
    <div class="pt--35 px--20 pb--54">
      <!-- 返回 -->
      <div @click="backFun" class="flex a-center cursor-pointer">
        <img
          src="../../assets/img/back.png"
          class="w--22 h--20 shrink0 mr--13"
        />
        <img src="../../assets/img/back.png" class="w--22 h--20 shrink0 mr--13" />
        <div class="c-fff lh--22 fs--22 SHSBold">设备列表</div>
      </div>
      <!-- 搜索 -->
      <div class="flex a-center gap--16 mt--24 mb--20">
        <div
          v-if="!projectId"
          class="flex a-center j-between pl--18 pr--15 h--40 relative w--300 bgcolor1 searchBox"
        >
          <el-select
            filterable
            v-model="projectId"
            placeholder="请选择项目"
            class="flex1"
          >
            <el-option
              v-for="item in [1, 2]"
              :key="item"
              :label="item"
              :value="item"
            >
        <div v-if="!projectId" class="flex a-center j-between pl--18 pr--15 h--40 relative w--300 bgcolor1 searchBox">
          <el-select filterable v-model="projectId" placeholder="请选择项目" class="flex1">
            <el-option v-for="item in [1, 2]" :key="item" :label="item" :value="item">
            </el-option>
          </el-select>
          <img
            src="../../assets/img/down-circle@2x.png"
            class="w--15 h--16 shrink0"
          />
          <img src="../../assets/img/down-circle@2x.png" class="w--15 h--16 shrink0" />
        </div>
        <div
          class="flex a-center j-between pl--18 pr--15 h--40 relative w--300 bgcolor1 searchBox"
        >
          <el-select
            filterable
            v-model="projectId"
            placeholder="请选择设备类型"
            class="flex1"
          >
            <el-option
              v-for="item in [1, 2]"
              :key="item"
              :label="item"
              :value="item"
            >
        <div class="flex a-center j-between pl--18 pr--15 h--40 relative w--300 bgcolor1 searchBox">
          <el-select filterable v-model="type" placeholder="请选择设备类型" class="flex1">
            <el-option v-for="item in deviceTypeList" :key="item.code" :label="item.name" :value="item.code">
            </el-option>
          </el-select>
          <img
            src="../../assets/img/down-circle@2x.png"
            class="w--15 h--16 shrink0"
          />
          <img src="../../assets/img/down-circle@2x.png" class="w--15 h--16 shrink0" />
        </div>
        <div
          @click="handleClick(1)"
          class="flex a-center j-between px--20 w--300 h--40 relative bgcolor1 picker"
        >
          <el-date-picker
            v-model="dateTime"
            ref="datetime1"
            type="datetime"
            placeholder=""
          >
        <div @click="handleClick(1)" class="flex a-center j-between px--20 w--300 h--40 relative bgcolor1 picker">
          <el-date-picker v-model="dateTime" ref="datetime1" type="datetime" placeholder="">
          </el-date-picker>
          <div
            class="absolute w100 h100 flex a-center c-fff fs--14 SHS"
            style="width: calc(100% - 20px)"
            v-if="dateTxt"
          >
            {{ dateTxt }}
          <div class="absolute w100 h100 flex a-center c-fff fs--14 SHS" style="width: calc(100% - 20px)"
            v-if="startTime">
            {{ startTime }}
          </div>
          <div
            v-else
            class="absolute w100 h100 flex a-center c-fff fs--14 SHSR"
          >
          <div v-else class="absolute w100 h100 flex a-center c-fff fs--14 SHSR">
            请选择日期
          </div>
          <img
            src="../../assets/img/home/Shape@2x (6).png"
            class="w--13 h--13 shrink0"
          />
          <img src="../../assets/img/home/Shape@2x (6).png" class="w--13 h--13 shrink0" />
        </div>
        <div
          @click="handleClick(2)"
          class="flex a-center j-between px--20 w--300 h--40 relative bgcolor1 picker"
        >
          <el-date-picker
            v-model="dateTime"
            ref="datetime2"
            type="datetime"
            placeholder=""
          >
        <div @click="handleClick(2)" class="flex a-center j-between px--20 w--300 h--40 relative bgcolor1 picker">
          <el-date-picker v-model="dateTime2" ref="datetime2" type="datetime" placeholder="">
          </el-date-picker>
          <div
            class="absolute w100 h100 flex a-center c-fff fs--14 SHS"
            style="width: calc(100% - 20px)"
            v-if="dateTxt"
          >
            {{ dateTxt }}
          <div class="absolute w100 h100 flex a-center c-fff fs--14 SHS" style="width: calc(100% - 20px)"
            v-if="endTime">
            {{ endTime }}
          </div>
          <div
            v-else
            class="absolute w100 h100 flex a-center c-fff fs--14 SHSR"
          >
          <div v-else class="absolute w100 h100 flex a-center c-fff fs--14 SHSR">
            请选择日期
          </div>
          <img
            src="../../assets/img/home/Shape@2x (6).png"
            class="w--13 h--13 shrink0"
          />
          <img src="../../assets/img/home/Shape@2x (6).png" class="w--13 h--13 shrink0" />
        </div>
        <div
          class="flex a-center j-between w--300 pl--20 h--40 relative bgcolor1 searchBox"
        >
          <el-select
            filterable
            v-model="projectId"
            placeholder="请输入搜索内容"
            class="flex1"
          >
            <el-option
              v-for="item in [1, 2]"
              :key="item"
              :label="item"
              :value="item"
            >
            </el-option>
          </el-select>
        <div class="flex a-center j-between w--300 pl--20 h--40 relative bgcolor1 searchBox">
          <el-input v-model="content" placeholder="请输入搜索内容" class="flex1"></el-input>
          <div class="btn SHSR">搜索</div>
        </div>
      </div>
      <!-- 表格 -->
      <CustomTable
        :data="[{ projectName: '项目777' }, { projectName: '项目2' }]"
        height="800"
        style="border: 2px solid #3d7fff"
      >
        <el-table-column
          v-if="!projectId"
          label="项目名称"
          prop="projectName"
        />
        <el-table-column label="设备类型" prop="projectName" />
        <el-table-column label="设备编号" prop="projectName" />
        <el-table-column label="设备出厂日期" prop="projectName" />
      <CustomTable :data="tableList" height="800"
        style="border: 2px solid #3d7fff">
        <el-table-column v-if="!projectId" label="项目名称" prop="projectName" />
        <el-table-column label="设备类型" prop="type" />
        <el-table-column label="设备编号" prop="name" />
        <el-table-column label="设备出厂日期" prop="createTime" />
        <el-table-column label="使用单位" prop="projectName" />
        <el-table-column label="工程起重机械生产单位" prop="projectName" />
        <el-table-column label="工程起重机械租赁单位" prop="projectName" />
        <el-table-column label="工程起重机械维保单位" prop="projectName" />
        <el-table-column label="工程起重机械安拆单位" prop="projectName" />
        <el-table-column label="本月检查情况" prop="projectName">
        <el-table-column label="本月检查情况" prop="checkResult">
          <template #default="{ row, $index }">
            <div class="flex a-center j-center">
              <div class="ripple">
                <div
                  class="ripple-wave wave-1"
                  :class="{ bgColor3: $index === 0 }"
                ></div>
                <div
                  class="ripple-wave wave-2"
                  :class="{ bgColor4: $index === 0 }"
                ></div>
                <div
                  class="ripple-wave wave-3"
                  :class="{ bgColor5: $index === 0 }"
                ></div>
                <div class="ripple-wave wave-1" :class="{ bgColor3: $index === 0 }"></div>
                <div class="ripple-wave wave-2" :class="{ bgColor4: $index === 0 }"></div>
                <div class="ripple-wave wave-3" :class="{ bgColor5: $index === 0 }"></div>
              </div>
              <div class="ml--6 SHSR">{{ $index }}</div>
            </div>
          </template>
        </el-table-column>
        <el-table-column label="最近一次检查时间" prop="projectName" />
        <el-table-column label="最近一次检查时间" prop="checkTime" />
        <el-table-column label="操作">
          <template #default="{ row }">
            <el-button
              @click="toHiddenDanger(row, 3)"
              type="text"
              class="btnColor"
              >隐患</el-button
            >
            <el-button
              type="text"
              class="btnColor"
              @click="projectVisible = true"
              >详情</el-button
            >
            <el-button @click="toHiddenDanger(row, 3)" type="text" class="btnColor">隐患</el-button>
            <el-button type="text" class="btnColor" @click="projectVisible = true">详情</el-button>
          </template>
        </el-table-column>
      </CustomTable>
      <CustomPagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[100, 200, 300, 400]"
        :page-size="10"
        :total="400"
      />
      <CustomPagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
        :current-page="currentPage" :page-sizes="[100, 200, 300, 400]" :page-size="10" :total="total" />
    </div>
    <!-- 项目列表弹窗 -->
    <CustomDialog title="项目" :visible.sync="projectVisible" width="1420px">
      <CustomTable
        :data="[{ projectName: '项目777' }, { projectName: '项目2' }]"
        height="630"
      >
      <CustomTable :data="[{ projectName: '项目777' }, { projectName: '项目2' }]" height="630">
        <el-table-column label="检查计划" prop="projectName" />
        <el-table-column label="计划类型" prop="projectName" />
        <el-table-column label="检测时间" prop="projectName" />
@@ -219,19 +101,11 @@
              <template #reference>
                <el-button type="text" class="btnColor">查看报告</el-button>
              </template>
              <div
                class="h100 flex flex-column a-center j-between c-fff fs--16 SHSBold"
              >
                <div
                  @click="openReport('safe')"
                  class="py--12 w100 txt-center br--10 bgcolor6 cursor-pointer"
                >
              <div class="h100 flex flex-column a-center j-between c-fff fs--16 SHSBold">
                <div @click="openReport('safe')" class="py--12 w100 txt-center br--10 bgcolor6 cursor-pointer">
                  综合报告
                </div>
                <div
                  @click="openReport('device')"
                  class="py--12 w100 txt-center br--10 bgcolor7 cursor-pointer"
                >
                <div @click="openReport('device')" class="py--12 w100 txt-center br--10 bgcolor7 cursor-pointer">
                  设备报告
                </div>
              </div>
@@ -243,13 +117,7 @@
    <!-- 检查报告弹窗 -->
    <CustomDialog title="检查报告" :visible.sync="reportVisible" width="1420px">
      <div style="height: 691px" class="oa">
        <iframe
          v-if="reportUrl"
          :src="reportUrl"
          width="100%"
          height="100%"
          frameborder="0"
        ></iframe>
        <iframe v-if="reportUrl" :src="reportUrl" width="100%" height="100%" frameborder="0"></iframe>
      </div>
    </CustomDialog>
  </div>
@@ -258,16 +126,24 @@
<script>
import HeaderBox from "../header/index.vue";
import moment from "moment";
import { deviceTypes, getDeviceList } from './service.js'
export default {
  components: { HeaderBox },
  props: {},
  data() {
    return {
      dateTime: null,
      dateTime2: null,
      projectId: null,
      projectName: '',
      dateTxt: "",
      type: '',//设备类型
      startTime: '',//开始时间
      endTime: '',//结束时间
      content: '',//搜索内容
      currentPage: 1,
      pageSize: 10,
      total: 0,
      projectVisible: false,
      reportVisible: false,
      reportUrl: "",
@@ -275,6 +151,8 @@
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
      deviceReportUrl:
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
      deviceTypeList: [],//设备类型列表
      tableList: [],//数据列表
    };
  },
  computed: {},
@@ -282,7 +160,15 @@
    dateTime: {
      handler(newVal, oldVal) {
        if (newVal) {
          this.dateTxt = moment(newVal).format("YYYY年MM月DD日 HH:mm:ss");
          this.startTime = moment(newVal).format("YYYY年MM月DD日 HH:mm:ss");
        }
      },
      immediate: true,
    },
    dateTime2: {
      handler(newVal, oldVal) {
        if (newVal) {
          this.endTime = moment(newVal).format("YYYY年MM月DD日 HH:mm:ss");
        }
      },
      immediate: true,
@@ -295,9 +181,17 @@
    if (this.$route.query.projectName) {
      this.projectName = this.$route.query.projectName;
    }
    this.getTypeList()
    this.getList()
  },
  mounted() {},
  mounted() { },
  methods: {
    // 获取设备类型
    getTypeList() {
      deviceTypes().then(res => {
        this.deviceTypeList = res
      })
    },
    toHiddenDanger(row, type) {
      this.$router.push({
        path: "/hiddenDanger",
@@ -307,6 +201,23 @@
          activeTab: type,
        },
      });
    },
    getList() {
      let params = {
        projectId: this.projectId,
        projectName: this.projectName,
        startTime: this.startTime,
        endTime: this.endTime,
        content: this.content,
        type: this.type,
        pageNum: this.currentPage,
        pageSize: this.pageSize
      }
      getDeviceList({ ...params }).then(res => {
        console.log('设备列表', res)
        this.tableList = res.records
        this.total = res.total
      })
    },
    handleSizeChange(val) {
@@ -424,12 +335,10 @@
    position: absolute;
    top: -2px;
    right: -2px;
    background: linear-gradient(
      90deg,
      #3467d0 0%,
      #0d226a 50.35%,
      #376fe0 100%
    );
    background: linear-gradient(90deg,
        #3467d0 0%,
        #0d226a 50.35%,
        #376fe0 100%);
    height: 38px;
    display: flex;
    align-items: center;
@@ -496,10 +405,12 @@
    transform: translate(-50%, -50%) scale(0.7);
    opacity: 0;
  }
  20% {
    opacity: 1;
    opacity: 1;
  }
  100% {
    -webkit-transform: translate(-50%, -50%) scale(1.4);
    opacity: 0;
screen/src/view/equipmentList/service.js
New file
@@ -0,0 +1,15 @@
import request from '@/utils/request'
// 设备类型
export const deviceTypes = async (id) => {
  return request(`/project/deviceTypes`, {
    method: 'get'
  })
}
// 获取设备列表
export const getDeviceList = async (data) => {
  return request(`/project/getDeviceList`, {
    method: 'post',
    data
  })
}
screen/src/view/projectHome/index.vue
@@ -13,67 +13,67 @@
              <div class="info-item">
                <div class="flex2 flex">
                  <div class="label">项目编号</div>
                  <div class="value">SPS-2021-01-01</div>
                  <div class="value">{{ projectInfo.code || '-' }}</div>
                </div>
                <div class="flex1 flex">
                  <div class="label">工程类型</div>
                  <div class="value">工程类型</div>
                  <div class="value">{{ projectInfo.type || '-' }}</div>
                </div>
              </div>
              <div class="info-item">
                <div class="flex2 flex">
                  <div class="label">项目地址</div>
                  <div class="value">西藏自治区拉萨市达孜县健康大道489号</div>
                  <div class="value">{{ projectInfo.address || '-' }}</div>
                </div>
                <div class="flex1 flex">
                  <div class="label">项目阶段</div>
                  <div class="value">工程类型</div>
                  <div class="value">{{ projectInfo.progress || '-' }}</div>
                </div>
              </div>
              <div class="info-item">
                <div class="flex2 flex">
                  <div class="label">施工单位</div>
                  <div class="value">SPS-2021-01-01</div>
                  <div class="value">{{ projectInfo.developmentCompanyInfo.name || '-' }}</div>
                </div>
                <div class="flex1 flex">
                  <div class="label">项目经理</div>
                  <div class="value">工程类型</div>
                  <div class="value">{{ projectInfo.developmentCompanyInfo.leader || '-' }}</div>
                </div>
              </div>
              <div class="info-item">
                <div class="flex2 flex">
                  <div class="label">监理单位</div>
                  <div class="value">SPS-2021-01-01</div>
                  <div class="value">{{ projectInfo.supervisorCompanyInfo.name || '-' }}</div>
                </div>
                <div class="flex1 flex">
                  <div class="label">总监</div>
                  <div class="value">工程类型</div>
                  <div class="value">{{ projectInfo.supervisorCompanyInfo.leader || '-' }}</div>
                </div>
              </div>
              <div class="info-item">
                <div class="flex2 flex">
                  <div class="label">建设单位</div>
                  <div class="value">SPS-2021-01-01</div>
                  <div class="value">{{ projectInfo.constructionCompanyInfo.name || '-' }}</div>
                </div>
                <div class="flex1 flex">
                  <div class="label">项目负责人</div>
                  <div class="value">工程类</div>
                  <div class="value">{{ projectInfo.constructionCompanyInfo.leader || '-' }}</div>
                </div>
              </div>
              <div class="info-item">
              <div class="info-item" v-for="item in projectInfo.properties">
                <div class="flex2 flex">
                  <div class="label dept">设备租赁单位</div>
                  <div class="value">SPS-2021-01-01</div>
                  <div class="value">{{ JSON.parse(item)['工程起重机械租赁单位'] || '-' }}</div>
                </div>
                <div class="flex1 flex">
                  <div class="label">联系人</div>
                  <div class="value">工程类型</div>
                  <div class="value">{{ JSON.parse(item)['联系电话'] || '-' }}</div>
                </div>
              </div>
              <div class="info-item">
                <div class="flex">
                  <div class="label time">最近一次检查时间</div>
                  <div class="value">SPS-2021-01-01</div>
                  <div class="value">{{ projectInfo.checkTime || '-' }}</div>
                </div>
              </div>
            </div>
@@ -91,10 +91,15 @@
                <div class="legend-item" v-for="(it, idx) in legendData" :key="idx">
                  <div class="dot" :style="{ backgroundColor: it.itemStyle.color }"></div>
                  <div class="legend-info">
                    <div class="legend-name" :title="it.name">{{ it.name }}</div>
                    <div class="legend-name" :title="it.name">{{ it.name }}
                    </div>
                    <div class="legend-number">{{ it.value }}</div>
                  </div>
                </div>
              </div>
              <div class="total-card">
                <div class="total ff54-">{{ equipment || 0 }}</div>
                <div class="text">设备数量</div>
              </div>
            </div>
          </template>
@@ -163,17 +168,17 @@
        </div>
        <div class="mid-content">
          <div class="mid-img">
            <div class="number">199</div>
            <div class="number">{{ dangerCount.serious || 0 }}</div>
            <div class="name">所有隐患数</div>
          </div>
          <div class="mid-total">
            <div class="mid-item">
              <div class="mid-txt">已整改</div>
              <div class="mid-num">62</div>
              <div class="mid-num">{{ dangerCount.rectified || 0 }}</div>
            </div>
            <div class="mid-item">
              <div class="mid-txt">未整改</div>
              <div class="mid-num">62</div>
              <div class="mid-num">{{ dangerCount.unRectified || 0 }}</div>
            </div>
          </div>
        </div>
@@ -196,8 +201,8 @@
              <div class="people-card">
                <div class="people-item">
                  <div class="people-chart">
                    <el-progress width="74" type="circle" :show-text="false" :percentage="25" define-back-color="#000"
                      color="#32C5FF" :stroke-linecap="square"></el-progress>
                    <el-progress :width="74" type="circle" :show-text="false" :percentage="25" define-back-color="#000"
                      color="#32C5FF" stroke-linecap="square"></el-progress>
                    <div class="progress-card">
                      <div class="progress-num">25.4</div>
                      <div class="progress-unit">%</div>
@@ -207,8 +212,8 @@
                </div>
                <div class="people-item">
                  <div class="people-chart">
                    <el-progress width="74" type="circle" :show-text="false" :percentage="25" define-back-color="#000"
                      color="#32C5FF" :stroke-linecap="square"></el-progress>
                    <el-progress :width="74" type="circle" :show-text="false" :percentage="25" define-back-color="#000"
                      color="#32C5FF" stroke-linecap="square"></el-progress>
                    <div class="progress-card">
                      <div class="progress-num">25.4</div>
                      <div class="progress-unit">%</div>
@@ -218,8 +223,8 @@
                </div>
                <div class="people-item">
                  <div class="people-chart">
                    <el-progress width="74" type="circle" :show-text="false" :percentage="25" define-back-color="#000"
                      color="#32C5FF" :stroke-linecap="square"></el-progress>
                    <el-progress :width="74" type="circle" :show-text="false" :percentage="25" define-back-color="#000"
                      color="#32C5FF" stroke-linecap="square"></el-progress>
                    <div class="progress-card">
                      <div class="progress-num">25.4</div>
                      <div class="progress-unit">%</div>
@@ -231,8 +236,8 @@
              <div class="people-card2">
                <div class="people-item mr--67">
                  <div class="people-chart">
                    <el-progress width="74" type="circle" :show-text="false" :percentage="25" define-back-color="#000"
                      color="#32C5FF" :stroke-linecap="square"></el-progress>
                    <el-progress :width="74" type="circle" :show-text="false" :percentage="25" define-back-color="#000"
                      color="#32C5FF" stroke-linecap="square"></el-progress>
                    <div class="progress-card">
                      <div class="progress-num">25.4</div>
                      <div class="progress-unit">%</div>
@@ -242,8 +247,8 @@
                </div>
                <div class="people-item">
                  <div class="people-chart">
                    <el-progress width="74" type="circle" :show-text="false" :percentage="25" define-back-color="#000"
                      color="#32C5FF" :stroke-linecap="square"></el-progress>
                    <el-progress :width="74" type="circle" :show-text="false" :percentage="25" define-back-color="#000"
                      color="#32C5FF" stroke-linecap="square"></el-progress>
                    <div class="progress-card">
                      <div class="progress-num">25.4</div>
                      <div class="progress-unit">%</div>
@@ -329,6 +334,7 @@
<script>
import HeaderBox from "../header/index.vue";
import { getLoginInfo, getProjectDetail, getProjectDeviceCount, getDangerCount, deviceTypes } from './service.js'
import moment from "moment";
import * as echarts from "echarts";
export default {
@@ -343,15 +349,14 @@
      markers: [],
      projectId: '',
      projectName: '',
      // 项目详情信息
      projectInfo: {},//项目信息
      dangerCount: {},//危险源统计
      deviceTypeList: [],//设备类型列表
      equipment: 0,//设备数量
      // pie数据
      legendData: [
        { name: "正常", value: 10, itemStyle: { color: "#00FF00" } },
        { name: "异常", value: 20, itemStyle: { color: "#FF0000" } },
        { name: "待处理", value: 30, itemStyle: { color: "#FFA500" } },
        { name: "待完成", value: 30, itemStyle: { color: "#FF00FF" } },
        { name: "已完成", value: 30, itemStyle: { color: "#00FFFF" } },
      ],
      legendData: [],
      dateTxt: '',
      riskTrandList: [],
      // 风险源数据
@@ -427,16 +432,62 @@
      key: "232929db1cb31f26d42b3645a7456154",
      version: "2.0",
    });
    this.projectId = this.$route.query.projectId || ''
    this.projectName = this.$route.query.projectName || ''
    if (this.$route.query.projectId) {
      this.projectId = this.$route.query.projectId || ''
      getLoginInfo({ id: this.projectId, type: 2 }).then(res => {
        console.log('res', res)
        this.projectName = res.name
      })
      this.getDetail()
    }
  },
  mounted() {
    this.setMapload()
    this.initPie3D()
    this.initRiskChart()
    setTimeout(() => {
      this.initRiskChart()
    }, 1000)
  },
  beforeDestroy() { },
  methods: {
    // 获取项目详情
    getDetail() {
      // 设备类型
      deviceTypes().then(res => {
        this.deviceTypeList = res
      })
      // 获取项目详情
      getProjectDetail(this.projectId).then(res => {
        this.projectInfo = {
          ...res,
          addressInfo: JSON.parse(res.addressInfo),
          address: JSON.parse(res.addressInfo).province + JSON.parse(res.addressInfo).city + JSON.parse(res.addressInfo).district + JSON.parse(res.addressInfo).detail,
          constructionCompanyInfo: JSON.parse(res.constructionCompanyInfo),
          developmentCompanyInfo: JSON.parse(res.developmentCompanyInfo),
          supervisorCompanyInfo: JSON.parse(res.supervisorCompanyInfo),
        }
        console.log('projectInfo projectInfo', this.projectInfo)
      })
      // 设备数量
      getProjectDeviceCount(this.projectId).then(res => {
        this.equipment = 0
        this.legendData = res.map(item => {
          this.equipment += item.count
          return {
            ...item,
            value: item.count || 0,
            name: this.deviceTypeList[item.type].name,
            itemStyle: { color: this.generateRandomColor() }
          }
        })
        this.initPie3D()
      })
      // 隐患数量
      getDangerCount(this.projectId).then(res => {
        this.dangerCount = res
        console.log('getDangerCount getDangerCount', res)
      })
    },
    toPersonnelOnDuty() {
      this.$router.push({
        path: "/personnelOnDuty",
@@ -502,7 +553,7 @@
            // mapStyle: "amap://styles/darkblue",
            layers: [satellite],
          });
          this.initCategoryMarkers(AMap);
          // this.initCategoryMarkers(AMap);
        })
        .catch((e) => {
          console.error(e); //加载错误提示
@@ -733,7 +784,13 @@
        }
      });
    },
    // 生成随机颜色
    generateRandomColor() {
      const h = Math.floor(Math.random() * 360);
      const s = Math.floor(Math.random() * 30) + 60; // 60-90%
      const l = Math.floor(Math.random() * 20) + 50; // 50-70%
      return `hsl(${h}, ${s}%, ${l}%)`;
    },
    // 生成扇形的曲面参数方程
    getParametricEquation(
      startRatio,
@@ -1095,17 +1152,19 @@
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: auto;
    .flex1 {
      flex: 1;
    }
    .flex2 {
      flex: 2;
      flex: 1.5;
    }
    .info-item {
      display: flex;
      gap: 10px;
    }
    .label {
@@ -1147,7 +1206,7 @@
    .pie-canvas {
      position: absolute;
      left: -37px;
      bottom: 20px;
      bottom: 10px;
      width: 362px;
      height: 112px;
      z-index: 2;
@@ -1235,7 +1294,31 @@
      }
    }
    .total-card {
      position: absolute;
      left: 53px;
      top: 0px;
      z-index: 99;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      .total {
        font-weight: 400;
        font-size: 34px;
        color: #66FFFF;
        line-height: 39px;
        text-shadow: 0px 0px 12px #1068F7;
      }
      .text {
        font-weight: bold;
        font-size: 16px;
        color: #FFFFFF;
        line-height: 24px;
      }
    }
  }
  .danger-info {
screen/src/view/projectHome/service.js
@@ -1,8 +1,33 @@
import request from '@/utils/request'
export const getDeptList = async (params) => {
  return request(`/statistics/deptList`, {
// 设备类型
export const deviceTypes = async (id) => {
  return request(`/project/deviceTypes`, {
    method: 'get'
  })
}
// 获取当前登录信息
export const getLoginInfo = async (params) => {
  return request(`/dashboard-statistics/getLoginInfo`, {
    method: 'get',
    params
  })
}
}
// 获取项目详情
export const getProjectDetail = async (id) => {
  return request(`/project/getProjectDetail/${id}`, {
    method: 'get'
  })
}
// 获取设备数量
export const getProjectDeviceCount = async (id) => {
  return request(`/project/getProjectDeviceCount/${id}`, {
    method: 'get'
  })
}
// 获取项目隐患数量
export const getDangerCount = async (id) => {
  return request(`/project/getProjectHiddenDangerCount/${id}`, {
    method: 'get'
  })
}