diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..279e4eb --- /dev/null +++ b/.env.example @@ -0,0 +1,10 @@ +NUXT_PUBLIC_BASE_API=https://api.vpress.vn/api-v1 +NUXT_PUBLIC_SITE_DEFAULT=1 +PUBLIC_BASE_SERVER_RESOURCE=https://acp-api.vpress.vn +PUBLIC_PAGING_PAGE=1 +PUBLIC_PAGING_LIMIT=10 +AUTH_SECRET=vpress +GOOGLE_CLIENT_ID=410090780886-odisqirb9ghresjoop8rg3ad0fn8jl0s.apps.googleusercontent.com +GOOGLE_CLIENT_SECRET=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 +FACEBOOK_CLIENT_ID=280456401372340 +FACEBOOK_CLIENT_SECRET=86d6272c3a03d25442ecd7ccbf0c204c \ No newline at end of file diff --git a/.env.production b/.env.production new file mode 100644 index 0000000..77425a6 --- /dev/null +++ b/.env.production @@ -0,0 +1,7 @@ +NUXT_PUBLIC_BASE_API=https://api.vpress.vn/api-v1 +NUXT_PUBLIC_SITE_DEFAULT=1 +PUBLIC_BASE_SERVER_RESOURCE=https://api.vpress.vn +PUBLIC_PAGING_PAGE=1 +PUBLIC_PAGING_LIMIT=10 +AUTH_SECRET=vpress +AUTH_ORIGIN=https://vpress.vn \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b827f3e --- /dev/null +++ b/.gitignore @@ -0,0 +1,25 @@ +# Nuxt dev/build outputs +.output +.data +.nuxt +.nitro +.cache +dist + +# Node dependencies +node_modules + +# Logs +logs +*.log + +# Misc +.DS_Store +.fleet +.idea + +package-lock.json +yarn.lock +bun.lockb + +.env \ No newline at end of file diff --git a/.npmrc b/.npmrc new file mode 100644 index 0000000..cf04042 --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +shamefully-hoist=true +strict-peer-dependencies=false diff --git a/README.md b/README.md index 2826b2e..595dda9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,63 @@ -# NSG_PORTAL_V2 +# Nuxt 3 Minimal Starter +Look at the [Nuxt 3 documentation](https://nuxt.com/docs/getting-started/introduction) to learn more. + +## Setup + +Make sure to install the dependencies: + +```bash +# npm +npm install + +# pnpm +pnpm install + +# yarn +yarn install +``` + +## Development Server + +Start the development server on `http://localhost:3000`: + +```bash +# npm +npm run dev + +# pnpm +pnpm run dev + +# yarn +yarn dev +``` + +## Production + +Build the application for production: + +```bash +# npm +npm run build + +# pnpm +pnpm run build + +# yarn +yarn build +``` + +Locally preview production build: + +```bash +# npm +npm run preview + +# pnpm +pnpm run preview + +# yarn +yarn preview +``` + +Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information. diff --git a/app.vue b/app.vue new file mode 100644 index 0000000..2fab925 --- /dev/null +++ b/app.vue @@ -0,0 +1,49 @@ + + + \ No newline at end of file diff --git a/assets/styles/app.sass b/assets/styles/app.sass new file mode 100644 index 0000000..5b6616a --- /dev/null +++ b/assets/styles/app.sass @@ -0,0 +1,12 @@ +@import custom.css +body + font-family: 'Nunito', sans-serif + +video + max-width: 100% !important + width: unset !important + height: unset !important + +iframe + width: 100% !important + \ No newline at end of file diff --git a/assets/styles/custom.css b/assets/styles/custom.css new file mode 100644 index 0000000..ae0f44b --- /dev/null +++ b/assets/styles/custom.css @@ -0,0 +1,287 @@ + +@import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap'); + +.custom_scrollbar { + white-space: nowrap; + overflow-x: auto; + overflow-y: hidden; + max-width: 100%; + margin: 5px 0px; + scrollbar-color: #f5f5f5 transparent; + scrollbar-width: thin; +} + +.custom_scrollbar::-webkit-scrollbar { + width: 4px; + height: 4px; +} +.custom_scrollbar::-webkit-scrollbar-thumb { + background: #cdcccc; + border-radius: 4px; +} +.custom_scrollbar::-webkit-scrollbar-track { + background: transparent; +} + +/* tiny */ + +figure.image { + display: table; + margin-left: 0; +} + +figure.image img { + margin-left: 0; + margin: 0; +} +img.wide { + display: block; + height: auto; + margin-left: 0; + max-width: 70%; + width: 70%; + transform: translateX(20%); +} + +figure.image.wide { + display: block; + height: auto; + max-width: auto; + width: auto; +} + +img.full-width { + max-width: 100%; + width: 100%; +} + +figure.image.full-width { + display: block; + max-width: 100%; + width: 100%; +} + +figure.image img, +figure.image.aside img, +figure.image.wide img, +figure.image.full-width img { + /* height: 100%; */ + /* max-width: 100%; */ + width: 100%; +} +figure figcaption { + color: #8a8f97; + display: block; + margin-top: 0.25rem; + text-align: center; +} +blockquote { + background: #f9f9f9; + border-left: 10px solid #ccc; + margin: 1.5em 10px; + padding: 0.5em 10px; + quotes: "\201C""\201D""\2018""\2019"; +} +blockquote:before { + color: #ccc; + content: open-quote; + font-size: 3em; + line-height: 0.1em; + margin-right: 0.25em; + vertical-align: -0.4em; +} +blockquote:after { + color: #ccc; + content: close-quote; + font-size: 3em; + line-height: 0.1em; + margin-right: 0.25em; + vertical-align: -0.4em; + margin-left: 0.25em; +} + +/* menu link */ +.menu-link{ + color: #757575; + + &:hover{ + @apply text-blue; + } + + &.active{ + @apply text-blue; + } +} +articlerelation img.relationImg{ + height: 100px !important; + width: 200px !important; + object-fit: cover; + border-radius: 7px; +} + articlerelation{ + margin-bottom: 12px; + display: inline-block; + cursor: pointer; +} +span.box{ + margin-top: 12px; + margin-bottom: 12px; + display: inline-block; +} +articlerelation >*{ + pointer-events: none; +} +articlerelation:hover .relationText{ + color: #3c7abc; + } +span.boxRelation{ + display: flex ; + gap: 12px ; + +} +span.boxRelation .relationBoxText{ + display: flex; + flex-direction: column; + flex: 1; +} + +span.boxRelation .relationText{ + font-size: 18px; + font-weight: 600; +} +span.boxRelation .relationDay{ + font-size: 14px; +} +figcaption.PhotoCMS_Caption p{ + display: inline-block; +} +@media only screen and (min-width: 600px){ + .width_common.box-widget-thethao-2{ + display: block !important; + } +} +.width_common.box-widget-thethao-2{ + border: 1px solid #e5e5e5; + position: relative; + border-radius: 20px 20px 0 0; + border-bottom: 0; + margin-bottom: 44px; + box-shadow: 0px 2px 2px rgba(185,192,210,0.2); + display: none; +} +.box-widget-thethao-2 .logo-left img{ + position: absolute; + opacity: 7%; + width: 35%; + left: -38px; + top: 22%; + +} +.box-widget-thethao-2 .logo-right img{ + position: absolute; + opacity: 12%; + right: -23px; + top: 22%; + z-index: 1; +} +.box-widget-thethao-2 .header-tt{ + padding: 12px 26px; + border-radius: 10px 10px 0 0; + background: black; + color: white; + display: flex; + justify-content: space-between; +} +.box-widget-thethao-2 .header-tt .txt-note{ + font-weight: 800; +} +a.width_common.team-kq{ + display: flex; + align-items: center; + background: white; + z-index: 10; + justify-content: space-between; + padding: 0 20px; + margin-top: 20px; +} +a.width_common.team-kq .team-pl{ + display: flex; + align-items: center; + gap: 5px; +} +span.name-team{ + font-weight: 700; +} +.flag-team{ + width: 48px; +} +.res-m{ + display: flex; + align-items: center; + flex-direction: column; + padding: 12px 53px; + border-radius: 9px; + background: #3E506D; + font-size: 35px; + font-weight: 900; + color: white; +} +.res-m .sub-res{ + font-size: 14px; + font-weight: 400; +} +.team-pl.team-away{ + font-weight: 700; +} +.dienbien{ + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 20px 20px; + flex: 1; + border-bottom: 1px solid #e5e5e5; +} +.dienbien .left .row{ + display: flex; + align-items: center; + gap: 5px; + flex-direction: row-reverse; +} +.dienbien .right .row{ + display: flex; + align-items: center; + gap: 5px; + justify-content: flex-end; + flex-direction: row-reverse; + +} +.dienbien .right .row .flag-team{ + width: fit-content; +} +.note-bot{ + margin-top: 10px; + position: absolute; +} +.bg-gradient-radial { + background-image: radial-gradient(97.99% 97.99% at 84.51% 2.01%, red 0%, #eaa23e 99.5%) !important; +} +.glide__bullet.glide__bullet--active{ + background: red ; +} +@media only screen and (min-width: 768px) { + /* For desktop: */ + .block-right { + float: right; + width: 50%; + } + .block-center { + display: block; + margin-left: auto; + margin-right: auto; + text-align: center; + } + .block-left { + float: left; + width: 50%; + } +} diff --git a/assets/svg/logo.svg b/assets/svg/logo.svg new file mode 100644 index 0000000..e94172c --- /dev/null +++ b/assets/svg/logo.svg @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/dynamic-page/page-component/templates/articles/collections/BasicCollection.vue b/components/dynamic-page/page-component/templates/articles/collections/BasicCollection.vue new file mode 100644 index 0000000..95f5573 --- /dev/null +++ b/components/dynamic-page/page-component/templates/articles/collections/BasicCollection.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/components/dynamic-page/page-component/templates/articles/individuals/Card.vue b/components/dynamic-page/page-component/templates/articles/individuals/Card.vue new file mode 100644 index 0000000..7343cb2 --- /dev/null +++ b/components/dynamic-page/page-component/templates/articles/individuals/Card.vue @@ -0,0 +1,136 @@ + + + + + diff --git a/components/dynamic-page/page-component/templates/categories/BasicCategories.vue b/components/dynamic-page/page-component/templates/categories/BasicCategories.vue new file mode 100644 index 0000000..4e75be2 --- /dev/null +++ b/components/dynamic-page/page-component/templates/categories/BasicCategories.vue @@ -0,0 +1,95 @@ + + + + + diff --git a/components/dynamic-page/page-component/templates/components/AudioPlayer.vue b/components/dynamic-page/page-component/templates/components/AudioPlayer.vue new file mode 100644 index 0000000..f7d7f30 --- /dev/null +++ b/components/dynamic-page/page-component/templates/components/AudioPlayer.vue @@ -0,0 +1,156 @@ + + + + diff --git a/components/dynamic-page/page-component/templates/components/Podcast.vue b/components/dynamic-page/page-component/templates/components/Podcast.vue new file mode 100644 index 0000000..69a14c8 --- /dev/null +++ b/components/dynamic-page/page-component/templates/components/Podcast.vue @@ -0,0 +1,191 @@ + + + diff --git a/components/dynamic-page/page-component/templates/components/Video.vue b/components/dynamic-page/page-component/templates/components/Video.vue new file mode 100644 index 0000000..347a57d --- /dev/null +++ b/components/dynamic-page/page-component/templates/components/Video.vue @@ -0,0 +1,74 @@ + + diff --git a/components/dynamic-page/page-component/templates/index.ts b/components/dynamic-page/page-component/templates/index.ts new file mode 100644 index 0000000..91e3dcf --- /dev/null +++ b/components/dynamic-page/page-component/templates/index.ts @@ -0,0 +1,7 @@ +// Article +export { default as Article_BasicCard } from './articles/individuals/Card.vue' +export { default as Article_BasicCollection } from './articles/collections/BasicCollection.vue' + +// Category +export { default as BasicCategories } from './categories/BasicCategories.vue' +export { default as CollectionPaging } from './pageCategories/collection_page.vue' \ No newline at end of file diff --git a/components/dynamic-page/page-component/templates/index.vue b/components/dynamic-page/page-component/templates/index.vue new file mode 100644 index 0000000..c2d2fdd --- /dev/null +++ b/components/dynamic-page/page-component/templates/index.vue @@ -0,0 +1,37 @@ + + + diff --git a/components/dynamic-page/page-component/templates/pageCategories/collection_page.vue b/components/dynamic-page/page-component/templates/pageCategories/collection_page.vue new file mode 100644 index 0000000..e3c36e1 --- /dev/null +++ b/components/dynamic-page/page-component/templates/pageCategories/collection_page.vue @@ -0,0 +1,194 @@ + + + + + diff --git a/components/dynamic-page/page-section/RecusiveSection.vue b/components/dynamic-page/page-section/RecusiveSection.vue new file mode 100644 index 0000000..b9c9717 --- /dev/null +++ b/components/dynamic-page/page-section/RecusiveSection.vue @@ -0,0 +1,70 @@ + + + + + diff --git a/components/dynamic-page/page-section/layouts/Default.vue b/components/dynamic-page/page-section/layouts/Default.vue new file mode 100644 index 0000000..8a846ac --- /dev/null +++ b/components/dynamic-page/page-section/layouts/Default.vue @@ -0,0 +1,178 @@ + + + + + diff --git a/components/dynamic-page/page-section/layouts/index.ts b/components/dynamic-page/page-section/layouts/index.ts new file mode 100644 index 0000000..92185eb --- /dev/null +++ b/components/dynamic-page/page-section/layouts/index.ts @@ -0,0 +1 @@ +export { default as BASE_LAYOUT } from './Default.vue' diff --git a/components/dynamic-page/page-section/layouts/index.vue b/components/dynamic-page/page-section/layouts/index.vue new file mode 100644 index 0000000..5b69e35 --- /dev/null +++ b/components/dynamic-page/page-section/layouts/index.vue @@ -0,0 +1,61 @@ + + + diff --git a/components/dynamic-page/page-section/templates/articles/Default.vue b/components/dynamic-page/page-section/templates/articles/Default.vue new file mode 100644 index 0000000..9d979a6 --- /dev/null +++ b/components/dynamic-page/page-section/templates/articles/Default.vue @@ -0,0 +1,48 @@ + + + + + \ No newline at end of file diff --git a/components/dynamic-page/page-section/templates/homes/Basic.vue b/components/dynamic-page/page-section/templates/homes/Basic.vue new file mode 100644 index 0000000..437a288 --- /dev/null +++ b/components/dynamic-page/page-section/templates/homes/Basic.vue @@ -0,0 +1,77 @@ + + + + + diff --git a/components/dynamic-page/page-section/templates/index.ts b/components/dynamic-page/page-section/templates/index.ts new file mode 100644 index 0000000..1ac4c32 --- /dev/null +++ b/components/dynamic-page/page-section/templates/index.ts @@ -0,0 +1 @@ +export { default as Article_Section_Default } from './articles/Default.vue' diff --git a/components/dynamic-page/page-section/templates/index.vue b/components/dynamic-page/page-section/templates/index.vue new file mode 100644 index 0000000..e79d22f --- /dev/null +++ b/components/dynamic-page/page-section/templates/index.vue @@ -0,0 +1,52 @@ + + + diff --git a/components/dynamic-page/page/layouts/Default.vue b/components/dynamic-page/page/layouts/Default.vue new file mode 100644 index 0000000..b4a0de5 --- /dev/null +++ b/components/dynamic-page/page/layouts/Default.vue @@ -0,0 +1,72 @@ + + + + + diff --git a/components/dynamic-page/page/layouts/articles/Long.vue b/components/dynamic-page/page/layouts/articles/Long.vue new file mode 100644 index 0000000..9e7752b --- /dev/null +++ b/components/dynamic-page/page/layouts/articles/Long.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/components/dynamic-page/page/layouts/articles/None.vue b/components/dynamic-page/page/layouts/articles/None.vue new file mode 100644 index 0000000..d662eea --- /dev/null +++ b/components/dynamic-page/page/layouts/articles/None.vue @@ -0,0 +1,42 @@ +/* +- LayoutType: None=0 | Normal=1 | Short=2 | Long=3 | Page=4 +- ContentType: None=0 | General=1 | Photo=2 | Audio=3 | Video=4 | Graphic=5 | Document=6 | Interaction=7 (Poll,Quiz) +*/ + + + + + diff --git a/components/dynamic-page/page/layouts/articles/Normal.vue b/components/dynamic-page/page/layouts/articles/Normal.vue new file mode 100644 index 0000000..9e7752b --- /dev/null +++ b/components/dynamic-page/page/layouts/articles/Normal.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/components/dynamic-page/page/layouts/articles/Page.vue b/components/dynamic-page/page/layouts/articles/Page.vue new file mode 100644 index 0000000..d662eea --- /dev/null +++ b/components/dynamic-page/page/layouts/articles/Page.vue @@ -0,0 +1,42 @@ +/* +- LayoutType: None=0 | Normal=1 | Short=2 | Long=3 | Page=4 +- ContentType: None=0 | General=1 | Photo=2 | Audio=3 | Video=4 | Graphic=5 | Document=6 | Interaction=7 (Poll,Quiz) +*/ + + + + + diff --git a/components/dynamic-page/page/layouts/articles/Short.vue b/components/dynamic-page/page/layouts/articles/Short.vue new file mode 100644 index 0000000..9e7752b --- /dev/null +++ b/components/dynamic-page/page/layouts/articles/Short.vue @@ -0,0 +1,32 @@ + + + + + diff --git a/components/dynamic-page/page/layouts/index.ts b/components/dynamic-page/page/layouts/index.ts new file mode 100644 index 0000000..70ac50c --- /dev/null +++ b/components/dynamic-page/page/layouts/index.ts @@ -0,0 +1,8 @@ +export { default as BASE_LAYOUT } from './Default.vue' + +// Article +export { default as ARTICLE_LONG_LAYOUT } from './articles/Long.vue' +export { default as ARTICLE_NONE_LAYOUT } from './articles/None.vue' +export { default as ARTICLE_NORMAL_LAYOUT } from './articles/Normal.vue' +export { default as ARTICLE_PAGE_LAYOUT } from './articles/Page.vue' +export { default as ARTICLE_SHORT_LAYOUT } from './articles/Short.vue' diff --git a/components/dynamic-page/page/layouts/index.vue b/components/dynamic-page/page/layouts/index.vue new file mode 100644 index 0000000..508dd22 --- /dev/null +++ b/components/dynamic-page/page/layouts/index.vue @@ -0,0 +1,50 @@ + + + diff --git a/components/dynamic-page/page/templates/articles/Default.vue b/components/dynamic-page/page/templates/articles/Default.vue new file mode 100644 index 0000000..dfbfade --- /dev/null +++ b/components/dynamic-page/page/templates/articles/Default.vue @@ -0,0 +1,19 @@ + + + diff --git a/components/dynamic-page/page/templates/components/footers/FooterHomeTemplate.vue b/components/dynamic-page/page/templates/components/footers/FooterHomeTemplate.vue new file mode 100644 index 0000000..e3b465e --- /dev/null +++ b/components/dynamic-page/page/templates/components/footers/FooterHomeTemplate.vue @@ -0,0 +1,237 @@ + + + + diff --git a/components/dynamic-page/page/templates/components/headers/HeaderHomeTemplate.vue b/components/dynamic-page/page/templates/components/headers/HeaderHomeTemplate.vue new file mode 100644 index 0000000..e3b465e --- /dev/null +++ b/components/dynamic-page/page/templates/components/headers/HeaderHomeTemplate.vue @@ -0,0 +1,237 @@ + + + + diff --git a/components/dynamic-page/page/templates/components/headers/logo.svg b/components/dynamic-page/page/templates/components/headers/logo.svg new file mode 100644 index 0000000..08d989f --- /dev/null +++ b/components/dynamic-page/page/templates/components/headers/logo.svg @@ -0,0 +1,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/components/dynamic-page/page/templates/homes/Basic.vue b/components/dynamic-page/page/templates/homes/Basic.vue new file mode 100644 index 0000000..76973ac --- /dev/null +++ b/components/dynamic-page/page/templates/homes/Basic.vue @@ -0,0 +1,19 @@ + + + diff --git a/components/dynamic-page/page/templates/index.ts b/components/dynamic-page/page/templates/index.ts new file mode 100644 index 0000000..ca8dc45 --- /dev/null +++ b/components/dynamic-page/page/templates/index.ts @@ -0,0 +1 @@ +export { default as HomeBasic } from './homes/Basic.vue' \ No newline at end of file diff --git a/components/dynamic-page/page/templates/index.vue b/components/dynamic-page/page/templates/index.vue new file mode 100644 index 0000000..935158d --- /dev/null +++ b/components/dynamic-page/page/templates/index.vue @@ -0,0 +1,36 @@ + + + \ No newline at end of file diff --git a/definitions/base-exception.ts b/definitions/base-exception.ts new file mode 100644 index 0000000..055eccf --- /dev/null +++ b/definitions/base-exception.ts @@ -0,0 +1,11 @@ +export const exceptionMessages = [ + { title: 'Unhandled Exception', value: 'Unhandled Exception' }, + { title: 'Unable to {0}', value: (entity: string) => `Unable to ${entity}` }, + { title: '{0} does not exist', value: (entity: string) => `${entity} does not exist` }, + { title: '{0} is not valid', value: (entity: string) => `${entity} is not valid` }, + { title: '{0} is not ready', value: (entity: string) => `${entity} is not ready` }, + { title: '{0} is not activated', value: (entity: string) => `${entity} is not activated` }, + { title: '{0} is not available', value: (entity: string) => `${entity} is not available` }, + { title: '{0} has expired', value: (entity: string) => `${entity} has expired` }, + { title: '{0} has been deleted', value: (entity: string) => `${entity} has been deleted` }, +]; diff --git a/definitions/base-gender.ts b/definitions/base-gender.ts new file mode 100644 index 0000000..7d76595 --- /dev/null +++ b/definitions/base-gender.ts @@ -0,0 +1,6 @@ +export const BaseGender = [ + { title: 'Nam', value: 1 }, + { title: 'Nữ', value: 2 }, + { title: 'Khác', value: 3 }, + ]; + \ No newline at end of file diff --git a/definitions/base-nationlity.ts b/definitions/base-nationlity.ts new file mode 100644 index 0000000..b81fd40 --- /dev/null +++ b/definitions/base-nationlity.ts @@ -0,0 +1,4 @@ +export const nationlityOptions = [ + { title: 'Anh', value: '0' }, + { title: 'Việt Nam', value: '1' }, + ]; diff --git a/definitions/base-sidebar.ts b/definitions/base-sidebar.ts new file mode 100644 index 0000000..3d2ddad --- /dev/null +++ b/definitions/base-sidebar.ts @@ -0,0 +1,365 @@ +export const baseSideBarMenu = [ + { + "components": [ + { + "operations": [ + { + "id": 119, + "siteId": 1, + "moduleId": 6, + "componentId": 24, + "title": "Xóa phòng ban", + "code": "delete", + "route": "HRM/GROUP/DELETE", + "description": "Quyền xóa phòng ban ", + "feature": "", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + }, + { + "id": 118, + "siteId": 1, + "moduleId": 6, + "componentId": 24, + "title": "Sửa phòng ban ", + "code": "update", + "route": "HRM/GROUP/UPDATE", + "description": "Quyền sửa phòng ban ", + "feature": "Navigation", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + }, + { + "id": 120, + "siteId": 1, + "moduleId": 6, + "componentId": 24, + "title": "Danh sách phòng ban", + "code": "manage", + "route": "HRM/GROUP/MANAGE", + "description": "Quyền hiển thị danh sách phòng ban", + "feature": "", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + }, + { + "id": 117, + "siteId": 1, + "moduleId": 6, + "componentId": 24, + "title": "Thêm phòng ban mới", + "code": "create", + "route": "HRM/GROUP/CREATE", + "description": "Quyền tạo phòng ban ", + "feature": "Navigation", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + } + ], + "id": 24, + "siteId": 1, + "moduleId": 6, + "title": "Group", + "code": "GROUP", + "route": "hrm/group", + "icon": "ri-article-line", + "description": "Quản lý phòng ban", + "order": 18, + "status": 6, + "createdBy": null, + "createdOn": null, + "updatedBy": null, + "updatedOn": null + }, + { + "operations": [ + { + "id": 123, + "siteId": 1, + "moduleId": 6, + "componentId": 25, + "title": "Xóa vai trò", + "code": "delete", + "route": "HRM/ROLE/DELETE", + "description": "Quyền xóa vai trò ", + "feature": "", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + }, + { + "id": 121, + "siteId": 1, + "moduleId": 6, + "componentId": 25, + "title": "Thêm vai trò mới", + "code": "create", + "route": "HRM/ROLE/CREATE", + "description": "Quyền tạo vai trò ", + "feature": "Navigation", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + }, + { + "id": 122, + "siteId": 1, + "moduleId": 6, + "componentId": 25, + "title": "Sửa vai trò ", + "code": "update", + "route": "HRM/ROLE/UPDATE", + "description": "Quyền sửa vai trò ", + "feature": "", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + }, + { + "id": 124, + "siteId": 1, + "moduleId": 6, + "componentId": 25, + "title": "Danh sách vai trò", + "code": "manage", + "route": "HRM/ROLE/MANAGE", + "description": "Quyền hiển thị danh sách vai trò", + "feature": "Navigation", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + } + ], + "id": 25, + "siteId": 1, + "moduleId": 6, + "title": "Role", + "code": "ROLE", + "route": "hrm/role", + "icon": "ri-article-line", + "description": "Quản lý vai trò", + "order": 19, + "status": 6, + "createdBy": null, + "createdOn": null, + "updatedBy": null, + "updatedOn": null + }, + { + "operations": [ + { + "id": 125, + "siteId": 1, + "moduleId": 6, + "componentId": 26, + "title": "Thêm quyền hạn mới", + "code": "create", + "route": "HRM/PERMISSION/CREATE", + "description": "Quyền tạo quyền hạn ", + "feature": "Navigation", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + }, + { + "id": 126, + "siteId": 1, + "moduleId": 6, + "componentId": 26, + "title": "Sửa quyền hạn", + "code": "update", + "route": "HRM/PERMISSION/UPDATE", + "description": "Quyền sửa quyền hạn", + "feature": "", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + }, + { + "id": 127, + "siteId": 1, + "moduleId": 6, + "componentId": 26, + "title": "Xóa quyền hạn", + "code": "delete", + "route": "HRM/PERMISSION/DELETE", + "description": "Quyền xóa quyền hạn ", + "feature": "", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + }, + { + "id": 128, + "siteId": 1, + "moduleId": 6, + "componentId": 26, + "title": "Danh sách quyền hạn", + "code": "manage", + "route": "HRM/PERMISSION/MANAGE", + "description": "Quyền hiển thị danh sách quyền hạn", + "feature": "Navigation", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + } + ], + "id": 26, + "siteId": 1, + "moduleId": 6, + "title": "Permission", + "code": "PERMISSION", + "route": "hrm/permission", + "icon": "ri-article-line", + "description": "Quản lý quyền hạn", + "order": 20, + "status": 6, + "createdBy": null, + "createdOn": null, + "updatedBy": null, + "updatedOn": null + }, + { + "operations": [ + { + "id": 133, + "siteId": 1, + "moduleId": 6, + "componentId": 27, + "title": "Thêm người dùng mới", + "code": "create", + "route": "HRM/USER/CREATE", + "description": "Quyền tạo người dùng ", + "feature": "Navigation", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + }, + { + "id": 134, + "siteId": 1, + "moduleId": 6, + "componentId": 27, + "title": "Sửa người dùng ", + "code": "update", + "route": "HRM/USER/UPDATE", + "description": "Quyền sửa người dùng ", + "feature": "", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + }, + { + "id": 135, + "siteId": 1, + "moduleId": 6, + "componentId": 27, + "title": "Xóa người dùng", + "code": "delete", + "route": "HRM/USER/DELETE", + "description": "Quyền xóa người dùng ", + "feature": "", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + }, + { + "id": 136, + "siteId": 1, + "moduleId": 6, + "componentId": 27, + "title": "Danh sách người dùng", + "code": "manage", + "route": "HRM/USER/MANAGE", + "description": "Quyền hiển thị danh sách người dùng", + "feature": "Navigation", + "order": null, + "status": 6, + "createdBy": 1, + "createdOn": "2023-12-13T10:48:47.667016", + "updatedBy": null, + "updatedOn": null + } + ], + "id": 27, + "siteId": 1, + "moduleId": 6, + "title": "User", + "code": "USER", + "route": "hrm/user", + "icon": "ri-article-line", + "description": "Quản lý người dùng", + "order": 21, + "status": 6, + "createdBy": null, + "createdOn": null, + "updatedBy": null, + "updatedOn": null + } + ], + "id": 6, + "siteId": 1, + "parentId": null, + "title": "Quản lý tổ chức", + "code": "HRM", + "route": null, + "icon": "ri-line-chart-fill", + "description": "Quản lý tổ chức", + "order": 3, + "status": 6, + "createdBy": null, + "createdOn": null, + "updatedBy": null, + "updatedOn": null + }, + +] diff --git a/definitions/base-status.ts b/definitions/base-status.ts new file mode 100644 index 0000000..6c02842 --- /dev/null +++ b/definitions/base-status.ts @@ -0,0 +1,13 @@ +export const baseStatus = [ + // { title: "All", value: null, key: "" }, // tất cả + { title: "Processing", value: 1, key: "1" }, // đang xử lý + { title: "Cancelled", value: 2, key: "2" }, // đã hủy + { title: "Completed", value: 3, key: "3" }, // hoàn thành + { title: "Approving", value: 4, key: "4" }, // chờ duyệt + { title: "Approved", value: 5, key: "5" }, // đã duyệt + { title: "Activated", value: 6, key: "6" }, // đã kích hoạt + { title: "Deactivated", value: 7, key: "7" }, // hủy kích hoạt + { title: "Suspended", value: 8, key: "8" }, // đã đình chỉ + { title: "Locked", value: 9, key: "9" }, // đã khóa + { title: "Deleted", value: -1, key: "-1" }, // đã xóa +]; diff --git a/definitions/base-taxonomy.ts b/definitions/base-taxonomy.ts new file mode 100644 index 0000000..c09c125 --- /dev/null +++ b/definitions/base-taxonomy.ts @@ -0,0 +1,8 @@ +export const taskTaxonomy = [ + { title: "Soạn thảo", value: "Soạn thảo", value_number: "1" }, + { title: "Biên tập", value: "Biên tập", value_number: "2" }, + { title: "Xem xét", value: "Xem xét", value_number: "3" }, + { title: "Duyệt bài", value: "Duyệt bài", value_number: "4" }, + { title: "Xuất bản", value: "Xuất bản", value_number: "5" }, + { title: "Dàn trang", value: "Dàn trang", value_number: "6" }, +]; diff --git a/definitions/boolean-options.ts b/definitions/boolean-options.ts new file mode 100644 index 0000000..af5afc7 --- /dev/null +++ b/definitions/boolean-options.ts @@ -0,0 +1,5 @@ +export const booleanOptions = [ + { title: 'True', value: true }, + { title: 'False', value: false }, + ]; + \ No newline at end of file diff --git a/definitions/breakpoint.ts b/definitions/breakpoint.ts new file mode 100644 index 0000000..7ea1d29 --- /dev/null +++ b/definitions/breakpoint.ts @@ -0,0 +1,9 @@ +export const breakpoint = { + xxs: 0, + xs: 375, + sm: 576, + md: 768, + lg: 992, + xl: 1200, + xxl: 1400 +} \ No newline at end of file diff --git a/definitions/category-layouts.ts b/definitions/category-layouts.ts new file mode 100644 index 0000000..ab43c18 --- /dev/null +++ b/definitions/category-layouts.ts @@ -0,0 +1,48 @@ +export const categoryLayouts = [ + { + title: 'Bố cục 1', + id: 1, + thumb: 'https://i.imgur.com/SJMRAv0.jpg' + }, + { + title: 'Bố cục 2', + id: 2, + thumb: 'https://i.imgur.com/QYOe6Wb.jpg' + }, + { + title: 'Bố cục 3', + id: 3, + thumb: 'https://i.imgur.com/IBcBPSA.jpg' + }, + { + title: 'Bố cục 4', + id: 4, + thumb: 'https://i.imgur.com/P2Wu4Vu.jpg' + }, + { + title: 'Bố cục 5', + id: 5, + thumb: 'https://i.imgur.com/2n2LzRZ.jpg' + }, + { + title: 'Bố cục 6', + id: 6, + thumb: ' ' + }, + { + title: 'Bố cục 7', + id: 7, + thumb: 'https://i.imgur.com/mRIHVdy.jpg' + }, + { + title: 'Bố cục 8', + id: 8, + thumb: 'https://i.imgur.com/4k0YxaV.jpg' + }, + { + title: 'Bố cục 9', + id: 9, + thumb: 'https://i.imgur.com/GCdGyeb.jpg' + }, + +] \ No newline at end of file diff --git a/definitions/cms/advertisement.type.ts b/definitions/cms/advertisement.type.ts new file mode 100644 index 0000000..4d4cca3 --- /dev/null +++ b/definitions/cms/advertisement.type.ts @@ -0,0 +1,4 @@ +export const advertisementType = [ + { title: "None", value: "None" }, + { title: "NoEffect", value: "NoEffect" }, +]; diff --git a/definitions/cms/article.type.ts b/definitions/cms/article.type.ts new file mode 100644 index 0000000..e9d02f7 --- /dev/null +++ b/definitions/cms/article.type.ts @@ -0,0 +1,146 @@ +export const articleType = [ + { title: "None", value: 0 }, + { title: "Editorial", value: 1 }, // Tự luận - xã luận + { title: "General", value: 2 }, // Tổng hợp + { title: "Reportage", value: 3 }, // Phóng sự + { title: "Interview", value: 4 }, // Phỏng vấn + { title: "Survey", value: 5 }, // Khảo sát + { title: "Tutorial", value: 6 }, // Hướng dẫn + { title: "Podcast", value: 7 }, // Tin tiếng + { title: "Broadcast", value: 8 }, // Trực tuyến + { title: "Talkshow", value: 9 }, // Tọa đàm + { title: "Livestream", value: 10 }, // Phát trực tiếp + { title: "Translation", value: 11 }, // Dịch thuật + { title: "Promotion", value: 12 }, // Quảng bá +]; + +export const articleLayout = [ + { title: "None", value: 0 }, + { title: "Normal", value: 1 }, // Thông thường + { title: "Short", value: 2 }, // Ngắn + { title: "Long", value: 3 }, // Dài + { title: "Page", value: 4 }, // Trang +]; + +export const articleContentType = [ + { title: "None", value: 0 }, + { title: "General", value: 1 }, //Tổng hợp + { title: "Photo", value: 2 }, // Ảnh + { title: "Audio", value: 3 }, // Âm thanh + { title: "Video", value: 4 }, // Video + { title: "Graphic", value: 5 }, // Đồ họa + { title: "Document", value: 6 }, // Văn bản + { title: "Interaction", value: 7 }, // Tương tác (Poll, Quiz) +]; + +export const articleComponentType = [ + { title: "None", value: 0 }, + { title: "Sub", value: 1 }, //Tiền tố + { title: "Title", value: 2 }, // Tiêu đề + { title: "Intro", value: 3 }, // Giới thiệu + { title: "Brief", value: 4 }, // Tóm tắt nội dung + { title: "Detail", value: 5 }, // Nội dung chi tiết + { title: "Sumary", value: 6 }, // Tóm tắt bài viết + { title: "Represent", value: 7 }, // Nội dung đại diện +]; + +export const articleStateType = [ + { title: "None", value: 0 }, + { title: "Drafting", value: 5 }, // Soạn thảo + { title: "Polishing", value: 10 }, // Hoàn thiện + { title: "Reviewing", value: 15 }, // Xem xét + { title: "Approving", value: 20 }, // Duyệt bài + { title: "Publishing", value: 25 }, // Xuất bản + { title: "UnPublishing", value: 30 }, // Hủy xuất bản +]; + +export const articlePublishType = [ + // { title: "None", value: 0 }, + { title: "Digital", value: 1 }, // Xuất bản số + { title: "Printing", value: 2 }, // Xuất bản in + { title: "Sharing", value: 3 }, // xuất bản chia sẻ + { title: "Digital_Printing", value: 12 }, // xuất bản số và in ấn + { title: "All", value: 99 }, +]; + +export const articleInteractionType = [ + { title: "View", value: "View" }, // Xem + { title: "Like", value: "Like" }, // Thích + { title: "Rate", value: "Rate" }, // Đánh giá + { title: "Share", value: "Share" }, // Chia sẻ + { title: "Report", value: "Report" }, // Báo cáo + { title: "Comment", value: "Comment" }, // Bình luận + { title: "Download", value: "Download" }, // Tải về + { title: "Follow", value: "Follow" }, // Theo dõi + { title: "Bookmark", value: "Bookmark" }, // Đánh dấu + { title: "Subscribe", value: "Subscribe" }, // Đăng ký theo dõi + { title: "PollSubmit", value: "PollSubmit" }, // Thực hiện bình chọn + { title: "QuizSubmit", value: "QuizSubmit" }, // Thực hiện trắc ngiệm + { title: "SurveySubmit", value: "SurveySubmit" }, // Thực hiện khảo sát +]; + +export const articleCommentType = [ + { title: "None", value: 0 }, + { title: "Comment", value: 1 }, // Bình luận + { title: "ReplyComment", value: 2 }, // Phản hồi +]; + +export const interactionType = [ + { title: "View", value: "View" }, // Xem + { title: "Like", value: "Like" }, // Thích + { title: "Rate", value: "Rate" }, // Đánh giá + { title: "Share", value: "Share" }, // Chia sẻ + { title: "Report", value: "Report" }, // Báo cáo + { title: "Comment", value: "Comment" }, // Bình luận + { title: "Download", value: "Download" }, // Tải về + { title: "Follow", value: "Follow" }, // Theo dõi + { title: "Bookmark", value: "Bookmark" }, // Đánh dấu + { title: "Subscribe", value: "Subscribe" }, // Đăng ký theo dõi + { title: "PollSubmit", value: "PollSubmit" }, // Thực hiện bình chọn + { title: "QuizSubmit", value: "QuizSubmit" }, // Thực hiện trắc ngiệm + { title: "SurveySubmit", value: "SurveySubmit" }, // Thực hiện khảo sát +]; + +export const articleRelationType = [ + { title: "None", value: 0 }, + { title: "SameContent", value: 1 }, + { title: "SameTag", value: 2 }, + { title: "SameFigure", value: 3 }, + { title: "SameLocation", value: 4 }, + { title: "SameAuthor", value: 5 }, + { title: "SameCategory", value: 6 }, + { title: "SameTopic", value: 7 }, + { title: "SameEvent", value: 8 }, + { title: "SameCollection", value: 9 }, +]; + +export const articleReportType = [ + { title: "None", value: 0 }, + { title: "Author", value: 1 }, // Tác giả + { title: "Content", value: 2 }, // Nội dung + { title: "Copyright", value: 3 }, // Bản quyền + { title: "Other", value: 99 }, // Khác +]; + +export const articleSourceType = [ + { title: "None", value: 0 }, + { title: "Synthesize", value: 1 }, // Tổng hợp + { title: "GenerativeAI", value: 2 }, // Trí tuệ nhân tạo + { title: "SearchEngine", value: 3 }, // Máy tìm kiếm + { title: "SocialNetwork", value: 4 }, // Mạng xã hội + { title: "Other", value: 99 }, // Khác +]; + +export const digitalArticleCommentType = [ + { title: "None", value: 0 }, + { title: "Comment", value: 1 }, // Bình luận + { title: "ReplyComment", value: 2 }, // Phản hồi +]; + +export const sharingSiteType = [ + // { title: "None", value: 0 }, + { title: "Facebook", value: 1 }, + { title: "Tiwtter", value: 2 }, + { title: "Youtube", value: 6 }, + // { title: "Tiktok", value: 7 }, +]; diff --git a/definitions/cms/attachment.type.ts b/definitions/cms/attachment.type.ts new file mode 100644 index 0000000..1dccecb --- /dev/null +++ b/definitions/cms/attachment.type.ts @@ -0,0 +1 @@ +export const attachmentType = [{ title: "None", value: 0 }]; diff --git a/definitions/cms/audio.type.ts b/definitions/cms/audio.type.ts new file mode 100644 index 0000000..0a100f6 --- /dev/null +++ b/definitions/cms/audio.type.ts @@ -0,0 +1 @@ +export const audioType = [{ title: "None", value: 0 }]; diff --git a/definitions/cms/author.type.ts b/definitions/cms/author.type.ts new file mode 100644 index 0000000..f13ed1e --- /dev/null +++ b/definitions/cms/author.type.ts @@ -0,0 +1,5 @@ +export const authorType = [ + { title: "None", value: 0 }, + { title: "Reporter", value: 1 }, // Phóng viên + { title: "Other", value: 99 }, // Khác +]; diff --git a/definitions/cms/category.type.ts b/definitions/cms/category.type.ts new file mode 100644 index 0000000..e921316 --- /dev/null +++ b/definitions/cms/category.type.ts @@ -0,0 +1,20 @@ +export const categoryType = [ + { title: "None", value: 0 }, // Không xác định + { title: "Normal", value: 1 }, // Thông thường + { title: "Section", value: 2 }, // Chuyên trang + { title: "Other", value: 99 }, // Khác + + // { title: "None", value: 0 }, // Không xác định + // { title: "Home", value: 1 }, // Thông thường + // { title: "Subsite", value: 2 }, // Chuyên trang + // { title: "Normal", value: 3 }, // Thông thường + // { title: "Other", value: 99 }, // Khác +]; + +export const categoryPublishType = [ + { title: "None", value: 0 }, // Chưa xác định + { title: "Digital", value: 1 }, // Xuất bản số + { title: "Printing", value: 2 }, // Xuất bản in ấn + { title: "Sharing", value: 3 }, // Xuất bản chia sẻ + { title: "Other", value: 99 }, // Khác +]; diff --git a/definitions/cms/collection.type.ts b/definitions/cms/collection.type.ts new file mode 100644 index 0000000..50c7505 --- /dev/null +++ b/definitions/cms/collection.type.ts @@ -0,0 +1,15 @@ +export const collectionType = [ + { title: "None", value: 0 }, + { title: "Normal", value: 1 }, // Thông thường + { title: "Section", value: 2 }, // Chuyên trang + { title: "Other", value: 99 }, // Khác +]; + +export const collectionPublishType = [ + { title: "None", value: 0 }, // Chưa xác định + { title: "Digital", value: 1 }, // Xuất bản số + { title: "Printing", value: 2 }, // Xuất bản in ấn + { title: "Sharing", value: 3 }, // Xuất bản chia sẻ + { title: "Other", value: 99 }, // Khác + ]; + \ No newline at end of file diff --git a/definitions/cms/criteria.type.ts b/definitions/cms/criteria.type.ts new file mode 100644 index 0000000..673adc0 --- /dev/null +++ b/definitions/cms/criteria.type.ts @@ -0,0 +1,8 @@ +export const criteriasType = [ + { title: 'None', value: 0 }, + { title: 'Category', value: 1 }, + { title: 'Topic', value: 2 }, + { title: 'Event', value: 3 }, + { title: 'Article', value: 4 }, + { title: 'Author', value: 5 }, +]; \ No newline at end of file diff --git a/definitions/cms/document.type.ts b/definitions/cms/document.type.ts new file mode 100644 index 0000000..fbefdd2 --- /dev/null +++ b/definitions/cms/document.type.ts @@ -0,0 +1 @@ +export const documentType = [{ title: "None", value: 0 }]; diff --git a/definitions/cms/event.type.ts b/definitions/cms/event.type.ts new file mode 100644 index 0000000..2393f55 --- /dev/null +++ b/definitions/cms/event.type.ts @@ -0,0 +1,14 @@ +export const eventType = [ + { title: "None", value: 0 }, // Chưa xác định + { title: "Normal", value: 1 }, // Thông thường + { title: "Section", value: 2 }, // Chuyên trang + { title: "Other", value: 99 }, // Khác +]; + +export const eventPublishType = [ + { title: "None", value: 0 }, // Chưa xác định + { title: "Digital", value: 1 }, // Xuất bản số + { title: "Printing", value: 2 }, // Xuất bản in ấn + { title: "Sharing", value: 3 }, // Xuất bản chia sẻ + { title: "Other", value: 99 }, // Khác +]; diff --git a/definitions/cms/exception-messages.ts b/definitions/cms/exception-messages.ts new file mode 100644 index 0000000..58c3109 --- /dev/null +++ b/definitions/cms/exception-messages.ts @@ -0,0 +1,17 @@ +export const exceptionMessages = [ + { title: 'Unhandled exception', value: 'UnhandledException' }, + { title: 'Invalid argument {0}', value: 'InvalidArgument' }, + { title: 'Unable to {0}', value: 'UnableTo' }, + { title: '{0} is unavailable', value: 'Unavailable' }, + { title: '{0} is unauthorized', value: 'Unauthorized' }, + { title: '{0} is unauthenticated', value: 'Unauthenticated' }, + { title: '{0} does not exist', value: 'NotExist' }, + { title: '{0} is not valid', value: 'NotValid' }, + { title: '{0} is not ready', value: 'NotReady' }, + { title: '{0} is not allowed', value: 'NotAllowed' }, + { title: '{0} is not activated', value: 'NotActivated' }, + { title: '{0} has expired', value: 'HasExpired' }, + { title: '{0} has been deleted', value: 'HasDeleted' }, + { title: '{0} failed', value: 'Failed' }, + ]; + \ No newline at end of file diff --git a/definitions/cms/figure.type.ts b/definitions/cms/figure.type.ts new file mode 100644 index 0000000..c266cac --- /dev/null +++ b/definitions/cms/figure.type.ts @@ -0,0 +1,8 @@ +export const figureType = [ + { title: "None", value: 0 }, + { title: "Genius", value: 1 }, // Vĩ nhân + { title: "Celebrity", value: 2 }, // Người nổi tiếng + { title: "Politician", value: 3 }, // Chính trị gia + { title: "Businessman", value: 4 }, // Doanh nhân + { title: "Other", value: 99 }, // Khác +]; diff --git a/definitions/cms/image.type.ts b/definitions/cms/image.type.ts new file mode 100644 index 0000000..5861a07 --- /dev/null +++ b/definitions/cms/image.type.ts @@ -0,0 +1,7 @@ +export const imageType = [{ title: "None", value: 0 }]; + +export const imageEffectType = [ + { title: "None", value: null }, // Không hiệu ứng + { title: "NoEffect", value: "NoEffect" }, // Không hiệu ứng + { title: "SwitchBar", value: "SwitchBar" }, // Thanh chuyển đổi | https://vnexpress.net/gaza-tan-hoang-duoi-don-khong-kich-cua-israel-4669473.html" +]; diff --git a/definitions/cms/index.ts b/definitions/cms/index.ts new file mode 100644 index 0000000..e2900eb --- /dev/null +++ b/definitions/cms/index.ts @@ -0,0 +1,62 @@ +export { advertisementType } from "./advertisement.type"; +export { + articleType, + articleLayout, + articleContentType, + articleComponentType, + articleStateType, + articlePublishType, + articleInteractionType, + articleCommentType, + interactionType, + articleRelationType, + articleReportType, + articleSourceType, + digitalArticleCommentType, + sharingSiteType, +} from "./article.type"; + +export { attachmentType } from "./attachment.type"; +export { audioType } from "./audio.type"; +export { authorType } from "./author.type"; +export { categoryType, categoryPublishType } from "./category.type"; +export { collectionType, collectionPublishType } from "./collection.type"; +export { documentType } from "./document.type"; +export { eventType, eventPublishType } from "./event.type"; +export { figureType } from "./figure.type"; +export { imageType, imageEffectType } from "./image.type"; +export { keywordType } from "./keyword.type"; +export { linkType } from "./link.type"; +export { locationType } from "./location.type"; +export { multimediaType, multimediaEffectType } from "./multimedia.type"; +export { navigationType } from "./navigation.type"; +export { + pageTypes, + pageComponentTypes, + pageSectionTypes, + pageTaxonomy, + pageSectionTaxonomy, + pageDataQuery, + pageDataType, + pageComponentTaxonomy, + pageLayouts, + pageTemplates, + pageSectionLayouts, + pageComponentLayouts, + pageComponentTemplates, +} from "./page.type"; +export { placementType } from "./placement.type"; +export { pollType, pollParticipantType, pollOptionType, pollResultPublication } from "./poll.type"; +export { printinEditionType, printingPageType, printingPublicationType } from "./printing.type"; +export { qualificationType } from "./qualification.type"; +export { quizType, quizAnswerType, quizQuestionType, quizResponseType, quizParticipantType, quizResultPublication } from "./quiz.type"; +export { quotationType } from "./quotation.type"; +export { readerType } from "./reader.type"; +export { redirectionType } from "./redirection.type"; +export { sectionType } from "./section.type"; +export { surveyType, surveyParticipantType, surveyResultPublication, surveyAnswerType, surveyQuestionType, surveyResponseType } from "./survey.type"; +export { tagType } from "./tag.type"; +export { templateType } from "./template.type"; +export { criteriasType } from "./criteria.type"; +export { topicType, topicPublishType } from "./topic.type"; +export { scoreCategoryType } from "./score-category.type"; diff --git a/definitions/cms/keyword.type.ts b/definitions/cms/keyword.type.ts new file mode 100644 index 0000000..1bb6ca8 --- /dev/null +++ b/definitions/cms/keyword.type.ts @@ -0,0 +1,4 @@ +export const keywordType = [ + {title: "None", value: 0 }// Chưa xác định +]; + \ No newline at end of file diff --git a/definitions/cms/link.type.ts b/definitions/cms/link.type.ts new file mode 100644 index 0000000..b25ac94 --- /dev/null +++ b/definitions/cms/link.type.ts @@ -0,0 +1,5 @@ +export const linkType = [ + { title: "None", value: 0 }, + { title: "Internal", value: 1 }, // Bên trong + { title: "External", value: 2 }, // Bên ngoài +]; diff --git a/definitions/cms/location.type.ts b/definitions/cms/location.type.ts new file mode 100644 index 0000000..cd3ea79 --- /dev/null +++ b/definitions/cms/location.type.ts @@ -0,0 +1 @@ +export const locationType = [{ title: "None", value: 0 }]; diff --git a/definitions/cms/multimedia.type.ts b/definitions/cms/multimedia.type.ts new file mode 100644 index 0000000..5cd1821 --- /dev/null +++ b/definitions/cms/multimedia.type.ts @@ -0,0 +1,5 @@ +export const multimediaType = [{ title: "None", value: 0 }]; +export const multimediaEffectType = [ + { title: "None", value: null }, // Không hiệu ứng + { title: "NoEffect", value: "NoEffect" }, // Không hiệu ứng +]; diff --git a/definitions/cms/navigation.type.ts b/definitions/cms/navigation.type.ts new file mode 100644 index 0000000..2f199c7 --- /dev/null +++ b/definitions/cms/navigation.type.ts @@ -0,0 +1,5 @@ +export const navigationType = [ + { title: "None", value: 0 }, + { title: "Primary", value: 1 }, + { title: "Secondary", value: 2 }, +]; diff --git a/definitions/cms/page.type.ts b/definitions/cms/page.type.ts new file mode 100644 index 0000000..e988734 --- /dev/null +++ b/definitions/cms/page.type.ts @@ -0,0 +1,174 @@ +import { enumPageComponentTemplates, enumPageComponentLayouts, enumPageSectionLayouts, templates } from "@/definitions/enum"; + +export const pageTypes = [ + { title: "None", value: 0 }, // Không xác định + { title: "Home", value: 1 }, // Trang chủ + { title: "Section", value: 2 }, // Chuyên trang + { title: "Category", value: 3 }, // Trang danh mục + { title: "Topic", value: 4 }, // Trang chủ đề + { title: "Event", value: 5 }, // Trang sự kiện + { title: "Collection", value: 6 }, // Trang sưu tập + { title: "Article", value: 7 }, // Trang bài viết + { title: "Tag", value: 8 }, // Trang từ khóa + { title: "Author", value: 9 }, // Trang tác giả + { title: "Search", value: 10 }, // Trang tìm kiếm + { title: "Contact", value: 11 }, // Trang liên hệ + { title: "About", value: 12 }, // Trang giới thiệu + { title: "Service", value: 13 }, // Trang dịch vụ + { title: "Policy", value: 14 }, // Trang chính sách + { title: "Terms", value: 15 }, // Trang điều khoản + { title: "Privacy", value: 16 }, // Trang bảo mật + { title: "Error", value: 97 }, // Trang lỗi + { title: "Maintenance", value: 98 }, // Trang bảo trì + { title: "Custom", value: 99 }, // Trang tùy chỉnh +]; +// LayoutType: None=0 | Normal=1 | Short=2 | Long=3 | Page=4 + +export const pageLayouts = (key: string)=>{ + if (key === "Article") { + return [ + { title: "Normal", value: 1, key: "ARTICLE_SHORT_LAYOUT" }, + { title: "Short", value: 2, key: "ARTICLE_SHORT_LAYOUT" }, + { title: "Long", value: 3, key: "ARTICLE_LONG_LAYOUT" }, + { title: "Page", value: 4, key: "ARTICLE_PAGE_LAYOUT" }, + ]; + } else { + return [ + { title: "None", value: 0 }, // Không xác định + { title: "Full Page", value: "Full_Page" }, // full with 100% + { title: "Center Page", value: "Center_Page" }, // ở giữa + { title: "Backgroud Page", value: "Backgroud_Page" }, // Phân trang + ]; + } +}; + +export const pageTemplates = [ + { title: "None", value: "None" }, // Không xác định + { title: "Home", value: "Home" }, // Trang chủ + { title: "Section", value: "Section" }, // Chuyên trang + { title: "Category", value: "Category" }, // Trang danh mục + { title: "Topic", value: "Topic" }, // Trang chủ đề + { title: "Event", value: "Event" }, // Trang sự kiện + { title: "Collection", value: "Collection" }, // Trang sưu tập + { title: "Article", value: "Article" }, // Trang bài viết + { title: "Tag", value: "Tag" }, // Trang từ khóa + { title: "Author", value: "Author" }, // Trang tác giả + { title: "Search", value: "Search" }, // Trang tìm kiếm + { title: "Contact", value: "Contact" }, // Trang liên hệ + { title: "About", value: "About" }, // Trang giới thiệu + { title: "Service", value: "Service" }, // Trang dịch vụ + { title: "Policy", value: "Policy" }, // Trang chính sách + { title: "Terms", value: "Terms" }, // Trang điều khoản + { title: "Privacy", value: "Privacy" }, // Trang bảo mật + { title: "Error", value: "Error" }, // Trang lỗi + { title: "Maintenance", value: "Maintenance" }, // Trang bảo trì + { title: "Custom", value: "Custom" }, // Trang tùy chỉnh +]; + +export const pageComponentTemplates = [ + { title: "None", value: "None" }, // Không xác định + { title: "Section", value: "Section" }, // Chuyên trang + { title: "Category", value: "Category" }, // Trang danh mục + { title: "Topic", value: "Topic" }, // Trang chủ đề + { title: "Event", value: "Event" }, // Trang sự kiện + { title: "Collection", value: "Collection" }, // Trang sưu tập + { title: "Article", value: "Article" }, // Trang bài viết + { title: "Tag", value: "Tag" }, // Trang từ khóa + { title: "Author", value: "Author" }, // Trang tác giả + { title: "Poll", value: "Poll" }, // Trang poll + { title: "Quiz", value: "Quiz" }, // Trang quiz + { title: "Survey", value: "Survey" }, // Trang survey + { title: "Advertising", value: "Advertising" }, // Trang quảng cáo + { title: "Other", value: "Other" }, // Trang khác +]; + +export const pageComponentTypes = [ + { title: "None", value: 0 }, // Không xác định + { title: "Individual", value: 1 }, // Đơn lẻ + { title: "Collection", value: 2 }, // Sưu tập + { title: "Pagination", value: 3 }, // Phân trang +]; + +export const pageSectionTypes = [ + { title: "None", value: 0 }, // Không xác định + { title: "Block", value: 1 }, // Khối +]; + +export const pageTaxonomy = [ + { title: "Block", value: 0 }, + { title: "Module", value: 1 }, + { title: "Navigation", value: 2 }, +]; + +export const pageSectionTaxonomy = [ + { title: "Block", value: "Block" }, + { title: "Module", value: "Module" }, + { title: "Navigation", value: "Navigation" }, +]; + +export const pageDataType = [ + { title: "Section", value: "Section" }, + { title: "Category", value: "Category" }, + { title: "Topic", value: "Topic" }, + { title: "Event", value: "Event" }, + { title: "Collection", value: "Collection" }, + { title: "Article", value: "Article" }, + { title: "Tag", value: "Tag" }, + { title: "Author", value: "Author" }, + { title: "Poll", value: "Poll" }, + { title: "Quiz", value: "Quiz" }, + { title: "Survey", value: "Survey" }, + { title: "Advertising", value: "Advertising" }, + { title: "Other", value: "Other" }, +]; + +export const pageDataQuery = [ + { title: "IDS", value: "IDS" }, + { title: "NEW", value: "NEW" }, + { title: "VIEW", value: "VIEW" }, + { title: "SQL", value: "SQL" }, + { title: "REQUEST", value: "REQUEST" }, +]; + +export const pageComponentTaxonomy = [ + { title: "Block", value: 0 }, + { title: "Module", value: 1 }, + { title: "Navigation", value: 2 }, +]; + +export const pageSectionLayouts = [ + { title: "None", value: "None" }, + { title: "2 Cột", value: enumPageSectionLayouts['VERTICAL_TWO'] }, + { title: "2 Cột, bên trái rộng", value: enumPageSectionLayouts['VERTICAL_LEFT_TWO'] }, + { title: "2 Cột, bên phải rộng", value: enumPageSectionLayouts['VERTICAL_RIGHT_TWO'] }, + { title: "3 Cột", value: enumPageSectionLayouts['VERTICAL_THREE'] }, + { title: "4 Cột", value: enumPageSectionLayouts['VERTICAL_FOUR'] }, + { title: "1 Hàng", value: enumPageSectionLayouts['HORIZONTAL_ONE'] }, + { title: "2 Hàng", value: enumPageSectionLayouts['HORIZONTAL_TWO'] }, + { title: "3 Hàng", value: enumPageSectionLayouts['HORIZONTAL_THREE'] }, + { title: "4 Hàng", value: enumPageSectionLayouts['HORIZONTAL_FOUR'] }, + { title: "5 Hàng", value: enumPageSectionLayouts['HORIZONTAL_FIVE'] }, + { title: "6 Hàng", value: enumPageSectionLayouts['HORIZONTAL_SIX'] }, + { title: "7 Hàng", value: enumPageSectionLayouts['HORIZONTAL_SEVEN'] }, + { title: "8 Hàng", value: enumPageSectionLayouts['HORIZONTAL_EIGHT'] }, + { title: "9 Hàng", value: enumPageSectionLayouts['HORIZONTAL_NINE'] }, + { title: "10 Hàng", value: enumPageSectionLayouts['HORIZONTAL_TEN'] } +]; + +export const pageComponentLayouts = { + [`${enumPageComponentTemplates.ARTICLE}`]: [ + { title: "None", value: "None" }, + { title: "Trình bày ngang", value: enumPageComponentLayouts[enumPageComponentTemplates.ARTICLE]['HORIZONTAL'] }, + { title: "Trình bày dọc", value: enumPageComponentLayouts[enumPageComponentTemplates.ARTICLE]['VERTICAL'] }, + { title: "Ngang và ẩn Giới thiệu", value: enumPageComponentLayouts[enumPageComponentTemplates.ARTICLE]['HORIZONTAL-HIDE_PARAGRAPH'] }, + { title: "Dọc và ẩn Hình ảnh", value: enumPageComponentLayouts[enumPageComponentTemplates.ARTICLE]['VERTICAL-HIDE_THUMBNAIL'] }, + { title: "Dọc và ẩn Giới thiệu", value: enumPageComponentLayouts[enumPageComponentTemplates.ARTICLE]['VERTICAL-HIDE_PARAGRAPH'] }, + { title: "Dọc và ẩn Giới thiệu, ngược", value: enumPageComponentLayouts[enumPageComponentTemplates.ARTICLE]['VERTICAL-HIDE_PARAGRAPH-REVERSE'] }, + ], + [`${enumPageComponentTemplates.CATEGORY}`]: [ + { title: "Danh mục", value: enumPageComponentLayouts[enumPageComponentTemplates.CATEGORY]['DEFAULT'] } + ], + [`${enumPageComponentTemplates.COLLECTION}`]: [ + { title: "Cụm Bài viết 5 phần tử, Bài viết ngang", value: enumPageComponentLayouts[enumPageComponentTemplates.COLLECTION]['ARTICLE-VERTICAL-|HORIZONTAL|-MAX_5'] }, + ] +}; diff --git a/definitions/cms/placement.type.ts b/definitions/cms/placement.type.ts new file mode 100644 index 0000000..1b111f7 --- /dev/null +++ b/definitions/cms/placement.type.ts @@ -0,0 +1,3 @@ +export const placementType = [ + { title: "None", value: 0 }, // Không xác định +]; diff --git a/definitions/cms/poll.type.ts b/definitions/cms/poll.type.ts new file mode 100644 index 0000000..d5f2afc --- /dev/null +++ b/definitions/cms/poll.type.ts @@ -0,0 +1,19 @@ +export const pollType = [ + { title: "None", value: 0 }, + { title: "SingleSelection", value: 1 }, // Đơn lựa chọn + { title: "MultipleSelections", value: 2 }, // Nhiều lựa chọn +]; +export const pollParticipantType = [ + { title: "None", value: 0 }, + { title: "Guest", value: 1 }, // Khách + { title: "Logged", value: 2 }, // Xác thực + { title: "All", value: 3 }, // Tất cả +]; +export const pollOptionType = [{ title: "None", value: 0 }]; + +export const pollResultPublication = [ + { title: 'Not Public', value: 0 }, // Không công khai + { title: 'Always Public', value: 1 }, // Luôn luôn công khai + { title: 'After Answered All', value: 2 }, // Sau khi kiểm tra + { title: 'At The End', value: 3 }, // Sau khi kiểm tra kết thúc +]; \ No newline at end of file diff --git a/definitions/cms/printing.type.ts b/definitions/cms/printing.type.ts new file mode 100644 index 0000000..dda4779 --- /dev/null +++ b/definitions/cms/printing.type.ts @@ -0,0 +1,8 @@ +export const printinEditionType = [{ title: "None", value: 0 }]; +export const printingPageType = [ + { title: "None", value: 0 }, + { title: "CoverPage", value: 1 }, // Trang bìa + { title: "MiddlePage", value: 2 }, // Trang giữa + { title: "LastPage", value: 3 }, // Trang cuối +]; +export const printingPublicationType = [{ title: "None", value: 0 }]; diff --git a/definitions/cms/qualification.type.ts b/definitions/cms/qualification.type.ts new file mode 100644 index 0000000..44b1f79 --- /dev/null +++ b/definitions/cms/qualification.type.ts @@ -0,0 +1,9 @@ +export const qualificationType = [ + { title: 'None', value: 0 }, + { title: 'Quality', value: 1 }, + { title: 'Interaction', value: 2 }, + { title: 'Contribution', value: 3 }, + { title: 'Professional', value: 4 }, + { title: 'Adjustment', value: 5 }, + { title: 'Bonus', value: 6 }, +]; diff --git a/definitions/cms/quiz.type.ts b/definitions/cms/quiz.type.ts new file mode 100644 index 0000000..af91978 --- /dev/null +++ b/definitions/cms/quiz.type.ts @@ -0,0 +1,40 @@ +export const quizType = [{ title: "None", value: 0 }]; + +export const pollType = [ + { title: "None", value: 0 }, + { title: "Guest", value: 1 }, // Khách + { title: "Logged", value: 2 }, // Xác thực + { title: "All", value: 3 }, // Tất cả +]; + +export const quizAnswerType = [ + { title: "None", value: 0 }, + { title: "Tick", value: 1 }, //chọn đáp án + { title: "Input", value: 2 }, // nhập đáp án +]; + +export const quizQuestionType = [ + { title: "None", value: 0 }, // Không xác định + { title: "Single Selection", value: 1 }, // Đơn lựa chọn + { title: "Multiple Selections", value: 2 }, // Nhiều lựa chọn +]; + +export const quizResponseType = [ + { title: "None", value: 0 }, + { title: "Tick", value: 1 }, //chọn đáp án + { title: "Input", value: 2 }, // nhập đáp án +]; + +export const quizParticipantType = [ + + { title: 'Guest', value: 1 }, // Khách + { title: 'Logged', value: 2 }, // Xác thực + { title: 'All', value: 3 }, // Tất cả +]; + +export const quizResultPublication = [ + { title: 'Not Public', value: 0 }, // Không công khai + { title: 'Always Public', value: 1 }, // Luôn luôn công khai + { title: 'After Answered All', value: 2 }, // Sau khi kiểm tra + { title: 'At The End', value: 3 }, // Sau khi kiểm tra kết thúc +]; \ No newline at end of file diff --git a/definitions/cms/quotation.type.ts b/definitions/cms/quotation.type.ts new file mode 100644 index 0000000..80980f8 --- /dev/null +++ b/definitions/cms/quotation.type.ts @@ -0,0 +1 @@ +export const quotationType = [{ title: "None", value: 0 }]; diff --git a/definitions/cms/reader.type.ts b/definitions/cms/reader.type.ts new file mode 100644 index 0000000..277dda4 --- /dev/null +++ b/definitions/cms/reader.type.ts @@ -0,0 +1,6 @@ +export const readerType = [ + { title: "None", value: 0 }, + { title: "Guest", value: 1 }, // Khách + { title: "Logged", value: 2 }, // Xác thực + { title: "All", value: 3 }, // Tất cả +]; diff --git a/definitions/cms/redirection.type.ts b/definitions/cms/redirection.type.ts new file mode 100644 index 0000000..d272aad --- /dev/null +++ b/definitions/cms/redirection.type.ts @@ -0,0 +1,7 @@ +export const redirectionType = [ + { title: "None", value: 0 }, + { title: "Blank", value: 1 }, + { title: "Self", value: 2 }, + { title: "Parent", value: 3 }, + { title: "Top", value: 4 }, +]; diff --git a/definitions/cms/score-category.type.ts b/definitions/cms/score-category.type.ts new file mode 100644 index 0000000..4849374 --- /dev/null +++ b/definitions/cms/score-category.type.ts @@ -0,0 +1,10 @@ +export const scoreCategoryType = [ + { + title: "Báo in", + value: 1 + }, + { + title: "Báo điện tử", + value: 2 + } +] \ No newline at end of file diff --git a/definitions/cms/section.type.ts b/definitions/cms/section.type.ts new file mode 100644 index 0000000..dc8a8f1 --- /dev/null +++ b/definitions/cms/section.type.ts @@ -0,0 +1 @@ +export const sectionType = [{ title: "None", value: 0 }]; diff --git a/definitions/cms/survey.type.ts b/definitions/cms/survey.type.ts new file mode 100644 index 0000000..c899d90 --- /dev/null +++ b/definitions/cms/survey.type.ts @@ -0,0 +1,31 @@ +export const surveyType = [{ title: "None", value: 0 }]; +export const surveyParticipantType = [ + { title: "None", value: 0 }, + { title: "Guest", value: 1 }, // Khách + { title: "Logged", value: 2 }, // Xác thực + { title: "All", value: 3 }, // Tất cả +]; +export const surveyResultPublication = [ + { title: "Not Public", value: 0 }, // Không công khai + { title: "Always Public", value: 1 }, // Luôn luôn công khai + { title: "After Answered All", value: 2 }, // Sau khi kiểm tra + { title: "At The End", value: 3 }, // Sau khi kiểm tra kết thúc +]; + +export const surveyAnswerType = [ + { title: "None", value: 0 }, + { title: "Tick", value: 1 }, + { title: "Input", value: 2 }, +]; + +export const surveyQuestionType = [ + { title: "None", value: 0 }, + { title: "Single Selection", value: 1 }, + { title: "Multiple Selections", value: 2 }, +]; + +export const surveyResponseType = [ + { title: "None", value: 0 }, + { title: "Tick", value: 1 }, + { title: "Input", value: 2 }, +]; diff --git a/definitions/cms/tag.type.ts b/definitions/cms/tag.type.ts new file mode 100644 index 0000000..fb97c47 --- /dev/null +++ b/definitions/cms/tag.type.ts @@ -0,0 +1 @@ +export const tagType = [{ title: "None", value: 0 }]; diff --git a/definitions/cms/template.type.ts b/definitions/cms/template.type.ts new file mode 100644 index 0000000..c25c856 --- /dev/null +++ b/definitions/cms/template.type.ts @@ -0,0 +1,6 @@ +export const templateType = [ + { title: "None", value: 0 }, + { title: "Post", value: 1 }, + { title: "Page", value: 2 }, + { title: "Other", value: 99 }, +]; diff --git a/definitions/cms/topic.type.ts b/definitions/cms/topic.type.ts new file mode 100644 index 0000000..af974d1 --- /dev/null +++ b/definitions/cms/topic.type.ts @@ -0,0 +1,14 @@ +export const topicType = [ + { title: "None", value: 0 }, + { title: "Normal", value: 1 }, + { title: "Subsite", value: 2 }, + { title: "Other", value: 99 }, +]; + +export const topicPublishType = [ + { title: "None", value: 0 }, + { title: "Digital", value: 1 }, // Xuất bản số + { title: "Printing", value: 2 }, // Xuất bản in + { title: "Sharing", value: 3 }, // xuất bản chia sẻ + { title: "Digital_Printing", value: 12 }, // xuất bản số và in ấn +]; diff --git a/definitions/com/domain-feature.ts b/definitions/com/domain-feature.ts new file mode 100644 index 0000000..b0cdb60 --- /dev/null +++ b/definitions/com/domain-feature.ts @@ -0,0 +1,4 @@ +export const domainFeature = [ //Loại domain sếp chưa nghĩ ra + { id: 0, name: 'No' }, + { id: 1, name: 'Yes' } +]; diff --git a/definitions/com/index.ts b/definitions/com/index.ts new file mode 100644 index 0000000..bace634 --- /dev/null +++ b/definitions/com/index.ts @@ -0,0 +1,4 @@ +export { status } from './status' +export { domainFeature } from './domain-feature' +export { typeOption } from './type-option' +export { scopeOption } from './scope-option' \ No newline at end of file diff --git a/definitions/com/scope-option.ts b/definitions/com/scope-option.ts new file mode 100644 index 0000000..f2f812a --- /dev/null +++ b/definitions/com/scope-option.ts @@ -0,0 +1,6 @@ +export const scopeOption = [ + { id: 0, title: "Global" }, + { id: 1, title: "Site" }, + { id: 2, title: "Group" }, + { id: 3, title: "User" }, +]; diff --git a/definitions/com/status.ts b/definitions/com/status.ts new file mode 100644 index 0000000..b39d522 --- /dev/null +++ b/definitions/com/status.ts @@ -0,0 +1,12 @@ +export const status = [ + { title: "Processing", value: 1, key: "1" }, + { title: "Cancelled", value: 2, key: "2" }, + { title: "Completed", value: 3, key: "3" }, + { title: "Approving", value: 4, key: "4" }, + { title: "Approved", value: 5, key: "5" }, + { title: "Activated", value: 6, key: "6" }, + { title: "Deactivated", value: 7, key: "7" }, + { title: "Suspended", value: 8, key: "8" }, + { title: "Locked", value: 9, key: "9" }, + { title: "Deleted", value: -1, key: "-1" }, +]; diff --git a/definitions/com/type-option.ts b/definitions/com/type-option.ts new file mode 100644 index 0000000..8f814d9 --- /dev/null +++ b/definitions/com/type-option.ts @@ -0,0 +1,4 @@ +export const typeOption = [ + { title: "Chính", value: 1 }, + { title: "Phụ", value: 2 }, +]; diff --git a/definitions/dashboad-ranges.ts b/definitions/dashboad-ranges.ts new file mode 100644 index 0000000..c031b57 --- /dev/null +++ b/definitions/dashboad-ranges.ts @@ -0,0 +1,7 @@ +export const dashboardRanges = [ + { title: "Giờ", value: 1 }, + { title: "Ngày", value: 2 }, + { title: "Tuần", value: 3 }, + { title: "Tháng", value: 4 }, + { title: "Năm", value: 5 }, +]; diff --git a/definitions/dashboard-options.ts b/definitions/dashboard-options.ts new file mode 100644 index 0000000..1a69fc9 --- /dev/null +++ b/definitions/dashboard-options.ts @@ -0,0 +1,6 @@ +export const dashboardOptions = [ + { title: 'Global', value: 1 }, + { title: 'Site', value: 2 }, + { title: 'Group', value: 3 }, + { title: 'User', value: 4 }, + ]; \ No newline at end of file diff --git a/definitions/digital-options.ts b/definitions/digital-options.ts new file mode 100644 index 0000000..61b239d --- /dev/null +++ b/definitions/digital-options.ts @@ -0,0 +1,4 @@ +export const digitaldOptions = [ + { title: 'View', value: 1}, + { title: 'Share', value: 0 }, + ]; \ No newline at end of file diff --git a/definitions/enum/actionCodes.enum.ts b/definitions/enum/actionCodes.enum.ts new file mode 100644 index 0000000..d99ee2d --- /dev/null +++ b/definitions/enum/actionCodes.enum.ts @@ -0,0 +1,14 @@ +export enum actionCodes { + MANAGE = "manage", + ACCESS = "access", + READ = "read", + CREATE = "create", + UPDATE = "update", + DELETE = "delete", + APPROVE = "approve", + ACTIVATE = "activate", + REACTIVATE = "reactivate", + DEACTIVATE = "deactivate", + SUSPEND = "suspend", + LOCK = "lock", +} diff --git a/definitions/enum/actionCommands.enum.ts b/definitions/enum/actionCommands.enum.ts new file mode 100644 index 0000000..8a4f043 --- /dev/null +++ b/definitions/enum/actionCommands.enum.ts @@ -0,0 +1,6 @@ +export enum actionCommands { + CHANGESTATE = "Changestate", + CREATEVERSION = "Createversion", + REPUBLISH = "Republish", + UNPUBLISH = "Unpublish", +} diff --git a/definitions/enum/categoryTypes.enum.ts b/definitions/enum/categoryTypes.enum.ts new file mode 100644 index 0000000..59acefe --- /dev/null +++ b/definitions/enum/categoryTypes.enum.ts @@ -0,0 +1,8 @@ +export enum categoryTypes { + NONE = 0, + HOME = 1, + SUBSITE = 2, + NORMAL = 3, + OTHER = 99 + } + \ No newline at end of file diff --git a/definitions/enum/component.enum.ts b/definitions/enum/component.enum.ts new file mode 100644 index 0000000..3a5c2af --- /dev/null +++ b/definitions/enum/component.enum.ts @@ -0,0 +1,19 @@ +import { moduleCodes } from "./module.enum"; +export enum componentCodes { + CmsArticle = `${moduleCodes.Cms}/article`, + CmsScoringCategory = `${moduleCodes.Cms}/scoring/category`, + CmsScoringQualification = `${moduleCodes.Cms}/scoring/qualification`, + CmsScoringQualificationQuota = `${moduleCodes.Cms}/scoring/qualification-quota`, + CmsCategory = `${moduleCodes.Cms}/category`, + CmsTopic = `${moduleCodes.Cms}/topic`, + CmsEvent = `${moduleCodes.Cms}/event`, + CmsPrintingPage = `${moduleCodes.Cms}/printing-page`, + CmsPrintingEdition = `${moduleCodes.Cms}/printing-edition`, + CmsPrintingPublication = `${moduleCodes.Cms}/printing-publication`, + CmsTemplate = `${moduleCodes.Cms}/template`, + CmsCollection = `${moduleCodes.Cms}/collection`, + HrmUser = `${moduleCodes.Hrm}/user`, + HrmRole = `${moduleCodes.Hrm}/role`, + HrmGroup = `${moduleCodes.Hrm}/group`, + MfmWorkflow = `${moduleCodes.Mfm}/workflow`, +} diff --git a/definitions/enum/index.ts b/definitions/enum/index.ts new file mode 100644 index 0000000..131fb7a --- /dev/null +++ b/definitions/enum/index.ts @@ -0,0 +1,8 @@ +export { PublishTypes as publishTypes } from "./publishTypes.enum"; +export { categoryTypes } from "./categoryTypes.enum"; +export { templates, layouts, dataTypes, dataQuery, sectionTypes, sectionTaxonomy, enumPageType, enumPageSectionLayouts, enumPageComponentLayouts, enumPageComponentTemplates } from "./page.enum"; +export { enumStatus } from "./status.enum"; +export { actionCommands } from "./actionCommands.enum"; +export { moduleCodes } from "./module.enum"; +export { actionCodes } from "./actionCodes.enum"; +export { componentCodes } from "./component.enum"; diff --git a/definitions/enum/module.enum.ts b/definitions/enum/module.enum.ts new file mode 100644 index 0000000..9ba73b9 --- /dev/null +++ b/definitions/enum/module.enum.ts @@ -0,0 +1,8 @@ +export enum moduleCodes { + Cms = "cms", + Com = "com", + Crm = "crm", + Fam = "fam", + Hrm = "hrm", + Mfm = "mfm", +} diff --git a/definitions/enum/page.enum.ts b/definitions/enum/page.enum.ts new file mode 100644 index 0000000..f519880 --- /dev/null +++ b/definitions/enum/page.enum.ts @@ -0,0 +1,142 @@ +export const templates = { + NONE: "None", // Không xác định + HOME: "Home", // Trang chủ + SECTION: "Section", // Chuyên trang + CATEGORY: "Category", // Trang danh mục + TOPIC: "Topic", // Trang chủ đề + EVENT: "Event", // Trang sự kiện + COLLECTION: "Collection", // Trang sưu tập + ARTICLE: "Article", // Trang bài viết + TAG: "Tag", // Trang từ khóa + AUTHOR: "Author", // Trang tác giả + SEARCH: "Search", // Trang tìm kiếm + CONTACT: "Contact", // Trang liên hệ + ABOUT: "About", // Trang giới thiệu + SERVICE: "Service", // Trang dịch vụ + POLICY: "Policy", // Trang chính sách + TERMS: "Terms", // Trang điều khoản + PRIVACY: "Privacy", // Trang bảo mật + ERROR: "Error", // Trang lỗi + MAINTENANCE: "Maintenance", // Trang bảo trì + CUSTOM: "Custom", // Trang tùy chỉnh +}; + +export const layouts = { + NONE: "None", // Không xác định + FULL_PAGE: "Full_Page", // full width 100% + CENTER_PAGE: "Center_Page", // ở giữa + BACKGROUND_PAGE: "Background_Page", // Phân trang +}; + +export const dataTypes = { + SECTION: "Section", + CATEGORY: "Category", + TOPIC: "Topic", + EVENT: "Event", + COLLECTION: "Collection", + ARTICLE: "Article", + TAG: "Tag", + AUTHOR: "Author", + POLL: "Poll", + QUIZ: "Quiz", + SURVEY: "Survey", + ADVERTISING: "Advertising", + OTHER: "Other", +}; + +export const dataQuery = { + IDS: "IDS", + NEW: "NEW", + VIEW: "VIEW", + SQL: "SQL", + REQUEST: "REQUEST", +}; + +export const sectionTypes = { + NONE: 0, // Không xác định + BLOCK: 1, // Khối +}; + +export const sectionTaxonomy = { + BLOCK: "Block", + MODULE: "Module", + NAVIGATION: "Navigation", +}; + +export const enumPageType = { + NONE: 0, // Không xác định + HOME: 1, // Trang chủ + SECTION: 2, // Chuyên trang + CATEGORY: 3, // Trang danh mục + TOPIC: 4, // Trang chủ đề + EVENT: 5, // Trang sự kiện + COLLECTION: 6, // Trang sưu tập + ARTICLE: 7, // Trang bài viết + TAG: 8, // Trang từ khóa + AUTHOR: 9, // Trang tác giả + SEARCH: 10, // Trang tìm kiếm + CONTACT: 11, // Trang liên hệ + ABOUT: 12, // Trang giới thiệu + SERVICE: 13, // Trang dịch vụ + POLICY: 14, // Trang chính sách + TERMS: 15, // Trang điều khoản + PRIVACY: 16, // Trang bảo mật + ERROR: 97, // Trang lỗi + MAINTENANCE: 98, // Trang bảo trì + CUSTOM: 99, // Trang tùy chỉnh +}; + +export const enumPageSectionLayouts = { + NONE: "None", + 'VERTICAL_TWO': 'LAYOUT:vertical-TYPE:Default-MAX:2', + 'VERTICAL_LEFT_TWO': 'LAYOUT:vertical-TYPE:LEFT-MAX:2', + 'VERTICAL_RIGHT_TWO': 'LAYOUT:vertical-TYPE:RIGHT-MAX:2', + 'VERTICAL_THREE': 'LAYOUT:vertical-TYPE:Default-MAX:3', + 'VERTICAL_FOUR': 'LAYOUT:vertical-TYPE:Default-MAX:4', + 'HORIZONTAL_ONE': 'LAYOUT:horizontal-TYPE:Default-MAX:1', + 'HORIZONTAL_TWO': 'LAYOUT:horizontal-TYPE:Default-MAX:2', + 'HORIZONTAL_THREE': 'LAYOUT:horizontal-TYPE:Default-MAX:3', + 'HORIZONTAL_FOUR': 'LAYOUT:horizontal-TYPE:Default-MAX:4', + 'HORIZONTAL_FIVE': 'LAYOUT:horizontal-TYPE:Default-MAX:5', + 'HORIZONTAL_SIX': 'LAYOUT:horizontal-TYPE:Default-MAX:6', + 'HORIZONTAL_SEVEN': 'LAYOUT:horizontal-TYPE:Default-MAX:7', + 'HORIZONTAL_EIGHT': 'LAYOUT:horizontal-TYPE:Default-MAX:8', + 'HORIZONTAL_NINE': 'LAYOUT:horizontal-TYPE:Default-MAX:9', + 'HORIZONTAL_TEN': 'LAYOUT:horizontal-TYPE:Default-MAX:10', +}; + +export const enumPageComponentTemplates = { // KHÔNG ĐƯỢC XÓA KEY - BIẾN này + NONE: "None", // Không xác định + SECTION: "Section", // Chuyên trang + CATEGORY: "Category", // Trang danh mục + TOPIC: "Topic", // Trang chủ đề + EVENT: "Event", // Trang sự kiện + COLLECTION: "Collection", // Trang sưu tập + ARTICLE: "Article", // Trang bài viết + TAG: "Tag", // Trang từ khóa + AUTHOR: "Author", // Trang tác giả + POLL: "Poll", // Trang poll + QUIZ: "Quiz", // Trang quiz + SURVEY: "Survey", // Trang survey + ADVERTISING: "Advertising", // Trang quảng cáo + OTHER: "Other" // Trang khác +}; + +export const enumPageComponentLayouts = { + [`${enumPageComponentTemplates.ARTICLE}`]: { + NONE: "None", + 'HORIZONTAL': "LAYOUT:horizontal", + 'VERTICAL': "LAYOUT:vertical", + 'HORIZONTAL-HIDE_PARAGRAPH': "LAYOUT:horizontal-HIDE:paragraph", + 'VERTICAL-HIDE_THUMBNAIL': "LAYOUT:vertical-HIDE:thumbnail", + 'VERTICAL-HIDE_PARAGRAPH': "LAYOUT:vertical-HIDE:paragraph", + 'VERTICAL-HIDE_PARAGRAPH-REVERSE': "LAYOUT:vertical-HIDE:paragraph-REVERSE:true", + }, + [`${enumPageComponentTemplates.CATEGORY}`]: { + NONE: "None", + 'DEFAULT': "DEFAULT" + }, + [`${enumPageComponentTemplates.COLLECTION}`]: { + 'ARTICLE-VERTICAL-|HORIZONTAL|-MAX_5': 'TYPE:Article-LAYOUT:vertical-DATA:HORIZONTAL-MAX:5' + } +}; diff --git a/definitions/enum/publishTypes.enum.ts b/definitions/enum/publishTypes.enum.ts new file mode 100644 index 0000000..4c575a5 --- /dev/null +++ b/definitions/enum/publishTypes.enum.ts @@ -0,0 +1,7 @@ +export enum PublishTypes { + DIGITAL = 1, + PRINTING = 2, + SHARING = 3, + DIGITAL_PRINTING = 12, + ALL = 99, +} diff --git a/definitions/enum/status.enum.ts b/definitions/enum/status.enum.ts new file mode 100644 index 0000000..f313f1a --- /dev/null +++ b/definitions/enum/status.enum.ts @@ -0,0 +1,13 @@ +export const enumStatus = { + ALL: null, + PROCESSING: 1, + CANCELLED: 2, + COMPLETED: 3, + APPROVING: 4, + APPROVED: 5, + ACTIVATED: 6, + DEACTIVATED: 7, + SUSPENDED: 8, + LOCKED: 9, + DELETED: -1, +}; diff --git a/definitions/feature-options.ts b/definitions/feature-options.ts new file mode 100644 index 0000000..f01403c --- /dev/null +++ b/definitions/feature-options.ts @@ -0,0 +1,6 @@ +export const featureOptions = [ + { title: 'Important', value: 'Important' }, + { title: 'Feature', value: 'Feature' }, + { title: 'Trending', value: 'Trending' }, + { title: 'Navigation', value: 'Navigation' }, +]; diff --git a/definitions/index.ts b/definitions/index.ts new file mode 100644 index 0000000..861e027 --- /dev/null +++ b/definitions/index.ts @@ -0,0 +1,18 @@ +export { BaseGender } from "./base-gender"; +export { baseStatus } from "./base-status"; +export { systemStatus } from "./system-status"; +export { breakpoint } from "./breakpoint"; +export { baseSideBarMenu } from "./base-sidebar"; +export { booleanOptions } from "./boolean-options"; +export { yesNoOptions } from "./yes-no-options"; +export { languageOptions } from "./language-options"; +export { featureOptions } from "./feature-options"; +export { taskTaxonomy } from "./base-taxonomy"; +export { nationlityOptions } from "./base-nationlity"; +export { dashboardOptions } from "./dashboard-options"; +export { digitaldOptions } from "./digital-options"; +export { categoryLayouts } from "./category-layouts"; +export { dashboardRanges } from "./dashboad-ranges"; +export { trendOptions } from "./trend-options"; +export { publishedByOptions } from "./publishedBy-options"; +export { priorityOptions } from './priority-options'; diff --git a/definitions/language-options.ts b/definitions/language-options.ts new file mode 100644 index 0000000..56ba37e --- /dev/null +++ b/definitions/language-options.ts @@ -0,0 +1,4 @@ +export const languageOptions = [ + { title: 'Tiếng Anh', value: 'en' }, + { title: 'Tiếng Việt', value: 'vi' }, + ]; diff --git a/definitions/mfm/action-type.ts b/definitions/mfm/action-type.ts new file mode 100644 index 0000000..5ef6b52 --- /dev/null +++ b/definitions/mfm/action-type.ts @@ -0,0 +1,15 @@ +export const actionCommands = [ + { title: "Create", value: "Create", code: "Create" }, + { title: "Update", value: "Update", code: "Update" }, + { title: "Publish", value: "Publish", code: "Publish" }, + { title: "Republish", value: "Republish", code: "Republish" }, + { title: "Unpublish", value: "Unpublish", code: "Unpublish" }, + + { title: "Assign", value: "Assign", code: "Assign" }, + { title: "Assign me", value: "Assign me", code: "Assign me" }, + { title: "Assign {id}", value: "Assign {id}", code: "AssignId" }, + + { title: "Create&Assign", value: "Create&Assign", code: "Create&Assign" }, + { title: "Create&Assign me", value: "Create&Assign me", code: "Create&Assign me" }, + { title: "Create&Assign {id}", value: "Create&Assign {id}", code: "Create&AssignId" }, +]; diff --git a/definitions/mfm/actor-types.ts b/definitions/mfm/actor-types.ts new file mode 100644 index 0000000..ef3c7cd --- /dev/null +++ b/definitions/mfm/actor-types.ts @@ -0,0 +1,6 @@ +export const actorTypes = [ + { title: 'Performer', value: 0 }, + { title: 'Supervisor', value: 1 }, + { title: 'Monitor', value: 2 }, + ]; + \ No newline at end of file diff --git a/definitions/mfm/enable-disable-button.ts b/definitions/mfm/enable-disable-button.ts new file mode 100644 index 0000000..6c74ad6 --- /dev/null +++ b/definitions/mfm/enable-disable-button.ts @@ -0,0 +1,9 @@ +/**phục vụ cho việc enable, disable các button cơ bản cho workflow + * hiện tại chỉ thêm trong state + * Nút delete hiện tại chỉ người nào tạo bài viết đó thì mới được hiển thị nút xóa ở trạng thái cho phép hiển thị nút xóa + */ +export const enableDisableButton = [ + { title: 'Creatable',value: true}, + { title: 'Updatable',value: true}, + { title: 'Deletable' ,value: false}, + ]; \ No newline at end of file diff --git a/definitions/mfm/index.ts b/definitions/mfm/index.ts new file mode 100644 index 0000000..7fb0f2a --- /dev/null +++ b/definitions/mfm/index.ts @@ -0,0 +1,4 @@ +export { stateTaxonomy } from "./state-taxonomy"; +export { actorTypes } from "./actor-types"; +export { enableDisableButton } from "./enable-disable-button"; +export { actionCommands } from "./action-type"; diff --git a/definitions/mfm/state-taxonomy.ts b/definitions/mfm/state-taxonomy.ts new file mode 100644 index 0000000..29ffa3b --- /dev/null +++ b/definitions/mfm/state-taxonomy.ts @@ -0,0 +1,26 @@ +export const stateTaxonomy = [ + { title: "Chờ biên tập", value: "Chờ biên tập", value_number: "1" }, + { title: "Chờ xem xét", value: "Chờ xem xét", value_number: "1" }, + { title: "Chờ duyệt bài", value: "Chờ duyệt bài", value_number: "1" }, + { title: "Chờ xuất bản", value: "Chờ xuất bản", value_number: "1" }, + { title: "Đã yêu cầu hủy xuất bản", value: "Đã yêu cầu hủy xuất bản", value_number: "1" }, + { title: "Đang chỉnh sửa", value: "Đang chỉnh sửa", value_number: "5" }, + { title: "Đang biên tập", value: "Đang biên tập", value_number: "5" }, + { title: "Đang xem xét", value: "Đang xem xét", value_number: "5" }, + { title: "Đang duyệt bài", value: "Đang duyệt bài", value_number: "5" }, + { title: "Đang xuất bản", value: "Đang xuất bản", value_number: "5" }, + { title: "Đang duyệt hủy xuất bản", value: "Đang duyệt hủy xuất bản", value_number: "5" }, + { title: "Đã soạn thảo", value: "Đã soạn thảo", value_number: "10" }, + { title: "Đã biên tập", value: "Đã biên tập", value_number: "10" }, + { title: "Đã xem xét", value: "Đã xem xét", value_number: "10" }, + { title: "Đã duyệt bài", value: "Đã duyệt bài", value_number: "10" }, + { title: "Đã hủy xuất bản", value: "Đã hủy xuất bản", value_number: "10" }, + { title: "Đã lên lịch", value: "Đã lên lịch", value_number: "10" }, + { title: "Bài bị trả về", value: "Bài bị trả về", value_number: "15" }, + { title: "Đã từ chối hủy xuất bản", value: "Đã từ chối hủy xuất bản", value_number: "15" }, + { title: "Đã xuất bản", value: "Đã xuất bản", value_number: "20" }, + { title: "Bài bị hạ", value: "Bài bị hạ", value_number: "25" }, + { title: "Chờ nhận dàn trang", value: "Chờ nhận dàn trang", value_number: "1" }, + { title: "Đang dàn trang ", value: "Đang dàn trang ", value_number: "5" }, + { title: "Đã dàn trang", value: "Đã dàn trang", value_number: "10" }, +]; diff --git a/definitions/priority-options.ts b/definitions/priority-options.ts new file mode 100644 index 0000000..5c37161 --- /dev/null +++ b/definitions/priority-options.ts @@ -0,0 +1,7 @@ +export const priorityOptions = [ + { title: 'Top', value: 0 }, + { title: 'High', value: 1 }, + { title: 'Medium', value: 2 }, + { title: 'Low', value: 3 }, + ]; + \ No newline at end of file diff --git a/definitions/publishedBy-options.ts b/definitions/publishedBy-options.ts new file mode 100644 index 0000000..54f4b2c --- /dev/null +++ b/definitions/publishedBy-options.ts @@ -0,0 +1,4 @@ +export const publishedByOptions = [ + { name: "Phóng viên", value: 1 }, + { name: "Biên tập", value: 2 }, +]; diff --git a/definitions/system-status.ts b/definitions/system-status.ts new file mode 100644 index 0000000..337b6f2 --- /dev/null +++ b/definitions/system-status.ts @@ -0,0 +1,5 @@ +export const systemStatus = [ + + { title: 'Deleted', value: -1 }, + ]; + \ No newline at end of file diff --git a/definitions/trend-options.ts b/definitions/trend-options.ts new file mode 100644 index 0000000..418a8cf --- /dev/null +++ b/definitions/trend-options.ts @@ -0,0 +1,5 @@ +export const trendOptions = [ + { title: 'Daily Trends', value: 'dailytrends' }, + { title: 'Realtime Trends', value: 'realtimetrends' } + ]; + \ No newline at end of file diff --git a/definitions/yes-no-options.ts b/definitions/yes-no-options.ts new file mode 100644 index 0000000..a760651 --- /dev/null +++ b/definitions/yes-no-options.ts @@ -0,0 +1,5 @@ +export const yesNoOptions = [ + { title: 'Yes', value: true }, + { title: 'No', value: false }, + ]; + \ No newline at end of file diff --git a/layouts/default.vue b/layouts/default.vue new file mode 100644 index 0000000..39979c4 --- /dev/null +++ b/layouts/default.vue @@ -0,0 +1,26 @@ + + + diff --git a/mocks/index.ts b/mocks/index.ts new file mode 100644 index 0000000..a765ea6 --- /dev/null +++ b/mocks/index.ts @@ -0,0 +1 @@ +export { default as MenuData } from './menu' \ No newline at end of file diff --git a/mocks/menu.ts b/mocks/menu.ts new file mode 100644 index 0000000..7cfd7e7 --- /dev/null +++ b/mocks/menu.ts @@ -0,0 +1,438 @@ +export default [ + { + name: 'Thời sự', + slug: 'thoi-su', + isMain: true, + children: [ + { + name: 'Chính trị', + slug: 'chinh-tri' + }, + { + name: 'Dân sinh', + slug: 'chinh-tri' + }, + { + name: 'Lao động - Việc làm', + slug: 'lao-dong-viec-lam' + }, + { + name: 'Giao thông', + slug: 'giao-thong' + } + ] + }, + { + name: 'Góc Nhìn', + slug: 'goc-nhin', + isMain: true, + children: [ + { + name: 'Bình luận nhiều', + slug: 'binh-luan-nhieu' + }, + { + name: 'Chính trị & Chính sách', + slug: 'chinh-tri-chinh-sach' + }, + { + name: 'Y tế & Sức khoẻ', + slug: 'y-te-suc-khoe' + }, + { + name: 'Kinh doanh & Quản trị', + slug: 'kinh-doanh-quan-tri' + } + ] + }, + { + name: 'Thế giới', + slug: 'the-gioi', + isMain: true, + children: [ + { + name: 'Tư liệu', + slug: 'tu-lieu' + }, + { + name: 'Phân tích', + slug: 'phan-tich' + }, + { + name: 'Người Việt 5 Châu', + slug: 'nguoi-viet-5-chau' + }, + { + name: 'Cuộc sống đó đây', + slug: 'cuoc-song-do-day' + } + ] + }, + { + name: 'Video', + slug: 'video', + isMain: true, + children: [ + { + name: 'Thời sự', + slug: 'thoi-su' + }, + { + name: 'Nhịp sống', + slug: 'nhip-song' + }, + { + name: 'Food', + slug: 'food' + }, + { + name: 'Tôi kể', + slug: 'toi-ke' + }, + ] + }, + { + name: 'Podcasts', + slug: 'podcasts', + isMain: true, + children: [ + { + name: 'Podcasts hôm nay', + slug: 'podcasts-hom-nay' + }, + { + name: 'Tiền để làm gì?', + slug: 'tien-de-lam-gi' + }, + { + name: 'Tài chính cá nhân', + slug: 'tai-chinh-ca-nhan' + }, + { + name: 'Giải mã', + slug: 'giai-ma' + } + ] + }, + { + name: 'Kinh doanh', + slug: 'kinh-doanh', + isMain: true, + children: [ + { + name: 'Quốc tế', + slug: 'quoc-te', + }, + { + name: 'Doanh nghiệp', + slug: 'doanh-nghiep', + }, + { + name: 'Chứng khoán', + slug: 'chung-khoan', + }, + { + name: 'EBank', + slug: 'e-bank', + } + ] + }, + { + name: 'Bất động sản', + slug: 'bat-dong-san', + isMain: true, + children: [ + { + name: 'Chính sách', + slug: 'chinh-sach' + }, + { + name: 'Thị trường', + slug: 'thi-truong' + }, + { + name: 'Dự án', + slug: 'du-an' + }, + { + name: 'Không gian sống', + slug: 'khong-gian-song' + } + ] + }, + { + name: 'Khoa học', + slug: 'khoa-hoc', + isMain: true, + children: [ + { + name: 'Khoa học trong nước', + slug: 'khoa-hoc-trong-nuoc' + }, + { + name: 'Tin tức', + slug: 'tin-tuc' + }, + { + name: 'Phát minh', + slug: 'phat-minh' + }, + { + name: 'Ứng dụng', + slug: 'ung-dung' + } + ] + }, + { + name: 'Giải trí', + slug: 'giai-tri', + isMain: true, + children: [ + { + name: 'Giới sao', + slug: 'gioi-sao' + }, + { + name: 'Sách', + slug: 'sach' + }, + { + name: 'Video', + slug: 'video' + }, + { + name: 'Phim', + slug: 'phim' + } + ] + }, + { + name: 'Thể thao', + slug: 'the-thao', + isMain: true, + children: [ + { + name: 'Lịch thi đấu', + slug: 'lich-thi-dau' + }, + { + name: 'Bóng đã', + slug: 'bong-da' + }, + { + name: 'Tennis', + slug: 'tennis' + }, + { + name: 'E-Sports', + slug: 'e-sports' + } + ] + }, + { + name: 'Pháp luật', + slug: 'phap-luat', + isMain: true, + children: [ + { + name: 'Hồ sơ phá án', + slug: 'ho-so-pha-an' + }, + { + name: 'Tư vấn', + slug: 'tu-van' + }, + { + name: 'Video', + slug: 'video' + } + ] + }, + { + name: 'Giáo dục', + slug: 'giao-duc', + isMain: true, + children: [ + { + name: 'Tin tức', + slug: 'tin-tuc' + }, + { + name: 'Tuyển sinh', + slug: 'tuyen-sinh' + }, + { + name: 'Tra cứu', + slug: 'tra-cuu' + }, + { + name: 'Diễn đàn', + slug: 'dien-dan' + } + ] + }, + { + name: 'Sức khoẻ', + slug: 'suc-khoe', + isMain: true, + children: [ + { + name: 'Tin tức', + slug: 'tin-tuc' + }, + { + name: 'Tư vấn', + slug: 'tu-van' + }, + { + name: 'Dinh dưỡng', + slug: 'dinh-duong' + }, + { + name: 'Khoẻ đẹp', + slug: 'khoe-dep' + } + ] + }, + { + name: 'Đời sống', + slug: 'doi-song', + isMain: true, + children: [ + { + name: 'Nhịp sống', + slug: 'nhip-song' + }, + { + name: 'Tổ ấm', + slug: 'to-am' + }, + { + name: 'Bài học', + slug: 'bai-hoc' + }, + { + name: 'Nấu ăn', + slug: 'nau-an' + } + ] + }, + { + name: 'Du lịch', + slug: 'du-lich', + isMain: true, + children: [ + { + name: 'Điểm đến', + slug: 'diem-den' + }, + { + name: 'Ẩm thực', + slug: 'am-thuc' + }, + { + name: 'Dấu chân', + slug: 'dau-chan' + }, + { + name: 'Tư vấn', + slug: 'tu-van' + } + ] + }, + { + name: 'Số hoá', + slug: 'so-hoa', + isMain: true, + children: [ + { + name: 'Công nghệ', + slug: 'cong-nghe' + }, + { + name: 'Sản phẩm', + slug: 'san-pham' + }, + { + name: 'Blockchain', + slug: 'blockchain' + }, + { + name: 'CTO Summit 2023', + slug: 'cto-summit-2023' + } + ] + }, + { + name: 'Xe', + slug: 'xe', + isMain: true, + children: [ + { + name: 'Thị trường', + slug: 'thi-truong' + }, + { + name: 'Car Awards 2023', + slug: 'car-awards-2023' + }, + { + name: 'Diễn đàn', + slug: 'dien-dan' + }, + { + name: 'V-Car', + slug: 'v-car' + } + ] + }, + { + name: 'Thư giãn', + slug: 'thu-gian', + isMain: true, + children: [ + { + name: 'Cười', + slug: 'cuoi' + }, + { + name: 'Đố vui', + slug: 'do-vui' + }, + { + name: 'Chuyện lạ', + slug: 'chuyen-la' + }, + { + name: 'Crossword', + slug: 'crossword' + } + ] + }, + { + name: 'Ý kiến', + slug: 'y-kien', + isMain: true, + children: [ + { + name: 'Thời sự', + slug: 'thoi-su' + }, + { + name: 'Đời sống', + slug: 'doi-song' + } + ] + }, + { + name: 'Tâm sự', + slug: 'tam-su', + isMain: true, + children: [ + { + name: 'Hẹn hò', + slug: 'hen-ho' + } + ] + } +] \ No newline at end of file diff --git a/nuxt.config.ts b/nuxt.config.ts new file mode 100644 index 0000000..e535bc4 --- /dev/null +++ b/nuxt.config.ts @@ -0,0 +1,82 @@ +import { createResolver } from "@nuxt/kit"; +const { resolve } = createResolver(import.meta.url); +// https://nuxt.com/docs/api/configuration/nuxt-config + +export default defineNuxtConfig({ + nitro: { + preset: 'iis_node' + }, + devtools: { enabled: true }, + app: { + head: { + link: [], + }, + }, + modules: [ + '@nuxt/image', + "@unocss/nuxt", + "@vueuse/nuxt", + "@pinia/nuxt", + "nuxt-delay-hydration", + // "@nuxtjs/critters", + "nuxt-icon", + // "nuxt-custom-elements", + "dayjs-nuxt", + "nuxt-swiper", + "nuxt-lodash", + // "nuxt-headlessui", + '@ant-design-vue/nuxt', + // "@sidebase/nuxt-auth", + ], + + runtimeConfig: { + public: { + apiUrl: process.env.NUXT_PUBLIC_BASE_API || "http://api-portal.vpress.vn/api-v1", + site: process.env.NUXT_PUBLIC_SITE_DEFAULT || "1", + }, + authSecret: process.env.AUTH_SECRET||"vpress" + }, + + alias: { + "@": resolve(__dirname, "./"), + "~": resolve(__dirname, "./"), + }, + + css: ["@/assets/styles/app.sass", "@unocss/reset/tailwind-compat.css"], + + // dayjs + dayjs: { + locales: ["vi"], + plugins: ["relativeTime", "utc", "timezone"], + defaultTimezone: "Asia/Ho_Chi_Minh", + defaultLocale: ["vi", { + weekdays: 'Chủ nhật_Thứ Hai_Thứ Ba_Thứ Tư_Thứ Năm_Thứ Sáu_Thứ Bảy'.split('_'), + }], + }, + + lodash: { + prefix: "_", + }, + + // pinia + pinia: { + autoImports: [ + 'defineStore', // import { defineStore } from 'pinia' + ['defineStore', 'definePiniaStore'], // import { defineStore as definePiniaStore } from 'pinia' + 'storeToRefs', + 'acceptHMRUpdate', + ], + }, + + vue: { + defineModel: true, + runtimeCompiler: true, + propsDestructure: true, + }, + + ssr: true, + + typescript: { + shim: false, + }, +}); diff --git a/package.json b/package.json new file mode 100644 index 0000000..b9d2f84 --- /dev/null +++ b/package.json @@ -0,0 +1,62 @@ +{ + "name": "nuxt-app", + "private": true, + "scripts": { + "build": "nuxt build --dotenv .env.production", + "dev": "nuxt dev", + "generate": "nuxt generate", + "preview": "nuxt preview", + "postinstall": "nuxt prepare" + }, + "devDependencies": { + "@ant-design-vue/nuxt": "^1.4.1", + "@nuxt/devtools": "1.0.0", + "@nuxt/image": "^1.1.0", + "@pinia/nuxt": "latest", + "@remix-run/web-file": "^3.1.0", + "@sidebase/nuxt-auth": "^0.6.4", + "@types/glidejs__glide": "latest", + "@unocss/postcss": "latest", + "cva": "beta", + "dayjs-nuxt": "^2.1.8", + "nuxt": "latest", + "nuxt-custom-elements": "beta", + "nuxt-headlessui": "^1.1.4", + "nuxt-icon": "latest", + "nuxt-lodash": "latest", + "typescript": "^5.3.3", + "vue-tsc": "^1.8.27" + }, + "dependencies": { + "@glidejs/glide": "^3.6.0", + "@unocss/nuxt": "latest", + "@unocss/reset": "latest", + "@vueuse/core": "^10.8.0", + "@vueuse/nuxt": "10.5.0", + "aos": "latest", + "axios": "^1.5.1", + "cheerio": "^1.0.0-rc.12", + "clsx": "^2.1.0", + "defu": "^6.1.4", + "ipx": "^3.0.1", + "mitt": "^3.0.1", + "next-auth": "4.21.1", + "node-html-parser": "latest", + "nuxt-delay-hydration": "latest", + "nuxt-swiper": "latest", + "parse-nested-form-data": "^1.0.0", + "request": "^2.88.2", + "request-promise": "^0.0.1", + "require": "^0.4.4", + "sass": "latest", + "sass-loader": "latest", + "tailwind-merge": "latest", + "vite-svg-loader": "latest", + "vue-advanced-cropper": "^2.8.8", + "winston": "^3.11.0", + "zod": "^3.22.4" + }, + "overrides": { + "vue": "latest" + } +} diff --git a/pages/index.vue b/pages/index.vue new file mode 100644 index 0000000..52d8c97 --- /dev/null +++ b/pages/index.vue @@ -0,0 +1,39 @@ + + + \ No newline at end of file diff --git a/pages/test.vue b/pages/test.vue new file mode 100644 index 0000000..b334b05 --- /dev/null +++ b/pages/test.vue @@ -0,0 +1,15 @@ + + + \ No newline at end of file diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..18993ad Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/images/100.png b/public/images/100.png new file mode 100644 index 0000000..03ffda1 Binary files /dev/null and b/public/images/100.png differ diff --git a/public/images/150.png b/public/images/150.png new file mode 100644 index 0000000..4cf888e Binary files /dev/null and b/public/images/150.png differ diff --git a/public/images/1600x900a.jpg b/public/images/1600x900a.jpg new file mode 100644 index 0000000..97cb870 Binary files /dev/null and b/public/images/1600x900a.jpg differ diff --git a/public/images/200.png b/public/images/200.png new file mode 100644 index 0000000..7ab2f97 Binary files /dev/null and b/public/images/200.png differ diff --git a/public/images/42.png b/public/images/42.png new file mode 100644 index 0000000..aebedd5 Binary files /dev/null and b/public/images/42.png differ diff --git a/public/images/VPress.png b/public/images/VPress.png new file mode 100644 index 0000000..ce89fe1 Binary files /dev/null and b/public/images/VPress.png differ diff --git a/public/images/default-thumbnail.jpg b/public/images/default-thumbnail.jpg new file mode 100644 index 0000000..b6f2279 Binary files /dev/null and b/public/images/default-thumbnail.jpg differ diff --git a/public/images/logo-footer-tttc.png b/public/images/logo-footer-tttc.png new file mode 100644 index 0000000..304ea60 Binary files /dev/null and b/public/images/logo-footer-tttc.png differ diff --git a/public/images/logo-ktdt-tttc.png b/public/images/logo-ktdt-tttc.png new file mode 100644 index 0000000..b03839e Binary files /dev/null and b/public/images/logo-ktdt-tttc.png differ diff --git a/public/images/logo-ktdt.png b/public/images/logo-ktdt.png new file mode 100644 index 0000000..b03839e Binary files /dev/null and b/public/images/logo-ktdt.png differ diff --git a/public/images/logo-tttc.png b/public/images/logo-tttc.png new file mode 100644 index 0000000..fe2a2b3 Binary files /dev/null and b/public/images/logo-tttc.png differ diff --git a/public/images/logo.png b/public/images/logo.png new file mode 100644 index 0000000..35bba5c Binary files /dev/null and b/public/images/logo.png differ diff --git a/public/images/logotttc.png b/public/images/logotttc.png new file mode 100644 index 0000000..fe2a2b3 Binary files /dev/null and b/public/images/logotttc.png differ diff --git a/public/images/logotttcfooter.png b/public/images/logotttcfooter.png new file mode 100644 index 0000000..304ea60 Binary files /dev/null and b/public/images/logotttcfooter.png differ diff --git a/public/images/vp-1.png b/public/images/vp-1.png new file mode 100644 index 0000000..38a32ed Binary files /dev/null and b/public/images/vp-1.png differ diff --git a/public/svg/logo.svg b/public/svg/logo.svg new file mode 100644 index 0000000..df34471 --- /dev/null +++ b/public/svg/logo.svg @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/server/api/dynamic-page/[...].ts b/server/api/dynamic-page/[...].ts new file mode 100644 index 0000000..d656343 --- /dev/null +++ b/server/api/dynamic-page/[...].ts @@ -0,0 +1,9 @@ +import { createRouter, defineEventHandler, useBase } from 'h3' +import * as DynamicPageCtrl from '~/server/models/dynamic-page' + +const router = createRouter() + +router.get('/getByCode/:code', defineEventHandler(DynamicPageCtrl.getDynamicPageByCode)) +router.get('/get-by-id/:id', defineEventHandler(DynamicPageCtrl.getDynamicPageById)) + +export default useBase('/api/services', router.handler) diff --git a/server/api/services/[...].ts b/server/api/services/[...].ts new file mode 100644 index 0000000..ecdacc1 --- /dev/null +++ b/server/api/services/[...].ts @@ -0,0 +1,30 @@ +import { createRouter, defineEventHandler, useBase } from 'h3' +import * as DynamicPageCtrl from '~/server/models/dynamic-page' + +const router = createRouter() + +router.get('/get-by-code/:slug', defineEventHandler(async (event : any) => { + try { + const { apiUrl } = useRuntimeConfig().public + const slug = event.context.params.slug; + const { item } : any = await $fetch(`${apiUrl}/cms/overview-page/1`) + + return item + } catch (error) { + handleError(error); + } +})) + +router.get('/get-by-id/:id', defineEventHandler(async (event : any) => { + try { + const { apiUrl } = useRuntimeConfig().public + const slug = event.context.params.slug; + const { item } : any = await $fetch(`${apiUrl}/cms/overview-page/1`) + + return item + } catch (error) { + handleError(error); + } +})) + +export default useBase('/api/services', router.handler) diff --git a/server/models/dynamic-page/index.ts b/server/models/dynamic-page/index.ts new file mode 100644 index 0000000..4574627 --- /dev/null +++ b/server/models/dynamic-page/index.ts @@ -0,0 +1,128 @@ +interface Base { + createdBy?: string | number + createdOn?: string + updatedBy?: string | number + updatedOn?: string +} +interface PageSettings { + label?: string; // Nhãn + layout?: string; // Bố cục + template?: string; // Bản mẫu + mainLink?: boolean; // Liên kết chính + footerLink?: boolean; // Liên kết chân trang + sidebarLink?: boolean; // Liên kết trượt bên + floatingLink?: boolean; // Liên kết bám nổi + dataType?: string; // Loại dữ liệu: Section, Category, Topic, Event, Collection, Article, Tag, Author, Poll, Quiz, Survey, Advertising, Other + dataQuery?: string; // Truy vấn dữ liệu: IDS | NEW | VIEW | SQL | REQUEST | PARAM | ... + dataResult?: string; // Kết quả dữ liệu (Json) +} +interface PageSectionSettings { + label?: string; // Nhãn + layout?: string; // Bố cục + template?: string; // Bản mẫu +} +interface PageComponentSettings { + label?: string; // Nhãn + layout?: string; // Bố cục + template?: string; // Bản mẫu + dataType?: string; // Loại dữ liệu: Section, Category, Topic, Event, Collection, Article, Tag, Author, Poll, Quiz, Survey, Advertising, Other + dataQuery?: string; // Truy vấn dữ liệu: IDS | NEW | VIEW | SQL | REQUEST | ... + dataResult?: string; // Kết quả dữ liệu (Json) +} + +interface PageSection extends Base { + 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 +} +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[]; +} + +export const getDynamicPageByCode = async (event : any) => { + try { + const { apiUrl } = useRuntimeConfig().public + const slug = event.context.params.slug; + + const { item }: any = await $fetch(`${apiUrl}/cms/overview-page/slug:${slug}`) + console.log('============') + console.log(item) + console.log('============') + return { item } + } catch (error) { + handleError(error); + } +} + +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}`, { + method: 'GET', + }) + return { item } + } catch (error) { + handleError(error); + } +} \ No newline at end of file diff --git a/server/tsconfig.json b/server/tsconfig.json new file mode 100644 index 0000000..b9ed69c --- /dev/null +++ b/server/tsconfig.json @@ -0,0 +1,3 @@ +{ + "extends": "../.nuxt/tsconfig.server.json" +} diff --git a/server/utils/error.ts b/server/utils/error.ts new file mode 100644 index 0000000..b4e4307 --- /dev/null +++ b/server/utils/error.ts @@ -0,0 +1,11 @@ +import { H3Error} from 'h3' + +export function handleError(error: any){ + const h3Error = new H3Error('') + + h3Error.statusCode = error.statusCode||500 + h3Error.statusMessage = error.statusMessage||'Internal Server Error' + h3Error.data = error.data + + throw createError(h3Error) +} \ No newline at end of file diff --git a/stores/dynamic-page.ts b/stores/dynamic-page.ts new file mode 100644 index 0000000..4ba1452 --- /dev/null +++ b/stores/dynamic-page.ts @@ -0,0 +1,74 @@ +import { defineStore, acceptHMRUpdate } from "pinia"; + +export const useDynamicPageStore = defineStore("dynamicPageStore", () => { + const currentPage = ref({}); + const sectionPublished = ref([]); + const componentPublished = ref([]); + + async function fetchPageByCode(slug: any) { + try { + const { data } = await useFetch(`/api/services/get-by-code/${slug}`) + currentPage.value = data.value + } catch (error: any) {} + } + + async function fetchPageById(id: string | number) { + try { + const {data} = await useFetch(`/api/services/get-by-id/${id}`) + currentPage.value = data.value + } catch (error: any) {} + } + + const setSectionPublished = () => { + const contentArr: any = []; + currentPage.value.sections && currentPage.value.sections.map((section: any) => { + contentArr.push(section.content && typeof section.content === 'string' && JSON.parse(section.content)); + return section; + }); + + sectionPublished.value = currentPage.value.sections && currentPage.value.sections.filter( + (section: any) => section.isPublished && !contentArr.flat().some((_section: any) => _section && _section.data && _section.type === "section" && section.id === _section.data) + ); + }; + + const setComponentPublished = () => { + const contentArr: any = []; + currentPage.value.sections && currentPage.value.sections.map((section: any) => { + contentArr.push(section.content && JSON.parse(section.content) && JSON.parse(section.content)); + return section; + }); + componentPublished.value = currentPage.value.components && currentPage.value.components.filter((section: any) => section.isPublished); + }; + + const setDataQuery = (query: any, componentId: number | string) => { + for (const _component of currentPage.value.components && currentPage.value.components) { + if (_component.id === componentId) { + const currentSetting = { + ..._component.settings, + dataQuery: query, + }; + _component.settings = { + ...currentSetting, + }; + break; + } + } + setComponentPublished(); + }; + + return { + currentPage, + sectionPublished, + componentPublished, + + fetchPageByCode, + fetchPageById, + setSectionPublished, + setComponentPublished, + setDataQuery, + }; +}); + +if (import.meta.hot) { + import.meta.hot.accept(acceptHMRUpdate(useDynamicPageStore, import.meta.hot)); +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..a746f2a --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,4 @@ +{ + // https://nuxt.com/docs/guide/concepts/typescript + "extends": "./.nuxt/tsconfig.json" +} diff --git a/uno.config.ts b/uno.config.ts new file mode 100644 index 0000000..4a27d30 --- /dev/null +++ b/uno.config.ts @@ -0,0 +1,85 @@ +import type { ConfigBase } from "unocss"; + +import { + defineConfig, + transformerVariantGroup, + transformerDirectives, + presetWebFonts, + presetUno, + presetMini, +} from "unocss"; + +export default defineConfig({ + safelist: [], + + theme: { + colors: { + 'primary': { + 100: "#3c7abc", + }, + // 'red': '#ff0018', + // 'blue': '#2d6cf6', + // 'brown-700': '#99553D', + // 'gray-100': '#f5f5f5', + // 'gray-200': '#eee', + // 'gray-400': '#bdbdbd', + // 'gray-600': '#757575', + // 'gray-700': '#616161', + // 'green-100': '#2ED0A9', + // 'yellow-700': '#eaa23e', + }, + }, + + shortcuts: [ + { + "after:no-content": "after:content-['']", + "before:no-content": "before:content-['']", + 'container-xxl': 'px-[8px] mx-auto w-full sm:w-620px md:w-760px lg:w-980px xl:w-1100px 2xl:w-1320px', + }, + ], + rules: [ + [ + "text-fill-transparent", + { + "-webkit-text-fill-color": "transparent", + "text-fill-color": "transparent", + }, + ], + [ + "backdrop-blur-xs", + { + "backdrop-filter": "blur(2px)", + "-webkit-backdrop-filter": "blur(2px)", + }, + ], + [ + "max-w-6xl", + { + "max-width": "60rem", + }, + ], + [ + "max-w-8xl", + { + "max-width": "85.375rem", + }, + ], + ], + extractors: [], + presets: [ + presetUno(), + presetMini(), + presetWebFonts({ + provider: "google", + fonts: { + nunito: "Nunito", + playfair: ['Playfair Display', 'sans-serif'], + 'playfair-display': ['Playfair Display', 'serif'], + 'bai-jamjuree': ['Bai Jamjuree', 'Arial', 'sans-serif'], + sans: ['Raleway', 'Arial', "Helvetica Neue", 'Helvetica', 'sans-serif'], + arial: ['Arial', 'sans-serif'], + }, + }), + ], + transformers: [transformerVariantGroup(), transformerDirectives()], +}) satisfies ConfigBase; diff --git a/utils/parseSQL.ts b/utils/parseSQL.ts new file mode 100644 index 0000000..692a0bc --- /dev/null +++ b/utils/parseSQL.ts @@ -0,0 +1,249 @@ +/* Bộ query mẫu */ +// Sql[SELECT * FROM Table WHERE Id=1] Key[xxx] +// Uri[link-api] Method[Post] Params[{"param1":"value1","param2":"value2"}] Headers[{"Authorization":"12345678","Content-Type":"application/json"}] Content[{"data1":"value1","data2":"value2"}] Key[xxx] +// Get[Article] Top[10] With[Topics:1,2,3] Sort[Views-,Shares+] + +import { isEmpty } from "lodash"; + +const keyMapping = { + // 3 query key để phân loại + Sql: 'Sql', + Uri: 'Uri', + Get: 'Get', + Key: 'Key', + Method: 'Method', + Params: 'Params', + Headers: 'Headers', + Content: 'Content', + Top: 'Top', + Page: 'Page', + With: 'With', + Sort: 'Sort', + TTL: 'TTL', + Ids: 'Ids' +}; + +const SQL_MODEL = { + Get: "", + Top: 1, + Page: 0, + With: [], + Sort: [], + TTL: "", + Key: "", + Ids: [], +} + +const REQUEST_MODEL = { + TTL: "", + Key: "", + Uri: "", + Method: "Get", + Params: [], + Headers: [], + Content: [], +}; + +const CUSTOM_MODEL = { + TTL: "", + Key: "", + Sql: "", +}; + +const regexParseString = (key: String) => { + const pattern = `${key}\\[(.*?)\\]`; + return new RegExp(pattern); +} +const regexParseStringColon = (key: String, suffix: string = ']') => { + const pattern = `${key}:\\s*([^;\\]]+)`; + return new RegExp(pattern); +} + +const getObjectWithModel = (model: any, queryString: string) => { + let resultObject: any = {}; + for (let [key] of Object.entries(model)) { + let resultValue: any = null; + const matchValue = queryString.match(regexParseString(key)) || ''; + let currentMatchValue: any = matchValue && matchValue[1]; + if (key === keyMapping.With) { + const splitArrWithSemi = currentMatchValue.split(';').length > 0 ? currentMatchValue.split(';') : [currentMatchValue]; + resultValue = splitArrWithSemi.map((_: any) => { + const parseColon = _.split(':'); + return { + key: parseColon[0], + value: parseColon[1], + } + }).filter((item: any) => item.value); + } else if (key === keyMapping.Sort) { + const splitArrWithComma = currentMatchValue.split(',').length > 0 ? currentMatchValue.split(',') : [currentMatchValue]; + resultValue = splitArrWithComma.map((_: any) => { + const isPlus = _.includes('+') + const isMinus = _.includes('-') + const key = _.replaceAll('-', '').replaceAll('+', ''); + return { + key, + value: isPlus ? '+' : isMinus ? '-' : '' + } + }).filter((item: any) => item.value); + } + else if ([keyMapping.Content, keyMapping.Headers, keyMapping.Params].includes(key)) { + if(currentMatchValue) { + const parsedObject = JSON.parse(currentMatchValue); + resultValue = Object.entries(parsedObject).map(([key, value]) => ({ key, value })); + } + } + else { + resultValue = currentMatchValue; + } + + resultObject = { + ...resultObject, + [key]: resultValue + } + } + return resultObject; +} + +const ArrayToString = (array: any, key: string, prefix: string, suffix: string) => { + if (!Array.isArray(array) || array.length === 0) { + return ''; + } + const toString = array.filter((item: any) => item.value).reduce((accumulator: any, currentObject: any, index: number) => { + const parseString = currentObject.key + prefix + currentObject.value; + return index === 0 ? accumulator + parseString : accumulator + suffix + parseString; + }, "") + return key + "[" + toString + "]"; +} + +const parseDataQueryFormString = (command: string) => { + if (isEmpty(command)) return null; + + let resultObject: any = null; + let typeQuery: any = null; + + if (command.includes(keyMapping.Sql)) { + typeQuery = keyMapping.Sql + } else if (command.includes(keyMapping.Uri)) { + typeQuery = keyMapping.Uri + } else if (command.includes(keyMapping.Get)) { + typeQuery = keyMapping.Get + } + + if (!typeQuery) return null; + + switch (typeQuery) { + case keyMapping.Sql: + resultObject = Object.assign(CUSTOM_MODEL, getObjectWithModel(CUSTOM_MODEL, command)); + break; + case keyMapping.Uri: + resultObject = Object.assign(REQUEST_MODEL, getObjectWithModel(REQUEST_MODEL, command)); + break; + case keyMapping.Get: + resultObject = Object.assign(SQL_MODEL, getObjectWithModel(SQL_MODEL, command)); + break; + default: + resultObject = {}; + } + return { + typeQuery, + value: resultObject + } +} + +const parseDataQueryFormObject = (command: any) => { + const resultString = Object.entries(command).reduce((accumulator, [key, value]) => { + if (!value) return accumulator; + let parseString: string = ''; + if (key === keyMapping.With) { + parseString = ArrayToString(value, key, ':', ';'); + } else if (key === keyMapping.Sort) { + parseString = ArrayToString(value, key, '', ','); + } else if ([keyMapping.Content, keyMapping.Headers, keyMapping.Params].includes(key)) { + const reduceArrayToObject = value.reduce((acc: any, { key, value }: any) => { + acc[key.trim()] = value.trim(); + return acc; + }, {}); + const formattedValue = Object.keys(reduceArrayToObject).length ? JSON.stringify(reduceArrayToObject) : ""; + parseString = formattedValue ? `${key}[${formattedValue}]` : "" + } + else { + if (typeof value === "string") { + value = value.trim(); + } else { + value = value < 0 ? 0 : value; + } + if(value) parseString = key + "[" + value + "]" + } + return parseString ? accumulator + " " + parseString : accumulator; + }, ""); + return resultString; +} + +const DEFAULT_QUERY_DROP = (key: string, id: any, TTL?: String) => { + return `Get[${key}] With[Id:${id}]${TTL ? ` TTL[${TTL}]` : ''}`; +} + +const COLLECTION_QUERY_DROP = (key: string, ids: any, TTL?: String) => { + let arraySplit : any = null; + try { + arraySplit = ids.split(','); + } catch { + arraySplit = 1; + } + return `Get[${key}]${`${arraySplit && arraySplit.length > 0 ? ` Top[${arraySplit?.length}]` : ` Top[1]`}`} With[Ids:${ids.toString()}]${TTL ? ` TTL[${TTL}]` : ''}`; +} + +const COLLECTION_PAGING_QUERY_DROP = (key: string, params: { key: string; value: any; }, TTL?: string) => { + return `Get[${key}] Top[20] With[${params.key}:${params.value}]${TTL ? ` TTL[${TTL}]` : ''}`; +}; + +const getValueStringWithKey = (queryString: string, key: string = keyMapping.Ids) => { + const matchValue = queryString.match(regexParseString(key)) || ''; + let currentMatchValue : any = matchValue && matchValue[1]; + return currentMatchValue; +} + +const getValueStringWithKeyAndColon = (queryString: string, key: string = keyMapping.Ids) => { + const matchValue = queryString.match(regexParseStringColon(key)) || ''; + let currentMatchValue : any = matchValue && matchValue[1]; + return currentMatchValue; +} + +const getInputValue = (inputValue: any, typeGet: 'OBJECT' | 'ARRAY') => { + if (!inputValue) return null; + + let _inputValue : any = null; + try { + _inputValue = JSON.parse(inputValue) + } catch { + _inputValue = inputValue + } + + let typeOfInputValue : any = null; + if (Array.isArray(_inputValue)) { + typeOfInputValue = 'ARRAY'; + } else if (typeof _inputValue === 'object' && _inputValue !== null) { + typeOfInputValue = 'OBJECT'; + } else { + typeOfInputValue = null; + } + + if (typeGet === 'OBJECT') { + if (typeOfInputValue === 'OBJECT') return _inputValue; + if (typeOfInputValue === 'ARRAY') return _inputValue && _inputValue[0]; + } else if (typeGet === 'ARRAY') { + if (typeOfInputValue === 'OBJECT') return [{..._inputValue}]; + if (typeOfInputValue === 'ARRAY') return _inputValue; + } +} + +export { + parseDataQueryFormString, + parseDataQueryFormObject, + getValueStringWithKey, + getValueStringWithKeyAndColon, + getInputValue, + DEFAULT_QUERY_DROP, + COLLECTION_QUERY_DROP, + COLLECTION_PAGING_QUERY_DROP +} \ No newline at end of file