<template>
	<v-row class="search-box" align="center" no-gutters>
		<v-col v-if="label" :cols="labelCols">
			<label for="" class="search-box-label">
				<v-icon x-small color="primary" class="mr-1">mdi-record-circle</v-icon>
				{{ label }}
			</label>
		</v-col>
		<v-col :cols="label ? textCols : ''">
			<v-radio-group
				v-model="selected"
				required:rules="radioRules"
				row
				hide-details
				dense
			>
				<v-radio
					label="태그"
					value="tag"
					:ripple="false"
					:color="isDarkMode ? '#1b74d7' : '#4777d9'"
					on-icon="mdi-record-circle"
				></v-radio>
				<v-radio
					label="검침개소"
					value="readPlc"
					:ripple="false"
					:color="isDarkMode ? '#1b74d7' : '#4777d9'"
					on-icon="mdi-record-circle"
				></v-radio>
				<v-radio
					label="공정"
					value="ecc"
					:ripple="false"
					:color="isDarkMode ? '#1b74d7' : '#4777d9'"
					on-icon="mdi-record-circle"
				></v-radio>
				<v-radio
					label="설비"
					value="eqpm"
					:ripple="false"
					:color="isDarkMode ? '#1b74d7' : '#4777d9'"
					on-icon="mdi-record-circle"
				></v-radio>
			</v-radio-group>
			<!-- @change="updateBlocCode($event)" -->
		</v-col>
	</v-row>
</template>

<script>
import { mapState, mapMutations, mapActions } from 'vuex';
import Utility from '~/plugins/utility';

export default {
	props: {
		parentPrgmId: {
			type: String,
			require: true,
		},
		labelCols: {
			type: Number,
			require: false,
			default: 4,
		},
		textCols: {
			type: Number,
			require: false,
			default: 7,
		},
	},
	data() {
		return {
			label: '기준',
			labelPrepend: true,
			//   selected:"CYC_DAY"
		};
	},
	computed: {
		...mapState({
			isDarkMode: 'isDarkMode',
			searchParam: state => state.pageData,
		}),
		selected: {
			get() {
				return this.searchParam[this.parentPrgmId].rdbStandard;
			},
			set(value) {
				return this.setPageData({ rdbStandard: value });
			},
		},
	},
	watch: {
		selected(value) {
			// 주기에 따른 오늘 기준 기본 날짜 세팅
			this.setDefaultDate(value);
		},
	},
	created() {
		// this.setDefaultDate(this.searchParam[this.parentPrgmId].cmCycle);
	},
	async mounted() {},
	methods: {
		...mapMutations({ setPageData: 'setPageData' }),
		...mapActions({}),
		setDefaultDate(value) {
			this.setPageData({ rdbStandard: value });
		},
	},
};
</script>

<style></style>
