fast-element-plus 1.0.7 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +894 -757
- package/dist/index.full.js.map +1 -1
- package/dist/index.full.min.js +1 -1
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +1 -1
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +894 -757
- package/dist/index.full.mjs.map +1 -1
- package/dist/styles/index.css +41 -23
- package/dist/styles/index.css.map +1 -1
- package/es/components/avatar/src/avatar.d.ts +4 -4
- package/es/components/avatar/src/avatar.mjs +1 -1
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/carNumber/src/carNumber.d.ts +13 -5
- package/es/components/carNumber/src/carNumber.mjs +1 -1
- package/es/components/carNumber/src/carNumber.mjs.map +1 -1
- package/es/components/contextMenu/src/contextMenu.mjs +1 -1
- package/es/components/contextMenu/src/contextMenu.mjs.map +1 -1
- package/es/components/dialog/src/dialog.d.ts +4 -4
- package/es/components/dialog/src/dialog.mjs +1 -1
- package/es/components/dialog/src/dialog.mjs.map +1 -1
- package/es/components/drawer/src/drawer.d.ts +12 -4
- package/es/components/drawer/src/drawer.mjs +1 -1
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/form/src/form.mjs +1 -1
- package/es/components/form/src/form.mjs.map +1 -1
- package/es/components/form/src/formItem.mjs +1 -1
- package/es/components/form/src/formItem.mjs.map +1 -1
- package/es/components/formItemTip/src/formItemTip.mjs +1 -1
- package/es/components/formItemTip/src/formItemTip.mjs.map +1 -1
- package/es/components/icon/src/icon.mjs +1 -1
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/iconSelector/src/iconSelector.mjs +1 -1
- package/es/components/iconSelector/src/iconSelector.mjs.map +1 -1
- package/es/components/image/src/image.mjs +1 -1
- package/es/components/image/src/image.mjs.map +1 -1
- package/es/components/index.d.ts +1 -0
- package/es/components/index.mjs +1 -1
- package/es/components/inputDialogPage/index.d.ts +14 -0
- package/es/components/inputDialogPage/index.mjs +2 -0
- package/es/components/inputDialogPage/index.mjs.map +1 -0
- package/es/components/inputDialogPage/src/inputDialogPage.d.ts +131 -0
- package/es/components/inputDialogPage/src/inputDialogPage.mjs +2 -0
- package/es/components/inputDialogPage/src/inputDialogPage.mjs.map +1 -0
- package/es/components/layoutGrid/src/layoutGrid.mjs +1 -1
- package/es/components/layoutGrid/src/layoutGrid.mjs.map +1 -1
- package/es/components/layoutGrid/src/layoutGridItem.d.ts +6 -6
- package/es/components/layoutGrid/src/layoutGridItem.mjs +1 -1
- package/es/components/layoutGrid/src/layoutGridItem.mjs.map +1 -1
- package/es/components/select/src/select.d.ts +39 -34
- package/es/components/select/src/select.mjs +1 -1
- package/es/components/select/src/select.mjs.map +1 -1
- package/es/components/select/src/selectOption.mjs +1 -1
- package/es/components/select/src/selectOption.mjs.map +1 -1
- package/es/components/selectPage/src/selectPage.d.ts +39 -25
- package/es/components/selectPage/src/selectPage.mjs +1 -1
- package/es/components/selectPage/src/selectPage.mjs.map +1 -1
- package/es/components/selectV2/src/selectV2.d.ts +36 -44
- package/es/components/selectV2/src/selectV2.mjs +1 -1
- package/es/components/selectV2/src/selectV2.mjs.map +1 -1
- package/es/components/table/src/table.d.ts +6 -6
- package/es/components/table/src/table.mjs +1 -1
- package/es/components/table/src/table.mjs.map +1 -1
- package/es/components/table/src/table.type.d.ts +1 -1
- package/es/components/table/src/table.type.mjs.map +1 -1
- package/es/components/table/src/tableColumn.mjs +1 -1
- package/es/components/table/src/tableColumn.mjs.map +1 -1
- package/es/components/table/src/tableColumnSettingDialog.mjs +1 -1
- package/es/components/table/src/tableColumnSettingDialog.mjs.map +1 -1
- package/es/components/table/src/useTable.mjs +1 -1
- package/es/components/table/src/useTable.mjs.map +1 -1
- package/es/components/table/utils/table.mjs +1 -1
- package/es/components/table/utils/table.mjs.map +1 -1
- package/es/components/tree/src/tree.d.ts +68 -174
- package/es/components/tree/src/tree.mjs +1 -1
- package/es/components/tree/src/tree.mjs.map +1 -1
- package/es/components/treeSelect/src/treeSelect.d.ts +123 -221
- package/es/components/treeSelect/src/treeSelect.mjs +1 -1
- package/es/components/treeSelect/src/treeSelect.mjs.map +1 -1
- package/es/directives/click-copy/index.mjs.map +1 -1
- package/es/directives/click-debounce/index.mjs.map +1 -1
- package/es/directives/click-draggable/index.mjs.map +1 -1
- package/es/directives/click-icon-copy/index.mjs.map +1 -1
- package/es/directives/click-longpress/index.mjs.map +1 -1
- package/es/directives/click-throttle/index.mjs.map +1 -1
- package/es/index.mjs +1 -1
- package/es/index.mjs.map +1 -1
- package/es/make-installer.mjs +1 -1
- package/es/make-installer.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/avatar/src/avatar.d.ts +4 -4
- package/lib/components/avatar/src/avatar.js +1 -1
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/carNumber/src/carNumber.d.ts +13 -5
- package/lib/components/carNumber/src/carNumber.js +1 -1
- package/lib/components/carNumber/src/carNumber.js.map +1 -1
- package/lib/components/contextMenu/src/contextMenu.js +1 -1
- package/lib/components/contextMenu/src/contextMenu.js.map +1 -1
- package/lib/components/dialog/src/dialog.d.ts +4 -4
- package/lib/components/dialog/src/dialog.js +1 -1
- package/lib/components/dialog/src/dialog.js.map +1 -1
- package/lib/components/drawer/src/drawer.d.ts +12 -4
- package/lib/components/drawer/src/drawer.js +1 -1
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/form/src/form.js +1 -1
- package/lib/components/form/src/form.js.map +1 -1
- package/lib/components/form/src/formItem.js +1 -1
- package/lib/components/form/src/formItem.js.map +1 -1
- package/lib/components/formItemTip/src/formItemTip.js +1 -1
- package/lib/components/formItemTip/src/formItemTip.js.map +1 -1
- package/lib/components/icon/src/icon.js +1 -1
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/iconSelector/src/iconSelector.js +1 -1
- package/lib/components/iconSelector/src/iconSelector.js.map +1 -1
- package/lib/components/image/src/image.js +1 -1
- package/lib/components/image/src/image.js.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +1 -1
- package/lib/components/inputDialogPage/index.d.ts +14 -0
- package/lib/components/inputDialogPage/index.js +2 -0
- package/lib/components/inputDialogPage/index.js.map +1 -0
- package/lib/components/inputDialogPage/src/inputDialogPage.d.ts +131 -0
- package/lib/components/inputDialogPage/src/inputDialogPage.js +2 -0
- package/lib/components/inputDialogPage/src/inputDialogPage.js.map +1 -0
- package/lib/components/layoutGrid/src/layoutGrid.js +1 -1
- package/lib/components/layoutGrid/src/layoutGrid.js.map +1 -1
- package/lib/components/layoutGrid/src/layoutGridItem.d.ts +6 -6
- package/lib/components/layoutGrid/src/layoutGridItem.js +1 -1
- package/lib/components/layoutGrid/src/layoutGridItem.js.map +1 -1
- package/lib/components/select/src/select.d.ts +39 -34
- package/lib/components/select/src/select.js +1 -1
- package/lib/components/select/src/select.js.map +1 -1
- package/lib/components/select/src/selectOption.js +1 -1
- package/lib/components/select/src/selectOption.js.map +1 -1
- package/lib/components/selectPage/src/selectPage.d.ts +39 -25
- package/lib/components/selectPage/src/selectPage.js +1 -1
- package/lib/components/selectPage/src/selectPage.js.map +1 -1
- package/lib/components/selectV2/src/selectV2.d.ts +36 -44
- package/lib/components/selectV2/src/selectV2.js +1 -1
- package/lib/components/selectV2/src/selectV2.js.map +1 -1
- package/lib/components/table/src/table.d.ts +6 -6
- package/lib/components/table/src/table.js +1 -1
- package/lib/components/table/src/table.js.map +1 -1
- package/lib/components/table/src/table.type.d.ts +1 -1
- package/lib/components/table/src/table.type.js.map +1 -1
- package/lib/components/table/src/tableColumn.js +1 -1
- package/lib/components/table/src/tableColumn.js.map +1 -1
- package/lib/components/table/src/tableColumnSettingDialog.js +1 -1
- package/lib/components/table/src/tableColumnSettingDialog.js.map +1 -1
- package/lib/components/table/src/useTable.js.map +1 -1
- package/lib/components/table/utils/table.js +1 -1
- package/lib/components/table/utils/table.js.map +1 -1
- package/lib/components/tree/src/tree.d.ts +68 -174
- package/lib/components/tree/src/tree.js +1 -1
- package/lib/components/tree/src/tree.js.map +1 -1
- package/lib/components/treeSelect/src/treeSelect.d.ts +123 -221
- package/lib/components/treeSelect/src/treeSelect.js +1 -1
- package/lib/components/treeSelect/src/treeSelect.js.map +1 -1
- package/lib/directives/click-copy/index.js.map +1 -1
- package/lib/directives/click-debounce/index.js.map +1 -1
- package/lib/directives/click-draggable/index.js.map +1 -1
- package/lib/directives/click-icon-copy/index.js.map +1 -1
- package/lib/directives/click-longpress/index.js.map +1 -1
- package/lib/directives/click-throttle/index.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/make-installer.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +3 -3
- package/styles/components/dialog.scss +1 -1
- package/styles/components/select.scss +35 -0
- package/styles/components/selectPage.scss +0 -30
- package/styles/components/table.scss +1 -1
- package/styles/components/tree.scss +17 -2
- package/styles/index.scss +1 -0
- package/types/components.d.ts +110 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sources":["../../../../../packages/components/table/utils/table.ts"],"sourcesContent":["import { isArray, isFunction, isString } from \"lodash-unified\";\nimport type { FaTableColumnCtx, FaTableEnumColumnCtx, FaTableEnumColumnType, PagedSortInput } from \"@fast-element-plus/components\";\n\n/**\n * 表格工具类\n */\nexport const tableUtil = {\n\t/**\n\t * @description 处理无数据情况\n\t * @param {String} callValue 需要处理的值\n\t */\n\tformatValue(callValue: any): any {\n\t\t// 如果当前值为数组,使用 / 拼接(根据需求自定义)\n\t\t// if (isArray(callValue)) return callValue.length ? callValue.join(\" / \") : \"--\";\n\t\tif (isArray(callValue)) return callValue.length ? callValue.join(` , `) : null;\n\t\t// return callValue ?? \"--\";\n\t\treturn callValue;\n\t},\n\t/**\n\t * @description 处理 prop 为多级嵌套的情况(列如: prop:user.name)\n\t * @param {Object} row 当前行数据\n\t * @param {String} prop 当前 prop\n\t */\n\thandleRowAccordingToProp(row: any, prop: string): any {\n\t\t// if (!prop.includes(\".\")) return row[prop] ?? \"--\";\n\t\tif (!prop.includes(\".\")) return row[prop] ?? null;\n\t\t// prop.split(\".\").forEach((item) => (row = row[item] ?? \"--\"));\n\t\tprop.split(\".\").forEach((item) => (row = row[item]));\n\t\treturn row;\n\t},\n\t/**\n\t * @description 处理 prop,当 prop 为多级嵌套时 ==> 返回最后一级 prop\n\t * @param {String} prop 当前 prop\n\t */\n\thandleProp(prop: string): string {\n\t\tconst propArr = prop.split(\".\");\n\t\tif (propArr.length === 1) return prop;\n\t\treturn propArr[propArr.length - 1];\n\t},\n\t/**\n\t * @description 根据枚举列表查询当需要的数据(如果指定了 label 和 value 的 key值,会自动识别格式化)\n\t * @param {String} callValue 当前单元格值\n\t * @param {Array} enumData 字典列表\n\t * @param {Array} fieldNames 指定 label && value 的 key 值\n\t * @param {String} type 过滤类型(目前只有 tag)\n\t */\n\tfilterEnum(callValue: any, enumData: FaTableEnumColumnCtx[], fieldNames?: { label: string; value: string }, type?: \"tag\"): string {\n\t\tconst value = fieldNames?.value ?? \"value\";\n\t\tconst label = fieldNames?.label ?? \"label\";\n\t\tlet filterData: any = {};\n\t\tif (isArray(enumData)) {\n\t\t\tfilterData = enumData.find((item: any) => item[value] === callValue);\n\t\t}\n\t\tif (type === \"tag\") {\n\t\t\treturn filterData?.type ?? \"info\";\n\t\t}\n\t\t// return filterData ? filterData[label] : \"--\";\n\t\treturn filterData ? filterData[label] : null;\n\t},\n\t/**\n\t * 数组动态排序\n\t */\n\tarrayDynamicSort(sortList: PagedSortInput[]): (a: any, b: any) => number {\n\t\treturn function (a: any, b: any) {\n\t\t\tif (sortList && sortList.length > 0) {\n\t\t\t\tfor (const condition of sortList) {\n\t\t\t\t\tconst property = condition.enField;\n\t\t\t\t\tconst order = condition.mode;\n\n\t\t\t\t\tconst aValue = a[property];\n\t\t\t\t\tconst bValue = b[property];\n\n\t\t\t\t\tif (typeof aValue === \"string\" && typeof bValue === \"string\") {\n\t\t\t\t\t\tif (order === \"ascending\") {\n\t\t\t\t\t\t\tconst comparison = aValue.localeCompare(bValue, \"zh-CN\");\n\t\t\t\t\t\t\tif (comparison !== 0) {\n\t\t\t\t\t\t\t\treturn comparison;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (order === \"descending\") {\n\t\t\t\t\t\t\tconst comparison = bValue.localeCompare(aValue, \"zh-CN\");\n\t\t\t\t\t\t\tif (comparison !== 0) {\n\t\t\t\t\t\t\t\treturn comparison;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (order === \"ascending\") {\n\t\t\t\t\t\t\tif (aValue < bValue) return -1;\n\t\t\t\t\t\t\tif (aValue > bValue) return 1;\n\t\t\t\t\t\t} else if (order === \"descending\") {\n\t\t\t\t\t\t\tif (aValue > bValue) return -1;\n\t\t\t\t\t\t\tif (aValue < bValue) return 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t};\n\t},\n\t/**\n\t * 设置枚举\n\t */\n\tsetEnumMap(columnEnum: FaTableEnumColumnType, prop: string, enumMap: Map<string, FaTableEnumColumnCtx[]>): void {\n\t\tif (!columnEnum) return;\n\t\tif (isFunction(columnEnum)) {\n\t\t\
|
|
1
|
+
{"version":3,"file":"table.js","sources":["../../../../../packages/components/table/utils/table.ts"],"sourcesContent":["import { isArray, isFunction, isString } from \"lodash-unified\";\nimport type { FaTableColumnCtx, FaTableEnumColumnCtx, FaTableEnumColumnType, PagedSortInput } from \"@fast-element-plus/components\";\n\n/**\n * 表格工具类\n */\nexport const tableUtil = {\n\t/**\n\t * @description 处理无数据情况\n\t * @param {String} callValue 需要处理的值\n\t */\n\tformatValue(callValue: any): any {\n\t\t// 如果当前值为数组,使用 / 拼接(根据需求自定义)\n\t\t// if (isArray(callValue)) return callValue.length ? callValue.join(\" / \") : \"--\";\n\t\tif (isArray(callValue)) return callValue.length ? callValue.join(` , `) : null;\n\t\t// return callValue ?? \"--\";\n\t\treturn callValue;\n\t},\n\t/**\n\t * @description 处理 prop 为多级嵌套的情况(列如: prop:user.name)\n\t * @param {Object} row 当前行数据\n\t * @param {String} prop 当前 prop\n\t */\n\thandleRowAccordingToProp(row: any, prop: string): any {\n\t\t// if (!prop.includes(\".\")) return row[prop] ?? \"--\";\n\t\tif (!prop.includes(\".\")) return row[prop] ?? null;\n\t\t// prop.split(\".\").forEach((item) => (row = row[item] ?? \"--\"));\n\t\tprop.split(\".\").forEach((item) => (row = row[item]));\n\t\treturn row;\n\t},\n\t/**\n\t * @description 处理 prop,当 prop 为多级嵌套时 ==> 返回最后一级 prop\n\t * @param {String} prop 当前 prop\n\t */\n\thandleProp(prop: string): string {\n\t\tconst propArr = prop.split(\".\");\n\t\tif (propArr.length === 1) return prop;\n\t\treturn propArr[propArr.length - 1];\n\t},\n\t/**\n\t * @description 根据枚举列表查询当需要的数据(如果指定了 label 和 value 的 key值,会自动识别格式化)\n\t * @param {String} callValue 当前单元格值\n\t * @param {Array} enumData 字典列表\n\t * @param {Array} fieldNames 指定 label && value 的 key 值\n\t * @param {String} type 过滤类型(目前只有 tag)\n\t */\n\tfilterEnum(callValue: any, enumData: FaTableEnumColumnCtx[], fieldNames?: { label: string; value: string }, type?: \"tag\"): string {\n\t\tconst value = fieldNames?.value ?? \"value\";\n\t\tconst label = fieldNames?.label ?? \"label\";\n\t\tlet filterData: any = {};\n\t\tif (isArray(enumData)) {\n\t\t\tfilterData = enumData.find((item: any) => item[value] === callValue);\n\t\t}\n\t\tif (type === \"tag\") {\n\t\t\treturn filterData?.type ?? \"info\";\n\t\t}\n\t\t// return filterData ? filterData[label] : \"--\";\n\t\treturn filterData ? filterData[label] : null;\n\t},\n\t/**\n\t * 数组动态排序\n\t */\n\tarrayDynamicSort(sortList: PagedSortInput[]): (a: any, b: any) => number {\n\t\treturn function (a: any, b: any) {\n\t\t\tif (sortList && sortList.length > 0) {\n\t\t\t\tfor (const condition of sortList) {\n\t\t\t\t\tconst property = condition.enField;\n\t\t\t\t\tconst order = condition.mode;\n\n\t\t\t\t\tconst aValue = a[property];\n\t\t\t\t\tconst bValue = b[property];\n\n\t\t\t\t\tif (typeof aValue === \"string\" && typeof bValue === \"string\") {\n\t\t\t\t\t\tif (order === \"ascending\") {\n\t\t\t\t\t\t\tconst comparison = aValue.localeCompare(bValue, \"zh-CN\");\n\t\t\t\t\t\t\tif (comparison !== 0) {\n\t\t\t\t\t\t\t\treturn comparison;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (order === \"descending\") {\n\t\t\t\t\t\t\tconst comparison = bValue.localeCompare(aValue, \"zh-CN\");\n\t\t\t\t\t\t\tif (comparison !== 0) {\n\t\t\t\t\t\t\t\treturn comparison;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (order === \"ascending\") {\n\t\t\t\t\t\t\tif (aValue < bValue) return -1;\n\t\t\t\t\t\t\tif (aValue > bValue) return 1;\n\t\t\t\t\t\t} else if (order === \"descending\") {\n\t\t\t\t\t\t\tif (aValue > bValue) return -1;\n\t\t\t\t\t\t\tif (aValue < bValue) return 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn 0;\n\t\t};\n\t},\n\t/**\n\t * 设置枚举\n\t */\n\tsetEnumMap(columnEnum: FaTableEnumColumnType, prop: string, enumMap: Map<string, FaTableEnumColumnCtx[]>): void {\n\t\tif (!columnEnum) return;\n\t\tif (isFunction(columnEnum)) {\n\t\t\tenumMap.set(prop, columnEnum());\n\t\t} else if (isArray(columnEnum)) {\n\t\t\tenumMap.set(prop, columnEnum);\n\t\t}\n\t},\n\t/**\n\t * 扁平化 columns\n\t */\n\tflatColumns(columns: FaTableColumnCtx[], enumMap?: Map<string, FaTableEnumColumnCtx[]>): FaTableColumnCtx[] {\n\t\tconst flatArr: FaTableColumnCtx[] = [];\n\t\tcolumns.forEach((col) => {\n\t\t\tif (col._children?.length) {\n\t\t\t\tflatArr.push(...this.flatColumns(col._children));\n\t\t\t}\n\n\t\t\tflatArr.push(col);\n\n\t\t\t// 给每一项 column 添加 show && filterEnum 默认属性\n\t\t\tcol.show = col.show ?? true;\n\t\t\t// col.filterEnum = col.filterEnum ?? col.tag ?? false;\n\n\t\t\tlet enumKey = col.prop ?? col.search?.key;\n\n\t\t\tif (col.enum && isString(col.enum)) {\n\t\t\t\tenumKey = col.enum;\n\t\t\t}\n\n\t\t\t// 设置 enumMap\n\t\t\tthis.setEnumMap(col.enum, enumKey, enumMap);\n\t\t});\n\t\treturn flatArr.filter((item) => !item._children?.length);\n\t},\n};\n"],"names":["tableUtil","formatValue","callValue","isArray","length","join","handleRowAccordingToProp","row","prop","includes","split","forEach","item","handleProp","propArr","filterEnum","enumData","fieldNames","type","value","label","filterData","find","arrayDynamicSort","sortList","a","b","condition","property","enField","order","mode","aValue","bValue","comparison","localeCompare","setEnumMap","columnEnum","enumMap","isFunction","set","flatColumns","columns","flatArr","col","_children","push","this","show","enumKey","search","key","enum","isString","filter"],"mappings":"kHAMaA,EAAY,CAKxBC,YAAYC,GAGPC,UAAQD,GAAmBA,EAAUE,OAASF,EAAUG,KAAK,OAAS,KAEnEH,EAORI,yBAAA,CAAyBC,EAAUC,IAE7BA,EAAKC,SAAS,MAEnBD,EAAKE,MAAM,KAAKC,QAASC,GAAUL,EAAMA,EAAIK,IACtCL,GAHyBA,EAAIC,IAAS,KAS9C,UAAAK,CAAWL,GACV,MAAMM,EAAUN,EAAKE,MAAM,KAC3B,OAAuB,IAAnBI,EAAQV,OAAqBI,EAC1BM,EAAQA,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BuC,EAAQG,QAAQC,KAAKN,YAAYG,EAAIC,YAGtCF,EAAQG,KAAKF,GAGbA,EAAII,KAAOJ,EAAII,OAAQ,EAGvB,IAAIC,EAAUL,EAAIpC,MAAQoC,EAAIM,QAAQC,IAElCP,EAAIQ,MAAQC,EAAAA,SAAST,EAAIQ,QAC5BH,EAAUL,EAAIQ,MAIfL,KAAKX,WAAWQ,EAAIQ,KAAMH,EAASX,KAE7BK,EAAQW,OAAQ1C,IAAUA,EAAKiC,WAAWzC,OAClD"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { NodeDropType, TreeKey } from './tree.props';
|
|
2
1
|
import { ElTreeOutput } from './tree.type';
|
|
3
2
|
import { ComponentInternalInstance } from 'vue';
|
|
4
3
|
export declare const faTreeProps: {
|
|
4
|
+
/** @description whether Select is disabled 重载使其支持 ElForm*/
|
|
5
|
+
disabled: {
|
|
6
|
+
type: BooleanConstructor;
|
|
7
|
+
default: any;
|
|
8
|
+
};
|
|
5
9
|
/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */
|
|
6
10
|
nodeKey: {
|
|
7
11
|
type: StringConstructor;
|
|
@@ -92,9 +96,9 @@ export declare const faTreeProps: {
|
|
|
92
96
|
type: BooleanConstructor;
|
|
93
97
|
default: boolean;
|
|
94
98
|
};
|
|
95
|
-
defaultCheckedKeys: import('vue').PropType<TreeKey[]>;
|
|
96
|
-
defaultExpandedKeys: import('vue').PropType<TreeKey[]>;
|
|
97
|
-
currentNodeKey: import('vue').PropType<TreeKey>;
|
|
99
|
+
defaultCheckedKeys: import('vue').PropType<import('./tree.props').TreeKey[]>;
|
|
100
|
+
defaultExpandedKeys: import('vue').PropType<import('./tree.props').TreeKey[]>;
|
|
101
|
+
currentNodeKey: import('vue').PropType<import('./tree.props').TreeKey>;
|
|
98
102
|
renderContent: FunctionConstructor;
|
|
99
103
|
showCheckbox: {
|
|
100
104
|
type: BooleanConstructor;
|
|
@@ -131,40 +135,22 @@ export declare const faTreeEmits: {
|
|
|
131
135
|
/** @description v-model:label 回调 */
|
|
132
136
|
"update:label": (value: string) => boolean;
|
|
133
137
|
/** @description 数据改变 */
|
|
134
|
-
dataChangeCallBack: (data: ElTreeOutput[]
|
|
138
|
+
dataChangeCallBack: (data: ElTreeOutput[]) => boolean;
|
|
135
139
|
/** @description 改变 */
|
|
136
140
|
change: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance, event: MouseEvent) => boolean;
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
/** @description 当前选中节点变化时触发的事件 */
|
|
151
|
-
currentChange: (data: ElTreeOutput, node: any) => boolean;
|
|
152
|
-
/** @description 节点被展开时触发的事件 */
|
|
153
|
-
nodeExpand: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance) => boolean;
|
|
154
|
-
/** @description 节点被关闭时触发的事件 */
|
|
155
|
-
nodeCollapse: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance) => boolean;
|
|
156
|
-
/** @description 节点开始拖拽时触发的事件 */
|
|
157
|
-
nodeDragStart: (node: any, event: DragEvent) => boolean;
|
|
158
|
-
/** @description 拖拽进入其他节点时触发的事件 */
|
|
159
|
-
nodeDragEnter: (node: any, enterNode: any, event: DragEvent) => boolean;
|
|
160
|
-
/** @description 拖拽离开某个节点时触发的事件 */
|
|
161
|
-
nodeDragLeave: (node: any, leaveNode: any, event: DragEvent) => boolean;
|
|
162
|
-
/** @description 在拖拽节点时触发的事件(类似浏览器的 mouseover 事件) */
|
|
163
|
-
nodeDragOver: (node: any, dropNode: any, event: DragEvent) => boolean;
|
|
164
|
-
/** @description 拖拽结束时(可能未成功)触发的事件 */
|
|
165
|
-
nodeDragEnd: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) => boolean;
|
|
166
|
-
/** @description 拖拽成功完成时触发的事件 */
|
|
167
|
-
nodeDrop: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) => boolean;
|
|
141
|
+
'check-change': (data: any, checked: boolean, indeterminate: boolean) => any;
|
|
142
|
+
'current-change': (data: any | null, node: import('element-plus/es/components/tree/src/model/node.mjs').default | null) => boolean;
|
|
143
|
+
'node-click': (data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default, nodeInstance: ComponentInternalInstance | null, evt: MouseEvent) => any;
|
|
144
|
+
'node-contextmenu': (evt: Event, data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default, nodeInstance: ComponentInternalInstance | null) => any;
|
|
145
|
+
'node-collapse': (data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default, nodeInstance: ComponentInternalInstance | null) => any;
|
|
146
|
+
'node-expand': (data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default, nodeInstance: ComponentInternalInstance | null) => any;
|
|
147
|
+
check: (data: any, checkedInfo: import('element-plus').CheckedInfo) => any;
|
|
148
|
+
'node-drag-start': (node: import('element-plus/es/components/tree/src/model/node.mjs').default, evt: DragEvent) => DragEvent;
|
|
149
|
+
'node-drag-end': (draggingNode: import('element-plus/es/components/tree/src/model/node.mjs').default, dropNode: import('element-plus/es/components/tree/src/model/node.mjs').default | null, dropType: import('element-plus').NodeDropType, evt: DragEvent) => DragEvent;
|
|
150
|
+
'node-drop': (draggingNode: import('element-plus/es/components/tree/src/model/node.mjs').default, dropNode: import('element-plus/es/components/tree/src/model/node.mjs').default, dropType: Exclude<import('element-plus').NodeDropType, "none">, evt: DragEvent) => DragEvent;
|
|
151
|
+
'node-drag-leave': (draggingNode: import('element-plus/es/components/tree/src/model/node.mjs').default, oldDropNode: import('element-plus/es/components/tree/src/model/node.mjs').default, evt: DragEvent) => DragEvent;
|
|
152
|
+
'node-drag-enter': (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) => DragEvent;
|
|
153
|
+
'node-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) => DragEvent;
|
|
168
154
|
};
|
|
169
155
|
type FaTreeSlots = {
|
|
170
156
|
/** @description 默认内容插槽 */
|
|
@@ -181,6 +167,11 @@ type FaTreeSlots = {
|
|
|
181
167
|
};
|
|
182
168
|
};
|
|
183
169
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
170
|
+
/** @description whether Select is disabled 重载使其支持 ElForm*/
|
|
171
|
+
disabled: {
|
|
172
|
+
type: BooleanConstructor;
|
|
173
|
+
default: any;
|
|
174
|
+
};
|
|
184
175
|
/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */
|
|
185
176
|
nodeKey: {
|
|
186
177
|
type: StringConstructor;
|
|
@@ -271,9 +262,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
271
262
|
type: BooleanConstructor;
|
|
272
263
|
default: boolean;
|
|
273
264
|
};
|
|
274
|
-
defaultCheckedKeys: import('vue').PropType<TreeKey[]>;
|
|
275
|
-
defaultExpandedKeys: import('vue').PropType<TreeKey[]>;
|
|
276
|
-
currentNodeKey: import('vue').PropType<TreeKey>;
|
|
265
|
+
defaultCheckedKeys: import('vue').PropType<import('./tree.props').TreeKey[]>;
|
|
266
|
+
defaultExpandedKeys: import('vue').PropType<import('./tree.props').TreeKey[]>;
|
|
267
|
+
currentNodeKey: import('vue').PropType<import('./tree.props').TreeKey>;
|
|
277
268
|
renderContent: FunctionConstructor;
|
|
278
269
|
showCheckbox: {
|
|
279
270
|
type: BooleanConstructor;
|
|
@@ -350,41 +341,28 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
350
341
|
/** @description v-model:label 回调 */
|
|
351
342
|
"update:label": (value: string) => boolean;
|
|
352
343
|
/** @description 数据改变 */
|
|
353
|
-
dataChangeCallBack: (data: ElTreeOutput[]
|
|
344
|
+
dataChangeCallBack: (data: ElTreeOutput[]) => boolean;
|
|
354
345
|
/** @description 改变 */
|
|
355
346
|
change: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance, event: MouseEvent) => boolean;
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
/** @description 当前选中节点变化时触发的事件 */
|
|
370
|
-
currentChange: (data: ElTreeOutput, node: any) => boolean;
|
|
371
|
-
/** @description 节点被展开时触发的事件 */
|
|
372
|
-
nodeExpand: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance) => boolean;
|
|
373
|
-
/** @description 节点被关闭时触发的事件 */
|
|
374
|
-
nodeCollapse: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance) => boolean;
|
|
375
|
-
/** @description 节点开始拖拽时触发的事件 */
|
|
376
|
-
nodeDragStart: (node: any, event: DragEvent) => boolean;
|
|
377
|
-
/** @description 拖拽进入其他节点时触发的事件 */
|
|
378
|
-
nodeDragEnter: (node: any, enterNode: any, event: DragEvent) => boolean;
|
|
379
|
-
/** @description 拖拽离开某个节点时触发的事件 */
|
|
380
|
-
nodeDragLeave: (node: any, leaveNode: any, event: DragEvent) => boolean;
|
|
381
|
-
/** @description 在拖拽节点时触发的事件(类似浏览器的 mouseover 事件) */
|
|
382
|
-
nodeDragOver: (node: any, dropNode: any, event: DragEvent) => boolean;
|
|
383
|
-
/** @description 拖拽结束时(可能未成功)触发的事件 */
|
|
384
|
-
nodeDragEnd: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) => boolean;
|
|
385
|
-
/** @description 拖拽成功完成时触发的事件 */
|
|
386
|
-
nodeDrop: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) => boolean;
|
|
347
|
+
'check-change': (data: any, checked: boolean, indeterminate: boolean) => any;
|
|
348
|
+
'current-change': (data: any | null, node: import('element-plus/es/components/tree/src/model/node.mjs').default | null) => boolean;
|
|
349
|
+
'node-click': (data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default, nodeInstance: ComponentInternalInstance | null, evt: MouseEvent) => any;
|
|
350
|
+
'node-contextmenu': (evt: Event, data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default, nodeInstance: ComponentInternalInstance | null) => any;
|
|
351
|
+
'node-collapse': (data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default, nodeInstance: ComponentInternalInstance | null) => any;
|
|
352
|
+
'node-expand': (data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default, nodeInstance: ComponentInternalInstance | null) => any;
|
|
353
|
+
check: (data: any, checkedInfo: import('element-plus').CheckedInfo) => any;
|
|
354
|
+
'node-drag-start': (node: import('element-plus/es/components/tree/src/model/node.mjs').default, evt: DragEvent) => DragEvent;
|
|
355
|
+
'node-drag-end': (draggingNode: import('element-plus/es/components/tree/src/model/node.mjs').default, dropNode: import('element-plus/es/components/tree/src/model/node.mjs').default | null, dropType: import('element-plus').NodeDropType, evt: DragEvent) => DragEvent;
|
|
356
|
+
'node-drop': (draggingNode: import('element-plus/es/components/tree/src/model/node.mjs').default, dropNode: import('element-plus/es/components/tree/src/model/node.mjs').default, dropType: Exclude<import('element-plus').NodeDropType, "none">, evt: DragEvent) => DragEvent;
|
|
357
|
+
'node-drag-leave': (draggingNode: import('element-plus/es/components/tree/src/model/node.mjs').default, oldDropNode: import('element-plus/es/components/tree/src/model/node.mjs').default, evt: DragEvent) => DragEvent;
|
|
358
|
+
'node-drag-enter': (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) => DragEvent;
|
|
359
|
+
'node-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) => DragEvent;
|
|
387
360
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
|
|
361
|
+
/** @description whether Select is disabled 重载使其支持 ElForm*/
|
|
362
|
+
disabled: {
|
|
363
|
+
type: BooleanConstructor;
|
|
364
|
+
default: any;
|
|
365
|
+
};
|
|
388
366
|
/** 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 */
|
|
389
367
|
nodeKey: {
|
|
390
368
|
type: StringConstructor;
|
|
@@ -475,9 +453,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
475
453
|
type: BooleanConstructor;
|
|
476
454
|
default: boolean;
|
|
477
455
|
};
|
|
478
|
-
defaultCheckedKeys: import('vue').PropType<TreeKey[]>;
|
|
479
|
-
defaultExpandedKeys: import('vue').PropType<TreeKey[]>;
|
|
480
|
-
currentNodeKey: import('vue').PropType<TreeKey>;
|
|
456
|
+
defaultCheckedKeys: import('vue').PropType<import('./tree.props').TreeKey[]>;
|
|
457
|
+
defaultExpandedKeys: import('vue').PropType<import('./tree.props').TreeKey[]>;
|
|
458
|
+
currentNodeKey: import('vue').PropType<import('./tree.props').TreeKey>;
|
|
481
459
|
renderContent: FunctionConstructor;
|
|
482
460
|
showCheckbox: {
|
|
483
461
|
type: BooleanConstructor;
|
|
@@ -531,105 +509,20 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
531
509
|
children?: /*elided*/ any[];
|
|
532
510
|
showQuantity?: boolean;
|
|
533
511
|
quantity?: number;
|
|
534
|
-
}[], orgData: {
|
|
535
|
-
[key: string]: any;
|
|
536
|
-
label?: string;
|
|
537
|
-
value?: any;
|
|
538
|
-
data?: any;
|
|
539
|
-
hide?: boolean;
|
|
540
|
-
disabled?: boolean;
|
|
541
|
-
children?: /*elided*/ any[];
|
|
542
|
-
showQuantity?: boolean;
|
|
543
|
-
quantity?: number;
|
|
544
512
|
}[]) => any;
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
label?: string;
|
|
559
|
-
value?: any;
|
|
560
|
-
data?: any;
|
|
561
|
-
hide?: boolean;
|
|
562
|
-
disabled?: boolean;
|
|
563
|
-
children?: /*elided*/ any[];
|
|
564
|
-
showQuantity?: boolean;
|
|
565
|
-
quantity?: number;
|
|
566
|
-
}, node?: any, instance?: ComponentInternalInstance) => any;
|
|
567
|
-
onCheckChange?: (data: {
|
|
568
|
-
[key: string]: any;
|
|
569
|
-
label?: string;
|
|
570
|
-
value?: any;
|
|
571
|
-
data?: any;
|
|
572
|
-
hide?: boolean;
|
|
573
|
-
disabled?: boolean;
|
|
574
|
-
children?: /*elided*/ any[];
|
|
575
|
-
showQuantity?: boolean;
|
|
576
|
-
quantity?: number;
|
|
577
|
-
}, checked: boolean, indeterminate: boolean) => any;
|
|
578
|
-
onCheck?: (data: {
|
|
579
|
-
[key: string]: any;
|
|
580
|
-
label?: string;
|
|
581
|
-
value?: any;
|
|
582
|
-
data?: any;
|
|
583
|
-
hide?: boolean;
|
|
584
|
-
disabled?: boolean;
|
|
585
|
-
children?: /*elided*/ any[];
|
|
586
|
-
showQuantity?: boolean;
|
|
587
|
-
quantity?: number;
|
|
588
|
-
}, node: {
|
|
589
|
-
checkedNodes: ElTreeOutput[];
|
|
590
|
-
checkedKeys: TreeKey[];
|
|
591
|
-
halfCheckedNodes: ElTreeOutput[];
|
|
592
|
-
halfCheckedKeys: TreeKey[];
|
|
593
|
-
}) => any;
|
|
594
|
-
onCurrentChange?: (data: {
|
|
595
|
-
[key: string]: any;
|
|
596
|
-
label?: string;
|
|
597
|
-
value?: any;
|
|
598
|
-
data?: any;
|
|
599
|
-
hide?: boolean;
|
|
600
|
-
disabled?: boolean;
|
|
601
|
-
children?: /*elided*/ any[];
|
|
602
|
-
showQuantity?: boolean;
|
|
603
|
-
quantity?: number;
|
|
604
|
-
}, node: any) => any;
|
|
605
|
-
onNodeExpand?: (data: {
|
|
606
|
-
[key: string]: any;
|
|
607
|
-
label?: string;
|
|
608
|
-
value?: any;
|
|
609
|
-
data?: any;
|
|
610
|
-
hide?: boolean;
|
|
611
|
-
disabled?: boolean;
|
|
612
|
-
children?: /*elided*/ any[];
|
|
613
|
-
showQuantity?: boolean;
|
|
614
|
-
quantity?: number;
|
|
615
|
-
}, node: any, instance: ComponentInternalInstance) => any;
|
|
616
|
-
onNodeCollapse?: (data: {
|
|
617
|
-
[key: string]: any;
|
|
618
|
-
label?: string;
|
|
619
|
-
value?: any;
|
|
620
|
-
data?: any;
|
|
621
|
-
hide?: boolean;
|
|
622
|
-
disabled?: boolean;
|
|
623
|
-
children?: /*elided*/ any[];
|
|
624
|
-
showQuantity?: boolean;
|
|
625
|
-
quantity?: number;
|
|
626
|
-
}, node: any, instance: ComponentInternalInstance) => any;
|
|
627
|
-
onNodeDragStart?: (node: any, event: DragEvent) => any;
|
|
628
|
-
onNodeDragEnter?: (node: any, enterNode: any, event: DragEvent) => any;
|
|
629
|
-
onNodeDragLeave?: (node: any, leaveNode: any, event: DragEvent) => any;
|
|
630
|
-
onNodeDragOver?: (node: any, dropNode: any, event: DragEvent) => any;
|
|
631
|
-
onNodeDragEnd?: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) => any;
|
|
632
|
-
onNodeDrop?: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) => any;
|
|
513
|
+
"onCurrent-change"?: (data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default) => any;
|
|
514
|
+
"onCheck-change"?: (data: any, checked: boolean, indeterminate: boolean) => any;
|
|
515
|
+
"onNode-click"?: (data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default, nodeInstance: ComponentInternalInstance, evt: MouseEvent) => any;
|
|
516
|
+
"onNode-contextmenu"?: (evt: Event, data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default, nodeInstance: ComponentInternalInstance) => any;
|
|
517
|
+
"onNode-collapse"?: (data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default, nodeInstance: ComponentInternalInstance) => any;
|
|
518
|
+
"onNode-expand"?: (data: any, node: import('element-plus/es/components/tree/src/model/node.mjs').default, nodeInstance: ComponentInternalInstance) => any;
|
|
519
|
+
onCheck?: (data: any, checkedInfo: import('element-plus').CheckedInfo) => any;
|
|
520
|
+
"onNode-drag-start"?: (node: import('element-plus/es/components/tree/src/model/node.mjs').default, evt: DragEvent) => any;
|
|
521
|
+
"onNode-drag-end"?: (draggingNode: import('element-plus/es/components/tree/src/model/node.mjs').default, dropNode: import('element-plus/es/components/tree/src/model/node.mjs').default, dropType: import('element-plus').NodeDropType, evt: DragEvent) => any;
|
|
522
|
+
"onNode-drop"?: (draggingNode: import('element-plus/es/components/tree/src/model/node.mjs').default, dropNode: import('element-plus/es/components/tree/src/model/node.mjs').default, dropType: "before" | "after" | "inner", evt: DragEvent) => any;
|
|
523
|
+
"onNode-drag-leave"?: (draggingNode: import('element-plus/es/components/tree/src/model/node.mjs').default, oldDropNode: import('element-plus/es/components/tree/src/model/node.mjs').default, evt: DragEvent) => any;
|
|
524
|
+
"onNode-drag-enter"?: (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;
|
|
525
|
+
"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;
|
|
633
526
|
}>, {
|
|
634
527
|
props: import('./tree.props').TreeOptionProps;
|
|
635
528
|
data: {
|
|
@@ -643,12 +536,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
643
536
|
showQuantity?: boolean;
|
|
644
537
|
quantity?: number;
|
|
645
538
|
}[];
|
|
539
|
+
disabled: boolean;
|
|
646
540
|
lazy: boolean;
|
|
647
541
|
modelValue: string | number | boolean | object;
|
|
648
542
|
width: string | number;
|
|
649
543
|
draggable: boolean;
|
|
650
|
-
nodeKey: string;
|
|
651
544
|
defaultExpandAll: boolean;
|
|
545
|
+
indent: number;
|
|
546
|
+
nodeKey: string;
|
|
652
547
|
checkOnClickNode: boolean;
|
|
653
548
|
highlightCurrent: boolean;
|
|
654
549
|
collapseOnClickNode: boolean;
|
|
@@ -663,6 +558,5 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
663
558
|
autoExpandParent: boolean;
|
|
664
559
|
showCheckbox: boolean;
|
|
665
560
|
accordion: boolean;
|
|
666
|
-
indent: number;
|
|
667
561
|
}, import('vue').SlotsType<Partial<import('@fast-china/utils').MakeSlots<FaTreeSlots>>>, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
668
562
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("element-plus"),a=require("@element-plus/icons-vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),t=require("element-plus"),a=require("@element-plus/icons-vue"),l=require("@fast-china/utils"),r=require("@vueuse/core"),d=require("lodash-unified"),o=require("./tree.props.js"),u={...o.treeProps,disabled:{type:Boolean,default:void 0},nodeKey:{type:String,default:"value"},defaultExpandAll:{type:Boolean,default:!0},checkOnClickNode:{type:Boolean,default:!0},highlightCurrent:{type:Boolean,default:!0},collapseOnClickNode:Boolean,modelValue:{type:l.definePropType([String,Number,Boolean,Object]),default:void 0},label:String,width:{type:[String,Number],default:180},defaultSelection:[String,Number],title:String,hamburger:Boolean,hideAll:Boolean,hideFilter:Boolean,allValue:{type:l.definePropType([String,Number,Boolean,Object]),default:void 0},data:{type:l.definePropType(Array),default:()=>[]},requestApi:{type:l.definePropType(Function)},initParam:l.definePropType([String,Number,Object])},n={...t.treeEmits,"update:modelValue":e=>d.isString(e)||d.isNumber(e)||d.isBoolean(e)||d.isObject(e)||d.isNull(e),"update:label":e=>d.isString(e)||d.isNull(e),dataChangeCallBack:e=>d.isArray(e),change:(e,t,a,l)=>!0},i=e.defineComponent({name:"FaTree",props:u,emits:n,slots:l.makeSlots(),setup(d,{attrs:u,slots:n,emit:i,expose:c}){const s=r.useVModel(d,"label",i),p=t.useGlobalSize(),h=e.reactive({value:l.withDefineType(),loading:!1,searchValue:l.withDefineType(),orgTreeData:l.withDefineType([]),treeData:l.withDefineType([]),hamburger:d.hamburger||!1,width:e.computed(()=>{if(h.hamburger)return"130px";{const e=l.addUnit(d.width);return"small"===p.value?`calc(${e} * 0.9)`:e}})}),f=e.computed(()=>0===[...h.orgTreeData].filter(e=>e[d.props.children]?.length>0).length),m=e.ref(),g=async()=>{let t;d.nodeKey&&(t=m.value.getCurrentKey());let a=[];if(d.requestApi){h.loading=!0;const e={...d.initParam??{},searchValue:h.searchValue};try{a=await d.requestApi(e)}catch(r){l.consoleError("FaTree",r)}finally{h.loading=!1}}else a=d.data;d.hideAll||a.unshift({[d.nodeKey]:d.allValue,label:"全部",value:null,all:!0}),h.orgTreeData=a,h.treeData=a,i("dataChangeCallBack",h.treeData),d.nodeKey&&t?e.nextTick(()=>{m.value.setCurrentKey(t)}):d.defaultSelection&&e.nextTick(()=>{m.value.setCurrentKey(d.defaultSelection)})},y=()=>{h.hamburger?h.treeData=h.orgTreeData:h.treeData=h.orgTreeData.map(e=>({...e,[d.props.children]:[]})),h.hamburger=!h.hamburger},v=(e,t,a)=>{if(!e)return!0;let l=a.parent,r=t.all?[t.label]:[a.label],o=1;for(;o<a.level;)r=[...r,l.label],l=l.parent,o++;const u=r.some(t=>-1!==t.indexOf(e));return d.filterNodeMethod?u&&d.filterNodeMethod(e,t,a):u},N=(e,t,a,l)=>{d.expandOnClickNode&&(t.expanded?t.expanded&&d.collapseOnClickNode&&t.collapse():t.expand()),h.value=t.key,s.value=t.label,i("update:modelValue",h.value),i("change",e,t,a,l),i("node-click",e,t,a,l)};e.onMounted(async()=>{await g(),e.watch(()=>d.data,async()=>{d.requestApi||await g()},{deep:!0})});const b=l.useProps(d,o.treeProps,["data","expandOnClickNode","filterNodeMethod"]),C=l.useEmits(t.treeEmits,i,["node-click"]);return l.useRender(()=>e.withDirectives(e.createVNode("div",{class:["el-card fa-tree",`fa-tree-${p.value}`,{"fa-tree__fold":h.hamburger||f.value}],style:{width:h.width}},[(d.title||d.hamburger)&&e.createVNode("div",{class:"fa-tree__title"},[d.title&&e.createVNode("h4",null,[d.title]),d.hamburger&&(h.hamburger?e.createVNode(t.ElIcon,{onClick:y,title:"展开"},{default:()=>[e.createVNode(a.Expand,null,null)]}):e.createVNode(t.ElIcon,{onClick:y,title:"折叠"},{default:()=>[e.createVNode(a.Fold,null,null)]}))]),!d.hideFilter&&e.createVNode(t.ElInput,{class:"fa-tree__search-input",modelValue:h.searchValue,modelModifiers:{trim:!0},"onUpdate:modelValue":e=>h.searchValue=e,placeholder:h.hamburger?"关键字过滤":"输入关键字进行过滤",clearable:!0,onInput:e=>m.value.filter(e)},null),e.createVNode(t.ElScrollbar,{class:"fa-tree__scrollbar"},{default:()=>[e.createVNode(t.ElTree,e.mergeProps(b.value,C.value,{ref:m,data:h.treeData,expandOnClickNode:!d.checkOnClickNode&&d.expandOnClickNode,filterNodeMethod:v,onNodeClick:N}),{default:({node:t,data:a})=>e.createVNode("span",{class:"el-tree-node__label",title:a?.all?a.label:t.label,style:{paddingLeft:f.value?"3px":""}},[e.createVNode("div",null,[a?.all?a.label:n.label?n.label({node:t,data:a}):t.label]),t.key&&a.showQuantity?e.createVNode("span",null,[e.createTextVNode("["),a.quantity,e.createTextVNode("]")]):null,!a?.all&&n.default&&e.createVNode("span",null,[n.default({node:t,data:a})])]),...n.empty&&{empty:()=>n.empty()}})]})]),[[e.resolveDirective("loading"),h.loading]])),l.useExpose(c,{filter:e.computed(()=>m.value?.filter),updateKeyChildren:e.computed(()=>m.value?.updateKeyChildren),getCheckedNodes:e.computed(()=>m.value?.getCheckedNodes),setCheckedNodes:e.computed(()=>m.value?.setCheckedNodes),getCheckedKeys:e.computed(()=>m.value?.getCheckedKeys),setCheckedKeys:e.computed(()=>m.value?.setCheckedKeys),setChecked:e.computed(()=>m.value?.setChecked),getHalfCheckedNodes:e.computed(()=>m.value?.getHalfCheckedNodes),getHalfCheckedKeys:e.computed(()=>m.value?.getHalfCheckedKeys),getCurrentKey:e.computed(()=>m.value?.getCurrentKey),getCurrentNode:e.computed(()=>m.value?.getCurrentNode),setCurrentKey:e.computed(()=>m.value?.setCurrentKey),setCurrentNode:e.computed(()=>m.value?.setCurrentNode),getNode:e.computed(()=>m.value?.getNode),remove:e.computed(()=>m.value?.remove),append:e.computed(()=>m.value?.append),insertBefore:e.computed(()=>m.value?.insertBefore),insertAfter:e.computed(()=>m.value?.insertAfter),loading:e.computed(()=>h.loading),refresh:g})}});exports.default=i,exports.faTreeEmits=n,exports.faTreeProps=u;
|
|
2
2
|
//# sourceMappingURL=tree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sources":["../../../../../packages/components/tree/src/tree.tsx"],"sourcesContent":["import { computed, defineComponent, nextTick, onMounted, reactive, ref, watch } from \"vue\";\nimport { ElIcon, ElInput, ElScrollbar, ElTree, useGlobalSize } from \"element-plus\";\nimport { Expand, Fold } from \"@element-plus/icons-vue\";\nimport { addUnit, consoleError, definePropType, makeSlots, useExpose, useProps, useRender, withDefineType } from \"@fast-china/utils\";\nimport { useVModel } from \"@vueuse/core\";\nimport { isArray, isBoolean, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { treeProps } from \"./tree.props\";\nimport type { FilterValue, NodeDropType, TreeKey, TreeNodeData } from \"./tree.props\";\nimport type { ElTreeOutput } from \"./tree.type\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\n\nexport const faTreeProps = {\n\t...treeProps,\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>([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>([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?: any) => Promise<ElTreeOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | any>([String, Number, Object]),\n};\n\nexport const faTreeEmits = {\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isNull(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[], orgData: ElTreeOutput[]): boolean => isArray(data) && isArray(orgData),\n\t/** @description 改变 */\n\tchange: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance, event: MouseEvent): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance) && event instanceof MouseEvent,\n\t/** @description 当节点被点击的时候触发 */\n\tnodeClick: (data: ElTreeOutput, node?: any, instance?: ComponentInternalInstance, event?: MouseEvent): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance) && event instanceof MouseEvent,\n\t/** @description 当某一节点被鼠标右键点击时会触发该事件 */\n\tnodeContextmenu: (event: Event, data: ElTreeOutput, node?: any, instance?: ComponentInternalInstance): boolean =>\n\t\tevent instanceof Event && isObject(data) && isObject(node) && isObject(instance),\n\t/** @description 当复选框被点击的时候触发 */\n\tcheckChange: (data: ElTreeOutput, checked: boolean, indeterminate: boolean): boolean =>\n\t\tisObject(data) && isBoolean(checked) && isBoolean(indeterminate),\n\t/** @description 点击节点复选框之后触发 */\n\tcheck: (\n\t\tdata: ElTreeOutput,\n\t\tnode: {\n\t\t\tcheckedNodes: ElTreeOutput[];\n\t\t\tcheckedKeys: TreeKey[];\n\t\t\thalfCheckedNodes: ElTreeOutput[];\n\t\t\thalfCheckedKeys: TreeKey[];\n\t\t}\n\t): boolean => isObject(data) && isObject(node),\n\t/** @description 当前选中节点变化时触发的事件 */\n\tcurrentChange: (data: ElTreeOutput, node: any): boolean => isObject(data) && isObject(node),\n\t/** @description 节点被展开时触发的事件 */\n\tnodeExpand: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance),\n\t/** @description 节点被关闭时触发的事件 */\n\tnodeCollapse: (data: ElTreeOutput, node: any, instance: ComponentInternalInstance): boolean =>\n\t\tisObject(data) && isObject(node) && isObject(instance),\n\t/** @description 节点开始拖拽时触发的事件 */\n\tnodeDragStart: (node: any, event: DragEvent): boolean => isObject(node) && event instanceof DragEvent,\n\t/** @description 拖拽进入其他节点时触发的事件 */\n\tnodeDragEnter: (node: any, enterNode: any, event: DragEvent): boolean => isObject(node) && isObject(enterNode) && event instanceof DragEvent,\n\t/** @description 拖拽离开某个节点时触发的事件 */\n\tnodeDragLeave: (node: any, leaveNode: any, event: DragEvent): boolean => isObject(node) && isObject(leaveNode) && event instanceof DragEvent,\n\t/** @description 在拖拽节点时触发的事件(类似浏览器的 mouseover 事件) */\n\tnodeDragOver: (node: any, dropNode: any, event: DragEvent): boolean => isObject(node) && isObject(dropNode) && event instanceof DragEvent,\n\t/** @description 拖拽结束时(可能未成功)触发的事件 */\n\tnodeDragEnd: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent): boolean =>\n\t\tisObject(node) && isObject(dropNode) && isString(dropType) && event instanceof DragEvent,\n\t/** @description 拖拽成功完成时触发的事件 */\n\tnodeDrop: (node: any, dropNode: any, dropType: NodeDropType, event: DragEvent): boolean =>\n\t\tisObject(node) && isObject(dropNode) && isString(dropType) && event instanceof DragEvent,\n};\n\ntype FaTreeSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: any; data: ElTreeOutput };\n\t/** @description 当数据为空时自定义的内容 */\n\tempty: never;\n\t/** @description 显示内容插槽 */\n\tlabel: { node: any; data: ElTreeOutput };\n};\n\nexport default defineComponent({\n\tname: \"FaTree\",\n\tprops: faTreeProps,\n\temits: faTreeEmits,\n\tslots: makeSlots<FaTreeSlots>(),\n\tsetup(props, { attrs, 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>(),\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: false,\n\t\t\twidth: computed(() => {\n\t\t\t\tif (props.hamburger || state.hamburger) {\n\t\t\t\t\treturn \"130px\";\n\t\t\t\t} else {\n\t\t\t\t\tconst width = addUnit(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>(() => [...state.orgTreeData].filter((f) => f[props.props.children]?.length > 0).length === 0);\n\n\t\tconst treeRef = ref<InstanceType<typeof ElTree>>();\n\n\t\tconst setTreeData = (treeData: ElTreeOutput[] | any[]): void => {\n\t\t\tif (!props.hideAll) {\n\t\t\t\ttreeData.unshift({ [props.nodeKey]: props.allValue, label: \"全部\", all: true } as any);\n\t\t\t}\n\t\t\tstate.treeData = treeData;\n\t\t};\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tlet curSelectedData;\n\t\t\tif (props.nodeKey) {\n\t\t\t\t// 记录原本选中的值\n\t\t\t\tcurSelectedData = treeRef.value.getCurrentKey();\n\t\t\t}\n\t\t\t// 判断是否需要自动请求\n\t\t\tif (props.requestApi) {\n\t\t\t\tstate.loading = true;\n\t\t\t\tconst params = { ...(props.initParam ?? {}), searchValue: state.searchValue };\n\t\t\t\ttry {\n\t\t\t\t\tconst resData = await props.requestApi(params);\n\t\t\t\t\tstate.orgTreeData = resData;\n\t\t\t\t\tsetTreeData(resData);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsoleError(\"FaTree\", error);\n\t\t\t\t\tstate.orgTreeData = [];\n\t\t\t\t\tsetTreeData([]);\n\t\t\t\t\temit(\"dataChangeCallBack\", state.treeData, state.orgTreeData);\n\t\t\t\t} finally {\n\t\t\t\t\tstate.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstate.orgTreeData = props.data;\n\t\t\t\tsetTreeData(props.data);\n\t\t\t}\n\t\t\tif (props.nodeKey && curSelectedData) {\n\t\t\t\tnextTick(() => {\n\t\t\t\t\t// 设置原本选中的值\n\t\t\t\t\ttreeRef.value.setCurrentKey(curSelectedData);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (props.defaultSelection) {\n\t\t\t\t\tnextTick(() => {\n\t\t\t\t\t\ttreeRef.value.setCurrentKey(props.defaultSelection);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tconst handleHamburgerClick = (): void => {\n\t\t\tif (props.hamburger || state.hamburger) {\n\t\t\t\tsetTreeData(state.orgTreeData);\n\t\t\t} else {\n\t\t\t\t// 折叠只显示一级数据\n\t\t\t\tstate.treeData = state.orgTreeData.map((m) => ({ ...m, [props.props.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: any): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels = data.all ? [data.label] : [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level) {\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 result = labels.some((label) => label.indexOf(value) !== -1);\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: any, instance: ComponentInternalInstance, event: MouseEvent): void => {\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\tstate.value = node.key;\n\t\t\tselectedLabel.value = node.label;\n\t\t\temit(\"update:modelValue\", state.value);\n\t\t\temit(\"change\", data, node, instance, event);\n\t\t\temit(\"nodeClick\", 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\tasync () => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\tawait 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\tconst elTreeProps = useProps(props, treeProps, [\"data\", \"expandOnClickNode\", \"filterNodeMethod\"]);\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\": (props.hamburger && 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 || 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={props.hamburger || state.hamburger ? \"关键字过滤\" : \"输入关键字进行过滤\"}\n\t\t\t\t\t\tclearable\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\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\tonNodeClick={handleNodeClick}\n\t\t\t\t\t\tonNodeContextmenu={(event: Event, data: ElTreeOutput, node?: any, instance?: ComponentInternalInstance) =>\n\t\t\t\t\t\t\temit(\"nodeContextmenu\", event, data, node, instance)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonCheckChange={(data: ElTreeOutput, checked: boolean, indeterminate: boolean) =>\n\t\t\t\t\t\t\temit(\"checkChange\", data, checked, indeterminate)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonCheck={(\n\t\t\t\t\t\t\tdata: ElTreeOutput,\n\t\t\t\t\t\t\tnode: {\n\t\t\t\t\t\t\t\tcheckedNodes: ElTreeOutput[];\n\t\t\t\t\t\t\t\tcheckedKeys: TreeKey[];\n\t\t\t\t\t\t\t\thalfCheckedNodes: ElTreeOutput[];\n\t\t\t\t\t\t\t\thalfCheckedKeys: TreeKey[];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t) => emit(\"check\", data, node)}\n\t\t\t\t\t\tonCurrentChange={(data: ElTreeOutput, node: any) => emit(\"currentChange\", data, node)}\n\t\t\t\t\t\tonNodeExpand={(data: ElTreeOutput, node: any, instance: ComponentInternalInstance) =>\n\t\t\t\t\t\t\temit(\"nodeExpand\", data, node, instance)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonNodeCollapse={(data: ElTreeOutput, node: any, instance: ComponentInternalInstance) =>\n\t\t\t\t\t\t\temit(\"nodeCollapse\", data, node, instance)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonNodeDragStart={(node: any, event: DragEvent) => emit(\"nodeDragStart\", node, event)}\n\t\t\t\t\t\tonNodeDragEnter={(node: any, enterNode: any, event: DragEvent) => emit(\"nodeDragEnter\", node, enterNode, event)}\n\t\t\t\t\t\tonNodeDragLeave={(node: any, leaveNode: any, event: DragEvent) => emit(\"nodeDragLeave\", node, leaveNode, event)}\n\t\t\t\t\t\tonNodeDragOver={(node: any, dropNode: any, event: DragEvent) => emit(\"nodeDragOver\", node, dropNode, event)}\n\t\t\t\t\t\tonNodeDragEnd={(node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) =>\n\t\t\t\t\t\t\temit(\"nodeDragEnd\", node, dropNode, dropType, event)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonNodeDrop={(node: any, dropNode: any, dropType: NodeDropType, event: DragEvent) =>\n\t\t\t\t\t\t\temit(\"nodeDrop\", node, dropNode, dropType, event)\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{{\n\t\t\t\t\t\t\tdefault: ({ node, data }: { node: any; 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<span>{slots.label ? slots.label({ node, data }) : data?.all ? data.label : node.label}</span>\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{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 为节点设置新数据,只有当设置 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"],"names":["faTreeProps","treeProps","nodeKey","type","String","default","defaultExpandAll","Boolean","checkOnClickNode","highlightCurrent","collapseOnClickNode","modelValue","definePropType","Number","Object","undefined","label","width","defaultSelection","title","hamburger","hideAll","hideFilter","allValue","data","Array","requestApi","Function","initParam","faTreeEmits","isString","value","isNumber","isBoolean","isObject","isNull","dataChangeCallBack","orgData","isArray","change","node","instance","event","MouseEvent","nodeClick","nodeContextmenu","Event","checkChange","checked","indeterminate","check","currentChange","nodeExpand","nodeCollapse","nodeDragStart","DragEvent","nodeDragEnter","enterNode","nodeDragLeave","leaveNode","nodeDragOver","dropNode","nodeDragEnd","dropType","nodeDrop","Tree","name","props","emits","slots","makeSlots","setup","attrs","emit","expose","selectedLabel","useVModel","passive","_globalSize","useGlobalSize","state","reactive","withDefineType","loading","searchValue","orgTreeData","treeData","computed","addUnit","fold","filter","f","children","length","treeRef","ref","setTreeData","unshift","all","loadData","async","curSelectedData","getCurrentKey","params","resData","error","consoleError","nextTick","setCurrentKey","handleHamburgerClick","map","m","handleFilterNode","child","parentNode","parent","labels","level","result","some","indexOf","filterNodeMethod","handleNodeClick","expandOnClickNode","expanded","collapse","expand","key","onMounted","watch","deep","elTreeProps","useProps","useRender","_withDirectives","_createVNode","class","style","ElIcon","onClick","Expand","Fold","ElInput","modelModifiers","trim","$event","placeholder","clearable","onInput","ElScrollbar","ElTree","_mergeProps","onNodeClick","onNodeContextmenu","onCheckChange","onCheck","onCurrentChange","onNodeExpand","onNodeCollapse","onNodeDragStart","onNodeDragEnter","onNodeDragLeave","onNodeDragOver","onNodeDragEnd","onNodeDrop","paddingLeft","showQuantity","_createTextVNode","quantity","empty","_resolveDirective","useExpose","updateKeyChildren","getCheckedNodes","setCheckedNodes","getCheckedKeys","setCheckedKeys","setChecked","getHalfCheckedNodes","getHalfCheckedKeys","getCurrentNode","setCurrentNode","getNode","remove","append","insertBefore","insertAfter","refresh"],"mappings":"oTAWaA,EAAc,IACvBC,EAAAA,UAEHC,QAAS,CACRC,KAAMC,OACNC,QAAS,SAGVC,iBAAkB,CACjBH,KAAMI,QACNF,SAAS,GAGVG,iBAAkB,CACjBL,KAAMI,QACNF,SAAS,GAGVI,iBAAkB,CACjBN,KAAMI,QACNF,SAAS,GAGVK,oBAAqBH,QAErBI,WAAY,CACXR,KAAMS,EAAAA,eAAmD,CAACR,OAAQS,OAAQN,QAASO,SACnFT,aAASU,GAGVC,MAAOZ,OAEPa,MAAO,CACNd,KAAM,CAACC,OAAQS,QACfR,QAAS,KAGVa,iBAAkB,CAACd,OAAQS,QAE3BM,MAAOf,OAEPgB,UAAWb,QAEXc,QAASd,QAETe,WAAYf,QAEZgB,SAAU,CACTpB,KAA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onMounted, reactive, ref, watch } from \"vue\";\nimport { ElIcon, ElInput, ElScrollbar, ElTree, treeEmits, useGlobalSize } from \"element-plus\";\nimport { Expand, Fold } from \"@element-plus/icons-vue\";\nimport { addUnit, consoleError, definePropType, makeSlots, useEmits, useExpose, useProps, useRender, withDefineType } from \"@fast-china/utils\";\nimport { useVModel } from \"@vueuse/core\";\nimport { isArray, isBoolean, isNull, isNumber, isObject, isString } from \"lodash-unified\";\nimport { treeProps } from \"./tree.props\";\nimport type { FilterValue, TreeNodeData } from \"./tree.props\";\nimport type { ElTreeOutput } from \"./tree.type\";\nimport type { ComponentInternalInstance, VNode } from \"vue\";\n\nexport const faTreeProps = {\n\t...treeProps,\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>([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>([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?: any) => Promise<ElTreeOutput[]>>(Function),\n\t},\n\t/** 初始化参数 */\n\tinitParam: definePropType<string | number | any>([String, Number, Object]),\n};\n\nexport const faTreeEmits = {\n\t...treeEmits,\n\t/** @description v-model 回调 */\n\t\"update:modelValue\": (value: string | number | boolean | object): boolean =>\n\t\tisString(value) || isNumber(value) || isBoolean(value) || isObject(value) || isNull(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: any, instance: ComponentInternalInstance, event: MouseEvent): boolean => true,\n};\n\ntype FaTreeSlots = {\n\t/** @description 默认内容插槽 */\n\tdefault: { node: any; data: ElTreeOutput };\n\t/** @description 当数据为空时自定义的内容 */\n\tempty: never;\n\t/** @description 显示内容插槽 */\n\tlabel: { node: any; data: ElTreeOutput };\n};\n\nexport default defineComponent({\n\tname: \"FaTree\",\n\tprops: faTreeProps,\n\temits: faTreeEmits,\n\tslots: makeSlots<FaTreeSlots>(),\n\tsetup(props, { attrs, slots, emit, expose }) {\n\t\tconst selectedLabel = useVModel(props, \"label\", emit);\n\t\tconst _globalSize = useGlobalSize();\n\n\t\tconst state = reactive({\n\t\t\tvalue: withDefineType<string | number | boolean | object>(),\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 = addUnit(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>(() => [...state.orgTreeData].filter((f) => f[props.props.children]?.length > 0).length === 0);\n\n\t\tconst treeRef = ref<InstanceType<typeof ElTree>>();\n\n\t\tconst loadData = async (): Promise<void> => {\n\t\t\tlet curSelectedData;\n\t\t\tif (props.nodeKey) {\n\t\t\t\t// 记录原本选中的值\n\t\t\t\tcurSelectedData = treeRef.value.getCurrentKey();\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 = { ...(props.initParam ?? {}), searchValue: state.searchValue };\n\t\t\t\ttry {\n\t\t\t\t\ttreeData = await props.requestApi(params);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsoleError(\"FaTree\", error);\n\t\t\t\t} finally {\n\t\t\t\t\tstate.loading = false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttreeData = props.data;\n\t\t\t}\n\t\t\tif (!props.hideAll) {\n\t\t\t\ttreeData.unshift({ [props.nodeKey]: props.allValue, label: \"全部\", value: null, all: true } as any);\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\tif (props.nodeKey && curSelectedData) {\n\t\t\t\tnextTick(() => {\n\t\t\t\t\t// 设置原本选中的值\n\t\t\t\t\ttreeRef.value.setCurrentKey(curSelectedData);\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tif (props.defaultSelection) {\n\t\t\t\t\tnextTick(() => {\n\t\t\t\t\t\ttreeRef.value.setCurrentKey(props.defaultSelection);\n\t\t\t\t\t});\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((m) => ({ ...m, [props.props.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: any): boolean => {\n\t\t\tif (!value) return true;\n\t\t\tlet parentNode = child.parent,\n\t\t\t\tlabels = data.all ? [data.label] : [child.label],\n\t\t\t\tlevel = 1;\n\t\t\twhile (level < child.level) {\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 result = labels.some((label) => label.indexOf(value) !== -1);\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: any, instance: ComponentInternalInstance, event: MouseEvent): void => {\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\tstate.value = node.key;\n\t\t\tselectedLabel.value = node.label;\n\t\t\temit(\"update:modelValue\", state.value);\n\t\t\temit(\"change\", data, node, instance, event);\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\tasync () => {\n\t\t\t\t\tif (!props.requestApi) {\n\t\t\t\t\t\tawait 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\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 || 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\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\tonNodeClick={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: any; 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 为节点设置新数据,只有当设置 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"],"names":["faTreeProps","treeProps","disabled","type","Boolean","default","undefined","nodeKey","String","defaultExpandAll","checkOnClickNode","highlightCurrent","collapseOnClickNode","modelValue","definePropType","Number","Object","label","width","defaultSelection","title","hamburger","hideAll","hideFilter","allValue","data","Array","requestApi","Function","initParam","faTreeEmits","treeEmits","isString","value","isNumber","isBoolean","isObject","isNull","dataChangeCallBack","isArray","change","node","instance","event","Tree","name","props","emits","slots","makeSlots","setup","attrs","emit","expose","selectedLabel","useVModel","_globalSize","useGlobalSize","state","reactive","withDefineType","loading","searchValue","orgTreeData","treeData","computed","addUnit","fold","filter","f","children","length","treeRef","ref","loadData","async","curSelectedData","getCurrentKey","params","error","consoleError","unshift","all","nextTick","setCurrentKey","handleHamburgerClick","map","m","handleFilterNode","child","parentNode","parent","labels","level","result","some","indexOf","filterNodeMethod","handleNodeClick","expandOnClickNode","expanded","collapse","expand","key","onMounted","watch","deep","elTreeProps","useProps","elTreeEmits","useEmits","useRender","_withDirectives","_createVNode","class","style","ElIcon","onClick","Expand","Fold","ElInput","modelModifiers","trim","$event","placeholder","clearable","onInput","ElScrollbar","ElTree","_mergeProps","onNodeClick","paddingLeft","showQuantity","_createTextVNode","quantity","empty","_resolveDirective","useExpose","updateKeyChildren","getCheckedNodes","setCheckedNodes","getCheckedKeys","setCheckedKeys","setChecked","getHalfCheckedNodes","getHalfCheckedKeys","getCurrentNode","setCurrentNode","getNode","remove","append","insertBefore","insertAfter","refresh"],"mappings":"oTAWaA,EAAc,IACvBC,EAAAA,UAEHC,SAAU,CACTC,KAAMC,QACNC,aAASC,GAGVC,QAAS,CACRJ,KAAMK,OACNH,QAAS,SAGVI,iBAAkB,CACjBN,KAAMC,QACNC,SAAS,GAGVK,iBAAkB,CACjBP,KAAMC,QACNC,SAAS,GAGVM,iBAAkB,CACjBR,KAAMC,QACNC,SAAS,GAGVO,oBAAqBR,QAErBS,WAAY,CACXV,KAAMW,EAAAA,eAAmD,CAACN,OAAQO,OAAQX,QAASY,SACnFX,aAASC,GAGVW,MAAOT,OAEPU,MAAO,CACNf,KAAM,CAACK,OAAQO,QACfV,QAAS,KAGVc,iBAAkB,CAACX,OAAQO,QAE3BK,MAAOZ,OAEPa,UAAWjB,QAEXkB,QAASlB,QAETmB,WAAYnB,QAEZoB,SAAU,CACTrB,KAAMW,EAAAA,eAAmD,CAACN,OAAQO,OAAQX,QAASY,SACnFX,aAASC,GAGVmB,KAAM,CACLtB,KAAMW,EAAAA,eAA+BY,OACrCrB,QAASA,IAAsB,IAGhCsB,WAAY,CACXxB,KAAMW,EAAAA,eAA0Dc,WAGjEC,UAAWf,EAAAA,eAAsC,CAACN,OAAQO,OAAQC,UAGtDc,EAAc,IACvBC,EAAAA,UAEH,uBACCC,EAAAA,SAASC,IAAUC,EAAAA,SAASD,IAAUE,EAAAA,UAAUF,IAAUG,EAAAA,SAASH,IAAUI,EAAAA,OAAOJ,GAErF,kBAA4CD,EAAAA,SAASC,IAAUI,EAAAA,OAAOJ,GAEtEK,mBAAqBb,GAAkCc,EAAAA,QAAQd,GAE/De,OAAQA,CAACf,EAAoBgB,EAAWC,EAAqCC,KAA+B,GAY7GC,oBAA+B,CAC9BC,KAAM,SACNC,MAAO9C,EACP+C,MAAO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