<?xml version="1.0" encoding="gbk"?>
<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
	<!-- 环境变量 -->
	<bean id="context" class="nc.vo.uif2.LoginContext" />

	<!-- 模型部分配置 -->

	<!-- 单据操作代理 -->
	<bean id="maintainProxy" class="nc.ui.th.th_bonus.ace.serviceproxy.AceTh_bonusMaintainProxy" />
	<!-- 单据删除代理，支持批操作 -->
	<bean id="deleteProxy" class="nc.ui.th.th_bonus.ace.serviceproxy.AceTh_bonusDeleteProxy" />
	<!-- 对象转换器工厂，由此获取操作对象的特征信息 -->
	<bean id="boadatorfactory"
		class="nc.ui.pubapp.uif2app.view.value.AggVOMetaBDObjectAdapterFactory" />

	<!-- 管理应用模型 -->
	<bean id="manageAppModel" class="nc.ui.pubapp.uif2app.model.BillManageModel">
		<property name="businessObjectAdapterFactory" ref="boadatorfactory"></property>
		<property name="context" ref="context"></property>
	</bean>
	<bean id="modelDataManager" class="nc.ui.pubapp.uif2app.model.pagination.PaginationModelDataManager">
		<property name="model" ref="manageAppModel"></property>
		<property name="paginationModel" ref="paginationModel" />
		<property name="pageQueryService" ref="pageQueryService" />
	</bean>

	<bean id="paginationModel" class="nc.ui.pubapp.uif2app.model.pagination.PubPaginationModel"
		init-method="init">
		<property name="paginationQueryService" ref="maintainProxy" />
	</bean>

	<bean id="pageQueryService" class="nc.ui.pubapp.uif2app.model.pagination.UIPageQueryService">
		<property name="allPagePkQueryServiceMethod" value="nc.itf.th.ITh_bonusMaintain.queryPKs"></property>
		<property name="dataOfPksQueryServiceMethod" value="nc.itf.th.ITh_bonusMaintain.queryBillByPK"></property>
	</bean>
	<bean id="paginationBar" class="nc.ui.uif2.components.pagination.PaginationBar" init-method="onStructChanged">
		<property name="paginationModel" ref="paginationModel" />
	</bean>

	<!-- 模板容器，负责对模板的统一装载 -->
	<bean id="templateContainer" class="nc.ui.pubapp.uif2app.view.TemplateContainer">
		<property name="context" ref="context" />
		<property name="nodeKeies">
			<list>
				<value>bt</value>
			</list>
		</property>
	</bean>

	<!-- 查询模板加载bean -->
	<bean id="queryTemplateContainer" class="nc.ui.uif2.editor.QueryTemplateContainer">
		<property name="context" ref="context"></property>
		<property name="nodeKey" value="qt"></property>
	</bean>

	<!-- 界面元素 -->
	<!-- 列表视图 -->
	<bean id="listView" class="nc.ui.pubapp.uif2app.view.ShowUpableBillListView"
        init-method="initUI">
		<property name="paginationBar" ref="paginationBar" />
		<property name="model" ref="manageAppModel"></property>
		<property name="templateContainer" ref="templateContainer"></property>
	</bean>

	<!--卡控件-->
	<bean id="billFormEditor" class="nc.ui.pubapp.uif2app.view.ShowUpableBillForm" init-method="initUI">
		<property name="model" ref="manageAppModel"></property>
		<property name="templateContainer" ref="templateContainer" />
		<property name="showOrgPanel" value="true" />
	</bean>

	<!-- 快速查询区域 -->
	<bean id="queryArea" class="nc.ui.pubapp.uif2app.tangramlayout.UEQueryAreaShell"
		init-method="initUI">
		<property name="queryAreaCreator" ref="queryAction" />
	</bean>
	<!-- 查询信息栏 -->
	<bean id="queryInfo" class="nc.ui.uif2.tangramlayout.CardLayoutToolbarPanel">
		<property name="model" ref="manageAppModel" />
	</bean>

	<!-- 卡片界面的工具栏和返回按钮 -->
	<bean id="cardInfoPnl" class="nc.ui.pubapp.uif2app.tangramlayout.UECardLayoutToolbarPanel">
		<property name="titleAction">
			<bean id="returnaction" class="nc.ui.pubapp.uif2app.actions.UEReturnAction">
				<property name="goComponent" ref="listView" />
				<property name="saveAction" ref="saveAction" />
				<property name="model" ref="manageAppModel" />
			</bean>
		</property>
		<property name="model" ref="manageAppModel" />
	</bean>

	<!-- 界面布局总装 -->
	<bean id="container" class="nc.ui.uif2.TangramContainer" init-method="initUI">
		<property name="model" ref="manageAppModel" />
		<property name="tangramLayoutRoot">
			<bean class="nc.ui.uif2.tangramlayout.node.TBNode">
				<property name="showMode" value="CardLayout" />
				<property name="tabs">
					<list>
						<bean class="nc.ui.uif2.tangramlayout.node.HSNode">
							<property name="left">
								<bean class="nc.ui.uif2.tangramlayout.node.CNode">
									<property name="component" ref="queryArea" />
								</bean>
							</property>
							<property name="right">
								<bean class="nc.ui.uif2.tangramlayout.node.VSNode">
									<property name="up">
										<bean class="nc.ui.uif2.tangramlayout.node.CNode">
											<property name="component" ref="queryInfo" />
										</bean>
									</property>
									<property name="down">
										<bean class="nc.ui.uif2.tangramlayout.node.CNode">
											<property name="name">
												<bean class="nc.ui.uif2.I18nFB">
													<property name="resDir" value="common"></property>
													<property name="resId" value="UC001-0000107"></property>
													<property name="defaultValue" value="列表"></property>
												</bean>
											</property>
											<property name="component" ref="listView" />
										</bean>
									</property>
									<property name="dividerLocation" value="25f" />
								</bean>
							</property>
							<property name="dividerLocation" value="0.22f" />
						</bean>
						<bean class="nc.ui.uif2.tangramlayout.node.VSNode">
							<property name="up">
								<bean class="nc.ui.uif2.tangramlayout.node.CNode">
									<property name="component" ref="cardInfoPnl" />
								</bean>
							</property>
							<property name="down">
								<bean class="nc.ui.uif2.tangramlayout.node.CNode">
									<property name="name">
										<bean class="nc.ui.uif2.I18nFB">
											<property name="resDir" value="common"></property>
											<property name="resId" value="UC001-0000106"></property>
											<property name="defaultValue" value="卡片"></property>
										</bean>
									</property>
									<property name="component" ref="billFormEditor" />
								</bean>
							</property>
							<property name="dividerLocation" value="30f" />
						</bean>
					</list>
				</property>
			</bean>
		</property>
	</bean>



	<!-- 事件监听 -->
	<bean id="eventMediator" class="nc.ui.pubapp.uif2app.model.AppEventHandlerMediator">
		<property name="model" ref="manageAppModel" />
		<property name="handlerGroup">
			<list>
				<!-- 表头表尾字段编辑前事件 -->
				<bean class="nc.ui.pubapp.uif2app.event.EventHandlerGroup">
					<property name="event" value="nc.ui.pubapp.uif2app.event.card.CardHeadTailBeforeEditEvent" />
					<property name="handler">
						<bean class="nc.ui.th.th_bonus.ace.handler.AceHeadTailBeforeEditHandler" />
					</property>
				</bean>
				<!-- 表头表尾字段编辑后事件 -->
				<bean class="nc.ui.pubapp.uif2app.event.EventHandlerGroup">
					<property name="event" value="nc.ui.pubapp.uif2app.event.card.CardHeadTailAfterEditEvent" />
					<property name="handler">
						<bean class="nc.ui.th.th_bonus.ace.handler.AceHeadTailAfterEditHandler" />
					</property>
				</bean>
				<!-- 新增事件 -->
				<bean class="nc.ui.pubapp.uif2app.event.EventHandlerGroup">
					<property name="event" value="nc.ui.pubapp.uif2app.event.billform.AddEvent" />
					<property name="handler">
						<bean class="nc.ui.th.th_bonus.ace.handler.AceAddHandler" />
					</property>
				</bean>
				<!-- 组织改变事件 -->
				<bean class="nc.ui.pubapp.uif2app.event.EventHandlerGroup">
					<property name="event" value="nc.ui.pubapp.uif2app.event.OrgChangedEvent" />
					<property name="handler">
						<bean class="nc.ui.th.th_bonus.ace.handler.AceOrgChangedHandler" >
							<constructor-arg ref="billFormEditor"/>
						</bean>
					</property>
				</bean>

			</list>
		</property>
	</bean>

	<!-- Actions  -->
	<bean id="toftpanelActionContributors" class="nc.ui.uif2.actions.ActionContributors">
		<property name="contributors">
			<list>
				<ref bean="actionsOfList" />
				<ref bean="actionsOfCard" />
			</list>
		</property>
	</bean>

	<!-- 列表显示下的按钮 -->
	<bean id="actionsOfList" class="nc.ui.uif2.actions.StandAloneToftPanelActionContainer">
		<constructor-arg ref="listView" />
		<property name="model" ref="manageAppModel" />
		<property name="actions">
			<list>
				<ref bean="addAction" />
				<ref bean="editAction" />
				<ref bean="deleteAction" />
				<ref bean="copyAction" />
				<ref bean="separatorAction" />
				<ref bean="queryAction" />
				<ref bean="refreshAction" />
				<ref bean="separatorAction" />
				<ref bean="linkQueryAction" />
				<ref bean="separatorAction" />
				<ref bean="printMenuAction" />
				<ref bean="separatorAction" />
				<ref bean="importExportMenu" />
			</list>
		</property>
	</bean>

	<!-- 卡片显示下的按钮 -->
	<bean id="actionsOfCard" class="nc.ui.uif2.actions.StandAloneToftPanelActionContainer">
		<constructor-arg ref="billFormEditor" />
		<property name="model" ref="manageAppModel" />
		<!-- 此处配置的Action浏览态始终可见 -->
		<property name="actions">
			<list>
				<ref bean="addAction" />
				<ref bean="editAction" />
				<ref bean="deleteAction" />
				<ref bean="copyAction" />
				<ref bean="separatorAction" />
				<ref bean="queryAction" />
				<ref bean="cardRefreshAction" />
				<ref bean="separatorAction" />
				<ref bean="linkQueryAction" />
				<ref bean="separatorAction" />
				<ref bean="printMenuAction" />
				<ref bean="separatorAction" />
				<ref bean="importExportMenu" />
			</list>
		</property>

		<!-- 此处配置的Action编辑态始终可见 -->
		<property name="editActions">
			<list>
				<ref bean="saveAction" />
				<ref bean="cancelAction" />
			</list>
		</property>
	</bean>

	<!-- 分隔按钮 -->
	<bean id="separatorAction" class="nc.funcnode.ui.action.SeparatorAction" /> 
	<!-- 显示列表的拦截器 -->
	<bean id="showListInterceptor"
		class="nc.ui.pubapp.uif2app.actions.interceptor.ShowUpComponentInterceptor">
		<property name="showUpComponent" ref="listView" />
	</bean>
	<!-- 显示卡片的拦截器 -->
	<bean id="showCardInterceptor"
		class="nc.ui.pubapp.uif2app.actions.interceptor.ShowUpComponentInterceptor">
		<property name="showUpComponent" ref="billFormEditor" />
	</bean>

	<bean id="addAction" class="nc.ui.pubapp.uif2app.actions.AddAction">
		<property name="model" ref="manageAppModel" />
		<property name="interceptor" ref="showCardInterceptor" />
	</bean>
	<bean id="editAction" class="nc.ui.pubapp.uif2app.actions.EditAction">
		<property name="model" ref="manageAppModel" />
		<property name="interceptor" ref="showCardInterceptor" />
	</bean>
	<bean id="deleteAction" class="nc.ui.pubapp.uif2app.actions.DeleteAction">
		<property name="model" ref="manageAppModel" />
		<property name="singleBillService" ref="deleteProxy" />
	</bean>

	<bean id="saveAction" class="nc.ui.pubapp.uif2app.actions.DifferentVOSaveAction">
		<property name="model" ref="manageAppModel" />
		<property name="editor" ref="billFormEditor" />
		<property name="service" ref="maintainProxy" />
		<property name="validationService" ref="validateService" />
	</bean>

	<!-- 保存组合校验 -->
	<bean id="validateService" class="nc.ui.pubapp.uif2app.validation.CompositeValidation">
		<property name="validators">
			<list>
				<bean class="nc.ui.pubapp.uif2app.validation.TemplateNotNullValidation">
					<property name="billForm" ref="billFormEditor" />
				</bean>	
			</list>
		</property>
	</bean>	
	<bean id="cancelAction" class="nc.ui.pubapp.uif2app.actions.CancelAction">
		<property name="model" ref="manageAppModel" />
	</bean>
	<!-- 复制 -->
	<bean id="copyAction" class="nc.ui.pubapp.uif2app.actions.CopyAction">
		<property name="model" ref="manageAppModel" />
		<property name="interceptor" ref="showCardInterceptor" />
		<property name="editor" ref="billFormEditor" />
		<property name="copyActionProcessor">
			<bean
				class="nc.ui.th.th_bonus.action.CopyActionProcessor"></bean>
		</property>
	</bean>

	<bean id="qryCondInitializer" class="nc.ui.th.th_bonus.query.Th_bonusQueryConditionInitializer" />

	<!-- 查询按钮 -->
	<bean id="queryAction" class="nc.ui.pubapp.uif2app.query2.action.DefaultQueryAction">
		<property name="model" ref="manageAppModel" />
		<property name="dataManager" ref="modelDataManager" />
		<property name="qryCondDLGInitializer" ref="qryCondInitializer" />
		<property name="showUpComponent" ref="listView" />
		<property name="templateContainer" ref="queryTemplateContainer" />
	</bean>

	<!-- 列表下刷新 -->
	<bean id="refreshAction" class="nc.ui.pubapp.uif2app.query2.action.DefaultRefreshAction">
		<property name="dataManager" ref="modelDataManager" />
		<property name="model" ref="manageAppModel" />
	</bean>

	<!-- 卡片下刷新 -->
	<bean id="cardRefreshAction" class="nc.ui.pubapp.uif2app.actions.RefreshSingleAction">
		<property name="model" ref="manageAppModel" />
	</bean>


	<!-- 打印 -->
	<bean id="printAction" class="nc.ui.pubapp.uif2app.actions.MetaDataBasedPrintAction">
		<property name="preview" value="false" />
		<property name="model" ref="manageAppModel" />
		<property name="nodeKey" value="ot" />
	</bean>

	<!-- 预览 -->
	<bean id="previewAction" class="nc.ui.pubapp.uif2app.actions.MetaDataBasedPrintAction">
		<property name="preview" value="true" />
		<property name="model" ref="manageAppModel" />
		<property name="nodeKey" value="ot" />
	</bean>

	<!-- 输出 -->
	<bean id="outputAction" class="nc.ui.pubapp.uif2app.actions.OutputAction">
		<property name="model" ref="manageAppModel" />
		<property name="parent" ref="billFormEditor" />
		<property name="nodeKey" value="ot" />
	</bean>

	<!-- 打印按钮组 -->
	<bean id="printMenuAction" class="nc.funcnode.ui.action.GroupAction">
		<property name="code" value="printMenuAction" />
		<property name="name">
			<bean class="nc.ui.uif2.I18nFB">
				<property name="resDir" value="common"></property>
				<property name="resId" value="UC001-0000007"></property>
				<property name="defaultValue" value="打印"></property>
			</bean>
		</property>
		<property name="actions">
			<list>
				<ref bean="printAction" />
				<ref bean="previewAction" />
				<ref bean="outputAction" />
			</list>
		</property>
	</bean>

	<!-- 联查单据 -->
	<bean id="linkQueryAction" class="nc.ui.pubapp.uif2app.actions.LinkQueryAction">
		<property name="model" ref="manageAppModel" />
		<property name="billType" value="THDJ" />
	</bean>


	<!-- 打开节点监听 -->
	<bean id="InitDataListener" class="nc.ui.pubapp.uif2app.model.DefaultFuncNodeInitDataListener">
		<property name="model" ref="manageAppModel"/>
		<property name="context" ref="context"></property>
		<!-- VO的类名 -->
		<property name="voClassName" value="nc.vo.th.bonus.AggbonusVO"/>
		<!-- 打开节点节点后要显示的界面 -->
		<property name="autoShowUpComponent" ref="billFormEditor"/>
	</bean>

	<!-- 节点关闭的校验 -->
	<bean id="ClosingListener" class="nc.ui.pubapp.common.validateservice.ClosingCheck" >
		<property name="model" ref="manageAppModel"/>
		<property name="saveAction" ref="saveAction"/>
	</bean>

	<!-- 自动修正卡片界面的分数显示控件(换算率) -->
	<bean id="fractionFixMediator" class="nc.ui.pubapp.uif2app.view.FractionFixMediator" init-method="initUI">
		<constructor-arg ref="billFormEditor"/>
	</bean>
	<!-- 双击列表行后显示卡片 -->
	<bean id="mouseClickShowPanelMediator" class="nc.ui.pubapp.uif2app.view.MouseClickShowPanelMediator">
		<property name="listView" ref="listView" />
		<property name="showUpComponent" ref="billFormEditor" />
		<property name="hyperLinkColumn" value="code" />
	</bean>

	<bean id="remoteCallCombinatorCaller" class="nc.ui.uif2.editor.UIF2RemoteCallCombinatorCaller">
		<property name="remoteCallers">
			<list>
				<ref bean="queryTemplateContainer" />
				<ref bean="templateContainer" />
			</list>
		</property>
	</bean>
	
	<!-- 导入导出按钮-->
	<bean id="importExportMenu" class="nc.funcnode.ui.action.MenuAction">
		<property name="code" value="importExport" />
		<property name="name" value="导入导出" />
		<property name="actions">
			<list>
				<ref bean="ImportData" />         <!-- 导入Excel -->
				<ref bean="ExportData" />         <!-- 导出Excel -->
				<ref bean="ExportTemplate" />     <!-- 导出模板 -->
			</list>
		</property>
	</bean>

	<!-- 导入Excel（根据模板填充数据） -->
	<bean id="ImportData" class="nc.ui.uif2.excelimport.ImportAction">
		<property name="model" ref="manageAppModel" />
		<property name="importableEditor" ref="ImportExportEditor" />
		<property name="btnName" value="导入Excel" />
	</bean>
	
		<!-- 导出数据到Excel -->
	<bean id="ExportData" class="nc.ui.uif2.excelimport.ExportAction">
		<property name="model" ref="manageAppModel" />
		<property name="importableEditor" ref="ImportExportEditor" />
		<property name="btnName" value="导出Excel" />
	</bean>
	
	
	<!-- 导入项目编辑器 -->
	<bean id="ImportExportEditor" class="nc.ui.uif2.excelimport.DefaultUIF2ImportableEditor">
		<property name="billcardPanelEditor" ref="billFormEditor" />
		<property name="addAction" ref="addAction" />
		<property name="cancelAction" ref="cancelAction" />
		<property name="saveAction" ref="saveAction" />
		<property name="appModel" ref="manageAppModel" />
	</bean>

	<!-- 导出模板到Excel -->
	<bean id="ExportTemplate" class="nc.ui.uif2.excelimport.ExportExcelTemplateAction">
		<property name="model" ref="manageAppModel" />
		<property name="importableEditor" ref="ImportExportEditor" />
		<property name="btnName" value="导出模板" />
	</bean>
	
</beans>