| | |
| | | MkIcons[type](resProps) |
| | | ) |
| | | } else { |
| | | return <span className={'anticon ' + (resProps.className || '')} style={resProps.style || null} dangerouslySetInnerHTML={{ __html: type }}></span> |
| | | return <span className={'anticon anticon-mk ' + (resProps.className || '')} style={resProps.style || null} dangerouslySetInnerHTML={{ __html: type }}></span> |
| | | } |
| | | } |
| | | } |
| | |
| | | }) |
| | | } |
| | | |
| | | trigger = () => { |
| | | const { selectIcon, cusicons } = this.state |
| | | |
| | | this.setState({visible: true}) |
| | | |
| | | if (cusicons.length > 0 && selectIcon && /<svg/.test(selectIcon)) { |
| | | setTimeout(() => { |
| | | let node = document.getElementById('mk-custom-tab') |
| | | node && node.click() |
| | | }, 200) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { selectIcon, visible, icons, allowClear, cusicons } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-icon-box"> |
| | | {selectIcon ? <MkIcon type={selectIcon}/> : <span style={{color: '#bcbcbc'}}>请选择</span>} |
| | | <MkIcon className="trigger" onClick={() => this.setState({visible: true})} type="swap"/> |
| | | <MkIcon className="trigger" onClick={this.trigger} type="swap"/> |
| | | {allowClear && selectIcon ? <CloseCircleFilled className="close" onClick={() => this.checkIcon('')}/> : null} |
| | | <Modal |
| | | wrapClassName="mk-pop-modal mk-icon-wrap" |
| | |
| | | </Row> |
| | | </TabPane> |
| | | <TabPane tab={ |
| | | <span className="tab-control"> |
| | | <span className="tab-control" id="mk-custom-tab"> |
| | | <RedoOutlined onClick={(e) => {this.getIcons()}}/> |
| | | 自定义 |
| | | </span> |
| | | } key="scripts"> |
| | | <Row> |
| | | {cusicons.map(icon => <Col key={icon.id} span={4} onClick={() => this.checkIcon(icon.icon_svg)}> |
| | | {cusicons.map(icon => <Col className={icon.icon_svg === selectIcon ? 'active' : ''} key={icon.id} span={4} onClick={() => this.checkIcon(icon.icon_svg)}> |
| | | <MkIcon type={icon.icon_svg} /> |
| | | </Col>)} |
| | | </Row> |
| | |
| | | onChange={(val) => val === undefined && this.selectChange('')} |
| | | > |
| | | {options.map((option, i) => |
| | | <Select.Option key={i} disabled={option.disabled} extend={option[config.extendName] || ''} value={option.value || option.field || ''}>{option.label || option.text}</Select.Option> |
| | | <Select.Option key={i} disabled={option.disabled} title={option.label || option.text} extend={option[config.extendName] || ''} value={option.value || option.field || ''}>{option.label || option.text}</Select.Option> |
| | | )} |
| | | </Select> |
| | | ) |
| | |
| | | <div className="mk-popover-control"> |
| | | <PlusOutlined className="plus" title="添加元素" onClick={this.addElement} /> |
| | | <PlusSquareOutlined className="plus" title="添加按钮" onClick={this.addButton} /> |
| | | <NormalForm title="卡片设置" width={800} update={this.updateSetting} getForms={this.getSettingForms}> |
| | | <NormalForm title="卡片设置" width={950} update={this.updateSetting} getForms={this.getSettingForms}> |
| | | <EditOutlined className="edit" title="编辑"/> |
| | | </NormalForm> |
| | | <CopyComponent type="cardcell" card={card}/> |
| | |
| | | editable: true, |
| | | unique: true, |
| | | required: false, |
| | | width: '35%' |
| | | width: '30%' |
| | | }, |
| | | { |
| | | title: '菜单', |
| | |
| | | editable: true, |
| | | required: true, |
| | | extends: !appType ? 'Menu' : [{key: 'label', value: 'label'}], |
| | | width: '35%', |
| | | width: '40%', |
| | | render: (text, record) => record.label, |
| | | options: menulist |
| | | } |
| | |
| | | getPopupContainer={() => document.getElementById('winter')} |
| | | > |
| | | {item.options.map((option, index) => |
| | | <Select.Option key={index} extend={option[item.extendName] || ''} value={(option.value || option.field)}> |
| | | <Select.Option key={index} title={option.text || option.label} extend={option[item.extendName] || ''} value={(option.value || option.field)}> |
| | | {(option.text || option.label)} |
| | | </Select.Option> |
| | | )} |
| | |
| | | getPopupContainer={() => document.getElementById('winter')} |
| | | > |
| | | {item.options.map((option, index) => |
| | | <Select.Option key={index} value={(option.value || option.field)}> |
| | | <Select.Option key={index} title={option.text || option.label} value={(option.value || option.field)}> |
| | | {(option.text || option.label)} |
| | | </Select.Option> |
| | | )} |
| | |
| | | field: 'primaryId', |
| | | label: '静态主键值', |
| | | initval: setting.primaryId || '', |
| | | tooltip: '可作为BID传到下一页面。', |
| | | tooltip: '可作为BID传到下一页面。注:@userid@会替换为用户ID。', |
| | | required: false |
| | | } |
| | | ] |
| | |
| | | .img { |
| | | width: 30px; |
| | | height: 30px; |
| | | border-radius: 4px; |
| | | border-radius: 30px; |
| | | margin-top: 9px; |
| | | margin-right: 5px; |
| | | background-size: cover; |
| | |
| | | const Interface = asyncLoadComponent(() => import('@/views/interface')) |
| | | const RoleManage = asyncLoadComponent(() => import('@/views/rolemanage')) |
| | | const SystemFunc = asyncLoadComponent(() => import('@/views/systemfunc')) |
| | | const SystemProc = asyncLoadComponent(() => import('@/views/systemproc')) |
| | | |
| | | const routers = [ |
| | | {path: '/login', name: 'login', component: Login, auth: false}, |
| | |
| | | {path: '/tab/:menuId', name: 'tab', component: MainParams, auth: false}, |
| | | {path: '/role/:param', name: 'role', component: RoleManage, auth: true}, |
| | | {path: '/hs', name: 'hs', component: SystemFunc, auth: true}, |
| | | {path: '/proc', name: 'proc', component: SystemProc, auth: true}, |
| | | {path: '/interface', name: 'interface', component: Interface, auth: true} |
| | | ] |
| | | |
| | |
| | | } |
| | | span { |
| | | text-indent: 0px; |
| | | font-style: inherit; |
| | | font-weight: inherit; |
| | | text-decoration: inherit; |
| | | } |
| | | } |
| | | .ant-mk-text:not(.line1):not(.line) { |
| | |
| | | // 数据选择类型校验 |
| | | this.actionSettingError() |
| | | return |
| | | } else if ( |
| | | !btn.verify || |
| | | (btn.verify.printMode === 'normal' && (!btn.verify.Template || !btn.verify.linkUrl)) || |
| | | (btn.verify.printMode === 'custom' && (!btn.verify.printFunc || !btn.verify.linkUrl)) |
| | | ) { |
| | | } else if (!btn.verify || !btn.verify.printMode) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请完善打印验证信息!', |
| | |
| | | } |
| | | } |
| | | |
| | | triggerPrint = (data, formlist = []) => { |
| | | const { btn } = this.props |
| | | |
| | | if (btn.verify.printMode === 'RFID') { |
| | | this.triggerRFIDPrint(data, formlist) |
| | | } else { |
| | | this.triggerNormalPrint(data, formlist) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * @description 触发打印 |
| | | */ |
| | | triggerPrint = (data, formlist = []) => { |
| | | triggerNormalPrint = (data, formlist) => { |
| | | const { btn } = this.props |
| | | let formdata = {} |
| | | let baseCount = 1 |
| | |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | Api.genericInterface(param).then(result => { |
| | | Api.getSystemCacheConfig(param).then(result => { |
| | | result.tempId = tempId |
| | | resolve(result) |
| | | }) |
| | |
| | | } |
| | | } else { |
| | | this.execError(errorMsg) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 触发RFID打印 |
| | | */ |
| | | triggerRFIDPrint = (data, formlist) => { |
| | | const { btn } = this.props |
| | | let formdata = {} |
| | | let list = [] |
| | | |
| | | formlist.forEach(_data => { |
| | | formdata[_data.key] = _data.value |
| | | }) |
| | | |
| | | new Promise(resolve => { |
| | | if (btn.intertype === 'system') { // 使用系统时,直接从表格或表单中选取数据 |
| | | if (btn.Ot === 'notRequired') { |
| | | if (formlist.length > 0) { |
| | | list = [formdata] |
| | | } |
| | | } else { |
| | | data.forEach(cell => { |
| | | let _cell = {...cell, ...formdata} |
| | | list.push(_cell) |
| | | }) |
| | | } |
| | | |
| | | resolve(true) |
| | | } else { |
| | | this.getprintdata(btn, data, formdata, formlist).then(result => { |
| | | if (result.next) { |
| | | result.list.forEach(cell => { |
| | | // 系统打印数据,校验data字段 |
| | | if (!cell.data || cell.data.length === 0) return |
| | | |
| | | cell.data.forEach(m => { |
| | | let _cell = {...m, ...formdata} |
| | | list.push(_cell) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | resolve(result.next) |
| | | }) |
| | | } |
| | | }).then(res => { |
| | | // 获取打印模板 getTemp |
| | | if (!res) return false |
| | | |
| | | if (list.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到打印数据!', |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } |
| | | |
| | | let param = { |
| | | func: 's_PrintTemplateMGetData', |
| | | Type: 'Y', |
| | | // ID: tempId, // 添加模板时,保存及查询使用模板参数 |
| | | PrintTempNO: btn.verify.Template |
| | | } |
| | | |
| | | if (window.GLOB.mainSystemApi) { // 从单点登录服务器取打印配置信息 |
| | | param.rduri = window.GLOB.mainSystemApi |
| | | } |
| | | |
| | | return Api.getSystemCacheConfig(param) |
| | | }).then(result => { |
| | | if (!result) { |
| | | this.setState({ loading: false }) |
| | | return |
| | | } |
| | | |
| | | if (!result.ConfigParam) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到打印模板信息!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({ loading: false }) |
| | | } else { |
| | | let configParam = '' |
| | | try { |
| | | configParam = JSON.parse(window.decodeURIComponent(window.atob(result.ConfigParam))) |
| | | } catch (e) { |
| | | configParam = '' |
| | | } |
| | | |
| | | if (!configParam) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '打印模板解析错误!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({ loading: false }) |
| | | } else { |
| | | this.execRfidPrint(list, configParam) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | // execRfidPrint = () => { |
| | | // let type = 'HF' |
| | | // let printparamsJsonArray = [] |
| | | execRfidPrint = (list, template) => { |
| | | const { btn } = this.props |
| | | |
| | | // let mm = 12 |
| | | // if (type === 'HF') { |
| | | // printparamsJsonArray.push({PTK_OpenUSBPort: 255}); // 打开打印机USB端口 |
| | | // printparamsJsonArray.push({PTK_ClearBuffer: ''}); // 清空缓存 |
| | | // printparamsJsonArray.push({PTK_SetDarkness: 10}); // 设置打印黑度 取值范围 0-20 |
| | | // printparamsJsonArray.push({PTK_SetPrintSpeed: 4}); // 设置打印速度 |
| | | // printparamsJsonArray.push({PTK_SetDirection: 'B'}); // 设置打印方向 |
| | | // printparamsJsonArray.push({PTK_SetLabelHeight: 25*mm + ","+ 10*mm +","+ 0 +","+ false}); // 设置标签高度、间隙及偏移 |
| | | // printparamsJsonArray.push({PTK_SetLabelWidth: 60*mm}); // 设置标签宽度 |
| | | // printparamsJsonArray.push({PTK_SetRFID: 0+","+0+","+0+","+0+","+0}); // UHF RFID打印设置 |
| | | // printparamsJsonArray.push({PTK_RWRFIDLabel: 1+","+0+","+0+","+4+","+1+',EEBA99192945C746'}); |
| | | // printparamsJsonArray.push({PTK_DrawText_TrueType: "50,10,36,0,微软雅黑,1,700,0,0,0,北京明科有限公司"}); |
| | | // // printparamsJsonArray.push({PTK_DrawText_TrueType: x+","+y+","+FHeight+","+FWidth+","+FType+","+Fspin+","+FWeight+","+FItalic+","+FUnline+","+FStrikeOut+","+data}); |
| | | // // printparamsJsonArray.push({PTK_EncodeRFIDPC:'mkA040'}); |
| | | // printparamsJsonArray.push({PTK_PrintLabel:1+","+1}); |
| | | // printparamsJsonArray.push({PTK_CloseUSBPort: ""}); // 关闭USB通讯端口 |
| | | // } |
| | | list = list.filter(item => !!item[btn.verify.valueField]) |
| | | |
| | | // let data = { |
| | | // reqParam: '1', |
| | | // printparams: JSON.stringify(printparamsJsonArray) |
| | | // // printparams: JSON.stringify([{PTK_OpenUSBPort: 255},{PTK_ErrorReport_USBInterrupt: 'status:'},{PTK_GetPrinterDPI: 'DPI:'},{PTK_CloseUSBPort: ''}]) |
| | | // // printparams: JSON.stringify([{PTK_OpenUSBPort: 255},{PTK_RFIDCalibrate: ''},{PTK_CloseUSBPort: ''}]) |
| | | // } |
| | | if (list.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '未获取到打印数据!', |
| | | duration: 5 |
| | | }) |
| | | this.setState({ loading: false }) |
| | | return |
| | | } |
| | | |
| | | // Api.postekPrint(data).then(result => { |
| | | let width = template.width |
| | | let height = template.height |
| | | let gap = template.gap || 0 |
| | | let mm = 12 |
| | | |
| | | // }) |
| | | // } |
| | | if (btn.verify.DPI === '203') { |
| | | mm = 8 |
| | | } else if (btn.verify.DPI === '600') { |
| | | mm = 24 |
| | | } |
| | | |
| | | let items = [] |
| | | template.elements.forEach(element => { |
| | | if (!['text', 'barcode', 'qrcode'].includes(element.type)) return |
| | | |
| | | let _field = element.field |
| | | |
| | | if (_field === 'other_field') { |
| | | _field = element.cusfield || '' |
| | | } |
| | | |
| | | let item = { |
| | | type: element.type, |
| | | value: element.value || '', |
| | | field: _field |
| | | } |
| | | |
| | | if (item.type === 'text') { |
| | | let size = Math.floor(4 * mm * (element.fontSize || 12) / 12) |
| | | let fontWeight = 400 |
| | | if (element.fontWeight === 'bold') { |
| | | fontWeight = 600 |
| | | } else if (element.fontWeight === 'bolder') { |
| | | fontWeight = 800 |
| | | } else if (element.fontWeight === 'lighter') { |
| | | fontWeight = 300 |
| | | } |
| | | item.draw = `${element.left * mm},${element.top * mm},${size},0,${element.fontFamily || '微软雅黑'},${element.align === 'center' ? 5 : 1},${fontWeight},0,0,0,` |
| | | } else if (item.type === 'barcode') { |
| | | let codeType = 1 |
| | | if (element.barcodeType === 'EAN13') { |
| | | codeType = 'E30' |
| | | } |
| | | let narrowWidth = element.narrowWidth || 2 |
| | | let horizontal = element.narrowWidth || 2 |
| | | let vertical = Math.ceil(element.barcodeHeight * mm) |
| | | |
| | | item.draw = `${element.left * mm},${element.top * mm},0,${codeType},${narrowWidth},${horizontal},${vertical},${element.barcodeLabel === 'true' ? 'B' : 'N'},` |
| | | } else if (item.type === 'qrcode') { |
| | | let r = Math.ceil(element.qrcodeWidth / 2) |
| | | |
| | | item.draw = `${element.left * mm},${element.top * mm},0,0,0,${r},0,0,8,` |
| | | } |
| | | |
| | | items.push(item) |
| | | }) |
| | | |
| | | let ip = '192.168.1.2' |
| | | let params = list.map(cell => { |
| | | let array = [] |
| | | let value = cell[btn.verify.valueField] |
| | | |
| | | if (btn.verify.linkType !== 'USB') { |
| | | array.push({PTK_Connect_Timer: `${ip},${btn.verify.port},5`}); // 打开打印机网络端口 |
| | | } else { |
| | | array.push({PTK_OpenUSBPort: btn.verify.port}); // 打开打印机USB端口 |
| | | } |
| | | |
| | | array.push({PTK_ClearBuffer: ''}); // 清空缓存 |
| | | array.push({PTK_SetDirection: 'B'}); // 设置打印方向 |
| | | array.push({PTK_SetLabelHeight: height * mm + ',' + gap * mm + ',' + 0 + ',' + false}); // 设置标签高度、间隙及偏移 |
| | | array.push({PTK_SetLabelWidth: width * mm}); // 设置标签宽度 |
| | | array.push({PTK_SetRFID: '0,0,0,0,0'}); // UHF RFID打印设置 |
| | | array.push({PTK_RWRFIDLabel: '1,0,0,4,1,' + value}); |
| | | |
| | | items.forEach(m => { |
| | | let val = '' |
| | | if (m.field) { |
| | | val = cell[m.field] |
| | | } else { |
| | | val = m.value |
| | | } |
| | | |
| | | if (!val && val !== 0) return |
| | | |
| | | if (m.type === 'text') { |
| | | array.push({PTK_DrawText_TrueType: m.draw + val}); |
| | | } else if (m.type === 'barcode') { |
| | | array.push({PTK_DrawBarcode: m.draw + val}); |
| | | } else if (m.type === 'qrcode') { |
| | | array.push({PTK_DrawBar2D_QR: m.draw + val}); |
| | | } |
| | | }) |
| | | |
| | | array.push({PTK_PrintLabel: '1,1'}); |
| | | array.push({PTK_CloseUSBPort: ''}); // 关闭USB通讯端口 |
| | | |
| | | return { |
| | | reqParam: '1', |
| | | printparams: JSON.stringify(array) |
| | | } |
| | | }) |
| | | |
| | | this.loopRFIDPrint(params) |
| | | } |
| | | |
| | | loopRFIDPrint = (params) => { |
| | | let param = params.shift() |
| | | |
| | | Api.postekPrint(param).then(res => { |
| | | if (res.retval === '0') { |
| | | if (params.length === 0) { |
| | | this.execSuccess({ ErrCode: 'S', message: '', ErrMesg: '打印请求已发出。', status: true }) |
| | | } else { |
| | | setTimeout(() => { |
| | | this.loopRFIDPrint(params) |
| | | }, 200) |
| | | } |
| | | } else { |
| | | if (res.retval === '30021') { |
| | | res.msg = res.msg.replace(/PTK_ClearBuffer[\s\S]*/, '') |
| | | } |
| | | |
| | | this.execError({ErrCode: 'N', message: res.msg}) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | execPrint = (list, template, formdata) => { |
| | | const { btn } = this.props |
| | | let _errors = [] |
| | | |
| | | // if (btn) { |
| | | // this.execRfidPrint() |
| | | // return |
| | | // } |
| | | |
| | | let defaultPrinter = btn.verify.defaultPrinter || 'lackprinter' |
| | | let printers = {} |
| | |
| | | changePrintMode = (e) => { |
| | | let value = e.target.value |
| | | |
| | | if (value === 'RFID') { |
| | | this.setState({linkType: 'USB', port: 255}, () => { |
| | | this.props.form.setFieldsValue({ |
| | | linkType: 'USB' |
| | | }) |
| | | }) |
| | | } else if (this.state.printMode === 'RFID') { |
| | | this.setState({linkType: 'system'}, () => { |
| | | this.props.form.setFieldsValue({ |
| | | linkType: 'system' |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | printMode: value |
| | | }) |
| | |
| | | if (value === 'system') { |
| | | this.props.form.setFieldsValue({ |
| | | linkUrl: '127.0.0.1:13529' |
| | | }) |
| | | } else if (value === 'USB') { |
| | | this.props.form.setFieldsValue({ |
| | | port: '255' |
| | | }) |
| | | } else if (value === 'network') { |
| | | this.props.form.setFieldsValue({ |
| | | port: '9100' |
| | | }) |
| | | } |
| | | }) |
| | |
| | | <Radio.Group onChange={this.changePrintMode}> |
| | | <Radio value="normal">标准</Radio> |
| | | <Radio value="custom">自定义</Radio> |
| | | <Radio value="RFID">RFID</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | {printMode !== 'RFID' ? <Col span={8}> |
| | | <Form.Item label="链接类型"> |
| | | {getFieldDecorator('linkType', { |
| | | initialValue: linkType || 'system' |
| | |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : |
| | | <Col span={8}> |
| | | <Form.Item label={'链接地址'}> |
| | | <Form.Item label="链接类型"> |
| | | {getFieldDecorator('linkType', { |
| | | initialValue: linkType || 'USB' |
| | | })( |
| | | <Radio.Group onChange={this.changeLinkType}> |
| | | <Radio value="USB">USB</Radio> |
| | | <Radio value="network">网络端口</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col>} |
| | | {printMode !== 'RFID' ? <Col span={8}> |
| | | <Form.Item label="链接地址"> |
| | | {getFieldDecorator('linkUrl', { |
| | | initialValue: verify.linkUrl || '127.0.0.1:13529', |
| | | rules: [ |
| | |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" disabled={linkType === 'system'} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : |
| | | <Col span={8}> |
| | | <Form.Item label={'端口'}> |
| | | {getFieldDecorator('port', { |
| | | initialValue: verify.port || '255', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入端口!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | | </Form.Item> |
| | | </Col>} |
| | | {printMode === 'custom' ? <Col span={24}> |
| | | <Form.Item label={'处理函数'} className="printFunc"> |
| | | {getFieldDecorator('printFunc', { |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {printMode === 'RFID' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="用于单位换算。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 分辨率 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('DPI', { |
| | | initialValue: verify.DPI || '300' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="203">203</Radio> |
| | | <Radio value="300">300</Radio> |
| | | <Radio value="600">600</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {printMode === 'RFID' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="需要存贮至芯片中的值,请填写对应的字段名,注意大小写。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 打印值 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('valueField', { |
| | | initialValue: verify.valueField || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入字段名!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" disabled={linkType === 'system'} />)} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {printMode === 'normal' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="打印列表为空时,是否提示用户。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 空值提示 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('emptyTip', { |
| | | initialValue: verify.emptyTip || 'true' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">是</Radio> |
| | | <Radio value="false">否</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {printMode !== 'custom' ? <Col span={8}> |
| | | <Form.Item label="打印模板"> |
| | | {getFieldDecorator('Template', { |
| | | initialValue: verify.Template || '', |
| | |
| | | </Select> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null } |
| | | {printMode === 'normal' ? <Col span={8}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="打印列表为空时,是否提示用户。"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 空值提示 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('emptyTip', { |
| | | initialValue: verify.emptyTip || 'true' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="true">是</Radio> |
| | | <Radio value="false">否</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {printMode === 'normal' ? <Col span={8}> |
| | | {printMode !== 'custom' ? <Col span={8} offset={printMode === 'RFID' ? 16 : 0}> |
| | | <img className="legend" src={this.state.selectimg} alt=""/> |
| | | </Col> : null } |
| | | </Row> |
| | |
| | | 打印类型 |
| | | {verify.printerTypeList.length ? <span className="count-tip">{verify.printerTypeList.length}</span> : null} |
| | | </span> |
| | | } key="2"> |
| | | } disabled={printMode === 'RFID'} key="2"> |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col span={24} className="print-tip"> |
| | |
| | | style.color = mark.color |
| | | innerStyle = {color: mark.color} |
| | | } else if (type === 'background') { |
| | | style.background = mark.color |
| | | style.backgroundColor = mark.color |
| | | if (mark.fontColor) { |
| | | style.color = mark.fontColor |
| | | innerStyle = {color: mark.fontColor} |
| | |
| | | import { withRouter } from 'react-router-dom' |
| | | import {connect} from 'react-redux' |
| | | import { Dropdown, Menu, Modal, notification, Switch, Button, Popover } from 'antd' |
| | | import { MenuFoldOutlined, SettingOutlined, AppstoreOutlined, DownOutlined, HomeOutlined, ApiOutlined, PlusOutlined, EditOutlined, MenuOutlined } from '@ant-design/icons' |
| | | import { MenuFoldOutlined, SettingOutlined, AppstoreOutlined, DownOutlined, HomeOutlined, ApiOutlined, PlusOutlined, EditOutlined, MenuOutlined, DatabaseOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | <SettingOutlined className="edit-check"/> |
| | | </Popover> : null} |
| | | {/* window.btoa(window.encodeURIComponent(JSON.stringify({ MenuType: 'home', MenuId: 'home_page_id', MenuName: '首页' }))) */} |
| | | {window.GLOB.systemType !== 'production' ? |
| | | <div className="home-entrance entrance"> |
| | | <div className="icon"><HomeOutlined /></div> |
| | | <div className="title">首页</div> |
| | | <div className="detail">基于自定义页面的首页设计,可实现灵活的元素配置及样式调整,展现当前系统的风格。</div> |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=')}}> |
| | | 编辑 |
| | | </Button> |
| | | </div> : null |
| | | } |
| | | <div className="api-entrance entrance"> |
| | | <div className="icon"><ApiOutlined /></div> |
| | | <div className="title">接口调试</div> |
| | | <div className="detail">可自动处理登录接口的参数加密,以及业务接口的签名计算,方便开发人员的接口测试工作。</div> |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/interface')}}> |
| | | 编辑 |
| | | </Button> |
| | | </div> |
| | | <div className="app-entrance entrance"> |
| | | <div className="icon"><AppstoreOutlined /></div> |
| | | <div className="title">应用管理</div> |
| | | <div className="detail">可创建及管理PC、pad及移动端等不同设备的应用,实现明科云APP、微信公众号、小程序等多平台的应用共享。</div> |
| | | {window.GLOB.systemType !== 'production' ? |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/appmanage')}}> |
| | | 编辑 |
| | | </Button> : |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/appcheck')}}> |
| | | 查看 |
| | | </Button> |
| | | <div className="entrance-wrap"> |
| | | {window.GLOB.systemType !== 'production' ? |
| | | <div className="entrance"> |
| | | <div className="icon"><HomeOutlined /></div> |
| | | <div className="title">首页</div> |
| | | <div className="detail">基于自定义页面的首页设计,可实现灵活的元素配置及样式调整,展现当前系统的风格。</div> |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/menudesign/JTdCJTIyTWVudVR5cGUlMjIlM0ElMjJob21lJTIyJTJDJTIyTWVudUlkJTIyJTNBJTIyaG9tZV9wYWdlX2lkJTIyJTJDJTIyTWVudU5hbWUlMjIlM0ElMjIlRTklQTYlOTYlRTklQTElQjUlMjIlN0Q=')}}> |
| | | 编辑 |
| | | </Button> |
| | | </div> : null |
| | | } |
| | | <div className="entrance"> |
| | | <div className="icon"><ApiOutlined /></div> |
| | | <div className="title">接口调试</div> |
| | | <div className="detail">可自动处理登录接口的参数加密,以及业务接口的签名计算,方便开发人员的接口测试工作。</div> |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/interface')}}> |
| | | 编辑 |
| | | </Button> |
| | | </div> |
| | | <div className="entrance"> |
| | | <div className="icon"><AppstoreOutlined /></div> |
| | | <div className="title">应用管理</div> |
| | | <div className="detail">可创建及管理PC、pad及移动端等不同设备的应用,实现明科云APP、微信公众号、小程序等多平台的应用共享。</div> |
| | | {window.GLOB.systemType !== 'production' ? |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/appmanage')}}> |
| | | 编辑 |
| | | </Button> : |
| | | <Button type="primary" disabled={!(memberLevel >= 20)} title={memberLevel >= 20 ? '' : '会员等级不够,无开发权限。'} onClick={() => {window.open('#/appcheck')}}> |
| | | 查看 |
| | | </Button> |
| | | } |
| | | </div> |
| | | {window.GLOB.systemType !== 'production' ? <div className="entrance"> |
| | | <div className="icon"><MenuOutlined /></div> |
| | | <div className="title">菜单操作说明</div> |
| | | <div className="detail">鼠标悬停 <SettingOutlined style={{color: '#1890ff'}}/> 可显示菜单的添加、排序(包括编辑、删除)与解冻功能,双击三级菜单可进入编辑窗口。</div> |
| | | <Button type="primary" onClick={() => {window.open('#/main')}}> |
| | | 新窗口 |
| | | </Button> |
| | | </div> : null} |
| | | {window.GLOB.systemType !== 'production' ? <div className="entrance"> |
| | | <div className="icon"><DatabaseOutlined /></div> |
| | | <div className="title">存储过程</div> |
| | | <div className="detail">可在页面中查看或编辑本地存储过程。</div> |
| | | <Button type="primary" onClick={() => {window.open('#/proc')}}> |
| | | 编辑 |
| | | </Button> |
| | | </div> : null} |
| | | </div> |
| | | {window.GLOB.systemType !== 'production' ? <div className="menu-entrance entrance"> |
| | | <div className="icon"><MenuOutlined /></div> |
| | | <div className="title">菜单操作说明</div> |
| | | <div className="detail">鼠标悬停 <SettingOutlined style={{color: '#1890ff'}}/> 可显示菜单的添加、排序(包括编辑、删除)与解冻功能,双击三级菜单可进入编辑窗口。</div> |
| | | <Button type="primary" onClick={() => {window.open('#/main')}}> |
| | | 新窗口 |
| | | </Button> |
| | | </div> : null} |
| | | {/* 编辑菜单 */} |
| | | {editLevel === 'level1' ? <EditMenu menulist={this.state.menulist} reload={this.reload} exitEdit={this.exitEdit}/> : null} |
| | | {/* 头像、用户名 */} |
| | |
| | | margin-left: 10px; |
| | | cursor: pointer; |
| | | } |
| | | .level4-close { |
| | | position: relative; |
| | | top: 13px; |
| | | left: 20px; |
| | | height: 26px; |
| | | padding: 0 10px; |
| | | z-index: 2; |
| | | } |
| | | .mobile { |
| | | position: absolute; |
| | | top: 135px; |
| | | right: 50px; |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | } |
| | | .interface { |
| | | position: absolute; |
| | | top: 170px; |
| | | right: 50px; |
| | | color: #1890ff; |
| | | cursor: pointer; |
| | | } |
| | | .home-entrance { |
| | | left: 260px; |
| | | } |
| | | .api-entrance { |
| | | left: 540px; |
| | | } |
| | | .app-entrance { |
| | | left: 820px; |
| | | } |
| | | .menu-entrance { |
| | | left: 1100px; |
| | | } |
| | | .entrance { |
| | | |
| | | .entrance-wrap { |
| | | position: absolute; |
| | | top: 100px; |
| | | left: 240px; |
| | | width: calc(100vw - 270px); |
| | | } |
| | | .entrance { |
| | | margin-left: 30px; |
| | | margin-bottom: 30px; |
| | | background: #ffffff; |
| | | box-shadow: 0 0 5px #d9d9d9; |
| | | border-radius: 5px; |
| | |
| | | height: 250px; |
| | | color: rgba(0, 0, 0, 0.85); |
| | | text-align: center; |
| | | display: inline-block; |
| | | vertical-align: top; |
| | | .icon { |
| | | text-align: center; |
| | | padding: 15px 0px; |
| | |
| | | color: rgba(0, 0, 0, 0.65); |
| | | text-align: center; |
| | | padding: 0 10px; |
| | | min-height: 60px; |
| | | } |
| | | .ant-btn { |
| | | margin-top: 15px; |
| | |
| | | // 登录提交 |
| | | let res = await Api.getusermsg(param.username, param.password, false, ipAddress, city) |
| | | if (res.status) { |
| | | if (res.check_mob) { |
| | | let loginWays = this.state.loginWays.filter(item => item.type === 'sms_vcode') |
| | | |
| | | if (loginWays.length > 0) { |
| | | this.setState({loginWays: null, isDisabled: false}, () => { |
| | | this.setState({loginWays: loginWays}) |
| | | }) |
| | | Modal.warning({ |
| | | title: '为确认是您本人操作,请使用手机短信验证码进行身份认证', |
| | | okText: '知道了' |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | sessionStorage.setItem('UserID', res.UserID) |
| | | sessionStorage.setItem('LoginUID', res.LoginUID) |
| | | sessionStorage.setItem('User_Name', res.UserName) |
| | |
| | | |
| | | let appIndeList = sessionStorage.getItem('appViewList') |
| | | appIndeList = JSON.parse(appIndeList) |
| | | appIndeList = appIndeList.map(item => (item.keys_type !== 'index' ? item.keys_id : '')).join(',') |
| | | appIndeList = appIndeList.map(item => (item.keys_type === 'navbar' ? item.keys_id : '')).join(',') |
| | | |
| | | if (sessionStorage.getItem('userbind')) { |
| | | appIndeList = appIndeList + ',' + sessionStorage.getItem('userbind') |
| | | } |
| | | // if (sessionStorage.getItem('userbind')) { |
| | | // appIndeList = appIndeList + ',' + sessionStorage.getItem('userbind') |
| | | // } |
| | | if (sessionStorage.getItem('instantMessage')) { |
| | | appIndeList = appIndeList + ',' + sessionStorage.getItem('instantMessage') |
| | | } |
| | |
| | | let menus = res.menus.filter(item => appIndeList.indexOf(item.MenuID) === -1) |
| | | menus = menus.map(item => { |
| | | item.value = item.MenuID |
| | | item.label = item.MenuName |
| | | if (item.MenuNo) { |
| | | item.label = item.MenuName + '(' + item.MenuNo + ')' |
| | | } else { |
| | | item.label = item.MenuName |
| | | } |
| | | return item |
| | | }) |
| | | sessionStorage.setItem('appMenus', JSON.stringify(menus)) |
| | |
| | | |
| | | let appIndeList = sessionStorage.getItem('appViewList') |
| | | appIndeList = JSON.parse(appIndeList) |
| | | appIndeList = appIndeList.map(item => (item.keys_type !== 'index' ? item.keys_id : '')).join(',') |
| | | appIndeList = appIndeList.map(item => (item.keys_type === 'navbar' ? item.keys_id : '')).join(',') |
| | | |
| | | let menus = res.menus.filter(item => appIndeList.indexOf(item.MenuID) === -1) |
| | | menus = menus.map(item => { |
| | | item.value = item.MenuID |
| | | item.label = item.MenuName |
| | | if (item.MenuNo) { |
| | | item.label = item.MenuName + '(' + item.MenuNo + ')' |
| | | } else { |
| | | item.label = item.MenuName |
| | | } |
| | | return item |
| | | }) |
| | | sessionStorage.setItem('appMenus', JSON.stringify(menus)) |
| | |
| | | initialValue: item.initval, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | required: item.required, |
| | | message: '请输入' + item.label + '!' |
| | | } |
| | | ] |
| | |
| | | initval: config.rotate || 0, |
| | | required: false, |
| | | options: Rotate |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'gap', |
| | | label: '间隙', |
| | | initval: config.gap || '', |
| | | tooltip: 'RFID标签间隙。', |
| | | min: 0, |
| | | required: false |
| | | } |
| | | ] |
| | | } |
| | |
| | | required: true |
| | | }, |
| | | { |
| | | type: 'number', |
| | | key: 'narrowWidth', |
| | | label: '单元宽度', |
| | | initval: item.narrowWidth, |
| | | tooltip: '注:RFID条码单元宽度,默认值为2。', |
| | | precision: 0, |
| | | required: false |
| | | }, |
| | | { |
| | | type: 'select', |
| | | key: 'background', |
| | | label: '背景色', |
| | |
| | | loading: false, |
| | | menulist: [], |
| | | columns: [ |
| | | { title: '菜单名称', dataIndex: 'MenuName', key: 'MenuName', align: 'center', render: (text, record) => { |
| | | if (record.extra) { |
| | | return <span style={{color: '#1890ff'}}>{text}</span> |
| | | { |
| | | title: '菜单名称', dataIndex: 'MenuName', key: 'MenuName', align: 'center', render: (text, record) => { |
| | | if (record.extra) { |
| | | return <span style={{color: '#1890ff'}}>{text}</span> |
| | | } |
| | | return text |
| | | } |
| | | return text |
| | | } }, |
| | | }, |
| | | { |
| | | title: '菜单参数', dataIndex: 'MenuNo', key: 'MenuNo', align: 'center' |
| | | }, |
| | | { |
| | | title: '操作', |
| | | key: 'action', |
| | |
| | | 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 './index.scss' |
| | | |
| | | const Tabview = asyncComponent(() => import('@/components/tabview')) |
| | | const _locale = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | |
| | | class Design extends Component { |
| | | UNSAFE_componentWillMount() { |
| | |
| | | render () { |
| | | return ( |
| | | <div className="mk-hs-view"> |
| | | <ConfigProvider locale={_locale}> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Sidemenu key="sidemenu"/> |
| | | <Tabview key="tabview"/> |
| | | <Header key="header"/> |
| | |
| | | MenuName: '标签页管理', |
| | | }, { |
| | | src: '', |
| | | PageParam: {OpenType: 'newtab', Template: 'CommonTable'}, |
| | | type: 'CommonTable', |
| | | PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, |
| | | type: 'BaseTable', |
| | | MenuID: '1578900109100np8aqd0a77q3na46oas', |
| | | MenuNo: 'sPrintTemplateM', |
| | | MenuName: '标签打印模板', |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import { ConfigProvider } from 'antd' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | |
| | | // import Api from '@/api' |
| | | // import Utils from '@/utils/utils.js' |
| | | import Header from '../systemfunc/header' |
| | | import Proc from './proc' |
| | | import './index.scss' |
| | | |
| | | class SysProc extends Component { |
| | | render () { |
| | | return ( |
| | | <div className="mk-proc-view"> |
| | | <ConfigProvider locale={zhCN}> |
| | | <Header key="header"/> |
| | | <Proc /> |
| | | </ConfigProvider> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default SysProc |
New file |
| | |
| | | .mk-proc-view { |
| | | .sys-header-container { |
| | | color: rgba(255, 255, 255, 0.65); |
| | | background: #001529; |
| | | .title { |
| | | display: none; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import { Input, notification } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import Utils from '@/utils/utils.js' |
| | | import Api from '@/api' |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | import './index.scss' |
| | | |
| | | const { Search } = Input |
| | | |
| | | class ProcControl extends Component { |
| | | state = { |
| | | procName: '', |
| | | content: null, |
| | | loading: false |
| | | } |
| | | |
| | | componentDidMount () { |
| | | |
| | | } |
| | | |
| | | search = (value) => { |
| | | let proc = value.replace(/^(\s*)|(\s*)$/ig, '') |
| | | |
| | | if (!proc) { |
| | | this.setState({content: '', procName: ''}) |
| | | return |
| | | } |
| | | |
| | | let _param = { |
| | | func: 's_get_userproc', |
| | | LText: proc |
| | | } |
| | | |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) |
| | | |
| | | this.setState({loading: true}) |
| | | |
| | | Api.genericInterface(_param).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | this.setState({content: '', procName: '', loading: false}) |
| | | return |
| | | } |
| | | |
| | | this.setState({content: res.Ltext.replace(/mchr13k/ig, '\n'), procName: proc, loading: false}) |
| | | }) |
| | | } |
| | | |
| | | render () { |
| | | const { loading, content } = this.state |
| | | |
| | | return ( |
| | | <div className="mk-proc-wrap"> |
| | | <div className="control-wrap"> |
| | | <div className="search-wrap"> |
| | | <Search placeholder="请输入存储过程名称" disabled={loading} enterButton="确定" onSearch={this.search}/> |
| | | </div> |
| | | <div className="action-wrap"> |
| | | |
| | | </div> |
| | | </div> |
| | | <div className="edit-wrap"> |
| | | <CodeMirror value={content} onChange={(val) => this.setState({content: val})}/> |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default ProcControl |
New file |
| | |
| | | .mk-proc-wrap { |
| | | position: relative; |
| | | padding: 65px 20px 0px; |
| | | |
| | | .control-wrap { |
| | | display: flex; |
| | | |
| | | .search-wrap { |
| | | width: 300px; |
| | | |
| | | .ant-btn[disabled] { |
| | | background-color: #1890ff!important; |
| | | border-color: #1890ff!important; |
| | | color: #ffffff!important; |
| | | opacity: 0.5; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .edit-wrap { |
| | | margin-top: 10px; |
| | | .CodeMirror { |
| | | height: calc(100vh - 130px); |
| | | } |
| | | .anticon-fullscreen { |
| | | display: none; |
| | | } |
| | | .anticon-format-painter { |
| | | top: 10px; |
| | | } |
| | | .CodeMirror-gutters { |
| | | background-color: #ffffff; |
| | | } |
| | | } |
| | | } |