2025-12-18 22:05:55 +08:00
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import { ref } from 'vue';
|
|
|
|
|
|
|
|
|
|
|
|
import { useVbenModal } from '@vben/common-ui';
|
|
|
|
|
|
|
|
|
|
|
|
import { useVbenVxeGrid } from '#/adapter/vxe-table';
|
|
|
|
|
|
import { postDeviceThingModelManagementPropertyPageAsync } from '#/api-client';
|
|
|
|
|
|
import { $t } from '#/locales';
|
|
|
|
|
|
|
|
|
|
|
|
defineOptions({
|
|
|
|
|
|
name: 'DeviceThingModelPropertyModal',
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const deviceThingModelId = ref<string>('');
|
|
|
|
|
|
const deviceModelName = ref<string>('');
|
|
|
|
|
|
|
|
|
|
|
|
const [Grid, gridApi] = useVbenVxeGrid({
|
|
|
|
|
|
formOptions: {
|
|
|
|
|
|
schema: [],
|
|
|
|
|
|
showDefaultActions: false,
|
|
|
|
|
|
},
|
|
|
|
|
|
gridOptions: {
|
|
|
|
|
|
columns: [
|
|
|
|
|
|
{
|
2025-12-19 10:32:13 +08:00
|
|
|
|
field: 'standardFieldDisplayName',
|
|
|
|
|
|
title: '标准属性名称',
|
2025-12-18 22:05:55 +08:00
|
|
|
|
minWidth: 160,
|
|
|
|
|
|
showOverflow: 'tooltip',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-12-19 10:32:13 +08:00
|
|
|
|
field: 'standardFieldName',
|
|
|
|
|
|
title: '标准属性标识符',
|
|
|
|
|
|
minWidth: 160,
|
|
|
|
|
|
showOverflow: 'tooltip',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
field: 'standardFieldValueType',
|
|
|
|
|
|
title: '标准属性值类型',
|
|
|
|
|
|
minWidth: 160,
|
|
|
|
|
|
showOverflow: 'tooltip',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
field: 'ioTPlatformRawFieldName',
|
|
|
|
|
|
title: '平台属性标识符',
|
|
|
|
|
|
minWidth: 160,
|
|
|
|
|
|
showOverflow: 'tooltip',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
field: 'ioTPlatformRawFieldDataType',
|
|
|
|
|
|
title: '平台属性值类型',
|
|
|
|
|
|
minWidth: 160,
|
2025-12-18 22:05:55 +08:00
|
|
|
|
showOverflow: 'tooltip',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
2025-12-19 10:32:13 +08:00
|
|
|
|
field: 'isValueNeedConvert',
|
|
|
|
|
|
title: '值类型是否转换',
|
2025-12-18 22:05:55 +08:00
|
|
|
|
minWidth: 120,
|
|
|
|
|
|
showOverflow: 'tooltip',
|
|
|
|
|
|
},
|
2025-12-19 10:32:13 +08:00
|
|
|
|
{
|
|
|
|
|
|
field: 'parsingSequence',
|
|
|
|
|
|
title: '解析方式',
|
|
|
|
|
|
minWidth: 140,
|
|
|
|
|
|
showOverflow: 'tooltip',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
field: 'nativeSkipNumber',
|
|
|
|
|
|
title: '正序跳过数量',
|
|
|
|
|
|
minWidth: 140,
|
|
|
|
|
|
showOverflow: 'tooltip',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
field: 'nativeTakeNumber',
|
|
|
|
|
|
title: '正序获取数量',
|
|
|
|
|
|
minWidth: 140,
|
|
|
|
|
|
showOverflow: 'tooltip',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
field: 'reversalSkipNumber',
|
|
|
|
|
|
title: '反转跳过数量',
|
|
|
|
|
|
minWidth: 140,
|
|
|
|
|
|
showOverflow: 'tooltip',
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
field: 'reversalTakeNumber',
|
|
|
|
|
|
title: '反转获取数量',
|
|
|
|
|
|
minWidth: 140,
|
|
|
|
|
|
showOverflow: 'tooltip',
|
|
|
|
|
|
},
|
2025-12-18 22:05:55 +08:00
|
|
|
|
{
|
|
|
|
|
|
field: 'action',
|
|
|
|
|
|
title: $t('common.action'),
|
|
|
|
|
|
width: 200,
|
|
|
|
|
|
fixed: 'right',
|
|
|
|
|
|
slots: { default: 'action' },
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
|
|
|
|
|
height: 400,
|
|
|
|
|
|
pagerConfig: {},
|
|
|
|
|
|
proxyConfig: {
|
|
|
|
|
|
ajax: {
|
|
|
|
|
|
query: async ({ page }) => {
|
|
|
|
|
|
if (!deviceThingModelId.value) {
|
|
|
|
|
|
return { items: [], totalCount: 0 };
|
|
|
|
|
|
}
|
2025-12-19 10:32:13 +08:00
|
|
|
|
const { data } =
|
|
|
|
|
|
await postDeviceThingModelManagementPropertyPageAsync({
|
|
|
|
|
|
body: {
|
|
|
|
|
|
pageIndex: page.currentPage,
|
|
|
|
|
|
pageSize: page.pageSize,
|
|
|
|
|
|
deviceThingModelId: deviceThingModelId.value,
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
2025-12-18 22:05:55 +08:00
|
|
|
|
return data || { items: [], totalCount: 0 };
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
const [Modal, modalApi] = useVbenModal({
|
|
|
|
|
|
onOpenChange(isOpen: boolean) {
|
|
|
|
|
|
if (isOpen) {
|
|
|
|
|
|
const data = modalApi.getData<Record<string, any>>();
|
|
|
|
|
|
deviceThingModelId.value = data?.deviceThingModelId || '';
|
|
|
|
|
|
deviceModelName.value = data?.deviceModelName || '';
|
|
|
|
|
|
if (gridApi && gridApi.reload) {
|
|
|
|
|
|
gridApi.reload();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
});
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
|
<Modal :title="`属性管理 - ${deviceModelName || ''}`" class="w-[900px]">
|
|
|
|
|
|
<Grid>
|
|
|
|
|
|
<!-- 这里后续可以加 toolbar-actions:新增属性、快速复制平台端物模型 -->
|
|
|
|
|
|
</Grid>
|
|
|
|
|
|
</Modal>
|
|
|
|
|
|
</template>
|