feat(web-admin): 项目组列表展示成员与负责医院 #47

Merged
cykj merged 1 commits from codex/issue-44-teams-list-cols-f6bbce737550 into V2.0 2026-11-05 06:39:08 +00:00
3 changed files with 30 additions and 2 deletions

No files matched your search

@@ -58,3 +58,11 @@ export function managementPayload(kind: 'teams' | 'projects', form: ProjectRecor
export function projectOptionsParams(bizType: BizType, filter = false) {
return filter ? { bizType, usage: 'filter' as const } : { bizType }
}
/** List cells join child display names; empty entries are dropped. */
export function joinChildNames(items?: ProjectRecord[]) {
return (items || [])
.map((item) => item?.name)
.filter(Boolean)
.join('、')
}
@@ -74,6 +74,16 @@
<el-table-column v-if="!isTeam" prop="projectNo" label="项目编号" min-width="160" />
<el-table-column v-if="!isTeam" prop="teamName" label="所属项目组" min-width="160" />
<el-table-column prop="leaderName" label="负责人" min-width="120" />
<el-table-column v-if="isTeam" label="成员" min-width="180" show-overflow-tooltip
><template #default="{ row }">{{
joinChildNames(row.members)
}}</template></el-table-column
>
<el-table-column v-if="isTeam" label="负责医院" min-width="200" show-overflow-tooltip
><template #default="{ row }">{{
joinChildNames(row.hospitals)
}}</template></el-table-column
>
<el-table-column label="状态" min-width="110"
><template #default="{ row }"
><el-tag
@@ -243,7 +253,7 @@
>
</template>
<script setup lang="ts">
import { managementPayload } from '@/utils/project-management'
import { joinChildNames, managementPayload } from '@/utils/project-management'
import { useMenuPerm } from '@/hooks/core/useMenuPerm'
import {
Plus,
+11 -1
View File
@@ -1,6 +1,10 @@
import assert from 'node:assert/strict'
import test from 'node:test'
import { buildDrillFilters, assignmentSnapshot } from '../src/utils/project-management'
import {
buildDrillFilters,
assignmentSnapshot,
joinChildNames
} from '../src/utils/project-management'
test('drill preserves applied dates and selected project when a team is opened', () => {
assert.deepEqual(
@@ -65,6 +69,12 @@ test('management payload excludes readonly response fields and preserves child I
)
})
test('joinChildNames joins display names and skips blanks', () => {
assert.equal(joinChildNames([{ name: '甲' }, { name: '' }, { name: '乙' }, {}]), '甲、乙')
assert.equal(joinChildNames([]), '')
assert.equal(joinChildNames(undefined), '')
})
test('filter options use visible historical scope; create and reassignment remain strict', async () => {
const { projectOptionsParams } = await import('../src/utils/project-management')
assert.deepEqual(projectOptionsParams('cell_storage', true), {