File was renamed from src/api/w4k.js |
| | |
| | | import axios from 'axios' |
| | | import jsSHA from 'jssha' |
| | | |
| | | class W4kApi { |
| | | class DirectApi { |
| | | /** |
| | | * @description 鉴权挑战 |
| | | * @param {Object} param 查询及提交参数 |
| | | */ |
| | | login (ip, username = 'admin', password) { |
| | | w4kLogin (ip, username = 'admin', password) { |
| | | return new Promise((resolve, reject) => { |
| | | let challurl = ip + '/api/auth/login/challenge?username=' + username |
| | | challurl = '/trans/redirect?rd=' + challurl + '&method=get' |
| | |
| | | }) |
| | | } |
| | | |
| | | queryUsers (ip) { |
| | | w4kQueryUsers (ip) { |
| | | let url = ip + '/api/persons/query' |
| | | url = '/trans/redirect?rd=' + url + '&method=post' |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | addUsers (ip, data) { |
| | | w4kAddUsers (ip, data) { |
| | | return new Promise((resolve, reject) => { |
| | | let delurl = ip + '/api/persons/item/' + data.id |
| | | delurl = '/trans/redirect?rd=' + delurl + '&method=DELETE' |
| | |
| | | } |
| | | } |
| | | |
| | | export default new W4kApi() |
| | | export default new DirectApi() |
| | |
| | | axios.defaults.withCredentials = false |
| | | |
| | | axios.interceptors.request.use((config) => { |
| | | if (config.url.includes('LoginAndRedirect') || config.url.includes('getjsonresult') || config.url.includes('wxNativePay')) { |
| | | if (/LoginAndRedirect|getjsonresult|wxNativePay|postek/ig.test(config.url)) { |
| | | config.data = qs.stringify(config.data) |
| | | } else if (/\/doupload|\/dopreload|\/upload/.test(config.url)) { |
| | | config.headers = { 'Content-Type': 'multipart/form-data' } |
| | |
| | | }) |
| | | } |
| | | |
| | | postekPrint (data) { |
| | | return axios({ |
| | | url: 'http://127.0.0.1:888/postek/print', |
| | | method: 'post', |
| | | data: data |
| | | }) |
| | | } |
| | | |
| | | // /** |
| | | // * @description 文件上传 |
| | | // */ |
| | |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | const { confirm } = Modal |
| | | |
| | | class KeyInterface extends Component { |
| | | static propTpyes = { |
| | |
| | | |
| | | if (this.state.key && _setting && typeof(_setting) === 'string') { |
| | | _setting = this.decrypt(this.state.key, _setting) |
| | | |
| | | if (!_setting) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '信息解析失败!', |
| | | duration: 5 |
| | | }) |
| | | this.props.onChange('') |
| | | } |
| | | } |
| | | |
| | | this.setState({visible: true, setting: _setting || {}}) |
| | |
| | | |
| | | setting = JSON.parse(window.decodeURIComponent(window.atob(setting))) |
| | | } catch (e) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '信息解析失败!', |
| | | duration: 5 |
| | | }) |
| | | setting = {} |
| | | setting = null |
| | | } |
| | | |
| | | return setting |
| | |
| | | let _setting = this.state.setting |
| | | if (_setting && typeof(_setting) === 'string') { |
| | | _setting = this.decrypt(key, _setting) |
| | | |
| | | if (!_setting) { |
| | | const that = this |
| | | confirm({ |
| | | title: '信息解析失败!', |
| | | content: '点击确定会清除配置信息,点击取消可重新输入appkey。', |
| | | onOk() { |
| | | that.setState({key: key, setting: {}, url: ''}) |
| | | that.props.onChange('') |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | this.setState({key: key, setting: _setting}) |
| | | return |
| | |
| | | this.props.onChange(content) |
| | | |
| | | this.setState({setting: message, url: values.interface, visible: false}) |
| | | |
| | | if (this.props.type !== 'develop') { |
| | | this.setState({key: ''}) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | delKey = () => { |
| | | const { url } = this.state |
| | | const { type } = this.props |
| | | |
| | | if (!url) return |
| | | |
| | | if (type === 'develop') { |
| | | this.setState({setting: null, url: ''}) |
| | |
| | | this.props.onChange('') |
| | | } |
| | | |
| | | cancel = () => { |
| | | const { type } = this.props |
| | | |
| | | if (type !== 'develop') { |
| | | this.setState({key: ''}) |
| | | } |
| | | this.setState({visible: false}) |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const { url, visible, setting, key } = this.state |
| | |
| | | return ( |
| | | <div className="mk-key-wrap"> |
| | | <TextArea value={url} rows={2} readOnly={true}/> |
| | | <div className="mk-key-edit"><EditOutlined onClick={this.editKey}/><DeleteOutlined onClick={this.delKey}/></div> |
| | | <div className="mk-key-edit"> |
| | | <EditOutlined onClick={this.editKey}/> |
| | | <DeleteOutlined className={!url ? 'disable' : ''} onClick={this.delKey}/> |
| | | </div> |
| | | <Modal |
| | | wrapClassName='mk-key-modal' |
| | | visible={visible} |
| | |
| | | maskClosable={false} |
| | | width={650} |
| | | onOk={this.handleConfirm} |
| | | onCancel={() => this.setState({visible: false})} |
| | | onCancel={this.cancel} |
| | | destroyOnClose |
| | | > |
| | | {key && setting ? |
| | |
| | | message: '不可小于16位!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="请输入appkey" autoComplete="off" />)} |
| | | })(<Input placeholder="请输入目标系统appkey" autoComplete="off" />)} |
| | | </Form.Item> |
| | | <Form.Item label="用户名"> |
| | | {getFieldDecorator('username', { |
| | |
| | | </Form.Item> |
| | | </Form> : null} |
| | | {!key ? <Form style={{marginTop: '20px', marginBottom: '50px'}}> |
| | | <Form.Item label="apptoken"> |
| | | <Form.Item label="appkey"> |
| | | {getFieldDecorator('apptoken', { |
| | | initialValue: '', |
| | | rules: [ |
| | |
| | | .anticon-delete { |
| | | color: #f5222d; |
| | | } |
| | | .anticon-delete.disable { |
| | | opacity: 0.5; |
| | | cursor: not-allowed; |
| | | } |
| | | } |
| | | } |
| | | .mk-key-modal { |
| | |
| | | document.title = GLOB.platTitle || '' |
| | | |
| | | if (config.filter === 'true' || (/^20\d{2}-\d{2}-\d{2}$/.test(config.filter) && new Date(config.filter).getTime() + 86400000 >= new Date().getTime())) { |
| | | let html = document.getElementsByTagName('html')[0] |
| | | |
| | | if (html) { |
| | | html.style.filter = 'grayscale(100%)' |
| | | } |
| | | GLOB.filter = true |
| | | } |
| | | |
| | | if (process.env.NODE_ENV === 'production') { // 用于校验是否存在开发权限 |
| | |
| | | if (item.key === 'field' || item.key === 'linkurl' || item.key === 'bgImage' || item.key === 'posterField') { |
| | | item.options = [] |
| | | config.columns.forEach(col => { |
| | | let label = col.label |
| | | if (label.toLowerCase() !== col.field.toLowerCase()) { |
| | | label = col.field + ' ' + col.label |
| | | } |
| | | let label = `${col.field}(${col.label})` |
| | | if (/^(Int|Decimal)/ig.test(col.datatype) && (card.eleType === 'number' || card.eleType === 'slider')) { |
| | | item.options.push({ |
| | | value: col.field, |
| | |
| | | if (item.key === 'field') { |
| | | item.options = [] |
| | | config.columns.forEach(col => { |
| | | let label = col.label |
| | | if (label.toLowerCase() !== col.field.toLowerCase()) { |
| | | label = col.field + ' ' + col.label |
| | | } |
| | | let label = `${col.field}(${col.label})` |
| | | |
| | | if (/^(Int|Decimal)/ig.test(col.datatype) && (value === 'number' || value === 'slider')) { |
| | | item.options.push({ |
| | |
| | | import { getCardCellForm } from './formconfig' |
| | | import { getActionForm, getBaseTableActionForm } from '@/menu/components/share/actioncomponent/formconfig' |
| | | |
| | | import Utils, { FuncUtils } from '@/utils/utils.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MenuUtils from '@/utils/utils-custom.js' |
| | | import ElementForm from './elementform' |
| | |
| | | options = ['border', 'margin'] |
| | | } else if (element.eleType === 'text') { |
| | | options[0] = 'font2' |
| | | options.push('display') |
| | | } else if (element.eleType === 'slider') { |
| | | options = ['padding', 'margin'] |
| | | } else if (element.eleType === 'splitline') { |
| | |
| | | let _elements = elements.map(cell => { |
| | | if (cell.uuid === res.uuid) { |
| | | res.style = cell.style || {} |
| | | |
| | | if (res.eleType !== 'text') { |
| | | delete res.style.display |
| | | } |
| | | |
| | | if (res.eleType === 'splitline' && (cell.eleType !== 'splitline' || cell.focus)) { |
| | | res.style.paddingTop = '5px' |
| | | res.style.paddingBottom = '5px' |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 创建按钮存储过程 |
| | | */ |
| | | creatFunc = () => { |
| | | const menu = window.GLOB.customMenu |
| | | let _config = fromJS(this.props.cards).toJS() |
| | | |
| | | this.actionFormRef.handleConfirm().then(res => { |
| | | let btn = res // 按钮信息 |
| | | let newLText = '' // 创建存储过程sql |
| | | let DelText = '' // 删除存储过程sql |
| | | |
| | | if (btn.intertype !== 'inner') return |
| | | |
| | | if (btn.OpenType === 'pop') { |
| | | let _param = { |
| | | funcName: btn.innerFunc, |
| | | name: _config.setting.tableName || '', |
| | | fields: btn.modal ? btn.modal.fields : [], |
| | | menuNo: menu.MenuNo |
| | | } |
| | | newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config)) |
| | | DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) |
| | | } else if (btn.OpenType === 'excelIn') { |
| | | let _param = { |
| | | funcName: btn.innerFunc, |
| | | menuNo: menu.MenuNo |
| | | } |
| | | newLText = Utils.formatOptions(FuncUtils.getexcelInfunc(_param, btn, menu)) |
| | | DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) |
| | | } else if (btn.OpenType === 'excelOut') { |
| | | newLText = Utils.formatOptions(FuncUtils.getTableFunc(btn.innerFunc, menu, _config)) // 创建存储过程sql |
| | | DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) |
| | | } else { |
| | | let _param = { |
| | | funcName: btn.innerFunc, |
| | | name: _config.setting.tableName || '', |
| | | fields: '', |
| | | menuNo: menu.MenuNo |
| | | } |
| | | newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config)) |
| | | DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) |
| | | } |
| | | |
| | | this.refs.btnCreatFunc.exec(btn.innerFunc, newLText, DelText) |
| | | }) |
| | | } |
| | | |
| | | getVerify = (card) => { |
| | | const { cards } = this.props |
| | | |
| | |
| | | /** |
| | | * @description Wrap表单配置信息 |
| | | */ |
| | | export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting) { |
| | | export default function (wrap, subtype, columns = [], id = '', supNodes = [], setting, buttons = []) { |
| | | let appType = sessionStorage.getItem('appType') |
| | | let MenuType = '' |
| | | let menu = window.GLOB.customMenu |
| | |
| | | {field: 'goback', values: ['dynamic']}, |
| | | {field: 'empty', values: ['dynamic', 'public']}, |
| | | {field: 'jump', values: ['dynamic']}, |
| | | {field: 'autoExec', values: ['dynamic']}, |
| | | {field: 'supModule', values: ['static']}, |
| | | {field: 'publicId', values: ['public']}, |
| | | ], |
| | |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'display', |
| | | label: '显示控制', |
| | | initval: wrap.display || 'normal', |
| | | required: false, |
| | | options: [ |
| | | {value: 'normal', label: '正常显示'}, |
| | | {value: 'hidden', label: '不可见'}, |
| | | ], |
| | | controlFields: [ |
| | | {field: 'empty', values: ['normal']}, |
| | | ], |
| | | forbid: subtype !== 'propcard' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'empty', |
| | | label: '空值隐藏', |
| | | initval: wrap.empty || 'show', |
| | |
| | | ], |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'autoExec', |
| | | label: '自动执行', |
| | | initval: wrap.autoExec || '', |
| | | tooltip: '数据更新时自动执行按钮。注:此按钮执行成功后谨慎选择刷新项,避免造成循环执行。', |
| | | required: false, |
| | | options: buttons, |
| | | forbid: subtype !== 'propcard' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'jump', |
| | | label: '页面跳转', |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Popover, Modal } from 'antd' |
| | | import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, ClockCircleOutlined } from '@ant-design/icons' |
| | | import { PlusOutlined, SettingOutlined, EditOutlined, ToolOutlined, DeleteOutlined, FontColorsOutlined, ClockCircleOutlined, HeatMapOutlined } from '@ant-design/icons' |
| | | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import asyncIconComponent from '@/utils/asyncIconComponent' |
| | |
| | | |
| | | getWrapForms = () => { |
| | | const { card } = this.state |
| | | return getWrapForm(card.wrap, card.subtype, card.columns, card.uuid) |
| | | let buttons = [] |
| | | |
| | | card.subcards.forEach(m => { |
| | | m.elements.forEach(n => { |
| | | if (n.eleType === 'button') { |
| | | buttons.push({ |
| | | value: n.uuid, |
| | | label: n.label |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | |
| | | return getWrapForm(card.wrap, card.subtype, card.columns, card.uuid, null, null, buttons) |
| | | } |
| | | |
| | | updateWrap = (res) => { |
| | |
| | | <div className={(card.wrap.layout || 'grid') + '-layout float-' + (card.wrap.cardFloat || 'left') + ' select-' + card.wrap.selStyle}> |
| | | {card.subcards.map(subcard => (<CardComponent key={subcard.uuid} cards={card} card={subcard} move={this.move} updateElement={this.updateCard} deleteElement={this.deleteCard}/>))} |
| | | </div> |
| | | {card.wrap.display === 'hidden' ? <HeatMapOutlined className="prop-hidden"/> : null} |
| | | <div className="component-name"> |
| | | <div className="center"> |
| | | <div className="title">{card.name}</div> |
| | |
| | | border-bottom: 2px solid #1890ff!important; |
| | | } |
| | | } |
| | | .prop-hidden { |
| | | color: orange; |
| | | float: right; |
| | | margin: 5px; |
| | | } |
| | | } |
| | | .menu-prop-card-edit-box::after { |
| | | display: block; |
| | |
| | | index = i |
| | | } |
| | | |
| | | let label = item.label || '' |
| | | if (item.field && item.field.toLowerCase() !== label.toLowerCase()) { |
| | | label = label + ' (' + item.field + ')' |
| | | } |
| | | let label = `${item.field || ''}(${item.label})` |
| | | |
| | | if (['text', 'number', 'textarea', 'color'].includes(item.type) && _item.field !== item.field) { |
| | | _inputfields.push({ |
| | |
| | | index = i |
| | | } |
| | | |
| | | let label = item.label || '' |
| | | if (item.field && item.field.toLowerCase() !== label.toLowerCase()) { |
| | | label = label + ' (' + item.field + ')' |
| | | } |
| | | let label = `${item.field || ''}(${item.label})` |
| | | |
| | | if (['text', 'number', 'textarea', 'color'].includes(item.type) && _item.field !== item.field) { |
| | | _inputfields.push({ |
| | |
| | | index = i |
| | | } |
| | | |
| | | let label = item.label || '' |
| | | if (item.field && item.field.toLowerCase() !== label.toLowerCase()) { |
| | | label = label + ' (' + item.field + ')' |
| | | } |
| | | let label = `${item.field || ''}(${item.label})` |
| | | |
| | | if (['text', 'number', 'textarea', 'color'].includes(item.type) && _item.field !== item.field) { |
| | | _inputfields.push({ |
| | |
| | | initVal: card.controlField || '', |
| | | required: true, |
| | | allowClear: true, |
| | | options: columns |
| | | options: columns.map(item => ({ |
| | | value: item.field, |
| | | text: `${item.label}(${item.field})` |
| | | })) |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | initVal: card.controlField || '', |
| | | required: true, |
| | | allowClear: true, |
| | | options: columns |
| | | options: columns.map(item => ({ |
| | | value: item.field, |
| | | text: `${item.label}(${item.field})` |
| | | })) |
| | | }, |
| | | { |
| | | type: 'text', |
| | |
| | | newLText = Utils.formatOptions(FuncUtils.getexcelInfunc(_param, btn, menu)) |
| | | DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) |
| | | } else if (btn.OpenType === 'excelOut') { |
| | | let _param = { |
| | | innerFunc: btn.innerFunc |
| | | } |
| | | |
| | | newLText = Utils.formatOptions(FuncUtils.getTableFunc(_param, menu, _config)) // 创建存储过程sql |
| | | newLText = Utils.formatOptions(FuncUtils.getTableFunc(btn.innerFunc, menu, _config)) // 创建存储过程sql |
| | | DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) |
| | | } else { |
| | | let _param = { |
| | |
| | | _columns.unshift({field: '$Index', label: '序号'}) |
| | | |
| | | let options = _columns.map(col => { |
| | | let label = col.label |
| | | if (col.label.toLowerCase() !== col.field.toLowerCase()) { |
| | | label += `(${col.field})` |
| | | } |
| | | let label = `${col.field}(${col.label})` |
| | | return { |
| | | value: col.field, |
| | | label: label, |
| | |
| | | value: 'dynamic', |
| | | label: '动态值', |
| | | children: _columns.map(cell => { |
| | | let _label = cell.label |
| | | if (cell.label.toLowerCase() !== cell.field.toLowerCase()) { |
| | | _label += `(${cell.field})` |
| | | } |
| | | let _label = `${cell.field}(${cell.label})` |
| | | return { |
| | | value: cell.field, |
| | | label: _label |
| | |
| | | |
| | | editColumn = (column) => { |
| | | let fields = fromJS(this.props.fields).toJS().map(item => { |
| | | if (item.label.toLowerCase() !== item.field.toLowerCase()) { |
| | | item.text = item.label + '(' + item.field + ')' |
| | | } |
| | | item.text = `${item.field}(${item.label})` |
| | | return item |
| | | }) |
| | | |
| | |
| | | } |
| | | .anticon-tool { |
| | | position: absolute; |
| | | z-index: 2; |
| | | z-index: 5; |
| | | font-size: 16px; |
| | | right: 1px; |
| | | top: 1px; |
| | |
| | | |
| | | editColumn = (column) => { |
| | | let fields = fromJS(this.props.fields).toJS().map(item => { |
| | | if (item.label.toLowerCase() !== item.field.toLowerCase()) { |
| | | item.text = item.label + '(' + item.field + ')' |
| | | } |
| | | item.text = `${item.field}(${item.label})` |
| | | return item |
| | | }) |
| | | |
| | |
| | | |
| | | editColumn = (column) => { |
| | | let fields = fromJS(this.props.fields).toJS().map(item => { |
| | | if (item.label.toLowerCase() !== item.field.toLowerCase()) { |
| | | item.text = item.label + '(' + item.field + ')' |
| | | } |
| | | item.text = `${item.field}(${item.label})` |
| | | return item |
| | | }) |
| | | |
| | |
| | | defaultsql: '', // 默认Sql |
| | | defaultSearch: '', |
| | | systemScripts: [], |
| | | median: {}, |
| | | visible: false, |
| | | pvisible: false, |
| | | reload: false, |
| | |
| | | scripts, |
| | | columns: config.columns ? fromJS(config.columns).toJS() : [], |
| | | setting: _setting, |
| | | median: _setting, |
| | | searches: search, |
| | | defaultSearch: _search |
| | | }) |
| | |
| | | return col |
| | | }), |
| | | setting: res.data.setting, |
| | | median: res.data.setting, |
| | | reload: true, |
| | | pvisible: false |
| | | }, () => { |
| | |
| | | return col |
| | | }), |
| | | setting: res.data.setting, |
| | | median: res.data.setting, |
| | | reload: true, |
| | | pvisible: false |
| | | }, () => { |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { columns, setting, scripts, colColumns, scriptsColumns, activeKey, loading, searches, defaultsql, visible, pvisible, reload, script, scriptValue } = this.state |
| | | const { columns, median, setting, scripts, colColumns, scriptsColumns, activeKey, loading, searches, defaultsql, visible, pvisible, reload, script, scriptValue } = this.state |
| | | |
| | | return ( |
| | | <div className="model-data-source-wrap"> |
| | |
| | | columns={columns} |
| | | setting={setting} |
| | | scripts={scripts} |
| | | updateStatus={(res) => this.setState({median: {...res}})} |
| | | wrappedComponentRef={(inst) => this.settingForm = inst} |
| | | /> : null} |
| | | </TabPane> |
| | |
| | | 自定义脚本 |
| | | {scripts.length ? <span className="count-tip">{scripts.length}</span> : null} |
| | | </span> |
| | | } key="scripts" id="mk-scripts-tabpane"> |
| | | } key="scripts" disabled={median.interType !== 'system'} id="mk-scripts-tabpane"> |
| | | {scripts.length ? <BorderOutlined className="full-scripts" onClick={() => { |
| | | if (this.scriptsForm && (this.scriptsForm.state.editItem || (this.scriptsForm.props.form.getFieldValue('sql') && !/^\s+$/.test(this.scriptsForm.props.form.getFieldValue('sql'))))) { |
| | | notification.warning({ |
| | |
| | | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | updateStatus: PropTypes.func, |
| | | config: PropTypes.object, // 组件配置 |
| | | setting: PropTypes.object, // 数据源配置 |
| | | columns: PropTypes.array, // 列设置 |
| | |
| | | if (key === 'sysInterface' && value === 'true') { |
| | | this.props.form.setFieldsValue({interface: window.GLOB.mainSystemApi}) |
| | | } |
| | | this.props.updateStatus(setting) |
| | | } |
| | | |
| | | render() { |
| | |
| | | index = i |
| | | } |
| | | |
| | | let label = item.label || '' |
| | | if (item.field && item.field.toLowerCase() !== label.toLowerCase()) { |
| | | label = label + ' (' + item.field + ')' |
| | | } |
| | | let label = `${item.field || ''}(${item.label})` |
| | | |
| | | if (['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) { |
| | | _inputfields.push({ |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | | {options.includes('display') ? <Panel header="显示" key="display"> |
| | | <Col span={24}> |
| | | <Form.Item |
| | | colon={false} |
| | | label={<SwapOutlined title="浮动"/>} |
| | | labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } |
| | | > |
| | | <Radio.Group style={{whiteSpace: 'nowrap'}} defaultValue={card.display || 'block'} onChange={(e) => this.changeNormalStyle(e.target.value, 'display')}> |
| | | <Radio value="block">块级元素</Radio> |
| | | <Radio value="inline-block">行内块元素</Radio> |
| | | </Radio.Group> |
| | | </Form.Item> |
| | | </Col> |
| | | </Panel> : null} |
| | | </Collapse> : null} |
| | | </Form> |
| | | <div style={{textAlign: 'right'}}> |
| | |
| | | index = i |
| | | } |
| | | |
| | | let label = item.label || '' |
| | | if (item.field && item.field.toLowerCase() !== label.toLowerCase()) { |
| | | label = label + ' (' + item.field + ')' |
| | | } |
| | | let label = `${item.field || ''}(${item.label})` |
| | | |
| | | if (['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) { |
| | | _inputfields.push({ |
| | |
| | | |
| | | _config.wrap.wrapClass = `${_config.wrap.selStyle} ${_config.wrap.cardType || ''} ${_config.wrap.scale || ''} ${_config.wrap.layout || 'grid'}-layout float-${_config.wrap.cardFloat || 'left'}` |
| | | |
| | | if (_config.wrap.display === 'hidden') { |
| | | _config.style.display = 'none' |
| | | } |
| | | |
| | | this.setState({ |
| | | selected, |
| | | sync: _sync, |
| | |
| | | }, 200) |
| | | } |
| | | |
| | | if (_config.wrap.datatype === 'dynamic') { |
| | | this.autoExec() |
| | | } |
| | | if (!_config.wrap.cardType && _data.$$uuid) { |
| | | setTimeout(() => { |
| | | this.transferLine() |
| | |
| | | } else if (!config.wrap.cardType && _data.$$uuid) { |
| | | this.transferLine() |
| | | } |
| | | this.autoExec() |
| | | }) |
| | | } else if (config.setting.useMSearch && nextProps.mainSearch && !is(fromJS(this.props.mainSearch), fromJS(nextProps.mainSearch))) { |
| | | this.setState({}, () => { |
| | |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | autoExec = () => { |
| | | const { config, data } = this.state |
| | | |
| | | if (!config.wrap.autoExec || data.$$empty) return |
| | | |
| | | setTimeout(() => { |
| | | MKEmitter.emit('triggerBtnId', config.wrap.autoExec, [data]) |
| | | }, 200) |
| | | } |
| | | |
| | | checkTopLine = () => { |
| | |
| | | } else { |
| | | this.transferLine() |
| | | } |
| | | this.autoExec() |
| | | }) |
| | | |
| | | if (config.timer && config.clearField) { |
| | |
| | | |
| | | import NApi from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | | import Api from '@/api/w4k.js' |
| | | import Api from '@/api/direct.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MkIcon from '@/components/mk-icon' |
| | | |
| | |
| | | // let ip = 'http://localhost:3001' |
| | | let ip = selectIp.face_ip |
| | | |
| | | Api.login(ip, selectIp.face_uname, selectIp.face_pwd).then(result => { |
| | | Api.w4kLogin(ip, selectIp.face_uname, selectIp.face_pwd).then(result => { |
| | | if (result.errors) { |
| | | this.execPreError(result) |
| | | return |
| | |
| | | |
| | | document.cookie = 'sessionID=' + result.session_id |
| | | |
| | | Api.queryUsers(ip).then(res => { |
| | | Api.w4kQueryUsers(ip).then(res => { |
| | | if (res.errors) { |
| | | this.execPreError(res) |
| | | return |
| | |
| | | data.id_number = CryptoJS.enc.Base64.stringify(encrypted.ciphertext) |
| | | } |
| | | |
| | | Api.addUsers(ip, data).then(res => { |
| | | Api.w4kAddUsers(ip, data).then(res => { |
| | | if (res.errors) { |
| | | this.execPreError(res, data) |
| | | return |
| | |
| | | } |
| | | } |
| | | |
| | | // execRfidPrint = () => { |
| | | // let type = 'HF' |
| | | // let printparamsJsonArray = [] |
| | | |
| | | // 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通讯端口 |
| | | // } |
| | | |
| | | // 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: ''}]) |
| | | // } |
| | | |
| | | // Api.postekPrint(data).then(result => { |
| | | |
| | | // }) |
| | | // } |
| | | |
| | | execPrint = (list, template, formdata) => { |
| | | const { btn } = this.props |
| | | let _errors = [] |
| | | |
| | | // if (btn) { |
| | | // this.execRfidPrint() |
| | | // return |
| | | // } |
| | | |
| | | let defaultPrinter = btn.verify.defaultPrinter || 'lackprinter' |
| | | let printers = {} |
| | | if (btn.verify.printerTypeList && btn.verify.printerTypeList.length > 0) { |
| | |
| | | } |
| | | |
| | | let _config = {...config, setting: setting} |
| | | let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting, menu, _config)) // 创建存储过程sql |
| | | let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting.innerFunc, menu, _config)) // 创建存储过程sql |
| | | let DelText = Utils.formatOptions(FuncUtils.dropfunc(setting.innerFunc)) // 删除存储过程sql |
| | | |
| | | this.refs.tableCreatFunc.exec(setting.innerFunc, newLText, DelText) |
| | |
| | | index = i |
| | | } |
| | | |
| | | let label = item.label || '' |
| | | if (item.field && item.field.toLowerCase() !== label.toLowerCase()) { |
| | | label = label + ' (' + item.field + ')' |
| | | } |
| | | let label = `${item.field || ''}(${item.label})` |
| | | |
| | | if (['text', 'number', 'textarea', 'color'].includes(item.type) && card.field !== item.field) { |
| | | _inputfields.push({ |
| | |
| | | resolve(false) |
| | | } |
| | | } else if (btn.OpenType === 'excelOut') { |
| | | let _param = { |
| | | innerFunc: btn.innerFunc |
| | | } |
| | | |
| | | newLText = Utils.formatOptions(FuncUtils.getTableFunc(_param, menu, _config)) // 创建存储过程sql |
| | | newLText = Utils.formatOptions(FuncUtils.getTableFunc(btn.innerFunc, menu, _config)) // 创建存储过程sql |
| | | DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) |
| | | |
| | | resolve(true) |
| | |
| | | changeColumns = (columns) => { |
| | | const { verify } = this.state |
| | | |
| | | if (columns[0] && (columns[0].type === 'image' || columns[0].type === 'text')) { |
| | | columns = columns.map(col => { |
| | | let _cell = { |
| | | uuid: Utils.getuuid(), |
| | | Column: col.Column, |
| | | Text: col.Text, |
| | | type: 'Nvarchar(50)', |
| | | limit: '50', |
| | | import: 'true', |
| | | required: 'true' |
| | | } |
| | | |
| | | return _cell |
| | | }) |
| | | } |
| | | |
| | | columns = columns.map(col => { |
| | | if (/^Nvarchar/ig.test(col.type)) { |
| | | col.limit = col.type.match(/\d+/) ? col.type.match(/\d+/)[0] : '20000' |
| | |
| | | changeColumns = (columns) => { |
| | | const { verify } = this.state |
| | | |
| | | if (columns[0] && (columns[0].type !== 'image' && columns[0].type !== 'text' && columns[0].type !== 'number')) { |
| | | if (columns[0] && !['image', 'text', 'number'].includes(columns[0].type)) { |
| | | columns = columns.map(col => { |
| | | let _cell = { |
| | | uuid: Utils.getuuid(), |
| | |
| | | Text: col.Text, |
| | | Width: 20, |
| | | abs: 'false', |
| | | output: 'true', |
| | | output: col.output || 'true', |
| | | type: 'text', |
| | | } |
| | | |
| | |
| | | <Form {...formItemLayout}> |
| | | <Row gutter={24}> |
| | | <Col span={8}> |
| | | <Form.Item label={'打印模式'}> |
| | | <Form.Item label="打印模式"> |
| | | {getFieldDecorator('printMode', { |
| | | initialValue: printMode || 'normal' |
| | | })( |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8}> |
| | | <Form.Item label={'链接类型'}> |
| | | <Form.Item label="链接类型"> |
| | | {getFieldDecorator('linkType', { |
| | | initialValue: linkType || 'system' |
| | | })( |
| | |
| | | this.settingRef.handleConfirm('loading').then(setting => { |
| | | let res = this.resetSetting(setting, config.setting) |
| | | let _config = {...config, setting: res} |
| | | let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting, menu, _config)) // 创建存储过程sql |
| | | let newLText = Utils.formatOptions(FuncUtils.getTableFunc(setting.innerFunc, menu, _config)) // 创建存储过程sql |
| | | let DelText = Utils.formatOptions(FuncUtils.dropfunc(setting.innerFunc)) // 删除存储过程sql |
| | | |
| | | this.refs.funcCreatComponent.exec(setting.innerFunc, newLText, DelText) |
| | |
| | | * @description 创建页面存储过程 |
| | | * @return {String} |
| | | */ |
| | | static getTableFunc (param, menu, config) { |
| | | static getTableFunc (func = 'func', menu, config) { |
| | | let form = '' |
| | | let formParam = '' |
| | | let _vars = ['bid', 'pageindex', 'pagesize', 'ordercol', 'ordertype', 'exceltype', 'septmenuno', 'lang', 'debug', 'loginuid', 'sessionuid', 'userid', 'errorcode', 'retmsg'] |
| | |
| | | ` |
| | | } |
| | | |
| | | let Ltext = `create proc ${param.innerFunc} |
| | | let Ltext = `create proc ${func} |
| | | ( /*${menu.MenuName}*/ |
| | | @appkey nvarchar(50)='', |
| | | @BID nvarchar(50)='',${formParam} |
| | |
| | | @LoginUID nvarchar(50)='', |
| | | @SessionUid nvarchar(50)='', |
| | | @UserID nvarchar(50), |
| | | @dataM nvarchar(50), |
| | | @ErrorCode nvarchar(50) out, |
| | | @retmsg nvarchar(4000) out |
| | | ) |
| | |
| | | .g2-tooltip { |
| | | display: none; |
| | | } |
| | | .mk-action-space { |
| | | display: none; |
| | | } |
| | | } |
| | | |
| | | .print-page { |
| | |
| | | padding: 2px 8px!important; |
| | | line-height: 1.5; |
| | | } |
| | | .ant-table-placeholder { |
| | | display: none; |
| | | } |
| | | .ant-empty { |
| | | display: none; |
| | | } |
| | | .mk-action-space { |
| | | display: none; |
| | | } |
| | | } |
| | | .print-page.auto:last-child { |
| | | height: auto!important; |
| | |
| | | // if (!res || !res.ip) return |
| | | // sessionStorage.setItem('ipAddress', res.ip) |
| | | // }) |
| | | if (window.GLOB.filter) { |
| | | let view = document.getElementById('mk-login-view') |
| | | |
| | | if (view) { |
| | | view.style.filter = 'grayscale(100%)' |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('loginError')) { |
| | | try { |
| | | let res = JSON.parse(sessionStorage.getItem('loginError')) |
| | |
| | | |
| | | Api.getTouristMsg().then(result => { |
| | | if (result.status) { |
| | | if (result.website && process.env.NODE_ENV === 'production') { |
| | | let website = result.website.replace(/http(s)?:\/\/|\/$/ig, '').toLowerCase() |
| | | let current = window.GLOB.baseurl.replace(/http(s)?:\/\/|\/$/ig, '').toLowerCase() |
| | | |
| | | if (website !== current) { |
| | | try { |
| | | window.history.replaceState(null, null, result.website.replace(/\/$/ig, '') + '/admin/index.html#/login') |
| | | window.location.reload() |
| | | } catch(e) { |
| | | window.location.href = result.website.replace(/\/$/ig, '') + '/admin/index.html#/login' |
| | | } |
| | | return |
| | | } |
| | | } |
| | | |
| | | sessionStorage.setItem('visitorUserID', result.UserID || '') |
| | | sessionStorage.setItem('visitorLoginUID', result.LoginUID || '') |
| | | |
| | |
| | | const { lineColor, bgImage, loginlogo, copyRight, webSite, ICP, loginWays, touristLogin } = this.state |
| | | |
| | | return ( |
| | | <div className="login-container" style={bgImage ? {backgroundImage: 'url(' + bgImage + ')'} : {}}> |
| | | <div className="login-container" id="mk-login-view" style={bgImage ? {backgroundImage: 'url(' + bgImage + ')'} : {}}> |
| | | <div className="logo" style={lineColor ? {borderColor: lineColor} : {}}> |
| | | {loginlogo ? <img src={loginlogo} alt=""/> : null} |
| | | {this.state.platName ? <p className="plat-name">{this.state.platName}</p> : null} |
| | |
| | | MenuID: '1588493493409k9guqp067d31lu7blsv', |
| | | MenuNo: 's_job_stepM', |
| | | MenuName: '计划任务', |
| | | }, { |
| | | src: '', |
| | | systems: ['production', 'local', 'SSO', 'cloud'], |
| | | PageParam: {OpenType: 'newtab', Template: 'BaseTable'}, |
| | | type: 'BaseTable', |
| | | MenuID: '1670296054432ab9d5c0pf76o93315ag', |
| | | MenuNo: 's_sys_job_history_M', |
| | | MenuName: '代理作业记录', |
| | | }] |
| | | }] |