diff --git a/.env.development b/.env.development index 3c85e65..4c857ef 100644 --- a/.env.development +++ b/.env.development @@ -5,5 +5,5 @@ VITE_API_URL=https://cms-api.websoft.top/api #VITE_SOCKET_URL=ws://127.0.0.1:9191 #VITE_SERVER_URL=http://127.0.0.1:8000/api -#VITE_API_URL=http://127.0.0.1:9000/api +VITE_API_URL=http://127.0.0.1:9200/api #/booking/bookingItem diff --git a/dist.zip b/dist.zip new file mode 100644 index 0000000..62483ad Binary files /dev/null and b/dist.zip differ diff --git a/src/api/pwl/pwlProjectLibrary/index.ts b/src/api/pwl/pwlProjectLibrary/index.ts new file mode 100644 index 0000000..149638f --- /dev/null +++ b/src/api/pwl/pwlProjectLibrary/index.ts @@ -0,0 +1,106 @@ +import request from '@/utils/request'; +import type { ApiResult, PageResult } from '@/api'; +import type { PwlProjectLibrary, PwlProjectLibraryParam } from './model'; +import { MODULES_API_URL } from '@/config/setting'; + +/** + * 分页查询材料库资料库表 + */ +export async function pagePwlProjectLibrary(params: PwlProjectLibraryParam) { + const res = await request.get>>( + MODULES_API_URL + '/pwl/pwl-project-library/page', + { + params + } + ); + if (res.data.code === 0) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 查询材料库资料库表列表 + */ +export async function listPwlProjectLibrary(params?: PwlProjectLibraryParam) { + const res = await request.get>( + MODULES_API_URL + '/pwl/pwl-project-library', + { + params + } + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 添加材料库资料库表 + */ +export async function addPwlProjectLibrary(data: PwlProjectLibrary) { + const res = await request.post>( + MODULES_API_URL + '/pwl/pwl-project-library', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 修改材料库资料库表 + */ +export async function updatePwlProjectLibrary(data: PwlProjectLibrary) { + const res = await request.put>( + MODULES_API_URL + '/pwl/pwl-project-library', + data + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 删除材料库资料库表 + */ +export async function removePwlProjectLibrary(id?: number) { + const res = await request.delete>( + MODULES_API_URL + '/pwl/pwl-project-library/' + id + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 批量删除材料库资料库表 + */ +export async function removeBatchPwlProjectLibrary(data: (number | undefined)[]) { + const res = await request.delete>( + MODULES_API_URL + '/pwl/pwl-project-library/batch', + { + data + } + ); + if (res.data.code === 0) { + return res.data.message; + } + return Promise.reject(new Error(res.data.message)); +} + +/** + * 根据id查询材料库资料库表 + */ +export async function getPwlProjectLibrary(id: number) { + const res = await request.get>( + MODULES_API_URL + '/pwl/pwl-project-library/' + id + ); + if (res.data.code === 0 && res.data.data) { + return res.data.data; + } + return Promise.reject(new Error(res.data.message)); +} diff --git a/src/api/pwl/pwlProjectLibrary/model/index.ts b/src/api/pwl/pwlProjectLibrary/model/index.ts new file mode 100644 index 0000000..19092ac --- /dev/null +++ b/src/api/pwl/pwlProjectLibrary/model/index.ts @@ -0,0 +1,47 @@ +import type { PageParam } from '@/api'; + +/** + * 材料库资料库表 + */ +export interface PwlProjectLibrary { + // ID + id?: number; + // 资料库名称 + name?: string; + // 资料库类型: biz-项目案例库, pub-公共知识库 + type?: string; + // 关联知识库ID + kbId?: string; + // 排序(数字越小越靠前) + sort?: number; + // 资料库图标 + image?: string; + // 资料库描述 + content?: string; + // 关联文件 + files?: string; + // 备注 + comments?: string; + // 是否推荐 + recommend?: number; + // 状态, 0正常, 1冻结 + status?: number; + // 是否删除, 0否, 1是 + deleted?: number; + // 创建用户ID + userId?: number; + // 租户id + tenantId?: number; + // 创建时间 + createTime?: string; + // 修改时间 + updateTime?: string; +} + +/** + * 材料库资料库表搜索条件 + */ +export interface PwlProjectLibraryParam extends PageParam { + id?: number; + keywords?: string; +} diff --git a/src/components/SelectDocsBook/components/select-data.vue b/src/components/SelectDocsBook/components/select-data.vue index 094c2f7..6cf0255 100644 --- a/src/components/SelectDocsBook/components/select-data.vue +++ b/src/components/SelectDocsBook/components/select-data.vue @@ -22,8 +22,8 @@ v-model:value="searchText" placeholder="请输入搜索关键词" style="width: 200px" - @search="reload" - @pressEnter="reload" + @search="() => reload()" + @pressEnter="() => reload()" />