interface RestApiResult { success: string, msg: string, data: T } /** * 清除 "Loading" 的状态 */ type ClearLoadingHandle = () => void interface System { /** * 深度遍历 vjson, 并调用 callback * @param vjson 要遍历的 vjson(如果 vjson 带 layout 属性,则按照布局遍历 layout 所有子元素) * @param cb 回调函数, 参数 callback(cmpVjson, jsonpath). * cmpVjson: 当前遍历到的组件 vjson, * jsonpath: 当前遍历到的 vjson 的特征串, 例如: 'toolbar:toolbar[1] / items:form[0]', 这个特征串可以用于界面规则的制定,只要界面没有发生重大变化,每次遍历到的特征串都是一样的 */ vjsonDepthTrave(vjson, cb: (cmpVjson, jsonpath) => void): void /** * 调用后端服务 * @param url API地址, 示例: /pages/inbound/asn_in/AsnIn@queryByAsnId * @param body API参数 */ invokeServer(url: string, body?: any): Promise>; /** * 替换内部结构中,所有 N/A */ replaceNA(obj) /** * 推迟调用函数 * @param func */ defer(func: () => void): void /** * 将源对象全部合并至第一个参数的对象,并返回 target * @param target 目标对象 * @param source 合并源1 * @param source2 合并源2 * @param source3 合并源3 */ extend(target, source, source2?, source3?) /** * 获取今天的日期 */ getNowDate(): string /** * 显示对话框 * @param path 模块路径 * @param param 模块参数 */ showDialog(path: string, param: any): Promise; /** * 显示抽屉 * @param path 模块路径 * @param param 模块参数 */ showDrawer(path: string, param: any): Promise; /** * 弹出用户必须点击确认的错误信息, * 给1个参数时,第一个参数是内容 * 给2个参数时,第一个是标题,第二个参数是内容; * @param msgOrTitle 标题或内容 * @param msg 内容 */ showErrorDialog(msgOrTitle: string, msg?: string) /** * 弹出用户必须确认的提示信息 * @param content 提示内容 */ showInfoDialog(content: string) /** * 信息提示内容,强提示,必须用户点击确认 * @param msg 提示内容 */ alert(msg) /** * 轻量级提示信息 * @param message 提示内容 */ msg(message: string) /** * 弹出确认对话框, 要求用户点击 "是"/"否" * @param msg 提示的内容 * @return then才响应 */ confirm(msg): Promise /** * 全局 “正在载入...” 对话框 */ showLoading() /** * 关闭 “正在载入...” 对话框 */ clearLoading() /** * 在触发的按钮上显示 loading 状态 * @return 关闭 loading 状态的函数 */ showLoadingIfButton(): ClearLoadingHandle /** * 在设计器中打开文件 * @param path VUE文件路径,格式: /src/pages/rule/lot/RuleLot.vue * @param href 默认值 '/studio/design' */ openStudioModule(path: string, href?: any): Promise getUser() : { uid: string loginName: string nickname: string } } // declare const system: System; interface Promise { /** * 附加一个回调,Promise无论是被解决(或拒绝)时调用该回调 */ finally(onfinally?: (() => void) | undefined | null): Promise }