| | |
| | | hint: ['label', 'field', 'type', 'blacklist', 'supField', 'message', 'span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], |
| | | split: ['label', 'type', 'marginTop', 'marginBottom', 'splitline', 'splitctrl', 'supField', 'opacity'], |
| | | formula: ['label', 'type', 'marginTop', 'marginBottom', 'splitline', 'supField', 'span', 'labelwidth', 'formula', 'eval', 'postfix'], |
| | | brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption', 'marginTop', 'marginBottom'], |
| | | brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'interception', 'extra', 'encryption', 'marginTop', 'marginBottom', 'contHeidht'], |
| | | funcvar: ['span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], |
| | | linkMain: ['readonly', 'required', 'hidden','declare', 'span', 'labelwidth', 'tooltip', 'interception', 'extra', 'place', 'marginTop', 'marginBottom'], |
| | | linkMain: ['readonly', 'required', 'hidden','declare', 'span', 'labelwidth', 'tooltip', 'interception', 'extra', 'place', 'marginTop', 'marginBottom', 'verifyVal'], |
| | | popSelect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'enter', 'dataSource', 'columns', 'primaryKey', 'order', 'controlField', 'laypage', 'onload', 'searchKey', 'showField', 'popWidth'], |
| | | vercode: ['label', 'field', 'type', 'blacklist', 'supField', 'readonly', 'required', 'hidden', 'span', 'labelwidth', 'tooltip', 'marginTop', 'marginBottom', 'placeholder', 'enter', 'smsId', 'phoneField', 'sendType'] |
| | | } |
| | |
| | | class MainSearch extends Component { |
| | | static propTpyes = { |
| | | formlist: PropTypes.any, |
| | | standardform: PropTypes.any, |
| | | fields: PropTypes.array, |
| | | card: PropTypes.object, |
| | | inputSubmit: PropTypes.any |
| | | } |
| | |
| | | if (this.record.interception === 'func') { |
| | | shows.push('func') |
| | | } |
| | | reTooltip.initval = '系统变量:@currentYear@(当前年份)' |
| | | } else if (type === 'number') { |
| | | reTypes.initval = 'number' |
| | | reRequired.initval = true |
| | |
| | | if (this.record.interception === 'func') { |
| | | shows.push('func') |
| | | } |
| | | } else if (type === 'brafteditor') { |
| | | if (this.record.interception === 'func') { |
| | | shows.push('func') |
| | | } |
| | | } else if (type === 'popSelect') { |
| | | if (this.record.enter === 'tab' || this.record.enter === 'sub') { |
| | | shows.push('tabField') |
| | |
| | | |
| | | if (value === 'brafteditor') { |
| | | this.record.encryption = 'true' |
| | | this.record.interception = 'false' |
| | | _fieldval.encryption = 'true' |
| | | _fieldval.interception = 'false' |
| | | } |
| | | |
| | | if (value === 'linkMain') { |
| | | this.record.hidden = 'true' |
| | | this.record.verifyVal = 'true' |
| | | _fieldval.hidden = 'true' |
| | | _fieldval.verifyVal = 'true' |
| | | } |
| | | |
| | | if (this.record.type === 'cascader' && value !== 'cascader') { |
| | |
| | | changeVal = (val, type) => { |
| | | if (type !== 'span' || ![24, 12, 8, 6].includes(val)) return |
| | | |
| | | const { standardform } = this.props |
| | | const { card, fields } = this.props |
| | | |
| | | if (!standardform || ![24, 12, 8, 6].includes(standardform.span) || !standardform.labelwidth) return |
| | | let index = fields.findIndex(item => card.uuid === item.uuid) |
| | | let stform = fields[index - 1] |
| | | |
| | | if (!stform || ![24, 12, 8, 6].includes(stform.span) || !stform.labelwidth) return |
| | | |
| | | let labelwidth = null |
| | | |
| | | if (standardform.span === val) { |
| | | labelwidth = standardform.labelwidth |
| | | } else if (standardform.span > val) { |
| | | if (stform.span === val) { |
| | | labelwidth = stform.labelwidth |
| | | } else if (stform.span > val) { |
| | | labelwidth = 33.3 |
| | | } else { |
| | | switch(standardform.span) { |
| | | switch(stform.span) { |
| | | case 12: |
| | | labelwidth = 16.2 |
| | | break; |
| | |
| | | extra = <span className="add-resource-empty" onClick={this.handleEmpty}>空</span> |
| | | } |
| | | if (item.placeholder) { |
| | | className = 'show-public-var' |
| | | extra = <><span className="resource-public-var">{item.placeholder}</span>{extra}</> |
| | | } |
| | | |
| | |
| | | return fields |
| | | } |
| | | |
| | | transfer = (options) => { |
| | | if (options.length === 0) return options |
| | | // transfer = (options) => { |
| | | // if (options.length === 0) return options |
| | | |
| | | let isNumber = true |
| | | options.forEach(item => { |
| | | if (!item.Value || isNaN(item.Value)) { |
| | | isNumber = false |
| | | } |
| | | }) |
| | | // let isNumber = true |
| | | // options.forEach(item => { |
| | | // if (!item.Value || isNaN(item.Value)) { |
| | | // isNumber = false |
| | | // } |
| | | // }) |
| | | |
| | | if (isNumber) { |
| | | return options.map(item => { |
| | | item.Value = +item.Value |
| | | return item |
| | | }) |
| | | } else { |
| | | return options.map(item => { |
| | | item.Value = item.Value + '' |
| | | return item |
| | | }) |
| | | } |
| | | } |
| | | // if (isNumber) { |
| | | // return options.map(item => { |
| | | // item.Value = +item.Value |
| | | // return item |
| | | // }) |
| | | // } else { |
| | | // return options.map(item => { |
| | | // item.Value = item.Value + '' |
| | | // return item |
| | | // }) |
| | | // } |
| | | // } |
| | | |
| | | transferCard = (options) => { |
| | | if (options.length === 0) return options |
| | | // transferCard = (options) => { |
| | | // if (options.length === 0) return options |
| | | |
| | | let isNumber = true |
| | | options.forEach(item => { |
| | | if (!/^([0-9]|[1-9]\d{0,2})$/.test(item.$value)) { |
| | | isNumber = false |
| | | } |
| | | }) |
| | | // let isNumber = true |
| | | // options.forEach(item => { |
| | | // if (!/^([0-9]|[1-9]\d{0,2})$/.test(item.$value)) { |
| | | // isNumber = false |
| | | // } |
| | | // }) |
| | | |
| | | if (isNumber) { |
| | | return options.map(item => { |
| | | item.$value = +item.$value |
| | | return item |
| | | }) |
| | | } else { |
| | | return options.map(item => { |
| | | item.$value = item.$value + '' |
| | | return item |
| | | }) |
| | | } |
| | | } |
| | | // if (isNumber) { |
| | | // return options.map(item => { |
| | | // item.$value = +item.$value |
| | | // return item |
| | | // }) |
| | | // } else { |
| | | // return options.map(item => { |
| | | // item.$value = item.$value + '' |
| | | // return item |
| | | // }) |
| | | // } |
| | | // } |
| | | |
| | | handleConfirm = (fields) => { |
| | | const { card } = this.props |
| | | handleConfirm = () => { |
| | | const { card, fields } = this.props |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | |
| | | if (['multiselect', 'select', 'link', 'radio', 'checkbox'].includes(values.type)) { |
| | | if (values.resourceType === '0') { |
| | | values.options = values.options || [] |
| | | values.options = values.options.map(item => { |
| | | item.Value = item.Value + '' |
| | | return item |
| | | }) |
| | | values.dataSource = '' |
| | | let type = values.type |
| | | if (values.type === 'radio' && values.linkField) { |
| | | type = 'link' |
| | | } |
| | | |
| | | values.options = this.transfer(values.options) |
| | | // values.options = this.transfer(values.options) |
| | | |
| | | if (values.options.filter(op => op.Text === '').length > 0) { |
| | | notification.warning({ |
| | |
| | | let linkSubFields = values.linkSubField || [] |
| | | values.options = values.options.map(m => { |
| | | m.ParentID = m.ParentID || '' |
| | | m.$value = m.$value + '' |
| | | |
| | | linkSubFields.forEach(n => { |
| | | m[n] = m[n] || '' |
| | |
| | | return m |
| | | }) |
| | | |
| | | values.options = this.transferCard(values.options) |
| | | // values.options = this.transferCard(values.options) |
| | | |
| | | let type = values.type |
| | | if (values.linkField) { |
| | |
| | | |
| | | window.GLOB.formId = card.uuid |
| | | |
| | | if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(values.type) && values.resourceType === '1' && values.dataSource) { |
| | | if (['select', 'multiselect', 'link', 'checkbox', 'radio', 'checkcard'].includes(values.type) && values.resourceType === '1' && values.database !== 'sso' && values.dataSource) { |
| | | let _option = Utils.getSelectQueryOptions(values) |
| | | |
| | | let sql = `declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) |
| | | ${_option.sql}` |
| | | |
| | | // LoginUID|SessionUid|UserID|Appkey 已替换 |
| | | // LoginUID|SessionUid|UserID|Appkey|lang 已替换 |
| | | sql = sql.replace(/@\$|\$@/ig, '') |
| | | |
| | | let rduri = '' |
| | | if (window.GLOB.mainSystemApi && values.database === 'sso') { |
| | | rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | resolve({values, loading: true, promise: () => new Promise((resolve, reject) => { |
| | | Api.sDebug(sql, rduri).then(result => { |
| | | Api.sDebug(sql).then(result => { |
| | | if (result.status || result.ErrCode === '-2') { |
| | | resolve() |
| | | } else { |