spring
4 天以前 a222a1024581067cc7823298172aaef539128d82
src/pages/safeProduction/safetyTrainingAssessment/index.vue
@@ -100,7 +100,7 @@
          </view>
          <!-- 按钮区域 -->
          <view class="action-buttons">
            <u-button type="primary"
            <!-- <u-button type="primary"
                      size="small"
                      class="action-btn"
                      :disabled="item.state !== 0"
@@ -118,7 +118,7 @@
                      class="action-btn"
                      @click="deleteVisit(item)">
              删除
            </u-button>
            </u-button> -->
          </view>
          <view class="action-buttons">
            <u-button type="warning"
@@ -149,12 +149,12 @@
                        @cancel="handleDateCancel"
                        title="选择培训日期" />
    <!-- 浮动新增按钮 -->
    <view class="fab-button"
    <!-- <view class="fab-button"
          @click="addVisit">
      <up-icon name="plus"
               size="24"
               color="#ffffff"></up-icon>
    </view>
    </view> -->
  </view>
</template>
@@ -284,8 +284,22 @@
  // 处理日期选择确认
  const handleDateConfirm = e => {
    searchKeyword.value = dayjs(e.value).format("YYYY-MM-DD");
    searchForm.value.trainingDate = dayjs(e.value).format("YYYY-MM-DD");
    const raw = e?.value;
    // up-datetime-picker 的 value 可能是 Date / 毫秒时间戳(13位) / 秒时间戳(10位) / 字符串
    const normalized =
      typeof raw === "number"
        ? raw < 1e12
          ? raw * 1000
          : raw
        : typeof raw === "string" && /^\d+$/.test(raw)
          ? raw.length === 10
            ? Number(raw) * 1000
            : Number(raw)
          : raw;
    const formatted = dayjs(normalized).format("YYYY-MM-DD");
    searchKeyword.value = formatted;
    searchForm.value.trainingDate = formatted;
    trainingDateVisible.value = false;
    getList();
  };