| | |
| | | |
| | | 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) |
| | |
| | | mainparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | mainparam.secretkey = Utils.encrypt(mainparam.LText, mainparam.timestamp) |
| | | |
| | | if (window.GLOB.mainSystemApi) { |
| | | mainparam.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | if (window.GLOB.mkHS) { // 云端数据验证 |
| | | mainparam.open_key = Utils.encryptOpenKey(mainparam.secretkey, mainparam.timestamp) |
| | | if (window.GLOB.cloudServiceApi) { |
| | | mainparam.rduri = window.GLOB.cloudServiceApi |
| | | mainparam.userid = sessionStorage.getItem('CloudUserID') || '' |
| | | mainparam.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | } |
| | | } else if (window.GLOB.mainSystemApi) { |
| | | mainparam.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | deffers.push( |
| | |
| | | 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}) |
| | |
| | | } |
| | | |
| | | handleSubmit = () => { |
| | | const { config } = this.props |
| | | |
| | | this.setState({}, () => { |
| | | this.props.form.validateFields((err, values) => { |
| | | if (err) return |
| | |
| | | this.sign = '' |
| | | }, 2000) |
| | | |
| | | if (config.wrap && config.wrap.cacheSearch === 'true') { |
| | | let _values = {} |
| | | searches.forEach(item => { |
| | | _values[item.key] = item.value |
| | | }) |
| | | |
| | | window.GLOB.SearchBox.set(config.$searchId + 'cache', _values) |
| | | } |
| | | |
| | | if (this.props.refreshdata) { |
| | | this.props.refreshdata(searches) |
| | | } else { |
| | | window.GLOB.SearchBox.set(this.props.config.$searchId, searches) |
| | | MKEmitter.emit('searchRefresh', this.props.config.$searchId) |
| | | window.GLOB.SearchBox.set(config.$searchId, searches) |
| | | MKEmitter.emit('searchRefresh', config.$searchId) |
| | | } |
| | | }) |
| | | }) |
| | |
| | | } 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>) |
| | | })} |