修改代码
This commit is contained in:
parent
6019490b00
commit
8609e3198a
@ -2,16 +2,16 @@
|
|||||||
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 { ref, watch } from 'vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { ref, nextTick, watch } from 'vue';
|
|
||||||
|
|
||||||
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 { postCTWingLogInfoPage } from '#/api-client';
|
import { postCTWingLogInfoPage } from '#/api-client';
|
||||||
|
|
||||||
import { querySchema, tableSchema } from './schema';
|
|
||||||
import DeviceSelect from '../deviceData/DeviceSelect.vue';
|
import DeviceSelect from '../deviceData/DeviceSelect.vue';
|
||||||
|
import { querySchema, tableSchema } from './schema';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'CTWingLog',
|
name: 'CTWingLog',
|
||||||
@ -49,7 +49,14 @@ const gridOptions: VxeGridProps<any> = {
|
|||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
pageSizes: [10, 20, 100],
|
pageSizes: [10, 20, 100],
|
||||||
layouts: ['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total'],
|
layouts: [
|
||||||
|
'PrevPage',
|
||||||
|
'JumpNumber',
|
||||||
|
'NextPage',
|
||||||
|
'FullJump',
|
||||||
|
'Sizes',
|
||||||
|
'Total',
|
||||||
|
],
|
||||||
},
|
},
|
||||||
toolbarConfig: {
|
toolbarConfig: {
|
||||||
custom: true,
|
custom: true,
|
||||||
@ -63,23 +70,20 @@ const gridOptions: VxeGridProps<any> = {
|
|||||||
// 获取选中的设备信息
|
// 获取选中的设备信息
|
||||||
let deviceId = '';
|
let deviceId = '';
|
||||||
let systemName = '';
|
let systemName = '';
|
||||||
let deviceType = formValues?.DeviceType || '';
|
const deviceType = formValues?.DeviceType || '';
|
||||||
|
const finalFocusAddress = formValues.FocusAddress || '';
|
||||||
if (deviceSelectRef.value) {
|
if (deviceSelectRef.value) {
|
||||||
const deviceInfo = deviceSelectRef.value.getSelectedDeviceInfo();
|
const deviceInfo = deviceSelectRef.value.getSelectedDeviceInfo();
|
||||||
if (deviceInfo) {
|
if (deviceInfo) {
|
||||||
|
finalFocusAddress = deviceInfo.focusAddress || '';
|
||||||
systemName = deviceInfo.systemName || '';
|
systemName = deviceInfo.systemName || '';
|
||||||
// 设备类型为10时取focusId,其他情况取meterId
|
// 设备类型为10时取focusId,其他情况取meterId
|
||||||
if (Number(deviceType) === 10) {
|
deviceId =
|
||||||
deviceId = deviceInfo.focusId || '';
|
Number(deviceType) === 10
|
||||||
} else {
|
? deviceInfo.focusId || ''
|
||||||
deviceId = deviceInfo.meterId || '';
|
: deviceInfo.meterId || '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
// 没有deviceInfo时回退表单DeviceId
|
|
||||||
if (!deviceId) {
|
|
||||||
deviceId = formValues?.DeviceId || '';
|
|
||||||
}
|
|
||||||
// 构建查询参数
|
// 构建查询参数
|
||||||
const queryParams: any = {
|
const queryParams: any = {
|
||||||
pageIndex: page.currentPage,
|
pageIndex: page.currentPage,
|
||||||
@ -91,6 +95,7 @@ const gridOptions: VxeGridProps<any> = {
|
|||||||
SystemName: systemName || formValues?.SystemName || '',
|
SystemName: systemName || formValues?.SystemName || '',
|
||||||
StartCreationTime: formatDate(formValues?.StartCreationTime),
|
StartCreationTime: formatDate(formValues?.StartCreationTime),
|
||||||
EndCreationTime: formatDate(formValues?.EndCreationTime),
|
EndCreationTime: formatDate(formValues?.EndCreationTime),
|
||||||
|
FocusAddress: finalFocusAddress,
|
||||||
};
|
};
|
||||||
if (DeviceType) queryParams.DeviceType = DeviceType;
|
if (DeviceType) queryParams.DeviceType = DeviceType;
|
||||||
if (DeviceId) queryParams.DeviceId = DeviceId;
|
if (DeviceId) queryParams.DeviceId = DeviceId;
|
||||||
@ -147,12 +152,9 @@ watch(
|
|||||||
<template>
|
<template>
|
||||||
<Page auto-content-height>
|
<Page auto-content-height>
|
||||||
<Grid>
|
<Grid>
|
||||||
<template #DeviceId="{ model, field }"> <DeviceSelect
|
<template #DeviceId="{ model, field }">
|
||||||
ref="deviceSelectRef"
|
<DeviceSelect ref="deviceSelectRef" v-model:value="model[field]"
|
||||||
v-model:value="model[field]"
|
:placeholder="$t('common.pleaseSelect') + $t('abp.log.deviceInfo')" allow-clear />
|
||||||
:placeholder="$t('common.pleaseSelect') + $t('abp.log.deviceInfo')"
|
|
||||||
allow-clear
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user