| | |
| | | :placeholder="placeholder" |
| | | > |
| | | <view |
| | | v-show="!readOnly" |
| | | v-show="!readOnly && !showClear" |
| | | class="at-icon at-icon-chevron-right" |
| | | /> |
| | | <view |
| | | v-show="showClear" |
| | | class="at-icon at-icon-close" |
| | | @tap.stop="evt => handleClear()" |
| | | ></view> |
| | | </AtInput> |
| | | </CDateRangeAction> |
| | | <CDateTimeAction |
| | |
| | | :placeholder="placeholder" |
| | | > |
| | | <view |
| | | v-show="!readOnly" |
| | | v-show="!readOnly && !showClear" |
| | | class="at-icon at-icon-chevron-right" |
| | | /> |
| | | <view |
| | | v-show="showClear" |
| | | class="at-icon at-icon-close" |
| | | @tap.stop="evt => handleClear()" |
| | | ></view> |
| | | </AtInput> |
| | | </CDateTimeAction> |
| | | <view v-else-if="mode==='date'"> |
| | |
| | | :placeholder="placeholder" |
| | | > |
| | | <view |
| | | v-show="!readOnly" |
| | | v-show="!readOnly && !showClear" |
| | | class="at-icon at-icon-chevron-right" |
| | | /> |
| | | <view |
| | | v-show="showClear" |
| | | class="at-icon at-icon-close" |
| | | @tap.stop="evt => handleClear()" |
| | | ></view> |
| | | </AtInput> |
| | | </picker> |
| | | </view> |
| | |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | // 允许清除 |
| | | allowClear: { |
| | | type: Boolean, |
| | | default: false, |
| | | }, |
| | | }, |
| | | data() { |
| | | const year = new Date().getFullYear(); |
| | |
| | | pickerEnd: year + 30 + '-12-31', |
| | | }; |
| | | }, |
| | | computed: {}, |
| | | computed: { |
| | | showClear() { |
| | | if (!this.allowClear) { |
| | | return false; |
| | | } |
| | | return !!this.itemRes.formData[this.itemRes.name]; |
| | | }, |
| | | }, |
| | | methods: { |
| | | handleChange(val) { |
| | | this.itemRes.onChange(val); |
| | | }, |
| | | handleClear() { |
| | | this.itemRes.onChange(''); |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | }; |
| | |
| | | font-size: 48px; |
| | | color: #ccc; |
| | | } |
| | | .at-icon-close { |
| | | padding: 8px; |
| | | margin: 4px; |
| | | color: #fff; |
| | | font-size: 24px; |
| | | line-height: 24px; |
| | | background-color: #ccc; |
| | | border-radius: 50%; |
| | | &::after { |
| | | @include position(absolute, -24px n n 0); |
| | | width: 90px; |
| | | height: 90px; |
| | | background-color: rgba(#000, 0); |
| | | content: ""; |
| | | } |
| | | } |
| | | } |
| | | .at-input__icon { |
| | | display: none; |