Gary Gu
2025-06-30 84201c1e88b65f16b6da2c85ab8eee23f37a3da1
src/views/ProjectView.vue
@@ -7,8 +7,13 @@
        backgroundImage: `url(${titleImage})`,
        backgroundRepeat: 'no-repeat',
        backgroundPosition: 'center center',
        backgroundSize: '100% 100%'
        backgroundSize: '100% 100%',
        display: 'flex',
        alignItems: 'center',
      }"
    >
      <span style="font-family: PangMenZhengDaoBiaoTiTi !important; font-size: 24px; letter-spacing: 2px; white-space: nowrap; margin-left: 30px"
        >项目概况</span
    >
    </div>
    
@@ -19,7 +24,7 @@
        backgroundImage: `url(${backgroundImage})`,
        backgroundRepeat: 'no-repeat',
        backgroundPosition: 'center center',
        backgroundSize: 'cover'
        backgroundSize: 'cover',
      }"
    >
      <div class="h-[120px] w-full">
@@ -30,17 +35,13 @@
            backgroundImage: `url(${contentImage})`,
            backgroundRepeat: 'no-repeat',
            backgroundPosition: 'center center',
            backgroundSize: '100% 100%'
            backgroundSize: '100% 100%',
          }"
        >
          <img
            src="../assets/images/backgrounds/jianzhumianji.png"
            alt=""
            class="h-[30px] w-[40px]"
          >
          <img src="../assets/images/backgrounds/jianzhumianji.png" alt="" class="h-[30px] w-[40px]" />
          <div class="text-white text-[16px]">一期总建筑面积</div>
          <div class="flex items-center justify-center">
            <div class="text-[24px] text-[#FFD500] font-bold mr-[8px]">{{projectInfo.GrossFloorArea ? projectInfo.GrossFloorArea : '103.18'}}</div>
            <div class="text-[24px] text-[#FFD500] font-bold mr-[8px]">{{ projectInfo.GrossFloorArea ? projectInfo.GrossFloorArea : "103.18" }}</div>
            <div class="text-[14px] text-white">万㎡</div>
          </div>
        </div>
@@ -52,17 +53,13 @@
            backgroundImage: `url(${contentImage})`,
            backgroundRepeat: 'no-repeat',
            backgroundPosition: 'center center',
            backgroundSize: '100% 100%'
            backgroundSize: '100% 100%',
          }"
        >
          <img
            src="../assets/images/backgrounds/mubiaowancheng.png"
            alt=""
            class="h-[30px] w-[40px]"
          >
          <img src="../assets/images/backgrounds/mubiaowancheng.png" alt="" class="h-[30px] w-[40px]" />
          <div class="text-white text-[16px]">目标完成日期</div>
          <div class="flex items-center justify-center">
            <div class="text-[24px] text-[#00FFFF] font-bold">{{projectInfo.endDate? projectInfo.endDate : '2028-12-01'}}</div>
            <div class="text-[24px] text-[#00FFFF] font-bold">{{ projectInfo.endDate ? projectInfo.endDate : "2028-12-01" }}</div>
          </div>
        </div>
      </div>
@@ -74,7 +71,7 @@
            backgroundImage: `url(${bgImage})`,
            backgroundRepeat: 'no-repeat',
            backgroundPosition: 'center center',
            backgroundSize: '100% 100%'
            backgroundSize: '100% 100%',
          }"
        >
          <div class="text-white text-[14px] ml-[40px] leading-[35px]">项目名称:{{projectInfo.ProjectName}}</div>
@@ -88,8 +85,8 @@
          :src="projectInfo.Thumbnail? projectInfo.Thumbnail : '../assets/images/backgrounds/cover_bg.png'" 
          alt="" 
          class="w-full mt-[20px]"
          style="height: calc(100% - 150px);"
        >
          style="height: calc(100% - 150px)"
        />
      </div>
      <div class="w-[100%] h-[18%]">
        <!-- 参建单位 -->
@@ -99,7 +96,7 @@
            backgroundImage: `url(${bgImage})`,
            backgroundRepeat: 'no-repeat',
            backgroundPosition: 'center center',
            backgroundSize: '100% 100%'
            backgroundSize: '100% 100%',
          }"
        >
          <div class="text-white text-[14px] ml-[40px] leading-[35px]">参建单位</div>
@@ -112,22 +109,14 @@
              <div class="text-[18px] text-[#00FFFF]">{{projectParticipatingNumber.buildingUnit}}</div>
              <div class="text-[12px] text-[#ddd]">建设单位</div>
            </div>
            <img
              src="../assets/images/backgrounds/jianshedanwei.png"
              alt=""
              class="h-[40px] w-[60px]"
            >
            <img src="../assets/images/backgrounds/jianshedanwei.png" alt="" class="h-[40px] w-[60px]" />
          </div>
          <div class="w-[48%] h-[50px] px-[12px] flex items-center justify-between mb-[10px] lineB">
            <div class="text-white text-[14px] flex flex-col items-center justify-center">
              <div class="text-[18px] text-[#00FFFF]">{{projectParticipatingNumber.constructionUnit}}</div>
              <div class="text-[12px] text-[#ddd]">施工单位</div>
            </div>
            <img
              src="../assets/images/backgrounds/shigongdanwei.png"
              alt=""
              class="h-[40px] w-[60px]"
            >
            <img src="../assets/images/backgrounds/shigongdanwei.png" alt="" class="h-[40px] w-[60px]" />
          </div>
        </div>
@@ -137,22 +126,14 @@
              <div class="text-[18px] text-[#00FFFF]">{{projectParticipatingNumber.supervisionUnit}}</div>
              <div class="text-[12px] text-[#ddd]">监理单位</div>
            </div>
            <img
              src="../assets/images/backgrounds/jianlidanwei.png"
              alt=""
              class="h-[40px] w-[60px]"
            >
            <img src="../assets/images/backgrounds/jianlidanwei.png" alt="" class="h-[40px] w-[60px]" />
          </div>
          <div class="w-[48%] h-[50px] px-[12px] flex items-center justify-between mb-[10px] lineB">
            <div class="text-white text-[14px] flex flex-col items-center justify-center">
              <div class="text-[18px] text-[#00FFFF]">{{projectParticipatingNumber.designUnit}}</div>
              <div class="text-[12px] text-[#ddd]">设计单位</div>
            </div>
            <img
              src="../assets/images/backgrounds/shejidanwei.png"
              alt=""
              class="h-[40px] w-[60px]"
            >
            <img src="../assets/images/backgrounds/shejidanwei.png" alt="" class="h-[40px] w-[60px]" />
          </div>
        </div>
      </div>
@@ -166,24 +147,16 @@
            prefix-icon="el-icon-search"
            clearable
            @keyup.enter.native="searchList"
          >
          </el-input>
          />
        </div>
        <!-- 表格 -->
        <el-table
          ref="filterTable"
          :data="tableData"
          class="chartTable w-full h-[300px] overflow-y-auto"
        >
        <el-table ref="filterTable" :data="tableData" class="chartTable w-full h-[300px] overflow-y-auto">
          <el-table-column prop="UnitTypeText" label="类型" width="180" />
          <el-table-column prop="Bind" label="阶段" width="180"
          :filters="bindFilters"
          :filter-method="filterBind"
          filter-placement="bottom-end">
          <el-table-column prop="Bind" label="阶段" width="180" :filters="bindFilters" :filter-method="filterBind" filter-placement="bottom-end">
            <template slot-scope="scope">
              <div class="long_title">
                <span>{{ scope.row.Bind&&scope.row.Bind !== '' ?scope.row.Bind: '--'}}</span>
                <span>{{ scope.row.Bind && scope.row.Bind !== "" ? scope.row.Bind : "--" }}</span>
              </div>
            </template>
          </el-table-column>
@@ -198,31 +171,31 @@
import { getProjectId } from "../utils/getToken.js";
import { HomeAPI } from "../api/home";
export default {
  name: 'ProjectView',
    name: "ProjectView",
  data() {
    return {
      projectId: '',
      searchText: '',
      backgroundImage: new URL('@/assets/images/backgrounds/cover_bg.png', import.meta.url).href,
      titleImage: new URL('@/assets/images/titles/xiangmu.png', import.meta.url).href,
      contentImage: new URL('@/assets/images/titles/xiangmu_bg.png', import.meta.url).href,
      bgImage: new URL('@/assets/images/titles/title_second.png', import.meta.url).href,
      tableImage: new URL('@/assets/images/backgrounds/table_bg.png', import.meta.url).href,
        projectId: "",
        searchText: "",
        backgroundImage: new URL("@/assets/images/backgrounds/cover_bg.png", import.meta.url).href,
        titleImage: new URL("@/assets/images/titles/xiangmu.png", import.meta.url).href,
        contentImage: new URL("@/assets/images/titles/xiangmu_bg.png", import.meta.url).href,
        bgImage: new URL("@/assets/images/titles/title_second.png", import.meta.url).href,
        tableImage: new URL("@/assets/images/backgrounds/table_bg.png", import.meta.url).href,
      projectInfo: {
        GrossFloorArea: '',
        ProjectName: '',
        Description: '',
        Thumbnail: '',
        endDate: ''
          GrossFloorArea: "",
          ProjectName: "",
          Description: "",
          Thumbnail: "",
          endDate: "",
      },
      projectParticipatingNumber: {
        buildingUnit: 0,
        constructionUnit: 0,
        supervisionUnit: 0,
        designUnit: 0
          designUnit: 0,
      },
      tableData: [],
      bindFilters: [{ text: '家', value: '家' }], // 示例阶段列表
        bindFilters: [{ text: "家", value: "家" }], // 示例阶段列表
    };
  },
  mounted() {
@@ -234,98 +207,95 @@
    getProject() {
      this.projectId = getProjectId();
      const data = {
        "projectId": this.projectId
      }
      HomeAPI.GetProject(data).then(res => {
          projectId: this.projectId,
        };
        HomeAPI.GetProject(data).then((res) => {
        console.log(res);
        if(res.Ret === 1) {
          const result = res.Data
            const result = res.Data;
          console.log(result);
          if(result.SafeProductionEndDate && result.SafeProductionEndDate !== 'null') {
            this.projectInfo.endDate = result.SafeProductionEndDate.substring(0, 10)
            this.$store.commit('common/setProjectEndDate', this.projectInfo.endDate)
            this.projectInfo.ProjectName = result.ProjectName
            this.projectInfo.Description = result.Description
            this.projectInfo.Thumbnail = result.Thumbnail
            this.projectInfo.GrossFloorArea = result.GrossFloorArea
            if (result.SafeProductionEndDate && result.SafeProductionEndDate !== "null") {
              this.projectInfo.endDate = result.SafeProductionEndDate.substring(0, 10);
              this.$store.commit("common/setProjectEndDate", this.projectInfo.endDate);
              this.projectInfo.ProjectName = result.ProjectName;
              this.projectInfo.Description = result.Description;
              this.projectInfo.Thumbnail = result.Thumbnail;
              this.projectInfo.GrossFloorArea = result.GrossFloorArea;
          } 
        }
      });
    },
    getParticipatingList(val) {
      const data = {
        "organizeId": this.projectId,
        name: val ? val : ''
      }
      HomeAPI.GetParticipatingList(data).then(res => {
          organizeId: this.projectId,
          name: val ? val : "",
        };
        HomeAPI.GetParticipatingList(data).then((res) => {
        console.log(res);
        if(res.Ret === 1) {
          const result = res.Data
            const result = res.Data;
          console.log(result);
          if(result.length > 0) {
            this.tableData = result
            const newArray = []
            result.forEach(item => {
              if(item.Bind && item.Bind !== 'null') {
                newArray.push({ text: item.Bind, value: item.Bind })
              this.tableData = result;
              const newArray = [];
              result.forEach((item) => {
                if (item.Bind && item.Bind !== "null") {
                  newArray.push({ text: item.Bind, value: item.Bind });
              }
            })
            this.bindFilters = this.arrayFilter(newArray, 'value')
              });
              this.bindFilters = this.arrayFilter(newArray, "value");
            console.log(newArray, this.bindFilters);
          } else {
            this.tableData = []
              this.tableData = [];
          }
        }
      });
    },
    // 数组去重
    arrayFilter (arr, key) {
      const res = new Map()
      return arr.filter(arr => !res.has(arr[key]) && res.set(arr[key], 1))
        const res = new Map();
        return arr.filter((arr) => !res.has(arr[key]) && res.set(arr[key], 1));
    },
    getParticipatingNumber() {
      const data = {
        "organizeId": this.projectId
      }
      HomeAPI.GetParticipatingNumber(data).then(res => {
          organizeId: this.projectId,
        };
        HomeAPI.GetParticipatingNumber(data).then((res) => {
        console.log(res);
        if(res.Ret === 1) {
          const result = res.Data
            const result = res.Data;
          console.log(result);
          if(result.length > 0) {
            result.forEach(item => {
              if(item.UnitTypeText === '建设单位') {
                this.projectParticipatingNumber.buildingUnit = item.Number
              } else if(item.UnitTypeText === '施工单位') {
                this.projectParticipatingNumber.constructionUnit = item.Number
              } else if(item.UnitTypeText === '监理单位') {
                this.projectParticipatingNumber.supervisionUnit = item.Number
              } else if(item.UnitTypeText === '设计单位') {
                this.projectParticipatingNumber.designUnit = item.Number
              result.forEach((item) => {
                if (item.UnitTypeText === "建设单位") {
                  this.projectParticipatingNumber.buildingUnit = item.Number;
                } else if (item.UnitTypeText === "施工单位") {
                  this.projectParticipatingNumber.constructionUnit = item.Number;
                } else if (item.UnitTypeText === "监理单位") {
                  this.projectParticipatingNumber.supervisionUnit = item.Number;
                } else if (item.UnitTypeText === "设计单位") {
                  this.projectParticipatingNumber.designUnit = item.Number;
              }
            })
              });
          }
        }
      });
    },
    searchList() {
      this.getParticipatingList(this.searchText)
        this.getParticipatingList(this.searchText);
    },
    filterBind(value, row) {
      return row.Bind === value;
    },
    resetDateFilter() {
      this.$refs.filterTable.clearFilter('date');
        this.$refs.filterTable.clearFilter("date");
    },
    clearFilter() {
      this.$refs.filterTable.clearFilter();
    },
  }
}
    },
  };
</script>
<style scoped lang="scss">
@@ -391,7 +361,7 @@
.table-header {
  height: 32px;
  background: linear-gradient(180deg, #3068A5 0%, #1E4066 100%);
    background: linear-gradient(180deg, #3068a5 0%, #1e4066 100%);
  box-shadow: inset 0px 1px 0px 0px rgba(255,255,255,0.2);
}
.chart-container{
@@ -399,18 +369,17 @@
  height: calc(40% - 170px);
  .chartTable{
    height: calc(100% - 10px);
  }
  ::v-deep .el-table{
      background-image: url("~@/assets/images/backgrounds/table_bg.png");
      background-repeat: no-repeat;
      background-position: center center;
      background-size: 100% 100%;
      background-color: #0E2B46;
      background-color: #0e2b46;
      padding: 8px 10px;
      .el-table__header tr,
      .el-table__header th {
        background: linear-gradient(180deg, #3068A5 0%, #1E4066 100%);
        background: linear-gradient(180deg, #3068a5 0%, #1e4066 100%);
        box-shadow: inset 0px 1px 0px 0px rgba(255,255,255,0.2);
        padding: 0;
        height: 32px;
@@ -434,7 +403,7 @@
          }
          td.el-table__cell{
            padding: 10px 0;
            border-bottom: 1px solid #3685F4;
            border-bottom: 1px solid #3685f4;
          }
        }
        tr.el-table__row{