From 5a2909f121606fe7ee3cd4d2b56cecae81369f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Sat, 8 May 2021 10:43:26 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E4=BF=A1=E6=81=AF=E7=AE=A1=E7=90=86=E7=9A=84?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Web/package.json | 1 + Web/src/assets/style/lib/container.less | 37 +++- Web/src/assets/style/lib/form.less | 7 + Web/src/common/login/index.js | 19 +- Web/src/components/yoImage/index.js | 20 +- Web/src/pages/account/index.vue | 35 +++ Web/src/pages/account/setting/info.vue | 254 ++++++++++++++++++++++ Web/src/pages/form/normal.vue | 7 - Web/src/pages/form/yo.vue | 79 ------- Web/src/pages/form/yo/Input.vue | 63 ------ Web/src/pages/list/query.vue | 146 ------------- Web/src/pages/system/doc/index.vue | 48 ++++ Web/src/util/global/index.js | 21 +- Web/src/views/main/_layout/content.vue | 16 +- Web/src/views/main/_layout/header/user.js | 13 ++ Web/src/views/main/index.vue | 4 +- Web/yarn.lock | 5 + 17 files changed, 450 insertions(+), 325 deletions(-) create mode 100644 Web/src/pages/account/index.vue create mode 100644 Web/src/pages/account/setting/info.vue delete mode 100644 Web/src/pages/form/normal.vue delete mode 100644 Web/src/pages/form/yo.vue delete mode 100644 Web/src/pages/form/yo/Input.vue delete mode 100644 Web/src/pages/list/query.vue diff --git a/Web/package.json b/Web/package.json index d9b6637..b1f0c80 100644 --- a/Web/package.json +++ b/Web/package.json @@ -22,6 +22,7 @@ "vue": "^2.6.11", "vue-awesome-swiper": "^4.1.1", "vue-color": "^2.8.1", + "vue-cropper": "^0.5.6", "vue-highlight.js": "^3.1.0", "vue-router": "^3.5.1" }, diff --git a/Web/src/assets/style/lib/container.less b/Web/src/assets/style/lib/container.less index 95a5ebb..4af89bf 100644 --- a/Web/src/assets/style/lib/container.less +++ b/Web/src/assets/style/lib/container.less @@ -1,10 +1,39 @@ @import (reference) '~@/assets/style/extend.less'; @container-width: 1400px; -.container { - width: @container-width; +.container-base { margin: 0 auto; padding: 0 @padding-md; } -.container-fluid { - padding: 0 @padding-md; +.container { + width: @container-width; + +.container-base(); +} +@media (max-width: 1400px) { + .container { + width: auto; + } +} +.container-md { + width: @container-width - 200px; + +.container-base(); +} +.container-sm { + width: @container-width - 400px; + +.container-base(); +} +.container-xs { + width: @container-width - 600px; + +.container-base(); +} +.container-xxs { + width: @container-width - 700px; + +.container-base(); +} +.container-fluid { + .container-base(); } diff --git a/Web/src/assets/style/lib/form.less b/Web/src/assets/style/lib/form.less index e1c5a53..a4508aa 100644 --- a/Web/src/assets/style/lib/form.less +++ b/Web/src/assets/style/lib/form.less @@ -136,6 +136,13 @@ width: 100%; } } + .yo-form--short { + .ant-form-item-control-wrapper { + flex: 0 0 38.2%; + + width: 38.2%; + } + } .ant-form-explain { font-size: @font-size-base - 1px; diff --git a/Web/src/common/login/index.js b/Web/src/common/login/index.js index 93f80bf..ce75d86 100644 --- a/Web/src/common/login/index.js +++ b/Web/src/common/login/index.js @@ -1,23 +1,9 @@ import { api } from '@/common/api' import { token } from '@/common/token' -import { GLOBAL_INFO_KEY } from '@/common/storage' import { encryptByDES, decryptByDES } from '@/util/des' +import { removeGlobal } from '@/util/global' import app from '@/main' -const setGlobal = (info) => { - app.$set(app.global, 'info', info) - window.sessionStorage.setItem(GLOBAL_INFO_KEY, encryptByDES(JSON.stringify(info))) -} - -const removeGlobal = () => { - app.$set(app.global, 'info', undefined) - window.sessionStorage.removeItem(GLOBAL_INFO_KEY) -} - -const getGlobal = () => { - return JSON.parse(decryptByDES(window.sessionStorage.getItem(GLOBAL_INFO_KEY))) -} - const doLogin = (args) => { return new Promise((resolve, reject) => { api.login(args).then(({ success, data, message }) => { @@ -72,7 +58,4 @@ const doLogout = () => { export { doLogin, doLogout, - - setGlobal, - getGlobal } \ No newline at end of file diff --git a/Web/src/components/yoImage/index.js b/Web/src/components/yoImage/index.js index 278a46a..b6fa7ea 100644 --- a/Web/src/components/yoImage/index.js +++ b/Web/src/components/yoImage/index.js @@ -17,13 +17,27 @@ export default { } }, - created() { + watch: { + async id() { + this.src = await this.getSrc() + } + }, + + async created() { if (this.id) { - this.$api.sysFileInfoPreview({ id: this.id }).then(async ({ data }) => { + this.src = await this.getSrc() + } + }, + + methods: { + + getSrc() { + return this.$api.sysFileInfoPreview({ id: this.id }).then(async ({ data }) => { const base64 = await ArrayBufferToBase64(data) - this.src = base64 + return base64 }) } + }, render() { diff --git a/Web/src/pages/account/index.vue b/Web/src/pages/account/index.vue new file mode 100644 index 0000000..3009fac --- /dev/null +++ b/Web/src/pages/account/index.vue @@ -0,0 +1,35 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/Web/src/pages/account/setting/info.vue b/Web/src/pages/account/setting/info.vue new file mode 100644 index 0000000..c06d462 --- /dev/null +++ b/Web/src/pages/account/setting/info.vue @@ -0,0 +1,254 @@ + + + + 我的信息 + + + + + + + + + + 上传完成时无法被销毁 + + + + + + avatar.preview = data" + auto-crop + fixed-box + info + ref="cropper" + /> + + + + + + + + 选择图片 + + + + + + + + + + 确认 + 取消 + + + + + + + + + + {{ form.name }} + + + form.birthday = date ? $moment(date).format('YYYY-MM-DD') : null" + class="w-100-p" + placeholder="请选择生日" + v-model="form.birthday" + /> + + + + + + 保密 + + + + 男 + + + + 女 + + + + + + + + + 更新个人信息 + + + + + \ No newline at end of file diff --git a/Web/src/pages/form/normal.vue b/Web/src/pages/form/normal.vue deleted file mode 100644 index f147e6a..0000000 --- a/Web/src/pages/form/normal.vue +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/Web/src/pages/form/yo.vue b/Web/src/pages/form/yo.vue deleted file mode 100644 index 84a95ef..0000000 --- a/Web/src/pages/form/yo.vue +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - 输入框 - - 数字输入框 - - - - a-input-number可以输入和选择数字 - - - - - 文本域 - - - - - - 提及 - - - - 史莱姆 - 哥布林 - 牛头人 - - - - 单选框 - - - - a-radio-group > a-radio横排的单选框。请注意,因为控件区域宽度的限制,在这里无法使用单选框按钮 - - - 攻击 - 防御 - 剑技 - 魔法 - 回复 - 虐杀 - 踩在脚下 - - - - - 垂直单选框,需要在垂直布局控件的基础上,添加类 - .yo-form--vertical-radio - - - 攻击 - 防御 - 剑技 - 魔法 - 回复 - 虐杀 - 踩在脚下 - - - - - - - - - - \ No newline at end of file diff --git a/Web/src/pages/form/yo/Input.vue b/Web/src/pages/form/yo/Input.vue deleted file mode 100644 index 49cee58..0000000 --- a/Web/src/pages/form/yo/Input.vue +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Zhejiang - Jiangsu - - - - - - - - - - Between - Except - - - - - - - - - 上下布局,请在 - a-form-model-item上添加类 - .yo-form--vertical - - - - - \ No newline at end of file diff --git a/Web/src/pages/list/query.vue b/Web/src/pages/list/query.vue deleted file mode 100644 index 5434e4a..0000000 --- a/Web/src/pages/list/query.vue +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - 宁波市 - - - - - 2020 - 2021 - - - - 查询 - - - - - - - - Button - Button - Button - Button - - Button - Button - Button - - - - 1st item - 2nd item - 3rd item - - - Actions - - - - - Dropdown - - - 1st menu item - - - 2nd menu item - - - 3rd item - - - - - - - - - - - \ No newline at end of file diff --git a/Web/src/pages/system/doc/index.vue b/Web/src/pages/system/doc/index.vue index 9e0a980..a3fda6d 100644 --- a/Web/src/pages/system/doc/index.vue +++ b/Web/src/pages/system/doc/index.vue @@ -1,6 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + app.$set(app.global, 'info', info) + window.sessionStorage.setItem(GLOBAL_INFO_KEY, encryptByDES(JSON.stringify(info))) +} +export const removeGlobal = () => { + app.$set(app.global, 'info', undefined) + window.sessionStorage.removeItem(GLOBAL_INFO_KEY) +} +export const getGlobal = () => { + return JSON.parse(decryptByDES(window.sessionStorage.getItem(GLOBAL_INFO_KEY))) +} \ No newline at end of file diff --git a/Web/src/views/main/_layout/content.vue b/Web/src/views/main/_layout/content.vue index 598c5b9..8e6e277 100644 --- a/Web/src/views/main/_layout/content.vue +++ b/Web/src/views/main/_layout/content.vue @@ -35,7 +35,13 @@ >关闭右侧标签页 - + @@ -75,6 +81,14 @@ export default { onLoadContentWindow(key) { NProgress.start(); const pane = this.panes.find((p) => p.key === key); + + // 打开之前先销毁 + const index = this.panes.indexOf(pane); + const component = this.$refs.panes && this.$refs.panes[index]; + if (component) { + component.$destroy(); + } + const i = import(`@/pages${pane.path}`); pane.component = () => i; pane.loaded = false; diff --git a/Web/src/views/main/_layout/header/user.js b/Web/src/views/main/_layout/header/user.js index 82027dd..2677a78 100644 --- a/Web/src/views/main/_layout/header/user.js +++ b/Web/src/views/main/_layout/header/user.js @@ -34,6 +34,15 @@ export default { }, 300) }, + onAccountSetting() { + this.openContentWindow({ + key: 'account-home', + title: '个人中心', + icon: 'user', + path: '/account' + }) + }, + onLogout() { this.$confirm({ title: '提示', @@ -64,6 +73,10 @@ export default { + + + 个人中心 + diff --git a/Web/src/views/main/index.vue b/Web/src/views/main/index.vue index a8c3db9..cab207c 100644 --- a/Web/src/views/main/index.vue +++ b/Web/src/views/main/index.vue @@ -35,9 +35,7 @@ import Content from './_layout/content'; import Setting from './setting'; -import { setGlobal } from '@/common/login'; - -import { EMPTY_ID } from '@/util/global'; +import { EMPTY_ID, setGlobal } from '@/util/global'; const getNewID = () => { return Math.random().toString(16).slice(2); diff --git a/Web/yarn.lock b/Web/yarn.lock index 43ebcb9..dcdf3a5 100644 --- a/Web/yarn.lock +++ b/Web/yarn.lock @@ -8518,6 +8518,11 @@ vue-color@^2.8.1: material-colors "^1.0.0" tinycolor2 "^1.1.2" +vue-cropper@^0.5.6: + version "0.5.6" + resolved "https://registry.npm.taobao.org/vue-cropper/download/vue-cropper-0.5.6.tgz?cache=0&sync_timestamp=1608604834259&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-cropper%2Fdownload%2Fvue-cropper-0.5.6.tgz#a38c98d402da1421bd5e7535e16b9723f103cafd" + integrity sha1-o4yY1ALaFCG9XnU14WuXI/EDyv0= + vue-eslint-parser@^7.0.0: version "7.6.0" resolved "https://registry.npm.taobao.org/vue-eslint-parser/download/vue-eslint-parser-7.6.0.tgz#01ea1a2932f581ff244336565d712801f8f72561"