From 600b32d52629edda8c340788a4cae7db0c6a42d4 Mon Sep 17 00:00:00 2001 From: mjh <741600436@qq.com> Date: Wed, 11 May 2022 12:03:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=A7=92=E8=89=B2=EF=BC=8C=E4=BF=AE=E5=A4=8D=E7=BA=BF=E4=B8=8A?= =?UTF-8?q?=E5=A4=B4=E5=83=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ mock/sys/user.ts | 5 +++-- src/views/sys/login/LoginForm.vue | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 81d3255..63bd044 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,8 @@ node_modules dist .npmrc .cache +.env.production +mock/sys/user tests/server/static tests/server/static/upload diff --git a/mock/sys/user.ts b/mock/sys/user.ts index 35bf3ea..5c12b59 100644 --- a/mock/sys/user.ts +++ b/mock/sys/user.ts @@ -7,7 +7,7 @@ export function createFakeUserList() { userId: '1', username: 'gen', realName: 'Gen Admin', - avatar: '/resource/img/avatar.png', + avatar: 'resource/img/avatar.png', desc: 'manager', password: '123456', token: 'fakeToken1', @@ -24,7 +24,8 @@ export function createFakeUserList() { username: 'test', password: '123456', realName: 'test user', - avatar: 'https://q1.qlogo.cn/g?b=qq&nk=339449197&s=640', + avatar: 'resource/img/avatar.png', + // avatar: 'https://q1.qlogo.cn/g?b=qq&nk=339449197&s=640', desc: 'tester', token: 'fakeToken2', homePath: '/dashboard/workbench', diff --git a/src/views/sys/login/LoginForm.vue b/src/views/sys/login/LoginForm.vue index fa88561..8fd1b0d 100644 --- a/src/views/sys/login/LoginForm.vue +++ b/src/views/sys/login/LoginForm.vue @@ -119,7 +119,7 @@ const rememberMe = ref(false); const formData = reactive({ - account: 'gen', + account: 'test', password: '123456', }); -- Gitee From 26c8c2875145da31c0a5148e69c0dd23e665f320 Mon Sep 17 00:00:00 2001 From: mjh <741600436@qq.com> Date: Wed, 11 May 2022 12:57:06 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0.eslintignore?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 .env.production diff --git a/.env.production b/.env.production deleted file mode 100644 index ee94de1..0000000 --- a/.env.production +++ /dev/null @@ -1,24 +0,0 @@ -# 是否开启mock -VITE_USE_MOCK=true -# 接口地址 可以由nginx做转发或者直接写实际地址 -VITE_GLOB_API_URL=/basic-api -# 文件上传地址 可以由nginx做转发或者直接写实际地址 -VITE_GLOB_UPLOAD_URL=/upload -# 接口地址前缀,有些系统所有接口地址都有前缀,可以在这里统一加,方便切换 -VITE_GLOB_API_URL_PREFIX= -# 是否删除Console.log -VITE_DROP_CONSOLE=false -# 资源公共路径,需要以 / 开头和结尾 -VITE_PUBLIC_PATH=/ -# 打包是否输出gz|br文件 -# 可选: gzip | brotli | none -# 也可以有多个, 例如 ‘gzip’|'brotli',这样会同时生成 .gz和.br文件 -VITE_BUILD_COMPRESS='none' -# 打包是否压缩图片 -VITE_USE_IMAGEMIN=false -# 打包是否开启pwa功能 -VITE_USE_PWA=false -# 是否兼容旧版浏览器。开启后打包时间会慢一倍左右。会多打出旧浏览器兼容包,且会根据浏览器兼容性自动使用相应的版本 -VITE_LEGACY=false - -VITE_GLOB_GEN_TABLE_URL=http://localhost:8199 -- Gitee From c5ec58c2baac12367e9123a8e431a7b3830c9e8b Mon Sep 17 00:00:00 2001 From: mjh <741600436@qq.com> Date: Thu, 12 May 2022 00:36:43 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=BA=90>=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E6=B5=8B=E8=AF=95=E8=BF=9E=E6=8E=A5,=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=83=A8=E5=88=86=E5=B7=B2=E7=9F=A5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/tool/datasource/api/index.ts | 34 +++++++++++++++++-- src/views/tool/datasource/config.ts | 19 +++++++---- src/views/tool/datasource/index.vue | 11 ++++--- src/views/tool/datasource/modal.vue | 40 ++++++++++++++++++----- src/views/tool/gen/edit/config.ts | 8 ++--- src/views/tool/tpl/modal/editor/index.vue | 10 +++--- 6 files changed, 91 insertions(+), 31 deletions(-) diff --git a/src/views/tool/datasource/api/index.ts b/src/views/tool/datasource/api/index.ts index ff078cc..4d8a318 100644 --- a/src/views/tool/datasource/api/index.ts +++ b/src/views/tool/datasource/api/index.ts @@ -54,11 +54,27 @@ export function addAPI(params: itemInter) { }, { apiUrl: genTableUrl, - successMessageMode:"message", + successMessageMode: 'message', + }, + ); +} +/** + * @vuese + * @Description: 编辑 + * @arg {any} params + */ +export function editAPI(params: any) { + return defHttp.put( + { + url: `/tool/db`, + params, + }, + { + apiUrl: genTableUrl, + successMessageMode: 'message', }, ); } - export function delAPI(params: delParamsInter) { return defHttp.delete( { @@ -68,7 +84,19 @@ export function delAPI(params: delParamsInter) { { apiUrl: genTableUrl, isReturnNativeResponse: true, - successMessageMode:"message", + successMessageMode: 'message', + }, + ); +} +export function testAPI(params: itemInter) { + return defHttp.post( + { + url: '/tool/db/test', + params, + }, + { + apiUrl: genTableUrl, + isReturnNativeResponse: true, }, ); } diff --git a/src/views/tool/datasource/config.ts b/src/views/tool/datasource/config.ts index 5732063..229e2fa 100644 --- a/src/views/tool/datasource/config.ts +++ b/src/views/tool/datasource/config.ts @@ -1,5 +1,5 @@ -import {FormProps, FormSchema} from '/@/components/Table'; -import {BasicColumn} from '/@/components/Table/src/types/table'; +import { FormProps, FormSchema } from '/@/components/Table'; +import { BasicColumn } from '/@/components/Table/src/types/table'; export function getBasicColumns(): BasicColumn[] { return [ @@ -44,7 +44,6 @@ export function getBasicColumns(): BasicColumn[] { ]; } - export function getFormConfig(): Partial { return { labelWidth: 100, @@ -73,6 +72,12 @@ export function getFormConfig(): Partial { export function formSchema(isUpdate: boolean): FormSchema[] { return [ + { + field: 'id', + label: 'id', + component: 'Input', + ifShow: false, + }, { field: 'group', label: '分组', @@ -135,10 +140,10 @@ export function formSchema(isUpdate: boolean): FormSchema[] { defaultValue: 'mysql', componentProps: { options: [ - {label: 'mysql', value: 'mysql'}, - {label: 'oracle', value: 'oracle'}, - {label: 'pgsql', value: 'pgsql'}, - {label: 'mssql', value: 'mssql'}, + { label: 'mysql', value: 'mysql' }, + { label: 'oracle', value: 'oracle' }, + { label: 'pgsql', value: 'pgsql' }, + { label: 'mssql', value: 'mssql' }, ], }, colProps: { diff --git a/src/views/tool/datasource/index.vue b/src/views/tool/datasource/index.vue index 1696e80..b24685f 100644 --- a/src/views/tool/datasource/index.vue +++ b/src/views/tool/datasource/index.vue @@ -6,16 +6,17 @@ diff --git a/src/views/tool/gen/edit/config.ts b/src/views/tool/gen/edit/config.ts index 1db7712..3149dfa 100644 --- a/src/views/tool/gen/edit/config.ts +++ b/src/views/tool/gen/edit/config.ts @@ -138,19 +138,19 @@ export function getFormConfig(type: string, params?: { treeOptions: any; tableIn field: 'systemName', component: 'Input', label: '生成系统名', - required: true, + required: false, }, { field: 'packageName', component: 'Input', label: '生成包路径', - required: true, + required: false, }, { field: 'moduleName', component: 'Input', label: '生成模块名', - required: true, + required: false, }, { field: 'businessName', @@ -278,7 +278,7 @@ export function getFormConfig(type: string, params?: { treeOptions: any; tableIn field: 'functionAuthor', component: 'Input', label: '作者', - required: true, + required: false, }, { field: 'remark', diff --git a/src/views/tool/tpl/modal/editor/index.vue b/src/views/tool/tpl/modal/editor/index.vue index f0c5d0e..f6672ec 100644 --- a/src/views/tool/tpl/modal/editor/index.vue +++ b/src/views/tool/tpl/modal/editor/index.vue @@ -5,12 +5,15 @@ * @FilePath: \src\views\tool\tpl\modal\editor\index.vue --> @@ -21,7 +24,7 @@ import { getFormConfig } from './config'; import monacoEditor from '/@/components/Custom/MonacoEditor/index.vue'; import * as _API from '../../api'; - import { Modal } from 'ant-design-vue'; + import { Modal } from 'ant-design-vue'; import diffModal from '../diff/index.vue'; export default defineComponent({ name: 'tplForm', @@ -69,8 +72,7 @@ } closeModal(); emit('success'); - } catch { - } + } catch {} }; const handleSubmit = () => { Modal.confirm({ -- Gitee