This commit is contained in:
ChenYi 2025-12-05 15:57:24 +08:00
parent ca55e50c9c
commit 28479396f9
4 changed files with 53 additions and 33 deletions

View File

@ -36,9 +36,9 @@ VITE_REFRESH_ROLE = true
# 后端接口地址
#VITE_APP_API_ADDRESS=http://47.110.53.196:28080
VITE_APP_API_ADDRESS=http://10.10.90.12:10500
VITE_APP_API_ADDRESS=http://10.10.10.103:10500
# websocket地址
VITE_WEBSOCKET_URL=http://10.10.90.12:10500/signalr/notification
VITE_WEBSOCKET_URL=http://10.10.10.103:10500/signalr/notification

View File

@ -112,7 +112,6 @@ export type ComponentType =
| 'DatePicker'
| 'DefaultButton'
| 'DeviceSelect'
| 'StandardThingModelCodeSelect'
| 'Divider'
| 'IconPicker'
| 'Input'
@ -126,6 +125,7 @@ export type ComponentType =
| 'Rate'
| 'Select'
| 'Space'
| 'StandardThingModelCodeSelect'
| 'Switch'
| 'Textarea'
| 'TimePicker'
@ -172,11 +172,17 @@ async function initComponentAdapter() {
DatePicker,
// 自定义设备选择组件
DeviceSelect: defineAsyncComponent(
() => import('#/views/iotdbdatamanagement/deviceData/DeviceSelect.vue') as any,
() =>
import(
'#/views/iotdbdatamanagement/deviceData/DeviceSelect.vue'
) as any,
),
// 自定义标准物模型编码选择组件(分页搜索)
StandardThingModelCodeSelect: defineAsyncComponent(
() => import('#/views/devicemanagement/thingmodelinfo/StandardThingModelCodeSelect.vue') as any,
() =>
import(
'#/views/thingmodelinfo/ioTPlatformThingModelInfo/StandardThingModelCodeSelect.vue'
) as any,
),
// 自定义默认按钮
DefaultButton: (props, { attrs, slots }) => {

View File

@ -12,18 +12,17 @@ import { message as Message, Tag } from 'ant-design-vue';
import { useVbenForm } from '#/adapter/form';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import {
postFilesDownload,
postFilesUpload,
postCtWingProductDeleteAsync,
postCtWingProductInsertAsync,
postCtWingProductListAsync,
postCtWingProductModifyAsync,
postCtWingProductProductStatusChangeAsync,
postFilesDownload,
postFilesUpload,
} from '#/api-client';
import { TableAction } from '#/components/table-action';
import { $t } from '#/locales';
import ThingModelInfoModal from '#/views/devicemanagement/thingmodelinfo/index.vue';
import ThingModelInfoModal from '#/views/thingmodelinfo/ioTPlatformThingModelInfo/index.vue';
import {
addProductFormSchema,
@ -179,7 +178,8 @@ async function submit() {
if (fileInfo && fileInfo.id) {
formValues.deviceThingModelFileId = fileInfo.id;
//
formValues.deviceThingModelFileName = fileInfo.fileName || selectedFile.name;
formValues.deviceThingModelFileName =
fileInfo.fileName || selectedFile.name;
} else {
Message.error('文件上传成功但未获取到文件ID');
userModalApi.setState({ loading: false, confirmLoading: false });
@ -336,7 +336,8 @@ function closeThingModelModal() {
<Page auto-content-height>
<Grid>
<template #toolbar-actions>
<TableAction :actions="[
<TableAction
:actions="[
{
label: $t('common.add'),
type: 'primary',
@ -344,26 +345,34 @@ function closeThingModelModal() {
onClick: openAddModal.bind(null),
auth: ['AbpIdentity.Users.Create'],
},
]" />
]"
/>
</template>
<template #isEnable="{ row }">
<component :is="h(Tag, { color: row.isEnabled ? 'green' : 'red' }, () =>
row.isEnabled ? $t('common.yes') : $t('common.no'),
<component
:is="
h(Tag, { color: row.isEnabled ? 'green' : 'red' }, () =>
row.isEnabled ? $t('common.yes') : $t('common.no'),
)
" />
"
/>
</template>
<template #deviceThingModelFileName="{ row }">
<a v-if="row.deviceThingModelFileName && row.deviceThingModelFileId" @click="onDownloadFile(row)"
style="color: #1890ff; text-decoration: underline; cursor: pointer">
<a
v-if="row.deviceThingModelFileName && row.deviceThingModelFileId"
@click="onDownloadFile(row)"
style="color: #1890ff; text-decoration: underline; cursor: pointer"
>
{{ row.deviceThingModelFileName }}
</a>
<span v-else>{{ row.deviceThingModelFileName || '-' }}</span>
</template>
<template #action="{ row }">
<TableAction :actions="[
<TableAction
:actions="[
{
label: $t('common.edit'),
type: 'link',
@ -377,18 +386,19 @@ function closeThingModelModal() {
size: 'small',
onClick: onThingModelManagement.bind(null, row),
},
{
label: row.isEnabled ? '禁用' : '启用',
type: 'link',
danger: row.isEnabled,
size: 'small',
auth: ['AbpIdentity.Users.Update'],
popConfirm: {
title: `确定要${row.isEnabled ? '禁用' : '启用'}该产品吗?`,
confirm: onStatusChange.bind(null, row),
{
label: row.isEnabled ? '禁用' : '启用',
type: 'link',
danger: row.isEnabled,
size: 'small',
auth: ['AbpIdentity.Users.Update'],
popConfirm: {
title: `确定要${row.isEnabled ? '禁用' : '启用'}该产品吗?`,
confirm: onStatusChange.bind(null, row),
},
},
},
]" :drop-down-actions="[
]"
:drop-down-actions="[
{
label: $t('common.delete'),
icon: 'ant-design:delete-outlined',
@ -399,10 +409,14 @@ function closeThingModelModal() {
confirm: onDel.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>

View File

@ -23,7 +23,7 @@ import {
import { TableAction } from '#/components/table-action';
import { $t } from '#/locales';
import ThingModelInfoModal from '#/views/devicemanagement/thingmodelinfo/index.vue';
import ThingModelInfoModal from '#/views/thingmodelinfo/ioTPlatformThingModelInfo/index.vue';
import {
addProductFormSchema,