<template>
	<div>
		<div class="text" v-if="isTitle">审批方式</div>
		<el-radio-group
			v-model="methodValue"
			class="method_radio_group"
			@change="change"
		>
			<el-radio
				:label="item.value"
				v-for="item in method"
				:key="item.value"
				>{{ item.label }}
				<span>{{
					item.label == '会签'
						? '(需要所有审批人同意)'
						: '(一名审批人同意或拒绝即可)'
				}}</span></el-radio
			>
		</el-radio-group>
	</div>
</template>

<script setup>
import { ref, toRefs } from 'vue';
// const methodValue = ref('1');
const props = defineProps({
	handleRadioChange: {
		type: Function,
	},
	methodValue: {
		type: String,
	},
	isTitle: {
		type: Boolean,
	},
	method: {
		type: Array,
	},
});
const emits = defineEmits(['handleRadioChange']);
const { method, methodValue } = toRefs(props);
const change = (value) => {
	emits('handleRadioChange', value);
};
defineExpose({
	methodValue: methodValue.value,
});
</script>

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