diff --git a/src/views/product/components/Subscription.vue b/src/views/product/components/Subscription.vue index 04dbabea..6de0e2b4 100644 --- a/src/views/product/components/Subscription.vue +++ b/src/views/product/components/Subscription.vue @@ -47,7 +47,7 @@ const schema: DescItem[] = [ type="info" show-icon class="py-4px" message="服务端订阅:服务端可以直接订阅产品下多种类型的消息,例如设备上报属性、设备上报消息、设备状态变化通知、设备生命周期变更等。配置服务端订阅后配合使用【消费组】,平台会将产品下所有设备中已订阅类型的消息进行转发。" /> - + 管理订阅 diff --git a/src/views/subscription/list/data.ts b/src/views/subscription/list/data.ts index 894f3d85..d1c7c8fe 100644 --- a/src/views/subscription/list/data.ts +++ b/src/views/subscription/list/data.ts @@ -50,24 +50,27 @@ export const columns: BasicColumn[] = [ }, ] -export const searchFormSchema: FormSchema[] = [ - { - field: 'productId', - label: '产品名称', - component: 'ApiSelect', - componentProps: { - api: getCachedProducts, - showSearch: true, - fieldNames: { - label: 'productName', - value: 'id', +export function getSearchFormSchema(productId?: string): FormSchema[] { + return [ + { + field: 'productId', + label: '产品名称', + component: 'ApiSelect', + componentProps: { + api: getCachedProducts, + showSearch: true, + fieldNames: { + label: 'productName', + value: 'id', + }, + }, + defaultValue: productId || undefined, + colProps: { + span: 6, }, }, - colProps: { - span: 6, - }, - }, -] + ] +} export function getFormSchema(isUpload: Ref): FormSchema[] { return [ diff --git a/src/views/subscription/list/index.vue b/src/views/subscription/list/index.vue index 8053239f..f8458e3e 100644 --- a/src/views/subscription/list/index.vue +++ b/src/views/subscription/list/index.vue @@ -1,6 +1,6 @@