<template>
|
<view class="oi-form-select">
|
<!-- 下拉选择框 -->
|
<uni-data-picker v-if="model" class="data-picker" :class="data.disabled?'input-disabled':''"
|
v-model="model[data.fieldId]" :localdata="data.useDict ? data.dict : data.selections" @change="onChange"
|
:readonly="data.disabled" :clear-icon="false" :popup-title="data.label"></uni-data-picker>
|
<uni-data-picker v-else class="data-picker" :class="data.disabled?'input-disabled':''" v-model="data.value"
|
:localdata="data.useDict ? data.dict : data.selections" @change="onChange" :readonly="data.disabled"
|
:clear-icon="false" :popup-title="data.label"></uni-data-picker>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
name: "OIFormSelect",
|
props: {
|
data: {
|
type: Object,
|
required: true,
|
},
|
model: Object,
|
},
|
methods: {
|
onChange(e) {
|
this.$emit("on-change", e)
|
},
|
|
}
|
};
|
</script>
|
|
<style lang="less">
|
.oi-form-select {
|
width: 100%;
|
|
.data-picker {
|
width: 100%;
|
background: #FFF;
|
border-radius: 0 !important;
|
color: #2d8cf0;
|
/* padding: 10rpx 8rpx 12rpx; */
|
font-size: 34rpx;
|
font-family: inherit;
|
box-shadow: none !important;
|
transition-duration: 0.1s;
|
margin-top: 0rpx;
|
/* vertical-align: 10px; */
|
vertical-align: middle;
|
|
.uni-select {
|
border: 1px solid #ccc;
|
border-radius: 0 !important;
|
color: #2d8cf0;
|
}
|
|
.uni-select__input-text {
|
color: #2d8cf0;
|
}
|
}
|
|
|
|
.input-disabled {
|
background-color: #f3f3f3 !important;
|
}
|
}
|
|
|
</style>
|