fix layout
This commit is contained in:
+138
-134
@@ -1,141 +1,145 @@
|
||||
<template>
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="登记事件详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="canUpdate"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<div
|
||||
v-can="permissionCodes.event.read"
|
||||
class="registration-event-detail"
|
||||
>
|
||||
<div v-entrance-transition v-if="event" class="event-header">
|
||||
<div class="color" :style="{ background: event.color || defaultColor }" />
|
||||
<div class="header-content">
|
||||
<div class="title-row">
|
||||
<h2 v-text="event.name || '未命名事件'" />
|
||||
<t-tag :theme="getStatusTheme(event.status)" variant="light-outline" :content="getStatusText(event.status)" />
|
||||
<div class="page-layout navbar">
|
||||
<t-navbar
|
||||
fixed
|
||||
:z-index="20"
|
||||
title="登记事件详情"
|
||||
left-arrow
|
||||
@left-click="$router.back()"
|
||||
>
|
||||
<template #right>
|
||||
<t-button
|
||||
v-if="canUpdate"
|
||||
@click="toEdit"
|
||||
theme="primary"
|
||||
variant="text"
|
||||
size="small"
|
||||
content="编辑"
|
||||
/>
|
||||
</template>
|
||||
</t-navbar>
|
||||
<main class="page-content scroll column">
|
||||
<div
|
||||
v-can="permissionCodes.event.read"
|
||||
class="registration-event-detail"
|
||||
>
|
||||
<div v-entrance-transition v-if="event" class="event-header">
|
||||
<div class="color" :style="{ background: event.color || defaultColor }" />
|
||||
<div class="header-content">
|
||||
<div class="title-row">
|
||||
<h2 v-text="event.name || '未命名事件'" />
|
||||
<t-tag :theme="getStatusTheme(event.status)" variant="light-outline" :content="getStatusText(event.status)" />
|
||||
</div>
|
||||
<div class="description" v-text="Text.display(event.description)" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="description" v-text="Text.display(event.description)" />
|
||||
</div>
|
||||
<t-cell-group v-entrance-transition v-if="event" title="基本信息" theme="card">
|
||||
<t-cell title="所属门店" :note="storeName" />
|
||||
<t-cell title="业务类型" :note="getEventBizTypeText(event.bizType)" />
|
||||
<t-cell v-if="isPackagePurchaseEvent(event)" title="绑定套餐">
|
||||
<template #note>
|
||||
<div class="package-note">
|
||||
<strong v-text="event.packageConfig?.name || '未返回套餐配置'" />
|
||||
<span v-if="event.packageConfig" v-text="`${formatPackageAmount(event.packageConfig.standardAmount)}|${getPackageConfigStatusText(event.packageConfig.status)}`" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="事件颜色">
|
||||
<template #note>
|
||||
<div class="color-note">
|
||||
<span class="color-dot" :style="{ background: event.color || defaultColor }" />
|
||||
<span v-text="(event.color || defaultColor).toLowerCase()" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="说明" :note="Text.display(event.description)" />
|
||||
<t-cell title="可登记角色">
|
||||
<template #note>
|
||||
<div v-if="event.roleCodeList?.length" class="tag-list">
|
||||
<t-tag
|
||||
v-for="roleCode in event.roleCodeList"
|
||||
:key="roleCode"
|
||||
theme="primary"
|
||||
variant="light-outline"
|
||||
:content="getRoleName(roleCode)"
|
||||
/>
|
||||
</div>
|
||||
<span v-else>未配置</span>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-if="canReadEventRecord && event.bizType !== 'PACKAGE_PURCHASE'"
|
||||
title="登记记录"
|
||||
note="查看该事件登记记录"
|
||||
arrow
|
||||
:hover="true"
|
||||
@click="toEventRecordList"
|
||||
/>
|
||||
<t-cell
|
||||
v-else-if="event.bizType === 'PACKAGE_PURCHASE'"
|
||||
title="购买记录"
|
||||
note="请在套餐订单列表或订单详情中查看"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-entrance-transition v-if="event" title="登记配置" theme="card">
|
||||
<t-cell title="数值类型" :note="getValueTypeText(event.valueType)" />
|
||||
<t-cell v-if="event.valueType === 'NUMBER'" title="数值单位" :note="getValueUnitText(event.valueUnit)" />
|
||||
<t-cell v-if="event.valueType === 'NUMBER'" title="登记必填数值" :note="event.requireValue ? '是' : '否'" />
|
||||
<t-cell title="需要拍照" :note="event.requirePhoto ? '是' : '否'" />
|
||||
<t-cell title="需要核销" :note="event.requireVerification ? '是' : '否'" />
|
||||
<t-cell title="次数约束" :note="getLimitText(event)" />
|
||||
<t-cell
|
||||
title="登记可选项"
|
||||
:note="`${(event?.optionGroupList || []).length} 个选项组`"
|
||||
:arrow="hasOptionGroup"
|
||||
:hover="hasOptionGroup"
|
||||
@click="openOptionPopup"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-entrance-transition v-if="event" title="生效时间" theme="card">
|
||||
<t-cell title="起始时间" :note="formatDate(event.beginAt)" />
|
||||
<t-cell title="终止时间" :note="formatDate(event.endAt)" />
|
||||
<t-cell title="创建时间" :note="formatDate(event.createdAt, '未知时间')" />
|
||||
<t-cell title="更新时间" :note="formatDate(event.updatedAt, '未知时间')" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="event && canDeleteEvent"
|
||||
v-can="permissionCodes.event.delete"
|
||||
class="cell-button"
|
||||
theme="danger"
|
||||
:loading="isRemoving"
|
||||
:disabled="isRemoving"
|
||||
@click="confirmRemoveEvent"
|
||||
v-entrance-transition
|
||||
content="删除事件"
|
||||
/>
|
||||
<t-empty v-if="!event" :description="isLoading ? '正在加载登记事件' : '登记事件不存在'" />
|
||||
</div>
|
||||
<t-cell-group v-entrance-transition v-if="event" title="基本信息" theme="card">
|
||||
<t-cell title="所属门店" :note="storeName" />
|
||||
<t-cell title="业务类型" :note="getEventBizTypeText(event.bizType)" />
|
||||
<t-cell v-if="isPackagePurchaseEvent(event)" title="绑定套餐">
|
||||
<template #note>
|
||||
<div class="package-note">
|
||||
<strong v-text="event.packageConfig?.name || '未返回套餐配置'" />
|
||||
<span v-if="event.packageConfig" v-text="`${formatPackageAmount(event.packageConfig.standardAmount)}|${getPackageConfigStatusText(event.packageConfig.status)}`" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="事件颜色">
|
||||
<template #note>
|
||||
<div class="color-note">
|
||||
<span class="color-dot" :style="{ background: event.color || defaultColor }" />
|
||||
<span v-text="(event.color || defaultColor).toLowerCase()" />
|
||||
</div>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell title="说明" :note="Text.display(event.description)" />
|
||||
<t-cell title="可登记角色">
|
||||
<template #note>
|
||||
<div v-if="event.roleCodeList?.length" class="tag-list">
|
||||
<t-tag
|
||||
v-for="roleCode in event.roleCodeList"
|
||||
:key="roleCode"
|
||||
theme="primary"
|
||||
variant="light-outline"
|
||||
:content="getRoleName(roleCode)"
|
||||
/>
|
||||
</div>
|
||||
<span v-else>未配置</span>
|
||||
</template>
|
||||
</t-cell>
|
||||
<t-cell
|
||||
v-if="canReadEventRecord && event.bizType !== 'PACKAGE_PURCHASE'"
|
||||
title="登记记录"
|
||||
note="查看该事件登记记录"
|
||||
arrow
|
||||
:hover="true"
|
||||
@click="toEventRecordList"
|
||||
</main>
|
||||
<bottom-popup
|
||||
v-model="optionPopupVisible"
|
||||
title="登记可选项"
|
||||
height="min(88vh, 48rem)"
|
||||
left-button-text="关闭"
|
||||
right-button-text=""
|
||||
@left-button-click="closeOptionPopup"
|
||||
>
|
||||
<div v-if="event && hasOptionGroup" class="option-popup">
|
||||
<event-option-selector
|
||||
v-model="optionSelectionMap"
|
||||
:event-list="[event]"
|
||||
:selected-event-id-list="selectedEventIdList"
|
||||
readonly
|
||||
/>
|
||||
<t-cell
|
||||
v-else-if="event.bizType === 'PACKAGE_PURCHASE'"
|
||||
title="购买记录"
|
||||
note="请在套餐订单列表或订单详情中查看"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-entrance-transition v-if="event" title="登记配置" theme="card">
|
||||
<t-cell title="数值类型" :note="getValueTypeText(event.valueType)" />
|
||||
<t-cell v-if="event.valueType === 'NUMBER'" title="数值单位" :note="getValueUnitText(event.valueUnit)" />
|
||||
<t-cell v-if="event.valueType === 'NUMBER'" title="登记必填数值" :note="event.requireValue ? '是' : '否'" />
|
||||
<t-cell title="需要拍照" :note="event.requirePhoto ? '是' : '否'" />
|
||||
<t-cell title="需要核销" :note="event.requireVerification ? '是' : '否'" />
|
||||
<t-cell title="次数约束" :note="getLimitText(event)" />
|
||||
<t-cell
|
||||
title="登记可选项"
|
||||
:note="`${(event?.optionGroupList || []).length} 个选项组`"
|
||||
:arrow="hasOptionGroup"
|
||||
:hover="hasOptionGroup"
|
||||
@click="openOptionPopup"
|
||||
/>
|
||||
</t-cell-group>
|
||||
<t-cell-group v-entrance-transition v-if="event" title="生效时间" theme="card">
|
||||
<t-cell title="起始时间" :note="formatDate(event.beginAt)" />
|
||||
<t-cell title="终止时间" :note="formatDate(event.endAt)" />
|
||||
<t-cell title="创建时间" :note="formatDate(event.createdAt, '未知时间')" />
|
||||
<t-cell title="更新时间" :note="formatDate(event.updatedAt, '未知时间')" />
|
||||
</t-cell-group>
|
||||
<t-button
|
||||
v-if="event && canDeleteEvent"
|
||||
v-can="permissionCodes.event.delete"
|
||||
class="cell-button"
|
||||
theme="danger"
|
||||
:loading="isRemoving"
|
||||
:disabled="isRemoving"
|
||||
@click="confirmRemoveEvent"
|
||||
v-entrance-transition
|
||||
content="删除事件"
|
||||
/>
|
||||
<t-empty v-if="!event" :description="isLoading ? '正在加载登记事件' : '登记事件不存在'" />
|
||||
</div>
|
||||
</bottom-popup>
|
||||
<event-remove-dialog
|
||||
v-model:visible="removeDialogVisible"
|
||||
:event="removeTarget"
|
||||
:loading="isRemoving"
|
||||
@confirm="removeEvent"
|
||||
/>
|
||||
</div>
|
||||
<bottom-popup
|
||||
v-model="optionPopupVisible"
|
||||
title="登记可选项"
|
||||
height="min(88vh, 48rem)"
|
||||
left-button-text="关闭"
|
||||
right-button-text=""
|
||||
@left-button-click="closeOptionPopup"
|
||||
>
|
||||
<div v-if="event && hasOptionGroup" class="option-popup">
|
||||
<event-option-selector
|
||||
v-model="optionSelectionMap"
|
||||
:event-list="[event]"
|
||||
:selected-event-id-list="selectedEventIdList"
|
||||
readonly
|
||||
/>
|
||||
</div>
|
||||
</bottom-popup>
|
||||
<event-remove-dialog
|
||||
v-model:visible="removeDialogVisible"
|
||||
:event="removeTarget"
|
||||
:loading="isRemoving"
|
||||
@confirm="removeEvent"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -397,7 +401,7 @@ onMounted(() => {
|
||||
.registration-event-detail {
|
||||
gap: 1rem;
|
||||
min-height: 100vh;
|
||||
padding: calc(var(--app-nav-height) + 1rem) 0 1rem;
|
||||
padding: 0 0 1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user