export declare const SIMPLE_RE: RegExp; /** * 判断目标字符串与关键字是否重叠 * @param target 目标字符串 * @param keyword 搜索关键字 */ export declare function pinyinMatch(target: any, keyword: any): boolean; /** * 对某个表达式进行求值 * a:{query.a},b:{query.b} -> a:aValue,b:bValue * * @example * calcExpress(cc.viewModel.data, "WH_ID:{query.WH_ID},C:{theGrid.selection.data.WH_ID}") * 计算出来的值是: "WH_ID:queryWhId,C:JH000000001" * * @param data 数据环境对象 * @param express 表达式对象 */ export declare function calcExpress(data: any, express: any): any; /** * 对个对象进行表达式求值,不用回调 * @example * calcObjectFlat({query:{a:'aValue',b1:'b1Value',b2:'b2Value',d1:1,d2:2}}, { a:'{query.a}', b:{b1:'{query.b1}', b2:'{query.b2}'},c:'aa',d:['{query.d1}','{query.d2}'] }) * * { * a: '{query.a}', * b: { * b1: '{query.b1}', * b2: '{query.b2}', * }, * c: 'aa', * d: [ * '{query.d1}', * '{query.d2}' * ] * } * * 计算结果为 * { * a: 'aValue', * b: { * b1: 'b1Value', * b2: 'b2Value' * }, * c: 'aa' * d: [ * '1', * '2' * ] * } * * @param data * @param paramObject */ export declare function calcObjectFlat(data: any, paramObject: any): any; /** * 合併 data 到當前的 ViewModel 對象 */ export declare function mergeViewModel(viewModel: any, propertyName: any, data: any, isFlat: any): void; /** * 转换内联结构的行,到平面结构 * company: { name:'公司1', id:'编号1' } => { company_id:'编号1', company_name:'公司1' } * * @param array * @param flatOption * @return {[]} */ export declare function flatRow(array: any): any[]; /** * 替换内部结构中,所有 N/A */ export declare function replaceNA(obj: any): string; /** * 根据表达式进入写值 * express="{query.a}" 写值就是 viewModel.set('query.a', value) * express="test-{query.a}" 写值就会失败 * * @example * tryWriteByExpress(cc.viewModel, "{query.WH_ID}", "111") * 写值成功 * * tryWriteByExpress(cc.viewModel, "test-{query.WH_ID}", "111") * 写值失败 * * @param viewModel VM对象 * @param express 表达式对象 * @param value 目标值 */ export declare function tryWriteByExpress(viewModel: any, express: any, value: any): void; /** * 尝试根据含表达式的对象回写, calcObjectFlat 的逆向方法 * @example * tryWriteObject({ a:'{query.a}', b:{b1:'{query.b1}', b2:'{query.b2}'},c:'aa',d:['{query.d1}','{query.d2}']}, {a:'aValue', b:{b1:'b1Value', b2:'b2Value'}, c:'aa', d:[1,2]}) * * expressObject: * { * a: '{query.a}', * b: { * b1: '{query.b1}', * b2: '{query.b2}', * }, * c: 'aa', * d: [ * '{query.a}', * '{query.b2}' * ] * } * * valueObject: * { * a: 'aValue', * b: { * b1: 'b1Value', * b2: 'b2Value' * }, * c: 'aa' * c: [ * 'aValue', * 'b2Value' * ] * } * * 系统会尝试回写 * viewModel.set('query.a', 'aValue') * viewModel.set('query.b1', 'b1Value') * viewModel.set('query.b2', 'b2Value') * * @param expressObject 含表达式的对象 * @param valueObject 表达式计算完成之后的结果对象 * @param writeFn 写入的方法 (path, value)=>void */ export declare function tryWriteObject(expressObject: any, valueObject: any, writeFn: any): void; /** * 尝试去掉变量两边括号 * {a} => a * a => a */ export declare function tryVarSimple(value: any): any; /** * 对多个表达式进行求值. 异步回调的方式返回 * { * a: 1, * b: '{someBind}', * c: ['a', 'b', 'c'], * d: ['a', 'b', '{someBind}'], * e: { * y: 1, * z: 2 * }, * f: { * y: 1, * z: '{someBind}' * } * } * * // Will produce * { * b: value, * d: ['a', 'b', value], * f: { * y: 1, * z: value * } * } * @param viewModel scope.viewModel对象 * @param paramObject 求值对象 */ export declare function calcObject(viewModel: any, paramObject: any): Promise; /** * 用于任意组件 Ext.Component 构造时,获取当前组件对应的表格(如果不是 grid.columns 对象就会返回 undefined) * @param config 组件构造函数传入的 config 配置文件 */ export declare function getParentGrid(config: any): any; /** * 解析 * { * condition: "{skuId}", * errorMsg: "无法编辑", * notice: 'msg' * } */ export declare function tryEnable(data: any, enableSetting: any): boolean; /** * 动态的为 combo 或 columns.combo 设置下拉框的值 * @param sender 目标对象 * @param config 目标对象的配置(在构造函数之前也可以) * @param getDictFn 获取字典的方法 * @param bizKey 传入字典的参数 * @param multiValueSeparator 多个字典值的分割符号 */ export declare function setComboStore(sender: any, config: any, getDictFn: any, bizKey: any, multiValueSeparator?: string): Promise; /** * 调用服务器 Ajax */ export declare function invokeServer(url: string, ...args: any[]): any; export declare function clearViewModelValues(viewModel: any, propertyName: any): void; export declare function reloadGrid(scope: any, gridRefName: any): void; /** * 将 Ext.data.Model 对象 (及子属性) 转换为 js.object 对象 */ export declare function toPlainObject(obj: any): any; export declare function confirm(msg: any, sender?: any): Promise; /** * 任何符号字符串都替换成下换线 */ export declare function normId(value: string): string; /** * * @param sender * @param propertyName * @param gridRefName */ export declare function clearViewModelReloadGrid(sender: any, propertyName: any, gridRefName: any): void; export declare function saveGridRow(grid1: any): void; export declare function insertGridRow(grid1: any): void; export declare function commitMe(sender: any): void; export declare function removeGridRow(grid1: any): void; export declare function moveUpGridRow(grid: any): void; export declare function moveDownGridRow(grid: any): void; export declare class SystemEventFu { moveUpGridRow(): (sender: any) => void; commitMe(): (sender: any) => void; moveDownGridRow(): (sender: any) => void; saveGridRow(): (sender: any) => void; insertGridRow(): (sender: any) => void; removeGridRow(): (sender: any) => void; enterToClick(btnReferenceName: any): (sender: any, config: any) => void; confirm(text: any, fn: any): (sender: any) => void; gridRemoveCurrentRow(gridRefName: any): (sender: any) => void; loadForm(invokeUrl: string, invokeParam: any, writeTarget: any): (sender: any) => void; commit(groovyUrl: string, arg0: any, successCallback: any): (sender: any) => void; formCommit(groovyUrl: string, arg0: any): (sender: any) => void; dialogSuccess(lookupObject: any): (sender: any) => void; clearViewModelValues(propertyName: string): (sender: any) => void; getGrid(url: any): (sender: any, config: any) => void; clearViewModelReloadGrid(propertyName: string, gridRefName?: string): (sender: any) => void; reloadGrid(gridRefName: string): (sender: any) => void; showDialog(url: string, lookupForData: any, successCallback: any): (sender: any) => void; showWidget(widgetUrl: any, lookup: any): (sender: any, queryValue: any) => void; clearViewModelByLookup(lookup: any): (sender: any) => void; closeMe(callBack: any): (sender: any) => void; showDialogAndFillData(url: string, lookupForData: any, map: any): (sender: any) => Promise; } /** * 清空 viewmodel 里下属的所有属性 * @param viewModel VM对象 * @param propertyKey 要清空的属性,可以是 "a.b.c" 这种表达模式 * @param ignoreProps 要忽略清空的属性名集合, 比如 ["a.b","b"] */ export declare function clearViewModel(viewModel: any, propertyKey: any, ignoreProps: any): void; export declare function clearViewModelByLookup(sender: any, lookup: any): void; export declare function showWidget(widgetUrl: any, lookup: any, sender: any, queryValue: any, vjson?: {}): void; /** * 停止事件的默认行为 * @param e */ export declare function stopEvent(e: any): void; /** * 屏幕中央显示一个黑框提示 */ export declare function msg(content: any): void; /** * 错误对话框的强提醒 */ export declare function showErrorDialog(msg: any, sender?: any): void; /** * 错误对话框的强提醒 */ export declare function showInfoDialog(msg: any, sender?: any): void; /** * 错误对话框的强提醒 */ export declare function prompt(message: any, defaultValue?: string, multiLine?: boolean): Promise; /** * 用于计算 express 表达式 */ export declare function evalFunction(data: any, express: any): any; /** * 获取表格编辑的行数据 */ export declare function getGridEditRows(grid: any): any;