wlzboy
2025-11-09 13a31edf7f569cdcf15d3c43a476a2c947f47fbf
app/components/AttachmentUpload.vue
@@ -3,7 +3,7 @@
    <view class="detail-section">
      <view class="section-title">
        {{ title }}
        <button class="upload-btn" @click="showUploadDialog">上传附件</button>
        <button class="upload-btn" @click="showUploadDialog" v-if="!readonly">上传附件</button>
      </view>
      <view v-if="attachmentList && attachmentList.length > 0">
        <view class="attachment-item" v-for="(item, index) in attachmentList" :key="item.attachmentId">
@@ -20,7 +20,7 @@
          </view>
          <view class="attachment-actions">
            <button class="action-btn view-btn" @click="viewAttachment(item)">查看</button>
            <button class="action-btn delete-btn" @click="deleteAttachment(item.attachmentId, index)">删除</button>
            <button class="action-btn delete-btn" @click="deleteAttachment(item.attachmentId, index)" v-if="!readonly">删除</button>
          </view>
        </view>
      </view>
@@ -87,6 +87,11 @@
      autoLoad: {
        type: Boolean,
        default: true
      },
      // 是否只读模式(禁止上传和删除)
      readonly: {
        type: Boolean,
        default: false
      }
    },
    data() {