新增背景颜色

This commit is contained in:
xiaokangsix 2024-04-28 10:15:13 +08:00
parent 12ab640886
commit 0712473161
3 changed files with 201 additions and 2 deletions

View File

@ -368,6 +368,7 @@
style="width: 100%; color: #737996" style="width: 100%; color: #737996"
@selection-change="handleCheckedCitiesChange" @selection-change="handleCheckedCitiesChange"
:show-header="false" :show-header="false"
:row-class-name="tableRowClassName"
> >
<el-table-column <el-table-column
type="selection" type="selection"
@ -443,9 +444,51 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<!-- 测试 -->
<el-table-column prop="sendSuccessStatus">
<template v-slot="{ row }">
<div>
下发状态
<span
:class="[
'valuesColor',
row.sendSuccessStatus === 1
? 'green'
: row.sendSuccessStatus === 2
? 'red'
: row.sendSuccessStatus === 3
? 'yellow'
: ''
]"
>
{{
row.sendSuccessStatus === 1
? '成功'
: row.sendSuccessStatus === 2
? '失败'
: row.sendSuccessStatus === 3
? '部分成功'
: ''
}}</span
>
</div>
<div class="personItemBottom">
所属企业
<span class="values">{{ row.enterpriseName }}</span>
</div>
</template>
</el-table-column>
<el-table-column prop="address" width="300px"> <el-table-column prop="address" width="300px">
<template slot-scope="scope"> <template slot-scope="scope">
<div class="tableBtns"> <div class="tableBtns">
<el-button
size="medium"
type="text"
class="operationText"
@click="issueTeamEvent(scope.row.id)"
>查看下发详情</el-button
>
<el-button <el-button
class="operationText" class="operationText"
type="text" type="text"
@ -1845,6 +1888,80 @@
</div> </div>
</div> </div>
</el-dialog> </el-dialog>
<!-- 下发详情 -->
<el-dialog
:modal-append-to-body="false"
title="下发详情"
:close-on-click-modal="false"
:visible.sync="issueTeamDialog"
width="740px"
>
<div class="dialog_content">
<div class="table_wrap whiteBlock">
<el-table class="tables" :data="issuePointList">
<el-table-column
type="index"
width="50"
align="center"
:label="$t('message.personnelPosition.beaconManage.table.index')"
></el-table-column>
<el-table-column
prop="detail"
label="任务名称"
align="center"
></el-table-column>
<el-table-column prop="isSuccess" label="执行结果" align="center">
<template v-slot="{ row }">{{
row.isSuccess === 0 ? '成功' : '失败'
}}</template>
</el-table-column>
<el-table-column
:label="
$t('message.personnelPosition.beaconManage.table.operation')
"
align="center"
width="150"
>
<template v-slot="{ row }">
<div class="operationText" @click="retryEvent(row.id)" v-if="row.isSuccess === 0">
<span style="color: #5381f6">重试</span>
</div>
</template>
</el-table-column>
<!-- <div slot="empty">{{$t('message.personnelPosition.empty')}}</div> -->
</el-table>
<!-- <el-pagination
class="pagerBox"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="issuePage.pageNo"
:page-sizes="$store.state.PAGESIZRS"
:page-size="issuePage.pageSize"
layout="total, sizes, prev, pager, next"
:total="Number(total)"
background
></el-pagination> -->
<div class="dialog-footer">
<el-button
class="cancleBtn"
@click="issueTeamDialog = false"
icon="el-icon-circle-close"
size="medium"
>{{ $t('message.laborMange.cancel') }}</el-button
>
<el-button
type="primary"
icon="el-icon-circle-check"
@click="issueTeamDialog = false"
size="medium"
>{{ $t('message.laborMange.confirm') }}</el-button
>
</div>
</div>
</div>
</el-dialog>
</div> </div>
</template> </template>
@ -1879,7 +1996,9 @@ import {
sendWorkerInfoByIdApi, sendWorkerInfoByIdApi,
updateByIdWorkerInfo, updateByIdWorkerInfo,
sendBatchWokerApi, sendBatchWokerApi,
importImgDataApi importImgDataApi,
xmglXzHikvisionSyncGetNewestList,
xmglXzHikvisionSyncRetryAPI
} from '@/assets/js/api/laborPerson' } from '@/assets/js/api/laborPerson'
import { selectUserDevAuthorityByUserIdApi } from '@/assets/js/api/configManage' import { selectUserDevAuthorityByUserIdApi } from '@/assets/js/api/configManage'
import { getProjectConfigListApi } from '@/assets/js/api/project.js' import { getProjectConfigListApi } from '@/assets/js/api/project.js'
@ -1898,6 +2017,9 @@ export default {
}, },
data() { data() {
return { return {
issuePointList: [],
issueTeamDialog:false,
whoId:'',
typeRadio: 1, typeRadio: 1,
refreshPage: true, refreshPage: true,
key: false, key: false,
@ -3644,6 +3766,37 @@ export default {
this.$message.error(this.$t('message.laborMange.hint10')) // this.$message.error(this.$t('message.laborMange.hint10')) //
} }
}) })
},
tableRowClassName ({ row, rowIndex }) {
if (row.sendSuccessStatus === 1) {
return 'green2'
}
if (row.sendSuccessStatus === 2) {
return 'red2'
}
if (row.sendSuccessStatus === 3) {
return 'yellow2'
}
},
async issueTeamEvent (id) {
this.issueTeamDialog = true
this.whoId = id
this.getNewestList()
},
async getNewestList(){
const res = await xmglXzHikvisionSyncGetNewestList({
// pageNo:this.issuePage.pageNo,
// pageSize:this.issuePage.pageSize,
whoId: this.whoId
})
console.log(res, '---------------------')
this.issuePointList = res.result
},
async retryEvent(id){
const res = await xmglXzHikvisionSyncRetryAPI({
id:id
})
console.log(res);
} }
} }
} }
@ -3903,4 +4056,42 @@ export default {
line-height: 16px; line-height: 16px;
} }
} }
.valuesColor {
color: #fff;
padding: 3px;
}
.yellow {
background-color: #fbe000;
}
.green {
background-color: #72cb40;
}
.red {
background-color: #ec373e;
}
::v-deep {
.el-table .yellow2 {
background-color: #fffce6;
}
.el-table .green2 {
background-color: #f1faec;
}
.el-table .red2 {
background-color: #feebed;
}
.dialog-footer {
margin-top: 20px;
}
.pagerBox {
margin-top: 0;
}
.tableBtns .operationText {
margin-right:0
}
}
</style> </style>

View File

@ -4810,5 +4810,9 @@ console.log(res);
.pagerBox { .pagerBox {
margin-top: 0; margin-top: 0;
} }
.tableBtns .operationText {
margin-right:0
}
} }
</style> </style>

View File

@ -7,7 +7,7 @@
:model="searchForm" :model="searchForm"
ref="searchForm" ref="searchForm"
> >
<div style="display: flex; justify-content: space-between"> <div style="display: flex; justify-content: space-between;margin-top:15px">
<div> <div>
<el-form-item label="访客姓名" prop="visitName"> <el-form-item label="访客姓名" prop="visitName">
<el-input <el-input
@ -469,5 +469,9 @@ export default {
.el-form-item { .el-form-item {
margin-bottom: 5px; margin-bottom: 5px;
} }
.searchBox{
height:auto;
}
} }
</style> </style>