Commit 3aa5b0f1902051d5cdb06c72c711975d967eca0a
Merge branch 'fix/DEFECT-1630' into 'main_dev'
fix: 修改看板管理里TCP网关子选择控制组件,可以选择到服务 See merge request yunteng/thingskit-front!913
Showing
2 changed files
with
11 additions
and
3 deletions
| @@ -263,6 +263,7 @@ | @@ -263,6 +263,7 @@ | ||
| 263 | class="!text-lg" | 263 | class="!text-lg" |
| 264 | icon="ant-design:form-outlined" | 264 | icon="ant-design:form-outlined" |
| 265 | @click.stop="handleUpdate(item)" | 265 | @click.stop="handleUpdate(item)" |
| 266 | + :disabled="item.name == 'default'" | ||
| 266 | /> | 267 | /> |
| 267 | </Tooltip> | 268 | </Tooltip> |
| 268 | <AuthDropDown | 269 | <AuthDropDown |
| @@ -286,7 +287,7 @@ | @@ -286,7 +287,7 @@ | ||
| 286 | onConfirm: handleDelete.bind(null, [item.id]), | 287 | onConfirm: handleDelete.bind(null, [item.id]), |
| 287 | disabled: item.default, | 288 | disabled: item.default, |
| 288 | }, | 289 | }, |
| 289 | - disabled: item.default, | 290 | + disabled: item.default || item.name == 'default', |
| 290 | }, | 291 | }, |
| 291 | ]" | 292 | ]" |
| 292 | /> | 293 | /> |
| @@ -282,7 +282,7 @@ export const commonDataSourceSchemas = (): FormSchema[] => { | @@ -282,7 +282,7 @@ export const commonDataSourceSchemas = (): FormSchema[] => { | ||
| 282 | }, | 282 | }, |
| 283 | componentProps: ({ formActionType, formModel }) => { | 283 | componentProps: ({ formActionType, formModel }) => { |
| 284 | const { setFieldsValue } = formActionType; | 284 | const { setFieldsValue } = formActionType; |
| 285 | - const { codeType } = formModel || {}; | 285 | + const { codeType, deviceType, transportType } = formModel || {}; |
| 286 | return { | 286 | return { |
| 287 | // api: findDictItemByCode, | 287 | // api: findDictItemByCode, |
| 288 | api: async (params: Recordable) => { | 288 | api: async (params: Recordable) => { |
| @@ -293,6 +293,14 @@ export const commonDataSourceSchemas = (): FormSchema[] => { | @@ -293,6 +293,14 @@ export const commonDataSourceSchemas = (): FormSchema[] => { | ||
| 293 | (item) => item.itemValue == CommandTypeEnum.ATTRIBUTE.toString() | 293 | (item) => item.itemValue == CommandTypeEnum.ATTRIBUTE.toString() |
| 294 | ); | 294 | ); |
| 295 | } | 295 | } |
| 296 | + | ||
| 297 | + // TCP网关子 --> 不能要服务命令类型 | ||
| 298 | + if (deviceType == 'SENSOR' && transportType == 'TCP') { | ||
| 299 | + return record.filter( | ||
| 300 | + (item) => item.itemValue == CommandTypeEnum.ATTRIBUTE.toString() | ||
| 301 | + ); | ||
| 302 | + } | ||
| 303 | + | ||
| 296 | if (codeType == TaskTypeEnum.MODBUS_RTU) { | 304 | if (codeType == TaskTypeEnum.MODBUS_RTU) { |
| 297 | // setFieldsValue({ [DataSourceField.COMMAND_TYPE]: undefined }); | 305 | // setFieldsValue({ [DataSourceField.COMMAND_TYPE]: undefined }); |
| 298 | return record.filter( | 306 | return record.filter( |
| @@ -304,7 +312,6 @@ export const commonDataSourceSchemas = (): FormSchema[] => { | @@ -304,7 +312,6 @@ export const commonDataSourceSchemas = (): FormSchema[] => { | ||
| 304 | ); | 312 | ); |
| 305 | } | 313 | } |
| 306 | } catch (error) { | 314 | } catch (error) { |
| 307 | - console.log(error); | ||
| 308 | return []; | 315 | return []; |
| 309 | } | 316 | } |
| 310 | }, | 317 | }, |