From 13b0c103c40d112f7a7bcfc1e44b4f85900614e1 Mon Sep 17 00:00:00 2001 From: b2894lxlx <517289602@qq.com> Date: Thu, 30 Apr 2026 22:37:39 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=8D=95=E4=BD=8D=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BD=92=E5=B1=9E=E5=8D=95=E4=BD=8D=E3=80=81?= =?UTF-8?q?=E5=8D=95=E4=BD=8D=E7=BC=96=E5=8F=B7=202=E3=80=81=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E7=AE=A1=E7=90=86=E6=96=B0=E5=A2=9E=E6=90=9C=E7=B4=A2?= =?UTF-8?q?=E3=80=81=E6=96=87=E4=BB=B6=E5=9C=A8=E7=BA=BF=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/ai/aiCloudFile/model/index.ts | 3 +- src/api/oa/oaCompany/model/index.ts | 4 + .../oa/oaCompany/components/oaCompanyEdit.vue | 291 +-- src/views/oa/oaCompany/index.vue | 1602 +++++++++-------- 4 files changed, 992 insertions(+), 908 deletions(-) diff --git a/src/api/ai/aiCloudFile/model/index.ts b/src/api/ai/aiCloudFile/model/index.ts index f3d3a2c..00a1ae3 100644 --- a/src/api/ai/aiCloudFile/model/index.ts +++ b/src/api/ai/aiCloudFile/model/index.ts @@ -47,6 +47,7 @@ export interface AiCloudFileParam extends PageParam { id?: number; keywords?: string; docId?: number; + fileName?: string; workspaceId?: number; fileType?: string; -} \ No newline at end of file +} diff --git a/src/api/oa/oaCompany/model/index.ts b/src/api/oa/oaCompany/model/index.ts index 613ba58..9f56876 100644 --- a/src/api/oa/oaCompany/model/index.ts +++ b/src/api/oa/oaCompany/model/index.ts @@ -10,6 +10,10 @@ export interface OaCompany { shortName?: string; // 企业全称 companyName?: string; + // 归属单位 + parentCompany?: string; + // 单位编号 + companyNo?: string; // 企业标识 companyCode?: string; // 类型 10企业 20政府单位 diff --git a/src/views/oa/oaCompany/components/oaCompanyEdit.vue b/src/views/oa/oaCompany/components/oaCompanyEdit.vue index 0c4da3a..ee613c1 100644 --- a/src/views/oa/oaCompany/components/oaCompanyEdit.vue +++ b/src/views/oa/oaCompany/components/oaCompanyEdit.vue @@ -35,6 +35,13 @@ v-model:value="form.companyName" /> + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + { - return listPwlProjectLibrary().then(res => { + return listPwlProjectLibrary().then((res) => { allLibraries.value = res; // 过滤行业库 (type='biz') bizLibList.value = res - .filter(item => item.type === 'biz') - .map(item => ({ - label: item.name, - value: String(item.id) // 将 ID 转换为字符串 - })); + .filter((item) => item.type === 'biz') + .map((item) => ({ + label: item.name, + value: String(item.id) // 将 ID 转换为字符串 + })); // 过滤公共库 (type='pub') pubLibList.value = res - .filter(item => item.type === 'pub') - .map(item => ({ - label: item.name, - value: String(item.id) // 将 ID 转换为字符串 - })); + .filter((item) => item.type === 'pub') + .map((item) => ({ + label: item.name, + value: String(item.id) // 将 ID 转换为字符串 + })); return res; }); @@ -411,12 +426,13 @@ const allLibraryIds = [ ...(form.bizLibIds || []), ...(form.pubLibIds || []) - ] + ]; const formData = { ...form, - libraryIds: allLibraryIds.join(','), // 保存为逗号分隔的字符串 + libraryIds: allLibraryIds.join(',') // 保存为逗号分隔的字符串 }; + if (!formData.parentCompany) formData.parentCompany = '本单位'; const saveOrUpdate = isUpdate.value ? updateOaCompany : addOaCompany; saveOrUpdate(formData) .then((msg) => { @@ -438,24 +454,30 @@ if (props.data?.libraryIds) { // 如果是字符串,按逗号分割成数组 if (typeof props.data.libraryIds === 'string') { - const libraryIdsArray = props.data.libraryIds.split(',').filter(id => id.trim() !== ''); + const libraryIdsArray = props.data.libraryIds + .split(',') + .filter((id) => id.trim() !== ''); // 清空当前的选择 form.bizLibIds = []; form.pubLibIds = []; // 根据资料库类型分别设置回显 - libraryIdsArray.forEach(id => { + libraryIdsArray.forEach((id) => { // 检查是否在行业库列表中 - const isBizLib = bizLibList.value.some(lib => lib.value === String(id)); // 转换为字符串比较 + const isBizLib = bizLibList.value.some( + (lib) => lib.value === String(id) + ); // 转换为字符串比较 // 检查是否在公共库列表中 - const isPubLib = pubLibList.value.some(lib => lib.value === String(id)); // 转换为字符串比较 + const isPubLib = pubLibList.value.some( + (lib) => lib.value === String(id) + ); // 转换为字符串比较 if (isBizLib) { - form.bizLibIds.push(String(id)); // 确保存储为字符串 + form.bizLibIds.push(String(id)); // 确保存储为字符串 } if (isPubLib) { - form.pubLibIds.push(String(id)); // 确保存储为字符串 + form.pubLibIds.push(String(id)); // 确保存储为字符串 } }); } else { @@ -463,9 +485,13 @@ form.bizLibIds = []; form.pubLibIds = []; - props.data.libraryIds.forEach(id => { - const isBizLib = bizLibList.value.some(lib => lib.value === String(id)); - const isPubLib = pubLibList.value.some(lib => lib.value === String(id)); + props.data.libraryIds.forEach((id) => { + const isBizLib = bizLibList.value.some( + (lib) => lib.value === String(id) + ); + const isPubLib = pubLibList.value.some( + (lib) => lib.value === String(id) + ); if (isBizLib) { form.bizLibIds.push(String(id)); @@ -483,21 +509,20 @@ watch( () => props.visible, - async (visible) => { + async (visible) => { if (visible) { - // 等待资料库列表加载完成后再设置回显 await fetchLibraries(); images.value = []; if (props.data) { assignObject(form, props.data); - if(props.data.companyLogo){ + if (props.data.companyLogo) { images.value.push({ uid: uuid(), url: props.data.companyLogo, status: 'done' - }) + }); } // 设置资料库回显 diff --git a/src/views/oa/oaCompany/index.vue b/src/views/oa/oaCompany/index.vue index 67f16c0..0bd6696 100644 --- a/src/views/oa/oaCompany/index.vue +++ b/src/views/oa/oaCompany/index.vue @@ -10,29 +10,29 @@