43 lines
1.2 KiB
Vue
43 lines
1.2 KiB
Vue
<script setup>
|
|
import { useShareReport } from "@/composables/useShareReport";
|
|
|
|
const props = defineProps({
|
|
orderId: {
|
|
type: String,
|
|
default: "",
|
|
},
|
|
orderNo: {
|
|
type: String,
|
|
default: "",
|
|
},
|
|
isExample: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
disabled: {
|
|
type: Boolean,
|
|
default: false,
|
|
},
|
|
});
|
|
|
|
const { isLoading, handleShare } = useShareReport();
|
|
|
|
const onShare = () => {
|
|
handleShare(props.orderId, props.orderNo, props.isExample, props.disabled);
|
|
};
|
|
</script>
|
|
|
|
<template>
|
|
<div class="bg-primary-second border border-primary-second rounded-[40px] px-3 py-1 flex items-center justify-center cursor-pointer hover:bg-primary-600 transition-colors duration-200"
|
|
:class="{ 'opacity-50 cursor-not-allowed': isLoading || disabled }" @click="onShare">
|
|
<img src="@/assets/images/report/fx.png" alt="分享" class="w-4 h-4 mr-1" />
|
|
<span class="text-white text-sm font-medium">
|
|
{{ isLoading ? "生成中..." : (isExample ? "分享示例" : "分享报告") }}
|
|
</span>
|
|
</div>
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
|
/* 样式已通过 Tailwind CSS 类实现 */
|
|
</style>
|