Index: ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.js
===================================================================
diff -u -r15012 -r15022
--- ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.js (.../printCustomDesign.js) (revision 15012)
+++ ssts-web/src/main/webapp/disinfectsystem/labelTemplateDesign/printCustomDesign.js (.../printCustomDesign.js) (revision 15022)
@@ -1,4 +1,5 @@
- var LODOP; //声明为全局变量
+var currentConfig = null;
+var LODOP; //声明为全局变量
var obj = {};
obj.name = '缝合包';
obj.operator = '张三';
@@ -23,7 +24,7 @@
}
function CreatePage(){
LODOP=getLodop(document.getElementById('LODOP2'),document.getElementById('LODOP_EM2'));
- LODOP.PRINT_INITA(0,0,'50mm','30mm',"小标签");
+ LODOP.PRINT_INITA(0,0,currentConfig.width,currentConfig.height,"小标签");
LODOP.SET_PRINT_MODE("PROGRAM_CONTENT_BYVAR",true);//生成程序时,内容参数有变量用变量,无变量用具体值
LODOP.ADD_PRINT_TEXT(10,50,175,30,"先加的内容");
};
@@ -40,6 +41,14 @@
LODOP.SET_SHOW_MODE("MESSAGE_NOSET_PROPERTY",'不能设置属性,请用打印设计(本提示可修改)!');
LODOP.PRINT_SETUP();
};
+ // 删除所选项
+ function deleteSelectedItems(){
+ LODOP.SET_PRINT_STYLEA('Selected','Deleted',true);
+ }
+ // 插入文本项
+ function insertTextItem(){
+ LODOP.ADD_PRINT_TEXTA('a',0,0,75,30,'文本');
+ }
function Addhtm() {
LODOP.ADD_PRINT_HTM(45,494,288,88,"
\n\n表格11 | \n表格12 | \n表格13 | \n
\n\n表格21 | \n表格22 | \n表格23 | \n
\n
");
};
@@ -82,7 +91,98 @@
};
function prn_Preview() {
LODOP=getLodop(document.getElementById('LODOP1'),document.getElementById('LODOP_EM1'));
+ LODOP.SET_PRINT_MODE("PROGRAM_CONTENT_BYVAR",true);//生成程序时,内容参数有变量用变量,无变量用具体值
eval(document.getElementById('S1').value);
LODOP.PREVIEW();
LODOP=getLodop(document.getElementById('LODOP2'),document.getElementById('LODOP_EM2'));
};
+
+ function cancel() {
+ }
+ function showWindow(id) {
+ formPanel = new Ext4.form.Panel({
+ id : 'configForm',
+ frame : true,
+ labelSeparator : ':',
+ bodyStyle : 'padding:5px 5px 0px 5px;',
+ width : 800,
+
+ renderTo : 'bottomDiv',
+ fieldDefaults : {
+ labelAlign : 'left',
+ labelWidth : 200
+ },
+ items : [ {
+ xtype : 'hidden',
+ id : 'id',
+ name : 'id'
+ } ],
+ tbar : [ {
+ xtype : 'button',
+ text : '删除所选项',
+ handler : function() {
+ deleteSelectedItems();
+ }
+ }, {
+ xtype : 'button',
+ text : '插入文本',
+ handler : function() {
+ insertTextItem();
+ }
+ } ],
+ buttons : [ {
+ id : 'saveBtn',
+ text : '保存',
+ hidden : false,
+ handler : function() {
+ if (formPanel.getForm().isValid()) {
+
+ } else {
+ showResult('请填写表单!');
+ return false;
+ }
+ }
+ }, {
+ text : '取消',
+ id : 'saveAndNewBtn',
+ handler : cancel
+ } ]
+ });
+}
+
+ function loadConfigAndInitDesign(){
+
+ if(!Ext4.isEmpty(id)){
+ top.Ext.MessageBox.wait('正在加载……', '请等待');
+
+ Ext4.Ajax.request({
+ url : WWWROOT + '/disinfectSystem/labelTemplateAction!loadData.do',
+ params : {id : id},
+ success : function(response,options){
+ hideMessageBox(true);
+ var result = Ext4.JSON.decode(response.responseText);
+ if(result.success && result.data){
+// top.Ext4.ComponentQuery.query("#configForm #id")[0].setValue(result.data.id);
+// top.Ext4.ComponentQuery.query("#configForm #name")[0].setValue(result.data.name);
+ currentConfig = result.data;
+// top.Ext4.ComponentQuery.query("#configForm #width")[0].setValue(result.data.width);
+// top.Ext4.ComponentQuery.query("#configForm #height")[0].setValue(result.data.height);
+// top.Ext4.ComponentQuery.query("#configForm #description")[0].setValue(result.data.description);
+// top.Ext4.ComponentQuery.query("#configForm #programCodes")[0].setValue(result.data.programCodes);
+ DisplayDesign();
+ }else{
+ showResult('系统加载出错,请稍候再试');
+ }
+ },
+ failure : function(response, options) {
+ hideMessageBox(true);
+ showResult('系统加载出错,请稍候再试');
+ }
+ });
+ }
+ }
+ Ext4.onReady(function() {
+ Ext4.QuickTips.init();
+ showWindow('');
+ loadConfigAndInitDesign();
+ });