@@ -95,13 +99,27 @@ const handlerCancel = () => {
{{ owner?.displayName }}
+
+
+
+
+ {{ `待审核` }}
+
+
+
+
{
>
- {{ relativeTimeTo(moment?.spec.releaseTime) }}
+ {{ relativeTimeTo(previewMoment.spec.releaseTime) }}
{
/>
+
+ 审核通过
+
编辑
删除
@@ -141,9 +165,8 @@ const handlerCancel = () => {
({
- queryKey: ["moments-tags"],
- queryFn: async () => {
- const { data } = await apiClient.get(
- "/apis/console.api.moment.halo.run/v1alpha1/tags",
- {
- params: {
- name: keyword.value,
- },
- }
- );
- return data;
- },
+const { data: tags, refetch } = useConsoleTagQueryFetch({
+ keyword,
});
const searchResults = computed(() => tags.value || []);
diff --git a/console/src/components/TextEditor.vue b/console/src/components/TextEditor.vue
index efe62a1..9738c48 100644
--- a/console/src/components/TextEditor.vue
+++ b/console/src/components/TextEditor.vue
@@ -44,6 +44,8 @@ import {
} from "@halo-dev/richtext-editor";
import { watch } from "vue";
import { TagsExtension } from "@/extensions/tags";
+import type { useTagQueryFetchProps } from "@/composables/use-tag";
+import type { UseQueryReturnType } from "@tanstack/vue-query";
import MomentExtensionImage from "@/extensions/images";
const props = withDefaults(
@@ -51,6 +53,9 @@ const props = withDefaults(
html: string;
raw: string;
isEmpty: boolean;
+ tagQueryFetch: (
+ props: useTagQueryFetchProps
+ ) => UseQueryReturnType;
}>(),
{
html: "",
@@ -130,7 +135,9 @@ const editor = useEditor({
}),
ExtensionHighlight,
ExtensionListKeymap,
- TagsExtension,
+ TagsExtension.configure({
+ tagQueryFetch: props.tagQueryFetch,
+ }),
],
autofocus: "end",
onUpdate: () => {
diff --git a/console/src/composables/use-tag.ts b/console/src/composables/use-tag.ts
new file mode 100644
index 0000000..c791ded
--- /dev/null
+++ b/console/src/composables/use-tag.ts
@@ -0,0 +1,39 @@
+import apiClient from "@/utils/api-client";
+import { useQuery } from "@tanstack/vue-query";
+import type { Ref } from "vue";
+
+export interface useTagQueryFetchProps {
+ keyword?: Ref;
+}
+
+export function useConsoleTagQueryFetch(
+ props: useTagQueryFetchProps
+): ReturnType {
+ return useTagQueryFetch("console", props);
+}
+
+export function useUCTagQueryFetch(
+ props: useTagQueryFetchProps
+): ReturnType {
+ return useTagQueryFetch("uc", props);
+}
+
+export function useTagQueryFetch(
+ group: "console" | "uc",
+ props: useTagQueryFetchProps
+): ReturnType {
+ return useQuery({
+ queryKey: ["moments-tags", props.keyword],
+ queryFn: async () => {
+ const { data } = await apiClient.get(
+ `/apis/${group}.api.moment.halo.run/v1alpha1/tags`,
+ {
+ params: {
+ name: props.keyword?.value,
+ },
+ }
+ );
+ return data;
+ },
+ });
+}
diff --git a/console/src/extensions/tags/TagsExtensionView.vue b/console/src/extensions/tags/TagsExtensionView.vue
index 7289d52..1b09076 100644
--- a/console/src/extensions/tags/TagsExtensionView.vue
+++ b/console/src/extensions/tags/TagsExtensionView.vue
@@ -1,42 +1,35 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/console/src/uc/MomentItem.vue b/console/src/uc/MomentItem.vue
new file mode 100644
index 0000000..dab9d2c
--- /dev/null
+++ b/console/src/uc/MomentItem.vue
@@ -0,0 +1,168 @@
+
+
+
+
diff --git a/console/src/uc/MomentsList.vue b/console/src/uc/MomentsList.vue
new file mode 100644
index 0000000..7b61307
--- /dev/null
+++ b/console/src/uc/MomentsList.vue
@@ -0,0 +1,230 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 暂无数据
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/console/src/uc/TagFilterDropdown.vue b/console/src/uc/TagFilterDropdown.vue
new file mode 100644
index 0000000..43dd4c5
--- /dev/null
+++ b/console/src/uc/TagFilterDropdown.vue
@@ -0,0 +1,112 @@
+
+
+
+
+
+
+ {{ label }}
+
+ {{ label }}:{{ modelValue }}
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+ {{ tag }}
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/console/src/views/MomentsList.vue b/console/src/views/MomentsList.vue
index 4ab348c..91984fd 100644
--- a/console/src/views/MomentsList.vue
+++ b/console/src/views/MomentsList.vue
@@ -1,5 +1,5 @@