|
|
@ -7,9 +7,10 @@ import './index.less'
|
|
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
export default {
|
|
|
|
components: {
|
|
|
|
components: {
|
|
|
|
draggable, columnSetting
|
|
|
|
draggable,
|
|
|
|
|
|
|
|
columnSetting
|
|
|
|
},
|
|
|
|
},
|
|
|
|
data () {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
needTotalList: [],
|
|
|
|
needTotalList: [],
|
|
|
|
|
|
|
|
|
|
|
@ -49,9 +50,9 @@ export default {
|
|
|
|
type: String,
|
|
|
|
type: String,
|
|
|
|
default: 'middle'
|
|
|
|
default: 'middle'
|
|
|
|
},
|
|
|
|
},
|
|
|
|
scroll:{
|
|
|
|
scroll: {
|
|
|
|
type:Object,
|
|
|
|
type: Object,
|
|
|
|
default:() => ({ y: '50vh'})
|
|
|
|
default: () => ({ y: '50vh' })
|
|
|
|
},
|
|
|
|
},
|
|
|
|
alert: {
|
|
|
|
alert: {
|
|
|
|
type: [Object, Boolean],
|
|
|
|
type: [Object, Boolean],
|
|
|
@ -85,12 +86,13 @@ export default {
|
|
|
|
},
|
|
|
|
},
|
|
|
|
extraTool: {
|
|
|
|
extraTool: {
|
|
|
|
type: Array,
|
|
|
|
type: Array,
|
|
|
|
default: () => ([])
|
|
|
|
default: () => []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
watch: {
|
|
|
|
watch: {
|
|
|
|
'localPagination.current' (val) {
|
|
|
|
'localPagination.current'(val) {
|
|
|
|
this.pageURI && this.$router.push({
|
|
|
|
this.pageURI &&
|
|
|
|
|
|
|
|
this.$router.push({
|
|
|
|
...this.$route,
|
|
|
|
...this.$route,
|
|
|
|
name: this.$route.name,
|
|
|
|
name: this.$route.name,
|
|
|
|
params: Object.assign({}, this.$route.params, {
|
|
|
|
params: Object.assign({}, this.$route.params, {
|
|
|
@ -98,26 +100,28 @@ export default {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
pageNum (val) {
|
|
|
|
pageNum(val) {
|
|
|
|
Object.assign(this.localPagination, {
|
|
|
|
Object.assign(this.localPagination, {
|
|
|
|
current: val
|
|
|
|
current: val
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
pageSize (val) {
|
|
|
|
pageSize(val) {
|
|
|
|
Object.assign(this.localPagination, {
|
|
|
|
Object.assign(this.localPagination, {
|
|
|
|
pageSize: val
|
|
|
|
pageSize: val
|
|
|
|
})
|
|
|
|
})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
showSizeChanger (val) {
|
|
|
|
showSizeChanger(val) {
|
|
|
|
Object.assign(this.localPagination, {
|
|
|
|
Object.assign(this.localPagination, {
|
|
|
|
showSizeChanger: val
|
|
|
|
showSizeChanger: val
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
created () {
|
|
|
|
created() {
|
|
|
|
const { pageNo } = this.$route.params
|
|
|
|
const { pageNo } = this.$route.params
|
|
|
|
const localPageNum = this.pageURI && (pageNo && parseInt(pageNo)) || this.pageNum
|
|
|
|
const localPageNum = (this.pageURI && pageNo && parseInt(pageNo)) || this.pageNum
|
|
|
|
this.localPagination = ['auto', true].includes(this.showPagination) && Object.assign({}, this.localPagination, {
|
|
|
|
this.localPagination =
|
|
|
|
|
|
|
|
(['auto', true].includes(this.showPagination) &&
|
|
|
|
|
|
|
|
Object.assign({}, this.localPagination, {
|
|
|
|
current: localPageNum,
|
|
|
|
current: localPageNum,
|
|
|
|
pageSize: this.pageSize,
|
|
|
|
pageSize: this.pageSize,
|
|
|
|
showSizeChanger: this.showSizeChanger,
|
|
|
|
showSizeChanger: this.showSizeChanger,
|
|
|
@ -125,31 +129,28 @@ export default {
|
|
|
|
showTotal: (total, range) => {
|
|
|
|
showTotal: (total, range) => {
|
|
|
|
return range[0] + '-' + range[1] + '共' + total + '条'
|
|
|
|
return range[0] + '-' + range[1] + '共' + total + '条'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}) || false
|
|
|
|
})) ||
|
|
|
|
|
|
|
|
false
|
|
|
|
this.needTotalList = this.initTotalList(this.columns)
|
|
|
|
this.needTotalList = this.initTotalList(this.columns)
|
|
|
|
this.loadData()
|
|
|
|
this.loadData()
|
|
|
|
// this.columnsSetting = this.columns
|
|
|
|
// this.columnsSetting = this.columns
|
|
|
|
//记录选择显示的列,以当前路由为key
|
|
|
|
//记录选择显示的列,以当前路由为key
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.columnsSetting = []
|
|
|
|
this.columnsSetting = []
|
|
|
|
let cacheColumns=this.$ls.get(this.$route.path);
|
|
|
|
let cacheColumns = this.$ls.get(this.$route.path)
|
|
|
|
if(cacheColumns && cacheColumns.length>0){
|
|
|
|
if (cacheColumns && cacheColumns.length > 0) {
|
|
|
|
this.columnsSetting=cacheColumns;
|
|
|
|
this.columnsSetting = cacheColumns
|
|
|
|
|
|
|
|
|
|
|
|
this.columns.forEach((item,index,arr)=>{
|
|
|
|
this.columns.forEach((item, index, arr) => {
|
|
|
|
let temp=this.columnsSetting.find(m=>m.dataIndex==item.dataIndex);
|
|
|
|
let temp = this.columnsSetting.find(m => m.dataIndex == item.dataIndex)
|
|
|
|
//如果存在
|
|
|
|
//如果存在
|
|
|
|
if(temp){
|
|
|
|
if (temp) {
|
|
|
|
arr[index].checked=temp.checked;
|
|
|
|
arr[index].checked = temp.checked
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
this.columnsSetting = this.columns
|
|
|
|
this.columnsSetting = this.columns
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
else{
|
|
|
|
|
|
|
|
this.columnsSetting = this.columns
|
|
|
|
this.columnsSetting = this.columns
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -159,10 +160,15 @@ export default {
|
|
|
|
* 如果参数为 true, 则强制刷新到第一页
|
|
|
|
* 如果参数为 true, 则强制刷新到第一页
|
|
|
|
* @param Boolean bool
|
|
|
|
* @param Boolean bool
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
refresh (bool = false) {
|
|
|
|
refresh(bool = false) {
|
|
|
|
bool && (this.localPagination = Object.assign({}, {
|
|
|
|
bool &&
|
|
|
|
current: 1, pageSize: this.pageSize
|
|
|
|
(this.localPagination = Object.assign(
|
|
|
|
}))
|
|
|
|
{},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
current: 1,
|
|
|
|
|
|
|
|
pageSize: this.pageSize
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
))
|
|
|
|
this.loadData()
|
|
|
|
this.loadData()
|
|
|
|
},
|
|
|
|
},
|
|
|
|
/**
|
|
|
|
/**
|
|
|
@ -171,20 +177,28 @@ export default {
|
|
|
|
* @param {Object} filters 过滤条件
|
|
|
|
* @param {Object} filters 过滤条件
|
|
|
|
* @param {Object} sorter 排序条件
|
|
|
|
* @param {Object} sorter 排序条件
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
loadData (pagination, filters, sorter) {
|
|
|
|
loadData(pagination, filters, sorter) {
|
|
|
|
this.localLoading = true
|
|
|
|
this.localLoading = true
|
|
|
|
const parameter = Object.assign({
|
|
|
|
const parameter = Object.assign(
|
|
|
|
pageNo: (pagination && pagination.current) ||
|
|
|
|
{
|
|
|
|
this.showPagination && this.localPagination.current || this.pageNum,
|
|
|
|
pageNo:
|
|
|
|
pageSize: (pagination && pagination.pageSize) ||
|
|
|
|
(pagination && pagination.current) || (this.showPagination && this.localPagination.current) || this.pageNum,
|
|
|
|
this.showPagination && this.localPagination.pageSize || this.pageSize
|
|
|
|
pageSize:
|
|
|
|
},
|
|
|
|
(pagination && pagination.pageSize) ||
|
|
|
|
(sorter && sorter.field && {
|
|
|
|
(this.showPagination && this.localPagination.pageSize) ||
|
|
|
|
|
|
|
|
this.pageSize
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
(sorter &&
|
|
|
|
|
|
|
|
sorter.field && {
|
|
|
|
sortField: sorter.field
|
|
|
|
sortField: sorter.field
|
|
|
|
}) || {},
|
|
|
|
}) ||
|
|
|
|
(sorter && sorter.order && {
|
|
|
|
{},
|
|
|
|
|
|
|
|
(sorter &&
|
|
|
|
|
|
|
|
sorter.order && {
|
|
|
|
sortOrder: sorter.order
|
|
|
|
sortOrder: sorter.order
|
|
|
|
}) || {}, {
|
|
|
|
}) ||
|
|
|
|
|
|
|
|
{},
|
|
|
|
|
|
|
|
{
|
|
|
|
...filters
|
|
|
|
...filters
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -197,13 +211,15 @@ export default {
|
|
|
|
this.localLoading = false
|
|
|
|
this.localLoading = false
|
|
|
|
return
|
|
|
|
return
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.localPagination = this.showPagination && Object.assign({}, this.localPagination, {
|
|
|
|
this.localPagination =
|
|
|
|
|
|
|
|
(this.showPagination &&
|
|
|
|
|
|
|
|
Object.assign({}, this.localPagination, {
|
|
|
|
current: r.pageNo, // pageNo, // 返回结果中的当前分页数
|
|
|
|
current: r.pageNo, // pageNo, // 返回结果中的当前分页数
|
|
|
|
total: r.totalRows, // totalCount, // 返回结果中的总记录数
|
|
|
|
total: r.totalRows, // totalCount, // 返回结果中的总记录数
|
|
|
|
showSizeChanger: this.showSizeChanger,
|
|
|
|
showSizeChanger: this.showSizeChanger,
|
|
|
|
pageSize: (pagination && pagination.pageSize) ||
|
|
|
|
pageSize: (pagination && pagination.pageSize) || this.localPagination.pageSize
|
|
|
|
this.localPagination.pageSize
|
|
|
|
})) ||
|
|
|
|
}) || false
|
|
|
|
false
|
|
|
|
// 后端数据rows为null保存修复
|
|
|
|
// 后端数据rows为null保存修复
|
|
|
|
if (r.rows == null) {
|
|
|
|
if (r.rows == null) {
|
|
|
|
r.rows = []
|
|
|
|
r.rows = []
|
|
|
@ -218,20 +234,25 @@ export default {
|
|
|
|
// 这里用于判断接口是否有返回 r.totalCount 且 this.showPagination = true 且 pageNo 和 pageSize 存在 且 totalCount 小于等于 pageNo * pageSize 的大小
|
|
|
|
// 这里用于判断接口是否有返回 r.totalCount 且 this.showPagination = true 且 pageNo 和 pageSize 存在 且 totalCount 小于等于 pageNo * pageSize 的大小
|
|
|
|
// 当情况满足时,表示数据不满足分页大小,关闭 table 分页功能
|
|
|
|
// 当情况满足时,表示数据不满足分页大小,关闭 table 分页功能
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
if ((['auto', true].includes(this.showPagination) && r.totalCount <= (r.totalPage * this.localPagination.pageSize))) {
|
|
|
|
if (
|
|
|
|
|
|
|
|
['auto', true].includes(this.showPagination) &&
|
|
|
|
|
|
|
|
r.totalCount <= r.totalPage * this.localPagination.pageSize
|
|
|
|
|
|
|
|
) {
|
|
|
|
this.localPagination.hideOnSinglePage = true
|
|
|
|
this.localPagination.hideOnSinglePage = true
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
this.localPagination = false
|
|
|
|
this.localPagination = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.localDataSource = this.showPagination? r.rows:r // 返回结果中的数组数据
|
|
|
|
this.localDataSource = this.showPagination ? r.rows : r // 返回结果中的数组数据
|
|
|
|
this.localLoading = false
|
|
|
|
this.localLoading = false
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
initTotalList (columns) {
|
|
|
|
initTotalList(columns) {
|
|
|
|
const totalList = []
|
|
|
|
const totalList = []
|
|
|
|
columns && columns instanceof Array && columns.forEach(column => {
|
|
|
|
columns &&
|
|
|
|
|
|
|
|
columns instanceof Array &&
|
|
|
|
|
|
|
|
columns.forEach(column => {
|
|
|
|
if (column.needTotal) {
|
|
|
|
if (column.needTotal) {
|
|
|
|
totalList.push({
|
|
|
|
totalList.push({
|
|
|
|
...column,
|
|
|
|
...column,
|
|
|
@ -246,7 +267,7 @@ export default {
|
|
|
|
* @param selectedRowKeys
|
|
|
|
* @param selectedRowKeys
|
|
|
|
* @param selectedRows
|
|
|
|
* @param selectedRows
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
updateSelect (selectedRowKeys, selectedRows) {
|
|
|
|
updateSelect(selectedRowKeys, selectedRows) {
|
|
|
|
this.selectedRows = selectedRows
|
|
|
|
this.selectedRows = selectedRows
|
|
|
|
this.selectedRowKeys = selectedRowKeys
|
|
|
|
this.selectedRowKeys = selectedRowKeys
|
|
|
|
const list = this.needTotalList
|
|
|
|
const list = this.needTotalList
|
|
|
@ -263,7 +284,7 @@ export default {
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* 清空 table 已选中项
|
|
|
|
* 清空 table 已选中项
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
clearSelected () {
|
|
|
|
clearSelected() {
|
|
|
|
if (this.rowSelection) {
|
|
|
|
if (this.rowSelection) {
|
|
|
|
this.rowSelection.onChange([], [])
|
|
|
|
this.rowSelection.onChange([], [])
|
|
|
|
this.updateSelect([], [])
|
|
|
|
this.updateSelect([], [])
|
|
|
@ -274,31 +295,40 @@ export default {
|
|
|
|
* @param callback
|
|
|
|
* @param callback
|
|
|
|
* @returns {*}
|
|
|
|
* @returns {*}
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
renderClear (callback) {
|
|
|
|
renderClear(callback) {
|
|
|
|
if (this.selectedRowKeys.length <= 0) return null
|
|
|
|
if (this.selectedRowKeys.length <= 0) return null
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<a style="margin-left: 24px" onClick={() => {
|
|
|
|
<a
|
|
|
|
|
|
|
|
style="margin-left: 24px"
|
|
|
|
|
|
|
|
onClick={() => {
|
|
|
|
callback()
|
|
|
|
callback()
|
|
|
|
this.clearSelected()
|
|
|
|
this.clearSelected()
|
|
|
|
}}>清空</a>
|
|
|
|
}}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
清空
|
|
|
|
|
|
|
|
</a>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
renderAlert () {
|
|
|
|
renderAlert() {
|
|
|
|
// 绘制统计列数据
|
|
|
|
// 绘制统计列数据
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
const needTotalItems = this.needTotalList.map((item) => {
|
|
|
|
const needTotalItems = this.needTotalList.map(item => {
|
|
|
|
return (<span style="margin-right: 12px">
|
|
|
|
return (
|
|
|
|
{item.title}总计 <a style="font-weight: 600">{!item.customRender ? item.total : item.customRender(item.total)}</a>
|
|
|
|
<span style="margin-right: 12px">
|
|
|
|
</span>)
|
|
|
|
{item.title}总计{' '}
|
|
|
|
|
|
|
|
<a style="font-weight: 600">{!item.customRender ? item.total : item.customRender(item.total)}</a>
|
|
|
|
|
|
|
|
</span>
|
|
|
|
|
|
|
|
)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
// 绘制 清空 按钮
|
|
|
|
// 绘制 清空 按钮
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
// eslint-disable-next-line no-unused-vars
|
|
|
|
const clearItem = (typeof this.alert.clear === 'boolean' && this.alert.clear) ? (
|
|
|
|
const clearItem =
|
|
|
|
this.renderClear(this.clearSelected)
|
|
|
|
typeof this.alert.clear === 'boolean' && this.alert.clear
|
|
|
|
) : (this.alert !== null && typeof this.alert.clear === 'function') ? (
|
|
|
|
? this.renderClear(this.clearSelected)
|
|
|
|
this.renderClear(this.alert.clear)
|
|
|
|
: this.alert !== null && typeof this.alert.clear === 'function'
|
|
|
|
) : null
|
|
|
|
? this.renderClear(this.alert.clear)
|
|
|
|
|
|
|
|
: null
|
|
|
|
|
|
|
|
|
|
|
|
// 绘制 alert 组件
|
|
|
|
// 绘制 alert 组件
|
|
|
|
// 统一先去除alert组件
|
|
|
|
// 统一先去除alert组件
|
|
|
@ -317,7 +347,7 @@ export default {
|
|
|
|
this.columnsSetting = val
|
|
|
|
this.columnsSetting = val
|
|
|
|
this.$ls.set(this.$route.path, val)
|
|
|
|
this.$ls.set(this.$route.path, val)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
renderHeader () {
|
|
|
|
renderHeader() {
|
|
|
|
let tools = [
|
|
|
|
let tools = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
icon: 'reload',
|
|
|
|
icon: 'reload',
|
|
|
@ -342,8 +372,7 @@ export default {
|
|
|
|
</a-menu>
|
|
|
|
</a-menu>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onClick: () => {
|
|
|
|
onClick: () => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
icon: 'setting',
|
|
|
|
icon: 'setting',
|
|
|
@ -353,8 +382,7 @@ export default {
|
|
|
|
//return <columnSetting slot="overlay" columns={this.columns} onColumnChange={this.columnChange} />
|
|
|
|
//return <columnSetting slot="overlay" columns={this.columns} onColumnChange={this.columnChange} />
|
|
|
|
return <columnSetting slot="overlay" columns={this.columnsSetting} onColumnChange={this.columnChange} />
|
|
|
|
return <columnSetting slot="overlay" columns={this.columnsSetting} onColumnChange={this.columnChange} />
|
|
|
|
},
|
|
|
|
},
|
|
|
|
onClick: () => {
|
|
|
|
onClick: () => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
if (this.extraTool.length) {
|
|
|
|
if (this.extraTool.length) {
|
|
|
@ -363,19 +391,16 @@ export default {
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div class="s-table-tool">
|
|
|
|
<div class="s-table-tool">
|
|
|
|
<div class="s-table-tool-left">
|
|
|
|
<div class="s-table-tool-left">{this.$scopedSlots.operator && this.$scopedSlots.operator()}</div>
|
|
|
|
{this.$scopedSlots.operator && this.$scopedSlots.operator()}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="s-table-tool-right">
|
|
|
|
<div class="s-table-tool-right">
|
|
|
|
{
|
|
|
|
{tools.map(tool => {
|
|
|
|
tools.map(tool => {
|
|
|
|
|
|
|
|
if (tool.isDropdown) {
|
|
|
|
if (tool.isDropdown) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<a-dropdown trigger={['click']}>
|
|
|
|
<a-dropdown trigger={['click']}>
|
|
|
|
<a-tooltip title={tool.title} class="s-tool-item" onClick={tool.onClick}>
|
|
|
|
<a-tooltip title={tool.title} class="s-tool-item" onClick={tool.onClick}>
|
|
|
|
<a-icon type={tool.icon}/>
|
|
|
|
<a-icon type={tool.icon} />
|
|
|
|
</a-tooltip>
|
|
|
|
</a-tooltip>
|
|
|
|
{ tool.menu() }
|
|
|
|
{tool.menu()}
|
|
|
|
</a-dropdown>
|
|
|
|
</a-dropdown>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -384,8 +409,7 @@ export default {
|
|
|
|
<a-icon type={tool.icon} />
|
|
|
|
<a-icon type={tool.icon} />
|
|
|
|
</a-tooltip>
|
|
|
|
</a-tooltip>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
})
|
|
|
|
})}
|
|
|
|
}
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
@ -401,10 +425,15 @@ export default {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
render () {
|
|
|
|
render() {
|
|
|
|
let props = {}
|
|
|
|
let props = {}
|
|
|
|
const localKeys = Object.keys(this.$data)
|
|
|
|
const localKeys = Object.keys(this.$data)
|
|
|
|
const showAlert = (typeof this.alert === 'object' && this.alert !== null && this.alert.show) && typeof this.rowSelection.selectedRowKeys !== 'undefined' || this.alert
|
|
|
|
const showAlert =
|
|
|
|
|
|
|
|
(typeof this.alert === 'object' &&
|
|
|
|
|
|
|
|
this.alert !== null &&
|
|
|
|
|
|
|
|
this.alert.show &&
|
|
|
|
|
|
|
|
typeof this.rowSelection.selectedRowKeys !== 'undefined') ||
|
|
|
|
|
|
|
|
this.alert
|
|
|
|
|
|
|
|
|
|
|
|
Object.keys(T.props).forEach(k => {
|
|
|
|
Object.keys(T.props).forEach(k => {
|
|
|
|
const localKey = `local${k.substring(0, 1).toUpperCase()}${k.substring(1)}`
|
|
|
|
const localKey = `local${k.substring(0, 1).toUpperCase()}${k.substring(1)}`
|
|
|
@ -441,16 +470,24 @@ export default {
|
|
|
|
return props[k]
|
|
|
|
return props[k]
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const table = (
|
|
|
|
const table = (
|
|
|
|
<a-table {...{ props, scopedSlots: { ...this.$scopedSlots } }} onChange={this.loadData} onExpand={ (expanded, record) => { this.$emit('expand', expanded, record) } }>
|
|
|
|
<a-table
|
|
|
|
{ Object.keys(this.$slots).map(name => (<template slot={name}>{this.$slots[name]}</template>)) }
|
|
|
|
{...{ props, scopedSlots: { ...this.$scopedSlots } }}
|
|
|
|
|
|
|
|
onChange={this.loadData}
|
|
|
|
|
|
|
|
onExpand={(expanded, record) => {
|
|
|
|
|
|
|
|
this.$emit('expand', expanded, record)
|
|
|
|
|
|
|
|
}}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{Object.keys(this.$slots).map(name => (
|
|
|
|
|
|
|
|
<template slot={name}>{this.$slots[name]}</template>
|
|
|
|
|
|
|
|
))}
|
|
|
|
</a-table>
|
|
|
|
</a-table>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div class="table-wrapper">
|
|
|
|
<div class="table-wrapper">
|
|
|
|
{ this.renderHeader() }
|
|
|
|
{this.renderHeader()}
|
|
|
|
{ showAlert ? this.renderAlert() : null }
|
|
|
|
{showAlert ? this.renderAlert() : null}
|
|
|
|
{ table }
|
|
|
|
{table}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|