@dt-frames/ui 1.0.9 → 1.0.12
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/es/components/curd/src/components/dialog.d.ts +8 -3
- package/es/components/forms/src/components/formIcon.d.ts +1 -1
- package/es/components/forms/src/components/formInputUseDialog.d.ts +903 -0
- package/es/components/forms/src/types/form.type.d.ts +6 -4
- package/es/components/index.d.ts +3 -2
- package/es/components/modal/src/types/modal.type.d.ts +5 -2
- package/es/components/source/src/hooks/useFetch.d.ts +2 -2
- package/es/components/source/src/hooks/useSource.d.ts +8 -8
- package/es/components/source/src/types/table.type.d.ts +1 -1
- package/es/components/table/src/components/TableActions.d.ts +2 -2
- package/es/components/table/src/components/TableHeader.d.ts +2 -2
- package/es/components/table/src/components/editable/CellComponent.d.ts +14 -0
- package/es/components/table/src/components/editable/EditTableCell.d.ts +88 -0
- package/es/components/table/src/components/editable/componentMap.d.ts +4 -0
- package/es/components/table/src/components/editable/index.d.ts +9 -0
- package/es/components/table/src/components/setting/Download.d.ts +2 -2
- package/es/components/table/src/components/setting/Size.d.ts +2 -2
- package/es/components/table/src/hooks/useCustomRow.d.ts +19 -0
- package/es/components/table/src/index.d.ts +29 -6
- package/es/components/table/src/props.d.ts +5 -1
- package/es/components/table/src/types/table.type.d.ts +16 -0
- package/es/components/tree/index.d.ts +2 -0
- package/es/components/tree/src/hooks/useTree.d.ts +14 -0
- package/es/components/tree/src/props.d.ts +101 -0
- package/es/components/tree/src/type/tree.d.ts +85 -0
- package/es/components/tree/src/utils/tree.d.ts +5 -0
- package/es/components/upload/index.d.ts +3 -0
- package/es/components/upload/src/helper.d.ts +4 -0
- package/es/components/upload/src/index.d.ts +2807 -0
- package/es/components/upload/src/props.d.ts +40 -0
- package/es/components/upload/src/upload.d.ts +1653 -0
- package/es/index.js +2113 -270
- package/es/style/components/forms/index.less +23 -0
- package/es/style/components/table/index.less +8 -2
- package/es/style/components/tree/index.less +41 -0
- package/es/style/components/upload/index.less +43 -0
- package/es/style/theme/header/index.less +1 -1
- package/es/theme/sider/components/basic-menu/basic-menu.d.ts +3 -3
- package/es/theme/tabs/components/TabContent.d.ts +2 -2
- package/package.json +2 -1
- package/src/components/curd/src/components/dialog.vue +7 -4
- package/src/components/curd/src/hooks/useCurd.tsx +1 -1
- package/src/components/forms/index.less +23 -0
- package/src/components/forms/src/componentMap.ts +2 -0
- package/src/components/forms/src/components/formInputUseDialog.vue +43 -0
- package/src/components/forms/src/components/formItem.vue +25 -12
- package/src/components/forms/src/hooks/useFormEvents.ts +4 -3
- package/src/components/forms/src/hooks/useFormValues.ts +1 -1
- package/src/components/forms/src/types/form.type.ts +9 -3
- package/src/components/index.ts +9 -3
- package/src/components/modal/src/hooks/useModal.ts +12 -4
- package/src/components/modal/src/index.vue +2 -2
- package/src/components/modal/src/types/modal.type.ts +5 -2
- package/src/components/source/src/hooks/useFetch.ts +10 -6
- package/src/components/source/src/hooks/useSource.ts +33 -12
- package/src/components/source/src/types/table.type.ts +1 -1
- package/src/components/table/index.less +8 -2
- package/src/components/table/src/components/TableHeader.vue +2 -2
- package/src/components/table/src/components/editable/CellComponent.ts +57 -0
- package/src/components/table/src/components/editable/EditTableCell.vue +181 -0
- package/src/components/table/src/components/editable/componentMap.ts +18 -0
- package/src/components/table/src/components/editable/index.ts +58 -0
- package/src/components/table/src/hooks/useColumns.ts +15 -8
- package/src/components/table/src/hooks/useCustomRow.ts +86 -0
- package/src/components/table/src/hooks/useDataSource.ts +0 -13
- package/src/components/table/src/hooks/useTableHeader.ts +2 -2
- package/src/components/table/src/index.vue +20 -3
- package/src/components/table/src/props.ts +4 -1
- package/src/components/table/src/types/table.type.ts +28 -1
- package/src/components/tree/index.less +41 -0
- package/src/components/tree/index.ts +5 -0
- package/src/components/tree/src/components/TreeHeader.vue +97 -0
- package/src/components/tree/src/hooks/useTree.ts +239 -0
- package/src/components/tree/src/index.vue +392 -0
- package/src/components/tree/src/props.ts +133 -0
- package/src/components/tree/src/type/tree.ts +105 -0
- package/src/components/tree/src/utils/tree.ts +73 -0
- package/src/components/upload/index.less +43 -0
- package/src/components/upload/index.ts +7 -0
- package/src/components/upload/src/helper.ts +32 -0
- package/src/components/upload/src/index.vue +38 -0
- package/src/components/upload/src/props.ts +48 -0
- package/src/components/upload/src/upload.vue +166 -0
- package/src/theme/header/helper/menu-tree.ts +2 -2
- package/src/theme/header/index.less +1 -1
- package/src/theme/sider/helper/split-menu.ts +2 -2
- package/es/components/dialog/index.d.ts +0 -2
- package/es/components/dialog/src/hooks/useDialog.d.ts +0 -3
- package/src/components/dialog/index.ts +0 -5
- package/src/components/dialog/src/hooks/useDialog.ts +0 -85
package/es/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent, resolveComponent, openBlock, createBlock, computed, unref, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, ref, watch, Fragment, renderList, createTextVNode, toDisplayString, KeepAlive, createVNode, withCtx, reactive, toRaw, getCurrentInstance, watchEffect, nextTick, onUnmounted, toRefs, isVNode, inject, h, provide, onMounted, onBeforeUnmount, resolveDynamicComponent, renderSlot, createCommentVNode, mergeProps, readonly, isRef,
|
|
2
|
-
import { isString, isArray as isArray$1, isObject, isFunction, error, useTimeoutFn, useAttrs, useSlots, dispatchResize, BAR_MAP, off, renderThumbStyle, on, useAppStore, addResizeListener, removeResizeListener, windowResizeFn, isNumber, isBoolean, isNull, DtCache, CacheKey, deepMerge,
|
|
3
|
-
import { InputSearch, Tooltip, Modal as Modal$1, RadioGroup, RadioButton, InputGroup, Input, Button, Select, TreeSelect, Radio, Checkbox, AutoComplete, Cascader, DatePicker, InputNumber, Switch, TimePicker, Slider, Rate, Divider, Col, Form, FormItem, Row, Dropdown, Menu, MenuItem,
|
|
4
|
-
import { isEqual, cloneDeep, upperFirst, set, uniqBy,
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createBlock, computed, unref, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, ref, watch, Fragment, renderList, createTextVNode, toDisplayString, KeepAlive, createVNode, withCtx, reactive, toRaw, getCurrentInstance, watchEffect, nextTick, onUnmounted, toRefs, isVNode, inject, h, provide, onMounted, onBeforeUnmount, resolveDynamicComponent, renderSlot, createCommentVNode, mergeProps, readonly, isRef, useAttrs as useAttrs$1, normalizeProps, guardReactiveProps, withDirectives, resolveDirective, render, createSlots, useSlots as useSlots$1, withModifiers, vShow, toRef, Transition } from "vue";
|
|
2
|
+
import { isString, isArray as isArray$1, isObject, isFunction, error, useTimeoutFn, useAttrs, useSlots, dispatchResize, BAR_MAP, off, renderThumbStyle, on, useAppStore, addResizeListener, removeResizeListener, windowResizeFn, isNumber, isBoolean, isNull, DtCache, CacheKey, deepMerge, http, getDynamicProps, getDictValueByCode, formatNumber, isVnode, getPopupContainer, isNullAndUnDef, dateFormat, useMessage, isEmpty, useTheme, useMenu, useHeader, useGo, Pages, localeList, changeLocale, Theme, MenuMode, MenuType, useThemeStore, ContentMode, useMultipleTab, copyText, MenuSplitTye, isUrl, openWindow, RouteReuseStore, menuList2Map, useApp } from "@dt-frames/core";
|
|
3
|
+
import { InputSearch, Tooltip, Modal as Modal$1, RadioGroup, RadioButton, InputGroup, Input, Button, Select, TreeSelect, Radio, Checkbox, AutoComplete, Cascader, DatePicker, InputNumber, Switch, TimePicker, Slider, Rate, Divider, Col, Form, FormItem, Row, Popover, Spin, Dropdown, Menu, MenuItem, CheckboxGroup, Table, Upload, Image, MenuDivider, Tree, Empty, BackTop, Breadcrumb, Avatar, Drawer, SubMenu, LayoutHeader, LayoutSider, Tabs, TabPane, LayoutFooter, LayoutContent, ConfigProvider, Layout } from "ant-design-vue";
|
|
4
|
+
import { isEqual, omit, cloneDeep, upperFirst, set, uniqBy, difference, get, trim } from "lodash-es";
|
|
5
5
|
import { tryOnUnmounted, isFunction as isFunction$1, useFullscreen, useDebounceFn, useThrottleFn } from "@vueuse/core";
|
|
6
6
|
import Sortablejs from "sortablejs";
|
|
7
7
|
import * as xlsx from "xlsx";
|
|
@@ -14,15 +14,15 @@ var _export_sfc = (sfc, props) => {
|
|
|
14
14
|
}
|
|
15
15
|
return target;
|
|
16
16
|
};
|
|
17
|
-
const _sfc_main$
|
|
17
|
+
const _sfc_main$Z = defineComponent({
|
|
18
18
|
name: "dt-base-router"
|
|
19
19
|
});
|
|
20
|
-
function _sfc_render$
|
|
20
|
+
function _sfc_render$8(_ctx, _cache, $props, $setup, $data, $options) {
|
|
21
21
|
const _component_router_view = resolveComponent("router-view");
|
|
22
22
|
return openBlock(), createBlock(_component_router_view);
|
|
23
23
|
}
|
|
24
|
-
var DtBaseRouter = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
25
|
-
const _sfc_main$
|
|
24
|
+
var DtBaseRouter = /* @__PURE__ */ _export_sfc(_sfc_main$Z, [["render", _sfc_render$8]]);
|
|
25
|
+
const _sfc_main$Y = defineComponent({
|
|
26
26
|
props: {
|
|
27
27
|
iconClass: {
|
|
28
28
|
type: String,
|
|
@@ -90,8 +90,8 @@ const _sfc_main$S = defineComponent({
|
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
92
|
});
|
|
93
|
-
const _hoisted_1$
|
|
94
|
-
function _sfc_render$
|
|
93
|
+
const _hoisted_1$x = ["xlink:href", "fill"];
|
|
94
|
+
function _sfc_render$7(_ctx, _cache, $props, $setup, $data, $options) {
|
|
95
95
|
return _ctx.isSvgIcon ? (openBlock(), createElementBlock("svg", {
|
|
96
96
|
key: 0,
|
|
97
97
|
class: normalizeClass(_ctx.clsName),
|
|
@@ -105,7 +105,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
105
105
|
createElementVNode("use", {
|
|
106
106
|
"xlink:href": _ctx.iconName,
|
|
107
107
|
fill: _ctx.color
|
|
108
|
-
}, null, 8, _hoisted_1$
|
|
108
|
+
}, null, 8, _hoisted_1$x)
|
|
109
109
|
], 6)) : (openBlock(), createElementBlock("i", {
|
|
110
110
|
key: 1,
|
|
111
111
|
class: normalizeClass(["dt-icon i", [_ctx.iconName, _ctx.clsName]]),
|
|
@@ -115,7 +115,7 @@ function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
115
115
|
})
|
|
116
116
|
}, null, 6));
|
|
117
117
|
}
|
|
118
|
-
var DtIcon = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
118
|
+
var DtIcon = /* @__PURE__ */ _export_sfc(_sfc_main$Y, [["render", _sfc_render$7]]);
|
|
119
119
|
const Actions = [
|
|
120
120
|
"ic:baseline-save",
|
|
121
121
|
"ic:baseline-save-all",
|
|
@@ -1026,7 +1026,7 @@ const Edit = [
|
|
|
1026
1026
|
"mdi:view-sequential",
|
|
1027
1027
|
"mdi:view-split-vertical"
|
|
1028
1028
|
];
|
|
1029
|
-
const File = [
|
|
1029
|
+
const File$1 = [
|
|
1030
1030
|
"ic:baseline-approval",
|
|
1031
1031
|
"ic:baseline-attach-email",
|
|
1032
1032
|
"ic:baseline-cloud",
|
|
@@ -1847,7 +1847,7 @@ const Icons = [
|
|
|
1847
1847
|
},
|
|
1848
1848
|
{
|
|
1849
1849
|
type: "\u6587\u4EF6",
|
|
1850
|
-
children: File
|
|
1850
|
+
children: File$1
|
|
1851
1851
|
},
|
|
1852
1852
|
{
|
|
1853
1853
|
type: "\u6570\u5B66",
|
|
@@ -1874,15 +1874,15 @@ const Icons = [
|
|
|
1874
1874
|
children: Other
|
|
1875
1875
|
}
|
|
1876
1876
|
];
|
|
1877
|
-
const _hoisted_1$
|
|
1878
|
-
const _hoisted_2$
|
|
1879
|
-
const _sfc_main$
|
|
1877
|
+
const _hoisted_1$w = ["onClick"];
|
|
1878
|
+
const _hoisted_2$l = ["onClick"];
|
|
1879
|
+
const _sfc_main$X = /* @__PURE__ */ defineComponent({
|
|
1880
1880
|
__name: "pick-icon",
|
|
1881
1881
|
emits: ["chooseIcon"],
|
|
1882
1882
|
setup(__props, { emit: emits }) {
|
|
1883
1883
|
const clsPrefix = "dt-pick-icon";
|
|
1884
1884
|
const activeIndex = ref(1);
|
|
1885
|
-
const
|
|
1885
|
+
const filter2 = ref(null);
|
|
1886
1886
|
const currentIcons = ref([]);
|
|
1887
1887
|
const activeIcon = ref(null);
|
|
1888
1888
|
const iconMenus = computed(() => {
|
|
@@ -1920,7 +1920,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
1920
1920
|
immediate: true
|
|
1921
1921
|
});
|
|
1922
1922
|
function onFilter(e) {
|
|
1923
|
-
currentIcons.value = getIcons().filter((it) => it.indexOf(unref(
|
|
1923
|
+
currentIcons.value = getIcons().filter((it) => it.indexOf(unref(filter2)) !== -1);
|
|
1924
1924
|
}
|
|
1925
1925
|
function selectIcon(icon) {
|
|
1926
1926
|
activeIcon.value = icon;
|
|
@@ -1933,17 +1933,17 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
1933
1933
|
createElementVNode("div", {
|
|
1934
1934
|
class: normalizeClass(`${clsPrefix}__menus`)
|
|
1935
1935
|
}, [
|
|
1936
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(iconMenus), (menu,
|
|
1936
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(iconMenus), (menu, index) => {
|
|
1937
1937
|
return openBlock(), createElementBlock("div", {
|
|
1938
1938
|
key: menu.type,
|
|
1939
|
-
class: normalizeClass(["menu", { "active": activeIndex.value ===
|
|
1940
|
-
onClick: ($event) => activeIndex.value =
|
|
1939
|
+
class: normalizeClass(["menu", { "active": activeIndex.value === index }]),
|
|
1940
|
+
onClick: ($event) => activeIndex.value = index
|
|
1941
1941
|
}, [
|
|
1942
1942
|
createElementVNode("p", null, [
|
|
1943
1943
|
createTextVNode(toDisplayString(menu.type), 1),
|
|
1944
1944
|
createElementVNode("span", null, "(" + toDisplayString(menu.total) + ")", 1)
|
|
1945
1945
|
])
|
|
1946
|
-
], 10, _hoisted_1$
|
|
1946
|
+
], 10, _hoisted_1$w);
|
|
1947
1947
|
}), 128))
|
|
1948
1948
|
], 2),
|
|
1949
1949
|
createElementVNode("div", {
|
|
@@ -1954,8 +1954,8 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
1954
1954
|
class: normalizeClass(`${clsPrefix}__content_item`)
|
|
1955
1955
|
}, [
|
|
1956
1956
|
createVNode(unref(InputSearch), {
|
|
1957
|
-
value:
|
|
1958
|
-
"onUpdate:value": _cache[0] || (_cache[0] = ($event) =>
|
|
1957
|
+
value: filter2.value,
|
|
1958
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => filter2.value = $event),
|
|
1959
1959
|
"enter-button": "",
|
|
1960
1960
|
placeholder: "\u8BF7\u8F93\u5165\u8FC7\u6EE4\u6761\u4EF6",
|
|
1961
1961
|
onSearch: onFilter
|
|
@@ -1980,7 +1980,7 @@ const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
|
1980
1980
|
]),
|
|
1981
1981
|
_: 2
|
|
1982
1982
|
}, 1024)
|
|
1983
|
-
], 10, _hoisted_2$
|
|
1983
|
+
], 10, _hoisted_2$l);
|
|
1984
1984
|
}), 128))
|
|
1985
1985
|
], 2)
|
|
1986
1986
|
], 1024))
|
|
@@ -2106,7 +2106,8 @@ function useModal(props, callbackFn) {
|
|
|
2106
2106
|
getVisible: computed(() => visibleData[~~unref(uidRef)]),
|
|
2107
2107
|
closeModal: (rsp) => {
|
|
2108
2108
|
var _a;
|
|
2109
|
-
cbTransfer[unref(uidRef)]
|
|
2109
|
+
if (cbTransfer[unref(uidRef)])
|
|
2110
|
+
cbTransfer[unref(uidRef)](rsp);
|
|
2110
2111
|
(_a = getInstance()) == null ? void 0 : _a.setModalProps({ visible: false });
|
|
2111
2112
|
},
|
|
2112
2113
|
openModal: (visable = true, data, openOnSet = true) => {
|
|
@@ -2383,8 +2384,8 @@ var Bar = defineComponent({
|
|
|
2383
2384
|
}));
|
|
2384
2385
|
}
|
|
2385
2386
|
});
|
|
2386
|
-
const _hoisted_1$
|
|
2387
|
-
const _sfc_main$
|
|
2387
|
+
const _hoisted_1$v = { class: "scrollbar" };
|
|
2388
|
+
const _sfc_main$W = /* @__PURE__ */ defineComponent({
|
|
2388
2389
|
__name: "scroll-bar",
|
|
2389
2390
|
props: {
|
|
2390
2391
|
wrapClass: {
|
|
@@ -2461,7 +2462,7 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
|
2461
2462
|
}
|
|
2462
2463
|
});
|
|
2463
2464
|
return (_ctx, _cache) => {
|
|
2464
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
2465
|
+
return openBlock(), createElementBlock("div", _hoisted_1$v, [
|
|
2465
2466
|
createElementVNode("div", {
|
|
2466
2467
|
ref_key: "wrap",
|
|
2467
2468
|
ref: wrap,
|
|
@@ -2496,12 +2497,12 @@ const _sfc_main$Q = /* @__PURE__ */ defineComponent({
|
|
|
2496
2497
|
};
|
|
2497
2498
|
}
|
|
2498
2499
|
});
|
|
2499
|
-
const _sfc_main$
|
|
2500
|
+
const _sfc_main$V = /* @__PURE__ */ defineComponent({
|
|
2500
2501
|
__name: "scroll-container",
|
|
2501
2502
|
setup(__props) {
|
|
2502
2503
|
const scrollbarRef = ref(null);
|
|
2503
2504
|
return (_ctx, _cache) => {
|
|
2504
|
-
return openBlock(), createBlock(_sfc_main$
|
|
2505
|
+
return openBlock(), createBlock(_sfc_main$W, mergeProps({
|
|
2505
2506
|
ref_key: "scrollbarRef",
|
|
2506
2507
|
ref: scrollbarRef,
|
|
2507
2508
|
class: "scroll-container"
|
|
@@ -2514,7 +2515,7 @@ const _sfc_main$P = /* @__PURE__ */ defineComponent({
|
|
|
2514
2515
|
};
|
|
2515
2516
|
}
|
|
2516
2517
|
});
|
|
2517
|
-
const _sfc_main$
|
|
2518
|
+
const _sfc_main$U = /* @__PURE__ */ defineComponent({
|
|
2518
2519
|
__name: "modal-wrap",
|
|
2519
2520
|
props: {
|
|
2520
2521
|
loading: { type: Boolean },
|
|
@@ -2602,7 +2603,7 @@ const _sfc_main$O = /* @__PURE__ */ defineComponent({
|
|
|
2602
2603
|
}
|
|
2603
2604
|
});
|
|
2604
2605
|
return (_ctx, _cache) => {
|
|
2605
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
2606
|
+
return openBlock(), createBlock(unref(_sfc_main$V), {
|
|
2606
2607
|
ref_key: "wrapperRef",
|
|
2607
2608
|
ref: wrapperRef
|
|
2608
2609
|
}, {
|
|
@@ -2688,7 +2689,7 @@ function useFormValue(props, key = "value", changeEvent = "change", emitData) {
|
|
|
2688
2689
|
});
|
|
2689
2690
|
return [state, setState, defaultState];
|
|
2690
2691
|
}
|
|
2691
|
-
const _sfc_main$
|
|
2692
|
+
const _sfc_main$T = defineComponent({
|
|
2692
2693
|
name: "radio-button",
|
|
2693
2694
|
props: {
|
|
2694
2695
|
value: {
|
|
@@ -2721,7 +2722,7 @@ const _sfc_main$N = defineComponent({
|
|
|
2721
2722
|
};
|
|
2722
2723
|
}
|
|
2723
2724
|
});
|
|
2724
|
-
function _sfc_render$
|
|
2725
|
+
function _sfc_render$6(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2725
2726
|
const _component_RadioButton = resolveComponent("RadioButton", true);
|
|
2726
2727
|
const _component_RadioGroup = resolveComponent("RadioGroup");
|
|
2727
2728
|
return openBlock(), createBlock(_component_RadioGroup, mergeProps(_ctx.attrs, {
|
|
@@ -2746,8 +2747,8 @@ function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
2746
2747
|
_: 1
|
|
2747
2748
|
}, 16, ["value"]);
|
|
2748
2749
|
}
|
|
2749
|
-
var RadioButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
2750
|
-
const _sfc_main$
|
|
2750
|
+
var RadioButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$T, [["render", _sfc_render$6]]);
|
|
2751
|
+
const _sfc_main$S = /* @__PURE__ */ defineComponent({
|
|
2751
2752
|
__name: "formIcon",
|
|
2752
2753
|
props: {
|
|
2753
2754
|
value: String,
|
|
@@ -2797,9 +2798,9 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
2797
2798
|
]),
|
|
2798
2799
|
_: 1
|
|
2799
2800
|
}),
|
|
2800
|
-
createVNode(unref(_sfc_main$
|
|
2801
|
+
createVNode(unref(_sfc_main$L), { onRegister: unref(register) }, {
|
|
2801
2802
|
default: withCtx(() => [
|
|
2802
|
-
createVNode(unref(_sfc_main$
|
|
2803
|
+
createVNode(unref(_sfc_main$X), {
|
|
2803
2804
|
onChooseIcon: _cache[2] || (_cache[2] = ($event) => chooseIcon($event))
|
|
2804
2805
|
})
|
|
2805
2806
|
]),
|
|
@@ -2809,8 +2810,47 @@ const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
|
2809
2810
|
};
|
|
2810
2811
|
}
|
|
2811
2812
|
});
|
|
2813
|
+
const _hoisted_1$u = { class: "input-with-dialog" };
|
|
2814
|
+
const _sfc_main$R = /* @__PURE__ */ defineComponent({
|
|
2815
|
+
__name: "formInputUseDialog",
|
|
2816
|
+
setup(__props) {
|
|
2817
|
+
const attrs = useAttrs$1();
|
|
2818
|
+
const bindProps = computed(() => {
|
|
2819
|
+
return {
|
|
2820
|
+
...omit(attrs, [
|
|
2821
|
+
"formValues"
|
|
2822
|
+
]),
|
|
2823
|
+
disabled: true
|
|
2824
|
+
};
|
|
2825
|
+
});
|
|
2826
|
+
function onClickInput() {
|
|
2827
|
+
const { model, schema = {} } = attrs.formValues;
|
|
2828
|
+
if (!schema.openDialog || !isFunction(schema.openDialog)) {
|
|
2829
|
+
error("openDialog\u5FC5\u987B\u662F\u51FD\u6570");
|
|
2830
|
+
return;
|
|
2831
|
+
}
|
|
2832
|
+
schema.openDialog(model);
|
|
2833
|
+
}
|
|
2834
|
+
function clearProps() {
|
|
2835
|
+
const { model, schema = {} } = attrs.formValues;
|
|
2836
|
+
[...schema.linkProps, schema.name].forEach((it) => model[it] = null);
|
|
2837
|
+
}
|
|
2838
|
+
return (_ctx, _cache) => {
|
|
2839
|
+
return openBlock(), createElementBlock("div", _hoisted_1$u, [
|
|
2840
|
+
createElementVNode("div", { onClick: onClickInput }, [
|
|
2841
|
+
createVNode(unref(Input), normalizeProps(guardReactiveProps(unref(bindProps))), null, 16)
|
|
2842
|
+
]),
|
|
2843
|
+
createElementVNode("i", {
|
|
2844
|
+
class: "i mdi:close-circle",
|
|
2845
|
+
onClick: clearProps
|
|
2846
|
+
})
|
|
2847
|
+
]);
|
|
2848
|
+
};
|
|
2849
|
+
}
|
|
2850
|
+
});
|
|
2812
2851
|
const components = {
|
|
2813
2852
|
Input,
|
|
2853
|
+
InputWithDialog: _sfc_main$R,
|
|
2814
2854
|
InputTextArea: Input.TextArea,
|
|
2815
2855
|
InputSearch: Input.Search,
|
|
2816
2856
|
InputGroup: Input.Group,
|
|
@@ -2834,11 +2874,11 @@ const components = {
|
|
|
2834
2874
|
Slider,
|
|
2835
2875
|
Rate,
|
|
2836
2876
|
Divider,
|
|
2837
|
-
Icon: _sfc_main$
|
|
2877
|
+
Icon: _sfc_main$S
|
|
2838
2878
|
};
|
|
2839
|
-
const componentMap = /* @__PURE__ */ new Map();
|
|
2879
|
+
const componentMap$1 = /* @__PURE__ */ new Map();
|
|
2840
2880
|
for (let item in components) {
|
|
2841
|
-
componentMap.set(item, components[item]);
|
|
2881
|
+
componentMap$1.set(item, components[item]);
|
|
2842
2882
|
}
|
|
2843
2883
|
function createPlaceholder(component) {
|
|
2844
2884
|
if (component.includes("Input") || component.includes("Complete")) {
|
|
@@ -2875,7 +2915,7 @@ function handleInputNumberValue(component, val) {
|
|
|
2875
2915
|
return val;
|
|
2876
2916
|
}
|
|
2877
2917
|
const datePickerType = ["DatePicker", "MonthPicker", "WeekPicker", "TimePicker", "RangePicker"];
|
|
2878
|
-
const BasicProps = {
|
|
2918
|
+
const BasicProps$1 = {
|
|
2879
2919
|
mode: {
|
|
2880
2920
|
type: String,
|
|
2881
2921
|
default: "search"
|
|
@@ -2942,7 +2982,7 @@ const FormItemProps = {
|
|
|
2942
2982
|
function _isSlot(s) {
|
|
2943
2983
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
2944
2984
|
}
|
|
2945
|
-
var _sfc_main$
|
|
2985
|
+
var _sfc_main$Q = defineComponent({
|
|
2946
2986
|
name: "FormItem",
|
|
2947
2987
|
inheritAttrs: false,
|
|
2948
2988
|
props: FormItemProps,
|
|
@@ -3179,12 +3219,12 @@ var _sfc_main$L = defineComponent({
|
|
|
3179
3219
|
const bindValue = {
|
|
3180
3220
|
[valueField || (isCheck ? "checked" : "value")]: props.formModel[name]
|
|
3181
3221
|
};
|
|
3182
|
-
|
|
3222
|
+
let compAttr = {
|
|
3183
3223
|
...itemProps,
|
|
3184
3224
|
...bindValue,
|
|
3185
3225
|
...on2
|
|
3186
3226
|
};
|
|
3187
|
-
const Comp = componentMap.get(component);
|
|
3227
|
+
const Comp = componentMap$1.get(component);
|
|
3188
3228
|
if (!renderComponent) {
|
|
3189
3229
|
return createVNode(Comp, compAttr, null);
|
|
3190
3230
|
}
|
|
@@ -3248,11 +3288,13 @@ var _sfc_main$L = defineComponent({
|
|
|
3248
3288
|
return rules;
|
|
3249
3289
|
}
|
|
3250
3290
|
return () => {
|
|
3251
|
-
let
|
|
3291
|
+
let _slot3;
|
|
3252
3292
|
const {
|
|
3253
3293
|
colSlot,
|
|
3254
3294
|
renderCol,
|
|
3255
|
-
colProps
|
|
3295
|
+
colProps,
|
|
3296
|
+
component,
|
|
3297
|
+
render: render2
|
|
3256
3298
|
} = props.schema;
|
|
3257
3299
|
const {
|
|
3258
3300
|
colProps: gColProps,
|
|
@@ -3260,11 +3302,23 @@ var _sfc_main$L = defineComponent({
|
|
|
3260
3302
|
} = props.formProps;
|
|
3261
3303
|
let _colProps = colProps ? colProps : gColProps ? gColProps : mode === "search" ? appConf.ui.form.searchColspan : appConf.ui.form.dialogColspan;
|
|
3262
3304
|
const values = unref(getValues);
|
|
3305
|
+
if (!component) {
|
|
3306
|
+
let _slot2;
|
|
3307
|
+
if (!render2) {
|
|
3308
|
+
error("\u8BF7\u914D\u7F6Erender\u51FD\u6570");
|
|
3309
|
+
return;
|
|
3310
|
+
}
|
|
3311
|
+
return createVNode(Col, {
|
|
3312
|
+
"span": 24
|
|
3313
|
+
}, _isSlot(_slot2 = render2()) ? _slot2 : {
|
|
3314
|
+
default: () => [_slot2]
|
|
3315
|
+
});
|
|
3316
|
+
}
|
|
3263
3317
|
const getContent = () => {
|
|
3264
3318
|
return colSlot ? getSlot(slots, colSlot, values) : renderCol ? renderCol(values) : renderItem();
|
|
3265
3319
|
};
|
|
3266
|
-
return unref(getShow) && createVNode(Col, _colProps, _isSlot(
|
|
3267
|
-
default: () => [
|
|
3320
|
+
return unref(getShow) && createVNode(Col, _colProps, _isSlot(_slot3 = getContent()) ? _slot3 : {
|
|
3321
|
+
default: () => [_slot3]
|
|
3268
3322
|
});
|
|
3269
3323
|
};
|
|
3270
3324
|
}
|
|
@@ -3315,7 +3369,7 @@ function initDirectives() {
|
|
|
3315
3369
|
}
|
|
3316
3370
|
};
|
|
3317
3371
|
}
|
|
3318
|
-
const _sfc_main$
|
|
3372
|
+
const _sfc_main$P = defineComponent({
|
|
3319
3373
|
name: "form-buttons",
|
|
3320
3374
|
props: {
|
|
3321
3375
|
mode: {
|
|
@@ -3402,16 +3456,16 @@ const _sfc_main$K = defineComponent({
|
|
|
3402
3456
|
};
|
|
3403
3457
|
}
|
|
3404
3458
|
});
|
|
3405
|
-
const _hoisted_1$
|
|
3459
|
+
const _hoisted_1$t = {
|
|
3406
3460
|
key: 0,
|
|
3407
3461
|
className: "preIcon"
|
|
3408
3462
|
};
|
|
3409
|
-
const _hoisted_2$
|
|
3463
|
+
const _hoisted_2$k = {
|
|
3410
3464
|
key: 0,
|
|
3411
3465
|
className: "preIcon"
|
|
3412
3466
|
};
|
|
3413
|
-
const _hoisted_3$
|
|
3414
|
-
function _sfc_render$
|
|
3467
|
+
const _hoisted_3$c = { class: "text" };
|
|
3468
|
+
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3415
3469
|
const _component_Button = resolveComponent("Button");
|
|
3416
3470
|
const _component_DtIcon = resolveComponent("DtIcon");
|
|
3417
3471
|
const _component_FormItem = resolveComponent("FormItem");
|
|
@@ -3438,13 +3492,13 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3438
3492
|
onClick: ($event) => _ctx.handleBtnClick(button)
|
|
3439
3493
|
}, {
|
|
3440
3494
|
icon: withCtx(() => [
|
|
3441
|
-
button.preIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_1$
|
|
3495
|
+
button.preIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_1$t, null, 512)), [
|
|
3442
3496
|
[_directive_icon, button.preIcon]
|
|
3443
3497
|
]) : createCommentVNode("", true)
|
|
3444
3498
|
]),
|
|
3445
3499
|
default: withCtx(() => [
|
|
3446
3500
|
createTextVNode(" " + toDisplayString(button.name) + " ", 1),
|
|
3447
|
-
button.postIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$
|
|
3501
|
+
button.postIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$k, null, 512)), [
|
|
3448
3502
|
[_directive_icon, button.postIcon]
|
|
3449
3503
|
]) : createCommentVNode("", true)
|
|
3450
3504
|
]),
|
|
@@ -3459,7 +3513,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3459
3513
|
onClick: _ctx.toggleAdvanced
|
|
3460
3514
|
}, {
|
|
3461
3515
|
default: withCtx(() => [
|
|
3462
|
-
createElementVNode("span", _hoisted_3$
|
|
3516
|
+
createElementVNode("span", _hoisted_3$c, toDisplayString(_ctx.advancedRef ? "\u6536\u8D77" : "\u5C55\u5F00"), 1),
|
|
3463
3517
|
createElementVNode("span", {
|
|
3464
3518
|
class: normalizeClass(_ctx.getAdvanceClass)
|
|
3465
3519
|
}, [
|
|
@@ -3478,7 +3532,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3478
3532
|
_: 1
|
|
3479
3533
|
}, 16)) : createCommentVNode("", true);
|
|
3480
3534
|
}
|
|
3481
|
-
var FormButtons = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3535
|
+
var FormButtons = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$5]]);
|
|
3482
3536
|
const isArray = Array.isArray;
|
|
3483
3537
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3484
3538
|
var dayjs_min = { exports: {} };
|
|
@@ -3709,7 +3763,7 @@ function useFormValues({
|
|
|
3709
3763
|
return res;
|
|
3710
3764
|
}
|
|
3711
3765
|
function initDefault() {
|
|
3712
|
-
const schema = unref(getSchema);
|
|
3766
|
+
const schema = unref(getSchema).filter((it) => it.component);
|
|
3713
3767
|
const obj = {};
|
|
3714
3768
|
schema.forEach((item) => {
|
|
3715
3769
|
const { props = {}, name, component } = item;
|
|
@@ -3737,9 +3791,9 @@ function useFormValues({
|
|
|
3737
3791
|
}
|
|
3738
3792
|
} else {
|
|
3739
3793
|
if (names.length > 1) {
|
|
3740
|
-
names.forEach((key,
|
|
3741
|
-
obj[key] = defaultValue2[
|
|
3742
|
-
formModel[key] = defaultValue2[
|
|
3794
|
+
names.forEach((key, index) => {
|
|
3795
|
+
obj[key] = defaultValue2[index];
|
|
3796
|
+
formModel[key] = defaultValue2[index];
|
|
3743
3797
|
});
|
|
3744
3798
|
} else {
|
|
3745
3799
|
obj[names[0]] = defaultValue2;
|
|
@@ -3747,7 +3801,7 @@ function useFormValues({
|
|
|
3747
3801
|
}
|
|
3748
3802
|
}
|
|
3749
3803
|
} else {
|
|
3750
|
-
names.forEach((key,
|
|
3804
|
+
names.forEach((key, index) => {
|
|
3751
3805
|
let defaultV = null;
|
|
3752
3806
|
if (component === "TreeSelect" && (mode === "multiple" || treeCheckable) || component === "Select" && mode === "multiple") {
|
|
3753
3807
|
defaultV = [];
|
|
@@ -3833,10 +3887,10 @@ function useFormEvents({
|
|
|
3833
3887
|
schemaRef.value = schemaList;
|
|
3834
3888
|
}
|
|
3835
3889
|
function _removeSchemaByName(name, schemaList) {
|
|
3836
|
-
const
|
|
3837
|
-
if (
|
|
3890
|
+
const index = schemaList.findIndex((schema) => schema.name === name);
|
|
3891
|
+
if (index !== -1) {
|
|
3838
3892
|
delete formModel[name];
|
|
3839
|
-
schemaList.splice(
|
|
3893
|
+
schemaList.splice(index, 1);
|
|
3840
3894
|
}
|
|
3841
3895
|
}
|
|
3842
3896
|
function setFormValues(values) {
|
|
@@ -3857,7 +3911,7 @@ function useFormEvents({
|
|
|
3857
3911
|
if (Array.isArray(value)) {
|
|
3858
3912
|
const arr = [];
|
|
3859
3913
|
for (const ele of value) {
|
|
3860
|
-
arr.push(ele ?
|
|
3914
|
+
arr.push(ele ? dayjs(ele) : null);
|
|
3861
3915
|
}
|
|
3862
3916
|
formModel[key] = arr;
|
|
3863
3917
|
} else {
|
|
@@ -3866,7 +3920,7 @@ function useFormEvents({
|
|
|
3866
3920
|
if (typeof props === "function") {
|
|
3867
3921
|
_props = props({ formModel });
|
|
3868
3922
|
}
|
|
3869
|
-
formModel[key] = value ? (_props == null ? void 0 : _props.valueFormat) ? value :
|
|
3923
|
+
formModel[key] = value ? (_props == null ? void 0 : _props.valueFormat) ? value : dayjs(value) : null;
|
|
3870
3924
|
}
|
|
3871
3925
|
} else {
|
|
3872
3926
|
formModel[key] = value;
|
|
@@ -3879,14 +3933,14 @@ function useFormEvents({
|
|
|
3879
3933
|
}
|
|
3880
3934
|
function appendFormItems(schema, prefixName, first = false) {
|
|
3881
3935
|
const schemaList = cloneDeep(unref(getSchema));
|
|
3882
|
-
const
|
|
3883
|
-
if (!prefixName ||
|
|
3936
|
+
const index = schemaList.findIndex((schema2) => schema2.name === prefixName);
|
|
3937
|
+
if (!prefixName || index === -1 || first) {
|
|
3884
3938
|
first ? schemaList.unshift(schema) : schemaList.push(schema);
|
|
3885
3939
|
schemaRef.value = schemaList;
|
|
3886
3940
|
return;
|
|
3887
3941
|
}
|
|
3888
|
-
if (
|
|
3889
|
-
schemaList.splice(
|
|
3942
|
+
if (index !== -1) {
|
|
3943
|
+
schemaList.splice(index + 1, 0, schema);
|
|
3890
3944
|
}
|
|
3891
3945
|
schemaRef.value = schemaList;
|
|
3892
3946
|
}
|
|
@@ -3928,8 +3982,8 @@ function useFormActions(opt) {
|
|
|
3928
3982
|
function handleAdvanced(isAdvanced) {
|
|
3929
3983
|
var _a;
|
|
3930
3984
|
const { schemas, minShowColumn = ((_a = appConf.ui.form) == null ? void 0 : _a.minShowColumn) || 2 } = unref(getProps);
|
|
3931
|
-
let schema = schemas.reduce((t, it,
|
|
3932
|
-
if (
|
|
3985
|
+
let schema = schemas.reduce((t, it, index) => {
|
|
3986
|
+
if (index > minShowColumn - 1)
|
|
3933
3987
|
it.isAdvanced = isAdvanced;
|
|
3934
3988
|
t.push(it);
|
|
3935
3989
|
return t;
|
|
@@ -3951,15 +4005,15 @@ function useFormActions(opt) {
|
|
|
3951
4005
|
}
|
|
3952
4006
|
return [handleMethod];
|
|
3953
4007
|
}
|
|
3954
|
-
const _sfc_main$
|
|
4008
|
+
const _sfc_main$O = defineComponent({
|
|
3955
4009
|
name: "dt-form",
|
|
3956
4010
|
components: {
|
|
3957
4011
|
Form,
|
|
3958
4012
|
Row,
|
|
3959
|
-
FormItem: _sfc_main$
|
|
4013
|
+
FormItem: _sfc_main$Q,
|
|
3960
4014
|
FormButtons
|
|
3961
4015
|
},
|
|
3962
|
-
props: BasicProps,
|
|
4016
|
+
props: BasicProps$1,
|
|
3963
4017
|
emits: ["register", "reset"],
|
|
3964
4018
|
setup(props, { emit, attrs }) {
|
|
3965
4019
|
const { appConf } = useAppStore();
|
|
@@ -4140,7 +4194,7 @@ const _sfc_main$J = defineComponent({
|
|
|
4140
4194
|
};
|
|
4141
4195
|
}
|
|
4142
4196
|
});
|
|
4143
|
-
function _sfc_render$
|
|
4197
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4144
4198
|
const _component_FormItem = resolveComponent("FormItem");
|
|
4145
4199
|
const _component_FormButtons = resolveComponent("FormButtons");
|
|
4146
4200
|
const _component_Row = resolveComponent("Row");
|
|
@@ -4185,7 +4239,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4185
4239
|
_: 3
|
|
4186
4240
|
}, 16, ["class", "model", "layout"]);
|
|
4187
4241
|
}
|
|
4188
|
-
var DtForm = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4242
|
+
var DtForm = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$4]]);
|
|
4189
4243
|
function useForm(props) {
|
|
4190
4244
|
const formRef = ref(null);
|
|
4191
4245
|
const loadedRef = ref(false);
|
|
@@ -4258,7 +4312,7 @@ function useForm(props) {
|
|
|
4258
4312
|
};
|
|
4259
4313
|
return [registerForm, methods];
|
|
4260
4314
|
}
|
|
4261
|
-
const _sfc_main$
|
|
4315
|
+
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
4262
4316
|
__name: "modalFooter",
|
|
4263
4317
|
props: {
|
|
4264
4318
|
showSave: {
|
|
@@ -4297,7 +4351,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
4297
4351
|
};
|
|
4298
4352
|
}
|
|
4299
4353
|
});
|
|
4300
|
-
const _sfc_main$
|
|
4354
|
+
const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
4301
4355
|
__name: "close-icon",
|
|
4302
4356
|
props: {
|
|
4303
4357
|
canFullscreen: { type: Boolean, default: true },
|
|
@@ -4362,7 +4416,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
4362
4416
|
};
|
|
4363
4417
|
}
|
|
4364
4418
|
});
|
|
4365
|
-
const _sfc_main$
|
|
4419
|
+
const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
4366
4420
|
__name: "index",
|
|
4367
4421
|
props: basicProps$1,
|
|
4368
4422
|
emits: ["visible-change", "height-change", "cancel", "save", "register", "update:visible"],
|
|
@@ -4384,7 +4438,10 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4384
4438
|
}
|
|
4385
4439
|
};
|
|
4386
4440
|
const { getWrapClassName, toggleFullScreen, fullScreenRef } = useFullScreen({
|
|
4387
|
-
wrapClassName: computed(() =>
|
|
4441
|
+
wrapClassName: computed(() => {
|
|
4442
|
+
var _a;
|
|
4443
|
+
return (_a = unref(propsRef)) == null ? void 0 : _a.wrapClassName;
|
|
4444
|
+
}),
|
|
4388
4445
|
extHeightRef,
|
|
4389
4446
|
modalWrapperRef
|
|
4390
4447
|
});
|
|
@@ -4442,7 +4499,6 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4442
4499
|
}
|
|
4443
4500
|
function handleSave() {
|
|
4444
4501
|
emits("save");
|
|
4445
|
-
handleCancel();
|
|
4446
4502
|
}
|
|
4447
4503
|
async function handleCancel(e = null) {
|
|
4448
4504
|
var _a, _b;
|
|
@@ -4462,7 +4518,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4462
4518
|
return (_ctx, _cache) => {
|
|
4463
4519
|
return openBlock(), createBlock(unref(Modal), mergeProps(unref(getBindValue), { onCancel: handleCancel }), createSlots({
|
|
4464
4520
|
default: withCtx(() => [
|
|
4465
|
-
createVNode(_sfc_main$
|
|
4521
|
+
createVNode(_sfc_main$U, mergeProps({
|
|
4466
4522
|
useWrapper: unref(getBindValue).useWrapper,
|
|
4467
4523
|
footerOffset: _ctx.wrapperFooterOffset,
|
|
4468
4524
|
fullScreen: unref(fullScreenRef),
|
|
@@ -4489,7 +4545,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4489
4545
|
!_ctx.$slots.closeIcon ? {
|
|
4490
4546
|
name: "closeIcon",
|
|
4491
4547
|
fn: withCtx(() => [
|
|
4492
|
-
createVNode(_sfc_main$
|
|
4548
|
+
createVNode(_sfc_main$M, {
|
|
4493
4549
|
canFullscreen: unref(getBindValue).canFullscreen,
|
|
4494
4550
|
fullScreen: unref(fullScreenRef),
|
|
4495
4551
|
onCancel: handleCancel,
|
|
@@ -4506,7 +4562,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4506
4562
|
!_ctx.$slots.footer ? {
|
|
4507
4563
|
name: "footer",
|
|
4508
4564
|
fn: withCtx(() => [
|
|
4509
|
-
createVNode(_sfc_main$
|
|
4565
|
+
createVNode(_sfc_main$N, {
|
|
4510
4566
|
showSave: unref(getBindValue).showSave,
|
|
4511
4567
|
onHandleSave: handleSave,
|
|
4512
4568
|
onHandleCancel: handleCancel
|
|
@@ -4668,6 +4724,7 @@ const TABLE_SIZE_HEIGHT = {
|
|
|
4668
4724
|
const TableProps = {
|
|
4669
4725
|
clickRowSelect: { type: Boolean, default: false },
|
|
4670
4726
|
tableSetting: { type: Object, default: () => ({}) },
|
|
4727
|
+
clickToRowSelect: { type: Boolean, default: false },
|
|
4671
4728
|
striped: { type: Boolean, default: true },
|
|
4672
4729
|
canColDrag: { type: Boolean, default: true },
|
|
4673
4730
|
resizable: { type: Boolean, default: true },
|
|
@@ -4749,14 +4806,14 @@ const TableProps = {
|
|
|
4749
4806
|
}
|
|
4750
4807
|
};
|
|
4751
4808
|
function useRows(propsRef) {
|
|
4752
|
-
function getRowClassName(record,
|
|
4809
|
+
function getRowClassName(record, index) {
|
|
4753
4810
|
const { striped, rowClassName } = unref(propsRef);
|
|
4754
4811
|
const classNames = [];
|
|
4755
4812
|
if (striped) {
|
|
4756
|
-
classNames.push(
|
|
4813
|
+
classNames.push(index % 2 === 1 ? "table-striped" : "");
|
|
4757
4814
|
}
|
|
4758
4815
|
if (rowClassName && isFunction(rowClassName)) {
|
|
4759
|
-
classNames.push(rowClassName(record,
|
|
4816
|
+
classNames.push(rowClassName(record, index));
|
|
4760
4817
|
}
|
|
4761
4818
|
return classNames.join(" ");
|
|
4762
4819
|
}
|
|
@@ -4971,7 +5028,7 @@ function useRowSelection(propsRef, emit) {
|
|
|
4971
5028
|
setSelectedRowKeys
|
|
4972
5029
|
};
|
|
4973
5030
|
}
|
|
4974
|
-
var _sfc_main$
|
|
5031
|
+
var _sfc_main$K = defineComponent({
|
|
4975
5032
|
name: "TableFormat",
|
|
4976
5033
|
props: {
|
|
4977
5034
|
column: {
|
|
@@ -4990,7 +5047,7 @@ var _sfc_main$F = defineComponent({
|
|
|
4990
5047
|
const {
|
|
4991
5048
|
column,
|
|
4992
5049
|
record,
|
|
4993
|
-
index
|
|
5050
|
+
index
|
|
4994
5051
|
} = props;
|
|
4995
5052
|
const {
|
|
4996
5053
|
render: render2,
|
|
@@ -5028,7 +5085,7 @@ var _sfc_main$F = defineComponent({
|
|
|
5028
5085
|
renderText.value = text;
|
|
5029
5086
|
}
|
|
5030
5087
|
if (isFunction(render2)) {
|
|
5031
|
-
let afterRenderData = render2(record,
|
|
5088
|
+
let afterRenderData = render2(record, index, text);
|
|
5032
5089
|
renderText.value = isVnode(afterRenderData) ? createVNode(Fragment, null, [afterRenderData]) : afterRenderData;
|
|
5033
5090
|
}
|
|
5034
5091
|
}
|
|
@@ -5043,9 +5100,239 @@ function createTableInstance(instance) {
|
|
|
5043
5100
|
function getTableInstance() {
|
|
5044
5101
|
return inject(tableKey);
|
|
5045
5102
|
}
|
|
5046
|
-
const
|
|
5047
|
-
|
|
5048
|
-
|
|
5103
|
+
const componentMap = /* @__PURE__ */ new Map();
|
|
5104
|
+
componentMap.set("Input", Input);
|
|
5105
|
+
componentMap.set("InputNumber", InputNumber);
|
|
5106
|
+
componentMap.set("Select", Select);
|
|
5107
|
+
componentMap.set("TreeSelect", TreeSelect);
|
|
5108
|
+
componentMap.set("Switch", Switch);
|
|
5109
|
+
componentMap.set("Checkbox", Checkbox);
|
|
5110
|
+
componentMap.set("DatePicker", DatePicker);
|
|
5111
|
+
componentMap.set("TimePicker", TimePicker);
|
|
5112
|
+
const CellComponent = ({
|
|
5113
|
+
component = "Input",
|
|
5114
|
+
rule = true,
|
|
5115
|
+
ruleMessage,
|
|
5116
|
+
popoverVisible,
|
|
5117
|
+
getPopupContainer: getPopupContainer2
|
|
5118
|
+
}, { attrs }) => {
|
|
5119
|
+
const Comp = componentMap.get(component);
|
|
5120
|
+
const DefaultComp = h(Comp, attrs);
|
|
5121
|
+
if (!rule)
|
|
5122
|
+
return DefaultComp;
|
|
5123
|
+
return h(Popover, {
|
|
5124
|
+
overlayClassName: "edit-cell-rule-popover",
|
|
5125
|
+
visible: !!popoverVisible,
|
|
5126
|
+
...getPopupContainer2 ? { getPopupContainer: getPopupContainer2 } : {}
|
|
5127
|
+
}, {
|
|
5128
|
+
default: () => DefaultComp,
|
|
5129
|
+
content: () => ruleMessage
|
|
5130
|
+
});
|
|
5131
|
+
};
|
|
5132
|
+
var _sfc_main$J = defineComponent({
|
|
5133
|
+
name: "EditableCell",
|
|
5134
|
+
components: {
|
|
5135
|
+
Spin,
|
|
5136
|
+
CellComponent
|
|
5137
|
+
},
|
|
5138
|
+
props: {
|
|
5139
|
+
value: {
|
|
5140
|
+
type: [String, Number, Boolean, Object],
|
|
5141
|
+
default: ""
|
|
5142
|
+
},
|
|
5143
|
+
record: {
|
|
5144
|
+
type: Object
|
|
5145
|
+
},
|
|
5146
|
+
column: {
|
|
5147
|
+
type: Object,
|
|
5148
|
+
default: () => ({})
|
|
5149
|
+
},
|
|
5150
|
+
index: Number
|
|
5151
|
+
},
|
|
5152
|
+
setup(props) {
|
|
5153
|
+
const table = getTableInstance();
|
|
5154
|
+
ref();
|
|
5155
|
+
const {
|
|
5156
|
+
editRule,
|
|
5157
|
+
align = "left"
|
|
5158
|
+
} = props.column;
|
|
5159
|
+
const ruleMessage = ref("");
|
|
5160
|
+
const ruleVisible = ref(false);
|
|
5161
|
+
const optionsRef = ref([]);
|
|
5162
|
+
const currentValueRef = ref(props.value);
|
|
5163
|
+
const getComponent = computed(() => {
|
|
5164
|
+
var _a;
|
|
5165
|
+
return ((_a = props.column) == null ? void 0 : _a.editComponent) || "Input";
|
|
5166
|
+
});
|
|
5167
|
+
const getRuleVisible = computed(() => {
|
|
5168
|
+
return unref(ruleMessage) && unref(ruleVisible);
|
|
5169
|
+
});
|
|
5170
|
+
const getWrapperClass = computed(() => {
|
|
5171
|
+
return `edit-cell-align-${align}`;
|
|
5172
|
+
});
|
|
5173
|
+
const getIsCheckComp = computed(() => {
|
|
5174
|
+
const component = unref(getComponent);
|
|
5175
|
+
return ["Checkbox", "Switch"].includes(component);
|
|
5176
|
+
});
|
|
5177
|
+
const createPlaceholderMessage = (component) => {
|
|
5178
|
+
if (component.includes("Input")) {
|
|
5179
|
+
return "\u8BF7\u8F93\u5165";
|
|
5180
|
+
}
|
|
5181
|
+
return "\u8BF7\u9009\u62E9";
|
|
5182
|
+
};
|
|
5183
|
+
const getComponentProps = computed(() => {
|
|
5184
|
+
var _a, _b, _c;
|
|
5185
|
+
const isCheckValue = unref(getIsCheckComp);
|
|
5186
|
+
const valueField = isCheckValue ? "checked" : "value";
|
|
5187
|
+
const val = unref(currentValueRef);
|
|
5188
|
+
const value = isCheckValue ? isNumber(val) && isBoolean(val) ? val : !!val : val;
|
|
5189
|
+
let compProps = (_b = (_a = props.column) == null ? void 0 : _a.editComponentProps) != null ? _b : {};
|
|
5190
|
+
const {
|
|
5191
|
+
record,
|
|
5192
|
+
column,
|
|
5193
|
+
index
|
|
5194
|
+
} = props;
|
|
5195
|
+
if (isFunction$1(compProps)) {
|
|
5196
|
+
compProps = (_c = compProps({
|
|
5197
|
+
text: val,
|
|
5198
|
+
record,
|
|
5199
|
+
column,
|
|
5200
|
+
index
|
|
5201
|
+
})) != null ? _c : {};
|
|
5202
|
+
}
|
|
5203
|
+
return {
|
|
5204
|
+
size: "small",
|
|
5205
|
+
getPopupContainer: () => document.body,
|
|
5206
|
+
placeholder: createPlaceholderMessage(unref(getComponent)),
|
|
5207
|
+
...omit(compProps, "onChange"),
|
|
5208
|
+
[valueField]: value
|
|
5209
|
+
};
|
|
5210
|
+
});
|
|
5211
|
+
async function handleChange(e) {
|
|
5212
|
+
var _a, _b;
|
|
5213
|
+
const component = unref(getComponent);
|
|
5214
|
+
if (!e) {
|
|
5215
|
+
currentValueRef.value = e;
|
|
5216
|
+
} else if (component === "Checkbox") {
|
|
5217
|
+
currentValueRef.value = e.target.checked;
|
|
5218
|
+
} else if (component === "Switch") {
|
|
5219
|
+
currentValueRef.value = e;
|
|
5220
|
+
} else if ((e == null ? void 0 : e.target) && Reflect.has(e.target, "value")) {
|
|
5221
|
+
currentValueRef.value = e.target.value;
|
|
5222
|
+
} else if (isString(e) || isBoolean(e) || isNumber(e)) {
|
|
5223
|
+
currentValueRef.value = e;
|
|
5224
|
+
}
|
|
5225
|
+
const onChange = (_a = unref(getComponentProps)) == null ? void 0 : _a.onChange;
|
|
5226
|
+
if (onChange && isFunction$1(onChange))
|
|
5227
|
+
onChange(...arguments);
|
|
5228
|
+
(_b = table.emit) == null ? void 0 : _b.call(table, "edit-change", {
|
|
5229
|
+
column: props.column,
|
|
5230
|
+
value: unref(currentValueRef),
|
|
5231
|
+
record: toRaw(props.record)
|
|
5232
|
+
});
|
|
5233
|
+
handleSubmitRule();
|
|
5234
|
+
}
|
|
5235
|
+
async function handleSubmitRule() {
|
|
5236
|
+
const {
|
|
5237
|
+
column,
|
|
5238
|
+
record
|
|
5239
|
+
} = props;
|
|
5240
|
+
const {
|
|
5241
|
+
editRule: editRule2
|
|
5242
|
+
} = column;
|
|
5243
|
+
const currentValue = unref(currentValueRef);
|
|
5244
|
+
if (editRule2) {
|
|
5245
|
+
if (isBoolean(editRule2) && !currentValue && !isNumber(currentValue)) {
|
|
5246
|
+
ruleVisible.value = true;
|
|
5247
|
+
const component = unref(getComponent);
|
|
5248
|
+
ruleMessage.value = createPlaceholderMessage(component);
|
|
5249
|
+
return false;
|
|
5250
|
+
}
|
|
5251
|
+
if (isFunction$1(editRule2)) {
|
|
5252
|
+
const res = await editRule2(currentValue, record);
|
|
5253
|
+
if (!!res) {
|
|
5254
|
+
ruleMessage.value = res;
|
|
5255
|
+
ruleVisible.value = true;
|
|
5256
|
+
return false;
|
|
5257
|
+
}
|
|
5258
|
+
}
|
|
5259
|
+
}
|
|
5260
|
+
ruleMessage.value = "";
|
|
5261
|
+
return true;
|
|
5262
|
+
}
|
|
5263
|
+
function handleOptionsChange(options) {
|
|
5264
|
+
optionsRef.value = options;
|
|
5265
|
+
}
|
|
5266
|
+
return {
|
|
5267
|
+
props,
|
|
5268
|
+
getComponentProps,
|
|
5269
|
+
getRuleVisible,
|
|
5270
|
+
editRule,
|
|
5271
|
+
ruleMessage,
|
|
5272
|
+
getWrapperClass,
|
|
5273
|
+
handleChange,
|
|
5274
|
+
handleOptionsChange
|
|
5275
|
+
};
|
|
5276
|
+
}
|
|
5277
|
+
});
|
|
5278
|
+
const _hoisted_1$s = { class: "editable-cell" };
|
|
5279
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5280
|
+
var _a;
|
|
5281
|
+
const _component_CellComponent = resolveComponent("CellComponent");
|
|
5282
|
+
return openBlock(), createElementBlock("div", _hoisted_1$s, [
|
|
5283
|
+
createVNode(_component_CellComponent, mergeProps({ ref: "elRef" }, _ctx.getComponentProps, {
|
|
5284
|
+
component: (_a = _ctx.column) == null ? void 0 : _a.editComponent,
|
|
5285
|
+
popoverVisible: _ctx.getRuleVisible,
|
|
5286
|
+
rule: _ctx.editRule,
|
|
5287
|
+
ruleMessage: _ctx.ruleMessage,
|
|
5288
|
+
class: _ctx.getWrapperClass,
|
|
5289
|
+
onChange: _ctx.handleChange,
|
|
5290
|
+
onOptionsChange: _ctx.handleOptionsChange
|
|
5291
|
+
}), null, 16, ["component", "popoverVisible", "rule", "ruleMessage", "class", "onChange", "onOptionsChange"])
|
|
5292
|
+
]);
|
|
5293
|
+
}
|
|
5294
|
+
var EditableCell = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", _sfc_render$3]]);
|
|
5295
|
+
function renderEditCell(column) {
|
|
5296
|
+
return ({ text: value, record, index }) => {
|
|
5297
|
+
record.onValid = async () => {
|
|
5298
|
+
if (isArray$1(record == null ? void 0 : record.validCbs)) {
|
|
5299
|
+
const validFns = ((record == null ? void 0 : record.validCbs) || []).map((fn) => fn());
|
|
5300
|
+
const res = await Promise.all(validFns);
|
|
5301
|
+
return res.every((item) => !!item);
|
|
5302
|
+
}
|
|
5303
|
+
return false;
|
|
5304
|
+
};
|
|
5305
|
+
record.onEdit = async (edit, submit = false) => {
|
|
5306
|
+
var _a, _b;
|
|
5307
|
+
if (!submit) {
|
|
5308
|
+
record.editable = edit;
|
|
5309
|
+
}
|
|
5310
|
+
if (!edit && submit) {
|
|
5311
|
+
if (!await record.onValid())
|
|
5312
|
+
return false;
|
|
5313
|
+
const res = await ((_a = record.onSubmitEdit) == null ? void 0 : _a.call(record));
|
|
5314
|
+
if (res) {
|
|
5315
|
+
record.editable = false;
|
|
5316
|
+
return true;
|
|
5317
|
+
}
|
|
5318
|
+
return false;
|
|
5319
|
+
}
|
|
5320
|
+
if (!edit && !submit) {
|
|
5321
|
+
(_b = record.onCancelEdit) == null ? void 0 : _b.call(record);
|
|
5322
|
+
}
|
|
5323
|
+
return true;
|
|
5324
|
+
};
|
|
5325
|
+
return h(EditableCell, {
|
|
5326
|
+
value,
|
|
5327
|
+
record,
|
|
5328
|
+
column,
|
|
5329
|
+
index
|
|
5330
|
+
});
|
|
5331
|
+
};
|
|
5332
|
+
}
|
|
5333
|
+
const _hoisted_1$r = { class: "dt-table-action-btn" };
|
|
5334
|
+
const _hoisted_2$j = ["color", "onClick"];
|
|
5335
|
+
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
5049
5336
|
__name: "TableActions",
|
|
5050
5337
|
props: {
|
|
5051
5338
|
fixed: {
|
|
@@ -5101,7 +5388,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
5101
5388
|
return (_ctx, _cache) => {
|
|
5102
5389
|
const _directive_icon = resolveDirective("icon");
|
|
5103
5390
|
return props.expand ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.btns, (item) => {
|
|
5104
|
-
return openBlock(), createElementBlock("span", _hoisted_1$
|
|
5391
|
+
return openBlock(), createElementBlock("span", _hoisted_1$r, [
|
|
5105
5392
|
item.ifShow ? (openBlock(), createBlock(unref(Tooltip), {
|
|
5106
5393
|
key: 0,
|
|
5107
5394
|
placement: "bottom"
|
|
@@ -5113,7 +5400,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
5113
5400
|
withDirectives(createElementVNode("span", {
|
|
5114
5401
|
color: item.color,
|
|
5115
5402
|
onClick: ($event) => handleAction(item)
|
|
5116
|
-
}, null, 8, _hoisted_2$
|
|
5403
|
+
}, null, 8, _hoisted_2$j), [
|
|
5117
5404
|
[_directive_icon, item.icon]
|
|
5118
5405
|
])
|
|
5119
5406
|
]),
|
|
@@ -5235,15 +5522,15 @@ function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
|
5235
5522
|
width: 50,
|
|
5236
5523
|
title: "\u5E8F\u53F7",
|
|
5237
5524
|
align: "center",
|
|
5238
|
-
customRender: ({ index
|
|
5525
|
+
customRender: ({ index }) => {
|
|
5239
5526
|
const getPagination = unref(getPaginationRef);
|
|
5240
5527
|
const { appConf } = useAppStore();
|
|
5241
5528
|
const { defaultPageSize } = appConf.ui.table;
|
|
5242
5529
|
if (isBoolean(getPagination)) {
|
|
5243
|
-
return `${
|
|
5530
|
+
return `${index + 1}`;
|
|
5244
5531
|
}
|
|
5245
5532
|
const { current = 1, pageSize = defaultPageSize } = getPagination;
|
|
5246
|
-
return ((current < 1 ? 1 : current) - 1) * pageSize +
|
|
5533
|
+
return ((current < 1 ? 1 : current) - 1) * pageSize + index + 1;
|
|
5247
5534
|
},
|
|
5248
5535
|
...isFixedLeft ? {
|
|
5249
5536
|
fixed: "left"
|
|
@@ -5270,13 +5557,12 @@ function handleActionColumn(propsRef, columns) {
|
|
|
5270
5557
|
};
|
|
5271
5558
|
columns.push({
|
|
5272
5559
|
...columnObj,
|
|
5273
|
-
customRender: ({ record, index
|
|
5274
|
-
return h(_sfc_main$
|
|
5560
|
+
customRender: ({ record, index }) => {
|
|
5561
|
+
return h(_sfc_main$I, omit({
|
|
5275
5562
|
...columnObj,
|
|
5276
5563
|
record,
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
});
|
|
5564
|
+
index
|
|
5565
|
+
}, "align"));
|
|
5280
5566
|
}
|
|
5281
5567
|
});
|
|
5282
5568
|
}
|
|
@@ -5289,9 +5575,9 @@ function useColumns(propsRef, getPaginationRef) {
|
|
|
5289
5575
|
if (!columns)
|
|
5290
5576
|
return [];
|
|
5291
5577
|
const { ellipsis, resizable, minWidth = 50, maxWidth = 700 } = unref(propsRef);
|
|
5292
|
-
columns.forEach((it,
|
|
5578
|
+
columns.forEach((it, index) => {
|
|
5293
5579
|
const { slots } = it;
|
|
5294
|
-
it.width = it.width || (
|
|
5580
|
+
it.width = it.width || (index === columns.length - 1 ? 119.9 : 120);
|
|
5295
5581
|
if (Reflect.has(it, "resizable") ? !!it.resizable : resizable) {
|
|
5296
5582
|
it.resizable = true;
|
|
5297
5583
|
it.minWidth = it.minWidth || minWidth;
|
|
@@ -5306,7 +5592,12 @@ function useColumns(propsRef, getPaginationRef) {
|
|
|
5306
5592
|
const getViewColumns = computed(() => {
|
|
5307
5593
|
const viewColumns = sortFixedColumn(unref(getColumnsRef));
|
|
5308
5594
|
const columns = cloneDeep(viewColumns);
|
|
5309
|
-
return columns.filter((column) => isIfShow(column))
|
|
5595
|
+
return columns.filter((column) => isIfShow(column)).map((column) => {
|
|
5596
|
+
if (column.edit) {
|
|
5597
|
+
column.customRender = renderEditCell(column);
|
|
5598
|
+
}
|
|
5599
|
+
return column;
|
|
5600
|
+
});
|
|
5310
5601
|
});
|
|
5311
5602
|
function isIfShow(column) {
|
|
5312
5603
|
const ifShow = column.ifShow;
|
|
@@ -5381,18 +5672,18 @@ function useColumns(propsRef, getPaginationRef) {
|
|
|
5381
5672
|
getCacheColumns
|
|
5382
5673
|
};
|
|
5383
5674
|
}
|
|
5384
|
-
const _hoisted_1$
|
|
5385
|
-
const _hoisted_2$
|
|
5386
|
-
const _hoisted_3$
|
|
5387
|
-
const _hoisted_4$
|
|
5388
|
-
const _hoisted_5$
|
|
5675
|
+
const _hoisted_1$q = /* @__PURE__ */ createElementVNode("span", null, "\u5217\u63A7\u5236", -1);
|
|
5676
|
+
const _hoisted_2$i = /* @__PURE__ */ createTextVNode(" \u5217\u5C55\u793A ");
|
|
5677
|
+
const _hoisted_3$b = /* @__PURE__ */ createTextVNode(" \u5E8F\u5217\u53F7 ");
|
|
5678
|
+
const _hoisted_4$8 = /* @__PURE__ */ createTextVNode(" \u590D\u9009\u6846 ");
|
|
5679
|
+
const _hoisted_5$5 = /* @__PURE__ */ createTextVNode("\u91CD\u7F6E");
|
|
5389
5680
|
const _hoisted_6$2 = {
|
|
5390
5681
|
size: 16,
|
|
5391
5682
|
className: "drag-icon"
|
|
5392
5683
|
};
|
|
5393
5684
|
const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("\u56FA\u5B9A\u5230\u5DE6\u4FA7");
|
|
5394
5685
|
const _hoisted_8$1 = /* @__PURE__ */ createTextVNode("\u56FA\u5B9A\u5230\u53F3\u4FA7");
|
|
5395
|
-
const _sfc_main$
|
|
5686
|
+
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
5396
5687
|
__name: "Column",
|
|
5397
5688
|
emits: [
|
|
5398
5689
|
"columns-change"
|
|
@@ -5528,9 +5819,9 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5528
5819
|
return;
|
|
5529
5820
|
const columns = getColumns();
|
|
5530
5821
|
const isFixed = item.fixed === fixed ? false : fixed;
|
|
5531
|
-
const
|
|
5532
|
-
if (
|
|
5533
|
-
columns[
|
|
5822
|
+
const index = columns.findIndex((col) => col.dataIndex === item.dataIndex);
|
|
5823
|
+
if (index !== -1) {
|
|
5824
|
+
columns[index].fixed = isFixed;
|
|
5534
5825
|
}
|
|
5535
5826
|
item.fixed = isFixed;
|
|
5536
5827
|
if (isFixed && !item.width) {
|
|
@@ -5571,7 +5862,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5571
5862
|
const _directive_icon = resolveDirective("icon");
|
|
5572
5863
|
return openBlock(), createBlock(unref(Tooltip), { placement: "top" }, {
|
|
5573
5864
|
title: withCtx(() => [
|
|
5574
|
-
_hoisted_1$
|
|
5865
|
+
_hoisted_1$q
|
|
5575
5866
|
]),
|
|
5576
5867
|
default: withCtx(() => [
|
|
5577
5868
|
createVNode(unref(Popover), {
|
|
@@ -5592,7 +5883,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5592
5883
|
onChange: onCheckAllChange
|
|
5593
5884
|
}, {
|
|
5594
5885
|
default: withCtx(() => [
|
|
5595
|
-
_hoisted_2$
|
|
5886
|
+
_hoisted_2$i
|
|
5596
5887
|
]),
|
|
5597
5888
|
_: 1
|
|
5598
5889
|
}, 8, ["indeterminate", "checked"]),
|
|
@@ -5602,7 +5893,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5602
5893
|
onChange: handleIndexCheckChange
|
|
5603
5894
|
}, {
|
|
5604
5895
|
default: withCtx(() => [
|
|
5605
|
-
_hoisted_3$
|
|
5896
|
+
_hoisted_3$b
|
|
5606
5897
|
]),
|
|
5607
5898
|
_: 1
|
|
5608
5899
|
}, 8, ["checked"]),
|
|
@@ -5613,7 +5904,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5613
5904
|
disabled: !unref(defaultRowSelection)
|
|
5614
5905
|
}, {
|
|
5615
5906
|
default: withCtx(() => [
|
|
5616
|
-
_hoisted_4$
|
|
5907
|
+
_hoisted_4$8
|
|
5617
5908
|
]),
|
|
5618
5909
|
_: 1
|
|
5619
5910
|
}, 8, ["checked", "disabled"]),
|
|
@@ -5623,7 +5914,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5623
5914
|
onClick: reset
|
|
5624
5915
|
}, {
|
|
5625
5916
|
default: withCtx(() => [
|
|
5626
|
-
_hoisted_5$
|
|
5917
|
+
_hoisted_5$5
|
|
5627
5918
|
]),
|
|
5628
5919
|
_: 1
|
|
5629
5920
|
})
|
|
@@ -5724,10 +6015,10 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5724
6015
|
};
|
|
5725
6016
|
}
|
|
5726
6017
|
});
|
|
5727
|
-
const _hoisted_1$
|
|
5728
|
-
const _hoisted_2$
|
|
5729
|
-
const _hoisted_3$
|
|
5730
|
-
const _sfc_main$
|
|
6018
|
+
const _hoisted_1$p = { key: 0 };
|
|
6019
|
+
const _hoisted_2$h = { key: 0 };
|
|
6020
|
+
const _hoisted_3$a = { key: 1 };
|
|
6021
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
5731
6022
|
__name: "Fullscreen",
|
|
5732
6023
|
setup(__props) {
|
|
5733
6024
|
const table = getTableInstance();
|
|
@@ -5750,15 +6041,15 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
5750
6041
|
const _directive_icon = resolveDirective("icon");
|
|
5751
6042
|
return openBlock(), createBlock(unref(Tooltip), { placement: "top" }, {
|
|
5752
6043
|
title: withCtx(() => [
|
|
5753
|
-
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
6044
|
+
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$p, "\u5168\u5C4F")) : createCommentVNode("", true)
|
|
5754
6045
|
]),
|
|
5755
6046
|
default: withCtx(() => [
|
|
5756
6047
|
createElementVNode("span", {
|
|
5757
6048
|
onClick: _cache[0] || (_cache[0] = (...args) => unref(toggle) && unref(toggle)(...args))
|
|
5758
6049
|
}, [
|
|
5759
|
-
!unref(isFullscreen) ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$
|
|
6050
|
+
!unref(isFullscreen) ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$h, null, 512)), [
|
|
5760
6051
|
[_directive_icon, "ic:baseline-fullscreen"]
|
|
5761
|
-
]) : withDirectives((openBlock(), createElementBlock("span", _hoisted_3$
|
|
6052
|
+
]) : withDirectives((openBlock(), createElementBlock("span", _hoisted_3$a, null, 512)), [
|
|
5762
6053
|
[_directive_icon, "ic:baseline-fullscreen-exit"]
|
|
5763
6054
|
])
|
|
5764
6055
|
])
|
|
@@ -5768,11 +6059,11 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
5768
6059
|
};
|
|
5769
6060
|
}
|
|
5770
6061
|
});
|
|
5771
|
-
const _hoisted_1$
|
|
5772
|
-
const _hoisted_2$
|
|
5773
|
-
const _hoisted_3$
|
|
5774
|
-
const _hoisted_4$
|
|
5775
|
-
const _sfc_main$
|
|
6062
|
+
const _hoisted_1$o = /* @__PURE__ */ createTextVNode("\u5BC6\u5EA6");
|
|
6063
|
+
const _hoisted_2$g = /* @__PURE__ */ createElementVNode("span", null, "\u9ED8\u8BA4", -1);
|
|
6064
|
+
const _hoisted_3$9 = /* @__PURE__ */ createElementVNode("span", null, "\u4E2D\u7B49", -1);
|
|
6065
|
+
const _hoisted_4$7 = /* @__PURE__ */ createElementVNode("span", null, "\u7D27\u51D1", -1);
|
|
6066
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
5776
6067
|
__name: "Size",
|
|
5777
6068
|
setup(__props) {
|
|
5778
6069
|
const table = getTableInstance();
|
|
@@ -5785,7 +6076,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
5785
6076
|
const _directive_icon = resolveDirective("icon");
|
|
5786
6077
|
return openBlock(), createBlock(unref(Tooltip), null, {
|
|
5787
6078
|
title: withCtx(() => [
|
|
5788
|
-
_hoisted_1$
|
|
6079
|
+
_hoisted_1$o
|
|
5789
6080
|
]),
|
|
5790
6081
|
default: withCtx(() => [
|
|
5791
6082
|
createVNode(unref(Dropdown), {
|
|
@@ -5803,19 +6094,19 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
5803
6094
|
default: withCtx(() => [
|
|
5804
6095
|
createVNode(unref(MenuItem), { key: "default" }, {
|
|
5805
6096
|
default: withCtx(() => [
|
|
5806
|
-
_hoisted_2$
|
|
6097
|
+
_hoisted_2$g
|
|
5807
6098
|
]),
|
|
5808
6099
|
_: 1
|
|
5809
6100
|
}),
|
|
5810
6101
|
createVNode(unref(MenuItem), { key: "middle" }, {
|
|
5811
6102
|
default: withCtx(() => [
|
|
5812
|
-
_hoisted_3$
|
|
6103
|
+
_hoisted_3$9
|
|
5813
6104
|
]),
|
|
5814
6105
|
_: 1
|
|
5815
6106
|
}),
|
|
5816
6107
|
createVNode(unref(MenuItem), { key: "small" }, {
|
|
5817
6108
|
default: withCtx(() => [
|
|
5818
|
-
_hoisted_4$
|
|
6109
|
+
_hoisted_4$7
|
|
5819
6110
|
]),
|
|
5820
6111
|
_: 1
|
|
5821
6112
|
})
|
|
@@ -5836,11 +6127,11 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
5836
6127
|
};
|
|
5837
6128
|
}
|
|
5838
6129
|
});
|
|
5839
|
-
const _hoisted_1$
|
|
5840
|
-
const _hoisted_2$
|
|
5841
|
-
const _hoisted_3$
|
|
5842
|
-
const _hoisted_4$
|
|
5843
|
-
const _sfc_main$
|
|
6130
|
+
const _hoisted_1$n = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA", -1);
|
|
6131
|
+
const _hoisted_2$f = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA\u5F53\u524D\u9875", -1);
|
|
6132
|
+
const _hoisted_3$8 = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA\u9009\u4E2D\u5217", -1);
|
|
6133
|
+
const _hoisted_4$6 = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA\u6240\u6709\u5217", -1);
|
|
6134
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
5844
6135
|
__name: "Download",
|
|
5845
6136
|
setup(__props) {
|
|
5846
6137
|
const table = getTableInstance();
|
|
@@ -5858,7 +6149,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
5858
6149
|
const _directive_icon = resolveDirective("icon");
|
|
5859
6150
|
return openBlock(), createBlock(unref(Tooltip), { placement: "top" }, {
|
|
5860
6151
|
title: withCtx(() => [
|
|
5861
|
-
_hoisted_1$
|
|
6152
|
+
_hoisted_1$n
|
|
5862
6153
|
]),
|
|
5863
6154
|
default: withCtx(() => [
|
|
5864
6155
|
createVNode(unref(Dropdown), {
|
|
@@ -5871,19 +6162,19 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
5871
6162
|
default: withCtx(() => [
|
|
5872
6163
|
createVNode(unref(MenuItem), { key: "current" }, {
|
|
5873
6164
|
default: withCtx(() => [
|
|
5874
|
-
_hoisted_2$
|
|
6165
|
+
_hoisted_2$f
|
|
5875
6166
|
]),
|
|
5876
6167
|
_: 1
|
|
5877
6168
|
}),
|
|
5878
6169
|
createVNode(unref(MenuItem), { key: "select" }, {
|
|
5879
6170
|
default: withCtx(() => [
|
|
5880
|
-
_hoisted_3$
|
|
6171
|
+
_hoisted_3$8
|
|
5881
6172
|
]),
|
|
5882
6173
|
_: 1
|
|
5883
6174
|
}),
|
|
5884
6175
|
createVNode(unref(MenuItem), { key: "all" }, {
|
|
5885
6176
|
default: withCtx(() => [
|
|
5886
|
-
_hoisted_4$
|
|
6177
|
+
_hoisted_4$6
|
|
5887
6178
|
]),
|
|
5888
6179
|
_: 1
|
|
5889
6180
|
})
|
|
@@ -5904,13 +6195,13 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
5904
6195
|
};
|
|
5905
6196
|
}
|
|
5906
6197
|
});
|
|
5907
|
-
const _sfc_main$
|
|
6198
|
+
const _sfc_main$D = defineComponent({
|
|
5908
6199
|
name: "table-setting",
|
|
5909
6200
|
components: {
|
|
5910
|
-
ColumnSetting: _sfc_main$
|
|
5911
|
-
FullscreenSetting: _sfc_main$
|
|
5912
|
-
SizeSetting: _sfc_main$
|
|
5913
|
-
Download: _sfc_main$
|
|
6201
|
+
ColumnSetting: _sfc_main$H,
|
|
6202
|
+
FullscreenSetting: _sfc_main$G,
|
|
6203
|
+
SizeSetting: _sfc_main$F,
|
|
6204
|
+
Download: _sfc_main$E
|
|
5914
6205
|
},
|
|
5915
6206
|
props: {
|
|
5916
6207
|
setting: {
|
|
@@ -5953,8 +6244,8 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5953
6244
|
_ctx.getSetting.fullscreen ? (openBlock(), createBlock(_component_FullscreenSetting, { key: 3 })) : createCommentVNode("", true)
|
|
5954
6245
|
], 64);
|
|
5955
6246
|
}
|
|
5956
|
-
var TableSettinCom = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5957
|
-
const _sfc_main$
|
|
6247
|
+
var TableSettinCom = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$2]]);
|
|
6248
|
+
const _sfc_main$C = defineComponent({
|
|
5958
6249
|
name: "table-header",
|
|
5959
6250
|
components: {
|
|
5960
6251
|
TableSettinCom,
|
|
@@ -5964,7 +6255,7 @@ const _sfc_main$y = defineComponent({
|
|
|
5964
6255
|
},
|
|
5965
6256
|
props: {
|
|
5966
6257
|
tableTools: {
|
|
5967
|
-
type: Object
|
|
6258
|
+
type: [Object, Boolean]
|
|
5968
6259
|
},
|
|
5969
6260
|
toolbar: {
|
|
5970
6261
|
type: Array,
|
|
@@ -5994,41 +6285,44 @@ const _sfc_main$y = defineComponent({
|
|
|
5994
6285
|
};
|
|
5995
6286
|
}
|
|
5996
6287
|
});
|
|
5997
|
-
const _hoisted_1$
|
|
5998
|
-
const _hoisted_2$
|
|
5999
|
-
const _hoisted_3$
|
|
6000
|
-
const _hoisted_4$
|
|
6001
|
-
|
|
6288
|
+
const _hoisted_1$m = { class: "dt-table-header" };
|
|
6289
|
+
const _hoisted_2$e = { class: "dt-table-header-actions" };
|
|
6290
|
+
const _hoisted_3$7 = { class: "dt-table-header-actions__left" };
|
|
6291
|
+
const _hoisted_4$5 = {
|
|
6292
|
+
key: 0,
|
|
6293
|
+
class: "dt-table-header-actions__right"
|
|
6294
|
+
};
|
|
6295
|
+
const _hoisted_5$4 = {
|
|
6002
6296
|
key: 0,
|
|
6003
6297
|
style: { "margin": "5px" }
|
|
6004
6298
|
};
|
|
6005
6299
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6006
6300
|
const _component_FormButtons = resolveComponent("FormButtons");
|
|
6007
6301
|
const _component_TableSettinCom = resolveComponent("TableSettinCom");
|
|
6008
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
6009
|
-
createElementVNode("div", _hoisted_2$
|
|
6010
|
-
createElementVNode("div", _hoisted_3$
|
|
6302
|
+
return openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
6303
|
+
createElementVNode("div", _hoisted_2$e, [
|
|
6304
|
+
createElementVNode("div", _hoisted_3$7, [
|
|
6011
6305
|
createVNode(_component_FormButtons, mergeProps(_ctx.getActionsProps, { onHandleMethod: _ctx.handleMethod }), null, 16, ["onHandleMethod"]),
|
|
6012
6306
|
renderSlot(_ctx.$slots, "toolbar")
|
|
6013
6307
|
]),
|
|
6014
|
-
|
|
6308
|
+
_ctx.tableTools ? (openBlock(), createElementBlock("div", _hoisted_4$5, [
|
|
6015
6309
|
createVNode(_component_TableSettinCom, {
|
|
6016
6310
|
setting: _ctx.tableTools,
|
|
6017
6311
|
onColumnsChange: _ctx.handleColumnChange
|
|
6018
6312
|
}, null, 8, ["setting", "onColumnsChange"])
|
|
6019
|
-
])
|
|
6313
|
+
])) : createCommentVNode("", true)
|
|
6020
6314
|
]),
|
|
6021
|
-
_ctx.$slots.headerTop ? (openBlock(), createElementBlock("div", _hoisted_5$
|
|
6315
|
+
_ctx.$slots.headerTop ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
|
|
6022
6316
|
renderSlot(_ctx.$slots, "headerTop")
|
|
6023
6317
|
])) : createCommentVNode("", true)
|
|
6024
6318
|
]);
|
|
6025
6319
|
}
|
|
6026
|
-
var TableHeader = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6320
|
+
var TableHeader = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$1]]);
|
|
6027
6321
|
function useTableHeader(propsRef, slots, handlers) {
|
|
6028
6322
|
const getHeaderProps = computed(() => {
|
|
6029
|
-
const { tableSetting, toolbar } = unref(propsRef);
|
|
6323
|
+
const { tableSetting, toolbar = [] } = unref(propsRef);
|
|
6030
6324
|
const { getSlot } = useSlots();
|
|
6031
|
-
const hideTitle = !slots.toolbar && !slots.headerTop && !tableSetting;
|
|
6325
|
+
const hideTitle = !toolbar.length && !slots.toolbar && !slots.headerTop && !tableSetting;
|
|
6032
6326
|
return {
|
|
6033
6327
|
title: hideTitle ? null : () => h(TableHeader, {
|
|
6034
6328
|
tableTools: tableSetting,
|
|
@@ -6203,17 +6497,88 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
6203
6497
|
filterSource
|
|
6204
6498
|
};
|
|
6205
6499
|
}
|
|
6206
|
-
|
|
6500
|
+
function useCustomRow(propsRef, { setSelectedRowKeys, getSelectRowKeys, clearSelectedRowKeys, emit }) {
|
|
6501
|
+
const customRow = (record, index) => {
|
|
6502
|
+
return {
|
|
6503
|
+
onClick: (e) => {
|
|
6504
|
+
e == null ? void 0 : e.stopPropagation();
|
|
6505
|
+
function handleClick() {
|
|
6506
|
+
var _a;
|
|
6507
|
+
const { rowSelection, rowKey, clickToRowSelect } = unref(propsRef);
|
|
6508
|
+
if (!rowSelection || !clickToRowSelect)
|
|
6509
|
+
return;
|
|
6510
|
+
const keys = getSelectRowKeys();
|
|
6511
|
+
const key = record[rowKey];
|
|
6512
|
+
if (!key)
|
|
6513
|
+
return;
|
|
6514
|
+
const isCheckbox = rowSelection.type === "checkbox";
|
|
6515
|
+
if (isCheckbox) {
|
|
6516
|
+
const tr = (_a = e.composedPath) == null ? void 0 : _a.call(e).find((dom) => dom.tagName === "TR");
|
|
6517
|
+
if (!tr)
|
|
6518
|
+
return;
|
|
6519
|
+
const checkBox = tr.querySelector("input[type=checkbox]");
|
|
6520
|
+
if (!checkBox || checkBox.hasAttribute("disabled"))
|
|
6521
|
+
return;
|
|
6522
|
+
if (!keys.includes(key)) {
|
|
6523
|
+
setSelectedRowKeys([...keys, key]);
|
|
6524
|
+
return;
|
|
6525
|
+
}
|
|
6526
|
+
const keyIndex = keys.findIndex((item) => item === key);
|
|
6527
|
+
keys.splice(keyIndex, 1);
|
|
6528
|
+
setSelectedRowKeys(keys);
|
|
6529
|
+
return;
|
|
6530
|
+
}
|
|
6531
|
+
const isRadio = rowSelection.type === "radio";
|
|
6532
|
+
if (isRadio) {
|
|
6533
|
+
if (!keys.includes(key)) {
|
|
6534
|
+
if (keys.length) {
|
|
6535
|
+
clearSelectedRowKeys();
|
|
6536
|
+
}
|
|
6537
|
+
setSelectedRowKeys([key]);
|
|
6538
|
+
return;
|
|
6539
|
+
}
|
|
6540
|
+
clearSelectedRowKeys();
|
|
6541
|
+
}
|
|
6542
|
+
}
|
|
6543
|
+
handleClick();
|
|
6544
|
+
emit("row-click", record, index, e);
|
|
6545
|
+
},
|
|
6546
|
+
onDblclick: (event) => {
|
|
6547
|
+
emit("row-dbClick", record, index, event);
|
|
6548
|
+
},
|
|
6549
|
+
onContextmenu: (event) => {
|
|
6550
|
+
emit("row-contextmenu", record, index, event);
|
|
6551
|
+
},
|
|
6552
|
+
onMouseenter: (event) => {
|
|
6553
|
+
emit("row-mouseenter", record, index, event);
|
|
6554
|
+
},
|
|
6555
|
+
onMouseleave: (event) => {
|
|
6556
|
+
emit("row-mouseleave", record, index, event);
|
|
6557
|
+
}
|
|
6558
|
+
};
|
|
6559
|
+
};
|
|
6560
|
+
return {
|
|
6561
|
+
customRow
|
|
6562
|
+
};
|
|
6563
|
+
}
|
|
6564
|
+
const _sfc_main$B = defineComponent({
|
|
6207
6565
|
name: "dt-table",
|
|
6208
6566
|
props: TableProps,
|
|
6209
6567
|
components: {
|
|
6210
6568
|
Table,
|
|
6211
|
-
TableRender: _sfc_main$
|
|
6569
|
+
TableRender: _sfc_main$K
|
|
6212
6570
|
},
|
|
6213
6571
|
emits: [
|
|
6214
6572
|
"register",
|
|
6215
6573
|
"columns-change",
|
|
6216
|
-
"selection-change"
|
|
6574
|
+
"selection-change",
|
|
6575
|
+
"row-click",
|
|
6576
|
+
"row-dbClick",
|
|
6577
|
+
"row-contextmenu",
|
|
6578
|
+
"row-mouseenter",
|
|
6579
|
+
"row-mouseleave",
|
|
6580
|
+
"expanded-rows-change",
|
|
6581
|
+
"edit-change"
|
|
6217
6582
|
],
|
|
6218
6583
|
setup(props, { emit, attrs, slots }) {
|
|
6219
6584
|
const tableElRef = ref(null);
|
|
@@ -6237,7 +6602,8 @@ const _sfc_main$x = defineComponent({
|
|
|
6237
6602
|
clearSelectedRowKeys,
|
|
6238
6603
|
getRowSelection,
|
|
6239
6604
|
getSelectRows,
|
|
6240
|
-
getSelectRowKeys
|
|
6605
|
+
getSelectRowKeys,
|
|
6606
|
+
setSelectedRowKeys
|
|
6241
6607
|
} = useRowSelection(getProps, emit);
|
|
6242
6608
|
const { getScrollRef, filterSource } = useTableScroll(getProps, tableElRef, getColumnsRef, getRowSelectionRef);
|
|
6243
6609
|
function setProps(props2) {
|
|
@@ -6253,6 +6619,7 @@ const _sfc_main$x = defineComponent({
|
|
|
6253
6619
|
getCacheColumns,
|
|
6254
6620
|
getSelectRows,
|
|
6255
6621
|
getSelectRowKeys,
|
|
6622
|
+
emit,
|
|
6256
6623
|
getSize: () => {
|
|
6257
6624
|
return unref(getBind).size;
|
|
6258
6625
|
}
|
|
@@ -6267,6 +6634,12 @@ const _sfc_main$x = defineComponent({
|
|
|
6267
6634
|
setPagination,
|
|
6268
6635
|
clearSelectedRowKeys
|
|
6269
6636
|
});
|
|
6637
|
+
const { customRow } = useCustomRow(getProps, {
|
|
6638
|
+
setSelectedRowKeys,
|
|
6639
|
+
getSelectRowKeys,
|
|
6640
|
+
clearSelectedRowKeys,
|
|
6641
|
+
emit
|
|
6642
|
+
});
|
|
6270
6643
|
const getBind = computed(() => {
|
|
6271
6644
|
return {
|
|
6272
6645
|
...attrs,
|
|
@@ -6279,7 +6652,8 @@ const _sfc_main$x = defineComponent({
|
|
|
6279
6652
|
rowSelection: unref(getRowSelectionRef),
|
|
6280
6653
|
rowKey: unref(getProps).rowKey,
|
|
6281
6654
|
columns: unref(getViewColumns),
|
|
6282
|
-
tableLayout: "fixed"
|
|
6655
|
+
tableLayout: "fixed",
|
|
6656
|
+
customRow
|
|
6283
6657
|
};
|
|
6284
6658
|
});
|
|
6285
6659
|
createTableInstance({ ...tableAction, tableElRef, getBind });
|
|
@@ -6316,12 +6690,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6316
6690
|
onChange: _ctx.handleTableChange,
|
|
6317
6691
|
onResizeColumn: _ctx.handleResizeColumn
|
|
6318
6692
|
}), createSlots({
|
|
6319
|
-
bodyCell: withCtx(({ column, record, index
|
|
6693
|
+
bodyCell: withCtx(({ column, record, index }) => [
|
|
6320
6694
|
(column == null ? void 0 : column.render) ? (openBlock(), createBlock(_component_TableRender, {
|
|
6321
6695
|
key: 0,
|
|
6322
6696
|
column,
|
|
6323
6697
|
record,
|
|
6324
|
-
index
|
|
6698
|
+
index
|
|
6325
6699
|
}, null, 8, ["column", "record", "index"])) : createCommentVNode("", true)
|
|
6326
6700
|
]),
|
|
6327
6701
|
_: 2
|
|
@@ -6336,20 +6710,23 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6336
6710
|
})
|
|
6337
6711
|
]), 1040, ["rowClassName", "onChange", "onResizeColumn"]);
|
|
6338
6712
|
}
|
|
6339
|
-
var
|
|
6713
|
+
var DtTable = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render]]);
|
|
6340
6714
|
function useFetch(api, baseUrl = "") {
|
|
6341
|
-
function fetch(params
|
|
6342
|
-
let type, header = {}, model = {}
|
|
6715
|
+
function fetch(params) {
|
|
6716
|
+
let type, header = {}, model = {};
|
|
6343
6717
|
if (isString(api)) {
|
|
6344
|
-
|
|
6718
|
+
api = baseUrl + api;
|
|
6345
6719
|
} else {
|
|
6346
6720
|
type = api.type;
|
|
6347
|
-
|
|
6721
|
+
if (api.api.indexOf(baseUrl) === -1) {
|
|
6722
|
+
api.api = `${baseUrl}${api.api}`;
|
|
6723
|
+
}
|
|
6348
6724
|
header = api.header;
|
|
6349
6725
|
model = api.model;
|
|
6350
6726
|
}
|
|
6351
6727
|
return new Promise((resolve, reject) => {
|
|
6352
|
-
|
|
6728
|
+
let param = isObject(params) ? Object.assign({}, model, params) : params;
|
|
6729
|
+
http[type || "post"](api, param, {
|
|
6353
6730
|
...header,
|
|
6354
6731
|
...{ onlyData: false }
|
|
6355
6732
|
}).then((data) => {
|
|
@@ -6396,9 +6773,18 @@ function useSource(opt) {
|
|
|
6396
6773
|
const { add, deletes, update, queryById, queryPage } = api;
|
|
6397
6774
|
const { message } = useMessage();
|
|
6398
6775
|
const apiFul = {};
|
|
6776
|
+
const apiPath = {};
|
|
6399
6777
|
for (let it in api) {
|
|
6400
6778
|
loading["on" + it.slice(0, 1).toUpperCase() + it.slice(1).toLowerCase()] = ref(false);
|
|
6401
|
-
|
|
6779
|
+
if (isString(api[it])) {
|
|
6780
|
+
apiFul[it] = baseUrl + api[it];
|
|
6781
|
+
} else {
|
|
6782
|
+
apiFul[it] = {
|
|
6783
|
+
...api[it],
|
|
6784
|
+
api: baseUrl + api[it].api
|
|
6785
|
+
};
|
|
6786
|
+
}
|
|
6787
|
+
apiPath[it] = baseUrl + (isString(api[it]) ? api[it] : api[it].api);
|
|
6402
6788
|
}
|
|
6403
6789
|
const { appConf } = useAppStore();
|
|
6404
6790
|
const pagination = ref({
|
|
@@ -6415,7 +6801,7 @@ function useSource(opt) {
|
|
|
6415
6801
|
},
|
|
6416
6802
|
orderDTOs: []
|
|
6417
6803
|
});
|
|
6418
|
-
function onSearch(model) {
|
|
6804
|
+
function onSearch(model = {}) {
|
|
6419
6805
|
baseData.entityDTO = { ...model };
|
|
6420
6806
|
baseData.pageDTO.pageNo = 0;
|
|
6421
6807
|
loading.onSearch.value = true;
|
|
@@ -6428,12 +6814,20 @@ function useSource(opt) {
|
|
|
6428
6814
|
search();
|
|
6429
6815
|
}
|
|
6430
6816
|
function onTableChange(params, needSearch = true) {
|
|
6431
|
-
const { pagination: pagination2, showBtnLoading, sort
|
|
6817
|
+
const { pagination: pagination2, showBtnLoading, sort, filter: filter2 } = params;
|
|
6432
6818
|
baseData.pageDTO = {
|
|
6433
6819
|
pageNo: pagination2.current - 1,
|
|
6434
6820
|
pageSize: pagination2.pageSize
|
|
6435
6821
|
};
|
|
6436
|
-
|
|
6822
|
+
const { field, order } = sort;
|
|
6823
|
+
if (field) {
|
|
6824
|
+
baseData.orderDTOs = [{
|
|
6825
|
+
propertyName: field,
|
|
6826
|
+
dir: order === "ascend" ? "asc" : "desc"
|
|
6827
|
+
}];
|
|
6828
|
+
} else {
|
|
6829
|
+
baseData.orderDTOs = [];
|
|
6830
|
+
}
|
|
6437
6831
|
if (needSearch)
|
|
6438
6832
|
search();
|
|
6439
6833
|
}
|
|
@@ -6457,7 +6851,7 @@ function useSource(opt) {
|
|
|
6457
6851
|
}
|
|
6458
6852
|
function onAdd(model) {
|
|
6459
6853
|
const { fetch } = useFetch(add, baseUrl);
|
|
6460
|
-
fetch(model).then((rsp) => {
|
|
6854
|
+
return fetch(model).then((rsp) => {
|
|
6461
6855
|
message.success("\u65B0\u589E\u6210\u529F");
|
|
6462
6856
|
search();
|
|
6463
6857
|
});
|
|
@@ -6468,14 +6862,15 @@ function useSource(opt) {
|
|
|
6468
6862
|
}
|
|
6469
6863
|
function onUpdate(model) {
|
|
6470
6864
|
const { fetch } = useFetch(update, baseUrl);
|
|
6471
|
-
fetch(model).then((rsp) => {
|
|
6865
|
+
return fetch(model).then((rsp) => {
|
|
6472
6866
|
message.success("\u66F4\u65B0\u6570\u636E\u6210\u529F");
|
|
6473
6867
|
search();
|
|
6474
6868
|
});
|
|
6475
6869
|
}
|
|
6476
6870
|
function onDeletes(ids) {
|
|
6477
6871
|
const { fetch } = useFetch(deletes, baseUrl);
|
|
6478
|
-
fetch(ids).then((rsp) => {
|
|
6872
|
+
fetch(toRaw(ids)).then((rsp) => {
|
|
6873
|
+
message.success(`${ids.length > 1 ? "\u6279\u91CF" : ""} \u5220\u9664\u6210\u529F\uFF01`);
|
|
6479
6874
|
search();
|
|
6480
6875
|
});
|
|
6481
6876
|
}
|
|
@@ -6501,8 +6896,8 @@ function useSource(opt) {
|
|
|
6501
6896
|
onDeletes
|
|
6502
6897
|
};
|
|
6503
6898
|
return {
|
|
6504
|
-
api,
|
|
6505
|
-
|
|
6899
|
+
api: apiFul,
|
|
6900
|
+
apiPath,
|
|
6506
6901
|
form,
|
|
6507
6902
|
table,
|
|
6508
6903
|
curd,
|
|
@@ -6545,14 +6940,15 @@ const basicProps = {
|
|
|
6545
6940
|
type: Object
|
|
6546
6941
|
}
|
|
6547
6942
|
};
|
|
6548
|
-
const _sfc_main$
|
|
6943
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
6549
6944
|
__name: "dialog",
|
|
6550
6945
|
props: {
|
|
6551
6946
|
...basicProps,
|
|
6552
6947
|
...{
|
|
6553
6948
|
onRegister: { type: Function },
|
|
6554
6949
|
formProps: {
|
|
6555
|
-
type: Object
|
|
6950
|
+
type: Object,
|
|
6951
|
+
default: () => ({})
|
|
6556
6952
|
},
|
|
6557
6953
|
formsVal: {
|
|
6558
6954
|
type: Object
|
|
@@ -6561,7 +6957,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
6561
6957
|
},
|
|
6562
6958
|
setup(__props) {
|
|
6563
6959
|
const props = __props;
|
|
6564
|
-
const [registerDialog] = useModal({
|
|
6960
|
+
const [registerDialog, { closeModal }] = useModal({
|
|
6565
6961
|
...omit(toRaw(props), [
|
|
6566
6962
|
"actions",
|
|
6567
6963
|
"curd",
|
|
@@ -6573,7 +6969,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
6573
6969
|
destroyOnClose: true
|
|
6574
6970
|
});
|
|
6575
6971
|
const [registerForm, { getFormValues, setFormValues }] = useForm({
|
|
6576
|
-
...props.formProps
|
|
6972
|
+
...props.formProps || {},
|
|
6577
6973
|
schemas: props.schemas,
|
|
6578
6974
|
mode: "dialog"
|
|
6579
6975
|
});
|
|
@@ -6586,11 +6982,12 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
6586
6982
|
var _a;
|
|
6587
6983
|
if (props.curd && isFunction((_a = props.curd) == null ? void 0 : _a.onAdd)) {
|
|
6588
6984
|
let obj = Object.assign({}, props.formsVal.value || {}, getFormValues());
|
|
6589
|
-
obj.id ? props.curd.onUpdate(obj) : props.curd.onAdd(obj);
|
|
6985
|
+
let pro = obj.id ? props.curd.onUpdate(obj) : props.curd.onAdd(obj);
|
|
6986
|
+
pro.then((rsp) => closeModal());
|
|
6590
6987
|
}
|
|
6591
6988
|
}
|
|
6592
6989
|
return (_ctx, _cache) => {
|
|
6593
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
6990
|
+
return openBlock(), createBlock(unref(_sfc_main$L), {
|
|
6594
6991
|
onRegister: unref(registerDialog),
|
|
6595
6992
|
onSave: handleSave
|
|
6596
6993
|
}, {
|
|
@@ -6615,7 +7012,7 @@ function useCurd(curdOpt) {
|
|
|
6615
7012
|
const DtCurdModal = () => {
|
|
6616
7013
|
return h(createVNode("div", {
|
|
6617
7014
|
"class": "curdModal"
|
|
6618
|
-
}, [createVNode(_sfc_main$
|
|
7015
|
+
}, [createVNode(_sfc_main$A, mergeProps(curdOpt, {
|
|
6619
7016
|
"formsVal": formsVal,
|
|
6620
7017
|
"formProps": curdOpt.formProps,
|
|
6621
7018
|
"onRegister": register
|
|
@@ -6681,9 +7078,9 @@ function useCurd(curdOpt) {
|
|
|
6681
7078
|
update
|
|
6682
7079
|
};
|
|
6683
7080
|
}
|
|
6684
|
-
const _hoisted_1$
|
|
6685
|
-
const _hoisted_2$
|
|
6686
|
-
const _sfc_main$
|
|
7081
|
+
const _hoisted_1$l = { class: "iframe-page" };
|
|
7082
|
+
const _hoisted_2$d = ["src"];
|
|
7083
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
6687
7084
|
__name: "index",
|
|
6688
7085
|
props: {
|
|
6689
7086
|
showLoading: {
|
|
@@ -6705,7 +7102,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
6705
7102
|
iframeWin.postMessage(props.postMsg, props.src);
|
|
6706
7103
|
}
|
|
6707
7104
|
return (_ctx, _cache) => {
|
|
6708
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
7105
|
+
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
6709
7106
|
createVNode(unref(Spin), {
|
|
6710
7107
|
spinning: loading.value,
|
|
6711
7108
|
size: "large"
|
|
@@ -6717,7 +7114,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
6717
7114
|
ref_key: "frameRef",
|
|
6718
7115
|
ref: frameRef,
|
|
6719
7116
|
onLoad: _cache[0] || (_cache[0] = ($event) => afterLoaded())
|
|
6720
|
-
}, null, 40, _hoisted_2$
|
|
7117
|
+
}, null, 40, _hoisted_2$d)
|
|
6721
7118
|
]),
|
|
6722
7119
|
_: 1
|
|
6723
7120
|
}, 8, ["spinning"])
|
|
@@ -6725,52 +7122,1494 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
6725
7122
|
};
|
|
6726
7123
|
}
|
|
6727
7124
|
});
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
7125
|
+
const basicUploadProps = {
|
|
7126
|
+
showTemplateDownload: {
|
|
7127
|
+
type: Boolean,
|
|
7128
|
+
default: false
|
|
7129
|
+
},
|
|
7130
|
+
templateDownload: {
|
|
7131
|
+
type: Function,
|
|
7132
|
+
default: () => {
|
|
7133
|
+
}
|
|
7134
|
+
},
|
|
7135
|
+
helpText: {
|
|
7136
|
+
type: String,
|
|
7137
|
+
default: ""
|
|
7138
|
+
},
|
|
7139
|
+
multiple: {
|
|
7140
|
+
type: Boolean,
|
|
7141
|
+
default: true
|
|
7142
|
+
},
|
|
7143
|
+
accept: {
|
|
7144
|
+
type: Array,
|
|
7145
|
+
default: () => []
|
|
7146
|
+
},
|
|
7147
|
+
maxSize: {
|
|
7148
|
+
type: Number,
|
|
7149
|
+
default: 2
|
|
7150
|
+
},
|
|
7151
|
+
maxNumber: {
|
|
7152
|
+
type: Number,
|
|
7153
|
+
default: Infinity
|
|
7154
|
+
},
|
|
7155
|
+
defaultFiles: {
|
|
7156
|
+
type: Array,
|
|
7157
|
+
default: []
|
|
6740
7158
|
}
|
|
7159
|
+
};
|
|
7160
|
+
function useHelpers(acceptRef, helpTextRef, maxNumberRef, maxSizeRef) {
|
|
7161
|
+
const getAccept = computed(() => {
|
|
7162
|
+
const accept = unref(acceptRef);
|
|
7163
|
+
if (accept && accept.length > 0) {
|
|
7164
|
+
return accept;
|
|
7165
|
+
}
|
|
7166
|
+
return [];
|
|
7167
|
+
});
|
|
7168
|
+
const getStringAccept = computed(() => {
|
|
7169
|
+
return unref(getAccept).map((item) => {
|
|
7170
|
+
if (item.indexOf("/") > 0 || item.startsWith(".")) {
|
|
7171
|
+
return item;
|
|
7172
|
+
}
|
|
7173
|
+
return `.${item}`;
|
|
7174
|
+
}).join(",");
|
|
7175
|
+
});
|
|
6741
7176
|
return {
|
|
6742
|
-
|
|
7177
|
+
getStringAccept
|
|
6743
7178
|
};
|
|
6744
7179
|
}
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
{
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
7180
|
+
var sparkMd5 = { exports: {} };
|
|
7181
|
+
(function(module, exports) {
|
|
7182
|
+
(function(factory) {
|
|
7183
|
+
{
|
|
7184
|
+
module.exports = factory();
|
|
7185
|
+
}
|
|
7186
|
+
})(function(undefined$1) {
|
|
7187
|
+
var hex_chr = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
|
7188
|
+
function md5cycle(x, k) {
|
|
7189
|
+
var a = x[0], b = x[1], c = x[2], d = x[3];
|
|
7190
|
+
a += (b & c | ~b & d) + k[0] - 680876936 | 0;
|
|
7191
|
+
a = (a << 7 | a >>> 25) + b | 0;
|
|
7192
|
+
d += (a & b | ~a & c) + k[1] - 389564586 | 0;
|
|
7193
|
+
d = (d << 12 | d >>> 20) + a | 0;
|
|
7194
|
+
c += (d & a | ~d & b) + k[2] + 606105819 | 0;
|
|
7195
|
+
c = (c << 17 | c >>> 15) + d | 0;
|
|
7196
|
+
b += (c & d | ~c & a) + k[3] - 1044525330 | 0;
|
|
7197
|
+
b = (b << 22 | b >>> 10) + c | 0;
|
|
7198
|
+
a += (b & c | ~b & d) + k[4] - 176418897 | 0;
|
|
7199
|
+
a = (a << 7 | a >>> 25) + b | 0;
|
|
7200
|
+
d += (a & b | ~a & c) + k[5] + 1200080426 | 0;
|
|
7201
|
+
d = (d << 12 | d >>> 20) + a | 0;
|
|
7202
|
+
c += (d & a | ~d & b) + k[6] - 1473231341 | 0;
|
|
7203
|
+
c = (c << 17 | c >>> 15) + d | 0;
|
|
7204
|
+
b += (c & d | ~c & a) + k[7] - 45705983 | 0;
|
|
7205
|
+
b = (b << 22 | b >>> 10) + c | 0;
|
|
7206
|
+
a += (b & c | ~b & d) + k[8] + 1770035416 | 0;
|
|
7207
|
+
a = (a << 7 | a >>> 25) + b | 0;
|
|
7208
|
+
d += (a & b | ~a & c) + k[9] - 1958414417 | 0;
|
|
7209
|
+
d = (d << 12 | d >>> 20) + a | 0;
|
|
7210
|
+
c += (d & a | ~d & b) + k[10] - 42063 | 0;
|
|
7211
|
+
c = (c << 17 | c >>> 15) + d | 0;
|
|
7212
|
+
b += (c & d | ~c & a) + k[11] - 1990404162 | 0;
|
|
7213
|
+
b = (b << 22 | b >>> 10) + c | 0;
|
|
7214
|
+
a += (b & c | ~b & d) + k[12] + 1804603682 | 0;
|
|
7215
|
+
a = (a << 7 | a >>> 25) + b | 0;
|
|
7216
|
+
d += (a & b | ~a & c) + k[13] - 40341101 | 0;
|
|
7217
|
+
d = (d << 12 | d >>> 20) + a | 0;
|
|
7218
|
+
c += (d & a | ~d & b) + k[14] - 1502002290 | 0;
|
|
7219
|
+
c = (c << 17 | c >>> 15) + d | 0;
|
|
7220
|
+
b += (c & d | ~c & a) + k[15] + 1236535329 | 0;
|
|
7221
|
+
b = (b << 22 | b >>> 10) + c | 0;
|
|
7222
|
+
a += (b & d | c & ~d) + k[1] - 165796510 | 0;
|
|
7223
|
+
a = (a << 5 | a >>> 27) + b | 0;
|
|
7224
|
+
d += (a & c | b & ~c) + k[6] - 1069501632 | 0;
|
|
7225
|
+
d = (d << 9 | d >>> 23) + a | 0;
|
|
7226
|
+
c += (d & b | a & ~b) + k[11] + 643717713 | 0;
|
|
7227
|
+
c = (c << 14 | c >>> 18) + d | 0;
|
|
7228
|
+
b += (c & a | d & ~a) + k[0] - 373897302 | 0;
|
|
7229
|
+
b = (b << 20 | b >>> 12) + c | 0;
|
|
7230
|
+
a += (b & d | c & ~d) + k[5] - 701558691 | 0;
|
|
7231
|
+
a = (a << 5 | a >>> 27) + b | 0;
|
|
7232
|
+
d += (a & c | b & ~c) + k[10] + 38016083 | 0;
|
|
7233
|
+
d = (d << 9 | d >>> 23) + a | 0;
|
|
7234
|
+
c += (d & b | a & ~b) + k[15] - 660478335 | 0;
|
|
7235
|
+
c = (c << 14 | c >>> 18) + d | 0;
|
|
7236
|
+
b += (c & a | d & ~a) + k[4] - 405537848 | 0;
|
|
7237
|
+
b = (b << 20 | b >>> 12) + c | 0;
|
|
7238
|
+
a += (b & d | c & ~d) + k[9] + 568446438 | 0;
|
|
7239
|
+
a = (a << 5 | a >>> 27) + b | 0;
|
|
7240
|
+
d += (a & c | b & ~c) + k[14] - 1019803690 | 0;
|
|
7241
|
+
d = (d << 9 | d >>> 23) + a | 0;
|
|
7242
|
+
c += (d & b | a & ~b) + k[3] - 187363961 | 0;
|
|
7243
|
+
c = (c << 14 | c >>> 18) + d | 0;
|
|
7244
|
+
b += (c & a | d & ~a) + k[8] + 1163531501 | 0;
|
|
7245
|
+
b = (b << 20 | b >>> 12) + c | 0;
|
|
7246
|
+
a += (b & d | c & ~d) + k[13] - 1444681467 | 0;
|
|
7247
|
+
a = (a << 5 | a >>> 27) + b | 0;
|
|
7248
|
+
d += (a & c | b & ~c) + k[2] - 51403784 | 0;
|
|
7249
|
+
d = (d << 9 | d >>> 23) + a | 0;
|
|
7250
|
+
c += (d & b | a & ~b) + k[7] + 1735328473 | 0;
|
|
7251
|
+
c = (c << 14 | c >>> 18) + d | 0;
|
|
7252
|
+
b += (c & a | d & ~a) + k[12] - 1926607734 | 0;
|
|
7253
|
+
b = (b << 20 | b >>> 12) + c | 0;
|
|
7254
|
+
a += (b ^ c ^ d) + k[5] - 378558 | 0;
|
|
7255
|
+
a = (a << 4 | a >>> 28) + b | 0;
|
|
7256
|
+
d += (a ^ b ^ c) + k[8] - 2022574463 | 0;
|
|
7257
|
+
d = (d << 11 | d >>> 21) + a | 0;
|
|
7258
|
+
c += (d ^ a ^ b) + k[11] + 1839030562 | 0;
|
|
7259
|
+
c = (c << 16 | c >>> 16) + d | 0;
|
|
7260
|
+
b += (c ^ d ^ a) + k[14] - 35309556 | 0;
|
|
7261
|
+
b = (b << 23 | b >>> 9) + c | 0;
|
|
7262
|
+
a += (b ^ c ^ d) + k[1] - 1530992060 | 0;
|
|
7263
|
+
a = (a << 4 | a >>> 28) + b | 0;
|
|
7264
|
+
d += (a ^ b ^ c) + k[4] + 1272893353 | 0;
|
|
7265
|
+
d = (d << 11 | d >>> 21) + a | 0;
|
|
7266
|
+
c += (d ^ a ^ b) + k[7] - 155497632 | 0;
|
|
7267
|
+
c = (c << 16 | c >>> 16) + d | 0;
|
|
7268
|
+
b += (c ^ d ^ a) + k[10] - 1094730640 | 0;
|
|
7269
|
+
b = (b << 23 | b >>> 9) + c | 0;
|
|
7270
|
+
a += (b ^ c ^ d) + k[13] + 681279174 | 0;
|
|
7271
|
+
a = (a << 4 | a >>> 28) + b | 0;
|
|
7272
|
+
d += (a ^ b ^ c) + k[0] - 358537222 | 0;
|
|
7273
|
+
d = (d << 11 | d >>> 21) + a | 0;
|
|
7274
|
+
c += (d ^ a ^ b) + k[3] - 722521979 | 0;
|
|
7275
|
+
c = (c << 16 | c >>> 16) + d | 0;
|
|
7276
|
+
b += (c ^ d ^ a) + k[6] + 76029189 | 0;
|
|
7277
|
+
b = (b << 23 | b >>> 9) + c | 0;
|
|
7278
|
+
a += (b ^ c ^ d) + k[9] - 640364487 | 0;
|
|
7279
|
+
a = (a << 4 | a >>> 28) + b | 0;
|
|
7280
|
+
d += (a ^ b ^ c) + k[12] - 421815835 | 0;
|
|
7281
|
+
d = (d << 11 | d >>> 21) + a | 0;
|
|
7282
|
+
c += (d ^ a ^ b) + k[15] + 530742520 | 0;
|
|
7283
|
+
c = (c << 16 | c >>> 16) + d | 0;
|
|
7284
|
+
b += (c ^ d ^ a) + k[2] - 995338651 | 0;
|
|
7285
|
+
b = (b << 23 | b >>> 9) + c | 0;
|
|
7286
|
+
a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;
|
|
7287
|
+
a = (a << 6 | a >>> 26) + b | 0;
|
|
7288
|
+
d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;
|
|
7289
|
+
d = (d << 10 | d >>> 22) + a | 0;
|
|
7290
|
+
c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;
|
|
7291
|
+
c = (c << 15 | c >>> 17) + d | 0;
|
|
7292
|
+
b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;
|
|
7293
|
+
b = (b << 21 | b >>> 11) + c | 0;
|
|
7294
|
+
a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;
|
|
7295
|
+
a = (a << 6 | a >>> 26) + b | 0;
|
|
7296
|
+
d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;
|
|
7297
|
+
d = (d << 10 | d >>> 22) + a | 0;
|
|
7298
|
+
c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;
|
|
7299
|
+
c = (c << 15 | c >>> 17) + d | 0;
|
|
7300
|
+
b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;
|
|
7301
|
+
b = (b << 21 | b >>> 11) + c | 0;
|
|
7302
|
+
a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;
|
|
7303
|
+
a = (a << 6 | a >>> 26) + b | 0;
|
|
7304
|
+
d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;
|
|
7305
|
+
d = (d << 10 | d >>> 22) + a | 0;
|
|
7306
|
+
c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;
|
|
7307
|
+
c = (c << 15 | c >>> 17) + d | 0;
|
|
7308
|
+
b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;
|
|
7309
|
+
b = (b << 21 | b >>> 11) + c | 0;
|
|
7310
|
+
a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;
|
|
7311
|
+
a = (a << 6 | a >>> 26) + b | 0;
|
|
7312
|
+
d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;
|
|
7313
|
+
d = (d << 10 | d >>> 22) + a | 0;
|
|
7314
|
+
c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;
|
|
7315
|
+
c = (c << 15 | c >>> 17) + d | 0;
|
|
7316
|
+
b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;
|
|
7317
|
+
b = (b << 21 | b >>> 11) + c | 0;
|
|
7318
|
+
x[0] = a + x[0] | 0;
|
|
7319
|
+
x[1] = b + x[1] | 0;
|
|
7320
|
+
x[2] = c + x[2] | 0;
|
|
7321
|
+
x[3] = d + x[3] | 0;
|
|
7322
|
+
}
|
|
7323
|
+
function md5blk(s) {
|
|
7324
|
+
var md5blks = [], i;
|
|
7325
|
+
for (i = 0; i < 64; i += 4) {
|
|
7326
|
+
md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);
|
|
7327
|
+
}
|
|
7328
|
+
return md5blks;
|
|
6756
7329
|
}
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
7330
|
+
function md5blk_array(a) {
|
|
7331
|
+
var md5blks = [], i;
|
|
7332
|
+
for (i = 0; i < 64; i += 4) {
|
|
7333
|
+
md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);
|
|
7334
|
+
}
|
|
7335
|
+
return md5blks;
|
|
7336
|
+
}
|
|
7337
|
+
function md51(s) {
|
|
7338
|
+
var n = s.length, state = [1732584193, -271733879, -1732584194, 271733878], i, length, tail, tmp, lo, hi;
|
|
7339
|
+
for (i = 64; i <= n; i += 64) {
|
|
7340
|
+
md5cycle(state, md5blk(s.substring(i - 64, i)));
|
|
7341
|
+
}
|
|
7342
|
+
s = s.substring(i - 64);
|
|
7343
|
+
length = s.length;
|
|
7344
|
+
tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
7345
|
+
for (i = 0; i < length; i += 1) {
|
|
7346
|
+
tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);
|
|
7347
|
+
}
|
|
7348
|
+
tail[i >> 2] |= 128 << (i % 4 << 3);
|
|
7349
|
+
if (i > 55) {
|
|
7350
|
+
md5cycle(state, tail);
|
|
7351
|
+
for (i = 0; i < 16; i += 1) {
|
|
7352
|
+
tail[i] = 0;
|
|
7353
|
+
}
|
|
7354
|
+
}
|
|
7355
|
+
tmp = n * 8;
|
|
7356
|
+
tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
|
|
7357
|
+
lo = parseInt(tmp[2], 16);
|
|
7358
|
+
hi = parseInt(tmp[1], 16) || 0;
|
|
7359
|
+
tail[14] = lo;
|
|
7360
|
+
tail[15] = hi;
|
|
7361
|
+
md5cycle(state, tail);
|
|
7362
|
+
return state;
|
|
7363
|
+
}
|
|
7364
|
+
function md51_array(a) {
|
|
7365
|
+
var n = a.length, state = [1732584193, -271733879, -1732584194, 271733878], i, length, tail, tmp, lo, hi;
|
|
7366
|
+
for (i = 64; i <= n; i += 64) {
|
|
7367
|
+
md5cycle(state, md5blk_array(a.subarray(i - 64, i)));
|
|
7368
|
+
}
|
|
7369
|
+
a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);
|
|
7370
|
+
length = a.length;
|
|
7371
|
+
tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
7372
|
+
for (i = 0; i < length; i += 1) {
|
|
7373
|
+
tail[i >> 2] |= a[i] << (i % 4 << 3);
|
|
7374
|
+
}
|
|
7375
|
+
tail[i >> 2] |= 128 << (i % 4 << 3);
|
|
7376
|
+
if (i > 55) {
|
|
7377
|
+
md5cycle(state, tail);
|
|
7378
|
+
for (i = 0; i < 16; i += 1) {
|
|
7379
|
+
tail[i] = 0;
|
|
7380
|
+
}
|
|
7381
|
+
}
|
|
7382
|
+
tmp = n * 8;
|
|
7383
|
+
tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
|
|
7384
|
+
lo = parseInt(tmp[2], 16);
|
|
7385
|
+
hi = parseInt(tmp[1], 16) || 0;
|
|
7386
|
+
tail[14] = lo;
|
|
7387
|
+
tail[15] = hi;
|
|
7388
|
+
md5cycle(state, tail);
|
|
7389
|
+
return state;
|
|
7390
|
+
}
|
|
7391
|
+
function rhex(n) {
|
|
7392
|
+
var s = "", j;
|
|
7393
|
+
for (j = 0; j < 4; j += 1) {
|
|
7394
|
+
s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];
|
|
7395
|
+
}
|
|
7396
|
+
return s;
|
|
7397
|
+
}
|
|
7398
|
+
function hex(x) {
|
|
7399
|
+
var i;
|
|
7400
|
+
for (i = 0; i < x.length; i += 1) {
|
|
7401
|
+
x[i] = rhex(x[i]);
|
|
7402
|
+
}
|
|
7403
|
+
return x.join("");
|
|
7404
|
+
}
|
|
7405
|
+
if (hex(md51("hello")) !== "5d41402abc4b2a76b9719d911017c592")
|
|
7406
|
+
;
|
|
7407
|
+
if (typeof ArrayBuffer !== "undefined" && !ArrayBuffer.prototype.slice) {
|
|
7408
|
+
(function() {
|
|
7409
|
+
function clamp(val, length) {
|
|
7410
|
+
val = val | 0 || 0;
|
|
7411
|
+
if (val < 0) {
|
|
7412
|
+
return Math.max(val + length, 0);
|
|
7413
|
+
}
|
|
7414
|
+
return Math.min(val, length);
|
|
7415
|
+
}
|
|
7416
|
+
ArrayBuffer.prototype.slice = function(from, to) {
|
|
7417
|
+
var length = this.byteLength, begin = clamp(from, length), end = length, num, target, targetArray, sourceArray;
|
|
7418
|
+
if (to !== undefined$1) {
|
|
7419
|
+
end = clamp(to, length);
|
|
7420
|
+
}
|
|
7421
|
+
if (begin > end) {
|
|
7422
|
+
return new ArrayBuffer(0);
|
|
7423
|
+
}
|
|
7424
|
+
num = end - begin;
|
|
7425
|
+
target = new ArrayBuffer(num);
|
|
7426
|
+
targetArray = new Uint8Array(target);
|
|
7427
|
+
sourceArray = new Uint8Array(this, begin, num);
|
|
7428
|
+
targetArray.set(sourceArray);
|
|
7429
|
+
return target;
|
|
7430
|
+
};
|
|
7431
|
+
})();
|
|
7432
|
+
}
|
|
7433
|
+
function toUtf8(str) {
|
|
7434
|
+
if (/[\u0080-\uFFFF]/.test(str)) {
|
|
7435
|
+
str = unescape(encodeURIComponent(str));
|
|
7436
|
+
}
|
|
7437
|
+
return str;
|
|
7438
|
+
}
|
|
7439
|
+
function utf8Str2ArrayBuffer(str, returnUInt8Array) {
|
|
7440
|
+
var length = str.length, buff = new ArrayBuffer(length), arr = new Uint8Array(buff), i;
|
|
7441
|
+
for (i = 0; i < length; i += 1) {
|
|
7442
|
+
arr[i] = str.charCodeAt(i);
|
|
7443
|
+
}
|
|
7444
|
+
return returnUInt8Array ? arr : buff;
|
|
7445
|
+
}
|
|
7446
|
+
function arrayBuffer2Utf8Str(buff) {
|
|
7447
|
+
return String.fromCharCode.apply(null, new Uint8Array(buff));
|
|
7448
|
+
}
|
|
7449
|
+
function concatenateArrayBuffers(first, second, returnUInt8Array) {
|
|
7450
|
+
var result = new Uint8Array(first.byteLength + second.byteLength);
|
|
7451
|
+
result.set(new Uint8Array(first));
|
|
7452
|
+
result.set(new Uint8Array(second), first.byteLength);
|
|
7453
|
+
return returnUInt8Array ? result : result.buffer;
|
|
7454
|
+
}
|
|
7455
|
+
function hexToBinaryString(hex2) {
|
|
7456
|
+
var bytes = [], length = hex2.length, x;
|
|
7457
|
+
for (x = 0; x < length - 1; x += 2) {
|
|
7458
|
+
bytes.push(parseInt(hex2.substr(x, 2), 16));
|
|
7459
|
+
}
|
|
7460
|
+
return String.fromCharCode.apply(String, bytes);
|
|
7461
|
+
}
|
|
7462
|
+
function SparkMD5() {
|
|
7463
|
+
this.reset();
|
|
7464
|
+
}
|
|
7465
|
+
SparkMD5.prototype.append = function(str) {
|
|
7466
|
+
this.appendBinary(toUtf8(str));
|
|
7467
|
+
return this;
|
|
6770
7468
|
};
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
7469
|
+
SparkMD5.prototype.appendBinary = function(contents) {
|
|
7470
|
+
this._buff += contents;
|
|
7471
|
+
this._length += contents.length;
|
|
7472
|
+
var length = this._buff.length, i;
|
|
7473
|
+
for (i = 64; i <= length; i += 64) {
|
|
7474
|
+
md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));
|
|
7475
|
+
}
|
|
7476
|
+
this._buff = this._buff.substring(i - 64);
|
|
7477
|
+
return this;
|
|
7478
|
+
};
|
|
7479
|
+
SparkMD5.prototype.end = function(raw) {
|
|
7480
|
+
var buff = this._buff, length = buff.length, i, tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ret;
|
|
7481
|
+
for (i = 0; i < length; i += 1) {
|
|
7482
|
+
tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);
|
|
7483
|
+
}
|
|
7484
|
+
this._finish(tail, length);
|
|
7485
|
+
ret = hex(this._hash);
|
|
7486
|
+
if (raw) {
|
|
7487
|
+
ret = hexToBinaryString(ret);
|
|
7488
|
+
}
|
|
7489
|
+
this.reset();
|
|
7490
|
+
return ret;
|
|
7491
|
+
};
|
|
7492
|
+
SparkMD5.prototype.reset = function() {
|
|
7493
|
+
this._buff = "";
|
|
7494
|
+
this._length = 0;
|
|
7495
|
+
this._hash = [1732584193, -271733879, -1732584194, 271733878];
|
|
7496
|
+
return this;
|
|
7497
|
+
};
|
|
7498
|
+
SparkMD5.prototype.getState = function() {
|
|
7499
|
+
return {
|
|
7500
|
+
buff: this._buff,
|
|
7501
|
+
length: this._length,
|
|
7502
|
+
hash: this._hash.slice()
|
|
7503
|
+
};
|
|
7504
|
+
};
|
|
7505
|
+
SparkMD5.prototype.setState = function(state) {
|
|
7506
|
+
this._buff = state.buff;
|
|
7507
|
+
this._length = state.length;
|
|
7508
|
+
this._hash = state.hash;
|
|
7509
|
+
return this;
|
|
7510
|
+
};
|
|
7511
|
+
SparkMD5.prototype.destroy = function() {
|
|
7512
|
+
delete this._hash;
|
|
7513
|
+
delete this._buff;
|
|
7514
|
+
delete this._length;
|
|
7515
|
+
};
|
|
7516
|
+
SparkMD5.prototype._finish = function(tail, length) {
|
|
7517
|
+
var i = length, tmp, lo, hi;
|
|
7518
|
+
tail[i >> 2] |= 128 << (i % 4 << 3);
|
|
7519
|
+
if (i > 55) {
|
|
7520
|
+
md5cycle(this._hash, tail);
|
|
7521
|
+
for (i = 0; i < 16; i += 1) {
|
|
7522
|
+
tail[i] = 0;
|
|
7523
|
+
}
|
|
7524
|
+
}
|
|
7525
|
+
tmp = this._length * 8;
|
|
7526
|
+
tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
|
|
7527
|
+
lo = parseInt(tmp[2], 16);
|
|
7528
|
+
hi = parseInt(tmp[1], 16) || 0;
|
|
7529
|
+
tail[14] = lo;
|
|
7530
|
+
tail[15] = hi;
|
|
7531
|
+
md5cycle(this._hash, tail);
|
|
7532
|
+
};
|
|
7533
|
+
SparkMD5.hash = function(str, raw) {
|
|
7534
|
+
return SparkMD5.hashBinary(toUtf8(str), raw);
|
|
7535
|
+
};
|
|
7536
|
+
SparkMD5.hashBinary = function(content, raw) {
|
|
7537
|
+
var hash = md51(content), ret = hex(hash);
|
|
7538
|
+
return raw ? hexToBinaryString(ret) : ret;
|
|
7539
|
+
};
|
|
7540
|
+
SparkMD5.ArrayBuffer = function() {
|
|
7541
|
+
this.reset();
|
|
7542
|
+
};
|
|
7543
|
+
SparkMD5.ArrayBuffer.prototype.append = function(arr) {
|
|
7544
|
+
var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), length = buff.length, i;
|
|
7545
|
+
this._length += arr.byteLength;
|
|
7546
|
+
for (i = 64; i <= length; i += 64) {
|
|
7547
|
+
md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));
|
|
7548
|
+
}
|
|
7549
|
+
this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);
|
|
7550
|
+
return this;
|
|
7551
|
+
};
|
|
7552
|
+
SparkMD5.ArrayBuffer.prototype.end = function(raw) {
|
|
7553
|
+
var buff = this._buff, length = buff.length, tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], i, ret;
|
|
7554
|
+
for (i = 0; i < length; i += 1) {
|
|
7555
|
+
tail[i >> 2] |= buff[i] << (i % 4 << 3);
|
|
7556
|
+
}
|
|
7557
|
+
this._finish(tail, length);
|
|
7558
|
+
ret = hex(this._hash);
|
|
7559
|
+
if (raw) {
|
|
7560
|
+
ret = hexToBinaryString(ret);
|
|
7561
|
+
}
|
|
7562
|
+
this.reset();
|
|
7563
|
+
return ret;
|
|
7564
|
+
};
|
|
7565
|
+
SparkMD5.ArrayBuffer.prototype.reset = function() {
|
|
7566
|
+
this._buff = new Uint8Array(0);
|
|
7567
|
+
this._length = 0;
|
|
7568
|
+
this._hash = [1732584193, -271733879, -1732584194, 271733878];
|
|
7569
|
+
return this;
|
|
7570
|
+
};
|
|
7571
|
+
SparkMD5.ArrayBuffer.prototype.getState = function() {
|
|
7572
|
+
var state = SparkMD5.prototype.getState.call(this);
|
|
7573
|
+
state.buff = arrayBuffer2Utf8Str(state.buff);
|
|
7574
|
+
return state;
|
|
7575
|
+
};
|
|
7576
|
+
SparkMD5.ArrayBuffer.prototype.setState = function(state) {
|
|
7577
|
+
state.buff = utf8Str2ArrayBuffer(state.buff, true);
|
|
7578
|
+
return SparkMD5.prototype.setState.call(this, state);
|
|
7579
|
+
};
|
|
7580
|
+
SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;
|
|
7581
|
+
SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;
|
|
7582
|
+
SparkMD5.ArrayBuffer.hash = function(arr, raw) {
|
|
7583
|
+
var hash = md51_array(new Uint8Array(arr)), ret = hex(hash);
|
|
7584
|
+
return raw ? hexToBinaryString(ret) : ret;
|
|
7585
|
+
};
|
|
7586
|
+
return SparkMD5;
|
|
7587
|
+
});
|
|
7588
|
+
})(sparkMd5);
|
|
7589
|
+
const _hoisted_1$k = { class: "file-header" };
|
|
7590
|
+
const _hoisted_2$c = /* @__PURE__ */ createTextVNode(" \u6587\u4EF6\u4E0A\u4F20 ");
|
|
7591
|
+
const _hoisted_3$6 = /* @__PURE__ */ createTextVNode(" \u6A21\u677F\u4E0B\u8F7D ");
|
|
7592
|
+
const _hoisted_4$4 = { class: "file-type-tips ant-alert-info" };
|
|
7593
|
+
const _hoisted_5$3 = /* @__PURE__ */ createElementVNode("i", null, "\u8BF7\u4E0A\u4F20pptx\u3001doc\u3001jpg\u3001jpeg\u3001png\u3001bmp\u3001gif\u3001xls\u3001xlsx\u3001txt\u3001rar\u3001zip\u30017z\u3001tar\u3001gz\u683C\u5F0F\u6587\u4EF6", -1);
|
|
7594
|
+
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
7595
|
+
__name: "upload",
|
|
7596
|
+
props: basicUploadProps,
|
|
7597
|
+
setup(__props, { expose }) {
|
|
7598
|
+
const props = __props;
|
|
7599
|
+
const { message } = useMessage();
|
|
7600
|
+
const filesRef = ref([]);
|
|
7601
|
+
const historyFilesRef = ref([]);
|
|
7602
|
+
const allFilesRef = ref([]);
|
|
7603
|
+
const imgVisable = ref(false);
|
|
7604
|
+
const setImgVisible = (value) => imgVisable.value = value;
|
|
7605
|
+
const { accept, helpText, maxNumber, maxSize } = toRefs(props);
|
|
7606
|
+
const { getStringAccept } = useHelpers(accept);
|
|
7607
|
+
const [registerTable, {}] = useTable({
|
|
7608
|
+
tableSetting: false,
|
|
7609
|
+
pagination: false,
|
|
7610
|
+
dataSource: allFilesRef,
|
|
7611
|
+
columns: [
|
|
7612
|
+
{ title: "\u6587\u4EF6\u540D\u79F0", dataIndex: "fileName" },
|
|
7613
|
+
{ title: "\u4E0A\u4F20\u72B6\u6001", dataIndex: "fileStatue", render(row) {
|
|
7614
|
+
return h("span", {
|
|
7615
|
+
style: `color: ${row.status === 0 ? "orange" : "green"}`
|
|
7616
|
+
}, row.fileStatue);
|
|
7617
|
+
} }
|
|
7618
|
+
],
|
|
7619
|
+
operations: {
|
|
7620
|
+
expand: true,
|
|
7621
|
+
btns: [
|
|
7622
|
+
{
|
|
7623
|
+
title: "\u9884\u89C8",
|
|
7624
|
+
icon: "ic:baseline-remove-red-eye",
|
|
7625
|
+
ifShow(row) {
|
|
7626
|
+
const supportFileTypes = ["pdf", "jpg", "jpeg", "png", "bmp", "gif"];
|
|
7627
|
+
return supportFileTypes.includes(row.fileName.split(".").pop());
|
|
7628
|
+
},
|
|
7629
|
+
action: () => {
|
|
7630
|
+
setImgVisible(true);
|
|
7631
|
+
}
|
|
7632
|
+
},
|
|
7633
|
+
{ title: "\u7F16\u8F91", icon: "mdi:text-box-edit-outline" },
|
|
7634
|
+
{ title: "\u5220\u9664", icon: "mdi:delete-outline" }
|
|
7635
|
+
]
|
|
7636
|
+
}
|
|
7637
|
+
});
|
|
7638
|
+
watchEffect(() => {
|
|
7639
|
+
historyFilesRef.value = props.defaultFiles.map((file) => {
|
|
7640
|
+
return {
|
|
7641
|
+
...file,
|
|
7642
|
+
fileName: file.fileName,
|
|
7643
|
+
status: 0,
|
|
7644
|
+
fileStatue: "\u5386\u53F2\u4E0A\u4F20"
|
|
7645
|
+
};
|
|
7646
|
+
});
|
|
7647
|
+
allFilesRef.value = [...historyFilesRef.value, ...filesRef.value];
|
|
7648
|
+
});
|
|
7649
|
+
function beforeUpload(file) {
|
|
7650
|
+
const { maxSize: maxSize2 } = props;
|
|
7651
|
+
if (maxSize2 && file.size / 1024 / 1024 >= maxSize2) {
|
|
7652
|
+
message.error(`\u53EA\u80FD\u4E0A\u4F20\u4E0D\u8D85\u8FC7${maxSize2}MB\u7684\u6587\u4EF6!`);
|
|
7653
|
+
return false;
|
|
7654
|
+
}
|
|
7655
|
+
addFile(file);
|
|
7656
|
+
return false;
|
|
7657
|
+
}
|
|
7658
|
+
function addFile(file) {
|
|
7659
|
+
let blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
|
|
7660
|
+
let chunkSize = 2097152, chunks = Math.ceil(file.size / chunkSize), currentChunk = 0, spark = new sparkMd5.exports.ArrayBuffer(), fileReader = new FileReader();
|
|
7661
|
+
fileReader.onload = function(e) {
|
|
7662
|
+
spark.append(e.target["result"]);
|
|
7663
|
+
currentChunk++;
|
|
7664
|
+
if (currentChunk < chunks) {
|
|
7665
|
+
loadNext();
|
|
7666
|
+
} else {
|
|
7667
|
+
filesRef.value.push({
|
|
7668
|
+
fileName: file.name,
|
|
7669
|
+
fileId: spark.end(),
|
|
7670
|
+
file,
|
|
7671
|
+
status: 1,
|
|
7672
|
+
fileStatue: "\u5F85\u4E0A\u4F20"
|
|
7673
|
+
});
|
|
7674
|
+
}
|
|
7675
|
+
};
|
|
7676
|
+
function loadNext() {
|
|
7677
|
+
var start = currentChunk * chunkSize, end = start + chunkSize >= file.size ? file.size : start + chunkSize;
|
|
7678
|
+
fileReader.readAsArrayBuffer(blobSlice.call(file, start, end));
|
|
7679
|
+
}
|
|
7680
|
+
loadNext();
|
|
7681
|
+
}
|
|
7682
|
+
expose({
|
|
7683
|
+
allFilesRef
|
|
7684
|
+
});
|
|
7685
|
+
return (_ctx, _cache) => {
|
|
7686
|
+
const _directive_icon = resolveDirective("icon");
|
|
7687
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
7688
|
+
createElementVNode("div", _hoisted_1$k, [
|
|
7689
|
+
createElementVNode("div", null, [
|
|
7690
|
+
createVNode(unref(Upload), {
|
|
7691
|
+
accept: unref(getStringAccept),
|
|
7692
|
+
multiple: _ctx.multiple,
|
|
7693
|
+
"before-upload": beforeUpload,
|
|
7694
|
+
"show-upload-list": false
|
|
7695
|
+
}, {
|
|
7696
|
+
default: withCtx(() => [
|
|
7697
|
+
createVNode(unref(Button), { type: "primary" }, {
|
|
7698
|
+
default: withCtx(() => [
|
|
7699
|
+
withDirectives(createElementVNode("span", null, null, 512), [
|
|
7700
|
+
[_directive_icon, "ic:baseline-file-upload"]
|
|
7701
|
+
]),
|
|
7702
|
+
_hoisted_2$c
|
|
7703
|
+
]),
|
|
7704
|
+
_: 1
|
|
7705
|
+
})
|
|
7706
|
+
]),
|
|
7707
|
+
_: 1
|
|
7708
|
+
}, 8, ["accept", "multiple"]),
|
|
7709
|
+
_ctx.showTemplateDownload ? (openBlock(), createBlock(unref(Button), {
|
|
7710
|
+
key: 0,
|
|
7711
|
+
type: "primary",
|
|
7712
|
+
onClick: _ctx.templateDownload
|
|
7713
|
+
}, {
|
|
7714
|
+
default: withCtx(() => [
|
|
7715
|
+
withDirectives(createElementVNode("span", null, null, 512), [
|
|
7716
|
+
[_directive_icon, "ic:baseline-file-download"]
|
|
7717
|
+
]),
|
|
7718
|
+
_hoisted_3$6
|
|
7719
|
+
]),
|
|
7720
|
+
_: 1
|
|
7721
|
+
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
7722
|
+
]),
|
|
7723
|
+
renderSlot(_ctx.$slots, "default")
|
|
7724
|
+
]),
|
|
7725
|
+
createElementVNode("div", _hoisted_4$4, [
|
|
7726
|
+
withDirectives(createElementVNode("span", null, null, 512), [
|
|
7727
|
+
[_directive_icon, "ant-design:info-circle-outlined"]
|
|
7728
|
+
]),
|
|
7729
|
+
_hoisted_5$3
|
|
7730
|
+
]),
|
|
7731
|
+
createVNode(unref(DtTable), { onRegister: unref(registerTable) }, null, 8, ["onRegister"]),
|
|
7732
|
+
createVNode(unref(Image), {
|
|
7733
|
+
width: 200,
|
|
7734
|
+
style: { display: "none" },
|
|
7735
|
+
preview: {
|
|
7736
|
+
visible: imgVisable.value,
|
|
7737
|
+
onVisibleChange: setImgVisible
|
|
7738
|
+
},
|
|
7739
|
+
src: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
|
|
7740
|
+
}, null, 8, ["preview"])
|
|
7741
|
+
], 64);
|
|
7742
|
+
};
|
|
7743
|
+
}
|
|
7744
|
+
});
|
|
7745
|
+
const _hoisted_1$j = { class: "dt-upload-wrap" };
|
|
7746
|
+
const _hoisted_2$b = /* @__PURE__ */ createTextVNode(" 111 ");
|
|
7747
|
+
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
7748
|
+
__name: "index",
|
|
7749
|
+
emits: ["register"],
|
|
7750
|
+
setup(__props, { emit: emites }) {
|
|
7751
|
+
const uploadRef = ref(null);
|
|
7752
|
+
const [register] = useModal({
|
|
7753
|
+
width: "700px",
|
|
7754
|
+
title: "\u6587\u4EF6\u4E0A\u4F20",
|
|
7755
|
+
maskClosable: false
|
|
7756
|
+
});
|
|
7757
|
+
const defaultFiles = [
|
|
7758
|
+
{ fileName: "\u53EE\u549A\u53D1\u7968667.09.pdf", fileId: "1" }
|
|
7759
|
+
];
|
|
7760
|
+
function handleSave() {
|
|
7761
|
+
console.log(uploadRef.value.allFilesRef);
|
|
7762
|
+
alert("s-s-s-");
|
|
7763
|
+
}
|
|
7764
|
+
return (_ctx, _cache) => {
|
|
7765
|
+
return openBlock(), createBlock(unref(_sfc_main$L), {
|
|
7766
|
+
onSave: _cache[0] || (_cache[0] = ($event) => handleSave()),
|
|
7767
|
+
onRegister: unref(register)
|
|
7768
|
+
}, {
|
|
7769
|
+
default: withCtx(() => [
|
|
7770
|
+
createElementVNode("div", _hoisted_1$j, [
|
|
7771
|
+
createVNode(_sfc_main$y, {
|
|
7772
|
+
ref_key: "uploadRef",
|
|
7773
|
+
ref: uploadRef,
|
|
7774
|
+
defaultFiles
|
|
7775
|
+
}, {
|
|
7776
|
+
default: withCtx(() => [
|
|
7777
|
+
_hoisted_2$b
|
|
7778
|
+
]),
|
|
7779
|
+
_: 1
|
|
7780
|
+
}, 512)
|
|
7781
|
+
])
|
|
7782
|
+
]),
|
|
7783
|
+
_: 1
|
|
7784
|
+
}, 8, ["onRegister"]);
|
|
7785
|
+
};
|
|
7786
|
+
}
|
|
7787
|
+
});
|
|
7788
|
+
const BasicProps = {
|
|
7789
|
+
loading: {
|
|
7790
|
+
type: Boolean,
|
|
7791
|
+
default: false
|
|
7792
|
+
},
|
|
7793
|
+
checkStrictly: Boolean,
|
|
7794
|
+
expandedKeys: {
|
|
7795
|
+
type: Array,
|
|
7796
|
+
default: () => []
|
|
7797
|
+
},
|
|
7798
|
+
selectedKeys: {
|
|
7799
|
+
type: Array,
|
|
7800
|
+
default: () => []
|
|
7801
|
+
},
|
|
7802
|
+
checkedKeys: {
|
|
7803
|
+
type: Array,
|
|
7804
|
+
default: () => []
|
|
7805
|
+
},
|
|
7806
|
+
fieldNames: {
|
|
7807
|
+
type: Object
|
|
7808
|
+
},
|
|
7809
|
+
beforeRightClick: {
|
|
7810
|
+
type: Function,
|
|
7811
|
+
default: void 0
|
|
7812
|
+
},
|
|
7813
|
+
rightMenuList: {
|
|
7814
|
+
type: Array
|
|
7815
|
+
},
|
|
7816
|
+
renderIcon: {
|
|
7817
|
+
type: Function
|
|
7818
|
+
},
|
|
7819
|
+
highlight: {
|
|
7820
|
+
type: [Boolean, String],
|
|
7821
|
+
default: false
|
|
7822
|
+
},
|
|
7823
|
+
actionList: {
|
|
7824
|
+
type: Array,
|
|
7825
|
+
default: () => []
|
|
7826
|
+
},
|
|
7827
|
+
clickRowToExpand: {
|
|
7828
|
+
type: Boolean,
|
|
7829
|
+
default: false
|
|
7830
|
+
},
|
|
7831
|
+
searchValue: {
|
|
7832
|
+
type: String,
|
|
7833
|
+
default: ""
|
|
7834
|
+
},
|
|
7835
|
+
filterFn: {
|
|
7836
|
+
type: Function,
|
|
7837
|
+
default: void 0
|
|
7838
|
+
},
|
|
7839
|
+
checkable: Boolean,
|
|
7840
|
+
expandOnSearch: Boolean,
|
|
7841
|
+
checkOnSearch: Boolean,
|
|
7842
|
+
selectedOnSearch: Boolean,
|
|
7843
|
+
treeData: {
|
|
7844
|
+
type: Array
|
|
7845
|
+
},
|
|
7846
|
+
value: {
|
|
7847
|
+
type: [Object, Array]
|
|
7848
|
+
},
|
|
7849
|
+
title: {
|
|
7850
|
+
type: String,
|
|
7851
|
+
default: ""
|
|
7852
|
+
},
|
|
7853
|
+
toolbar: Boolean,
|
|
7854
|
+
search: Boolean
|
|
7855
|
+
};
|
|
7856
|
+
const searchProps = {
|
|
7857
|
+
title: {
|
|
7858
|
+
type: String,
|
|
7859
|
+
default: ""
|
|
7860
|
+
},
|
|
7861
|
+
toolbar: {
|
|
7862
|
+
type: Boolean,
|
|
7863
|
+
default: false
|
|
7864
|
+
},
|
|
7865
|
+
checkable: {
|
|
7866
|
+
type: Boolean,
|
|
7867
|
+
default: false
|
|
7868
|
+
},
|
|
7869
|
+
search: {
|
|
7870
|
+
type: Boolean,
|
|
7871
|
+
default: false
|
|
7872
|
+
},
|
|
7873
|
+
searchText: {
|
|
7874
|
+
type: String,
|
|
7875
|
+
default: ""
|
|
7876
|
+
},
|
|
7877
|
+
checkAll: {
|
|
7878
|
+
type: Function,
|
|
7879
|
+
default: void 0
|
|
7880
|
+
},
|
|
7881
|
+
expandAll: {
|
|
7882
|
+
type: Function,
|
|
7883
|
+
default: void 0
|
|
7884
|
+
}
|
|
7885
|
+
};
|
|
7886
|
+
var ToolbarEnum = /* @__PURE__ */ ((ToolbarEnum2) => {
|
|
7887
|
+
ToolbarEnum2[ToolbarEnum2["SELECT_ALL"] = 0] = "SELECT_ALL";
|
|
7888
|
+
ToolbarEnum2[ToolbarEnum2["UN_SELECT_ALL"] = 1] = "UN_SELECT_ALL";
|
|
7889
|
+
ToolbarEnum2[ToolbarEnum2["EXPAND_ALL"] = 2] = "EXPAND_ALL";
|
|
7890
|
+
ToolbarEnum2[ToolbarEnum2["UN_EXPAND_ALL"] = 3] = "UN_EXPAND_ALL";
|
|
7891
|
+
ToolbarEnum2[ToolbarEnum2["CHECK_STRICTLY"] = 4] = "CHECK_STRICTLY";
|
|
7892
|
+
ToolbarEnum2[ToolbarEnum2["CHECK_UN_STRICTLY"] = 5] = "CHECK_UN_STRICTLY";
|
|
7893
|
+
return ToolbarEnum2;
|
|
7894
|
+
})(ToolbarEnum || {});
|
|
7895
|
+
const _hoisted_1$i = { class: "dt-tree-header" };
|
|
7896
|
+
const _hoisted_2$a = {
|
|
7897
|
+
key: 1,
|
|
7898
|
+
class: "headerTitle"
|
|
7899
|
+
};
|
|
7900
|
+
const _hoisted_3$5 = {
|
|
7901
|
+
key: 2,
|
|
7902
|
+
class: "dt-tree-search"
|
|
7903
|
+
};
|
|
7904
|
+
const _hoisted_4$3 = {
|
|
7905
|
+
key: 0,
|
|
7906
|
+
class: "dt-tree-search-input"
|
|
7907
|
+
};
|
|
7908
|
+
const _hoisted_5$2 = /* @__PURE__ */ createElementVNode("i", { class: "i ic:baseline-more-vert" }, null, -1);
|
|
7909
|
+
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
7910
|
+
__name: "treeHeader",
|
|
7911
|
+
props: searchProps,
|
|
7912
|
+
emits: [
|
|
7913
|
+
"search",
|
|
7914
|
+
"strictly-change",
|
|
7915
|
+
"strictly-change"
|
|
7916
|
+
],
|
|
7917
|
+
setup(__props, { emit: emits }) {
|
|
7918
|
+
const props = __props;
|
|
7919
|
+
const slots = useSlots$1();
|
|
7920
|
+
const searchValue = ref("");
|
|
7921
|
+
function emitChange(value) {
|
|
7922
|
+
emits("search", value);
|
|
7923
|
+
}
|
|
7924
|
+
function handleMenuClick(e) {
|
|
7925
|
+
var _a, _b, _c, _d;
|
|
7926
|
+
const { key } = e;
|
|
7927
|
+
switch (key) {
|
|
7928
|
+
case ToolbarEnum.SELECT_ALL:
|
|
7929
|
+
(_a = props.checkAll) == null ? void 0 : _a.call(props, true);
|
|
7930
|
+
break;
|
|
7931
|
+
case ToolbarEnum.UN_SELECT_ALL:
|
|
7932
|
+
(_b = props.checkAll) == null ? void 0 : _b.call(props, false);
|
|
7933
|
+
break;
|
|
7934
|
+
case ToolbarEnum.EXPAND_ALL:
|
|
7935
|
+
(_c = props.expandAll) == null ? void 0 : _c.call(props, true);
|
|
7936
|
+
break;
|
|
7937
|
+
case ToolbarEnum.UN_EXPAND_ALL:
|
|
7938
|
+
(_d = props.expandAll) == null ? void 0 : _d.call(props, false);
|
|
7939
|
+
break;
|
|
7940
|
+
case ToolbarEnum.CHECK_STRICTLY:
|
|
7941
|
+
emits("strictly-change", false);
|
|
7942
|
+
break;
|
|
7943
|
+
case ToolbarEnum.CHECK_UN_STRICTLY:
|
|
7944
|
+
emits("strictly-change", true);
|
|
7945
|
+
break;
|
|
7946
|
+
}
|
|
7947
|
+
}
|
|
7948
|
+
const toolbarList = computed(() => {
|
|
7949
|
+
const { checkable } = props;
|
|
7950
|
+
const defaultToolbarList = [
|
|
7951
|
+
{ label: "\u5C55\u5F00\u5168\u90E8", value: ToolbarEnum.EXPAND_ALL },
|
|
7952
|
+
{
|
|
7953
|
+
label: "\u6298\u53E0\u5168\u90E8",
|
|
7954
|
+
value: ToolbarEnum.UN_EXPAND_ALL,
|
|
7955
|
+
divider: checkable
|
|
7956
|
+
}
|
|
7957
|
+
];
|
|
7958
|
+
return checkable ? [
|
|
7959
|
+
{ label: "\u9009\u62E9\u5168\u90E8", value: ToolbarEnum.SELECT_ALL },
|
|
7960
|
+
{
|
|
7961
|
+
label: "\u53D6\u6D88\u9009\u62E9",
|
|
7962
|
+
value: ToolbarEnum.UN_SELECT_ALL,
|
|
7963
|
+
divider: checkable
|
|
7964
|
+
},
|
|
7965
|
+
...defaultToolbarList,
|
|
7966
|
+
{ label: "\u5C42\u7EA7\u5173\u8054", value: ToolbarEnum.CHECK_STRICTLY },
|
|
7967
|
+
{ label: "\u5C42\u7EA7\u72EC\u7ACB", value: ToolbarEnum.CHECK_UN_STRICTLY }
|
|
7968
|
+
] : defaultToolbarList;
|
|
7969
|
+
});
|
|
7970
|
+
const debounceEmitChange = useDebounceFn(emitChange, 200);
|
|
7971
|
+
watch(() => searchValue.value, (v) => {
|
|
7972
|
+
debounceEmitChange(v);
|
|
7973
|
+
});
|
|
7974
|
+
return (_ctx, _cache) => {
|
|
7975
|
+
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
7976
|
+
unref(slots).headerTitle ? renderSlot(_ctx.$slots, "headerTitle", { key: 0 }) : createCommentVNode("", true),
|
|
7977
|
+
!unref(slots).headerTitle && _ctx.title ? (openBlock(), createElementBlock("h4", _hoisted_2$a, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
|
|
7978
|
+
_ctx.search || _ctx.toolbar ? (openBlock(), createElementBlock("div", _hoisted_3$5, [
|
|
7979
|
+
_ctx.search ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
7980
|
+
createVNode(unref(InputSearch), {
|
|
7981
|
+
size: "small",
|
|
7982
|
+
allowClear: "",
|
|
7983
|
+
value: searchValue.value,
|
|
7984
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => searchValue.value = $event),
|
|
7985
|
+
placeholder: "\u641C\u7D22"
|
|
7986
|
+
}, null, 8, ["value"])
|
|
7987
|
+
])) : createCommentVNode("", true),
|
|
7988
|
+
_ctx.toolbar ? (openBlock(), createBlock(unref(Dropdown), {
|
|
7989
|
+
key: 1,
|
|
7990
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
7991
|
+
}, ["prevent"]))
|
|
7992
|
+
}, {
|
|
7993
|
+
overlay: withCtx(() => [
|
|
7994
|
+
createVNode(unref(Menu), { onClick: handleMenuClick }, {
|
|
7995
|
+
default: withCtx(() => [
|
|
7996
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(toolbarList), (item) => {
|
|
7997
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
7998
|
+
key: item.value
|
|
7999
|
+
}, [
|
|
8000
|
+
createVNode(unref(MenuItem), normalizeProps(guardReactiveProps({ key: item.value })), {
|
|
8001
|
+
default: withCtx(() => [
|
|
8002
|
+
createTextVNode(toDisplayString(item.label), 1)
|
|
8003
|
+
]),
|
|
8004
|
+
_: 2
|
|
8005
|
+
}, 1040),
|
|
8006
|
+
item.divider ? (openBlock(), createBlock(unref(MenuDivider), { key: 0 })) : createCommentVNode("", true)
|
|
8007
|
+
], 64);
|
|
8008
|
+
}), 128))
|
|
8009
|
+
]),
|
|
8010
|
+
_: 1
|
|
8011
|
+
})
|
|
8012
|
+
]),
|
|
8013
|
+
default: withCtx(() => [
|
|
8014
|
+
_hoisted_5$2
|
|
8015
|
+
]),
|
|
8016
|
+
_: 1
|
|
8017
|
+
})) : createCommentVNode("", true)
|
|
8018
|
+
])) : createCommentVNode("", true)
|
|
8019
|
+
]);
|
|
8020
|
+
};
|
|
8021
|
+
}
|
|
8022
|
+
});
|
|
8023
|
+
function eachTree(treeDatas, callBack, parentNode = {}) {
|
|
8024
|
+
treeDatas.forEach((el) => {
|
|
8025
|
+
const newNode = callBack(el, parentNode) || el;
|
|
8026
|
+
if (el.children) {
|
|
8027
|
+
eachTree(el.children, callBack, newNode);
|
|
8028
|
+
}
|
|
8029
|
+
});
|
|
8030
|
+
}
|
|
8031
|
+
function forEach(tree, func, config = {}) {
|
|
8032
|
+
const list = [...tree];
|
|
8033
|
+
const { children = "children" } = config;
|
|
8034
|
+
for (let i = 0; i < list.length; i++) {
|
|
8035
|
+
if (func(list[i])) {
|
|
8036
|
+
return;
|
|
8037
|
+
}
|
|
8038
|
+
children && list[i][children] && list.splice(i + 1, 0, ...list[i][children]);
|
|
8039
|
+
}
|
|
8040
|
+
}
|
|
8041
|
+
function filter(tree, func, config = {}) {
|
|
8042
|
+
const children = config.children || "children";
|
|
8043
|
+
function listFilter(list) {
|
|
8044
|
+
return list.map((node) => ({ ...node })).filter((node) => {
|
|
8045
|
+
node[children] = node[children] && listFilter(node[children]);
|
|
8046
|
+
return func(node) || node[children] && node[children].length;
|
|
8047
|
+
});
|
|
8048
|
+
}
|
|
8049
|
+
return listFilter(tree);
|
|
8050
|
+
}
|
|
8051
|
+
function treeToList(tree, config = {}) {
|
|
8052
|
+
const { children = "children" } = config;
|
|
8053
|
+
const result = [...tree];
|
|
8054
|
+
for (let i = 0; i < result.length; i++) {
|
|
8055
|
+
if (!result[i][children])
|
|
8056
|
+
continue;
|
|
8057
|
+
result.splice(i + 1, 0, ...result[i][children]);
|
|
8058
|
+
}
|
|
8059
|
+
return result;
|
|
8060
|
+
}
|
|
8061
|
+
function useTree(treeDataRef, getFieldNames) {
|
|
8062
|
+
function getAllKeys(list) {
|
|
8063
|
+
const keys = [];
|
|
8064
|
+
const treeData = list || unref(treeDataRef);
|
|
8065
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8066
|
+
if (!childrenField || !keyField)
|
|
8067
|
+
return keys;
|
|
8068
|
+
for (let index = 0; index < treeData.length; index++) {
|
|
8069
|
+
const node = treeData[index];
|
|
8070
|
+
keys.push(node[keyField]);
|
|
8071
|
+
const children = node[childrenField];
|
|
8072
|
+
if (children && children.length) {
|
|
8073
|
+
keys.push(...getAllKeys(children));
|
|
8074
|
+
}
|
|
8075
|
+
}
|
|
8076
|
+
return keys;
|
|
8077
|
+
}
|
|
8078
|
+
function getEnabledKeys(list) {
|
|
8079
|
+
const keys = [];
|
|
8080
|
+
const treeData = list || unref(treeDataRef);
|
|
8081
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8082
|
+
if (!childrenField || !keyField)
|
|
8083
|
+
return keys;
|
|
8084
|
+
for (let index = 0; index < treeData.length; index++) {
|
|
8085
|
+
const node = treeData[index];
|
|
8086
|
+
node.disabled !== true && node.selectable !== false && keys.push(node[keyField]);
|
|
8087
|
+
const children = node[childrenField];
|
|
8088
|
+
if (children && children.length) {
|
|
8089
|
+
keys.push(...getEnabledKeys(children));
|
|
8090
|
+
}
|
|
8091
|
+
}
|
|
8092
|
+
return keys;
|
|
8093
|
+
}
|
|
8094
|
+
function getChildrenKeys(nodeKey, list) {
|
|
8095
|
+
const keys = [];
|
|
8096
|
+
const treeData = list || unref(treeDataRef);
|
|
8097
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8098
|
+
if (!childrenField || !keyField)
|
|
8099
|
+
return keys;
|
|
8100
|
+
for (let index = 0; index < treeData.length; index++) {
|
|
8101
|
+
const node = treeData[index];
|
|
8102
|
+
const children = node[childrenField];
|
|
8103
|
+
if (nodeKey === node[keyField]) {
|
|
8104
|
+
keys.push(node[keyField]);
|
|
8105
|
+
if (children && children.length) {
|
|
8106
|
+
keys.push(...getAllKeys(children));
|
|
8107
|
+
}
|
|
8108
|
+
} else {
|
|
8109
|
+
if (children && children.length) {
|
|
8110
|
+
keys.push(...getChildrenKeys(nodeKey, children));
|
|
8111
|
+
}
|
|
8112
|
+
}
|
|
8113
|
+
}
|
|
8114
|
+
return keys;
|
|
8115
|
+
}
|
|
8116
|
+
function updateNodeByKey(key, node, list) {
|
|
8117
|
+
if (!key)
|
|
8118
|
+
return;
|
|
8119
|
+
const treeData = list || unref(treeDataRef);
|
|
8120
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8121
|
+
if (!childrenField || !keyField)
|
|
8122
|
+
return;
|
|
8123
|
+
for (let index = 0; index < treeData.length; index++) {
|
|
8124
|
+
const element = treeData[index];
|
|
8125
|
+
const children = element[childrenField];
|
|
8126
|
+
if (element[keyField] === key) {
|
|
8127
|
+
treeData[index] = { ...treeData[index], ...node };
|
|
8128
|
+
break;
|
|
8129
|
+
} else if (children && children.length) {
|
|
8130
|
+
updateNodeByKey(key, node, element[childrenField]);
|
|
8131
|
+
}
|
|
8132
|
+
}
|
|
8133
|
+
}
|
|
8134
|
+
function filterByLevel(level = 1, list, currentLevel = 1) {
|
|
8135
|
+
if (!level)
|
|
8136
|
+
return [];
|
|
8137
|
+
const res = [];
|
|
8138
|
+
const data = list || unref(treeDataRef) || [];
|
|
8139
|
+
for (let index = 0; index < data.length; index++) {
|
|
8140
|
+
const item = data[index];
|
|
8141
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8142
|
+
const key = keyField ? item[keyField] : "";
|
|
8143
|
+
const children = childrenField ? item[childrenField] : [];
|
|
8144
|
+
res.push(key);
|
|
8145
|
+
if (children && children.length && currentLevel < level) {
|
|
8146
|
+
currentLevel += 1;
|
|
8147
|
+
res.push(...filterByLevel(level, children, currentLevel));
|
|
8148
|
+
}
|
|
8149
|
+
}
|
|
8150
|
+
return res;
|
|
8151
|
+
}
|
|
8152
|
+
function insertNodeByKey({ parentKey = null, node, push = "push" }) {
|
|
8153
|
+
const treeData = cloneDeep(unref(treeDataRef));
|
|
8154
|
+
if (!parentKey) {
|
|
8155
|
+
treeData[push](node);
|
|
8156
|
+
treeDataRef.value = treeData;
|
|
8157
|
+
return;
|
|
8158
|
+
}
|
|
8159
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8160
|
+
if (!childrenField || !keyField)
|
|
8161
|
+
return;
|
|
8162
|
+
forEach(treeData, (treeItem) => {
|
|
8163
|
+
if (treeItem[keyField] === parentKey) {
|
|
8164
|
+
treeItem[childrenField] = treeItem[childrenField] || [];
|
|
8165
|
+
treeItem[childrenField][push](node);
|
|
8166
|
+
return true;
|
|
8167
|
+
}
|
|
8168
|
+
});
|
|
8169
|
+
treeDataRef.value = treeData;
|
|
8170
|
+
}
|
|
8171
|
+
function insertNodesByKey({ parentKey = null, list, push = "push" }) {
|
|
8172
|
+
const treeData = cloneDeep(unref(treeDataRef));
|
|
8173
|
+
if (!list || list.length < 1)
|
|
8174
|
+
return;
|
|
8175
|
+
if (!parentKey) {
|
|
8176
|
+
for (let i = 0; i < list.length; i++) {
|
|
8177
|
+
treeData[push](list[i]);
|
|
8178
|
+
}
|
|
8179
|
+
} else {
|
|
8180
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8181
|
+
if (!childrenField || !keyField)
|
|
8182
|
+
return;
|
|
8183
|
+
forEach(treeData, (treeItem) => {
|
|
8184
|
+
if (treeItem[keyField] === parentKey) {
|
|
8185
|
+
treeItem[childrenField] = treeItem[childrenField] || [];
|
|
8186
|
+
for (let i = 0; i < list.length; i++) {
|
|
8187
|
+
treeItem[childrenField][push](list[i]);
|
|
8188
|
+
}
|
|
8189
|
+
treeDataRef.value = treeData;
|
|
8190
|
+
return true;
|
|
8191
|
+
}
|
|
8192
|
+
});
|
|
8193
|
+
}
|
|
8194
|
+
}
|
|
8195
|
+
function deleteNodeByKey(key, list) {
|
|
8196
|
+
if (!key)
|
|
8197
|
+
return;
|
|
8198
|
+
const treeData = list || unref(treeDataRef);
|
|
8199
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8200
|
+
if (!childrenField || !keyField)
|
|
8201
|
+
return;
|
|
8202
|
+
for (let index = 0; index < treeData.length; index++) {
|
|
8203
|
+
const element = treeData[index];
|
|
8204
|
+
const children = element[childrenField];
|
|
8205
|
+
if (element[keyField] === key) {
|
|
8206
|
+
treeData.splice(index, 1);
|
|
8207
|
+
break;
|
|
8208
|
+
} else if (children && children.length) {
|
|
8209
|
+
deleteNodeByKey(key, element[childrenField]);
|
|
8210
|
+
}
|
|
8211
|
+
}
|
|
8212
|
+
}
|
|
8213
|
+
function getSelectedNode(key, list, selectedNode) {
|
|
8214
|
+
if (!key && key !== 0)
|
|
8215
|
+
return null;
|
|
8216
|
+
const treeData = list || unref(treeDataRef);
|
|
8217
|
+
treeData.forEach((item) => {
|
|
8218
|
+
if ((selectedNode == null ? void 0 : selectedNode.key) || (selectedNode == null ? void 0 : selectedNode.key) === 0)
|
|
8219
|
+
return selectedNode;
|
|
8220
|
+
if (item.key === key) {
|
|
8221
|
+
selectedNode = item;
|
|
8222
|
+
return;
|
|
8223
|
+
}
|
|
8224
|
+
if (item.children && item.children.length) {
|
|
8225
|
+
selectedNode = getSelectedNode(key, item.children, selectedNode);
|
|
8226
|
+
}
|
|
8227
|
+
});
|
|
8228
|
+
return selectedNode || null;
|
|
8229
|
+
}
|
|
8230
|
+
return {
|
|
8231
|
+
getAllKeys,
|
|
8232
|
+
getEnabledKeys,
|
|
8233
|
+
getChildrenKeys,
|
|
8234
|
+
updateNodeByKey,
|
|
8235
|
+
filterByLevel,
|
|
8236
|
+
insertNodeByKey,
|
|
8237
|
+
insertNodesByKey,
|
|
8238
|
+
deleteNodeByKey,
|
|
8239
|
+
getSelectedNode
|
|
8240
|
+
};
|
|
8241
|
+
}
|
|
8242
|
+
const _hoisted_1$h = {
|
|
8243
|
+
class: "dt-tree"
|
|
8244
|
+
};
|
|
8245
|
+
var _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
8246
|
+
__name: "index",
|
|
8247
|
+
props: BasicProps,
|
|
8248
|
+
emits: ["update:expandedKeys", "update:selectedKeys", "update:value", "check", "change", "clickNode", "update:searchValue"],
|
|
8249
|
+
setup(__props, {
|
|
8250
|
+
expose,
|
|
8251
|
+
emit
|
|
8252
|
+
}) {
|
|
8253
|
+
const props = __props;
|
|
8254
|
+
const attrs = useAttrs$1();
|
|
8255
|
+
const slots = useSlots$1();
|
|
8256
|
+
const {
|
|
8257
|
+
getSlot,
|
|
8258
|
+
extendSlots
|
|
8259
|
+
} = useSlots();
|
|
8260
|
+
const state = reactive({
|
|
8261
|
+
checkStrictly: props.checkStrictly,
|
|
8262
|
+
expandedKeys: props.expandedKeys || [],
|
|
8263
|
+
selectedKeys: props.selectedKeys || [],
|
|
8264
|
+
checkedKeys: props.checkedKeys || []
|
|
8265
|
+
});
|
|
8266
|
+
const searchState = reactive({
|
|
8267
|
+
startSearch: false,
|
|
8268
|
+
searchText: "",
|
|
8269
|
+
searchData: []
|
|
8270
|
+
});
|
|
8271
|
+
const treeDataRef = ref([]);
|
|
8272
|
+
const getFieldNames = computed(() => {
|
|
8273
|
+
const {
|
|
8274
|
+
fieldNames
|
|
8275
|
+
} = props;
|
|
8276
|
+
return {
|
|
8277
|
+
children: "children",
|
|
8278
|
+
title: "title",
|
|
8279
|
+
key: "key",
|
|
8280
|
+
...fieldNames
|
|
8281
|
+
};
|
|
8282
|
+
});
|
|
8283
|
+
const getTreeData = computed(() => {
|
|
8284
|
+
return searchState.startSearch ? searchState.searchData : unref(treeDataRef);
|
|
8285
|
+
});
|
|
8286
|
+
const getNotFound = computed(() => {
|
|
8287
|
+
return !getTreeData.value || getTreeData.value.length === 0;
|
|
8288
|
+
});
|
|
8289
|
+
const getIcon = (params, icon) => {
|
|
8290
|
+
if (!icon) {
|
|
8291
|
+
if (props.renderIcon && isFunction(props.renderIcon)) {
|
|
8292
|
+
return props.renderIcon(params);
|
|
8293
|
+
}
|
|
8294
|
+
}
|
|
8295
|
+
return icon;
|
|
8296
|
+
};
|
|
8297
|
+
const treeData = computed(() => {
|
|
8298
|
+
const data = cloneDeep(getTreeData.value);
|
|
8299
|
+
eachTree(data, (item, _parent) => {
|
|
8300
|
+
const searchText = searchState.searchText;
|
|
8301
|
+
const {
|
|
8302
|
+
highlight
|
|
8303
|
+
} = unref(props);
|
|
8304
|
+
const {
|
|
8305
|
+
title: titleField,
|
|
8306
|
+
key: keyField,
|
|
8307
|
+
children: childrenField
|
|
8308
|
+
} = unref(getFieldNames);
|
|
8309
|
+
const icon = getIcon(item, item.icon);
|
|
8310
|
+
const title = get(item, titleField);
|
|
8311
|
+
const searchIdx = searchText ? title.indexOf(searchText) : -1;
|
|
8312
|
+
const isHighlight = searchState.startSearch && !isEmpty(searchText) && highlight && searchIdx !== -1;
|
|
8313
|
+
const highlightStyle = `color: ${isBoolean(highlight) ? "#f50" : highlight}`;
|
|
8314
|
+
const titleDom = isHighlight ? createVNode("span", {
|
|
8315
|
+
"class": "tree-content"
|
|
8316
|
+
}, [createVNode("span", null, [title.substr(0, searchIdx)]), createVNode("span", {
|
|
8317
|
+
"style": highlightStyle
|
|
8318
|
+
}, [searchText]), createVNode("span", null, [title.substr(searchIdx + searchText.length)])]) : title;
|
|
8319
|
+
item[titleField] = createVNode("span", {
|
|
8320
|
+
"class": "tree-title",
|
|
8321
|
+
"onClick": handleClickNode.bind(null, item[keyField], item[childrenField], item)
|
|
8322
|
+
}, [(slots == null ? void 0 : slots.title) ? getSlot(slots, "title", item) : createVNode(Fragment, null, [icon && createVNode("i", {
|
|
8323
|
+
"class": `i ${icon}`
|
|
8324
|
+
}, null), titleDom, createVNode("span", {
|
|
8325
|
+
"class": "tree-action"
|
|
8326
|
+
}, [renderAction(item)])])]);
|
|
8327
|
+
});
|
|
8328
|
+
return data;
|
|
8329
|
+
});
|
|
8330
|
+
const showTitle = computed(() => {
|
|
8331
|
+
return true;
|
|
8332
|
+
});
|
|
8333
|
+
const getBindValues = computed(() => {
|
|
8334
|
+
let propsData = {
|
|
8335
|
+
blockNode: true,
|
|
8336
|
+
...attrs,
|
|
8337
|
+
...props,
|
|
8338
|
+
expandedKeys: state.expandedKeys,
|
|
8339
|
+
selectedKeys: state.selectedKeys,
|
|
8340
|
+
checkedKeys: state.checkedKeys,
|
|
8341
|
+
checkStrictly: state.checkStrictly,
|
|
8342
|
+
fieldNames: unref(getFieldNames),
|
|
8343
|
+
"onUpdate:expandedKeys": (v) => {
|
|
8344
|
+
state.expandedKeys = v;
|
|
8345
|
+
emit("update:expandedKeys", v);
|
|
8346
|
+
},
|
|
8347
|
+
"onUpdate:selectedKeys": (v) => {
|
|
8348
|
+
state.selectedKeys = v;
|
|
8349
|
+
emit("update:selectedKeys", v);
|
|
8350
|
+
},
|
|
8351
|
+
onCheck: (v, e) => {
|
|
8352
|
+
let currentValue = toRaw(state.checkedKeys);
|
|
8353
|
+
if (isArray$1(currentValue) && searchState.startSearch) {
|
|
8354
|
+
const {
|
|
8355
|
+
key
|
|
8356
|
+
} = unref(getFieldNames);
|
|
8357
|
+
currentValue = difference(currentValue, getChildrenKeys(e.node.$attrs.node[key]));
|
|
8358
|
+
if (e.checked) {
|
|
8359
|
+
currentValue.push(e.node.$attrs.node[key]);
|
|
8360
|
+
}
|
|
8361
|
+
state.checkedKeys = currentValue;
|
|
8362
|
+
} else {
|
|
8363
|
+
state.checkedKeys = v;
|
|
8364
|
+
}
|
|
8365
|
+
const rawVal = toRaw(state.checkedKeys);
|
|
8366
|
+
emit("update:value", rawVal);
|
|
8367
|
+
emit("check", rawVal, e);
|
|
8368
|
+
}
|
|
8369
|
+
};
|
|
8370
|
+
return omit(propsData, "treeData", "class");
|
|
8371
|
+
});
|
|
8372
|
+
function handleClickNode(key, children, node) {
|
|
8373
|
+
emit("clickNode", node);
|
|
8374
|
+
if (!props.clickRowToExpand || !children || children.length === 0)
|
|
8375
|
+
return;
|
|
8376
|
+
if (!state.expandedKeys.includes(key)) {
|
|
8377
|
+
setExpandedKeys([...state.expandedKeys, key]);
|
|
8378
|
+
} else {
|
|
8379
|
+
const keys = [...state.expandedKeys];
|
|
8380
|
+
const index = keys.findIndex((item) => item === key);
|
|
8381
|
+
if (index !== -1) {
|
|
8382
|
+
keys.splice(index, 1);
|
|
8383
|
+
}
|
|
8384
|
+
setExpandedKeys(keys);
|
|
8385
|
+
}
|
|
8386
|
+
}
|
|
8387
|
+
function renderAction(node) {
|
|
8388
|
+
const {
|
|
8389
|
+
actionList
|
|
8390
|
+
} = props;
|
|
8391
|
+
if (!actionList || actionList.length === 0)
|
|
8392
|
+
return;
|
|
8393
|
+
return actionList.map((item, index) => {
|
|
8394
|
+
var _a;
|
|
8395
|
+
let nodeShow = true;
|
|
8396
|
+
if (isFunction(item.show)) {
|
|
8397
|
+
nodeShow = (_a = item.show) == null ? void 0 : _a.call(item, node);
|
|
8398
|
+
} else if (isBoolean(item.show)) {
|
|
8399
|
+
nodeShow = item.show;
|
|
8400
|
+
}
|
|
8401
|
+
if (!nodeShow)
|
|
8402
|
+
return null;
|
|
8403
|
+
return createVNode("span", {
|
|
8404
|
+
"key": index,
|
|
8405
|
+
"class": "tree-action"
|
|
8406
|
+
}, [item.render(node)]);
|
|
8407
|
+
});
|
|
8408
|
+
}
|
|
8409
|
+
const {
|
|
8410
|
+
deleteNodeByKey,
|
|
8411
|
+
insertNodeByKey,
|
|
8412
|
+
insertNodesByKey,
|
|
8413
|
+
filterByLevel,
|
|
8414
|
+
updateNodeByKey,
|
|
8415
|
+
getAllKeys,
|
|
8416
|
+
getChildrenKeys,
|
|
8417
|
+
getEnabledKeys,
|
|
8418
|
+
getSelectedNode
|
|
8419
|
+
} = useTree(treeDataRef, getFieldNames);
|
|
8420
|
+
function setExpandedKeys(keys) {
|
|
8421
|
+
state.expandedKeys = keys;
|
|
8422
|
+
}
|
|
8423
|
+
function getExpandedKeys() {
|
|
8424
|
+
return state.expandedKeys;
|
|
8425
|
+
}
|
|
8426
|
+
function setSelectedKeys(keys) {
|
|
8427
|
+
state.selectedKeys = keys;
|
|
8428
|
+
}
|
|
8429
|
+
function getSelectedKeys() {
|
|
8430
|
+
return state.selectedKeys;
|
|
8431
|
+
}
|
|
8432
|
+
function setCheckedKeys(keys) {
|
|
8433
|
+
state.checkedKeys = keys;
|
|
8434
|
+
}
|
|
8435
|
+
function getCheckedKeys() {
|
|
8436
|
+
return state.checkedKeys;
|
|
8437
|
+
}
|
|
8438
|
+
function checkAll(checkAll2) {
|
|
8439
|
+
state.checkedKeys = checkAll2 ? getEnabledKeys() : [];
|
|
8440
|
+
}
|
|
8441
|
+
function expandAll(expandAll2) {
|
|
8442
|
+
state.expandedKeys = expandAll2 ? getAllKeys() : [];
|
|
8443
|
+
}
|
|
8444
|
+
function onStrictlyChange(strictly) {
|
|
8445
|
+
state.checkStrictly = strictly;
|
|
8446
|
+
}
|
|
8447
|
+
const instance = {
|
|
8448
|
+
setExpandedKeys,
|
|
8449
|
+
getExpandedKeys,
|
|
8450
|
+
setSelectedKeys,
|
|
8451
|
+
getSelectedKeys,
|
|
8452
|
+
setCheckedKeys,
|
|
8453
|
+
getCheckedKeys,
|
|
8454
|
+
insertNodeByKey,
|
|
8455
|
+
insertNodesByKey,
|
|
8456
|
+
deleteNodeByKey,
|
|
8457
|
+
updateNodeByKey,
|
|
8458
|
+
getSelectedNode,
|
|
8459
|
+
checkAll,
|
|
8460
|
+
expandAll,
|
|
8461
|
+
onStrictlyChange,
|
|
8462
|
+
filterByLevel: (level) => {
|
|
8463
|
+
state.expandedKeys = filterByLevel(level);
|
|
8464
|
+
},
|
|
8465
|
+
setSearchValue: (value) => {
|
|
8466
|
+
handleSearch(value);
|
|
8467
|
+
},
|
|
8468
|
+
getSearchValue: () => {
|
|
8469
|
+
return searchState.searchText;
|
|
8470
|
+
}
|
|
8471
|
+
};
|
|
8472
|
+
function handleSearch(searchValue) {
|
|
8473
|
+
if (searchValue !== searchState.searchText)
|
|
8474
|
+
searchState.searchText = searchValue;
|
|
8475
|
+
emit("update:searchValue", searchValue);
|
|
8476
|
+
if (!searchValue) {
|
|
8477
|
+
searchState.startSearch = false;
|
|
8478
|
+
return;
|
|
8479
|
+
}
|
|
8480
|
+
const {
|
|
8481
|
+
filterFn,
|
|
8482
|
+
checkable,
|
|
8483
|
+
expandOnSearch,
|
|
8484
|
+
checkOnSearch,
|
|
8485
|
+
selectedOnSearch
|
|
8486
|
+
} = unref(props);
|
|
8487
|
+
const {
|
|
8488
|
+
title: titleField,
|
|
8489
|
+
key: keyField
|
|
8490
|
+
} = unref(getFieldNames);
|
|
8491
|
+
const matchedKeys = [];
|
|
8492
|
+
searchState.startSearch = true;
|
|
8493
|
+
searchState.searchData = filter(unref(treeDataRef), (node) => {
|
|
8494
|
+
var _a, _b;
|
|
8495
|
+
const result = filterFn ? filterFn(searchValue, node, unref(getFieldNames)) : (_b = (_a = node[titleField]) == null ? void 0 : _a.includes(searchValue)) != null ? _b : false;
|
|
8496
|
+
if (result) {
|
|
8497
|
+
matchedKeys.push(node[keyField]);
|
|
8498
|
+
}
|
|
8499
|
+
return result;
|
|
8500
|
+
}, unref(getFieldNames));
|
|
8501
|
+
if (expandOnSearch) {
|
|
8502
|
+
const expandKeys = treeToList(searchState.searchData).map((val) => {
|
|
8503
|
+
return val[keyField];
|
|
8504
|
+
});
|
|
8505
|
+
if (expandKeys && expandKeys.length) {
|
|
8506
|
+
setExpandedKeys(expandKeys);
|
|
8507
|
+
}
|
|
8508
|
+
}
|
|
8509
|
+
if (checkOnSearch && checkable && matchedKeys.length) {
|
|
8510
|
+
setCheckedKeys(matchedKeys);
|
|
8511
|
+
}
|
|
8512
|
+
if (selectedOnSearch && matchedKeys.length) {
|
|
8513
|
+
setSelectedKeys(matchedKeys);
|
|
8514
|
+
}
|
|
8515
|
+
}
|
|
8516
|
+
watch(() => props.searchValue, (val) => {
|
|
8517
|
+
if (val !== searchState.searchText) {
|
|
8518
|
+
searchState.searchText = val;
|
|
8519
|
+
}
|
|
8520
|
+
}, {
|
|
8521
|
+
immediate: true
|
|
8522
|
+
});
|
|
8523
|
+
watch(() => props.treeData, (val) => {
|
|
8524
|
+
if (val) {
|
|
8525
|
+
handleSearch(searchState.searchText);
|
|
8526
|
+
}
|
|
8527
|
+
});
|
|
8528
|
+
watch(() => props.value, () => {
|
|
8529
|
+
state.checkedKeys = toRaw(props.value || []);
|
|
8530
|
+
}, {
|
|
8531
|
+
immediate: true
|
|
8532
|
+
});
|
|
8533
|
+
watch(() => state.checkedKeys, () => {
|
|
8534
|
+
const v = toRaw(state.checkedKeys);
|
|
8535
|
+
emit("update:value", v);
|
|
8536
|
+
emit("change", v);
|
|
8537
|
+
});
|
|
8538
|
+
watchEffect(() => {
|
|
8539
|
+
treeDataRef.value = props.treeData;
|
|
8540
|
+
});
|
|
8541
|
+
watchEffect(() => {
|
|
8542
|
+
state.expandedKeys = props.expandedKeys;
|
|
8543
|
+
});
|
|
8544
|
+
watchEffect(() => {
|
|
8545
|
+
state.selectedKeys = props.selectedKeys;
|
|
8546
|
+
});
|
|
8547
|
+
watchEffect(() => {
|
|
8548
|
+
state.checkedKeys = props.checkedKeys;
|
|
8549
|
+
});
|
|
8550
|
+
watchEffect(() => {
|
|
8551
|
+
state.checkStrictly = props.checkStrictly;
|
|
8552
|
+
});
|
|
8553
|
+
expose(instance);
|
|
8554
|
+
return (_ctx, _cache) => {
|
|
8555
|
+
return openBlock(), createElementBlock("div", _hoisted_1$h, [unref(showTitle) ? (openBlock(), createBlock(_sfc_main$w, {
|
|
8556
|
+
key: 0,
|
|
8557
|
+
title: _ctx.title,
|
|
8558
|
+
toolbar: _ctx.toolbar,
|
|
8559
|
+
search: _ctx.search,
|
|
8560
|
+
checkable: _ctx.checkable,
|
|
8561
|
+
searchText: searchState.searchText,
|
|
8562
|
+
checkAll,
|
|
8563
|
+
expandAll,
|
|
8564
|
+
onSearch: handleSearch
|
|
8565
|
+
}, {
|
|
8566
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(extendSlots)(unref(slots))), 1)]),
|
|
8567
|
+
_: 1
|
|
8568
|
+
}, 8, ["title", "toolbar", "search", "checkable", "searchText"])) : createCommentVNode("", true), createVNode(unref(Spin), {
|
|
8569
|
+
spinning: _ctx.loading,
|
|
8570
|
+
tip: "\u52A0\u8F7D\u4E2D..."
|
|
8571
|
+
}, {
|
|
8572
|
+
default: withCtx(() => [withDirectives(createElementVNode("div", null, [createVNode(unref(Tree), mergeProps(unref(getBindValues), {
|
|
8573
|
+
showIcon: false,
|
|
8574
|
+
treeData: unref(treeData)
|
|
8575
|
+
}), null, 16, ["treeData"])], 512), [[vShow, !unref(getNotFound)]]), withDirectives(createVNode(unref(Empty), null, null, 512), [[vShow, unref(getNotFound)]])]),
|
|
8576
|
+
_: 1
|
|
8577
|
+
}, 8, ["spinning"])]);
|
|
8578
|
+
};
|
|
8579
|
+
}
|
|
8580
|
+
});
|
|
8581
|
+
const dtComponents = [
|
|
8582
|
+
{ name: "dt-base-router", component: DtBaseRouter },
|
|
8583
|
+
{ name: "dt-icon", component: DtIcon },
|
|
8584
|
+
{ name: "dt-pick-icon", component: _sfc_main$X },
|
|
8585
|
+
{ name: "dt-modal", component: _sfc_main$L },
|
|
8586
|
+
{ name: "dt-form", component: DtForm },
|
|
8587
|
+
{ name: "dt-upload", component: _sfc_main$y },
|
|
8588
|
+
{ name: "dt-upload-modal", component: _sfc_main$x },
|
|
8589
|
+
{ name: "dt-tree", component: _sfc_main$v }
|
|
8590
|
+
];
|
|
8591
|
+
function initComponents() {
|
|
8592
|
+
return {
|
|
8593
|
+
install(app) {
|
|
8594
|
+
dtComponents.forEach((comp) => app.component(comp.name, comp));
|
|
8595
|
+
}
|
|
8596
|
+
};
|
|
8597
|
+
}
|
|
8598
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
8599
|
+
__name: "back-top",
|
|
8600
|
+
setup(__props) {
|
|
8601
|
+
const getTarget = () => document.getElementById("dt-layout-content");
|
|
8602
|
+
const { getShowBackToTop } = useTheme();
|
|
8603
|
+
return (_ctx, _cache) => {
|
|
8604
|
+
return unref(getShowBackToTop) ? (openBlock(), createBlock(unref(BackTop), {
|
|
8605
|
+
key: 0,
|
|
8606
|
+
target: getTarget,
|
|
8607
|
+
visibilityHeight: 300
|
|
8608
|
+
})) : createCommentVNode("", true);
|
|
8609
|
+
};
|
|
8610
|
+
}
|
|
8611
|
+
});
|
|
8612
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
6774
8613
|
__name: "index",
|
|
6775
8614
|
setup(__props) {
|
|
6776
8615
|
return (_ctx, _cache) => {
|
|
@@ -6841,7 +8680,8 @@ function deleteChildrenProp(menu) {
|
|
|
6841
8680
|
return obj;
|
|
6842
8681
|
}
|
|
6843
8682
|
function getBreadCrumb(path, menus) {
|
|
6844
|
-
|
|
8683
|
+
var _a;
|
|
8684
|
+
const _menus = menus || ((_a = DtCache.getLocal(CacheKey.MENUS)) == null ? void 0 : _a.children) || [];
|
|
6845
8685
|
let routes = [];
|
|
6846
8686
|
let getParentByPath = (menu, path2 = "") => {
|
|
6847
8687
|
if (menu.children && menu.children.length) {
|
|
@@ -6860,20 +8700,21 @@ function getBreadCrumb(path, menus) {
|
|
|
6860
8700
|
});
|
|
6861
8701
|
return routes;
|
|
6862
8702
|
}
|
|
6863
|
-
function getFilterMenu(
|
|
8703
|
+
function getFilterMenu(filter2 = "", flag = false) {
|
|
8704
|
+
var _a;
|
|
6864
8705
|
let _menus = [];
|
|
6865
|
-
if (!trim(
|
|
8706
|
+
if (!trim(filter2) && !flag)
|
|
6866
8707
|
return _menus;
|
|
6867
8708
|
let getTargetMenus = (menusArr) => {
|
|
6868
8709
|
menusArr.forEach((menu) => {
|
|
6869
8710
|
if (menu.children && menu.children.length) {
|
|
6870
8711
|
getTargetMenus(menu.children);
|
|
6871
|
-
} else if (menu.label.indexOf(
|
|
8712
|
+
} else if (menu.label.indexOf(filter2) !== -1 || flag && !trim(filter2)) {
|
|
6872
8713
|
_menus.push(menu);
|
|
6873
8714
|
}
|
|
6874
8715
|
});
|
|
6875
8716
|
};
|
|
6876
|
-
getTargetMenus(DtCache.getLocal(CacheKey.MENUS));
|
|
8717
|
+
getTargetMenus((_a = DtCache.getLocal(CacheKey.MENUS)) == null ? void 0 : _a.children);
|
|
6877
8718
|
return _menus;
|
|
6878
8719
|
}
|
|
6879
8720
|
const _hoisted_1$e = { class: "dt-breadcrumb" };
|
|
@@ -7541,7 +9382,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
7541
9382
|
setup(__props) {
|
|
7542
9383
|
const menuList = ref([]);
|
|
7543
9384
|
const router = useRouter();
|
|
7544
|
-
const
|
|
9385
|
+
const filter2 = ref("");
|
|
7545
9386
|
const { getShowSearch } = useHeader();
|
|
7546
9387
|
const isUseDef = computed(() => {
|
|
7547
9388
|
return isBoolean(getShowSearch.value);
|
|
@@ -7550,16 +9391,16 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
7550
9391
|
if (e) {
|
|
7551
9392
|
filterMenu();
|
|
7552
9393
|
} else {
|
|
7553
|
-
|
|
9394
|
+
filter2.value = null;
|
|
7554
9395
|
}
|
|
7555
9396
|
}
|
|
7556
9397
|
function filterMenu() {
|
|
7557
|
-
menuList.value = getFilterMenu(
|
|
9398
|
+
menuList.value = getFilterMenu(filter2.value, true);
|
|
7558
9399
|
}
|
|
7559
9400
|
function navigation(url) {
|
|
7560
9401
|
router.push(url);
|
|
7561
9402
|
setTimeout(() => {
|
|
7562
|
-
|
|
9403
|
+
filter2.value = "";
|
|
7563
9404
|
menuList.value = [];
|
|
7564
9405
|
});
|
|
7565
9406
|
}
|
|
@@ -7586,8 +9427,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
7586
9427
|
]),
|
|
7587
9428
|
default: withCtx(() => [
|
|
7588
9429
|
createVNode(unref(InputSearch), {
|
|
7589
|
-
value:
|
|
7590
|
-
"onUpdate:value": _cache[0] || (_cache[0] = ($event) =>
|
|
9430
|
+
value: filter2.value,
|
|
9431
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => filter2.value = $event),
|
|
7591
9432
|
placeholder: "\u641C\u7D22...",
|
|
7592
9433
|
onInput: filterMenu
|
|
7593
9434
|
}, null, 8, ["value"])
|
|
@@ -7627,8 +9468,9 @@ function useSplitMenu(splitType) {
|
|
|
7627
9468
|
menusRef.value = (_a = menusMap.filter((it) => it.includesPath.includes(path))[0]) == null ? void 0 : _a.children;
|
|
7628
9469
|
}
|
|
7629
9470
|
async function getMenus2() {
|
|
9471
|
+
var _a;
|
|
7630
9472
|
if (unref(normalType)) {
|
|
7631
|
-
menusRef.value = DtCache.getLocal(CacheKey.MENUS);
|
|
9473
|
+
menusRef.value = (_a = DtCache.getLocal(CacheKey.MENUS)) == null ? void 0 : _a.children;
|
|
7632
9474
|
return;
|
|
7633
9475
|
}
|
|
7634
9476
|
if (unref(getSplitTop)) {
|
|
@@ -7641,7 +9483,8 @@ function useSplitMenu(splitType) {
|
|
|
7641
9483
|
return { menusRef };
|
|
7642
9484
|
}
|
|
7643
9485
|
async function getMenus() {
|
|
7644
|
-
|
|
9486
|
+
var _a;
|
|
9487
|
+
return (_a = DtCache.getLocal(CacheKey.MENUS)) == null ? void 0 : _a.children;
|
|
7645
9488
|
}
|
|
7646
9489
|
function getFirstMenuPath(item) {
|
|
7647
9490
|
let isFind = false, path = "";
|
|
@@ -8031,7 +9874,7 @@ var _sfc_main$b = defineComponent({
|
|
|
8031
9874
|
}), null);
|
|
8032
9875
|
}
|
|
8033
9876
|
return () => {
|
|
8034
|
-
return createVNode(Fragment, null, [renderHeader(), unref(getUseScroll) ? createVNode(_sfc_main$
|
|
9877
|
+
return createVNode(Fragment, null, [renderHeader(), unref(getUseScroll) ? createVNode(_sfc_main$V, null, {
|
|
8035
9878
|
default: () => renderMenu()
|
|
8036
9879
|
}) : renderMenu()]);
|
|
8037
9880
|
};
|
|
@@ -8366,10 +10209,10 @@ function useTabDropdown() {
|
|
|
8366
10209
|
const { path, meta } = unref(currentRoute);
|
|
8367
10210
|
const curItem = state.current;
|
|
8368
10211
|
const isCurItem = curItem ? curItem.path === path : false;
|
|
8369
|
-
const
|
|
8370
|
-
const closeLeftDisabled =
|
|
10212
|
+
const index = state.currentIndex;
|
|
10213
|
+
const closeLeftDisabled = index === 0 || !isCurItem;
|
|
8371
10214
|
const disabled = tabStore.getTabList.length === 1;
|
|
8372
|
-
const closeRightDisabled = !isCurItem ||
|
|
10215
|
+
const closeRightDisabled = !isCurItem || index === tabStore.getTabList.length - 1 && tabStore.getLastDragEndIndex >= 0;
|
|
8373
10216
|
const dropMenuList = [
|
|
8374
10217
|
{
|
|
8375
10218
|
icon: "ic:baseline-close",
|
|
@@ -8410,9 +10253,9 @@ function useTabDropdown() {
|
|
|
8410
10253
|
function handleContext(e) {
|
|
8411
10254
|
e == null ? void 0 : e.preventDefault();
|
|
8412
10255
|
const { path } = unref(currentRoute);
|
|
8413
|
-
const
|
|
10256
|
+
const index = tabStore.getTabList.findIndex((tab) => tab.path === path);
|
|
8414
10257
|
state.current = unref(currentRoute);
|
|
8415
|
-
state.currentIndex =
|
|
10258
|
+
state.currentIndex = index;
|
|
8416
10259
|
}
|
|
8417
10260
|
function handleMenuEvent(item) {
|
|
8418
10261
|
var _a;
|
|
@@ -8440,8 +10283,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
8440
10283
|
overlay: withCtx(() => [
|
|
8441
10284
|
createVNode(unref(Menu), null, {
|
|
8442
10285
|
default: withCtx(() => [
|
|
8443
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getDropMenuList), (item,
|
|
8444
|
-
return openBlock(), createElementBlock(Fragment, { key:
|
|
10286
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getDropMenuList), (item, index) => {
|
|
10287
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
8445
10288
|
createVNode(unref(MenuItem), {
|
|
8446
10289
|
onClick: ($event) => unref(handleMenuEvent)(item),
|
|
8447
10290
|
disabled: item.disabled
|
|
@@ -8455,7 +10298,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
8455
10298
|
_: 2
|
|
8456
10299
|
}, 1032, ["onClick", "disabled"]),
|
|
8457
10300
|
item.divider ? (openBlock(), createBlock(unref(MenuDivider), {
|
|
8458
|
-
key: `d-${
|
|
10301
|
+
key: `d-${index}`
|
|
8459
10302
|
})) : createCommentVNode("", true)
|
|
8460
10303
|
], 64);
|
|
8461
10304
|
}), 128))
|
|
@@ -8875,7 +10718,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8875
10718
|
}, {
|
|
8876
10719
|
default: withCtx(() => [
|
|
8877
10720
|
unref(getShowSidebar) ? (openBlock(), createBlock(_sfc_main$7, { key: 0 })) : createCommentVNode("", true),
|
|
8878
|
-
createVNode(unref(_sfc_main$
|
|
10721
|
+
createVNode(unref(_sfc_main$V), {
|
|
8879
10722
|
ref_key: "wrapperRef",
|
|
8880
10723
|
ref: wrapperRef,
|
|
8881
10724
|
class: normalizeClass({ "fixedWrap": unref(getFixed) })
|
|
@@ -8908,4 +10751,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8908
10751
|
};
|
|
8909
10752
|
}
|
|
8910
10753
|
});
|
|
8911
|
-
export { DtBaseRouter, DtForm, DtIcon, _sfc_main$
|
|
10754
|
+
export { DtBaseRouter, DtForm, DtIcon, _sfc_main$z as DtIframe, _sfc_main$L as DtModal, _sfc_main$X as DtPickIcon, DtTable, _sfc_main as DtTheme, _sfc_main$v as DtTree, _sfc_main$y as DtUpload, _sfc_main$x as DtUploadModal, FormButtons, authMounted, export2Excel, iconMounted, initComponents, initDirectives, useCurd, useForm, useModal, useModalOut, useSource, useTable };
|