From 76e68544a64e8c015429616bdf4c5aa23c45d86b Mon Sep 17 00:00:00 2001 From: edana <1813750890@qq.com> Date: Tue, 25 Jun 2024 11:33:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- generated/core/OpenAPI.ts | 5 +- .../CourseResourceControllerService.ts | 2 +- .../courseResources/componse/resourceAdd.vue | 212 ++++++++---------- src/views/courseResources/index.vue | 38 ++-- 4 files changed, 122 insertions(+), 135 deletions(-) diff --git a/generated/core/OpenAPI.ts b/generated/core/OpenAPI.ts index 16c0ace..685abe2 100644 --- a/generated/core/OpenAPI.ts +++ b/generated/core/OpenAPI.ts @@ -21,7 +21,8 @@ export type OpenAPIConfig = { export const OpenAPI: OpenAPIConfig = { - BASE: 'http://39.106.16.162:8080', + //BASE: 'http://39.106.16.162:8080', + BASE: 'http://127.0.0.1:8080', VERSION: '1.0.0', WITH_CREDENTIALS: false, CREDENTIALS: 'include', @@ -33,7 +34,7 @@ export const OpenAPI: OpenAPIConfig = { }; // BASE: 'http://39.106.16.162:8080', -// BASE: 'http://127.0.0.1:8080/api', + // VERSION: '1.0.0', // WITH_CREDENTIALS: false, // CREDENTIALS: 'include', diff --git a/generated/services/CourseResourceControllerService.ts b/generated/services/CourseResourceControllerService.ts index ee146aa..697b0a8 100644 --- a/generated/services/CourseResourceControllerService.ts +++ b/generated/services/CourseResourceControllerService.ts @@ -85,7 +85,7 @@ export class CourseResourceControllerService { courseResources: CourseResources, ): CancelablePromise { return __request(OpenAPI, { - method: 'GET', + method: 'POST', url: '/api/courses/save', body: courseResources, errors: { diff --git a/src/views/courseResources/componse/resourceAdd.vue b/src/views/courseResources/componse/resourceAdd.vue index 44204c9..c2e4b2a 100644 --- a/src/views/courseResources/componse/resourceAdd.vue +++ b/src/views/courseResources/componse/resourceAdd.vue @@ -1,69 +1,53 @@ diff --git a/src/views/courseResources/index.vue b/src/views/courseResources/index.vue index 5396e29..66f7d52 100644 --- a/src/views/courseResources/index.vue +++ b/src/views/courseResources/index.vue @@ -19,8 +19,8 @@ const total = ref(0) const pptresourceList = ref([]) const loading = ref(false) const params = ref({ - // pagesize: '10', - // pagenum: '1', + pagesize: '10', + pagenum: '1', type: '1', //设置默认显示ppt类型 }) @@ -85,7 +85,7 @@ const param = ref({ download: '0', content: '', address: '/portal', - type: '4', + type: '1', }) //点击生成浏览记录 const generateRecords = async (rescource) => { @@ -95,20 +95,32 @@ const generateRecords = async (rescource) => { // console.log(param) } -const resourceAddRef = ref() -//添加资源 +const rescourceRef = ref() +//添加 const onAddResource = () => { - resourceAddRef.value.open({}) + rescourceRef.value.open({}) } -//编辑资源 const onEditResource = (row) => { - resourceAddRef.value.open(row) + rescourceRef.value.open(row) +} +//添加或者编辑的回调 +const onsuccess = (state) => { + if (state == 'add') { + // 添加 渲染最后一页 + const lastPage = Math.ceil((total.value + 1) / params.value.pagesize) + //更新成最大页码数 + params.value.pagenum = lastPage + getpptresourceList() + } else { + //编辑 渲染当前页面 + getpptresourceList() + } }