Commit 9527b942ddf39e26c1e3f9a35a0e25e4580ff966

Authored by fengwotao
1 parent 53dbbcf3

feat:pc端新增公共接口管理

@@ -45,6 +45,7 @@ @@ -45,6 +45,7 @@
45 updateDataViewInterface, 45 updateDataViewInterface,
46 } from '/@/api/bigscreen/center/bigscreenCenter'; 46 } from '/@/api/bigscreen/center/bigscreenCenter';
47 import { useMessage } from '/@/hooks/web/useMessage'; 47 import { useMessage } from '/@/hooks/web/useMessage';
  48 + import { findDictItemByCode } from '/@/api/system/dict';
48 49
49 const emits = defineEmits(['success', 'register']); 50 const emits = defineEmits(['success', 'register']);
50 51
@@ -87,26 +88,19 @@ @@ -87,26 +88,19 @@
87 simpleRequestRef.value?.setValue(data.record); 88 simpleRequestRef.value?.setValue(data.record);
88 }, 200) 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 setDrawerProps({ loading: false }); 105 setDrawerProps({ loading: false });
112 }); 106 });