imatrix-ui 2.8.97-dw-tmp2 → 2.8.97-dw-tmp4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/lib/super-ui.css +1 -0
  2. package/lib/super-ui.umd.min.js +36 -1
  3. package/package.json +1 -2
  4. package/src/i18n/i18n.js +1 -1
  5. package/src/i18n/langs/cn.js +1 -1
  6. package/src/i18n/langs/en.js +1 -1
  7. package/src/permission.js +1 -1
  8. package/src/plugins.js +4 -4
  9. package/src/store/modules/permission.js +5 -0
  10. package/src/styles/index.scss +2 -2
  11. package/src/utils/permissionAuth.js +6 -0
  12. package/src/utils/request.js +1 -1
  13. package/src/views/login/index.vue +1 -1
  14. package/lib/css/super-ui.common~46f24e9d.f712732a.css +0 -1
  15. package/lib/css/super-ui.common~60a56baa.e6f54088.css +0 -1
  16. package/lib/css/super-ui.common~691e02b5.3387eefb.css +0 -1
  17. package/lib/css/super-ui.common~e2e93592.e9ec19a9.css +0 -1
  18. package/lib/css/super-ui.umd.min~46f24e9d.f712732a.css +0 -1
  19. package/lib/css/super-ui.umd.min~60a56baa.e6f54088.css +0 -1
  20. package/lib/css/super-ui.umd.min~691e02b5.3387eefb.css +0 -1
  21. package/lib/css/super-ui.umd.min~e2e93592.e9ec19a9.css +0 -1
  22. package/lib/css/super-ui.umd~46f24e9d.f712732a.css +0 -1
  23. package/lib/css/super-ui.umd~60a56baa.e6f54088.css +0 -1
  24. package/lib/css/super-ui.umd~691e02b5.3387eefb.css +0 -1
  25. package/lib/css/super-ui.umd~e2e93592.e9ec19a9.css +0 -1
  26. package/lib/css/vendors~super-ui.common~253ae210.b57e4bfb.css +0 -1
  27. package/lib/css/vendors~super-ui.umd.min~253ae210.b57e4bfb.css +0 -1
  28. package/lib/css/vendors~super-ui.umd~253ae210.b57e4bfb.css +0 -1
  29. package/lib/css/yarn.tinymce~97d7b732.ea366551.css +0 -1
  30. package/lib/super-ui.common.super-ui.common~46f24e9d.js +0 -12446
  31. package/lib/super-ui.common.super-ui.common~60a56baa.js +0 -2774
  32. package/lib/super-ui.common.super-ui.common~691e02b5.js +0 -3062
  33. package/lib/super-ui.common.super-ui.common~970f9218.js +0 -3729
  34. package/lib/super-ui.common.super-ui.common~bd3594d6.js +0 -5264
  35. package/lib/super-ui.common.super-ui.common~e2e93592.js +0 -6945
  36. package/lib/super-ui.common.vendors~super-ui.common~253ae210.js +0 -3504
  37. package/lib/super-ui.common.yarn.async-validator~7864cd12.js +0 -1225
  38. package/lib/super-ui.common.yarn.core-js~2b13b260.js +0 -7542
  39. package/lib/super-ui.common.yarn.gcommon~c5c7b9b4.js +0 -11
  40. package/lib/super-ui.common.yarn.gcommon~cd278a5f.js +0 -4846
  41. package/lib/super-ui.common.yarn.resize-observer-polyfill~7370204d.js +0 -942
  42. package/lib/super-ui.common.yarn.sortablejs~f811d8fd.js +0 -3714
  43. package/lib/super-ui.common.yarn.tinymce~253ae210.js +0 -568
  44. package/lib/super-ui.common.yarn.tinymce~29bc5d46.js +0 -2125
  45. package/lib/super-ui.common.yarn.tinymce~35f50c21.js +0 -34090
  46. package/lib/super-ui.common.yarn.tinymce~8a52df3b.js +0 -30088
  47. package/lib/super-ui.common.yarn.tinymce~97d7b732.js +0 -31
  48. package/lib/super-ui.common.yarn.tinymce~b5d80f29.js +0 -7936
  49. package/lib/super-ui.common.yarn.tinymce~c1068939.js +0 -13346
  50. package/lib/super-ui.common.yarn.vue-i18n~02576867.js +0 -2179
  51. package/lib/super-ui.common.yarn.vue-virtual-scroll-list~bd67cfcd.js +0 -1069
  52. package/lib/super-ui.common.yarn.zxing~3446ce64.js +0 -11996
  53. package/lib/super-ui.common.yarn.zxing~61a1471b.js +0 -11202
  54. package/lib/super-ui.common.yarn.zxing~b49f3034.js +0 -3576
  55. package/lib/super-ui.common.yarn.zxing~fd3cc9f3.js +0 -2916
  56. package/lib/super-ui.umd.min.super-ui.umd.min~46f24e9d.js +0 -2
  57. package/lib/super-ui.umd.min.super-ui.umd.min~60a56baa.js +0 -2
  58. package/lib/super-ui.umd.min.super-ui.umd.min~691e02b5.js +0 -2
  59. package/lib/super-ui.umd.min.super-ui.umd.min~970f9218.js +0 -2
  60. package/lib/super-ui.umd.min.super-ui.umd.min~bd3594d6.js +0 -2
  61. package/lib/super-ui.umd.min.super-ui.umd.min~e2e93592.js +0 -2
  62. package/lib/super-ui.umd.min.vendors~super-ui.umd.min~253ae210.js +0 -24
  63. package/lib/super-ui.umd.min.yarn.async-validator~7864cd12.js +0 -2
  64. package/lib/super-ui.umd.min.yarn.core-js~2b13b260.js +0 -2
  65. package/lib/super-ui.umd.min.yarn.gcommon~c5c7b9b4.js +0 -2
  66. package/lib/super-ui.umd.min.yarn.gcommon~cd278a5f.js +0 -26
  67. package/lib/super-ui.umd.min.yarn.resize-observer-polyfill~7370204d.js +0 -2
  68. package/lib/super-ui.umd.min.yarn.sortablejs~f811d8fd.js +0 -8
  69. package/lib/super-ui.umd.min.yarn.tinymce~253ae210.js +0 -2
  70. package/lib/super-ui.umd.min.yarn.tinymce~29bc5d46.js +0 -2
  71. package/lib/super-ui.umd.min.yarn.tinymce~35f50c21.js +0 -2
  72. package/lib/super-ui.umd.min.yarn.tinymce~8a52df3b.js +0 -2
  73. package/lib/super-ui.umd.min.yarn.tinymce~97d7b732.js +0 -2
  74. package/lib/super-ui.umd.min.yarn.tinymce~b5d80f29.js +0 -2
  75. package/lib/super-ui.umd.min.yarn.tinymce~c1068939.js +0 -2
  76. package/lib/super-ui.umd.min.yarn.vue-i18n~02576867.js +0 -7
  77. package/lib/super-ui.umd.min.yarn.vue-virtual-scroll-list~bd67cfcd.js +0 -8
  78. package/lib/super-ui.umd.min.yarn.zxing~3446ce64.js +0 -2
  79. package/lib/super-ui.umd.min.yarn.zxing~61a1471b.js +0 -2
  80. package/lib/super-ui.umd.min.yarn.zxing~b49f3034.js +0 -2
  81. package/lib/super-ui.umd.min.yarn.zxing~fd3cc9f3.js +0 -2
  82. package/lib/super-ui.umd.super-ui.umd~46f24e9d.js +0 -12446
  83. package/lib/super-ui.umd.super-ui.umd~60a56baa.js +0 -2774
  84. package/lib/super-ui.umd.super-ui.umd~691e02b5.js +0 -3062
  85. package/lib/super-ui.umd.super-ui.umd~970f9218.js +0 -3739
  86. package/lib/super-ui.umd.super-ui.umd~bd3594d6.js +0 -5264
  87. package/lib/super-ui.umd.super-ui.umd~e2e93592.js +0 -6945
  88. package/lib/super-ui.umd.vendors~super-ui.umd~253ae210.js +0 -3504
  89. package/lib/super-ui.umd.yarn.async-validator~7864cd12.js +0 -1225
  90. package/lib/super-ui.umd.yarn.core-js~2b13b260.js +0 -7542
  91. package/lib/super-ui.umd.yarn.gcommon~c5c7b9b4.js +0 -11
  92. package/lib/super-ui.umd.yarn.gcommon~cd278a5f.js +0 -4846
  93. package/lib/super-ui.umd.yarn.resize-observer-polyfill~7370204d.js +0 -942
  94. package/lib/super-ui.umd.yarn.sortablejs~f811d8fd.js +0 -3714
  95. package/lib/super-ui.umd.yarn.tinymce~253ae210.js +0 -568
  96. package/lib/super-ui.umd.yarn.tinymce~29bc5d46.js +0 -2125
  97. package/lib/super-ui.umd.yarn.tinymce~35f50c21.js +0 -34090
  98. package/lib/super-ui.umd.yarn.tinymce~8a52df3b.js +0 -30088
  99. package/lib/super-ui.umd.yarn.tinymce~97d7b732.js +0 -31
  100. package/lib/super-ui.umd.yarn.tinymce~b5d80f29.js +0 -7936
  101. package/lib/super-ui.umd.yarn.tinymce~c1068939.js +0 -13346
  102. package/lib/super-ui.umd.yarn.vue-i18n~02576867.js +0 -2179
  103. package/lib/super-ui.umd.yarn.vue-virtual-scroll-list~bd67cfcd.js +0 -1069
  104. package/lib/super-ui.umd.yarn.zxing~3446ce64.js +0 -11996
  105. package/lib/super-ui.umd.yarn.zxing~61a1471b.js +0 -11202
  106. package/lib/super-ui.umd.yarn.zxing~b49f3034.js +0 -3576
  107. package/lib/super-ui.umd.yarn.zxing~fd3cc9f3.js +0 -2916
@@ -1,2774 +0,0 @@
1
- ((typeof self !== 'undefined' ? self : this)["webpackJsonpsuper_ui"] = (typeof self !== 'undefined' ? self : this)["webpackJsonpsuper_ui"] || []).push([[2],{
2
-
3
- /***/ "45ae":
4
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
5
-
6
- "use strict";
7
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_search_form_vue_vue_type_style_index_0_id_398b171b_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ea60");
8
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_search_form_vue_vue_type_style_index_0_id_398b171b_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_6_oneOf_1_0_node_modules_css_loader_index_js_ref_6_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_6_oneOf_1_2_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_search_form_vue_vue_type_style_index_0_id_398b171b_scoped_true_lang_css___WEBPACK_IMPORTED_MODULE_0__);
9
- /* unused harmony reexport * */
10
-
11
-
12
- /***/ }),
13
-
14
- /***/ "5b34":
15
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
16
-
17
- "use strict";
18
-
19
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.function.name.js
20
- var es6_function_name = __webpack_require__("7f7f");
21
-
22
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"52d3a51e-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/super-nine-grid/src/super-nine-grid.vue?vue&type=template&id=4d6cc5f7&scoped=true&
23
- var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[(_vm.hasLoadedColumns)?_c('search-form',{directives:[{name:"show",rawName:"v-show",value:(_vm.showSearch),expression:"showSearch"}],ref:"sf",attrs:{"columns":_vm.columns,"code":_vm.code,"url":_vm.url,"pagination":_vm.pagination,"query":_vm.query,"search-param":_vm.searchFormContent,"init-search-props":_vm.initSearchProps,"grid-id":_vm.gridId},on:{"search":_vm.search,"reset":_vm.resetSearch}}):_vm._e(),_c('div',{staticClass:"nine-grid-area"},[_c('div',{style:('height:'+ _vm.height+'px;overflow-y: auto;overflow-x: hidden;'),attrs:{"id":_vm.gridId}},[_c('el-row',{attrs:{"gutter":20}},[(_vm.isHasCreate)?_c('el-col',{directives:[{name:"permission",rawName:"v-permission",value:(_vm.createPermission),expression:"createPermission"}],attrs:{"id":"_addCardId_","span":6,"offset":1.5}},[_c('el-card',{attrs:{"body-style":{ padding: '0px' }}},[_c('div',{staticClass:"add-screen",on:{"click":_vm.add}},[_c('span',{staticStyle:{"color":"#6882da"}},[_c('em',{staticClass:"el-icon-plus"}),_vm._v(" "+_vm._s(_vm.$t('superNineGrid.add')))])])])],1):_vm._e(),_vm._l((_vm.gridData),function(params,index){return _c('el-col',{key:params.id,staticClass:"col-content",attrs:{"span":6,"offset":1.5}},[_c('el-card',{attrs:{"body-style":{ padding: '0px' },"shadow":"hover"}},[_c('div',{on:{"mouseenter":function($event){return _vm.enter(index)},"mouseleave":function($event){return _vm.leave()},"click":function($event){return _vm.clickContent(params)}}},[_c('transition',{attrs:{"name":"fade"}},[(_vm.seen && index === _vm.current)?_c('div',{staticClass:"popContainer"},[_c('div',{staticClass:"else-button"},[_vm._l((_vm.operations),function(button){return [(_vm.isShowButton(params, button))?[(button.icon)?_c('el-tooltip',{directives:[{name:"permission",rawName:"v-permission",value:(button.permission?button.permission:'true'),expression:"button.permission?button.permission:'true'"}],key:button.name,staticClass:"item",attrs:{"effect":"dark","content":button.name,"placement":"top"}},[_c('em',{class:button.icon +' icons',on:{"click":function($event){$event.stopPropagation();return _vm.buttonClick(button.event, params)}}})]):_c('em',{directives:[{name:"permission",rawName:"v-permission",value:(button.permission?button.permission:'true'),expression:"button.permission?button.permission:'true'"}],key:button.name,class:button.name +' icons',on:{"click":function($event){$event.stopPropagation();return _vm.buttonClick(button.event, params)}}},[_vm._v(_vm._s(button.name)+" ")])]:_vm._e()]})],2)]):_vm._e()]),(_vm.props && _vm.props.imageUrl && _vm.objectPropValue(params, _vm.propCloumns.imageUrl, _vm.props.imageUrl))?_c('img',{staticClass:"image",attrs:{"src":_vm.defaultShowImageAction+_vm.objectPropValue(params, _vm.propCloumns.imageUrl, _vm.props.imageUrl),"alt":"加载失败"}}):_c('div',{staticClass:"image",staticStyle:{"display":"table","text-align":"center"}},[(_vm.props && _vm.props.content)?_c('div',{staticStyle:{"display":"table-cell","vertical-align":"middle"}},[_vm._v("\n "+_vm._s(_vm.getPropValue('content', params))+"\n ")]):(_vm.props && _vm.props.title)?_c('div',{staticStyle:{"display":"table-cell","vertical-align":"middle"}},[_vm._v("\n "+_vm._s(_vm.getPropValue('title', params))+"\n ")]):_vm._e()])],1),_c('el-divider'),_c('div',{staticStyle:{"padding":"10px 10px 10px 10px"}},[_c('div',{staticClass:"bottom clearfix"},[_c('time',{staticClass:"name"},[(_vm.props && _vm.props.title)?_c('span',[(_vm.multiple)?_c('el-checkbox',{staticStyle:{"width":"100%"},attrs:{"value":_vm.selectionModels['select'+params.id],"true-label":params.id,"false-label":'false-'+params.id,"title":_vm.getPropValue('title', params)},on:{"change":function($event){return _vm.changeChecked($event, index)}}},[_c('span',{style:(_vm.getTitleStyle(params))},[_vm._v(" "+_vm._s(_vm.getPropValue('title', params)))])]):(_vm.isShowRadio)?_c('el-radio',{staticStyle:{"width":"100%"},attrs:{"label":params.id,"title":_vm.getPropValue('title', params)},on:{"change":function($event){return _vm.changeSelectWhenRadio($event, index)}},model:{value:(_vm.currentId),callback:function ($$v) {_vm.currentId=$$v},expression:"currentId"}},[_c('span',{style:(_vm.getTitleStyle(params))},[_vm._v(" "+_vm._s(_vm.getPropValue('title', params)))])]):_c('span',{style:(_vm.getTitleStyle(params)),attrs:{"title":_vm.getPropValue('title', params)}},[_vm._v(" "+_vm._s(_vm.getPropValue('title', params)))])],1):(_vm.props && _vm.props.content)?_c('span',[(_vm.multiple)?_c('el-checkbox',{staticStyle:{"width":"100%"},attrs:{"value":_vm.selectionModels['select'+params.id],"true-label":params.id,"false-label":'false-'+params.id,"title":_vm.getPropValue('content', params)},on:{"change":function($event){return _vm.changeChecked($event, index)}}},[_vm._v(_vm._s(_vm.getPropValue('content', params)))]):(_vm.isShowRadio)?_c('el-radio',{staticStyle:{"width":"100%"},attrs:{"label":params.id,"title":_vm.getPropValue('content', params)},on:{"change":function($event){return _vm.changeSelectWhenRadio($event, index)}},model:{value:(_vm.currentId),callback:function ($$v) {_vm.currentId=$$v},expression:"currentId"}},[_vm._v(_vm._s(_vm.getPropValue('content', params)))]):_c('span',{staticStyle:{"width":"100%"},attrs:{"title":_vm.getPropValue('content', params)}},[_vm._v(" "+_vm._s(_vm.getPropValue('content', params)))])],1):_c('span',[(_vm.multiple)?_c('el-checkbox',{attrs:{"value":_vm.selectionModels['select'+params.id],"true-label":params.id,"false-label":'false-'+params.id},on:{"change":function($event){return _vm.changeChecked($event, index)}}},[_vm._v(_vm._s(index + 1))]):(_vm.isShowRadio)?_c('el-radio',{attrs:{"label":params.id},on:{"change":function($event){return _vm.changeSelectWhenRadio($event, index)}},model:{value:(_vm.currentId),callback:function ($$v) {_vm.currentId=$$v},expression:"currentId"}},[_vm._v(_vm._s(index + 1))]):_c('span',[_vm._v(" "+_vm._s(index + 1))])],1)]),(_vm.props && _vm.props.subTitle)?_c('time',{staticClass:"state"},[_c('span',{staticStyle:{"width":"100%"},attrs:{"title":_vm.getPropValue('subTitle', params)}},[_vm._v(_vm._s(_vm.getPropValue('subTitle', params)))])]):_vm._e()])])],1)],1)})],2)],1),(_vm.pagination)?_c('el-pagination',{attrs:{"current-page":_vm.currentPage,"page-sizes":_vm.pagination.pageSizes,"page-size":_vm.pagination.pageSize,"layout":_vm.pagination.layout,"total":_vm.pagination.total},on:{"update:currentPage":function($event){_vm.currentPage=$event},"update:current-page":function($event){_vm.currentPage=$event},"size-change":_vm.handleSizeChange,"current-change":_vm.handleCurrentChange}}):_vm._e()],1)],1)}
24
- var staticRenderFns = []
25
-
26
-
27
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/super-nine-grid.vue?vue&type=template&id=4d6cc5f7&scoped=true&
28
-
29
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es7.symbol.async-iterator.js
30
- var es7_symbol_async_iterator = __webpack_require__("ac4d");
31
-
32
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.symbol.js
33
- var es6_symbol = __webpack_require__("8a81");
34
-
35
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.string.iterator.js
36
- var es6_string_iterator = __webpack_require__("5df3");
37
-
38
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.from.js
39
- var es6_array_from = __webpack_require__("1c4c");
40
-
41
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.regexp.to-string.js
42
- var es6_regexp_to_string = __webpack_require__("6b54");
43
-
44
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es7.object.get-own-property-descriptors.js
45
- var es7_object_get_own_property_descriptors = __webpack_require__("8e6e");
46
-
47
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.array.iterator.js
48
- var es6_array_iterator = __webpack_require__("cadf");
49
-
50
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.keys.js
51
- var es6_object_keys = __webpack_require__("456d");
52
-
53
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.regexp.search.js
54
- var es6_regexp_search = __webpack_require__("386d");
55
-
56
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/toConsumableArray.js + 5 modules
57
- var toConsumableArray = __webpack_require__("2909");
58
-
59
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.promise.js
60
- var es6_promise = __webpack_require__("551c");
61
-
62
- // EXTERNAL MODULE: ./node_modules/core-js/modules/web.dom.iterable.js
63
- var web_dom_iterable = __webpack_require__("ac6a");
64
-
65
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.object.assign.js
66
- var es6_object_assign = __webpack_require__("f751");
67
-
68
- // EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
69
- var defineProperty = __webpack_require__("ade3");
70
-
71
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.regexp.split.js
72
- var es6_regexp_split = __webpack_require__("28a5");
73
-
74
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.regexp.replace.js
75
- var es6_regexp_replace = __webpack_require__("a481");
76
-
77
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/formatter.js
78
-
79
- var formatter = {
80
- number: function number(value, options) {
81
- debugger; // 小数位数
82
-
83
- var precision = options.precision; // 是否显示千分位
84
-
85
- var isDelimiter = options.delimiter; // 是否显示科学计数法
86
-
87
- var scientific = options.scientific; // 几位开始计算
88
-
89
- var scientificNum = options.scientificNum;
90
-
91
- if (value != null) {
92
- if (precision > 0) {
93
- // 表示有小数
94
- value = parseFloat(value);
95
- value = value.toFixed(precision);
96
- }
97
-
98
- if (isDelimiter) {
99
- value = value.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,');
100
- }
101
-
102
- if (scientific != null) {
103
- var isScientific = false;
104
-
105
- if (scientificNum) {
106
- scientificNum = parseInt(scientificNum);
107
- } else {
108
- scientificNum = 11;
109
- }
110
-
111
- if (value.length >= scientificNum) {
112
- isScientific = true;
113
- }
114
-
115
- if (isScientific) {
116
- value = '' + value;
117
- value = parseFloat(value);
118
- value = value.toExponential(); // 转换为标准的科学计数法形式(字符串)
119
- // const tmpArray = eformat.match(/\d(?:\.(\d*))?e([+-]\d+)/) // 分离出小数值和指数值
120
- // value = value.toFixed(Math.max(0, (tmpArray[1] || '').length - tmpArray[2]))
121
- }
122
- }
123
- }
124
-
125
- return value;
126
- },
127
- currency: function currency(value, options) {
128
- // 单位:$ 或 ¥
129
- var sign = options.sign;
130
- return sign + this.number(value, options);
131
- },
132
- date: function date(value, options) {
133
- // format格式,例如:yyyy-m-d,yyyy-m-d hh:mm:ss等等
134
- var format = options.format;
135
-
136
- if (value != null) {
137
- var date = new Date(value);
138
- var y = date.getFullYear();
139
- var m = date.getMonth() + 1;
140
- var d = date.getDate();
141
- var h = date.getHours();
142
- var min = date.getMinutes();
143
- var s = date.getSeconds();
144
-
145
- if (m < 10) {
146
- m = '0' + m;
147
- }
148
-
149
- if (d < 10) {
150
- d = '0' + d;
151
- }
152
-
153
- if (h < 10) {
154
- h = '0' + h;
155
- }
156
-
157
- if (min < 10) {
158
- min = '0' + min;
159
- }
160
-
161
- if (s < 10) {
162
- s = '0' + s;
163
- }
164
-
165
- return format.replace('yyyy', y).replace('m', m).replace('d', d).replace('hh', h).replace('mm', min).replace('ss', s);
166
- }
167
-
168
- return value;
169
- },
170
- time: function time(value, options) {
171
- return this.date(value, options);
172
- },
173
- percent: function percent(value, options) {
174
- return this.number(value, options) + '%';
175
- }
176
- };
177
- function doFormat(column, value) {
178
- if (value === undefined || column === undefined) {
179
- return value;
180
- } // 先处理值设置再处理格式化设置:即会对值设置的结果进行格式化设置
181
-
182
-
183
- if (column.valueSet !== undefined) {
184
- var item = column.valueSet.filter(function (item) {
185
- return item.value === value + '';
186
- });
187
-
188
- if (item.length > 0) {
189
- // 数据库的原始值要显示成label值,后续对这个label进行格式化(不是处理原始值)
190
- value = item[0].label;
191
- }
192
- } // 获得默认的格式设置
193
-
194
-
195
- if (column.formatter === undefined) {
196
- if (column.dataType === 'DATE') {
197
- // 默认的“DATE”类型的格式设置
198
- column.formatter = {
199
- type: 'date',
200
- options: {
201
- format: 'yyyy-m-d'
202
- }
203
- };
204
- } else if (column.dataType === 'TIME') {
205
- // 默认的“TIME”类型的格式设置
206
- column.formatter = {
207
- type: 'time',
208
- options: {
209
- format: 'yyyy-m-d hh:mm:ss'
210
- }
211
- };
212
- }
213
- }
214
-
215
- var columnFormatter = column.formatter;
216
-
217
- if (columnFormatter !== undefined && formatter[columnFormatter.type] !== undefined) {
218
- return formatter[columnFormatter.type](value, columnFormatter.options);
219
- } else {
220
- return value;
221
- }
222
- }
223
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/custom-formatter.js
224
-
225
-
226
- // import Vue from 'vue'
227
-
228
- var customFormatter = {
229
- isObjectProp: function isObjectProp(prop) {
230
- if (prop.indexOf('.') > 0) {
231
- return true;
232
- } else {
233
- return false;
234
- }
235
- },
236
- objectPropOriginalValue: function objectPropOriginalValue(row, prop) {
237
- try {
238
- // console.log('---super-grid--objectPropOriginalValue--')
239
- var objValue = row;
240
- var props = prop.split('.');
241
- props.forEach(function (subProp) {
242
- if (objValue) {
243
- objValue = objValue[subProp];
244
- } else {
245
- objValue = '';
246
- throw objValue;
247
- }
248
- });
249
- return objValue;
250
- } catch (e) {
251
- // console.log(e)
252
- return '';
253
- }
254
- },
255
- objectPropValue: function objectPropValue(row, column, prop) {
256
- // console.log('---super-grid--objectPropValue--')
257
- var val = doFormat(column, this.objectPropOriginalValue(row, prop));
258
- return val;
259
- },
260
- getColumnValue: function getColumnValue(row, column) {
261
- var prop = column.prop;
262
- var originalValue = row[prop];
263
-
264
- if (this.isObjectProp(prop)) {
265
- originalValue = this.objectPropOriginalValue(row, prop);
266
- }
267
-
268
- var formatValue = doFormat(column, originalValue);
269
- return {
270
- originalValue: originalValue,
271
- formatValue: formatValue
272
- };
273
- },
274
- onClickFun: function onClickFun(row, column, onClick, rowIndex) {
275
- var values = this.getColumnValue(row, column);
276
- onClick.call(this, values.originalValue, values.formatValue, row, column, rowIndex);
277
- },
278
- isShowButtonFun: function isShowButtonFun(entity, button) {
279
- var isShowFun = button.isShow;
280
-
281
- if (isShowFun === undefined) {
282
- return true;
283
- }
284
-
285
- if (typeof isShowFun === 'function') {
286
- var isShow = isShowFun.call(this, entity, button);
287
-
288
- if (isShow === undefined) {
289
- isShow = true;
290
- }
291
-
292
- return isShow;
293
- } else {
294
- return isShowFun;
295
- }
296
- }
297
- };
298
- /* harmony default export */ var custom_formatter = (customFormatter);
299
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"52d3a51e-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/super-nine-grid/src/search-form.vue?vue&type=template&id=398b171b&scoped=true&
300
- var search_formvue_type_template_id_398b171b_scoped_true_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.searchableColumns.length > 0)?_c('el-form',{ref:"searchForm",staticClass:"grid-search-form",attrs:{"model":_vm.searchForm,"rules":_vm.rules,"label-width":_vm.labelWidth,"label-position":_vm.query.queryLabelPosition,"size":"mini"}},[_c('table',_vm._l((_vm.rowNum),function(r){return _c('tr',{key:r},_vm._l((_vm.getColumnNumPerRow(r,_vm.searchableColumns.length)),function(n){return _c('td',{key:n},[_c('el-form-item',{style:({paddingLeft:'10px',minWidth:'200px'}),attrs:{"prop":_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,"label-width":_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchLabelWidth?_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchLabelWidth:'80px'}},[_c('template',{slot:"label"},[(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchLabel && _vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchLabel !== '')?_c('span',{domProps:{"innerHTML":_vm._s(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchLabel.replace(/\\n/g, '</br>'))}}):_c('span',{domProps:{"innerHTML":_vm._s(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].label.replace(/\\n/g, '</br>'))}})]),(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].dataType === 'DATE' || _vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType==='date' )?_c('el-date-picker',{style:(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchControlWidth),attrs:{"value":_vm.getFormItemValue(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop),"type":"daterange","range-separator":_vm.$t('imatrixUIPublicModel.to'),"unlink-panels":"","start-placeholder":_vm.$t('imatrixUIMessage.startDate'),"end-placeholder":_vm.$t('imatrixUIMessage.endDate'),"value-format":"yyyy-MM-dd"},on:{"input":function($event){_vm.setValueToModelProp(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,$event)}}}):(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType==='dateTimePicker')?_c('el-date-picker',{style:(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchControlWidth),attrs:{"value":_vm.getFormItemValue(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop),"type":"datetimerange","range-separator":_vm.$t('imatrixUIPublicModel.to'),"unlink-panels":"","start-placeholder":_vm.$t('imatrixUIMessage.startDate'),"end-placeholder":_vm.$t('imatrixUIMessage.endDate'),"value-format":"yyyy-MM-dd HH:mm:ss"},on:{"input":function($event){_vm.setValueToModelProp(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,$event)}}}):(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].dataType === 'TIME' && _vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType==='timepicker')?_c('el-date-picker',{style:(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchControlWidth),attrs:{"value":_vm.getFormItemValue(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop),"type":"datetimerange","range-separator":_vm.$t('imatrixUIPublicModel.to'),"unlink-panels":"","start-placeholder":_vm.$t('imatrixUIMessage.startDate'),"end-placeholder":_vm.$t('imatrixUIMessage.endDate'),"value-format":"HH:mm:ss"},on:{"input":function($event){_vm.setValueToModelProp(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,$event)}}}):(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType==='timepicker' && _vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].dataType !== 'TIME' && _vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].dataType !== 'DATE' )?_c('el-time-picker',{staticStyle:{"width":"100%"},attrs:{"type":"fixed-time","placeholder":_vm.$t('imatrixUIMessage.selectTime'),"value-format":"HH:mm:ss","value":_vm.getFormItemValue(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop)},on:{"input":function($event){_vm.setValueToModelProp(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,$event)}}}):((_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType && _vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType==='select') || _vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].dataType === 'BOOLEAN')?_c('el-select',{style:(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchControlWidth),attrs:{"clearable":"","placeholder":_vm.$t('imatrixUIMessage.pleaseSelect'),"value":_vm.getFormItemValue(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop)},on:{"input":function($event){_vm.setValueToModelProp(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,$event)}}},_vm._l((_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].valueSet),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.label,"value":item.value}})}),1):(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType && _vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType==='multiselect')?_c('el-select',{style:(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchControlWidth),attrs:{"clearable":"","multiple":"","collapse-tags":"","placeholder":_vm.$t('imatrixUIMessage.pleaseSelect'),"value":_vm.getFormItemValue(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop)},on:{"input":function($event){_vm.setValueToModelProp(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,$event)}}},_vm._l((_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].valueSet),function(item){return _c('el-option',{key:item.value,attrs:{"label":item.label,"value":item.value}})}),1):(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType && _vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType==='inputNumber')?_c('search-form-number',{attrs:{"r":r,"n":n},on:{"setValue":_vm.setNumberValue}}):(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType && _vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType==='switch')?_c('el-switch',{style:(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchControlWidth),attrs:{"active-color":"#13ce66","inactive-color":"#ff4949","value":_vm.getFormItemValue(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop)},on:{"input":function($event){_vm.setValueToModelProp(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,$event)}}}):(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType && _vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType==='slider')?_c('el-slider',{style:(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchControlWidth),attrs:{"value":_vm.getFormItemValue(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop)},on:{"input":function($event){_vm.setValueToModelProp(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,$event)}}}):(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType && _vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentType==='rate')?_c('el-rate',{style:(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchControlWidth),attrs:{"value":_vm.getFormItemValue(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop)},on:{"input":function($event){_vm.setValueToModelProp(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,$event)}}}):(_vm.customComponent(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)]) === true)?_c('span',[_c(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentName,{ref:_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].componentName,refInFor:true,tag:"component",staticClass:"customComponent",attrs:{"prop":_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,"value":_vm.getFormItemValue(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop)},on:{"input":function($event){_vm.setValueToModelProp(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,$event)}}})],1):_c('el-input',{style:(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].searchControlWidth),attrs:{"value":_vm.getFormItemValue(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop)},on:{"input":function($event){_vm.setValueToModelProp(_vm.searchableColumns[_vm.fieldNum*(r-1)+(n-1)].prop,$event)}},nativeOn:{"keyup":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,"enter",13,$event.key,"Enter")){ return null; }return _vm.submitForm('searchForm')}}})],2)],1)}),0)}),0),_c('el-form-item',{staticClass:"search-btn"},[_c('el-button',{attrs:{"loading":_vm.loading,"type":"primary","size":"mini"},on:{"click":function($event){return _vm.submitForm('searchForm')}}},[_vm._v("\n "+_vm._s(_vm.$t('imatrixUIPublicModel.sure'))+"\n ")]),_c('el-button',{attrs:{"loading":_vm.loading,"size":"mini"},on:{"click":function($event){return _vm.resetForm('searchForm')}}},[_vm._v("\n "+_vm._s(_vm.$t('imatrixUIPublicModel.reset'))+"\n ")])],1)],1):_vm._e()}
301
- var search_formvue_type_template_id_398b171b_scoped_true_staticRenderFns = []
302
-
303
-
304
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/search-form.vue?vue&type=template&id=398b171b&scoped=true&
305
-
306
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.set.js
307
- var es6_set = __webpack_require__("4f7f");
308
-
309
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/search-methods.js
310
-
311
-
312
-
313
-
314
- var searchMethods = {
315
- packageSearchParam: function packageSearchParam() {
316
- var _this = this;
317
-
318
- var searchParams = [];
319
- this.searchableColumns.forEach(function (column) {
320
- var param = {
321
- leftBracket: '',
322
- rightBracket: '',
323
- joinSign: 'and'
324
- }; // 布尔型字段时prop中去掉了is字符,查询时返回带有is的属性字段,
325
- // 否则会导致查询布尔型报500错误
326
-
327
- var orgProp = column.orgProp; // sql查询时,会把点“.”改为两个下划线"__"
328
-
329
- var replaceDot = '__';
330
-
331
- if (orgProp.indexOf(replaceDot) > 0) {
332
- // 表示包括点“.”,需要把两个下划线"__"重新改为点“.”,否则会导致查询报500错误
333
- orgProp = orgProp.replace(replaceDot, '.');
334
- }
335
-
336
- param.columnProp = column.prop;
337
- param.propName = orgProp;
338
- param.enumName = column.enumName;
339
- param.operator = _this.getOperator(column);
340
- param.dataType = column.dataType;
341
-
342
- if (column.dataType === 'DATE' || column.dataType === 'TIME') {
343
- // 日期 或 时间类型
344
- var values = _this.getFormItemValue(column.prop); // console.log('values==', values, column.prop)
345
-
346
-
347
- if (values !== null && values.length === 2 && values[0] !== null && values[1] !== null) {
348
- param.startValue = values[0];
349
- param.endValue = values[1];
350
- searchParams.push(param);
351
- }
352
- } else if (column.dataType === 'INTEGER' || column.dataType === 'LONG') {
353
- // 日期 或 时间类型
354
- var values1 = _this.getFormItemValue(column.prop);
355
-
356
- if (values1) {
357
- if (!Array.isArray(values1) || values1.length < 2 || values1[0] === null && values1[1] === null) {
358
- // 填写了一个有效值
359
- if (!Array.isArray(values1)) {
360
- param.propValue = values1;
361
- searchParams.push(param);
362
- } else if (values1.length < 2) {
363
- param.propValue = values1[0];
364
- searchParams.push(param);
365
- } else if (values1[0] === null) {
366
- param.propValue = values1[1];
367
- searchParams.push(param);
368
- } else if (values1[1] === null) {
369
- param.propValue = values1[0];
370
- searchParams.push(param);
371
- }
372
- } else {
373
- // 填写了两个有效值
374
- param.startValue = values1[0];
375
- param.endValue = values1[1];
376
- searchParams.push(param);
377
- }
378
- }
379
- } else {
380
- if (column.componentType === 'multiselect') {
381
- // 表示是多选下拉框选择器选择的值
382
- var _values = _this.getFormItemValue(column.prop); // console.log('values==', values, column.prop)
383
-
384
-
385
- _this.packageValueWithArray(_values, searchParams, param);
386
- } else {
387
- var propValue = _this.getFormItemValue(column.prop);
388
-
389
- _this.packageValueWithArray(propValue, searchParams, param);
390
- }
391
- }
392
- });
393
- return searchParams;
394
- },
395
- getOperator: function getOperator(column) {
396
- if ((column.dataType === 'TEXT' || column.dataType === 'CLOB') && column.fuzzy) {
397
- // 是否是文本类型的字段,且启用了模糊查询,则表示操作符为contains模糊查询
398
- return 'CONTAIN';
399
- } else {
400
- // 否则就是等于
401
- return 'EQ';
402
- }
403
- },
404
- getFormItemValue: function getFormItemValue(prop) {
405
- if (prop.indexOf('.') > 0) {
406
- var parentOjbect = this.getParentObject(prop);
407
- return parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)];
408
- } else {
409
- return this.searchForm[prop];
410
- }
411
- },
412
- getParentObject: function getParentObject(prop) {
413
- var nestedProp = prop.split('.'); // 属性只有一个时父对象就是searchForm
414
-
415
- if (nestedProp.length === 1) {
416
- return this.searchForm;
417
- } else {
418
- var parentObject; // 属性超过2个时先找到最后一层属性的父对象
419
-
420
- for (var i = 0; i < nestedProp.length - 1; i++) {
421
- parentObject = this.searchForm[nestedProp[i]];
422
- }
423
-
424
- return parentObject;
425
- }
426
- },
427
- // 处理多选下拉框时获得的值
428
- // 处理非多选下拉框的值
429
- packageValueWithArray: function packageValueWithArray(value, searchParams, param) {
430
- if (value && Array.isArray(value)) {
431
- var selectValues = value; // if (!Array.isArray(values)) {
432
- // selectValues = values.split(',')
433
- // }
434
-
435
- var num = 0;
436
- selectValues.forEach(function (val) {
437
- var selectParam = Object.assign({}, param);
438
- selectParam.joinSign = 'or'; // 将条件连接符修改为or,否则无法查询到值
439
-
440
- if (num === 0) {
441
- selectParam.leftBracket = '1'; // 左边有1个括号
442
- }
443
-
444
- if (num === selectValues.length - 1) {
445
- // 说明是最后一个条件
446
- selectParam.rightBracket = '1'; // 右边有1个括号
447
-
448
- selectParam.joinSign = 'and'; // 最后一个条件的连接符需要修改为and
449
- }
450
-
451
- selectParam.propValue = val;
452
- selectParam.operator = 'EQ';
453
-
454
- if (val) {
455
- searchParams.push(selectParam);
456
- }
457
-
458
- num++;
459
- });
460
- } else if (typeof value !== 'undefined' && value !== '' && value !== null && !Array.isArray(value)) {
461
- // 不是数组
462
- param.propValue = value;
463
- searchParams.push(param);
464
- }
465
- }
466
- };
467
- /* harmony default export */ var search_methods = (searchMethods);
468
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"52d3a51e-vue-loader-template"}!./node_modules/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/super-nine-grid/src/search-form-number.vue?vue&type=template&id=fc90c4ea&
469
- var search_form_numbervue_type_template_id_fc90c4ea_render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('el-input-number',{on:{"change":function($event){return _vm.setValue()}},model:{value:(_vm.number1),callback:function ($$v) {_vm.number1=$$v},expression:"number1"}}),_c('span',[_vm._v("---")]),_c('el-input-number',{on:{"change":function($event){return _vm.setValue()}},model:{value:(_vm.number2),callback:function ($$v) {_vm.number2=$$v},expression:"number2"}})],1)}
470
- var search_form_numbervue_type_template_id_fc90c4ea_staticRenderFns = []
471
-
472
-
473
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/search-form-number.vue?vue&type=template&id=fc90c4ea&
474
-
475
- // EXTERNAL MODULE: ./node_modules/core-js/modules/es6.number.constructor.js
476
- var es6_number_constructor = __webpack_require__("c5f6");
477
-
478
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/super-nine-grid/src/search-form-number.vue?vue&type=script&lang=js&
479
-
480
- //
481
- //
482
- //
483
- //
484
- //
485
- //
486
- //
487
- //
488
- //
489
- //
490
- //
491
- //
492
- //
493
- /* harmony default export */ var search_form_numbervue_type_script_lang_js_ = ({
494
- props: {
495
- r: {
496
- type: Number,
497
- default: null
498
- },
499
- n: {
500
- type: Number,
501
- default: null
502
- }
503
- },
504
- data: function data() {
505
- return {
506
- number1: null,
507
- number2: null
508
- };
509
- },
510
- methods: {
511
- setValue: function setValue() {
512
- this.$emit('setValue', [this.number1, this.number2], this.r, this.n);
513
- }
514
- }
515
- });
516
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/search-form-number.vue?vue&type=script&lang=js&
517
- /* harmony default export */ var src_search_form_numbervue_type_script_lang_js_ = (search_form_numbervue_type_script_lang_js_);
518
- // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
519
- var componentNormalizer = __webpack_require__("2877");
520
-
521
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/search-form-number.vue
522
-
523
-
524
-
525
-
526
-
527
- /* normalize component */
528
-
529
- var search_form_number_component = Object(componentNormalizer["a" /* default */])(
530
- src_search_form_numbervue_type_script_lang_js_,
531
- search_form_numbervue_type_template_id_fc90c4ea_render,
532
- search_form_numbervue_type_template_id_fc90c4ea_staticRenderFns,
533
- false,
534
- null,
535
- null,
536
- null
537
-
538
- )
539
-
540
- /* harmony default export */ var search_form_number = (search_form_number_component.exports);
541
- // EXTERNAL MODULE: ./packages/super-nine-grid/src/store.js
542
- var store = __webpack_require__("d96b");
543
-
544
- // EXTERNAL MODULE: external "Vue"
545
- var external_Vue_ = __webpack_require__("8bbf");
546
- var external_Vue_default = /*#__PURE__*/__webpack_require__.n(external_Vue_);
547
-
548
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/utils.js
549
-
550
-
551
-
552
-
553
-
554
-
555
-
556
-
557
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
558
-
559
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
560
-
561
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
562
-
563
-
564
-
565
- function getColumnValues(data, prop) {
566
- var values = [];
567
-
568
- var _iterator = _createForOfIteratorHelper(data),
569
- _step;
570
-
571
- try {
572
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
573
- var obj = _step.value;
574
- values.push(obj[prop]);
575
- }
576
- } catch (err) {
577
- _iterator.e(err);
578
- } finally {
579
- _iterator.f();
580
- }
581
-
582
- return values;
583
- }
584
- /**
585
- * 返回的数组表示当前列每行的合并情况:[3,0,0,1,1]表示1到3行合并,四五行不合并
586
- * @param {Array} data 列表数据
587
- * @param {String} prop 列名
588
- */
589
-
590
- function getSpanValuesForColumn(data, prop) {
591
- var spanArr = [];
592
- var pos = 0;
593
-
594
- for (var i = 0; i < data.length; i++) {
595
- if (i === 0) {
596
- spanArr.push(1);
597
- pos = 0;
598
- } else {
599
- // 判断当前元素与上一个元素是否相同
600
- if (data[i][prop] === data[i - 1][prop]) {
601
- spanArr[pos] += 1;
602
- spanArr.push(0);
603
- } else {
604
- spanArr.push(1);
605
- pos = i;
606
- }
607
- }
608
- }
609
-
610
- return spanArr;
611
- }
612
- function getFirstEditableColumn(listCode) {
613
- if (!listCode) {
614
- listCode = store["a" /* default */].get('_nine_list_code');
615
- }
616
-
617
- if (listCode && listCode.indexOf('~') < 0) {
618
- // 拼接默认的九宫格gridId
619
- listCode = listCode + '~' + '_nineGrid';
620
- }
621
-
622
- var _iterator2 = _createForOfIteratorHelper(store["a" /* default */].get(listCode).columns),
623
- _step2;
624
-
625
- try {
626
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
627
- var column = _step2.value;
628
-
629
- if (column.editable) {
630
- return column.prop;
631
- }
632
- }
633
- } catch (err) {
634
- _iterator2.e(err);
635
- } finally {
636
- _iterator2.f();
637
- }
638
-
639
- return null;
640
- }
641
- var ArrowKeyAction = {
642
- getIndex: function getIndex(prop) {
643
- var i = 0;
644
-
645
- var _iterator3 = _createForOfIteratorHelper(store["a" /* default */].columns),
646
- _step3;
647
-
648
- try {
649
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
650
- var column = _step3.value;
651
-
652
- if (column.prop === prop) {
653
- return i;
654
- } else {
655
- i++;
656
- }
657
- }
658
- } catch (err) {
659
- _iterator3.e(err);
660
- } finally {
661
- _iterator3.f();
662
- }
663
- },
664
- getLeftColumn: function getLeftColumn(prop) {
665
- var index = ArrowKeyAction.getIndex(prop);
666
- var i = 0;
667
-
668
- for (i = index - 1; i >= 0; i--) {
669
- if (store["a" /* default */].columns[i].editable) {
670
- return store["a" /* default */].columns[i].prop;
671
- } else {
672
- return null;
673
- }
674
- }
675
- }
676
- };
677
-
678
- /**
679
- * 是否是行编辑时的属性
680
- * @param {*} event
681
- */
682
-
683
- function isHasEditOption(event, listCode) {
684
- if (!listCode) {
685
- listCode = store["a" /* default */].get('_nine_list_code');
686
- }
687
-
688
- if (listCode && listCode.indexOf('~') < 0) {
689
- // 拼接默认的九宫格gridId
690
- listCode = listCode + '~' + '_nineGrid';
691
- }
692
-
693
- var gridParams = store["a" /* default */].get(listCode);
694
-
695
- if (gridParams.options.lineEditOptions && gridParams.options.lineEditOptions[event]) {
696
- return true;
697
- }
698
-
699
- return false;
700
- }
701
- function isEditOptionFunction(event, listCode) {
702
- if (!listCode) {
703
- listCode = store["a" /* default */].get('_nine_list_code');
704
- }
705
-
706
- if (listCode && listCode.indexOf('~') < 0) {
707
- // 拼接默认的九宫格gridId
708
- listCode = listCode + '~' + '_nineGrid';
709
- }
710
-
711
- var gridParams = store["a" /* default */].get(listCode);
712
-
713
- if (gridParams.options.lineEditOptions && typeof gridParams.options.lineEditOptions[event] === 'function') {
714
- return true;
715
- }
716
-
717
- return false;
718
- }
719
- /**
720
- * 是否是行编辑时的属性
721
- * @param {*} event
722
- */
723
-
724
- function isHasOptionFunction(event, listCode) {
725
- if (!listCode) {
726
- listCode = store["a" /* default */].get('_nine_list_code');
727
- }
728
-
729
- if (listCode && listCode.indexOf('~') < 0) {
730
- // 拼接默认的九宫格gridId
731
- listCode = listCode + '~' + '_nineGrid';
732
- }
733
-
734
- var gridParams = store["a" /* default */].get(listCode);
735
-
736
- if (gridParams.options && typeof gridParams.options[event] === 'function') {
737
- return true;
738
- }
739
-
740
- return false;
741
- }
742
- function isOptionFunction(props, listCode) {
743
- if (!listCode) {
744
- listCode = store["a" /* default */].get('_nine_list_code');
745
- }
746
-
747
- if (listCode && listCode.indexOf('~') < 0) {
748
- // 拼接默认的九宫格gridId
749
- listCode = listCode + '~' + '_nineGrid';
750
- }
751
-
752
- var gridParams = store["a" /* default */].get(listCode);
753
-
754
- if (props.indexOf('.') > 0) {
755
- var optionProp = gridParams.options;
756
- var propsArr = props.split('.');
757
-
758
- for (var i = 0; i < propsArr.length; i++) {
759
- var _event = propsArr[i];
760
-
761
- if (optionProp) {
762
- if (typeof optionProp[_event] === 'function') {
763
- return true;
764
- } else {
765
- optionProp = optionProp[_event];
766
- }
767
- } else {
768
- return false;
769
- }
770
- }
771
- } else {
772
- if (gridParams.options && typeof gridParams.options[event] === 'function') {
773
- return true;
774
- }
775
- }
776
- }
777
- /**
778
- * 获得控制表格需要的参数
779
- */
780
-
781
- function getGridParams() {
782
- var gridParams = {
783
- columns: [],
784
- gridData: [],
785
- orgGridData: [],
786
- // 行编辑保存时使用
787
- showValidateError: true,
788
- // 是否可以显示验证信息,防止同时弹出两个验证信息的
789
- options: {// id: '_nineGrid', // 九宫格组件的元素id,影响格子拖动功能,当tab页签中有多个九宫格时必须配置该属性,如果当前页面中只有一个九宫格组件,不配也可以
790
- // 附加参数
791
- // extraParam: {},
792
- // 表格及数据均加载完成后
793
- // gridComplete: function(gridData, columns) {}, // gridData, columns
794
- // 刚请求到字段配置,没有请求数据时,可以通过该方法修改表头或添加自定义表头
795
- // loadBeforeSend: function(columns, settings) { return true }, // columns, settings(列表所有设置,包括字段设置、分页设置、查询设置、行编辑设置)
796
- // 数据加载失败的回调方法
797
- // loadError: function(code, error) {}, // code, error
798
- // 数据请求成功后,表格记录显示前的回调方法,该方法主要是处理业务数据,比如:处理xss攻击
799
- // gridDataLoaded: function(data) { return data },
800
- // 查询组件需要的一些参数
801
- // search: {
802
- // // 属性自定义组件,当不是行编辑时,查询框需要自定义控件时
803
- // customSearchElements: function(column) { return null },
804
- // labelWidth: '150px',
805
- // fieldNum: 4, // 查询的每行排放的字段个数,默认是4个字段
806
- // },
807
- // isSql:false, // 是否是sql查询数据内容。在使用sql语句查询表内容时,否则会导致列表字段的值不显示,都显示为空
808
- // initSearchForm: [], // 初始查询条件,格式同“查询”按钮封装的json格式
809
- // multiple: true/false,// 是否多选,默认以列表管理中配置的为准
810
- // initSortInfo: {prop:'',order: 'ASC/DESC'},// 默认排序字段,和排序方式
811
- // pageSizes: '20,30,50,100',// 可选行数
812
- // initSearch: true/false, // 初始化时是否查询,默认是查询
813
- // isHiddenSearchForm: false, //查询时,是否隐藏查询区域,不配置默认是显示的
814
- // isHasCreate: true/false, // 是否显示新建按钮
815
- // createPermission: 'a.b.c', // 新建按钮的资源编码,用于控制新建按钮的权限
816
- // props: {imageUrl:'prop1', content:'prop1', title:'prop2', subTitle:'prop3'}, // 九宫格中图片、标题、副标题属性名配置
817
- // operations: [ // 按钮区按钮信息
818
- // {
819
- // name:'修改',
820
- // icon:'el-icon-edit',
821
- // event: this.updateItem,
822
- // permission:'sss.ddd.ddds'
823
- // },
824
- // {
825
- // name:'删除',
826
- // icon:'el-icon-delete',
827
- // event: this.deleteItem
828
- // },
829
- // {
830
- // name:'设为模板',
831
- // icon:'el-icon-document-copy',
832
- // event: this.setToTemplate
833
- // }
834
- // ]
835
- }
836
- };
837
- return external_Vue_default.a.observable(gridParams);
838
- }
839
- function addDynamicProp(target, prop, propValue) {
840
- var nestedProp = prop.split('.');
841
-
842
- if (nestedProp.length === 1) {
843
- if (propValue !== undefined) {
844
- target[prop] = propValue;
845
- } else {
846
- target[prop] = null;
847
- }
848
-
849
- return;
850
- } // 如果是嵌套属性,就要逐层添加空对象,起点是searchForm,属性每多一层嵌套,parent就前进一层,到倒数第二层为止
851
-
852
-
853
- var parent = target;
854
-
855
- for (var i = 0; i < nestedProp.length - 1; i++) {
856
- if (parent[nestedProp[i]] === undefined) {
857
- parent[nestedProp[i]] = {};
858
- }
859
-
860
- parent = parent[nestedProp[i]];
861
- }
862
-
863
- if (propValue !== undefined) {
864
- parent[nestedProp[nestedProp.length - 1]] = propValue;
865
- } else {
866
- parent[nestedProp[nestedProp.length - 1]] = null;
867
- }
868
- }
869
- function getTableHeight(showSearch, searchForm) {
870
- if (showSearch === true) {
871
- var searchHeight = 0;
872
-
873
- if (searchForm) {
874
- // 获得查询区高度
875
- searchHeight = searchForm.$el.offsetHeight;
876
- }
877
-
878
- return window.innerHeight - searchHeight - 165;
879
- } else {
880
- return window.innerHeight - 165;
881
- }
882
- }
883
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/super-nine-grid/src/search-form.vue?vue&type=script&lang=js&
884
-
885
-
886
-
887
-
888
-
889
-
890
-
891
-
892
-
893
-
894
-
895
-
896
-
897
-
898
- function search_formvue_type_script_lang_js_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = search_formvue_type_script_lang_js_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
899
-
900
- function search_formvue_type_script_lang_js_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return search_formvue_type_script_lang_js_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return search_formvue_type_script_lang_js_arrayLikeToArray(o, minLen); }
901
-
902
- function search_formvue_type_script_lang_js_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
903
-
904
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
905
-
906
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
907
-
908
- //
909
- //
910
- //
911
- //
912
- //
913
- //
914
- //
915
- //
916
- //
917
- //
918
- //
919
- //
920
- //
921
- //
922
- //
923
- //
924
- //
925
- //
926
- //
927
- //
928
- //
929
- //
930
- //
931
- //
932
- //
933
- //
934
- //
935
- //
936
- //
937
- //
938
- //
939
- //
940
- //
941
- //
942
- //
943
- //
944
- //
945
- //
946
- //
947
- //
948
- //
949
- //
950
- //
951
- //
952
- //
953
- //
954
- //
955
- //
956
- //
957
- //
958
- //
959
- //
960
- //
961
- //
962
- //
963
- //
964
- //
965
- //
966
- //
967
- //
968
- //
969
- //
970
- //
971
- //
972
- //
973
- //
974
- //
975
- //
976
- //
977
- //
978
- //
979
- //
980
- //
981
- //
982
- //
983
- //
984
- //
985
- //
986
- //
987
- //
988
- //
989
- //
990
- //
991
- //
992
- //
993
- //
994
- //
995
- //
996
- //
997
- //
998
- //
999
- //
1000
- //
1001
- //
1002
- //
1003
- //
1004
- //
1005
- //
1006
- //
1007
- //
1008
- //
1009
- //
1010
- //
1011
- //
1012
- //
1013
- //
1014
- //
1015
- //
1016
- //
1017
- //
1018
- //
1019
- //
1020
- //
1021
- //
1022
- //
1023
- //
1024
- //
1025
- //
1026
- //
1027
- //
1028
- //
1029
- //
1030
- //
1031
- //
1032
- //
1033
- //
1034
- //
1035
- //
1036
- //
1037
- //
1038
- //
1039
- //
1040
- //
1041
- //
1042
- //
1043
- //
1044
- //
1045
- //
1046
- //
1047
- //
1048
- //
1049
- //
1050
- //
1051
- //
1052
- //
1053
- //
1054
- //
1055
- //
1056
- //
1057
- //
1058
- //
1059
- //
1060
- //
1061
- //
1062
- //
1063
- //
1064
- //
1065
- //
1066
- //
1067
- //
1068
- //
1069
- //
1070
- //
1071
- //
1072
- //
1073
- //
1074
- //
1075
-
1076
-
1077
- // import { isOptionFunction, getSearchObject } from './utils'
1078
-
1079
-
1080
-
1081
- /* harmony default export */ var search_formvue_type_script_lang_js_ = ({
1082
- name: 'SearchForm',
1083
- components: {
1084
- searchFormNumber: search_form_number
1085
- },
1086
- props: {
1087
- columns: {
1088
- type: Array,
1089
- default: null
1090
- },
1091
- code: {
1092
- type: String,
1093
- default: null
1094
- },
1095
- url: {
1096
- type: String,
1097
- default: null
1098
- },
1099
- pagination: {
1100
- type: Object,
1101
- default: null
1102
- },
1103
- query: {
1104
- type: Object,
1105
- default: null
1106
- },
1107
- searchParam: {
1108
- type: Object,
1109
- default: null
1110
- },
1111
- initSearchProps: {
1112
- type: Array,
1113
- default: null
1114
- },
1115
- // 九宫格组件的id
1116
- gridId: {
1117
- type: String,
1118
- default: '_nineGrid'
1119
- }
1120
- },
1121
- data: function data() {
1122
- var _this = this;
1123
-
1124
- var storeId = this.code + '~' + this.gridId;
1125
- var customComponentNames = new Set();
1126
- var gridParams = store["a" /* default */].get(storeId);
1127
- var searchForm = {};
1128
-
1129
- if (this.searchParam !== null) {
1130
- searchForm = JSON.parse(JSON.stringify(this.searchParam)); // searchForm = this.searchParam
1131
- }
1132
-
1133
- console.log('searchForm=', searchForm);
1134
- var searchColumns = this.getSearchableColumns();
1135
-
1136
- if (this.initSearchProps === undefined || this.initSearchProps === null) {
1137
- this.initSearchProps = [];
1138
- }
1139
-
1140
- searchColumns.forEach(function (column) {
1141
- if (_this.initSearchProps.indexOf(column.prop) < 0) {
1142
- // 表示没有默认初始查询字段
1143
- if (column.prop.indexOf('.') > 0) {
1144
- // 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
1145
- addDynamicProp(searchForm, column.prop);
1146
- } else {
1147
- searchForm[column.prop] = null;
1148
- }
1149
- }
1150
- });
1151
- var spanNum = this.getSpanNum(storeId);
1152
- var fieldNum = this.getFieldNumPerRow(storeId);
1153
- var rowNum = Math.ceil(searchColumns.length / fieldNum); // console.log('searchColumns.length=' + searchColumns.length + ',fieldNum=' + fieldNum + ',rowNum=' + rowNum)
1154
- // // -2是把
1155
- // const dateSpanNum = (spanNum - 2) / 2
1156
-
1157
- return {
1158
- searchForm: searchForm,
1159
- rules: {},
1160
- searchParams: [],
1161
- labelWidth: gridParams.options.search && gridParams.options.search.labelWidth ? gridParams.options.search.labelWidth : '80px',
1162
- customComponentNames: customComponentNames,
1163
- componentName: '',
1164
- spanNum: spanNum,
1165
- fieldNum: fieldNum,
1166
- // 每行放的字段个数
1167
- rowNum: rowNum,
1168
- // 一共有几行
1169
- loading: false,
1170
- // 是否正在查询,默认时否
1171
- storeId: storeId // 缓存的列表id
1172
-
1173
- };
1174
- },
1175
- computed: {
1176
- searchableColumns: function searchableColumns() {
1177
- return this.getSearchableColumns();
1178
- }
1179
- },
1180
- methods: _objectSpread(_objectSpread({}, search_methods), {}, {
1181
- // 获得每行排放的字段个数
1182
- getColumnNumPerRow: function getColumnNumPerRow(rowIndex, searchColumnsLength) {
1183
- var columnNumPerRow = this.fieldNum;
1184
-
1185
- if (this.fieldNum * rowIndex > searchColumnsLength) {
1186
- // 表示字段无法填满最后一行
1187
- columnNumPerRow = searchColumnsLength - this.fieldNum * (rowIndex - 1);
1188
- }
1189
-
1190
- return columnNumPerRow;
1191
- },
1192
- // 每行放的字段个数
1193
- getFieldNumPerRow: function getFieldNumPerRow(storeId) {
1194
- var gridParams = store["a" /* default */].get(storeId);
1195
- return gridParams.options.search && gridParams.options.search.fieldNum ? gridParams.options.search.fieldNum : 4;
1196
- },
1197
- // 根据每行显示的字段个数,确定栅栏个数,默认是4个字段。最多就只能放6个字段
1198
- getSpanNum: function getSpanNum(storeId) {
1199
- var fieldNum = this.getFieldNumPerRow(storeId);
1200
-
1201
- if (fieldNum === 1) {
1202
- return 14;
1203
- } else if (fieldNum === 2) {
1204
- return 10;
1205
- } else if (fieldNum === 3) {
1206
- return 8;
1207
- } else if (fieldNum === 4) {
1208
- return 6;
1209
- } else {
1210
- // 6个字段
1211
- return 4;
1212
- }
1213
- },
1214
- setValueToModelProp: function setValueToModelProp(prop, value) {
1215
- if (prop.indexOf('.') > 0) {
1216
- var parentOjbect = this.getParentObject(prop); // 嵌套属性中的最后一个属性是属于这个中间父对象的,所有要通过中间父对象来赋值
1217
-
1218
- parentOjbect[prop.substring(prop.lastIndexOf('.') + 1)] = value;
1219
- } else {
1220
- this.searchForm[prop] = value;
1221
- }
1222
- },
1223
- getSearchableColumns: function getSearchableColumns(columns, searchColumns) {
1224
- if (!this.customComponentNames) {
1225
- this.customComponentNames = new Set();
1226
- }
1227
-
1228
- if (!searchColumns) {
1229
- searchColumns = [];
1230
- }
1231
-
1232
- if (!columns) {
1233
- columns = this.columns;
1234
- }
1235
-
1236
- for (var i = 0; i < columns.length; i++) {
1237
- var column = columns[i];
1238
-
1239
- if (column.prop === '$index' || column.prop === '$selection' || column.dynamic) {
1240
- // 序号和复选框列、动态列 不属于该组件的查询字段
1241
- continue;
1242
- }
1243
-
1244
- if (column.groupHeader) {
1245
- // 组合表头中子表头的字段查询
1246
- this.getSearchableColumns(column.children, searchColumns);
1247
- } else {
1248
- if (column.queryType === 'normal' && !column.custom && column.prop !== '') {
1249
- // 表示是普通查询,且不是占位符列,是查询字段
1250
- if (typeof column.componentType === 'undefined' || column.componentType === '') {
1251
- column.componentType = 'input';
1252
- }
1253
-
1254
- if (column.querySetting && column.querySetting !== '') {
1255
- var querySetting = JSON.parse(column.querySetting);
1256
-
1257
- if (querySetting.width) {
1258
- column.searchControlWidth = 'width:' + querySetting.width + 'px';
1259
- }
1260
-
1261
- if (querySetting.labelWidth) {
1262
- column.searchLabelWidth = querySetting.labelWidth + 'px';
1263
- }
1264
-
1265
- if (querySetting.label) {
1266
- column.searchLabel = querySetting.label;
1267
- }
1268
- } // 行编辑时自定义编辑组件
1269
-
1270
-
1271
- if (column.componentType.indexOf('custom:') >= 0) {
1272
- column.componentName = column.componentType.substring(column.componentType.indexOf(':') + 1);
1273
- this.customComponentNames.add(column.componentName);
1274
- } else {
1275
- column.componentName = '';
1276
- }
1277
-
1278
- searchColumns.push(column);
1279
- }
1280
- }
1281
- }
1282
-
1283
- return searchColumns;
1284
- },
1285
- customComponent: function customComponent(column) {
1286
- var gridParams = store["a" /* default */].get(this.storeId);
1287
-
1288
- if (column.componentName && column.componentName !== '') {
1289
- this.customComponentNames.add(column.componentName);
1290
- return true;
1291
- }
1292
-
1293
- if ((!column.componentName || column.componentName === '') && gridParams.options && gridParams.options.search && gridParams.options.search.customSearchElements) {
1294
- // 定义了自定义查询组件
1295
- var propSearchEle = gridParams.options.search.customSearchElements[column.prop]; // console.log('customComponent-customSearchElements-propSearchEle-', column.prop)
1296
-
1297
- if (propSearchEle) {
1298
- column.componentName = 'custom-' + column.prop;
1299
- var component = propSearchEle.call(this, column); // console.log('customComponent-customSearchElements-')
1300
-
1301
- if (component) {
1302
- this.customComponentNames.add(column.componentName);
1303
- external_Vue_default.a.component(column.componentName, component);
1304
- return true;
1305
- }
1306
- }
1307
- }
1308
-
1309
- return false;
1310
- },
1311
- submitForm: function submitForm(formName) {
1312
- var _this2 = this;
1313
-
1314
- this.$refs[formName].validate(function (valid) {
1315
- if (valid) {
1316
- // const searchDemo = [
1317
- // { leftBracket: '', propName: 'name', enumName: '', operator: 'contain', propValue: '系统', rightBracket: '', joinSign: 'and', dataType: 'TEXT' },
1318
- // { leftBracket: '', propName: 'createdTime', enumName: '', operator: 'eq', startValue: '2019-01-29', endValue: '2019-01-30', propValue: '2019-01-30', rightBracket: '', joinSign: 'and', dataType: 'DATE' },
1319
- // { leftBracket: '', propName: 'enabledState', enumName: 'tech.imatrix.enumeration.MenuState', operator: 'eq', propValue: 'ENABLE', rightBracket: '', joinSign: 'and', dataType: 'ENUM' }
1320
- // ]
1321
- _this2.loading = true;
1322
- _this2.searchParams = _this2.packageSearchParam();
1323
-
1324
- _this2.$emit('search', _this2.searchParams, true);
1325
- } else {
1326
- // console.log('error submit!!')
1327
- return false;
1328
- }
1329
- });
1330
- },
1331
- resetForm: function resetForm(formName) {
1332
- var _this3 = this;
1333
-
1334
- // console.log('customComponentNames=', this.customComponentNames)
1335
- var _iterator = search_formvue_type_script_lang_js_createForOfIteratorHelper(this.customComponentNames),
1336
- _step;
1337
-
1338
- try {
1339
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
1340
- var componentName = _step.value;
1341
- // 遍历
1342
- this.$refs[componentName][0].resetField();
1343
- } // this.$refs[formName].resetFields()
1344
-
1345
- } catch (err) {
1346
- _iterator.e(err);
1347
- } finally {
1348
- _iterator.f();
1349
- }
1350
-
1351
- this.searchableColumns.forEach(function (column) {
1352
- // 表示没有默认初始查询字段
1353
- if (column.prop.indexOf('.') > 0) {
1354
- // 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
1355
- addDynamicProp(_this3.searchForm, column.prop);
1356
- } else {
1357
- _this3.searchForm[column.prop] = null;
1358
- }
1359
- });
1360
- this.$emit('reset');
1361
- },
1362
- setNumberValue: function setNumberValue(value, r, n) {
1363
- var itemValue = this.getFormItemValue(this.searchableColumns[this.fieldNum * (r - 1) + (n - 1)].prop);
1364
- itemValue = value;
1365
- this.setValueToModelProp(this.searchableColumns[this.fieldNum * (r - 1) + (n - 1)].prop, itemValue);
1366
- }
1367
- })
1368
- });
1369
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/search-form.vue?vue&type=script&lang=js&
1370
- /* harmony default export */ var src_search_formvue_type_script_lang_js_ = (search_formvue_type_script_lang_js_);
1371
- // EXTERNAL MODULE: ./packages/super-nine-grid/src/search-form.vue?vue&type=style&index=0&id=398b171b&scoped=true&lang=css&
1372
- var search_formvue_type_style_index_0_id_398b171b_scoped_true_lang_css_ = __webpack_require__("45ae");
1373
-
1374
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/search-form.vue
1375
-
1376
-
1377
-
1378
-
1379
-
1380
-
1381
- /* normalize component */
1382
-
1383
- var search_form_component = Object(componentNormalizer["a" /* default */])(
1384
- src_search_formvue_type_script_lang_js_,
1385
- search_formvue_type_template_id_398b171b_scoped_true_render,
1386
- search_formvue_type_template_id_398b171b_scoped_true_staticRenderFns,
1387
- false,
1388
- null,
1389
- "398b171b",
1390
- null
1391
-
1392
- )
1393
-
1394
- /* harmony default export */ var search_form = (search_form_component.exports);
1395
- // EXTERNAL MODULE: ./packages/utils/value-set.js
1396
- var value_set = __webpack_require__("4910");
1397
-
1398
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/super-grid-service.js
1399
-
1400
-
1401
-
1402
- /* eslint-disable no-undef */
1403
-
1404
-
1405
-
1406
-
1407
- var superGridService = {
1408
- initialize: function initialize() {
1409
- var _this = this;
1410
-
1411
- var url = external_Vue_default.a.prototype.baseAPI + '/component/super-grids/' + this.code;
1412
- var param = {};
1413
- var isSqlSetting = this.options.isSql;
1414
-
1415
- if (this.options && typeof isSqlSetting !== 'undefined') {
1416
- this.isSql = isSqlSetting;
1417
- param.isSql = isSqlSetting + '';
1418
- }
1419
-
1420
- this.isLoading = true; // 初始化组件时先获取元信息再获取数据,以后翻页、排序、查询不再去获取元数据了
1421
-
1422
- this.$http.post(url, param).then(function (data) {
1423
- // console.log('自定义显示数量1:' + data)
1424
- // console.log('initialize--grid--data.columns.length=', data.columns.length)
1425
- if (_this.options.pageSizes && data.pagination) {
1426
- // 组件的options属性配置中配置“可选行数”,已该配置为准
1427
- var pageSizeArr = null;
1428
-
1429
- var pageSizeStrs = _this.options.pageSizes.split(',');
1430
-
1431
- if (pageSizeStrs && pageSizeStrs.length > 0) {
1432
- pageSizeArr = [];
1433
-
1434
- for (var i = 0; i < pageSizeStrs.length; i++) {
1435
- pageSizeArr.push(pageSizeStrs[i] * 1);
1436
- }
1437
-
1438
- data.pagination.pageSize = pageSizeArr[0];
1439
- }
1440
-
1441
- data.pagination.layout = 'total, sizes, prev, pager, next, jumper';
1442
- data.pagination.pageSizes = pageSizeArr; // console.log('自定义显示数量2:' + pageSizeArr)
1443
- // console.log('自定义显示数量3:' + data)
1444
- }
1445
-
1446
- if (typeof _this.options.initSortInfo !== 'undefined') {
1447
- // 组件的options属性配置中配置“排序信息”,以该配置为准
1448
- if (Array.isArray(_this.options.initSortInfo)) {
1449
- data.sortInfo = _this.options.initSortInfo;
1450
- } else {
1451
- data.sortInfo = [];
1452
- data.sortInfo.push(_this.options.initSortInfo);
1453
- }
1454
- }
1455
-
1456
- Object.assign(_this, data);
1457
- var gridParams = store["a" /* default */].get(_this.code + '~' + _this.gridId); // store.listCode = this.code
1458
- // 需要多个组件共享的数据放到store中,避免组件定义一堆props来接收这些共享数据
1459
-
1460
- Object(value_set["a" /* packageEnumAndBeanColumnValueSets */])(_this.columns, _this.code).then(function () {
1461
- gridParams.isSql = _this.isSql;
1462
- gridParams.columns = _this.columns;
1463
- gridParams.lineEdit = _this.lineEdit;
1464
- gridParams.basicInfo = _this.basicInfo;
1465
- gridParams.pagination = _this.pagination;
1466
- gridParams.query = _this.query;
1467
- _this.hasLoadedColumns = true;
1468
- var canFetchData = true;
1469
-
1470
- if (isHasOptionFunction('loadBeforeSend', _this.storeId)) {
1471
- canFetchData = gridParams.options.loadBeforeSend.call(_this, {
1472
- columns: _this.columns,
1473
- gridParams: gridParams
1474
- });
1475
- }
1476
-
1477
- if (canFetchData === undefined || canFetchData === true) {
1478
- if (typeof _this.options.initSearch === 'undefined' || _this.options.initSearch !== false) {
1479
- // 获得行拖动顺序接口路径
1480
- _this.urlToSaveOrder = _this.lineEdit && _this.lineEdit.urlToSaveOrder ? _this.lineEdit.urlToSaveOrder : null; // 表示初始化时查询记录
1481
-
1482
- _this.fetchData().then(function () {
1483
- _this.initSelectData();
1484
- });
1485
- }
1486
- }
1487
- });
1488
- });
1489
- },
1490
- // 单选时默认勾选指定的记录
1491
- initSelectData: function initSelectData() {
1492
- if (this.options && this.options.currentIds) {
1493
- // 表示指定了选择的记录
1494
- for (var i = 0; i < this.gridData.length; i++) {
1495
- var record = this.gridData[i];
1496
-
1497
- if ((record.id || record.ID) && this.options.currentIds.indexOf(record.id ? record.id : record.ID) >= 0) {
1498
- this.changeSelect(record);
1499
-
1500
- if (this.multiple === false) {
1501
- break;
1502
- }
1503
- }
1504
- }
1505
- }
1506
- }
1507
- };
1508
- /* harmony default export */ var super_grid_service = (superGridService);
1509
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/apis.js
1510
-
1511
-
1512
-
1513
- var apis = {
1514
- // 刷新列表数据
1515
- refresh: function refresh() {
1516
- var _this = this;
1517
-
1518
- return new Promise(function (resolve, reject) {
1519
- if (_this.$refs) {
1520
- // 刷新列表数据
1521
- if (_this.$refs.sf) {
1522
- _this.search(_this.$refs.sf.searchParams, true).then(function () {
1523
- return resolve();
1524
- }).catch(function (error) {
1525
- return reject(error);
1526
- });
1527
- } else {
1528
- _this.search(null, true).then(function () {
1529
- return resolve();
1530
- }).catch(function (error) {
1531
- return reject(error);
1532
- });
1533
- }
1534
- } else {
1535
- resolve();
1536
- }
1537
- });
1538
- },
1539
- // 显示查询
1540
- showSearchForm: function showSearchForm() {
1541
- this.showSearch = true;
1542
- this.$emit('showSearch');
1543
- },
1544
- // 取消查询
1545
- cancelSearch: function cancelSearch() {
1546
- this.showSearch = false;
1547
- this.$emit('cancelSearch');
1548
- },
1549
- // 获得查询条件
1550
- getSearchForm: function getSearchForm() {
1551
- var gridParams = store["a" /* default */].get(this.storeId);
1552
-
1553
- if (gridParams.searchForm) {
1554
- return gridParams.searchForm;
1555
- } else {
1556
- return [];
1557
- }
1558
- },
1559
- // 获得列表所有数据
1560
- getGridData: function getGridData(listCode) {
1561
- if (!listCode) {
1562
- listCode = store["a" /* default */].get('_nine_list_code');
1563
- }
1564
-
1565
- if (listCode && listCode.indexOf('~') < 0) {
1566
- // 拼接默认的九宫格gridId
1567
- listCode = listCode + '~' + '_nineGrid';
1568
- }
1569
-
1570
- var gridParams = store["a" /* default */].get(listCode);
1571
- return gridParams.gridData;
1572
- },
1573
- // 获得字段配置
1574
- getColumns: function getColumns(listCode) {
1575
- if (!listCode) {
1576
- listCode = store["a" /* default */].get('_nine_list_code');
1577
- }
1578
-
1579
- if (listCode && listCode.indexOf('~') < 0) {
1580
- // 拼接默认的九宫格gridId
1581
- listCode = listCode + '~' + '_nineGrid';
1582
- }
1583
-
1584
- var gridParams = store["a" /* default */].get(listCode);
1585
- return gridParams.columns;
1586
- },
1587
- // listCode 列表编码~gridId,例如:MMS_BUSSINESS_SYSTEM~grid1
1588
- getPagination: function getPagination(listCode) {
1589
- if (!listCode) {
1590
- listCode = store["a" /* default */].get('_nine_list_code');
1591
- }
1592
-
1593
- if (listCode && listCode.indexOf('~') < 0) {
1594
- // 拼接默认的九宫格gridId
1595
- listCode = listCode + '~' + '_nineGrid';
1596
- }
1597
-
1598
- var gridParams = store["a" /* default */].get(listCode);
1599
- return gridParams.pagination;
1600
- },
1601
- // 获得选中的记录集合
1602
- getSelections: function getSelections() {
1603
- return this.selections;
1604
- },
1605
- // 获得选中的记录id集合
1606
- getSelectionIds: function getSelectionIds() {
1607
- return this.selectionIds;
1608
- },
1609
- // 清空选中的记录
1610
- clearSelections: function clearSelections() {
1611
- this.selections = [];
1612
- this.selectionIds = [];
1613
- this.selectionModels = {};
1614
- this.currentId = null;
1615
- },
1616
- // 单选时获得选中的记录
1617
- getSelection: function getSelection() {
1618
- if (this.selections && this.selections.length > 0) {
1619
- return this.selections[0];
1620
- }
1621
-
1622
- return null;
1623
- },
1624
- // 单选时获得选中的记录id集合
1625
- getSelectionId: function getSelectionId() {
1626
- if (this.selectionIds && this.selectionIds.length > 0) {
1627
- return this.selectionIds[0];
1628
- }
1629
-
1630
- return null;
1631
- }
1632
- };
1633
- /* harmony default export */ var src_apis = (apis);
1634
- // EXTERNAL MODULE: ./node_modules/sortablejs/modular/sortable.esm.js
1635
- var sortable_esm = __webpack_require__("aa47");
1636
-
1637
- // CONCATENATED MODULE: ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./packages/super-nine-grid/src/super-nine-grid.vue?vue&type=script&lang=js&
1638
-
1639
-
1640
-
1641
-
1642
-
1643
-
1644
-
1645
-
1646
-
1647
-
1648
-
1649
-
1650
-
1651
-
1652
-
1653
-
1654
-
1655
- function super_nine_gridvue_type_script_lang_js_createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = super_nine_gridvue_type_script_lang_js_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
1656
-
1657
- function super_nine_gridvue_type_script_lang_js_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return super_nine_gridvue_type_script_lang_js_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return super_nine_gridvue_type_script_lang_js_arrayLikeToArray(o, minLen); }
1658
-
1659
- function super_nine_gridvue_type_script_lang_js_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1660
-
1661
- function super_nine_gridvue_type_script_lang_js_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
1662
-
1663
- function super_nine_gridvue_type_script_lang_js_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { super_nine_gridvue_type_script_lang_js_ownKeys(Object(source), true).forEach(function (key) { Object(defineProperty["a" /* default */])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { super_nine_gridvue_type_script_lang_js_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
1664
-
1665
- //
1666
- //
1667
- //
1668
- //
1669
- //
1670
- //
1671
- //
1672
- //
1673
- //
1674
- //
1675
- //
1676
- //
1677
- //
1678
- //
1679
- //
1680
- //
1681
- //
1682
- //
1683
- //
1684
- //
1685
- //
1686
- //
1687
- //
1688
- //
1689
- //
1690
- //
1691
- //
1692
- //
1693
- //
1694
- //
1695
- //
1696
- //
1697
- //
1698
- //
1699
- //
1700
- //
1701
- //
1702
- //
1703
- //
1704
- //
1705
- //
1706
- //
1707
- //
1708
- //
1709
- //
1710
- //
1711
- //
1712
- //
1713
- //
1714
- //
1715
- //
1716
- //
1717
- //
1718
- //
1719
- //
1720
- //
1721
- //
1722
- //
1723
- //
1724
- //
1725
- //
1726
- //
1727
- //
1728
- //
1729
- //
1730
- //
1731
- //
1732
- //
1733
- //
1734
- //
1735
- //
1736
- //
1737
- //
1738
- //
1739
- //
1740
- //
1741
- //
1742
- //
1743
- //
1744
- //
1745
- //
1746
- //
1747
- //
1748
- //
1749
- //
1750
- //
1751
- //
1752
- //
1753
- //
1754
- //
1755
- //
1756
- //
1757
- //
1758
- //
1759
- //
1760
- //
1761
- //
1762
- //
1763
- //
1764
- //
1765
- //
1766
- //
1767
- //
1768
- //
1769
- //
1770
- //
1771
- //
1772
- //
1773
- //
1774
- //
1775
- //
1776
- //
1777
- //
1778
- //
1779
- //
1780
- //
1781
- //
1782
- //
1783
- //
1784
- //
1785
- //
1786
- //
1787
- //
1788
- //
1789
- //
1790
- //
1791
- //
1792
- //
1793
- //
1794
- //
1795
- //
1796
- //
1797
- //
1798
- //
1799
- //
1800
- //
1801
- //
1802
- //
1803
- //
1804
- //
1805
- //
1806
- //
1807
- //
1808
- //
1809
- //
1810
- //
1811
- //
1812
- //
1813
- //
1814
- //
1815
- //
1816
- //
1817
- //
1818
- //
1819
- //
1820
- //
1821
- //
1822
- //
1823
- //
1824
- //
1825
- //
1826
- //
1827
- //
1828
- //
1829
- //
1830
- //
1831
- //
1832
- //
1833
- //
1834
- //
1835
- //
1836
- //
1837
- //
1838
- //
1839
- //
1840
- //
1841
- //
1842
- //
1843
- //
1844
- //
1845
- //
1846
- //
1847
- //
1848
- //
1849
- //
1850
- //
1851
- //
1852
- //
1853
- //
1854
- //
1855
- //
1856
- //
1857
- //
1858
- //
1859
- //
1860
- //
1861
- //
1862
- //
1863
- //
1864
- //
1865
- //
1866
- //
1867
-
1868
-
1869
-
1870
-
1871
-
1872
-
1873
-
1874
-
1875
-
1876
- /* harmony default export */ var super_nine_gridvue_type_script_lang_js_ = ({
1877
- name: 'SuperNineGrid',
1878
- components: {
1879
- SearchForm: search_form
1880
- },
1881
- props: {
1882
- code: {
1883
- type: String,
1884
- default: ''
1885
- },
1886
- url: {
1887
- type: String,
1888
- default: ''
1889
- },
1890
- options: {
1891
- type: Object,
1892
- default: function _default() {
1893
- return {};
1894
- }
1895
- }
1896
- },
1897
- data: function data() {
1898
- var mergeFields = [];
1899
-
1900
- if (this.options && this.options.mergeFields && this.options.mergeFields !== '') {
1901
- mergeFields = this.options.mergeFields.split(',');
1902
- }
1903
-
1904
- var defaultShowImageAction = external_Vue_default.a.prototype.baseAPI + '/component/super-form/show-image?serverPath=';
1905
- var gridId = this.options && this.options.id ? this.options.id : '_nineGrid';
1906
- var storeId = this.code + '~' + gridId;
1907
- var isShowRadio = this.options && this.options.showRadio !== undefined ? this.options.showRadio : false;
1908
- return {
1909
- isLoading: false,
1910
- currentPage: 1,
1911
- showColumnConfig: false,
1912
- basicInfo: {
1913
- summary: 'no'
1914
- },
1915
- columns: [],
1916
- pagination: null,
1917
- query: null,
1918
- lineEdit: null,
1919
- gridData: [],
1920
- sortInfo: null,
1921
- pageSize: null,
1922
- showSearch: false,
1923
- height: null,
1924
- isSql: false,
1925
- // 是否是sql查询
1926
- hasLoadData: false,
1927
- mergeFields: mergeFields,
1928
- hasLoadedColumns: false,
1929
- // 是否已经加载了列配置
1930
- seen: false,
1931
- current: null,
1932
- isHasCreate: true,
1933
- // 是否需要新建按钮
1934
- screenBaseUrl: null,
1935
- props: null,
1936
- // 属性配置
1937
- operations: [],
1938
- // 指向格子时出现的操作按钮集合
1939
- propCloumns: null,
1940
- // 属性字段配置详细信息
1941
- multiple: false,
1942
- // 是否需要多选
1943
- createPermission: 'true',
1944
- // 新建权限编码,默认是有权限的
1945
- urlToSaveOrder: null,
1946
- // 拖动格子后台保存接口路径
1947
- selections: [],
1948
- // 选中的记录集合
1949
- selectionIds: [],
1950
- // 选中的记录id集合
1951
- selectionModels: {},
1952
- // 选中的记录对象
1953
- searchFormContent: null,
1954
- initSearchProps: [],
1955
- // 初始查询的字段属性名集合
1956
- defaultShowImageAction: defaultShowImageAction,
1957
- // 显示图片的路径
1958
- gridId: gridId,
1959
- storeId: storeId,
1960
- currentId: null,
1961
- // 当前点击的记录id
1962
- isShowRadio: isShowRadio,
1963
- // 单选时是否显示单选按钮
1964
- titleStyle: null // 标题的样式对象,格式为:{ color: 'green', fontWeight: 'bold'}
1965
-
1966
- };
1967
- },
1968
- computed: {},
1969
- provide: function provide() {
1970
- return {};
1971
- },
1972
- created: function created() {
1973
- store["a" /* default */].set(this.code + '~' + this.gridId, getGridParams());
1974
- store["a" /* default */].set('_nine_list_code', this.code + '~' + this.gridId);
1975
- this.initSetting();
1976
- this.initialize(); // this.showDemo()
1977
- },
1978
- mounted: function mounted() {
1979
- this.$watch('showSearch', function (newVal, oldVal) {
1980
- var _this = this;
1981
-
1982
- this.$nextTick(function () {
1983
- var tableHeight = getTableHeight(newVal, _this.$refs.sf);
1984
-
1985
- var newHeight = _this.resizeHeight();
1986
-
1987
- if (newHeight) {
1988
- tableHeight = newHeight;
1989
- }
1990
-
1991
- _this.height = tableHeight;
1992
- });
1993
- }, {
1994
- immediate: true,
1995
- deep: true
1996
- });
1997
- this.$watch('hasLoadData', function (newVal, oldVal) {
1998
- var _this2 = this;
1999
-
2000
- if (newVal === true) {
2001
- this.$nextTick(function () {
2002
- _this2.rowDrop();
2003
-
2004
- var gridParams = store["a" /* default */].get(_this2.storeId);
2005
-
2006
- if (isHasOptionFunction('gridComplete', _this2.storeId)) {
2007
- gridParams.options.gridComplete.call(_this2, {
2008
- gridData: _this2.gridData,
2009
- columns: gridParams.columns,
2010
- superGrid: _this2.$refs.superGrid
2011
- });
2012
- }
2013
-
2014
- var newHeight = _this2.resizeHeight();
2015
-
2016
- if (newHeight) {
2017
- _this2.height = newHeight;
2018
- }
2019
- });
2020
- }
2021
- }, {
2022
- immediate: true,
2023
- deep: true
2024
- });
2025
- },
2026
- methods: super_nine_gridvue_type_script_lang_js_objectSpread(super_nine_gridvue_type_script_lang_js_objectSpread(super_nine_gridvue_type_script_lang_js_objectSpread(super_nine_gridvue_type_script_lang_js_objectSpread({}, super_grid_service), src_apis), custom_formatter), {}, {
2027
- getTitleStyle: function getTitleStyle(entity) {
2028
- // 九宫格的标题自定义样式
2029
- if (this.options && this.options.titleStyle) {
2030
- return this.options.titleStyle.call(this, entity);
2031
- }
2032
-
2033
- return {
2034
- width: '100%'
2035
- };
2036
- },
2037
- // 获得属性值
2038
- getPropValue: function getPropValue(type, entity) {
2039
- var value = '';
2040
- var gridParams = store["a" /* default */].get(this.storeId);
2041
-
2042
- if (type === 'content') {
2043
- var content = '';
2044
-
2045
- if (isHasOptionFunction('setContent', this.storeId)) {
2046
- content = gridParams.options.getContent.call(this, entity);
2047
- }
2048
-
2049
- if (content === undefined || content === '') {
2050
- if (this.props && this.props.content) {
2051
- content = this.objectPropValue(entity, this.propCloumns.content, this.props.content);
2052
- } else if (this.props && this.props.title) {
2053
- content = this.objectPropValue(entity, this.propCloumns.title, this.props.title);
2054
- }
2055
- }
2056
-
2057
- value = content;
2058
- } else if (type === 'title') {
2059
- var _content = '';
2060
-
2061
- if (isHasOptionFunction('setTitle', this.storeId)) {
2062
- _content = gridParams.options.setTitle.call(this, entity);
2063
- }
2064
-
2065
- if (_content === undefined || _content === '') {
2066
- if (this.props && this.props.title) {
2067
- _content = this.objectPropValue(entity, this.propCloumns.title, this.props.title);
2068
- } else if (this.props && this.props.content) {
2069
- _content = this.objectPropValue(entity, this.propCloumns.content, this.props.content);
2070
- }
2071
- }
2072
-
2073
- value = _content;
2074
- } else if (type === 'subTitle') {
2075
- var _content2 = '';
2076
-
2077
- if (isHasOptionFunction('setSubTitle', this.storeId)) {
2078
- _content2 = gridParams.options.getSubTitle.call(this, entity);
2079
- }
2080
-
2081
- if (_content2 === undefined || _content2 === '') {
2082
- if (this.props && this.props.subTitle) {
2083
- _content2 = this.objectPropValue(entity, this.propCloumns.subTitle, this.props.subTitle);
2084
- }
2085
- }
2086
-
2087
- value = _content2;
2088
- }
2089
-
2090
- if (value === undefined) {
2091
- value = '';
2092
- }
2093
-
2094
- return value;
2095
- },
2096
- resizeHeight: function resizeHeight() {
2097
- var gridParams = store["a" /* default */].get(this.storeId);
2098
-
2099
- if (isHasOptionFunction('resizeHeight', this.storeId)) {
2100
- var searchHeight = 0;
2101
-
2102
- if (this.showSearch === true) {
2103
- if (this.$refs.sf) {
2104
- // 获得查询区高度
2105
- searchHeight = this.$refs.sf.$el.offsetHeight;
2106
- }
2107
- }
2108
-
2109
- return gridParams.options.resizeHeight.call(this, {
2110
- code: this.code,
2111
- height: this.height,
2112
- searchHeight: searchHeight
2113
- });
2114
- }
2115
- },
2116
- enter: function enter(index) {
2117
- this.seen = true;
2118
- this.current = index;
2119
- },
2120
- leave: function leave() {
2121
- this.seen = false;
2122
- this.current = null;
2123
- },
2124
- initSetting: function initSetting() {
2125
- var gridParams = store["a" /* default */].get(this.storeId);
2126
-
2127
- if (typeof this.options !== 'undefined') {
2128
- Object.assign(gridParams.options, this.options);
2129
- } else {
2130
- gridParams.options = {};
2131
- }
2132
-
2133
- if (this.options && typeof this.options.isHasCreate !== 'undefined') {
2134
- this.isHasCreate = this.options.isHasCreate;
2135
- }
2136
-
2137
- if (this.options && typeof this.options.props !== 'undefined') {
2138
- this.props = this.options.props;
2139
- }
2140
-
2141
- if (this.options && typeof this.options.operations !== 'undefined') {
2142
- this.operations = this.options.operations;
2143
- }
2144
-
2145
- if (this.options && typeof this.options.createPermission !== 'undefined') {
2146
- this.createPermission = this.options.createPermission;
2147
- }
2148
-
2149
- if (this.options && typeof this.options.multiple !== 'undefined') {
2150
- this.multiple = this.options.multiple;
2151
- }
2152
- },
2153
- // 获得各属性对应的字段配置
2154
- getPropColumns: function getPropColumns() {
2155
- var _this3 = this;
2156
-
2157
- if (this.columns && this.columns.length > 0) {
2158
- // imageUrl:{column}, content: {column}, title: {}, subTitle:{}
2159
- this.propCloumns = {};
2160
- this.columns.forEach(function (column) {
2161
- if (_this3.props.imageUrl && _this3.props.imageUrl === column.prop) {
2162
- _this3.propCloumns.imageUrl = column;
2163
- }
2164
-
2165
- if (_this3.props.content && _this3.props.content === column.prop) {
2166
- _this3.propCloumns.content = column;
2167
- }
2168
-
2169
- if (_this3.props.title && _this3.props.title === column.prop) {
2170
- _this3.propCloumns.title = column;
2171
- }
2172
-
2173
- if (_this3.props.subTitle && _this3.props.subTitle === column.prop) {
2174
- _this3.propCloumns.subTitle = column;
2175
- }
2176
- });
2177
- }
2178
- },
2179
- fetchData: function fetchData(searchParam, isSearch) {
2180
- var _this4 = this;
2181
-
2182
- return new Promise(function (resolve, reject) {
2183
- // 获得各属性对应的字段配置
2184
- _this4.getPropColumns();
2185
-
2186
- _this4.isLoading = true;
2187
- _this4.hasLoadData = false;
2188
-
2189
- if (isSearch === undefined || isSearch === false) {
2190
- // 如果不是查询时才需要从缓存中获得结果
2191
- // 如果是刷新当前列表,则需要获得缓存中的sessionStorage
2192
- var isRefreshList = sessionStorage.getItem('refreshList-' + _this4.storeId); // console.log('fetchData--isRefreshList--', isRefreshList)
2193
-
2194
- if (isRefreshList !== undefined && isRefreshList === 'true') {
2195
- var searchParamJson = sessionStorage.getItem('searchParam-' + _this4.storeId); // console.log('fetchData--searchParamJson--', searchParamJson)
2196
- // console.log('fetchData--pagination--', this.pagination)
2197
-
2198
- if (searchParamJson !== undefined && searchParamJson !== null && searchParamJson !== '') {
2199
- searchParam = JSON.parse(searchParamJson);
2200
- var pagination = searchParam.pagination;
2201
-
2202
- if (pagination) {
2203
- _this4.currentPage = pagination.currentPage;
2204
- _this4.pagination.pageSize = pagination.pageSize;
2205
- _this4.pagination.showTotal = pagination.showTotal;
2206
- }
2207
-
2208
- _this4.getInitSearchForm(searchParam.searchForm); // this.searchFormContent = searchParam.searchForm
2209
-
2210
- }
2211
- }
2212
- }
2213
-
2214
- sessionStorage.removeItem('refreshList-' + _this4.storeId);
2215
-
2216
- if (searchParam === undefined) {
2217
- searchParam = _this4.getSearchParam();
2218
- }
2219
-
2220
- var gridParams = store["a" /* default */].get(_this4.storeId);
2221
- var param = searchParam;
2222
-
2223
- if (gridParams.options.extraParam) {
2224
- param = {
2225
- searchParam: searchParam
2226
- };
2227
-
2228
- if (gridParams.options.extraParam) {
2229
- for (var paramName in gridParams.options.extraParam) {
2230
- param[paramName] = gridParams.options.extraParam[paramName];
2231
- }
2232
- }
2233
- } // 导出需要这两个参数
2234
-
2235
-
2236
- gridParams.searchParam = searchParam;
2237
- gridParams.url = _this4.url;
2238
- var requestUrl = _this4.url; // 缓存查询条件及当前页数
2239
-
2240
- sessionStorage.setItem('searchParam-' + _this4.storeId, JSON.stringify(param));
2241
-
2242
- _this4.$http.post(requestUrl, param).then(function (data) {
2243
- // 对数据做序列化,比如:处理xss攻击
2244
- if (isHasOptionFunction('gridDataLoaded', _this4.storeId)) {
2245
- var gridData = gridParams.options.gridDataLoaded.call(_this4, {
2246
- gridData: data.data,
2247
- columns: gridParams.columns
2248
- });
2249
-
2250
- if (gridData) {
2251
- _this4.gridData = gridData;
2252
- } else {
2253
- _this4.gridData = data.data;
2254
- }
2255
- } else {
2256
- _this4.gridData = data.data;
2257
- }
2258
-
2259
- if (!_this4.gridData) {
2260
- _this4.gridData = [];
2261
- }
2262
-
2263
- if (_this4.pagination !== null) {
2264
- _this4.pagination.total = data.total;
2265
- }
2266
-
2267
- gridParams.gridData = _this4.gridData; // 完成深拷贝,复制一份对象,行编辑时使用
2268
-
2269
- gridParams.orgGridData = [].concat(JSON.parse(JSON.stringify(_this4.gridData)));
2270
- gridParams.pagination = _this4.pagination;
2271
- gridParams.loaded = true;
2272
- _this4.hasLoadData = true;
2273
- resolve();
2274
- }).catch(function (error) {
2275
- if (isHasOptionFunction('loadError', _this4.storeId)) {
2276
- gridParams.options.loadError.call(_this4, _this4.code, error);
2277
- }
2278
-
2279
- reject(error);
2280
- });
2281
- });
2282
- },
2283
- // 获得初始查询条件对象
2284
- getInitSearchForm: function getInitSearchForm(searchFormArr) {
2285
- var _this5 = this;
2286
-
2287
- var gridParams = store["a" /* default */].get(this.storeId);
2288
-
2289
- if (searchFormArr && searchFormArr.length > 0) {
2290
- this.searchFormContent = {};
2291
- searchFormArr.forEach(function (item) {
2292
- // 获得的是"isDeleted"
2293
- var prop = item.propName; // 获得的是“deleted”
2294
-
2295
- var columnProp = item.columnProp;
2296
- var dataType = item.dataType;
2297
-
2298
- if (dataType && dataType === 'BOOLEAN') {
2299
- prop = columnProp;
2300
- }
2301
-
2302
- _this5.initSearchProps.push(prop);
2303
-
2304
- var propValue = item.propValue;
2305
-
2306
- if (prop.indexOf('.') > 0) {
2307
- // 动态给searchForm添加属性,包括多级嵌套属性,属性的初始值都为 null
2308
- addDynamicProp(_this5.searchFormContent, prop, propValue);
2309
- } else {
2310
- _this5.searchFormContent[prop] = propValue;
2311
- }
2312
- });
2313
- gridParams.searchForm = searchFormArr; // 调用查询api方法,该方法中调用了@showSearch方法,用于控制“查询”按钮改名为“取消查询”
2314
-
2315
- this.showSearchForm();
2316
- } else {
2317
- gridParams.searchForm = null;
2318
- }
2319
- },
2320
- showDemo: function showDemo() {
2321
- var _this6 = this;
2322
-
2323
- this.isLoading = true;
2324
- this.$http.get(this.url).then(function (data) {
2325
- Object.assign(_this6, data);
2326
- var gridParams = store["a" /* default */].get(_this6.storeId);
2327
- gridParams.listCode = _this6.code;
2328
- gridParams.columns = _this6.columns;
2329
-
2330
- if (gridParams.columns && _this6.options.dynamicColumns) {
2331
- for (var i = 0; i < _this6.options.dynamicColumns.length; i++) {
2332
- _this6.options.dynamicColumns[i].dynamic = true;
2333
- gridParams.columns.push(_this6.options.dynamicColumns[i]);
2334
- }
2335
- }
2336
-
2337
- gridParams.lineEdit = _this6.lineEdit;
2338
- gridParams.basicInfo = _this6.basicInfo;
2339
- gridParams.pagination = _this6.pagination;
2340
- gridParams.query = _this6.query;
2341
- _this6.gridData = data.gridData; // 对数据做序列化,比如:处理xss攻击
2342
-
2343
- if (isHasOptionFunction('gridDataLoaded', _this6.storeId)) {
2344
- var gridData = gridParams.options.gridDataLoaded.call(_this6, data.gridData);
2345
-
2346
- if (gridData) {
2347
- _this6.gridData = gridData;
2348
- } else {
2349
- _this6.gridData = data.gridData;
2350
- }
2351
- } else {
2352
- _this6.gridData = data.gridData;
2353
- }
2354
-
2355
- if (_this6.pagination != null) {
2356
- _this6.pagination.total = data.total;
2357
- }
2358
-
2359
- if (!_this6.gridData) {
2360
- _this6.gridData = [];
2361
- }
2362
-
2363
- gridParams.gridData = _this6.gridData; // 完成深拷贝,复制一份对象,行编辑时使用
2364
-
2365
- gridParams.orgGridData = [].concat(JSON.parse(JSON.stringify(_this6.gridData)));
2366
- gridParams.pagination = _this6.pagination;
2367
-
2368
- if (isHasOptionFunction('gridComplete', _this6.storeId)) {
2369
- gridParams.options.gridComplete.call(_this6, _this6.gridData, gridParams.columns);
2370
- }
2371
- }).catch(function (error) {
2372
- if (isHasOptionFunction('loadError', _this6.storeId)) {
2373
- var gridParams = store["a" /* default */].get(_this6.storeId);
2374
- gridParams.options.loadError.call(_this6, _this6.code, error);
2375
- }
2376
- });
2377
- },
2378
- search: function search(searchForm) {
2379
- var vm = this;
2380
- return new Promise(function (resolve, reject) {
2381
- var gridParams = store["a" /* default */].get(vm.storeId);
2382
-
2383
- if (typeof searchForm !== 'undefined' && searchForm !== null) {
2384
- gridParams.searchForm = searchForm;
2385
- } else {
2386
- gridParams.searchForm = null;
2387
- }
2388
-
2389
- vm.fetchData(vm.getSearchParam(), true).then(function (data) {
2390
- if (gridParams.options !== undefined && gridParams.options.isHiddenSearchForm !== undefined && gridParams.options.isHiddenSearchForm === true) {
2391
- // 查询时,是否隐藏查询区域,默认是不隐藏查询区域
2392
- vm.showSearch = false;
2393
- vm.$emit('cancel-search');
2394
- }
2395
-
2396
- if (vm.$refs.sf) {
2397
- vm.$refs.sf.loading = false;
2398
- }
2399
-
2400
- resolve(data);
2401
- }).catch(function (error) {
2402
- if (vm.$refs.sf) {
2403
- vm.$refs.sf.loading = false;
2404
- }
2405
-
2406
- reject(error);
2407
- });
2408
- });
2409
- },
2410
- getSearchParam: function getSearchParam() {
2411
- var searchParam = {
2412
- 'code': this.code
2413
- };
2414
- var gridParams = store["a" /* default */].get(this.storeId);
2415
-
2416
- if (this.pagination !== null) {
2417
- var pagination = {
2418
- 'currentPage': this.currentPage,
2419
- 'pageSize': this.pagination.pageSize,
2420
- 'showTotal': this.pagination.showTotal
2421
- };
2422
-
2423
- if (this.pageSize !== null) {
2424
- // 表示更改了每页显示的数据条数
2425
- pagination.pageSize = this.pageSize;
2426
- }
2427
-
2428
- searchParam.pagination = pagination;
2429
- } // 排序信息
2430
-
2431
-
2432
- if (this.sortInfo !== null) {
2433
- // 表示更改了排序信息
2434
- searchParam.sorts = this.sortInfo;
2435
- }
2436
-
2437
- if (this.mergeFields && this.mergeFields.length > 0) {
2438
- if (!searchParam.sorts) {
2439
- searchParam.sorts = [];
2440
- }
2441
-
2442
- var mergeFieldsArr = [];
2443
-
2444
- var _iterator = super_nine_gridvue_type_script_lang_js_createForOfIteratorHelper(this.mergeFields),
2445
- _step;
2446
-
2447
- try {
2448
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
2449
- var mergeField = _step.value;
2450
- var flag = true;
2451
-
2452
- var _iterator2 = super_nine_gridvue_type_script_lang_js_createForOfIteratorHelper(searchParam.sorts),
2453
- _step2;
2454
-
2455
- try {
2456
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
2457
- var so = _step2.value;
2458
-
2459
- if (so.prop === mergeField) {
2460
- flag = false;
2461
- break;
2462
- }
2463
- }
2464
- } catch (err) {
2465
- _iterator2.e(err);
2466
- } finally {
2467
- _iterator2.f();
2468
- }
2469
-
2470
- if (flag) {
2471
- mergeFieldsArr.push({
2472
- 'prop': mergeField,
2473
- 'order': 'ascending'
2474
- });
2475
- }
2476
- }
2477
- } catch (err) {
2478
- _iterator.e(err);
2479
- } finally {
2480
- _iterator.f();
2481
- }
2482
-
2483
- mergeFieldsArr.push.apply(mergeFieldsArr, Object(toConsumableArray["a" /* default */])(searchParam.sorts));
2484
- searchParam.sorts = mergeFieldsArr;
2485
- } // 是否有初始过滤条件
2486
-
2487
-
2488
- if (gridParams.options && typeof gridParams.options.initSearchForm !== 'undefined') {
2489
- searchParam.initSearchForm = gridParams.options.initSearchForm;
2490
- }
2491
-
2492
- if (typeof gridParams.searchForm !== 'undefined') {
2493
- searchParam.searchForm = gridParams.searchForm;
2494
- } else {
2495
- searchParam.searchForm = [];
2496
- }
2497
-
2498
- return searchParam;
2499
- },
2500
- handleSizeChange: function handleSizeChange(val) {
2501
- this.pageSize = val;
2502
- this.fetchData(this.getSearchParam());
2503
- },
2504
- handleCurrentChange: function handleCurrentChange(val) {
2505
- this.fetchData(this.getSearchParam());
2506
- },
2507
- handleSortChange: function handleSortChange(_ref) {
2508
- var column = _ref.column,
2509
- prop = _ref.prop,
2510
- order = _ref.order;
2511
-
2512
- if (prop !== null) {
2513
- // 当点击第3次时,prop会是空,表示清空排序字段,还原原顺序
2514
- this.sortInfo = [{
2515
- 'prop': prop,
2516
- 'order': order
2517
- }];
2518
- } else {
2519
- this.sortInfo = null;
2520
- }
2521
-
2522
- this.fetchData(this.getSearchParam());
2523
- this.$emit('sort-change', {
2524
- column: column,
2525
- prop: prop,
2526
- order: order
2527
- });
2528
- },
2529
- resetSearch: function resetSearch() {
2530
- this.search(null, false);
2531
- },
2532
- // 新建事件
2533
- add: function add() {
2534
- this.$emit('add');
2535
- },
2536
- // 操作按钮的点击事件
2537
- buttonClick: function buttonClick(event, data) {
2538
- if (event) {
2539
- if (typeof event === 'function') {
2540
- event.call(this, data);
2541
- } else {
2542
- this.$emit(event, data);
2543
- }
2544
- }
2545
- },
2546
- // 点击内容区域的事件
2547
- clickContent: function clickContent(data) {
2548
- this.changeSelect(data);
2549
- this.$emit('click', data);
2550
- },
2551
- // 格子拖拽
2552
- rowDrop: function rowDrop() {
2553
- if (this.urlToSaveOrder) {
2554
- var urlToSaveOrder = this.urlToSaveOrder;
2555
-
2556
- if (urlToSaveOrder.indexOf('http:') < 0 || urlToSaveOrder.indexOf('https:') < 0) {
2557
- // 表示是相对路径,需要拼接全路径
2558
- var baseURL = external_Vue_default.a.prototype.baseURL;
2559
-
2560
- if (baseURL.lastIndexOf('/') === baseURL.length - 1) {
2561
- // 表示以斜线结尾
2562
- // 去掉斜线
2563
- baseURL = baseURL.substring(0, baseURL.length - 1);
2564
- }
2565
-
2566
- if (urlToSaveOrder.indexOf('/') > 0) {
2567
- // 表示不是以斜线开头,需要开头加“/”
2568
- urlToSaveOrder = '/' + urlToSaveOrder;
2569
- }
2570
-
2571
- urlToSaveOrder = baseURL + urlToSaveOrder;
2572
- }
2573
-
2574
- var tbody = document.querySelector('#' + this.gridId + ' .el-row');
2575
-
2576
- if (tbody != null) {
2577
- var vm = this;
2578
- sortable_esm["a" /* default */].create(tbody, {
2579
- draggable: '.col-content',
2580
- onEnd: function onEnd(_ref2) {
2581
- var newIndex = _ref2.newIndex,
2582
- oldIndex = _ref2.oldIndex;
2583
- var addCardId = document.querySelector('#' + vm.gridId + ' #_addCardId_');
2584
-
2585
- if (addCardId != null) {
2586
- // 表示存在新建区域,则序号需要减1
2587
- if (oldIndex > 0) {
2588
- oldIndex = oldIndex - 1;
2589
- }
2590
-
2591
- if (newIndex > 0) {
2592
- newIndex = newIndex - 1;
2593
- }
2594
- }
2595
-
2596
- var params = {
2597
- 'oldIndex': oldIndex,
2598
- 'newIndex': newIndex,
2599
- 'gridData': vm.gridData
2600
- };
2601
- vm.$http.post(urlToSaveOrder, params).then(function (data) {
2602
- var currRow = vm.gridData.splice(oldIndex, 1)[0];
2603
- vm.gridData.splice(newIndex, 0, currRow);
2604
- vm.refresh().then(function () {
2605
- vm.$emit('afterDrag', params);
2606
- });
2607
- });
2608
- }
2609
- });
2610
- }
2611
- }
2612
- },
2613
- // 多选按钮的change事件
2614
- changeChecked: function changeChecked(label, index) {
2615
- var entity = this.gridData[index];
2616
-
2617
- if ((label + '').indexOf('false-') >= 0) {
2618
- // 表示取消勾选记录
2619
- this.unselect(entity);
2620
- } else {
2621
- // 表示勾选记录
2622
- this.select(entity);
2623
- }
2624
- },
2625
- unselect: function unselect(entity) {
2626
- var id = entity.id;
2627
- var index = this.selectionIds.indexOf(id);
2628
-
2629
- if (index > -1) {
2630
- this.selections.splice(index, 1);
2631
- this.selectionIds.splice(index, 1);
2632
- }
2633
-
2634
- this.$emit('unselect', entity, this.selections);
2635
- this.$set(this.selectionModels, 'select' + id, 'false-' + id); // console.log('unselect---this.selections=', this.selections)
2636
- },
2637
- select: function select(entity) {
2638
- var id = entity.id;
2639
-
2640
- if (this.selectionIds.indexOf(id) < 0) {
2641
- this.$set(this.selectionIds, this.selectionIds.length, id);
2642
- this.$set(this.selections, this.selections.length, entity);
2643
- }
2644
-
2645
- this.$emit('select', entity, this.selections);
2646
- this.$set(this.selectionModels, 'select' + id, id); // console.log('select---this.selections=', this.selections)
2647
- },
2648
- // 单选按钮的change事件
2649
- changeSelectWhenRadio: function changeSelectWhenRadio(label, index) {
2650
- var entity = this.gridData[index];
2651
- this.selectionIds = [];
2652
- this.selections = [];
2653
- this.selectionModels = {};
2654
- this.select(entity);
2655
- },
2656
- changeSelect: function changeSelect(data) {
2657
- var id = data.id;
2658
-
2659
- if (this.multiple === true) {
2660
- // 多选时
2661
- if (this.selectionIds && this.selectionIds.indexOf(id) >= 0) {
2662
- // 表示需要取消选中
2663
- this.unselect(data);
2664
- } else {
2665
- // 表示需要选中
2666
- this.select(data);
2667
- }
2668
- } else {
2669
- // 单选时
2670
- this.currentId = id;
2671
- this.selectionIds = [];
2672
- this.selections = [];
2673
- this.selectionModels = {};
2674
- this.select(data);
2675
- }
2676
- },
2677
- isShowButton: function isShowButton(entity, button) {
2678
- var val = this.isShowButtonFun(entity, button);
2679
-
2680
- if (val === undefined) {
2681
- return true;
2682
- }
2683
-
2684
- return val;
2685
- }
2686
- })
2687
- });
2688
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/super-nine-grid.vue?vue&type=script&lang=js&
2689
- /* harmony default export */ var src_super_nine_gridvue_type_script_lang_js_ = (super_nine_gridvue_type_script_lang_js_);
2690
- // EXTERNAL MODULE: ./packages/super-nine-grid/src/super-nine-grid.vue?vue&type=style&index=0&id=4d6cc5f7&rel=stylesheet%2Fscss&lang=scss&scoped=true&
2691
- var super_nine_gridvue_type_style_index_0_id_4d6cc5f7_rel_stylesheet_2Fscss_lang_scss_scoped_true_ = __webpack_require__("e7a6");
2692
-
2693
- // CONCATENATED MODULE: ./packages/super-nine-grid/src/super-nine-grid.vue
2694
-
2695
-
2696
-
2697
-
2698
-
2699
-
2700
- /* normalize component */
2701
-
2702
- var super_nine_grid_component = Object(componentNormalizer["a" /* default */])(
2703
- src_super_nine_gridvue_type_script_lang_js_,
2704
- render,
2705
- staticRenderFns,
2706
- false,
2707
- null,
2708
- "4d6cc5f7",
2709
- null
2710
-
2711
- )
2712
-
2713
- /* harmony default export */ var super_nine_grid = (super_nine_grid_component.exports);
2714
- // CONCATENATED MODULE: ./packages/super-nine-grid/index.js
2715
-
2716
-
2717
-
2718
- super_nine_grid.install = function (Vue) {
2719
- Vue.component(super_nine_grid.name, super_nine_grid);
2720
- };
2721
-
2722
- /* harmony default export */ var packages_super_nine_grid = __webpack_exports__["a"] = (super_nine_grid);
2723
-
2724
- /***/ }),
2725
-
2726
- /***/ "7fd5":
2727
- /***/ (function(module, exports, __webpack_require__) {
2728
-
2729
- // extracted by mini-css-extract-plugin
2730
-
2731
- /***/ }),
2732
-
2733
- /***/ "d96b":
2734
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
2735
-
2736
- "use strict";
2737
- /* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("ac6a");
2738
- /* harmony import */ var core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_web_dom_iterable__WEBPACK_IMPORTED_MODULE_0__);
2739
- /* harmony import */ var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("cadf");
2740
- /* harmony import */ var core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_array_iterator__WEBPACK_IMPORTED_MODULE_1__);
2741
- /* harmony import */ var core_js_modules_es6_string_iterator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("5df3");
2742
- /* harmony import */ var core_js_modules_es6_string_iterator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_string_iterator__WEBPACK_IMPORTED_MODULE_2__);
2743
- /* harmony import */ var core_js_modules_es6_map__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("f400");
2744
- /* harmony import */ var core_js_modules_es6_map__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(core_js_modules_es6_map__WEBPACK_IMPORTED_MODULE_3__);
2745
-
2746
-
2747
-
2748
-
2749
- // 用于存放表格的控制属性,控制表格的编辑状态、存储表格的数据便于使用等等
2750
- var store = new Map();
2751
- /* harmony default export */ __webpack_exports__["a"] = (store);
2752
-
2753
- /***/ }),
2754
-
2755
- /***/ "e7a6":
2756
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
2757
-
2758
- "use strict";
2759
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_super_nine_grid_vue_vue_type_style_index_0_id_4d6cc5f7_rel_stylesheet_2Fscss_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("7fd5");
2760
- /* harmony import */ var _node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_super_nine_grid_vue_vue_type_style_index_0_id_4d6cc5f7_rel_stylesheet_2Fscss_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_mini_css_extract_plugin_dist_loader_js_ref_8_oneOf_1_0_node_modules_css_loader_index_js_ref_8_oneOf_1_1_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_src_index_js_ref_8_oneOf_1_2_node_modules_sass_loader_dist_cjs_js_ref_8_oneOf_1_3_node_modules_cache_loader_dist_cjs_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_super_nine_grid_vue_vue_type_style_index_0_id_4d6cc5f7_rel_stylesheet_2Fscss_lang_scss_scoped_true___WEBPACK_IMPORTED_MODULE_0__);
2761
- /* unused harmony reexport * */
2762
-
2763
-
2764
- /***/ }),
2765
-
2766
- /***/ "ea60":
2767
- /***/ (function(module, exports, __webpack_require__) {
2768
-
2769
- // extracted by mini-css-extract-plugin
2770
-
2771
- /***/ })
2772
-
2773
- }]);
2774
- //# sourceMappingURL=super-ui.common.super-ui.common~60a56baa.js.map