5.0.215
parent
d5662a6b8a
commit
f5a96877da
|
@ -4476,7 +4476,7 @@ body .layui-table-tips .layui-layer-content {
|
|||
.layui-tab-title {
|
||||
position: relative;
|
||||
left: 0;
|
||||
height: 40px;
|
||||
height: 32px;
|
||||
white-space: nowrap;
|
||||
font-size: 0;
|
||||
border-bottom-width: 1px;
|
||||
|
@ -4497,7 +4497,7 @@ body .layui-table-tips .layui-layer-content {
|
|||
|
||||
.layui-tab-title li {
|
||||
position: relative;
|
||||
line-height: 40px;
|
||||
line-height: 32px;
|
||||
min-width: 65px;
|
||||
padding: 0 15px;
|
||||
text-align: center;
|
||||
|
@ -4518,7 +4518,7 @@ body .layui-table-tips .layui-layer-content {
|
|||
top: 0;
|
||||
content: '';
|
||||
width: 100%;
|
||||
height: 41px;
|
||||
height: 33px;
|
||||
border-width: 1px;
|
||||
border-style: solid;
|
||||
border-bottom-color: #fff;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2670,7 +2670,6 @@ layui.define(['laytpl', 'laypage', 'layer', 'form', 'util'], function (exports)
|
|||
that.layFixed.find(ELEM_BODY).scrollTop(scrollTop);
|
||||
|
||||
that.scrollPatch();
|
||||
console.info("that.layHeader.scrollLeft:" + that.layHeader.scrollLeft())
|
||||
layer.close(that.tipsIndex);
|
||||
});
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -853,6 +853,11 @@ enum PageEditState {
|
|||
*/
|
||||
class ComponentBase extends SerializeComponetBase {
|
||||
/**
|
||||
*组件的最外层的jquery对象
|
||||
注意: 如果在运行时操作该对象会造成不可预知的错误. 谨慎!!!
|
||||
*/
|
||||
$elemt: JQuery<any>
|
||||
/**
|
||||
*组件背景
|
||||
*/
|
||||
background: string
|
||||
|
@ -1214,6 +1219,10 @@ setParentAfter(parent: ComponentBase,before: ComponentBase): void
|
|||
*组件容器基类 可视化组件
|
||||
*/
|
||||
class ContainerBase extends ComponentBase {
|
||||
/**
|
||||
*是否运行点击的消息传递 默认是true. 如果要自己处理组件的内部点击事件可以设置成false
|
||||
*/
|
||||
isClickStopEvent: boolean
|
||||
|
||||
/**
|
||||
* 把子组件的html元素$elemt添加到自己的children里面;
|
||||
|
@ -1390,6 +1399,14 @@ getTempParamObj(): object
|
|||
*/
|
||||
getTempParamValue(paramName: string): any
|
||||
|
||||
/**
|
||||
* 运行模式 下是否存在数据需要保存才能通过页签关闭页面
|
||||
注意:改函数与 hasChanged的区别 ; 本函数是运行模式针对数据级别的变动标志,hasChanged 是设计模式下组件的属性变动的标志
|
||||
* @returns true 存在修改的数据,则反之 (默认:false)
|
||||
|
||||
*/
|
||||
hasDataChanged(): boolean
|
||||
|
||||
/**
|
||||
* 注册是否允许关闭回调
|
||||
* @param fn 回调函数
|
||||
|
@ -1425,6 +1442,13 @@ removeComponentById(id: string): void
|
|||
*/
|
||||
setHandle(h: any): void
|
||||
|
||||
/**
|
||||
* 运行模式 下是否存在数据需要保存,如果存在页面关闭时候回提示,
|
||||
* @param value true 存在修改的数据,则反之
|
||||
|
||||
*/
|
||||
setHasDataChanged(value: boolean): void
|
||||
|
||||
/**
|
||||
* 设置并融合页面的参数数组
|
||||
不存在就新增,存在就更新
|
||||
|
@ -4726,10 +4750,10 @@ resumeEvents(): void
|
|||
|
||||
/**
|
||||
* 组件序列化
|
||||
* @returns 返回json字符串
|
||||
* @param space 可选参数 输出的格式的缩进参数. 如:每行缩进两个空格 serialize(2)* @returns 返回json字符串
|
||||
|
||||
*/
|
||||
serialize(): any
|
||||
serialize(space: any): any
|
||||
|
||||
/**
|
||||
* 设置组件名称
|
||||
|
@ -6000,6 +6024,13 @@ getAt(index: number): Row
|
|||
*/
|
||||
getById(id: string): Row
|
||||
|
||||
/**
|
||||
* 获取某个修改状态的修改数据
|
||||
* @param state 修改状态 取值: insert,update,delete* @returns 返回对应修改状态的数据数组
|
||||
|
||||
*/
|
||||
getChangeDatas(state: RowState): object[]
|
||||
|
||||
/**
|
||||
* 获取修改的数据用于提交
|
||||
[
|
||||
|
@ -9704,6 +9735,42 @@ declare type onSelectChangedHandle = (cmp: SelectTreeBase,node: ztree.ITreeNode,
|
|||
*/
|
||||
class TreeBase extends DbComponentBase {
|
||||
|
||||
/**
|
||||
* 增加节点
|
||||
* @param parent 父节点,跟节点传 null/undefine
|
||||
* @param nodes 新增的节点数组* @returns 返回新增的节点数组
|
||||
|
||||
*/
|
||||
addNode(parent: ITreeNode,nodes: ITreeNode[]): ITreeNode[]
|
||||
|
||||
/**
|
||||
* 清除书签
|
||||
|
||||
*/
|
||||
clearBookmark(): void
|
||||
|
||||
/**
|
||||
* 展开 / 折叠 全部节点
|
||||
* @param expandFlag true 表示 展开 节点 ;false 表示 折叠 节点* @returns true 表示 展开 全部节点 false 表示 折叠 全部节点
|
||||
|
||||
*/
|
||||
expandAll(expandFlag: boolean): boolean
|
||||
|
||||
/**
|
||||
* 展开 / 折叠 指定的节点
|
||||
* @param node 指定的节点
|
||||
* @param expandFlag true 表示 展开 节点 ;false 表示 折叠 节点* @returns true 表示 展开节点 false 表示 折叠节点
|
||||
|
||||
*/
|
||||
expandNode(node: ITreeNode,expandFlag: boolean): boolean
|
||||
|
||||
/**
|
||||
* 获取所有的节点包含了跟节点和子孙节点的全集数组
|
||||
* @returns 返回所有的节点包含了跟节点和子孙节点的全集数组
|
||||
|
||||
*/
|
||||
getAllNodes(): ITreeNode[]
|
||||
|
||||
/**
|
||||
* 得到被选中的节点数组
|
||||
* @returns 返回选择的节点数组 ITreeNode[]
|
||||
|
@ -9718,6 +9785,12 @@ getSelectNodes(): ITreeNode[]
|
|||
*/
|
||||
getTreeObj(): IzTreeObj
|
||||
|
||||
/**
|
||||
* 选择项跳到书签节点
|
||||
|
||||
*/
|
||||
gotoBookmark(): void
|
||||
|
||||
/**
|
||||
* 加载数据
|
||||
* @param data 数据数组
|
||||
|
@ -9740,6 +9813,13 @@ onCheckChanged(callback: onCheckChangedHandle): void
|
|||
*/
|
||||
onDbClickNode(callback: onSelectChangedHandle): void
|
||||
|
||||
/**
|
||||
* 注册树的数据加载完成事件
|
||||
* @param callback 完成回调
|
||||
|
||||
*/
|
||||
onLoadedData(callback: onLoadedDataHandle): void
|
||||
|
||||
/**
|
||||
* 注册select 值发生点击时候触发事件
|
||||
* @param callback 回调
|
||||
|
@ -9747,23 +9827,66 @@ onDbClickNode(callback: onSelectChangedHandle): void
|
|||
*/
|
||||
onSelectChanged(callback: onSelectChangedHandle): void
|
||||
|
||||
/**
|
||||
* 重新刷新关联的数据源
|
||||
|
||||
*/
|
||||
reload(): void
|
||||
|
||||
/**
|
||||
* 移除子节点
|
||||
* @param parent 父节点* @returns 父节点的子节点数组
|
||||
|
||||
*/
|
||||
removeChildNodes(parent: ITreeNode): ITreeNode[]
|
||||
|
||||
/**
|
||||
* 移除节点
|
||||
* @param node 需要移除的节点
|
||||
|
||||
*/
|
||||
removeNode(node: ITreeNode): void
|
||||
|
||||
/**
|
||||
* 移除func回调返回true 的节点
|
||||
* @param func 匹配节点的回调函数
|
||||
|
||||
*/
|
||||
removeNodeFunc(func: SelectNodeHandle): void
|
||||
|
||||
/**
|
||||
* 设置保存书签
|
||||
* @param bookmark 书签对象 (默认:null时候 保存的是当前选中的节点)
|
||||
|
||||
*/
|
||||
saveBookmark(bookmark: ITreeNode): void
|
||||
|
||||
/**
|
||||
* 选中指定节点
|
||||
* @param treeNode 需要被选中的节点数据
|
||||
* @param addFlag true 表示追加选中,会出现多点同时被选中的情况 false (默认)表示单独选中,原先被选中的节点会被取消选中状态
|
||||
* @param isSilent true 选中节点时,不会让节点自动滚到到可视区域内 false (默认)表示选中节点时,会让节点自动滚到到可视区域内
|
||||
* @param isSilent true 选中节点时,不会让节点自动滚到到可视区域内 false (默认)表示选中节点时,会让节点自动滚到到可视区域内* @returns 返回选择的节点实例
|
||||
|
||||
*/
|
||||
selectNode(treeNode: ITreeNode,addFlag: Boolean,isSilent: boolean): void
|
||||
selectNode(treeNode: ITreeNode,addFlag: boolean,isSilent: boolean): ITreeNode
|
||||
|
||||
/**
|
||||
* 通过func回调返回true 遍历所有的节点并选中返回true的节点(焦点停留在该节点)
|
||||
* @param func 匹配节点的回调函数
|
||||
* @param addFlag true 表示追加选中,会出现多点同时被选中的情况 false (默认)表示单独选中,原先被选中的节点会被取消选中状态
|
||||
* @param isSilent true 选中节点时,不会让节点自动滚到到可视区域内 false (默认)表示选中节点时,会让节点自动滚到到可视区域内* @returns 返回选择的节点实例
|
||||
|
||||
*/
|
||||
selectNodeByFunc(func: SelectNodeHandle,addFlag: boolean,isSilent: boolean): ITreeNode
|
||||
|
||||
/**
|
||||
* 通过id选中指定节点(焦点停留在该节点)
|
||||
* @param id 需要被选中的节点id
|
||||
* @param addFlag true 表示追加选中,会出现多点同时被选中的情况 false (默认)表示单独选中,原先被选中的节点会被取消选中状态
|
||||
* @param isSilent true 选中节点时,不会让节点自动滚到到可视区域内 false (默认)表示选中节点时,会让节点自动滚到到可视区域内
|
||||
* @param isSilent true 选中节点时,不会让节点自动滚到到可视区域内 false (默认)表示选中节点时,会让节点自动滚到到可视区域内* @returns 返回选择的节点实例
|
||||
|
||||
*/
|
||||
selectNodeById(id: string,addFlag: Boolean,isSilent: boolean): void
|
||||
selectNodeById(id: string,addFlag: boolean,isSilent: boolean): ITreeNode
|
||||
|
||||
/**
|
||||
* 隐藏/显示节点
|
||||
|
@ -9773,12 +9896,19 @@ selectNodeById(id: string,addFlag: Boolean,isSilent: boolean): void
|
|||
*/
|
||||
setNodeVisable(id: string,visiable: boolean): void
|
||||
|
||||
/**
|
||||
* 更新某节点数据,主要用于该节点显示属性的更新。
|
||||
* @param node
|
||||
|
||||
*/
|
||||
updateNode(node: ITreeNode): void
|
||||
|
||||
/**
|
||||
* 更新某节点数据,主要用于该节点显示属性的更新。
|
||||
* @param id 节点的id
|
||||
|
||||
*/
|
||||
updateNode(id: string): void
|
||||
updateNodeById(id: string): void
|
||||
|
||||
}
|
||||
/**
|
||||
|
@ -10004,6 +10134,21 @@ getPath(): ITreeNode[]
|
|||
*/
|
||||
getPreNode(): ITreeNode
|
||||
}
|
||||
/**
|
||||
*节点选择回调
|
||||
|
||||
*/
|
||||
declare type SelectNodeHandle = (node: ITreeNode) => boolean
|
||||
/**
|
||||
*组件加载玩数据
|
||||
|
||||
*/
|
||||
declare type onLoadedDataHandle = (cmp: TreeBase) => void
|
||||
/**
|
||||
*节点的名称渲染事件句柄
|
||||
|
||||
*/
|
||||
declare type onRenderNodeHandle = (cmp: TreeBase,node: ztree.ITreeNode) => boolean
|
||||
/**
|
||||
*弹出tree 的 page
|
||||
用于弹出树形的选择选择
|
||||
|
@ -10049,6 +10194,8 @@ class AttributeRender {
|
|||
}
|
||||
/**
|
||||
*剪贴板对象
|
||||
操作剪贴板的类
|
||||
注意: 由于受浏览器的安全限制读取剪贴板. 谷歌浏览器只有在 127.0.0.1 /localhost / https才运行读取剪贴板 获取不支持读取
|
||||
*/
|
||||
class Clipboard {
|
||||
|
||||
|
@ -10108,6 +10255,20 @@ class Designer {
|
|||
config: any
|
||||
version: any
|
||||
|
||||
/**
|
||||
* 获取设计器的当前设计页面实例
|
||||
* @returns 返回页面实例
|
||||
|
||||
*/
|
||||
getPage(): DesignerPageBase
|
||||
|
||||
/**
|
||||
* 设计模式下 判断是否有修改过模型
|
||||
* @returns 返回是否存修改的数据
|
||||
|
||||
*/
|
||||
hasChanged(): boolean
|
||||
|
||||
/**
|
||||
* 渲染设计器
|
||||
这个函数常用于在后台数据库获取页面模型的json 后渲染使用
|
||||
|
@ -10142,6 +10303,13 @@ class ObjectTree {
|
|||
*/
|
||||
class Preview {
|
||||
|
||||
/**
|
||||
* 获取页面实例
|
||||
* @returns 返回页面实例
|
||||
|
||||
*/
|
||||
getPage(): DesignerPageBase
|
||||
|
||||
/**
|
||||
* 预览类渲染函数
|
||||
* @param previewElemtId html 元素的id
|
||||
|
@ -10151,7 +10319,7 @@ render(previewElemtId: string): void
|
|||
|
||||
}
|
||||
/**
|
||||
* 组件树
|
||||
* 版本管理类
|
||||
*/
|
||||
class VersionManger {
|
||||
|
||||
|
@ -12823,8 +12991,8 @@ off(handle: string,msgFilter: string,fn: Function): void
|
|||
* 注册对象的消息处理
|
||||
* @param handle 接收消息来源的对象id或者组件实例...等等.
|
||||
* @param msg 消息字符串
|
||||
* @param callback 消息回调
|
||||
* @param override 是否覆盖之前注册的消息处理函数 默认值 = false
|
||||
* @param callback 消息处理回调
|
||||
* @param override 是否覆盖之前注册的消息处理函数 默认值 = false 只允许存在一个处理回调.
|
||||
* @param isGlobal 是否全局监听(跨域iframe监听) 默认值 = false
|
||||
|
||||
*/
|
||||
|
@ -12836,9 +13004,10 @@ on(handle: string | IComponent,msg: string,callback: Function,override: boolean,
|
|||
* @param msg 消息值
|
||||
* @param parms 附带到消息的参数对象 注意消息参数对象不能是组件的实例,这是因为发送会序列化操作会导致死循环
|
||||
* @param isGlobal 是否全局监听(跨域iframe监听) 默认值 = false
|
||||
* @param doMsgCallback 可选参数, 处理消息的回调
|
||||
|
||||
*/
|
||||
send(handle: string | IComponent,msg: string,parms: any,isGlobal: boolean): void
|
||||
send(handle: string | IComponent,msg: string,parms: any,isGlobal: boolean,doMsgCallback: MessageCallbackhandle): void
|
||||
|
||||
/**
|
||||
* 判断浏览器是否支持postMessage
|
||||
|
@ -12849,6 +13018,45 @@ static getSupportPostMessage(): boolean
|
|||
|
||||
}
|
||||
/**
|
||||
*消息实体类
|
||||
*/
|
||||
interface IMessage {
|
||||
/**
|
||||
*回调函数的id
|
||||
消息回调时候需要使用
|
||||
*/
|
||||
callbackId: string
|
||||
/**
|
||||
*消息接收的句柄
|
||||
*/
|
||||
handle: string
|
||||
/**
|
||||
*消息类型
|
||||
*/
|
||||
msg: string
|
||||
/**
|
||||
* 参数
|
||||
*/
|
||||
params: any
|
||||
/**
|
||||
*消息处理的返回值
|
||||
*/
|
||||
result: any
|
||||
/**
|
||||
*源消息
|
||||
*/
|
||||
sourceMsg: IMessage
|
||||
/**
|
||||
*消息的所属的target对象的ID
|
||||
*/
|
||||
targetId: string
|
||||
}
|
||||
/**
|
||||
*消息的处理回调
|
||||
|
||||
*/
|
||||
declare type MessageCallbackhandle = (msg: IMessage) => any
|
||||
/**
|
||||
*组件的取名服务类
|
||||
*/
|
||||
class NameGenerateService extends ServiceBase {
|
||||
|
@ -13385,6 +13593,14 @@ static Form(options: IFormOptions): number
|
|||
*/
|
||||
static addJavaScript(id: string,javascript: string): boolean
|
||||
|
||||
/**
|
||||
* 给url地址增加参数 一般用于get请求的参数增加
|
||||
* @param url 地址字符串
|
||||
* @param paramObj 参数对象* @returns 返回处理完成的url地址字符串
|
||||
|
||||
*/
|
||||
static addQueryString(url: string,paramObj: object): string
|
||||
|
||||
/**
|
||||
* 任意值转成boolean类型
|
||||
true: 'true', 11
|
||||
|
@ -13436,9 +13652,10 @@ static autoFill(frmElem: HTMLElement,data: string[],options: object): void
|
|||
* @param cmpId 目标组件ID或者组件实例
|
||||
* @param msgName 消息常量值
|
||||
* @param params 参数
|
||||
* @param doMsgCallback 可选参数, 处理消息的回调
|
||||
|
||||
*/
|
||||
static broadcast(cmpId: string | IComponent,msgName: string,params: any): void
|
||||
static broadcast(cmpId: string | IComponent,msgName: string,params: any,doMsgCallback: MessageCallbackhandle): void
|
||||
|
||||
/**
|
||||
* 关闭指定的弹出层
|
||||
|
@ -13524,22 +13741,24 @@ static doError(xhr: any,textStatus: any): void
|
|||
|
||||
/**
|
||||
* 下载文件
|
||||
注意:这个函数中文文件名存在乱码现象
|
||||
* @param url 下载的文件地址
|
||||
* @param params 参数
|
||||
* @param paramObj 参数对象
|
||||
* @param onStarCallBack 开始下载回调函数
|
||||
* @param processCallBack 处理的回调函数
|
||||
* @param completeCallback 完成回调函数
|
||||
|
||||
*/
|
||||
static downloaFile(url: string,params: any,onStarCallBack: any,processCallBack: any,completeCallback: any): void
|
||||
static downloaFile(url: string,paramObj: object,onStarCallBack: any,processCallBack: any,completeCallback: any): void
|
||||
|
||||
/**
|
||||
* 下载文件
|
||||
* @param url 下载地址
|
||||
* @param completeCallback 完成回调函数
|
||||
* @param paramobj 参数对象
|
||||
|
||||
*/
|
||||
static download(url: string,completeCallback: any): void
|
||||
static download(url: string,completeCallback: any,paramobj: object): void
|
||||
|
||||
/**
|
||||
* 生效AMD加载
|
||||
|
@ -13607,6 +13826,15 @@ static formPost(url: string,method: MethodType,param: object,callBackFunc: AjaxH
|
|||
*/
|
||||
static formSubmit(url: string,params: IParam[],newTab: boolean): void
|
||||
|
||||
/**
|
||||
* 模拟form 提交
|
||||
* @param url 提交的地址
|
||||
* @param paramObj 参数对象
|
||||
* @param newTab 是否在新页签开启 默认:true
|
||||
|
||||
*/
|
||||
static formSubmitWithParams(url: string,paramObj: object,newTab: boolean): void
|
||||
|
||||
/**
|
||||
* 格式化数字显示方式
|
||||
用法
|
||||
|
@ -14032,13 +14260,14 @@ static require(jsUrl: string,onFinishCallBack: Function,attrs: object): void
|
|||
static requires(jsUrls: string[],onFinishCallBack: Function,attrs: object,isSequence: boolean): void
|
||||
|
||||
/**
|
||||
* 发送消息
|
||||
* 当前window/iframe 发送消息
|
||||
* @param cmpId 目标组件ID或者组件实例
|
||||
* @param msgName 消息常量值
|
||||
* @param params 参数
|
||||
* @param doMsgCallback 可选参数, 处理消息的回调
|
||||
|
||||
*/
|
||||
static send(cmpId: string | IComponent,msgName: string,params: any): void
|
||||
static send(cmpId: string | IComponent,msgName: string,params: any,doMsgCallback: MessageCallbackhandle): void
|
||||
|
||||
/**
|
||||
* 保存用户信息
|
||||
|
@ -14106,6 +14335,16 @@ Common.tips("hello", btn.getElemt(), { tips: {color:"red", direct: "down" } })
|
|||
*/
|
||||
static tips(content: string,$follow: JQuery<any>,options: IFormTipsOptions): number
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
* @param uploadUrl 上传文件的路径
|
||||
* @param accept 可选参数,可以选择那些文件 默认值:file/* ,可设置 image/* text/* audio/* video/* .xxx 多个格式可以使用逗号隔开: .xxx,.doc,.docx,.xls,.xlsx,.pdf
|
||||
* @param onFinishCallBack 可选参数 完成回调 存在错误时候等于错误信息,为空时候说明完成上传
|
||||
* @param config 可选参数 上传的配置项
|
||||
|
||||
*/
|
||||
static uploadFile(uploadUrl: string,accept: string,onFinishCallBack: onFinishCallBackHandle,config: IUploadImageConfig): void
|
||||
|
||||
/**
|
||||
* 上传图片方法
|
||||
```typescript
|
||||
|
@ -14594,6 +14833,16 @@ class HashMap {
|
|||
*/
|
||||
class KdUploader {
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
* @param uploadUrl 上传文件的路径
|
||||
* @param accept 可以选择那些文件
|
||||
* @param onFinishCallBack 完成回调 存在错误时候等于错误信息,为空时候说明完成上传
|
||||
* @param config 上传的配置项
|
||||
|
||||
*/
|
||||
static upLoadFile(uploadUrl: string,accept: string,onFinishCallBack: onFinishCallBackHandle,config: IUploadImageConfig): void
|
||||
|
||||
/**
|
||||
* 上传文件
|
||||
* @param config 上传的配置
|
||||
|
@ -14607,6 +14856,11 @@ static upLoadImage(config: IUploadImageConfig): void
|
|||
*/
|
||||
interface IUploadImageConfig {
|
||||
/**
|
||||
*选择的文件类型
|
||||
*/
|
||||
accept: string
|
||||
elem: HTMLElement
|
||||
/**
|
||||
*上传的文件
|
||||
*/
|
||||
file: File
|
||||
|
@ -14615,6 +14869,10 @@ file: File
|
|||
*/
|
||||
headers: any
|
||||
/**
|
||||
*是否允许上传多个文件
|
||||
*/
|
||||
isMultiple: boolean
|
||||
/**
|
||||
*上传开始前回调
|
||||
*/
|
||||
onBefore: Function
|
||||
|
@ -14635,6 +14893,12 @@ onUploading: any
|
|||
*/
|
||||
url: string
|
||||
}
|
||||
/**
|
||||
*完成回调类型
|
||||
*@param err 存在错误时候等于错误信息,为空时候说明完成上传
|
||||
|
||||
*/
|
||||
declare type onFinishCallBackHandle = (err: string) => void
|
||||
/**
|
||||
*消息盒子
|
||||
用于跨iframe的消息处理和发送
|
||||
|
@ -15220,6 +15484,13 @@ class Custom extends ContainerBase {
|
|||
*/
|
||||
onLoadScript(callback: onCustomHandle): void
|
||||
|
||||
/**
|
||||
* 设置html
|
||||
* @param html html字符串
|
||||
|
||||
*/
|
||||
setHtml(html: string): void
|
||||
|
||||
}
|
||||
/**
|
||||
*脚本加载回调
|
||||
|
@ -15570,6 +15841,28 @@ class TabItemsAttrEditor extends ButtonAttrEditor {
|
|||
*页签内容容器
|
||||
*/
|
||||
class TabPanel extends ContainerBase {
|
||||
/**
|
||||
*附带的临时参数对象
|
||||
*/
|
||||
params: object
|
||||
/**
|
||||
*页签标题
|
||||
*/
|
||||
title: string
|
||||
|
||||
/**
|
||||
* 获取页签的标记
|
||||
* @returns 返回是否显示标记 true 显示,则反之
|
||||
|
||||
*/
|
||||
getShowFlag(): boolean
|
||||
|
||||
/**
|
||||
* 得到组件的父容器组件tab
|
||||
* @returns 返回父组件的实例
|
||||
|
||||
*/
|
||||
getTab(): Tabs
|
||||
|
||||
/**
|
||||
* 得到页签的索引号
|
||||
|
@ -15592,6 +15885,13 @@ onTitleClick(handle: TabPanelTitleClickHandle): void
|
|||
*/
|
||||
onTitleCloseClick(handle: TabPanelTitleClickHandle): void
|
||||
|
||||
/**
|
||||
* 刷新页签
|
||||
如果是url的iframe的页签可以使用该函数刷新
|
||||
|
||||
*/
|
||||
refresh(): void
|
||||
|
||||
/**
|
||||
* 移除页签
|
||||
|
||||
|
@ -15604,6 +15904,20 @@ remove(): void
|
|||
*/
|
||||
setActive(): void
|
||||
|
||||
/**
|
||||
* 设置页签的标记
|
||||
* @param value 是否显示标记 true 显示,则反之
|
||||
|
||||
*/
|
||||
setShowFlag(value: boolean): void
|
||||
|
||||
/**
|
||||
* 设置页签的标题
|
||||
* @param title 标题字符
|
||||
|
||||
*/
|
||||
setTitle(title: string): void
|
||||
|
||||
}
|
||||
/**
|
||||
*Tabs 选项卡
|
||||
|
@ -15642,6 +15956,13 @@ addTab(tab: TabPanel): void
|
|||
*/
|
||||
addUrlTab(title: string,url: string,params: object,method: MethodType,allowClose: boolean): void
|
||||
|
||||
/**
|
||||
* 查找tabPanel
|
||||
* @param findCallback 差早回调* @returns 返回查找到页签数组
|
||||
|
||||
*/
|
||||
findTabPage(findCallback: findTabPanelHandle): TabPanel[]
|
||||
|
||||
/**
|
||||
* 返回激活的页签
|
||||
* @returns 页签的实例
|
||||
|
@ -15697,6 +16018,11 @@ url: string
|
|||
*/
|
||||
interface TabItemsAttrEditorConfig {
|
||||
}
|
||||
/**
|
||||
*查找页签回调类型
|
||||
|
||||
*/
|
||||
declare type findTabPanelHandle = (tabPanel: TabPanel) => boolean
|
||||
/**
|
||||
*文本域组件
|
||||
*/
|
||||
|
@ -35228,3 +35554,349 @@ $( "p" ).wrapInner( $( "<span class='red'></span>" ) );
|
|||
|
||||
[n: number]: TElement;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
zTree: ztree.IzTree;
|
||||
}
|
||||
declare namespace ztree {
|
||||
|
||||
|
||||
interface IJSON {
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
|
||||
type ApplicationType = 'application/x-www-form-urlencoded' | 'application/json';
|
||||
type AjaxType = 'get' | 'post' | 'GET' | 'POST';
|
||||
type dataType = 'text' | 'json' | 'jsonp' | 'html' | 'xml' | 'script';
|
||||
|
||||
interface IAsync {
|
||||
autoParam?: string[];
|
||||
contentType?: ApplicationType;
|
||||
dataFilter?: (treeId: string, parentNode: object, responseData: IJSON[] | IJSON | string) => IJSON[] | IJSON;
|
||||
dataType?: dataType;
|
||||
enable?: boolean;
|
||||
otherParam?: string[] | IJSON;
|
||||
type?: AjaxType;
|
||||
headers?: object;
|
||||
xhrFields?: object;
|
||||
url: string;
|
||||
}
|
||||
|
||||
|
||||
type CallBackBeforeFn = (treeId: string, treeNode: ITreeNode) => boolean;
|
||||
type CallBackOnFn = (event: Event, treeId: string, treeNode: ITreeNode) => void;
|
||||
|
||||
interface ICallback {
|
||||
beforeAsync?: CallBackBeforeFn;
|
||||
beforeCheck?: CallBackBeforeFn;
|
||||
beforeClick?: (treeId: string, treeNode: ITreeNode, clickFlag: number) => boolean;
|
||||
beforeCollapse?: CallBackBeforeFn;
|
||||
beforeDblClick?: CallBackBeforeFn;
|
||||
beforeDrag?: (treeId: string, treeNode: ITreeNode[]) => boolean;
|
||||
beforeDragOpen?: CallBackBeforeFn;
|
||||
beforeDrop?: (treeId: string, treeNode: ITreeNode[], targetNode: ITreeNode, moveType: string, isCopy: boolean) => boolean;
|
||||
beforeEditName?: CallBackBeforeFn;
|
||||
beforeExpand?: CallBackBeforeFn;
|
||||
beforeMouseDown?: CallBackBeforeFn;
|
||||
beforeMouseUp?: CallBackBeforeFn;
|
||||
beforeRemove?: CallBackBeforeFn;
|
||||
beforeRename?: (treeId: string, treeNode: ITreeNode, newName: string, isCancel: boolean) => boolean;
|
||||
beforeRightClick?: CallBackBeforeFn;
|
||||
|
||||
onAsyncError?: (event: Event, treeId: string, treeNode: ITreeNode, XMLHttpRequest: any, textStatus: string, errorThrown: string) => void;
|
||||
onAsyncSuccess?: (event: Event, treeId: string, treeNode: ITreeNode, msg: string | object) => void;
|
||||
onCheck?: (event: Event, treeId: string, treeNode: object) => void;
|
||||
onClick?: (event: Event, treeId: string, treeNode: ITreeNode, clickFlag: number) => void;
|
||||
onCollapse?: (event: Event, treeId: string, treeNode: ITreeNode) => void;
|
||||
onDblClick?: (event: Event, treeId: string, treeNode: ITreeNode) => void;
|
||||
onDrag?: (event: Event, treeId: string, treeNodes: ITreeNode[]) => void;
|
||||
onDragMove?: (event: Event, treeId: string, treeNodes: ITreeNode[]) => void;
|
||||
onDrop?: (event: Event, treeId: string, treeNodes: ITreeNode[], targetNode: object, moveType: string, isCopy: boolean) => void;
|
||||
onExpand?: CallBackOnFn;
|
||||
onMouseDown?: CallBackOnFn;
|
||||
onMouseUp?: CallBackOnFn;
|
||||
onNodeCreated?: CallBackOnFn;
|
||||
onRemove?: CallBackOnFn;
|
||||
onRename?: (event: Event, treeId: string, treeNode: ITreeNode, isCancel: boolean) => void;
|
||||
onRightClick?: CallBackOnFn;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 树节点接口声明
|
||||
*/
|
||||
export interface ITreeNode {
|
||||
[key: string]: any
|
||||
/**
|
||||
* 节点的唯一标识 tId。
|
||||
*/
|
||||
tId?: string
|
||||
|
||||
/**
|
||||
* 节点的父节点唯一标识 tId。
|
||||
*/
|
||||
parentTId?: string
|
||||
|
||||
/**
|
||||
* 节点的 checkBox / radio 的 勾选状态
|
||||
*/
|
||||
checkBox?: boolean
|
||||
|
||||
/**
|
||||
* 记录节点的层级
|
||||
* 根节点 level = 0,依次递增
|
||||
*/
|
||||
level?: number
|
||||
|
||||
/**
|
||||
* 节点是否为同级节点中的最后一个节点。
|
||||
*/
|
||||
isLastNode?: boolean
|
||||
|
||||
/**
|
||||
* 节点是否为同级节点中的第一个节点。
|
||||
*/
|
||||
isFirstNode?: boolean
|
||||
|
||||
/**
|
||||
* 记录节点 的 hover 状态
|
||||
*/
|
||||
isHover?: boolean
|
||||
|
||||
|
||||
/**
|
||||
* 用于记录节点是否处于编辑名称状态 [setting.edit.enable = true 时有效]
|
||||
*/
|
||||
editNameFlag?: boolean
|
||||
|
||||
/**
|
||||
* 节点是否正在进行异步加载。
|
||||
*/
|
||||
isAjaxing?: boolean
|
||||
|
||||
/**
|
||||
* 节点是否已经进行过异步加载,避免父节点反复异步加载数据。
|
||||
*/
|
||||
zAsync?: boolean
|
||||
|
||||
/**
|
||||
* 用于设置节点的子节点的 checkBox / radio 的半选状态
|
||||
* setting.check.checkType = "checkbox"
|
||||
* -1 不存在子节点 或 子节点全部设置为 nocheck = true
|
||||
* 0 无 子节点被勾选
|
||||
* 1 部分 子节点被勾选
|
||||
* 2 全部 子节点被勾选
|
||||
* setting.check.checkType = "radio"
|
||||
* -1 不存在子节点 或 子节点全部设置为 nocheck = true
|
||||
* 0 无 子节点被勾选
|
||||
* 2 有 子节点被勾选
|
||||
*/
|
||||
check_Child_State?: number
|
||||
/**
|
||||
* 设置节点的 checkBox / radio 的 focus 状态
|
||||
* 默认值:false
|
||||
*/
|
||||
check_Focus?: boolean
|
||||
|
||||
/**
|
||||
* 强制节点的 checkBox / radio 的 半勾选状态。[setting.check.enable = true & treeNode.nocheck = false 时有效]
|
||||
* 1、强制为半勾选状态后,不再进行自动计算半勾选状态
|
||||
* 2、设置 treeNode.halfCheck = false 或 null 才能恢复自动计算半勾选状态
|
||||
* 3、为了解决部分朋友生成 json 数据出现的兼容问题, 支持 "false","true" 字符串格式的数据
|
||||
* 默认值:false
|
||||
*/
|
||||
halfCheck?: boolean
|
||||
/**
|
||||
* 节点自定义图标的 URL 路径。
|
||||
* 1、父节点如果只设置 icon ,会导致展开、折叠时都使用同一个图标
|
||||
* 2、父节点展开、折叠使用不同的个性化图标需要同时设置 treeNode.iconOpen / treeNode.iconClose 两个属性
|
||||
* 3、如果想利用 className 设置个性化图标,需要设置 treeNode.iconSkin 属性
|
||||
* 默认值:无
|
||||
*/
|
||||
icon?: string
|
||||
|
||||
/**
|
||||
* 父节点自定义折叠时图标的 URL 路径。
|
||||
* 1、此属性只针对父节点有效
|
||||
* 2、此属性必须与 iconOpen 同时使用
|
||||
* 3、如果想利用 className 设置个性化图标,需要设置 treeNode.iconSkin 属性
|
||||
* 默认值:无
|
||||
*/
|
||||
iconClose?: string
|
||||
/**
|
||||
* 父节点自定义展开时图标的 URL 路径。
|
||||
* 1、此属性只针对父节点有效
|
||||
* 2、此属性必须与 iconClose 同时使用
|
||||
* 3、如果想利用 className 设置个性化图标,需要设置 treeNode.iconSkin 属性
|
||||
* 默认值:无
|
||||
*/
|
||||
iconOpen?: string
|
||||
/**
|
||||
* 获取节点在同级节点中的位置。
|
||||
*/
|
||||
getIndex(): number
|
||||
/**
|
||||
* 获取与节点相邻的后一个节点。
|
||||
*/
|
||||
getNextNode(): ITreeNode
|
||||
/**
|
||||
* 获取节点的父节点。
|
||||
* @return 节点的父节点数据对象。
|
||||
*/
|
||||
getParentNode(): ITreeNode
|
||||
|
||||
/**
|
||||
* 获取 treeNode 节点的所有父节点(包括自己)。
|
||||
* @returns treeNode 节点的所有父节点的数据集合(包括自己)
|
||||
*/
|
||||
getPath(): ITreeNode[]
|
||||
|
||||
|
||||
/**
|
||||
* 获取与 treeNode 节点相邻的前一个节点。
|
||||
*/
|
||||
getPreNode(): ITreeNode
|
||||
|
||||
}
|
||||
|
||||
interface ICheck {
|
||||
autoCheckTrigger?: boolean;
|
||||
chkboxType?: IJSON;
|
||||
chkStyle?: string;
|
||||
enable?: boolean;
|
||||
nocheckInherit?: boolean;
|
||||
chkDisabledInherit?: boolean;
|
||||
radioType?: string;
|
||||
}
|
||||
|
||||
interface IData {
|
||||
keep?: {
|
||||
leaf?: boolean;
|
||||
parent?: boolean;
|
||||
},
|
||||
key?: {
|
||||
checked?: string;
|
||||
children?: string;
|
||||
isParent?: string;
|
||||
isHidden?: string;
|
||||
name?: string;
|
||||
title?: string;
|
||||
url?: string;
|
||||
},
|
||||
simpleData?: {
|
||||
enable?: boolean;
|
||||
idKey?: string;
|
||||
pIdKey?: string;
|
||||
rootPId?: any;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
type removeFnType<T> = (treeId: string, treeNode: ITreeNode) => T;
|
||||
|
||||
interface IEdit {
|
||||
drag?: {
|
||||
autoExpandTrigger?: boolean;
|
||||
isCopy?: boolean;
|
||||
isMove?: boolean;
|
||||
prev?: boolean;
|
||||
next?: boolean;
|
||||
inner?: boolean;
|
||||
borderMax?: number;
|
||||
borderMin?: number;
|
||||
minMoveSize?: number;
|
||||
maxShowNodeNum?: number;
|
||||
autoOpenTime?: number;
|
||||
},
|
||||
editNameSelectAll?: boolean;
|
||||
enable?: boolean;
|
||||
removeTitle?: string | removeFnType<string>;
|
||||
renameTitle?: string | removeFnType<string>;
|
||||
showRemoveBtn?: boolean | removeFnType<boolean>;
|
||||
showRenameBtn?: boolean | removeFnType<boolean>;
|
||||
}
|
||||
|
||||
|
||||
type dblClickExpandFn<T> = (treeId: string, treeNode: ITreeNode) => T;
|
||||
|
||||
interface IView {
|
||||
addDiyDom?: dblClickExpandFn<void>;
|
||||
addHoverDom?: dblClickExpandFn<void>;
|
||||
autoCancelSelected?: boolean;
|
||||
dblClickExpand?: boolean | dblClickExpandFn<boolean>;
|
||||
expandSpeed?: string | number;
|
||||
fontCss?: IJSON | dblClickExpandFn<IJSON>;
|
||||
nameIsHTML?: boolean;
|
||||
removeHoverDom?: dblClickExpandFn<void>;
|
||||
selectedMulti?: boolean;
|
||||
showIcon?: boolean | dblClickExpandFn<boolean>;
|
||||
showLine?: boolean;
|
||||
showTitle?: boolean | dblClickExpandFn<boolean>;
|
||||
txtSelectedEnable?: boolean;
|
||||
}
|
||||
|
||||
interface IZTreeSetting {
|
||||
/**
|
||||
* html元素的id
|
||||
*/
|
||||
treeId?: string
|
||||
treeInstObj?: object
|
||||
async?: IAsync;
|
||||
callback?: ICallback;
|
||||
check?: ICheck;
|
||||
data?: IData;
|
||||
edit?: IEdit;
|
||||
view?: IView;
|
||||
}
|
||||
|
||||
|
||||
type filterFnType = (node: ITreeNode) => boolean;
|
||||
|
||||
export interface IzTreeObj {
|
||||
setting: IZTreeSetting;
|
||||
addNodes: (parentNode: ITreeNode, index?: number, newNodes?: IJSON[] | IJSON, isSilentBoolean?: boolean) => ITreeNode[];
|
||||
cancelEditName: (newName?: string) => void;
|
||||
cancelSelectedNode: (treeNode?: ITreeNode) => void;
|
||||
checkAllNodes: (checked: boolean) => void;
|
||||
checkNode: (treeNode: ITreeNode, checked?: boolean, checkTypeFlag?: boolean, callbackFlag?: boolean) => void;
|
||||
copyNode: (targetNode: ITreeNode, treeNode: ITreeNode, moveType: string, isSilent: boolean) => ITreeNode;
|
||||
destroy: () => void;
|
||||
editName: (treeNode: ITreeNode) => void;
|
||||
expandAll: (expandFlag: boolean) => boolean | null;
|
||||
expandNode: (treeNode: ITreeNode, expandFlag?: boolean, sonSign?: boolean, focus?: boolean, callbackFlag?: boolean) => boolean | null;
|
||||
getChangeCheckedNodes: () => ITreeNode[];
|
||||
getCheckedNodes: (checked?: boolean) => ITreeNode[];
|
||||
getNodeByParam: (key: string, value: any, parentNode?: ITreeNode) => ITreeNode;
|
||||
getNodeByTId: (tId: string) => ITreeNode;
|
||||
getNodeIndex: (treeNode: ITreeNode) => number;
|
||||
getNodes: () => ITreeNode[];
|
||||
getNodesByFilter: (filter: filterFnType, isSingle?: boolean, parentNode?: ITreeNode, invokeParam?: any) => ITreeNode[];
|
||||
getNodesByParam: (key: string, value: any, parentNode?: ITreeNode) => ITreeNode[];
|
||||
getNodesByParamFuzzy: (key: string, value: string, parentNode?: ITreeNode) => ITreeNode;
|
||||
getSelectedNodes: () => any;
|
||||
hideNode: (treeNode: ITreeNode) => void;
|
||||
hideNodes: (treeNodes: ITreeNode[]) => void;
|
||||
moveNode: (targetNode: ITreeNode, treeNode: ITreeNode, moveType: string, isSilent?: boolean) => ITreeNode;
|
||||
reAsyncChildNodes: (parentNode: ITreeNode, reloadType: string, isSilent?: boolean, callback?: any) => void;
|
||||
reAsyncChildNodesPromise: (parentNode: ITreeNode, reloadType: string, isSilent?: boolean) => any;
|
||||
refresh: () => void;
|
||||
removeChildNodes: (parentNode: ITreeNode) => ITreeNode[];
|
||||
removeNode: (treeNode: ITreeNode, callbackFlag?: boolean) => void;
|
||||
selectNode: (treeNode: ITreeNode, addFlag?: boolean, isSilent?: boolean) => void;
|
||||
setChkDisabled: (treeNode: ITreeNode, disabled?: boolean, inheritParent?: boolean, inheritChildren?: boolean) => void;
|
||||
setEditable: (editable: boolean) => void;
|
||||
showNode: (treeNode: ITreeNode) => void;
|
||||
showNodes: (treeNodes: ITreeNode[]) => void;
|
||||
transformToArray: (treeNodes: ITreeNode[] | IJSON) => ITreeNode[];
|
||||
transformTozTreeNodes: (simpleNodes: IJSON[] | IJSON) => ITreeNode[];
|
||||
updateNode: (treeNode: ITreeNode, checkTypeFlag?: boolean) => void;
|
||||
}
|
||||
|
||||
export interface IzTree {
|
||||
init?: (dom: any, setting: IZTreeSetting, zNodes: IJSON[] | object) => IzTreeObj;
|
||||
getZTreeObj?: (treeId: string) => IzTreeObj;
|
||||
destroy?: (treeId: string) => void;
|
||||
_z?: any;
|
||||
}
|
||||
}
|
|
@ -122,7 +122,18 @@ layui.define('jquery', function(exports){
|
|||
, parents = li.parents('.layui-tab').eq(0)
|
||||
, item = parents.children('.layui-tab-content').children('.layui-tab-item')
|
||||
, filter = parents.attr('lay-filter');
|
||||
setTimeout(function () {
|
||||
call.tabAuto();
|
||||
}, 50);
|
||||
var param = {
|
||||
elem: parents
|
||||
, index: index
|
||||
, canClose: true
|
||||
};
|
||||
|
||||
layui.event.call(this, MOD_NAME, 'tabDelete(' + filter + ')', param);
|
||||
|
||||
if (param.canClose === true) {
|
||||
if (li.hasClass(THIS)) {
|
||||
if (li.next()[0]) {
|
||||
call.tabClick.call(li.next()[0], null, index + 1);
|
||||
|
@ -130,17 +141,10 @@ layui.define('jquery', function(exports){
|
|||
call.tabClick.call(li.prev()[0], null, index - 1);
|
||||
}
|
||||
}
|
||||
|
||||
li.remove();
|
||||
item.eq(index).remove();
|
||||
setTimeout(function(){
|
||||
call.tabAuto();
|
||||
}, 50);
|
||||
li.remove();
|
||||
}
|
||||
|
||||
layui.event.call(this, MOD_NAME, 'tabDelete('+ filter +')', {
|
||||
elem: parents
|
||||
,index: index
|
||||
});
|
||||
}
|
||||
|
||||
//Tab自适应
|
||||
|
|
|
@ -233,9 +233,8 @@ layui.define(['view', 'theme', 'common'], function (exports) {
|
|||
*/
|
||||
refresh: function () {
|
||||
var iframe = admin.tabsBody(common.tabsPage.index).find('.layadmin-iframe');
|
||||
$('.layadmin-tabsbody-shade').show();
|
||||
//$('.layadmin-tabsbody-shade').show();
|
||||
iframe.attr('src', iframe.attr('src'));
|
||||
// iframe[0].contentWindow.location.reload(true);
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -687,11 +686,26 @@ layui.define(['view', 'theme', 'common'], function (exports) {
|
|||
|
||||
//监听 tabspage 删除
|
||||
element.on('tabDelete(' + FILTER_TAB_TBAS + ')', function (obj) {
|
||||
var othis = $(TABS_HEADER + '.layui-this');
|
||||
|
||||
var tab = obj.elem.find('li').eq(obj.index)
|
||||
let $iframe = admin.tabsBody(obj.index).find('iframe');
|
||||
if ($iframe.length > 0) {
|
||||
yhpreview = $iframe[0].contentWindow['yhpreview'];
|
||||
if (yhpreview && yhpreview.getPage().hasDataChanged()) {
|
||||
layer.msg('存在未保存的数据,请先保存数据再关闭页面');
|
||||
obj.canClose = false;
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (obj.canClose !== false) {
|
||||
if (tab.hasClass('layui-this')) {
|
||||
if (tab.next()[0]) {
|
||||
setThisRouter(tab.next());
|
||||
} else if (tab.prev()[0]) {
|
||||
setThisRouter(tab.prev());
|
||||
}
|
||||
}
|
||||
}
|
||||
obj.index && admin.tabsBody(obj.index).remove();
|
||||
setThisRouter(othis);
|
||||
|
||||
//移除resize事件
|
||||
admin.delResize();
|
||||
events.setPrevAndNext();
|
||||
|
|
Loading…
Reference in New Issue