<template>
    <div class="common-btn-box1 font12" @click="handleBtnClick()" v-if="isBtnShow[routeName]">
        <span>新增</span>
    </div>
</template>

<script setup lang="ts">
import { useAuthStore } from "@/stores/modules/auth";
const authStore = useAuthStore();
const $router = useRouter();
const routeName: string = $router.currentRoute.value.name as string;
const props = defineProps<{
    selectionList?: any[];
    handleChildBtnCallback?: () => void;
    ruleForm: any;
}>();
console.log(props, "=======props========");

const ROUTES: any = {
    boxMarkIndex: "/setUp/boxMark/details",
    subscriptionIndex: "/setUp/subscription/details"
};
// 提交事件
const handleBtnClick = () => {
    $router.push({
        path: ROUTES[routeName],
        query: { sjtag: Math.random() * 36, type: "add", data: null }
    });
};
//渲染按钮
const isBtnShow = computed(() => {
    const btnShowObj: any = {
        boxMarkIndex: false,
        subscriptionIndex: false
    };
    let btnName = routeName + "Add";
    btnShowObj[routeName] = authStore.btnsAuthList.includes(btnName);
    return btnShowObj;
});
</script>

<style scoped>
@import "../index.scss";
</style>
