feat:设备使用记录
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
<template>
|
||||
<view>
|
||||
<up-sticky v-if="!isComponent">
|
||||
<navbar-back title="设备使用记录查看"> </navbar-back>
|
||||
</up-sticky>
|
||||
<navbar-back v-if="!isComponent" title="设备使用记录查看"> </navbar-back>
|
||||
<uni-card spacing="0">
|
||||
<uni-section v-if="!isComponent" titleFontSize="20px" type="line" :title="deviceText"> </uni-section>
|
||||
<view class="p10" style="width: 50%">
|
||||
@@ -18,7 +16,7 @@
|
||||
@custom="reset"
|
||||
></up-search>
|
||||
</view>
|
||||
<view :style="{ height: isComponent ? '60vh' : '62vh' }">
|
||||
<view :style="{ height: isComponent ? '70vh' : '72vh' }">
|
||||
<zb-table
|
||||
ref="zbTableRef"
|
||||
isShowLoadMore
|
||||
@@ -28,6 +26,7 @@
|
||||
:cellStyle="setCellStyle"
|
||||
:cellHeaderStyle="setCellHeaderStyle"
|
||||
:data="listData"
|
||||
:formatter="columnFormatter"
|
||||
@detail="handleDetail"
|
||||
@pullUpLoading="pullUpLoadingAction"
|
||||
></zb-table>
|
||||
@@ -58,12 +57,13 @@ const column = reactive([
|
||||
{
|
||||
label: '开始使用人',
|
||||
name: 'userName',
|
||||
width: 100
|
||||
width: 150
|
||||
},
|
||||
{
|
||||
label: '开始时间',
|
||||
name: 'useTimeStart',
|
||||
width: 170
|
||||
width: 170,
|
||||
formatter: true
|
||||
},
|
||||
{
|
||||
label: '结束使用人',
|
||||
@@ -73,7 +73,8 @@ const column = reactive([
|
||||
{
|
||||
label: '结束时间',
|
||||
name: 'useTimeEnd',
|
||||
width: 170
|
||||
width: 170,
|
||||
formatter: true
|
||||
},
|
||||
{
|
||||
label: '使用前状态',
|
||||
@@ -94,10 +95,22 @@ const column = reactive([
|
||||
{
|
||||
name: 'operation',
|
||||
type: 'operation',
|
||||
width: 100,
|
||||
label: '操作',
|
||||
renders: [{ name: '详情', func: 'detail' }]
|
||||
}
|
||||
])
|
||||
function columnFormatter(row, column, rowIndex, columnIndex) {
|
||||
// 判断是哪一列需要格式化
|
||||
if (column.name === 'useTimeStart') {
|
||||
return nx.$helper.formateToDateTime(row.useTimeStart)
|
||||
}
|
||||
if (column.name === 'useTimeEnd') {
|
||||
return nx.$helper.formateToDateTime(row.useTimeEnd)
|
||||
}
|
||||
// 对于不需要特殊格式化的列,返回原始值
|
||||
return row[column.name]
|
||||
}
|
||||
let zbTableRef = ref(null)
|
||||
const deviceId = ref('')
|
||||
const deviceText = ref('')
|
||||
@@ -148,10 +161,6 @@ function handleDetail(row) {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.u-sticky {
|
||||
top: 0 !important;
|
||||
background-color: #fff !important;
|
||||
}
|
||||
:deep(.zb-table uni-button[type='primary']) {
|
||||
background-color: $uni-color-primary !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user