diff --git a/frontend/components.d.ts b/frontend/components.d.ts index 003854e..b81887b 100644 --- a/frontend/components.d.ts +++ b/frontend/components.d.ts @@ -12,10 +12,14 @@ export {} declare module 'vue' { export interface GlobalComponents { ElAvatar: typeof import('element-plus/es')['ElAvatar'] + ElBreadcrumb: typeof import('element-plus/es')['ElBreadcrumb'] + ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem'] ElButton: typeof import('element-plus/es')['ElButton'] + ElDivider: typeof import('element-plus/es')['ElDivider'] ElDropdown: typeof import('element-plus/es')['ElDropdown'] ElDropdownItem: typeof import('element-plus/es')['ElDropdownItem'] ElDropdownMenu: typeof import('element-plus/es')['ElDropdownMenu'] + ElEmpty: typeof import('element-plus/es')['ElEmpty'] ElIcon: typeof import('element-plus/es')['ElIcon'] ElInput: typeof import('element-plus/es')['ElInput'] ElPagination: typeof import('element-plus/es')['ElPagination'] diff --git a/frontend/frontend/.env.development b/frontend/frontend/.env.development deleted file mode 100644 index ccfa5cc..0000000 --- a/frontend/frontend/.env.development +++ /dev/null @@ -1,7 +0,0 @@ -# 寮€鍙戠幆澧冮厤缃?# API 鍩虹鍦板潃 -VITE_API_DOMAIN=http://localhost:8000 - -# 寮€鍙戠幆澧冩爣璇?NODE_ENV=development - -# 璋冭瘯妯″紡 -VITE_DEBUG=true diff --git a/frontend/frontend/frontend/.env.production b/frontend/frontend/frontend/.env.production deleted file mode 100644 index 8d32a9e..0000000 --- a/frontend/frontend/frontend/.env.production +++ /dev/null @@ -1,9 +0,0 @@ -# 鐢熶骇鐜閰嶇疆 -# API 鍩虹鍦板潃 -VITE_API_DOMAIN=https://api.yourdomain.com - -# 鐢熶骇鐜鏍囪瘑 -NODE_ENV=production - -# 璋冭瘯妯″紡 -VITE_DEBUG=false diff --git a/frontend/src/api/downloadGames.ts b/frontend/src/api/downloadGames.ts index 70ff86f..c6450fa 100644 --- a/frontend/src/api/downloadGames.ts +++ b/frontend/src/api/downloadGames.ts @@ -18,4 +18,22 @@ export class downloadGames { static async getDownloadGamesLists(cateid: string) { return request("/index/program/getDownloadGamesLists", { cateid }, "get"); } + + /** + * @description 获取downloadGames文章列表 + * @param {string} cateid - 分类ID + * @return {Promise} 返回请求结果 + */ + static async getDownloadGamesSimpleLists(cateid: string) { + return request("/index/program/getDownloadGamesSimpleLists", { cateid }, "get"); + } + + /** + * @description 获取downloadGames文章详情 + * @param {string} id - 内容ID + * @return {Promise} 返回请求结果 + */ + static async getDownloadGamesDetail(id: string) { + return request("/index/program/getDownloadGamesDetail", { id }, "get"); + } } \ No newline at end of file diff --git a/frontend/src/api/downloadPrograms.ts b/frontend/src/api/downloadPrograms.ts index 4861b31..91e7f55 100644 --- a/frontend/src/api/downloadPrograms.ts +++ b/frontend/src/api/downloadPrograms.ts @@ -16,6 +16,32 @@ export class downloadPrograms { * @return {Promise} 返回请求结果 */ static async getDownloadProgramsLists(cateid: string) { - return request("/index/program/getDownloadProgramsLists", { cateid }, "get"); + return request( + "/index/program/getDownloadProgramsLists", + { cateid }, + "get" + ); } -} \ No newline at end of file + + /** + * @description 获取downloadPrograms文章列表 + * @param {string} cateid - 分类ID + * @return {Promise} 返回请求结果 + */ + static async getDownloadProgramsSimpleLists(cateid: string) { + return request( + "/index/program/getDownloadProgramsSimpleLists", + { cateid }, + "get" + ); + } + + /** + * @description 获取downloadPrograms文章详情 + * @param {string} id - 内容ID + * @return {Promise} 返回请求结果 + */ + static async getDownloadProgramsDetail(id: string) { + return request("/index/program/getDownloadProgramsDetail", { id }, "get"); + } +} diff --git a/frontend/src/api/officeResources.ts b/frontend/src/api/officeResources.ts index 9a68cd6..cbed7ce 100644 --- a/frontend/src/api/officeResources.ts +++ b/frontend/src/api/officeResources.ts @@ -18,4 +18,26 @@ export class officeResources { static async getOfficeResourcesLists(cateid: string) { return request("/index/program/getOfficeResourcesLists", { cateid }, "get"); } -} \ No newline at end of file + + /** + * @description 获取officeResources文章列表 + * @param {string} cateid - 分类ID + * @return {Promise} 返回请求结果 + */ + static async getOfficeResourcesSimpleLists(cateid: string) { + return request( + "/index/program/getOfficeResourcesSimpleLists", + { cateid }, + "get" + ); + } + + /** + * @description 获取officeResources文章详情 + * @param {string} id - 内容ID + * @return {Promise} 返回请求结果 + */ + static async getOfficeResourcesDetail(id: string) { + return request("/index/program/getOfficeResourcesDetail", { id }, "get"); + } +} diff --git a/frontend/src/main.ts b/frontend/src/main.ts index 7e7836a..d8e8316 100644 --- a/frontend/src/main.ts +++ b/frontend/src/main.ts @@ -1,4 +1,6 @@ import { createApp } from "vue"; +import ElementPlus from 'element-plus' +import 'element-plus/dist/index.css' import "@/assets/less/global.less"; import "@/assets/css/all.css" import App from "./App.vue"; @@ -7,4 +9,4 @@ import { createPinia } from 'pinia' const pinia = createPinia() -createApp(App).use(router).use(pinia).mount("#app"); +createApp(App).use(router).use(pinia).use(ElementPlus).mount("#app"); diff --git a/frontend/src/router/index.ts b/frontend/src/router/index.ts index f138f64..cf238a9 100644 --- a/frontend/src/router/index.ts +++ b/frontend/src/router/index.ts @@ -32,6 +32,11 @@ const router = createRouter({ name: "downloadPrograms", component: () => import("@/views/downloadPrograms/index.vue"), }, + { + path: "/downloadPrograms/:id", + name: "downloadProgramsDetail", + component: () => import("@/views/downloadPrograms/detail.vue"), + }, { path: "/downloadGames", name: "downloadGames", diff --git a/frontend/src/views/downloadGames/index.vue b/frontend/src/views/downloadGames/index.vue index 5da2ffb..d388b5c 100644 --- a/frontend/src/views/downloadGames/index.vue +++ b/frontend/src/views/downloadGames/index.vue @@ -131,10 +131,10 @@ const fetchCategories = async () => { }; // 获取文章列表 -const fetchResources = async (_page: number = currentPage.value) => { +const fetchResources = async (page: number = currentPage.value) => { loading.value = true; try { - const response: any = await downloadGames.getDownloadGamesLists( + const response: any = await downloadGames.getDownloadGamesSimpleLists( selectedCategory.value ); diff --git a/frontend/src/views/downloadPrograms/detail.vue b/frontend/src/views/downloadPrograms/detail.vue new file mode 100644 index 0000000..cabc16b --- /dev/null +++ b/frontend/src/views/downloadPrograms/detail.vue @@ -0,0 +1,428 @@ + + + + + diff --git a/frontend/src/views/downloadPrograms/index.vue b/frontend/src/views/downloadPrograms/index.vue index 5487cbf..ddeacbe 100644 --- a/frontend/src/views/downloadPrograms/index.vue +++ b/frontend/src/views/downloadPrograms/index.vue @@ -40,7 +40,7 @@

{{ resource.title }}

@@ -131,10 +131,10 @@ const fetchCategories = async () => { }; // 获取文章列表 -const fetchResources = async (_page: number = currentPage.value) => { +const fetchResources = async (page: number = currentPage.value) => { loading.value = true; try { - const response: any = await downloadPrograms.getDownloadProgramsLists( + const response: any = await downloadPrograms.getDownloadProgramsSimpleLists( selectedCategory.value ); diff --git a/frontend/src/views/officeResources/index.vue b/frontend/src/views/officeResources/index.vue index a67e6f1..d351455 100644 --- a/frontend/src/views/officeResources/index.vue +++ b/frontend/src/views/officeResources/index.vue @@ -131,10 +131,10 @@ const fetchCategories = async () => { }; // 获取文章列表 -const fetchResources = async (_page: number = currentPage.value) => { +const fetchResources = async (page: number = currentPage.value) => { loading.value = true; try { - const response: any = await officeResources.getOfficeResourcesLists( + const response: any = await officeResources.getOfficeResourcesSimpleLists( selectedCategory.value ); diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index ddb363a..d2e96b2 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -29,6 +29,9 @@ export default defineConfig({ }, css: { preprocessorOptions: { + less: { + // Less options + }, scss: { additionalData: '@import "./src/assets/scss/main.scss";', },