描述

设置表格内数据。

  • 主要用于应用系统自行在自己的系统记录数据,需要展示和打印时使用SetTableData()添加或更新记录单文档数据数据

接口

bool SetTableData(const char* id, const char* tableXmlStr, const char* jsonCfg)
参数名 必填 类型 说明 备注
id string 表格ID,为””时表示当前操作表格
tableXmlStr xml 表格数据XML格式
jsonCfg json 配置数据

tableXmlStr 参数-简化

<Table>
    <Row height='0.800'>
        <Cell width='1.852'>
            <Paragraph>
                2022-09-07
            </Paragraph>
        </Cell>
        <Cell width='0.863'>
            <Paragraph>
                19:20            
            </Paragraph>
        </Cell>
        <Cell width='0.715'>
            <Paragraph>
                36.3            
            </Paragraph>
        </Cell>       
    </Row>
    <Row height='0.800'>
        <Cell width='1.852'>
            <Paragraph>
                2022-09-08
            </Paragraph>
        </Cell>
        <Cell width='0.863'>
            <Paragraph>
                19:20            
            </Paragraph>
        </Cell>
        <Cell width='0.715'>
            <Paragraph>
                36.3            
            </Paragraph>
        </Cell>       
    </Row>
</Table>

tableXmlStr 参数-复杂-任意信息-包括单元格合并

为表格xml数据。

<Table padding='0.026'>
    <Row height='0.000' xCfg='1'>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='1.852' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='10' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />
                <Revise del='L76dT6001' />2022-09-07

                <Revise del='' />
            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.863' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='10' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />19:20

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.715' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />36.3

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.677' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />166

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.423' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />24

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='1.184' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />80/50

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.465' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />1

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.677' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.677' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.634' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.634' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.508' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' /></Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.804' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />96

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.592' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />2

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.508' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />1

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.761' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.973' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.973' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />通畅

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='1.692' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.761' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='1.531' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.761' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='1.073' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='5.660' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='10' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />
                <Space count='5' />
                <Revise del='L76dT6001' />患者因“咳嗽、咳痰20年,再发伴头昏、乏力2天

                <Revise del='' />”于19:19分由家属背入病房,立即通知医生。患者呼之能应,精神差,不能对答,家属诉咳嗽,咳较多白色泡沫痰,伴劳累后胸闷、气促,恶心,患者左侧臀部红肿,面积约5×5cm,触摸感硬,压之患者无反应,右侧红肿,面积约5×5ml,其中破溃面积3×3cm,有散在水泡,压之患者无反应。入院后遵医嘱予内科I级病危护理,予抗炎,化痰


                <Space />,扩容升压,营养心肌细胞,减慢心率等对症支持治疗,予防褥护理,褥疮局部予换药,睡气垫床,入院宣教已做。


                <Space />
            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='1.418' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='10' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />张霞

            </Paragraph>
        </Cell>
    </Row>
    <Row height='0.000' xCfg='1'>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='1.852' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='10' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />2022-09-07

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.863' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='10' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />20:00

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.715' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.677' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />165

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.423' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />21

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='1.184' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />82/56

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.465' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.677' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.677' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.634' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.634' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.508' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' /></Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.804' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />96

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.592' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />2

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.508' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />1

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.761' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.973' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.973' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />通畅

            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='1.692' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.761' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='1.531' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='0.761' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='1.073' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='12' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500' />
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='5.660' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='10' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />
                <Space count='5' />
            </Paragraph>
        </Cell>
        <Cell eCfg='80' gridHeight='0.800' gridBorderWidth='0.026' gridBorderStyle='1' width='1.418' borderWidth='0.026' borderStyle='1'>
            <Paragraph xCfg='10' leftIndent='0.020' rightIndent='0.020' spaceBefore='0.020' spaceAfter='0.020' lineSpaceValue='1.500'>
                <Font size='0.317' fontName='仿宋' backColor='0' />张霞

            </Paragraph>
        </Cell>
    </Row>
</Table>

jsonCfg

字段 类型 说明 备注
mode enum 设置类型 0:替换模式 1:追加模式

返回值

类型 说明 备注
bool 设置是否成功 0:设置失败 1:设置成功

示例代码

使用一个表格数据 填充到护理记录单

 //示例:tableDataMaterial为构造的测试数据,参考tableXmlStr 参数
      let tableXml = tableDataMaterial;
      let jsonCfg = {};
      this.thinkEditor.SetTableData('', tableXml, jsonCfg);

在护理记录单 某行 填入签名图片

step1: 加载签名图片到编辑器并得到图片md5 SetImageResource 或者 SetImageResourceBase64
var md5 = this.thinkEditor.SetImageResource('当前医师电子签名.jpg', signImgData, signImgData.byteLength, {});

step2: 组装 图片片段xml。widt、height、file 都可自定义
    <Image width='2' height='0.8' file='当前医师电子签名.jpg' md5='" + md5 + "'/>


step3: 组装 表格xml时,对应单元格 填入图片片段xml
<Table>
...略
    <Row height='0.800'>
        <Cell width='1.852'>
            <Paragraph>
                <Image width='2' height='0.8' file='当前医师电子签名.jpg' md5='xxxxxxx'/>
            </Paragraph>
        </Cell>
    </Row>
...略
</Table>    
文档更新时间: 2025-03-05 19:58   作者:admin