forked from dotnetcore/WTM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5b6769b
commit 19d243d
Showing
7 changed files
with
40 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 11 additions & 31 deletions
42
src/WalkingTec.Mvvm.Mvc/GeneratorFiles/Spa/React/views/table.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,22 @@ | ||
import { columnsRender, columnsRenderImg, DataViewTable } from 'components/dataView'; | ||
import { DesError } from 'components/decorators'; | ||
import { ColDef, ColGroupDef } from 'ag-grid-community'; | ||
import { AgGrid } from 'components/dataView'; | ||
import React from 'react'; | ||
import Store from '../store'; | ||
import Action from './action'; | ||
/** | ||
* 列 信息配置 | ||
* 完整参数列表 https://ant.design/components/table-cn/#components-table-demo-dynamic-settings | ||
* dataIndex:属性名称 区分大小写 | ||
* title:表格显示的中文标题 | ||
*/ | ||
const columns = [$columns$ | ||
// 列配置 | ||
const columnDefs: (ColDef | ColGroupDef)[] = [$columns$ | ||
] | ||
|
||
/** | ||
* 表格 | ||
*/ | ||
@DesError | ||
export default class extends React.Component<any, any> { | ||
/** | ||
* 操作动作 | ||
*/ | ||
renderColumns() { | ||
const tableColumns: any[] = [...columns]; | ||
// 根据需求 加入行动作 | ||
if (true) { | ||
tableColumns.push( | ||
{ | ||
title: '动作', | ||
dataIndex: 'Action', | ||
fixed: 'right',//固定 列 | ||
width: 160, | ||
render: (text, record) => <Action.rowAction data={record} /> | ||
} | ||
) | ||
} | ||
return tableColumns | ||
} | ||
render() { | ||
return <DataViewTable Store={Store} columns={this.renderColumns()} /> | ||
return <AgGrid | ||
rowGroupPanelShow="always" | ||
Store={Store} | ||
columnDefs={columnDefs} | ||
rowAction={Action.rowAction} | ||
rowHeight={$rowheight$} | ||
/> | ||
} | ||
} |
Binary file not shown.
Binary file not shown.