Merge branch 'master' into positec
| | |
| | | .ant-col.ant-col-0 { |
| | | display: inline-block; |
| | | } |
| | | .mk-cell-btn.ant-col-0 { |
| | | width: auto; |
| | | float: left; |
| | | } |
| | | |
| | | .ant-dropdown { |
| | | .ant-dropdown-menu-item:hover, .ant-dropdown-menu-submenu-title:hover { |
| | |
| | | _style_ = {float: 'right'} |
| | | } |
| | | |
| | | let className = card.width || '' |
| | | let className = card.width || 0 |
| | | if (card.hidden === 'true') { |
| | | className += ' mk-hidden' |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, cards.uuid, supId) |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, cards.uuid, supId, true) |
| | | |
| | | if (cards.subtype === 'basetable') { |
| | | this.setState({ |
| | |
| | | res.style = {} |
| | | } |
| | | } else if (res.class !== cell.class || res.show !== cell.show || !res.style) { |
| | | let cl = res.class.replace('border-', '') |
| | | let style = {} |
| | | if (res.class === 'default') { |
| | | style.color = 'rgba(0, 0, 0, 0.65)' |
| | | style.backgroundColor = '#fff' |
| | | style.borderColor = '#d9d9d9' |
| | | } else if (res.class.indexOf('border') > -1) { |
| | | style.color = color[cl] |
| | | style.backgroundColor = '#fff' |
| | | style.borderColor = color[cl] |
| | | if (res.class) { |
| | | let cl = res.class.replace('border-', '') |
| | | let style = {} |
| | | if (res.class === 'default') { |
| | | style.color = 'rgba(0, 0, 0, 0.65)' |
| | | style.backgroundColor = '#fff' |
| | | style.borderColor = '#d9d9d9' |
| | | } else if (res.class.indexOf('border') > -1) { |
| | | style.color = color[cl] |
| | | style.backgroundColor = '#fff' |
| | | style.borderColor = color[cl] |
| | | } else { |
| | | style.color = '#ffffff' |
| | | style.backgroundColor = color[cl] |
| | | } |
| | | res.style = {...res.style, ...style} |
| | | } else { |
| | | style.color = '#ffffff' |
| | | style.backgroundColor = color[cl] |
| | | res.style = res.style || {} |
| | | } |
| | | res.style = {...res.style, ...style} |
| | | } |
| | | |
| | | if (res.width === 0 && cell.width !== 0) { |
| | | res.style = res.style || {} |
| | | |
| | | res.style.paddingLeft = '15px' |
| | | res.style.paddingRight = '15px' |
| | | res.style.marginRight = '15px' |
| | | res.style.width = 'auto' |
| | | |
| | | delete res.style.marginLeft |
| | | } |
| | | |
| | | res.updateTime = moment().format('YYYY-MM-DD HH:mm') |
| | |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'shifting', |
| | | label: '按钮偏移', |
| | | initval: wrap.shifting || 'false', |
| | | tooltip: '启用时,工具栏按钮将显示在标题栏右上角。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !!appType || subtype !== 'datacard' || isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'shifting', |
| | | label: '按钮偏移', |
| | | initval: wrap.shifting || 'false', |
| | | tooltip: '启用时,工具栏按钮将显示在标题栏右上角。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !!appType || isprint |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | }) |
| | | } |
| | | |
| | | if (!plot.legend || plot.legend === 'hidden') { |
| | | let noLegend = !plot.legend || plot.legend === 'hidden' |
| | | if (noLegend) { |
| | | chart.legend(false) |
| | | } else { |
| | | chart.legend({ |
| | |
| | | } |
| | | view1.axis('value', yc) |
| | | |
| | | // view1.legend(false) |
| | | if (!noLegend) { |
| | | view1.legend(false) |
| | | } |
| | | |
| | | if (plot.mutilBar !== 'stack') { |
| | | let _chart = view1 |
| | |
| | | |
| | | view2.data(dv.rows) |
| | | |
| | | // view2.legend(false) |
| | | if (!noLegend) { |
| | | view2.legend(false) |
| | | } |
| | | |
| | | fields.forEach(item => { |
| | | if (item.chartType === 'bar' && !Bar_axis.length) { |
| | |
| | | { |
| | | type: 'select', |
| | | field: 'focus', |
| | | label: '焦点', |
| | | label: '初始焦点', |
| | | initval: group.setting.focus || '', |
| | | required: false, |
| | | options: fields |
| | |
| | | shows = ['typeName', 'label'] |
| | | } else { |
| | | shows = ['typeName', 'label', 'intertype', 'Ot', 'execSuccess', 'syncComponent', 'anchors', 'linkmenu', 'output', 'reload', 'preButton'] // 选项列表 |
| | | |
| | | |
| | | if (this.record.execSuccess === 'never') { |
| | | shows.push('resetForms') |
| | | } |
| | | if (this.record.intertype === 'custom') { |
| | | shows.pop() |
| | | shows.push('procMode', 'interface', 'callbackType', 'proInterface', 'method', 'cross', 'stringify', 'ContentType', 'outerBlacklist') |
| | | if (this.record.procMode === 'system') { |
| | | shows.push('sql', 'sqlType') |
| | |
| | | })( |
| | | <Select |
| | | showSearch |
| | | mode={item.mode || ''} |
| | | filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} |
| | | onChange={(value) => {this.optionChange(item.key, value)}} |
| | | getPopupContainer={() => document.getElementById('winter')} |
| | |
| | | if (values.outerBlacklist) { |
| | | values.outerBlacklist = values.outerBlacklist.replace(/\s/ig, '') |
| | | } |
| | | if (values.resetForms && values.resetForms.length === 0) { |
| | | values.resetForms = null |
| | | } |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | |
| | | * @param {*} type 按钮类型,用于区分可选的打开方式 |
| | | */ |
| | | |
| | | export function getActionForm (card, functip, tableName, usefulFields, modules, anchors, uuid) { |
| | | export function getActionForm (card, functip, tableName, usefulFields, modules, anchors, uuid, fields) { |
| | | const appType = sessionStorage.getItem('appType') |
| | | let viewType = sessionStorage.getItem('editMenuType') // 弹窗 popview |
| | | let _type = '提交' |
| | |
| | | text: '刷新源组件' |
| | | }) |
| | | } |
| | | |
| | | let resets = [] |
| | | fields.forEach(item => { |
| | | if (item.type !== 'text' && item.type !== 'number') return |
| | | |
| | | resets.push({ |
| | | value: item.field, |
| | | text: item.label |
| | | }) |
| | | }) |
| | | |
| | | return [ |
| | | { |
| | |
| | | options: linkButtons |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'resetForms', |
| | | label: '重置表单', |
| | | tooltip: '按钮执行成功后需要重置的表单,表单会恢复默认值并聚焦。', |
| | | initVal: card.resetForms || [], |
| | | required: false, |
| | | mode: 'multiple', |
| | | options: resets |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'reload', |
| | | label: '上一页', |
| | |
| | | this.setState({ |
| | | visible: true, |
| | | card: card, |
| | | formlist: getActionForm(card, functip, config.setting.tableName, usefulFields, modules, anchors, group.uuid) |
| | | formlist: getActionForm(card, functip, config.setting.tableName, usefulFields, modules, anchors, group.uuid, group.fields) |
| | | }) |
| | | } |
| | | |
| | |
| | | { |
| | | type: 'select', |
| | | field: 'focus', |
| | | label: '焦点', |
| | | label: '初始焦点', |
| | | initval: wrap.focus || '', |
| | | required: false, |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'refocus', |
| | | label: '刷新焦点', |
| | | initval: wrap.refocus || '', |
| | | required: false, |
| | | options: fields |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'cache', |
| | | label: '选项查询', |
| | |
| | | { |
| | | type: 'number', |
| | | key: 'width', |
| | | min: 1, |
| | | min: 0, |
| | | max: 24, |
| | | precision: 0, |
| | | label: '宽度', |
| | | initVal: card.width || 12, |
| | | tooltip: '栅格布局,每行等分为24列。', |
| | | initVal: card.width || (card.width === 0 ? 0 : 12), |
| | | tooltip: '栅格布局,每行等分为24列。为 0 时宽度自适应。', |
| | | forbid: type !== 'card', |
| | | required: true |
| | | }, |
| | |
| | | } |
| | | } |
| | | |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid, supId) |
| | | let modules = MenuUtils.getSubModules(window.GLOB.customMenu.components, config.uuid, supId, config.subtype !== 'basetable') |
| | | |
| | | if (config.subtype === 'basetable') { |
| | | delete card.eleType // 区分按钮位置 |
| | |
| | | import Api from '@/api' |
| | | import { checkSQL } from '@/utils/utils-custom.js' |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | import './index.scss' |
| | | // import './index.scss' |
| | | |
| | | class CustomForm extends Component { |
| | | static propTpyes = { |
| | |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={5} style={{paddingTop: '3px', whiteSpace: 'nowrap'}}> |
| | | <Col span={5} className="add" style={{paddingTop: '3px', whiteSpace: 'nowrap'}}> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 15}}> |
| | | {type === 'fullscreen' && !editItem ? '添加' : '保存'} |
| | | </Button> |
| | |
| | | 取消 |
| | | </Button> |
| | | </Col> |
| | | <Col span={3} style={{paddingTop: '12px', fontSize: '12px', whiteSpace: 'nowrap'}}> |
| | | {!type ? <Col span={3} style={{paddingTop: '12px', fontSize: '12px', whiteSpace: 'nowrap'}}> |
| | | 强制保存: |
| | | <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/> |
| | | </Col> |
| | | </Col> : null} |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label="sql"> |
| | | {getFieldDecorator('sql', { |
| | |
| | | </span> |
| | | } key="scripts"> |
| | | <FullScripts |
| | | verify={verify} |
| | | scripts={verify.scripts} |
| | | getScriptsFullForm={() => this.scriptsFullForm} |
| | | getScriptsForm={() => this.scriptsForm} |
| | | handleStatus={this.handleStatus} |
| | |
| | | getSearchField = (searches) => { |
| | | let _usefulFields = [] |
| | | searches.forEach(item => { |
| | | if (['dateweek', 'datemonth'].includes(item.type)) { |
| | | if (item.type === 'dateweek') { |
| | | _usefulFields.push(item.key) |
| | | _usefulFields.push(item.key + '1') |
| | | } else if (item.type === 'datemonth') { |
| | | if (item.match === '=') { |
| | | _usefulFields.push(item.key) |
| | | } else { |
| | | _usefulFields.push(item.key) |
| | | _usefulFields.push(item.key + '1') |
| | | } |
| | | } else if (item.type === 'daterange') { |
| | | let _skey = item.key |
| | | let _ekey = item.key + '1' |
| | |
| | | loading: false, |
| | | card: null, |
| | | data: [], |
| | | total: null, |
| | | total: 0, |
| | | precards: [], |
| | | nextcards: [], |
| | | selected: 'false', |
| | |
| | | _config.wrap.layout = (_config.wrap.layout || 'grid') + '-layout float-' + (_config.wrap.cardFloat || 'left') |
| | | |
| | | _config.wrap.wrapClass = `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale}` |
| | | |
| | | if (_config.wrap.shifting === 'true') { |
| | | _config.wrap.shifting = 'shifting' |
| | | } else { |
| | | _config.wrap.shifting = '' |
| | | } |
| | | |
| | | let pageOptions = ['10', '25', '50', '100', '500', '1000'] |
| | | |
| | |
| | | } |
| | | |
| | | return ( |
| | | <div className="custom-data-card-box" id={'anchor' + config.uuid} style={config.style}> |
| | | <div className={'custom-data-card-box ' + config.wrap.shifting} id={'anchor' + config.uuid} style={config.style}> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | {data.length ? <div className="ant-spin-blur"></div> : null} |
| | |
| | | } |
| | | } |
| | | } |
| | | .custom-data-card-box.shifting { |
| | | .normal-header:not(.header-search) + .toolbar-button { |
| | | position: absolute; |
| | | top: 0px; |
| | | right: 0px; |
| | | z-index: 1; |
| | | button { |
| | | margin-bottom: 0px!important; |
| | | } |
| | | } |
| | | .normal-header:not(.header-search) + .toolbar-button + .pickup-wrap{ |
| | | position: relative; |
| | | button { |
| | | position: relative; |
| | | } |
| | | } |
| | | } |
| | | .custom-data-card-box::-webkit-scrollbar { |
| | | width: 7px; |
| | | height: 7px; |
| | |
| | | loading: false, // 数据加载状态 |
| | | card: null, // 卡片设置 |
| | | data: [], // 数据 |
| | | total: null, |
| | | total: 0, |
| | | precards: [], |
| | | nextcards: [], |
| | | selected: 'false', |
| | |
| | | |
| | | _config.wrap.wrapClass = `${_config.wrap.selStyle} ${_config.wrap.cardType || ''}` |
| | | |
| | | if (_config.wrap.shifting === 'true') { |
| | | _config.wrap.shifting = 'shifting' |
| | | } else { |
| | | _config.wrap.shifting = '' |
| | | } |
| | | |
| | | let wrapStyle = null |
| | | let subcard = fromJS(_card).toJS() |
| | | let subconfig = fromJS(_config).toJS() |
| | |
| | | } |
| | | |
| | | return ( |
| | | <div className="double-data-card-box" id={'anchor' + config.uuid} style={config.style}> |
| | | <div className={'double-data-card-box ' + config.wrap.shifting} id={'anchor' + config.uuid} style={config.style}> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | {data.length ? <div className="ant-spin-blur"></div> : null} |
| | |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | } |
| | | .double-data-card-box.shifting { |
| | | .normal-header:not(.header-search) + .toolbar-button { |
| | | position: absolute; |
| | | top: 0px; |
| | | right: 0px; |
| | | z-index: 1; |
| | | button { |
| | | margin-bottom: 0px!important; |
| | | } |
| | | } |
| | | .normal-header:not(.header-search) + .toolbar-button + .pickup-wrap{ |
| | | position: relative; |
| | | button { |
| | | position: relative; |
| | | } |
| | | } |
| | | } |
| | | .double-data-card-box::-webkit-scrollbar { |
| | | width: 7px; |
| | | height: 7px; |
| | |
| | | MKEmitter.addListener('queryModuleParam', this.queryModuleParam) |
| | | MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | |
| | | if (config.setting.useMSearch) { |
| | | MKEmitter.addListener('searchRefresh', this.searchRefresh) |
| | | } |
| | | |
| | | if (config.setting.sync === 'true') { |
| | | MKEmitter.addListener('transferSyncData', this.transferSyncData) |
| | | } |
| | | |
| | | if (config.wrap.datatype === 'public') { |
| | | MKEmitter.addListener('mkPublicData', this.mkPublicData) |
| | | } else if (config.setting.useMSearch) { |
| | | MKEmitter.addListener('searchRefresh', this.searchRefresh) |
| | | } |
| | | |
| | | if (config.timer && config.wrap.datatype === 'dynamic') { |
| | |
| | | }) |
| | | } |
| | | |
| | | if (!plot.legend || plot.legend === 'hidden') { |
| | | let noLegend = !plot.legend || plot.legend === 'hidden' |
| | | if (noLegend) { |
| | | chart.legend(false) |
| | | } else { |
| | | chart.legend({ |
| | |
| | | view1.scale('value', c) |
| | | view1.axis('value', plot.$yc) |
| | | |
| | | // view1.legend(false) |
| | | if (!noLegend) { |
| | | view1.legend(false) |
| | | } |
| | | |
| | | let colorIndex = 0 |
| | | |
| | |
| | | } |
| | | |
| | | view2.data(dv.rows) |
| | | // view2.legend(false) |
| | | |
| | | if (!noLegend) { |
| | | view2.legend(false) |
| | | } |
| | | |
| | | plot.customs.forEach(item => { |
| | | if (item.chartType === 'bar' && !plot.Bar_axis) { |
| | |
| | | MKEmitter.addListener('reloadData', this.reloadData) |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | |
| | | if (config.setting.useMSearch) { |
| | | MKEmitter.addListener('searchRefresh', this.searchRefresh) |
| | | } |
| | | |
| | | if (config.setting.sync === 'true') { |
| | | MKEmitter.addListener('transferSyncData', this.transferSyncData) |
| | | } |
| | | |
| | | if (config.wrap.datatype === 'public') { |
| | | MKEmitter.addListener('mkPublicData', this.mkPublicData) |
| | | } else if (config.setting.useMSearch) { |
| | | MKEmitter.addListener('searchRefresh', this.searchRefresh) |
| | | } |
| | | |
| | | this.initExec() |
| | |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | |
| | | if (config.setting.useMSearch) { |
| | | MKEmitter.addListener('searchRefresh', this.searchRefresh) |
| | | } |
| | | |
| | | if (config.setting.sync === 'true') { |
| | | MKEmitter.addListener('transferSyncData', this.transferSyncData) |
| | | } |
| | | |
| | | if (config.wrap.datatype === 'public') { |
| | | MKEmitter.addListener('mkPublicData', this.mkPublicData) |
| | | } else if (config.setting.useMSearch) { |
| | | MKEmitter.addListener('searchRefresh', this.searchRefresh) |
| | | } |
| | | |
| | | this.initExec() |
| | |
| | | } |
| | | |
| | | reloadData = (menuId, id) => { |
| | | const { config } = this.state |
| | | const { config, group } = this.state |
| | | |
| | | if (config.uuid !== menuId) return |
| | | |
| | | this.loadData() |
| | | if (id === 'focus-refresh' && config.wrap.refocus) { |
| | | let _group = fromJS(group).toJS() |
| | | _group.setting.focus = config.wrap.refocus |
| | | |
| | | if (config.wrap.datatype === 'static') { |
| | | this.setState({ |
| | | data: null, |
| | | group: _group |
| | | }, () => { |
| | | this.setState({data: {$$empty: true}}) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | group: _group |
| | | }, () => { |
| | | this.loadData(true) |
| | | }) |
| | | } |
| | | } else if (id === 'focus-nofresh' && config.wrap.refocus) { |
| | | let formId = '' |
| | | group.fields.forEach(item => { |
| | | if (item.field === config.wrap.refocus) { |
| | | formId = item.uuid |
| | | } |
| | | }) |
| | | MKEmitter.emit('mkFC', 'focus', formId) |
| | | } else { |
| | | this.loadData() |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | if ((position === 'mainline' || position === 'popclose') && config.setting.supModule && BID) { |
| | | MKEmitter.emit('reloadData', config.setting.supModule, BID) |
| | | } else if (position === 'grid' && config.wrap.datatype === 'static') { |
| | | if (config.wrap.refocus && group.setting.focus === config.wrap.refocus) { |
| | | let _group = fromJS(group).toJS() |
| | | _group.setting.focus = config.wrap.focus |
| | | |
| | | this.setState({ |
| | | group: _group |
| | | }) |
| | | } |
| | | this.setState({ |
| | | data: null |
| | | }, () => { |
| | |
| | | } |
| | | } |
| | | |
| | | async loadData () { |
| | | const { config, BID } = this.state |
| | | async loadData (refocus) { |
| | | const { config, BID, group } = this.state |
| | | |
| | | if (config.wrap.refocus && !refocus && group.setting.focus === config.wrap.refocus) { |
| | | let _group = fromJS(group).toJS() |
| | | _group.setting.focus = config.wrap.focus |
| | | |
| | | this.setState({ |
| | | group: _group |
| | | }) |
| | | } |
| | | |
| | | if (config.wrap.datatype === 'public') { |
| | | MKEmitter.emit('reloadData', config.wrap.publicId) |
| | |
| | | } |
| | | } |
| | | |
| | | mkFormSubmit = (btnId, callback) => { |
| | | mkFormSubmit = (btnId, callback, formId) => { |
| | | const { group } = this.state |
| | | |
| | | if (group.uuid !== btnId) return |
| | | |
| | | this.formRef.handleConfirm().then(res => { |
| | | this.formRef.handleConfirm(formId).then(res => { |
| | | MKEmitter.emit('triggerFormSubmit', {menuId: btnId, form: res}) |
| | | }, () => { |
| | | callback && callback() |
| | |
| | | data={data} |
| | | action={group} |
| | | unload={config.setting.supModule && !BID} |
| | | inputSubmit={() => this.mkFormSubmit(group.uuid)} |
| | | inputSubmit={(id) => this.mkFormSubmit(group.uuid, null, id)} |
| | | wrappedComponentRef={(inst) => this.formRef = inst} |
| | | /> : null} |
| | | {data ? <div className={'mk-form-action ' + (group.$button || '')}> |
| | |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | |
| | | if (config.setting.useMSearch) { |
| | | MKEmitter.addListener('searchRefresh', this.searchRefresh) |
| | | } |
| | | |
| | | if (config.setting.sync === 'true') { |
| | | MKEmitter.addListener('transferSyncData', this.transferSyncData) |
| | | } |
| | | |
| | | if (config.wrap.datatype === 'public') { |
| | | MKEmitter.addListener('mkPublicData', this.mkPublicData) |
| | | } else if (config.setting.useMSearch) { |
| | | MKEmitter.addListener('searchRefresh', this.searchRefresh) |
| | | } |
| | | |
| | | this.initExec() |
| | |
| | | MKEmitter.addListener('resetSelectLine', this.resetParentParam) |
| | | MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) |
| | | |
| | | if (config.setting.useMSearch) { |
| | | MKEmitter.addListener('searchRefresh', this.searchRefresh) |
| | | } |
| | | |
| | | if (config.setting.sync === 'true') { |
| | | MKEmitter.addListener('transferSyncData', this.transferSyncData) |
| | | } |
| | | |
| | | if (config.wrap.datatype === 'public') { |
| | | MKEmitter.addListener('mkPublicData', this.mkPublicData) |
| | | } else if (config.setting.useMSearch) { |
| | | MKEmitter.addListener('searchRefresh', this.searchRefresh) |
| | | } |
| | | |
| | | this.initExec() |
| | |
| | | .normal-custom-table { |
| | | position: relative; |
| | | padding: 0px; |
| | | min-height: 40px; |
| | | --mk-table-border-color: #e8e8e8; |
| | | --mk-table-color: rgba(0, 0, 0, 0.65); |
| | | --mk-table-font-size: 14px; |
| | | --mk-table-font-weight: normal; |
| | | |
| | | .main-pickup { |
| | | position: absolute; |
| | | right: 5px; |
| | | top: -22px; |
| | | z-index: 2; |
| | | } |
| | | |
| | | .normal-table-footer { |
| | | padding: 10px 0px; |
| | | color: rgba(0, 0, 0, 0.65); |
| | |
| | | columns={config.columns} |
| | | selectedData={selectedData} |
| | | /> : <div style={{height: '25px'}}></div>} |
| | | <div className="main-table-box"> |
| | | <MainTable |
| | | data={data} |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuID={config.uuid} |
| | | fields={config.columns} |
| | | total={this.state.total} |
| | | autoMatic={config.autoMatic} |
| | | lineMarks={config.lineMarks} |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbytable} |
| | | statFValue={this.state.statFValue} |
| | | chgSelectData={(selects) => this.setState({selectedData: selects})} |
| | | /> |
| | | </div> |
| | | <MainTable |
| | | data={data} |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuID={config.uuid} |
| | | fields={config.columns} |
| | | total={this.state.total} |
| | | autoMatic={config.autoMatic} |
| | | lineMarks={config.lineMarks} |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbytable} |
| | | statFValue={this.state.statFValue} |
| | | chgSelectData={(selects) => this.setState({selectedData: selects})} |
| | | /> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | .button-list.toolbar-button { |
| | | padding-right: 60px; |
| | | } |
| | | .main-table-box { |
| | | position: relative; |
| | | min-height: 40px; |
| | | .main-pickup { |
| | | position: absolute; |
| | | right: 5px; |
| | | top: -22px; |
| | | z-index: 2; |
| | | } |
| | | >.async-spin { |
| | | line-height: 150px!important; |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | let content = <> |
| | | {config.search && config.search.length ? |
| | | {config.search.length ? |
| | | <MainSearch BID={BID} config={config} refreshdata={this.refreshbysearch}/> : null |
| | | } |
| | | {actions.length > 0 ? <MainAction |
| | |
| | | BData={BData} |
| | | columns={config.columns} |
| | | selectedData={selectedData} |
| | | /> : <div className="mk-action-space" style={{height: '25px'}}></div>} |
| | | <div className={'main-table-box ' + (!actions || actions.length === 0 ? 'no-action' : '')}> |
| | | <MainTable |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuID={config.uuid} |
| | | allSearch={allSearch} |
| | | data={this.state.data} |
| | | fields={config.columns} |
| | | total={this.state.total} |
| | | colsCtrls={config.colsCtrls} |
| | | lineMarks={config.lineMarks} |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbytable} |
| | | statFValue={this.state.statFValue} |
| | | chgSelectData={(selects) => this.setState({selectedData: selects})} |
| | | /> |
| | | </div> |
| | | /> : (setting.tableType || config.search.length > 0 ? <div className="mk-action-space" style={{height: '25px'}}></div> : null)} |
| | | <MainTable |
| | | setting={setting} |
| | | columns={columns} |
| | | MenuID={config.uuid} |
| | | allSearch={allSearch} |
| | | data={this.state.data} |
| | | fields={config.columns} |
| | | total={this.state.total} |
| | | colsCtrls={config.colsCtrls} |
| | | lineMarks={config.lineMarks} |
| | | loading={this.state.loading} |
| | | refreshdata={this.refreshbytable} |
| | | statFValue={this.state.statFValue} |
| | | chgSelectData={(selects) => this.setState({selectedData: selects})} |
| | | /> |
| | | </> |
| | | |
| | | return ( |
| | |
| | | .button-list.toolbar-button { |
| | | padding-right: 60px; |
| | | } |
| | | .main-table-box { |
| | | position: relative; |
| | | min-height: 40px; |
| | | .main-pickup { |
| | | position: absolute; |
| | | right: 5px; |
| | | top: -22px; |
| | | z-index: 2; |
| | | } |
| | | >.async-spin { |
| | | line-height: 150px!important; |
| | | } |
| | | } |
| | | .ant-collapse { |
| | | background-color: transparent; |
| | | border-radius: 0px; |
| | |
| | | item.wrap.datatype = 'static' |
| | | } else { |
| | | item.setting = {...inter.setting} |
| | | item.$searchId = inter.$searchId |
| | | } |
| | | } |
| | | } |
| | |
| | | component.components = this.formatSetting(component.components, params, null, regs, balMap) |
| | | return component |
| | | } else if (component.wrap && component.wrap.datatype === 'public') { |
| | | component.setting.useMSearch = false |
| | | component.setting.sync = 'false' |
| | | |
| | | return component |
| | | } else if (component.wrap && component.wrap.datatype === 'static') { |
| | | component.format = '' |
| | |
| | | if (btn.syncComponentId === 'multiComponent') { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('reloadData', id) |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | } else if (/\$focus/.test(btn.syncComponentId)) { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | } |
| | |
| | | if (btn.syncComponentId === 'multiComponent') { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('reloadData', id) |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | } else if (/\$focus/.test(btn.syncComponentId)) { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | } |
| | |
| | | const { btn } = this.props |
| | | const { autoMatic } = this.state |
| | | |
| | | if (btn.resetForms) { |
| | | MKEmitter.emit('resetForms', btn.uuid) |
| | | } |
| | | |
| | | if (this.preCallback) { |
| | | this.setState({ |
| | | loading: false, |
| | |
| | | if (btn.syncComponentId === 'multiComponent') { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('reloadData', id) |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | } else if (/\$focus/.test(btn.syncComponentId)) { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | } |
| | |
| | | if (btn.syncComponentId === 'multiComponent') { |
| | | btn.syncComponentIds.forEach((id, i) => { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('reloadData', id) |
| | | if (/\$focus/.test(id)) { |
| | | MKEmitter.emit('reloadData', id.split('$')[0], id.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', id) |
| | | } |
| | | }, 20 * i) |
| | | }) |
| | | } else if (/\$focus/.test(btn.syncComponentId)) { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId.split('$')[0], btn.syncComponentId.split('$')[1]) |
| | | } else { |
| | | MKEmitter.emit('reloadData', btn.syncComponentId) |
| | | } |
| | |
| | | ID: '', |
| | | send_type: '', |
| | | timestamp: '', |
| | | n_id: '' |
| | | n_id: '', |
| | | focusId: '' |
| | | } |
| | | |
| | | record = {} |
| | | submitId = '' |
| | | |
| | | componentDidMount () { |
| | | const { action, unload } = this.props |
| | |
| | | } |
| | | |
| | | if (item.type === 'number') { |
| | | if (isNaN(item.initval)) { |
| | | if (isNaN(item.initval) || item.initval === '') { |
| | | item.initval = 0 |
| | | } |
| | | } else if (['select', 'link', 'radio', 'checkbox', 'checkcard', 'multiselect', 'cascader'].includes(item.type) && item.resourceType === '1') { |
| | |
| | | } |
| | | |
| | | record[item.field] = item.initval |
| | | item.orgval = item.initval |
| | | |
| | | if (linkFields[item.field]) { |
| | | item.linkFields = linkFields[item.field] |
| | | } |
| | | |
| | | if (item.enter === 'tab' || item.enter === 'sub') { |
| | | if (fieldMap.has(item.tabField)) { |
| | | item.tabUuid = '' |
| | | if (item.tabField && fieldMap.has(item.tabField)) { |
| | | item.tabUuid = fieldMap.get(item.tabField).uuid |
| | | } else if (item.enter === 'tab') { |
| | | item.enter = 'false' |
| | | } else if (item.enter === 'sub') { |
| | | } else if (item.enter === 'sub' && ['text', 'number'].includes(item.type)) { |
| | | item.tabUuid = item.uuid |
| | | } |
| | | } |
| | |
| | | |
| | | this.record = record |
| | | let ID = this.props.data ? this.props.data.$$uuid || '' : '' |
| | | let focusItem = null |
| | | |
| | | this.setState({ formlist, ID }, () => { |
| | | if (action.setting.focus && fieldMap.has(action.setting.focus)) { |
| | | focusItem = fieldMap.get(action.setting.focus) |
| | | } |
| | | |
| | | this.setState({ formlist, ID, focusId: focusItem ? focusItem.uuid : '' }, () => { |
| | | if (unload) return |
| | | |
| | | if (action.setting && action.setting.focus && fieldMap.has(action.setting.focus)) { |
| | | let focusItem = fieldMap.get(action.setting.focus) |
| | | |
| | | if (focusItem) { |
| | | if (focusItem.type === 'text' || focusItem.type === 'number') { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'focus', focusItem.uuid) |
| | |
| | | } |
| | | } |
| | | }) |
| | | |
| | | if (action.subButton && action.subButton.resetForms) { |
| | | MKEmitter.addListener('resetForms', this.resetForms) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('resetForms', this.resetForms) |
| | | } |
| | | |
| | | resetForms = (id) => { |
| | | const { action } = this.props |
| | | const { focusId } = this.state |
| | | |
| | | if (id !== action.uuid) return |
| | | |
| | | let formlist = fromJS(this.state.formlist).toJS() |
| | | let resetForms = action.subButton.resetForms || [] |
| | | |
| | | formlist = formlist.map(item => { |
| | | if (item.type !== 'text' && item.type !== 'number') return item |
| | | |
| | | if (resetForms.includes(item.field)) { |
| | | item.initval = item.orgval |
| | | this.record[item.field] = item.orgval |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | | let _list = fromJS(formlist).toJS().map(item => { |
| | | if (item.type !== 'text' && item.type !== 'number') return item |
| | | |
| | | if (resetForms.includes(item.field) && !item.hidden) { |
| | | item.hidden = true |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | |
| | | this.setState({ |
| | | formlist: _list |
| | | }, () => { |
| | | this.setState({ |
| | | formlist |
| | | }) |
| | | }) |
| | | |
| | | if (focusId || this.submitId) { |
| | | setTimeout(() => { |
| | | MKEmitter.emit('mkFC', 'focus', this.submitId || focusId) |
| | | }, 50) |
| | | } |
| | | } |
| | | |
| | | getFormData = (deForms) => { |
| | |
| | | return fields |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | handleConfirm = (formId) => { |
| | | const { formlist, send_type, timestamp, n_id } = this.state |
| | | |
| | | // 表单提交时检查输入值是否正确 |
| | |
| | | forms.push(_item) |
| | | }) |
| | | |
| | | this.submitId = formId || '' |
| | | |
| | | resolve(forms) |
| | | }) |
| | | }) |
| | |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | } else { |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | this.props.onSubmit() |
| | | this.props.onSubmit(config.tabUuid) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (type === 'focus') { |
| | | let node = document.getElementById(uuid) |
| | | node.select() |
| | | node && node.select() |
| | | } else if (type === 'input') { |
| | | this.setState({value}) |
| | | this.props.onChange(value, true) |
| | |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | } else { |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | this.props.onSubmit() |
| | | this.props.onSubmit(config.tabUuid) |
| | | } |
| | | } |
| | | |
| | |
| | | if (config.enter === 'tab') { |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | } else if (config.enter === 'sub') { |
| | | config.tabUuid && MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | if (config.subFields) { |
| | | setTimeout(() => { |
| | | this.props.onSubmit() |
| | | this.props.onSubmit(config.tabUuid) |
| | | }, 1000) |
| | | } else { |
| | | this.props.onSubmit() |
| | | this.props.onSubmit(config.tabUuid) |
| | | } |
| | | } |
| | | }) |
| | |
| | | if (config.enter === 'tab') { |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | } else if (config.enter === 'sub') { |
| | | config.tabUuid && MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | if (config.linkFields || config.subFields || config.controlFields) { |
| | | setTimeout(() => { |
| | | this.props.onSubmit() |
| | | this.props.onSubmit(config.tabUuid) |
| | | }, 1000) |
| | | } else { |
| | | this.props.onSubmit() |
| | | this.props.onSubmit(config.tabUuid) |
| | | } |
| | | } |
| | | }) |
| | |
| | | if (config.enter === 'tab') { |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | } else { |
| | | MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | this.props.onSubmit() |
| | | config.tabUuid && MKEmitter.emit('mkFC', 'focus', config.tabUuid) |
| | | this.props.onSubmit(config.tabUuid) |
| | | } |
| | | } |
| | | |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Select, Button, Input, InputNumber, Radio } from 'antd' |
| | | import './index.scss' |
| | | // import './index.scss' |
| | | |
| | | class ExcelInColumn extends Component { |
| | | static propTpyes = { |
| | |
| | | import Api from '@/api' |
| | | import { checkSQL } from '@/utils/utils-custom.js' |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | import './index.scss' |
| | | // import './index.scss' |
| | | |
| | | class CustomForm extends Component { |
| | | static propTpyes = { |
| | |
| | | 取消 |
| | | </Button> |
| | | </Col> |
| | | <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}> |
| | | {!type ? <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}> |
| | | 强制保存: |
| | | <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/> |
| | | </Col> |
| | | </Col> : null} |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label="sql"> |
| | | {getFieldDecorator('sql', { |
| | |
| | | </span> |
| | | } key="scripts" id="mk-exin-script"> |
| | | <FullScripts |
| | | verify={verify} |
| | | scripts={verify.scripts} |
| | | getScriptsFullForm={() => this.scriptsFullForm} |
| | | getScriptsForm={() => this.scriptsForm} |
| | | handleStatus={this.handleStatus} |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Select, Button } from 'antd' |
| | | import './index.scss' |
| | | |
| | | // import './index.scss' |
| | | |
| | | class UniqueForm extends Component { |
| | | static propTpyes = { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Button, Input, InputNumber, Radio } from 'antd' |
| | | import './index.scss' |
| | | // import './index.scss' |
| | | |
| | | class ExcelOutColumn extends Component { |
| | | static propTpyes = { |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import { checkSQL } from '@/utils/utils-custom.js' |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | import './index.scss' |
| | | // import './index.scss' |
| | | |
| | | class CustomForm extends Component { |
| | | static propTpyes = { |
| | |
| | | _usefulFields.push(item.field) |
| | | _usefulFields.push(item.datefield) |
| | | _usefulFields.push(item.datefield + '1') |
| | | } else if (['dateweek', 'datemonth'].includes(item.type)) { |
| | | } else if (item.type === 'dateweek') { |
| | | _usefulFields.push(item.field) |
| | | _usefulFields.push(item.field + '1') |
| | | } else if (item.type === 'datemonth') { |
| | | if (item.match === '=') { |
| | | _usefulFields.push(item.field) |
| | | } else { |
| | | _usefulFields.push(item.field) |
| | | _usefulFields.push(item.field + '1') |
| | | } |
| | | } else if (item.type === 'daterange') { |
| | | let _skey = item.field |
| | | let _ekey = item.field + '1' |
| | |
| | | reTypes.initval = 'text' |
| | | } |
| | | |
| | | reTooltip.match = '' |
| | | if (type === 'text') { |
| | | reOptions.match = matchReg.class1 |
| | | } else if (type === 'multiselect') { |
| | |
| | | } else if (type === 'date') { |
| | | reOptions.match = matchReg.class4 |
| | | } else if (type === 'datemonth') { |
| | | reOptions.match = matchReg.class5 |
| | | reTooltip.match = '匹配模式为 between 时,搜索条件为大于月初小于月末,匹配模式为 = 时,搜索条件为等于当前月(YYYY-MM)。' |
| | | reOptions.match = matchReg.class6 |
| | | } else if (type === 'dateweek' || type === 'daterange' || type === 'range') { |
| | | reOptions.match = matchReg.class5 |
| | | } else if (type === 'checkcard') { |
| | |
| | | if (this.record.interception === 'func') { |
| | | shows.push('func') |
| | | } |
| | | } else if (type === 'popSelect') { |
| | | if (this.record.enter === 'tab' || this.record.enter === 'sub') { |
| | | shows.push('tabField') |
| | | } |
| | | } |
| | | |
| | | if (['multiselect', 'select', 'link', 'radio', 'checkbox', 'checkcard', 'cascader'].includes(type)) { |
| | |
| | | if (value === 'text' || value === 'number') { |
| | | this.record.enter = 'sub' |
| | | _fieldval.enter = 'sub' |
| | | } else if (value === 'select' || value === 'link') { |
| | | } else if (['select', 'link', 'popSelect', 'vercode'].includes(value)) { |
| | | _fieldval.enter = 'false' |
| | | } |
| | | |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Button, Modal, Tooltip, Radio, Select, Switch } from 'antd' |
| | | import { Form, Row, Col, Button, Modal, Tooltip, Radio, Select, Switch, notification } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | |
| | | editItem: record |
| | | }) |
| | | |
| | | this.props.form.setFieldsValue({ |
| | | sql: record.sql, |
| | | position: record.position || 'back' |
| | | }) |
| | | if (this.props.type) { |
| | | this.props.form.setFieldsValue({ |
| | | sql: record.sql |
| | | }) |
| | | } else { |
| | | this.props.form.setFieldsValue({ |
| | | sql: record.sql, |
| | | position: record.position || 'back' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { type } = this.props |
| | | const { editItem, skip } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (type === 'fullscreen' && err) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请输入sql!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (!err) { |
| | | values.uuid = editItem ? editItem.uuid : '' |
| | | values.position = values.position || (editItem ? editItem.position : 'front') |
| | | |
| | | if (type === 'fullscreen' && editItem) { |
| | | values.status = editItem.status || 'true' |
| | | } |
| | | |
| | | let pass = checkSQL(values.sql, 'customscript') |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { usefulfields, systemScripts, btn } = this.props |
| | | const { usefulfields, systemScripts, btn, type } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { skip } = this.state |
| | | const { editItem, skip } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form verify-custom-callback-scripts" id="verify-custom-callback-scripts"> |
| | | <Row gutter={24}> |
| | | <Col span={8}> |
| | | {!type ? <Col span={8}> |
| | | <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}> |
| | | {btn.cbTable} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={10}> |
| | | </Col> : null} |
| | | {!type ? <Col span={10}> |
| | | <Form.Item label={'报错字段'} style={{margin: 0, whiteSpace: 'nowrap'}}> |
| | | ErrorCode(增加后缀NT表示数据不回滚,如ENT、NNT、FNT、NMNT、CNT、-2NT), retmsg |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24} className="sqlfield"> |
| | | </Col> : null} |
| | | {!type ? <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address, mk_deleted</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并在单号生成或创建凭证时使用。'}><span style={{color: '#13c2c2'}}>BillCode, BVoucher, FIBVoucherDate, FiYear, ModularDetailCode</span></Tooltip> |
| | | {usefulfields ? <span>, {usefulfields}</span> : ''} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | </Col> : null} |
| | | {!type ? <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | <Form.Item style={{marginBottom: 0}} label={ |
| | | <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | </Col> : null} |
| | | {!type ? <Col span={8}> |
| | | <Form.Item label={'快捷添加'} style={{marginBottom: 0}}> |
| | | <Select |
| | | allowClear |
| | |
| | | )} |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | <Col span={5} className="add" style={{whiteSpace: 'nowrap'}}> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> |
| | | 保存 |
| | | {type === 'fullscreen' && !editItem ? '添加' : '保存'} |
| | | </Button> |
| | | <Button onClick={this.handleCancel} style={{marginBottom: 15, marginLeft: 10}}> |
| | | 取消 |
| | | </Button> |
| | | </Col> |
| | | <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}> |
| | | {!type ? <Col span={3} style={{paddingTop: '15px', fontSize: '12px', whiteSpace: 'nowrap'}}> |
| | | 强制保存: |
| | | <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/> |
| | | </Col> |
| | | </Col> : null} |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label="sql"> |
| | | {getFieldDecorator('sql', { |
| | |
| | | |
| | | class fullScripts extends Component { |
| | | static propTpyes = { |
| | | verify: PropTypes.object, |
| | | scripts: PropTypes.array, |
| | | getScriptsForm: PropTypes.func |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { verify, children } = this.props |
| | | const { scripts, children } = this.props |
| | | const { visible, scriptId } = this.state |
| | | |
| | | if (scripts.length === 0) return null |
| | | |
| | | return ( |
| | | <> |
| | | <BorderOutlined className="full-scripts" onClick={this.trigger}/> |
| | |
| | | > |
| | | <img className="unfull-scripts" src={MinView} onClick={() => this.setState({visible: false, scriptId: ''})} alt=""/> |
| | | <div className="script-table-wrap"> |
| | | {verify.scripts.map(item => { |
| | | {scripts.map(item => { |
| | | let title = item.sql.match(/^\s*\/\*.+\*\//) |
| | | title = title && title[0] ? title[0] : '' |
| | | let _text = title ? item.sql.replace(title, '') : item.sql |
| | |
| | | position: absolute; |
| | | top: 10px; |
| | | z-index: 1; |
| | | padding-top: 0px!important; |
| | | .ant-btn { |
| | | height: 28px; |
| | | } |
| | |
| | | </span> |
| | | } key="scripts" id="mk-normal-script"> |
| | | <FullScripts |
| | | verify={verify} |
| | | scripts={verify.scripts} |
| | | getScriptsFullForm={() => this.scriptsFullForm} |
| | | getScriptsForm={() => this.scriptsForm} |
| | | handleStatus={this.handleStatus} |
| | |
| | | {verify.cbScripts.length ? <span className="count-tip">{verify.cbScripts.length}</span> : null} |
| | | </span> |
| | | } key="cbScripts" id="mk-callback-script"> |
| | | <FullScripts |
| | | scripts={verify.cbScripts} |
| | | getScriptsFullForm={() => this.cbscriptsFullForm} |
| | | getScriptsForm={() => this.cbscriptsForm} |
| | | handleStatus={(item) => this.handleStatus(item, 'cbscripts')} |
| | | handleDelete={(item) => this.handleDelete(item, 'cbscripts')} |
| | | > |
| | | <CallBackCustomScript |
| | | type="fullscreen" |
| | | btn={this.props.card} |
| | | initsql={this.state.initsql} |
| | | customScripts={verify.cbScripts} |
| | | usefulfields={this.state.usefulfields} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.cbScriptsChange} |
| | | wrappedComponentRef={(inst) => this.cbscriptsFullForm = inst} |
| | | /> |
| | | </FullScripts> |
| | | <CallBackCustomScript |
| | | btn={this.props.card} |
| | | initsql={this.state.initsql} |
| | |
| | | class5: [{ |
| | | value: 'between', |
| | | text: 'between' |
| | | }], |
| | | class6: [{ |
| | | value: 'between', |
| | | text: 'between' |
| | | }, { |
| | | value: '=', |
| | | text: '=' |
| | | }] |
| | | } |
| | | |
| | |
| | | * @description 获取下级模块 |
| | | * @return {String} selfId 当前组件id |
| | | */ |
| | | static getSubModules (components, selfId, supId) { |
| | | static getSubModules (components, selfId, supId, has) { |
| | | let modules = [] |
| | | components.forEach(item => { |
| | | if (item.uuid === selfId || item.type === 'navbar') { |
| | |
| | | label: item.name, |
| | | disabled: supId === item.uuid |
| | | }) |
| | | |
| | | if (item.type === 'form' && item.subtype === 'simpleform' && item.wrap.refocus && supId !== item.uuid) { |
| | | modules.push({ |
| | | value: item.uuid + '$focus-refresh', |
| | | label: item.name + '(刷新-聚焦)', |
| | | }) |
| | | modules.push({ |
| | | value: item.uuid + '$focus-nofresh', |
| | | label: item.name + '(不刷新-聚焦)', |
| | | }) |
| | | } |
| | | } else if (item.type === 'tabs') { |
| | | if (item.subtype === 'tabletabs') { |
| | | item.subtabs.forEach(tab => { |
| | |
| | | type: 'tab', |
| | | value: f_tab.uuid, |
| | | label: f_tab.label, |
| | | children: this.getSubModules(f_tab.components, selfId, supId) |
| | | children: this.getSubModules(f_tab.components, selfId, supId, has) |
| | | } |
| | | |
| | | if (subItem.children.length === 0) { |
| | |
| | | } |
| | | if (btn.syncComponent && btn.syncComponent[0] === 'multiComponent' && btn.syncComponents) { |
| | | btn.syncComponents = btn.syncComponents.map(m => { |
| | | m.syncComId = m.syncComId.map(n => md5(commonId + n)) |
| | | m.syncComId = m.syncComId.map(n => { |
| | | if (/\$focus/.test(n)) { |
| | | return md5(commonId + n.split('$')[0]) + '$' + n.split('$')[1] |
| | | } |
| | | |
| | | return md5(commonId + n) |
| | | }) |
| | | return m |
| | | }) |
| | | } else if (btn.syncComponent && btn.syncComponent.length > 0) { |
| | | btn.syncComponent = btn.syncComponent.map(m => md5(commonId + m)) |
| | | btn.syncComponent = btn.syncComponent.map(m => { |
| | | if (/\$focus/.test(m)) { |
| | | return md5(commonId + m.split('$')[0]) + '$' + m.split('$')[1] |
| | | } |
| | | |
| | | return md5(commonId + m) |
| | | }) |
| | | } |
| | | } |
| | | |
| | |
| | | if (item.type === 'date') { |
| | | value = '1949-10-01 00:00:00.000' |
| | | } else if (item.type === 'datemonth') { |
| | | value = '1949-10-01 00:00:00.000,1949-10-02 00:00:00.000' |
| | | if (item.match === '=') { |
| | | value = '1949-10' |
| | | } else { |
| | | value = '1949-10-01 00:00:00.000,1949-10-02 00:00:00.000' |
| | | } |
| | | } else if (item.type === 'dateweek') { |
| | | value = '1949-10-01 00:00:00.000,1949-10-02 00:00:00.000' |
| | | } else if (item.type === 'daterange') { |
| | |
| | | searchText.push(`('${item.value}' ${item.match} '%'+${item.key}+'%')`) |
| | | } else if (item.type === 'date') { |
| | | searchText.push('(' + item.key + ' ' + item.match + ' \'' + item.value + '\')') |
| | | } else if (item.type === 'datemonth' || item.type === 'dateweek' || item.type === 'range') { |
| | | } else if (item.type === 'dateweek' || item.type === 'range') { |
| | | let val = item.value.split(',') |
| | | searchText.push('(' + item.key + ' >= \'' + val[0] + '\' AND ' + item.key + ' < \'' + val[1] + '\')') |
| | | } else if (item.type === 'datemonth') { |
| | | if (item.match === '=') { |
| | | searchText.push('(' + item.key + ' = \'' + item.value + '\')') |
| | | } else { |
| | | let val = item.value.split(',') |
| | | searchText.push('(' + item.key + ' >= \'' + val[0] + '\' AND ' + item.key + ' < \'' + val[1] + '\')') |
| | | } |
| | | } else if (item.type === 'daterange') { |
| | | let val = item.value.split(',') |
| | | |
| | |
| | | value: `'${item.value}'` |
| | | }) |
| | | } |
| | | } else if (['dateweek', 'datemonth', 'range'].includes(item.type)) { |
| | | |
| | | } else if (['dateweek', 'range'].includes(item.type)) { |
| | | let val = item.value.split(',') |
| | | options.push({ |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | |
| | | reg: new RegExp('@' + item.key + '1@', 'ig'), |
| | | value: `'${val[1]}'` |
| | | }) |
| | | } else if (item.type === 'datemonth') { |
| | | if (item.match === '=') { |
| | | options.push({ |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'${item.value}'` |
| | | }) |
| | | } else { |
| | | let val = item.value.split(',') |
| | | options.push({ |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'${val[0]}'` |
| | | }, { |
| | | reg: new RegExp('@' + item.key + '1@', 'ig'), |
| | | value: `'${val[1]}'` |
| | | }) |
| | | } |
| | | } else if (item.type === 'daterange') { |
| | | let val = item.value.split(',') |
| | | let _skey = item.key |
| | |
| | | newsearches[item.key] = _val |
| | | } |
| | | } else if (item.type === 'datemonth') { |
| | | // 月-过滤条件,从月开始至结束 |
| | | let _startval = '' |
| | | let _endval = '' |
| | | |
| | | if (item.value) { |
| | | _startval = moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000' |
| | | _endval = moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' |
| | | if (item.match === '=') { |
| | | newsearches[item.key] = item.value |
| | | } else { |
| | | // 月-过滤条件,从月开始至结束 |
| | | let _startval = '' |
| | | let _endval = '' |
| | | |
| | | if (item.value) { |
| | | _startval = moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000' |
| | | _endval = moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' |
| | | } |
| | | |
| | | newsearches[item.key] = _startval |
| | | newsearches[item.key + '1'] = _endval |
| | | } |
| | | |
| | | newsearches[item.key] = _startval |
| | | newsearches[item.key + '1'] = _endval |
| | | } else if (item.type === 'dateweek') { |
| | | let _startval = '' |
| | | let _endval = '' |
| | |
| | | |
| | | searchText.push('(' + item.key + ' ' + _match + ' \'' + _val + timetail + '\')') |
| | | } else if (item.type === 'datemonth') { // 月-过滤条件,从月开始至结束,结束时间为月末加一天的0点,方式为< |
| | | let _startval = moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000' |
| | | let _endval = moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' |
| | | |
| | | searchText.push('(' + item.key + ' >= \'' + _startval + '\' AND ' + item.key + ' < \'' + _endval + '\')') |
| | | if (item.match === '=') { |
| | | searchText.push('(' + item.key + ' = \'' + item.value + '\')') |
| | | } else { |
| | | let _startval = moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000' |
| | | let _endval = moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' |
| | | |
| | | searchText.push('(' + item.key + ' >= \'' + _startval + '\' AND ' + item.key + ' < \'' + _endval + '\')') |
| | | } |
| | | } else if (item.type === 'dateweek') { // 周-过滤条件 |
| | | let _startval = moment(item.value, 'YYYY-MM-DD' ).startOf('week').format('YYYY-MM-DD') + ' 00:00:00.000' |
| | | let _endval = moment(item.value, 'YYYY-MM-DD').endOf('week').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' |
| | |
| | | |
| | | options.push(item) |
| | | } else if (item.type === 'datemonth') { |
| | | let _startval = item.value ? moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000' : '1970-01-01 00:00:00.000' |
| | | let _endval = item.value ? moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' : '2050-01-01 00:00:00.000' |
| | | |
| | | let copy = JSON.parse(JSON.stringify(item)) |
| | | copy.key = copy.key + '1' |
| | | copy.value = _endval |
| | | |
| | | item.value = _startval |
| | | |
| | | options.push(item) |
| | | options.push(copy) |
| | | if (item.match === '=') { |
| | | options.push(item) |
| | | } else { |
| | | let _startval = item.value ? moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000' : '1970-01-01 00:00:00.000' |
| | | let _endval = item.value ? moment(item.value, 'YYYY-MM').endOf('month').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' : '2050-01-01 00:00:00.000' |
| | | |
| | | let copy = JSON.parse(JSON.stringify(item)) |
| | | copy.key = copy.key + '1' |
| | | copy.value = _endval |
| | | |
| | | item.value = _startval |
| | | |
| | | options.push(item) |
| | | options.push(copy) |
| | | } |
| | | } else if (item.type === 'dateweek') { |
| | | let _startval = item.value ? moment(item.value, 'YYYY-MM-DD').startOf('week').format('YYYY-MM-DD') + ' 00:00:00.000' : '1970-01-01 00:00:00.000' |
| | | let _endval = item.value ? moment(item.value, 'YYYY-MM-DD').endOf('week').add(1, 'days').format('YYYY-MM-DD') + ' 00:00:00.000' : '2050-01-01 00:00:00.000' |