From b9de90424da69066d90b1065e21f06045cea32db Mon Sep 17 00:00:00 2001 From: suixy <2277317060@qq.com> Date: Wed, 15 Oct 2025 13:54:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BF=BD=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/contract/index.vue | 36 +++++++++++++++++++++--------------- vite.config.ts | 7 +++++-- 2 files changed, 26 insertions(+), 17 deletions(-) diff --git a/src/views/contract/index.vue b/src/views/contract/index.vue index ed1d757..986ad0a 100644 --- a/src/views/contract/index.vue +++ b/src/views/contract/index.vue @@ -1,6 +1,6 @@ @@ -122,10 +122,10 @@ const createContractTable = () => { }; }; const options = ref({ - document: { - title: '', - content: { - type: 'doc', + templates: [ + { + title: '合同', + description: '合同', content: [ { type: 'heading', @@ -253,6 +253,13 @@ const options = ref({ content: [{ type: 'text', text: `\t日期:\t\t\t\t\t\t\t日期:` }] } ] + } + ], + document: { + title: '', + content: { + type: 'doc', + content: [] }, placeholder: { en_US: 'Please enter the document content...', @@ -276,23 +283,22 @@ const options = ref({ } }, onSave: async (e) => { - const editor = editorRef.value; - const html = editor.getHTML(); - console.log(html); + console.log(e); + // const editor = editorRef.value; + // const html = editor.getHTML(); + // console.log(html); // const doc = new Document({ // sections: [{ children: parseHTML(editor.getHTML()) }] // }); // await download(doc); }, onChanged: async (e) => { - const editor = editorRef.value; - const json = editor.getJSON(); - console.log(json); - console.log(json.content.find((v) => v.type === 'table' && v.attrs?.id === 'contractTable')); - + // const editor = editorRef.value; + // const json = editor.getJSON(); + // console.log(json); + // console.log(json.content.find((v) => v.type === 'table' && v.attrs?.id === 'contractTable')); // json - editor.setContent(json, { emitUpdate: false }); - + // editor.setContent(json, { emitUpdate: false }); // const doc = new Document({ // sections: [{ children: prseHTML(editor.getHTML()) }] // }); diff --git a/vite.config.ts b/vite.config.ts index 50e2ccf..fe8bfc2 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,4 +1,5 @@ import { defineConfig, loadEnv } from 'vite'; +import basicSsl from '@vitejs/plugin-basic-ssl'; import createPlugins from './vite/plugins'; import autoprefixer from 'autoprefixer'; // css自动添加兼容性前缀 import path from 'path'; @@ -17,16 +18,18 @@ export default defineConfig(({ mode, command }) => { extensions: ['.mjs', '.js', '.ts', '.jsx', '.tsx', '.json', '.vue'] }, // https://cn.vitejs.dev/config/#resolve-extensions - plugins: createPlugins(env, command === 'build'), + plugins: [createPlugins(env, command === 'build'), basicSsl()], server: { host: '0.0.0.0', + https: true, port: Number(env.VITE_APP_PORT), open: true, proxy: { [env.VITE_APP_BASE_API]: { - target: 'http://localhost:8080', + target: 'https://frp-off.com:47543', changeOrigin: true, ws: true, + secure: false, rewrite: (path) => path.replace(new RegExp('^' + env.VITE_APP_BASE_API), '') } }