From 41faf72c37d87f7390ad4c8cdb1b6c0865588fee Mon Sep 17 00:00:00 2001 From: kuaifan Date: Wed, 18 May 2022 13:09:41 +0800 Subject: [PATCH] no message --- README_PUBLISH.md | 6 +++ electron/build.js | 1 + resources/assets/js/App.vue | 3 -- resources/assets/js/functions/common.js | 45 ++++++++-------- .../js/pages/manage/components/DialogView.vue | 8 +-- .../pages/manage/components/FileHistory.vue | 8 +-- .../js/pages/manage/components/TaskDetail.vue | 10 ++-- resources/assets/js/pages/token.vue | 54 +++++++++++++++++++ resources/assets/js/routes.js | 5 ++ resources/assets/js/store/actions.js | 20 ++++--- .../sass/pages/components/task-add.scss | 31 ++++++++++- 11 files changed, 149 insertions(+), 42 deletions(-) create mode 100644 resources/assets/js/pages/token.vue diff --git a/README_PUBLISH.md b/README_PUBLISH.md index f8b124a16..0f11a0f78 100644 --- a/README_PUBLISH.md +++ b/README_PUBLISH.md @@ -20,3 +20,9 @@ 3. 执行 `git commit` 相关操作 4. 制作标签 5. 执行 `./cmd electron` 相关操作 + + +## 编译App + +1. 执行 `./cmd appbuild` 编译 +2. 进入 `resources/mobile` eeui框架内打包Android或iOS应用 diff --git a/electron/build.js b/electron/build.js index ec4216e98..6dfd26c1f 100644 --- a/electron/build.js +++ b/electron/build.js @@ -131,6 +131,7 @@ function startBuild(data, publish) { const publicDir = path.resolve(__dirname, "../resources/mobile/src/public"); fse.removeSync(publicDir) fse.copySync(electronDir, publicDir) + child_process.spawnSync("eeui", ["build"], {stdio: "inherit", cwd: "resources/mobile"}); return; } // package.json Backup diff --git a/resources/assets/js/App.vue b/resources/assets/js/App.vue index a7546df3b..40f04a32b 100755 --- a/resources/assets/js/App.vue +++ b/resources/assets/js/App.vue @@ -32,9 +32,6 @@ export default { }, created() { - if ($A.urlParameter('token')) { - this.$store.state.userToken = $A.urlParameter('token'); - } this.electronEvents(); }, diff --git a/resources/assets/js/functions/common.js b/resources/assets/js/functions/common.js index ab0a26707..83d59e531 100755 --- a/resources/assets/js/functions/common.js +++ b/resources/assets/js/functions/common.js @@ -704,34 +704,37 @@ /** * 刷新当前地址 - * @param url - * @param key * @returns {string} */ - reloadUrl(url = undefined, key = undefined) { - url = key || window.location.href; - key = (key || '_') + '=' - let reg = new RegExp(key + '\\d+'); - let timestamp = this.Time(); - if (url.indexOf(key) > -1) { - url = url.replace(reg, key + timestamp); - } else { - if (url.indexOf('\?') > -1) { - let urlArr = url.split('\?'); - if (urlArr[1]) { - url = urlArr[0] + '?' + key + timestamp + '&' + urlArr[1]; - } else { - url = urlArr[0] + '?' + key + timestamp; - } + reloadUrl() { + if ($A.isEEUiApp && $A.isAndroid()) { + let url = window.location.href; + let key = '_=' + let reg = new RegExp(key + '\\d+'); + let timestamp = this.Time(); + if (url.indexOf(key) > -1) { + url = url.replace(reg, key + timestamp); } else { - if (url.indexOf('#') > -1) { - url = url.split('#')[0] + '?' + key + timestamp + location.hash; + if (url.indexOf('\?') > -1) { + let urlArr = url.split('\?'); + if (urlArr[1]) { + url = urlArr[0] + '?' + key + timestamp + '&' + urlArr[1]; + } else { + url = urlArr[0] + '?' + key + timestamp; + } } else { - url = url + '?' + key + timestamp; + if (url.indexOf('#') > -1) { + url = url.split('#')[0] + '?' + key + timestamp + location.hash; + } else { + url = url + '?' + key + timestamp; + } } } + const webview = requireModuleJs("webview"); + webview.setUrl(url); + } else { + window.location.reload(); } - window.location.href = url }, /** diff --git a/resources/assets/js/pages/manage/components/DialogView.vue b/resources/assets/js/pages/manage/components/DialogView.vue index cf3e405c1..5ef923d78 100644 --- a/resources/assets/js/pages/manage/components/DialogView.vue +++ b/resources/assets/js/pages/manage/components/DialogView.vue @@ -300,10 +300,11 @@ export default { this.viewPicture(msg.path); return } + const uri = `/single/file/msg/${this.msgData.id}`; if (this.$Electron) { this.$Electron.sendMessage('windowRouter', { name: `file-msg-${this.msgData.id}`, - path: `/single/file/msg/${this.msgData.id}`, + path: uri, userAgent: "/hideenOfficeTitle/", force: false, config: { @@ -319,10 +320,11 @@ export default { eeui.openPage({ pageType: 'web', pageTitle: `${this.msgData.msg.name} (${$A.bytesToSize(this.msgData.msg.size)})`, - url: $A.apiUrl(`../#/single/file/msg/${this.msgData.id}?token=${this.userToken}`) + statusBarStyle: false, + url: $A.apiUrl(`../#/token?token=${this.userToken}&from=${encodeURIComponent($A.apiUrl(`../#${uri}`))}`) }, _ => {}); } else { - window.open($A.apiUrl(`../single/file/msg/${this.msgData.id}`)) + window.open($A.apiUrl(`..${uri}`)) } }, diff --git a/resources/assets/js/pages/manage/components/FileHistory.vue b/resources/assets/js/pages/manage/components/FileHistory.vue index a57843567..cfaf4fdac 100644 --- a/resources/assets/js/pages/manage/components/FileHistory.vue +++ b/resources/assets/js/pages/manage/components/FileHistory.vue @@ -182,10 +182,11 @@ export default { break; case 'preview': + const uri = `/single/file/${this.fileId}?history_id=${row.id}&history_at=${row.created_at}`; if (this.$Electron) { this.$Electron.sendMessage('windowRouter', { name: `file-${this.fileId}-${row.id}`, - path: `/single/file/${this.fileId}?history_id=${row.id}&history_at=${row.created_at}`, + path: uri, userAgent: "/hideenOfficeTitle/", force: false, config: { @@ -204,10 +205,11 @@ export default { eeui.openPage({ pageType: 'web', pageTitle: $A.getFileName(this.file) + ` [${row.created_at}]`, - url: $A.apiUrl(`../#/single/file/${this.fileId}?history_id=${row.id}&history_at=${row.created_at}&token=${this.userToken}`) + statusBarStyle: false, + url: $A.apiUrl(`../#/token?token=${this.userToken}&from=${encodeURIComponent($A.apiUrl(`../#${uri}`))}`) }, _ => {}); } else { - window.open($A.apiUrl(`../single/file/${this.fileId}?history_id=${row.id}&history_at=${row.created_at}`)) + window.open($A.apiUrl(`..${uri}`)) } break; } diff --git a/resources/assets/js/pages/manage/components/TaskDetail.vue b/resources/assets/js/pages/manage/components/TaskDetail.vue index a26048e87..0236f88d1 100644 --- a/resources/assets/js/pages/manage/components/TaskDetail.vue +++ b/resources/assets/js/pages/manage/components/TaskDetail.vue @@ -723,7 +723,7 @@ export default { openTask: { handler(data) { this.taskDetail = $A.cloneJSON(data); - if (this.taskDetail.parent_id === 0 && this.$refs.name) { + if (this.$refs.name) { this.__openTask && clearTimeout(this.__openTask); this.__openTask = setTimeout(this.$refs.name.resizeTextarea, 100) } @@ -1249,10 +1249,11 @@ export default { } return } + const uri = `/single/file/task/${file.id}`; if (this.$Electron) { this.$Electron.sendMessage('windowRouter', { name: `file-task-${file.id}`, - path: `/single/file/task/${file.id}`, + path: uri, userAgent: "/hideenOfficeTitle/", force: false, config: { @@ -1268,10 +1269,11 @@ export default { eeui.openPage({ pageType: 'web', pageTitle: `${file.name} (${$A.bytesToSize(file.size)})`, - url: $A.apiUrl(`../#/single/file/task/${file.id}?token=${this.userToken}`) + statusBarStyle: false, + url: $A.apiUrl(`../#/token?token=${this.userToken}&from=${encodeURIComponent($A.apiUrl(`../#${uri}`))}`) }, _ => {}); } else { - window.open($A.apiUrl(`../single/file/task/${file.id}`)) + window.open($A.apiUrl(`..${uri}`)) } }, diff --git a/resources/assets/js/pages/token.vue b/resources/assets/js/pages/token.vue new file mode 100644 index 000000000..a92992c17 --- /dev/null +++ b/resources/assets/js/pages/token.vue @@ -0,0 +1,54 @@ + + + + diff --git a/resources/assets/js/routes.js b/resources/assets/js/routes.js index 1518e76ad..dd00827bb 100755 --- a/resources/assets/js/routes.js +++ b/resources/assets/js/routes.js @@ -107,6 +107,11 @@ export default [ path: '/single/report/detail/:reportDetailId', component: () => import('./pages/single/reportDetail.vue') }, + { + name: 'token', + path: '/token', + component: () => import('./pages/token.vue'), + }, { name: 'login', path: '/login', diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index e6c4537ec..189421829 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -10,15 +10,21 @@ export default { */ call({state, dispatch}, params) { if (!$A.isJson(params)) params = {url: params} - if (!$A.isJson(params.header)) params.header = {} + const header = { + 'Content-Type': 'application/json', + 'language': $A.getLanguage(), + 'token': state.userToken, + 'fd': $A.getSessionStorageString("userWsFd"), + 'version': window.systemInfo.version || "0.0.1", + 'platform': $A.Platform, + } + if ($A.isJson(params.header)) { + params.header = Object.assign(header, params.header) + } else { + params.header = header; + } params.url = $A.apiUrl(params.url); params.data = $A.date2string(params.data); - params.header['Content-Type'] = 'application/json'; - params.header['language'] = $A.getLanguage(); - params.header['token'] = state.userToken; - params.header['fd'] = $A.getSessionStorageString("userWsFd"); - params.header['version'] = window.systemInfo.version || "0.0.1"; - params.header['platform'] = $A.Platform; // const cloneParams = $A.cloneJSON(params); return new Promise(function (resolve, reject) { diff --git a/resources/assets/sass/pages/components/task-add.scss b/resources/assets/sass/pages/components/task-add.scss index 47ee7d82d..10ebb31c0 100644 --- a/resources/assets/sass/pages/components/task-add.scss +++ b/resources/assets/sass/pages/components/task-add.scss @@ -90,7 +90,7 @@ } } .advanced-option { - margin-top: 42px; + padding-top: 42px; z-index: 1; display: flex; align-items: center; @@ -108,6 +108,11 @@ align-items: center; margin-left: 24px; height: 34px; + overflow-y: hidden; + overflow-x: auto; + &::-webkit-scrollbar { + display: none; + } > li { list-style: none; margin-left: 3px; @@ -200,3 +205,27 @@ padding: 26px 0 22px !important; } } + +@media (max-width: 768px) { + .task-add { + .task-add-form, + .task-add-advanced { + .advanced-option { + width: calc(100% + 8px); + padding-right: 8px; + justify-content: space-between; + > button { + &.advanced { + margin-left: 0; + } + } + .advanced-priority { + margin-left: 8px; + } + .advanced-time { + margin-left: 4px; + } + } + } + } +}