Merge branch 'positec' into bms
| | |
| | | } |
| | | |
| | | .ant-calendar-selected-day .ant-calendar-date { |
| | | background: var(--mk-sys-color2); |
| | | background: var(--mk-sys-color1); |
| | | color: var(--mk-sys-color); |
| | | border-color: var(--mk-sys-color); |
| | | } |
| | | .ant-calendar-today-btn { |
| | | color: var(--mk-sys-color); |
| | |
| | | field: item.field || '', |
| | | width: item.span || 12, |
| | | value: '', |
| | | style: {marginBottom: '15px'} |
| | | style: {marginBottom: '15px', color: 'rgba(0, 0, 0, 0.85)'} |
| | | } |
| | | |
| | | if (item.type === 'number') { |
| | | cell.eleType = 'number' |
| | | cell.decimal = typeof(item.decimal) === 'number' ? item.decimal : '' |
| | | } else if (item.type === 'split') { |
| | | cell.width = 24 |
| | | cell.prefix = '' |
| | | cell.value = item.label || '' |
| | | cell.style = { |
| | | color: '#1890ff', |
| | | marginBottom: '15px', |
| | | borderBottomWidth: '1px', |
| | | borderBottomColor: '#e9e9e9' |
| | | } |
| | | } |
| | | |
| | | items.push(cell) |
| | |
| | | field: item.field || '', |
| | | width: item.span || 12, |
| | | value: '', |
| | | style: {marginBottom: '15px'} |
| | | style: {marginBottom: '15px', color: 'rgba(0, 0, 0, 0.85)'} |
| | | } |
| | | |
| | | if (item.type === 'number') { |
| | | cell.eleType = 'number' |
| | | cell.decimal = typeof(item.decimal) === 'number' ? item.decimal : '' |
| | | } else if (item.type === 'split') { |
| | | cell.width = 24 |
| | | cell.prefix = '' |
| | | cell.value = item.label || '' |
| | | cell.style = { |
| | | color: '#1890ff', |
| | | marginBottom: '15px', |
| | | borderBottomWidth: '1px', |
| | | borderBottomColor: '#e9e9e9' |
| | | } |
| | | } |
| | | |
| | | items.push(cell) |
| | |
| | | field: item.field || '', |
| | | width: item.span || 12, |
| | | value: '', |
| | | style: {marginBottom: '15px'} |
| | | style: {marginBottom: '15px', color: 'rgba(0, 0, 0, 0.85)'} |
| | | } |
| | | |
| | | if (item.type === 'number') { |
| | | cell.eleType = 'number' |
| | | cell.decimal = typeof(item.decimal) === 'number' ? item.decimal : '' |
| | | } else if (item.type === 'split') { |
| | | cell.width = 24 |
| | | cell.prefix = '' |
| | | cell.value = item.label || '' |
| | | cell.style = { |
| | | color: '#1890ff', |
| | | marginBottom: '15px', |
| | | borderBottomWidth: '1px', |
| | | borderBottomColor: '#e9e9e9' |
| | | } |
| | | } |
| | | |
| | | items.push(cell) |
| | |
| | | } else if (config.type === 'interface') { |
| | | menu.components.forEach(item => { |
| | | if (item.type !== 'search') return |
| | | search = item.search |
| | | search = item.search || [] |
| | | }) |
| | | } else { |
| | | let filterComponent = (box, mainSearch) => { |
| | | box.components.forEach(item => { |
| | | if (item.type !== 'search') return |
| | | mainSearch = item.search |
| | | mainSearch = item.search || [] |
| | | }) |
| | | let has = false |
| | | box.components.forEach(item => { |
| | |
| | | } |
| | | |
| | | verifySubmit = () => { |
| | | const { config } = this.props |
| | | const { config, mainSearch } = this.props |
| | | |
| | | this.setState({loading: true}) |
| | | this.verifyRef.submitDataSource().then((res, hasMSearch) => { |
| | | this.verifyRef.submitDataSource().then((res) => { |
| | | |
| | | let MenuType = sessionStorage.getItem('MenuType') |
| | | |
| | |
| | | }, 150) |
| | | } |
| | | |
| | | if (config.type === 'interface' && res.setting && res.setting.useMSearch === 'true' && !hasMSearch) { |
| | | if (config.type === 'interface' && res.setting && res.setting.useMSearch === 'true' && mainSearch.length === 0) { |
| | | Modal.warning({ |
| | | title: '数据源中使用了外部搜索,但搜索条件尚未添加!', |
| | | centered: true |
| | |
| | | searches: formatSearch(search), |
| | | searchKey: '', |
| | | debugId: _setting.debugId || '', |
| | | hasMainSearch: mainSearch && mainSearch.length, |
| | | hasMainSearch: mainSearch && mainSearch.length > 0, |
| | | oriConfig: fromJS({ |
| | | scripts, |
| | | columns: columns, |
| | |
| | | |
| | | submitDataSource = () => { |
| | | const { config, mainSearch } = this.props |
| | | const { activeKey, setting, columns, subColumns, scripts, cols, median, searches, hasMainSearch } = this.state |
| | | const { activeKey, setting, columns, subColumns, scripts, cols, median, searches } = this.state |
| | | |
| | | if (config.subtype === 'dualdatacard') { |
| | | let arr = columns.map(col => col.field.toLowerCase()) |
| | |
| | | searches: _searches, |
| | | setting: res |
| | | }, () => { |
| | | this.sqlverify(() => { resolve({setting: res, columns, subColumns, scripts, cols, searches: _searches }, hasMainSearch) }, reject, 'submit') |
| | | this.sqlverify(() => { resolve({setting: res, columns, subColumns, scripts, cols, searches: _searches }) }, reject, 'submit') |
| | | }) |
| | | }, () => { |
| | | reject() |
| | |
| | | reject() |
| | | return |
| | | } |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }, hasMainSearch) }, reject, 'submit') |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }) }, reject, 'submit') |
| | | } else if (activeKey === 'subcolumns') { |
| | | if (this.subdatasource && this.subdatasource.state.editingKey) { |
| | | notification.warning({ |
| | |
| | | reject() |
| | | return |
| | | } |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }, hasMainSearch) }, reject, 'submit') |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }) }, reject, 'submit') |
| | | } else if (activeKey === 'scripts') { |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }, hasMainSearch) }, reject, 'submit') |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols, searches }) }, reject, 'submit') |
| | | } |
| | | }) |
| | | } |
| | |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | } |
| | | } |
| | | if (_item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 特殊字段替换 |
| | | _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (BID || '')) |
| | | if (_item.type === 'text') { |
| | | if (/@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 特殊字段替换 |
| | | _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (BID || '')) |
| | | } |
| | | if (/@currentYear@/ig.test(_item.value)) { // 系统变量替换 |
| | | _item.value = _item.value.replace(/@currentYear@/ig, moment().format('YYYY')) |
| | | } |
| | | } |
| | | if (_item.type === 'text' && item.lenControl && item.lenControl !== 'limit') { |
| | | if (item.lenControl === 'left') { |
| | |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | } |
| | | } |
| | | if (_item.type === 'text' && /@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 特殊字段替换 |
| | | _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || '')) |
| | | if (_item.type === 'text') { |
| | | if (/@appkey@|@SessionUid@|@bid@/ig.test(_item.value)) { // 特殊字段替换 |
| | | _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey).replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')).replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || '')) |
| | | } |
| | | if (/@currentYear@/ig.test(_item.value)) { // 系统变量替换 |
| | | _item.value = _item.value.replace(/@currentYear@/ig, moment().format('YYYY')) |
| | | } |
| | | } |
| | | if (_item.type === 'text' && item.lenControl && item.lenControl !== 'limit') { |
| | | if (item.lenControl === 'left') { |
| | |
| | | item.rules = [] |
| | | if (item.type === 'text') { |
| | | item.initval = item.initval + '' |
| | | if (/@currentYear@/ig.test(item.initval)) { // 系统变量替换 |
| | | item.initval = item.initval.replace(/@currentYear@/ig, moment().format('YYYY')) |
| | | } |
| | | |
| | | if (item.required === 'true') { |
| | | item.rules.push({ |
| | |
| | | }) |
| | | |
| | | _sql = _sql.replace(/,\n\s*/g, ',') |
| | | _sql = _sql.replace(/@db@\s+[a-zA-Z]/g, (w) => { |
| | | return w.replace(/\s+/g, '') |
| | | }) |
| | | |
| | | this.setState({display: false, defaultVal: _sql}, () => { |
| | | this.setState({display: true}) |
| | |
| | | if (this.record.interception === 'func') { |
| | | shows.push('func') |
| | | } |
| | | reTooltip.initval = '系统变量:@currentYear@(当前年份)' |
| | | } else if (type === 'number') { |
| | | reTypes.initval = 'number' |
| | | reRequired.initval = true |
| | |
| | | let keys = [] |
| | | let values = [] |
| | | |
| | | formdata.forEach(item => { |
| | | formdata && formdata.forEach(item => { |
| | | if (item.writein === false) return |
| | | let _key = item.field.toLowerCase() |
| | | |