|
@@ -1,19 +1,31 @@
|
|
|
import _ from 'lodash'
|
|
|
-import $ from 'jquery'
|
|
|
+import {baseConfig} from "./base";
|
|
|
+import {text} from "../Defaults";
|
|
|
|
|
|
export default function () {
|
|
|
- /**
|
|
|
- * 改变必填项之前加星号
|
|
|
- */
|
|
|
- const t1 = Ext.form.field.Text.prototype.initComponent
|
|
|
+
|
|
|
+ const cc = Ext.form.field.ComboBox.prototype.constructor
|
|
|
+ const {initComponent} = Ext.form.field.Text.prototype
|
|
|
Ext.form.field.Text.override({
|
|
|
- initComponent(config) {
|
|
|
+ constructor(config) {
|
|
|
+ const newConfig = _.defaultsDeep({
|
|
|
+ // 强制属性
|
|
|
+ }, baseConfig(config, 'col-item'), config, text)
|
|
|
+
|
|
|
+ cc.call(this, newConfig)
|
|
|
+ },
|
|
|
+
|
|
|
+ initComponent() {
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 改变必填项之前加星号
|
|
|
+ */
|
|
|
if (this.allowBlank === false || this.validateBlank === true) {
|
|
|
this.beforeLabelTextTpl = [
|
|
|
'<span style="color:red;font-weight:bold" data-qtip="必填选项">*</span>'
|
|
|
];
|
|
|
}
|
|
|
- t1.call(this, config)
|
|
|
+ initComponent.call(this)
|
|
|
}
|
|
|
});
|
|
|
}
|