add 批次管理界面

This commit is contained in:
Asoka.Wang 2025-06-20 17:19:08 +08:00
parent a4148ff5b2
commit 12cfa91c6f
7 changed files with 217 additions and 56 deletions

View File

@ -5583,6 +5583,8 @@ export interface UserAddInput {
orgId?: number
/** 密码 */
password?: string | null
/** 团队 */
team?: number
/** 启用 */
enabled?: boolean
@ -6104,6 +6106,10 @@ export interface UserUpdateInput {
* @minLength 1
*/
userName: string
/** 团队 */
team?: number
/**
*
* @minLength 1

View File

@ -25,6 +25,12 @@ export const Sex = {
Female: { name: 'Female', value: 2, desc: '女' },
}
export const Team = {
All: { name: '全部', value: 5, desc: '全部' },
USP: { name: '上游', value: 1, desc: '上游' },
DSP: { name: '下游', value: 3, desc: '下游' },
}
/** 角色类型 */
export const RoleType = {
Group: { name: 'Group', value: 1, desc: '分组' },

View File

@ -28,6 +28,8 @@ export interface PreBatchPageDto {
preBatchNo: string
/** 项目ID */
projectId?: number | null
/** 项目负责人 */
projectUserName?: string
/** 创建用户真实姓名 */
createdUserRealName?: string
/** 创建时间 */
@ -50,6 +52,8 @@ export interface PreBatchDto {
isDown?: boolean | null
/** 滴度 */
titer?: number | null
projectUserName?: string
}
export type PreBatchPageInput = ServiceRequestPage<PreBatchFilter>

View File

@ -66,28 +66,31 @@
{{ getProjectName(row.projectId) }}
</template>
</el-table-column>
<el-table-column prop="projectUserName" label="项目负责人" min-width="100" show-overflow-tooltip />
<el-table-column prop="createdUserRealName" label="创建者" min-width="100" show-overflow-tooltip />
<el-table-column prop="createdTime" label="创建时间" min-width="160" show-overflow-tooltip />
<el-table-column label="操作" width="200" fixed="right" header-align="center" align="center">
<template #default="{ row }">
<el-button
v-if="auth('api:admin:pre-batch:update')"
icon="ele-EditPen"
size="small"
text
type="primary"
@click="onEdit(row)"
>编辑</el-button
>
<el-button
v-if="auth('api:admin:pre-batch:soft-delete')"
icon="ele-Delete"
size="small"
text
type="danger"
@click="onDelete(row)"
>删除</el-button
>
<div class="action-buttons">
<el-button
v-if="auth('api:admin:pre-batch:update')"
icon="ele-EditPen"
size="small"
text
type="primary"
@click="onEdit(row)"
>编辑</el-button
>
<el-button
v-if="auth('api:admin:pre-batch:soft-delete')"
icon="ele-Delete"
size="small"
text
type="danger"
@click="onDelete(row)"
>删除</el-button
>
</div>
</template>
</el-table-column>
</el-table>
@ -238,19 +241,33 @@ const getProjectName = (projectId: number) => {
<style lang="scss" scoped>
.my-query-box {
margin-top: 8px;
:deep(.el-form-item) {
margin-bottom: 16px;
}
:deep(.el-form--inline .el-form-item) {
margin-right: 16px;
}
}
.my-fill {
flex: 1;
display: flex;
flex-direction: column;
:deep(.el-card__body) {
padding: 20px;
height: 100%;
display: flex;
flex-direction: column;
}
}
.my-flex {
display: flex;
align-items: center;
}
.my-flex-between {
@ -268,4 +285,60 @@ const getProjectName = (projectId: number) => {
.mb8 {
margin-bottom: 8px;
}
//
:deep(.el-table) {
.el-table__header-wrapper {
th {
background-color: #fafafa;
color: #606266;
font-weight: 500;
}
}
.el-table__body-wrapper {
.el-table__row {
&:hover {
background-color: #f5f7fa;
}
}
}
}
//
:deep(.el-pagination) {
display: flex;
justify-content: flex-end;
margin-top: 16px;
.el-pager li.is-active {
background-color: var(--el-color-primary);
color: white;
}
}
//
.action-buttons {
display: flex;
gap: 8px;
.el-button {
margin-left: 0;
}
}
//
.status-tag {
&.enabled {
background-color: #f0f9ff;
color: #1890ff;
border: 1px solid #d4edda;
}
&.disabled {
background-color: #fff2f0;
color: #ff4d4f;
border: 1px solid #ffccc7;
}
}
</style>

View File

@ -113,11 +113,12 @@
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="职位">
<el-input v-model="form.staff.position" autocomplete="off" />
<el-form-item label="团队">
<el-select v-model="form.team" placeholder="请选择团队" class="w100">
<el-option v-for="item in state.teamList" :key="item.label" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="性别">
<el-select v-model="form.staff.sex" placeholder="请选择性别" class="w100">
@ -158,7 +159,7 @@ import { validatorPwd } from '/@/utils/validators'
import eventBus from '/@/utils/mitt'
import { FormInstance } from 'element-plus'
import { verifyCnAndSpace } from '/@/utils/toolsValidate'
import { Sex } from '/@/api/admin/enum-contracts'
import { Sex, Team } from '/@/api/admin/enum-contracts'
import { toOptionsByValue } from '/@/utils/enum'
//
@ -186,6 +187,7 @@ const state = reactive({
orgTreeData: [] as OrgGetListOutput[],
roleTreeData: [] as RoleGetListOutput[],
sexList: toOptionsByValue(Sex),
teamList: toOptionsByValue(Team),
})
const { form } = toRefs(state)

View File

@ -64,8 +64,10 @@
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
<el-form-item label="职位">
<el-input v-model="form.staff.position" autocomplete="off" />
<el-form-item label="团队">
<el-select v-model="form.team" placeholder="请选择团队" class="w100">
<el-option v-for="item in state.teamList" :key="item.label" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
</el-col>
<el-col :xs="24" :sm="12" :md="12" :lg="12" :xl="12">
@ -104,7 +106,7 @@ import { listToTree } from '/@/utils/tree'
import { isMobile, testMobile, testEmail } from '/@/utils/test'
import eventBus from '/@/utils/mitt'
import { FormInstance } from 'element-plus'
import { Sex } from '/@/api/admin/enum-contracts'
import { Sex, Team } from '/@/api/admin/enum-contracts'
import { toOptionsByValue } from '/@/utils/enum'
//
@ -125,9 +127,11 @@ const state = reactive({
sureLoading: false,
form: {
roleIds: [] as any,
team: 5,
} as UserAddInput & UserUpdateInput,
roleTreeData: [] as RoleGetListOutput[],
sexList: toOptionsByValue(Sex),
teamList: toOptionsByValue(Team),
})
const { form } = toRefs(state)

View File

@ -44,8 +44,7 @@
</el-form-item>
<el-form-item>
<el-button type="primary" icon="ele-Search" @click="onQuery">查询</el-button>
<el-button icon="ele-Refresh" @click="onReset">重置</el-button>
<el-button v-auth="'api:admin:uspbatch:add'" type="primary" icon="ele-Plus" @click="onAdd">新增</el-button>
<el-button v-auth="'api:admin:pre-batch:add'" type="primary" icon="ele-Plus" @click="onAdd">新增</el-button>
</el-form-item>
</el-form>
</el-card>
@ -58,20 +57,15 @@
row-key="id"
border
>
<el-table-column prop="uspBatchName" label="USP批次名称" min-width="150" show-overflow-tooltip />
<el-table-column prop="uspBatchNo" label="USP批次编号" min-width="120" show-overflow-tooltip />
<el-table-column prop="preBatchName" label="批次名称" min-width="150" show-overflow-tooltip />
<el-table-column prop="preBatchNo" label="批次编号" min-width="120" show-overflow-tooltip />
<el-table-column prop="projectId" label="项目" min-width="120" show-overflow-tooltip>
<template #default="{ row }">
{{ getProjectName(row.projectId) }}
</template>
</el-table-column>
<el-table-column prop="isDown" label="是否下游" width="100" align="center">
<template #default="{ row }">
<el-tag v-if="row.isDown" type="success"></el-tag>
<el-tag v-else type="info"></el-tag>
</template>
</el-table-column>
<el-table-column prop="titer" label="滴度" min-width="100" align="center" show-overflow-tooltip>
<el-table-column prop="projectUserName" label="项目负责人" min-width="100" show-overflow-tooltip />
<el-table-column prop="titer" label="titer" min-width="100" align="center" show-overflow-tooltip>
<template #default="{ row }">
{{ row.titer || '-' }}
</template>
@ -80,24 +74,26 @@
<el-table-column prop="createdTime" label="创建时间" min-width="160" show-overflow-tooltip />
<el-table-column label="操作" width="200" fixed="right" header-align="center" align="center">
<template #default="{ row }">
<el-button
v-if="auth('api:admin:uspbatch:update')"
icon="ele-EditPen"
size="small"
text
type="primary"
@click="onEdit(row)"
>编辑</el-button
>
<el-button
v-if="auth('api:admin:uspbatch:soft-delete')"
icon="ele-Delete"
size="small"
text
type="danger"
@click="onDelete(row)"
>删除</el-button
>
<div class="action-buttons">
<el-button
v-if="auth('api:admin:pre-batch:update')"
icon="ele-EditPen"
size="small"
text
type="primary"
@click="onEdit(row)"
>编辑</el-button
>
<el-button
v-if="auth('api:admin:pre-batch:soft-delete')"
icon="ele-Delete"
size="small"
text
type="danger"
@click="onDelete(row)"
>删除</el-button
>
</div>
</template>
</el-table-column>
</el-table>
@ -117,7 +113,7 @@
</div>
</el-card>
<uspbatch-form ref="uspBatchFormRef" :title="state.formTitle" @ok="Query" />
<UspbatchForm ref="uspBatchFormRef" :title="state.formTitle" @ok="Query" />
</MyLayout>
</template>
@ -129,7 +125,7 @@ import type { UspBatchDto, UspBatchPageInput, UspBatchPageDto } from '/@/api/typ
import { auth } from '/@/utils/authFunction'
//
const UspBatchForm = defineAsyncComponent(() => import('./components/uspbatch-form.vue'))
const UspbatchForm = defineAsyncComponent(() => import('./components/uspbatch-form.vue'))
const { proxy } = getCurrentInstance() as any
@ -248,19 +244,33 @@ const getProjectName = (projectId: number) => {
<style lang="scss" scoped>
.my-query-box {
margin-bottom: 8px;
:deep(.el-form-item) {
margin-bottom: 16px;
}
:deep(.el-form--inline .el-form-item) {
margin-right: 16px;
}
}
.my-fill {
flex: 1;
display: flex;
flex-direction: column;
:deep(.el-card__body) {
padding: 20px;
height: 100%;
display: flex;
flex-direction: column;
}
}
.my-flex {
display: flex;
align-items: center;
}
.my-flex-between {
@ -278,4 +288,60 @@ const getProjectName = (projectId: number) => {
.mb8 {
margin-bottom: 8px;
}
//
:deep(.el-table) {
.el-table__header-wrapper {
th {
background-color: #fafafa;
color: #606266;
font-weight: 500;
}
}
.el-table__body-wrapper {
.el-table__row {
&:hover {
background-color: #f5f7fa;
}
}
}
}
//
:deep(.el-pagination) {
display: flex;
justify-content: flex-end;
margin-top: 16px;
.el-pager li.is-active {
background-color: var(--el-color-primary);
color: white;
}
}
//
.action-buttons {
display: flex;
gap: 8px;
.el-button {
margin-left: 0;
}
}
//
.status-tag {
&.enabled {
background-color: #f0f9ff;
color: #1890ff;
border: 1px solid #d4edda;
}
&.disabled {
background-color: #fff2f0;
color: #ff4d4f;
border: 1px solid #ffccc7;
}
}
</style>