index.js 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. const iconPrefix = 'vxe-icon--'
  2. const GlobalConfig = {
  3. // size: null, // 全局尺寸
  4. zIndex: 999, // 全局 zIndex 起始值,如果项目的的 z-index 样式值过大时就需要跟随设置更大,避免被遮挡
  5. version: 0, // 版本号,对于某些带数据缓存的功能有用到,上升版本号可以用于重置数据
  6. // resizeInterval: 500,
  7. emptyCell: ' ',
  8. table: {
  9. fit: true,
  10. showHeader: true,
  11. animat: true,
  12. delayHover: 250,
  13. // keepSource: false,
  14. // cloak: false,
  15. // showOverflow: null,
  16. // showHeaderOverflow: null,
  17. // showFooterOverflow: null,
  18. // resizeInterval: 500,
  19. // size: null,
  20. // zIndex: null,
  21. // resizable: false,
  22. // autoResize: false,
  23. // stripe: false,
  24. // border: false,
  25. // round: false,
  26. // emptyRender: {
  27. // name: ''
  28. // },
  29. // radioConfig: {
  30. // trigger: 'default'
  31. // },
  32. // checkboxConfig: {
  33. // trigger: 'default'
  34. // },
  35. // tooltipConfig: {
  36. // theme: 'dark',
  37. // enterable: false
  38. // },
  39. validConfig: {
  40. showMessage: true,
  41. message: 'default'
  42. },
  43. // menuConfig: {
  44. // visibleMethod () {}
  45. // },
  46. // customConfig: {
  47. // storage: false,
  48. // checkMethod () {}
  49. // },
  50. // rowId: '_XID', // 行数据的唯一主键字段名
  51. sortConfig: {
  52. // remote: false,
  53. // trigger: 'default',
  54. // orders: ['asc', 'desc', null],
  55. // sortMethod: null,
  56. showIcon: true
  57. },
  58. filterConfig: {
  59. // remote: false,
  60. // filterMethod: null,
  61. showIcon: true
  62. },
  63. treeConfig: {
  64. children: 'children',
  65. hasChild: 'hasChild',
  66. indent: 20,
  67. showIcon: true
  68. },
  69. keyboardConfig: {
  70. isChecked: true
  71. },
  72. expandConfig: {
  73. // trigger: 'default',
  74. showIcon: true
  75. },
  76. editConfig: {
  77. // mode: 'cell',
  78. showIcon: true,
  79. showAsterisk: true
  80. },
  81. importConfig: {
  82. modes: ['insert', 'covering']
  83. },
  84. exportConfig: {
  85. // isPrint: false,
  86. modes: ['current', 'selected']
  87. },
  88. mouseConfig: {
  89. extension: true
  90. },
  91. areaConfig: {
  92. selectCellByHeader: true
  93. },
  94. clipConfig: {
  95. isCopy: true,
  96. isCut: true,
  97. isPaste: true
  98. },
  99. fnrConfig: {
  100. isFind: true,
  101. isReplace: true
  102. },
  103. scrollX: {
  104. enabled: true,
  105. gt: 60
  106. // oSize: 0,
  107. // rSize: 0
  108. // vSize: 0
  109. },
  110. scrollY: {
  111. enabled: true,
  112. gt: 100
  113. // oSize: 0,
  114. // rSize: 0
  115. // vSize: 0,
  116. // rHeight: 0
  117. }
  118. },
  119. export: {
  120. types: {}
  121. },
  122. icon: {
  123. // table
  124. TABLE_SORT_ASC: iconPrefix + 'caret-top',
  125. TABLE_SORT_DESC: iconPrefix + 'caret-bottom',
  126. TABLE_FILTER_NONE: iconPrefix + 'funnel',
  127. TABLE_FILTER_MATCH: iconPrefix + 'funnel',
  128. TABLE_EDIT: iconPrefix + 'edit-outline',
  129. TABLE_HELP: iconPrefix + 'question',
  130. TABLE_TREE_LOADED: iconPrefix + 'refresh roll',
  131. TABLE_TREE_OPEN: iconPrefix + 'caret-right rotate90',
  132. TABLE_TREE_CLOSE: iconPrefix + 'caret-right',
  133. TABLE_EXPAND_LOADED: iconPrefix + 'refresh roll',
  134. TABLE_EXPAND_OPEN: iconPrefix + 'arrow-right rotate90',
  135. TABLE_EXPAND_CLOSE: iconPrefix + 'arrow-right',
  136. // button
  137. BUTTON_DROPDOWN: iconPrefix + 'arrow-bottom',
  138. BUTTON_LOADING: iconPrefix + 'refresh roll',
  139. // select
  140. SELECT_LOADED: iconPrefix + 'refresh roll',
  141. SELECT_OPEN: iconPrefix + 'caret-bottom rotate180',
  142. SELECT_CLOSE: iconPrefix + 'caret-bottom',
  143. // pager
  144. PAGER_JUMP_PREV: iconPrefix + 'd-arrow-left',
  145. PAGER_JUMP_NEXT: iconPrefix + 'd-arrow-right',
  146. PAGER_PREV_PAGE: iconPrefix + 'arrow-left',
  147. PAGER_NEXT_PAGE: iconPrefix + 'arrow-right',
  148. PAGER_JUMP_MORE: iconPrefix + 'more',
  149. // input
  150. INPUT_CLEAR: iconPrefix + 'close',
  151. INPUT_PWD: iconPrefix + 'eye-slash',
  152. INPUT_SHOW_PWD: iconPrefix + 'eye',
  153. INPUT_PREV_NUM: iconPrefix + 'caret-top',
  154. INPUT_NEXT_NUM: iconPrefix + 'caret-bottom',
  155. INPUT_DATE: iconPrefix + 'calendar',
  156. INPUT_SEARCH: iconPrefix + 'search',
  157. // modal
  158. MODAL_ZOOM_IN: iconPrefix + 'square',
  159. MODAL_ZOOM_OUT: iconPrefix + 'zoomout',
  160. MODAL_CLOSE: iconPrefix + 'close',
  161. MODAL_INFO: iconPrefix + 'info',
  162. MODAL_SUCCESS: iconPrefix + 'success',
  163. MODAL_WARNING: iconPrefix + 'warning',
  164. MODAL_ERROR: iconPrefix + 'error',
  165. MODAL_QUESTION: iconPrefix + 'question',
  166. MODAL_LOADING: iconPrefix + 'refresh roll',
  167. // toolbar
  168. TOOLBAR_TOOLS_REFRESH: iconPrefix + 'refresh',
  169. TOOLBAR_TOOLS_REFRESH_LOADING: iconPrefix + 'refresh roll',
  170. TOOLBAR_TOOLS_IMPORT: iconPrefix + 'upload',
  171. TOOLBAR_TOOLS_EXPORT: iconPrefix + 'download',
  172. TOOLBAR_TOOLS_PRINT: iconPrefix + 'print',
  173. TOOLBAR_TOOLS_ZOOM_IN: iconPrefix + 'zoomin',
  174. TOOLBAR_TOOLS_ZOOM_OUT: iconPrefix + 'zoomout',
  175. TOOLBAR_TOOLS_CUSTOM: iconPrefix + 'menu',
  176. // form
  177. FORM_PREFIX: iconPrefix + 'info',
  178. FORM_SUFFIX: iconPrefix + 'info',
  179. FORM_FOLDING: iconPrefix + 'arrow-top rotate180',
  180. FORM_UNFOLDING: iconPrefix + 'arrow-top'
  181. },
  182. grid: {
  183. // size: null,
  184. // zoomConfig: {
  185. // escRestore: true
  186. // },
  187. formConfig: {
  188. enabled: true
  189. },
  190. pagerConfig: {
  191. enabled: true
  192. // perfect: false
  193. },
  194. toolbarConfig: {
  195. enabled: true
  196. // perfect: false
  197. },
  198. proxyConfig: {
  199. enabled: true,
  200. autoLoad: true,
  201. message: true,
  202. props: {
  203. list: null,
  204. result: 'result',
  205. total: 'page.total',
  206. message: 'message'
  207. }
  208. // beforeItem: null,
  209. // beforeColumn: null,
  210. // beforeQuery: null,
  211. // afterQuery: null,
  212. // beforeDelete: null,
  213. // afterDelete: null,
  214. // beforeSave: null,
  215. // afterSave: null
  216. }
  217. },
  218. tooltip: {
  219. // size: null,
  220. trigger: 'hover',
  221. theme: 'dark',
  222. leaveDelay: 300
  223. },
  224. pager: {
  225. // size: null,
  226. // autoHidden: false,
  227. // perfect: true,
  228. // pageSize: 10,
  229. // pagerCount: 7,
  230. // pageSizes: [10, 15, 20, 50, 100],
  231. // layouts: ['PrevJump', 'PrevPage', 'Jump', 'PageCount', 'NextPage', 'NextJump', 'Sizes', 'Total']
  232. },
  233. form: {
  234. // preventSubmit: false,
  235. validConfig: {
  236. showMessage: true,
  237. autoPos: true
  238. },
  239. // size: null,
  240. // colon: false,
  241. titleAsterisk: true
  242. },
  243. input: {
  244. // size: null,
  245. // transfer: false
  246. // parseFormat: 'yyyy-MM-dd HH:mm:ss.SSS',
  247. // labelFormat: '',
  248. // valueFormat: '',
  249. minDate: new Date(1900, 0, 1),
  250. maxDate: new Date(2100, 0, 1),
  251. startDay: 1,
  252. selectDay: 1,
  253. digits: 2,
  254. controls: true
  255. },
  256. textarea: {
  257. // size: null,
  258. // autosize: {
  259. // minRows: 1,
  260. // maxRows: 10
  261. // }
  262. },
  263. select: {
  264. // size: null,
  265. // transfer: false,
  266. multiCharOverflow: 8
  267. },
  268. toolbar: {
  269. // size: null,
  270. // import: {
  271. // mode: 'covering'
  272. // },
  273. // export: {
  274. // types: ['csv', 'html', 'xml', 'txt']
  275. // },
  276. // custom: {
  277. // isFooter: true
  278. // },
  279. // buttons: []
  280. },
  281. button: {
  282. // size: null,
  283. // transfer: false
  284. },
  285. radio: {
  286. // size: null
  287. },
  288. checkbox: {
  289. // size: null
  290. },
  291. switch: {
  292. // size: null
  293. },
  294. modal: {
  295. // size: null,
  296. top: 15,
  297. showHeader: true,
  298. minWidth: 340,
  299. minHeight: 140,
  300. lockView: true,
  301. mask: true,
  302. duration: 3000,
  303. marginSize: 0,
  304. dblclickZoom: true,
  305. showTitleOverflow: true,
  306. animat: true,
  307. showClose: true,
  308. // storage: false,
  309. storageKey: 'VXE_MODAL_POSITION'
  310. },
  311. list: {
  312. // size: null,
  313. scrollY: {
  314. enabled: true,
  315. gt: 100
  316. // oSize: 0,
  317. // rSize: 0
  318. // vSize: 0,
  319. // rHeight: 0
  320. }
  321. },
  322. i18n: key => key
  323. }
  324. export default GlobalConfig