fix: bug#16441
This commit is contained in:
parent
69dad3807a
commit
387a37f5a4
|
@ -604,6 +604,6 @@ export const getProtocolMetadata = (id: string, transport: string) => server.get
|
|||
*/
|
||||
export const saveDeviceVirtualProperty = (productId: string, deviceId: string, data: any[]) => server.patch(`/virtual/property/product/${productId}/${deviceId}/_batch`, data)
|
||||
|
||||
export const queryDeviceVirtualProperty = (productId: string, deviceId: string, propertyId: string) => server.get(`/virtual/property/product/${productId}/${deviceId}/${propertyId}`)
|
||||
export const queryDeviceVirtualProperty = (productId: string, deviceId: string, propertyId: string) => server.get(`/virtual/property/device/${productId}/${deviceId}/${propertyId}`)
|
||||
|
||||
export const queryByParent = (deviceId: string) => server.get(`/device/gateway/${deviceId}/parent`)
|
||||
|
|
|
@ -254,25 +254,26 @@ const options = computed(() => {
|
|||
|
||||
const handleSearch = async () => {
|
||||
let resp: any = undefined;
|
||||
if (target === 'product') {
|
||||
try {
|
||||
if (target === 'product') {
|
||||
resp = await queryProductVirtualProperty(
|
||||
productStore.current?.id,
|
||||
props.value?.id,
|
||||
);
|
||||
} else {
|
||||
} else {
|
||||
resp = await queryDeviceVirtualProperty(
|
||||
instanceStore.current?.productId,
|
||||
instanceStore.current?.id,
|
||||
props.value?.id,
|
||||
);
|
||||
}
|
||||
if (resp && resp.status === 200 && resp.result) {
|
||||
}
|
||||
if (resp && resp.status === 200 && resp.result) {
|
||||
formData.virtualRule = {
|
||||
triggerProperties: resp.result.triggerProperties,
|
||||
rule: resp.result.rule,
|
||||
triggerProperties: resp.result.triggerProperties,
|
||||
rule: resp.result.rule,
|
||||
}
|
||||
} else {
|
||||
console.log(props.value)
|
||||
}
|
||||
} catch (err) {
|
||||
formData.virtualRule = {
|
||||
triggerProperties: props.value?.expands?.virtualRule?.triggerProperties || ['*'],
|
||||
rule: props.value?.expands?.virtualRule?.rule || initData.rule
|
||||
|
|
Loading…
Reference in New Issue