Index: ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.js
===================================================================
diff -u -r15036 -r15071
--- ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.js (.../printCustomDesign.js) (revision 15036)
+++ ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.js (.../printCustomDesign.js) (revision 15071)
@@ -58,7 +58,9 @@
}
function CreatePage() {
getLODOP2();
+// alert(currentConfig.width)
LODOP.PRINT_INITA(0, 0, currentConfig.width, currentConfig.height, "小标签");
+ LODOP.PRINT_INITA(0, 0, '800px', '600px', "小标签");
LODOP.SET_PRINT_MODE("PROGRAM_CONTENT_BYVAR", true);// 生成程序时,内容参数有变量用变量,无变量用具体值
};
function DisplayDesign() {
@@ -68,10 +70,14 @@
// alert(currentConfig.programCodes)
eval(currentConfig.programCodes);// 执行eval方法,装载模板
}
+// LODOP.PRINT_INITA(0, 0, '800px', '600px', "小标签");
+// LODOP.PRINT_INITA(0, 0, '300%', '300%', "小标签");
LODOP.SET_SHOW_MODE("DESIGN_IN_BROWSE", 1);
+// LODOP.SET_SHOW_MODE("HIDE_ITEM_LIST",false);//设置对象列表默认处于关闭状态
+ LODOP.SET_SHOW_MODE("TEXT_SHOW_BORDER",2); //设置字符编辑框默认为无边框
LODOP.SET_SHOW_MODE("SETUP_ENABLESS", "11111111000000");// 隐藏关闭(叉)按钮
- LODOP.SET_SHOW_MODE("HIDE_GROUND_LOCK", true);// 隐藏纸钉按钮
+// LODOP.SET_SHOW_MODE("HIDE_GROUND_LOCK", true);// 隐藏纸钉按钮
LODOP.PRINT_DESIGN();
};
function DisplaySetup() {
@@ -88,6 +94,64 @@
function insertTextItem() {
LODOP.ADD_PRINT_TEXTA('a', 0, 0, 75, 30, '文本');
}
+function testInsertTable(tableConfig){
+ var tableHtml = createTableHtmlByConfig(tableConfig,dataSource1);
+ LODOP.ADD_PRINT_TABLE(0,0,'800px','600px',tableHtml);
+ LODOP.SET_PRINT_STYLEA(0, "ItemType",4);// 多页项
+}
+// 插入表格
+function insertTable() {
+ var tableConfigs = currentConfig.tableConfigs;
+ if(tableConfigs.length > 0){
+ showResult("表格已存在!");
+ return;
+ }
+ var columnAmount = Ext4.getCmp('columnAmount').getValue();
+ var tableConfig = new TableConfig({
+ itemsPerRow: 1,
+ columnAmount: columnAmount,
+ fontConfig: new FontConfig(),
+ borderConfig: new BorderConfig(),
+ tableRowConfigs: []
+ });
+ // 初始化行列配置
+ // 表头
+ var rowConfig = Ext4.create('TableRowConfig',{
+ align: 'center',
+ height: '25',
+ fontConfig: new FontConfig(),
+ borderConfig: new BorderConfig(),
+ type: ROW_TYPE_TABLEHEAD,
+ columnConfigs: []
+ });
+ for(var i=0;i
header: {\n titlePosition: 2,\n titleAlign: "center"\n},\nmaximizable: true,\ntools: [{type: "pin"}],\nclosable: true
'
+ }, {
+ title: 'Another Tab',
+ html: 'Hello world 2'
+ }, {
+ title: 'Closable Tab',
+ html: 'Hello world 3',
+ closable: true
+ }]
+ }, {
+ region: 'east',
+ xtype: 'tabpanel',
+ items: [{
+ // LTR even when example is RTL so that the code can be read
+ rtl: false,
+ title: 'Bogus Tab',
+ html: 'Window configured with:
header: {\n titlePosition: 2,\n titleAlign: "center"\n},\nmaximizable: true,\ntools: [{type: "pin"}],\nclosable: true
'
+ }, {
+ title: 'Another Tab',
+ html: 'Hello world 2'
+ }, {
+ title: 'Closable Tab',
+ html: 'Hello world 3',
+ closable: true
+ }]
+ }]
+ });
+ }
+ tableDesignWindow.show();
+// if (win.isVisible()) {
+// win.hide(this, function() {
+// button.dom.disabled = false;
+// });
+// } else {
+// win.show(this, function() {
+// button.dom.disabled = false;
+// });
+// }
+}
function loadConfigAndInitDesign() {
if (!Ext4.isEmpty(id)) {
@@ -327,6 +587,11 @@
var result = Ext4.JSON.decode(response.responseText);
if (result.success && result.data) {
currentConfig = result.data;
+ if(isUndefinedOrNullOrEmpty(currentConfig.tableConfigs)){
+ currentConfig.tableConfigs = [];
+ }else{
+ currentConfig.tableConfigs = Ext4.JSON.decode(currentConfig.tableConfigs);
+ }
DisplayDesign();
// restoreDesign();
} else {
@@ -344,5 +609,282 @@
Ext4.QuickTips.init();
showWindow('');
+ showTableDesignWindow();
loadConfigAndInitDesign();
});
+
+//function FontConfig(){
+// this.fontStyle = 'normal';
+// this.fontVariant = 'normal';
+// this.fontWeight = 'normal';
+// this.fontSize = '16px';
+// this.fontSizeValue = '16';
+// this.fontSizeUnit = 'px';
+// this.fontFamily = '宋体';
+//}
+//FontConfig.prototype = {
+//
+//}
+Ext4.define("StyleConfig", {
+ getStyleStr: function(){
+ return '';
+ }
+});
+Ext4.define("FontConfig", {
+ fontStyle: 'normal',
+ fontVariant: 'normal',
+ fontWeight: 'normal',
+ fontSize: '16px',
+ fontSizeValue: '16',
+ fontSizeUnit: 'px',
+ fontFamily: '宋体',
+ extend: 'StyleConfig',
+ getStyleStr: function(){
+ return this.fontStyle +' '+ this.fontVariant +' '+ this.fontWeight +' '+ this.fontSize +' '+ this.fontFamily+';';
+ },
+ constructor: function(){
+ this.callParent(arguments);
+ }
+});
+Ext4.define("BorderConfig", {
+ extend: 'StyleConfig',
+ getStyleStr: function(){
+ return this.borderWidth +' '+ this.borderStyle +' '+ this.borderColor+';';
+ },
+ constructor: function(){
+ this.callParent(arguments);
+ this.borderWidth = '1px';
+ this.borderStyle = 'solid';
+ this.borderColor = 'black';
+ }
+});
+Ext4.define("TableColumnConfig", {
+ config:{
+ align: 'center',
+ width: '30%',
+ innerHTML:'',
+ fontConfig: new FontConfig(),
+ borderConfig: new BorderConfig()
+ },
+ constructor: function(config){
+ this.initConfig(config);
+ this.callParent(arguments);
+ },
+ getStyleStr: function(){
+ return this.borderConfig.getStyleStr() + this.fontConfig.getStyleStr();
+ }
+});
+var ROW_TYPE_TABLEHEAD = '表头';
+var ROW_TYPE_TABLEFOOT = '表尾';
+var ROW_TYPE_PAGEHEAD = '页头';
+var ROW_TYPE_PAGEFOOT = '页尾';
+var ROW_TYPE_DATAITEM = '数据项';
+
+
+Ext4.define("TableRowConfig", {
+ config:{
+ align: 'center',
+ height: '25',
+ fontConfig: new FontConfig(),
+ borderConfig: new BorderConfig(),
+ type: ROW_TYPE_DATAITEM,
+ columnConfigs: []
+ },
+ constructor: function(config){
+ this.initConfig(config);
+ this.callParent(arguments);
+ },
+ getStyleStr: function(){
+ return '';
+ },
+ insertColumnConfig: function(columnConfig){
+ this.columnConfigs.push(columnConfig);
+ }
+});
+
+
+Ext4.define("TableConfig", {
+ config:{
+ itemsPerRow: 1,
+ columnAmount:3,
+ fontConfig: new FontConfig(),
+ borderConfig: new BorderConfig(),
+ tableRowConfigs: []
+ },
+ constructor: function(config){
+ this.initConfig(config);
+ this.callParent(arguments);
+ },
+ getTableHeadRowConfig: function(){
+ var heads = [];
+ for(var i=0;i