feat:设备管理

This commit is contained in:
houjunxiang
2026-03-09 17:53:33 +08:00
parent 9c88c45d66
commit 6004f6c032
19 changed files with 1196 additions and 1057 deletions

View File

@@ -6,11 +6,11 @@
<up-row class="flex-wrap pt10 pl10" style="background-color: #f5f7fa">
<up-col class="mb8" :span="gridCol" v-for="(item, index) in detailSchema">
<view style="color: #666"
><span style="color: #333">{{ item.label }}</span>{{ detailInfo[item.value] }}</view
><span style="color: #333">{{ item.label }}</span>{{ deviceInfo[item.value] }}</view
>
</up-col>
</up-row>
<view class="pt5">
<view class="p10">
<up-row>
<up-col span="6">
<view
@@ -19,10 +19,10 @@
{{ detailInfo.checkUserName }}
</text>
</view>
<view class="pt5"
<view class="pt10"
>维护保养日期
<text style="color: #666">
{{ detailInfo.checkDate }}
{{ nx.$helper.formateToDateTime(detailInfo.checkDate) }}
</text>
</view>
</up-col>
@@ -73,8 +73,9 @@
import { ref, reactive, onMounted, watch, computed } from 'vue'
import { useGridCol } from '@/nx/hooks/useGridCol'
import dailyCheckApi from '@/nx/api/dailyCheck'
import { getDeviceBusInfoById } from '@/nx/api/deviceInfo'
import { getImgBaseUrl } from '@/defaultBaseUrl'
import nx from '@/nx'
const { gridCol } = useGridCol([700], [6, 4])
const props = defineProps({
show: {
@@ -113,12 +114,18 @@ async function getDetailInfo(id) {
const res = await dailyCheckApi.queryById(id)
detailInfo.value = res
}
const deviceInfo = ref({})
async function getDeviceInfo(id) {
const res = await getDeviceBusInfoById(id)
deviceInfo.value = res
}
const emit = defineEmits(['close', 'open'])
function handleClose() {
emit('close')
}
function handleOpen() {
getDetailInfo(props.checkInfo.id)
getDeviceInfo(props.checkInfo.deviceId)
}
</script>
@@ -139,4 +146,7 @@ function handleOpen() {
:deep(.uicon-close) {
font-size: 22px !important;
}
:deep(.u-popup__content__close--top-right) {
top: 30px;
}
</style>

File diff suppressed because it is too large Load Diff

View File

@@ -14,6 +14,7 @@
:columns="column"
:cellStyle="setCellStyle"
:cellHeaderStyle="setCellHeaderStyle"
:formatter="columnFormatter"
:data="listData"
@detail="handleDetail"
@pullUpLoading="pullUpLoadingAction"
@@ -47,7 +48,8 @@ const column = reactive([
{
label: '维护保养日期',
name: 'checkDate',
width: 300
width: 300,
formatter: true
},
{
name: 'operation',
@@ -56,7 +58,14 @@ const column = reactive([
renders: [{ name: '详情', func: 'detail' }]
}
])
function columnFormatter(row, column, rowIndex, columnIndex) {
// 判断是哪一列需要格式化
if (column.name === 'checkDate') {
return nx.$helper.formateToDateTime(row.checkDate)
}
// 对于不需要特殊格式化的列,返回原始值
return row[column.name]
}
const deviceId = ref('')
const deviceText = ref('')
onMounted(() => {