diff --git a/package.json b/package.json index 3c6f911523d164d9349bb813f05a0fe38fe6826d..217a181b269368f8d74257f2a64cbaea9b67b9d3 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "@tailwindcss/postcss7-compat": "^2.2.2", "animate.css": "^4.1.0", "ant-design-vue": "1.7.2", - "axios": "^0.19.2", + "axios": "^0.21.1", "clipboard": "^2.0.6", "core-js": "^3.6.5", "crypto-js": "^4.0.0", diff --git a/src/components/action_button/index.vue b/src/components/action_button/index.vue new file mode 100644 index 0000000000000000000000000000000000000000..378a5684fe8522877aea8dde7826a5fc978f17b1 --- /dev/null +++ b/src/components/action_button/index.vue @@ -0,0 +1,55 @@ + + + diff --git a/src/components/menu_tree/select.vue b/src/components/menu_tree/select.vue new file mode 100644 index 0000000000000000000000000000000000000000..46088dd7388d8beaf8d195f737182b3e04cfb3ca --- /dev/null +++ b/src/components/menu_tree/select.vue @@ -0,0 +1,40 @@ + + + diff --git a/src/components/table/index.vue b/src/components/table/index.vue index f1dcb3b080df26e4e86faec22dbd30ae02924ef2..3092465fbf0df4936c8f1efb12d775eea7da446c 100644 --- a/src/components/table/index.vue +++ b/src/components/table/index.vue @@ -7,7 +7,7 @@
- 重置 + 重置 查询
@@ -39,7 +39,7 @@ :closable="false" :drawerStyle="drawerStyle" :bodyStyle="bodyStyle" - :width="addBtn.width" + :width="addBtn.width || 600" destroyOnClose >
@@ -73,9 +73,15 @@ export default { noPage: Boolean, }, data() { + this.initQuery = { + pageNum: 1, + pageSize: 10, + }; return { data: [], - queryForm: {}, + queryForm: { + ...this.initQuery, + }, loading: false, addVisible: false, submitLoading: false, @@ -106,14 +112,24 @@ export default { async getData() { this.loading = true; try { - const res = await request(this.url, METHOD.GET); - if (this.formatData) this.data = this.formatData(res); - else this.data = res; + this.noPage ? await this.getDataNoPage() : await this.getDataWithPage(); } catch (error) { // todo } this.loading = false; }, + async getDataNoPage() { + const res = await request(this.url, METHOD.GET); + if (this.formatData) this.data = this.formatData(res); + else this.data = res; + }, + + async getDataWithPage() { + const res = await request(this.url, METHOD.GET, this.queryForm); + if (this.formatData) this.data = this.formatData(res); + else this.data = res.records; + }, + add() { this.addVisible = true; }, @@ -124,12 +140,12 @@ export default { this.submitLoading = true; try { await this.addBtn?.onOk(); + this.addVisible = false; this.getData(); } catch (error) { // todo } this.submitLoading = false; - this.addVisible = false; }, showAdd() { this.addVisible = true; diff --git a/src/pages/frame/store/accountModule.js b/src/pages/frame/store/accountModule.js index 32f9da4aa9a47df624be227769665c1daa848e0c..153304221344fb7fe0d872b87cd1b02f9aab2521 100644 --- a/src/pages/frame/store/accountModule.js +++ b/src/pages/frame/store/accountModule.js @@ -8,7 +8,7 @@ export default { }, //大量共享的方法 getters: { - user: (state) => { + user: state => { if (!state.user) { try { const user = localStorage.getItem(process.env.VUE_APP_USER_KEY); @@ -19,31 +19,27 @@ export default { } return state.user; }, - permissions: (state) => { + permissions: state => { if (!state.permissions) { try { - const permissions = localStorage.getItem(process.env.VUE_APP_PERMISSIONS_KEY); - state.permissions = JSON.parse(permissions); - state.permissions = state.permissions ? state.permissions : []; + state.permissions = []; } catch (e) { console.error(e.message); } } return state.permissions; }, - roles: (state) => { + roles: state => { if (!state.roles) { try { - const roles = localStorage.getItem(process.env.VUE_APP_ROLES_KEY); - state.roles = JSON.parse(roles); - state.roles = state.roles ? state.roles : []; + state.roles = []; } catch (e) { console.error(e.message); } } return state.roles; }, - routesConfig: (state) => { + routesConfig: state => { if (!state.routesConfig) { try { const routesConfig = localStorage.getItem(process.env.VUE_APP_ROUTES_KEY); diff --git a/src/pages/system/view/menu/MenuManagement.vue b/src/pages/system/view/menu/MenuManagement.vue index e123280f8464e1d55907065b7975a30e90ade3e5..f7a269a082983c598a0c00e1402d2739cc5e07f5 100644 --- a/src/pages/system/view/menu/MenuManagement.vue +++ b/src/pages/system/view/menu/MenuManagement.vue @@ -37,7 +37,6 @@ export default { addBtn: { text: '新建', title: '菜单配置', - width: 400, onOk() { return vm.$refs['addForm']?.submit(); }, diff --git a/src/pages/system/view/menu/form.vue b/src/pages/system/view/menu/form.vue index 414341eaf0fad95cf7fd454e56abb5ae7158d9d8..314ca4eadee1c9446e8a648d85c1dea566d8346e 100644 --- a/src/pages/system/view/menu/form.vue +++ b/src/pages/system/view/menu/form.vue @@ -1,7 +1,7 @@