ttk-app-core
Version:
enterprise develop framework
312 lines (310 loc) • 8.09 kB
JavaScript
export function getMeta() {
return {
name: 'root',
component: 'Layout',
className: 'ttk-table-app-tab-list',
children: [{
name: 'tabs',
component: 'Tabs',
className: 'ttk-table-app-tab-list-tabs',
type: 'card',
activeKey: '{{data.filter.targetList}}',
onChange: '{{$tabChange}}',
children: [{
name: 'all',
component: 'Tabs.TabPane',
key: 'all',
tab: '全部'
}, {
name: 'assets',
component: 'Tabs.TabPane',
key: '5000010001',
tab: '衣服'
}, {
name: 'liabilities',
component: 'Tabs.TabPane',
key: '5000010002',
tab: '饰品'
}, {
name: 'rightsInterests',
component: 'Tabs.TabPane',
key: '5000010004',
tab: '食物'
}, {
name: 'cost',
component: 'Tabs.TabPane',
key: '5000010005',
tab: '水果'
}, {
name: 'profitLoss',
component: 'Tabs.TabPane',
key: '5000010006',
tab: '设备'
}]
}, {
name: 'header-right',
component: '::div',
className: 'ttk-table-app-tab-list-header-right',
onClick: '{{$setSubjectCode}}',
children:[{
name: 'set',
component: 'Icon',
className: 'ttk-table-app-tab-list-header-right-icon',
showStyle: 'softly',
fontFamily: 'edficon',
type: 'shezhi',
style: {
fontSize: 28
},
title: '设置',
},{
name: 'set',
component: '::span',
className: 'ttk-table-app-tab-list-header-right-text',
children: '编码设置'
}]
},{
name: 'content',
className: 'ttk-table-app-tab-list-content',
component: 'Layout',
children: [{
name: 'dataGrid',
component: 'DataGrid',
headerHeight: 37,
callBack: '{{$setScrollTop}}',
rowHeight: 35,
// top: '{{data.top}}',
isColumnResizing: true,
loading: '{{data.other.loading}}',
ellipsis: true,
changetab: '{{data.other.changetab}}',
className: 'ttk-table-app-tab-list-content-grid',
// scrollToRow: '{{data.other.detailsScrollToRow}}',
rowsCount: "{{data.list ? data.list.length : 0}}",
columns: [{
name: 'code',
component: 'DataGrid.Column',
columnKey: 'code',
flexGrow: 1,
// isResizable: true,
width: 130,
header: {
name: 'header',
component: 'DataGrid.Cell',
children: '编码'
},
cell: {
name: 'cell',
component: 'DataGrid.Cell',
className: 'ttk-table-app-tab-list-cell-left',
_power: '({rowIndex})=>rowIndex',
children: {
name: 'link',
className:'ttk-table-app-tab-list-cell-left-code',
component: '::a',
children: '{{data.list[_rowIndex].code}}',
onClick: '{{$editSubject(data.list[_rowIndex])}}'
},
},
}, {
name: 'name',
component: 'DataGrid.Column',
columnKey: 'name',
width: 250,
// isResizable: true,
header: {
name: 'header',
component: 'DataGrid.Cell',
children: '名称'
},
cell: {
name: 'cell',
component: 'DataGrid.Cell',
className: 'ttk-table-app-tab-list-cell-left',
_power: '({rowIndex})=>rowIndex',
style:{
paddingLeft: '{{(data.list[_rowIndex].grade - 1) * 12 + 8}}',
},
children: "{{data.list[_rowIndex].name && data.list[_rowIndex].name }}",
tip: true,
// children: {
// component: '::div',
// style:{
// paddingLeft: '{{data.list[_rowIndex].grade * 3}}',
// },
// children:"{{data.list[_rowIndex].name && data.list[_rowIndex].name }}"
// },
}
}, {
name: 'balanceDirectionName',
component: 'DataGrid.Column',
columnKey: 'balanceDirectionName',
flexGrow: 1,
width: 50,
header: {
name: 'header',
component: 'DataGrid.Cell',
children: '方向',
},
cell: {
name: 'cell',
component: 'DataGrid.Cell',
_power: '({rowIndex})=>rowIndex',
children: '{{data.list[_rowIndex].balanceDirectionName}}',
},
}, {
name: 'isAuxAccProject',
component: 'DataGrid.Column',
columnKey: 'isAuxAccProject',
// isResizable: true,
flexGrow: 1,
width: 230,
header: {
name: 'header',
component: 'DataGrid.Cell',
children: '辅助核算'
},
cell: {
name: 'cell',
className: 'ttk-table-app-tab-list-cell-left',
component: 'DataGrid.Cell',
_power: '({rowIndex})=>rowIndex',
children: '{{data.list[_rowIndex].AuxAccCalcInfo}}',
tip: true,
},
}, {
name: 'currencyName',
component: 'DataGrid.Column',
columnKey: 'currencyName',
// isResizable: true,
flexGrow: 1,
width: 90,
header: {
name: 'header',
component: 'DataGrid.Cell',
children: '外币'
},
cell: {
name: 'cell',
component: 'DataGrid.Cell',
_power: '({rowIndex})=>rowIndex',
children: '{{data.list[_rowIndex].currencyName}}',
tip: true,
},
}, {
name: 'unitName',
component: 'DataGrid.Column',
// isResizable: true,
columnKey: 'unitName',
flexGrow: 1,
width: 70,
header: {
name: 'header',
component: 'DataGrid.Cell',
children: '数量'
},
cell: {
name: 'cell',
component: 'DataGrid.Cell',
// className: 'ttk-table-app-tab-list-cell-left',
_power: '({rowIndex})=>rowIndex',
children: '{{data.list[_rowIndex].unitName}}',
tip: true,
},
}, {
name: 'status',
component: 'DataGrid.Column',
columnKey: 'statue',
flexGrow: 1,
width: 50,
header: {
name: 'header',
component: 'DataGrid.Cell',
children: '停用'
},
cell: {
name: 'cell',
component: 'DataGrid.Cell',
_power: '({rowIndex})=>rowIndex',
children: `{{data.list[_rowIndex].isEnable ? '否': '是'}}`,
},
},{
name: 'oprate',
component: 'DataGrid.Column',
className: 'ttk-table-app-tab-list-cell-oprate',
columnKey: 'oprate',
fixedRight: true,
width: 80,
style: {textOverflow: 'initial'},
header: {
name: 'header',
component: 'DataGrid.Cell',
children: '操作'
},
cell: {
name: 'cell',
component: 'DataGrid.Cell',
className: 'ttk-table-app-tab-list-cell-oprate',
_power: '({rowIndex})=>rowIndex',
children: [{
name: 'add',
component: 'Icon',
showStyle: 'softly',
fontFamily: 'edficon',
type: 'xinzengkemu',
className: 'add',
disabled: '{{$disabledState(data.list[_rowIndex])}}',
style: {
fontSize: 23
},
title: '新增',
onClick: '{{$addSubject(data.list[_rowIndex],_rowIndex)}}'
}, {
name: 'edit',
component: 'Icon',
showStyle: 'softly',
fontFamily: 'edficon',
type: 'bianji',
// disabled: '{{!data.list[_rowIndex].isAudit}}',
style: {
fontSize: 23
},
title: '编辑',
onClick: '{{$editSubject(data.list[_rowIndex])}}'
}, {
name: 'del',
component: 'Icon',
showStyle: 'showy',
fontFamily: 'edficon',
type: 'shanchu',
disabled: '{{!(!data.list[_rowIndex].isSystem && data.list[_rowIndex].isEndNode && data.list[_rowIndex].isEnable)}}',
style: {
fontSize: 23
},
title: '删除',
onClick: '{{$deleteSubject(data.list[_rowIndex])}}'
}]
}
}]
}]
}]
}
}
export function getInitState() {
return {
data: {
list: [],
filter: {
targetList: 'all'
},
top: 0,
other: {
calcDict: {},
detailsScrollToRow: 0,
changetab: true,
loading: true, //grid加载状态
accountingStandards: true //是否为小企业会计准则
}
}
}
}