| | |
| | | { |
| | | "appId": "202108312122504607B107A83F55B40C98CCF", |
| | | "appkey": "20210831212235413F287EC3BF489424496C8", |
| | | "appId": "201912040924165801464FF1788654BC5AC73", |
| | | "appkey": "20191106103859640976D6E924E464D029CF0", |
| | | "mainSystemApi": "http://sso.mk9h.cn/cloud/webapi/dostars", |
| | | "systemType": "", |
| | | "externalDatabase": "", |
| | | "lineColor": "", |
| | | "filter": "false", |
| | | "defaultApp": "mkindustry", |
| | | "defaultApp": "mk", |
| | | "defaultLang": "zh-CN", |
| | | "WXAppID": "", |
| | | "WXminiAppID": "", |
| | |
| | | "transfer": "false", |
| | | "keepPassword": "true", |
| | | "platforms": ["H5", "wechat", "android", "ios", "wxMiniProgram"], |
| | | "host": "http://demo.mk9h.cn", |
| | | "service": "erp_new/" |
| | | "host": "http://qingqiumarket.cn", |
| | | "service": "MKWMS/" |
| | | } |
| | |
| | | .ant-pagination-next:hover .ant-pagination-item-link { |
| | | color: $color6; |
| | | } |
| | | .ant-pagination-options { |
| | | > div:not(:first-child) { |
| | | z-index: 1; |
| | | } |
| | | } |
| | | } |
| | | // 表格排序图标 |
| | | .ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner .ant-table-column-sorter-up.on, .ant-table-thead > tr > th .ant-table-column-sorter .ant-table-column-sorter-inner .ant-table-column-sorter-down.on { |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'readonly', |
| | | label: '只读', |
| | | initval: wrap.readonly || 'false', |
| | | required: true, |
| | | options: [ |
| | | {value: 'false', label: '否'}, |
| | | {value: 'true', label: '是'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'addable', values: ['false']}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'addable', |
| | | label: '可新增', |
| | | initval: wrap.addable || 'false', |
| | | required: true, |
| | | options: [ |
| | | {value: 'true', label: '是'}, |
| | | {value: 'false', label: '否'}, |
| | | {value: 'true', label: '是'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'linkmenu', values: ['true']}, |
| | |
| | | if (Ot === 'required') { |
| | | shows.push('progress') |
| | | } |
| | | if (Ot === 'required' && (intertype === 'inner' || intertype === 'system')) { |
| | | shows.push('execType') |
| | | } |
| | | if (this.record.openmenu && this.record.openmenu !== 'goback') { |
| | | shows.push('open') |
| | | } |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'execType', |
| | | label: '请求方式', |
| | | initVal: card.execType || 'multi', |
| | | tooltip: '选中多条数据时的请求方式,注:当选中数据超过20条时将逐条请求。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'multi', |
| | | text: '批量请求' |
| | | }, { |
| | | value: 'single', |
| | | text: '逐条请求' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'progress', |
| | | label: '进度提示', |
| | | initVal: card.progress || 'number', |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'execType', |
| | | label: '请求方式', |
| | | initVal: card.execType || 'multi', |
| | | tooltip: '选中多条数据时的请求方式,注:当选中数据超过20条时将逐条请求。', |
| | | required: false, |
| | | options: [{ |
| | | value: 'multi', |
| | | text: '批量请求' |
| | | }, { |
| | | value: 'single', |
| | | text: '逐条请求' |
| | | }] |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | key: 'progress', |
| | | label: '进度提示', |
| | | initVal: card.progress || 'number', |
| | |
| | | roleList = [] |
| | | } |
| | | |
| | | if (['picture', 'link', 'colspan'].includes(card.type)) { |
| | | // if (['picture', 'link', 'colspan'].includes(card.type)) { |
| | | if (['picture', 'link'].includes(card.type)) { |
| | | card.type = 'text' |
| | | } |
| | | |
| | |
| | | value: 'custom', |
| | | text: '自定义列' |
| | | }, { |
| | | value: 'action', |
| | | text: '操作' |
| | | value: 'colspan', |
| | | text: '合并列' |
| | | // }, { |
| | | // value: 'action', |
| | | // text: '操作' |
| | | }, { |
| | | value: 'formula', |
| | | text: '公式' |
| | |
| | | value: 'index', |
| | | text: '序号' |
| | | }] |
| | | |
| | | if (!card.isSub) { |
| | | options.push({ |
| | | value: 'action', |
| | | text: '操作' |
| | | }) |
| | | } |
| | | |
| | | let editCols = [ |
| | | { |
| | |
| | | editCols.push({ |
| | | field: col.uuid, |
| | | label: col.label |
| | | }) |
| | | } else if (col.type === 'colspan') { |
| | | col.subcols.forEach(subcol => { |
| | | if (subcol.editable === 'true' && subcol.uuid !== card.uuid) { |
| | | editCols.push({ |
| | | field: subcol.uuid, |
| | | label: col.label + '-' + subcol.label |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | |
| | | type: 'radio', |
| | | key: 'IsSort', |
| | | label: '排序', |
| | | initVal: card.IsSort || 'false', |
| | | initVal: card.IsSort || (card.isSub ? 'false' : 'true'), |
| | | required: true, |
| | | options: [{ |
| | | value: 'true', |
| | |
| | | number: ['label', 'field', 'type', 'Align', 'Hide', 'IsSort', 'Width', 'decimal', 'format', 'prefix', 'postfix', 'editable', 'initval', 'sum', 'blacklist'], |
| | | textarea: ['label', 'field', 'type', 'Align', 'Hide', 'Width', 'prefix', 'initval', 'postfix', 'blacklist'], |
| | | custom: ['label', 'type', 'Align', 'Hide', 'Width', 'blacklist'], |
| | | colspan: ['label', 'type', 'Align', 'Hide', 'blacklist'], |
| | | action: ['label', 'type', 'Align', 'Width'], |
| | | formula: ['label', 'type', 'Align', 'Hide', 'Width', 'prefix', 'postfix', 'eval', 'formula', 'blacklist'], |
| | | index: ['label', 'type', 'Align', 'Width'] |
| | |
| | | return item |
| | | }) |
| | | }, () => { |
| | | if (value === 'action') { |
| | | if (value === 'action' || value === 'colspan') { |
| | | this.props.form.setFieldsValue({Align: 'center'}) |
| | | } |
| | | }) |
| | |
| | | } |
| | | |
| | | handleSubmit = () => { |
| | | const { columns, column } = this.props |
| | | // const { columns } = this.props |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | values.uuid = column.uuid |
| | | values.marks = column.marks || [] |
| | | |
| | | if (values.field && columns.filter(col => col.field && col.uuid !== values.uuid && col.field === values.field).length > 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '字段已添加!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | // if (values.field && columns.filter(col => col.field && col.uuid !== values.uuid && col.field === values.field).length > 0) { |
| | | // notification.warning({ |
| | | // top: 92, |
| | | // message: '字段已添加!', |
| | | // duration: 5 |
| | | // }) |
| | | // return |
| | | // } |
| | | this.setState({visible: false, formlist: null}) |
| | | this.props.submitCol(values) |
| | | |
| | |
| | | </th> |
| | | ) |
| | | |
| | | if (index !== undefined) { |
| | | let style = {cursor: 'move', textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | |
| | | connectDropTarget(<th {...restProps} index={index} style={style} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {['custom', 'action'].includes(column.type) ? |
| | | {['custom', 'colspan', 'action'].includes(column.type) ? |
| | | <PlusOutlined className="plus" title="添加" onClick={() => this.props.addElement(column)} /> : null |
| | | } |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | |
| | | </Popover> |
| | | </th>), |
| | | ) |
| | | } else if (column) { |
| | | let style = {textAlign: align} |
| | | if (column.Width) { |
| | | style.width = column.Width |
| | | style.minWidth = column.Width |
| | | } |
| | | |
| | | return ( |
| | | <th {...restProps} style={style} key={column.uuid} onDoubleClick={() => this.props.editColumn(column)}> |
| | | <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ |
| | | <div className="mk-popover-control" onDoubleClick={(e) => e.stopPropagation()}> |
| | | {['custom', 'colspan'].includes(column.type) ? |
| | | <PlusOutlined className="plus" title="添加" onClick={() => this.props.addElement(column)} /> : null |
| | | } |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.props.editColumn(column)} /> |
| | | {column.type === 'custom' ? <PasteComponent options={['customCardElement']} updateConfig={(res, resolve) => this.props.pasteCell(column, res, resolve)} /> : null} |
| | | <DeleteOutlined className="close" title="删除" onClick={this.deleteCol} /> |
| | | {column && ['text', 'number', 'formula'].includes(column.type) ? <MarkColumn field={column.field || ''} columns={fields} marks={column.marks} onSubmit={this.updateMarks} /> : null } |
| | | </div> |
| | | } trigger="hover"> |
| | | {children} |
| | | </Popover> |
| | | </th> |
| | | ) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | let type = item.subType |
| | | |
| | | if (!['text', 'number', 'textarea', 'custom', 'action', 'formula', 'index'].includes(item.subType)) { |
| | | if (!['text', 'number', 'textarea', 'custom', 'action', 'formula', 'index', 'colspan'].includes(item.subType)) { |
| | | type = 'text' |
| | | } |
| | | |
| | | let col = { focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: type, elements: [] } |
| | | if (col.type === 'action') { |
| | | if (col.type === 'colspan') { |
| | | col.subcols = [] |
| | | } else if (col.type === 'action') { |
| | | col.label = '操作' |
| | | } else if (col.type === 'index') { |
| | | col.label = '序号' |
| | |
| | | }) |
| | | } |
| | | |
| | | updateCol = (col, btn) => { |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | _columns = _columns.map(column => { |
| | | loopCol = (columns, col) => { |
| | | return columns.map(column => { |
| | | if (column.type === 'colspan') { |
| | | column.subcols = this.loopCol(column.subcols || [], col) |
| | | } |
| | | if (column.uuid === col.uuid) { |
| | | return col |
| | | } |
| | | return column |
| | | }) |
| | | } |
| | | |
| | | updateCol = (col, btn) => { |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | _columns = this.loopCol(_columns, col) |
| | | |
| | | this.setState({ |
| | | columns: _columns, |
| | |
| | | addElement = (col) => { |
| | | let column = fromJS(col).toJS() |
| | | |
| | | if (column.type === 'custom') { |
| | | if (column.type === 'colspan') { |
| | | column.subcols = column.subcols || [] |
| | | let subcol = { isSub: true, focus: true, uuid: Utils.getuuid(), label: 'label', field: '', type: 'text' } |
| | | column.subcols.push(subcol) |
| | | |
| | | this.setState({ |
| | | card: subcol |
| | | }) |
| | | this.updateCol(column) |
| | | } else if (column.type === 'custom') { |
| | | let newcard = {uuid: Utils.getuuid(), focus: true, width: 24, eleType: 'text', datatype: 'dynamic', style: {paddingLeft: '4px'}} |
| | | |
| | | // 注册事件-添加元素 |
| | |
| | | submitCol = (col) => { |
| | | const { card } = this.state |
| | | |
| | | if (col.type === 'custom') { |
| | | col.uuid = card.uuid |
| | | col.isSub = card.isSub === true |
| | | col.marks = card.marks || [] |
| | | |
| | | if (col.type === 'colspan') { |
| | | col.subcols = card.subcols || [] |
| | | } else if (col.type === 'custom') { |
| | | col.style = card.style || {} |
| | | col.elements = card.type === 'custom' ? (card.elements || []) : [] |
| | | } else if (col.type === 'action') { |
| | |
| | | this.setState({card: null}) |
| | | } |
| | | |
| | | loopDelCol = (columns, col) => { |
| | | return columns.filter(column => { |
| | | if (column.type === 'colspan') { |
| | | column.subcols = this.loopDelCol(column.subcols, col) |
| | | } |
| | | return column.uuid !== col.uuid |
| | | }) |
| | | } |
| | | |
| | | deleteCol = (col) => { |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | |
| | | _columns = _columns.filter(column => column.uuid !== col.uuid) |
| | | _columns = this.loopDelCol(_columns, col) |
| | | |
| | | this.setState({ |
| | | columns: _columns |
| | |
| | | MKEmitter.removeListener('submitStyle', this.getStyle) |
| | | } |
| | | |
| | | handlecolumns = (columns, fields, config, isSub) => { |
| | | return columns.map((col, index) => { |
| | | let title = col.label |
| | | if (col.editable === 'true') { |
| | | title = <span>{col.label}<EditOutlined style={{position: 'absolute', bottom: 0, right: 0, color: '#1890ff', opacity: '0.7'}}/></span> |
| | | } |
| | | |
| | | return { |
| | | title: title, |
| | | dataIndex: col.uuid, |
| | | align: col.Align, |
| | | sorter: col.IsSort === 'true', |
| | | onCell: () => ({ |
| | | column: col, |
| | | width: col.Width, |
| | | config: config, |
| | | upComponent: this.updateCol |
| | | }), |
| | | onHeaderCell: () => ({ |
| | | index: isSub ? undefined : index, |
| | | column: col, |
| | | fields: fields, |
| | | align: col.Align, |
| | | moveCol: this.moveCol, |
| | | dropCol: this.dropCol, |
| | | updateCol: this.updateCol, |
| | | addElement: this.addElement, |
| | | editColumn: this.editColumn, |
| | | pasteCell: this.pasteCell, |
| | | changeStyle: this.changeStyle, |
| | | deleteCol: this.deleteCol, |
| | | }), |
| | | children: col.subcols && col.subcols.length ? this.handlecolumns(col.subcols, fields, config, true) : null, |
| | | } |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { fields, card, lineMarks, tableId, visible } = this.state |
| | |
| | | } |
| | | } |
| | | |
| | | const columns = this.state.columns.map((col, index) => { |
| | | let title = col.label |
| | | if (col.editable === 'true') { |
| | | title = <span>{col.label}<EditOutlined style={{position: 'absolute', bottom: 0, right: 0, color: '#1890ff', opacity: '0.7'}}/></span> |
| | | } |
| | | return { |
| | | title: title, |
| | | dataIndex: col.uuid, |
| | | align: col.Align, |
| | | sorter: col.IsSort === 'true', |
| | | onCell: () => ({ |
| | | column: col, |
| | | width: col.Width, |
| | | config: config, |
| | | upComponent: this.updateCol |
| | | }), |
| | | onHeaderCell: () => ({ |
| | | index, |
| | | column: col, |
| | | fields: fields, |
| | | align: col.Align, |
| | | moveCol: this.moveCol, |
| | | dropCol: this.dropCol, |
| | | updateCol: this.updateCol, |
| | | addElement: this.addElement, |
| | | editColumn: this.editColumn, |
| | | pasteCell: this.pasteCell, |
| | | changeStyle: this.changeStyle, |
| | | deleteCol: this.deleteCol, |
| | | }), |
| | | } |
| | | }) |
| | | const columns = this.handlecolumns(this.state.columns, fields, config) |
| | | |
| | | return ( |
| | | <div className={`edit-table-columns ${config.setting.laypage} ${config.wrap.mode || ''} table-vertical-${config.wrap.vertical || ''}`} id={tableId}> |
| | |
| | | } |
| | | >.anticon-copy { |
| | | color: #26C281; |
| | | margin-left: 5px; |
| | | } |
| | | >.anticon-delete { |
| | | color: #ff4d4f; |
| | |
| | | if (col.format === 'abs') { |
| | | config.absFields.push(col.field) |
| | | } |
| | | } else if (col.type === 'colspan' && col.subcols) { |
| | | col.subcols.forEach(scol => { |
| | | if (scol.type === 'number') { |
| | | if (scol.format === 'abs') { |
| | | config.absFields.push(scol.field) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }) |
| | | |
| | |
| | | options: [ |
| | | {value: 'true', label: '可编辑'}, |
| | | {value: 'false', label: '不可编辑'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'switchable', values: ['true']}, |
| | | ] |
| | | }, |
| | | { |
| | |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'switchable', |
| | | label: '状态切换', |
| | | initval: wrap.switchable || 'true', |
| | | tooltip: '是否可以在编辑和默认table状态间切换。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ] |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | | field: 'blacklist', |
| | | label: '黑名单', |
| | |
| | | title: col.label, |
| | | dataIndex: col.uuid, |
| | | align: col.Align, |
| | | // sorter: !isSub && col.IsSort === 'true', |
| | | sorter: col.IsSort === 'true', |
| | | onCell: () => ({ |
| | | column: col, |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { notification, Select, Divider } from 'antd' |
| | | import { notification, Select, Divider, Modal } from 'antd' |
| | | import { PlusOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | |
| | | import './index.scss' |
| | | |
| | | const { Option } = Select |
| | | const { confirm } = Modal |
| | | |
| | | class AccountModule extends Component { |
| | | static propTpyes = { |
| | |
| | | } |
| | | |
| | | changeBook = (value) => { |
| | | const { books } = this.state |
| | | const { books, activeItem } = this.state |
| | | |
| | | let activeItem = books.filter(item => item.id === value)[0] |
| | | let Item = books.filter(item => item.id === value)[0] |
| | | |
| | | this.setState({activeItem}) |
| | | if (!activeItem && Item) { |
| | | this.setBook(Item) |
| | | } else if (Item) { |
| | | const _this = this |
| | | confirm({ |
| | | title: '确定切换账套吗?', |
| | | content: '切换账套时系统需要刷新。', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.setBook(Item, resolve) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (activeItem) { |
| | | MKEmitter.emit('resetSelectLine', this.props.config.uuid, activeItem.id, activeItem) |
| | | setBook = (item, resolve) => { |
| | | if (!resolve) { |
| | | this.setState({activeItem: item}) |
| | | |
| | | MKEmitter.emit('resetSelectLine', this.props.config.uuid, item.id, item) |
| | | } |
| | | |
| | | let userid = sessionStorage.getItem('UserID') || '' |
| | | let sid = localStorage.getItem('SessionUid') || '' |
| | |
| | | func: 'sPC_TableData_InUpDe', |
| | | LText: `delete tmp_session_show_key where createuserid='${userid}' and createuser='${sid}' and key_type='fcc_years' |
| | | insert into tmp_session_show_key ( key_id,key_type,createuserid,CreateUser,CreateStaff) |
| | | select '${activeItem.id}','fcc_years','${userid}','${sid}','${sessionStorage.getItem('Full_Name') || ''}'`, |
| | | select '${item.id}','fcc_years','${userid}','${sid}','${sessionStorage.getItem('Full_Name') || ''}'`, |
| | | exec_type: 'y' |
| | | } |
| | | |
| | |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | |
| | | Api.genericInterface(param) |
| | | Api.genericInterface(param).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | resolve && resolve() |
| | | return |
| | | } |
| | | |
| | | if (resolve) { |
| | | window.location.reload() |
| | | } |
| | | }) |
| | | } |
| | | |
| | | addBook = () => { |
| | |
| | | {books.map(item => ( |
| | | <Option disabled={!item.months} key={item.id}>{item.account_name}</Option> |
| | | ))} |
| | | </Select> : <Select value={activeItem ? activeItem.id : ''} placeholder="请选择账套" onChange={this.changeBook}> |
| | | </Select> : <Select value={activeItem ? activeItem.id : ''} disabled={config.wrap.readonly === 'true'} placeholder="请选择账套" onChange={this.changeBook}> |
| | | {books.map(item => ( |
| | | <Option disabled={!item.months} key={item.id}>{item.account_name}</Option> |
| | | ))} |
| | |
| | | .date { |
| | | margin-left: 15px; |
| | | } |
| | | .ant-select.ant-select-disabled { |
| | | .ant-select-selection:hover { |
| | | border-color: #d9d9d9; |
| | | } |
| | | .ant-select-selection, .ant-select-selection:focus, .ant-select-selection:active { |
| | | border-color: #d9d9d9; |
| | | box-shadow: none; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .mk-add-book { |
| | |
| | | } |
| | | |
| | | // config.wrap.type = 'checkVoucher' |
| | | // BID = '20230214130744811P0K95RQ155KG0QIQOFV' |
| | | // BID = '20230228173542370E2F4FC1773704C29A6A4' |
| | | |
| | | // config.wrap.type = 'checkTemp' |
| | | // BID = '20230214174458780MFR8IA576ON4VKNOLVH' |
| | |
| | | let line = {...record} |
| | | line[col.field] = value |
| | | |
| | | if (col.field === 'subject_voucher_text') { |
| | | MKEmitter.emit('changeRecord', col.tableId, line) |
| | | |
| | | setTimeout(() => { |
| | | let cl = {subject_voucher_text: 'subject_code', subject_code: 'debit', debit: 'credit'} |
| | | MKEmitter.emit('tdFocus', cl[col.uuid] + record.uuid) |
| | | }, 50) |
| | | return |
| | | } |
| | | |
| | | if (col.field === 'debit') { |
| | | line.credit = '' |
| | | if (isNaN(line.debit)) { |
| | |
| | | if (value !== record[col.field]) { |
| | | let line = {...record, [col.field]: value} |
| | | |
| | | if (col.field === 'subject_voucher_text') { |
| | | MKEmitter.emit('changeRecord', col.tableId, line) |
| | | return |
| | | } |
| | | |
| | | if (col.field === 'debit') { |
| | | line.credit = '' |
| | | if (isNaN(line.debit)) { |
| | |
| | | setting.orisel = true |
| | | } |
| | | |
| | | _config.cols.forEach(column => { |
| | | if (column.type === 'action') { |
| | | column.operations = column.elements |
| | | } |
| | | }) |
| | | |
| | | _config.style = _config.style || {} |
| | | |
| | | this.setState({ |
| | |
| | | }) |
| | | } |
| | | |
| | | if (column.type === 'action') { |
| | | column.operations = column.elements |
| | | } |
| | | |
| | | _columns.push(column) |
| | | }) |
| | | |
| | |
| | | pageIndex: 1, // 初始页面索引 |
| | | pageSize: 10, // 每页数据条数 |
| | | columns: null, // 显示列 |
| | | fields: [], |
| | | forms: [], |
| | | pickup: false, // 收起未选择项 |
| | | orderfields: {}, // 排序id与field转换 |
| | | loading: false, |
| | |
| | | |
| | | let _columns = [] |
| | | let deForms = [] |
| | | columns.forEach(item => { |
| | | if (!initEditLine && item.editable === 'true') { |
| | | let _forms = {} |
| | | |
| | | let getColumns = (cols) => { |
| | | return cols.map(item => { |
| | | let cell = null |
| | | |
| | | if (item.type === 'colspan') { |
| | | cell = { title: item.label, align: item.Align } |
| | | cell.children = getColumns(item.subcols) |
| | | } else { |
| | | if (item.editable === 'true') { |
| | | _forms[item.field] = item |
| | | if (!initEditLine) { |
| | | initEditLine = item |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'text' && item.editable === 'true' && item.editType === 'select' && item.resourceType === '1') { |
| | |
| | | orderfields[item.uuid] = item.field |
| | | } |
| | | |
| | | let _item = { |
| | | cell = { |
| | | align: item.Align, |
| | | dataIndex: item.uuid, |
| | | title: item.label, |
| | | sorter: item.field && item.IsSort === 'true', |
| | | sorter: !!(item.field && item.IsSort === 'true'), |
| | | width: item.Width || 120, |
| | | $type: item.type, |
| | | onCell: record => ({ |
| | | record, |
| | | col: item, |
| | | config: item.type === 'custom' || item.type === 'action' ? {setting, columns: fields} : null, |
| | | }) |
| | | } |
| | | } |
| | | |
| | | if (item.type !== 'action') { |
| | | let _copy = fromJS(_item).toJS() |
| | | return cell |
| | | }) |
| | | } |
| | | _columns = getColumns(columns) |
| | | |
| | | let forms = [] |
| | | fields.forEach(item => { |
| | | if (item.field === setting.primaryKey) return |
| | | |
| | | if (_forms[item.field]) { |
| | | forms.push({..._forms[item.field], datatype: item.datatype}) |
| | | } else { |
| | | forms.push(item) |
| | | } |
| | | }) |
| | | |
| | | _columns.forEach(item => { |
| | | if (item.$type === 'action') return |
| | | |
| | | let _copy = fromJS(item).toJS() |
| | | _copy.sorter = false |
| | | |
| | | if (item.editable === 'true') { |
| | | _copy.title = <span>{item.label}<EditOutlined className="system-color mk-edit-sign"/></span> |
| | | } |
| | | edColumns.push(_copy) |
| | | } |
| | | _columns.push(_item) |
| | | }) |
| | | |
| | | if (setting.delable !== 'false' && setting.operType !== 'buoyMode') { |
| | |
| | | }) |
| | | } |
| | | |
| | | // if (setting.borderColor) { // 边框颜色 |
| | | // let style = `#${setting.tableId} table, #${setting.tableId} tr, #${setting.tableId} th, #${setting.tableId} td {border-color: ${setting.borderColor}}` |
| | | // let ele = document.createElement('style') |
| | | // ele.innerHTML = style |
| | | // document.getElementsByTagName('head')[0].appendChild(ele) |
| | | // } |
| | | |
| | | let size = (setting.pageSize || 10) + '' |
| | | let pageOptions = ['10', '25', '50', '100', '500', '1000'] |
| | | |
| | |
| | | } |
| | | |
| | | this.setState({ |
| | | forms, |
| | | pageSize: setting.pageSize || 10, |
| | | pageOptions, |
| | | columns: _columns, |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { fields, setting } = this.props |
| | | |
| | | this.setState({ |
| | | fields: fields.filter(item => item.field !== setting.primaryKey), |
| | | }) |
| | | |
| | | MKEmitter.addListener('subLine', this.subLine) |
| | | MKEmitter.addListener('nextLine', this.nextLine) |
| | | MKEmitter.addListener('addRecord', this.addLine) |
| | |
| | | } |
| | | |
| | | subLine = (col, record) => { |
| | | const { tableId, fields, edData } = this.state |
| | | const { tableId, forms, edData } = this.state |
| | | |
| | | if (col && col.tableId !== tableId) return |
| | | |
| | |
| | | setTimeout(() => { |
| | | let item = fromJS(record).toJS() |
| | | let line = [] |
| | | fields.forEach(col => { |
| | | forms.forEach(col => { |
| | | if (col.editable !== 'true' || item.$deleted) { |
| | | if (col.type === 'number') { |
| | | item[col.field] = +item[col.field] |
| | |
| | | } |
| | | |
| | | plusLine = () => { |
| | | const { edData, fields, initEditLine } = this.state |
| | | const { edData, forms, initEditLine } = this.state |
| | | |
| | | let item = {...edData[edData.length - 1]} |
| | | |
| | |
| | | item.$type = 'add' |
| | | item.$Index = '' |
| | | |
| | | fields.forEach(col => { |
| | | forms.forEach(col => { |
| | | if (col.initval !== '$copy') { |
| | | item[col.field] = col.initval |
| | | } |
| | |
| | | |
| | | addLine = (id, record) => { |
| | | const { BID } = this.props |
| | | const { edData, fields, tableId } = this.state |
| | | const { edData, forms, tableId } = this.state |
| | | |
| | | if (id) { |
| | | if (id !== tableId) return |
| | |
| | | item.$Index = '' |
| | | item.$$BID = BID || '' |
| | | |
| | | fields.forEach(col => { |
| | | forms.forEach(col => { |
| | | if (col.initval !== '$copy') { |
| | | item[col.field] = col.initval |
| | | } |
| | |
| | | item.$$BID = BID || '' |
| | | } |
| | | |
| | | fields.forEach(col => { |
| | | forms.forEach(col => { |
| | | if (col.initval !== '$copy') { |
| | | item[col.field] = col.initval |
| | | } |
| | |
| | | } |
| | | |
| | | checkData = () => { |
| | | const { edData, fields } = this.state |
| | | const { edData, forms } = this.state |
| | | |
| | | if (edData.length === 0) { |
| | | notification.warning({ |
| | |
| | | let Index = 1 |
| | | let data = fromJS(edData).toJS().map(item => { |
| | | let line = [] |
| | | fields.forEach(col => { |
| | | forms.forEach(col => { |
| | | if (col.editable !== 'true' || item.$deleted) { |
| | | if (col.type === 'number') { |
| | | item[col.field] = +item[col.field] |
| | |
| | | |
| | | submit = (data, type) => { |
| | | const { submit, BID, setting } = this.props |
| | | const { fields } = this.state |
| | | const { forms } = this.state |
| | | |
| | | if (type !== 'simple' && (setting.commit === 'change' || setting.commit === 'simple')) { |
| | | data = data.filter(item => !item.$origin) |
| | |
| | | return |
| | | } |
| | | |
| | | let result = getEditTableSql(submit, data, fields) |
| | | let result = getEditTableSql(submit, data, forms) |
| | | |
| | | let param = { |
| | | excel_in: result.lines, |
| | |
| | | </div> : null} |
| | | <div className="edit-custom-table-btn-wrap" style={submit.wrapStyle}> |
| | | {!submit.hasAction && pickup ? <Button style={submit.style} onClick={() => setTimeout(() => {this.checkData()}, 10)} loading={loading} className="submit-table" type="link">提交</Button> : null} |
| | | <Switch title="编辑" className="main-pickup" checkedChildren="开" unCheckedChildren="关" disabled={loading || this.props.loading} checked={pickup} onChange={this.pickupChange} /> |
| | | {setting.switchable !== 'false' ? <Switch title="编辑" className="main-pickup" checkedChildren="开" unCheckedChildren="关" disabled={loading || this.props.loading} checked={pickup} onChange={this.pickupChange} /> : null} |
| | | </div> |
| | | <div className={`edit-custom-table ${pickup ? 'editable' : ''} ${setting.tableHeader || ''} ${setting.operType || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''}`} id={tableId}> |
| | | <div className={`edit-custom-table ${pickup ? 'editable' : ''} ${setting.tableHeader || ''} ${setting.operType || ''} ${height ? 'fixed-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''} mk-edit-${setting.editType || 'simple'}`} id={tableId}> |
| | | <Table |
| | | rowKey="$$uuid" |
| | | components={components} |
| | |
| | | } |
| | | } |
| | | } |
| | | .edit-custom-table.mk-edit-multi { |
| | | th .ant-table-column-title .anticon-edit { |
| | | display: none; |
| | | } |
| | | } |
| | | .edit-custom-table.editable { |
| | | td { |
| | | background-color: #ffffff!important; |
| | |
| | | } |
| | | } |
| | | |
| | | _config.cols.forEach(column => { |
| | | if (column.type === 'action') { |
| | | column.operations = column.elements |
| | | } |
| | | }) |
| | | |
| | | // if (setting.color) { |
| | | // setting.style.color = setting.color |
| | | // } |
| | | // if (setting.fontSize) { |
| | | // setting.style.fontSize = setting.fontSize |
| | | // } |
| | | |
| | | if (_config.wrap.collapse === 'true') { |
| | | _config.wrap.title = _config.wrap.title || ' ' |
| | | } |
| | |
| | | return |
| | | } |
| | | |
| | | // 内部函数为z_mk_express,表示查询快递信息 |
| | | if (config.setting.interType === 'inner' && config.setting.innerFunc === 'z_mk_express') { |
| | | this.getExpress() |
| | | return |
| | |
| | | let sheetName = btn.verify.sheet |
| | | let errDetail = '' |
| | | |
| | | if (Object.keys(workbook.Sheets).length === 1) { |
| | | if (sheetName === 'Sheet1' && Object.keys(workbook.Sheets).length === 1) { |
| | | sheetName = Object.keys(workbook.Sheets)[0] |
| | | } |
| | | |
| | |
| | | |
| | | this.table2excel(column, table, this.state.excelName.replace(/\.xlsx/ig, '.xls')) |
| | | |
| | | if (btn.verify && btn.verify.enable === 'true' && btn.verify.script) { |
| | | if (btn.verify.enable === 'true' && btn.verify.script) { |
| | | this.execCustomScript() |
| | | } else { |
| | | this.execSuccess({ErrCode: 'S', ErrMesg: '导出成功!'}) |
| | | } |
| | | } else { |
| | | let letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
| | | let cols = [] |
| | | |
| | | for (let index = 0; index < columns.length; index++) { |
| | | let i = Math.floor(index / 26) |
| | | let s = letters[i - 1] || '' |
| | | |
| | | cols.push(s + letters[index % 26]) |
| | | } |
| | | |
| | | let table = [] |
| | | let _header = [] |
| | | let _topRow = {} |
| | | let colwidth = [] |
| | | let requires = [] |
| | | let merges = [] |
| | | |
| | | columns.forEach((col, i) => { |
| | | _header.push(col.Column) |
| | | _topRow[col.Column] = col.Text |
| | | colwidth.push({width: col.Width || 20}) |
| | | colwidth.push({wch: col.Width || 20}) |
| | | if (col.required === 'true') { |
| | | requires.push(i) |
| | | } |
| | | }) |
| | | |
| | | let table = [] |
| | | if (btn.verify.merge === 'true') { |
| | | let fLine = {} |
| | | let sLine = {} |
| | | let sign = '' |
| | | columns.forEach((col, i) => { |
| | | if (/.+-.+/.test(col.Text)) { |
| | | let _sign = col.Text.split('-')[0] |
| | | let _name = col.Text.split('-')[1] |
| | | fLine[col.Column] = _sign |
| | | sLine[col.Column] = _name |
| | | |
| | | if (sign === _sign) { |
| | | merges[merges.length - 1] = merges[merges.length - 1].split(':')[0] + `:${cols[i]}1` |
| | | } else { |
| | | merges.push(`${cols[i]}1:${cols[i]}2`) |
| | | sign = _sign |
| | | } |
| | | } else { |
| | | fLine[col.Column] = col.Text |
| | | sLine[col.Column] = col.Text |
| | | sign = '' |
| | | merges.push(`${cols[i]}1:${cols[i]}2`) |
| | | } |
| | | }) |
| | | |
| | | table.push(fLine) |
| | | table.push(sLine) |
| | | } else { |
| | | table.push(_topRow) |
| | | } |
| | | |
| | | data && data.forEach((item, index) => { |
| | | let _row = {} |
| | |
| | | |
| | | ws['!cols'] = colwidth |
| | | |
| | | if (btn.verify.rowHeight) { |
| | | ws['!rows'] = Array(table.length).fill({hpx: btn.verify.rowHeight}) |
| | | } |
| | | |
| | | if (requires.length) { |
| | | let cols = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' |
| | | requires.forEach(col => { |
| | | if (cols[col]) { |
| | | ws[cols[col] + '1'].s = {font: { color: { rgb: 'F5222D' } }} |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (merges.length) { |
| | | ws['!merges'] = [] |
| | | merges.forEach(item => { |
| | | ws['!merges'].push(XLSX.utils.decode_range(item)) |
| | | }) |
| | | |
| | | cols.forEach(col => { |
| | | if (ws[col + '1'].s) { |
| | | ws[col + '1'].s = {font: { color: { rgb: 'F5222D' } }, alignment: { horizontal: 'center', vertical: 'center' }} |
| | | } else { |
| | | ws[col + '1'].s = {alignment: { horizontal: 'center', vertical: 'center' }} |
| | | } |
| | | ws[col + '2'].s = {alignment: { horizontal: 'center', vertical: 'center' }} |
| | | }) |
| | | } |
| | | |
| | | // ws["A1"].s = {fill: { bgColor: { rgb: "FFFFAA" }}, font: { color: { rgb: "1890FF" } }} |
| | | |
| | | const wb = XLSX.utils.book_new() |
| | | XLSX.utils.book_append_sheet(wb, ws, 'Sheet1') |
| | | XLSX.utils.book_append_sheet(wb, ws, btn.verify.sheet || 'Sheet1') |
| | | |
| | | XLSX.writeFile(wb, this.state.excelName) |
| | | |
| | | if (btn.verify && btn.verify.enable === 'true' && btn.verify.script) { |
| | | if (btn.verify.enable === 'true' && btn.verify.script) { |
| | | this.execCustomScript() |
| | | } else { |
| | | this.execSuccess({ErrCode: 'S', ErrMesg: '导出成功!'}) |
| | |
| | | height: 34px; |
| | | border-radius: 0px; |
| | | padding-left: 15px!important; |
| | | border-bottom-width: 1px!important; |
| | | .anticon { |
| | | display: none; |
| | | } |
| | |
| | | |
| | | if (params[0].$unCheckParam) { |
| | | this.checkLoopRequest(params, _resolve) |
| | | } else if (params.length <= 20) { |
| | | } else if (params.length <= 20 && btn.execType !== 'single') { |
| | | let deffers = params.map((param, i) => { |
| | | return new Promise(resolve => { |
| | | setTimeout(() => { |
| | |
| | | _resolve() |
| | | }) |
| | | } else { // 超出20个请求时循环执行 |
| | | if (btn.progress === 'progressbar' && btn.$toolbtn) { |
| | | if (btn.progress === 'progressbar' && btn.$toolbtn && params.length > 1) { |
| | | this.setState({ |
| | | loadingTotal: params.length |
| | | }) |
| | |
| | | className={className} |
| | | onClick={(e) => {e.stopPropagation(); this.actionTrigger()}} |
| | | >{label}</Button> |
| | | <span onClick={(e) => {e.stopPropagation()}}>{this.getPop()}</span> |
| | | <span onClick={(e) => {e.stopPropagation()}} onDoubleClick={(e) => {e.stopPropagation()}}>{this.getPop()}</span> |
| | | </> |
| | | ) |
| | | } |
| | |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col span={8}> |
| | | <Form.Item label="表名"> |
| | | <Form.Item label={ |
| | | <Tooltip placement="bottomLeft" title="导入时工作表名与excel中必须一致,注:工作表名为Sheet1且excel中仅有一个工作表时不进行表名验证。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 工作表 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sheet', { |
| | | initialValue: verify.sheet || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入表名!' |
| | | message: '请输入工作表名!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Radio, Tooltip, notification } from 'antd' |
| | | import { Form, Row, Col, Input, Radio, Tooltip, notification, InputNumber } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {btnType !== 'print' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="导出excel中工作表名称,默认为Sheet1。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 工作表 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sheet', { |
| | | initialValue: setting.sheet || '' |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {btnType !== 'print' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="导出excel中的行高。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 行高 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('rowHeight', { |
| | | initialValue: setting.rowHeight || '' |
| | | })(<InputNumber min={10} max={200} precision={0} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {btnType !== 'print' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="请将需要合并的表头使用中横线分隔(如:商品-数量、商品-单价),前部分将作为主表头,后部分将作为子表头。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 表头合并 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('merge', { |
| | | initialValue: setting.merge || 'false' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="false">否</Radio> |
| | | <Radio value="true">是</Radio> |
| | | </Radio.Group>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | </div> |
| | |
| | | values.uuid = editItem ? editItem.uuid : '' |
| | | values.position = values.position || (editItem ? editItem.position : 'front') |
| | | |
| | | if (type === 'fullscreen' && editItem) { |
| | | values.status = editItem.status || 'true' |
| | | } |
| | | |
| | | let _quot = values.sql.match(/'{1}/g) |
| | | let _lparen = values.sql.match(/\({1}/g) |
| | | let _rparen = values.sql.match(/\){1}/g) |
| | |
| | | let _backCustomScript = '' // 默认sql后执行脚本 |
| | | |
| | | this.props.customScripts.forEach(item => { |
| | | if (item.status === 'false' && values.uuid !== item.uuid) return |
| | | |
| | | let _item = values.uuid === item.uuid ? values : item |
| | | |
| | | if (_item.status === 'false') return |
| | | |
| | | if (_item.position === 'init') { |
| | | _initCustomScript += ` |
| | | /* 初始化脚本 */ |
| | |
| | | } else { |
| | | resolve(result) |
| | | } |
| | | }) |
| | | }, this.netError) |
| | | }) |
| | | } else { |
| | | resolve({status: true}) |
| | |
| | | } |
| | | return Api.getSystemConfig(_param) |
| | | } |
| | | }).then(res => { // 页面按钮关系保存 |
| | | }, this.netError).then(res => { // 页面按钮关系保存 |
| | | if (!res || !res.status) return res |
| | | |
| | | this.setState({ |
| | |
| | | status: true |
| | | } |
| | | } |
| | | }).then(res => { |
| | | }, this.netError).then(res => { |
| | | this.setState({ |
| | | menuloading: false |
| | | }) |
| | |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }, this.netError) |
| | | }, 300 + (+sessionStorage.getItem('mkDelay'))) |
| | | } |
| | | |
| | | netError = (error) => { |
| | | this.setState({ |
| | | menuloading: false |
| | | }) |
| | | if (!error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '保存失败,请检查网络是否正常。', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | getRoleFields = () => { |
| | | if (sessionStorage.getItem('sysRoles')) return |
| | | |
| | |
| | | } |
| | | |
| | | resolve(result) |
| | | }) |
| | | }, this.netError) |
| | | } else { |
| | | resolve(res) |
| | | } |
| | | } else { |
| | | resolve(res) |
| | | } |
| | | }) |
| | | }, this.netError) |
| | | } |
| | | } |
| | | }).then(res => { // 页面保存 |
| | |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }, this.netError) |
| | | }, 300 + (+sessionStorage.getItem('mkDelay'))) |
| | | } |
| | | |
| | | netError = (error) => { |
| | | this.setState({ |
| | | menuloading: false |
| | | }) |
| | | if (!error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '保存失败,请检查网络是否正常。', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | getRoleFields = () => { |
| | | if (sessionStorage.getItem('sysRoles')) return |
| | | |
| | |
| | | } |
| | | |
| | | resolve(result) |
| | | }) |
| | | }, this.netError) |
| | | } else { |
| | | resolve(res) |
| | | } |
| | | } else { |
| | | resolve(res) |
| | | } |
| | | }) |
| | | }, this.netError) |
| | | } |
| | | } |
| | | }).then(res => { // 页面保存 |
| | |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }, this.netError) |
| | | }, 300 + (+sessionStorage.getItem('mkDelay'))) |
| | | } |
| | | |
| | | netError = (error) => { |
| | | this.setState({ |
| | | menuloading: false |
| | | }) |
| | | if (!error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '保存失败,请检查网络是否正常。', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | getRoleFields = () => { |
| | | if (sessionStorage.getItem('sysRoles') || sessionStorage.getItem('permFuncField')) return |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | |
| | | new Promise(resolve => { |
| | | Api.getSystemConfig(param).then(res => { |
| | | resolve(res) |
| | | }) |
| | | }, this.netError) |
| | | }).then(res => { |
| | | if (!res || !res.status) return res |
| | | |
| | |
| | | duration: 5 |
| | | }) |
| | | } |
| | | }) |
| | | }, this.netError) |
| | | }, 300 + (+sessionStorage.getItem('mkDelay'))) |
| | | } |
| | | |
| | | netError = (error) => { |
| | | this.setState({ |
| | | menuloading: false |
| | | }) |
| | | if (!error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '保存失败,请检查网络是否正常。', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | } |
| | | |
| | | getRoleFields = () => { |
| | | if (sessionStorage.getItem('sysRoles')) return |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |