<template>
	<view>
		<!-- 选择类巡检操作 -->
		<u-radio-group size="40" wrap="true" width="690">
			<u-radio :disabled="false" icon-size="28" label-size="28" active-color="orange" @change="radioChange" style="width: 100%;"
				v-for="(item, index) in list" :key="index" :name="item.id">
				{{item.name}}
			</u-radio>
		</u-radio-group>
	</view>
</template>

<script>
	export default {
		props: {
			// 巡检项规则
			options: {
				type: Array,
				default: []
			},
			//拍照选项项目巡检id
			scan_id: {
				type: Number
			},
		},
		data() {
			return {
				list: [],
				value: 0
			}
		},
		created() {
			this.setData()
		},
		methods: {
			setData() {
				this.options.forEach(j => {
					let obj = {}
					obj.name = j.optionName
					obj.id = j.id
					this.list.push(obj)
				})
			},
			submit() {
			let item = {
				id: this.scan_id,
				value: this.value
			} //提交数据
			this.$store.state.user.items.push(item)
			},
			//重置表单
			reset() {
				this.list = []
			},
			//选中某一radio时，由redio触发
			radioChange(e) {
				this.value = e
			},
			
		}
	}
</script>

<style>
</style>
