完善设备数据跳转

This commit is contained in:
ChenYi 2025-07-14 11:06:36 +08:00
parent 6563b24045
commit 551323d5d1
2 changed files with 81 additions and 118 deletions

View File

@ -171,7 +171,7 @@ function onDel(row: any) {
const toStatusData = (row: Record<string, any>) => { const toStatusData = (row: Record<string, any>) => {
// 使 // 使
router.push({ router.push({
path: '/iotdb/status', path: '/iotdb/deviceData',
query: { query: {
DeviceType: 10, DeviceType: 10,
DeviceId: row.focusId, DeviceId: row.focusId,
@ -202,8 +202,7 @@ const openAddModal = async () => {
<Page auto-content-height> <Page auto-content-height>
<Grid> <Grid>
<template #toolbar-actions> <template #toolbar-actions>
<TableAction <TableAction :actions="[
:actions="[
{ {
label: $t('common.add'), label: $t('common.add'),
type: 'primary', type: 'primary',
@ -211,41 +210,30 @@ const openAddModal = async () => {
onClick: openAddModal.bind(null), onClick: openAddModal.bind(null),
auth: ['AbpIdentity.Users.Create'], auth: ['AbpIdentity.Users.Create'],
}, },
]" ]" />
/>
</template> </template>
<template #isSelfDevelop="{ row }"> <template #isSelfDevelop="{ row }">
<component <component :is="h(Tag, { color: row.selfDevelop ? 'green' : 'red' }, () =>
:is="
h(Tag, { color: row.selfDevelop ? 'green' : 'red' }, () =>
row.selfDevelop ? $t('common.yes') : $t('common.no'), row.selfDevelop ? $t('common.yes') : $t('common.no'),
) )
" " />
/>
</template> </template>
<template #isStatus="{ row }"> <template #isStatus="{ row }">
<component <component :is="h(Tag, { color: row.status ? 'green' : 'red' }, () =>
:is="
h(Tag, { color: row.status ? 'green' : 'red' }, () =>
row.status ? $t('common.yes') : $t('common.no'), row.status ? $t('common.yes') : $t('common.no'),
) )
" " />
/>
</template> </template>
<template #isEnable="{ row }"> <template #isEnable="{ row }">
<component <component :is="h(Tag, { color: row.enabled ? 'green' : 'red' }, () =>
:is="
h(Tag, { color: row.enabled ? 'green' : 'red' }, () =>
row.enabled ? $t('common.yes') : $t('common.no'), row.enabled ? $t('common.yes') : $t('common.no'),
) )
" " />
/>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<TableAction <TableAction :actions="[
:actions="[
{ {
label: $t('common.edit'), label: $t('common.edit'),
type: 'link', type: 'link',
@ -253,8 +241,7 @@ const openAddModal = async () => {
auth: ['AbpIdentity.Users.Update'], auth: ['AbpIdentity.Users.Update'],
onClick: onEdit.bind(null, row), onClick: onEdit.bind(null, row),
}, },
]" ]" :drop-down-actions="[
:drop-down-actions="[
{ {
label: row.enabled ? $t('common.disabled') : $t('common.enabled'), label: row.enabled ? $t('common.disabled') : $t('common.enabled'),
icon: `ant-design:${row.enabled ? 'close' : 'check'}-outlined`, icon: `ant-design:${row.enabled ? 'close' : 'check'}-outlined`,
@ -280,15 +267,11 @@ const openAddModal = async () => {
auth: ['AbpIdentity.Users.Delete'], auth: ['AbpIdentity.Users.Delete'],
onClick: toStatusData.bind(null, row), onClick: toStatusData.bind(null, row),
}, },
]" ]" />
/>
</template> </template>
</Grid> </Grid>
<UserModal <UserModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
:title="editRow.id ? $t('common.edit') : $t('common.add')"
class="w-[800px]"
>
<component :is="editRow.id ? EditForm : AddForm" /> <component :is="editRow.id ? EditForm : AddForm" />
</UserModal> </UserModal>
</Page> </Page>

View File

@ -178,7 +178,7 @@ function onDel(row: any) {
const toStatusData = (row: Record<string, any>) => { const toStatusData = (row: Record<string, any>) => {
// 使 // 使
router.push({ router.push({
path: '/iotdb/point', path: '/iotdb/deviceData',
query: { query: {
DeviceType: row.meterType, DeviceType: row.meterType,
DeviceId: row.meterId, DeviceId: row.meterId,
@ -212,8 +212,7 @@ const openAddModal = async () => {
<Page auto-content-height> <Page auto-content-height>
<Grid> <Grid>
<template #toolbar-actions> <template #toolbar-actions>
<TableAction <TableAction :actions="[
:actions="[
{ {
label: $t('common.add'), label: $t('common.add'),
type: 'primary', type: 'primary',
@ -221,15 +220,14 @@ const openAddModal = async () => {
onClick: openAddModal.bind(null), onClick: openAddModal.bind(null),
auth: ['AbpIdentity.Users.Create'], auth: ['AbpIdentity.Users.Create'],
}, },
]" ]" />
/>
</template> </template>
<template #isMeterType="{ row }"> <template #isMeterType="{ row }">
{{ meterTypeOptions[row.meterType - 1]?.label }} {{ meterTypeOptions[row.meterType - 1]?.label }}
</template> </template>
<template #isSingleRate="{ row }"> <template #isSingleRate="{ row }">
{{ rateOptions.find((item) => item.value === row.singleRate)?.label }} {{rateOptions.find((item) => item.value === row.singleRate)?.label}}
</template> </template>
<template #isArchiveStatus="{ row }"> <template #isArchiveStatus="{ row }">
{{ {{
@ -240,45 +238,32 @@ const openAddModal = async () => {
{{ row.tripState ? $t('common.SwitchOff') : $t('common.Closing') }} {{ row.tripState ? $t('common.SwitchOff') : $t('common.Closing') }}
</template> </template>
<template #isHaveValve="{ row }"> <template #isHaveValve="{ row }">
<component <component :is="h(Tag, { color: row.haveValve ? 'green' : 'red' }, () =>
:is="
h(Tag, { color: row.haveValve ? 'green' : 'red' }, () =>
row.haveValve ? $t('common.yes') : $t('common.no'), row.haveValve ? $t('common.yes') : $t('common.no'),
) )
" " />
/>
</template> </template>
<template #isSelfDevelop="{ row }"> <template #isSelfDevelop="{ row }">
<component <component :is="h(Tag, { color: row.selfDevelop ? 'green' : 'red' }, () =>
:is="
h(Tag, { color: row.selfDevelop ? 'green' : 'red' }, () =>
row.selfDevelop ? $t('common.yes') : $t('common.no'), row.selfDevelop ? $t('common.yes') : $t('common.no'),
) )
" " />
/>
</template> </template>
<template #isDynamicPassword="{ row }"> <template #isDynamicPassword="{ row }">
<component <component :is="h(Tag, { color: row.dynamicPassword ? 'green' : 'red' }, () =>
:is="
h(Tag, { color: row.dynamicPassword ? 'green' : 'red' }, () =>
row.dynamicPassword ? $t('common.yes') : $t('common.no'), row.dynamicPassword ? $t('common.yes') : $t('common.no'),
) )
" " />
/>
</template> </template>
<template #isEnable="{ row }"> <template #isEnable="{ row }">
<component <component :is="h(Tag, { color: row.enabled ? 'green' : 'red' }, () =>
:is="
h(Tag, { color: row.enabled ? 'green' : 'red' }, () =>
row.enabled ? $t('common.yes') : $t('common.no'), row.enabled ? $t('common.yes') : $t('common.no'),
) )
" " />
/>
</template> </template>
<template #action="{ row }"> <template #action="{ row }">
<TableAction <TableAction :actions="[
:actions="[
{ {
label: $t('common.edit'), label: $t('common.edit'),
type: 'link', type: 'link',
@ -286,8 +271,7 @@ const openAddModal = async () => {
auth: ['AbpIdentity.Users.Update'], auth: ['AbpIdentity.Users.Update'],
onClick: onEdit.bind(null, row), onClick: onEdit.bind(null, row),
}, },
]" ]" :drop-down-actions="[
:drop-down-actions="[
{ {
label: $t('common.delete'), label: $t('common.delete'),
icon: 'ant-design:delete-outlined', icon: 'ant-design:delete-outlined',
@ -312,14 +296,10 @@ const openAddModal = async () => {
auth: ['AbpIdentity.Users.Delete'], auth: ['AbpIdentity.Users.Delete'],
onClick: archivesIssued.bind(null, row), onClick: archivesIssued.bind(null, row),
}, },
]" ]" />
/>
</template> </template>
</Grid> </Grid>
<UserModal <UserModal :title="editRow.id ? $t('common.edit') : $t('common.add')" class="w-[800px]">
:title="editRow.id ? $t('common.edit') : $t('common.add')"
class="w-[800px]"
>
<component :is="editRow.id ? EditForm : AddForm" /> <component :is="editRow.id ? EditForm : AddForm" />
</UserModal> </UserModal>
</Page> </Page>