@cimom-ui/standard-ui 1.1.12 → 1.1.14
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.
- package/README.md +715 -307
- package/dist/standard-ui.common.js +1167 -217
- package/dist/standard-ui.umd.js +1167 -217
- package/dist/standard-ui.umd.min.js +3 -3
- package/package.json +1 -1
package/dist/standard-ui.umd.js
CHANGED
|
@@ -2858,7 +2858,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.standard-container[data-v-b0b5121a]{d
|
|
|
2858
2858
|
|
|
2859
2859
|
/***/ },
|
|
2860
2860
|
|
|
2861
|
-
/***/
|
|
2861
|
+
/***/ 255
|
|
2862
2862
|
(module, __webpack_exports__, __webpack_require__) {
|
|
2863
2863
|
|
|
2864
2864
|
"use strict";
|
|
@@ -2872,7 +2872,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2872
2872
|
|
|
2873
2873
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
2874
2874
|
// Module
|
|
2875
|
-
___CSS_LOADER_EXPORT___.push([module.id, `.normal-report-toolbar-panel{padding:10px 12px;margin-bottom:8px;background:#fff;border:1px solid #e8edf4;border-radius:10px;box-shadow:0 6px 18px rgba(31,73,125,.06);flex-shrink:0}.normal-report-filter-row{display:flex;align-items:flex-end;-moz-column-gap:6px;column-gap:6px;row-gap:10px;flex-wrap:wrap}.normal-report-filter-row-secondary{margin-top:10px;padding-top:10px;border-top:1px solid #edf1f6}.normal-report-filter-item{display:flex;flex-direction:column;gap:4px;width:175px;flex:0 0 175px;font-size:10px;color:#5a657a}.normal-report-filter-item>span{margin-left:2px}.normal-report-filter-item-date,.normal-report-filter-item-device{width:175px!important}.normal-report-filter-item .normal-report-filter-control{width:100%!important}.normal-report-filter-actions{display:flex;align-items:center;gap:6px;margin-left:auto}.normal-report-filter-actions .el-button+.el-button{margin-left:0}.normal-report-filter-expand-enter-active,.normal-report-filter-expand-leave-active{transition:opacity .18s ease}.normal-report-filter-expand-enter,.normal-report-filter-expand-leave-to{opacity:0}@media(max-width:768px){.normal-report-filter-item{width:100%;flex-basis:100%}.normal-report-filter-actions{width:100%;margin-left:0;justify-content:flex-end}}`, ""]);
|
|
2875
|
+
___CSS_LOADER_EXPORT___.push([module.id, `.normal-report-toolbar-panel{padding:10px 12px;margin-bottom:8px;background:#fff;border:1px solid #e8edf4;border-radius:10px;box-shadow:0 6px 18px rgba(31,73,125,.06);flex-shrink:0}.normal-report-filter-row{display:flex;align-items:flex-end;-moz-column-gap:6px;column-gap:6px;row-gap:10px;flex-wrap:wrap}.standard-filterbar{min-width:0;max-width:100%}.standard-filterbar .normal-report-filter-row-primary{flex-wrap:nowrap;min-width:0;max-width:100%}.standard-filterbar .normal-report-filter-actions{width:auto;flex:0 0 auto;margin-left:auto}.standard-filterbar .normal-report-filter-item{width:var(--filter-item-width,175px);flex:0 0 var(--filter-item-width,175px);min-width:175px;max-width:300px}.standard-filterbar .normal-report-filter-item.normal-report-filter-item-date,.standard-filterbar .normal-report-filter-item.normal-report-filter-item-device{width:var(--filter-item-width,175px)!important;flex:0 0 var(--filter-item-width,175px);min-width:175px;max-width:300px}.normal-report-filter-row-secondary{margin-top:10px;padding-top:10px;border-top:1px solid #edf1f6}.standard-filterbar.standard-filterbar--expand-up{display:flex;flex-direction:column}.standard-filterbar.standard-filterbar--expand-up .normal-report-filter-row-secondary{order:-1;margin-top:0;margin-bottom:10px;padding-top:0;padding-bottom:10px;border-top:none;border-bottom:1px solid #edf1f6}.normal-report-filter-item{display:flex;flex-direction:column;gap:4px;width:175px;flex:0 0 175px;font-size:10px;color:#5a657a}.normal-report-filter-item>span{margin-left:2px}.normal-report-filter-item-date,.normal-report-filter-item-device{width:175px!important}.normal-report-filter-item .normal-report-filter-control{width:100%!important}.standard-filterbar-slot-control>.el-autocomplete,.standard-filterbar-slot-control>.el-cascader,.standard-filterbar-slot-control>.el-date-editor,.standard-filterbar-slot-control>.el-input,.standard-filterbar-slot-control>.el-select{width:100%}.normal-report-filter-actions{display:flex;align-items:center;gap:6px;margin-left:auto}.normal-report-filter-actions .el-button+.el-button{margin-left:0}.normal-report-filter-expand-enter-active,.normal-report-filter-expand-leave-active{transition:opacity .18s ease}.normal-report-filter-expand-enter,.normal-report-filter-expand-leave-to{opacity:0}@media(max-width:768px){.normal-report-filter-item{width:100%;flex-basis:100%}.normal-report-filter-actions{width:100%;margin-left:0;justify-content:flex-end}}`, ""]);
|
|
2876
2876
|
// Exports
|
|
2877
2877
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
2878
2878
|
|
|
@@ -3072,7 +3072,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3072
3072
|
|
|
3073
3073
|
var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
|
|
3074
3074
|
// Module
|
|
3075
|
-
___CSS_LOADER_EXPORT___.push([module.id, `.standard-advanced-query-entry,.standard-advanced-query-entry .el-popover__reference-wrapper{display:inline-flex;align-items:center}.standard-advanced-query-panel{min-width:360px}.standard-advanced-query-list{max-height:300px;overflow-y:auto;padding:4px 0}.standard-advanced-query-empty{padding:12px 0}.standard-advanced-query-empty .el-empty__description p{font-size:12px;color:#909399;margin:0}.standard-advanced-query-item{display:flex;align-items:center;gap:6px;padding:5px 4px}.standard-advanced-query-item .el-button+.el-button{margin-left:0}.standard-advanced-query-item-field{flex:0 0 130px;width:130px}.standard-advanced-query-item-value{flex:1;min-width:0}.standard-advanced-query-item-remove{flex-shrink:0;padding:5px;color:#f56c6c}.standard-advanced-query-add{display:flex;justify-content:center;padding:2px 0}.standard-advanced-query-add .el-button{padding:5px}.standard-advanced-query-footer{margin-top:8px;padding-top:8px;border-top:1px solid #ebeef5;text-align:right}`, ""]);
|
|
3075
|
+
___CSS_LOADER_EXPORT___.push([module.id, `.standard-advanced-query-entry,.standard-advanced-query-entry .el-popover__reference-wrapper{display:inline-flex;align-items:center}.standard-advanced-query-panel{min-width:360px}.standard-advanced-query-custom{display:flex;flex-wrap:wrap;align-items:flex-end;-moz-column-gap:6px;column-gap:6px;row-gap:10px;padding:4px 0 8px}.standard-advanced-query-list{max-height:300px;overflow-y:auto;padding:4px 0}.standard-advanced-query-empty{padding:12px 0}.standard-advanced-query-empty .el-empty__description p{font-size:12px;color:#909399;margin:0}.standard-advanced-query-item{display:flex;align-items:center;gap:6px;padding:5px 4px}.standard-advanced-query-item .el-button+.el-button{margin-left:0}.standard-advanced-query-item-field{flex:0 0 130px;width:130px}.standard-advanced-query-item-value{flex:1;min-width:0}.standard-advanced-query-item-remove{flex-shrink:0;padding:5px;color:#f56c6c}.standard-advanced-query-add{display:flex;justify-content:center;padding:2px 0}.standard-advanced-query-add .el-button{padding:5px}.standard-advanced-query-footer{margin-top:8px;padding-top:8px;border-top:1px solid #ebeef5;text-align:right}`, ""]);
|
|
3076
3076
|
// Exports
|
|
3077
3077
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
3078
3078
|
|
|
@@ -73342,19 +73342,19 @@ var update = add("4a97ea96", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
73342
73342
|
|
|
73343
73343
|
/***/ },
|
|
73344
73344
|
|
|
73345
|
-
/***/
|
|
73345
|
+
/***/ 8859
|
|
73346
73346
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
73347
73347
|
|
|
73348
73348
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
73349
73349
|
|
|
73350
73350
|
// load the styles
|
|
73351
|
-
var content = __webpack_require__(
|
|
73351
|
+
var content = __webpack_require__(255);
|
|
73352
73352
|
if(content.__esModule) content = content.default;
|
|
73353
73353
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
73354
73354
|
if(content.locals) module.exports = content.locals;
|
|
73355
73355
|
// add the styles to the DOM
|
|
73356
73356
|
var add = (__webpack_require__(9548)/* ["default"] */ .A)
|
|
73357
|
-
var update = add("
|
|
73357
|
+
var update = add("73895a00", content, true, {"sourceMap":false,"shadowMode":false});
|
|
73358
73358
|
|
|
73359
73359
|
/***/ },
|
|
73360
73360
|
|
|
@@ -118983,15 +118983,24 @@ var StandardContainer_component = normalizeComponent(
|
|
|
118983
118983
|
)
|
|
118984
118984
|
|
|
118985
118985
|
/* harmony default export */ const StandardContainer = (StandardContainer_component.exports);
|
|
118986
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/index.vue?vue&type=template&id=
|
|
118987
|
-
var
|
|
118986
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/index.vue?vue&type=template&id=042f1c58
|
|
118987
|
+
var StandardFilterbarvue_type_template_id_042f1c58_render = function render() {
|
|
118988
118988
|
var _vm = this,
|
|
118989
|
-
_c = _vm._self._c
|
|
118989
|
+
_c = _vm._self._c,
|
|
118990
|
+
_setup = _vm._self._setupProxy;
|
|
118990
118991
|
return _vm.renderValid ? _c('section', {
|
|
118991
|
-
staticClass: "normal-report-toolbar-panel standard-filterbar"
|
|
118992
|
+
staticClass: "normal-report-toolbar-panel standard-filterbar",
|
|
118993
|
+
"class": {
|
|
118994
|
+
'standard-filterbar--expand-up': _vm.expandAbove
|
|
118995
|
+
}
|
|
118992
118996
|
}, [_c('div', {
|
|
118997
|
+
ref: "filterRow",
|
|
118993
118998
|
staticClass: "normal-report-filter-row normal-report-filter-row-primary"
|
|
118994
|
-
}, [
|
|
118999
|
+
}, [_c('filter-slot-group', {
|
|
119000
|
+
attrs: {
|
|
119001
|
+
"nodes": _vm.primarySlotNodes()
|
|
119002
|
+
}
|
|
119003
|
+
}), _vm._l(_vm.primaryConditionList(), function (cond) {
|
|
118995
119004
|
return _c('filter-search-item', {
|
|
118996
119005
|
key: cond.value,
|
|
118997
119006
|
staticClass: "standard-filterbar-item",
|
|
@@ -118999,6 +119008,7 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
|
|
|
118999
119008
|
attrs: {
|
|
119000
119009
|
"cond": cond,
|
|
119001
119010
|
"search-bar": _vm.searchBar,
|
|
119011
|
+
"layout-width": _vm.sharedItemWidth,
|
|
119002
119012
|
"options": _vm.getOptions(cond),
|
|
119003
119013
|
"is-remote": _vm.isRemoteCond(cond),
|
|
119004
119014
|
"remote-method": _vm.remoteMethods[cond.value] || null,
|
|
@@ -119010,6 +119020,7 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
|
|
|
119010
119020
|
}
|
|
119011
119021
|
});
|
|
119012
119022
|
}), _c('div', {
|
|
119023
|
+
ref: "filterActions",
|
|
119013
119024
|
staticClass: "normal-report-filter-actions"
|
|
119014
119025
|
}, [_c('standard-button', {
|
|
119015
119026
|
attrs: {
|
|
@@ -119039,20 +119050,26 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
|
|
|
119039
119050
|
return _vm.$emit('export');
|
|
119040
119051
|
}
|
|
119041
119052
|
}
|
|
119042
|
-
}) : _vm._e(), _vm.showAdvancedQuery && _vm.
|
|
119053
|
+
}) : _vm._e(), _vm.showAdvancedQuery && _vm.hasOverflow() ? _c('standard-advanced-query', {
|
|
119043
119054
|
ref: "advancedQuery",
|
|
119044
119055
|
attrs: {
|
|
119045
|
-
"conditions": _vm.
|
|
119056
|
+
"conditions": _vm.overflowConditionList(),
|
|
119057
|
+
"custom-count": _vm.overflowSlotNodes().length,
|
|
119046
119058
|
"search-bar": _vm.searchBar
|
|
119047
119059
|
},
|
|
119048
119060
|
on: {
|
|
119049
119061
|
"search": _vm.onSearch
|
|
119050
119062
|
}
|
|
119051
|
-
}
|
|
119063
|
+
}, [_c('filter-slot-group', {
|
|
119064
|
+
attrs: {
|
|
119065
|
+
"nodes": _vm.overflowSlotNodes()
|
|
119066
|
+
}
|
|
119067
|
+
})], 1) : _vm.showExpand && _vm.hasOverflow() ? _c('standard-button', {
|
|
119068
|
+
ref: "moreButton",
|
|
119052
119069
|
staticClass: "normal-report-expand-button",
|
|
119053
119070
|
attrs: {
|
|
119054
|
-
"icon": _vm.
|
|
119055
|
-
"label": "\u66F4\u591A".concat(_vm.
|
|
119071
|
+
"icon": _vm.expandIcon,
|
|
119072
|
+
"label": "\u66F4\u591A".concat(_vm.overflowActiveCount() ? " (".concat(_vm.overflowActiveCount(), ")") : '')
|
|
119056
119073
|
},
|
|
119057
119074
|
on: {
|
|
119058
119075
|
"click": function click($event) {
|
|
@@ -119063,15 +119080,19 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
|
|
|
119063
119080
|
attrs: {
|
|
119064
119081
|
"name": "normal-report-filter-expand"
|
|
119065
119082
|
}
|
|
119066
|
-
}, [_vm.
|
|
119083
|
+
}, [!_vm.showAdvancedQuery && _vm.hasOverflow() ? _c('div', {
|
|
119067
119084
|
directives: [{
|
|
119068
119085
|
name: "show",
|
|
119069
119086
|
rawName: "v-show",
|
|
119070
|
-
value: _vm.
|
|
119071
|
-
expression: "
|
|
119087
|
+
value: _vm.secondaryOpen(),
|
|
119088
|
+
expression: "secondaryOpen()"
|
|
119072
119089
|
}],
|
|
119073
119090
|
staticClass: "normal-report-filter-row normal-report-filter-row-secondary"
|
|
119074
|
-
},
|
|
119091
|
+
}, [_c('filter-slot-group', {
|
|
119092
|
+
attrs: {
|
|
119093
|
+
"nodes": _vm.overflowSlotNodes()
|
|
119094
|
+
}
|
|
119095
|
+
}), _vm._l(_vm.overflowConditionList(), function (cond) {
|
|
119075
119096
|
return _c('filter-search-item', {
|
|
119076
119097
|
key: cond.value,
|
|
119077
119098
|
staticClass: "standard-filterbar-item",
|
|
@@ -119079,6 +119100,7 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
|
|
|
119079
119100
|
attrs: {
|
|
119080
119101
|
"cond": cond,
|
|
119081
119102
|
"search-bar": _vm.searchBar,
|
|
119103
|
+
"layout-width": _vm.sharedItemWidth,
|
|
119082
119104
|
"options": _vm.getOptions(cond),
|
|
119083
119105
|
"is-remote": _vm.isRemoteCond(cond),
|
|
119084
119106
|
"remote-method": _vm.remoteMethods[cond.value] || null,
|
|
@@ -119089,12 +119111,12 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
|
|
|
119089
119111
|
}
|
|
119090
119112
|
}
|
|
119091
119113
|
});
|
|
119092
|
-
}),
|
|
119114
|
+
})], 2) : _vm._e()])], 1) : _vm._e();
|
|
119093
119115
|
};
|
|
119094
|
-
var
|
|
119116
|
+
var StandardFilterbarvue_type_template_id_042f1c58_staticRenderFns = [];
|
|
119095
119117
|
|
|
119096
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardAdvancedQuery/index.vue?vue&type=template&id=
|
|
119097
|
-
var
|
|
119118
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardAdvancedQuery/index.vue?vue&type=template&id=07a0d3fc
|
|
119119
|
+
var StandardAdvancedQueryvue_type_template_id_07a0d3fc_render = function render() {
|
|
119098
119120
|
var _vm = this,
|
|
119099
119121
|
_c = _vm._self._c;
|
|
119100
119122
|
return _c('el-popover', {
|
|
@@ -119112,7 +119134,9 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_render = function render(
|
|
|
119112
119134
|
}
|
|
119113
119135
|
}, [_c('div', {
|
|
119114
119136
|
staticClass: "standard-advanced-query-panel"
|
|
119115
|
-
}, [_c('div', {
|
|
119137
|
+
}, [_vm.customCount ? _c('div', {
|
|
119138
|
+
staticClass: "standard-advanced-query-custom"
|
|
119139
|
+
}, [_vm._t("default")], 2) : _vm._e(), _c('div', {
|
|
119116
119140
|
staticClass: "standard-advanced-query-list"
|
|
119117
119141
|
}, [_vm.rows.length ? _vm._l(_vm.rows, function (row, index) {
|
|
119118
119142
|
return _c('div', {
|
|
@@ -119165,13 +119189,13 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_render = function render(
|
|
|
119165
119189
|
}
|
|
119166
119190
|
}
|
|
119167
119191
|
})], 1);
|
|
119168
|
-
}) : _c('el-empty', {
|
|
119192
|
+
}) : !_vm.customCount ? _c('el-empty', {
|
|
119169
119193
|
staticClass: "standard-advanced-query-empty",
|
|
119170
119194
|
attrs: {
|
|
119171
119195
|
"image-size": 60,
|
|
119172
119196
|
"description": "点击下方新增按钮添加查询条件"
|
|
119173
119197
|
}
|
|
119174
|
-
})], 2), _c('div', {
|
|
119198
|
+
}) : _vm._e()], 2), _c('div', {
|
|
119175
119199
|
staticClass: "standard-advanced-query-footer"
|
|
119176
119200
|
}, [_c('el-button', {
|
|
119177
119201
|
attrs: {
|
|
@@ -119209,7 +119233,7 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_render = function render(
|
|
|
119209
119233
|
slot: "reference"
|
|
119210
119234
|
}, [_vm._v(" 高级查询" + _vm._s(_vm.rows.length ? " (".concat(_vm.rows.length, ")") : '') + " ")])], 1);
|
|
119211
119235
|
};
|
|
119212
|
-
var
|
|
119236
|
+
var StandardAdvancedQueryvue_type_template_id_07a0d3fc_staticRenderFns = [];
|
|
119213
119237
|
|
|
119214
119238
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardAdvancedQuery/index.vue?vue&type=script&lang=js
|
|
119215
119239
|
/**
|
|
@@ -119235,6 +119259,11 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_staticRenderFns = [];
|
|
|
119235
119259
|
return [];
|
|
119236
119260
|
}
|
|
119237
119261
|
},
|
|
119262
|
+
// 未进首行的自定义筛选项数量(默认插槽中的原始控件,不参与文本条件行)
|
|
119263
|
+
customCount: {
|
|
119264
|
+
type: Number,
|
|
119265
|
+
"default": 0
|
|
119266
|
+
},
|
|
119238
119267
|
// v-model 绑定的筛选配置对象(读写 searchVariable 完成值双向绑定)
|
|
119239
119268
|
searchBar: {
|
|
119240
119269
|
type: Object,
|
|
@@ -119259,7 +119288,8 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_staticRenderFns = [];
|
|
|
119259
119288
|
}
|
|
119260
119289
|
},
|
|
119261
119290
|
watch: {
|
|
119262
|
-
//
|
|
119291
|
+
// 可用条件变化时:移出已不在列表中的行(保留字段值,避免首行容量变化时把已填内容清掉);
|
|
119292
|
+
// 新进入列表且已有值的字段补一行,角标与弹窗能看到该条件
|
|
119263
119293
|
conditions: function conditions() {
|
|
119264
119294
|
var _this = this;
|
|
119265
119295
|
var fields = (this.conditions || []).map(function (c) {
|
|
@@ -119268,8 +119298,19 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_staticRenderFns = [];
|
|
|
119268
119298
|
var valid = this.rows.filter(function (row) {
|
|
119269
119299
|
return fields.indexOf(row.field) > -1;
|
|
119270
119300
|
});
|
|
119271
|
-
|
|
119272
|
-
|
|
119301
|
+
var existing = {};
|
|
119302
|
+
valid.forEach(function (row) {
|
|
119303
|
+
existing[row.field] = true;
|
|
119304
|
+
});
|
|
119305
|
+
(this.conditions || []).forEach(function (cond) {
|
|
119306
|
+
if (!cond || existing[cond.value]) return;
|
|
119307
|
+
if (_this.hasValue(cond)) {
|
|
119308
|
+
valid.push({
|
|
119309
|
+
uid: ++_this.uidSeq,
|
|
119310
|
+
field: cond.value
|
|
119311
|
+
});
|
|
119312
|
+
existing[cond.value] = true;
|
|
119313
|
+
}
|
|
119273
119314
|
});
|
|
119274
119315
|
this.rows = valid;
|
|
119275
119316
|
}
|
|
@@ -119423,8 +119464,8 @@ var StandardAdvancedQueryvue_type_style_index_0_prod_lang_scss_external = __webp
|
|
|
119423
119464
|
|
|
119424
119465
|
var StandardAdvancedQuery_component = normalizeComponent(
|
|
119425
119466
|
components_StandardAdvancedQueryvue_type_script_lang_js,
|
|
119426
|
-
|
|
119427
|
-
|
|
119467
|
+
StandardAdvancedQueryvue_type_template_id_07a0d3fc_render,
|
|
119468
|
+
StandardAdvancedQueryvue_type_template_id_07a0d3fc_staticRenderFns,
|
|
119428
119469
|
false,
|
|
119429
119470
|
null,
|
|
119430
119471
|
null,
|
|
@@ -119433,11 +119474,125 @@ var StandardAdvancedQuery_component = normalizeComponent(
|
|
|
119433
119474
|
)
|
|
119434
119475
|
|
|
119435
119476
|
/* harmony default export */ const StandardAdvancedQuery = (StandardAdvancedQuery_component.exports);
|
|
119477
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/Item.vue?vue&type=template&id=0001f453
|
|
119478
|
+
var Itemvue_type_template_id_0001f453_render = function render() {
|
|
119479
|
+
var _vm = this,
|
|
119480
|
+
_c = _vm._self._c;
|
|
119481
|
+
return _c('label', {
|
|
119482
|
+
staticClass: "normal-report-filter-item",
|
|
119483
|
+
style: _vm.itemStyle
|
|
119484
|
+
}, [_vm.label ? _c('span', [_vm._v(_vm._s(_vm.label))]) : _vm._e(), _c('div', {
|
|
119485
|
+
staticClass: "normal-report-filter-control standard-filterbar-slot-control"
|
|
119486
|
+
}, [_vm._t("default")], 2)]);
|
|
119487
|
+
};
|
|
119488
|
+
var Itemvue_type_template_id_0001f453_staticRenderFns = [];
|
|
119489
|
+
|
|
119490
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/Item.vue?vue&type=script&lang=js
|
|
119491
|
+
/**
|
|
119492
|
+
* StandardFilterbarItem
|
|
119493
|
+
* 用法(作为 standard-filterbar 的默认插槽子节点,顺序优先于 v-model 中的条件):
|
|
119494
|
+
* <standard-filterbar-item label="车间">
|
|
119495
|
+
* <el-select v-model="extra.workshop" size="mini" clearable />
|
|
119496
|
+
* </standard-filterbar-item>
|
|
119497
|
+
*/
|
|
119498
|
+
/* harmony default export */ const Itemvue_type_script_lang_js = ({
|
|
119499
|
+
name: 'StandardFilterbarItem',
|
|
119500
|
+
props: {
|
|
119501
|
+
// 条件标题,显示在控件上方
|
|
119502
|
+
label: {
|
|
119503
|
+
type: String,
|
|
119504
|
+
"default": ''
|
|
119505
|
+
},
|
|
119506
|
+
// 自定义宽度:数字按 px,或任意 CSS 宽度字符串。未传时跟随首行统一宽度
|
|
119507
|
+
width: {
|
|
119508
|
+
type: [Number, String],
|
|
119509
|
+
"default": null
|
|
119510
|
+
},
|
|
119511
|
+
// 由筛选栏在渲染时写入的统一项宽,使用方无需传递
|
|
119512
|
+
layoutWidth: {
|
|
119513
|
+
type: Number,
|
|
119514
|
+
"default": 0
|
|
119515
|
+
}
|
|
119516
|
+
},
|
|
119517
|
+
computed: {
|
|
119518
|
+
itemStyle: function itemStyle() {
|
|
119519
|
+
var custom = this.width;
|
|
119520
|
+
var hasCustom = custom !== undefined && custom !== null && custom !== '';
|
|
119521
|
+
var toCss = function toCss(value) {
|
|
119522
|
+
return typeof value === 'number' ? "".concat(value, "px") : value;
|
|
119523
|
+
};
|
|
119524
|
+
if (hasCustom) {
|
|
119525
|
+
var css = toCss(custom);
|
|
119526
|
+
return {
|
|
119527
|
+
'--filter-item-width': css,
|
|
119528
|
+
width: css,
|
|
119529
|
+
flexBasis: css,
|
|
119530
|
+
flexGrow: 0,
|
|
119531
|
+
flexShrink: 0,
|
|
119532
|
+
minWidth: css,
|
|
119533
|
+
maxWidth: css
|
|
119534
|
+
};
|
|
119535
|
+
}
|
|
119536
|
+
if (this.layoutWidth > 0) {
|
|
119537
|
+
var _css = "".concat(this.layoutWidth, "px");
|
|
119538
|
+
return {
|
|
119539
|
+
'--filter-item-width': _css,
|
|
119540
|
+
width: _css,
|
|
119541
|
+
flexBasis: _css,
|
|
119542
|
+
flexGrow: 0,
|
|
119543
|
+
flexShrink: 0
|
|
119544
|
+
};
|
|
119545
|
+
}
|
|
119546
|
+
return null;
|
|
119547
|
+
}
|
|
119548
|
+
}
|
|
119549
|
+
});
|
|
119550
|
+
;// ./src/components/StandardFilterbar/Item.vue?vue&type=script&lang=js
|
|
119551
|
+
/* harmony default export */ const StandardFilterbar_Itemvue_type_script_lang_js = (Itemvue_type_script_lang_js);
|
|
119552
|
+
;// ./src/components/StandardFilterbar/Item.vue
|
|
119553
|
+
|
|
119554
|
+
|
|
119555
|
+
|
|
119556
|
+
|
|
119557
|
+
|
|
119558
|
+
/* normalize component */
|
|
119559
|
+
;
|
|
119560
|
+
var Item_component = normalizeComponent(
|
|
119561
|
+
StandardFilterbar_Itemvue_type_script_lang_js,
|
|
119562
|
+
Itemvue_type_template_id_0001f453_render,
|
|
119563
|
+
Itemvue_type_template_id_0001f453_staticRenderFns,
|
|
119564
|
+
false,
|
|
119565
|
+
null,
|
|
119566
|
+
null,
|
|
119567
|
+
null
|
|
119568
|
+
|
|
119569
|
+
)
|
|
119570
|
+
|
|
119571
|
+
/* harmony default export */ const Item = (Item_component.exports);
|
|
119436
119572
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/index.vue?vue&type=script&lang=js
|
|
119437
119573
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
119438
119574
|
;
|
|
119439
119575
|
|
|
119440
119576
|
|
|
119577
|
+
|
|
119578
|
+
/**
|
|
119579
|
+
* 把插槽项 vnode 铺进父级 flex 行,不额外包一层,保证每个 item 单独占一格。
|
|
119580
|
+
*/
|
|
119581
|
+
var FilterSlotGroup = {
|
|
119582
|
+
functional: true,
|
|
119583
|
+
props: {
|
|
119584
|
+
nodes: {
|
|
119585
|
+
type: Array,
|
|
119586
|
+
"default": function _default() {
|
|
119587
|
+
return [];
|
|
119588
|
+
}
|
|
119589
|
+
}
|
|
119590
|
+
},
|
|
119591
|
+
render: function render(h, ctx) {
|
|
119592
|
+
return ctx.props.nodes || [];
|
|
119593
|
+
}
|
|
119594
|
+
};
|
|
119595
|
+
|
|
119441
119596
|
/**
|
|
119442
119597
|
* 单个筛选条件渲染组件(组件内部使用,不对外暴露)
|
|
119443
119598
|
* 使用 render 函数实现,避免主区/次区重复书写同一套控件模板
|
|
@@ -119485,7 +119640,12 @@ var FilterSearchItem = {
|
|
|
119485
119640
|
onFocus: {
|
|
119486
119641
|
type: Function,
|
|
119487
119642
|
"default": null
|
|
119488
|
-
}
|
|
119643
|
+
},
|
|
119644
|
+
// 下拉聚焦/展开时的回调
|
|
119645
|
+
layoutWidth: {
|
|
119646
|
+
type: Number,
|
|
119647
|
+
"default": 0
|
|
119648
|
+
} // 首行测得的统一项宽(px);0 表示尚未测得,沿用样式默认值
|
|
119489
119649
|
},
|
|
119490
119650
|
render: function render(h) {
|
|
119491
119651
|
var _this = this;
|
|
@@ -119500,12 +119660,34 @@ var FilterSearchItem = {
|
|
|
119500
119660
|
};
|
|
119501
119661
|
var clearable = cond.clearable !== false;
|
|
119502
119662
|
var placeholder = cond.placeholder || (cond.type === 'text' ? "\u8BF7\u8F93\u5165".concat(cond.label) : "\u8BF7\u9009\u62E9".concat(cond.label));
|
|
119503
|
-
//
|
|
119504
|
-
var
|
|
119505
|
-
var
|
|
119506
|
-
|
|
119507
|
-
|
|
119508
|
-
}
|
|
119663
|
+
// 宽度:单条 cond.width 优先(数字按 px);否则使用父组件按行宽算出的统一宽度
|
|
119664
|
+
var custom = cond.width;
|
|
119665
|
+
var hasCustom = custom !== undefined && custom !== null && custom !== '';
|
|
119666
|
+
var toCss = function toCss(value) {
|
|
119667
|
+
return typeof value === 'number' ? "".concat(value, "px") : value;
|
|
119668
|
+
};
|
|
119669
|
+
var style = null;
|
|
119670
|
+
if (hasCustom) {
|
|
119671
|
+
var css = toCss(custom);
|
|
119672
|
+
style = {
|
|
119673
|
+
'--filter-item-width': css,
|
|
119674
|
+
width: css,
|
|
119675
|
+
flexBasis: css,
|
|
119676
|
+
flexGrow: 0,
|
|
119677
|
+
flexShrink: 0,
|
|
119678
|
+
minWidth: css,
|
|
119679
|
+
maxWidth: css
|
|
119680
|
+
};
|
|
119681
|
+
} else if (this.layoutWidth > 0) {
|
|
119682
|
+
var _css = "".concat(this.layoutWidth, "px");
|
|
119683
|
+
style = {
|
|
119684
|
+
'--filter-item-width': _css,
|
|
119685
|
+
width: _css,
|
|
119686
|
+
flexBasis: _css,
|
|
119687
|
+
flexGrow: 0,
|
|
119688
|
+
flexShrink: 0
|
|
119689
|
+
};
|
|
119690
|
+
}
|
|
119509
119691
|
var controlEl = null;
|
|
119510
119692
|
switch (cond.type) {
|
|
119511
119693
|
// 文本输入框
|
|
@@ -119624,14 +119806,17 @@ var FilterSearchItem = {
|
|
|
119624
119806
|
* 用法:
|
|
119625
119807
|
* <standard-filterbar v-model="searchBar" show-export @search="..." @export="..." />
|
|
119626
119808
|
* 说明:
|
|
119627
|
-
* v-model 绑定的 searchBar 对象包含 searchCondition(条件配置列表)、searchVariable
|
|
119628
|
-
*
|
|
119629
|
-
*
|
|
119809
|
+
* v-model 绑定的 searchBar 对象包含 searchCondition(条件配置列表)、searchVariable(绑定值对象)。
|
|
119810
|
+
* 默认插槽中的 standard-filterbar-item 排在 searchCondition 之前;首行放不下的进入“更多”或“高级查询”。
|
|
119811
|
+
* 不传插槽时仍按单标签使用。单项宽 175–300px。
|
|
119812
|
+
* 未显式传入 mainConditionCount 时不设个数上限,传入时作为首行个数上限。
|
|
119813
|
+
* isMain 仍可写在配置中,不再参与首行/其余的划分。
|
|
119630
119814
|
*/
|
|
119631
|
-
|
|
119815
|
+
var StandardFilterbar = {
|
|
119632
119816
|
name: 'StandardFilterbar',
|
|
119633
119817
|
components: {
|
|
119634
119818
|
FilterSearchItem: FilterSearchItem,
|
|
119819
|
+
FilterSlotGroup: FilterSlotGroup,
|
|
119635
119820
|
StandardButton: StandardButton,
|
|
119636
119821
|
StandardAdvancedQuery: StandardAdvancedQuery
|
|
119637
119822
|
},
|
|
@@ -119641,7 +119826,7 @@ var FilterSearchItem = {
|
|
|
119641
119826
|
event: 'input'
|
|
119642
119827
|
},
|
|
119643
119828
|
props: {
|
|
119644
|
-
// v-model 绑定的筛选配置对象:{ searchCondition: [], searchVariable: {}, mainConditionCount
|
|
119829
|
+
// v-model 绑定的筛选配置对象:{ searchCondition: [], searchVariable: {}, mainConditionCount }
|
|
119645
119830
|
searchBar: {
|
|
119646
119831
|
type: Object,
|
|
119647
119832
|
required: true
|
|
@@ -119662,6 +119847,11 @@ var FilterSearchItem = {
|
|
|
119662
119847
|
type: Boolean,
|
|
119663
119848
|
"default": false
|
|
119664
119849
|
},
|
|
119850
|
+
// 更多条件是否向筛选栏上方展开。仅在为 true 且未使用高级查询时生效;否则在下方展开
|
|
119851
|
+
expandUpwards: {
|
|
119852
|
+
type: Boolean,
|
|
119853
|
+
"default": true
|
|
119854
|
+
},
|
|
119665
119855
|
// 查询按钮 loading 状态(可选,由父组件控制)
|
|
119666
119856
|
loading: {
|
|
119667
119857
|
type: Boolean,
|
|
@@ -119685,7 +119875,11 @@ var FilterSearchItem = {
|
|
|
119685
119875
|
// 远程下拉加载状态:{ 条件value: Boolean }
|
|
119686
119876
|
remoteMethods: {},
|
|
119687
119877
|
// 远程下拉防抖方法缓存:{ 条件value: Function }
|
|
119688
|
-
initValues: {}
|
|
119878
|
+
initValues: {},
|
|
119879
|
+
// searchVariable 初始值快照(组件创建时刻),用于“重置”
|
|
119880
|
+
visibleCount: 99,
|
|
119881
|
+
// 首行可展示的条件个数,挂载后按容器宽度重算
|
|
119882
|
+
sharedItemWidth: 0 // 首行弹性项的统一宽度(px),0 表示沿用样式默认 175
|
|
119689
119883
|
};
|
|
119690
119884
|
},
|
|
119691
119885
|
computed: {
|
|
@@ -119694,95 +119888,329 @@ var FilterSearchItem = {
|
|
|
119694
119888
|
var list = this.searchBar && this.searchBar.searchCondition || [];
|
|
119695
119889
|
return Array.isArray(list) ? list : [];
|
|
119696
119890
|
},
|
|
119697
|
-
//
|
|
119698
|
-
//
|
|
119699
|
-
|
|
119891
|
+
// 首行个数上限:仅当 searchBar.mainConditionCount 显式传入且为非负数字时生效;
|
|
119892
|
+
// 未传则只受容器宽度限制
|
|
119893
|
+
firstRowLimit: function firstRowLimit() {
|
|
119700
119894
|
var count = this.searchBar && this.searchBar.mainConditionCount;
|
|
119895
|
+
if (count === undefined || count === null || count === '') return null;
|
|
119701
119896
|
var num = Number(count);
|
|
119702
|
-
|
|
119897
|
+
if (isNaN(num) || num < 0) return null;
|
|
119898
|
+
return Math.floor(num);
|
|
119703
119899
|
},
|
|
119704
|
-
//
|
|
119705
|
-
|
|
119900
|
+
// 参与排布的条件:保持 searchCondition 数组顺序,空项不渲染
|
|
119901
|
+
orderedConditions: function orderedConditions() {
|
|
119706
119902
|
return this.conditions.filter(function (cond) {
|
|
119707
|
-
return cond && (cond
|
|
119903
|
+
return cond && _typeof(cond) === 'object';
|
|
119708
119904
|
});
|
|
119709
119905
|
},
|
|
119710
|
-
//
|
|
119711
|
-
|
|
119712
|
-
return this.
|
|
119713
|
-
return !cond || cond.isMain !== 'Y' && cond.isMain !== true;
|
|
119714
|
-
});
|
|
119906
|
+
// 向上展开:属性为 true,且当前不是高级查询
|
|
119907
|
+
expandAbove: function expandAbove() {
|
|
119908
|
+
return this.expandUpwards && !this.showAdvancedQuery;
|
|
119715
119909
|
},
|
|
119716
|
-
//
|
|
119717
|
-
|
|
119718
|
-
|
|
119719
|
-
|
|
119720
|
-
if (this.showAdvancedQuery) return false;
|
|
119721
|
-
return this.showExpand ? this.expanded : true;
|
|
119722
|
-
},
|
|
119723
|
-
// 次区已填写条件的数量(用于“更多 (n)”角标)
|
|
119724
|
-
secondaryActiveCount: function secondaryActiveCount() {
|
|
119725
|
-
var _this2 = this;
|
|
119726
|
-
return this.secondaryConditions.filter(function (cond) {
|
|
119727
|
-
return _this2.hasValue(cond);
|
|
119728
|
-
}).length;
|
|
119910
|
+
// 更多按钮箭头:向上展开时,收起箭头朝上、展开后箭头朝下
|
|
119911
|
+
expandIcon: function expandIcon() {
|
|
119912
|
+
if (this.expandAbove) return this.expanded ? 'el-icon-arrow-down' : 'el-icon-arrow-up';
|
|
119913
|
+
return this.expanded ? 'el-icon-arrow-up' : 'el-icon-arrow-down';
|
|
119729
119914
|
}
|
|
119730
119915
|
},
|
|
119731
119916
|
watch: {
|
|
119732
119917
|
// 条件配置动态变化时重新校验,并为新增的远程下拉补充初始化
|
|
119733
119918
|
'searchBar.searchCondition': function searchBarSearchCondition(val) {
|
|
119734
|
-
var
|
|
119919
|
+
var _this2 = this;
|
|
119735
119920
|
this.validate();
|
|
119921
|
+
this.scheduleMeasure();
|
|
119736
119922
|
if (!this.renderValid) return;
|
|
119737
119923
|
var list = Array.isArray(val) ? val : [];
|
|
119738
119924
|
list.forEach(function (cond) {
|
|
119739
|
-
if (
|
|
119740
|
-
if (!
|
|
119741
|
-
|
|
119742
|
-
return
|
|
119925
|
+
if (_this2.isRemoteCond(cond)) {
|
|
119926
|
+
if (!_this2.remoteMethods[cond.value]) {
|
|
119927
|
+
_this2.remoteMethods[cond.value] = _this2.debounce(function (keyword) {
|
|
119928
|
+
return _this2.loadRemoteOptions(cond, keyword);
|
|
119743
119929
|
}, 300);
|
|
119744
119930
|
}
|
|
119745
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
119746
|
-
|
|
119931
|
+
if (!Object.prototype.hasOwnProperty.call(_this2.remoteOptions, cond.value)) {
|
|
119932
|
+
_this2.loadRemoteOptions(cond, '');
|
|
119747
119933
|
}
|
|
119748
119934
|
}
|
|
119749
119935
|
});
|
|
119936
|
+
},
|
|
119937
|
+
showExport: function showExport() {
|
|
119938
|
+
this.scheduleMeasure();
|
|
119939
|
+
},
|
|
119940
|
+
showExpand: function showExpand() {
|
|
119941
|
+
this.scheduleMeasure();
|
|
119942
|
+
},
|
|
119943
|
+
showAdvancedQuery: function showAdvancedQuery() {
|
|
119944
|
+
this.scheduleMeasure();
|
|
119750
119945
|
}
|
|
119751
119946
|
},
|
|
119752
119947
|
created: function created() {
|
|
119753
|
-
var
|
|
119948
|
+
var _this3 = this;
|
|
119754
119949
|
// 深拷贝初始值快照:作为“重置”按钮的恢复目标
|
|
119755
119950
|
this.initValues = this.deepCopy(this.searchBar && this.searchBar.searchVariable || {});
|
|
119756
119951
|
// 渲染前校验:失败则 renderValid=false,组件不渲染
|
|
119757
119952
|
this.validate();
|
|
119758
119953
|
if (!this.renderValid) return;
|
|
119759
|
-
//
|
|
119760
|
-
if (!this.showExpand
|
|
119954
|
+
// 关闭“更多”时,未进首行的条件换行常显
|
|
119955
|
+
if (!this.showExpand) {
|
|
119761
119956
|
this.expanded = true;
|
|
119762
119957
|
}
|
|
119958
|
+
this._slotStamp = 0;
|
|
119959
|
+
this._slotBucket = null;
|
|
119960
|
+
this._measuredSlotCount = 0;
|
|
119763
119961
|
// 为远程下拉预先创建防抖方法,并做首次数据加载
|
|
119764
|
-
this.
|
|
119765
|
-
if (
|
|
119766
|
-
if (!
|
|
119767
|
-
|
|
119768
|
-
return
|
|
119962
|
+
this.conditions.forEach(function (cond) {
|
|
119963
|
+
if (_this3.isRemoteCond(cond)) {
|
|
119964
|
+
if (!_this3.remoteMethods[cond.value]) {
|
|
119965
|
+
_this3.remoteMethods[cond.value] = _this3.debounce(function (keyword) {
|
|
119966
|
+
return _this3.loadRemoteOptions(cond, keyword);
|
|
119769
119967
|
}, 300);
|
|
119770
119968
|
}
|
|
119771
|
-
|
|
119969
|
+
_this3.loadRemoteOptions(cond, '');
|
|
119772
119970
|
}
|
|
119773
119971
|
});
|
|
119774
119972
|
},
|
|
119973
|
+
beforeUpdate: function beforeUpdate() {
|
|
119974
|
+
// 同一次渲染里多次读取插槽时复用同一批 vnode,避免自定义控件被创建两份
|
|
119975
|
+
this._slotStamp = (this._slotStamp || 0) + 1;
|
|
119976
|
+
this._slotBucket = null;
|
|
119977
|
+
},
|
|
119978
|
+
mounted: function mounted() {
|
|
119979
|
+
var _this4 = this;
|
|
119980
|
+
this.$nextTick(function () {
|
|
119981
|
+
_this4.bindResize();
|
|
119982
|
+
_this4.measureVisibleCount();
|
|
119983
|
+
});
|
|
119984
|
+
},
|
|
119985
|
+
updated: function updated() {
|
|
119986
|
+
var count = this.readSlotNodes().length;
|
|
119987
|
+
if (count !== this._measuredSlotCount) {
|
|
119988
|
+
this._measuredSlotCount = count;
|
|
119989
|
+
this.scheduleMeasure();
|
|
119990
|
+
}
|
|
119991
|
+
},
|
|
119992
|
+
beforeDestroy: function beforeDestroy() {
|
|
119993
|
+
if (this._resizeObserver) {
|
|
119994
|
+
this._resizeObserver.disconnect();
|
|
119995
|
+
this._resizeObserver = null;
|
|
119996
|
+
}
|
|
119997
|
+
if (this._measureRaf) {
|
|
119998
|
+
cancelAnimationFrame(this._measureRaf);
|
|
119999
|
+
this._measureRaf = 0;
|
|
120000
|
+
}
|
|
120001
|
+
if (this._onWindowResize) {
|
|
120002
|
+
window.removeEventListener('resize', this._onWindowResize);
|
|
120003
|
+
this._onWindowResize = null;
|
|
120004
|
+
}
|
|
120005
|
+
},
|
|
119775
120006
|
methods: {
|
|
120007
|
+
/** 下一帧重算首行容量,合并同一帧内的连续触发 */scheduleMeasure: function scheduleMeasure() {
|
|
120008
|
+
var _this5 = this;
|
|
120009
|
+
if (this._measureRaf) return;
|
|
120010
|
+
this._measureRaf = requestAnimationFrame(function () {
|
|
120011
|
+
_this5._measureRaf = 0;
|
|
120012
|
+
_this5.measureVisibleCount();
|
|
120013
|
+
});
|
|
120014
|
+
},
|
|
120015
|
+
/** 监听筛选行与按钮区尺寸:窗口缩放、分割条拖动都会改变可用宽度 */bindResize: function bindResize() {
|
|
120016
|
+
var _this6 = this;
|
|
120017
|
+
var row = this.$refs.filterRow;
|
|
120018
|
+
if (!row || typeof ResizeObserver === 'undefined') {
|
|
120019
|
+
this._onWindowResize = function () {
|
|
120020
|
+
return _this6.scheduleMeasure();
|
|
120021
|
+
};
|
|
120022
|
+
window.addEventListener('resize', this._onWindowResize);
|
|
120023
|
+
return;
|
|
120024
|
+
}
|
|
120025
|
+
this._resizeObserver = new ResizeObserver(function () {
|
|
120026
|
+
return _this6.scheduleMeasure();
|
|
120027
|
+
});
|
|
120028
|
+
this._resizeObserver.observe(row);
|
|
120029
|
+
if (this.$refs.filterActions) this._resizeObserver.observe(this.$refs.filterActions);
|
|
120030
|
+
},
|
|
120031
|
+
/** 将条件宽度解析为 px;百分比等非 px 写法返回 null */parseItemPx: function parseItemPx(width) {
|
|
120032
|
+
if (width == null || width === '') return null;
|
|
120033
|
+
if (typeof width === 'number' && !isNaN(width)) return width;
|
|
120034
|
+
if (typeof width === 'string') {
|
|
120035
|
+
var matched = /^(\d+(?:\.\d+)?)px$/.exec(width.trim());
|
|
120036
|
+
if (matched) return Number(matched[1]);
|
|
120037
|
+
}
|
|
120038
|
+
return null;
|
|
120039
|
+
},
|
|
120040
|
+
/** 读取默认插槽中的 standard-filterbar-item,每个节点计为一条筛选条件 */readSlotNodes: function readSlotNodes() {
|
|
120041
|
+
var _this7 = this;
|
|
120042
|
+
var scoped = this.$scopedSlots && this.$scopedSlots["default"];
|
|
120043
|
+
var raw = typeof scoped === 'function' ? scoped({}) : this.$slots && this.$slots["default"] || [];
|
|
120044
|
+
return raw.filter(function (node) {
|
|
120045
|
+
return _this7.isFilterbarItemNode(node);
|
|
120046
|
+
});
|
|
120047
|
+
},
|
|
120048
|
+
/** 是否为筛选栏插槽项(忽略插槽里的空白文本节点) */isFilterbarItemNode: function isFilterbarItemNode(vnode) {
|
|
120049
|
+
if (!vnode || !vnode.tag || !vnode.componentOptions) return false;
|
|
120050
|
+
var Ctor = vnode.componentOptions.Ctor;
|
|
120051
|
+
var name = Ctor && Ctor.options && Ctor.options.name || Ctor && Ctor.extendOptions && Ctor.extendOptions.name || '';
|
|
120052
|
+
if (name === 'StandardFilterbarItem') return true;
|
|
120053
|
+
return String(vnode.componentOptions.tag || '') === 'standard-filterbar-item';
|
|
120054
|
+
},
|
|
120055
|
+
/**
|
|
120056
|
+
* 同一次渲染只收集一次插槽节点。
|
|
120057
|
+
* 插槽项整体排在 searchCondition 之前,再按 visibleCount 切到首行或其余区域。
|
|
120058
|
+
*/
|
|
120059
|
+
ensureSlotBucket: function ensureSlotBucket() {
|
|
120060
|
+
if (this._slotBucket && this._slotBucket.stamp === this._slotStamp) return this._slotBucket;
|
|
120061
|
+
var nodes = this.readSlotNodes();
|
|
120062
|
+
var layoutWidth = this.sharedItemWidth;
|
|
120063
|
+
nodes.forEach(function (node, index) {
|
|
120064
|
+
var props = node.componentOptions && node.componentOptions.propsData || {};
|
|
120065
|
+
node.componentOptions.propsData = Object.assign({}, props, {
|
|
120066
|
+
layoutWidth: layoutWidth
|
|
120067
|
+
});
|
|
120068
|
+
if (!node.key) node.key = "standard-filterbar-item-".concat(index);
|
|
120069
|
+
});
|
|
120070
|
+
var primaryCount = Math.min(this.visibleCount, nodes.length);
|
|
120071
|
+
this._slotBucket = {
|
|
120072
|
+
stamp: this._slotStamp,
|
|
120073
|
+
nodes: nodes,
|
|
120074
|
+
primary: nodes.slice(0, primaryCount),
|
|
120075
|
+
overflow: nodes.slice(primaryCount)
|
|
120076
|
+
};
|
|
120077
|
+
return this._slotBucket;
|
|
120078
|
+
},
|
|
120079
|
+
primarySlotNodes: function primarySlotNodes() {
|
|
120080
|
+
return this.ensureSlotBucket().primary;
|
|
120081
|
+
},
|
|
120082
|
+
overflowSlotNodes: function overflowSlotNodes() {
|
|
120083
|
+
return this.ensureSlotBucket().overflow;
|
|
120084
|
+
},
|
|
120085
|
+
/** searchCondition 进入首行的起点:插槽项先占用 visibleCount */conditionSplitIndex: function conditionSplitIndex() {
|
|
120086
|
+
return Math.max(0, this.visibleCount - this.ensureSlotBucket().nodes.length);
|
|
120087
|
+
},
|
|
120088
|
+
primaryConditionList: function primaryConditionList() {
|
|
120089
|
+
return this.orderedConditions.slice(0, this.conditionSplitIndex());
|
|
120090
|
+
},
|
|
120091
|
+
overflowConditionList: function overflowConditionList() {
|
|
120092
|
+
return this.orderedConditions.slice(this.conditionSplitIndex());
|
|
120093
|
+
},
|
|
120094
|
+
hasOverflow: function hasOverflow() {
|
|
120095
|
+
return this.overflowSlotNodes().length > 0 || this.overflowConditionList().length > 0;
|
|
120096
|
+
},
|
|
120097
|
+
/** 未进首行的区域是否展开。高级查询时自定义项改放到弹窗,这里不展开 */secondaryOpen: function secondaryOpen() {
|
|
120098
|
+
if (!this.hasOverflow()) return false;
|
|
120099
|
+
if (this.showAdvancedQuery) return false;
|
|
120100
|
+
return this.showExpand ? this.expanded : true;
|
|
120101
|
+
},
|
|
120102
|
+
/** 未进首行且已填写的配置项数量(用于“更多 (n)”角标) */overflowActiveCount: function overflowActiveCount() {
|
|
120103
|
+
var _this8 = this;
|
|
120104
|
+
return this.overflowConditionList().filter(function (cond) {
|
|
120105
|
+
return _this8.hasValue(cond);
|
|
120106
|
+
}).length;
|
|
120107
|
+
},
|
|
120108
|
+
/**
|
|
120109
|
+
* 按当前行宽计算首行条数和弹性项宽度。
|
|
120110
|
+
* 先按“不显示更多/高级查询按钮”试装,装得下则全部留在首行;
|
|
120111
|
+
* 装不下再扣掉该按钮宽度重算,避免按钮显隐来回跳动。
|
|
120112
|
+
*/
|
|
120113
|
+
measureVisibleCount: function measureVisibleCount() {
|
|
120114
|
+
var _this9 = this;
|
|
120115
|
+
var row = this.$refs.filterRow;
|
|
120116
|
+
var actions = this.$refs.filterActions;
|
|
120117
|
+
if (!row || !actions) return;
|
|
120118
|
+
var rowWidth = row.clientWidth;
|
|
120119
|
+
if (rowWidth < 50) return;
|
|
120120
|
+
var ordered = this.orderedConditions;
|
|
120121
|
+
var slotNodes = this.readSlotNodes();
|
|
120122
|
+
var total = slotNodes.length + ordered.length;
|
|
120123
|
+
this._measuredSlotCount = slotNodes.length;
|
|
120124
|
+
if (!total) {
|
|
120125
|
+
if (this.visibleCount !== 0) this.visibleCount = 0;
|
|
120126
|
+
return;
|
|
120127
|
+
}
|
|
120128
|
+
var rowGap = this.readFlexGap(row);
|
|
120129
|
+
var actionsGap = this.readFlexGap(actions);
|
|
120130
|
+
var minItem = 175;
|
|
120131
|
+
var maxItem = 300;
|
|
120132
|
+
var moreEl = this.getOverflowButtonEl();
|
|
120133
|
+
var moreWidth = this._moreButtonWidth || (this.showAdvancedQuery ? 108 : 80);
|
|
120134
|
+
if (moreEl && moreEl.offsetWidth) {
|
|
120135
|
+
moreWidth = moreEl.offsetWidth;
|
|
120136
|
+
this._moreButtonWidth = moreWidth;
|
|
120137
|
+
}
|
|
120138
|
+
var moreVisible = !!(moreEl && moreEl.offsetWidth);
|
|
120139
|
+
var baseActions = actions.offsetWidth;
|
|
120140
|
+
if (moreVisible) baseActions -= moreWidth + actionsGap;
|
|
120141
|
+
if (baseActions < 0) baseActions = 0;
|
|
120142
|
+
var widthOf = function widthOf(item) {
|
|
120143
|
+
var parsed = _this9.parseItemPx(item && item.width);
|
|
120144
|
+
return parsed == null ? minItem : parsed;
|
|
120145
|
+
};
|
|
120146
|
+
var descriptors = slotNodes.map(function (node) {
|
|
120147
|
+
return node.componentOptions && node.componentOptions.propsData || {};
|
|
120148
|
+
}).concat(ordered);
|
|
120149
|
+
var minWidths = descriptors.map(widthOf);
|
|
120150
|
+
var fit = function fit(actionsW) {
|
|
120151
|
+
var used = 0;
|
|
120152
|
+
var count = 0;
|
|
120153
|
+
for (var i = 0; i < minWidths.length; i++) {
|
|
120154
|
+
var itemsWidth = used + minWidths[i];
|
|
120155
|
+
var _gaps = (i + 1) * rowGap;
|
|
120156
|
+
if (itemsWidth + _gaps + actionsW <= rowWidth - 1) {
|
|
120157
|
+
used = itemsWidth;
|
|
120158
|
+
count = i + 1;
|
|
120159
|
+
} else {
|
|
120160
|
+
break;
|
|
120161
|
+
}
|
|
120162
|
+
}
|
|
120163
|
+
if (!count) count = 1;
|
|
120164
|
+
return count;
|
|
120165
|
+
};
|
|
120166
|
+
var hideOverflow = this.showAdvancedQuery || this.showExpand;
|
|
120167
|
+
var count = fit(baseActions);
|
|
120168
|
+
if (hideOverflow && count < total) {
|
|
120169
|
+
count = fit(baseActions + moreWidth + actionsGap);
|
|
120170
|
+
}
|
|
120171
|
+
var limit = this.firstRowLimit;
|
|
120172
|
+
if (limit != null) count = Math.min(count, limit);
|
|
120173
|
+
count = Math.max(0, Math.min(count, total));
|
|
120174
|
+
var fixed = 0;
|
|
120175
|
+
var flexCount = 0;
|
|
120176
|
+
for (var i = 0; i < count; i++) {
|
|
120177
|
+
var parsed = this.parseItemPx(descriptors[i].width);
|
|
120178
|
+
var hasCustom = descriptors[i].width !== undefined && descriptors[i].width !== null && descriptors[i].width !== '';
|
|
120179
|
+
if (hasCustom && parsed != null) fixed += parsed;else if (hasCustom) fixed += minItem;else flexCount += 1;
|
|
120180
|
+
}
|
|
120181
|
+
var actionsUsed = baseActions + (hideOverflow && count < total ? moreWidth + actionsGap : 0);
|
|
120182
|
+
var gaps = count > 0 ? count * rowGap : 0;
|
|
120183
|
+
var shared = this.sharedItemWidth;
|
|
120184
|
+
if (flexCount > 0) {
|
|
120185
|
+
shared = Math.floor((rowWidth - actionsUsed - gaps - fixed) / flexCount);
|
|
120186
|
+
if (shared < minItem) shared = minItem;
|
|
120187
|
+
if (shared > maxItem) shared = maxItem;
|
|
120188
|
+
}
|
|
120189
|
+
if (this.visibleCount !== count) this.visibleCount = count;
|
|
120190
|
+
if (Math.abs((this.sharedItemWidth || 0) - shared) > 1) this.sharedItemWidth = shared;
|
|
120191
|
+
},
|
|
120192
|
+
/** 读取 flex 间距(column-gap / gap) */readFlexGap: function readFlexGap(el) {
|
|
120193
|
+
var style = window.getComputedStyle(el);
|
|
120194
|
+
var raw = style.columnGap && style.columnGap !== 'normal' ? style.columnGap : style.gap;
|
|
120195
|
+
var value = parseFloat(raw);
|
|
120196
|
+
return isNaN(value) ? 6 : value;
|
|
120197
|
+
},
|
|
120198
|
+
/** “更多”或“高级查询”按钮的根节点,用于扣减其占位宽度 */getOverflowButtonEl: function getOverflowButtonEl() {
|
|
120199
|
+
var more = this.$refs.moreButton;
|
|
120200
|
+
if (more && more.$el) return more.$el;
|
|
120201
|
+
var advanced = this.$refs.advancedQuery;
|
|
120202
|
+
if (advanced && advanced.$el) return advanced.$el;
|
|
120203
|
+
return null;
|
|
120204
|
+
},
|
|
119776
120205
|
/**
|
|
119777
120206
|
* 渲染前整体校验。
|
|
119778
120207
|
* 以下情况组件渲染失败,并在控制台输出详细错误:
|
|
119779
|
-
* 1.
|
|
119780
|
-
* 2.
|
|
119781
|
-
* 3. searchCondition
|
|
119782
|
-
* 4. searchCondition 中的必填项(label/value/type)未填
|
|
120208
|
+
* 1. 未传入查询事件对应的方法(@search)
|
|
120209
|
+
* 2. searchCondition 中的 value 在 searchVariable 中不存在
|
|
120210
|
+
* 3. searchCondition 中的必填项(label/value/type)未填
|
|
119783
120211
|
*/
|
|
119784
120212
|
validate: function validate() {
|
|
119785
|
-
var
|
|
120213
|
+
var _this0 = this;
|
|
119786
120214
|
var errors = [];
|
|
119787
120215
|
var searchBar = this.searchBar;
|
|
119788
120216
|
if (!searchBar || _typeof(searchBar) !== 'object') {
|
|
@@ -119795,15 +120223,6 @@ var FilterSearchItem = {
|
|
|
119795
120223
|
} else if (!searchVariable || _typeof(searchVariable) !== 'object' || Array.isArray(searchVariable)) {
|
|
119796
120224
|
errors.push('searchVariable 必须为非空对象');
|
|
119797
120225
|
} else {
|
|
119798
|
-
// 规则 1:主要条件数量校验(上限取 searchBar.mainConditionCount,默认 4)
|
|
119799
|
-
var mainList = searchCondition.filter(function (c) {
|
|
119800
|
-
return c && (c.isMain === 'Y' || c.isMain === true);
|
|
119801
|
-
});
|
|
119802
|
-
if (mainList.length > this.mainConditionCount) {
|
|
119803
|
-
errors.push("\u4E3B\u8981\u7684\u7B5B\u9009\u6761\u4EF6\u4E0D\u80FD\u8D85\u8FC7 ".concat(this.mainConditionCount, " \u4E2A\uFF08\u5F53\u524D ").concat(mainList.length, " \u4E2A\uFF1A").concat(mainList.map(function (c) {
|
|
119804
|
-
return c.label;
|
|
119805
|
-
}).join('、'), "\uFF09"));
|
|
119806
|
-
}
|
|
119807
120226
|
var validTypes = ['text', 'date', 'datetime', 'select', 'select-multi'];
|
|
119808
120227
|
var seenValues = {};
|
|
119809
120228
|
// 规则 3/4:逐条校验条件配置
|
|
@@ -119834,7 +120253,7 @@ var FilterSearchItem = {
|
|
|
119834
120253
|
console.warn("[StandardFilterbar] \u7B2C ".concat(index + 1, " \u6761\u7B5B\u9009\u6761\u4EF6\u201C").concat(cond.label, "\u201D\u4E3A\u4E0B\u62C9\u7C7B\u578B\uFF0C\u4F46\u672A\u914D\u7F6E selectSource \u6216 remote\uFF0C\u4E0B\u62C9\u6570\u636E\u4E3A\u7A7A"));
|
|
119835
120254
|
}
|
|
119836
120255
|
// 非致命提醒 2:remote 传字符串但未在父组件中找到对应方法(仅警告)
|
|
119837
|
-
if (typeof cond.remote === 'string' && !
|
|
120256
|
+
if (typeof cond.remote === 'string' && !_this0.resolveRemoteFn(cond.remote)) {
|
|
119838
120257
|
console.warn("[StandardFilterbar] \u7B2C ".concat(index + 1, " \u6761\u7B5B\u9009\u6761\u4EF6\u201C").concat(cond.label, "\u201D\u7684 remote=\"").concat(cond.remote, "\" \u672A\u5728\u7236\u7EC4\u4EF6\u4E2D\u627E\u5230\u5BF9\u5E94\u65B9\u6CD5"));
|
|
119839
120258
|
}
|
|
119840
120259
|
// 非致命提醒 3:value 重复定义(仅警告)
|
|
@@ -119845,7 +120264,7 @@ var FilterSearchItem = {
|
|
|
119845
120264
|
});
|
|
119846
120265
|
}
|
|
119847
120266
|
}
|
|
119848
|
-
//
|
|
120267
|
+
// 查询事件校验
|
|
119849
120268
|
if (typeof this.$listeners.search !== 'function') {
|
|
119850
120269
|
errors.push('未传入查询事件对应的方法,请通过 @search 绑定查询方法');
|
|
119851
120270
|
}
|
|
@@ -119864,17 +120283,17 @@ var FilterSearchItem = {
|
|
|
119864
120283
|
this.$emit('search');
|
|
119865
120284
|
},
|
|
119866
120285
|
/** 重置:将所有筛选条件恢复为组件创建时刻的初始值 */onReset: function onReset() {
|
|
119867
|
-
var
|
|
120286
|
+
var _this1 = this;
|
|
119868
120287
|
var variable = this.searchBar && this.searchBar.searchVariable;
|
|
119869
120288
|
if (variable && this.initValues) {
|
|
119870
120289
|
Object.keys(this.initValues).forEach(function (key) {
|
|
119871
120290
|
// 使用 $set 保证新值具备响应式
|
|
119872
|
-
|
|
120291
|
+
_this1.$set(variable, key, _this1.deepCopy(_this1.initValues[key]));
|
|
119873
120292
|
});
|
|
119874
120293
|
// 多选下拉的值规范为数组,避免 Element UI 类型告警
|
|
119875
120294
|
this.conditions.forEach(function (cond) {
|
|
119876
120295
|
if (cond.type === 'select-multi' && !Array.isArray(variable[cond.value])) {
|
|
119877
|
-
|
|
120296
|
+
_this1.$set(variable, cond.value, []);
|
|
119878
120297
|
}
|
|
119879
120298
|
});
|
|
119880
120299
|
}
|
|
@@ -119914,19 +120333,19 @@ var FilterSearchItem = {
|
|
|
119914
120333
|
* 统一归一化为 [{ label, value }] 后缓存。
|
|
119915
120334
|
*/
|
|
119916
120335
|
loadRemoteOptions: function loadRemoteOptions(cond, keyword) {
|
|
119917
|
-
var
|
|
120336
|
+
var _this10 = this;
|
|
119918
120337
|
var fn = this.resolveRemoteFn(cond.remote);
|
|
119919
120338
|
if (!fn) return Promise.resolve([]);
|
|
119920
120339
|
this.$set(this.remoteLoading, cond.value, true);
|
|
119921
120340
|
return Promise.resolve(fn(keyword == null ? '' : keyword)).then(function (res) {
|
|
119922
|
-
var options =
|
|
119923
|
-
|
|
120341
|
+
var options = _this10.normalizeOptions(_this10.extractOptions(res), cond);
|
|
120342
|
+
_this10.$set(_this10.remoteOptions, cond.value, options);
|
|
119924
120343
|
return options;
|
|
119925
120344
|
})["catch"](function (err) {
|
|
119926
120345
|
console.error("[StandardFilterbar] \u7B5B\u9009\u6761\u4EF6\u201C".concat(cond.label, "\u201D\u8FDC\u7A0B\u6570\u636E\u52A0\u8F7D\u5931\u8D25"), err);
|
|
119927
120346
|
return [];
|
|
119928
120347
|
})["finally"](function () {
|
|
119929
|
-
|
|
120348
|
+
_this10.$set(_this10.remoteLoading, cond.value, false);
|
|
119930
120349
|
});
|
|
119931
120350
|
},
|
|
119932
120351
|
/** 从远程方法返回值中提取选项数组(兼容多种返回结构) */extractOptions: function extractOptions(res) {
|
|
@@ -119982,9 +120401,7 @@ var FilterSearchItem = {
|
|
|
119982
120401
|
return val !== undefined && val !== null && String(val) !== '';
|
|
119983
120402
|
},
|
|
119984
120403
|
/**
|
|
119985
|
-
*
|
|
119986
|
-
* 日期/时间选择框统一复用全局 normal-report.scss 中的 normal-report-filter-item-date 公共类,
|
|
119987
|
-
* 与项目内其它页面(如 inspectQuery)保持一致的 170px 宽度,组件内不再自定义宽度样式
|
|
120404
|
+
* 日期/时间条件附加公共类。宽度与其它条件相同,由首行测量结果在 175–300px 之间写入。
|
|
119988
120405
|
*/
|
|
119989
120406
|
itemClass: function itemClass(cond) {
|
|
119990
120407
|
if (cond.type === 'date' || cond.type === 'datetime') return 'normal-report-filter-item-date';
|
|
@@ -119997,24 +120414,30 @@ var FilterSearchItem = {
|
|
|
119997
120414
|
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
119998
120415
|
var timer = null;
|
|
119999
120416
|
return function () {
|
|
120000
|
-
var
|
|
120417
|
+
var _this11 = this;
|
|
120001
120418
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
120002
120419
|
args[_key] = arguments[_key];
|
|
120003
120420
|
}
|
|
120004
120421
|
if (timer) clearTimeout(timer);
|
|
120005
120422
|
timer = setTimeout(function () {
|
|
120006
120423
|
timer = null;
|
|
120007
|
-
fn.apply(
|
|
120424
|
+
fn.apply(_this11, args);
|
|
120008
120425
|
}, delay);
|
|
120009
120426
|
};
|
|
120010
120427
|
}
|
|
120011
120428
|
}
|
|
120012
|
-
}
|
|
120429
|
+
};
|
|
120430
|
+
StandardFilterbar.Item = Item;
|
|
120431
|
+
StandardFilterbar.install = function (Vue) {
|
|
120432
|
+
Vue.component(StandardFilterbar.name, StandardFilterbar);
|
|
120433
|
+
Vue.component(Item.name, Item);
|
|
120434
|
+
};
|
|
120435
|
+
/* harmony default export */ const StandardFilterbarvue_type_script_lang_js = (StandardFilterbar);
|
|
120013
120436
|
;// ./src/components/StandardFilterbar/index.vue?vue&type=script&lang=js
|
|
120014
120437
|
/* harmony default export */ const components_StandardFilterbarvue_type_script_lang_js = (StandardFilterbarvue_type_script_lang_js);
|
|
120015
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/index.vue?vue&type=style&index=0&id=
|
|
120016
|
-
var
|
|
120017
|
-
;// ./src/components/StandardFilterbar/index.vue?vue&type=style&index=0&id=
|
|
120438
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/index.vue?vue&type=style&index=0&id=042f1c58&prod&lang=scss
|
|
120439
|
+
var StandardFilterbarvue_type_style_index_0_id_042f1c58_prod_lang_scss = __webpack_require__(8859);
|
|
120440
|
+
;// ./src/components/StandardFilterbar/index.vue?vue&type=style&index=0&id=042f1c58&prod&lang=scss
|
|
120018
120441
|
|
|
120019
120442
|
;// ./src/components/StandardFilterbar/index.vue
|
|
120020
120443
|
|
|
@@ -120027,8 +120450,8 @@ var StandardFilterbarvue_type_style_index_0_id_a1e74ef8_prod_lang_scss = __webpa
|
|
|
120027
120450
|
|
|
120028
120451
|
var StandardFilterbar_component = normalizeComponent(
|
|
120029
120452
|
components_StandardFilterbarvue_type_script_lang_js,
|
|
120030
|
-
|
|
120031
|
-
|
|
120453
|
+
StandardFilterbarvue_type_template_id_042f1c58_render,
|
|
120454
|
+
StandardFilterbarvue_type_template_id_042f1c58_staticRenderFns,
|
|
120032
120455
|
false,
|
|
120033
120456
|
null,
|
|
120034
120457
|
null,
|
|
@@ -120036,7 +120459,7 @@ var StandardFilterbar_component = normalizeComponent(
|
|
|
120036
120459
|
|
|
120037
120460
|
)
|
|
120038
120461
|
|
|
120039
|
-
/* harmony default export */ const
|
|
120462
|
+
/* harmony default export */ const components_StandardFilterbar = (StandardFilterbar_component.exports);
|
|
120040
120463
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardForm/index.vue?vue&type=template&id=16c030ac
|
|
120041
120464
|
var StandardFormvue_type_template_id_16c030ac_render = function render() {
|
|
120042
120465
|
var _vm = this,
|
|
@@ -120202,7 +120625,7 @@ var Itemvue_type_template_id_ccd7639c_staticRenderFns = [];
|
|
|
120202
120625
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardForm/Item.vue?vue&type=script&lang=js
|
|
120203
120626
|
// 注意:standard-form-item 的全部样式已统一在 ./StandardForm.scss 中
|
|
120204
120627
|
// (与父组件 StandardForm 共用同一份样式文件,避免重复注入)
|
|
120205
|
-
/* harmony default export */ const
|
|
120628
|
+
/* harmony default export */ const StandardForm_Itemvue_type_script_lang_js = ({
|
|
120206
120629
|
name: "StandardFormItem",
|
|
120207
120630
|
props: {
|
|
120208
120631
|
// 标签文案(参与 label-width 自动计算)
|
|
@@ -120260,7 +120683,7 @@ var Itemvue_type_template_id_ccd7639c_staticRenderFns = [];
|
|
|
120260
120683
|
}
|
|
120261
120684
|
});
|
|
120262
120685
|
;// ./src/components/StandardForm/Item.vue?vue&type=script&lang=js
|
|
120263
|
-
/* harmony default export */ const
|
|
120686
|
+
/* harmony default export */ const components_StandardForm_Itemvue_type_script_lang_js = (StandardForm_Itemvue_type_script_lang_js);
|
|
120264
120687
|
;// ./src/components/StandardForm/Item.vue
|
|
120265
120688
|
|
|
120266
120689
|
|
|
@@ -120269,8 +120692,8 @@ var Itemvue_type_template_id_ccd7639c_staticRenderFns = [];
|
|
|
120269
120692
|
|
|
120270
120693
|
/* normalize component */
|
|
120271
120694
|
;
|
|
120272
|
-
var
|
|
120273
|
-
|
|
120695
|
+
var StandardForm_Item_component = normalizeComponent(
|
|
120696
|
+
components_StandardForm_Itemvue_type_script_lang_js,
|
|
120274
120697
|
Itemvue_type_template_id_ccd7639c_render,
|
|
120275
120698
|
Itemvue_type_template_id_ccd7639c_staticRenderFns,
|
|
120276
120699
|
false,
|
|
@@ -120280,7 +120703,7 @@ var Item_component = normalizeComponent(
|
|
|
120280
120703
|
|
|
120281
120704
|
)
|
|
120282
120705
|
|
|
120283
|
-
/* harmony default export */ const
|
|
120706
|
+
/* harmony default export */ const StandardForm_Item = (StandardForm_Item_component.exports);
|
|
120284
120707
|
;// ./src/components/StandardForm/index.js
|
|
120285
120708
|
/**
|
|
120286
120709
|
* StandardForm 通用表单组件入口
|
|
@@ -120303,12 +120726,12 @@ var Item_component = normalizeComponent(
|
|
|
120303
120726
|
|
|
120304
120727
|
|
|
120305
120728
|
// 将子组件挂载为静态属性,方便引用方统一引入注册
|
|
120306
|
-
StandardForm.Item =
|
|
120729
|
+
StandardForm.Item = StandardForm_Item;
|
|
120307
120730
|
|
|
120308
120731
|
// 支持 Vue.use 全局注册
|
|
120309
120732
|
StandardForm.install = function (Vue) {
|
|
120310
120733
|
Vue.component(StandardForm.name, StandardForm);
|
|
120311
|
-
Vue.component(
|
|
120734
|
+
Vue.component(StandardForm_Item.name, StandardForm_Item);
|
|
120312
120735
|
};
|
|
120313
120736
|
/* harmony default export */ const components_StandardForm = (StandardForm);
|
|
120314
120737
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardHalfArea/index.vue?vue&type=template&id=7888c782&scoped=true
|
|
@@ -121109,8 +121532,8 @@ var StandardTimePick_component = normalizeComponent(
|
|
|
121109
121532
|
)
|
|
121110
121533
|
|
|
121111
121534
|
/* harmony default export */ const StandardTimePick = (StandardTimePick_component.exports);
|
|
121112
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/index.vue?vue&type=template&id=
|
|
121113
|
-
var
|
|
121535
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/index.vue?vue&type=template&id=b1d59d54
|
|
121536
|
+
var StandardTablevue_type_template_id_b1d59d54_render = function render() {
|
|
121114
121537
|
var _vm = this,
|
|
121115
121538
|
_c = _vm._self._c;
|
|
121116
121539
|
return _c('section', {
|
|
@@ -121360,6 +121783,7 @@ var StandardTablevue_type_template_id_a9e9136a_render = function render() {
|
|
|
121360
121783
|
},
|
|
121361
121784
|
on: {
|
|
121362
121785
|
"menu-click": _vm.onMenuClick,
|
|
121786
|
+
"resizable-change": _vm.onColumnResizableChange,
|
|
121363
121787
|
"checkbox-change": _vm.handleCheckboxChange,
|
|
121364
121788
|
"checkbox-all": _vm.handleCheckboxChange,
|
|
121365
121789
|
"current-change": _vm.handleCurrentRowChange,
|
|
@@ -121389,7 +121813,7 @@ var StandardTablevue_type_template_id_a9e9136a_render = function render() {
|
|
|
121389
121813
|
"type": col.type,
|
|
121390
121814
|
"field": col.field,
|
|
121391
121815
|
"title": col.title,
|
|
121392
|
-
"width": col.isOp ? col.width : undefined,
|
|
121816
|
+
"width": col.isOp ? col.width : col.userWidth || undefined,
|
|
121393
121817
|
"min-width": col.minWidth,
|
|
121394
121818
|
"fixed": col.fixed,
|
|
121395
121819
|
"align": col.align,
|
|
@@ -121444,7 +121868,7 @@ var StandardTablevue_type_template_id_a9e9136a_render = function render() {
|
|
|
121444
121868
|
}
|
|
121445
121869
|
}) : _vm.getFooterEmptyVisible() ? _c('standard-footer-empty') : _vm._e()], 1);
|
|
121446
121870
|
};
|
|
121447
|
-
var
|
|
121871
|
+
var StandardTablevue_type_template_id_b1d59d54_staticRenderFns = [];
|
|
121448
121872
|
|
|
121449
121873
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/ToolbarEmpty.vue?vue&type=script&lang=js
|
|
121450
121874
|
/**
|
|
@@ -121531,6 +121955,313 @@ var FooterEmpty_component = normalizeComponent(
|
|
|
121531
121955
|
)
|
|
121532
121956
|
|
|
121533
121957
|
/* harmony default export */ const FooterEmpty = (FooterEmpty_component.exports);
|
|
121958
|
+
;// ./src/components/StandardTable/columnConfigApi.js
|
|
121959
|
+
/**
|
|
121960
|
+
* 表头配置接口。路径固定,请求方法由业务项目注入。
|
|
121961
|
+
* IP 和端口来自该请求方法自己的 baseURL,组件库不保存主机地址。
|
|
121962
|
+
*/
|
|
121963
|
+
var GET_CONFIG = '/api/Migration/UserTableColumn/GetConfig';
|
|
121964
|
+
var SAVE_CONFIG = '/api/Migration/UserTableColumn/SaveConfig';
|
|
121965
|
+
var RESET_CONFIG = '/api/Migration/UserTableColumn/ResetConfig';
|
|
121966
|
+
var columnConfigApi = null;
|
|
121967
|
+
var columnModuleCode = '';
|
|
121968
|
+
|
|
121969
|
+
// 同一模块、同一页面内 table-code 的占用者,用于发现重复编码
|
|
121970
|
+
var tableCodeOwners = Object.create(null);
|
|
121971
|
+
function setColumnConfigRequest(request) {
|
|
121972
|
+
if (typeof request !== 'function') {
|
|
121973
|
+
columnConfigApi = null;
|
|
121974
|
+
return;
|
|
121975
|
+
}
|
|
121976
|
+
columnConfigApi = {
|
|
121977
|
+
get: function get(moduleCode, pageCode, tableCode) {
|
|
121978
|
+
return request({
|
|
121979
|
+
url: GET_CONFIG,
|
|
121980
|
+
method: 'get',
|
|
121981
|
+
params: {
|
|
121982
|
+
moduleCode: moduleCode,
|
|
121983
|
+
pageCode: pageCode,
|
|
121984
|
+
tableCode: tableCode
|
|
121985
|
+
}
|
|
121986
|
+
});
|
|
121987
|
+
},
|
|
121988
|
+
save: function save(moduleCode, pageCode, tableCode, columns) {
|
|
121989
|
+
return request({
|
|
121990
|
+
url: SAVE_CONFIG,
|
|
121991
|
+
method: 'post',
|
|
121992
|
+
data: {
|
|
121993
|
+
ModuleCode: moduleCode,
|
|
121994
|
+
PageCode: pageCode,
|
|
121995
|
+
TableCode: tableCode,
|
|
121996
|
+
SchemaVersion: 1,
|
|
121997
|
+
Columns: columns
|
|
121998
|
+
}
|
|
121999
|
+
});
|
|
122000
|
+
},
|
|
122001
|
+
reset: function reset(moduleCode, pageCode, tableCode) {
|
|
122002
|
+
return request({
|
|
122003
|
+
url: RESET_CONFIG,
|
|
122004
|
+
method: 'post',
|
|
122005
|
+
data: {
|
|
122006
|
+
ModuleCode: moduleCode,
|
|
122007
|
+
PageCode: pageCode,
|
|
122008
|
+
TableCode: tableCode
|
|
122009
|
+
}
|
|
122010
|
+
});
|
|
122011
|
+
}
|
|
122012
|
+
};
|
|
122013
|
+
}
|
|
122014
|
+
function getColumnConfigApi() {
|
|
122015
|
+
return columnConfigApi;
|
|
122016
|
+
}
|
|
122017
|
+
function setColumnModuleCode(code) {
|
|
122018
|
+
columnModuleCode = code != null ? String(code).trim() : '';
|
|
122019
|
+
}
|
|
122020
|
+
function getColumnModuleCode() {
|
|
122021
|
+
return columnModuleCode;
|
|
122022
|
+
}
|
|
122023
|
+
function tableCodeKey(moduleCode, pageCode, tableCode) {
|
|
122024
|
+
return moduleCode + '\n' + pageCode + '\n' + tableCode;
|
|
122025
|
+
}
|
|
122026
|
+
|
|
122027
|
+
// 登记表格编码。同一模块的同一页面已被其它表格占用时返回 false
|
|
122028
|
+
function claimTableCode(moduleCode, pageCode, tableCode, owner) {
|
|
122029
|
+
var key = tableCodeKey(moduleCode, pageCode, tableCode);
|
|
122030
|
+
var current = tableCodeOwners[key];
|
|
122031
|
+
if (current && current !== owner) return false;
|
|
122032
|
+
tableCodeOwners[key] = owner;
|
|
122033
|
+
return true;
|
|
122034
|
+
}
|
|
122035
|
+
function releaseTableCode(moduleCode, pageCode, tableCode, owner) {
|
|
122036
|
+
var key = tableCodeKey(moduleCode, pageCode, tableCode);
|
|
122037
|
+
if (tableCodeOwners[key] === owner) delete tableCodeOwners[key];
|
|
122038
|
+
}
|
|
122039
|
+
;// ./src/components/StandardTable/columnPersist.js
|
|
122040
|
+
function columnPersist_typeof(o) { "@babel/helpers - typeof"; return columnPersist_typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, columnPersist_typeof(o); }
|
|
122041
|
+
/**
|
|
122042
|
+
* 表头配置的列主键、合并和提交数据。
|
|
122043
|
+
* 持久化主键不能使用 Vue 的 _uid,每次进入页面都会变化。
|
|
122044
|
+
*/
|
|
122045
|
+
|
|
122046
|
+
// 列稳定主键:显式 column-key > field:字段名 > type:类型
|
|
122047
|
+
function resolveColumnKey(comp) {
|
|
122048
|
+
if (!comp) return '';
|
|
122049
|
+
var custom = comp.columnKey != null ? String(comp.columnKey).trim() : '';
|
|
122050
|
+
if (custom) return custom;
|
|
122051
|
+
if (comp.field) return 'field:' + comp.field;
|
|
122052
|
+
if (comp.type) return 'type:' + comp.type;
|
|
122053
|
+
return '';
|
|
122054
|
+
}
|
|
122055
|
+
|
|
122056
|
+
// 同一张表里主键重复时返回该主键,否则返回空串
|
|
122057
|
+
function findDuplicateColumnKey(comps) {
|
|
122058
|
+
var seen = Object.create(null);
|
|
122059
|
+
var list = Array.isArray(comps) ? comps : [];
|
|
122060
|
+
for (var i = 0; i < list.length; i++) {
|
|
122061
|
+
var key = resolveColumnKey(list[i]);
|
|
122062
|
+
if (!key) continue;
|
|
122063
|
+
if (seen[key]) return key;
|
|
122064
|
+
seen[key] = true;
|
|
122065
|
+
}
|
|
122066
|
+
return '';
|
|
122067
|
+
}
|
|
122068
|
+
|
|
122069
|
+
// 接口字段与 C# 属性名一致。已保存的小写字段仍可读。
|
|
122070
|
+
function readSavedColumn(item) {
|
|
122071
|
+
if (!item || columnPersist_typeof(item) !== 'object') return null;
|
|
122072
|
+
var columnKey = item.ColumnKey != null ? item.ColumnKey : item.columnKey;
|
|
122073
|
+
if (columnKey == null || String(columnKey).trim() === '') return null;
|
|
122074
|
+
return {
|
|
122075
|
+
columnKey: String(columnKey).trim(),
|
|
122076
|
+
sortNo: item.SortNo != null ? item.SortNo : item.sortNo,
|
|
122077
|
+
visible: item.Visible != null ? item.Visible : item.visible,
|
|
122078
|
+
fixed: item.Fixed != null ? item.Fixed : item.fixed,
|
|
122079
|
+
minWidth: item.MinWidth !== undefined ? item.MinWidth : item.minWidth,
|
|
122080
|
+
width: item.Width !== undefined ? item.Width : item.width,
|
|
122081
|
+
sortable: item.Sortable !== undefined ? item.Sortable : item.sortable
|
|
122082
|
+
};
|
|
122083
|
+
}
|
|
122084
|
+
function savedFixed(value) {
|
|
122085
|
+
return value === 'left' || value === 'right' ? value : '';
|
|
122086
|
+
}
|
|
122087
|
+
function savedMinWidth(value) {
|
|
122088
|
+
var width = Number(value);
|
|
122089
|
+
if (value == null || value === '' || !(width >= 1) || width > 500) return null;
|
|
122090
|
+
return Math.round(width);
|
|
122091
|
+
}
|
|
122092
|
+
function savedWidth(value) {
|
|
122093
|
+
var width = Number(value);
|
|
122094
|
+
if (value == null || value === '' || !(width >= 60) || width > 2000) return null;
|
|
122095
|
+
return Math.round(width);
|
|
122096
|
+
}
|
|
122097
|
+
|
|
122098
|
+
/**
|
|
122099
|
+
* 用当前代码列做主数据,把已保存列覆盖上去。
|
|
122100
|
+
* 新增列贴在代码声明顺序里、它前面最近一个仍存在的已保存列之后。
|
|
122101
|
+
* 返回 { order, states }。states 只包含命中的已保存列,新增列沿用注册时的默认状态。
|
|
122102
|
+
*/
|
|
122103
|
+
function mergeColumnConfig(comps, savedColumns) {
|
|
122104
|
+
var list = Array.isArray(comps) ? comps.filter(Boolean) : [];
|
|
122105
|
+
var keyed = [];
|
|
122106
|
+
var unkeyed = [];
|
|
122107
|
+
list.forEach(function (comp) {
|
|
122108
|
+
var key = resolveColumnKey(comp);
|
|
122109
|
+
if (!key) unkeyed.push(comp);else keyed.push({
|
|
122110
|
+
comp: comp,
|
|
122111
|
+
key: key,
|
|
122112
|
+
uid: comp._uid
|
|
122113
|
+
});
|
|
122114
|
+
});
|
|
122115
|
+
var saved = (Array.isArray(savedColumns) ? savedColumns : []).map(readSavedColumn).filter(Boolean);
|
|
122116
|
+
if (!saved.length) return null;
|
|
122117
|
+
var codeMap = Object.create(null);
|
|
122118
|
+
keyed.forEach(function (item) {
|
|
122119
|
+
codeMap[item.key] = item;
|
|
122120
|
+
});
|
|
122121
|
+
var baseline = saved.filter(function (item) {
|
|
122122
|
+
return codeMap[item.columnKey];
|
|
122123
|
+
}).slice().sort(function (a, b) {
|
|
122124
|
+
return (Number(a.sortNo) || 0) - (Number(b.sortNo) || 0);
|
|
122125
|
+
}).map(function (item) {
|
|
122126
|
+
return {
|
|
122127
|
+
entry: codeMap[item.columnKey],
|
|
122128
|
+
saved: item
|
|
122129
|
+
};
|
|
122130
|
+
});
|
|
122131
|
+
var seen = Object.create(null);
|
|
122132
|
+
var rows = [];
|
|
122133
|
+
baseline.forEach(function (row) {
|
|
122134
|
+
if (seen[row.entry.key]) return;
|
|
122135
|
+
seen[row.entry.key] = true;
|
|
122136
|
+
rows.push(row);
|
|
122137
|
+
});
|
|
122138
|
+
keyed.forEach(function (codeCol, codeIndex) {
|
|
122139
|
+
if (seen[codeCol.key]) return;
|
|
122140
|
+
var insertAt = rows.length;
|
|
122141
|
+
var found = false;
|
|
122142
|
+
var _loop = function _loop(i) {
|
|
122143
|
+
var pos = rows.findIndex(function (row) {
|
|
122144
|
+
return row.entry.key === keyed[i].key;
|
|
122145
|
+
});
|
|
122146
|
+
if (pos >= 0) {
|
|
122147
|
+
insertAt = pos + 1;
|
|
122148
|
+
found = true;
|
|
122149
|
+
return 1; // break
|
|
122150
|
+
}
|
|
122151
|
+
};
|
|
122152
|
+
for (var i = codeIndex - 1; i >= 0; i--) {
|
|
122153
|
+
if (_loop(i)) break;
|
|
122154
|
+
}
|
|
122155
|
+
if (!found) {
|
|
122156
|
+
var _loop2 = function _loop2(_i) {
|
|
122157
|
+
var pos = rows.findIndex(function (row) {
|
|
122158
|
+
return row.entry.key === keyed[_i].key;
|
|
122159
|
+
});
|
|
122160
|
+
if (pos >= 0) {
|
|
122161
|
+
insertAt = pos;
|
|
122162
|
+
return 1; // break
|
|
122163
|
+
}
|
|
122164
|
+
};
|
|
122165
|
+
for (var _i = codeIndex + 1; _i < keyed.length; _i++) {
|
|
122166
|
+
if (_loop2(_i)) break;
|
|
122167
|
+
}
|
|
122168
|
+
}
|
|
122169
|
+
rows.splice(insertAt, 0, {
|
|
122170
|
+
entry: codeCol,
|
|
122171
|
+
saved: null
|
|
122172
|
+
});
|
|
122173
|
+
seen[codeCol.key] = true;
|
|
122174
|
+
});
|
|
122175
|
+
var order = rows.map(function (row) {
|
|
122176
|
+
return row.entry.uid;
|
|
122177
|
+
});
|
|
122178
|
+
unkeyed.forEach(function (comp) {
|
|
122179
|
+
return order.push(comp._uid);
|
|
122180
|
+
});
|
|
122181
|
+
var states = [];
|
|
122182
|
+
rows.forEach(function (row) {
|
|
122183
|
+
if (!row.saved) return;
|
|
122184
|
+
var comp = row.entry.comp;
|
|
122185
|
+
states.push({
|
|
122186
|
+
uid: row.entry.uid,
|
|
122187
|
+
state: {
|
|
122188
|
+
visible: row.saved.visible !== false,
|
|
122189
|
+
fixed: savedFixed(row.saved.fixed),
|
|
122190
|
+
minWidth: savedMinWidth(row.saved.minWidth),
|
|
122191
|
+
width: savedWidth(row.saved.width),
|
|
122192
|
+
sortable: row.saved.sortable != null ? !!row.saved.sortable : !!comp.sortable
|
|
122193
|
+
}
|
|
122194
|
+
});
|
|
122195
|
+
});
|
|
122196
|
+
return {
|
|
122197
|
+
order: order,
|
|
122198
|
+
states: states
|
|
122199
|
+
};
|
|
122200
|
+
}
|
|
122201
|
+
|
|
122202
|
+
// 提交给保存接口的列数组。顺序按当前 columnOrder,sortNo 从 0 连续编号
|
|
122203
|
+
function buildColumnPayload(comps, order, states) {
|
|
122204
|
+
var map = Object.create(null);
|
|
122205
|
+
(Array.isArray(comps) ? comps : []).forEach(function (comp) {
|
|
122206
|
+
if (comp) map[comp._uid] = comp;
|
|
122207
|
+
});
|
|
122208
|
+
var columns = [];
|
|
122209
|
+
(Array.isArray(order) ? order : []).forEach(function (uid) {
|
|
122210
|
+
var comp = map[uid];
|
|
122211
|
+
if (!comp) return;
|
|
122212
|
+
var key = resolveColumnKey(comp);
|
|
122213
|
+
if (!key) return;
|
|
122214
|
+
var st = states && states[uid] ? states[uid] : {};
|
|
122215
|
+
columns.push({
|
|
122216
|
+
ColumnKey: key,
|
|
122217
|
+
SortNo: columns.length,
|
|
122218
|
+
Visible: st.visible !== false,
|
|
122219
|
+
Fixed: savedFixed(st.fixed),
|
|
122220
|
+
MinWidth: savedMinWidth(st.minWidth),
|
|
122221
|
+
Width: savedWidth(st.width),
|
|
122222
|
+
Sortable: !!st.sortable
|
|
122223
|
+
});
|
|
122224
|
+
});
|
|
122225
|
+
return columns;
|
|
122226
|
+
}
|
|
122227
|
+
|
|
122228
|
+
// 与代码声明完全一致时走删除接口,避免把当时的默认值冻住
|
|
122229
|
+
function isDefaultColumnPayload(comps, columns) {
|
|
122230
|
+
var keyed = (Array.isArray(comps) ? comps : []).filter(function (comp) {
|
|
122231
|
+
return resolveColumnKey(comp);
|
|
122232
|
+
});
|
|
122233
|
+
if (!Array.isArray(columns) || keyed.length !== columns.length) return false;
|
|
122234
|
+
for (var i = 0; i < keyed.length; i++) {
|
|
122235
|
+
var comp = keyed[i];
|
|
122236
|
+
var col = columns[i];
|
|
122237
|
+
if (!col || col.ColumnKey !== resolveColumnKey(comp)) return false;
|
|
122238
|
+
if (col.Visible !== true) return false;
|
|
122239
|
+
if ((col.Fixed || '') !== (comp.fixed || '')) return false;
|
|
122240
|
+
if (!!col.Sortable !== !!comp.sortable) return false;
|
|
122241
|
+
if (col.Width != null) return false;
|
|
122242
|
+
if (col.MinWidth != null && Number(col.MinWidth) !== Number(comp.resolvedMinWidth)) return false;
|
|
122243
|
+
}
|
|
122244
|
+
return true;
|
|
122245
|
+
}
|
|
122246
|
+
|
|
122247
|
+
// 从 Datas 取出列数组。字段名优先用属性名 Columns,兼容 columns。
|
|
122248
|
+
function readSavedColumns(datas) {
|
|
122249
|
+
if (!datas || columnPersist_typeof(datas) !== 'object') return null;
|
|
122250
|
+
var columns = datas.Columns != null ? datas.Columns : datas.columns;
|
|
122251
|
+
if (!Array.isArray(columns)) return null;
|
|
122252
|
+
return columns.map(readSavedColumn).filter(Boolean);
|
|
122253
|
+
}
|
|
122254
|
+
|
|
122255
|
+
// 业务项目 axios 拦截器返回 { code, data: { Success, Content, Datas } }
|
|
122256
|
+
function readColumnConfigDatas(res) {
|
|
122257
|
+
if (res && res.code == 200 && res.data) {
|
|
122258
|
+
if (!res.data.Success) throw new Error(res.data.Content || '表头配置请求失败');
|
|
122259
|
+
return res.data.Datas == null ? null : res.data.Datas;
|
|
122260
|
+
}
|
|
122261
|
+
if (res && res.Success) return res.Datas == null ? null : res.Datas;
|
|
122262
|
+
var content = res && res.data && res.data.Content;
|
|
122263
|
+
throw new Error(content || '表头配置请求失败');
|
|
122264
|
+
}
|
|
121534
122265
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/index.vue?vue&type=script&lang=js
|
|
121535
122266
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || StandardTablevue_type_script_lang_js_unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
121536
122267
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
@@ -121545,6 +122276,8 @@ function StandardTablevue_type_script_lang_js_arrayLikeToArray(r, a) { (null ==
|
|
|
121545
122276
|
;
|
|
121546
122277
|
|
|
121547
122278
|
|
|
122279
|
+
|
|
122280
|
+
|
|
121548
122281
|
// 将单元格渲染结果归一化为 VNode:
|
|
121549
122282
|
// Vue 2 函数式组件只接受 VNode / VNode 数组作为渲染结果,
|
|
121550
122283
|
// 纯字符串、数字等原始值会被直接丢弃(表现为空白单元格),
|
|
@@ -121721,10 +122454,10 @@ var NormalReportSlotView = {
|
|
|
121721
122454
|
type: Boolean,
|
|
121722
122455
|
"default": false
|
|
121723
122456
|
},
|
|
121724
|
-
//
|
|
122457
|
+
// 是否显示表格右上角“调整”按钮(列设置弹层),默认显示;传 false 隐藏
|
|
121725
122458
|
showAdjustment: {
|
|
121726
122459
|
type: Boolean,
|
|
121727
|
-
"default":
|
|
122460
|
+
"default": true
|
|
121728
122461
|
},
|
|
121729
122462
|
// 是否显示表格左下方“数据更新时间”
|
|
121730
122463
|
showUpdateTime: {
|
|
@@ -121761,6 +122494,17 @@ var NormalReportSlotView = {
|
|
|
121761
122494
|
showFooter: {
|
|
121762
122495
|
type: Boolean,
|
|
121763
122496
|
"default": false
|
|
122497
|
+
},
|
|
122498
|
+
// 表格编码。按「当前登录用户 + 模块 + 页面 + 表格」读写表头配置,同一页面内必须唯一。
|
|
122499
|
+
// 未传时使用组件 ref;ref 也没有时不访问服务端
|
|
122500
|
+
tableCode: {
|
|
122501
|
+
type: String,
|
|
122502
|
+
"default": ''
|
|
122503
|
+
},
|
|
122504
|
+
// 页面编码。不传时使用当前路由 name;没有 name 时使用不含查询参数的 path
|
|
122505
|
+
pageCode: {
|
|
122506
|
+
type: String,
|
|
122507
|
+
"default": ''
|
|
121764
122508
|
}
|
|
121765
122509
|
},
|
|
121766
122510
|
data: function data() {
|
|
@@ -121832,7 +122576,14 @@ var NormalReportSlotView = {
|
|
|
121832
122576
|
// 尺寸变化防抖定时器
|
|
121833
122577
|
// 首屏先让 standard-column 在 created 中注册完,再渲染 vxe-column。
|
|
121834
122578
|
// 否则第一次往往只有操作列,vxe-table 会固化它的插槽,随后数据列插入后操作列变空白
|
|
121835
|
-
columnsReady: false
|
|
122579
|
+
columnsReady: false,
|
|
122580
|
+
// 表头配置已完成首次加载后才允许写回,避免加载过程中的默认状态覆盖服务端
|
|
122581
|
+
columnConfigReady: false,
|
|
122582
|
+
columnConfigDisabled: false,
|
|
122583
|
+
columnConfigDirty: false,
|
|
122584
|
+
columnConfigSettled: false,
|
|
122585
|
+
columnConfigTimer: null,
|
|
122586
|
+
columnConfigSaveTimer: null
|
|
121836
122587
|
};
|
|
121837
122588
|
},
|
|
121838
122589
|
computed: {
|
|
@@ -121840,13 +122591,9 @@ var NormalReportSlotView = {
|
|
|
121840
122591
|
hasFooterLeftSlot: function hasFooterLeftSlot() {
|
|
121841
122592
|
return !!(this.$slots['footer-left'] || this.$scopedSlots['footer-left']);
|
|
121842
122593
|
},
|
|
121843
|
-
//
|
|
121844
|
-
// 或 toolbar-right 子组件 show-adjustment 属性(任一为 true 即显示)
|
|
122594
|
+
// 是否显示“调整”列设置按钮,由主组件 show-adjustment 决定;false 时隐藏
|
|
121845
122595
|
resolvedShowAdjustment: function resolvedShowAdjustment() {
|
|
121846
|
-
|
|
121847
|
-
return this.toolbarRightInstances.some(function (inst) {
|
|
121848
|
-
return !!inst.showAdjustment;
|
|
121849
|
-
});
|
|
122596
|
+
return this.showAdjustment;
|
|
121850
122597
|
},
|
|
121851
122598
|
// 操作列按钮列表(tableOperation 属性)
|
|
121852
122599
|
opButtons: function opButtons() {
|
|
@@ -121990,6 +122737,8 @@ var NormalReportSlotView = {
|
|
|
121990
122737
|
title: comp.title,
|
|
121991
122738
|
// 列宽:仅取列组件声明宽度(列设置弹层调整的是列最小宽度)
|
|
121992
122739
|
width: comp.width,
|
|
122740
|
+
// 用户拖拽表头得到的实际列宽。未拖过时不传给 vxe,仍由 min-width 分配
|
|
122741
|
+
userWidth: st && st.width != null ? st.width : null,
|
|
121993
122742
|
// 列最小宽度(对应 vxe-table min-width):优先取列设置弹层设置的值(px),
|
|
121994
122743
|
// 未设置时取列组件 resolvedMinWidth(显式传入值或按标题自动计算)
|
|
121995
122744
|
minWidth: st && st.minWidth != null ? st.minWidth : comp.resolvedMinWidth,
|
|
@@ -122037,6 +122786,7 @@ var NormalReportSlotView = {
|
|
|
122037
122786
|
field: c.field || undefined,
|
|
122038
122787
|
title: c.title,
|
|
122039
122788
|
width: c.width || undefined,
|
|
122789
|
+
userWidth: c.userWidth || undefined,
|
|
122040
122790
|
minWidth: c.minWidth,
|
|
122041
122791
|
treeNode: !!c.treeNode,
|
|
122042
122792
|
fixed: c.fixed || undefined,
|
|
@@ -122111,24 +122861,23 @@ var NormalReportSlotView = {
|
|
|
122111
122861
|
}
|
|
122112
122862
|
},
|
|
122113
122863
|
mounted: function mounted() {
|
|
122114
|
-
var _this4 = this;
|
|
122115
122864
|
this.initResizeObserver();
|
|
122116
122865
|
// 表头拖拽排序结束后抑制一次 click(document 捕获阶段拦截,防止拖拽结束触发排序切换)
|
|
122117
122866
|
document.addEventListener('click', this.onDocumentClickCapture, true);
|
|
122118
|
-
//
|
|
122119
|
-
this.
|
|
122120
|
-
// 列挂载后再重算。height="100%" 要等浏览器完成 flex 布局才有父容器高度,
|
|
122121
|
-
// 只在 nextTick 里算会把表体高度当成内容高度,滚动条不再出现
|
|
122122
|
-
this.$nextTick(function () {
|
|
122123
|
-
_this4.resizeRecalculate();
|
|
122124
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
122125
|
-
requestAnimationFrame(function () {
|
|
122126
|
-
return _this4.resizeRecalculate();
|
|
122127
|
-
});
|
|
122128
|
-
}
|
|
122129
|
-
});
|
|
122867
|
+
// 列已在子组件 created 中注册完成。能确定表格编码时先合并历史配置,再放行表头
|
|
122868
|
+
this.bootstrapColumnConfig();
|
|
122130
122869
|
},
|
|
122131
122870
|
beforeDestroy: function beforeDestroy() {
|
|
122871
|
+
this.columnConfigSettled = true;
|
|
122872
|
+
if (this.columnConfigTimer) {
|
|
122873
|
+
clearTimeout(this.columnConfigTimer);
|
|
122874
|
+
this.columnConfigTimer = null;
|
|
122875
|
+
}
|
|
122876
|
+
if (this.columnConfigSaveTimer) {
|
|
122877
|
+
clearTimeout(this.columnConfigSaveTimer);
|
|
122878
|
+
this.columnConfigSaveTimer = null;
|
|
122879
|
+
}
|
|
122880
|
+
this.releaseColumnConfigClaim();
|
|
122132
122881
|
this.destroyResizeObserver();
|
|
122133
122882
|
document.removeEventListener('click', this.onDocumentClickCapture, true);
|
|
122134
122883
|
this.clearHeaderDragBindings();
|
|
@@ -122151,51 +122900,51 @@ var NormalReportSlotView = {
|
|
|
122151
122900
|
},
|
|
122152
122901
|
// 工具栏左侧子组件 vnode(渲染到操作区左侧)
|
|
122153
122902
|
getToolbarLeftVNodes: function getToolbarLeftVNodes() {
|
|
122154
|
-
var
|
|
122903
|
+
var _this4 = this;
|
|
122155
122904
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122156
|
-
return
|
|
122905
|
+
return _this4.isVNodeOfType(v, TOOLBAR_LEFT_TYPES);
|
|
122157
122906
|
});
|
|
122158
122907
|
},
|
|
122159
122908
|
// 工具栏右侧子组件 vnode(渲染到操作区右侧)
|
|
122160
122909
|
getToolbarRightVNodes: function getToolbarRightVNodes() {
|
|
122161
|
-
var
|
|
122910
|
+
var _this5 = this;
|
|
122162
122911
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122163
|
-
return
|
|
122912
|
+
return _this5.isVNodeOfType(v, TOOLBAR_RIGHT_TYPES);
|
|
122164
122913
|
});
|
|
122165
122914
|
},
|
|
122166
122915
|
// 底部栏左侧子组件 vnode(渲染到底部栏左侧)
|
|
122167
122916
|
getFooterLeftVNodes: function getFooterLeftVNodes() {
|
|
122168
|
-
var
|
|
122917
|
+
var _this6 = this;
|
|
122169
122918
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122170
|
-
return
|
|
122919
|
+
return _this6.isVNodeOfType(v, FOOTER_LEFT_TYPES);
|
|
122171
122920
|
});
|
|
122172
122921
|
},
|
|
122173
122922
|
// 底部栏右侧分页子组件 vnode(渲染到底部栏右侧)
|
|
122174
122923
|
getFooterRightVNodes: function getFooterRightVNodes() {
|
|
122175
|
-
var
|
|
122924
|
+
var _this7 = this;
|
|
122176
122925
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122177
|
-
return
|
|
122926
|
+
return _this7.isVNodeOfType(v, FOOTER_RIGHT_TYPES);
|
|
122178
122927
|
});
|
|
122179
122928
|
},
|
|
122180
122929
|
// 底部空占位子组件 vnode(页面声明时渲染,未声明时使用内置默认占位)
|
|
122181
122930
|
getFooterEmptyVNodes: function getFooterEmptyVNodes() {
|
|
122182
|
-
var
|
|
122931
|
+
var _this8 = this;
|
|
122183
122932
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122184
|
-
return
|
|
122933
|
+
return _this8.isVNodeOfType(v, FOOTER_EMPTY_TYPES);
|
|
122185
122934
|
});
|
|
122186
122935
|
},
|
|
122187
122936
|
// 工具栏空占位子组件 vnode(页面声明时渲染,未声明时使用内置默认占位)
|
|
122188
122937
|
getToolbarEmptyVNodes: function getToolbarEmptyVNodes() {
|
|
122189
|
-
var
|
|
122938
|
+
var _this9 = this;
|
|
122190
122939
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122191
|
-
return
|
|
122940
|
+
return _this9.isVNodeOfType(v, TOOLBAR_EMPTY_TYPES);
|
|
122192
122941
|
});
|
|
122193
122942
|
},
|
|
122194
122943
|
// 隐藏注册区 vnode:默认插槽中除区域子组件(工具栏/底部栏功能区 + 空占位)之外的内容
|
|
122195
122944
|
getHiddenSlotVNodes: function getHiddenSlotVNodes() {
|
|
122196
|
-
var
|
|
122945
|
+
var _this0 = this;
|
|
122197
122946
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122198
|
-
return !
|
|
122947
|
+
return !_this0.isVNodeOfType(v, TOOLBAR_LEFT_TYPES) && !_this0.isVNodeOfType(v, TOOLBAR_RIGHT_TYPES) && !_this0.isVNodeOfType(v, FOOTER_LEFT_TYPES) && !_this0.isVNodeOfType(v, FOOTER_RIGHT_TYPES) && !_this0.isVNodeOfType(v, FOOTER_EMPTY_TYPES) && !_this0.isVNodeOfType(v, TOOLBAR_EMPTY_TYPES);
|
|
122199
122948
|
});
|
|
122200
122949
|
},
|
|
122201
122950
|
// 操作区是否显示
|
|
@@ -122249,6 +122998,7 @@ var NormalReportSlotView = {
|
|
|
122249
122998
|
visible: true,
|
|
122250
122999
|
fixed: comp.fixed || '',
|
|
122251
123000
|
minWidth: null,
|
|
123001
|
+
width: null,
|
|
122252
123002
|
sortable: !!comp.sortable
|
|
122253
123003
|
});
|
|
122254
123004
|
if (this.columnOrder.indexOf(comp._uid) === -1) {
|
|
@@ -122317,7 +123067,7 @@ var NormalReportSlotView = {
|
|
|
122317
123067
|
// 渲染单个操作按钮:active 为 false 时不再隐藏(原按 v-if 消失),
|
|
122318
123068
|
// 改为渲染 disabled 按钮(变灰不可操作)
|
|
122319
123069
|
renderOpButton: function renderOpButton(h, row, btn, idx) {
|
|
122320
|
-
var
|
|
123070
|
+
var _this1 = this;
|
|
122321
123071
|
var active = this.isOpActive(btn, row);
|
|
122322
123072
|
var data = {
|
|
122323
123073
|
key: idx,
|
|
@@ -122328,7 +123078,7 @@ var NormalReportSlotView = {
|
|
|
122328
123078
|
},
|
|
122329
123079
|
on: {
|
|
122330
123080
|
click: function click() {
|
|
122331
|
-
return
|
|
123081
|
+
return _this1.handleOpClick(row, btn);
|
|
122332
123082
|
}
|
|
122333
123083
|
},
|
|
122334
123084
|
// 阻止点击事件冒泡到表格单元格:
|
|
@@ -122350,7 +123100,7 @@ var NormalReportSlotView = {
|
|
|
122350
123100
|
// 超出按钮渲染为 el-dropdown-item,点击后走与直接按钮一致的 handleOpClick;
|
|
122351
123101
|
// active 为 false 的按钮以 disabled 形式变灰展示
|
|
122352
123102
|
renderOpMore: function renderOpMore(h, row, restButtons) {
|
|
122353
|
-
var
|
|
123103
|
+
var _this10 = this;
|
|
122354
123104
|
return h('el-dropdown', {
|
|
122355
123105
|
key: '__normal_report_op_more__',
|
|
122356
123106
|
"class": 'normal-report-op-more',
|
|
@@ -122360,7 +123110,7 @@ var NormalReportSlotView = {
|
|
|
122360
123110
|
},
|
|
122361
123111
|
on: {
|
|
122362
123112
|
command: function command(btn) {
|
|
122363
|
-
return
|
|
123113
|
+
return _this10.handleOpClick(row, btn);
|
|
122364
123114
|
}
|
|
122365
123115
|
},
|
|
122366
123116
|
nativeOn: {
|
|
@@ -122378,7 +123128,7 @@ var NormalReportSlotView = {
|
|
|
122378
123128
|
})]), h('el-dropdown-menu', {
|
|
122379
123129
|
slot: 'dropdown'
|
|
122380
123130
|
}, restButtons.map(function (btn, idx) {
|
|
122381
|
-
var active =
|
|
123131
|
+
var active = _this10.isOpActive(btn, row);
|
|
122382
123132
|
return h('el-dropdown-item', {
|
|
122383
123133
|
key: idx,
|
|
122384
123134
|
props: {
|
|
@@ -122394,17 +123144,17 @@ var NormalReportSlotView = {
|
|
|
122394
123144
|
// 渲染操作列:按钮 ≤ 3 个时全部直接渲染;超过 3 个时前 3 个直接渲染,
|
|
122395
123145
|
// 其余统一收纳进“更多”下拉菜单;active 为 false 的按钮渲染为 disabled(变灰)
|
|
122396
123146
|
renderOpCell: function renderOpCell(row, h) {
|
|
122397
|
-
var
|
|
123147
|
+
var _this11 = this;
|
|
122398
123148
|
var createElement = h || this.$createElement;
|
|
122399
123149
|
var btns = this.opButtons;
|
|
122400
123150
|
if (!btns.length) return null;
|
|
122401
123151
|
if (btns.length <= OP_MAX_DIRECT_COUNT) {
|
|
122402
123152
|
return btns.map(function (btn, idx) {
|
|
122403
|
-
return
|
|
123153
|
+
return _this11.renderOpButton(createElement, row, btn, idx);
|
|
122404
123154
|
});
|
|
122405
123155
|
}
|
|
122406
123156
|
var nodes = btns.slice(0, OP_MAX_DIRECT_COUNT).map(function (btn, idx) {
|
|
122407
|
-
return
|
|
123157
|
+
return _this11.renderOpButton(createElement, row, btn, idx);
|
|
122408
123158
|
});
|
|
122409
123159
|
nodes.push(this.renderOpMore(createElement, row, btns.slice(OP_MAX_DIRECT_COUNT)));
|
|
122410
123160
|
return nodes;
|
|
@@ -122487,12 +123237,12 @@ var NormalReportSlotView = {
|
|
|
122487
123237
|
},
|
|
122488
123238
|
// 复制文本到剪贴板:优先使用现代 API,失败时降级 execCommand
|
|
122489
123239
|
copyTextToClipboard: function copyTextToClipboard(text) {
|
|
122490
|
-
var
|
|
123240
|
+
var _this12 = this;
|
|
122491
123241
|
if (navigator.clipboard && window.isSecureContext) {
|
|
122492
123242
|
navigator.clipboard.writeText(text).then(function () {
|
|
122493
|
-
|
|
123243
|
+
_this12.$message && _this12.$message.success('复制成功:' + text);
|
|
122494
123244
|
})["catch"](function () {
|
|
122495
|
-
|
|
123245
|
+
_this12.fallbackCopyText(text);
|
|
122496
123246
|
});
|
|
122497
123247
|
} else {
|
|
122498
123248
|
this.fallbackCopyText(text);
|
|
@@ -122578,23 +123328,25 @@ var NormalReportSlotView = {
|
|
|
122578
123328
|
// 切换列的排序开关:sortable 已纳入列 key,修改后强制重建列,
|
|
122579
123329
|
// 再由 applyColumnOrder 恢复列顺序(重建会打乱 staticColumns 顺序)
|
|
122580
123330
|
toggleHeaderColumnSort: function toggleHeaderColumnSort(uid) {
|
|
122581
|
-
var
|
|
123331
|
+
var _this13 = this;
|
|
122582
123332
|
var st = this.columnStates[uid];
|
|
122583
123333
|
if (!st) return;
|
|
122584
123334
|
this.$set(st, 'sortable', !st.sortable);
|
|
123335
|
+
this.schedulePersistColumnConfig();
|
|
122585
123336
|
this.$nextTick(function () {
|
|
122586
|
-
return
|
|
123337
|
+
return _this13.applyColumnOrder();
|
|
122587
123338
|
});
|
|
122588
123339
|
},
|
|
122589
123340
|
// 切换列的固定状态(左/右固定互斥,再次点击同侧即取消):
|
|
122590
123341
|
// fixed 同样纳入列 key,重建后 vxe-table 重新解析固定列分组
|
|
122591
123342
|
toggleHeaderColumnFixed: function toggleHeaderColumnFixed(uid, side) {
|
|
122592
|
-
var
|
|
123343
|
+
var _this14 = this;
|
|
122593
123344
|
var st = this.columnStates[uid];
|
|
122594
123345
|
if (!st) return;
|
|
122595
123346
|
this.$set(st, 'fixed', st.fixed === side ? '' : side);
|
|
123347
|
+
this.schedulePersistColumnConfig();
|
|
122596
123348
|
this.$nextTick(function () {
|
|
122597
|
-
return
|
|
123349
|
+
return _this14.applyColumnOrder();
|
|
122598
123350
|
});
|
|
122599
123351
|
},
|
|
122600
123352
|
// ===== 单元格编辑 =====
|
|
@@ -122710,7 +123462,7 @@ var NormalReportSlotView = {
|
|
|
122710
123462
|
},
|
|
122711
123463
|
// 交换列顺序(columnOrder 重排后强制同步 vxe-table 内部列配置)
|
|
122712
123464
|
moveColumnOrder: function moveColumnOrder(fromUid, toUid) {
|
|
122713
|
-
var
|
|
123465
|
+
var _this15 = this;
|
|
122714
123466
|
var from = this.columnOrder.indexOf(fromUid);
|
|
122715
123467
|
var to = this.columnOrder.indexOf(toUid);
|
|
122716
123468
|
if (from < 0 || to < 0 || from === to) return;
|
|
@@ -122718,8 +123470,9 @@ var NormalReportSlotView = {
|
|
|
122718
123470
|
var moved = order.splice(from, 1)[0];
|
|
122719
123471
|
order.splice(to, 0, moved);
|
|
122720
123472
|
this.columnOrder = order;
|
|
123473
|
+
this.schedulePersistColumnConfig();
|
|
122721
123474
|
this.$nextTick(function () {
|
|
122722
|
-
return
|
|
123475
|
+
return _this15.applyColumnOrder();
|
|
122723
123476
|
});
|
|
122724
123477
|
},
|
|
122725
123478
|
// ===== 对外方法(父组件通过 ref 调用) =====
|
|
@@ -122757,14 +123510,14 @@ var NormalReportSlotView = {
|
|
|
122757
123510
|
// 表现为固定列行与数据行错位。此处监听表格容器尺寸变化,防抖后
|
|
122758
123511
|
// 重新计算布局并调用 refreshScroll() 强制同步各滚动层位置。
|
|
122759
123512
|
initResizeObserver: function initResizeObserver() {
|
|
122760
|
-
var
|
|
123513
|
+
var _this16 = this;
|
|
122761
123514
|
var wrapEl = this.$refs.tableWrap;
|
|
122762
123515
|
if (!wrapEl) return;
|
|
122763
123516
|
if (typeof ResizeObserver !== 'undefined') {
|
|
122764
123517
|
// 首次通知也要重算。挂载时容器往往已有高度,但还不是 flex 约束后的高度,
|
|
122765
123518
|
// 跳过这次就会把“内容撑开的高度”当成可视高度,滚动条不再出现
|
|
122766
123519
|
this.resizeObserver = new ResizeObserver(function () {
|
|
122767
|
-
|
|
123520
|
+
_this16.scheduleTableRecalculate();
|
|
122768
123521
|
});
|
|
122769
123522
|
this.resizeObserver.observe(wrapEl);
|
|
122770
123523
|
} else {
|
|
@@ -122774,23 +123527,23 @@ var NormalReportSlotView = {
|
|
|
122774
123527
|
},
|
|
122775
123528
|
// 防抖:连续尺寸变化(如拖拽分割线)停稳后再重算,读到的是最终宽高
|
|
122776
123529
|
scheduleTableRecalculate: function scheduleTableRecalculate() {
|
|
122777
|
-
var
|
|
123530
|
+
var _this17 = this;
|
|
122778
123531
|
if (this.resizeTimer) clearTimeout(this.resizeTimer);
|
|
122779
123532
|
this.resizeTimer = setTimeout(function () {
|
|
122780
|
-
|
|
122781
|
-
|
|
123533
|
+
_this17.resizeTimer = null;
|
|
123534
|
+
_this17.resizeRecalculate();
|
|
122782
123535
|
}, 50);
|
|
122783
123536
|
},
|
|
122784
123537
|
// 重新计算布局,并在重算完成后强制同步固定列与主表体的滚动位置。
|
|
122785
123538
|
// 容器还没有宽度时 vxe 会直接跳过滚动计算,等下一次尺寸通知再算
|
|
122786
123539
|
resizeRecalculate: function resizeRecalculate() {
|
|
122787
|
-
var
|
|
123540
|
+
var _this18 = this;
|
|
122788
123541
|
var xTable = this.$refs.xTable;
|
|
122789
123542
|
var wrapEl = this.$refs.tableWrap;
|
|
122790
123543
|
if (!xTable) return;
|
|
122791
123544
|
if (wrapEl && wrapEl.clientWidth === 0) return;
|
|
122792
123545
|
var restore = function restore() {
|
|
122793
|
-
|
|
123546
|
+
_this18.$nextTick(function () {
|
|
122794
123547
|
if (xTable.refreshScroll) xTable.refreshScroll();
|
|
122795
123548
|
});
|
|
122796
123549
|
};
|
|
@@ -122857,7 +123610,7 @@ var NormalReportSlotView = {
|
|
|
122857
123610
|
// ===== 列设置弹层 =====
|
|
122858
123611
|
// 打开列设置:以当前注册列生成工作副本(每次打开都重新初始化)
|
|
122859
123612
|
openColumnSetting: function openColumnSetting() {
|
|
122860
|
-
var
|
|
123613
|
+
var _this19 = this;
|
|
122861
123614
|
var compMap = {};
|
|
122862
123615
|
this.columnComps.forEach(function (comp) {
|
|
122863
123616
|
compMap[comp._uid] = comp;
|
|
@@ -122885,7 +123638,7 @@ var NormalReportSlotView = {
|
|
|
122885
123638
|
// 列标题宽度:按最长列名称计算(中文 25px/字 + 英文 15px/字 + 30px 余量),
|
|
122886
123639
|
// 各列标题统一按该宽度显示,保证输入框与按钮对齐
|
|
122887
123640
|
this.columnTitleWidth = this.columnDraft.reduce(function (max, c) {
|
|
122888
|
-
return Math.max(max,
|
|
123641
|
+
return Math.max(max, _this19.calcColumnTitleWidth(c.title));
|
|
122889
123642
|
}, 0);
|
|
122890
123643
|
},
|
|
122891
123644
|
// 计算单个列标题的显示宽度(px):中文 25px/字 + 英文 15px/字 + 30px 余量
|
|
@@ -122977,21 +123730,199 @@ var NormalReportSlotView = {
|
|
|
122977
123730
|
},
|
|
122978
123731
|
// 确认:将面板副本应用到列状态并刷新表格
|
|
122979
123732
|
confirmColumnSetting: function confirmColumnSetting() {
|
|
122980
|
-
var
|
|
123733
|
+
var _this20 = this;
|
|
122981
123734
|
var order = [];
|
|
122982
123735
|
this.columnDraft.forEach(function (d) {
|
|
122983
|
-
|
|
123736
|
+
var prev = _this20.columnStates[d.uid] || {};
|
|
123737
|
+
_this20.$set(_this20.columnStates, d.uid, {
|
|
122984
123738
|
visible: d.visible,
|
|
122985
123739
|
fixed: d.fixed || '',
|
|
122986
123740
|
minWidth: d.minWidth != null ? d.minWidth : null,
|
|
123741
|
+
width: prev.width != null ? prev.width : null,
|
|
122987
123742
|
sortable: !!d.sortable
|
|
122988
123743
|
});
|
|
122989
123744
|
order.push(d.uid);
|
|
122990
123745
|
});
|
|
122991
123746
|
this.columnOrder = order;
|
|
122992
123747
|
this.columnSettingVisible = false;
|
|
123748
|
+
this.persistColumnConfigNow();
|
|
123749
|
+
this.$nextTick(function () {
|
|
123750
|
+
_this20.applyColumnOrder();
|
|
123751
|
+
});
|
|
123752
|
+
},
|
|
123753
|
+
// ===== 表头配置持久化 =====
|
|
123754
|
+
// 表格编码:显式 table-code 优先,否则取组件 ref。两者都没有时不读写表头配置
|
|
123755
|
+
resolveTableCode: function resolveTableCode() {
|
|
123756
|
+
var explicit = this.tableCode != null ? String(this.tableCode).trim() : '';
|
|
123757
|
+
if (explicit) return explicit;
|
|
123758
|
+
var data = this.$vnode && this.$vnode.data;
|
|
123759
|
+
var ref = data && data.ref;
|
|
123760
|
+
if (typeof ref !== 'string') return '';
|
|
123761
|
+
return ref.trim();
|
|
123762
|
+
},
|
|
123763
|
+
// 页面编码:显式 page-code 优先,否则取路由 name,再退回不含查询参数的 path
|
|
123764
|
+
resolvePageCode: function resolvePageCode() {
|
|
123765
|
+
var explicit = this.pageCode != null ? String(this.pageCode).trim() : '';
|
|
123766
|
+
if (explicit) return explicit;
|
|
123767
|
+
var route = this.$route;
|
|
123768
|
+
if (route && route.name) return String(route.name);
|
|
123769
|
+
if (route && route.path) return String(route.path).split('?')[0];
|
|
123770
|
+
return '';
|
|
123771
|
+
},
|
|
123772
|
+
releaseColumnConfigClaim: function releaseColumnConfigClaim() {
|
|
123773
|
+
var claim = this._columnConfigClaim;
|
|
123774
|
+
if (!claim) return;
|
|
123775
|
+
releaseTableCode(claim.moduleCode, claim.pageCode, claim.tableCode, this);
|
|
123776
|
+
this._columnConfigClaim = null;
|
|
123777
|
+
},
|
|
123778
|
+
// 列挂载后再重算。height="100%" 要等浏览器完成 flex 布局才有父容器高度
|
|
123779
|
+
scheduleInitialLayout: function scheduleInitialLayout() {
|
|
123780
|
+
var _this21 = this;
|
|
122993
123781
|
this.$nextTick(function () {
|
|
122994
|
-
_this21.
|
|
123782
|
+
_this21.resizeRecalculate();
|
|
123783
|
+
if (typeof requestAnimationFrame === 'function') {
|
|
123784
|
+
requestAnimationFrame(function () {
|
|
123785
|
+
return _this21.resizeRecalculate();
|
|
123786
|
+
});
|
|
123787
|
+
}
|
|
123788
|
+
});
|
|
123789
|
+
},
|
|
123790
|
+
// 首次加载只结算一次。用户在返回前已调整时,保留本地结果并在允许写入后保存
|
|
123791
|
+
finishColumnConfigLoad: function finishColumnConfigLoad(apply) {
|
|
123792
|
+
if (this.columnConfigSettled) return;
|
|
123793
|
+
this.columnConfigSettled = true;
|
|
123794
|
+
if (this.columnConfigTimer) {
|
|
123795
|
+
clearTimeout(this.columnConfigTimer);
|
|
123796
|
+
this.columnConfigTimer = null;
|
|
123797
|
+
}
|
|
123798
|
+
if (!this.columnConfigDirty && typeof apply === 'function') apply();
|
|
123799
|
+
var tableCode = this.resolveTableCode();
|
|
123800
|
+
this.columnConfigReady = !!getColumnModuleCode() && !!tableCode && !this.columnConfigDisabled;
|
|
123801
|
+
this.columnsReady = true;
|
|
123802
|
+
this.scheduleInitialLayout();
|
|
123803
|
+
if (this.columnConfigDirty) this.persistColumnConfig();
|
|
123804
|
+
},
|
|
123805
|
+
bootstrapColumnConfig: function bootstrapColumnConfig() {
|
|
123806
|
+
var _this22 = this;
|
|
123807
|
+
var tableCode = this.resolveTableCode();
|
|
123808
|
+
if (!tableCode) {
|
|
123809
|
+
this.finishColumnConfigLoad();
|
|
123810
|
+
return;
|
|
123811
|
+
}
|
|
123812
|
+
var pageCode = this.resolvePageCode();
|
|
123813
|
+
if (!pageCode) {
|
|
123814
|
+
console.warn('[StandardTable] 无法确定 page-code,表头配置不会加载');
|
|
123815
|
+
this.columnConfigDisabled = true;
|
|
123816
|
+
this.finishColumnConfigLoad();
|
|
123817
|
+
return;
|
|
123818
|
+
}
|
|
123819
|
+
var moduleCode = getColumnModuleCode();
|
|
123820
|
+
if (!moduleCode) {
|
|
123821
|
+
console.warn('[StandardTable] 未注册 moduleCode,表头配置不会加载');
|
|
123822
|
+
this.columnConfigDisabled = true;
|
|
123823
|
+
this.finishColumnConfigLoad();
|
|
123824
|
+
return;
|
|
123825
|
+
}
|
|
123826
|
+
if (!claimTableCode(moduleCode, pageCode, tableCode, this)) {
|
|
123827
|
+
console.warn('[StandardTable] 同一页面存在重复的 table-code:' + tableCode);
|
|
123828
|
+
this.columnConfigDisabled = true;
|
|
123829
|
+
this.finishColumnConfigLoad();
|
|
123830
|
+
return;
|
|
123831
|
+
}
|
|
123832
|
+
this._columnConfigClaim = {
|
|
123833
|
+
moduleCode: moduleCode,
|
|
123834
|
+
pageCode: pageCode,
|
|
123835
|
+
tableCode: tableCode
|
|
123836
|
+
};
|
|
123837
|
+
var duplicated = findDuplicateColumnKey(this.columnComps);
|
|
123838
|
+
if (duplicated) {
|
|
123839
|
+
console.warn('[StandardTable] 列标识重复,已跳过表头配置:' + duplicated);
|
|
123840
|
+
this.columnConfigDisabled = true;
|
|
123841
|
+
this.finishColumnConfigLoad();
|
|
123842
|
+
return;
|
|
123843
|
+
}
|
|
123844
|
+
var api = getColumnConfigApi();
|
|
123845
|
+
if (!api || typeof api.get !== 'function') {
|
|
123846
|
+
console.warn('[StandardTable] 未注入 request,表头配置不会加载');
|
|
123847
|
+
this.columnConfigDisabled = true;
|
|
123848
|
+
this.finishColumnConfigLoad();
|
|
123849
|
+
return;
|
|
123850
|
+
}
|
|
123851
|
+
this.columnConfigTimer = setTimeout(function () {
|
|
123852
|
+
if (_this22.columnConfigSettled) return;
|
|
123853
|
+
if (_this22.$message) _this22.$message.warning('表头配置加载超时,已使用默认列');
|
|
123854
|
+
_this22.finishColumnConfigLoad();
|
|
123855
|
+
}, 3000);
|
|
123856
|
+
Promise.resolve(api.get(moduleCode, pageCode, tableCode)).then(function (res) {
|
|
123857
|
+
var datas = readColumnConfigDatas(res);
|
|
123858
|
+
var columns = readSavedColumns(datas);
|
|
123859
|
+
_this22.finishColumnConfigLoad(function () {
|
|
123860
|
+
if (columns && columns.length) _this22.applyMergedColumnConfig(columns);
|
|
123861
|
+
});
|
|
123862
|
+
})["catch"](function (err) {
|
|
123863
|
+
if (_this22.columnConfigSettled) return;
|
|
123864
|
+
if (_this22.$message) _this22.$message.warning(err && err.message || '表头配置加载失败,已使用默认列');
|
|
123865
|
+
_this22.finishColumnConfigLoad();
|
|
123866
|
+
});
|
|
123867
|
+
},
|
|
123868
|
+
applyMergedColumnConfig: function applyMergedColumnConfig(savedColumns) {
|
|
123869
|
+
var _this23 = this;
|
|
123870
|
+
var merged = mergeColumnConfig(this.columnComps, savedColumns);
|
|
123871
|
+
if (!merged) return;
|
|
123872
|
+
merged.states.forEach(function (item) {
|
|
123873
|
+
_this23.$set(_this23.columnStates, item.uid, item.state);
|
|
123874
|
+
});
|
|
123875
|
+
this.columnOrder = merged.order;
|
|
123876
|
+
},
|
|
123877
|
+
// 拖拽表头列宽:写入实际宽度,最小宽度仍由列设置弹层维护
|
|
123878
|
+
onColumnResizableChange: function onColumnResizableChange(params) {
|
|
123879
|
+
if (!params) return;
|
|
123880
|
+
var uid = this.resolveColumnUid(params.column);
|
|
123881
|
+
if (uid == null) return;
|
|
123882
|
+
var st = this.columnStates[uid];
|
|
123883
|
+
if (!st) return;
|
|
123884
|
+
var width = Math.round(Number(params.resizeWidth));
|
|
123885
|
+
if (!(width >= 60)) return;
|
|
123886
|
+
this.$set(st, 'width', Math.min(width, 2000));
|
|
123887
|
+
this.schedulePersistColumnConfig();
|
|
123888
|
+
},
|
|
123889
|
+
schedulePersistColumnConfig: function schedulePersistColumnConfig() {
|
|
123890
|
+
var _this24 = this;
|
|
123891
|
+
this.columnConfigDirty = true;
|
|
123892
|
+
if (!this.columnConfigReady) return;
|
|
123893
|
+
if (this.columnConfigSaveTimer) clearTimeout(this.columnConfigSaveTimer);
|
|
123894
|
+
this.columnConfigSaveTimer = setTimeout(function () {
|
|
123895
|
+
_this24.columnConfigSaveTimer = null;
|
|
123896
|
+
_this24.persistColumnConfig();
|
|
123897
|
+
}, 500);
|
|
123898
|
+
},
|
|
123899
|
+
persistColumnConfigNow: function persistColumnConfigNow() {
|
|
123900
|
+
this.columnConfigDirty = true;
|
|
123901
|
+
if (this.columnConfigSaveTimer) {
|
|
123902
|
+
clearTimeout(this.columnConfigSaveTimer);
|
|
123903
|
+
this.columnConfigSaveTimer = null;
|
|
123904
|
+
}
|
|
123905
|
+
this.persistColumnConfig();
|
|
123906
|
+
},
|
|
123907
|
+
persistColumnConfig: function persistColumnConfig() {
|
|
123908
|
+
var _this25 = this;
|
|
123909
|
+
if (!this.columnConfigReady || this.columnConfigDisabled) return;
|
|
123910
|
+
var api = getColumnConfigApi();
|
|
123911
|
+
if (!api) return;
|
|
123912
|
+
var moduleCode = getColumnModuleCode();
|
|
123913
|
+
var pageCode = this.resolvePageCode();
|
|
123914
|
+
var tableCode = this.resolveTableCode();
|
|
123915
|
+
if (!moduleCode || !pageCode || !tableCode) return;
|
|
123916
|
+
var columns = buildColumnPayload(this.columnComps, this.columnOrder, this.columnStates);
|
|
123917
|
+
var useReset = isDefaultColumnPayload(this.columnComps, columns);
|
|
123918
|
+
var request = useReset ? typeof api.reset === 'function' ? api.reset(moduleCode, pageCode, tableCode) : null : typeof api.save === 'function' ? api.save(moduleCode, pageCode, tableCode, columns) : null;
|
|
123919
|
+
if (!request) return;
|
|
123920
|
+
Promise.resolve(request).then(function (res) {
|
|
123921
|
+
readColumnConfigDatas(res);
|
|
123922
|
+
var content = res && res.data && res.data.Content || res && res.Content || '表头配置保存成功';
|
|
123923
|
+
if (_this25.$message) _this25.$message.success(content);
|
|
123924
|
+
})["catch"](function (err) {
|
|
123925
|
+
if (_this25.$message) _this25.$message.error(err && err.message || '表头配置保存失败');
|
|
122995
123926
|
});
|
|
122996
123927
|
}
|
|
122997
123928
|
}
|
|
@@ -123013,8 +123944,8 @@ var StandardTablevue_type_style_index_0_prod_lang_scss_external = __webpack_requ
|
|
|
123013
123944
|
|
|
123014
123945
|
var StandardTable_component = normalizeComponent(
|
|
123015
123946
|
components_StandardTablevue_type_script_lang_js,
|
|
123016
|
-
|
|
123017
|
-
|
|
123947
|
+
StandardTablevue_type_template_id_b1d59d54_render,
|
|
123948
|
+
StandardTablevue_type_template_id_b1d59d54_staticRenderFns,
|
|
123018
123949
|
false,
|
|
123019
123950
|
null,
|
|
123020
123951
|
null,
|
|
@@ -123055,6 +123986,12 @@ var StandardTable_component = normalizeComponent(
|
|
|
123055
123986
|
type: String,
|
|
123056
123987
|
"default": ''
|
|
123057
123988
|
},
|
|
123989
|
+
// 表头配置使用的稳定主键。不传时按 field:字段名 或 type:类型 生成。
|
|
123990
|
+
// 字段以后可能改名、或同一字段出现两列时必须显式指定,且一经使用不再修改
|
|
123991
|
+
columnKey: {
|
|
123992
|
+
type: String,
|
|
123993
|
+
"default": ''
|
|
123994
|
+
},
|
|
123058
123995
|
// vxe-table 内置列类型(如 seq 序号列),普通数据列不传
|
|
123059
123996
|
type: {
|
|
123060
123997
|
type: String,
|
|
@@ -123310,16 +124247,15 @@ var ToolbarLeft_component = normalizeComponent(
|
|
|
123310
124247
|
* 工具栏右侧子组件(双标签组件):
|
|
123311
124248
|
*
|
|
123312
124249
|
* <standard-toolbar-right show-adjustment>
|
|
123313
|
-
* <standard-toolbar-query query-method="onQuery" export-method="onExport" />
|
|
124250
|
+
* <standard-toolbar-query query-method="onQuery" show-export export-method="onExport" />
|
|
123314
124251
|
* </standard-toolbar-right>
|
|
123315
124252
|
*
|
|
123316
124253
|
* 说明:
|
|
123317
124254
|
* 1. 必须放在 <standard-table> 默认插槽内,标签内部内容(按钮、standard-toolbar-query 等)
|
|
123318
124255
|
* 由主组件就地渲染到表格操作区右侧(“调整”列设置按钮之前);
|
|
123319
124256
|
* standard-toolbar-query 只能放在本组件内部;
|
|
123320
|
-
* 2.
|
|
123321
|
-
*
|
|
123322
|
-
* 主组件自身的 showAdjustment 属性继续有效(任一为 true 即显示“调整”按钮);
|
|
124257
|
+
* 2. “调整”列设置按钮由主组件 standard-table 的 show-adjustment 控制,默认显示,
|
|
124258
|
+
* 传 false 时隐藏。列设置弹层仍由主组件渲染;
|
|
123323
124259
|
* 3. 按钮点击事件等逻辑完全由使用方在插槽内容中自行绑定(页面作用域)。
|
|
123324
124260
|
*/
|
|
123325
124261
|
/* harmony default export */ const ToolbarRightvue_type_script_lang_js = ({
|
|
@@ -123387,8 +124323,8 @@ var ToolbarRight_component = normalizeComponent(
|
|
|
123387
124323
|
)
|
|
123388
124324
|
|
|
123389
124325
|
/* harmony default export */ const ToolbarRight = (ToolbarRight_component.exports);
|
|
123390
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/ToolbarQuery.vue?vue&type=template&id=
|
|
123391
|
-
var
|
|
124326
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/ToolbarQuery.vue?vue&type=template&id=2b616fae
|
|
124327
|
+
var ToolbarQueryvue_type_template_id_2b616fae_render = function render() {
|
|
123392
124328
|
var _vm = this,
|
|
123393
124329
|
_c = _vm._self._c;
|
|
123394
124330
|
return _vm.placedCorrectly ? _c('div', {
|
|
@@ -123412,7 +124348,7 @@ var ToolbarQueryvue_type_template_id_d3cc2f7c_render = function render() {
|
|
|
123412
124348
|
on: {
|
|
123413
124349
|
"click": _vm.onQuery
|
|
123414
124350
|
}
|
|
123415
|
-
}), _c('standard-button', {
|
|
124351
|
+
}), _vm.showExport ? _c('standard-button', {
|
|
123416
124352
|
attrs: {
|
|
123417
124353
|
"icon": "el-icon-upload2",
|
|
123418
124354
|
"label": "导出"
|
|
@@ -123420,9 +124356,9 @@ var ToolbarQueryvue_type_template_id_d3cc2f7c_render = function render() {
|
|
|
123420
124356
|
on: {
|
|
123421
124357
|
"click": _vm.onExport
|
|
123422
124358
|
}
|
|
123423
|
-
})], 1) : _vm._e();
|
|
124359
|
+
}) : _vm._e()], 1) : _vm._e();
|
|
123424
124360
|
};
|
|
123425
|
-
var
|
|
124361
|
+
var ToolbarQueryvue_type_template_id_2b616fae_staticRenderFns = [];
|
|
123426
124362
|
|
|
123427
124363
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/ToolbarQuery.vue?vue&type=script&lang=js
|
|
123428
124364
|
|
|
@@ -123436,16 +124372,18 @@ var ToolbarQueryvue_type_template_id_d3cc2f7c_staticRenderFns = [];
|
|
|
123436
124372
|
* v-model="keyword"
|
|
123437
124373
|
* placeholder="请输入关键字"
|
|
123438
124374
|
* query-method="onQuery"
|
|
124375
|
+
* show-export
|
|
123439
124376
|
* export-method="onExport"
|
|
123440
124377
|
* />
|
|
123441
124378
|
* </standard-toolbar-right>
|
|
123442
124379
|
*
|
|
123443
124380
|
* 说明:
|
|
123444
124381
|
* 1. 只能作为 standard-toolbar-right 的子组件使用,放在其它位置时不渲染并给出警告;
|
|
123445
|
-
* 2.
|
|
124382
|
+
* 2. 默认包含输入框、查询按钮;showExport(模板写法 show-export)为 true 时再显示导出按钮。
|
|
124383
|
+
* 输入框回车与点击查询等效;
|
|
123446
124384
|
* 3. queryMethod / exportMethod(模板写法 query-method / export-method)
|
|
123447
124385
|
* 支持函数(直接调用)与字符串(沿父组件链查找页面方法),入参为当前关键字;
|
|
123448
|
-
* 4. 同时派发 query / export 事件,参数同样为当前关键字。
|
|
124386
|
+
* 4. 同时派发 query / export 事件,参数同样为当前关键字。export 仅在导出按钮显示时由点击触发。
|
|
123449
124387
|
*/
|
|
123450
124388
|
/* harmony default export */ const ToolbarQueryvue_type_script_lang_js = ({
|
|
123451
124389
|
name: 'StandardToolbarQuery',
|
|
@@ -123478,6 +124416,11 @@ var ToolbarQueryvue_type_template_id_d3cc2f7c_staticRenderFns = [];
|
|
|
123478
124416
|
type: [Function, String],
|
|
123479
124417
|
"default": ''
|
|
123480
124418
|
},
|
|
124419
|
+
// 是否显示导出按钮,默认不显示
|
|
124420
|
+
showExport: {
|
|
124421
|
+
type: Boolean,
|
|
124422
|
+
"default": false
|
|
124423
|
+
},
|
|
123481
124424
|
// 查询按钮加载态
|
|
123482
124425
|
loading: {
|
|
123483
124426
|
type: Boolean,
|
|
@@ -123563,8 +124506,8 @@ var ToolbarQueryvue_type_template_id_d3cc2f7c_staticRenderFns = [];
|
|
|
123563
124506
|
;
|
|
123564
124507
|
var ToolbarQuery_component = normalizeComponent(
|
|
123565
124508
|
StandardTable_ToolbarQueryvue_type_script_lang_js,
|
|
123566
|
-
|
|
123567
|
-
|
|
124509
|
+
ToolbarQueryvue_type_template_id_2b616fae_render,
|
|
124510
|
+
ToolbarQueryvue_type_template_id_2b616fae_staticRenderFns,
|
|
123568
124511
|
false,
|
|
123569
124512
|
null,
|
|
123570
124513
|
null,
|
|
@@ -124264,7 +125207,10 @@ function index_esm_default() { return index_esm_default.c || (index_esm_default.
|
|
|
124264
125207
|
*
|
|
124265
125208
|
* 用法一(全局注册,推荐):
|
|
124266
125209
|
* import StandardComponents from '@cimom-ui/standard-ui'
|
|
124267
|
-
* Vue.use(StandardComponents
|
|
125210
|
+
* Vue.use(StandardComponents, {
|
|
125211
|
+
* moduleCode: process.env.VUE_APP_MODULE_CODE, // 模块编码,与页面、表格一起确定表头配置
|
|
125212
|
+
* request: (config) => axios.request(config) // 业务项目的请求方法,baseURL 决定 IP 和端口
|
|
125213
|
+
* })
|
|
124268
125214
|
* // 之后所有页面模板可直接使用 <standard-button> / <standard-table> 等标签
|
|
124269
125215
|
*
|
|
124270
125216
|
* 用法二(局部注册):
|
|
@@ -124298,13 +125244,17 @@ function index_esm_default() { return index_esm_default.c || (index_esm_default.
|
|
|
124298
125244
|
|
|
124299
125245
|
|
|
124300
125246
|
|
|
125247
|
+
|
|
124301
125248
|
// 全部 14 个顶层组件(StandardForm / StandardTable / StandardTabs 注册时会连带其子组件)
|
|
124302
125249
|
// 说明:StandardAdvancedQuery 为 StandardFilterbar 的内部依赖,不单独暴露
|
|
124303
|
-
var src_components = [StandardButton, StandardDialog, StandardContainer,
|
|
125250
|
+
var src_components = [StandardButton, StandardDialog, StandardContainer, components_StandardFilterbar, components_StandardForm, StandardHalfArea, StandardInput, StandardPage, StandardSplitter, StandardSelect, StandardTimePick, components_StandardTable, components_StandardTabs, StandardTree];
|
|
124304
125251
|
|
|
124305
125252
|
// 全局 vxe-table 弹层层级是否已提升(install 重复调用时只设置一次)
|
|
124306
125253
|
var zIndexConfigured = false;
|
|
124307
|
-
var install = function install(Vue) {
|
|
125254
|
+
var install = function install(Vue, options) {
|
|
125255
|
+
// 模块编码和请求方法由业务项目注入。接口路径固定,IP 和端口来自请求方法的 baseURL
|
|
125256
|
+
if (options && options.moduleCode != null) setColumnModuleCode(options.moduleCode);
|
|
125257
|
+
if (options && typeof options.request === 'function') setColumnConfigRequest(options.request);
|
|
124308
125258
|
// 提升 vxe-table 弹层层级(右键菜单/tooltip 等):vxe-table 默认 zIndex 起始值
|
|
124309
125259
|
// 999,低于 Element UI 弹窗(el-dialog 等默认 2000 起),会导致弹窗内表格的
|
|
124310
125260
|
// 右键菜单面板被弹窗遮挡而“失效”;统一提升到 5000,确保位于所有常规弹窗之上
|
|
@@ -124332,7 +125282,7 @@ var StandardComponents = {
|
|
|
124332
125282
|
StandardButton: StandardButton,
|
|
124333
125283
|
StandardDialog: StandardDialog,
|
|
124334
125284
|
StandardContainer: StandardContainer,
|
|
124335
|
-
StandardFilterbar:
|
|
125285
|
+
StandardFilterbar: components_StandardFilterbar,
|
|
124336
125286
|
StandardForm: components_StandardForm,
|
|
124337
125287
|
StandardHalfArea: StandardHalfArea,
|
|
124338
125288
|
StandardInput: StandardInput,
|