UNPKG

ttk-app-core

Version:
291 lines (290 loc) 9.44 kB
import moment from 'moment' export function getMeta() { return { name: 'root', component: 'Layout', className: 'app-asset-management-list', children: [{ name: 'tablesetting', component: 'TableSettingCard', data: '{{data.other.columnDto}}', visible: '{{data.showTableSetting}}', showTitle: '{{false}}', positionClass: 'app-asset-management-list-content', confirmClick: '{{function(data){$showTableSetting({value: false, data: data})}}}', cancelClick: '{{function(){$closeTableSetting()}}}', resetClick: '{{function(){$resetTableSetting({data: data})}}}' },{ name: 'header', component: '::div', className: 'app-asset-management-list-header', children: [{ name: 'accountQuery', title: 'accountQuery', className: 'app-asset-management-list-accountQuery', component: 'SearchCard', refName: 'accountQuery', searchClick: '{{function(value){$searchValueChange(value)}}}', cancelClick: '{{function(value){$searchCancelChange(value)}}}', clearClick: '{{function(value){$clearValueChange(value)}}}', onChange: '{{function(value){$searchValueChange(value)}}}', didMount:'{{function(childrenRef){$getSearchCard(childrenRef)}}}', refreshBtn: { name: 'refreshBtn', component: 'Icon', fontFamily: 'edficon', type: 'shuaxin', className: 'mk-normalsearch-reload', onClick: '{{$refresh}}' }, confirmBtn:{ hidden: false, text: '查询' }, cancelBtn: { hidden: false, text: '取消' }, clearBtn: { hidden: false, text: '清空' }, menuBtn:[{ name: 'import', component: 'Button', _visible: '{{data.list.length ? true : false}}', type: 'primary', children: '取消处置', className: 'btn subjectRight', onClick: '{{$noDispose}}' }, { name: 'add', component: 'Button', type: "{{ data.list.length ? 'Default' : 'primary'}}", children: '科目设置', className: 'btn', onClick: '{{$moreMenuClick}}', _visible: true, },{ name: 'submitShow', component: 'Button', //type: 'primary', _visible: '{{data.other.submitShow}}', children: '手工生成凭证', className: 'btn subjectRight', onClick: '{{$generatingVoucher}}' }, { name: 'print', component: 'Icon', fontFamily: 'edficon', className: 'btn print', type: 'dayin', onClick: '{{$print}}', title: '打印', style: { fontSize: 28, lineHeight: '30px' }, }, { name: 'export', component: 'Icon', fontFamily: 'edficon', className: 'btn export', type: 'daochu', title: '导出', onClick: '{{$exports}}', style: { fontSize: 28, lineHeight: '28px' }, }], normalSearcChildren: [{ name: 'assetProperty', component: 'Select', showSearch: false, className: 'app-asset-list-header-assetProperty asset-header-select', value: '{{data.form.assetProperty && data.form.assetProperty.value}}', onChange: `{{function(v){$assetPropertyChange('data.form.assetProperty',data.other.assetProperty.filter(function(o){return o.value == v})[0])}}}`, children: { name: 'option', component: 'Select.Option', className: 'active-management-option', value: '{{data.other.assetProperty && data.other.assetProperty[_rowIndex].value }}', title: '{{data.other.assetProperty && data.other.assetProperty[_rowIndex].label }}', children: '{{data.other.assetProperty && data.other.assetProperty[_rowIndex].label }}', _power: 'for in data.other.assetProperty' } }, { name: 'assetClass', component: 'Select', showSearch: false, className: 'app-asset-list-header-assetClass asset-header-select', value: '{{data.form.assetClass && data.form.assetClass.value}}', onChange: `{{function(v){$assetClassChange('data.form.assetClass',data.other.assetClass.filter(function(o){return o.value == v})[0])}}}`, children: { name: 'option', component: 'Select.Option', className: 'active-management-option', value: '{{data.other.assetClass && data.other.assetClass[_rowIndex].value }}', title: '{{data.other.assetClass && data.other.assetClass[_rowIndex].label }}', children: '{{data.other.assetClass && data.other.assetClass[_rowIndex].label }}', _power: 'for in data.other.assetClass' } }], normalSearch:[], moreSearch: '{{data.other.oldSearchValue}}', treeSelect: [{ name: "treeSelect", component: '::div', className: 'select-tree', children: [{ name: "treeSelect", component: '::span', className: 'select-tree-label', children: "资产分类" },{ name: 'assetProperty', component: 'Select', showSearch: false, className: 'app-asset-management-list-header-assetProperty', value: '{{data.searchValue.assetProperty && data.searchValue.assetProperty.value}}', onChange: `{{function(v){$assetPropertyChange('data.searchValue.assetProperty',data.other.assetProperty.filter(function(o){return o.value == v})[0])}}}`, children: { name: 'option', component: 'Select.Option', //className: 'active-management-option', value: '{{data.other.assetProperty && data.other.assetProperty[_rowIndex].value }}', children: '{{data.other.assetProperty && data.other.assetProperty[_rowIndex].label }}', _power: 'for in data.other.assetProperty' } }, { name: 'assetClass', component: 'Select', showSearch: false, className: 'app-asset-management-list-header-assetClass', value: '{{data.searchValue.assetClass && data.searchValue.assetClass.value}}', onChange: `{{function(v){$assetClassChange('data.searchValue.assetClass',data.other.assetClass.filter(function(o){return o.value == v})[0])}}}`, children: { name: 'option', component: 'Select.Option', //className: 'active-management-option', value: '{{data.other.assetClass && data.other.assetClass[_rowIndex].value }}', children: '{{data.other.assetClass && data.other.assetClass[_rowIndex].label }}', _power: 'for in data.other.assetClass' } }] }], moreSearchItem: [{ name: 'date', range: true, label: '处置日期', centerContent: '到', isTime: true, pre:{ name: 'startDate', type: 'DatePicker', // mode: ['month', 'month'], // format: "YYYY-MM", allowClear: true, // noClear: true, decoratorDate: '{{function(value, value2){return $disabledDateDay(value, value2, "pre")}}}', }, next: { name: 'endDate', type: 'DatePicker', // mode: ['month', 'month'], // format: "YYYY-MM", allowClear: true, // noClear: true, decoratorDate: '{{function(value, value2){return $disabledDateDay(value, value2, "next")}}}', } }, { name: 'assets', label: '资产', type: 'Select', showSearch: '{{true}}', childType: 'Option', optionFilterProp:"children", filterOption: '{{$filterOptionSummary}}', title: '{{data.other.assets}}', option: '{{data.other.assets}}', allowClear: true, onChange: '{{function(v){$selectAsset(v)}}}' }, { name: 'assetDisposeType', label: '处置方式', type: 'Select', childType: 'Option', option: '{{data.other.assetDisposeType}}', allowClear: true, onChange: '{{function(v){$selectAssetDisposeType(v)}}}' }], }] }, { name: 'content', component: 'Layout', className: 'app-asset-management-list-content', children: [{ name: 'dataGrid', component: 'DataGrid', headerHeight: 37, isColumnResizing: true, rowHeight: 37, onColumnResizeEnd: '{{$onColumnResizeEnd}}', //enableSequence: true, loading: '{{data.other.loading}}', ellipsis: true, rowsCount: "{{$getListRowsCount()}}", columns: "{{$getColumns()}}", }] }, { name: 'footer', component: '::div', className: 'app-list-account-footer', children: [{ name: 'pagination', component: 'Pagination', showSizeChanger: true, pageSizeOptions: ['50', '100', '150', '200'], pageSize: '{{data.page.pageSize}}', current: '{{data.page.current}}', total: '{{data.page.total}}', onChange: '{{$pageChanged}}', onShowSizeChange: '{{$pageChanged}}' }] }] } } export function getInitState() { return { data: { list: [], showTableSetting:false, searchValue: { //startDate: moment().startOf('month'), //endDate: moment().endOf('month'), }, filter: { page: {pageSize: 50, currentPage: 1} }, form: {}, other: { loading: false, //grid加载状态 oldSearchValue: { //startDate: moment().startOf('month'), //endDate: moment().endOf('month'), }, submitShow: false, columnDto: [], isColumnSolution: true, isNoDispose: true, isGeneratingVoucher: true }, page: { current: 1, total: 0, pageSize: 50 }, } } }