ttk-app-core
Version:
enterprise develop framework
119 lines (116 loc) • 2.92 kB
JavaScript
import moment from 'moment'
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'ttk-scm-app-collect-result',
children: [
{
component: '::div',
className:'main',
children: [
{
name: 'header',
component: '::div',
_visible: '{{data.dateVisible}}',
className: 'ttk-scm-app-invoice-summary-headerContent',
children: {
name: 'header-content',
component: '::div',
className: 'ttk-scm-app-invoice-summary-header',
children: [{
name: 'date',
component: 'DatePicker.MonthPicker',
format: "YYYY-MM",
allowClear: false,
className: "mk-rangePicker",
value: '{{data.date}}',
onChange: '{{$dateChange}}',
disabledDate: '{{$disabledRangePicker}}'
}, {
component: 'Icon',
fontFamily: 'edficon',
type: 'shuaxin',
className: 'ttk-scm-app-invoice-summary-header-reload',
onClick: '{{$refresh}}',
}, {
name: 'lblDocCount',
component: 'Layout',
className: 'ttk-scm-app-invoice-summary-header-label',
children: null
},
{
component: 'Icon',
fontFamily: 'edficon',
type: 'dayin',
className: 'dayin',
onClick: '{{$print}}',
title: '打印'
}, {
component: 'Icon',
fontFamily: 'edficon',
className: 'daochu',
type: 'daochu',
title: '导出',
onClick: '{{$export}}'
}]
}
},
{
className: 'ttk-scm-app-collect-result-Body',
name: 'report',
component: 'Table',
key: '{{data.tableKey}}',
remberName: 'ttk-scm-app-collect-result',
loading: '{{data.loading}}',
pagination: false,
scroll: '{{data.list.length > 0 ? data.tableOption : undefined }}',
rowSelection: null,
allowColResize: false,
onChange: '{{$tableOnchange}}',
noDelCheckbox: false,
bordered: true,
dataSource: '{{data.list}}',
columns: '{{$renderColumns()}}',
rowKey: "id", //主键
rowClassName: '{{$renderRowClassName}}',
}
]
}, {
name: 'foot',
component: '::div',
style: {
textAlign: 'center',
padding: '10px 16px',
height:51
},
children: {
component: 'Button',
type: 'primary',
children: '关闭',
onClick: '{{$onOk}}',
style: {
textAlign: 'center',
width: 59.3,
height: 30,
},
}
}
]
}
}
export function getInitState() {
return {
data: {
list: [],
tableKey: 1000,
tableOption: {
x:0.01
},
loading: true,
dateVisible: true,
//date: moment().subtract(1, "months").startOf('month'),
date:null
}
}
}