| | |
| | | |
| | | const MKCheckCard = asyncComponent(() => import('./mkCheckCard')) |
| | | const MKSwitch = asyncComponent(() => import('./mkSwitch')) |
| | | const MKCheck = asyncComponent(() => import('./mkCheck')) |
| | | const MKCheckbox = asyncComponent(() => import('./mkCheckbox')) |
| | | const MKRadio = asyncComponent(() => import('./mkRadio')) |
| | | const MKDatePicker = asyncComponent(() => import('./mkDatePicker')) |
| | |
| | | delete item.style.marginRight |
| | | } |
| | | |
| | | if (item.type === 'split' && item.splitctrl) { |
| | | if (data.hasOwnProperty(item.splitctrl.toLowerCase()) && data[item.splitctrl.toLowerCase()] === '') { |
| | | return false |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'split' || item.type === 'formula') return true |
| | | if (item.type === 'hint') { |
| | | if (item.field && data[item.field.toLowerCase()]) { |
| | |
| | | } |
| | | delete item.field |
| | | return true |
| | | } else if (item.type === 'date') { // 时间搜索 |
| | | } else if (item.type === 'date') { |
| | | item.precision = item.precision || 'day' |
| | | } else if (item.type === 'datetime') { |
| | | item.type = 'date' |
| | | item.precision = 'second' |
| | | } |
| | | |
| | | if (!item.field || !['text', 'number', 'switch', 'rate', 'select', 'link', 'cascader', 'linkMain', 'funcvar', 'date', 'datemonth', 'radio', 'checkbox', 'checkcard', 'fileupload', 'textarea', 'multiselect', 'brafteditor', 'color', 'vercode'].includes(item.type)) return false |
| | | if (!item.field || !['text', 'number', 'switch', 'check', 'rate', 'select', 'link', 'cascader', 'linkMain', 'funcvar', 'date', 'datemonth', 'radio', 'checkbox', 'checkcard', 'fileupload', 'textarea', 'multiselect', 'brafteditor', 'color', 'vercode'].includes(item.type)) return false |
| | | |
| | | if (/^\s+$/.test(item.label)) { |
| | | item.style = item.style || {} |
| | | item.style.color = 'transparent' |
| | | item.style.opacity = 0 |
| | | item.style.width = 1 |
| | | item.style.display = 'inline-block' |
| | | } |
| | | |
| | | // 数据自动填充 |
| | |
| | | }) |
| | | } |
| | | item.oriOptions = fromJS(item.options).toJS() |
| | | |
| | | if (item.empty === 'hidden' && item.oriOptions.length === 0) { |
| | | item.hidden = true |
| | | } |
| | | if (item.type === 'checkcard' && item.readonly && item.unchecked === 'hidden') { |
| | | let selectKeys = item.initval |
| | | if (item.multiple === 'true') { |
| | | selectKeys = selectKeys ? selectKeys.split(',') : [] |
| | | item.options = item.options.filter(item => selectKeys.includes(item.$value)) |
| | | } else { |
| | | item.options = item.options.filter(item => selectKeys === item.$value) |
| | | } |
| | | item.oriOptions = fromJS(item.options).toJS() |
| | | if (item.options.length === 0) { |
| | | item.hidden = true |
| | | } |
| | | } |
| | | } |
| | | |
| | | let newval = '$empty' |
| | |
| | | if (newval === '$empty' && item.initval) { |
| | | newval = moment().subtract(item.initval, 'month').format('YYYY-MM') |
| | | } |
| | | } else if (item.type === 'switch') { // 开关只接收固定值 |
| | | } else if (item.type === 'switch' || item.type === 'check') { // 开关勾选框只接收固定值 |
| | | if (newval !== '$empty' && (newval === item.closeVal || newval === item.openVal)) { |
| | | |
| | | } else if (item.initval === true) { |
| | |
| | | |
| | | let cell = fieldMap.get(item.field) |
| | | |
| | | if (cell.hidden) return |
| | | |
| | | // if (cell.hidden) return |
| | | |
| | | if (supItem.hidden || !item.values.includes(supItem.initval)) { |
| | | cell.hidden = true |
| | | if (cell.empty === 'hidden') { |
| | | cell.$hidden = true |
| | | } |
| | | fieldMap.set(item.field, cell) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (['select', 'link', 'radio'].includes(item.type)) { // 选中第一项 |
| | | if (typeof(item.initval) === 'string' && item.initval.indexOf('$first') > -1) { |
| | | if (/^\s*\$first\s*$/.test(item.initval)) { |
| | | item.$first = true |
| | | item.initval = '' |
| | | } |
| | |
| | | let cache = action.setting.cache !== 'false' |
| | | let debug = window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud') |
| | | |
| | | let _sql = `Declare @mk_organization nvarchar(512) select @mk_organization='${sessionStorage.getItem('organization') || ''}'\n` |
| | | let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n` |
| | | let _sso = _sql |
| | | |
| | | deForms.forEach(item => { |
| | |
| | | improveSimpleActionForm = (deForms) => { |
| | | let cache = this.props.action.setting.cache !== 'false' |
| | | let debug = window.GLOB.debugger === true || (window.debugger === true && options.sysType !== 'cloud') |
| | | let _sql = `Declare @mk_organization nvarchar(512) select @mk_organization='${sessionStorage.getItem('organization') || ''}'\n` |
| | | let _sql = `Declare @mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20) select @mk_departmentcode='${sessionStorage.getItem('departmentcode') || ''}',@mk_organization='${sessionStorage.getItem('organization') || ''}',@mk_user_type='${sessionStorage.getItem('mk_user_type') || ''}'\n` |
| | | |
| | | let deffers = deForms.map((form, index) => { |
| | | let param = { |
| | |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (item.empty === 'hidden' && item.oriOptions.length > 0 && !item.$hidden) { |
| | | item.hidden = false |
| | | } |
| | | if (item.type === 'checkcard' && item.readonly && item.unchecked === 'hidden') { |
| | | let selectKeys = item.initval |
| | | if (item.multiple === 'true') { |
| | | selectKeys = selectKeys ? selectKeys.split(',') : [] |
| | | item.options = item.options.filter(item => selectKeys.includes(item.$value)) |
| | | } else { |
| | | item.options = item.options.filter(item => selectKeys === item.$value) |
| | | } |
| | | item.oriOptions = fromJS(item.options).toJS() |
| | | if (item.options.length === 0) { |
| | | item.hidden = true |
| | | } else { |
| | | item.hidden = false |
| | | } |
| | | } |
| | | } |
| | | |
| | | return item |
| | |
| | | let m = map.get(cell.field) |
| | | m.hidden = current.hidden || !cell.values.includes(val) |
| | | |
| | | if (m.empty === 'hidden' && m.oriOptions.length === 0) { |
| | | m.hidden = true |
| | | } |
| | | |
| | | if (m.hidden) { |
| | | m.initval = this.record[m.field] |
| | | } |
| | |
| | | |
| | | formlist.forEach((item, index) => { |
| | | if (item.hidden) return |
| | | if (item.empty === 'hidden' && item.options.length === 0) return |
| | | |
| | | if (item.type === 'split') { |
| | | fields.push( |
| | |
| | | content = (<MKCheckCard config={item} onChange={(val, other) => this.recordChange({[item.field]: val, ...other}, item)}/>) |
| | | } else if (item.type === 'switch') { |
| | | content = (<MKSwitch config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>) |
| | | } else if (item.type === 'check') { |
| | | content = (<MKCheck config={item} onChange={(val) => this.recordChange({[item.field]: val}, item)}/>) |
| | | } else if (item.type === 'checkbox') { |
| | | content = (<MKCheckbox config={item} onChange={(val) => this.recordChange({[item.field]: val})}/>) |
| | | } else if (item.type === 'radio') { |
| | |
| | | _item.value = _item.value.slice(-item.fieldlength) |
| | | } |
| | | } |
| | | } else if (item.type.indexOf('date') > -1) { |
| | | if (item.declareType === 'nvarchar(50)') { |
| | | _item.type = 'text' |
| | | } |
| | | } else if (item.type === 'datemonth') { |
| | | _item.type = 'text' |
| | | } else if (item.type === 'date') { |
| | | _item.type = item.declareType === 'nvarchar(50)' ? 'text' : 'date' |
| | | } else if (item.type === 'vercode') { |
| | | _item.type = 'text' |
| | | forms.push({ |