123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281 |
- 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<unknown>;
- /**
- * 用于任意组件 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<unknown>;
- /**
- * 调用服务器 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<void>;
- /**
- * 任何符号字符串都替换成下换线
- */
- 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<unknown>;
- }
- /**
- * 清空 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<string>;
- /**
- * 用于计算 express 表达式
- */
- export declare function evalFunction(data: any, express: any): any;
- /**
- * 获取表格编辑的行数据
- */
- export declare function getGridEditRows(grid: any): any;
|