@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.
@@ -2858,7 +2858,7 @@ ___CSS_LOADER_EXPORT___.push([module.id, `.standard-container[data-v-b0b5121a]{d
2858
2858
 
2859
2859
  /***/ },
2860
2860
 
2861
- /***/ 3777
2861
+ /***/ 255
2862
2862
  (module, __webpack_exports__, __webpack_require__) {
2863
2863
 
2864
2864
  "use strict";
@@ -2872,7 +2872,7 @@ __webpack_require__.r(__webpack_exports__);
2872
2872
 
2873
2873
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
2874
2874
  // Module
2875
- ___CSS_LOADER_EXPORT___.push([module.id, `.normal-report-toolbar-panel{padding:10px 12px;margin-bottom:8px;background:#fff;border:1px solid #e8edf4;border-radius:10px;box-shadow:0 6px 18px rgba(31,73,125,.06);flex-shrink:0}.normal-report-filter-row{display:flex;align-items:flex-end;-moz-column-gap:6px;column-gap:6px;row-gap:10px;flex-wrap:wrap}.normal-report-filter-row-secondary{margin-top:10px;padding-top:10px;border-top:1px solid #edf1f6}.normal-report-filter-item{display:flex;flex-direction:column;gap:4px;width:175px;flex:0 0 175px;font-size:10px;color:#5a657a}.normal-report-filter-item>span{margin-left:2px}.normal-report-filter-item-date,.normal-report-filter-item-device{width:175px!important}.normal-report-filter-item .normal-report-filter-control{width:100%!important}.normal-report-filter-actions{display:flex;align-items:center;gap:6px;margin-left:auto}.normal-report-filter-actions .el-button+.el-button{margin-left:0}.normal-report-filter-expand-enter-active,.normal-report-filter-expand-leave-active{transition:opacity .18s ease}.normal-report-filter-expand-enter,.normal-report-filter-expand-leave-to{opacity:0}@media(max-width:768px){.normal-report-filter-item{width:100%;flex-basis:100%}.normal-report-filter-actions{width:100%;margin-left:0;justify-content:flex-end}}`, ""]);
2875
+ ___CSS_LOADER_EXPORT___.push([module.id, `.normal-report-toolbar-panel{padding:10px 12px;margin-bottom:8px;background:#fff;border:1px solid #e8edf4;border-radius:10px;box-shadow:0 6px 18px rgba(31,73,125,.06);flex-shrink:0}.normal-report-filter-row{display:flex;align-items:flex-end;-moz-column-gap:6px;column-gap:6px;row-gap:10px;flex-wrap:wrap}.standard-filterbar{min-width:0;max-width:100%}.standard-filterbar .normal-report-filter-row-primary{flex-wrap:nowrap;min-width:0;max-width:100%}.standard-filterbar .normal-report-filter-actions{width:auto;flex:0 0 auto;margin-left:auto}.standard-filterbar .normal-report-filter-item{width:var(--filter-item-width,175px);flex:0 0 var(--filter-item-width,175px);min-width:175px;max-width:300px}.standard-filterbar .normal-report-filter-item.normal-report-filter-item-date,.standard-filterbar .normal-report-filter-item.normal-report-filter-item-device{width:var(--filter-item-width,175px)!important;flex:0 0 var(--filter-item-width,175px);min-width:175px;max-width:300px}.normal-report-filter-row-secondary{margin-top:10px;padding-top:10px;border-top:1px solid #edf1f6}.standard-filterbar.standard-filterbar--expand-up{display:flex;flex-direction:column}.standard-filterbar.standard-filterbar--expand-up .normal-report-filter-row-secondary{order:-1;margin-top:0;margin-bottom:10px;padding-top:0;padding-bottom:10px;border-top:none;border-bottom:1px solid #edf1f6}.normal-report-filter-item{display:flex;flex-direction:column;gap:4px;width:175px;flex:0 0 175px;font-size:10px;color:#5a657a}.normal-report-filter-item>span{margin-left:2px}.normal-report-filter-item-date,.normal-report-filter-item-device{width:175px!important}.normal-report-filter-item .normal-report-filter-control{width:100%!important}.standard-filterbar-slot-control>.el-autocomplete,.standard-filterbar-slot-control>.el-cascader,.standard-filterbar-slot-control>.el-date-editor,.standard-filterbar-slot-control>.el-input,.standard-filterbar-slot-control>.el-select{width:100%}.normal-report-filter-actions{display:flex;align-items:center;gap:6px;margin-left:auto}.normal-report-filter-actions .el-button+.el-button{margin-left:0}.normal-report-filter-expand-enter-active,.normal-report-filter-expand-leave-active{transition:opacity .18s ease}.normal-report-filter-expand-enter,.normal-report-filter-expand-leave-to{opacity:0}@media(max-width:768px){.normal-report-filter-item{width:100%;flex-basis:100%}.normal-report-filter-actions{width:100%;margin-left:0;justify-content:flex-end}}`, ""]);
2876
2876
  // Exports
2877
2877
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
2878
2878
 
@@ -3072,7 +3072,7 @@ __webpack_require__.r(__webpack_exports__);
3072
3072
 
3073
3073
  var ___CSS_LOADER_EXPORT___ = _node_modules_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_node_modules_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));
3074
3074
  // Module
3075
- ___CSS_LOADER_EXPORT___.push([module.id, `.standard-advanced-query-entry,.standard-advanced-query-entry .el-popover__reference-wrapper{display:inline-flex;align-items:center}.standard-advanced-query-panel{min-width:360px}.standard-advanced-query-list{max-height:300px;overflow-y:auto;padding:4px 0}.standard-advanced-query-empty{padding:12px 0}.standard-advanced-query-empty .el-empty__description p{font-size:12px;color:#909399;margin:0}.standard-advanced-query-item{display:flex;align-items:center;gap:6px;padding:5px 4px}.standard-advanced-query-item .el-button+.el-button{margin-left:0}.standard-advanced-query-item-field{flex:0 0 130px;width:130px}.standard-advanced-query-item-value{flex:1;min-width:0}.standard-advanced-query-item-remove{flex-shrink:0;padding:5px;color:#f56c6c}.standard-advanced-query-add{display:flex;justify-content:center;padding:2px 0}.standard-advanced-query-add .el-button{padding:5px}.standard-advanced-query-footer{margin-top:8px;padding-top:8px;border-top:1px solid #ebeef5;text-align:right}`, ""]);
3075
+ ___CSS_LOADER_EXPORT___.push([module.id, `.standard-advanced-query-entry,.standard-advanced-query-entry .el-popover__reference-wrapper{display:inline-flex;align-items:center}.standard-advanced-query-panel{min-width:360px}.standard-advanced-query-custom{display:flex;flex-wrap:wrap;align-items:flex-end;-moz-column-gap:6px;column-gap:6px;row-gap:10px;padding:4px 0 8px}.standard-advanced-query-list{max-height:300px;overflow-y:auto;padding:4px 0}.standard-advanced-query-empty{padding:12px 0}.standard-advanced-query-empty .el-empty__description p{font-size:12px;color:#909399;margin:0}.standard-advanced-query-item{display:flex;align-items:center;gap:6px;padding:5px 4px}.standard-advanced-query-item .el-button+.el-button{margin-left:0}.standard-advanced-query-item-field{flex:0 0 130px;width:130px}.standard-advanced-query-item-value{flex:1;min-width:0}.standard-advanced-query-item-remove{flex-shrink:0;padding:5px;color:#f56c6c}.standard-advanced-query-add{display:flex;justify-content:center;padding:2px 0}.standard-advanced-query-add .el-button{padding:5px}.standard-advanced-query-footer{margin-top:8px;padding-top:8px;border-top:1px solid #ebeef5;text-align:right}`, ""]);
3076
3076
  // Exports
3077
3077
  /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);
3078
3078
 
@@ -73342,19 +73342,19 @@ var update = add("4a97ea96", content, true, {"sourceMap":false,"shadowMode":fals
73342
73342
 
73343
73343
  /***/ },
73344
73344
 
73345
- /***/ 5229
73345
+ /***/ 8859
73346
73346
  (module, __unused_webpack_exports, __webpack_require__) {
73347
73347
 
73348
73348
  // style-loader: Adds some css to the DOM by adding a <style> tag
73349
73349
 
73350
73350
  // load the styles
73351
- var content = __webpack_require__(3777);
73351
+ var content = __webpack_require__(255);
73352
73352
  if(content.__esModule) content = content.default;
73353
73353
  if(typeof content === 'string') content = [[module.id, content, '']];
73354
73354
  if(content.locals) module.exports = content.locals;
73355
73355
  // add the styles to the DOM
73356
73356
  var add = (__webpack_require__(9548)/* ["default"] */ .A)
73357
- var update = add("18b68d10", content, true, {"sourceMap":false,"shadowMode":false});
73357
+ var update = add("73895a00", content, true, {"sourceMap":false,"shadowMode":false});
73358
73358
 
73359
73359
  /***/ },
73360
73360
 
@@ -118983,15 +118983,24 @@ var StandardContainer_component = normalizeComponent(
118983
118983
  )
118984
118984
 
118985
118985
  /* harmony default export */ const StandardContainer = (StandardContainer_component.exports);
118986
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/index.vue?vue&type=template&id=a1e74ef8
118987
- var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
118986
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/index.vue?vue&type=template&id=042f1c58
118987
+ var StandardFilterbarvue_type_template_id_042f1c58_render = function render() {
118988
118988
  var _vm = this,
118989
- _c = _vm._self._c;
118989
+ _c = _vm._self._c,
118990
+ _setup = _vm._self._setupProxy;
118990
118991
  return _vm.renderValid ? _c('section', {
118991
- staticClass: "normal-report-toolbar-panel standard-filterbar"
118992
+ staticClass: "normal-report-toolbar-panel standard-filterbar",
118993
+ "class": {
118994
+ 'standard-filterbar--expand-up': _vm.expandAbove
118995
+ }
118992
118996
  }, [_c('div', {
118997
+ ref: "filterRow",
118993
118998
  staticClass: "normal-report-filter-row normal-report-filter-row-primary"
118994
- }, [_vm._l(_vm.mainConditions, function (cond) {
118999
+ }, [_c('filter-slot-group', {
119000
+ attrs: {
119001
+ "nodes": _vm.primarySlotNodes()
119002
+ }
119003
+ }), _vm._l(_vm.primaryConditionList(), function (cond) {
118995
119004
  return _c('filter-search-item', {
118996
119005
  key: cond.value,
118997
119006
  staticClass: "standard-filterbar-item",
@@ -118999,6 +119008,7 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
118999
119008
  attrs: {
119000
119009
  "cond": cond,
119001
119010
  "search-bar": _vm.searchBar,
119011
+ "layout-width": _vm.sharedItemWidth,
119002
119012
  "options": _vm.getOptions(cond),
119003
119013
  "is-remote": _vm.isRemoteCond(cond),
119004
119014
  "remote-method": _vm.remoteMethods[cond.value] || null,
@@ -119010,6 +119020,7 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
119010
119020
  }
119011
119021
  });
119012
119022
  }), _c('div', {
119023
+ ref: "filterActions",
119013
119024
  staticClass: "normal-report-filter-actions"
119014
119025
  }, [_c('standard-button', {
119015
119026
  attrs: {
@@ -119039,20 +119050,26 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
119039
119050
  return _vm.$emit('export');
119040
119051
  }
119041
119052
  }
119042
- }) : _vm._e(), _vm.showAdvancedQuery && _vm.secondaryConditions.length ? _c('standard-advanced-query', {
119053
+ }) : _vm._e(), _vm.showAdvancedQuery && _vm.hasOverflow() ? _c('standard-advanced-query', {
119043
119054
  ref: "advancedQuery",
119044
119055
  attrs: {
119045
- "conditions": _vm.secondaryConditions,
119056
+ "conditions": _vm.overflowConditionList(),
119057
+ "custom-count": _vm.overflowSlotNodes().length,
119046
119058
  "search-bar": _vm.searchBar
119047
119059
  },
119048
119060
  on: {
119049
119061
  "search": _vm.onSearch
119050
119062
  }
119051
- }) : _vm.showExpand && _vm.secondaryConditions.length ? _c('standard-button', {
119063
+ }, [_c('filter-slot-group', {
119064
+ attrs: {
119065
+ "nodes": _vm.overflowSlotNodes()
119066
+ }
119067
+ })], 1) : _vm.showExpand && _vm.hasOverflow() ? _c('standard-button', {
119068
+ ref: "moreButton",
119052
119069
  staticClass: "normal-report-expand-button",
119053
119070
  attrs: {
119054
- "icon": _vm.expanded ? 'el-icon-arrow-up' : 'el-icon-arrow-down',
119055
- "label": "\u66F4\u591A".concat(_vm.secondaryActiveCount ? " (".concat(_vm.secondaryActiveCount, ")") : '')
119071
+ "icon": _vm.expandIcon,
119072
+ "label": "\u66F4\u591A".concat(_vm.overflowActiveCount() ? " (".concat(_vm.overflowActiveCount(), ")") : '')
119056
119073
  },
119057
119074
  on: {
119058
119075
  "click": function click($event) {
@@ -119063,15 +119080,19 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
119063
119080
  attrs: {
119064
119081
  "name": "normal-report-filter-expand"
119065
119082
  }
119066
- }, [_vm.secondaryConditions.length ? _c('div', {
119083
+ }, [!_vm.showAdvancedQuery && _vm.hasOverflow() ? _c('div', {
119067
119084
  directives: [{
119068
119085
  name: "show",
119069
119086
  rawName: "v-show",
119070
- value: _vm.secondaryVisible,
119071
- expression: "secondaryVisible"
119087
+ value: _vm.secondaryOpen(),
119088
+ expression: "secondaryOpen()"
119072
119089
  }],
119073
119090
  staticClass: "normal-report-filter-row normal-report-filter-row-secondary"
119074
- }, _vm._l(_vm.secondaryConditions, function (cond) {
119091
+ }, [_c('filter-slot-group', {
119092
+ attrs: {
119093
+ "nodes": _vm.overflowSlotNodes()
119094
+ }
119095
+ }), _vm._l(_vm.overflowConditionList(), function (cond) {
119075
119096
  return _c('filter-search-item', {
119076
119097
  key: cond.value,
119077
119098
  staticClass: "standard-filterbar-item",
@@ -119079,6 +119100,7 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
119079
119100
  attrs: {
119080
119101
  "cond": cond,
119081
119102
  "search-bar": _vm.searchBar,
119103
+ "layout-width": _vm.sharedItemWidth,
119082
119104
  "options": _vm.getOptions(cond),
119083
119105
  "is-remote": _vm.isRemoteCond(cond),
119084
119106
  "remote-method": _vm.remoteMethods[cond.value] || null,
@@ -119089,12 +119111,12 @@ var StandardFilterbarvue_type_template_id_a1e74ef8_render = function render() {
119089
119111
  }
119090
119112
  }
119091
119113
  });
119092
- }), 1) : _vm._e()])], 1) : _vm._e();
119114
+ })], 2) : _vm._e()])], 1) : _vm._e();
119093
119115
  };
119094
- var StandardFilterbarvue_type_template_id_a1e74ef8_staticRenderFns = [];
119116
+ var StandardFilterbarvue_type_template_id_042f1c58_staticRenderFns = [];
119095
119117
 
119096
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardAdvancedQuery/index.vue?vue&type=template&id=231a2683
119097
- var StandardAdvancedQueryvue_type_template_id_231a2683_render = function render() {
119118
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardAdvancedQuery/index.vue?vue&type=template&id=07a0d3fc
119119
+ var StandardAdvancedQueryvue_type_template_id_07a0d3fc_render = function render() {
119098
119120
  var _vm = this,
119099
119121
  _c = _vm._self._c;
119100
119122
  return _c('el-popover', {
@@ -119112,7 +119134,9 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_render = function render(
119112
119134
  }
119113
119135
  }, [_c('div', {
119114
119136
  staticClass: "standard-advanced-query-panel"
119115
- }, [_c('div', {
119137
+ }, [_vm.customCount ? _c('div', {
119138
+ staticClass: "standard-advanced-query-custom"
119139
+ }, [_vm._t("default")], 2) : _vm._e(), _c('div', {
119116
119140
  staticClass: "standard-advanced-query-list"
119117
119141
  }, [_vm.rows.length ? _vm._l(_vm.rows, function (row, index) {
119118
119142
  return _c('div', {
@@ -119165,13 +119189,13 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_render = function render(
119165
119189
  }
119166
119190
  }
119167
119191
  })], 1);
119168
- }) : _c('el-empty', {
119192
+ }) : !_vm.customCount ? _c('el-empty', {
119169
119193
  staticClass: "standard-advanced-query-empty",
119170
119194
  attrs: {
119171
119195
  "image-size": 60,
119172
119196
  "description": "点击下方新增按钮添加查询条件"
119173
119197
  }
119174
- })], 2), _c('div', {
119198
+ }) : _vm._e()], 2), _c('div', {
119175
119199
  staticClass: "standard-advanced-query-footer"
119176
119200
  }, [_c('el-button', {
119177
119201
  attrs: {
@@ -119209,7 +119233,7 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_render = function render(
119209
119233
  slot: "reference"
119210
119234
  }, [_vm._v(" 高级查询" + _vm._s(_vm.rows.length ? " (".concat(_vm.rows.length, ")") : '') + " ")])], 1);
119211
119235
  };
119212
- var StandardAdvancedQueryvue_type_template_id_231a2683_staticRenderFns = [];
119236
+ var StandardAdvancedQueryvue_type_template_id_07a0d3fc_staticRenderFns = [];
119213
119237
 
119214
119238
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardAdvancedQuery/index.vue?vue&type=script&lang=js
119215
119239
  /**
@@ -119235,6 +119259,11 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_staticRenderFns = [];
119235
119259
  return [];
119236
119260
  }
119237
119261
  },
119262
+ // 未进首行的自定义筛选项数量(默认插槽中的原始控件,不参与文本条件行)
119263
+ customCount: {
119264
+ type: Number,
119265
+ "default": 0
119266
+ },
119238
119267
  // v-model 绑定的筛选配置对象(读写 searchVariable 完成值双向绑定)
119239
119268
  searchBar: {
119240
119269
  type: Object,
@@ -119259,7 +119288,8 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_staticRenderFns = [];
119259
119288
  }
119260
119289
  },
119261
119290
  watch: {
119262
- // 条件配置变化时清理失效行(field 已不在 conditions 中的行自动移除并恢复值)
119291
+ // 可用条件变化时:移出已不在列表中的行(保留字段值,避免首行容量变化时把已填内容清掉);
119292
+ // 新进入列表且已有值的字段补一行,角标与弹窗能看到该条件
119263
119293
  conditions: function conditions() {
119264
119294
  var _this = this;
119265
119295
  var fields = (this.conditions || []).map(function (c) {
@@ -119268,8 +119298,19 @@ var StandardAdvancedQueryvue_type_template_id_231a2683_staticRenderFns = [];
119268
119298
  var valid = this.rows.filter(function (row) {
119269
119299
  return fields.indexOf(row.field) > -1;
119270
119300
  });
119271
- this.rows.forEach(function (row) {
119272
- if (fields.indexOf(row.field) === -1) _this.restoreFieldValue(row.field);
119301
+ var existing = {};
119302
+ valid.forEach(function (row) {
119303
+ existing[row.field] = true;
119304
+ });
119305
+ (this.conditions || []).forEach(function (cond) {
119306
+ if (!cond || existing[cond.value]) return;
119307
+ if (_this.hasValue(cond)) {
119308
+ valid.push({
119309
+ uid: ++_this.uidSeq,
119310
+ field: cond.value
119311
+ });
119312
+ existing[cond.value] = true;
119313
+ }
119273
119314
  });
119274
119315
  this.rows = valid;
119275
119316
  }
@@ -119423,8 +119464,8 @@ var StandardAdvancedQueryvue_type_style_index_0_prod_lang_scss_external = __webp
119423
119464
 
119424
119465
  var StandardAdvancedQuery_component = normalizeComponent(
119425
119466
  components_StandardAdvancedQueryvue_type_script_lang_js,
119426
- StandardAdvancedQueryvue_type_template_id_231a2683_render,
119427
- StandardAdvancedQueryvue_type_template_id_231a2683_staticRenderFns,
119467
+ StandardAdvancedQueryvue_type_template_id_07a0d3fc_render,
119468
+ StandardAdvancedQueryvue_type_template_id_07a0d3fc_staticRenderFns,
119428
119469
  false,
119429
119470
  null,
119430
119471
  null,
@@ -119433,11 +119474,125 @@ var StandardAdvancedQuery_component = normalizeComponent(
119433
119474
  )
119434
119475
 
119435
119476
  /* harmony default export */ const StandardAdvancedQuery = (StandardAdvancedQuery_component.exports);
119477
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/Item.vue?vue&type=template&id=0001f453
119478
+ var Itemvue_type_template_id_0001f453_render = function render() {
119479
+ var _vm = this,
119480
+ _c = _vm._self._c;
119481
+ return _c('label', {
119482
+ staticClass: "normal-report-filter-item",
119483
+ style: _vm.itemStyle
119484
+ }, [_vm.label ? _c('span', [_vm._v(_vm._s(_vm.label))]) : _vm._e(), _c('div', {
119485
+ staticClass: "normal-report-filter-control standard-filterbar-slot-control"
119486
+ }, [_vm._t("default")], 2)]);
119487
+ };
119488
+ var Itemvue_type_template_id_0001f453_staticRenderFns = [];
119489
+
119490
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/Item.vue?vue&type=script&lang=js
119491
+ /**
119492
+ * StandardFilterbarItem
119493
+ * 用法(作为 standard-filterbar 的默认插槽子节点,顺序优先于 v-model 中的条件):
119494
+ * <standard-filterbar-item label="车间">
119495
+ * <el-select v-model="extra.workshop" size="mini" clearable />
119496
+ * </standard-filterbar-item>
119497
+ */
119498
+ /* harmony default export */ const Itemvue_type_script_lang_js = ({
119499
+ name: 'StandardFilterbarItem',
119500
+ props: {
119501
+ // 条件标题,显示在控件上方
119502
+ label: {
119503
+ type: String,
119504
+ "default": ''
119505
+ },
119506
+ // 自定义宽度:数字按 px,或任意 CSS 宽度字符串。未传时跟随首行统一宽度
119507
+ width: {
119508
+ type: [Number, String],
119509
+ "default": null
119510
+ },
119511
+ // 由筛选栏在渲染时写入的统一项宽,使用方无需传递
119512
+ layoutWidth: {
119513
+ type: Number,
119514
+ "default": 0
119515
+ }
119516
+ },
119517
+ computed: {
119518
+ itemStyle: function itemStyle() {
119519
+ var custom = this.width;
119520
+ var hasCustom = custom !== undefined && custom !== null && custom !== '';
119521
+ var toCss = function toCss(value) {
119522
+ return typeof value === 'number' ? "".concat(value, "px") : value;
119523
+ };
119524
+ if (hasCustom) {
119525
+ var css = toCss(custom);
119526
+ return {
119527
+ '--filter-item-width': css,
119528
+ width: css,
119529
+ flexBasis: css,
119530
+ flexGrow: 0,
119531
+ flexShrink: 0,
119532
+ minWidth: css,
119533
+ maxWidth: css
119534
+ };
119535
+ }
119536
+ if (this.layoutWidth > 0) {
119537
+ var _css = "".concat(this.layoutWidth, "px");
119538
+ return {
119539
+ '--filter-item-width': _css,
119540
+ width: _css,
119541
+ flexBasis: _css,
119542
+ flexGrow: 0,
119543
+ flexShrink: 0
119544
+ };
119545
+ }
119546
+ return null;
119547
+ }
119548
+ }
119549
+ });
119550
+ ;// ./src/components/StandardFilterbar/Item.vue?vue&type=script&lang=js
119551
+ /* harmony default export */ const StandardFilterbar_Itemvue_type_script_lang_js = (Itemvue_type_script_lang_js);
119552
+ ;// ./src/components/StandardFilterbar/Item.vue
119553
+
119554
+
119555
+
119556
+
119557
+
119558
+ /* normalize component */
119559
+ ;
119560
+ var Item_component = normalizeComponent(
119561
+ StandardFilterbar_Itemvue_type_script_lang_js,
119562
+ Itemvue_type_template_id_0001f453_render,
119563
+ Itemvue_type_template_id_0001f453_staticRenderFns,
119564
+ false,
119565
+ null,
119566
+ null,
119567
+ null
119568
+
119569
+ )
119570
+
119571
+ /* harmony default export */ const Item = (Item_component.exports);
119436
119572
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/index.vue?vue&type=script&lang=js
119437
119573
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
119438
119574
  ;
119439
119575
 
119440
119576
 
119577
+
119578
+ /**
119579
+ * 把插槽项 vnode 铺进父级 flex 行,不额外包一层,保证每个 item 单独占一格。
119580
+ */
119581
+ var FilterSlotGroup = {
119582
+ functional: true,
119583
+ props: {
119584
+ nodes: {
119585
+ type: Array,
119586
+ "default": function _default() {
119587
+ return [];
119588
+ }
119589
+ }
119590
+ },
119591
+ render: function render(h, ctx) {
119592
+ return ctx.props.nodes || [];
119593
+ }
119594
+ };
119595
+
119441
119596
  /**
119442
119597
  * 单个筛选条件渲染组件(组件内部使用,不对外暴露)
119443
119598
  * 使用 render 函数实现,避免主区/次区重复书写同一套控件模板
@@ -119485,7 +119640,12 @@ var FilterSearchItem = {
119485
119640
  onFocus: {
119486
119641
  type: Function,
119487
119642
  "default": null
119488
- } // 下拉聚焦/展开时的回调
119643
+ },
119644
+ // 下拉聚焦/展开时的回调
119645
+ layoutWidth: {
119646
+ type: Number,
119647
+ "default": 0
119648
+ } // 首行测得的统一项宽(px);0 表示尚未测得,沿用样式默认值
119489
119649
  },
119490
119650
  render: function render(h) {
119491
119651
  var _this = this;
@@ -119500,12 +119660,34 @@ var FilterSearchItem = {
119500
119660
  };
119501
119661
  var clearable = cond.clearable !== false;
119502
119662
  var placeholder = cond.placeholder || (cond.type === 'text' ? "\u8BF7\u8F93\u5165".concat(cond.label) : "\u8BF7\u9009\u62E9".concat(cond.label));
119503
- // 自定义宽度(可选扩展字段):支持数字(px)或任意 CSS 宽度字符串
119504
- var width = cond.width;
119505
- var style = width ? {
119506
- width: typeof width === 'number' ? "".concat(width, "px") : width,
119507
- flexBasis: typeof width === 'number' ? "".concat(width, "px") : width
119508
- } : null;
119663
+ // 宽度:单条 cond.width 优先(数字按 px);否则使用父组件按行宽算出的统一宽度
119664
+ var custom = cond.width;
119665
+ var hasCustom = custom !== undefined && custom !== null && custom !== '';
119666
+ var toCss = function toCss(value) {
119667
+ return typeof value === 'number' ? "".concat(value, "px") : value;
119668
+ };
119669
+ var style = null;
119670
+ if (hasCustom) {
119671
+ var css = toCss(custom);
119672
+ style = {
119673
+ '--filter-item-width': css,
119674
+ width: css,
119675
+ flexBasis: css,
119676
+ flexGrow: 0,
119677
+ flexShrink: 0,
119678
+ minWidth: css,
119679
+ maxWidth: css
119680
+ };
119681
+ } else if (this.layoutWidth > 0) {
119682
+ var _css = "".concat(this.layoutWidth, "px");
119683
+ style = {
119684
+ '--filter-item-width': _css,
119685
+ width: _css,
119686
+ flexBasis: _css,
119687
+ flexGrow: 0,
119688
+ flexShrink: 0
119689
+ };
119690
+ }
119509
119691
  var controlEl = null;
119510
119692
  switch (cond.type) {
119511
119693
  // 文本输入框
@@ -119624,14 +119806,17 @@ var FilterSearchItem = {
119624
119806
  * 用法:
119625
119807
  * <standard-filterbar v-model="searchBar" show-export @search="..." @export="..." />
119626
119808
  * 说明:
119627
- * v-model 绑定的 searchBar 对象包含 searchCondition(条件配置列表)、searchVariable(绑定值对象)
119628
- * 与 mainConditionCount(主区条件个数上限,未传入时默认 4),
119629
- * 组件依据 searchCondition 渲染控件,值通过 searchVariable 双向绑定回父组件。
119809
+ * v-model 绑定的 searchBar 对象包含 searchCondition(条件配置列表)、searchVariable(绑定值对象)。
119810
+ * 默认插槽中的 standard-filterbar-item 排在 searchCondition 之前;首行放不下的进入“更多”或“高级查询”。
119811
+ * 不传插槽时仍按单标签使用。单项宽 175–300px。
119812
+ * 未显式传入 mainConditionCount 时不设个数上限,传入时作为首行个数上限。
119813
+ * isMain 仍可写在配置中,不再参与首行/其余的划分。
119630
119814
  */
119631
- /* harmony default export */ const StandardFilterbarvue_type_script_lang_js = ({
119815
+ var StandardFilterbar = {
119632
119816
  name: 'StandardFilterbar',
119633
119817
  components: {
119634
119818
  FilterSearchItem: FilterSearchItem,
119819
+ FilterSlotGroup: FilterSlotGroup,
119635
119820
  StandardButton: StandardButton,
119636
119821
  StandardAdvancedQuery: StandardAdvancedQuery
119637
119822
  },
@@ -119641,7 +119826,7 @@ var FilterSearchItem = {
119641
119826
  event: 'input'
119642
119827
  },
119643
119828
  props: {
119644
- // v-model 绑定的筛选配置对象:{ searchCondition: [], searchVariable: {}, mainConditionCount: 4 }
119829
+ // v-model 绑定的筛选配置对象:{ searchCondition: [], searchVariable: {}, mainConditionCount }
119645
119830
  searchBar: {
119646
119831
  type: Object,
119647
119832
  required: true
@@ -119662,6 +119847,11 @@ var FilterSearchItem = {
119662
119847
  type: Boolean,
119663
119848
  "default": false
119664
119849
  },
119850
+ // 更多条件是否向筛选栏上方展开。仅在为 true 且未使用高级查询时生效;否则在下方展开
119851
+ expandUpwards: {
119852
+ type: Boolean,
119853
+ "default": true
119854
+ },
119665
119855
  // 查询按钮 loading 状态(可选,由父组件控制)
119666
119856
  loading: {
119667
119857
  type: Boolean,
@@ -119685,7 +119875,11 @@ var FilterSearchItem = {
119685
119875
  // 远程下拉加载状态:{ 条件value: Boolean }
119686
119876
  remoteMethods: {},
119687
119877
  // 远程下拉防抖方法缓存:{ 条件value: Function }
119688
- initValues: {} // searchVariable 初始值快照(组件创建时刻),用于“重置”
119878
+ initValues: {},
119879
+ // searchVariable 初始值快照(组件创建时刻),用于“重置”
119880
+ visibleCount: 99,
119881
+ // 首行可展示的条件个数,挂载后按容器宽度重算
119882
+ sharedItemWidth: 0 // 首行弹性项的统一宽度(px),0 表示沿用样式默认 175
119689
119883
  };
119690
119884
  },
119691
119885
  computed: {
@@ -119694,95 +119888,329 @@ var FilterSearchItem = {
119694
119888
  var list = this.searchBar && this.searchBar.searchCondition || [];
119695
119889
  return Array.isArray(list) ? list : [];
119696
119890
  },
119697
- // 主区条件个数上限:由父组件通过 searchBar.mainConditionCount 传入,
119698
- // 未传入、为空或非法时默认 4
119699
- mainConditionCount: function mainConditionCount() {
119891
+ // 首行个数上限:仅当 searchBar.mainConditionCount 显式传入且为非负数字时生效;
119892
+ // 未传则只受容器宽度限制
119893
+ firstRowLimit: function firstRowLimit() {
119700
119894
  var count = this.searchBar && this.searchBar.mainConditionCount;
119895
+ if (count === undefined || count === null || count === '') return null;
119701
119896
  var num = Number(count);
119702
- return count === undefined || count === null || count === '' || isNaN(num) || num < 0 ? 4 : num;
119897
+ if (isNaN(num) || num < 0) return null;
119898
+ return Math.floor(num);
119703
119899
  },
119704
- // 主区条件(isMain 为 'Y' 或 true)
119705
- mainConditions: function mainConditions() {
119900
+ // 参与排布的条件:保持 searchCondition 数组顺序,空项不渲染
119901
+ orderedConditions: function orderedConditions() {
119706
119902
  return this.conditions.filter(function (cond) {
119707
- return cond && (cond.isMain === 'Y' || cond.isMain === true);
119903
+ return cond && _typeof(cond) === 'object';
119708
119904
  });
119709
119905
  },
119710
- // 次区条件
119711
- secondaryConditions: function secondaryConditions() {
119712
- return this.conditions.filter(function (cond) {
119713
- return !cond || cond.isMain !== 'Y' && cond.isMain !== true;
119714
- });
119715
- },
119716
- // 次区是否可见:高级查询模式下次区条件收进弹窗(不展开显示);
119717
- // 未开启“更多”功能时次区常显
119718
- secondaryVisible: function secondaryVisible() {
119719
- if (!this.secondaryConditions.length) return false;
119720
- if (this.showAdvancedQuery) return false;
119721
- return this.showExpand ? this.expanded : true;
119906
+ // 向上展开:属性为 true,且当前不是高级查询
119907
+ expandAbove: function expandAbove() {
119908
+ return this.expandUpwards && !this.showAdvancedQuery;
119722
119909
  },
119723
- // 次区已填写条件的数量(用于“更多 (n)”角标)
119724
- secondaryActiveCount: function secondaryActiveCount() {
119725
- var _this2 = this;
119726
- return this.secondaryConditions.filter(function (cond) {
119727
- return _this2.hasValue(cond);
119728
- }).length;
119910
+ // 更多按钮箭头:向上展开时,收起箭头朝上、展开后箭头朝下
119911
+ expandIcon: function expandIcon() {
119912
+ if (this.expandAbove) return this.expanded ? 'el-icon-arrow-down' : 'el-icon-arrow-up';
119913
+ return this.expanded ? 'el-icon-arrow-up' : 'el-icon-arrow-down';
119729
119914
  }
119730
119915
  },
119731
119916
  watch: {
119732
119917
  // 条件配置动态变化时重新校验,并为新增的远程下拉补充初始化
119733
119918
  'searchBar.searchCondition': function searchBarSearchCondition(val) {
119734
- var _this3 = this;
119919
+ var _this2 = this;
119735
119920
  this.validate();
119921
+ this.scheduleMeasure();
119736
119922
  if (!this.renderValid) return;
119737
119923
  var list = Array.isArray(val) ? val : [];
119738
119924
  list.forEach(function (cond) {
119739
- if (_this3.isRemoteCond(cond)) {
119740
- if (!_this3.remoteMethods[cond.value]) {
119741
- _this3.remoteMethods[cond.value] = _this3.debounce(function (keyword) {
119742
- return _this3.loadRemoteOptions(cond, keyword);
119925
+ if (_this2.isRemoteCond(cond)) {
119926
+ if (!_this2.remoteMethods[cond.value]) {
119927
+ _this2.remoteMethods[cond.value] = _this2.debounce(function (keyword) {
119928
+ return _this2.loadRemoteOptions(cond, keyword);
119743
119929
  }, 300);
119744
119930
  }
119745
- if (!Object.prototype.hasOwnProperty.call(_this3.remoteOptions, cond.value)) {
119746
- _this3.loadRemoteOptions(cond, '');
119931
+ if (!Object.prototype.hasOwnProperty.call(_this2.remoteOptions, cond.value)) {
119932
+ _this2.loadRemoteOptions(cond, '');
119747
119933
  }
119748
119934
  }
119749
119935
  });
119936
+ },
119937
+ showExport: function showExport() {
119938
+ this.scheduleMeasure();
119939
+ },
119940
+ showExpand: function showExpand() {
119941
+ this.scheduleMeasure();
119942
+ },
119943
+ showAdvancedQuery: function showAdvancedQuery() {
119944
+ this.scheduleMeasure();
119750
119945
  }
119751
119946
  },
119752
119947
  created: function created() {
119753
- var _this4 = this;
119948
+ var _this3 = this;
119754
119949
  // 深拷贝初始值快照:作为“重置”按钮的恢复目标
119755
119950
  this.initValues = this.deepCopy(this.searchBar && this.searchBar.searchVariable || {});
119756
119951
  // 渲染前校验:失败则 renderValid=false,组件不渲染
119757
119952
  this.validate();
119758
119953
  if (!this.renderValid) return;
119759
- // 无主要条件时默认展开次区;关闭“更多”功能时次区常显
119760
- if (!this.showExpand || this.mainConditions.length === 0) {
119954
+ // 关闭“更多”时,未进首行的条件换行常显
119955
+ if (!this.showExpand) {
119761
119956
  this.expanded = true;
119762
119957
  }
119958
+ this._slotStamp = 0;
119959
+ this._slotBucket = null;
119960
+ this._measuredSlotCount = 0;
119763
119961
  // 为远程下拉预先创建防抖方法,并做首次数据加载
119764
- this.mainConditions.concat(this.secondaryConditions).forEach(function (cond) {
119765
- if (_this4.isRemoteCond(cond)) {
119766
- if (!_this4.remoteMethods[cond.value]) {
119767
- _this4.remoteMethods[cond.value] = _this4.debounce(function (keyword) {
119768
- return _this4.loadRemoteOptions(cond, keyword);
119962
+ this.conditions.forEach(function (cond) {
119963
+ if (_this3.isRemoteCond(cond)) {
119964
+ if (!_this3.remoteMethods[cond.value]) {
119965
+ _this3.remoteMethods[cond.value] = _this3.debounce(function (keyword) {
119966
+ return _this3.loadRemoteOptions(cond, keyword);
119769
119967
  }, 300);
119770
119968
  }
119771
- _this4.loadRemoteOptions(cond, '');
119969
+ _this3.loadRemoteOptions(cond, '');
119772
119970
  }
119773
119971
  });
119774
119972
  },
119973
+ beforeUpdate: function beforeUpdate() {
119974
+ // 同一次渲染里多次读取插槽时复用同一批 vnode,避免自定义控件被创建两份
119975
+ this._slotStamp = (this._slotStamp || 0) + 1;
119976
+ this._slotBucket = null;
119977
+ },
119978
+ mounted: function mounted() {
119979
+ var _this4 = this;
119980
+ this.$nextTick(function () {
119981
+ _this4.bindResize();
119982
+ _this4.measureVisibleCount();
119983
+ });
119984
+ },
119985
+ updated: function updated() {
119986
+ var count = this.readSlotNodes().length;
119987
+ if (count !== this._measuredSlotCount) {
119988
+ this._measuredSlotCount = count;
119989
+ this.scheduleMeasure();
119990
+ }
119991
+ },
119992
+ beforeDestroy: function beforeDestroy() {
119993
+ if (this._resizeObserver) {
119994
+ this._resizeObserver.disconnect();
119995
+ this._resizeObserver = null;
119996
+ }
119997
+ if (this._measureRaf) {
119998
+ cancelAnimationFrame(this._measureRaf);
119999
+ this._measureRaf = 0;
120000
+ }
120001
+ if (this._onWindowResize) {
120002
+ window.removeEventListener('resize', this._onWindowResize);
120003
+ this._onWindowResize = null;
120004
+ }
120005
+ },
119775
120006
  methods: {
120007
+ /** 下一帧重算首行容量,合并同一帧内的连续触发 */scheduleMeasure: function scheduleMeasure() {
120008
+ var _this5 = this;
120009
+ if (this._measureRaf) return;
120010
+ this._measureRaf = requestAnimationFrame(function () {
120011
+ _this5._measureRaf = 0;
120012
+ _this5.measureVisibleCount();
120013
+ });
120014
+ },
120015
+ /** 监听筛选行与按钮区尺寸:窗口缩放、分割条拖动都会改变可用宽度 */bindResize: function bindResize() {
120016
+ var _this6 = this;
120017
+ var row = this.$refs.filterRow;
120018
+ if (!row || typeof ResizeObserver === 'undefined') {
120019
+ this._onWindowResize = function () {
120020
+ return _this6.scheduleMeasure();
120021
+ };
120022
+ window.addEventListener('resize', this._onWindowResize);
120023
+ return;
120024
+ }
120025
+ this._resizeObserver = new ResizeObserver(function () {
120026
+ return _this6.scheduleMeasure();
120027
+ });
120028
+ this._resizeObserver.observe(row);
120029
+ if (this.$refs.filterActions) this._resizeObserver.observe(this.$refs.filterActions);
120030
+ },
120031
+ /** 将条件宽度解析为 px;百分比等非 px 写法返回 null */parseItemPx: function parseItemPx(width) {
120032
+ if (width == null || width === '') return null;
120033
+ if (typeof width === 'number' && !isNaN(width)) return width;
120034
+ if (typeof width === 'string') {
120035
+ var matched = /^(\d+(?:\.\d+)?)px$/.exec(width.trim());
120036
+ if (matched) return Number(matched[1]);
120037
+ }
120038
+ return null;
120039
+ },
120040
+ /** 读取默认插槽中的 standard-filterbar-item,每个节点计为一条筛选条件 */readSlotNodes: function readSlotNodes() {
120041
+ var _this7 = this;
120042
+ var scoped = this.$scopedSlots && this.$scopedSlots["default"];
120043
+ var raw = typeof scoped === 'function' ? scoped({}) : this.$slots && this.$slots["default"] || [];
120044
+ return raw.filter(function (node) {
120045
+ return _this7.isFilterbarItemNode(node);
120046
+ });
120047
+ },
120048
+ /** 是否为筛选栏插槽项(忽略插槽里的空白文本节点) */isFilterbarItemNode: function isFilterbarItemNode(vnode) {
120049
+ if (!vnode || !vnode.tag || !vnode.componentOptions) return false;
120050
+ var Ctor = vnode.componentOptions.Ctor;
120051
+ var name = Ctor && Ctor.options && Ctor.options.name || Ctor && Ctor.extendOptions && Ctor.extendOptions.name || '';
120052
+ if (name === 'StandardFilterbarItem') return true;
120053
+ return String(vnode.componentOptions.tag || '') === 'standard-filterbar-item';
120054
+ },
120055
+ /**
120056
+ * 同一次渲染只收集一次插槽节点。
120057
+ * 插槽项整体排在 searchCondition 之前,再按 visibleCount 切到首行或其余区域。
120058
+ */
120059
+ ensureSlotBucket: function ensureSlotBucket() {
120060
+ if (this._slotBucket && this._slotBucket.stamp === this._slotStamp) return this._slotBucket;
120061
+ var nodes = this.readSlotNodes();
120062
+ var layoutWidth = this.sharedItemWidth;
120063
+ nodes.forEach(function (node, index) {
120064
+ var props = node.componentOptions && node.componentOptions.propsData || {};
120065
+ node.componentOptions.propsData = Object.assign({}, props, {
120066
+ layoutWidth: layoutWidth
120067
+ });
120068
+ if (!node.key) node.key = "standard-filterbar-item-".concat(index);
120069
+ });
120070
+ var primaryCount = Math.min(this.visibleCount, nodes.length);
120071
+ this._slotBucket = {
120072
+ stamp: this._slotStamp,
120073
+ nodes: nodes,
120074
+ primary: nodes.slice(0, primaryCount),
120075
+ overflow: nodes.slice(primaryCount)
120076
+ };
120077
+ return this._slotBucket;
120078
+ },
120079
+ primarySlotNodes: function primarySlotNodes() {
120080
+ return this.ensureSlotBucket().primary;
120081
+ },
120082
+ overflowSlotNodes: function overflowSlotNodes() {
120083
+ return this.ensureSlotBucket().overflow;
120084
+ },
120085
+ /** searchCondition 进入首行的起点:插槽项先占用 visibleCount */conditionSplitIndex: function conditionSplitIndex() {
120086
+ return Math.max(0, this.visibleCount - this.ensureSlotBucket().nodes.length);
120087
+ },
120088
+ primaryConditionList: function primaryConditionList() {
120089
+ return this.orderedConditions.slice(0, this.conditionSplitIndex());
120090
+ },
120091
+ overflowConditionList: function overflowConditionList() {
120092
+ return this.orderedConditions.slice(this.conditionSplitIndex());
120093
+ },
120094
+ hasOverflow: function hasOverflow() {
120095
+ return this.overflowSlotNodes().length > 0 || this.overflowConditionList().length > 0;
120096
+ },
120097
+ /** 未进首行的区域是否展开。高级查询时自定义项改放到弹窗,这里不展开 */secondaryOpen: function secondaryOpen() {
120098
+ if (!this.hasOverflow()) return false;
120099
+ if (this.showAdvancedQuery) return false;
120100
+ return this.showExpand ? this.expanded : true;
120101
+ },
120102
+ /** 未进首行且已填写的配置项数量(用于“更多 (n)”角标) */overflowActiveCount: function overflowActiveCount() {
120103
+ var _this8 = this;
120104
+ return this.overflowConditionList().filter(function (cond) {
120105
+ return _this8.hasValue(cond);
120106
+ }).length;
120107
+ },
120108
+ /**
120109
+ * 按当前行宽计算首行条数和弹性项宽度。
120110
+ * 先按“不显示更多/高级查询按钮”试装,装得下则全部留在首行;
120111
+ * 装不下再扣掉该按钮宽度重算,避免按钮显隐来回跳动。
120112
+ */
120113
+ measureVisibleCount: function measureVisibleCount() {
120114
+ var _this9 = this;
120115
+ var row = this.$refs.filterRow;
120116
+ var actions = this.$refs.filterActions;
120117
+ if (!row || !actions) return;
120118
+ var rowWidth = row.clientWidth;
120119
+ if (rowWidth < 50) return;
120120
+ var ordered = this.orderedConditions;
120121
+ var slotNodes = this.readSlotNodes();
120122
+ var total = slotNodes.length + ordered.length;
120123
+ this._measuredSlotCount = slotNodes.length;
120124
+ if (!total) {
120125
+ if (this.visibleCount !== 0) this.visibleCount = 0;
120126
+ return;
120127
+ }
120128
+ var rowGap = this.readFlexGap(row);
120129
+ var actionsGap = this.readFlexGap(actions);
120130
+ var minItem = 175;
120131
+ var maxItem = 300;
120132
+ var moreEl = this.getOverflowButtonEl();
120133
+ var moreWidth = this._moreButtonWidth || (this.showAdvancedQuery ? 108 : 80);
120134
+ if (moreEl && moreEl.offsetWidth) {
120135
+ moreWidth = moreEl.offsetWidth;
120136
+ this._moreButtonWidth = moreWidth;
120137
+ }
120138
+ var moreVisible = !!(moreEl && moreEl.offsetWidth);
120139
+ var baseActions = actions.offsetWidth;
120140
+ if (moreVisible) baseActions -= moreWidth + actionsGap;
120141
+ if (baseActions < 0) baseActions = 0;
120142
+ var widthOf = function widthOf(item) {
120143
+ var parsed = _this9.parseItemPx(item && item.width);
120144
+ return parsed == null ? minItem : parsed;
120145
+ };
120146
+ var descriptors = slotNodes.map(function (node) {
120147
+ return node.componentOptions && node.componentOptions.propsData || {};
120148
+ }).concat(ordered);
120149
+ var minWidths = descriptors.map(widthOf);
120150
+ var fit = function fit(actionsW) {
120151
+ var used = 0;
120152
+ var count = 0;
120153
+ for (var i = 0; i < minWidths.length; i++) {
120154
+ var itemsWidth = used + minWidths[i];
120155
+ var _gaps = (i + 1) * rowGap;
120156
+ if (itemsWidth + _gaps + actionsW <= rowWidth - 1) {
120157
+ used = itemsWidth;
120158
+ count = i + 1;
120159
+ } else {
120160
+ break;
120161
+ }
120162
+ }
120163
+ if (!count) count = 1;
120164
+ return count;
120165
+ };
120166
+ var hideOverflow = this.showAdvancedQuery || this.showExpand;
120167
+ var count = fit(baseActions);
120168
+ if (hideOverflow && count < total) {
120169
+ count = fit(baseActions + moreWidth + actionsGap);
120170
+ }
120171
+ var limit = this.firstRowLimit;
120172
+ if (limit != null) count = Math.min(count, limit);
120173
+ count = Math.max(0, Math.min(count, total));
120174
+ var fixed = 0;
120175
+ var flexCount = 0;
120176
+ for (var i = 0; i < count; i++) {
120177
+ var parsed = this.parseItemPx(descriptors[i].width);
120178
+ var hasCustom = descriptors[i].width !== undefined && descriptors[i].width !== null && descriptors[i].width !== '';
120179
+ if (hasCustom && parsed != null) fixed += parsed;else if (hasCustom) fixed += minItem;else flexCount += 1;
120180
+ }
120181
+ var actionsUsed = baseActions + (hideOverflow && count < total ? moreWidth + actionsGap : 0);
120182
+ var gaps = count > 0 ? count * rowGap : 0;
120183
+ var shared = this.sharedItemWidth;
120184
+ if (flexCount > 0) {
120185
+ shared = Math.floor((rowWidth - actionsUsed - gaps - fixed) / flexCount);
120186
+ if (shared < minItem) shared = minItem;
120187
+ if (shared > maxItem) shared = maxItem;
120188
+ }
120189
+ if (this.visibleCount !== count) this.visibleCount = count;
120190
+ if (Math.abs((this.sharedItemWidth || 0) - shared) > 1) this.sharedItemWidth = shared;
120191
+ },
120192
+ /** 读取 flex 间距(column-gap / gap) */readFlexGap: function readFlexGap(el) {
120193
+ var style = window.getComputedStyle(el);
120194
+ var raw = style.columnGap && style.columnGap !== 'normal' ? style.columnGap : style.gap;
120195
+ var value = parseFloat(raw);
120196
+ return isNaN(value) ? 6 : value;
120197
+ },
120198
+ /** “更多”或“高级查询”按钮的根节点,用于扣减其占位宽度 */getOverflowButtonEl: function getOverflowButtonEl() {
120199
+ var more = this.$refs.moreButton;
120200
+ if (more && more.$el) return more.$el;
120201
+ var advanced = this.$refs.advancedQuery;
120202
+ if (advanced && advanced.$el) return advanced.$el;
120203
+ return null;
120204
+ },
119776
120205
  /**
119777
120206
  * 渲染前整体校验。
119778
120207
  * 以下情况组件渲染失败,并在控制台输出详细错误:
119779
- * 1. 主要的筛选条件超过 searchBar.mainConditionCount 配置的个数(默认 4)
119780
- * 2. 未传入查询事件对应的方法(@search)
119781
- * 3. searchCondition 中的 value 在 searchVariable 中不存在
119782
- * 4. searchCondition 中的必填项(label/value/type)未填
120208
+ * 1. 未传入查询事件对应的方法(@search)
120209
+ * 2. searchCondition 中的 value 在 searchVariable 中不存在
120210
+ * 3. searchCondition 中的必填项(label/value/type)未填
119783
120211
  */
119784
120212
  validate: function validate() {
119785
- var _this5 = this;
120213
+ var _this0 = this;
119786
120214
  var errors = [];
119787
120215
  var searchBar = this.searchBar;
119788
120216
  if (!searchBar || _typeof(searchBar) !== 'object') {
@@ -119795,15 +120223,6 @@ var FilterSearchItem = {
119795
120223
  } else if (!searchVariable || _typeof(searchVariable) !== 'object' || Array.isArray(searchVariable)) {
119796
120224
  errors.push('searchVariable 必须为非空对象');
119797
120225
  } else {
119798
- // 规则 1:主要条件数量校验(上限取 searchBar.mainConditionCount,默认 4)
119799
- var mainList = searchCondition.filter(function (c) {
119800
- return c && (c.isMain === 'Y' || c.isMain === true);
119801
- });
119802
- if (mainList.length > this.mainConditionCount) {
119803
- errors.push("\u4E3B\u8981\u7684\u7B5B\u9009\u6761\u4EF6\u4E0D\u80FD\u8D85\u8FC7 ".concat(this.mainConditionCount, " \u4E2A\uFF08\u5F53\u524D ").concat(mainList.length, " \u4E2A\uFF1A").concat(mainList.map(function (c) {
119804
- return c.label;
119805
- }).join('、'), "\uFF09"));
119806
- }
119807
120226
  var validTypes = ['text', 'date', 'datetime', 'select', 'select-multi'];
119808
120227
  var seenValues = {};
119809
120228
  // 规则 3/4:逐条校验条件配置
@@ -119834,7 +120253,7 @@ var FilterSearchItem = {
119834
120253
  console.warn("[StandardFilterbar] \u7B2C ".concat(index + 1, " \u6761\u7B5B\u9009\u6761\u4EF6\u201C").concat(cond.label, "\u201D\u4E3A\u4E0B\u62C9\u7C7B\u578B\uFF0C\u4F46\u672A\u914D\u7F6E selectSource \u6216 remote\uFF0C\u4E0B\u62C9\u6570\u636E\u4E3A\u7A7A"));
119835
120254
  }
119836
120255
  // 非致命提醒 2:remote 传字符串但未在父组件中找到对应方法(仅警告)
119837
- if (typeof cond.remote === 'string' && !_this5.resolveRemoteFn(cond.remote)) {
120256
+ if (typeof cond.remote === 'string' && !_this0.resolveRemoteFn(cond.remote)) {
119838
120257
  console.warn("[StandardFilterbar] \u7B2C ".concat(index + 1, " \u6761\u7B5B\u9009\u6761\u4EF6\u201C").concat(cond.label, "\u201D\u7684 remote=\"").concat(cond.remote, "\" \u672A\u5728\u7236\u7EC4\u4EF6\u4E2D\u627E\u5230\u5BF9\u5E94\u65B9\u6CD5"));
119839
120258
  }
119840
120259
  // 非致命提醒 3:value 重复定义(仅警告)
@@ -119845,7 +120264,7 @@ var FilterSearchItem = {
119845
120264
  });
119846
120265
  }
119847
120266
  }
119848
- // 规则 2:查询事件校验
120267
+ // 查询事件校验
119849
120268
  if (typeof this.$listeners.search !== 'function') {
119850
120269
  errors.push('未传入查询事件对应的方法,请通过 @search 绑定查询方法');
119851
120270
  }
@@ -119864,17 +120283,17 @@ var FilterSearchItem = {
119864
120283
  this.$emit('search');
119865
120284
  },
119866
120285
  /** 重置:将所有筛选条件恢复为组件创建时刻的初始值 */onReset: function onReset() {
119867
- var _this6 = this;
120286
+ var _this1 = this;
119868
120287
  var variable = this.searchBar && this.searchBar.searchVariable;
119869
120288
  if (variable && this.initValues) {
119870
120289
  Object.keys(this.initValues).forEach(function (key) {
119871
120290
  // 使用 $set 保证新值具备响应式
119872
- _this6.$set(variable, key, _this6.deepCopy(_this6.initValues[key]));
120291
+ _this1.$set(variable, key, _this1.deepCopy(_this1.initValues[key]));
119873
120292
  });
119874
120293
  // 多选下拉的值规范为数组,避免 Element UI 类型告警
119875
120294
  this.conditions.forEach(function (cond) {
119876
120295
  if (cond.type === 'select-multi' && !Array.isArray(variable[cond.value])) {
119877
- _this6.$set(variable, cond.value, []);
120296
+ _this1.$set(variable, cond.value, []);
119878
120297
  }
119879
120298
  });
119880
120299
  }
@@ -119914,19 +120333,19 @@ var FilterSearchItem = {
119914
120333
  * 统一归一化为 [{ label, value }] 后缓存。
119915
120334
  */
119916
120335
  loadRemoteOptions: function loadRemoteOptions(cond, keyword) {
119917
- var _this7 = this;
120336
+ var _this10 = this;
119918
120337
  var fn = this.resolveRemoteFn(cond.remote);
119919
120338
  if (!fn) return Promise.resolve([]);
119920
120339
  this.$set(this.remoteLoading, cond.value, true);
119921
120340
  return Promise.resolve(fn(keyword == null ? '' : keyword)).then(function (res) {
119922
- var options = _this7.normalizeOptions(_this7.extractOptions(res), cond);
119923
- _this7.$set(_this7.remoteOptions, cond.value, options);
120341
+ var options = _this10.normalizeOptions(_this10.extractOptions(res), cond);
120342
+ _this10.$set(_this10.remoteOptions, cond.value, options);
119924
120343
  return options;
119925
120344
  })["catch"](function (err) {
119926
120345
  console.error("[StandardFilterbar] \u7B5B\u9009\u6761\u4EF6\u201C".concat(cond.label, "\u201D\u8FDC\u7A0B\u6570\u636E\u52A0\u8F7D\u5931\u8D25"), err);
119927
120346
  return [];
119928
120347
  })["finally"](function () {
119929
- _this7.$set(_this7.remoteLoading, cond.value, false);
120348
+ _this10.$set(_this10.remoteLoading, cond.value, false);
119930
120349
  });
119931
120350
  },
119932
120351
  /** 从远程方法返回值中提取选项数组(兼容多种返回结构) */extractOptions: function extractOptions(res) {
@@ -119982,9 +120401,7 @@ var FilterSearchItem = {
119982
120401
  return val !== undefined && val !== null && String(val) !== '';
119983
120402
  },
119984
120403
  /**
119985
- * 不同控件类型的宽度修饰类:
119986
- * 日期/时间选择框统一复用全局 normal-report.scss 中的 normal-report-filter-item-date 公共类,
119987
- * 与项目内其它页面(如 inspectQuery)保持一致的 170px 宽度,组件内不再自定义宽度样式
120404
+ * 日期/时间条件附加公共类。宽度与其它条件相同,由首行测量结果在 175–300px 之间写入。
119988
120405
  */
119989
120406
  itemClass: function itemClass(cond) {
119990
120407
  if (cond.type === 'date' || cond.type === 'datetime') return 'normal-report-filter-item-date';
@@ -119997,24 +120414,30 @@ var FilterSearchItem = {
119997
120414
  var delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 300;
119998
120415
  var timer = null;
119999
120416
  return function () {
120000
- var _this8 = this;
120417
+ var _this11 = this;
120001
120418
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
120002
120419
  args[_key] = arguments[_key];
120003
120420
  }
120004
120421
  if (timer) clearTimeout(timer);
120005
120422
  timer = setTimeout(function () {
120006
120423
  timer = null;
120007
- fn.apply(_this8, args);
120424
+ fn.apply(_this11, args);
120008
120425
  }, delay);
120009
120426
  };
120010
120427
  }
120011
120428
  }
120012
- });
120429
+ };
120430
+ StandardFilterbar.Item = Item;
120431
+ StandardFilterbar.install = function (Vue) {
120432
+ Vue.component(StandardFilterbar.name, StandardFilterbar);
120433
+ Vue.component(Item.name, Item);
120434
+ };
120435
+ /* harmony default export */ const StandardFilterbarvue_type_script_lang_js = (StandardFilterbar);
120013
120436
  ;// ./src/components/StandardFilterbar/index.vue?vue&type=script&lang=js
120014
120437
  /* harmony default export */ const components_StandardFilterbarvue_type_script_lang_js = (StandardFilterbarvue_type_script_lang_js);
120015
- // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/index.vue?vue&type=style&index=0&id=a1e74ef8&prod&lang=scss
120016
- var StandardFilterbarvue_type_style_index_0_id_a1e74ef8_prod_lang_scss = __webpack_require__(5229);
120017
- ;// ./src/components/StandardFilterbar/index.vue?vue&type=style&index=0&id=a1e74ef8&prod&lang=scss
120438
+ // EXTERNAL MODULE: ./node_modules/vue-style-loader/index.js??clonedRuleSet-64.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-64.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[2]!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-64.use[3]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-64.use[4]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardFilterbar/index.vue?vue&type=style&index=0&id=042f1c58&prod&lang=scss
120439
+ var StandardFilterbarvue_type_style_index_0_id_042f1c58_prod_lang_scss = __webpack_require__(8859);
120440
+ ;// ./src/components/StandardFilterbar/index.vue?vue&type=style&index=0&id=042f1c58&prod&lang=scss
120018
120441
 
120019
120442
  ;// ./src/components/StandardFilterbar/index.vue
120020
120443
 
@@ -120027,8 +120450,8 @@ var StandardFilterbarvue_type_style_index_0_id_a1e74ef8_prod_lang_scss = __webpa
120027
120450
 
120028
120451
  var StandardFilterbar_component = normalizeComponent(
120029
120452
  components_StandardFilterbarvue_type_script_lang_js,
120030
- StandardFilterbarvue_type_template_id_a1e74ef8_render,
120031
- StandardFilterbarvue_type_template_id_a1e74ef8_staticRenderFns,
120453
+ StandardFilterbarvue_type_template_id_042f1c58_render,
120454
+ StandardFilterbarvue_type_template_id_042f1c58_staticRenderFns,
120032
120455
  false,
120033
120456
  null,
120034
120457
  null,
@@ -120036,7 +120459,7 @@ var StandardFilterbar_component = normalizeComponent(
120036
120459
 
120037
120460
  )
120038
120461
 
120039
- /* harmony default export */ const StandardFilterbar = (StandardFilterbar_component.exports);
120462
+ /* harmony default export */ const components_StandardFilterbar = (StandardFilterbar_component.exports);
120040
120463
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardForm/index.vue?vue&type=template&id=16c030ac
120041
120464
  var StandardFormvue_type_template_id_16c030ac_render = function render() {
120042
120465
  var _vm = this,
@@ -120202,7 +120625,7 @@ var Itemvue_type_template_id_ccd7639c_staticRenderFns = [];
120202
120625
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardForm/Item.vue?vue&type=script&lang=js
120203
120626
  // 注意:standard-form-item 的全部样式已统一在 ./StandardForm.scss 中
120204
120627
  // (与父组件 StandardForm 共用同一份样式文件,避免重复注入)
120205
- /* harmony default export */ const Itemvue_type_script_lang_js = ({
120628
+ /* harmony default export */ const StandardForm_Itemvue_type_script_lang_js = ({
120206
120629
  name: "StandardFormItem",
120207
120630
  props: {
120208
120631
  // 标签文案(参与 label-width 自动计算)
@@ -120260,7 +120683,7 @@ var Itemvue_type_template_id_ccd7639c_staticRenderFns = [];
120260
120683
  }
120261
120684
  });
120262
120685
  ;// ./src/components/StandardForm/Item.vue?vue&type=script&lang=js
120263
- /* harmony default export */ const StandardForm_Itemvue_type_script_lang_js = (Itemvue_type_script_lang_js);
120686
+ /* harmony default export */ const components_StandardForm_Itemvue_type_script_lang_js = (StandardForm_Itemvue_type_script_lang_js);
120264
120687
  ;// ./src/components/StandardForm/Item.vue
120265
120688
 
120266
120689
 
@@ -120269,8 +120692,8 @@ var Itemvue_type_template_id_ccd7639c_staticRenderFns = [];
120269
120692
 
120270
120693
  /* normalize component */
120271
120694
  ;
120272
- var Item_component = normalizeComponent(
120273
- StandardForm_Itemvue_type_script_lang_js,
120695
+ var StandardForm_Item_component = normalizeComponent(
120696
+ components_StandardForm_Itemvue_type_script_lang_js,
120274
120697
  Itemvue_type_template_id_ccd7639c_render,
120275
120698
  Itemvue_type_template_id_ccd7639c_staticRenderFns,
120276
120699
  false,
@@ -120280,7 +120703,7 @@ var Item_component = normalizeComponent(
120280
120703
 
120281
120704
  )
120282
120705
 
120283
- /* harmony default export */ const Item = (Item_component.exports);
120706
+ /* harmony default export */ const StandardForm_Item = (StandardForm_Item_component.exports);
120284
120707
  ;// ./src/components/StandardForm/index.js
120285
120708
  /**
120286
120709
  * StandardForm 通用表单组件入口
@@ -120303,12 +120726,12 @@ var Item_component = normalizeComponent(
120303
120726
 
120304
120727
 
120305
120728
  // 将子组件挂载为静态属性,方便引用方统一引入注册
120306
- StandardForm.Item = Item;
120729
+ StandardForm.Item = StandardForm_Item;
120307
120730
 
120308
120731
  // 支持 Vue.use 全局注册
120309
120732
  StandardForm.install = function (Vue) {
120310
120733
  Vue.component(StandardForm.name, StandardForm);
120311
- Vue.component(Item.name, Item);
120734
+ Vue.component(StandardForm_Item.name, StandardForm_Item);
120312
120735
  };
120313
120736
  /* harmony default export */ const components_StandardForm = (StandardForm);
120314
120737
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardHalfArea/index.vue?vue&type=template&id=7888c782&scoped=true
@@ -121109,8 +121532,8 @@ var StandardTimePick_component = normalizeComponent(
121109
121532
  )
121110
121533
 
121111
121534
  /* harmony default export */ const StandardTimePick = (StandardTimePick_component.exports);
121112
- ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/index.vue?vue&type=template&id=a9e9136a
121113
- var StandardTablevue_type_template_id_a9e9136a_render = function render() {
121535
+ ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/loaders/templateLoader.js??ruleSet[1].rules[3]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/index.vue?vue&type=template&id=24e29a8b
121536
+ var StandardTablevue_type_template_id_24e29a8b_render = function render() {
121114
121537
  var _vm = this,
121115
121538
  _c = _vm._self._c;
121116
121539
  return _c('section', {
@@ -121360,6 +121783,7 @@ var StandardTablevue_type_template_id_a9e9136a_render = function render() {
121360
121783
  },
121361
121784
  on: {
121362
121785
  "menu-click": _vm.onMenuClick,
121786
+ "resizable-change": _vm.onColumnResizableChange,
121363
121787
  "checkbox-change": _vm.handleCheckboxChange,
121364
121788
  "checkbox-all": _vm.handleCheckboxChange,
121365
121789
  "current-change": _vm.handleCurrentRowChange,
@@ -121389,7 +121813,7 @@ var StandardTablevue_type_template_id_a9e9136a_render = function render() {
121389
121813
  "type": col.type,
121390
121814
  "field": col.field,
121391
121815
  "title": col.title,
121392
- "width": col.isOp ? col.width : undefined,
121816
+ "width": col.isOp ? col.width : col.userWidth || undefined,
121393
121817
  "min-width": col.minWidth,
121394
121818
  "fixed": col.fixed,
121395
121819
  "align": col.align,
@@ -121444,7 +121868,7 @@ var StandardTablevue_type_template_id_a9e9136a_render = function render() {
121444
121868
  }
121445
121869
  }) : _vm.getFooterEmptyVisible() ? _c('standard-footer-empty') : _vm._e()], 1);
121446
121870
  };
121447
- var StandardTablevue_type_template_id_a9e9136a_staticRenderFns = [];
121871
+ var StandardTablevue_type_template_id_24e29a8b_staticRenderFns = [];
121448
121872
 
121449
121873
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/ToolbarEmpty.vue?vue&type=script&lang=js
121450
121874
  /**
@@ -121531,6 +121955,467 @@ var FooterEmpty_component = normalizeComponent(
121531
121955
  )
121532
121956
 
121533
121957
  /* harmony default export */ const FooterEmpty = (FooterEmpty_component.exports);
121958
+ ;// ./src/components/StandardTable/columnConfigApi.js
121959
+ /**
121960
+ * 表头配置接口。路径固定,请求方法由业务项目注入。
121961
+ * IP 和端口来自该请求方法自己的 baseURL,组件库不保存主机地址。
121962
+ */
121963
+ var GET_CONFIG = '/api/SYS/UserTableColumn/GetUserTableConfig';
121964
+ var SAVE_CONFIG = '/api/SYS/UserTableColumn/SaveUserTableConfig';
121965
+ var RESET_CONFIG = '/api/SYS/UserTableColumn/ResetUserTableConfig';
121966
+ var columnConfigApi = null;
121967
+ var columnModuleCode = '';
121968
+
121969
+ // 同一模块、同一页面内 table-code 的占用者,用于发现重复编码
121970
+ var tableCodeOwners = Object.create(null);
121971
+ function setColumnConfigRequest(request) {
121972
+ if (typeof request !== 'function') {
121973
+ columnConfigApi = null;
121974
+ return;
121975
+ }
121976
+ columnConfigApi = {
121977
+ // 一次取当前用户的全部表头。表格渲染不调用它,由业务程序写入本地 TableSetting
121978
+ get: function get() {
121979
+ return request({
121980
+ url: GET_CONFIG,
121981
+ method: 'get'
121982
+ });
121983
+ },
121984
+ save: function save(moduleCode, pageCode, tableCode, columns) {
121985
+ return request({
121986
+ url: SAVE_CONFIG,
121987
+ method: 'post',
121988
+ data: {
121989
+ ModuleCode: moduleCode,
121990
+ PageCode: pageCode,
121991
+ TableCode: tableCode,
121992
+ SchemaVersion: 1,
121993
+ Columns: columns
121994
+ }
121995
+ });
121996
+ },
121997
+ reset: function reset(moduleCode, pageCode, tableCode) {
121998
+ return request({
121999
+ url: RESET_CONFIG,
122000
+ method: 'post',
122001
+ data: {
122002
+ ModuleCode: moduleCode,
122003
+ PageCode: pageCode,
122004
+ TableCode: tableCode
122005
+ }
122006
+ });
122007
+ }
122008
+ };
122009
+ }
122010
+ function getColumnConfigApi() {
122011
+ return columnConfigApi;
122012
+ }
122013
+ function setColumnModuleCode(code) {
122014
+ columnModuleCode = code != null ? String(code).trim() : '';
122015
+ }
122016
+ function getColumnModuleCode() {
122017
+ return columnModuleCode;
122018
+ }
122019
+ function tableCodeKey(moduleCode, pageCode, tableCode) {
122020
+ return moduleCode + '\n' + pageCode + '\n' + tableCode;
122021
+ }
122022
+
122023
+ // 登记表格编码。同一模块的同一页面已被其它表格占用时返回 false
122024
+ function claimTableCode(moduleCode, pageCode, tableCode, owner) {
122025
+ var key = tableCodeKey(moduleCode, pageCode, tableCode);
122026
+ var current = tableCodeOwners[key];
122027
+ if (current && current !== owner) return false;
122028
+ tableCodeOwners[key] = owner;
122029
+ return true;
122030
+ }
122031
+ function releaseTableCode(moduleCode, pageCode, tableCode, owner) {
122032
+ var key = tableCodeKey(moduleCode, pageCode, tableCode);
122033
+ if (tableCodeOwners[key] === owner) delete tableCodeOwners[key];
122034
+ }
122035
+ ;// ./src/components/StandardTable/columnPersist.js
122036
+ 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; }
122037
+ function columnPersist_toPropertyKey(t) { var i = columnPersist_toPrimitive(t, "string"); return "symbol" == columnPersist_typeof(i) ? i : i + ""; }
122038
+ 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); }
122039
+ 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); }
122040
+ /**
122041
+ * 表头配置的列主键、合并和提交数据。
122042
+ * 持久化主键不能使用 Vue 的 _uid,每次进入页面都会变化。
122043
+ */
122044
+
122045
+ // 列稳定主键:显式 column-key > field:字段名 > type:类型
122046
+ function resolveColumnKey(comp) {
122047
+ if (!comp) return '';
122048
+ var custom = comp.columnKey != null ? String(comp.columnKey).trim() : '';
122049
+ if (custom) return custom;
122050
+ if (comp.field) return 'field:' + comp.field;
122051
+ if (comp.type) return 'type:' + comp.type;
122052
+ return '';
122053
+ }
122054
+
122055
+ // 同一张表里主键重复时返回该主键,否则返回空串
122056
+ function findDuplicateColumnKey(comps) {
122057
+ var seen = Object.create(null);
122058
+ var list = Array.isArray(comps) ? comps : [];
122059
+ for (var i = 0; i < list.length; i++) {
122060
+ var key = resolveColumnKey(list[i]);
122061
+ if (!key) continue;
122062
+ if (seen[key]) return key;
122063
+ seen[key] = true;
122064
+ }
122065
+ return '';
122066
+ }
122067
+
122068
+ // 接口字段与 C# 属性名一致。已保存的小写字段仍可读。
122069
+ function readSavedColumn(item) {
122070
+ if (!item || columnPersist_typeof(item) !== 'object') return null;
122071
+ var columnKey = item.ColumnKey != null ? item.ColumnKey : item.columnKey;
122072
+ if (columnKey == null || String(columnKey).trim() === '') return null;
122073
+ return {
122074
+ columnKey: String(columnKey).trim(),
122075
+ sortNo: item.SortNo != null ? item.SortNo : item.sortNo,
122076
+ visible: item.Visible != null ? item.Visible : item.visible,
122077
+ fixed: item.Fixed != null ? item.Fixed : item.fixed,
122078
+ minWidth: item.MinWidth !== undefined ? item.MinWidth : item.minWidth,
122079
+ width: item.Width !== undefined ? item.Width : item.width,
122080
+ sortable: item.Sortable !== undefined ? item.Sortable : item.sortable
122081
+ };
122082
+ }
122083
+ function savedFixed(value) {
122084
+ return value === 'left' || value === 'right' ? value : '';
122085
+ }
122086
+ function savedMinWidth(value) {
122087
+ var width = Number(value);
122088
+ if (value == null || value === '' || !(width >= 1) || width > 500) return null;
122089
+ return Math.round(width);
122090
+ }
122091
+ function savedWidth(value) {
122092
+ var width = Number(value);
122093
+ if (value == null || value === '' || !(width >= 60) || width > 2000) return null;
122094
+ return Math.round(width);
122095
+ }
122096
+
122097
+ /**
122098
+ * 用当前代码列做主数据,把已保存列覆盖上去。
122099
+ * 新增列贴在代码声明顺序里、它前面最近一个仍存在的已保存列之后。
122100
+ * 返回 { order, states }。states 只包含命中的已保存列,新增列沿用注册时的默认状态。
122101
+ */
122102
+ function mergeColumnConfig(comps, savedColumns) {
122103
+ var list = Array.isArray(comps) ? comps.filter(Boolean) : [];
122104
+ var keyed = [];
122105
+ var unkeyed = [];
122106
+ list.forEach(function (comp) {
122107
+ var key = resolveColumnKey(comp);
122108
+ if (!key) unkeyed.push(comp);else keyed.push({
122109
+ comp: comp,
122110
+ key: key,
122111
+ uid: comp._uid
122112
+ });
122113
+ });
122114
+ var saved = (Array.isArray(savedColumns) ? savedColumns : []).map(readSavedColumn).filter(Boolean);
122115
+ if (!saved.length) return null;
122116
+ var codeMap = Object.create(null);
122117
+ keyed.forEach(function (item) {
122118
+ codeMap[item.key] = item;
122119
+ });
122120
+ var baseline = saved.filter(function (item) {
122121
+ return codeMap[item.columnKey];
122122
+ }).slice().sort(function (a, b) {
122123
+ return (Number(a.sortNo) || 0) - (Number(b.sortNo) || 0);
122124
+ }).map(function (item) {
122125
+ return {
122126
+ entry: codeMap[item.columnKey],
122127
+ saved: item
122128
+ };
122129
+ });
122130
+ var seen = Object.create(null);
122131
+ var rows = [];
122132
+ baseline.forEach(function (row) {
122133
+ if (seen[row.entry.key]) return;
122134
+ seen[row.entry.key] = true;
122135
+ rows.push(row);
122136
+ });
122137
+ keyed.forEach(function (codeCol, codeIndex) {
122138
+ if (seen[codeCol.key]) return;
122139
+ var insertAt = rows.length;
122140
+ var found = false;
122141
+ var _loop = function _loop(i) {
122142
+ var pos = rows.findIndex(function (row) {
122143
+ return row.entry.key === keyed[i].key;
122144
+ });
122145
+ if (pos >= 0) {
122146
+ insertAt = pos + 1;
122147
+ found = true;
122148
+ return 1; // break
122149
+ }
122150
+ };
122151
+ for (var i = codeIndex - 1; i >= 0; i--) {
122152
+ if (_loop(i)) break;
122153
+ }
122154
+ if (!found) {
122155
+ var _loop2 = function _loop2(_i) {
122156
+ var pos = rows.findIndex(function (row) {
122157
+ return row.entry.key === keyed[_i].key;
122158
+ });
122159
+ if (pos >= 0) {
122160
+ insertAt = pos;
122161
+ return 1; // break
122162
+ }
122163
+ };
122164
+ for (var _i = codeIndex + 1; _i < keyed.length; _i++) {
122165
+ if (_loop2(_i)) break;
122166
+ }
122167
+ }
122168
+ rows.splice(insertAt, 0, {
122169
+ entry: codeCol,
122170
+ saved: null
122171
+ });
122172
+ seen[codeCol.key] = true;
122173
+ });
122174
+ var order = rows.map(function (row) {
122175
+ return row.entry.uid;
122176
+ });
122177
+ unkeyed.forEach(function (comp) {
122178
+ return order.push(comp._uid);
122179
+ });
122180
+ var states = [];
122181
+ rows.forEach(function (row) {
122182
+ if (!row.saved) return;
122183
+ var comp = row.entry.comp;
122184
+ states.push({
122185
+ uid: row.entry.uid,
122186
+ state: {
122187
+ visible: row.saved.visible !== false,
122188
+ fixed: savedFixed(row.saved.fixed),
122189
+ minWidth: savedMinWidth(row.saved.minWidth),
122190
+ width: savedWidth(row.saved.width),
122191
+ sortable: row.saved.sortable != null ? !!row.saved.sortable : !!comp.sortable
122192
+ }
122193
+ });
122194
+ });
122195
+ return {
122196
+ order: order,
122197
+ states: states
122198
+ };
122199
+ }
122200
+
122201
+ // 提交给保存接口的列数组。顺序按当前 columnOrder,sortNo 从 0 连续编号
122202
+ function buildColumnPayload(comps, order, states) {
122203
+ var map = Object.create(null);
122204
+ (Array.isArray(comps) ? comps : []).forEach(function (comp) {
122205
+ if (comp) map[comp._uid] = comp;
122206
+ });
122207
+ var columns = [];
122208
+ (Array.isArray(order) ? order : []).forEach(function (uid) {
122209
+ var comp = map[uid];
122210
+ if (!comp) return;
122211
+ var key = resolveColumnKey(comp);
122212
+ if (!key) return;
122213
+ var st = states && states[uid] ? states[uid] : {};
122214
+ columns.push({
122215
+ ColumnKey: key,
122216
+ SortNo: columns.length,
122217
+ Visible: st.visible !== false,
122218
+ Fixed: savedFixed(st.fixed),
122219
+ MinWidth: savedMinWidth(st.minWidth),
122220
+ Width: savedWidth(st.width),
122221
+ Sortable: !!st.sortable
122222
+ });
122223
+ });
122224
+ return columns;
122225
+ }
122226
+
122227
+ // 与代码声明完全一致时走删除接口,避免把当时的默认值冻住
122228
+ function isDefaultColumnPayload(comps, columns) {
122229
+ var keyed = (Array.isArray(comps) ? comps : []).filter(function (comp) {
122230
+ return resolveColumnKey(comp);
122231
+ });
122232
+ if (!Array.isArray(columns) || keyed.length !== columns.length) return false;
122233
+ for (var i = 0; i < keyed.length; i++) {
122234
+ var comp = keyed[i];
122235
+ var col = columns[i];
122236
+ if (!col || col.ColumnKey !== resolveColumnKey(comp)) return false;
122237
+ if (col.Visible !== true) return false;
122238
+ if ((col.Fixed || '') !== (comp.fixed || '')) return false;
122239
+ if (!!col.Sortable !== !!comp.sortable) return false;
122240
+ if (col.Width != null) return false;
122241
+ if (col.MinWidth != null && Number(col.MinWidth) !== Number(comp.resolvedMinWidth)) return false;
122242
+ }
122243
+ return true;
122244
+ }
122245
+
122246
+ // 从 Datas 取出列数组。字段名优先用属性名 Columns,兼容 columns。
122247
+ function readSavedColumns(datas) {
122248
+ if (!datas || columnPersist_typeof(datas) !== 'object') return null;
122249
+ var columns = datas.Columns != null ? datas.Columns : datas.columns;
122250
+ if (!Array.isArray(columns)) return null;
122251
+ return columns.map(readSavedColumn).filter(Boolean);
122252
+ }
122253
+
122254
+ // 业务项目 axios 拦截器返回 { code, data: { Success, Content, Datas } }
122255
+ function readColumnConfigDatas(res) {
122256
+ if (res && res.code == 200 && res.data) {
122257
+ if (!res.data.Success) throw new Error(res.data.Content || '表头配置请求失败');
122258
+ return res.data.Datas == null ? null : res.data.Datas;
122259
+ }
122260
+ if (res && res.Success) return res.Datas == null ? null : res.Datas;
122261
+ var content = res && res.data && res.data.Content;
122262
+ throw new Error(content || '表头配置请求失败');
122263
+ }
122264
+
122265
+ // 其它程序把 GetConfig 的响应写入 localStorage.TableSetting。键为「模块/页面/表格」,值为 CLAYOUT 原文。
122266
+ var TABLE_SETTING_STORE = 'TableSetting';
122267
+ function buildColumnSettingKey(moduleCode, pageCode, tableCode) {
122268
+ return moduleCode + '/' + pageCode + '/' + tableCode;
122269
+ }
122270
+ function readTableSettingRoot() {
122271
+ if (typeof window === 'undefined' || !window.localStorage) return {
122272
+ missing: true
122273
+ };
122274
+ try {
122275
+ var raw = window.localStorage.getItem(TABLE_SETTING_STORE);
122276
+ if (raw == null || raw === '') return {
122277
+ missing: true
122278
+ };
122279
+ var root = JSON.parse(raw);
122280
+ // 个别调用方会把已经 stringify 过的响应再存一次
122281
+ if (typeof root === 'string') root = JSON.parse(root);
122282
+ return {
122283
+ missing: false,
122284
+ root: root
122285
+ };
122286
+ } catch (e) {
122287
+ console.warn('[StandardTable] TableSetting 解析失败');
122288
+ return {
122289
+ invalid: true
122290
+ };
122291
+ }
122292
+ }
122293
+ function writeTableSettingRoot(root) {
122294
+ window.localStorage.setItem(TABLE_SETTING_STORE, JSON.stringify(root));
122295
+ }
122296
+
122297
+ // 响应可能整包存入,也可能只存 Datas。沿 code/data/Datas 找到字典数组。
122298
+ function findLayoutArray(node, depth) {
122299
+ if (depth > 5 || node == null) return null;
122300
+ if (Array.isArray(node)) {
122301
+ if (!node.length || node.every(function (item) {
122302
+ return item && columnPersist_typeof(item) === 'object' && !Array.isArray(item);
122303
+ })) return node;
122304
+ return null;
122305
+ }
122306
+ if (columnPersist_typeof(node) !== 'object') return null;
122307
+ var fields = ['Datas', 'datas', 'data'];
122308
+ for (var i = 0; i < fields.length; i++) {
122309
+ if (!Object.prototype.hasOwnProperty.call(node, fields[i])) continue;
122310
+ var found = findLayoutArray(node[fields[i]], depth + 1);
122311
+ if (found) return found;
122312
+ }
122313
+ return null;
122314
+ }
122315
+ function isFlatLayoutMap(node) {
122316
+ if (!node || columnPersist_typeof(node) !== 'object' || Array.isArray(node)) return false;
122317
+ return Object.keys(node).some(function (key) {
122318
+ return key.indexOf('/') >= 0;
122319
+ });
122320
+ }
122321
+
122322
+ // Datas 为 null 的成功响应,补一个空数组后再写入,避免改掉外层结构
122323
+ function ensureLayoutArray(root) {
122324
+ var list = findLayoutArray(root, 0);
122325
+ if (list) return list;
122326
+ if (!root || columnPersist_typeof(root) !== 'object' || Array.isArray(root)) return null;
122327
+ 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;
122328
+ if (!holder) return null;
122329
+ var field = 'datas' in holder && !('Datas' in holder) ? 'datas' : 'Datas';
122330
+ holder[field] = [];
122331
+ return holder[field];
122332
+ }
122333
+
122334
+ // CLAYOUT 是列数组的 JSON 字符串。兼容已解析的数组,以及旧的 { Columns } 结构。
122335
+ function parseLayoutColumns(value) {
122336
+ var data = value;
122337
+ for (var i = 0; i < 2 && typeof data === 'string'; i++) {
122338
+ var text = data.trim();
122339
+ if (!text) return null;
122340
+ try {
122341
+ data = JSON.parse(text);
122342
+ } catch (e) {
122343
+ return null;
122344
+ }
122345
+ }
122346
+ if (Array.isArray(data)) return data;
122347
+ if (data && columnPersist_typeof(data) === 'object') {
122348
+ var columns = data.Columns != null ? data.Columns : data.columns;
122349
+ if (Array.isArray(columns)) return columns;
122350
+ }
122351
+ return null;
122352
+ }
122353
+ function layoutJson(columns) {
122354
+ return JSON.stringify(Array.isArray(columns) ? columns : []);
122355
+ }
122356
+ function readCachedColumnLayout(moduleCode, pageCode, tableCode) {
122357
+ var stored = readTableSettingRoot();
122358
+ if (stored.missing || stored.invalid) return null;
122359
+ var key = buildColumnSettingKey(moduleCode, pageCode, tableCode);
122360
+ var list = findLayoutArray(stored.root, 0);
122361
+ if (list) {
122362
+ for (var i = list.length - 1; i >= 0; i--) {
122363
+ var item = list[i];
122364
+ if (item && Object.prototype.hasOwnProperty.call(item, key)) return parseLayoutColumns(item[key]);
122365
+ }
122366
+ return null;
122367
+ }
122368
+ if (isFlatLayoutMap(stored.root) && Object.prototype.hasOwnProperty.call(stored.root, key)) {
122369
+ return parseLayoutColumns(stored.root[key]);
122370
+ }
122371
+ return null;
122372
+ }
122373
+ function updateCachedColumnLayout(moduleCode, pageCode, tableCode, columns) {
122374
+ var key = buildColumnSettingKey(moduleCode, pageCode, tableCode);
122375
+ var value = layoutJson(columns);
122376
+ var stored = readTableSettingRoot();
122377
+ if (stored.invalid) return;
122378
+ if (stored.missing) {
122379
+ writeTableSettingRoot([columnPersist_defineProperty({}, key, value)]);
122380
+ return;
122381
+ }
122382
+ var list = ensureLayoutArray(stored.root);
122383
+ if (list) {
122384
+ var hit = null;
122385
+ for (var i = 0; i < list.length; i++) {
122386
+ if (list[i] && Object.prototype.hasOwnProperty.call(list[i], key)) hit = list[i];
122387
+ }
122388
+ if (hit) hit[key] = value;else list.push(columnPersist_defineProperty({}, key, value));
122389
+ writeTableSettingRoot(stored.root);
122390
+ return;
122391
+ }
122392
+ if (isFlatLayoutMap(stored.root)) {
122393
+ stored.root[key] = value;
122394
+ writeTableSettingRoot(stored.root);
122395
+ return;
122396
+ }
122397
+ console.warn('[StandardTable] TableSetting 结构无法识别,未更新本地表头配置');
122398
+ }
122399
+ function removeCachedColumnLayout(moduleCode, pageCode, tableCode) {
122400
+ var key = buildColumnSettingKey(moduleCode, pageCode, tableCode);
122401
+ var stored = readTableSettingRoot();
122402
+ if (stored.missing || stored.invalid) return;
122403
+ var list = findLayoutArray(stored.root, 0);
122404
+ if (list) {
122405
+ for (var i = list.length - 1; i >= 0; i--) {
122406
+ var item = list[i];
122407
+ if (!item || !Object.prototype.hasOwnProperty.call(item, key)) continue;
122408
+ delete item[key];
122409
+ if (!Object.keys(item).length) list.splice(i, 1);
122410
+ }
122411
+ writeTableSettingRoot(stored.root);
122412
+ return;
122413
+ }
122414
+ if (isFlatLayoutMap(stored.root) && Object.prototype.hasOwnProperty.call(stored.root, key)) {
122415
+ delete stored.root[key];
122416
+ writeTableSettingRoot(stored.root);
122417
+ }
122418
+ }
121534
122419
  ;// ./node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib/index.js??clonedRuleSet-82.use[1]!./node_modules/@vue/vue-loader-v15/lib/index.js??vue-loader-options!./src/components/StandardTable/index.vue?vue&type=script&lang=js
121535
122420
  function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || StandardTablevue_type_script_lang_js_unsupportedIterableToArray(r, e) || _nonIterableRest(); }
121536
122421
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
@@ -121545,6 +122430,8 @@ function StandardTablevue_type_script_lang_js_arrayLikeToArray(r, a) { (null ==
121545
122430
  ;
121546
122431
 
121547
122432
 
122433
+
122434
+
121548
122435
  // 将单元格渲染结果归一化为 VNode:
121549
122436
  // Vue 2 函数式组件只接受 VNode / VNode 数组作为渲染结果,
121550
122437
  // 纯字符串、数字等原始值会被直接丢弃(表现为空白单元格),
@@ -121721,10 +122608,10 @@ var NormalReportSlotView = {
121721
122608
  type: Boolean,
121722
122609
  "default": false
121723
122610
  },
121724
- // 是否显示表格右上角“调整”按钮(列设置弹层)
122611
+ // 是否显示表格右上角“调整”按钮(列设置弹层),默认显示;传 false 隐藏
121725
122612
  showAdjustment: {
121726
122613
  type: Boolean,
121727
- "default": false
122614
+ "default": true
121728
122615
  },
121729
122616
  // 是否显示表格左下方“数据更新时间”
121730
122617
  showUpdateTime: {
@@ -121761,6 +122648,17 @@ var NormalReportSlotView = {
121761
122648
  showFooter: {
121762
122649
  type: Boolean,
121763
122650
  "default": false
122651
+ },
122652
+ // 表格编码。按「当前登录用户 + 模块 + 页面 + 表格」读写表头配置,同一页面内必须唯一。
122653
+ // 未传时使用组件 ref;ref 也没有时不访问服务端
122654
+ tableCode: {
122655
+ type: String,
122656
+ "default": ''
122657
+ },
122658
+ // 页面编码。不传时使用当前路由 name;没有 name 时使用不含查询参数的 path
122659
+ pageCode: {
122660
+ type: String,
122661
+ "default": ''
121764
122662
  }
121765
122663
  },
121766
122664
  data: function data() {
@@ -121832,7 +122730,14 @@ var NormalReportSlotView = {
121832
122730
  // 尺寸变化防抖定时器
121833
122731
  // 首屏先让 standard-column 在 created 中注册完,再渲染 vxe-column。
121834
122732
  // 否则第一次往往只有操作列,vxe-table 会固化它的插槽,随后数据列插入后操作列变空白
121835
- columnsReady: false
122733
+ columnsReady: false,
122734
+ // 表头配置已完成首次加载后才允许写回,避免加载过程中的默认状态覆盖服务端
122735
+ columnConfigReady: false,
122736
+ columnConfigDisabled: false,
122737
+ columnConfigDirty: false,
122738
+ columnConfigSettled: false,
122739
+ columnConfigTimer: null,
122740
+ columnConfigSaveTimer: null
121836
122741
  };
121837
122742
  },
121838
122743
  computed: {
@@ -121840,13 +122745,9 @@ var NormalReportSlotView = {
121840
122745
  hasFooterLeftSlot: function hasFooterLeftSlot() {
121841
122746
  return !!(this.$slots['footer-left'] || this.$scopedSlots['footer-left']);
121842
122747
  },
121843
- // 是否显示“调整”列设置按钮:主组件 showAdjustment 属性
121844
- // 或 toolbar-right 子组件 show-adjustment 属性(任一为 true 即显示)
122748
+ // 是否显示“调整”列设置按钮,由主组件 show-adjustment 决定;false 时隐藏
121845
122749
  resolvedShowAdjustment: function resolvedShowAdjustment() {
121846
- if (this.showAdjustment) return true;
121847
- return this.toolbarRightInstances.some(function (inst) {
121848
- return !!inst.showAdjustment;
121849
- });
122750
+ return this.showAdjustment;
121850
122751
  },
121851
122752
  // 操作列按钮列表(tableOperation 属性)
121852
122753
  opButtons: function opButtons() {
@@ -121990,6 +122891,8 @@ var NormalReportSlotView = {
121990
122891
  title: comp.title,
121991
122892
  // 列宽:仅取列组件声明宽度(列设置弹层调整的是列最小宽度)
121992
122893
  width: comp.width,
122894
+ // 用户拖拽表头得到的实际列宽。未拖过时不传给 vxe,仍由 min-width 分配
122895
+ userWidth: st && st.width != null ? st.width : null,
121993
122896
  // 列最小宽度(对应 vxe-table min-width):优先取列设置弹层设置的值(px),
121994
122897
  // 未设置时取列组件 resolvedMinWidth(显式传入值或按标题自动计算)
121995
122898
  minWidth: st && st.minWidth != null ? st.minWidth : comp.resolvedMinWidth,
@@ -122037,6 +122940,7 @@ var NormalReportSlotView = {
122037
122940
  field: c.field || undefined,
122038
122941
  title: c.title,
122039
122942
  width: c.width || undefined,
122943
+ userWidth: c.userWidth || undefined,
122040
122944
  minWidth: c.minWidth,
122041
122945
  treeNode: !!c.treeNode,
122042
122946
  fixed: c.fixed || undefined,
@@ -122111,24 +123015,25 @@ var NormalReportSlotView = {
122111
123015
  }
122112
123016
  },
122113
123017
  mounted: function mounted() {
122114
- var _this4 = this;
122115
123018
  this.initResizeObserver();
122116
123019
  // 表头拖拽排序结束后抑制一次 click(document 捕获阶段拦截,防止拖拽结束触发排序切换)
122117
123020
  document.addEventListener('click', this.onDocumentClickCapture, true);
122118
- // 本次 patch 中 standard-column 的 created 已经完成注册,此刻再放行列
122119
- this.columnsReady = true;
122120
- // 列挂载后再重算。height="100%" 要等浏览器完成 flex 布局才有父容器高度,
122121
- // 只在 nextTick 里算会把表体高度当成内容高度,滚动条不再出现
122122
- this.$nextTick(function () {
122123
- _this4.resizeRecalculate();
122124
- if (typeof requestAnimationFrame === 'function') {
122125
- requestAnimationFrame(function () {
122126
- return _this4.resizeRecalculate();
122127
- });
122128
- }
122129
- });
123021
+ // 列已在子组件 created 中注册完成。能确定表格编码时先合并历史配置,再放行表头
123022
+ this.bootstrapColumnConfig();
122130
123023
  },
122131
123024
  beforeDestroy: function beforeDestroy() {
123025
+ this.columnConfigSettled = true;
123026
+ if (this.columnConfigTimer) {
123027
+ clearTimeout(this.columnConfigTimer);
123028
+ this.columnConfigTimer = null;
123029
+ }
123030
+ // 直接改表头的保存还在 3 秒防抖里,离开页面时把最后一次调整写回去
123031
+ if (this.columnConfigSaveTimer) {
123032
+ clearTimeout(this.columnConfigSaveTimer);
123033
+ this.columnConfigSaveTimer = null;
123034
+ this.persistColumnConfig();
123035
+ }
123036
+ this.releaseColumnConfigClaim();
122132
123037
  this.destroyResizeObserver();
122133
123038
  document.removeEventListener('click', this.onDocumentClickCapture, true);
122134
123039
  this.clearHeaderDragBindings();
@@ -122151,51 +123056,51 @@ var NormalReportSlotView = {
122151
123056
  },
122152
123057
  // 工具栏左侧子组件 vnode(渲染到操作区左侧)
122153
123058
  getToolbarLeftVNodes: function getToolbarLeftVNodes() {
122154
- var _this5 = this;
123059
+ var _this4 = this;
122155
123060
  return this.getDefaultSlotVNodes().filter(function (v) {
122156
- return _this5.isVNodeOfType(v, TOOLBAR_LEFT_TYPES);
123061
+ return _this4.isVNodeOfType(v, TOOLBAR_LEFT_TYPES);
122157
123062
  });
122158
123063
  },
122159
123064
  // 工具栏右侧子组件 vnode(渲染到操作区右侧)
122160
123065
  getToolbarRightVNodes: function getToolbarRightVNodes() {
122161
- var _this6 = this;
123066
+ var _this5 = this;
122162
123067
  return this.getDefaultSlotVNodes().filter(function (v) {
122163
- return _this6.isVNodeOfType(v, TOOLBAR_RIGHT_TYPES);
123068
+ return _this5.isVNodeOfType(v, TOOLBAR_RIGHT_TYPES);
122164
123069
  });
122165
123070
  },
122166
123071
  // 底部栏左侧子组件 vnode(渲染到底部栏左侧)
122167
123072
  getFooterLeftVNodes: function getFooterLeftVNodes() {
122168
- var _this7 = this;
123073
+ var _this6 = this;
122169
123074
  return this.getDefaultSlotVNodes().filter(function (v) {
122170
- return _this7.isVNodeOfType(v, FOOTER_LEFT_TYPES);
123075
+ return _this6.isVNodeOfType(v, FOOTER_LEFT_TYPES);
122171
123076
  });
122172
123077
  },
122173
123078
  // 底部栏右侧分页子组件 vnode(渲染到底部栏右侧)
122174
123079
  getFooterRightVNodes: function getFooterRightVNodes() {
122175
- var _this8 = this;
123080
+ var _this7 = this;
122176
123081
  return this.getDefaultSlotVNodes().filter(function (v) {
122177
- return _this8.isVNodeOfType(v, FOOTER_RIGHT_TYPES);
123082
+ return _this7.isVNodeOfType(v, FOOTER_RIGHT_TYPES);
122178
123083
  });
122179
123084
  },
122180
123085
  // 底部空占位子组件 vnode(页面声明时渲染,未声明时使用内置默认占位)
122181
123086
  getFooterEmptyVNodes: function getFooterEmptyVNodes() {
122182
- var _this9 = this;
123087
+ var _this8 = this;
122183
123088
  return this.getDefaultSlotVNodes().filter(function (v) {
122184
- return _this9.isVNodeOfType(v, FOOTER_EMPTY_TYPES);
123089
+ return _this8.isVNodeOfType(v, FOOTER_EMPTY_TYPES);
122185
123090
  });
122186
123091
  },
122187
123092
  // 工具栏空占位子组件 vnode(页面声明时渲染,未声明时使用内置默认占位)
122188
123093
  getToolbarEmptyVNodes: function getToolbarEmptyVNodes() {
122189
- var _this0 = this;
123094
+ var _this9 = this;
122190
123095
  return this.getDefaultSlotVNodes().filter(function (v) {
122191
- return _this0.isVNodeOfType(v, TOOLBAR_EMPTY_TYPES);
123096
+ return _this9.isVNodeOfType(v, TOOLBAR_EMPTY_TYPES);
122192
123097
  });
122193
123098
  },
122194
123099
  // 隐藏注册区 vnode:默认插槽中除区域子组件(工具栏/底部栏功能区 + 空占位)之外的内容
122195
123100
  getHiddenSlotVNodes: function getHiddenSlotVNodes() {
122196
- var _this1 = this;
123101
+ var _this0 = this;
122197
123102
  return this.getDefaultSlotVNodes().filter(function (v) {
122198
- return !_this1.isVNodeOfType(v, TOOLBAR_LEFT_TYPES) && !_this1.isVNodeOfType(v, TOOLBAR_RIGHT_TYPES) && !_this1.isVNodeOfType(v, FOOTER_LEFT_TYPES) && !_this1.isVNodeOfType(v, FOOTER_RIGHT_TYPES) && !_this1.isVNodeOfType(v, FOOTER_EMPTY_TYPES) && !_this1.isVNodeOfType(v, TOOLBAR_EMPTY_TYPES);
123103
+ return !_this0.isVNodeOfType(v, TOOLBAR_LEFT_TYPES) && !_this0.isVNodeOfType(v, TOOLBAR_RIGHT_TYPES) && !_this0.isVNodeOfType(v, FOOTER_LEFT_TYPES) && !_this0.isVNodeOfType(v, FOOTER_RIGHT_TYPES) && !_this0.isVNodeOfType(v, FOOTER_EMPTY_TYPES) && !_this0.isVNodeOfType(v, TOOLBAR_EMPTY_TYPES);
122199
123104
  });
122200
123105
  },
122201
123106
  // 操作区是否显示
@@ -122249,6 +123154,7 @@ var NormalReportSlotView = {
122249
123154
  visible: true,
122250
123155
  fixed: comp.fixed || '',
122251
123156
  minWidth: null,
123157
+ width: null,
122252
123158
  sortable: !!comp.sortable
122253
123159
  });
122254
123160
  if (this.columnOrder.indexOf(comp._uid) === -1) {
@@ -122317,7 +123223,7 @@ var NormalReportSlotView = {
122317
123223
  // 渲染单个操作按钮:active 为 false 时不再隐藏(原按 v-if 消失),
122318
123224
  // 改为渲染 disabled 按钮(变灰不可操作)
122319
123225
  renderOpButton: function renderOpButton(h, row, btn, idx) {
122320
- var _this10 = this;
123226
+ var _this1 = this;
122321
123227
  var active = this.isOpActive(btn, row);
122322
123228
  var data = {
122323
123229
  key: idx,
@@ -122328,7 +123234,7 @@ var NormalReportSlotView = {
122328
123234
  },
122329
123235
  on: {
122330
123236
  click: function click() {
122331
- return _this10.handleOpClick(row, btn);
123237
+ return _this1.handleOpClick(row, btn);
122332
123238
  }
122333
123239
  },
122334
123240
  // 阻止点击事件冒泡到表格单元格:
@@ -122350,7 +123256,7 @@ var NormalReportSlotView = {
122350
123256
  // 超出按钮渲染为 el-dropdown-item,点击后走与直接按钮一致的 handleOpClick;
122351
123257
  // active 为 false 的按钮以 disabled 形式变灰展示
122352
123258
  renderOpMore: function renderOpMore(h, row, restButtons) {
122353
- var _this11 = this;
123259
+ var _this10 = this;
122354
123260
  return h('el-dropdown', {
122355
123261
  key: '__normal_report_op_more__',
122356
123262
  "class": 'normal-report-op-more',
@@ -122360,7 +123266,7 @@ var NormalReportSlotView = {
122360
123266
  },
122361
123267
  on: {
122362
123268
  command: function command(btn) {
122363
- return _this11.handleOpClick(row, btn);
123269
+ return _this10.handleOpClick(row, btn);
122364
123270
  }
122365
123271
  },
122366
123272
  nativeOn: {
@@ -122378,7 +123284,7 @@ var NormalReportSlotView = {
122378
123284
  })]), h('el-dropdown-menu', {
122379
123285
  slot: 'dropdown'
122380
123286
  }, restButtons.map(function (btn, idx) {
122381
- var active = _this11.isOpActive(btn, row);
123287
+ var active = _this10.isOpActive(btn, row);
122382
123288
  return h('el-dropdown-item', {
122383
123289
  key: idx,
122384
123290
  props: {
@@ -122394,17 +123300,17 @@ var NormalReportSlotView = {
122394
123300
  // 渲染操作列:按钮 ≤ 3 个时全部直接渲染;超过 3 个时前 3 个直接渲染,
122395
123301
  // 其余统一收纳进“更多”下拉菜单;active 为 false 的按钮渲染为 disabled(变灰)
122396
123302
  renderOpCell: function renderOpCell(row, h) {
122397
- var _this12 = this;
123303
+ var _this11 = this;
122398
123304
  var createElement = h || this.$createElement;
122399
123305
  var btns = this.opButtons;
122400
123306
  if (!btns.length) return null;
122401
123307
  if (btns.length <= OP_MAX_DIRECT_COUNT) {
122402
123308
  return btns.map(function (btn, idx) {
122403
- return _this12.renderOpButton(createElement, row, btn, idx);
123309
+ return _this11.renderOpButton(createElement, row, btn, idx);
122404
123310
  });
122405
123311
  }
122406
123312
  var nodes = btns.slice(0, OP_MAX_DIRECT_COUNT).map(function (btn, idx) {
122407
- return _this12.renderOpButton(createElement, row, btn, idx);
123313
+ return _this11.renderOpButton(createElement, row, btn, idx);
122408
123314
  });
122409
123315
  nodes.push(this.renderOpMore(createElement, row, btns.slice(OP_MAX_DIRECT_COUNT)));
122410
123316
  return nodes;
@@ -122487,12 +123393,12 @@ var NormalReportSlotView = {
122487
123393
  },
122488
123394
  // 复制文本到剪贴板:优先使用现代 API,失败时降级 execCommand
122489
123395
  copyTextToClipboard: function copyTextToClipboard(text) {
122490
- var _this13 = this;
123396
+ var _this12 = this;
122491
123397
  if (navigator.clipboard && window.isSecureContext) {
122492
123398
  navigator.clipboard.writeText(text).then(function () {
122493
- _this13.$message && _this13.$message.success('复制成功:' + text);
123399
+ _this12.$message && _this12.$message.success('复制成功:' + text);
122494
123400
  })["catch"](function () {
122495
- _this13.fallbackCopyText(text);
123401
+ _this12.fallbackCopyText(text);
122496
123402
  });
122497
123403
  } else {
122498
123404
  this.fallbackCopyText(text);
@@ -122578,23 +123484,25 @@ var NormalReportSlotView = {
122578
123484
  // 切换列的排序开关:sortable 已纳入列 key,修改后强制重建列,
122579
123485
  // 再由 applyColumnOrder 恢复列顺序(重建会打乱 staticColumns 顺序)
122580
123486
  toggleHeaderColumnSort: function toggleHeaderColumnSort(uid) {
122581
- var _this14 = this;
123487
+ var _this13 = this;
122582
123488
  var st = this.columnStates[uid];
122583
123489
  if (!st) return;
122584
123490
  this.$set(st, 'sortable', !st.sortable);
123491
+ this.schedulePersistColumnConfig();
122585
123492
  this.$nextTick(function () {
122586
- return _this14.applyColumnOrder();
123493
+ return _this13.applyColumnOrder();
122587
123494
  });
122588
123495
  },
122589
123496
  // 切换列的固定状态(左/右固定互斥,再次点击同侧即取消):
122590
123497
  // fixed 同样纳入列 key,重建后 vxe-table 重新解析固定列分组
122591
123498
  toggleHeaderColumnFixed: function toggleHeaderColumnFixed(uid, side) {
122592
- var _this15 = this;
123499
+ var _this14 = this;
122593
123500
  var st = this.columnStates[uid];
122594
123501
  if (!st) return;
122595
123502
  this.$set(st, 'fixed', st.fixed === side ? '' : side);
123503
+ this.schedulePersistColumnConfig();
122596
123504
  this.$nextTick(function () {
122597
- return _this15.applyColumnOrder();
123505
+ return _this14.applyColumnOrder();
122598
123506
  });
122599
123507
  },
122600
123508
  // ===== 单元格编辑 =====
@@ -122710,7 +123618,7 @@ var NormalReportSlotView = {
122710
123618
  },
122711
123619
  // 交换列顺序(columnOrder 重排后强制同步 vxe-table 内部列配置)
122712
123620
  moveColumnOrder: function moveColumnOrder(fromUid, toUid) {
122713
- var _this16 = this;
123621
+ var _this15 = this;
122714
123622
  var from = this.columnOrder.indexOf(fromUid);
122715
123623
  var to = this.columnOrder.indexOf(toUid);
122716
123624
  if (from < 0 || to < 0 || from === to) return;
@@ -122718,8 +123626,9 @@ var NormalReportSlotView = {
122718
123626
  var moved = order.splice(from, 1)[0];
122719
123627
  order.splice(to, 0, moved);
122720
123628
  this.columnOrder = order;
123629
+ this.schedulePersistColumnConfig();
122721
123630
  this.$nextTick(function () {
122722
- return _this16.applyColumnOrder();
123631
+ return _this15.applyColumnOrder();
122723
123632
  });
122724
123633
  },
122725
123634
  // ===== 对外方法(父组件通过 ref 调用) =====
@@ -122757,14 +123666,14 @@ var NormalReportSlotView = {
122757
123666
  // 表现为固定列行与数据行错位。此处监听表格容器尺寸变化,防抖后
122758
123667
  // 重新计算布局并调用 refreshScroll() 强制同步各滚动层位置。
122759
123668
  initResizeObserver: function initResizeObserver() {
122760
- var _this17 = this;
123669
+ var _this16 = this;
122761
123670
  var wrapEl = this.$refs.tableWrap;
122762
123671
  if (!wrapEl) return;
122763
123672
  if (typeof ResizeObserver !== 'undefined') {
122764
123673
  // 首次通知也要重算。挂载时容器往往已有高度,但还不是 flex 约束后的高度,
122765
123674
  // 跳过这次就会把“内容撑开的高度”当成可视高度,滚动条不再出现
122766
123675
  this.resizeObserver = new ResizeObserver(function () {
122767
- _this17.scheduleTableRecalculate();
123676
+ _this16.scheduleTableRecalculate();
122768
123677
  });
122769
123678
  this.resizeObserver.observe(wrapEl);
122770
123679
  } else {
@@ -122774,23 +123683,23 @@ var NormalReportSlotView = {
122774
123683
  },
122775
123684
  // 防抖:连续尺寸变化(如拖拽分割线)停稳后再重算,读到的是最终宽高
122776
123685
  scheduleTableRecalculate: function scheduleTableRecalculate() {
122777
- var _this18 = this;
123686
+ var _this17 = this;
122778
123687
  if (this.resizeTimer) clearTimeout(this.resizeTimer);
122779
123688
  this.resizeTimer = setTimeout(function () {
122780
- _this18.resizeTimer = null;
122781
- _this18.resizeRecalculate();
123689
+ _this17.resizeTimer = null;
123690
+ _this17.resizeRecalculate();
122782
123691
  }, 50);
122783
123692
  },
122784
123693
  // 重新计算布局,并在重算完成后强制同步固定列与主表体的滚动位置。
122785
123694
  // 容器还没有宽度时 vxe 会直接跳过滚动计算,等下一次尺寸通知再算
122786
123695
  resizeRecalculate: function resizeRecalculate() {
122787
- var _this19 = this;
123696
+ var _this18 = this;
122788
123697
  var xTable = this.$refs.xTable;
122789
123698
  var wrapEl = this.$refs.tableWrap;
122790
123699
  if (!xTable) return;
122791
123700
  if (wrapEl && wrapEl.clientWidth === 0) return;
122792
123701
  var restore = function restore() {
122793
- _this19.$nextTick(function () {
123702
+ _this18.$nextTick(function () {
122794
123703
  if (xTable.refreshScroll) xTable.refreshScroll();
122795
123704
  });
122796
123705
  };
@@ -122857,7 +123766,7 @@ var NormalReportSlotView = {
122857
123766
  // ===== 列设置弹层 =====
122858
123767
  // 打开列设置:以当前注册列生成工作副本(每次打开都重新初始化)
122859
123768
  openColumnSetting: function openColumnSetting() {
122860
- var _this20 = this;
123769
+ var _this19 = this;
122861
123770
  var compMap = {};
122862
123771
  this.columnComps.forEach(function (comp) {
122863
123772
  compMap[comp._uid] = comp;
@@ -122885,7 +123794,7 @@ var NormalReportSlotView = {
122885
123794
  // 列标题宽度:按最长列名称计算(中文 25px/字 + 英文 15px/字 + 30px 余量),
122886
123795
  // 各列标题统一按该宽度显示,保证输入框与按钮对齐
122887
123796
  this.columnTitleWidth = this.columnDraft.reduce(function (max, c) {
122888
- return Math.max(max, _this20.calcColumnTitleWidth(c.title));
123797
+ return Math.max(max, _this19.calcColumnTitleWidth(c.title));
122889
123798
  }, 0);
122890
123799
  },
122891
123800
  // 计算单个列标题的显示宽度(px):中文 25px/字 + 英文 15px/字 + 30px 余量
@@ -122977,21 +123886,189 @@ var NormalReportSlotView = {
122977
123886
  },
122978
123887
  // 确认:将面板副本应用到列状态并刷新表格
122979
123888
  confirmColumnSetting: function confirmColumnSetting() {
122980
- var _this21 = this;
123889
+ var _this20 = this;
122981
123890
  var order = [];
122982
123891
  this.columnDraft.forEach(function (d) {
122983
- _this21.$set(_this21.columnStates, d.uid, {
123892
+ var prev = _this20.columnStates[d.uid] || {};
123893
+ _this20.$set(_this20.columnStates, d.uid, {
122984
123894
  visible: d.visible,
122985
123895
  fixed: d.fixed || '',
122986
123896
  minWidth: d.minWidth != null ? d.minWidth : null,
123897
+ width: prev.width != null ? prev.width : null,
122987
123898
  sortable: !!d.sortable
122988
123899
  });
122989
123900
  order.push(d.uid);
122990
123901
  });
122991
123902
  this.columnOrder = order;
122992
123903
  this.columnSettingVisible = false;
123904
+ this.persistColumnConfigNow();
122993
123905
  this.$nextTick(function () {
122994
- _this21.applyColumnOrder();
123906
+ _this20.applyColumnOrder();
123907
+ });
123908
+ },
123909
+ // ===== 表头配置持久化 =====
123910
+ // 表格编码:显式 table-code 优先,否则取组件 ref。两者都没有时不读写表头配置
123911
+ resolveTableCode: function resolveTableCode() {
123912
+ var explicit = this.tableCode != null ? String(this.tableCode).trim() : '';
123913
+ if (explicit) return explicit;
123914
+ var data = this.$vnode && this.$vnode.data;
123915
+ var ref = data && data.ref;
123916
+ if (typeof ref !== 'string') return '';
123917
+ return ref.trim();
123918
+ },
123919
+ // 页面编码:显式 page-code 优先,否则取路由 name,再退回不含查询参数的 path
123920
+ resolvePageCode: function resolvePageCode() {
123921
+ var explicit = this.pageCode != null ? String(this.pageCode).trim() : '';
123922
+ if (explicit) return explicit;
123923
+ var route = this.$route;
123924
+ if (route && route.name) return String(route.name);
123925
+ if (route && route.path) return String(route.path).split('?')[0];
123926
+ return '';
123927
+ },
123928
+ releaseColumnConfigClaim: function releaseColumnConfigClaim() {
123929
+ var claim = this._columnConfigClaim;
123930
+ if (!claim) return;
123931
+ releaseTableCode(claim.moduleCode, claim.pageCode, claim.tableCode, this);
123932
+ this._columnConfigClaim = null;
123933
+ },
123934
+ // 列挂载后再重算。height="100%" 要等浏览器完成 flex 布局才有父容器高度
123935
+ scheduleInitialLayout: function scheduleInitialLayout() {
123936
+ var _this21 = this;
123937
+ this.$nextTick(function () {
123938
+ _this21.resizeRecalculate();
123939
+ if (typeof requestAnimationFrame === 'function') {
123940
+ requestAnimationFrame(function () {
123941
+ return _this21.resizeRecalculate();
123942
+ });
123943
+ }
123944
+ });
123945
+ },
123946
+ // 首次加载只结算一次。用户在返回前已调整时,保留本地结果并在允许写入后保存
123947
+ finishColumnConfigLoad: function finishColumnConfigLoad(apply) {
123948
+ if (this.columnConfigSettled) return;
123949
+ this.columnConfigSettled = true;
123950
+ if (this.columnConfigTimer) {
123951
+ clearTimeout(this.columnConfigTimer);
123952
+ this.columnConfigTimer = null;
123953
+ }
123954
+ if (!this.columnConfigDirty && typeof apply === 'function') apply();
123955
+ var tableCode = this.resolveTableCode();
123956
+ this.columnConfigReady = !!getColumnModuleCode() && !!tableCode && !this.columnConfigDisabled;
123957
+ this.columnsReady = true;
123958
+ this.scheduleInitialLayout();
123959
+ // 加载完成前已经直接改过表头时,同样等 3 秒再保存,避免和后续拖拽各打一次接口
123960
+ if (this.columnConfigDirty) this.schedulePersistColumnConfig();
123961
+ },
123962
+ bootstrapColumnConfig: function bootstrapColumnConfig() {
123963
+ var _this22 = this;
123964
+ var tableCode = this.resolveTableCode();
123965
+ if (!tableCode) {
123966
+ this.finishColumnConfigLoad();
123967
+ return;
123968
+ }
123969
+ var pageCode = this.resolvePageCode();
123970
+ if (!pageCode) {
123971
+ console.warn('[StandardTable] 无法确定 page-code,表头配置不会加载');
123972
+ this.columnConfigDisabled = true;
123973
+ this.finishColumnConfigLoad();
123974
+ return;
123975
+ }
123976
+ var moduleCode = getColumnModuleCode();
123977
+ if (!moduleCode) {
123978
+ console.warn('[StandardTable] 未注册 moduleCode,表头配置不会加载');
123979
+ this.columnConfigDisabled = true;
123980
+ this.finishColumnConfigLoad();
123981
+ return;
123982
+ }
123983
+ if (!claimTableCode(moduleCode, pageCode, tableCode, this)) {
123984
+ console.warn('[StandardTable] 同一页面存在重复的 table-code:' + tableCode);
123985
+ this.columnConfigDisabled = true;
123986
+ this.finishColumnConfigLoad();
123987
+ return;
123988
+ }
123989
+ this._columnConfigClaim = {
123990
+ moduleCode: moduleCode,
123991
+ pageCode: pageCode,
123992
+ tableCode: tableCode
123993
+ };
123994
+ var duplicated = findDuplicateColumnKey(this.columnComps);
123995
+ if (duplicated) {
123996
+ console.warn('[StandardTable] 列标识重复,已跳过表头配置:' + duplicated);
123997
+ this.columnConfigDisabled = true;
123998
+ this.finishColumnConfigLoad();
123999
+ return;
124000
+ }
124001
+ var columns = readCachedColumnLayout(moduleCode, pageCode, tableCode);
124002
+ var api = getColumnConfigApi();
124003
+ if (!api || typeof api.save !== 'function') {
124004
+ console.warn('[StandardTable] 未注入 request,表头配置不会保存');
124005
+ this.columnConfigDisabled = true;
124006
+ }
124007
+ this.finishColumnConfigLoad(function () {
124008
+ if (columns && columns.length) _this22.applyMergedColumnConfig(columns);
124009
+ });
124010
+ },
124011
+ applyMergedColumnConfig: function applyMergedColumnConfig(savedColumns) {
124012
+ var _this23 = this;
124013
+ var merged = mergeColumnConfig(this.columnComps, savedColumns);
124014
+ if (!merged) return;
124015
+ merged.states.forEach(function (item) {
124016
+ _this23.$set(_this23.columnStates, item.uid, item.state);
124017
+ });
124018
+ this.columnOrder = merged.order;
124019
+ },
124020
+ // 拖拽表头列宽:写入实际宽度,最小宽度仍由列设置弹层维护
124021
+ onColumnResizableChange: function onColumnResizableChange(params) {
124022
+ if (!params) return;
124023
+ var uid = this.resolveColumnUid(params.column);
124024
+ if (uid == null) return;
124025
+ var st = this.columnStates[uid];
124026
+ if (!st) return;
124027
+ var width = Math.round(Number(params.resizeWidth));
124028
+ if (!(width >= 60)) return;
124029
+ this.$set(st, 'width', Math.min(width, 2000));
124030
+ this.schedulePersistColumnConfig();
124031
+ },
124032
+ // 直接改表头(拖列宽、拖换列、右键改排序或固定)时防抖:停手 3 秒后才保存。
124033
+ // 「调整」弹层点确认走 persistColumnConfigNow,不经过这里。
124034
+ schedulePersistColumnConfig: function schedulePersistColumnConfig() {
124035
+ var _this24 = this;
124036
+ this.columnConfigDirty = true;
124037
+ if (!this.columnConfigReady) return;
124038
+ if (this.columnConfigSaveTimer) clearTimeout(this.columnConfigSaveTimer);
124039
+ this.columnConfigSaveTimer = setTimeout(function () {
124040
+ _this24.columnConfigSaveTimer = null;
124041
+ _this24.persistColumnConfig();
124042
+ }, 3000);
124043
+ },
124044
+ persistColumnConfigNow: function persistColumnConfigNow() {
124045
+ this.columnConfigDirty = true;
124046
+ if (this.columnConfigSaveTimer) {
124047
+ clearTimeout(this.columnConfigSaveTimer);
124048
+ this.columnConfigSaveTimer = null;
124049
+ }
124050
+ this.persistColumnConfig();
124051
+ },
124052
+ persistColumnConfig: function persistColumnConfig() {
124053
+ var _this25 = this;
124054
+ if (!this.columnConfigReady || this.columnConfigDisabled) return;
124055
+ var api = getColumnConfigApi();
124056
+ if (!api) return;
124057
+ var moduleCode = getColumnModuleCode();
124058
+ var pageCode = this.resolvePageCode();
124059
+ var tableCode = this.resolveTableCode();
124060
+ if (!moduleCode || !pageCode || !tableCode) return;
124061
+ var columns = buildColumnPayload(this.columnComps, this.columnOrder, this.columnStates);
124062
+ var useReset = isDefaultColumnPayload(this.columnComps, columns);
124063
+ var request = useReset ? typeof api.reset === 'function' ? api.reset(moduleCode, pageCode, tableCode) : null : typeof api.save === 'function' ? api.save(moduleCode, pageCode, tableCode, columns) : null;
124064
+ if (!request) return;
124065
+ Promise.resolve(request).then(function (res) {
124066
+ readColumnConfigDatas(res);
124067
+ if (useReset) removeCachedColumnLayout(moduleCode, pageCode, tableCode);else updateCachedColumnLayout(moduleCode, pageCode, tableCode, columns);
124068
+ var content = res && res.data && res.data.Content || res && res.Content || '表头配置保存成功';
124069
+ if (_this25.$message) _this25.$message.success(content);
124070
+ })["catch"](function (err) {
124071
+ if (_this25.$message) _this25.$message.error(err && err.message || '表头配置保存失败');
122995
124072
  });
122996
124073
  }
122997
124074
  }
@@ -123013,8 +124090,8 @@ var StandardTablevue_type_style_index_0_prod_lang_scss_external = __webpack_requ
123013
124090
 
123014
124091
  var StandardTable_component = normalizeComponent(
123015
124092
  components_StandardTablevue_type_script_lang_js,
123016
- StandardTablevue_type_template_id_a9e9136a_render,
123017
- StandardTablevue_type_template_id_a9e9136a_staticRenderFns,
124093
+ StandardTablevue_type_template_id_24e29a8b_render,
124094
+ StandardTablevue_type_template_id_24e29a8b_staticRenderFns,
123018
124095
  false,
123019
124096
  null,
123020
124097
  null,
@@ -123055,6 +124132,12 @@ var StandardTable_component = normalizeComponent(
123055
124132
  type: String,
123056
124133
  "default": ''
123057
124134
  },
124135
+ // 表头配置使用的稳定主键。不传时按 field:字段名 或 type:类型 生成。
124136
+ // 字段以后可能改名、或同一字段出现两列时必须显式指定,且一经使用不再修改
124137
+ columnKey: {
124138
+ type: String,
124139
+ "default": ''
124140
+ },
123058
124141
  // vxe-table 内置列类型(如 seq 序号列),普通数据列不传
123059
124142
  type: {
123060
124143
  type: String,
@@ -123317,9 +124400,8 @@ var ToolbarLeft_component = normalizeComponent(
123317
124400
  * 1. 必须放在 <standard-table> 默认插槽内,标签内部内容(按钮、standard-toolbar-query 等)
123318
124401
  * 由主组件就地渲染到表格操作区右侧(“调整”列设置按钮之前);
123319
124402
  * standard-toolbar-query 只能放在本组件内部;
123320
- * 2. showAdjustment(模板写法 show-adjustment):是否显示“调整”列设置按钮。
123321
- * 列设置弹层仍由主组件 StandardTable 渲染,本组件仅声明开关;
123322
- * 主组件自身的 showAdjustment 属性继续有效(任一为 true 即显示“调整”按钮);
124403
+ * 2. “调整”列设置按钮由主组件 standard-table 的 show-adjustment 控制,默认显示,
124404
+ * 传 false 时隐藏。列设置弹层仍由主组件渲染;
123323
124405
  * 3. 按钮点击事件等逻辑完全由使用方在插槽内容中自行绑定(页面作用域)。
123324
124406
  */
123325
124407
  /* harmony default export */ const ToolbarRightvue_type_script_lang_js = ({
@@ -124271,7 +125353,10 @@ function index_esm_default() { return index_esm_default.c || (index_esm_default.
124271
125353
  *
124272
125354
  * 用法一(全局注册,推荐):
124273
125355
  * import StandardComponents from '@cimom-ui/standard-ui'
124274
- * Vue.use(StandardComponents)
125356
+ * Vue.use(StandardComponents, {
125357
+ * moduleCode: process.env.VUE_APP_MODULE_CODE, // 模块编码,与页面、表格一起确定表头配置
125358
+ * request: (config) => axios.request(config) // 业务项目的请求方法,baseURL 决定 IP 和端口
125359
+ * })
124275
125360
  * // 之后所有页面模板可直接使用 <standard-button> / <standard-table> 等标签
124276
125361
  *
124277
125362
  * 用法二(局部注册):
@@ -124305,13 +125390,17 @@ function index_esm_default() { return index_esm_default.c || (index_esm_default.
124305
125390
 
124306
125391
 
124307
125392
 
125393
+
124308
125394
  // 全部 14 个顶层组件(StandardForm / StandardTable / StandardTabs 注册时会连带其子组件)
124309
125395
  // 说明:StandardAdvancedQuery 为 StandardFilterbar 的内部依赖,不单独暴露
124310
- var src_components = [StandardButton, StandardDialog, StandardContainer, StandardFilterbar, components_StandardForm, StandardHalfArea, StandardInput, StandardPage, StandardSplitter, StandardSelect, StandardTimePick, components_StandardTable, components_StandardTabs, StandardTree];
125396
+ var src_components = [StandardButton, StandardDialog, StandardContainer, components_StandardFilterbar, components_StandardForm, StandardHalfArea, StandardInput, StandardPage, StandardSplitter, StandardSelect, StandardTimePick, components_StandardTable, components_StandardTabs, StandardTree];
124311
125397
 
124312
125398
  // 全局 vxe-table 弹层层级是否已提升(install 重复调用时只设置一次)
124313
125399
  var zIndexConfigured = false;
124314
- var install = function install(Vue) {
125400
+ var install = function install(Vue, options) {
125401
+ // 模块编码和请求方法由业务项目注入。接口路径固定,IP 和端口来自请求方法的 baseURL
125402
+ if (options && options.moduleCode != null) setColumnModuleCode(options.moduleCode);
125403
+ if (options && typeof options.request === 'function') setColumnConfigRequest(options.request);
124315
125404
  // 提升 vxe-table 弹层层级(右键菜单/tooltip 等):vxe-table 默认 zIndex 起始值
124316
125405
  // 999,低于 Element UI 弹窗(el-dialog 等默认 2000 起),会导致弹窗内表格的
124317
125406
  // 右键菜单面板被弹窗遮挡而“失效”;统一提升到 5000,确保位于所有常规弹窗之上
@@ -124339,7 +125428,7 @@ var StandardComponents = {
124339
125428
  StandardButton: StandardButton,
124340
125429
  StandardDialog: StandardDialog,
124341
125430
  StandardContainer: StandardContainer,
124342
- StandardFilterbar: StandardFilterbar,
125431
+ StandardFilterbar: components_StandardFilterbar,
124343
125432
  StandardForm: components_StandardForm,
124344
125433
  StandardHalfArea: StandardHalfArea,
124345
125434
  StandardInput: StandardInput,