| | |
| | | "integrity": "sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==" |
| | | }, |
| | | "axios": { |
| | | "version": "0.19.0", |
| | | "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz", |
| | | "integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==", |
| | | "version": "1.6.7", |
| | | "resolved": "https://registry.npmjs.org/axios/-/axios-1.6.7.tgz", |
| | | "integrity": "sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==", |
| | | "requires": { |
| | | "follow-redirects": "1.5.10", |
| | | "is-buffer": "^2.0.2" |
| | | "follow-redirects": "^1.15.4", |
| | | "form-data": "^4.0.0", |
| | | "proxy-from-env": "^1.1.0" |
| | | }, |
| | | "dependencies": { |
| | | "follow-redirects": { |
| | | "version": "1.15.5", |
| | | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.5.tgz", |
| | | "integrity": "sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==" |
| | | }, |
| | | "form-data": { |
| | | "version": "4.0.0", |
| | | "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", |
| | | "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", |
| | | "requires": { |
| | | "asynckit": "^0.4.0", |
| | | "combined-stream": "^1.0.8", |
| | | "mime-types": "^2.1.12" |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | "axobject-query": { |
| | |
| | | "binary-extensions": "^1.0.0" |
| | | } |
| | | }, |
| | | "is-buffer": { |
| | | "version": "2.0.3", |
| | | "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz", |
| | | "integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw==" |
| | | }, |
| | | "is-callable": { |
| | | "version": "1.1.4", |
| | | "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", |
| | |
| | | "ipaddr.js": "1.9.0" |
| | | } |
| | | }, |
| | | "proxy-from-env": { |
| | | "version": "1.1.0", |
| | | "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", |
| | | "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==" |
| | | }, |
| | | "prr": { |
| | | "version": "1.0.1", |
| | | "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", |
| | |
| | | "@uiw/react-codemirror": "^2.2.1", |
| | | "antd": "^3.26.20", |
| | | "antd-mobile": "^5.14.2", |
| | | "axios": "^0.19.0", |
| | | "axios": "^1.6.7", |
| | | "babel-eslint": "10.0.2", |
| | | "babel-jest": "^24.8.0", |
| | | "babel-loader": "8.0.6", |
| | |
| | | "display": "standalone", |
| | | "theme_color": "#000000", |
| | | "background_color": "#ffffff", |
| | | "mk_version": "20240203" |
| | | "mk_version": "20240302" |
| | | } |
| | |
| | | |
| | | return Promise.reject(response.data) |
| | | } else { |
| | | if (response.config.requestId) { |
| | | response.data.$requestId = response.config.requestId |
| | | } |
| | | return Promise.resolve(response.data) |
| | | } |
| | | }, (error) => { |
| | |
| | | * @description 获取业务通用接口 |
| | | * 访问 'https://sso.mk9h.cn/webapi/dostars'或云端时,传入userid、LoginUID |
| | | */ |
| | | genericInterface (param, script = '', position) { |
| | | genericInterface (param, script = '', position, requestId = '') { |
| | | param.userid = param.userid || sessionStorage.getItem('UserID') || '' |
| | | param.lang = param.lang || sessionStorage.getItem('lang') || '' |
| | | param.SessionUid = localStorage.getItem('SessionUid') || '' |
| | |
| | | return axios({ |
| | | url: `${url}${param.func ? '/' + param.func : ''}`, |
| | | method: 'post', |
| | | data: JSON.stringify(param) |
| | | data: JSON.stringify(param), |
| | | requestId |
| | | }) |
| | | } |
| | | } |
| | |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { config } = this.state |
| | | |
| | | if (!is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) { |
| | | this.setState({ |
| | | config: fromJS(nextProps.config).toJS(), |
| | | options: fromJS(nextProps.config.options).toJS() |
| | | }) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | |
| | | MKEmitter.addListener('mkFC', this.mkFormControl) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { config } = this.state |
| | | |
| | | if (!is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) { |
| | | this.setState({ |
| | | config: fromJS(nextProps.config).toJS(), |
| | | options: fromJS(nextProps.config.options).toJS() |
| | | }) |
| | | } |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | |
| | | const getContent = () => { |
| | | if (card.eleType === 'sequence') { |
| | | return ( |
| | | <div style={{height: card.innerHeight || 'auto'}} className="ant-mk-text">1</div> |
| | | <div style={{height: card.innerHeight || 'auto'}} className="ant-mk-text">{card.prefix || ''}1{card.postfix || ''}</div> |
| | | ) |
| | | } else if (card.eleType === 'text' || card.eleType === 'number') { |
| | | let val = `${card.prefix || ''}${card.datatype === 'static' ? (card.value || '') : (card.field || '')}${card.postfix || ''}` |
| | |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | |
| | | const cardTypeOptions = { |
| | | sequence: ['eleType', 'width'], |
| | | sequence: ['eleType', 'width', 'prefix', 'postfix'], |
| | | text: ['eleType', 'datatype', 'format', 'width', 'height', 'prefix', 'postfix', 'link', 'anchors', 'noValue', 'bgImage', 'fixStyle', 'copyable', 'alignItems', 'sortField'], |
| | | number: ['eleType', 'datatype', 'width', 'height', 'prefix', 'postfix', 'noValue', 'fixStyle', 'alignItems'], |
| | | picture: ['eleType', 'datatype', 'width', 'lenWidRadio', 'maxWidth', 'link', 'noValue'], |
| | |
| | | required: false, |
| | | options: labelOptions, |
| | | controlFields: [ |
| | | {field: 'labelColor', values: ['true']} |
| | | {field: 'labelUnit', values: ['true', 'top', 'middle', 'bottom']} |
| | | ] |
| | | }, { |
| | | type: 'radio', |
| | |
| | | forbid: appType === 'mob', |
| | | required: false |
| | | }, { |
| | | type: 'text', |
| | | field: 'labelUnit', |
| | | label: '标注单位', |
| | | initval: card.labelUnit ||'', |
| | | forbid: appType === 'mob', |
| | | required: false |
| | | }, { |
| | | type: 'color', |
| | | field: 'lineColor', |
| | | label: '坐标轴颜色', |
| | |
| | | if (plot.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | let _color = color |
| | | |
| | | if (plot.labelColor === 'custom' && colors.has(key)) { |
| | |
| | | if (plot.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | |
| | | if (label === 'true' && plot.labelColor === 'custom' && colors.has(key)) { |
| | | lablecfg.style.fill = colors.get(key) |
| | |
| | | _chart.label('value*key', (value, key) => { |
| | | if (plot.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | |
| | | if (label === 'true' && plot.labelColor === 'custom' && colors.has(key)) { |
| | |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | |
| | | if (plot.label === 'true' && plot.labelColor === 'custom') { |
| | | lablecfg.style.fill = item.color |
| | |
| | | _chart.label(item.name, (value) => { |
| | | if (item.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | let _color = color |
| | | |
| | |
| | | if (plot.grid === 'hidden') { |
| | | yc.grid = null |
| | | } |
| | | if (plot.y_line === 'show') { |
| | | if (plot.tick === 'hidden') { |
| | | xc.tickLine = null |
| | | } |
| | | if (plot.x_line === 'hidden') { |
| | | xc.line = null |
| | | } |
| | | if (plot.y_line === 'hidden') { |
| | | yc.line = null |
| | | } else { |
| | | yc.line = {style: { stroke: '#D1D2CE' }} |
| | | } |
| | | if (plot.x_label === 'hidden') { |
| | | xc.label = null |
| | | } |
| | | if (plot.y_label === 'hidden') { |
| | | yc.label = null |
| | | } |
| | | |
| | | if (plot.lineColor) { |
| | | if (xc.tickLine !== null) { |
| | | xc.tickLine = {style: { stroke: plot.lineColor }} |
| | | } |
| | | if (xc.line !== null) { |
| | | xc.line = { style: { stroke: plot.lineColor } } |
| | | } |
| | | if (yc.grid !== null) { |
| | | yc.grid = { line: { style: { stroke: plot.lineColor } }} |
| | | } |
| | |
| | | if (plot.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && colors.has(key)) { |
| | | lablecfg.style.fill = colors.get(key) |
| | |
| | | if (plot.show === 'percent') { |
| | | value = value + '%' |
| | | } |
| | | if (plot.labelUnit) { |
| | | value = value + plot.labelUnit |
| | | } |
| | | |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && colors.has(key)) { |
| | | lablecfg.style.fill = colors.get(key) |
| | |
| | | this.props.updateConfig(component) |
| | | } |
| | | |
| | | checkComponent = (component) => { |
| | | this.updateComponent(component) |
| | | // checkComponent = (component) => { |
| | | // this.updateComponent(component) |
| | | |
| | | let _item = null |
| | | component.search.forEach(item => { |
| | | if (!_item && item.focus) { |
| | | _item = item |
| | | } |
| | | }) |
| | | if (_item) { |
| | | this.handleSearch(_item) |
| | | } |
| | | } |
| | | // let _item = null |
| | | // component.search.forEach(item => { |
| | | // if (!_item && item.focus) { |
| | | // _item = item |
| | | // } |
| | | // }) |
| | | // if (_item) { |
| | | // this.handleSearch(_item) |
| | | // } |
| | | // } |
| | | |
| | | /** |
| | | * @description 搜索条件顺序调整,或拖拽添加 |
| | |
| | | _card.search.push(item) |
| | | |
| | | this.updateComponent(_card) |
| | | this.handleSearch(item) |
| | | } else if (type === 'multil') { |
| | | _card.search.push(...item) |
| | | |
| | |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="mainsearch" card={card}/> |
| | | <PasteComponent config={card} options={['search', 'form']} updateConfig={this.checkComponent} /> |
| | | {/* <PasteComponent config={card} options={['search', 'form']} updateConfig={this.checkComponent} /> */} |
| | | <PasteComponent config={card} options={['search', 'form']} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/> |
| | | <DeleteOutlined className="close" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | </div> |
| | |
| | | width: 100%; |
| | | } |
| | | } |
| | | label[title=" "]::after, label[title=" "]::after { |
| | | display: none; |
| | | } |
| | | .page-card.advanced { |
| | | .ant-form-item-label label { |
| | | color: orange; |
| | |
| | | output: 'true', |
| | | required: 'false', |
| | | type: 'text', |
| | | noValue: 'true', |
| | | uuid: Utils.getuuid() |
| | | } |
| | | |
| | | if (item.type === 'number') { |
| | | cell.type = 'number' |
| | | cell.decimal = item.decimal |
| | | |
| | | if (item.noValue === 'hide') { |
| | | cell.noValue = 'false' |
| | | } |
| | | } |
| | | |
| | | columns.push(cell) |
| | |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'noValue', |
| | | label: '空值', |
| | | initVal: card.noValue || 'show', |
| | | tooltip: '数值为 0 或时间小于 1949-10-02 时,是否显示', |
| | | required: false, |
| | | options: [{ |
| | | value: 'show', |
| | | text: '显示' |
| | | }, { |
| | | value: 'hide', |
| | | text: '隐藏' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | _options.push('sortField') |
| | | } |
| | | |
| | | if (this.record.Hide !== 'true') { |
| | | if (['number', 'formula'].includes(this.record.type)) { |
| | | _options.push('noValue') |
| | | } else if (this.record.type === 'text' && ['YYYY-MM-DD', 'YYYY-MM-DD HH:mm:ss'].includes(this.record.textFormat)) { |
| | | _options.push('noValue') |
| | | } |
| | | } |
| | | |
| | | return _options |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (key === 'format' && value === 'percent') { |
| | | this.props.form.setFieldsValue({postfix: '%'}) |
| | | } else if (['perspective', 'eval', 'IsSort'].includes(key)) { |
| | | } else if (['perspective', 'eval', 'IsSort', 'textFormat'].includes(key)) { |
| | | let _options = this.getOptions() |
| | | |
| | | this.setState({ |
| | |
| | | key: 'noValue', |
| | | label: '空值', |
| | | initVal: card.noValue || 'show', |
| | | tooltip: '当值为0时是否显示', |
| | | tooltip: '数值为 0 或时间小于 1949-10-02 时,是否显示', |
| | | required: false, |
| | | options: [{ |
| | | value: 'show', |
| | |
| | | } else if (this.record.type === 'custom' && this.record.IsSort === 'true') { |
| | | _options.push('sortField') |
| | | } |
| | | if (['number', 'formula'].includes(this.record.type) && this.record.Hide !== 'true') { |
| | | |
| | | if (this.record.Hide !== 'true') { |
| | | if (['number', 'formula'].includes(this.record.type)) { |
| | | _options.push('noValue') |
| | | } else if (this.record.type === 'text' && ['YYYY-MM-DD', 'YYYY-MM-DD HH:mm:ss'].includes(this.record.textFormat)) { |
| | | _options.push('noValue') |
| | | } |
| | | } |
| | | |
| | | return _options |
| | |
| | | return item |
| | | }) |
| | | }) |
| | | } else if (['editable', 'editType', 'resourceType', 'ctrlField', 'eval', 'Hide', 'IsSort'].includes(key)) { |
| | | } else if (['editable', 'editType', 'resourceType', 'ctrlField', 'eval', 'Hide', 'IsSort', 'textFormat'].includes(key)) { |
| | | let _options = this.getOptions() |
| | | |
| | | this.setState({ |
| | |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'noValue', |
| | | label: '空值', |
| | | initVal: card.noValue || 'show', |
| | | tooltip: '数值为 0 或时间小于 1949-10-02 时,是否显示', |
| | | required: false, |
| | | options: [{ |
| | | value: 'show', |
| | | text: '显示' |
| | | }, { |
| | | value: 'hide', |
| | | text: '隐藏' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | key: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | _options.push('sortField') |
| | | } |
| | | |
| | | if (this.record.Hide !== 'true') { |
| | | if (['number', 'formula'].includes(this.record.type)) { |
| | | _options.push('noValue') |
| | | } else if (this.record.type === 'text' && ['YYYY-MM-DD', 'YYYY-MM-DD HH:mm:ss'].includes(this.record.textFormat)) { |
| | | _options.push('noValue') |
| | | } |
| | | } |
| | | |
| | | return _options |
| | | } |
| | | |
| | |
| | | } |
| | | } else if (key === 'format' && value === 'percent') { |
| | | this.props.form.setFieldsValue({postfix: '%'}) |
| | | } else if (['perspective', 'eval', 'IsSort'].includes(key)) { |
| | | } else if (['perspective', 'eval', 'IsSort', 'textFormat'].includes(key)) { |
| | | let _options = this.getOptions() |
| | | |
| | | this.setState({ |
| | |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="可用字段" className="field-able"> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, LoginUID, SessionUid, UserID, Appkey, time_id, typename, datam</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</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'排序、分页以及搜索条件变量,请按照@xxx@格式使用。使用@pageSize@或@orderBy@代表自定义分页,总数请以mk_total返回。'}>orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}{type === 'calendar' ? ', mk_year' : ''}</Tooltip> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'url变量,请按照@xxx@格式使用。'}>{urlFields ? ', ' : ''}<span style={{color: '#13c2c2'}}>{urlFields}</span></Tooltip> |
| | |
| | | |
| | | submitDataSource = () => { |
| | | const { config, mainSearch } = this.props |
| | | const { activeKey, setting, columns, subColumns, scripts, cols } = this.state |
| | | const { activeKey, setting, columns, subColumns, scripts, cols, median } = this.state |
| | | |
| | | if (config.subtype === 'dualdatacard') { |
| | | let arr = columns.map(col => col.field.toLowerCase()) |
| | |
| | | message: '字段集中不可使用' + _arr.join('、') + '!注:此字段为提交时的系统字段。', |
| | | duration: 5 |
| | | }) |
| | | return Promise.reject() |
| | | } |
| | | } |
| | | |
| | | if (median.interType === 'system') { |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | _loading = true |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | | if (_loading) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({activeKey: 'scripts'}) |
| | | return Promise.reject() |
| | | } |
| | | } |
| | |
| | | } |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, 'submit') |
| | | } else if (activeKey === 'scripts') { |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | | _loading = true |
| | | } else if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | _loading = true |
| | | } |
| | | |
| | | if (_loading) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!', |
| | | duration: 5 |
| | | }) |
| | | reject() |
| | | return |
| | | } |
| | | |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, 'submit') |
| | | } |
| | | }) |
| | |
| | | this.resetVideo(result.data || []) |
| | | } else if (card.typecharone === 'color') { |
| | | window.GLOB.app_colors = result.data || [] |
| | | sessionStorage.setItem('app_colors', JSON.stringify(result.data || [])) |
| | | this.resetColor(result.data || []) |
| | | } |
| | | this.setState({editvisible: false}) |
| | |
| | | _this.resetVideo(res.data || []) |
| | | } else if (item.typecharone === 'color') { |
| | | window.GLOB.app_colors = res.data || [] |
| | | sessionStorage.setItem('app_colors', JSON.stringify(res.data || [])) |
| | | _this.resetColor(res.data || []) |
| | | } |
| | | } else { |
| | |
| | | let config = JSON.stringify(this.props.config) |
| | | const _this = this |
| | | |
| | | if (new RegExp(field, 'ig').test(config)) { |
| | | if (new RegExp('@' + field + '@', 'ig').test(config)) { |
| | | confirm({ |
| | | title: `配置中存在@${field}@,确定删除吗?`, |
| | | content: '', |
| | |
| | | |
| | | if (app_colors) { |
| | | this.getColors(app_colors) |
| | | } else if (sessionStorage.getItem('app_colors')) { |
| | | let app_colors = JSON.parse(sessionStorage.getItem('app_colors')) |
| | | window.GLOB.app_colors = app_colors |
| | | this.getColors(app_colors) |
| | | } else { |
| | | if (loading) { |
| | | this.getColors([]) |
| | |
| | | Api.getCloudConfig(param).then(res => { |
| | | loading = false |
| | | window.GLOB.app_colors = res.data || [] |
| | | sessionStorage.setItem('app_colors', JSON.stringify(res.data || [])) |
| | | this.getColors(res.data || []) |
| | | }) |
| | | } |
| | |
| | | contents.push( |
| | | <div className={'ant-col ant-col-' + card.width} key={card.uuid} style={_style_} span={card.width}> |
| | | <div style={card.style}> |
| | | <div className={'ant-mk-text line1' + className} style={{height: card.innerHeight || 'auto'}}><span className="sequence-wrap" style={_style}>{data.$Index || ''}</span></div> |
| | | <div className={'ant-mk-text line1' + className} style={{height: card.innerHeight || 'auto'}}><span className="sequence-wrap" style={_style}>{card.prefix || ''}{data.$Index || ''}{card.postfix || ''}</span></div> |
| | | </div> |
| | | </div> |
| | | ) |
| | |
| | | |
| | | if (config.setting.supModule && !BID && config.wrap.supKey !== 'false') { // BID 不存在时,不做查询 |
| | | this.loaded = true |
| | | this.requestId = '' |
| | | |
| | | this.setState({ |
| | | activeKey: '', |
| | |
| | | let _orderBy = orderBy || config.setting.order || '' |
| | | let param = UtilsDM.getQueryDataParams(config.setting, searches, _orderBy, pageIndex, pageSize, BID) |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | this.requestId = config.uuid + new Date().getTime() |
| | | |
| | | let result = await Api.genericInterface(param, '', '', this.requestId) |
| | | if (result.status) { |
| | | if (result.$requestId && this.requestId !== result.$requestId) return |
| | | |
| | | let start = 1 |
| | | if (config.setting.laypage) { |
| | | start = pageSize * (pageIndex - 1) + 1 |
| | |
| | | |
| | | if (config.setting.supModule && !BID && config.wrap.supKey !== 'false') { // BID 不存在时,不做查询 |
| | | this.loaded = true |
| | | this.requestId = '' |
| | | |
| | | this.setState({ |
| | | activeKey: '', |
| | |
| | | let _orderBy = orderBy || config.setting.order || '' |
| | | let param = UtilsDM.getQueryDataParams(config.setting, searches, _orderBy, pageIndex, pageSize, BID) |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | this.requestId = config.uuid + new Date().getTime() |
| | | |
| | | let result = await Api.genericInterface(param, '', '', this.requestId) |
| | | if (result.status) { |
| | | if (result.$requestId && this.requestId !== result.$requestId) return |
| | | |
| | | let start = 1 |
| | | if (config.setting.laypage) { |
| | | start = pageSize * (pageIndex - 1) + 1 |
| | |
| | | style: { fill: _config.plot.color } |
| | | }} |
| | | let yc = {label: { style: { fill: _config.plot.color } }} |
| | | |
| | | if (_config.plot.grid === 'hidden') { |
| | | yc.grid = null |
| | | } |
| | | if (_config.plot.y_line === 'show') { |
| | | if (_config.plot.tick === 'hidden') { |
| | | xc.tickLine = null |
| | | } |
| | | if (_config.plot.x_line === 'hidden') { |
| | | xc.line = null |
| | | } |
| | | if (_config.plot.y_line === 'hidden') { |
| | | yc.line = null |
| | | } else { |
| | | yc.line = {style: { stroke: '#D1D2CE' }} |
| | | } |
| | | if (_config.plot.x_label === 'hidden') { |
| | | xc.label = null |
| | | } |
| | | if (_config.plot.y_label === 'hidden') { |
| | | yc.label = null |
| | | } |
| | | |
| | | if (_config.plot.lineColor) { |
| | | if (xc.tickLine !== null) { |
| | | xc.tickLine = {style: { stroke: _config.plot.lineColor }} |
| | | } |
| | | if (xc.line !== null) { |
| | | xc.line = { style: { stroke: _config.plot.lineColor } } |
| | | } |
| | | if (yc.grid !== null) { |
| | | yc.grid = { line: { style: { stroke: _config.plot.lineColor } }} |
| | | } |
| | |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | return { |
| | | content: val, |
| | | style: { |
| | |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | |
| | | if (plot.$label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) { |
| | | lablecfg.style.fill = plot.$colors.get(key) |
| | |
| | | } else if (plot.show === 'thdSeparator') { |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | if (plot.$label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) { |
| | | lablecfg.style.fill = plot.$colors.get(key) |
| | |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && item.color) { |
| | | lablecfg.style.fill = item.color |
| | | } |
| | |
| | | } else if (item.show === 'thdSeparator') { |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | |
| | | return { |
| | |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) { |
| | | lablecfg.style.fill = plot.$colors.get(key) |
| | |
| | | val = val + '' |
| | | val = val.replace(/\d{1,3}(?=(\d{3})+(\.\d*)?$)/g, '$&,') |
| | | } |
| | | if (plot.labelUnit) { |
| | | val = val + plot.labelUnit |
| | | } |
| | | |
| | | if (plot.label === 'true' && plot.labelColor === 'custom' && plot.$colors && plot.$colors.has(key)) { |
| | | lablecfg.style.fill = plot.$colors.get(key) |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import { Chart, registerShape } from '@antv/g2' |
| | | import { Spin, notification, Modal } from 'antd' |
| | | import { DownloadOutlined } from '@ant-design/icons' |
| | | // import { DownloadOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | } |
| | | <NormalHeader config={config} /> |
| | | <div className="canvas-wrap"> |
| | | {config.plot.download === 'enable' && this.state.chart ? <DownloadOutlined onClick={this.downloadImage} className="system-color download"/> : null} |
| | | {/* {config.plot.download === 'enable' && this.state.chart ? <DownloadOutlined onClick={this.downloadImage} className="system-color download"/> : null} */} |
| | | <div className="canvas" id={this.state.chartId}></div> |
| | | </div> |
| | | </div> |
| | |
| | | import { Chart } from '@antv/g2' |
| | | import DataSet, { DataView } from '@antv/data-set' |
| | | import { Spin, Empty, notification, Modal } from 'antd' |
| | | import { DownloadOutlined } from '@ant-design/icons' |
| | | // import { DownloadOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | } |
| | | <NormalHeader config={config} BID={BID} refresh={this.refreshSearch} /> |
| | | <div className="canvas-wrap"> |
| | | {config.plot.download === 'enable' && this.state.chart && !empty ? <DownloadOutlined onClick={this.downloadImage} className="system-color download"/> : null} |
| | | {/* {config.plot.download === 'enable' && this.state.chart && !empty ? <DownloadOutlined onClick={this.downloadImage} className="system-color download"/> : null} */} |
| | | <div className={'canvas' + (empty ? ' empty' : '')} id={this.state.chartId}></div> |
| | | </div> |
| | | {empty ? <Empty description={false}/> : null} |
| | |
| | | content = <span>{col.prefix || ''}<Encrypts value={content} />{col.postfix || ''}</span> |
| | | } |
| | | |
| | | if (col.noValue === 'hide' && content < '1949-10-02') { |
| | | content = '' |
| | | } |
| | | |
| | | if (col.textFormat !== 'encryption') { |
| | | content = (col.prefix || '') + content + (col.postfix || '') |
| | | } |
| | |
| | | resProps.rowSpan = record['$$' + col.field] |
| | | } |
| | | |
| | | if (!record.$disabled && (col.linkThdMenu || col.linkurl)) { |
| | | content = ( |
| | | <div> |
| | | <div className="link-menu" onDoubleClick={(e) => triggerLink(e, col, record)}></div> |
| | | {content} |
| | | </div> |
| | | ) |
| | | } |
| | | |
| | | resProps.children = content |
| | | |
| | | if (!record.$disabled && (col.linkThdMenu || col.linkurl)) { |
| | | style = style || {} |
| | | style.cursor = 'pointer' |
| | | |
| | | return (<td {...resProps} className={className} onDoubleClick={() => triggerLink(col, record)} style={style}/>) |
| | | } |
| | | } else if (col.type === 'number') { |
| | | let content = '' |
| | | try { |
| | | content = parseFloat(record[col.field]) |
| | | if (isNaN(content)) { |
| | | content = '' |
| | | } |
| | | if (col.noValue === 'hide' && content === 0) { |
| | | content = '' |
| | | } |
| | | } catch (e) { |
| | |
| | | resProps.rowSpan = record['$$' + col.field] |
| | | } |
| | | |
| | | if (!record.$disabled && (col.linkThdMenu || col.linkurl)) { |
| | | content = ( |
| | | <div> |
| | | <div className="link-menu" onDoubleClick={(e) => triggerLink(e, col, record)}></div> |
| | | {content} |
| | | </div> |
| | | ) |
| | | } |
| | | |
| | | resProps.children = content |
| | | |
| | | if (!record.$disabled && (col.linkThdMenu || col.linkurl)) { |
| | | style = style || {} |
| | | style.cursor = 'pointer' |
| | | |
| | | return (<td {...resProps} className={className} onDoubleClick={() => triggerLink(col, record)} style={style}/>) |
| | | } |
| | | } else if (col.type === 'picture') { |
| | | let photos = '' |
| | | if (record[col.field]) { |
| | |
| | | // eslint-disable-next-line |
| | | let func = new Function('data', col.formula) |
| | | content = func([record]) |
| | | |
| | | if (col.noValue === 'hide' && content === 0) { |
| | | content = '' |
| | | } |
| | | } catch (e) { |
| | | console.warn(e) |
| | | content = '' |
| | |
| | | try { |
| | | // eslint-disable-next-line |
| | | content = eval(content) |
| | | |
| | | if (col.noValue === 'hide' && content === 0) { |
| | | content = '' |
| | | } |
| | | } catch (e) { |
| | | console.info(content) |
| | | console.warn(e) |
| | |
| | | } |
| | | |
| | | // 字段透视 |
| | | triggerLink = (e, item, record) => { |
| | | e.stopPropagation() |
| | | |
| | | triggerLink = (item, record) => { |
| | | let __param = { |
| | | $searchkey: item.field, |
| | | $searchval: record[item.field] || '', |
| | |
| | | display: none; |
| | | } |
| | | } |
| | | .action-col { |
| | | .ant-btn > .anticon + span { |
| | | margin-left: 3px; |
| | | } |
| | | button { |
| | | border: 0; |
| | | background-color: transparent; |
| | | color: #1890ff; |
| | | box-shadow: none; |
| | | padding: 0 5px; |
| | | .anticon-loading { |
| | | display: none; |
| | | } |
| | | } |
| | | > div { |
| | | margin: 0 3px; |
| | | } |
| | | > button { |
| | | margin: 0 3px; |
| | | } |
| | | .ant-btn.ant-btn-loading:not(.ant-btn-circle):not(.ant-btn-circle-outline):not(.ant-btn-icon-only) { |
| | | padding-left: 0px; |
| | | } |
| | | } |
| | | } |
| | | .ant-table-tbody > tr > td[rowspan] { |
| | | vertical-align: middle; |
| | | } |
| | | .ant-table-tbody > tr > td.ant-table-column-has-actions { |
| | | .content { |
| | | position: relative; |
| | | z-index: 1; |
| | | word-wrap: break-word; |
| | | word-break: break-word; |
| | | } |
| | | } |
| | | // .ant-table-tbody > tr > td.ant-table-column-has-actions { |
| | | // .content { |
| | | // position: relative; |
| | | // z-index: 1; |
| | | // word-wrap: break-word; |
| | | // word-break: break-word; |
| | | // } |
| | | // } |
| | | .ant-table-tbody > tr > td { |
| | | position: relative; |
| | | .link-menu { |
| | | position: absolute; |
| | | top: 0px; |
| | | left: 0px; |
| | | right: 0px; |
| | | bottom: 0px; |
| | | opacity: 0; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | .ant-table-tbody > tr > td .content { |
| | | p { |
| | | margin-bottom: 2px; |
| | | } |
| | | span { |
| | | display: inline-block; |
| | | margin-right: 5px; |
| | | } |
| | | } |
| | | .ant-table-tbody > tr > td .button { |
| | | .ant-btn { |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | // .ant-table-tbody > tr > td .content { |
| | | // p { |
| | | // margin-bottom: 2px; |
| | | // } |
| | | // span { |
| | | // display: inline-block; |
| | | // margin-right: 5px; |
| | | // } |
| | | // } |
| | | // .ant-table-tbody > tr > td .button { |
| | | // .ant-btn { |
| | | // margin-bottom: 10px; |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | // .ant-table-body::-webkit-scrollbar { |
| | |
| | | this.setState({ |
| | | data: [], |
| | | selectedData: [], |
| | | loading: false, |
| | | total: 0 |
| | | }) |
| | | |
| | |
| | | if (setting.$hasSyncModule) { |
| | | MKEmitter.emit('syncBalconyData', config.uuid, [], false) |
| | | } |
| | | |
| | | this.requestId = '' |
| | | return |
| | | } |
| | | |
| | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID) |
| | | |
| | | let result = await Api.genericInterface(param, setting.js_script) |
| | | this.requestId = config.uuid + new Date().getTime() |
| | | |
| | | let result = await Api.genericInterface(param, setting.js_script, '', this.requestId) |
| | | if (result.status) { |
| | | if (result.$requestId && this.requestId !== result.$requestId) return |
| | | |
| | | if (repage === 'false' && result.data && result.data.length === 0 && result.total > 0 && pageIndex > 1) { |
| | | let _pageIndex = Math.ceil(result.total / pageSize) |
| | | |
| | |
| | | this.setState({ |
| | | data: [], |
| | | selectedData: [], |
| | | loading: false, |
| | | total: 0 |
| | | }) |
| | | reset && MKEmitter.emit('resetTable', config.uuid, 'true') // 列表重置 |
| | | |
| | | this.requestId = '' |
| | | return |
| | | } |
| | | |
| | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID) |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | this.requestId = config.uuid + new Date().getTime() |
| | | |
| | | let result = await Api.genericInterface(param, '', '', this.requestId) |
| | | if (result.status) { |
| | | if (result.$requestId && this.requestId !== result.$requestId) return |
| | | |
| | | reset && MKEmitter.emit('resetTable', config.uuid, repage) // 列表重置 |
| | | |
| | | let start = 1 |
| | |
| | | content = <span>{col.prefix || ''}<Encrypts value={content} />{col.postfix || ''}</span> |
| | | } |
| | | |
| | | if (col.noValue === 'hide' && content < '1949-10-02') { |
| | | content = '' |
| | | } |
| | | |
| | | if (col.textFormat !== 'encryption') { |
| | | content = (col.prefix || '') + content + (col.postfix || '') |
| | | } |
| | |
| | | content = <span>{col.prefix || ''}<Encrypts value={content} />{col.postfix || ''}</span> |
| | | } |
| | | |
| | | if (col.noValue === 'hide' && content < '1949-10-02') { |
| | | content = '' |
| | | } |
| | | |
| | | if (col.textFormat !== 'encryption') { |
| | | content = (col.prefix || '') + content + (col.postfix || '') |
| | | } |
| | |
| | | color: inherit; |
| | | overflow: hidden; |
| | | } |
| | | .action-col { |
| | | .ant-btn > .anticon + span { |
| | | margin-left: 3px; |
| | | } |
| | | button { |
| | | border: 0; |
| | | background-color: transparent; |
| | | color: #1890ff; |
| | | box-shadow: none; |
| | | padding: 0 5px; |
| | | .anticon-loading { |
| | | display: none; |
| | | } |
| | | } |
| | | > div { |
| | | margin: 0 3px; |
| | | } |
| | | > button { |
| | | margin: 0 3px; |
| | | } |
| | | .ant-btn.ant-btn-loading:not(.ant-btn-circle):not(.ant-btn-circle-outline):not(.ant-btn-icon-only) { |
| | | padding-left: 0px; |
| | | } |
| | | } |
| | | } |
| | | .ant-table-tbody > tr > td[rowspan] { |
| | | vertical-align: middle; |
| | | } |
| | | .ant-table-tbody > tr > td.ant-table-column-has-actions { |
| | | .content { |
| | | position: relative; |
| | | z-index: 1; |
| | | word-wrap: break-word; |
| | | word-break: break-word; |
| | | } |
| | | } |
| | | // .ant-table-tbody > tr > td.ant-table-column-has-actions { |
| | | // .content { |
| | | // position: relative; |
| | | // z-index: 1; |
| | | // word-wrap: break-word; |
| | | // word-break: break-word; |
| | | // } |
| | | // } |
| | | .ant-table-tbody > tr > td { |
| | | position: relative; |
| | | .link-menu { |
| | | position: absolute; |
| | | top: 0px; |
| | | left: 0px; |
| | | right: 0px; |
| | | bottom: 0px; |
| | | opacity: 0; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | .ant-table-tbody > tr > td .content { |
| | | p { |
| | | margin-bottom: 2px; |
| | | } |
| | | span { |
| | | display: inline-block; |
| | | margin-right: 5px; |
| | | } |
| | | } |
| | | .ant-table-tbody > tr > td .button { |
| | | .ant-btn { |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | // .ant-table-tbody > tr > td .content { |
| | | // p { |
| | | // margin-bottom: 2px; |
| | | // } |
| | | // span { |
| | | // display: inline-block; |
| | | // margin-right: 5px; |
| | | // } |
| | | // } |
| | | // .ant-table-tbody > tr > td .button { |
| | | // .ant-btn { |
| | | // margin-bottom: 10px; |
| | | // } |
| | | // } |
| | | } |
| | | } |
| | | |
| | |
| | | this.setState({ |
| | | data: [], |
| | | selectedData: [], |
| | | loading: false, |
| | | total: 0 |
| | | }) |
| | | |
| | |
| | | } |
| | | |
| | | this.loaded = true |
| | | this.requestId = '' |
| | | return |
| | | } |
| | | |
| | |
| | | let _orderBy = orderBy || setting.order |
| | | let param = UtilsDM.getQueryDataParams(setting, searches, _orderBy, pageIndex, pageSize, BID) |
| | | |
| | | let result = await Api.genericInterface(param) |
| | | this.requestId = config.uuid + new Date().getTime() |
| | | |
| | | let result = await Api.genericInterface(param, '', '', this.requestId) |
| | | if (result.status) { |
| | | if (result.$requestId && this.requestId !== result.$requestId) return |
| | | |
| | | this.loaded = true |
| | | if (config.$cache && type === 'init') { |
| | | Api.writeCacheConfig(config.uuid, result.data || [], BID) |
| | |
| | | } |
| | | } |
| | | |
| | | tab.$menuname = (MenuName || '') + '-' + (tab.label || '') |
| | | |
| | | return true |
| | | }) |
| | | |
| | |
| | | config = JSON.stringify(config) |
| | | config = config.replace(/@mywebsite@\//ig, window.GLOB.baseurl) |
| | | config = JSON.parse(config) |
| | | config.MenuName = Tab.logLabel || Tab.label || '' |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | config = '' |
| | |
| | | } |
| | | } |
| | | |
| | | tab.$menuname = (Tab.logLabel || Tab.label || '') + '-' + (tab.label || '') |
| | | |
| | | return true |
| | | }) |
| | | |
| | |
| | | val = Math.round(val * col.round) / col.round |
| | | // val = val.toFixed(col.decimal) |
| | | } |
| | | if (col.noValue === 'false' && val === 0) { |
| | | val = '' |
| | | } |
| | | } |
| | | |
| | | _row[col.Column] = val |
| | |
| | | val = Math.round(val * col.round) / col.round |
| | | // val = val.toFixed(col.decimal) |
| | | } |
| | | if (col.noValue === 'false' && val === 0) { |
| | | val = '' |
| | | } |
| | | } |
| | | |
| | | _row[col.Column] = val |
| | |
| | | cancelText: '支付遇到问题', |
| | | onOk() { |
| | | // 支付后刷新界面 |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, 'grid', btn) |
| | | MKEmitter.emit('reloadMenuView', btn.$MenuID) |
| | | }, |
| | | onCancel() { |
| | | MKEmitter.emit('refreshByButtonResult', btn.$menuId, 'grid', btn) |
| | |
| | | sql = sql.replace(/@typename@/ig, `'admin'`) |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | sql = sql.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') |
| | | sql = sql.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, `'Y'`) |
| | | } else { |
| | | sql = sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') |
| | | sql = sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, `''`) |
| | | } |
| | | |
| | | if (window.GLOB.debugger === true) { |
| | |
| | | console.warn(e) |
| | | _item.value = '' |
| | | } |
| | | } else if (item.interception === 'charTure') { |
| | | let str = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | let result = '' |
| | | for (let i = 0 ; i < str.length; i++) { |
| | | let code = str.charCodeAt(i) |
| | | if (code >= 65281 && code <= 65373) { |
| | | result += String.fromCharCode(str.charCodeAt(i) - 65248) |
| | | } else if (code === 12288) { |
| | | result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32) |
| | | } else { |
| | | result += str.charAt(i) |
| | | } |
| | | } |
| | | _item.value = result |
| | | } else { |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | } |
| | |
| | | console.warn(e) |
| | | _item.value = '' |
| | | } |
| | | } else if (item.interception === 'charTure') { |
| | | let str = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | let result = '' |
| | | for (let i = 0 ; i < str.length; i++) { |
| | | let code = str.charCodeAt(i) |
| | | if (code >= 65281 && code <= 65373) { |
| | | result += String.fromCharCode(str.charCodeAt(i) - 65248) |
| | | } else if (code === 12288) { |
| | | result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32) |
| | | } else { |
| | | result += str.charAt(i) |
| | | } |
| | | } |
| | | _item.value = result |
| | | } else { |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | } |
| | |
| | | console.warn(e) |
| | | _item.value = '' |
| | | } |
| | | } else if (item.interception === 'charTure') { |
| | | let str = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | let result = '' |
| | | for (let i = 0 ; i < str.length; i++) { |
| | | let code = str.charCodeAt(i) |
| | | if (code >= 65281 && code <= 65373) { |
| | | result += String.fromCharCode(str.charCodeAt(i) - 65248) |
| | | } else if (code === 12288) { |
| | | result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32) |
| | | } else { |
| | | result += str.charAt(i) |
| | | } |
| | | } |
| | | _item.value = result |
| | | } else { |
| | | _item.value = _item.value.replace(/(^\s*|\s*$)/g, '') |
| | | } |
| | |
| | | .ant-form-item-label { |
| | | text-overflow: ellipsis; |
| | | } |
| | | label[title=" "]::after, label[title=" "]::after { |
| | | display: none; |
| | | } |
| | | .daterange .ant-calendar-picker-input { |
| | | padding: 4px 20px 4px 5px; |
| | | font-size: 13px; |
| | |
| | | .ant-form-item-label { |
| | | text-overflow: ellipsis; |
| | | } |
| | | label[title=" "]::after, label[title=" "]::after { |
| | | display: none; |
| | | } |
| | | .daterange .ant-calendar-picker-input { |
| | | padding: 4px 20px 4px 5px; |
| | | font-size: 13px; |
| | |
| | | values.limit = '' |
| | | } |
| | | |
| | | this.props.columnChange(values) |
| | | this.props.columnChange(values, () => { |
| | | this.props.form.setFieldsValue({ |
| | | Column: '', |
| | | Text: '' |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | columnChange = (values) => { |
| | | columnChange = (values, callback) => { |
| | | let verify = JSON.parse(JSON.stringify(this.state.verify)) |
| | | |
| | | let fields = verify.columns.map(item => item.Column) |
| | |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else { |
| | | callback() |
| | | } |
| | | |
| | | values.uuid = Utils.getuuid() |
| | |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> |
| | | {verify.excelHandle === 'true' ? <Col span={24} style={{paddingLeft: '30px'}}> |
| | | <Form.Item wrapperCol={ {xs: { span: 24 }, sm: { span: 24 }} } label=""> |
| | | {getFieldDecorator('excel_func', { |
| | | initialValue: verify.excel_func || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请填写自定义逻辑!' |
| | | } |
| | | ] |
| | | })(<CodeMirror mode="text/javascript" theme="cobalt" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {verify.excelHandle !== 'true' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="bottomLeft" title="导入时工作表名与excel中必须一致,注:工作表名为Sheet1且excel中仅有一个工作表时不进行表名验证。"> |
| | |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {verify.excelHandle !== 'true' ? <Col span={8}> |
| | | <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="bottomLeft" title="忽略首行时,会校验excel中表头名称与excel列设置是否一致。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | initialValue: verify.range || 0 |
| | | })(<InputNumber min={0} max={100} precision={0} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | {verify.excelHandle === 'true' ? <Col span={24} style={{paddingLeft: '30px'}}> |
| | | <Form.Item wrapperCol={ {xs: { span: 24 }, sm: { span: 24 }} } label=""> |
| | | {getFieldDecorator('excel_func', { |
| | | initialValue: verify.excel_func || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请填写自定义逻辑!' |
| | | } |
| | | ] |
| | | })(<CodeMirror mode="text/javascript" theme="cobalt" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | this.props.columnChange(values) |
| | | this.props.columnChange(values, () => { |
| | | this.props.form.setFieldsValue({ |
| | | Column: '', |
| | | Text: '', |
| | | Width: 20 |
| | | }) |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | |
| | | editable: true, |
| | | required: false, |
| | | keyCol: true, |
| | | width: '12%', |
| | | width: '8%', |
| | | render: (text) => { |
| | | if (text === 'image') { |
| | | return '图片' |
| | |
| | | inputType: 'radio', |
| | | editable: true, |
| | | required: false, |
| | | width: '12%', |
| | | width: '10%', |
| | | render: (text) => { |
| | | if (text !== 'false') { |
| | | return '是' |
| | |
| | | editable: true, |
| | | required: false, |
| | | keyVals: ['number'], |
| | | width: '12%', |
| | | width: '10%', |
| | | render: (text, record) => { |
| | | if (record.type !== 'number') return '' |
| | | |
| | | if (text === 'true') { |
| | | return '是' |
| | | } else { |
| | | return '否' |
| | | } |
| | | }, |
| | | options: [ |
| | | {value: 'true', text: '是'}, |
| | | {value: 'false', text: '否'} |
| | | ] |
| | | }, |
| | | { |
| | | title: '0值导出', |
| | | dataIndex: 'noValue', |
| | | inputType: 'radio', |
| | | editable: true, |
| | | required: false, |
| | | keyVals: ['number'], |
| | | width: '10%', |
| | | render: (text, record) => { |
| | | if (record.type !== 'number') return '' |
| | | |
| | | if (text !== 'false') { |
| | | return '是' |
| | | } else { |
| | | return '否' |
| | |
| | | col.type = col.type || 'text' |
| | | col.output = col.output || 'true' |
| | | col.required = col.required || 'false' |
| | | col.noValue = col.noValue || 'true' |
| | | |
| | | if (!['text', 'image', 'number'].includes(col.type)) { |
| | | if (/^Decimal/ig.test(col.type)) { |
| | |
| | | }) |
| | | } |
| | | |
| | | columnChange = (values) => { |
| | | columnChange = (values, callback) => { |
| | | let verify = JSON.parse(JSON.stringify(this.state.verify)) |
| | | |
| | | let fields = verify.columns.map(item => item.Column) |
| | |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else { |
| | | callback() |
| | | } |
| | | values.uuid = Utils.getuuid() |
| | | values.abs = 'false' |
| | |
| | | return |
| | | } |
| | | |
| | | if (verify.dataType === 'custom') { |
| | | if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({activeKey: 'scripts'}) |
| | | return |
| | | } |
| | | } |
| | | if (this.columnRef && this.columnRef.state.editingKey) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段未保存!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (card.intertype === 'system' && verify.dataType !== 'custom' && verify.columns.length > 0 && config.$c_ds && config.setting.interType === 'system' && config.columns && config.columns.length > 0) { |
| | | let cols = [] |
| | | let columns = config.columns.map(c => c.field) |
| | |
| | | }) |
| | | }) |
| | | } else if (activeKey === 'columns') { |
| | | if (this.columnRef && this.columnRef.state.editingKey) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段未保存!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (this.props.card.intertype !== 'system' || verify.dataType !== 'custom') { |
| | | resolve(verify) |
| | | } else { |
| | |
| | | }, verify.scripts) |
| | | } |
| | | } else if (activeKey === 'scripts') { |
| | | if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在未保存脚本,请点击确定保存,或点击取消放弃修改!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.setState({loading: true}) |
| | | this.sqlverify(() => { // 验证成功 |
| | | this.setState({ |
| | |
| | | col.type = col.type || 'text' |
| | | col.output = col.output || 'true' |
| | | col.required = col.required || 'false' |
| | | col.noValue = col.noValue || 'true' |
| | | col.Width = col.Width || 20 |
| | | |
| | | if (!['text', 'image', 'number'].includes(col.type)) { |
| | | if (/^Decimal/ig.test(col.type)) { |
| | |
| | | .ant-form-item-label { |
| | | float: left; |
| | | } |
| | | label[title=" "]::after, label[title=" "]::after { |
| | | display: none; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | float: left; |
| | | .ant-select { |
| | |
| | | key: 'inputType', |
| | | label: '加密显示', |
| | | initVal: card.inputType || 'text', |
| | | tooltip: '输入框内容以 ****** 显示。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'text', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | type: 'select', |
| | | key: 'interception', |
| | | label: '截取方式', |
| | | label: '文本预处理', |
| | | initVal: card.interception || 'true', |
| | | tooltip: '提交时的文本处理方式,空白字符指开头或结尾的空白字符。', |
| | | tooltip: '提交时的文本处理方式。注:全角转半角时会去除首尾空格', |
| | | options: [{ |
| | | value: 'false', |
| | | text: '无' |
| | | }, { |
| | | value: 'true', |
| | | text: '空白字符' |
| | | text: '去掉首尾空格' |
| | | // }, { |
| | | // value: 'char', |
| | | // text: '全角转半角' |
| | | }, { |
| | | value: 'charTure', |
| | | text: '全角转半角' |
| | | }, { |
| | | value: 'func', |
| | | text: '自定义函数' |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {verify.printEnable === 'true' ? <Col span={8}> |
| | | <Form.Item label="打印模板" required> |
| | | <Form.Item label="打印模板" required help={(() => { |
| | | if (verify.printTempId) { |
| | | return <span onClick={() => { |
| | | sessionStorage.setItem('mk-print-temp', verify.printTempId) |
| | | window.open('#/hs') |
| | | |
| | | setTimeout(() => { |
| | | sessionStorage.removeItem('mk-print-temp') |
| | | }, 50) |
| | | }} style={{color: '#1890ff', cursor: 'pointer', fontSize: '13px'}}>#查看模板</span> |
| | | } |
| | | return null |
| | | })()}> |
| | | <MkPrintTemps value={verify.printTempId} onChange={this.onPrintIdChange}/> |
| | | </Form.Item> |
| | | </Col> : null} |
| | |
| | | static propTpyes = { |
| | | btn: PropTypes.object, // 按钮信息 |
| | | initsql: PropTypes.string, // 初始化脚本 |
| | | usefulfields: PropTypes.string, // 可用字段 |
| | | formfields: PropTypes.string, |
| | | colfields: PropTypes.string, |
| | | systemScripts: PropTypes.array, // 系统脚本 |
| | | customScripts: PropTypes.array, // 自定义脚本 |
| | | scriptsChange: PropTypes.func // 表单 |
| | |
| | | } |
| | | |
| | | if (!err) { |
| | | if (/^[\s\n]+$/.test(values.sql)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请输入sql!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | values.uuid = editItem ? editItem.uuid : '' |
| | | values.position = values.position || (editItem ? editItem.position : 'front') |
| | | |
| | |
| | | |
| | | // 数据权限 |
| | | sql = sql.replace(/@\$|\$@/ig, '').replace(/\$check@|@check\$/ig, '') |
| | | sql = sql.replace(/@datam@/ig, `''`) |
| | | sql = sql.replace(/@typename@/ig, `'debug'`) |
| | | |
| | | if (skip) { |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { usefulfields, systemScripts, btn, type } = this.props |
| | | const { formfields, colfields, systemScripts, btn, type } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { editItem, skip } = this.state |
| | | const formItemLayout = { |
| | |
| | | } |
| | | } |
| | | |
| | | // let _usefulfields = usefulfields ? usefulfields.replace(/(BID|ID|LoginUID|SessionUid|UserID|Appkey|UserName|FullName|RoleID|mk_departmentcode|mk_organization|mk_nation|mk_province|mk_city|mk_district|mk_address|mk_user_type|BillCode|BVoucher|FIBVoucherDate|FiYear|ModularDetailCode),\s/ig, '') : null |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form verify-custom-callback-scripts" id="verify-custom-callback-scripts"> |
| | | <Row gutter={24}> |
| | | {!type ? <Col span={8}> |
| | | <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}> |
| | | <Form.Item label="表名" style={{whiteSpace: 'nowrap', margin: 0}}> |
| | | {btn.cbTable} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!type ? <Col span={10}> |
| | | <Form.Item label={'报错字段'} style={{margin: 0, whiteSpace: 'nowrap'}}> |
| | | <Form.Item label="报错字段" style={{margin: 0, whiteSpace: 'nowrap'}}> |
| | | ErrorCode(增加后缀NT表示数据不回滚,如ENT、NNT、FNT、NMNT、CNT、-2NT), retmsg |
| | | </Form.Item> |
| | | </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>, |
| | | <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, datam</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> : ''} |
| | | {formfields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="表单变量,系统会定义变量并赋值。">, <span style={{color: '#8E44AD'}}>{formfields}</span></Tooltip> : ''} |
| | | {colfields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="字段集变量,系统会定义变量并赋值。">, {colfields}</Tooltip> : ''} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!type ? <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!type ? <Col span={8}> |
| | | <Form.Item label={'快捷添加'} style={{marginBottom: 0}}> |
| | | <Form.Item label="快捷添加" style={{marginBottom: 0}}> |
| | | <Select |
| | | allowClear |
| | | showSearch |
| | |
| | | class CustomForm extends Component { |
| | | static propTpyes = { |
| | | btn: PropTypes.object, // 按钮 |
| | | usefulfields: PropTypes.string, // 可用字段 |
| | | formfields: PropTypes.string, |
| | | colfields: PropTypes.string, |
| | | initsql: PropTypes.string, // 可用字段 |
| | | customChange: PropTypes.func // 表单 |
| | | } |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { usefulfields, btn } = this.props |
| | | const { formfields, colfields, btn } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | } |
| | | } |
| | | |
| | | // let _usefulfields = usefulfields ? usefulfields.replace(/(BID|ID|LoginUID|SessionUid|UserID|Appkey|UserName|FullName|RoleID|mk_departmentcode|mk_organization|mk_nation|mk_province|mk_city|mk_district|mk_address|mk_user_type|BillCode|BVoucher|FIBVoucherDate|FiYear|ModularDetailCode),\s/ig, '') : null |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form" id="verifycard2"> |
| | | <Row gutter={24}> |
| | |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id</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> : ''} |
| | | {formfields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="表单变量,系统会定义变量并赋值。">, <span style={{color: '#8E44AD'}}>{formfields}</span></Tooltip> : ''} |
| | | {colfields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="字段集变量,系统会定义变量并赋值。">, {colfields}</Tooltip> : ''} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={21} className="sql"> |
| | |
| | | static propTpyes = { |
| | | type: PropTypes.any, |
| | | btn: PropTypes.object, |
| | | usefulfields: PropTypes.string, |
| | | formfields: PropTypes.string, |
| | | colfields: PropTypes.string, |
| | | initsql: PropTypes.string, |
| | | defaultsql: PropTypes.string, |
| | | useDefaultSql: PropTypes.any, |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { usefulfields, systemScripts, btn, type, workFlow } = this.props |
| | | const { formfields, colfields, systemScripts, btn, type, workFlow } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { editItem, skip } = this.state |
| | | const formItemLayout = { |
| | |
| | | } |
| | | |
| | | let _type = type || '' |
| | | |
| | | // let _usefulfields = usefulfields ? usefulfields.replace(/(BID|ID|LoginUID|SessionUid|UserID|Appkey|UserName|FullName|RoleID|mk_departmentcode|mk_organization|mk_nation|mk_province|mk_city|mk_district|mk_address|mk_user_type|BillCode|BVoucher|FIBVoucherDate|FiYear|ModularDetailCode),\s/ig, '') : null |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form verify-custom-scripts" id={'verify-custom-scripts' + _type}> |
| | |
| | | </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> : ''} |
| | | {window.GLOB.process && workFlow === 'true' ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'工作流变量,请按照@xxx@格式使用。注:check_userids、notice_userids 在审批或驳回时有效。'}>,<span style={{color: 'purple'}}> works_flow_code, works_flow_name, works_flow_param, works_flow_detail_id, status, statusname, work_group, work_grade, start_type, check_type, notice_type, check_userids, notice_userids</span></Tooltip> : null} |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="公共值,请按照@xxx@格式使用。"><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename, datam</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> |
| | | {formfields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="表单变量,系统会定义变量并赋值。">, <span style={{color: '#8E44AD'}}>{formfields}</span></Tooltip> : ''} |
| | | {colfields ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="字段集变量,系统会定义变量并赋值。">, {colfields}</Tooltip> : ''} |
| | | {window.GLOB.process && workFlow === 'true' ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="工作流变量,请按照@xxx@格式使用。注:check_userids、notice_userids 在审批或驳回时有效。">,<span style={{color: 'purple'}}> works_flow_code, works_flow_name, works_flow_param, works_flow_detail_id, status, statusname, work_group, work_grade, start_type, check_type, notice_type, check_userids, notice_userids</span></Tooltip> : null} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!_type ? <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | |
| | | emailCodes: [], // 邮箱模板 |
| | | verify: {}, |
| | | fields: [], |
| | | usefulfields: '', |
| | | formfields: '', |
| | | colfields: '', |
| | | defaultsql: '', // 默认Sql |
| | | orderModular: [], |
| | | orderModularDetail: [], |
| | |
| | | _fields = card.modal.fields || [] |
| | | } |
| | | |
| | | let _usefulfields = ['UserName', 'FullName', 'RoleID', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'ModularDetailCode', 'tbid', 'mk_deleted'] |
| | | let sysfields = ['UserName', 'FullName', 'RoleID', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'ModularDetailCode', 'tbid', 'mk_deleted', 'bid'] |
| | | let _declare = ['@UserName nvarchar(50)', '@FullName nvarchar(50)', '@RoleID nvarchar(512)', '@mk_departmentcode nvarchar(512)', '@mk_organization nvarchar(512)', '@mk_user_type nvarchar(20)', '@mk_nation nvarchar(50)', '@mk_province nvarchar(50)', '@mk_city nvarchar(50)', '@mk_district nvarchar(50)', '@mk_address nvarchar(100)', '@ErrorCode nvarchar(50)', '@retmsg nvarchar(4000)', '@BillCode nvarchar(50)', '@BVoucher nvarchar(50)', '@FIBVoucherDate nvarchar(50)', '@FiYear nvarchar(50)', '@ModularDetailCode nvarchar(50)', '@bid nvarchar(50)', '@tbid nvarchar(50)', '@mk_deleted int'] |
| | | let _select = ['@UserName=\'\'', '@FullName=\'\'', '@RoleID=\'\'', '@mk_departmentcode=\'\'', '@mk_organization=\'\'', '@mk_user_type=\'\'', '@mk_nation=\'\'', '@mk_province=\'\'', '@mk_city=\'\'', '@mk_district=\'\'', '@mk_address=\'\'', '@ErrorCode=\'\'', '@retmsg=\'\'', '@BillCode=\'\'', '@BVoucher=\'\'', '@FIBVoucherDate=\'\'', '@FiYear=\'\'', '@ModularDetailCode=\'\'', '@bid=\'\'', '@mk_deleted=1'] |
| | | let fieldArr = _usefulfields.map(_f => _f.toLowerCase()) |
| | | |
| | | let fieldArr = sysfields.map(_f => _f.toLowerCase()) |
| | | let hasBid = false |
| | | |
| | | _usefulfields = [] |
| | | |
| | | fieldArr.push('bid') |
| | | |
| | | let verIndex = _fields.findIndex(item => item.type === 'vercode') |
| | | if (verIndex > -1) { |
| | |
| | | }) |
| | | } |
| | | |
| | | let formfields = [] |
| | | _fields = _fields.filter(_f => _f.field) |
| | | _fields.forEach(_f => { |
| | | if (_f.field.toLowerCase() === 'bid') { |
| | |
| | | |
| | | fieldArr.push(_f.field.toLowerCase()) |
| | | |
| | | _usefulfields.push(_f.field) |
| | | formfields.push(_f.field) |
| | | |
| | | let _fieldlen = _f.fieldlength || 50 |
| | | |
| | |
| | | let unionFields = fromJS(_fields).toJS() |
| | | let formArr = _fields.map(_f => _f.field.toLowerCase()) |
| | | |
| | | let colfields = [] |
| | | if (card.Ot !== 'notRequired' && columns) { |
| | | columns.forEach(_f => { |
| | | if (!_f.field) return |
| | |
| | | if (fieldArr.includes(key)) return |
| | | |
| | | fieldArr.push(key) |
| | | _usefulfields.push(_f.field) |
| | | colfields.push(_f.field) |
| | | |
| | | if (_f.datatype) { // 自定义字段 |
| | | if (/decimal/ig.test(_f.datatype)) { |
| | |
| | | columnsFields: _columns, |
| | | initsql: _sql, |
| | | defaultsql: _defaultsql, |
| | | usefulfields: _usefulfields.join(', '), |
| | | formfields: formfields.join(', '), |
| | | colfields: colfields.join(', '), |
| | | uniqueColumns: this.state.uniqueColumns.map(col => { |
| | | if (col.dataIndex === 'field') { |
| | | col.options = uniqueFields |
| | |
| | | verify.scripts.push(values) |
| | | } |
| | | |
| | | if (/@bvoucher(\s|\))/ig.test(values.sql)) { |
| | | if (/@bvoucher(\s|\))/ig.test(values.sql) && !/s_BVoucher_Create/ig.test(values.sql)) { |
| | | if (verify.voucher && verify.voucher.enabled) { |
| | | |
| | | } else if (card.Ot !== 'notRequired' && columns) { |
| | |
| | | |
| | | render() { |
| | | const { card, columns } = this.props |
| | | const { activeKey, verifyInter, verify, fields, uniqueFields, uniqueColumns, unionFields, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, cbScriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail, notes, emailCodes, appType } = this.state |
| | | const { activeKey, verifyInter, verify, fields, uniqueFields, uniqueColumns, unionFields, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, cbScriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail, notes, emailCodes, appType, formfields, colfields } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | <CustomForm |
| | | btn={this.props.card} |
| | | initsql={this.state.initsql} |
| | | usefulfields={this.state.usefulfields} |
| | | formfields={formfields} |
| | | colfields={colfields} |
| | | customChange={this.customChange} |
| | | wrappedComponentRef={(inst) => this.customForm = inst} |
| | | /> |
| | |
| | | customScripts={verify.scripts} |
| | | useDefaultSql={verify.default !== 'false'} |
| | | defaultsql={this.state.defaultsql} |
| | | usefulfields={this.state.usefulfields} |
| | | formfields={formfields} |
| | | colfields={colfields} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | wrappedComponentRef={(inst) => this.scriptsFullForm = inst} |
| | |
| | | customScripts={verify.scripts} |
| | | useDefaultSql={verify.default !== 'false'} |
| | | defaultsql={this.state.defaultsql} |
| | | usefulfields={this.state.usefulfields} |
| | | formfields={formfields} |
| | | colfields={colfields} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | wrappedComponentRef={(inst) => this.scriptsForm = inst} |
| | |
| | | btn={this.props.card} |
| | | initsql={this.state.initsql} |
| | | customScripts={verify.cbScripts} |
| | | usefulfields={this.state.usefulfields} |
| | | formfields={formfields} |
| | | colfields={colfields} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.cbScriptsChange} |
| | | wrappedComponentRef={(inst) => this.cbscriptsFullForm = inst} |
| | |
| | | btn={this.props.card} |
| | | initsql={this.state.initsql} |
| | | customScripts={verify.cbScripts} |
| | | usefulfields={this.state.usefulfields} |
| | | formfields={formfields} |
| | | colfields={colfields} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.cbScriptsChange} |
| | | wrappedComponentRef={(inst) => this.cbscriptsForm = inst} |
| | |
| | | |
| | | if (card.$c_ds) { |
| | | columns = card.columns.map(c => c.field) |
| | | |
| | | if (card.setting.primaryKey && !columns.includes(card.setting.primaryKey)) { |
| | | let key = card.setting.primaryKey.toLowerCase() |
| | | columns.forEach(f => { |
| | | if (f.toLowerCase() === key) { |
| | | card.setting.primaryKey = f |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (card.setting.interType === 'system' && card.setting.execute !== 'false' && !card.setting.dataresource) { |
| | | errors.push({ level: 0, detail: '未设置数据源!'}) |
| | | } else if (card.setting.interType === 'system' && card.setting.execute === 'false' && card.scripts.filter(script => script.status !== 'false').length === 0) { |
| | |
| | | |
| | | // exec_type 解码字段:LText、LText1、LText2、custom_script、DateCount |
| | | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss.SSS') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | param.username = userName |
| | |
| | | fullName: sessionStorage.getItem('Full_Name') || '' |
| | | } |
| | | |
| | | if (config.MenuName) { |
| | | param.menuname = config.MenuName |
| | | } |
| | | param.menuname = config.MenuName || config.$menuname || '' |
| | | |
| | | param.exec_type = window.GLOB.execType || 'y' |
| | | param.LText = Utils.formatOptions(_LText.join(' union all '), param.exec_type) |
| | |
| | | if (item.type === 'date') { |
| | | if (!item.value) { |
| | | if (['>=', '>'].includes(item.match)) { |
| | | item.value = '1970-01-01 00:00:00.000' |
| | | item.value = '1900-01-01 00:00:00.000' |
| | | } else if (['<=', '<'].includes(item.match)) { |
| | | item.value = '2050-01-01 00:00:00.000' |
| | | item.value = '3000-01-01 00:00:00.000' |
| | | } |
| | | } else if (search.precision === 'day') { |
| | | if (['>=', '>'].includes(item.match)) { |
| | |
| | | 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 _startval = item.value ? moment(item.value, 'YYYY-MM').startOf('month').format('YYYY-MM-DD') + ' 00:00:00.000' : '1900-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' : '3000-01-01 00:00:00.000' |
| | | |
| | | let copy = JSON.parse(JSON.stringify(item)) |
| | | copy.key = copy.key + '1' |
| | |
| | | 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' |
| | | let _startval = item.value ? moment(item.value, 'YYYY-MM-DD').startOf('week').format('YYYY-MM-DD') + ' 00:00:00.000' : '1900-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' : '3000-01-01 00:00:00.000' |
| | | |
| | | let copy = JSON.parse(JSON.stringify(item)) |
| | | copy.key = copy.key + '1' |
| | |
| | | options.push(item) |
| | | options.push(copy) |
| | | } else if (item.type === 'daterange') { |
| | | let _startval = '1970-01-01 00:00:00.000' |
| | | let _endval = '2050-01-01 00:00:00.000' |
| | | let _startval = '1900-01-01 00:00:00.000' |
| | | let _endval = '3000-01-01 00:00:00.000' |
| | | |
| | | if (item.value) { |
| | | let val = item.value.split(',') |
| | |
| | | margin-right: 15px; |
| | | } |
| | | a { |
| | | display: block; |
| | | margin-bottom: 5px; |
| | | color: var(--mk-sys-font-color); |
| | | } |
| | | } |
| | |
| | | if (keyCode === 46 && editItemId && editItemType !== 'Template') { |
| | | this.deleteItem() |
| | | } |
| | | if (e.ctrlKey && keyCode === 81 && editItemId && editItemType !== 'Template') { |
| | | this.copyItem() |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | copyItem = () => { |
| | | const { editItemId, config, fields } = this.state |
| | | |
| | | let cell = config.elements.filter(item => item.uuid === editItemId)[0] |
| | | |
| | | if (!cell) return |
| | | |
| | | let item = {...cell} |
| | | |
| | | item.left = item.left + parseInt(item.width / 4) |
| | | item.top = item.top + parseInt(item.height / 4) |
| | | item.uuid = Utils.getuuid() |
| | | |
| | | if (item.left + item.width > config.width) { |
| | | item.left = config.width - item.width |
| | | } |
| | | if (item.top + item.height > config.height) { |
| | | item.top = config.height - item.height |
| | | } |
| | | |
| | | let _config = fromJS(config).toJS() |
| | | |
| | | _config.elements.push(item) |
| | | |
| | | let _formlist = [] |
| | | if (item.type === 'text') { |
| | | _formlist = getTextForm(item, fields) |
| | | } else if (item.type === 'barcode') { |
| | | _formlist = getBarcodeForm(item, fields) |
| | | } else if (item.type === 'qrcode') { |
| | | _formlist = getQrcodeForm(item, fields) |
| | | } else if (item.type === 'image') { |
| | | _formlist = getImageForm(item, fields) |
| | | } |
| | | |
| | | this.setState({ |
| | | config: _config, |
| | | editItemId: item.uuid, |
| | | editItemType: item.type, |
| | | formlist: _formlist |
| | | }, () => { |
| | | this.resetview() |
| | | }) |
| | | } |
| | | |
| | | deleteItem = () => { |
| | | const _this = this |
| | | const { editItemId, config } = this.state |
| | |
| | | return ( |
| | | <div className="print-template"> |
| | | <DndProvider backend={HTML5Backend}> |
| | | <header className="print-header-container ant-menu-dark">模板制作</header> |
| | | <header className="print-header-container ant-menu-dark"> |
| | | 模板制作 |
| | | <div>快捷键:Delete(删除元素)、ctrl + q(复制元素)</div> |
| | | </header> |
| | | <aside className="tools"> |
| | | <Card className="tool-bar" title="工具栏"> |
| | | {printItems.map((item, index) => { |
| | |
| | | text-align: center; |
| | | color: #fff; |
| | | background: #001529; |
| | | |
| | | div { |
| | | position: absolute; |
| | | top: 0px; |
| | | right: 30px; |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | .tools { |
| | | width: 240px; |
| | |
| | | ParentID: 'mk_app', |
| | | TypeCharOne: app.kei_no, |
| | | typename: app.typename, |
| | | lang: app.lang |
| | | lang: app.lang, |
| | | TYPE: 30 |
| | | }).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |