Commit 2ac743be7a9197c5020d928ae3b8384651905983
Merge branch 'ww' into 'main'
fix: 修复数据流转RabbitMQ ClientProperties字段为空时,需要保存为空对象 See merge request yunteng/thingskit-front!501
Showing
3 changed files
with
13 additions
and
4 deletions
| ... | ... | @@ -14,7 +14,7 @@ VITE_GLOB_PUBLIC_PATH = / |
| 14 | 14 | # VITE_PROXY = [["/api","http://101.133.234.90:8080/api"]] |
| 15 | 15 | # 线上测试环境 |
| 16 | 16 | # VITE_PROXY = [["/api","http://localhost:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] |
| 17 | -VITE_PROXY = [["/api","http://222.180.200.114:48080/api"],["/thingskit-drawio","http://localhost:3000/"]] | |
| 17 | +VITE_PROXY = [["/api","http://222.180.200.114:48080/api"],["/thingskit-drawio","http://localhost:3000/"],["/large-designer", "http://localhost:5555/large-designer/"]] | |
| 18 | 18 | # VITE_PROXY = [["/api","http://121.37.251.8:8080/api"],["/thingskit-drawio","http://localhost:3000/"]] |
| 19 | 19 | # VITE_PROXY = [["/api","http://192.168.10.103:8080/api"],["/thingskit-drawio","http://192.168.10.136:8080/api"]] |
| 20 | 20 | ... | ... |
| ... | ... | @@ -259,6 +259,12 @@ |
| 259 | 259 | delete allPostForm.id; |
| 260 | 260 | } |
| 261 | 261 | }; |
| 262 | + const setClientProperties = (record: Recordable) => { | |
| 263 | + const configuration = Reflect.get(record, 'configuration'); | |
| 264 | + const clientProperties = Reflect.get(configuration, 'clientProperties'); | |
| 265 | + !clientProperties && record.configuration && (record.configuration.clientProperties = {}); | |
| 266 | + }; | |
| 267 | + | |
| 262 | 268 | const handleSubmit = async (closeModalAfterSuccess = true) => { |
| 263 | 269 | try { |
| 264 | 270 | closeModalAfterSuccess && setModalProps({ confirmLoading: true }); |
| ... | ... | @@ -278,7 +284,7 @@ |
| 278 | 284 | if (isApiHeaders && Object.values(isApiHeaders).includes('')) { |
| 279 | 285 | return createMessage.error('请填写属性'); |
| 280 | 286 | } |
| 281 | - Object.assign(allPostForm, { clientProperties: {} }); | |
| 287 | + setClientProperties(allPostForm); | |
| 282 | 288 | const res = await postAddConvertApi(allPostForm); |
| 283 | 289 | if (res) { |
| 284 | 290 | closeModalAfterSuccess && closeModal(); |
| ... | ... | @@ -304,10 +310,11 @@ |
| 304 | 310 | } |
| 305 | 311 | } |
| 306 | 312 | Object.assign(noEditObj, getTypeObj, { |
| 307 | - clientProperties: {}, | |
| 308 | 313 | datasourceType: allPostForm.datasourceType, |
| 309 | 314 | datasourceContent: allPostForm.datasourceContent, |
| 310 | 315 | }); |
| 316 | + setClientProperties(allPostForm); | |
| 317 | + setClientProperties(noEditObj); | |
| 311 | 318 | const res = await postAddConvertApi(isEdit.value ? noEditObj : allPostForm); |
| 312 | 319 | if (res) { |
| 313 | 320 | closeModalAfterSuccess && closeModal(); | ... | ... |
| ... | ... | @@ -587,7 +587,9 @@ export const actionSchema: FormSchema[] = [ |
| 587 | 587 | placeholder: '请选择服务', |
| 588 | 588 | api: async (params: Recordable) => { |
| 589 | 589 | try { |
| 590 | - const record = await getModelServices(params as Record<'deviceProfileId', string>); | |
| 590 | + if (!Reflect.get(params, 'deviceProfileId')) return []; | |
| 591 | + const record = | |
| 592 | + (await getModelServices(params as Record<'deviceProfileId', string>)) || []; | |
| 591 | 593 | const selected = record.find((item) => item.id === thingsModelId); |
| 592 | 594 | selected && |
| 593 | 595 | updateSchema({ | ... | ... |