package com.vci.client.workflow.task;
|
|
import java.awt.BorderLayout;
|
import java.awt.Dimension;
|
import java.awt.FlowLayout;
|
import java.awt.Toolkit;
|
import java.awt.event.ActionEvent;
|
import java.awt.event.ActionListener;
|
import java.util.ArrayList;
|
import java.util.List;
|
|
import javax.swing.JButton;
|
import javax.swing.JComboBox;
|
import javax.swing.JLabel;
|
import javax.swing.JPanel;
|
import javax.swing.JScrollPane;
|
import javax.swing.JTabbedPane;
|
import javax.swing.JTable;
|
import javax.swing.JTextArea;
|
|
import com.vci.client.LogonApplication;
|
import com.vci.client.framework.rightConfig.object.FunctionObject;
|
import com.vci.client.ui.exception.VCIException;
|
import com.vci.client.ui.swing.components.VCIJDialog;
|
import com.vci.client.workflow.commom.ClientHelper;
|
import com.vci.client.workflow.delegate.ProcessCustomClientDelegate;
|
import com.vci.corba.common.VCIError;
|
import com.vci.corba.workflow.data.FlowApproveHistoryInfo;
|
|
/**
|
* 查看流程历史
|
*
|
* @author Administrator
|
*
|
*/
|
public class ViewWorkfolwHistoryByPlatformDialog extends VCIJDialog {
|
|
private static final long serialVersionUID = 1461586100225135416L;
|
|
|
private JTable historyTable;
|
|
private HistoryTableModelByPlatform historyTableModel;
|
|
FunctionObject funcObject = new FunctionObject();
|
|
private String[] executionIds;
|
|
private JButton commit;
|
private JButton cancel;
|
private JComboBox outComeComb;
|
|
|
private String outCome;
|
private String desc;
|
private String[] taskId;
|
|
|
private String[] taskName;
|
|
private boolean saveFlag = false;
|
|
|
private JTextArea descTextArea;
|
|
|
private String[] status;
|
|
public boolean isSaveFlag() {
|
return saveFlag;
|
}
|
|
public void setSaveFlag(boolean saveFlag) {
|
this.saveFlag = saveFlag;
|
}
|
|
public String getOutCome() {
|
return outCome;
|
}
|
|
public void setOutCome(String outCome) {
|
this.outCome = outCome;
|
}
|
|
public String getDesc() {
|
return desc;
|
}
|
|
public void setDesc(String desc) {
|
this.desc = desc;
|
}
|
|
public ViewWorkfolwHistoryByPlatformDialog(String[] executionIds) {
|
super(LogonApplication.frame, true);
|
this.executionIds = executionIds;
|
|
initUI();
|
initData();
|
// this.setLocationRelativeTo(null);
|
}
|
|
private void initData() {
|
ProcessCustomClientDelegate processCustomClientDelegate = new ProcessCustomClientDelegate();
|
// FlowApproveHistoryInfo[] historyActivity = null;
|
List<FlowApproveHistoryInfo> historyActivity = new ArrayList<FlowApproveHistoryInfo>();
|
try {
|
for(String executionId : executionIds){
|
FlowApproveHistoryInfo[] historyActivityByProInsId = processCustomClientDelegate.getHistoryActivityByProInsId(executionId);
|
for(FlowApproveHistoryInfo flowApproveHistoryInfo : historyActivityByProInsId){
|
historyActivity.add(flowApproveHistoryInfo);
|
}
|
}
|
historyTableModel.setData(historyActivity.toArray(new FlowApproveHistoryInfo[]{}));
|
} catch (VCIError e) {
|
e.printStackTrace();
|
}
|
|
}
|
|
private void initUI() {
|
setSize(780, 600);
|
centerToScreen();
|
|
JPanel panel = new JPanel();
|
getContentPane().add(panel, BorderLayout.CENTER);
|
panel.setLayout(new BorderLayout(0, 0));
|
|
JTabbedPane tabbedPane = new JTabbedPane(JTabbedPane.TOP);
|
panel.add(tabbedPane, BorderLayout.CENTER);
|
|
JPanel panel_2 = new JPanel();
|
panel_2.setLayout(null);
|
|
JLabel label = new JLabel("审批:");
|
label.setBounds(72, 33, 36, 15);
|
panel_2.add(label);
|
|
outComeComb = new JComboBox();
|
outComeComb.setBounds(155, 30, 453, 21);
|
panel_2.add(outComeComb);
|
|
JLabel label_1 = new JLabel("审批意见:");
|
label_1.setBounds(61, 124, 60, 74);
|
panel_2.add(label_1);
|
|
JScrollPane scrollPane_1 = new JScrollPane();
|
scrollPane_1.setBounds(155, 86, 453, 143);
|
panel_2.add(scrollPane_1);
|
|
descTextArea = new JTextArea();
|
scrollPane_1.setViewportView(descTextArea);
|
|
JPanel historyPanel = new JPanel();
|
tabbedPane.addTab("流程历史", null, historyPanel, null);
|
historyPanel.setLayout(new BorderLayout(0, 0));
|
|
JScrollPane scrollPane = new JScrollPane();
|
historyPanel.add(scrollPane, BorderLayout.CENTER);
|
|
historyTableModel = new HistoryTableModelByPlatform();
|
historyTable = new JTable(historyTableModel);
|
historyTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
|
scrollPane.setViewportView(historyTable);
|
historyTable.setRowHeight(25);
|
|
|
}
|
|
/**
|
* 居中屏幕
|
*/
|
private void centerToScreen() {
|
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
|
Dimension componentSize = getSize();
|
if (componentSize.height > screenSize.height) {
|
componentSize.height = screenSize.height;
|
}
|
|
if (componentSize.width > screenSize.width) {
|
componentSize.width = screenSize.width;
|
}
|
|
setLocation((screenSize.width - componentSize.width) / 2, (screenSize.height - componentSize.height) / 2);
|
}
|
|
private String getI18nString(String spCode) {
|
return ClientHelper.getI18nStringForWorkflow(this.getClass().getName() + "." + spCode, this.getLocale());
|
}
|
|
private String getI18nStringByCode(String spCode) {
|
return ClientHelper.getI18nStringForWorkflow(spCode, this.getLocale());
|
}
|
}
|