fast-element-plus 2.0.5 → 2.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/components/iconSelector/src/iconSelector.mjs +12 -8
- package/dist/components/iconSelector/src/iconSelector.mjs.map +1 -1
- package/dist/components/selectPage/src/selectPage.mjs +9 -3
- package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
- package/dist/components/table/src/tablePagination.mjs +15 -8
- package/dist/components/table/src/tablePagination.mjs.map +1 -1
- package/dist/index.global.min.js +3 -3
- package/dist/index.global.min.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to Fast.Element.Plus are documented in this file.
|
|
4
4
|
|
|
5
|
+
## [2.0.6] - 2026-08-31
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Migrated controlled Pagination and Popover state to TSX `v-model` bindings, eliminating repeated ElPagination deprecated-usage warnings while preserving remote page loading and visibility cleanup.
|
|
10
|
+
|
|
5
11
|
## [2.0.5] - 2026-08-31
|
|
6
12
|
|
|
7
13
|
### Fixed
|
|
@@ -77,6 +83,7 @@ All notable changes to Fast.Element.Plus are documented in this file.
|
|
|
77
83
|
- Scoped Table styles and added responsive IconSelector styling.
|
|
78
84
|
- Improved dialogs, drawers, tables, forms, trees, selectors, car-number input, images, and uploads for dark mode, touch input, and narrow viewports.
|
|
79
85
|
|
|
86
|
+
[2.0.6]: https://gitee.com/FastDotnet/fast.element.plus/releases/tag/v2.0.6
|
|
80
87
|
[2.0.5]: https://gitee.com/FastDotnet/fast.element.plus/releases/tag/v2.0.5
|
|
81
88
|
[2.0.4]: https://gitee.com/FastDotnet/fast.element.plus/releases/tag/v2.0.4
|
|
82
89
|
[2.0.3]: https://gitee.com/FastDotnet/fast.element.plus/releases/tag/v2.0.3
|
|
@@ -4,7 +4,7 @@ import { useRender } from "../../../utils/vue/render.mjs";
|
|
|
4
4
|
import { withDefineType } from "../../../utils/vue/with.mjs";
|
|
5
5
|
import { FaIcon } from "../../icon/index.mjs";
|
|
6
6
|
import * as FastElementPlusIconsVue from "@fast-element-plus/icons-vue";
|
|
7
|
-
import { computed, createTextVNode, createVNode, defineComponent, isVNode,
|
|
7
|
+
import { computed, createTextVNode, createVNode, defineComponent, isVNode, reactive, watch } from "vue";
|
|
8
8
|
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
|
|
9
9
|
import { ChromeFilled, RefreshRight } from "@element-plus/icons-vue";
|
|
10
10
|
import { ElIcon, ElInput, ElPopover, ElScrollbar } from "element-plus";
|
|
@@ -42,6 +42,13 @@ var iconSelector_default = defineComponent({
|
|
|
42
42
|
return state.iconNames.filter((f) => f.toLowerCase().includes(state.searchValue?.toLowerCase() ?? ""));
|
|
43
43
|
})
|
|
44
44
|
});
|
|
45
|
+
const popoverVisibleModel = computed({
|
|
46
|
+
get: () => state.popoverVisible,
|
|
47
|
+
set: (visible) => {
|
|
48
|
+
state.popoverVisible = visible;
|
|
49
|
+
if (!visible) state.searchValue = null;
|
|
50
|
+
}
|
|
51
|
+
});
|
|
45
52
|
const handleTabClick = (iconType) => {
|
|
46
53
|
state.iconType = iconType;
|
|
47
54
|
state.iconNames = [];
|
|
@@ -74,19 +81,16 @@ var iconSelector_default = defineComponent({
|
|
|
74
81
|
watch(() => props.customIcons, () => {
|
|
75
82
|
if (state.iconType === "local") state.iconNames = [...props.customIcons];
|
|
76
83
|
}, { deep: true });
|
|
77
|
-
useRender(() => createVNode(ElPopover,
|
|
84
|
+
useRender(() => createVNode(ElPopover, {
|
|
78
85
|
"popperClass": "fa-icon-selector-popover",
|
|
79
|
-
"visible":
|
|
80
|
-
|
|
81
|
-
state.popoverVisible = visible;
|
|
82
|
-
if (!visible) state.searchValue = null;
|
|
83
|
-
} }, {
|
|
86
|
+
"visible": popoverVisibleModel.value,
|
|
87
|
+
"onUpdate:visible": ($event) => popoverVisibleModel.value = $event,
|
|
84
88
|
"width": "auto",
|
|
85
89
|
"trigger": "click",
|
|
86
90
|
"showArrow": false,
|
|
87
91
|
"showAfter": 0,
|
|
88
92
|
"hideAfter": 0
|
|
89
|
-
}
|
|
93
|
+
}, {
|
|
90
94
|
reference: () => createVNode(ElInput, {
|
|
91
95
|
"class": "fa-icon-selector",
|
|
92
96
|
"modelValue": state.popoverVisible ? state.searchValue ?? "" : state.value ?? "",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"iconSelector.mjs","names":["update:modelValue","onUpdate:visible"],"sources":["../../../../src/components/iconSelector/src/iconSelector.tsx"],"sourcesContent":["import { computed, defineComponent, reactive, watch } from \"vue\";\nimport * as ElementPlusIconsVue from \"@element-plus/icons-vue\";\nimport { ChromeFilled, RefreshRight } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElInput, ElPopover, ElScrollbar } from \"element-plus\";\nimport * as FastElementPlusIconsVue from \"@fast-element-plus/icons-vue\";\nimport { isNull, isString } from \"lodash-unified\";\nimport { definePropType, useExpose, useRender, withDefineType } from \"../../../utils\";\nimport { FaIcon } from \"../../icon\";\nimport type { PropType } from \"vue\";\n\ntype IconType = \"ele\" | \"fastEle\" | \"local\";\n\nexport default defineComponent({\n\tname: \"FaIconSelector\",\n\tprops: {\n\t\t/** @description v-model绑定值 */\n\t\tmodelValue: String as PropType<string | null>,\n\t\t/** @description 自定义图标 */\n\t\tcustomIcons: {\n\t\t\ttype: definePropType<string[]>(Array),\n\t\t\tdefault: (): string[] => [],\n\t\t},\n\t},\n\temits: {\n\t\t/** @description v-model 回调 */\n\t\t\"update:modelValue\": (value: string | null) => isString(value) || isNull(value),\n\t\t/** @description 改变 */\n\t\tchange: (value: string | null) => isString(value) || isNull(value),\n\t},\n\tsetup(props, { emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | null>(props.modelValue ?? null),\n\t\t\tsearchValue: withDefineType<string | null>(),\n\t\t\ticonType: withDefineType<IconType>(\"ele\"),\n\t\t\tpopoverVisible: false,\n\t\t\ticonNames: withDefineType<string[]>(Object.keys(ElementPlusIconsVue).map((name) => `el-icon-${name}`)),\n\t\t\trenderIconNames: computed((): string[] => {\n\t\t\t\tif (!state.searchValue) return state.iconNames;\n\t\t\t\treturn state.iconNames.filter((f) => f.toLowerCase().includes(state.searchValue?.toLowerCase() ?? \"\"));\n\t\t\t}),\n\t\t});\n\n\t\tconst handleTabClick = (iconType: IconType): void => {\n\t\t\tstate.iconType = iconType;\n\t\t\tstate.iconNames = [];\n\t\t\tswitch (iconType) {\n\t\t\t\tcase \"ele\":\n\t\t\t\t\tstate.iconNames = Object.keys(ElementPlusIconsVue).map((name) => `el-icon-${name}`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"fastEle\":\n\t\t\t\t\tstate.iconNames = Object.keys(FastElementPlusIconsVue).map((name) => `fa-icon-${name}`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"local\":\n\t\t\t\t\tstate.iconNames = props.customIcons;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\n\t\tconst handleIconClick = (value: string): void => {\n\t\t\tstate.popoverVisible = false;\n\t\t\tstate.value = value;\n\t\t\tstate.searchValue = \"\";\n\t\t\temit(\"update:modelValue\", value);\n\t\t\temit(\"change\", value);\n\t\t};\n\n\t\tconst handleRefresh = (): void => {\n\t\t\tstate.value = null;\n\t\t\tstate.searchValue = null;\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"change\", null);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tstate.value = newValue ?? null;\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.customIcons,\n\t\t\t() => {\n\t\t\t\tif (state.iconType === \"local\") state.iconNames = [...props.customIcons];\n\t\t\t},\n\t\t\t{ deep: true }\n\t\t);\n\n\t\tuseRender(() => (\n\t\t\t<ElPopover\n\t\t\t\tpopperClass=\"fa-icon-selector-popover\"\n\t\t\t\tvisible={state.popoverVisible}\n\t\t\t\t{...{\n\t\t\t\t\t\"onUpdate:visible\": (visible: boolean): void => {\n\t\t\t\t\t\tstate.popoverVisible = visible;\n\t\t\t\t\t\tif (!visible) state.searchValue = null;\n\t\t\t\t\t},\n\t\t\t\t}}\n\t\t\t\twidth=\"auto\"\n\t\t\t\ttrigger=\"click\"\n\t\t\t\tshowArrow={false}\n\t\t\t\tshowAfter={0}\n\t\t\t\thideAfter={0}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\treference: () => (\n\t\t\t\t\t\t<ElInput\n\t\t\t\t\t\t\tclass=\"fa-icon-selector\"\n\t\t\t\t\t\t\tmodelValue={state.popoverVisible ? (state.searchValue ?? \"\") : (state.value ?? \"\")}\n\t\t\t\t\t\t\tplaceholder={state.popoverVisible ? \"搜索图标\" : \"请选择图标\"}\n\t\t\t\t\t\t\treadonly={!state.popoverVisible}\n\t\t\t\t\t\t\tonInput={(value: string) => {\n\t\t\t\t\t\t\t\tif (state.popoverVisible) state.searchValue = value;\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\tprepend: () => <ElIcon>{state.value ? <FaIcon name={state.value} /> : <ChromeFilled />}</ElIcon>,\n\t\t\t\t\t\t\t\tappend: () => (\n\t\t\t\t\t\t\t\t\t<ElIcon\n\t\t\t\t\t\t\t\t\t\tonClick={(event: MouseEvent) => {\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\thandleRefresh();\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<RefreshRight />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</ElInput>\n\t\t\t\t\t),\n\t\t\t\t\tdefault: () => (\n\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box\">\n\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-header\">\n\t\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-header__title\">请选择图标</div>\n\t\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-header__tab\">\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass={{ \"is-active\": state.iconType === \"ele\" }}\n\t\t\t\t\t\t\t\t\t\ttitle=\"Element Plus 图标\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleTabClick(\"ele\")}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tele\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass={{ \"is-active\": state.iconType === \"fastEle\" }}\n\t\t\t\t\t\t\t\t\t\ttitle=\"Fast Element Plus 图标\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleTabClick(\"fastEle\")}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tfastEle\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass={{ \"is-active\": state.iconType === \"local\" }}\n\t\t\t\t\t\t\t\t\t\ttitle=\"本地图标\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleTabClick(\"local\")}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tlocal\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-body\">\n\t\t\t\t\t\t\t\t<ElScrollbar>\n\t\t\t\t\t\t\t\t\t{state.renderIconNames.map((m) => (\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tkey={m}\n\t\t\t\t\t\t\t\t\t\t\tclass=\"fa-icon-selector-popover__box-body__item\"\n\t\t\t\t\t\t\t\t\t\t\ttitle={m}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleIconClick(m)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<FaIcon name={m} />\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</ElScrollbar>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t</ElPopover>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 当前图标来源。 */\n\t\t\ticonType: computed(() => state.iconType),\n\t\t\t/** 当前选中的图标名称。 */\n\t\t\tvalue: computed(() => state.value),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;AAQoC,SAAA,QAAA,GAAA;CAAA,OAAA,OAAA,MAAA,cAAA,OAAA,UAAA,SAAA,KAAA,CAAA,MAAA,qBAAA,CAAA,QAAA,CAAA;AAAA;AAIpC,IAAA,uBAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;;EAEN,YAAY;;EAEZ,aAAa;GACZ,MAAM,eAAyB,KAAK;GACpC,eAAyB,CAAA;EAC1B;CACD;CACA,OAAO;;EAEN,sBAAsB,UAAyB,SAAS,KAAK,KAAK,OAAO,KAAK;;EAE9E,SAAS,UAAyB,SAAS,KAAK,KAAK,OAAO,KAAK;CAClE;CACA,MAAM,OAAO,EAAE,MAAM,UAAU;EAC9B,MAAM,QAAQ,SAA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AA,CAAA,CAAA;KAAA,YAAA,UAAA;MAAA,QAAA;MAAA,SAMjC,EAAE,aAAa,MAAM,aAAa,QAAQ;MAAC,SAAA;MAAA,iBAEnC,eAAe,OAAO;KAAC,GAAA,CAAA,gBAAA,OAAA,CAAA,CAAA;IAAA,CAAA,CAAA,CAAA,GAAA,YAAA,OAAA,EAAA,SAAA,qCAAA,GAAA,CAAA,YAAA,aAAA,MAAA,QAAA,QAQtC,MAAM,gBAAgB,KAAK,MAAC,YAAA,UAAA;KAAA,QAAA;KAAA,OAGtB;KAAC,SAAA;KAAA,SAEC;KAAC,iBACO,gBAAgB,CAAC;IAAC,GAAA,CAAA,YAAA,QAAA,EAAA,QAEnB,EAAC,GAAA,IAAA,CAAA,CAAA,CAEhB,CAAC,IAAA,QAAA,EAAA,eAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GAAA;EAIL,CAAA,CAGH;EAED,OAAO,UAAU,QAAQ;;GAExB,UAAU,eAAe,MAAM,QAAQ;;GAEvC,OAAO,eAAe,MAAM,KAAK;EAClC,CAAC;CACF;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"iconSelector.mjs","names":["update:modelValue"],"sources":["../../../../src/components/iconSelector/src/iconSelector.tsx"],"sourcesContent":["import { computed, defineComponent, reactive, watch } from \"vue\";\nimport * as ElementPlusIconsVue from \"@element-plus/icons-vue\";\nimport { ChromeFilled, RefreshRight } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElInput, ElPopover, ElScrollbar } from \"element-plus\";\nimport * as FastElementPlusIconsVue from \"@fast-element-plus/icons-vue\";\nimport { isNull, isString } from \"lodash-unified\";\nimport { definePropType, useExpose, useRender, withDefineType } from \"../../../utils\";\nimport { FaIcon } from \"../../icon\";\nimport type { PropType } from \"vue\";\n\ntype IconType = \"ele\" | \"fastEle\" | \"local\";\n\nexport default defineComponent({\n\tname: \"FaIconSelector\",\n\tprops: {\n\t\t/** @description v-model绑定值 */\n\t\tmodelValue: String as PropType<string | null>,\n\t\t/** @description 自定义图标 */\n\t\tcustomIcons: {\n\t\t\ttype: definePropType<string[]>(Array),\n\t\t\tdefault: (): string[] => [],\n\t\t},\n\t},\n\temits: {\n\t\t/** @description v-model 回调 */\n\t\t\"update:modelValue\": (value: string | null) => isString(value) || isNull(value),\n\t\t/** @description 改变 */\n\t\tchange: (value: string | null) => isString(value) || isNull(value),\n\t},\n\tsetup(props, { emit, expose }) {\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | null>(props.modelValue ?? null),\n\t\t\tsearchValue: withDefineType<string | null>(),\n\t\t\ticonType: withDefineType<IconType>(\"ele\"),\n\t\t\tpopoverVisible: false,\n\t\t\ticonNames: withDefineType<string[]>(Object.keys(ElementPlusIconsVue).map((name) => `el-icon-${name}`)),\n\t\t\trenderIconNames: computed((): string[] => {\n\t\t\t\tif (!state.searchValue) return state.iconNames;\n\t\t\t\treturn state.iconNames.filter((f) => f.toLowerCase().includes(state.searchValue?.toLowerCase() ?? \"\"));\n\t\t\t}),\n\t\t});\n\t\tconst popoverVisibleModel = computed({\n\t\t\tget: () => state.popoverVisible,\n\t\t\tset: (visible: boolean) => {\n\t\t\t\tstate.popoverVisible = visible;\n\t\t\t\tif (!visible) state.searchValue = null;\n\t\t\t},\n\t\t});\n\n\t\tconst handleTabClick = (iconType: IconType): void => {\n\t\t\tstate.iconType = iconType;\n\t\t\tstate.iconNames = [];\n\t\t\tswitch (iconType) {\n\t\t\t\tcase \"ele\":\n\t\t\t\t\tstate.iconNames = Object.keys(ElementPlusIconsVue).map((name) => `el-icon-${name}`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"fastEle\":\n\t\t\t\t\tstate.iconNames = Object.keys(FastElementPlusIconsVue).map((name) => `fa-icon-${name}`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"local\":\n\t\t\t\t\tstate.iconNames = props.customIcons;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t};\n\n\t\tconst handleIconClick = (value: string): void => {\n\t\t\tstate.popoverVisible = false;\n\t\t\tstate.value = value;\n\t\t\tstate.searchValue = \"\";\n\t\t\temit(\"update:modelValue\", value);\n\t\t\temit(\"change\", value);\n\t\t};\n\n\t\tconst handleRefresh = (): void => {\n\t\t\tstate.value = null;\n\t\t\tstate.searchValue = null;\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"change\", null);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tstate.value = newValue ?? null;\n\t\t\t}\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.customIcons,\n\t\t\t() => {\n\t\t\t\tif (state.iconType === \"local\") state.iconNames = [...props.customIcons];\n\t\t\t},\n\t\t\t{ deep: true }\n\t\t);\n\n\t\tuseRender(() => (\n\t\t\t<ElPopover\n\t\t\t\tpopperClass=\"fa-icon-selector-popover\"\n\t\t\t\tvModel:visible={popoverVisibleModel.value}\n\t\t\t\twidth=\"auto\"\n\t\t\t\ttrigger=\"click\"\n\t\t\t\tshowArrow={false}\n\t\t\t\tshowAfter={0}\n\t\t\t\thideAfter={0}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\treference: () => (\n\t\t\t\t\t\t<ElInput\n\t\t\t\t\t\t\tclass=\"fa-icon-selector\"\n\t\t\t\t\t\t\tmodelValue={state.popoverVisible ? (state.searchValue ?? \"\") : (state.value ?? \"\")}\n\t\t\t\t\t\t\tplaceholder={state.popoverVisible ? \"搜索图标\" : \"请选择图标\"}\n\t\t\t\t\t\t\treadonly={!state.popoverVisible}\n\t\t\t\t\t\t\tonInput={(value: string) => {\n\t\t\t\t\t\t\t\tif (state.popoverVisible) state.searchValue = value;\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\tprepend: () => <ElIcon>{state.value ? <FaIcon name={state.value} /> : <ChromeFilled />}</ElIcon>,\n\t\t\t\t\t\t\t\tappend: () => (\n\t\t\t\t\t\t\t\t\t<ElIcon\n\t\t\t\t\t\t\t\t\t\tonClick={(event: MouseEvent) => {\n\t\t\t\t\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\t\t\t\t\thandleRefresh();\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<RefreshRight />\n\t\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t</ElInput>\n\t\t\t\t\t),\n\t\t\t\t\tdefault: () => (\n\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box\">\n\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-header\">\n\t\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-header__title\">请选择图标</div>\n\t\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-header__tab\">\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass={{ \"is-active\": state.iconType === \"ele\" }}\n\t\t\t\t\t\t\t\t\t\ttitle=\"Element Plus 图标\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleTabClick(\"ele\")}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tele\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass={{ \"is-active\": state.iconType === \"fastEle\" }}\n\t\t\t\t\t\t\t\t\t\ttitle=\"Fast Element Plus 图标\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleTabClick(\"fastEle\")}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tfastEle\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\tclass={{ \"is-active\": state.iconType === \"local\" }}\n\t\t\t\t\t\t\t\t\t\ttitle=\"本地图标\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => handleTabClick(\"local\")}\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\tlocal\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"fa-icon-selector-popover__box-body\">\n\t\t\t\t\t\t\t\t<ElScrollbar>\n\t\t\t\t\t\t\t\t\t{state.renderIconNames.map((m) => (\n\t\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\t\tkey={m}\n\t\t\t\t\t\t\t\t\t\t\tclass=\"fa-icon-selector-popover__box-body__item\"\n\t\t\t\t\t\t\t\t\t\t\ttitle={m}\n\t\t\t\t\t\t\t\t\t\t\tonClick={() => handleIconClick(m)}\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<FaIcon name={m} />\n\t\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t))}\n\t\t\t\t\t\t\t\t</ElScrollbar>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t),\n\t\t\t\t}}\n\t\t\t</ElPopover>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** 当前图标来源。 */\n\t\t\ticonType: computed(() => state.iconType),\n\t\t\t/** 当前选中的图标名称。 */\n\t\t\tvalue: computed(() => state.value),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;AAQoC,SAAA,QAAA,GAAA;CAAA,OAAA,OAAA,MAAA,cAAA,OAAA,UAAA,SAAA,KAAA,CAAA,MAAA,qBAAA,CAAA,QAAA,CAAA;AAAA;AAIpC,IAAA,uBAA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OAAA,CAAA,CAAA,GAAA,YAAA,OAAA,EAAA,SAAA,4CAAA,GAAA;KAAA,YAAA,UAAA;MAAA,QAAA;MAAA,SAOG,EAAE,aAAa,MAAM,aAAa,MAAM;MAAC,SAAA;MAAA,iBAEjC,eAAe,KAAK;KAAC,GAAA,CAAA,gBAAA,KAAA,CAAA,CAAA;KAAA,YAAA,UAAA;MAAA,QAAA;MAAA,SAM7B,EAAE,aAAa,MAAM,aAAa,UAAU;MAAC,SAAA;MAAA,iBAErC,eAAe,SAAS;KAAC,GAAA,CAAA,gBAAA,SAAA,CAAA,CAAA;KAAA,YAAA,UAAA;MAAA,QAAA;MAAA,SAMjC,EAAE,aAAa,MAAM,aAAa,QAAQ;MAAC,SAAA;MAAA,iBAEnC,eAAe,OAAO;KAAC,GAAA,CAAA,gBAAA,OAAA,CAAA,CAAA;IAAA,CAAA,CAAA,CAAA,GAAA,YAAA,OAAA,EAAA,SAAA,qCAAA,GAAA,CAAA,YAAA,aAAA,MAAA,QAAA,QAQtC,MAAM,gBAAgB,KAAK,MAAC,YAAA,UAAA;KAAA,QAAA;KAAA,OAGtB;KAAC,SAAA;KAAA,SAEC;KAAC,iBACO,gBAAgB,CAAC;IAAC,GAAA,CAAA,YAAA,QAAA,EAAA,QAEnB,EAAC,GAAA,IAAA,CAAA,CAAA,CAEhB,CAAC,IAAA,QAAA,EAAA,eAAA,CAAA,KAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GAAA;EAIL,CAAA,CAGH;EAED,OAAO,UAAU,QAAQ;;GAExB,UAAU,eAAe,MAAM,QAAQ;;GAEvC,OAAO,eAAe,MAAM,KAAK;EAClC,CAAC;CACF;AACD,CAAC"}
|
|
@@ -172,6 +172,12 @@ var selectPage_default = defineComponent({
|
|
|
172
172
|
if (currentRequestVersion === requestVersion) state.loading = false;
|
|
173
173
|
}
|
|
174
174
|
};
|
|
175
|
+
const pageIndexModel = computed({
|
|
176
|
+
get: () => state.pageIndex,
|
|
177
|
+
set: (pageIndex) => {
|
|
178
|
+
loadData(pageIndex);
|
|
179
|
+
}
|
|
180
|
+
});
|
|
175
181
|
const handleChange = (value) => {
|
|
176
182
|
if (props.multiple) {
|
|
177
183
|
const valueArr = Array.isArray(value) ? value : [];
|
|
@@ -332,12 +338,12 @@ var selectPage_default = defineComponent({
|
|
|
332
338
|
footer: () => createVNode(Fragment, null, [createVNode(ElPagination, {
|
|
333
339
|
"class": "fa-select-page-dropdown__pagination",
|
|
334
340
|
"size": "small",
|
|
335
|
-
"currentPage":
|
|
341
|
+
"currentPage": pageIndexModel.value,
|
|
342
|
+
"onUpdate:currentPage": ($event) => pageIndexModel.value = $event,
|
|
336
343
|
"pageSize": state.pageSize,
|
|
337
344
|
"total": state.totalRows,
|
|
338
345
|
"layout": "prev, pager, next, total",
|
|
339
|
-
"pagerCount": 5
|
|
340
|
-
"onCurrent-change": loadData
|
|
346
|
+
"pagerCount": 5
|
|
341
347
|
}, null), slots.footer?.()]),
|
|
342
348
|
...slots.prefix && { prefix: () => slots.prefix?.() ?? [] },
|
|
343
349
|
...slots.empty && { empty: () => slots.empty?.() ?? [] },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectPage.mjs","names":["update:modelValue","update:label"],"sources":["../../../../src/components/selectPage/src/selectPage.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { Fragment, computed, defineComponent, onMounted, reactive, ref, watch } from \"vue\";\nimport { Search } from \"@element-plus/icons-vue\";\nimport { ElButton, ElInput, ElOption, ElPagination, ElSelect, selectEmits, selectProps, useGlobalSize } from \"element-plus\";\nimport { isArray, isBoolean, isEqual, isNil, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { addCssUnit, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport { FaSelectOption } from \"../../select\";\nimport type { VNode } from \"vue\";\nimport type { ElSelectorModelValue, ElSelectorOutput, ElSelectorValue } from \"../../select\";\nimport type { SelectComponentProps } from \"../../select/src/select\";\nimport type { PagedInput, PagedResult } from \"../../table\";\n\n/** FaSelectPage 的运行时 Props 定义。 */\nexport const faSelectPageProps = {\n\t...selectProps,\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** @description displayed text while loading data from server, default is 'Loading' */\n\tloadingText: {\n\t\ttype: String,\n\t\tdefault: \"加载中...\",\n\t},\n\t/** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */\n\tnoMatchText: {\n\t\ttype: String,\n\t\tdefault: \"暂无匹配的数据\",\n\t},\n\t/** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */\n\tnoDataText: {\n\t\ttype: String,\n\t\tdefault: \"暂无数据\",\n\t},\n\t/** @description whether to collapse tags to a text when multiple selecting */\n\tcollapseTags: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */\n\tcollapseTagsTooltip: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([String, Number, Boolean, Object, Array]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"100%\",\n\t},\n\t/** @description 更多细节,只有使用slot的时候有用 */\n\tmoreDetail: Boolean,\n\t/** @description 配置选项 */\n\tprops: {\n\t\ttype: definePropType<SelectComponentProps>(Object),\n\t\tdefault: (): Partial<SelectComponentProps> => ({\n\t\t\tlabel: \"label\",\n\t\t\thide: \"hide\",\n\t\t\tdisabled: \"disabled\",\n\t\t\tchildren: \"children\",\n\t\t}),\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: PagedInput) => Promise<PagedResult<ElSelectorOutput>>>(Function),\n\t\trequired: true as const,\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput>([String, Number, Object]),\n};\n\n/** FaSelectPage 的运行时 Emits 定义。 */\nexport const faSelectPageEmits = {\n\t...selectEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: ElSelectorModelValue): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isArray(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElSelectorOutput[]): boolean => isArray(data),\n\t/** @description 改变 */\n\tchange: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue): boolean => true,\n};\n\n/** FaSelectPage 的插槽参数。 */\nexport interface FaSelectPageSlots extends Record<string, unknown> {\n\t/** @description FaSelectOption 默认内容插槽 */\n\tdefault: ElSelectorOutput;\n\t/** @description 下拉列表顶部的内容 */\n\theader: never;\n\t/** @description 下拉列表底部的内容 */\n\tfooter: never;\n\t/** @description Select 组件头部内容 */\n\tprefix: never;\n\t/** @description 无选项时的列表 */\n\tempty: never;\n\t/** @description select 组件自定义标签内容 */\n\ttag: never;\n\t/** @description select 组件自定义 loading内容 */\n\tloading: never;\n\t/** @description select 组件自定义标签内容 */\n\tlabel: { label: string; value: string | number | boolean | object };\n}\n\nexport default defineComponent({\n\tname: \"FaSelectPage\",\n\tprops: faSelectPageProps,\n\temits: faSelectPageEmits,\n\tslots: makeSlots<FaSelectPageSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<ElSelectorModelValue>(),\n\t\t\tloading: false,\n\t\t\tselectorData: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 选中的数据 */\n\t\t\tselectedList: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 首次出现 */\n\t\t\tdebut: true,\n\t\t\t/** 回显 */\n\t\t\techo: true,\n\t\t\t/** 下次刷新 */\n\t\t\tnextRefresh: false,\n\t\t\tpageIndex: 1,\n\t\t\tpageSize: 15,\n\t\t\ttotalRows: 0,\n\t\t\tsearchValue: undefined,\n\t\t\tdefaultSelectorData: withDefineType<ElSelectorOutput>(),\n\t\t});\n\n\t\tconst selectRef = ref<InstanceType<typeof ElSelect>>();\n\t\tlet requestVersion = 0;\n\n\t\tconst handleData = (data: ElSelectorOutput[]): ElSelectorOutput[] => {\n\t\t\treturn data\n\t\t\t\t.map((item): ElSelectorOutput => {\n\t\t\t\t\tconst value: unknown = item[props.valueKey];\n\t\t\t\t\tconst label: unknown = typeof props.props.label === \"function\" ? props.props.label(item) : item[props.props.label ?? \"label\"];\n\t\t\t\t\tconst hide: unknown = typeof props.props.hide === \"function\" ? props.props.hide(item) : item[props.props.hide ?? \"hide\"];\n\t\t\t\t\tconst disabled: unknown =\n\t\t\t\t\t\ttypeof props.props.disabled === \"function\" ? props.props.disabled(item) : item[props.props.disabled ?? \"disabled\"];\n\t\t\t\t\tconst children: unknown = item[props.props.children ?? \"children\"];\n\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t(typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"object\")\n\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...item,\n\t\t\t\t\t\tchildren: Array.isArray(children) ? handleData(children as ElSelectorOutput[]) : [],\n\t\t\t\t\t\tdisabled: typeof disabled === \"boolean\" ? disabled : undefined,\n\t\t\t\t\t\thide: typeof hide === \"boolean\" ? hide : undefined,\n\t\t\t\t\t\tlabel: typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.filter((item) => item.hide !== true);\n\t\t};\n\n\t\tconst loadData = async (pageIndex?: number): Promise<void> => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\tstate.loading = true;\n\t\t\tstate.pageIndex = pageIndex ?? state.pageIndex;\n\t\t\tconst params: PagedInput = {\n\t\t\t\t...(typeof props.initParam === \"object\" && props.initParam !== null ? props.initParam : {}),\n\t\t\t\tpageIndex: state.pageIndex,\n\t\t\t\tpageSize: state.pageSize,\n\t\t\t\tsearchValue: state.searchValue,\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t// 这里不允许回显了\n\t\t\t\tstate.echo = false;\n\t\t\t\tstate.totalRows = resData.totalRows ?? 0;\n\t\t\t\tstate.selectorData = handleData(resData.rows ?? []);\n\t\t\t\temit(\"dataChangeCallBack\", state.selectorData);\n\t\t\t} catch (error) {\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\tstate.pageIndex = 1;\n\t\t\t\tstate.totalRows = 0;\n\t\t\t\tstate.selectorData = [];\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t}\n\t\t};\n\n\t\tconst handleChange = (value?: ElSelectorModelValue): void => {\n\t\t\t// 判断是否为多选\n\t\t\tif (props.multiple) {\n\t\t\t\t// value 必然是数组\n\t\t\t\tconst valueArr = Array.isArray(value) ? value : [];\n\t\t\t\tif (valueArr?.length === 0) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\tstate.selectedList = [];\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst dataList = state.selectorData.filter((item) => item.value !== undefined && valueArr.includes(item.value));\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = dataList.map((item) => item.label ?? \"\");\n\t\t\t\tstate.selectedList = [...state.selectedList.filter((f) => !dataList.some((s) => s.value === f.value)), ...dataList]\n\t\t\t\t\t// 过滤不存在的\n\t\t\t\t\t.filter((item) => item.value !== undefined && valueArr.includes(item.value));\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", dataList, value);\n\t\t\t} else {\n\t\t\t\t// value 必然不是数组\n\t\t\t\tif (isNil(value)) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\tstate.selectedList = [];\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst data = state.selectorData.find((f) => f.value === value);\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = data?.label ?? null;\n\t\t\t\tif (data && !state.selectedList.some((s) => s.value === value)) {\n\t\t\t\t\tstate.selectedList = [data];\n\t\t\t\t}\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", data ?? null, value);\n\t\t\t}\n\t\t};\n\n\t\tconst handleClear = (): void => {\n\t\t\tstate.value = null;\n\t\t\tselectedLabel.value = null;\n\t\t\tstate.selectedList = [];\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"clear\");\n\t\t};\n\n\t\tconst handleVisibleChange = async (visible: boolean): Promise<void> => {\n\t\t\tif (visible) {\n\t\t\t\tif (state.debut) {\n\t\t\t\t\t// 首次出现\n\t\t\t\t\tstate.debut = false;\n\t\t\t\t\tawait loadData();\n\t\t\t\t} else {\n\t\t\t\t\t// 判断再次出现是否需要刷新数据\n\t\t\t\t\tif (state.nextRefresh) {\n\t\t\t\t\t\tstate.nextRefresh = false;\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"visible-change\", visible);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.echo && !isNil(newValue)) {\n\t\t\t\t\tconst hasLabel = !isNil(props.label);\n\t\t\t\t\t// 判断是否为多选\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\tif (!Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectPage]\", \"当启用 multiple 时,传入的 modelValue 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && !isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectPage]\", \"当启用 multiple 时,传入的 modelValue:label 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectedList = newValue\n\t\t\t\t\t\t\t// 最大选项截取\n\t\t\t\t\t\t\t.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length)\n\t\t\t\t\t\t\t.map((item, index) => {\n\t\t\t\t\t\t\t\tconst value: unknown = item;\n\t\t\t\t\t\t\t\tconst label: unknown = Array.isArray(props.label) ? props.label[index] : undefined;\n\t\t\t\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t\t\t\t(typeof value === \"string\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"number\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"boolean\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"object\")\n\t\t\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t\t\t\t\tlabel: hasLabel && typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectPage]\", \"当禁用 multiple 时,传入的 modelValue 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectPage]\", \"当禁用 multiple 时,传入的 modelValue:label 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.defaultSelectorData = {\n\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\tlabel: typeof props.label === \"string\" ? props.label : undefined,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstate.value = newValue;\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\tonMounted(() => {\n\t\t\twatch(\n\t\t\t\t() => props.initParam,\n\t\t\t\t(newValue, oldValue) => {\n\t\t\t\t\tif (!isEqual(newValue, oldValue)) {\n\t\t\t\t\t\tstate.nextRefresh = true;\n\t\t\t\t\t\tif (!isNil(state.value)) {\n\t\t\t\t\t\t\thandleChange();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\n\t\tconst elSelectProps = useProps(props, selectProps, [\"modelValue\", \"popperClass\", \"loading\", \"props\"]);\n\t\tconst elSelectEmits = useEmits(selectEmits, emit, [\"update:modelValue\", \"change\", \"clear\", \"visible-change\"]);\n\t\tconst elPopperClass = computed(() => [\n\t\t\t`fa-select-page-dropdown fa-select-page-dropdown-${_globalSize.value}`,\n\t\t\tprops.popperClass,\n\t\t\tprops.moreDetail && `fa-select-dropdown__more-detail fa-select-dropdown__more-detail-${_globalSize.value}`,\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<ElSelect\n\t\t\t\t{...elSelectProps.value}\n\t\t\t\t{...elSelectEmits.value}\n\t\t\t\tref={selectRef}\n\t\t\t\tclass=\"fa-select-page\"\n\t\t\t\tpopperClass={elPopperClass.value}\n\t\t\t\tstyle={{ width: addCssUnit(props.width) }}\n\t\t\t\tvModel={state.value}\n\t\t\t\tloading={state.loading}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonClear={handleClear}\n\t\t\t\tonVisible-change={handleVisibleChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: (): VNode[] =>\n\t\t\t\t\t\tstate.selectorData.map((item) => (\n\t\t\t\t\t\t\t<FaSelectOption vSlots={{ default: slots.default }} data={item} moreDetail={props.moreDetail} />\n\t\t\t\t\t\t)),\n\t\t\t\t\theader: (): VNode[] => [\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t{state.defaultSelectorData?.value !== undefined && (\n\t\t\t\t\t\t\t\t<ElOption\n\t\t\t\t\t\t\t\t\tclass=\"fa-select-page-dropdown__default-selector\"\n\t\t\t\t\t\t\t\t\tvalue={state.defaultSelectorData.value}\n\t\t\t\t\t\t\t\t\tlabel={state.defaultSelectorData.label ?? \"\"}\n\t\t\t\t\t\t\t\t\tdisabled={true}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span>{state.defaultSelectorData.label}</span>\n\t\t\t\t\t\t\t\t\t<span>Default</span>\n\t\t\t\t\t\t\t\t</ElOption>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t<ElInput\n\t\t\t\t\t\t\t\t\tclass=\"fa-select-page-dropdown__search-input\"\n\t\t\t\t\t\t\t\t\tclearable={Boolean(state.searchValue)}\n\t\t\t\t\t\t\t\t\tplaceholder=\"请输入关键字搜索\"\n\t\t\t\t\t\t\t\t\tvModel_trim={state.searchValue}\n\t\t\t\t\t\t\t\t\tonKeyup={(event: KeyboardEvent) => {\n\t\t\t\t\t\t\t\t\t\tif (event.key === \"Enter\") {\n\t\t\t\t\t\t\t\t\t\t\tvoid loadData(1);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\t\t\tappend: () => (\n\t\t\t\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\t\t\t\tloading={state.loading}\n\t\t\t\t\t\t\t\t\t\t\t\ticon={Search}\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvoid loadData(1);\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t</ElInput>\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t{slots.header?.()}\n\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t],\n\t\t\t\t\tfooter: () => (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<ElPagination\n\t\t\t\t\t\t\t\tclass=\"fa-select-page-dropdown__pagination\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tcurrentPage={state.pageIndex}\n\t\t\t\t\t\t\t\tpageSize={state.pageSize}\n\t\t\t\t\t\t\t\ttotal={state.totalRows}\n\t\t\t\t\t\t\t\tlayout=\"prev, pager, next, total\"\n\t\t\t\t\t\t\t\tpagerCount={5}\n\t\t\t\t\t\t\t\tonCurrent-change={loadData}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{slots.footer?.()}\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t),\n\t\t\t\t\t...(slots.prefix && { prefix: (): VNode[] => slots.prefix?.() ?? [] }),\n\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty?.() ?? [] }),\n\t\t\t\t\t...(slots.tag && { tag: (): VNode[] => slots.tag?.() ?? [] }),\n\t\t\t\t\t...(slots.loading && { loading: (): VNode[] => slots.loading?.() ?? [] }),\n\t\t\t\t\t...(props.multiple\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tlabel: ({ label: _label, value }: { label: string; value: string | number | boolean | object }): VNode[] => {\n\t\t\t\t\t\t\t\t\tconst selectedData = state.selectedList.find((f) => f.value === value);\n\t\t\t\t\t\t\t\t\tif (slots.label) {\n\t\t\t\t\t\t\t\t\t\treturn slots.label({ label: selectedData?.label ?? _label, value: selectedData?.value ?? value });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn selectedData ? [<span class=\"el-select__tags-text\">{selectedData.label}</span>] : [];\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: slots.label && {\n\t\t\t\t\t\t\t\tlabel: ({ label, value }: { label: string; value: string | number | boolean | object }): VNode[] =>\n\t\t\t\t\t\t\t\t\tslots.label?.({ label, value }) ?? [],\n\t\t\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElSelect>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 使选择器的输入框获取焦点 */\n\t\t\tfocus: computed(() => selectRef.value?.focus),\n\t\t\t/** @description 使选择器的输入框失去焦点,并隐藏下拉框 */\n\t\t\tblur: computed(() => selectRef.value?.blur),\n\t\t\t/** @description 获取当前选中的标签 */\n\t\t\tselectedLabel: computed(() => selectRef.value?.selectedLabel),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 选中的数据 */\n\t\t\tselectedList: computed(() => state.selectedList),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t\t/** @description 设置选择 */\n\t\t\tsetSelection: (value: Exclude<ElSelectorModelValue, null | undefined>) => handleChange(value),\n\t\t\t/** @description 清除选择 */\n\t\t\tclearSelection: () => handleChange(null),\n\t\t});\n\t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IAAA,GAE1B,MAAM,SAAS,CAAC,CAAA;GAGnB,GAAI,MAAM,UAAU,EAAE,cAAuB,MAAM,SAAS,KAAK,CAAA,EAAG;GACpE,GAAI,MAAM,SAAS,EAAE,aAAsB,MAAM,QAAQ,KAAK,CAAA,EAAG;GACjE,GAAI,MAAM,OAAO,EAAE,WAAoB,MAAM,MAAM,KAAK,CAAA,EAAG;GAC3D,GAAI,MAAM,WAAW,EAAE,eAAwB,MAAM,UAAU,KAAK,CAAA,EAAG;GACvE,GAAI,MAAM,WACP,EACA,QAAQ,EAAE,OAAO,QAAQ,YAAmF;IAC3G,MAAM,eAAe,MAAM,aAAa,MAAM,MAAM,EAAE,UAAU,KAAK;IACrE,IAAI,MAAM,OACT,OAAO,MAAM,MAAM;KAAE,OAAO,cAAc,SAAS;KAAQ,OAAO,cAAc,SAAS;IAAM,CAAC;IAEjG,OAAO,eAAe,CAAA,YAAA,QAAA,EAAA,SAAA,uBAAA,GAAA,CAAqC,aAAa,KAAK,CAAA,CAAA,IAAY,CAAA;GAC1F,EACD,IACC,MAAM,SAAS,EACf,QAAQ,EAAE,OAAO,YAChB,MAAM,QAAQ;IAAE;IAAO;GAAM,CAAC,KAAK,CAAA,EACrC;EAAE,CAAA,CAGN;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,UAAU,OAAO,KAAK;;GAE5C,MAAM,eAAe,UAAU,OAAO,IAAI;;GAE1C,eAAe,eAAe,UAAU,OAAO,aAAa;;GAE5D,SAAS,eAAe,MAAM,OAAO;;GAErC,cAAc,eAAe,MAAM,YAAY;;GAE/C,SAAS;;GAET,eAAe,UAA2D,aAAa,KAAK;;GAE5F,sBAAsB,aAAa,IAAI;EACxC,CAAC;CACF;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"selectPage.mjs","names":["update:modelValue","update:label"],"sources":["../../../../src/components/selectPage/src/selectPage.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { Fragment, computed, defineComponent, onMounted, reactive, ref, watch } from \"vue\";\nimport { Search } from \"@element-plus/icons-vue\";\nimport { ElButton, ElInput, ElOption, ElPagination, ElSelect, selectEmits, selectProps, useGlobalSize } from \"element-plus\";\nimport { isArray, isBoolean, isEqual, isNil, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { addCssUnit, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport { FaSelectOption } from \"../../select\";\nimport type { VNode } from \"vue\";\nimport type { ElSelectorModelValue, ElSelectorOutput, ElSelectorValue } from \"../../select\";\nimport type { SelectComponentProps } from \"../../select/src/select\";\nimport type { PagedInput, PagedResult } from \"../../table\";\n\n/** FaSelectPage 的运行时 Props 定义。 */\nexport const faSelectPageProps = {\n\t...selectProps,\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** @description displayed text while loading data from server, default is 'Loading' */\n\tloadingText: {\n\t\ttype: String,\n\t\tdefault: \"加载中...\",\n\t},\n\t/** @description displayed text when no data matches the filtering query, you can also use slot `empty`, default is 'No matching data' */\n\tnoMatchText: {\n\t\ttype: String,\n\t\tdefault: \"暂无匹配的数据\",\n\t},\n\t/** @description displayed text when there is no options, you can also use slot `empty`, default is 'No data' */\n\tnoDataText: {\n\t\ttype: String,\n\t\tdefault: \"暂无数据\",\n\t},\n\t/** @description whether to collapse tags to a text when multiple selecting */\n\tcollapseTags: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description whether show all selected tags when mouse hover text of collapse-tags. To use this, `collapse-tags` must be true */\n\tcollapseTagsTooltip: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<ElSelectorModelValue>([String, Number, Boolean, Object, Array]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: definePropType<string | string[] | null>([String, Array]),\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: \"100%\",\n\t},\n\t/** @description 更多细节,只有使用slot的时候有用 */\n\tmoreDetail: Boolean,\n\t/** @description 配置选项 */\n\tprops: {\n\t\ttype: definePropType<SelectComponentProps>(Object),\n\t\tdefault: (): Partial<SelectComponentProps> => ({\n\t\t\tlabel: \"label\",\n\t\t\thide: \"hide\",\n\t\t\tdisabled: \"disabled\",\n\t\t\tchildren: \"children\",\n\t\t}),\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: PagedInput) => Promise<PagedResult<ElSelectorOutput>>>(Function),\n\t\trequired: true as const,\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput>([String, Number, Object]),\n};\n\n/** FaSelectPage 的运行时 Emits 定义。 */\nexport const faSelectPageEmits = {\n\t...selectEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: ElSelectorModelValue): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isArray(value) || isNull(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string | string[] | null): boolean => isString(value) || isArray(value) || isNull(value),\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElSelectorOutput[]): boolean => isArray(data),\n\t/** @description 改变 */\n\tchange: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue): boolean => true,\n};\n\n/** FaSelectPage 的插槽参数。 */\nexport interface FaSelectPageSlots extends Record<string, unknown> {\n\t/** @description FaSelectOption 默认内容插槽 */\n\tdefault: ElSelectorOutput;\n\t/** @description 下拉列表顶部的内容 */\n\theader: never;\n\t/** @description 下拉列表底部的内容 */\n\tfooter: never;\n\t/** @description Select 组件头部内容 */\n\tprefix: never;\n\t/** @description 无选项时的列表 */\n\tempty: never;\n\t/** @description select 组件自定义标签内容 */\n\ttag: never;\n\t/** @description select 组件自定义 loading内容 */\n\tloading: never;\n\t/** @description select 组件自定义标签内容 */\n\tlabel: { label: string; value: string | number | boolean | object };\n}\n\nexport default defineComponent({\n\tname: \"FaSelectPage\",\n\tprops: faSelectPageProps,\n\temits: faSelectPageEmits,\n\tslots: makeSlots<FaSelectPageSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit, { passive: true });\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<ElSelectorModelValue>(),\n\t\t\tloading: false,\n\t\t\tselectorData: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 选中的数据 */\n\t\t\tselectedList: withDefineType<ElSelectorOutput[]>([]),\n\t\t\t/** 首次出现 */\n\t\t\tdebut: true,\n\t\t\t/** 回显 */\n\t\t\techo: true,\n\t\t\t/** 下次刷新 */\n\t\t\tnextRefresh: false,\n\t\t\tpageIndex: 1,\n\t\t\tpageSize: 15,\n\t\t\ttotalRows: 0,\n\t\t\tsearchValue: undefined,\n\t\t\tdefaultSelectorData: withDefineType<ElSelectorOutput>(),\n\t\t});\n\n\t\tconst selectRef = ref<InstanceType<typeof ElSelect>>();\n\t\tlet requestVersion = 0;\n\n\t\tconst handleData = (data: ElSelectorOutput[]): ElSelectorOutput[] => {\n\t\t\treturn data\n\t\t\t\t.map((item): ElSelectorOutput => {\n\t\t\t\t\tconst value: unknown = item[props.valueKey];\n\t\t\t\t\tconst label: unknown = typeof props.props.label === \"function\" ? props.props.label(item) : item[props.props.label ?? \"label\"];\n\t\t\t\t\tconst hide: unknown = typeof props.props.hide === \"function\" ? props.props.hide(item) : item[props.props.hide ?? \"hide\"];\n\t\t\t\t\tconst disabled: unknown =\n\t\t\t\t\t\ttypeof props.props.disabled === \"function\" ? props.props.disabled(item) : item[props.props.disabled ?? \"disabled\"];\n\t\t\t\t\tconst children: unknown = item[props.props.children ?? \"children\"];\n\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t(typeof value === \"string\" || typeof value === \"number\" || typeof value === \"boolean\" || typeof value === \"object\")\n\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...item,\n\t\t\t\t\t\tchildren: Array.isArray(children) ? handleData(children as ElSelectorOutput[]) : [],\n\t\t\t\t\t\tdisabled: typeof disabled === \"boolean\" ? disabled : undefined,\n\t\t\t\t\t\thide: typeof hide === \"boolean\" ? hide : undefined,\n\t\t\t\t\t\tlabel: typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t};\n\t\t\t\t})\n\t\t\t\t.filter((item) => item.hide !== true);\n\t\t};\n\n\t\tconst loadData = async (pageIndex?: number): Promise<void> => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\tstate.loading = true;\n\t\t\tstate.pageIndex = pageIndex ?? state.pageIndex;\n\t\t\tconst params: PagedInput = {\n\t\t\t\t...(typeof props.initParam === \"object\" && props.initParam !== null ? props.initParam : {}),\n\t\t\t\tpageIndex: state.pageIndex,\n\t\t\t\tpageSize: state.pageSize,\n\t\t\t\tsearchValue: state.searchValue,\n\t\t\t};\n\t\t\ttry {\n\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t// 这里不允许回显了\n\t\t\t\tstate.echo = false;\n\t\t\t\tstate.totalRows = resData.totalRows ?? 0;\n\t\t\t\tstate.selectorData = handleData(resData.rows ?? []);\n\t\t\t\temit(\"dataChangeCallBack\", state.selectorData);\n\t\t\t} catch (error) {\n\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\tstate.pageIndex = 1;\n\t\t\t\tstate.totalRows = 0;\n\t\t\t\tstate.selectorData = [];\n\t\t\t\tthrow error;\n\t\t\t} finally {\n\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t}\n\t\t};\n\t\tconst pageIndexModel = computed({\n\t\t\tget: () => state.pageIndex,\n\t\t\tset: (pageIndex: number) => {\n\t\t\t\tvoid loadData(pageIndex);\n\t\t\t},\n\t\t});\n\n\t\tconst handleChange = (value?: ElSelectorModelValue): void => {\n\t\t\t// 判断是否为多选\n\t\t\tif (props.multiple) {\n\t\t\t\t// value 必然是数组\n\t\t\t\tconst valueArr = Array.isArray(value) ? value : [];\n\t\t\t\tif (valueArr?.length === 0) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\tstate.selectedList = [];\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst dataList = state.selectorData.filter((item) => item.value !== undefined && valueArr.includes(item.value));\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = dataList.map((item) => item.label ?? \"\");\n\t\t\t\tstate.selectedList = [...state.selectedList.filter((f) => !dataList.some((s) => s.value === f.value)), ...dataList]\n\t\t\t\t\t// 过滤不存在的\n\t\t\t\t\t.filter((item) => item.value !== undefined && valueArr.includes(item.value));\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", dataList, value);\n\t\t\t} else {\n\t\t\t\t// value 必然不是数组\n\t\t\t\tif (isNil(value)) {\n\t\t\t\t\tstate.value = null;\n\t\t\t\t\tselectedLabel.value = null;\n\t\t\t\t\tstate.selectedList = [];\n\t\t\t\t\temit(\"update:modelValue\", null);\n\t\t\t\t\temit(\"change\", null, null);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tconst data = state.selectorData.find((f) => f.value === value);\n\t\t\t\tstate.value = value;\n\t\t\t\tselectedLabel.value = data?.label ?? null;\n\t\t\t\tif (data && !state.selectedList.some((s) => s.value === value)) {\n\t\t\t\t\tstate.selectedList = [data];\n\t\t\t\t}\n\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\temit(\"change\", data ?? null, value);\n\t\t\t}\n\t\t};\n\n\t\tconst handleClear = (): void => {\n\t\t\tstate.value = null;\n\t\t\tselectedLabel.value = null;\n\t\t\tstate.selectedList = [];\n\t\t\temit(\"update:modelValue\", null);\n\t\t\temit(\"clear\");\n\t\t};\n\n\t\tconst handleVisibleChange = async (visible: boolean): Promise<void> => {\n\t\t\tif (visible) {\n\t\t\t\tif (state.debut) {\n\t\t\t\t\t// 首次出现\n\t\t\t\t\tstate.debut = false;\n\t\t\t\t\tawait loadData();\n\t\t\t\t} else {\n\t\t\t\t\t// 判断再次出现是否需要刷新数据\n\t\t\t\t\tif (state.nextRefresh) {\n\t\t\t\t\t\tstate.nextRefresh = false;\n\t\t\t\t\t\tawait loadData();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"visible-change\", visible);\n\t\t};\n\n\t\twatch(\n\t\t\t() => props.modelValue,\n\t\t\t(newValue) => {\n\t\t\t\tif (state.echo && !isNil(newValue)) {\n\t\t\t\t\tconst hasLabel = !isNil(props.label);\n\t\t\t\t\t// 判断是否为多选\n\t\t\t\t\tif (props.multiple) {\n\t\t\t\t\t\tif (!Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectPage]\", \"当启用 multiple 时,传入的 modelValue 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && !isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectPage]\", \"当启用 multiple 时,传入的 modelValue:label 必须是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.selectedList = newValue\n\t\t\t\t\t\t\t// 最大选项截取\n\t\t\t\t\t\t\t.slice(0, props.multipleLimit > 0 ? props.multipleLimit : newValue.length)\n\t\t\t\t\t\t\t.map((item, index) => {\n\t\t\t\t\t\t\t\tconst value: unknown = item;\n\t\t\t\t\t\t\t\tconst label: unknown = Array.isArray(props.label) ? props.label[index] : undefined;\n\t\t\t\t\t\t\t\tconst selectorValue: ElSelectorValue | undefined =\n\t\t\t\t\t\t\t\t\tvalue !== null &&\n\t\t\t\t\t\t\t\t\t(typeof value === \"string\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"number\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"boolean\" ||\n\t\t\t\t\t\t\t\t\t\ttypeof value === \"object\")\n\t\t\t\t\t\t\t\t\t\t? value\n\t\t\t\t\t\t\t\t\t\t: undefined;\n\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\tvalue: selectorValue,\n\t\t\t\t\t\t\t\t\tlabel: hasLabel && typeof label === \"string\" ? label : undefined,\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (Array.isArray(newValue)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectPage]\", \"当禁用 multiple 时,传入的 modelValue 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (hasLabel && isArray(props.label)) {\n\t\t\t\t\t\t\tconsole.error(\"[Fast:FaSelectPage]\", \"当禁用 multiple 时,传入的 modelValue:label 不能是 Array。\");\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tstate.defaultSelectorData = {\n\t\t\t\t\t\t\tvalue: newValue,\n\t\t\t\t\t\t\tlabel: typeof props.label === \"string\" ? props.label : undefined,\n\t\t\t\t\t\t};\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tstate.value = newValue;\n\t\t\t},\n\t\t\t{\n\t\t\t\timmediate: true,\n\t\t\t}\n\t\t);\n\n\t\tonMounted(() => {\n\t\t\twatch(\n\t\t\t\t() => props.initParam,\n\t\t\t\t(newValue, oldValue) => {\n\t\t\t\t\tif (!isEqual(newValue, oldValue)) {\n\t\t\t\t\t\tstate.nextRefresh = true;\n\t\t\t\t\t\tif (!isNil(state.value)) {\n\t\t\t\t\t\t\thandleChange();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t});\n\n\t\tconst elSelectProps = useProps(props, selectProps, [\"modelValue\", \"popperClass\", \"loading\", \"props\"]);\n\t\tconst elSelectEmits = useEmits(selectEmits, emit, [\"update:modelValue\", \"change\", \"clear\", \"visible-change\"]);\n\t\tconst elPopperClass = computed(() => [\n\t\t\t`fa-select-page-dropdown fa-select-page-dropdown-${_globalSize.value}`,\n\t\t\tprops.popperClass,\n\t\t\tprops.moreDetail && `fa-select-dropdown__more-detail fa-select-dropdown__more-detail-${_globalSize.value}`,\n\t\t]);\n\n\t\tuseRender(() => (\n\t\t\t<ElSelect\n\t\t\t\t{...elSelectProps.value}\n\t\t\t\t{...elSelectEmits.value}\n\t\t\t\tref={selectRef}\n\t\t\t\tclass=\"fa-select-page\"\n\t\t\t\tpopperClass={elPopperClass.value}\n\t\t\t\tstyle={{ width: addCssUnit(props.width) }}\n\t\t\t\tvModel={state.value}\n\t\t\t\tloading={state.loading}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonClear={handleClear}\n\t\t\t\tonVisible-change={handleVisibleChange}\n\t\t\t>\n\t\t\t\t{{\n\t\t\t\t\tdefault: (): VNode[] =>\n\t\t\t\t\t\tstate.selectorData.map((item) => (\n\t\t\t\t\t\t\t<FaSelectOption vSlots={{ default: slots.default }} data={item} moreDetail={props.moreDetail} />\n\t\t\t\t\t\t)),\n\t\t\t\t\theader: (): VNode[] => [\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t{state.defaultSelectorData?.value !== undefined && (\n\t\t\t\t\t\t\t\t<ElOption\n\t\t\t\t\t\t\t\t\tclass=\"fa-select-page-dropdown__default-selector\"\n\t\t\t\t\t\t\t\t\tvalue={state.defaultSelectorData.value}\n\t\t\t\t\t\t\t\t\tlabel={state.defaultSelectorData.label ?? \"\"}\n\t\t\t\t\t\t\t\t\tdisabled={true}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<span>{state.defaultSelectorData.label}</span>\n\t\t\t\t\t\t\t\t\t<span>Default</span>\n\t\t\t\t\t\t\t\t</ElOption>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t<ElInput\n\t\t\t\t\t\t\t\t\tclass=\"fa-select-page-dropdown__search-input\"\n\t\t\t\t\t\t\t\t\tclearable={Boolean(state.searchValue)}\n\t\t\t\t\t\t\t\t\tplaceholder=\"请输入关键字搜索\"\n\t\t\t\t\t\t\t\t\tvModel_trim={state.searchValue}\n\t\t\t\t\t\t\t\t\tonKeyup={(event: KeyboardEvent) => {\n\t\t\t\t\t\t\t\t\t\tif (event.key === \"Enter\") {\n\t\t\t\t\t\t\t\t\t\t\tvoid loadData(1);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{{\n\t\t\t\t\t\t\t\t\t\tappend: () => (\n\t\t\t\t\t\t\t\t\t\t\t<ElButton\n\t\t\t\t\t\t\t\t\t\t\t\tloading={state.loading}\n\t\t\t\t\t\t\t\t\t\t\t\ticon={Search}\n\t\t\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\t\t\tvoid loadData(1);\n\t\t\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t</ElInput>\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t{slots.header?.()}\n\t\t\t\t\t\t</Fragment>,\n\t\t\t\t\t],\n\t\t\t\t\tfooter: () => (\n\t\t\t\t\t\t<Fragment>\n\t\t\t\t\t\t\t<ElPagination\n\t\t\t\t\t\t\t\tclass=\"fa-select-page-dropdown__pagination\"\n\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\tvModel:currentPage={pageIndexModel.value}\n\t\t\t\t\t\t\t\tpageSize={state.pageSize}\n\t\t\t\t\t\t\t\ttotal={state.totalRows}\n\t\t\t\t\t\t\t\tlayout=\"prev, pager, next, total\"\n\t\t\t\t\t\t\t\tpagerCount={5}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t{slots.footer?.()}\n\t\t\t\t\t\t</Fragment>\n\t\t\t\t\t),\n\t\t\t\t\t...(slots.prefix && { prefix: (): VNode[] => slots.prefix?.() ?? [] }),\n\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty?.() ?? [] }),\n\t\t\t\t\t...(slots.tag && { tag: (): VNode[] => slots.tag?.() ?? [] }),\n\t\t\t\t\t...(slots.loading && { loading: (): VNode[] => slots.loading?.() ?? [] }),\n\t\t\t\t\t...(props.multiple\n\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\tlabel: ({ label: _label, value }: { label: string; value: string | number | boolean | object }): VNode[] => {\n\t\t\t\t\t\t\t\t\tconst selectedData = state.selectedList.find((f) => f.value === value);\n\t\t\t\t\t\t\t\t\tif (slots.label) {\n\t\t\t\t\t\t\t\t\t\treturn slots.label({ label: selectedData?.label ?? _label, value: selectedData?.value ?? value });\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn selectedData ? [<span class=\"el-select__tags-text\">{selectedData.label}</span>] : [];\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t: slots.label && {\n\t\t\t\t\t\t\t\tlabel: ({ label, value }: { label: string; value: string | number | boolean | object }): VNode[] =>\n\t\t\t\t\t\t\t\t\tslots.label?.({ label, value }) ?? [],\n\t\t\t\t\t\t\t}),\n\t\t\t\t}}\n\t\t\t</ElSelect>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 使选择器的输入框获取焦点 */\n\t\t\tfocus: computed(() => selectRef.value?.focus),\n\t\t\t/** @description 使选择器的输入框失去焦点,并隐藏下拉框 */\n\t\t\tblur: computed(() => selectRef.value?.blur),\n\t\t\t/** @description 获取当前选中的标签 */\n\t\t\tselectedLabel: computed(() => selectRef.value?.selectedLabel),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 选中的数据 */\n\t\t\tselectedList: computed(() => state.selectedList),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t\t/** @description 设置选择 */\n\t\t\tsetSelection: (value: Exclude<ElSelectorModelValue, null | undefined>) => handleChange(value),\n\t\t\t/** @description 清除选择 */\n\t\t\tclearSelection: () => handleChange(null),\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;AAaA,MAAa,oBAAoB;CAChC,GAAG;;CAEH,UAAU;EACT,MAAM;EACN,SAAS,KAAA;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,aAAa;EACZ,MAAM;EACN,SAAS;CACV;;CAEA,YAAY;EACX,MAAM;EACN,SAAS;CACV;;CAEA,cAAc;EACb,MAAM;EACN,SAAS;CACV;;CAEA,qBAAqB;EACpB,MAAM;EACN,SAAS;CACV;;CAEA,YAAY;EACX,MAAM,eAAqC;GAAC;GAAQ;GAAQ;GAAS;GAAQ;EAAK,CAAC;EACnF,SAAS,KAAA;CACV;;CAEA,OAAO,eAAyC,CAAC,QAAQ,KAAK,CAAC;;CAE/D,OAAO;EACN,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,YAAY;;CAEZ,OAAO;EACN,MAAM,eAAqC,MAAM;EACjD,gBAA+C;GAC9C,OAAO;GACP,MAAM;GACN,UAAU;GACV,UAAU;EACX;CACD;;CAEA,YAAY;EACX,MAAM,eAAgF,QAAQ;EAC9F,UAAU;CACX;;CAEA,WAAW,eAA6C;EAAC;EAAQ;EAAQ;CAAM,CAAC;AACjF;;AAGA,MAAa,oBAAoB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AAS,EACf,QAAQ,EAAE,OAAO,YAChB,MAAM,QAAQ;IAAE;IAAO;GAAM,CAAC,KAAK,CAAA,EACrC;EAAE,CAAA,CAGN;EAED,OAAO,UAAU,QAAQ;;GAExB,OAAO,eAAe,UAAU,OAAO,KAAK;;GAE5C,MAAM,eAAe,UAAU,OAAO,IAAI;;GAE1C,eAAe,eAAe,UAAU,OAAO,aAAa;;GAE5D,SAAS,eAAe,MAAM,OAAO;;GAErC,cAAc,eAAe,MAAM,YAAY;;GAE/C,SAAS;;GAET,eAAe,UAA2D,aAAa,KAAK;;GAE5F,sBAAsB,aAAa,IAAI;EACxC,CAAC;CACF;AACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { definePropType } from "../../../utils/vue/props.mjs";
|
|
2
2
|
import { useRender } from "../../../utils/vue/render.mjs";
|
|
3
3
|
import { tableStateKey } from "./useTable.mjs";
|
|
4
|
-
import { createVNode, defineComponent, inject
|
|
4
|
+
import { computed, createVNode, defineComponent, inject } from "vue";
|
|
5
5
|
import { ElNotification, ElPagination } from "element-plus";
|
|
6
6
|
import { isNull, isNumber } from "lodash-unified";
|
|
7
7
|
//#region src/components/table/src/tablePagination.tsx
|
|
@@ -36,19 +36,26 @@ pageSizes: {
|
|
|
36
36
|
});
|
|
37
37
|
emit("sizeChange", pageSize);
|
|
38
38
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
39
|
+
const currentPageModel = computed({
|
|
40
|
+
get: () => tableState.tablePagination.pageIndex,
|
|
41
|
+
set: (currentPage) => emit("currentChange", currentPage)
|
|
42
|
+
});
|
|
43
|
+
const pageSizeModel = computed({
|
|
44
|
+
get: () => tableState.tablePagination.pageSize,
|
|
45
|
+
set: handleSizeChange
|
|
46
|
+
});
|
|
47
|
+
useRender(() => createVNode(ElPagination, {
|
|
43
48
|
"class": "fa-table-pagination",
|
|
44
49
|
"size": "small",
|
|
45
|
-
"currentPage":
|
|
46
|
-
"
|
|
50
|
+
"currentPage": currentPageModel.value,
|
|
51
|
+
"onUpdate:currentPage": ($event) => currentPageModel.value = $event,
|
|
52
|
+
"pageSize": pageSizeModel.value,
|
|
53
|
+
"onUpdate:pageSize": ($event) => pageSizeModel.value = $event,
|
|
47
54
|
"pageSizes": props.pageSizes,
|
|
48
55
|
"background": true,
|
|
49
56
|
"layout": "jumper, prev, pager, next, sizes, total",
|
|
50
57
|
"total": tableState.tablePagination.totalRows
|
|
51
|
-
}
|
|
58
|
+
}, null));
|
|
52
59
|
}
|
|
53
60
|
});
|
|
54
61
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tablePagination.mjs","names":[
|
|
1
|
+
{"version":3,"file":"tablePagination.mjs","names":[],"sources":["../../../../src/components/table/src/tablePagination.tsx"],"sourcesContent":["import { computed, defineComponent, inject } from \"vue\";\nimport { ElNotification, ElPagination } from \"element-plus\";\nimport { isNull, isNumber } from \"lodash-unified\";\nimport { definePropType, useRender } from \"../../../utils\";\nimport { tableStateKey } from \"./useTable\";\n\nexport default defineComponent({\n\tname: \"FaTablePagination\",\n\tprops: {\n\t\t/** @description 页码 */\n\t\tpageSizes: {\n\t\t\ttype: definePropType<number[]>(Array),\n\t\t\tdefault: [20, 30, 50, 100],\n\t\t},\n\t},\n\temits: {\n\t\t/** @description 页码改变 */\n\t\tsizeChange: (pageSize: number) => isNumber(pageSize) || isNull(pageSize),\n\t\t/** @description 当前页数改变 */\n\t\tcurrentChange: (currentPage: number) => isNumber(currentPage) || isNull(currentPage),\n\t},\n\tsetup(props, { emit }) {\n\t\tconst tableState = inject(tableStateKey);\n\t\tif (tableState === undefined) {\n\t\t\tthrow new Error(\"FaTablePagination 必须在 FaTable 内部渲染。\");\n\t\t}\n\n\t\tconst handleSizeChange = (pageSize: number): void => {\n\t\t\tif (pageSize > 100) {\n\t\t\t\tElNotification({\n\t\t\t\t\ttitle: \"欢迎\",\n\t\t\t\t\tmessage: \"当前页码已经超过100条/页,可能会造成页面卡顿。\",\n\t\t\t\t\ttype: \"warning\",\n\t\t\t\t\tduration: 2000,\n\t\t\t\t});\n\t\t\t}\n\t\t\temit(\"sizeChange\", pageSize);\n\t\t};\n\t\tconst currentPageModel = computed({\n\t\t\tget: () => tableState.tablePagination.pageIndex,\n\t\t\tset: (currentPage: number) => emit(\"currentChange\", currentPage),\n\t\t});\n\t\tconst pageSizeModel = computed({\n\t\t\tget: () => tableState.tablePagination.pageSize,\n\t\t\tset: handleSizeChange,\n\t\t});\n\n\t\tuseRender(() => (\n\t\t\t<ElPagination\n\t\t\t\tclass=\"fa-table-pagination\"\n\t\t\t\tsize=\"small\"\n\t\t\t\tvModel:currentPage={currentPageModel.value}\n\t\t\t\tvModel:pageSize={pageSizeModel.value}\n\t\t\t\tpageSizes={props.pageSizes}\n\t\t\t\tbackground\n\t\t\t\tlayout=\"jumper, prev, pager, next, sizes, total\"\n\t\t\t\ttotal={tableState.tablePagination.totalRows}\n\t\t\t/>\n\t\t));\n\t},\n});\n"],"mappings":";;;;;;;AAMA,IAAA,0BAAe,gBAAgB;CAC9B,MAAM;CACN,OAAO;;AAEN,WAAW;EACV,MAAM,eAAyB,KAAK;EACpC,SAAS;GAAC;GAAI;GAAI;GAAI;EAAG;CAC1B,EACD;CACA,OAAO;;EAEN,aAAa,aAAqB,SAAS,QAAQ,KAAK,OAAO,QAAQ;;EAEvE,gBAAgB,gBAAwB,SAAS,WAAW,KAAK,OAAO,WAAW;CACpF;CACA,MAAM,OAAO,EAAE,QAAQ;EACtB,MAAM,aAAa,OAAO,aAAa;EACvC,IAAI,eAAe,KAAA,GAClB,MAAM,IAAI,MAAM,qCAAqC;EAGtD,MAAM,oBAAoB,aAA2B;GACpD,IAAI,WAAW,KACd,eAAe;IACd,OAAO;IACP,SAAS;IACT,MAAM;IACN,UAAU;GACX,CAAC;GAEF,KAAK,cAAc,QAAQ;EAC5B;EACA,MAAM,mBAAmB,SAAS;GACjC,WAAW,WAAW,gBAAgB;GACtC,MAAM,gBAAwB,KAAK,iBAAiB,WAAW;EAChE,CAAC;EACD,MAAM,gBAAgB,SAAS;GAC9B,WAAW,WAAW,gBAAgB;GACtC,KAAK;EACN,CAAC;EAED,gBAAU,YAAA,cAAA;GAAA,SAAA;GAAA,QAAA;GAAA,eAIY,iBAAiB;GAAK,yBAAA,WAAtB,iBAAiB,QAAK;GAAA,YACzB,cAAc;GAAK,sBAAA,WAAnB,cAAc,QAAK;GAAA,aACzB,MAAM;GAAS,cAAA;GAAA,UAAA;GAAA,SAGnB,WAAW,gBAAgB;EAAS,GAAA,IAAA,CAE5C;CACF;AACD,CAAC"}
|