|
@@ -195,19 +195,19 @@ export default {
|
|
|
loadData (pagination, filters, sorter) {
|
|
|
this.localLoading = true
|
|
|
const parameter = Object.assign({
|
|
|
- pageNum: (pagination && pagination.current) ||
|
|
|
+ pageNum: (pagination && pagination.current) ||
|
|
|
this.showPagination && this.localPagination.current || this.pageNum,
|
|
|
- pageSize: (pagination && pagination.pageSize) ||
|
|
|
+ pageSize: (pagination && pagination.pageSize) ||
|
|
|
this.showPagination && this.localPagination.pageSize || this.pageSize
|
|
|
- },
|
|
|
- (sorter && sorter.field && {
|
|
|
- sortField: sorter.field
|
|
|
- }) || {},
|
|
|
- (sorter && sorter.order && {
|
|
|
- sortOrder: sorter.order
|
|
|
- }) || {}, {
|
|
|
- ...filters
|
|
|
- }
|
|
|
+ },
|
|
|
+ (sorter && sorter.field && {
|
|
|
+ sortField: sorter.field
|
|
|
+ }) || {},
|
|
|
+ (sorter && sorter.order && {
|
|
|
+ sortOrder: sorter.order
|
|
|
+ }) || {}, {
|
|
|
+ ...filters
|
|
|
+ }
|
|
|
)
|
|
|
const result = this.data(parameter)
|
|
|
// 对接自己的通用数据接口需要修改下方代码中的 r.pageNo, r.totalCount, r.data
|
|
@@ -292,10 +292,10 @@ export default {
|
|
|
if (this.selectedRowKeys.length <= 0) return null
|
|
|
return (
|
|
|
<a style="margin-left: 24px" onClick={() => {
|
|
|
- callback()
|
|
|
- this.clearSelected()
|
|
|
- }}>清空</a>
|
|
|
- )
|
|
|
+ callback()
|
|
|
+ this.clearSelected()
|
|
|
+ }}>清空</a>
|
|
|
+ )
|
|
|
},
|
|
|
/** myColumns
|
|
|
* 处理交给 table 使用者去处理 clear 事件时,内部选中统计同时调用
|
|
@@ -314,38 +314,38 @@ export default {
|
|
|
treeData.push({ title: item.title,
|
|
|
key: item.title })
|
|
|
})
|
|
|
- //const choose=this.$t('m.common.choose_show_column')
|
|
|
+ // const choose=this.$t('m.common.choose_show_column')
|
|
|
return (
|
|
|
<a style="margin-left: 24px" onClick={() => {
|
|
|
- }}>
|
|
|
+ }}>
|
|
|
|
|
|
- <a-popover placement="bottom">
|
|
|
- <template slot="content">
|
|
|
- <a-tree
|
|
|
- checkable={true}
|
|
|
- onCheck={(checkedKeys) => {
|
|
|
- Object.keys(this.checkCustomMap).forEach((key) => {
|
|
|
- const item = this.checkCustomMap[key]
|
|
|
- item.checked = false
|
|
|
- })
|
|
|
- checkedKeys.forEach((item) => {
|
|
|
- this.checkCustomMap[item].checked = true
|
|
|
- })
|
|
|
- // 重新渲染render ()函数
|
|
|
- this.$forceUpdate()
|
|
|
- }}
|
|
|
- onSelect={(selectedKeys, info) => {
|
|
|
- }}
|
|
|
- checkedKeys={checkedKeys}
|
|
|
- treeData={treeData} />
|
|
|
- </template>
|
|
|
- <template slot="title">
|
|
|
- <span>选择显示列</span>
|
|
|
- </template>
|
|
|
- <a-icon type="appstore" />
|
|
|
- </a-popover>
|
|
|
+ <a-popover placement="bottom">
|
|
|
+ <template slot="content">
|
|
|
+ <a-tree
|
|
|
+ checkable={true}
|
|
|
+ onCheck={(checkedKeys) => {
|
|
|
+ Object.keys(this.checkCustomMap).forEach((key) => {
|
|
|
+ const item = this.checkCustomMap[key]
|
|
|
+ item.checked = false
|
|
|
+ })
|
|
|
+ checkedKeys.forEach((item) => {
|
|
|
+ this.checkCustomMap[item].checked = true
|
|
|
+ })
|
|
|
+ // 重新渲染render ()函数
|
|
|
+ this.$forceUpdate()
|
|
|
+ }}
|
|
|
+ onSelect={(selectedKeys, info) => {
|
|
|
+ }}
|
|
|
+ checkedKeys={checkedKeys}
|
|
|
+ treeData={treeData} />
|
|
|
+ </template>
|
|
|
+ <template slot="title">
|
|
|
+ <span>选择显示列</span>
|
|
|
+ </template>
|
|
|
+ <a-icon type="appstore" />
|
|
|
+ </a-popover>
|
|
|
</a>
|
|
|
- )
|
|
|
+ )
|
|
|
},
|
|
|
renderAlert () {
|
|
|
// 绘制统计列数据
|
|
@@ -362,18 +362,18 @@ export default {
|
|
|
this.renderClear(this.alert.clear)
|
|
|
) : null
|
|
|
const renderColumns = this.renderColumns()
|
|
|
- //const ss = this.$t('m.common.choose_total')
|
|
|
+ // const ss = this.$t('m.common.choose_total')
|
|
|
// 绘制 alert 组件
|
|
|
return (
|
|
|
<a-alert showIcon={true} style="margin-bottom: 16px">
|
|
|
- <template slot="message">
|
|
|
- <span style="margin-right: 12px">已选择:<a style="font-weight: 600">{this.selectedRows.length}</a></span>
|
|
|
- {needTotalItems}
|
|
|
- {clearItem}
|
|
|
- {renderColumns}
|
|
|
- </template>
|
|
|
- </a-alert>
|
|
|
- )
|
|
|
+ <template slot="message">
|
|
|
+ <span style="margin-right: 12px">已选择:<a style="font-weight: 600">{this.selectedRows.length}</a></span>
|
|
|
+ {needTotalItems}
|
|
|
+ {clearItem}
|
|
|
+ {renderColumns}
|
|
|
+ </template>
|
|
|
+ </a-alert>
|
|
|
+ )
|
|
|
}
|
|
|
},
|
|
|
|