| | |
| | | } |
| | | |
| | | /** |
| | | * @description 微信业务请求 |
| | | * @description 微信业务请求 原接口 'wxpay/getaccesstoken' |
| | | */ |
| | | wxAccessToken (domain = '') { |
| | | let _url = window.GLOB.baseurl + 'wxpay/getaccesstoken' |
| | | let _url = domain || window.GLOB.baseurl |
| | | |
| | | if (domain) { |
| | | _url = domain + 'wxpay/getaccesstoken' |
| | | if (/qingqiumarket.cn|cloud.mk9h.cn/.test(_url)) { |
| | | _url = _url.replace('http://qingqiumarket.cn', 'http://qingqiumarket.cn:8080') |
| | | _url = _url.replace('http://cloud.mk9h.cn', 'http://cloud.mk9h.cn:8080') |
| | | _url = _url.replace('https://qingqiumarket.cn', 'https://qingqiumarket.cn:8443') |
| | | _url = _url.replace('https://cloud.mk9h.cn', 'https://cloud.mk9h.cn:8443') |
| | | } |
| | | |
| | | return new Promise(resolve => { |
| | |
| | | } else { |
| | | window.GLOB.accessToken = {domain} |
| | | axios({ |
| | | url: _url, |
| | | method: 'get' |
| | | url: _url + 'wechat/jsapi/getaccesstoken', |
| | | method: 'post', |
| | | headers: { 'Content-Type': 'application/json' }, |
| | | data: JSON.stringify({appId: 'wx4d8a34c8d4494872'}) |
| | | }).then(res => { |
| | | if (res.oa_access_token) { |
| | | window.GLOB.accessToken.accessTime = parseInt(new Date().getTime() / 1000) |
| | |
| | | |
| | | /** |
| | | * @description 微信业务请求 |
| | | * 39上 qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn |
| | | */ |
| | | wxNginxRequest (url, method, param) { |
| | | let _url = url |
| | |
| | | if (process.env.NODE_ENV === 'production') { |
| | | _url = document.location.origin + '/' + url |
| | | } |
| | | if (/^http:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) { |
| | | _url = window.GLOB.location + ':8080/' + url |
| | | if (process.env.NODE_ENV === 'production') { |
| | | _url = document.location.origin + ':8080/' + url |
| | | } |
| | | } else if (/^https:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) { |
| | | _url = window.GLOB.location + ':8443/' + url |
| | | if (process.env.NODE_ENV === 'production') { |
| | | _url = document.location.origin + ':8443/' + url |
| | | } |
| | | if (/qingqiumarket.cn|cloud.mk9h.cn/.test(_url)) { |
| | | _url = _url.replace('http://qingqiumarket.cn', 'http://qingqiumarket.cn:8080') |
| | | _url = _url.replace('http://cloud.mk9h.cn', 'http://cloud.mk9h.cn:8080') |
| | | _url = _url.replace('https://qingqiumarket.cn', 'https://qingqiumarket.cn:8443') |
| | | _url = _url.replace('https://cloud.mk9h.cn', 'https://cloud.mk9h.cn:8443') |
| | | } |
| | | } |
| | | |
| | |
| | | if (process.env.NODE_ENV === 'production') { |
| | | _url = document.location.origin + '/file/oss/upload' |
| | | } |
| | | if (/^http:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) { |
| | | _url = window.GLOB.location + ':8080/file/oss/upload' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | _url = document.location.origin + ':8080/file/oss/upload' |
| | | } |
| | | } else if (/^https:\/\/(qingqiumarket.cn|cloud.mk9h.cn|sso.mk9h.cn)/.test(_url)) { |
| | | _url = window.GLOB.location + ':8443/file/oss/upload' |
| | | if (process.env.NODE_ENV === 'production') { |
| | | _url = document.location.origin + ':8443/file/oss/upload' |
| | | } |
| | | if (/qingqiumarket.cn|cloud.mk9h.cn/.test(_url)) { |
| | | _url = _url.replace('http://qingqiumarket.cn', 'http://qingqiumarket.cn:8080') |
| | | _url = _url.replace('http://cloud.mk9h.cn', 'http://cloud.mk9h.cn:8080') |
| | | _url = _url.replace('https://qingqiumarket.cn', 'https://qingqiumarket.cn:8443') |
| | | _url = _url.replace('https://cloud.mk9h.cn', 'https://cloud.mk9h.cn:8443') |
| | | } |
| | | |
| | | return axios({ |
| | |
| | | import React from 'react' |
| | | import ReactDOM from 'react-dom' |
| | | import { ConfigProvider } from 'antd' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | |
| | | import Route from './router' |
| | | import md5 from 'md5' |
| | | import * as serviceWorker from './serviceWorker' |
| | |
| | | } |
| | | return uuid.join('') |
| | | })()) |
| | | } |
| | | |
| | | const render = Component => { |
| | | ReactDOM.render( |
| | | <Component/>, |
| | | document.getElementById('root') |
| | | ) |
| | | } |
| | | |
| | | fetch('../options.json') |
| | |
| | | window.GLOB.SyncData = new Map() // 存储同步查询数据 |
| | | window.GLOB.mkThdMenus = new Map() // 三级菜单 |
| | | |
| | | render(Route) |
| | | if (lang === 'zh-CN' || !/#\/(login|main|billprint|docprint|tab|iframe|view|ssologin)/.test(window.location.href)) { // 开发使用中文 |
| | | ReactDOM.render( |
| | | <ConfigProvider locale={zhCN}> |
| | | <Route/> |
| | | </ConfigProvider>, |
| | | document.getElementById('root') |
| | | ) |
| | | } else { |
| | | ReactDOM.render( |
| | | <Route/>, |
| | | document.getElementById('root') |
| | | ) |
| | | } |
| | | |
| | | }) |
| | | |
| | | serviceWorker.unregister() |
| | |
| | | changeOrigin: true |
| | | })) |
| | | |
| | | app.use(proxy('/wechat', { |
| | | target: `${options.host}/${options.service}`, |
| | | secure: false, |
| | | changeOrigin: true |
| | | })) |
| | | |
| | | // app.use(proxy('/trans', { |
| | | // target: `${host}/${service}`, |
| | | // secure: false, |
| | |
| | | |
| | | if (cell.OpenType === 'excelOut') { // 导出 |
| | | cell.$menuName = item.$menuname |
| | | |
| | | if (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0) { |
| | | cell.errorType = 'error1' |
| | | } else if (cell.intertype === 'system' && cell.verify.dataType !== 'custom' && item.setting.interType !== 'system') { |
| | | cell.errorType = 'error2' |
| | | } |
| | | } |
| | | |
| | | if (cell.verify) { |
| | |
| | | |
| | | if (item.OpenType === 'excelOut') { // 导出 |
| | | item.$menuName = MenuName |
| | | |
| | | if (!item.verify || !item.verify.columns || item.verify.columns.length === 0) { |
| | | item.errorType = 'error1' |
| | | } else if (item.intertype === 'system' && item.verify.dataType !== 'custom' && config.setting.interType !== 'system') { |
| | | item.errorType = 'error2' |
| | | } |
| | | } |
| | | |
| | | if (item.verify && item.verify.invalid === 'true') { |
| | |
| | | MKEmitter.emit('resetSelectLine', config.uuid, last ? last.$$uuid : '', last) |
| | | MKEmitter.emit('syncBalconyData', config.uuid, items, data.length > 0 && data.length === keys.length) |
| | | if (items.length === 0) { |
| | | message.warning('未获取到数据!') |
| | | message.warning(window.GLOB.dict['no_data'] || '未获取到数据!') |
| | | } |
| | | } else { |
| | | this.setState({ |
| | |
| | | selectedData={selectedData} |
| | | /> : null |
| | | } |
| | | {config.wrap.pickup === 'true' && this.state.data.length > 0 ? <div className="pickup-wrap"><Switch title="收起" checkedChildren="开" unCheckedChildren="关" checked={pickup} onChange={this.pickupChange} /></div> : null} |
| | | {config.wrap.pickup === 'true' && this.state.data.length > 0 ? <div className="pickup-wrap"><Switch title="收起" checkedChildren={window.GLOB.dict['open'] || '开'} unCheckedChildren={window.GLOB.dict['shut'] || '关'} checked={pickup} onChange={this.pickupChange} /></div> : null} |
| | | <div className={`data-zoom ${config.wrap.wrapClass}`}> |
| | | {switchable ? <div className={'prev-page ' + (pageIndex === 1 ? 'disabled' : '')} onClick={this.prevPage}><div><div><img src={preImg} alt=""/></div></div></div> : null} |
| | | <Row className={'card-row-list ' + config.wrap.layout} style={{maxHeight: config.wrap.zHeight}}> |
| | |
| | | {switchable ? <div className={'prev-page ' + (total <= _total ? 'disabled' : '')} onClick={this.nextPage}><div><div><img src={nextImg} alt=""/></div></div></div> : null} |
| | | </div> |
| | | {config.$empty && data.length === 0 ? <Empty description={false}/> : null} |
| | | {config.wrap.pagestyle === 'page' ? <Pagination size="small" total={total} showTotal={(t, range) => total > 0 ? `${range[0]}-${range[1]} 共 ${total} 条` : `共 ${total} 条`} pageSize={pageSize} showSizeChanger={true} pageSizeOptions={this.state.pageOptions} onChange={this.changePageIndex} onShowSizeChange={this.pageSizeChange} current={pageIndex}/> : null} |
| | | {config.wrap.pagestyle === 'more' && data.length > 0 ? <div className={'mk-more' + (pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>查看更多<DownOutlined/></div> : null} |
| | | {config.wrap.pagestyle === 'page' ? <Pagination size="small" total={total} showTotal={(t, range) => total > 0 ? `${range[0]}-${range[1]} ${window.GLOB.dict['of'] || '共'} ${total} ${window.GLOB.dict['items'] || '条'}` : `${total} ${window.GLOB.dict['items'] || '条'}`} pageSize={pageSize} showSizeChanger={true} pageSizeOptions={this.state.pageOptions} onChange={this.changePageIndex} onShowSizeChange={this.pageSizeChange} current={pageIndex}/> : null} |
| | | {config.wrap.pagestyle === 'more' && data.length > 0 ? <div className={'mk-more' + (pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>{window.GLOB.dict['view_more'] || '查看更多'}<DownOutlined/></div> : null} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | selectedData={selectedData} |
| | | /> : null |
| | | } |
| | | {config.wrap.pickup === 'true' && this.state.data.length > 0 ? <div className="pickup-wrap"><Switch title="收起" checkedChildren="开" unCheckedChildren="关" checked={pickup} onChange={this.pickupChange} /></div> : null} |
| | | {config.wrap.pickup === 'true' && this.state.data.length > 0 ? <div className="pickup-wrap"><Switch title="收起" checkedChildren={window.GLOB.dict['open'] || '开'} unCheckedChildren={window.GLOB.dict['shut'] || '关'} checked={pickup} onChange={this.pickupChange} /></div> : null} |
| | | <div className={config.wrap.zoomStyle ? 'data-zoom-box' : ''} style={config.wrap.zoomStyle}> |
| | | <div className={`data-zoom ${config.wrap.wrapClass}`}> |
| | | <Row className="card-row-list"> |
| | |
| | | </div> |
| | | {config.$empty && data.length === 0 ? <Empty description={false}/> : null} |
| | | </div> |
| | | {config.wrap.pagestyle === 'page' ? <Pagination size="small" total={total} showTotal={(t, range) => total > 0 ? `${range[0]}-${range[1]} 共 ${total} 条` : `共 ${total} 条`} pageSize={pageSize} showSizeChanger={true} pageSizeOptions={this.state.pageOptions} onChange={this.changePageIndex} onShowSizeChange={this.pageSizeChange} current={pageIndex}/> : null} |
| | | {config.wrap.pagestyle === 'more' && data.length > 0 ? <div className={'mk-more' + (pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>查看更多<DownOutlined/></div> : null} |
| | | {config.wrap.pagestyle === 'page' ? <Pagination size="small" total={total} showTotal={(t, range) => total > 0 ? `${range[0]}-${range[1]} ${window.GLOB.dict['of'] || '共'} ${total} ${window.GLOB.dict['items'] || '条'}` : `${total} ${window.GLOB.dict['items'] || '条'}`} pageSize={pageSize} showSizeChanger={true} pageSizeOptions={this.state.pageOptions} onChange={this.changePageIndex} onShowSizeChange={this.pageSizeChange} current={pageIndex}/> : null} |
| | | {config.wrap.pagestyle === 'more' && data.length > 0 ? <div className={'mk-more' + (pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>{window.GLOB.dict['view_more'] || '查看更多'}<DownOutlined/></div> : null} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | {data && data.length === 0 ? <Empty description={false}/> : null} |
| | | </Row> |
| | | {config.wrap.pagestyle === 'page' ? <Pagination size="small" current={pageIndex} total={total} onChange={this.changePageIndex} /> : null} |
| | | {config.wrap.pagestyle === 'more' && data && data.length > 0 ? <div className={'mk-more' + (config.setting.pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>查看更多<DownOutlined/></div> : null} |
| | | {config.wrap.pagestyle === 'more' && data && data.length > 0 ? <div className={'mk-more' + (config.setting.pageSize * pageIndex >= total ? ' disabled' : '')} onClick={this.loadMore}>{window.GLOB.dict['view_more'] || '查看更多'}<DownOutlined/></div> : null} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | MKEmitter.emit('resetSelectLine', MenuID, '', '') |
| | | MKEmitter.emit('syncBalconyData', MenuID, data, data.length > 0) |
| | | if (data.length === 0) { |
| | | message.warning('未获取到数据!') |
| | | message.warning(window.GLOB.dict['no_data'] || '未获取到数据!') |
| | | } |
| | | } else { |
| | | this.setState({ |
| | |
| | | pageSizeOptions: pageOptions, |
| | | showSizeChanger: true, |
| | | total: this.props.total || 0, |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条` |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} ${window.GLOB.dict['of'] || '共'} ${total} ${window.GLOB.dict['items'] || '条'}` |
| | | } |
| | | } |
| | | |
| | |
| | | return ( |
| | | <div className={`normal-custom-table ${setting.tableHeader || ''} ${setting.parity === 'true' ? 'mk-parity' : ''} ${height ? 'fixed-table-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || 'middle'} table-col-${columns.length} ${fixed}`} style={style}> |
| | | {(setting.tableType === 'radio' || setting.tableType === 'checkbox') && data && data.length > 0 ? |
| | | <Switch title="收起" className="main-pickup" checkedChildren="开" unCheckedChildren="关" checked={pickup} onChange={this.pickupChange} /> : null |
| | | <Switch title="收起" className="main-pickup" checkedChildren={window.GLOB.dict['open'] || '开'} unCheckedChildren={window.GLOB.dict['shut'] || '关'} checked={pickup} onChange={this.pickupChange} /> : null |
| | | } |
| | | <Table |
| | | components={components} |
| | |
| | | allColumns: null, |
| | | checkForms: [], |
| | | allForms: [], |
| | | reseting: false |
| | | reseting: false, |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | timer = null |
| | |
| | | } |
| | | |
| | | checkLine = () => { |
| | | const { edData, forms, checkForms } = this.state |
| | | const { edData, forms, checkForms, dict } = this.state |
| | | |
| | | let data = edData.filter(item => item.$$uuid === this.blurId)[0] |
| | | |
| | |
| | | if (col.type === 'text') { |
| | | let val = record[col.field] !== undefined ? (record[col.field] + '') : '' |
| | | if (col.required === 'true' && !val) { |
| | | err = `${col.label}不可为空` |
| | | err = `${col.label}${dict['not_empty'] || '不可为空'}` |
| | | } else if (col.datatype === 'datetime' && !val) { |
| | | val = '1949-10-01' |
| | | } |
| | |
| | | let val = record[col.field] |
| | | |
| | | if (col.required === 'true' && !val) { |
| | | err = `${col.label}不可为${col.noValue === 'hide' ? '空' : '0'}` |
| | | err = `${col.label}${col.noValue === 'hide' ? (dict['not_empty'] || '不可为空') : dict['not_zero'] || '不可为0'}` |
| | | } else if (col.noValue === 'hide' && !val) { |
| | | if (col.clearField && checkForms.includes(col.clearField) && !record[col.clearField]) { |
| | | err = `请填写 ${col.label} 或 ${col.clearName}` |
| | | err = `${dict['input_tip'] || '请填写 '}${col.label} ${dict['or'] || '或'} ${col.clearName}` |
| | | } |
| | | val = 0 |
| | | } else if (!val && val !== 0) { |
| | | err = `${col.label}不可为空` |
| | | err = `${col.label}${dict['not_empty'] || '不可为空'}` |
| | | } else { |
| | | val = +val |
| | | if (isNaN(val)) { |
| | | err = `${col.label}数据格式错误` |
| | | err = `${col.label} ${dict['data_format'] || '数据格式错误'}` |
| | | return |
| | | } |
| | | |
| | | val = +val.toFixed(col.decimal || 0) |
| | | |
| | | if (typeof(col.max) === 'number' && val > col.max) { |
| | | err = `${col.label}不可大于${col.max}` |
| | | err = `${col.label}${dict['max_limit'] || ' 不可大于 '}${col.max}` |
| | | } else if (typeof(col.min) === 'number' && val < col.min) { |
| | | err = `${col.label}不可小于${col.min}` |
| | | err = `${col.label}${dict['less_limit'] || ' 不可小于 '}${col.min}` |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | checkData = () => { |
| | | const { setting } = this.props |
| | | const { edData, forms, checkForms, selectedRowKeys } = this.state |
| | | const { edData, forms, checkForms, selectedRowKeys, dict } = this.state |
| | | |
| | | let data = fromJS(edData).toJS() |
| | | |
| | |
| | | if (data.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择需要提交的数据!', |
| | | message: dict['select_row'] || '请选择需要提交的数据!', |
| | | duration: 5 |
| | | }) |
| | | return null |
| | |
| | | if (data.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '数据未修改,不可提交!', |
| | | message: dict['un_modified'] || '数据未修改,不可提交!', |
| | | duration: 5 |
| | | }) |
| | | return null |
| | |
| | | if (col.type === 'text') { |
| | | let val = item[col.field] !== undefined ? (item[col.field] + '') : '' |
| | | if (col.required === 'true' && !val) { |
| | | line.push(`${col.label}不可为空`) |
| | | line.push(`${col.label}${dict['not_empty'] || '不可为空'}`) |
| | | } else if (col.datatype === 'datetime' && !val) { |
| | | val = '1949-10-01' |
| | | } |
| | |
| | | } else if (col.type === 'number') { |
| | | let val = item[col.field] |
| | | if (col.required === 'true' && !val) { |
| | | err = `${col.label}不可为${col.noValue === 'hide' ? '空' : '0'}` |
| | | err = `${col.label}${col.noValue === 'hide' ? (dict['not_empty'] || '不可为空') : dict['not_zero'] || '不可为0'}` |
| | | } else if (col.noValue === 'hide' && !val) { |
| | | if (col.clearField && checkForms.includes(col.clearField) && !item[col.clearField]) { |
| | | let msg = `请填写 ${col.label} 或 ${col.clearName}` |
| | | let msg = `${dict['input_tip'] || '请填写 '}${col.label} ${dict['or'] || '或'} ${col.clearName}` |
| | | if (!line.includes(msg)) { |
| | | line.push(msg) |
| | | } |
| | | } |
| | | val = 0 |
| | | } else if (!val && val !== 0) { |
| | | line.push(`${col.label}不可为空`) |
| | | line.push(`${col.label}${dict['not_empty'] || '不可为空'}`) |
| | | return |
| | | } else { |
| | | val = +val |
| | | if (isNaN(val)) { |
| | | line.push(`${col.label}数据格式错误`) |
| | | line.push(`${col.label} ${dict['data_format'] || '数据格式错误'}`) |
| | | return |
| | | } |
| | | |
| | | val = +val.toFixed(col.decimal || 0) |
| | | |
| | | if (typeof(col.max) === 'number' && val > col.max) { |
| | | line.push(`${col.label}不可大于${col.max}`) |
| | | line.push(`${col.label}${dict['max_limit'] || ' 不可大于 '}${col.max}`) |
| | | } else if (typeof(col.min) === 'number' && val < col.min) { |
| | | line.push(`${col.label}不可小于${col.min}`) |
| | | line.push(`${col.label}${dict['less_limit'] || ' 不可小于 '}${col.min}`) |
| | | } |
| | | } |
| | | |
| | |
| | | }) |
| | | |
| | | if (line.length > 0) { |
| | | err += `第${Index}行:` + line.join(',') + ';' |
| | | err += (dict['line'] ? `${dict['line']} ${Index}:` : `第${Index}行:`) + line.join(',') + ';' |
| | | } |
| | | if (!item.$deleted) { |
| | | Index++ |
| | |
| | | |
| | | submit = (record) => { |
| | | const { submit, BID, setting } = this.props |
| | | const { forms } = this.state |
| | | const { forms, dict } = this.state |
| | | |
| | | this.setState({visible: false, midData: null}) |
| | | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '需要上级主键值!', |
| | | message: dict['sup_key_req'] || '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | |
| | |
| | | |
| | | execSuccess = (res, record) => { |
| | | const { submit } = this.props |
| | | const { edData } = this.state |
| | | const { edData, dict } = this.state |
| | | |
| | | if (res && res.ErrCode === 'S') { // 执行成功 |
| | | notification.success({ |
| | | top: 92, |
| | | message: res.message || '执行成功', |
| | | message: res.message || dict['exc_success'] || '执行成功', |
| | | duration: submit.stime ? submit.stime : 2 |
| | | }) |
| | | } else if (res && res.ErrCode === 'Y') { // 执行成功 |
| | | Modal.success({ |
| | | title: res.message || '执行成功' |
| | | title: res.message || dict['exc_success'] || '执行成功', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | } else if (res && res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | |
| | | |
| | | execError = (res, record) => { |
| | | const { submit } = this.props |
| | | const { dict } = this.state |
| | | |
| | | if (res.ErrCode === 'E') { |
| | | Modal.error({ |
| | | title: res.message || '执行失败!', |
| | | title: res.message || dict['exc_fail'] || '执行失败!', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: submit.ntime ? submit.ntime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: submit.ftime ? submit.ftime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || '执行失败!') |
| | | message.error(res.message || dict['exc_fail'] || '执行失败!') |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | |
| | | render() { |
| | | const { setting, lineMarks, submit } = this.props |
| | | const { edData, columns, loading, pageOptions, selectedRowKeys, visible, midData, reseting } = this.state |
| | | const { edData, columns, loading, pageOptions, selectedRowKeys, visible, midData, reseting, dict } = this.state |
| | | |
| | | if (reseting) return null |
| | | |
| | |
| | | pageSizeOptions: pageOptions, |
| | | showSizeChanger: true, |
| | | total: this.props.total || 0, |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条` |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} ${dict['of'] || '共'} ${total} ${dict['items'] || '条'}` |
| | | } |
| | | } |
| | | |
| | |
| | | return ( |
| | | <> |
| | | {setting.hasSubmit && edData.length > 0 ? <div className="edit-custom-table-btn-wrap" style={submit.wrapStyle}> |
| | | <Button style={submit.style} onClick={() => setTimeout(() => {this.submit()}, 10)} loading={loading} className="submit-table" type="link">提交</Button> |
| | | <Button style={submit.style} onClick={() => setTimeout(() => {this.submit()}, 10)} loading={loading} className="submit-table" type="link">{dict['submit'] || '提交'}</Button> |
| | | </div> : null} |
| | | <div className={`edit-custom-table ${setting.tableHeader || ''} ${setting.parity === 'true' ? 'mk-parity' : ''} ${height ? 'fixed-table-height' : ''} ${setting.mode || ''} table-vertical-${setting.vertical || ''} mk-edit-${setting.editType || 'simple'}`} style={style}> |
| | | <Table |
| | |
| | | onChange={this.changeTable} |
| | | pagination={_pagination} |
| | | /> |
| | | {setting.hasSubmit && _data.length > 10 ? <Button style={submit.style} onClick={() => setTimeout(() => {this.submit()}, 10)} loading={loading} className="submit-footer-table" type="link">提交</Button> : null} |
| | | {setting.hasSubmit && _data.length > 10 ? <Button style={submit.style} onClick={() => setTimeout(() => {this.submit()}, 10)} loading={loading} className="submit-footer-table" type="link">{dict['submit'] || '提交'}</Button> : null} |
| | | </div> |
| | | <Modal |
| | | className="mk-user-confirm" |
| | |
| | | maskClosable={false} |
| | | closable={false} |
| | | footer={[ |
| | | <Button key="cancel" onClick={() => { this.setState({ visible: false, midData: null }) }}>取消</Button>, |
| | | <Button key="refresh" className="table-refresh" onClick={() => { midData && this.updateMutil(midData) }}>刷新表格</Button>, |
| | | <Button key="confirm" type="primary" onClick={() => setTimeout(() => {this.submit()}, 10)}>提交数据</Button> |
| | | <Button key="cancel" onClick={() => { this.setState({ visible: false, midData: null }) }}>{dict['cancel'] || '取消'}</Button>, |
| | | <Button key="refresh" className="table-refresh" onClick={() => { midData && this.updateMutil(midData) }}>{dict['refresh'] || '刷新表格'}</Button>, |
| | | <Button key="confirm" type="primary" onClick={() => setTimeout(() => {this.submit()}, 10)}>{dict['submit'] || '提交数据'}</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | | <div><QuestionCircleOutlined />表格中有数据尚未提交</div> |
| | | <div><QuestionCircleOutlined />{dict['data_not_sub'] || '表格中有数据尚未提交'}</div> |
| | | </Modal> |
| | | </> |
| | | ) |
| | |
| | | |
| | | if (cell.OpenType === 'excelOut') { // 导出 |
| | | cell.$menuName = item.$menuname |
| | | |
| | | if (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0) { |
| | | cell.errorType = 'error1' |
| | | } else if (cell.intertype === 'system' && cell.verify.dataType !== 'custom') { |
| | | if (item.setting.interType !== 'system') { |
| | | cell.errorType = 'error2' |
| | | } else if (item.type === 'balcony' || item.subtype === 'propcard') { |
| | | cell.errorType = 'error2' |
| | | } |
| | | } |
| | | } else if (cell.OpenType === 'pop' && item.$cache && item.$time && cell.modal) { |
| | | cell.modal.$cache = item.$cache |
| | | cell.modal.$time = item.$time |
| | |
| | | |
| | | if (cell.OpenType === 'excelOut') { // 导出 |
| | | cell.$menuName = item.$menuname |
| | | |
| | | if (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0) { |
| | | cell.errorType = 'error1' |
| | | } else if (cell.intertype === 'system' && cell.verify.dataType !== 'custom') { |
| | | if (item.setting.interType !== 'system') { |
| | | cell.errorType = 'error2' |
| | | } else if (item.type === 'balcony' || item.subtype === 'propcard') { |
| | | cell.errorType = 'error2' |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (cell.verify) { |
| | |
| | | |
| | | if (item.OpenType === 'excelOut') { // 导出 |
| | | item.$menuName = Tab.label |
| | | |
| | | if (!item.verify || !item.verify.columns || item.verify.columns.length === 0) { |
| | | item.errorType = 'error1' |
| | | } else if (item.intertype === 'system' && item.verify.dataType !== 'custom' && config.setting.interType !== 'system') { |
| | | item.errorType = 'error2' |
| | | } |
| | | } |
| | | |
| | | if (item.verify && item.verify.invalid === 'true') { |
| | |
| | | |
| | | if (item.OpenType === 'excelOut') { // 导出 |
| | | item.$menuName = Tab.label |
| | | |
| | | if (!item.verify || !item.verify.columns || item.verify.columns.length === 0) { |
| | | item.errorType = 'error1' |
| | | } else if (item.intertype === 'system' && item.verify.dataType !== 'custom' && config.setting.interType !== 'system') { |
| | | item.errorType = 'error2' |
| | | } |
| | | } |
| | | |
| | | if (item.verify && item.verify.invalid === 'true') { |
| | |
| | | // 需要选择单行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择单行数据!', |
| | | message: window.GLOB.dict['select_single_row'] || '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | param[setting.primaryKey] = primaryId |
| | | |
| | | confirm({ |
| | | title: '确定要执行吗?', |
| | | title: window.GLOB.dict['exec_sure'] || '确定要执行吗?', |
| | | okText: window.GLOB.dict['ok'] || '确定', |
| | | cancelText: window.GLOB.dict['cancel'] || '取消', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | Api.genericInterface(param).then(res => { |
| | |
| | | disabled: false, |
| | | hidden: false, |
| | | primaryId: '', |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | */ |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { setting, BID, btn, selectedData, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | const { loading, disabled, dict } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '需要上级主键值!', |
| | | message: dict['sup_key_req'] || '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | } else if (btn.Ot === 'requiredSgl' && data.length !== 1) { |
| | | // 需要选择单行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | } else if (!btn.verify || !btn.verify.sheet || !btn.verify.columns || btn.verify.columns.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'excel导入验证信息未设置!', |
| | | message: dict['select_single_row'] || '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | |
| | | */ |
| | | execSuccess = (res = {}) => { |
| | | const { btn } = this.props |
| | | const { dict } = this.state |
| | | |
| | | if (res.ErrCode === 'S' || !res.ErrCode) { // 执行成功 |
| | | notification.success({ |
| | | top: 92, |
| | | message: res.message || '执行成功!', |
| | | message: res.message || dict['exc_success'] || '执行成功!', |
| | | duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 |
| | | }) |
| | | } else if (res.ErrCode === 'Y') { // 执行成功 |
| | | Modal.success({ |
| | | title: res.message || '执行成功!' |
| | | title: res.message || dict['exc_success'] || '执行成功!', |
| | | okText: dict['got_it'] || '知道了', |
| | | }) |
| | | } else if (res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | |
| | | */ |
| | | execError = (res = {}) => { |
| | | const { btn } = this.props |
| | | const { dict } = this.state |
| | | |
| | | if (!['LoginError', 'C', '-2', 'E', 'N', 'F', 'NM'].includes(res.ErrCode)) { |
| | | res.ErrCode = 'E' |
| | |
| | | |
| | | if (res.ErrCode === 'E') { |
| | | Modal.error({ |
| | | title: res.message || '执行失败!', |
| | | title: res.message || dict['exc_fail'] || '执行失败!', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || '执行失败!') |
| | | message.error(res.message || dict['exc_fail'] || '执行失败!') |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } else if (res.ErrCode === 'C') { |
| | | const _this = this |
| | | confirm({ |
| | | title: '请确认', |
| | | title: window.GLOB.dict['exec_sure'] || '请确认', |
| | | content: res.message, |
| | | okText: window.GLOB.dict['ok'] || '确定', |
| | | cancelText: window.GLOB.dict['cancel'] || '取消', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | Api.genericInterface(unCheckParam).then(result => { |
| | |
| | | } |
| | | |
| | | state = { |
| | | loading: false, // 导出中 |
| | | loading: false, |
| | | hidden: false, |
| | | disabled: false |
| | | disabled: false, |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | */ |
| | | actionTrigger = (triggerId, _, type, lid) => { |
| | | const { setting, BID, btn, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | const { loading, disabled, dict } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | } else if (btn.errorType === 'error1') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请设置导出列!', |
| | | duration: 5 |
| | | }) |
| | | } else if (btn.errorType === 'error2') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '按钮需自定义导出数据源!', |
| | | message: dict['sup_key_req'] || '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | |
| | | if (!valid) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '搜索条件不可为空!', |
| | | message: window.GLOB.dict['miss_search'] || '搜索条件不可为空!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | Api.genericInterface(res).then(result => { |
| | | if (result.status) { |
| | | if (!result.data) { |
| | | this.execError({ErrCode: 'N', message: '未获取到数据信息!'}) |
| | | this.execError({ErrCode: 'N', message: window.GLOB.dict['no_data'] || '未获取到数据信息!'}) |
| | | } else if (result.data.length >= pageSize) { |
| | | data = data.concat(result.data) |
| | | pageIndex++ |
| | |
| | | Api.genericInterface(param).then(result => { |
| | | if (result.status) { |
| | | if (!result.data) { |
| | | this.execError({ErrCode: 'N', message: '未获取到数据信息!'}) |
| | | this.execError({ErrCode: 'N', message: window.GLOB.dict['no_data'] || '未获取到数据信息!'}) |
| | | } else if (result.data.length >= pageSize) { |
| | | data = data.concat(result.data) |
| | | pageIndex++ |
| | |
| | | */ |
| | | exportExcel = (data = [], ErrCode, msg, search) => { |
| | | const { btn } = this.props |
| | | const { dict } = this.state |
| | | |
| | | let imgCol = false |
| | | let merge = false |
| | |
| | | if (errors.length) { |
| | | notification.error({ |
| | | top: 92, |
| | | message: '数据中缺少字段:' + errors.join('、'), |
| | | message: (dict['miss_field'] || '数据中缺少字段') + ':' + errors.join('、'), |
| | | duration: 5 |
| | | }) |
| | | |
| | |
| | | // eslint-disable-next-line |
| | | let func = new Function('XLSX', 'data', 'columns', 'searches', 'callback', btn.verify.excel_func) |
| | | func(XLSX, data, columns, search, (res) => { |
| | | res = res || {ErrCode: ErrCode || 'S', message: msg || '导出成功!'} |
| | | res = res || {ErrCode: ErrCode || 'S', message: msg || dict['exc_success'] || '导出成功!'} |
| | | this.execSuccess(res) |
| | | }) |
| | | } else if (imgCol) { |
| | |
| | | |
| | | this.table2excel(column, table) |
| | | |
| | | this.execSuccess({ErrCode: ErrCode || 'S', message: msg || '导出成功!'}) |
| | | this.execSuccess({ErrCode: ErrCode || 'S', message: msg || dict['exc_success'] || '导出成功!'}) |
| | | } else { |
| | | let table = [] |
| | | let _header = [] |
| | |
| | | |
| | | XLSX.writeFile(wb, `${btn.verify.excelName || btn.$menuName || ''}${moment().format('YYYYMMDDHHmmss')}.xlsx`) |
| | | |
| | | this.execSuccess({ErrCode: ErrCode || 'S', message: msg || '导出成功!'}) |
| | | this.execSuccess({ErrCode: ErrCode || 'S', message: msg || dict['exc_success'] || '导出成功!'}) |
| | | } |
| | | } catch (e) { |
| | | console.warn(e) |
| | |
| | | }) |
| | | } else if (res.ErrCode === 'Y') { // 执行成功 |
| | | Modal.success({ |
| | | title: res.message |
| | | title: res.message, |
| | | okText: window.GLOB.dict['got_it'] || '知道了' |
| | | }) |
| | | } else if (res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | |
| | | */ |
| | | execError = (res = {}) => { |
| | | const { btn } = this.props |
| | | const { dict } = this.state |
| | | |
| | | if (!['LoginError', 'C', '-2', 'E', 'N', 'F', 'NM'].includes(res.ErrCode)) { |
| | | res.ErrCode = 'E' |
| | |
| | | |
| | | if (res.ErrCode === 'E') { |
| | | Modal.error({ |
| | | title: res.message || '执行失败!', |
| | | title: res.message || dict['exc_fail'] || '执行失败!', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || '执行失败!') |
| | | message.error(res.message || dict['exc_fail'] || '执行失败!') |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | loading: false, |
| | | disabled: false, |
| | | hidden: false, |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | */ |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { btn, BID, selectedData, LID } = this.props |
| | | const { loading } = this.state |
| | | const { loading, dict } = this.state |
| | | |
| | | if (loading) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | |
| | | let error = '' |
| | | |
| | | if (btn.funcType === 'shareLink' && window.GLOB.systemType === 'production' && !btn.shareProUrl) { |
| | | error = '尚未设置正式系统链接地址!' |
| | | error = dict['no_prod_link'] || '尚未设置正式系统链接地址!' |
| | | } else if (btn.funcType === 'refund') { |
| | | if (data.length === 0) { |
| | | error = '请选择行!' |
| | | error = dict['select_row'] || '请选择行!' |
| | | } else if (data.length !== 1) { |
| | | error = '请选择单行数据!' |
| | | error = dict['select_single_row'] || '请选择单行数据!' |
| | | } else if (!data[0].$$uuid) { |
| | | error = '未获取到订单编号!' |
| | | error = dict['no_ordercode'] || '未获取到订单编号!' |
| | | } |
| | | } |
| | | |
| | |
| | | const that = this |
| | | |
| | | confirm({ |
| | | title: btn.tipTitle || '确定要执行吗?', |
| | | title: btn.tipTitle || dict['exec_sure'] || '确定要执行吗?', |
| | | okText: dict['ok'] || '确定', |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | that.execRefund(orderId) |
| | | }, |
| | |
| | | execRefund = (orderId) => { |
| | | Api.setRefund(orderId).then(res => { |
| | | if (!res.status) { |
| | | this.execError({ErrCode: 'E', message: '执行失败!', ...res}) |
| | | this.execError({ErrCode: 'E', message: window.GLOB.dict['exc_fail'] || '执行失败!', ...res}) |
| | | } else { |
| | | this.execSuccess({ErrCode: 'S', ...res}) |
| | | } |
| | |
| | | title: btn.shareTip |
| | | }) |
| | | } else { |
| | | message.success('已复制到剪切板。') |
| | | message.success(window.GLOB.dict['copied'] || '已复制到剪切板。') |
| | | } |
| | | } |
| | | |
| | | execSuccess = (res = {}) => { |
| | | const { btn } = this.props |
| | | const { dict } = this.state |
| | | |
| | | if (res.ErrCode === 'S' || !res.ErrCode) { // 执行成功 |
| | | notification.success({ |
| | | top: 92, |
| | | message: res.message || '执行成功!', |
| | | message: res.message || dict['exc_success'] || '执行成功!', |
| | | duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 |
| | | }) |
| | | } else if (res.ErrCode === 'Y') { // 执行成功 |
| | | Modal.success({ |
| | | title: res.message || '执行成功!' |
| | | title: res.message || dict['exc_success'] || '执行成功!', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | } else if (res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | |
| | | |
| | | execError = (res) => { |
| | | const { btn } = this.props |
| | | const { dict } = this.state |
| | | |
| | | if (!['LoginError', 'C', '-2', 'E', 'N', 'F', 'NM'].includes(res.ErrCode)) { |
| | | res.ErrCode = 'E' |
| | |
| | | |
| | | if (res.ErrCode === 'E') { |
| | | Modal.error({ |
| | | title: res.message || '执行失败!', |
| | | title: res.message || dict['exc_fail'] || '执行失败!', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || '执行失败!') |
| | | message.error(res.message || dict['exc_fail'] || '执行失败!') |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | loading: false, |
| | | disabled: false, |
| | | hidden: false, |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | */ |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { BID, btn, selectedData, setting, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | const { loading, disabled, dict } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '需要上级主键值!', |
| | | message: dict['sup_key_req'] || '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (btn.Ot !== 'notRequired' && data.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择行!', |
| | | message: dict['select_row'] || '请选择行!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (btn.Ot === 'requiredSgl' && data.length !== 1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择单行数据!', |
| | | message: dict['select_single_row'] || '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | */ |
| | | execError = (res) => { |
| | | const { btn } = this.props |
| | | const { dict } = this.state |
| | | |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | |
| | | if (res.ErrCode === '01') { |
| | | message.error('未获取到下载文件。') |
| | | message.error(dict['exc_fail'] || '未获取到下载文件。') |
| | | return |
| | | } else if (res.ErrCode === '02') { |
| | | Modal.error({ |
| | | title: '部分文件下载失败:1、请检查文件路径是否正确,2、请检查文件是否跨域。', |
| | | title: dict['exc_fail'] || '部分文件下载失败:1、请检查文件路径是否正确,2、请检查文件是否跨域。', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | return |
| | | } else if (res.ErrCode === '03') { |
| | | Modal.error({ |
| | | title: '文件下载失败:1、请检查文件路径是否正确,2、请检查文件是否跨域。', |
| | | title: dict['exc_fail'] || '文件下载失败:1、请检查文件路径是否正确,2、请检查文件是否跨域。', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | return |
| | | } else if (res.ErrCode === 'E') { |
| | | Modal.error({ |
| | | title: res.message || '执行失败!', |
| | | title: res.message || dict['exc_fail'] || '执行失败!', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || '执行失败!') |
| | | message.error(res.message || dict['exc_fail'] || '执行失败!') |
| | | } |
| | | |
| | | if (btn.execError !== 'never') { |
| | |
| | | <div className="button-list toolbar-button"> |
| | | {this.getButtonList(actions)} |
| | | {mores ? <Dropdown overlay={<div className="mk-button-dropdown-wrap">{this.getButtonList(mores)}</div>} trigger={['hover']}> |
| | | <div className="mk-button-more">更多<DownOutlined/></div> |
| | | <div className="mk-button-more">{window.GLOB.dict['more'] || '更多'}<DownOutlined/></div> |
| | | </Dropdown> : null} |
| | | </div> |
| | | </Affix> |
| | |
| | | <div className="button-list toolbar-button"> |
| | | {this.getButtonList(actions)} |
| | | {mores ? <Dropdown overlay={<div className="mk-button-dropdown-wrap">{this.getButtonList(mores)}</div>} trigger={['hover']}> |
| | | <div className="mk-button-more">更多<DownOutlined/></div> |
| | | <div className="mk-button-more">{window.GLOB.dict['more'] || '更多'}<DownOutlined/></div> |
| | | </Dropdown> : null} |
| | | </div> |
| | | ) |
| | |
| | | // 需要选择行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择行!', |
| | | message: window.GLOB.dict['select_row'] || '请选择行!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | // 需要选择单行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择单行数据!', |
| | | message: window.GLOB.dict['select_single_row'] || '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (btn.pageTemplate === 'custom' && window.GLOB.systemType === 'production' && !btn.proUrl) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '尚未设置正式系统链接地址!', |
| | | message: window.GLOB.dict['no_prod_link'] || '尚未设置正式系统链接地址!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | hidden: false, |
| | | autoMatic: false, |
| | | check: false, |
| | | count: 0 |
| | | count: 0, |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | moduleParams = null |
| | |
| | | */ |
| | | actionTrigger = (triggerId, record, type, lid, callback) => { |
| | | const { btn, selectedData, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | const { loading, disabled, dict } = this.state |
| | | |
| | | if (type === 'preButton') { |
| | | if (btn.uuid !== triggerId) return |
| | |
| | | } else if (btn.OpenType === 'prompt') { |
| | | this.setState({loading: true}) |
| | | confirm({ |
| | | title: btn.tipTitle || '确定要执行吗?', |
| | | title: btn.tipTitle || dict['exec_sure'] || '确定要执行吗?', |
| | | okText: dict['ok'] || '确定', |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execSubmit(data, resolve) |
| | |
| | | |
| | | preTrigger = (callback) => { |
| | | const { btn, selectedData } = this.props |
| | | const { loading, disabled } = this.state |
| | | const { loading, disabled, dict } = this.state |
| | | |
| | | if (loading || disabled) { |
| | | callback() |
| | |
| | | } else if (btn.OpenType === 'prompt') { |
| | | this.setState({loading: true}) |
| | | confirm({ |
| | | title: btn.tipTitle || '确定要执行吗?', |
| | | title: btn.tipTitle || dict['exec_sure'] || '确定要执行吗?', |
| | | okText: dict['ok'] || '确定', |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execSubmit(data, resolve) |
| | |
| | | |
| | | checkBtnData = (data) => { |
| | | const { BID, btn, setting } = this.props |
| | | const { dict } = this.state |
| | | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '需要上级主键值!', |
| | | message: dict['sup_key_req'] || '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | |
| | | // 需要选择行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择行!', |
| | | message: dict['select_row'] || '请选择行!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | |
| | | // 需要选择单行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择单行数据!', |
| | | message: dict['select_single_row'] || '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } else if (btn.intertype === 'system') { |
| | | if (data.length === 0 && btn.verify && btn.verify.voucher && btn.verify.voucher.enabled) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '使用创建凭证函数,需要选择行!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } |
| | | } else if (btn.intertype === 'custom' || btn.intertype === 'outer') { |
| | | if (btn.callbackType === 'script' && (!btn.verify || !btn.verify.cbScripts || !btn.verify.cbScripts.filter(item => item.status !== 'false').length === 0)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '使用自定义脚本回调时,回调脚本不可为空!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } else if (btn.procMode === 'system' && data.length === 0 && btn.verify && btn.verify.voucher && btn.verify.voucher.enabled) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '使用创建凭证函数,需要选择行!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } else if (btn.intertype === 'custom' && window.GLOB.systemType === 'production' && !btn.proInterface) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '尚未设置正式系统接口地址!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } |
| | | } else if (btn.intertype === 'custom' && window.GLOB.systemType === 'production' && !btn.proInterface) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: dict['no_prod_link'] || '尚未设置正式系统接口地址!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } |
| | | |
| | | return true |
| | |
| | | if (times > 50) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '前置按钮加载失败!', |
| | | message: window.GLOB.dict['pre_btn_failed'] || '前置按钮加载失败!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({loading: false}) |
| | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '需要上级主键值!', |
| | | message: window.GLOB.dict['sup_key_req'] || '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | _resolve() |
| | |
| | | } |
| | | const _this = this |
| | | confirm({ |
| | | title: '请确认', |
| | | title: window.GLOB.dict['exec_sure'] || '请确认', |
| | | content: msg, |
| | | okText: window.GLOB.dict['ok'] || '确定', |
| | | cancelText: window.GLOB.dict['cancel'] || '取消', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | Api.genericInterface(unCheckParam).then(result => { |
| | |
| | | */ |
| | | execSuccess = (res = {}) => { |
| | | const { btn } = this.props |
| | | const { autoMatic } = this.state |
| | | const { autoMatic, dict } = this.state |
| | | |
| | | if (btn.resetForms) { |
| | | let data = {} |
| | |
| | | if (btn.formType !== 'counter' || res.message) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: res.message || '执行成功!', |
| | | message: res.message || dict['exc_success'] || '执行成功!', |
| | | duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 |
| | | }) |
| | | } |
| | | } else if (res.ErrCode === 'Y') { // 执行成功 |
| | | let msg = res.message || '执行成功!' |
| | | let msg = res.message || dict['exc_success'] || '执行成功!' |
| | | if (/\n|\r/.test(msg)) { |
| | | msg = msg.replace(/\n|\r/ig, '<br/>') |
| | | msg = <span dangerouslySetInnerHTML={{__html: msg}}></span> |
| | | } |
| | | Modal.success({ |
| | | title: msg, |
| | | okText: dict['got_it'] || '知道了', |
| | | onOk: () => { |
| | | this.successContinue(sign, id, res, focusField) |
| | | } |
| | |
| | | if (!url) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '尚未添加正式系统链接地址!', |
| | | message: window.GLOB.dict['no_prod_link'] || '尚未设置正式系统链接地址!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | */ |
| | | execError = (res = {}) => { |
| | | const { btn } = this.props |
| | | const { autoMatic } = this.state |
| | | const { autoMatic, dict } = this.state |
| | | |
| | | if (this.preCallback) { |
| | | this.setState({ |
| | |
| | | } else if (autoMatic) { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: 10 |
| | | }) |
| | | |
| | |
| | | } |
| | | |
| | | if (res.ErrCode === 'E') { |
| | | let msg = res.message || '执行失败!' |
| | | let msg = res.message || dict['exc_fail'] || '执行失败!' |
| | | if (/\n|\r/.test(msg)) { |
| | | msg = msg.replace(/\n|\r/ig, '<br/>') |
| | | msg = <span dangerouslySetInnerHTML={{__html: msg}}></span> |
| | | } |
| | | Modal.error({ |
| | | title: msg, |
| | | okText: dict['got_it'] || '知道了', |
| | | onOk: () => { |
| | | this.errorContinue(sign) |
| | | } |
| | |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || '执行失败!') |
| | | message.error(res.message || dict['exc_fail'] || '执行失败!') |
| | | } else if (res.ErrCode === '-2') { |
| | | this.setState({ |
| | | loadingNumber: '', |
| | |
| | | |
| | | modelconfirm = () => { |
| | | const { BID } = this.props |
| | | const { btnconfig, selines } = this.state |
| | | const { btnconfig, selines, dict } = this.state |
| | | let _this = this |
| | | |
| | | let result = [] |
| | |
| | | this.execSubmit(selines, () => {}, result) |
| | | } else { |
| | | confirm({ |
| | | title: btnconfig.setting.tipTitle || '确定要执行吗?', |
| | | title: btnconfig.setting.tipTitle || dict['exec_sure'] || '确定要执行吗?', |
| | | okText: dict['ok'] || '确定', |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | _this.execSubmit(selines, resolve, result) |
| | |
| | | */ |
| | | getModels = () => { |
| | | const { BID, btn, BData } = this.props |
| | | const { btnconfig, visible } = this.state |
| | | const { btnconfig, visible, dict } = this.state |
| | | |
| | | if (!btnconfig || !btnconfig.setting) return null |
| | | |
| | |
| | | /> |
| | | <div className="ant-drawer-footer" style={{ position: 'absolute', zIndex: 1, right: 0, bottom: 0, width: '100%', borderTop: '1px solid #e9e9e9', padding: '10px 16px', background: '#fff', textAlign: 'right'}}> |
| | | <Button onClick={this.handleCancel} style={{ marginRight: 8 }}> |
| | | {btnconfig.setting.formType !== 'check' ? '取消' : '关闭'} |
| | | {btnconfig.setting.formType !== 'check' ? dict['cancel'] || '取消' : dict['close'] || '关闭'} |
| | | </Button> |
| | | {btnconfig.setting.formType !== 'check' ? <Button onClick={this.handleOk} loading={this.state.confirmLoading} type="primary"> |
| | | 确定 |
| | | {dict['ok'] || '确定'} |
| | | </Button> : null} |
| | | </div> |
| | | </Drawer> |
| | |
| | | wrapClassName={'action-modal' + (btnconfig.setting.moveable === 'true' ? ' moveable-modal modal-' + btn.uuid : '')} |
| | | visible={visible} |
| | | width={width} |
| | | okText={dict['ok'] || '确定'} |
| | | cancelText={dict['cancel'] || '取消'} |
| | | onOk={this.handleOk} |
| | | maskStyle={btnconfig.setting.moveable === 'true' ? {backgroundColor: 'rgba(0, 0, 0, 0.15)'} : null} |
| | | confirmLoading={this.state.confirmLoading} |
| | |
| | | |
| | | changeLineCount = (count) => { |
| | | const { btn, selectedData } = this.props |
| | | const { disabled } = this.state |
| | | const { disabled, dict } = this.state |
| | | |
| | | if (disabled) return |
| | | |
| | |
| | | // 需要选择行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择行!', |
| | | message: dict['select_row'] || '请选择行!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | // 需要选择单行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择单行数据!', |
| | | message: dict['select_single_row'] || '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | disabled: false, |
| | | hidden: false, |
| | | loading: false, |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | */ |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { setting, BID, btn, selectedData, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | const { loading, disabled, dict } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '需要上级主键值!', |
| | | message: dict['sup_key_req'] || '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | // 需要选择单行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: data.length === 0 ? '请选择行!' : '请选择单行数据!', |
| | | message: data.length === 0 ? dict['select_row'] || '请选择行!' : dict['select_single_row'] || '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | |
| | | getPop = () => { |
| | | const { btn } = this.props |
| | | const { popData, primaryId, visible } = this.state |
| | | const { popData, primaryId, visible, dict } = this.state |
| | | |
| | | let ratio = btn.ratio || 85 |
| | | |
| | |
| | | visible={visible} |
| | | onCancel={this.popclose} |
| | | footer={[ |
| | | <Button key="close" onClick={this.popclose}>关闭</Button> |
| | | <Button key="close" onClick={this.popclose}>{dict['close'] || '关闭'}</Button> |
| | | ]} |
| | | destroyOnClose |
| | | > |
| | |
| | | {btn.$view === 'popview' ? <PopView Tab={btn} param={{$BID: (popData ? primaryId : this.props.BID), ...(popData || this.props.BData || {})}} /> : null} |
| | | <div className="close-drawer"> |
| | | <Button onClick={this.popclose}> |
| | | 关闭 |
| | | {dict['close'] || '关闭'} |
| | | </Button> |
| | | </div> |
| | | </Drawer> |
| | |
| | | loading: false, |
| | | disabled: false, |
| | | hidden: false, |
| | | autoMatic: false |
| | | autoMatic: false, |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | */ |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { BID, btn, selectedData, setting, LID } = this.props |
| | | const { loading, disabled } = this.state |
| | | const { loading, disabled, dict } = this.state |
| | | |
| | | if (loading || disabled) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | |
| | | if (setting.supModule && !BID) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '需要上级主键值!', |
| | | message: dict['sup_key_req'] || '需要上级主键值!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | // 需要选择行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择行!', |
| | | message: dict['select_row'] || '请选择行!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | // 需要选择单行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (!btn.verify || !btn.verify.printMode) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请完善打印验证信息!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (btn.intertype === 'system' && btn.verify.dataType === 'custom' && (!btn.verify.setting || btn.verify.columns.length === 0)) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '自定义打印数据请设置数据源!', |
| | | message: dict['select_single_row'] || '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | } else if (btn.execMode === 'prompt') { |
| | | this.setState({ loading: true }) |
| | | confirm({ |
| | | title: '确定要执行吗?', |
| | | title: dict['exec_sure'] || '确定要执行吗?', |
| | | okText: dict['ok'] || '确定', |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | _this.triggerPrint(data) |
| | | }, |
| | |
| | | if (list.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到打印数据!', |
| | | message: window.GLOB.dict['no_data'] || '未获取到打印数据!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | |
| | | if (!result.ConfigParam) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到打印模板信息!', |
| | | message: window.GLOB.dict['no_print_temp'] || '未获取到打印模板信息!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({ loading: false }) |
| | |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '自定义函数执行错误!', |
| | | message: window.GLOB.dict['func_error'] || '自定义函数执行错误!', |
| | | duration: 5 |
| | | }) |
| | | } |
| | |
| | | let imgs = [] |
| | | |
| | | if (!res.ConfigParam) { |
| | | error = '未获取到打印模板信息!' |
| | | error = window.GLOB.dict['no_print_temp'] || '未获取到打印模板信息!' |
| | | } else { |
| | | try { |
| | | configParam = JSON.parse(window.decodeURIComponent(window.atob(res.ConfigParam))) |
| | |
| | | if (list.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到打印数据!', |
| | | message: window.GLOB.dict['no_data'] || '未获取到打印数据!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({ loading: false }) |
| | |
| | | Api.postekPrint(param).then(res => { |
| | | if (res.retval === '0') { |
| | | if (params.length === 0) { |
| | | this.execSuccess({ ErrCode: 'S', message: '打印请求已发出。', status: true }) |
| | | this.execSuccess({ ErrCode: 'S', message: window.GLOB.dict['print_out'] || '打印请求已发出。', status: true }) |
| | | } else { |
| | | setTimeout(() => { |
| | | this.loopRFIDPrint(params) |
| | |
| | | |
| | | execPrint = (list, template) => { |
| | | const { btn } = this.props |
| | | const { dict } = this.state |
| | | |
| | | let _errors = [] |
| | | |
| | | let defaultPrinter = btn.verify.defaultPrinter || 'lackprinter' |
| | |
| | | if (btn.verify.emptyTip === 'false') { |
| | | this.execSuccess({ |
| | | ErrCode: '-1', |
| | | message: '未获取到打印信息!', |
| | | message: dict['no_data'] || '未获取到打印信息!', |
| | | status: true |
| | | }) |
| | | } else { |
| | | this.execError({ |
| | | ErrCode: 'N', |
| | | message: '未获取到打印信息!', |
| | | message: dict['no_data'] || '未获取到打印信息!', |
| | | status: false |
| | | }) |
| | | } |
| | |
| | | lackerror.push(`数据中未获取到模板(${err.title})${err.lacks.join('、')} 字段`) |
| | | } |
| | | if (err.emptys.length > 0) { |
| | | emptyerror.push(`数据中模板(${err.title}) ${err.emptys.join('、')} 字段不可为空`) |
| | | emptyerror.push(dict['not_empty'] ? `${err.title}: ${err.emptys.join('、')} ${dict['not_empty']}` : `数据中模板(${err.title}) ${err.emptys.join('、')} 字段不可为空`) |
| | | } |
| | | }) |
| | | |
| | |
| | | if (printerList.length === 0) { |
| | | this.execSuccess({ |
| | | ErrCode: '-1', |
| | | message: '未获取到打印信息!', |
| | | message: dict['no_data'] || '未获取到打印信息!', |
| | | status: true |
| | | }) |
| | | return |
| | |
| | | this.syncMessageSend(printerList, () => { |
| | | this.execSuccess({ |
| | | ErrCode: 'S', |
| | | message: '打印请求已发出。', |
| | | message: dict['print_out'] || '打印请求已发出。', |
| | | status: true |
| | | }) |
| | | }) |
| | |
| | | this.syncMessageSend(printerList, () => { |
| | | this.execSuccess({ |
| | | ErrCode: 'S', |
| | | message: '打印请求已发出。', |
| | | message: dict['print_out'] || '打印请求已发出。', |
| | | status: true |
| | | }) |
| | | }) |
| | |
| | | socket.onerror = () => { |
| | | this.execError({ |
| | | ErrCode: 'N', |
| | | message: '无法连接到:' + btn.verify.linkUrl, |
| | | message: (dict['un_connect'] || '无法连接到') + ':' + btn.verify.linkUrl, |
| | | status: false |
| | | }) |
| | | } |
| | |
| | | */ |
| | | execSuccess = (res = {}) => { |
| | | const { btn } = this.props |
| | | const { autoMatic, btnconfig } = this.state |
| | | const { autoMatic, btnconfig, dict } = this.state |
| | | |
| | | if ((res.ErrCode === 'S' || !res.ErrCode) || autoMatic) { // 执行成功 |
| | | notification.success({ |
| | | top: 92, |
| | | message: res.message || '执行成功!', |
| | | message: res.message || dict['exc_success'] || '执行成功!', |
| | | duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 |
| | | }) |
| | | } else if (res.ErrCode === 'Y') { // 执行成功 |
| | | Modal.success({ |
| | | title: res.message || '执行成功!' |
| | | title: res.message || dict['exc_success'] || '执行成功!', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | } else if (res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | |
| | | */ |
| | | execError = (res) => { |
| | | const { btn } = this.props |
| | | const { btnconfig, autoMatic } = this.state |
| | | const { btnconfig, autoMatic, dict } = this.state |
| | | |
| | | if (!['LoginError', 'C', '-2', 'E', 'N', 'F', 'NM'].includes(res.ErrCode)) { |
| | | res.ErrCode = 'E' |
| | |
| | | |
| | | if (res.ErrCode === 'E' && !autoMatic) { |
| | | Modal.error({ |
| | | title: res.message || '执行失败!', |
| | | title: res.message || dict['exc_fail'] || '执行失败!', |
| | | okText: dict['got_it'] || '知道了' |
| | | }) |
| | | } else if (res.ErrCode === 'N' || autoMatic) { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || '执行失败!', |
| | | message: res.message || dict['exc_fail'] || '执行失败!', |
| | | duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || '执行失败!') |
| | | message.error(res.message || dict['exc_fail'] || '执行失败!') |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } |
| | | |
| | | modelconfirm = () => { |
| | | const { btnconfig, selines } = this.state |
| | | const { btnconfig, selines, dict } = this.state |
| | | let _this = this |
| | | let result = [] |
| | | let _data = {} |
| | |
| | | this.execSubmit(selines, () => {}, result) |
| | | } else { |
| | | confirm({ |
| | | title: '确定要执行吗?', |
| | | title: dict['exec_sure'] || '确定要执行吗?', |
| | | okText: dict['ok'] || '确定', |
| | | cancelText: dict['cancel'] || '取消', |
| | | onOk() { |
| | | _this.triggerPrint(selines, result) |
| | | }, |
| | |
| | | */ |
| | | getModels = () => { |
| | | const { BID, btn } = this.props |
| | | const { btnconfig } = this.state |
| | | const { btnconfig, dict } = this.state |
| | | |
| | | if (!this.state.visible || !btnconfig || !btnconfig.setting) return null |
| | | |
| | |
| | | visible={this.state.visible} |
| | | confirmLoading={this.state.confirmLoading} |
| | | width={width} |
| | | okText={dict['ok'] || '确定'} |
| | | cancelText={dict['cancel'] || '取消'} |
| | | maskStyle={btnconfig.setting.moveable === 'true' ? {backgroundColor: 'rgba(0, 0, 0, 0.15)'} : null} |
| | | onOk={this.handleOk} |
| | | onCancel={this.handleCancel} |
| | |
| | | state = { |
| | | disabled: false, |
| | | hidden: false, |
| | | primaryId: '' |
| | | primaryId: '', |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | */ |
| | | actionTrigger = (triggerId, record, type, lid) => { |
| | | const { btn, selectedData, BID, LID } = this.props |
| | | const { disabled } = this.state |
| | | const { disabled, dict } = this.state |
| | | |
| | | if (disabled || btn.multiMenus) return |
| | | if (triggerId && btn.uuid !== triggerId) return |
| | |
| | | // 需要选择行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择行!', |
| | | message: dict['select_row'] || '请选择行!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | |
| | | // 需要选择单行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择单行数据!', |
| | | message: dict['select_single_row'] || '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | if (!menu) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单已删除或没有访问权限!', |
| | | message: dict['no_perm'] || '菜单已删除或没有访问权限!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | |
| | | triggerMenu = (tab) => { |
| | | const { btn, selectedData, BID } = this.props |
| | | const { dict } = this.state |
| | | |
| | | let data = selectedData || [] |
| | | |
| | |
| | | // 需要选择行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择行!', |
| | | message: dict['select_row'] || '请选择行!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | |
| | | // 需要选择单行时,校验数据 |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择单行数据!', |
| | | message: dict['select_single_row'] || '请选择单行数据!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | if (!menu) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '菜单已删除或没有访问权限!', |
| | | message: dict['no_perm'] || '菜单已删除或没有访问权限!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import { formRule } from '@/utils/option.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import MKEmitter from '@/utils/events.js' |
| | |
| | | timestamp: '', |
| | | n_id: '', |
| | | focusId: '', |
| | | reFocusId: '' |
| | | reFocusId: '', |
| | | dict: window.GLOB.dict |
| | | } |
| | | |
| | | record = {} |
| | |
| | | |
| | | componentDidMount () { |
| | | const { action, unload } = this.props |
| | | const { dict } = this.state |
| | | |
| | | let data = {} |
| | | let BData = {} |
| | |
| | | if (item.required === 'true') { |
| | | item.rules.push({ |
| | | required: true, |
| | | message: item.label + '不可为空!' |
| | | message: item.label + (dict['not_empty'] || '不可为空!') |
| | | }) |
| | | } |
| | | |
| | | item.rules.push({ |
| | | validator: (rule, value, callback) => { |
| | | if (/'/.test(value)) { |
| | | callback('不可使用英文状态的单引号!') |
| | | callback(dict['single_quot'] || '不可使用英文状态的单引号!') |
| | | // } else if (/--/.test(value)) { |
| | | // callback('不可使用 -- !') |
| | | } else { |
| | |
| | | if (!item.lenControl || item.lenControl === 'limit') { |
| | | item.rules.push({ |
| | | max: item.fieldlength, |
| | | message: formRule.input.formMessage.replace('@max', item.fieldlength) |
| | | message: (dict['max_char'] || '最多@max个字符').replace('@max', item.fieldlength) |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | item.rules.push({ |
| | | pattern: reg, |
| | | message: item.regularText || formRule.input.numbermsg |
| | | message: item.regularText || dict['enter_num'] || '请输入数字!' |
| | | }) |
| | | } else if (item.regular === 'letter') { |
| | | let reg = /^[a-zA-Z]*$/ |
| | |
| | | } |
| | | item.rules.push({ |
| | | pattern: reg, |
| | | message: item.regularText || formRule.input.lettermsg |
| | | message: item.regularText || dict['enter_letter'] || '请输入字母!' |
| | | }) |
| | | } else if (item.regular === 'letter_number') { |
| | | let reg = /^[a-zA-Z0-9]*$/ |
| | |
| | | } |
| | | item.rules.push({ |
| | | pattern: reg, |
| | | message: item.regularText || '请输入数字或字母' |
| | | message: item.regularText || dict['enter_num_letter'] || '请输入数字或字母' |
| | | }) |
| | | } else if (item.regular === 'letter&number') { |
| | | let reg = /^[a-zA-Z0-9@_.]*$/ |
| | |
| | | } |
| | | item.rules.push({ |
| | | pattern: reg, |
| | | message: item.regularText || '请输入数字、字母以及@_.' |
| | | message: item.regularText || dict['enter_num_letter_char'] || '请输入数字、字母以及@_.' |
| | | }) |
| | | } else if (item.regular === 'phone') { |
| | | item.rules.push({ |
| | | pattern: /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/, |
| | | message: item.regularText || '请正确输入手机号' |
| | | message: item.regularText || dict['phone_error'] || '请正确输入手机号' |
| | | }) |
| | | } else if (item.regular === 'email') { |
| | | item.rules.push({ |
| | | pattern: /^([a-zA-Z0-9._-])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-])+/, |
| | | message: item.regularText || '请正确输入邮箱地址' |
| | | message: item.regularText || dict['email_error'] || '请正确输入邮箱地址' |
| | | }) |
| | | } |
| | | } |
| | | } else if (item.type === 'number') { |
| | | item.rules = [{ |
| | | required: true, |
| | | message: item.label + '不可为空!' |
| | | message: item.label + (dict['not_empty'] || '不可为空!') |
| | | }] |
| | | |
| | | if (typeof(item.min) === 'number' || typeof(item.max) === 'number' || item.notZero === 'true') { |
| | |
| | | if (isNaN(value)) { |
| | | callback() |
| | | } else if (item.notZero === 'true' && value === 0) { |
| | | callback(item.label + '不可为0') |
| | | callback(item.label + (dict['not_zero'] || '不可为0')) |
| | | } else if (typeof(item.min) === 'number' && value < item.min) { |
| | | if (item.min < 1e-6) { |
| | | if (item.min === 1e-6) { |
| | |
| | | callback(item.label + '最小值为 ' + item.min) |
| | | } |
| | | } else { |
| | | callback(item.label + '最小值为 ' + item.min) |
| | | callback(item.label + (dict['less_limit'] || '最小值为 ') + item.min) |
| | | } |
| | | } else if (typeof(item.max) === 'number' && value > item.max) { |
| | | callback(item.label + '最大值为 ' + item.max) |
| | | callback(item.label + (dict['max_limit'] || '最大值为 ') + item.max) |
| | | } else { |
| | | callback() |
| | | } |
| | |
| | | if (item.required === 'true') { |
| | | item.rules.push({ |
| | | required: true, |
| | | message: item.label + '不可为空!' |
| | | message: item.label + (dict['not_empty'] || '不可为空!') |
| | | }) |
| | | } |
| | | |
| | | item.rules.push({ |
| | | validator: (rule, value, callback) => { |
| | | if (/'/.test(value)) { |
| | | callback('不可使用英文状态的单引号!') |
| | | callback(dict['single_quot'] || '不可使用英文状态的单引号!') |
| | | // } else if (/--/.test(value)) { |
| | | // callback('不可使用 -- !') |
| | | } else { |
| | |
| | | } |
| | | }, { |
| | | max: item.fieldlength, |
| | | message: formRule.input.formMessage.replace('@max', item.fieldlength) |
| | | message: (dict['max_char'] || '最多@max个字符').replace('@max', item.fieldlength) |
| | | }) |
| | | } else if (item.type === 'brafteditor') { |
| | | if (item.required === 'true') { |
| | | item.rules.push({ |
| | | required: true, |
| | | message: item.label + '不可为空!' |
| | | message: item.label + (dict['not_empty'] || '不可为空!') |
| | | }) |
| | | } |
| | | |
| | | item.rules.push({ |
| | | max: item.fieldlength, |
| | | message: formRule.input.formMessage.replace('@max', item.fieldlength) |
| | | message: (dict['max_char'] || '最多@max个字符').replace('@max', item.fieldlength) |
| | | }) |
| | | } else if (item.type === 'linkMain' || item.type === 'vercode') { |
| | | if (item.required === 'true') { |
| | | item.rules.push({ |
| | | required: true, |
| | | message: item.label + '不可为空!' |
| | | message: item.label + (dict['not_empty'] || '不可为空!') |
| | | }) |
| | | } |
| | | } else { |
| | | if (item.required === 'true') { |
| | | item.rules.push({ |
| | | required: true, |
| | | message: '请选择' + item.label + '!' |
| | | message: (dict['select_tip'] || '请选择') + item.label + '!' |
| | | }) |
| | | } |
| | | if (['cascader', 'checkbox', 'checkcard', 'fileupload', 'multiselect'].includes(item.type) && item.fieldlength) { |
| | | item.rules.push({ |
| | | max: item.fieldlength, |
| | | message: formRule.input.formMessage.replace('@max', item.fieldlength) |
| | | message: (dict['max_char'] || '最多@max个字符').replace('@max', item.fieldlength) |
| | | }) |
| | | } |
| | | } |
| | |
| | | const _rules = [ |
| | | { |
| | | required: item.required, |
| | | message: item.label + '不可为空!' |
| | | message: item.label + (window.GLOB.dict['not_empty'] || '不可为空!') |
| | | } |
| | | ] |
| | | |
| | |
| | | wrapperCol={setting.wrapperCol} |
| | | > |
| | | {setting.show ? <Button style={style} type="primary" onClick={this.handleSubmit}> |
| | | 搜索 |
| | | {window.GLOB.dict['search'] || '搜索'} |
| | | </Button> : null} |
| | | {setting.show ? <Button style={{ marginLeft: 8, ...style }} onClick={this.handleReset}> |
| | | 重置 |
| | | {window.GLOB.dict['reset'] || '重置'} |
| | | </Button> : null} |
| | | {setting.showAdv ? <Button className={visible ? 'visible' : ''} type="link" onClick={this.handleAdvance}> |
| | | 高级{setting.advanceType === 'pulldown' ? <DownOutlined /> : null} |
| | | {window.GLOB.dict['senior'] || '高级'}{setting.advanceType === 'pulldown' ? <DownOutlined /> : null} |
| | | </Button> : null} |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | <Col className="mk-search-col search-button" key="actions"> |
| | | <Form.Item> |
| | | <Button type="primary" onClick={this.handleSubmit}> |
| | | 搜索 |
| | | {window.GLOB.dict['search'] || '搜索'} |
| | | </Button> |
| | | </Form.Item> |
| | | </Col> |
| | |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请输入' + labels.join('、') + ' !', |
| | | message: (window.GLOB.dict['input_tip'] || '请输入') + labels.join('、') + ' !', |
| | | duration: 3 |
| | | }) |
| | | return |
| | |
| | | </Row> : null} |
| | | </Form> |
| | | {setting.advanceType === 'modal' ? <Modal |
| | | title="高级搜索" |
| | | title={window.GLOB.dict['adv_search'] || '高级搜索'} |
| | | maskClosable={false} |
| | | visible={visible} |
| | | width={setting.advWidth} |
| | |
| | | /> |
| | | </Modal> : null} |
| | | {setting.advanceType === 'drawer' ? <Drawer |
| | | title="高级搜索" |
| | | title={window.GLOB.dict['adv_search'] || '高级搜索'} |
| | | className="mk-search-drawer" |
| | | width={setting.advWidth} |
| | | height={setting.advHeight} |
| | |
| | | |
| | | let _value = '' |
| | | if (value === 'default') { |
| | | let fields = usefulfields.filter(item => item.import !== 'false') |
| | | fields = fields.map(col => col.Column).join(',') |
| | | let fields = [] |
| | | let decls = [] |
| | | usefulfields.forEach(col => { |
| | | if (col.import === 'false') return |
| | | |
| | | if (col.type === 'date') { |
| | | decls.push(`${col.Column} Nvarchar(50)`) |
| | | } else { |
| | | decls.push(`${col.Column} ${col.type}`) |
| | | } |
| | | fields.push(col.Column) |
| | | }) |
| | | |
| | | decls = decls.join(',') |
| | | fields = fields.join(',') |
| | | |
| | | if (fields) { |
| | | fields = fields + ',' |
| | | decls = decls + ',' |
| | | } |
| | | |
| | | 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 = `/* create table #${sheet} (${decls}jskey nvarchar(50),BID nvarchar(50) ) */\nInsert into ${database}${sheet} (${fields}createuserid,createuser,createstaff,bid)\nSelect ${fields}@userid@,@username,@fullname,@BID@ From #${sheet}` |
| | | } else if (value === 'flowSql') { |
| | | let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '') |
| | | |
| | |
| | | if (this.record.selectStyle === 'custom') { |
| | | shows.push('backgroundColor') |
| | | } |
| | | if (this.record.multiple === 'dropdown' && this.record.resourceType === '1') { |
| | | shows.push('mark', 'parentField') |
| | | if (this.record.multiple === 'dropdown') { |
| | | shows.push('mark') |
| | | if (this.record.resourceType === '1') { |
| | | shows.push('parentField') |
| | | } |
| | | } |
| | | } |
| | | shows.push('linkField') |
| | |
| | | if (!cell.modal || cell.modal.fields.length === 0) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中表单尚未添加`}) |
| | | } |
| | | } else if (cell.OpenType === 'excelIn' && (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导入列未设置!`}) |
| | | } else if (cell.OpenType === 'excelIn') { |
| | | if (!cell.verify || !cell.verify.sheet || !cell.verify.columns || cell.verify.columns.length === 0) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导入列未设置!`}) |
| | | } |
| | | } else if (cell.OpenType === 'excelOut') { |
| | | if (!cell.verify || !cell.verify.columns || cell.verify.columns.length === 0) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列未设置!`}) |
| | | } else if (cell.intertype === 'system' && cell.verify.dataType !== 'custom' && card.$c_ds && columns.length > 0) { |
| | | let cols = [] |
| | | cell.verify.columns.forEach(col => { |
| | | if (col.output === 'false' || col.Column === '$Index') return |
| | | if (!columns.includes(col.Column)) { |
| | | cols.push(col.Column) |
| | | } else if (cell.intertype === 'system' && cell.verify.dataType !== 'custom') { |
| | | if (!card.setting || card.setting.interType !== 'system') { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”需自定义导出数据源!`}) |
| | | } else if (card.type === 'balcony' || card.subtype === 'propcard') { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”需自定义导出数据源!`}) |
| | | } else if (card.$c_ds && columns.length > 0) { |
| | | let cols = [] |
| | | cell.verify.columns.forEach(col => { |
| | | if (col.output === 'false' || col.Column === '$Index') return |
| | | if (!columns.includes(col.Column)) { |
| | | cols.push(col.Column) |
| | | } |
| | | }) |
| | | if (cols.length) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列(${cols.join('、')})在字段集中不存在!`}) |
| | | } |
| | | }) |
| | | if (cols.length) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”中导出列(${cols.join('、')})在字段集中不存在!`}) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | if (['pop', 'prompt', 'exec'].includes(cell.OpenType) && cell.verify && !cell.output) { |
| | |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”未设置返回值短信发送无效!`}) |
| | | } else if (cell.verify.emailEnable === 'true') { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”未设置返回值邮件发送无效!`}) |
| | | } |
| | | } |
| | | |
| | | if (['exec', 'prompt', 'pop', 'form', 'formSubmit'].includes(cell.OpenType)) { |
| | | 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}”使用了创建凭证函数,需要选择行!`}) |
| | | } |
| | | } 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.OpenType === 'funcbutton' && cell.funcType === 'print') { |
| | | if (!cell.verify || !cell.verify.printMode) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”请完善验证信息!`}) |
| | | } else if (cell.intertype === 'system' && cell.verify.dataType === 'custom' && (!cell.verify.setting || cell.verify.columns.length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”使用了自定义打印数据,请设置数据源!`}) |
| | | } |
| | | } else if (cell.OpenType === 'innerpage' || cell.OpenType === 'outerpage') { |
| | | if (!cell.pageTemplate) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”页面类型设置错误!`}) |
| | | } |
| | | } |
| | | } |
| | |
| | | if (item.wrap.click === 'menu') { |
| | | resetMenu(item.wrap) |
| | | } else if (item.wrap.click === 'menus') { |
| | | resetMenus(config.wrap) |
| | | resetMenus(item.wrap) |
| | | } |
| | | } else if (item.plot && (item.plot.click === 'menu' || item.plot.click === 'menus')) { |
| | | if (item.plot.click === 'menu') { |
| | | resetMenu(item.plot) |
| | | } else if (item.plot.click === 'menus') { |
| | | resetMenus(config.plot) |
| | | resetMenus(item.plot) |
| | | } |
| | | } |
| | | if (item.setting && (!item.wrap || !item.wrap.datatype || item.wrap.datatype === 'dynamic')) { |
| | |
| | | import React, {Component} from 'react' |
| | | import { Spin, notification, Table, ConfigProvider, Typography, Row, Col, Tooltip } from 'antd' |
| | | import { Spin, notification, Table, Typography, Row, Col, Tooltip } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | |
| | | import Api from '@/api' |
| | | import { langs } from '@/store/options.js' |
| | |
| | | |
| | | return ( |
| | | <div className="mk-app-check"> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Header view="manage" /> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <Spin size="large" /> |
| | | </div> : null |
| | | } |
| | | <div className="view-wrap"> |
| | | <div className="left-view"> |
| | | <div className="app-table"> |
| | | <Table |
| | | rowKey="ID" |
| | | columns={columns} |
| | | dataSource={applist} |
| | | pagination={false} |
| | | rowSelection={{ type: 'radio', selectedRowKeys: selectApp ? [selectApp.ID] : [], onChange: this.onSelectChange }} |
| | | onRow={(record) => ({ onClick: () => this.setState({ selectApp: record })})} |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div className="right-view"> |
| | | {selectApp ? <div className="app-title">{selectApp.remark}</div> : null} |
| | | {selectApp && selectApp.sublist.map((item, index) => { |
| | | let css = skinStyle[item.css] ? skinStyle[item.css].name : '' |
| | | let color = skinStyle[item.css] ? skinStyle[item.css].color : '#e8e8e8' |
| | | let binding = '' |
| | | if (item.user_binding) { |
| | | if (item.user_binding.indexOf('uname_pwd') > -1) { |
| | | binding = '用户名' |
| | | } |
| | | if (item.user_binding.indexOf('sms_vcode') > -1) { |
| | | binding = binding ? binding + ',手机号' : '手机号' |
| | | } |
| | | } |
| | | return ( |
| | | <div className="sub-app" key={index} style={{borderColor: color}}> |
| | | <Row> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">应用类型:</div> |
| | | <div className="content" style={{fontSize: '18px', fontWeight: 600}}>{item.typename}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">语言:</div> |
| | | <div className="content" style={{textDecoration: 'underline'}}>{langs[item.lang]}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">权限管理:</div> |
| | | <div className="content">{item.role_type === 'false' ? '不启用' : '启用'}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">皮肤:</div> |
| | | <div className="content" style={{color: color}}>{css}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | {binding ? <div className="label"> |
| | | <Tooltip placement="topLeft" title="微信公众号登录时,系统用户与微信用户的绑定方式。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 用户绑定: |
| | | </Tooltip> |
| | | </div> : null} |
| | | <div className="content">{binding}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">标题:</div> |
| | | <div className="content">{item.title || '无'}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">网站头像:</div> |
| | | <div className="content">{item.favicon ? <img style={{width: '18px', height: '18px'}} src={item.favicon} alt="" /> : '无'}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">版权:</div> |
| | | <div className="content">{item.copyright || '无'}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">LOGO:</div> |
| | | <div className="content">{item.logo ? <img style={{height: '18px'}} src={item.logo} alt="" /> : '无'}</div> |
| | | </div> |
| | | </Col> |
| | | </Row> |
| | | <div className="action"> |
| | | <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${window.GLOB.baseurl}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}` }}></Paragraph> |
| | | </div> |
| | | </div> |
| | | ) |
| | | })} |
| | | <Header view="manage" /> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <Spin size="large" /> |
| | | </div> : null |
| | | } |
| | | <div className="view-wrap"> |
| | | <div className="left-view"> |
| | | <div className="app-table"> |
| | | <Table |
| | | rowKey="ID" |
| | | columns={columns} |
| | | dataSource={applist} |
| | | pagination={false} |
| | | rowSelection={{ type: 'radio', selectedRowKeys: selectApp ? [selectApp.ID] : [], onChange: this.onSelectChange }} |
| | | onRow={(record) => ({ onClick: () => this.setState({ selectApp: record })})} |
| | | /> |
| | | </div> |
| | | </div> |
| | | </ConfigProvider> |
| | | <div className="right-view"> |
| | | {selectApp ? <div className="app-title">{selectApp.remark}</div> : null} |
| | | {selectApp && selectApp.sublist.map((item, index) => { |
| | | let css = skinStyle[item.css] ? skinStyle[item.css].name : '' |
| | | let color = skinStyle[item.css] ? skinStyle[item.css].color : '#e8e8e8' |
| | | let binding = '' |
| | | if (item.user_binding) { |
| | | if (item.user_binding.indexOf('uname_pwd') > -1) { |
| | | binding = '用户名' |
| | | } |
| | | if (item.user_binding.indexOf('sms_vcode') > -1) { |
| | | binding = binding ? binding + ',手机号' : '手机号' |
| | | } |
| | | } |
| | | return ( |
| | | <div className="sub-app" key={index} style={{borderColor: color}}> |
| | | <Row> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">应用类型:</div> |
| | | <div className="content" style={{fontSize: '18px', fontWeight: 600}}>{item.typename}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">语言:</div> |
| | | <div className="content" style={{textDecoration: 'underline'}}>{langs[item.lang]}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">权限管理:</div> |
| | | <div className="content">{item.role_type === 'false' ? '不启用' : '启用'}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">皮肤:</div> |
| | | <div className="content" style={{color: color}}>{css}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | {binding ? <div className="label"> |
| | | <Tooltip placement="topLeft" title="微信公众号登录时,系统用户与微信用户的绑定方式。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 用户绑定: |
| | | </Tooltip> |
| | | </div> : null} |
| | | <div className="content">{binding}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">标题:</div> |
| | | <div className="content">{item.title || '无'}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">网站头像:</div> |
| | | <div className="content">{item.favicon ? <img style={{width: '18px', height: '18px'}} src={item.favicon} alt="" /> : '无'}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">版权:</div> |
| | | <div className="content">{item.copyright || '无'}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">LOGO:</div> |
| | | <div className="content">{item.logo ? <img style={{height: '18px'}} src={item.logo} alt="" /> : '无'}</div> |
| | | </div> |
| | | </Col> |
| | | </Row> |
| | | <div className="action"> |
| | | <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${window.GLOB.baseurl}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}` }}></Paragraph> |
| | | </div> |
| | | </div> |
| | | ) |
| | | })} |
| | | </div> |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import { fromJS } from 'immutable' |
| | | import { Spin, notification, Input, Button, Table, Modal, ConfigProvider, Typography, Row, Col, Tooltip } from 'antd' |
| | | import { Spin, notification, Input, Button, Table, Modal, Typography, Row, Col, Tooltip } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | |
| | | return ( |
| | | <div className="mk-app-manage"> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Header view="manage" /> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <Spin size="large" /> |
| | | </div> : null |
| | | } |
| | | <div className="view-wrap"> |
| | | <div className="left-view"> |
| | | <div className="app-table"> |
| | | <div className="app-action"> |
| | | <Button className="mk-green" onClick={() => this.setState({ visible: 'plus' })}>添加应用</Button> |
| | | </div> |
| | | <Table |
| | | rowKey="ID" |
| | | columns={columns} |
| | | dataSource={applist} |
| | | pagination={false} |
| | | rowSelection={{ type: 'radio', selectedRowKeys: selectApp ? [selectApp.ID] : [], onChange: this.onSelectChange }} |
| | | onRow={(record) => ({ onClick: () => this.setState({ selectApp: record })})} |
| | | /> |
| | | <Header view="manage" /> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <Spin size="large" /> |
| | | </div> : null |
| | | } |
| | | <div className="view-wrap"> |
| | | <div className="left-view"> |
| | | <div className="app-table"> |
| | | <div className="app-action"> |
| | | <Button className="mk-green" onClick={() => this.setState({ visible: 'plus' })}>添加应用</Button> |
| | | </div> |
| | | <div className={'trans-table' + (this.state.transTotal <= 10 ? ' no-footer' : '')}> |
| | | <div className="app-action"> |
| | | <Button className="mk-green" onClick={() => this.setState({ transVisible: 'plus' })}>添加传输号</Button> |
| | | <Search placeholder="综合搜索" onSearch={value => this.tranSearch(value)} enterButton /> |
| | | </div> |
| | | <Table |
| | | rowKey="ID" |
| | | columns={transcolumns} |
| | | dataSource={translist} |
| | | pagination={{ |
| | | current: this.state.transIndex, |
| | | pageSize: 10, |
| | | total: this.state.transTotal || 0, |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条` |
| | | }} |
| | | rowSelection={{ type: 'radio', selectedRowKeys: selectTran ? [selectTran.ID] : [], onChange: this.onTransChange }} |
| | | onRow={(record) => ({ onClick: () => { |
| | | if (this.forbid) { |
| | | this.forbid = false |
| | | return |
| | | } |
| | | this.onTransSelect(record) |
| | | }})} |
| | | onChange={this.changeTable} |
| | | /> |
| | | <Table |
| | | rowKey="ID" |
| | | columns={columns} |
| | | dataSource={applist} |
| | | pagination={false} |
| | | rowSelection={{ type: 'radio', selectedRowKeys: selectApp ? [selectApp.ID] : [], onChange: this.onSelectChange }} |
| | | onRow={(record) => ({ onClick: () => this.setState({ selectApp: record })})} |
| | | /> |
| | | </div> |
| | | <div className={'trans-table' + (this.state.transTotal <= 10 ? ' no-footer' : '')}> |
| | | <div className="app-action"> |
| | | <Button className="mk-green" onClick={() => this.setState({ transVisible: 'plus' })}>添加传输号</Button> |
| | | <Search placeholder="综合搜索" onSearch={value => this.tranSearch(value)} enterButton /> |
| | | </div> |
| | | {selectTran ? <div className="script-table"> |
| | | <div className="app-action"> |
| | | <Button className="mk-green" onClick={() => this.setState({ scriptVisible: true })}>添加脚本</Button> |
| | | <Button className="mk-danger" onClick={this.deleteScripts} style={{marginLeft: '15px'}}>删除</Button> |
| | | <Search placeholder="综合搜索" defaultValue={this.state.scriptSearchKey} onSearch={value => this.scriptSearch(value)} enterButton /> |
| | | </div> |
| | | <Table |
| | | rowKey="ID" |
| | | columns={scriptcolumns} |
| | | dataSource={scriptlist} |
| | | pagination={{ |
| | | current: this.state.scriptIndex, |
| | | pageSize: 10, |
| | | total: this.state.scriptTotal || 0, |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条` |
| | | }} |
| | | rowSelection={{ type: 'checkbox', selectedRowKeys: selectScriptKeys, onChange: this.onScriptChange }} |
| | | onRow={(record) => ({ onClick: () => this.onScriptSelect(record)})} |
| | | onChange={this.changeScriptTable} |
| | | /> |
| | | </div> : null} |
| | | <Table |
| | | rowKey="ID" |
| | | columns={transcolumns} |
| | | dataSource={translist} |
| | | pagination={{ |
| | | current: this.state.transIndex, |
| | | pageSize: 10, |
| | | total: this.state.transTotal || 0, |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条` |
| | | }} |
| | | rowSelection={{ type: 'radio', selectedRowKeys: selectTran ? [selectTran.ID] : [], onChange: this.onTransChange }} |
| | | onRow={(record) => ({ onClick: () => { |
| | | if (this.forbid) { |
| | | this.forbid = false |
| | | return |
| | | } |
| | | this.onTransSelect(record) |
| | | }})} |
| | | onChange={this.changeTable} |
| | | /> |
| | | </div> |
| | | <div className="right-view"> |
| | | {selectApp ? <div className="app-title">{selectApp.remark}</div> : null} |
| | | {selectApp && selectApp.sublist.map((item, index) => { |
| | | let css = skinStyle[item.css] ? skinStyle[item.css].name : '' |
| | | let color = skinStyle[item.css] ? skinStyle[item.css].color : '#e8e8e8' |
| | | let binding = '' |
| | | if (item.user_binding === 'true') { |
| | | binding = '用户绑定' |
| | | } |
| | | if (item.share === 'true') { |
| | | binding = binding ? binding + '、分享' : '分享' |
| | | } |
| | | |
| | | return ( |
| | | <div className="sub-app" key={index} style={{borderColor: color}}> |
| | | <Row> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">应用类型:</div> |
| | | <div className="content" style={{fontSize: '18px', fontWeight: 600}}>{item.typename}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">语言:</div> |
| | | <div className="content" style={{textDecoration: 'underline'}}>{langs[item.lang]}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">权限管理:</div> |
| | | <div className="content">{item.role_type === 'false' ? '不启用' : '启用'}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | {/* <div className="label">皮肤:</div> |
| | | <div className="content" style={{color: color}}>{css}</div> */} |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">皮肤:</div> |
| | | <div className="content" style={{color: color}}>{css}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | {/* {binding ? <div className="label"> |
| | | <Tooltip placement="topLeft" title="微信公众号登录时,系统用户与微信用户的绑定方式。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 用户绑定: |
| | | </Tooltip> |
| | | </div> : null} */} |
| | | {binding ? <div className="label"> |
| | | <Tooltip placement="topLeft" title="微信公众号或小程序中,绑定系统用户、自定义分享等功能。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 扩展功能: |
| | | </Tooltip> |
| | | </div> : null} |
| | | <div className="content">{binding}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">标题:</div> |
| | | <div className="content">{item.title || '无'}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">网站头像:</div> |
| | | <div className="content">{item.favicon ? <img style={{width: '18px', height: '18px', borderRadius: '4px'}} src={item.favicon} alt="" /> : '无'}</div> |
| | | </div> |
| | | </Col> |
| | | </Row> |
| | | <div className="action"> |
| | | {item.lang !== 'zh-CN' ? <TransMenu app={item} supApp={selectApp} /> : null} |
| | | <Button type="link" onClick={() => this.jumpMenu(item)} style={{color: 'rgba(30, 228, 224, 1)'}}>菜单&权限</Button> |
| | | <Button type="link" onClick={() => this.setState({ selectSubApp: item, subVisible: 'edit' })} style={{color: '#8E44AD'}}>修改</Button> |
| | | <Button type="link" onClick={() => this.deleteSubApp(item)} style={{color: '#ff4d4f'}}>删除</Button> |
| | | <Button type="link" onClick={() => this.jumpApp(item)}>编辑应用</Button> |
| | | <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${window.GLOB.baseurl}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}` }}></Paragraph> |
| | | </div> |
| | | </div> |
| | | ) |
| | | })} |
| | | </div> |
| | | {selectTran ? <div className="script-table"> |
| | | <div className="app-action"> |
| | | <Button className="mk-green" onClick={() => this.setState({ scriptVisible: true })}>添加脚本</Button> |
| | | <Button className="mk-danger" onClick={this.deleteScripts} style={{marginLeft: '15px'}}>删除</Button> |
| | | <Search placeholder="综合搜索" defaultValue={this.state.scriptSearchKey} onSearch={value => this.scriptSearch(value)} enterButton /> |
| | | </div> |
| | | <Table |
| | | rowKey="ID" |
| | | columns={scriptcolumns} |
| | | dataSource={scriptlist} |
| | | pagination={{ |
| | | current: this.state.scriptIndex, |
| | | pageSize: 10, |
| | | total: this.state.scriptTotal || 0, |
| | | showTotal: (total, range) => `${range[0]}-${range[1]} 共 ${total} 条` |
| | | }} |
| | | rowSelection={{ type: 'checkbox', selectedRowKeys: selectScriptKeys, onChange: this.onScriptChange }} |
| | | onRow={(record) => ({ onClick: () => this.onScriptSelect(record)})} |
| | | onChange={this.changeScriptTable} |
| | | /> |
| | | </div> : null} |
| | | </div> |
| | | <Modal |
| | | title={'编辑应用'} |
| | | width={'600px'} |
| | | maskClosable={false} |
| | | visible={visible !== false} |
| | | onCancel={() => this.setState({visible: false, confirmloading: false})} |
| | | confirmLoading={this.state.confirmloading} |
| | | onOk={this.submitCard} |
| | | cancelText="取消" |
| | | okText="确定" |
| | | destroyOnClose |
| | | > |
| | | <MutilForm type={visible} card={visible === 'edit' ? selectApp : ''} wrappedComponentRef={(inst) => this.mobcardRef = inst} inputSubmit={this.submitCard} /> |
| | | </Modal> |
| | | <Modal |
| | | title={transVisible === 'plus' ? '添加传输号' : '编辑传输号'} |
| | | width={'600px'} |
| | | maskClosable={false} |
| | | visible={transVisible !== false} |
| | | onCancel={() => this.setState({transVisible: false, confirmloading: false})} |
| | | confirmLoading={this.state.confirmloading} |
| | | onOk={this.submitTrans} |
| | | cancelText="取消" |
| | | okText="确定" |
| | | destroyOnClose |
| | | > |
| | | <TransForm type={transVisible} card={transVisible === 'edit' ? this.state.editTran : ''} wrappedComponentRef={(inst) => this.transRef = inst} inputSubmit={this.submitTrans} /> |
| | | </Modal> |
| | | <Modal |
| | | title={'添加脚本'} |
| | | width={900} |
| | | maskClosable={false} |
| | | visible={scriptVisible} |
| | | onCancel={() => this.setState({scriptVisible: false, confirmloading: false})} |
| | | confirmLoading={this.state.confirmloading} |
| | | onOk={this.submitScript} |
| | | cancelText="取消" |
| | | okText="确定" |
| | | destroyOnClose |
| | | > |
| | | <ScriptForm applist={applist} wrappedComponentRef={(inst) => this.scriptRef = inst} inputSubmit={this.submitScript} /> |
| | | </Modal> |
| | | <Modal |
| | | title={subVisible === 'plus' ? '添加子应用' : '编辑子应用'} |
| | | width={'850px'} |
| | | maskClosable={false} |
| | | visible={subVisible !== false} |
| | | onCancel={() => this.setState({subVisible: false, confirmloading: false})} |
| | | confirmLoading={this.state.confirmloading} |
| | | onOk={this.submitSubCard} |
| | | cancelText="取消" |
| | | okText="确定" |
| | | destroyOnClose |
| | | > |
| | | <SubMutilForm type={subVisible} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} /> |
| | | </Modal> |
| | | </ConfigProvider> |
| | | <div className="right-view"> |
| | | {selectApp ? <div className="app-title">{selectApp.remark}</div> : null} |
| | | {selectApp && selectApp.sublist.map((item, index) => { |
| | | let css = skinStyle[item.css] ? skinStyle[item.css].name : '' |
| | | let color = skinStyle[item.css] ? skinStyle[item.css].color : '#e8e8e8' |
| | | let binding = '' |
| | | if (item.user_binding === 'true') { |
| | | binding = '用户绑定' |
| | | } |
| | | if (item.share === 'true') { |
| | | binding = binding ? binding + '、分享' : '分享' |
| | | } |
| | | |
| | | return ( |
| | | <div className="sub-app" key={index} style={{borderColor: color}}> |
| | | <Row> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">应用类型:</div> |
| | | <div className="content" style={{fontSize: '18px', fontWeight: 600}}>{item.typename}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">语言:</div> |
| | | <div className="content" style={{textDecoration: 'underline'}}>{langs[item.lang]}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">权限管理:</div> |
| | | <div className="content">{item.role_type === 'false' ? '不启用' : '启用'}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | {/* <div className="label">皮肤:</div> |
| | | <div className="content" style={{color: color}}>{css}</div> */} |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">皮肤:</div> |
| | | <div className="content" style={{color: color}}>{css}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | {/* {binding ? <div className="label"> |
| | | <Tooltip placement="topLeft" title="微信公众号登录时,系统用户与微信用户的绑定方式。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 用户绑定: |
| | | </Tooltip> |
| | | </div> : null} */} |
| | | {binding ? <div className="label"> |
| | | <Tooltip placement="topLeft" title="微信公众号或小程序中,绑定系统用户、自定义分享等功能。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 扩展功能: |
| | | </Tooltip> |
| | | </div> : null} |
| | | <div className="content">{binding}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">标题:</div> |
| | | <div className="content">{item.title || '无'}</div> |
| | | </div> |
| | | </Col> |
| | | <Col span={12}> |
| | | <div className="app-item"> |
| | | <div className="label">网站头像:</div> |
| | | <div className="content">{item.favicon ? <img style={{width: '18px', height: '18px', borderRadius: '4px'}} src={item.favicon} alt="" /> : '无'}</div> |
| | | </div> |
| | | </Col> |
| | | </Row> |
| | | <div className="action"> |
| | | {item.lang !== 'zh-CN' ? <TransMenu app={item} supApp={selectApp} /> : null} |
| | | <Button type="link" onClick={() => this.jumpMenu(item)} style={{color: 'rgba(30, 228, 224, 1)'}}>菜单&权限</Button> |
| | | <Button type="link" onClick={() => this.setState({ selectSubApp: item, subVisible: 'edit' })} style={{color: '#8E44AD'}}>修改</Button> |
| | | <Button type="link" onClick={() => this.deleteSubApp(item)} style={{color: '#ff4d4f'}}>删除</Button> |
| | | <Button type="link" onClick={() => this.jumpApp(item)}>编辑应用</Button> |
| | | <Paragraph style={{display: 'inline-block', margin: 0}} copyable={{ text: `${window.GLOB.baseurl}${item.typename === 'pad' ? 'mob' : item.typename}/index.html#/index/${this.state.selectApp.kei_no}/${item.typename !== 'pc' ? item.typename + '/' : ''}${item.lang}` }}></Paragraph> |
| | | </div> |
| | | </div> |
| | | ) |
| | | })} |
| | | </div> |
| | | </div> |
| | | <Modal |
| | | title={'编辑应用'} |
| | | width={'600px'} |
| | | maskClosable={false} |
| | | visible={visible !== false} |
| | | onCancel={() => this.setState({visible: false, confirmloading: false})} |
| | | confirmLoading={this.state.confirmloading} |
| | | onOk={this.submitCard} |
| | | cancelText="取消" |
| | | okText="确定" |
| | | destroyOnClose |
| | | > |
| | | <MutilForm type={visible} card={visible === 'edit' ? selectApp : ''} wrappedComponentRef={(inst) => this.mobcardRef = inst} inputSubmit={this.submitCard} /> |
| | | </Modal> |
| | | <Modal |
| | | title={transVisible === 'plus' ? '添加传输号' : '编辑传输号'} |
| | | width={'600px'} |
| | | maskClosable={false} |
| | | visible={transVisible !== false} |
| | | onCancel={() => this.setState({transVisible: false, confirmloading: false})} |
| | | confirmLoading={this.state.confirmloading} |
| | | onOk={this.submitTrans} |
| | | cancelText="取消" |
| | | okText="确定" |
| | | destroyOnClose |
| | | > |
| | | <TransForm type={transVisible} card={transVisible === 'edit' ? this.state.editTran : ''} wrappedComponentRef={(inst) => this.transRef = inst} inputSubmit={this.submitTrans} /> |
| | | </Modal> |
| | | <Modal |
| | | title={'添加脚本'} |
| | | width={900} |
| | | maskClosable={false} |
| | | visible={scriptVisible} |
| | | onCancel={() => this.setState({scriptVisible: false, confirmloading: false})} |
| | | confirmLoading={this.state.confirmloading} |
| | | onOk={this.submitScript} |
| | | cancelText="取消" |
| | | okText="确定" |
| | | destroyOnClose |
| | | > |
| | | <ScriptForm applist={applist} wrappedComponentRef={(inst) => this.scriptRef = inst} inputSubmit={this.submitScript} /> |
| | | </Modal> |
| | | <Modal |
| | | title={subVisible === 'plus' ? '添加子应用' : '编辑子应用'} |
| | | width={'850px'} |
| | | maskClosable={false} |
| | | visible={subVisible !== false} |
| | | onCancel={() => this.setState({subVisible: false, confirmloading: false})} |
| | | confirmLoading={this.state.confirmloading} |
| | | onOk={this.submitSubCard} |
| | | cancelText="取消" |
| | | okText="确定" |
| | | destroyOnClose |
| | | > |
| | | <SubMutilForm type={subVisible} card={subVisible === 'edit' ? selectSubApp : ''} wrappedComponentRef={(inst) => this.submobcardRef = inst} inputSubmit={this.submitSubCard} /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import { notification, Spin, ConfigProvider } from 'antd' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | import { notification, Spin } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | |
| | | return ( |
| | | <div className="mk-base-design-wrap"> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Header/> |
| | | {this.state.tabview === 'CommonTable' ? |
| | | <ComTableConfig |
| | | menu={editMenu} |
| | | reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'SubTable' ? |
| | | <SubTable |
| | | menu={editMenu} |
| | | editTab={this.state.editTab} |
| | | editSubTab={this.state.editSubTab} |
| | | tabConfig={this.state.tabConfig} |
| | | btnTab={btnTab} |
| | | btnTabConfig={this.state.btnTabConfig} |
| | | config={subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'Modal' ? |
| | | <ModalConfig |
| | | menu={editMenu} |
| | | editTab={this.state.editTab} |
| | | tabConfig={this.state.tabConfig} |
| | | editSubTab={this.state.editSubTab} |
| | | subTabConfig={this.state.subTabConfig} |
| | | btnTab={btnTab} |
| | | btnTabConfig={this.state.btnTabConfig} |
| | | editAction={this.state.editAction} |
| | | subConfig={subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'TreePage' ? |
| | | <TreePageConfig |
| | | menu={editMenu} |
| | | reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'FormTab' ? |
| | | <UpdateFormTab |
| | | menu={editMenu} |
| | | btnTab={btnTab} |
| | | config={subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {loading ? <Spin className="loading-view" size="large"/> : null} |
| | | </ConfigProvider> |
| | | <Header/> |
| | | {this.state.tabview === 'CommonTable' ? |
| | | <ComTableConfig |
| | | menu={editMenu} |
| | | reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'SubTable' ? |
| | | <SubTable |
| | | menu={editMenu} |
| | | editTab={this.state.editTab} |
| | | editSubTab={this.state.editSubTab} |
| | | tabConfig={this.state.tabConfig} |
| | | btnTab={btnTab} |
| | | btnTabConfig={this.state.btnTabConfig} |
| | | config={subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'Modal' ? |
| | | <ModalConfig |
| | | menu={editMenu} |
| | | editTab={this.state.editTab} |
| | | tabConfig={this.state.tabConfig} |
| | | editSubTab={this.state.editSubTab} |
| | | subTabConfig={this.state.subTabConfig} |
| | | btnTab={btnTab} |
| | | btnTabConfig={this.state.btnTabConfig} |
| | | editAction={this.state.editAction} |
| | | subConfig={subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'TreePage' ? |
| | | <TreePageConfig |
| | | menu={editMenu} |
| | | reloadmenu={() => {localStorage.setItem('menuUpdate', new Date().getTime())}} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {this.state.tabview === 'FormTab' ? |
| | | <UpdateFormTab |
| | | menu={editMenu} |
| | | btnTab={btnTab} |
| | | config={subConfig} |
| | | handleView={this.handleView} |
| | | /> : null |
| | | } |
| | | {loading ? <Spin className="loading-view" size="large"/> : null} |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | import { withRouter } from 'react-router' |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import { ConfigProvider, notification, Modal, Collapse, Button, Spin } from 'antd' |
| | | import { notification, Modal, Collapse, Button, Spin } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, LeftOutlined, UserOutlined, EllipsisOutlined } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | // import MKEmitter from '@/utils/events.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import getWrapForm from './options' |
| | |
| | | const { loading, settingshow, controlshow, MenuId, config, menuloading } = this.state |
| | | |
| | | return ( |
| | | <ConfigProvider locale={antdZhCN}> |
| | | <div className="mk-mob-view" id="mk-mob-design-view"> |
| | | <Header/> |
| | | {loading ? <Spin className="view-spin" size="large" /> : null} |
| | | <div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}> |
| | | <div className="draw"> |
| | | {settingshow ? <DoubleLeftOutlined onClick={() => {this.setState({settingshow: false})}} /> : null} |
| | | {!settingshow ? <DoubleRightOutlined onClick={() => {this.setState({settingshow: true})}} /> : null} |
| | | </div> |
| | | <div className="pc-setting-tools"> |
| | | <Collapse accordion defaultActiveKey="basedata" bordered={false}> |
| | | {/* 基本信息 */} |
| | | <Panel header="基本信息" forceRender key="basedata"> |
| | | {/* 菜单信息 */} |
| | | {config ? <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | </Panel> |
| | | <Panel header="页面样式" key="background"> |
| | | {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null} |
| | | </Panel> |
| | | </Collapse> |
| | | </div> |
| | | <div className="mk-mob-view" id="mk-mob-design-view"> |
| | | <Header/> |
| | | {loading ? <Spin className="view-spin" size="large" /> : null} |
| | | <div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}> |
| | | <div className="draw"> |
| | | {settingshow ? <DoubleLeftOutlined onClick={() => {this.setState({settingshow: false})}} /> : null} |
| | | {!settingshow ? <DoubleRightOutlined onClick={() => {this.setState({settingshow: true})}} /> : null} |
| | | </div> |
| | | <div className={'menu-control ' + (!controlshow ? 'hidden' : '')}> |
| | | <div className="draw"> |
| | | {controlshow ? <DoubleRightOutlined onClick={() => {this.setState({controlshow: false})}}/> : null} |
| | | {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null} |
| | | </div> |
| | | <div className="wrap"> |
| | | <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>保存</Button> |
| | | <NormalForm title="即时通信设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <Button type="default" style={{borderColor: 'rgb(64, 169, 255)', color: 'rgb(64, 169, 255)'}}>设置</Button> |
| | | </NormalForm> |
| | | <Button type="default" className="mk-border-purple" onClick={this.backView}>后退</Button> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | | <Transfer MenuID={MenuId} /> |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | <div className="pc-setting-tools"> |
| | | <Collapse accordion defaultActiveKey="basedata" bordered={false}> |
| | | {/* 基本信息 */} |
| | | <Panel header="基本信息" forceRender key="basedata"> |
| | | {/* 菜单信息 */} |
| | | {config ? <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | updateConfig={this.updateConfig} |
| | | /> : null} |
| | | </Panel> |
| | | <Panel header="页面样式" key="background"> |
| | | {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null} |
| | | </Panel> |
| | | </Collapse> |
| | | </div> |
| | | <div className={'menu-body menu-view'}> |
| | | <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> |
| | | <div className="instant-message" style={config ? config.style : null}> |
| | | <div className="header"> |
| | | <LeftOutlined/> |
| | | <span className="title">朋友</span> |
| | | {config && config.wrap.linkmenu ? <EllipsisOutlined onDoubleClick={this.changeEditMenu}/> : null} |
| | | </div> |
| | | <div className="mk-content-wrap"> |
| | | <div className="line-wrap"> |
| | | <div className="time-line">12:34</div> |
| | | <div className="line-msg"> |
| | | <div className="portrait"> |
| | | <div className="img"><UserOutlined /></div> |
| | | </div> |
| | | <div className="msg"> |
| | | <div className="title">朋友</div> |
| | | <div className="words">您好</div> |
| | | </div> |
| | | </div> |
| | | <div className={'menu-control ' + (!controlshow ? 'hidden' : '')}> |
| | | <div className="draw"> |
| | | {controlshow ? <DoubleRightOutlined onClick={() => {this.setState({controlshow: false})}}/> : null} |
| | | {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null} |
| | | </div> |
| | | <div className="wrap"> |
| | | <Button type="primary" onClick={this.submitConfig} id="save-config" loading={menuloading}>保存</Button> |
| | | <NormalForm title="即时通信设置" width={800} update={this.updateWrap} getForms={this.getWrapForms}> |
| | | <Button type="default" style={{borderColor: 'rgb(64, 169, 255)', color: 'rgb(64, 169, 255)'}}>设置</Button> |
| | | </NormalForm> |
| | | <Button type="default" className="mk-border-purple" onClick={this.backView}>后退</Button> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | | <Transfer MenuID={MenuId} /> |
| | | <Button type="default" onClick={this.closeView}>关闭</Button> |
| | | </div> |
| | | </div> |
| | | <div className={'menu-body menu-view'}> |
| | | <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> |
| | | <div className="instant-message" style={config ? config.style : null}> |
| | | <div className="header"> |
| | | <LeftOutlined/> |
| | | <span className="title">朋友</span> |
| | | {config && config.wrap.linkmenu ? <EllipsisOutlined onDoubleClick={this.changeEditMenu}/> : null} |
| | | </div> |
| | | <div className="mk-content-wrap"> |
| | | <div className="line-wrap"> |
| | | <div className="time-line">12:34</div> |
| | | <div className="line-msg"> |
| | | <div className="portrait"> |
| | | <div className="img"><UserOutlined /></div> |
| | | </div> |
| | | </div> |
| | | <div className="line-wrap"> |
| | | <div className="time-line">12:45</div> |
| | | <div className="line-msg right"> |
| | | <div className="msg"> |
| | | <div className="words"> |
| | | 您好 |
| | | </div> |
| | | </div> |
| | | <div className="portrait"> |
| | | <div className="img"><UserOutlined /></div> |
| | | </div> |
| | | <div className="msg"> |
| | | <div className="title">朋友</div> |
| | | <div className="words">您好</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div className="send-wrap"> |
| | | <div className="adm-input"></div> |
| | | <div className="send"><Button>发送</Button></div> |
| | | <div className="line-wrap"> |
| | | <div className="time-line">12:45</div> |
| | | <div className="line-msg right"> |
| | | <div className="msg"> |
| | | <div className="words"> |
| | | 您好 |
| | | </div> |
| | | </div> |
| | | <div className="portrait"> |
| | | <div className="img"><UserOutlined /></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div className="send-wrap"> |
| | | <div className="adm-input"></div> |
| | | <div className="send"><Button>发送</Button></div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <StyleController /> |
| | | </div> |
| | | </ConfigProvider> |
| | | <StyleController /> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import { ConfigProvider } from 'antd' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | |
| | | import Header from './header' |
| | | import History from './history' |
| | |
| | | render () { |
| | | return ( |
| | | <div className="interface-view"> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Header key="header"/> |
| | | <History key="history"/> |
| | | <WorkSpace key="workspace"/> |
| | | </ConfigProvider> |
| | | <Header key="header"/> |
| | | <History key="history"/> |
| | | <WorkSpace key="workspace"/> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | if (res.lang_translation_js && res.lang_data && res.lang_data[0] && (res.lang_data.length > 1 || res.lang_data[0].Lang !== 'zh-CN')) { |
| | | let lang = sessionStorage.getItem('lang') |
| | | let js_trans = res.lang_translation_js.map(item => { |
| | | if (['not_empty', 'not_zero', 'max_limit', 'less_limit']) { |
| | | item.translation = ' ' + item.translation |
| | | } |
| | | if (['input_tip', 'select_tip', 'max_limit', 'less_limit']) { |
| | | item.translation = item.translation + ' ' |
| | | } |
| | | if (lang === item.lang) { |
| | | window.GLOB.dict[item.msn_code] = item.translation |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import { ConfigProvider } from 'antd' |
| | | // import enUS from 'antd/es/locale/en_US' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import Header from '@/components/header' |
| | |
| | | |
| | | return ( |
| | | <div className="mk-main-view"> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Header key="header"/> |
| | | {navBar === 'shutter' ? <Sidemenu key="sidemenu"/> : null} |
| | | {navBar === 'shutter' || navBar === 'menu_board_navigation' ? |
| | | <Tabview key="tabview"/> : |
| | | <Breadview key="breadview"/>} |
| | | {window.GLOB.systemType === 'production' ? <QueryLog /> : null} |
| | | </ConfigProvider> |
| | | <Header key="header"/> |
| | | {navBar === 'shutter' ? <Sidemenu key="sidemenu"/> : null} |
| | | {navBar === 'shutter' || navBar === 'menu_board_navigation' ? |
| | | <Tabview key="tabview"/> : |
| | | <Breadview key="breadview"/>} |
| | | {window.GLOB.systemType === 'production' ? <QueryLog /> : null} |
| | | <ImgScale /> |
| | | </div> |
| | | ) |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { ConfigProvider, notification, Modal, Collapse, Card, Switch, Button, Typography, Spin } from 'antd' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography, Spin } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | import html2canvas from 'html2canvas' |
| | | import md5 from 'md5' |
| | |
| | | import Api from '@/api' |
| | | import Utils, { setGLOBFuncs } from '@/utils/utils.js' |
| | | import { langs } from '@/store/options' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { getTables, getFuncsAndInters, getLangTrans } from '@/utils/utils-custom.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | const { Panel } = Collapse |
| | | const { confirm } = Modal |
| | | const { Paragraph } = Typography |
| | | const _locale = antdZhCN |
| | | |
| | | const MenuForm = asyncComponent(() => import('./menuform')) |
| | | const HomeForm = asyncComponent(() => import('./homeform')) |
| | |
| | | const { view, comloading, MenuType, MenuId, config, settingshow, ParentId, menuloading, eyeopen, needUpdate, langName } = this.state |
| | | |
| | | return ( |
| | | <ConfigProvider locale={_locale}> |
| | | <> |
| | | <Header menuName={config ? config.MenuName + langName : ''}/> |
| | | <DndProvider backend={HTML5Backend}> |
| | | {view !== 'popview' ? <div className={'pc-menu-view ' + (MenuType || '')}> |
| | |
| | | <ModalController /> |
| | | <StyleController /> |
| | | <StyleCombController /> |
| | | </ConfigProvider> |
| | | </> |
| | | ) |
| | | } |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import { Spin, notification, ConfigProvider } from 'antd' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | import { Spin, notification } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import asyncComponent from '@/utils/asyncLoadComponent' |
| | |
| | | |
| | | return ( |
| | | <div className="main-iframe"> |
| | | <ConfigProvider locale={zhCN}> |
| | | {loading ? <Spin size="large" /> : null} |
| | | {!loading && type === 'CustomPage' ? <CustomPage MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null} |
| | | {!loading && type === 'BaseTable' ? <BaseTable MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null} |
| | | </ConfigProvider> |
| | | {loading ? <Spin size="large" /> : null} |
| | | {!loading && type === 'CustomPage' ? <CustomPage MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null} |
| | | {!loading && type === 'BaseTable' ? <BaseTable MenuID={MenuId} param={{$BID: BID}} changeTemp={this.changeTemp}/> : null} |
| | | <ImgScale /> |
| | | </div> |
| | | ) |
| | |
| | | import { withRouter } from 'react-router' |
| | | import { is, fromJS } from 'immutable' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { ConfigProvider, notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd' |
| | | import { notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import Utils, { setGLOBFuncs } from '@/utils/utils.js' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MenuUtils, { getTables, getFuncsAndInters, getLangTrans } from '@/utils/utils-custom.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | const { view, viewType, comloading, loading, settingshow, controlshow, activeKey, MenuId, config, menuloading, adapters, eyeopen, needUpdate } = this.state |
| | | |
| | | return ( |
| | | <ConfigProvider locale={antdZhCN}> |
| | | <div className={'mk-mob-view ' + viewType} id="mk-mob-design-view"> |
| | | <Header/> |
| | | {loading ? <Spin className="view-spin" size="large" /> : null} |
| | | <DndProvider backend={HTML5Backend}> |
| | | {view !== 'popview' ? <><div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}> |
| | | <div className="draw"> |
| | | {settingshow ? <DoubleLeftOutlined onClick={() => {this.setState({settingshow: false})}} /> : null} |
| | | {!settingshow ? <DoubleRightOutlined onClick={() => {this.setState({settingshow: true})}} /> : null} |
| | | </div> |
| | | <div className="pc-setting-tools"> |
| | | <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> |
| | | {/* 基本信息 */} |
| | | <Panel header="基本信息" forceRender className="basedata" key="basedata"> |
| | | {config ? <> |
| | | <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | adapters={adapters} |
| | | updateConfig={(con) => { |
| | | this.updateConfig(con) |
| | | if (con.direction !== config.direction) { |
| | | this.changeView(con.direction) |
| | | } |
| | | }} |
| | | /> |
| | | <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '10px 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> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | </> : null} |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | | <Panel header="组件" className="component" key="component"> |
| | | <SourceWrap /> |
| | | </Panel> |
| | | <Panel header="元素" key="element"> |
| | | <Modulecell /> |
| | | </Panel> |
| | | <Panel header="页面样式" key="background"> |
| | | {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null} |
| | | </Panel> |
| | | </Collapse> |
| | | </div> |
| | | <div className={'mk-mob-view ' + viewType} id="mk-mob-design-view"> |
| | | <Header/> |
| | | {loading ? <Spin className="view-spin" size="large" /> : null} |
| | | <DndProvider backend={HTML5Backend}> |
| | | {view !== 'popview' ? <><div className={'menu-setting ' + (!settingshow ? 'hidden' : '')}> |
| | | <div className="draw"> |
| | | {settingshow ? <DoubleLeftOutlined onClick={() => {this.setState({settingshow: false})}} /> : null} |
| | | {!settingshow ? <DoubleRightOutlined onClick={() => {this.setState({settingshow: true})}} /> : null} |
| | | </div> |
| | | <div className={'menu-control' + (!controlshow ? ' hidden' : '')}> |
| | | <div className="draw"> |
| | | {controlshow ? <DoubleRightOutlined onClick={() => {this.setState({controlshow: false})}}/> : null} |
| | | {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null} |
| | | </div> |
| | | <div className="wrap"> |
| | | <Button type="primary" className={needUpdate ? 'update-tip' : ''} 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}/> |
| | | {config ? <Debug config={config}/> : null} |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | | <PasteController insert={this.insert} /> |
| | | <TableNodes config={config} /> |
| | | <ViewNodes config={config} MenuId={MenuId}/> |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | | <PictureController/> |
| | | <Quotecomponent config={config} updateConfig={this.updateConfig}/> |
| | | <StyleCombControlButton menu={config} /> |
| | | <Button className="mk-border-green set-home" onClick={this.setHomeView}><HomeOutlined /> 设为首页</Button> |
| | | <Button className="mk-border-purple set-login" onClick={this.setLoginView}><LoginOutlined /> 设为登录页</Button> |
| | | <ReplaceField type="custom" 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> |
| | | </div> |
| | | <div className="pc-setting-tools"> |
| | | <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> |
| | | {/* 基本信息 */} |
| | | <Panel header="基本信息" forceRender className="basedata" key="basedata"> |
| | | {config ? <> |
| | | <MenuForm |
| | | config={config} |
| | | MenuId={MenuId} |
| | | adapters={adapters} |
| | | updateConfig={(con) => { |
| | | this.updateConfig(con) |
| | | if (con.direction !== config.direction) { |
| | | this.changeView(con.direction) |
| | | } |
| | | }} |
| | | /> |
| | | <UrlFieldComponent config={config} updateConfig={this.updateConfig}/> |
| | | {/* 表名添加 */} |
| | | <TableComponent config={config} updatetable={this.updateConfig}/> |
| | | <Paragraph style={{padding: '15px 0px 0px 18px'}} copyable={{ text: MenuId }}>菜单ID</Paragraph> |
| | | <Paragraph style={{padding: '10px 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> |
| | | <NormalCss config={config} updateConfig={this.updateConfig}/> |
| | | </> : null} |
| | | </Panel> |
| | | {/* 组件添加 */} |
| | | <Panel header="组件" className="component" key="component"> |
| | | <SourceWrap /> |
| | | </Panel> |
| | | <Panel header="元素" key="element"> |
| | | <Modulecell /> |
| | | </Panel> |
| | | <Panel header="页面样式" key="background"> |
| | | {config ? <BgController config={config} updateConfig={this.updateConfig} /> : null} |
| | | </Panel> |
| | | </Collapse> |
| | | </div> |
| | | <div className={'menu-body menu-view' + (menuloading ? ' saving' : '') + (eyeopen ? ' eye-open' : '')}> |
| | | {config && !comloading ? <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> |
| | | <MobShell menu={config} handleList={this.updateConfig} /> |
| | | </div> : null} |
| | | </div></> : <PopView btn={this.state.popConfig} save={this.submitPopConfig} cancel={this.closePop}/>} |
| | | </DndProvider> |
| | | <StyleController /> |
| | | <StyleCombController /> |
| | | <ModalController /> |
| | | <SearchController /> |
| | | </div> |
| | | </ConfigProvider> |
| | | </div> |
| | | <div className={'menu-control' + (!controlshow ? ' hidden' : '')}> |
| | | <div className="draw"> |
| | | {controlshow ? <DoubleRightOutlined onClick={() => {this.setState({controlshow: false})}}/> : null} |
| | | {!controlshow ? <DoubleLeftOutlined onClick={() => {this.setState({controlshow: true})}}/> : null} |
| | | </div> |
| | | <div className="wrap"> |
| | | <Button type="primary" className={needUpdate ? 'update-tip' : ''} 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}/> |
| | | {config ? <Debug config={config}/> : null} |
| | | <Button className="mk-border-purple" onClick={() => this.setState({eyeopen: !eyeopen})}>{!eyeopen ? <EyeOutlined /> : <EyeInvisibleOutlined />} 组件名</Button> |
| | | <CreateView resetmenu={this.getAppMenus} /> |
| | | <PasteController insert={this.insert} /> |
| | | <TableNodes config={config} /> |
| | | <ViewNodes config={config} MenuId={MenuId}/> |
| | | <SysInterface config={config} updateConfig={this.updateConfig}/> |
| | | <PictureController/> |
| | | <Quotecomponent config={config} updateConfig={this.updateConfig}/> |
| | | <StyleCombControlButton menu={config} /> |
| | | <Button className="mk-border-green set-home" onClick={this.setHomeView}><HomeOutlined /> 设为首页</Button> |
| | | <Button className="mk-border-purple set-login" onClick={this.setLoginView}><LoginOutlined /> 设为登录页</Button> |
| | | <ReplaceField type="custom" 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> |
| | | </div> |
| | | </div> |
| | | <div className={'menu-body menu-view' + (menuloading ? ' saving' : '') + (eyeopen ? ' eye-open' : '')}> |
| | | {config && !comloading ? <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> |
| | | <MobShell menu={config} handleList={this.updateConfig} /> |
| | | </div> : null} |
| | | </div></> : <PopView btn={this.state.popConfig} save={this.submitPopConfig} cancel={this.closePop}/>} |
| | | </DndProvider> |
| | | <StyleController /> |
| | | <StyleCombController /> |
| | | <ModalController /> |
| | | <SearchController /> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | |
| | | import { withRouter } from 'react-router' |
| | | import { is, fromJS } from 'immutable' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { ConfigProvider, notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd' |
| | | import { notification, Modal, Collapse, Switch, Button, message, Spin, Typography } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined, HomeOutlined, LoginOutlined, ArrowLeftOutlined, EyeOutlined, EyeInvisibleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | |
| | | import Api from '@/api' |
| | | import Utils, { setGLOBFuncs } from '@/utils/utils.js' |
| | | import { getTables, getFuncsAndInters, getLangTrans } from '@/utils/utils-custom.js' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | const { view, loading, comloading, activeKey, settingshow, controlshow, MenuId, config, menuloading, eyeopen, needUpdate } = this.state |
| | | |
| | | return ( |
| | | <ConfigProvider locale={antdZhCN}> |
| | | <> |
| | | <DndProvider backend={HTML5Backend}> |
| | | {view !== 'popview' ? <div className={'mk-pc-view '} id="mk-pc-design-view"> |
| | | {loading ? <Spin className="view-spin" size="large" /> : null} |
| | |
| | | <StyleController /> |
| | | <StyleCombController /> |
| | | <ModalController /> |
| | | </ConfigProvider> |
| | | </> |
| | | ) |
| | | } |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import { fromJS } from 'immutable' |
| | | import { Spin, notification, Button, Table, Modal, ConfigProvider, Tree, Input, Empty } from 'antd' |
| | | import { Spin, notification, Button, Table, Modal, Tree, Input, Empty } from 'antd' |
| | | import moment from 'moment' |
| | | import md5 from 'md5' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | import { ApiOutlined } from '@ant-design/icons' |
| | | |
| | | import Api from '@/api' |
| | |
| | | |
| | | return ( |
| | | <div className="mk-role-manage"> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Header app={app} /> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <Spin size="large" /> |
| | | </div> : null |
| | | } |
| | | <div className="view-wrap"> |
| | | <div className="left-view"> |
| | | <div className="app-table"> |
| | | <div className="app-action"> |
| | | <Button className="mk-green" onClick={this.triggerThaw}>解冻菜单</Button> |
| | | <Search placeholder="综合搜索" onSearch={value => this.setState({ searchkey: value })} enterButton /> |
| | | </div> |
| | | <Table |
| | | rowKey="MenuID" |
| | | columns={columns} |
| | | dataSource={_menulist} |
| | | pagination={false} |
| | | onChange={this.changeTable} |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div className="right-view"> |
| | | <Header app={app} /> |
| | | {loading ? |
| | | <div className="loading-mask"> |
| | | <Spin size="large" /> |
| | | </div> : null |
| | | } |
| | | <div className="view-wrap"> |
| | | <div className="left-view"> |
| | | <div className="app-table"> |
| | | <div className="app-action"> |
| | | <Button className="mk-primary" onClick={this.initTree}>重置</Button> |
| | | {/* <Button className="mk-purple" onClick={this.syncTree}>同步</Button> */} |
| | | <Button className="mk-green save" onClick={this.saveTree}>保存</Button> |
| | | <Button className="mk-green" onClick={this.triggerThaw}>解冻菜单</Button> |
| | | <Search placeholder="综合搜索" onSearch={value => this.setState({ searchkey: value })} enterButton /> |
| | | </div> |
| | | {trees && trees.length ? <Tree |
| | | className="draggable-tree" |
| | | defaultExpandedKeys={this.state.expandedKeys} |
| | | // showLine |
| | | draggable |
| | | blockNode |
| | | onDrop={this.onDrop} |
| | | > |
| | | {this.renderNode(trees)} |
| | | </Tree> : <div className="empty"> |
| | | <Empty /> |
| | | </div>} |
| | | <Table |
| | | rowKey="MenuID" |
| | | columns={columns} |
| | | dataSource={_menulist} |
| | | pagination={false} |
| | | onChange={this.changeTable} |
| | | /> |
| | | </div> |
| | | </div> |
| | | <Modal |
| | | title="解除冻结" |
| | | visible={this.state.visible} |
| | | width={600} |
| | | onOk={this.thawSubmit} |
| | | confirmLoading={this.state.confirmLoading} |
| | | onCancel={() => this.setState({visible: false, targetKeys: []})} |
| | | destroyOnClose |
| | | > |
| | | <TransferForm onChange={(vals) => this.setState({targetKeys: vals})} menulist={this.state.thawmenulist}/> |
| | | </Modal> |
| | | </ConfigProvider> |
| | | <div className="right-view"> |
| | | <div className="app-action"> |
| | | <Button className="mk-primary" onClick={this.initTree}>重置</Button> |
| | | {/* <Button className="mk-purple" onClick={this.syncTree}>同步</Button> */} |
| | | <Button className="mk-green save" onClick={this.saveTree}>保存</Button> |
| | | </div> |
| | | {trees && trees.length ? <Tree |
| | | className="draggable-tree" |
| | | defaultExpandedKeys={this.state.expandedKeys} |
| | | // showLine |
| | | draggable |
| | | blockNode |
| | | onDrop={this.onDrop} |
| | | > |
| | | {this.renderNode(trees)} |
| | | </Tree> : <div className="empty"> |
| | | <Empty /> |
| | | </div>} |
| | | </div> |
| | | </div> |
| | | <Modal |
| | | title="解除冻结" |
| | | visible={this.state.visible} |
| | | width={600} |
| | | onOk={this.thawSubmit} |
| | | confirmLoading={this.state.confirmLoading} |
| | | onCancel={() => this.setState({visible: false, targetKeys: []})} |
| | | destroyOnClose |
| | | > |
| | | <TransferForm onChange={(vals) => this.setState({targetKeys: vals})} menulist={this.state.thawmenulist}/> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import { ConfigProvider } from 'antd' |
| | | import { withRouter } from 'react-router-dom' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import Header from './header' |
| | |
| | | render () { |
| | | return ( |
| | | <div className="mk-main-view"> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Sidemenu key="sidemenu"/> |
| | | <Tabview key="tabview"/> |
| | | <Header key="header"/> |
| | | </ConfigProvider> |
| | | <Sidemenu key="sidemenu"/> |
| | | <Tabview key="tabview"/> |
| | | <Header key="header"/> |
| | | <ImgScale /> |
| | | </div> |
| | | ) |
| | |
| | | import React, {Component} from 'react' |
| | | import { ConfigProvider } from 'antd' |
| | | import { withRouter } from 'react-router-dom' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | |
| | | import Header from '../systemfunc/header' |
| | | import Proc from './proc' |
| | |
| | | |
| | | return ( |
| | | <div className="mk-proc-view"> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Header key="header"/> |
| | | <Proc func={func} /> |
| | | </ConfigProvider> |
| | | <Header key="header"/> |
| | | <Proc func={func} /> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | import { is, fromJS } from 'immutable' |
| | | import moment from 'moment' |
| | | import HTML5Backend from 'react-dnd-html5-backend' |
| | | import { ConfigProvider, notification, Modal, Collapse, Card, Switch, Button, Typography } from 'antd' |
| | | import { notification, Modal, Collapse, Card, Switch, Button, Typography } from 'antd' |
| | | import { DoubleLeftOutlined, DoubleRightOutlined } from '@ant-design/icons' |
| | | import md5 from 'md5' |
| | | |
| | | import Api from '@/api' |
| | | import Utils, { setGLOBFuncs } from '@/utils/utils.js' |
| | | import { langs } from '@/store/options' |
| | | import antdZhCN from 'antd/es/locale/zh_CN' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import { getTables, getFuncsAndInters, getLangTrans } from '@/utils/utils-custom.js' |
| | | import SourceElement from '@/templates/zshare/dragsource' |
| | |
| | | const { Panel } = Collapse |
| | | const { confirm } = Modal |
| | | const { Paragraph } = Typography |
| | | const _locale = antdZhCN |
| | | |
| | | const MenuForm = asyncComponent(() => import('./menuform')) |
| | | const PopView = asyncComponent(() => import('./popview')) |
| | |
| | | const { view, activeKey, comloading, MenuId, config, settingshow, ParentId, menuloading, langName } = this.state |
| | | |
| | | return ( |
| | | <ConfigProvider locale={_locale}> |
| | | <> |
| | | <Header menuName={config ? config.MenuName + langName : ''}/> |
| | | <DndProvider backend={HTML5Backend}> |
| | | {view !== 'popview' ? <div className="pc-table-view"> |
| | |
| | | </DndProvider> |
| | | <StyleController /> |
| | | <ModalController /> |
| | | </ConfigProvider> |
| | | </> |
| | | ) |
| | | } |
| | | } |