| | |
| | | config.absFields = [] |
| | | config.mergeCol = false |
| | | |
| | | let mapCol = (cols) => { |
| | | cols.forEach(col => { |
| | | if (col.type === 'number') { |
| | | if (col.format === 'abs') { |
| | | config.absFields.push(col.field) |
| | | } |
| | | } else if (col.type === 'colspan' && col.subcols) { |
| | | mapCol(col.subcols) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | config.cols.forEach((col, index) => { |
| | | delete col.pops |
| | | |
| | |
| | | config.absFields.push(col.field) |
| | | } |
| | | } else if (col.type === 'colspan' && col.subcols) { |
| | | col.subcols.forEach(scol => { |
| | | if (scol.type === 'number') { |
| | | if (scol.format === 'abs') { |
| | | config.absFields.push(scol.field) |
| | | } |
| | | } |
| | | }) |
| | | mapCol(col.subcols) |
| | | } else if (col.type === 'text') { |
| | | if (col.editable === 'true' && col.editType === 'popSelect' && /^tab:/.test(col.initval)) { |
| | | config.mergeCol = config.mergeCol || [] |
| | |
| | | |
| | | updatecolumn = (config) => { |
| | | config.absFields = [] |
| | | config.cols.forEach(col => { |
| | | if (col.type === 'number') { |
| | | if (col.format === 'abs') { |
| | | config.absFields.push(col.field) |
| | | } |
| | | } else if (col.type === 'colspan' && col.subcols) { |
| | | col.subcols.forEach(scol => { |
| | | if (scol.type === 'number') { |
| | | if (scol.format === 'abs') { |
| | | config.absFields.push(scol.field) |
| | | } |
| | | config.hasExtend = false |
| | | let mapCol = (cols) => { |
| | | cols.forEach(col => { |
| | | if (col.type === 'number') { |
| | | if (col.format === 'abs') { |
| | | config.absFields.push(col.field) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } else if (col.type === 'extend') { |
| | | config.hasExtend = true |
| | | } else if (col.type === 'colspan' && col.subcols) { |
| | | mapCol(col.subcols) |
| | | } |
| | | }) |
| | | } |
| | | mapCol(config.cols) |
| | | |
| | | if (config.absFields.length) { |
| | | config.absFields = Array.from(new Set(config.absFields)) |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { systemScripts, setting, type } = this.props |
| | | const { systemScripts, setting, type, hasExtend } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const { usefulFields, skip } = this.state |
| | | |
| | |
| | | <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, 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={'排序、分页以及搜索条件变量,请按照@xxx@格式使用。使用@pageSize@或@orderBy@代表自定义分页,总数请以mk_total返回。'}>orderBy, pageSize, pageIndex{usefulFields ? ', ' + usefulFields : ''}{type === 'calendar' ? ', mk_year' : ''}{hasExtend ? ', mk_time' : ''}</Tooltip> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'url变量,请按照@xxx@格式使用。'}>{urlFields ? ', ' : ''}<span style={{color: '#13c2c2'}}>{urlFields}</span></Tooltip> |
| | | {window.GLOB.process ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'工作流变量,请按照@xxx@格式使用。'}>, <span style={{color: 'purple'}}>works_flow_code</span></Tooltip> : null} |
| | | </Form.Item> |
| | |
| | | _columns = [...columns, ...subColumns] |
| | | } |
| | | |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, _columns, searches, config.subtype) |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, _columns, searches, config.subtype, config.hasExtend) |
| | | |
| | | let _debugId = md5(r.sql) |
| | | |
| | |
| | | }}/> : null} |
| | | <CustomScriptsForm |
| | | type={config.type} |
| | | hasExtend={config.hasExtend} |
| | | setting={setting} |
| | | searches={searches} |
| | | defaultsql={defaultsql} |
| | |
| | | * @return {Object} setting 页面设置 |
| | | * @return {Array} columns 显示字段 |
| | | */ |
| | | static getDebugSql (setting, scripts, columns, searches = [], type) { |
| | | static getDebugSql (setting, scripts, columns, searches = [], type, hasExtend) { |
| | | let sql = '' |
| | | let error = '' |
| | | let _dataresource = '' |
| | |
| | | regs.push({reg: /@works_flow_code@/ig, value: `'${getuuid()}'`}) |
| | | } |
| | | |
| | | if (hasExtend) { |
| | | regs.push({reg: /@mk_time@/ig, value: '2024-04-29 17:20:00'}) |
| | | } |
| | | if (type === 'calendar') { |
| | | regs.push({reg: /@mk_year@/ig, value: '2024'}) |
| | | } |
| | |
| | | { reg: /@typename@/ig, value: `'admin'`}, |
| | | ) |
| | | |
| | | if (item.hasExtend) { |
| | | regs.push({reg: /@mk_time@/ig, value: '2024-04-29 17:20:00'}) |
| | | } |
| | | if (item.type === 'calendar') { |
| | | regoptions.push({ reg: /@mk_year@/ig, value: '2024' }) |
| | | } |
| | |
| | | try { // 配置信息解析 |
| | | let userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser))) |
| | | if (userConfig) { |
| | | shortcuts = userConfig.action |
| | | userConfig.printers.forEach(item => { |
| | | shortcuts = userConfig.action || [] |
| | | userConfig.printers && userConfig.printers.forEach(item => { |
| | | window.GLOB.UserCacheMap.set(item.parentId + item.uuid, item) |
| | | }) |
| | | } |
| | |
| | | }) |
| | | }) |
| | | } else if (userConfig) { |
| | | shortcuts = userConfig.action |
| | | userConfig.printers.forEach(item => { |
| | | shortcuts = userConfig.action || [] |
| | | userConfig.printers && userConfig.printers.forEach(item => { |
| | | window.GLOB.UserCacheMap.set(item.parentId + item.uuid, item) |
| | | }) |
| | | } |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { notification, Spin, Row, Col, Modal } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | try { // 配置信息解析 |
| | | let userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser))) |
| | | if (userConfig) { |
| | | shortcuts = userConfig.action |
| | | userConfig.printers.forEach(item => { |
| | | shortcuts = userConfig.action || [] |
| | | userConfig.printers && userConfig.printers.forEach(item => { |
| | | window.GLOB.UserCacheMap.set(item.parentId + item.uuid, item) |
| | | }) |
| | | } |
| | |
| | | |
| | | item.cols = getCols(item.cols) |
| | | |
| | | if (item.hasExtend) { |
| | | item.setting.hasExtend = true |
| | | item.setting.extendTime = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | item.colsCtrls = null |
| | | } |
| | | |
| | | if (item.subtype === 'editable') { |
| | | item.submit.logLabel = item.$menuname + '-提交' |
| | | item.submit.$menuId = item.uuid |
| | |
| | | try { // 配置信息解析 |
| | | let userConfig = JSON.parse(window.decodeURIComponent(window.atob(result.LongParamUser))) |
| | | if (userConfig) { |
| | | shortcuts = userConfig.action |
| | | userConfig.printers.forEach(item => { |
| | | shortcuts = userConfig.action || [] |
| | | userConfig.printers && userConfig.printers.forEach(item => { |
| | | window.GLOB.UserCacheMap.set(item.parentId + item.uuid, item) |
| | | }) |
| | | } |
| | |
| | | param.mk_year = year |
| | | } |
| | | |
| | | if (setting.hasExtend) { |
| | | param.mk_time = setting.extendTime |
| | | } |
| | | |
| | | if (setting.interType === 'inner') { |
| | | param.func = setting.innerFunc |
| | | |
| | |
| | | { reg: /@typename@/ig, value: `'admin'`}, |
| | | ) |
| | | |
| | | if (setting.hasExtend) { |
| | | regoptions.push({ reg: /@mk_time@/ig, value: setting.extendTime }) |
| | | } |
| | | if (setting.$re_year) { |
| | | regoptions.push({ reg: /@mk_year@/ig, value: year }) |
| | | } |