his-weapp/pages/surgery/index.wxml
2026-01-15 15:05:29 +08:00

102 lines
3.7 KiB
Plaintext

<t-pull-down-refresh
value="{{refreshing}}"
loadingProps="{{loadingProps}}"
loadingTexts="{{loadingTexts}}"
bind:refresh="onRefresh"
bind:scrolltolower="onScrollToLower"
maxBarHeight="200"
loadingBarHeight="80"
lowerThreshold="100"
enable-back-to-top="{{true}}"
>
<view class="surgery-searchbar">
<view class="surgery-radio">
<t-radio default-checked="{{isFinish}}" allow-uncheck icon="line" label="未完成" bind:change="clickunfinished"/>
</view>
<view class="surgery-search"><t-search placeholder="请输入患者ID" /></view>
</view>
<view class="surgery-container">
<!-- 初始加载骨架屏 -->
<block wx:if="{{loading && surgeries.length === 0}}">
<view wx:for="{{5}}" wx:key="index" class="skeleton-item">
<t-skeleton theme="paragraph" loading></t-skeleton>
</view>
</block>
<!-- 加载错误提示 -->
<block wx:elif="{{loadError}}">
<view class="error-container">
<t-empty icon="error-circle" description="加载失败,请下拉刷新重试" />
</view>
</block>
<!-- 手术列表 -->
<block wx:elif="{{surgeries && surgeries.length > 0}}">
<view class="surgery-list">
<block wx:for="{{surgeries}}" wx:key="id">
<t-swipe-cell class="swipe-cell-container" right="{{item.swipeButtons}}" bind:click="onSwipeCellClick">
<view class="surgery-card {{item.hasUnfinishedDevice ? 'surgery-card--unfinished' : ''}}" bindtap="viewSurgeryDetail" data-id="{{item.id}}">
<view class="surgery-title">
{{item.surgery_name}}
<view wx:if="{{item.hasUnfinishedDevice}}" class="unfinished-indicator">
<text class="unfinished-text">未设置结束时间</text>
</view>
</view>
<view class="surgery-info">
<view class="info-item patient">
<text>患者: {{item.patient}}</text>
</view>
<view class="info-item time">
<text>时间: {{item.formattedTime}}</text>
</view>
<view class="info-item doctor-dept">
<text class="doctor">{{item.doctorName}}</text>
<text class="dept">{{item.departmentName}}</text>
</view>
<!-- 添加设备数量显示 -->
<view class="info-item device-count">
<text class="count">使用设备: {{item.deviceCount}}个</text>
</view>
</view>
<view class="surgery-id-tag">{{item.surgery_id}}</view>
</view>
</t-swipe-cell>
</block>
</view>
<!-- 加载更多状态 -->
<view wx:if="{{loadingMore}}" class="loading-more">
<t-loading text="加载更多..." size="40rpx" theme="circular" />
</view>
<!-- 没有更多数据 -->
<view wx:if="{{noMoreData && surgeries.length > 0}}" class="no-more">
<view class="no-more-line"></view>
<text class="no-more-text">没有更多手术记录了</text>
<view class="no-more-line"></view>
</view>
</block>
<!-- 空数据提示 -->
<block wx:else>
<view class="empty-container">
<t-empty icon="info-circle-filled" description="暂无手术记录" />
</view>
</block>
<t-fab icon="add" bind:click="handleClick" aria-label="增加"></t-fab>
</view>
</t-pull-down-refresh>
<!-- Toast 消息提示 -->
<t-toast id="t-toast" />
<!-- 确认删除的对话框 -->
<t-dialog
visible="{{confirmDialogVisible}}"
title="确认删除"
content="确定要删除此手术记录吗?此操作不可撤销。"
confirm-btn="删除"
cancel-btn="取消"
bind:confirm="confirmDelete"
bind:cancel="cancelDelete"
/>