diff --git a/src/api/xixi-inspection-story.js b/src/api/xixi-inspection-story.js new file mode 100644 index 0000000..e95a09a --- /dev/null +++ b/src/api/xixi-inspection-story.js @@ -0,0 +1,76 @@ +import request from '@/utils/request' + +/** + * 恋爱检查项子表 love_check_item_child + * LoveCheckItemChildController:@RequestMapping("/api/loveCheckItemChild") + * 本项目的 axios baseURL 为 /api,故此处 url 使用 /loveCheckItemChild/...(最终请求 /api/loveCheckItemChild/...) + * + * 若 Spring 已配置 server.servlet.context-path=/api,且类上仍为 @RequestMapping("/api/loveCheckItemChild"), + * 实际路径可能为 /api/api/loveCheckItemChild/...,可设环境变量:VUE_APP_LOVE_CHECK_ITEM_CHILD_SEGMENT=api/loveCheckItemChild(无首尾斜杠) + */ +function lcChildUrl(action) { + const seg = (process.env.VUE_APP_LOVE_CHECK_ITEM_CHILD_SEGMENT || 'loveCheckItemChild').replace(/^\/+|\/+$/g, '') + return seg.startsWith('api/') ? `${seg}/${action}` : `/${seg}/${action}` +} + +/** GET /list:current、size、parentId、projectName、scenario、createStartTime、createEndTime、updateStartTime、updateEndTime */ +export function fetchInspectionStoryList(params) { + return request({ + url: lcChildUrl('list'), + method: 'get', + params: { + current: params.page || 1, + size: params.limit || 10, + parentId: params.parentId, + projectName: params.projectName, + scenario: params.scenario, + createStartTime: params.createStartTime, + createEndTime: params.createEndTime, + updateStartTime: params.updateStartTime, + updateEndTime: params.updateEndTime + } + }) +} + +/** GET /get/{id} */ +export function getInspectionStoryById(id) { + return request({ + url: lcChildUrl(`get/${id}`), + method: 'get' + }) +} + +/** POST /add */ +export function addInspectionStory(data) { + return request({ + url: lcChildUrl('add'), + method: 'post', + data + }) +} + +/** PUT /update */ +export function updateInspectionStory(data) { + return request({ + url: lcChildUrl('update'), + method: 'put', + data + }) +} + +/** DELETE /delete/{id} */ +export function deleteInspectionStory(id) { + return request({ + url: lcChildUrl(`delete/${id}`), + method: 'delete' + }) +} + +/** DELETE /batchDelete,请求体为 id 字符串列表 */ +export function batchDeleteInspectionStory(ids) { + return request({ + url: lcChildUrl('batchDelete'), + method: 'delete', + data: ids + }) +} diff --git a/src/views/xixi-love/inspection-story.vue b/src/views/xixi-love/inspection-story.vue index 44fc3b5..28b723d 100644 --- a/src/views/xixi-love/inspection-story.vue +++ b/src/views/xixi-love/inspection-story.vue @@ -1,20 +1,466 @@ diff --git a/src/views/xixi-love/inspection.vue b/src/views/xixi-love/inspection.vue index b7652e2..7eeb841 100644 --- a/src/views/xixi-love/inspection.vue +++ b/src/views/xixi-love/inspection.vue @@ -105,8 +105,11 @@ {{ formatDateTime(row.updateTime) }} - +