cnhis-design-vue 3.1.12-beta.3 → 3.1.12-beta.6
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/es/packages/big-table/index.d.ts +0 -8
- package/es/packages/big-table/src/BigTable.vue.d.ts +0 -8
- package/es/packages/big-table/src/bigTableState.js +1 -1
- package/es/packages/form-render/src/components/renderer/index.d.ts +1 -0
- package/es/packages/form-render/src/components/renderer/index.js +1 -0
- package/es/packages/form-render/src/components/renderer/linebar.js +1 -1
- package/es/packages/form-render/src/components/renderer/simpleComponent.d.ts +2 -0
- package/es/packages/form-render/src/components/renderer/simpleComponent.js +65 -0
- package/es/packages/form-render/src/components/renderer/slider.js +1 -1
- package/es/packages/form-render/src/constants/index.d.ts +9 -0
- package/es/packages/form-render/src/constants/index.js +11 -1
- package/es/packages/form-render/src/hooks/useBusinessBinding.d.ts +1 -0
- package/es/packages/form-render/src/hooks/useBusinessBinding.js +23 -19
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.d.ts +1 -1
- package/es/packages/form-render/src/hooks/useFieldListAdaptor.js +24 -15
- package/es/packages/form-render/src/hooks/useTypeNormalize.js +3 -0
- package/es/packages/form-render/src/types/index.d.ts +2 -1
- package/es/packages/form-render/src/utils/index.d.ts +2 -2
- package/es/packages/form-render/src/utils/index.js +1 -1
- package/es/packages/index.css +7 -2
- package/es/packages/scale-view/src/components/formitem/r-collection.d.ts +1 -1
- package/es/packages/scale-view/src/components/formitem/r-collection.js +2 -4
- package/es/packages/scale-view/src/hooks/scaleview-computed.js +1 -1
- package/es/packages/scale-view/src/hooks/scaleview-init.js +3 -1
- package/es/packages/scale-view/src/hooks/use-component.d.ts +5 -5
- package/es/packages/scale-view/style/index.css +0 -2
- package/es/packages/select-label/style/index.css +7 -0
- package/package.json +2 -2
|
@@ -2563,14 +2563,6 @@ declare const BigTable: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
2563
2563
|
showInsertStatus?: boolean | undefined;
|
|
2564
2564
|
showAsterisk?: boolean | undefined;
|
|
2565
2565
|
autoClear?: boolean | undefined;
|
|
2566
|
-
beforeEditMethod?: ((params: {
|
|
2567
|
-
row: any;
|
|
2568
|
-
rowIndex: number;
|
|
2569
|
-
column: import("vxe-table").VxeTableDefines.ColumnInfo;
|
|
2570
|
-
columnIndex: number;
|
|
2571
|
-
$table: import("vxe-table").VxeTableConstructor & import("vxe-table").VxeTablePrivateMethods;
|
|
2572
|
-
$grid: import("vxe-table").VxeGridConstructor | null | undefined;
|
|
2573
|
-
}) => boolean) | undefined;
|
|
2574
2566
|
activeMethod?: ((params: {
|
|
2575
2567
|
row: any;
|
|
2576
2568
|
rowIndex: number;
|
|
@@ -2562,14 +2562,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2562
2562
|
showInsertStatus?: boolean | undefined;
|
|
2563
2563
|
showAsterisk?: boolean | undefined;
|
|
2564
2564
|
autoClear?: boolean | undefined;
|
|
2565
|
-
beforeEditMethod?: ((params: {
|
|
2566
|
-
row: any;
|
|
2567
|
-
rowIndex: number;
|
|
2568
|
-
column: import("vxe-table").VxeTableDefines.ColumnInfo;
|
|
2569
|
-
columnIndex: number;
|
|
2570
|
-
$table: import("vxe-table").VxeTableConstructor & import("vxe-table").VxeTablePrivateMethods;
|
|
2571
|
-
$grid: import("vxe-table").VxeGridConstructor | null | undefined;
|
|
2572
|
-
}) => boolean) | undefined;
|
|
2573
2565
|
activeMethod?: ((params: {
|
|
2574
2566
|
row: any;
|
|
2575
2567
|
rowIndex: number;
|
|
@@ -58,7 +58,7 @@ const script = defineComponent({
|
|
|
58
58
|
}) : createVNode("header", {
|
|
59
59
|
"class": "form-render__linebarHeader",
|
|
60
60
|
"onClick": toggleShow
|
|
61
|
-
}, [
|
|
61
|
+
}, [props.title]), createVNode(NCollapseTransition, {
|
|
62
62
|
"class": "form-render__linebarItem",
|
|
63
63
|
"show": _show.value
|
|
64
64
|
}, slots)]);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { createVNode, mergeProps, isVNode } from 'vue';
|
|
2
|
+
import { connect, mapProps } from '@formily/vue';
|
|
3
|
+
import { isObject, isFunction } from 'lodash-es';
|
|
4
|
+
import { NButton } from 'naive-ui';
|
|
5
|
+
|
|
6
|
+
function _isSlot(s) {
|
|
7
|
+
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
8
|
+
}
|
|
9
|
+
function createPropFor(props) {
|
|
10
|
+
return (property) => {
|
|
11
|
+
var _a;
|
|
12
|
+
return (_a = props.fieldItem) == null ? void 0 : _a[property];
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function createSlot(renderer, props) {
|
|
16
|
+
if (isObject(renderer)) {
|
|
17
|
+
const result = {};
|
|
18
|
+
Object.entries(renderer).forEach(([key, renderer2]) => {
|
|
19
|
+
isFunction(renderer2) && (result[key] = () => renderer2(props));
|
|
20
|
+
});
|
|
21
|
+
return result;
|
|
22
|
+
}
|
|
23
|
+
return {
|
|
24
|
+
default() {
|
|
25
|
+
return isFunction(renderer) ? renderer(props) : renderer;
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
const textScript = (props) => {
|
|
30
|
+
var _a, _b, _c;
|
|
31
|
+
const propFor = createPropFor(props);
|
|
32
|
+
return createVNode("div", (_a = propFor("componentProps")) != null ? _a : {}, [(_c = (_b = createSlot(props.content, props)).default) == null ? void 0 : _c.call(_b)]);
|
|
33
|
+
};
|
|
34
|
+
const TEXT = connect(textScript, mapProps((props) => {
|
|
35
|
+
var _a;
|
|
36
|
+
return {
|
|
37
|
+
...props,
|
|
38
|
+
content: (_a = props.fieldItem) == null ? void 0 : _a.content
|
|
39
|
+
};
|
|
40
|
+
}));
|
|
41
|
+
const buttonScript = (props) => {
|
|
42
|
+
var _a;
|
|
43
|
+
let _slot;
|
|
44
|
+
const propFor = createPropFor(props);
|
|
45
|
+
function onClick() {
|
|
46
|
+
var _a2;
|
|
47
|
+
const cb = propFor("onClick") || ((_a2 = propFor("componentProps")) == null ? void 0 : _a2.onClick);
|
|
48
|
+
return () => isFunction(cb) && cb(props.fieldItem);
|
|
49
|
+
}
|
|
50
|
+
console.log(props.content);
|
|
51
|
+
return createVNode(NButton, mergeProps((_a = propFor("componentProps")) != null ? _a : {}, {
|
|
52
|
+
"onClick": onClick()
|
|
53
|
+
}), _isSlot(_slot = createSlot(props.content, props)) ? _slot : {
|
|
54
|
+
default: () => [_slot]
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
const BUTTON = connect(buttonScript, mapProps((props) => {
|
|
58
|
+
var _a;
|
|
59
|
+
return {
|
|
60
|
+
...props,
|
|
61
|
+
content: (_a = props.fieldItem) == null ? void 0 : _a.content
|
|
62
|
+
};
|
|
63
|
+
}));
|
|
64
|
+
|
|
65
|
+
export { BUTTON, TEXT };
|
|
@@ -6,7 +6,7 @@ const SLIDER = connect(NSlider, mapProps((props, field) => {
|
|
|
6
6
|
const _props = assignUpdateValue(props, field);
|
|
7
7
|
if (Array.isArray(_props.option)) {
|
|
8
8
|
_props.marks = _props.option.reduce((fin, option) => {
|
|
9
|
-
fin[option.value] = option.text;
|
|
9
|
+
fin[+option.value] = option.text;
|
|
10
10
|
return fin;
|
|
11
11
|
}, {});
|
|
12
12
|
}
|
|
@@ -13,6 +13,7 @@ export declare enum FIELD_BUSINESS_TYPE {
|
|
|
13
13
|
PASSWORD = "password",
|
|
14
14
|
ID_CARD = "id_card",
|
|
15
15
|
AGE = "age",
|
|
16
|
+
AGE_UNIT = "age_unit",
|
|
16
17
|
MOBILE = "mobile",
|
|
17
18
|
TELEPHONE = "telephone",
|
|
18
19
|
EMAIL = "email",
|
|
@@ -28,3 +29,11 @@ export declare enum FIELD_SEX_VALUE {
|
|
|
28
29
|
MALE = "1",
|
|
29
30
|
FEMALE = "2"
|
|
30
31
|
}
|
|
32
|
+
export declare enum FIELD_AGE_UNIT {
|
|
33
|
+
DAY = "D",
|
|
34
|
+
MONTH = "M",
|
|
35
|
+
YEAR = "Y",
|
|
36
|
+
HOUR = "H",
|
|
37
|
+
WEEK = "W",
|
|
38
|
+
MINUTE = "N"
|
|
39
|
+
}
|
|
@@ -9,6 +9,7 @@ var FIELD_BUSINESS_TYPE = /* @__PURE__ */ ((FIELD_BUSINESS_TYPE2) => {
|
|
|
9
9
|
FIELD_BUSINESS_TYPE2["PASSWORD"] = "password";
|
|
10
10
|
FIELD_BUSINESS_TYPE2["ID_CARD"] = "id_card";
|
|
11
11
|
FIELD_BUSINESS_TYPE2["AGE"] = "age";
|
|
12
|
+
FIELD_BUSINESS_TYPE2["AGE_UNIT"] = "age_unit";
|
|
12
13
|
FIELD_BUSINESS_TYPE2["MOBILE"] = "mobile";
|
|
13
14
|
FIELD_BUSINESS_TYPE2["TELEPHONE"] = "telephone";
|
|
14
15
|
FIELD_BUSINESS_TYPE2["EMAIL"] = "email";
|
|
@@ -26,5 +27,14 @@ var FIELD_SEX_VALUE = /* @__PURE__ */ ((FIELD_SEX_VALUE2) => {
|
|
|
26
27
|
FIELD_SEX_VALUE2["FEMALE"] = "2";
|
|
27
28
|
return FIELD_SEX_VALUE2;
|
|
28
29
|
})(FIELD_SEX_VALUE || {});
|
|
30
|
+
var FIELD_AGE_UNIT = /* @__PURE__ */ ((FIELD_AGE_UNIT2) => {
|
|
31
|
+
FIELD_AGE_UNIT2["DAY"] = "D";
|
|
32
|
+
FIELD_AGE_UNIT2["MONTH"] = "M";
|
|
33
|
+
FIELD_AGE_UNIT2["YEAR"] = "Y";
|
|
34
|
+
FIELD_AGE_UNIT2["HOUR"] = "H";
|
|
35
|
+
FIELD_AGE_UNIT2["WEEK"] = "W";
|
|
36
|
+
FIELD_AGE_UNIT2["MINUTE"] = "N";
|
|
37
|
+
return FIELD_AGE_UNIT2;
|
|
38
|
+
})(FIELD_AGE_UNIT || {});
|
|
29
39
|
|
|
30
|
-
export { FIELD_BUSINESS_TYPE, FIELD_SEX_VALUE, FormItemLineBarDepKeyPrepend, InjectAsyncQueue, InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectionFormUUID, InjectionSchemaField };
|
|
40
|
+
export { FIELD_AGE_UNIT, FIELD_BUSINESS_TYPE, FIELD_SEX_VALUE, FormItemLineBarDepKeyPrepend, InjectAsyncQueue, InjectionBusinessCollector, InjectionChangeContextCollector, InjectionFormItemDepsCollector, InjectionFormUUID, InjectionSchemaField };
|
|
@@ -9,6 +9,7 @@ export declare class BusinessCollector {
|
|
|
9
9
|
collect(type: FIELD_BUSINESS_TYPE, fieldName: string): void;
|
|
10
10
|
getField(type: FIELD_BUSINESS_TYPE): string[];
|
|
11
11
|
getType(fieldName: string): FIELD_BUSINESS_TYPE | undefined;
|
|
12
|
+
private setAge;
|
|
12
13
|
private handlerIdCardType;
|
|
13
14
|
private handlerBirthdayType;
|
|
14
15
|
handlerMap: Map<FIELD_BUSINESS_TYPE, (formModel: Form, value: unknown) => void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isString } from '@vueuse/core';
|
|
2
|
-
import { FIELD_BUSINESS_TYPE } from '../constants/index.js';
|
|
2
|
+
import { FIELD_BUSINESS_TYPE, FIELD_AGE_UNIT } from '../constants/index.js';
|
|
3
3
|
import { isIdCard, parseIdCard, parseBirthday } from '../utils/index.js';
|
|
4
4
|
|
|
5
5
|
class BusinessCollector {
|
|
@@ -24,21 +24,36 @@ class BusinessCollector {
|
|
|
24
24
|
getType(fieldName) {
|
|
25
25
|
return this.fieldNameCollector.get(fieldName);
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
setAge(formModel, context) {
|
|
28
|
+
const value = context.day < 30 ? { ageUnit: FIELD_AGE_UNIT.DAY, age: context.day } : context.day < 365 ? { ageUnit: FIELD_AGE_UNIT.MONTH, age: context.month } : { ageUnit: FIELD_AGE_UNIT.YEAR, age: context.year };
|
|
29
|
+
const ageUnitFields = this.getField(FIELD_BUSINESS_TYPE.AGE_UNIT);
|
|
30
|
+
ageUnitFields.forEach((field) => {
|
|
31
|
+
formModel.setFieldState(field, (state) => {
|
|
32
|
+
state.value = this.valueFilter({
|
|
33
|
+
fieldKey: field,
|
|
34
|
+
value: value.ageUnit,
|
|
35
|
+
context,
|
|
36
|
+
type: FIELD_BUSINESS_TYPE.AGE_UNIT
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
});
|
|
31
40
|
const ageFields = this.getField(FIELD_BUSINESS_TYPE.AGE);
|
|
32
41
|
ageFields.forEach((field) => {
|
|
33
42
|
formModel.setFieldState(field, (state) => {
|
|
34
43
|
state.value = this.valueFilter({
|
|
35
44
|
fieldKey: field,
|
|
36
|
-
value:
|
|
37
|
-
context
|
|
45
|
+
value: ageUnitFields.length ? value.age : context.year,
|
|
46
|
+
context,
|
|
38
47
|
type: FIELD_BUSINESS_TYPE.AGE
|
|
39
48
|
});
|
|
40
49
|
});
|
|
41
50
|
});
|
|
51
|
+
}
|
|
52
|
+
handlerIdCardType(formModel, value) {
|
|
53
|
+
if (!value || !isString(value) || !isIdCard(value))
|
|
54
|
+
return;
|
|
55
|
+
const info = parseIdCard(value);
|
|
56
|
+
this.setAge(formModel, info);
|
|
42
57
|
const sexFields = this.getField(FIELD_BUSINESS_TYPE.SEX);
|
|
43
58
|
sexFields.forEach((field) => {
|
|
44
59
|
formModel.setFieldState(field, (state) => {
|
|
@@ -55,18 +70,7 @@ class BusinessCollector {
|
|
|
55
70
|
handlerBirthdayType(formModel, value) {
|
|
56
71
|
if (!isString(value))
|
|
57
72
|
return;
|
|
58
|
-
|
|
59
|
-
ageFields.forEach((field) => {
|
|
60
|
-
const context = parseBirthday(value);
|
|
61
|
-
formModel.setFieldState(field, (state) => {
|
|
62
|
-
state.value = this.valueFilter({
|
|
63
|
-
fieldKey: field,
|
|
64
|
-
value: context.year,
|
|
65
|
-
context,
|
|
66
|
-
type: FIELD_BUSINESS_TYPE.AGE
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
});
|
|
73
|
+
this.setAge(formModel, parseBirthday(value));
|
|
70
74
|
}
|
|
71
75
|
trigger(formModel, fieldName, value) {
|
|
72
76
|
const type = this.getType(fieldName);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { isObject } from '@vueuse/core';
|
|
1
2
|
import { isArray, pick } from 'lodash-es';
|
|
2
|
-
import { arrayed, transformDateFormat } from '../utils/index.js';
|
|
3
3
|
import { useFormValidator, useTypeNormalize } from '../../../../packages/form-render';
|
|
4
|
-
import {
|
|
4
|
+
import { arrayed, transformDateFormat } from '../utils/index.js';
|
|
5
5
|
|
|
6
6
|
function useFieldListAdaptor(collector, uuid) {
|
|
7
7
|
const { createValidatorSchema } = useFormValidator();
|
|
@@ -10,12 +10,6 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
10
10
|
name: item.val_key,
|
|
11
11
|
type: "string",
|
|
12
12
|
title: item.alias || item.name,
|
|
13
|
-
"x-decorator": "FORM_ITEM",
|
|
14
|
-
"x-decorator-props": {
|
|
15
|
-
span: item.elem_width,
|
|
16
|
-
showLabel: item.hide_title !== "1",
|
|
17
|
-
id: `${uuid}-${item.val_key}`
|
|
18
|
-
},
|
|
19
13
|
"x-component": item.html_type,
|
|
20
14
|
"x-component-props": {
|
|
21
15
|
placeholder: item.placeholder,
|
|
@@ -28,6 +22,17 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
28
22
|
if (isObject(item.reactions)) {
|
|
29
23
|
result["x-reactions"] = item.reactions;
|
|
30
24
|
}
|
|
25
|
+
if (!item.noDecorator) {
|
|
26
|
+
Object.assign(result, {
|
|
27
|
+
"x-decorator": "FORM_ITEM",
|
|
28
|
+
"x-decorator-props": {
|
|
29
|
+
span: item.elem_width,
|
|
30
|
+
showLabel: item.hide_title !== "1",
|
|
31
|
+
id: `${uuid}-${item.val_key}`,
|
|
32
|
+
...item.decoratorProps || {}
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
}
|
|
31
36
|
const rules = createValidatorSchema(item);
|
|
32
37
|
rules && (result["x-validator"] = rules);
|
|
33
38
|
item.is_null === "0" && (result.required = true);
|
|
@@ -108,9 +113,9 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
108
113
|
const createSliderSchema = (item) => {
|
|
109
114
|
const schema = createStandardSchema(item);
|
|
110
115
|
Object.assign(schema["x-component-props"], {
|
|
111
|
-
step: item.step_length,
|
|
112
|
-
max: item.max_length,
|
|
113
|
-
min: item.min_length,
|
|
116
|
+
step: +item.step_length,
|
|
117
|
+
max: +item.max_length,
|
|
118
|
+
min: +item.min_length,
|
|
114
119
|
option: item.option
|
|
115
120
|
});
|
|
116
121
|
return schema;
|
|
@@ -183,22 +188,26 @@ function useFieldListAdaptor(collector, uuid) {
|
|
|
183
188
|
const { normalize } = useTypeNormalize();
|
|
184
189
|
function schemaAdaptor(fieldList) {
|
|
185
190
|
let prevLinebar = null;
|
|
186
|
-
return fieldList.reduce((fin, cur) => {
|
|
191
|
+
return fieldList.reduce((fin, cur, idx) => {
|
|
187
192
|
var _a;
|
|
188
193
|
normalize(cur);
|
|
189
194
|
const obj_type = (_a = cur.validate) == null ? void 0 : _a.obj_type;
|
|
190
195
|
obj_type && collector.collect(obj_type, cur.val_key);
|
|
191
196
|
if (cur.html_type === "LINEBAR") {
|
|
192
|
-
fin[createFieldName(cur)] = createLinebarSchema(cur);
|
|
197
|
+
fin[createFieldName(cur)] = bindIndex(createLinebarSchema(cur), idx);
|
|
193
198
|
prevLinebar = fin[createFieldName(cur)].properties = {};
|
|
194
199
|
} else if (prevLinebar) {
|
|
195
|
-
prevLinebar[createFieldName(cur)] = createWidgetSchema(cur);
|
|
200
|
+
prevLinebar[createFieldName(cur)] = bindIndex(createWidgetSchema(cur), idx);
|
|
196
201
|
} else {
|
|
197
202
|
prevLinebar = null;
|
|
198
|
-
fin[createFieldName(cur)] = createWidgetSchema(cur);
|
|
203
|
+
fin[createFieldName(cur)] = bindIndex(createWidgetSchema(cur), idx);
|
|
199
204
|
}
|
|
200
205
|
return fin;
|
|
201
206
|
}, {});
|
|
207
|
+
function bindIndex(schema, idx) {
|
|
208
|
+
schema["x-index"] = idx;
|
|
209
|
+
return schema;
|
|
210
|
+
}
|
|
202
211
|
function createFieldName(fieldItem) {
|
|
203
212
|
if (isArray(fieldItem.suffixConfig)) {
|
|
204
213
|
return [fieldItem.val_key, fieldItem.suffixConfig.map((f) => f.val_key)].join("-");
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import { FIELD_BUSINESS_TYPE } from '../../../../packages/form-render/src/constants';
|
|
2
|
+
|
|
1
3
|
function useTypeNormalize() {
|
|
2
4
|
function normalizeAgeField(item) {
|
|
3
5
|
item.html_type = "INPUT_NUMBER";
|
|
4
6
|
item.suffixConfig = [
|
|
5
7
|
{
|
|
8
|
+
validate: { obj_type: FIELD_BUSINESS_TYPE.AGE_UNIT },
|
|
6
9
|
val_key: item.val_key_unit,
|
|
7
10
|
html_type: "SELECT",
|
|
8
11
|
option: item.option
|
|
@@ -19,7 +19,8 @@ export interface FormAsyncQueueItem {
|
|
|
19
19
|
params?: AnyObject;
|
|
20
20
|
}
|
|
21
21
|
export declare type FormAsyncQueue = AsyncQueue<FormAsyncQueueItem, any, AnyObject[]>;
|
|
22
|
-
export declare type
|
|
22
|
+
export declare type AgeContext = Record<'age' | 'day' | 'month' | 'year', number>;
|
|
23
|
+
export declare type IdCardParseInfo = Record<'sex' | 'birthday', string> & AgeContext;
|
|
23
24
|
export declare type FormRenderExpose = {
|
|
24
25
|
validate(path?: string): Promise<void>;
|
|
25
26
|
getFormValues(): AnyObject;
|
|
@@ -2,7 +2,7 @@ import { AnyObject } from '../../../../../es/src/types';
|
|
|
2
2
|
import { ISchema } from '@formily/json-schema/esm/types';
|
|
3
3
|
import { GeneralField } from '@formily/core';
|
|
4
4
|
import { InjectionKey } from 'vue';
|
|
5
|
-
import { IdCardParseInfo } from '../types';
|
|
5
|
+
import { AgeContext, IdCardParseInfo } from '../types';
|
|
6
6
|
export declare function formRenderLog(message: string, type?: keyof Console): void;
|
|
7
7
|
export declare function arrayed<T>(maybeArray: T): T extends Array<any> ? T : [T];
|
|
8
8
|
export declare function assignUpdateValue(props: AnyObject, field: GeneralField): {
|
|
@@ -11,7 +11,7 @@ export declare function assignUpdateValue(props: AnyObject, field: GeneralField)
|
|
|
11
11
|
export declare function transformDateFormat(format: string): "date" | "datetime";
|
|
12
12
|
export declare function isIdCard(idCardNo: string): boolean;
|
|
13
13
|
export declare function isMobile(mobile: string): boolean;
|
|
14
|
-
export declare function parseBirthday(birthday: string):
|
|
14
|
+
export declare function parseBirthday(birthday: string): AgeContext;
|
|
15
15
|
export declare function parseIdCard(idCardNo: string): IdCardParseInfo;
|
|
16
16
|
export declare function injectOrProvide<T>(key: InjectionKey<T>, creator: () => T): T;
|
|
17
17
|
export declare function generateUrlParams(field: GeneralField, dependKeys?: string | string[]): AnyObject;
|
|
@@ -41,7 +41,7 @@ function parseBirthday(birthday) {
|
|
|
41
41
|
const birthDate = new Date(birthday);
|
|
42
42
|
result.day = differenceInDays(d, birthDate);
|
|
43
43
|
result.month = differenceInMonths(d, birthDate);
|
|
44
|
-
result.year = differenceInYears(d, birthDate);
|
|
44
|
+
result.age = result.year = differenceInYears(d, birthDate);
|
|
45
45
|
return result;
|
|
46
46
|
}
|
|
47
47
|
function parseIdCard(idCardNo) {
|
package/es/packages/index.css
CHANGED
|
@@ -1129,6 +1129,13 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
1129
1129
|
.n-dialog__title .svg-wrap {
|
|
1130
1130
|
margin: 0 0 0 auto;
|
|
1131
1131
|
}
|
|
1132
|
+
.n-dialog__title .svg-wrap .svg-icon {
|
|
1133
|
+
width: 1em;
|
|
1134
|
+
height: 1em;
|
|
1135
|
+
vertical-align: -0.15em;
|
|
1136
|
+
fill: currentColor;
|
|
1137
|
+
overflow: hidden;
|
|
1138
|
+
}
|
|
1132
1139
|
.n-dialog__title .svg-wrap svg {
|
|
1133
1140
|
font-size: 14px;
|
|
1134
1141
|
cursor: pointer;
|
|
@@ -1764,8 +1771,6 @@ body > .vxe-table--tooltip-wrapper {
|
|
|
1764
1771
|
}
|
|
1765
1772
|
.n-dialog.n-modal.c-evatip-dialog-wrap .n-base-icon {
|
|
1766
1773
|
position: absolute;
|
|
1767
|
-
right: 16px;
|
|
1768
|
-
top: 16px;
|
|
1769
1774
|
margin: 0;
|
|
1770
1775
|
color: #666666;
|
|
1771
1776
|
}
|
|
@@ -11,7 +11,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
11
11
|
type: BooleanConstructor;
|
|
12
12
|
default: boolean;
|
|
13
13
|
};
|
|
14
|
-
}, () => JSX.Element
|
|
14
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
15
15
|
form: {
|
|
16
16
|
type: ObjectConstructor;
|
|
17
17
|
default: () => {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, computed, createVNode, resolveComponent, createTextVNode } from 'vue';
|
|
1
|
+
import { defineComponent, computed, createVNode, withDirectives, vShow, resolveComponent, createTextVNode } from 'vue';
|
|
2
2
|
import { NDivider, NIcon } from 'naive-ui';
|
|
3
3
|
import { AlertCircleOutline } from '@vicons/ionicons5';
|
|
4
4
|
|
|
@@ -59,11 +59,9 @@ var RCollection = defineComponent({
|
|
|
59
59
|
}, [describe])]);
|
|
60
60
|
};
|
|
61
61
|
const renderLinebar = () => {
|
|
62
|
-
if (!props.item.title)
|
|
63
|
-
return null;
|
|
64
62
|
return createVNode("div", {
|
|
65
63
|
"class": "linebar-div"
|
|
66
|
-
}, [createVNode("span", null, [props.item.title]), createVNode(resolveComponent("n-divider"), null, null)]);
|
|
64
|
+
}, [withDirectives(createVNode("span", null, [props.item.title]), [[vShow, props.item.title]]), createVNode(resolveComponent("n-divider"), null, null)]);
|
|
67
65
|
};
|
|
68
66
|
const renderPrompt = () => {
|
|
69
67
|
return createVNode("div", {
|
|
@@ -32,7 +32,7 @@ const ScaleViewComputed = (props, state, config) => {
|
|
|
32
32
|
XS: "extrasmall"
|
|
33
33
|
};
|
|
34
34
|
fontSize = keyValue[fontSize];
|
|
35
|
-
const scale = fontSize &&
|
|
35
|
+
const scale = fontSize && (props == null ? void 0 : props.fontSizeObj[fontSize]) || 1;
|
|
36
36
|
const size = 1e4;
|
|
37
37
|
const value = Math.floor(100 / scale * size) / size;
|
|
38
38
|
return {
|
|
@@ -197,6 +197,9 @@ const ScaleViewInit = (props, state, emit, config) => {
|
|
|
197
197
|
var _a, _b;
|
|
198
198
|
if (!list || !list.length)
|
|
199
199
|
return;
|
|
200
|
+
let query = handleQueryParams();
|
|
201
|
+
if ((props == null ? void 0 : props.noBtn) || (query == null ? void 0 : query.noBtn))
|
|
202
|
+
return;
|
|
200
203
|
let matchItem = list.find((item) => item.type === "FRONT_ADDRESS");
|
|
201
204
|
if (!matchItem || !Object.keys(matchItem).length)
|
|
202
205
|
return;
|
|
@@ -206,7 +209,6 @@ const ScaleViewInit = (props, state, emit, config) => {
|
|
|
206
209
|
}
|
|
207
210
|
if (!setting || !Object.keys(setting).length)
|
|
208
211
|
return;
|
|
209
|
-
let query = handleQueryParams();
|
|
210
212
|
if ((query == null ? void 0 : query.redirect) == 1 || ((_a = props.params) == null ? void 0 : _a.redirect) == 1 || query.isEdit == 3 || ((_b = props.params) == null ? void 0 : _b.isEdit) == 3)
|
|
211
213
|
return;
|
|
212
214
|
let { frontAddress } = setting;
|
|
@@ -13,7 +13,7 @@ export declare const componentMap: {
|
|
|
13
13
|
type: BooleanConstructor;
|
|
14
14
|
default: boolean;
|
|
15
15
|
};
|
|
16
|
-
}, () => JSX.Element
|
|
16
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
17
17
|
form: {
|
|
18
18
|
type: ObjectConstructor;
|
|
19
19
|
default: () => {};
|
|
@@ -44,7 +44,7 @@ export declare const componentMap: {
|
|
|
44
44
|
type: BooleanConstructor;
|
|
45
45
|
default: boolean;
|
|
46
46
|
};
|
|
47
|
-
}, () => JSX.Element
|
|
47
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
48
48
|
form: {
|
|
49
49
|
type: ObjectConstructor;
|
|
50
50
|
default: () => {};
|
|
@@ -10190,7 +10190,7 @@ export declare const componentMap: {
|
|
|
10190
10190
|
type: BooleanConstructor;
|
|
10191
10191
|
default: boolean;
|
|
10192
10192
|
};
|
|
10193
|
-
}, () => JSX.Element
|
|
10193
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10194
10194
|
form: {
|
|
10195
10195
|
type: ObjectConstructor;
|
|
10196
10196
|
default: () => {};
|
|
@@ -10221,7 +10221,7 @@ export declare const componentMap: {
|
|
|
10221
10221
|
type: BooleanConstructor;
|
|
10222
10222
|
default: boolean;
|
|
10223
10223
|
};
|
|
10224
|
-
}, () => JSX.Element
|
|
10224
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10225
10225
|
form: {
|
|
10226
10226
|
type: ObjectConstructor;
|
|
10227
10227
|
default: () => {};
|
|
@@ -10252,7 +10252,7 @@ export declare const componentMap: {
|
|
|
10252
10252
|
type: BooleanConstructor;
|
|
10253
10253
|
default: boolean;
|
|
10254
10254
|
};
|
|
10255
|
-
}, () => JSX.Element
|
|
10255
|
+
}, () => JSX.Element, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, never[], never, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10256
10256
|
form: {
|
|
10257
10257
|
type: ObjectConstructor;
|
|
10258
10258
|
default: () => {};
|
|
@@ -148,6 +148,13 @@
|
|
|
148
148
|
.n-dialog__title .svg-wrap {
|
|
149
149
|
margin: 0 0 0 auto;
|
|
150
150
|
}
|
|
151
|
+
.n-dialog__title .svg-wrap .svg-icon {
|
|
152
|
+
width: 1em;
|
|
153
|
+
height: 1em;
|
|
154
|
+
vertical-align: -0.15em;
|
|
155
|
+
fill: currentColor;
|
|
156
|
+
overflow: hidden;
|
|
157
|
+
}
|
|
151
158
|
.n-dialog__title .svg-wrap svg {
|
|
152
159
|
font-size: 14px;
|
|
153
160
|
cursor: pointer;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "3.1.12-beta.
|
|
4
|
+
"version": "3.1.12-beta.6",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"module": "es/packages/index.js",
|
|
7
7
|
"main": "es/packages/index.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"vue": "^3.2.0",
|
|
60
60
|
"vue-simple-uploader": "^1.0.0-beta.5",
|
|
61
61
|
"vuedraggable": "4.1.0",
|
|
62
|
-
"vxe-table": "
|
|
62
|
+
"vxe-table": "4.2.5",
|
|
63
63
|
"xe-utils": "^3.5.4"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|