fast-element-plus 2.0.15 → 2.0.17
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 +28 -0
- package/dist/component.d.ts +6570 -2
- package/dist/component.mjs.map +1 -1
- package/dist/components/avatar/src/avatar.d.ts +19 -7
- package/dist/components/avatar/src/avatar.mjs +5 -0
- package/dist/components/avatar/src/avatar.mjs.map +1 -1
- package/dist/components/button/src/button.d.ts +4 -4
- package/dist/components/button/src/button.mjs +3 -4
- package/dist/components/button/src/button.mjs.map +1 -1
- package/dist/components/carNumber/src/carNumber.mjs +7 -9
- package/dist/components/carNumber/src/carNumber.mjs.map +1 -1
- package/dist/components/contextMenu/index.d.ts +1 -1
- package/dist/components/contextMenu/index.mjs.map +1 -1
- package/dist/components/contextMenu/src/contextMenu.d.ts +2 -2
- package/dist/components/contextMenu/src/contextMenu.mjs +10 -9
- package/dist/components/contextMenu/src/contextMenu.mjs.map +1 -1
- package/dist/components/dialog/src/dialog.d.ts +7 -4
- package/dist/components/dialog/src/dialog.mjs +10 -11
- package/dist/components/dialog/src/dialog.mjs.map +1 -1
- package/dist/components/drawer/src/drawer.d.ts +2 -2
- package/dist/components/drawer/src/drawer.mjs +18 -18
- package/dist/components/drawer/src/drawer.mjs.map +1 -1
- package/dist/components/form/src/form.d.ts +34 -16
- package/dist/components/form/src/form.mjs +8 -9
- package/dist/components/form/src/form.mjs.map +1 -1
- package/dist/components/form/src/formItem.d.ts +4 -4
- package/dist/components/form/src/formItem.mjs +18 -17
- package/dist/components/form/src/formItem.mjs.map +1 -1
- package/dist/components/form/utils/form.d.ts +3 -3
- package/dist/components/form/utils/form.mjs +6 -10
- package/dist/components/form/utils/form.mjs.map +1 -1
- package/dist/components/icon/src/icon.mjs.map +1 -1
- package/dist/components/iconSelector/src/iconSelector.d.ts +2 -2
- package/dist/components/iconSelector/src/iconSelector.mjs +4 -5
- package/dist/components/iconSelector/src/iconSelector.mjs.map +1 -1
- package/dist/components/image/src/image.d.ts +1 -1
- package/dist/components/image/src/image.mjs +3 -3
- package/dist/components/image/src/image.mjs.map +1 -1
- package/dist/components/inputDialogPage/src/inputDialogPage.d.ts +4 -4
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs +11 -15
- package/dist/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -1
- package/dist/components/layoutGrid/index.d.ts +1 -1
- package/dist/components/layoutGrid/index.mjs.map +1 -1
- package/dist/components/layoutGrid/src/layoutGrid.d.ts +23 -11
- package/dist/components/layoutGrid/src/layoutGrid.mjs +44 -45
- package/dist/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
- package/dist/components/layoutGrid/src/layoutGrid.type.d.ts +1 -1
- package/dist/components/layoutGrid/src/layoutGridItem.mjs +13 -14
- package/dist/components/layoutGrid/src/layoutGridItem.mjs.map +1 -1
- package/dist/components/select/index.d.ts +1 -1
- package/dist/components/select/index.mjs.map +1 -1
- package/dist/components/select/src/select.d.ts +29 -14
- package/dist/components/select/src/select.mjs +47 -45
- package/dist/components/select/src/select.mjs.map +1 -1
- package/dist/components/select/src/selectOption.mjs +4 -5
- package/dist/components/select/src/selectOption.mjs.map +1 -1
- package/dist/components/selectPage/src/selectPage.d.ts +29 -14
- package/dist/components/selectPage/src/selectPage.mjs +45 -52
- package/dist/components/selectPage/src/selectPage.mjs.map +1 -1
- package/dist/components/selectV2/src/selectV2.d.ts +51 -31
- package/dist/components/selectV2/src/selectV2.mjs +66 -64
- package/dist/components/selectV2/src/selectV2.mjs.map +1 -1
- package/dist/components/table/index.d.ts +3 -3
- package/dist/components/table/index.mjs +1 -3
- package/dist/components/table/index.mjs.map +1 -1
- package/dist/components/table/src/table.d.ts +72 -38
- package/dist/components/table/src/table.mjs +98 -104
- package/dist/components/table/src/table.mjs.map +1 -1
- package/dist/components/table/src/table.type.d.ts +2 -2
- package/dist/components/table/src/table.type.mjs.map +1 -1
- package/dist/components/table/src/tableColumn.d.ts +7 -7
- package/dist/components/table/src/tableColumn.mjs +25 -45
- package/dist/components/table/src/tableColumn.mjs.map +1 -1
- package/dist/components/table/src/tableColumnSettingDialog.mjs +32 -22
- package/dist/components/table/src/tableColumnSettingDialog.mjs.map +1 -1
- package/dist/components/table/src/tablePagination.mjs +2 -3
- package/dist/components/table/src/tablePagination.mjs.map +1 -1
- package/dist/components/table/src/tableSearchForm.d.ts +4 -4
- package/dist/components/table/src/tableSearchForm.mjs +35 -44
- package/dist/components/table/src/tableSearchForm.mjs.map +1 -1
- package/dist/components/table/src/tableSearchFormItem.d.ts +1 -7
- package/dist/components/table/src/tableSearchFormItem.mjs +3 -6
- package/dist/components/table/src/tableSearchFormItem.mjs.map +1 -1
- package/dist/components/table/src/useTable.d.ts +4 -4
- package/dist/components/table/src/useTable.mjs +19 -20
- package/dist/components/table/src/useTable.mjs.map +1 -1
- package/dist/components/table/utils/table.mjs +6 -8
- package/dist/components/table/utils/table.mjs.map +1 -1
- package/dist/components/tree/index.d.ts +1 -1
- package/dist/components/tree/index.mjs.map +1 -1
- package/dist/components/tree/src/tree.d.ts +9 -9
- package/dist/components/tree/src/tree.mjs +29 -27
- package/dist/components/tree/src/tree.mjs.map +1 -1
- package/dist/components/treeSelect/src/treeSelect.d.ts +38 -35
- package/dist/components/treeSelect/src/treeSelect.mjs +47 -45
- package/dist/components/treeSelect/src/treeSelect.mjs.map +1 -1
- package/dist/components/upload/src/upload.d.ts +1 -1
- package/dist/components/upload/src/upload.mjs +5 -6
- package/dist/components/upload/src/upload.mjs.map +1 -1
- package/dist/components/upload/src/useUpload.mjs +8 -10
- package/dist/components/upload/src/useUpload.mjs.map +1 -1
- package/dist/components/upload/utils/upload.d.ts +1 -1
- package/dist/components/upload/utils/upload.mjs +1 -1
- package/dist/components/upload/utils/upload.mjs.map +1 -1
- package/dist/components/uploadImage/src/uploadImage.d.ts +8 -5
- package/dist/components/uploadImage/src/uploadImage.mjs +18 -13
- package/dist/components/uploadImage/src/uploadImage.mjs.map +1 -1
- package/dist/components/uploadImages/src/uploadImages.d.ts +8 -5
- package/dist/components/uploadImages/src/uploadImages.mjs +16 -11
- package/dist/components/uploadImages/src/uploadImages.mjs.map +1 -1
- package/dist/directives/click-copy/index.d.ts +1 -1
- package/dist/directives/click-copy/index.mjs +5 -9
- package/dist/directives/click-copy/index.mjs.map +1 -1
- package/dist/directives/click-debounce/index.d.ts +1 -1
- package/dist/directives/click-draggable/index.d.ts +1 -1
- package/dist/directives/click-icon-copy/index.d.ts +1 -1
- package/dist/directives/click-icon-copy/index.mjs.map +1 -1
- package/dist/directives/click-longpress/index.d.ts +1 -1
- package/dist/directives/click-throttle/index.d.ts +1 -1
- package/dist/element-plus.mjs +5 -6
- package/dist/element-plus.mjs.map +1 -1
- package/dist/hooks/use-screenFull/index.mjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.global.min.js +4 -4
- package/dist/index.global.min.js.map +1 -1
- package/dist/index.mjs +1 -3
- package/dist/index.mjs.map +1 -1
- package/dist/utils/async/index.mjs +6 -4
- package/dist/utils/async/index.mjs.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/object/index.d.ts +8 -0
- package/dist/utils/object/index.mjs +113 -0
- package/dist/utils/object/index.mjs.map +1 -0
- package/dist/utils/string/index.mjs +19 -11
- package/dist/utils/string/index.mjs.map +1 -1
- package/dist/utils/vue/emits.mjs.map +1 -1
- package/dist/utils/vue/install.mjs.map +1 -1
- package/dist/utils/vue/render.mjs.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 +5 -10
- package/dist/components/table/src/page.type.mjs +0 -45
- package/dist/components/table/src/page.type.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.mjs","names":["update:modelValue","update:label","node-click"],"sources":["../../../../src/components/tree/src/tree.tsx"],"sourcesContent":["import { useVModel } from \"@vueuse/core\";\nimport { computed, defineComponent, nextTick, onMounted, reactive, ref, watch } from \"vue\";\nimport { Expand, Fold } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElInput, ElScrollbar, ElTree, treeEmits, treeProps, useGlobalSize } from \"element-plus\";\nimport { isArray, isBoolean, isEqual, isNull, isNumber, isObject, isString, isUndefined } from \"lodash-unified\";\nimport { addCssUnit, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport type { FilterValue, TreeNodeData } from \"element-plus\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\nimport type { PagedInput } from \"../../table\";\nimport type { FilterNodeMethodFunction, TreeNode } from \"./tree.props\";\nimport type { ElTreeOutput } from \"./tree.type\";\n\n/** FaTree 的运行时 Props 定义。 */\nexport const faTreeProps = {\n\t...treeProps,\n\t/** 树节点筛选方法。 */\n\tfilterNodeMethod: {\n\t\ttype: definePropType<FilterNodeMethodFunction>(Function),\n\t},\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */\n\tnodeKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/** @description 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: String,\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 180,\n\t},\n\t/** @description 默认选择 */\n\tdefaultSelection: [String, Number],\n\t/** @description 标题 */\n\ttitle: String,\n\t/** @description 折叠 */\n\thamburger: Boolean,\n\t/** @description 隐藏全部 */\n\thideAll: Boolean,\n\t/** @description 隐藏过滤 */\n\thideFilter: Boolean,\n\t/** @description 全部值 */\n\tallValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description 树形数据 */\n\tdata: {\n\t\ttype: definePropType<ElTreeOutput[]>(Array),\n\t\tdefault: (): ElTreeOutput[] => [],\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: string | number | PagedInput) => Promise<ElTreeOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput>([String, Number, Object]),\n};\n\n/** FaTree 的运行时 Emits 定义。 */\nexport const faTreeEmits = {\n\t...treeEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object | null | undefined): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isNull(value) || isUndefined(value),\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string): boolean => isString(value) || isNull(value),\n\t/** @description 数据改变 */\n\tdataChangeCallBack: (data: ElTreeOutput[]): boolean => isArray(data),\n\t/** @description 选中数据改变 */\n\tchange: (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent): boolean => true,\n\t/** @description 节点点击 */\n\t\"node-click\": (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance | null, _event: MouseEvent): boolean => true,\n};\n\n/** FaTree 的插槽参数。 */\nexport interface FaTreeSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: TreeNode; data: ElTreeOutput };\n\t/** @description 当数据为空时自定义的内容 */\n\tempty: never;\n\t/** @description 显示内容插槽 */\n\tlabel: { node: TreeNode; data: ElTreeOutput };\n}\n\nexport default defineComponent({\n\tname: \"FaTree\",\n\tprops: faTreeProps,\n\temits: faTreeEmits,\n\tslots: makeSlots<FaTreeSlots>(),\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<string | number | boolean | object | null | undefined>(props.modelValue),\n\t\t\tloading: false,\n\t\t\tsearchValue: withDefineType<string>(),\n\t\t\torgTreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\ttreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\thamburger: props.hamburger || false,\n\t\t\twidth: computed(() => {\n\t\t\t\tif (state.hamburger) {\n\t\t\t\t\treturn \"130px\";\n\t\t\t\t} else {\n\t\t\t\t\tconst width = addCssUnit(props.width);\n\t\t\t\t\tif (_globalSize.value === \"small\") {\n\t\t\t\t\t\treturn `calc(${width} * 0.9)`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t});\n\n\t\t/** @description 只有一层节点 */\n\t\tconst fold = computed<boolean>(() => {\n\t\t\tconst childrenKey = props.props.children ?? \"children\";\n\t\t\treturn state.orgTreeData.every((item) => !Array.isArray(item[childrenKey]) || item[childrenKey].length === 0);\n\t\t});\n\n\t\tconst treeRef = ref<InstanceType<typeof ElTree>>();\n\t\tlet requestVersion = 0;\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\tlet curSelectedData: string | number | undefined;\n\t\t\tif (props.nodeKey) {\n\t\t\t\t// 记录原本选中的值\n\t\t\t\tconst currentKey = treeRef.value?.getCurrentKey();\n\t\t\t\tif (typeof currentKey === \"string\" || typeof currentKey === \"number\") curSelectedData = currentKey;\n\t\t\t}\n\t\t\tlet treeData: ElTreeOutput[];\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = {\n\t\t\t\t\t...(typeof props.initParam === \"object\" && props.initParam !== null ? props.initParam : {}),\n\t\t\t\t\tsearchValue: state.searchValue,\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\tconst responseData = await props.requestApi(params);\n\t\t\t\t\ttreeData = responseData.map((item) => ({ ...item }));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttreeData = props.data.map((item) => ({ ...item }));\n\t\t\t}\n\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\tif (!props.hideAll) {\n\t\t\t\ttreeData.unshift({ [props.nodeKey]: props.allValue, label: \"全部\", value: null, all: true });\n\t\t\t}\n\t\t\tstate.orgTreeData = treeData;\n\t\t\tstate.treeData = treeData;\n\t\t\temit(\"dataChangeCallBack\", state.treeData);\n\t\t\tconst selectedKey = curSelectedData ?? props.modelValue ?? props.defaultSelection;\n\t\t\tif (props.nodeKey && (typeof selectedKey === \"string\" || typeof selectedKey === \"number\")) {\n\t\t\t\tvoid nextTick(() => {\n\t\t\t\t\t// 设置原本选中的值\n\t\t\t\t\ttreeRef.value?.setCurrentKey(selectedKey);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tconst handleHamburgerClick = (): void => {\n\t\t\tif (state.hamburger) {\n\t\t\t\tstate.treeData = state.orgTreeData;\n\t\t\t} else {\n\t\t\t\t// 折叠只显示一级数据\n\t\t\t\tstate.treeData = state.orgTreeData.map((item) => ({ ...item, [props.props.children ?? \"children\"]: [] }));\n\t\t\t}\n\t\t\tstate.hamburger = !state.hamburger;\n\t\t};\n\n\t\tconst handleFilterNode = (value: FilterValue, data: TreeNodeData, child: TreeNode): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tconst isAll: unknown = data[\"all\"];\n\t\t\tconst dataLabel: unknown = data[\"label\"];\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels: unknown[] = isAll ? [dataLabel] : [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level && parentNode) {\n\t\t\t\tlabels = [...labels, parentNode.label];\n\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\tconst filterText = typeof value === \"string\" || typeof value === \"number\" ? String(value) : \"\";\n\t\t\tconst result = labels.some((label) =>\n\t\t\t\ttypeof label === \"string\" || typeof label === \"number\" ? String(label).includes(filterText) : false\n\t\t\t);\n\t\t\tif (props.filterNodeMethod) {\n\t\t\t\treturn result && props.filterNodeMethod(value, data, child);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst handleNodeClick = (data: ElTreeOutput, node: TreeNode, instance: ComponentInternalInstance | null, event: MouseEvent): void => {\n\t\t\tif (!instance) return;\n\t\t\t// 判断是否开启点击展开节点,并且节点是折叠状态,则自动展开,否则需要点击箭头图标才能折叠或开启 'collapseOnClickNode'\n\t\t\tif (props.expandOnClickNode) {\n\t\t\t\tif (!node.expanded) {\n\t\t\t\t\tnode.expand();\n\t\t\t\t} else if (node.expanded && props.collapseOnClickNode) {\n\t\t\t\t\tnode.collapse();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (data[\"all\"] || (node.key !== undefined && node.key !== null)) {\n\t\t\t\tconst value = data[\"all\"] ? props.allValue : node.key;\n\t\t\t\tif (!isEqual(state.value, value)) {\n\t\t\t\t\tstate.value = value;\n\t\t\t\t\tselectedLabel.value = node.label;\n\t\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\t\temit(\"change\", data, node, instance, event);\n\t\t\t\t}\n\t\t\t}\n\t\t\temit(\"node-click\", data, node, instance, event);\n\t\t};\n\n\t\tonMounted(async () => {\n\t\t\tawait loadData();\n\t\t\twatch(\n\t\t\t\t() => props.data,\n\t\t\t\t() => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\treturn loadData();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{ deep: true }\n\t\t\t);\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;\n\t\t\t\tif (typeof newValue === \"string\" || typeof newValue === \"number\") treeRef.value?.setCurrentKey(newValue);\n\t\t\t}\n\t\t);\n\n\t\tconst elTreeProps = useProps(props, treeProps, [\"data\", \"expandOnClickNode\", \"filterNodeMethod\"]);\n\t\tconst elTreeEmits = useEmits(treeEmits, emit, [\"node-click\"]);\n\n\t\tuseRender(() => (\n\t\t\t<div\n\t\t\t\tclass={[\"el-card fa-tree\", `fa-tree-${_globalSize.value}`, { \"fa-tree__fold\": state.hamburger || fold.value }]}\n\t\t\t\tstyle={{ width: state.width }}\n\t\t\t\tvLoading={state.loading}\n\t\t\t>\n\t\t\t\t{(props.title !== undefined || props.hamburger) && (\n\t\t\t\t\t<div class=\"fa-tree__title\">\n\t\t\t\t\t\t{props.title && <h4>{props.title}</h4>}\n\t\t\t\t\t\t{props.hamburger &&\n\t\t\t\t\t\t\t(state.hamburger ? (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"展开\">\n\t\t\t\t\t\t\t\t\t<Expand />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"折叠\">\n\t\t\t\t\t\t\t\t\t<Fold />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!props.hideFilter && (\n\t\t\t\t\t<ElInput\n\t\t\t\t\t\tclass=\"fa-tree__search-input\"\n\t\t\t\t\t\tvModel_trim={state.searchValue}\n\t\t\t\t\t\tplaceholder={state.hamburger ? \"关键字过滤\" : \"输入关键字进行过滤\"}\n\t\t\t\t\t\tclearable={Boolean(state.searchValue)}\n\t\t\t\t\t\tonInput={(value) => treeRef.value?.filter(value)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<ElScrollbar class=\"fa-tree__scrollbar\">\n\t\t\t\t\t<ElTree\n\t\t\t\t\t\t{...elTreeProps.value}\n\t\t\t\t\t\t{...elTreeEmits.value}\n\t\t\t\t\t\tref={treeRef}\n\t\t\t\t\t\tdata={state.treeData}\n\t\t\t\t\t\texpandOnClickNode={props.checkOnClickNode ? false : props.expandOnClickNode}\n\t\t\t\t\t\tfilterNodeMethod={handleFilterNode}\n\t\t\t\t\t\tonNode-click={handleNodeClick}\n\t\t\t\t\t>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: ({ node, data }: { node: TreeNode; data: ElTreeOutput }) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\"el-tree-node__label\"\n\t\t\t\t\t\t\t\t\ttitle={data[\"all\"] ? data.label : node.label}\n\t\t\t\t\t\t\t\t\tstyle={{ paddingLeft: fold.value ? \"3px\" : \"\" }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div>{data[\"all\"] ? data.label : slots.label ? slots.label({ node, data }) : node.label}</div>\n\t\t\t\t\t\t\t\t\t{node.key && data.showQuantity ? <span>[{data.quantity}]</span> : null}\n\t\t\t\t\t\t\t\t\t{!data[\"all\"] && slots.default && <span>{slots.default({ node, data })}</span>}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t...(slots.empty && { empty: (): VNode[] => slots.empty?.() ?? [] }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</ElTree>\n\t\t\t\t</ElScrollbar>\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 过滤所有树节点,过滤后的节点将被隐藏 */\n\t\t\tfilter: computed(() => treeRef.value?.filter),\n\t\t\t/** @description 获取节点的唯一标识。 */\n\t\t\tgetNodeKey: computed(() => treeRef.value?.getNodeKey),\n\t\t\t/** @description 获取指定节点的路径数据。 */\n\t\t\tgetNodePath: computed(() => treeRef.value?.getNodePath),\n\t\t\t/** @description 为节点设置新数据,只有当设置 node-key 属性的时候才可用 */\n\t\t\tupdateKeyChildren: computed(() => treeRef.value?.updateKeyChildren),\n\t\t\t/** @description 如果节点可以被选中,(show-checkbox 为 true), 本方法将返回当前选中节点的数组 */\n\t\t\tgetCheckedNodes: computed(() => treeRef.value?.getCheckedNodes),\n\t\t\t/** @description 设置目前勾选的节点,使用此方法必须提前设置 node-key 属性 */\n\t\t\tsetCheckedNodes: computed(() => treeRef.value?.setCheckedNodes),\n\t\t\t/** @description \t若节点可用被选中 (show-checkbox 为 true), 它将返回当前选中节点 key 的数组 */\n\t\t\tgetCheckedKeys: computed(() => treeRef.value?.getCheckedKeys),\n\t\t\t/** @description 设置目前选中的节点,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCheckedKeys: computed(() => treeRef.value?.setCheckedKeys),\n\t\t\t/** @description 设置节点是否被选中, 使用此方法必须设置 node-key 属性 */\n\t\t\tsetChecked: computed(() => treeRef.value?.setChecked),\n\t\t\t/** @description 如果节点可用被选中 (show-checkbox 为 true), 它将返回当前半选中的节点组成的数组 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeRef.value?.getHalfCheckedNodes),\n\t\t\t/** @description 若节点可被选中(show-checkbox 为 true),则返回目前半选中的节点的 key 所组成的数组 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeRef.value?.getHalfCheckedKeys),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentKey: computed(() => treeRef.value?.getCurrentKey),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentNode: computed(() => treeRef.value?.getCurrentNode),\n\t\t\t/** @description 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentKey: computed(() => treeRef.value?.setCurrentKey),\n\t\t\t/** @description 设置节点为选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentNode: computed(() => treeRef.value?.setCurrentNode),\n\t\t\t/** @description 根据 data 或者 key 拿到 Tree 组件中的 node */\n\t\t\tgetNode: computed(() => treeRef.value?.getNode),\n\t\t\t/** @description 删除 Tree 中的一个节点,使用此方法必须设置 node-key 属性 */\n\t\t\tremove: computed(() => treeRef.value?.remove),\n\t\t\t/** @description 为 Tree 中的一个节点追加一个子节点 */\n\t\t\tappend: computed(() => treeRef.value?.append),\n\t\t\t/** @description 在 Tree 中给定节点前插入一个节点 */\n\t\t\tinsertBefore: computed(() => treeRef.value?.insertBefore),\n\t\t\t/** @description 在 Tree 中给定节点后插入一个节点 */\n\t\t\tinsertAfter: computed(() => treeRef.value?.insertAfter),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;AAaA,MAAa,cAAc;CAC1B,GAAG;;CAEH,kBAAkB,EACjB,MAAM,eAAyC,QAAQ,EACxD;;CAEA,UAAU;EACT,MAAM;EACN,SAAS,KAAA;CACV;;CAEA,SAAS;EACR,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,qBAAqB;;CAErB,YAAY;EACX,MAAM,eAA0D;GAAC;GAAQ;GAAQ;GAAS;EAAM,CAAC;EACjG,SAAS,KAAA;CACV;;CAEA,OAAO;;CAEP,OAAO;EACN,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,kBAAkB,CAAC,QAA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,OAAO,iBAAiB;;GAElE,iBAAiB,eAAe,QAAQ,OAAO,eAAe;;GAE9D,iBAAiB,eAAe,QAAQ,OAAO,eAAe;;GAE9D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,YAAY,eAAe,QAAQ,OAAO,UAAU;;GAEpD,qBAAqB,eAAe,QAAQ,OAAO,mBAAmB;;GAEtE,oBAAoB,eAAe,QAAQ,OAAO,kBAAkB;;GAEpE,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,SAAS,eAAe,QAAQ,OAAO,OAAO;;GAE9C,QAAQ,eAAe,QAAQ,OAAO,MAAM;;GAE5C,QAAQ,eAAe,QAAQ,OAAO,MAAM;;GAE5C,cAAc,eAAe,QAAQ,OAAO,YAAY;;GAExD,aAAa,eAAe,QAAQ,OAAO,WAAW;;GAEtD,SAAS,eAAe,MAAM,OAAO;;GAErC,SAAS;EACV,CAAC;CACF;AACD,CAAC"}
|
|
1
|
+
{"version":3,"file":"tree.mjs","names":["update:modelValue","update:label","node-click"],"sources":["../../../../src/components/tree/src/tree.tsx"],"sourcesContent":["import { computed, defineComponent, nextTick, onMounted, reactive, shallowRef, useModel, watch } from \"vue\";\nimport { Expand, Fold } from \"@element-plus/icons-vue\";\nimport { ElIcon, ElInput, ElScrollbar, ElTree, treeEmits, treeProps, useGlobalSize } from \"element-plus\";\nimport { addCssUnit, definePropType, isEqual, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"../../../utils\";\nimport type { FilterValue, TreeNodeData } from \"element-plus\";\nimport type { ComponentInternalInstance } from \"vue\";\nimport type { PagedInput } from \"../../table\";\nimport type { FilterNodeMethodFunction, TreeNode } from \"./tree.props\";\nimport type { ElTreeOutput } from \"./tree.type\";\n\n/** FaTree 的运行时 Props 定义。 */\nexport const faTreeProps = {\n\t...treeProps,\n\t/** 树节点筛选方法。 */\n\tfilterNodeMethod: {\n\t\ttype: definePropType<FilterNodeMethodFunction>(Function),\n\t},\n\t/** @description whether Select is disabled 重载使其支持 ElForm*/\n\tdisabled: {\n\t\ttype: Boolean,\n\t\tdefault: undefined,\n\t},\n\t/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */\n\tnodeKey: {\n\t\ttype: String,\n\t\tdefault: \"value\",\n\t},\n\t/** @description 是否默认展开所有节点 */\n\tdefaultExpandAll: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否在点击节点的时候选中节点 */\n\tcheckOnClickNode: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 是否高亮当前选中节点 */\n\thighlightCurrent: {\n\t\ttype: Boolean,\n\t\tdefault: true,\n\t},\n\t/** @description 点击折叠节点,需要开启 'expandOnClickNode' */\n\tcollapseOnClickNode: Boolean,\n\t/** @description v-model绑定值 */\n\tmodelValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description v-model:label绑定值 */\n\tlabel: String,\n\t/** @description 宽度 */\n\twidth: {\n\t\ttype: [String, Number],\n\t\tdefault: 180,\n\t},\n\t/** @description 默认选择 */\n\tdefaultSelection: [String, Number],\n\t/** @description 标题 */\n\ttitle: String,\n\t/** @description 折叠 */\n\thamburger: Boolean,\n\t/** @description 隐藏全部 */\n\thideAll: Boolean,\n\t/** @description 隐藏过滤 */\n\thideFilter: Boolean,\n\t/** @description 全部值 */\n\tallValue: {\n\t\ttype: definePropType<string | number | boolean | object | null>([String, Number, Boolean, Object]),\n\t\tdefault: undefined,\n\t},\n\t/** @description 树形数据 */\n\tdata: {\n\t\ttype: definePropType<ElTreeOutput[]>(Array),\n\t\tdefault: () => [],\n\t},\n\t/** @description 请求api */\n\trequestApi: {\n\t\ttype: definePropType<(params?: string | number | PagedInput) => Promise<ElTreeOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | PagedInput | null>([String, Number, Object]),\n};\n\n/** FaTree 的运行时 Emits 定义。 */\nexport const faTreeEmits = {\n\t...treeEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object | null | undefined) =>\n\t\ttypeof value === \"string\" ||\n\t\ttypeof value === \"number\" ||\n\t\ttypeof value === \"boolean\" ||\n\t\t(typeof value === \"object\" && value !== null) ||\n\t\tvalue == null,\n\t/** @description v-model:label 回调 */\n\t\"update:label\": (value: string) => typeof value === \"string\" || value === null,\n\t/** @description 数据改变 */\n\tdataChange: (data: ElTreeOutput[]) => Array.isArray(data),\n\t/** @description 选中数据改变 */\n\tchange: (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance, _event: MouseEvent) => true,\n\t/** @description 节点点击 */\n\t\"node-click\": (_data: ElTreeOutput, _node: TreeNode, _instance: ComponentInternalInstance | null, _event: MouseEvent) => true,\n};\n\n/** FaTree 的插槽参数。 */\nexport interface FaTreeSlots extends Record<string, unknown> {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: TreeNode; data: ElTreeOutput };\n\t/** @description 当数据为空时自定义的内容 */\n\tempty: never;\n\t/** @description 显示内容插槽 */\n\tlabel: { node: TreeNode; data: ElTreeOutput };\n}\n\nexport default defineComponent({\n\tname: \"FaTree\",\n\tprops: faTreeProps,\n\temits: faTreeEmits,\n\tslots: makeSlots<FaTreeSlots>(),\n\tsetup(props, { slots, emit, expose }) {\n\t\tconst selectedLabel = useModel(props, \"label\");\n\n\t\tconst globalSize = useGlobalSize();\n\t\tconst treeRef = shallowRef<InstanceType<typeof ElTree> | null>(null);\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | number | boolean | object | null | undefined>(),\n\t\t\tloading: false,\n\t\t\tsearchValue: withDefineType<string>(),\n\t\t\toriginalTreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\ttreeData: withDefineType<ElTreeOutput[]>([]),\n\t\t\thamburger: false,\n\t\t\twidth: computed(() => {\n\t\t\t\tif (state.hamburger) {\n\t\t\t\t\treturn \"130px\";\n\t\t\t\t} else {\n\t\t\t\t\tconst width = addCssUnit(props.width);\n\t\t\t\t\tif (globalSize.value === \"small\") {\n\t\t\t\t\t\treturn `calc(${width} * 0.9)`;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn width;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}),\n\t\t});\n\t\tlet requestVersion = 0;\n\n\t\t/** @description 只有一层节点 */\n\t\tconst fold = computed<boolean>(() => {\n\t\t\tconst childrenKey = props.props.children ?? \"children\";\n\t\t\treturn state.originalTreeData.every((item) => !Array.isArray(item[childrenKey]) || item[childrenKey].length === 0);\n\t\t});\n\n\t\tconst loadData = async () => {\n\t\t\tconst currentRequestVersion = ++requestVersion;\n\t\t\tlet curSelectedData: string | number | undefined;\n\t\t\tif (props.nodeKey) {\n\t\t\t\t// 记录原本选中的值\n\t\t\t\tconst currentKey = treeRef.value?.getCurrentKey();\n\t\t\t\tif (typeof currentKey === \"string\" || typeof currentKey === \"number\") curSelectedData = currentKey;\n\t\t\t}\n\t\t\tlet treeData: ElTreeOutput[];\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = {\n\t\t\t\t\t...(typeof props.initParam === \"object\" && props.initParam !== null ? props.initParam : {}),\n\t\t\t\t\tsearchValue: state.searchValue,\n\t\t\t\t};\n\t\t\t\ttry {\n\t\t\t\t\tconst responseData = await props.requestApi(params);\n\t\t\t\t\ttreeData = responseData.map((item) => ({ ...item }));\n\t\t\t\t} catch (error) {\n\t\t\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\t\t\tthrow error;\n\t\t\t\t} finally {\n\t\t\t\t\tif (currentRequestVersion === requestVersion) state.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttreeData = props.data.map((item) => ({ ...item }));\n\t\t\t}\n\t\t\tif (currentRequestVersion !== requestVersion) return;\n\t\t\tif (!props.hideAll) {\n\t\t\t\ttreeData.unshift({ [props.nodeKey]: props.allValue, label: \"全部\", value: null, all: true });\n\t\t\t}\n\t\t\tstate.originalTreeData = treeData;\n\t\t\tstate.treeData = treeData;\n\t\t\temit(\"dataChange\", state.treeData);\n\t\t\tconst selectedKey = curSelectedData ?? props.modelValue ?? props.defaultSelection;\n\t\t\tif (props.nodeKey && (typeof selectedKey === \"string\" || typeof selectedKey === \"number\")) {\n\t\t\t\tnextTick(() => {\n\t\t\t\t\t// 设置原本选中的值\n\t\t\t\t\ttreeRef.value?.setCurrentKey(selectedKey);\n\t\t\t\t});\n\t\t\t}\n\t\t};\n\n\t\tconst handleHamburgerClick = () => {\n\t\t\tif (state.hamburger) {\n\t\t\t\tstate.treeData = state.originalTreeData;\n\t\t\t} else {\n\t\t\t\t// 折叠只显示一级数据\n\t\t\t\tstate.treeData = state.originalTreeData.map((item) => ({ ...item, [props.props.children ?? \"children\"]: [] }));\n\t\t\t}\n\t\t\tstate.hamburger = !state.hamburger;\n\t\t};\n\n\t\tconst handleFilterNode = (value: FilterValue, data: TreeNodeData, child: TreeNode) => {\n\t\t\tif (!value) return true;\n\t\t\tconst isAll: unknown = data[\"all\"];\n\t\t\tconst dataLabel: unknown = data[\"label\"];\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels: unknown[] = isAll ? [dataLabel] : [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level && parentNode) {\n\t\t\t\tlabels = [...labels, parentNode.label];\n\t\t\t\tparentNode = parentNode.parent;\n\t\t\t\tlevel++;\n\t\t\t}\n\t\t\tconst filterText = typeof value === \"string\" || typeof value === \"number\" ? String(value) : \"\";\n\t\t\tconst result = labels.some((label) =>\n\t\t\t\ttypeof label === \"string\" || typeof label === \"number\" ? String(label).includes(filterText) : false\n\t\t\t);\n\t\t\tif (props.filterNodeMethod) {\n\t\t\t\treturn result && props.filterNodeMethod(value, data, child);\n\t\t\t}\n\t\t\treturn result;\n\t\t};\n\n\t\tconst handleNodeClick = (data: ElTreeOutput, node: TreeNode, instance: ComponentInternalInstance | null, event: MouseEvent) => {\n\t\t\tif (!instance) return;\n\t\t\t// 判断是否开启点击展开节点,并且节点是折叠状态,则自动展开,否则需要点击箭头图标才能折叠或开启 'collapseOnClickNode'\n\t\t\tif (props.expandOnClickNode) {\n\t\t\t\tif (!node.expanded) {\n\t\t\t\t\tnode.expand();\n\t\t\t\t} else if (props.collapseOnClickNode) {\n\t\t\t\t\tnode.collapse();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (data[\"all\"] || (node.key !== undefined && node.key !== null)) {\n\t\t\t\tconst value = data[\"all\"] ? props.allValue : node.key;\n\t\t\t\tif (!isEqual(state.value, value)) {\n\t\t\t\t\tstate.value = value;\n\t\t\t\t\tselectedLabel.value = node.label;\n\t\t\t\t\temit(\"update:modelValue\", value);\n\t\t\t\t\temit(\"change\", data, node, instance, event);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// eslint-disable-next-line vue/custom-event-name-casing -- Element Plus 的公开事件名为 node-click,需要保持原始名称透传。\n\t\t\temit(\"node-click\", data, node, instance, event);\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;\n\t\t\t\tif (typeof newValue === \"string\" || typeof newValue === \"number\") treeRef.value?.setCurrentKey(newValue);\n\t\t\t},\n\t\t\t{ immediate: true }\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.hamburger,\n\t\t\t(newValue) => {\n\t\t\t\tstate.hamburger = newValue;\n\t\t\t},\n\t\t\t{ immediate: true }\n\t\t);\n\n\t\twatch(\n\t\t\t() => props.data,\n\t\t\t() => {\n\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\treturn loadData();\n\t\t\t\t}\n\t\t\t},\n\t\t\t{ deep: true }\n\t\t);\n\n\t\tonMounted(async () => {\n\t\t\tawait loadData();\n\t\t});\n\n\t\tconst elTreeProps = useProps(props, treeProps, [\"data\", \"expandOnClickNode\", \"filterNodeMethod\"]);\n\t\tconst elTreeEmits = useEmits(treeEmits, emit, [\"node-click\"]);\n\n\t\tuseRender(() => (\n\t\t\t<div\n\t\t\t\tclass={[\"el-card fa-tree\", `fa-tree-${globalSize.value}`, { \"fa-tree__fold\": state.hamburger || fold.value }]}\n\t\t\t\tstyle={{ width: state.width }}\n\t\t\t\tvLoading={state.loading}\n\t\t\t>\n\t\t\t\t{(props.title !== undefined || props.hamburger) && (\n\t\t\t\t\t<div class=\"fa-tree__title\">\n\t\t\t\t\t\t{props.title && <h4>{props.title}</h4>}\n\t\t\t\t\t\t{props.hamburger &&\n\t\t\t\t\t\t\t(state.hamburger ? (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"展开\">\n\t\t\t\t\t\t\t\t\t<Expand />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<ElIcon onClick={handleHamburgerClick} title=\"折叠\">\n\t\t\t\t\t\t\t\t\t<Fold />\n\t\t\t\t\t\t\t\t</ElIcon>\n\t\t\t\t\t\t\t))}\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t{!props.hideFilter && (\n\t\t\t\t\t<ElInput\n\t\t\t\t\t\tclass=\"fa-tree__search-input\"\n\t\t\t\t\t\tvModel_trim={state.searchValue}\n\t\t\t\t\t\tplaceholder={state.hamburger ? \"关键字过滤\" : \"输入关键字进行过滤\"}\n\t\t\t\t\t\tclearable={Boolean(state.searchValue)}\n\t\t\t\t\t\tonInput={(value) => treeRef.value?.filter(value)}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t\t<ElScrollbar class=\"fa-tree__scrollbar\">\n\t\t\t\t\t<ElTree\n\t\t\t\t\t\t{...elTreeProps.value}\n\t\t\t\t\t\t{...elTreeEmits.value}\n\t\t\t\t\t\tref={treeRef}\n\t\t\t\t\t\tdata={state.treeData}\n\t\t\t\t\t\texpandOnClickNode={props.checkOnClickNode ? false : props.expandOnClickNode}\n\t\t\t\t\t\tfilterNodeMethod={handleFilterNode}\n\t\t\t\t\t\tonNode-click={handleNodeClick}\n\t\t\t\t\t>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: ({ node, data }: { node: TreeNode; data: ElTreeOutput }) => (\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tclass=\"el-tree-node__label\"\n\t\t\t\t\t\t\t\t\ttitle={data[\"all\"] ? data.label : node.label}\n\t\t\t\t\t\t\t\t\tstyle={{ paddingLeft: fold.value ? \"3px\" : \"\" }}\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div>{data[\"all\"] ? data.label : slots.label ? slots.label({ node, data }) : node.label}</div>\n\t\t\t\t\t\t\t\t\t{node.key && data.showQuantity ? <span>[{data.quantity}]</span> : null}\n\t\t\t\t\t\t\t\t\t{!data[\"all\"] && slots.default && <span>{slots.default({ node, data })}</span>}\n\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t...(slots.empty && { empty: () => slots.empty?.() ?? [] }),\n\t\t\t\t\t\t}}\n\t\t\t\t\t</ElTree>\n\t\t\t\t</ElScrollbar>\n\t\t\t</div>\n\t\t));\n\n\t\treturn useExpose(expose, {\n\t\t\t/** @description 过滤所有树节点,过滤后的节点将被隐藏 */\n\t\t\tfilter: computed(() => treeRef.value?.filter),\n\t\t\t/** @description 获取节点的唯一标识。 */\n\t\t\tgetNodeKey: computed(() => treeRef.value?.getNodeKey),\n\t\t\t/** @description 获取指定节点的路径数据。 */\n\t\t\tgetNodePath: computed(() => treeRef.value?.getNodePath),\n\t\t\t/** @description 为节点设置新数据,只有当设置 node-key 属性的时候才可用 */\n\t\t\tupdateKeyChildren: computed(() => treeRef.value?.updateKeyChildren),\n\t\t\t/** @description 如果节点可以被选中,(show-checkbox 为 true), 本方法将返回当前选中节点的数组 */\n\t\t\tgetCheckedNodes: computed(() => treeRef.value?.getCheckedNodes),\n\t\t\t/** @description 设置目前勾选的节点,使用此方法必须提前设置 node-key 属性 */\n\t\t\tsetCheckedNodes: computed(() => treeRef.value?.setCheckedNodes),\n\t\t\t/** @description \t若节点可用被选中 (show-checkbox 为 true), 它将返回当前选中节点 key 的数组 */\n\t\t\tgetCheckedKeys: computed(() => treeRef.value?.getCheckedKeys),\n\t\t\t/** @description 设置目前选中的节点,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCheckedKeys: computed(() => treeRef.value?.setCheckedKeys),\n\t\t\t/** @description 设置节点是否被选中, 使用此方法必须设置 node-key 属性 */\n\t\t\tsetChecked: computed(() => treeRef.value?.setChecked),\n\t\t\t/** @description 如果节点可用被选中 (show-checkbox 为 true), 它将返回当前半选中的节点组成的数组 */\n\t\t\tgetHalfCheckedNodes: computed(() => treeRef.value?.getHalfCheckedNodes),\n\t\t\t/** @description 若节点可被选中(show-checkbox 为 true),则返回目前半选中的节点的 key 所组成的数组 */\n\t\t\tgetHalfCheckedKeys: computed(() => treeRef.value?.getHalfCheckedKeys),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentKey: computed(() => treeRef.value?.getCurrentKey),\n\t\t\t/** @description 返回当前被选中节点的数据 (如果没有则返回 null) */\n\t\t\tgetCurrentNode: computed(() => treeRef.value?.getCurrentNode),\n\t\t\t/** @description 通过 key 设置某个节点的当前选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentKey: computed(() => treeRef.value?.setCurrentKey),\n\t\t\t/** @description 设置节点为选中状态,使用此方法必须设置 node-key 属性 */\n\t\t\tsetCurrentNode: computed(() => treeRef.value?.setCurrentNode),\n\t\t\t/** @description 根据 data 或者 key 拿到 Tree 组件中的 node */\n\t\t\tgetNode: computed(() => treeRef.value?.getNode),\n\t\t\t/** @description 删除 Tree 中的一个节点,使用此方法必须设置 node-key 属性 */\n\t\t\tremove: computed(() => treeRef.value?.remove),\n\t\t\t/** @description 为 Tree 中的一个节点追加一个子节点 */\n\t\t\tappend: computed(() => treeRef.value?.append),\n\t\t\t/** @description 在 Tree 中给定节点前插入一个节点 */\n\t\t\tinsertBefore: computed(() => treeRef.value?.insertBefore),\n\t\t\t/** @description 在 Tree 中给定节点后插入一个节点 */\n\t\t\tinsertAfter: computed(() => treeRef.value?.insertAfter),\n\t\t\t/** @description 加载状态 */\n\t\t\tloading: computed(() => state.loading),\n\t\t\t/** @description 刷新 */\n\t\t\trefresh: loadData,\n\t\t});\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;AAWA,MAAa,cAAc;CAC1B,GAAG;;CAEH,kBAAkB,EACjB,MAAM,eAAyC,QAAQ,EACxD;;CAEA,UAAU;EACT,MAAM;EACN,SAAS,KAAA;CACV;;CAEA,SAAS;EACR,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,kBAAkB;EACjB,MAAM;EACN,SAAS;CACV;;CAEA,qBAAqB;;CAErB,YAAY;EACX,MAAM,eAA0D;GAAC;GAAQ;GAAQ;GAAS;EAAM,CAAC;EACjG,SAAS,KAAA;CACV;;CAEA,OAAO;;CAEP,OAAO;EACN,MAAM,CAAC,QAAQ,MAAM;EACrB,SAAS;CACV;;CAEA,kBAAkB,CAAC,QAAQ,MAAM;;CAEjC,OAAO;;CAEP,WAAW;;CAEX,SAAS;;CAET,YAAY;;CAEZ,UAAU;EACT,MAAM,eAA0D;GAAC;GAAQ;GAAQ;GAAS;EAAM,CAAC;EACjG,SAAS,KAAA;CACV;;CAEA,MAAM;EACL,MAAM,eAA+B,KAAK;EAC1C,eAAe,CAAA;CAChB;;CAEA,YAAY,EACX,MAAM,eAAmF,QAAQ,EAClG;;C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AAqB,eAAe,QAAQ,OAAO,mBAAmB;;GAEtE,oBAAoB,eAAe,QAAQ,OAAO,kBAAkB;;GAEpE,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,eAAe,eAAe,QAAQ,OAAO,aAAa;;GAE1D,gBAAgB,eAAe,QAAQ,OAAO,cAAc;;GAE5D,SAAS,eAAe,QAAQ,OAAO,OAAO;;GAE9C,QAAQ,eAAe,QAAQ,OAAO,MAAM;;GAE5C,QAAQ,eAAe,QAAQ,OAAO,MAAM;;GAE5C,cAAc,eAAe,QAAQ,OAAO,YAAY;;GAExD,aAAa,eAAe,QAAQ,OAAO,WAAW;;GAEtD,SAAS,eAAe,MAAM,OAAO;;GAErC,SAAS;EACV,CAAC;CACF;AACD,CAAC"}
|
|
@@ -20,11 +20,7 @@ export declare const faTreeSelectProps: {
|
|
|
20
20
|
currentLabel: string | number;
|
|
21
21
|
isDisabled: boolean;
|
|
22
22
|
}[]>;
|
|
23
|
-
default:
|
|
24
|
-
value: string | number | boolean | object;
|
|
25
|
-
currentLabel: string | number;
|
|
26
|
-
isDisabled: boolean;
|
|
27
|
-
}[];
|
|
23
|
+
default: () => never[];
|
|
28
24
|
};
|
|
29
25
|
/** @description whether Select is disabled 重载使其支持 ElForm*/
|
|
30
26
|
disabled: {
|
|
@@ -104,19 +100,24 @@ export declare const faTreeSelectProps: {
|
|
|
104
100
|
/** @description 配置选项 */
|
|
105
101
|
props: {
|
|
106
102
|
type: import("vue").PropType<SelectComponentProps>;
|
|
107
|
-
default: () =>
|
|
103
|
+
default: () => {
|
|
104
|
+
label: string;
|
|
105
|
+
hide: string;
|
|
106
|
+
disabled: string;
|
|
107
|
+
children: string;
|
|
108
|
+
};
|
|
108
109
|
};
|
|
109
110
|
/** @description 下拉框数据 */
|
|
110
111
|
data: {
|
|
111
112
|
type: import("vue").PropType<ElSelectorOutput<ElSelectorValue, any>[]>;
|
|
112
|
-
default: () =>
|
|
113
|
+
default: () => never[];
|
|
113
114
|
};
|
|
114
115
|
/** @description 请求api */
|
|
115
116
|
requestApi: {
|
|
116
117
|
type: import("vue").PropType<(params?: string | number | PagedInput) => Promise<ElSelectorOutput[]>>;
|
|
117
118
|
};
|
|
118
119
|
/** 初始化参数 */
|
|
119
|
-
initParam: import("vue").PropType<string | number | PagedInput>;
|
|
120
|
+
initParam: import("vue").PropType<string | number | PagedInput | null>;
|
|
120
121
|
emptyText: {
|
|
121
122
|
readonly type: import("vue").PropType<string>;
|
|
122
123
|
readonly required: false;
|
|
@@ -230,7 +231,7 @@ export declare const faTreeSelectProps: {
|
|
|
230
231
|
maxCollapseTags: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
231
232
|
teleported: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
232
233
|
persistent: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
233
|
-
clearIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...
|
|
234
|
+
clearIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
|
|
234
235
|
fitInputWidth: BooleanConstructor;
|
|
235
236
|
suffixIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
|
|
236
237
|
tagType: {
|
|
@@ -270,13 +271,13 @@ export declare const faTreeSelectProps: {
|
|
|
270
271
|
/** FaTreeSelect 的运行时 Emits 定义。 */
|
|
271
272
|
export declare const faTreeSelectEmits: {
|
|
272
273
|
/** @description v-model 回调 */
|
|
273
|
-
"update:modelValue": (value: ElSelectorModelValue) => boolean;
|
|
274
|
+
"update:modelValue": (value: ElSelectorModelValue) => value is string | number | boolean | object | ElSelectorValue[] | null | undefined;
|
|
274
275
|
/** @description 选中数据改变 */
|
|
275
276
|
change: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => boolean;
|
|
276
277
|
/** @description v-model:label 回调 */
|
|
277
278
|
"update:label": (value: string | string[] | null) => boolean;
|
|
278
279
|
/** @description 数据改变 */
|
|
279
|
-
|
|
280
|
+
dataChange: (data: ElSelectorOutput[]) => boolean;
|
|
280
281
|
/** @description 节点点击 */
|
|
281
282
|
"node-click": (_data: ElSelectorOutput, _node: TreeNode, _instance: ComponentInternalInstance | null) => boolean;
|
|
282
283
|
'check-change': (data: any, checked: boolean, indeterminate: boolean) => any;
|
|
@@ -342,11 +343,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
342
343
|
currentLabel: string | number;
|
|
343
344
|
isDisabled: boolean;
|
|
344
345
|
}[]>;
|
|
345
|
-
default:
|
|
346
|
-
value: string | number | boolean | object;
|
|
347
|
-
currentLabel: string | number;
|
|
348
|
-
isDisabled: boolean;
|
|
349
|
-
}[];
|
|
346
|
+
default: () => never[];
|
|
350
347
|
};
|
|
351
348
|
/** @description whether Select is disabled 重载使其支持 ElForm*/
|
|
352
349
|
disabled: {
|
|
@@ -426,19 +423,24 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
426
423
|
/** @description 配置选项 */
|
|
427
424
|
props: {
|
|
428
425
|
type: import("vue").PropType<SelectComponentProps>;
|
|
429
|
-
default: () =>
|
|
426
|
+
default: () => {
|
|
427
|
+
label: string;
|
|
428
|
+
hide: string;
|
|
429
|
+
disabled: string;
|
|
430
|
+
children: string;
|
|
431
|
+
};
|
|
430
432
|
};
|
|
431
433
|
/** @description 下拉框数据 */
|
|
432
434
|
data: {
|
|
433
435
|
type: import("vue").PropType<ElSelectorOutput<ElSelectorValue, any>[]>;
|
|
434
|
-
default: () =>
|
|
436
|
+
default: () => never[];
|
|
435
437
|
};
|
|
436
438
|
/** @description 请求api */
|
|
437
439
|
requestApi: {
|
|
438
440
|
type: import("vue").PropType<(params?: string | number | PagedInput) => Promise<ElSelectorOutput[]>>;
|
|
439
441
|
};
|
|
440
442
|
/** 初始化参数 */
|
|
441
|
-
initParam: import("vue").PropType<string | number | PagedInput>;
|
|
443
|
+
initParam: import("vue").PropType<string | number | PagedInput | null>;
|
|
442
444
|
emptyText: {
|
|
443
445
|
readonly type: import("vue").PropType<string>;
|
|
444
446
|
readonly required: false;
|
|
@@ -552,7 +554,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
552
554
|
maxCollapseTags: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
553
555
|
teleported: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
554
556
|
persistent: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
555
|
-
clearIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...
|
|
557
|
+
clearIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
|
|
556
558
|
fitInputWidth: BooleanConstructor;
|
|
557
559
|
suffixIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
|
|
558
560
|
tagType: {
|
|
@@ -645,13 +647,13 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
645
647
|
clearSelection: () => void;
|
|
646
648
|
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
647
649
|
/** @description v-model 回调 */
|
|
648
|
-
"update:modelValue": (value: ElSelectorModelValue) => boolean;
|
|
650
|
+
"update:modelValue": (value: ElSelectorModelValue) => value is string | number | boolean | object | ElSelectorValue[] | null | undefined;
|
|
649
651
|
/** @description 选中数据改变 */
|
|
650
652
|
change: (_data: ElSelectorOutput | ElSelectorOutput[] | null, _value?: ElSelectorModelValue) => boolean;
|
|
651
653
|
/** @description v-model:label 回调 */
|
|
652
654
|
"update:label": (value: string | string[] | null) => boolean;
|
|
653
655
|
/** @description 数据改变 */
|
|
654
|
-
|
|
656
|
+
dataChange: (data: ElSelectorOutput[]) => boolean;
|
|
655
657
|
/** @description 节点点击 */
|
|
656
658
|
"node-click": (_data: ElSelectorOutput, _node: TreeNode, _instance: ComponentInternalInstance | null) => boolean;
|
|
657
659
|
'check-change': (data: any, checked: boolean, indeterminate: boolean) => any;
|
|
@@ -691,11 +693,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
691
693
|
currentLabel: string | number;
|
|
692
694
|
isDisabled: boolean;
|
|
693
695
|
}[]>;
|
|
694
|
-
default:
|
|
695
|
-
value: string | number | boolean | object;
|
|
696
|
-
currentLabel: string | number;
|
|
697
|
-
isDisabled: boolean;
|
|
698
|
-
}[];
|
|
696
|
+
default: () => never[];
|
|
699
697
|
};
|
|
700
698
|
/** @description whether Select is disabled 重载使其支持 ElForm*/
|
|
701
699
|
disabled: {
|
|
@@ -775,19 +773,24 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
775
773
|
/** @description 配置选项 */
|
|
776
774
|
props: {
|
|
777
775
|
type: import("vue").PropType<SelectComponentProps>;
|
|
778
|
-
default: () =>
|
|
776
|
+
default: () => {
|
|
777
|
+
label: string;
|
|
778
|
+
hide: string;
|
|
779
|
+
disabled: string;
|
|
780
|
+
children: string;
|
|
781
|
+
};
|
|
779
782
|
};
|
|
780
783
|
/** @description 下拉框数据 */
|
|
781
784
|
data: {
|
|
782
785
|
type: import("vue").PropType<ElSelectorOutput<ElSelectorValue, any>[]>;
|
|
783
|
-
default: () =>
|
|
786
|
+
default: () => never[];
|
|
784
787
|
};
|
|
785
788
|
/** @description 请求api */
|
|
786
789
|
requestApi: {
|
|
787
790
|
type: import("vue").PropType<(params?: string | number | PagedInput) => Promise<ElSelectorOutput[]>>;
|
|
788
791
|
};
|
|
789
792
|
/** 初始化参数 */
|
|
790
|
-
initParam: import("vue").PropType<string | number | PagedInput>;
|
|
793
|
+
initParam: import("vue").PropType<string | number | PagedInput | null>;
|
|
791
794
|
emptyText: {
|
|
792
795
|
readonly type: import("vue").PropType<string>;
|
|
793
796
|
readonly required: false;
|
|
@@ -901,7 +904,7 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
901
904
|
maxCollapseTags: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<NumberConstructor, unknown, unknown, number, boolean>;
|
|
902
905
|
teleported: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, true, boolean>;
|
|
903
906
|
persistent: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<BooleanConstructor, unknown, unknown, boolean, boolean>;
|
|
904
|
-
clearIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...
|
|
907
|
+
clearIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
|
|
905
908
|
fitInputWidth: BooleanConstructor;
|
|
906
909
|
suffixIcon: import("element-plus/es/utils/vue/props/types.mjs").EpPropFinalized<(new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component) | (((new (...args: any[]) => (string | import("vue").Component) & {}) | (() => string | import("vue").Component)) | null)[], unknown, unknown, import("vue").DefineComponent<{}, void, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>, boolean>;
|
|
907
910
|
tagType: {
|
|
@@ -938,16 +941,16 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
938
941
|
__epPropKey: true;
|
|
939
942
|
};
|
|
940
943
|
}>> & Readonly<{
|
|
941
|
-
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
942
|
-
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
943
944
|
onClear?: (() => any) | undefined;
|
|
944
945
|
onChange?: ((_data: ElSelectorOutput<ElSelectorValue, any> | ElSelectorOutput<ElSelectorValue, any>[] | null, _value?: ElSelectorModelValue) => any) | undefined;
|
|
945
946
|
"onUpdate:modelValue"?: ((value: ElSelectorModelValue) => any) | undefined;
|
|
947
|
+
onFocus?: ((evt: FocusEvent) => any) | undefined;
|
|
948
|
+
onBlur?: ((evt: FocusEvent) => any) | undefined;
|
|
946
949
|
"onEnd-reached"?: ((direction: import("element-plus").ScrollbarDirection) => any) | undefined;
|
|
947
950
|
"onCurrent-change"?: ((data: any, node: import("element-plus/es/components/tree/src/model/node.mjs").default | null) => any) | undefined;
|
|
948
951
|
"onVisible-change"?: ((visible: boolean) => any) | undefined;
|
|
949
952
|
"onUpdate:label"?: ((value: string | string[] | null) => any) | undefined;
|
|
950
|
-
|
|
953
|
+
onDataChange?: ((data: ElSelectorOutput<ElSelectorValue, any>[]) => any) | undefined;
|
|
951
954
|
"onPopup-scroll"?: ((args_0: {
|
|
952
955
|
scrollTop: number;
|
|
953
956
|
scrollLeft: number;
|
|
@@ -967,10 +970,10 @@ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropT
|
|
|
967
970
|
"onNode-drag-over"?: ((draggingNode: import("element-plus/es/components/tree/src/model/node.mjs").default, dropNode: import("element-plus/es/components/tree/src/model/node.mjs").default, evt: DragEvent) => any) | undefined;
|
|
968
971
|
}>, {
|
|
969
972
|
data: ElSelectorOutput<ElSelectorValue, any>[];
|
|
973
|
+
loading: boolean;
|
|
970
974
|
props: SelectComponentProps;
|
|
971
975
|
offset: number;
|
|
972
976
|
placement: import("element-plus/es/utils/vue/props/types.mjs").EpPropMergeType<(new (...args: any[]) => "left" | "right" | "top" | "auto" | "bottom" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | ((new (...args: any[]) => "left" | "right" | "top" | "auto" | "bottom" | "auto-start" | "auto-end" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end") | (() => import("element-plus").Placement) | null)[], import("element-plus").Placement, unknown>;
|
|
973
|
-
loading: boolean;
|
|
974
977
|
disabled: boolean;
|
|
975
978
|
modelValue: ElSelectorModelValue;
|
|
976
979
|
autocomplete: string;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { addCssUnit } from "../../../utils/dom/index.mjs";
|
|
2
|
+
import { isEqual } from "../../../utils/object/index.mjs";
|
|
2
3
|
import { useEmits } from "../../../utils/vue/emits.mjs";
|
|
3
4
|
import { useExpose } from "../../../utils/vue/expose.mjs";
|
|
4
5
|
import { definePropType, useProps } from "../../../utils/vue/props.mjs";
|
|
5
6
|
import { useRender } from "../../../utils/vue/render.mjs";
|
|
6
7
|
import { makeSlots } from "../../../utils/vue/slots.mjs";
|
|
7
8
|
import { withDefineType } from "../../../utils/vue/with.mjs";
|
|
8
|
-
import { computed, createVNode, defineComponent, mergeProps, onMounted, reactive,
|
|
9
|
+
import { computed, createVNode, defineComponent, mergeProps, onMounted, reactive, shallowRef, useModel, watch } from "vue";
|
|
9
10
|
import { ElTreeSelect, selectEmits, selectProps, treeEmits, treeProps } from "element-plus";
|
|
10
|
-
import { isArray, isBoolean, isEqual, isNil, isNull, isNumber, isObject, isString } from "lodash-unified";
|
|
11
|
-
import { useVModel } from "@vueuse/core";
|
|
12
11
|
//#region src/components/treeSelect/src/treeSelect.tsx
|
|
13
12
|
const ElTreeSelectRuntime = ElTreeSelect;
|
|
14
13
|
/** FaTreeSelect 的运行时 Props 定义。 */
|
|
@@ -23,7 +22,7 @@ const faTreeSelectProps = {
|
|
|
23
22
|
*/
|
|
24
23
|
cacheData: {
|
|
25
24
|
type: definePropType(Array),
|
|
26
|
-
default: []
|
|
25
|
+
default: () => []
|
|
27
26
|
},
|
|
28
27
|
/** @description whether Select is disabled 重载使其支持 ElForm*/
|
|
29
28
|
disabled: {
|
|
@@ -135,13 +134,13 @@ const faTreeSelectEmits = {
|
|
|
135
134
|
...selectEmits,
|
|
136
135
|
...treeEmits,
|
|
137
136
|
/** @description v-model 回调 */
|
|
138
|
-
"update:modelValue": (value) =>
|
|
137
|
+
"update:modelValue": (value) => typeof value === "string" || typeof value === "number" || typeof value === "boolean" || typeof value === "object" && value !== null || value == null,
|
|
139
138
|
/** @description 选中数据改变 */
|
|
140
139
|
change: (_data, _value) => true,
|
|
141
140
|
/** @description v-model:label 回调 */
|
|
142
|
-
"update:label": (value) =>
|
|
141
|
+
"update:label": (value) => typeof value === "string" || Array.isArray(value) || value === null,
|
|
143
142
|
/** @description 数据改变 */
|
|
144
|
-
|
|
143
|
+
dataChange: (data) => Array.isArray(data),
|
|
145
144
|
/** @description 节点点击 */
|
|
146
145
|
"node-click": (_data, _node, _instance) => true
|
|
147
146
|
};
|
|
@@ -151,7 +150,8 @@ var treeSelect_default = defineComponent({
|
|
|
151
150
|
emits: faTreeSelectEmits,
|
|
152
151
|
slots: makeSlots(),
|
|
153
152
|
setup(props, { slots, emit, expose }) {
|
|
154
|
-
const selectedLabel =
|
|
153
|
+
const selectedLabel = useModel(props, "label");
|
|
154
|
+
const treeSelectRef = shallowRef(null);
|
|
155
155
|
const state = reactive({
|
|
156
156
|
value: withDefineType(),
|
|
157
157
|
loading: false,
|
|
@@ -159,11 +159,10 @@ var treeSelect_default = defineComponent({
|
|
|
159
159
|
/** 首次出现 */
|
|
160
160
|
debut: true,
|
|
161
161
|
/** 回显 */
|
|
162
|
-
echo:
|
|
162
|
+
echo: true,
|
|
163
163
|
/** 下次刷新 */
|
|
164
164
|
nextRefresh: false
|
|
165
165
|
});
|
|
166
|
-
const treeSelectRef = ref();
|
|
167
166
|
let requestVersion = 0;
|
|
168
167
|
const handleData = (data) => {
|
|
169
168
|
return data.map((item) => {
|
|
@@ -197,7 +196,7 @@ var treeSelect_default = defineComponent({
|
|
|
197
196
|
if (currentRequestVersion !== requestVersion) return;
|
|
198
197
|
state.echo = false;
|
|
199
198
|
state.selectorData = handleData(resData);
|
|
200
|
-
emit("
|
|
199
|
+
emit("dataChange", state.selectorData);
|
|
201
200
|
} catch (error) {
|
|
202
201
|
if (currentRequestVersion !== requestVersion) return;
|
|
203
202
|
state.selectorData = [];
|
|
@@ -227,7 +226,7 @@ var treeSelect_default = defineComponent({
|
|
|
227
226
|
const handleNodeClick = (data, node, instance) => {
|
|
228
227
|
if (props.expandOnClickNode) {
|
|
229
228
|
if (!node.expanded) node.expand();
|
|
230
|
-
else if (
|
|
229
|
+
else if (props.collapseOnClickNode) node.collapse();
|
|
231
230
|
}
|
|
232
231
|
emit("node-click", data, node, instance);
|
|
233
232
|
};
|
|
@@ -246,15 +245,33 @@ var treeSelect_default = defineComponent({
|
|
|
246
245
|
}
|
|
247
246
|
emit("visible-change", visible);
|
|
248
247
|
};
|
|
248
|
+
const flattenOptions = (data) => data.flatMap((item) => [item, ...flattenOptions(item.children ?? [])]);
|
|
249
|
+
const handleChange = (value) => {
|
|
250
|
+
const selectorData = flattenOptions(state.selectorData);
|
|
251
|
+
if (props.multiple) {
|
|
252
|
+
const valueList = Array.isArray(value) ? value : [];
|
|
253
|
+
if (valueList.length === 0) {
|
|
254
|
+
emit("change", null, null);
|
|
255
|
+
return;
|
|
256
|
+
}
|
|
257
|
+
emit("change", valueList.map((item) => selectorData.find((option) => option.value !== void 0 && isEqual(option.value, item))).filter((item) => item !== void 0), value);
|
|
258
|
+
return;
|
|
259
|
+
}
|
|
260
|
+
if (value == null || Array.isArray(value)) {
|
|
261
|
+
emit("change", null, null);
|
|
262
|
+
return;
|
|
263
|
+
}
|
|
264
|
+
emit("change", selectorData.find((item) => item.value !== void 0 && isEqual(item.value, value)) ?? null, value);
|
|
265
|
+
};
|
|
249
266
|
watch(() => props.modelValue, (newValue) => {
|
|
250
|
-
if (state.echo &&
|
|
251
|
-
const hasLabel =
|
|
267
|
+
if (state.echo && newValue != null) {
|
|
268
|
+
const hasLabel = props.label != null;
|
|
252
269
|
if (props.multiple) {
|
|
253
270
|
if (!Array.isArray(newValue)) {
|
|
254
271
|
console.error("[Fast:FaTreeSelect]", "当启用 multiple 时,传入的 modelValue 必须是 Array。");
|
|
255
272
|
return;
|
|
256
273
|
}
|
|
257
|
-
if (hasLabel && !isArray(props.label)) {
|
|
274
|
+
if (hasLabel && !Array.isArray(props.label)) {
|
|
258
275
|
console.error("[Fast:FaTreeSelect]", "当启用 multiple 时,传入的 modelValue:label 必须是 Array。");
|
|
259
276
|
return;
|
|
260
277
|
}
|
|
@@ -271,7 +288,7 @@ var treeSelect_default = defineComponent({
|
|
|
271
288
|
console.error("[Fast:FaTreeSelect]", "当禁用 multiple 时,传入的 modelValue 不能是 Array。");
|
|
272
289
|
return;
|
|
273
290
|
}
|
|
274
|
-
if (hasLabel && isArray(props.label)) {
|
|
291
|
+
if (hasLabel && Array.isArray(props.label)) {
|
|
275
292
|
console.error("[Fast:FaTreeSelect]", "当禁用 multiple 时,传入的 modelValue:label 不能是 Array。");
|
|
276
293
|
return;
|
|
277
294
|
}
|
|
@@ -283,24 +300,6 @@ var treeSelect_default = defineComponent({
|
|
|
283
300
|
}
|
|
284
301
|
state.value = newValue;
|
|
285
302
|
}, { immediate: true });
|
|
286
|
-
const flattenOptions = (data) => data.flatMap((item) => [item, ...flattenOptions(item.children ?? [])]);
|
|
287
|
-
const handleChange = (value) => {
|
|
288
|
-
const selectorData = flattenOptions(state.selectorData);
|
|
289
|
-
if (props.multiple) {
|
|
290
|
-
const valueList = Array.isArray(value) ? value : [];
|
|
291
|
-
if (valueList.length === 0) {
|
|
292
|
-
emit("change", null, null);
|
|
293
|
-
return;
|
|
294
|
-
}
|
|
295
|
-
emit("change", valueList.map((item) => selectorData.find((option) => option.value !== void 0 && isEqual(option.value, item))).filter((item) => item !== void 0), value);
|
|
296
|
-
return;
|
|
297
|
-
}
|
|
298
|
-
if (isNil(value) || Array.isArray(value)) {
|
|
299
|
-
emit("change", null, null);
|
|
300
|
-
return;
|
|
301
|
-
}
|
|
302
|
-
emit("change", selectorData.find((item) => item.value !== void 0 && isEqual(item.value, value)) ?? null, value);
|
|
303
|
-
};
|
|
304
303
|
watch([() => state.value, () => state.selectorData], ([value]) => {
|
|
305
304
|
const selectorData = flattenOptions(state.selectorData);
|
|
306
305
|
if (props.multiple) {
|
|
@@ -313,7 +312,7 @@ var treeSelect_default = defineComponent({
|
|
|
313
312
|
});
|
|
314
313
|
return;
|
|
315
314
|
}
|
|
316
|
-
if (
|
|
315
|
+
if (value == null || Array.isArray(value)) {
|
|
317
316
|
selectedLabel.value = null;
|
|
318
317
|
return;
|
|
319
318
|
}
|
|
@@ -323,6 +322,18 @@ var treeSelect_default = defineComponent({
|
|
|
323
322
|
flush: "sync",
|
|
324
323
|
immediate: true
|
|
325
324
|
});
|
|
325
|
+
watch(() => props.initParam, (newValue, oldValue) => {
|
|
326
|
+
if (!isEqual(newValue, oldValue)) {
|
|
327
|
+
state.nextRefresh = true;
|
|
328
|
+
if (state.value != null) handleModelValueUpdate(props.multiple ? [] : void 0);
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
watch(() => props.data, () => {
|
|
332
|
+
if (!props.requestApi) return loadData();
|
|
333
|
+
}, { deep: true });
|
|
334
|
+
watch(() => props.data.length, (length) => {
|
|
335
|
+
if (state.debut) state.echo = length === 0;
|
|
336
|
+
}, { immediate: true });
|
|
326
337
|
onMounted(async () => {
|
|
327
338
|
if (props.defaultSelected) {
|
|
328
339
|
await loadData();
|
|
@@ -331,19 +342,10 @@ var treeSelect_default = defineComponent({
|
|
|
331
342
|
if (props.multiple) handleModelValueUpdate([firstItem.value]);
|
|
332
343
|
else handleModelValueUpdate(firstItem.value);
|
|
333
344
|
}
|
|
334
|
-
} else if (!props.requestApi && props.data
|
|
345
|
+
} else if (!props.requestApi && props.data.length > 0) {
|
|
335
346
|
state.debut = false;
|
|
336
347
|
await loadData();
|
|
337
348
|
} else if (!props.lazy) await loadData();
|
|
338
|
-
watch(() => props.initParam, (newValue, oldValue) => {
|
|
339
|
-
if (!isEqual(newValue, oldValue)) {
|
|
340
|
-
state.nextRefresh = true;
|
|
341
|
-
if (!isNil(state.value)) handleModelValueUpdate(props.multiple ? [] : void 0);
|
|
342
|
-
}
|
|
343
|
-
});
|
|
344
|
-
watch(() => props.data, () => {
|
|
345
|
-
if (!props.requestApi) return loadData();
|
|
346
|
-
}, { deep: true });
|
|
347
349
|
});
|
|
348
350
|
const elTreeSelectProps = useProps(props, {
|
|
349
351
|
...selectProps,
|