| | |
| | | } |
| | | |
| | | formlist = formlist.filter(item => { |
| | | if (item.type === 'hint') { |
| | | if (item.field && data[item.field.toLowerCase()]) { |
| | | item.message = data[item.field.toLowerCase()] |
| | | } |
| | | delete item.field |
| | | } |
| | | |
| | | if (item.supField) { // 多层表单控制 |
| | | if (['hint', 'split', 'formula'].includes(item.type)) { |
| | | item.field = item.uuid |
| | | fieldMap.set(item.field, item) |
| | | } |
| | | let supvals = [] |
| | | if (item.supvalue) { |
| | | item.supvalue.split(',').forEach(val => { |
| | |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'split' || item.type === 'formula') return true |
| | | if (item.type === 'hint') { |
| | | if (item.field && data[item.field.toLowerCase()]) { |
| | | item.message = data[item.field.toLowerCase()] |
| | | } |
| | | delete item.field |
| | | return true |
| | | } else if (item.type === 'date') { |
| | | if (['hint', 'split', 'formula'].includes(item.type)) return true |
| | | if (item.type === 'date') { |
| | | item.precision = item.precision || 'day' |
| | | } else if (item.type === 'datetime') { |
| | | item.type = 'date' |
| | |
| | | item.readin = item.readin !== 'false' && item.readin !== 'top' |
| | | item.readonly = check || item.readonly === 'true' |
| | | item.writein = item.writein !== 'false' |
| | | item.defHidden = item.hidden === 'true' |
| | | item.hidden = item.hidden === 'true' |
| | | item.fieldlength = item.fieldlength || 50 |
| | | |
| | |
| | | newval = item.openVal |
| | | } else { |
| | | newval = item.closeVal |
| | | } |
| | | } else if (item.type === 'popSelect') { |
| | | if (newval && newval !== '$empty') { |
| | | item.showValue = data[item.showField.toLowerCase()] || '' |
| | | } else { |
| | | item.showValue = '' |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | let _hidden = false |
| | | |
| | | if (supItem.hidden) { |
| | | if (supItem.hidden && !supItem.defHidden) { |
| | | _hidden = true |
| | | } else { |
| | | let box = [...item.values] |
| | |
| | | cell.labelCol = {style: {width: cell.labelwidth + '%'}} |
| | | cell.wrapperCol = {style: {width: (100 - cell.labelwidth) + '%'}} |
| | | } |
| | | if (!cell.field || !fieldMap.has(cell.field)) return cell |
| | | if (!cell.field || !fieldMap.has(cell.field) || ['hint', 'split', 'formula'].includes(cell.type)) return cell |
| | | let item = fieldMap.get(cell.field) |
| | | |
| | | // 下级表单控制-字段写入 |
| | |
| | | item.supInitVal = '' |
| | | |
| | | if (fieldMap.has(item.linkField)) { |
| | | item.supInitVal = fieldMap.get(item.linkField).initval || '' |
| | | let supitem = fieldMap.get(item.linkField) |
| | | item.supInitVal = supitem.initval || '' |
| | | if (supitem.$first) { |
| | | item.$resetSup = true |
| | | } |
| | | } else if (data.hasOwnProperty(item.linkField.toLowerCase())) { |
| | | item.supInitVal = data[item.linkField.toLowerCase()] |
| | | } |
| | |
| | | } |
| | | |
| | | if (param.LText) { |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | if (window.GLOB.execType === 'x') { |
| | | param.exec_type = 'x' |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText, param.exec_type) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.secretkey = Utils.encrypt(window.GLOB.execType === 'x' ? '' : param.LText, param.timestamp) |
| | | |
| | | if (window.GLOB.mkHS) { // 云端数据验证 |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | |
| | | } |
| | | |
| | | if (mainparam.LText) { |
| | | mainparam.LText = Utils.formatOptions(mainparam.LText) |
| | | if (window.GLOB.execType === 'x') { |
| | | mainparam.exec_type = 'x' |
| | | } |
| | | |
| | | mainparam.LText = Utils.formatOptions(mainparam.LText, mainparam.exec_type) |
| | | mainparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | mainparam.secretkey = Utils.encrypt(mainparam.LText, mainparam.timestamp) |
| | | mainparam.secretkey = Utils.encrypt(window.GLOB.execType === 'x' ? '' : mainparam.LText, mainparam.timestamp) |
| | | |
| | | if (window.GLOB.mainSystemApi) { |
| | | mainparam.rduri = window.GLOB.mainSystemApi |
| | |
| | | if (window.GLOB.debugger) { |
| | | console.info(param.LText) |
| | | } |
| | | |
| | | if (window.GLOB.execType === 'x') { |
| | | param.exec_type = 'x' |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.LText = Utils.formatOptions(param.LText, param.exec_type) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.secretkey = Utils.encrypt(window.GLOB.execType === 'x' ? '' : param.LText, param.timestamp) |
| | | |
| | | if (form.database === 'sso' && window.GLOB.mainSystemApi) { |
| | | param.rduri = window.GLOB.mainSystemApi |
| | |
| | | |
| | | // if (item.type === 'link') { |
| | | if (item.linkField) { |
| | | item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal || option.value === '') |
| | | let supInitVal = item.supInitVal |
| | | if (item.$resetSup) { |
| | | supInitVal = this.record[item.linkField] |
| | | } |
| | | item.options = item.oriOptions.filter(option => option.ParentID === supInitVal || option.value === '') |
| | | // } else if (['select', 'radio', 'checkbox', 'checkcard', 'multiselect'].includes(item.type)) { |
| | | } else { |
| | | item.options = item.oriOptions |
| | |
| | | if (item.hidden) return |
| | | |
| | | if (item.type === 'split') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <p className="mk-form-split-line" style={item.style}>{item.label}</p> |
| | | </Col> |
| | | ) |
| | | if (item.opacity === 'false') { |
| | | fields.push( |
| | | <div key={index}></div> |
| | | ) |
| | | } else { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <p className="mk-form-split-line" style={item.style}>{item.label}</p> |
| | | </Col> |
| | | ) |
| | | } |
| | | } else if (item.type === 'hint') { |
| | | fields.push( |
| | | <Col span={item.span || 24} key={index}> |
| | |
| | | } else if (item.type === 'radio') { |
| | | content = (<MKRadio config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>) |
| | | } else if (item.type === 'date' || item.type === 'datemonth') { |
| | | content = (<MKDatePicker config={item} onChange={(val) => this.recordChange({[item.field]: val})} />) |
| | | content = (<MKDatePicker config={item} onChange={(val) => this.recordChange({[item.field]: val})} onSubmit={this.props.inputSubmit}/>) |
| | | } else if (item.type === 'fileupload') { |
| | | className = item.readonly ? 'readonly' : '' |
| | | className += item.fileType === 'picture-card' ? ' file-upload' : '' |
| | |
| | | let record = {...this.record, ...values} |
| | | |
| | | formlist.forEach(item => { |
| | | if (!item.field) return |
| | | if (!item.field || ['hint', 'split', 'formula'].includes(item.type)) return |
| | | |
| | | let _item = { |
| | | type: item.type, |
| | |
| | | console.warn(e) |
| | | _item.value = '' |
| | | } |
| | | } else if (item.interception === 'charTure') { |
| | | let str = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | let result = '' |
| | | for (let i = 0 ; i < str.length; i++) { |
| | | let code = str.charCodeAt(i) |
| | | if (code >= 65281 && code <= 65373) { |
| | | result += String.fromCharCode(str.charCodeAt(i) - 65248) |
| | | } else if (code === 12288) { |
| | | result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32) |
| | | } else { |
| | | result += str.charAt(i) |
| | | } |
| | | } |
| | | _item.value = result |
| | | } else { |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | } |