ol-base-components 3.6.2 → 3.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +128 -38
- package/dist/index.umd.js +3 -3
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -8221,17 +8221,17 @@ function requireFunctionUncurryThis() {
|
|
|
8221
8221
|
};
|
|
8222
8222
|
return functionUncurryThis;
|
|
8223
8223
|
}
|
|
8224
|
-
var uncurryThis$
|
|
8225
|
-
var toString$2 = uncurryThis$
|
|
8226
|
-
var stringSlice$1 = uncurryThis$
|
|
8224
|
+
var uncurryThis$6 = requireFunctionUncurryThis();
|
|
8225
|
+
var toString$2 = uncurryThis$6({}.toString);
|
|
8226
|
+
var stringSlice$1 = uncurryThis$6("".slice);
|
|
8227
8227
|
var classofRaw = function(it2) {
|
|
8228
8228
|
return stringSlice$1(toString$2(it2), 8, -1);
|
|
8229
8229
|
};
|
|
8230
|
-
var uncurryThis$
|
|
8230
|
+
var uncurryThis$5 = requireFunctionUncurryThis();
|
|
8231
8231
|
var fails$6 = fails$9;
|
|
8232
8232
|
var classof$1 = classofRaw;
|
|
8233
8233
|
var $Object$1 = Object;
|
|
8234
|
-
var split = uncurryThis$
|
|
8234
|
+
var split = uncurryThis$5("".split);
|
|
8235
8235
|
var indexedObject = fails$6(function() {
|
|
8236
8236
|
return !$Object$1("z").propertyIsEnumerable(0);
|
|
8237
8237
|
}) ? function(it2) {
|
|
@@ -8270,8 +8270,16 @@ var aFunction = function(argument) {
|
|
|
8270
8270
|
var getBuiltIn$3 = function(namespace, method) {
|
|
8271
8271
|
return arguments.length < 2 ? aFunction(globalThis$7[namespace]) : globalThis$7[namespace] && globalThis$7[namespace][method];
|
|
8272
8272
|
};
|
|
8273
|
-
var
|
|
8274
|
-
var
|
|
8273
|
+
var objectIsPrototypeOf;
|
|
8274
|
+
var hasRequiredObjectIsPrototypeOf;
|
|
8275
|
+
function requireObjectIsPrototypeOf() {
|
|
8276
|
+
if (hasRequiredObjectIsPrototypeOf)
|
|
8277
|
+
return objectIsPrototypeOf;
|
|
8278
|
+
hasRequiredObjectIsPrototypeOf = 1;
|
|
8279
|
+
var uncurryThis2 = requireFunctionUncurryThis();
|
|
8280
|
+
objectIsPrototypeOf = uncurryThis2({}.isPrototypeOf);
|
|
8281
|
+
return objectIsPrototypeOf;
|
|
8282
|
+
}
|
|
8275
8283
|
var environmentUserAgent;
|
|
8276
8284
|
var hasRequiredEnvironmentUserAgent;
|
|
8277
8285
|
function requireEnvironmentUserAgent() {
|
|
@@ -8325,7 +8333,7 @@ var NATIVE_SYMBOL$1 = symbolConstructorDetection;
|
|
|
8325
8333
|
var useSymbolAsUid = NATIVE_SYMBOL$1 && !Symbol.sham && typeof Symbol.iterator == "symbol";
|
|
8326
8334
|
var getBuiltIn$2 = getBuiltIn$3;
|
|
8327
8335
|
var isCallable$5 = isCallable$8;
|
|
8328
|
-
var isPrototypeOf =
|
|
8336
|
+
var isPrototypeOf = requireObjectIsPrototypeOf();
|
|
8329
8337
|
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
|
|
8330
8338
|
var $Object = Object;
|
|
8331
8339
|
var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function(it2) {
|
|
@@ -13792,7 +13800,7 @@ var render$2 = function() {
|
|
|
13792
13800
|
}) : _vm._e(), _vm._v(" " + _vm._s(btn.title) + " ")]);
|
|
13793
13801
|
}), _vm._t("toolbarAfter", null, null, _vm.toolbarSlotScope)], 2), _c("div", {
|
|
13794
13802
|
staticClass: "crud-toolbar-right"
|
|
13795
|
-
}, [_vm._t("toolbarActions", null, null, _vm.toolbarSlotScope), _vm.$cfg("showColumnFilterBtn") ? [_vm.
|
|
13803
|
+
}, [_vm._t("toolbarActions", null, null, _vm.toolbarSlotScope), _vm.$cfg("showColumnFilterBtn") ? [_vm.resolvedColumnConfigMode === "simple" ? _c("el-dropdown", {
|
|
13796
13804
|
staticClass: "crud-toolbar-action",
|
|
13797
13805
|
attrs: {
|
|
13798
13806
|
"trigger": "click"
|
|
@@ -13918,11 +13926,6 @@ var render$2 = function() {
|
|
|
13918
13926
|
})], null, true)
|
|
13919
13927
|
})];
|
|
13920
13928
|
})], _vm.operates && _vm.operates.length > 0 ? _c("el-table-column", _vm._b({
|
|
13921
|
-
attrs: {
|
|
13922
|
-
"label": "操作",
|
|
13923
|
-
"align": "center",
|
|
13924
|
-
"min-width": _vm.operatesMinWidth
|
|
13925
|
-
},
|
|
13926
13929
|
scopedSlots: _vm._u([{
|
|
13927
13930
|
key: "default",
|
|
13928
13931
|
fn: function(_ref2) {
|
|
@@ -13948,7 +13951,11 @@ var render$2 = function() {
|
|
|
13948
13951
|
})], 2)];
|
|
13949
13952
|
}
|
|
13950
13953
|
}], null, false, 2917153455)
|
|
13951
|
-
}, "el-table-column",
|
|
13954
|
+
}, "el-table-column", Object.assign({
|
|
13955
|
+
label: "操作",
|
|
13956
|
+
align: "center",
|
|
13957
|
+
minWidth: _vm.operatesMinWidth
|
|
13958
|
+
}, _vm.operatesAttrs || {}), false)) : _vm._e(), _c("div", {
|
|
13952
13959
|
staticClass: "crud-empty",
|
|
13953
13960
|
attrs: {
|
|
13954
13961
|
"slot": "empty"
|
|
@@ -13961,7 +13968,7 @@ var render$2 = function() {
|
|
|
13961
13968
|
}, [_c("el-pagination", {
|
|
13962
13969
|
attrs: {
|
|
13963
13970
|
"current-page": _vm.displayPagination.page,
|
|
13964
|
-
"page-sizes": _vm.
|
|
13971
|
+
"page-sizes": _vm.resolvedPageSizes,
|
|
13965
13972
|
"page-size": _vm.displayPagination.limit,
|
|
13966
13973
|
"total": _vm.displayPagination.total,
|
|
13967
13974
|
"layout": "total, sizes, prev, pager, next, jumper"
|
|
@@ -13970,7 +13977,7 @@ var render$2 = function() {
|
|
|
13970
13977
|
"size-change": _vm.onSizeChange,
|
|
13971
13978
|
"current-change": _vm.onPageChange
|
|
13972
13979
|
}
|
|
13973
|
-
})], 1) : _vm._e(), _vm.
|
|
13980
|
+
})], 1) : _vm._e(), _vm.resolvedColumnConfigMode === "persisted" ? _c("ol-column-config", {
|
|
13974
13981
|
attrs: {
|
|
13975
13982
|
"visible": _vm.columnConfigVisible,
|
|
13976
13983
|
"columns": _vm.columnsForConfig,
|
|
@@ -13988,7 +13995,7 @@ var render$2 = function() {
|
|
|
13988
13995
|
attrs: {
|
|
13989
13996
|
"visible": _vm.entityChangeVisible,
|
|
13990
13997
|
"selected-rows": _vm.currentSelection,
|
|
13991
|
-
"page-params": _vm.
|
|
13998
|
+
"page-params": _vm.resolvedPageParams
|
|
13992
13999
|
},
|
|
13993
14000
|
on: {
|
|
13994
14001
|
"update:visible": function($event) {
|
|
@@ -14012,7 +14019,15 @@ var render$2 = function() {
|
|
|
14012
14019
|
var staticRenderFns$2 = [];
|
|
14013
14020
|
const index_vue_vue_type_style_index_0_scoped_true_lang$1 = "";
|
|
14014
14021
|
const index_vue_vue_type_style_index_1_lang$1 = "";
|
|
14015
|
-
const DATE_TYPES = [
|
|
14022
|
+
const DATE_TYPES = [
|
|
14023
|
+
"date",
|
|
14024
|
+
"datetime",
|
|
14025
|
+
"daterange",
|
|
14026
|
+
"datetimerange",
|
|
14027
|
+
"month",
|
|
14028
|
+
"monthrange",
|
|
14029
|
+
"year"
|
|
14030
|
+
];
|
|
14016
14031
|
const newFieldToOld = (field) => ({
|
|
14017
14032
|
...field,
|
|
14018
14033
|
value: field.prop,
|
|
@@ -14116,7 +14131,7 @@ const __vue2_script$2 = {
|
|
|
14116
14131
|
/** 列配置持久化的页面标识(默认取 $route.path) */
|
|
14117
14132
|
pageKey: { type: String, default: "" },
|
|
14118
14133
|
/** 是否显示列过滤入口。未传时回退到 $olBaseConfig */
|
|
14119
|
-
showColumnFilterBtn: { type: Boolean, default:
|
|
14134
|
+
showColumnFilterBtn: { type: Boolean, default: true },
|
|
14120
14135
|
/** 是否显示刷新按钮。未传时回退到 $olBaseConfig */
|
|
14121
14136
|
showRefreshBtn: { type: Boolean, default: true },
|
|
14122
14137
|
/** 是否显示打印按钮。未传时回退到 $olBaseConfig */
|
|
@@ -14188,7 +14203,11 @@ const __vue2_script$2 = {
|
|
|
14188
14203
|
fetchingData: false,
|
|
14189
14204
|
// 自动请求模式下的内部数据存储
|
|
14190
14205
|
internalTableData: [],
|
|
14191
|
-
internalPagination: {
|
|
14206
|
+
internalPagination: {
|
|
14207
|
+
page: 1,
|
|
14208
|
+
limit: this.$olBaseConfig && this.$olBaseConfig.pagination && this.$olBaseConfig.pagination.limit || 30,
|
|
14209
|
+
total: 0
|
|
14210
|
+
},
|
|
14192
14211
|
// 打印数据
|
|
14193
14212
|
printListObj: { title: "", tableHeader: [], tableData: [] },
|
|
14194
14213
|
// 列配置弹窗(persisted 模式)
|
|
@@ -14201,9 +14220,45 @@ const __vue2_script$2 = {
|
|
|
14201
14220
|
};
|
|
14202
14221
|
},
|
|
14203
14222
|
computed: {
|
|
14204
|
-
/**
|
|
14223
|
+
/** 实际请求方式(三级优先级:prop > $olBaseConfig > 默认 'get') */
|
|
14205
14224
|
finalMethod() {
|
|
14206
|
-
|
|
14225
|
+
if (this.$options.propsData && "method" in this.$options.propsData) {
|
|
14226
|
+
return this.method;
|
|
14227
|
+
}
|
|
14228
|
+
const base = this.$olBaseConfig || {};
|
|
14229
|
+
if (base.method !== void 0)
|
|
14230
|
+
return base.method;
|
|
14231
|
+
return "get";
|
|
14232
|
+
},
|
|
14233
|
+
/** 列配置模式(三级优先级) */
|
|
14234
|
+
resolvedColumnConfigMode() {
|
|
14235
|
+
if (this.$options.propsData && "columnConfigMode" in this.$options.propsData) {
|
|
14236
|
+
return this.columnConfigMode;
|
|
14237
|
+
}
|
|
14238
|
+
const base = this.$olBaseConfig || {};
|
|
14239
|
+
if (base.columnConfigMode !== void 0)
|
|
14240
|
+
return base.columnConfigMode;
|
|
14241
|
+
return this.columnConfigMode;
|
|
14242
|
+
},
|
|
14243
|
+
/** 分页参数名映射(三级优先级) */
|
|
14244
|
+
resolvedPageParams() {
|
|
14245
|
+
if (this.$options.propsData && "pageParams" in this.$options.propsData) {
|
|
14246
|
+
return this.pageParams;
|
|
14247
|
+
}
|
|
14248
|
+
const base = this.$olBaseConfig || {};
|
|
14249
|
+
if (base.pageParams !== void 0)
|
|
14250
|
+
return base.pageParams;
|
|
14251
|
+
return this.pageParams;
|
|
14252
|
+
},
|
|
14253
|
+
/** 每页条数选项(三级优先级) */
|
|
14254
|
+
resolvedPageSizes() {
|
|
14255
|
+
if (this.$options.propsData && "pageSizes" in this.$options.propsData) {
|
|
14256
|
+
return this.pageSizes;
|
|
14257
|
+
}
|
|
14258
|
+
const base = this.$olBaseConfig || {};
|
|
14259
|
+
if (base.pageSizes !== void 0)
|
|
14260
|
+
return base.pageSizes;
|
|
14261
|
+
return this.pageSizes;
|
|
14207
14262
|
},
|
|
14208
14263
|
/** 是否启用内部数据管理(自动模式有 url,手动模式有 fetchData) */
|
|
14209
14264
|
shouldAutoFetch() {
|
|
@@ -14365,7 +14420,7 @@ const __vue2_script$2 = {
|
|
|
14365
14420
|
},
|
|
14366
14421
|
async mounted() {
|
|
14367
14422
|
this.syncColumnSlots();
|
|
14368
|
-
if (this.$cfg("showColumnFilterBtn") && this.
|
|
14423
|
+
if (this.$cfg("showColumnFilterBtn") && this.resolvedColumnConfigMode === "persisted") {
|
|
14369
14424
|
await this.loadColumnConfig();
|
|
14370
14425
|
}
|
|
14371
14426
|
if (this.$cfg("showCustomSearch")) {
|
|
@@ -14478,7 +14533,11 @@ const __vue2_script$2 = {
|
|
|
14478
14533
|
manualField.prop = userProp;
|
|
14479
14534
|
} else {
|
|
14480
14535
|
this.searchFields.push(swaggerField);
|
|
14481
|
-
this.$set(
|
|
14536
|
+
this.$set(
|
|
14537
|
+
this.internalSearchModel,
|
|
14538
|
+
swaggerField.prop,
|
|
14539
|
+
swaggerField.defaultValue != null ? swaggerField.defaultValue : null
|
|
14540
|
+
);
|
|
14482
14541
|
}
|
|
14483
14542
|
});
|
|
14484
14543
|
this.autoDetectRangeTimeFields(parameters);
|
|
@@ -14654,7 +14713,11 @@ const __vue2_script$2 = {
|
|
|
14654
14713
|
type: "datetimerange",
|
|
14655
14714
|
visible: true,
|
|
14656
14715
|
defaultValue: null,
|
|
14657
|
-
props: {
|
|
14716
|
+
props: {
|
|
14717
|
+
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
14718
|
+
format: "yyyy/MM/dd HH:mm:ss",
|
|
14719
|
+
defaultTime: ["00:00:00", "23:59:59"]
|
|
14720
|
+
},
|
|
14658
14721
|
originalFields: { begin: "BeginTime", end: "EndTime" }
|
|
14659
14722
|
});
|
|
14660
14723
|
}
|
|
@@ -14675,7 +14738,11 @@ const __vue2_script$2 = {
|
|
|
14675
14738
|
type: "datetimerange",
|
|
14676
14739
|
visible: true,
|
|
14677
14740
|
defaultValue: null,
|
|
14678
|
-
props: {
|
|
14741
|
+
props: {
|
|
14742
|
+
valueFormat: "yyyy-MM-dd HH:mm:ss",
|
|
14743
|
+
format: "yyyy/MM/dd HH:mm:ss",
|
|
14744
|
+
defaultTime: ["00:00:00", "23:59:59"]
|
|
14745
|
+
},
|
|
14679
14746
|
originalFields: { begin: beginParam.name, end: endName }
|
|
14680
14747
|
});
|
|
14681
14748
|
const rmBeginIdx = searchFields.findIndex((f2) => f2.prop === beginParam.name);
|
|
@@ -14693,7 +14760,10 @@ const __vue2_script$2 = {
|
|
|
14693
14760
|
});
|
|
14694
14761
|
if (toAdd.length) {
|
|
14695
14762
|
this.initSearchDefaults();
|
|
14696
|
-
console.log(
|
|
14763
|
+
console.log(
|
|
14764
|
+
`\x1B[36m\x1B[4mol-crud 自动识别日期范围字段`,
|
|
14765
|
+
toAdd.map((f2) => f2.prop)
|
|
14766
|
+
);
|
|
14697
14767
|
}
|
|
14698
14768
|
},
|
|
14699
14769
|
// ===================== 搜索 =====================
|
|
@@ -14771,7 +14841,7 @@ const __vue2_script$2 = {
|
|
|
14771
14841
|
async fetchList() {
|
|
14772
14842
|
if (!this.shouldAutoFetch)
|
|
14773
14843
|
return;
|
|
14774
|
-
const { page: pageKey, limit: limitKey } = this.
|
|
14844
|
+
const { page: pageKey, limit: limitKey } = this.resolvedPageParams || {};
|
|
14775
14845
|
const page = this.internalPagination.page;
|
|
14776
14846
|
const limit = this.internalPagination.limit;
|
|
14777
14847
|
const { cleanParams } = this.buildSearchParams();
|
|
@@ -14810,7 +14880,9 @@ const __vue2_script$2 = {
|
|
|
14810
14880
|
if (!apiUrl)
|
|
14811
14881
|
return;
|
|
14812
14882
|
if (typeof this.get !== "function" && typeof this.post !== "function") {
|
|
14813
|
-
console.warn(
|
|
14883
|
+
console.warn(
|
|
14884
|
+
"[ol-crud] 未找到 this.get/this.post,无法自动拉取数据,请使用 fetchData 或手动传入 tableData"
|
|
14885
|
+
);
|
|
14814
14886
|
return;
|
|
14815
14887
|
}
|
|
14816
14888
|
let params;
|
|
@@ -15021,12 +15093,30 @@ const __vue2_script$2 = {
|
|
|
15021
15093
|
});
|
|
15022
15094
|
};
|
|
15023
15095
|
walkUser(this.columns);
|
|
15024
|
-
const sorted = [...fields].sort(
|
|
15096
|
+
const sorted = [...fields].sort(
|
|
15097
|
+
(a2, b2) => (a2.order != null ? a2.order : 0) - (b2.order != null ? b2.order : 0)
|
|
15098
|
+
);
|
|
15025
15099
|
const apiColumns = sorted.map((f2) => {
|
|
15026
15100
|
const user = userColMap[f2.fieldName];
|
|
15027
|
-
const base = {
|
|
15101
|
+
const base = {
|
|
15102
|
+
prop: f2.fieldName,
|
|
15103
|
+
label: f2.displayName || f2.fieldName,
|
|
15104
|
+
show: f2.isVisible !== false,
|
|
15105
|
+
fixed: f2.isFixed || false,
|
|
15106
|
+
sortable: false
|
|
15107
|
+
};
|
|
15028
15108
|
if (user) {
|
|
15029
|
-
return {
|
|
15109
|
+
return {
|
|
15110
|
+
...base,
|
|
15111
|
+
render: user.render,
|
|
15112
|
+
renderSlot: user.renderSlot,
|
|
15113
|
+
sortable: user.sortable,
|
|
15114
|
+
attrs: user.attrs,
|
|
15115
|
+
width: user.width,
|
|
15116
|
+
minWidth: user.minWidth,
|
|
15117
|
+
children: user.children,
|
|
15118
|
+
enumName: f2.enumName || user.enumName
|
|
15119
|
+
};
|
|
15030
15120
|
}
|
|
15031
15121
|
return { ...base, enumName: f2.enumName || void 0 };
|
|
15032
15122
|
});
|
|
@@ -15250,7 +15340,7 @@ var __component__$2 = /* @__PURE__ */ normalizeComponent(
|
|
|
15250
15340
|
staticRenderFns$2,
|
|
15251
15341
|
false,
|
|
15252
15342
|
__vue2_injectStyles$2,
|
|
15253
|
-
"
|
|
15343
|
+
"1eace123",
|
|
15254
15344
|
null,
|
|
15255
15345
|
null
|
|
15256
15346
|
);
|
|
@@ -86071,7 +86161,7 @@ function requireAnInstance() {
|
|
|
86071
86161
|
if (hasRequiredAnInstance)
|
|
86072
86162
|
return anInstance;
|
|
86073
86163
|
hasRequiredAnInstance = 1;
|
|
86074
|
-
var isPrototypeOf2 =
|
|
86164
|
+
var isPrototypeOf2 = requireObjectIsPrototypeOf();
|
|
86075
86165
|
var $TypeError2 = TypeError;
|
|
86076
86166
|
anInstance = function(it2, Prototype) {
|
|
86077
86167
|
if (isPrototypeOf2(Prototype, it2))
|
|
@@ -86991,7 +87081,7 @@ function requireIterate() {
|
|
|
86991
87081
|
var tryToString2 = requireTryToString();
|
|
86992
87082
|
var isArrayIteratorMethod2 = requireIsArrayIteratorMethod();
|
|
86993
87083
|
var lengthOfArrayLike2 = lengthOfArrayLike$1;
|
|
86994
|
-
var isPrototypeOf2 =
|
|
87084
|
+
var isPrototypeOf2 = requireObjectIsPrototypeOf();
|
|
86995
87085
|
var getIterator2 = requireGetIterator();
|
|
86996
87086
|
var getIteratorMethod2 = requireGetIteratorMethod();
|
|
86997
87087
|
var iteratorClose2 = requireIteratorClose();
|
|
@@ -88411,7 +88501,7 @@ function requireRegexpGetFlags() {
|
|
|
88411
88501
|
hasRequiredRegexpGetFlags = 1;
|
|
88412
88502
|
var call2 = functionCall;
|
|
88413
88503
|
var hasOwn3 = hasOwnProperty_1;
|
|
88414
|
-
var isPrototypeOf2 =
|
|
88504
|
+
var isPrototypeOf2 = requireObjectIsPrototypeOf();
|
|
88415
88505
|
var regExpFlagsDetection = requireRegexpFlagsDetection();
|
|
88416
88506
|
var regExpFlagsGetterImplementation = requireRegexpFlags();
|
|
88417
88507
|
var RegExpPrototype = RegExp.prototype;
|
|
@@ -90550,7 +90640,7 @@ function requireEs_number_constructor() {
|
|
|
90550
90640
|
var isForced2 = isForced_1;
|
|
90551
90641
|
var hasOwn3 = hasOwnProperty_1;
|
|
90552
90642
|
var inheritIfRequired2 = requireInheritIfRequired();
|
|
90553
|
-
var isPrototypeOf2 =
|
|
90643
|
+
var isPrototypeOf2 = requireObjectIsPrototypeOf();
|
|
90554
90644
|
var isSymbol2 = isSymbol$2;
|
|
90555
90645
|
var toPrimitive2 = toPrimitive$2;
|
|
90556
90646
|
var fails2 = fails$9;
|