Newer
Older
KaiFengPC / src / views / sponeScreen / projectHM / ProjectDisplay.vue
@lyj lyj on 25 Jun 3 KB 工程考核弹框
<template>
  <div class="publicContainerA">
    <div class="partTitleHM">项目展示列表</div>
    <div class="ConstrucClass">
      <div class="HeadContent">
        <el-form-item>
          <el-input @blur="blurMethod(queryParams.filieDescription)" v-model="queryParams.filieDescription" placeholder="请输入项目名称" style="width: 95%; margin: 15px auto" />
        </el-form-item>
      </div>
      <div class="ConstrucNr">
        <Vue3SeamlessScroll :list="listDataXm" :singleHeight="55" :singleWaitTime="1500" :hover="true" class="scroll">
          <div class="listXm" v-for="item in listDataXm" :title="item.projectName" @click="ProjectClick(item)">
            <img class="Icon_zp" :src="Architectural" alt="" />
            <div :class="{activeConstruListA: listActive.projectTypeId==item.projectTypeId}"   class="XmName ellipsis" >{{ item.projectName }}</div>
          </div>
        </Vue3SeamlessScroll>
      </div>
    </div>
  </div>
</template>

<script setup>
import { Vue3SeamlessScroll } from 'vue3-seamless-scroll';
import {projectInfoNew} from '@/api/sponeScreen/gcpjApi.js'

import Architectural from '@/assets/newImgs/HMScreen/Architectural_icon.png';
const emitM = defineEmits();
const listDataXm = ref([]);
const listActive = ref({});

async function projectInfoNewM() { 
  let { data, code } = await projectInfoNew()
  if (code == 200) { 
    listDataXm.value=data
  }
}
const AllData = reactive({
  queryParams: {},
});
const ProjectClick = (row) => { 
  listActive.value = row
  listDataXm.value.map(i => {
    if (row.id == i.id) {
      i.checked = !i.checked;
    } else {
      i.checked = false;
    }
  });
  let arr = listDataXm.value.filter(i => i.checked);
  emitM('qipaoDateMeth', arr[0], arr[0]?.checked);
}
const { queryParams } = toRefs(AllData);
const blurMethod = v => {
  if (v) {
    debugger
    listDataXm.value = listDataXm.value.filter(item => {
      return item.projectName.includes(v);
    });
  } else { 
    projectInfoNewM()
  }
};
projectInfoNewM()
</script>

<style lang="scss" scoped>
.publicContainerA {
  margin-top: 10px;
}
.ConstrucClass {
  width: 100%;
  height: calc(100vh - 530px);
  background: #003b6d;
  opacity: 0.8;
  .HeadContent {
    width: 100%;
    height: 65px;
    // background: red;
    align-items: center;
    line-height: 25px;
    margin-top: 2px;
  }
  .ConstrucNr {
    width: 100%;
    height: calc(100% - 17%);
    // background: #2790fb;
    .scroll {
      width: 95%;
      height: calc(100% - 1%);
      overflow: hidden;
      // display: inline-block;
      // background: red;
      margin: auto;
    }
    .listXm {
      position: relative;
      width: 95%;
      height: 50px;
      background: url('@/assets/newImgs/HMScreen/ujnasf.png') no-repeat;
      background-size: 100% 100%;
      display: flex;
      margin: 5px auto;
      .Icon_zp {
        width: 32px;
        height: 32px;
        position: relative;
        top: 9px;
        left: 20px;
        // background: red;
      }
      .XmName {
        position: relative;
        left: 70px;
        top: 15px;
        width: 315px;
        height: 50px;
        // background: red;
        overflow: hidden;
       white-space: nowrap; /* 防止文字换行 */
         text-overflow: ellipsis; 
      }
      
    }
  }
}

:deep(.el-input__wrapper, .el-textarea__inner) {
  background: #11559b !important;
  box-shadow: 0 0 0 0.00521rem #066592 inset !important;
  border: 1px solid #2790fb;
  color: #fff !important;
}
.activeConstruListA
{ 
  color: #cbc05a;
}
</style>