Commit 9a668aa2 authored by 李俊赕's avatar 李俊赕

选择时间组件

parent 7bdee353
......@@ -2,32 +2,22 @@
<div class="input-item" >
<div class="label">{{item.label}}</div>
<div class="required" v-show="item.required">*</div>
<div class="input-box" @click="popupVisible = true">
<div class="input-box" @click="openShadow">
<div class="input" :class="['input',!item.value ? 'grey' : '']">{{getName(item.value) || '请选择'}}</div> <!-- <input class="input" v-model="{{item.value | getName}}" readonly placeholder="请选择" /> -->
</div>
<i class="mint-cell-allow-right" @click="popupVisible = true"></i>
<mt-popup
v-model="popupVisible"
position="bottom">
<div class="select-con">
<div class="select-title">
<span class="btn" @click="cancel">取消</span>
<span class="btn confirm" @click="confirmSelect">确定</span>
</div>
<div class="list">
<mt-radio
v-model="value"
:options="item.settings || []">
</mt-radio>
</div>
</div>
</mt-popup>
<i class="mint-cell-allow-right" @click="openShadow"></i>
<mt-datetime-picker
ref="picker"
type="date"
v-model="value"
@confirm="handleConfirm">
</mt-datetime-picker>
</div>
</template>
<script>
export default {
name: 'XhSelect',
name: 'XhDate',
data() {
return {
popupVisible: false,
......@@ -54,6 +44,10 @@ export default {
},
methods: {
openShadow() {
this.popupVisible = true
this.$refs.picker.open()
},
getName(value) {
let result = ''
if (!value) {
......@@ -71,9 +65,9 @@ export default {
cancel() {
this.popupVisible = false
},
confirmSelect() {
handleConfirm() {
this.item.value = this.value
this.popupVisible = false
// this.popupVisible = false
}
}
}
......
......@@ -5,3 +5,5 @@ export { default as XhMultipleSelect } from './XhMultipleSelect'
export { default as XhFiles } from './XhFiles'
export { default as XhSwitch } from './XhSwitch'
export { default as XhServiceMore } from './XhServiceMore'
export { default as XhDate } from './XhDate'
......@@ -188,7 +188,7 @@ const installData = [{
}, {
fieldName: 'installComfirmTime',
label: '安装确认时间',
inputType: 'select',
inputType: 'date',
required: true,
settings: [{ label: '一致', value: 'Y' }, { label: '不一致', value: 'N' }]
}, {
......
......@@ -48,7 +48,7 @@ import {
XhInput,
XhSelect,
XhMultipleSelect,
XhFiles, XhSwitch, XhTextarea, XhServiceMore
XhFiles, XhSwitch, XhTextarea, XhServiceMore, XhDate
} from '../components/index.js'
import { getData } from './data.js'
export default {
......@@ -63,7 +63,8 @@ export default {
XhFiles,
XhSwitch,
XhTextarea,
XhServiceMore
XhServiceMore,
XhDate
},
data() {
return {
......@@ -138,6 +139,9 @@ export default {
case 'service-more':
result = 'XhServiceMore'
break
case 'date':
result = 'XhDate'
break
}
return result
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment