完善设备数据跳转

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

View File

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