Merge branch 'positec' into dms
| | |
| | | "display": "standalone", |
| | | "theme_color": "#000000", |
| | | "background_color": "#ffffff", |
| | | "mk_version": "20250101" |
| | | "mk_version": "20250205" |
| | | } |
| | |
| | | if (res.mksqls) { |
| | | res.mksqls.forEach(n => { |
| | | n = n.replace(/(UNION ALL\s+)?SELECT obj_name='[\S\s]+sub_field=''\s+/ig, '') |
| | | if (!res.status) { |
| | | window.mkInfo('%c' + n, 'color: #f5222d') |
| | | } else { |
| | | window.mkInfo(n) |
| | | if (!res.status && param.data[0] && param.data[0].menuname) { |
| | | window.mkInfo('%c' + param.data[0].menuname, 'color: #f5222d') |
| | | } |
| | | window.mkInfo(n) |
| | | }) |
| | | } |
| | | delete res.mksqls |
| | |
| | | if (res.mksqls) { |
| | | res.mksqls.forEach(n => { |
| | | n = n.replace(/(UNION ALL\s+)?SELECT obj_name='[\S\s]+sub_field=''\s+/ig, '') |
| | | if (!res.status) { |
| | | window.mkInfo('%c' + n, 'color: #f5222d') |
| | | } else { |
| | | window.mkInfo(n) |
| | | if (!res.status && param.data[0] && param.data[0].menuname) { |
| | | window.mkInfo('%c' + param.data[0].menuname, 'color: #f5222d') |
| | | } |
| | | window.mkInfo(n) |
| | | }) |
| | | } |
| | | delete res.mksqls |
| | |
| | | color: #f5222d; |
| | | } |
| | | } |
| | | |
| | | .mk-opeartion-dropdown-wrap { |
| | | box-shadow: 0 0 2px #bcbcbc; |
| | | background: #ffffff; |
| | | min-width: 120px; |
| | | button { |
| | | display: block; |
| | | width: 100%; |
| | | height: 40px; |
| | | line-height: 40px; |
| | | border-radius: 0px; |
| | | border: none; |
| | | border-bottom: 1px solid #e8e8e8!important; |
| | | color: #26C281; |
| | | |
| | | .anticon { |
| | | display: none; |
| | | } |
| | | } |
| | | button:hover { |
| | | color: #26C281; |
| | | } |
| | | } |
| | | |
| | | .menu-setting .ant-typography-copy { |
| | | margin-left: 0px; |
| | | } |
| | |
| | | // const MKColor = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkColor')) |
| | | const MkEditIcon = asyncComponent(() => import('@/components/mkIcon')) |
| | | const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) |
| | | const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror')) |
| | | |
| | | class ModalForm extends Component { |
| | | static propTpyes = { |
| | |
| | | return |
| | | } else if (item.type === 'printTemps') { |
| | | content = <MkPrintTemps onChange={(val) => this.recordChange({[item.field]: val})}/> |
| | | } else if (item.type === 'codemirror') { |
| | | content = <CodeMirror mode="text/javascript" theme="cobalt" onChange={(val) => this.recordChange({[item.field]: val})}/> |
| | | } |
| | | |
| | | if (!content) return |
| | |
| | | label: '上级组件', |
| | | initval: wrap.supModule || [], |
| | | required: true, |
| | | allowClear: true, |
| | | options: supmodules, |
| | | forbid: isprint |
| | | }, |
| | |
| | | message.warning('复制失败。') |
| | | } |
| | | |
| | | if (card.eleType !== 'button') { |
| | | if (card.eleType !== 'button' && !window.GLOB.CopyOnly) { |
| | | _cards.push(copycard) |
| | | |
| | | handleList(_cards) |
| | |
| | | dataIndex: 'remark', |
| | | inputType: 'input', |
| | | editable: true, |
| | | unique: false, |
| | | required: false, |
| | | width: '20%' |
| | | } |
| | |
| | | this.updateComponent(_card) |
| | | } |
| | | |
| | | addSearch = (copy) => { |
| | | addSearch = (copy, type = '') => { |
| | | const { card } = this.state |
| | | |
| | | let newcard = {} |
| | |
| | | } |
| | | |
| | | // 注册事件-添加搜索 |
| | | MKEmitter.emit('addSearch', card.uuid, newcard) |
| | | MKEmitter.emit('addSearch', card.uuid, newcard, type) |
| | | } |
| | | |
| | | addButton = (copy) => { |
| | |
| | | } |
| | | |
| | | if (res.field && keys.includes(res.field.toLowerCase())) { |
| | | resolve({status: false, message: '搜索字段已存在!'}) |
| | | return |
| | | resolve({status: false}) |
| | | const that = this |
| | | confirm({ |
| | | title: '搜索字段已存在!', |
| | | okText: '知道了', |
| | | cancelText: '替换', |
| | | onOk() {}, |
| | | onCancel() { |
| | | that.addSearch(res, 'replace') |
| | | } |
| | | |
| | | }) |
| | | } else { |
| | | resolve({status: true}) |
| | | |
| | | this.addSearch(res) |
| | | } |
| | | } |
| | | } else if (type === 'action') { |
| | | if (res.style) { |
| | | delete res.style.width |
| | |
| | | this.updateComponent(_card) |
| | | } |
| | | |
| | | addSearch = (copy) => { |
| | | addSearch = (copy, type = '') => { |
| | | const { card } = this.state |
| | | |
| | | let newcard = {} |
| | |
| | | } |
| | | |
| | | // 注册事件-添加搜索 |
| | | MKEmitter.emit('addSearch', card.uuid, newcard) |
| | | MKEmitter.emit('addSearch', card.uuid, newcard, type) |
| | | } |
| | | |
| | | addButton = (copy) => { |
| | |
| | | } |
| | | |
| | | if (res.field && keys.includes(res.field.toLowerCase())) { |
| | | resolve({status: false, message: '搜索字段已存在!'}) |
| | | return |
| | | resolve({status: false}) |
| | | const that = this |
| | | confirm({ |
| | | title: '搜索字段已存在!', |
| | | okText: '知道了', |
| | | cancelText: '替换', |
| | | onOk() {}, |
| | | onCancel() { |
| | | that.addSearch(res, 'replace') |
| | | } |
| | | |
| | | }) |
| | | } else { |
| | | resolve({status: true}) |
| | | |
| | | this.addSearch(res) |
| | | } |
| | | } |
| | | } else if (type === 'action') { |
| | | if (appType === 'mob' && !['pop', 'prompt', 'exec', 'innerpage'].includes(res.OpenType)) { |
| | | resolve({status: false, message: '移动端不支持此类型的按钮。'}) |
| | |
| | | this.updateComponent(card) |
| | | } |
| | | |
| | | addSearch = (copy) => { |
| | | addSearch = (copy, type = '') => { |
| | | const { card } = this.state |
| | | |
| | | let newcard = {} |
| | |
| | | } |
| | | |
| | | // 注册事件-添加搜索 |
| | | MKEmitter.emit('addSearch', card.uuid, newcard) |
| | | MKEmitter.emit('addSearch', card.uuid, newcard, type) |
| | | } |
| | | |
| | | move = (item, direction) => { |
| | |
| | | } |
| | | |
| | | if (res.field && keys.includes(res.field.toLowerCase())) { |
| | | resolve({status: false, message: '搜索字段已存在!'}) |
| | | return |
| | | resolve({status: false}) |
| | | const that = this |
| | | confirm({ |
| | | title: '搜索字段已存在!', |
| | | okText: '知道了', |
| | | cancelText: '替换', |
| | | onOk() {}, |
| | | onCancel() { |
| | | that.addSearch(res, 'replace') |
| | | } |
| | | |
| | | }) |
| | | } else { |
| | | resolve({status: true}) |
| | | |
| | | this.addSearch(res) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | addButton = (copy) => { |
| | | const { card } = this.state |
| | |
| | | |
| | | plusSearch = (uuid, search, type) => { |
| | | const { card } = this.state |
| | | if (card.uuid !== uuid || type !== 'simple') return |
| | | if (card.uuid !== uuid || (type !== 'simple' && type !== 'replace')) return |
| | | |
| | | search.uuid = Utils.getuuid() |
| | | search.focus = true |
| | | |
| | | MKEmitter.emit('addSearch', card.uuid, search) |
| | | MKEmitter.emit('addSearch', card.uuid, search, type === 'replace' ? 'replace' : '') |
| | | } |
| | | |
| | | addButton = () => { |
| | |
| | | |
| | | plusSearch = (uuid, search, type) => { |
| | | const { card } = this.state |
| | | if (card.uuid !== uuid || type !== 'simple') return |
| | | if (card.uuid !== uuid || (type !== 'simple' && type !== 'replace')) return |
| | | |
| | | search.uuid = Utils.getuuid() |
| | | search.focus = true |
| | | |
| | | MKEmitter.emit('addSearch', card.uuid, search) |
| | | MKEmitter.emit('addSearch', card.uuid, search, type === 'replace' ? 'replace' : '') |
| | | } |
| | | |
| | | addButton = () => { |
| | |
| | | background-color: #f0f0f0; |
| | | } |
| | | td, th { |
| | | padding: 5px 14px; |
| | | padding: 5px 10px; |
| | | font-size: 16px; |
| | | border: 1px solid #ddd; |
| | | } |
| | |
| | | <NormalHeader hideSearch="true" config={card} updateComponent={this.updateComponent}/> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control"> |
| | | <NormalForm title="富文本设置" width={850} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <NormalForm title="富文本设置" width={900} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="editor" card={card}/> |
| | |
| | | } trigger="hover"> |
| | | <ToolOutlined /> |
| | | </Popover> |
| | | <BraftContent |
| | | value={card.wrap.datatype !== 'static' ? '<p class="empty-content">富文本</p>' : card.html} |
| | | encryption="false" |
| | | /> |
| | | <BraftContent value={card.wrap.datatype !== 'static' ? '<p class="empty-content">富文本</p>' : card.html}/> |
| | | <div className="component-name"> |
| | | <div className="center"> |
| | | <div className="title">{card.name}</div> |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'loaded', |
| | | label: '布局调整', |
| | | initval: wrap.loaded || 'false', |
| | | required: false, |
| | | options: [ |
| | | {value: 'false', label: '关闭'}, |
| | | {value: 'true', label: '开启'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'loadedfunc', values: ['true']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'codemirror', |
| | | field: 'loadedfunc', |
| | | label: '处理脚本', |
| | | initval: wrap.loadedfunc || '', |
| | | required: true, |
| | | span: 24 |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initval: wrap.permission || 'false', |
| | |
| | | if (appType === 'mob') { |
| | | group.fields.forEach(f => { |
| | | if (f.field && ['select', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | fields.push({...f, label: `${f.label}(${f.field})`}) |
| | | } |
| | | }) |
| | | } else { |
| | | group.fields.forEach(f => { |
| | | if (f.field && ['select', 'link', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | fields.push({...f, label: `${f.label}(${f.field})`}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | if (this.record.execSuccess === 'never') { |
| | | shows.push('resetForms') |
| | | } |
| | | if (this.record.refreshTab && this.record.refreshTab.length) { |
| | | shows.push('urlPar') |
| | | } |
| | | if (this.record.syncComponent && this.record.syncComponent[0]) { |
| | | shows.push('syncDelay') |
| | | } |
| | |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'urlPar', |
| | | label: 'URL变量', |
| | | initVal: card.urlPar || 'false', |
| | | tooltip: '刷新菜单时是否清除URL变量。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '清空' |
| | | }, { |
| | | value: 'false', |
| | | text: '不清空' |
| | | }], |
| | | forbid: appType === 'pc' || appType === 'mob' || viewType === 'popview', |
| | | }, |
| | | { |
| | | type: (appType === 'pc' || appType === 'mob') ? 'select' : 'cascader', |
| | | key: 'linkmenu', |
| | | label: '下一步操作', |
| | |
| | | orderType: 'asc', |
| | | readonly: 'false', |
| | | required: 'true', |
| | | readin: 'top', |
| | | focus: true |
| | | } |
| | | |
| | |
| | | if (appType === 'mob') { |
| | | config.subcards[0].fields.forEach(f => { |
| | | if (f.field && ['select', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | fields.push({...f, label: `${f.label}(${f.field})`}) |
| | | } |
| | | }) |
| | | } else { |
| | | config.subcards[0].fields.forEach(f => { |
| | | if (f.field && ['select', 'link', 'text', 'number', 'textarea'].includes(f.type) && f.hidden !== 'true' && f.readonly !== 'true') { |
| | | fields.push(f) |
| | | fields.push({...f, label: `${f.label}(${f.field})`}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | orderType: 'asc', |
| | | readonly: 'false', |
| | | required: 'true', |
| | | readin: 'top', |
| | | focus: true |
| | | } |
| | | |
| | |
| | | orderType: 'asc', |
| | | readonly: 'false', |
| | | required: 'true', |
| | | readin: 'top', |
| | | focus: true |
| | | } |
| | | |
| | |
| | | |
| | | import './index.scss' |
| | | |
| | | const CopyComponent = asyncIconComponent(() => import('@/menu/components/share/copycomponent')) |
| | | const NormalForm = asyncIconComponent(() => import('@/components/normalform')) |
| | | |
| | | class Account extends Component { |
| | |
| | | <NormalForm title="基本设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <EditOutlined style={{color: '#1890ff'}} title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="account" card={card}/> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={this.changeStyle}/> |
| | | <DeleteOutlined className="close" title="删除组件" onClick={() => this.props.deletecomponent(card.uuid)} /> |
| | | </div> |
| | |
| | | _defaultValue = [moment().startOf('month'), moment().endOf('month')] |
| | | } else if (card.initval === 'lastMonth') { |
| | | _defaultValue = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] |
| | | } else if (card.initval === 'year') { |
| | | _defaultValue = [moment().startOf('year'), moment().endOf('year')] |
| | | } else if (card.initval === 'lastYear') { |
| | | _defaultValue = [moment().subtract(1, 'years').startOf('year'), moment().subtract(1, 'years').endOf('year')] |
| | | } else if (card.initval) { |
| | | try { |
| | | let _initval = JSON.parse(card.initval) |
| | |
| | | |
| | | this.updateComponent(_card) |
| | | this.handleSearch(item) |
| | | } else if (type === 'replace') { |
| | | delete item.focus |
| | | _card.search = _card.search.map(cell => { |
| | | if (cell.field && cell.field.toLowerCase() === item.field.toLowerCase()) { |
| | | return item |
| | | } |
| | | return cell |
| | | }) |
| | | |
| | | this.updateComponent(_card) |
| | | this.handleSearch(item) |
| | | } else if (type === 'multil') { |
| | | _card.search.push(...item) |
| | | |
| | |
| | | field: 'resetContrl', |
| | | label: '重置时', |
| | | initval: wrap.resetContrl || 'init', |
| | | tooltip: '刷新菜单会清空URL变量。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'init', label: '恢复初始值'}, |
| | | {value: 'clear', label: '清空'}, |
| | | {value: 'refresh', label: '刷新菜单'}, |
| | | ], |
| | | }, |
| | | { |
| | |
| | | label: '上级组件', |
| | | initval: wrap.supModule || [], |
| | | required: false, |
| | | allowClear: true, |
| | | options: modules, |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | |
| | | |
| | | if (Ot === 'required') { |
| | | shows.push('progress') |
| | | } |
| | | if (Ot === 'required' && (intertype === 'inner' || intertype === 'system')) { |
| | | if (intertype === 'inner' || intertype === 'system') { |
| | | shows.push('execType') |
| | | if (this.record.execType === 'single') { |
| | | shows.push('execInterval') |
| | | } |
| | | } |
| | | } |
| | | if (intertype === 'outer' || intertype === 'custom') { |
| | | shows.push('execInterval') |
| | | } |
| | | if (this.record.openmenu && this.record.openmenu !== 'goback') { |
| | | shows.push('open') |
| | |
| | | } |
| | | } |
| | | |
| | | if (shows.includes('refreshTab') && this.record.refreshTab && this.record.refreshTab.length) { |
| | | shows.push('urlPar') |
| | | } |
| | | |
| | | return { |
| | | shows, |
| | | reOptions, |
| | |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'urlPar', |
| | | label: 'URL变量', |
| | | initVal: card.urlPar || 'false', |
| | | tooltip: '刷新菜单时是否清除URL变量。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '清空' |
| | | }, { |
| | | value: 'false', |
| | | text: '不清空' |
| | | }], |
| | | forbid: isApp || viewType === 'popview', |
| | | }, |
| | | { |
| | | type: !appType ? 'cascader' : 'select', |
| | | key: 'openmenu', |
| | | label: '打开菜单', |
| | |
| | | value: 'single', |
| | | text: '逐条请求' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'execInterval', |
| | | label: '执行间隔', |
| | | initVal: card.execInterval || 0, |
| | | tooltip: '两次请求的时间间隔(单位毫秒)。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | options: menulist |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'urlPar', |
| | | label: 'URL变量', |
| | | initVal: card.urlPar || 'false', |
| | | tooltip: '刷新菜单时是否清除URL变量。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'true', |
| | | text: '清空' |
| | | }, { |
| | | value: 'false', |
| | | text: '不清空' |
| | | }], |
| | | forbid: viewType === 'popview', |
| | | }, |
| | | { |
| | | type: 'cascader', |
| | | key: 'openmenu', |
| | | label: '打开菜单', |
| | |
| | | }] |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'execInterval', |
| | | label: '执行间隔', |
| | | initVal: card.execInterval || 0, |
| | | tooltip: '两次请求的时间间隔(单位毫秒)。', |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'progress', |
| | | label: '进度提示', |
| | |
| | | uniqueFunc: (data, item) => { |
| | | let index = data.findIndex(mark => mark.uuid !== item.uuid && mark.contrastValue === item.contrastValue && mark.match === item.match && mark.field.join('') === item.field.join('')) |
| | | |
| | | if (index > -1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '此标记已存在!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } |
| | | return true |
| | | if (index > -1) return '此标记已存在!' |
| | | return '' |
| | | }, |
| | | inputType: 'cascader', |
| | | options: [], |
| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | // import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | const PasteForm = asyncComponent(() => import('@/templates/zshare/pasteform')) |
| | | |
| | | class PasteController extends Component { |
| | |
| | | } |
| | | } |
| | | |
| | | if (res.field && keys.includes(res.field.toLowerCase())) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '搜索字段已存在!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | MKEmitter.emit('plusSearch', config.uuid, res, 'simple') |
| | | this.setState({visible: false}) |
| | | if (res.field && keys.includes(res.field.toLowerCase())) { |
| | | confirm({ |
| | | title: '搜索字段已存在!', |
| | | okText: '知道了', |
| | | cancelText: '替换', |
| | | onOk() {}, |
| | | onCancel() { |
| | | MKEmitter.emit('plusSearch', config.uuid, res, 'replace') |
| | | } |
| | | }) |
| | | } else { |
| | | MKEmitter.emit('plusSearch', config.uuid, res, 'simple') |
| | | } |
| | | return |
| | | } else if (type === 'cardcell') { |
| | | config.subcards.push(res) |
| | |
| | | _defaultValue = [moment().startOf('month'), moment().endOf('month')] |
| | | } else if (card.initval === 'lastMonth') { |
| | | _defaultValue = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] |
| | | } else if (card.initval === 'year') { |
| | | _defaultValue = [moment().startOf('year'), moment().endOf('year')] |
| | | } else if (card.initval === 'lastYear') { |
| | | _defaultValue = [moment().subtract(1, 'years').startOf('year'), moment().subtract(1, 'years').endOf('year')] |
| | | } else if (card.initval) { |
| | | try { |
| | | let _initval = JSON.parse(card.initval) |
| | |
| | | MKEmitter.removeListener('addSearch', this.addSearch) |
| | | } |
| | | |
| | | addSearch = (cardId, element) => { |
| | | addSearch = (cardId, element, type) => { |
| | | if (cardId !== this.props.config.uuid) return |
| | | |
| | | const { searchlist } = this.state |
| | | |
| | | if (type === 'replace') { |
| | | delete element.focus |
| | | this.setState({ |
| | | searchlist: searchlist.map(cell => { |
| | | if (cell.field && cell.field.toLowerCase() === element.field.toLowerCase()) { |
| | | return element |
| | | } |
| | | return cell |
| | | }), |
| | | }) |
| | | } else { |
| | | this.setState({searchlist: [...searchlist, element]}) |
| | | } |
| | | this.handleSearch(element) |
| | | } |
| | | |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd' |
| | | import { Form, Row, Col, Button, notification, Tooltip, Radio, Select, Switch } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | | import { checkSQL } from '@/utils/utils-custom.js' |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | // import './index.scss' |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { type, btn } = this.props |
| | | const { type } = this.props |
| | | const { editItem, skip } = this.state |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (type === 'fullscreen' && err) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请输入sql!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | if (!err) { |
| | | if (/^[\s\n]+$/.test(values.sql)) { |
| | | if (!values.sql || /^[\s\n]+$/.test(values.sql)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请输入sql!', |
| | |
| | | |
| | | if (!pass && !skip) return |
| | | |
| | | let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '') |
| | | let tail = ` |
| | | drop table #${sheet} |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg |
| | | ` |
| | | |
| | | let _initCustomScript = '' // 初始化脚本 |
| | | let _prevCustomScript = '' // 默认sql前执行脚本 |
| | | let _backCustomScript = '' // 默认sql后执行脚本 |
| | | |
| | | this.props.scripts.forEach(item => { |
| | | if (item.status === 'false') return |
| | | |
| | | if (item.position === 'init') { |
| | | _initCustomScript += ` |
| | | /* 初始化脚本 */ |
| | | ${values.uuid === item.uuid ? values.sql : item.sql} |
| | | ` |
| | | } else if (item.position === 'front') { |
| | | _prevCustomScript += ` |
| | | /* 默认sql前脚本 */ |
| | | ${values.uuid === item.uuid ? values.sql : item.sql} |
| | | ` |
| | | } else { |
| | | _backCustomScript += ` |
| | | /* 默认sql后脚本 */ |
| | | ${values.uuid === item.uuid ? values.sql : item.sql} |
| | | ` |
| | | } |
| | | if (/@ID@/ig.test(values.sql) && !skip) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '脚本中不可使用@ID@!', |
| | | duration: 5 |
| | | }) |
| | | |
| | | if (!values.uuid) { |
| | | if (values.position === 'init') { |
| | | _initCustomScript += ` |
| | | /* 初始化脚本 */ |
| | | ${values.sql} |
| | | ` |
| | | } else if (values.position === 'front') { |
| | | _prevCustomScript += ` |
| | | /* 默认sql前脚本 */ |
| | | ${values.sql} |
| | | ` |
| | | } else { |
| | | _backCustomScript += ` |
| | | /* 默认sql后脚本 */ |
| | | ${values.sql} |
| | | ` |
| | | return |
| | | } |
| | | } |
| | | |
| | | let sql = this.state.verifySql + _initCustomScript + _prevCustomScript + _backCustomScript + tail |
| | | |
| | | sql = sql.replace(/@\$|\$@/ig, '') |
| | | sql = sql.replace(/@datam@/ig, `''`) |
| | | sql = sql.replace(/@typename@/ig, `'debug'`) |
| | | |
| | | if (skip) { |
| | | this.setState({ |
| | | editItem: null, |
| | | skip: false |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | skip: false, |
| | | editItem: null |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | this.props.scriptsChange(values) |
| | | } else { |
| | | this.setState({loading: true}) |
| | | Api.sDebug(sql).then(res => { |
| | | if (res.status || res.ErrCode === '-2') { |
| | | |
| | | this.props.scriptsChange(values, () => { |
| | | this.setState({ |
| | | loading: false, |
| | | editItem: null |
| | | }, () => { |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: false}) |
| | | |
| | | Modal.error({ |
| | | title: res.message |
| | | }, () => { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | selectScript = (value, option) => { |
| | | const { usefulfields, btn } = this.props |
| | | const { usefulfields, btn, setting } = this.props |
| | | |
| | | let _value = '' |
| | | if (value === 'default') { |
| | | let fields = usefulfields.map(col => col.field).join(',') |
| | | let upFields = usefulfields.map(col => `${col.field}=t.${col.field}`).join(',') |
| | | |
| | | if (fields) { |
| | | fields = fields + ',' |
| | | } |
| | | if (upFields) { |
| | | upFields = upFields + ',' |
| | | } |
| | | |
| | | let database = btn.sheet.match(/(.*)\.(.*)\.|@db@/ig) || '' |
| | |
| | | |
| | | database = database ? (database[0] || '') : '' |
| | | |
| | | _value = `Insert into ${database}${sheet} (${fields}createuserid,createuser,createstaff,bid)\nSelect ${fields}@userid@,@username,@fullname,@BID@ From #${sheet}` |
| | | _value = `update a set ${upFields}modifydate=getdate(),modifyuserid=@UserID@,modifyuser=@username,modifystaff=@fullname,deleted=0 |
| | | from (select * from #${sheet} where data_type='upt') t |
| | | inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | update a set deleted=1,modifydate=getdate(),modifyuserid=@UserID@,modifyuser=@username,modifystaff=@fullname |
| | | from (select * from #${sheet} where data_type='del') t |
| | | inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | delete t from #${sheet} t inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | Insert into ${database}${sheet} (${fields}createuserid,createuser,createstaff,bid) |
| | | Select ${fields}@UserID@,@username,@fullname,@BID@ From #${sheet} |
| | | ` |
| | | _value = _value.replace(/\s{6}[fiuds]/ig, (word) => word.replace(/\s{6}/ig, '')) |
| | | } else { |
| | | _value = value |
| | | } |
| | |
| | | <Switch checked={skip} size="small" onChange={() => this.setState({skip: !skip})}/> |
| | | </Col> |
| | | <Col span={24} className="sql"> |
| | | <Form.Item label="sql"> |
| | | <Form.Item label="sql" required> |
| | | {getFieldDecorator('sql', { |
| | | initialValue: '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入sql!' |
| | | } |
| | | ] |
| | | initialValue: '' |
| | | })(<CodeMirror />)} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | let _fields = record.field.split(',') |
| | | let _fields_ = _fields.map(_field => `a.${_field}=b.${_field}`) |
| | | _fields_ = _fields_.join(' and ') |
| | | _fields_ += ` and a.jskey != b.${this.props.config.setting.primaryKey || 'id'}` |
| | | |
| | | let _where = [] |
| | | _fields.forEach(f => { |
| | |
| | | this.setState({verify: {...verify, uniques}}) |
| | | } |
| | | |
| | | scriptsChange = (values) => { |
| | | scriptsChange = (values, resolve, reject) => { |
| | | let verify = JSON.parse(JSON.stringify(this.state.verify)) |
| | | |
| | | if (values.uuid) { |
| | |
| | | verify.scripts.push(values) |
| | | } |
| | | |
| | | let sql = this.getEditTableSql(verify) |
| | | |
| | | if (resolve) { |
| | | Api.sDebug(sql).then(res => { |
| | | if (res.status || res.ErrCode === '-2') { |
| | | resolve() |
| | | values && MKEmitter.emit('editLineId', values.uuid) |
| | | |
| | | this.setState({ verify }) |
| | | } else { |
| | | reject() |
| | | |
| | | Modal.error({ |
| | | title: res.message |
| | | }) |
| | | } |
| | | }) |
| | | } else { |
| | | Api.sDebug(sql, true) |
| | | |
| | | MKEmitter.emit('editLineId', values.uuid) |
| | | |
| | | this.setState({ |
| | | verify: verify |
| | | this.setState({ verify }) |
| | | } |
| | | } |
| | | |
| | | getEditTableSql = (verify) => { |
| | | const { columns, setting, cols } = this.props.config |
| | | |
| | | let btn = verify |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | let RoleID = sessionStorage.getItem('role_id') || '' |
| | | let departmentcode = sessionStorage.getItem('departmentcode') || '' |
| | | let organization = sessionStorage.getItem('organization') || '' |
| | | let mk_user_type = sessionStorage.getItem('mk_user_type') || '' |
| | | let nation = sessionStorage.getItem('nation') || '' |
| | | let province = sessionStorage.getItem('province') || '' |
| | | let city = sessionStorage.getItem('city') || '' |
| | | let district = sessionStorage.getItem('district') || '' |
| | | let address = sessionStorage.getItem('address') || '' |
| | | |
| | | let _sheet = btn.sheet |
| | | let BID = 'bid' |
| | | |
| | | if (window.GLOB.externalDatabase !== null) { |
| | | _sheet = _sheet.replace(/@db@/ig, window.GLOB.externalDatabase) |
| | | } |
| | | |
| | | let database = _sheet.match(/(.*)\.(.*)\./ig) |
| | | let sheet = _sheet.replace(/(.*)\.(.*)\./ig, '') |
| | | |
| | | database = database ? (database[0] || '') : '' |
| | | |
| | | let vals = [] |
| | | let forms = [] |
| | | let _forms = {} |
| | | let index = 0 |
| | | |
| | | let getColumns = (cols) => { |
| | | cols.forEach(item => { |
| | | if (item.type === 'colspan') { |
| | | getColumns(item.subcols) |
| | | } else if (item.editable === 'true') { |
| | | item.$sort = index |
| | | _forms[item.field] = item |
| | | index++ |
| | | } |
| | | }) |
| | | } |
| | | |
| | | getColumns(cols) |
| | | |
| | | columns.forEach(item => { |
| | | if (item.field === setting.primaryKey) return |
| | | |
| | | if (_forms[item.field]) { |
| | | let _item = {..._forms[item.field]} |
| | | if (_item.editType === 'date') { |
| | | _item.datatype = _item.declareType || 'datetime' |
| | | } else { |
| | | _item.datatype = item.datatype |
| | | } |
| | | |
| | | forms.push(_item) |
| | | } else { |
| | | forms.push({...item, $sort: 999}) |
| | | } |
| | | }) |
| | | |
| | | forms.sort((a, b) => a.$sort - b.$sort) |
| | | |
| | | forms.forEach(col => { |
| | | if (/date/.test(col.datatype)) { |
| | | vals.push(`'1949-10-01'`) |
| | | } else if (col.type === 'number') { |
| | | vals.push(`1`) |
| | | } else { |
| | | vals.push(`'mk'`) |
| | | } |
| | | }) |
| | | |
| | | vals.push(`'uuid'`) |
| | | vals.push(`'upt'`) |
| | | vals.push(`'${BID}'`) |
| | | |
| | | vals = `Select ${vals.join(',')}` |
| | | |
| | | let sql = '' |
| | | |
| | | let _initCustomScript = '' // 初始化脚本 |
| | | let _prevCustomScript = '' // 默认sql前执行脚本 |
| | | let _backCustomScript = '' // 默认sql后执行脚本 |
| | | let isDM = sessionStorage.getItem('dataM') === 'true' |
| | | let regs = [ |
| | | {reg: new RegExp('(^|\\s)@' + sheet + '(\\s|$)', 'ig'), value: ` #${sheet} `}, |
| | | {reg: new RegExp('(^|\\s)@' + sheet + '\\(', 'ig'), value: ` #${sheet}(`}, |
| | | {reg: new RegExp('(^|\\s)@' + sheet + '\\)', 'ig'), value: ` #${sheet})`}, |
| | | {reg: /@typename@/ig, value: `'admin'`}, |
| | | {reg: /\$@/ig, value: isDM ? '/*' : ''}, |
| | | {reg: /@\$/ig, value: isDM ? '*/' : ''}, |
| | | {reg: /@datam@/ig, value: isDM ? `'Y'` : `''`}, |
| | | ] |
| | | |
| | | btn.scripts && btn.scripts.forEach(script => { |
| | | if (script.status === 'false') return |
| | | |
| | | let _sql = script.sql |
| | | |
| | | regs.forEach(item => { |
| | | _sql = _sql.replace(item.reg, item.value) |
| | | }) |
| | | |
| | | if (script.position === 'init') { |
| | | _initCustomScript += ` |
| | | /* 自定义脚本 */ |
| | | ${_sql} |
| | | ` |
| | | } else if (script.position === 'front') { |
| | | _prevCustomScript += ` |
| | | /* 自定义脚本 */ |
| | | ${_sql} |
| | | ` |
| | | } else { |
| | | _backCustomScript += ` |
| | | /* 自定义脚本 */ |
| | | ${_sql} |
| | | ` |
| | | } |
| | | }) |
| | | |
| | | let _uniquesql = '' |
| | | if (btn.uniques && btn.uniques.length > 0) { |
| | | let textFields = [] |
| | | let numberFields = [] |
| | | let dateFields = [] |
| | | columns.forEach((col) => { |
| | | if (/Nvarchar/ig.test(col.datatype)) { |
| | | textFields.push(col.field) |
| | | } else if (/Decimal|int/ig.test(col.datatype)) { |
| | | numberFields.push(col.field) |
| | | } else if (/date/ig.test(col.datatype)) { |
| | | dateFields.push(col.field) |
| | | } |
| | | }) |
| | | btn.uniques.forEach(unique => { |
| | | if (unique.status === 'false' || !unique.verifyType) return |
| | | |
| | | let _fields = unique.field.split(',') |
| | | let _fields_ = _fields.map(_field => `a.${_field}=b.${_field}`) |
| | | _fields_ = _fields_.join(' and ') |
| | | _fields_ += ` and a.jskey != b.${setting.primaryKey || 'id'}` |
| | | |
| | | let _where = [] |
| | | _fields.forEach(f => { |
| | | if (textFields.includes(f)) { |
| | | _where.push(`${f}!=''`) |
| | | } else if (numberFields.includes(f)) { |
| | | _where.push(`${f}!=0`) |
| | | } else if (dateFields.includes(f)) { |
| | | _where.push(`${f}>'1949-10-01'`) |
| | | } |
| | | }) |
| | | _where = _where.length ? `where ${_where.join(' and ')} ` : '' |
| | | |
| | | if (unique.verifyType === 'logic' || unique.verifyType === 'logic_temp') { |
| | | _fields_ += ' and b.deleted=0' |
| | | } |
| | | |
| | | let _afields = [] |
| | | _fields = _fields.map(f => { |
| | | if (numberFields.includes(f)) { |
| | | _afields.push(`cast(a.${f} as nvarchar(50))`) |
| | | return `cast(${f} as nvarchar(50))` |
| | | } else if (dateFields.includes(f)) { |
| | | _afields.push(`CONVERT(nvarchar(50), a.${f}, 21)`) |
| | | return `CONVERT(nvarchar(50), ${f}, 21)` |
| | | } |
| | | _afields.push(`a.${f}`) |
| | | |
| | | return f |
| | | }) |
| | | |
| | | _uniquesql += ` |
| | | /* 重复性验证 */ |
| | | Set @tbid='' |
| | | Select top 1 @tbid=${_fields.join('+\' \'+')} from (select 1 as n,${unique.field} from #${sheet} ) a group by ${unique.field} having sum(n)>1 |
| | | |
| | | If @tbid!='' |
| | | Begin |
| | | select @ErrorCode='${unique.errorCode}',@retmsg=@tbid+' 重复' |
| | | goto aaa |
| | | end |
| | | |
| | | ${unique.verifyType.indexOf('temp') === -1 ? `Set @tbid='' |
| | | Select top 1 @tbid=${_afields.join('+\' \'+')} from ${_where ? `(select * from #${sheet} ${_where})` : `#${sheet}`} a Inner join ${sheet} b on ${_fields_} |
| | | |
| | | If @tbid!='' |
| | | Begin |
| | | select @ErrorCode='${unique.errorCode}',@retmsg=@tbid+' 与已有数据重复' |
| | | goto aaa |
| | | end` : ''} |
| | | ` |
| | | }) |
| | | } |
| | | |
| | | let declarefields = [] |
| | | let fields = [] |
| | | let upFields = [] |
| | | |
| | | forms.forEach(col => { |
| | | let key = col.field.toLowerCase() |
| | | if (key === 'jskey' || key === 'bid' || key === 'data_type') return |
| | | |
| | | declarefields.push(`${col.field} ${col.datatype}`) |
| | | fields.push(col.field) |
| | | upFields.push(`${col.field}=t.${col.field}`) |
| | | }) |
| | | |
| | | fields = fields.join(',') |
| | | upFields = upFields.join(',') |
| | | |
| | | let _insert = '' |
| | | if (btn.default !== 'false') { |
| | | _insert = ` |
| | | /* 默认sql */ |
| | | update a set ${upFields},modifydate=getdate(),modifyuserid='${sessionStorage.getItem('UserID') || ''}',modifyuser=@username,modifystaff=@fullname,deleted=0 |
| | | from (select * from #${sheet} where data_type='upt') t |
| | | inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | update a set deleted=1,modifydate=getdate(),modifyuserid='${sessionStorage.getItem('UserID') || ''}',modifyuser=@username,modifystaff=@fullname |
| | | from (select * from #${sheet} where data_type='del') t |
| | | inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | delete t from #${sheet} t inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | Insert into ${database}${sheet} (${fields},createuserid,createuser,createstaff,bid) |
| | | Select ${fields},'${sessionStorage.getItem('UserID') || ''}',@username,@fullname,'${BID}' From #${sheet} |
| | | ` |
| | | } |
| | | |
| | | sql = `create table #${sheet} (${declarefields.join(',')},jskey nvarchar(50),data_type nvarchar(50),BID nvarchar(256)) |
| | | 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),@tbid Nvarchar(512) |
| | | |
| | | Select @ErrorCode='', @retmsg='', @UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}' |
| | | ${_initCustomScript} |
| | | Insert into #${sheet} (${fields},jskey,data_type,BID) |
| | | |
| | | /* excel数据*/ |
| | | ${vals} |
| | | |
| | | ${_uniquesql} |
| | | ${_prevCustomScript} |
| | | ${_insert} |
| | | ${_backCustomScript} |
| | | |
| | | drop table #${sheet} |
| | | |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` |
| | | |
| | | return sql |
| | | } |
| | | |
| | | handleDelete = (record, type) => { |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | <Form.Item required label={'接口类型'}> |
| | | <Form.Item required label="接口类型"> |
| | | <Radio.Group value={verify.intertype} onChange={(e) => this.onOptionChange(e.target.value, 'intertype')}> |
| | | <Radio value="system">系统</Radio> |
| | | <Radio value="inner">内部</Radio> |
| | |
| | | type="fullscreen" |
| | | btn={verify} |
| | | usefulfields={fields} |
| | | setting={config.setting} |
| | | scripts={verify.scripts} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | |
| | | <CustomScript |
| | | btn={verify} |
| | | usefulfields={fields} |
| | | setting={config.setting} |
| | | scripts={verify.scripts} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | |
| | | <Col span={7}> |
| | | <Form.Item label="验证类型"> |
| | | {getFieldDecorator('verifyType', { |
| | | initialValue: 'physical', |
| | | initialValue: 'logic', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | ] |
| | | })( |
| | | <Select> |
| | | <Select.Option value="physical"> 物理验证(全量验证) </Select.Option> |
| | | <Select.Option value="logic"> 逻辑验证(全量验证) </Select.Option> |
| | | <Select.Option value="physical"> 物理验证(全量验证) </Select.Option> |
| | | <Select.Option value="physical_temp"> 物理验证(仅临时表) </Select.Option> |
| | | <Select.Option value="logic_temp"> 逻辑验证(仅临时表) </Select.Option> |
| | | </Select> |
| | |
| | | inputType: 'input', |
| | | editable: true, |
| | | searchable: true, |
| | | copy: true, |
| | | width: '28%' |
| | | }, |
| | | { |
| | |
| | | { value: 'datetime', text: 'datetime' }, |
| | | ], |
| | | editable: true, |
| | | copy: true, |
| | | width: '25%', |
| | | } |
| | | ], |
| | |
| | | |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, _columns, searches, config.subtype, config.hasExtend) |
| | | |
| | | if (type === 'submit' && r.custompage && setting.queryType !== 'statistics') { |
| | | Modal.info({ |
| | | title: '数据源或自定义脚本中使用了自定义分页,查询类型请使用统计!', |
| | | }) |
| | | reject() |
| | | return |
| | | } |
| | | if (r.custompage && setting.laypage === 'true' && _columns.findIndex(col => col.field === 'mk_total') === -1) { |
| | | if (config.subtype !== 'basetable') { |
| | | const that = this |
| | |
| | | }) |
| | | } |
| | | |
| | | tolowercase = (type) => { |
| | | const that = this |
| | | confirm({ |
| | | content: type === 'sub' ? '确定将子表字段转为小写吗?' : '确定将字段转为小写吗?', |
| | | onOk() { |
| | | that.execlowercase(type) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | execlowercase = (type) => { |
| | | const { subColumns, columns } = this.state |
| | | |
| | | if (type === 'sub') { |
| | | this.setState({subColumns: fromJS(subColumns).toJS().map(col => { |
| | | col.field = col.field.toLowerCase() |
| | | return col |
| | | })}) |
| | | } else { |
| | | this.setState({columns: fromJS(columns).toJS().map(col => { |
| | | col.field = col.field.toLowerCase() |
| | | return col |
| | | })}) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | type="fields" |
| | | updatefield={this.updatefields} |
| | | /> |
| | | <SwapOutlined className="columns-lowercase" title="转小写" onClick={() => this.tolowercase()}/> |
| | | <ExcelOut data={columns} setting={setting}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} searchKey={searchKey} type="datasourcefield" wrappedComponentRef={(inst) => this.datasource = inst} data={columns} columns={colColumns} onChange={(columns) => this.setState({columns})}/> |
| | | </TabPane> : <TabPane tab={ |
| | |
| | | type="fields" |
| | | updatefield={this.updateSubfields} |
| | | /> |
| | | <SwapOutlined className="columns-lowercase" title="转小写" onClick={() => this.tolowercase('sub')}/> |
| | | <ExcelOut data={subColumns} setting={setting}/> |
| | | <EditTable actions={['edit', 'move', 'copy', 'del', 'clear']} searchKey={searchKey} type="datasourcefield" wrappedComponentRef={(inst) => this.subdatasource = inst} data={subColumns} columns={colColumns} onChange={(subColumns) => this.setState({subColumns})}/> |
| | | </TabPane> : null} |
| | |
| | | margin-right: 5px; |
| | | cursor: pointer; |
| | | } |
| | | .columns-lowercase { |
| | | float: right; |
| | | position: relative; |
| | | z-index: 2; |
| | | right: 30px; |
| | | height: 0px; |
| | | top: -15px; |
| | | color: orange; |
| | | cursor: pointer; |
| | | } |
| | | .columns-out { |
| | | float: right; |
| | | position: relative; |
| | |
| | | .ant-table-thead { |
| | | .copy-control { |
| | | top: -18px; |
| | | right: 55px; |
| | | right: 35px; |
| | | .anticon-copy { |
| | | margin-right: 12px; |
| | | } |
| | |
| | | sqlList = [] |
| | | verSqls = [] |
| | | linkMain = null |
| | | modules = null |
| | | supError = null |
| | | |
| | | trigger = () => { |
| | | let config = fromJS(this.props.config).toJS() |
| | |
| | | if (error) { |
| | | Modal.warning({ |
| | | title: error, |
| | | okText: '知道了' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.modules = {} |
| | | this.supError = null |
| | | |
| | | this.getModules(config.components, config.interfaces) |
| | | |
| | | config.interfaces && config.interfaces.forEach(item => { |
| | | if (item.setting && item.setting.supModule && item.setting.supModule[0] !== 'empty') { |
| | | let id = item.setting.supModule[item.setting.supModule.length - 1] |
| | | if (!this.modules[id]) { |
| | | this.supError = item.name + '(公共数据源)' |
| | | } |
| | | } |
| | | }) |
| | | |
| | | this.checklink(config.components) |
| | | |
| | | if (this.supError) { |
| | | Modal.warning({ |
| | | title: this.supError + ':上级组件不存在!', |
| | | okText: '知道了' |
| | | }) |
| | | return |
| | |
| | | }) |
| | | |
| | | this.sqlList = [] |
| | | } |
| | | |
| | | getModules = (components, interfaces, sups = []) => { |
| | | components.forEach(item => { |
| | | this.modules[item.uuid] = [...sups, item.uuid] |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(f_tab => { |
| | | this.getModules(f_tab.components, null, [...sups, item.uuid, f_tab.uuid]) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | item.components.forEach(cell => { |
| | | this.modules[cell.uuid] = [...sups, item.uuid, cell.uuid] |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | if (interfaces && interfaces.length > 0) { |
| | | interfaces.forEach(item => { |
| | | this.modules[item.uuid] = [item.uuid] |
| | | }) |
| | | } |
| | | } |
| | | |
| | | checklink = (components, suplabel = '') => { |
| | | if (this.supError) return |
| | | components.forEach(item => { |
| | | if (this.supError) return |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(f_tab => { |
| | | this.checklink(f_tab.components, suplabel) |
| | | }) |
| | | } else if (item.type === 'group' ) { |
| | | item.components && this.checklink(item.components, suplabel) |
| | | } else { |
| | | if (item.wrap && item.wrap.supType === 'multi') { |
| | | if (item.setting && item.setting.supModule) { |
| | | item.setting.supModule = '' |
| | | } |
| | | if (item.supNodes) { |
| | | item.supNodes.forEach(cell => { |
| | | let id = cell.nodes[cell.nodes.length - 1] |
| | | if (!this.modules[id]) { |
| | | this.supError = suplabel + item.name |
| | | } |
| | | }) |
| | | } |
| | | } else if ((item.wrap && item.wrap.datatype === 'static') || (['mainsearch', 'voucher'].includes(item.subtype))) { |
| | | if (item.wrap && item.wrap.supModule && item.wrap.supModule[0]) { |
| | | let id = item.wrap.supModule[item.wrap.supModule.length - 1] |
| | | if (!this.modules[id]) { |
| | | this.supError = suplabel + item.name |
| | | } |
| | | } |
| | | } else if (item.setting && item.setting.supModule && item.setting.supModule[0] !== 'empty') { |
| | | let id = item.setting.supModule[item.setting.supModule.length - 1] |
| | | if (!this.modules[id]) { |
| | | this.supError = suplabel + item.name |
| | | } |
| | | } |
| | | |
| | | if (this.supError) return |
| | | |
| | | if (['card', 'carousel', 'timeline'].includes(item.type)) { |
| | | item.subcards.forEach(card => { |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType === 'button' && cell.OpenType === 'popview') { |
| | | if (cell.config && cell.config.components && cell.config.enabled) { |
| | | this.checklink(cell.config.components, item.name + '-' + cell.label + '(弹窗标签)-') |
| | | } |
| | | } |
| | | }) |
| | | card.backElements && card.backElements.forEach(cell => { |
| | | if (cell.eleType === 'button' && cell.OpenType === 'popview') { |
| | | if (cell.config && cell.config.components && cell.config.enabled) { |
| | | this.checklink(cell.config.components, item.name + '-' + cell.label + '(弹窗标签)-') |
| | | } |
| | | } |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements && item.elements.forEach(cell => { |
| | | if (cell.eleType === 'button' && cell.OpenType === 'popview') { |
| | | if (cell.config && cell.config.components && cell.config.enabled) { |
| | | this.checklink(cell.config.components, item.name + '-' + cell.label + '(弹窗标签)-') |
| | | } |
| | | } |
| | | }) |
| | | } else if (item.type === 'table' && item.cols) { |
| | | let loopCol = (cols) => { |
| | | cols.forEach(col => { |
| | | if (col.type === 'colspan' && col.subcols) { |
| | | loopCol(col.subcols) |
| | | } else if (col.type === 'custom' && col.elements) { |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType === 'button' && cell.OpenType === 'popview') { |
| | | if (cell.config && cell.config.components && cell.config.enabled) { |
| | | this.checklink(cell.config.components, item.name + '-' + cell.label + '(弹窗标签)-') |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | loopCol(item.cols) |
| | | } |
| | | |
| | | item.action && item.action.forEach(cell => { |
| | | if (cell.OpenType === 'popview') { |
| | | if (cell.config && cell.config.components && cell.config.enabled) { |
| | | this.checklink(cell.config.components, item.name + '-' + cell.label + '(弹窗标签)-') |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | filterComponent = (components, mainSearch, regs, process, ispop = false) => { |
| | |
| | | type: item.type |
| | | } |
| | | |
| | | if (item.type === 'linkMain' && item.verifyVal === 'true') { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | |
| | | if (_item.type === 'datemonth') { |
| | | _item.type = 'text' |
| | | } else if (_item.type === 'number' || _item.type === 'rate') { |
| | |
| | | type: item.type |
| | | } |
| | | |
| | | if (item.type === 'linkMain' && item.verifyVal === 'true') { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | |
| | | if (_item.type === 'datemonth') { |
| | | _item.type = 'text' |
| | | } else if (_item.type === 'number' || _item.type === 'rate') { |
| | |
| | | key: 'mk_n_id' |
| | | }) |
| | | } |
| | | |
| | | let verifyValSql = '' |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | | if (form.$verify) { |
| | | verifyValSql += ` |
| | | if @${form.key}=${form.type === 'number' ? 0 : `''`} |
| | | begin |
| | | select @errorcode='E',@retmsg='${form.label},关联主表失效' |
| | | goto aaa |
| | | end |
| | | ` |
| | | } |
| | | |
| | | let _key = form.key.toLowerCase() |
| | | if (!_initvars.includes(_key)) { |
| | | _initvars.push(_key) |
| | |
| | | |
| | | verify.billcodes.forEach(item => { |
| | | let _key = item.field.toLowerCase() |
| | | let _linkKey = item.linkField ? item.linkField.toLowerCase() : '' |
| | | |
| | | if (!keys.includes(_key)) return // 表单中不含单号生成字段 |
| | | |
| | | let _lpline = '' |
| | | if (item.TypeCharOne === 'Lp') { |
| | | if (_linkKey === 'bid' && BID) { // 替换bid |
| | | if (/^BID$/ig.test(item.linkField)) { |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@BID@,48)` |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${_linkKey},48)` |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${item.linkField},48)` |
| | | } |
| | | } else if (item.TypeCharOne === 'BN') { |
| | | if (_linkKey === 'bid' && BID) { // 替换bid |
| | | if (/^BID$/ig.test(item.linkField)) { |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@BID@,48)` |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@${_linkKey},48)` |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@${item.linkField},48)` |
| | | } |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= right('${item.ModularDetailCode}',50)` |
| | |
| | | let hasvoucher = false |
| | | |
| | | // 凭证-显示列中选取,必须选行 |
| | | if (verify.voucher && verify.voucher.enabled && btn.Ot !== 'requiredOnce') { |
| | | if (verify.voucher && verify.voucher.enabled) { |
| | | let _voucher = verify.voucher |
| | | let linkField = `@${_voucher.linkField}` |
| | | |
| | | if (/^BID$/ig.test(_voucher.linkField)) { |
| | | linkField = `'${BID}'` |
| | | } |
| | | |
| | | hasvoucher = true |
| | | |
| | | _sql += ` |
| | | /* 创建凭证 */ |
| | | exec s_BVoucher_Create |
| | | @Bill = @${_voucher.linkField}, |
| | | @Bill = ${linkField}, |
| | | @BVoucherType ='${_voucher.BVoucherType}', |
| | | @VoucherTypeOne ='${_voucher.VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', |
| | |
| | | } |
| | | } else if (_backCustomScript) { |
| | | _sql += _backCustomScript |
| | | } |
| | | |
| | | if (verifyValSql) { |
| | | _sql += verifyValSql |
| | | } |
| | | |
| | | if (btn.procMode === 'system') { |
| | |
| | | let _fields = unique.field.split(',') |
| | | let _fields_ = _fields.map(_field => `a.${_field}=b.${_field}`) |
| | | _fields_ = _fields_.join(' and ') |
| | | _fields_ += ` and a.jskey != b.${setting.primaryKey || 'id'}` |
| | | |
| | | let _where = [] |
| | | _fields.forEach(f => { |
| | |
| | | |
| | | let declarefields = [] |
| | | let fields = [] |
| | | let upFields = [] |
| | | |
| | | forms.forEach(col => { |
| | | let key = col.field.toLowerCase() |
| | |
| | | |
| | | declarefields.push(`${col.field} ${col.datatype}`) |
| | | fields.push(col.field) |
| | | upFields.push(`${col.field}=t.${col.field}`) |
| | | }) |
| | | |
| | | fields = fields.join(',') |
| | | upFields = upFields.join(',') |
| | | |
| | | let _insert = '' |
| | | if (btn.default !== 'false') { |
| | | _insert = ` |
| | | /* 默认sql */ |
| | | update a set ${upFields},modifydate=getdate(),modifyuserid='${sessionStorage.getItem('UserID') || ''}',modifyuser=@username,modifystaff=@fullname,deleted=0 |
| | | from (select * from #${sheet} where data_type='upt') t |
| | | inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | update a set deleted=1,modifydate=getdate(),modifyuserid='${sessionStorage.getItem('UserID') || ''}',modifyuser=@username,modifystaff=@fullname |
| | | from (select * from #${sheet} where data_type='del') t |
| | | inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | delete t from #${sheet} t inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | Insert into ${database}${sheet} (${fields},createuserid,createuser,createstaff,bid) |
| | | Select ${fields},'${sessionStorage.getItem('UserID') || ''}',@username,@fullname,'${BID}' From #${sheet} |
| | | ` |
New file |
| | |
| | | import React, { Component } from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Modal, Button, notification } from 'antd' |
| | | import { VerticalRightOutlined } from '@ant-design/icons' |
| | | |
| | | // import './index.scss' |
| | | |
| | | const { confirm } = Modal |
| | | |
| | | class LowerField extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, |
| | | updateConfig: PropTypes.func |
| | | } |
| | | |
| | | trigger = () => { |
| | | const that = this |
| | | confirm({ |
| | | content: `确定将字段转为小写吗?`, |
| | | onOk() { |
| | | that.exec() |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | exec = () => { |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | let resetElement = (m) => { |
| | | if (m.datatype === 'dynamic' && m.field) { |
| | | m.field = m.field.toLowerCase() |
| | | } |
| | | if (m.posterField) { |
| | | m.posterField = m.posterField.toLowerCase() |
| | | } |
| | | if (m.bgImage) { |
| | | m.bgImage = m.bgImage.toLowerCase() |
| | | } |
| | | if (m.linkurl && /^[a-zA-Z0-9_]+$/.test(m.linkurl)) { |
| | | m.linkurl = m.linkurl.toLowerCase() |
| | | } |
| | | if (m.modal && m.modal.fields) { |
| | | m.modal.fields = m.modal.fields.map(col => { |
| | | if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | } |
| | | if (col.type === 'split' && col.splitctrl) { |
| | | col.splitctrl = col.splitctrl.toLowerCase() |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.verify) { |
| | | if (m.verify.columns) { |
| | | m.verify.columns = m.verify.columns.map(col => { |
| | | if (col.Column) { |
| | | col.Column = col.Column.toLowerCase() |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.verify.uniques) { |
| | | m.verify.uniques = m.verify.uniques.map(col => { |
| | | if (col.field) { |
| | | col.field = col.field.split(',').map(_field => { |
| | | if (_field === 'BID') return _field |
| | | return _field.toLowerCase() |
| | | }).join(',') |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (m.verify.accountfield && m.verify.accountfield !== 'BID') { |
| | | m.verify.accountfield = m.verify.accountfield.toLowerCase() |
| | | } |
| | | if (m.verify.voucher && m.verify.voucher.linkField && m.verify.voucher.linkField !== 'BID') { |
| | | m.verify.voucher.linkField = m.verify.voucher.linkField.toLowerCase() |
| | | } |
| | | } |
| | | if (m.controlField) { |
| | | m.controlField = m.controlField.toLowerCase() |
| | | } |
| | | if (m.config && m.config.components) { |
| | | m.config.components = _replace(m.config.components) |
| | | } |
| | | } |
| | | let _replace = (components) => { |
| | | return components.map(item => { |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | tab.components = _replace(tab.components) |
| | | }) |
| | | return item |
| | | } else if (item.type === 'group') { |
| | | item.components = _replace(item.components) |
| | | return item |
| | | } |
| | | |
| | | if (item.columns) { |
| | | item.columns = item.columns.map(col => { |
| | | if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (item.setting && item.setting.primaryKey) { |
| | | item.setting.primaryKey = item.setting.primaryKey.toLowerCase() |
| | | } |
| | | if (item.subColumns) { |
| | | item.subColumns = item.subColumns.map(col => { |
| | | if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (item.search) { |
| | | if (item.type === 'topbar') { |
| | | if (item.search.fields) { |
| | | item.search.fields = item.search.fields.map(col => { |
| | | if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (item.search.groups) { |
| | | item.search.groups = item.search.groups.map(group => { |
| | | group.fields = group.fields.map(col => { |
| | | if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | } |
| | | return col |
| | | }) |
| | | return group |
| | | }) |
| | | } |
| | | } else if (Array.isArray(item.search)) { |
| | | item.search = item.search.map(col => { |
| | | if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (item.action) { |
| | | item.action.forEach(m => { |
| | | resetElement(m) |
| | | }) |
| | | } |
| | | |
| | | if (item.subcards) { |
| | | item.subcards.forEach(card => { |
| | | if (card.setting && card.setting.controlField) { |
| | | card.setting.controlField = card.setting.controlField.toLowerCase() |
| | | } |
| | | if (card.elements) { |
| | | card.elements = card.elements.map(m => { |
| | | resetElement(m) |
| | | return m |
| | | }) |
| | | } |
| | | |
| | | if (card.backElements) { |
| | | card.backElements = card.backElements.map(m => { |
| | | resetElement(m) |
| | | return m |
| | | }) |
| | | } |
| | | |
| | | if (card.fields) { |
| | | card.fields = card.fields.map(m => { |
| | | if (m.field) { |
| | | m.field = m.field.toLowerCase() |
| | | } |
| | | if (m.type === 'split' && m.splitctrl) { |
| | | m.splitctrl = m.splitctrl.toLowerCase() |
| | | } |
| | | return m |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (item.elements) { |
| | | item.elements = item.elements.map(m => { |
| | | resetElement(m) |
| | | return m |
| | | }) |
| | | } |
| | | |
| | | if (item.plot) { |
| | | if (item.plot.Xaxis) { |
| | | item.plot.Xaxis = item.plot.Xaxis.toLowerCase() |
| | | } |
| | | // 统计图 |
| | | if (item.plot.InfoValue) { |
| | | item.plot.InfoValue = item.plot.InfoValue.toLowerCase() |
| | | } |
| | | if (item.plot.InfoType) { |
| | | item.plot.InfoType = item.plot.InfoType.toLowerCase() |
| | | } |
| | | // 占比图 |
| | | if (item.plot.valueField) { |
| | | item.plot.valueField = item.plot.valueField.toLowerCase() |
| | | } |
| | | if (item.plot.labelField) { |
| | | item.plot.labelField = item.plot.labelField.toLowerCase() |
| | | } |
| | | // 饼图 |
| | | if (item.plot.type) { |
| | | item.plot.type = item.plot.type.toLowerCase() |
| | | } |
| | | // 散点图 |
| | | if (item.plot.gender) { |
| | | item.plot.gender = item.plot.gender.toLowerCase() |
| | | } |
| | | if (item.Yaxis) { |
| | | if (Array.isArray(item.Yaxis)) { |
| | | item.Yaxis = item.Yaxis.map(m => { |
| | | if (m) return m.toLowerCase() |
| | | return m |
| | | }) |
| | | } else { |
| | | if (item.Yaxis) { |
| | | item.Yaxis = item.Yaxis.toLowerCase() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (item.cols) { |
| | | let _update = (cols) => { |
| | | return cols.map(col => { |
| | | if (col.type === 'custom' && col.elements) { |
| | | col.elements = col.elements.map(m => { |
| | | resetElement(m) |
| | | return m |
| | | }) |
| | | } else if (col.type === 'colspan') { |
| | | col.subcols = _update(col.subcols) |
| | | } else if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | } |
| | | |
| | | return col |
| | | }) |
| | | } |
| | | |
| | | item.cols = _update(item.cols) |
| | | } |
| | | |
| | | if (item.wrap) { |
| | | if (item.wrap.tipField) { |
| | | item.wrap.tipField = item.wrap.tipField.toLowerCase() |
| | | } |
| | | if (item.wrap.controlField) { |
| | | item.wrap.controlField = item.wrap.controlField.toLowerCase() |
| | | } |
| | | if (item.wrap.valueField) { |
| | | item.wrap.valueField = item.wrap.valueField.toLowerCase() |
| | | } |
| | | if (item.wrap.labelField) { |
| | | item.wrap.labelField = item.wrap.labelField.toLowerCase() |
| | | } |
| | | if (item.wrap.parentField) { |
| | | item.wrap.parentField = item.wrap.parentField.toLowerCase() |
| | | } |
| | | if (item.wrap.broadcast) { |
| | | item.wrap.broadcast = item.wrap.broadcast.toLowerCase() |
| | | } |
| | | if (item.wrap.jumpField) { |
| | | item.wrap.jumpField = item.wrap.jumpField.toLowerCase() |
| | | } |
| | | if (item.wrap.link) { |
| | | item.wrap.link = item.wrap.link.toLowerCase() |
| | | } |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | config.components = _replace(config.components) |
| | | |
| | | config.interfaces && config.interfaces.forEach(item => { |
| | | if (item.columns) { |
| | | item.columns = item.columns.map(col => { |
| | | if (col.field) { |
| | | col.field = col.field.toLowerCase() |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | if (item.setting && item.setting.primaryKey) { |
| | | item.setting.primaryKey = item.setting.primaryKey.toLowerCase() |
| | | } |
| | | }) |
| | | |
| | | notification.success({ |
| | | top: 92, |
| | | message: '转换已完成。', |
| | | duration: 3 |
| | | }) |
| | | |
| | | this.props.updateConfig(config) |
| | | } |
| | | |
| | | render() { |
| | | return ( |
| | | <Button className="mk-border-purple" onClick={this.trigger}><VerticalRightOutlined style={{transform: 'rotate(270deg)'}}/> 字段转小写</Button> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default LowerField |
| | |
| | | |
| | | const MkIcon = asyncComponent(() => import('@/components/mk-icon')) |
| | | const TableComponent = asyncComponent(() => import('./tablecomponent')) |
| | | const NormalCopy = asyncComponent(() => import('@/menu/normalCopy')) |
| | | const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) |
| | | const PasteForms = asyncComponent(() => import('@/menu/components/share/pasteforms')) |
| | | const FormFork = asyncComponent(() => import('@/menu/modalconfig/formfork')) |
| | |
| | | }) |
| | | } |
| | | |
| | | submitConfig = () => { |
| | | submitConfig = (type) => { |
| | | const { config } = this.state |
| | | |
| | | this.setState({originConfig: fromJS(config).toJS(), saving: true}) |
| | | if (type === 'cache') { |
| | | this.setState({originConfig: fromJS(config).toJS()}) |
| | | this.props.handleSave(config) |
| | | |
| | | message.success(<span>表单配置已保存至本地(<span style={{color: 'red'}}>尚未提交至云端</span>)。</span>) |
| | | } else { |
| | | this.setState({originConfig: fromJS(config).toJS(), saving: true}) |
| | | this.props.handleSave(config) |
| | | setTimeout(() => { |
| | | MKEmitter.emit('triggerMenuSave') |
| | | }, 100) |
| | | } |
| | | } |
| | | |
| | | clearConfig = () => { |
| | |
| | | <Collapse accordion defaultActiveKey="1" bordered={false}> |
| | | <Panel header="基本信息" key="0"> |
| | | <TableComponent /> |
| | | <NormalCopy /> |
| | | </Panel> |
| | | <Panel header="表单" key="1"> |
| | | <div className="search-element"> |
| | |
| | | <div className="setting"> |
| | | <Card title="表单配置" bordered={false} extra={ |
| | | <div> |
| | | <Button className="mk-border-green" onClick={() => this.submitConfig('cache')}>存草稿</Button> |
| | | <PasteForms type="toolbar" config={config} update={this.pasteFields}/> |
| | | <Button type="primary" id="save-modal-config" loading={saving} onClick={this.submitConfig}>保存</Button> |
| | | <Button type="primary" id="save-modal-config" loading={saving} onClick={() => this.submitConfig()}>保存</Button> |
| | | <Button disabled={saving} onClick={this.cancelConfig}>返回</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |
New file |
| | |
| | | import React, { Component } from 'react' |
| | | import { Radio } from 'antd' |
| | | |
| | | import './index.scss' |
| | | |
| | | class NormalCopy extends Component { |
| | | state = { |
| | | value: window.GLOB.CopyOnly === true ? 'true' : 'false' |
| | | } |
| | | |
| | | selectChange = (val) => { |
| | | if (val === 'true') { |
| | | window.GLOB.CopyOnly = true |
| | | } else { |
| | | window.GLOB.CopyOnly = false |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { value } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-normal-copy"> |
| | | 元素复制:<Radio.Group defaultValue={value} onChange={(e) => {this.selectChange(e.target.value)}}> |
| | | <Radio value="true">仅复制</Radio> |
| | | <Radio value="false">复制+自增</Radio> |
| | | </Radio.Group> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default NormalCopy |
New file |
| | |
| | | .mk-normal-copy { |
| | | padding-left: 18px; |
| | | white-space: nowrap; |
| | | |
| | | .ant-radio-wrapper { |
| | | margin-right: 2px; |
| | | } |
| | | } |
| | | .model-tablename-manage-view + .mk-normal-copy { |
| | | margin-top: 15px; |
| | | } |
| | | .modal-form-board, .mob-form-board { |
| | | .mk-normal-copy { |
| | | padding-left: 0px; |
| | | |
| | | span.ant-radio + * { |
| | | padding-right: 2px; |
| | | padding-left: 2px; |
| | | } |
| | | } |
| | | } |
| | |
| | | .mk-normal-css { |
| | | padding-left: 18px; |
| | | margin-bottom: 15px; |
| | | |
| | | .anticon-edit { |
| | | color: #1890ff; |
| | |
| | | } |
| | | } else { |
| | | options.push('editable', 'mainsearch', 'antvG6', 'antvX6', 'calendar', 'tree', 'dashboard', 'chart') |
| | | if (appType !== 'pc') { |
| | | options.push('account') |
| | | } |
| | | } |
| | | } else { |
| | | if (appType === 'mob') { |
| | |
| | | |
| | | class ReplaceField extends Component { |
| | | static propTpyes = { |
| | | type: PropTypes.string, |
| | | config: PropTypes.object, |
| | | updateConfig: PropTypes.func |
| | | } |
| | |
| | | |
| | | // 依据原字段替换为新字段 |
| | | exec = (map) => { |
| | | const { type } = this.props |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | if (type === 'custom') { |
| | | let _replace = (components) => { |
| | | return components.map(item => { |
| | | if (item.type === 'tabs') { |
| | |
| | | } |
| | | |
| | | config.components = _replace(config.components) |
| | | // } else if (type === 'table') { |
| | | // config.columns = config.columns.map(col => { |
| | | // if (col.field && map[col.field.toLowerCase()]) { |
| | | // col.field = map[col.field.toLowerCase()].FieldName |
| | | // } |
| | | // return col |
| | | // }) |
| | | |
| | | // config.search = config.search.map(col => { |
| | | // if (col.field && map[col.field.toLowerCase()]) { |
| | | // col.field = map[col.field.toLowerCase()].FieldName |
| | | // } |
| | | // if (col.datefield && map[col.datefield.toLowerCase()]) { |
| | | // col.datefield = map[col.datefield.toLowerCase()].FieldName |
| | | // } |
| | | // return col |
| | | // }) |
| | | |
| | | // config.action = config.action.map(m => { |
| | | // if (m.verify && m.verify.columns) { |
| | | // m.verify.columns = m.verify.columns.map(col => { |
| | | // if (col.Column && map[col.Column.toLowerCase()]) { |
| | | // col.Column = map[col.Column.toLowerCase()].FieldName |
| | | // } |
| | | // return col |
| | | // }) |
| | | // } |
| | | // return m |
| | | // }) |
| | | } else if (type === 'form') { |
| | | config.fields = config.fields.map(col => { |
| | | if (col.field && map[col.field.toLowerCase()]) { |
| | | col.field = map[col.field.toLowerCase()].FieldName |
| | | config.interfaces && config.interfaces.forEach(item => { |
| | | if (item.columns) { |
| | | item.columns = item.columns.map(col => { |
| | | let cell = map[col.field.toLowerCase()] |
| | | if (cell) { |
| | | col.field = cell.FieldName |
| | | if (cell.datatype) { |
| | | col.datatype = cell.datatype |
| | | } |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | confirming: false, |
| | |
| | | |
| | | // 依据字段替换名称 |
| | | execLabel = (map) => { |
| | | const { type } = this.props |
| | | let config = fromJS(this.props.config).toJS() |
| | | |
| | | if (type === 'custom') { |
| | | let _replace = (components) => { |
| | | return components.map(item => { |
| | | if (item.type === 'tabs') { |
| | |
| | | } |
| | | |
| | | config.components = _replace(config.components) |
| | | // } else if (type === 'table') { |
| | | // config.columns = config.columns.map(col => { |
| | | // if (col.field && map[col.field.toLowerCase()]) { |
| | | // col.label = map[col.field.toLowerCase()].FieldDec |
| | | // } |
| | | // return col |
| | | // }) |
| | | |
| | | // config.search = config.search.map(col => { |
| | | // if (col.field && map[col.field.toLowerCase()]) { |
| | | // col.label = map[col.field.toLowerCase()].FieldDec |
| | | // } |
| | | // return col |
| | | // }) |
| | | |
| | | // config.action = config.action.map(m => { |
| | | // if (m.verify && m.verify.columns) { |
| | | // m.verify.columns = m.verify.columns.map(col => { |
| | | // if (col.Column && map[col.Column.toLowerCase()]) { |
| | | // col.Text = map[col.Column.toLowerCase()].FieldDec |
| | | // } |
| | | // return col |
| | | // }) |
| | | // } |
| | | // return m |
| | | // }) |
| | | } else if (type === 'form') { |
| | | config.fields = config.fields.map(col => { |
| | | config.interfaces && config.interfaces.forEach(item => { |
| | | if (item.columns) { |
| | | item.columns = item.columns.map(col => { |
| | | if (col.field && map[col.field.toLowerCase()]) { |
| | | col.label = map[col.field.toLowerCase()].FieldDec |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | }) |
| | | |
| | | this.setState({ |
| | | confirming: false, |
| | |
| | | background: #ffffff; |
| | | } |
| | | body.style-control { |
| | | .pc-menu-view::before, .menu-control::before { |
| | | .menu-setting::before, .mk-opeartion-list::before { |
| | | content: ' '; |
| | | position: absolute; |
| | | left: 0; |
| | |
| | | z-index: 12; |
| | | background:rgba(0, 0, 0, 0.2); |
| | | } |
| | | .pc-poper-view::before { |
| | | content: ' '; |
| | | position: absolute; |
| | | left: 0; |
| | | top: 0; |
| | | bottom: 0; |
| | | right: 0; |
| | | z-index: 12; |
| | | background:rgba(0, 0, 0, 0.2); |
| | | .menu-setting .draw, .menu-control .draw { |
| | | display: none; |
| | | } |
| | | .menu-body .menu-view >.ant-card >.ant-card-body { |
| | | position: relative; |
| | | z-index: 13; |
| | | background:#ffffff; |
| | | .style-control-button { |
| | | z-index: 12; |
| | | } |
| | | .menu-view { |
| | | .anticon-tool { |
| | | display: none; |
| | | } |
| | | } |
| | | .mk-pc-view .menu-setting { |
| | | display: none; |
| | | } |
| | | .mk-mob-view .mob-shell { |
| | | .anticon-tool { |
| | | display: none; |
| | |
| | | import React, { useState } from 'react' |
| | | import { useDrop } from 'react-dnd' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Col } from 'antd' |
| | | import { Col, message } from 'antd' |
| | | import update from 'immutability-helper' |
| | | import Utils from '@/utils/utils.js' |
| | | import Card from './card' |
| | |
| | | oInput.style.display = 'none' |
| | | document.body.removeChild(oInput) |
| | | |
| | | if (window.GLOB.CopyOnly) { |
| | | message.success('复制成功。') |
| | | } else { |
| | | const _cards = update(cards, { $splice: [[overIndex + 1, 0, _card]] }) |
| | | |
| | | setCards(_cards) |
| | | |
| | | handleList(_cards, _card) |
| | | } |
| | | } |
| | | |
| | | const [, drop] = useDrop({ |
| | |
| | | newcard.options = [] |
| | | newcard.readonly = 'false' |
| | | newcard.required = 'true' |
| | | newcard.readin = 'top' |
| | | newcard.span = 24 |
| | | newcard.focus = true |
| | | |
| | | if (item.subType === 'textarea') { |
| | | if (item.subType === 'linkMain') { |
| | | newcard.hidden = 'true' |
| | | newcard.verifyVal = 'true' |
| | | } else if (item.subType === 'textarea') { |
| | | newcard.required = 'false' |
| | | } |
| | | |
| | |
| | | const { confirm } = Modal |
| | | const TableComponent = asyncComponent(() => import('@/menu/modalconfig/tablecomponent')) |
| | | const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) |
| | | const NormalCopy = asyncComponent(() => import('@/menu/normalCopy')) |
| | | const PasteForms = asyncComponent(() => import('@/menu/components/share/pasteforms')) |
| | | const DragElement = asyncComponent(() => import('@/mob/components/formdragelement')) |
| | | const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) |
| | |
| | | <Collapse accordion defaultActiveKey="1" bordered={false}> |
| | | <Panel header="基本信息" key="0"> |
| | | <TableComponent /> |
| | | <NormalCopy/> |
| | | </Panel> |
| | | <Panel header="表单" key="1"> |
| | | <div className="search-element"> |
| | |
| | | dataIndex: 'link', |
| | | inputType: 'input', |
| | | editable: true, |
| | | unique: true, |
| | | required: true, |
| | | width: '40%' |
| | | }, |
| | |
| | | userConfig: null, // 用户自定义设置 |
| | | visible: false, // 标签页控制 |
| | | shortcuts: null, // 快捷键 |
| | | autoMatic: null |
| | | autoMatic: null, |
| | | noParam: false |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | async loadconfig () { |
| | | const { MenuID, MenuName, param } = this.props |
| | | const { noParam } = this.state |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | let skip = window.GLOB.mkHS |
| | | let urlparam = {} // url参数 |
| | | if (param) { |
| | | if (!noParam) { |
| | | Object.keys(param).forEach(key => { |
| | | if (/^\$/.test(key)) { |
| | | urlparam[key] = param[key] |
| | |
| | | urlparam[key.toLowerCase()] = param[key] |
| | | } |
| | | }) |
| | | } else { |
| | | urlparam.$BID = param.$BID |
| | | } |
| | | } |
| | | |
| | | window.GLOB.CacheData.set(MenuID, urlparam) |
| | |
| | | }) |
| | | } |
| | | |
| | | reloadMenuView = (menuId) => { |
| | | reloadMenuView = (menuId, clear) => { |
| | | const { MenuID } = this.props |
| | | |
| | | if (MenuID !== menuId) return |
| | | |
| | | this.reloadview() |
| | | this.reloadview(clear) |
| | | } |
| | | |
| | | resetActiveMenu = (menuId) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | reloadview = () => { |
| | | reloadview = (clear) => { |
| | | window.GLOB.CacheData.delete(this.props.MenuID) |
| | | if (this.state.config) { |
| | | this.deleteCache(this.state.config.components) |
| | |
| | | viewlost: false, // 页面丢失:1、未获取到配置-页面丢失;2、页面未启用 |
| | | config: null, // 页面配置信息,包括组件等 |
| | | shortcuts: null, |
| | | noParam: clear === true |
| | | }, () => { |
| | | this.loadconfig() |
| | | }) |
| | |
| | | return |
| | | } |
| | | |
| | | if (/^http.+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar|.ppt)$/i.test(url) || card.linkType === 'download') { |
| | | if (/^(http|\/\/).+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar|.ppt)$/i.test(url) || card.linkType === 'download') { |
| | | let name = '' |
| | | if (card.datatype === 'static') { |
| | | name = card.value || '' |
| | |
| | | url = data[card.linkurl] |
| | | } |
| | | |
| | | if (/^http.+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar)$/i.test(url)) { |
| | | if (/^(http|\/\/).+(.txt|.doc|.docx|.pdf|.xlsx|.xls|.zip|.rar)$/i.test(url)) { |
| | | if (/pdf$/i.test(url)) { |
| | | val = <><img src="./media/pdf.png" className="file-image" alt=""/> {val}</> |
| | | } else if (/(.doc|.docx)$/i.test(url)) { |
| | |
| | | } |
| | | |
| | | this.setState({ |
| | | data: _data, |
| | | data: this.decodeHtml(_data, _config.wrap), |
| | | BID: BID || '', |
| | | config: _config, |
| | | }) |
| | |
| | | |
| | | let _data = window.GLOB.SyncData.get(config.dataName) || [] |
| | | |
| | | this.setState({data: _data}) |
| | | this.setState({data: this.decodeHtml(_data, config.wrap)}) |
| | | |
| | | window.GLOB.SyncData.delete(config.dataName) |
| | | |
| | |
| | | _data = [_data] |
| | | } |
| | | |
| | | this.setState({data: _data}) |
| | | this.setState({data: this.decodeHtml(_data, config.wrap)}) |
| | | } |
| | | } |
| | | |
| | |
| | | let result = await Api.genericInterface(param) |
| | | if (result.status) { |
| | | this.setState({ |
| | | data: result.data || [], |
| | | data: this.decodeHtml(result.data, config.wrap), |
| | | loading: false |
| | | }) |
| | | |
| | |
| | | |
| | | UtilsDM.queryFail(result) |
| | | } |
| | | } |
| | | |
| | | decodeHtml = (data, wrap) => { |
| | | if (!data || data.length === 0) return [] |
| | | |
| | | data.forEach(item => { |
| | | item.$html = item[wrap.field] || '' |
| | | if (item.$html) { |
| | | if (wrap.encryption === 'true') { |
| | | try { |
| | | item.$html = window.decodeURIComponent(window.atob(item.$html)) |
| | | } catch (e) { |
| | | item.$html = item[wrap.field] || '' |
| | | } |
| | | } |
| | | |
| | | delete item[wrap.field] |
| | | |
| | | if (/\$[\s\S]+\$/.test(item.$html)) { |
| | | Object.keys(item).forEach(key => { |
| | | if (/^\$/.test(key)) return |
| | | let reg = new RegExp('\\$' + key + '\\$', 'ig') |
| | | item.$html = item.$html.replace(reg, item[key]) |
| | | }) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | return data |
| | | } |
| | | |
| | | render() { |
| | |
| | | <NormalHeader config={config}/> |
| | | {config.wrap.datatype === 'static' ? <BraftContent |
| | | value={config.html} |
| | | encryption={'false'} |
| | | /> : data.map((item, index) => <BraftContent |
| | | key={index} |
| | | value={item[config.wrap.field] || ''} |
| | | encryption={config.wrap.encryption} |
| | | value={item.$html} |
| | | script={config.wrap.loaded === 'true' ? config.wrap.loadedfunc : ''} |
| | | />)} |
| | | </div> |
| | | ) |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | |
| | | import './index.scss' |
| | | |
| | | class BraftContent extends Component { |
| | | static propTpyes = { |
| | | value: PropTypes.any, // 内容 |
| | | encryption: PropTypes.any, // 是否解码 |
| | | script: PropTypes.any // 自定义脚本 |
| | | } |
| | | |
| | | state = { |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { encryption, value } = this.props |
| | | let html = value |
| | | const { value } = this.props |
| | | |
| | | if (encryption === 'true' && html) { |
| | | try { |
| | | html = window.decodeURIComponent(window.atob(html)) |
| | | } catch (e) { |
| | | html = value |
| | | } |
| | | this.setState({html: value}) |
| | | } |
| | | |
| | | this.setState({html}) |
| | | componentDidMount() { |
| | | this.loadScript() |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps(nextProps) { |
| | | if (!is(fromJS(this.props), fromJS(nextProps))) { |
| | | const { encryption, value } = nextProps |
| | | let html = value |
| | | if (this.props.value !== nextProps.value) { |
| | | this.setState({html: nextProps.value}, () => { |
| | | this.loadScript() |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (encryption === 'true' && html) { |
| | | loadScript = () => { |
| | | const { script } = this.props |
| | | const { html } = this.state |
| | | |
| | | if (script && html) { |
| | | const that = this |
| | | let _html = '' |
| | | try { |
| | | html = window.decodeURIComponent(window.atob(html)) |
| | | // eslint-disable-next-line |
| | | let func = new Function('that', 'html', script) |
| | | _html = func(that, html) |
| | | } catch (e) { |
| | | html = value |
| | | } |
| | | _html = '' |
| | | console.warn(e) |
| | | } |
| | | |
| | | this.setState({html}) |
| | | if (_html) { |
| | | this.setState({html: _html}) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | background-color: #f0f0f0; |
| | | } |
| | | td, th { |
| | | padding: 5px 14px; |
| | | padding: 5px 10px; |
| | | font-size: 16px; |
| | | border: 1px solid #ddd; |
| | | } |
| | |
| | | this.execError({}) |
| | | }) |
| | | } else if (submit.intertype === 'system') { // 系统存储过程 |
| | | let result = getEditTableSql(submit, data, forms) |
| | | let result = getEditTableSql(submit, data, forms, setting) |
| | | let param = {} |
| | | |
| | | param.func = 'sPC_TableData_InUpDe' |
| | |
| | | this.execError({}) |
| | | }) |
| | | } else if (submit.intertype === 'inner' && submit.innerFunc) { // 自定义存储过程 |
| | | let result = getEditTableSql(submit, data, forms) |
| | | let result = getEditTableSql(submit, data, forms, setting) |
| | | let param = {} |
| | | |
| | | param.func = submit.innerFunc |
| | |
| | | loading: false, // 列表数据加载中 |
| | | visible: false, // 标签页控制 |
| | | shortcuts: null, // 快捷键 |
| | | loadinginter: false |
| | | loadinginter: false, |
| | | noParam: false |
| | | } |
| | | |
| | | stepInter = null |
| | |
| | | */ |
| | | async loadconfig () { |
| | | const { MenuID, MenuName, param } = this.props |
| | | const { noParam } = this.state |
| | | |
| | | let _param = { |
| | | func: 'sPC_Get_LongParam', |
| | |
| | | let skip = config.permission === 'false' || window.GLOB.mkHS |
| | | let urlparam = {} // url参数 |
| | | if (param) { |
| | | if (!noParam) { |
| | | Object.keys(param).forEach(key => { |
| | | if (/^\$/.test(key)) { |
| | | urlparam[key] = param[key] |
| | |
| | | urlparam[key.toLowerCase()] = param[key] |
| | | } |
| | | }) |
| | | } else { |
| | | urlparam.$BID = param.$BID |
| | | } |
| | | } |
| | | |
| | | window.GLOB.CacheData.set(MenuID, urlparam) |
| | |
| | | }) |
| | | } |
| | | |
| | | reloadMenuView = (menuId) => { |
| | | reloadMenuView = (menuId, clear) => { |
| | | const { MenuID } = this.props |
| | | |
| | | if (MenuID !== menuId) return |
| | | |
| | | this.reloadview() |
| | | this.reloadview(clear) |
| | | } |
| | | |
| | | resetActiveMenu = (menuId) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | reloadview = () => { |
| | | reloadview = (clear) => { |
| | | window.GLOB.CacheData.delete(this.props.MenuID) |
| | | |
| | | if (this.state.config) { |
| | |
| | | viewlost: false, // 页面丢失:1、未获取到配置-页面丢失;2、页面未启用 |
| | | config: null, // 页面配置信息,包括组件等 |
| | | loading: false, // 列表数据加载中 |
| | | shortcuts: null |
| | | shortcuts: null, |
| | | noParam: clear === true |
| | | }, () => { |
| | | this.loadconfig() |
| | | }) |
| | |
| | | MKEmitter.emit('closeTabView', MenuID || btn.$MenuID) |
| | | |
| | | if (btn.refreshTab && btn.refreshTab.length > 0) { |
| | | MKEmitter.emit('reloadMenuView', btn.refreshTab[btn.refreshTab.length - 1]) |
| | | MKEmitter.emit('reloadMenuView', btn.refreshTab[btn.refreshTab.length - 1], btn.urlPar === 'true') |
| | | } |
| | | return |
| | | } |
| | |
| | | } |
| | | |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | return |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | } |
| | | |
| | | if (btn.switchTab && btn.switchTab.length > 0) { |
| | |
| | | tabId = btn.refreshTab[btn.refreshTab.length - 1] |
| | | } |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId, 'table') |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | return |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | return |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | } |
| | | |
| | | if (btn.switchTab && btn.switchTab.length > 0) { |
| | |
| | | tabId = btn.refreshTab[btn.refreshTab.length - 1] |
| | | } |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | return |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | let val = form.value |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | } else if (['date', 'datemonth'].includes(form.type)) { |
| | |
| | | let val = form.value |
| | | |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | _initFormfields.push(`@${_key}=${val}`) |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(result) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.customLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.customLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(result) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.customLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.customLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.customLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.customLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.innerLoopRequest(params, btn, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.innerLoopRequest(params, btn, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(result) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.outerLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.outerLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(result) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.outerLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.outerLoopRequest(params, _resolve) |
| | | } |
| | |
| | | if (params.length === 0) { |
| | | this.execSuccess(res) |
| | | _resolve() |
| | | } else if (btn.execInterval) { |
| | | setTimeout(() => { |
| | | this.outerLoopRequest(params, _resolve) |
| | | }, btn.execInterval) |
| | | } else { |
| | | this.outerLoopRequest(params, _resolve) |
| | | } |
| | |
| | | res.message = res.message.replace(/\s*<<.*>>\s*/g, '') |
| | | val = val ? val[0].replace(/<<|>>/g, '') : '' |
| | | |
| | | if (/^http/.test(val)) { |
| | | if (/^(http|\/\/)/.test(val)) { |
| | | let audio = document.createElement('audio') |
| | | audio.src = val |
| | | audio.play() |
| | |
| | | } |
| | | |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | |
| | | if (menu) { |
| | | MKEmitter.emit('modifyTabs', menu, true) |
| | |
| | | } |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | } |
| | | |
| | | if (btn.switchTab && btn.switchTab.length > 0) { |
| | |
| | | res.message = res.message.replace(/\s*<<.*>>\s*/g, '') |
| | | val = val ? val[0].replace(/<<|>>/g, '') : '' |
| | | |
| | | if (/^http/.test(val)) { |
| | | if (/^(http|\/\/)/.test(val)) { |
| | | let audio = document.createElement('audio') |
| | | audio.src = val |
| | | audio.play() |
| | |
| | | tabId = btn.refreshTab[btn.refreshTab.length - 1] |
| | | } |
| | | if (tabId && btn.$MenuID === tabId) { // 刷新当前菜单时,停止其他操作 |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | return |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | if (tabId) { |
| | | MKEmitter.emit('reloadMenuView', tabId) |
| | | MKEmitter.emit('reloadMenuView', tabId, btn.urlPar === 'true') |
| | | } |
| | | } |
| | | |
| | |
| | | let key = item.field.toLowerCase() |
| | | let _readin = item.readin !== 'false' |
| | | |
| | | if (item.type === 'linkMain' && item.verifyVal === 'true') { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | if (_item.type === 'date') { // 时间兼容 |
| | | _item.precision = item.precision || 'day' |
| | | } else if (_item.type === 'datetime') { |
| | |
| | | */ |
| | | getModels = () => { |
| | | const { BID, btn, BData } = this.props |
| | | const { btnconfig, visible, dict, confirmLoading, submitType } = this.state |
| | | const { btnconfig, visible, dict, confirmLoading, submitType, loadingNumber, loadingTotal } = this.state |
| | | |
| | | if (!btnconfig || !btnconfig.setting) return null |
| | | |
| | | let title = btn.label |
| | | let width = btnconfig.setting.width > 100 ? btnconfig.setting.width : btnconfig.setting.width + 'vw' |
| | | let clickouter = btnconfig.setting.clickouter === 'close' |
| | | let num = loadingNumber && !loadingTotal ? `(${loadingNumber}) ` : '' |
| | | |
| | | if (btnconfig.setting.display === 'drawer') { |
| | | let height = '100vh' |
| | |
| | | onCancel={this.handleCancel} |
| | | footer={[ |
| | | <Button key="cancel" onClick={this.handleCancel}>{dict['cancel'] || '取消'}</Button>, |
| | | btn.extBtn === 'true' ? <Button key="extend" className={'extend-btn ' + (btn.extStyle || '')} disabled={confirmLoading && submitType !== btn.extValue} loading={confirmLoading && submitType === btn.extValue} onClick={() => this.handleOk(btn.extValue)}>{btn.extLabel}</Button> : null, |
| | | btn.extBtn === 'true' ? <Button key="confirm" className={'confirm-btn ' + (btn.confStyle || '')} disabled={confirmLoading && submitType !== ''} loading={confirmLoading && submitType === ''} onClick={() => this.handleOk()}>{btn.confLabel || dict['ok'] || '确定'}</Button> : null, |
| | | btn.extBtn !== 'true' ? <Button key="confirm" type="primary" loading={confirmLoading} onClick={() => this.handleOk()}>{dict['ok'] || '确定'}</Button> : null |
| | | btn.extBtn === 'true' ? <Button key="extend" className={'extend-btn ' + (btn.extStyle || '')} disabled={confirmLoading && submitType !== btn.extValue} loading={confirmLoading && submitType === btn.extValue} onClick={() => this.handleOk(btn.extValue)}>{submitType === btn.extValue ? num : ''}{btn.extLabel}</Button> : null, |
| | | btn.extBtn === 'true' ? <Button key="confirm" className={'confirm-btn ' + (btn.confStyle || '')} disabled={confirmLoading && submitType !== ''} loading={confirmLoading && submitType === ''} onClick={() => this.handleOk()}>{submitType === '' ? num : ''}{btn.confLabel || dict['ok'] || '确定'}</Button> : null, |
| | | btn.extBtn !== 'true' ? <Button key="confirm" type="primary" loading={confirmLoading} onClick={() => this.handleOk()}>{num}{dict['ok'] || '确定'}</Button> : null |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | |
| | | |
| | | let val = form.value |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | } else if (['date', 'datemonth'].includes(form.type)) { |
| | |
| | | |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | let val = form.value |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | _initvars.push(`@${_key}=${val}`) |
| | |
| | | let key = item.field.toLowerCase() |
| | | let _readin = item.readin !== 'false' |
| | | |
| | | if (item.type === 'linkMain' && item.verifyVal === 'true') { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | if (_item.type === 'date') { // 时间兼容 |
| | | _item.precision = item.precision || 'day' |
| | | } else if (_item.type === 'datetime') { |
| | |
| | | } else if (item.type === 'linkMain') { |
| | | readin = false |
| | | item.readin = false |
| | | item.$verify = item.verifyVal === 'true' |
| | | } else if (item.type === 'number') { |
| | | item.decimal = item.decimal || 0 |
| | | item.fieldlength = item.decimal |
| | |
| | | isconst: item.constant === 'true' |
| | | } |
| | | |
| | | if (item.$verify) { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | |
| | | _item.value = record[item.field] !== undefined ? record[item.field] : '' |
| | | |
| | | if (item.type === 'funcvar') { |
| | |
| | | }) |
| | | |
| | | let placeholder = '' |
| | | let searchKey = '' |
| | | if (!config.searchKey) { |
| | | config.onload = 'true' |
| | | } else { |
| | |
| | | }) |
| | | |
| | | placeholder = placeholder ? placeholder.join('、') : '' |
| | | |
| | | if (value && !config.showValue) { |
| | | searchKey = value |
| | | config.onload = 'true' |
| | | } |
| | | } |
| | | |
| | | this.state = { |
| | |
| | | showValue: config.showValue, |
| | | placeholder, |
| | | arr_field: arrfield.join(','), |
| | | searchKey: '', |
| | | searchKey: searchKey, |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | orderBy: '', |
| | |
| | | let linkFields = {} |
| | | let record = {} |
| | | let forbid = false // header中不设置高级搜索 |
| | | let _setting = {showAdv: false, show: false, style: null} |
| | | let _setting = {showAdv: false, show: false, style: null, $pageId: config.$pageId || ''} |
| | | let BID = this.props.BID |
| | | let sysvals = {} |
| | | |
| | |
| | | item.initval = [moment(d).startOf('month').format(item.format), moment(d).endOf('month').format(item.format)].join(',') |
| | | } else if (item.$initval === 'lastMonth') { |
| | | item.initval = [moment(d).subtract(1, 'months').startOf('month').format(item.format), moment(d).subtract(1, 'months').endOf('month').format(item.format)].join(',') |
| | | } else if (item.$initval === 'year') { |
| | | item.initval = [moment(d).startOf('year').format(item.format), moment(d).endOf('year').format(item.format)].join(',') |
| | | } else if (item.$initval === 'lastYear') { |
| | | item.initval = [moment(d).subtract(1, 'years').startOf('year').format(item.format), moment(d).subtract(1, 'years').endOf('year').format(item.format)].join(',') |
| | | } else { |
| | | try { |
| | | let _initval = JSON.parse(item.$initval) |
| | |
| | | item.initval = [moment(d).startOf('month').format(item.format), moment(d).endOf('month').format(item.format)].join(',') |
| | | } else if (item.$initval === 'lastMonth') { |
| | | item.initval = [moment(d).subtract(1, 'months').startOf('month').format(item.format), moment(d).subtract(1, 'months').endOf('month').format(item.format)].join(',') |
| | | } else if (item.$initval === 'year') { |
| | | item.initval = [moment(d).startOf('year').format(item.format), moment(d).endOf('year').format(item.format)].join(',') |
| | | } else if (item.$initval === 'lastYear') { |
| | | item.initval = [moment(d).subtract(1, 'years').startOf('year').format(item.format), moment(d).subtract(1, 'years').endOf('year').format(item.format)].join(',') |
| | | } else { |
| | | try { |
| | | let _initval = JSON.parse(item.$initval) |
| | |
| | | handleReset = () => { |
| | | const { setting } = this.state |
| | | |
| | | if (setting.resetContrl === 'refresh') { |
| | | MKEmitter.emit('reloadMenuView', setting.$pageId, true) |
| | | return |
| | | } |
| | | |
| | | let record = {} |
| | | let advanceValues = [] |
| | | let searchlist = this.state.searchlist.map(item => { |
| | |
| | | if (item.type === 'tabs') { |
| | | item.subtabs.forEach(tab => { |
| | | tab.components[0].action.forEach(btn => { |
| | | btn.uuid = Utils.getuuid() |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | | btn.config.$tables = getTables(btn.config.components[0]) |
| | | |
| | | btn.config.components[0].action && btn.config.components[0].action.forEach(cell => { |
| | | cell.uuid = Utils.getuuid() |
| | | }) |
| | | } |
| | | }) |
| | | tab.components[0].cols.forEach(col => { |
| | | if (col.type !== 'custom') return |
| | | col.elements.forEach(btn => { |
| | | if (btn.eleType !== 'button') return |
| | | btn.uuid = Utils.getuuid() |
| | | if (btn.OpenType === 'popview' && btn.config) { |
| | | btn.config.$tables = getTables(btn.config.components[0]) |
| | | |
| | | btn.config.components[0].action && btn.config.components[0].action.forEach(cell => { |
| | | cell.uuid = Utils.getuuid() |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | |
| | | import { useDrop } from 'react-dnd' |
| | | import { is, fromJS } from 'immutable' |
| | | import update from 'immutability-helper' |
| | | import { Col } from 'antd' |
| | | import { Col, message } from 'antd' |
| | | import Utils from '@/utils/utils.js' |
| | | import Card from './card' |
| | | import './index.scss' |
| | |
| | | oInput.style.display = 'none' |
| | | document.body.removeChild(oInput) |
| | | |
| | | if (window.GLOB.CopyOnly) { |
| | | message.success('复制成功。') |
| | | } else { |
| | | const _cards = update(cards, { $splice: [[overIndex + 1, 0, _card]] }) |
| | | |
| | | setCards(_cards) |
| | | |
| | | handleList(_cards, _card) |
| | | } |
| | | } |
| | | |
| | | const [, drop] = useDrop({ |
| | |
| | | newcard.options = [] |
| | | newcard.readonly = 'false' |
| | | newcard.required = 'true' |
| | | newcard.readin = 'top' |
| | | newcard.focus = true |
| | | |
| | | if (item.subType === 'linkMain') { |
| | | newcard.hidden = 'true' |
| | | newcard.verifyVal = 'true' |
| | | } else if (item.subType === 'textarea') { |
| | | newcard.required = 'false' |
| | | } |
| | |
| | | > |
| | | {fields.map(option => |
| | | <Select.Option id={option.uuid} title={option.label} key={option.uuid} value={option.field}> |
| | | {option.label} |
| | | {`${option.label}(${option.field})`} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | > |
| | | {fields.map(option => |
| | | <Select.Option key={option.uuid} value={option.uuid}> |
| | | {option.label} |
| | | {`${option.label}(${option.field})`} |
| | | </Select.Option> |
| | | )} |
| | | </Select> |
| | |
| | | columnChange = (values, callback) => { |
| | | let verify = JSON.parse(JSON.stringify(this.state.verify)) |
| | | |
| | | let fields = verify.columns.map(item => item.Column) |
| | | if (fields.includes(values.Column)) { |
| | | let fields = verify.columns.map(item => item.Column.toLowerCase()) |
| | | if (fields.includes(values.Column.toLowerCase())) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: values.Column + '字段已存在!', |
| | |
| | | inputType: 'input', |
| | | editable: true, |
| | | unique: true, |
| | | strict: true, |
| | | searchable: true, |
| | | copy: true, |
| | | width: '16%' |
| | |
| | | inputType: 'input', |
| | | editable: true, |
| | | searchable: true, |
| | | unique: true, |
| | | width: '16%' |
| | | }, |
| | | { |
| | |
| | | columnChange = (values, callback) => { |
| | | let verify = JSON.parse(JSON.stringify(this.state.verify)) |
| | | |
| | | let fields = verify.columns.map(item => item.Column) |
| | | if (fields.includes(values.Column)) { |
| | | let fields = verify.columns.map(item => item.Column.toLowerCase()) |
| | | if (fields.includes(values.Column.toLowerCase())) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: values.Column + '字段已存在!', |
| | |
| | | decimal: item.decimal, |
| | | orderType: 'asc', |
| | | readonly: 'false', |
| | | required: 'true' |
| | | required: 'true', |
| | | readin: 'top' |
| | | } |
| | | |
| | | if (/^icon|images?$/ig.test(item.field)) { |
| | |
| | | _defaultValue = [moment().startOf('month'), moment().endOf('month')] |
| | | } else if (card.initval === 'lastMonth') { |
| | | _defaultValue = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] |
| | | } else if (card.initval === 'year') { |
| | | _defaultValue = [moment().startOf('year'), moment().endOf('year')] |
| | | } else if (card.initval === 'lastYear') { |
| | | _defaultValue = [moment().subtract(1, 'years').startOf('year'), moment().subtract(1, 'years').endOf('year')] |
| | | } else if (card.initval) { |
| | | try { |
| | | let _initval = JSON.parse(card.initval) |
| | |
| | | import { useDrop } from 'react-dnd' |
| | | import { is, fromJS } from 'immutable' |
| | | import update from 'immutability-helper' |
| | | import { Col, Button, Popover } from 'antd' |
| | | import { Col, Button, Popover, message } from 'antd' |
| | | import { EditOutlined } from '@ant-design/icons' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | document.body.removeChild(oInput) |
| | | } |
| | | |
| | | if (window.GLOB.CopyOnly) { |
| | | message.success('复制成功。') |
| | | } else { |
| | | const { index: overIndex } = findCard(id) |
| | | |
| | | const _cards = update(cards, { $splice: [[overIndex + 1, 0, copycard]] }) |
| | | |
| | | handleList(_cards, copycard) |
| | | } |
| | | } |
| | | |
| | | const [, drop] = useDrop({ |
| | | accept: 'search', |
| | |
| | | }, () => { |
| | | this.handleSearch(item) |
| | | }) |
| | | } else if (type === 'replace') { |
| | | delete item.focus |
| | | this.setState({ |
| | | searchlist: searchlist.map(cell => { |
| | | if (cell.field && cell.field.toLowerCase() === item.field.toLowerCase()) { |
| | | return item |
| | | } |
| | | return cell |
| | | }), |
| | | }, () => { |
| | | this.handleSearch(item) |
| | | }) |
| | | } else if (type === 'multil') { |
| | | let list = [...searchlist, ...item] |
| | | list = list.filter(item => !item.origin) // 去除系统项 |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | {show === 'true' ? <Col span={12}> |
| | | <Form.Item label="重置时"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="刷新菜单会清空URL变量。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 重置时 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('resetContrl', { |
| | | initialValue: setting.resetContrl || 'init', |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="init">恢复初始值</Radio> |
| | | <Radio value="clear">清空</Radio> |
| | | <Radio value="refresh">刷新菜单</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | |
| | | return |
| | | } |
| | | |
| | | let ucol = columns.filter(col => col.unique === true)[0] |
| | | const that = this |
| | | |
| | | if (data.length === 0) { |
| | | if (res.type === 'line') { |
| | | let unique = true |
| | | res.data.uuid = Utils.getuuid() |
| | | columns.forEach(col => { |
| | | if (col.unique !== true || !unique) return |
| | | data.push(res.data) |
| | | } else if (res.type === 'array') { |
| | | res.data.forEach(cell => { |
| | | cell.uuid = Utils.getuuid() |
| | | data.push(cell) |
| | | }) |
| | | } |
| | | this.setState({ data, editingKey: '', editLineId: res.type === 'line' ? res.data.uuid : '' }, () => { |
| | | this.props.onChange(data) |
| | | }) |
| | | } else if (res.type === 'line') { |
| | | let index = -1 |
| | | res.data.uuid = Utils.getuuid() |
| | | |
| | | if (col.uniqueFunc) { |
| | | unique = col.uniqueFunc(data, res.data) |
| | | } else if (col.strict) { |
| | | let key = res.data[col.dataIndex].toLowerCase() |
| | | let _index = data.findIndex(item => key === item[col.dataIndex].toLowerCase()) |
| | | if (ucol) { |
| | | if (ucol.uniqueFunc) { |
| | | let msg = ucol.uniqueFunc(data, res.data) |
| | | |
| | | if (_index > -1) { |
| | | if (msg) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: col.title + '不可重复!', |
| | | message: msg, |
| | | duration: 5 |
| | | }) |
| | | unique = false |
| | | callback() |
| | | return |
| | | } |
| | | } else if (ucol.strict) { |
| | | let key = res.data[ucol.dataIndex].toLowerCase() |
| | | index = data.findIndex(item => key === item[ucol.dataIndex].toLowerCase()) |
| | | } else { |
| | | let _index = data.findIndex(item => res.data[col.dataIndex] === item[col.dataIndex]) |
| | | |
| | | if (_index > -1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: col.title + '不可重复!', |
| | | duration: 5 |
| | | }) |
| | | unique = false |
| | | index = data.findIndex(item => res.data[ucol.dataIndex] === item[ucol.dataIndex]) |
| | | } |
| | | } |
| | | |
| | | if (index > -1) { |
| | | callback() |
| | | data.splice(index, 1, res.data) |
| | | |
| | | confirm({ |
| | | title: `${ucol.title}(${res.data[ucol.dataIndex]})已存在!`, |
| | | okText: '知道了', |
| | | cancelText: '替换', |
| | | onOk() {}, |
| | | onCancel() { |
| | | that.setState({ data, editingKey: '', editLineId: res.data.uuid || '' }, () => { |
| | | that.props.onChange(data) |
| | | }) |
| | | |
| | | if (!unique) return |
| | | |
| | | } |
| | | }) |
| | | return |
| | | } else { |
| | | if (type === 'excelcolumn') { |
| | | data.push(res.data) |
| | | } else { |
| | |
| | | this.setState({ data, editingKey: '', editLineId: res.data.uuid || '' }, () => { |
| | | this.props.onChange(data) |
| | | }) |
| | | } |
| | | } else if (res.type === 'array') { |
| | | let repeats = [] |
| | | let vals = [] |
| | | |
| | | if (ucol) { |
| | | if (ucol.uniqueFunc) { |
| | | |
| | | } else if (ucol.strict) { |
| | | vals = data.map(item => item[ucol.dataIndex].toLowerCase()) |
| | | } else { |
| | | vals = data.map(item => item[ucol.dataIndex]) |
| | | } |
| | | } |
| | | |
| | | res.data.forEach(cell => { |
| | | let unique = true |
| | | cell.uuid = Utils.getuuid() |
| | | columns.forEach(col => { |
| | | if (col.unique !== true || !unique) return |
| | | |
| | | if (col.uniqueFunc) { |
| | | unique = col.uniqueFunc(data, cell) |
| | | } else if (col.strict) { |
| | | let _index = data.findIndex(item => cell[col.dataIndex].toLowerCase() === item[col.dataIndex].toLowerCase()) |
| | | if (ucol) { |
| | | let unique = true |
| | | if (ucol.uniqueFunc) { |
| | | let msg = ucol.uniqueFunc(data, cell) |
| | | |
| | | if (_index > -1) { |
| | | unique = false |
| | | if (msg) return |
| | | } else if (ucol.strict) { |
| | | unique = !vals.includes(cell[ucol.dataIndex].toLowerCase()) |
| | | } else { |
| | | unique = !vals.includes(cell[ucol.dataIndex]) |
| | | } |
| | | |
| | | if (unique) { |
| | | data.push(cell) |
| | | } else { |
| | | repeats.push(cell) |
| | | } |
| | | } else { |
| | | let _index = data.findIndex(item => cell[col.dataIndex] === item[col.dataIndex]) |
| | | |
| | | if (_index > -1) { |
| | | unique = false |
| | | } |
| | | } |
| | | }) |
| | | |
| | | if (!unique) return |
| | | |
| | | data.push(cell) |
| | | } |
| | | }) |
| | | |
| | | if (repeats.length) { |
| | | callback() |
| | | let _data = fromJS(data).toJS().map(cell => { |
| | | let _cell = cell |
| | | repeats.forEach(item => { |
| | | if (ucol.strict) { |
| | | if (cell[ucol.dataIndex].toLowerCase() === item[ucol.dataIndex].toLowerCase()) { |
| | | _cell = item |
| | | } |
| | | } else if (cell[ucol.dataIndex] === item[ucol.dataIndex]) { |
| | | _cell = item |
| | | } |
| | | }) |
| | | |
| | | return _cell |
| | | }) |
| | | |
| | | confirm({ |
| | | content: `存在重复的${ucol.title},请选择处理方式。`, |
| | | okText: '跳过', |
| | | cancelText: '替换', |
| | | onOk() { |
| | | that.setState({ data, editingKey: '', editLineId: '' }, () => { |
| | | that.props.onChange(data) |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.setState({ data: _data, editingKey: '', editLineId: '' }, () => { |
| | | that.props.onChange(data) |
| | | }) |
| | | } |
| | | }) |
| | | return |
| | | } else { |
| | | this.setState({ data, editingKey: '' }, () => { |
| | | this.props.onChange(data) |
| | | }) |
| | | } |
| | | } |
| | | |
| | | callback() |
| | |
| | | return |
| | | } |
| | | |
| | | let unique = true |
| | | columns.forEach(col => { |
| | | if (col.unique !== true || !unique) return |
| | | let ucol = columns.filter(col => col.unique === true)[0] |
| | | if (ucol) { |
| | | let index = -1 |
| | | if (ucol.uniqueFunc) { |
| | | let msg = ucol.uniqueFunc(newData, record) |
| | | |
| | | if (col.uniqueFunc) { |
| | | unique = col.uniqueFunc(newData, record) |
| | | if (msg) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: msg, |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (col.strict) { |
| | | let key = record[col.dataIndex].toLowerCase() |
| | | let _index = newData.findIndex(item => record.uuid !== item.uuid && key === item[col.dataIndex].toLowerCase()) |
| | | |
| | | if (_index > -1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: col.title + '不可重复!', |
| | | duration: 5 |
| | | }) |
| | | unique = false |
| | | } |
| | | } else if (ucol.strict) { |
| | | let key = record[ucol.dataIndex].toLowerCase() |
| | | index = newData.findIndex(item => record.uuid !== item.uuid && key === item[ucol.dataIndex].toLowerCase()) |
| | | } else { |
| | | let _index = newData.findIndex(item => record.uuid !== item.uuid && record[col.dataIndex] === item[col.dataIndex]) |
| | | index = newData.findIndex(item => record.uuid !== item.uuid && record[ucol.dataIndex] === item[ucol.dataIndex]) |
| | | } |
| | | |
| | | if (_index > -1) { |
| | | if (index > -1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: col.title + '不可重复!', |
| | | message: ucol.title + '不可重复!', |
| | | duration: 5 |
| | | }) |
| | | unique = false |
| | | return |
| | | } |
| | | } |
| | | }) |
| | | |
| | | if (!unique) return |
| | | |
| | | newData.splice(index, 1, record) |
| | | this.setState({ data: newData, editingKey: '' }, () => { |
| | |
| | | return |
| | | } |
| | | |
| | | let unique = true |
| | | columns.forEach(col => { |
| | | if (col.unique !== true || !unique) return |
| | | let ucol = columns.filter(col => col.unique === true)[0] |
| | | if (ucol) { |
| | | let _index = -1 |
| | | if (ucol.uniqueFunc) { |
| | | let msg = ucol.uniqueFunc(newData, row) |
| | | |
| | | if (col.uniqueFunc) { |
| | | unique = col.uniqueFunc(newData, row) |
| | | if (msg) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: msg, |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (col.strict) { |
| | | let key = row[col.dataIndex].toLowerCase() |
| | | let _index = newData.findIndex(item => row.uuid !== item.uuid && key === item[col.dataIndex].toLowerCase()) |
| | | |
| | | if (_index > -1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: col.title + '不可重复!', |
| | | duration: 5 |
| | | }) |
| | | unique = false |
| | | } |
| | | } else if (ucol.strict) { |
| | | let key = row[ucol.dataIndex].toLowerCase() |
| | | _index = newData.findIndex(item => row.uuid !== item.uuid && key === item[ucol.dataIndex].toLowerCase()) |
| | | } else { |
| | | let _index = newData.findIndex(item => row.uuid !== item.uuid && row[col.dataIndex] === item[col.dataIndex]) |
| | | _index = newData.findIndex(item => row.uuid !== item.uuid && row[ucol.dataIndex] === item[ucol.dataIndex]) |
| | | } |
| | | |
| | | if (_index > -1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: col.title + '不可重复!', |
| | | message: ucol.title + '不可重复!', |
| | | duration: 5 |
| | | }) |
| | | unique = false |
| | | return |
| | | } |
| | | } |
| | | }) |
| | | |
| | | if (!unique) return |
| | | |
| | | if (index > -1) { |
| | | newData.splice(index, 1, row) |
| | |
| | | ...moveprops |
| | | })} |
| | | /> |
| | | {actions.includes('copy') && data.length > 10 ? <span className="footer-copy-control"> |
| | | <CopyOutlined title="复制" onClick={() => this.copy()} /> |
| | | <PasteBoard getPasteValue={this.pasteSubmit}/> |
| | | </span> : null} |
| | | </DndProvider> |
| | | </div> |
| | | </EditableContext.Provider> |
| | |
| | | font-size: 18px; |
| | | color: #26C281; |
| | | } |
| | | .footer-copy-control { |
| | | text-align: right; |
| | | margin: 10px; |
| | | display: block; |
| | | .anticon-copy { |
| | | margin-right: 15px; |
| | | color: #26C281; |
| | | } |
| | | .anticon-snippets { |
| | | color: purple; |
| | | } |
| | | } |
| | | .ant-typography-copy:not(.ant-typography-copy-success) { |
| | | opacity: 0; |
| | | transition: opacity 0.2s; |
| | | } |
| | | |
| | | tr:hover { |
| | | .ant-typography-copy:not(.ant-typography-copy-success) { |
| | | opacity: 0.7; |
| | | } |
| | | .ant-typography-copy:hover { |
| | | opacity: 1; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .ant-modal.ant-modal-confirm.ant-modal-confirm-info.sql-example { |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'verifyVal', |
| | | label: '空值验证', |
| | | tooltip: '按钮提交时验证字段值是否为空(或数值为0)。', |
| | | initVal: card.verifyVal || 'false', |
| | | options: [{ |
| | | value: 'true', |
| | | text: '开启' |
| | | }, { |
| | | value: 'false', |
| | | text: '关闭' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'format', |
| | | label: '格式化', |
| | | tooltip: '使用千分位时,数值将以千分位格式显示,提交时为原数值。', |
| | |
| | | formula: ['label', 'type', 'marginTop', 'marginBottom', 'splitline', 'supField', 'span', 'labelwidth', 'formula', 'eval', 'postfix'], |
| | | brafteditor: ['required', 'hidelabel', 'hidden', 'readin', 'fieldlength', 'readonly', 'span', 'labelwidth', 'tooltip', 'extra', 'encryption', 'marginTop', 'marginBottom', 'contHeidht'], |
| | | funcvar: ['span', 'labelwidth', 'splitline', 'marginTop', 'marginBottom'], |
| | | linkMain: ['readonly', 'required', 'hidden','declare', 'span', 'labelwidth', 'tooltip', 'interception', 'extra', 'place', 'marginTop', 'marginBottom'], |
| | | linkMain: ['readonly', 'required', 'hidden','declare', 'span', 'labelwidth', 'tooltip', 'interception', 'extra', 'place', 'marginTop', 'marginBottom', 'verifyVal'], |
| | | popSelect: ['initval', 'readonly', 'required', 'hidden', 'readin', 'linkSubField', 'span', 'labelwidth', 'tooltip', 'extra', 'place', 'enter', 'dataSource', 'columns', 'primaryKey', 'order', 'controlField', 'laypage', 'onload', 'searchKey', 'showField', 'popWidth'], |
| | | vercode: ['label', 'field', 'type', 'blacklist', 'supField', 'readonly', 'required', 'hidden', 'span', 'labelwidth', 'tooltip', 'marginTop', 'marginBottom', 'placeholder', 'enter', 'smsId', 'phoneField', 'sendType'] |
| | | } |
| | |
| | | |
| | | if (value === 'linkMain') { |
| | | this.record.hidden = 'true' |
| | | this.record.verifyVal = 'true' |
| | | _fieldval.hidden = 'true' |
| | | _fieldval.verifyVal = 'true' |
| | | } |
| | | |
| | | if (this.record.type === 'cascader' && value !== 'cascader') { |
| | |
| | | _f.writein = _f.writein !== 'false' |
| | | _f.fieldlen = _f.fieldlength || 50 |
| | | |
| | | if (_f.type === 'linkMain' && _f.verifyVal === 'true') { |
| | | _f.$verify = true |
| | | } |
| | | |
| | | if (_f.type === 'datemonth') { |
| | | _f.type = 'text' |
| | | } else if (_f.type === 'number' || _f.type === 'rate') { |
| | |
| | | colfields: colfields.join(', '), |
| | | uniqueColumns: this.state.uniqueColumns.map(col => { |
| | | if (col.dataIndex === 'field') { |
| | | col.options = unionFields |
| | | col.options = fromJS(unionFields).toJS().map(n => { |
| | | n.label = `${n.label}(${n.field})` |
| | | return n |
| | | }) |
| | | } |
| | | return col |
| | | }), |
| | | onceUniqueColumns: this.state.onceUniqueColumns.map(col => { |
| | | if (col.dataIndex === 'field') { |
| | | col.options = _columns |
| | | col.options = fromJS(_columns).toJS().map(n => { |
| | | n.label = `${n.label}(${n.field})` |
| | | return n |
| | | }) |
| | | } |
| | | return col |
| | | }), |
| | |
| | | |
| | | formdata = formdata.length ? formdata : null |
| | | |
| | | let verifyValSql = '' |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | | if (form.$verify) { |
| | | verifyValSql += ` |
| | | if @${form.field}=${form.type === 'number' ? 0 : `''`} |
| | | begin |
| | | select @errorcode='E',@retmsg='${form.label},关联主表失效' |
| | | goto aaa |
| | | end |
| | | ` |
| | | } |
| | | |
| | | let _key = form.field.toLowerCase() |
| | | if (!_initvars.includes(_key)) { |
| | | _initvars.push(_key) |
| | |
| | | |
| | | verify.billcodes.forEach(item => { |
| | | let _key = item.field.toLowerCase() |
| | | let _linkKey = item.linkField ? item.linkField.toLowerCase() : '' |
| | | |
| | | if (!keys.includes(_key)) return // 表单中不含单号生成字段 |
| | | |
| | | let _lpline = '' |
| | | if (item.TypeCharOne === 'Lp') { |
| | | if (_linkKey === 'bid' && BID) { // 替换bid |
| | | if (/^BID$/ig.test(item.linkField)) { |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@BID@,48)` |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${_linkKey},48)` |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${item.linkField},48)` |
| | | } |
| | | } else if (item.TypeCharOne === 'BN') { |
| | | if (_linkKey === 'bid' && BID) { // 替换bid |
| | | if (/^BID$/ig.test(item.linkField)) { |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@BID@,48)` |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@${_linkKey},48)` |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@${item.linkField},48)` |
| | | } |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= right('${item.ModularDetailCode}',50)` |
| | |
| | | let hasvoucher = false |
| | | |
| | | // 凭证-显示列中选取,必须选行 |
| | | if (verify.voucher && verify.voucher.enabled && btn.Ot !== 'requiredOnce') { |
| | | if (verify.voucher && verify.voucher.enabled) { |
| | | let _voucher = verify.voucher |
| | | let linkField = `@${_voucher.linkField}` |
| | | |
| | | if (/^BID$/ig.test(_voucher.linkField)) { |
| | | linkField = `'${BID}'` |
| | | } |
| | | |
| | | hasvoucher = true |
| | | |
| | | _sql += ` |
| | | /* 创建凭证 */ |
| | | exec s_BVoucher_Create |
| | | @Bill = @${_voucher.linkField}, |
| | | @Bill = ${linkField}, |
| | | @BVoucherType ='${_voucher.BVoucherType}', |
| | | @VoucherTypeOne ='${_voucher.VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', |
| | |
| | | _sql += _backCustomScript |
| | | } |
| | | |
| | | if (verifyValSql) { |
| | | _sql += verifyValSql |
| | | } |
| | | |
| | | if (btn.procMode === 'system') { |
| | | _sql += ` |
| | | aaa: if @ErrorCode!='' |
| | |
| | | let hasvoucher = false |
| | | |
| | | // 凭证-显示列中选取,必须选行 |
| | | if (verify.voucher && verify.voucher.enabled && btn.Ot !== 'requiredOnce') { |
| | | if (verify.voucher && verify.voucher.enabled) { |
| | | hasvoucher = true |
| | | } |
| | | if (hasvoucher) { |
| | |
| | | _lpline = `set @ModularDetailCode= right('${record.ModularDetailCode}',50)` |
| | | } |
| | | |
| | | let sql = `select @BillCode='', @${record.field}='', @ModularDetailCode='' |
| | | let sql = `Declare @BillCode nvarchar(50),@ModularDetailCode nvarchar(50) |
| | | select @BillCode='', @${record.field}='', @ModularDetailCode='' |
| | | ${_lpline} |
| | | exec s_get_BillCode |
| | | @ModularDetailCode=@ModularDetailCode, |
| | |
| | | <EditTable actions={['edit', 'move', 'del', 'status', 'sql']} data={verify.uniques} columns={card.Ot !== 'requiredOnce' ? uniqueColumns : onceUniqueColumns} onChange={this.changeUniques}/> |
| | | </TabPane> : null} |
| | | {verifyInter === 'system' ? <TabPane tab={ |
| | | <span title={card.Ot === 'requiredOnce' ? '多行拼接时不可用' : ''}> |
| | | <span> |
| | | 创建凭证 |
| | | {verify.voucher && verify.voucher.enabled ? <span className="count-tip">1</span> : null} |
| | | </span> |
| | | } key="voucher" disabled={card.Ot === 'requiredOnce'}> |
| | | } key="voucher"> |
| | | <VoucherForm |
| | | voucher={voucher} |
| | | columns={columns} |
| | | columns={unionFields} |
| | | voucherobj={verify.voucher} |
| | | voucherDetail={voucherDetail} |
| | | voucherChange={this.voucherChange} |
| | |
| | | {value: 'week', text: '本周'}, |
| | | {value: 'month', text: '本月'}, |
| | | {value: 'lastMonth', text: '上月'}, |
| | | {value: 'year', text: '本年'}, |
| | | {value: 'lastYear', text: '上年'}, |
| | | ], |
| | | datetime: [ |
| | | {value: '', text: '空'}, |
| | |
| | | if (cell.OpenType === 'form' && cell.formType === 'count_line') return |
| | | |
| | | if (cell.intertype === 'system') { |
| | | if (cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`}) |
| | | } |
| | | // if (cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) { |
| | | // errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`}) |
| | | // } |
| | | } else if (cell.intertype === 'custom' || cell.intertype === 'outer') { |
| | | if (cell.callbackType === 'script' && (!cell.verify || !cell.verify.cbScripts || cell.verify.cbScripts.filter(item => item.status !== 'false').length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”使用了自定义脚本回调,回调脚本不可为空!`}) |
| | | } else if (cell.procMode === 'system' && cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`}) |
| | | // } else if (cell.procMode === 'system' && cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) { |
| | | // errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`}) |
| | | } |
| | | } |
| | | } else if (cell.OpenType === 'funcbutton') { |
| | |
| | | isconst: item.constant === 'true' |
| | | } |
| | | |
| | | if (item.type === 'linkMain' && item.verifyVal === 'true') { |
| | | _item.$verify = true |
| | | _item.label = item.label |
| | | } |
| | | |
| | | if (_item.type === 'datemonth') { |
| | | _item.type = 'text' |
| | | } else if (_item.type === 'number' || _item.type === 'rate') { |
| | |
| | | formdata.push(item) |
| | | } |
| | | |
| | | let verifyValSql = '' |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | | if (form.$verify) { |
| | | verifyValSql += ` |
| | | if @${form.key}=${form.type === 'number' ? 0 : `''`} |
| | | begin |
| | | select @errorcode='E',@retmsg='${form.label},关联主表失效' |
| | | goto aaa |
| | | end |
| | | ` |
| | | } |
| | | |
| | | let _key = form.key.toLowerCase() |
| | | |
| | | if (!formkeys.includes(_key)) { |
| | |
| | | if (formdata && verify.billcodes && verify.billcodes.length > 0) { |
| | | verify.billcodes.forEach(item => { |
| | | let _key = item.field.toLowerCase() |
| | | let _linkKey = item.linkField ? item.linkField.toLowerCase() : '' |
| | | |
| | | if (!formkeys.includes(_key)) return // 表单中不含单号生成字段 |
| | | |
| | | let _lpline = '' |
| | | if (item.TypeCharOne === 'Lp') { |
| | | if (_linkKey === 'bid' && BID) { // 替换bid |
| | | if (/^BID$/ig.test(item.linkField)) { |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@BID@,48)` |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${_linkKey},48)` |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${item.linkField},48)` |
| | | } |
| | | } else if (item.TypeCharOne === 'BN') { |
| | | if (_linkKey === 'bid' && BID) { // 替换bid |
| | | if (/^BID$/ig.test(item.linkField)) { |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@BID@,48)` |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@${_linkKey},48)` |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@${item.linkField},48)` |
| | | } |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= right('${item.ModularDetailCode}',50)` |
| | |
| | | let hasvoucher = false |
| | | |
| | | // 凭证-显示列中选取,必须选行 |
| | | if (verify.voucher && verify.voucher.enabled && btn.Ot !== 'requiredOnce') { |
| | | if (verify.voucher && verify.voucher.enabled) { |
| | | let _voucher = verify.voucher |
| | | let linkField = `@${_voucher.linkField}` |
| | | |
| | | if (/^BID$/ig.test(_voucher.linkField)) { |
| | | linkField = BID |
| | | } |
| | | |
| | | hasvoucher = true |
| | | |
| | | _sql += ` |
| | | /* 创建凭证 */ |
| | | exec s_BVoucher_Create |
| | | @Bill = @${_voucher.linkField}, |
| | | @Bill = ${linkField}, |
| | | @BVoucherType ='${_voucher.BVoucherType}', |
| | | @VoucherTypeOne ='${_voucher.VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', |
| | |
| | | } |
| | | } else if (_backCustomScript) { |
| | | _sql += _backCustomScript |
| | | } |
| | | |
| | | if (verifyValSql) { |
| | | _sql += verifyValSql |
| | | } |
| | | |
| | | if (verify.workFlow === 'true' && process) { |
| | |
| | | let _fields = unique.field.split(',') |
| | | let _fields_ = _fields.map(_field => `a.${_field}=b.${_field}`) |
| | | _fields_ = _fields_.join(' and ') |
| | | _fields_ += ` and a.jskey != b.${setting.primaryKey || 'id'}` |
| | | |
| | | let _where = [] |
| | | _fields.forEach(f => { |
| | |
| | | |
| | | let declarefields = [] |
| | | let fields = [] |
| | | let upFields = [] |
| | | |
| | | forms.forEach(col => { |
| | | let key = col.field.toLowerCase() |
| | |
| | | |
| | | declarefields.push(`${col.field} ${col.datatype}`) |
| | | fields.push(col.field) |
| | | upFields.push(`${col.field}=t.${col.field}`) |
| | | }) |
| | | |
| | | fields = fields.join(',') |
| | | upFields = upFields.join(',') |
| | | |
| | | let _insert = '' |
| | | if (btn.default !== 'false') { |
| | | _insert = ` |
| | | /* 默认sql */ |
| | | update a set ${upFields},modifydate=getdate(),modifyuserid=@UserID@,modifyuser=@username,modifystaff=@fullname,deleted=0 |
| | | from (select * from #${sheet} where data_type='upt') t |
| | | inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | update a set deleted=1,modifydate=getdate(),modifyuserid=@UserID@,modifyuser=@username,modifystaff=@fullname |
| | | from (select * from #${sheet} where data_type='del') t |
| | | inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | delete t from #${sheet} t inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | Insert into ${database}${sheet} (${fields},createuserid,createuser,createstaff,bid) |
| | | Select ${fields},@UserID@,@username,@fullname,@BID@ From #${sheet} |
| | | ` |
| | |
| | | } |
| | | |
| | | if (d) { |
| | | item.initval = moment(d).subtract(item.initval, 'month').format('YYYY-MM') |
| | | item.initval = moment(d).subtract(item.$initval, 'month').format('YYYY-MM') |
| | | } |
| | | } |
| | | } |
| | |
| | | item.initval = [moment().startOf('month').format(format), moment().endOf('month').format(format)].join(',') |
| | | } else if (item.initval === 'lastMonth') { |
| | | item.initval = [moment().subtract(1, 'months').startOf('month').format(format), moment().subtract(1, 'months').endOf('month').format(format)].join(',') |
| | | } else if (item.initval === 'year') { |
| | | item.initval = [moment().startOf('year').format(format), moment().endOf('year').format(format)].join(',') |
| | | } else if (item.initval === 'lastYear') { |
| | | item.initval = [moment().subtract(1, 'years').startOf('year').format(format), moment().subtract(1, 'years').endOf('year').format(format)].join(',') |
| | | } else if (item.initval) { |
| | | try { |
| | | let _initval = JSON.parse(item.initval) |
| | |
| | | item.initval = [moment(d).startOf('month').format(format), moment(d).endOf('month').format(format)].join(',') |
| | | } else if (item.$initval === 'lastMonth') { |
| | | item.initval = [moment(d).subtract(1, 'months').startOf('month').format(format), moment(d).subtract(1, 'months').endOf('month').format(format)].join(',') |
| | | } else if (item.$initval === 'year') { |
| | | item.initval = [moment(d).startOf('year').format(format), moment(d).endOf('year').format(format)].join(',') |
| | | } else if (item.$initval === 'lastYear') { |
| | | item.initval = [moment(d).subtract(1, 'years').startOf('year').format(format), moment(d).subtract(1, 'years').endOf('year').format(format)].join(',') |
| | | } else { |
| | | try { |
| | | let _initval = JSON.parse(item.$initval) |
| | |
| | | * @return {Object} item 按钮信息 |
| | | * @return {Array} data excel数据 |
| | | */ |
| | | export function getEditTableSql (verify, data, columns) { |
| | | export function getEditTableSql (verify, data, columns, setting) { |
| | | let btn = verify |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | |
| | | let _fields = unique.field.split(',') |
| | | let _fields_ = _fields.map(_field => `a.${_field}=b.${_field}`) |
| | | _fields_ = _fields_.join(' and ') |
| | | _fields_ += ` and a.jskey != b.${setting.primaryKey || 'id'}` |
| | | |
| | | let _where = [] |
| | | _fields.forEach(f => { |
| | |
| | | |
| | | let declarefields = [] |
| | | let fields = [] |
| | | let upFields = [] |
| | | |
| | | columns.forEach(col => { |
| | | let key = col.field.toLowerCase() |
| | |
| | | |
| | | declarefields.push(`${col.field} ${col.datatype}`) |
| | | fields.push(col.field) |
| | | upFields.push(`${col.field}=t.${col.field}`) |
| | | }) |
| | | |
| | | fields = fields.join(',') |
| | | upFields = upFields.join(',') |
| | | |
| | | let _insert = '' |
| | | if (btn.default !== 'false') { |
| | | _insert = ` |
| | | /* 默认sql */ |
| | | update a set ${upFields},modifydate=getdate(),modifyuserid='${sessionStorage.getItem('UserID') || ''}',modifyuser=@username,modifystaff=@fullname,deleted=0 |
| | | from (select * from #${sheet} where data_type='upt') t |
| | | inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | update a set deleted=1,modifydate=getdate(),modifyuserid='${sessionStorage.getItem('UserID') || ''}',modifyuser=@username,modifystaff=@fullname |
| | | from (select * from #${sheet} where data_type='del') t |
| | | inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | delete t from #${sheet} t inner join ${database}${sheet} a on t.jskey=a.${setting.primaryKey || 'id'} |
| | | |
| | | Insert into ${database}${sheet} (${fields},createuserid,createuser,createstaff,bid) |
| | | Select ${fields},'${sessionStorage.getItem('UserID') || ''}',@username,@fullname,'${BID}' From #${sheet} |
| | | ` |
| | |
| | | let _initFormfields = [] |
| | | let _initColfields = [] |
| | | let _declarefields = [] |
| | | let verifyValSql = '' |
| | | |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | | if (form.$verify) { |
| | | verifyValSql += ` |
| | | if @${form.key}=${form.type === 'number' ? 0 : `''`} |
| | | begin |
| | | select @errorcode='E',@retmsg='${form.label},关联主表失效' |
| | | goto aaa |
| | | end |
| | | ` |
| | | } |
| | | |
| | | let _key = form.key.toLowerCase() |
| | | |
| | | if (!_initvars.includes(_key)) { |
| | |
| | | let val = form.value |
| | | |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | if (isNaN(val)) { |
| | | if (isNaN(val) || val === '') { |
| | | val = 0 |
| | | } |
| | | _initFormfields.push(`@${_key}=${val}`) |
| | |
| | | |
| | | verify.billcodes.forEach(item => { |
| | | let _key = item.field.toLowerCase() |
| | | let _linkKey = item.linkField ? item.linkField.toLowerCase() : '' |
| | | |
| | | if (!keys.includes(_key)) return // 表单中不含单号生成字段 |
| | | |
| | | let _lpline = '' |
| | | if (item.TypeCharOne === 'Lp') { |
| | | if (_linkKey === 'bid' && BID) { // 替换bid |
| | | if (/^BID$/ig.test(item.linkField)) { |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@BID@,48)` |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${_linkKey},48)` |
| | | _lpline = `set @ModularDetailCode= 'Lp'+ right('${item.mark || btn.uuid}'+@${item.linkField},48)` |
| | | } |
| | | } else if (item.TypeCharOne === 'BN') { |
| | | if (_linkKey === 'bid' && BID) { // 替换bid |
| | | if (/^BID$/ig.test(item.linkField)) { |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@BID@,48)` |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@${_linkKey},48)` |
| | | _lpline = `set @ModularDetailCode= 'BN'+ right(@${item.linkField},48)` |
| | | } |
| | | } else { |
| | | _lpline = `set @ModularDetailCode= right('${item.ModularDetailCode}',50)` |
| | |
| | | // 凭证-显示列中选取,必须选行 |
| | | if (verify.voucher && verify.voucher.enabled) { |
| | | let _voucher = verify.voucher |
| | | let linkField = `@${_voucher.linkField}` |
| | | |
| | | if (/^BID$/ig.test(_voucher.linkField)) { |
| | | linkField = `'${BID}'` |
| | | } |
| | | |
| | | hasvoucher = true |
| | | |
| | | _sql += ` |
| | | /* 创建凭证 */ |
| | | exec s_BVoucher_Create |
| | | @Bill = @${_voucher.linkField}, |
| | | @Bill = ${linkField}, |
| | | @BVoucherType ='${_voucher.BVoucherType}', |
| | | @VoucherTypeOne ='${_voucher.VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', |
| | |
| | | _sql += _backCustomScript |
| | | } |
| | | |
| | | if (verifyValSql) { |
| | | _sql += verifyValSql |
| | | } |
| | | |
| | | if (window.GLOB.breakpoint) { |
| | | let start = new RegExp('\\/\\*\\$breakpoint_begin_' + window.GLOB.breakpoint + '@', 'ig') |
| | | let end = new RegExp('@breakpoint_end_' + window.GLOB.breakpoint + '\\$\\*\\/', 'ig') |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography, Spin, message } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined } from '@ant-design/icons' |
| | | import { notification, Modal, Collapse, Switch, Button, Typography, Spin, message, Dropdown } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined, CopyOutlined, DownOutlined } from '@ant-design/icons' |
| | | import html2canvas from 'html2canvas' |
| | | import md5 from 'md5' |
| | | |
| | |
| | | const PasteController = asyncComponent(() => import('@/menu/pastecontroller')) |
| | | const StyleController = asyncComponent(() => import('@/menu/stylecontroller')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const LowerField = asyncComponent(() => import('@/menu/lowerField')) |
| | | const Debug = asyncComponent(() => import('@/menu/debug')) |
| | | const NormalCss = asyncComponent(() => import('@/menu/normalCss')) |
| | | const NormalCopy = asyncComponent(() => import('@/menu/normalCopy')) |
| | | const Versions = asyncComponent(() => import('@/menu/versions')) |
| | | const TableNodes = asyncComponent(() => import('@/menu/tablenodes')) |
| | | const SysInterface = asyncComponent(() => import('@/menu/sysinterface')) |
| | |
| | | /> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 37px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '15px 0px 0px 32px'}} copyable={{ text: MenuId }}>菜单ID:</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 18px'}}>菜单组件:<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | <NormalCopy /> |
| | | </> : null} |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | |
| | | </Collapse> |
| | | </div> |
| | | <div className={'menu-view' + (menuloading ? ' saving' : '') + (eyeopen ? ' eye-open' : '')}> |
| | | <Card bordered={false} extra={ |
| | | <div className="mk-opeartion-list"> |
| | | {config ? <Debug config={config}/> : null} |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | {config ? <Versions MenuId={MenuId} Template="CustomPage" checklog={this.checklog} updateConfig={this.updateLogConfig}/> : null} |
| | | <TableNodes config={config} /> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | | <PictureController/> |
| | | <StyleCombControlButton menu={config} /> |
| | | <PasteController vType="admin" insert={this.insert} /> |
| | | {config ? <Dropdown placement="bottomCenter" overlay={<div className="mk-opeartion-dropdown-wrap"> |
| | | <ReplaceField config={config} updateConfig={this.resetConfig}/> |
| | | <LowerField config={config} updateConfig={this.resetConfig}/> |
| | | <PictureController/> |
| | | </div>} trigger={['hover']}> |
| | | <div className="mk-button-more">更多<DownOutlined/></div> |
| | | </Dropdown> : null} |
| | | {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | | <Button type="primary" id="save-config" disabled={!config} className={needUpdate ? 'update-tip' : ''} onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Button type="default" disabled={menuloading} onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | {config && !comloading ? <MenuShell menu={config} handleList={this.updateConfig} /> : <Spin className="loading-config" size="large" />} |
| | | </Card> |
| | | </div> |
| | | </div> |
| | | </div> : <PopView btn={this.state.popConfig} save={this.submitPopConfig} cancel={this.closePop}/>} |
| | |
| | | overflow-y: auto; |
| | | transition: all 0.3s; |
| | | |
| | | > .ant-card { |
| | | >.ant-card-head { |
| | | margin-bottom: 0px; |
| | | .mk-opeartion-list { |
| | | position: sticky; |
| | | top: 0px; |
| | | z-index: 10; |
| | | left: 0px; |
| | | right: 0px; |
| | | text-align: right; |
| | | padding: 5px 10px 8px; |
| | | background: #ffffff; |
| | | .ant-card-head-title { |
| | | color: #1890ff; |
| | | padding: 5px 0; |
| | | } |
| | | .ant-card-extra { |
| | | padding: 5px 0; |
| | | border-bottom: 1px solid #e8e8e8; |
| | | height: 45px; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | z-index: 10; |
| | | |
| | | button { |
| | | margin-left: 10px; |
| | | margin-left: 15px; |
| | | } |
| | | .mk-opeartion-list button:not(.ant-switch):not(:last-child):not(:nth-last-child(2)) { |
| | | button:not(.ant-switch):not(:last-child):not(:nth-last-child(2)) { |
| | | padding: 0px 10px; |
| | | } |
| | | .mk-button-more { |
| | | display: inline-block; |
| | | height: 32px; |
| | | border: 1px solid #26C281; |
| | | color: #26C281; |
| | | line-height: 32px; |
| | | padding: 0 10px 0px 20px; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | vertical-align: top; |
| | | margin-left: 10px; |
| | | .anticon-down { |
| | | margin-left: 3px; |
| | | } |
| | | } |
| | | .ant-switch.big { |
| | | min-width: 60px; |
| | |
| | | .ant-switch.big:after { |
| | | width: 24px; |
| | | height: 24px; |
| | | } |
| | | } |
| | | } |
| | | >.ant-card-body { |
| | | padding: 0px; |
| | | } |
| | | } |
| | | } |
| | |
| | | .ant-table-thead > tr > th { |
| | | background: transparent!important; |
| | | border-radius: 0!important; |
| | | } |
| | | } |
| | | |
| | | @media screen and (max-width: 1500px) { |
| | | .mk-opeartion-list .ant-btn { |
| | | min-width: 65px; |
| | | .anticon { |
| | | display: none; |
| | | } |
| | | .anticon + span { |
| | | margin-left: 0px; |
| | | } |
| | | } |
| | | } |
| | |
| | | import React, { Component } from 'react' |
| | | import { is, fromJS } from 'immutable' |
| | | import PropTypes from 'prop-types' |
| | | import { notification, Modal, Collapse, Card, Switch, Button } from 'antd' |
| | | import { notification, Modal, Collapse, Switch, Button } from 'antd' |
| | | import { EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | const SourceWrap = asyncComponent(() => import('@/menu/modulesource')) |
| | | const Modulecell = asyncComponent(() => import('@/menu/modulecell')) |
| | | const MenuShell = asyncComponent(() => import('@/menu/menushell')) |
| | | const NormalCopy = asyncComponent(() => import('@/menu/normalCopy')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const BgController = asyncComponent(() => import('@/pc/bgcontroller')) |
| | | const PasteController = asyncComponent(() => import('@/menu/pastecontroller')) |
| | |
| | | <Panel header="基本信息" key="basedata"> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updatetable}/> |
| | | <NormalCopy /> |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | | <Panel header="组件" key="component"> |
| | |
| | | </Collapse> |
| | | </div> |
| | | <div className={'menu-view' + (menuloading ? ' saving' : '') + (eyeopen ? ' eye-open' : '')}> |
| | | <Card title={ |
| | | <div> {config.MenuName} </div> |
| | | } bordered={false} extra={ |
| | | <div> |
| | | <div className="mk-opeartion-list"> |
| | | <div className="btn-name">{config.MenuName}</div> |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <ReplaceField config={config} updateConfig={this.resetConfig}/> |
| | | <StyleCombControlButton menu={config} /> |
| | | <PasteController insert={this.insert} /> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" id="save-pop-config" onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Button type="default" disabled={menuloading} onClick={this.closeView}>返回</Button> |
| | | </div> |
| | | } style={{ width: '100%' }}> |
| | | {!comloading ? <MenuShell menu={config} handleList={this.updateConfig} /> : null} |
| | | </Card> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | width: 300px; |
| | | background: #ffffff; |
| | | box-shadow: 0px 2px 5px #bcbcbc; |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | |
| | | > .ant-collapse { |
| | | height: 100%; |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | background-color: #ffffff; |
| | | border-radius: 0px; |
| | | padding-bottom: 30px; |
| | | |
| | | .ant-collapse-item.ant-collapse-item-active { |
| | | border-bottom: 1px solid #d9d9d9; |
| | | } |
| | |
| | | } |
| | | } |
| | | } |
| | | .menu-setting::-webkit-scrollbar { |
| | | .menu-setting >.ant-collapse::-webkit-scrollbar { |
| | | width: 4px; |
| | | } |
| | | .menu-setting::-webkit-scrollbar-thumb { |
| | | .menu-setting >.ant-collapse::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.08); |
| | | background: rgba(0, 0, 0, 0.08); |
| | | } |
| | | .menu-setting::-webkit-scrollbar-track { |
| | | .menu-setting >.ant-collapse::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | |
| | | height: calc(100vh - 50px); |
| | | overflow-y: auto; |
| | | |
| | | > .ant-card { |
| | | >.ant-card-head { |
| | | margin-bottom: 0px; |
| | | .mk-opeartion-list { |
| | | position: sticky; |
| | | top: 0px; |
| | | z-index: 10; |
| | | left: 0px; |
| | | right: 0px; |
| | | text-align: right; |
| | | padding: 5px 10px 8px; |
| | | background: #ffffff; |
| | | .ant-card-head-title { |
| | | border-bottom: 1px solid #e8e8e8; |
| | | height: 45px; |
| | | z-index: 10; |
| | | |
| | | .btn-name { |
| | | float: left; |
| | | color: #1890ff; |
| | | padding: 5px 0; |
| | | font-size: 16px; |
| | | } |
| | | .ant-card-extra { |
| | | padding: 5px 0; |
| | | button { |
| | | margin-left: 20px; |
| | | margin-left: 15px; |
| | | } |
| | | button:not(.ant-switch):not(:last-child):not(:nth-last-child(2)) { |
| | | padding: 0px 10px; |
| | | } |
| | | .ant-switch.big { |
| | | min-width: 60px; |
| | | height: 28px; |
| | | line-height: 28px; |
| | | margin-top: -2px; |
| | | .ant-switch-inner { |
| | | font-size: 14px; |
| | | } |
| | | } |
| | | .ant-switch.big:after { |
| | | width: 24px; |
| | | height: 24px; |
| | | } |
| | | } |
| | | } |
| | | >.ant-card-body { |
| | | padding: 0px; |
| | | transform: scale(1.15); |
| | | top: -2px; |
| | | } |
| | | } |
| | | } |
| | |
| | | const TableNodes = asyncComponent(() => import('@/menu/tablenodes')) |
| | | const BgController = asyncComponent(() => import('@/pc/bgcontroller')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const LowerField = asyncComponent(() => import('@/menu/lowerField')) |
| | | const NormalCss = asyncComponent(() => import('@/menu/normalCss')) |
| | | const NormalCopy = asyncComponent(() => import('@/menu/normalCopy')) |
| | | const SysInterface = asyncComponent(() => import('@/menu/sysinterface')) |
| | | const Quotecomponent = asyncComponent(() => import('@/pc/quotecomponent')) |
| | | const PasteController = asyncComponent(() => import('@/menu/pastecontroller')) |
| | |
| | | <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 37px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 23px'}} copyable={{ text: `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>菜单链接</Paragraph> |
| | | <Paragraph style={{padding: '15px 0px 0px 32px'}} copyable={{ text: MenuId }}>菜单ID:</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 18px'}} copyable={{ text: `${window.GLOB.baseurl}mob/index.html#/index/${sessionStorage.getItem('kei_no')}/${sessionStorage.getItem('typename')}/${sessionStorage.getItem('lang')}/${MenuId}/@BID@` }}>菜单链接:</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 18px'}}>菜单组件:<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | <NormalCopy /> |
| | | </> : null} |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | |
| | | {controlshow ? <DoubleRightOutlined onClick={() => {this.setState({controlshow: false})}}/> : null} |
| | | {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null} |
| | | </div> |
| | | <div className="wrap"> |
| | | <div className="wrap mk-opeartion-list"> |
| | | <Button type="primary" className={needUpdate ? 'update-tip' : ''} disabled={!config} onClick={this.submitConfig} id="save-config" loading={menuloading}>保存</Button> |
| | | {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | | <ArrowLeftOutlined title="后退" className="back-view" onClick={this.backView}/> |
| | |
| | | <StyleCombControlButton menu={config} /> |
| | | <Button className="mk-border-green set-home" disabled={MenuId === appHomeId} data-title="当前菜单为应用首页" onClick={this.setHomeView}><HomeOutlined /> 设为首页</Button> |
| | | <Button className="mk-border-purple" disabled={MenuId === appLoginId} data-title="当前菜单为应用登录页" onClick={this.setLoginView}><LoginOutlined /> 设为登录页</Button> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <ReplaceField config={config} updateConfig={this.resetConfig}/> |
| | | <LowerField config={config} updateConfig={this.resetConfig}/> |
| | | <Transfer MenuID={MenuId} /> |
| | | {config ? <Versions MenuId={MenuId} Template="webPage" checklog={this.checklog} updateConfig={this.updateLogConfig}/> : null} |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | |
| | | const MobShell = asyncComponent(() => import('@/mob/mobshell')) |
| | | const SourceWrap = asyncComponent(() => import('@/mob/modulesource')) |
| | | const Modulecell = asyncComponent(() => import('@/menu/modulecell')) |
| | | const NormalCopy = asyncComponent(() => import('@/menu/normalCopy')) |
| | | const BgController = asyncComponent(() => import('@/pc/bgcontroller')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const PasteController = asyncComponent(() => import('@/menu/pastecontroller')) |
| | |
| | | <Panel header="基本信息" forceRender className="basedata" key="basedata"> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <NormalCopy /> |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | | <Panel header="组件" className="component" key="component"> |
| | |
| | | {controlshow ? <DoubleRightOutlined onClick={() => {this.setState({controlshow: false})}}/> : null} |
| | | {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null} |
| | | </div> |
| | | <div className="wrap"> |
| | | <div className="wrap mk-opeartion-list"> |
| | | <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>保存</Button> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config && config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | <PasteController insert={this.insert} /> |
| | | <StyleCombControlButton menu={config} /> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <ReplaceField config={config} updateConfig={this.resetConfig}/> |
| | | <Button type="default" onClick={this.closeView}>返回</Button> |
| | | </div> |
| | | </div> |
| | |
| | | const PasteController = asyncComponent(() => import('@/menu/pastecontroller')) |
| | | const StyleController = asyncComponent(() => import('@/menu/stylecontroller')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const LowerField = asyncComponent(() => import('@/menu/lowerField')) |
| | | const NormalCss = asyncComponent(() => import('@/menu/normalCss')) |
| | | const NormalCopy = asyncComponent(() => import('@/menu/normalCopy')) |
| | | const SysInterface = asyncComponent(() => import('@/menu/sysinterface')) |
| | | const UrlFieldComponent = asyncComponent(() => import('@/menu/urlfieldcomponent')) |
| | | const PictureController = asyncComponent(() => import('@/menu/picturecontroller')) |
| | |
| | | <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 37px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '15px 0px 0px 32px'}} copyable={{ text: MenuId }}>菜单ID:</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 18px'}}>菜单组件:<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | <NormalCopy /> |
| | | </> : null} |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | |
| | | {controlshow ? <DoubleRightOutlined onClick={() => {sessionStorage.setItem('controlshow', 'false'); this.setState({controlshow: false})}}/> : null} |
| | | {!controlshow ? <DoubleLeftOutlined onClick={() => {sessionStorage.setItem('controlshow', 'true'); this.setState({controlshow: true})}}/> : null} |
| | | </div> |
| | | <div className="wrap"> |
| | | <div className="wrap mk-opeartion-list"> |
| | | <Button type="primary" className={needUpdate ? 'update-tip' : ''} disabled={!config} id="save-config" onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | | <ArrowLeftOutlined title="后退" className="back-view" onClick={this.backView}/> |
| | |
| | | <StyleCombControlButton menu={config} /> |
| | | <Button className="mk-border-green" disabled={MenuId === appHomeId} data-title="当前菜单为应用首页" onClick={this.setHomeView}><HomeOutlined /> 设为首页</Button> |
| | | <Button className="mk-border-purple" disabled={MenuId === appLoginId} data-title="当前菜单为应用登录页" onClick={this.setLoginView}><LoginOutlined/> 设为登录页</Button> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <ReplaceField config={config} updateConfig={this.resetConfig}/> |
| | | <LowerField config={config} updateConfig={this.resetConfig}/> |
| | | <Transfer MenuID={MenuId} /> |
| | | {config ? <Versions MenuId={MenuId} Template="webPage" checklog={this.checklog} updateConfig={this.updateLogConfig}/> : null} |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | |
| | | height: 100%; |
| | | padding: 20px 10px; |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | } |
| | | .wrap::-webkit-scrollbar { |
| | | width: 2px; |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography, message } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, CopyOutlined } from '@ant-design/icons' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography, message, Dropdown } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, CopyOutlined, DownOutlined } from '@ant-design/icons' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | |
| | | const BgController = asyncComponent(() => import('@/pc/bgcontroller')) |
| | | const StyleController = asyncComponent(() => import('@/menu/stylecontroller')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const LowerField = asyncComponent(() => import('@/menu/lowerField')) |
| | | const Debug = asyncComponent(() => import('@/menu/debug')) |
| | | const Versions = asyncComponent(() => import('@/menu/versions')) |
| | | const Transfer = asyncComponent(() => import('@/menu/transfer')) |
| | | const Unattended = asyncComponent(() => import('@/templates/zshare/unattended')) |
| | | const NormalCopy = asyncComponent(() => import('@/menu/normalCopy')) |
| | | const UrlFieldComponent = asyncComponent(() => import('@/menu/urlfieldcomponent')) |
| | | const ModalController = asyncComponent(() => import('@/menu/modalconfig/controller')) |
| | | const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) |
| | |
| | | /> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 5px'}}>菜单组件 <CopyOutlined onClick={this.copyMenu} style={{marginLeft: '3px', cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | <Paragraph style={{padding: '15px 0px 0px 32px'}} copyable={{ text: MenuId }}>菜单ID:</Paragraph> |
| | | <Paragraph style={{padding: '0px 0px 0px 18px'}}>菜单组件:<CopyOutlined onClick={this.copyMenu} style={{cursor: 'pointer', color: '#1890ff'}} /></Paragraph> |
| | | <NormalCopy /> |
| | | </> : null} |
| | | </Panel> |
| | | <Panel header="搜索" key="search"> |
| | |
| | | {config ? <Unattended config={config} updateConfig={this.updateConfig}/> : null} |
| | | {config ? <Versions MenuId={MenuId} Template="BaseTable" checklog={this.checklog} updateConfig={this.updateLogConfig}/> : null} |
| | | <TableNodes config={config} /> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <PasteBaseTable type="page" insert={this.insert}/> |
| | | {config ? <Dropdown placement="bottomCenter" overlay={<div className="mk-opeartion-dropdown-wrap"> |
| | | <ReplaceField config={config} updateConfig={this.resetConfig}/> |
| | | <LowerField config={config} updateConfig={this.resetConfig}/> |
| | | </div>} trigger={['hover']}> |
| | | <div className="mk-button-more">更多<DownOutlined/></div> |
| | | </Dropdown> : null} |
| | | {config ? <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> : null} |
| | | <Button type="primary" id="save-config" disabled={!config} onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Button type="default" disabled={menuloading} onClick={this.closeView}>关闭</Button> |
| | |
| | | button { |
| | | margin-left: 15px; |
| | | } |
| | | .mk-opeartion-list button:not(.ant-switch):not(:last-child):not(:nth-last-child(2)) { |
| | | .mk-opeartion-list { |
| | | button:not(.ant-switch):not(:last-child):not(:nth-last-child(2)) { |
| | | padding: 0px 10px; |
| | | } |
| | | .mk-button-more { |
| | | display: inline-block; |
| | | height: 32px; |
| | | border: 1px solid #26C281; |
| | | color: #26C281; |
| | | line-height: 32px; |
| | | padding: 0 10px 0px 20px; |
| | | border-radius: 4px; |
| | | cursor: pointer; |
| | | vertical-align: top; |
| | | margin-left: 15px; |
| | | .anticon-down { |
| | | margin-left: 3px; |
| | | } |
| | | } |
| | | } |
| | | .ant-switch.big { |
| | | min-width: 60px; |
| | | height: 28px; |
| | |
| | | |
| | | const MenuShell = asyncComponent(() => import('@/menu/tableshell')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const NormalCopy = asyncComponent(() => import('@/menu/normalCopy')) |
| | | const BgController = asyncComponent(() => import('@/pc/bgcontroller')) |
| | | const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) |
| | | |
| | |
| | | <Panel header="基本信息" key="basedata"> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updatetable}/> |
| | | <NormalCopy /> |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | | <Panel header="搜索" key="search"> |
| | |
| | | <div> {config.MenuName} </div> |
| | | } bordered={false} extra={ |
| | | <div> |
| | | <ReplaceField type="custom" config={config} updateConfig={this.resetConfig}/> |
| | | <ReplaceField config={config} updateConfig={this.resetConfig}/> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" id="save-pop-config" onClick={this.submitConfig} loading={menuloading}>保存</Button> |
| | | <Button type="default" disabled={menuloading} onClick={this.closeView}>返回</Button> |