From 9419800806a8a537150cfcf49cc7dc7d1779e6dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=AF=BA?= <1253070437@qq.com> Date: Tue, 8 Jun 2021 19:12:53 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91bug?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- _web/src/components/Table/index.js | 141 ++++++++++-------- _web/src/views/system/menu/index.vue | 12 +- _web/src/views/system/org/index.vue | 11 +- .../org/controller/SysOrgController.java | 5 +- .../modular/org/service/SysOrgService.java | 4 +- .../org/service/impl/SysOrgServiceImpl.java | 71 ++++----- .../pos/controller/SysPosController.java | 5 +- .../modular/pos/service/SysPosService.java | 4 +- .../pos/service/impl/SysPosServiceImpl.java | 36 ++--- 9 files changed, 161 insertions(+), 128 deletions(-) diff --git a/_web/src/components/Table/index.js b/_web/src/components/Table/index.js index a3f004ae..b2286f0a 100644 --- a/_web/src/components/Table/index.js +++ b/_web/src/components/Table/index.js @@ -113,6 +113,9 @@ export default { Object.assign(this.localPagination, { showSizeChanger: val }) + }, + columns(v) { + this.columnsSetting = v } }, created () { @@ -151,19 +154,19 @@ export default { loadData (pagination, filters, sorter) { this.localLoading = true const parameter = Object.assign({ - pageNo: (pagination && pagination.current) || - this.showPagination && this.localPagination.current || this.pageNum, - pageSize: (pagination && pagination.pageSize) || - this.showPagination && this.localPagination.pageSize || this.pageSize - }, - (sorter && sorter.field && { - sortField: sorter.field - }) || {}, - (sorter && sorter.order && { - sortOrder: sorter.order - }) || {}, { - ...filters - } + pageNo: (pagination && pagination.current) || + this.showPagination && this.localPagination.current || this.pageNum, + pageSize: (pagination && pagination.pageSize) || + this.showPagination && this.localPagination.pageSize || this.pageSize + }, + (sorter && sorter.field && { + sortField: sorter.field + }) || {}, + (sorter && sorter.order && { + sortOrder: sorter.order + }) || {}, { + ...filters + } ) const result = this.data(parameter) // 对接自己的通用数据接口需要修改下方代码中的 r.pageNo, r.totalCount, r.data @@ -252,6 +255,13 @@ export default { this.updateSelect([], []) } }, + /** + * 刷新并清空已选 + */ + clearRefreshSelected (bool = false) { + this.refresh(bool) + this.clearSelected() + }, /** * 处理交给 table 使用者去处理 clear 事件时,内部选中统计同时调用 * @param callback @@ -261,10 +271,10 @@ export default { if (this.selectedRowKeys.length <= 0) return null return ( { - callback() - this.clearSelected() - }}>清空 - ) + callback() + this.clearSelected() + }}>清空 + ) }, renderAlert () { // 绘制统计列数据 @@ -285,16 +295,15 @@ export default { // 绘制 alert 组件 // 统一先去除alert组件 - return '' - /* return ( + return ( - - - ) */ + + + ) }, columnChange(val) { this.columnsSetting = val @@ -318,11 +327,11 @@ export default { } return ( - 默认 - 中等 - 紧凑 + 默认 + 中等 + 紧凑 - ) + ) }, onClick: () => { } @@ -344,33 +353,34 @@ export default { return (
-
- {this.$scopedSlots.operator && this.$scopedSlots.operator()} -
-
- { - tools.map(tool => { - if (tool.isDropdown) { - return ( - - - - - { tool.menu() } - - ) - } - return ( - - - - ) - }) - } -
+
+ {this.$scopedSlots.operator && this.$scopedSlots.operator()}
- ) - /* return ( +
+ { + tools.map(tool => { + if (tool.isDropdown) { + return ( + + + + + { tool.menu() } + + ) + } + return ( + + + + ) + }) + } +
+
+ ) + /* + return ( - ) */ + ) + */ } }, @@ -423,16 +434,16 @@ export default { }) const table = ( { this.$emit('expand', expanded, record) } }> - { Object.keys(this.$slots).map(name => ()) } + { Object.keys(this.$slots).map(name => ()) } ) - return ( -
- { this.renderHeader() } - { showAlert ? this.renderAlert() : null } - { table } -
+ return ( +
+ { this.renderHeader() } + { showAlert ? this.renderAlert() : null } + { table } +
) + } } -} diff --git a/_web/src/views/system/menu/index.vue b/_web/src/views/system/menu/index.vue index 7067f80d..5a6b70d7 100644 --- a/_web/src/views/system/menu/index.vue +++ b/_web/src/views/system/menu/index.vue @@ -74,7 +74,7 @@