@cimom-ui/standard-ui 1.1.13 → 1.1.16
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 -309
- package/dist/standard-ui.common.js +1296 -207
- package/dist/standard-ui.umd.js +1296 -207
- package/dist/standard-ui.umd.min.js +3 -3
- package/package.json +1 -1
|
@@ -2848,7 +2848,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.standard-container[data-v-b0b5121a]{d
|
|
|
2848
2848
|
|
|
2849
2849
|
/***/ },
|
|
2850
2850
|
|
|
2851
|
-
/***/
|
|
2851
|
+
/***/ 4175
|
|
2852
2852
|
(module, __webpack_exports__, __webpack_require__) {
|
|
2853
2853
|
|
|
2854
2854
|
"use strict";
|
|
@@ -2862,7 +2862,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2862
2862
|
|
|
2863
2863
|
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()));
|
|
2864
2864
|
// Module
|
|
2865
|
-
___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}}`, ""]);
|
|
2865
|
+
___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}}`, ""]);
|
|
2866
2866
|
// Exports
|
|
2867
2867
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
2868
2868
|
|
|
@@ -3062,7 +3062,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
3062
3062
|
|
|
3063
3063
|
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()));
|
|
3064
3064
|
// Module
|
|
3065
|
-
___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}`, ""]);
|
|
3065
|
+
___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}`, ""]);
|
|
3066
3066
|
// Exports
|
|
3067
3067
|
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
|
|
3068
3068
|
|
|
@@ -73332,19 +73332,19 @@ var update = add("5ae09596", content, true, {"sourceMap":false,"shadowMode":fals
|
|
|
73332
73332
|
|
|
73333
73333
|
/***/ },
|
|
73334
73334
|
|
|
73335
|
-
/***/
|
|
73335
|
+
/***/ 8365
|
|
73336
73336
|
(module, __unused_webpack_exports, __webpack_require__) {
|
|
73337
73337
|
|
|
73338
73338
|
// style-loader: Adds some css to the DOM by adding a <style> tag
|
|
73339
73339
|
|
|
73340
73340
|
// load the styles
|
|
73341
|
-
var content = __webpack_require__(
|
|
73341
|
+
var content = __webpack_require__(4175);
|
|
73342
73342
|
if(content.__esModule) content = content.default;
|
|
73343
73343
|
if(typeof content === 'string') content = [[module.id, content, '']];
|
|
73344
73344
|
if(content.locals) module.exports = content.locals;
|
|
73345
73345
|
// add the styles to the DOM
|
|
73346
73346
|
var add = (__webpack_require__(9548)/* ["default"] */ .A)
|
|
73347
|
-
var update = add("
|
|
73347
|
+
var update = add("54270400", content, true, {"sourceMap":false,"shadowMode":false});
|
|
73348
73348
|
|
|
73349
73349
|
/***/ },
|
|
73350
73350
|
|
|
@@ -118973,15 +118973,24 @@ var StandardContainer_component = normalizeComponent(
|
|
|
118973
118973
|
)
|
|
118974
118974
|
|
|
118975
118975
|
/* harmony default export */ const StandardContainer = (StandardContainer_component.exports);
|
|
118976
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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=
|
|
118977
|
-
var
|
|
118976
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
|
|
118977
|
+
var StandardFilterbarvue_type_template_id_042f1c58_render = function render() {
|
|
118978
118978
|
var _vm = this,
|
|
118979
|
-
_c = _vm._self._c
|
|
118979
|
+
_c = _vm._self._c,
|
|
118980
|
+
_setup = _vm._self._setupProxy;
|
|
118980
118981
|
return _vm.renderValid ? _c('section', {
|
|
118981
|
-
staticClass: "normal-report-toolbar-panel standard-filterbar"
|
|
118982
|
+
staticClass: "normal-report-toolbar-panel standard-filterbar",
|
|
118983
|
+
"class": {
|
|
118984
|
+
'standard-filterbar--expand-up': _vm.expandAbove
|
|
118985
|
+
}
|
|
118982
118986
|
}, [_c('div', {
|
|
118987
|
+
ref: "filterRow",
|
|
118983
118988
|
staticClass: "normal-report-filter-row normal-report-filter-row-primary"
|
|
118984
|
-
}, [
|
|
118989
|
+
}, [_c('filter-slot-group', {
|
|
118990
|
+
attrs: {
|
|
118991
|
+
"nodes": _vm.primarySlotNodes()
|
|
118992
|
+
}
|
|
118993
|
+
}), _vm._l(_vm.primaryConditionList(), function (cond) {
|
|
118985
118994
|
return _c('filter-search-item', {
|
|
118986
118995
|
key: cond.value,
|
|
118987
118996
|
staticClass: "standard-filterbar-item",
|
|
@@ -118989,6 +118998,7 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
|
|
|
118989
118998
|
attrs: {
|
|
118990
118999
|
"cond": cond,
|
|
118991
119000
|
"search-bar": _vm.searchBar,
|
|
119001
|
+
"layout-width": _vm.sharedItemWidth,
|
|
118992
119002
|
"options": _vm.getOptions(cond),
|
|
118993
119003
|
"is-remote": _vm.isRemoteCond(cond),
|
|
118994
119004
|
"remote-method": _vm.remoteMethods[cond.value] || null,
|
|
@@ -119000,6 +119010,7 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
|
|
|
119000
119010
|
}
|
|
119001
119011
|
});
|
|
119002
119012
|
}), _c('div', {
|
|
119013
|
+
ref: "filterActions",
|
|
119003
119014
|
staticClass: "normal-report-filter-actions"
|
|
119004
119015
|
}, [_c('standard-button', {
|
|
119005
119016
|
attrs: {
|
|
@@ -119029,20 +119040,26 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
|
|
|
119029
119040
|
return _vm.$emit('export');
|
|
119030
119041
|
}
|
|
119031
119042
|
}
|
|
119032
|
-
}) : _vm._e(), _vm.showAdvancedQuery && _vm.
|
|
119043
|
+
}) : _vm._e(), _vm.showAdvancedQuery && _vm.hasOverflow() ? _c('standard-advanced-query', {
|
|
119033
119044
|
ref: "advancedQuery",
|
|
119034
119045
|
attrs: {
|
|
119035
|
-
"conditions": _vm.
|
|
119046
|
+
"conditions": _vm.overflowConditionList(),
|
|
119047
|
+
"custom-count": _vm.overflowSlotNodes().length,
|
|
119036
119048
|
"search-bar": _vm.searchBar
|
|
119037
119049
|
},
|
|
119038
119050
|
on: {
|
|
119039
119051
|
"search": _vm.onSearch
|
|
119040
119052
|
}
|
|
119041
|
-
}
|
|
119053
|
+
}, [_c('filter-slot-group', {
|
|
119054
|
+
attrs: {
|
|
119055
|
+
"nodes": _vm.overflowSlotNodes()
|
|
119056
|
+
}
|
|
119057
|
+
})], 1) : _vm.showExpand && _vm.hasOverflow() ? _c('standard-button', {
|
|
119058
|
+
ref: "moreButton",
|
|
119042
119059
|
staticClass: "normal-report-expand-button",
|
|
119043
119060
|
attrs: {
|
|
119044
|
-
"icon": _vm.
|
|
119045
|
-
"label": "\u66F4\u591A".concat(_vm.
|
|
119061
|
+
"icon": _vm.expandIcon,
|
|
119062
|
+
"label": "\u66F4\u591A".concat(_vm.overflowActiveCount() ? " (".concat(_vm.overflowActiveCount(), ")") : '')
|
|
119046
119063
|
},
|
|
119047
119064
|
on: {
|
|
119048
119065
|
"click": function click($event) {
|
|
@@ -119053,15 +119070,19 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
|
|
|
119053
119070
|
attrs: {
|
|
119054
119071
|
"name": "normal-report-filter-expand"
|
|
119055
119072
|
}
|
|
119056
|
-
}, [_vm.
|
|
119073
|
+
}, [!_vm.showAdvancedQuery && _vm.hasOverflow() ? _c('div', {
|
|
119057
119074
|
directives: [{
|
|
119058
119075
|
name: "show",
|
|
119059
119076
|
rawName: "v-show",
|
|
119060
|
-
value: _vm.
|
|
119061
|
-
expression: "
|
|
119077
|
+
value: _vm.secondaryOpen(),
|
|
119078
|
+
expression: "secondaryOpen()"
|
|
119062
119079
|
}],
|
|
119063
119080
|
staticClass: "normal-report-filter-row normal-report-filter-row-secondary"
|
|
119064
|
-
},
|
|
119081
|
+
}, [_c('filter-slot-group', {
|
|
119082
|
+
attrs: {
|
|
119083
|
+
"nodes": _vm.overflowSlotNodes()
|
|
119084
|
+
}
|
|
119085
|
+
}), _vm._l(_vm.overflowConditionList(), function (cond) {
|
|
119065
119086
|
return _c('filter-search-item', {
|
|
119066
119087
|
key: cond.value,
|
|
119067
119088
|
staticClass: "standard-filterbar-item",
|
|
@@ -119069,6 +119090,7 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
|
|
|
119069
119090
|
attrs: {
|
|
119070
119091
|
"cond": cond,
|
|
119071
119092
|
"search-bar": _vm.searchBar,
|
|
119093
|
+
"layout-width": _vm.sharedItemWidth,
|
|
119072
119094
|
"options": _vm.getOptions(cond),
|
|
119073
119095
|
"is-remote": _vm.isRemoteCond(cond),
|
|
119074
119096
|
"remote-method": _vm.remoteMethods[cond.value] || null,
|
|
@@ -119079,12 +119101,12 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
|
|
|
119079
119101
|
}
|
|
119080
119102
|
}
|
|
119081
119103
|
});
|
|
119082
|
-
}),
|
|
119104
|
+
})], 2) : _vm._e()])], 1) : _vm._e();
|
|
119083
119105
|
};
|
|
119084
|
-
var
|
|
119106
|
+
var StandardFilterbarvue_type_template_id_042f1c58_staticRenderFns = [];
|
|
119085
119107
|
|
|
119086
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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=
|
|
119087
|
-
var
|
|
119108
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
|
|
119109
|
+
var StandardAdvancedQueryvue_type_template_id_07a0d3fc_render = function render() {
|
|
119088
119110
|
var _vm = this,
|
|
119089
119111
|
_c = _vm._self._c;
|
|
119090
119112
|
return _c('el-popover', {
|
|
@@ -119102,7 +119124,9 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_render = function render(
|
|
|
119102
119124
|
}
|
|
119103
119125
|
}, [_c('div', {
|
|
119104
119126
|
staticClass: "standard-advanced-query-panel"
|
|
119105
|
-
}, [_c('div', {
|
|
119127
|
+
}, [_vm.customCount ? _c('div', {
|
|
119128
|
+
staticClass: "standard-advanced-query-custom"
|
|
119129
|
+
}, [_vm._t("default")], 2) : _vm._e(), _c('div', {
|
|
119106
119130
|
staticClass: "standard-advanced-query-list"
|
|
119107
119131
|
}, [_vm.rows.length ? _vm._l(_vm.rows, function (row, index) {
|
|
119108
119132
|
return _c('div', {
|
|
@@ -119155,13 +119179,13 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_render = function render(
|
|
|
119155
119179
|
}
|
|
119156
119180
|
}
|
|
119157
119181
|
})], 1);
|
|
119158
|
-
}) : _c('el-empty', {
|
|
119182
|
+
}) : !_vm.customCount ? _c('el-empty', {
|
|
119159
119183
|
staticClass: "standard-advanced-query-empty",
|
|
119160
119184
|
attrs: {
|
|
119161
119185
|
"image-size": 60,
|
|
119162
119186
|
"description": "点击下方新增按钮添加查询条件"
|
|
119163
119187
|
}
|
|
119164
|
-
})], 2), _c('div', {
|
|
119188
|
+
}) : _vm._e()], 2), _c('div', {
|
|
119165
119189
|
staticClass: "standard-advanced-query-footer"
|
|
119166
119190
|
}, [_c('el-button', {
|
|
119167
119191
|
attrs: {
|
|
@@ -119199,7 +119223,7 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_render = function render(
|
|
|
119199
119223
|
slot: "reference"
|
|
119200
119224
|
}, [_vm._v(" 高级查询" + _vm._s(_vm.rows.length ? " (".concat(_vm.rows.length, ")") : '') + " ")])], 1);
|
|
119201
119225
|
};
|
|
119202
|
-
var
|
|
119226
|
+
var StandardAdvancedQueryvue_type_template_id_07a0d3fc_staticRenderFns = [];
|
|
119203
119227
|
|
|
119204
119228
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardAdvancedQuery/index.vue?vue&type=script&lang=js
|
|
119205
119229
|
/**
|
|
@@ -119225,6 +119249,11 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_staticRenderFns = [];
|
|
|
119225
119249
|
return [];
|
|
119226
119250
|
}
|
|
119227
119251
|
},
|
|
119252
|
+
// 未进首行的自定义筛选项数量(默认插槽中的原始控件,不参与文本条件行)
|
|
119253
|
+
customCount: {
|
|
119254
|
+
type: Number,
|
|
119255
|
+
"default": 0
|
|
119256
|
+
},
|
|
119228
119257
|
// v-model 绑定的筛选配置对象(读写 searchVariable 完成值双向绑定)
|
|
119229
119258
|
searchBar: {
|
|
119230
119259
|
type: Object,
|
|
@@ -119249,7 +119278,8 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_staticRenderFns = [];
|
|
|
119249
119278
|
}
|
|
119250
119279
|
},
|
|
119251
119280
|
watch: {
|
|
119252
|
-
//
|
|
119281
|
+
// 可用条件变化时:移出已不在列表中的行(保留字段值,避免首行容量变化时把已填内容清掉);
|
|
119282
|
+
// 新进入列表且已有值的字段补一行,角标与弹窗能看到该条件
|
|
119253
119283
|
conditions: function conditions() {
|
|
119254
119284
|
var _this = this;
|
|
119255
119285
|
var fields = (this.conditions || []).map(function (c) {
|
|
@@ -119258,8 +119288,19 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_staticRenderFns = [];
|
|
|
119258
119288
|
var valid = this.rows.filter(function (row) {
|
|
119259
119289
|
return fields.indexOf(row.field) > -1;
|
|
119260
119290
|
});
|
|
119261
|
-
|
|
119262
|
-
|
|
119291
|
+
var existing = {};
|
|
119292
|
+
valid.forEach(function (row) {
|
|
119293
|
+
existing[row.field] = true;
|
|
119294
|
+
});
|
|
119295
|
+
(this.conditions || []).forEach(function (cond) {
|
|
119296
|
+
if (!cond || existing[cond.value]) return;
|
|
119297
|
+
if (_this.hasValue(cond)) {
|
|
119298
|
+
valid.push({
|
|
119299
|
+
uid: ++_this.uidSeq,
|
|
119300
|
+
field: cond.value
|
|
119301
|
+
});
|
|
119302
|
+
existing[cond.value] = true;
|
|
119303
|
+
}
|
|
119263
119304
|
});
|
|
119264
119305
|
this.rows = valid;
|
|
119265
119306
|
}
|
|
@@ -119413,8 +119454,8 @@ var StandardAdvancedQueryvue_type_style_index_0_prod_lang_scss_external = __webp
|
|
|
119413
119454
|
|
|
119414
119455
|
var StandardAdvancedQuery_component = normalizeComponent(
|
|
119415
119456
|
components_StandardAdvancedQueryvue_type_script_lang_js,
|
|
119416
|
-
|
|
119417
|
-
|
|
119457
|
+
StandardAdvancedQueryvue_type_template_id_07a0d3fc_render,
|
|
119458
|
+
StandardAdvancedQueryvue_type_template_id_07a0d3fc_staticRenderFns,
|
|
119418
119459
|
false,
|
|
119419
119460
|
null,
|
|
119420
119461
|
null,
|
|
@@ -119423,11 +119464,125 @@ var StandardAdvancedQuery_component = normalizeComponent(
|
|
|
119423
119464
|
)
|
|
119424
119465
|
|
|
119425
119466
|
/* harmony default export */ const StandardAdvancedQuery = (StandardAdvancedQuery_component.exports);
|
|
119467
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
|
|
119468
|
+
var Itemvue_type_template_id_0001f453_render = function render() {
|
|
119469
|
+
var _vm = this,
|
|
119470
|
+
_c = _vm._self._c;
|
|
119471
|
+
return _c('label', {
|
|
119472
|
+
staticClass: "normal-report-filter-item",
|
|
119473
|
+
style: _vm.itemStyle
|
|
119474
|
+
}, [_vm.label ? _c('span', [_vm._v(_vm._s(_vm.label))]) : _vm._e(), _c('div', {
|
|
119475
|
+
staticClass: "normal-report-filter-control standard-filterbar-slot-control"
|
|
119476
|
+
}, [_vm._t("default")], 2)]);
|
|
119477
|
+
};
|
|
119478
|
+
var Itemvue_type_template_id_0001f453_staticRenderFns = [];
|
|
119479
|
+
|
|
119480
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/Item.vue?vue&type=script&lang=js
|
|
119481
|
+
/**
|
|
119482
|
+
* StandardFilterbarItem
|
|
119483
|
+
* 用法(作为 standard-filterbar 的默认插槽子节点,顺序优先于 v-model 中的条件):
|
|
119484
|
+
* <standard-filterbar-item label="车间">
|
|
119485
|
+
* <el-select v-model="extra.workshop" size="mini" clearable />
|
|
119486
|
+
* </standard-filterbar-item>
|
|
119487
|
+
*/
|
|
119488
|
+
/* harmony default export */ const Itemvue_type_script_lang_js = ({
|
|
119489
|
+
name: 'StandardFilterbarItem',
|
|
119490
|
+
props: {
|
|
119491
|
+
// 条件标题,显示在控件上方
|
|
119492
|
+
label: {
|
|
119493
|
+
type: String,
|
|
119494
|
+
"default": ''
|
|
119495
|
+
},
|
|
119496
|
+
// 自定义宽度:数字按 px,或任意 CSS 宽度字符串。未传时跟随首行统一宽度
|
|
119497
|
+
width: {
|
|
119498
|
+
type: [Number, String],
|
|
119499
|
+
"default": null
|
|
119500
|
+
},
|
|
119501
|
+
// 由筛选栏在渲染时写入的统一项宽,使用方无需传递
|
|
119502
|
+
layoutWidth: {
|
|
119503
|
+
type: Number,
|
|
119504
|
+
"default": 0
|
|
119505
|
+
}
|
|
119506
|
+
},
|
|
119507
|
+
computed: {
|
|
119508
|
+
itemStyle: function itemStyle() {
|
|
119509
|
+
var custom = this.width;
|
|
119510
|
+
var hasCustom = custom !== undefined && custom !== null && custom !== '';
|
|
119511
|
+
var toCss = function toCss(value) {
|
|
119512
|
+
return typeof value === 'number' ? "".concat(value, "px") : value;
|
|
119513
|
+
};
|
|
119514
|
+
if (hasCustom) {
|
|
119515
|
+
var css = toCss(custom);
|
|
119516
|
+
return {
|
|
119517
|
+
'--filter-item-width': css,
|
|
119518
|
+
width: css,
|
|
119519
|
+
flexBasis: css,
|
|
119520
|
+
flexGrow: 0,
|
|
119521
|
+
flexShrink: 0,
|
|
119522
|
+
minWidth: css,
|
|
119523
|
+
maxWidth: css
|
|
119524
|
+
};
|
|
119525
|
+
}
|
|
119526
|
+
if (this.layoutWidth > 0) {
|
|
119527
|
+
var _css = "".concat(this.layoutWidth, "px");
|
|
119528
|
+
return {
|
|
119529
|
+
'--filter-item-width': _css,
|
|
119530
|
+
width: _css,
|
|
119531
|
+
flexBasis: _css,
|
|
119532
|
+
flexGrow: 0,
|
|
119533
|
+
flexShrink: 0
|
|
119534
|
+
};
|
|
119535
|
+
}
|
|
119536
|
+
return null;
|
|
119537
|
+
}
|
|
119538
|
+
}
|
|
119539
|
+
});
|
|
119540
|
+
;// ./src/components/StandardFilterbar/Item.vue?vue&type=script&lang=js
|
|
119541
|
+
/* harmony default export */ const StandardFilterbar_Itemvue_type_script_lang_js = (Itemvue_type_script_lang_js);
|
|
119542
|
+
;// ./src/components/StandardFilterbar/Item.vue
|
|
119543
|
+
|
|
119544
|
+
|
|
119545
|
+
|
|
119546
|
+
|
|
119547
|
+
|
|
119548
|
+
/* normalize component */
|
|
119549
|
+
;
|
|
119550
|
+
var Item_component = normalizeComponent(
|
|
119551
|
+
StandardFilterbar_Itemvue_type_script_lang_js,
|
|
119552
|
+
Itemvue_type_template_id_0001f453_render,
|
|
119553
|
+
Itemvue_type_template_id_0001f453_staticRenderFns,
|
|
119554
|
+
false,
|
|
119555
|
+
null,
|
|
119556
|
+
null,
|
|
119557
|
+
null
|
|
119558
|
+
|
|
119559
|
+
)
|
|
119560
|
+
|
|
119561
|
+
/* harmony default export */ const Item = (Item_component.exports);
|
|
119426
119562
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/index.vue?vue&type=script&lang=js
|
|
119427
119563
|
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); }
|
|
119428
119564
|
;
|
|
119429
119565
|
|
|
119430
119566
|
|
|
119567
|
+
|
|
119568
|
+
/**
|
|
119569
|
+
* 把插槽项 vnode 铺进父级 flex 行,不额外包一层,保证每个 item 单独占一格。
|
|
119570
|
+
*/
|
|
119571
|
+
var FilterSlotGroup = {
|
|
119572
|
+
functional: true,
|
|
119573
|
+
props: {
|
|
119574
|
+
nodes: {
|
|
119575
|
+
type: Array,
|
|
119576
|
+
"default": function _default() {
|
|
119577
|
+
return [];
|
|
119578
|
+
}
|
|
119579
|
+
}
|
|
119580
|
+
},
|
|
119581
|
+
render: function render(h, ctx) {
|
|
119582
|
+
return ctx.props.nodes || [];
|
|
119583
|
+
}
|
|
119584
|
+
};
|
|
119585
|
+
|
|
119431
119586
|
/**
|
|
119432
119587
|
* 单个筛选条件渲染组件(组件内部使用,不对外暴露)
|
|
119433
119588
|
* 使用 render 函数实现,避免主区/次区重复书写同一套控件模板
|
|
@@ -119475,7 +119630,12 @@ var FilterSearchItem = {
|
|
|
119475
119630
|
onFocus: {
|
|
119476
119631
|
type: Function,
|
|
119477
119632
|
"default": null
|
|
119478
|
-
}
|
|
119633
|
+
},
|
|
119634
|
+
// 下拉聚焦/展开时的回调
|
|
119635
|
+
layoutWidth: {
|
|
119636
|
+
type: Number,
|
|
119637
|
+
"default": 0
|
|
119638
|
+
} // 首行测得的统一项宽(px);0 表示尚未测得,沿用样式默认值
|
|
119479
119639
|
},
|
|
119480
119640
|
render: function render(h) {
|
|
119481
119641
|
var _this = this;
|
|
@@ -119490,12 +119650,34 @@ var FilterSearchItem = {
|
|
|
119490
119650
|
};
|
|
119491
119651
|
var clearable = cond.clearable !== false;
|
|
119492
119652
|
var placeholder = cond.placeholder || (cond.type === 'text' ? "\u8BF7\u8F93\u5165".concat(cond.label) : "\u8BF7\u9009\u62E9".concat(cond.label));
|
|
119493
|
-
//
|
|
119494
|
-
var
|
|
119495
|
-
var
|
|
119496
|
-
|
|
119497
|
-
|
|
119498
|
-
}
|
|
119653
|
+
// 宽度:单条 cond.width 优先(数字按 px);否则使用父组件按行宽算出的统一宽度
|
|
119654
|
+
var custom = cond.width;
|
|
119655
|
+
var hasCustom = custom !== undefined && custom !== null && custom !== '';
|
|
119656
|
+
var toCss = function toCss(value) {
|
|
119657
|
+
return typeof value === 'number' ? "".concat(value, "px") : value;
|
|
119658
|
+
};
|
|
119659
|
+
var style = null;
|
|
119660
|
+
if (hasCustom) {
|
|
119661
|
+
var css = toCss(custom);
|
|
119662
|
+
style = {
|
|
119663
|
+
'--filter-item-width': css,
|
|
119664
|
+
width: css,
|
|
119665
|
+
flexBasis: css,
|
|
119666
|
+
flexGrow: 0,
|
|
119667
|
+
flexShrink: 0,
|
|
119668
|
+
minWidth: css,
|
|
119669
|
+
maxWidth: css
|
|
119670
|
+
};
|
|
119671
|
+
} else if (this.layoutWidth > 0) {
|
|
119672
|
+
var _css = "".concat(this.layoutWidth, "px");
|
|
119673
|
+
style = {
|
|
119674
|
+
'--filter-item-width': _css,
|
|
119675
|
+
width: _css,
|
|
119676
|
+
flexBasis: _css,
|
|
119677
|
+
flexGrow: 0,
|
|
119678
|
+
flexShrink: 0
|
|
119679
|
+
};
|
|
119680
|
+
}
|
|
119499
119681
|
var controlEl = null;
|
|
119500
119682
|
switch (cond.type) {
|
|
119501
119683
|
// 文本输入框
|
|
@@ -119614,14 +119796,17 @@ var FilterSearchItem = {
|
|
|
119614
119796
|
* 用法:
|
|
119615
119797
|
* <standard-filterbar v-model="searchBar" show-export @search="..." @export="..." />
|
|
119616
119798
|
* 说明:
|
|
119617
|
-
* v-model 绑定的 searchBar 对象包含 searchCondition(条件配置列表)、searchVariable
|
|
119618
|
-
*
|
|
119619
|
-
*
|
|
119799
|
+
* v-model 绑定的 searchBar 对象包含 searchCondition(条件配置列表)、searchVariable(绑定值对象)。
|
|
119800
|
+
* 默认插槽中的 standard-filterbar-item 排在 searchCondition 之前;首行放不下的进入“更多”或“高级查询”。
|
|
119801
|
+
* 不传插槽时仍按单标签使用。单项宽 175–300px。
|
|
119802
|
+
* 未显式传入 mainConditionCount 时不设个数上限,传入时作为首行个数上限。
|
|
119803
|
+
* isMain 仍可写在配置中,不再参与首行/其余的划分。
|
|
119620
119804
|
*/
|
|
119621
|
-
|
|
119805
|
+
var StandardFilterbar = {
|
|
119622
119806
|
name: 'StandardFilterbar',
|
|
119623
119807
|
components: {
|
|
119624
119808
|
FilterSearchItem: FilterSearchItem,
|
|
119809
|
+
FilterSlotGroup: FilterSlotGroup,
|
|
119625
119810
|
StandardButton: StandardButton,
|
|
119626
119811
|
StandardAdvancedQuery: StandardAdvancedQuery
|
|
119627
119812
|
},
|
|
@@ -119631,7 +119816,7 @@ var FilterSearchItem = {
|
|
|
119631
119816
|
event: 'input'
|
|
119632
119817
|
},
|
|
119633
119818
|
props: {
|
|
119634
|
-
// v-model 绑定的筛选配置对象:{ searchCondition: [], searchVariable: {}, mainConditionCount
|
|
119819
|
+
// v-model 绑定的筛选配置对象:{ searchCondition: [], searchVariable: {}, mainConditionCount }
|
|
119635
119820
|
searchBar: {
|
|
119636
119821
|
type: Object,
|
|
119637
119822
|
required: true
|
|
@@ -119652,6 +119837,11 @@ var FilterSearchItem = {
|
|
|
119652
119837
|
type: Boolean,
|
|
119653
119838
|
"default": false
|
|
119654
119839
|
},
|
|
119840
|
+
// 更多条件是否向筛选栏上方展开。仅在为 true 且未使用高级查询时生效;否则在下方展开
|
|
119841
|
+
expandUpwards: {
|
|
119842
|
+
type: Boolean,
|
|
119843
|
+
"default": true
|
|
119844
|
+
},
|
|
119655
119845
|
// 查询按钮 loading 状态(可选,由父组件控制)
|
|
119656
119846
|
loading: {
|
|
119657
119847
|
type: Boolean,
|
|
@@ -119675,7 +119865,11 @@ var FilterSearchItem = {
|
|
|
119675
119865
|
// 远程下拉加载状态:{ 条件value: Boolean }
|
|
119676
119866
|
remoteMethods: {},
|
|
119677
119867
|
// 远程下拉防抖方法缓存:{ 条件value: Function }
|
|
119678
|
-
initValues: {}
|
|
119868
|
+
initValues: {},
|
|
119869
|
+
// searchVariable 初始值快照(组件创建时刻),用于“重置”
|
|
119870
|
+
visibleCount: 99,
|
|
119871
|
+
// 首行可展示的条件个数,挂载后按容器宽度重算
|
|
119872
|
+
sharedItemWidth: 0 // 首行弹性项的统一宽度(px),0 表示沿用样式默认 175
|
|
119679
119873
|
};
|
|
119680
119874
|
},
|
|
119681
119875
|
computed: {
|
|
@@ -119684,95 +119878,329 @@ var FilterSearchItem = {
|
|
|
119684
119878
|
var list = this.searchBar && this.searchBar.searchCondition || [];
|
|
119685
119879
|
return Array.isArray(list) ? list : [];
|
|
119686
119880
|
},
|
|
119687
|
-
//
|
|
119688
|
-
//
|
|
119689
|
-
|
|
119881
|
+
// 首行个数上限:仅当 searchBar.mainConditionCount 显式传入且为非负数字时生效;
|
|
119882
|
+
// 未传则只受容器宽度限制
|
|
119883
|
+
firstRowLimit: function firstRowLimit() {
|
|
119690
119884
|
var count = this.searchBar && this.searchBar.mainConditionCount;
|
|
119885
|
+
if (count === undefined || count === null || count === '') return null;
|
|
119691
119886
|
var num = Number(count);
|
|
119692
|
-
|
|
119887
|
+
if (isNaN(num) || num < 0) return null;
|
|
119888
|
+
return Math.floor(num);
|
|
119693
119889
|
},
|
|
119694
|
-
//
|
|
119695
|
-
|
|
119890
|
+
// 参与排布的条件:保持 searchCondition 数组顺序,空项不渲染
|
|
119891
|
+
orderedConditions: function orderedConditions() {
|
|
119696
119892
|
return this.conditions.filter(function (cond) {
|
|
119697
|
-
return cond && (cond
|
|
119893
|
+
return cond && _typeof(cond) === 'object';
|
|
119698
119894
|
});
|
|
119699
119895
|
},
|
|
119700
|
-
//
|
|
119701
|
-
|
|
119702
|
-
return this.
|
|
119703
|
-
return !cond || cond.isMain !== 'Y' && cond.isMain !== true;
|
|
119704
|
-
});
|
|
119705
|
-
},
|
|
119706
|
-
// 次区是否可见:高级查询模式下次区条件收进弹窗(不展开显示);
|
|
119707
|
-
// 未开启“更多”功能时次区常显
|
|
119708
|
-
secondaryVisible: function secondaryVisible() {
|
|
119709
|
-
if (!this.secondaryConditions.length) return false;
|
|
119710
|
-
if (this.showAdvancedQuery) return false;
|
|
119711
|
-
return this.showExpand ? this.expanded : true;
|
|
119896
|
+
// 向上展开:属性为 true,且当前不是高级查询
|
|
119897
|
+
expandAbove: function expandAbove() {
|
|
119898
|
+
return this.expandUpwards && !this.showAdvancedQuery;
|
|
119712
119899
|
},
|
|
119713
|
-
//
|
|
119714
|
-
|
|
119715
|
-
|
|
119716
|
-
return this.
|
|
119717
|
-
return _this2.hasValue(cond);
|
|
119718
|
-
}).length;
|
|
119900
|
+
// 更多按钮箭头:向上展开时,收起箭头朝上、展开后箭头朝下
|
|
119901
|
+
expandIcon: function expandIcon() {
|
|
119902
|
+
if (this.expandAbove) return this.expanded ? 'el-icon-arrow-down' : 'el-icon-arrow-up';
|
|
119903
|
+
return this.expanded ? 'el-icon-arrow-up' : 'el-icon-arrow-down';
|
|
119719
119904
|
}
|
|
119720
119905
|
},
|
|
119721
119906
|
watch: {
|
|
119722
119907
|
// 条件配置动态变化时重新校验,并为新增的远程下拉补充初始化
|
|
119723
119908
|
'searchBar.searchCondition': function searchBarSearchCondition(val) {
|
|
119724
|
-
var
|
|
119909
|
+
var _this2 = this;
|
|
119725
119910
|
this.validate();
|
|
119911
|
+
this.scheduleMeasure();
|
|
119726
119912
|
if (!this.renderValid) return;
|
|
119727
119913
|
var list = Array.isArray(val) ? val : [];
|
|
119728
119914
|
list.forEach(function (cond) {
|
|
119729
|
-
if (
|
|
119730
|
-
if (!
|
|
119731
|
-
|
|
119732
|
-
return
|
|
119915
|
+
if (_this2.isRemoteCond(cond)) {
|
|
119916
|
+
if (!_this2.remoteMethods[cond.value]) {
|
|
119917
|
+
_this2.remoteMethods[cond.value] = _this2.debounce(function (keyword) {
|
|
119918
|
+
return _this2.loadRemoteOptions(cond, keyword);
|
|
119733
119919
|
}, 300);
|
|
119734
119920
|
}
|
|
119735
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
119736
|
-
|
|
119921
|
+
if (!Object.prototype.hasOwnProperty.call(_this2.remoteOptions, cond.value)) {
|
|
119922
|
+
_this2.loadRemoteOptions(cond, '');
|
|
119737
119923
|
}
|
|
119738
119924
|
}
|
|
119739
119925
|
});
|
|
119926
|
+
},
|
|
119927
|
+
showExport: function showExport() {
|
|
119928
|
+
this.scheduleMeasure();
|
|
119929
|
+
},
|
|
119930
|
+
showExpand: function showExpand() {
|
|
119931
|
+
this.scheduleMeasure();
|
|
119932
|
+
},
|
|
119933
|
+
showAdvancedQuery: function showAdvancedQuery() {
|
|
119934
|
+
this.scheduleMeasure();
|
|
119740
119935
|
}
|
|
119741
119936
|
},
|
|
119742
119937
|
created: function created() {
|
|
119743
|
-
var
|
|
119938
|
+
var _this3 = this;
|
|
119744
119939
|
// 深拷贝初始值快照:作为“重置”按钮的恢复目标
|
|
119745
119940
|
this.initValues = this.deepCopy(this.searchBar && this.searchBar.searchVariable || {});
|
|
119746
119941
|
// 渲染前校验:失败则 renderValid=false,组件不渲染
|
|
119747
119942
|
this.validate();
|
|
119748
119943
|
if (!this.renderValid) return;
|
|
119749
|
-
//
|
|
119750
|
-
if (!this.showExpand
|
|
119944
|
+
// 关闭“更多”时,未进首行的条件换行常显
|
|
119945
|
+
if (!this.showExpand) {
|
|
119751
119946
|
this.expanded = true;
|
|
119752
119947
|
}
|
|
119948
|
+
this._slotStamp = 0;
|
|
119949
|
+
this._slotBucket = null;
|
|
119950
|
+
this._measuredSlotCount = 0;
|
|
119753
119951
|
// 为远程下拉预先创建防抖方法,并做首次数据加载
|
|
119754
|
-
this.
|
|
119755
|
-
if (
|
|
119756
|
-
if (!
|
|
119757
|
-
|
|
119758
|
-
return
|
|
119952
|
+
this.conditions.forEach(function (cond) {
|
|
119953
|
+
if (_this3.isRemoteCond(cond)) {
|
|
119954
|
+
if (!_this3.remoteMethods[cond.value]) {
|
|
119955
|
+
_this3.remoteMethods[cond.value] = _this3.debounce(function (keyword) {
|
|
119956
|
+
return _this3.loadRemoteOptions(cond, keyword);
|
|
119759
119957
|
}, 300);
|
|
119760
119958
|
}
|
|
119761
|
-
|
|
119959
|
+
_this3.loadRemoteOptions(cond, '');
|
|
119762
119960
|
}
|
|
119763
119961
|
});
|
|
119764
119962
|
},
|
|
119963
|
+
beforeUpdate: function beforeUpdate() {
|
|
119964
|
+
// 同一次渲染里多次读取插槽时复用同一批 vnode,避免自定义控件被创建两份
|
|
119965
|
+
this._slotStamp = (this._slotStamp || 0) + 1;
|
|
119966
|
+
this._slotBucket = null;
|
|
119967
|
+
},
|
|
119968
|
+
mounted: function mounted() {
|
|
119969
|
+
var _this4 = this;
|
|
119970
|
+
this.$nextTick(function () {
|
|
119971
|
+
_this4.bindResize();
|
|
119972
|
+
_this4.measureVisibleCount();
|
|
119973
|
+
});
|
|
119974
|
+
},
|
|
119975
|
+
updated: function updated() {
|
|
119976
|
+
var count = this.readSlotNodes().length;
|
|
119977
|
+
if (count !== this._measuredSlotCount) {
|
|
119978
|
+
this._measuredSlotCount = count;
|
|
119979
|
+
this.scheduleMeasure();
|
|
119980
|
+
}
|
|
119981
|
+
},
|
|
119982
|
+
beforeDestroy: function beforeDestroy() {
|
|
119983
|
+
if (this._resizeObserver) {
|
|
119984
|
+
this._resizeObserver.disconnect();
|
|
119985
|
+
this._resizeObserver = null;
|
|
119986
|
+
}
|
|
119987
|
+
if (this._measureRaf) {
|
|
119988
|
+
cancelAnimationFrame(this._measureRaf);
|
|
119989
|
+
this._measureRaf = 0;
|
|
119990
|
+
}
|
|
119991
|
+
if (this._onWindowResize) {
|
|
119992
|
+
window.removeEventListener('resize', this._onWindowResize);
|
|
119993
|
+
this._onWindowResize = null;
|
|
119994
|
+
}
|
|
119995
|
+
},
|
|
119765
119996
|
methods: {
|
|
119997
|
+
/** 下一帧重算首行容量,合并同一帧内的连续触发 */scheduleMeasure: function scheduleMeasure() {
|
|
119998
|
+
var _this5 = this;
|
|
119999
|
+
if (this._measureRaf) return;
|
|
120000
|
+
this._measureRaf = requestAnimationFrame(function () {
|
|
120001
|
+
_this5._measureRaf = 0;
|
|
120002
|
+
_this5.measureVisibleCount();
|
|
120003
|
+
});
|
|
120004
|
+
},
|
|
120005
|
+
/** 监听筛选行与按钮区尺寸:窗口缩放、分割条拖动都会改变可用宽度 */bindResize: function bindResize() {
|
|
120006
|
+
var _this6 = this;
|
|
120007
|
+
var row = this.$refs.filterRow;
|
|
120008
|
+
if (!row || typeof ResizeObserver === 'undefined') {
|
|
120009
|
+
this._onWindowResize = function () {
|
|
120010
|
+
return _this6.scheduleMeasure();
|
|
120011
|
+
};
|
|
120012
|
+
window.addEventListener('resize', this._onWindowResize);
|
|
120013
|
+
return;
|
|
120014
|
+
}
|
|
120015
|
+
this._resizeObserver = new ResizeObserver(function () {
|
|
120016
|
+
return _this6.scheduleMeasure();
|
|
120017
|
+
});
|
|
120018
|
+
this._resizeObserver.observe(row);
|
|
120019
|
+
if (this.$refs.filterActions) this._resizeObserver.observe(this.$refs.filterActions);
|
|
120020
|
+
},
|
|
120021
|
+
/** 将条件宽度解析为 px;百分比等非 px 写法返回 null */parseItemPx: function parseItemPx(width) {
|
|
120022
|
+
if (width == null || width === '') return null;
|
|
120023
|
+
if (typeof width === 'number' && !isNaN(width)) return width;
|
|
120024
|
+
if (typeof width === 'string') {
|
|
120025
|
+
var matched = /^(\d+(?:\.\d+)?)px$/.exec(width.trim());
|
|
120026
|
+
if (matched) return Number(matched[1]);
|
|
120027
|
+
}
|
|
120028
|
+
return null;
|
|
120029
|
+
},
|
|
120030
|
+
/** 读取默认插槽中的 standard-filterbar-item,每个节点计为一条筛选条件 */readSlotNodes: function readSlotNodes() {
|
|
120031
|
+
var _this7 = this;
|
|
120032
|
+
var scoped = this.$scopedSlots && this.$scopedSlots["default"];
|
|
120033
|
+
var raw = typeof scoped === 'function' ? scoped({}) : this.$slots && this.$slots["default"] || [];
|
|
120034
|
+
return raw.filter(function (node) {
|
|
120035
|
+
return _this7.isFilterbarItemNode(node);
|
|
120036
|
+
});
|
|
120037
|
+
},
|
|
120038
|
+
/** 是否为筛选栏插槽项(忽略插槽里的空白文本节点) */isFilterbarItemNode: function isFilterbarItemNode(vnode) {
|
|
120039
|
+
if (!vnode || !vnode.tag || !vnode.componentOptions) return false;
|
|
120040
|
+
var Ctor = vnode.componentOptions.Ctor;
|
|
120041
|
+
var name = Ctor && Ctor.options && Ctor.options.name || Ctor && Ctor.extendOptions && Ctor.extendOptions.name || '';
|
|
120042
|
+
if (name === 'StandardFilterbarItem') return true;
|
|
120043
|
+
return String(vnode.componentOptions.tag || '') === 'standard-filterbar-item';
|
|
120044
|
+
},
|
|
120045
|
+
/**
|
|
120046
|
+
* 同一次渲染只收集一次插槽节点。
|
|
120047
|
+
* 插槽项整体排在 searchCondition 之前,再按 visibleCount 切到首行或其余区域。
|
|
120048
|
+
*/
|
|
120049
|
+
ensureSlotBucket: function ensureSlotBucket() {
|
|
120050
|
+
if (this._slotBucket && this._slotBucket.stamp === this._slotStamp) return this._slotBucket;
|
|
120051
|
+
var nodes = this.readSlotNodes();
|
|
120052
|
+
var layoutWidth = this.sharedItemWidth;
|
|
120053
|
+
nodes.forEach(function (node, index) {
|
|
120054
|
+
var props = node.componentOptions && node.componentOptions.propsData || {};
|
|
120055
|
+
node.componentOptions.propsData = Object.assign({}, props, {
|
|
120056
|
+
layoutWidth: layoutWidth
|
|
120057
|
+
});
|
|
120058
|
+
if (!node.key) node.key = "standard-filterbar-item-".concat(index);
|
|
120059
|
+
});
|
|
120060
|
+
var primaryCount = Math.min(this.visibleCount, nodes.length);
|
|
120061
|
+
this._slotBucket = {
|
|
120062
|
+
stamp: this._slotStamp,
|
|
120063
|
+
nodes: nodes,
|
|
120064
|
+
primary: nodes.slice(0, primaryCount),
|
|
120065
|
+
overflow: nodes.slice(primaryCount)
|
|
120066
|
+
};
|
|
120067
|
+
return this._slotBucket;
|
|
120068
|
+
},
|
|
120069
|
+
primarySlotNodes: function primarySlotNodes() {
|
|
120070
|
+
return this.ensureSlotBucket().primary;
|
|
120071
|
+
},
|
|
120072
|
+
overflowSlotNodes: function overflowSlotNodes() {
|
|
120073
|
+
return this.ensureSlotBucket().overflow;
|
|
120074
|
+
},
|
|
120075
|
+
/** searchCondition 进入首行的起点:插槽项先占用 visibleCount */conditionSplitIndex: function conditionSplitIndex() {
|
|
120076
|
+
return Math.max(0, this.visibleCount - this.ensureSlotBucket().nodes.length);
|
|
120077
|
+
},
|
|
120078
|
+
primaryConditionList: function primaryConditionList() {
|
|
120079
|
+
return this.orderedConditions.slice(0, this.conditionSplitIndex());
|
|
120080
|
+
},
|
|
120081
|
+
overflowConditionList: function overflowConditionList() {
|
|
120082
|
+
return this.orderedConditions.slice(this.conditionSplitIndex());
|
|
120083
|
+
},
|
|
120084
|
+
hasOverflow: function hasOverflow() {
|
|
120085
|
+
return this.overflowSlotNodes().length > 0 || this.overflowConditionList().length > 0;
|
|
120086
|
+
},
|
|
120087
|
+
/** 未进首行的区域是否展开。高级查询时自定义项改放到弹窗,这里不展开 */secondaryOpen: function secondaryOpen() {
|
|
120088
|
+
if (!this.hasOverflow()) return false;
|
|
120089
|
+
if (this.showAdvancedQuery) return false;
|
|
120090
|
+
return this.showExpand ? this.expanded : true;
|
|
120091
|
+
},
|
|
120092
|
+
/** 未进首行且已填写的配置项数量(用于“更多 (n)”角标) */overflowActiveCount: function overflowActiveCount() {
|
|
120093
|
+
var _this8 = this;
|
|
120094
|
+
return this.overflowConditionList().filter(function (cond) {
|
|
120095
|
+
return _this8.hasValue(cond);
|
|
120096
|
+
}).length;
|
|
120097
|
+
},
|
|
120098
|
+
/**
|
|
120099
|
+
* 按当前行宽计算首行条数和弹性项宽度。
|
|
120100
|
+
* 先按“不显示更多/高级查询按钮”试装,装得下则全部留在首行;
|
|
120101
|
+
* 装不下再扣掉该按钮宽度重算,避免按钮显隐来回跳动。
|
|
120102
|
+
*/
|
|
120103
|
+
measureVisibleCount: function measureVisibleCount() {
|
|
120104
|
+
var _this9 = this;
|
|
120105
|
+
var row = this.$refs.filterRow;
|
|
120106
|
+
var actions = this.$refs.filterActions;
|
|
120107
|
+
if (!row || !actions) return;
|
|
120108
|
+
var rowWidth = row.clientWidth;
|
|
120109
|
+
if (rowWidth < 50) return;
|
|
120110
|
+
var ordered = this.orderedConditions;
|
|
120111
|
+
var slotNodes = this.readSlotNodes();
|
|
120112
|
+
var total = slotNodes.length + ordered.length;
|
|
120113
|
+
this._measuredSlotCount = slotNodes.length;
|
|
120114
|
+
if (!total) {
|
|
120115
|
+
if (this.visibleCount !== 0) this.visibleCount = 0;
|
|
120116
|
+
return;
|
|
120117
|
+
}
|
|
120118
|
+
var rowGap = this.readFlexGap(row);
|
|
120119
|
+
var actionsGap = this.readFlexGap(actions);
|
|
120120
|
+
var minItem = 175;
|
|
120121
|
+
var maxItem = 300;
|
|
120122
|
+
var moreEl = this.getOverflowButtonEl();
|
|
120123
|
+
var moreWidth = this._moreButtonWidth || (this.showAdvancedQuery ? 108 : 80);
|
|
120124
|
+
if (moreEl && moreEl.offsetWidth) {
|
|
120125
|
+
moreWidth = moreEl.offsetWidth;
|
|
120126
|
+
this._moreButtonWidth = moreWidth;
|
|
120127
|
+
}
|
|
120128
|
+
var moreVisible = !!(moreEl && moreEl.offsetWidth);
|
|
120129
|
+
var baseActions = actions.offsetWidth;
|
|
120130
|
+
if (moreVisible) baseActions -= moreWidth + actionsGap;
|
|
120131
|
+
if (baseActions < 0) baseActions = 0;
|
|
120132
|
+
var widthOf = function widthOf(item) {
|
|
120133
|
+
var parsed = _this9.parseItemPx(item && item.width);
|
|
120134
|
+
return parsed == null ? minItem : parsed;
|
|
120135
|
+
};
|
|
120136
|
+
var descriptors = slotNodes.map(function (node) {
|
|
120137
|
+
return node.componentOptions && node.componentOptions.propsData || {};
|
|
120138
|
+
}).concat(ordered);
|
|
120139
|
+
var minWidths = descriptors.map(widthOf);
|
|
120140
|
+
var fit = function fit(actionsW) {
|
|
120141
|
+
var used = 0;
|
|
120142
|
+
var count = 0;
|
|
120143
|
+
for (var i = 0; i < minWidths.length; i++) {
|
|
120144
|
+
var itemsWidth = used + minWidths[i];
|
|
120145
|
+
var _gaps = (i + 1) * rowGap;
|
|
120146
|
+
if (itemsWidth + _gaps + actionsW <= rowWidth - 1) {
|
|
120147
|
+
used = itemsWidth;
|
|
120148
|
+
count = i + 1;
|
|
120149
|
+
} else {
|
|
120150
|
+
break;
|
|
120151
|
+
}
|
|
120152
|
+
}
|
|
120153
|
+
if (!count) count = 1;
|
|
120154
|
+
return count;
|
|
120155
|
+
};
|
|
120156
|
+
var hideOverflow = this.showAdvancedQuery || this.showExpand;
|
|
120157
|
+
var count = fit(baseActions);
|
|
120158
|
+
if (hideOverflow && count < total) {
|
|
120159
|
+
count = fit(baseActions + moreWidth + actionsGap);
|
|
120160
|
+
}
|
|
120161
|
+
var limit = this.firstRowLimit;
|
|
120162
|
+
if (limit != null) count = Math.min(count, limit);
|
|
120163
|
+
count = Math.max(0, Math.min(count, total));
|
|
120164
|
+
var fixed = 0;
|
|
120165
|
+
var flexCount = 0;
|
|
120166
|
+
for (var i = 0; i < count; i++) {
|
|
120167
|
+
var parsed = this.parseItemPx(descriptors[i].width);
|
|
120168
|
+
var hasCustom = descriptors[i].width !== undefined && descriptors[i].width !== null && descriptors[i].width !== '';
|
|
120169
|
+
if (hasCustom && parsed != null) fixed += parsed;else if (hasCustom) fixed += minItem;else flexCount += 1;
|
|
120170
|
+
}
|
|
120171
|
+
var actionsUsed = baseActions + (hideOverflow && count < total ? moreWidth + actionsGap : 0);
|
|
120172
|
+
var gaps = count > 0 ? count * rowGap : 0;
|
|
120173
|
+
var shared = this.sharedItemWidth;
|
|
120174
|
+
if (flexCount > 0) {
|
|
120175
|
+
shared = Math.floor((rowWidth - actionsUsed - gaps - fixed) / flexCount);
|
|
120176
|
+
if (shared < minItem) shared = minItem;
|
|
120177
|
+
if (shared > maxItem) shared = maxItem;
|
|
120178
|
+
}
|
|
120179
|
+
if (this.visibleCount !== count) this.visibleCount = count;
|
|
120180
|
+
if (Math.abs((this.sharedItemWidth || 0) - shared) > 1) this.sharedItemWidth = shared;
|
|
120181
|
+
},
|
|
120182
|
+
/** 读取 flex 间距(column-gap / gap) */readFlexGap: function readFlexGap(el) {
|
|
120183
|
+
var style = window.getComputedStyle(el);
|
|
120184
|
+
var raw = style.columnGap && style.columnGap !== 'normal' ? style.columnGap : style.gap;
|
|
120185
|
+
var value = parseFloat(raw);
|
|
120186
|
+
return isNaN(value) ? 6 : value;
|
|
120187
|
+
},
|
|
120188
|
+
/** “更多”或“高级查询”按钮的根节点,用于扣减其占位宽度 */getOverflowButtonEl: function getOverflowButtonEl() {
|
|
120189
|
+
var more = this.$refs.moreButton;
|
|
120190
|
+
if (more && more.$el) return more.$el;
|
|
120191
|
+
var advanced = this.$refs.advancedQuery;
|
|
120192
|
+
if (advanced && advanced.$el) return advanced.$el;
|
|
120193
|
+
return null;
|
|
120194
|
+
},
|
|
119766
120195
|
/**
|
|
119767
120196
|
* 渲染前整体校验。
|
|
119768
120197
|
* 以下情况组件渲染失败,并在控制台输出详细错误:
|
|
119769
|
-
* 1.
|
|
119770
|
-
* 2.
|
|
119771
|
-
* 3. searchCondition
|
|
119772
|
-
* 4. searchCondition 中的必填项(label/value/type)未填
|
|
120198
|
+
* 1. 未传入查询事件对应的方法(@search)
|
|
120199
|
+
* 2. searchCondition 中的 value 在 searchVariable 中不存在
|
|
120200
|
+
* 3. searchCondition 中的必填项(label/value/type)未填
|
|
119773
120201
|
*/
|
|
119774
120202
|
validate: function validate() {
|
|
119775
|
-
var
|
|
120203
|
+
var _this0 = this;
|
|
119776
120204
|
var errors = [];
|
|
119777
120205
|
var searchBar = this.searchBar;
|
|
119778
120206
|
if (!searchBar || _typeof(searchBar) !== 'object') {
|
|
@@ -119785,15 +120213,6 @@ var FilterSearchItem = {
|
|
|
119785
120213
|
} else if (!searchVariable || _typeof(searchVariable) !== 'object' || Array.isArray(searchVariable)) {
|
|
119786
120214
|
errors.push('searchVariable 必须为非空对象');
|
|
119787
120215
|
} else {
|
|
119788
|
-
// 规则 1:主要条件数量校验(上限取 searchBar.mainConditionCount,默认 4)
|
|
119789
|
-
var mainList = searchCondition.filter(function (c) {
|
|
119790
|
-
return c && (c.isMain === 'Y' || c.isMain === true);
|
|
119791
|
-
});
|
|
119792
|
-
if (mainList.length > this.mainConditionCount) {
|
|
119793
|
-
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) {
|
|
119794
|
-
return c.label;
|
|
119795
|
-
}).join('、'), "\uFF09"));
|
|
119796
|
-
}
|
|
119797
120216
|
var validTypes = ['text', 'date', 'datetime', 'select', 'select-multi'];
|
|
119798
120217
|
var seenValues = {};
|
|
119799
120218
|
// 规则 3/4:逐条校验条件配置
|
|
@@ -119824,7 +120243,7 @@ var FilterSearchItem = {
|
|
|
119824
120243
|
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"));
|
|
119825
120244
|
}
|
|
119826
120245
|
// 非致命提醒 2:remote 传字符串但未在父组件中找到对应方法(仅警告)
|
|
119827
|
-
if (typeof cond.remote === 'string' && !
|
|
120246
|
+
if (typeof cond.remote === 'string' && !_this0.resolveRemoteFn(cond.remote)) {
|
|
119828
120247
|
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"));
|
|
119829
120248
|
}
|
|
119830
120249
|
// 非致命提醒 3:value 重复定义(仅警告)
|
|
@@ -119835,7 +120254,7 @@ var FilterSearchItem = {
|
|
|
119835
120254
|
});
|
|
119836
120255
|
}
|
|
119837
120256
|
}
|
|
119838
|
-
//
|
|
120257
|
+
// 查询事件校验
|
|
119839
120258
|
if (typeof this.$listeners.search !== 'function') {
|
|
119840
120259
|
errors.push('未传入查询事件对应的方法,请通过 @search 绑定查询方法');
|
|
119841
120260
|
}
|
|
@@ -119854,17 +120273,17 @@ var FilterSearchItem = {
|
|
|
119854
120273
|
this.$emit('search');
|
|
119855
120274
|
},
|
|
119856
120275
|
/** 重置:将所有筛选条件恢复为组件创建时刻的初始值 */onReset: function onReset() {
|
|
119857
|
-
var
|
|
120276
|
+
var _this1 = this;
|
|
119858
120277
|
var variable = this.searchBar && this.searchBar.searchVariable;
|
|
119859
120278
|
if (variable && this.initValues) {
|
|
119860
120279
|
Object.keys(this.initValues).forEach(function (key) {
|
|
119861
120280
|
// 使用 $set 保证新值具备响应式
|
|
119862
|
-
|
|
120281
|
+
_this1.$set(variable, key, _this1.deepCopy(_this1.initValues[key]));
|
|
119863
120282
|
});
|
|
119864
120283
|
// 多选下拉的值规范为数组,避免 Element UI 类型告警
|
|
119865
120284
|
this.conditions.forEach(function (cond) {
|
|
119866
120285
|
if (cond.type === 'select-multi' && !Array.isArray(variable[cond.value])) {
|
|
119867
|
-
|
|
120286
|
+
_this1.$set(variable, cond.value, []);
|
|
119868
120287
|
}
|
|
119869
120288
|
});
|
|
119870
120289
|
}
|
|
@@ -119904,19 +120323,19 @@ var FilterSearchItem = {
|
|
|
119904
120323
|
* 统一归一化为 [{ label, value }] 后缓存。
|
|
119905
120324
|
*/
|
|
119906
120325
|
loadRemoteOptions: function loadRemoteOptions(cond, keyword) {
|
|
119907
|
-
var
|
|
120326
|
+
var _this10 = this;
|
|
119908
120327
|
var fn = this.resolveRemoteFn(cond.remote);
|
|
119909
120328
|
if (!fn) return Promise.resolve([]);
|
|
119910
120329
|
this.$set(this.remoteLoading, cond.value, true);
|
|
119911
120330
|
return Promise.resolve(fn(keyword == null ? '' : keyword)).then(function (res) {
|
|
119912
|
-
var options =
|
|
119913
|
-
|
|
120331
|
+
var options = _this10.normalizeOptions(_this10.extractOptions(res), cond);
|
|
120332
|
+
_this10.$set(_this10.remoteOptions, cond.value, options);
|
|
119914
120333
|
return options;
|
|
119915
120334
|
})["catch"](function (err) {
|
|
119916
120335
|
console.error("[StandardFilterbar] \u7B5B\u9009\u6761\u4EF6\u201C".concat(cond.label, "\u201D\u8FDC\u7A0B\u6570\u636E\u52A0\u8F7D\u5931\u8D25"), err);
|
|
119917
120336
|
return [];
|
|
119918
120337
|
})["finally"](function () {
|
|
119919
|
-
|
|
120338
|
+
_this10.$set(_this10.remoteLoading, cond.value, false);
|
|
119920
120339
|
});
|
|
119921
120340
|
},
|
|
119922
120341
|
/** 从远程方法返回值中提取选项数组(兼容多种返回结构) */extractOptions: function extractOptions(res) {
|
|
@@ -119972,9 +120391,7 @@ var FilterSearchItem = {
|
|
|
119972
120391
|
return val !== undefined && val !== null && String(val) !== '';
|
|
119973
120392
|
},
|
|
119974
120393
|
/**
|
|
119975
|
-
*
|
|
119976
|
-
* 日期/时间选择框统一复用全局 normal-report.scss 中的 normal-report-filter-item-date 公共类,
|
|
119977
|
-
* 与项目内其它页面(如 inspectQuery)保持一致的 170px 宽度,组件内不再自定义宽度样式
|
|
120394
|
+
* 日期/时间条件附加公共类。宽度与其它条件相同,由首行测量结果在 175–300px 之间写入。
|
|
119978
120395
|
*/
|
|
119979
120396
|
itemClass: function itemClass(cond) {
|
|
119980
120397
|
if (cond.type === 'date' || cond.type === 'datetime') return 'normal-report-filter-item-date';
|
|
@@ -119987,24 +120404,30 @@ var FilterSearchItem = {
|
|
|
119987
120404
|
var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
|
|
119988
120405
|
var timer = null;
|
|
119989
120406
|
return function () {
|
|
119990
|
-
var
|
|
120407
|
+
var _this11 = this;
|
|
119991
120408
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
119992
120409
|
args[_key] = arguments[_key];
|
|
119993
120410
|
}
|
|
119994
120411
|
if (timer) clearTimeout(timer);
|
|
119995
120412
|
timer = setTimeout(function () {
|
|
119996
120413
|
timer = null;
|
|
119997
|
-
fn.apply(
|
|
120414
|
+
fn.apply(_this11, args);
|
|
119998
120415
|
}, delay);
|
|
119999
120416
|
};
|
|
120000
120417
|
}
|
|
120001
120418
|
}
|
|
120002
|
-
}
|
|
120419
|
+
};
|
|
120420
|
+
StandardFilterbar.Item = Item;
|
|
120421
|
+
StandardFilterbar.install = function (Vue) {
|
|
120422
|
+
Vue.component(StandardFilterbar.name, StandardFilterbar);
|
|
120423
|
+
Vue.component(Item.name, Item);
|
|
120424
|
+
};
|
|
120425
|
+
/* harmony default export */ const StandardFilterbarvue_type_script_lang_js = (StandardFilterbar);
|
|
120003
120426
|
;// ./src/components/StandardFilterbar/index.vue?vue&type=script&lang=js
|
|
120004
120427
|
/* harmony default export */ const components_StandardFilterbarvue_type_script_lang_js = (StandardFilterbarvue_type_script_lang_js);
|
|
120005
|
-
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.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=
|
|
120006
|
-
var
|
|
120007
|
-
;// ./src/components/StandardFilterbar/index.vue?vue&type=style&index=0&id=
|
|
120428
|
+
// EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.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
|
|
120429
|
+
var StandardFilterbarvue_type_style_index_0_id_042f1c58_prod_lang_scss = __webpack_require__(8365);
|
|
120430
|
+
;// ./src/components/StandardFilterbar/index.vue?vue&type=style&index=0&id=042f1c58&prod&lang=scss
|
|
120008
120431
|
|
|
120009
120432
|
;// ./src/components/StandardFilterbar/index.vue
|
|
120010
120433
|
|
|
@@ -120017,8 +120440,8 @@ var StandardFilterbarvue_type_style_index_0_id_a1e74ef8_prod_lang_scss = __webpa
|
|
|
120017
120440
|
|
|
120018
120441
|
var StandardFilterbar_component = normalizeComponent(
|
|
120019
120442
|
components_StandardFilterbarvue_type_script_lang_js,
|
|
120020
|
-
|
|
120021
|
-
|
|
120443
|
+
StandardFilterbarvue_type_template_id_042f1c58_render,
|
|
120444
|
+
StandardFilterbarvue_type_template_id_042f1c58_staticRenderFns,
|
|
120022
120445
|
false,
|
|
120023
120446
|
null,
|
|
120024
120447
|
null,
|
|
@@ -120026,7 +120449,7 @@ var StandardFilterbar_component = normalizeComponent(
|
|
|
120026
120449
|
|
|
120027
120450
|
)
|
|
120028
120451
|
|
|
120029
|
-
/* harmony default export */ const
|
|
120452
|
+
/* harmony default export */ const components_StandardFilterbar = (StandardFilterbar_component.exports);
|
|
120030
120453
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
|
|
120031
120454
|
var StandardFormvue_type_template_id_16c030ac_render = function render() {
|
|
120032
120455
|
var _vm = this,
|
|
@@ -120192,7 +120615,7 @@ var Itemvue_type_template_id_ccd7639c_staticRenderFns = [];
|
|
|
120192
120615
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardForm/Item.vue?vue&type=script&lang=js
|
|
120193
120616
|
// 注意:standard-form-item 的全部样式已统一在 ./StandardForm.scss 中
|
|
120194
120617
|
// (与父组件 StandardForm 共用同一份样式文件,避免重复注入)
|
|
120195
|
-
/* harmony default export */ const
|
|
120618
|
+
/* harmony default export */ const StandardForm_Itemvue_type_script_lang_js = ({
|
|
120196
120619
|
name: "StandardFormItem",
|
|
120197
120620
|
props: {
|
|
120198
120621
|
// 标签文案(参与 label-width 自动计算)
|
|
@@ -120250,7 +120673,7 @@ var Itemvue_type_template_id_ccd7639c_staticRenderFns = [];
|
|
|
120250
120673
|
}
|
|
120251
120674
|
});
|
|
120252
120675
|
;// ./src/components/StandardForm/Item.vue?vue&type=script&lang=js
|
|
120253
|
-
/* harmony default export */ const
|
|
120676
|
+
/* harmony default export */ const components_StandardForm_Itemvue_type_script_lang_js = (StandardForm_Itemvue_type_script_lang_js);
|
|
120254
120677
|
;// ./src/components/StandardForm/Item.vue
|
|
120255
120678
|
|
|
120256
120679
|
|
|
@@ -120259,8 +120682,8 @@ var Itemvue_type_template_id_ccd7639c_staticRenderFns = [];
|
|
|
120259
120682
|
|
|
120260
120683
|
/* normalize component */
|
|
120261
120684
|
;
|
|
120262
|
-
var
|
|
120263
|
-
|
|
120685
|
+
var StandardForm_Item_component = normalizeComponent(
|
|
120686
|
+
components_StandardForm_Itemvue_type_script_lang_js,
|
|
120264
120687
|
Itemvue_type_template_id_ccd7639c_render,
|
|
120265
120688
|
Itemvue_type_template_id_ccd7639c_staticRenderFns,
|
|
120266
120689
|
false,
|
|
@@ -120270,7 +120693,7 @@ var Item_component = normalizeComponent(
|
|
|
120270
120693
|
|
|
120271
120694
|
)
|
|
120272
120695
|
|
|
120273
|
-
/* harmony default export */ const
|
|
120696
|
+
/* harmony default export */ const StandardForm_Item = (StandardForm_Item_component.exports);
|
|
120274
120697
|
;// ./src/components/StandardForm/index.js
|
|
120275
120698
|
/**
|
|
120276
120699
|
* StandardForm 通用表单组件入口
|
|
@@ -120293,12 +120716,12 @@ var Item_component = normalizeComponent(
|
|
|
120293
120716
|
|
|
120294
120717
|
|
|
120295
120718
|
// 将子组件挂载为静态属性,方便引用方统一引入注册
|
|
120296
|
-
StandardForm.Item =
|
|
120719
|
+
StandardForm.Item = StandardForm_Item;
|
|
120297
120720
|
|
|
120298
120721
|
// 支持 Vue.use 全局注册
|
|
120299
120722
|
StandardForm.install = function (Vue) {
|
|
120300
120723
|
Vue.component(StandardForm.name, StandardForm);
|
|
120301
|
-
Vue.component(
|
|
120724
|
+
Vue.component(StandardForm_Item.name, StandardForm_Item);
|
|
120302
120725
|
};
|
|
120303
120726
|
/* harmony default export */ const components_StandardForm = (StandardForm);
|
|
120304
120727
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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
|
|
@@ -121099,8 +121522,8 @@ var StandardTimePick_component = normalizeComponent(
|
|
|
121099
121522
|
)
|
|
121100
121523
|
|
|
121101
121524
|
/* harmony default export */ const StandardTimePick = (StandardTimePick_component.exports);
|
|
121102
|
-
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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=
|
|
121103
|
-
var
|
|
121525
|
+
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.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=24e29a8b
|
|
121526
|
+
var StandardTablevue_type_template_id_24e29a8b_render = function render() {
|
|
121104
121527
|
var _vm = this,
|
|
121105
121528
|
_c = _vm._self._c;
|
|
121106
121529
|
return _c('section', {
|
|
@@ -121350,6 +121773,7 @@ var StandardTablevue_type_template_id_a9e9136a_render = function render() {
|
|
|
121350
121773
|
},
|
|
121351
121774
|
on: {
|
|
121352
121775
|
"menu-click": _vm.onMenuClick,
|
|
121776
|
+
"resizable-change": _vm.onColumnResizableChange,
|
|
121353
121777
|
"checkbox-change": _vm.handleCheckboxChange,
|
|
121354
121778
|
"checkbox-all": _vm.handleCheckboxChange,
|
|
121355
121779
|
"current-change": _vm.handleCurrentRowChange,
|
|
@@ -121379,7 +121803,7 @@ var StandardTablevue_type_template_id_a9e9136a_render = function render() {
|
|
|
121379
121803
|
"type": col.type,
|
|
121380
121804
|
"field": col.field,
|
|
121381
121805
|
"title": col.title,
|
|
121382
|
-
"width": col.isOp ? col.width : undefined,
|
|
121806
|
+
"width": col.isOp ? col.width : col.userWidth || undefined,
|
|
121383
121807
|
"min-width": col.minWidth,
|
|
121384
121808
|
"fixed": col.fixed,
|
|
121385
121809
|
"align": col.align,
|
|
@@ -121434,7 +121858,7 @@ var StandardTablevue_type_template_id_a9e9136a_render = function render() {
|
|
|
121434
121858
|
}
|
|
121435
121859
|
}) : _vm.getFooterEmptyVisible() ? _c('standard-footer-empty') : _vm._e()], 1);
|
|
121436
121860
|
};
|
|
121437
|
-
var
|
|
121861
|
+
var StandardTablevue_type_template_id_24e29a8b_staticRenderFns = [];
|
|
121438
121862
|
|
|
121439
121863
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/ToolbarEmpty.vue?vue&type=script&lang=js
|
|
121440
121864
|
/**
|
|
@@ -121521,6 +121945,467 @@ var FooterEmpty_component = normalizeComponent(
|
|
|
121521
121945
|
)
|
|
121522
121946
|
|
|
121523
121947
|
/* harmony default export */ const FooterEmpty = (FooterEmpty_component.exports);
|
|
121948
|
+
;// ./src/components/StandardTable/columnConfigApi.js
|
|
121949
|
+
/**
|
|
121950
|
+
* 表头配置接口。路径固定,请求方法由业务项目注入。
|
|
121951
|
+
* IP 和端口来自该请求方法自己的 baseURL,组件库不保存主机地址。
|
|
121952
|
+
*/
|
|
121953
|
+
var GET_CONFIG = '/api/SYS/UserTableColumn/GetUserTableConfig';
|
|
121954
|
+
var SAVE_CONFIG = '/api/SYS/UserTableColumn/SaveUserTableConfig';
|
|
121955
|
+
var RESET_CONFIG = '/api/SYS/UserTableColumn/ResetUserTableConfig';
|
|
121956
|
+
var columnConfigApi = null;
|
|
121957
|
+
var columnModuleCode = '';
|
|
121958
|
+
|
|
121959
|
+
// 同一模块、同一页面内 table-code 的占用者,用于发现重复编码
|
|
121960
|
+
var tableCodeOwners = Object.create(null);
|
|
121961
|
+
function setColumnConfigRequest(request) {
|
|
121962
|
+
if (typeof request !== 'function') {
|
|
121963
|
+
columnConfigApi = null;
|
|
121964
|
+
return;
|
|
121965
|
+
}
|
|
121966
|
+
columnConfigApi = {
|
|
121967
|
+
// 一次取当前用户的全部表头。表格渲染不调用它,由业务程序写入本地 TableSetting
|
|
121968
|
+
get: function get() {
|
|
121969
|
+
return request({
|
|
121970
|
+
url: GET_CONFIG,
|
|
121971
|
+
method: 'get'
|
|
121972
|
+
});
|
|
121973
|
+
},
|
|
121974
|
+
save: function save(moduleCode, pageCode, tableCode, columns) {
|
|
121975
|
+
return request({
|
|
121976
|
+
url: SAVE_CONFIG,
|
|
121977
|
+
method: 'post',
|
|
121978
|
+
data: {
|
|
121979
|
+
ModuleCode: moduleCode,
|
|
121980
|
+
PageCode: pageCode,
|
|
121981
|
+
TableCode: tableCode,
|
|
121982
|
+
SchemaVersion: 1,
|
|
121983
|
+
Columns: columns
|
|
121984
|
+
}
|
|
121985
|
+
});
|
|
121986
|
+
},
|
|
121987
|
+
reset: function reset(moduleCode, pageCode, tableCode) {
|
|
121988
|
+
return request({
|
|
121989
|
+
url: RESET_CONFIG,
|
|
121990
|
+
method: 'post',
|
|
121991
|
+
data: {
|
|
121992
|
+
ModuleCode: moduleCode,
|
|
121993
|
+
PageCode: pageCode,
|
|
121994
|
+
TableCode: tableCode
|
|
121995
|
+
}
|
|
121996
|
+
});
|
|
121997
|
+
}
|
|
121998
|
+
};
|
|
121999
|
+
}
|
|
122000
|
+
function getColumnConfigApi() {
|
|
122001
|
+
return columnConfigApi;
|
|
122002
|
+
}
|
|
122003
|
+
function setColumnModuleCode(code) {
|
|
122004
|
+
columnModuleCode = code != null ? String(code).trim() : '';
|
|
122005
|
+
}
|
|
122006
|
+
function getColumnModuleCode() {
|
|
122007
|
+
return columnModuleCode;
|
|
122008
|
+
}
|
|
122009
|
+
function tableCodeKey(moduleCode, pageCode, tableCode) {
|
|
122010
|
+
return moduleCode + '\n' + pageCode + '\n' + tableCode;
|
|
122011
|
+
}
|
|
122012
|
+
|
|
122013
|
+
// 登记表格编码。同一模块的同一页面已被其它表格占用时返回 false
|
|
122014
|
+
function claimTableCode(moduleCode, pageCode, tableCode, owner) {
|
|
122015
|
+
var key = tableCodeKey(moduleCode, pageCode, tableCode);
|
|
122016
|
+
var current = tableCodeOwners[key];
|
|
122017
|
+
if (current && current !== owner) return false;
|
|
122018
|
+
tableCodeOwners[key] = owner;
|
|
122019
|
+
return true;
|
|
122020
|
+
}
|
|
122021
|
+
function releaseTableCode(moduleCode, pageCode, tableCode, owner) {
|
|
122022
|
+
var key = tableCodeKey(moduleCode, pageCode, tableCode);
|
|
122023
|
+
if (tableCodeOwners[key] === owner) delete tableCodeOwners[key];
|
|
122024
|
+
}
|
|
122025
|
+
;// ./src/components/StandardTable/columnPersist.js
|
|
122026
|
+
function columnPersist_defineProperty(e, r, t) { return (r = columnPersist_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
122027
|
+
function columnPersist_toPropertyKey(t) { var i = columnPersist_toPrimitive(t, "string"); return "symbol" == columnPersist_typeof(i) ? i : i + ""; }
|
|
122028
|
+
function columnPersist_toPrimitive(t, r) { if ("object" != columnPersist_typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != columnPersist_typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
122029
|
+
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); }
|
|
122030
|
+
/**
|
|
122031
|
+
* 表头配置的列主键、合并和提交数据。
|
|
122032
|
+
* 持久化主键不能使用 Vue 的 _uid,每次进入页面都会变化。
|
|
122033
|
+
*/
|
|
122034
|
+
|
|
122035
|
+
// 列稳定主键:显式 column-key > field:字段名 > type:类型
|
|
122036
|
+
function resolveColumnKey(comp) {
|
|
122037
|
+
if (!comp) return '';
|
|
122038
|
+
var custom = comp.columnKey != null ? String(comp.columnKey).trim() : '';
|
|
122039
|
+
if (custom) return custom;
|
|
122040
|
+
if (comp.field) return 'field:' + comp.field;
|
|
122041
|
+
if (comp.type) return 'type:' + comp.type;
|
|
122042
|
+
return '';
|
|
122043
|
+
}
|
|
122044
|
+
|
|
122045
|
+
// 同一张表里主键重复时返回该主键,否则返回空串
|
|
122046
|
+
function findDuplicateColumnKey(comps) {
|
|
122047
|
+
var seen = Object.create(null);
|
|
122048
|
+
var list = Array.isArray(comps) ? comps : [];
|
|
122049
|
+
for (var i = 0; i < list.length; i++) {
|
|
122050
|
+
var key = resolveColumnKey(list[i]);
|
|
122051
|
+
if (!key) continue;
|
|
122052
|
+
if (seen[key]) return key;
|
|
122053
|
+
seen[key] = true;
|
|
122054
|
+
}
|
|
122055
|
+
return '';
|
|
122056
|
+
}
|
|
122057
|
+
|
|
122058
|
+
// 接口字段与 C# 属性名一致。已保存的小写字段仍可读。
|
|
122059
|
+
function readSavedColumn(item) {
|
|
122060
|
+
if (!item || columnPersist_typeof(item) !== 'object') return null;
|
|
122061
|
+
var columnKey = item.ColumnKey != null ? item.ColumnKey : item.columnKey;
|
|
122062
|
+
if (columnKey == null || String(columnKey).trim() === '') return null;
|
|
122063
|
+
return {
|
|
122064
|
+
columnKey: String(columnKey).trim(),
|
|
122065
|
+
sortNo: item.SortNo != null ? item.SortNo : item.sortNo,
|
|
122066
|
+
visible: item.Visible != null ? item.Visible : item.visible,
|
|
122067
|
+
fixed: item.Fixed != null ? item.Fixed : item.fixed,
|
|
122068
|
+
minWidth: item.MinWidth !== undefined ? item.MinWidth : item.minWidth,
|
|
122069
|
+
width: item.Width !== undefined ? item.Width : item.width,
|
|
122070
|
+
sortable: item.Sortable !== undefined ? item.Sortable : item.sortable
|
|
122071
|
+
};
|
|
122072
|
+
}
|
|
122073
|
+
function savedFixed(value) {
|
|
122074
|
+
return value === 'left' || value === 'right' ? value : '';
|
|
122075
|
+
}
|
|
122076
|
+
function savedMinWidth(value) {
|
|
122077
|
+
var width = Number(value);
|
|
122078
|
+
if (value == null || value === '' || !(width >= 1) || width > 500) return null;
|
|
122079
|
+
return Math.round(width);
|
|
122080
|
+
}
|
|
122081
|
+
function savedWidth(value) {
|
|
122082
|
+
var width = Number(value);
|
|
122083
|
+
if (value == null || value === '' || !(width >= 60) || width > 2000) return null;
|
|
122084
|
+
return Math.round(width);
|
|
122085
|
+
}
|
|
122086
|
+
|
|
122087
|
+
/**
|
|
122088
|
+
* 用当前代码列做主数据,把已保存列覆盖上去。
|
|
122089
|
+
* 新增列贴在代码声明顺序里、它前面最近一个仍存在的已保存列之后。
|
|
122090
|
+
* 返回 { order, states }。states 只包含命中的已保存列,新增列沿用注册时的默认状态。
|
|
122091
|
+
*/
|
|
122092
|
+
function mergeColumnConfig(comps, savedColumns) {
|
|
122093
|
+
var list = Array.isArray(comps) ? comps.filter(Boolean) : [];
|
|
122094
|
+
var keyed = [];
|
|
122095
|
+
var unkeyed = [];
|
|
122096
|
+
list.forEach(function (comp) {
|
|
122097
|
+
var key = resolveColumnKey(comp);
|
|
122098
|
+
if (!key) unkeyed.push(comp);else keyed.push({
|
|
122099
|
+
comp: comp,
|
|
122100
|
+
key: key,
|
|
122101
|
+
uid: comp._uid
|
|
122102
|
+
});
|
|
122103
|
+
});
|
|
122104
|
+
var saved = (Array.isArray(savedColumns) ? savedColumns : []).map(readSavedColumn).filter(Boolean);
|
|
122105
|
+
if (!saved.length) return null;
|
|
122106
|
+
var codeMap = Object.create(null);
|
|
122107
|
+
keyed.forEach(function (item) {
|
|
122108
|
+
codeMap[item.key] = item;
|
|
122109
|
+
});
|
|
122110
|
+
var baseline = saved.filter(function (item) {
|
|
122111
|
+
return codeMap[item.columnKey];
|
|
122112
|
+
}).slice().sort(function (a, b) {
|
|
122113
|
+
return (Number(a.sortNo) || 0) - (Number(b.sortNo) || 0);
|
|
122114
|
+
}).map(function (item) {
|
|
122115
|
+
return {
|
|
122116
|
+
entry: codeMap[item.columnKey],
|
|
122117
|
+
saved: item
|
|
122118
|
+
};
|
|
122119
|
+
});
|
|
122120
|
+
var seen = Object.create(null);
|
|
122121
|
+
var rows = [];
|
|
122122
|
+
baseline.forEach(function (row) {
|
|
122123
|
+
if (seen[row.entry.key]) return;
|
|
122124
|
+
seen[row.entry.key] = true;
|
|
122125
|
+
rows.push(row);
|
|
122126
|
+
});
|
|
122127
|
+
keyed.forEach(function (codeCol, codeIndex) {
|
|
122128
|
+
if (seen[codeCol.key]) return;
|
|
122129
|
+
var insertAt = rows.length;
|
|
122130
|
+
var found = false;
|
|
122131
|
+
var _loop = function _loop(i) {
|
|
122132
|
+
var pos = rows.findIndex(function (row) {
|
|
122133
|
+
return row.entry.key === keyed[i].key;
|
|
122134
|
+
});
|
|
122135
|
+
if (pos >= 0) {
|
|
122136
|
+
insertAt = pos + 1;
|
|
122137
|
+
found = true;
|
|
122138
|
+
return 1; // break
|
|
122139
|
+
}
|
|
122140
|
+
};
|
|
122141
|
+
for (var i = codeIndex - 1; i >= 0; i--) {
|
|
122142
|
+
if (_loop(i)) break;
|
|
122143
|
+
}
|
|
122144
|
+
if (!found) {
|
|
122145
|
+
var _loop2 = function _loop2(_i) {
|
|
122146
|
+
var pos = rows.findIndex(function (row) {
|
|
122147
|
+
return row.entry.key === keyed[_i].key;
|
|
122148
|
+
});
|
|
122149
|
+
if (pos >= 0) {
|
|
122150
|
+
insertAt = pos;
|
|
122151
|
+
return 1; // break
|
|
122152
|
+
}
|
|
122153
|
+
};
|
|
122154
|
+
for (var _i = codeIndex + 1; _i < keyed.length; _i++) {
|
|
122155
|
+
if (_loop2(_i)) break;
|
|
122156
|
+
}
|
|
122157
|
+
}
|
|
122158
|
+
rows.splice(insertAt, 0, {
|
|
122159
|
+
entry: codeCol,
|
|
122160
|
+
saved: null
|
|
122161
|
+
});
|
|
122162
|
+
seen[codeCol.key] = true;
|
|
122163
|
+
});
|
|
122164
|
+
var order = rows.map(function (row) {
|
|
122165
|
+
return row.entry.uid;
|
|
122166
|
+
});
|
|
122167
|
+
unkeyed.forEach(function (comp) {
|
|
122168
|
+
return order.push(comp._uid);
|
|
122169
|
+
});
|
|
122170
|
+
var states = [];
|
|
122171
|
+
rows.forEach(function (row) {
|
|
122172
|
+
if (!row.saved) return;
|
|
122173
|
+
var comp = row.entry.comp;
|
|
122174
|
+
states.push({
|
|
122175
|
+
uid: row.entry.uid,
|
|
122176
|
+
state: {
|
|
122177
|
+
visible: row.saved.visible !== false,
|
|
122178
|
+
fixed: savedFixed(row.saved.fixed),
|
|
122179
|
+
minWidth: savedMinWidth(row.saved.minWidth),
|
|
122180
|
+
width: savedWidth(row.saved.width),
|
|
122181
|
+
sortable: row.saved.sortable != null ? !!row.saved.sortable : !!comp.sortable
|
|
122182
|
+
}
|
|
122183
|
+
});
|
|
122184
|
+
});
|
|
122185
|
+
return {
|
|
122186
|
+
order: order,
|
|
122187
|
+
states: states
|
|
122188
|
+
};
|
|
122189
|
+
}
|
|
122190
|
+
|
|
122191
|
+
// 提交给保存接口的列数组。顺序按当前 columnOrder,sortNo 从 0 连续编号
|
|
122192
|
+
function buildColumnPayload(comps, order, states) {
|
|
122193
|
+
var map = Object.create(null);
|
|
122194
|
+
(Array.isArray(comps) ? comps : []).forEach(function (comp) {
|
|
122195
|
+
if (comp) map[comp._uid] = comp;
|
|
122196
|
+
});
|
|
122197
|
+
var columns = [];
|
|
122198
|
+
(Array.isArray(order) ? order : []).forEach(function (uid) {
|
|
122199
|
+
var comp = map[uid];
|
|
122200
|
+
if (!comp) return;
|
|
122201
|
+
var key = resolveColumnKey(comp);
|
|
122202
|
+
if (!key) return;
|
|
122203
|
+
var st = states && states[uid] ? states[uid] : {};
|
|
122204
|
+
columns.push({
|
|
122205
|
+
ColumnKey: key,
|
|
122206
|
+
SortNo: columns.length,
|
|
122207
|
+
Visible: st.visible !== false,
|
|
122208
|
+
Fixed: savedFixed(st.fixed),
|
|
122209
|
+
MinWidth: savedMinWidth(st.minWidth),
|
|
122210
|
+
Width: savedWidth(st.width),
|
|
122211
|
+
Sortable: !!st.sortable
|
|
122212
|
+
});
|
|
122213
|
+
});
|
|
122214
|
+
return columns;
|
|
122215
|
+
}
|
|
122216
|
+
|
|
122217
|
+
// 与代码声明完全一致时走删除接口,避免把当时的默认值冻住
|
|
122218
|
+
function isDefaultColumnPayload(comps, columns) {
|
|
122219
|
+
var keyed = (Array.isArray(comps) ? comps : []).filter(function (comp) {
|
|
122220
|
+
return resolveColumnKey(comp);
|
|
122221
|
+
});
|
|
122222
|
+
if (!Array.isArray(columns) || keyed.length !== columns.length) return false;
|
|
122223
|
+
for (var i = 0; i < keyed.length; i++) {
|
|
122224
|
+
var comp = keyed[i];
|
|
122225
|
+
var col = columns[i];
|
|
122226
|
+
if (!col || col.ColumnKey !== resolveColumnKey(comp)) return false;
|
|
122227
|
+
if (col.Visible !== true) return false;
|
|
122228
|
+
if ((col.Fixed || '') !== (comp.fixed || '')) return false;
|
|
122229
|
+
if (!!col.Sortable !== !!comp.sortable) return false;
|
|
122230
|
+
if (col.Width != null) return false;
|
|
122231
|
+
if (col.MinWidth != null && Number(col.MinWidth) !== Number(comp.resolvedMinWidth)) return false;
|
|
122232
|
+
}
|
|
122233
|
+
return true;
|
|
122234
|
+
}
|
|
122235
|
+
|
|
122236
|
+
// 从 Datas 取出列数组。字段名优先用属性名 Columns,兼容 columns。
|
|
122237
|
+
function readSavedColumns(datas) {
|
|
122238
|
+
if (!datas || columnPersist_typeof(datas) !== 'object') return null;
|
|
122239
|
+
var columns = datas.Columns != null ? datas.Columns : datas.columns;
|
|
122240
|
+
if (!Array.isArray(columns)) return null;
|
|
122241
|
+
return columns.map(readSavedColumn).filter(Boolean);
|
|
122242
|
+
}
|
|
122243
|
+
|
|
122244
|
+
// 业务项目 axios 拦截器返回 { code, data: { Success, Content, Datas } }
|
|
122245
|
+
function readColumnConfigDatas(res) {
|
|
122246
|
+
if (res && res.code == 200 && res.data) {
|
|
122247
|
+
if (!res.data.Success) throw new Error(res.data.Content || '表头配置请求失败');
|
|
122248
|
+
return res.data.Datas == null ? null : res.data.Datas;
|
|
122249
|
+
}
|
|
122250
|
+
if (res && res.Success) return res.Datas == null ? null : res.Datas;
|
|
122251
|
+
var content = res && res.data && res.data.Content;
|
|
122252
|
+
throw new Error(content || '表头配置请求失败');
|
|
122253
|
+
}
|
|
122254
|
+
|
|
122255
|
+
// 其它程序把 GetConfig 的响应写入 localStorage.TableSetting。键为「模块/页面/表格」,值为 CLAYOUT 原文。
|
|
122256
|
+
var TABLE_SETTING_STORE = 'TableSetting';
|
|
122257
|
+
function buildColumnSettingKey(moduleCode, pageCode, tableCode) {
|
|
122258
|
+
return moduleCode + '/' + pageCode + '/' + tableCode;
|
|
122259
|
+
}
|
|
122260
|
+
function readTableSettingRoot() {
|
|
122261
|
+
if (typeof window === 'undefined' || !window.localStorage) return {
|
|
122262
|
+
missing: true
|
|
122263
|
+
};
|
|
122264
|
+
try {
|
|
122265
|
+
var raw = window.localStorage.getItem(TABLE_SETTING_STORE);
|
|
122266
|
+
if (raw == null || raw === '') return {
|
|
122267
|
+
missing: true
|
|
122268
|
+
};
|
|
122269
|
+
var root = JSON.parse(raw);
|
|
122270
|
+
// 个别调用方会把已经 stringify 过的响应再存一次
|
|
122271
|
+
if (typeof root === 'string') root = JSON.parse(root);
|
|
122272
|
+
return {
|
|
122273
|
+
missing: false,
|
|
122274
|
+
root: root
|
|
122275
|
+
};
|
|
122276
|
+
} catch (e) {
|
|
122277
|
+
console.warn('[StandardTable] TableSetting 解析失败');
|
|
122278
|
+
return {
|
|
122279
|
+
invalid: true
|
|
122280
|
+
};
|
|
122281
|
+
}
|
|
122282
|
+
}
|
|
122283
|
+
function writeTableSettingRoot(root) {
|
|
122284
|
+
window.localStorage.setItem(TABLE_SETTING_STORE, JSON.stringify(root));
|
|
122285
|
+
}
|
|
122286
|
+
|
|
122287
|
+
// 响应可能整包存入,也可能只存 Datas。沿 code/data/Datas 找到字典数组。
|
|
122288
|
+
function findLayoutArray(node, depth) {
|
|
122289
|
+
if (depth > 5 || node == null) return null;
|
|
122290
|
+
if (Array.isArray(node)) {
|
|
122291
|
+
if (!node.length || node.every(function (item) {
|
|
122292
|
+
return item && columnPersist_typeof(item) === 'object' && !Array.isArray(item);
|
|
122293
|
+
})) return node;
|
|
122294
|
+
return null;
|
|
122295
|
+
}
|
|
122296
|
+
if (columnPersist_typeof(node) !== 'object') return null;
|
|
122297
|
+
var fields = ['Datas', 'datas', 'data'];
|
|
122298
|
+
for (var i = 0; i < fields.length; i++) {
|
|
122299
|
+
if (!Object.prototype.hasOwnProperty.call(node, fields[i])) continue;
|
|
122300
|
+
var found = findLayoutArray(node[fields[i]], depth + 1);
|
|
122301
|
+
if (found) return found;
|
|
122302
|
+
}
|
|
122303
|
+
return null;
|
|
122304
|
+
}
|
|
122305
|
+
function isFlatLayoutMap(node) {
|
|
122306
|
+
if (!node || columnPersist_typeof(node) !== 'object' || Array.isArray(node)) return false;
|
|
122307
|
+
return Object.keys(node).some(function (key) {
|
|
122308
|
+
return key.indexOf('/') >= 0;
|
|
122309
|
+
});
|
|
122310
|
+
}
|
|
122311
|
+
|
|
122312
|
+
// Datas 为 null 的成功响应,补一个空数组后再写入,避免改掉外层结构
|
|
122313
|
+
function ensureLayoutArray(root) {
|
|
122314
|
+
var list = findLayoutArray(root, 0);
|
|
122315
|
+
if (list) return list;
|
|
122316
|
+
if (!root || columnPersist_typeof(root) !== 'object' || Array.isArray(root)) return null;
|
|
122317
|
+
var holder = root.data && columnPersist_typeof(root.data) === 'object' && !Array.isArray(root.data) && ('Datas' in root.data || 'datas' in root.data || 'Success' in root.data) ? root.data : 'Datas' in root || 'Success' in root ? root : null;
|
|
122318
|
+
if (!holder) return null;
|
|
122319
|
+
var field = 'datas' in holder && !('Datas' in holder) ? 'datas' : 'Datas';
|
|
122320
|
+
holder[field] = [];
|
|
122321
|
+
return holder[field];
|
|
122322
|
+
}
|
|
122323
|
+
|
|
122324
|
+
// CLAYOUT 是列数组的 JSON 字符串。兼容已解析的数组,以及旧的 { Columns } 结构。
|
|
122325
|
+
function parseLayoutColumns(value) {
|
|
122326
|
+
var data = value;
|
|
122327
|
+
for (var i = 0; i < 2 && typeof data === 'string'; i++) {
|
|
122328
|
+
var text = data.trim();
|
|
122329
|
+
if (!text) return null;
|
|
122330
|
+
try {
|
|
122331
|
+
data = JSON.parse(text);
|
|
122332
|
+
} catch (e) {
|
|
122333
|
+
return null;
|
|
122334
|
+
}
|
|
122335
|
+
}
|
|
122336
|
+
if (Array.isArray(data)) return data;
|
|
122337
|
+
if (data && columnPersist_typeof(data) === 'object') {
|
|
122338
|
+
var columns = data.Columns != null ? data.Columns : data.columns;
|
|
122339
|
+
if (Array.isArray(columns)) return columns;
|
|
122340
|
+
}
|
|
122341
|
+
return null;
|
|
122342
|
+
}
|
|
122343
|
+
function layoutJson(columns) {
|
|
122344
|
+
return JSON.stringify(Array.isArray(columns) ? columns : []);
|
|
122345
|
+
}
|
|
122346
|
+
function readCachedColumnLayout(moduleCode, pageCode, tableCode) {
|
|
122347
|
+
var stored = readTableSettingRoot();
|
|
122348
|
+
if (stored.missing || stored.invalid) return null;
|
|
122349
|
+
var key = buildColumnSettingKey(moduleCode, pageCode, tableCode);
|
|
122350
|
+
var list = findLayoutArray(stored.root, 0);
|
|
122351
|
+
if (list) {
|
|
122352
|
+
for (var i = list.length - 1; i >= 0; i--) {
|
|
122353
|
+
var item = list[i];
|
|
122354
|
+
if (item && Object.prototype.hasOwnProperty.call(item, key)) return parseLayoutColumns(item[key]);
|
|
122355
|
+
}
|
|
122356
|
+
return null;
|
|
122357
|
+
}
|
|
122358
|
+
if (isFlatLayoutMap(stored.root) && Object.prototype.hasOwnProperty.call(stored.root, key)) {
|
|
122359
|
+
return parseLayoutColumns(stored.root[key]);
|
|
122360
|
+
}
|
|
122361
|
+
return null;
|
|
122362
|
+
}
|
|
122363
|
+
function updateCachedColumnLayout(moduleCode, pageCode, tableCode, columns) {
|
|
122364
|
+
var key = buildColumnSettingKey(moduleCode, pageCode, tableCode);
|
|
122365
|
+
var value = layoutJson(columns);
|
|
122366
|
+
var stored = readTableSettingRoot();
|
|
122367
|
+
if (stored.invalid) return;
|
|
122368
|
+
if (stored.missing) {
|
|
122369
|
+
writeTableSettingRoot([columnPersist_defineProperty({}, key, value)]);
|
|
122370
|
+
return;
|
|
122371
|
+
}
|
|
122372
|
+
var list = ensureLayoutArray(stored.root);
|
|
122373
|
+
if (list) {
|
|
122374
|
+
var hit = null;
|
|
122375
|
+
for (var i = 0; i < list.length; i++) {
|
|
122376
|
+
if (list[i] && Object.prototype.hasOwnProperty.call(list[i], key)) hit = list[i];
|
|
122377
|
+
}
|
|
122378
|
+
if (hit) hit[key] = value;else list.push(columnPersist_defineProperty({}, key, value));
|
|
122379
|
+
writeTableSettingRoot(stored.root);
|
|
122380
|
+
return;
|
|
122381
|
+
}
|
|
122382
|
+
if (isFlatLayoutMap(stored.root)) {
|
|
122383
|
+
stored.root[key] = value;
|
|
122384
|
+
writeTableSettingRoot(stored.root);
|
|
122385
|
+
return;
|
|
122386
|
+
}
|
|
122387
|
+
console.warn('[StandardTable] TableSetting 结构无法识别,未更新本地表头配置');
|
|
122388
|
+
}
|
|
122389
|
+
function removeCachedColumnLayout(moduleCode, pageCode, tableCode) {
|
|
122390
|
+
var key = buildColumnSettingKey(moduleCode, pageCode, tableCode);
|
|
122391
|
+
var stored = readTableSettingRoot();
|
|
122392
|
+
if (stored.missing || stored.invalid) return;
|
|
122393
|
+
var list = findLayoutArray(stored.root, 0);
|
|
122394
|
+
if (list) {
|
|
122395
|
+
for (var i = list.length - 1; i >= 0; i--) {
|
|
122396
|
+
var item = list[i];
|
|
122397
|
+
if (!item || !Object.prototype.hasOwnProperty.call(item, key)) continue;
|
|
122398
|
+
delete item[key];
|
|
122399
|
+
if (!Object.keys(item).length) list.splice(i, 1);
|
|
122400
|
+
}
|
|
122401
|
+
writeTableSettingRoot(stored.root);
|
|
122402
|
+
return;
|
|
122403
|
+
}
|
|
122404
|
+
if (isFlatLayoutMap(stored.root) && Object.prototype.hasOwnProperty.call(stored.root, key)) {
|
|
122405
|
+
delete stored.root[key];
|
|
122406
|
+
writeTableSettingRoot(stored.root);
|
|
122407
|
+
}
|
|
122408
|
+
}
|
|
121524
122409
|
;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-40.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/index.vue?vue&type=script&lang=js
|
|
121525
122410
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || StandardTablevue_type_script_lang_js_unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
121526
122411
|
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."); }
|
|
@@ -121535,6 +122420,8 @@ function StandardTablevue_type_script_lang_js_arrayLikeToArray(r, a) { (null ==
|
|
|
121535
122420
|
;
|
|
121536
122421
|
|
|
121537
122422
|
|
|
122423
|
+
|
|
122424
|
+
|
|
121538
122425
|
// 将单元格渲染结果归一化为 VNode:
|
|
121539
122426
|
// Vue 2 函数式组件只接受 VNode / VNode 数组作为渲染结果,
|
|
121540
122427
|
// 纯字符串、数字等原始值会被直接丢弃(表现为空白单元格),
|
|
@@ -121711,10 +122598,10 @@ var NormalReportSlotView = {
|
|
|
121711
122598
|
type: Boolean,
|
|
121712
122599
|
"default": false
|
|
121713
122600
|
},
|
|
121714
|
-
//
|
|
122601
|
+
// 是否显示表格右上角“调整”按钮(列设置弹层),默认显示;传 false 隐藏
|
|
121715
122602
|
showAdjustment: {
|
|
121716
122603
|
type: Boolean,
|
|
121717
|
-
"default":
|
|
122604
|
+
"default": true
|
|
121718
122605
|
},
|
|
121719
122606
|
// 是否显示表格左下方“数据更新时间”
|
|
121720
122607
|
showUpdateTime: {
|
|
@@ -121751,6 +122638,17 @@ var NormalReportSlotView = {
|
|
|
121751
122638
|
showFooter: {
|
|
121752
122639
|
type: Boolean,
|
|
121753
122640
|
"default": false
|
|
122641
|
+
},
|
|
122642
|
+
// 表格编码。按「当前登录用户 + 模块 + 页面 + 表格」读写表头配置,同一页面内必须唯一。
|
|
122643
|
+
// 未传时使用组件 ref;ref 也没有时不访问服务端
|
|
122644
|
+
tableCode: {
|
|
122645
|
+
type: String,
|
|
122646
|
+
"default": ''
|
|
122647
|
+
},
|
|
122648
|
+
// 页面编码。不传时使用当前路由 name;没有 name 时使用不含查询参数的 path
|
|
122649
|
+
pageCode: {
|
|
122650
|
+
type: String,
|
|
122651
|
+
"default": ''
|
|
121754
122652
|
}
|
|
121755
122653
|
},
|
|
121756
122654
|
data: function data() {
|
|
@@ -121822,7 +122720,14 @@ var NormalReportSlotView = {
|
|
|
121822
122720
|
// 尺寸变化防抖定时器
|
|
121823
122721
|
// 首屏先让 standard-column 在 created 中注册完,再渲染 vxe-column。
|
|
121824
122722
|
// 否则第一次往往只有操作列,vxe-table 会固化它的插槽,随后数据列插入后操作列变空白
|
|
121825
|
-
columnsReady: false
|
|
122723
|
+
columnsReady: false,
|
|
122724
|
+
// 表头配置已完成首次加载后才允许写回,避免加载过程中的默认状态覆盖服务端
|
|
122725
|
+
columnConfigReady: false,
|
|
122726
|
+
columnConfigDisabled: false,
|
|
122727
|
+
columnConfigDirty: false,
|
|
122728
|
+
columnConfigSettled: false,
|
|
122729
|
+
columnConfigTimer: null,
|
|
122730
|
+
columnConfigSaveTimer: null
|
|
121826
122731
|
};
|
|
121827
122732
|
},
|
|
121828
122733
|
computed: {
|
|
@@ -121830,13 +122735,9 @@ var NormalReportSlotView = {
|
|
|
121830
122735
|
hasFooterLeftSlot: function hasFooterLeftSlot() {
|
|
121831
122736
|
return !!(this.$slots['footer-left'] || this.$scopedSlots['footer-left']);
|
|
121832
122737
|
},
|
|
121833
|
-
//
|
|
121834
|
-
// 或 toolbar-right 子组件 show-adjustment 属性(任一为 true 即显示)
|
|
122738
|
+
// 是否显示“调整”列设置按钮,由主组件 show-adjustment 决定;false 时隐藏
|
|
121835
122739
|
resolvedShowAdjustment: function resolvedShowAdjustment() {
|
|
121836
|
-
|
|
121837
|
-
return this.toolbarRightInstances.some(function (inst) {
|
|
121838
|
-
return !!inst.showAdjustment;
|
|
121839
|
-
});
|
|
122740
|
+
return this.showAdjustment;
|
|
121840
122741
|
},
|
|
121841
122742
|
// 操作列按钮列表(tableOperation 属性)
|
|
121842
122743
|
opButtons: function opButtons() {
|
|
@@ -121980,6 +122881,8 @@ var NormalReportSlotView = {
|
|
|
121980
122881
|
title: comp.title,
|
|
121981
122882
|
// 列宽:仅取列组件声明宽度(列设置弹层调整的是列最小宽度)
|
|
121982
122883
|
width: comp.width,
|
|
122884
|
+
// 用户拖拽表头得到的实际列宽。未拖过时不传给 vxe,仍由 min-width 分配
|
|
122885
|
+
userWidth: st && st.width != null ? st.width : null,
|
|
121983
122886
|
// 列最小宽度(对应 vxe-table min-width):优先取列设置弹层设置的值(px),
|
|
121984
122887
|
// 未设置时取列组件 resolvedMinWidth(显式传入值或按标题自动计算)
|
|
121985
122888
|
minWidth: st && st.minWidth != null ? st.minWidth : comp.resolvedMinWidth,
|
|
@@ -122027,6 +122930,7 @@ var NormalReportSlotView = {
|
|
|
122027
122930
|
field: c.field || undefined,
|
|
122028
122931
|
title: c.title,
|
|
122029
122932
|
width: c.width || undefined,
|
|
122933
|
+
userWidth: c.userWidth || undefined,
|
|
122030
122934
|
minWidth: c.minWidth,
|
|
122031
122935
|
treeNode: !!c.treeNode,
|
|
122032
122936
|
fixed: c.fixed || undefined,
|
|
@@ -122101,24 +123005,25 @@ var NormalReportSlotView = {
|
|
|
122101
123005
|
}
|
|
122102
123006
|
},
|
|
122103
123007
|
mounted: function mounted() {
|
|
122104
|
-
var _this4 = this;
|
|
122105
123008
|
this.initResizeObserver();
|
|
122106
123009
|
// 表头拖拽排序结束后抑制一次 click(document 捕获阶段拦截,防止拖拽结束触发排序切换)
|
|
122107
123010
|
document.addEventListener('click', this.onDocumentClickCapture, true);
|
|
122108
|
-
//
|
|
122109
|
-
this.
|
|
122110
|
-
// 列挂载后再重算。height="100%" 要等浏览器完成 flex 布局才有父容器高度,
|
|
122111
|
-
// 只在 nextTick 里算会把表体高度当成内容高度,滚动条不再出现
|
|
122112
|
-
this.$nextTick(function () {
|
|
122113
|
-
_this4.resizeRecalculate();
|
|
122114
|
-
if (typeof requestAnimationFrame === 'function') {
|
|
122115
|
-
requestAnimationFrame(function () {
|
|
122116
|
-
return _this4.resizeRecalculate();
|
|
122117
|
-
});
|
|
122118
|
-
}
|
|
122119
|
-
});
|
|
123011
|
+
// 列已在子组件 created 中注册完成。能确定表格编码时先合并历史配置,再放行表头
|
|
123012
|
+
this.bootstrapColumnConfig();
|
|
122120
123013
|
},
|
|
122121
123014
|
beforeDestroy: function beforeDestroy() {
|
|
123015
|
+
this.columnConfigSettled = true;
|
|
123016
|
+
if (this.columnConfigTimer) {
|
|
123017
|
+
clearTimeout(this.columnConfigTimer);
|
|
123018
|
+
this.columnConfigTimer = null;
|
|
123019
|
+
}
|
|
123020
|
+
// 直接改表头的保存还在 3 秒防抖里,离开页面时把最后一次调整写回去
|
|
123021
|
+
if (this.columnConfigSaveTimer) {
|
|
123022
|
+
clearTimeout(this.columnConfigSaveTimer);
|
|
123023
|
+
this.columnConfigSaveTimer = null;
|
|
123024
|
+
this.persistColumnConfig();
|
|
123025
|
+
}
|
|
123026
|
+
this.releaseColumnConfigClaim();
|
|
122122
123027
|
this.destroyResizeObserver();
|
|
122123
123028
|
document.removeEventListener('click', this.onDocumentClickCapture, true);
|
|
122124
123029
|
this.clearHeaderDragBindings();
|
|
@@ -122141,51 +123046,51 @@ var NormalReportSlotView = {
|
|
|
122141
123046
|
},
|
|
122142
123047
|
// 工具栏左侧子组件 vnode(渲染到操作区左侧)
|
|
122143
123048
|
getToolbarLeftVNodes: function getToolbarLeftVNodes() {
|
|
122144
|
-
var
|
|
123049
|
+
var _this4 = this;
|
|
122145
123050
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122146
|
-
return
|
|
123051
|
+
return _this4.isVNodeOfType(v, TOOLBAR_LEFT_TYPES);
|
|
122147
123052
|
});
|
|
122148
123053
|
},
|
|
122149
123054
|
// 工具栏右侧子组件 vnode(渲染到操作区右侧)
|
|
122150
123055
|
getToolbarRightVNodes: function getToolbarRightVNodes() {
|
|
122151
|
-
var
|
|
123056
|
+
var _this5 = this;
|
|
122152
123057
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122153
|
-
return
|
|
123058
|
+
return _this5.isVNodeOfType(v, TOOLBAR_RIGHT_TYPES);
|
|
122154
123059
|
});
|
|
122155
123060
|
},
|
|
122156
123061
|
// 底部栏左侧子组件 vnode(渲染到底部栏左侧)
|
|
122157
123062
|
getFooterLeftVNodes: function getFooterLeftVNodes() {
|
|
122158
|
-
var
|
|
123063
|
+
var _this6 = this;
|
|
122159
123064
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122160
|
-
return
|
|
123065
|
+
return _this6.isVNodeOfType(v, FOOTER_LEFT_TYPES);
|
|
122161
123066
|
});
|
|
122162
123067
|
},
|
|
122163
123068
|
// 底部栏右侧分页子组件 vnode(渲染到底部栏右侧)
|
|
122164
123069
|
getFooterRightVNodes: function getFooterRightVNodes() {
|
|
122165
|
-
var
|
|
123070
|
+
var _this7 = this;
|
|
122166
123071
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122167
|
-
return
|
|
123072
|
+
return _this7.isVNodeOfType(v, FOOTER_RIGHT_TYPES);
|
|
122168
123073
|
});
|
|
122169
123074
|
},
|
|
122170
123075
|
// 底部空占位子组件 vnode(页面声明时渲染,未声明时使用内置默认占位)
|
|
122171
123076
|
getFooterEmptyVNodes: function getFooterEmptyVNodes() {
|
|
122172
|
-
var
|
|
123077
|
+
var _this8 = this;
|
|
122173
123078
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122174
|
-
return
|
|
123079
|
+
return _this8.isVNodeOfType(v, FOOTER_EMPTY_TYPES);
|
|
122175
123080
|
});
|
|
122176
123081
|
},
|
|
122177
123082
|
// 工具栏空占位子组件 vnode(页面声明时渲染,未声明时使用内置默认占位)
|
|
122178
123083
|
getToolbarEmptyVNodes: function getToolbarEmptyVNodes() {
|
|
122179
|
-
var
|
|
123084
|
+
var _this9 = this;
|
|
122180
123085
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122181
|
-
return
|
|
123086
|
+
return _this9.isVNodeOfType(v, TOOLBAR_EMPTY_TYPES);
|
|
122182
123087
|
});
|
|
122183
123088
|
},
|
|
122184
123089
|
// 隐藏注册区 vnode:默认插槽中除区域子组件(工具栏/底部栏功能区 + 空占位)之外的内容
|
|
122185
123090
|
getHiddenSlotVNodes: function getHiddenSlotVNodes() {
|
|
122186
|
-
var
|
|
123091
|
+
var _this0 = this;
|
|
122187
123092
|
return this.getDefaultSlotVNodes().filter(function (v) {
|
|
122188
|
-
return !
|
|
123093
|
+
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);
|
|
122189
123094
|
});
|
|
122190
123095
|
},
|
|
122191
123096
|
// 操作区是否显示
|
|
@@ -122239,6 +123144,7 @@ var NormalReportSlotView = {
|
|
|
122239
123144
|
visible: true,
|
|
122240
123145
|
fixed: comp.fixed || '',
|
|
122241
123146
|
minWidth: null,
|
|
123147
|
+
width: null,
|
|
122242
123148
|
sortable: !!comp.sortable
|
|
122243
123149
|
});
|
|
122244
123150
|
if (this.columnOrder.indexOf(comp._uid) === -1) {
|
|
@@ -122307,7 +123213,7 @@ var NormalReportSlotView = {
|
|
|
122307
123213
|
// 渲染单个操作按钮:active 为 false 时不再隐藏(原按 v-if 消失),
|
|
122308
123214
|
// 改为渲染 disabled 按钮(变灰不可操作)
|
|
122309
123215
|
renderOpButton: function renderOpButton(h, row, btn, idx) {
|
|
122310
|
-
var
|
|
123216
|
+
var _this1 = this;
|
|
122311
123217
|
var active = this.isOpActive(btn, row);
|
|
122312
123218
|
var data = {
|
|
122313
123219
|
key: idx,
|
|
@@ -122318,7 +123224,7 @@ var NormalReportSlotView = {
|
|
|
122318
123224
|
},
|
|
122319
123225
|
on: {
|
|
122320
123226
|
click: function click() {
|
|
122321
|
-
return
|
|
123227
|
+
return _this1.handleOpClick(row, btn);
|
|
122322
123228
|
}
|
|
122323
123229
|
},
|
|
122324
123230
|
// 阻止点击事件冒泡到表格单元格:
|
|
@@ -122340,7 +123246,7 @@ var NormalReportSlotView = {
|
|
|
122340
123246
|
// 超出按钮渲染为 el-dropdown-item,点击后走与直接按钮一致的 handleOpClick;
|
|
122341
123247
|
// active 为 false 的按钮以 disabled 形式变灰展示
|
|
122342
123248
|
renderOpMore: function renderOpMore(h, row, restButtons) {
|
|
122343
|
-
var
|
|
123249
|
+
var _this10 = this;
|
|
122344
123250
|
return h('el-dropdown', {
|
|
122345
123251
|
key: '__normal_report_op_more__',
|
|
122346
123252
|
"class": 'normal-report-op-more',
|
|
@@ -122350,7 +123256,7 @@ var NormalReportSlotView = {
|
|
|
122350
123256
|
},
|
|
122351
123257
|
on: {
|
|
122352
123258
|
command: function command(btn) {
|
|
122353
|
-
return
|
|
123259
|
+
return _this10.handleOpClick(row, btn);
|
|
122354
123260
|
}
|
|
122355
123261
|
},
|
|
122356
123262
|
nativeOn: {
|
|
@@ -122368,7 +123274,7 @@ var NormalReportSlotView = {
|
|
|
122368
123274
|
})]), h('el-dropdown-menu', {
|
|
122369
123275
|
slot: 'dropdown'
|
|
122370
123276
|
}, restButtons.map(function (btn, idx) {
|
|
122371
|
-
var active =
|
|
123277
|
+
var active = _this10.isOpActive(btn, row);
|
|
122372
123278
|
return h('el-dropdown-item', {
|
|
122373
123279
|
key: idx,
|
|
122374
123280
|
props: {
|
|
@@ -122384,17 +123290,17 @@ var NormalReportSlotView = {
|
|
|
122384
123290
|
// 渲染操作列:按钮 ≤ 3 个时全部直接渲染;超过 3 个时前 3 个直接渲染,
|
|
122385
123291
|
// 其余统一收纳进“更多”下拉菜单;active 为 false 的按钮渲染为 disabled(变灰)
|
|
122386
123292
|
renderOpCell: function renderOpCell(row, h) {
|
|
122387
|
-
var
|
|
123293
|
+
var _this11 = this;
|
|
122388
123294
|
var createElement = h || this.$createElement;
|
|
122389
123295
|
var btns = this.opButtons;
|
|
122390
123296
|
if (!btns.length) return null;
|
|
122391
123297
|
if (btns.length <= OP_MAX_DIRECT_COUNT) {
|
|
122392
123298
|
return btns.map(function (btn, idx) {
|
|
122393
|
-
return
|
|
123299
|
+
return _this11.renderOpButton(createElement, row, btn, idx);
|
|
122394
123300
|
});
|
|
122395
123301
|
}
|
|
122396
123302
|
var nodes = btns.slice(0, OP_MAX_DIRECT_COUNT).map(function (btn, idx) {
|
|
122397
|
-
return
|
|
123303
|
+
return _this11.renderOpButton(createElement, row, btn, idx);
|
|
122398
123304
|
});
|
|
122399
123305
|
nodes.push(this.renderOpMore(createElement, row, btns.slice(OP_MAX_DIRECT_COUNT)));
|
|
122400
123306
|
return nodes;
|
|
@@ -122477,12 +123383,12 @@ var NormalReportSlotView = {
|
|
|
122477
123383
|
},
|
|
122478
123384
|
// 复制文本到剪贴板:优先使用现代 API,失败时降级 execCommand
|
|
122479
123385
|
copyTextToClipboard: function copyTextToClipboard(text) {
|
|
122480
|
-
var
|
|
123386
|
+
var _this12 = this;
|
|
122481
123387
|
if (navigator.clipboard && window.isSecureContext) {
|
|
122482
123388
|
navigator.clipboard.writeText(text).then(function () {
|
|
122483
|
-
|
|
123389
|
+
_this12.$message && _this12.$message.success('复制成功:' + text);
|
|
122484
123390
|
})["catch"](function () {
|
|
122485
|
-
|
|
123391
|
+
_this12.fallbackCopyText(text);
|
|
122486
123392
|
});
|
|
122487
123393
|
} else {
|
|
122488
123394
|
this.fallbackCopyText(text);
|
|
@@ -122568,23 +123474,25 @@ var NormalReportSlotView = {
|
|
|
122568
123474
|
// 切换列的排序开关:sortable 已纳入列 key,修改后强制重建列,
|
|
122569
123475
|
// 再由 applyColumnOrder 恢复列顺序(重建会打乱 staticColumns 顺序)
|
|
122570
123476
|
toggleHeaderColumnSort: function toggleHeaderColumnSort(uid) {
|
|
122571
|
-
var
|
|
123477
|
+
var _this13 = this;
|
|
122572
123478
|
var st = this.columnStates[uid];
|
|
122573
123479
|
if (!st) return;
|
|
122574
123480
|
this.$set(st, 'sortable', !st.sortable);
|
|
123481
|
+
this.schedulePersistColumnConfig();
|
|
122575
123482
|
this.$nextTick(function () {
|
|
122576
|
-
return
|
|
123483
|
+
return _this13.applyColumnOrder();
|
|
122577
123484
|
});
|
|
122578
123485
|
},
|
|
122579
123486
|
// 切换列的固定状态(左/右固定互斥,再次点击同侧即取消):
|
|
122580
123487
|
// fixed 同样纳入列 key,重建后 vxe-table 重新解析固定列分组
|
|
122581
123488
|
toggleHeaderColumnFixed: function toggleHeaderColumnFixed(uid, side) {
|
|
122582
|
-
var
|
|
123489
|
+
var _this14 = this;
|
|
122583
123490
|
var st = this.columnStates[uid];
|
|
122584
123491
|
if (!st) return;
|
|
122585
123492
|
this.$set(st, 'fixed', st.fixed === side ? '' : side);
|
|
123493
|
+
this.schedulePersistColumnConfig();
|
|
122586
123494
|
this.$nextTick(function () {
|
|
122587
|
-
return
|
|
123495
|
+
return _this14.applyColumnOrder();
|
|
122588
123496
|
});
|
|
122589
123497
|
},
|
|
122590
123498
|
// ===== 单元格编辑 =====
|
|
@@ -122700,7 +123608,7 @@ var NormalReportSlotView = {
|
|
|
122700
123608
|
},
|
|
122701
123609
|
// 交换列顺序(columnOrder 重排后强制同步 vxe-table 内部列配置)
|
|
122702
123610
|
moveColumnOrder: function moveColumnOrder(fromUid, toUid) {
|
|
122703
|
-
var
|
|
123611
|
+
var _this15 = this;
|
|
122704
123612
|
var from = this.columnOrder.indexOf(fromUid);
|
|
122705
123613
|
var to = this.columnOrder.indexOf(toUid);
|
|
122706
123614
|
if (from < 0 || to < 0 || from === to) return;
|
|
@@ -122708,8 +123616,9 @@ var NormalReportSlotView = {
|
|
|
122708
123616
|
var moved = order.splice(from, 1)[0];
|
|
122709
123617
|
order.splice(to, 0, moved);
|
|
122710
123618
|
this.columnOrder = order;
|
|
123619
|
+
this.schedulePersistColumnConfig();
|
|
122711
123620
|
this.$nextTick(function () {
|
|
122712
|
-
return
|
|
123621
|
+
return _this15.applyColumnOrder();
|
|
122713
123622
|
});
|
|
122714
123623
|
},
|
|
122715
123624
|
// ===== 对外方法(父组件通过 ref 调用) =====
|
|
@@ -122747,14 +123656,14 @@ var NormalReportSlotView = {
|
|
|
122747
123656
|
// 表现为固定列行与数据行错位。此处监听表格容器尺寸变化,防抖后
|
|
122748
123657
|
// 重新计算布局并调用 refreshScroll() 强制同步各滚动层位置。
|
|
122749
123658
|
initResizeObserver: function initResizeObserver() {
|
|
122750
|
-
var
|
|
123659
|
+
var _this16 = this;
|
|
122751
123660
|
var wrapEl = this.$refs.tableWrap;
|
|
122752
123661
|
if (!wrapEl) return;
|
|
122753
123662
|
if (typeof ResizeObserver !== 'undefined') {
|
|
122754
123663
|
// 首次通知也要重算。挂载时容器往往已有高度,但还不是 flex 约束后的高度,
|
|
122755
123664
|
// 跳过这次就会把“内容撑开的高度”当成可视高度,滚动条不再出现
|
|
122756
123665
|
this.resizeObserver = new ResizeObserver(function () {
|
|
122757
|
-
|
|
123666
|
+
_this16.scheduleTableRecalculate();
|
|
122758
123667
|
});
|
|
122759
123668
|
this.resizeObserver.observe(wrapEl);
|
|
122760
123669
|
} else {
|
|
@@ -122764,23 +123673,23 @@ var NormalReportSlotView = {
|
|
|
122764
123673
|
},
|
|
122765
123674
|
// 防抖:连续尺寸变化(如拖拽分割线)停稳后再重算,读到的是最终宽高
|
|
122766
123675
|
scheduleTableRecalculate: function scheduleTableRecalculate() {
|
|
122767
|
-
var
|
|
123676
|
+
var _this17 = this;
|
|
122768
123677
|
if (this.resizeTimer) clearTimeout(this.resizeTimer);
|
|
122769
123678
|
this.resizeTimer = setTimeout(function () {
|
|
122770
|
-
|
|
122771
|
-
|
|
123679
|
+
_this17.resizeTimer = null;
|
|
123680
|
+
_this17.resizeRecalculate();
|
|
122772
123681
|
}, 50);
|
|
122773
123682
|
},
|
|
122774
123683
|
// 重新计算布局,并在重算完成后强制同步固定列与主表体的滚动位置。
|
|
122775
123684
|
// 容器还没有宽度时 vxe 会直接跳过滚动计算,等下一次尺寸通知再算
|
|
122776
123685
|
resizeRecalculate: function resizeRecalculate() {
|
|
122777
|
-
var
|
|
123686
|
+
var _this18 = this;
|
|
122778
123687
|
var xTable = this.$refs.xTable;
|
|
122779
123688
|
var wrapEl = this.$refs.tableWrap;
|
|
122780
123689
|
if (!xTable) return;
|
|
122781
123690
|
if (wrapEl && wrapEl.clientWidth === 0) return;
|
|
122782
123691
|
var restore = function restore() {
|
|
122783
|
-
|
|
123692
|
+
_this18.$nextTick(function () {
|
|
122784
123693
|
if (xTable.refreshScroll) xTable.refreshScroll();
|
|
122785
123694
|
});
|
|
122786
123695
|
};
|
|
@@ -122847,7 +123756,7 @@ var NormalReportSlotView = {
|
|
|
122847
123756
|
// ===== 列设置弹层 =====
|
|
122848
123757
|
// 打开列设置:以当前注册列生成工作副本(每次打开都重新初始化)
|
|
122849
123758
|
openColumnSetting: function openColumnSetting() {
|
|
122850
|
-
var
|
|
123759
|
+
var _this19 = this;
|
|
122851
123760
|
var compMap = {};
|
|
122852
123761
|
this.columnComps.forEach(function (comp) {
|
|
122853
123762
|
compMap[comp._uid] = comp;
|
|
@@ -122875,7 +123784,7 @@ var NormalReportSlotView = {
|
|
|
122875
123784
|
// 列标题宽度:按最长列名称计算(中文 25px/字 + 英文 15px/字 + 30px 余量),
|
|
122876
123785
|
// 各列标题统一按该宽度显示,保证输入框与按钮对齐
|
|
122877
123786
|
this.columnTitleWidth = this.columnDraft.reduce(function (max, c) {
|
|
122878
|
-
return Math.max(max,
|
|
123787
|
+
return Math.max(max, _this19.calcColumnTitleWidth(c.title));
|
|
122879
123788
|
}, 0);
|
|
122880
123789
|
},
|
|
122881
123790
|
// 计算单个列标题的显示宽度(px):中文 25px/字 + 英文 15px/字 + 30px 余量
|
|
@@ -122967,21 +123876,189 @@ var NormalReportSlotView = {
|
|
|
122967
123876
|
},
|
|
122968
123877
|
// 确认:将面板副本应用到列状态并刷新表格
|
|
122969
123878
|
confirmColumnSetting: function confirmColumnSetting() {
|
|
122970
|
-
var
|
|
123879
|
+
var _this20 = this;
|
|
122971
123880
|
var order = [];
|
|
122972
123881
|
this.columnDraft.forEach(function (d) {
|
|
122973
|
-
|
|
123882
|
+
var prev = _this20.columnStates[d.uid] || {};
|
|
123883
|
+
_this20.$set(_this20.columnStates, d.uid, {
|
|
122974
123884
|
visible: d.visible,
|
|
122975
123885
|
fixed: d.fixed || '',
|
|
122976
123886
|
minWidth: d.minWidth != null ? d.minWidth : null,
|
|
123887
|
+
width: prev.width != null ? prev.width : null,
|
|
122977
123888
|
sortable: !!d.sortable
|
|
122978
123889
|
});
|
|
122979
123890
|
order.push(d.uid);
|
|
122980
123891
|
});
|
|
122981
123892
|
this.columnOrder = order;
|
|
122982
123893
|
this.columnSettingVisible = false;
|
|
123894
|
+
this.persistColumnConfigNow();
|
|
122983
123895
|
this.$nextTick(function () {
|
|
122984
|
-
|
|
123896
|
+
_this20.applyColumnOrder();
|
|
123897
|
+
});
|
|
123898
|
+
},
|
|
123899
|
+
// ===== 表头配置持久化 =====
|
|
123900
|
+
// 表格编码:显式 table-code 优先,否则取组件 ref。两者都没有时不读写表头配置
|
|
123901
|
+
resolveTableCode: function resolveTableCode() {
|
|
123902
|
+
var explicit = this.tableCode != null ? String(this.tableCode).trim() : '';
|
|
123903
|
+
if (explicit) return explicit;
|
|
123904
|
+
var data = this.$vnode && this.$vnode.data;
|
|
123905
|
+
var ref = data && data.ref;
|
|
123906
|
+
if (typeof ref !== 'string') return '';
|
|
123907
|
+
return ref.trim();
|
|
123908
|
+
},
|
|
123909
|
+
// 页面编码:显式 page-code 优先,否则取路由 name,再退回不含查询参数的 path
|
|
123910
|
+
resolvePageCode: function resolvePageCode() {
|
|
123911
|
+
var explicit = this.pageCode != null ? String(this.pageCode).trim() : '';
|
|
123912
|
+
if (explicit) return explicit;
|
|
123913
|
+
var route = this.$route;
|
|
123914
|
+
if (route && route.name) return String(route.name);
|
|
123915
|
+
if (route && route.path) return String(route.path).split('?')[0];
|
|
123916
|
+
return '';
|
|
123917
|
+
},
|
|
123918
|
+
releaseColumnConfigClaim: function releaseColumnConfigClaim() {
|
|
123919
|
+
var claim = this._columnConfigClaim;
|
|
123920
|
+
if (!claim) return;
|
|
123921
|
+
releaseTableCode(claim.moduleCode, claim.pageCode, claim.tableCode, this);
|
|
123922
|
+
this._columnConfigClaim = null;
|
|
123923
|
+
},
|
|
123924
|
+
// 列挂载后再重算。height="100%" 要等浏览器完成 flex 布局才有父容器高度
|
|
123925
|
+
scheduleInitialLayout: function scheduleInitialLayout() {
|
|
123926
|
+
var _this21 = this;
|
|
123927
|
+
this.$nextTick(function () {
|
|
123928
|
+
_this21.resizeRecalculate();
|
|
123929
|
+
if (typeof requestAnimationFrame === 'function') {
|
|
123930
|
+
requestAnimationFrame(function () {
|
|
123931
|
+
return _this21.resizeRecalculate();
|
|
123932
|
+
});
|
|
123933
|
+
}
|
|
123934
|
+
});
|
|
123935
|
+
},
|
|
123936
|
+
// 首次加载只结算一次。用户在返回前已调整时,保留本地结果并在允许写入后保存
|
|
123937
|
+
finishColumnConfigLoad: function finishColumnConfigLoad(apply) {
|
|
123938
|
+
if (this.columnConfigSettled) return;
|
|
123939
|
+
this.columnConfigSettled = true;
|
|
123940
|
+
if (this.columnConfigTimer) {
|
|
123941
|
+
clearTimeout(this.columnConfigTimer);
|
|
123942
|
+
this.columnConfigTimer = null;
|
|
123943
|
+
}
|
|
123944
|
+
if (!this.columnConfigDirty && typeof apply === 'function') apply();
|
|
123945
|
+
var tableCode = this.resolveTableCode();
|
|
123946
|
+
this.columnConfigReady = !!getColumnModuleCode() && !!tableCode && !this.columnConfigDisabled;
|
|
123947
|
+
this.columnsReady = true;
|
|
123948
|
+
this.scheduleInitialLayout();
|
|
123949
|
+
// 加载完成前已经直接改过表头时,同样等 3 秒再保存,避免和后续拖拽各打一次接口
|
|
123950
|
+
if (this.columnConfigDirty) this.schedulePersistColumnConfig();
|
|
123951
|
+
},
|
|
123952
|
+
bootstrapColumnConfig: function bootstrapColumnConfig() {
|
|
123953
|
+
var _this22 = this;
|
|
123954
|
+
var tableCode = this.resolveTableCode();
|
|
123955
|
+
if (!tableCode) {
|
|
123956
|
+
this.finishColumnConfigLoad();
|
|
123957
|
+
return;
|
|
123958
|
+
}
|
|
123959
|
+
var pageCode = this.resolvePageCode();
|
|
123960
|
+
if (!pageCode) {
|
|
123961
|
+
console.warn('[StandardTable] 无法确定 page-code,表头配置不会加载');
|
|
123962
|
+
this.columnConfigDisabled = true;
|
|
123963
|
+
this.finishColumnConfigLoad();
|
|
123964
|
+
return;
|
|
123965
|
+
}
|
|
123966
|
+
var moduleCode = getColumnModuleCode();
|
|
123967
|
+
if (!moduleCode) {
|
|
123968
|
+
console.warn('[StandardTable] 未注册 moduleCode,表头配置不会加载');
|
|
123969
|
+
this.columnConfigDisabled = true;
|
|
123970
|
+
this.finishColumnConfigLoad();
|
|
123971
|
+
return;
|
|
123972
|
+
}
|
|
123973
|
+
if (!claimTableCode(moduleCode, pageCode, tableCode, this)) {
|
|
123974
|
+
console.warn('[StandardTable] 同一页面存在重复的 table-code:' + tableCode);
|
|
123975
|
+
this.columnConfigDisabled = true;
|
|
123976
|
+
this.finishColumnConfigLoad();
|
|
123977
|
+
return;
|
|
123978
|
+
}
|
|
123979
|
+
this._columnConfigClaim = {
|
|
123980
|
+
moduleCode: moduleCode,
|
|
123981
|
+
pageCode: pageCode,
|
|
123982
|
+
tableCode: tableCode
|
|
123983
|
+
};
|
|
123984
|
+
var duplicated = findDuplicateColumnKey(this.columnComps);
|
|
123985
|
+
if (duplicated) {
|
|
123986
|
+
console.warn('[StandardTable] 列标识重复,已跳过表头配置:' + duplicated);
|
|
123987
|
+
this.columnConfigDisabled = true;
|
|
123988
|
+
this.finishColumnConfigLoad();
|
|
123989
|
+
return;
|
|
123990
|
+
}
|
|
123991
|
+
var columns = readCachedColumnLayout(moduleCode, pageCode, tableCode);
|
|
123992
|
+
var api = getColumnConfigApi();
|
|
123993
|
+
if (!api || typeof api.save !== 'function') {
|
|
123994
|
+
console.warn('[StandardTable] 未注入 request,表头配置不会保存');
|
|
123995
|
+
this.columnConfigDisabled = true;
|
|
123996
|
+
}
|
|
123997
|
+
this.finishColumnConfigLoad(function () {
|
|
123998
|
+
if (columns && columns.length) _this22.applyMergedColumnConfig(columns);
|
|
123999
|
+
});
|
|
124000
|
+
},
|
|
124001
|
+
applyMergedColumnConfig: function applyMergedColumnConfig(savedColumns) {
|
|
124002
|
+
var _this23 = this;
|
|
124003
|
+
var merged = mergeColumnConfig(this.columnComps, savedColumns);
|
|
124004
|
+
if (!merged) return;
|
|
124005
|
+
merged.states.forEach(function (item) {
|
|
124006
|
+
_this23.$set(_this23.columnStates, item.uid, item.state);
|
|
124007
|
+
});
|
|
124008
|
+
this.columnOrder = merged.order;
|
|
124009
|
+
},
|
|
124010
|
+
// 拖拽表头列宽:写入实际宽度,最小宽度仍由列设置弹层维护
|
|
124011
|
+
onColumnResizableChange: function onColumnResizableChange(params) {
|
|
124012
|
+
if (!params) return;
|
|
124013
|
+
var uid = this.resolveColumnUid(params.column);
|
|
124014
|
+
if (uid == null) return;
|
|
124015
|
+
var st = this.columnStates[uid];
|
|
124016
|
+
if (!st) return;
|
|
124017
|
+
var width = Math.round(Number(params.resizeWidth));
|
|
124018
|
+
if (!(width >= 60)) return;
|
|
124019
|
+
this.$set(st, 'width', Math.min(width, 2000));
|
|
124020
|
+
this.schedulePersistColumnConfig();
|
|
124021
|
+
},
|
|
124022
|
+
// 直接改表头(拖列宽、拖换列、右键改排序或固定)时防抖:停手 3 秒后才保存。
|
|
124023
|
+
// 「调整」弹层点确认走 persistColumnConfigNow,不经过这里。
|
|
124024
|
+
schedulePersistColumnConfig: function schedulePersistColumnConfig() {
|
|
124025
|
+
var _this24 = this;
|
|
124026
|
+
this.columnConfigDirty = true;
|
|
124027
|
+
if (!this.columnConfigReady) return;
|
|
124028
|
+
if (this.columnConfigSaveTimer) clearTimeout(this.columnConfigSaveTimer);
|
|
124029
|
+
this.columnConfigSaveTimer = setTimeout(function () {
|
|
124030
|
+
_this24.columnConfigSaveTimer = null;
|
|
124031
|
+
_this24.persistColumnConfig();
|
|
124032
|
+
}, 3000);
|
|
124033
|
+
},
|
|
124034
|
+
persistColumnConfigNow: function persistColumnConfigNow() {
|
|
124035
|
+
this.columnConfigDirty = true;
|
|
124036
|
+
if (this.columnConfigSaveTimer) {
|
|
124037
|
+
clearTimeout(this.columnConfigSaveTimer);
|
|
124038
|
+
this.columnConfigSaveTimer = null;
|
|
124039
|
+
}
|
|
124040
|
+
this.persistColumnConfig();
|
|
124041
|
+
},
|
|
124042
|
+
persistColumnConfig: function persistColumnConfig() {
|
|
124043
|
+
var _this25 = this;
|
|
124044
|
+
if (!this.columnConfigReady || this.columnConfigDisabled) return;
|
|
124045
|
+
var api = getColumnConfigApi();
|
|
124046
|
+
if (!api) return;
|
|
124047
|
+
var moduleCode = getColumnModuleCode();
|
|
124048
|
+
var pageCode = this.resolvePageCode();
|
|
124049
|
+
var tableCode = this.resolveTableCode();
|
|
124050
|
+
if (!moduleCode || !pageCode || !tableCode) return;
|
|
124051
|
+
var columns = buildColumnPayload(this.columnComps, this.columnOrder, this.columnStates);
|
|
124052
|
+
var useReset = isDefaultColumnPayload(this.columnComps, columns);
|
|
124053
|
+
var request = useReset ? typeof api.reset === 'function' ? api.reset(moduleCode, pageCode, tableCode) : null : typeof api.save === 'function' ? api.save(moduleCode, pageCode, tableCode, columns) : null;
|
|
124054
|
+
if (!request) return;
|
|
124055
|
+
Promise.resolve(request).then(function (res) {
|
|
124056
|
+
readColumnConfigDatas(res);
|
|
124057
|
+
if (useReset) removeCachedColumnLayout(moduleCode, pageCode, tableCode);else updateCachedColumnLayout(moduleCode, pageCode, tableCode, columns);
|
|
124058
|
+
var content = res && res.data && res.data.Content || res && res.Content || '表头配置保存成功';
|
|
124059
|
+
if (_this25.$message) _this25.$message.success(content);
|
|
124060
|
+
})["catch"](function (err) {
|
|
124061
|
+
if (_this25.$message) _this25.$message.error(err && err.message || '表头配置保存失败');
|
|
122985
124062
|
});
|
|
122986
124063
|
}
|
|
122987
124064
|
}
|
|
@@ -123003,8 +124080,8 @@ var StandardTablevue_type_style_index_0_prod_lang_scss_external = __webpack_requ
|
|
|
123003
124080
|
|
|
123004
124081
|
var StandardTable_component = normalizeComponent(
|
|
123005
124082
|
components_StandardTablevue_type_script_lang_js,
|
|
123006
|
-
|
|
123007
|
-
|
|
124083
|
+
StandardTablevue_type_template_id_24e29a8b_render,
|
|
124084
|
+
StandardTablevue_type_template_id_24e29a8b_staticRenderFns,
|
|
123008
124085
|
false,
|
|
123009
124086
|
null,
|
|
123010
124087
|
null,
|
|
@@ -123045,6 +124122,12 @@ var StandardTable_component = normalizeComponent(
|
|
|
123045
124122
|
type: String,
|
|
123046
124123
|
"default": ''
|
|
123047
124124
|
},
|
|
124125
|
+
// 表头配置使用的稳定主键。不传时按 field:字段名 或 type:类型 生成。
|
|
124126
|
+
// 字段以后可能改名、或同一字段出现两列时必须显式指定,且一经使用不再修改
|
|
124127
|
+
columnKey: {
|
|
124128
|
+
type: String,
|
|
124129
|
+
"default": ''
|
|
124130
|
+
},
|
|
123048
124131
|
// vxe-table 内置列类型(如 seq 序号列),普通数据列不传
|
|
123049
124132
|
type: {
|
|
123050
124133
|
type: String,
|
|
@@ -123307,9 +124390,8 @@ var ToolbarLeft_component = normalizeComponent(
|
|
|
123307
124390
|
* 1. 必须放在 <standard-table> 默认插槽内,标签内部内容(按钮、standard-toolbar-query 等)
|
|
123308
124391
|
* 由主组件就地渲染到表格操作区右侧(“调整”列设置按钮之前);
|
|
123309
124392
|
* standard-toolbar-query 只能放在本组件内部;
|
|
123310
|
-
* 2.
|
|
123311
|
-
*
|
|
123312
|
-
* 主组件自身的 showAdjustment 属性继续有效(任一为 true 即显示“调整”按钮);
|
|
124393
|
+
* 2. “调整”列设置按钮由主组件 standard-table 的 show-adjustment 控制,默认显示,
|
|
124394
|
+
* 传 false 时隐藏。列设置弹层仍由主组件渲染;
|
|
123313
124395
|
* 3. 按钮点击事件等逻辑完全由使用方在插槽内容中自行绑定(页面作用域)。
|
|
123314
124396
|
*/
|
|
123315
124397
|
/* harmony default export */ const ToolbarRightvue_type_script_lang_js = ({
|
|
@@ -124261,7 +125343,10 @@ function index_esm_default() { return index_esm_default.c || (index_esm_default.
|
|
|
124261
125343
|
*
|
|
124262
125344
|
* 用法一(全局注册,推荐):
|
|
124263
125345
|
* import StandardComponents from '@cimom-ui/standard-ui'
|
|
124264
|
-
* Vue.use(StandardComponents
|
|
125346
|
+
* Vue.use(StandardComponents, {
|
|
125347
|
+
* moduleCode: process.env.VUE_APP_MODULE_CODE, // 模块编码,与页面、表格一起确定表头配置
|
|
125348
|
+
* request: (config) => axios.request(config) // 业务项目的请求方法,baseURL 决定 IP 和端口
|
|
125349
|
+
* })
|
|
124265
125350
|
* // 之后所有页面模板可直接使用 <standard-button> / <standard-table> 等标签
|
|
124266
125351
|
*
|
|
124267
125352
|
* 用法二(局部注册):
|
|
@@ -124295,13 +125380,17 @@ function index_esm_default() { return index_esm_default.c || (index_esm_default.
|
|
|
124295
125380
|
|
|
124296
125381
|
|
|
124297
125382
|
|
|
125383
|
+
|
|
124298
125384
|
// 全部 14 个顶层组件(StandardForm / StandardTable / StandardTabs 注册时会连带其子组件)
|
|
124299
125385
|
// 说明:StandardAdvancedQuery 为 StandardFilterbar 的内部依赖,不单独暴露
|
|
124300
|
-
var src_components = [StandardButton, StandardDialog, StandardContainer,
|
|
125386
|
+
var src_components = [StandardButton, StandardDialog, StandardContainer, components_StandardFilterbar, components_StandardForm, StandardHalfArea, StandardInput, StandardPage, StandardSplitter, StandardSelect, StandardTimePick, components_StandardTable, components_StandardTabs, StandardTree];
|
|
124301
125387
|
|
|
124302
125388
|
// 全局 vxe-table 弹层层级是否已提升(install 重复调用时只设置一次)
|
|
124303
125389
|
var zIndexConfigured = false;
|
|
124304
|
-
var install = function install(Vue) {
|
|
125390
|
+
var install = function install(Vue, options) {
|
|
125391
|
+
// 模块编码和请求方法由业务项目注入。接口路径固定,IP 和端口来自请求方法的 baseURL
|
|
125392
|
+
if (options && options.moduleCode != null) setColumnModuleCode(options.moduleCode);
|
|
125393
|
+
if (options && typeof options.request === 'function') setColumnConfigRequest(options.request);
|
|
124305
125394
|
// 提升 vxe-table 弹层层级(右键菜单/tooltip 等):vxe-table 默认 zIndex 起始值
|
|
124306
125395
|
// 999,低于 Element UI 弹窗(el-dialog 等默认 2000 起),会导致弹窗内表格的
|
|
124307
125396
|
// 右键菜单面板被弹窗遮挡而“失效”;统一提升到 5000,确保位于所有常规弹窗之上
|
|
@@ -124329,7 +125418,7 @@ var StandardComponents = {
|
|
|
124329
125418
|
StandardButton: StandardButton,
|
|
124330
125419
|
StandardDialog: StandardDialog,
|
|
124331
125420
|
StandardContainer: StandardContainer,
|
|
124332
|
-
StandardFilterbar:
|
|
125421
|
+
StandardFilterbar: components_StandardFilterbar,
|
|
124333
125422
|
StandardForm: components_StandardForm,
|
|
124334
125423
|
StandardHalfArea: StandardHalfArea,
|
|
124335
125424
|
StandardInput: StandardInput,
|