0.0.4 • Published 4 years ago

qmac-editor-sany v0.0.4

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

富文本编辑器 版本 AcEditorSy

React复杂文本编辑器组件,可插入日期、下拉框、单选框、多选框、单行文本输入框、多行文本输入框、固定字段等常用组件,同时提供文本编辑生成的页面支持动态交互(表单提交)、内容动态替换(设置默认值)和生成水印功能,生成的页面支持前端打印(表格分页带表头、表格横排打印、自定义打印样式)和导出word功能。

如何使用

npm install ac-editor-sany --save
// 文本编辑器组件,内容展示组件, 导出pdf组件,word组件
import { AcEditorSany,AcEditorShow,AcEditorPDF,AcEditorWord } from 'ac-editor-sany';
import 'ac-editor-sany/dist/index.css';

代码演示

API

AcEditorSany API

参数类型默认值说明
editorIdstring必填项文本编辑器唯一id
onReffunction非必须设置ref属性
htmlStringstring""文本编辑器默认字符串
heightstring"0px"文本编辑器默认最小高
fixedDatearray[]支持插入固定字段,参照demo1
defaultDataarray[]默认值替换,替换htmlString 中组件

AcEditorShow API

参数类型默认值说明
editorIdstring必填项展示文本内容组件唯一id
onReffunction非必须设置ref属性
htmlStringstring""展示文本内容
isActivebooleantrue文本内容可交互
defaultDataarray[]文本内容被替换信息
waterMarkerTextstring“”生成水印

AcEditorPDF API

参数类型默认值说明
formInfofunction必填项回调函数,返回值{doc,idList}(要打印的dom,替换值数组)
titlestring/element"打印"打印按钮
tablePageListarray[]指定table 分页打印(id:表格id,rowNum:A4纸上打印多少条记录)
tableRownumber非必须最后一个旋转table 的A4 最多多少行
tableTitleIdstring非必须表标题 例如:"附件一"
tableNoticeIdstring非必须表格备注 例如:"注:xxxx"

AcEditorWord API

参数类型默认值说明
wordIdstring必填项与要导出的 dom id 保持一致
fileNamestring非必须导出word名
wordStylesstring非必须导出word 样式
titlestring/element"导出wrod"导出word按钮
getDefaultInfofunction非必须获取导出默认值
successfunction非必须导出成功回调

fixedDate 参数

参数类型默认值说明
fieldstring必填项固定字段唯一标识
directionstring"horizontal"固定字段布局方向(horizontal,vertical)
datastring""固定字段值(select、checkbox、radio 用 "" 链接)
typestring"text"固定字段类型(text,date,checkbox,radio,select,textarea)
filedTypestring"文本"固定字段中文类型
defaultValuestring""固定字段默认值( checkbox用 "" 链接)

defaultData 参数

参数类型默认值说明
fieldstring必填项分页表格id
directionstring"horizontal"组件布局方向(horizontal,vertical)
datastring""组件值(select、checkbox、radio 用 "" 链接)
typestring"text"组件类型(text,date,checkbox,radio,select,textarea)
defaultValuestring""组件默认值( checkbox用 "" 链接)

tablePageList 参数

参数类型默认值说明
idstring必填项分页表格id
rowNumnumber20分页条数

注意事项

暂无

更新日志