| | |
| | | import NormalTable from '@/assets/mobimg/normal-table.png' |
| | | import Pie from '@/assets/mobimg/pie.png' |
| | | import Editor from '@/assets/mobimg/editor.png' |
| | | import SandBox from '@/assets/mobimg/sandbox.png' |
| | | import Pie1 from '@/assets/mobimg/ring.png' |
| | | import Pie2 from '@/assets/mobimg/nightingale.png' |
| | | import Mainsearch from '@/assets/mobimg/mainsearch.png' |
| | |
| | | { type: 'menu', url: Pie, component: 'pie', subtype: 'pie', title: '饼图', width: 12 }, |
| | | { type: 'menu', url: Pie1, component: 'pie', subtype: 'ring', title: '环图', width: 12 }, |
| | | { type: 'menu', url: Editor, component: 'editor', subtype: 'brafteditor', title: '富文本', width: 24 }, |
| | | { type: 'menu', url: Editor, component: 'code', subtype: 'sandbox', title: '自定义', width: 24 }, |
| | | { type: 'menu', url: SandBox, component: 'code', subtype: 'sandbox', title: '自定义', width: 24 }, |
| | | { type: 'menu', url: Pie2, component: 'pie', subtype: 'nightingale', title: '南丁格尔图', width: 12 }, |
| | | { type: 'menu', url: group, component: 'group', subtype: 'normalgroup', title: '分组', width: 24, forbid: ['billPrint'] }, |
| | | ] |
| | |
| | | return ( |
| | | <div style={{display: 'inline-block'}}> |
| | | {type !== 'menu' ? <Icon type="snippets" style={{color: 'purple'}} onClick={() => {this.setState({visible: true})}} /> : null} |
| | | {type === 'menu' ? <Button type="link" style={{padding: '5px'}} icon="snippets" onClick={() => {this.setState({visible: true})}}>粘贴</Button> : null} |
| | | {type === 'menu' ? <Button className="Menu-config-paste" icon="snippets" onClick={() => {this.setState({visible: true})}}>粘贴</Button> : null} |
| | | <Modal |
| | | title="粘贴" |
| | | visible={visible} |
| | |
| | | .Menu-config-paste { |
| | | border-color: #40a9ff; |
| | | color: #40a9ff; |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | // import { fromJS } from 'immutable' |
| | | import { Modal, Button } from 'antd' |
| | | |
| | | // import Utils from '@/utils/utils.js' |
| | | // import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | | // const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform')) |
| | | |
| | | class PasteController extends Component { |
| | | state = { |
| | | visible: false |
| | | } |
| | | |
| | | addSource = () => { |
| | | |
| | | } |
| | | |
| | | render() { |
| | | const { visible } = this.state |
| | | |
| | | return ( |
| | | <div style={{display: 'inline-block'}}> |
| | | <Button className="mk-border-purple" icon="picture" onClick={() => {this.setState({visible: true})}}>资源管理</Button> |
| | | <Modal |
| | | title="粘贴" |
| | | visible={visible} |
| | | width={600} |
| | | maskClosable={false} |
| | | onOk={this.pasteSubmit} |
| | | onCancel={() => {this.setState({visible: false})}} |
| | | footer={[ |
| | | <Button key="back" type="link" icon="plus" onClick={this.addSource}> |
| | | 添加 |
| | | </Button>, |
| | | <Button key="colse" onClick={() => {this.setState({visible: false})}}> |
| | | 关闭 |
| | | </Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | <div> |
| | | |
| | | </div> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default PasteController |
New file |
| | |
| | | .Menu-config-paste { |
| | | border-color: #40a9ff; |
| | | color: #40a9ff; |
| | | } |
| | |
| | | {customComponents && customComponents.length ? <Panel header="自定义组件" key="cuscomponent"> |
| | | <SourceWrap components={customComponents} MenuType={MenuType} /> |
| | | </Panel> : null} |
| | | <Panel header={'背景'} key="background"> |
| | | <Panel header={'页面背景'} key="background"> |
| | | {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null} |
| | | </Panel> |
| | | <Panel header={'内边距'} key="padding"> |
| | | <Panel header={'页面内边距'} key="padding"> |
| | | {config ? <PaddingController config={config} updateConfig={this.updateConfig} /> : null} |
| | | </Panel> |
| | | </Collapse> |
| | |
| | | render() { |
| | | const { label } = this.state |
| | | return ( |
| | | <Button className="style-control-button" type="link" icon="font-colors" title="调整样式" onClick={this.triggerStyleChange}>{label}</Button> |
| | | <Button className="style-control-button" icon="font-colors" title="调整样式" onClick={this.triggerStyleChange}>{label}</Button> |
| | | ) |
| | | } |
| | | } |
| | |
| | | |
| | | .style-control-button.ant-btn-link, .style-control-button.ant-btn-link:hover, .style-control-button.ant-btn-link:focus { |
| | | .style-control-button, .style-control-button:hover, .style-control-button:focus { |
| | | color: orange; |
| | | border-color: orange; |
| | | position: relative; |
| | | z-index: 13; |
| | | background: #ffffff; |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import UtilsUpdate from '@/utils/utils-update.js' |
| | | import { updateCommonTable } from '@/utils/utils-update.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | } |
| | | |
| | | // 版本兼容 |
| | | config = UtilsUpdate.updateCommonTable(config) |
| | | config = updateCommonTable(config) |
| | | |
| | | // 权限过滤 |
| | | if (this.props.menuType !== 'HS') { |
| | |
| | | |
| | | customCallbackRequest = (result) => { |
| | | const { setting } = this.state |
| | | let lines = [] |
| | | let pre = setting.callbackType === 'script' ? '@' : '' |
| | | |
| | | let errSql = '' |
| | | if (result.$ErrCode === 'E') { |
| | | errSql = ` |
| | |
| | | delete result.$ErrMesg |
| | | } |
| | | |
| | | let getDefaultSql = (obj, tb, bid, level) => { |
| | | let keys = [] |
| | | let vals = [] |
| | | let subObjs = [] |
| | | let id = Utils.getuuid() |
| | | |
| | | delete obj.$$key |
| | | |
| | | Object.keys(obj).forEach(key => { |
| | | let val = obj[key] |
| | | if (val === null || val === undefined) return |
| | | if (typeof(val) === 'object') { |
| | | if (Array.isArray(val)) { |
| | | val.forEach(item => { |
| | | if (typeof(item) !== 'object' || Array.isArray(item)) return |
| | | if (Object.keys(item).length > 0) { |
| | | item.$$key = tb + '_' + key |
| | | subObjs.push(item) |
| | | } |
| | | }) |
| | | } else if (Object.keys(val).length > 0) { |
| | | val.$$key = tb + '_' + key |
| | | subObjs.push(val) |
| | | } |
| | | } else { |
| | | keys.push(key) |
| | | vals.push(`'${val}'`) |
| | | } |
| | | }) |
| | | |
| | | lines.push({ |
| | | table: tb, |
| | | insert: `Insert into ${pre}${tb} (${keys.join(',')},mk_level,mk_id,mk_bid)`, |
| | | select: `Select ${vals.join(',')},'${level}','${id}','${bid}'` |
| | | }) |
| | | |
| | | subObjs.forEach(item => { |
| | | getDefaultSql(item, item.$$key, id, level + 1) |
| | | }) |
| | | } |
| | | |
| | | getDefaultSql(result, setting.cbTable, '', 1) |
| | | |
| | | let lineMap = new Map() |
| | | lines.forEach(line => { |
| | | if (lineMap.has(line.table)) { |
| | | let _line = lineMap.get(line.table) |
| | | _line.selects.push(line.select) |
| | | lineMap.set(line.table, _line) |
| | | } else { |
| | | lineMap.set(line.table, { |
| | | table: line.table, |
| | | insert: line.insert, |
| | | selects: [line.select] |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | let lines = UtilsDM.getCallBackSql(setting, result) |
| | | let param = {} |
| | | |
| | | if (setting.callbackType === 'script') { // 使用自定义脚本 |
| | | let sql = [...lineMap.values()].map(item => (` |
| | | let sql = lines.map(item => (` |
| | | ${item.insert} |
| | | ${item.selects.join(` union all |
| | | `)} |
| | |
| | | } |
| | | } else { |
| | | param.func = 's_ex_result_back' |
| | | param.s_ex_result = [...lineMap.values()].map((item, index) => ({ |
| | | param.s_ex_result = lines.map((item, index) => ({ |
| | | MenuID: this.state.config.MenuID, |
| | | MenuName: this.state.config.MenuName, |
| | | TableName: item.table, |
| | |
| | | })) |
| | | |
| | | if ((window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') || window.debugger === true) { |
| | | let sql = [...lineMap.values()].map(item => (` |
| | | let sql = lines.map(item => (` |
| | | ${item.insert} |
| | | ${item.selects.join(` union all |
| | | `)} |
| | |
| | | import PropTypes from 'prop-types' |
| | | import moment from 'moment' |
| | | import { Button, Modal, notification, message } from 'antd' |
| | | import Utils from '@/utils/utils.js' |
| | | import Utils, { getSysDefaultSql } from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | |
| | | |
| | | if (btn.sql && btn.sqlType === 'insert') { // 系统函数添加时,生成uuid |
| | | param.ID = Utils.getguid() |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | param.LText = Utils.formatOptions(param.LText) |
| | |
| | | _primaryId = param.ID |
| | | } else if (btn.sql && btn.sqlType === 'insertOrUpdate') { // 系统函数添加或修改时 |
| | | param.ID = primaryId || Utils.getguid() |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | param.LText = Utils.formatOptions(param.LText) |
| | |
| | | _primaryId = param.ID |
| | | } else if (btn.sql) { |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, data, []) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | param.LText = Utils.formatOptions(param.LText) |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import UtilsUpdate from '@/utils/utils-update.js' |
| | | import { updateSubTable } from '@/utils/utils-update.js' |
| | | import { modifyTabview } from '@/store/action' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | |
| | | let absFields = [] // 绝对值字段 |
| | | |
| | | // 版本兼容 |
| | | config = UtilsUpdate.updateSubTable(config) |
| | | config = updateSubTable(config) |
| | | |
| | | // 权限过滤 |
| | | if (this.props.menuType !== 'HS') { |
| | |
| | | |
| | | customCallbackRequest = (result) => { |
| | | const { setting } = this.state |
| | | let lines = [] |
| | | let pre = setting.callbackType === 'script' ? '@' : '' |
| | | |
| | | let errSql = '' |
| | | if (result.$ErrCode === 'E') { |
| | | errSql = ` |
| | |
| | | delete result.$ErrMesg |
| | | } |
| | | |
| | | let getDefaultSql = (obj, tb, bid, level) => { |
| | | let keys = [] |
| | | let vals = [] |
| | | let subObjs = [] |
| | | let id = Utils.getuuid() |
| | | |
| | | delete obj.$$key |
| | | |
| | | Object.keys(obj).forEach(key => { |
| | | let val = obj[key] |
| | | if (val === null || val === undefined) return |
| | | if (typeof(val) === 'object') { |
| | | if (Array.isArray(val)) { |
| | | val.forEach(item => { |
| | | if (typeof(item) !== 'object' || Array.isArray(item)) return |
| | | if (Object.keys(item).length > 0) { |
| | | item.$$key = tb + '_' + key |
| | | subObjs.push(item) |
| | | } |
| | | }) |
| | | } else if (Object.keys(val).length > 0) { |
| | | val.$$key = tb + '_' + key |
| | | subObjs.push(val) |
| | | } |
| | | } else { |
| | | keys.push(key) |
| | | vals.push(`'${val}'`) |
| | | } |
| | | }) |
| | | |
| | | lines.push({ |
| | | table: tb, |
| | | insert: `Insert into ${pre}${tb} (${keys.join(',')},mk_level,mk_id,mk_bid)`, |
| | | select: `Select ${vals.join(',')},'${level}','${id}','${bid}'` |
| | | }) |
| | | |
| | | subObjs.forEach(item => { |
| | | getDefaultSql(item, item.$$key, id, level + 1) |
| | | }) |
| | | } |
| | | |
| | | getDefaultSql(result, setting.cbTable, '', 1) |
| | | |
| | | let lineMap = new Map() |
| | | lines.forEach(line => { |
| | | if (lineMap.has(line.table)) { |
| | | let _line = lineMap.get(line.table) |
| | | _line.selects.push(line.select) |
| | | lineMap.set(line.table, _line) |
| | | } else { |
| | | lineMap.set(line.table, { |
| | | table: line.table, |
| | | insert: line.insert, |
| | | selects: [line.select] |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | let lines = UtilsDM.getCallBackSql(setting, result) |
| | | let param = {} |
| | | |
| | | if (setting.callbackType === 'script') { // 使用自定义脚本 |
| | | let sql = [...lineMap.values()].map(item => (` |
| | | let sql = lines.map(item => (` |
| | | ${item.insert} |
| | | ${item.selects.join(` union all |
| | | `)} |
| | |
| | | } |
| | | } else { |
| | | param.func = 's_ex_result_back' |
| | | param.s_ex_result = [...lineMap.values()].map((item, index) => ({ |
| | | param.s_ex_result = lines.map((item, index) => ({ |
| | | MenuID: this.props.MenuID, |
| | | MenuName: this.props.Tab.label, |
| | | TableName: item.table, |
| | |
| | | })) |
| | | |
| | | if ((window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') || window.debugger === true) { |
| | | let sql = [...lineMap.values()].map(item => (` |
| | | let sql = lines.map(item => (` |
| | | ${item.insert} |
| | | ${item.selects.join(` union all |
| | | `)} |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import UtilsDM from '@/utils/utils-datamanage.js' |
| | | import UtilsUpdate from '@/utils/utils-update.js' |
| | | import { updateSubTable } from '@/utils/utils-update.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | | import NotFount from '@/components/404' |
| | |
| | | let absFields = [] // 绝对值字段 |
| | | |
| | | // 版本兼容 |
| | | config = UtilsUpdate.updateSubTable(config) |
| | | config = updateSubTable(config) |
| | | |
| | | // 不支持funcbutton、popview 类型按钮 |
| | | let labels = [] |
| | |
| | | |
| | | customCallbackRequest = (result) => { |
| | | const { setting } = this.state |
| | | let lines = [] |
| | | let pre = setting.callbackType === 'script' ? '@' : '' |
| | | |
| | | let errSql = '' |
| | | if (result.$ErrCode === 'E') { |
| | | errSql = ` |
| | |
| | | delete result.$ErrMesg |
| | | } |
| | | |
| | | let getDefaultSql = (obj, tb, bid, level) => { |
| | | let keys = [] |
| | | let vals = [] |
| | | let subObjs = [] |
| | | let id = Utils.getuuid() |
| | | |
| | | delete obj.$$key |
| | | |
| | | Object.keys(obj).forEach(key => { |
| | | let val = obj[key] |
| | | if (val === null || val === undefined) return |
| | | if (typeof(val) === 'object') { |
| | | if (Array.isArray(val)) { |
| | | val.forEach(item => { |
| | | if (typeof(item) !== 'object' || Array.isArray(item)) return |
| | | if (Object.keys(item).length > 0) { |
| | | item.$$key = tb + '_' + key |
| | | subObjs.push(item) |
| | | } |
| | | }) |
| | | } else if (Object.keys(val).length > 0) { |
| | | val.$$key = tb + '_' + key |
| | | subObjs.push(val) |
| | | } |
| | | } else { |
| | | keys.push(key) |
| | | vals.push(`'${val}'`) |
| | | } |
| | | }) |
| | | |
| | | lines.push({ |
| | | table: tb, |
| | | insert: `Insert into ${pre}${tb} (${keys.join(',')},mk_level,mk_id,mk_bid)`, |
| | | select: `Select ${vals.join(',')},'${level}','${id}','${bid}'` |
| | | }) |
| | | |
| | | subObjs.forEach(item => { |
| | | getDefaultSql(item, item.$$key, id, level + 1) |
| | | }) |
| | | } |
| | | |
| | | getDefaultSql(result, setting.cbTable, '', 1) |
| | | |
| | | let lineMap = new Map() |
| | | lines.forEach(line => { |
| | | if (lineMap.has(line.table)) { |
| | | let _line = lineMap.get(line.table) |
| | | _line.selects.push(line.select) |
| | | lineMap.set(line.table, _line) |
| | | } else { |
| | | lineMap.set(line.table, { |
| | | table: line.table, |
| | | insert: line.insert, |
| | | selects: [line.select] |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | let lines = UtilsDM.getCallBackSql(setting, result) |
| | | let param = {} |
| | | |
| | | if (setting.callbackType === 'script') { // 使用自定义脚本 |
| | | let sql = [...lineMap.values()].map(item => (` |
| | | let sql = lines.map(item => (` |
| | | ${item.insert} |
| | | ${item.selects.join(` union all |
| | | `)} |
| | |
| | | } else { |
| | | let name = this.props.Tab ? (this.props.Tab.label || '') : '' |
| | | param.func = 's_ex_result_back' |
| | | param.s_ex_result = [...lineMap.values()].map((item, index) => ({ |
| | | param.s_ex_result = lines.map((item, index) => ({ |
| | | MenuID: this.props.MenuID, |
| | | MenuName: name, |
| | | TableName: item.table, |
| | |
| | | })) |
| | | |
| | | if ((window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') || window.debugger === true) { |
| | | let sql = [...lineMap.values()].map(item => (` |
| | | let sql = lines.map(item => (` |
| | | ${item.insert} |
| | | ${item.selects.join(` union all |
| | | `)} |
| | |
| | | import moment from 'moment' |
| | | import { Button, Modal, notification, message } from 'antd' |
| | | import MutilForm from '@/tabviews/zshare/mutilform' |
| | | import Utils from '@/utils/utils.js' |
| | | import Utils, { getSysDefaultSql } from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import Api from '@/api' |
| | | import './index.scss' |
| | |
| | | } |
| | | } else if (btn.sql) { |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, '', param, data[0], columns) // 数据源 |
| | | param.LText = getSysDefaultSql(btn, setting, '', param, data[0], columns) // 数据源 |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | } |
| | | } |
| | | param.ID = primaryId || Utils.getguid() |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data[0], columns) // 数据源 |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns) // 数据源 |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | } else if (btn.sql) { |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data[0], columns) // 数据源 |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns) // 数据源 |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | } |
| | | } else if (btn.sql) { |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, '', param, cell, columns) // 数据源 |
| | | param.LText = getSysDefaultSql(btn, setting, '', param, cell, columns) // 数据源 |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | } |
| | | } else if (btn.sql && btn.sqlType === 'insert') { // 系统函数添加时,生成uuid |
| | | param.ID = _formPrimaryId || Utils.getguid() |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, cell, columns) // 数据源 |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns) // 数据源 |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | } |
| | | |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, cell, columns) // 数据源 |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns) // 数据源 |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | import { Button, Modal, notification, message } from 'antd' |
| | | |
| | | import ExcelIn from './excelin' |
| | | import Utils from '@/utils/utils.js' |
| | | import Utils, { getExcelInSql } from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import Api from '@/api' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | |
| | | }) |
| | | } |
| | | |
| | | let result = Utils.getExcelInSql(btn, data, this.state.dict, (this.props.BID || '')) |
| | | let result = getExcelInSql(btn, data, this.state.dict, (this.props.BID || '')) |
| | | |
| | | if (result.errors) { |
| | | notification.warning({ |
| | |
| | | import { Button, Modal, notification, message } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import Utils, { getSysDefaultSql } from '@/utils/utils.js' |
| | | import options from '@/store/options.js' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | |
| | | |
| | | if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 是否弹框或直接执行 |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, '', param, data[0], columns, this.props.Tab, retmsg) // 数据源 |
| | | |
| | | if (retmsg) { |
| | | const { sql, callbacksql } = getSysDefaultSql(btn, setting, '', param, data[0], columns, this.props.Tab, retmsg) // 数据源 |
| | | param.LText = sql |
| | | param.$callbacksql = callbacksql |
| | | } else { |
| | | param.LText = getSysDefaultSql(btn, setting, '', param, data[0], columns, this.props.Tab) // 数据源 |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | param.LText = param.LText.replace(/\$@/ig, '/*') |
| | |
| | | } |
| | | |
| | | param.ID = primaryId || Utils.getguid() |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data[0], columns, this.props.Tab, retmsg) // 数据源 |
| | | |
| | | if (retmsg) { |
| | | const { sql, callbacksql } = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, this.props.Tab, retmsg) // 数据源 |
| | | param.LText = sql |
| | | param.$callbacksql = callbacksql |
| | | } else { |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, this.props.Tab) // 数据源 |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | param.LText = param.LText.replace(/\$@/ig, '/*') |
| | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | } else { |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, data[0], columns, this.props.Tab, retmsg) // 数据源 |
| | | |
| | | if (retmsg) { |
| | | const { sql, callbacksql } = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, this.props.Tab, retmsg) // 数据源 |
| | | param.LText = sql |
| | | param.$callbacksql = callbacksql |
| | | } else { |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, data[0], columns, this.props.Tab) // 数据源 |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | param.LText = param.LText.replace(/\$@/ig, '/*') |
| | |
| | | |
| | | if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 是否弹框或直接执行 |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, '', param, cell, columns, this.props.Tab, retmsg) // 数据源 |
| | | |
| | | if (retmsg) { |
| | | const { sql, callbacksql } = getSysDefaultSql(btn, setting, '', param, cell, columns, this.props.Tab, retmsg) // 数据源 |
| | | param.LText = sql |
| | | param.$callbacksql = callbacksql |
| | | } else { |
| | | param.LText = getSysDefaultSql(btn, setting, '', param, cell, columns, this.props.Tab) // 数据源 |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | param.LText = param.LText.replace(/\$@/ig, '/*') |
| | |
| | | |
| | | if (btn.sqlType === 'insert') { // 系统函数添加时,生成uuid |
| | | param.ID = Utils.getguid() |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, cell, columns, this.props.Tab, retmsg) // 数据源 |
| | | |
| | | if (retmsg) { |
| | | const { sql, callbacksql } = getSysDefaultSql(btn, setting, formdata, param, cell, columns, this.props.Tab, retmsg) // 数据源 |
| | | param.LText = sql |
| | | param.$callbacksql = callbacksql |
| | | } else { |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns, this.props.Tab) // 数据源 |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | param.LText = param.LText.replace(/\$@/ig, '/*') |
| | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | } else { |
| | | param.ID = primaryId |
| | | param.LText = Utils.getSysDefaultSql(btn, setting, formdata, param, cell, columns, this.props.Tab, retmsg) // 数据源 |
| | | |
| | | if (retmsg) { |
| | | const { sql, callbacksql } = getSysDefaultSql(btn, setting, formdata, param, cell, columns, this.props.Tab, retmsg) // 数据源 |
| | | param.LText = sql |
| | | param.$callbacksql = callbacksql |
| | | } else { |
| | | param.LText = getSysDefaultSql(btn, setting, formdata, param, cell, columns, this.props.Tab) // 数据源 |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | param.LText = param.LText.replace(/\$@/ig, '/*') |
| | |
| | | loadingNumber: params.length || '' |
| | | }) |
| | | |
| | | let record = { |
| | | BID: param.BID || '', |
| | | ID: param.ID || '', |
| | | callbacksql: param.$callbacksql || '' |
| | | } |
| | | |
| | | delete param.$callbacksql |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | if (res.status) { |
| | | if (res.mk_ex_invoke === 'false' && params.length === 0) { |
| | |
| | | } else if (res.mk_ex_invoke === 'false' && params.length > 0) { |
| | | this.customLoopRequest(params, _resolve) |
| | | } else { |
| | | this.customOuterRequest(params, res, _resolve) |
| | | this.customOuterRequest(params, res, record, _resolve) |
| | | } |
| | | } else if (res.ErrCode === 'C' && this.state.checkParam) { |
| | | const _this = this |
| | |
| | | } else if (result.mk_ex_invoke === 'false' && params.length > 0) { |
| | | _this.customLoopRequest(params, _resolve) |
| | | } else { |
| | | _this.customOuterRequest(params, result, _resolve) |
| | | _this.customOuterRequest(params, result, record, _resolve) |
| | | } |
| | | } else { |
| | | _this.execError(result) |
| | |
| | | /** |
| | | * @description 自定义请求循环执行 |
| | | */ |
| | | customOuterRequest = (params, result, _resolve) => { |
| | | customOuterRequest = (params, result, record, _resolve) => { |
| | | const { btn } = this.props |
| | | |
| | | let url = '' |
| | |
| | | $ErrMesg: error |
| | | } |
| | | |
| | | this.customCallbackRequest(params, result, _resolve) |
| | | this.customCallbackRequest(params, result, record, _resolve) |
| | | } else { |
| | | res.mk_api_key = mkey |
| | | this.customCallbackRequest(params, res, _resolve) |
| | | this.customCallbackRequest(params, res, record, _resolve) |
| | | } |
| | | }, () => { |
| | | this.updateStatus('over') |
| | |
| | | /** |
| | | * @description 回调请求循环执行 |
| | | */ |
| | | customCallbackRequest = (params, result, _resolve) => { |
| | | customCallbackRequest = (params, result, record, _resolve) => { |
| | | const { btn } = this.props |
| | | let lines = [] |
| | | let pre = btn.callbackType === 'script' ? '@' : '' |
| | |
| | | if (btn.callbackType === 'script') { // 使用自定义脚本 |
| | | param.func = 'sPC_TableData_InUpDe' |
| | | |
| | | if (this.props.BID) { |
| | | if (record.BID) { |
| | | param.BID = this.props.BID |
| | | } |
| | | if (record.ID) { |
| | | param.ID = record.ID |
| | | } |
| | | |
| | | let _prevCustomScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) |
| | | let _prevCustomScript = `${record.callbacksql || 'declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000)'} |
| | | Select @ErrorCode='',@retmsg='' |
| | | ${errSql} |
| | | ` |
| | |
| | | |
| | | if (!_item) return |
| | | |
| | | if (item.type === 'date' || item.type === 'datemonth' || item.type === 'datetime') { |
| | | if (_item.value && _item.value.format) { |
| | | _item.value = _item.value.format(_format[item.type]) |
| | | } else if (!_item.value) { |
| | | _item.value = '' |
| | | } |
| | | } |
| | | |
| | | if (_item.value === undefined) { |
| | | _item.value = '' |
| | | } else if (item.type === 'date' || item.type === 'datemonth' || item.type === 'datetime') { |
| | | if (!_item.value) { |
| | | _item.value = '' |
| | | } else if (_item.value.format) { |
| | | _item.value = _item.value.format(_format[item.type]) |
| | | } |
| | | } else if (item.type === 'text' && _item.value) { // 特殊字段替换 |
| | | _item.value = _item.value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey) |
| | | _item.value = _item.value.replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')) |
| | | _item.value = _item.value.replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || '')) |
| | | } |
| | | |
| | | search.push(_item) |
| | |
| | | } |
| | | |
| | | let _value = '' |
| | | if (this.state.datatype[key] === 'datetime') { |
| | | let _type = this.state.datatype[key] |
| | | if (_type === 'datetime') { |
| | | _value = values[key] ? moment(values[key]).format('YYYY-MM-DD HH:mm:ss') : '' |
| | | } else if (this.state.datatype[key] === 'datemonth') { |
| | | } else if (_type === 'datemonth') { |
| | | _value = values[key] ? moment(values[key]).format('YYYY-MM') : '' |
| | | } else if (this.state.datatype[key] === 'date') { |
| | | } else if (_type === 'date') { |
| | | _value = values[key] ? moment(values[key]).format('YYYY-MM-DD') : '' |
| | | } else if (this.state.datatype[key] === 'number') { |
| | | } else if (_type === 'number') { |
| | | _value = values[key] |
| | | |
| | | } else if (this.state.datatype[key] === 'multiselect' || this.state.datatype[key] === 'checkbox') { |
| | | } else if (_type === 'multiselect' || _type === 'checkbox') { |
| | | _value = values[key] ? values[key].join(',') : '' |
| | | |
| | | } else if (this.state.datatype[key] === 'fileupload') { |
| | | } else if (_type === 'fileupload') { |
| | | let vals = [] |
| | | |
| | | if (values[key] && values[key].length > 0) { |
| | |
| | | } |
| | | |
| | | _value = vals.join(',') |
| | | } else if (this.state.datatype[key] === 'text' || this.state.datatype[key] === 'textarea') { |
| | | } else if (_type === 'text' || _type === 'textarea') { |
| | | _value = values[key].replace(/\t*|\v*/g, '') // 去除制表符 |
| | | |
| | | if (intercepts.includes(key)) { // 去除首尾空格 |
| | | _value = _value.replace(/(^\s*|\s*$)/g, '') |
| | | } |
| | | if (_type === 'text' && _value) { // 特殊字段替换 |
| | | _value = _value.replace(/^(\s*)@appkey@(\s*)$/ig, window.GLOB.appkey) |
| | | _value = _value.replace(/^(\s*)@SessionUid@(\s*)$/ig, (localStorage.getItem('SessionUid') || '')) |
| | | _value = _value.replace(/^(\s*)@bid@(\s*)$/ig, (this.props.BID || '')) |
| | | } |
| | | } else { |
| | | _value = values[key] |
| | | } |
| | |
| | | |
| | | import Api from '@/api' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import UtilsUpdate from '@/utils/utils-update.js' |
| | | import { updateSubTable } from '@/utils/utils-update.js' |
| | | import options from '@/store/options.js' |
| | | import asyncComponent from '@/utils/asyncSpinComponent' |
| | | import './index.scss' |
| | |
| | | |
| | | if (!subconfig || !subconfig.enabled) return |
| | | |
| | | subconfig = UtilsUpdate.updateSubTable(subconfig) |
| | | subconfig = updateSubTable(subconfig) |
| | | |
| | | let _comp = {title: res.tab.label, uuid: res.tab.uuid, action: []} |
| | | |
| | |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import UtilsUpdate from '@/utils/utils-update.js' |
| | | import { updateCommonTable } from '@/utils/utils-update.js' |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | |
| | |
| | | _config.easyCode = _config.easyCode || '' |
| | | |
| | | // 版本兼容 |
| | | _config = UtilsUpdate.updateCommonTable(_config) |
| | | _config = updateCommonTable(_config) |
| | | |
| | | let _oriActions = [] |
| | | if (_config.type === 'user') { |
| | |
| | | id, bid, loginuid, sessionuid, userid, username, fullname, appkey, time_id{usefulFields ? ', ' + usefulFields : ''} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!usefulFields ? <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | id, bid, loginuid, sessionuid, userid, username, fullname, appkey, time_id |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!usefulFields ? <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | <Form.Item style={{marginBottom: 0}} label="执行位置"> |
| | | {getFieldDecorator('position', { |
| | |
| | | import zhCN from '@/locales/zh-CN/model.js' |
| | | import enUS from '@/locales/en-US/model.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import UtilsUpdate from '@/utils/utils-update.js' |
| | | import { updateSubTable } from '@/utils/utils-update.js' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import SearchComponent from '@/templates/sharecomponent/searchcomponent' |
| | |
| | | let _activeKey = editSubTab ? editSubTab.activeKey : editTab.activeKey |
| | | |
| | | // 版本兼容 |
| | | _config = UtilsUpdate.updateSubTable(_config) |
| | | _config = updateSubTable(_config) |
| | | |
| | | this.setState({ |
| | | openEdition: editSubTab ? (editSubTab.open_edition || '') : (editTab.open_edition || ''), |
| | |
| | | static propTpyes = { |
| | | dict: PropTypes.object, // 字典项 |
| | | btn: PropTypes.object, // 按钮信息 |
| | | initsql: PropTypes.string, // 初始化脚本 |
| | | usefulfields: PropTypes.string, // 可用字段 |
| | | systemScripts: PropTypes.array, // 系统脚本 |
| | | customScripts: PropTypes.array, // 自定义脚本 |
| | | scriptsChange: PropTypes.func // 表单 |
| | |
| | | return |
| | | } |
| | | |
| | | let prev = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) |
| | | ` |
| | | let tail = ` |
| | | aaa: |
| | | ` |
| | |
| | | let param = { |
| | | func: 's_debug_sql', |
| | | exec_type: 'y', |
| | | LText: prev + _prevCustomScript + _backCustomScript + tail |
| | | LText: this.props.initsql + _prevCustomScript + _backCustomScript + tail |
| | | } |
| | | |
| | | // 数据权限 |
| | | param.LText = param.LText.replace(/@\$|\$@/ig, '') |
| | | |
| | | // check |
| | | param.LText = param.LText.replace(/\$check@|@check\$/ig, '') |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { systemScripts, btn } = this.props |
| | | const { usefulfields, systemScripts, btn } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | ErrorCode(增加后缀NT表示数据不回滚,如ENT、NNT、FNT、NMNT), retmsg |
| | | </Form.Item> |
| | | </Col> |
| | | {usefulfields ? <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | {usefulfields} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | <Form.Item style={{marginBottom: 0}} label={ |
| | | <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}> |
| | |
| | | </span> |
| | | } key="6"> |
| | | <CustomScript |
| | | usefulfields={this.state.usefulfields} |
| | | initsql={this.state.initsql} |
| | | dict={this.props.dict} |
| | | btn={this.props.card} |
| | | dict={this.props.dict} |
| | | initsql={this.state.initsql} |
| | | customScripts={verify.scripts} |
| | | defaultsql={this.state.defaultsql} |
| | | usefulfields={this.state.usefulfields} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | wrappedComponentRef={(inst) => this.scriptsForm = inst} |
| | |
| | | </span> |
| | | } key="6a"> |
| | | <CallBackCustomScript |
| | | dict={this.props.dict} |
| | | btn={this.props.card} |
| | | dict={this.props.dict} |
| | | initsql={this.state.initsql} |
| | | customScripts={verify.cbScripts} |
| | | usefulfields={this.state.usefulfields} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.cbScriptsChange} |
| | | wrappedComponentRef={(inst) => this.cbscriptsForm = inst} |
| | |
| | | func: 'sPC_TableData_InUpDe', |
| | | exec_type: 'y', |
| | | } |
| | | let _prevCustomScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000) |
| | | Select @ErrorCode='',@retmsg='' |
| | | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let _prevCustomScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50) |
| | | Select @ErrorCode='',@retmsg='',@UserName='${userName}', @FullName='${fullName}' |
| | | ${errSql} |
| | | ` |
| | | let _backCustomScript = ` |
| | |
| | | |
| | | return param |
| | | } |
| | | |
| | | /** |
| | | * @description 获取回调sql |
| | | */ |
| | | static getCallBackSql (setting, result) { |
| | | let lines = [] |
| | | let pre = setting.callbackType === 'script' ? '@' : '' |
| | | |
| | | let getDefaultSql = (obj, tb, bid, level) => { |
| | | let keys = [] |
| | | let vals = [] |
| | | let subObjs = [] |
| | | let id = Utils.getuuid() |
| | | |
| | | delete obj.$$key |
| | | |
| | | Object.keys(obj).forEach(key => { |
| | | let val = obj[key] |
| | | if (val === null || val === undefined) return |
| | | if (typeof(val) === 'object') { |
| | | if (Array.isArray(val)) { |
| | | val.forEach(item => { |
| | | if (typeof(item) !== 'object' || Array.isArray(item)) return |
| | | if (Object.keys(item).length > 0) { |
| | | item.$$key = tb + '_' + key |
| | | subObjs.push(item) |
| | | } |
| | | }) |
| | | } else if (Object.keys(val).length > 0) { |
| | | val.$$key = tb + '_' + key |
| | | subObjs.push(val) |
| | | } |
| | | } else { |
| | | keys.push(key) |
| | | vals.push(`'${val}'`) |
| | | } |
| | | }) |
| | | |
| | | lines.push({ |
| | | table: tb, |
| | | insert: `Insert into ${pre}${tb} (${keys.join(',')},mk_level,mk_id,mk_bid)`, |
| | | select: `Select ${vals.join(',')},'${level}','${id}','${bid}'` |
| | | }) |
| | | |
| | | subObjs.forEach(item => { |
| | | getDefaultSql(item, item.$$key, id, level + 1) |
| | | }) |
| | | } |
| | | |
| | | getDefaultSql(result, setting.cbTable, '', 1) |
| | | |
| | | let lineMap = new Map() |
| | | lines.forEach(line => { |
| | | if (lineMap.has(line.table)) { |
| | | let _line = lineMap.get(line.table) |
| | | _line.selects.push(line.select) |
| | | lineMap.set(line.table, _line) |
| | | } else { |
| | | lineMap.set(line.table, { |
| | | table: line.table, |
| | | insert: line.insert, |
| | | selects: [line.select] |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | return [...lineMap.values()] |
| | | } |
| | | } |
| | |
| | | import { fromJS } from 'immutable' |
| | | import Utils from './utils.js' |
| | | |
| | | export default class UpdateUtils { |
| | | /** |
| | | * @description 升级主表信息 |
| | | * @param {Object} config 页面配置信息 |
| | | * @return {Object} config |
| | | */ |
| | | static updateCommonTable (config) { |
| | | export function updateCommonTable (config) { |
| | | if (!config.version || config.version < '1.0') { |
| | | config.version = '1.0' |
| | | // 兼容标签 |
| | |
| | | config.tabgroups.forEach(groupId => { |
| | | let _group = { |
| | | uuid: groupId, |
| | | sublist: fromJS(config[groupId]).toJS() |
| | | sublist: config[groupId] |
| | | } |
| | | |
| | | delete config[groupId] |
| | |
| | | // 兼容图表 |
| | | if (!config.charts) { |
| | | config.expand = true |
| | | config.charts = [{ uuid: Utils.getuuid(), label: '', title: '', chartType: 'table', icon: 'table', Hide: 'false', blacklist: [] }] |
| | | config.charts = [{ uuid: '$$normaltable', label: '', title: '', chartType: 'table', icon: 'table', Hide: 'false', blacklist: [] }] |
| | | } else { |
| | | config.charts.forEach(card => { |
| | | if (card.chartType === 'card') { |
| | |
| | | * @param {Object} config 页面配置信息 |
| | | * @return {Object} config |
| | | */ |
| | | static updateSubTable (config) { |
| | | export function updateSubTable (config) { |
| | | if (!config.version || config.version < '1.0') { |
| | | config.version = '1.0' |
| | | // 兼容图表 |
| | | if (!config.charts) { |
| | | config.expand = false |
| | | config.charts = [{ |
| | | uuid: Utils.getuuid(), |
| | | uuid: '$$normalsubtable', |
| | | label: '', |
| | | title: '', |
| | | chartType: 'table', |
| | |
| | | config.Template = 'SubTable' |
| | | |
| | | return config |
| | | } |
| | | } |
| | |
| | | field: arrfield |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 获取excel导入参数 |
| | | * @return {String} btn 按钮 |
| | | * @return {String} data excel数据 |
| | | */ |
| | | static getExcelInSql (item, data, dict, BID) { |
| | | export function getExcelInSql (item, data, dict, BID) { |
| | | let btn = item.verify |
| | | let keys = ['delete', 'drop', 'insert', 'truncate', 'update'] |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | |
| | | let database = item.sheet.match(/(.*)\.(.*)\./ig) || '' |
| | | let sheet = item.sheet.replace(/(.*)\.(.*)\./ig, '') |
| | | |
| | | let getuuid = () => { |
| | | let uuid = [] |
| | | let timestamp = new Date().getTime() |
| | | let _options = '0123456789abcdefghigklmnopqrstuv' |
| | | for (let i = 0; i < 19; i++) { |
| | | uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) |
| | | } |
| | | uuid = timestamp + uuid.join('') |
| | | return uuid |
| | | } |
| | | |
| | | let errors = [] |
| | | let _topline = btn.range || 0 |
| | | let upId = this.getuuid() |
| | | let upId = getuuid() |
| | | |
| | | let _initCustomScript = '' // 初始化脚本 |
| | | let _prevCustomScript = '' // 默认sql前执行脚本 |
| | |
| | | * @return {String} type 执行类型 |
| | | * @return {String} table 表名 |
| | | */ |
| | | static getSysDefaultSql (btn, setting, formdata, param, data, columns, tab, retmsg) { |
| | | export function getSysDefaultSql (btn, setting, formdata, param, data, columns, tab, retmsg = false) { |
| | | let primaryId = param.ID |
| | | let BID = param.BID |
| | | let verify = btn.verify || {} |
| | | let datavars = {} // 声明的变量,表单及显示列 |
| | | let _actionType = null |
| | | let appkey = window.GLOB.appkey || '' |
| | | let sessionUid = localStorage.getItem('SessionUid') || '' |
| | | let _callbacksql = '' |
| | | |
| | | if (verify.default !== 'false') { // 判断是否使用默认sql |
| | | _actionType = btn.sqlType |
| | |
| | | |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | | if (form.type === 'text' && form.value) { // 特殊字段替换 |
| | | form.value = form.value.replace(/^(\s*)@appkey@(\s*)$/ig, appkey) |
| | | form.value = form.value.replace(/^(\s*)@SessionUid@(\s*)$/ig, sessionUid) |
| | | form.value = form.value.replace(/^(\s*)@bid@(\s*)$/ig, BID) |
| | | } |
| | | |
| | | let _key = form.key.toLowerCase() |
| | | datavars[_key] = form.value |
| | | |
| | |
| | | /* 显示列变量赋值 */ |
| | | select ${_initColfields.join(',')} |
| | | ` |
| | | } |
| | | |
| | | if (retmsg) { |
| | | _callbacksql = _sql |
| | | } |
| | | |
| | | // 去除禁用的验证 |
| | |
| | | } |
| | | |
| | | if ((window.GLOB.systemType !== 'production' && options.sysType !== 'cloud') || window.debugger === true) { |
| | | _sql = _sql.replace(/\n\s{8}/ig, '\n') |
| | | // _sql = _sql.replace(/\n\s{8}/ig, '\n') |
| | | console.info(_sql) |
| | | } |
| | | |
| | | if (retmsg) { |
| | | return { |
| | | sql: _sql, |
| | | callbacksql: _callbacksql |
| | | } |
| | | } else { |
| | | return _sql |
| | | } |
| | | } |
| | |
| | | A4: { |
| | | vertical: 980, |
| | | horizontal: 1200, |
| | | verticaldefault: 1.45789, |
| | | verticalwithout: 1.41428, |
| | | horizontaldefault: 0.683, |
| | | horizontalwithout: 0.705, |
| | | verticaldefault: 1.455, |
| | | verticalwithout: 1.411, |
| | | horizontaldefault: 0.679, |
| | | horizontalwithout: 0.701, |
| | | }, |
| | | A3: { |
| | | vertical: 1200, |
| | | horizontal: 1600, |
| | | verticaldefault: 1.44404, |
| | | verticalwithout: 1.41414, |
| | | horizontaldefault: 0.6923, |
| | | horizontalwithout: 0.707, |
| | | verticaldefault: 1.441, |
| | | verticalwithout: 1.410, |
| | | horizontaldefault: 0.688, |
| | | horizontalwithout: 0.703, |
| | | }, |
| | | A5: { |
| | | vertical: 700, |
| | | horizontal: 1000, |
| | | verticaldefault: 1.482, |
| | | verticalwithout: 1.417, |
| | | horizontaldefault: 0.6736, |
| | | horizontalwithout: 0.7047, |
| | | verticaldefault: 1.478, |
| | | verticalwithout: 1.413, |
| | | horizontaldefault: 0.669, |
| | | horizontalwithout: 0.700, |
| | | } |
| | | } |
| | | |
| | |
| | | const PasteController = asyncComponent(() => import('@/menu/pastecontroller')) |
| | | const PaddingController = asyncComponent(() => import('@/menu/padcontroller')) |
| | | const StyleController = asyncComponent(() => import('@/menu/stylecontroller')) |
| | | // const PictureController = asyncComponent(() => import('@/menu/picturecontroller')) |
| | | const StyleCombController = asyncComponent(() => import('@/menu/stylecombcontroller')) |
| | | const StyleCombControlButton = asyncComponent(() => import('@/menu/stylecombcontrolbutton')) |
| | | const ModalController = asyncComponent(() => import('@/menu/modalconfig/controller')) |
| | |
| | | MKEmitter.addListener('submitComponentStyle', this.updateComponentStyle) |
| | | MKEmitter.addListener('updateCustomComponent', this.updateCustomComponent) |
| | | this.updateCustomComponent() |
| | | // this.getAppPictures() |
| | | } |
| | | |
| | | /** |
| | |
| | | MKEmitter.removeListener('submitComponentStyle', this.updateComponentStyle) |
| | | MKEmitter.removeListener('updateCustomComponent', this.updateCustomComponent) |
| | | } |
| | | |
| | | // getAppPictures = () => { |
| | | // Api.getSystemConfig({ |
| | | // func: 's_url_db_adduptdel', |
| | | // id: '', |
| | | // PageIndex: 0, // 0 代表全部 |
| | | // PageSize: 0, // 0 代表全部 |
| | | // typecharone: 'image', |
| | | // type: 'search' |
| | | // }).then(res => { |
| | | |
| | | // }) |
| | | // } |
| | | |
| | | updateCustomComponent = () => { |
| | | Api.getSystemConfig({ |
| | |
| | | {customComponents && customComponents.length ? <Panel header="自定义组件" key="cuscomponent"> |
| | | <SourceWrap components={customComponents} MenuType={MenuType} /> |
| | | </Panel> : null} |
| | | <Panel header={'背景'} key="background"> |
| | | <Panel header={'页面背景'} key="background"> |
| | | {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null} |
| | | </Panel> |
| | | <Panel header={'内边距'} key="padding"> |
| | | <Panel header={'页面内边距'} key="padding"> |
| | | {config ? <PaddingController config={config} updateConfig={this.updateConfig} /> : null} |
| | | </Panel> |
| | | </Collapse> |
| | |
| | | <div> {config && config.MenuName} </div> |
| | | } bordered={false} extra={ |
| | | <div> |
| | | {/* <PictureController/> */} |
| | | <StyleCombControlButton menu={config} /> |
| | | <PasteController type="menu" Tab={null} insert={this.insert} /> |
| | | {config ? <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | |
| | | this.props.updateConfig({...this.props.config, pageSize: val}) |
| | | } |
| | | |
| | | onRadioChange = (val) => { |
| | | onLayoutChange = (val) => { |
| | | this.props.updateConfig({...this.props.config, pageLayout: val}) |
| | | } |
| | | |
| | | onPaddingChange = (val) => { |
| | | this.props.updateConfig({...this.props.config, pagePadding: val}) |
| | | } |
| | | |
| | | render() { |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.onRadioChange(e.target.value)}}> |
| | | <Radio.Group onChange={(e) => {this.onLayoutChange(e.target.value)}}> |
| | | <Radio value="vertical">纵向</Radio> |
| | | <Radio value="horizontal">横向</Radio> |
| | | </Radio.Group> |
| | |
| | | } |
| | | ] |
| | | })( |
| | | <Radio.Group onChange={(e) => {this.onRadioChange(e.target.value)}}> |
| | | <Radio.Group onChange={(e) => {this.onPaddingChange(e.target.value)}}> |
| | | <Radio value="default">默认</Radio> |
| | | <Radio value="without">无</Radio> |
| | | </Radio.Group> |