From b07cc9861959bb4c2f67eece49e922ca815f1a4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E5=BB=BA?= <1348660141@qq.com> Date: Wed, 21 Jun 2023 13:22:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=91=BD=E5=90=8D=E7=BB=9F?= =?UTF-8?q?=E4=B8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/infra/config/index.ts | 19 +++++++++++++------ src/views/infra/build/index.vue | 6 ++---- src/views/infra/config/index.vue | 13 ++++++------- src/views/infra/druid/index.vue | 2 +- src/views/infra/server/index.vue | 2 +- src/views/infra/skywalking/index.vue | 2 +- src/views/infra/swagger/index.vue | 2 +- 7 files changed, 25 insertions(+), 21 deletions(-) diff --git a/src/api/infra/config/index.ts b/src/api/infra/config/index.ts index c6d3772e..ca7294fd 100644 --- a/src/api/infra/config/index.ts +++ b/src/api/infra/config/index.ts @@ -12,6 +12,13 @@ export interface ConfigVO { createTime: Date } +export interface ConfigPageReqVO extends PageParam { + name?: string + key?: string + type?: number + createTime?: Date[] +} + export interface ConfigExportReqVO { name?: string key?: string @@ -20,32 +27,32 @@ export interface ConfigExportReqVO { } // 查询参数列表 -export const getConfigPage = (params: PageParam) => { +export const getConfigPageApi = (params: ConfigPageReqVO) => { return request.get({ url: '/infra/config/page', params }) } // 查询参数详情 -export const getConfig = (id: number) => { +export const getConfigApi = (id: number) => { return request.get({ url: '/infra/config/get?id=' + id }) } // 根据参数键名查询参数值 -export const getConfigKey = (configKey: string) => { +export const getConfigKeyApi = (configKey: string) => { return request.get({ url: '/infra/config/get-value-by-key?key=' + configKey }) } // 新增参数 -export const createConfig = (data: ConfigVO) => { +export const createConfigApi = (data: ConfigVO) => { return request.post({ url: '/infra/config/create', data }) } // 修改参数 -export const updateConfig = (data: ConfigVO) => { +export const updateConfigApi = (data: ConfigVO) => { return request.put({ url: '/infra/config/update', data }) } // 删除参数 -export const deleteConfig = (id: number) => { +export const deleteConfigApi = (id: number) => { return request.delete({ url: '/infra/config/delete?id=' + id }) } diff --git a/src/views/infra/build/index.vue b/src/views/infra/build/index.vue index 1d81e095..fc118b9c 100644 --- a/src/views/infra/build/index.vue +++ b/src/views/infra/build/index.vue @@ -20,9 +20,7 @@
- - {{ t('common.copy') }} - +
@@ -35,7 +33,7 @@ import FcDesigner from '@form-create/designer' // import { useClipboard } from '@vueuse/core' import { isString } from '@/utils/is' - +import formCreate from '@form-create/element-ui' import hljs from 'highlight.js' // 导入代码高亮文件 import 'highlight.js/styles/github.css' // 导入代码高亮样式 import xml from 'highlight.js/lib/languages/java' diff --git a/src/views/infra/config/index.vue b/src/views/infra/config/index.vue index ddf9eeba..6ecbfa5e 100644 --- a/src/views/infra/config/index.vue +++ b/src/views/infra/config/index.vue @@ -93,8 +93,8 @@ const message = useMessage() // 消息弹窗 // 列表相关的变量 const [registerTable, { reload, deleteData, exportList }] = useXTable({ allSchemas: allSchemas, - getListApi: ConfigApi.getConfigPage, - deleteApi: ConfigApi.deleteConfig, + getListApi: ConfigApi.getConfigPageApi, + deleteApi: ConfigApi.deleteConfigApi, exportListApi: ConfigApi.exportConfigApi }) @@ -117,7 +117,6 @@ const setDialogTile = (type: string) => { const handleCreate = async () => { setDialogTile('create') await nextTick() - console.log(allSchemas.formSchema, 'allSchemas.formSchema') if (allSchemas.formSchema[2].field !== 'key') { unref(formRef)?.addSchema( { @@ -134,7 +133,7 @@ const handleCreate = async () => { const handleUpdate = async (rowId: number) => { setDialogTile('update') // 设置数据 - const res = await ConfigApi.getConfig(rowId) + const res = await ConfigApi.getConfigApi(rowId) unref(formRef)?.delSchema('key') unref(formRef)?.setValues(res) } @@ -142,7 +141,7 @@ const handleUpdate = async (rowId: number) => { // 详情操作 const handleDetail = async (rowId: number) => { setDialogTile('detail') - const res = await ConfigApi.getConfig(rowId) + const res = await ConfigApi.getConfigApi(rowId) detailData.value = res } @@ -157,10 +156,10 @@ const submitForm = async () => { try { const data = unref(formRef)?.formModel as ConfigApi.ConfigVO if (actionType.value === 'create') { - await ConfigApi.createConfig(data) + await ConfigApi.createConfigApi(data) message.success(t('common.createSuccess')) } else { - await ConfigApi.updateConfig(data) + await ConfigApi.updateConfigApi(data) message.success(t('common.updateSuccess')) } dialogVisible.value = false diff --git a/src/views/infra/druid/index.vue b/src/views/infra/druid/index.vue index 76be557b..35cd0c6a 100644 --- a/src/views/infra/druid/index.vue +++ b/src/views/infra/druid/index.vue @@ -12,7 +12,7 @@ const url = ref(import.meta.env.VITE_BASE_URL + '/druid/index.html') /** 初始化 */ onMounted(async () => { try { - const data = await ConfigApi.getConfigKey('url.druid') + const data = await ConfigApi.getConfigKeyApi('url.druid') if (data && data.length > 0) { url.value = data } diff --git a/src/views/infra/server/index.vue b/src/views/infra/server/index.vue index 009f91d1..983dcd95 100644 --- a/src/views/infra/server/index.vue +++ b/src/views/infra/server/index.vue @@ -12,7 +12,7 @@ const src = ref(import.meta.env.VITE_BASE_URL + '/admin/applications') /** 初始化 */ onMounted(async () => { try { - const data = await ConfigApi.getConfigKey('url.spring-boot-admin') + const data = await ConfigApi.getConfigKeyApi('url.spring-boot-admin') if (data && data.length > 0) { src.value = data } diff --git a/src/views/infra/skywalking/index.vue b/src/views/infra/skywalking/index.vue index ef72deee..6e86520f 100644 --- a/src/views/infra/skywalking/index.vue +++ b/src/views/infra/skywalking/index.vue @@ -12,7 +12,7 @@ const src = ref('http://skywalking.shop.iocoder.cn') /** 初始化 */ onMounted(async () => { try { - const data = await ConfigApi.getConfigKey('url.skywalking') + const data = await ConfigApi.getConfigKeyApi('url.skywalking') if (data && data.length > 0) { src.value = data } diff --git a/src/views/infra/swagger/index.vue b/src/views/infra/swagger/index.vue index ba23155e..32664ff7 100644 --- a/src/views/infra/swagger/index.vue +++ b/src/views/infra/swagger/index.vue @@ -13,7 +13,7 @@ const src = ref(import.meta.env.VITE_BASE_URL + '/doc.html') // Knife4j UI /** 初始化 */ onMounted(async () => { try { - const data = await ConfigApi.getConfigKey('url.swagger') + const data = await ConfigApi.getConfigKeyApi('url.swagger') if (data && data.length > 0) { src.value = data }