<template>
  <view class="main-data-page">
    <!-- 使用子头部组件 -->
    <sub-header
      title="业务审批"
      @goBack="goBack"
      @showMoreOptions="showMoreOptions"
    />
    <view class="main-container">
        
    </view>
  </view>
</template>

<script setup>
import { ref } from "vue";
import SubHeader from "../components/subHeader.vue";

// 头部相关方法
const goBack = () => {
  uni.navigateBack();
};

const showMoreOptions = () => {
  uni.showActionSheet({
    itemList: ["刷新", "返回首页"],
    success: (res) => {
      switch (res.tapIndex) {
        case 0:
          // 刷新数据
          uni.reLaunch({
            url: "/pages/businessDatas/index",
          });
          uni.showToast({ title: "数据已刷新", icon: "success" });
          break;
        case 1:
          uni.reLaunch({
            url: "/pages/index/index",
          });
          uni.showToast({ title: "已返回工作台", icon: "success" });
          break;
      }
    },
  });
};


</script>

<style lang="scss" scoped>
.main-data-page {
  background: #f9f9fb;
  min-height: 100vh;
  padding-top: calc(var(--status-bar-height) + 88rpx);
  padding-bottom: 40rpx;

  .main-container{
    padding: 24rpx;
    
  }
}

/* 支持安全区域的设备 */
@supports (padding: max(0px)) {
  .business-data-page {
    padding-top: calc(
      var(--status-bar-height) + 88rpx + env(safe-area-inset-top)
    );
  }
}
</style>
