@hzab/list-render 1.9.4 → 1.9.5
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/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
2
|
import { getFieldMap } from "./utils";
|
|
3
|
+
import { isRunStr, handleSchemaStrVal, isScopeKey as formIsScopeKey, getScopeKeyVal } from '@hzab/form-render/src/common/schema-handler';
|
|
3
4
|
|
|
4
5
|
export const handleQuerySchema = (opt) => {
|
|
5
6
|
const { schema, search, filters, onSearch, replaceComList, schemaScope } = opt || {};
|
|
@@ -212,6 +213,13 @@ export const handleHoc = (source, cb, opt) => {
|
|
|
212
213
|
let _source = getSchemaVal(source, schemaScope);
|
|
213
214
|
|
|
214
215
|
let res = null;
|
|
216
|
+
if (isRunStr(source)) {
|
|
217
|
+
|
|
218
|
+
_source = handleSchemaStrVal(source, schemaScope);
|
|
219
|
+
}
|
|
220
|
+
if (formIsScopeKey(source, schemaScope)) {
|
|
221
|
+
_source = getScopeKeyVal(source, schemaScope);
|
|
222
|
+
}
|
|
215
223
|
if (_source) {
|
|
216
224
|
res = await _source(...args);
|
|
217
225
|
}
|
package/src/common/utils.js
CHANGED
|
@@ -32,7 +32,7 @@ export function getVal(field = {}, data = {}, opt = {}) {
|
|
|
32
32
|
|
|
33
33
|
if (val && (xComponent === "DatePicker" || xComponent === "DatePicker.RangePicker")) {
|
|
34
34
|
const { picker, showTime } = xComponentProps || {};
|
|
35
|
-
const mode =
|
|
35
|
+
const mode = showTime === true ? "time" : picker || "date";
|
|
36
36
|
const _formatEnum = opt.dateFormatEnum || dateFormatEnum;
|
|
37
37
|
const format = xComponentProps?.format || _formatEnum[mode];
|
|
38
38
|
|
|
@@ -18,7 +18,7 @@ function QueryRender(props, parentRef) {
|
|
|
18
18
|
setSchema(
|
|
19
19
|
handleQuerySchema({
|
|
20
20
|
...props?.config,
|
|
21
|
-
schemaScope: props.schemaScope,
|
|
21
|
+
schemaScope: { ...props.schemaScope, scenario: "query" },
|
|
22
22
|
schema: _.cloneDeep(props.schema),
|
|
23
23
|
search: props.search,
|
|
24
24
|
filters: _.cloneDeep(props.filters),
|