|
|
@@ -85,19 +85,21 @@ export const JeecgListMixin = {
|
|
|
getAction(this.url.list, params).then((res) => {
|
|
|
if (res.success) {
|
|
|
if (res.result.records) {
|
|
|
- var keys = Object.keys(res.result.records[0]).sort()
|
|
|
- console.log('keys', keys)
|
|
|
- this.columns.splice(2, this.columns.length)
|
|
|
- keys.forEach(t => {
|
|
|
- if (t !== 'layout_name' && t !== 'price_name' && t !== 'id' && t !== 'hotel_name') {
|
|
|
- this.columns.push({
|
|
|
- title: t,
|
|
|
- align: "center",
|
|
|
- dataIndex: t,
|
|
|
- scopedSlots: { customRender: t },
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
+ if (res.result.records.length > 0) {
|
|
|
+ var keys = Object.keys(res.result.records[0]).sort()
|
|
|
+ console.log('keys', keys)
|
|
|
+ this.columns.splice(3, this.columns.length)
|
|
|
+ keys.forEach(t => {
|
|
|
+ if (t !== 'layout_name' && t !== 'price_name' && t !== 'id' && t !== 'hotel_name' && t !== 'price_id') {
|
|
|
+ this.columns.push({
|
|
|
+ title: t,
|
|
|
+ align: "center",
|
|
|
+ dataIndex: t,
|
|
|
+ scopedSlots: { customRender: t },
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
//update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
|
this.dataSource = res.result.records || res.result;
|