Showing
1 changed file
with
14 additions
and
20 deletions
| ... | ... | @@ -45,6 +45,7 @@ |
| 45 | 45 | updateDataViewInterface, |
| 46 | 46 | } from '/@/api/bigscreen/center/bigscreenCenter'; |
| 47 | 47 | import { useMessage } from '/@/hooks/web/useMessage'; |
| 48 | + import { findDictItemByCode } from '/@/api/system/dict'; | |
| 48 | 49 | |
| 49 | 50 | const emits = defineEmits(['success', 'register']); |
| 50 | 51 | |
| ... | ... | @@ -87,26 +88,19 @@ |
| 87 | 88 | simpleRequestRef.value?.setValue(data.record); |
| 88 | 89 | }, 200) |
| 89 | 90 | ); |
| 90 | - const opt = [ | |
| 91 | - { label: 'get', value: 'GET' }, | |
| 92 | - { label: 'post', value: 'POST' }, | |
| 93 | - { label: 'put', value: 'PUT' }, | |
| 94 | - ]; | |
| 95 | - if (data.record?.requestContentType === 1) { | |
| 96 | - updateSchema({ | |
| 97 | - field: 'requestHttpType', | |
| 98 | - componentProps: { | |
| 99 | - options: opt.slice(-2), | |
| 100 | - }, | |
| 101 | - }); | |
| 102 | - } else { | |
| 103 | - updateSchema({ | |
| 104 | - field: 'requestHttpType', | |
| 105 | - componentProps: { | |
| 106 | - options: opt, | |
| 107 | - }, | |
| 108 | - }); | |
| 109 | - } | |
| 91 | + const res = await findDictItemByCode({ | |
| 92 | + dictCode: | |
| 93 | + data.record?.requestContentType === 1 | |
| 94 | + ? 'dataview_select_sql_request' | |
| 95 | + : 'dataview_select_request', | |
| 96 | + }); | |
| 97 | + const options = res.map((m) => ({ label: m.itemText, value: m.itemValue })); | |
| 98 | + updateSchema({ | |
| 99 | + field: 'requestHttpType', | |
| 100 | + componentProps: { | |
| 101 | + options, | |
| 102 | + }, | |
| 103 | + }); | |
| 110 | 104 | } |
| 111 | 105 | setDrawerProps({ loading: false }); |
| 112 | 106 | }); | ... | ... |