From c76aa923d4bf9a75ede87d54dc6ce719ee38aa5c Mon Sep 17 00:00:00 2001 From: cysamurai Date: Thu, 14 Aug 2025 14:08:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=BF=E9=97=AE=E5=AE=A2?= =?UTF-8?q?=E5=88=B6=E7=AB=99=E7=82=B9=E5=8A=9F=E8=83=BD=E6=8A=80=E6=9C=AF?= =?UTF-8?q?=E6=9E=B6=E6=9E=84=E5=89=8D=E7=9A=84=E5=AD=98=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tax-asst-client/electron.vite.config.ts | 5 + tax-asst-client/package.json | 1 + tax-asst-client/src/main/index.ts | 8 +- tax-asst-client/src/renderer/index.html | 6 +- tax-asst-client/src/renderer/src/api/api.ts | 7 + .../renderer/src/components/HomeHeader.vue | 97 ++++++- .../src/renderer/src/router/index.ts | 22 +- .../src/renderer/src/store/menus.ts | 23 ++ .../src/renderer/src/store/tabs.ts | 52 ++++ .../src/renderer/src/utils/eventBus.ts | 6 + .../src/renderer/src/views/Home..vue | 8 +- .../src/renderer/src/views/Login.vue | 2 +- .../src/renderer/src/views/Menu.vue | 252 ++++++++++-------- .../src/renderer/src/views/WebContainer.vue | 165 +++++++++++- tax-asst-client/yarn.lock | 33 +-- 15 files changed, 523 insertions(+), 164 deletions(-) create mode 100644 tax-asst-client/src/renderer/src/store/menus.ts create mode 100644 tax-asst-client/src/renderer/src/store/tabs.ts create mode 100644 tax-asst-client/src/renderer/src/utils/eventBus.ts diff --git a/tax-asst-client/electron.vite.config.ts b/tax-asst-client/electron.vite.config.ts index 7cf4aaa..900ce81 100644 --- a/tax-asst-client/electron.vite.config.ts +++ b/tax-asst-client/electron.vite.config.ts @@ -2,6 +2,9 @@ import { resolve } from 'path' import { defineConfig, externalizeDepsPlugin } from 'electron-vite' import vue from '@vitejs/plugin-vue' +// const publicDir = resolve('resources') +// const envDir = resolve('build') + export default defineConfig({ main: { plugins: [externalizeDepsPlugin()] @@ -10,6 +13,8 @@ export default defineConfig({ plugins: [externalizeDepsPlugin()] }, renderer: { + // publicDir, + // envDir, resolve: { alias: { '@renderer': resolve('src/renderer/src'), diff --git a/tax-asst-client/package.json b/tax-asst-client/package.json index e7b764a..4700a34 100644 --- a/tax-asst-client/package.json +++ b/tax-asst-client/package.json @@ -26,6 +26,7 @@ "@electron-toolkit/utils": "^3.0.0", "@vicons/ionicons5": "^0.13.0", "axios": "^1.11.0", + "mitt": "^3.0.1", "naive-ui": "^2.42.0", "pinia": "^3.0.3", "vue-router": "^4.5.1" diff --git a/tax-asst-client/src/main/index.ts b/tax-asst-client/src/main/index.ts index 20254ff..62a894d 100644 --- a/tax-asst-client/src/main/index.ts +++ b/tax-asst-client/src/main/index.ts @@ -4,6 +4,7 @@ import { electronApp, optimizer, is } from '@electron-toolkit/utils' import icon from '../../resources/icon.png?asset' function createWindow(): void { + // Create the browser window. const mainWindow = new BrowserWindow({ width: 1280, @@ -14,14 +15,17 @@ function createWindow(): void { autoHideMenuBar: true, ...(process.platform === 'linux' ? { icon } : {}), webPreferences: { - preload: join(__dirname, '../preload/index.js'), - sandbox: false + webviewTag: true, + sandbox: true, + // preload: join(__dirname, '../preload/index.js') } }) // if (is.dev) { mainWindow.webContents.openDevTools() //打开调试工具 // } + + mainWindow.webContents.setUserAgent('Mozilla/5.0 (Windows NT 10.0...) Chrome/91.0...') mainWindow.on('ready-to-show', () => { mainWindow.show() diff --git a/tax-asst-client/src/renderer/index.html b/tax-asst-client/src/renderer/index.html index e3b0ca1..9ebdbf9 100644 --- a/tax-asst-client/src/renderer/index.html +++ b/tax-asst-client/src/renderer/index.html @@ -4,10 +4,10 @@ Electron - + content="default-src 'self'; script-src 'self'; style-src 'self' 'unsafe-inline'; img-src 'self' data: http://192.168.0.117:8092 https://zjjcmspublic.oss-cn-hangzhou-zwynet-d01-a.internet.cloud.zj.gov.cn https:; frame-src 'self' https://etax.zhejiang.chinatax.gov.cn:8443 https://portal.zjzwfw.gov.cn https://www.zjzwfw.gov.cn https://etax.chinatax.gov.cn https://www.baidu.com https://chat.deepseek.com https://login.gjzwfw.gov.cn; form-action 'self' https://portal.zjzwfw.gov.cn https://login.gjzwfw.gov.cn" + /> --> diff --git a/tax-asst-client/src/renderer/src/api/api.ts b/tax-asst-client/src/renderer/src/api/api.ts index db30f50..75f0469 100644 --- a/tax-asst-client/src/renderer/src/api/api.ts +++ b/tax-asst-client/src/renderer/src/api/api.ts @@ -7,3 +7,10 @@ export function loginByJson(data) { data }) } + +export function getMenus() { + return request({ + url: '/platforms', + method: 'get' + }) +} diff --git a/tax-asst-client/src/renderer/src/components/HomeHeader.vue b/tax-asst-client/src/renderer/src/components/HomeHeader.vue index a8f5533..8622294 100644 --- a/tax-asst-client/src/renderer/src/components/HomeHeader.vue +++ b/tax-asst-client/src/renderer/src/components/HomeHeader.vue @@ -1,13 +1,41 @@ + + diff --git a/tax-asst-client/yarn.lock b/tax-asst-client/yarn.lock index 8dacd04..0a27353 100644 --- a/tax-asst-client/yarn.lock +++ b/tax-asst-client/yarn.lock @@ -2822,7 +2822,7 @@ minizlib@^2.1.1: mitt@^3.0.1: version "3.0.1" - resolved "https://registry.yarnpkg.com/mitt/-/mitt-3.0.1.tgz#ea36cf0cc30403601ae074c8f77b7092cdab36d1" + resolved "https://registry.npmmirror.com/mitt/-/mitt-3.0.1.tgz#ea36cf0cc30403601ae074c8f77b7092cdab36d1" integrity sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw== mkdirp@^1.0.3: @@ -3358,16 +3358,7 @@ stat-mode@^1.0.0: resolved "https://registry.yarnpkg.com/stat-mode/-/stat-mode-1.0.0.tgz#68b55cb61ea639ff57136f36b216a291800d1465" integrity sha512-jH9EhtKIjuXZ2cWxmXS8ZP80XyC3iasQxMDV8jzhNJpfDb7VbQLVW4Wvsxz9QZvzV+G4YoSfBUVKDOyxLzi/sg== -"string-width-cjs@npm:string-width@^4.2.0": - version "4.2.3" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" - integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== - dependencies: - emoji-regex "^8.0.0" - is-fullwidth-code-point "^3.0.0" - strip-ansi "^6.0.1" - -string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -3385,14 +3376,7 @@ string-width@^5.0.1, string-width@^5.1.2: emoji-regex "^9.2.2" strip-ansi "^7.0.1" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" - integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== - dependencies: - ansi-regex "^5.0.1" - -strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -3670,16 +3654,7 @@ word-wrap@^1.2.5: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": - version "7.0.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" - integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== - dependencies: - ansi-styles "^4.0.0" - string-width "^4.1.0" - strip-ansi "^6.0.0" - -wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==