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
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { reactive, computed } from 'vue';
|
|
2
|
+
import { useMessage } from 'naive-ui';
|
|
3
|
+
|
|
4
|
+
const $message = useMessage();
|
|
5
|
+
const useDisplayCategory = (selectedDisplayCategory, { conditionList }) => {
|
|
6
|
+
const State = reactive({
|
|
7
|
+
displayCategories: [],
|
|
8
|
+
displayCategoryOriginLen: 0,
|
|
9
|
+
showAdd: false,
|
|
10
|
+
addDisplayCategory: ""
|
|
11
|
+
});
|
|
12
|
+
const isEnableAddDisplayCategory = computed(() => {
|
|
13
|
+
return State.displayCategories.length === State.displayCategoryOriginLen;
|
|
14
|
+
});
|
|
15
|
+
const editDisplayCategory = (e, item) => {
|
|
16
|
+
item.disabled = false;
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
e.target.focus();
|
|
19
|
+
}, 0);
|
|
20
|
+
};
|
|
21
|
+
const handleDisplayCategorySelect = (item) => {
|
|
22
|
+
if (!item.disabled)
|
|
23
|
+
return;
|
|
24
|
+
if (selectedDisplayCategory.value === item.value) {
|
|
25
|
+
selectedDisplayCategory.value = "";
|
|
26
|
+
} else {
|
|
27
|
+
selectedDisplayCategory.value = item.value;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const handleDisplayCategoryRemove = (index, item) => {
|
|
31
|
+
if (!conditionList.value || !conditionList.value.length) {
|
|
32
|
+
State.displayCategories.splice(index, 1);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const hasItem = conditionList.value.filter((v) => v.displayCategory === item.value);
|
|
36
|
+
if (!hasItem || !hasItem.length) {
|
|
37
|
+
State.displayCategories.splice(index, 1);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
$message.error("\u8BE5\u5206\u7C7B\u4E0B\u6709\u5DF2\u6709\u6570\u636E\uFF0C\u8BF7\u5220\u9664\u8BE5\u5206\u7C7B\u4E0B\u7684\u7B5B\u9009\u96C6\u540E\u91CD\u8BD5\uFF01");
|
|
41
|
+
};
|
|
42
|
+
const handleDisplayCategoryAdd = (e) => {
|
|
43
|
+
var _a;
|
|
44
|
+
const nextInput = (_a = e == null ? void 0 : e.target) == null ? void 0 : _a.nextElementSibling;
|
|
45
|
+
setTimeout(() => {
|
|
46
|
+
nextInput && nextInput.focus();
|
|
47
|
+
});
|
|
48
|
+
State.showAdd = true;
|
|
49
|
+
};
|
|
50
|
+
const handlerBlur = () => {
|
|
51
|
+
State.showAdd = false;
|
|
52
|
+
if (!State.addDisplayCategory)
|
|
53
|
+
return;
|
|
54
|
+
State.displayCategories.push({
|
|
55
|
+
disabled: true,
|
|
56
|
+
value: State.addDisplayCategory
|
|
57
|
+
});
|
|
58
|
+
selectedDisplayCategory.value = State.addDisplayCategory;
|
|
59
|
+
State.addDisplayCategory = "";
|
|
60
|
+
};
|
|
61
|
+
const initDisplayCategories = (rawDataDisplayCategories, displayCategory) => {
|
|
62
|
+
const displayCategories = [];
|
|
63
|
+
rawDataDisplayCategories.forEach((item) => {
|
|
64
|
+
if (item !== "\u672A\u5206\u7C7B") {
|
|
65
|
+
displayCategories.push({
|
|
66
|
+
disabled: true,
|
|
67
|
+
value: item
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
State.displayCategories = displayCategories;
|
|
72
|
+
State.displayCategoryOriginLen = State.displayCategories.length;
|
|
73
|
+
selectedDisplayCategory.value = displayCategory;
|
|
74
|
+
};
|
|
75
|
+
return {
|
|
76
|
+
State,
|
|
77
|
+
isEnableAddDisplayCategory,
|
|
78
|
+
editDisplayCategory,
|
|
79
|
+
handleDisplayCategorySelect,
|
|
80
|
+
handleDisplayCategoryRemove,
|
|
81
|
+
handleDisplayCategoryAdd,
|
|
82
|
+
handlerBlur,
|
|
83
|
+
initDisplayCategories
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export { useDisplayCategory };
|
package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.d.ts
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
import { ISearchConfigType } from '../../../../../../../es/components/table-filter/src/types';
|
|
3
|
+
export declare const getTableAdvancedFilterCfg: (tableListId: string) => Promise<({
|
|
4
|
+
name: string;
|
|
5
|
+
title: string;
|
|
6
|
+
dataType: string;
|
|
7
|
+
type: string;
|
|
8
|
+
isShowSearch: boolean;
|
|
9
|
+
filterExplicit: boolean;
|
|
10
|
+
explicitRequired: boolean;
|
|
11
|
+
optionType?: undefined;
|
|
12
|
+
optionInfo?: undefined;
|
|
13
|
+
defaultValue?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
name: string;
|
|
16
|
+
title: string;
|
|
17
|
+
dataType: string;
|
|
18
|
+
type: string;
|
|
19
|
+
optionType: string;
|
|
20
|
+
isShowSearch: boolean;
|
|
21
|
+
filterExplicit: boolean;
|
|
22
|
+
explicitRequired: boolean;
|
|
23
|
+
optionInfo: {
|
|
24
|
+
list: {
|
|
25
|
+
name: string;
|
|
26
|
+
value: string;
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
defaultValue?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
name: string;
|
|
32
|
+
title: string;
|
|
33
|
+
dataType: string;
|
|
34
|
+
type: string;
|
|
35
|
+
isShowSearch: boolean;
|
|
36
|
+
filterExplicit: boolean;
|
|
37
|
+
explicitRequired: boolean;
|
|
38
|
+
defaultValue: {
|
|
39
|
+
unit: string;
|
|
40
|
+
};
|
|
41
|
+
optionType?: undefined;
|
|
42
|
+
optionInfo?: undefined;
|
|
43
|
+
})[]>;
|
|
44
|
+
export declare const useFilterConditions: (filterConditions: Ref, dataType: string) => {
|
|
45
|
+
State: any;
|
|
46
|
+
paramOptions: import("vue").ComputedRef<any>;
|
|
47
|
+
addFilterCondition: () => void;
|
|
48
|
+
delFilterCondition: (index: number) => void;
|
|
49
|
+
updateKey: (index: number, val: any) => void;
|
|
50
|
+
updateCondition: (index: number, val: any) => void;
|
|
51
|
+
getParamCfg: (key: string) => any;
|
|
52
|
+
initFilterConditions: (tableId: string, rawConditions: ISearchConfigType) => Promise<void>;
|
|
53
|
+
getRawFilterConditions: () => {
|
|
54
|
+
field_key: any;
|
|
55
|
+
con: any;
|
|
56
|
+
value: any;
|
|
57
|
+
unit: any;
|
|
58
|
+
}[];
|
|
59
|
+
};
|
package/es/components/table-filter/src/components/classify-filter/hooks/useFilterConditions.js
ADDED
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { reactive, computed, toRaw, unref } from 'vue';
|
|
2
|
+
import { ConditionEnums, WidgetTypeEnums, WidgetOptionEnums } from '../../../types/enums.js';
|
|
3
|
+
import { transformConditions, transformRawConditions, transformDataToFront } from '../../../tool/transformData.js';
|
|
4
|
+
|
|
5
|
+
const getTableAdvancedFilterCfg = async (tableListId) => {
|
|
6
|
+
return await [
|
|
7
|
+
{
|
|
8
|
+
"name": "ruleCode",
|
|
9
|
+
"title": "\u89C4\u5219\u6807\u8BC6",
|
|
10
|
+
"dataType": "TEXT",
|
|
11
|
+
"type": "TEXT",
|
|
12
|
+
"isShowSearch": true,
|
|
13
|
+
"filterExplicit": false,
|
|
14
|
+
"explicitRequired": false
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "batchNumber",
|
|
18
|
+
"title": "\u6279\u6B21\u53F7",
|
|
19
|
+
"dataType": "TEXT",
|
|
20
|
+
"type": "TEXT",
|
|
21
|
+
"isShowSearch": true,
|
|
22
|
+
"filterExplicit": true,
|
|
23
|
+
"explicitRequired": false
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "result",
|
|
27
|
+
"title": "\u6267\u884C\u7ED3\u679C",
|
|
28
|
+
"dataType": "TEXT",
|
|
29
|
+
"type": "SELECT",
|
|
30
|
+
"optionType": "SELECT_SINGLE",
|
|
31
|
+
"isShowSearch": true,
|
|
32
|
+
"filterExplicit": true,
|
|
33
|
+
"explicitRequired": false,
|
|
34
|
+
"optionInfo": {
|
|
35
|
+
"list": [
|
|
36
|
+
{
|
|
37
|
+
"name": "\u6210\u529F\u4E0B\u62C9\u6846",
|
|
38
|
+
"value": "true"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "\u5931\u8D25\u4E0B\u62C9\u6846",
|
|
42
|
+
"value": "false"
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"name": "startTime",
|
|
49
|
+
"title": "\u5F00\u59CB\u65F6\u95F4",
|
|
50
|
+
"dataType": "DATE",
|
|
51
|
+
"type": "DATE",
|
|
52
|
+
"isShowSearch": true,
|
|
53
|
+
"filterExplicit": true,
|
|
54
|
+
"explicitRequired": false,
|
|
55
|
+
"defaultValue": {
|
|
56
|
+
"unit": "THIS_WEEK_START"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
"name": "endTime",
|
|
61
|
+
"title": "\u7ED3\u675F\u65F6\u95F4",
|
|
62
|
+
"dataType": "DATETIME",
|
|
63
|
+
"type": "DATETIME",
|
|
64
|
+
"isShowSearch": true,
|
|
65
|
+
"filterExplicit": true,
|
|
66
|
+
"explicitRequired": false,
|
|
67
|
+
"defaultValue": {
|
|
68
|
+
"unit": "THIS_WEEK_END"
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"name": "keyword",
|
|
73
|
+
"title": "\u5173\u952E\u5B57",
|
|
74
|
+
"dataType": "TEXT",
|
|
75
|
+
"type": "TEXT",
|
|
76
|
+
"isShowSearch": true,
|
|
77
|
+
"filterExplicit": true,
|
|
78
|
+
"explicitRequired": false
|
|
79
|
+
}
|
|
80
|
+
];
|
|
81
|
+
};
|
|
82
|
+
const useFilterConditions = (filterConditions, dataType) => {
|
|
83
|
+
const State = reactive({
|
|
84
|
+
params: []
|
|
85
|
+
});
|
|
86
|
+
const paramOptions = computed(
|
|
87
|
+
() => State.params.map(({ p_name, title }) => ({ label: title || p_name, value: p_name }))
|
|
88
|
+
);
|
|
89
|
+
const getParamCfg = (key) => {
|
|
90
|
+
const item = State.params.find((i) => i.p_name === key);
|
|
91
|
+
return item;
|
|
92
|
+
};
|
|
93
|
+
const clearByCondition = (filterCondition) => {
|
|
94
|
+
const cfg = getParamCfg(filterCondition.key);
|
|
95
|
+
filterCondition.value = (cfg == null ? void 0 : cfg.type) === WidgetTypeEnums.SELECT && (cfg == null ? void 0 : cfg.optionSetting) === WidgetOptionEnums.MULTIPLE ? [] : null;
|
|
96
|
+
filterCondition.timeVal = null;
|
|
97
|
+
};
|
|
98
|
+
const updateCondition = (index, val) => {
|
|
99
|
+
const filterCondition = filterConditions.value[index];
|
|
100
|
+
if (filterCondition) {
|
|
101
|
+
filterCondition.condition = val;
|
|
102
|
+
clearByCondition(filterCondition);
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
const updateKey = (index, val) => {
|
|
106
|
+
const filterCondition = filterConditions.value[index];
|
|
107
|
+
if (filterCondition) {
|
|
108
|
+
filterCondition.key = val;
|
|
109
|
+
updateCondition(index, ConditionEnums.EQUAL);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
const addFilterCondition = () => {
|
|
113
|
+
filterConditions.value.push({ key: null, condition: null, value: null, presetVal: null });
|
|
114
|
+
};
|
|
115
|
+
const delFilterCondition = (index) => {
|
|
116
|
+
filterConditions.value.splice(index, 1);
|
|
117
|
+
};
|
|
118
|
+
const getParamsData = async (tableId) => {
|
|
119
|
+
try {
|
|
120
|
+
const advancedFilterRawData = await getTableAdvancedFilterCfg(tableId);
|
|
121
|
+
return transformDataToFront(dataType, advancedFilterRawData);
|
|
122
|
+
} catch (e) {
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
const initFilterConditions = async (tableId, rawConditions) => {
|
|
127
|
+
const params = await getParamsData(tableId);
|
|
128
|
+
State.params = params;
|
|
129
|
+
filterConditions.value = transformConditions(rawConditions, toRaw(State.params));
|
|
130
|
+
};
|
|
131
|
+
const getRawFilterConditions = () => {
|
|
132
|
+
return transformRawConditions(unref(filterConditions));
|
|
133
|
+
};
|
|
134
|
+
return {
|
|
135
|
+
State,
|
|
136
|
+
paramOptions,
|
|
137
|
+
addFilterCondition,
|
|
138
|
+
delFilterCondition,
|
|
139
|
+
updateKey,
|
|
140
|
+
updateCondition,
|
|
141
|
+
getParamCfg,
|
|
142
|
+
initFilterConditions,
|
|
143
|
+
getRawFilterConditions
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
export { getTableAdvancedFilterCfg, useFilterConditions };
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { PropType } from 'vue';
|
|
2
|
+
import { IClassifyListType, ICategoryItemType } from '../../../../../../es/components/table-filter/src/types';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<{
|
|
4
|
+
actionList_prop: {
|
|
5
|
+
type: PropType<IClassifyListType>;
|
|
6
|
+
default: () => {};
|
|
7
|
+
};
|
|
8
|
+
conditionList: {
|
|
9
|
+
type: ArrayConstructor;
|
|
10
|
+
default: () => never[];
|
|
11
|
+
};
|
|
12
|
+
tableId: {
|
|
13
|
+
type: StringConstructor;
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
}, {
|
|
17
|
+
$message: import("naive-ui").MessageApi;
|
|
18
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
19
|
+
actionList_prop: {
|
|
20
|
+
type: PropType<IClassifyListType>;
|
|
21
|
+
default: () => {};
|
|
22
|
+
};
|
|
23
|
+
conditionList: {
|
|
24
|
+
type: ArrayConstructor;
|
|
25
|
+
default: () => never[];
|
|
26
|
+
};
|
|
27
|
+
tableId: {
|
|
28
|
+
type: StringConstructor;
|
|
29
|
+
default: string;
|
|
30
|
+
};
|
|
31
|
+
}>> & {
|
|
32
|
+
onSaveAdd?: ((...args: any[]) => any) | undefined;
|
|
33
|
+
onCancelSaveAdd?: ((...args: any[]) => any) | undefined;
|
|
34
|
+
}>>;
|
|
35
|
+
emit: (event: "saveAdd" | "cancelSaveAdd", ...args: any[]) => void;
|
|
36
|
+
$attrs: {
|
|
37
|
+
[x: string]: unknown;
|
|
38
|
+
};
|
|
39
|
+
FormState: {
|
|
40
|
+
className: string;
|
|
41
|
+
displayCategory: string;
|
|
42
|
+
filterConditions: {
|
|
43
|
+
value: string;
|
|
44
|
+
key: string;
|
|
45
|
+
condition: string;
|
|
46
|
+
presetVal: string;
|
|
47
|
+
}[];
|
|
48
|
+
};
|
|
49
|
+
loading: import("vue").Ref<boolean>;
|
|
50
|
+
DisplayCategoryState: {
|
|
51
|
+
addDisplayCategory: string;
|
|
52
|
+
displayCategories: {
|
|
53
|
+
disabled: boolean;
|
|
54
|
+
value: string;
|
|
55
|
+
}[];
|
|
56
|
+
displayCategoryOriginLen: number;
|
|
57
|
+
showAdd: boolean;
|
|
58
|
+
};
|
|
59
|
+
isEnableAddDisplayCategory: import("vue").ComputedRef<boolean>;
|
|
60
|
+
editDisplayCategory: (e: any, item: ICategoryItemType) => void;
|
|
61
|
+
handleDisplayCategorySelect: (item: ICategoryItemType) => void;
|
|
62
|
+
handleDisplayCategoryRemove: (index: number, item: ICategoryItemType) => void;
|
|
63
|
+
handleDisplayCategoryAdd: (e: any) => void;
|
|
64
|
+
handlerBlur: () => void;
|
|
65
|
+
initDisplayCategories: (rawDataDisplayCategories: any, displayCategory: any) => void;
|
|
66
|
+
FilterConditionsState: any;
|
|
67
|
+
paramOptions: import("vue").ComputedRef<any>;
|
|
68
|
+
addFilterCondition: () => void;
|
|
69
|
+
delFilterCondition: (index: number) => void;
|
|
70
|
+
updateKey: (index: number, val: any) => void;
|
|
71
|
+
updateCondition: (index: number, val: any) => void;
|
|
72
|
+
getParamCfg: (key: string) => any;
|
|
73
|
+
initFilterConditions: (tableId: string, rawConditions: import("../../../../../../es/components/table-filter/src/types").ISearchConfigType) => Promise<void>;
|
|
74
|
+
getRawFilterConditions: () => {
|
|
75
|
+
field_key: any;
|
|
76
|
+
con: any;
|
|
77
|
+
value: any;
|
|
78
|
+
unit: any;
|
|
79
|
+
}[];
|
|
80
|
+
findConditionByDisplayCategory: (displayCategory: string) => unknown;
|
|
81
|
+
handleDisplayCategorySelectProxy: (item: ICategoryItemType) => void;
|
|
82
|
+
clearFormData: () => void;
|
|
83
|
+
handleInitConditions: () => Promise<void>;
|
|
84
|
+
validate: () => Promise<unknown>;
|
|
85
|
+
saveAdd: () => void;
|
|
86
|
+
cancelSaveAdd: () => void;
|
|
87
|
+
NSpin: any;
|
|
88
|
+
NIcon: any;
|
|
89
|
+
NInput: any;
|
|
90
|
+
NButton: any;
|
|
91
|
+
NTooltip: any;
|
|
92
|
+
NSelect: any;
|
|
93
|
+
AddOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
94
|
+
AddCircleSharp: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
95
|
+
CloseOutline: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
96
|
+
SvgIcon: import("vue").DefineComponent<{
|
|
97
|
+
iconClass: {
|
|
98
|
+
type: StringConstructor;
|
|
99
|
+
required: true;
|
|
100
|
+
default: string;
|
|
101
|
+
};
|
|
102
|
+
title: {
|
|
103
|
+
type: StringConstructor;
|
|
104
|
+
required: false;
|
|
105
|
+
default: string;
|
|
106
|
+
};
|
|
107
|
+
className: {
|
|
108
|
+
type: StringConstructor;
|
|
109
|
+
required: false;
|
|
110
|
+
};
|
|
111
|
+
}, {
|
|
112
|
+
props: {
|
|
113
|
+
iconClass: string;
|
|
114
|
+
title: string;
|
|
115
|
+
className?: string | undefined;
|
|
116
|
+
};
|
|
117
|
+
iconName: import("vue").ComputedRef<string>;
|
|
118
|
+
svgClass: import("vue").ComputedRef<string>;
|
|
119
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
120
|
+
iconClass: {
|
|
121
|
+
type: StringConstructor;
|
|
122
|
+
required: true;
|
|
123
|
+
default: string;
|
|
124
|
+
};
|
|
125
|
+
title: {
|
|
126
|
+
type: StringConstructor;
|
|
127
|
+
required: false;
|
|
128
|
+
default: string;
|
|
129
|
+
};
|
|
130
|
+
className: {
|
|
131
|
+
type: StringConstructor;
|
|
132
|
+
required: false;
|
|
133
|
+
};
|
|
134
|
+
}>>, {
|
|
135
|
+
title: string;
|
|
136
|
+
iconClass: string;
|
|
137
|
+
}>;
|
|
138
|
+
ValueCfg: import("vue").DefineComponent<{
|
|
139
|
+
paramCfg: {
|
|
140
|
+
type: ObjectConstructor;
|
|
141
|
+
default: null;
|
|
142
|
+
};
|
|
143
|
+
modelValue: {
|
|
144
|
+
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
145
|
+
default: null;
|
|
146
|
+
};
|
|
147
|
+
presetVal: {
|
|
148
|
+
type: StringConstructor;
|
|
149
|
+
default: null;
|
|
150
|
+
};
|
|
151
|
+
}, {
|
|
152
|
+
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
153
|
+
paramCfg: {
|
|
154
|
+
type: ObjectConstructor;
|
|
155
|
+
default: null;
|
|
156
|
+
};
|
|
157
|
+
modelValue: {
|
|
158
|
+
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
159
|
+
default: null;
|
|
160
|
+
};
|
|
161
|
+
presetVal: {
|
|
162
|
+
type: StringConstructor;
|
|
163
|
+
default: null;
|
|
164
|
+
};
|
|
165
|
+
}>> & {
|
|
166
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
167
|
+
"onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
|
|
168
|
+
}>>;
|
|
169
|
+
emit: (event: "update:modelValue" | "update:presetVal", ...args: any[]) => void;
|
|
170
|
+
valueCp: import("vue").WritableComputedRef<unknown>;
|
|
171
|
+
presetValCp: import("vue").WritableComputedRef<unknown>;
|
|
172
|
+
widgetType: import("vue").ComputedRef<any>;
|
|
173
|
+
optionSetting: import("vue").ComputedRef<any>;
|
|
174
|
+
mappingConfig: import("vue").ComputedRef<any>;
|
|
175
|
+
widgetOptions: import("vue").ComputedRef<{
|
|
176
|
+
label: string;
|
|
177
|
+
value: string;
|
|
178
|
+
}[]>;
|
|
179
|
+
NInputNumber: any;
|
|
180
|
+
NInput: any;
|
|
181
|
+
NSelect: any;
|
|
182
|
+
NDatePicker: any;
|
|
183
|
+
WidgetTypeEnums: {
|
|
184
|
+
INPUT_NUMBER: string;
|
|
185
|
+
INPUT: string;
|
|
186
|
+
SELECT: string;
|
|
187
|
+
DATE: string;
|
|
188
|
+
DATE_TIME: string;
|
|
189
|
+
};
|
|
190
|
+
WidgetValEnums: {
|
|
191
|
+
CUSTOM: string;
|
|
192
|
+
FIRST_VAL: string;
|
|
193
|
+
NOW: string;
|
|
194
|
+
TODAY: string;
|
|
195
|
+
TODAY_START: string;
|
|
196
|
+
TODAY_END: string;
|
|
197
|
+
TOMORROW: string;
|
|
198
|
+
TOMORROW_START: string;
|
|
199
|
+
TOMORROW_END: string;
|
|
200
|
+
YESTERDAY: string;
|
|
201
|
+
YESTERDAY_START: string;
|
|
202
|
+
YESTERDAY_END: string;
|
|
203
|
+
THIS_WEEK: string;
|
|
204
|
+
WEEK_START: string;
|
|
205
|
+
WEEK_END: string;
|
|
206
|
+
NEXT_WEEK: string;
|
|
207
|
+
LAST_WEEK: string;
|
|
208
|
+
THIS_MONTH: string;
|
|
209
|
+
MONTH_START: string;
|
|
210
|
+
MONTH_END: string;
|
|
211
|
+
NEXT_MONTH: string;
|
|
212
|
+
LAST_MONTH: string;
|
|
213
|
+
THIS_QUARTER: string;
|
|
214
|
+
NEXT_QUARTER: string;
|
|
215
|
+
LAST_QUARTER: string;
|
|
216
|
+
THIS_YEAR: string;
|
|
217
|
+
NEXT_YEAR: string;
|
|
218
|
+
LAST_YEAR: string;
|
|
219
|
+
};
|
|
220
|
+
WidgetOptionEnums: {
|
|
221
|
+
RADIO: string;
|
|
222
|
+
MULTIPLE: string;
|
|
223
|
+
ALL: string;
|
|
224
|
+
SELECT_TIME: string;
|
|
225
|
+
PAST_TIME: string;
|
|
226
|
+
FUTURE_TIME: string;
|
|
227
|
+
};
|
|
228
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:modelValue" | "update:presetVal")[], "update:modelValue" | "update:presetVal", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
229
|
+
paramCfg: {
|
|
230
|
+
type: ObjectConstructor;
|
|
231
|
+
default: null;
|
|
232
|
+
};
|
|
233
|
+
modelValue: {
|
|
234
|
+
type: (ArrayConstructor | NumberConstructor | StringConstructor)[];
|
|
235
|
+
default: null;
|
|
236
|
+
};
|
|
237
|
+
presetVal: {
|
|
238
|
+
type: StringConstructor;
|
|
239
|
+
default: null;
|
|
240
|
+
};
|
|
241
|
+
}>> & {
|
|
242
|
+
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
243
|
+
"onUpdate:presetVal"?: ((...args: any[]) => any) | undefined;
|
|
244
|
+
}, {
|
|
245
|
+
modelValue: string | number | unknown[];
|
|
246
|
+
presetVal: string;
|
|
247
|
+
paramCfg: Record<string, any>;
|
|
248
|
+
}>;
|
|
249
|
+
ConditionEnums: {
|
|
250
|
+
NULL: string;
|
|
251
|
+
EQUAL: string;
|
|
252
|
+
};
|
|
253
|
+
conditionOptions: {
|
|
254
|
+
label: string;
|
|
255
|
+
value: string;
|
|
256
|
+
}[];
|
|
257
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("saveAdd" | "cancelSaveAdd")[], "saveAdd" | "cancelSaveAdd", import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
258
|
+
actionList_prop: {
|
|
259
|
+
type: PropType<IClassifyListType>;
|
|
260
|
+
default: () => {};
|
|
261
|
+
};
|
|
262
|
+
conditionList: {
|
|
263
|
+
type: ArrayConstructor;
|
|
264
|
+
default: () => never[];
|
|
265
|
+
};
|
|
266
|
+
tableId: {
|
|
267
|
+
type: StringConstructor;
|
|
268
|
+
default: string;
|
|
269
|
+
};
|
|
270
|
+
}>> & {
|
|
271
|
+
onSaveAdd?: ((...args: any[]) => any) | undefined;
|
|
272
|
+
onCancelSaveAdd?: ((...args: any[]) => any) | undefined;
|
|
273
|
+
}, {
|
|
274
|
+
tableId: string;
|
|
275
|
+
actionList_prop: IClassifyListType;
|
|
276
|
+
conditionList: unknown[];
|
|
277
|
+
}>;
|
|
278
|
+
export default _default;
|