diff --git a/src/api/system/apiPage.ts b/src/api/system/apiPage.ts index 9d0d3a8f..a827239c 100644 --- a/src/api/system/apiPage.ts +++ b/src/api/system/apiPage.ts @@ -23,4 +23,13 @@ export const addOperations_api = (data:object) => server.patch(`/application/ope /** * 删除可授权的接口ID */ -export const delOperations_api = (data:object) => server.remove(`/application/operations/_batch`,{},{data}); \ No newline at end of file +export const delOperations_api = (data:object) => server.remove(`/application/operations/_batch`,{},{data}); + +/** + * 赋权-选中/取消选中api + * @param id + * @param type + * @param data + * @returns + */ +export const updateOperations_api = (code:string,type:'_add'| '_delete', data: object) => server.post(`/application/${code}/grant/${type}`, data); diff --git a/src/views/system/Apply/Save/components/EditForm.vue b/src/views/system/Apply/Save/components/EditForm.vue index f7219994..6c6eafba 100644 --- a/src/views/system/Apply/Save/components/EditForm.vue +++ b/src/views/system/Apply/Save/components/EditForm.vue @@ -1738,7 +1738,6 @@ function changeBackUpload(info: UploadChangeParam>) { if (info.file.status === 'uploading') { form.uploadLoading = true; } else if (info.file.status === 'done') { - console.log(info); info.file.url = info.file.response?.result; form.uploadLoading = false; @@ -1749,9 +1748,6 @@ function changeBackUpload(info: UploadChangeParam>) { message.error('logo上传失败,请稍后再试'); } } -function test(...args: any[]) { - console.log('test:', args); -} function clearNullProp(obj: object) { if (typeof obj !== 'object') return; for (const prop in obj) { @@ -1799,6 +1795,17 @@ function clearNullProp(obj: object) { padding: 0 15px; box-sizing: content-box; margin-right: 20px; + color: #000; + + &.ant-radio-button-wrapper-disabled { + opacity: .5; + } + + &.ant-radio-button-wrapper-checked { + background-color: #fff; + border: 1px solid #1d39c4; + opacity: 1; + } > :last-child { width: 100%; diff --git a/src/views/system/Apply/index.vue b/src/views/system/Apply/index.vue index 84f90f5e..214ecf00 100644 --- a/src/views/system/Apply/index.vue +++ b/src/views/system/Apply/index.vue @@ -271,6 +271,8 @@ const columns = [ dataIndex: 'action', key: 'action', scopedSlots: true, + width:'200px', + fixed:'right' }, ]; const queryParams = ref({}); diff --git a/src/views/system/Platforms/Api/components/ApiDoes.vue b/src/views/system/Platforms/Api/components/ApiDoes.vue index 1bbcb09a..ebaeff99 100644 --- a/src/views/system/Platforms/Api/components/ApiDoes.vue +++ b/src/views/system/Platforms/Api/components/ApiDoes.vue @@ -148,7 +148,9 @@ const requestCard = reactive({ return (requestCard.tableData = props.selectApi.parameters); const schema = props.selectApi.requestBody.content['application/json'].schema; - const schemaName = (schema.$ref || schema.items.$ref)?.split('/').pop(); + const _ref = schema.$ref || schema?.items?.$ref; + if(!_ref) return; // schema不是Java中的类的话则不进行解析,直接结束 + const schemaName = _ref?.split('/').pop(); const type = schema.type || ''; const tableData = findData(schemaName); if (type === 'array') { diff --git a/src/views/system/Platforms/Api/components/ApiTest.vue b/src/views/system/Platforms/Api/components/ApiTest.vue index 5b1759bd..a0a38062 100644 --- a/src/views/system/Platforms/Api/components/ApiTest.vue +++ b/src/views/system/Platforms/Api/components/ApiTest.vue @@ -95,6 +95,7 @@ (); +const responsesContent = ref({}); +const editorRef = ref(); const formRef = ref(); const requestBody = reactive({ tableColumns: [ @@ -178,8 +181,16 @@ const paramsTable = computed(() => { return requestBody.params.paramsTable.slice(startIndex, endIndex); }); -const responsesContent = ref({}); -const editorRef = ref() +let schema: any = {}; +const refStr = ref(''); + +const init = () => { + if (!props.selectApi.requestBody) return; + schema = props.selectApi.requestBody.content['application/json'].schema; + refStr.value = schema.$ref || schema?.items?.$ref; +}; +init(); + const send = () => { if (paramsTable.value.length) formRef.value && @@ -210,10 +221,10 @@ const _send = () => { ...urlParams, }; server[methodObj[methodName]](url, params).then((resp: any) => { - if (Object.keys(params).length === 0){ - + // 如果用户没填写参数且有body的情况下,给用户展示请求示例 + if (Object.keys(params).length === 0 && refStr.value) { requestBody.code = JSON.stringify(getDefaultParams()); - editorRef.value?.editorFormat() + editorRef.value?.editorFormat(); } responsesContent.value = resp; }); @@ -224,9 +235,8 @@ const _send = () => { */ function getDefaultParams() { if (!props.selectApi.requestBody) return {}; - const schema = - props.selectApi.requestBody.content['application/json'].schema; - const schemaName = (schema.$ref || schema.items.$ref)?.split('/').pop(); + if (!refStr.value) return ''; // schema不是Java中的类的话则不进行解析,直接结束 + const schemaName = refStr.value?.split('/').pop() as string; const type = schema.type || ''; const tableData = findData(schemaName); if (type === 'array') { diff --git a/src/views/system/Platforms/Api/components/ChooseApi.vue b/src/views/system/Platforms/Api/components/ChooseApi.vue index fe01ba9f..be147aa1 100644 --- a/src/views/system/Platforms/Api/components/ChooseApi.vue +++ b/src/views/system/Platforms/Api/components/ChooseApi.vue @@ -11,7 +11,7 @@ @@ -25,18 +25,28 @@