@dt-frames/ui 1.0.8 → 1.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/components/curd/src/components/dialog.d.ts +1 -0
- package/es/components/forms/src/components/formIcon.d.ts +1 -1
- package/es/components/forms/src/types/form.type.d.ts +3 -3
- package/es/components/index.d.ts +3 -2
- package/es/components/modal/src/types/modal.type.d.ts +1 -1
- 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/index.d.ts +9 -5
- package/es/components/table/src/props.d.ts +1 -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 +2788 -0
- package/es/components/upload/src/props.d.ts +40 -0
- package/es/components/upload/src/upload.d.ts +1634 -0
- package/es/index.js +2035 -308
- 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 +4 -2
- package/src/components/curd/src/hooks/useCurd.tsx +1 -1
- package/src/components/forms/src/components/formItem.vue +15 -2
- 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 +3 -3
- package/src/components/index.ts +9 -3
- package/src/components/modal/src/hooks/useModal.ts +5 -3
- package/src/components/modal/src/index.vue +2 -2
- package/src/components/modal/src/types/modal.type.ts +1 -1
- package/src/components/source/src/hooks/useFetch.ts +10 -6
- package/src/components/source/src/hooks/useSource.ts +32 -11
- 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/TableRender.vue +1 -3
- 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/useDataSource.ts +0 -13
- package/src/components/table/src/hooks/useTableHeader.ts +2 -2
- package/src/components/table/src/index.vue +6 -1
- package/src/components/table/src/props.ts +1 -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, withDirectives, resolveDirective, render, normalizeProps, guardReactiveProps, createSlots, useAttrs as useAttrs$1, vShow, toRef,
|
|
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, omit, trim } from "lodash-es";
|
|
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, withDirectives, resolveDirective, render, normalizeProps, guardReactiveProps, createSlots, useAttrs as useAttrs$1, 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, cloneDeep, upperFirst, set, uniqBy, omit, 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$Y = 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$Y, [["render", _sfc_render$8]]);
|
|
25
|
+
const _sfc_main$X = 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$w = ["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$w)
|
|
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$X, [["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$v = ["onClick"];
|
|
1878
|
+
const _hoisted_2$l = ["onClick"];
|
|
1879
|
+
const _sfc_main$W = /* @__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$v);
|
|
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$u = { class: "scrollbar" };
|
|
2388
|
+
const _sfc_main$V = /* @__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$u, [
|
|
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$U = /* @__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$V, 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$T = /* @__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$U), {
|
|
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$S = 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$S, [["render", _sfc_render$6]]);
|
|
2751
|
+
const _sfc_main$R = /* @__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$W), {
|
|
2803
2804
|
onChooseIcon: _cache[2] || (_cache[2] = ($event) => chooseIcon($event))
|
|
2804
2805
|
})
|
|
2805
2806
|
]),
|
|
@@ -2834,11 +2835,11 @@ const components = {
|
|
|
2834
2835
|
Slider,
|
|
2835
2836
|
Rate,
|
|
2836
2837
|
Divider,
|
|
2837
|
-
Icon: _sfc_main$
|
|
2838
|
+
Icon: _sfc_main$R
|
|
2838
2839
|
};
|
|
2839
|
-
const componentMap = /* @__PURE__ */ new Map();
|
|
2840
|
+
const componentMap$1 = /* @__PURE__ */ new Map();
|
|
2840
2841
|
for (let item in components) {
|
|
2841
|
-
componentMap.set(item, components[item]);
|
|
2842
|
+
componentMap$1.set(item, components[item]);
|
|
2842
2843
|
}
|
|
2843
2844
|
function createPlaceholder(component) {
|
|
2844
2845
|
if (component.includes("Input") || component.includes("Complete")) {
|
|
@@ -2875,7 +2876,7 @@ function handleInputNumberValue(component, val) {
|
|
|
2875
2876
|
return val;
|
|
2876
2877
|
}
|
|
2877
2878
|
const datePickerType = ["DatePicker", "MonthPicker", "WeekPicker", "TimePicker", "RangePicker"];
|
|
2878
|
-
const BasicProps = {
|
|
2879
|
+
const BasicProps$1 = {
|
|
2879
2880
|
mode: {
|
|
2880
2881
|
type: String,
|
|
2881
2882
|
default: "search"
|
|
@@ -2942,7 +2943,7 @@ const FormItemProps = {
|
|
|
2942
2943
|
function _isSlot(s) {
|
|
2943
2944
|
return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
|
|
2944
2945
|
}
|
|
2945
|
-
var _sfc_main$
|
|
2946
|
+
var _sfc_main$Q = defineComponent({
|
|
2946
2947
|
name: "FormItem",
|
|
2947
2948
|
inheritAttrs: false,
|
|
2948
2949
|
props: FormItemProps,
|
|
@@ -3184,7 +3185,7 @@ var _sfc_main$L = defineComponent({
|
|
|
3184
3185
|
...bindValue,
|
|
3185
3186
|
...on2
|
|
3186
3187
|
};
|
|
3187
|
-
const Comp = componentMap.get(component);
|
|
3188
|
+
const Comp = componentMap$1.get(component);
|
|
3188
3189
|
if (!renderComponent) {
|
|
3189
3190
|
return createVNode(Comp, compAttr, null);
|
|
3190
3191
|
}
|
|
@@ -3248,11 +3249,13 @@ var _sfc_main$L = defineComponent({
|
|
|
3248
3249
|
return rules;
|
|
3249
3250
|
}
|
|
3250
3251
|
return () => {
|
|
3251
|
-
let
|
|
3252
|
+
let _slot3;
|
|
3252
3253
|
const {
|
|
3253
3254
|
colSlot,
|
|
3254
3255
|
renderCol,
|
|
3255
|
-
colProps
|
|
3256
|
+
colProps,
|
|
3257
|
+
component,
|
|
3258
|
+
render: render2
|
|
3256
3259
|
} = props.schema;
|
|
3257
3260
|
const {
|
|
3258
3261
|
colProps: gColProps,
|
|
@@ -3260,11 +3263,23 @@ var _sfc_main$L = defineComponent({
|
|
|
3260
3263
|
} = props.formProps;
|
|
3261
3264
|
let _colProps = colProps ? colProps : gColProps ? gColProps : mode === "search" ? appConf.ui.form.searchColspan : appConf.ui.form.dialogColspan;
|
|
3262
3265
|
const values = unref(getValues);
|
|
3266
|
+
if (!component) {
|
|
3267
|
+
let _slot2;
|
|
3268
|
+
if (!render2) {
|
|
3269
|
+
error("\u8BF7\u914D\u7F6Erender\u51FD\u6570");
|
|
3270
|
+
return;
|
|
3271
|
+
}
|
|
3272
|
+
return createVNode(Col, {
|
|
3273
|
+
"span": 24
|
|
3274
|
+
}, _isSlot(_slot2 = render2()) ? _slot2 : {
|
|
3275
|
+
default: () => [_slot2]
|
|
3276
|
+
});
|
|
3277
|
+
}
|
|
3263
3278
|
const getContent = () => {
|
|
3264
3279
|
return colSlot ? getSlot(slots, colSlot, values) : renderCol ? renderCol(values) : renderItem();
|
|
3265
3280
|
};
|
|
3266
|
-
return unref(getShow) && createVNode(Col, _colProps, _isSlot(
|
|
3267
|
-
default: () => [
|
|
3281
|
+
return unref(getShow) && createVNode(Col, _colProps, _isSlot(_slot3 = getContent()) ? _slot3 : {
|
|
3282
|
+
default: () => [_slot3]
|
|
3268
3283
|
});
|
|
3269
3284
|
};
|
|
3270
3285
|
}
|
|
@@ -3315,7 +3330,7 @@ function initDirectives() {
|
|
|
3315
3330
|
}
|
|
3316
3331
|
};
|
|
3317
3332
|
}
|
|
3318
|
-
const _sfc_main$
|
|
3333
|
+
const _sfc_main$P = defineComponent({
|
|
3319
3334
|
name: "form-buttons",
|
|
3320
3335
|
props: {
|
|
3321
3336
|
mode: {
|
|
@@ -3402,16 +3417,16 @@ const _sfc_main$K = defineComponent({
|
|
|
3402
3417
|
};
|
|
3403
3418
|
}
|
|
3404
3419
|
});
|
|
3405
|
-
const _hoisted_1$
|
|
3420
|
+
const _hoisted_1$t = {
|
|
3406
3421
|
key: 0,
|
|
3407
3422
|
className: "preIcon"
|
|
3408
3423
|
};
|
|
3409
|
-
const _hoisted_2$
|
|
3424
|
+
const _hoisted_2$k = {
|
|
3410
3425
|
key: 0,
|
|
3411
3426
|
className: "preIcon"
|
|
3412
3427
|
};
|
|
3413
|
-
const _hoisted_3$
|
|
3414
|
-
function _sfc_render$
|
|
3428
|
+
const _hoisted_3$c = { class: "text" };
|
|
3429
|
+
function _sfc_render$5(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3415
3430
|
const _component_Button = resolveComponent("Button");
|
|
3416
3431
|
const _component_DtIcon = resolveComponent("DtIcon");
|
|
3417
3432
|
const _component_FormItem = resolveComponent("FormItem");
|
|
@@ -3438,13 +3453,13 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3438
3453
|
onClick: ($event) => _ctx.handleBtnClick(button)
|
|
3439
3454
|
}, {
|
|
3440
3455
|
icon: withCtx(() => [
|
|
3441
|
-
button.preIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_1$
|
|
3456
|
+
button.preIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_1$t, null, 512)), [
|
|
3442
3457
|
[_directive_icon, button.preIcon]
|
|
3443
3458
|
]) : createCommentVNode("", true)
|
|
3444
3459
|
]),
|
|
3445
3460
|
default: withCtx(() => [
|
|
3446
3461
|
createTextVNode(" " + toDisplayString(button.name) + " ", 1),
|
|
3447
|
-
button.postIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$
|
|
3462
|
+
button.postIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$k, null, 512)), [
|
|
3448
3463
|
[_directive_icon, button.postIcon]
|
|
3449
3464
|
]) : createCommentVNode("", true)
|
|
3450
3465
|
]),
|
|
@@ -3459,7 +3474,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3459
3474
|
onClick: _ctx.toggleAdvanced
|
|
3460
3475
|
}, {
|
|
3461
3476
|
default: withCtx(() => [
|
|
3462
|
-
createElementVNode("span", _hoisted_3$
|
|
3477
|
+
createElementVNode("span", _hoisted_3$c, toDisplayString(_ctx.advancedRef ? "\u6536\u8D77" : "\u5C55\u5F00"), 1),
|
|
3463
3478
|
createElementVNode("span", {
|
|
3464
3479
|
class: normalizeClass(_ctx.getAdvanceClass)
|
|
3465
3480
|
}, [
|
|
@@ -3478,7 +3493,7 @@ function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3478
3493
|
_: 1
|
|
3479
3494
|
}, 16)) : createCommentVNode("", true);
|
|
3480
3495
|
}
|
|
3481
|
-
var FormButtons = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
3496
|
+
var FormButtons = /* @__PURE__ */ _export_sfc(_sfc_main$P, [["render", _sfc_render$5]]);
|
|
3482
3497
|
const isArray = Array.isArray;
|
|
3483
3498
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
3484
3499
|
var dayjs_min = { exports: {} };
|
|
@@ -3709,7 +3724,7 @@ function useFormValues({
|
|
|
3709
3724
|
return res;
|
|
3710
3725
|
}
|
|
3711
3726
|
function initDefault() {
|
|
3712
|
-
const schema = unref(getSchema);
|
|
3727
|
+
const schema = unref(getSchema).filter((it) => it.component);
|
|
3713
3728
|
const obj = {};
|
|
3714
3729
|
schema.forEach((item) => {
|
|
3715
3730
|
const { props = {}, name, component } = item;
|
|
@@ -3737,9 +3752,9 @@ function useFormValues({
|
|
|
3737
3752
|
}
|
|
3738
3753
|
} else {
|
|
3739
3754
|
if (names.length > 1) {
|
|
3740
|
-
names.forEach((key,
|
|
3741
|
-
obj[key] = defaultValue2[
|
|
3742
|
-
formModel[key] = defaultValue2[
|
|
3755
|
+
names.forEach((key, index) => {
|
|
3756
|
+
obj[key] = defaultValue2[index];
|
|
3757
|
+
formModel[key] = defaultValue2[index];
|
|
3743
3758
|
});
|
|
3744
3759
|
} else {
|
|
3745
3760
|
obj[names[0]] = defaultValue2;
|
|
@@ -3747,7 +3762,7 @@ function useFormValues({
|
|
|
3747
3762
|
}
|
|
3748
3763
|
}
|
|
3749
3764
|
} else {
|
|
3750
|
-
names.forEach((key,
|
|
3765
|
+
names.forEach((key, index) => {
|
|
3751
3766
|
let defaultV = null;
|
|
3752
3767
|
if (component === "TreeSelect" && (mode === "multiple" || treeCheckable) || component === "Select" && mode === "multiple") {
|
|
3753
3768
|
defaultV = [];
|
|
@@ -3833,10 +3848,10 @@ function useFormEvents({
|
|
|
3833
3848
|
schemaRef.value = schemaList;
|
|
3834
3849
|
}
|
|
3835
3850
|
function _removeSchemaByName(name, schemaList) {
|
|
3836
|
-
const
|
|
3837
|
-
if (
|
|
3851
|
+
const index = schemaList.findIndex((schema) => schema.name === name);
|
|
3852
|
+
if (index !== -1) {
|
|
3838
3853
|
delete formModel[name];
|
|
3839
|
-
schemaList.splice(
|
|
3854
|
+
schemaList.splice(index, 1);
|
|
3840
3855
|
}
|
|
3841
3856
|
}
|
|
3842
3857
|
function setFormValues(values) {
|
|
@@ -3857,7 +3872,7 @@ function useFormEvents({
|
|
|
3857
3872
|
if (Array.isArray(value)) {
|
|
3858
3873
|
const arr = [];
|
|
3859
3874
|
for (const ele of value) {
|
|
3860
|
-
arr.push(ele ?
|
|
3875
|
+
arr.push(ele ? dayjs(ele) : null);
|
|
3861
3876
|
}
|
|
3862
3877
|
formModel[key] = arr;
|
|
3863
3878
|
} else {
|
|
@@ -3866,7 +3881,7 @@ function useFormEvents({
|
|
|
3866
3881
|
if (typeof props === "function") {
|
|
3867
3882
|
_props = props({ formModel });
|
|
3868
3883
|
}
|
|
3869
|
-
formModel[key] = value ? (_props == null ? void 0 : _props.valueFormat) ? value :
|
|
3884
|
+
formModel[key] = value ? (_props == null ? void 0 : _props.valueFormat) ? value : dayjs(value) : null;
|
|
3870
3885
|
}
|
|
3871
3886
|
} else {
|
|
3872
3887
|
formModel[key] = value;
|
|
@@ -3879,14 +3894,14 @@ function useFormEvents({
|
|
|
3879
3894
|
}
|
|
3880
3895
|
function appendFormItems(schema, prefixName, first = false) {
|
|
3881
3896
|
const schemaList = cloneDeep(unref(getSchema));
|
|
3882
|
-
const
|
|
3883
|
-
if (!prefixName ||
|
|
3897
|
+
const index = schemaList.findIndex((schema2) => schema2.name === prefixName);
|
|
3898
|
+
if (!prefixName || index === -1 || first) {
|
|
3884
3899
|
first ? schemaList.unshift(schema) : schemaList.push(schema);
|
|
3885
3900
|
schemaRef.value = schemaList;
|
|
3886
3901
|
return;
|
|
3887
3902
|
}
|
|
3888
|
-
if (
|
|
3889
|
-
schemaList.splice(
|
|
3903
|
+
if (index !== -1) {
|
|
3904
|
+
schemaList.splice(index + 1, 0, schema);
|
|
3890
3905
|
}
|
|
3891
3906
|
schemaRef.value = schemaList;
|
|
3892
3907
|
}
|
|
@@ -3928,8 +3943,8 @@ function useFormActions(opt) {
|
|
|
3928
3943
|
function handleAdvanced(isAdvanced) {
|
|
3929
3944
|
var _a;
|
|
3930
3945
|
const { schemas, minShowColumn = ((_a = appConf.ui.form) == null ? void 0 : _a.minShowColumn) || 2 } = unref(getProps);
|
|
3931
|
-
let schema = schemas.reduce((t, it,
|
|
3932
|
-
if (
|
|
3946
|
+
let schema = schemas.reduce((t, it, index) => {
|
|
3947
|
+
if (index > minShowColumn - 1)
|
|
3933
3948
|
it.isAdvanced = isAdvanced;
|
|
3934
3949
|
t.push(it);
|
|
3935
3950
|
return t;
|
|
@@ -3951,15 +3966,15 @@ function useFormActions(opt) {
|
|
|
3951
3966
|
}
|
|
3952
3967
|
return [handleMethod];
|
|
3953
3968
|
}
|
|
3954
|
-
const _sfc_main$
|
|
3969
|
+
const _sfc_main$O = defineComponent({
|
|
3955
3970
|
name: "dt-form",
|
|
3956
3971
|
components: {
|
|
3957
3972
|
Form,
|
|
3958
3973
|
Row,
|
|
3959
|
-
FormItem: _sfc_main$
|
|
3974
|
+
FormItem: _sfc_main$Q,
|
|
3960
3975
|
FormButtons
|
|
3961
3976
|
},
|
|
3962
|
-
props: BasicProps,
|
|
3977
|
+
props: BasicProps$1,
|
|
3963
3978
|
emits: ["register", "reset"],
|
|
3964
3979
|
setup(props, { emit, attrs }) {
|
|
3965
3980
|
const { appConf } = useAppStore();
|
|
@@ -4140,7 +4155,7 @@ const _sfc_main$J = defineComponent({
|
|
|
4140
4155
|
};
|
|
4141
4156
|
}
|
|
4142
4157
|
});
|
|
4143
|
-
function _sfc_render$
|
|
4158
|
+
function _sfc_render$4(_ctx, _cache, $props, $setup, $data, $options) {
|
|
4144
4159
|
const _component_FormItem = resolveComponent("FormItem");
|
|
4145
4160
|
const _component_FormButtons = resolveComponent("FormButtons");
|
|
4146
4161
|
const _component_Row = resolveComponent("Row");
|
|
@@ -4185,7 +4200,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
4185
4200
|
_: 3
|
|
4186
4201
|
}, 16, ["class", "model", "layout"]);
|
|
4187
4202
|
}
|
|
4188
|
-
var DtForm = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
4203
|
+
var DtForm = /* @__PURE__ */ _export_sfc(_sfc_main$O, [["render", _sfc_render$4]]);
|
|
4189
4204
|
function useForm(props) {
|
|
4190
4205
|
const formRef = ref(null);
|
|
4191
4206
|
const loadedRef = ref(false);
|
|
@@ -4258,7 +4273,7 @@ function useForm(props) {
|
|
|
4258
4273
|
};
|
|
4259
4274
|
return [registerForm, methods];
|
|
4260
4275
|
}
|
|
4261
|
-
const _sfc_main$
|
|
4276
|
+
const _sfc_main$N = /* @__PURE__ */ defineComponent({
|
|
4262
4277
|
__name: "modalFooter",
|
|
4263
4278
|
props: {
|
|
4264
4279
|
showSave: {
|
|
@@ -4297,7 +4312,7 @@ const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
|
4297
4312
|
};
|
|
4298
4313
|
}
|
|
4299
4314
|
});
|
|
4300
|
-
const _sfc_main$
|
|
4315
|
+
const _sfc_main$M = /* @__PURE__ */ defineComponent({
|
|
4301
4316
|
__name: "close-icon",
|
|
4302
4317
|
props: {
|
|
4303
4318
|
canFullscreen: { type: Boolean, default: true },
|
|
@@ -4362,7 +4377,7 @@ const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
|
4362
4377
|
};
|
|
4363
4378
|
}
|
|
4364
4379
|
});
|
|
4365
|
-
const _sfc_main$
|
|
4380
|
+
const _sfc_main$L = /* @__PURE__ */ defineComponent({
|
|
4366
4381
|
__name: "index",
|
|
4367
4382
|
props: basicProps$1,
|
|
4368
4383
|
emits: ["visible-change", "height-change", "cancel", "save", "register", "update:visible"],
|
|
@@ -4384,7 +4399,10 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4384
4399
|
}
|
|
4385
4400
|
};
|
|
4386
4401
|
const { getWrapClassName, toggleFullScreen, fullScreenRef } = useFullScreen({
|
|
4387
|
-
wrapClassName: computed(() =>
|
|
4402
|
+
wrapClassName: computed(() => {
|
|
4403
|
+
var _a;
|
|
4404
|
+
return (_a = unref(propsRef)) == null ? void 0 : _a.wrapClassName;
|
|
4405
|
+
}),
|
|
4388
4406
|
extHeightRef,
|
|
4389
4407
|
modalWrapperRef
|
|
4390
4408
|
});
|
|
@@ -4442,7 +4460,6 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4442
4460
|
}
|
|
4443
4461
|
function handleSave() {
|
|
4444
4462
|
emits("save");
|
|
4445
|
-
handleCancel();
|
|
4446
4463
|
}
|
|
4447
4464
|
async function handleCancel(e = null) {
|
|
4448
4465
|
var _a, _b;
|
|
@@ -4462,7 +4479,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4462
4479
|
return (_ctx, _cache) => {
|
|
4463
4480
|
return openBlock(), createBlock(unref(Modal), mergeProps(unref(getBindValue), { onCancel: handleCancel }), createSlots({
|
|
4464
4481
|
default: withCtx(() => [
|
|
4465
|
-
createVNode(_sfc_main$
|
|
4482
|
+
createVNode(_sfc_main$T, mergeProps({
|
|
4466
4483
|
useWrapper: unref(getBindValue).useWrapper,
|
|
4467
4484
|
footerOffset: _ctx.wrapperFooterOffset,
|
|
4468
4485
|
fullScreen: unref(fullScreenRef),
|
|
@@ -4489,7 +4506,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4489
4506
|
!_ctx.$slots.closeIcon ? {
|
|
4490
4507
|
name: "closeIcon",
|
|
4491
4508
|
fn: withCtx(() => [
|
|
4492
|
-
createVNode(_sfc_main$
|
|
4509
|
+
createVNode(_sfc_main$M, {
|
|
4493
4510
|
canFullscreen: unref(getBindValue).canFullscreen,
|
|
4494
4511
|
fullScreen: unref(fullScreenRef),
|
|
4495
4512
|
onCancel: handleCancel,
|
|
@@ -4506,7 +4523,7 @@ const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
|
4506
4523
|
!_ctx.$slots.footer ? {
|
|
4507
4524
|
name: "footer",
|
|
4508
4525
|
fn: withCtx(() => [
|
|
4509
|
-
createVNode(_sfc_main$
|
|
4526
|
+
createVNode(_sfc_main$N, {
|
|
4510
4527
|
showSave: unref(getBindValue).showSave,
|
|
4511
4528
|
onHandleSave: handleSave,
|
|
4512
4529
|
onHandleCancel: handleCancel
|
|
@@ -4749,14 +4766,14 @@ const TableProps = {
|
|
|
4749
4766
|
}
|
|
4750
4767
|
};
|
|
4751
4768
|
function useRows(propsRef) {
|
|
4752
|
-
function getRowClassName(record,
|
|
4769
|
+
function getRowClassName(record, index) {
|
|
4753
4770
|
const { striped, rowClassName } = unref(propsRef);
|
|
4754
4771
|
const classNames = [];
|
|
4755
4772
|
if (striped) {
|
|
4756
|
-
classNames.push(
|
|
4773
|
+
classNames.push(index % 2 === 1 ? "table-striped" : "");
|
|
4757
4774
|
}
|
|
4758
4775
|
if (rowClassName && isFunction(rowClassName)) {
|
|
4759
|
-
classNames.push(rowClassName(record,
|
|
4776
|
+
classNames.push(rowClassName(record, index));
|
|
4760
4777
|
}
|
|
4761
4778
|
return classNames.join(" ");
|
|
4762
4779
|
}
|
|
@@ -4971,7 +4988,7 @@ function useRowSelection(propsRef, emit) {
|
|
|
4971
4988
|
setSelectedRowKeys
|
|
4972
4989
|
};
|
|
4973
4990
|
}
|
|
4974
|
-
var _sfc_main$
|
|
4991
|
+
var _sfc_main$K = defineComponent({
|
|
4975
4992
|
name: "TableFormat",
|
|
4976
4993
|
props: {
|
|
4977
4994
|
column: {
|
|
@@ -4990,7 +5007,7 @@ var _sfc_main$F = defineComponent({
|
|
|
4990
5007
|
const {
|
|
4991
5008
|
column,
|
|
4992
5009
|
record,
|
|
4993
|
-
index
|
|
5010
|
+
index
|
|
4994
5011
|
} = props;
|
|
4995
5012
|
const {
|
|
4996
5013
|
render: render2,
|
|
@@ -5028,7 +5045,7 @@ var _sfc_main$F = defineComponent({
|
|
|
5028
5045
|
renderText.value = text;
|
|
5029
5046
|
}
|
|
5030
5047
|
if (isFunction(render2)) {
|
|
5031
|
-
let afterRenderData = render2(record,
|
|
5048
|
+
let afterRenderData = render2(record, index, text);
|
|
5032
5049
|
renderText.value = isVnode(afterRenderData) ? createVNode(Fragment, null, [afterRenderData]) : afterRenderData;
|
|
5033
5050
|
}
|
|
5034
5051
|
}
|
|
@@ -5043,9 +5060,239 @@ function createTableInstance(instance) {
|
|
|
5043
5060
|
function getTableInstance() {
|
|
5044
5061
|
return inject(tableKey);
|
|
5045
5062
|
}
|
|
5046
|
-
const
|
|
5047
|
-
|
|
5048
|
-
|
|
5063
|
+
const componentMap = /* @__PURE__ */ new Map();
|
|
5064
|
+
componentMap.set("Input", Input);
|
|
5065
|
+
componentMap.set("InputNumber", InputNumber);
|
|
5066
|
+
componentMap.set("Select", Select);
|
|
5067
|
+
componentMap.set("TreeSelect", TreeSelect);
|
|
5068
|
+
componentMap.set("Switch", Switch);
|
|
5069
|
+
componentMap.set("Checkbox", Checkbox);
|
|
5070
|
+
componentMap.set("DatePicker", DatePicker);
|
|
5071
|
+
componentMap.set("TimePicker", TimePicker);
|
|
5072
|
+
const CellComponent = ({
|
|
5073
|
+
component = "Input",
|
|
5074
|
+
rule = true,
|
|
5075
|
+
ruleMessage,
|
|
5076
|
+
popoverVisible,
|
|
5077
|
+
getPopupContainer: getPopupContainer2
|
|
5078
|
+
}, { attrs }) => {
|
|
5079
|
+
const Comp = componentMap.get(component);
|
|
5080
|
+
const DefaultComp = h(Comp, attrs);
|
|
5081
|
+
if (!rule)
|
|
5082
|
+
return DefaultComp;
|
|
5083
|
+
return h(Popover, {
|
|
5084
|
+
overlayClassName: "edit-cell-rule-popover",
|
|
5085
|
+
visible: !!popoverVisible,
|
|
5086
|
+
...getPopupContainer2 ? { getPopupContainer: getPopupContainer2 } : {}
|
|
5087
|
+
}, {
|
|
5088
|
+
default: () => DefaultComp,
|
|
5089
|
+
content: () => ruleMessage
|
|
5090
|
+
});
|
|
5091
|
+
};
|
|
5092
|
+
var _sfc_main$J = defineComponent({
|
|
5093
|
+
name: "EditableCell",
|
|
5094
|
+
components: {
|
|
5095
|
+
Spin,
|
|
5096
|
+
CellComponent
|
|
5097
|
+
},
|
|
5098
|
+
props: {
|
|
5099
|
+
value: {
|
|
5100
|
+
type: [String, Number, Boolean, Object],
|
|
5101
|
+
default: ""
|
|
5102
|
+
},
|
|
5103
|
+
record: {
|
|
5104
|
+
type: Object
|
|
5105
|
+
},
|
|
5106
|
+
column: {
|
|
5107
|
+
type: Object,
|
|
5108
|
+
default: () => ({})
|
|
5109
|
+
},
|
|
5110
|
+
index: Number
|
|
5111
|
+
},
|
|
5112
|
+
setup(props) {
|
|
5113
|
+
const table = getTableInstance();
|
|
5114
|
+
ref();
|
|
5115
|
+
const {
|
|
5116
|
+
editRule,
|
|
5117
|
+
align = "left"
|
|
5118
|
+
} = props.column;
|
|
5119
|
+
const ruleMessage = ref("");
|
|
5120
|
+
const ruleVisible = ref(false);
|
|
5121
|
+
const optionsRef = ref([]);
|
|
5122
|
+
const currentValueRef = ref(props.value);
|
|
5123
|
+
const getComponent = computed(() => {
|
|
5124
|
+
var _a;
|
|
5125
|
+
return ((_a = props.column) == null ? void 0 : _a.editComponent) || "Input";
|
|
5126
|
+
});
|
|
5127
|
+
const getRuleVisible = computed(() => {
|
|
5128
|
+
return unref(ruleMessage) && unref(ruleVisible);
|
|
5129
|
+
});
|
|
5130
|
+
const getWrapperClass = computed(() => {
|
|
5131
|
+
return `edit-cell-align-${align}`;
|
|
5132
|
+
});
|
|
5133
|
+
const getIsCheckComp = computed(() => {
|
|
5134
|
+
const component = unref(getComponent);
|
|
5135
|
+
return ["Checkbox", "Switch"].includes(component);
|
|
5136
|
+
});
|
|
5137
|
+
const createPlaceholderMessage = (component) => {
|
|
5138
|
+
if (component.includes("Input")) {
|
|
5139
|
+
return "\u8BF7\u8F93\u5165";
|
|
5140
|
+
}
|
|
5141
|
+
return "\u8BF7\u9009\u62E9";
|
|
5142
|
+
};
|
|
5143
|
+
const getComponentProps = computed(() => {
|
|
5144
|
+
var _a, _b, _c;
|
|
5145
|
+
const isCheckValue = unref(getIsCheckComp);
|
|
5146
|
+
const valueField = isCheckValue ? "checked" : "value";
|
|
5147
|
+
const val = unref(currentValueRef);
|
|
5148
|
+
const value = isCheckValue ? isNumber(val) && isBoolean(val) ? val : !!val : val;
|
|
5149
|
+
let compProps = (_b = (_a = props.column) == null ? void 0 : _a.editComponentProps) != null ? _b : {};
|
|
5150
|
+
const {
|
|
5151
|
+
record,
|
|
5152
|
+
column,
|
|
5153
|
+
index
|
|
5154
|
+
} = props;
|
|
5155
|
+
if (isFunction$1(compProps)) {
|
|
5156
|
+
compProps = (_c = compProps({
|
|
5157
|
+
text: val,
|
|
5158
|
+
record,
|
|
5159
|
+
column,
|
|
5160
|
+
index
|
|
5161
|
+
})) != null ? _c : {};
|
|
5162
|
+
}
|
|
5163
|
+
return {
|
|
5164
|
+
size: "small",
|
|
5165
|
+
getPopupContainer: () => document.body,
|
|
5166
|
+
placeholder: createPlaceholderMessage(unref(getComponent)),
|
|
5167
|
+
...omit(compProps, "onChange"),
|
|
5168
|
+
[valueField]: value
|
|
5169
|
+
};
|
|
5170
|
+
});
|
|
5171
|
+
async function handleChange(e) {
|
|
5172
|
+
var _a, _b;
|
|
5173
|
+
const component = unref(getComponent);
|
|
5174
|
+
if (!e) {
|
|
5175
|
+
currentValueRef.value = e;
|
|
5176
|
+
} else if (component === "Checkbox") {
|
|
5177
|
+
currentValueRef.value = e.target.checked;
|
|
5178
|
+
} else if (component === "Switch") {
|
|
5179
|
+
currentValueRef.value = e;
|
|
5180
|
+
} else if ((e == null ? void 0 : e.target) && Reflect.has(e.target, "value")) {
|
|
5181
|
+
currentValueRef.value = e.target.value;
|
|
5182
|
+
} else if (isString(e) || isBoolean(e) || isNumber(e)) {
|
|
5183
|
+
currentValueRef.value = e;
|
|
5184
|
+
}
|
|
5185
|
+
const onChange = (_a = unref(getComponentProps)) == null ? void 0 : _a.onChange;
|
|
5186
|
+
if (onChange && isFunction$1(onChange))
|
|
5187
|
+
onChange(...arguments);
|
|
5188
|
+
(_b = table.emit) == null ? void 0 : _b.call(table, "edit-change", {
|
|
5189
|
+
column: props.column,
|
|
5190
|
+
value: unref(currentValueRef),
|
|
5191
|
+
record: toRaw(props.record)
|
|
5192
|
+
});
|
|
5193
|
+
handleSubmitRule();
|
|
5194
|
+
}
|
|
5195
|
+
async function handleSubmitRule() {
|
|
5196
|
+
const {
|
|
5197
|
+
column,
|
|
5198
|
+
record
|
|
5199
|
+
} = props;
|
|
5200
|
+
const {
|
|
5201
|
+
editRule: editRule2
|
|
5202
|
+
} = column;
|
|
5203
|
+
const currentValue = unref(currentValueRef);
|
|
5204
|
+
if (editRule2) {
|
|
5205
|
+
if (isBoolean(editRule2) && !currentValue && !isNumber(currentValue)) {
|
|
5206
|
+
ruleVisible.value = true;
|
|
5207
|
+
const component = unref(getComponent);
|
|
5208
|
+
ruleMessage.value = createPlaceholderMessage(component);
|
|
5209
|
+
return false;
|
|
5210
|
+
}
|
|
5211
|
+
if (isFunction$1(editRule2)) {
|
|
5212
|
+
const res = await editRule2(currentValue, record);
|
|
5213
|
+
if (!!res) {
|
|
5214
|
+
ruleMessage.value = res;
|
|
5215
|
+
ruleVisible.value = true;
|
|
5216
|
+
return false;
|
|
5217
|
+
}
|
|
5218
|
+
}
|
|
5219
|
+
}
|
|
5220
|
+
ruleMessage.value = "";
|
|
5221
|
+
return true;
|
|
5222
|
+
}
|
|
5223
|
+
function handleOptionsChange(options) {
|
|
5224
|
+
optionsRef.value = options;
|
|
5225
|
+
}
|
|
5226
|
+
return {
|
|
5227
|
+
props,
|
|
5228
|
+
getComponentProps,
|
|
5229
|
+
getRuleVisible,
|
|
5230
|
+
editRule,
|
|
5231
|
+
ruleMessage,
|
|
5232
|
+
getWrapperClass,
|
|
5233
|
+
handleChange,
|
|
5234
|
+
handleOptionsChange
|
|
5235
|
+
};
|
|
5236
|
+
}
|
|
5237
|
+
});
|
|
5238
|
+
const _hoisted_1$s = { class: "editable-cell" };
|
|
5239
|
+
function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
5240
|
+
var _a;
|
|
5241
|
+
const _component_CellComponent = resolveComponent("CellComponent");
|
|
5242
|
+
return openBlock(), createElementBlock("div", _hoisted_1$s, [
|
|
5243
|
+
createVNode(_component_CellComponent, mergeProps({ ref: "elRef" }, _ctx.getComponentProps, {
|
|
5244
|
+
component: (_a = _ctx.column) == null ? void 0 : _a.editComponent,
|
|
5245
|
+
popoverVisible: _ctx.getRuleVisible,
|
|
5246
|
+
rule: _ctx.editRule,
|
|
5247
|
+
ruleMessage: _ctx.ruleMessage,
|
|
5248
|
+
class: _ctx.getWrapperClass,
|
|
5249
|
+
onChange: _ctx.handleChange,
|
|
5250
|
+
onOptionsChange: _ctx.handleOptionsChange
|
|
5251
|
+
}), null, 16, ["component", "popoverVisible", "rule", "ruleMessage", "class", "onChange", "onOptionsChange"])
|
|
5252
|
+
]);
|
|
5253
|
+
}
|
|
5254
|
+
var EditableCell = /* @__PURE__ */ _export_sfc(_sfc_main$J, [["render", _sfc_render$3]]);
|
|
5255
|
+
function renderEditCell(column) {
|
|
5256
|
+
return ({ text: value, record, index }) => {
|
|
5257
|
+
record.onValid = async () => {
|
|
5258
|
+
if (isArray$1(record == null ? void 0 : record.validCbs)) {
|
|
5259
|
+
const validFns = ((record == null ? void 0 : record.validCbs) || []).map((fn) => fn());
|
|
5260
|
+
const res = await Promise.all(validFns);
|
|
5261
|
+
return res.every((item) => !!item);
|
|
5262
|
+
}
|
|
5263
|
+
return false;
|
|
5264
|
+
};
|
|
5265
|
+
record.onEdit = async (edit, submit = false) => {
|
|
5266
|
+
var _a, _b;
|
|
5267
|
+
if (!submit) {
|
|
5268
|
+
record.editable = edit;
|
|
5269
|
+
}
|
|
5270
|
+
if (!edit && submit) {
|
|
5271
|
+
if (!await record.onValid())
|
|
5272
|
+
return false;
|
|
5273
|
+
const res = await ((_a = record.onSubmitEdit) == null ? void 0 : _a.call(record));
|
|
5274
|
+
if (res) {
|
|
5275
|
+
record.editable = false;
|
|
5276
|
+
return true;
|
|
5277
|
+
}
|
|
5278
|
+
return false;
|
|
5279
|
+
}
|
|
5280
|
+
if (!edit && !submit) {
|
|
5281
|
+
(_b = record.onCancelEdit) == null ? void 0 : _b.call(record);
|
|
5282
|
+
}
|
|
5283
|
+
return true;
|
|
5284
|
+
};
|
|
5285
|
+
return h(EditableCell, {
|
|
5286
|
+
value,
|
|
5287
|
+
record,
|
|
5288
|
+
column,
|
|
5289
|
+
index
|
|
5290
|
+
});
|
|
5291
|
+
};
|
|
5292
|
+
}
|
|
5293
|
+
const _hoisted_1$r = { class: "dt-table-action-btn" };
|
|
5294
|
+
const _hoisted_2$j = ["color", "onClick"];
|
|
5295
|
+
const _sfc_main$I = /* @__PURE__ */ defineComponent({
|
|
5049
5296
|
__name: "TableActions",
|
|
5050
5297
|
props: {
|
|
5051
5298
|
fixed: {
|
|
@@ -5101,7 +5348,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
5101
5348
|
return (_ctx, _cache) => {
|
|
5102
5349
|
const _directive_icon = resolveDirective("icon");
|
|
5103
5350
|
return props.expand ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(props.btns, (item) => {
|
|
5104
|
-
return openBlock(), createElementBlock("span", _hoisted_1$
|
|
5351
|
+
return openBlock(), createElementBlock("span", _hoisted_1$r, [
|
|
5105
5352
|
item.ifShow ? (openBlock(), createBlock(unref(Tooltip), {
|
|
5106
5353
|
key: 0,
|
|
5107
5354
|
placement: "bottom"
|
|
@@ -5113,7 +5360,7 @@ const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
|
5113
5360
|
withDirectives(createElementVNode("span", {
|
|
5114
5361
|
color: item.color,
|
|
5115
5362
|
onClick: ($event) => handleAction(item)
|
|
5116
|
-
}, null, 8, _hoisted_2$
|
|
5363
|
+
}, null, 8, _hoisted_2$j), [
|
|
5117
5364
|
[_directive_icon, item.icon]
|
|
5118
5365
|
])
|
|
5119
5366
|
]),
|
|
@@ -5235,15 +5482,15 @@ function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
|
5235
5482
|
width: 50,
|
|
5236
5483
|
title: "\u5E8F\u53F7",
|
|
5237
5484
|
align: "center",
|
|
5238
|
-
customRender: ({ index
|
|
5485
|
+
customRender: ({ index }) => {
|
|
5239
5486
|
const getPagination = unref(getPaginationRef);
|
|
5240
5487
|
const { appConf } = useAppStore();
|
|
5241
5488
|
const { defaultPageSize } = appConf.ui.table;
|
|
5242
5489
|
if (isBoolean(getPagination)) {
|
|
5243
|
-
return `${
|
|
5490
|
+
return `${index + 1}`;
|
|
5244
5491
|
}
|
|
5245
5492
|
const { current = 1, pageSize = defaultPageSize } = getPagination;
|
|
5246
|
-
return ((current < 1 ? 1 : current) - 1) * pageSize +
|
|
5493
|
+
return ((current < 1 ? 1 : current) - 1) * pageSize + index + 1;
|
|
5247
5494
|
},
|
|
5248
5495
|
...isFixedLeft ? {
|
|
5249
5496
|
fixed: "left"
|
|
@@ -5270,13 +5517,12 @@ function handleActionColumn(propsRef, columns) {
|
|
|
5270
5517
|
};
|
|
5271
5518
|
columns.push({
|
|
5272
5519
|
...columnObj,
|
|
5273
|
-
customRender: ({ record, index
|
|
5274
|
-
return h(_sfc_main$
|
|
5520
|
+
customRender: ({ record, index }) => {
|
|
5521
|
+
return h(_sfc_main$I, omit({
|
|
5275
5522
|
...columnObj,
|
|
5276
5523
|
record,
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
});
|
|
5524
|
+
index
|
|
5525
|
+
}, "align"));
|
|
5280
5526
|
}
|
|
5281
5527
|
});
|
|
5282
5528
|
}
|
|
@@ -5289,9 +5535,9 @@ function useColumns(propsRef, getPaginationRef) {
|
|
|
5289
5535
|
if (!columns)
|
|
5290
5536
|
return [];
|
|
5291
5537
|
const { ellipsis, resizable, minWidth = 50, maxWidth = 700 } = unref(propsRef);
|
|
5292
|
-
columns.forEach((it,
|
|
5538
|
+
columns.forEach((it, index) => {
|
|
5293
5539
|
const { slots } = it;
|
|
5294
|
-
it.width = it.width || (
|
|
5540
|
+
it.width = it.width || (index === columns.length - 1 ? 119.9 : 120);
|
|
5295
5541
|
if (Reflect.has(it, "resizable") ? !!it.resizable : resizable) {
|
|
5296
5542
|
it.resizable = true;
|
|
5297
5543
|
it.minWidth = it.minWidth || minWidth;
|
|
@@ -5306,7 +5552,12 @@ function useColumns(propsRef, getPaginationRef) {
|
|
|
5306
5552
|
const getViewColumns = computed(() => {
|
|
5307
5553
|
const viewColumns = sortFixedColumn(unref(getColumnsRef));
|
|
5308
5554
|
const columns = cloneDeep(viewColumns);
|
|
5309
|
-
return columns.filter((column) => isIfShow(column))
|
|
5555
|
+
return columns.filter((column) => isIfShow(column)).map((column) => {
|
|
5556
|
+
if (column.edit) {
|
|
5557
|
+
column.customRender = renderEditCell(column);
|
|
5558
|
+
}
|
|
5559
|
+
return column;
|
|
5560
|
+
});
|
|
5310
5561
|
});
|
|
5311
5562
|
function isIfShow(column) {
|
|
5312
5563
|
const ifShow = column.ifShow;
|
|
@@ -5381,18 +5632,18 @@ function useColumns(propsRef, getPaginationRef) {
|
|
|
5381
5632
|
getCacheColumns
|
|
5382
5633
|
};
|
|
5383
5634
|
}
|
|
5384
|
-
const _hoisted_1$
|
|
5385
|
-
const _hoisted_2$
|
|
5386
|
-
const _hoisted_3$
|
|
5387
|
-
const _hoisted_4$
|
|
5388
|
-
const _hoisted_5$
|
|
5635
|
+
const _hoisted_1$q = /* @__PURE__ */ createElementVNode("span", null, "\u5217\u63A7\u5236", -1);
|
|
5636
|
+
const _hoisted_2$i = /* @__PURE__ */ createTextVNode(" \u5217\u5C55\u793A ");
|
|
5637
|
+
const _hoisted_3$b = /* @__PURE__ */ createTextVNode(" \u5E8F\u5217\u53F7 ");
|
|
5638
|
+
const _hoisted_4$8 = /* @__PURE__ */ createTextVNode(" \u590D\u9009\u6846 ");
|
|
5639
|
+
const _hoisted_5$5 = /* @__PURE__ */ createTextVNode("\u91CD\u7F6E");
|
|
5389
5640
|
const _hoisted_6$2 = {
|
|
5390
5641
|
size: 16,
|
|
5391
5642
|
className: "drag-icon"
|
|
5392
5643
|
};
|
|
5393
5644
|
const _hoisted_7$1 = /* @__PURE__ */ createTextVNode("\u56FA\u5B9A\u5230\u5DE6\u4FA7");
|
|
5394
5645
|
const _hoisted_8$1 = /* @__PURE__ */ createTextVNode("\u56FA\u5B9A\u5230\u53F3\u4FA7");
|
|
5395
|
-
const _sfc_main$
|
|
5646
|
+
const _sfc_main$H = /* @__PURE__ */ defineComponent({
|
|
5396
5647
|
__name: "Column",
|
|
5397
5648
|
emits: [
|
|
5398
5649
|
"columns-change"
|
|
@@ -5528,9 +5779,9 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5528
5779
|
return;
|
|
5529
5780
|
const columns = getColumns();
|
|
5530
5781
|
const isFixed = item.fixed === fixed ? false : fixed;
|
|
5531
|
-
const
|
|
5532
|
-
if (
|
|
5533
|
-
columns[
|
|
5782
|
+
const index = columns.findIndex((col) => col.dataIndex === item.dataIndex);
|
|
5783
|
+
if (index !== -1) {
|
|
5784
|
+
columns[index].fixed = isFixed;
|
|
5534
5785
|
}
|
|
5535
5786
|
item.fixed = isFixed;
|
|
5536
5787
|
if (isFixed && !item.width) {
|
|
@@ -5571,7 +5822,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5571
5822
|
const _directive_icon = resolveDirective("icon");
|
|
5572
5823
|
return openBlock(), createBlock(unref(Tooltip), { placement: "top" }, {
|
|
5573
5824
|
title: withCtx(() => [
|
|
5574
|
-
_hoisted_1$
|
|
5825
|
+
_hoisted_1$q
|
|
5575
5826
|
]),
|
|
5576
5827
|
default: withCtx(() => [
|
|
5577
5828
|
createVNode(unref(Popover), {
|
|
@@ -5592,7 +5843,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5592
5843
|
onChange: onCheckAllChange
|
|
5593
5844
|
}, {
|
|
5594
5845
|
default: withCtx(() => [
|
|
5595
|
-
_hoisted_2$
|
|
5846
|
+
_hoisted_2$i
|
|
5596
5847
|
]),
|
|
5597
5848
|
_: 1
|
|
5598
5849
|
}, 8, ["indeterminate", "checked"]),
|
|
@@ -5602,7 +5853,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5602
5853
|
onChange: handleIndexCheckChange
|
|
5603
5854
|
}, {
|
|
5604
5855
|
default: withCtx(() => [
|
|
5605
|
-
_hoisted_3$
|
|
5856
|
+
_hoisted_3$b
|
|
5606
5857
|
]),
|
|
5607
5858
|
_: 1
|
|
5608
5859
|
}, 8, ["checked"]),
|
|
@@ -5613,7 +5864,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5613
5864
|
disabled: !unref(defaultRowSelection)
|
|
5614
5865
|
}, {
|
|
5615
5866
|
default: withCtx(() => [
|
|
5616
|
-
_hoisted_4$
|
|
5867
|
+
_hoisted_4$8
|
|
5617
5868
|
]),
|
|
5618
5869
|
_: 1
|
|
5619
5870
|
}, 8, ["checked", "disabled"]),
|
|
@@ -5623,7 +5874,7 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5623
5874
|
onClick: reset
|
|
5624
5875
|
}, {
|
|
5625
5876
|
default: withCtx(() => [
|
|
5626
|
-
_hoisted_5$
|
|
5877
|
+
_hoisted_5$5
|
|
5627
5878
|
]),
|
|
5628
5879
|
_: 1
|
|
5629
5880
|
})
|
|
@@ -5724,10 +5975,10 @@ const _sfc_main$D = /* @__PURE__ */ defineComponent({
|
|
|
5724
5975
|
};
|
|
5725
5976
|
}
|
|
5726
5977
|
});
|
|
5727
|
-
const _hoisted_1$
|
|
5728
|
-
const _hoisted_2$
|
|
5729
|
-
const _hoisted_3$
|
|
5730
|
-
const _sfc_main$
|
|
5978
|
+
const _hoisted_1$p = { key: 0 };
|
|
5979
|
+
const _hoisted_2$h = { key: 0 };
|
|
5980
|
+
const _hoisted_3$a = { key: 1 };
|
|
5981
|
+
const _sfc_main$G = /* @__PURE__ */ defineComponent({
|
|
5731
5982
|
__name: "Fullscreen",
|
|
5732
5983
|
setup(__props) {
|
|
5733
5984
|
const table = getTableInstance();
|
|
@@ -5750,15 +6001,15 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
5750
6001
|
const _directive_icon = resolveDirective("icon");
|
|
5751
6002
|
return openBlock(), createBlock(unref(Tooltip), { placement: "top" }, {
|
|
5752
6003
|
title: withCtx(() => [
|
|
5753
|
-
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$
|
|
6004
|
+
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$p, "\u5168\u5C4F")) : createCommentVNode("", true)
|
|
5754
6005
|
]),
|
|
5755
6006
|
default: withCtx(() => [
|
|
5756
6007
|
createElementVNode("span", {
|
|
5757
6008
|
onClick: _cache[0] || (_cache[0] = (...args) => unref(toggle) && unref(toggle)(...args))
|
|
5758
6009
|
}, [
|
|
5759
|
-
!unref(isFullscreen) ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$
|
|
6010
|
+
!unref(isFullscreen) ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$h, null, 512)), [
|
|
5760
6011
|
[_directive_icon, "ic:baseline-fullscreen"]
|
|
5761
|
-
]) : withDirectives((openBlock(), createElementBlock("span", _hoisted_3$
|
|
6012
|
+
]) : withDirectives((openBlock(), createElementBlock("span", _hoisted_3$a, null, 512)), [
|
|
5762
6013
|
[_directive_icon, "ic:baseline-fullscreen-exit"]
|
|
5763
6014
|
])
|
|
5764
6015
|
])
|
|
@@ -5768,11 +6019,11 @@ const _sfc_main$C = /* @__PURE__ */ defineComponent({
|
|
|
5768
6019
|
};
|
|
5769
6020
|
}
|
|
5770
6021
|
});
|
|
5771
|
-
const _hoisted_1$
|
|
5772
|
-
const _hoisted_2$
|
|
5773
|
-
const _hoisted_3$
|
|
5774
|
-
const _hoisted_4$
|
|
5775
|
-
const _sfc_main$
|
|
6022
|
+
const _hoisted_1$o = /* @__PURE__ */ createTextVNode("\u5BC6\u5EA6");
|
|
6023
|
+
const _hoisted_2$g = /* @__PURE__ */ createElementVNode("span", null, "\u9ED8\u8BA4", -1);
|
|
6024
|
+
const _hoisted_3$9 = /* @__PURE__ */ createElementVNode("span", null, "\u4E2D\u7B49", -1);
|
|
6025
|
+
const _hoisted_4$7 = /* @__PURE__ */ createElementVNode("span", null, "\u7D27\u51D1", -1);
|
|
6026
|
+
const _sfc_main$F = /* @__PURE__ */ defineComponent({
|
|
5776
6027
|
__name: "Size",
|
|
5777
6028
|
setup(__props) {
|
|
5778
6029
|
const table = getTableInstance();
|
|
@@ -5785,7 +6036,7 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
5785
6036
|
const _directive_icon = resolveDirective("icon");
|
|
5786
6037
|
return openBlock(), createBlock(unref(Tooltip), null, {
|
|
5787
6038
|
title: withCtx(() => [
|
|
5788
|
-
_hoisted_1$
|
|
6039
|
+
_hoisted_1$o
|
|
5789
6040
|
]),
|
|
5790
6041
|
default: withCtx(() => [
|
|
5791
6042
|
createVNode(unref(Dropdown), {
|
|
@@ -5803,19 +6054,19 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
5803
6054
|
default: withCtx(() => [
|
|
5804
6055
|
createVNode(unref(MenuItem), { key: "default" }, {
|
|
5805
6056
|
default: withCtx(() => [
|
|
5806
|
-
_hoisted_2$
|
|
6057
|
+
_hoisted_2$g
|
|
5807
6058
|
]),
|
|
5808
6059
|
_: 1
|
|
5809
6060
|
}),
|
|
5810
6061
|
createVNode(unref(MenuItem), { key: "middle" }, {
|
|
5811
6062
|
default: withCtx(() => [
|
|
5812
|
-
_hoisted_3$
|
|
6063
|
+
_hoisted_3$9
|
|
5813
6064
|
]),
|
|
5814
6065
|
_: 1
|
|
5815
6066
|
}),
|
|
5816
6067
|
createVNode(unref(MenuItem), { key: "small" }, {
|
|
5817
6068
|
default: withCtx(() => [
|
|
5818
|
-
_hoisted_4$
|
|
6069
|
+
_hoisted_4$7
|
|
5819
6070
|
]),
|
|
5820
6071
|
_: 1
|
|
5821
6072
|
})
|
|
@@ -5836,11 +6087,11 @@ const _sfc_main$B = /* @__PURE__ */ defineComponent({
|
|
|
5836
6087
|
};
|
|
5837
6088
|
}
|
|
5838
6089
|
});
|
|
5839
|
-
const _hoisted_1$
|
|
5840
|
-
const _hoisted_2$
|
|
5841
|
-
const _hoisted_3$
|
|
5842
|
-
const _hoisted_4$
|
|
5843
|
-
const _sfc_main$
|
|
6090
|
+
const _hoisted_1$n = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA", -1);
|
|
6091
|
+
const _hoisted_2$f = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA\u5F53\u524D\u9875", -1);
|
|
6092
|
+
const _hoisted_3$8 = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA\u9009\u4E2D\u5217", -1);
|
|
6093
|
+
const _hoisted_4$6 = /* @__PURE__ */ createElementVNode("span", null, "\u5BFC\u51FA\u6240\u6709\u5217", -1);
|
|
6094
|
+
const _sfc_main$E = /* @__PURE__ */ defineComponent({
|
|
5844
6095
|
__name: "Download",
|
|
5845
6096
|
setup(__props) {
|
|
5846
6097
|
const table = getTableInstance();
|
|
@@ -5858,7 +6109,7 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
5858
6109
|
const _directive_icon = resolveDirective("icon");
|
|
5859
6110
|
return openBlock(), createBlock(unref(Tooltip), { placement: "top" }, {
|
|
5860
6111
|
title: withCtx(() => [
|
|
5861
|
-
_hoisted_1$
|
|
6112
|
+
_hoisted_1$n
|
|
5862
6113
|
]),
|
|
5863
6114
|
default: withCtx(() => [
|
|
5864
6115
|
createVNode(unref(Dropdown), {
|
|
@@ -5871,19 +6122,19 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
5871
6122
|
default: withCtx(() => [
|
|
5872
6123
|
createVNode(unref(MenuItem), { key: "current" }, {
|
|
5873
6124
|
default: withCtx(() => [
|
|
5874
|
-
_hoisted_2$
|
|
6125
|
+
_hoisted_2$f
|
|
5875
6126
|
]),
|
|
5876
6127
|
_: 1
|
|
5877
6128
|
}),
|
|
5878
6129
|
createVNode(unref(MenuItem), { key: "select" }, {
|
|
5879
6130
|
default: withCtx(() => [
|
|
5880
|
-
_hoisted_3$
|
|
6131
|
+
_hoisted_3$8
|
|
5881
6132
|
]),
|
|
5882
6133
|
_: 1
|
|
5883
6134
|
}),
|
|
5884
6135
|
createVNode(unref(MenuItem), { key: "all" }, {
|
|
5885
6136
|
default: withCtx(() => [
|
|
5886
|
-
_hoisted_4$
|
|
6137
|
+
_hoisted_4$6
|
|
5887
6138
|
]),
|
|
5888
6139
|
_: 1
|
|
5889
6140
|
})
|
|
@@ -5904,13 +6155,13 @@ const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
|
5904
6155
|
};
|
|
5905
6156
|
}
|
|
5906
6157
|
});
|
|
5907
|
-
const _sfc_main$
|
|
6158
|
+
const _sfc_main$D = defineComponent({
|
|
5908
6159
|
name: "table-setting",
|
|
5909
6160
|
components: {
|
|
5910
|
-
ColumnSetting: _sfc_main$
|
|
5911
|
-
FullscreenSetting: _sfc_main$
|
|
5912
|
-
SizeSetting: _sfc_main$
|
|
5913
|
-
Download: _sfc_main$
|
|
6161
|
+
ColumnSetting: _sfc_main$H,
|
|
6162
|
+
FullscreenSetting: _sfc_main$G,
|
|
6163
|
+
SizeSetting: _sfc_main$F,
|
|
6164
|
+
Download: _sfc_main$E
|
|
5914
6165
|
},
|
|
5915
6166
|
props: {
|
|
5916
6167
|
setting: {
|
|
@@ -5953,8 +6204,8 @@ function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5953
6204
|
_ctx.getSetting.fullscreen ? (openBlock(), createBlock(_component_FullscreenSetting, { key: 3 })) : createCommentVNode("", true)
|
|
5954
6205
|
], 64);
|
|
5955
6206
|
}
|
|
5956
|
-
var TableSettinCom = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
5957
|
-
const _sfc_main$
|
|
6207
|
+
var TableSettinCom = /* @__PURE__ */ _export_sfc(_sfc_main$D, [["render", _sfc_render$2]]);
|
|
6208
|
+
const _sfc_main$C = defineComponent({
|
|
5958
6209
|
name: "table-header",
|
|
5959
6210
|
components: {
|
|
5960
6211
|
TableSettinCom,
|
|
@@ -5994,41 +6245,44 @@ const _sfc_main$y = defineComponent({
|
|
|
5994
6245
|
};
|
|
5995
6246
|
}
|
|
5996
6247
|
});
|
|
5997
|
-
const _hoisted_1$
|
|
5998
|
-
const _hoisted_2$
|
|
5999
|
-
const _hoisted_3$
|
|
6000
|
-
const _hoisted_4$
|
|
6001
|
-
|
|
6248
|
+
const _hoisted_1$m = { class: "dt-table-header" };
|
|
6249
|
+
const _hoisted_2$e = { class: "dt-table-header-actions" };
|
|
6250
|
+
const _hoisted_3$7 = { class: "dt-table-header-actions__left" };
|
|
6251
|
+
const _hoisted_4$5 = {
|
|
6252
|
+
key: 0,
|
|
6253
|
+
class: "dt-table-header-actions__right"
|
|
6254
|
+
};
|
|
6255
|
+
const _hoisted_5$4 = {
|
|
6002
6256
|
key: 0,
|
|
6003
6257
|
style: { "margin": "5px" }
|
|
6004
6258
|
};
|
|
6005
6259
|
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6006
6260
|
const _component_FormButtons = resolveComponent("FormButtons");
|
|
6007
6261
|
const _component_TableSettinCom = resolveComponent("TableSettinCom");
|
|
6008
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
6009
|
-
createElementVNode("div", _hoisted_2$
|
|
6010
|
-
createElementVNode("div", _hoisted_3$
|
|
6262
|
+
return openBlock(), createElementBlock("div", _hoisted_1$m, [
|
|
6263
|
+
createElementVNode("div", _hoisted_2$e, [
|
|
6264
|
+
createElementVNode("div", _hoisted_3$7, [
|
|
6011
6265
|
createVNode(_component_FormButtons, mergeProps(_ctx.getActionsProps, { onHandleMethod: _ctx.handleMethod }), null, 16, ["onHandleMethod"]),
|
|
6012
6266
|
renderSlot(_ctx.$slots, "toolbar")
|
|
6013
6267
|
]),
|
|
6014
|
-
|
|
6268
|
+
_ctx.tableTools ? (openBlock(), createElementBlock("div", _hoisted_4$5, [
|
|
6015
6269
|
createVNode(_component_TableSettinCom, {
|
|
6016
6270
|
setting: _ctx.tableTools,
|
|
6017
6271
|
onColumnsChange: _ctx.handleColumnChange
|
|
6018
6272
|
}, null, 8, ["setting", "onColumnsChange"])
|
|
6019
|
-
])
|
|
6273
|
+
])) : createCommentVNode("", true)
|
|
6020
6274
|
]),
|
|
6021
|
-
_ctx.$slots.headerTop ? (openBlock(), createElementBlock("div", _hoisted_5$
|
|
6275
|
+
_ctx.$slots.headerTop ? (openBlock(), createElementBlock("div", _hoisted_5$4, [
|
|
6022
6276
|
renderSlot(_ctx.$slots, "headerTop")
|
|
6023
6277
|
])) : createCommentVNode("", true)
|
|
6024
6278
|
]);
|
|
6025
6279
|
}
|
|
6026
|
-
var TableHeader = /* @__PURE__ */ _export_sfc(_sfc_main$
|
|
6280
|
+
var TableHeader = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["render", _sfc_render$1]]);
|
|
6027
6281
|
function useTableHeader(propsRef, slots, handlers) {
|
|
6028
6282
|
const getHeaderProps = computed(() => {
|
|
6029
|
-
const { tableSetting, toolbar } = unref(propsRef);
|
|
6283
|
+
const { tableSetting, toolbar = [] } = unref(propsRef);
|
|
6030
6284
|
const { getSlot } = useSlots();
|
|
6031
|
-
const hideTitle = !slots.toolbar && !slots.headerTop && !tableSetting;
|
|
6285
|
+
const hideTitle = !toolbar.length && !slots.toolbar && !slots.headerTop && !tableSetting;
|
|
6032
6286
|
return {
|
|
6033
6287
|
title: hideTitle ? null : () => h(TableHeader, {
|
|
6034
6288
|
tableTools: tableSetting,
|
|
@@ -6203,17 +6457,21 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
6203
6457
|
filterSource
|
|
6204
6458
|
};
|
|
6205
6459
|
}
|
|
6206
|
-
const _sfc_main$
|
|
6460
|
+
const _sfc_main$B = defineComponent({
|
|
6207
6461
|
name: "dt-table",
|
|
6208
6462
|
props: TableProps,
|
|
6209
6463
|
components: {
|
|
6210
6464
|
Table,
|
|
6211
|
-
TableRender: _sfc_main$
|
|
6465
|
+
TableRender: _sfc_main$K
|
|
6212
6466
|
},
|
|
6213
6467
|
emits: [
|
|
6214
6468
|
"register",
|
|
6215
6469
|
"columns-change",
|
|
6216
|
-
"selection-change"
|
|
6470
|
+
"selection-change",
|
|
6471
|
+
"row-click",
|
|
6472
|
+
"row-dbClick",
|
|
6473
|
+
"expanded-rows-change",
|
|
6474
|
+
"edit-change"
|
|
6217
6475
|
],
|
|
6218
6476
|
setup(props, { emit, attrs, slots }) {
|
|
6219
6477
|
const tableElRef = ref(null);
|
|
@@ -6253,6 +6511,7 @@ const _sfc_main$x = defineComponent({
|
|
|
6253
6511
|
getCacheColumns,
|
|
6254
6512
|
getSelectRows,
|
|
6255
6513
|
getSelectRowKeys,
|
|
6514
|
+
emit,
|
|
6256
6515
|
getSize: () => {
|
|
6257
6516
|
return unref(getBind).size;
|
|
6258
6517
|
}
|
|
@@ -6316,12 +6575,12 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6316
6575
|
onChange: _ctx.handleTableChange,
|
|
6317
6576
|
onResizeColumn: _ctx.handleResizeColumn
|
|
6318
6577
|
}), createSlots({
|
|
6319
|
-
bodyCell: withCtx(({ column, record, index
|
|
6578
|
+
bodyCell: withCtx(({ column, record, index }) => [
|
|
6320
6579
|
(column == null ? void 0 : column.render) ? (openBlock(), createBlock(_component_TableRender, {
|
|
6321
6580
|
key: 0,
|
|
6322
6581
|
column,
|
|
6323
6582
|
record,
|
|
6324
|
-
index
|
|
6583
|
+
index
|
|
6325
6584
|
}, null, 8, ["column", "record", "index"])) : createCommentVNode("", true)
|
|
6326
6585
|
]),
|
|
6327
6586
|
_: 2
|
|
@@ -6336,20 +6595,23 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
6336
6595
|
})
|
|
6337
6596
|
]), 1040, ["rowClassName", "onChange", "onResizeColumn"]);
|
|
6338
6597
|
}
|
|
6339
|
-
var
|
|
6598
|
+
var DtTable = /* @__PURE__ */ _export_sfc(_sfc_main$B, [["render", _sfc_render]]);
|
|
6340
6599
|
function useFetch(api, baseUrl = "") {
|
|
6341
|
-
function fetch(params
|
|
6342
|
-
let type
|
|
6600
|
+
function fetch(params) {
|
|
6601
|
+
let type, header = {}, model = {};
|
|
6343
6602
|
if (isString(api)) {
|
|
6344
|
-
|
|
6603
|
+
api = baseUrl + api;
|
|
6345
6604
|
} else {
|
|
6346
6605
|
type = api.type;
|
|
6347
|
-
|
|
6606
|
+
if (api.api.indexOf(baseUrl) === -1) {
|
|
6607
|
+
api.api = `${baseUrl}${api.api}`;
|
|
6608
|
+
}
|
|
6348
6609
|
header = api.header;
|
|
6349
6610
|
model = api.model;
|
|
6350
6611
|
}
|
|
6351
6612
|
return new Promise((resolve, reject) => {
|
|
6352
|
-
|
|
6613
|
+
let param = isObject(params) ? Object.assign({}, model, params) : params;
|
|
6614
|
+
http[type || "post"](api, param, {
|
|
6353
6615
|
...header,
|
|
6354
6616
|
...{ onlyData: false }
|
|
6355
6617
|
}).then((data) => {
|
|
@@ -6396,9 +6658,18 @@ function useSource(opt) {
|
|
|
6396
6658
|
const { add, deletes, update, queryById, queryPage } = api;
|
|
6397
6659
|
const { message } = useMessage();
|
|
6398
6660
|
const apiFul = {};
|
|
6661
|
+
const apiPath = {};
|
|
6399
6662
|
for (let it in api) {
|
|
6400
6663
|
loading["on" + it.slice(0, 1).toUpperCase() + it.slice(1).toLowerCase()] = ref(false);
|
|
6401
|
-
|
|
6664
|
+
if (isString(api[it])) {
|
|
6665
|
+
apiFul[it] = baseUrl + api[it];
|
|
6666
|
+
} else {
|
|
6667
|
+
apiFul[it] = {
|
|
6668
|
+
...api[it],
|
|
6669
|
+
api: baseUrl + api[it].api
|
|
6670
|
+
};
|
|
6671
|
+
}
|
|
6672
|
+
apiPath[it] = baseUrl + (isString(api[it]) ? api[it] : api[it].api);
|
|
6402
6673
|
}
|
|
6403
6674
|
const { appConf } = useAppStore();
|
|
6404
6675
|
const pagination = ref({
|
|
@@ -6415,7 +6686,7 @@ function useSource(opt) {
|
|
|
6415
6686
|
},
|
|
6416
6687
|
orderDTOs: []
|
|
6417
6688
|
});
|
|
6418
|
-
function onSearch(model) {
|
|
6689
|
+
function onSearch(model = {}) {
|
|
6419
6690
|
baseData.entityDTO = { ...model };
|
|
6420
6691
|
baseData.pageDTO.pageNo = 0;
|
|
6421
6692
|
loading.onSearch.value = true;
|
|
@@ -6428,12 +6699,20 @@ function useSource(opt) {
|
|
|
6428
6699
|
search();
|
|
6429
6700
|
}
|
|
6430
6701
|
function onTableChange(params, needSearch = true) {
|
|
6431
|
-
const { pagination: pagination2, showBtnLoading, sort
|
|
6702
|
+
const { pagination: pagination2, showBtnLoading, sort, filter: filter2 } = params;
|
|
6432
6703
|
baseData.pageDTO = {
|
|
6433
6704
|
pageNo: pagination2.current - 1,
|
|
6434
6705
|
pageSize: pagination2.pageSize
|
|
6435
6706
|
};
|
|
6436
|
-
|
|
6707
|
+
const { field, order } = sort;
|
|
6708
|
+
if (field) {
|
|
6709
|
+
baseData.orderDTOs = [{
|
|
6710
|
+
propertyName: field,
|
|
6711
|
+
dir: order === "ascend" ? "asc" : "desc"
|
|
6712
|
+
}];
|
|
6713
|
+
} else {
|
|
6714
|
+
baseData.orderDTOs = [];
|
|
6715
|
+
}
|
|
6437
6716
|
if (needSearch)
|
|
6438
6717
|
search();
|
|
6439
6718
|
}
|
|
@@ -6457,7 +6736,7 @@ function useSource(opt) {
|
|
|
6457
6736
|
}
|
|
6458
6737
|
function onAdd(model) {
|
|
6459
6738
|
const { fetch } = useFetch(add, baseUrl);
|
|
6460
|
-
fetch(model).then((rsp) => {
|
|
6739
|
+
return fetch(model).then((rsp) => {
|
|
6461
6740
|
message.success("\u65B0\u589E\u6210\u529F");
|
|
6462
6741
|
search();
|
|
6463
6742
|
});
|
|
@@ -6468,14 +6747,15 @@ function useSource(opt) {
|
|
|
6468
6747
|
}
|
|
6469
6748
|
function onUpdate(model) {
|
|
6470
6749
|
const { fetch } = useFetch(update, baseUrl);
|
|
6471
|
-
fetch(model).then((rsp) => {
|
|
6750
|
+
return fetch(model).then((rsp) => {
|
|
6472
6751
|
message.success("\u66F4\u65B0\u6570\u636E\u6210\u529F");
|
|
6473
6752
|
search();
|
|
6474
6753
|
});
|
|
6475
6754
|
}
|
|
6476
6755
|
function onDeletes(ids) {
|
|
6477
6756
|
const { fetch } = useFetch(deletes, baseUrl);
|
|
6478
|
-
fetch(ids).then((rsp) => {
|
|
6757
|
+
fetch(toRaw(ids)).then((rsp) => {
|
|
6758
|
+
message.success(`${ids.length > 1 ? "\u6279\u91CF" : ""} \u5220\u9664\u6210\u529F\uFF01`);
|
|
6479
6759
|
search();
|
|
6480
6760
|
});
|
|
6481
6761
|
}
|
|
@@ -6501,8 +6781,8 @@ function useSource(opt) {
|
|
|
6501
6781
|
onDeletes
|
|
6502
6782
|
};
|
|
6503
6783
|
return {
|
|
6504
|
-
api,
|
|
6505
|
-
|
|
6784
|
+
api: apiFul,
|
|
6785
|
+
apiPath,
|
|
6506
6786
|
form,
|
|
6507
6787
|
table,
|
|
6508
6788
|
curd,
|
|
@@ -6545,7 +6825,7 @@ const basicProps = {
|
|
|
6545
6825
|
type: Object
|
|
6546
6826
|
}
|
|
6547
6827
|
};
|
|
6548
|
-
const _sfc_main$
|
|
6828
|
+
const _sfc_main$A = /* @__PURE__ */ defineComponent({
|
|
6549
6829
|
__name: "dialog",
|
|
6550
6830
|
props: {
|
|
6551
6831
|
...basicProps,
|
|
@@ -6561,7 +6841,7 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
6561
6841
|
},
|
|
6562
6842
|
setup(__props) {
|
|
6563
6843
|
const props = __props;
|
|
6564
|
-
const [registerDialog] = useModal({
|
|
6844
|
+
const [registerDialog, { closeModal }] = useModal({
|
|
6565
6845
|
...omit(toRaw(props), [
|
|
6566
6846
|
"actions",
|
|
6567
6847
|
"curd",
|
|
@@ -6586,11 +6866,12 @@ const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
|
6586
6866
|
var _a;
|
|
6587
6867
|
if (props.curd && isFunction((_a = props.curd) == null ? void 0 : _a.onAdd)) {
|
|
6588
6868
|
let obj = Object.assign({}, props.formsVal.value || {}, getFormValues());
|
|
6589
|
-
obj.id ? props.curd.onUpdate(obj) : props.curd.onAdd(obj);
|
|
6869
|
+
let pro = obj.id ? props.curd.onUpdate(obj) : props.curd.onAdd(obj);
|
|
6870
|
+
pro.then((rsp) => closeModal());
|
|
6590
6871
|
}
|
|
6591
6872
|
}
|
|
6592
6873
|
return (_ctx, _cache) => {
|
|
6593
|
-
return openBlock(), createBlock(unref(_sfc_main$
|
|
6874
|
+
return openBlock(), createBlock(unref(_sfc_main$L), {
|
|
6594
6875
|
onRegister: unref(registerDialog),
|
|
6595
6876
|
onSave: handleSave
|
|
6596
6877
|
}, {
|
|
@@ -6615,7 +6896,7 @@ function useCurd(curdOpt) {
|
|
|
6615
6896
|
const DtCurdModal = () => {
|
|
6616
6897
|
return h(createVNode("div", {
|
|
6617
6898
|
"class": "curdModal"
|
|
6618
|
-
}, [createVNode(_sfc_main$
|
|
6899
|
+
}, [createVNode(_sfc_main$A, mergeProps(curdOpt, {
|
|
6619
6900
|
"formsVal": formsVal,
|
|
6620
6901
|
"formProps": curdOpt.formProps,
|
|
6621
6902
|
"onRegister": register
|
|
@@ -6681,9 +6962,9 @@ function useCurd(curdOpt) {
|
|
|
6681
6962
|
update
|
|
6682
6963
|
};
|
|
6683
6964
|
}
|
|
6684
|
-
const _hoisted_1$
|
|
6685
|
-
const _hoisted_2$
|
|
6686
|
-
const _sfc_main$
|
|
6965
|
+
const _hoisted_1$l = { class: "iframe-page" };
|
|
6966
|
+
const _hoisted_2$d = ["src"];
|
|
6967
|
+
const _sfc_main$z = /* @__PURE__ */ defineComponent({
|
|
6687
6968
|
__name: "index",
|
|
6688
6969
|
props: {
|
|
6689
6970
|
showLoading: {
|
|
@@ -6705,7 +6986,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
6705
6986
|
iframeWin.postMessage(props.postMsg, props.src);
|
|
6706
6987
|
}
|
|
6707
6988
|
return (_ctx, _cache) => {
|
|
6708
|
-
return openBlock(), createElementBlock("div", _hoisted_1$
|
|
6989
|
+
return openBlock(), createElementBlock("div", _hoisted_1$l, [
|
|
6709
6990
|
createVNode(unref(Spin), {
|
|
6710
6991
|
spinning: loading.value,
|
|
6711
6992
|
size: "large"
|
|
@@ -6717,7 +6998,7 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
6717
6998
|
ref_key: "frameRef",
|
|
6718
6999
|
ref: frameRef,
|
|
6719
7000
|
onLoad: _cache[0] || (_cache[0] = ($event) => afterLoaded())
|
|
6720
|
-
}, null, 40, _hoisted_2$
|
|
7001
|
+
}, null, 40, _hoisted_2$d)
|
|
6721
7002
|
]),
|
|
6722
7003
|
_: 1
|
|
6723
7004
|
}, 8, ["spinning"])
|
|
@@ -6725,98 +7006,1540 @@ const _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
|
6725
7006
|
};
|
|
6726
7007
|
}
|
|
6727
7008
|
});
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
7009
|
+
const basicUploadProps = {
|
|
7010
|
+
showTemplateDownload: {
|
|
7011
|
+
type: Boolean,
|
|
7012
|
+
default: false
|
|
7013
|
+
},
|
|
7014
|
+
templateDownload: {
|
|
7015
|
+
type: Function,
|
|
7016
|
+
default: () => {
|
|
7017
|
+
}
|
|
7018
|
+
},
|
|
7019
|
+
helpText: {
|
|
7020
|
+
type: String,
|
|
7021
|
+
default: ""
|
|
7022
|
+
},
|
|
7023
|
+
multiple: {
|
|
7024
|
+
type: Boolean,
|
|
7025
|
+
default: true
|
|
7026
|
+
},
|
|
7027
|
+
accept: {
|
|
7028
|
+
type: Array,
|
|
7029
|
+
default: () => []
|
|
7030
|
+
},
|
|
7031
|
+
maxSize: {
|
|
7032
|
+
type: Number,
|
|
7033
|
+
default: 2
|
|
7034
|
+
},
|
|
7035
|
+
maxNumber: {
|
|
7036
|
+
type: Number,
|
|
7037
|
+
default: Infinity
|
|
7038
|
+
},
|
|
7039
|
+
defaultFiles: {
|
|
7040
|
+
type: Array,
|
|
7041
|
+
default: []
|
|
6740
7042
|
}
|
|
7043
|
+
};
|
|
7044
|
+
function useHelpers(acceptRef, helpTextRef, maxNumberRef, maxSizeRef) {
|
|
7045
|
+
const getAccept = computed(() => {
|
|
7046
|
+
const accept = unref(acceptRef);
|
|
7047
|
+
if (accept && accept.length > 0) {
|
|
7048
|
+
return accept;
|
|
7049
|
+
}
|
|
7050
|
+
return [];
|
|
7051
|
+
});
|
|
7052
|
+
const getStringAccept = computed(() => {
|
|
7053
|
+
return unref(getAccept).map((item) => {
|
|
7054
|
+
if (item.indexOf("/") > 0 || item.startsWith(".")) {
|
|
7055
|
+
return item;
|
|
7056
|
+
}
|
|
7057
|
+
return `.${item}`;
|
|
7058
|
+
}).join(",");
|
|
7059
|
+
});
|
|
6741
7060
|
return {
|
|
6742
|
-
|
|
7061
|
+
getStringAccept
|
|
6743
7062
|
};
|
|
6744
7063
|
}
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
{
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
7064
|
+
var sparkMd5 = { exports: {} };
|
|
7065
|
+
(function(module, exports) {
|
|
7066
|
+
(function(factory) {
|
|
7067
|
+
{
|
|
7068
|
+
module.exports = factory();
|
|
7069
|
+
}
|
|
7070
|
+
})(function(undefined$1) {
|
|
7071
|
+
var hex_chr = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
|
|
7072
|
+
function md5cycle(x, k) {
|
|
7073
|
+
var a = x[0], b = x[1], c = x[2], d = x[3];
|
|
7074
|
+
a += (b & c | ~b & d) + k[0] - 680876936 | 0;
|
|
7075
|
+
a = (a << 7 | a >>> 25) + b | 0;
|
|
7076
|
+
d += (a & b | ~a & c) + k[1] - 389564586 | 0;
|
|
7077
|
+
d = (d << 12 | d >>> 20) + a | 0;
|
|
7078
|
+
c += (d & a | ~d & b) + k[2] + 606105819 | 0;
|
|
7079
|
+
c = (c << 17 | c >>> 15) + d | 0;
|
|
7080
|
+
b += (c & d | ~c & a) + k[3] - 1044525330 | 0;
|
|
7081
|
+
b = (b << 22 | b >>> 10) + c | 0;
|
|
7082
|
+
a += (b & c | ~b & d) + k[4] - 176418897 | 0;
|
|
7083
|
+
a = (a << 7 | a >>> 25) + b | 0;
|
|
7084
|
+
d += (a & b | ~a & c) + k[5] + 1200080426 | 0;
|
|
7085
|
+
d = (d << 12 | d >>> 20) + a | 0;
|
|
7086
|
+
c += (d & a | ~d & b) + k[6] - 1473231341 | 0;
|
|
7087
|
+
c = (c << 17 | c >>> 15) + d | 0;
|
|
7088
|
+
b += (c & d | ~c & a) + k[7] - 45705983 | 0;
|
|
7089
|
+
b = (b << 22 | b >>> 10) + c | 0;
|
|
7090
|
+
a += (b & c | ~b & d) + k[8] + 1770035416 | 0;
|
|
7091
|
+
a = (a << 7 | a >>> 25) + b | 0;
|
|
7092
|
+
d += (a & b | ~a & c) + k[9] - 1958414417 | 0;
|
|
7093
|
+
d = (d << 12 | d >>> 20) + a | 0;
|
|
7094
|
+
c += (d & a | ~d & b) + k[10] - 42063 | 0;
|
|
7095
|
+
c = (c << 17 | c >>> 15) + d | 0;
|
|
7096
|
+
b += (c & d | ~c & a) + k[11] - 1990404162 | 0;
|
|
7097
|
+
b = (b << 22 | b >>> 10) + c | 0;
|
|
7098
|
+
a += (b & c | ~b & d) + k[12] + 1804603682 | 0;
|
|
7099
|
+
a = (a << 7 | a >>> 25) + b | 0;
|
|
7100
|
+
d += (a & b | ~a & c) + k[13] - 40341101 | 0;
|
|
7101
|
+
d = (d << 12 | d >>> 20) + a | 0;
|
|
7102
|
+
c += (d & a | ~d & b) + k[14] - 1502002290 | 0;
|
|
7103
|
+
c = (c << 17 | c >>> 15) + d | 0;
|
|
7104
|
+
b += (c & d | ~c & a) + k[15] + 1236535329 | 0;
|
|
7105
|
+
b = (b << 22 | b >>> 10) + c | 0;
|
|
7106
|
+
a += (b & d | c & ~d) + k[1] - 165796510 | 0;
|
|
7107
|
+
a = (a << 5 | a >>> 27) + b | 0;
|
|
7108
|
+
d += (a & c | b & ~c) + k[6] - 1069501632 | 0;
|
|
7109
|
+
d = (d << 9 | d >>> 23) + a | 0;
|
|
7110
|
+
c += (d & b | a & ~b) + k[11] + 643717713 | 0;
|
|
7111
|
+
c = (c << 14 | c >>> 18) + d | 0;
|
|
7112
|
+
b += (c & a | d & ~a) + k[0] - 373897302 | 0;
|
|
7113
|
+
b = (b << 20 | b >>> 12) + c | 0;
|
|
7114
|
+
a += (b & d | c & ~d) + k[5] - 701558691 | 0;
|
|
7115
|
+
a = (a << 5 | a >>> 27) + b | 0;
|
|
7116
|
+
d += (a & c | b & ~c) + k[10] + 38016083 | 0;
|
|
7117
|
+
d = (d << 9 | d >>> 23) + a | 0;
|
|
7118
|
+
c += (d & b | a & ~b) + k[15] - 660478335 | 0;
|
|
7119
|
+
c = (c << 14 | c >>> 18) + d | 0;
|
|
7120
|
+
b += (c & a | d & ~a) + k[4] - 405537848 | 0;
|
|
7121
|
+
b = (b << 20 | b >>> 12) + c | 0;
|
|
7122
|
+
a += (b & d | c & ~d) + k[9] + 568446438 | 0;
|
|
7123
|
+
a = (a << 5 | a >>> 27) + b | 0;
|
|
7124
|
+
d += (a & c | b & ~c) + k[14] - 1019803690 | 0;
|
|
7125
|
+
d = (d << 9 | d >>> 23) + a | 0;
|
|
7126
|
+
c += (d & b | a & ~b) + k[3] - 187363961 | 0;
|
|
7127
|
+
c = (c << 14 | c >>> 18) + d | 0;
|
|
7128
|
+
b += (c & a | d & ~a) + k[8] + 1163531501 | 0;
|
|
7129
|
+
b = (b << 20 | b >>> 12) + c | 0;
|
|
7130
|
+
a += (b & d | c & ~d) + k[13] - 1444681467 | 0;
|
|
7131
|
+
a = (a << 5 | a >>> 27) + b | 0;
|
|
7132
|
+
d += (a & c | b & ~c) + k[2] - 51403784 | 0;
|
|
7133
|
+
d = (d << 9 | d >>> 23) + a | 0;
|
|
7134
|
+
c += (d & b | a & ~b) + k[7] + 1735328473 | 0;
|
|
7135
|
+
c = (c << 14 | c >>> 18) + d | 0;
|
|
7136
|
+
b += (c & a | d & ~a) + k[12] - 1926607734 | 0;
|
|
7137
|
+
b = (b << 20 | b >>> 12) + c | 0;
|
|
7138
|
+
a += (b ^ c ^ d) + k[5] - 378558 | 0;
|
|
7139
|
+
a = (a << 4 | a >>> 28) + b | 0;
|
|
7140
|
+
d += (a ^ b ^ c) + k[8] - 2022574463 | 0;
|
|
7141
|
+
d = (d << 11 | d >>> 21) + a | 0;
|
|
7142
|
+
c += (d ^ a ^ b) + k[11] + 1839030562 | 0;
|
|
7143
|
+
c = (c << 16 | c >>> 16) + d | 0;
|
|
7144
|
+
b += (c ^ d ^ a) + k[14] - 35309556 | 0;
|
|
7145
|
+
b = (b << 23 | b >>> 9) + c | 0;
|
|
7146
|
+
a += (b ^ c ^ d) + k[1] - 1530992060 | 0;
|
|
7147
|
+
a = (a << 4 | a >>> 28) + b | 0;
|
|
7148
|
+
d += (a ^ b ^ c) + k[4] + 1272893353 | 0;
|
|
7149
|
+
d = (d << 11 | d >>> 21) + a | 0;
|
|
7150
|
+
c += (d ^ a ^ b) + k[7] - 155497632 | 0;
|
|
7151
|
+
c = (c << 16 | c >>> 16) + d | 0;
|
|
7152
|
+
b += (c ^ d ^ a) + k[10] - 1094730640 | 0;
|
|
7153
|
+
b = (b << 23 | b >>> 9) + c | 0;
|
|
7154
|
+
a += (b ^ c ^ d) + k[13] + 681279174 | 0;
|
|
7155
|
+
a = (a << 4 | a >>> 28) + b | 0;
|
|
7156
|
+
d += (a ^ b ^ c) + k[0] - 358537222 | 0;
|
|
7157
|
+
d = (d << 11 | d >>> 21) + a | 0;
|
|
7158
|
+
c += (d ^ a ^ b) + k[3] - 722521979 | 0;
|
|
7159
|
+
c = (c << 16 | c >>> 16) + d | 0;
|
|
7160
|
+
b += (c ^ d ^ a) + k[6] + 76029189 | 0;
|
|
7161
|
+
b = (b << 23 | b >>> 9) + c | 0;
|
|
7162
|
+
a += (b ^ c ^ d) + k[9] - 640364487 | 0;
|
|
7163
|
+
a = (a << 4 | a >>> 28) + b | 0;
|
|
7164
|
+
d += (a ^ b ^ c) + k[12] - 421815835 | 0;
|
|
7165
|
+
d = (d << 11 | d >>> 21) + a | 0;
|
|
7166
|
+
c += (d ^ a ^ b) + k[15] + 530742520 | 0;
|
|
7167
|
+
c = (c << 16 | c >>> 16) + d | 0;
|
|
7168
|
+
b += (c ^ d ^ a) + k[2] - 995338651 | 0;
|
|
7169
|
+
b = (b << 23 | b >>> 9) + c | 0;
|
|
7170
|
+
a += (c ^ (b | ~d)) + k[0] - 198630844 | 0;
|
|
7171
|
+
a = (a << 6 | a >>> 26) + b | 0;
|
|
7172
|
+
d += (b ^ (a | ~c)) + k[7] + 1126891415 | 0;
|
|
7173
|
+
d = (d << 10 | d >>> 22) + a | 0;
|
|
7174
|
+
c += (a ^ (d | ~b)) + k[14] - 1416354905 | 0;
|
|
7175
|
+
c = (c << 15 | c >>> 17) + d | 0;
|
|
7176
|
+
b += (d ^ (c | ~a)) + k[5] - 57434055 | 0;
|
|
7177
|
+
b = (b << 21 | b >>> 11) + c | 0;
|
|
7178
|
+
a += (c ^ (b | ~d)) + k[12] + 1700485571 | 0;
|
|
7179
|
+
a = (a << 6 | a >>> 26) + b | 0;
|
|
7180
|
+
d += (b ^ (a | ~c)) + k[3] - 1894986606 | 0;
|
|
7181
|
+
d = (d << 10 | d >>> 22) + a | 0;
|
|
7182
|
+
c += (a ^ (d | ~b)) + k[10] - 1051523 | 0;
|
|
7183
|
+
c = (c << 15 | c >>> 17) + d | 0;
|
|
7184
|
+
b += (d ^ (c | ~a)) + k[1] - 2054922799 | 0;
|
|
7185
|
+
b = (b << 21 | b >>> 11) + c | 0;
|
|
7186
|
+
a += (c ^ (b | ~d)) + k[8] + 1873313359 | 0;
|
|
7187
|
+
a = (a << 6 | a >>> 26) + b | 0;
|
|
7188
|
+
d += (b ^ (a | ~c)) + k[15] - 30611744 | 0;
|
|
7189
|
+
d = (d << 10 | d >>> 22) + a | 0;
|
|
7190
|
+
c += (a ^ (d | ~b)) + k[6] - 1560198380 | 0;
|
|
7191
|
+
c = (c << 15 | c >>> 17) + d | 0;
|
|
7192
|
+
b += (d ^ (c | ~a)) + k[13] + 1309151649 | 0;
|
|
7193
|
+
b = (b << 21 | b >>> 11) + c | 0;
|
|
7194
|
+
a += (c ^ (b | ~d)) + k[4] - 145523070 | 0;
|
|
7195
|
+
a = (a << 6 | a >>> 26) + b | 0;
|
|
7196
|
+
d += (b ^ (a | ~c)) + k[11] - 1120210379 | 0;
|
|
7197
|
+
d = (d << 10 | d >>> 22) + a | 0;
|
|
7198
|
+
c += (a ^ (d | ~b)) + k[2] + 718787259 | 0;
|
|
7199
|
+
c = (c << 15 | c >>> 17) + d | 0;
|
|
7200
|
+
b += (d ^ (c | ~a)) + k[9] - 343485551 | 0;
|
|
7201
|
+
b = (b << 21 | b >>> 11) + c | 0;
|
|
7202
|
+
x[0] = a + x[0] | 0;
|
|
7203
|
+
x[1] = b + x[1] | 0;
|
|
7204
|
+
x[2] = c + x[2] | 0;
|
|
7205
|
+
x[3] = d + x[3] | 0;
|
|
7206
|
+
}
|
|
7207
|
+
function md5blk(s) {
|
|
7208
|
+
var md5blks = [], i;
|
|
7209
|
+
for (i = 0; i < 64; i += 4) {
|
|
7210
|
+
md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);
|
|
7211
|
+
}
|
|
7212
|
+
return md5blks;
|
|
6756
7213
|
}
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
7214
|
+
function md5blk_array(a) {
|
|
7215
|
+
var md5blks = [], i;
|
|
7216
|
+
for (i = 0; i < 64; i += 4) {
|
|
7217
|
+
md5blks[i >> 2] = a[i] + (a[i + 1] << 8) + (a[i + 2] << 16) + (a[i + 3] << 24);
|
|
7218
|
+
}
|
|
7219
|
+
return md5blks;
|
|
7220
|
+
}
|
|
7221
|
+
function md51(s) {
|
|
7222
|
+
var n = s.length, state = [1732584193, -271733879, -1732584194, 271733878], i, length, tail, tmp, lo, hi;
|
|
7223
|
+
for (i = 64; i <= n; i += 64) {
|
|
7224
|
+
md5cycle(state, md5blk(s.substring(i - 64, i)));
|
|
7225
|
+
}
|
|
7226
|
+
s = s.substring(i - 64);
|
|
7227
|
+
length = s.length;
|
|
7228
|
+
tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
7229
|
+
for (i = 0; i < length; i += 1) {
|
|
7230
|
+
tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);
|
|
7231
|
+
}
|
|
7232
|
+
tail[i >> 2] |= 128 << (i % 4 << 3);
|
|
7233
|
+
if (i > 55) {
|
|
7234
|
+
md5cycle(state, tail);
|
|
7235
|
+
for (i = 0; i < 16; i += 1) {
|
|
7236
|
+
tail[i] = 0;
|
|
7237
|
+
}
|
|
7238
|
+
}
|
|
7239
|
+
tmp = n * 8;
|
|
7240
|
+
tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
|
|
7241
|
+
lo = parseInt(tmp[2], 16);
|
|
7242
|
+
hi = parseInt(tmp[1], 16) || 0;
|
|
7243
|
+
tail[14] = lo;
|
|
7244
|
+
tail[15] = hi;
|
|
7245
|
+
md5cycle(state, tail);
|
|
7246
|
+
return state;
|
|
7247
|
+
}
|
|
7248
|
+
function md51_array(a) {
|
|
7249
|
+
var n = a.length, state = [1732584193, -271733879, -1732584194, 271733878], i, length, tail, tmp, lo, hi;
|
|
7250
|
+
for (i = 64; i <= n; i += 64) {
|
|
7251
|
+
md5cycle(state, md5blk_array(a.subarray(i - 64, i)));
|
|
7252
|
+
}
|
|
7253
|
+
a = i - 64 < n ? a.subarray(i - 64) : new Uint8Array(0);
|
|
7254
|
+
length = a.length;
|
|
7255
|
+
tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
7256
|
+
for (i = 0; i < length; i += 1) {
|
|
7257
|
+
tail[i >> 2] |= a[i] << (i % 4 << 3);
|
|
7258
|
+
}
|
|
7259
|
+
tail[i >> 2] |= 128 << (i % 4 << 3);
|
|
7260
|
+
if (i > 55) {
|
|
7261
|
+
md5cycle(state, tail);
|
|
7262
|
+
for (i = 0; i < 16; i += 1) {
|
|
7263
|
+
tail[i] = 0;
|
|
7264
|
+
}
|
|
7265
|
+
}
|
|
7266
|
+
tmp = n * 8;
|
|
7267
|
+
tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
|
|
7268
|
+
lo = parseInt(tmp[2], 16);
|
|
7269
|
+
hi = parseInt(tmp[1], 16) || 0;
|
|
7270
|
+
tail[14] = lo;
|
|
7271
|
+
tail[15] = hi;
|
|
7272
|
+
md5cycle(state, tail);
|
|
7273
|
+
return state;
|
|
7274
|
+
}
|
|
7275
|
+
function rhex(n) {
|
|
7276
|
+
var s = "", j;
|
|
7277
|
+
for (j = 0; j < 4; j += 1) {
|
|
7278
|
+
s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];
|
|
7279
|
+
}
|
|
7280
|
+
return s;
|
|
7281
|
+
}
|
|
7282
|
+
function hex(x) {
|
|
7283
|
+
var i;
|
|
7284
|
+
for (i = 0; i < x.length; i += 1) {
|
|
7285
|
+
x[i] = rhex(x[i]);
|
|
7286
|
+
}
|
|
7287
|
+
return x.join("");
|
|
7288
|
+
}
|
|
7289
|
+
if (hex(md51("hello")) !== "5d41402abc4b2a76b9719d911017c592")
|
|
7290
|
+
;
|
|
7291
|
+
if (typeof ArrayBuffer !== "undefined" && !ArrayBuffer.prototype.slice) {
|
|
7292
|
+
(function() {
|
|
7293
|
+
function clamp(val, length) {
|
|
7294
|
+
val = val | 0 || 0;
|
|
7295
|
+
if (val < 0) {
|
|
7296
|
+
return Math.max(val + length, 0);
|
|
7297
|
+
}
|
|
7298
|
+
return Math.min(val, length);
|
|
7299
|
+
}
|
|
7300
|
+
ArrayBuffer.prototype.slice = function(from, to) {
|
|
7301
|
+
var length = this.byteLength, begin = clamp(from, length), end = length, num, target, targetArray, sourceArray;
|
|
7302
|
+
if (to !== undefined$1) {
|
|
7303
|
+
end = clamp(to, length);
|
|
7304
|
+
}
|
|
7305
|
+
if (begin > end) {
|
|
7306
|
+
return new ArrayBuffer(0);
|
|
7307
|
+
}
|
|
7308
|
+
num = end - begin;
|
|
7309
|
+
target = new ArrayBuffer(num);
|
|
7310
|
+
targetArray = new Uint8Array(target);
|
|
7311
|
+
sourceArray = new Uint8Array(this, begin, num);
|
|
7312
|
+
targetArray.set(sourceArray);
|
|
7313
|
+
return target;
|
|
7314
|
+
};
|
|
7315
|
+
})();
|
|
7316
|
+
}
|
|
7317
|
+
function toUtf8(str) {
|
|
7318
|
+
if (/[\u0080-\uFFFF]/.test(str)) {
|
|
7319
|
+
str = unescape(encodeURIComponent(str));
|
|
7320
|
+
}
|
|
7321
|
+
return str;
|
|
7322
|
+
}
|
|
7323
|
+
function utf8Str2ArrayBuffer(str, returnUInt8Array) {
|
|
7324
|
+
var length = str.length, buff = new ArrayBuffer(length), arr = new Uint8Array(buff), i;
|
|
7325
|
+
for (i = 0; i < length; i += 1) {
|
|
7326
|
+
arr[i] = str.charCodeAt(i);
|
|
7327
|
+
}
|
|
7328
|
+
return returnUInt8Array ? arr : buff;
|
|
7329
|
+
}
|
|
7330
|
+
function arrayBuffer2Utf8Str(buff) {
|
|
7331
|
+
return String.fromCharCode.apply(null, new Uint8Array(buff));
|
|
7332
|
+
}
|
|
7333
|
+
function concatenateArrayBuffers(first, second, returnUInt8Array) {
|
|
7334
|
+
var result = new Uint8Array(first.byteLength + second.byteLength);
|
|
7335
|
+
result.set(new Uint8Array(first));
|
|
7336
|
+
result.set(new Uint8Array(second), first.byteLength);
|
|
7337
|
+
return returnUInt8Array ? result : result.buffer;
|
|
7338
|
+
}
|
|
7339
|
+
function hexToBinaryString(hex2) {
|
|
7340
|
+
var bytes = [], length = hex2.length, x;
|
|
7341
|
+
for (x = 0; x < length - 1; x += 2) {
|
|
7342
|
+
bytes.push(parseInt(hex2.substr(x, 2), 16));
|
|
7343
|
+
}
|
|
7344
|
+
return String.fromCharCode.apply(String, bytes);
|
|
7345
|
+
}
|
|
7346
|
+
function SparkMD5() {
|
|
7347
|
+
this.reset();
|
|
7348
|
+
}
|
|
7349
|
+
SparkMD5.prototype.append = function(str) {
|
|
7350
|
+
this.appendBinary(toUtf8(str));
|
|
7351
|
+
return this;
|
|
6770
7352
|
};
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
7353
|
+
SparkMD5.prototype.appendBinary = function(contents) {
|
|
7354
|
+
this._buff += contents;
|
|
7355
|
+
this._length += contents.length;
|
|
7356
|
+
var length = this._buff.length, i;
|
|
7357
|
+
for (i = 64; i <= length; i += 64) {
|
|
7358
|
+
md5cycle(this._hash, md5blk(this._buff.substring(i - 64, i)));
|
|
7359
|
+
}
|
|
7360
|
+
this._buff = this._buff.substring(i - 64);
|
|
7361
|
+
return this;
|
|
6778
7362
|
};
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
const { getCollapsedShowTitle } = useMenu();
|
|
6792
|
-
const getLogoClass = computed(() => {
|
|
6793
|
-
return [
|
|
6794
|
-
"dt-logo",
|
|
6795
|
-
props.theme,
|
|
6796
|
-
{ "collapsed-show-title": unref(getCollapsedShowTitle) }
|
|
6797
|
-
];
|
|
6798
|
-
});
|
|
6799
|
-
return (_ctx, _cache) => {
|
|
6800
|
-
return openBlock(), createElementBlock("div", {
|
|
6801
|
-
class: normalizeClass(["dt-logo", unref(getLogoClass)])
|
|
6802
|
-
}, [
|
|
6803
|
-
createVNode(unref(DtIcon), {
|
|
6804
|
-
"icon-class": "logo",
|
|
6805
|
-
size: 42,
|
|
6806
|
-
"class-name": "brand-logo"
|
|
6807
|
-
}),
|
|
6808
|
-
withDirectives(createElementVNode("div", _hoisted_1$g, toDisplayString(title), 512), [
|
|
6809
|
-
[vShow, __props.showTitle]
|
|
6810
|
-
])
|
|
6811
|
-
], 2);
|
|
7363
|
+
SparkMD5.prototype.end = function(raw) {
|
|
7364
|
+
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;
|
|
7365
|
+
for (i = 0; i < length; i += 1) {
|
|
7366
|
+
tail[i >> 2] |= buff.charCodeAt(i) << (i % 4 << 3);
|
|
7367
|
+
}
|
|
7368
|
+
this._finish(tail, length);
|
|
7369
|
+
ret = hex(this._hash);
|
|
7370
|
+
if (raw) {
|
|
7371
|
+
ret = hexToBinaryString(ret);
|
|
7372
|
+
}
|
|
7373
|
+
this.reset();
|
|
7374
|
+
return ret;
|
|
6812
7375
|
};
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
7376
|
+
SparkMD5.prototype.reset = function() {
|
|
7377
|
+
this._buff = "";
|
|
7378
|
+
this._length = 0;
|
|
7379
|
+
this._hash = [1732584193, -271733879, -1732584194, 271733878];
|
|
7380
|
+
return this;
|
|
7381
|
+
};
|
|
7382
|
+
SparkMD5.prototype.getState = function() {
|
|
7383
|
+
return {
|
|
7384
|
+
buff: this._buff,
|
|
7385
|
+
length: this._length,
|
|
7386
|
+
hash: this._hash.slice()
|
|
7387
|
+
};
|
|
7388
|
+
};
|
|
7389
|
+
SparkMD5.prototype.setState = function(state) {
|
|
7390
|
+
this._buff = state.buff;
|
|
7391
|
+
this._length = state.length;
|
|
7392
|
+
this._hash = state.hash;
|
|
7393
|
+
return this;
|
|
7394
|
+
};
|
|
7395
|
+
SparkMD5.prototype.destroy = function() {
|
|
7396
|
+
delete this._hash;
|
|
7397
|
+
delete this._buff;
|
|
7398
|
+
delete this._length;
|
|
7399
|
+
};
|
|
7400
|
+
SparkMD5.prototype._finish = function(tail, length) {
|
|
7401
|
+
var i = length, tmp, lo, hi;
|
|
7402
|
+
tail[i >> 2] |= 128 << (i % 4 << 3);
|
|
7403
|
+
if (i > 55) {
|
|
7404
|
+
md5cycle(this._hash, tail);
|
|
7405
|
+
for (i = 0; i < 16; i += 1) {
|
|
7406
|
+
tail[i] = 0;
|
|
7407
|
+
}
|
|
7408
|
+
}
|
|
7409
|
+
tmp = this._length * 8;
|
|
7410
|
+
tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
|
|
7411
|
+
lo = parseInt(tmp[2], 16);
|
|
7412
|
+
hi = parseInt(tmp[1], 16) || 0;
|
|
7413
|
+
tail[14] = lo;
|
|
7414
|
+
tail[15] = hi;
|
|
7415
|
+
md5cycle(this._hash, tail);
|
|
7416
|
+
};
|
|
7417
|
+
SparkMD5.hash = function(str, raw) {
|
|
7418
|
+
return SparkMD5.hashBinary(toUtf8(str), raw);
|
|
7419
|
+
};
|
|
7420
|
+
SparkMD5.hashBinary = function(content, raw) {
|
|
7421
|
+
var hash = md51(content), ret = hex(hash);
|
|
7422
|
+
return raw ? hexToBinaryString(ret) : ret;
|
|
7423
|
+
};
|
|
7424
|
+
SparkMD5.ArrayBuffer = function() {
|
|
7425
|
+
this.reset();
|
|
7426
|
+
};
|
|
7427
|
+
SparkMD5.ArrayBuffer.prototype.append = function(arr) {
|
|
7428
|
+
var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), length = buff.length, i;
|
|
7429
|
+
this._length += arr.byteLength;
|
|
7430
|
+
for (i = 64; i <= length; i += 64) {
|
|
7431
|
+
md5cycle(this._hash, md5blk_array(buff.subarray(i - 64, i)));
|
|
7432
|
+
}
|
|
7433
|
+
this._buff = i - 64 < length ? new Uint8Array(buff.buffer.slice(i - 64)) : new Uint8Array(0);
|
|
7434
|
+
return this;
|
|
7435
|
+
};
|
|
7436
|
+
SparkMD5.ArrayBuffer.prototype.end = function(raw) {
|
|
7437
|
+
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;
|
|
7438
|
+
for (i = 0; i < length; i += 1) {
|
|
7439
|
+
tail[i >> 2] |= buff[i] << (i % 4 << 3);
|
|
7440
|
+
}
|
|
7441
|
+
this._finish(tail, length);
|
|
7442
|
+
ret = hex(this._hash);
|
|
7443
|
+
if (raw) {
|
|
7444
|
+
ret = hexToBinaryString(ret);
|
|
7445
|
+
}
|
|
7446
|
+
this.reset();
|
|
7447
|
+
return ret;
|
|
7448
|
+
};
|
|
7449
|
+
SparkMD5.ArrayBuffer.prototype.reset = function() {
|
|
7450
|
+
this._buff = new Uint8Array(0);
|
|
7451
|
+
this._length = 0;
|
|
7452
|
+
this._hash = [1732584193, -271733879, -1732584194, 271733878];
|
|
7453
|
+
return this;
|
|
7454
|
+
};
|
|
7455
|
+
SparkMD5.ArrayBuffer.prototype.getState = function() {
|
|
7456
|
+
var state = SparkMD5.prototype.getState.call(this);
|
|
7457
|
+
state.buff = arrayBuffer2Utf8Str(state.buff);
|
|
7458
|
+
return state;
|
|
7459
|
+
};
|
|
7460
|
+
SparkMD5.ArrayBuffer.prototype.setState = function(state) {
|
|
7461
|
+
state.buff = utf8Str2ArrayBuffer(state.buff, true);
|
|
7462
|
+
return SparkMD5.prototype.setState.call(this, state);
|
|
7463
|
+
};
|
|
7464
|
+
SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;
|
|
7465
|
+
SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;
|
|
7466
|
+
SparkMD5.ArrayBuffer.hash = function(arr, raw) {
|
|
7467
|
+
var hash = md51_array(new Uint8Array(arr)), ret = hex(hash);
|
|
7468
|
+
return raw ? hexToBinaryString(ret) : ret;
|
|
7469
|
+
};
|
|
7470
|
+
return SparkMD5;
|
|
7471
|
+
});
|
|
7472
|
+
})(sparkMd5);
|
|
7473
|
+
const _hoisted_1$k = { class: "file-header" };
|
|
7474
|
+
const _hoisted_2$c = /* @__PURE__ */ createTextVNode(" \u6587\u4EF6\u4E0A\u4F20 ");
|
|
7475
|
+
const _hoisted_3$6 = /* @__PURE__ */ createTextVNode(" \u6A21\u677F\u4E0B\u8F7D ");
|
|
7476
|
+
const _hoisted_4$4 = { class: "file-type-tips ant-alert-info" };
|
|
7477
|
+
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);
|
|
7478
|
+
const _sfc_main$y = /* @__PURE__ */ defineComponent({
|
|
7479
|
+
__name: "upload",
|
|
7480
|
+
props: basicUploadProps,
|
|
7481
|
+
setup(__props, { expose }) {
|
|
7482
|
+
const props = __props;
|
|
7483
|
+
const { message } = useMessage();
|
|
7484
|
+
const filesRef = ref([]);
|
|
7485
|
+
const historyFilesRef = ref([]);
|
|
7486
|
+
const allFilesRef = ref([]);
|
|
7487
|
+
const imgVisable = ref(false);
|
|
7488
|
+
const setImgVisible = (value) => imgVisable.value = value;
|
|
7489
|
+
const { accept, helpText, maxNumber, maxSize } = toRefs(props);
|
|
7490
|
+
const { getStringAccept } = useHelpers(accept);
|
|
7491
|
+
const [registerTable, {}] = useTable({
|
|
7492
|
+
tableSetting: false,
|
|
7493
|
+
pagination: false,
|
|
7494
|
+
dataSource: allFilesRef,
|
|
7495
|
+
columns: [
|
|
7496
|
+
{ title: "\u6587\u4EF6\u540D\u79F0", dataIndex: "fileName" },
|
|
7497
|
+
{ title: "\u4E0A\u4F20\u72B6\u6001", dataIndex: "fileStatue", render(row) {
|
|
7498
|
+
return h("span", {
|
|
7499
|
+
style: `color: ${row.status === 0 ? "orange" : "green"}`
|
|
7500
|
+
}, row.fileStatue);
|
|
7501
|
+
} }
|
|
7502
|
+
],
|
|
7503
|
+
operations: {
|
|
7504
|
+
expand: true,
|
|
7505
|
+
btns: [
|
|
7506
|
+
{
|
|
7507
|
+
title: "\u9884\u89C8",
|
|
7508
|
+
icon: "ic:baseline-remove-red-eye",
|
|
7509
|
+
ifShow(row) {
|
|
7510
|
+
const supportFileTypes = ["pdf", "jpg", "jpeg", "png", "bmp", "gif"];
|
|
7511
|
+
return supportFileTypes.includes(row.fileName.split(".").pop());
|
|
7512
|
+
},
|
|
7513
|
+
action: () => {
|
|
7514
|
+
setImgVisible(true);
|
|
7515
|
+
}
|
|
7516
|
+
},
|
|
7517
|
+
{ title: "\u7F16\u8F91", icon: "mdi:text-box-edit-outline" },
|
|
7518
|
+
{ title: "\u5220\u9664", icon: "mdi:delete-outline" }
|
|
7519
|
+
]
|
|
7520
|
+
}
|
|
7521
|
+
});
|
|
7522
|
+
watchEffect(() => {
|
|
7523
|
+
historyFilesRef.value = props.defaultFiles.map((file) => {
|
|
7524
|
+
return {
|
|
7525
|
+
...file,
|
|
7526
|
+
fileName: file.fileName,
|
|
7527
|
+
status: 0,
|
|
7528
|
+
fileStatue: "\u5386\u53F2\u4E0A\u4F20"
|
|
7529
|
+
};
|
|
7530
|
+
});
|
|
7531
|
+
allFilesRef.value = [...historyFilesRef.value, ...filesRef.value];
|
|
7532
|
+
});
|
|
7533
|
+
function beforeUpload(file) {
|
|
7534
|
+
const { maxSize: maxSize2 } = props;
|
|
7535
|
+
if (maxSize2 && file.size / 1024 / 1024 >= maxSize2) {
|
|
7536
|
+
message.error(`\u53EA\u80FD\u4E0A\u4F20\u4E0D\u8D85\u8FC7${maxSize2}MB\u7684\u6587\u4EF6!`);
|
|
7537
|
+
return false;
|
|
7538
|
+
}
|
|
7539
|
+
addFile(file);
|
|
7540
|
+
return false;
|
|
7541
|
+
}
|
|
7542
|
+
function addFile(file) {
|
|
7543
|
+
let blobSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
|
|
7544
|
+
let chunkSize = 2097152, chunks = Math.ceil(file.size / chunkSize), currentChunk = 0, spark = new sparkMd5.exports.ArrayBuffer(), fileReader = new FileReader();
|
|
7545
|
+
fileReader.onload = function(e) {
|
|
7546
|
+
spark.append(e.target["result"]);
|
|
7547
|
+
currentChunk++;
|
|
7548
|
+
if (currentChunk < chunks) {
|
|
7549
|
+
loadNext();
|
|
7550
|
+
} else {
|
|
7551
|
+
filesRef.value.push({
|
|
7552
|
+
fileName: file.name,
|
|
7553
|
+
fileId: spark.end(),
|
|
7554
|
+
file,
|
|
7555
|
+
status: 1,
|
|
7556
|
+
fileStatue: "\u5F85\u4E0A\u4F20"
|
|
7557
|
+
});
|
|
7558
|
+
}
|
|
7559
|
+
};
|
|
7560
|
+
function loadNext() {
|
|
7561
|
+
var start = currentChunk * chunkSize, end = start + chunkSize >= file.size ? file.size : start + chunkSize;
|
|
7562
|
+
fileReader.readAsArrayBuffer(blobSlice.call(file, start, end));
|
|
7563
|
+
}
|
|
7564
|
+
loadNext();
|
|
7565
|
+
}
|
|
7566
|
+
expose({
|
|
7567
|
+
allFilesRef
|
|
7568
|
+
});
|
|
7569
|
+
return (_ctx, _cache) => {
|
|
7570
|
+
const _directive_icon = resolveDirective("icon");
|
|
7571
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
7572
|
+
createElementVNode("div", _hoisted_1$k, [
|
|
7573
|
+
createElementVNode("div", null, [
|
|
7574
|
+
createVNode(unref(Upload), {
|
|
7575
|
+
accept: unref(getStringAccept),
|
|
7576
|
+
multiple: _ctx.multiple,
|
|
7577
|
+
"before-upload": beforeUpload,
|
|
7578
|
+
"show-upload-list": false
|
|
7579
|
+
}, {
|
|
7580
|
+
default: withCtx(() => [
|
|
7581
|
+
createVNode(unref(Button), { type: "primary" }, {
|
|
7582
|
+
default: withCtx(() => [
|
|
7583
|
+
withDirectives(createElementVNode("span", null, null, 512), [
|
|
7584
|
+
[_directive_icon, "ic:baseline-file-upload"]
|
|
7585
|
+
]),
|
|
7586
|
+
_hoisted_2$c
|
|
7587
|
+
]),
|
|
7588
|
+
_: 1
|
|
7589
|
+
})
|
|
7590
|
+
]),
|
|
7591
|
+
_: 1
|
|
7592
|
+
}, 8, ["accept", "multiple"]),
|
|
7593
|
+
_ctx.showTemplateDownload ? (openBlock(), createBlock(unref(Button), {
|
|
7594
|
+
key: 0,
|
|
7595
|
+
type: "primary",
|
|
7596
|
+
onClick: _ctx.templateDownload
|
|
7597
|
+
}, {
|
|
7598
|
+
default: withCtx(() => [
|
|
7599
|
+
withDirectives(createElementVNode("span", null, null, 512), [
|
|
7600
|
+
[_directive_icon, "ic:baseline-file-download"]
|
|
7601
|
+
]),
|
|
7602
|
+
_hoisted_3$6
|
|
7603
|
+
]),
|
|
7604
|
+
_: 1
|
|
7605
|
+
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
7606
|
+
]),
|
|
7607
|
+
renderSlot(_ctx.$slots, "default")
|
|
7608
|
+
]),
|
|
7609
|
+
createElementVNode("div", _hoisted_4$4, [
|
|
7610
|
+
withDirectives(createElementVNode("span", null, null, 512), [
|
|
7611
|
+
[_directive_icon, "ant-design:info-circle-outlined"]
|
|
7612
|
+
]),
|
|
7613
|
+
_hoisted_5$3
|
|
7614
|
+
]),
|
|
7615
|
+
createVNode(unref(DtTable), { onRegister: unref(registerTable) }, null, 8, ["onRegister"]),
|
|
7616
|
+
createVNode(unref(Image), {
|
|
7617
|
+
width: 200,
|
|
7618
|
+
style: { display: "none" },
|
|
7619
|
+
preview: {
|
|
7620
|
+
visible: imgVisable.value,
|
|
7621
|
+
onVisibleChange: setImgVisible
|
|
7622
|
+
},
|
|
7623
|
+
src: "https://zos.alipayobjects.com/rmsportal/jkjgkEfvpUPVyRjUImniVslZfWPnJuuZ.png"
|
|
7624
|
+
}, null, 8, ["preview"])
|
|
7625
|
+
], 64);
|
|
7626
|
+
};
|
|
7627
|
+
}
|
|
7628
|
+
});
|
|
7629
|
+
const _hoisted_1$j = { class: "dt-upload-wrap" };
|
|
7630
|
+
const _hoisted_2$b = /* @__PURE__ */ createTextVNode(" 111 ");
|
|
7631
|
+
const _sfc_main$x = /* @__PURE__ */ defineComponent({
|
|
7632
|
+
__name: "index",
|
|
7633
|
+
emits: ["register"],
|
|
7634
|
+
setup(__props, { emit: emites }) {
|
|
7635
|
+
const uploadRef = ref(null);
|
|
7636
|
+
const [register] = useModal({
|
|
7637
|
+
width: "700px",
|
|
7638
|
+
title: "\u6587\u4EF6\u4E0A\u4F20",
|
|
7639
|
+
maskClosable: false
|
|
7640
|
+
});
|
|
7641
|
+
const defaultFiles = [
|
|
7642
|
+
{ fileName: "\u53EE\u549A\u53D1\u7968667.09.pdf", fileId: "1" }
|
|
7643
|
+
];
|
|
7644
|
+
function handleSave() {
|
|
7645
|
+
console.log(uploadRef.value.allFilesRef);
|
|
7646
|
+
alert("s-s-s-");
|
|
7647
|
+
}
|
|
7648
|
+
return (_ctx, _cache) => {
|
|
7649
|
+
return openBlock(), createBlock(unref(_sfc_main$L), {
|
|
7650
|
+
onSave: _cache[0] || (_cache[0] = ($event) => handleSave()),
|
|
7651
|
+
onRegister: unref(register)
|
|
7652
|
+
}, {
|
|
7653
|
+
default: withCtx(() => [
|
|
7654
|
+
createElementVNode("div", _hoisted_1$j, [
|
|
7655
|
+
createVNode(_sfc_main$y, {
|
|
7656
|
+
ref_key: "uploadRef",
|
|
7657
|
+
ref: uploadRef,
|
|
7658
|
+
defaultFiles
|
|
7659
|
+
}, {
|
|
7660
|
+
default: withCtx(() => [
|
|
7661
|
+
_hoisted_2$b
|
|
7662
|
+
]),
|
|
7663
|
+
_: 1
|
|
7664
|
+
}, 512)
|
|
7665
|
+
])
|
|
7666
|
+
]),
|
|
7667
|
+
_: 1
|
|
7668
|
+
}, 8, ["onRegister"]);
|
|
7669
|
+
};
|
|
7670
|
+
}
|
|
7671
|
+
});
|
|
7672
|
+
const BasicProps = {
|
|
7673
|
+
loading: {
|
|
7674
|
+
type: Boolean,
|
|
7675
|
+
default: false
|
|
7676
|
+
},
|
|
7677
|
+
checkStrictly: Boolean,
|
|
7678
|
+
expandedKeys: {
|
|
7679
|
+
type: Array,
|
|
7680
|
+
default: () => []
|
|
7681
|
+
},
|
|
7682
|
+
selectedKeys: {
|
|
7683
|
+
type: Array,
|
|
7684
|
+
default: () => []
|
|
7685
|
+
},
|
|
7686
|
+
checkedKeys: {
|
|
7687
|
+
type: Array,
|
|
7688
|
+
default: () => []
|
|
7689
|
+
},
|
|
7690
|
+
fieldNames: {
|
|
7691
|
+
type: Object
|
|
7692
|
+
},
|
|
7693
|
+
beforeRightClick: {
|
|
7694
|
+
type: Function,
|
|
7695
|
+
default: void 0
|
|
7696
|
+
},
|
|
7697
|
+
rightMenuList: {
|
|
7698
|
+
type: Array
|
|
7699
|
+
},
|
|
7700
|
+
renderIcon: {
|
|
7701
|
+
type: Function
|
|
7702
|
+
},
|
|
7703
|
+
highlight: {
|
|
7704
|
+
type: [Boolean, String],
|
|
7705
|
+
default: false
|
|
7706
|
+
},
|
|
7707
|
+
actionList: {
|
|
7708
|
+
type: Array,
|
|
7709
|
+
default: () => []
|
|
7710
|
+
},
|
|
7711
|
+
clickRowToExpand: {
|
|
7712
|
+
type: Boolean,
|
|
7713
|
+
default: false
|
|
7714
|
+
},
|
|
7715
|
+
searchValue: {
|
|
7716
|
+
type: String,
|
|
7717
|
+
default: ""
|
|
7718
|
+
},
|
|
7719
|
+
filterFn: {
|
|
7720
|
+
type: Function,
|
|
7721
|
+
default: void 0
|
|
7722
|
+
},
|
|
7723
|
+
checkable: Boolean,
|
|
7724
|
+
expandOnSearch: Boolean,
|
|
7725
|
+
checkOnSearch: Boolean,
|
|
7726
|
+
selectedOnSearch: Boolean,
|
|
7727
|
+
treeData: {
|
|
7728
|
+
type: Array
|
|
7729
|
+
},
|
|
7730
|
+
value: {
|
|
7731
|
+
type: [Object, Array]
|
|
7732
|
+
},
|
|
7733
|
+
title: {
|
|
7734
|
+
type: String,
|
|
7735
|
+
default: ""
|
|
7736
|
+
},
|
|
7737
|
+
toolbar: Boolean,
|
|
7738
|
+
search: Boolean
|
|
7739
|
+
};
|
|
7740
|
+
const searchProps = {
|
|
7741
|
+
title: {
|
|
7742
|
+
type: String,
|
|
7743
|
+
default: ""
|
|
7744
|
+
},
|
|
7745
|
+
toolbar: {
|
|
7746
|
+
type: Boolean,
|
|
7747
|
+
default: false
|
|
7748
|
+
},
|
|
7749
|
+
checkable: {
|
|
7750
|
+
type: Boolean,
|
|
7751
|
+
default: false
|
|
7752
|
+
},
|
|
7753
|
+
search: {
|
|
7754
|
+
type: Boolean,
|
|
7755
|
+
default: false
|
|
7756
|
+
},
|
|
7757
|
+
searchText: {
|
|
7758
|
+
type: String,
|
|
7759
|
+
default: ""
|
|
7760
|
+
},
|
|
7761
|
+
checkAll: {
|
|
7762
|
+
type: Function,
|
|
7763
|
+
default: void 0
|
|
7764
|
+
},
|
|
7765
|
+
expandAll: {
|
|
7766
|
+
type: Function,
|
|
7767
|
+
default: void 0
|
|
7768
|
+
}
|
|
7769
|
+
};
|
|
7770
|
+
var ToolbarEnum = /* @__PURE__ */ ((ToolbarEnum2) => {
|
|
7771
|
+
ToolbarEnum2[ToolbarEnum2["SELECT_ALL"] = 0] = "SELECT_ALL";
|
|
7772
|
+
ToolbarEnum2[ToolbarEnum2["UN_SELECT_ALL"] = 1] = "UN_SELECT_ALL";
|
|
7773
|
+
ToolbarEnum2[ToolbarEnum2["EXPAND_ALL"] = 2] = "EXPAND_ALL";
|
|
7774
|
+
ToolbarEnum2[ToolbarEnum2["UN_EXPAND_ALL"] = 3] = "UN_EXPAND_ALL";
|
|
7775
|
+
ToolbarEnum2[ToolbarEnum2["CHECK_STRICTLY"] = 4] = "CHECK_STRICTLY";
|
|
7776
|
+
ToolbarEnum2[ToolbarEnum2["CHECK_UN_STRICTLY"] = 5] = "CHECK_UN_STRICTLY";
|
|
7777
|
+
return ToolbarEnum2;
|
|
7778
|
+
})(ToolbarEnum || {});
|
|
7779
|
+
const _hoisted_1$i = { class: "dt-tree-header" };
|
|
7780
|
+
const _hoisted_2$a = {
|
|
7781
|
+
key: 1,
|
|
7782
|
+
class: "headerTitle"
|
|
7783
|
+
};
|
|
7784
|
+
const _hoisted_3$5 = {
|
|
7785
|
+
key: 2,
|
|
7786
|
+
class: "dt-tree-search"
|
|
7787
|
+
};
|
|
7788
|
+
const _hoisted_4$3 = {
|
|
7789
|
+
key: 0,
|
|
7790
|
+
class: "dt-tree-search-input"
|
|
7791
|
+
};
|
|
7792
|
+
const _hoisted_5$2 = /* @__PURE__ */ createElementVNode("i", { class: "i ic:baseline-more-vert" }, null, -1);
|
|
7793
|
+
const _sfc_main$w = /* @__PURE__ */ defineComponent({
|
|
7794
|
+
__name: "treeHeader",
|
|
7795
|
+
props: searchProps,
|
|
7796
|
+
emits: [
|
|
7797
|
+
"search",
|
|
7798
|
+
"strictly-change",
|
|
7799
|
+
"strictly-change"
|
|
7800
|
+
],
|
|
7801
|
+
setup(__props, { emit: emits }) {
|
|
7802
|
+
const props = __props;
|
|
7803
|
+
const slots = useSlots$1();
|
|
7804
|
+
const searchValue = ref("");
|
|
7805
|
+
function emitChange(value) {
|
|
7806
|
+
emits("search", value);
|
|
7807
|
+
}
|
|
7808
|
+
function handleMenuClick(e) {
|
|
7809
|
+
var _a, _b, _c, _d;
|
|
7810
|
+
const { key } = e;
|
|
7811
|
+
switch (key) {
|
|
7812
|
+
case ToolbarEnum.SELECT_ALL:
|
|
7813
|
+
(_a = props.checkAll) == null ? void 0 : _a.call(props, true);
|
|
7814
|
+
break;
|
|
7815
|
+
case ToolbarEnum.UN_SELECT_ALL:
|
|
7816
|
+
(_b = props.checkAll) == null ? void 0 : _b.call(props, false);
|
|
7817
|
+
break;
|
|
7818
|
+
case ToolbarEnum.EXPAND_ALL:
|
|
7819
|
+
(_c = props.expandAll) == null ? void 0 : _c.call(props, true);
|
|
7820
|
+
break;
|
|
7821
|
+
case ToolbarEnum.UN_EXPAND_ALL:
|
|
7822
|
+
(_d = props.expandAll) == null ? void 0 : _d.call(props, false);
|
|
7823
|
+
break;
|
|
7824
|
+
case ToolbarEnum.CHECK_STRICTLY:
|
|
7825
|
+
emits("strictly-change", false);
|
|
7826
|
+
break;
|
|
7827
|
+
case ToolbarEnum.CHECK_UN_STRICTLY:
|
|
7828
|
+
emits("strictly-change", true);
|
|
7829
|
+
break;
|
|
7830
|
+
}
|
|
7831
|
+
}
|
|
7832
|
+
const toolbarList = computed(() => {
|
|
7833
|
+
const { checkable } = props;
|
|
7834
|
+
const defaultToolbarList = [
|
|
7835
|
+
{ label: "\u5C55\u5F00\u5168\u90E8", value: ToolbarEnum.EXPAND_ALL },
|
|
7836
|
+
{
|
|
7837
|
+
label: "\u6298\u53E0\u5168\u90E8",
|
|
7838
|
+
value: ToolbarEnum.UN_EXPAND_ALL,
|
|
7839
|
+
divider: checkable
|
|
7840
|
+
}
|
|
7841
|
+
];
|
|
7842
|
+
return checkable ? [
|
|
7843
|
+
{ label: "\u9009\u62E9\u5168\u90E8", value: ToolbarEnum.SELECT_ALL },
|
|
7844
|
+
{
|
|
7845
|
+
label: "\u53D6\u6D88\u9009\u62E9",
|
|
7846
|
+
value: ToolbarEnum.UN_SELECT_ALL,
|
|
7847
|
+
divider: checkable
|
|
7848
|
+
},
|
|
7849
|
+
...defaultToolbarList,
|
|
7850
|
+
{ label: "\u5C42\u7EA7\u5173\u8054", value: ToolbarEnum.CHECK_STRICTLY },
|
|
7851
|
+
{ label: "\u5C42\u7EA7\u72EC\u7ACB", value: ToolbarEnum.CHECK_UN_STRICTLY }
|
|
7852
|
+
] : defaultToolbarList;
|
|
7853
|
+
});
|
|
7854
|
+
const debounceEmitChange = useDebounceFn(emitChange, 200);
|
|
7855
|
+
watch(() => searchValue.value, (v) => {
|
|
7856
|
+
debounceEmitChange(v);
|
|
7857
|
+
});
|
|
7858
|
+
return (_ctx, _cache) => {
|
|
7859
|
+
return openBlock(), createElementBlock("div", _hoisted_1$i, [
|
|
7860
|
+
unref(slots).headerTitle ? renderSlot(_ctx.$slots, "headerTitle", { key: 0 }) : createCommentVNode("", true),
|
|
7861
|
+
!unref(slots).headerTitle && _ctx.title ? (openBlock(), createElementBlock("h4", _hoisted_2$a, toDisplayString(_ctx.title), 1)) : createCommentVNode("", true),
|
|
7862
|
+
_ctx.search || _ctx.toolbar ? (openBlock(), createElementBlock("div", _hoisted_3$5, [
|
|
7863
|
+
_ctx.search ? (openBlock(), createElementBlock("div", _hoisted_4$3, [
|
|
7864
|
+
createVNode(unref(InputSearch), {
|
|
7865
|
+
size: "small",
|
|
7866
|
+
allowClear: "",
|
|
7867
|
+
value: searchValue.value,
|
|
7868
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => searchValue.value = $event),
|
|
7869
|
+
placeholder: "\u641C\u7D22"
|
|
7870
|
+
}, null, 8, ["value"])
|
|
7871
|
+
])) : createCommentVNode("", true),
|
|
7872
|
+
_ctx.toolbar ? (openBlock(), createBlock(unref(Dropdown), {
|
|
7873
|
+
key: 1,
|
|
7874
|
+
onClick: _cache[1] || (_cache[1] = withModifiers(() => {
|
|
7875
|
+
}, ["prevent"]))
|
|
7876
|
+
}, {
|
|
7877
|
+
overlay: withCtx(() => [
|
|
7878
|
+
createVNode(unref(Menu), { onClick: handleMenuClick }, {
|
|
7879
|
+
default: withCtx(() => [
|
|
7880
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(toolbarList), (item) => {
|
|
7881
|
+
return openBlock(), createElementBlock(Fragment, {
|
|
7882
|
+
key: item.value
|
|
7883
|
+
}, [
|
|
7884
|
+
createVNode(unref(MenuItem), normalizeProps(guardReactiveProps({ key: item.value })), {
|
|
7885
|
+
default: withCtx(() => [
|
|
7886
|
+
createTextVNode(toDisplayString(item.label), 1)
|
|
7887
|
+
]),
|
|
7888
|
+
_: 2
|
|
7889
|
+
}, 1040),
|
|
7890
|
+
item.divider ? (openBlock(), createBlock(unref(MenuDivider), { key: 0 })) : createCommentVNode("", true)
|
|
7891
|
+
], 64);
|
|
7892
|
+
}), 128))
|
|
7893
|
+
]),
|
|
7894
|
+
_: 1
|
|
7895
|
+
})
|
|
7896
|
+
]),
|
|
7897
|
+
default: withCtx(() => [
|
|
7898
|
+
_hoisted_5$2
|
|
7899
|
+
]),
|
|
7900
|
+
_: 1
|
|
7901
|
+
})) : createCommentVNode("", true)
|
|
7902
|
+
])) : createCommentVNode("", true)
|
|
7903
|
+
]);
|
|
7904
|
+
};
|
|
7905
|
+
}
|
|
7906
|
+
});
|
|
7907
|
+
function eachTree(treeDatas, callBack, parentNode = {}) {
|
|
7908
|
+
treeDatas.forEach((el) => {
|
|
7909
|
+
const newNode = callBack(el, parentNode) || el;
|
|
7910
|
+
if (el.children) {
|
|
7911
|
+
eachTree(el.children, callBack, newNode);
|
|
7912
|
+
}
|
|
7913
|
+
});
|
|
7914
|
+
}
|
|
7915
|
+
function forEach(tree, func, config = {}) {
|
|
7916
|
+
const list = [...tree];
|
|
7917
|
+
const { children = "children" } = config;
|
|
7918
|
+
for (let i = 0; i < list.length; i++) {
|
|
7919
|
+
if (func(list[i])) {
|
|
7920
|
+
return;
|
|
7921
|
+
}
|
|
7922
|
+
children && list[i][children] && list.splice(i + 1, 0, ...list[i][children]);
|
|
7923
|
+
}
|
|
7924
|
+
}
|
|
7925
|
+
function filter(tree, func, config = {}) {
|
|
7926
|
+
const children = config.children || "children";
|
|
7927
|
+
function listFilter(list) {
|
|
7928
|
+
return list.map((node) => ({ ...node })).filter((node) => {
|
|
7929
|
+
node[children] = node[children] && listFilter(node[children]);
|
|
7930
|
+
return func(node) || node[children] && node[children].length;
|
|
7931
|
+
});
|
|
7932
|
+
}
|
|
7933
|
+
return listFilter(tree);
|
|
7934
|
+
}
|
|
7935
|
+
function treeToList(tree, config = {}) {
|
|
7936
|
+
const { children = "children" } = config;
|
|
7937
|
+
const result = [...tree];
|
|
7938
|
+
for (let i = 0; i < result.length; i++) {
|
|
7939
|
+
if (!result[i][children])
|
|
7940
|
+
continue;
|
|
7941
|
+
result.splice(i + 1, 0, ...result[i][children]);
|
|
7942
|
+
}
|
|
7943
|
+
return result;
|
|
7944
|
+
}
|
|
7945
|
+
function useTree(treeDataRef, getFieldNames) {
|
|
7946
|
+
function getAllKeys(list) {
|
|
7947
|
+
const keys = [];
|
|
7948
|
+
const treeData = list || unref(treeDataRef);
|
|
7949
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
7950
|
+
if (!childrenField || !keyField)
|
|
7951
|
+
return keys;
|
|
7952
|
+
for (let index = 0; index < treeData.length; index++) {
|
|
7953
|
+
const node = treeData[index];
|
|
7954
|
+
keys.push(node[keyField]);
|
|
7955
|
+
const children = node[childrenField];
|
|
7956
|
+
if (children && children.length) {
|
|
7957
|
+
keys.push(...getAllKeys(children));
|
|
7958
|
+
}
|
|
7959
|
+
}
|
|
7960
|
+
return keys;
|
|
7961
|
+
}
|
|
7962
|
+
function getEnabledKeys(list) {
|
|
7963
|
+
const keys = [];
|
|
7964
|
+
const treeData = list || unref(treeDataRef);
|
|
7965
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
7966
|
+
if (!childrenField || !keyField)
|
|
7967
|
+
return keys;
|
|
7968
|
+
for (let index = 0; index < treeData.length; index++) {
|
|
7969
|
+
const node = treeData[index];
|
|
7970
|
+
node.disabled !== true && node.selectable !== false && keys.push(node[keyField]);
|
|
7971
|
+
const children = node[childrenField];
|
|
7972
|
+
if (children && children.length) {
|
|
7973
|
+
keys.push(...getEnabledKeys(children));
|
|
7974
|
+
}
|
|
7975
|
+
}
|
|
7976
|
+
return keys;
|
|
7977
|
+
}
|
|
7978
|
+
function getChildrenKeys(nodeKey, list) {
|
|
7979
|
+
const keys = [];
|
|
7980
|
+
const treeData = list || unref(treeDataRef);
|
|
7981
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
7982
|
+
if (!childrenField || !keyField)
|
|
7983
|
+
return keys;
|
|
7984
|
+
for (let index = 0; index < treeData.length; index++) {
|
|
7985
|
+
const node = treeData[index];
|
|
7986
|
+
const children = node[childrenField];
|
|
7987
|
+
if (nodeKey === node[keyField]) {
|
|
7988
|
+
keys.push(node[keyField]);
|
|
7989
|
+
if (children && children.length) {
|
|
7990
|
+
keys.push(...getAllKeys(children));
|
|
7991
|
+
}
|
|
7992
|
+
} else {
|
|
7993
|
+
if (children && children.length) {
|
|
7994
|
+
keys.push(...getChildrenKeys(nodeKey, children));
|
|
7995
|
+
}
|
|
7996
|
+
}
|
|
7997
|
+
}
|
|
7998
|
+
return keys;
|
|
7999
|
+
}
|
|
8000
|
+
function updateNodeByKey(key, node, list) {
|
|
8001
|
+
if (!key)
|
|
8002
|
+
return;
|
|
8003
|
+
const treeData = list || unref(treeDataRef);
|
|
8004
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8005
|
+
if (!childrenField || !keyField)
|
|
8006
|
+
return;
|
|
8007
|
+
for (let index = 0; index < treeData.length; index++) {
|
|
8008
|
+
const element = treeData[index];
|
|
8009
|
+
const children = element[childrenField];
|
|
8010
|
+
if (element[keyField] === key) {
|
|
8011
|
+
treeData[index] = { ...treeData[index], ...node };
|
|
8012
|
+
break;
|
|
8013
|
+
} else if (children && children.length) {
|
|
8014
|
+
updateNodeByKey(key, node, element[childrenField]);
|
|
8015
|
+
}
|
|
8016
|
+
}
|
|
8017
|
+
}
|
|
8018
|
+
function filterByLevel(level = 1, list, currentLevel = 1) {
|
|
8019
|
+
if (!level)
|
|
8020
|
+
return [];
|
|
8021
|
+
const res = [];
|
|
8022
|
+
const data = list || unref(treeDataRef) || [];
|
|
8023
|
+
for (let index = 0; index < data.length; index++) {
|
|
8024
|
+
const item = data[index];
|
|
8025
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8026
|
+
const key = keyField ? item[keyField] : "";
|
|
8027
|
+
const children = childrenField ? item[childrenField] : [];
|
|
8028
|
+
res.push(key);
|
|
8029
|
+
if (children && children.length && currentLevel < level) {
|
|
8030
|
+
currentLevel += 1;
|
|
8031
|
+
res.push(...filterByLevel(level, children, currentLevel));
|
|
8032
|
+
}
|
|
8033
|
+
}
|
|
8034
|
+
return res;
|
|
8035
|
+
}
|
|
8036
|
+
function insertNodeByKey({ parentKey = null, node, push = "push" }) {
|
|
8037
|
+
const treeData = cloneDeep(unref(treeDataRef));
|
|
8038
|
+
if (!parentKey) {
|
|
8039
|
+
treeData[push](node);
|
|
8040
|
+
treeDataRef.value = treeData;
|
|
8041
|
+
return;
|
|
8042
|
+
}
|
|
8043
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8044
|
+
if (!childrenField || !keyField)
|
|
8045
|
+
return;
|
|
8046
|
+
forEach(treeData, (treeItem) => {
|
|
8047
|
+
if (treeItem[keyField] === parentKey) {
|
|
8048
|
+
treeItem[childrenField] = treeItem[childrenField] || [];
|
|
8049
|
+
treeItem[childrenField][push](node);
|
|
8050
|
+
return true;
|
|
8051
|
+
}
|
|
8052
|
+
});
|
|
8053
|
+
treeDataRef.value = treeData;
|
|
8054
|
+
}
|
|
8055
|
+
function insertNodesByKey({ parentKey = null, list, push = "push" }) {
|
|
8056
|
+
const treeData = cloneDeep(unref(treeDataRef));
|
|
8057
|
+
if (!list || list.length < 1)
|
|
8058
|
+
return;
|
|
8059
|
+
if (!parentKey) {
|
|
8060
|
+
for (let i = 0; i < list.length; i++) {
|
|
8061
|
+
treeData[push](list[i]);
|
|
8062
|
+
}
|
|
8063
|
+
} else {
|
|
8064
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8065
|
+
if (!childrenField || !keyField)
|
|
8066
|
+
return;
|
|
8067
|
+
forEach(treeData, (treeItem) => {
|
|
8068
|
+
if (treeItem[keyField] === parentKey) {
|
|
8069
|
+
treeItem[childrenField] = treeItem[childrenField] || [];
|
|
8070
|
+
for (let i = 0; i < list.length; i++) {
|
|
8071
|
+
treeItem[childrenField][push](list[i]);
|
|
8072
|
+
}
|
|
8073
|
+
treeDataRef.value = treeData;
|
|
8074
|
+
return true;
|
|
8075
|
+
}
|
|
8076
|
+
});
|
|
8077
|
+
}
|
|
8078
|
+
}
|
|
8079
|
+
function deleteNodeByKey(key, list) {
|
|
8080
|
+
if (!key)
|
|
8081
|
+
return;
|
|
8082
|
+
const treeData = list || unref(treeDataRef);
|
|
8083
|
+
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
|
8084
|
+
if (!childrenField || !keyField)
|
|
8085
|
+
return;
|
|
8086
|
+
for (let index = 0; index < treeData.length; index++) {
|
|
8087
|
+
const element = treeData[index];
|
|
8088
|
+
const children = element[childrenField];
|
|
8089
|
+
if (element[keyField] === key) {
|
|
8090
|
+
treeData.splice(index, 1);
|
|
8091
|
+
break;
|
|
8092
|
+
} else if (children && children.length) {
|
|
8093
|
+
deleteNodeByKey(key, element[childrenField]);
|
|
8094
|
+
}
|
|
8095
|
+
}
|
|
8096
|
+
}
|
|
8097
|
+
function getSelectedNode(key, list, selectedNode) {
|
|
8098
|
+
if (!key && key !== 0)
|
|
8099
|
+
return null;
|
|
8100
|
+
const treeData = list || unref(treeDataRef);
|
|
8101
|
+
treeData.forEach((item) => {
|
|
8102
|
+
if ((selectedNode == null ? void 0 : selectedNode.key) || (selectedNode == null ? void 0 : selectedNode.key) === 0)
|
|
8103
|
+
return selectedNode;
|
|
8104
|
+
if (item.key === key) {
|
|
8105
|
+
selectedNode = item;
|
|
8106
|
+
return;
|
|
8107
|
+
}
|
|
8108
|
+
if (item.children && item.children.length) {
|
|
8109
|
+
selectedNode = getSelectedNode(key, item.children, selectedNode);
|
|
8110
|
+
}
|
|
8111
|
+
});
|
|
8112
|
+
return selectedNode || null;
|
|
8113
|
+
}
|
|
8114
|
+
return {
|
|
8115
|
+
getAllKeys,
|
|
8116
|
+
getEnabledKeys,
|
|
8117
|
+
getChildrenKeys,
|
|
8118
|
+
updateNodeByKey,
|
|
8119
|
+
filterByLevel,
|
|
8120
|
+
insertNodeByKey,
|
|
8121
|
+
insertNodesByKey,
|
|
8122
|
+
deleteNodeByKey,
|
|
8123
|
+
getSelectedNode
|
|
8124
|
+
};
|
|
8125
|
+
}
|
|
8126
|
+
const _hoisted_1$h = {
|
|
8127
|
+
class: "dt-tree"
|
|
8128
|
+
};
|
|
8129
|
+
var _sfc_main$v = /* @__PURE__ */ defineComponent({
|
|
8130
|
+
__name: "index",
|
|
8131
|
+
props: BasicProps,
|
|
8132
|
+
emits: ["update:expandedKeys", "update:selectedKeys", "update:value", "check", "change", "clickNode", "update:searchValue"],
|
|
8133
|
+
setup(__props, {
|
|
8134
|
+
expose,
|
|
8135
|
+
emit
|
|
8136
|
+
}) {
|
|
8137
|
+
const props = __props;
|
|
8138
|
+
const attrs = useAttrs$1();
|
|
8139
|
+
const slots = useSlots$1();
|
|
8140
|
+
const {
|
|
8141
|
+
getSlot,
|
|
8142
|
+
extendSlots
|
|
8143
|
+
} = useSlots();
|
|
8144
|
+
const state = reactive({
|
|
8145
|
+
checkStrictly: props.checkStrictly,
|
|
8146
|
+
expandedKeys: props.expandedKeys || [],
|
|
8147
|
+
selectedKeys: props.selectedKeys || [],
|
|
8148
|
+
checkedKeys: props.checkedKeys || []
|
|
8149
|
+
});
|
|
8150
|
+
const searchState = reactive({
|
|
8151
|
+
startSearch: false,
|
|
8152
|
+
searchText: "",
|
|
8153
|
+
searchData: []
|
|
8154
|
+
});
|
|
8155
|
+
const treeDataRef = ref([]);
|
|
8156
|
+
const getFieldNames = computed(() => {
|
|
8157
|
+
const {
|
|
8158
|
+
fieldNames
|
|
8159
|
+
} = props;
|
|
8160
|
+
return {
|
|
8161
|
+
children: "children",
|
|
8162
|
+
title: "title",
|
|
8163
|
+
key: "key",
|
|
8164
|
+
...fieldNames
|
|
8165
|
+
};
|
|
8166
|
+
});
|
|
8167
|
+
const getTreeData = computed(() => {
|
|
8168
|
+
return searchState.startSearch ? searchState.searchData : unref(treeDataRef);
|
|
8169
|
+
});
|
|
8170
|
+
const getNotFound = computed(() => {
|
|
8171
|
+
return !getTreeData.value || getTreeData.value.length === 0;
|
|
8172
|
+
});
|
|
8173
|
+
const getIcon = (params, icon) => {
|
|
8174
|
+
if (!icon) {
|
|
8175
|
+
if (props.renderIcon && isFunction(props.renderIcon)) {
|
|
8176
|
+
return props.renderIcon(params);
|
|
8177
|
+
}
|
|
8178
|
+
}
|
|
8179
|
+
return icon;
|
|
8180
|
+
};
|
|
8181
|
+
const treeData = computed(() => {
|
|
8182
|
+
const data = cloneDeep(getTreeData.value);
|
|
8183
|
+
eachTree(data, (item, _parent) => {
|
|
8184
|
+
const searchText = searchState.searchText;
|
|
8185
|
+
const {
|
|
8186
|
+
highlight
|
|
8187
|
+
} = unref(props);
|
|
8188
|
+
const {
|
|
8189
|
+
title: titleField,
|
|
8190
|
+
key: keyField,
|
|
8191
|
+
children: childrenField
|
|
8192
|
+
} = unref(getFieldNames);
|
|
8193
|
+
const icon = getIcon(item, item.icon);
|
|
8194
|
+
const title = get(item, titleField);
|
|
8195
|
+
const searchIdx = searchText ? title.indexOf(searchText) : -1;
|
|
8196
|
+
const isHighlight = searchState.startSearch && !isEmpty(searchText) && highlight && searchIdx !== -1;
|
|
8197
|
+
const highlightStyle = `color: ${isBoolean(highlight) ? "#f50" : highlight}`;
|
|
8198
|
+
const titleDom = isHighlight ? createVNode("span", {
|
|
8199
|
+
"class": "tree-content"
|
|
8200
|
+
}, [createVNode("span", null, [title.substr(0, searchIdx)]), createVNode("span", {
|
|
8201
|
+
"style": highlightStyle
|
|
8202
|
+
}, [searchText]), createVNode("span", null, [title.substr(searchIdx + searchText.length)])]) : title;
|
|
8203
|
+
item[titleField] = createVNode("span", {
|
|
8204
|
+
"class": "tree-title",
|
|
8205
|
+
"onClick": handleClickNode.bind(null, item[keyField], item[childrenField], item)
|
|
8206
|
+
}, [(slots == null ? void 0 : slots.title) ? getSlot(slots, "title", item) : createVNode(Fragment, null, [icon && createVNode("i", {
|
|
8207
|
+
"class": `i ${icon}`
|
|
8208
|
+
}, null), titleDom, createVNode("span", {
|
|
8209
|
+
"class": "tree-action"
|
|
8210
|
+
}, [renderAction(item)])])]);
|
|
8211
|
+
});
|
|
8212
|
+
return data;
|
|
8213
|
+
});
|
|
8214
|
+
const showTitle = computed(() => {
|
|
8215
|
+
return true;
|
|
8216
|
+
});
|
|
8217
|
+
const getBindValues = computed(() => {
|
|
8218
|
+
let propsData = {
|
|
8219
|
+
blockNode: true,
|
|
8220
|
+
...attrs,
|
|
8221
|
+
...props,
|
|
8222
|
+
expandedKeys: state.expandedKeys,
|
|
8223
|
+
selectedKeys: state.selectedKeys,
|
|
8224
|
+
checkedKeys: state.checkedKeys,
|
|
8225
|
+
checkStrictly: state.checkStrictly,
|
|
8226
|
+
fieldNames: unref(getFieldNames),
|
|
8227
|
+
"onUpdate:expandedKeys": (v) => {
|
|
8228
|
+
state.expandedKeys = v;
|
|
8229
|
+
emit("update:expandedKeys", v);
|
|
8230
|
+
},
|
|
8231
|
+
"onUpdate:selectedKeys": (v) => {
|
|
8232
|
+
state.selectedKeys = v;
|
|
8233
|
+
emit("update:selectedKeys", v);
|
|
8234
|
+
},
|
|
8235
|
+
onCheck: (v, e) => {
|
|
8236
|
+
let currentValue = toRaw(state.checkedKeys);
|
|
8237
|
+
if (isArray$1(currentValue) && searchState.startSearch) {
|
|
8238
|
+
const {
|
|
8239
|
+
key
|
|
8240
|
+
} = unref(getFieldNames);
|
|
8241
|
+
currentValue = difference(currentValue, getChildrenKeys(e.node.$attrs.node[key]));
|
|
8242
|
+
if (e.checked) {
|
|
8243
|
+
currentValue.push(e.node.$attrs.node[key]);
|
|
8244
|
+
}
|
|
8245
|
+
state.checkedKeys = currentValue;
|
|
8246
|
+
} else {
|
|
8247
|
+
state.checkedKeys = v;
|
|
8248
|
+
}
|
|
8249
|
+
const rawVal = toRaw(state.checkedKeys);
|
|
8250
|
+
emit("update:value", rawVal);
|
|
8251
|
+
emit("check", rawVal, e);
|
|
8252
|
+
}
|
|
8253
|
+
};
|
|
8254
|
+
return omit(propsData, "treeData", "class");
|
|
8255
|
+
});
|
|
8256
|
+
function handleClickNode(key, children, node) {
|
|
8257
|
+
emit("clickNode", node);
|
|
8258
|
+
if (!props.clickRowToExpand || !children || children.length === 0)
|
|
8259
|
+
return;
|
|
8260
|
+
if (!state.expandedKeys.includes(key)) {
|
|
8261
|
+
setExpandedKeys([...state.expandedKeys, key]);
|
|
8262
|
+
} else {
|
|
8263
|
+
const keys = [...state.expandedKeys];
|
|
8264
|
+
const index = keys.findIndex((item) => item === key);
|
|
8265
|
+
if (index !== -1) {
|
|
8266
|
+
keys.splice(index, 1);
|
|
8267
|
+
}
|
|
8268
|
+
setExpandedKeys(keys);
|
|
8269
|
+
}
|
|
8270
|
+
}
|
|
8271
|
+
function renderAction(node) {
|
|
8272
|
+
const {
|
|
8273
|
+
actionList
|
|
8274
|
+
} = props;
|
|
8275
|
+
if (!actionList || actionList.length === 0)
|
|
8276
|
+
return;
|
|
8277
|
+
return actionList.map((item, index) => {
|
|
8278
|
+
var _a;
|
|
8279
|
+
let nodeShow = true;
|
|
8280
|
+
if (isFunction(item.show)) {
|
|
8281
|
+
nodeShow = (_a = item.show) == null ? void 0 : _a.call(item, node);
|
|
8282
|
+
} else if (isBoolean(item.show)) {
|
|
8283
|
+
nodeShow = item.show;
|
|
8284
|
+
}
|
|
8285
|
+
if (!nodeShow)
|
|
8286
|
+
return null;
|
|
8287
|
+
return createVNode("span", {
|
|
8288
|
+
"key": index,
|
|
8289
|
+
"class": "tree-action"
|
|
8290
|
+
}, [item.render(node)]);
|
|
8291
|
+
});
|
|
8292
|
+
}
|
|
8293
|
+
const {
|
|
8294
|
+
deleteNodeByKey,
|
|
8295
|
+
insertNodeByKey,
|
|
8296
|
+
insertNodesByKey,
|
|
8297
|
+
filterByLevel,
|
|
8298
|
+
updateNodeByKey,
|
|
8299
|
+
getAllKeys,
|
|
8300
|
+
getChildrenKeys,
|
|
8301
|
+
getEnabledKeys,
|
|
8302
|
+
getSelectedNode
|
|
8303
|
+
} = useTree(treeDataRef, getFieldNames);
|
|
8304
|
+
function setExpandedKeys(keys) {
|
|
8305
|
+
state.expandedKeys = keys;
|
|
8306
|
+
}
|
|
8307
|
+
function getExpandedKeys() {
|
|
8308
|
+
return state.expandedKeys;
|
|
8309
|
+
}
|
|
8310
|
+
function setSelectedKeys(keys) {
|
|
8311
|
+
state.selectedKeys = keys;
|
|
8312
|
+
}
|
|
8313
|
+
function getSelectedKeys() {
|
|
8314
|
+
return state.selectedKeys;
|
|
8315
|
+
}
|
|
8316
|
+
function setCheckedKeys(keys) {
|
|
8317
|
+
state.checkedKeys = keys;
|
|
8318
|
+
}
|
|
8319
|
+
function getCheckedKeys() {
|
|
8320
|
+
return state.checkedKeys;
|
|
8321
|
+
}
|
|
8322
|
+
function checkAll(checkAll2) {
|
|
8323
|
+
state.checkedKeys = checkAll2 ? getEnabledKeys() : [];
|
|
8324
|
+
}
|
|
8325
|
+
function expandAll(expandAll2) {
|
|
8326
|
+
state.expandedKeys = expandAll2 ? getAllKeys() : [];
|
|
8327
|
+
}
|
|
8328
|
+
function onStrictlyChange(strictly) {
|
|
8329
|
+
state.checkStrictly = strictly;
|
|
8330
|
+
}
|
|
8331
|
+
const instance = {
|
|
8332
|
+
setExpandedKeys,
|
|
8333
|
+
getExpandedKeys,
|
|
8334
|
+
setSelectedKeys,
|
|
8335
|
+
getSelectedKeys,
|
|
8336
|
+
setCheckedKeys,
|
|
8337
|
+
getCheckedKeys,
|
|
8338
|
+
insertNodeByKey,
|
|
8339
|
+
insertNodesByKey,
|
|
8340
|
+
deleteNodeByKey,
|
|
8341
|
+
updateNodeByKey,
|
|
8342
|
+
getSelectedNode,
|
|
8343
|
+
checkAll,
|
|
8344
|
+
expandAll,
|
|
8345
|
+
onStrictlyChange,
|
|
8346
|
+
filterByLevel: (level) => {
|
|
8347
|
+
state.expandedKeys = filterByLevel(level);
|
|
8348
|
+
},
|
|
8349
|
+
setSearchValue: (value) => {
|
|
8350
|
+
handleSearch(value);
|
|
8351
|
+
},
|
|
8352
|
+
getSearchValue: () => {
|
|
8353
|
+
return searchState.searchText;
|
|
8354
|
+
}
|
|
8355
|
+
};
|
|
8356
|
+
function handleSearch(searchValue) {
|
|
8357
|
+
if (searchValue !== searchState.searchText)
|
|
8358
|
+
searchState.searchText = searchValue;
|
|
8359
|
+
emit("update:searchValue", searchValue);
|
|
8360
|
+
if (!searchValue) {
|
|
8361
|
+
searchState.startSearch = false;
|
|
8362
|
+
return;
|
|
8363
|
+
}
|
|
8364
|
+
const {
|
|
8365
|
+
filterFn,
|
|
8366
|
+
checkable,
|
|
8367
|
+
expandOnSearch,
|
|
8368
|
+
checkOnSearch,
|
|
8369
|
+
selectedOnSearch
|
|
8370
|
+
} = unref(props);
|
|
8371
|
+
const {
|
|
8372
|
+
title: titleField,
|
|
8373
|
+
key: keyField
|
|
8374
|
+
} = unref(getFieldNames);
|
|
8375
|
+
const matchedKeys = [];
|
|
8376
|
+
searchState.startSearch = true;
|
|
8377
|
+
searchState.searchData = filter(unref(treeDataRef), (node) => {
|
|
8378
|
+
var _a, _b;
|
|
8379
|
+
const result = filterFn ? filterFn(searchValue, node, unref(getFieldNames)) : (_b = (_a = node[titleField]) == null ? void 0 : _a.includes(searchValue)) != null ? _b : false;
|
|
8380
|
+
if (result) {
|
|
8381
|
+
matchedKeys.push(node[keyField]);
|
|
8382
|
+
}
|
|
8383
|
+
return result;
|
|
8384
|
+
}, unref(getFieldNames));
|
|
8385
|
+
if (expandOnSearch) {
|
|
8386
|
+
const expandKeys = treeToList(searchState.searchData).map((val) => {
|
|
8387
|
+
return val[keyField];
|
|
8388
|
+
});
|
|
8389
|
+
if (expandKeys && expandKeys.length) {
|
|
8390
|
+
setExpandedKeys(expandKeys);
|
|
8391
|
+
}
|
|
8392
|
+
}
|
|
8393
|
+
if (checkOnSearch && checkable && matchedKeys.length) {
|
|
8394
|
+
setCheckedKeys(matchedKeys);
|
|
8395
|
+
}
|
|
8396
|
+
if (selectedOnSearch && matchedKeys.length) {
|
|
8397
|
+
setSelectedKeys(matchedKeys);
|
|
8398
|
+
}
|
|
8399
|
+
}
|
|
8400
|
+
watch(() => props.searchValue, (val) => {
|
|
8401
|
+
if (val !== searchState.searchText) {
|
|
8402
|
+
searchState.searchText = val;
|
|
8403
|
+
}
|
|
8404
|
+
}, {
|
|
8405
|
+
immediate: true
|
|
8406
|
+
});
|
|
8407
|
+
watch(() => props.treeData, (val) => {
|
|
8408
|
+
if (val) {
|
|
8409
|
+
handleSearch(searchState.searchText);
|
|
8410
|
+
}
|
|
8411
|
+
});
|
|
8412
|
+
watch(() => props.value, () => {
|
|
8413
|
+
state.checkedKeys = toRaw(props.value || []);
|
|
8414
|
+
}, {
|
|
8415
|
+
immediate: true
|
|
8416
|
+
});
|
|
8417
|
+
watch(() => state.checkedKeys, () => {
|
|
8418
|
+
const v = toRaw(state.checkedKeys);
|
|
8419
|
+
emit("update:value", v);
|
|
8420
|
+
emit("change", v);
|
|
8421
|
+
});
|
|
8422
|
+
watchEffect(() => {
|
|
8423
|
+
treeDataRef.value = props.treeData;
|
|
8424
|
+
});
|
|
8425
|
+
watchEffect(() => {
|
|
8426
|
+
state.expandedKeys = props.expandedKeys;
|
|
8427
|
+
});
|
|
8428
|
+
watchEffect(() => {
|
|
8429
|
+
state.selectedKeys = props.selectedKeys;
|
|
8430
|
+
});
|
|
8431
|
+
watchEffect(() => {
|
|
8432
|
+
state.checkedKeys = props.checkedKeys;
|
|
8433
|
+
});
|
|
8434
|
+
watchEffect(() => {
|
|
8435
|
+
state.checkStrictly = props.checkStrictly;
|
|
8436
|
+
});
|
|
8437
|
+
expose(instance);
|
|
8438
|
+
return (_ctx, _cache) => {
|
|
8439
|
+
return openBlock(), createElementBlock("div", _hoisted_1$h, [unref(showTitle) ? (openBlock(), createBlock(_sfc_main$w, {
|
|
8440
|
+
key: 0,
|
|
8441
|
+
title: _ctx.title,
|
|
8442
|
+
toolbar: _ctx.toolbar,
|
|
8443
|
+
search: _ctx.search,
|
|
8444
|
+
checkable: _ctx.checkable,
|
|
8445
|
+
searchText: searchState.searchText,
|
|
8446
|
+
checkAll,
|
|
8447
|
+
expandAll,
|
|
8448
|
+
onSearch: handleSearch
|
|
8449
|
+
}, {
|
|
8450
|
+
default: withCtx(() => [createTextVNode(toDisplayString(unref(extendSlots)(unref(slots))), 1)]),
|
|
8451
|
+
_: 1
|
|
8452
|
+
}, 8, ["title", "toolbar", "search", "checkable", "searchText"])) : createCommentVNode("", true), createVNode(unref(Spin), {
|
|
8453
|
+
spinning: _ctx.loading,
|
|
8454
|
+
tip: "\u52A0\u8F7D\u4E2D..."
|
|
8455
|
+
}, {
|
|
8456
|
+
default: withCtx(() => [withDirectives(createElementVNode("div", null, [createVNode(unref(Tree), mergeProps(unref(getBindValues), {
|
|
8457
|
+
showIcon: false,
|
|
8458
|
+
treeData: unref(treeData)
|
|
8459
|
+
}), null, 16, ["treeData"])], 512), [[vShow, !unref(getNotFound)]]), withDirectives(createVNode(unref(Empty), null, null, 512), [[vShow, unref(getNotFound)]])]),
|
|
8460
|
+
_: 1
|
|
8461
|
+
}, 8, ["spinning"])]);
|
|
8462
|
+
};
|
|
8463
|
+
}
|
|
8464
|
+
});
|
|
8465
|
+
const dtComponents = [
|
|
8466
|
+
{ name: "dt-base-router", component: DtBaseRouter },
|
|
8467
|
+
{ name: "dt-icon", component: DtIcon },
|
|
8468
|
+
{ name: "dt-pick-icon", component: _sfc_main$W },
|
|
8469
|
+
{ name: "dt-modal", component: _sfc_main$L },
|
|
8470
|
+
{ name: "dt-form", component: DtForm },
|
|
8471
|
+
{ name: "dt-upload", component: _sfc_main$y },
|
|
8472
|
+
{ name: "dt-upload-modal", component: _sfc_main$x },
|
|
8473
|
+
{ name: "dt-tree", component: _sfc_main$v }
|
|
8474
|
+
];
|
|
8475
|
+
function initComponents() {
|
|
8476
|
+
return {
|
|
8477
|
+
install(app) {
|
|
8478
|
+
dtComponents.forEach((comp) => app.component(comp.name, comp));
|
|
8479
|
+
}
|
|
8480
|
+
};
|
|
8481
|
+
}
|
|
8482
|
+
const _sfc_main$u = /* @__PURE__ */ defineComponent({
|
|
8483
|
+
__name: "back-top",
|
|
8484
|
+
setup(__props) {
|
|
8485
|
+
const getTarget = () => document.getElementById("dt-layout-content");
|
|
8486
|
+
const { getShowBackToTop } = useTheme();
|
|
8487
|
+
return (_ctx, _cache) => {
|
|
8488
|
+
return unref(getShowBackToTop) ? (openBlock(), createBlock(unref(BackTop), {
|
|
8489
|
+
key: 0,
|
|
8490
|
+
target: getTarget,
|
|
8491
|
+
visibilityHeight: 300
|
|
8492
|
+
})) : createCommentVNode("", true);
|
|
8493
|
+
};
|
|
8494
|
+
}
|
|
8495
|
+
});
|
|
8496
|
+
const _sfc_main$t = /* @__PURE__ */ defineComponent({
|
|
8497
|
+
__name: "index",
|
|
8498
|
+
setup(__props) {
|
|
8499
|
+
return (_ctx, _cache) => {
|
|
8500
|
+
return openBlock(), createBlock(_sfc_main$u);
|
|
8501
|
+
};
|
|
8502
|
+
}
|
|
8503
|
+
});
|
|
8504
|
+
const _hoisted_1$g = { class: "dt-logo__title" };
|
|
8505
|
+
const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
8506
|
+
__name: "logo",
|
|
8507
|
+
props: {
|
|
8508
|
+
theme: { type: String, validator: (v) => ["light", "dark"].includes(v) },
|
|
8509
|
+
showTitle: { type: Boolean, default: true }
|
|
8510
|
+
},
|
|
8511
|
+
setup(__props) {
|
|
8512
|
+
const props = __props;
|
|
8513
|
+
const title = "\u9686\u57FA\u7A0E\u52A1\u540E\u53F0\u7BA1\u7406\u7CFB\u7EDF";
|
|
8514
|
+
const { getCollapsedShowTitle } = useMenu();
|
|
8515
|
+
const getLogoClass = computed(() => {
|
|
8516
|
+
return [
|
|
8517
|
+
"dt-logo",
|
|
8518
|
+
props.theme,
|
|
8519
|
+
{ "collapsed-show-title": unref(getCollapsedShowTitle) }
|
|
8520
|
+
];
|
|
8521
|
+
});
|
|
8522
|
+
return (_ctx, _cache) => {
|
|
8523
|
+
return openBlock(), createElementBlock("div", {
|
|
8524
|
+
class: normalizeClass(["dt-logo", unref(getLogoClass)])
|
|
8525
|
+
}, [
|
|
8526
|
+
createVNode(unref(DtIcon), {
|
|
8527
|
+
"icon-class": "logo",
|
|
8528
|
+
size: 42,
|
|
8529
|
+
"class-name": "brand-logo"
|
|
8530
|
+
}),
|
|
8531
|
+
withDirectives(createElementVNode("div", _hoisted_1$g, toDisplayString(title), 512), [
|
|
8532
|
+
[vShow, __props.showTitle]
|
|
8533
|
+
])
|
|
8534
|
+
], 2);
|
|
8535
|
+
};
|
|
8536
|
+
}
|
|
8537
|
+
});
|
|
8538
|
+
const _hoisted_1$f = { key: 0 };
|
|
8539
|
+
const _hoisted_2$9 = { key: 1 };
|
|
8540
|
+
const _sfc_main$r = /* @__PURE__ */ defineComponent({
|
|
8541
|
+
__name: "trigger",
|
|
8542
|
+
props: { theme: String },
|
|
6820
8543
|
setup(__props) {
|
|
6821
8544
|
const props = __props;
|
|
6822
8545
|
const { getCollapsed, toggleCollapsed } = useMenu();
|
|
@@ -6841,7 +8564,8 @@ function deleteChildrenProp(menu) {
|
|
|
6841
8564
|
return obj;
|
|
6842
8565
|
}
|
|
6843
8566
|
function getBreadCrumb(path, menus) {
|
|
6844
|
-
|
|
8567
|
+
var _a;
|
|
8568
|
+
const _menus = menus || ((_a = DtCache.getLocal(CacheKey.MENUS)) == null ? void 0 : _a.children) || [];
|
|
6845
8569
|
let routes = [];
|
|
6846
8570
|
let getParentByPath = (menu, path2 = "") => {
|
|
6847
8571
|
if (menu.children && menu.children.length) {
|
|
@@ -6860,20 +8584,21 @@ function getBreadCrumb(path, menus) {
|
|
|
6860
8584
|
});
|
|
6861
8585
|
return routes;
|
|
6862
8586
|
}
|
|
6863
|
-
function getFilterMenu(
|
|
8587
|
+
function getFilterMenu(filter2 = "", flag = false) {
|
|
8588
|
+
var _a;
|
|
6864
8589
|
let _menus = [];
|
|
6865
|
-
if (!trim(
|
|
8590
|
+
if (!trim(filter2) && !flag)
|
|
6866
8591
|
return _menus;
|
|
6867
8592
|
let getTargetMenus = (menusArr) => {
|
|
6868
8593
|
menusArr.forEach((menu) => {
|
|
6869
8594
|
if (menu.children && menu.children.length) {
|
|
6870
8595
|
getTargetMenus(menu.children);
|
|
6871
|
-
} else if (menu.label.indexOf(
|
|
8596
|
+
} else if (menu.label.indexOf(filter2) !== -1 || flag && !trim(filter2)) {
|
|
6872
8597
|
_menus.push(menu);
|
|
6873
8598
|
}
|
|
6874
8599
|
});
|
|
6875
8600
|
};
|
|
6876
|
-
getTargetMenus(DtCache.getLocal(CacheKey.MENUS));
|
|
8601
|
+
getTargetMenus((_a = DtCache.getLocal(CacheKey.MENUS)) == null ? void 0 : _a.children);
|
|
6877
8602
|
return _menus;
|
|
6878
8603
|
}
|
|
6879
8604
|
const _hoisted_1$e = { class: "dt-breadcrumb" };
|
|
@@ -7541,7 +9266,7 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
7541
9266
|
setup(__props) {
|
|
7542
9267
|
const menuList = ref([]);
|
|
7543
9268
|
const router = useRouter();
|
|
7544
|
-
const
|
|
9269
|
+
const filter2 = ref("");
|
|
7545
9270
|
const { getShowSearch } = useHeader();
|
|
7546
9271
|
const isUseDef = computed(() => {
|
|
7547
9272
|
return isBoolean(getShowSearch.value);
|
|
@@ -7550,16 +9275,16 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
7550
9275
|
if (e) {
|
|
7551
9276
|
filterMenu();
|
|
7552
9277
|
} else {
|
|
7553
|
-
|
|
9278
|
+
filter2.value = null;
|
|
7554
9279
|
}
|
|
7555
9280
|
}
|
|
7556
9281
|
function filterMenu() {
|
|
7557
|
-
menuList.value = getFilterMenu(
|
|
9282
|
+
menuList.value = getFilterMenu(filter2.value, true);
|
|
7558
9283
|
}
|
|
7559
9284
|
function navigation(url) {
|
|
7560
9285
|
router.push(url);
|
|
7561
9286
|
setTimeout(() => {
|
|
7562
|
-
|
|
9287
|
+
filter2.value = "";
|
|
7563
9288
|
menuList.value = [];
|
|
7564
9289
|
});
|
|
7565
9290
|
}
|
|
@@ -7586,8 +9311,8 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
7586
9311
|
]),
|
|
7587
9312
|
default: withCtx(() => [
|
|
7588
9313
|
createVNode(unref(InputSearch), {
|
|
7589
|
-
value:
|
|
7590
|
-
"onUpdate:value": _cache[0] || (_cache[0] = ($event) =>
|
|
9314
|
+
value: filter2.value,
|
|
9315
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => filter2.value = $event),
|
|
7591
9316
|
placeholder: "\u641C\u7D22...",
|
|
7592
9317
|
onInput: filterMenu
|
|
7593
9318
|
}, null, 8, ["value"])
|
|
@@ -7627,8 +9352,9 @@ function useSplitMenu(splitType) {
|
|
|
7627
9352
|
menusRef.value = (_a = menusMap.filter((it) => it.includesPath.includes(path))[0]) == null ? void 0 : _a.children;
|
|
7628
9353
|
}
|
|
7629
9354
|
async function getMenus2() {
|
|
9355
|
+
var _a;
|
|
7630
9356
|
if (unref(normalType)) {
|
|
7631
|
-
menusRef.value = DtCache.getLocal(CacheKey.MENUS);
|
|
9357
|
+
menusRef.value = (_a = DtCache.getLocal(CacheKey.MENUS)) == null ? void 0 : _a.children;
|
|
7632
9358
|
return;
|
|
7633
9359
|
}
|
|
7634
9360
|
if (unref(getSplitTop)) {
|
|
@@ -7641,7 +9367,8 @@ function useSplitMenu(splitType) {
|
|
|
7641
9367
|
return { menusRef };
|
|
7642
9368
|
}
|
|
7643
9369
|
async function getMenus() {
|
|
7644
|
-
|
|
9370
|
+
var _a;
|
|
9371
|
+
return (_a = DtCache.getLocal(CacheKey.MENUS)) == null ? void 0 : _a.children;
|
|
7645
9372
|
}
|
|
7646
9373
|
function getFirstMenuPath(item) {
|
|
7647
9374
|
let isFind = false, path = "";
|
|
@@ -8031,7 +9758,7 @@ var _sfc_main$b = defineComponent({
|
|
|
8031
9758
|
}), null);
|
|
8032
9759
|
}
|
|
8033
9760
|
return () => {
|
|
8034
|
-
return createVNode(Fragment, null, [renderHeader(), unref(getUseScroll) ? createVNode(_sfc_main$
|
|
9761
|
+
return createVNode(Fragment, null, [renderHeader(), unref(getUseScroll) ? createVNode(_sfc_main$U, null, {
|
|
8035
9762
|
default: () => renderMenu()
|
|
8036
9763
|
}) : renderMenu()]);
|
|
8037
9764
|
};
|
|
@@ -8366,10 +10093,10 @@ function useTabDropdown() {
|
|
|
8366
10093
|
const { path, meta } = unref(currentRoute);
|
|
8367
10094
|
const curItem = state.current;
|
|
8368
10095
|
const isCurItem = curItem ? curItem.path === path : false;
|
|
8369
|
-
const
|
|
8370
|
-
const closeLeftDisabled =
|
|
10096
|
+
const index = state.currentIndex;
|
|
10097
|
+
const closeLeftDisabled = index === 0 || !isCurItem;
|
|
8371
10098
|
const disabled = tabStore.getTabList.length === 1;
|
|
8372
|
-
const closeRightDisabled = !isCurItem ||
|
|
10099
|
+
const closeRightDisabled = !isCurItem || index === tabStore.getTabList.length - 1 && tabStore.getLastDragEndIndex >= 0;
|
|
8373
10100
|
const dropMenuList = [
|
|
8374
10101
|
{
|
|
8375
10102
|
icon: "ic:baseline-close",
|
|
@@ -8410,9 +10137,9 @@ function useTabDropdown() {
|
|
|
8410
10137
|
function handleContext(e) {
|
|
8411
10138
|
e == null ? void 0 : e.preventDefault();
|
|
8412
10139
|
const { path } = unref(currentRoute);
|
|
8413
|
-
const
|
|
10140
|
+
const index = tabStore.getTabList.findIndex((tab) => tab.path === path);
|
|
8414
10141
|
state.current = unref(currentRoute);
|
|
8415
|
-
state.currentIndex =
|
|
10142
|
+
state.currentIndex = index;
|
|
8416
10143
|
}
|
|
8417
10144
|
function handleMenuEvent(item) {
|
|
8418
10145
|
var _a;
|
|
@@ -8440,8 +10167,8 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
8440
10167
|
overlay: withCtx(() => [
|
|
8441
10168
|
createVNode(unref(Menu), null, {
|
|
8442
10169
|
default: withCtx(() => [
|
|
8443
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getDropMenuList), (item,
|
|
8444
|
-
return openBlock(), createElementBlock(Fragment, { key:
|
|
10170
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(unref(getDropMenuList), (item, index) => {
|
|
10171
|
+
return openBlock(), createElementBlock(Fragment, { key: index }, [
|
|
8445
10172
|
createVNode(unref(MenuItem), {
|
|
8446
10173
|
onClick: ($event) => unref(handleMenuEvent)(item),
|
|
8447
10174
|
disabled: item.disabled
|
|
@@ -8455,7 +10182,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
8455
10182
|
_: 2
|
|
8456
10183
|
}, 1032, ["onClick", "disabled"]),
|
|
8457
10184
|
item.divider ? (openBlock(), createBlock(unref(MenuDivider), {
|
|
8458
|
-
key: `d-${
|
|
10185
|
+
key: `d-${index}`
|
|
8459
10186
|
})) : createCommentVNode("", true)
|
|
8460
10187
|
], 64);
|
|
8461
10188
|
}), 128))
|
|
@@ -8875,7 +10602,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8875
10602
|
}, {
|
|
8876
10603
|
default: withCtx(() => [
|
|
8877
10604
|
unref(getShowSidebar) ? (openBlock(), createBlock(_sfc_main$7, { key: 0 })) : createCommentVNode("", true),
|
|
8878
|
-
createVNode(unref(_sfc_main$
|
|
10605
|
+
createVNode(unref(_sfc_main$U), {
|
|
8879
10606
|
ref_key: "wrapperRef",
|
|
8880
10607
|
ref: wrapperRef,
|
|
8881
10608
|
class: normalizeClass({ "fixedWrap": unref(getFixed) })
|
|
@@ -8908,4 +10635,4 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
8908
10635
|
};
|
|
8909
10636
|
}
|
|
8910
10637
|
});
|
|
8911
|
-
export { DtBaseRouter, DtForm, DtIcon, _sfc_main$
|
|
10638
|
+
export { DtBaseRouter, DtForm, DtIcon, _sfc_main$z as DtIframe, _sfc_main$L as DtModal, _sfc_main$W 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 };
|