@dt-frames/ui 2.0.6 → 2.0.8
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/index.js +42 -67
- package/es/components/curd/src/components/Curd.d.ts +2 -8
- package/es/components/curd/src/hooks/useCurd.d.ts +3 -3
- package/es/components/curd/src/props.d.ts +1 -4
- package/es/components/curd/src/types/curd.type.d.ts +3 -9
- package/es/components/form/index.d.ts +30 -54
- package/es/components/form/index.js +74 -41
- package/es/components/form/index.less +1 -0
- package/es/components/form/src/components/FormButtons.d.ts +3 -3
- package/es/components/form/src/components/FormItem.d.ts +5 -8
- package/es/components/form/src/components/formIcon.d.ts +4 -4
- package/es/components/form/src/components/formInputUseDialog.d.ts +3 -3
- package/es/components/form/src/hooks/useFormEvent.d.ts +1 -1
- package/es/components/form/src/index.d.ts +24 -42
- package/es/components/form/src/props.d.ts +5 -8
- package/es/components/modal/index.js +3 -6
- package/es/components/modal/src/components/ModalFooter.d.ts +3 -3
- package/es/components/modal/src/index.d.ts +9 -9
- package/es/components/source/hooks/useSource.d.ts +14 -13
- package/es/components/source/index.js +62 -36
- package/es/components/table/index.js +151 -158
- package/es/components/table/src/index.d.ts +18 -54
- package/es/components/table/src/props.d.ts +6 -18
- package/es/components/table/src/types/table.type.d.ts +1 -4
- package/es/theme/index.d.ts +2 -2
- package/es/theme/index.js +299 -294
- package/es/theme/src/components/sider/index.d.ts +2 -1
- package/es/theme/src/components/sider/mix-sider.d.ts +2 -1
- package/es/theme/src/hooks/useMenu.d.ts +1 -1
- package/es/theme/src/index.d.ts +2 -1
- package/es/theme/src/types/theme.type.d.ts +0 -1
- package/index.js +3 -1
- package/package.json +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { DtCache, CacheKey, deepMerge, Pages, useGo, useRedo, Language, useAppStore, useSlots, error, http, useApp, getDynamicProps, isBoolean, isFunction, getPopupContainer, useI18n, isNumber, isArray, isObject, isString, dispatchResize, useTimeoutFn, off, on, windowResizeFn, useMessage, isNullAndUnDef, getDictValueByCode, formatNumber, isVnode } from "@dt-frames/core";
|
|
2
2
|
import { toRaw as toRaw$1, unref, computed, useSlots as useSlots$1, ref, watch, onUnmounted, defineComponent, useAttrs, resolveDirective, openBlock, createElementBlock, Fragment, renderList, withDirectives, createVNode, withCtx, createTextVNode, toDisplayString, createElementVNode, normalizeClass, normalizeStyle, createCommentVNode, createBlock, provide, inject, h as h$1, mergeProps, nextTick, getCurrentInstance, reactive, readonly, watchEffect, isRef, normalizeProps, guardReactiveProps, toRefs, isVNode, onMounted, onBeforeUnmount, resolveDynamicComponent, renderSlot, createSlots } from "vue";
|
|
3
3
|
import { defineStore } from "pinia";
|
|
4
|
+
import { cloneDeep, omit, isEqual } from "lodash-es";
|
|
4
5
|
import { Tooltip, MenuItem, Menu, Dropdown, RadioButton, RadioGroup, Button, FormItem, Col, Spin, Checkbox as Checkbox$1, Divider as Divider$1, Row, CheckboxGroup, Popover as Popover$1, Table } from "ant-design-vue/es";
|
|
5
6
|
import "ant-design-vue/es/table/style";
|
|
6
|
-
import { omit, cloneDeep, isEqual } from "lodash-es";
|
|
7
7
|
import "ant-design-vue/es/dropdown/style";
|
|
8
8
|
import "ant-design-vue/es/menu/style";
|
|
9
9
|
import "ant-design-vue/es/tooltip/style";
|
|
10
10
|
import { useDebounceFn, useFullscreen, isFunction as isFunction$1 } from "@vueuse/core";
|
|
11
|
-
import { Input, InputNumber, Select, TreeSelect, Switch, Checkbox, DatePicker, TimePicker, Popover, Radio, AutoComplete, Cascader, Slider, Rate, Divider, Modal
|
|
11
|
+
import { Input, InputNumber, Select, TreeSelect, Switch, Checkbox, DatePicker, TimePicker, Popover, Radio, AutoComplete, Cascader, Slider, Rate, Divider, Modal } from "ant-design-vue";
|
|
12
12
|
import "ant-design-vue/es/radio/style";
|
|
13
13
|
import "ant-design-vue/es/cascader/style";
|
|
14
14
|
import "ant-design-vue/es/input-number/style";
|
|
@@ -100,7 +100,7 @@ const defaultThemeConf = {
|
|
|
100
100
|
},
|
|
101
101
|
routeReuse: {
|
|
102
102
|
show: true,
|
|
103
|
-
cache:
|
|
103
|
+
cache: false,
|
|
104
104
|
canDrag: true,
|
|
105
105
|
showQuick: true,
|
|
106
106
|
showRedo: true,
|
|
@@ -110,7 +110,7 @@ const defaultThemeConf = {
|
|
|
110
110
|
const useThemeStore = defineStore({
|
|
111
111
|
id: "dt-theme",
|
|
112
112
|
state: () => ({
|
|
113
|
-
themeConf: DtCache.getLocal(CacheKey.THEME) ?? defaultThemeConf,
|
|
113
|
+
themeConf: DtCache.getLocal(CacheKey.THEME) ?? cloneDeep(defaultThemeConf),
|
|
114
114
|
pageLoading: false,
|
|
115
115
|
mixSiderHasSubMenu: false
|
|
116
116
|
}),
|
|
@@ -145,14 +145,22 @@ const useThemeStore = defineStore({
|
|
|
145
145
|
},
|
|
146
146
|
setMixSiderIsHasMenu(val) {
|
|
147
147
|
this.mixSiderHasSubMenu = val;
|
|
148
|
+
},
|
|
149
|
+
resetState() {
|
|
150
|
+
DtCache.removeLocal(CacheKey.THEME);
|
|
151
|
+
this.themeConf = cloneDeep(defaultThemeConf);
|
|
148
152
|
}
|
|
149
153
|
}
|
|
150
154
|
});
|
|
155
|
+
function handleGotoPage(router) {
|
|
156
|
+
const go = useGo(router);
|
|
157
|
+
go(unref(router.currentRoute).path, true);
|
|
158
|
+
}
|
|
151
159
|
defineStore({
|
|
152
160
|
id: "route-reuse",
|
|
153
161
|
state: () => ({
|
|
154
162
|
cacheTabList: /* @__PURE__ */ new Set(),
|
|
155
|
-
tabList: DtCache.getLocal(CacheKey.
|
|
163
|
+
tabList: DtCache.getLocal(CacheKey.ROUTE_REUSE) || [],
|
|
156
164
|
lastDragEndIndex: 0
|
|
157
165
|
}),
|
|
158
166
|
getters: {
|
|
@@ -173,8 +181,8 @@ defineStore({
|
|
|
173
181
|
return;
|
|
174
182
|
}
|
|
175
183
|
let updateIndex = -1;
|
|
176
|
-
const tabHasExits = this.tabList.some((tab,
|
|
177
|
-
updateIndex =
|
|
184
|
+
const tabHasExits = this.tabList.some((tab, index) => {
|
|
185
|
+
updateIndex = index;
|
|
178
186
|
return (tab.fullPath || tab.path) === (fullPath || path);
|
|
179
187
|
});
|
|
180
188
|
if (tabHasExits) {
|
|
@@ -188,20 +196,20 @@ defineStore({
|
|
|
188
196
|
}
|
|
189
197
|
this.updateCacheTab();
|
|
190
198
|
},
|
|
191
|
-
closeTab(
|
|
199
|
+
closeTab(route, router) {
|
|
192
200
|
const go = useGo(router);
|
|
193
|
-
const
|
|
201
|
+
const index = this.tabList.findIndex((item) => item.path === route.path);
|
|
194
202
|
let page;
|
|
195
|
-
if (
|
|
203
|
+
if (index === 0) {
|
|
196
204
|
if (this.tabList.length !== 1) {
|
|
197
|
-
page = this.tabList[
|
|
205
|
+
page = this.tabList[index + 1];
|
|
198
206
|
}
|
|
199
207
|
} else {
|
|
200
|
-
page = this.tabList[
|
|
208
|
+
page = this.tabList[index - 1];
|
|
201
209
|
}
|
|
202
|
-
this.bulkCloseTabs([path]);
|
|
210
|
+
this.bulkCloseTabs([route.path]);
|
|
203
211
|
this.updateCacheTab();
|
|
204
|
-
path === router.currentRoute.value.path && go(page.path);
|
|
212
|
+
route.path === router.currentRoute.value.path && go(page.path);
|
|
205
213
|
},
|
|
206
214
|
closeAllTab(currentRoute, router) {
|
|
207
215
|
const go = useGo(router);
|
|
@@ -211,10 +219,10 @@ defineStore({
|
|
|
211
219
|
this.updateCacheTab();
|
|
212
220
|
go(route.path);
|
|
213
221
|
},
|
|
214
|
-
closeLeftTabs(
|
|
215
|
-
const
|
|
216
|
-
if (
|
|
217
|
-
const leftTabs = this.tabList.slice(0,
|
|
222
|
+
closeLeftTabs(route, router) {
|
|
223
|
+
const index = this.tabList.findIndex((item) => item.path === route.path);
|
|
224
|
+
if (index > 0) {
|
|
225
|
+
const leftTabs = this.tabList.slice(0, index);
|
|
218
226
|
const pathList = [];
|
|
219
227
|
for (const item of leftTabs) {
|
|
220
228
|
const affix = item?.meta?.affix ?? false;
|
|
@@ -225,11 +233,12 @@ defineStore({
|
|
|
225
233
|
this.bulkCloseTabs(pathList);
|
|
226
234
|
}
|
|
227
235
|
this.updateCacheTab();
|
|
236
|
+
handleGotoPage(router);
|
|
228
237
|
},
|
|
229
|
-
closeRightTabs(
|
|
230
|
-
const
|
|
231
|
-
if (
|
|
232
|
-
const rightTabs = this.tabList.slice(
|
|
238
|
+
closeRightTabs(route, router) {
|
|
239
|
+
const index = this.tabList.findIndex((item) => item.path === route.path);
|
|
240
|
+
if (index >= 0 && index < this.tabList.length - 1) {
|
|
241
|
+
const rightTabs = this.tabList.slice(index + 1, this.tabList.length);
|
|
233
242
|
const pathList = [];
|
|
234
243
|
for (const item of rightTabs) {
|
|
235
244
|
const affix = item?.meta?.affix ?? false;
|
|
@@ -240,24 +249,40 @@ defineStore({
|
|
|
240
249
|
this.bulkCloseTabs(pathList);
|
|
241
250
|
}
|
|
242
251
|
this.updateCacheTab();
|
|
252
|
+
handleGotoPage(router);
|
|
243
253
|
},
|
|
244
|
-
closeOtherTabs(
|
|
254
|
+
closeOtherTabs(route, router) {
|
|
245
255
|
const pathList = [];
|
|
246
256
|
for (let item of this.tabList) {
|
|
247
257
|
const affix = item?.meta?.affix ?? false;
|
|
248
|
-
if (item.path !== path && !affix) {
|
|
258
|
+
if (item.path !== route.path && !affix) {
|
|
249
259
|
pathList.push(item.path);
|
|
250
260
|
}
|
|
251
261
|
}
|
|
252
262
|
this.bulkCloseTabs(pathList);
|
|
253
263
|
this.updateCacheTab();
|
|
264
|
+
handleGotoPage(router);
|
|
265
|
+
},
|
|
266
|
+
closeTabByKey(path, router) {
|
|
267
|
+
const go = useGo(router);
|
|
268
|
+
const index = this.tabList.findIndex((item) => item.path === path);
|
|
269
|
+
let page;
|
|
270
|
+
if (index === 0) {
|
|
271
|
+
if (this.tabList.length !== 1) {
|
|
272
|
+
page = this.tabList[index + 1];
|
|
273
|
+
}
|
|
274
|
+
} else {
|
|
275
|
+
page = this.tabList[index - 1];
|
|
276
|
+
}
|
|
277
|
+
this.bulkCloseTabs([path]);
|
|
278
|
+
this.updateCacheTab();
|
|
279
|
+
path === router.currentRoute.value.path && go(page.path);
|
|
254
280
|
},
|
|
255
281
|
bulkCloseTabs(pathList) {
|
|
256
282
|
this.tabList = this.tabList.filter((item) => !pathList.includes(item.fullPath));
|
|
257
283
|
},
|
|
258
284
|
updateCacheTab() {
|
|
259
|
-
|
|
260
|
-
cacheTab && DtCache.setLocal(CacheKey.ROUTE_REUSE, this.tabList);
|
|
285
|
+
DtCache.setLocal(CacheKey.ROUTE_REUSE, this.tabList);
|
|
261
286
|
const cacheMap = /* @__PURE__ */ new Set();
|
|
262
287
|
for (const tab of this.tabList) {
|
|
263
288
|
if (tab.meta?.hideTab) {
|
|
@@ -281,42 +306,46 @@ defineStore({
|
|
|
281
306
|
this.tabList.splice(oldIndex, 1);
|
|
282
307
|
this.tabList.splice(newIndex, 0, currentTab);
|
|
283
308
|
this.lastDragEndIndex = this.lastDragEndIndex + 1;
|
|
309
|
+
},
|
|
310
|
+
resetState() {
|
|
311
|
+
this.tabList = [];
|
|
312
|
+
this.updateCacheTab();
|
|
284
313
|
}
|
|
285
314
|
}
|
|
286
315
|
});
|
|
287
316
|
function useMenu() {
|
|
288
|
-
const {
|
|
289
|
-
const getCollapsedShowTitle = computed(() => getMenuConf.collapsedShowTitle);
|
|
290
|
-
const getIsSidebarType = computed(() => getMenuConf.type === MenuType.SIDE);
|
|
291
|
-
const getMenuFixed = computed(() => getMenuConf.fixed);
|
|
292
|
-
const getShowMenu = computed(() => getMenuConf.show);
|
|
317
|
+
const { setThemeConf } = useThemeStore();
|
|
318
|
+
const getCollapsedShowTitle = computed(() => useThemeStore().getMenuConf.collapsedShowTitle);
|
|
319
|
+
const getIsSidebarType = computed(() => useThemeStore().getMenuConf.type === MenuType.SIDE);
|
|
320
|
+
const getMenuFixed = computed(() => useThemeStore().getMenuConf.fixed);
|
|
321
|
+
const getShowMenu = computed(() => useThemeStore().getMenuConf.show);
|
|
293
322
|
const getShowSidebar = computed(() => {
|
|
294
323
|
return unref(getSplit) || unref(getShowMenu) && unref(getMenuMode) !== MenuMode.HORIZONTAL;
|
|
295
324
|
});
|
|
296
|
-
const getMenuHidden = computed(() => getMenuConf.hidden);
|
|
297
|
-
const getMenuTheme = computed(() => getMenuConf.theme);
|
|
298
|
-
const getTrigger = computed(() => getMenuConf.trigger);
|
|
299
|
-
const getCanDrag = computed(() => getMenuConf.canDrag);
|
|
325
|
+
const getMenuHidden = computed(() => useThemeStore().getMenuConf.hidden);
|
|
326
|
+
const getMenuTheme = computed(() => useThemeStore().getMenuConf.theme);
|
|
327
|
+
const getTrigger = computed(() => useThemeStore().getMenuConf.trigger);
|
|
328
|
+
const getCanDrag = computed(() => useThemeStore().getMenuConf.canDrag);
|
|
300
329
|
const getIsMixMode = computed(() => {
|
|
301
330
|
return unref(getMenuMode) === MenuMode.INLINE && unref(getMenuType) === MenuType.MIX;
|
|
302
331
|
});
|
|
303
332
|
const getIsMixSidebar = computed(() => unref(getMenuType) === MenuType.MIX_SIDEBAR);
|
|
304
333
|
const getMenuWidth = computed(() => {
|
|
305
334
|
if (unref(getIsMixMode)) {
|
|
306
|
-
return Number(getMenuConf.menuWidth) - 40;
|
|
335
|
+
return Number(useThemeStore().getMenuConf.menuWidth) - 40;
|
|
307
336
|
} else if (unref(getIsMixSidebar)) {
|
|
308
|
-
return Number(getMenuConf.menuWidth) - 10;
|
|
337
|
+
return Number(useThemeStore().getMenuConf.menuWidth) - 10;
|
|
309
338
|
} else {
|
|
310
|
-
return Number(getMenuConf.menuWidth);
|
|
339
|
+
return Number(useThemeStore().getMenuConf.menuWidth);
|
|
311
340
|
}
|
|
312
341
|
});
|
|
313
|
-
const getMixSideTrigger = computed(() => getMenuConf.mixSideTrigger);
|
|
314
|
-
const getLogoWidth = computed(() => unref(getIsMixSidebar) ? "80px" : getMenuConf.menuWidth);
|
|
315
|
-
const getMenuType = computed(() => getMenuConf.type);
|
|
342
|
+
const getMixSideTrigger = computed(() => useThemeStore().getMenuConf.mixSideTrigger);
|
|
343
|
+
const getLogoWidth = computed(() => unref(getIsMixSidebar) ? "80px" : useThemeStore().getMenuConf.menuWidth);
|
|
344
|
+
const getMenuType = computed(() => useThemeStore().getMenuConf.type);
|
|
316
345
|
const getIsTopMenu = computed(() => unref(getMenuType) === MenuType.TOP_MENU);
|
|
317
|
-
const getMenuMode = computed(() => getMenuConf.mode);
|
|
318
|
-
const getSplit = computed(() => getMenuConf.split);
|
|
319
|
-
const getCollapsed = computed(() => getMenuConf.collapsed);
|
|
346
|
+
const getMenuMode = computed(() => useThemeStore().getMenuConf.mode);
|
|
347
|
+
const getSplit = computed(() => useThemeStore().getMenuConf.split);
|
|
348
|
+
const getCollapsed = computed(() => useThemeStore().getMenuConf.collapsed);
|
|
320
349
|
const getIsHorizontal = computed(() => unref(getMenuMode) === MenuMode.HORIZONTAL);
|
|
321
350
|
const setThemeStore = (conf = {}) => setThemeConf(conf);
|
|
322
351
|
const toggleCollapsed = () => setThemeStore({
|
|
@@ -324,7 +353,7 @@ function useMenu() {
|
|
|
324
353
|
collapsed: !unref(getCollapsed)
|
|
325
354
|
}
|
|
326
355
|
});
|
|
327
|
-
const getMiniWidthNumber = computed(() => getMenuConf.collapsedShowTitle ? 80 : 48);
|
|
356
|
+
const getMiniWidthNumber = computed(() => useThemeStore().getMenuConf.collapsedShowTitle ? 80 : 48);
|
|
328
357
|
const getRealWidth = computed(() => {
|
|
329
358
|
return unref(getCollapsed) ? unref(getMiniWidthNumber) : unref(getMenuWidth);
|
|
330
359
|
});
|
|
@@ -631,10 +660,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
631
660
|
const actionBtns = ref([]);
|
|
632
661
|
function handleAction(it) {
|
|
633
662
|
if (isFunction(it.onClick)) {
|
|
634
|
-
it.onClick(
|
|
635
|
-
row: props2.record,
|
|
636
|
-
index: props2.index
|
|
637
|
-
});
|
|
663
|
+
it.onClick(props2.record, props2.index);
|
|
638
664
|
}
|
|
639
665
|
}
|
|
640
666
|
const attrs = useAttrs();
|
|
@@ -684,7 +710,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
684
710
|
}, 1024)
|
|
685
711
|
])), [
|
|
686
712
|
[_directive_auth, item.auth]
|
|
687
|
-
]) : createCommentVNode("
|
|
713
|
+
]) : createCommentVNode("", true)
|
|
688
714
|
], 64);
|
|
689
715
|
}), 256))
|
|
690
716
|
])) : (openBlock(), createBlock(_component_ADropdown, {
|
|
@@ -711,7 +737,7 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
711
737
|
createElementVNode("span", _hoisted_5$2, toDisplayString(item.label()), 1)
|
|
712
738
|
]),
|
|
713
739
|
_: 2
|
|
714
|
-
}, 1032, ["onClick"])) : createCommentVNode("
|
|
740
|
+
}, 1032, ["onClick"])) : createCommentVNode("", true)
|
|
715
741
|
])), [
|
|
716
742
|
[_directive_auth, item.auth]
|
|
717
743
|
]);
|
|
@@ -728,14 +754,6 @@ const _sfc_main$k = /* @__PURE__ */ defineComponent({
|
|
|
728
754
|
};
|
|
729
755
|
}
|
|
730
756
|
});
|
|
731
|
-
const _export_sfc = (sfc, props2) => {
|
|
732
|
-
const target = sfc.__vccOpts || sfc;
|
|
733
|
-
for (const [key, val] of props2) {
|
|
734
|
-
target[key] = val;
|
|
735
|
-
}
|
|
736
|
-
return target;
|
|
737
|
-
};
|
|
738
|
-
const TableAction = /* @__PURE__ */ _export_sfc(_sfc_main$k, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/TableAction.vue"]]);
|
|
739
757
|
const tableKey = Symbol("dt-page");
|
|
740
758
|
function createTableInstance(instance) {
|
|
741
759
|
provide(tableKey, instance);
|
|
@@ -830,9 +848,9 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
830
848
|
const val = unref(currentValueRef);
|
|
831
849
|
const value = isCheckValue ? isNumber(val) && isBoolean(val) ? val : !!val : val;
|
|
832
850
|
let compProps = props2.column?.editComponentProps ?? {};
|
|
833
|
-
const { record, column, index
|
|
851
|
+
const { record, column, index } = props2;
|
|
834
852
|
if (isFunction(compProps)) {
|
|
835
|
-
compProps = compProps({ text: val, record, column, index
|
|
853
|
+
compProps = compProps({ text: val, record, column, index }) ?? {};
|
|
836
854
|
}
|
|
837
855
|
if (unref(getComponent) === "InputNumber") {
|
|
838
856
|
compProps = {
|
|
@@ -912,9 +930,8 @@ const _sfc_main$j = /* @__PURE__ */ defineComponent({
|
|
|
912
930
|
};
|
|
913
931
|
}
|
|
914
932
|
});
|
|
915
|
-
const EditableCell = /* @__PURE__ */ _export_sfc(_sfc_main$j, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/editTable/EditTableCell.vue"]]);
|
|
916
933
|
function renderEditCell(column) {
|
|
917
|
-
return ({ text: value, record, index
|
|
934
|
+
return ({ text: value, record, index }) => {
|
|
918
935
|
record.onValid = async () => {
|
|
919
936
|
if (isArray(record?.validCbs)) {
|
|
920
937
|
const validFns = (record?.validCbs || []).map((fn) => fn());
|
|
@@ -942,11 +959,11 @@ function renderEditCell(column) {
|
|
|
942
959
|
}
|
|
943
960
|
return true;
|
|
944
961
|
};
|
|
945
|
-
return h(
|
|
962
|
+
return h(_sfc_main$j, {
|
|
946
963
|
value,
|
|
947
964
|
record,
|
|
948
965
|
column,
|
|
949
|
-
index
|
|
966
|
+
index
|
|
950
967
|
});
|
|
951
968
|
};
|
|
952
969
|
}
|
|
@@ -1003,15 +1020,15 @@ function handleIndexColumn(propsRef, getPaginationRef, columns) {
|
|
|
1003
1020
|
width: unref(getIsZH) ? 50 : 70,
|
|
1004
1021
|
title: t("NUMBER"),
|
|
1005
1022
|
align: "center",
|
|
1006
|
-
customRender: ({ index
|
|
1023
|
+
customRender: ({ index }) => {
|
|
1007
1024
|
const getPagination = unref(getPaginationRef);
|
|
1008
1025
|
const { appConf } = useAppStore();
|
|
1009
1026
|
const { defaultPageSize } = appConf.ui.table;
|
|
1010
1027
|
if (isBoolean(getPagination)) {
|
|
1011
|
-
return `${
|
|
1028
|
+
return `${index + 1}`;
|
|
1012
1029
|
}
|
|
1013
1030
|
const { current = 1, pageSize = defaultPageSize } = getPagination;
|
|
1014
|
-
return ((current < 1 ? 1 : current) - 1) * pageSize +
|
|
1031
|
+
return ((current < 1 ? 1 : current) - 1) * pageSize + index + 1;
|
|
1015
1032
|
},
|
|
1016
1033
|
...isFixedLeft ? {
|
|
1017
1034
|
fixed: "left"
|
|
@@ -1024,7 +1041,7 @@ function handleActionColumn(propsRef, columns) {
|
|
|
1024
1041
|
const { getIsZH } = useHeader();
|
|
1025
1042
|
const { t } = useI18n("UI");
|
|
1026
1043
|
let defaultButtons = [
|
|
1027
|
-
{ label: t("EDIT"), icon: "mdi:text-box-edit-outline", onClick: unref(propsRef).
|
|
1044
|
+
{ label: t("EDIT"), icon: "mdi:text-box-edit-outline", onClick: unref(propsRef).onOpenUpdateDialog },
|
|
1028
1045
|
{ label: t("DELETE"), icon: "mdi:delete-outline", onClick: unref(propsRef).onDelete, color: "#ed6f6f" }
|
|
1029
1046
|
];
|
|
1030
1047
|
const { operations = defaultButtons, expandMethodIcon = false } = unref(propsRef);
|
|
@@ -1049,13 +1066,13 @@ function handleActionColumn(propsRef, columns) {
|
|
|
1049
1066
|
};
|
|
1050
1067
|
columns.push({
|
|
1051
1068
|
...columnObj,
|
|
1052
|
-
customRender: ({ record, index
|
|
1069
|
+
customRender: ({ record, index }) => {
|
|
1053
1070
|
return h$1(
|
|
1054
|
-
|
|
1071
|
+
_sfc_main$k,
|
|
1055
1072
|
omit({
|
|
1056
1073
|
...columnObj,
|
|
1057
1074
|
record,
|
|
1058
|
-
index
|
|
1075
|
+
index
|
|
1059
1076
|
}, "align")
|
|
1060
1077
|
);
|
|
1061
1078
|
}
|
|
@@ -1092,7 +1109,7 @@ function useColumns(propsRef, getPaginationRef, tableElRef) {
|
|
|
1092
1109
|
const getColumnsRef = computed(() => {
|
|
1093
1110
|
const columns = cloneDeep(unref(columnsRef));
|
|
1094
1111
|
const { ellipsis } = unref(propsRef);
|
|
1095
|
-
columns.forEach((it,
|
|
1112
|
+
columns.forEach((it, index) => {
|
|
1096
1113
|
it.class = it.class ?? "";
|
|
1097
1114
|
if (!it.class.split(" ").includes("__column")) {
|
|
1098
1115
|
it.class = `${it.class} __column`;
|
|
@@ -1226,7 +1243,7 @@ function useColumns(propsRef, getPaginationRef, tableElRef) {
|
|
|
1226
1243
|
};
|
|
1227
1244
|
}
|
|
1228
1245
|
function useCustomRow(propsRef, { setSelectedRowKeys, getSelectedRowKeys, clearSelectedRowKeys, emits }) {
|
|
1229
|
-
const customRow = (record,
|
|
1246
|
+
const customRow = (record, index) => {
|
|
1230
1247
|
return {
|
|
1231
1248
|
onClick: (e) => {
|
|
1232
1249
|
e?.stopPropagation();
|
|
@@ -1280,19 +1297,19 @@ function useCustomRow(propsRef, { setSelectedRowKeys, getSelectedRowKeys, clearS
|
|
|
1280
1297
|
}
|
|
1281
1298
|
}
|
|
1282
1299
|
handleClick();
|
|
1283
|
-
emits("row-click", record,
|
|
1300
|
+
emits("row-click", record, index, e);
|
|
1284
1301
|
},
|
|
1285
1302
|
onDblclick: (event) => {
|
|
1286
|
-
emits("row-dbClick", record,
|
|
1303
|
+
emits("row-dbClick", record, index, event);
|
|
1287
1304
|
},
|
|
1288
1305
|
onContextmenu: (event) => {
|
|
1289
|
-
emits("row-contextmenu", record,
|
|
1306
|
+
emits("row-contextmenu", record, index, event);
|
|
1290
1307
|
},
|
|
1291
1308
|
onMouseenter: (event) => {
|
|
1292
|
-
emits("row-mouseenter", record,
|
|
1309
|
+
emits("row-mouseenter", record, index, event);
|
|
1293
1310
|
},
|
|
1294
1311
|
onMouseleave: (event) => {
|
|
1295
|
-
emits("row-mouseleave", record,
|
|
1312
|
+
emits("row-mouseleave", record, index, event);
|
|
1296
1313
|
}
|
|
1297
1314
|
};
|
|
1298
1315
|
};
|
|
@@ -1469,7 +1486,6 @@ const _sfc_main$i = /* @__PURE__ */ defineComponent({
|
|
|
1469
1486
|
};
|
|
1470
1487
|
}
|
|
1471
1488
|
});
|
|
1472
|
-
const RadioButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main$i, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/components/radioButton.vue"]]);
|
|
1473
1489
|
const _hoisted_1$9 = { class: "input-with-dialog" };
|
|
1474
1490
|
const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
1475
1491
|
__name: "formInputUseDialog",
|
|
@@ -1505,15 +1521,14 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
1505
1521
|
key: 0,
|
|
1506
1522
|
class: "i mdi:close-circle",
|
|
1507
1523
|
onClick: clearProps
|
|
1508
|
-
})) : createCommentVNode("
|
|
1524
|
+
})) : createCommentVNode("", true)
|
|
1509
1525
|
]);
|
|
1510
1526
|
};
|
|
1511
1527
|
}
|
|
1512
1528
|
});
|
|
1513
|
-
const DtFormInputDialog = /* @__PURE__ */ _export_sfc(_sfc_main$h, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/components/formInputUseDialog.vue"]]);
|
|
1514
1529
|
const components = {
|
|
1515
1530
|
Input,
|
|
1516
|
-
InputWithDialog:
|
|
1531
|
+
InputWithDialog: _sfc_main$h,
|
|
1517
1532
|
InputTextArea: Input.TextArea,
|
|
1518
1533
|
InputSearch: Input.Search,
|
|
1519
1534
|
InputGroup: Input.Group,
|
|
@@ -1522,7 +1537,7 @@ const components = {
|
|
|
1522
1537
|
TreeSelect,
|
|
1523
1538
|
Radio,
|
|
1524
1539
|
RadioGroup: Radio.Group,
|
|
1525
|
-
RadioButtonGroup,
|
|
1540
|
+
RadioButtonGroup: _sfc_main$i,
|
|
1526
1541
|
Checkbox,
|
|
1527
1542
|
CheckboxGroup: Checkbox.Group,
|
|
1528
1543
|
AutoComplete,
|
|
@@ -1664,18 +1679,18 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
1664
1679
|
icon: withCtx(() => [
|
|
1665
1680
|
button.preIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_1$8, null, 512)), [
|
|
1666
1681
|
[_directive_icon, button.preIcon]
|
|
1667
|
-
]) : createCommentVNode("
|
|
1682
|
+
]) : createCommentVNode("", true)
|
|
1668
1683
|
]),
|
|
1669
1684
|
default: withCtx(() => [
|
|
1670
1685
|
createTextVNode(" " + toDisplayString(unref(t)(button.label)) + " ", 1),
|
|
1671
1686
|
button.postIcon ? withDirectives((openBlock(), createElementBlock("span", _hoisted_2$2, null, 512)), [
|
|
1672
1687
|
[_directive_icon, button.postIcon]
|
|
1673
|
-
]) : createCommentVNode("
|
|
1688
|
+
]) : createCommentVNode("", true)
|
|
1674
1689
|
]),
|
|
1675
1690
|
_: 2
|
|
1676
1691
|
}, 1032, ["type", "class", "loading", "disabled", "onClick"])), [
|
|
1677
1692
|
[_directive_auth, button.auth]
|
|
1678
|
-
]) : createCommentVNode("
|
|
1693
|
+
]) : createCommentVNode("", true)
|
|
1679
1694
|
], 64);
|
|
1680
1695
|
}), 256)),
|
|
1681
1696
|
unref(showAdvanceRef) ? (openBlock(), createBlock(_component_AButton, {
|
|
@@ -1685,24 +1700,22 @@ const _sfc_main$g = /* @__PURE__ */ defineComponent({
|
|
|
1685
1700
|
onClick: toggleAdvanced
|
|
1686
1701
|
}, {
|
|
1687
1702
|
default: withCtx(() => [
|
|
1688
|
-
createCommentVNode(" \u6536\u8D77 | \u5C55\u5F00 "),
|
|
1689
1703
|
createElementVNode("span", _hoisted_3$2, toDisplayString(advancedRef.value ? unref(t)("UI.ADVANCED") : unref(t)("UI.EXPAND")), 1),
|
|
1690
1704
|
createElementVNode("span", {
|
|
1691
1705
|
class: normalizeClass(unref(getAdvanceClass))
|
|
1692
1706
|
}, _hoisted_5$1, 2)
|
|
1693
1707
|
]),
|
|
1694
1708
|
_: 1
|
|
1695
|
-
})) : createCommentVNode("
|
|
1709
|
+
})) : createCommentVNode("", true)
|
|
1696
1710
|
]),
|
|
1697
1711
|
_: 1
|
|
1698
1712
|
}, 8, ["style"])
|
|
1699
1713
|
]),
|
|
1700
1714
|
_: 1
|
|
1701
|
-
}, 16)) : createCommentVNode("
|
|
1715
|
+
}, 16)) : createCommentVNode("", true);
|
|
1702
1716
|
};
|
|
1703
1717
|
}
|
|
1704
1718
|
});
|
|
1705
|
-
const DtFormButtons = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/form/src/components/FormButtons.vue"]]);
|
|
1706
1719
|
const _hoisted_1$7 = { key: 0 };
|
|
1707
1720
|
const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
1708
1721
|
__name: "Fullscreen",
|
|
@@ -1730,7 +1743,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
1730
1743
|
const _component_ATooltip = Tooltip;
|
|
1731
1744
|
return openBlock(), createBlock(_component_ATooltip, { placement: "top" }, {
|
|
1732
1745
|
title: withCtx(() => [
|
|
1733
|
-
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$7, toDisplayString(unref(t)("FULLSCREEN")), 1)) : createCommentVNode("
|
|
1746
|
+
!unref(isFullscreen) ? (openBlock(), createElementBlock("span", _hoisted_1$7, toDisplayString(unref(t)("FULLSCREEN")), 1)) : createCommentVNode("", true)
|
|
1734
1747
|
]),
|
|
1735
1748
|
default: withCtx(() => [
|
|
1736
1749
|
createElementVNode("span", {
|
|
@@ -1747,7 +1760,6 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
1747
1760
|
};
|
|
1748
1761
|
}
|
|
1749
1762
|
});
|
|
1750
|
-
const FullscreenSetting = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/tableSetting/Fullscreen.vue"]]);
|
|
1751
1763
|
const orgDialogProp = reactive({});
|
|
1752
1764
|
const cbTransfer = reactive({});
|
|
1753
1765
|
const dataTransfer = reactive({});
|
|
@@ -1835,8 +1847,6 @@ function useModal(props2, setModalData) {
|
|
|
1835
1847
|
};
|
|
1836
1848
|
watchEffect(() => {
|
|
1837
1849
|
const data = dataTransfer[unref(uidRef)];
|
|
1838
|
-
if (!data)
|
|
1839
|
-
return;
|
|
1840
1850
|
if (!setModalData || !isFunction(setModalData))
|
|
1841
1851
|
return;
|
|
1842
1852
|
nextTick(() => {
|
|
@@ -1955,7 +1965,6 @@ function useDragMove(context) {
|
|
|
1955
1965
|
const screenHeight = document.documentElement.clientHeight;
|
|
1956
1966
|
const dragDomWidth = dragDom.offsetWidth;
|
|
1957
1967
|
const dragDomheight = dragDom.offsetHeight;
|
|
1958
|
-
console.log(dragDomWidth, dragDomheight, screenHeight, screenWidth);
|
|
1959
1968
|
const minDragDomLeft = dragDom.offsetLeft;
|
|
1960
1969
|
const maxDragDomLeft = screenWidth - dragDom.offsetLeft - dragDomWidth;
|
|
1961
1970
|
const minDragDomTop = dragDom.offsetTop;
|
|
@@ -2052,13 +2061,12 @@ const _sfc_main$e = {
|
|
|
2052
2061
|
};
|
|
2053
2062
|
if (!propsData?.visible)
|
|
2054
2063
|
return null;
|
|
2055
|
-
return createVNode(Modal
|
|
2064
|
+
return createVNode(Modal, propsData, _isSlot(_slot = extendSlots(slots)) ? _slot : {
|
|
2056
2065
|
default: () => [_slot]
|
|
2057
2066
|
});
|
|
2058
2067
|
};
|
|
2059
2068
|
}
|
|
2060
2069
|
};
|
|
2061
|
-
const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/modal/src/components/Modal.vue"]]);
|
|
2062
2070
|
const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
2063
2071
|
__name: "CloseIcon",
|
|
2064
2072
|
props: {
|
|
@@ -2117,7 +2125,7 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
2117
2125
|
]),
|
|
2118
2126
|
_: 1
|
|
2119
2127
|
}, 8, ["title"]))
|
|
2120
|
-
], 64)) : createCommentVNode("
|
|
2128
|
+
], 64)) : createCommentVNode("", true),
|
|
2121
2129
|
createElementVNode("i", {
|
|
2122
2130
|
class: "i mdi:close h-14 w-10 pr-4",
|
|
2123
2131
|
onClick: handleCancel
|
|
@@ -2126,7 +2134,6 @@ const _sfc_main$d = /* @__PURE__ */ defineComponent({
|
|
|
2126
2134
|
};
|
|
2127
2135
|
}
|
|
2128
2136
|
});
|
|
2129
|
-
const CloseIcon = /* @__PURE__ */ _export_sfc(_sfc_main$d, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/modal/src/components/CloseIcon.vue"]]);
|
|
2130
2137
|
const isServer = typeof window === "undefined";
|
|
2131
2138
|
const BAR_MAP = {
|
|
2132
2139
|
vertical: {
|
|
@@ -2368,13 +2375,12 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
|
|
|
2368
2375
|
};
|
|
2369
2376
|
}
|
|
2370
2377
|
});
|
|
2371
|
-
const ScrollBar = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/container/src/components/scroll-bar.vue"]]);
|
|
2372
2378
|
const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
2373
2379
|
__name: "scroll-container",
|
|
2374
2380
|
setup(__props) {
|
|
2375
2381
|
const scrollbarRef = ref(null);
|
|
2376
2382
|
return (_ctx, _cache) => {
|
|
2377
|
-
return openBlock(), createBlock(
|
|
2383
|
+
return openBlock(), createBlock(_sfc_main$c, mergeProps({
|
|
2378
2384
|
ref_key: "scrollbarRef",
|
|
2379
2385
|
ref: scrollbarRef
|
|
2380
2386
|
}, _ctx.$attrs, { class: "w-full h-full" }), {
|
|
@@ -2386,7 +2392,6 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
2386
2392
|
};
|
|
2387
2393
|
}
|
|
2388
2394
|
});
|
|
2389
|
-
const ScrollContainer = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/container/src/scroll-container.vue"]]);
|
|
2390
2395
|
const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
2391
2396
|
__name: "slot-container",
|
|
2392
2397
|
props: {
|
|
@@ -2405,15 +2410,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
|
|
|
2405
2410
|
};
|
|
2406
2411
|
}
|
|
2407
2412
|
});
|
|
2408
|
-
const SlotContainer = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/container/src/slot-container.vue"]]);
|
|
2409
2413
|
const withInstall = (comp) => {
|
|
2410
2414
|
comp.install = (app) => {
|
|
2411
2415
|
app.component(comp.name, comp);
|
|
2412
2416
|
};
|
|
2413
2417
|
return comp;
|
|
2414
2418
|
};
|
|
2415
|
-
const DtScrollContainer = withInstall(
|
|
2416
|
-
withInstall(
|
|
2419
|
+
const DtScrollContainer = withInstall(_sfc_main$b);
|
|
2420
|
+
withInstall(_sfc_main$a);
|
|
2417
2421
|
const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
2418
2422
|
__name: "ModalWrap",
|
|
2419
2423
|
props: {
|
|
@@ -2520,7 +2524,6 @@ const _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
2520
2524
|
};
|
|
2521
2525
|
}
|
|
2522
2526
|
});
|
|
2523
|
-
const ModalWrapper = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/modal/src/components/ModalWrap.vue"]]);
|
|
2524
2527
|
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
2525
2528
|
__name: "ModalFooter",
|
|
2526
2529
|
props: {
|
|
@@ -2541,8 +2544,8 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
2541
2544
|
if (props2.buttons && props2.buttons.length)
|
|
2542
2545
|
return props2.buttons;
|
|
2543
2546
|
let buttonActions = [
|
|
2544
|
-
{ t: "\
|
|
2545
|
-
{ t: "\
|
|
2547
|
+
{ t: "\u5173\u95ED", label: props2.cancelText || t("CLOSE"), preIcon: "mdi:close", flag: "CANCEL" },
|
|
2548
|
+
{ t: "\u4FDD\u5B58", label: props2.okText || t("SAVE"), preIcon: "mdi:content-save", type: "primary", flag: "OK" }
|
|
2546
2549
|
];
|
|
2547
2550
|
if (!props2.showSave)
|
|
2548
2551
|
buttonActions = buttonActions.filter((btn) => btn.flag !== "OK");
|
|
@@ -2563,7 +2566,7 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
2563
2566
|
return (_ctx, _cache) => {
|
|
2564
2567
|
return openBlock(), createElementBlock(Fragment, null, [
|
|
2565
2568
|
renderSlot(_ctx.$slots, "appendFooter"),
|
|
2566
|
-
createVNode(
|
|
2569
|
+
createVNode(_sfc_main$g, {
|
|
2567
2570
|
mode: "dialog",
|
|
2568
2571
|
buttonList: unref(buttonList),
|
|
2569
2572
|
onHandleMethod: _cache[0] || (_cache[0] = ($event) => handleMethod($event))
|
|
@@ -2572,7 +2575,6 @@ const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
|
2572
2575
|
};
|
|
2573
2576
|
}
|
|
2574
2577
|
});
|
|
2575
|
-
const ModalFooter = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/modal/src/components/ModalFooter.vue"]]);
|
|
2576
2578
|
function useFullScreen(wrapClassName) {
|
|
2577
2579
|
const fullScreenRef = ref(false);
|
|
2578
2580
|
const getWrapClassName = computed(() => {
|
|
@@ -2691,14 +2693,14 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2691
2693
|
});
|
|
2692
2694
|
return (_ctx, _cache) => {
|
|
2693
2695
|
const _component_ASpin = Spin;
|
|
2694
|
-
return openBlock(), createBlock(
|
|
2696
|
+
return openBlock(), createBlock(_sfc_main$e, mergeProps(unref(getBindValue), { onCancel: handleCancel }), createSlots({
|
|
2695
2697
|
default: withCtx(() => [
|
|
2696
2698
|
createVNode(_component_ASpin, {
|
|
2697
2699
|
spinning: unref(getBindValue).loading,
|
|
2698
2700
|
tip: unref(getBindValue).loadingTip
|
|
2699
2701
|
}, {
|
|
2700
2702
|
default: withCtx(() => [
|
|
2701
|
-
createVNode(
|
|
2703
|
+
createVNode(_sfc_main$9, mergeProps({
|
|
2702
2704
|
useWrapper: unref(getBindValue).useWrapper,
|
|
2703
2705
|
fullScreen: unref(fullScreenRef),
|
|
2704
2706
|
ref_key: "modalWrapperRef",
|
|
@@ -2722,7 +2724,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2722
2724
|
!_ctx.$slots.closeIcon ? {
|
|
2723
2725
|
name: "closeIcon",
|
|
2724
2726
|
fn: withCtx(() => [
|
|
2725
|
-
createVNode(
|
|
2727
|
+
createVNode(_sfc_main$d, {
|
|
2726
2728
|
canFullscreen: unref(getBindValue).canFullscreen,
|
|
2727
2729
|
fullScreen: unref(fullScreenRef),
|
|
2728
2730
|
onCancel: handleCancel,
|
|
@@ -2741,7 +2743,7 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2741
2743
|
!_ctx.$slots.footer ? {
|
|
2742
2744
|
name: "footer",
|
|
2743
2745
|
fn: withCtx(() => [
|
|
2744
|
-
createVNode(
|
|
2746
|
+
createVNode(_sfc_main$8, {
|
|
2745
2747
|
buttons: propsRef.value?.footer,
|
|
2746
2748
|
showSave: unref(getBindValue).showOkBtn,
|
|
2747
2749
|
showCancel: unref(getBindValue).showCancelBtn,
|
|
@@ -2774,7 +2776,6 @@ const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
|
2774
2776
|
};
|
|
2775
2777
|
}
|
|
2776
2778
|
});
|
|
2777
|
-
const DtModal = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/modal/src/index.vue"]]);
|
|
2778
2779
|
const _hoisted_1$5 = { class: "column-select" };
|
|
2779
2780
|
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
2780
2781
|
__name: "DownloadCtrl",
|
|
@@ -2826,7 +2827,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2826
2827
|
const _component_ADivider = Divider$1;
|
|
2827
2828
|
const _component_ACol = Col;
|
|
2828
2829
|
const _component_ARow = Row;
|
|
2829
|
-
return openBlock(), createBlock(unref(
|
|
2830
|
+
return openBlock(), createBlock(unref(_sfc_main$7), {
|
|
2830
2831
|
onRegister: unref(registerDialog),
|
|
2831
2832
|
onSave: save
|
|
2832
2833
|
}, {
|
|
@@ -2846,7 +2847,7 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2846
2847
|
createVNode(_component_ADivider, { dashed: "" }),
|
|
2847
2848
|
createVNode(_component_ARow, null, {
|
|
2848
2849
|
default: withCtx(() => [
|
|
2849
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(modalData.value, (it,
|
|
2850
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(modalData.value, (it, index) => {
|
|
2850
2851
|
return openBlock(), createBlock(_component_ACol, { span: 8 }, {
|
|
2851
2852
|
default: withCtx(() => [
|
|
2852
2853
|
createVNode(_component_ACheckbox, {
|
|
@@ -2872,7 +2873,6 @@ const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
|
2872
2873
|
};
|
|
2873
2874
|
}
|
|
2874
2875
|
});
|
|
2875
|
-
const DownloadCtrl = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/tableSetting/DownloadCtrl.vue"]]);
|
|
2876
2876
|
const _hoisted_1$4 = /* @__PURE__ */ createElementVNode("span", { class: "flex" }, [
|
|
2877
2877
|
/* @__PURE__ */ createElementVNode("i", { class: "i ic:baseline-download w-7 leading-7 text-center cursor-pointer" })
|
|
2878
2878
|
], -1);
|
|
@@ -2930,19 +2930,19 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
2930
2930
|
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_CURRENT_PAGE")), 1)
|
|
2931
2931
|
]),
|
|
2932
2932
|
_: 1
|
|
2933
|
-
})) : createCommentVNode("
|
|
2933
|
+
})) : createCommentVNode("", true),
|
|
2934
2934
|
unref(showSelectedDownload) ? (openBlock(), createBlock(_component_AMenuItem, { key: "select" }, {
|
|
2935
2935
|
default: withCtx(() => [
|
|
2936
2936
|
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_SELECT_COLUMN")), 1)
|
|
2937
2937
|
]),
|
|
2938
2938
|
_: 1
|
|
2939
|
-
})) : createCommentVNode("
|
|
2939
|
+
})) : createCommentVNode("", true),
|
|
2940
2940
|
unref(showBackDownload) ? (openBlock(), createBlock(_component_AMenuItem, { key: "all" }, {
|
|
2941
2941
|
default: withCtx(() => [
|
|
2942
2942
|
createElementVNode("span", null, toDisplayString(unref(t)("EXPORT_ALL")), 1)
|
|
2943
2943
|
]),
|
|
2944
2944
|
_: 1
|
|
2945
|
-
})) : createCommentVNode("
|
|
2945
|
+
})) : createCommentVNode("", true)
|
|
2946
2946
|
]),
|
|
2947
2947
|
_: 1
|
|
2948
2948
|
})
|
|
@@ -2952,14 +2952,13 @@ const _sfc_main$5 = /* @__PURE__ */ defineComponent({
|
|
|
2952
2952
|
]),
|
|
2953
2953
|
_: 1
|
|
2954
2954
|
}, 8, ["getPopupContainer"]),
|
|
2955
|
-
createVNode(
|
|
2955
|
+
createVNode(_sfc_main$6, { onRegister: unref(registerDialog) }, null, 8, ["onRegister"])
|
|
2956
2956
|
]),
|
|
2957
2957
|
_: 1
|
|
2958
2958
|
});
|
|
2959
2959
|
};
|
|
2960
2960
|
}
|
|
2961
2961
|
});
|
|
2962
|
-
const Download = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/tableSetting/Download.vue"]]);
|
|
2963
2962
|
const _hoisted_1$3 = /* @__PURE__ */ createElementVNode("i", { class: "i ant-design:drag-outlined drag-icon cursor-pointer" }, null, -1);
|
|
2964
2963
|
const _hoisted_2$1 = ["onClick"];
|
|
2965
2964
|
const _hoisted_3$1 = ["onClick"];
|
|
@@ -3102,9 +3101,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3102
3101
|
return;
|
|
3103
3102
|
const columns = getColumns();
|
|
3104
3103
|
const isFixed = item.fixed === fixed ? false : fixed;
|
|
3105
|
-
const
|
|
3106
|
-
if (
|
|
3107
|
-
columns[
|
|
3104
|
+
const index = columns.findIndex((col) => col.dataIndex === item.dataIndex);
|
|
3105
|
+
if (index !== -1) {
|
|
3106
|
+
columns[index].fixed = isFixed;
|
|
3108
3107
|
}
|
|
3109
3108
|
item.fixed = isFixed;
|
|
3110
3109
|
if (isFixed && !item.width) {
|
|
@@ -3295,7 +3294,6 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
3295
3294
|
};
|
|
3296
3295
|
}
|
|
3297
3296
|
});
|
|
3298
|
-
const ColumnSetting = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/tableSetting/Column.vue"]]);
|
|
3299
3297
|
const _hoisted_1$2 = { class: "flex dt-table-setting" };
|
|
3300
3298
|
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
3301
3299
|
__name: "index",
|
|
@@ -3321,17 +3319,16 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
3321
3319
|
}
|
|
3322
3320
|
return (_ctx, _cache) => {
|
|
3323
3321
|
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
3324
|
-
unref(getSetting).download ? (openBlock(), createBlock(
|
|
3325
|
-
unref(getSetting).setting ? (openBlock(), createBlock(
|
|
3322
|
+
unref(getSetting).download ? (openBlock(), createBlock(_sfc_main$5, normalizeProps(mergeProps({ key: 0 }, unref(getSetting))), null, 16)) : createCommentVNode("", true),
|
|
3323
|
+
unref(getSetting).setting ? (openBlock(), createBlock(_sfc_main$4, {
|
|
3326
3324
|
key: 1,
|
|
3327
3325
|
onColumnsChange: handleColumnChange
|
|
3328
|
-
})) : createCommentVNode("
|
|
3329
|
-
unref(getSetting).fullscreen ? (openBlock(), createBlock(
|
|
3326
|
+
})) : createCommentVNode("", true),
|
|
3327
|
+
unref(getSetting).fullscreen ? (openBlock(), createBlock(_sfc_main$f, { key: 2 })) : createCommentVNode("", true)
|
|
3330
3328
|
]);
|
|
3331
3329
|
};
|
|
3332
3330
|
}
|
|
3333
3331
|
});
|
|
3334
|
-
const DtTableSetting = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/tableSetting/index.vue"]]);
|
|
3335
3332
|
const _hoisted_1$1 = { class: "dt-table-header" };
|
|
3336
3333
|
const _hoisted_2 = { class: "flex flex-row justify-between" };
|
|
3337
3334
|
const _hoisted_3 = { class: "flex flex-row flex-1" };
|
|
@@ -3363,26 +3360,25 @@ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
|
3363
3360
|
return openBlock(), createElementBlock("div", _hoisted_1$1, [
|
|
3364
3361
|
createElementVNode("div", _hoisted_2, [
|
|
3365
3362
|
createElementVNode("div", _hoisted_3, [
|
|
3366
|
-
unref(getActionsProps)?.buttonList.length ? (openBlock(), createBlock(unref(
|
|
3363
|
+
unref(getActionsProps)?.buttonList.length ? (openBlock(), createBlock(unref(_sfc_main$g), normalizeProps(mergeProps({ key: 0 }, unref(getActionsProps))), null, 16)) : createCommentVNode("", true),
|
|
3367
3364
|
renderSlot(_ctx.$slots, "toolbar")
|
|
3368
3365
|
]),
|
|
3369
3366
|
__props.tableSetting ? (openBlock(), createElementBlock("div", _hoisted_4, [
|
|
3370
|
-
createVNode(
|
|
3371
|
-
])) : createCommentVNode("
|
|
3367
|
+
createVNode(_sfc_main$3, { setting: __props.tableSetting }, null, 8, ["setting"])
|
|
3368
|
+
])) : createCommentVNode("", true)
|
|
3372
3369
|
]),
|
|
3373
3370
|
_ctx.$slots.headerTop ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
|
3374
3371
|
renderSlot(_ctx.$slots, "headerTop")
|
|
3375
|
-
])) : createCommentVNode("
|
|
3372
|
+
])) : createCommentVNode("", true)
|
|
3376
3373
|
]);
|
|
3377
3374
|
};
|
|
3378
3375
|
}
|
|
3379
3376
|
});
|
|
3380
|
-
const TableHeader = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/TableHeader.vue"]]);
|
|
3381
3377
|
function useTableHeader(propsRef, slots, handlers) {
|
|
3382
3378
|
const { t } = useI18n("UI");
|
|
3383
3379
|
const getHeaderProps = computed(() => {
|
|
3384
3380
|
const TABLE_TOOLS = [
|
|
3385
|
-
{ t: "\u65B0\u589E", label: t("ADD"), preIcon: "mdi:plus", type: "primary", onClick: unref(propsRef).
|
|
3381
|
+
{ t: "\u65B0\u589E", label: t("ADD"), preIcon: "mdi:plus", type: "primary", onClick: unref(propsRef).onOPenAddDialog },
|
|
3386
3382
|
{ t: "\u5220\u9664", label: t("DELETE"), preIcon: "mdi:delete-outline", onClick: unref(propsRef).onDeletes }
|
|
3387
3383
|
];
|
|
3388
3384
|
const { tableSetting, toolbar = TABLE_TOOLS } = unref(propsRef);
|
|
@@ -3390,7 +3386,7 @@ function useTableHeader(propsRef, slots, handlers) {
|
|
|
3390
3386
|
const hideTitle = (!toolbar || !toolbar.filter((it) => it.show ?? true).length) && !slots.toolbar && !slots.headerTop && !tableSetting;
|
|
3391
3387
|
return {
|
|
3392
3388
|
title: hideTitle ? null : () => h$1(
|
|
3393
|
-
|
|
3389
|
+
_sfc_main$2,
|
|
3394
3390
|
{
|
|
3395
3391
|
tableSetting,
|
|
3396
3392
|
toolbar,
|
|
@@ -3711,14 +3707,14 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
3711
3707
|
};
|
|
3712
3708
|
}
|
|
3713
3709
|
function useRows(propsRef) {
|
|
3714
|
-
function getRowClassName(record,
|
|
3710
|
+
function getRowClassName(record, index) {
|
|
3715
3711
|
const { striped, rowClassName } = unref(propsRef);
|
|
3716
3712
|
const classNames = [];
|
|
3717
3713
|
if (striped) {
|
|
3718
|
-
classNames.push(
|
|
3714
|
+
classNames.push(index % 2 === 1 ? "table-striped" : "");
|
|
3719
3715
|
}
|
|
3720
3716
|
if (rowClassName && isFunction(rowClassName)) {
|
|
3721
|
-
classNames.push(rowClassName(record,
|
|
3717
|
+
classNames.push(rowClassName(record, index));
|
|
3722
3718
|
}
|
|
3723
3719
|
return classNames.join(" ");
|
|
3724
3720
|
}
|
|
@@ -3748,7 +3744,7 @@ const _sfc_main$1 = {
|
|
|
3748
3744
|
const {
|
|
3749
3745
|
column,
|
|
3750
3746
|
record,
|
|
3751
|
-
index
|
|
3747
|
+
index
|
|
3752
3748
|
} = props2;
|
|
3753
3749
|
const {
|
|
3754
3750
|
render,
|
|
@@ -3790,7 +3786,7 @@ const _sfc_main$1 = {
|
|
|
3790
3786
|
});
|
|
3791
3787
|
}
|
|
3792
3788
|
} else if (isFunction(render)) {
|
|
3793
|
-
let afterRenderData = render(record,
|
|
3789
|
+
let afterRenderData = render(record, index, text);
|
|
3794
3790
|
if (afterRenderData.__v_isRef) {
|
|
3795
3791
|
renderText = afterRenderData;
|
|
3796
3792
|
} else if (afterRenderData["setup"]) {
|
|
@@ -3808,7 +3804,6 @@ const _sfc_main$1 = {
|
|
|
3808
3804
|
return () => createVNode("span", null, [unref(renderText)]);
|
|
3809
3805
|
}
|
|
3810
3806
|
};
|
|
3811
|
-
const TableRender = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/components/TableRender.vue"]]);
|
|
3812
3807
|
const DEFAULT_SORT_FN = (sortInfo) => {
|
|
3813
3808
|
const { field, order } = sortInfo;
|
|
3814
3809
|
return field && order ? { field, order } : {};
|
|
@@ -3904,17 +3899,17 @@ const TableProps = {
|
|
|
3904
3899
|
default: (params) => {
|
|
3905
3900
|
}
|
|
3906
3901
|
},
|
|
3907
|
-
|
|
3902
|
+
onOPenAddDialog: {
|
|
3908
3903
|
type: Function,
|
|
3909
3904
|
default: (params) => ({})
|
|
3910
3905
|
},
|
|
3911
|
-
|
|
3906
|
+
onOpenUpdateDialog: {
|
|
3912
3907
|
type: Function,
|
|
3913
|
-
default: (
|
|
3908
|
+
default: (row, index) => ({})
|
|
3914
3909
|
},
|
|
3915
3910
|
onDelete: {
|
|
3916
3911
|
type: Function,
|
|
3917
|
-
default: (
|
|
3912
|
+
default: (row, index) => ({})
|
|
3918
3913
|
},
|
|
3919
3914
|
onDeletes: {
|
|
3920
3915
|
type: Function,
|
|
@@ -4059,15 +4054,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4059
4054
|
rowClassName: unref(getRowClassName),
|
|
4060
4055
|
onChange: unref(handleTableChange)
|
|
4061
4056
|
}), createSlots({
|
|
4062
|
-
bodyCell: withCtx(({ column, record, index
|
|
4063
|
-
_ctx.$slots.bodyCell ? renderSlot(_ctx.$slots, "bodyCell", normalizeProps(mergeProps({ key: 0 }, { column, record, index
|
|
4064
|
-
|
|
4065
|
-
column?.render && !_ctx.$slots.bodyCell ? (openBlock(), createBlock(TableRender, {
|
|
4057
|
+
bodyCell: withCtx(({ column, record, index }) => [
|
|
4058
|
+
_ctx.$slots.bodyCell ? renderSlot(_ctx.$slots, "bodyCell", normalizeProps(mergeProps({ key: 0 }, { column, record, index }))) : createCommentVNode("", true),
|
|
4059
|
+
column?.render && !_ctx.$slots.bodyCell ? (openBlock(), createBlock(_sfc_main$1, {
|
|
4066
4060
|
key: 1,
|
|
4067
4061
|
column,
|
|
4068
4062
|
record,
|
|
4069
|
-
index
|
|
4070
|
-
}, null, 8, ["column", "record", "index"])) : createCommentVNode("
|
|
4063
|
+
index
|
|
4064
|
+
}, null, 8, ["column", "record", "index"])) : createCommentVNode("", true)
|
|
4071
4065
|
]),
|
|
4072
4066
|
emptyText: withCtx(() => [
|
|
4073
4067
|
createElementVNode("img", {
|
|
@@ -4089,8 +4083,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
4089
4083
|
};
|
|
4090
4084
|
}
|
|
4091
4085
|
});
|
|
4092
|
-
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "D:/dt/dt-frame-front/dt-frames/frames/packages/ui/src/components/table/src/index.vue"]]);
|
|
4093
4086
|
export {
|
|
4094
|
-
|
|
4087
|
+
_sfc_main as DtTable,
|
|
4095
4088
|
useTable
|
|
4096
4089
|
};
|