| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982 |
- <template>
- <div class="wb-page pack-page">
- <section class="pack-panel">
- <header class="pack-panel__head">
- <div class="pack-panel__heading">
- <div class="pack-panel__title-row">
- <h3 class="pack-panel__title">场景包</h3>
- <a-tooltip :title="packPanelTip" placement="bottomLeft" :overlay-style="{ maxWidth: '460px' }">
- <Icon icon="i-mdi:information-outline" class="pack-panel__tip" tabindex="0" />
- </a-tooltip>
- <span class="pack-panel__count">共 {{ packList.length }} 个</span>
- </div>
- </div>
- <div class="pack-panel__tools">
- <a-input
- v-model:value="queryParams.keyword"
- class="pack-search"
- placeholder="搜索场景包名称"
- allow-clear
- @press-enter="handleQuery"
- >
- <template #prefix>
- <Icon icon="i-mdi:magnify" class="pack-search__icon" />
- </template>
- </a-input>
- <a-select v-model:value="queryParams.status" class="pack-status-select" placeholder="全部状态" allow-clear>
- <a-select-option value="0">启用</a-select-option>
- <a-select-option value="1">停用</a-select-option>
- </a-select>
- <a-button type="primary" @click="handleQuery">查询</a-button>
- <a-button @click="resetQuery">重置</a-button>
- <a-button type="primary" @click="handleAdd"> 新增 </a-button>
- </div>
- </header>
- <div class="pack-panel__body">
- <a-spin :spinning="loading">
- <div v-if="packList.length" class="pack-grid">
- <article v-for="record in packList" :key="String(record.id)" class="pack-card">
- <div class="pack-card__head">
- <div class="pack-card__identity">
- <span class="pack-card__avatar">
- <Icon icon="i-mdi:package-variant-closed" :size="20" />
- </span>
- <div class="pack-card__name-wrap">
- <h4 class="pack-card__name" :title="record.packName">{{ record.packName || '-' }}</h4>
- <span class="pack-card__code" :title="record.packCode">{{ record.packCode || '-' }}</span>
- </div>
- </div>
- <a-tag :color="record.status === '0' ? 'success' : 'error'">
- {{ record.status === '0' ? '启用' : '停用' }}
- </a-tag>
- </div>
- <p class="pack-card__desc">{{ record.description || '暂无用途说明' }}</p>
- <div class="pack-card__capabilities">
- <a-tag class="cell-tag">业务工具 {{ record.toolBindings?.length || 0 }}</a-tag>
- <a-tag color="warning" class="cell-tag">MCP 工具 {{ record.mcpToolBindings?.length || 0 }}</a-tag>
- <a-tag color="success" class="cell-tag">技能 {{ record.skillIds?.length || 0 }}</a-tag>
- </div>
- <div class="pack-card__footer">
- <span class="pack-card__time">更新于 {{ record.updateTime || '-' }}</span>
- <div class="pack-card__actions">
- <a-button type="link" size="small" @click="handleView(record)">查看</a-button>
- <a-button type="link" size="small" @click="handleUpdate(record)">修改</a-button>
- <a-button danger type="link" size="small" @click="handleDelete(record)">删除</a-button>
- </div>
- </div>
- </article>
- </div>
- <a-empty v-else description="暂无场景包" :image-style="{ height: '72px' }" />
- </a-spin>
- </div>
- </section>
- <BasicModal
- v-model:open="dialog.visible"
- :title="dialog.title"
- :width="900"
- :height="640"
- :min-height="520"
- :can-fullscreen="false"
- :confirm-loading="buttonLoading"
- ok-text="确 定"
- cancel-text="取 消"
- wrap-class-name="pack-modal"
- @ok="submitForm"
- @cancel="cancel"
- >
- <a-form ref="packFormRef" :model="form" :rules="rules" :label-col="{ style: { width: '130px' } }">
- <a-form-item name="packCode">
- <template #label>
- <span class="wb-label-tip">
- 场景包编码
- <a-tooltip title="唯一标识,创建后不可修改;会作为任务快照保存。">
- <Icon icon="i-mdi:information-outline" class="wb-label-tip__icon" tabindex="0" />
- </a-tooltip>
- </span>
- </template>
- <a-input
- v-model:value="form.packCode"
- :disabled="!!form.id"
- placeholder="小写字母开头,可含数字、下划线、短横线"
- />
- </a-form-item>
- <a-form-item name="packName">
- <template #label><span class="wb-label-tip">场景包名称</span></template>
- <a-input v-model:value="form.packName" placeholder="如:财务场景包 / 人力场景包" />
- </a-form-item>
- <a-form-item name="description">
- <template #label>
- <span class="wb-label-tip">
- 用途说明
- <a-tooltip title="创建任务时会展示给用户,请写清「适合哪些角色 / 什么场景使用」。">
- <Icon icon="i-mdi:information-outline" class="wb-label-tip__icon" tabindex="0" />
- </a-tooltip>
- </span>
- </template>
- <a-textarea v-model:value="form.description" :rows="2" placeholder="适合哪些角色 / 什么场景使用" />
- </a-form-item>
- <a-form-item name="toolBindings">
- <template #label>
- <span class="wb-label-tip">
- 业务工具
- <a-tooltip>
- <template #title>
- <div class="tip-content">
- 叠加到智能体既有绑定之上;<b>同一工具以包内决策优先</b>。写入类工具建议设为「需确认」。
- </div>
- </template>
- <Icon icon="i-mdi:information-outline" class="wb-label-tip__icon" tabindex="0" />
- </a-tooltip>
- </span>
- </template>
- <a-select
- v-model:value="selectedToolCodes"
- mode="multiple"
- allow-clear
- placeholder="请选择包内业务工具"
- style="width: 100%"
- >
- <a-select-option
- v-for="item in toolOptions"
- :key="item.toolCode"
- :label="item.toolName"
- :value="item.toolCode"
- >
- <span>{{ item.toolName }}</span>
- <span class="option-suffix">{{ item.toolType === '0' ? '只读' : '写入' }}</span>
- </a-select-option>
- </a-select>
- </a-form-item>
- <a-form-item v-if="form.toolBindings?.length">
- <template #label>
- <span class="wb-label-tip">
- 工具授权
- <a-tooltip title="允许:直接执行;需确认:调用前暂停,等待用户在对话页确认;禁止:不允许调用。">
- <Icon icon="i-mdi:information-outline" class="wb-label-tip__icon" tabindex="0" />
- </a-tooltip>
- </span>
- </template>
- <div class="binding-list">
- <div v-for="bind in form.toolBindings" :key="bind.toolCode" class="binding-row">
- <span class="binding-name">{{ toolLabel(bind.toolCode) }}</span>
- <a-select v-model:value="bind.decision" size="small" style="width: 150px">
- <a-select-option v-for="item in DECISION_OPTIONS" :key="item.value" :value="item.value">
- {{ item.label }}
- </a-select-option>
- </a-select>
- </div>
- </div>
- </a-form-item>
- <a-form-item name="mcpToolBindings">
- <template #label>
- <span class="wb-label-tip">
- 外部 MCP 工具
- <a-tooltip>
- <template #title>
- <div class="tip-content">
- 仅装配包内勾选项且必须在该连接的工具白名单内;<b>未选包的任务不接入任何 MCP 工具</b>。
- 连接未配置工具白名单时无可选项,请先到「MCP 客户端」页填写。
- </div>
- </template>
- <Icon icon="i-mdi:information-outline" class="wb-label-tip__icon" tabindex="0" />
- </a-tooltip>
- </span>
- </template>
- <a-select
- v-model:value="selectedMcpKeys"
- mode="multiple"
- allow-clear
- placeholder="请选择包内 MCP 工具"
- :options="mcpSelectOptions"
- style="width: 100%"
- />
- </a-form-item>
- <a-form-item v-if="form.mcpToolBindings?.length">
- <template #label>
- <span class="wb-label-tip">
- MCP 授权
- <a-tooltip title="允许:直接执行;需确认:调用前暂停,等待用户在对话页确认;禁止:不允许调用。">
- <Icon icon="i-mdi:information-outline" class="wb-label-tip__icon" tabindex="0" />
- </a-tooltip>
- </span>
- </template>
- <div class="binding-list">
- <div
- v-for="bind in form.mcpToolBindings"
- :key="mcpKey(bind.mcpClientId, bind.toolName)"
- class="binding-row"
- >
- <span class="binding-name"> {{ serverNameOf(bind.mcpClientId) }} · {{ bind.toolName }} </span>
- <a-select v-model:value="bind.decision" size="small" style="width: 150px">
- <a-select-option v-for="item in DECISION_OPTIONS" :key="item.value" :value="item.value">
- {{ item.label }}
- </a-select-option>
- </a-select>
- </div>
- </div>
- </a-form-item>
- <a-form-item name="skillIds">
- <template #label>
- <span class="wb-label-tip">
- 技能
- <a-tooltip
- title="叠加到智能体既有技能绑定之上;仍按提问用户的技能生效范围过滤(仅列当前用户可见的技能)。"
- >
- <Icon icon="i-mdi:information-outline" class="wb-label-tip__icon" tabindex="0" />
- </a-tooltip>
- </span>
- </template>
- <a-select
- v-model:value="form.skillIds"
- mode="multiple"
- allow-clear
- placeholder="请选择包内技能"
- style="width: 100%"
- >
- <a-select-option v-for="item in skillOptions" :key="item.id" :label="item.name" :value="item.id" />
- </a-select>
- </a-form-item>
- <a-form-item name="status">
- <template #label><span class="wb-label-tip">状态</span></template>
- <a-radio-group v-model:value="form.status">
- <a-radio value="0">启用</a-radio>
- <a-radio value="1">停用</a-radio>
- </a-radio-group>
- </a-form-item>
- <a-form-item name="remark">
- <template #label><span class="wb-label-tip">备注</span></template>
- <a-textarea v-model:value="form.remark" :rows="2" placeholder="请输入备注" />
- </a-form-item>
- </a-form>
- </BasicModal>
- <BasicModal
- v-model:open="detail.visible"
- title="场景包详情"
- :width="900"
- :height="620"
- :min-height="520"
- :can-fullscreen="false"
- wrap-class-name="pack-modal"
- >
- <template v-if="detail.record">
- <a-descriptions :column="2" bordered size="small" class="detail-summary">
- <a-descriptions-item label="场景包编码">{{ detail.record.packCode || '-' }}</a-descriptions-item>
- <a-descriptions-item label="场景包名称">{{ detail.record.packName || '-' }}</a-descriptions-item>
- <a-descriptions-item label="状态">
- <a-tag :color="detail.record.status === '0' ? 'success' : 'error'">
- {{ detail.record.status === '0' ? '启用' : '停用' }}
- </a-tag>
- </a-descriptions-item>
- <a-descriptions-item label="创建人">{{ detail.record.createByName || '-' }}</a-descriptions-item>
- <a-descriptions-item label="用途说明" :span="2">{{ detail.record.description || '-' }}</a-descriptions-item>
- <a-descriptions-item label="业务工具" :span="2">
- <template v-if="detail.record.toolBindings?.length">
- <a-tag
- v-for="bind in detail.record.toolBindings"
- :key="bind.toolCode"
- class="cell-tag"
- :color="decisionTagColor(bind.decision)"
- >
- {{ bind.toolName || bind.toolCode }} · {{ decisionLabel(bind.decision) }}
- </a-tag>
- </template>
- <span v-else class="wb-muted">未配置</span>
- </a-descriptions-item>
- <a-descriptions-item label="外部 MCP 工具" :span="2">
- <template v-if="detail.record.mcpToolBindings?.length">
- <a-tag
- v-for="bind in detail.record.mcpToolBindings"
- :key="mcpKey(bind.mcpClientId, bind.toolName)"
- class="cell-tag"
- :color="decisionTagColor(bind.decision)"
- >
- {{ bind.serverName || bind.mcpClientId }} · {{ bind.toolName }} · {{ decisionLabel(bind.decision) }}
- </a-tag>
- </template>
- <span v-else class="wb-muted">未配置(该会话不接入 MCP 工具)</span>
- </a-descriptions-item>
- <a-descriptions-item label="技能" :span="2">
- <template v-if="detail.record.skillNames?.length">
- <a-tag v-for="name in detail.record.skillNames" :key="name" class="cell-tag" color="success">
- {{ name }}
- </a-tag>
- </template>
- <span v-else class="wb-muted">未配置</span>
- </a-descriptions-item>
- <a-descriptions-item label="备注" :span="2">{{ detail.record.remark || '-' }}</a-descriptions-item>
- <a-descriptions-item label="创建时间">{{ detail.record.createTime || '-' }}</a-descriptions-item>
- <a-descriptions-item label="更新时间">{{ detail.record.updateTime || '-' }}</a-descriptions-item>
- </a-descriptions>
- </template>
- <template #footer>
- <a-button @click="detail.visible = false">关 闭</a-button>
- </template>
- </BasicModal>
- </div>
- </template>
- <script lang="ts" setup name="WorkbenchAgentPack">
- import { computed, onMounted, reactive, ref } from 'vue';
- import {
- AButton,
- ADescriptions,
- ADescriptionsItem,
- AEmpty,
- AForm,
- AFormItem,
- AInput,
- ARadio,
- ARadioGroup,
- ASelect,
- ASelectOption,
- ASpin,
- ATag,
- ATextarea,
- ATooltip,
- Modal,
- message,
- } from '@/workbench/components/ant';
- import { Icon } from '@/core/components/Icon';
- import { BasicModal } from '@/core/components/Modal';
- import {
- addScenarioPack,
- delScenarioPack,
- getScenarioPack,
- listScenarioPack,
- scenarioPackMcpOptions,
- updateScenarioPack,
- } from '@/workbench/api/pack';
- import { visibleSkillOptions } from '@/workbench/api/skill';
- import { listTool } from '@/workbench/api/tool';
- const packPanelTip =
- '场景包按角色 / 部门把业务工具、外部 MCP 工具与技能打包;用户在创建任务时选定并固化到任务,' +
- '包内能力叠加到智能体既有绑定之上(同一工具以包内决策优先)。未选包的任务不接入任何 MCP 工具。';
- /** 工具授权决策选项 */
- const DECISION_OPTIONS = [
- { label: '允许', value: '0' },
- { label: '需确认', value: '1' },
- { label: '禁止', value: '2' },
- ];
- const packList = ref<any[]>([]);
- const toolOptions = ref<any[]>([]);
- const mcpOptions = ref<any[]>([]);
- const skillOptions = ref<any[]>([]);
- const loading = ref(true);
- const buttonLoading = ref(false);
- const packFormRef = ref<any>();
- const queryParams = reactive({
- keyword: '' as string,
- status: undefined as any,
- });
- const initFormData = {
- id: undefined as any,
- packCode: undefined as any,
- packName: undefined as any,
- description: undefined as any,
- status: '0',
- remark: undefined as any,
- toolBindings: [] as any[],
- mcpToolBindings: [] as any[],
- skillIds: [] as any[],
- };
- const dialog = reactive<{ visible: boolean; title: string }>({
- visible: false,
- title: '',
- });
- const form = ref<any>({ ...initFormData });
- /** 详情弹窗(查看场景包完整信息,只读) */
- const detail = reactive<{ visible: boolean; record: any | null }>({
- visible: false,
- record: null,
- });
- /** MCP 工具选择值:连接主键::远端工具名 */
- const mcpKey = (mcpClientId?: string | number, toolName?: string) => `${mcpClientId}::${toolName}`;
- /** MCP 工具下拉(按连接分组) */
- const mcpSelectOptions = computed(() =>
- mcpOptions.value.map((group) => ({
- label: group.serverName,
- options: (group.tools || []).map((toolName: string) => ({
- label: toolName,
- value: mcpKey(group.mcpClientId, toolName),
- })),
- })),
- );
- /** 业务工具多选(保留已选工具的授权决策) */
- const selectedToolCodes = computed<string[]>({
- get: () => (form.value.toolBindings ?? []).map((bind: any) => bind.toolCode),
- set: (codes: string[]) => {
- const exists = new Map((form.value.toolBindings ?? []).map((bind: any) => [bind.toolCode, bind]));
- form.value.toolBindings = codes.map((code) => exists.get(code) ?? { toolCode: code, decision: '0' });
- },
- });
- /** MCP 工具多选(保留已选工具的授权决策) */
- const selectedMcpKeys = computed<string[]>({
- get: () => (form.value.mcpToolBindings ?? []).map((bind: any) => mcpKey(bind.mcpClientId, bind.toolName)),
- set: (keys: string[]) => {
- const exists = new Map(
- (form.value.mcpToolBindings ?? []).map((bind: any) => [mcpKey(bind.mcpClientId, bind.toolName), bind]),
- );
- form.value.mcpToolBindings = keys.map((key): any => {
- const found = exists.get(key);
- if (found) {
- return found;
- }
- const idx = key.indexOf('::');
- return { mcpClientId: key.slice(0, idx), toolName: key.slice(idx + 2), decision: '0' };
- });
- },
- });
- /** 工具显示名(工具停用 / 删除时回落到编码,避免下拉与列表空白) */
- const toolLabel = (toolCode?: string) =>
- toolOptions.value.find((item) => item.toolCode === toolCode)?.toolName ?? toolCode ?? '-';
- /** Server 名称(连接停用 / 删除时回落到主键) */
- const serverNameOf = (mcpClientId?: string | number) =>
- mcpOptions.value.find((item) => String(item.mcpClientId) === String(mcpClientId))?.serverName ??
- String(mcpClientId ?? '-');
- const decisionLabel = (decision?: string) =>
- DECISION_OPTIONS.find((item) => item.value === decision)?.label ?? '允许';
- const decisionTagColor = (decision?: string) => {
- if (decision === '1') {
- return 'warning';
- }
- if (decision === '2') {
- return 'error';
- }
- return 'success';
- };
- /** 表单校验规则 */
- const rules: any = computed(() => ({
- packCode: [
- { required: true, message: '场景包编码不能为空', trigger: 'blur' },
- {
- pattern: /^[a-z][a-z0-9_-]{1,63}$/,
- message: '小写字母开头,仅含小写字母、数字、下划线或短横线,长度 2~64 位',
- trigger: 'blur',
- },
- ],
- packName: [{ required: true, message: '场景包名称不能为空', trigger: 'blur' }],
- }));
- /** 查询场景包列表 */
- const getList = async () => {
- loading.value = true;
- try {
- const res = await listScenarioPack(queryParams);
- packList.value = res?.rows ?? [];
- } finally {
- loading.value = false;
- }
- };
- /** 加载表单依赖的三类选项(逐项降级:单项失败仅置空该项并汇总警告) */
- const loadOptions = async () => {
- const [toolRes, mcpRes, skillRes] = await Promise.allSettled([
- listTool({ pageNum: 1, pageSize: 200, status: '0' }),
- scenarioPackMcpOptions(),
- visibleSkillOptions(),
- ]);
- const failed: string[] = [];
- if (toolRes.status === 'fulfilled') {
- toolOptions.value = toolRes.value?.rows ?? [];
- } else {
- failed.push('业务工具');
- }
- if (mcpRes.status === 'fulfilled') {
- mcpOptions.value = mcpRes.value ?? [];
- } else {
- failed.push('外部 MCP 工具');
- }
- if (skillRes.status === 'fulfilled') {
- skillOptions.value = skillRes.value ?? [];
- } else {
- failed.push('技能');
- }
- if (failed.length) {
- message.warning(`以下选项加载失败(可能缺少相应权限):${failed.join('、')}`);
- }
- };
- const handleQuery = () => {
- getList();
- };
- const resetQuery = () => {
- queryParams.keyword = '';
- queryParams.status = undefined;
- getList();
- };
- /** 重置表单为初始值 */
- const reset = () => {
- form.value = { ...initFormData, toolBindings: [], mcpToolBindings: [], skillIds: [] };
- packFormRef.value?.resetFields?.();
- };
- /** 新增按钮操作 */
- const handleAdd = () => {
- reset();
- dialog.title = '新增场景包';
- dialog.visible = true;
- };
- /** 查看按钮操作(拉取完整字段后只读展示) */
- const handleView = async (row: any) => {
- detail.record = (await getScenarioPack(row.id)) ?? null;
- detail.visible = true;
- };
- /** 修改按钮操作 */
- const handleUpdate = async (row: any) => {
- reset();
- const record = await getScenarioPack(row.id);
- form.value = {
- id: record.id,
- packCode: record.packCode,
- packName: record.packName,
- description: record.description,
- status: record.status ?? '0',
- remark: record.remark,
- toolBindings: (record.toolBindings ?? []).map((bind: any) => ({ ...bind })),
- mcpToolBindings: (record.mcpToolBindings ?? []).map((bind: any) => ({ ...bind })),
- skillIds: [...(record.skillIds ?? [])],
- };
- dialog.title = '修改场景包';
- dialog.visible = true;
- };
- /** 取消按钮 */
- const cancel = () => {
- reset();
- dialog.visible = false;
- };
- /** 提交按钮 */
- const submitForm = async () => {
- try {
- await packFormRef.value?.validate();
- } catch {
- return;
- }
- buttonLoading.value = true;
- try {
- const payload: any = {
- ...form.value,
- toolBindings: (form.value.toolBindings ?? []).filter((bind: any) => !!bind.toolCode),
- mcpToolBindings: (form.value.mcpToolBindings ?? []).filter((bind: any) => !!bind.toolName),
- skillIds: (form.value.skillIds ?? []).filter((id: any) => id !== undefined && id !== null && id !== ''),
- };
- if (payload.id) {
- await updateScenarioPack(payload);
- message.success('修改成功');
- } else {
- delete payload.id;
- await addScenarioPack(payload);
- message.success('新增成功');
- }
- dialog.visible = false;
- await getList();
- } finally {
- buttonLoading.value = false;
- }
- };
- /** 删除按钮操作 */
- const handleDelete = async (row: any) => {
- const ok = await new Promise<boolean>((resolve) => {
- Modal.confirm({
- title: '提示',
- content: `是否确认删除场景包「${row.packName || row.id}」?`,
- okText: '确定',
- cancelText: '取消',
- onOk: () => resolve(true),
- onCancel: () => resolve(false),
- });
- });
- if (!ok) {
- return;
- }
- await delScenarioPack(row.id);
- message.success('删除成功');
- await getList();
- };
- onMounted(() => {
- loadOptions();
- getList();
- });
- </script>
- <style scoped lang="less">
- .pack-page {
- height: 100%;
- padding: 8px 10px;
- overflow: hidden;
- background: #f4f6fa;
- }
- .pack-panel {
- display: flex;
- flex: 1 1 auto;
- flex-direction: column;
- min-height: 0;
- overflow: hidden;
- background: #fff;
- border: 1px solid #e7ebf3;
- border-radius: 14px;
- box-shadow: 0 1px 2px rgb(16 24 40 / 4%);
- }
- .pack-panel__head {
- display: flex;
- flex: 0 0 auto;
- flex-wrap: wrap;
- align-items: center;
- gap: 12px;
- min-height: 56px;
- padding: 10px 14px;
- border-bottom: 1px solid #eff2f7;
- }
- .pack-panel__heading {
- flex: 1 1 320px;
- min-width: 0;
- }
- .pack-panel__title-row {
- display: flex;
- align-items: center;
- min-width: 0;
- gap: 8px;
- }
- .pack-panel__title {
- position: relative;
- margin: 0;
- padding-left: 11px;
- color: #111827;
- font-size: 15px;
- font-weight: 600;
- line-height: 22px;
- &::before {
- position: absolute;
- top: 4px;
- bottom: 4px;
- left: 0;
- width: 3px;
- border-radius: 2px;
- background: #2a50ec;
- content: '';
- }
- }
- .pack-panel__tip {
- color: #98a2b3;
- font-size: 16px;
- cursor: help;
- }
- .pack-panel__count {
- margin-left: 2px;
- color: #5b6577;
- font-size: 12px;
- font-variant-numeric: tabular-nums;
- }
- .pack-panel__tools {
- display: flex;
- flex: 0 0 auto;
- flex-wrap: wrap;
- align-items: center;
- gap: 8px;
- }
- .pack-search {
- width: 280px;
- }
- .pack-status-select {
- width: 140px;
- }
- .pack-search__icon {
- color: #98a2b3;
- }
- .pack-panel__tools :deep(.ant-btn) {
- height: 30px;
- padding: 0 14px;
- border-radius: 8px;
- font-size: 12px;
- font-weight: 500;
- }
- .pack-panel__tools :deep(.ant-input),
- .pack-panel__tools :deep(.ant-input-affix-wrapper),
- .pack-panel__tools :deep(.ant-select),
- .pack-panel__tools :deep(.ant-select-selector) {
- height: 32px;
- border-color: #e7ebf3;
- border-radius: 8px;
- font-size: 12px;
- }
- .pack-panel__tools :deep(.ant-input-affix-wrapper) {
- padding: 0 10px;
- }
- .pack-panel__tools :deep(.ant-input-affix-wrapper > .ant-input) {
- height: 100%;
- padding: 0;
- background: transparent;
- border: 0;
- border-radius: 0;
- box-shadow: none;
- }
- .pack-panel__tools :deep(.ant-select-selector) {
- padding: 0 10px;
- }
- .pack-panel__tools :deep(.ant-select-selection-item),
- .pack-panel__tools :deep(.ant-select-selection-placeholder) {
- font-size: 12px;
- line-height: 30px;
- }
- .pack-panel__body {
- flex: 1 1 auto;
- min-height: 0;
- padding: 14px;
- overflow: auto;
- background: #f8fafc;
- }
- .pack-panel__body :deep(.ant-empty) {
- margin: 48px 0;
- }
- .pack-grid {
- display: grid;
- grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
- gap: 12px;
- }
- .pack-card {
- display: flex;
- flex-direction: column;
- min-width: 0;
- min-height: 220px;
- padding: 14px;
- background: #fff;
- border: 1px solid #e7ebf3;
- border-radius: 12px;
- box-shadow: 0 1px 2px rgb(16 24 40 / 3%);
- transition:
- border-color 0.15s ease,
- box-shadow 0.15s ease;
- }
- .pack-card:hover {
- border-color: #bfcdfb;
- box-shadow: 0 6px 18px rgb(42 80 236 / 8%);
- }
- .pack-card__head {
- display: flex;
- align-items: flex-start;
- justify-content: space-between;
- gap: 10px;
- }
- .pack-card__identity {
- display: flex;
- min-width: 0;
- gap: 10px;
- }
- .pack-card__avatar {
- display: inline-flex;
- flex: 0 0 38px;
- align-items: center;
- justify-content: center;
- width: 38px;
- height: 38px;
- color: #2a50ec;
- background: #eef2ff;
- border-radius: 10px;
- }
- .pack-card__name-wrap {
- min-width: 0;
- }
- .pack-card__name {
- margin: 0;
- overflow: hidden;
- color: #111827;
- font-size: 15px;
- font-weight: 600;
- line-height: 22px;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .pack-card__code {
- display: block;
- margin-top: 2px;
- overflow: hidden;
- color: #98a2b3;
- font-size: 12px;
- line-height: 18px;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .pack-card__desc {
- display: -webkit-box;
- min-height: 40px;
- margin: 12px 0 0;
- overflow: hidden;
- color: #5b6577;
- font-size: 12px;
- line-height: 20px;
- -webkit-box-orient: vertical;
- -webkit-line-clamp: 2;
- }
- .pack-card__capabilities {
- display: flex;
- flex-wrap: wrap;
- gap: 6px;
- margin-top: 12px;
- padding-top: 12px;
- border-top: 1px dashed #eff2f7;
- }
- .pack-card__capabilities :deep(.ant-tag) {
- margin-inline-end: 0;
- font-size: 11px;
- line-height: 20px;
- }
- .pack-card__footer {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 12px;
- margin-top: auto;
- padding-top: 12px;
- border-top: 1px solid #eff2f7;
- }
- .pack-card__time {
- overflow: hidden;
- color: #98a2b3;
- font-size: 11px;
- line-height: 18px;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .pack-card__actions {
- display: flex;
- align-items: center;
- gap: 2px;
- }
- .pack-card__actions :deep(.ant-btn-link) {
- padding: 0 4px;
- font-size: 12px;
- }
- .wb-label-tip__icon {
- color: #98a2b3;
- font-size: 13px;
- }
- .tip-content {
- line-height: 1.6;
- }
- .cell-tag {
- margin: 2px 4px 2px 0;
- }
- .option-suffix {
- float: right;
- color: #98a2b3;
- font-size: 12px;
- }
- .binding-list {
- width: 100%;
- max-height: 220px;
- overflow-y: auto;
- }
- .binding-row {
- display: flex;
- align-items: center;
- justify-content: space-between;
- gap: 12px;
- padding: 4px 0;
- }
- .binding-name {
- flex: 1;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
- .detail-summary {
- margin-bottom: 12px;
- :deep(.ant-descriptions-item-label) {
- min-width: 110px;
- }
- }
- @media (max-width: 900px) {
- .pack-panel__head {
- align-items: flex-start;
- }
- .pack-panel__tools {
- width: 100%;
- }
- .pack-search {
- flex: 1 1 180px;
- width: auto;
- }
- }
- :global(.pack-modal .ant-modal) {
- height: auto !important;
- }
- </style>
|