From 54f35ae7866dac5c497372b68d03309c7eae9424 Mon Sep 17 00:00:00 2001
From: dangsn <dangsn@chicecm.com>
Date: 星期三, 02 八月 2023 18:15:07 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeDataMainPanel.java |  154 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 154 insertions(+), 0 deletions(-)

diff --git a/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeDataMainPanel.java b/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeDataMainPanel.java
new file mode 100644
index 0000000..b4da4c3
--- /dev/null
+++ b/Source/UBCS/ubcs-codeApply/src/main/java/com/vci/ubcs/codeapply/CodeDataMainPanel.java
@@ -0,0 +1,154 @@
+package com.vci.ubcs.codeapply;
+
+import com.vci.base.ui.swing.VCISwingUtil;
+import com.vci.base.ui.swing.components.VCIJButton;
+import com.vci.base.ui.swing.components.VCIJPanel;
+import com.vci.base.ui.swing.components.table.AbstractVCIJTableDataProvider;
+import com.vci.base.ui.swing.components.table.VCIJTablePanel;
+import com.vci.ubcs.codeapply.object.BaseModel;
+import com.vci.ubcs.codeapply.object.UIFormRefer;
+
+import java.awt.*;
+import java.util.HashMap;
+import java.util.Map;
+
+public class CodeDataMainPanel extends VCIJPanel {
+
+	/**
+	 * 鑷畾涔夐《閮ㄦ帶浠跺尯鍩�
+	 */
+	private AttarSearchPanel customTopPanel = null;
+	private UIFormRefer uiFormRefer;
+	private CodeDataMainPanelActionListener actionListener = new CodeDataMainPanelActionListener(this);
+	private VCIJButton btnSearch = VCISwingUtil.createVCIJButton("search", "鏌ヨ", "鏌ヨ", "search.png", actionListener);
+	private VCIJButton btnClear = VCISwingUtil.createVCIJButton("clear_search", "娓呯┖鏌ヨ鏉′欢", "娓呯┖鏌ヨ鏉′欢", "clear.gif", actionListener);
+	public CodeDataMainPanel(UIFormRefer uiFormRefer) {
+		this.uiFormRefer=uiFormRefer;
+	}
+	private Map<String,String> customCondtionMap=new HashMap<>();
+	public void buildPanel(){
+		this.init();
+	}
+	private void init(){
+		initComponents();
+	}
+
+	private void initComponents(){
+		setLayout(new BorderLayout());
+		add(createNorthBaseAttrsPanel(), BorderLayout.NORTH);
+		add(createCenterDataTablePanel(), BorderLayout.CENTER);
+	}
+	/**
+	 * 鏍规嵁绫诲瀷鏄剧ずtable
+	 */
+	private VCIJTablePanel<BaseModel> tablePanel = null;
+	private AbstractVCIJTableDataProvider<BaseModel> dataProvider = null;
+	private VCIJPanel createCenterDataTablePanel() {
+		tablePanel = new VCIJTablePanel<BaseModel>(dataProvider);
+		//tablePanel.setCustomButtons(getCombinedButtons());
+		tablePanel.setShowExport(true);
+		tablePanel.setShowPaging(true);
+		tablePanel.setShowProgressBar(false);
+		tablePanel.setPageButtonFlowAlign(FlowLayout.CENTER);
+		tablePanel.setCustomButtonFlowAlign(FlowLayout.CENTER);
+		tablePanel.buildTablePanel();
+		int columnCount = tablePanel.getTable().getColumnCount();
+		//tablePanel.getTable().getColumnModel().getColumn(columnCount - 2).setPreferredWidth(150);
+		//tablePanel.getTable().getColumnModel().getColumn(columnCount - 4).setPreferredWidth(150);
+		/**
+		 * 绂佹table琛ㄥご鎷栧姩锛岄槻姝㈢涓�鍒楃殑澶嶉�夋鍜岀浜屽垪鐨勫簭鍙锋嫋鍔ㄥ嚭闂:
+		 * 鐐瑰嚮鏌愯锛岃〃鏍间腑鐨勫閫夋鐪嬩笉鍒帮紝涓旈�変腑琛ㄥご涓婄殑澶嶉�夋绯荤粺浼氭姤閿欙紱鏁版嵁淇℃伅鏄剧ず涓嶆纭��
+		 * 2012-12-4 wangxl
+		 */
+		tablePanel.getTable().getTableHeader().setReorderingAllowed(false);
+		tablePanel.refreshTableData();
+		return tablePanel;
+	}
+
+	private VCIJPanel createNorthBaseAttrsPanel(){
+		VCIJPanel palRes = new VCIJPanel(new BorderLayout());
+		if(getCustomTopPanel() != null){
+
+			VCIJPanel pal = new VCIJPanel();
+			pal.setLayout(new GridBagLayout());
+			GridBagConstraints c = new GridBagConstraints();
+			int x = 0;
+			int y = 0;
+
+			c.gridx = x++;
+			c.gridy = y++;
+			c.gridheight = 1;
+			c.gridwidth = 1;
+			c.weightx = 0;
+			c.weighty = 0;
+			c.fill = GridBagConstraints.NONE;
+			c.anchor = GridBagConstraints.EAST;
+			c.insets = new Insets(1, 1, 1, 1);
+			c.ipadx = 1;
+			c.ipady = 1;
+			pal.add(btnSearch, c);
+			c.gridx = x++;
+			pal.add(btnClear, c);
+			palRes.add(pal, BorderLayout.SOUTH);
+			palRes.add(getCustomTopPanel(), BorderLayout.CENTER);
+		}
+		return palRes;
+	}
+
+	public AttarSearchPanel getCustomTopPanel() {
+		return customTopPanel;
+	}
+
+	public void setCustomTopPanel(AttarSearchPanel customTopPanel) {
+		this.customTopPanel = customTopPanel;
+	}
+
+	public VCIJTablePanel<BaseModel> getTablePanel() {
+		return tablePanel;
+	}
+
+	public void setTablePanel(VCIJTablePanel<BaseModel> tablePanel) {
+		this.tablePanel = tablePanel;
+	}
+
+
+	public UIFormRefer getUiFormRefer() {
+		return uiFormRefer;
+	}
+
+	public void setUiFormRefer(UIFormRefer uiFormRefer) {
+		this.uiFormRefer = uiFormRefer;
+	}
+
+	public AbstractVCIJTableDataProvider<BaseModel> getDataProvider() {
+		return dataProvider;
+	}
+
+	public void setDataProvider(AbstractVCIJTableDataProvider<BaseModel> dataProvider) {
+		this.dataProvider = dataProvider;
+	}
+
+	public Map<String, String> getCustomCondtionMap() {
+		if(this.getCustomTopPanel()!=null){
+			Map<String,String> newCustomCondtionMap= this.getCustomTopPanel().getAttrSearchFilterString();
+			customCondtionMap.putAll(newCustomCondtionMap);
+		}
+		return customCondtionMap;
+	}
+
+	public void setCustomCondtionMap(Map<String, String> customCondtionMap) {
+		this.customCondtionMap = customCondtionMap;
+	}
+
+	/**
+	 * 娓呯┖鏉′欢
+	 * <p>Description: </p>
+	 *
+	 * @author liujw
+	 */
+	public void clearCustomTopPanel(){
+		customCondtionMap.clear();
+		AttarSearchPanel search = (AttarSearchPanel)getCustomTopPanel();
+		search.clear();
+	}
+}

--
Gitblit v1.9.3