diff --git a/electron/electron.js b/electron/electron.js index d807fa74..26f83b11 100644 --- a/electron/electron.js +++ b/electron/electron.js @@ -112,16 +112,16 @@ function createMainWindow() { }) } +/** + * @param args {path, hash, title, titleFixed, force, userAgent, config, webPreferences} + */ function createSubWindow(args) { if (!args) { return; } - if (typeof args !== "object") { - args = { - path: args, - config: {}, - } + if (!utils.isJson(args)) { + args = {path: args, config: {}} } let name = args.name || "auto_" + utils.randomString(6); @@ -134,27 +134,25 @@ function createSubWindow(args) { } } else { let config = args.config || {}; - if (typeof args.title !== "undefined") { - config.title = args.title; - } + let webPreferences = args.webPreferences || {}; browser = new BrowserWindow(Object.assign({ width: 1280, height: 800, center: true, parent: mainWindow, autoHideMenuBar: true, - webPreferences: { + webPreferences: Object.assign({ preload: path.join(__dirname, 'electron-preload.js'), - devTools: args.devTools !== false, webSecurity: true, nodeIntegration: true, nodeIntegrationInSubFrames: true, contextIsolation: true, nativeWindowOpen: true - }, + }, webPreferences), }, config)) + browser.on('page-title-updated', (event, title) => { - if (title == "index.html" || args.titleFixed === true) { + if (title == "index.html" || config.titleFixed === true) { event.preventDefault() } }) diff --git a/package.json b/package.json index 64df1013..906c3b66 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "stylus-loader": "^6.2.0", "tinymce": "^5.10.3", "tui-calendar-hi": "^1.15.1-5", - "view-design-hi": "^4.7.0-12", + "view-design-hi": "^4.7.0-15", "vue": "^2.6.14", "vue-clipboard2": "^0.3.3", "vue-emoji-picker": "^1.0.3", diff --git a/resources/assets/js/pages/manage/components/DialogView.vue b/resources/assets/js/pages/manage/components/DialogView.vue index 093d7bf8..0215fa48 100644 --- a/resources/assets/js/pages/manage/components/DialogView.vue +++ b/resources/assets/js/pages/manage/components/DialogView.vue @@ -214,12 +214,12 @@ export default { viewFile() { if (this.$Electron) { this.$Electron.sendMessage('windowRouter', { - title: `${this.msgData.msg.name} (${$A.bytesToSize(this.msgData.msg.size)})`, - titleFixed: true, name: 'file-msg-' + this.msgData.id, path: "/single/file/msg/" + this.msgData.id, force: false, config: { + title: `${this.msgData.msg.name} (${$A.bytesToSize(this.msgData.msg.size)})`, + titleFixed: true, parent: null, width: Math.min(window.screen.availWidth, 1440), height: Math.min(window.screen.availHeight, 900), diff --git a/resources/assets/js/pages/manage/components/TaskDetail.vue b/resources/assets/js/pages/manage/components/TaskDetail.vue index 1c798d3b..6c597990 100644 --- a/resources/assets/js/pages/manage/components/TaskDetail.vue +++ b/resources/assets/js/pages/manage/components/TaskDetail.vue @@ -1116,6 +1116,8 @@ export default { openNewWin() { let config = { + title: this.taskDetail.name, + titleFixed: true, parent: null, width: Math.min(window.screen.availWidth, this.$el.clientWidth + 72), height: Math.min(window.screen.availHeight, this.$el.clientHeight + 72), @@ -1127,8 +1129,6 @@ export default { config.minHeight = 600; } this.$Electron.sendMessage('windowRouter', { - title: this.taskDetail.name, - titleFixed: true, name: 'task-' + this.taskDetail.id, path: "/single/task/" + this.taskDetail.id, force: false, @@ -1162,12 +1162,12 @@ export default { viewFile(file) { if (this.$Electron) { this.$Electron.sendMessage('windowRouter', { - title: `${file.name} (${$A.bytesToSize(file.size)})`, - titleFixed: true, name: 'file-task-' + file.id, path: "/single/file/task/" + file.id, force: false, config: { + title: `${file.name} (${$A.bytesToSize(file.size)})`, + titleFixed: true, parent: null, width: Math.min(window.screen.availWidth, 1440), height: Math.min(window.screen.availHeight, 900), diff --git a/resources/assets/js/pages/manage/file.vue b/resources/assets/js/pages/manage/file.vue index cab0a3ba..4e6af675 100644 --- a/resources/assets/js/pages/manage/file.vue +++ b/resources/assets/js/pages/manage/file.vue @@ -855,13 +855,13 @@ export default { openSingle(item) { this.$Electron.sendMessage('windowRouter', { - title: this.formatName(item), - titleFixed: true, - userAgent: "/hideenOfficeTitle/", name: 'file-' + item.id, path: "/single/file/" + item.id, + userAgent: "/hideenOfficeTitle/", force: false, // 如果窗口已存在不重新加载 config: { + title: this.formatName(item), + titleFixed: true, parent: null, width: Math.min(window.screen.availWidth, 1440), height: Math.min(window.screen.availHeight, 900), diff --git a/resources/assets/sass/pages/components/project-list.scss b/resources/assets/sass/pages/components/project-list.scss index 6526c89b..e261cdf6 100644 --- a/resources/assets/sass/pages/components/project-list.scss +++ b/resources/assets/sass/pages/components/project-list.scss @@ -597,8 +597,7 @@ .project-table { height: 100%; margin-top: 18px; - overflow-x: hidden; - overflow-y: auto; + overflow: auto; .task-row { background-color: #ffffff; border-bottom: 1px solid #F4F4F5; @@ -631,6 +630,7 @@ } .project-table-head, .project-table-body { + min-width: 800px; margin: 0 32px 12px; border-radius: 5px; border: 1px solid #F4F4F5;