+
+
-
-
-
-
-
-
- Nội dung danh sách bài viết của danh mục sẽ ở đây
+
+
+
@@ -161,35 +161,9 @@ const mapActivesToItems = (index: number) => {
display: flex;
flex-direction: column;
/* gap: 10px; */
- overflow-x: scroll;
&.border-custom {
border-color: #e5e5e5 !important;
}
- &.borderLeft {
- border-left: 1px solid;
- }
- &.borderRight {
- border-right: 1px solid;
- }
- &.borderTop {
- border-top: 1px solid;
- }
- &.borderBottom {
- border-bottom: 1px solid;
- }
- }
- .empty {
- width: 100%;
- height: 100%;
- min-height: 50px;
- background-color: #409eff;
- display: flex;
- white-space: normal;
- justify-content: center;
- align-items: center;
- h6 {
- color: #fff;
- }
}
.basic-article {
&.article {
@@ -198,9 +172,6 @@ const mapActivesToItems = (index: number) => {
pointer-events: none;
}
}
- &.noData {
- border-radius: 6px;
- }
.flex {
display: flex;
@@ -218,17 +189,21 @@ const mapActivesToItems = (index: number) => {
.btn-page {
width: 40px;
height: 40px;
+ padding: 9px 16px;
text-align: center;
line-height: 36px;
- border: 1px solid #409eff;
- border-radius: 3px;
+ border-radius: 4px;
margin-left: 10px;
display: flex;
justify-content: center;
align-items: center;
+ gap: 8px;
+ flex-shrink: 0;
+ background: #f2f2f2;
cursor: pointer;
+ color: #222222;
&.active {
- background: #409eff;
+ background: #ed1c24;
color: white;
}
}
diff --git a/server/models/dynamic-page/index.ts b/server/models/dynamic-page/index.ts
index 6512f4e..c11079a 100644
--- a/server/models/dynamic-page/index.ts
+++ b/server/models/dynamic-page/index.ts
@@ -30,81 +30,81 @@ interface PageComponentSettings {
dataResult?: string; // Kết quả dữ liệu (Json)
}
export type PageSection = {
- id?: number; // Mã định danh
- siteId?: number; // Mã hệ thống
- pageId?: number; // Mã trang
- parentId?: number; // Mã vùng cha
- title?: string; // Tiêu đề
- slug?: string; // (Anchor)
- code?: string; // Mã nhận diện
- content?: string; // Nội dung
- keywords?: string; // Từ khóa
- description?: string; // Mô tả
- type?: number; // Phân loại: PageSectionType
- features?: string; // Đặc trưng: Featured (nổi bật)
- taxonomy?: string; // Phân loại: Block | Module | Navigation
- settings?: PageSectionSettings; // Thiết lập: PageSectionSettings (Json)
- isPublished?: boolean; // Đã xuất bản
- publishedBy?: number; // Xuất bản bởi
- publishedOn?: string; // Xuất bản vào lúc (string)
- expiresOn?: string; // Hết hạn vào lúc (string)
- order?: number; // Thứ tự sắp xếp
- status?: number; // Trạng thái
+ id?: number; // Mã định danh
+ siteId?: number; // Mã hệ thống
+ pageId?: number; // Mã trang
+ parentId?: number; // Mã vùng cha
+ title?: string; // Tiêu đề
+ slug?: string; // (Anchor)
+ code?: string; // Mã nhận diện
+ content?: string; // Nội dung
+ keywords?: string; // Từ khóa
+ description?: string; // Mô tả
+ type?: number; // Phân loại: PageSectionType
+ features?: string; // Đặc trưng: Featured (nổi bật)
+ taxonomy?: string; // Phân loại: Block | Module | Navigation
+ settings?: PageSectionSettings; // Thiết lập: PageSectionSettings (Json)
+ isPublished?: boolean; // Đã xuất bản
+ publishedBy?: number; // Xuất bản bởi
+ publishedOn?: string; // Xuất bản vào lúc (string)
+ expiresOn?: string; // Hết hạn vào lúc (string)
+ order?: number; // Thứ tự sắp xếp
+ status?: number; // Trạng thái
}
interface PageComponent extends Base {
- id?: number; // Mã định danh
- siteId?: number; // Mã hệ thống
- pageId?: number; // Mã trang
- sectionId?: number; // Mã vùng
- title?: string; // Tiêu đề
- code?: string; // Mã nhận diện
- content?: string; // Nội dung
- type?: number; // Phân loại: PageComponentType
- features?: string; // Đặc trưng: Featured (nổi bật)
- taxonomy?: string; // Phân loại
- settings?: PageComponentSettings; // Thiết lập: PageComponentSettings (Json)
- isPublished?: boolean; // Đã xuất bản
- publishedBy?: number; // Xuất bản bởi
- publishedOn?: string; // Xuất bản vào lúc (string)
- expiresOn?: string; // Hết hạn vào lúc (string)
- order?: number; // Thứ tự sắp xếp
- status?: number; // Trạng thái
+ id?: number; // Mã định danh
+ siteId?: number; // Mã hệ thống
+ pageId?: number; // Mã trang
+ sectionId?: number; // Mã vùng
+ title?: string; // Tiêu đề
+ code?: string; // Mã nhận diện
+ content?: string; // Nội dung
+ type?: number; // Phân loại: PageComponentType
+ features?: string; // Đặc trưng: Featured (nổi bật)
+ taxonomy?: string; // Phân loại
+ settings?: PageComponentSettings; // Thiết lập: PageComponentSettings (Json)
+ isPublished?: boolean; // Đã xuất bản
+ publishedBy?: number; // Xuất bản bởi
+ publishedOn?: string; // Xuất bản vào lúc (string)
+ expiresOn?: string; // Hết hạn vào lúc (string)
+ order?: number; // Thứ tự sắp xếp
+ status?: number; // Trạng thái
}
interface Page extends Base {
- id?: number; // Mã định danh
- siteId?: number; // Mã hệ thống
- parentId?: number; // Mã trang cha
- title?: string; // Tiêu đề
- slug?: string; // Slug
- code?: string; // Mã nhận diện
- content?: string; // Nội dung
- favicon?: string; // Biểu tượng
- keywords?: string; // Từ khóa
- thumbnail?: string; // Ảnh đại diện
- description?: string; // Mô tả
- type?: number; // Phân loại: PageType
- features?: string; // Đặc trưng: Featured (nổi bật)
- taxonomy?: string; // Phân nhóm
- settings?: PageSettings; // Thiết lập: PageSettings (Json)
- isPublished?: boolean; // Đã xuất bản
- publishedBy?: number; // Đã xuất bản bởi
- publishedOn?: string; // Đã xuất bản vào lúc (string)
- expiresOn?: string; // Đã hết hạn vào lúc (string)
- order?: number; // Thứ tự sắp xếp
- status?: number; // Trạng thái
-
- components?: PageComponent[];
- sections?: PageSection[];
+ id?: number; // Mã định danh
+ siteId?: number; // Mã hệ thống
+ parentId?: number; // Mã trang cha
+ title?: string; // Tiêu đề
+ slug?: string; // Slug
+ code?: string; // Mã nhận diện
+ content?: string; // Nội dung
+ favicon?: string; // Biểu tượng
+ keywords?: string; // Từ khóa
+ thumbnail?: string; // Ảnh đại diện
+ description?: string; // Mô tả
+ type?: number; // Phân loại: PageType
+ features?: string; // Đặc trưng: Featured (nổi bật)
+ taxonomy?: string; // Phân nhóm
+ settings?: PageSettings; // Thiết lập: PageSettings (Json)
+ isPublished?: boolean; // Đã xuất bản
+ publishedBy?: number; // Đã xuất bản bởi
+ publishedOn?: string; // Đã xuất bản vào lúc (string)
+ expiresOn?: string; // Đã hết hạn vào lúc (string)
+ order?: number; // Thứ tự sắp xếp
+ status?: number; // Trạng thái
+
+ components?: PageComponent[];
+ sections?: PageSection[];
}
-export const getDynamicPageByCode = async (event : any) => {
+export const getDynamicPageByCode = async (event: any) => {
try {
const { apiUrl } = useRuntimeConfig().public
const slug = event.context.params.slug;
const { item }: any = await $fetch(`${apiUrl}/cms/page/overview-page/slug:${slug}`, {
headers: new Headers({
site: '1' || 1,
- }),
+ }),
})
return item
} catch (error) {
@@ -112,13 +112,28 @@ export const getDynamicPageByCode = async (event : any) => {
}
}
-export const getDynamicPageById = async (event : any) => {
+export const getDynamicPageById = async (event: any) => {
try {
const { apiUrl } = useRuntimeConfig().public
const id = event.context.params.id;
const { item }: any = await $fetch(`${apiUrl}/cms/overview-page/${id}`)
- return item
+ return item
} catch (error) {
handleError(error);
}
+}
+export async function getOverviewPageComponentById(event: any) {
+ try {
+ const { apiUrl } = useRuntimeConfig().public
+ const { componentId, dataQuery } = getQuery(event)
+ return await $fetch(`${apiUrl}/cms/overview-page-component/${componentId}`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: dataQuery,
+ });
+ } catch (err) {
+ handleError(err);
+ }
}
\ No newline at end of file
diff --git a/stores/dynamic-page.ts b/stores/dynamic-page.ts
index 8c8f5c5..1511ebc 100644
--- a/stores/dynamic-page.ts
+++ b/stores/dynamic-page.ts
@@ -60,6 +60,23 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
} catch (error: any) {}
}
+ async function getOverviewPageComponentById(componentId, dataQuery) {
+ try {
+ const { apiUrl } = useRuntimeConfig().public
+ const res = await $fetch(`${apiUrl}/cms/page-component/overview-page-component/${componentId}`, {
+ method: "POST",
+ headers: {
+ "Content-Type": "application/json",
+ },
+ body: JSON.stringify(dataQuery),
+ });
+ return res
+ } catch (err) {
+ throw err;
+ }
+ }
+
+
return {
currentPage,
sectionPublished,
@@ -69,6 +86,7 @@ export const useDynamicPageStore = defineStore("dynamicPageStore", () => {
setSectionPublished,
setComponentPublished,
setDataQuery,
+ getOverviewPageComponentById
};
});