|
@@ -16,7 +16,7 @@ import {PropertyDescription} from "../../PropertyDescription";
|
|
export default function () {
|
|
export default function () {
|
|
|
|
|
|
const cc = Ext.form.field.Date.prototype.constructor
|
|
const cc = Ext.form.field.Date.prototype.constructor
|
|
- const {initComponent, getValue} = Ext.form.field.Date.prototype
|
|
|
|
|
|
+ const {initComponent, getValue, valueToRaw} = Ext.form.field.Date.prototype
|
|
Ext.form.field.Date.override({
|
|
Ext.form.field.Date.override({
|
|
constructor(config) {
|
|
constructor(config) {
|
|
const newConfig = _.defaultsDeep({
|
|
const newConfig = _.defaultsDeep({
|
|
@@ -36,7 +36,6 @@ export default function () {
|
|
return nv
|
|
return nv
|
|
},
|
|
},
|
|
|
|
|
|
-
|
|
|
|
initComponent() {
|
|
initComponent() {
|
|
const that = this
|
|
const that = this
|
|
const toggle = function (e) {
|
|
const toggle = function (e) {
|
|
@@ -66,6 +65,19 @@ export default function () {
|
|
destory() {
|
|
destory() {
|
|
$(this.el.dom).off('click', toggle.bind(this))
|
|
$(this.el.dom).off('click', toggle.bind(this))
|
|
},
|
|
},
|
|
|
|
+ change: {
|
|
|
|
+ fn(sender) {
|
|
|
|
+ const value = sender.getRawValue()
|
|
|
|
+ if (/^\d{8}$/.test(value)) {
|
|
|
|
+ const newValue = [
|
|
|
|
+ value.substr(0, 4),
|
|
|
|
+ value.substr(4, 2),
|
|
|
|
+ value.substr(6, 2)
|
|
|
|
+ ].join('-')
|
|
|
|
+ sender.setValue(newValue)
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ }
|
|
// focus: {
|
|
// focus: {
|
|
// // 获得焦点后自动下拉
|
|
// // 获得焦点后自动下拉
|
|
// fn(sender) {
|
|
// fn(sender) {
|