JRT集中打印

之前一直在夯实基础,现在是补demo的时段了。了解过检验集中打印的人知道,集中打印的逻辑有多复杂。既要考虑普通检验报告加上换页。又要考虑微生物报告加上换页,既有A5的报告,也有A4的报告,还要考虑A4打印两个组装A5时候的Y坐标问题。实现起来是超级复杂的,而JRT在本次设计之初就决心整治打印问题,要最大程度的减少打印业务的复杂度。JRT先后提供了容错PAGE、A4Double元素、表格元素、以及封装打印元素绘制协议来解决打印复杂度问题。

集中打印作为打印的综合测试来验证JRT对打印设计的有效性,下图是效果,寥寥几行代码就完成了M时代最令人头大的集中打印效果,这是目前我实现的最强大的打印体系,只为使用JRT的系统提供支持。

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

集中打印的业务后台示例

import JRT.Core.Dto.OutValue;
import JRT.Core.Dto.PrintElement;
import JRT.Core.Util.PrintDrawProtocol;
import JRTBLLBase.BaseHttpHandlerNoSession;
import JRTBLLBase.Helper;
import JRTPrintDraw.JRTPrintDrawProtocol;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;

/**
 * 作为集中打印的示例代码,把之前的打印元素测试、表格测试、模板打印报告测试整合成A4上下打印两个的集中打印,提供强悍的打印整合能力
 */
public class CenterPrintTest extends BaseHttpHandlerNoSession {
    /**
     * 按传入的RowID输出符合打印元素绘制协议的数据来实现打印控制
     *
     * @param RowID   业务主键
     * @param P1
     * @param P2
     * @param P3
     * @param P4
     * @param P5
     * @param P6
     * @param P7
     * @param P8
     * @param P9
     * @param P10
     * @param P11
     * @param P12
     * @param P13
     * @param Session
     * @param Output
     * @return
     */
    public String GetData(String RowID, String P1, String P2, String P3, String P4, String P5, String P6, String P7, String P8, String P9, String P10, String P11, String P12, String P13, OutValue Session, OutValue Output) throws Exception {
        List<PrintElement> retList = new ArrayList<>();
        //标志A4打印两个
        retList.add(PrintDrawProtocol.A4Double(false));

        //打条码最初的打印示例
        String barCodeTestJson=Helper.GetVMData("vm.test.PrintBarCodeTest","GetData",null,Session,Output);
        List<PrintElement> barCodeTestJsonList=Helper.Json2List(barCodeTestJson,PrintElement.class);
        retList.addAll(barCodeTestJsonList);
        //换页
        retList.add(PrintDrawProtocol.ChangePage());

        //打表格最初示例
        String drawGridJson=Helper.GetVMData("vm.test.DrawGrid","GetData",null,Session,Output);
        List<PrintElement> drawGridJsonList=Helper.Json2List(drawGridJson,PrintElement.class);
        retList.addAll(drawGridJsonList);
        //换页
        retList.add(PrintDrawProtocol.ChangePage());

        //用模板打印报告的示例
        String printTemplateTestJson=Helper.GetVMData("vm.test.PrintTemplateTest","GetData",null,Session,Output);
        List<PrintElement> printTemplateTestJsonList=Helper.Json2List(printTemplateTestJson,PrintElement.class);
        retList.addAll(printTemplateTestJsonList);
        //换页
        retList.add(PrintDrawProtocol.ChangePage());

        //返回整合的集中打印
        return Helper.Object2Json(retList);
    }
}

打印元素的测试业务代码

import JRT.Core.Dto.OutParam;
import JRT.Core.Dto.OutValue;
import JRT.Core.Dto.PrintElement;
import JRT.Core.Util.PrintDrawProtocol;
import JRTBLLBase.BaseHttpHandlerNoSession;
import JRTBLLBase.Helper;

import java.awt.*;
import java.util.ArrayList;
import java.util.List;

/**
 * 输出符合打印元素绘制协议的打印元素数据,来供打印执行层打印
 */
public class PrintBarCodeTest extends BaseHttpHandlerNoSession {
    /**
     * 按传入的RowID输出符合打印元素绘制协议的数据来实现打印控制
     *
     * @param RowID   业务主键
     * @param P1
     * @param P2
     * @param P3
     * @param P4
     * @param P5
     * @param P6
     * @param P7
     * @param P8
     * @param P9
     * @param P10
     * @param P11
     * @param P12
     * @param P13
     * @param Session
     * @param Output
     * @return
     */
    public String GetData(String RowID, String P1, String P2, String P3, String P4, String P5, String P6, String P7, String P8, String P9, String P10, String P11, String P12, String P13, OutValue Session, OutValue Output) throws Exception {
        List<PrintElement> retList = new ArrayList<>();
        //控制打印机
        //retList.add(PrintDrawProtocol.ControlPrinter("A5", PrintDrawProtocol.PrintLayout.Portrait,"pdf","",0,0));
        //标志A4打印两个
        //retList.add(PrintDrawProtocol.A4Double(true));
        //打印PDF文件
        //retList.add(PrintDrawProtocol.DrawFile("http://localhost:8080/JRTWeb/FileService/test.pdf"));

        retList.add(PrintDrawProtocol.DrawPDF("http://localhost:8080/JRTWeb/FileService/test.pdf"));

        //换页
        retList.add(PrintDrawProtocol.ChangePage());
        //换页
        retList.add(PrintDrawProtocol.ChangePage());
        //换页
        retList.add(PrintDrawProtocol.ChangePage());

        //页码
        retList.add(PrintDrawProtocol.DrawPageNum(720, 10, "", "宋体", 12, "", null, "", "#fda632", "0"));

        //画logo
        retList.add(PrintDrawProtocol.DrawLabel(420, 10, "http的logn图", "宋体", 22, "", null, "", "#fda632", "0"));
        retList.add(PrintDrawProtocol.DrawGraph(420, 30, 64, 64, "http://localhost:8080/JRTWeb/FileService/logo.png", false, null));

        retList.add(PrintDrawProtocol.DrawLabel(420, 150, "ftp的logn图", "宋体", 12, "", null, "", "#fda632", "0"));
        //retList.add(PrintDrawProtocol.DrawGraph(420,180,64,64,"ftp://zlz:zlz@127.0.0.1:21/ftp.png",false,null));

        //画一个文本
        retList.add(PrintDrawProtocol.DrawLabel(20, 20, "zhanglianzhu", "宋体", 12, "", null, "", "#ff5252", "0"));
        //画一个条码
        retList.add(PrintDrawProtocol.DrawBarCode(20, 50, "0947809", true, 5, 30, "", "宋体", 12, "", null, "", "0"));
        //换一根横线
        retList.add(PrintDrawProtocol.DrawLine(20, 70, 70, 70, 1, "", ""));
        //换一根竖线
        retList.add(PrintDrawProtocol.DrawLine(50, 10, 50, 470, 1, "", ""));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawQRCode(20, 90, "jbase", 90, 90));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawLabel(20, 210, "jbase打印支持", "宋体", 12, "", null, "", "", "0"));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawLabel(20, 230, "20231118 22:49", "宋体", 12, "", null, "", "", "0"));
        //画一个点
        retList.add(PrintDrawProtocol.DrawPoint(20, 270, 10, 10, "o", ""));
        retList.add(PrintDrawProtocol.DrawPoint(100, 270, 10, 10, "[]", ""));
        retList.add(PrintDrawProtocol.DrawPoint(200, 270, 10, 10, "<>", ""));
        //画多边形
        List<Point> pointList = new ArrayList<>();
        Point p1 = new Point();
        p1.x = 10;
        p1.y = 300;
        pointList.add(p1);
        Point p2 = new Point();
        p2.x = 100;
        p2.y = 310;
        pointList.add(p2);
        Point p3 = new Point();
        p3.x = 50;
        p3.y = 360;
        pointList.add(p3);
        retList.add(PrintDrawProtocol.DrawPoly(pointList, ""));
        //画复选框
        retList.add(PrintDrawProtocol.DrawCheckBox(10, 400, true, 30, 30));
        //画单选框
        retList.add(PrintDrawProtocol.DrawRadio(60, 400, true, 30, 30));
        //画复选框
        retList.add(PrintDrawProtocol.DrawCheckBox(110, 400, false, 30, 30));
        //画单选框
        retList.add(PrintDrawProtocol.DrawRadio(160, 400, false, 30, 30));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawLabel(20, 1010, "页尾", "宋体", 12, "", null, "", "", "0"));
        retList.add(PrintDrawProtocol.DrawLabel(20, 900, "A4纸张打印", "宋体", 12, "", null, "", "", "0"));
        retList.add(PrintDrawProtocol.DrawLine(20, 920, 700, 920, 1, "0", ""));
        retList.add(PrintDrawProtocol.DrawLine(20, 940, 700, 940, 1, "1", ""));
        retList.add(PrintDrawProtocol.DrawLine(20, 960, 700, 960, 1, "2", ""));
        retList.add(PrintDrawProtocol.DrawLine(20, 980, 700, 980, 1, "3", ""));
        retList.add(PrintDrawProtocol.DrawLine(20, 1000, 700, 1000, 1, "4", ""));
        //换一根横线
        retList.add(PrintDrawProtocol.DrawLine(20, 1025, 700, 1025, 1, "", ""));

        //换页
        retList.add(PrintDrawProtocol.ChangePage());

        //页码
        retList.add(PrintDrawProtocol.DrawPageNum(520, 10, "", "宋体", 12, "", null, "", "#fda632", "0"));
        //画logo
        retList.add(PrintDrawProtocol.DrawLabel(420, 10, "logn图", "宋体", 12, "", null, "", "", "0"));
        retList.add(PrintDrawProtocol.DrawGraph(420, 20, 64, 64, "http://localhost:8080/JRTWeb/FileService/logo.png", false, null));
        //画一个文本
        retList.add(PrintDrawProtocol.DrawLabel(10, 10, "这是打印的第二页", "宋体", 12, "", null, "", "", "0"));
        //画一个条码
        retList.add(PrintDrawProtocol.DrawBarCode(10, 50, "0947809", true, 5, 30, "", "宋体", 12, "", null, "", "0"));
        //换一根横线
        retList.add(PrintDrawProtocol.DrawLine(10, 70, 70, 70, 1, "", ""));
        //换一根竖线
        retList.add(PrintDrawProtocol.DrawLine(50, 10, 50, 470, 1, "", ""));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawQRCode(10, 90, "jbase", 90, 90));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawLabel(10, 210, "jbase打印支持", "宋体", 12, "", null, "", "", "0"));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawLabel(10, 230, "20231119", "宋体", 12, "", null, "", "", "0"));
        retList.add(PrintDrawProtocol.DrawLabel(20, 500, "A5纸张打印", "宋体", 12, "", null, "", "", "0"));
        //画一根横线
        retList.add(PrintDrawProtocol.DrawLine(20, 525, 700, 525, 1, "", ""));

        //换页
        retList.add(PrintDrawProtocol.ChangePage());
        //页码
        retList.add(PrintDrawProtocol.DrawPageNum(520, 10, "", "宋体", 12, "", null, "", "#fda632", "0"));
        //画logo
        retList.add(PrintDrawProtocol.DrawLabel(420, 10, "logn图", "宋体", 12, "", null, "", "", "0"));
        retList.add(PrintDrawProtocol.DrawGraph(420, 20, 64, 64, "http://localhost:8080/JRTWeb/FileService/logo.png", false, null));
        //画一个文本
        retList.add(PrintDrawProtocol.DrawLabel(10, 10, "这是打印的第三页", "宋体", 12, "", null, "", "", "0"));
        //画一个条码
        retList.add(PrintDrawProtocol.DrawBarCode(10, 50, "0947809", true, 5, 30, "", "宋体", 12, "", null, "", "0"));
        //换一根横线
        retList.add(PrintDrawProtocol.DrawLine(10, 70, 70, 70, 1, "", ""));
        //换一根竖线
        retList.add(PrintDrawProtocol.DrawLine(50, 10, 50, 470, 1, "", ""));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawQRCode(10, 90, "jbase", 90, 90));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawLabel(10, 210, "jbase打印支持", "宋体", 12, "", null, "", "", "0"));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawLabel(10, 230, "20231119", "宋体", 12, "", null, "", "", "0"));
        retList.add(PrintDrawProtocol.DrawLabel(20, 500, "A5纸张打印", "宋体", 12, "", null, "", "", "0"));
        //画一根横线
        retList.add(PrintDrawProtocol.DrawLine(20, 525, 700, 525, 1, "", ""));

        //换页
        retList.add(PrintDrawProtocol.ChangePage());
        //页码
        retList.add(PrintDrawProtocol.DrawPageNum(520, 10, "", "宋体", 12, "", null, "", "#fda632", "0"));
        //画logo
        retList.add(PrintDrawProtocol.DrawLabel(420, 10, "logn图", "宋体", 12, "", null, "", "", "0"));
        retList.add(PrintDrawProtocol.DrawGraph(420, 20, 64, 64, "http://localhost:8080/JRTWeb/FileService/logo.png", false, null));
        //画一个文本
        retList.add(PrintDrawProtocol.DrawLabel(10, 10, "这是打印的第四页", "宋体", 12, "", null, "", "", "0"));
        //画一个条码
        retList.add(PrintDrawProtocol.DrawBarCode(10, 50, "0947809", true, 5, 30, "", "宋体", 12, "", null, "", "0"));
        //换一根横线
        retList.add(PrintDrawProtocol.DrawLine(10, 70, 70, 70, 1, "", ""));
        //换一根竖线
        retList.add(PrintDrawProtocol.DrawLine(50, 10, 50, 470, 1, "", ""));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawQRCode(10, 90, "jbase", 90, 90));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawLabel(10, 210, "jbase打印支持", "宋体", 12, "", null, "", "", "0"));
        //绘制一个条码
        retList.add(PrintDrawProtocol.DrawLabel(10, 230, "20231206", "宋体", 12, "", null, "", "", "0"));
        retList.add(PrintDrawProtocol.DrawLabel(20, 500, "A5纸张打印", "宋体", 12, "", null, "", "", "0"));
        //画一根横线
        retList.add(PrintDrawProtocol.DrawLine(20, 525, 700, 525, 1, "", ""));
        //先包一个打印元素绘制协议数据生成的工具类来解决元素约束问题,工具类实现了调用工具类得到标签,条码,文本等
        return Helper.Object2Json(retList);
    }
}





打印表格的测试业务代码

import JRT.Core.DataGrid.*;
import JRT.Core.Dto.OutValue;
import JRT.Core.Dto.PrintElement;
import JRT.Core.Metrics.DrawMetricsHandler;
import JRT.Core.Util.PrintDrawProtocol;
import JRTBLLBase.BaseHttpHandlerNoSession;
import JRTBLLBase.Helper;

import java.awt.*;
import java.util.*;
import java.util.List;

/**
 * 画表格测试,将要实现一个自动切割和实现换页的表格个业务使用
 */
public class DrawGrid extends BaseHttpHandlerNoSession implements IGridChangePage {
    /**
     * 打印元素
     */
    private List<PrintElement> retList = new ArrayList<>();

    /**
     * 表格换页之前要执行的逻辑
     * @param gridKey
     * @param maxY
     */
    public void PreChangePageDo(String gridKey,int maxY)
    {
        retList.add(PrintDrawProtocol.DrawLabel(20, 10, "这是表格换页之前执行逻辑画的", "宋体", 12, "", null, "", "#fda632", "0"));
    }

    /**
     * 表格换页之后要执行的逻辑
     * @param gridKey
     * @param maxY
     */
    public void AfterChangePageDo(String gridKey,int maxY)
    {
        retList.add(PrintDrawProtocol.DrawLabel(400, 10, "这是表格换页之后执行逻辑画的", "宋体", 12, "", null, "", "#fda632", "0"));
    }

    /**
     * 按传入的RowID输出符合打印元素绘制协议的数据来实现打印控制
     *
     * @param RowID   业务主键
     * @param P1
     * @param P2
     * @param P3
     * @param P4
     * @param P5
     * @param P6
     * @param P7
     * @param P8
     * @param P9
     * @param P10
     * @param P11
     * @param P12
     * @param P13
     * @param Session
     * @param Output
     * @return
     */
    public String GetData(String RowID, String P1, String P2, String P3, String P4, String P5, String P6, String P7, String P8, String P9, String P10, String P11, String P12, String P13, OutValue Session, OutValue Output) throws Exception {

        //这部分由设计器维护的Json得到表格维护信息
        GridDto def = new GridDto();
        //边框宽度
        def.BoderWidth=1;
        //列数
        def.Cols=2;
        //是否左填充
        def.ColsLeftFull=0;
        //第一页控制参数
        GridPageDto page = new GridPageDto();
        //换页行数
        page.ChangePageRowNum=8;
        //顶部
        page.Top=40;
        def.PageList.add(page);

        //第2和后面的页画到500后换页
        page = new GridPageDto();
        //顶部
        page.Top=100;
        //左边
        page.Left=30;
        //换页行数
        page.ChangePageRowNum=8;
        def.PageList.add(page);
        //定义表格的列
        GridColDto col = null;
        //表格列
        for (int i = 0; i < 5; i++) {
            col = new GridColDto();
            col.DataField = "Col" + i;
            col.Width = 75;
            def.DataCol.add(col);
            col = new GridColDto();
            col.DataField = "Col" + i;
            col.Width = 75;
            col.PrintFontStyle="Bold";
            def.HeadCol.add(col);
        }
        List<Object> headDatas=new ArrayList<>();
        //定义表格的标题
        GridDataDto headData = new GridDataDto();
        headData.Col0=PrintDrawProtocol.GetMergeGridStr("合并标题头",1,3);
        headData.Col1="";
        headData.Col2="";
        headData.Col3=PrintDrawProtocol.GetMergeGridStr("合并标题头1",1,2);
        headData.Col4="";
        headDatas.add(headData);
        headData = new GridDataDto();
        headData.Col0="第一列";
        headData.Col1="第二列";
        headData.Col2="第三列";
        headData.Col3="第四列";
        headData.Col4="第五列";
        headDatas.add(headData);
        //这部分由业务打印组装数据
        List<Object> dataList = new ArrayList<>();


        //构造测试数据
        for (int i = 0; i < 21; i++) {
            GridDataDto one = new GridDataDto();
            one.Col0 = "第" + (i+1) + "个数据0列,这是比较长的内容额,会自动换行";
            //合并单元格
            if(i%4==0)
            {
                //one.Col0=PrintDrawProtocol.GetMergeGridStr(one.Col0,2,2);
            }
            one.Col1 = "第" + (i+1) + "个数据1列,这是稍微长的内容";
            one.Col2 = "第" + (i+1) + "个数据2列,this is jrtbase draw grid test for printtemplate";
            one.Col3 = "第" + (i+1) + "个数据3列";
            one.Col4 = "1.这是第一行$r$n2.这是第二行$r$n3.这是第三行";
            dataList.add(one);
        }
        //控制纸张方向
        retList.add(PrintDrawProtocol.ControlPrinter("A4", PrintDrawProtocol.PrintLayout.Portrait,"pdf","",0,0));
        //绘制表格
        int lastY = PrintDrawProtocol.DrawGrid(retList,def, headDatas, dataList,"G1",this);
        return Helper.Object2Json(retList);
    }


    /**
     * 数据实体
     */
    public static class GridDataDto {
        public String Col0;
        public String Col1;
        public String Col2;
        public String Col3;
        public String Col4;
    }
}


模板打印报告的测试业务代码

import JRT.Core.DataGrid.GridDto;
import JRT.Core.DataGrid.IGridChangePage;
import JRT.Core.Dto.HashParam;
import JRT.Core.Dto.OutValue;
import JRT.Core.Dto.PrintElement;
import JRT.Core.Util.Convert;
import JRT.Core.Util.PrintDrawProtocol;
import JRT.Model.Entity.JRTPrintTemplate;
import JRT.Model.Entity.JRTPrintTemplateEle;
import JRTBLLBase.BaseHttpHandlerNoSession;
import JRTBLLBase.Helper;

import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;

/**
 * 调用模板数据来打印,这是一个模拟打印的demo,调用模板数据组装打印数据
 */
public class PrintTemplateTest extends BaseHttpHandlerNoSession implements IGridChangePage {

    /**
     * 打印元素
     */
    private List<PrintElement> retList = new ArrayList<>();

    /**
     * 打印模板数据
     */
    JRTPrintTemplateDto template =null;

    /**
     * 存打印的Data数据
     */
    Hashtable<String, String> printDataMap =null;

    /**
     * 表格换页之前要执行的逻辑
     * @param gridKey
     * @param maxY
     */
    public void PreChangePageDo(String gridKey,int maxY)
    {

    }

    /**
     * 表格换页之后要执行的逻辑
     * @param gridKey
     * @param maxY
     */
    public void AfterChangePageDo(String gridKey,int maxY)
    {
        System.out.println("换页后执行逻辑");
        //画数据元素
        PrintData(template, retList, printDataMap);
        //画标签元素
        PrintLabel(template, retList);
        //画线元素
        PrintLine(template, retList);
    }

    /**
     * 按传入的RowID输出符合打印元素绘制协议的数据来实现打印控制
     *
     * @param RowID   业务主键
     * @param P1
     * @param P2
     * @param P3
     * @param P4
     * @param P5
     * @param P6
     * @param P7
     * @param P8
     * @param P9
     * @param P10
     * @param P11
     * @param P12
     * @param P13
     * @param Session
     * @param Output
     * @return
     */
    public String GetData(String RowID, String P1, String P2, String P3, String P4, String P5, String P6, String P7, String P8, String P9, String P10, String P11, String P12, String P13, OutValue Session, OutValue Output) throws Exception {
        //查询模板数据
        template = GetOneTemplate(null, "JRTReport");
        //存打印的Data数据
        printDataMap = new Hashtable<>();
        printDataMap.put("姓名", "小乌鱼");
        printDataMap.put("性别", "男");
        printDataMap.put("年龄", "32岁");
        printDataMap.put("登记号", "0947809");
        printDataMap.put("检验号", "24011901");
        printDataMap.put("科室", "体检科");
        printDataMap.put("标本", "全血");
        printDataMap.put("床号", "");
        printDataMap.put("诊断", "体检");
        printDataMap.put("采集日期", "2024-01-19");
        printDataMap.put("采集时间", "16:00");
        printDataMap.put("医嘱备注", "体检");
        printDataMap.put("医嘱名称", "血细胞分析五分类");
        printDataMap.put("申请医生", "乌鱼");
        printDataMap.put("申请日期", "2024-01-19");
        printDataMap.put("操作者", "李四");
        printDataMap.put("审核日期", "2024-01-19");
        printDataMap.put("审核时间", "17:00");
        printDataMap.put("审核者", "张三");

        //存打印的图数据
        Hashtable<String, String> printImgMap = new Hashtable<>();
        printImgMap.put("RPC", "http://localhost:8080/JRTWeb/FileService/zlz/logo.png");

        //存项目结果数据
        List<Object> repResList = new ArrayList<>();
        RepResPrintDto oneRes = new RepResPrintDto();
        oneRes.AbFlag = "*";
        oneRes.RefRange = "12-34um/ml";
        oneRes.Result = "50";
        oneRes.Seq = "1";
        oneRes.TestCodeName = "白细胞计数";
        repResList.add(oneRes);
        oneRes = new RepResPrintDto();
        oneRes.AbFlag = "*";
        oneRes.RefRange = "12-34um/ml";
        oneRes.Result = "50";
        oneRes.Seq = "2";
        oneRes.TestCodeName = "红细胞计数";
        repResList.add(oneRes);
        oneRes = new RepResPrintDto();
        oneRes.AbFlag = "";
        oneRes.RefRange = "12-34um/ml";
        oneRes.Result = "33";
        oneRes.Seq = "3";
        oneRes.TestCodeName = "淋巴细胞计数";
        repResList.add(oneRes);
        oneRes = new RepResPrintDto();
        oneRes.AbFlag = "↓";
        oneRes.RefRange = "22-34um/ml";
        oneRes.Result = "5";
        oneRes.Seq = "4";
        oneRes.TestCodeName = "单核细胞计数";
        repResList.add(oneRes);
        oneRes = new RepResPrintDto();
        oneRes.AbFlag = "↓";
        oneRes.RefRange = "22-34um/ml";
        oneRes.Result = "5";
        oneRes.Seq = "5";
        oneRes.TestCodeName = "单核细胞计数";
        repResList.add(oneRes);
        oneRes = new RepResPrintDto();
        oneRes.AbFlag = "↓";
        oneRes.RefRange = "22-34um/ml";
        oneRes.Result = "5";
        oneRes.Seq = "6";
        oneRes.TestCodeName = "单核细胞计数";
        repResList.add(oneRes);
        oneRes = new RepResPrintDto();
        oneRes.AbFlag = "↓";
        oneRes.RefRange = "22-34um/ml";
        oneRes.Result = "5";
        oneRes.Seq = "7";
        oneRes.TestCodeName = "单核细胞计数";
        repResList.add(oneRes);
        oneRes = new RepResPrintDto();
        oneRes.AbFlag = "↓";
        oneRes.RefRange = "22-34um/ml";
        oneRes.Result = "5";
        oneRes.Seq = "8";
        oneRes.TestCodeName = "单核细胞计数";
        repResList.add(oneRes);
        for(int k=9;k<40;k++)
        {
            oneRes = new RepResPrintDto();
            oneRes.AbFlag = "↓";
            oneRes.RefRange = "22-34um/ml";
            oneRes.Result = "5";
            oneRes.Seq = String.valueOf(k);
            oneRes.TestCodeName = "项目"+k;
            repResList.add(oneRes);
        }

        //画图片元素
        PrintImage(template, retList, printImgMap);
        //画数据元素
        PrintData(template, retList, printDataMap);
        //画标签元素
        PrintLabel(template, retList);
        //画线元素
        PrintLine(template, retList);
        //画表格元素
        PrintDataGrid(template, retList, repResList);
        return Helper.Object2Json(retList);
    }

    /**
     * 输出报告结果
     *
     * @param template
     * @param template   模板
     * @param retList    元素列表
     * @param repResList 报告结果列表
     */
    private void PrintDataGrid(JRTPrintTemplateDto template, List<PrintElement> retList, List<Object> repResList) throws Exception {
        for (JRTPrintTemplateEle ele : template.EleList) {
            //输出表格
            if (ele.PrintType.equals("DataGrid")) {
                //得到表格定义
                GridDto defGrid = (GridDto) Helper.Json2Object(ele.PrintText, GridDto.class);
                int lastY = PrintDrawProtocol.DrawGrid(retList, defGrid, null, repResList, "ReportRes", this);
            }
        }
    }

    /**
     * 输出图片
     *
     * @param template
     * @param template     模板
     * @param retList      元素列表
     * @param printDataMap 数据哈希
     */
    private void PrintImage(JRTPrintTemplateDto template, List<PrintElement> retList, Hashtable<String, String> printDataMap) {
        for (JRTPrintTemplateEle ele : template.EleList) {
            //输出图片
            if (ele.PrintType.equals("Graph")) {
                boolean isSign = false;
                if (ele.PrintFlag.equals("D")) {
                    isSign = true;
                }
                String dataField = ele.DataField;
                if (!ele.DataField.isEmpty() && printDataMap.containsKey(ele.DataField)) {
                    dataField = printDataMap.get(ele.DataField);
                }
                PrintElement printEle = PrintDrawProtocol.DrawGraph(ele.PrintX, ele.PrintY, ele.PrintWidth, ele.PrintHeight, dataField, isSign, false);
                retList.add(printEle);
            }
        }
    }

    /**
     * 输出数据
     *
     * @param template     模板
     * @param retList      元素列表
     * @param printDataMap 数据哈希
     */
    private void PrintData(JRTPrintTemplateDto template, List<PrintElement> retList, Hashtable<String, String> printDataMap) {
        for (JRTPrintTemplateEle ele : template.EleList) {
            //输出标签
            if (ele.PrintType.equals("Data")) {
                String dataFiled = ele.DataField;
                if (!dataFiled.isEmpty() && printDataMap.containsKey(dataFiled)) {
                    //带字的条码
                    if (ele.PrintFlag.contains("BarCode")) {
                        String BarType = ele.PrintFlag.replace("BarCode", "");
                        PrintElement printEle = PrintDrawProtocol.DrawBarCode(ele.PrintX, ele.PrintY, printDataMap.get(dataFiled), true, ele.PrintWidth, ele.PrintHeight, BarType, ele.PrintFont, Convert.ToDouble(ele.PrintFontSize).intValue(), ele.PrintFontStyle, PrintDrawProtocol.GetPrintAlignment(ele.PrintAlignment), ele.Color, ele.Angle);
                        retList.add(printEle);
                    }
                    //不带字的条码
                    else if (ele.PrintFlag.contains("BarCodeN")) {
                        String BarType = ele.PrintFlag.replace("BarCodeN", "");
                        PrintElement printEle = PrintDrawProtocol.DrawBarCode(ele.PrintX, ele.PrintY, printDataMap.get(dataFiled), false, ele.PrintWidth, ele.PrintHeight, BarType, ele.PrintFont, Convert.ToDouble(ele.PrintFontSize).intValue(), ele.PrintFontStyle, PrintDrawProtocol.GetPrintAlignment(ele.PrintAlignment), ele.Color, ele.Angle);
                        retList.add(printEle);
                    }
                    //画普通数据
                    else {
                        PrintElement printEle = PrintDrawProtocol.DrawLabel(ele.PrintX, ele.PrintY, printDataMap.get(dataFiled), ele.PrintFont, Convert.ToDouble(ele.PrintFontSize).intValue(), ele.PrintFontStyle, PrintDrawProtocol.GetPrintAlignment(ele.PrintAlignment), ele.Color, "", ele.Angle);
                        retList.add(printEle);
                    }
                }
            }
        }
    }

    /**
     * 输出标签
     *
     * @param template
     * @param retList
     */
    private void PrintLabel(JRTPrintTemplateDto template, List<PrintElement> retList) {
        for (JRTPrintTemplateEle ele : template.EleList) {
            //输出标签
            if (ele.PrintType.equals("Label")) {
                PrintElement printEle = PrintDrawProtocol.DrawLabel(ele.PrintX, ele.PrintY, ele.PrintText, ele.PrintFont, Convert.ToDouble(ele.PrintFontSize).intValue(), ele.PrintFontStyle, PrintDrawProtocol.GetPrintAlignment(ele.PrintAlignment), ele.Color, "", ele.Angle);
                retList.add(printEle);
            }
        }
    }

    /**
     * 输出线
     *
     * @param template
     * @param retList
     */
    private void PrintLine(JRTPrintTemplateDto template, List<PrintElement> retList) {
        for (JRTPrintTemplateEle ele : template.EleList) {
            //输出先
            if (ele.PrintType.equals("ILineN")) {
                int width = ele.PrintWidth;
                int height = ele.PrintHeight;
                int endX = ele.PrintX + width;
                int endY = ele.PrintY;
                int lineWidth = height;
                if (height > width) {
                    endX = ele.PrintX;
                    endY = ele.PrintY;
                    lineWidth = width;
                }
                PrintElement printEle = PrintDrawProtocol.DrawLine(ele.PrintX, ele.PrintY, endX, endY, lineWidth, ele.PrintFlag, ele.Color);
                retList.add(printEle);
            }
        }
    }

    /**
     * 通过模板主键或者代码得到模板数据供打印使用
     *
     * @param rowID
     * @param code
     * @return
     */
    private JRTPrintTemplateDto GetOneTemplate(Integer rowID, String code) throws Exception {
        JRTPrintTemplateDto retDto = null;
        //按主键取
        if (rowID != null) {
            retDto = EntityManager().GetById(JRTPrintTemplateDto.class, rowID);
        }
        //按代码取
        else if (code != null && !code.isEmpty()) {
            retDto = EntityManager().GetByColVal(JRTPrintTemplateDto.class, "Code", code);
        }
        if (retDto != null) {
            HashParam hs = new HashParam();
            hs.Add("PrintTemplateDR", retDto.RowID);
            retDto.EleList = EntityManager().FindAllSimple(JRTPrintTemplateEle.class, hs);
        }
        return retDto;
    }

    /**
     * 存获得的一个模板数据
     */
    public static class JRTPrintTemplateDto extends JRTPrintTemplate {
        /**
         * 模板元素
         */
        public List<JRTPrintTemplateEle> EleList;
    }

    /**
     * 打印的报告结果实体
     */
    public static class RepResPrintDto {
        /**
         * 序号
         */
        public String Seq;

        /**
         * 项目名称
         */
        public String TestCodeName;

        /**
         * 结果
         */
        public String Result;

        /**
         * 标志
         */
        public String AbFlag;

        /**
         * 参考范围
         */
        public String RefRange;
    }
}

界面代码

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <title>JRTPrintTemplateEle供拷贝代码使用</title>
    <link rel="shortcut icon" href="../../resource/common/images/favicon.ico" />
    <script src="../../resource/common/js/JRTBSBase.js" type="text/javascript"></script>
    <script src="../../jrtprint/js/JRTPrint.js" type="text/javascript"></script>
    <script language="javascript" type="text/javascript">
        SYSPageCommonInfo.Init();
        var BasePath = '';
        var ResourcePath = '';
        var WebServicAddress = SYSPageCommonInfo.Data.WebServicAddress;
        var UserDR = SYSPageCommonInfo.Data.Sesssion.UserDR;
        var WorkGroupDR = SYSPageCommonInfo.Data.Sesssion.WorkGroupDR;
        var sysTheme = SYSPageCommonInfo.Data.Sesssion.Theme;
        var SessionStr = SYSPageCommonInfo.Data.SessionStr;
    </script>
    <script type="text/javascript">
        //全局变量
        var me = {
            actionUrl: '../ashx/ashJRTPrintTemplateEle.ashx'
        };

        //jquery入口
        $(function () {
            //导出Excel
            $("#btnExport").click(function () {
                var para = {};
                var tempPath = DealExportExcelTMPName("打印元素.xls");
                JRTBasePrint('Export@' + WebServicAddress + '@vm.test.QryPrintTemplateEle@QryPrintEle@' + JSON.stringify(para) + '@' + SessionStr + '@' + tempPath + '@0');
            });

            //导出Excel多模板
            $("#btnExport1").click(function () {
                var para = {};
                var tempPath = DealExportExcelTMPName("打印元素多模板");
                JRTBasePrint('Export@' + WebServicAddress + '@vm.test.QryPrintTemplateEle@QryPrintEle@' + JSON.stringify(para) + '@' + SessionStr + '@' + tempPath + '@0');
            });

            //导出Excel无模板
            $("#btnExport0").click(function () {
                var para = {};
                var tempPath = "";
                JRTBasePrint('Export@' + WebServicAddress + '@vm.test.QryPrintTemplateEle@QryPrintEle@' + JSON.stringify(para) + '@' + SessionStr + '@' + tempPath + '@0');
            });

            //打印预览
            $("#btnPrintPreview").click(function () {
                //0:打印所有报告 1:循环打印每一份报告
                var printFlag = "0";
                var userCode = "";
                //打印参数
                var paramList = "";
                //PrintOut:打印  PrintPreview打印预览
                var printType = "PrintPreview";
                var printPara = "1";
                var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.PrintBarCodeTest@GetData";
                JRTBasePrint(Param);
            });

            //打印表格
            $("#btnPrintPreviewGrid").click(function () {
                //0:打印所有报告 1:循环打印每一份报告
                var printFlag = "0";
                var userCode = "";
                //打印参数
                var paramList = "";
                //PrintOut:打印  PrintPreview打印预览
                var printType = "PrintOut";
                var printPara = "1";
                var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.DrawGrid@GetData";
                JRTBasePrint(Param);
            });

            //打印报告
            $("#btnPrintReport").click(function () {
                //0:打印所有报告 1:循环打印每一份报告
                var printFlag = "0";
                var userCode = "";
                //打印参数
                var paramList = "";
                //PrintOut:打印  PrintPreview打印预览
                var printType = "PrintOut";
                var printPara = "1";
                var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.PrintTemplateTest@GetData";
                JRTBasePrint(Param);
            });

            //集中打印
            $("#btnCenterPrint").click(function () {
                //0:打印所有报告 1:循环打印每一份报告
                var printFlag = "0";
                var userCode = "";
                //打印参数
                var paramList = "";
                //PrintOut:打印  PrintPreview打印预览
                var printType = "PrintOut";
                var printPara = "1";
                var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.CenterPrintTest@GetData";
                JRTBasePrint(Param);
            });

            //在线预览
            $("#btnPrintPreviewInline").click(function () {
                showwin("#winPrintPreview", "在线打印预览", '../../facade/form/frmJRTPrintDrawView.aspx?PrintDR=' + 1 + '&PrintClassName=vm.test.PrintBarCodeTest', 950, $(window).height() - 20, true, "10px");
            });

            //打印
            $("#btnPrint").click(function () {
                //0:打印所有报告 1:循环打印每一份报告
                var printFlag = "0";
                var userCode = "";
                //打印参数
                var paramList = "";
                //PrintOut:打印  PrintPreview打印预览
                var printType = "PrintOut";
                var printPara = "1";
                var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.PrintBarCodeTest@GetData";
                JRTBasePrint(Param);
            });

            //PDF
            $("#btnPDF").click(function () {
                //0:打印所有报告 1:循环打印每一份报告
                var printFlag = "0";
                var userCode = "";
                //打印参数
                var paramList = "";
                //PrintOut:打印  PrintPreview打印预览
                var printType = "PDF#-1";
                var printPara = "1";
                var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.PrintBarCodeTest@GetData";
                JRTBasePrint(Param);
            });

            //PDF弹窗
            $("#btnPDFSave").click(function () {
                //0:打印所有报告 1:循环打印每一份报告
                var printFlag = "0";
                var userCode = "";
                //打印参数
                var paramList = "";
                //PrintOut:打印  PrintPreview打印预览
                var printType = "PDF#0";
                var printPara = "1";
                var Param = printFlag + "@" + WebServicAddress + "@" + printPara + "@" + userCode + "@" + printType + "@" + paramList + "@vm.test.PrintBarCodeTest@GetData";
                JRTBasePrint(Param);
            });

            //上传文件到文件服务
            $("#btnUpfile").click(function () {
                $("#file_upload").click();
            });
            //改名文件
            $("#btnRenamefile").click(function () {
                //往后台提交数据
                $.ajax({
                    type: "post",
                    dataType: "json",
                    cache: false, //
                    async: true, //为true时,异步,不等待后台返回值,为false时强制等待;-asir
                    url: me.actionUrl + '?Method=ReNameImageFile',
                    success: function (data, status) {
                        $.messager.progress('close');
                        if (!FilterBackData(data)) {
                            return;
                        }
                        alert("成功");
                    }
                });
            });
            //删除文件
            $("#btnDeletefile").click(function () {
                //往后台提交数据
                $.ajax({
                    type: "post",
                    dataType: "json",
                    cache: false, //
                    async: true, //为true时,异步,不等待后台返回值,为false时强制等待;-asir
                    url: me.actionUrl + '?Method=DeleteImageFile',
                    success: function (data, status) {
                        $.messager.progress('close');
                        if (!FilterBackData(data)) {
                            return;
                        }
                        alert("成功");
                    }
                });
            });

            //新增数据点击
            $("#btnAddJRTPrintTemplateEle").click(function () {
                $("#txtJRTPrintTemplateEleRowID").val(""); 
				$('#winEditJRTPrintTemplateEle').window({
                    title: TranslateDataMTHD('Add Data', '新增数据', ''),
                    modal: true
                });
            });


            //修改数据点击
            $("#btnUpdateJRTPrintTemplateEle").click(function () {
				UpdateJRTPrintTemplateEle();
            });

			//修改数据
			function UpdateJRTPrintTemplateEle(row)
			{
                var selectRow = $('#dgJRTPrintTemplateEle').datagrid("getSelected");
                if(row!=null)
                {
                	selectRow=row;
                }
                if (selectRow == null) {
                    $.messager.alert(TranslateDataMTHD('Info', '提示', ''), TranslateDataMTHD('Please select the data to modify', '请选择要修改的数据!', ''), 'info');
                    return;
                }
				$("#formJRTPrintTemplateEle").form('load', selectRow);
				$('#winEditJRTPrintTemplateEle').window({
                    title: TranslateDataMTHD('Update Data', '修改数据', ''),
                    modal: true
                });
			}



            //删除数据点击
            $("#btnDeleteJRTPrintTemplateEle").click(function () {
                var checkRow = $('#dgJRTPrintTemplateEle').datagrid("getChecked");
                var selectRow = $('#dgJRTPrintTemplateEle').datagrid("getSelected");
                if ((checkRow == null || checkRow.length == 0)&&selectRow==null) {
                    $.messager.alert(TranslateDataMTHD('Info', '提示', ''), TranslateDataMTHD('Please select the data to delete', '请勾选要删除的数据!', ''), 'info');
                    return;
                }
                if ((checkRow == null || checkRow.length == 0)) {
                    checkRow=[selectRow];
                }
                var RowIDS = "";
                for (var i = 0; i < checkRow.length; i++) {
                    if (i == 0) {
                        RowIDS = checkRow[i].RowID;
                    }
                    else {
                        RowIDS += "^" + checkRow[i].RowID;
                    }
                }
                $.messager.confirm(TranslateDataMTHD('Info', '提示', ''), TranslateDataMTHD('Do you want to delete the selected data', '是否要删除选择的数据?', '') , function (r) {
                    if (r) {
                		//开启等待
                		$.messager.progress({ text: TranslateDataMTHD("Deleting data","正在删除数据", ""), interval: 500 });
                		setTimeout(function () {
                    		$.messager.progress('close');
                		}, 8000);
                		//往后台提交数据
                		$.ajax({
                    		type: "post",
                    		dataType: "json",
                    		cache: false, //
                    		async: true, //为true时,异步,不等待后台返回值,为false时强制等待;-asir
                    		url: me.actionUrl + '?Method=DeleteJRTPrintTemplateEle',
                    		data: { RowIDS: RowIDS },
                    		success: function (data, status) {
                        		$.messager.progress('close');
                        		if (!FilterBackData(data)) {
                            		return;
                        		}
                        		if (!data.IsOk) {
                            		$.messager.alert(TranslateDataMTHD("Error message", "错误提示", ""), TranslateDataMTHD("failed to dalete data, error message:", "删除失败,错误信息:", "") + data.Message);
                        		}
                        		else {
                            		QryJRTPrintTemplateEle();
                            		$.messager.show({
                                		title: TranslateDataMTHD("Info", "提示", ""),
                               		 	msg: TranslateDataMTHD("Successfully deleted!", "删除成功!", ""),
                                		timeout: 500,
                                		showType: 'slide'
                            		});
                        		}
                    		}
                		});
                    }
                });
            });


            //保存数据
            $("#btnSaveJRTPrintTemplateEle").click(function () {
                var saveData = jQuery.parseJSON($("#formJRTPrintTemplateEle").serializeObject());
                //开启等待
                $.messager.progress({ text: TranslateDataMTHD("Saving data","正在保存数据", ""), interval: 500 });
                setTimeout(function () {
                    $.messager.progress('close');
                }, 8000);
                //往后台提交数据
                $.ajax({
                    type: "post",
                    dataType: "json",
                    cache: false, //
                    async: true, //为true时,异步,不等待后台返回值,为false时强制等待;-asir
                    url: me.actionUrl + '?Method=SaveJRTPrintTemplateEle',
                    data: saveData,
                    success: function (data, status) {
                        $.messager.progress('close');
                        if (!FilterBackData(data)) {
                            return;
                        }
                        if (!data.IsOk) {
                            $.messager.alert(TranslateDataMTHD("Error message", "错误提示", ""), TranslateDataMTHD("failed to dalete data, error message:", "删除失败,错误信息:", "") + data.Message);
                        }
                        else {
                            QryJRTPrintTemplateEle();
                            $.messager.show({
                                title: TranslateDataMTHD("Info", "提示", ""),
                                msg: TranslateDataMTHD("Successfully saveed!", "保存成功!", ""),
                                timeout: 500,
                                showType: 'slide'
                            });
                            $('#winEditJRTPrintTemplateEle').window("close");
                        }
                    }
                });
            });


            //关闭窗口
            $("#btnCloseJRTPrintTemplateEle").click(function () {
				$('#winEditJRTPrintTemplateEle').window("close");
            });


            //构造查询事件
            $("#txtFilterJRTPrintTemplateEle").searchbox({
                searcher: function (value, name) {
                    QryJRTPrintTemplateEle();
                },
                prompt: TranslateDataMTHD('Enter query', '回车查询', '')
            });



            //模板下拉表格渲染
            $('#txtJRTPrintTemplateElePrintTemplateDR').combogrid({
                panelWidth: 350,
                idField: 'RowID',
                width: 205,
                textField: 'CName',
                url: me.actionUrl + '?Method=CommonQueryView&data='+JSON.stringify({ ModelName: "JRTPrintTemplate", Pram: [], IsDisplayCount: false, Joiner: [], Operators: [] }),
                columns: [[
                    { field: 'RowID', title: '主键', width: 60 },
                    { field: 'CName', title: '名称', width: 260 }
                ]]
            });
            $('#txtJRTPrintTemplateElePrintTemplateDR').combogrid("showSelectWin");

            //JRTPrintTemplateEle表格
            $('#dgJRTPrintTemplateEle').datagrid({
                remoteSort:false,
                singleSelect: true,
                toolbar: "#dgJRTPrintTemplateEleToolBar",
                fit: true,
                onSelect: function (index, row) {
                    //方便拷贝到子表查询用
                	var selectJRTPrintTemplateEle=$('#dgJRTPrintTemplateEle').datagrid("getSelected");
                },
                onDblClickRow: function (index, row) {
                    UpdateJRTPrintTemplateEle(row);
                },

                columns: [[
                    { field: 'ChkFlag', title: TranslateDataMTHD('Check', '选择', ''), width: 20, sortable: true, align: 'center', checkbox: true },
                    { field: 'RowID', title: TranslateDataMTHD('RowID', '主键', '') , width: 150, sortable: true },
                    { field: 'PrintTemplateDRName', title: TranslateDataMTHD('PrintTemplateDRName', '模板', '') , width: 150, sortable: true },
                    { field: 'PrintType', title: TranslateDataMTHD('PrintType', '元素类型', '') , width: 150, sortable: true },
                    { field: 'PrintX', title: TranslateDataMTHD('PrintX', 'X坐标', '') , width: 150, sortable: true },
                    { field: 'PrintY', title: TranslateDataMTHD('PrintY', 'Y坐标', '') , width: 150, sortable: true },
                    { field: 'PrintFont', title: TranslateDataMTHD('PrintFont', '打印字体', '') , width: 150, sortable: true },
                    { field: 'PrintFontSize', title: TranslateDataMTHD('PrintFontSize', '打印字体大小', '') , width: 150, sortable: true },
                    { field: 'PrintFontStyle', title: TranslateDataMTHD('PrintFontStyle', '打印字体样式', '') , width: 150, sortable: true },
                    { field: 'PrintLength', title: TranslateDataMTHD('PrintLength', '打印长度', '') , width: 150, sortable: true },
                    { field: 'PrintWidth', title: TranslateDataMTHD('PrintWidth', '元素宽度', '') , width: 150, sortable: true },
                    { field: 'PrintHeight', title: TranslateDataMTHD('PrintHeight', '元素高度', '') , width: 150, sortable: true },
                    { field: 'PrintText', title: TranslateDataMTHD('PrintText', '元素文本', '') , width: 150, sortable: true },
                    { field: 'DataField', title: TranslateDataMTHD('DataField', '绑定属性', '') , width: 150, sortable: true },
                    { field: 'PrintFlag', title: TranslateDataMTHD('PrintFlag', '特殊标志', '') , width: 150, sortable: true },
                    { field: 'PrintAlignment', title: TranslateDataMTHD('PrintAlignment', '停靠方向', '') , width: 150, sortable: true },
                    { field: 'LayOut', title: TranslateDataMTHD('LayOut', '布局方式', '') , width: 150, sortable: true },
                    { field: 'Angle', title: TranslateDataMTHD('Angle', '旋转角度', '') , width: 150, sortable: true },
                    { field: 'IsVShow', title: TranslateDataMTHD('IsVShow', '是否垂直显示', '') , width: 150, sortable: true },
                    { field: 'Color', title: TranslateDataMTHD('Color', '颜色', '') , width: 150, sortable: true },
                    { field: 'FixedReport', title: TranslateDataMTHD('FixedReport', '固定元素', '') , width: 150, sortable: true }
                ]]
            });


            //查询JRTPrintTemplateEle
            function QryJRTPrintTemplateEle() {
                var Filter = $("#txtFilterJRTPrintTemplateEle").searchbox("getValue");
                //开启等待,默认注释,在单击事件调用的逻辑启用等待会冲掉双击事件,按需要开启
                //$.messager.progress({ text: TranslateDataMTHD("Querying data","正在查询数据", ""), interval: 500 });
                //setTimeout(function () {
                    //$.messager.progress('close');
                //}, 8000);
                $.ajax({
                    type: "post",
                    dataType: "json",
                    cache: false, //
                    async: true, //为true时,异步,不等待后台返回值,为false时强制等待;-asir
                    url: me.actionUrl + '?Method=QryJRTPrintTemplateEle',
                    data: { Filter: Filter },
                    success: function (data, status) {
                        //结束等待
                        //$.messager.progress('close');
                        if (!FilterBackData(data)) {
                           return;
                        }
                        $('#dgJRTPrintTemplateEle').datagrid("loadData", data);
                    }
                });
            };


            //执行查询数据
            QryJRTPrintTemplateEle();


		});
    </script>
</head>
<body>
    <div class="easyui-layout" fit="true" style="border: none;">
        <div data-options="region:'center',title:''" style="border: none;">
            <div id="dgJRTPrintTemplateEleToolBar" style="padding: 3px 0px 3px 10px;">
                <a id="btnAddJRTPrintTemplateEle" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-add'" plain="true" listranslate="html~Add">新增</a>
                <a id="btnUpdateJRTPrintTemplateEle" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-write-order'" plain="true" listranslate="html~Mod">修改</a>
                <a id="btnDeleteJRTPrintTemplateEle" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" plain="true" listranslate="html~Del">删除</a>
                <input id="txtFilterJRTPrintTemplateEle" style="margin-left: 14px; width: 240px;"></input>
                <a id="btnExport" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-excel'" plain="true" listranslate="html~Export">导出</a>
                <a id="btnExport1" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-excel'" plain="true" listranslate="html~Export">导出多模板</a>
                <a id="btnExport0" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-excel'" plain="true" listranslate="html~Export">导出无模板</a>
                <a id="btnPrintPreview" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~PrintPreview">打印预览</a>
                <a id="btnPrintPreviewInline" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~PrintPreview">在线预览</a>
                <a id="btnPrint" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~Print">打印</a>
                <a id="btnPDF" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~PDF">PDF</a>
                <a id="btnPDFSave" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~PDF">PDF弹</a>
                <a id="btnPrintPreviewGrid" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~PrintGrid">打表格</a>
                <a id="btnPrintReport" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~PrintReport">打报告</a>
                <a id="btnCenterPrint" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-print'" plain="true" listranslate="html~CenterPrint">集中打印</a>
                <a id="btnUpfile" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-file'" plain="true" listranslate="html~File">上传文件</a>
                <a id="btnRenamefile" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-file'" plain="true" listranslate="html~File">改名</a>
                <a id="btnDeletefile" href="#" class="easyui-linkbutton" data-options="iconCls:'icon-file'" plain="true" listranslate="html~File">删除</a>
            </div>
            <table id="dgJRTPrintTemplateEle" title="" iconcls="icon-paper" listranslate="title~JRTPrintTemplateEle"></table>
        </div>
        <div id="winEditJRTPrintTemplateEle" style="padding: 10px 0px 0px 10px;width:1140px;height:366.6666666666666667px;display: none;">
            <form id="formJRTPrintTemplateEle" name="edit_form" method="post">
                <input type="hidden" id="txtJRTPrintTemplateEleRowID" name="RowID" value="0" />
                <table>
                    <tr>
                        <td class="lisar" jrttranslate="html~PrintTemplateDR">模板</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintTemplateDR" type="text" name="PrintTemplateDR" style="width:200px;"/></td>
                        <td class="lisar" jrttranslate="html~PrintType">元素类型</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintType" type="text" name="PrintType" style="width:200px;" class="easyui-validatebox"  maxlength="20"/></td>
                        <td class="lisar" jrttranslate="html~PrintX">X坐标</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintX" type="text" name="PrintX" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td>
                    </tr>
                    <tr>
                        <td class="lisar" jrttranslate="html~PrintY">Y坐标</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintY" type="text" name="PrintY" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td>
                        <td class="lisar" jrttranslate="html~PrintFont">打印字体</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintFont" type="text" name="PrintFont" style="width:200px;" class="easyui-validatebox"  maxlength="20"/></td>
                        <td class="lisar" jrttranslate="html~PrintFontSize">打印字体大小</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintFontSize" type="text" name="PrintFontSize" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td>
                    </tr>
                    <tr>
                        <td class="lisar" jrttranslate="html~PrintFontStyle">打印字体样式</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintFontStyle" type="text" name="PrintFontStyle" style="width:200px;" class="easyui-validatebox"  maxlength="20"/></td>
                        <td class="lisar" jrttranslate="html~PrintLength">打印长度</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintLength" type="text" name="PrintLength" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td>
                        <td class="lisar" jrttranslate="html~PrintWidth">元素宽度</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintWidth" type="text" name="PrintWidth" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td>
                    </tr>
                    <tr>
                        <td class="lisar" jrttranslate="html~PrintHeight">元素高度</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintHeight" type="text" name="PrintHeight" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td>
                        <td class="lisar" jrttranslate="html~PrintText">元素文本</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintText" type="text" name="PrintText" style="width:200px;" class="easyui-validatebox"  maxlength="2000"/></td>
                        <td class="lisar" jrttranslate="html~DataField">绑定属性</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateEleDataField" type="text" name="DataField" style="width:200px;" class="easyui-validatebox"  maxlength="500"/></td>
                    </tr>
                    <tr>
                        <td class="lisar" jrttranslate="html~PrintFlag">特殊标志</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintFlag" type="text" name="PrintFlag" style="width:200px;" class="easyui-validatebox"  maxlength="50"/></td>
                        <td class="lisar" jrttranslate="html~PrintAlignment">停靠方向</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateElePrintAlignment" type="text" name="PrintAlignment" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td>
                        <td class="lisar" jrttranslate="html~LayOut">布局方式</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateEleLayOut" type="text" name="LayOut" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td>
                    </tr>
                    <tr>
                        <td class="lisar" jrttranslate="html~Angle">旋转角度</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateEleAngle" type="text" name="Angle" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td>
                        <td class="lisar" jrttranslate="html~IsVShow">是否垂直显示</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateEleIsVShow" type="text" name="IsVShow" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td>
                        <td class="lisar" jrttranslate="html~Color">颜色</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateEleColor" type="text" name="Color" style="width:200px;" class="easyui-validatebox"  maxlength="30"/></td>
                    </tr>
                    <tr>
                        <td class="lisar" jrttranslate="html~FixedReport">固定元素</td>
                        <td class="lisal"><input id="txtJRTPrintTemplateEleFixedReport" type="text" name="FixedReport" style="width:200px;" class="easyui-validatebox"  maxlength="10"/></td>
                </table>
                <div region="south" border="fale" style="text-align: center; padding: 5px 0 0;">
                    <a id="btnSaveJRTPrintTemplateEle" href="#" class="easyui-linkbutton" plain="false" listranslate="html~Save">保存</a>
                    <span class="sp6"></span>
                    <a id="btnCloseJRTPrintTemplateEle" href="#" class="easyui-linkbutton" plain="false" listranslate="html~Cancel">取消</a>
                </div>
            </form>
        </div>
        <div id="winPrintPreview" style="padding: 10px 0px 0px 10px; width: 1140px; height: 786px; display: none;">
        </div>
</body>
</html>


通过最近的实践发现逻辑强悍还是赶不上设计强悍,想想以前用M写打印怪考验逻辑的

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/342781.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

小程序学习-21

目前小程序分包大小有以下限制&#xff1a; 整个小程序所有分包大小不超过 20M单个分包/主包大小不能超过 2M 独立分包&#xff1a;"independent": true

书生·浦语大模型实战营-学习笔记5

LMDeploy 大模型量化部署实践 大模型部署背景 LMDeploy简介 轻量化、推理引擎、服务 核心功能-量化 显存消耗变少了 大语言模型是典型的访存密集型任务&#xff0c;因为它是decoder-by-decoder 先把数据量化为INT4存起来&#xff0c;算的时候会反量化为FP16 AWQ算法&a…

windows资源管理器占用过高CPU的问题

最近&#xff0c;笔者的电脑在进行文件操作时变得异常的卡顿&#xff0c;打开任务管理器发现windows资源管理器占用了50%-80%的CPU。这里指的文件操作包括但不限于解压&#xff0c;复制&#xff0c;粘贴&#xff0c;甚至重命名一个文件夹都会引起50%的CPU占用。起初笔者认为可能…

缓解Spring Core的“Spring4Shell”零日漏洞

一、概述 2022年3月30日&#xff0c;安全社区广泛注意到Spring&#xff08;一种流行的开源Java框架&#xff09;爆出的一个漏洞。Akamai自适应安全引擎第一时间检测到基于该漏洞发起的零日攻击&#xff0c;为Akamai客户提供了保护。 该漏洞的披露时间线以及其他通过非正式方式…

docker报错 missing signature key 无法拉去镜像,yum install docker-ce没有可用软件包 解决办法

错误场景描述 今天项目需要用到minio&#xff0c;我打算在虚拟机中使用docker装一个&#xff0c;可是发现当我docker pull minio/minio的时候&#xff0c;报错了missing signature key 这个报错提示的让人很蒙&#xff0c;翻译过来的意思是 “缺少签名密钥” &#xff1f;&am…

大小鼠行为刺激-ZL-034B大小鼠跳台仪/多通道跳台记录仪

小鼠跳台实验是一种常用的学习记忆实验方法&#xff0c;它基于条件反射原理&#xff0c;通过观察小鼠在电栅和平台之间跳跃的行为&#xff0c;来研究药物对学习和记忆过程的影响。它适用于各种增智健脑、提高记忆、抗衰老药物和保健品筛选、开发研制。它是初筛药物的理想工具&a…

完美调试android-goldfish(linux kernel) aarch64的方法

环境要求 Mac m1Mac m1 中 虚拟机安装aarch64 ubuntu22.02Mac m1安装OrbStack&#xff0c;并在其中安装 ubuntu20.04&#xff08;x86_64&#xff09; 构建文件系统 在虚拟机 aarch64 ubuntu22.02中构建 安装必要的库 sudo apt-get install libncurses5-dev build-essenti…

C++ | 六、栈 Stack、队列 Queue

栈的基础知识 栈&#xff08;stack&#xff09;是一种数据结构&#xff0c;在C中属于STL&#xff08;标准库&#xff09;特点&#xff1a;先进后出 栈的使用&#xff1a; 一、引入头文件<stack>二、创建栈变量&#xff08;类似容器、集合的创建方式&#xff09;&#xf…

前端项目对接protobufjs的时候,踩坑总结

Protobuf&#xff08;Protocol Buffers&#xff09;是一种用于序列化结构化数据的语言无关、平台无关、可扩展的机制。在JS/TS项目中&#xff0c;使用WebSocket与Protobuf可以实现高效的通信和数据传输。protobufjs官方仓库:https://github.com/protobufjs/protobuf.js 安装pro…

户用光伏市场前景如何?

户用光伏市场前景广阔&#xff0c;随着人们对环保和能源利用的关注度不断提高&#xff0c;家庭光伏发电系统也越来越受到欢迎。国家对新能源的支持力度不断加大&#xff0c;政策扶持、电价补贴等措施进一步推动了户用光伏的发展。同时&#xff0c;技术的不断创新和产业链的日益…

在 Linux 上搭建 Java 环境

目录 一、安装jdk 1. 挑选 jdk 版本 2. 安装 3. 验证 jdk 二、安装tomcat 1. 下载压缩包 2. 上传压缩包给 Linux &#xff08;需要用到 rz 命令&#xff09; 3. 解压压缩包&#xff08;需要用到 unzip&#xff09; 4. 进入 bin 目录 5. 给启动脚本增加可执行权限 6. 启…

关于 GPT,你知道多少?

GPT GPT&#xff0c;全称为Generative Pre-Trained Transformer&#xff08;生成式预训练Transformer模型&#xff09;&#xff0c;是一种基于互联网的、可用数据来训练的、文本生成的深度学习模型。GPT的目标是生成自然语言文本&#xff0c;并能够通过机器学习算法进行自我改…

51单片机-电子密码锁

实物演示效果&#xff1a; https://www.bilibili.com/video/BV1xh4y1K7uV/?vd_source6ff7cd03af95cd504b60511ef9373a1d 电子密码锁的主要功能 1.按键设置6位密码&#xff0c;输入密码若密码正确&#xff0c;则锁打开。显示open&#xff01; 2.密码可以自己修改&#xff0…

最新热门商用GPT4.0带MJ绘画去授权版本自定义三方接口(开心版)

一台VPS 搭建宝塔 解析域名 上传程序至根目录 访问首页在线安装配置数据库 PHP版本选择:7.3 安装完成后访问网站首页即可&#xff01; 配置APIKEY&#xff0c;登录网站后台自定义配置&#xff0c;不然网站无法使用&#xff01; 网站后台地址/admin 默认账号:admin 密码…

32、WEB攻防——通用漏洞文件上传二次渲染.htaccess变异免杀

文章目录 一、点过滤二、文件删除三、二次渲染四、.htaccess五、过滤php关键函数 一、点过滤 不能写带文件后缀的文件名&#xff1b;IP转数字 二、文件删除 文件依据规则进行删除&#xff0c;删除有两种删除的类型&#xff1a; 什么文件都删除&#xff0c;条件竞争进行绕过…

【CentOS】Linux 在线帮助文档命令:help、man 命令与文档汉化

目录 1、Linux 的命令行模式 2、help 命令 3、man 命令 4、man 命令输出文档汉化 注&#xff1a;本文档使用 Linux 版本为 CentOS 7.9 [swadianlocalhost ~]$ cat /etc/centos-release CentOS Linux release 7.9.2009 (Core) 1、Linux 的命令行模式 一般情况下&#xff0…

鸿蒙应用开发学习:获取手机位置信息

一、前言 移动应用中经常需要获取设备的位置信息&#xff0c;因此在鸿蒙应用开发学习中&#xff0c;如何获取手机的位置信息是必修课。之前我想偷懒从别人那里复制黏贴代码&#xff0c;于是在百度上搜了一下&#xff0c;可能是我输入的关键字不对&#xff0c;结果没有找到想要…

【云原生】初识Docker,安装以及了解操作命令

一、为什么要使用容器&#xff1f; 背景&#xff1a;以前开发、测试、生产为不同的环境&#xff0c;痛点是发现开发测试以后没问题&#xff0c;但是在生产环境无法运行。给测试、开发、运维人员造成了大量的工作。最终结果是发版更新速度也跟不上&#xff0c;效率低 我认为使…

java SSM自助快递服务平台myeclipse开发mysql数据库springMVC模式java编程计算机网页设计

一、源码特点 java SSM自助快递服务平台是一套完善的web设计系统&#xff08;系统采用SSM框架进行设计开发&#xff0c;springspringMVCmybatis&#xff09;&#xff0c;对理解JSP java编程开发语言有帮助&#xff0c;系统具有完整的源代 码和数据库&#xff0c;系统主要采…

mysql 导入数据 1273 - Unknown collation: ‘utf8mb4_0900_ai_ci‘

前言: mysql 导入数据 遇到这个错误 1273 - Unknown collation: utf8mb4_0900_ai_ci 具体原因没有深究 但应该是设计数据库的 字符集类型会出现这个问题 例如: char varchar text..... utf8mb4 类型可以存储表情 在现在这个时代会用很多 以后会用的更多 所以不建议改…