1.4.3 • Published 3 years ago

web-reseditor v1.4.3

Weekly downloads
793
License
-
Repository
-
Last release
3 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

3 years ago

1.4.2

3 years ago

1.4.1

3 years ago

1.4.0

3 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.2

4 years ago

1.2.1

4 years ago

1.2.0

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.170

4 years ago

1.0.165

4 years ago

1.0.164

4 years ago

1.0.167

4 years ago

1.0.166

4 years ago

1.0.161

4 years ago

1.0.160

4 years ago

1.0.163

4 years ago

1.0.162

4 years ago

1.0.169

4 years ago

1.0.168

4 years ago

1.0.156

4 years ago

1.0.158

4 years ago

1.0.157

4 years ago

1.0.159

4 years ago

1.0.154

4 years ago

1.0.153

4 years ago

1.0.152

4 years ago

1.0.151

4 years ago

1.0.149

4 years ago

1.0.150

4 years ago

1.0.148

4 years ago

1.0.147

4 years ago

1.0.146

4 years ago

1.0.143

4 years ago

1.0.144

4 years ago

1.0.141

4 years ago

1.0.140

4 years ago

1.0.139

4 years ago

1.0.136

4 years ago

1.0.135

4 years ago

1.0.138

4 years ago

1.0.134

4 years ago

1.0.133

4 years ago

1.0.130

4 years ago

1.0.129

4 years ago

1.0.128

4 years ago

1.0.126

4 years ago

1.0.125

4 years ago

1.0.123

4 years ago

1.0.124

4 years ago

1.0.122

4 years ago

1.0.121

4 years ago

1.0.120

4 years ago

1.0.118

4 years ago

1.0.117

4 years ago

1.0.116

4 years ago

1.0.115

4 years ago

1.0.112

4 years ago

1.0.114

4 years ago

1.0.113

4 years ago

1.0.111

4 years ago

1.0.110

4 years ago

1.0.109

4 years ago

1.0.107

4 years ago

1.0.108

4 years ago

1.0.106

4 years ago

1.0.105

4 years ago

1.0.104

4 years ago

1.0.103

4 years ago

1.0.102

4 years ago

1.0.101

4 years ago

1.0.100

4 years ago

1.0.99

4 years ago

1.0.98

4 years ago

1.0.97

4 years ago

1.0.95

4 years ago

1.0.96

4 years ago

1.0.94

4 years ago

1.0.93

4 years ago

1.0.92

4 years ago

1.0.91

4 years ago

1.0.90

4 years ago

1.0.88

4 years ago

1.0.89

4 years ago

1.0.87

4 years ago

1.0.86

4 years ago

1.0.85

4 years ago

1.0.84

4 years ago

1.0.83

4 years ago

1.0.80

4 years ago

1.0.82

4 years ago

1.0.81

4 years ago

1.0.79

4 years ago

1.0.78

4 years ago

1.0.77

4 years ago

1.0.76

4 years ago

1.0.75

4 years ago

1.0.74

4 years ago

1.0.73

4 years ago

1.0.72

4 years ago

1.0.71

4 years ago

1.0.69

4 years ago

1.0.70

4 years ago

1.0.66

4 years ago

1.0.68

4 years ago

1.0.67

4 years ago

1.0.65

4 years ago

1.0.64

4 years ago

1.0.63

4 years ago

1.0.62

4 years ago

1.0.61

4 years ago

1.0.60

4 years ago

1.0.59

4 years ago

1.0.58

4 years ago

1.0.57

4 years ago

1.0.56

4 years ago

1.0.55

4 years ago

1.0.54

4 years ago

1.0.53

4 years ago

1.0.52

4 years ago

1.0.51

4 years ago

1.0.50

4 years ago

1.0.48

4 years ago

1.0.49

4 years ago

1.0.47

4 years ago

1.0.46

4 years ago

1.0.44

4 years ago

1.0.45

4 years ago

1.0.43

4 years ago

1.0.42

4 years ago

1.0.41

4 years ago

1.0.40

4 years ago

1.0.39

4 years ago

1.0.38

4 years ago

1.0.33

4 years ago

1.0.37

4 years ago

1.0.36

4 years ago

1.0.35

4 years ago

1.0.34

4 years ago

1.0.31

4 years ago

1.0.30

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.24

4 years ago

1.0.29

4 years ago

1.0.28

4 years ago

1.0.27

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago