pukaad-ui-lib 1.236.0 → 1.237.0
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/module.json +1 -1
- package/dist/runtime/components/card/card-user-blog.d.vue.ts +2 -0
- package/dist/runtime/components/card/card-user-blog.vue +21 -2
- package/dist/runtime/components/card/card-user-blog.vue.d.ts +2 -0
- package/dist/runtime/components/picker/picker-option-menu/picker-option-menu-user.d.vue.ts +2 -2
- package/dist/runtime/components/picker/picker-option-menu/picker-option-menu-user.vue.d.ts +2 -2
- package/package.json +1 -1
package/dist/module.json
CHANGED
|
@@ -25,8 +25,10 @@ type __VLS_Props = {
|
|
|
25
25
|
};
|
|
26
26
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
27
|
"blog-updated": () => any;
|
|
28
|
+
"blog-deleted": () => any;
|
|
28
29
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
30
|
"onBlog-updated"?: (() => any) | undefined;
|
|
31
|
+
"onBlog-deleted"?: (() => any) | undefined;
|
|
30
32
|
}>, {
|
|
31
33
|
isMyProfile: boolean;
|
|
32
34
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
@blog-unpin="onBlogUnpin"
|
|
40
40
|
@blog-pin="onBlogPin"
|
|
41
41
|
@blog-edit="onBlogEdit"
|
|
42
|
+
@blog-delete="onBlogDelete"
|
|
42
43
|
/>
|
|
43
44
|
</div>
|
|
44
45
|
<div class="flex flex-col gap-[16px] cursor-pointer" @click="onBlogClick">
|
|
@@ -91,14 +92,14 @@ import { useNuxtApp } from "nuxt/app";
|
|
|
91
92
|
import { useConvert } from "@/runtime/composables/useConvert";
|
|
92
93
|
import { useApi } from "../../composables/useApi";
|
|
93
94
|
const { convertNumber, convertDateTorelativeText } = useConvert();
|
|
94
|
-
const { $toast } = useNuxtApp();
|
|
95
|
+
const { $toast, $alert } = useNuxtApp();
|
|
95
96
|
const api = useApi();
|
|
96
97
|
const props = defineProps({
|
|
97
98
|
item: { type: Object, required: true },
|
|
98
99
|
isMyProfile: { type: Boolean, required: false, default: false }
|
|
99
100
|
});
|
|
100
101
|
const router = useRouter();
|
|
101
|
-
const emit = defineEmits(["blog-updated"]);
|
|
102
|
+
const emit = defineEmits(["blog-updated", "blog-deleted"]);
|
|
102
103
|
const isPinned = ref(props.item.is_pinned);
|
|
103
104
|
const isEditDrawerOpen = ref(false);
|
|
104
105
|
const editBlogItem = ref(null);
|
|
@@ -154,4 +155,22 @@ const onBlogEdit = async () => {
|
|
|
154
155
|
const onEditSuccess = () => {
|
|
155
156
|
emit("blog-updated");
|
|
156
157
|
};
|
|
158
|
+
const onBlogDelete = async () => {
|
|
159
|
+
const { isConfirmed } = await $alert.show({
|
|
160
|
+
type: "warning",
|
|
161
|
+
title: "\u0E25\u0E1A\u0E1A\u0E17\u0E04\u0E27\u0E32\u0E21\u0E19\u0E35\u0E49?",
|
|
162
|
+
description: "\u0E1A\u0E17\u0E04\u0E27\u0E32\u0E21\u0E08\u0E30\u0E16\u0E39\u0E01\u0E25\u0E1A\u0E16\u0E32\u0E27\u0E23\u0E41\u0E25\u0E30\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E01\u0E39\u0E49\u0E04\u0E37\u0E19\u0E44\u0E14\u0E49",
|
|
163
|
+
confirmText: "\u0E25\u0E1A",
|
|
164
|
+
cancelText: "\u0E22\u0E01\u0E40\u0E25\u0E34\u0E01",
|
|
165
|
+
showCancelBtn: true
|
|
166
|
+
});
|
|
167
|
+
if (!isConfirmed) return;
|
|
168
|
+
try {
|
|
169
|
+
await api(`/blogs/${props.item.id}`, { method: "DELETE" });
|
|
170
|
+
$toast.success("\u0E25\u0E1A\u0E1A\u0E17\u0E04\u0E27\u0E32\u0E21\u0E2A\u0E33\u0E40\u0E23\u0E47\u0E08");
|
|
171
|
+
emit("blog-deleted");
|
|
172
|
+
} catch (e) {
|
|
173
|
+
$toast.error(e?.data?.message?.description || "\u0E44\u0E21\u0E48\u0E2A\u0E32\u0E21\u0E32\u0E23\u0E16\u0E25\u0E1A\u0E1A\u0E17\u0E04\u0E27\u0E32\u0E21\u0E44\u0E14\u0E49");
|
|
174
|
+
}
|
|
175
|
+
};
|
|
157
176
|
</script>
|
|
@@ -25,8 +25,10 @@ type __VLS_Props = {
|
|
|
25
25
|
};
|
|
26
26
|
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
|
|
27
27
|
"blog-updated": () => any;
|
|
28
|
+
"blog-deleted": () => any;
|
|
28
29
|
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
29
30
|
"onBlog-updated"?: (() => any) | undefined;
|
|
31
|
+
"onBlog-deleted"?: (() => any) | undefined;
|
|
30
32
|
}>, {
|
|
31
33
|
isMyProfile: boolean;
|
|
32
34
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
@@ -4,12 +4,12 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
4
4
|
"blog-unpin": () => any;
|
|
5
5
|
"blog-pin": () => any;
|
|
6
6
|
"blog-edit": () => any;
|
|
7
|
+
"blog-delete": () => any;
|
|
7
8
|
"profile-name-updated": (name: string) => any;
|
|
8
9
|
"profile-edit": () => any;
|
|
9
10
|
"profile-share": () => any;
|
|
10
11
|
"profile-follower-delete": () => any;
|
|
11
12
|
"profile-block": () => any;
|
|
12
|
-
"blog-delete": () => any;
|
|
13
13
|
"report-blog": () => any;
|
|
14
14
|
"report-place": () => any;
|
|
15
15
|
"report-profile": () => any;
|
|
@@ -23,12 +23,12 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
23
23
|
"onBlog-unpin"?: (() => any) | undefined;
|
|
24
24
|
"onBlog-pin"?: (() => any) | undefined;
|
|
25
25
|
"onBlog-edit"?: (() => any) | undefined;
|
|
26
|
+
"onBlog-delete"?: (() => any) | undefined;
|
|
26
27
|
"onProfile-name-updated"?: ((name: string) => any) | undefined;
|
|
27
28
|
"onProfile-edit"?: (() => any) | undefined;
|
|
28
29
|
"onProfile-share"?: (() => any) | undefined;
|
|
29
30
|
"onProfile-follower-delete"?: (() => any) | undefined;
|
|
30
31
|
"onProfile-block"?: (() => any) | undefined;
|
|
31
|
-
"onBlog-delete"?: (() => any) | undefined;
|
|
32
32
|
"onReport-blog"?: (() => any) | undefined;
|
|
33
33
|
"onReport-place"?: (() => any) | undefined;
|
|
34
34
|
"onReport-profile"?: (() => any) | undefined;
|
|
@@ -4,12 +4,12 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
4
4
|
"blog-unpin": () => any;
|
|
5
5
|
"blog-pin": () => any;
|
|
6
6
|
"blog-edit": () => any;
|
|
7
|
+
"blog-delete": () => any;
|
|
7
8
|
"profile-name-updated": (name: string) => any;
|
|
8
9
|
"profile-edit": () => any;
|
|
9
10
|
"profile-share": () => any;
|
|
10
11
|
"profile-follower-delete": () => any;
|
|
11
12
|
"profile-block": () => any;
|
|
12
|
-
"blog-delete": () => any;
|
|
13
13
|
"report-blog": () => any;
|
|
14
14
|
"report-place": () => any;
|
|
15
15
|
"report-profile": () => any;
|
|
@@ -23,12 +23,12 @@ declare const __VLS_export: import("vue").DefineComponent<PickerOptionMenuUserPr
|
|
|
23
23
|
"onBlog-unpin"?: (() => any) | undefined;
|
|
24
24
|
"onBlog-pin"?: (() => any) | undefined;
|
|
25
25
|
"onBlog-edit"?: (() => any) | undefined;
|
|
26
|
+
"onBlog-delete"?: (() => any) | undefined;
|
|
26
27
|
"onProfile-name-updated"?: ((name: string) => any) | undefined;
|
|
27
28
|
"onProfile-edit"?: (() => any) | undefined;
|
|
28
29
|
"onProfile-share"?: (() => any) | undefined;
|
|
29
30
|
"onProfile-follower-delete"?: (() => any) | undefined;
|
|
30
31
|
"onProfile-block"?: (() => any) | undefined;
|
|
31
|
-
"onBlog-delete"?: (() => any) | undefined;
|
|
32
32
|
"onReport-blog"?: (() => any) | undefined;
|
|
33
33
|
"onReport-place"?: (() => any) | undefined;
|
|
34
34
|
"onReport-profile"?: (() => any) | undefined;
|