systemLib.d.ts 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. export declare const SIMPLE_RE: RegExp;
  2. /**
  3. * 判断目标字符串与关键字是否重叠
  4. * @param target 目标字符串
  5. * @param keyword 搜索关键字
  6. */
  7. export declare function pinyinMatch(target: any, keyword: any): boolean;
  8. /**
  9. * 对某个表达式进行求值
  10. * a:{query.a},b:{query.b} -> a:aValue,b:bValue
  11. *
  12. * @example
  13. * calcExpress(cc.viewModel.data, "WH_ID:{query.WH_ID},C:{theGrid.selection.data.WH_ID}")
  14. * 计算出来的值是: "WH_ID:queryWhId,C:JH000000001"
  15. *
  16. * @param data 数据环境对象
  17. * @param express 表达式对象
  18. */
  19. export declare function calcExpress(data: any, express: any): any;
  20. /**
  21. * 对个对象进行表达式求值,不用回调
  22. * @example
  23. * 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}'] })
  24. *
  25. * {
  26. * a: '{query.a}',
  27. * b: {
  28. * b1: '{query.b1}',
  29. * b2: '{query.b2}',
  30. * },
  31. * c: 'aa',
  32. * d: [
  33. * '{query.d1}',
  34. * '{query.d2}'
  35. * ]
  36. * }
  37. *
  38. * 计算结果为
  39. * {
  40. * a: 'aValue',
  41. * b: {
  42. * b1: 'b1Value',
  43. * b2: 'b2Value'
  44. * },
  45. * c: 'aa'
  46. * d: [
  47. * '1',
  48. * '2'
  49. * ]
  50. * }
  51. *
  52. * @param data
  53. * @param paramObject
  54. */
  55. export declare function calcObjectFlat(data: any, paramObject: any): any;
  56. /**
  57. * 合併 data 到當前的 ViewModel 對象
  58. */
  59. export declare function mergeViewModel(viewModel: any, propertyName: any, data: any, isFlat: any): void;
  60. /**
  61. * 转换内联结构的行,到平面结构
  62. * company: { name:'公司1', id:'编号1' } => { company_id:'编号1', company_name:'公司1' }
  63. *
  64. * @param array
  65. * @param flatOption
  66. * @return {[]}
  67. */
  68. export declare function flatRow(array: any): any[];
  69. /**
  70. * 替换内部结构中,所有 N/A
  71. */
  72. export declare function replaceNA(obj: any): string;
  73. /**
  74. * 根据表达式进入写值
  75. * express="{query.a}" 写值就是 viewModel.set('query.a', value)
  76. * express="test-{query.a}" 写值就会失败
  77. *
  78. * @example
  79. * tryWriteByExpress(cc.viewModel, "{query.WH_ID}", "111")
  80. * 写值成功
  81. *
  82. * tryWriteByExpress(cc.viewModel, "test-{query.WH_ID}", "111")
  83. * 写值失败
  84. *
  85. * @param viewModel VM对象
  86. * @param express 表达式对象
  87. * @param value 目标值
  88. */
  89. export declare function tryWriteByExpress(viewModel: any, express: any, value: any): void;
  90. /**
  91. * 尝试根据含表达式的对象回写, calcObjectFlat 的逆向方法
  92. * @example
  93. * 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]})
  94. *
  95. * expressObject:
  96. * {
  97. * a: '{query.a}',
  98. * b: {
  99. * b1: '{query.b1}',
  100. * b2: '{query.b2}',
  101. * },
  102. * c: 'aa',
  103. * d: [
  104. * '{query.a}',
  105. * '{query.b2}'
  106. * ]
  107. * }
  108. *
  109. * valueObject:
  110. * {
  111. * a: 'aValue',
  112. * b: {
  113. * b1: 'b1Value',
  114. * b2: 'b2Value'
  115. * },
  116. * c: 'aa'
  117. * c: [
  118. * 'aValue',
  119. * 'b2Value'
  120. * ]
  121. * }
  122. *
  123. * 系统会尝试回写
  124. * viewModel.set('query.a', 'aValue')
  125. * viewModel.set('query.b1', 'b1Value')
  126. * viewModel.set('query.b2', 'b2Value')
  127. *
  128. * @param expressObject 含表达式的对象
  129. * @param valueObject 表达式计算完成之后的结果对象
  130. * @param writeFn 写入的方法 (path, value)=>void
  131. */
  132. export declare function tryWriteObject(expressObject: any, valueObject: any, writeFn: any): void;
  133. /**
  134. * 尝试去掉变量两边括号
  135. * {a} => a
  136. * a => a
  137. */
  138. export declare function tryVarSimple(value: any): any;
  139. /**
  140. * 对多个表达式进行求值. 异步回调的方式返回
  141. * {
  142. * a: 1,
  143. * b: '{someBind}',
  144. * c: ['a', 'b', 'c'],
  145. * d: ['a', 'b', '{someBind}'],
  146. * e: {
  147. * y: 1,
  148. * z: 2
  149. * },
  150. * f: {
  151. * y: 1,
  152. * z: '{someBind}'
  153. * }
  154. * }
  155. *
  156. * // Will produce
  157. * {
  158. * b: value,
  159. * d: ['a', 'b', value],
  160. * f: {
  161. * y: 1,
  162. * z: value
  163. * }
  164. * }
  165. * @param viewModel scope.viewModel对象
  166. * @param paramObject 求值对象
  167. */
  168. export declare function calcObject(viewModel: any, paramObject: any): Promise<unknown>;
  169. /**
  170. * 用于任意组件 Ext.Component 构造时,获取当前组件对应的表格(如果不是 grid.columns 对象就会返回 undefined)
  171. * @param config 组件构造函数传入的 config 配置文件
  172. */
  173. export declare function getParentGrid(config: any): any;
  174. /**
  175. * 解析
  176. * {
  177. * condition: "{skuId}",
  178. * errorMsg: "无法编辑",
  179. * notice: 'msg'
  180. * }
  181. */
  182. export declare function tryEnable(data: any, enableSetting: any): boolean;
  183. /**
  184. * 动态的为 combo 或 columns.combo 设置下拉框的值
  185. * @param sender 目标对象
  186. * @param config 目标对象的配置(在构造函数之前也可以)
  187. * @param getDictFn 获取字典的方法
  188. * @param bizKey 传入字典的参数
  189. * @param multiValueSeparator 多个字典值的分割符号
  190. */
  191. export declare function setComboStore(sender: any, config: any, getDictFn: any, bizKey: any, multiValueSeparator?: string): Promise<unknown>;
  192. /**
  193. * 调用服务器 Ajax
  194. */
  195. export declare function invokeServer(url: string, ...args: any[]): any;
  196. export declare function clearViewModelValues(viewModel: any, propertyName: any): void;
  197. export declare function reloadGrid(scope: any, gridRefName: any): void;
  198. /**
  199. * 将 Ext.data.Model 对象 (及子属性) 转换为 js.object 对象
  200. */
  201. export declare function toPlainObject(obj: any): any;
  202. export declare function confirm(msg: any, sender?: any): Promise<void>;
  203. /**
  204. * 任何符号字符串都替换成下换线
  205. */
  206. export declare function normId(value: string): string;
  207. /**
  208. *
  209. * @param sender
  210. * @param propertyName
  211. * @param gridRefName
  212. */
  213. export declare function clearViewModelReloadGrid(sender: any, propertyName: any, gridRefName: any): void;
  214. export declare function saveGridRow(grid1: any): void;
  215. export declare function insertGridRow(grid1: any): void;
  216. export declare function commitMe(sender: any): void;
  217. export declare function removeGridRow(grid1: any): void;
  218. export declare function moveUpGridRow(grid: any): void;
  219. export declare function moveDownGridRow(grid: any): void;
  220. export declare class SystemEventFu {
  221. moveUpGridRow(): (sender: any) => void;
  222. commitMe(): (sender: any) => void;
  223. moveDownGridRow(): (sender: any) => void;
  224. saveGridRow(): (sender: any) => void;
  225. insertGridRow(): (sender: any) => void;
  226. removeGridRow(): (sender: any) => void;
  227. enterToClick(btnReferenceName: any): (sender: any, config: any) => void;
  228. confirm(text: any, fn: any): (sender: any) => void;
  229. gridRemoveCurrentRow(gridRefName: any): (sender: any) => void;
  230. loadForm(invokeUrl: string, invokeParam: any, writeTarget: any): (sender: any) => void;
  231. commit(groovyUrl: string, arg0: any, successCallback: any): (sender: any) => void;
  232. formCommit(groovyUrl: string, arg0: any): (sender: any) => void;
  233. dialogSuccess(lookupObject: any): (sender: any) => void;
  234. clearViewModelValues(propertyName: string): (sender: any) => void;
  235. getGrid(url: any): (sender: any, config: any) => void;
  236. clearViewModelReloadGrid(propertyName: string, gridRefName?: string): (sender: any) => void;
  237. reloadGrid(gridRefName: string): (sender: any) => void;
  238. showDialog(url: string, lookupForData: any, successCallback: any): (sender: any) => void;
  239. showWidget(widgetUrl: any, lookup: any): (sender: any, queryValue: any) => void;
  240. clearViewModelByLookup(lookup: any): (sender: any) => void;
  241. closeMe(callBack: any): (sender: any) => void;
  242. showDialogAndFillData(url: string, lookupForData: any, map: any): (sender: any) => Promise<unknown>;
  243. }
  244. /**
  245. * 清空 viewmodel 里下属的所有属性
  246. * @param viewModel VM对象
  247. * @param propertyKey 要清空的属性,可以是 "a.b.c" 这种表达模式
  248. * @param ignoreProps 要忽略清空的属性名集合, 比如 ["a.b","b"]
  249. */
  250. export declare function clearViewModel(viewModel: any, propertyKey: any, ignoreProps: any): void;
  251. export declare function clearViewModelByLookup(sender: any, lookup: any): void;
  252. export declare function showWidget(widgetUrl: any, lookup: any, sender: any, queryValue: any, vjson?: {}): void;
  253. /**
  254. * 停止事件的默认行为
  255. * @param e
  256. */
  257. export declare function stopEvent(e: any): void;
  258. /**
  259. * 屏幕中央显示一个黑框提示
  260. */
  261. export declare function msg(content: any): void;
  262. /**
  263. * 错误对话框的强提醒
  264. */
  265. export declare function showErrorDialog(msg: any, sender?: any): void;
  266. /**
  267. * 错误对话框的强提醒
  268. */
  269. export declare function showInfoDialog(msg: any, sender?: any): void;
  270. /**
  271. * 错误对话框的强提醒
  272. */
  273. export declare function prompt(message: any, defaultValue?: string, multiLine?: boolean): Promise<string>;
  274. /**
  275. * 用于计算 express 表达式
  276. */
  277. export declare function evalFunction(data: any, express: any): any;
  278. /**
  279. * 获取表格编辑的行数据
  280. */
  281. export declare function getGridEditRows(grid: any): any;