12345678910111213141516171819202122232425262728293031 |
- import _ from 'lodash'
- import {baseConfig} from "./base";
- import {text} from "../Defaults";
- export default function () {
- const cc = Ext.form.field.ComboBox.prototype.constructor
- const {initComponent} = Ext.form.field.Text.prototype
- Ext.form.field.Text.override({
- 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>'
- ];
- }
- initComponent.call(this)
- }
- });
- }
|