Compare commits
5 Commits
12d28955bf
...
a5781829e9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5781829e9 | ||
|
|
551323d5d1 | ||
|
|
6563b24045 | ||
|
|
598f0d8399 | ||
|
|
31c6a15aae |
@ -2,17 +2,22 @@
|
|||||||
import type { VbenFormProps } from '#/adapter/form';
|
import type { VbenFormProps } from '#/adapter/form';
|
||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
|
|
||||||
import { computed, nextTick, ref, watch } from 'vue';
|
import { computed, nextTick, ref, watch, onMounted } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
|
|
||||||
import { Page } from '@vben/common-ui';
|
import { Page } from '@vben/common-ui';
|
||||||
|
|
||||||
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
||||||
import { postTreeModelDeviceDataInfoPage, postMetersPage } from '#/api-client';
|
import { postMetersPage, postTreeModelDeviceDataInfoPage } from '#/api-client';
|
||||||
|
import { $t } from '#/locales';
|
||||||
|
|
||||||
import { generateDynamicColumns } from './dynamicColumns';
|
import { generateDynamicColumns } from './dynamicColumns';
|
||||||
import { querySchema } from './schema';
|
import { querySchema } from './schema';
|
||||||
|
|
||||||
|
defineOptions({
|
||||||
|
name: 'DeviceData',
|
||||||
|
});
|
||||||
|
|
||||||
// 存储设备信息选项的完整数据
|
// 存储设备信息选项的完整数据
|
||||||
const deviceOptions = ref<any[]>([]);
|
const deviceOptions = ref<any[]>([]);
|
||||||
|
|
||||||
@ -37,30 +42,28 @@ const fetchDeviceOptions = async () => {
|
|||||||
|
|
||||||
// 根据设备ID获取设备信息对象
|
// 根据设备ID获取设备信息对象
|
||||||
const getDeviceInfoById = (deviceId: string) => {
|
const getDeviceInfoById = (deviceId: string) => {
|
||||||
return deviceOptions.value.find(device => device.id === deviceId);
|
return deviceOptions.value.find((device) => device.id === deviceId);
|
||||||
};
|
};
|
||||||
|
|
||||||
defineOptions({
|
|
||||||
name: 'DeviceData',
|
|
||||||
});
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const { DeviceType, DeviceId, FocusAddress } = route.query;
|
const { DeviceType, DeviceId, FocusAddress, SystemName } = route.query;
|
||||||
|
|
||||||
// 动态列定义
|
// 动态列定义
|
||||||
const dynamicColumns = ref<any[]>([]);
|
const dynamicColumns = ref<any[]>([]);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 固定列定义(始终显示)- 基于 IoTDBTreeModelDeviceDataDto 类型
|
// 固定列定义(始终显示)- 基于 IoTDBTreeModelDeviceDataDto 类型
|
||||||
const fixedColumns = [
|
const fixedColumns = [
|
||||||
{ title: '序号', type: 'seq', width: 50 },
|
{ title: '序号', type: 'seq', width: 50 },
|
||||||
{ field: 'Timestamps', title: '时间戳', minWidth: 150 },
|
{ field: 'Timestamps', title: $t('abp.IoTDBBase.Timestamps'), minWidth: 150 },
|
||||||
{ field: 'SystemName', title: '系统名称', minWidth: 150 },
|
{ field: 'SystemName', title: $t('abp.IoTDBBase.SystemName'), minWidth: 150 },
|
||||||
{ field: 'ProjectId', title: '项目ID', minWidth: 150 },
|
{ field: 'ProjectId', title: $t('abp.IoTDBBase.ProjectId'), minWidth: 150 },
|
||||||
{ field: 'DeviceType', title: '设备类型', minWidth: 150 },
|
{ field: 'DeviceType', title: $t('abp.IoTDBBase.DeviceType'), minWidth: 150 },
|
||||||
{ field: 'IoTDataType', title: 'IoT数据类型', minWidth: 150 },
|
{
|
||||||
{ field: 'DeviceId', title: '设备ID', minWidth: 150 },
|
field: 'IoTDataType',
|
||||||
|
title: $t('abp.IoTDBBase.IoTDataType'),
|
||||||
|
minWidth: 150,
|
||||||
|
},
|
||||||
|
{ field: 'DeviceId', title: $t('abp.IoTDBBase.DeviceId'), minWidth: 150 },
|
||||||
];
|
];
|
||||||
|
|
||||||
// 合并固定列和动态列 - 使用计算属性确保响应式
|
// 合并固定列和动态列 - 使用计算属性确保响应式
|
||||||
@ -86,18 +89,30 @@ const formOptions: VbenFormProps = {
|
|||||||
FocusAddress: FocusAddress as string,
|
FocusAddress: FocusAddress as string,
|
||||||
DeviceType: DeviceType ? Number(DeviceType) : undefined,
|
DeviceType: DeviceType ? Number(DeviceType) : undefined,
|
||||||
DeviceId: DeviceId as string,
|
DeviceId: DeviceId as string,
|
||||||
|
SystemName: SystemName as string,
|
||||||
},
|
},
|
||||||
// 禁用表单值变化时自动提交,使用自定义处理函数
|
// 禁用表单值变化时自动提交,使用自定义处理函数
|
||||||
submitOnChange: false,
|
submitOnChange: false,
|
||||||
// 添加表单值变化的处理函数
|
// 添加表单值变化的处理函数
|
||||||
handleValuesChange: async (values, changedFields) => {
|
handleValuesChange: async (values, changedFields) => {
|
||||||
// 当任何相关字段发生变化时,刷新表格数据
|
// 当任何相关字段发生变化时,刷新表格数据
|
||||||
const relevantFields = ['SystemName', 'DeviceType', 'IoTDataType', 'DeviceId', 'FocusAddress'];
|
const relevantFields = new Set([
|
||||||
const hasRelevantChange = changedFields.some(field => relevantFields.includes(field));
|
'DeviceId',
|
||||||
|
'DeviceType',
|
||||||
|
'FocusAddress',
|
||||||
|
'IoTDataType',
|
||||||
|
'SystemName',
|
||||||
|
]);
|
||||||
|
const hasRelevantChange = changedFields.some((field) =>
|
||||||
|
relevantFields.has(field),
|
||||||
|
);
|
||||||
|
|
||||||
if (hasRelevantChange) {
|
if (hasRelevantChange) {
|
||||||
console.log('表单字段变化:', { values, changedFields });
|
console.log('表单字段变化:', { values, changedFields });
|
||||||
console.log('相关字段变化:', changedFields.filter(field => relevantFields.includes(field)));
|
console.log(
|
||||||
|
'相关字段变化:',
|
||||||
|
changedFields.filter((field) => relevantFields.has(field)),
|
||||||
|
);
|
||||||
|
|
||||||
// 使用 setTimeout 确保表单值已经完全更新
|
// 使用 setTimeout 确保表单值已经完全更新
|
||||||
setTimeout(async () => {
|
setTimeout(async () => {
|
||||||
@ -147,62 +162,45 @@ const gridOptions: VxeGridProps<any> = {
|
|||||||
console.log('=== API调用开始 ===');
|
console.log('=== API调用开始 ===');
|
||||||
// 处理DeviceType和IoTDataType,确保传递数字类型
|
// 处理DeviceType和IoTDataType,确保传递数字类型
|
||||||
const deviceTypeValue = formValues.DeviceType || DeviceType;
|
const deviceTypeValue = formValues.DeviceType || DeviceType;
|
||||||
const deviceTypeNumber = deviceTypeValue ? Number(deviceTypeValue) : undefined;
|
const deviceTypeNumber = deviceTypeValue
|
||||||
|
? Number(deviceTypeValue)
|
||||||
|
: undefined;
|
||||||
|
|
||||||
const ioTDataTypeValue = formValues.IoTDataType;
|
const ioTDataTypeValue = formValues.IoTDataType;
|
||||||
const ioTDataTypeNumber = ioTDataTypeValue ? Number(ioTDataTypeValue) : undefined;
|
|
||||||
|
console.log('=== API调用开始 ===2', ioTDataTypeValue);
|
||||||
|
|
||||||
// 处理DeviceId,当设备类型为集中器(10)时,使用focusId
|
// 处理DeviceId,当设备类型为集中器(10)时,使用focusId
|
||||||
let finalDeviceId = formValues.DeviceId || DeviceId;
|
let finalDeviceId = formValues.DeviceId || DeviceId;
|
||||||
if (deviceTypeNumber === 10 && formValues.DeviceId) {
|
if (formValues.DeviceId) {
|
||||||
const deviceInfo = getDeviceInfoById(formValues.DeviceId);
|
const deviceInfo = getDeviceInfoById(formValues.DeviceId);
|
||||||
if (deviceInfo && deviceInfo.focusId) {
|
if (deviceInfo) {
|
||||||
finalDeviceId = deviceInfo.focusId;
|
if (deviceTypeNumber === 10) {
|
||||||
console.log('设备类型为集中器,使用focusId:', {
|
// 集中器类型使用focusId
|
||||||
originalDeviceId: formValues.DeviceId,
|
if (deviceInfo.focusId) {
|
||||||
focusId: deviceInfo.focusId,
|
finalDeviceId = deviceInfo.focusId;
|
||||||
deviceInfo: deviceInfo,
|
console.log('设备类型为集中器,使用focusId:', {
|
||||||
});
|
originalDeviceId: formValues.DeviceId,
|
||||||
|
focusId: deviceInfo.focusId,
|
||||||
|
deviceInfo: deviceInfo,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 其他设备类型使用meterId
|
||||||
|
if (deviceInfo.meterId) {
|
||||||
|
finalDeviceId = deviceInfo.meterId;
|
||||||
|
console.log('设备类型为非集中器,使用meterId:', {
|
||||||
|
originalDeviceId: formValues.DeviceId,
|
||||||
|
meterId: deviceInfo.meterId,
|
||||||
|
deviceInfo: deviceInfo,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('请求参数:', {
|
|
||||||
page,
|
|
||||||
formValues,
|
|
||||||
routeParams: { DeviceType, DeviceId, FocusAddress },
|
|
||||||
typeConversions: {
|
|
||||||
deviceType: {
|
|
||||||
originalValue: deviceTypeValue,
|
|
||||||
convertedValue: deviceTypeNumber,
|
|
||||||
type: typeof deviceTypeNumber,
|
|
||||||
},
|
|
||||||
ioTDataType: {
|
|
||||||
originalValue: ioTDataTypeValue,
|
|
||||||
convertedValue: ioTDataTypeNumber,
|
|
||||||
type: typeof ioTDataTypeNumber,
|
|
||||||
},
|
|
||||||
deviceId: {
|
|
||||||
originalValue: formValues.DeviceId || DeviceId,
|
|
||||||
finalValue: finalDeviceId,
|
|
||||||
isFocusId: deviceTypeNumber === 10 && formValues.DeviceId && getDeviceInfoById(formValues.DeviceId)?.focusId,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
finalParams: {
|
|
||||||
...formValues,
|
|
||||||
pageIndex: page.currentPage,
|
|
||||||
pageSize: page.pageSize,
|
|
||||||
DeviceType: deviceTypeNumber,
|
|
||||||
DeviceId: finalDeviceId,
|
|
||||||
FocusAddress: formValues.FocusAddress || FocusAddress,
|
|
||||||
SystemName: formValues.SystemName,
|
|
||||||
IoTDataType: ioTDataTypeNumber,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const { data } = await postTreeModelDeviceDataInfoPage({
|
const { data } = await postTreeModelDeviceDataInfoPage({
|
||||||
body: {
|
body: {
|
||||||
...formValues,
|
|
||||||
pageIndex: page.currentPage,
|
pageIndex: page.currentPage,
|
||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
// 优先使用表单中的值,如果没有则使用路由参数
|
// 优先使用表单中的值,如果没有则使用路由参数
|
||||||
@ -210,8 +208,8 @@ const gridOptions: VxeGridProps<any> = {
|
|||||||
DeviceId: finalDeviceId,
|
DeviceId: finalDeviceId,
|
||||||
FocusAddress: formValues.FocusAddress || FocusAddress,
|
FocusAddress: formValues.FocusAddress || FocusAddress,
|
||||||
// 添加其他表单参数
|
// 添加其他表单参数
|
||||||
SystemName: formValues.SystemName,
|
SystemName: formValues.SystemName || SystemName,
|
||||||
IoTDataType: ioTDataTypeNumber,
|
IoTDataType: ioTDataTypeValue,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -267,7 +265,12 @@ const gridOptions: VxeGridProps<any> = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
console.log('返回给表格的数据:', result);
|
console.log('返回给表格的数据:', result);
|
||||||
console.log('总数:', result.totalCount, '当前页数据量:', result.items.length);
|
console.log(
|
||||||
|
'总数:',
|
||||||
|
result.totalCount,
|
||||||
|
'当前页数据量:',
|
||||||
|
result.items.length,
|
||||||
|
);
|
||||||
console.log('分页信息:', {
|
console.log('分页信息:', {
|
||||||
currentPage: page.currentPage,
|
currentPage: page.currentPage,
|
||||||
pageSize: page.pageSize,
|
pageSize: page.pageSize,
|
||||||
@ -311,6 +314,40 @@ watch(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// 监听路由参数变化,当有路由参数时自动触发查询
|
||||||
|
watch(
|
||||||
|
() => [DeviceType, DeviceId, FocusAddress, SystemName],
|
||||||
|
async (newValues, oldValues) => {
|
||||||
|
console.log('路由参数变化:', { newValues, oldValues });
|
||||||
|
// 如果有路由参数,等待设备信息加载完成后自动触发查询
|
||||||
|
if (newValues.some(val => val) && gridApi) {
|
||||||
|
// 等待设备信息加载完成
|
||||||
|
await fetchDeviceOptions();
|
||||||
|
// 延迟一下确保表单值已经设置
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log('自动触发查询,路由参数:', { DeviceType, DeviceId, FocusAddress, SystemName });
|
||||||
|
gridApi.reload();
|
||||||
|
}, 100);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ immediate: true }
|
||||||
|
);
|
||||||
|
|
||||||
|
// 页面初始化时,如果有路由参数则自动触发查询
|
||||||
|
onMounted(async () => {
|
||||||
|
console.log('页面挂载完成,检查路由参数:', { DeviceType, DeviceId, FocusAddress, SystemName });
|
||||||
|
// 如果有路由参数,等待设备信息加载完成后自动触发查询
|
||||||
|
if (DeviceType || DeviceId || FocusAddress || SystemName) {
|
||||||
|
// 等待设备信息加载完成
|
||||||
|
await fetchDeviceOptions();
|
||||||
|
// 延迟一下确保表单值已经设置
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log('页面初始化时自动触发查询');
|
||||||
|
gridApi.reload();
|
||||||
|
}, 200);
|
||||||
|
}
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@ -50,8 +50,8 @@ export const querySchema = computed(() => [
|
|||||||
TypeName: 'MeterTypeEnum',
|
TypeName: 'MeterTypeEnum',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
labelField: 'secondValue',
|
labelField: 'value',
|
||||||
valueField: 'value',
|
valueField: 'key',
|
||||||
optionsPropName: 'options',
|
optionsPropName: 'options',
|
||||||
immediate: true,
|
immediate: true,
|
||||||
afterFetch: (res: any) => {
|
afterFetch: (res: any) => {
|
||||||
|
|||||||
@ -123,9 +123,9 @@ async function submit() {
|
|||||||
const formValues = await formApi.getValues();
|
const formValues = await formApi.getValues();
|
||||||
const fetchParams: any = isEdit
|
const fetchParams: any = isEdit
|
||||||
? {
|
? {
|
||||||
id: editRow.value.id,
|
id: editRow.value.id,
|
||||||
...formValues,
|
...formValues,
|
||||||
}
|
}
|
||||||
: formValues;
|
: formValues;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -171,11 +171,12 @@ 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,
|
||||||
FocusAddress: row.focusAddress,
|
FocusAddress: row.focusAddress,
|
||||||
|
SystemName: row.businessSystemName,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -202,59 +203,46 @@ 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',
|
icon: 'ant-design:plus-outlined',
|
||||||
icon: 'ant-design:plus-outlined',
|
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="
|
row.selfDevelop ? $t('common.yes') : $t('common.no'),
|
||||||
h(Tag, { color: row.selfDevelop ? 'green' : 'red' }, () =>
|
)
|
||||||
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="
|
row.status ? $t('common.yes') : $t('common.no'),
|
||||||
h(Tag, { color: row.status ? 'green' : 'red' }, () =>
|
)
|
||||||
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="
|
row.enabled ? $t('common.yes') : $t('common.no'),
|
||||||
h(Tag, { color: row.enabled ? 'green' : 'red' }, () =>
|
)
|
||||||
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',
|
size: 'small',
|
||||||
size: 'small',
|
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 +268,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>
|
||||||
|
|||||||
@ -127,14 +127,14 @@ async function submit() {
|
|||||||
const formValues = await formApi.getValues();
|
const formValues = await formApi.getValues();
|
||||||
const fetchParams: any = isEdit
|
const fetchParams: any = isEdit
|
||||||
? {
|
? {
|
||||||
id: editRow.value.id,
|
id: editRow.value.id,
|
||||||
...formValues,
|
...formValues,
|
||||||
password: formValues.password || '000000',
|
password: formValues.password || '000000',
|
||||||
}
|
}
|
||||||
: {
|
: {
|
||||||
...formValues,
|
...formValues,
|
||||||
password: formValues.password || '000000',
|
password: formValues.password || '000000',
|
||||||
};
|
};
|
||||||
|
|
||||||
try {
|
try {
|
||||||
userModalApi.setState({ loading: true, confirmLoading: true });
|
userModalApi.setState({ loading: true, confirmLoading: true });
|
||||||
@ -178,11 +178,12 @@ 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,
|
||||||
FocusAddress: row.focusAddress,
|
FocusAddress: row.focusAddress,
|
||||||
|
SystemName: row.businessSystemName,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -212,24 +213,22 @@ 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',
|
icon: 'ant-design:plus-outlined',
|
||||||
icon: 'ant-design:plus-outlined',
|
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,54 +239,40 @@ 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="
|
row.haveValve ? $t('common.yes') : $t('common.no'),
|
||||||
h(Tag, { color: row.haveValve ? 'green' : 'red' }, () =>
|
)
|
||||||
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="
|
row.selfDevelop ? $t('common.yes') : $t('common.no'),
|
||||||
h(Tag, { color: row.selfDevelop ? 'green' : 'red' }, () =>
|
)
|
||||||
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="
|
row.dynamicPassword ? $t('common.yes') : $t('common.no'),
|
||||||
h(Tag, { color: row.dynamicPassword ? 'green' : 'red' }, () =>
|
)
|
||||||
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="
|
row.enabled ? $t('common.yes') : $t('common.no'),
|
||||||
h(Tag, { color: row.enabled ? 'green' : 'red' }, () =>
|
)
|
||||||
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',
|
size: 'small',
|
||||||
size: 'small',
|
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 +297,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>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user