修改大屏项目详情信息

dev_xd
haha 2025-03-31 23:51:54 +08:00
parent dd32355b98
commit b34bf8bb9e
1 changed files with 110 additions and 71 deletions

View File

@ -7,28 +7,30 @@
<div v-for="it in types" :key="it.value" :class="nav == it.value ? 'head-nav active' : 'head-nav'"
@click="doNav(it)">{{ it.label }}({{ getTypeCount(it) }})</div>
</div>
<el-table v-loading="loading" :data="dataList" v-if="type == 0" class="data-list">
<el-table v-loading="loading" :data="dataList" v-if="type == 0" class="data-list" :height="tbHeight">
<el-table-column label="头像" align="center">
<template #default="scope">
<el-image :src="scope.row.user.userPicture" :preview-teleported="true"
class="att-img" :preview-src-list="[scope.row.user.userPicture]"></el-image>
<el-image :src="scope.row.user.userPicture" :preview-teleported="true" class="att-img"
:preview-src-list="[scope.row.user.userPicture]"></el-image>
</template>
</el-table-column>
<el-table-column label="姓名" align="center" prop="user.userName" />
<el-table-column label="籍贯" align="center" prop="info.nativePlace" />
<el-table-column label="性别" align="center" prop="user.sex" />
<el-table-column label="状态" align="center" prop="enterState">
<el-table-column label="姓名" align="center" prop="userName" />
<el-table-column label="籍贯" align="center" prop="nativePlace" />
<el-table-column label="性别" align="center" prop="sex" />
<el-table-column label="状态" align="center" prop="useStatus">
<template #default="scope">
<span v-if="scope.row.enterState == 0" style="color: green;"></span>
<span v-if="scope.row.useStatus == 0" style="color: green;"></span>
<span v-else style="color: red">离场</span>
</template>
</el-table-column>
<el-table-column label="进场日期" align="center" prop="createTime" :width="$dpi() == '1K' ? '120px' : $dpi() == '2K'?'200px':'300px'">
<el-table-column label="进场日期" align="center" prop="createTime"
:width="$dpi() == '1K' ? '120px' : $dpi() == '2K' ? '200px' : '300px'">
<template #default="scope">{{ scope.row.createTime | toDate }}</template>
</el-table-column>
<el-table-column label="所属单位" align="center" prop="subDeptName" />
<el-table-column label="班组" align="center" prop="subDeptGroupName" :width="$dpi() == '1K' ? '120px' : $dpi() == '2K'?'200px':'300px'"/>
<el-table-column label="班组" align="center" prop="subDeptGroupName"
:width="$dpi() == '1K' ? '120px' : $dpi() == '2K' ? '200px' : '300px'" />
<el-table-column label="工种类型" align="center" prop="craftType">
<template #default="scope">
<dict-tag :options="types" :value="scope.row.craftType" />
@ -43,7 +45,7 @@
<el-table-column label="出生日期" align="center" prop="info.birthDayStr" v-if="false" />
</el-table>
<el-table v-loading="loading" :data="dataList" v-if="type == 1" class="data-list">
<el-table v-loading="loading" :data="dataList" v-if="type == 1" class="data-list" :height="tbHeight">
<el-table-column label="进场照片" align="center" prop="inPhoto">
<template #default="scope">
<el-image v-if="scope.row.inPhoto" :src="scope.row.inPhoto" class="att-img"
@ -72,7 +74,8 @@
<span v-else class="el-icon-close" style="color: red;font-weight: bold;"></span>
</template>
</el-table-column>
<el-table-column label="班组" align="center" prop="subDeptGroupName" :width="$dpi() == '1K' ? '120px' : $dpi() == '2K'?'200px':'400px'"/>
<el-table-column label="班组" align="center" prop="subDeptGroupName"
:width="$dpi() == '1K' ? '120px' : $dpi() == '2K' ? '200px' : '400px'" />
<el-table-column label="工种类型" align="center" prop="craftType">
<template #default="scope">
<dict-tag :options="types" :value="scope.row.craftType" class="dict-tag" />
@ -95,6 +98,7 @@ export default {
//
data() {
return {
dpi: "",
show: false,
title: '在岗人员',
prjInfo: {},
@ -108,9 +112,25 @@ export default {
total: 0,
dataList: [],
loading: false,
tbHeight: 400,
}
},
mounted() {
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.tbHeight = is1K ? 400 : is2K ? 500 : 600;
},
handleCurrentChange(n) {
this.index = n;
this.loadData();
@ -137,6 +157,7 @@ export default {
pageNum: this.index,
craftType: this.nav,
comId: this.prjInfo.comId,
useStatus: 0,
projectId: this.prjInfo.id
};
if (this.type == 1) {
@ -147,7 +168,7 @@ export default {
comId: this.prjInfo.comId,
projectId: this.prjInfo.id,
craftType: this.nav,
inTime: '2024-10-14'
inTime: this.$dt(new Date()).format("YYYY-MM-DD")
};
}
this.loading = true;
@ -155,13 +176,15 @@ export default {
this.loading = false;
if (this.type == 0) {
this.dataList = (d.rows || []).map(d => {
d.info = this.$tryToJson(d.user?.userInfos || "{}")
d.info = this.$tryToJson(d.userInfos || "{}")
d.user = d.user || {};
if (d.info.birthDay) {
let birthDay = this.$dt(d.info.birthDay).format("YYYY-MM-DD");
d.info.birthDayStr = birthDay;
d.info.age = this.$dt(new Date()).diff(d.info.birthDay, 'year');
}
d.sex = d.userSex == 0 ? '男' : '女';
d.nativePlace = d.info.nativePlace || "";
return d;
});
} else {
@ -185,67 +208,79 @@ export default {
<style lang="less">
.attendance-info-dlg {
.data-list {
margin-top:10px;
th {
.cell {
font-size: 14px;
.data-list {
margin-top: 10px;
.el-table__body-wrapper::-webkit-scrollbar {
width: 8px;
height: 8px;
}
.el-table__body-wrapper::-webkit-scrollbar-thumb {
background-color: #01a9ff;
border-radius: 4px;
}
th {
.cell {
font-size: 14px;
}
}
td {
.cell {
font-size: 14px;
.el-tag {
font-size: 12px;
height: 30px;
line-height: 30px;
}
}
}
.el-table__empty-text {
font-size: 14px;
}
.el-table__row {
&:nth-child(odd) {
background-size: 100% 55px;
}
td {
.cell {
font-size: 14px;
.el-tag{
font-size:12px;
height: 30px;
line-height: 30px;
}
}
}
.el-table__empty-text {
font-size: 14px;
}
.el-table__row {
&:nth-child(odd) {
background-size: 100% 55px;
}
td {
height: 60px;
}
}
.el-image.att-img {
img {
height: 40px;
}
.el-image__error {
height: 50px;
position: relative;
top: 10px;
}
}
.el-icon-close {
font-size: 20px;
height: 60px;
}
}
.el-pagination {
* {
font-size: 14px !important;
height: 28px !important;
line-height: 28px !important;
vertical-align: middle !important;
.el-image.att-img {
img {
height: 40px;
}
.el-image__error {
height: 50px;
position: relative;
top: 10px;
}
}
.el-icon-close {
font-size: 20px;
}
}
.el-pagination {
* {
font-size: 14px !important;
height: 28px !important;
line-height: 28px !important;
vertical-align: middle !important;
}
}
}
@media (min-width: 1921px) and (max-width: 2560px) {
.attendance-info-dlg {
.data-list {
@ -258,8 +293,9 @@ export default {
td {
.cell {
font-size: 20px;
.el-tag{
font-size:20px;
.el-tag {
font-size: 20px;
height: 30px;
line-height: 30px;
}
@ -311,9 +347,10 @@ export default {
@media (min-width: 2561px) {
.attendance-info-dlg {
.data-list {
th {
height: 50px;
.data-list {
th {
height: 50px;
.cell {
font-size: 30px;
line-height: 48px;
@ -321,12 +358,14 @@ export default {
}
td {
height: 50px;
height: 50px;
.cell {
font-size: 30px;
line-height: 48px;
.el-tag{
font-size:30px;
.el-tag {
font-size: 30px;
height: 48px;
line-height: 48px;
}