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 @@
+
+
+
+
\ No newline at end of file
+
diff --git a/tax-asst-client/src/renderer/src/router/index.ts b/tax-asst-client/src/renderer/src/router/index.ts
index e3ebc5c..67a5010 100644
--- a/tax-asst-client/src/renderer/src/router/index.ts
+++ b/tax-asst-client/src/renderer/src/router/index.ts
@@ -8,9 +8,23 @@ export default createRouter({
history: createWebHashHistory(),
routes: [
{ path: '/', component: Login },
- { path: '/home', component: Home, children:[
- { path: 'menu', component: Menu },
- { path:'webContainer', component: WebContainer}
- ] }
+ {
+ path: '/home', component: Home, children: [
+ {
+ path: 'menu',
+ component: Menu,
+ meta: {
+ KeepAlive: true
+ }
+ },
+ {
+ path: 'webContainer',
+ component: WebContainer,
+ meta: {
+ KeepAlive: true
+ }
+ }
+ ]
+ }
]
})
diff --git a/tax-asst-client/src/renderer/src/store/menus.ts b/tax-asst-client/src/renderer/src/store/menus.ts
new file mode 100644
index 0000000..bee9501
--- /dev/null
+++ b/tax-asst-client/src/renderer/src/store/menus.ts
@@ -0,0 +1,23 @@
+import { defineStore } from 'pinia'
+import { getMenus } from '@renderer/api/api'
+
+export const useMenusStore = defineStore('Menus', {
+ state: () => {
+ return {
+ menus: []
+ }
+ },
+ getters: {},
+ actions: {
+ async getMenusAction() {
+ let res = await getMenus()
+ // console.log(res.data)
+ this.menus = res.data.data.slice(0, res.data.data.length)
+ },
+ getMenusDebug(items) {
+ // let res = getMenus()
+ // console.log(res.data)
+ this.menus = items.slice(0, items.length)
+ }
+ }
+})
diff --git a/tax-asst-client/src/renderer/src/store/tabs.ts b/tax-asst-client/src/renderer/src/store/tabs.ts
new file mode 100644
index 0000000..f73ac8e
--- /dev/null
+++ b/tax-asst-client/src/renderer/src/store/tabs.ts
@@ -0,0 +1,52 @@
+import { defineStore } from 'pinia'
+
+interface Tab {
+ id: string
+ url: string
+ title: string
+ active: boolean
+}
+
+export const useTabsStore = defineStore('tabs', {
+ state: () => ({
+ tabs: [] as Tab[],
+ currentTabId: null as string | null
+ }),
+ actions: {
+ addTab(item: { platformUrl: string; platformName: string }) {
+ const existingTab = this.tabs.find(tab => tab.url === item.platformUrl)
+
+ if (existingTab) {
+ this.currentTabId = existingTab.id
+ return existingTab.id
+ }
+
+ const newTab = {
+ id: Date.now().toString(),
+ url: item.platformUrl,
+ title: item.platformName,
+ active: true
+ }
+
+ this.tabs.forEach(tab => tab.active = false)
+ this.tabs.push(newTab)
+ this.currentTabId = newTab.id
+ return newTab.id
+ },
+ setActiveTab(tabId: string) {
+ this.tabs.forEach(tab => {
+ tab.active = tab.id === tabId
+ })
+ this.currentTabId = tabId
+ },
+ closeTab(tabId: string) {
+ this.tabs = this.tabs.filter(tab => tab.id !== tabId)
+ if (this.currentTabId === tabId) {
+ this.currentTabId = this.tabs[0]?.id || null
+ }
+ }
+ },
+ getters: {
+ activeTab: (state) => state.tabs.find(tab => tab.id === state.currentTabId)
+ }
+})
diff --git a/tax-asst-client/src/renderer/src/utils/eventBus.ts b/tax-asst-client/src/renderer/src/utils/eventBus.ts
new file mode 100644
index 0000000..efbd676
--- /dev/null
+++ b/tax-asst-client/src/renderer/src/utils/eventBus.ts
@@ -0,0 +1,6 @@
+// event-bus.js
+import mitt from 'mitt'
+
+const emitter = mitt()
+
+export default emitter
\ No newline at end of file
diff --git a/tax-asst-client/src/renderer/src/views/Home..vue b/tax-asst-client/src/renderer/src/views/Home..vue
index d185aa9..aa9ca3f 100644
--- a/tax-asst-client/src/renderer/src/views/Home..vue
+++ b/tax-asst-client/src/renderer/src/views/Home..vue
@@ -6,12 +6,16 @@ import HomeHeader from '@renderer/components/HomeHeader.vue';
-
+
+
+
+
+
diff --git a/tax-asst-client/src/renderer/src/views/WebContainer.vue b/tax-asst-client/src/renderer/src/views/WebContainer.vue
index 6b48855..b365b33 100644
--- a/tax-asst-client/src/renderer/src/views/WebContainer.vue
+++ b/tax-asst-client/src/renderer/src/views/WebContainer.vue
@@ -1,7 +1,168 @@
- WebContainer
-
\ No newline at end of file
+
+
+
+ {{ tab.title }}
+
+
+
+
+
+
+
+
+
+
+
+
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==