| | |
| | | const { value, card } = this.props |
| | | let color = card.color |
| | | let size = card.qrWidth || 50 |
| | | let width = size + 'px' |
| | | |
| | | if (/rgb/ig.test(color)) { |
| | | color = this.hexify(color) |
| | | } |
| | | if (size < 640) { |
| | | size = 640 |
| | | } |
| | | |
| | | return ( |
| | | <div className="qrcode-box"> |
| | | <div className="qrcode-box" style={{width: width, height: width}}> |
| | | <QrCode |
| | | value={value} |
| | | size={size} |
| | |
| | | .qrcode-box { |
| | | display: inline-block; |
| | | canvas { |
| | | vertical-align: top; |
| | | max-width: 100%; |
| | | max-height: 100%; |
| | | } |
| | | } |
| | |
| | | } |
| | | } else if (_funcType === 'mkBinding' || _funcType === 'mkUnBinding') { |
| | | _options.push('execSuccess', 'execError') |
| | | } else if (_funcType === 'scan') { |
| | | _options.push('openmenu') |
| | | } else if (_funcType === 'closetab') { |
| | | _options.push('refreshTab') |
| | | } |
| | |
| | | funTypes = [ |
| | | { value: 'mkBinding', text: '开通扫码登录' }, |
| | | { value: 'mkUnBinding', text: '用户解绑' }, |
| | | { value: 'scan', text: '扫一扫' }, |
| | | // { value: 'scan', text: '扫一扫' }, |
| | | { value: 'reAuth', text: '重新授权' }, |
| | | ] |
| | | } else { |
| | |
| | | }, 100) |
| | | } |
| | | |
| | | clearConfig = () => { |
| | | const _this = this |
| | | let _config = {...this.state.config, fields: []} |
| | | |
| | | confirm({ |
| | | content: '确定清空表单吗?', |
| | | onOk() { |
| | | _this.setState({ config: _config }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | completeSave = () => { |
| | | this.setState({saving: false}) |
| | | } |
| | |
| | | <div className="setting"> |
| | | <Card title={dict['header.menu.form.configurable']} bordered={false} extra={ |
| | | <div> |
| | | <Button type="danger" onClick={this.clearConfig}>清空</Button> |
| | | <EditComponent dict={dict} options={['form']} config={this.state.config} refresh={(res) => this.updateConfig(res.config)}/> |
| | | <Button type="primary" loading={saving} onClick={this.submitConfig}>保存</Button> |
| | | <Button onClick={this.cancelConfig}>返回</Button> |
| | |
| | | let param = params.shift() |
| | | let _outParam = null |
| | | let _localParam = null |
| | | let errRes = null |
| | | |
| | | if (widthNumber) { |
| | | this.setState({ |
| | |
| | | if (!res) return |
| | | |
| | | if (_localParam) { |
| | | |
| | | if (!res.status) { |
| | | errRes = res |
| | | } |
| | | return Api.getLocalConfig(_localParam) |
| | | } else if (res.status) { |
| | | if (params.length === 0) { |
| | |
| | | }).then(res => { |
| | | if (!res) return |
| | | |
| | | if (res.status) { |
| | | if (res.status && !errRes) { |
| | | if (params.length === 0) { |
| | | this.execSuccess(btn, res) |
| | | _resolve() |
| | |
| | | this.outerLoopRequest(params, btn, _resolve, widthNumber) |
| | | } |
| | | } else { |
| | | this.execError(res, btn) |
| | | this.execError(errRes || res, btn) |
| | | _resolve() |
| | | } |
| | | }) |
| | |
| | | |
| | | let printlist = [] |
| | | let templates = [] |
| | | let printCount = 1 |
| | | let printCount = +(formdata.printCount || formdata.PrintCount || formdata.printcount || formdata.Printcount || 1) |
| | | |
| | | if (formdata.printCount && typeof(formdata.printCount) === 'number' && formdata.printCount >= 1) { |
| | | printCount = formdata.printCount |
| | | if (isNaN(printCount) || printCount < 1) { |
| | | printCount = 1 |
| | | } |
| | | |
| | | new Promise(resolve => { |
| | | if (btn.intertype === 'system') { // 使用系统时,直接从表格或表单中选取数据 |
| | | let printcell = {} |
| | | |
| | | printcell.printType = formdata.printType || '' |
| | | printcell.printType = formdata.printType || formdata.PrintType || formdata.printtype || formdata.Printtype || '' |
| | | printcell.printCount = printCount |
| | | printcell.templateID = btn.verify.Template || '' |
| | | |
| | |
| | | // 系统打印数据,校验data字段 |
| | | if (btn.verify.printMode !== 'custom' && (!cell.data || cell.data.length === 0)) return |
| | | |
| | | cell.templateID = cell.templateID || btn.verify.Template |
| | | cell.printType = cell.printType || formdata.printType || '' |
| | | cell.templateID = cell.templateID || cell.TemplateID || cell.Templateid || cell.templateid || btn.verify.Template |
| | | cell.printType = cell.printType || cell.PrintType || cell.printtype || cell.Printtype || formdata.printType || formdata.PrintType || formdata.printtype || formdata.Printtype || '' |
| | | |
| | | let _printCount = printCount |
| | | if (cell.printCount && typeof(cell.printCount) === 'number' && cell.printCount >= 1) { |
| | | _printCount = cell.printCount |
| | | let _printCount = +(cell.printCount || cell.PrintCount || cell.printcount || cell.Printcount || 0) |
| | | |
| | | if (isNaN(_printCount) || _printCount < 1) { |
| | | _printCount = printCount |
| | | } |
| | | |
| | | cell.printCount = _printCount |
| | |
| | | task: { |
| | | taskID: Utils.getuuid(), |
| | | preview: false, |
| | | printer: printer, |
| | | printer: printer === 'lackprinter' ? '' : printer, |
| | | documents: [_cell] |
| | | } |
| | | }) |
| | |
| | | return |
| | | } |
| | | |
| | | let lackItems = printerList.filter(cell => cell.task.printer === 'lackprinter')[0] |
| | | // let lackItems = printerList.filter(cell => cell.task.printer === 'lackprinter')[0] |
| | | |
| | | if (!socket || socket.readyState !== 1 || socket.url !== 'ws://' + btn.verify.linkUrl) { |
| | | socket = new WebSocket('ws://' + btn.verify.linkUrl) |
| | | } else { |
| | | if (lackItems) { |
| | | let request = { |
| | | requestID: '', |
| | | version: '', |
| | | cmd: 'getPrinters' |
| | | } |
| | | socket.send(JSON.stringify(request)) |
| | | } else { |
| | | // if (lackItems) { |
| | | // let request = { |
| | | // requestID: '', |
| | | // version: '', |
| | | // cmd: 'getPrinters' |
| | | // } |
| | | // socket.send(JSON.stringify(request)) |
| | | // } else { |
| | | this.syncMessageSend(printerList) |
| | | |
| | | this.execSuccess({ |
| | |
| | | ErrMesg: '打印请求已发出。', |
| | | status: true |
| | | }) |
| | | } |
| | | // } |
| | | } |
| | | |
| | | // 打开Socket |
| | | socket.onopen = () =>{ |
| | | if (lackItems) { |
| | | let request = { |
| | | requestID: '', |
| | | version: '', |
| | | cmd: 'getPrinters' |
| | | } |
| | | socket.send(JSON.stringify(request)) |
| | | } else { |
| | | // if (lackItems) { |
| | | // let request = { |
| | | // requestID: '', |
| | | // version: '', |
| | | // cmd: 'getPrinters' |
| | | // } |
| | | // socket.send(JSON.stringify(request)) |
| | | // } else { |
| | | this.syncMessageSend(printerList) |
| | | |
| | | this.execSuccess({ |
| | |
| | | ErrMesg: '打印请求已发出。', |
| | | status: true |
| | | }) |
| | | } |
| | | // } |
| | | } |
| | | // 监听消息 |
| | | socket.onmessage = (event) => { |
| | |
| | | } |
| | | } |
| | | |
| | | if (data && data.cmd === 'getPrinters' && data.status) { |
| | | printerList = printerList.map(cell => { |
| | | if (cell.task.printer === 'lackprinter') { |
| | | cell.task.printer = data.defaultPrinter |
| | | } |
| | | return cell |
| | | }) |
| | | // if (data && data.cmd === 'getPrinters' && data.status) { |
| | | // printerList = printerList.map(cell => { |
| | | // if (cell.task.printer === 'lackprinter') { |
| | | // cell.task.printer = data.defaultPrinter |
| | | // } |
| | | // return cell |
| | | // }) |
| | | |
| | | this.syncMessageSend(printerList) |
| | | // this.syncMessageSend(printerList) |
| | | |
| | | this.execSuccess({ |
| | | ErrCode: 'S', |
| | | message: '', |
| | | ErrMesg: '打印请求已发出。', |
| | | status: true |
| | | }) |
| | | } else if (data && data.message && !data.status) { |
| | | // this.execSuccess({ |
| | | // ErrCode: 'S', |
| | | // message: '', |
| | | // ErrMesg: '打印请求已发出。', |
| | | // status: true |
| | | // }) |
| | | // } else if (data && data.message && !data.status) { |
| | | if (data && data.message && !data.status) { |
| | | this.execError({ |
| | | ErrCode: 'N', |
| | | message: data.message, |
| | |
| | | columns = columns.filter(item => item.import !== 'false') |
| | | let fields = columns.map(item => item.Column) |
| | | |
| | | if (!fields.includes('ID')) { |
| | | fields.unshift('ID') |
| | | } |
| | | if (!fields.includes('BID')) { |
| | | fields.unshift('BID') |
| | | } |
| | | fields.push('jskey') |
| | | |
| | | let _sql = `Declare @${btn.sheet} table (${columns.map(item => item.Column + ' ' + item.type).join(',')},jskey nvarchar(50) ) |
| | | Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@departmentcode nvarchar(50),@organization nvarchar(50),@login_city nvarchar(50),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512) |
| | |
| | | </Col> |
| | | {usefulfields ? <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | {usefulfields}, jskey |
| | | BID, ID, LoginUID, SessionUid, UserID, Appkey, UserName, FullName, RoleID, departmentcode, organization, login_city, {usefulfields} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | |
| | | }) |
| | | |
| | | let kei_no = res.appId.split(',')[1] |
| | | let lang = res.subAppId.split(',')[1] |
| | | let kei_no_detail = res.subAppId.split(',')[2] |
| | | let lang = res.subAppId ? res.subAppId.split(',')[1] : '' |
| | | let kei_no_detail = res.subAppId ? res.subAppId.split(',')[2] : '' |
| | | |
| | | let param = { |
| | | func: 's_sVersionDetail_CloudAdd', |
| | |
| | | cell.copyright = _param.copyright || '' |
| | | cell.logo = _param.logo || '' |
| | | cell.apptype = _param.apptype || '' |
| | | cell.delay = _param.delay || 0 |
| | | } |
| | | |
| | | return cell |
| | |
| | | sublist = sublist.filter(item => item.ID !== record.ID) |
| | | |
| | | // param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) |
| | | param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}','${window.btoa(window.encodeURIComponent(JSON.stringify({copyright: item.copyright || '', logo: item.logo || '', apptype: item.apptype || ''})))}'`) |
| | | param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}','${window.btoa(window.encodeURIComponent(JSON.stringify({copyright: item.copyright || '', logo: item.logo || '', apptype: item.apptype || '', delay: item.delay || 0})))}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | |
| | |
| | | |
| | | if (visible === 'edit') { |
| | | // param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) |
| | | param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}','${window.btoa(window.encodeURIComponent(JSON.stringify({copyright: item.copyright || '', logo: item.logo || '', apptype: item.apptype || ''})))}'`) |
| | | param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}','${window.btoa(window.encodeURIComponent(JSON.stringify({copyright: item.copyright || '', logo: item.logo || '', apptype: item.apptype || '', delay: item.delay || 0})))}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | } |
| | |
| | | } |
| | | |
| | | // param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) |
| | | param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}','${window.btoa(window.encodeURIComponent(JSON.stringify({copyright: item.copyright || '', logo: item.logo || '', apptype: item.apptype || ''})))}'`) |
| | | param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','false','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}','${item.user_binding || ''}','${item.sms_id || ''}','${window.btoa(window.encodeURIComponent(JSON.stringify({copyright: item.copyright || '', logo: item.logo || '', apptype: item.apptype || '', delay: item.delay || 0})))}'`) |
| | | param.LText = param.LText.join(' union all ') |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | |
| | |
| | | position: relative; |
| | | display: flex; |
| | | |
| | | .ant-table { |
| | | th { |
| | | white-space: nowrap; |
| | | } |
| | | td { |
| | | word-break: break-all; |
| | | } |
| | | } |
| | | .left-view { |
| | | flex: 1; |
| | | width: 60%; |
| | |
| | | |
| | | changeApp = (val) => { |
| | | const { applist } = this.props |
| | | const { type } = this.state |
| | | |
| | | let app = applist.filter(item => `${item.ID},${item.kei_no}` === val)[0] |
| | | |
| | |
| | | this.setState({sublist, subAppId, appId}, () => { |
| | | this.getViews() |
| | | }) |
| | | |
| | | if (type !== 'app') { |
| | | this.props.form.setFieldsValue({subAppId}) |
| | | } |
| | | } |
| | | |
| | | changeSubApp = (val) => { |
| | |
| | | }] |
| | | })( |
| | | <Select onChange={this.changeType}> |
| | | <Select.Option value="app">应用</Select.Option> |
| | | <Select.Option value="app">应用(基本信息)</Select.Option> |
| | | <Select.Option value="subapp">子应用</Select.Option> |
| | | <Select.Option value="view">页面</Select.Option> |
| | | <Select.Option value="role">权限树</Select.Option> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | {type !== 'app' ? <Col span={12}> |
| | | <Form.Item label="子应用"> |
| | | {getFieldDecorator('subAppId', { |
| | | initialValue: subAppId, |
| | |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | {type === 'view' ? <Col span={12}> |
| | | <Form.Item label="页面"> |
| | | {getFieldDecorator('viewId', { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Select, Radio, Input, Tooltip, Icon, notification } from 'antd' |
| | | import { Form, Row, Col, Select, Radio, Input, Tooltip, Icon, notification, InputNumber } from 'antd' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {typename !== 'pc' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="在使用明科云APP时,且在app模式中无效"> |
| | | <Icon type="question-circle" /> |
| | | 延迟加载 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('delay', { |
| | | initialValue: card ? card.delay || 0 : 0 |
| | | })(<InputNumber min={0} max={5000} precision={0} onPressEnter={this.handleSubmit}/>)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | border-radius: 0 4px 4px 0; |
| | | } |
| | | } |
| | | .ant-input-number { |
| | | width: 100%; |
| | | } |
| | | } |
| | |
| | | localedict: sessionStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS, |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | }) |
| | | this.getAppMessage() |
| | | this.getAppMessage(param.MenuID) |
| | | } else if (param.type === 'view') { |
| | | window.GLOB.winWidth = 420 |
| | | window.GLOB.winHeight = 738 |
| | |
| | | this.props.history.push('/mobdesign/' + param) |
| | | } |
| | | |
| | | getAppMessage = () => { |
| | | getAppMessage = (MenuID) => { |
| | | Api.getSystemConfig({ |
| | | func: 's_get_keyids', |
| | | bid: sessionStorage.getItem('appId') |
| | |
| | | return |
| | | } |
| | | |
| | | let homeId = '' |
| | | let homeId = MenuID || '' |
| | | let appViewList = [] |
| | | if (res.data && res.data.length > 0) { |
| | | if (!homeId && res.data && res.data.length > 0) { |
| | | appViewList = res.data |
| | | appViewList.forEach(item => { |
| | | if (item.keys_type === 'index') { |
| | |
| | | localedict: sessionStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS, |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | }) |
| | | this.getAppMessage() |
| | | this.getAppMessage(param.MenuID) |
| | | } else if (param.type === 'view') { |
| | | this.setState({ |
| | | MenuId: param.MenuID |
| | |
| | | this.props.history.push('/pcdesign/' + param) |
| | | } |
| | | |
| | | getAppMessage = () => { |
| | | getAppMessage = (MenuID) => { |
| | | Api.getSystemConfig({ |
| | | func: 's_get_keyids', |
| | | bid: sessionStorage.getItem('appId') |
| | |
| | | return |
| | | } |
| | | |
| | | let homeId = '' |
| | | let homeId = MenuID || '' |
| | | let appViewList = [] |
| | | if (res.data && res.data.length > 0) { |
| | | if (!homeId && res.data && res.data.length > 0) { |
| | | appViewList = res.data |
| | | appViewList.forEach(item => { |
| | | if (item.keys_type === 'index') { |
| | |
| | | render: (text, record) => ( |
| | | <div> |
| | | <Button type="link" onClick={() => this.deleteMenu(record)} style={{color: '#ff4d4f'}}>删除</Button> |
| | | <Button type="link" onClick={() => this.jumpApp(record)} style={{color: '#1890ff', marginLeft: '5px'}}>编辑</Button> |
| | | </div> |
| | | ), |
| | | }, |
| | |
| | | this.setState({ visible: true, targetKeys: [] }) |
| | | } |
| | | |
| | | jumpApp = (item) => { |
| | | const { app } = this.state |
| | | |
| | | let route = 'mobdesign' |
| | | if (app.typename === 'pc') { |
| | | route = 'pcdesign' |
| | | } |
| | | |
| | | window.open(window.location.href.replace(/#.+/ig, `#/${route}/${window.btoa(window.encodeURIComponent(JSON.stringify({...app, MenuID: item.MenuID, type: 'app'})))}`)) |
| | | } |
| | | |
| | | render () { |
| | | const { app, loading, columns, menulist, trees, searchkey } = this.state |
| | | let _menulist = menulist |