完善设备数据跳转

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

@ -123,9 +123,9 @@ async function submit() {
const formValues = await formApi.getValues();
const fetchParams: any = isEdit
? {
id: editRow.value.id,
...formValues,
}
id: editRow.value.id,
...formValues,
}
: formValues;
try {
@ -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,59 +202,46 @@ const openAddModal = async () => {
<Page auto-content-height>
<Grid>
<template #toolbar-actions>
<TableAction
:actions="[
{
label: $t('common.add'),
type: 'primary',
icon: 'ant-design:plus-outlined',
onClick: openAddModal.bind(null),
auth: ['AbpIdentity.Users.Create'],
},
]"
/>
<TableAction :actions="[
{
label: $t('common.add'),
type: 'primary',
icon: 'ant-design:plus-outlined',
onClick: openAddModal.bind(null),
auth: ['AbpIdentity.Users.Create'],
},
]" />
</template>
<template #isSelfDevelop="{ row }">
<component
:is="
h(Tag, { color: row.selfDevelop ? 'green' : 'red' }, () =>
row.selfDevelop ? $t('common.yes') : $t('common.no'),
)
"
/>
<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' }, () =>
row.status ? $t('common.yes') : $t('common.no'),
)
"
/>
<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' }, () =>
row.enabled ? $t('common.yes') : $t('common.no'),
)
"
/>
<component :is="h(Tag, { color: row.enabled ? 'green' : 'red' }, () =>
row.enabled ? $t('common.yes') : $t('common.no'),
)
" />
</template>
<template #action="{ row }">
<TableAction
:actions="[
{
label: $t('common.edit'),
type: 'link',
size: 'small',
auth: ['AbpIdentity.Users.Update'],
onClick: onEdit.bind(null, row),
},
]"
:drop-down-actions="[
<TableAction :actions="[
{
label: $t('common.edit'),
type: 'link',
size: 'small',
auth: ['AbpIdentity.Users.Update'],
onClick: onEdit.bind(null, row),
},
]" :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

@ -127,14 +127,14 @@ async function submit() {
const formValues = await formApi.getValues();
const fetchParams: any = isEdit
? {
id: editRow.value.id,
...formValues,
password: formValues.password || '000000',
}
id: editRow.value.id,
...formValues,
password: formValues.password || '000000',
}
: {
...formValues,
password: formValues.password || '000000',
};
...formValues,
password: formValues.password || '000000',
};
try {
userModalApi.setState({ loading: true, confirmLoading: true });
@ -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,24 +212,22 @@ const openAddModal = async () => {
<Page auto-content-height>
<Grid>
<template #toolbar-actions>
<TableAction
:actions="[
{
label: $t('common.add'),
type: 'primary',
icon: 'ant-design:plus-outlined',
onClick: openAddModal.bind(null),
auth: ['AbpIdentity.Users.Create'],
},
]"
/>
<TableAction :actions="[
{
label: $t('common.add'),
type: 'primary',
icon: 'ant-design:plus-outlined',
onClick: openAddModal.bind(null),
auth: ['AbpIdentity.Users.Create'],
},
]" />
</template>
<template #isMeterType="{ row }">
{{ meterTypeOptions[row.meterType - 1]?.label }}
</template>
<template #isSingleRate="{ row }">
{{ rateOptions.find((item) => item.value === row.singleRate)?.label }}
{{rateOptions.find((item) => item.value === row.singleRate)?.label}}
</template>
<template #isArchiveStatus="{ row }">
{{
@ -240,54 +238,40 @@ const openAddModal = async () => {
{{ row.tripState ? $t('common.SwitchOff') : $t('common.Closing') }}
</template>
<template #isHaveValve="{ row }">
<component
:is="
h(Tag, { color: row.haveValve ? 'green' : 'red' }, () =>
row.haveValve ? $t('common.yes') : $t('common.no'),
)
"
/>
<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' }, () =>
row.selfDevelop ? $t('common.yes') : $t('common.no'),
)
"
/>
<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' }, () =>
row.dynamicPassword ? $t('common.yes') : $t('common.no'),
)
"
/>
<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' }, () =>
row.enabled ? $t('common.yes') : $t('common.no'),
)
"
/>
<component :is="h(Tag, { color: row.enabled ? 'green' : 'red' }, () =>
row.enabled ? $t('common.yes') : $t('common.no'),
)
" />
</template>
<template #action="{ row }">
<TableAction
:actions="[
{
label: $t('common.edit'),
type: 'link',
size: 'small',
auth: ['AbpIdentity.Users.Update'],
onClick: onEdit.bind(null, row),
},
]"
:drop-down-actions="[
<TableAction :actions="[
{
label: $t('common.edit'),
type: 'link',
size: 'small',
auth: ['AbpIdentity.Users.Update'],
onClick: onEdit.bind(null, row),
},
]" :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>