@aligov/doc-center-edit

业务化的文档中心组件,是多个业务组件的组合

Usage no npm install needed!

<script type="module">
  import aligovDocCenterEdit from 'https://cdn.skypack.dev/@aligov/doc-center-edit';
</script>

README

文档中心

@aligov/doc-center-edit

业务化的文档中心组件,是多个业务组件的组合

目录树

树节点

参考 Fusion Next 的 Tree 组件 再次基础上扩展了三个配置项 hasAdd, hasDelete, onAdd

{
    label: "xxxx",
    key: "xxx", // 必需唯一
    hasAdd: true, // 是否显示 添加按钮
    hasDelete: true, // 是否显示 删除按钮
    hasEdit: true, // 是否显示 编辑按钮
    isLeaf: true, // 按需加载情况下必填
    children: [], // 子节点 树形结构 非必填
    xxxx: 'xxx', // 其他 Fusion Tree Node 合法的值
}

目录树相关的 API

参数名 说明 必填 类型 默认值 备注
hasTree 是否显示目录树 Boolean true
treeDataSource 用于生成目录树的数据 Array<树节点>
onDelete 删除按钮回调 Function
onEdit 编辑按钮回调 Function
onAdd 添加按钮回调 Function
onSelect 目录树节点选中回调 Function
loadTreeNode 按需加载子节点 Function
treeProps 透传给树的属性 Object {}

文档编辑区

文档数据格式

interface File {
  fileId: string; // 文档ID
  fileName: string; // 文档名
  edit: boolean;
  fileUrl: string; // 文件 地址
  fileContent: string; // 文件内容
  type: string; // 类型
}
参数名 说明 必填 类型 默认值 备注
hasEditor 是否展示编辑器 Boolean true
file 文件数据 File
onSave 文件保存按钮回调 File
fileUploadUrl 文件上传地址 string
fileUploadPrepare 文件上传参数调整函数 Function 本质上是 Fusion Next Upload 中的 beforeUpload 方法
fileUploadResFormatter 上传接口的返回参数 Function 本质上是 Fusion Next Upload 中的 formatter 方法