1.0.12 • Published 1 year ago

yyuap-historylog v1.0.12

Weekly downloads
42
License
-
Repository
-
Last release
1 year ago

欢迎使用 业务历史变更组件

组件能力

提供业务日志历史查看与比较能力 提供json查看与对比能力

使用方法

组件形式

import historyLog,{jsonViewer,jsonViewerCompare} from "yyuap-historylog"
import "yyuap-historylog/dist/main.css" // 记得引样式 ^_^
<div>
    <button onClick={()=>historyLog({locale:'zh_CN',record})}>
     查看业务历史
    </button>
    <button onClick={()=>jsonViewer({locale:'en_US',title,json})}>
      查看JSON
    </button> 
    <button onClick={()=>jsonViewerCompare({locale:'zh_CN',leftTitle,leftJson,rightTitle,rightJson })}>
      比较JSON
    </button> 
</div>

script 前端组件形式

<script src="https://unpkg.com/yyuap-historylog/lib/lib.js"></script>
<link href="https://unpkg.com/yyuap-historylog/lib/lib.css" ></link>

全局绑定对象HistoryLog 内部能力对应为以下三个参数

  1. HistoryLog.historyLog
  2. HistoryLog.jsonViewer
  3. HistoryLog.jsonViewerCompare

script 集成服务

<script src="http://workbench.yyuap.com/diwork-log/business/showLogPanel"></script>
<!-- 不同环境
(迭代)http://yonsuite-iter.yyuap.com
(测试)http://workbench.yyuap.com
(日常)https://u8c3ec-daily.yyuap.com
(预发)https://3ec-y3me-pre.diwork.com
(生产)https://ms.diwork.com 
-->
<script>
  /***
   * historyLog已经绑定到全局变量 对HistoryLog.historyLog进行了包装
   * /
  historyLog(locale,record) // 直接调用 内部已经封装url
</script>

参数说明

HistoryLog.historyLog

是否必需参数对象属性对应值说明
localeString"zh_CN","en_US","zh_TW"
urlString请求地址覆写
recordObject传递待查询节点属性
// record 参数示例
{
  busiObjId: "1234567890123456",// * 查询用
  busiObjCode: "2",// 查询用
  busiObjName: "示例操作",// * 展示用
  operationDate: "2019-12-09T08:01:49.725+0000",
  busiObjTypeCode: "oper_quicktype",// 查询用
  busiObjTypeName: "示例操作类型",
  businessId: "c6a8b585-aa69-43e6-8cea-53514e3789e0",
  detail: "发生了一些",// 无id时展现此reecord值
  mdId: null,
  mdUri: null,
  newBusiObj: "{\"test\":1}",// 无id时展现此reecord的json
  operCode: "update",
  operationDate: "2019-12-09T08:01:49.725+0000",// 无id时展现此reecord的时间
  operationName: "Update",
  operator: "3c8a4587-ee13-4740-be79-dff184bd9501",
  operatorName: "操作人", // 无id时展现此reecord的操作人
}

HistoryLog.jsonViewer(查看json)

是否必需参数对象属性对应值说明示例
localeString"zh_CN","en_US","zh_TW""zh_CN"
leftTitleObject左侧标题{name:"name",time:"2019-12-09 16:01:49"}
leftJsonJSON左侧JSON{}
rightTitleObject右侧标题{name:"name",time:"2019-12-09 16:01:49"}
rightJsonJSON右侧JSON{}

title属性为对象 非字符串 请注意

HistoryLog.jsonViewerCompare(比较json)

是否必需参数对象属性对应值说明示例
localeString"zh_CN","en_US","zh_TW""zh_CN"
titleObject标题{name:"name",time:"2019-12-09 16:01:49"}
jsonJSONJSON{}

title属性为对象 非字符串 请注意

版本说明

1.0.0 提供基本功能 支持服务端渲染 1.0.1 提供lib文件 支持script直接调用 1.0.2 打包图标资源文件 1.0.3 跨域请求cookie携带 1.0.4 增加script 提供黑盒服务 删除未引用包 1.0.5 支持json对象为null 调整ue风格 1.0.7 fix: edge 浏览器报错:接口返回格式不是application/json格式 1.0.8 fix: json value 中 null 不替换成字符串 1.0.9 fix: React DOM tree root should always have a node reference 错误 1.0.10 fix: json value 中 null 不替换成字符串 1.0.11 log-pub/business/rest/search/history请求使用axios 1.0.12 url 为空时,域名使用 window._YMSHOST_

End`