cnhis-design-vue 3.1.40-beta.1 → 3.1.40-beta.11
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 +12 -48
- package/es/components/form-config/index.d.ts +66 -148
- package/es/components/form-config/src/FormConfig.vue.d.ts +66 -148
- package/es/components/form-config/src/components/FormConfigCreator.vue.d.ts +33 -74
- package/es/components/form-config/src/components/FormConfigEdit.vue.d.ts +33 -74
- package/es/components/form-render/index.d.ts +33 -74
- package/es/components/form-render/src/FormRender.vue.d.ts +33 -74
- package/es/components/form-render/src/FormRender.vue.js +36 -20
- package/es/components/form-render/src/FormRenderWrapper.vue.d.ts +33 -74
- package/es/components/form-render/src/components/renderer/formItem.js +8 -2
- package/es/components/form-render/src/components/renderer/searchCascade.js +1 -0
- package/es/components/form-render/src/components/renderer/select.js +1 -0
- package/es/components/form-render/src/hooks/useAnchor.d.ts +6 -3
- package/es/components/form-render/src/hooks/useAnchor.js +26 -26
- package/es/components/form-render/src/hooks/useAutoHidden.d.ts +4 -0
- package/es/components/form-render/src/hooks/useAutoHidden.js +43 -0
- package/es/components/form-render/src/hooks/useBusinessBinding.d.ts +7 -10
- package/es/components/form-render/src/hooks/useBusinessBinding.js +38 -36
- package/es/components/form-render/src/hooks/useFieldListAdaptor.js +10 -12
- package/es/components/form-render/src/hooks/useFormContext.d.ts +1 -2
- package/es/components/form-render/src/hooks/useFormContext.js +2 -2
- package/es/components/form-render/src/types/fieldItem.d.ts +1 -1
- package/es/components/iho-table/index.d.ts +121 -121
- package/es/components/iho-table/src/IhoTable.vue.d.ts +121 -121
- package/es/components/iho-table/src/constants/index.d.ts +2 -2
- package/es/components/iho-table/src/hooks/tapHooks/index.d.ts +59 -59
- package/es/components/iho-table/src/hooks/tapHooks/useEventHooks.d.ts +1 -1
- package/es/components/index.css +1 -1
- package/es/components/index.d.ts +3 -1
- package/es/components/index.js +6 -0
- package/es/components/info-header/index.d.ts +18 -3
- 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.vue.d.ts +18 -3
- package/es/components/info-header/src/InfoHeader.vue.js +33 -19
- package/es/components/keyboard/index.d.ts +20 -2
- package/es/components/keyboard/src/Keyboard.vue.d.ts +20 -2
- package/es/components/keyboard/src/components/InputNumber.vue.d.ts +19 -2
- package/es/components/keyboard/src/components/InputNumber.vue.js +15 -5
- package/es/components/keyboard/src/components/NumberPanel.vue.d.ts +20 -2
- package/es/components/keyboard/src/components/NumberPanel.vue.js +14 -10
- package/es/components/recommend-search/index.d.ts +14 -14
- package/es/components/recommend-search/src/RecommendSearch.vue.d.ts +14 -14
- package/es/components/recommend-search/src/components/BaseSearch.vue.d.ts +2 -2
- package/es/components/recommend-search/src/components/RecommendInput.vue.d.ts +4 -4
- package/es/components/recommend-search/src/components/RecommendSelect.vue.d.ts +4 -4
- package/es/components/scale-view/index.d.ts +4 -2
- package/es/components/scale-view/src/ScaleView.vue.d.ts +7 -2
- package/es/components/scale-view/src/ScaleView.vue.js +2 -1
- package/es/components/scale-view/src/components/formitem/standard-modal.d.ts +1 -1
- package/es/components/scale-view/src/components/formitem/text-over-tooltip/TextOverTooltip.vue.d.ts +1 -1
- package/es/components/shortcut-provider/index.d.ts +15 -1
- package/es/components/shortcut-provider/src/ShortcutProvider.vue.d.ts +15 -1
- package/es/components/shortcut-provider/src/ShortcutProvider.vue.js +7 -2
- package/es/components/shortcut-setter/index.d.ts +33 -74
- package/es/components/shortcut-setter/src/ShortcutSetter.vue.d.ts +33 -74
- package/es/components/steps-wheel/index.d.ts +1 -1
- package/es/components/steps-wheel/src/StepsWheel.vue.d.ts +1 -1
- package/es/components/table-filter/index.d.ts +8933 -0
- package/es/components/table-filter/index.js +21 -0
- package/es/components/table-filter/src/base-search-com/BaseSearch.vue.d.ts +3841 -0
- package/es/components/table-filter/src/base-search-com/BaseSearch.vue.js +2272 -0
- package/es/components/table-filter/src/classification/Classification-com.vue.d.ts +3198 -0
- package/es/components/table-filter/src/classification/Classification-com.vue.js +1315 -0
- package/es/components/table-filter/src/classification/search-class-name.vue.d.ts +71 -0
- package/es/components/table-filter/src/classification/search-class-name.vue.js +195 -0
- package/es/components/table-filter/src/classification/search-professional-model.vue.d.ts +1119 -0
- package/es/components/table-filter/src/classification/search-professional-model.vue.js +594 -0
- package/es/components/table-filter/src/components/age-com/index.vue.d.ts +119 -0
- package/es/components/table-filter/src/components/age-com/index.vue.js +185 -0
- package/es/components/table-filter/src/components/button-group/ButtonGroup.vue.d.ts +199 -0
- package/es/components/table-filter/src/components/button-group/ButtonGroup.vue.js +86 -0
- package/es/components/table-filter/src/components/button-icon/getBtnIcon.d.ts +2 -0
- package/es/components/table-filter/src/components/button-icon/getBtnIcon.js +30 -0
- package/es/components/table-filter/src/components/c-tree-select/tree-select.vue.d.ts +90 -0
- package/es/components/table-filter/src/components/c-tree-select/tree-select.vue.js +253 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.d.ts +112 -0
- package/es/components/table-filter/src/components/classify-filter/ValueCfg.vue.js +114 -0
- package/es/components/table-filter/src/components/classify-filter/helpers/options.d.ts +4 -0
- package/es/components/table-filter/src/components/classify-filter/helpers/options.js +14 -0
- package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.d.ts +20 -0
- package/es/components/table-filter/src/components/classify-filter/hooks/useDisplayCategory.js +87 -0
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.d.ts +59 -0
- package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js +147 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.d.ts +278 -0
- package/es/components/table-filter/src/components/classify-filter/index.vue.js +304 -0
- package/es/components/table-filter/src/components/multi-select/multi-select.vue.d.ts +113 -0
- package/es/components/table-filter/src/components/multi-select/multi-select.vue.js +153 -0
- package/es/components/table-filter/src/components/out-quick-search/out-quick-search.vue.d.ts +266 -0
- package/es/components/table-filter/src/components/out-quick-search/out-quick-search.vue.js +310 -0
- package/es/components/table-filter/src/components/range-age/index.vue.d.ts +248 -0
- package/es/components/table-filter/src/components/range-age/index.vue.js +137 -0
- package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.d.ts +104 -0
- package/es/components/table-filter/src/components/render-widget/components/CheckboxGroup.vue.js +64 -0
- package/es/components/table-filter/src/components/render-widget/components/Select.vue.d.ts +34 -0
- package/es/components/table-filter/src/components/render-widget/components/Select.vue.js +45 -0
- package/es/components/table-filter/src/components/render-widget/components/index.d.ts +3 -0
- package/es/components/table-filter/src/components/render-widget/components/index.js +2 -0
- package/es/components/table-filter/src/components/render-widget/enums.d.ts +25 -0
- package/es/components/table-filter/src/components/render-widget/enums.js +27 -0
- package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.d.ts +1 -0
- package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js +70 -0
- package/es/components/table-filter/src/components/render-widget/index.vue.d.ts +32 -0
- package/es/components/table-filter/src/components/render-widget/index.vue.js +107 -0
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.d.ts +199 -0
- package/es/components/table-filter/src/components/render-widget/widgetCfgMaps.js +152 -0
- package/es/components/table-filter/src/components/search-condition/SearchCondition.vue.d.ts +789 -0
- package/es/components/table-filter/src/components/search-condition/SearchCondition.vue.js +1520 -0
- package/es/components/table-filter/src/components/search-condition/fieldTypeList.d.ts +18 -0
- package/es/components/table-filter/src/components/search-condition/fieldTypeList.js +171 -0
- package/es/components/table-filter/src/components/search-filter/SearchFilter.vue.d.ts +1217 -0
- package/es/components/table-filter/src/components/search-filter/SearchFilter.vue.js +199 -0
- package/es/components/table-filter/src/components/search-modal/set-classification.vue.d.ts +1624 -0
- package/es/components/table-filter/src/components/search-modal/set-classification.vue.js +241 -0
- package/es/components/table-filter/src/components/table-modal/TableModal.vue.d.ts +292 -0
- package/es/components/table-filter/src/components/table-modal/TableModal.vue.js +526 -0
- package/es/components/table-filter/src/const/dataOptions.d.ts +36 -0
- package/es/components/table-filter/src/const/dataOptions.js +107 -0
- package/es/components/table-filter/src/const/index.d.ts +5 -0
- package/es/components/table-filter/src/const/index.js +5 -0
- package/es/components/table-filter/src/directive/flexibleResize.d.ts +28 -0
- package/es/components/table-filter/src/directive/flexibleResize.js +157 -0
- package/es/components/table-filter/src/directive/preventReClick.d.ts +4 -0
- package/es/components/table-filter/src/directive/preventReClick.js +14 -0
- package/es/components/table-filter/src/directive/resize.d.ts +4 -0
- package/es/components/table-filter/src/directive/resize.js +12 -0
- package/es/components/table-filter/src/hooks/export.d.ts +1 -0
- package/es/components/table-filter/src/hooks/export.js +1 -0
- package/es/components/table-filter/src/hooks/useAdvanced.d.ts +28 -0
- package/es/components/table-filter/src/hooks/useAdvanced.js +64 -0
- package/es/components/table-filter/src/hooks/useMixins.d.ts +60 -0
- package/es/components/table-filter/src/hooks/useMixins.js +532 -0
- package/es/components/table-filter/src/hooks/useRenderWidget.d.ts +15 -0
- package/es/components/table-filter/src/hooks/useRenderWidget.js +94 -0
- package/es/components/table-filter/src/hooks/useTableSearchCon.d.ts +8 -0
- package/es/components/table-filter/src/hooks/useTableSearchCon.js +131 -0
- package/es/components/table-filter/src/hooks/useWordBookutils.d.ts +12 -0
- package/es/components/table-filter/src/hooks/useWordBookutils.js +91 -0
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.d.ts +1942 -0
- package/es/components/table-filter/src/quick-search/QuickSearch.vue.js +2038 -0
- package/es/components/table-filter/src/tool/generateDefOptions.d.ts +14 -0
- package/es/components/table-filter/src/tool/generateDefOptions.js +65 -0
- package/es/components/table-filter/src/tool/getWidgetType.d.ts +1 -0
- package/es/components/table-filter/src/tool/getWidgetType.js +27 -0
- package/es/components/table-filter/src/tool/options.d.ts +18 -0
- package/es/components/table-filter/src/tool/options.js +200 -0
- package/es/components/table-filter/src/tool/resizeSensor.d.ts +16 -0
- package/es/components/table-filter/src/tool/resizeSensor.js +123 -0
- package/es/components/table-filter/src/tool/time-domain.d.ts +39 -0
- package/es/components/table-filter/src/tool/time-domain.js +100 -0
- package/es/components/table-filter/src/tool/transformData.d.ts +92 -0
- package/es/components/table-filter/src/tool/transformData.js +169 -0
- package/es/components/table-filter/src/tool/utils.d.ts +4 -0
- package/es/components/table-filter/src/tool/utils.js +29 -0
- package/es/components/table-filter/src/types/enums.d.ts +65 -0
- package/es/components/table-filter/src/types/enums.js +67 -0
- package/es/components/table-filter/src/types/index.d.ts +483 -0
- package/es/components/table-filter/src/types/index.js +1 -0
- package/es/components/table-filter/src/types/tool.d.ts +7 -0
- package/es/components/table-filter/src/types/tool.js +1 -0
- package/es/components/table-filter/style/index.css +1 -0
- package/es/shared/assets/img/failure.js +1 -1
- package/es/shared/assets/img/failure.png.js +1 -1
- package/es/shared/assets/img/icon-asc.js +1 -1
- package/es/shared/assets/img/icon-desc.js +1 -1
- package/es/shared/assets/img/no-permission.js +1 -1
- package/es/shared/assets/img/no-permission.png.js +1 -1
- package/es/shared/assets/img/nodata.js +1 -1
- package/es/shared/assets/img/nodata.png.js +1 -1
- package/es/shared/assets/img/notfound.js +1 -1
- package/es/shared/assets/img/notfound.png.js +1 -1
- package/es/shared/assets/img/qr.js +1 -1
- package/es/shared/assets/img/qr.png.js +1 -1
- package/es/shared/assets/img/success.js +1 -1
- package/es/shared/assets/img/success.png.js +1 -1
- package/es/shared/assets/img/video.js +1 -1
- package/es/shared/assets/img/video.png.js +1 -1
- package/es/shared/assets/img/video_default_cover.js +1 -1
- package/es/shared/assets/img/video_default_cover.png.js +1 -1
- package/es/shared/assets/img/video_hover.js +1 -1
- package/es/shared/assets/img/video_play_hover.js +1 -1
- package/es/shared/assets/img/xb_big.js +1 -1
- package/es/shared/assets/img/xb_big.png.js +1 -1
- package/es/shared/assets/img/xb_small.js +1 -1
- package/es/shared/assets/img/xb_small.png.js +1 -1
- package/es/shared/components/TextOverTooltip/TextOverTooltip.vue.d.ts +1 -1
- package/es/shared/utils/utilExpand.js +66 -0
- package/package.json +3 -3
package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const presetValToTimestamp: (presetVal: string, format?: string) => any;
|
package/es/components/table-filter/src/components/render-widget/helpers/presetValToTimestamp.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { DatePresetValEnums } from '../enums.js';
|
|
2
|
+
import moment from 'moment';
|
|
3
|
+
|
|
4
|
+
const Maps = /* @__PURE__ */ new Map([
|
|
5
|
+
[
|
|
6
|
+
DatePresetValEnums.NOW,
|
|
7
|
+
() => moment()
|
|
8
|
+
],
|
|
9
|
+
[
|
|
10
|
+
DatePresetValEnums.TODAY,
|
|
11
|
+
() => moment().startOf("day")
|
|
12
|
+
],
|
|
13
|
+
[
|
|
14
|
+
DatePresetValEnums.TODAY_START,
|
|
15
|
+
() => moment().startOf("day")
|
|
16
|
+
],
|
|
17
|
+
[
|
|
18
|
+
DatePresetValEnums.TODAY_END,
|
|
19
|
+
() => moment().endOf("day")
|
|
20
|
+
],
|
|
21
|
+
[
|
|
22
|
+
DatePresetValEnums.TOMORROW,
|
|
23
|
+
() => moment().add(1, "days").startOf("day")
|
|
24
|
+
],
|
|
25
|
+
[
|
|
26
|
+
DatePresetValEnums.TOMORROW_START,
|
|
27
|
+
() => moment().add(1, "days").startOf("day")
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
DatePresetValEnums.TOMORROW_END,
|
|
31
|
+
() => moment().add(1, "days").endOf("day")
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
DatePresetValEnums.YESTERDAY,
|
|
35
|
+
() => moment().subtract(1, "days").startOf("day")
|
|
36
|
+
],
|
|
37
|
+
[
|
|
38
|
+
DatePresetValEnums.YESTERDAY_START,
|
|
39
|
+
() => moment().subtract(1, "days").startOf("day")
|
|
40
|
+
],
|
|
41
|
+
[
|
|
42
|
+
DatePresetValEnums.YESTERDAY_END,
|
|
43
|
+
() => moment().subtract(1, "days").endOf("day")
|
|
44
|
+
],
|
|
45
|
+
[
|
|
46
|
+
DatePresetValEnums.WEEK_START,
|
|
47
|
+
() => moment().startOf("week")
|
|
48
|
+
],
|
|
49
|
+
[
|
|
50
|
+
DatePresetValEnums.WEEK_END,
|
|
51
|
+
() => moment().endOf("week")
|
|
52
|
+
],
|
|
53
|
+
[
|
|
54
|
+
DatePresetValEnums.MONTH_START,
|
|
55
|
+
() => moment().startOf("month")
|
|
56
|
+
],
|
|
57
|
+
[
|
|
58
|
+
DatePresetValEnums.MONTH_END,
|
|
59
|
+
() => moment().endOf("month")
|
|
60
|
+
]
|
|
61
|
+
]);
|
|
62
|
+
const presetValToTimestamp = (presetVal, format = "x") => {
|
|
63
|
+
if (!Maps.has(presetVal))
|
|
64
|
+
return;
|
|
65
|
+
const fun = Maps.get(presetVal);
|
|
66
|
+
const val = fun().format(format);
|
|
67
|
+
return format === "x" || format === "X" ? Number(val) : val;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export { presetValToTimestamp };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
declare const _default: import("vue").DefineComponent<{
|
|
2
|
+
cfg: {
|
|
3
|
+
type: ObjectConstructor;
|
|
4
|
+
required: true;
|
|
5
|
+
};
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
8
|
+
};
|
|
9
|
+
}, any, {
|
|
10
|
+
initialProps: {};
|
|
11
|
+
}, {
|
|
12
|
+
valueCp(): any;
|
|
13
|
+
}, {
|
|
14
|
+
search(): void;
|
|
15
|
+
getEleWidth(cfg: any): string | undefined;
|
|
16
|
+
initComponentProps(cfg: any): void;
|
|
17
|
+
generateWidget(cfg: any): import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
18
|
+
[key: string]: any;
|
|
19
|
+
}> | null;
|
|
20
|
+
handleUpdate(val: any, widgetType: any, defValueUnit: any): void;
|
|
21
|
+
}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:modelValue"[], "update:modelValue", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
22
|
+
cfg: {
|
|
23
|
+
type: ObjectConstructor;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
modelValue: {
|
|
27
|
+
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
28
|
+
};
|
|
29
|
+
}>> & {
|
|
30
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
31
|
+
}, {}>;
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { defineComponent, h } from 'vue';
|
|
2
|
+
import { WidgetTypeEnums } from './enums.js';
|
|
3
|
+
import { WidgetCfgMaps, formatItemData } from './widgetCfgMaps.js';
|
|
4
|
+
import moment from 'moment';
|
|
5
|
+
import _export_sfc from '../../../../../_virtual/plugin-vue_export-helper.js';
|
|
6
|
+
|
|
7
|
+
const UseSelfWidth = [WidgetTypeEnums.DATE, WidgetTypeEnums.DATE_TIME, WidgetTypeEnums.CHECKBOX_GROUP];
|
|
8
|
+
const _sfc_main = defineComponent({
|
|
9
|
+
props: {
|
|
10
|
+
cfg: {
|
|
11
|
+
type: Object,
|
|
12
|
+
required: true
|
|
13
|
+
},
|
|
14
|
+
modelValue: {
|
|
15
|
+
type: [Array, String, Number]
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
emits: ["update:modelValue"],
|
|
19
|
+
computed: {
|
|
20
|
+
valueCp() {
|
|
21
|
+
const { widgetType } = this.cfg;
|
|
22
|
+
const GATHER = [WidgetTypeEnums.DATE, WidgetTypeEnums.DATE_TIME];
|
|
23
|
+
if (GATHER.includes(widgetType)) {
|
|
24
|
+
return moment(this.cfg.value).valueOf();
|
|
25
|
+
}
|
|
26
|
+
return this.cfg.value;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
data() {
|
|
30
|
+
return {
|
|
31
|
+
initialProps: {}
|
|
32
|
+
};
|
|
33
|
+
},
|
|
34
|
+
methods: {
|
|
35
|
+
search() {
|
|
36
|
+
this.$emit("outFilterChange");
|
|
37
|
+
},
|
|
38
|
+
getEleWidth(cfg) {
|
|
39
|
+
const { widgetType } = cfg;
|
|
40
|
+
if (UseSelfWidth.includes(widgetType))
|
|
41
|
+
return;
|
|
42
|
+
return `${cfg.advanceColWidth || 200}px`;
|
|
43
|
+
},
|
|
44
|
+
initComponentProps(cfg) {
|
|
45
|
+
const { widgetType, alias, title, placeholder: customPlaceholder, widgetCfg } = cfg;
|
|
46
|
+
const { props, handlerProps } = WidgetCfgMaps.get(widgetType);
|
|
47
|
+
let Props = { ...props };
|
|
48
|
+
if (handlerProps) {
|
|
49
|
+
Props = handlerProps(Props, { ...widgetCfg, title: alias || title });
|
|
50
|
+
}
|
|
51
|
+
if (customPlaceholder) {
|
|
52
|
+
Props.placeholder = customPlaceholder;
|
|
53
|
+
}
|
|
54
|
+
this.initialProps = Props;
|
|
55
|
+
if (Props.value) {
|
|
56
|
+
this.valueCp = Props.value;
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
generateWidget(cfg) {
|
|
60
|
+
const { widgetType } = cfg;
|
|
61
|
+
const { defValueUnit } = cfg.widgetCfg || {};
|
|
62
|
+
if (!WidgetCfgMaps.has(widgetType)) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
const { value } = cfg;
|
|
66
|
+
const { component, style, eventsBySearch = [] } = WidgetCfgMaps.get(widgetType);
|
|
67
|
+
const props = { ...this.initialProps, value };
|
|
68
|
+
const EventsBySearch = eventsBySearch.reduce((evts, item) => {
|
|
69
|
+
const { name, handler } = item;
|
|
70
|
+
let eventHandler = this.search;
|
|
71
|
+
if (handler) {
|
|
72
|
+
eventHandler = (e) => {
|
|
73
|
+
handler(e, this.search, props);
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
return {
|
|
77
|
+
...evts,
|
|
78
|
+
[`on${name}`]: eventHandler
|
|
79
|
+
};
|
|
80
|
+
}, {});
|
|
81
|
+
return h(
|
|
82
|
+
component,
|
|
83
|
+
{
|
|
84
|
+
...style,
|
|
85
|
+
...props,
|
|
86
|
+
style: { width: this.getEleWidth(cfg) },
|
|
87
|
+
value: this.valueCp,
|
|
88
|
+
"onUpdate:value": (val) => this.handleUpdate(val, widgetType, defValueUnit),
|
|
89
|
+
...EventsBySearch
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
},
|
|
93
|
+
handleUpdate(val, widgetType, defValueUnit) {
|
|
94
|
+
const result = formatItemData(val, widgetType);
|
|
95
|
+
this.$emit("update:modelValue", result);
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
created() {
|
|
99
|
+
this.initComponentProps(this.cfg);
|
|
100
|
+
},
|
|
101
|
+
render() {
|
|
102
|
+
return this.generateWidget(this.cfg);
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
var RenderWidget = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "index.vue"]]);
|
|
106
|
+
|
|
107
|
+
export { RenderWidget as default };
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { funcVoid } from '../../../../../../es/components/table-filter/src/types';
|
|
2
|
+
export declare const WidgetCfgMaps: Map<string, {
|
|
3
|
+
component: any;
|
|
4
|
+
props: {
|
|
5
|
+
clearable: boolean;
|
|
6
|
+
options?: undefined;
|
|
7
|
+
filterable?: undefined;
|
|
8
|
+
multiple?: undefined;
|
|
9
|
+
type?: undefined;
|
|
10
|
+
valueFormat?: undefined;
|
|
11
|
+
};
|
|
12
|
+
eventsBySearch: {
|
|
13
|
+
name: string;
|
|
14
|
+
handler(e: KeyboardEvent, search: funcVoid): void;
|
|
15
|
+
}[];
|
|
16
|
+
handlerProps(props: any, { title }?: any): any;
|
|
17
|
+
setDefaultValue: (defaultValue: any) => any;
|
|
18
|
+
style?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
component: import("vue").DefineComponent<{
|
|
21
|
+
value: {
|
|
22
|
+
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
23
|
+
};
|
|
24
|
+
componentCfg: {
|
|
25
|
+
type: ObjectConstructor;
|
|
26
|
+
};
|
|
27
|
+
}, {
|
|
28
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
29
|
+
value: {
|
|
30
|
+
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
31
|
+
};
|
|
32
|
+
componentCfg: {
|
|
33
|
+
type: ObjectConstructor;
|
|
34
|
+
};
|
|
35
|
+
}>> & {
|
|
36
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
37
|
+
}>>;
|
|
38
|
+
emit: (event: "update:value", ...args: any[]) => void;
|
|
39
|
+
valueCp: import("vue").WritableComputedRef<any>;
|
|
40
|
+
maxTagCount: import("vue").ComputedRef<0 | 1 | undefined>;
|
|
41
|
+
maxTagPlaceholder: () => string | undefined;
|
|
42
|
+
NSelect: any;
|
|
43
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
44
|
+
value: {
|
|
45
|
+
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
46
|
+
};
|
|
47
|
+
componentCfg: {
|
|
48
|
+
type: ObjectConstructor;
|
|
49
|
+
};
|
|
50
|
+
}>> & {
|
|
51
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
52
|
+
}, {}>;
|
|
53
|
+
props: {
|
|
54
|
+
clearable: boolean;
|
|
55
|
+
options: never[];
|
|
56
|
+
filterable: boolean;
|
|
57
|
+
multiple: boolean;
|
|
58
|
+
type?: undefined;
|
|
59
|
+
valueFormat?: undefined;
|
|
60
|
+
};
|
|
61
|
+
eventsBySearch: {
|
|
62
|
+
name: string;
|
|
63
|
+
handler(e: KeyboardEvent, search: funcVoid, props: any): void;
|
|
64
|
+
}[];
|
|
65
|
+
handlerProps(props: any, { valueList, multiple, title }?: any): any;
|
|
66
|
+
setDefaultValue: (defaultValue: any) => any;
|
|
67
|
+
style?: undefined;
|
|
68
|
+
} | {
|
|
69
|
+
component: any;
|
|
70
|
+
props: {
|
|
71
|
+
type: string;
|
|
72
|
+
clearable: boolean;
|
|
73
|
+
valueFormat: string;
|
|
74
|
+
options?: undefined;
|
|
75
|
+
filterable?: undefined;
|
|
76
|
+
multiple?: undefined;
|
|
77
|
+
};
|
|
78
|
+
handlerProps(props: any, { title }?: any): any;
|
|
79
|
+
setDefaultValue(defaultValue: any, defValueUnit: any): any;
|
|
80
|
+
eventsBySearch?: undefined;
|
|
81
|
+
style?: undefined;
|
|
82
|
+
} | {
|
|
83
|
+
component: import("vue").DefineComponent<{
|
|
84
|
+
options: {
|
|
85
|
+
type: import("vue").PropType<import("../../../../../../es/components/table-filter/src/types").ICheckboxType[]>;
|
|
86
|
+
};
|
|
87
|
+
value: {
|
|
88
|
+
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
89
|
+
default: string[];
|
|
90
|
+
};
|
|
91
|
+
multiple: {
|
|
92
|
+
type: BooleanConstructor;
|
|
93
|
+
default: boolean;
|
|
94
|
+
};
|
|
95
|
+
}, {
|
|
96
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
97
|
+
options: {
|
|
98
|
+
type: import("vue").PropType<import("../../../../../../es/components/table-filter/src/types").ICheckboxType[]>;
|
|
99
|
+
};
|
|
100
|
+
value: {
|
|
101
|
+
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
102
|
+
default: string[];
|
|
103
|
+
};
|
|
104
|
+
multiple: {
|
|
105
|
+
type: BooleanConstructor;
|
|
106
|
+
default: boolean;
|
|
107
|
+
};
|
|
108
|
+
}>> & {
|
|
109
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
110
|
+
}>>;
|
|
111
|
+
emit: (event: "update:value", ...args: any[]) => void;
|
|
112
|
+
valueCp: import("vue").WritableComputedRef<any>;
|
|
113
|
+
filterNewVal: (val: any) => any;
|
|
114
|
+
onChange: (val: any) => void;
|
|
115
|
+
NCheckboxGroup: import("vue").DefineComponent<{
|
|
116
|
+
readonly min: NumberConstructor;
|
|
117
|
+
readonly max: NumberConstructor;
|
|
118
|
+
readonly size: import("vue").PropType<"small" | "medium" | "large">;
|
|
119
|
+
readonly value: import("vue").PropType<(string | number)[] | null>;
|
|
120
|
+
readonly defaultValue: {
|
|
121
|
+
readonly type: import("vue").PropType<(string | number)[] | null>;
|
|
122
|
+
readonly default: null;
|
|
123
|
+
};
|
|
124
|
+
readonly disabled: {
|
|
125
|
+
readonly type: import("vue").PropType<boolean | undefined>;
|
|
126
|
+
readonly default: undefined;
|
|
127
|
+
};
|
|
128
|
+
readonly 'onUpdate:value': import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[], meta: {
|
|
129
|
+
actionType: "check" | "uncheck";
|
|
130
|
+
value: string | number;
|
|
131
|
+
}) => void>>;
|
|
132
|
+
readonly onUpdateValue: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[], meta: {
|
|
133
|
+
actionType: "check" | "uncheck";
|
|
134
|
+
value: string | number;
|
|
135
|
+
}) => void>>;
|
|
136
|
+
readonly onChange: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[]) => void> | undefined>;
|
|
137
|
+
}, {
|
|
138
|
+
mergedClsPrefix: import("vue").ComputedRef<string>;
|
|
139
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
140
|
+
readonly min: NumberConstructor;
|
|
141
|
+
readonly max: NumberConstructor;
|
|
142
|
+
readonly size: import("vue").PropType<"small" | "medium" | "large">;
|
|
143
|
+
readonly value: import("vue").PropType<(string | number)[] | null>;
|
|
144
|
+
readonly defaultValue: {
|
|
145
|
+
readonly type: import("vue").PropType<(string | number)[] | null>;
|
|
146
|
+
readonly default: null;
|
|
147
|
+
};
|
|
148
|
+
readonly disabled: {
|
|
149
|
+
readonly type: import("vue").PropType<boolean | undefined>;
|
|
150
|
+
readonly default: undefined;
|
|
151
|
+
};
|
|
152
|
+
readonly 'onUpdate:value': import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[], meta: {
|
|
153
|
+
actionType: "check" | "uncheck";
|
|
154
|
+
value: string | number;
|
|
155
|
+
}) => void>>;
|
|
156
|
+
readonly onUpdateValue: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[], meta: {
|
|
157
|
+
actionType: "check" | "uncheck";
|
|
158
|
+
value: string | number;
|
|
159
|
+
}) => void>>;
|
|
160
|
+
readonly onChange: import("vue").PropType<import("naive-ui/es/_utils").MaybeArray<(value: (string | number)[]) => void> | undefined>;
|
|
161
|
+
}>>, {
|
|
162
|
+
readonly disabled: boolean | undefined;
|
|
163
|
+
readonly defaultValue: (string | number)[] | null;
|
|
164
|
+
}>;
|
|
165
|
+
NCheckbox: any;
|
|
166
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "update:value"[], "update:value", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
167
|
+
options: {
|
|
168
|
+
type: import("vue").PropType<import("../../../../../../es/components/table-filter/src/types").ICheckboxType[]>;
|
|
169
|
+
};
|
|
170
|
+
value: {
|
|
171
|
+
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
172
|
+
default: string[];
|
|
173
|
+
};
|
|
174
|
+
multiple: {
|
|
175
|
+
type: BooleanConstructor;
|
|
176
|
+
default: boolean;
|
|
177
|
+
};
|
|
178
|
+
}>> & {
|
|
179
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
180
|
+
}, {
|
|
181
|
+
value: string | number | unknown[];
|
|
182
|
+
multiple: boolean;
|
|
183
|
+
}>;
|
|
184
|
+
props: {
|
|
185
|
+
clearable?: undefined;
|
|
186
|
+
options?: undefined;
|
|
187
|
+
filterable?: undefined;
|
|
188
|
+
multiple?: undefined;
|
|
189
|
+
type?: undefined;
|
|
190
|
+
valueFormat?: undefined;
|
|
191
|
+
};
|
|
192
|
+
style: {
|
|
193
|
+
"line-height": string;
|
|
194
|
+
};
|
|
195
|
+
handlerProps(props: any, { valueList, multiple }?: any): any;
|
|
196
|
+
setDefaultValue: (defaultValue: any) => any;
|
|
197
|
+
eventsBySearch?: undefined;
|
|
198
|
+
}>;
|
|
199
|
+
export declare const formatItemData: (val: any, widgetType: string) => any;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { WidgetTypeEnums, DatePresetValEnums } from './enums.js';
|
|
2
|
+
import { NInputNumber, NInput, NDatePicker } from 'naive-ui';
|
|
3
|
+
import CheckboxGroup from './components/CheckboxGroup.vue.js';
|
|
4
|
+
import Select from './components/Select.vue.js';
|
|
5
|
+
import moment from 'moment';
|
|
6
|
+
import { presetValToTimestamp } from './helpers/presetValToTimestamp.js';
|
|
7
|
+
|
|
8
|
+
const SetDefVal = (defaultValue) => defaultValue;
|
|
9
|
+
const WidgetCfgMaps = /* @__PURE__ */ new Map([
|
|
10
|
+
[
|
|
11
|
+
WidgetTypeEnums.INPUT_NUMBER,
|
|
12
|
+
{
|
|
13
|
+
component: NInputNumber,
|
|
14
|
+
props: {
|
|
15
|
+
clearable: true
|
|
16
|
+
},
|
|
17
|
+
eventsBySearch: [{
|
|
18
|
+
name: "keydown",
|
|
19
|
+
handler(e, search) {
|
|
20
|
+
if (e.key === "Enter") {
|
|
21
|
+
console.log("\u70B9\u51FBkeyup>>>>>", search);
|
|
22
|
+
search();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}],
|
|
26
|
+
handlerProps(props, { title } = {}) {
|
|
27
|
+
const Props = { ...props, placeholder: `\u8F93\u5165${title}` };
|
|
28
|
+
return Props;
|
|
29
|
+
},
|
|
30
|
+
setDefaultValue: SetDefVal
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
[
|
|
34
|
+
WidgetTypeEnums.INPUT,
|
|
35
|
+
{
|
|
36
|
+
component: NInput,
|
|
37
|
+
props: {
|
|
38
|
+
clearable: true
|
|
39
|
+
},
|
|
40
|
+
eventsBySearch: [{
|
|
41
|
+
name: "keydown",
|
|
42
|
+
handler(e, search) {
|
|
43
|
+
if (e.key === "Enter") {
|
|
44
|
+
search();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}],
|
|
48
|
+
handlerProps(props, { title } = {}) {
|
|
49
|
+
const Props = { ...props, placeholder: `\u641C\u7D22${title}` };
|
|
50
|
+
return Props;
|
|
51
|
+
},
|
|
52
|
+
setDefaultValue: SetDefVal
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
[
|
|
56
|
+
WidgetTypeEnums.SELECT,
|
|
57
|
+
{
|
|
58
|
+
component: Select,
|
|
59
|
+
props: {
|
|
60
|
+
clearable: true,
|
|
61
|
+
options: [],
|
|
62
|
+
filterable: true,
|
|
63
|
+
multiple: false
|
|
64
|
+
},
|
|
65
|
+
eventsBySearch: [{
|
|
66
|
+
name: "change",
|
|
67
|
+
handler(e, search, props) {
|
|
68
|
+
const { multiple } = props;
|
|
69
|
+
if (multiple) {
|
|
70
|
+
search();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}],
|
|
74
|
+
handlerProps(props, { valueList, multiple, title } = {}) {
|
|
75
|
+
const Props = { ...props, placeholder: `\u8BF7\u9009\u62E9${title}` };
|
|
76
|
+
if (Array.isArray(valueList))
|
|
77
|
+
Props.options = valueList.map(({ value, label }) => ({ value, label }));
|
|
78
|
+
if (multiple)
|
|
79
|
+
Props.multiple = true;
|
|
80
|
+
return Props;
|
|
81
|
+
},
|
|
82
|
+
setDefaultValue: SetDefVal
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
[
|
|
86
|
+
WidgetTypeEnums.DATE,
|
|
87
|
+
{
|
|
88
|
+
component: NDatePicker,
|
|
89
|
+
props: {
|
|
90
|
+
type: "date",
|
|
91
|
+
clearable: true,
|
|
92
|
+
valueFormat: "yyyy-MM-dd"
|
|
93
|
+
},
|
|
94
|
+
handlerProps(props, { title } = {}) {
|
|
95
|
+
const Props = { ...props, placeholder: `\u8BF7\u9009\u62E9${title}` };
|
|
96
|
+
return Props;
|
|
97
|
+
},
|
|
98
|
+
setDefaultValue(defaultValue, defValueUnit) {
|
|
99
|
+
if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
|
|
100
|
+
return presetValToTimestamp(defValueUnit, "YYYY-MM-DD HH:mm:ss");
|
|
101
|
+
}
|
|
102
|
+
return defaultValue;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
[
|
|
107
|
+
WidgetTypeEnums.DATE_TIME,
|
|
108
|
+
{
|
|
109
|
+
component: NDatePicker,
|
|
110
|
+
props: {
|
|
111
|
+
type: "datetime",
|
|
112
|
+
clearable: true,
|
|
113
|
+
valueFormat: "yyyy-MM-dd HH:mm:ss"
|
|
114
|
+
},
|
|
115
|
+
handlerProps(props, { title } = {}) {
|
|
116
|
+
const Props = { ...props, placeholder: `\u8BF7\u9009\u62E9${title}` };
|
|
117
|
+
return Props;
|
|
118
|
+
},
|
|
119
|
+
setDefaultValue(defaultValue, defValueUnit) {
|
|
120
|
+
if (defValueUnit && defValueUnit !== DatePresetValEnums.CUSTOM) {
|
|
121
|
+
return presetValToTimestamp(defValueUnit, "YYYY-MM-DD HH:mm:ss");
|
|
122
|
+
}
|
|
123
|
+
return moment(defaultValue).format("YYYY-MM-DD HH:mm:ss");
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
[
|
|
128
|
+
WidgetTypeEnums.CHECKBOX_GROUP,
|
|
129
|
+
{
|
|
130
|
+
component: CheckboxGroup,
|
|
131
|
+
props: {},
|
|
132
|
+
style: {
|
|
133
|
+
"line-height": "32px"
|
|
134
|
+
},
|
|
135
|
+
handlerProps(props, { valueList, multiple } = {}) {
|
|
136
|
+
const Props = { ...props, multiple };
|
|
137
|
+
if (Array.isArray(valueList))
|
|
138
|
+
Props.options = valueList.map(({ value, label }) => ({ value, label }));
|
|
139
|
+
return Props;
|
|
140
|
+
},
|
|
141
|
+
setDefaultValue: SetDefVal
|
|
142
|
+
}
|
|
143
|
+
]
|
|
144
|
+
]);
|
|
145
|
+
const formatItemData = (val, widgetType) => {
|
|
146
|
+
if (widgetType === WidgetTypeEnums.DATE || widgetType === WidgetTypeEnums.DATE_TIME) {
|
|
147
|
+
return moment(val).format("YYYY-MM-DD HH:mm:ss");
|
|
148
|
+
}
|
|
149
|
+
return val;
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export { WidgetCfgMaps, formatItemData };
|