Merge branch 'master' into positec
| | |
| | | } |
| | | }, |
| | | "caniuse-lite": { |
| | | "version": "1.0.30001588", |
| | | "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001588.tgz", |
| | | "integrity": "sha512-+hVY9jE44uKLkH0SrUTqxjxqNTOWHsbnQDIKjwkZ3lNTzUUVdBLBGXtj/q5Mp5u98r3droaZAewQuEDzjQdZlQ==" |
| | | "version": "1.0.30001643", |
| | | "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001643.tgz", |
| | | "integrity": "sha512-ERgWGNleEilSrHM6iUz/zJNSQTP8Mr21wDWpdgvRwcTXGAq6jMtOUPP4dqFPTdKqZ2wKTdtB+uucZ3MRpAUSmg==" |
| | | }, |
| | | "canvg": { |
| | | "version": "3.0.10", |
| | |
| | | /** |
| | | * @description 直接请求 |
| | | */ |
| | | directRequest (params) { |
| | | directRequest (params, script, position) { |
| | | if (script) { |
| | | try { |
| | | // eslint-disable-next-line |
| | | let func = new Function('axios', 'Api', 'param', 'position', 'systemType', 'notification', script) |
| | | let promise = func(axios, this, params, position, window.GLOB.systemType, notification) |
| | | |
| | | if (promise instanceof Promise) { |
| | | return promise |
| | | } |
| | | } catch (e) { |
| | | console.warn(e) |
| | | } |
| | | |
| | | return Promise.resolve({ |
| | | status: false, |
| | | message: '自定义脚本执行错误', |
| | | ErrCode: 'E' |
| | | }) |
| | | } |
| | | |
| | | return axios(params) |
| | | } |
| | | |
| | |
| | | |
| | | let cell = fieldMap.get(item.field) |
| | | |
| | | cell.$ctrls = cell.$ctrls || [] |
| | | cell.$ctrls.push(key) |
| | | |
| | | if (cell.hidden) return |
| | | |
| | | if (cell.skip && supItem.forbid) { // 上级表单禁用时,此表单不受控制 |
| | |
| | | |
| | | formlist = formlist.map(cell => { |
| | | let item = fieldMap.get(cell.field) |
| | | |
| | | if (item.$ctrls && item.$ctrls.length === 1) { |
| | | delete item.$ctrls |
| | | } |
| | | |
| | | if (item.linkField) { |
| | | let supInitVal = fieldMap.get(item.linkField).initval || '' |
| | |
| | | m.hidden = !cell.values.includes(val) |
| | | } |
| | | |
| | | if (!m.hidden && m.$ctrls) { |
| | | m.$ctrls.forEach(n => { |
| | | if (n === current.field || m.hidden) return |
| | | |
| | | let oth = map.get(n) |
| | | let _val = this.record[n] |
| | | |
| | | if (_val && JSON.stringify(_val) === '[]') { |
| | | _val = '' |
| | | } |
| | | |
| | | let p = oth.controlFields.filter(q => q.field === m.field)[0] |
| | | |
| | | if (oth.hidden || (p.notNull && !_val)) { |
| | | m.hidden = true |
| | | } else if (oth.type === 'checkbox' || oth.type === 'multiselect') { |
| | | let _vals = [...(_val || []), ...p.values] |
| | | if (_vals.length === new Set(_vals).size) { |
| | | m.hidden = true |
| | | } |
| | | } else if (!p.values.includes(_val)) { |
| | | m.hidden = true |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (m.hidden) { |
| | | m.initval = this.record[m.field] |
| | | } |
| | |
| | | <CopyOutlined className="copy" title="复制" onClick={() => copyCard(id)} /> |
| | | <CloseOutlined className="close" title="删除" onClick={() => delCard(id)} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={() => changeStyle(id)} /> |
| | | {hasProfile ? <ProfileOutlined className="profile" title="setting" onClick={() => profileCard(id)} /> : null} |
| | | {hasProfile ? <ProfileOutlined className="profile" title="验证信息" onClick={() => profileCard(id)} /> : null} |
| | | {updateTime} |
| | | </div> |
| | | } trigger="hover"> |
| | |
| | | res.width = (res.width + '').replace(/.5/, 'x') |
| | | } |
| | | |
| | | if (res.eleType === 'formula' && res.eval === 'false' && res.noValue === 'hide') { |
| | | let keys = res.formula.match(/@[0-9a-z_]+@/ig) |
| | | if (keys) { |
| | | res.$keys = keys.map(key => key.slice(1, -1).toLowerCase()) |
| | | res.$keys = Array.from(new Set(res.$keys)) |
| | | } |
| | | } |
| | | |
| | | let _elements = elements.map(cell => { |
| | | if (cell.uuid === res.uuid) { |
| | | res.style = cell.style || {} |
| | |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !!appType || isprint |
| | | forbid: !!appType || subtype === 'propcard' || isprint |
| | | }, |
| | | { |
| | | type: 'radio', |
| | | field: 'searchBtn', |
| | | label: '搜索按钮', |
| | | initval: wrap.searchBtn || 'hidden', |
| | | // tooltip: '启用搜索条件缓存后,在菜单刷新时搜索条件不变。', |
| | | required: false, |
| | | options: [ |
| | | {value: 'hidden', label: '隐藏'}, |
| | | {value: 'show', label: '显示'}, |
| | | ], |
| | | forbid: appType === 'mob' || isprint, |
| | | forbid: appType === 'mob' || subtype === 'propcard' || isprint, |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | <div className="mk-popover-control"> |
| | | <EditOutlined className="edit" title="编辑" onClick={() => this.handleAction(group.subButton)} /> |
| | | <FontColorsOutlined className="style" title="调整样式" onClick={() => this.handleStyle(group.subButton)}/> |
| | | <ProfileOutlined className="profile" title="setting" onClick={() => this.profileAction()} /> |
| | | <ProfileOutlined className="profile" title="验证信息" onClick={() => this.profileAction()} /> |
| | | </div> |
| | | } trigger="hover"> |
| | | <Button type="link" className="submit" onDoubleClick={this.changeMenu} style={resetStyle(group.subButton.style)}>{group.subButton.label}</Button> |
| | |
| | | shows.push('position') |
| | | } |
| | | } else if (_funcType === 'mkBinding' || _funcType === 'mkUnBinding') { |
| | | shows.push('execSuccess', 'execError') |
| | | shows.push('execSuccess', 'execError', 'tipTitle') |
| | | } else if (_funcType === 'mkUnsubscribe' || _funcType === 'reAuth') { |
| | | shows.push('tipTitle') |
| | | } else if (_funcType === 'closetab') { |
| | | shows.push('refreshTab') |
| | | } else if (_funcType === 'scan') { |
| | |
| | | {!card.$fixed ? <CopyOutlined className="copy" onClick={() => copyCard(id)} /> : null} |
| | | {!card.$fixed ? <CloseOutlined className="close" onClick={() => delCard(id)} /> : null} |
| | | {type !== 'datacard' && type !== 'basetable' && !card.$fixed ? <FontColorsOutlined className="style" title="调整样式" onClick={() => changeStyle(id)}/> : ''} |
| | | {hasProfile ? <ProfileOutlined className="profile" title="验证" onClick={() => profileCard(id)} /> : null} |
| | | {hasProfile ? <ProfileOutlined className="profile" title="验证信息" onClick={() => profileCard(id)} /> : null} |
| | | {updateTime} |
| | | </div> |
| | | } trigger="hover"> |
| | |
| | | val = '' |
| | | } else if (data) { |
| | | let _val = card.formula |
| | | |
| | | if (card.$keys && card.noValue === 'hide') { // 空值隐藏 |
| | | let _data = {} |
| | | let empty = true |
| | | |
| | | Object.keys(data).forEach(key => { |
| | | _data[key.toLowerCase()] = data[key] |
| | | }) |
| | | _data.username = sessionStorage.getItem('User_Name') || '' |
| | | _data.fullname = sessionStorage.getItem('Full_Name') || '' |
| | | _data.bid = data.$$BID || '' |
| | | |
| | | card.$keys.forEach(key => { |
| | | if (!_data.hasOwnProperty(key)) { |
| | | empty = false |
| | | } else if (_data[key] && !/^1949-10-01/.test(_data[key])) { |
| | | empty = false |
| | | } |
| | | }) |
| | | |
| | | if (empty) return null |
| | | } |
| | | |
| | | if (/@username@|@fullName@|@bid@/ig.test(_val)) { |
| | | _val = _val.replace(/@username@/ig, sessionStorage.getItem('User_Name') || '').replace(/@fullName@/ig, sessionStorage.getItem('Full_Name') || '').replace(/@bid@/ig, data.$$BID || '') |
| | | } |
| | |
| | | overflow: visible; |
| | | text-align: center; |
| | | } |
| | | span { |
| | | span, div { |
| | | text-indent: 0px; |
| | | font-style: inherit; |
| | | font-weight: inherit; |
| | |
| | | method: btn.method || 'post' |
| | | } |
| | | |
| | | if (btn.cross === 'true') { |
| | | if (btn.ContentType) { |
| | | _params.headers = { |
| | | 'Content-Type': btn.ContentType |
| | | } |
| | | } |
| | | |
| | | if (btn.$outerScript) { |
| | | if (JSON.stringify(param) !== '{}') { |
| | | if (btn.stringify === 'qs') { |
| | | _params.data = qs.stringify(param) |
| | | } else { |
| | | _params.data = param |
| | | } |
| | | } |
| | | } else if (btn.cross === 'true') { |
| | | if (JSON.stringify(param) !== '{}') { |
| | | if (btn.stringify === 'qs') { |
| | | _params.data = qs.stringify(param) |
| | |
| | | _params.method = 'post' |
| | | } |
| | | |
| | | if (btn.ContentType) { |
| | | _params.headers = { |
| | | 'Content-Type': btn.ContentType |
| | | } |
| | | } |
| | | |
| | | Api.directRequest(_params).then(res => { |
| | | Api.directRequest(_params, btn.$outerScript, 'outer').then(res => { |
| | | if (typeof(res) !== 'object') { |
| | | let error = '未知的返回结果!' |
| | | |
| | |
| | | if (item.Field) { |
| | | fields.push(item.Field) |
| | | // 条码二维码字段不可为空 |
| | | if (item.Type === 'qrcode' || item.Type === 'barcode') { |
| | | if (item.Type === 'barcode') { |
| | | nonEFields.push(item.Field) |
| | | } |
| | | } else if (!item.Value) { |
| | | // 条码二维码内容不可为空 |
| | | if (item.Type === 'barcode') { |
| | | error = '模板中条码/二维码内容不可为空!' |
| | | } |
| | | } |
| | | |
| | | control.push(item) |
| | |
| | | import React, {Component} from 'react' |
| | | import React, { Component } from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Row, Col, Button, notification, Modal, Tooltip, Radio, Select, Switch } from 'antd' |
| | |
| | | editItem: null, |
| | | usefulfields: null, |
| | | loading: false, |
| | | skip: false, |
| | | verifySql: '' |
| | | skip: false |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | |
| | | } |
| | | |
| | | resetfield = (columns) => { |
| | | const { btn } = this.props |
| | | columns = columns.filter(item => item.import !== 'false') |
| | | let fields = columns.map(item => item.Column) |
| | | |
| | | fields.push('jskey') |
| | | |
| | | let _dec = columns.map(item => item.Column + ' ' + item.type).join(',') |
| | | let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '') |
| | | |
| | | if (_dec) { |
| | | _dec += ',' |
| | | } |
| | | |
| | | let _sql = `create table #${sheet} (${_dec}jskey nvarchar(50),BID nvarchar(50) ) |
| | | Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512) |
| | | Select @ErrorCode='', @retmsg='' |
| | | ` |
| | | |
| | | this.setState({ |
| | | verifySql: _sql, |
| | | usefulfields: fields.join(', ') |
| | | }) |
| | | } |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { type, btn, workFlow } = this.props |
| | | const { type, btn, workFlow, usefulfields } = this.props |
| | | const { editItem, skip } = this.state |
| | | |
| | | // 表单提交时检查输入值是否正确 |
| | |
| | | let pass = checkSQL(values.sql, 'customscript') |
| | | |
| | | if (!pass) return |
| | | |
| | | let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '') |
| | | let tail = ` |
| | | drop table #${sheet} |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg |
| | | ` |
| | | |
| | | let _initCustomScript = '' // 初始化脚本 |
| | | let _prevCustomScript = '' // 默认sql前执行脚本 |
| | |
| | | ` |
| | | } |
| | | } |
| | | |
| | | let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '') |
| | | let fields = [] |
| | | let _dec = [] |
| | | let vals = [] |
| | | |
| | | let sql = this.state.verifySql + _initCustomScript + _prevCustomScript + _backCustomScript + tail |
| | | usefulfields.forEach(col => { |
| | | if (col.import === 'false') return |
| | | |
| | | fields.push(col.Column) |
| | | _dec.push(col.Column + ' ' + col.type) |
| | | |
| | | let val = '' |
| | | if (col.import === 'init') { |
| | | if (/^Nvarchar/ig.test(col.type)) { |
| | | val = '' |
| | | } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) { |
| | | val = 0 |
| | | } else if (col.type === 'date') { |
| | | val = '1949-10-01' |
| | | } else if (col.type === 'datetime') { |
| | | val = '1949-10-01 00:00:00' |
| | | } |
| | | } else if (/^Nvarchar/ig.test(col.type)) { |
| | | val = 'mk' |
| | | } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) { |
| | | val = 1 |
| | | } else if (col.type === 'date') { |
| | | val = '1949-10-01' |
| | | } else if (col.type === 'datetime') { |
| | | val = '1949-10-01 00:00:00' |
| | | } |
| | | |
| | | vals.push(`'${val}'`) |
| | | }) |
| | | |
| | | vals.push(`'${new Date().getTime()}000010'`) |
| | | vals.push(`'bid'`) |
| | | vals = `Select ${vals.join(',')}` |
| | | |
| | | fields.push('jskey') |
| | | fields = fields.join(',') |
| | | |
| | | _dec = _dec.join(',') |
| | | _dec = _dec ? _dec + ',' : '' |
| | | |
| | | let sql = `create table #${sheet} (${_dec}jskey nvarchar(50),BID nvarchar(50) ) |
| | | Declare @UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100),@ErrorCode nvarchar(50), @retmsg nvarchar(4000),@tbid Nvarchar(512) |
| | | Select @ErrorCode='', @retmsg='', @UserName='', @FullName='', @RoleID='', @mk_departmentcode='', @mk_organization='', @mk_user_type='', @mk_nation='', @mk_province='', @mk_city='', @mk_district='', @mk_address='' |
| | | |
| | | ${_initCustomScript} |
| | | |
| | | Insert into #${sheet} (${fields},BID) |
| | | |
| | | /* excel数据*/ |
| | | ${vals} |
| | | |
| | | ${_prevCustomScript} |
| | | |
| | | ${_backCustomScript} |
| | | |
| | | drop table #${sheet} |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg |
| | | ` |
| | | |
| | | sql = sql.replace(/@\$|\$@/ig, '').replace(/\$check@|@check\$/ig, '').replace(/@datam@/ig, `''`).replace(/@typename@/ig, `'debug'`) |
| | | |
| | | if (workFlow === 'true') { |