@duxweb/dvha-pro 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/app.cjs +1 -0
- package/dist/cjs/component.cjs +1 -0
- package/dist/cjs/components/card/card.cjs +1 -0
- package/dist/cjs/components/carousel/carousel.cjs +1 -0
- package/dist/cjs/components/dashboard/hello.cjs +1 -0
- package/dist/cjs/components/dashboard/helloBig.cjs +1 -0
- package/dist/cjs/components/dashboard/quick.cjs +1 -0
- package/dist/cjs/components/dialog/dialog.cjs +1 -0
- package/dist/cjs/components/draw/drawApps.cjs +1 -0
- package/dist/cjs/components/draw/drawAuth.cjs +1 -0
- package/dist/cjs/components/draw/drawEmpty.cjs +1 -0
- package/dist/cjs/components/draw/drawEmptyForm.cjs +1 -0
- package/dist/cjs/components/draw/drawError.cjs +1 -0
- package/dist/cjs/components/drawer/drawer.cjs +1 -0
- package/dist/cjs/components/drawer/drawerPage.cjs +1 -0
- package/dist/cjs/components/form/formItem.cjs +1 -0
- package/dist/cjs/components/form/formLayout.cjs +1 -0
- package/dist/cjs/components/form/modalForm.cjs +1 -0
- package/dist/cjs/components/form/pageForm.cjs +1 -0
- package/dist/cjs/components/form/settingForm.cjs +1 -0
- package/dist/cjs/components/layout/filter.cjs +1 -0
- package/dist/cjs/components/layout/list.cjs +1 -0
- package/dist/cjs/components/layout/table.cjs +1 -0
- package/dist/cjs/components/layout/tools.cjs +1 -0
- package/dist/cjs/components/list/card.cjs +1 -0
- package/dist/cjs/components/list/list.cjs +1 -0
- package/dist/cjs/components/media/media.cjs +1 -0
- package/dist/cjs/components/modal/modal.cjs +1 -0
- package/dist/cjs/components/modal/modalPage.cjs +1 -0
- package/dist/cjs/components/modal/modalTab.cjs +1 -0
- package/dist/cjs/components/panel/alert.cjs +1 -0
- package/dist/cjs/components/panel/setting.cjs +1 -0
- package/dist/cjs/components/status/blockEmpty.cjs +1 -0
- package/dist/cjs/components/table/tablePage.cjs +1 -0
- package/dist/cjs/components/widget/connect.cjs +1 -0
- package/dist/cjs/config/uno.cjs +1 -0
- package/dist/cjs/config/validate.cjs +1 -0
- package/dist/cjs/dvha-pro.css +1 -0
- package/dist/cjs/hooks/action.cjs +1 -0
- package/dist/cjs/hooks/dialog.cjs +1 -0
- package/dist/cjs/hooks/drawer.cjs +1 -0
- package/dist/cjs/hooks/modal.cjs +1 -0
- package/dist/cjs/hooks/table/column.cjs +1 -0
- package/dist/cjs/hooks/table/copy.cjs +1 -0
- package/dist/cjs/hooks/table/hidden.cjs +1 -0
- package/dist/cjs/hooks/table/image.cjs +1 -0
- package/dist/cjs/hooks/table/input.cjs +1 -0
- package/dist/cjs/hooks/table/map.cjs +1 -0
- package/dist/cjs/hooks/table/media.cjs +1 -0
- package/dist/cjs/hooks/table/status.cjs +1 -0
- package/dist/cjs/hooks/table/switch.cjs +1 -0
- package/dist/cjs/hooks/table.cjs +1 -0
- package/dist/cjs/hooks/ui.cjs +1 -0
- package/dist/cjs/index.cjs +1 -0
- package/dist/cjs/langs/en-US.json.cjs +1 -0
- package/dist/cjs/langs/zh-CN.json.cjs +1 -0
- package/dist/cjs/main.cjs +1 -0
- package/dist/cjs/node_modules/@iconify-json/tabler/icons.json.cjs +1 -0
- package/dist/cjs/node_modules/@overlastic/core/dist/index.cjs +1 -0
- package/dist/cjs/node_modules/@overlastic/vue/dist/index.cjs +1 -0
- package/dist/cjs/node_modules/@vee-validate/i18n/dist/locale/en.json.cjs +1 -0
- package/dist/cjs/node_modules/@vee-validate/i18n/dist/locale/zh_CN.json.cjs +1 -0
- package/dist/cjs/node_modules/@vueuse/integrations/useFocusTrap.cjs +1 -0
- package/dist/cjs/node_modules/@vueuse/shared/index.cjs +1 -0
- package/dist/cjs/node_modules/colorizr/dist/index.cjs +1 -0
- package/dist/cjs/node_modules/focus-trap/dist/focus-trap.esm.cjs +5 -0
- package/dist/cjs/node_modules/lower-case/dist.es2015/index.cjs +1 -0
- package/dist/cjs/node_modules/no-case/dist.es2015/index.cjs +1 -0
- package/dist/cjs/node_modules/pascal-case/dist.es2015/index.cjs +1 -0
- package/dist/cjs/node_modules/tabbable/dist/index.esm.cjs +4 -0
- package/dist/cjs/node_modules/tslib/tslib.es6.cjs +1 -0
- package/dist/cjs/pages/authLayout.cjs +1 -0
- package/dist/cjs/pages/layout/global.cjs +1 -0
- package/dist/cjs/pages/layout/page.cjs +1 -0
- package/dist/cjs/pages/layout/tab.cjs +1 -0
- package/dist/cjs/pages/layout.cjs +1 -0
- package/dist/cjs/pages/loading.cjs +1 -0
- package/dist/cjs/pages/login.cjs +1 -0
- package/dist/cjs/pages/menu/avatar.cjs +1 -0
- package/dist/cjs/pages/menu/button.cjs +1 -0
- package/dist/cjs/pages/menu/cmd.cjs +1 -0
- package/dist/cjs/pages/menu/main.cjs +1 -0
- package/dist/cjs/pages/menu/mobile.cjs +1 -0
- package/dist/cjs/pages/page.cjs +1 -0
- package/dist/cjs/pages/page403.cjs +1 -0
- package/dist/cjs/pages/page404.cjs +1 -0
- package/dist/cjs/pages/page500.cjs +1 -0
- package/dist/cjs/pages/pageEmpty.cjs +1 -0
- package/dist/cjs/pages/pageLoading.cjs +1 -0
- package/dist/cjs/pages/pageStatus.cjs +1 -0
- package/dist/cjs/static/images/placeholder.png.cjs +1 -0
- package/dist/cjs/stores/ui.cjs +1 -0
- package/dist/cjs/theme/naiveTheme.cjs +1 -0
- package/dist/cjs/theme/presetTheme.cjs +1 -0
- package/dist/cjs/theme/uno.css.cjs +1285 -0
- package/dist/esm/app.js +20 -0
- package/dist/esm/component.js +59 -0
- package/dist/esm/components/card/card.js +114 -0
- package/dist/esm/components/carousel/carousel.js +37 -0
- package/dist/esm/components/dashboard/hello.js +40 -0
- package/dist/esm/components/dashboard/helloBig.js +344 -0
- package/dist/esm/components/dashboard/quick.js +59 -0
- package/dist/esm/components/dialog/dialog.js +118 -0
- package/dist/esm/components/draw/drawApps.js +145 -0
- package/dist/esm/components/draw/drawAuth.js +50 -0
- package/dist/esm/components/draw/drawEmpty.js +92 -0
- package/dist/esm/components/draw/drawEmptyForm.js +128 -0
- package/dist/esm/components/draw/drawError.js +242 -0
- package/dist/esm/components/drawer/drawer.js +73 -0
- package/dist/esm/components/drawer/drawerPage.js +28 -0
- package/dist/esm/components/form/formItem.js +77 -0
- package/dist/esm/components/form/formLayout.js +38 -0
- package/dist/esm/components/form/modalForm.js +108 -0
- package/dist/esm/components/form/pageForm.js +94 -0
- package/dist/esm/components/form/settingForm.js +104 -0
- package/dist/esm/components/layout/filter.js +27 -0
- package/dist/esm/components/layout/list.js +333 -0
- package/dist/esm/components/layout/table.js +292 -0
- package/dist/esm/components/layout/tools.js +78 -0
- package/dist/esm/components/list/card.js +78 -0
- package/dist/esm/components/list/list.js +38 -0
- package/dist/esm/components/media/media.js +77 -0
- package/dist/esm/components/modal/modal.js +116 -0
- package/dist/esm/components/modal/modalPage.js +56 -0
- package/dist/esm/components/modal/modalTab.js +70 -0
- package/dist/esm/components/panel/alert.js +57 -0
- package/dist/esm/components/panel/setting.js +49 -0
- package/dist/esm/components/status/blockEmpty.js +78 -0
- package/dist/esm/components/table/tablePage.js +41 -0
- package/dist/esm/components/widget/connect.js +119 -0
- package/dist/esm/config/uno.js +32 -0
- package/dist/esm/config/validate.js +15 -0
- package/dist/esm/dvha-pro.css +1 -0
- package/dist/esm/hooks/action.js +213 -0
- package/dist/esm/hooks/dialog.js +32 -0
- package/dist/esm/hooks/drawer.js +25 -0
- package/dist/esm/hooks/modal.js +14 -0
- package/dist/esm/hooks/table/column.js +31 -0
- package/dist/esm/hooks/table/copy.js +27 -0
- package/dist/esm/hooks/table/hidden.js +48 -0
- package/dist/esm/hooks/table/image.js +24 -0
- package/dist/esm/hooks/table/input.js +81 -0
- package/dist/esm/hooks/table/map.js +21 -0
- package/dist/esm/hooks/table/media.js +34 -0
- package/dist/esm/hooks/table/status.js +32 -0
- package/dist/esm/hooks/table/switch.js +33 -0
- package/dist/esm/hooks/table.js +74 -0
- package/dist/esm/hooks/ui.js +16 -0
- package/dist/esm/index.js +139 -0
- package/dist/esm/langs/en-US.json.js +11 -0
- package/dist/esm/langs/zh-CN.json.js +11 -0
- package/dist/esm/main.js +18 -0
- package/dist/esm/node_modules/@iconify-json/tabler/icons.json.js +17 -0
- package/dist/esm/node_modules/@overlastic/core/dist/index.js +76 -0
- package/dist/esm/node_modules/@overlastic/vue/dist/index.js +122 -0
- package/dist/esm/node_modules/@vee-validate/i18n/dist/locale/en.json.js +9 -0
- package/dist/esm/node_modules/@vee-validate/i18n/dist/locale/zh_CN.json.js +9 -0
- package/dist/esm/node_modules/@vueuse/integrations/useFocusTrap.js +43 -0
- package/dist/esm/node_modules/@vueuse/shared/index.js +6 -0
- package/dist/esm/node_modules/colorizr/dist/index.js +318 -0
- package/dist/esm/node_modules/focus-trap/dist/focus-trap.esm.js +473 -0
- package/dist/esm/node_modules/lower-case/dist.es2015/index.js +6 -0
- package/dist/esm/node_modules/no-case/dist.es2015/index.js +18 -0
- package/dist/esm/node_modules/pascal-case/dist.es2015/index.js +13 -0
- package/dist/esm/node_modules/tabbable/dist/index.esm.js +202 -0
- package/dist/esm/node_modules/tslib/tslib.es6.js +12 -0
- package/dist/esm/pages/authLayout.js +38 -0
- package/dist/esm/pages/layout/global.js +51 -0
- package/dist/esm/pages/layout/page.js +54 -0
- package/dist/esm/pages/layout/tab.js +110 -0
- package/dist/esm/pages/layout.js +14 -0
- package/dist/esm/pages/loading.js +14 -0
- package/dist/esm/pages/login.js +143 -0
- package/dist/esm/pages/menu/avatar.js +205 -0
- package/dist/esm/pages/menu/button.js +60 -0
- package/dist/esm/pages/menu/cmd.js +156 -0
- package/dist/esm/pages/menu/main.js +101 -0
- package/dist/esm/pages/menu/mobile.js +38 -0
- package/dist/esm/pages/page.js +47 -0
- package/dist/esm/pages/page403.js +46 -0
- package/dist/esm/pages/page404.js +57 -0
- package/dist/esm/pages/page500.js +45 -0
- package/dist/esm/pages/pageEmpty.js +25 -0
- package/dist/esm/pages/pageLoading.js +22 -0
- package/dist/esm/pages/pageStatus.js +50 -0
- package/dist/esm/static/images/placeholder.png.js +4 -0
- package/dist/esm/stores/ui.js +34 -0
- package/dist/esm/theme/naiveTheme.js +97 -0
- package/dist/esm/theme/presetTheme.js +12 -0
- package/dist/esm/theme/uno.css.js +1288 -0
- package/dist/types/app.d.ts +1 -0
- package/dist/types/component.d.ts +5 -0
- package/dist/types/components/card/card.d.ts +140 -0
- package/dist/types/components/card/index.d.ts +1 -0
- package/dist/types/components/carousel/carousel.d.ts +20 -0
- package/dist/types/components/carousel/index.d.ts +1 -0
- package/dist/types/components/dashboard/hello.d.ts +16 -0
- package/dist/types/components/dashboard/helloBig.d.ts +19 -0
- package/dist/types/components/dashboard/index.d.ts +3 -0
- package/dist/types/components/dashboard/quick.d.ts +33 -0
- package/dist/types/components/dialog/dialog.d.ts +35 -0
- package/dist/types/components/dialog/index.d.ts +1 -0
- package/dist/types/components/draw/drawApps.d.ts +1 -0
- package/dist/types/components/draw/drawAuth.d.ts +1 -0
- package/dist/types/components/draw/drawEmpty.d.ts +1 -0
- package/dist/types/components/draw/drawEmptyForm.d.ts +1 -0
- package/dist/types/components/draw/drawError.d.ts +1 -0
- package/dist/types/components/draw/index.d.ts +5 -0
- package/dist/types/components/drawer/drawer.d.ts +19 -0
- package/dist/types/components/drawer/drawerPage.d.ts +1 -0
- package/dist/types/components/drawer/index.d.ts +2 -0
- package/dist/types/components/form/formItem.d.ts +27 -0
- package/dist/types/components/form/formLayout.d.ts +38 -0
- package/dist/types/components/form/index.d.ts +5 -0
- package/dist/types/components/form/modalForm.d.ts +89 -0
- package/dist/types/components/form/pageForm.d.ts +51 -0
- package/dist/types/components/form/settingForm.d.ts +69 -0
- package/dist/types/components/index.d.ts +14 -0
- package/dist/types/components/layout/filter.d.ts +13 -0
- package/dist/types/components/layout/index.d.ts +4 -0
- package/dist/types/components/layout/list.d.ts +85 -0
- package/dist/types/components/layout/table.d.ts +72 -0
- package/dist/types/components/layout/tools.d.ts +37 -0
- package/dist/types/components/list/card.d.ts +117 -0
- package/dist/types/components/list/index.d.ts +2 -0
- package/dist/types/components/list/list.d.ts +87 -0
- package/dist/types/components/media/index.d.ts +1 -0
- package/dist/types/components/media/media.d.ts +95 -0
- package/dist/types/components/modal/index.d.ts +3 -0
- package/dist/types/components/modal/modal.d.ts +66 -0
- package/dist/types/components/modal/modalPage.d.ts +42 -0
- package/dist/types/components/modal/modalTab.d.ts +42 -0
- package/dist/types/components/panel/alert.d.ts +32 -0
- package/dist/types/components/panel/index.d.ts +2 -0
- package/dist/types/components/panel/setting.d.ts +29 -0
- package/dist/types/components/status/blockEmpty.d.ts +25 -0
- package/dist/types/components/status/index.d.ts +1 -0
- package/dist/types/components/table/index.d.ts +1 -0
- package/dist/types/components/table/tablePage.d.ts +73 -0
- package/dist/types/components/widget/connect.d.ts +11 -0
- package/dist/types/components/widget/index.d.ts +1 -0
- package/dist/types/config/index.d.ts +2 -0
- package/dist/types/config/uno.d.ts +2 -0
- package/dist/types/config/validate.d.ts +1 -0
- package/dist/types/hooks/action.d.ts +17 -0
- package/dist/types/hooks/dialog.d.ts +17 -0
- package/dist/types/hooks/drawer.d.ts +11 -0
- package/dist/types/hooks/index.d.ts +6 -0
- package/dist/types/hooks/modal.d.ts +9 -0
- package/dist/types/hooks/table/column.d.ts +14 -0
- package/dist/types/hooks/table/copy.d.ts +6 -0
- package/dist/types/hooks/table/hidden.d.ts +7 -0
- package/dist/types/hooks/table/image.d.ts +8 -0
- package/dist/types/hooks/table/index.d.ts +7 -0
- package/dist/types/hooks/table/input.d.ts +9 -0
- package/dist/types/hooks/table/map.d.ts +13 -0
- package/dist/types/hooks/table/media.d.ts +12 -0
- package/dist/types/hooks/table/status.d.ts +12 -0
- package/dist/types/hooks/table/switch.d.ts +7 -0
- package/dist/types/hooks/table/types.d.ts +74 -0
- package/dist/types/hooks/table.d.ts +2 -0
- package/dist/types/hooks/ui.d.ts +8 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/langs/index.d.ts +3 -0
- package/dist/types/main.d.ts +5 -0
- package/dist/types/pages/authLayout.d.ts +1 -0
- package/dist/types/pages/index.d.ts +12 -0
- package/dist/types/pages/layout/global.d.ts +1 -0
- package/dist/types/pages/layout/index.d.ts +3 -0
- package/dist/types/pages/layout/page.d.ts +1 -0
- package/dist/types/pages/layout/tab.d.ts +1 -0
- package/dist/types/pages/layout.d.ts +1 -0
- package/dist/types/pages/loading.d.ts +1 -0
- package/dist/types/pages/login.d.ts +1 -0
- package/dist/types/pages/menu/avatar.d.ts +14 -0
- package/dist/types/pages/menu/button.d.ts +41 -0
- package/dist/types/pages/menu/cmd.d.ts +7 -0
- package/dist/types/pages/menu/index.d.ts +4 -0
- package/dist/types/pages/menu/main.d.ts +13 -0
- package/dist/types/pages/menu/mobile.d.ts +1 -0
- package/dist/types/pages/page.d.ts +42 -0
- package/dist/types/pages/page403.d.ts +1 -0
- package/dist/types/pages/page404.d.ts +1 -0
- package/dist/types/pages/page500.d.ts +1 -0
- package/dist/types/pages/pageEmpty.d.ts +7 -0
- package/dist/types/pages/pageLoading.d.ts +1 -0
- package/dist/types/pages/pageStatus.d.ts +7 -0
- package/dist/types/stores/index.d.ts +1 -0
- package/dist/types/stores/ui.d.ts +28 -0
- package/dist/types/theme/index.d.ts +2 -0
- package/dist/types/theme/naiveTheme.d.ts +5 -0
- package/dist/types/theme/presetTheme.d.ts +7 -0
- package/package.json +73 -0
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import { useI18n as b, useManage as S, useCustomMutation as D, useDelete as C } from "@duxweb/dvha-core";
|
|
2
|
+
import { useMessage as I, NButton as j, NDropdown as N } from "naive-ui";
|
|
3
|
+
import { h as s } from "vue";
|
|
4
|
+
import { useRouter as $ } from "vue-router";
|
|
5
|
+
import { useDialog as B } from "./dialog.js";
|
|
6
|
+
import { useDrawer as E } from "./drawer.js";
|
|
7
|
+
import { useModal as T } from "./modal.js";
|
|
8
|
+
function U(n) {
|
|
9
|
+
const y = T(), d = E(), f = B(), {
|
|
10
|
+
t: c
|
|
11
|
+
} = b(), l = I(), a = S(), u = $(), v = D({
|
|
12
|
+
onSuccess: (e) => {
|
|
13
|
+
l.success(e.message || "操作成功");
|
|
14
|
+
},
|
|
15
|
+
onError: (e) => {
|
|
16
|
+
l.error(e.message || "操作失败");
|
|
17
|
+
}
|
|
18
|
+
}), A = C({
|
|
19
|
+
onSuccess: (e) => {
|
|
20
|
+
l.success(e.message || "操作成功");
|
|
21
|
+
},
|
|
22
|
+
onError: (e) => {
|
|
23
|
+
l.error(e.message || "操作失败");
|
|
24
|
+
}
|
|
25
|
+
}), g = (n == null ? void 0 : n.path) || a.getPath(), x = (e) => {
|
|
26
|
+
var r, P;
|
|
27
|
+
const i = c(e.item.title || "", {}, e.item.title), m = c(e.item.label || "", {}, e.item.label);
|
|
28
|
+
if (e.item.type === "modal") {
|
|
29
|
+
const t = e.item;
|
|
30
|
+
y.show({
|
|
31
|
+
title: i || m,
|
|
32
|
+
component: t.component,
|
|
33
|
+
componentProps: {
|
|
34
|
+
id: e.id,
|
|
35
|
+
...t.componentProps
|
|
36
|
+
},
|
|
37
|
+
width: t.width
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
if (e.item.type === "drawer") {
|
|
41
|
+
const t = e.item;
|
|
42
|
+
d.show({
|
|
43
|
+
title: i || m,
|
|
44
|
+
component: t.component,
|
|
45
|
+
componentProps: {
|
|
46
|
+
id: e.id,
|
|
47
|
+
...t.componentProps
|
|
48
|
+
},
|
|
49
|
+
width: t.width
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (e.item.type === "confirm") {
|
|
53
|
+
const t = e.item;
|
|
54
|
+
f.confirm({
|
|
55
|
+
title: i || m,
|
|
56
|
+
content: t.content
|
|
57
|
+
}).then((h) => {
|
|
58
|
+
var o;
|
|
59
|
+
h && ((o = t.callback) == null || o.call(t, e.id, e.data));
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
if (e.item.type === "request") {
|
|
63
|
+
const t = e.item;
|
|
64
|
+
f.confirm({
|
|
65
|
+
title: i || m,
|
|
66
|
+
content: t.content
|
|
67
|
+
}).then(() => {
|
|
68
|
+
const h = typeof t.data == "function" ? t.data(e.id, e.data) : t.data, o = (t.method || "post").toLowerCase(), M = t.path || g;
|
|
69
|
+
v.mutate({
|
|
70
|
+
path: M,
|
|
71
|
+
method: o,
|
|
72
|
+
payload: h
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
if (e.item.type === "delete") {
|
|
77
|
+
const t = e.item;
|
|
78
|
+
f.confirm({
|
|
79
|
+
title: i || m,
|
|
80
|
+
content: t.content
|
|
81
|
+
}).then(() => {
|
|
82
|
+
A.mutate({
|
|
83
|
+
id: e.id,
|
|
84
|
+
path: t.path || g
|
|
85
|
+
});
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
if (e.item.type === "link") {
|
|
89
|
+
const t = e.item, h = typeof t.path == "function" ? (r = t.path) == null ? void 0 : r.call(t, e.id, e.data) : a.getRoutePath(e.id ? `${t.path || g}${e.data === void 0 ? "" : `/${e.id}`}` : t.path || g);
|
|
90
|
+
u.push(h);
|
|
91
|
+
}
|
|
92
|
+
if (e.item.type === "callback") {
|
|
93
|
+
const t = e.item;
|
|
94
|
+
(P = t.callback) == null || P.call(t, e.id, e.data);
|
|
95
|
+
}
|
|
96
|
+
}, w = q(), k = L();
|
|
97
|
+
return {
|
|
98
|
+
target: x,
|
|
99
|
+
renderTable: (e) => (i, m) => {
|
|
100
|
+
const r = {
|
|
101
|
+
id: i[e.key || (n == null ? void 0 : n.key) || "id"],
|
|
102
|
+
data: i,
|
|
103
|
+
index: m,
|
|
104
|
+
target: x,
|
|
105
|
+
text: e.text !== void 0 ? e.text : (n == null ? void 0 : n.text) || !1,
|
|
106
|
+
align: e.align !== void 0 ? e.align : (n == null ? void 0 : n.align) || "left"
|
|
107
|
+
};
|
|
108
|
+
return (e.type || (n == null ? void 0 : n.type)) === "button" ? w.render({
|
|
109
|
+
...r,
|
|
110
|
+
action: e || n
|
|
111
|
+
}) : k.render({
|
|
112
|
+
...r,
|
|
113
|
+
action: e || n
|
|
114
|
+
});
|
|
115
|
+
},
|
|
116
|
+
renderAction: (e) => {
|
|
117
|
+
const i = {
|
|
118
|
+
target: x,
|
|
119
|
+
text: e.text !== void 0 ? e.text : (n == null ? void 0 : n.text) || !1,
|
|
120
|
+
align: e.align !== void 0 ? e.align : (n == null ? void 0 : n.align) || "left"
|
|
121
|
+
};
|
|
122
|
+
return (e.type || (n == null ? void 0 : n.type)) === "button" ? w.render({
|
|
123
|
+
...i,
|
|
124
|
+
action: e || n
|
|
125
|
+
}) : k.render({
|
|
126
|
+
...i,
|
|
127
|
+
action: e || n
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
function q() {
|
|
133
|
+
const {
|
|
134
|
+
t: n
|
|
135
|
+
} = b();
|
|
136
|
+
return {
|
|
137
|
+
render: (d) => {
|
|
138
|
+
var c;
|
|
139
|
+
const f = (c = d.action.items) == null ? void 0 : c.filter((l) => {
|
|
140
|
+
var a;
|
|
141
|
+
return !l.show || ((a = l.show) == null ? void 0 : a.call(l, d.data, d.index));
|
|
142
|
+
}).map((l, a) => s(j, {
|
|
143
|
+
key: a,
|
|
144
|
+
type: l.color || l.type === "delete" ? "error" : "primary",
|
|
145
|
+
text: d.text,
|
|
146
|
+
onClick: () => {
|
|
147
|
+
var u;
|
|
148
|
+
(u = d == null ? void 0 : d.target) == null || u.call(d, {
|
|
149
|
+
id: d.id,
|
|
150
|
+
data: d.data,
|
|
151
|
+
item: l
|
|
152
|
+
});
|
|
153
|
+
},
|
|
154
|
+
renderIcon: l.icon ? () => s("div", {
|
|
155
|
+
class: ["n-icon", l.icon]
|
|
156
|
+
}) : void 0
|
|
157
|
+
}, () => n(l.label || "", {}, l.label)));
|
|
158
|
+
return s("div", {
|
|
159
|
+
class: ["flex gap-2 flex-wrap items-center", d.align === "right" ? "justify-end" : d.align === "center" ? "justify-center" : "justify-start"]
|
|
160
|
+
}, f);
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
}
|
|
164
|
+
function L() {
|
|
165
|
+
const {
|
|
166
|
+
t: n
|
|
167
|
+
} = b();
|
|
168
|
+
return {
|
|
169
|
+
render: (d) => {
|
|
170
|
+
var c;
|
|
171
|
+
const f = (c = d.action.items) == null ? void 0 : c.filter((l) => {
|
|
172
|
+
var a;
|
|
173
|
+
return !l.show || ((a = l.show) == null ? void 0 : a.call(l, d.data, d.index));
|
|
174
|
+
}).map((l, a) => ({
|
|
175
|
+
label: n(l.label || "", {}, l.label),
|
|
176
|
+
key: a,
|
|
177
|
+
icon: l.icon ? () => s("div", {
|
|
178
|
+
class: ["n-icon", l.icon]
|
|
179
|
+
}) : void 0,
|
|
180
|
+
onSelect: () => {
|
|
181
|
+
var u;
|
|
182
|
+
(u = d == null ? void 0 : d.target) == null || u.call(d, {
|
|
183
|
+
id: d.id,
|
|
184
|
+
data: d.data,
|
|
185
|
+
item: l
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
}));
|
|
189
|
+
return s(N, {
|
|
190
|
+
trigger: "click",
|
|
191
|
+
options: f,
|
|
192
|
+
onSelect: (l, a) => {
|
|
193
|
+
var u;
|
|
194
|
+
(u = a == null ? void 0 : a.onSelect) == null || u.call(a);
|
|
195
|
+
}
|
|
196
|
+
}, () => [s("div", {
|
|
197
|
+
class: ["flex items-center", d.align === "right" ? "justify-end" : d.align === "center" ? "justify-center" : "justify-start"]
|
|
198
|
+
}, s(j, {
|
|
199
|
+
type: "default",
|
|
200
|
+
text: d.text,
|
|
201
|
+
secondary: !d.text,
|
|
202
|
+
renderIcon: () => s("div", {
|
|
203
|
+
class: ["n-icon", "i-tabler:dots-vertical"]
|
|
204
|
+
})
|
|
205
|
+
}))]);
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
export {
|
|
210
|
+
U as useAction,
|
|
211
|
+
q as useActionButton,
|
|
212
|
+
L as useActionDropdown
|
|
213
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useOverlay as t } from "@duxweb/dvha-core";
|
|
2
|
+
function i() {
|
|
3
|
+
const e = t(), o = (r) => e.show({
|
|
4
|
+
component: () => import("../components/dialog/dialog.js"),
|
|
5
|
+
componentProps: r
|
|
6
|
+
});
|
|
7
|
+
return {
|
|
8
|
+
confirm: (r) => o({
|
|
9
|
+
...r,
|
|
10
|
+
type: "confirm"
|
|
11
|
+
}),
|
|
12
|
+
success: (r) => o({
|
|
13
|
+
...r,
|
|
14
|
+
type: "success"
|
|
15
|
+
}),
|
|
16
|
+
error: (r) => o({
|
|
17
|
+
...r,
|
|
18
|
+
type: "error"
|
|
19
|
+
}),
|
|
20
|
+
prompt: (r) => o({
|
|
21
|
+
...r,
|
|
22
|
+
type: "prompt"
|
|
23
|
+
}),
|
|
24
|
+
node: (r) => o({
|
|
25
|
+
...r,
|
|
26
|
+
type: "node"
|
|
27
|
+
})
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
i as useDialog
|
|
32
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { useOverlayInject as t } from "../node_modules/@overlastic/vue/dist/index.js";
|
|
2
|
+
import "vue";
|
|
3
|
+
import "naive-ui";
|
|
4
|
+
import "clsx";
|
|
5
|
+
import "jinrishici";
|
|
6
|
+
import "lodash-es";
|
|
7
|
+
import m from "../components/drawer/drawer.js";
|
|
8
|
+
import "@vueuse/core";
|
|
9
|
+
import "vee-validate";
|
|
10
|
+
import "@duxweb/dvha-core";
|
|
11
|
+
import "vue-router";
|
|
12
|
+
import "@duxweb/dvha-naiveui";
|
|
13
|
+
import "pinia";
|
|
14
|
+
import "@vee-validate/i18n";
|
|
15
|
+
import "vue-command-palette";
|
|
16
|
+
import "../pages/page404.js";
|
|
17
|
+
function I() {
|
|
18
|
+
const r = t(m);
|
|
19
|
+
return {
|
|
20
|
+
show: (o) => r(o)
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export {
|
|
24
|
+
I as useDrawer
|
|
25
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useOverlay as e } from "@duxweb/dvha-core";
|
|
2
|
+
function s() {
|
|
3
|
+
const r = e();
|
|
4
|
+
return {
|
|
5
|
+
show: (o) => r.show({
|
|
6
|
+
component: () => import("../components/modal/modal.js"),
|
|
7
|
+
componentProps: o,
|
|
8
|
+
mask: !o.draggable
|
|
9
|
+
})
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
s as useModal
|
|
14
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useManage as s } from "@duxweb/dvha-core";
|
|
2
|
+
import { useTableColumnCopy as C } from "./copy.js";
|
|
3
|
+
import { useTableColumnHidden as f } from "./hidden.js";
|
|
4
|
+
import { useTableColumnImage as b } from "./image.js";
|
|
5
|
+
import { useTableColumnInput as T } from "./input.js";
|
|
6
|
+
import { useTableColumnMap as M } from "./map.js";
|
|
7
|
+
import { useTableColumnMedia as h } from "./media.js";
|
|
8
|
+
import { useTableColumnStatus as I } from "./status.js";
|
|
9
|
+
import { useTableColumnSwitch as S } from "./switch.js";
|
|
10
|
+
function k(e) {
|
|
11
|
+
const { getPath: o } = s(), n = (e == null ? void 0 : e.path) || o(), r = (e == null ? void 0 : e.rowKey) || "id", t = h(), m = b(), u = S({
|
|
12
|
+
path: n,
|
|
13
|
+
rowKey: r
|
|
14
|
+
}), a = I(), d = M(), l = T({
|
|
15
|
+
path: n,
|
|
16
|
+
rowKey: r
|
|
17
|
+
}), c = C(), i = f();
|
|
18
|
+
return {
|
|
19
|
+
renderMedia: t.render,
|
|
20
|
+
renderImage: m.render,
|
|
21
|
+
renderSwitch: u.render,
|
|
22
|
+
renderStatus: a.render,
|
|
23
|
+
renderMap: d.render,
|
|
24
|
+
renderInput: l.render,
|
|
25
|
+
renderCopy: c.render,
|
|
26
|
+
renderHidden: i.render
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
k as useTableColumn
|
|
31
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { createVNode as r } from "vue";
|
|
2
|
+
import { useClipboard as c } from "@vueuse/core";
|
|
3
|
+
import { get as i } from "lodash-es";
|
|
4
|
+
import { useMessage as l } from "naive-ui";
|
|
5
|
+
function v() {
|
|
6
|
+
const t = l(), {
|
|
7
|
+
copy: o
|
|
8
|
+
} = c();
|
|
9
|
+
return {
|
|
10
|
+
render: (s) => (n, a) => {
|
|
11
|
+
const e = i(n, s.key || "");
|
|
12
|
+
return r("div", {
|
|
13
|
+
class: "flex"
|
|
14
|
+
}, [e && e !== "-" ? r("div", {
|
|
15
|
+
class: "flex justify-start items-center gap-1"
|
|
16
|
+
}, [r("div", null, [e]), r("div", {
|
|
17
|
+
class: "cursor-pointer i-tabler:copy size-4 text-muted hover:text-primary",
|
|
18
|
+
onClick: () => {
|
|
19
|
+
o(e).then(() => t.success("复制成功")).catch(() => t.error("复制失败"));
|
|
20
|
+
}
|
|
21
|
+
}, null)]) : "-"]);
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
v as useTableColumnCopy
|
|
27
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { createVNode as i, defineComponent as o, ref as u } from "vue";
|
|
2
|
+
import { get as a } from "lodash-es";
|
|
3
|
+
const d = /* @__PURE__ */ o({
|
|
4
|
+
name: "TableColumnHidden",
|
|
5
|
+
props: {
|
|
6
|
+
value: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ""
|
|
9
|
+
},
|
|
10
|
+
percent: {
|
|
11
|
+
type: Number,
|
|
12
|
+
default: 30
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setup(e) {
|
|
16
|
+
const t = u(!0);
|
|
17
|
+
return () => e.value ? i("div", {
|
|
18
|
+
class: "flex justify-start items-center gap-1"
|
|
19
|
+
}, [i("div", {
|
|
20
|
+
class: "font-mono"
|
|
21
|
+
}, [t.value ? c(e.value, e.percent) : e.value]), i("div", {
|
|
22
|
+
class: ["cursor-pointer size-4 text-muted hover:text-primary transition-all duration-150", t.value ? "i-tabler:eye" : "i-tabler:eye-off"],
|
|
23
|
+
onClick: () => {
|
|
24
|
+
t.value = !t.value;
|
|
25
|
+
}
|
|
26
|
+
}, null)]) : "-";
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
function m() {
|
|
30
|
+
return {
|
|
31
|
+
render: (t) => (n, r) => {
|
|
32
|
+
const l = a(n, t.key || "");
|
|
33
|
+
return i(d, {
|
|
34
|
+
value: l,
|
|
35
|
+
percent: t.percent
|
|
36
|
+
}, null);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
function c(e, t = 30) {
|
|
41
|
+
if (!e || e.length < 4)
|
|
42
|
+
return e;
|
|
43
|
+
const n = e.length, r = Math.ceil(n * t / 100), l = Math.floor((n - r) / 2);
|
|
44
|
+
return e.slice(0, l) + "*".repeat(r) + e.slice(l + r);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
m as useTableColumnHidden
|
|
48
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { createVNode as t } from "vue";
|
|
2
|
+
import { get as m } from "lodash-es";
|
|
3
|
+
import { NImage as l } from "naive-ui";
|
|
4
|
+
import n from "../../static/images/placeholder.png.js";
|
|
5
|
+
function p() {
|
|
6
|
+
return {
|
|
7
|
+
render: (r) => (a, d) => {
|
|
8
|
+
let e = m(a, r.key || "") || [];
|
|
9
|
+
return e = Array.isArray(e) ? e : [e], t("div", {
|
|
10
|
+
class: "flex flex-wrap gap-2"
|
|
11
|
+
}, [e.map((o, i) => t(l, {
|
|
12
|
+
key: i,
|
|
13
|
+
src: o,
|
|
14
|
+
width: r.imageWidth,
|
|
15
|
+
height: r.imageHeight,
|
|
16
|
+
fallbackSrc: n,
|
|
17
|
+
objectFit: "cover"
|
|
18
|
+
}, null))]);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
p as useTableColumnImage
|
|
24
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { createVNode as t, defineComponent as v, ref as f, h } from "vue";
|
|
2
|
+
import { useCustomMutation as s } from "@duxweb/dvha-core";
|
|
3
|
+
import { get as c } from "lodash-es";
|
|
4
|
+
import { useMessage as g, NInput as y, NButton as C } from "naive-ui";
|
|
5
|
+
const b = /* @__PURE__ */ v({
|
|
6
|
+
name: "TableColumnInput",
|
|
7
|
+
props: {
|
|
8
|
+
data: {
|
|
9
|
+
type: Object,
|
|
10
|
+
required: !0
|
|
11
|
+
},
|
|
12
|
+
field: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
},
|
|
16
|
+
path: {
|
|
17
|
+
type: String,
|
|
18
|
+
required: !0
|
|
19
|
+
},
|
|
20
|
+
tag: {
|
|
21
|
+
type: Object
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
setup(e) {
|
|
25
|
+
const d = f(!1), a = f(""), {
|
|
26
|
+
mutateAsync: i
|
|
27
|
+
} = s(), l = g(), n = (u) => {
|
|
28
|
+
i({
|
|
29
|
+
path: e.path,
|
|
30
|
+
method: "PATCH",
|
|
31
|
+
payload: {
|
|
32
|
+
[e.field]: u
|
|
33
|
+
}
|
|
34
|
+
}).then(() => {
|
|
35
|
+
l.success("保存成功");
|
|
36
|
+
}).catch((r) => {
|
|
37
|
+
l.error(r.message);
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
return () => d.value ? t("div", {
|
|
41
|
+
class: "flex gap-2"
|
|
42
|
+
}, [t("div", null, [h(e.tag || y, {
|
|
43
|
+
value: a.value,
|
|
44
|
+
"onUpdate:value": (u) => a.value = u,
|
|
45
|
+
autofocus: !0
|
|
46
|
+
})]), t(C, {
|
|
47
|
+
type: "primary",
|
|
48
|
+
onClick: () => {
|
|
49
|
+
a.value !== e.data[e.field] ? n(a.value) : d.value = !1;
|
|
50
|
+
},
|
|
51
|
+
renderIcon: () => t("div", {
|
|
52
|
+
class: "size-4 i-tabler:check"
|
|
53
|
+
}, null)
|
|
54
|
+
}, null)]) : t("div", {
|
|
55
|
+
class: "flex"
|
|
56
|
+
}, [t("div", {
|
|
57
|
+
class: "flex justify-start items-center gap-1"
|
|
58
|
+
}, [t("div", null, [e.data[e.field] === void 0 || e.data[e.field] === "" ? "-" : e.data[e.field]]), t("div", {
|
|
59
|
+
class: "cursor-pointer i-tabler:pencil size-4 text-muted hover:text-primary",
|
|
60
|
+
onClick: () => {
|
|
61
|
+
a.value = e.data[e.field], d.value = !0;
|
|
62
|
+
}
|
|
63
|
+
}, null)])]);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
function j(e) {
|
|
67
|
+
return {
|
|
68
|
+
render: (a) => (i, l) => {
|
|
69
|
+
const n = typeof (e == null ? void 0 : e.path) == "function" ? e == null ? void 0 : e.path(i) : `${e == null ? void 0 : e.path}/${c(i, (e == null ? void 0 : e.rowKey) || "id")}`;
|
|
70
|
+
return t(b, {
|
|
71
|
+
data: i,
|
|
72
|
+
field: a.key,
|
|
73
|
+
path: n,
|
|
74
|
+
tag: a.tag
|
|
75
|
+
}, null);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export {
|
|
80
|
+
j as useTableColumnInput
|
|
81
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createVNode as n } from "vue";
|
|
2
|
+
import { get as s } from "lodash-es";
|
|
3
|
+
function f() {
|
|
4
|
+
return {
|
|
5
|
+
render: (r) => (l, d) => {
|
|
6
|
+
const c = typeof r.maps == "function" ? r.maps(l) : r.maps;
|
|
7
|
+
return n("div", {
|
|
8
|
+
class: "flex flex-col gap-1"
|
|
9
|
+
}, [c == null ? void 0 : c.map((e) => n("div", {
|
|
10
|
+
class: "flex gap-2 "
|
|
11
|
+
}, [n("div", {
|
|
12
|
+
class: "flex text-muted items-center gap-1 whitespace-nowrap"
|
|
13
|
+
}, [e.icon && n("div", {
|
|
14
|
+
class: ["size-4", e.icon]
|
|
15
|
+
}, null), e.label]), n("div", null, [e != null && e.render ? e.render(s(l, e.key || "")) : s(l, e.key || "")])]))]);
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export {
|
|
20
|
+
f as useTableColumnMap
|
|
21
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { createVNode as r } from "vue";
|
|
2
|
+
import { get as i } from "lodash-es";
|
|
3
|
+
import "naive-ui";
|
|
4
|
+
import "clsx";
|
|
5
|
+
import "jinrishici";
|
|
6
|
+
import "../../node_modules/@overlastic/vue/dist/index.js";
|
|
7
|
+
import "@vueuse/core";
|
|
8
|
+
import "vee-validate";
|
|
9
|
+
import "@duxweb/dvha-core";
|
|
10
|
+
import "vue-router";
|
|
11
|
+
import "@duxweb/dvha-naiveui";
|
|
12
|
+
import "pinia";
|
|
13
|
+
import "@vee-validate/i18n";
|
|
14
|
+
import "vue-command-palette";
|
|
15
|
+
import "../../pages/page404.js";
|
|
16
|
+
import { DuxMedia as c } from "../../components/media/media.js";
|
|
17
|
+
function V() {
|
|
18
|
+
return {
|
|
19
|
+
render: (t) => (e, g) => {
|
|
20
|
+
const m = typeof t.title == "function" ? t.title(e) : i(e, t.title || ""), n = typeof t.desc == "function" ? t.desc(e) : i(e, t.desc || ""), o = typeof t.image == "function" ? t.image(e) : i(e, t.image || "");
|
|
21
|
+
return r(c, {
|
|
22
|
+
title: m,
|
|
23
|
+
desc: n,
|
|
24
|
+
avatar: t.avatar,
|
|
25
|
+
image: o,
|
|
26
|
+
imageWidth: t.imageWidth,
|
|
27
|
+
imageHeight: t.imageHeight
|
|
28
|
+
}, null);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
export {
|
|
33
|
+
V as useTableColumnMedia
|
|
34
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createVNode as l, Fragment as u } from "vue";
|
|
2
|
+
import { findKey as d, get as o } from "lodash-es";
|
|
3
|
+
import { NTag as s } from "naive-ui";
|
|
4
|
+
function g() {
|
|
5
|
+
return {
|
|
6
|
+
render: (n) => (c, m) => {
|
|
7
|
+
var i;
|
|
8
|
+
const a = (n == null ? void 0 : n.key) || "status", e = d(n.maps, (t) => t ? (t == null ? void 0 : t.value) === o(c, a) : !1), r = e ? (i = n.maps) == null ? void 0 : i[e] : void 0;
|
|
9
|
+
return r ? l(s, {
|
|
10
|
+
round: !0,
|
|
11
|
+
bordered: !0,
|
|
12
|
+
type: e
|
|
13
|
+
}, {
|
|
14
|
+
icon: () => l(u, null, [e === "success" && l("div", {
|
|
15
|
+
class: "n-icon i-tabler:circle-check-filled"
|
|
16
|
+
}, null), e === "error" && l("div", {
|
|
17
|
+
class: "n-icon i-tabler:circle-x-filled"
|
|
18
|
+
}, null), e === "warning" && l("div", {
|
|
19
|
+
class: "n-icon i-tabler:exclamation-circle-filled"
|
|
20
|
+
}, null), (e === "default" || e === "info") && l("div", {
|
|
21
|
+
class: "n-icon i-tabler:info-circle-filled"
|
|
22
|
+
}, null)]),
|
|
23
|
+
default: () => l("span", {
|
|
24
|
+
class: "text-sm"
|
|
25
|
+
}, [r == null ? void 0 : r.label])
|
|
26
|
+
}) : null;
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export {
|
|
31
|
+
g as useTableColumnStatus
|
|
32
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createVNode as C } from "vue";
|
|
2
|
+
import { useCustomMutation as n } from "@duxweb/dvha-core";
|
|
3
|
+
import { get as r } from "lodash-es";
|
|
4
|
+
import { useMessage as x, NSwitch as A } from "naive-ui";
|
|
5
|
+
function $(e) {
|
|
6
|
+
const {
|
|
7
|
+
mutateAsync: a
|
|
8
|
+
} = n(), d = x();
|
|
9
|
+
return {
|
|
10
|
+
render: (f) => (t, M) => {
|
|
11
|
+
const i = f.key || "status", y = typeof (e == null ? void 0 : e.path) == "function" ? e == null ? void 0 : e.path(t) : `${e == null ? void 0 : e.path}/${r(t, (e == null ? void 0 : e.rowKey) || "id")}`;
|
|
12
|
+
return C(A, {
|
|
13
|
+
value: !!t[i],
|
|
14
|
+
onUpdateValue: (h) => {
|
|
15
|
+
t[i] = h, a({
|
|
16
|
+
path: y,
|
|
17
|
+
method: "PATCH",
|
|
18
|
+
payload: {
|
|
19
|
+
[i]: h
|
|
20
|
+
}
|
|
21
|
+
}).then(() => {
|
|
22
|
+
t[i] = h;
|
|
23
|
+
}).catch((g) => {
|
|
24
|
+
t[i] = !h, d.error(g.message);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}, null);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
$ as useTableColumnSwitch
|
|
33
|
+
};
|