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 | 263 | class="!text-lg" |
| 264 | 264 | icon="ant-design:form-outlined" |
| 265 | 265 | @click.stop="handleUpdate(item)" |
| 266 | + :disabled="item.name == 'default'" | |
| 266 | 267 | /> |
| 267 | 268 | </Tooltip> |
| 268 | 269 | <AuthDropDown |
| ... | ... | @@ -286,7 +287,7 @@ |
| 286 | 287 | onConfirm: handleDelete.bind(null, [item.id]), |
| 287 | 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 | 282 | }, |
| 283 | 283 | componentProps: ({ formActionType, formModel }) => { |
| 284 | 284 | const { setFieldsValue } = formActionType; |
| 285 | - const { codeType } = formModel || {}; | |
| 285 | + const { codeType, deviceType, transportType } = formModel || {}; | |
| 286 | 286 | return { |
| 287 | 287 | // api: findDictItemByCode, |
| 288 | 288 | api: async (params: Recordable) => { |
| ... | ... | @@ -293,6 +293,14 @@ export const commonDataSourceSchemas = (): FormSchema[] => { |
| 293 | 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 | 304 | if (codeType == TaskTypeEnum.MODBUS_RTU) { |
| 297 | 305 | // setFieldsValue({ [DataSourceField.COMMAND_TYPE]: undefined }); |
| 298 | 306 | return record.filter( |
| ... | ... | @@ -304,7 +312,6 @@ export const commonDataSourceSchemas = (): FormSchema[] => { |
| 304 | 312 | ); |
| 305 | 313 | } |
| 306 | 314 | } catch (error) { |
| 307 | - console.log(error); | |
| 308 | 315 | return []; |
| 309 | 316 | } |
| 310 | 317 | }, | ... | ... |