| | |
| | | |
| | | if (item.advanced && !forbid) { |
| | | _setting.showAdv = true |
| | | if (!['group', 'check', 'switch'].includes(item.type)) { |
| | | item.signValue = true |
| | | } |
| | | } else { |
| | | item.advanced = false |
| | | } |
| | | |
| | | if (item.advanced && item.initval) { |
| | | let val = item.initval |
| | | if (item.precision === 'hour') { |
| | | if (/,/ig.test(val)) { |
| | | val = val.split(',').map(m => m + ':00').join(',') |
| | | } else { |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) { |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val}) |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'group') { |
| | |
| | | if (item.type === 'checkcard' && item.multiple === 'dropdown' && item.resourceType === '0') { |
| | | this.resetCheckcard(item) |
| | | } |
| | | } |
| | | |
| | | if (item.signValue && item.initval) { |
| | | let val = item.initval |
| | | if (item.precision === 'hour') { |
| | | if (/,/ig.test(val)) { |
| | | val = val.split(',').map(m => m + ':00').join(',') |
| | | } else { |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | |
| | | let text = val |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'radio') { |
| | | item.oriOptions.forEach(cell => { |
| | | if (cell.Value === val) { |
| | | text = cell.Text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val, text}) |
| | | } |
| | | |
| | | fieldMap.set(item.field, item) |
| | |
| | | if (visible) { |
| | | let advanceValues = [] |
| | | this.state.searchlist.forEach(item => { |
| | | if (!item.advanced) return |
| | | if (!item.signValue) return |
| | | |
| | | let val = this.record[item.field] |
| | | if (val || val === 0) { |
| | |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) { |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val}) |
| | | |
| | | let text = val |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'radio') { |
| | | item.oriOptions.forEach(cell => { |
| | | if (cell.Value === val) { |
| | | text = cell.Text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val, text}) |
| | | } |
| | | }) |
| | | this.setState({advanceValues}) |
| | |
| | | } else { |
| | | record[item.field] = item.initval |
| | | } |
| | | if (item.advanced && item.initval) { |
| | | if (item.signValue && item.initval) { |
| | | let val = item.initval |
| | | if (item.precision === 'hour') { |
| | | if (/,/ig.test(val)) { |
| | |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) { |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val}) |
| | | |
| | | let text = val |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'radio') { |
| | | item.oriOptions.forEach(cell => { |
| | | if (cell.Value === val) { |
| | | text = cell.Text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val, text}) |
| | | } |
| | | |
| | | return item |
| | |
| | | |
| | | let advanceValues = [] |
| | | this.state.searchlist.forEach(item => { |
| | | if (!item.advanced) return |
| | | if (!item.signValue) return |
| | | |
| | | let val = this.record[item.field] |
| | | if (val || val === 0) { |
| | |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) { |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val}) |
| | | |
| | | let text = val |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'radio') { |
| | | item.oriOptions.forEach(cell => { |
| | | if (cell.Value === val) { |
| | | text = cell.Text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val, text}) |
| | | } |
| | | }) |
| | | |
| | |
| | | return ( |
| | | <div key={index}> |
| | | <span>{item.label}: </span> |
| | | <span className="advance-value">{item.value}</span> |
| | | <span className="advance-value">{item.text}</span> |
| | | <CloseOutlined onClick={() => this.closeAdvanceForm(item)} /> |
| | | </div>) |
| | | })} |