cnhis-design-vue 3.1.21-beta.1 → 3.1.21-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +123 -123
- package/es/components/big-table/index.d.ts +12 -10
- package/es/components/big-table/src/BigTable.vue.d.ts +12 -10
- package/es/components/big-table/src/BigTable.vue_vue_type_script_setup_true_lang.js +24 -16
- package/es/components/big-table/src/bigTableProps.d.ts +1 -1
- package/es/components/big-table/src/components/edit-form/edit-input.js +15 -7
- package/es/components/big-table/src/hooks/useEdit.d.ts +2 -1
- package/es/components/big-table/src/hooks/useEdit2.js +3 -2
- package/es/components/big-table/src/hooks/useFormat.d.ts +3 -1
- package/es/components/big-table/src/hooks/useFormat2.js +11 -2
- package/es/components/fabric-chart/src/components/PopupMenu.js +9 -2
- package/es/components/fabric-chart/src/hooks/useCenter2.js +21 -20
- package/es/components/fabric-chart/src/hooks/useLeft2.js +4 -3
- package/es/components/form-config/index.d.ts +1 -0
- package/es/components/form-config/src/FormConfig.vue.d.ts +1 -0
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +1 -0
- package/es/components/form-render/index2.js +4 -5
- package/es/components/form-render/src/FormRender.js +3 -3
- package/es/components/form-render/src/components/renderer/cascader.js +3 -4
- package/es/components/form-render/src/components/renderer/checkbox.js +2 -5
- package/es/components/form-render/src/components/renderer/combination.js +2 -4
- package/es/components/form-render/src/components/renderer/complex.js +1 -4
- package/es/components/form-render/src/components/renderer/date.js +12 -3
- package/es/components/form-render/src/components/renderer/formItem.js +1 -4
- package/es/components/form-render/src/components/renderer/radio.js +1 -3
- package/es/components/form-render/src/components/renderer/search.js +11 -17
- package/es/components/form-render/src/components/renderer/select.js +13 -19
- package/es/components/form-render/src/components/renderer/switch.js +2 -5
- package/es/components/form-render/src/components/renderer/textarea.js +2 -5
- package/es/components/form-render/src/hooks/useAnchor2.js +1 -3
- package/es/components/form-render/src/hooks/useBusinessBinding2.js +1 -3
- package/es/components/form-render/src/hooks/useChangeContext.d.ts +3 -5
- package/es/components/form-render/src/hooks/useChangeContext2.js +2 -2
- package/es/components/form-render/src/hooks/useFormItemDeps2.js +1 -4
- package/es/components/{form-table → form-render}/src/hooks/useNuiThemeOverrides.d.ts +0 -0
- package/es/components/{form-table → form-render}/src/hooks/useNuiThemeOverrides.js +0 -0
- package/es/components/{form-table → form-render}/src/hooks/useNuiThemeOverrides2.js +0 -0
- package/es/components/form-render/src/hooks/usePresetScope2.js +1 -4
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -0
- package/es/components/form-render/src/utils/index.d.ts +4 -1
- package/es/components/form-render/src/utils/index.js +27 -1
- package/es/components/index.d.ts +1 -2
- package/es/components/index.js +0 -1
- package/es/components/index2.js +0 -3
- package/es/components/info-header/index.d.ts +31 -8
- package/es/components/info-header/src/HiddenContent.vue.d.ts +2 -2
- package/es/components/info-header/src/InfoEllipsis.vue.d.ts +1 -1
- package/es/components/info-header/src/InfoHeader.js +9 -10
- package/es/components/info-header/src/InfoHeader.vue.d.ts +32 -8
- package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +1 -1
- package/es/components/shortcut-setter/index.d.ts +1 -0
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +1 -0
- package/es/components/steps-wheel/index.d.ts +1 -1
- package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +1 -1
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +1 -1
- package/package.json +2 -2
- package/es/components/big-table/src/components/edit-form/useCommon.d.ts +0 -4
- package/es/components/bpmn-workflow/src/BpmnWorkflow.d.ts +0 -0
- package/es/components/bpmn-workflow/types/BpmnViewer.d.ts +0 -1
- package/es/components/bpmn-workflow/types/ModelingModule.d.ts +0 -1
- package/es/components/bpmn-workflow/types/MoveCanvasModule.d.ts +0 -1
- package/es/components/fabric-chart/src/utils/index.d.ts +0 -6823
- package/es/components/form-table/index.d.ts +0 -4019
- package/es/components/form-table/index.js +0 -1
- package/es/components/form-table/index2.js +0 -10
- package/es/components/form-table/src/FormTable.js +0 -474
- package/es/components/form-table/src/FormTable.vue.d.ts +0 -4019
- package/es/components/form-table/src/components/index.d.ts +0 -3778
- package/es/components/form-table/src/components/index.js +0 -1
- package/es/components/form-table/src/components/index2.js +0 -40
- package/es/components/form-table/src/components/table-age.js +0 -235
- package/es/components/form-table/src/components/table-age.vue.d.ts +0 -318
- package/es/components/form-table/src/components/table-date-picker.js +0 -179
- package/es/components/form-table/src/components/table-date-picker.vue.d.ts +0 -250
- package/es/components/form-table/src/components/table-digital.js +0 -141
- package/es/components/form-table/src/components/table-digital.vue.d.ts +0 -261
- package/es/components/form-table/src/components/table-input-password.js +0 -141
- package/es/components/form-table/src/components/table-input-password.vue.d.ts +0 -304
- package/es/components/form-table/src/components/table-input.js +0 -127
- package/es/components/form-table/src/components/table-input.vue.d.ts +0 -261
- package/es/components/form-table/src/components/table-month-picker.js +0 -104
- package/es/components/form-table/src/components/table-month-picker.vue.d.ts +0 -193
- package/es/components/form-table/src/components/table-search-more.js +0 -6
- package/es/components/form-table/src/components/table-search-more.vue.d.ts +0 -392
- package/es/components/form-table/src/components/table-search-more.vue_vue_type_script_setup_true_lang.js +0 -276
- package/es/components/form-table/src/components/table-search.js +0 -6
- package/es/components/form-table/src/components/table-search.vue.d.ts +0 -386
- package/es/components/form-table/src/components/table-search.vue_vue_type_script_setup_true_lang.js +0 -276
- package/es/components/form-table/src/components/table-select-multiple.js +0 -164
- package/es/components/form-table/src/components/table-select-multiple.vue.d.ts +0 -235
- package/es/components/form-table/src/components/table-select.js +0 -159
- package/es/components/form-table/src/components/table-select.vue.d.ts +0 -234
- package/es/components/form-table/src/components/table-textarea.js +0 -157
- package/es/components/form-table/src/components/table-textarea.vue.d.ts +0 -320
- package/es/components/form-table/src/components/table-time-picker.js +0 -150
- package/es/components/form-table/src/components/table-time-picker.vue.d.ts +0 -246
- package/es/components/form-table/src/components/table-tree-select.js +0 -285
- package/es/components/form-table/src/components/table-tree-select.vue.d.ts +0 -349
- package/es/components/form-table/src/components/text-over-tooltip.js +0 -64
- package/es/components/form-table/src/components/text-over-tooltip.vue.d.ts +0 -70
- package/es/components/form-table/src/configs/index.d.ts +0 -35
- package/es/components/form-table/src/configs/index.js +0 -1
- package/es/components/form-table/src/configs/index2.js +0 -67
- package/es/components/form-table/src/hooks/index.d.ts +0 -5
- package/es/components/form-table/src/hooks/index.js +0 -5
- package/es/components/form-table/src/hooks/useBoundDate.d.ts +0 -21
- package/es/components/form-table/src/hooks/useBoundDate.js +0 -1
- package/es/components/form-table/src/hooks/useBoundDate2.js +0 -414
- package/es/components/form-table/src/hooks/useDateType.d.ts +0 -17
- package/es/components/form-table/src/hooks/useDateType.js +0 -1
- package/es/components/form-table/src/hooks/useDateType2.js +0 -160
- package/es/components/form-table/src/hooks/useFormCommon.d.ts +0 -14
- package/es/components/form-table/src/hooks/useFormCommon.js +0 -1
- package/es/components/form-table/src/hooks/useFormCommon2.js +0 -101
- package/es/components/form-table/src/hooks/useFormEvent.d.ts +0 -9
- package/es/components/form-table/src/hooks/useFormEvent.js +0 -1
- package/es/components/form-table/src/hooks/useFormEvent2.js +0 -68
- package/es/components/form-table/src/hooks/useItemDefault.d.ts +0 -53
- package/es/components/form-table/src/hooks/useItemDefault.js +0 -1
- package/es/components/form-table/src/hooks/useItemDefault2.js +0 -218
- package/es/components/form-table/src/hooks/useSearch.d.ts +0 -165
- package/es/components/form-table/src/hooks/useSearch.js +0 -1
- package/es/components/form-table/src/hooks/useSearch2.js +0 -1154
- package/es/components/form-table/src/hooks/useValidate.d.ts +0 -24
- package/es/components/form-table/src/hooks/useValidate.js +0 -1
- package/es/components/form-table/src/hooks/useValidate2.js +0 -480
- package/es/components/form-table/src/types/index.d.ts +0 -11
- package/es/components/form-table/src/types/index.js +0 -1
- package/es/components/form-table/style/index.css +0 -1
- package/es/shared/utils/tapable/index.d.ts +0 -139
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import XEUtils from 'xe-utils';
|
|
2
2
|
import 'moment';
|
|
3
3
|
|
|
4
|
-
const useFormat = (state) => {
|
|
4
|
+
const useFormat = (state, attr) => {
|
|
5
5
|
const formatData = (data = {
|
|
6
6
|
tableList: [],
|
|
7
7
|
fieldList: [],
|
|
@@ -482,10 +482,19 @@ const useFormat = (state) => {
|
|
|
482
482
|
"border-color": v.color
|
|
483
483
|
};
|
|
484
484
|
};
|
|
485
|
+
function getAttr(field) {
|
|
486
|
+
if (attr[field])
|
|
487
|
+
return attr[field];
|
|
488
|
+
const newField = field.replace(/-(\w)/g, ($0, $1) => {
|
|
489
|
+
return $1.toUpperCase();
|
|
490
|
+
});
|
|
491
|
+
return attr[newField] || {};
|
|
492
|
+
}
|
|
485
493
|
return {
|
|
486
494
|
formatData,
|
|
487
495
|
htmlToText,
|
|
488
|
-
getBtnStyle
|
|
496
|
+
getBtnStyle,
|
|
497
|
+
getAttr
|
|
489
498
|
};
|
|
490
499
|
};
|
|
491
500
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, createVNode, Teleport, withDirectives, vShow } from 'vue';
|
|
1
|
+
import { defineComponent, ref, watch, createVNode, Teleport, withDirectives, vShow } from 'vue';
|
|
2
2
|
import { NSpace, NInputNumber } from 'naive-ui';
|
|
3
3
|
import useStyle from './useStyle2.js';
|
|
4
4
|
import { onClickOutside } from '@vueuse/core';
|
|
@@ -31,9 +31,11 @@ var PopupMenu = defineComponent({
|
|
|
31
31
|
slots,
|
|
32
32
|
emit
|
|
33
33
|
}) {
|
|
34
|
+
let setNoShow = false;
|
|
34
35
|
const popupRef = ref(null);
|
|
35
36
|
onClickOutside(popupRef, (event) => {
|
|
36
|
-
emit("update:show", false);
|
|
37
|
+
!setNoShow && emit("update:show", false);
|
|
38
|
+
setNoShow = false;
|
|
37
39
|
});
|
|
38
40
|
const {
|
|
39
41
|
left
|
|
@@ -81,6 +83,11 @@ var PopupMenu = defineComponent({
|
|
|
81
83
|
});
|
|
82
84
|
}
|
|
83
85
|
}
|
|
86
|
+
watch(() => props.show, (value) => {
|
|
87
|
+
if (value) {
|
|
88
|
+
setNoShow = true;
|
|
89
|
+
}
|
|
90
|
+
});
|
|
84
91
|
return () => {
|
|
85
92
|
return createVNode(Teleport, {
|
|
86
93
|
"to": ".c-fabric-chart"
|
|
@@ -64,7 +64,9 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
64
64
|
left.yScaleValue.forEach((scaleValue) => {
|
|
65
65
|
drawPositionLine(scaleValue);
|
|
66
66
|
scaleValue.dataList.forEach((item, dataIndex) => {
|
|
67
|
-
|
|
67
|
+
if (scaleValue.type !== "temperature" || item.enable) {
|
|
68
|
+
drawPolyLine(item, dataIndex, scaleValue);
|
|
69
|
+
}
|
|
68
70
|
});
|
|
69
71
|
});
|
|
70
72
|
drawShaDow();
|
|
@@ -228,13 +230,6 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
228
230
|
});
|
|
229
231
|
}
|
|
230
232
|
function drawPolyLine(item, dataIndex, scaleValue) {
|
|
231
|
-
const {
|
|
232
|
-
pointAttr = {},
|
|
233
|
-
lineAttr = {},
|
|
234
|
-
type: pointType = "circle",
|
|
235
|
-
upArrowShow = false,
|
|
236
|
-
limitValueShow = false
|
|
237
|
-
} = item;
|
|
238
233
|
const {
|
|
239
234
|
type,
|
|
240
235
|
noRiseStyle = {},
|
|
@@ -242,13 +237,22 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
242
237
|
reduceStyle = {},
|
|
243
238
|
pacemaker = {},
|
|
244
239
|
upArrowStyle = {},
|
|
245
|
-
limitValueStyle = {}
|
|
240
|
+
limitValueStyle = {},
|
|
241
|
+
dataList = []
|
|
246
242
|
} = scaleValue;
|
|
247
243
|
const pointList = [];
|
|
248
244
|
const lineList = [];
|
|
249
245
|
const otherList = [];
|
|
250
246
|
item.list.forEach((v, index) => {
|
|
251
|
-
var _a
|
|
247
|
+
var _a;
|
|
248
|
+
const _item = type !== "temperature" ? item : dataList.find((_v) => _v.key === v.key);
|
|
249
|
+
const {
|
|
250
|
+
pointAttr = {},
|
|
251
|
+
lineAttr = {},
|
|
252
|
+
type: pointType = "circle",
|
|
253
|
+
upArrowShow = false,
|
|
254
|
+
limitValueShow = false
|
|
255
|
+
} = _item;
|
|
252
256
|
const points = getPointer(v, scaleValue);
|
|
253
257
|
const nextV = item.list[index + 1];
|
|
254
258
|
const nextPoint = getPointer(nextV, scaleValue);
|
|
@@ -330,9 +334,8 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
330
334
|
line = drawLine([...points, ...nextPoint], {
|
|
331
335
|
...lineAttr
|
|
332
336
|
});
|
|
333
|
-
} else if (points && !nextPoint && !v.breakpoint
|
|
334
|
-
const
|
|
335
|
-
const nextLinePoint = getPointer(nextV2, scaleValue);
|
|
337
|
+
} else if (points && !nextPoint && !v.breakpoint) {
|
|
338
|
+
const nextLinePoint = getPointer(nextV, scaleValue);
|
|
336
339
|
line = nextLinePoint ? drawLine([...points, ...nextLinePoint], {
|
|
337
340
|
...lineAttr
|
|
338
341
|
}) : null;
|
|
@@ -373,12 +376,6 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
373
376
|
} else {
|
|
374
377
|
if (points) {
|
|
375
378
|
pointAttrNew.leftLine = null;
|
|
376
|
-
if (type == "temperature" && index === 0) {
|
|
377
|
-
const objLine = [...prevLines].find((v2) => v2.dataIndex === dataIndex - 1);
|
|
378
|
-
if (objLine) {
|
|
379
|
-
pointAttrNew.leftLine = objLine.line;
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
379
|
point = drawPoint(currentPointType, {
|
|
383
380
|
left: points[0],
|
|
384
381
|
top: points[1],
|
|
@@ -526,7 +523,8 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
526
523
|
emits("add", {
|
|
527
524
|
data: {
|
|
528
525
|
time: getXValue(item.pointer.x),
|
|
529
|
-
value: getYValue(item.origin.type, item.pointer.y)
|
|
526
|
+
value: getYValue(item.origin.type, item.pointer.y),
|
|
527
|
+
...item.origin.type !== "temperature" ? {} : { key: item.origin.key }
|
|
530
528
|
},
|
|
531
529
|
...item.origin
|
|
532
530
|
});
|
|
@@ -536,6 +534,9 @@ function useCenter(canvas, propItems, emits, cumputedX, cumputedY, getXValue, ge
|
|
|
536
534
|
value: target.origin.data.value
|
|
537
535
|
};
|
|
538
536
|
data[`${item.type}`] = item.value;
|
|
537
|
+
if (target.origin.type === "temperature") {
|
|
538
|
+
data["key"] = target.origin.key;
|
|
539
|
+
}
|
|
539
540
|
emits("change", {
|
|
540
541
|
...target.origin,
|
|
541
542
|
data
|
|
@@ -212,7 +212,7 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
212
212
|
});
|
|
213
213
|
const icon = drawPoint(item.type, {
|
|
214
214
|
left: leftX,
|
|
215
|
-
top: topY - (text.height || 30) / 2,
|
|
215
|
+
top: topY - (text.height || 30) / 2 - 1,
|
|
216
216
|
...item.pointAttr,
|
|
217
217
|
originY: "center",
|
|
218
218
|
originX: "right",
|
|
@@ -224,7 +224,7 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
224
224
|
key: item.key
|
|
225
225
|
},
|
|
226
226
|
originLeft: leftX,
|
|
227
|
-
originTop: topY - (text.height || 30) / 2,
|
|
227
|
+
originTop: topY - (text.height || 30) / 2 - 1,
|
|
228
228
|
...propItems.event
|
|
229
229
|
});
|
|
230
230
|
topY -= text.height || 30;
|
|
@@ -251,7 +251,8 @@ function useLeft(canvas, propItems, emits, setPopup, pointTipProps, getXValue, g
|
|
|
251
251
|
emits("add", {
|
|
252
252
|
data: {
|
|
253
253
|
time: getXValue(point.left),
|
|
254
|
-
value: getYValue(point.origin.type, point.top)
|
|
254
|
+
value: getYValue(point.origin.type, point.top),
|
|
255
|
+
...point.origin.type !== "temperature" ? {} : { key: point.origin.key }
|
|
255
256
|
},
|
|
256
257
|
...point.origin
|
|
257
258
|
});
|
|
@@ -927,6 +927,7 @@ declare const FormConfig: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
927
927
|
option?: {
|
|
928
928
|
text: string;
|
|
929
929
|
value: any;
|
|
930
|
+
keyword?: string | undefined;
|
|
930
931
|
children?: any[] | undefined;
|
|
931
932
|
}[] | undefined;
|
|
932
933
|
multi_select?: import("..").FormCommonState | undefined;
|
|
@@ -929,6 +929,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
929
929
|
option?: {
|
|
930
930
|
text: string;
|
|
931
931
|
value: any;
|
|
932
|
+
keyword?: string | undefined;
|
|
932
933
|
children?: any[] | undefined;
|
|
933
934
|
}[] | undefined;
|
|
934
935
|
multi_select?: import("../..").FormCommonState | undefined;
|
|
@@ -56,6 +56,7 @@ declare const _default: import("vue").DefineComponent<{}, {
|
|
|
56
56
|
option?: {
|
|
57
57
|
text: string;
|
|
58
58
|
value: any;
|
|
59
|
+
keyword?: string | undefined;
|
|
59
60
|
children?: any[] | undefined;
|
|
60
61
|
}[] | undefined;
|
|
61
62
|
multi_select?: import("../../../../../es/components/form-render").FormCommonState | undefined;
|
|
@@ -3,12 +3,9 @@ import { safeComponentRegister } from '../../shared/utils/index2.js';
|
|
|
3
3
|
import script from './src/FormRender.js';
|
|
4
4
|
import '@vueuse/core';
|
|
5
5
|
import 'lodash-es';
|
|
6
|
-
import '
|
|
7
|
-
import '@formily/path';
|
|
8
|
-
import '@vue/shared';
|
|
9
|
-
import 'date-fns';
|
|
10
|
-
export * from '@formily/core';
|
|
6
|
+
import './src/utils/index.js';
|
|
11
7
|
import '@formily/vue';
|
|
8
|
+
import 'vue';
|
|
12
9
|
import '../../shared/utils/tapable/SyncHook.js';
|
|
13
10
|
import '../../shared/utils/tapable/SyncBailHook.js';
|
|
14
11
|
import '../../shared/utils/tapable/SyncWaterfallHook.js';
|
|
@@ -19,6 +16,8 @@ import '../../shared/utils/tapable/AsyncSeriesHook.js';
|
|
|
19
16
|
import '../../shared/utils/tapable/AsyncSeriesBailHook.js';
|
|
20
17
|
import '../../shared/utils/tapable/AsyncSeriesLoopHook.js';
|
|
21
18
|
import '../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
|
|
19
|
+
export * from '@formily/core';
|
|
20
|
+
import '@vue/shared';
|
|
22
21
|
import './src/components/renderer/input.js';
|
|
23
22
|
import './src/components/renderer/select.js';
|
|
24
23
|
import './src/components/renderer/formItem.js';
|
|
@@ -6,8 +6,8 @@ import { cloneDeep, isArray } from 'lodash-es';
|
|
|
6
6
|
import { NForm, NTabs, NTabPane, NConfigProvider } from 'naive-ui';
|
|
7
7
|
import { FormItemLineBarDepKeyPrepend } from './constants/index2.js';
|
|
8
8
|
import { useFormRenderLifeCycle } from './hooks/useFormRenderLifeCycle2.js';
|
|
9
|
+
import { useNuiThemeOverrides } from './hooks/useNuiThemeOverrides2.js';
|
|
9
10
|
import { arrayed } from './utils/index.js';
|
|
10
|
-
import { useNuiThemeOverrides } from '../../form-table/src/hooks/useNuiThemeOverrides2.js';
|
|
11
11
|
import { useFieldListAdaptor } from './hooks/useFieldListAdaptor2.js';
|
|
12
12
|
import '../index2.js';
|
|
13
13
|
import { useFieldVisitor } from './hooks/useFieldVisitor2.js';
|
|
@@ -65,7 +65,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
65
65
|
const formModel = createForm({
|
|
66
66
|
initialValues: props.initialData,
|
|
67
67
|
effects() {
|
|
68
|
-
onFieldValueChange("*",
|
|
68
|
+
onFieldValueChange("*", (field) => {
|
|
69
69
|
const fieldKey = field.props.name.toString();
|
|
70
70
|
businessCollector.trigger(fieldKey);
|
|
71
71
|
formItemDepsCollector.trigger(fieldKey);
|
|
@@ -74,7 +74,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
74
74
|
fieldKey,
|
|
75
75
|
fieldName: field.title,
|
|
76
76
|
value: field.value,
|
|
77
|
-
context:
|
|
77
|
+
context: changeContextCollector.getContext(fieldKey, field.value)
|
|
78
78
|
});
|
|
79
79
|
});
|
|
80
80
|
}
|
|
@@ -5,10 +5,7 @@ import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
|
|
|
5
5
|
import { InjectAsyncQueue } from '../../constants/index2.js';
|
|
6
6
|
import '@vueuse/core';
|
|
7
7
|
import '../../../index2.js';
|
|
8
|
-
import '
|
|
9
|
-
import '@vue/shared';
|
|
10
|
-
import 'date-fns';
|
|
11
|
-
import { assignUpdateValue, assignValueBindKey, traverseDependKey } from '../../utils/schema2.js';
|
|
8
|
+
import '../../utils/index.js';
|
|
12
9
|
import { useFormField } from '../../hooks/useFormField2.js';
|
|
13
10
|
import '../../../../../shared/utils/tapable/SyncHook.js';
|
|
14
11
|
import '../../../../../shared/utils/tapable/SyncBailHook.js';
|
|
@@ -20,6 +17,7 @@ import '../../../../../shared/utils/tapable/AsyncSeriesHook.js';
|
|
|
20
17
|
import '../../../../../shared/utils/tapable/AsyncSeriesBailHook.js';
|
|
21
18
|
import '../../../../../shared/utils/tapable/AsyncSeriesLoopHook.js';
|
|
22
19
|
import '../../../../../shared/utils/tapable/AsyncSeriesWaterfallHook.js';
|
|
20
|
+
import '@vue/shared';
|
|
23
21
|
import { connect, mapProps } from '@formily/vue';
|
|
24
22
|
import './input.js';
|
|
25
23
|
import './select.js';
|
|
@@ -40,6 +38,7 @@ import './complex.js';
|
|
|
40
38
|
import './simpleComponent.js';
|
|
41
39
|
import './search.js';
|
|
42
40
|
import { NCascader } from 'naive-ui';
|
|
41
|
+
import { assignUpdateValue, assignValueBindKey, traverseDependKey } from '../../utils/schema2.js';
|
|
43
42
|
|
|
44
43
|
const script = defineComponent({
|
|
45
44
|
name: "FormCascader",
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { defineComponent, createVNode } from 'vue';
|
|
2
|
-
import '
|
|
3
|
-
import '@vue/shared';
|
|
4
|
-
import 'lodash-es';
|
|
5
|
-
import 'date-fns';
|
|
6
|
-
import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
|
|
2
|
+
import '../../utils/index.js';
|
|
7
3
|
import { connect, mapProps } from '@formily/vue';
|
|
8
4
|
import { NCheckboxGroup, NSpace, NCheckbox } from 'naive-ui';
|
|
5
|
+
import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
|
|
9
6
|
|
|
10
7
|
const script = defineComponent({
|
|
11
8
|
name: "FormCheckbox",
|
|
@@ -4,12 +4,10 @@ import '../../../index2.js';
|
|
|
4
4
|
import { useField, RecursionField, connect } from '@formily/vue';
|
|
5
5
|
import { NButton, NIcon } from 'naive-ui';
|
|
6
6
|
import { InjectionBusinessCollector } from '../../constants/index2.js';
|
|
7
|
-
import '
|
|
8
|
-
import '@vue/shared';
|
|
9
|
-
import 'date-fns';
|
|
10
|
-
import { createObjSchema } from '../../utils/schema2.js';
|
|
7
|
+
import '../../utils/index.js';
|
|
11
8
|
import { AddCircleOutline, RemoveCircle } from '@vicons/ionicons5';
|
|
12
9
|
import { useFieldListAdaptor } from '../../hooks/useFieldListAdaptor2.js';
|
|
10
|
+
import { createObjSchema } from '../../utils/schema2.js';
|
|
13
11
|
|
|
14
12
|
const script = defineComponent({
|
|
15
13
|
name: "FormCombination",
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { defineComponent, createVNode } from 'vue';
|
|
2
2
|
import { connect, mapProps } from '@formily/vue';
|
|
3
|
-
import '
|
|
4
|
-
import '@vue/shared';
|
|
5
|
-
import 'lodash-es';
|
|
6
|
-
import 'date-fns';
|
|
3
|
+
import '../../utils/index.js';
|
|
7
4
|
import { assignUpdateValue } from '../../utils/schema2.js';
|
|
8
5
|
|
|
9
6
|
const script = defineComponent({
|
|
@@ -5,9 +5,7 @@ import { isObject } from '@vueuse/core';
|
|
|
5
5
|
import { format } from 'date-fns';
|
|
6
6
|
import { NDatePicker } from 'naive-ui';
|
|
7
7
|
import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
|
|
8
|
-
import '
|
|
9
|
-
import '@vue/shared';
|
|
10
|
-
import 'lodash-es';
|
|
8
|
+
import '../../utils/index.js';
|
|
11
9
|
import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
|
|
12
10
|
|
|
13
11
|
const script = defineComponent({
|
|
@@ -46,6 +44,10 @@ const script = defineComponent({
|
|
|
46
44
|
function isTimeDisabled(time) {
|
|
47
45
|
const checkDate = new Date(time);
|
|
48
46
|
const currentDate = new Date();
|
|
47
|
+
const checkDateDuplicate = new Date(checkDate);
|
|
48
|
+
checkDateDuplicate.setHours(0);
|
|
49
|
+
checkDateDuplicate.setMinutes(0);
|
|
50
|
+
checkDateDuplicate.setSeconds(0);
|
|
49
51
|
return {
|
|
50
52
|
isHourDisabled,
|
|
51
53
|
isMinuteDisabled
|
|
@@ -59,10 +61,17 @@ const script = defineComponent({
|
|
|
59
61
|
function currentMinute() {
|
|
60
62
|
return currentDate.getMinutes();
|
|
61
63
|
}
|
|
64
|
+
function isOverDate() {
|
|
65
|
+
return checkDateDuplicate > currentDate;
|
|
66
|
+
}
|
|
62
67
|
function isHourDisabled(hour) {
|
|
68
|
+
if (isOverDate())
|
|
69
|
+
return false;
|
|
63
70
|
return minCurrentDate() && hour < currentHour() || maxCurrentDate() && hour > currentHour();
|
|
64
71
|
}
|
|
65
72
|
function isMinuteDisabled(minute) {
|
|
73
|
+
if (isOverDate())
|
|
74
|
+
return false;
|
|
66
75
|
if (checkHour() === currentHour()) {
|
|
67
76
|
return minCurrentDate() && minute < currentMinute() || maxCurrentDate() && minute > currentMinute();
|
|
68
77
|
}
|
|
@@ -4,10 +4,7 @@ import { useField, connect, mapProps } from '@formily/vue';
|
|
|
4
4
|
import { NFormItem } from 'naive-ui';
|
|
5
5
|
import Annotation from '../../../../annotation-edit/index2.js';
|
|
6
6
|
import { InjectionAnnotation, InjectionFormUUID } from '../../constants/index2.js';
|
|
7
|
-
import '
|
|
8
|
-
import '@vue/shared';
|
|
9
|
-
import 'lodash-es';
|
|
10
|
-
import 'date-fns';
|
|
7
|
+
import '../../utils/index.js';
|
|
11
8
|
import { dotEscape } from '../../utils/schema2.js';
|
|
12
9
|
|
|
13
10
|
const script = defineComponent({
|
|
@@ -2,9 +2,7 @@ import { defineComponent, computed, createVNode } from 'vue';
|
|
|
2
2
|
import { connect, mapProps } from '@formily/vue';
|
|
3
3
|
import { isNumber } from 'lodash-es';
|
|
4
4
|
import { NRadioGroup, NSpace, NRadio } from 'naive-ui';
|
|
5
|
-
import '
|
|
6
|
-
import '@vue/shared';
|
|
7
|
-
import 'date-fns';
|
|
5
|
+
import '../../utils/index.js';
|
|
8
6
|
import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
|
|
9
7
|
|
|
10
8
|
const script = defineComponent({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, inject,
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, computed, ref, inject, watch, createVNode } from 'vue';
|
|
2
|
+
import { useDebounceFn } from '@vueuse/core';
|
|
3
|
+
import { isString, cloneDeep, isEqual } from 'lodash-es';
|
|
3
4
|
import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
|
|
4
5
|
import { InjectAsyncQueue, InjectionChangeContextCollector } from '../../constants/index2.js';
|
|
5
|
-
import '@vueuse/core';
|
|
6
6
|
import '../../../index2.js';
|
|
7
|
-
import { formRenderLog } from '../../utils/index.js';
|
|
7
|
+
import { formRenderLog, optionMatcher } from '../../utils/index.js';
|
|
8
8
|
import { useFormRequest } from '../../hooks/useFormRequest2.js';
|
|
9
9
|
import { useFormField } from '../../hooks/useFormField2.js';
|
|
10
10
|
import '../../../../../shared/utils/tapable/SyncHook.js';
|
|
@@ -91,7 +91,7 @@ const script = defineComponent({
|
|
|
91
91
|
const {
|
|
92
92
|
getSearchRequestInfo
|
|
93
93
|
} = useFormRequest();
|
|
94
|
-
async function
|
|
94
|
+
const fetchData = useDebounceFn(async function(content) {
|
|
95
95
|
lastSearch.value = content || "";
|
|
96
96
|
if (remoteOptions.value)
|
|
97
97
|
return;
|
|
@@ -115,23 +115,17 @@ const script = defineComponent({
|
|
|
115
115
|
key: key2
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
}
|
|
118
|
+
}, 300);
|
|
119
119
|
const parsedOptions = computed(() => {
|
|
120
|
-
return remoteOptions.value ?
|
|
121
|
-
function filterOption(options, searchContent) {
|
|
122
|
-
return options.filter((option) => {
|
|
123
|
-
return !searchContent || String(option[labelKey.value]).includes(searchContent);
|
|
124
|
-
});
|
|
125
|
-
}
|
|
120
|
+
return remoteOptions.value ? optionMatcher(remoteOptions.value, lastSearch.value, labelKey.value) : [];
|
|
126
121
|
});
|
|
127
122
|
const changeContextCollector = inject(InjectionChangeContextCollector);
|
|
128
|
-
changeContextCollector.setContext(fieldKey.value,
|
|
129
|
-
await nextTick();
|
|
123
|
+
changeContextCollector.setContext(fieldKey.value, (v) => {
|
|
130
124
|
return {
|
|
131
|
-
currentOption: cloneDeep(getCurrentOption())
|
|
125
|
+
currentOption: cloneDeep(getCurrentOption(v))
|
|
132
126
|
};
|
|
133
|
-
function getCurrentOption() {
|
|
134
|
-
return parsedOptions.value.find((option) => option[valueKey.value] ===
|
|
127
|
+
function getCurrentOption(v2) {
|
|
128
|
+
return parsedOptions.value.find((option) => option[valueKey.value] === v2);
|
|
135
129
|
}
|
|
136
130
|
});
|
|
137
131
|
watch(() => props.wordbook, (wordbook, oldWordbook) => {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent, computed, ref, inject,
|
|
1
|
+
import { defineComponent, computed, ref, inject, watch, createVNode } from 'vue';
|
|
2
2
|
import { isField } from '@formily/core';
|
|
3
|
-
import {
|
|
3
|
+
import { useDebounceFn } from '@vueuse/core';
|
|
4
|
+
import { isString, cloneDeep, isEqual } from 'lodash-es';
|
|
4
5
|
import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
|
|
5
6
|
import { InjectAsyncQueue, InjectionChangeContextCollector, InjectionFormItemDepsCollector } from '../../constants/index2.js';
|
|
6
|
-
import '@vueuse/core';
|
|
7
7
|
import '../../../index2.js';
|
|
8
|
-
import { formRenderLog } from '../../utils/index.js';
|
|
8
|
+
import { formRenderLog, optionMatcher } from '../../utils/index.js';
|
|
9
9
|
import { useFormField } from '../../hooks/useFormField2.js';
|
|
10
10
|
import '../../../../../shared/utils/tapable/SyncHook.js';
|
|
11
11
|
import '../../../../../shared/utils/tapable/SyncBailHook.js';
|
|
@@ -38,7 +38,7 @@ import './complex.js';
|
|
|
38
38
|
import './simpleComponent.js';
|
|
39
39
|
import './search.js';
|
|
40
40
|
import { NSelect } from 'naive-ui';
|
|
41
|
-
import { focusDecorator, assignUpdateValue
|
|
41
|
+
import { traverseDependKey, focusDecorator, assignUpdateValue } from '../../utils/schema2.js';
|
|
42
42
|
|
|
43
43
|
const script = defineComponent({
|
|
44
44
|
name: "FormSelect",
|
|
@@ -86,7 +86,7 @@ const script = defineComponent({
|
|
|
86
86
|
fieldKey
|
|
87
87
|
} = useFormField();
|
|
88
88
|
const asyncQueue = inject(InjectAsyncQueue);
|
|
89
|
-
async function
|
|
89
|
+
const fetchData = useDebounceFn(async function(content) {
|
|
90
90
|
lastSearch.value = content || "";
|
|
91
91
|
if (!configFor(props)) {
|
|
92
92
|
return remoteOptions.value = null;
|
|
@@ -122,27 +122,21 @@ const script = defineComponent({
|
|
|
122
122
|
function configFor(target) {
|
|
123
123
|
return target.urlConfig;
|
|
124
124
|
}
|
|
125
|
-
}
|
|
125
|
+
}, 300);
|
|
126
126
|
const parsedOptions = computed(() => {
|
|
127
127
|
if (remoteOptions.value)
|
|
128
|
-
return
|
|
128
|
+
return optionMatcher(remoteOptions.value, lastSearch.value, labelKey.value);
|
|
129
129
|
if (!Array.isArray(props.options))
|
|
130
130
|
return [];
|
|
131
|
-
return
|
|
132
|
-
function filterOption(options, searchContent) {
|
|
133
|
-
return options.filter((option) => {
|
|
134
|
-
return !searchContent || String(option[labelKey.value]).includes(searchContent);
|
|
135
|
-
});
|
|
136
|
-
}
|
|
131
|
+
return optionMatcher(props.options, lastSearch.value, labelKey.value);
|
|
137
132
|
});
|
|
138
133
|
const changeContextCollector = inject(InjectionChangeContextCollector);
|
|
139
|
-
changeContextCollector.setContext(fieldKey.value,
|
|
140
|
-
await nextTick();
|
|
134
|
+
changeContextCollector.setContext(fieldKey.value, (v) => {
|
|
141
135
|
return {
|
|
142
|
-
currentOption: cloneDeep(getCurrentOption())
|
|
136
|
+
currentOption: cloneDeep(getCurrentOption(v))
|
|
143
137
|
};
|
|
144
|
-
function getCurrentOption() {
|
|
145
|
-
return parsedOptions.value.find((option) => option[valueKey.value] ===
|
|
138
|
+
function getCurrentOption(v2) {
|
|
139
|
+
return parsedOptions.value.find((option) => option[valueKey.value] === v2);
|
|
146
140
|
}
|
|
147
141
|
});
|
|
148
142
|
const formItemDepsCollector = inject(InjectionFormItemDepsCollector);
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { defineComponent, computed, createVNode, createTextVNode } from 'vue';
|
|
2
2
|
import { NSwitch } from 'naive-ui';
|
|
3
|
-
import '
|
|
4
|
-
import '@vue/shared';
|
|
5
|
-
import 'lodash-es';
|
|
6
|
-
import 'date-fns';
|
|
7
|
-
import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
|
|
3
|
+
import '../../utils/index.js';
|
|
8
4
|
import { connect, mapProps } from '@formily/vue';
|
|
5
|
+
import { assignUpdateValue, assignValueBindKey } from '../../utils/schema2.js';
|
|
9
6
|
|
|
10
7
|
const script = defineComponent({
|
|
11
8
|
name: "FormSwitch",
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { defineComponent, computed, createVNode } from 'vue';
|
|
2
2
|
import { useCommonInjection } from '../../hooks/useCommonInjection2.js';
|
|
3
|
-
import '
|
|
4
|
-
import '@vue/shared';
|
|
5
|
-
import 'lodash-es';
|
|
6
|
-
import 'date-fns';
|
|
7
|
-
import { assignUpdateValue } from '../../utils/schema2.js';
|
|
3
|
+
import '../../utils/index.js';
|
|
8
4
|
import { connect, mapProps } from '@formily/vue';
|
|
9
5
|
import { NInput } from 'naive-ui';
|
|
6
|
+
import { assignUpdateValue } from '../../utils/schema2.js';
|
|
10
7
|
|
|
11
8
|
const script = defineComponent({
|
|
12
9
|
name: "FormTextarea",
|
|
@@ -3,9 +3,7 @@ import { useDebounceFn } from '@vueuse/core';
|
|
|
3
3
|
import { isNumber } from 'lodash-es';
|
|
4
4
|
import { ref, computed, watch, nextTick } from 'vue';
|
|
5
5
|
import { FormItemLineBarDepKeyPrepend } from '../constants/index2.js';
|
|
6
|
-
import '
|
|
7
|
-
import '@vue/shared';
|
|
8
|
-
import 'date-fns';
|
|
6
|
+
import '../utils/index.js';
|
|
9
7
|
import { createLinebarId, traverseSchema } from '../utils/schema2.js';
|
|
10
8
|
|
|
11
9
|
function useAnchor(props, scrollbarRef, collector) {
|
|
@@ -2,9 +2,7 @@ import { isField } from '@formily/core';
|
|
|
2
2
|
import { isString } from '@vueuse/core';
|
|
3
3
|
import { isFunction, isNumber } from 'lodash-es';
|
|
4
4
|
import { FIELD_BUSINESS_TYPE } from '../constants/index2.js';
|
|
5
|
-
import '
|
|
6
|
-
import '@formily/path';
|
|
7
|
-
import '@vue/shared';
|
|
5
|
+
import '../utils/index.js';
|
|
8
6
|
import { isIdCard, parseIdCard, parseAge2FromContext, parseBirthday, parseAge2Birthday } from '../utils/business2.js';
|
|
9
7
|
|
|
10
8
|
class BusinessCollector {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { FormChangeContext } from '../types';
|
|
2
2
|
export declare class ContextCollector {
|
|
3
3
|
private readonly contextMap;
|
|
4
|
-
setContext(key: string, value: () =>
|
|
5
|
-
getContext(key: string): Partial<{
|
|
4
|
+
setContext(key: string, value: (value: unknown) => FormChangeContext): void;
|
|
5
|
+
getContext(key: string, value: unknown): Partial<{
|
|
6
6
|
currentOption: import("../../../../shared/types").AnyObject;
|
|
7
|
-
}> |
|
|
8
|
-
currentOption: import("../../../../shared/types").AnyObject;
|
|
9
|
-
}>> | undefined;
|
|
7
|
+
}> | undefined;
|
|
10
8
|
}
|
|
11
9
|
export declare function useChangeContext(): {
|
|
12
10
|
create: () => ContextCollector;
|
|
@@ -5,9 +5,9 @@ class ContextCollector {
|
|
|
5
5
|
setContext(key, value) {
|
|
6
6
|
this.contextMap.set(key, value);
|
|
7
7
|
}
|
|
8
|
-
getContext(key) {
|
|
8
|
+
getContext(key, value) {
|
|
9
9
|
var _a;
|
|
10
|
-
return (_a = this.contextMap.get(key)) == null ? void 0 : _a();
|
|
10
|
+
return (_a = this.contextMap.get(key)) == null ? void 0 : _a(value);
|
|
11
11
|
}
|
|
12
12
|
}
|
|
13
13
|
function useChangeContext() {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import { isString } from 'lodash-es';
|
|
2
|
-
import '
|
|
3
|
-
import '@formily/path';
|
|
4
|
-
import '@vue/shared';
|
|
2
|
+
import '../utils/index.js';
|
|
5
3
|
import { isIdCard, isMobile } from '../utils/business2.js';
|
|
6
|
-
import '@formily/core';
|
|
7
4
|
|
|
8
5
|
function usePresetScope() {
|
|
9
6
|
return {
|