ttk-app-core
Version:
enterprise develop framework
318 lines (312 loc) • 7.89 kB
JavaScript
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'ttk-edf-app-advancerpt',
children: [{
name: 'header',
component: 'Layout',
className: 'ttk-edf-app-advancerpt-header',
children: [{
name: 'right',
component: 'Layout',
className: 'ttk-edf-app-advancerpt-header-right',
children: [{
name: 'addSaleOrder',
component: 'Button',
type: 'showy',
children: '新增销售订单',
onClick: '{{$add}}'
}, {
name: 'receipt',
component: 'Button',
type: 'bluesky',
children: '收款',
onClick: '{{$receipt}}'
}, {
name: 'batch',
component: 'Dropdown',
overlay: {
name: 'menu',
component: 'Menu',
onClick: '{{$batchMenuClick}}',
children: [{
name: 'modify',
component: 'Menu.Item',
key: 'audit',
children: '审核'
}, {
name: 'del',
component: 'Menu.Item',
key: 'del',
children: '删除'
}]
},
children: {
name: 'internal',
component: 'Button',
type: 'bluesky',
children: ['批量', {
name: 'down',
component: 'Icon',
type: 'down'
}]
}
}, {
name: 'print',
component: 'Icon',
fontFamily: 'edficon',
className: 'btn print dayin',
type: 'dayin',
onClick: '{{$print}}',
title: '打印',
style: {
fontSize: 28
},
}, {
name: 'export',
component: 'Icon',
fontFamily: 'edficon',
className: 'btn export daochu',
type: 'daochu',
title: '导出',
onClick: '{{$export}}',
style: {
fontSize: 28,
lineHeight: '28px'
},
}, {
name: 'setting',
component: 'Icon',
fontFamily: 'edficon',
className: 'btn export shezhi',
type: 'shezhi',
title: '导出',
onClick: '{{$setting}}',
style: {
fontSize: 28,
lineHeight: '28px'
},
}]
}]
}, {
name: 'commonFilter',
component: 'Layout',
className: 'ttk-edf-app-advancerpt-baseFilter',
children: [{
name: 'internal',
component: 'Radio.Group',
value: '{{data.filter.common}}',
onChange: `{{$commonFilterChange}}`,
children: [{
name: 'all',
value: 'all',
component: 'Radio.Button',
children: '全部'
}, {
name: 'today',
value: 'today',
component: 'Radio.Button',
children: '今天'
}, {
name: 'thisWeek',
value: 'thisWeek',
component: 'Radio.Button',
children: '本周'
},{
name: 'thisMonth',
value: 'thisMonth',
component: 'Radio.Button',
children: '本月'
}, {
name: 'thisYear',
value: 'thisYear',
component: 'Radio.Button',
children: '本年'
}]
}, {
name: 'fold',
component: 'Icon',
showStyle: 'softly',
type: `{{data.other.isFold ? 'down': 'right'}}`,
style: {fontSize: 20},
onClick: '{{$toggleShowAdvanceFilter}}',
}],
}, {
name: 'advanceFilter',
component: 'Layout',
className: 'ttk-edf-app-advancerpt-advanceFilter',
_visible: '{{data.other.isFold}}',
children: [{
name: 'form',
component: 'Form',
className: 'ttk-edf-app-advancerpt-advanceFilter-form',
children: [{
name: 'customerItem',
component: 'Form.Item',
label: '产地',
children: [{
name: 'customer',
component: 'Select',
showSearch: false,
value: '{{data.filter.customer }}',
onChange: "{{$customerChange}}",
allowClear: true,
children: {
name: 'option',
component: 'Select.Option',
value: "{{ data.other.customers && data.other.customers[_rowIndex].n }}",
children: '{{data.other.customers && data.other.customers[_rowIndex].n }}',
_power: 'for in data.other.customers'
}
}]
}, {
name: 'codeItem',
component: 'Form.Item',
label: '编号',
children: [{
name: 'code',
component: 'Input',
allowClear: true,
value: '{{data.filter.code}}',
onBlur: `{{(e)=>$sf('data.filter.code', e.target.value)}}`,
}]
}, {
name: 'search',
component: 'Button',
type: 'bluesky',
children: '查询',
onClick: '{{$search}}'
}]
}]
}, {
name: 'tabs',
component: 'Tabs',
className: 'ttk-edf-app-advancerpt-tabs',
type: 'card',
activeKey: '{{data.filter.status}}',
onChange: '{{$tabChange}}',
children: [{
name: 'all',
component: 'Tabs.TabPane',
key: 'all',
tab: '全部'
},{
name: 'unpaid',
component: 'Tabs.TabPane',
key: '未收款',
tab: `{{'未收款'}}`
}, {
name: 'paid',
component: 'Tabs.TabPane',
key: '已收款',
tab: '已收款'
}]
},{
name: 'content',
className: 'ttk-edf-app-advancerpt-content',
component: 'Table',
key: Math.random(),
columns: '{{$renderColumns()}}',
dataSource: '{{data.list}}',
scroll: '{{data.tableOption}}',
pagination: false,
},
// {
// name: 'footer',
// className: 'ttk-edf-app-advancerpt-footer',
// component: 'Layout',
// children: [{
// name: 'pagination',
// component: 'Pagination',
// showSizeChanger: true,
// pageSize: '{{data.pagination.pageSize}}',
// current: '{{data.pagination.current}}',
// total: '{{data.pagination.total}}',
// onChange: '{{$pageChanged}}',
// onShowSizeChange: '{{$pageChanged}}'
// }]
// }
]
}
}
export function getInitState() {
return {
data: {
list: [],
tableOption: {
x: 1090,
y: null
},
pagination: { current: 1, total: 0, pageSize: 50 },
filter: {
common: 'all',
status: 'all'
},
total: {
allCount: 0,
unauditCount : 0,
unpaidCount: 0,
paidCount: 0
},
other: {
isFold: true,
stateclass:[
{
id:0,
key:'all',
name:'全部'
},
{
id:1,
key:'unaudit',
name:'未审核',
},
{
id:2,
key:'unpaid',
name:'未收全款',
},
{
id:3,
key:'paid',
name:'已收款',
}
],
customers: [
{ 'n': "北京市", 'c': "110000" },
{ 'n': "天津市", 'c': "120000" },
{ 'n': "河北省", 'c': "130000" },
{ 'n': "山西省", 'c': "140000" },
{ 'n': "内蒙古自治区", 'c': "150000" },
{ 'n': "辽宁省", 'c': "210000" },
{ 'n': "吉林省", 'c': "220000" },
{ 'n': "黑龙江省", 'c': "230000" },
{ 'n': "上海市", 'c': "310000" },
{ 'n': "江苏省", 'c': "320000" },
{ 'n': "浙江省", 'c': "330000" },
{ 'n': "安徽省", 'c': "340000" },
{ 'n': "福建省", 'c': "350000" },
{ 'n': "江西省", 'c': "360000" },
{ 'n': "山东省", 'c': "370000" },
{ 'n': "河南省", 'c': "410000" },
{ 'n': "湖北省", 'c': "420000" },
{ 'n': "湖南省", 'c': "430000" },
{ 'n': "广东省", 'c': "440000" },
{ 'n': "广西壮族自治区", 'c': "450000" },
{ 'n': "海南省", 'c': "460000" },
{ 'n': "重庆市", 'c': "500000" },
{ 'n': "四川省", 'c': "510000" },
{ 'n': "贵州省", 'c': "520000" },
{ 'n': "云南省", 'c': "530000" },
{ 'n': "西藏自治区", 'c': "540000" },
{ 'n': "陕西省", 'c': "610000" },
{ 'n': "甘肃省", 'c': "620000" },
{ 'n': "青海省", 'c': "630000" },
{ 'n': "宁夏回族自治区", 'c': "640000" },
{ 'n': "新疆维吾尔自治区", 'c': "650000" }
]
}
}
}
}