1.4.3 • Published 2 years ago

web-reseditor v1.4.3

Weekly downloads
793
License
-
Repository
-
Last release
2 years ago

编辑器

使用

  • 独立部署直接使用
git clone http://svn.radonline.cn:3888/PACS/web-RSTEditor.git

安装依赖

npm install

启动

npm run dev
  • 依赖使用
npm i web-reseditor

1.0版本稳定版本推荐 1.2.0版本

表格设计器

import { TableDesigner } from 'web-reseditor/index.js'
<TableDesigner ref="tableDesigner"
  :tableTplList="tpls" 
  :extent="extent"
  @saveContent="saveTable"
  @saveEdit="saveEditTable"
  @deleteTableTpl="deleteTableTpl"></TableDesigner>
  • extent 保存模版的扩展字段
[
  key: {
    name: ''// label
    options: [] // length>0时呈现为下拉框,否则呈现为输入框
    option: '' // 绑定值
  }
]
  • tableTplList 历史表格模版 Array []
{
  id - 模版id
  name - 模版名称
  // rels - 关联属性 Object
  tpl - 表格模版字符串
  extend - 业务扩展字段 []
}
  • tableDesigner 触发模版内保存模版事件 通过refs触发 配合saveContent
this.$refs.tableDesigner.getContent()
  • saveContent 事件 新建表格模版保存数据 Object {}
{
  id - 模版id
  name - 模版名称
  rels - 关联属性 Object
  tpl - 表格模版字符串
  index - 坐标
}
  • deleteTableTpl 事件 删除表格模版 Number 返回坐标

  • saveEdit 事件 编辑表格模版保存数据 Object {}

{
  id - 模版id
  name - 模版名称
  <!-- rels - 关联属性 Object -->
  tpl - 表格模版字符串,
  extent - 扩展字段
}

报告设计器

import { Designer } from 'web-reseditor/index.js'
<Designer ref="designer"
  @saveDesignerData="saveDesignerData"
  @saveCustomNotDisplayComps="saveCustomNotDisplayComps"
  :customCompEditable="false"
  :studyData="studyData"
  compId="designer"
  :customComps="customComp"></Designer>
function saveDesignerData(e) {
  // e
  /**
    elements: [],
    fixedHeader: {
      openFixed: false,
      height: 50,
      pageNum: false,
      page: '1'
    },
    fixedFooter: {
      openFixed: false,
      height: 50,
      pageNum: false,
      page: '1'
    },
    name: '',
    pageType: 'a4',
    spCharacters: [],
    script: '',
    customHeight: 297,
    customWidth: 210,
    totalPages: 1,
    backgroundSize: 20,
    width: $config.canvasH5Width > 700 ? $config.canvasH5Width : 700,
    height: $config.canvasH5Height,
    backgroundImage:
  */
}
  • customComp 客户自定义组件 Array
{
  title - 标题
  elName - 对应组件的elname
  type - 分类
  threshold - 阈值
}
  • saveDesignerData 事件 保存设计器整体obj
  • this.$refs.designer.saveDesignerData() 触发设计器保存动作,触发后配合saveDesignerData获取模版内容
  • this.$refs.designer.resetPage(pageData) 设计器导入模版 pageData是原设计器导出的结构,不对非规范obj兼容,无参数时为新建模版,按标准化配置基础参数
  • saveCustomNotDisplayComps 保存用户自定义隐藏的组件
  • studyData 设计脚本提示部分可用于编写脚本的提示文本,str
  • compId 自定义必填 str

编辑器

import { Editor } from 'web-reseditor/index.js'
<Editor ref="editor"
  @updateSpChars="updateSpChars"
  :tpls="tpls"
  @saveEditor="saveEditedPage"></Editor>
  • this.$refs.editor.resetPage(pageData = {}, chars = []) 编辑器导入模版 pageData是原设计器导出的结构,不对非规范obj兼容,chars为特殊字符集[]
  • tpls 表格模版列表,需要符合表格模版设计器保存的规则
  • updateSpChars 编辑器更新特殊字符,返回字符集list
  • saveEditor 保存编辑数据
  • this.$refs.editor.save() 触发编辑器保存,配合saveEditor,saveEditor返回值同设计器的保存方法

和富文本交互

// 追加内容
window['modelId'].reditor['阈值'].edit.appendHtml(str)
// 追加到光标
window['modelId'].reditor['阈值'].edit.insertHtml(str);
// 替换全部内容 可以是字符串或序列化的dom节点
window['modelId'].reditor['阈值'].edit.html(str) 
// 获取内容
window['modelId'].reditor['阈值'].edit.html()
// 获取当前焦点所在的富文本框(有阈值才有)对应阈值
window['modelId'].focusedEditor

和图片选择器交互

// 重置图片列表
window['modelId'].imagePicker['阈值'].resetPics(pics = []) // 传入图片列表
// 删除某几个图片
window['modelId'].imagePicker['阈值'].deletePics(index = []) // 传入要删除的图片下标
// 插入图片到指定位置
window['modelId'].imagePicker['阈值'].insertPics(pics = [], index)

// 在编辑器上拖拽图片或者删除上传
@updateImages="updateImages"  // 监听事件 {返回

updateImages(e) {
  e.threshold // 阈值
  e.fileList // 图片列表
}

外部更改组件的值

this.$refs.editor.updateElement(域值, value, img) // 如果是操作人相关的传入img,签名同步更新

快速编辑模式

适用于和普通编辑模式切换,提出所有富文本部分

<QuickEditor  @reditorChangeed="timingStorage"
              @updateSpChars="updateSpChars"
              :modalId="modalId"></QuickEditor>
  • reditorChangeed 富文本内容变化的回调方法,返回富文本控整个obj
  • updateSpChars 变更特殊字符集合的回调方法,返回字符集arr
  • modalId 当前页面的标识,适配多页场景,可随意定义一个字符串
  • 和普通编辑模式的区别,在控件的域值上会追加'-quick'用于区分,在切换时,需要业务测自行处理

预览

import { Preview } from 'web-reseditor/index.js'
<Preview :tplStr="pageTpl"
  ref="preview"></Preview>
  • pageTpl编辑器导出的模版字符串

版本说明&changelog

  • v1.1.0 第一个稳定版本,适配锐达可配置化结构化报告功能,已上线使用。
  • v1.2.0 第二个稳定版本,增加快速编辑模式
1.4.3

2 years ago

1.4.2

2 years ago

1.4.1

2 years ago

1.4.0

2 years ago

1.3.1

2 years ago

1.3.0

2 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.170

3 years ago

1.0.165

3 years ago

1.0.164

3 years ago

1.0.167

3 years ago

1.0.166

3 years ago

1.0.161

3 years ago

1.0.160

3 years ago

1.0.163

3 years ago

1.0.162

3 years ago

1.0.169

3 years ago

1.0.168

3 years ago

1.0.156

3 years ago

1.0.158

3 years ago

1.0.157

3 years ago

1.0.159

3 years ago

1.0.154

3 years ago

1.0.153

3 years ago

1.0.152

3 years ago

1.0.151

3 years ago

1.0.149

3 years ago

1.0.150

3 years ago

1.0.148

3 years ago

1.0.147

3 years ago

1.0.146

3 years ago

1.0.143

3 years ago

1.0.144

3 years ago

1.0.141

3 years ago

1.0.140

3 years ago

1.0.139

3 years ago

1.0.136

3 years ago

1.0.135

3 years ago

1.0.138

3 years ago

1.0.134

3 years ago

1.0.133

3 years ago

1.0.130

3 years ago

1.0.129

3 years ago

1.0.128

3 years ago

1.0.126

3 years ago

1.0.125

3 years ago

1.0.123

3 years ago

1.0.124

3 years ago

1.0.122

3 years ago

1.0.121

3 years ago

1.0.120

3 years ago

1.0.118

3 years ago

1.0.117

3 years ago

1.0.116

3 years ago

1.0.115

3 years ago

1.0.112

3 years ago

1.0.114

3 years ago

1.0.113

3 years ago

1.0.111

3 years ago

1.0.110

3 years ago

1.0.109

3 years ago

1.0.107

3 years ago

1.0.108

3 years ago

1.0.106

3 years ago

1.0.105

3 years ago

1.0.104

3 years ago

1.0.103

3 years ago

1.0.102

3 years ago

1.0.101

3 years ago

1.0.100

3 years ago

1.0.99

3 years ago

1.0.98

3 years ago

1.0.97

3 years ago

1.0.95

3 years ago

1.0.96

3 years ago

1.0.94

3 years ago

1.0.93

3 years ago

1.0.92

3 years ago

1.0.91

3 years ago

1.0.90

3 years ago

1.0.88

3 years ago

1.0.89

3 years ago

1.0.87

3 years ago

1.0.86

3 years ago

1.0.85

3 years ago

1.0.84

3 years ago

1.0.83

3 years ago

1.0.80

3 years ago

1.0.82

3 years ago

1.0.81

3 years ago

1.0.79

3 years ago

1.0.78

3 years ago

1.0.77

3 years ago

1.0.76

3 years ago

1.0.75

3 years ago

1.0.74

3 years ago

1.0.73

3 years ago

1.0.72

3 years ago

1.0.71

3 years ago

1.0.69

3 years ago

1.0.70

3 years ago

1.0.66

3 years ago

1.0.68

3 years ago

1.0.67

3 years ago

1.0.65

3 years ago

1.0.64

3 years ago

1.0.63

3 years ago

1.0.62

3 years ago

1.0.61

3 years ago

1.0.60

3 years ago

1.0.59

3 years ago

1.0.58

3 years ago

1.0.57

3 years ago

1.0.56

3 years ago

1.0.55

3 years ago

1.0.54

3 years ago

1.0.53

3 years ago

1.0.52

3 years ago

1.0.51

3 years ago

1.0.50

3 years ago

1.0.48

3 years ago

1.0.49

3 years ago

1.0.47

3 years ago

1.0.46

3 years ago

1.0.44

3 years ago

1.0.45

3 years ago

1.0.43

3 years ago

1.0.42

3 years ago

1.0.41

3 years ago

1.0.40

3 years ago

1.0.39

3 years ago

1.0.38

3 years ago

1.0.33

3 years ago

1.0.37

3 years ago

1.0.36

3 years ago

1.0.35

3 years ago

1.0.34

3 years ago

1.0.31

3 years ago

1.0.30

3 years ago

1.0.26

3 years ago

1.0.25

3 years ago

1.0.24

3 years ago

1.0.29

3 years ago

1.0.28

3 years ago

1.0.27

3 years ago

1.0.23

3 years ago

1.0.22

3 years ago

1.0.20

3 years ago

1.0.19

3 years ago

1.0.18

3 years ago

1.0.17

3 years ago

1.0.16

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.12

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.2

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago