sk_fems_ui commit
This commit is contained in:
119
components/common/select/SelectMttList.vue
Normal file
119
components/common/select/SelectMttList.vue
Normal file
@ -0,0 +1,119 @@
|
||||
<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 small color="primary" class="mr-1">mdi-record-circle</v-icon>
|
||||
{{ label }}
|
||||
</label>
|
||||
</v-col>
|
||||
<v-col :cols="label ? textCols : ''">
|
||||
<v-select
|
||||
v-model="selectValue"
|
||||
:items="searchParam[parentPrgmId][dataKey + 'List']"
|
||||
item-text="mttNm"
|
||||
item-value="mttCd"
|
||||
solo
|
||||
append-icon="mdi-chevron-down"
|
||||
class="v-select__custom"
|
||||
outlined
|
||||
hide-details
|
||||
></v-select>
|
||||
<!-- @change="updateBlocCode($event)" -->
|
||||
</v-col>
|
||||
</v-row>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapMutations, mapActions } from 'vuex';
|
||||
export default {
|
||||
props: {
|
||||
parentPrgmId: {
|
||||
type: String,
|
||||
require: true,
|
||||
},
|
||||
dataKey: {
|
||||
type: String,
|
||||
require: true,
|
||||
},
|
||||
autoLoad: {
|
||||
type: Boolean,
|
||||
require: false,
|
||||
default: true,
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
require: false,
|
||||
default: null,
|
||||
},
|
||||
sendParam: {
|
||||
type: Object,
|
||||
require: false,
|
||||
default: () => {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
addAll: {
|
||||
type: Boolean,
|
||||
require: false,
|
||||
default: false,
|
||||
},
|
||||
textCols: {
|
||||
type: Number,
|
||||
require: false,
|
||||
default: 7,
|
||||
},
|
||||
labelCols: {
|
||||
type: Number,
|
||||
require: false,
|
||||
default: 4,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// label: "검침대상유형",
|
||||
// labelPrepend: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
...mapState({
|
||||
searchParam: state => state.pageData,
|
||||
}),
|
||||
mySendMttParam() {
|
||||
return this.searchParam[this.parentPrgmId]['sendMttParam'];
|
||||
},
|
||||
selectValue: {
|
||||
get() {
|
||||
return this.searchParam[this.parentPrgmId][this.dataKey];
|
||||
},
|
||||
set(value) {
|
||||
return this.setPageData({ [this.dataKey]: value });
|
||||
},
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
mySendMttParam() {
|
||||
this.getMttList({
|
||||
dataKey: this.dataKey,
|
||||
params: this.searchParam[this.parentPrgmId]['sendMttParam'],
|
||||
});
|
||||
// this.selectValue(this.searchParam[this.parentPrgmId].mttCdList[0].mttCd);
|
||||
},
|
||||
},
|
||||
created() {
|
||||
if (this.searchParam[this.parentPrgmId]['sendMttParam'].mttTp!=""){
|
||||
this.getMttList({
|
||||
dataKey: this.dataKey,
|
||||
params: this.searchParam[this.parentPrgmId]['sendMttParam'],
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
...mapMutations({ setPageData: 'setPageData' }),
|
||||
...mapActions({
|
||||
getMttList: 'modules/search/getMttList',
|
||||
}),
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style></style>
|
Reference in New Issue
Block a user