diff --git a/.env.production b/.env.production
index 48b63e72af36e541c477d5402a054a634b597faf..a976772c7f8eeaab4f4a4784918887e3c0c82d3b 100644
--- a/.env.production
+++ b/.env.production
@@ -1,7 +1,7 @@
# 是否开启mock
VITE_USE_MOCK=true
# 接口地址 可以由nginx做转发或者直接写实际地址
-VITE_GLOB_API_URL=/api
+VITE_GLOB_API_URL=/basic-api
# 文件上传地址 可以由nginx做转发或者直接写实际地址
VITE_GLOB_UPLOAD_URL=/upload
# 接口地址前缀,有些系统所有接口地址都有前缀,可以在这里统一加,方便切换
@@ -13,7 +13,7 @@ VITE_PUBLIC_PATH=/
# 打包是否输出gz|br文件
# 可选: gzip | brotli | none
# 也可以有多个, 例如 ‘gzip’|'brotli',这样会同时生成 .gz和.br文件
-VITE_BUILD_COMPRESS='gzip'
+VITE_BUILD_COMPRESS='none'
# 打包是否压缩图片
VITE_USE_IMAGEMIN=false
# 打包是否开启pwa功能
diff --git a/build/vite/monaco/index.ts b/build/vite/monaco/index.ts
deleted file mode 100644
index 89af17952ae68f5fdaa14cb03c255bf777f0a841..0000000000000000000000000000000000000000
--- a/build/vite/monaco/index.ts
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * @version:
- * @Company:
- * @Description:
- * @FilePath: \build\vite\monaco\index.ts
- */
-import MonacoEditorNlsPlugin, {
- esbuildPluginMonacoEditorNls,
- Languages,
-} from 'vite-plugin-monaco-editor-nls';
-
-const prefix = `monaco-editor/esm/vs`;
-
-export default {
- optimizeDeps: {
- include: [`${prefix}/language/typescript/ts.worker`, `${prefix}/editor/editor.worker`],
- /** vite 版本需要大于等于2.3.0 */
- esbuildOptions: {
- plugins: [
- esbuildPluginMonacoEditorNls({
- locale: Languages.zh_hans,
- }),
- ],
- },
- },
- plugins: [MonacoEditorNlsPlugin({ locale: Languages.zh_hans })],
-};
diff --git a/package.json b/package.json
index b7b5a4dd57f568837eb974cfe837fd67de12e508..e464065ad515c90fb1cb053c3abec39741511e71 100644
--- a/package.json
+++ b/package.json
@@ -141,7 +141,6 @@
"vite-plugin-imagemin": "^0.6.1",
"vite-plugin-mkcert": "^1.6.0",
"vite-plugin-mock": "^2.9.6",
- "vite-plugin-monaco-editor-nls": "^1.0.8",
"vite-plugin-purge-icons": "^0.8.1",
"vite-plugin-pwa": "^0.11.13",
"vite-plugin-style-import": "^2.0.0",
diff --git a/src/components/Custom/MonacoEditor/index.vue b/src/components/Custom/MonacoEditor/index.vue
index 4e54f5a57096ec562037ccd72f6113b3294ccff4..59443ac60fedceb2efb7956546c91599c7b81657 100644
--- a/src/components/Custom/MonacoEditor/index.vue
+++ b/src/components/Custom/MonacoEditor/index.vue
@@ -44,7 +44,7 @@
},
},
setup(props, { emit }) {
- let editor,
+ let editor: any = ref(null),
__prevent_trigger_change_event = false;
let diffEditor: any = ref(null);
const monacoEditor: any = ref(null);
@@ -53,9 +53,7 @@
watch(
() => props.modelValue,
(newValue) => {
- // newValue && editor.setValue(newValue);
const model = editor.getModel();
- console.log('new', newValue !== model.getValue());
if (newValue !== model.getValue()) {
editor.pushUndoStop();
__prevent_trigger_change_event = true;
@@ -144,7 +142,7 @@
* 格式化代码
*/
editor?.getAction('editor.action.formatDocument').run();
- },200);
+ }, 200);
(window as any).MonacoEnvironment = {
getWorker(_, label) {
if (label === 'json') {
diff --git a/src/components/Custom/MonacoEditor/langs/tpl.ts b/src/components/Custom/MonacoEditor/langs/tpl.ts
index 19dc3c8a5b292c548f90ece325b6e312ff23b5c3..1b466122712cb44c187b873d35fa64a879c53e8e 100644
--- a/src/components/Custom/MonacoEditor/langs/tpl.ts
+++ b/src/components/Custom/MonacoEditor/langs/tpl.ts
@@ -169,6 +169,14 @@ const keywords = (range) =>
label: 'GoField',
detail: 'GO字段名',
},
+ {
+ label: 'TsType',
+ detail: 'TypeScript类型',
+ },
+ {
+ label: 'TsField',
+ detail: 'TypeScript字段名',
+ },
{
label: 'IsPk',
detail: '是否主键(1是)',
@@ -389,6 +397,14 @@ const keywords = (range) =>
label: 'GoField',
detail: 'GO字段名',
},
+ {
+ label: 'TsType',
+ detail: 'TypeScript类型',
+ },
+ {
+ label: 'TsField',
+ detail: 'TypeScript字段名',
+ },
{
label: 'IsPk',
detail: '是否主键(1是)',
diff --git a/src/components/registerGlobComp.ts b/src/components/registerGlobComp.ts
index a67397071e5129b4b32150dda95cc7f460eaef2c..1c52ee30603b827f5c75f8056b32c5d42fd5fd65 100644
--- a/src/components/registerGlobComp.ts
+++ b/src/components/registerGlobComp.ts
@@ -17,12 +17,5 @@ export function registerGlobComp(app: App) {
table: {},
};
VXETable.use(VXETablePluginAntd);
- app
- .use(Input)
- .use(Button)
- .use(Select)
- .use(Switch)
- .use(Layout)
- .use(hljsVuePlugin)
- .use(VXETable, VXETableSettings);
+ app.use(Input).use(Button).use(Select).use(Switch).use(Layout).use(VXETable, VXETableSettings).use(hljsVuePlugin);
}
diff --git a/src/views/tool/gen/edit/BaseInfo.vue b/src/views/tool/gen/edit/BaseInfo.vue
index fa610e8e5088eb046fc22bc1ad7305e887d69f4c..4e60142e275d35b1f778003156e7866f27b9b1f6 100644
--- a/src/views/tool/gen/edit/BaseInfo.vue
+++ b/src/views/tool/gen/edit/BaseInfo.vue
@@ -6,7 +6,7 @@
-
+
@@ -46,7 +46,7 @@
showActionButtonGroup: false,
});
//基础信息
- const [editorRegister, editorMethods] = useForm({
+ const [paramsRegister, { validate: paramsValidate, getFieldsValue: getParamsValue, setFieldsValue: setParams }] = useForm({
labelWidth: 100,
baseColProps: {
span: 10,
@@ -94,6 +94,7 @@
tableInfo.value = props.tableInfo;
await setBaseInfo(props.tableInfo.info);
await setGenInfo(props.tableInfo.info);
+ await setParams(props.tableInfo.info);
}
};
@@ -104,7 +105,10 @@
setBaseInfo,
genRegister,
genValidate,
- editorRegister,
+ paramsRegister,
+ setParams,
+ paramsValidate,
+ getParamsValue,
updateGenSchema,
removeGenSchema,
appendGenSchema,
diff --git a/src/views/tool/gen/edit/index.vue b/src/views/tool/gen/edit/index.vue
index 5156f78823c0e5af9a1ff89dfdd28953411e96a1..bc85a334111a2b1656e3cb2fa2cdc8edde5cdde3 100644
--- a/src/views/tool/gen/edit/index.vue
+++ b/src/views/tool/gen/edit/index.vue
@@ -41,7 +41,7 @@
},
setup() {
const tableRef = ref<{ getData: () => any } | null>(null);
- const baseInfoRef = ref<{ baseValidate: () => any; genValidate: () => any } | null>(null);
+ const baseInfoRef = ref<{ baseValidate: () => any; genValidate: () => any; paramsValidate: () => any; getParamsValue: () => any } | null>(null);
const tableInfo = ref({});
let { closeCurrent } = useTabs();
@@ -65,7 +65,7 @@
};
if (baseInfoRef.value) {
const [values, taskValues] = await Promise.all([baseInfoRef.value.baseValidate(), baseInfoRef.value.genValidate()]);
- tableResult = { ...tableResult, ...values, ...taskValues };
+ tableResult = { ...tableResult, ...values, ...taskValues, ...baseInfoRef.value.getParamsValue() };
}
if (tableRef.value) {
tableResult.columns = tableRef.value.getData();
diff --git a/src/views/tool/gen/modal/preview/index.vue b/src/views/tool/gen/modal/preview/index.vue
index e3b32f38e203798ce66a3fd708202ac5c279b8bb..35bc1d80e850c04a5a3a22b871bc43073ffff784 100644
--- a/src/views/tool/gen/modal/preview/index.vue
+++ b/src/views/tool/gen/modal/preview/index.vue
@@ -40,7 +40,7 @@
import { Tabs } from 'ant-design-vue';
import { BasicModal, useModalInner } from '/@/components/Modal';
import * as _API from '../../api';
- import { PreviewParams, PreviewResultModel } from '../../edit/model';
+ import { PreviewParams, PreviewResultModel } from '../../api/model';
import { useMessage } from '/@/hooks/web/useMessage';
export default defineComponent({
diff --git a/src/views/tool/tpl/modal/diff/index.vue b/src/views/tool/tpl/modal/diff/index.vue
index 37e07791fcb589ae1f657bc1fcb92a558676bf29..3f0949b306073c9d73dc1867338517efd402a182 100644
--- a/src/views/tool/tpl/modal/diff/index.vue
+++ b/src/views/tool/tpl/modal/diff/index.vue
@@ -5,7 +5,7 @@
* @FilePath: \src\views\tool\tpl\modal\diff\index.vue
-->
-
+
@@ -29,6 +29,7 @@
setModalProps({ confirmLoading: false });
});
const handleSubmit = () => {
+ nextTick(() => (visible.value = false));
closeModal();
emit('success');
};
diff --git a/src/views/tool/tpl/modal/editor/index.vue b/src/views/tool/tpl/modal/editor/index.vue
index 62452034b04c3a23115fc32b898a6138d8f2ef17..f0c5d0eaa81558f9a909f64065972be0baf8a1c8 100644
--- a/src/views/tool/tpl/modal/editor/index.vue
+++ b/src/views/tool/tpl/modal/editor/index.vue
@@ -21,7 +21,7 @@
import { getFormConfig } from './config';
import monacoEditor from '/@/components/Custom/MonacoEditor/index.vue';
import * as _API from '../../api';
- import { message, Modal } from 'ant-design-vue';
+ import { Modal } from 'ant-design-vue';
import diffModal from '../diff/index.vue';
export default defineComponent({
name: 'tplForm',
@@ -77,7 +77,7 @@
title: '提示',
content: '是否需要进行代码对比?',
okText: '确认',
- cancelText: '取消',
+ cancelText: '取消并保存',
onOk: () => {
diffModalMethods.openModal(true, { diffValue: form.value.content, modelValue: monacoEditor.value.getVal() || getFieldsValue()?.content });
},
diff --git a/vite.config.ts b/vite.config.ts
index c47997484f812861ff1b6fdc16f8f03befccbe55..8f5f4446efb5e066e8d7734a1c627d51170b68bc 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -7,7 +7,6 @@ import { generateModifyVars } from './build/generate/generateModifyVars';
import { createProxy } from './build/vite/proxy';
import { wrapperEnv } from './build/utils';
import { createVitePlugins } from './build/vite/plugin';
-import monacoVite from './build/vite/monaco';
import { OUTPUT_DIR } from './build/constant';
function pathResolve(dir: string) {
@@ -100,7 +99,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
},
// The vite plugin used by the project. The quantity is large, so it is separately extracted and managed
- plugins: createVitePlugins(viteEnv, isBuild).concat(monacoVite.plugins),
+ plugins: createVitePlugins(viteEnv, isBuild),
optimizeDeps: {
// @iconify/iconify: The dependency is dynamically and virtually loaded by @purge-icons/generated, so it needs to be specified explicitly
@@ -110,9 +109,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
'@iconify/iconify',
'ant-design-vue/es/locale/zh_CN',
'ant-design-vue/es/locale/en_US',
- ...monacoVite.optimizeDeps.include,
],
- esbuildOptions: monacoVite.optimizeDeps.esbuildOptions,
},
};
};