| | |
| | | type: 'radio', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initval: wrap.permission || 'false', |
| | | initval: wrap.permission || (!appType ? 'true' : 'false'), |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'select', |
| | |
| | | type: 'radio', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initval: wrap.permission || 'false', |
| | | initval: wrap.permission || (!appType ? 'true' : 'false'), |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | type: 'radio', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initval: wrap.permission || 'false', |
| | | initval: wrap.permission || (!appType ? 'true' : 'false'), |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | type: 'radio', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initval: wrap.permission || 'false', |
| | | initval: wrap.permission || (!appType ? 'true' : 'false'), |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | border-right: 1px solid #e9e9e9; |
| | | } |
| | | span:nth-child(3), span:nth-child(6) { |
| | | border-color: #91d5ff; |
| | | border-color: #474069; |
| | | } |
| | | span:nth-child(9) { |
| | | border-color: #ffa39e; |
| | | border-color: #C48584; |
| | | } |
| | | } |
| | | |
| | |
| | | tr { |
| | | th { |
| | | position: relative; |
| | | background-color: transparent; |
| | | background-color: #E3E7F2; |
| | | padding: 0; |
| | | height: 60px; |
| | | line-height: 60px; |
| | |
| | | max-width: 60px; |
| | | } |
| | | .ant-table-tbody { |
| | | tr:last-child { |
| | | background-color: #FBF8EF; |
| | | } |
| | | tr td { |
| | | position: relative; |
| | | background-color: transparent; |
| | |
| | | deleteCol = (col) => { |
| | | let _columns = fromJS(this.state.columns).toJS() |
| | | |
| | | _columns = this.loopDelCol(_columns, col) |
| | | if (col.type === 'colspan' && col.subcols && col.subcols.length > 0) { |
| | | let Index = _columns.findIndex(item => item.uuid === col.uuid) |
| | | |
| | | if (Index !== -1) { |
| | | let list = col.subcols.map(item => { |
| | | item.isSub = false |
| | | return item |
| | | }) |
| | | |
| | | _columns.splice(Index, 1, ...list) |
| | | } else { |
| | | _columns = this.loopDelCol(_columns, col) |
| | | } |
| | | } else { |
| | | _columns = this.loopDelCol(_columns, col) |
| | | } |
| | | |
| | | this.setState({ |
| | | columns: _columns |
| | |
| | | } |
| | | } |
| | | |
| | | let _type = type || '' |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form" id="verify-excelin-custom-scripts"> |
| | | <Row gutter={24}> |
| | | {!_type && btn.sheet ? <Col span={8}> |
| | | {!type && btn.sheet ? <Col span={8}> |
| | | <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}> |
| | | {btn.sheet} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!_type ? <Col span={10}> |
| | | {!type ? <Col span={10}> |
| | | <Form.Item label={'报错字段'} style={{margin: 0, whiteSpace: 'nowrap'}}> |
| | | ErrorCode(增加后缀NT表示数据不回滚,如ENT、NNT、FNT、NMNT), retmsg |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!_type ? <Col span={24} className="sqlfield"> |
| | | {!type ? <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>, |
| | | {usefulfields},data_type(注:jskey为主键值,新增时前端生成;data_type为操作类型,新增 - add、修改 - upt、删除 - del) |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!_type ? <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | {!type ? <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | <Form.Item style={{marginBottom: 0}} label={ |
| | | <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {!_type ? <Col span={10}> |
| | | {!type ? <Col span={10}> |
| | | <Form.Item style={{marginBottom: 0}} label={'快捷添加'}> |
| | | <Select |
| | | showSearch |
| | |
| | | </Col> : null} |
| | | <Col span={6} className="add"> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> |
| | | {_type === 'fullscreen' && !editItem ? '添加' : '保存'} |
| | | {type === 'fullscreen' && !editItem ? '添加' : '保存'} |
| | | </Button> |
| | | <Button onClick={this.handleCancel} style={{marginBottom: 15, marginLeft: 10}}> |
| | | 取消 |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Form, Tabs, Row, Col, Input, Button, Popconfirm, notification, Modal, message, InputNumber, Radio, Typography } from 'antd' |
| | | import { StopTwoTone, CheckCircleTwoTone, EditOutlined, SwapOutlined, DeleteOutlined, BorderOutlined, CheckCircleOutlined, StopOutlined } from '@ant-design/icons' |
| | | import { StopTwoTone, CheckCircleTwoTone, EditOutlined, SwapOutlined, DeleteOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | |
| | | import MKEmitter from '@/utils/events.js' |
| | | import UniqueForm from './uniqueform' |
| | | import CustomScript from './customscript' |
| | | import MinView from '@/assets/img/minview.png' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import './index.scss' |
| | | |
| | |
| | | const { confirm } = Modal |
| | | const { Paragraph } = Typography |
| | | const EditTable = asyncComponent(() => import('@/templates/zshare/editTable')) |
| | | const FullScripts = asyncComponent(() => import('@/templates/zshare/verifycard/fullScripts')) |
| | | |
| | | class VerifyTableCard extends Component { |
| | | static propTpyes = { |
| | |
| | | } |
| | | |
| | | state = { |
| | | visible: false, |
| | | scriptId: '', |
| | | verify: {}, |
| | | fields: [], |
| | | fieldLabel: {}, |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { verify, scriptsColumns, uniqueColumns, activeKey, fields, visible } = this.state |
| | | const { verify, scriptsColumns, uniqueColumns, activeKey, fields } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | {verify.scripts.length ? <span className="count-tip">{verify.scripts.length}</span> : null} |
| | | </span> |
| | | } key="scripts"> |
| | | <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({ |
| | | top: 92, |
| | | message: '请保存自定义脚本!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | this.setState({visible: true, scriptId: ''}) |
| | | }}/> |
| | | <FullScripts |
| | | verify={verify} |
| | | getScriptsFullForm={() => this.scriptsFullForm} |
| | | getScriptsForm={() => this.scriptsForm} |
| | | handleStatus={this.handleStatus} |
| | | handleDelete={this.handleDelete} |
| | | > |
| | | <CustomScript |
| | | type="fullscreen" |
| | | btn={verify} |
| | | usefulfields={fields} |
| | | scripts={verify.scripts} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | wrappedComponentRef={(inst) => this.scriptsFullForm = inst} |
| | | /> |
| | | </FullScripts> |
| | | <CustomScript |
| | | btn={verify} |
| | | usefulfields={fields} |
| | |
| | | </Form> |
| | | </TabPane> |
| | | </Tabs> |
| | | <Modal |
| | | wrapClassName="model-custom-scripts-modal" |
| | | title="自定义脚本" |
| | | visible={visible} |
| | | width={'95vw'} |
| | | maskClosable={false} |
| | | destroyOnClose |
| | | > |
| | | <img className="unfull-scripts" src={MinView} onClick={() => this.setState({visible: false, scriptId: ''})} alt=""/> |
| | | <div className="script-table-wrap"> |
| | | {verify.scripts.map(item => { |
| | | let title = item.sql.match(/^\s*\/\*.+\*\//) |
| | | title = title && title[0] ? title[0] : '' |
| | | let _text = title ? item.sql.replace(title, '') : item.sql |
| | | |
| | | let position = null |
| | | if (item.position === 'init') { |
| | | position = <span style={{color: 'orange'}}>初始化</span> |
| | | } else if (item.position === 'front') { |
| | | position = <span style={{color: '#26C281'}}>sql前</span> |
| | | } else { |
| | | position = <span style={{color: '#1890ff'}}>sql后</span> |
| | | } |
| | | |
| | | if (item.status === 'false') { |
| | | return ( |
| | | <div className="script-item" key={item.uuid}> |
| | | <div style={{cursor: 'not-allowed'}}> |
| | | {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} |
| | | <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> |
| | | <div>{position} |
| | | <span style={{color: '#ff4d4f', marginLeft: '20px'}}> |
| | | 禁用 |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | <div style={{height: '24px'}}></div> |
| | | </div> |
| | | ) |
| | | } else { |
| | | return ( |
| | | <div className={'script-item ' + (this.state.scriptId === item.uuid ? 'active' : '') } key={item.uuid}> |
| | | <div style={{cursor: 'pointer'}} onClick={() => { |
| | | this.scriptsFullForm.edit(item) |
| | | this.setState({scriptId: item.uuid}) |
| | | }}> |
| | | {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} |
| | | <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> |
| | | <div>{position} |
| | | <span style={{color: '#26C281', marginLeft: '20px'}}> |
| | | 启用 |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | <div style={{textAlign: 'right'}}> |
| | | <span className="operation-btn" onClick={() => this.handleStatus(item, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> |
| | | <Popconfirm |
| | | overlayClassName="popover-confirm" |
| | | title="确定删除吗?" |
| | | onConfirm={() => this.handleDelete(item, 'scripts') |
| | | }> |
| | | <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> |
| | | </Popconfirm> |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | })} |
| | | </div> |
| | | <CustomScript |
| | | type="fullscreen" |
| | | btn={verify} |
| | | usefulfields={fields} |
| | | scripts={verify.scripts} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | wrappedComponentRef={(inst) => this.scriptsFullForm = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | color: #1890ff; |
| | | z-index: 1; |
| | | } |
| | | } |
| | | .model-custom-scripts-modal { |
| | | .ant-modal { |
| | | top: 30px; |
| | | .ant-modal-header { |
| | | padding: 10px 24px; |
| | | } |
| | | .ant-modal-footer { |
| | | display: none; |
| | | } |
| | | .ant-modal-close { |
| | | display: none; |
| | | } |
| | | .ant-modal-body { |
| | | padding: 0; |
| | | height: calc(100vh - 100px); |
| | | overflow: hidden; |
| | | display: flex; |
| | | |
| | | .script-table-wrap { |
| | | width: 240px; |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | height: calc(100vh - 100px); |
| | | |
| | | .operation-btn { |
| | | display: inline-block; |
| | | font-size: 16px; |
| | | padding: 0 5px; |
| | | cursor: pointer; |
| | | margin-left: 5px; |
| | | } |
| | | |
| | | .script-item { |
| | | border-bottom: 1px solid #eeeeee; |
| | | padding: 15px 10px 5px; |
| | | } |
| | | .script-item.active { |
| | | background-color: #bae7ff; |
| | | } |
| | | .ant-typography { |
| | | margin-bottom: 5px; |
| | | } |
| | | } |
| | | |
| | | .script-table-wrap::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .script-table-wrap::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | } |
| | | .script-table-wrap::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | |
| | | .unfull-scripts { |
| | | position: absolute; |
| | | right: 20px; |
| | | z-index: 2; |
| | | top: 10px; |
| | | color: #1890ff; |
| | | width: 26px; |
| | | cursor: pointer; |
| | | padding: 5px; |
| | | |
| | | } |
| | | |
| | | .verify-form { |
| | | flex: 1; |
| | | >.ant-row { |
| | | margin: 0!important; |
| | | position: unset; |
| | | } |
| | | .sql { |
| | | padding: 0!important; |
| | | .ant-form-item-label { |
| | | display: none; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | width: 100%; |
| | | } |
| | | .CodeMirror { |
| | | height: calc(100vh - 100px); |
| | | border-radius: 0; |
| | | } |
| | | .code-mirror-area { |
| | | border-radius: 0; |
| | | width: calc(95vw - 240px); |
| | | } |
| | | } |
| | | .sqlfield { |
| | | .ant-form-item { |
| | | margin-bottom: 5px; |
| | | } |
| | | .ant-form-item-control { |
| | | line-height: 24px; |
| | | } |
| | | .ant-form-item-label { |
| | | line-height: 25px; |
| | | } |
| | | .ant-form-item-children { |
| | | line-height: 22px; |
| | | } |
| | | .ant-col-sm-8 { |
| | | width: 10.5%; |
| | | } |
| | | .ant-col-sm-16 { |
| | | width: 89.5%; |
| | | } |
| | | } |
| | | .add { |
| | | position: absolute; |
| | | top: 10px; |
| | | z-index: 1; |
| | | .ant-btn { |
| | | height: 28px; |
| | | } |
| | | .mk-green { |
| | | margin-left: 0!important; |
| | | margin-right: 10px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | type: 'radio', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initval: wrap.permission || 'false', |
| | | initval: wrap.permission || (!appType ? 'true' : 'false'), |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | // { |
| | | // type: 'radio', |
| | |
| | | type: 'radio', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initval: wrap.permission || 'false', |
| | | initval: wrap.permission || (!appType ? 'true' : 'false'), |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'multiselect', |
| | |
| | | type: 'radio', |
| | | field: 'permission', |
| | | label: '权限验证', |
| | | initval: wrap.permission || 'false', |
| | | initval: wrap.permission || (!appType ? 'true' : 'false'), |
| | | required: false, |
| | | options: [ |
| | | {value: 'true', label: '启用'}, |
| | | {value: 'false', label: '禁用'}, |
| | | ], |
| | | forbid: !appType || sessionStorage.getItem('editMenuType') === 'popview' |
| | | forbid: sessionStorage.getItem('editMenuType') === 'popview' |
| | | }, |
| | | { |
| | | type: 'radio', |
| | |
| | | border-right: 1px solid #e9e9e9; |
| | | } |
| | | span:nth-child(3), span:nth-child(6) { |
| | | border-color: #91d5ff; |
| | | border-color: #474069; |
| | | } |
| | | span:nth-child(9) { |
| | | border-color: #ffa39e; |
| | | border-color: #C48584; |
| | | } |
| | | } |
| | | |
| | |
| | | tr { |
| | | th { |
| | | position: relative; |
| | | background-color: transparent; |
| | | background-color: #E3E7F2; |
| | | padding: 0; |
| | | height: 60px; |
| | | line-height: 60px; |
| | |
| | | max-width: 60px; |
| | | } |
| | | .ant-table-tbody { |
| | | tr:last-child { |
| | | background-color: #FBF8EF; |
| | | } |
| | | tr td { |
| | | position: relative; |
| | | background-color: transparent; |
| | |
| | | BID: id, |
| | | BData: data |
| | | }, () => { |
| | | this.loadmaindata(true, 'true') |
| | | setTimeout(() => { |
| | | this.loadmaindata(true, 'true') |
| | | }, setting.delay || 0) |
| | | }) |
| | | } |
| | | } |
| | |
| | | } |
| | | }, 50) |
| | | |
| | | let values = {} |
| | | // if (col.editField) { |
| | | // values[col.field] = label |
| | | // values[col.editField] = val |
| | | // } else { |
| | | values[col.field] = val |
| | | // } |
| | | |
| | | MKEmitter.emit('changeRecord', col.tableId, {...record, ...values}) |
| | | MKEmitter.emit('changeRecord', col.tableId, {...record, [col.field]: val}) |
| | | } |
| | | |
| | | onSelectChange = (val, option) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | // if (col.editField) { |
| | | // values[col.field] = _option.label |
| | | // values[col.editField] = val |
| | | // } else { |
| | | values[col.field] = val |
| | | // } |
| | | values[col.field] = val |
| | | } |
| | | |
| | | this.setState({editing: false}) |
| | |
| | | <Input className={err ? 'has-error' : ''} title={err} id={col.uuid + record.$$uuid} defaultValue={value} onChange={(e) => this.onChange(e.target.value)} onPressEnter={this.enterPress} onBlur={this.onBlur}/> |
| | | </td>) |
| | | } else if (col.editType === 'switch') { |
| | | let _value = '' |
| | | // if (col.editField) { |
| | | // _value = record[col.editField] !== undefined ? record[col.editField] : '' |
| | | // } else { |
| | | _value = record[col.field] !== undefined ? record[col.field] : '' |
| | | // } |
| | | let _value = record[col.field] !== undefined ? record[col.field] : '' |
| | | |
| | | return (<td className="editing_table_cell"> |
| | | <CusSwitch config={col} defaultValue={_value} autoFocus={true} onChange={this.onSwitchChange} onBlur={this.switchBlur}/> |
| | | </td>) |
| | | } else { |
| | | let _value = '' |
| | | // if (col.editField) { |
| | | // _value = record[col.editField] !== undefined ? record[col.editField] : '' |
| | | // } else { |
| | | _value = record[col.field] !== undefined ? record[col.field] : '' |
| | | // } |
| | | let _value = record[col.field] !== undefined ? record[col.field] : '' |
| | | |
| | | return (<td className="editing_table_cell"> |
| | | <Select |
| | | showSearch |
| | |
| | | } |
| | | }, 50) |
| | | |
| | | let values = {} |
| | | // if (col.editField) { |
| | | // values[col.field] = label |
| | | // values[col.editField] = val |
| | | // } else { |
| | | values[col.field] = val |
| | | // } |
| | | |
| | | MKEmitter.emit('changeRecord', col.tableId, {...record, ...values}) |
| | | MKEmitter.emit('changeRecord', col.tableId, {...record, [col.field]: val}) |
| | | } |
| | | |
| | | onSelectChange = (val, option) => { |
| | |
| | | }) |
| | | } |
| | | |
| | | // if (col.editField) { |
| | | // values[col.field] = _option.label |
| | | // values[col.editField] = val |
| | | // } else { |
| | | values[col.field] = val |
| | | // } |
| | | values[col.field] = val |
| | | } |
| | | |
| | | setTimeout(() => { |
| | |
| | | let children = null |
| | | if (col.type === 'text') { |
| | | if (col.editable === 'true' && !disabled) { |
| | | let _value = '' |
| | | // if (col.editField) { |
| | | // _value = record[col.editField] !== undefined ? record[col.editField] : '' |
| | | // } else { |
| | | _value = record[col.field] !== undefined ? record[col.field] : '' |
| | | // } |
| | | let _value = record[col.field] !== undefined ? record[col.field] : '' |
| | | |
| | | if (!col.editType || col.editType === 'text') { |
| | | children = (<> |
| | |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } |
| | | } |
| | | |
| | | if (col.editable === 'true' && disabled) { |
| | | content = <span style={{display: 'inline-block', padding: '0 6px'}}>{content}</span> |
| | | } |
| | | |
| | | children = content |
| | | } |
| | | } else if (col.type === 'number') { |
| | |
| | | content = <span style={mark.innerStyle}>{content}</span> |
| | | } |
| | | } |
| | | |
| | | if (col.editable === 'true' && disabled) { |
| | | content = <span style={{display: 'inline-block', padding: '0 6px'}}>{content}</span> |
| | | } |
| | | |
| | | children = content |
| | | } |
| | | } else if (col.type === 'textarea') { |
| | |
| | | if (menuid !== MenuID) return |
| | | |
| | | if (type !== 'line') { |
| | | this.setState({edData: data}) |
| | | if (setting.editType === 'multi' && data.length > 0) { |
| | | this.setState({edData: []}, () => { |
| | | this.setState({edData: data}) |
| | | }) |
| | | } else { |
| | | this.setState({edData: data}) |
| | | } |
| | | |
| | | if (setting.addable && data.length === 0) { |
| | | setTimeout(() => { |
| | |
| | | } |
| | | } |
| | | |
| | | let pass = skip |
| | | |
| | | if (item.wrap && item.wrap.permission === 'false') { |
| | | pass = true |
| | | } |
| | | |
| | | // 权限过滤 |
| | | if (item.action && item.action.length > 0) { |
| | | item.action = item.action.filter(cell => { |
| | |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } |
| | | |
| | | return skip || permAction[cell.uuid] |
| | | return pass || permAction[cell.uuid] |
| | | }) |
| | | } |
| | | |
| | |
| | | cell = this.getPrinter(cell, item.uuid) |
| | | } |
| | | |
| | | return skip || permAction[cell.uuid] |
| | | return pass || permAction[cell.uuid] |
| | | } else { |
| | | cell = this.resetElement(cell) |
| | | } |
| | |
| | | cell = this.resetElement(cell) |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | return cell.eleType !== 'button' || pass || permAction[cell.uuid] |
| | | }) |
| | | |
| | | if (!card.backElements || card.backElements.length === 0) return |
| | |
| | | cell = this.resetElement(cell) |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | return cell.eleType !== 'button' || pass || permAction[cell.uuid] |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | |
| | | cell = this.resetElement(cell) |
| | | } |
| | | |
| | | return cell.eleType !== 'button' || skip || permAction[cell.uuid] |
| | | return cell.eleType !== 'button' || pass || permAction[cell.uuid] |
| | | }) |
| | | } else if (item.type === 'form') { |
| | | item.subcards = item.subcards.map(group => { |
| | |
| | | this.sendMessage(btn.verify, id) |
| | | } |
| | | if (btn.verify.wxNote === 'true') { |
| | | this.sendWxMessage(btn.verify, id) |
| | | if (btn.verify.wxTemplateId === 'mk_category_temp') { |
| | | let verify = fromJS(btn.verify).toJS() |
| | | verify.wxTemplateId = verify.wxCustomTempId |
| | | |
| | | verify.wxNoteKeys = verify.wxNoteKeys.filter(item => item.key) |
| | | |
| | | if (!verify.wxTemplateId || verify.wxNoteKeys.length === 0) return |
| | | |
| | | this.sendWxMessage(verify, id) |
| | | } else { |
| | | this.sendWxMessage(btn.verify, id) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | Api.genericInterface(param).then(res => { |
| | | res.send_data = [{openid: 'o2E7gvoSFvQRG7I8_gZxf4y3ONkQ', send_id: Utils.getuuid(), first: '您的缴费信息如下', p1: '010000000001', p2: '2022年07月03日', p3: '供暖缴费', p4: '20元', p5: '成功', remark: '感谢您的使用!'}] |
| | | res.send_data = [{openid: 'o2E7gvoSFvQRG7I8_gZxf4y3ONkQ', send_id: Utils.getuuid(), p1: '010000000001', p2: '明科', p3: 'dddd', p4: '顺风', p5: '成功'}] |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | params.forEach(n => { |
| | | Api.wxNginxRequest(`cgi-bin/message/template/send?access_token=${res.oa_access_token}`, 'post', n).then(re => { |
| | | if (verify.wxNoteCallback === 'true') { |
| | | let msg = re.errmsg || '' |
| | | |
| | | if (msg.length > 50) { |
| | | msg = msg.substr(0, 50) |
| | | } |
| | | |
| | | let _p = { |
| | | func: 's_get_sms_weixin_local_suc_err', |
| | | upid: id, |
| | | send_id: n.client_msg_id || '', |
| | | status_result: re.errcode === 0 ? 'S' : 'E', |
| | | errcode: re.errcode, |
| | | msg_result: re.errmsg |
| | | msg_result: msg |
| | | } |
| | | |
| | | _p.LText = Utils.formatOptions(Utils.getuuid()) |
| | |
| | | } |
| | | |
| | | edit = (record) => { |
| | | const { type } = this.props |
| | | |
| | | this.setState({ |
| | | editItem: record |
| | | }) |
| | | |
| | | this.props.form.setFieldsValue({ |
| | | sql: record.sql, |
| | | position: record.position || 'back' |
| | | }) |
| | | if (type === 'fullscreen') { |
| | | this.props.form.setFieldsValue({ |
| | | sql: record.sql |
| | | }) |
| | | } else { |
| | | this.props.form.setFieldsValue({ |
| | | sql: record.sql, |
| | | position: record.position || 'back' |
| | | }) |
| | | } |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { type } = this.props |
| | | const { editItem } = this.state |
| | | |
| | | // 表单提交时检查输入值是否正确 |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (type === 'fullscreen' && err) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请输入sql!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | if (!err) { |
| | | if (/^[\s\n]+$/.test(values.sql)) { |
| | | notification.warning({ |
| | |
| | | return |
| | | } |
| | | |
| | | values.uuid = this.state.editItem ? this.state.editItem.uuid : '' |
| | | values.uuid = editItem ? editItem.uuid : '' |
| | | |
| | | if (type === 'fullscreen' && editItem) { |
| | | values.status = editItem.status || 'true' |
| | | } |
| | | |
| | | let _quot = values.sql.match(/'{1}/g) |
| | | let _lparen = values.sql.match(/\({1}/g) |
| | |
| | | this.props.scriptsChange(values) |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: '' |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({loading: false}) |
| | |
| | | }) |
| | | |
| | | this.props.form.setFieldsValue({ |
| | | sql: '' |
| | | sql: ' ' |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let _sql = this.props.form.getFieldValue('sql') |
| | | if (/^\s+$/.test(_sql)) { |
| | | _sql = '' |
| | | } |
| | | if (_sql) { |
| | | _sql = _sql + ` |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { systemScripts, btn } = this.props |
| | | const { usefulfields } = this.state |
| | | const { systemScripts, btn, type } = this.props |
| | | const { usefulfields, editItem } = this.state |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | |
| | | return ( |
| | | <Form {...formItemLayout} className="verify-form" id="verify-excelin-custom-scripts"> |
| | | <Row gutter={24}> |
| | | {btn.sheet ? <Col span={8}> |
| | | {!type && btn.sheet ? <Col span={8}> |
| | | <Form.Item label={'表名'} style={{whiteSpace: 'nowrap', margin: 0}}> |
| | | {btn.sheet} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={10}> |
| | | {!type ? <Col span={10}> |
| | | <Form.Item label={'报错字段'} style={{margin: 0, whiteSpace: 'nowrap'}}> |
| | | ErrorCode(增加后缀NT表示数据不回滚,如ENT、NNT、FNT、NMNT), retmsg |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24} className="sqlfield"> |
| | | </Col> : null} |
| | | {!type ? <Col span={24} className="sqlfield"> |
| | | <Form.Item label={'可用字段'}> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>, |
| | | {usefulfields} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | </Col> : null} |
| | | {!type ? <Col span={8} style={{whiteSpace: 'nowrap'}}> |
| | | <Form.Item style={{marginBottom: 0}} label={ |
| | | <Tooltip placement="bottomLeft" title={'自定义脚本与默认sql位置关系。'}> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={10}> |
| | | </Col> : null} |
| | | {!type ? <Col span={10}> |
| | | <Form.Item style={{marginBottom: 0}} label={'快捷添加'}> |
| | | <Select |
| | | showSearch |
| | |
| | | )} |
| | | </Select> |
| | | </Form.Item> |
| | | </Col> |
| | | </Col> : null} |
| | | <Col span={6} className="add"> |
| | | <Button onClick={this.handleConfirm} loading={this.state.loading} className="mk-green" style={{marginBottom: 15, marginLeft: 40}}> |
| | | 保存 |
| | | {type === 'fullscreen' && !editItem ? '添加' : '保存'} |
| | | </Button> |
| | | <Button onClick={this.handleCancel} style={{marginBottom: 15, marginLeft: 10}}> |
| | | 取消 |
| | |
| | | const { confirm } = Modal |
| | | const { Paragraph } = Typography |
| | | const EditTable = asyncComponent(() => import('@/templates/zshare/editTable')) |
| | | const FullScripts = asyncComponent(() => import('@/templates/zshare/verifycard/fullScripts')) |
| | | |
| | | class VerifyCard extends Component { |
| | | static propTpyes = { |
| | |
| | | changeColumns = (columns) => { |
| | | const { verify } = this.state |
| | | |
| | | let reset = false |
| | | columns = columns.map(col => { |
| | | col.type = col.type || 'Nvarchar(50)' |
| | | if (col.type === 'text' || col.type === 'image') { |
| | |
| | | col.limit = col.type.match(/\d+/) ? col.type.match(/\d+/)[0] : '20000' |
| | | } else if (/^Decimal/ig.test(col.type)) { |
| | | col.limit = col.type.match(/\d+/ig)[1] |
| | | if (col.required === 'false') { |
| | | reset = true |
| | | } |
| | | col.required = 'true' |
| | | } else if (/^int/ig.test(col.type)) { |
| | | if (col.required === 'false') { |
| | | reset = true |
| | | } |
| | | col.required = 'true' |
| | | } else { |
| | | col.limit = '' |
| | |
| | | |
| | | return col |
| | | }) |
| | | |
| | | if (reset) { |
| | | message.warn('数值类型均为必填。') |
| | | } |
| | | |
| | | this.setState({verify: {...verify, columns}}, () => { |
| | | this.resetUniqueColumns() |
| | |
| | | {verify.scripts.length ? <span className="count-tip">{verify.scripts.length}</span> : null} |
| | | </span> |
| | | } key="scripts" id="mk-exin-script"> |
| | | <FullScripts |
| | | verify={verify} |
| | | getScriptsFullForm={() => this.scriptsFullForm} |
| | | getScriptsForm={() => this.scriptsForm} |
| | | handleStatus={this.handleStatus} |
| | | handleDelete={this.handleDelete} |
| | | > |
| | | <CustomScript |
| | | type="fullscreen" |
| | | btn={this.props.card} |
| | | usefulfields={verify.columns} |
| | | scripts={verify.scripts} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | wrappedComponentRef={(inst) => this.scriptsFullForm = inst} |
| | | /> |
| | | </FullScripts> |
| | | <CustomScript |
| | | btn={this.props.card} |
| | | usefulfields={verify.columns} |
| | |
| | | z-index: 1; |
| | | } |
| | | } |
| | | .full-scripts { |
| | | position: absolute; |
| | | right: 24px; |
| | | top: 0px; |
| | | font-size: 16px; |
| | | color: #1890ff; |
| | | z-index: 1; |
| | | } |
| | | } |
| | |
| | | |
| | | this.props.form.setFieldsValue({ |
| | | sql: record.sql, |
| | | position: record.position || 'back' |
| | | // position: record.position || 'back' |
| | | }) |
| | | } |
| | | |
| | |
| | | editItem: null |
| | | }) |
| | | this.props.form.setFieldsValue({ |
| | | sql: '' |
| | | sql: ' ' |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | |
| | | }) |
| | | |
| | | this.props.form.setFieldsValue({ |
| | | sql: '' |
| | | sql: ' ' |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | let _sql = this.props.form.getFieldValue('sql') |
| | | if (/^\s+$/.test(_sql)) { |
| | | _sql = '' |
| | | } |
| | | if (_sql) { |
| | | _sql = _sql + ` |
| | | |
| | |
| | | ) |
| | | } |
| | | }, |
| | | { |
| | | title: '执行位置', |
| | | dataIndex: 'position', |
| | | width: '10%', |
| | | render: (text, record) => { |
| | | if (record.position === 'init') { |
| | | return <span style={{color: 'orange'}}>初始化</span> |
| | | } else if (record.position === 'front') { |
| | | return <span style={{color: '#26C281'}}>sql前</span> |
| | | } else { |
| | | return <span style={{color: '#1890ff'}}>sql后</span> |
| | | } |
| | | } |
| | | }, |
| | | // { |
| | | // title: '执行位置', |
| | | // dataIndex: 'position', |
| | | // width: '10%', |
| | | // render: (text, record) => { |
| | | // if (record.position === 'init') { |
| | | // return <span style={{color: 'orange'}}>初始化</span> |
| | | // } else if (record.position === 'front') { |
| | | // return <span style={{color: '#26C281'}}>sql前</span> |
| | | // } else { |
| | | // return <span style={{color: '#1890ff'}}>sql后</span> |
| | | // } |
| | | // } |
| | | // }, |
| | | { |
| | | title: '状态', |
| | | dataIndex: 'status', |
| | |
| | | const { verify } = this.props |
| | | |
| | | let sysTemps = [ |
| | | // { |
| | | // template_id: '8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo', |
| | | // title: '订单受理通知(明科云)', |
| | | // primary_industry: 'IT科技', |
| | | // deputy_industry: 'IT软件与服务', |
| | | // content: '订单号:{{keyword1.DATA}}\n订单类型:{{keyword2.DATA}}\n订单状态:{{keyword3.DATA}}\n通知时间:{{keyword4.DATA}}', |
| | | // example: '订单号:20190101001\r\n订单类型:衣柜\r\n订单状态:设计完成\r\n通知时间:2019年1月1日12:30' |
| | | // }, |
| | | // { |
| | | // template_id: 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok', |
| | | // title: '订单进度提醒(明科云)', |
| | | // primary_industry: 'IT科技', |
| | | // deputy_industry: 'IT软件与服务', |
| | | // content: '订单类型:{{keyword1.DATA}}\n订单号:{{keyword2.DATA}}\n订单状态:{{keyword3.DATA}}', |
| | | // example: '订单类型:退租申请\r\n订单号:TZ16101909\r\n订单状态:待取货' |
| | | // }, |
| | | // { |
| | | // template_id: 'mk_category_temp', |
| | | // title: '类目模板', |
| | | // primary_industry: '', |
| | | // deputy_industry: '', |
| | | // content: '', |
| | | // example: '' |
| | | // } |
| | | { |
| | | template_id: '8IFltwzyKcu15iA8fqSyb6m-pMa88a3ZTu0No3vDHgo', |
| | | title: '订单受理通知(明科云)', |
| | | primary_industry: 'IT科技', |
| | | deputy_industry: 'IT软件与服务', |
| | | content: '订单号:{{keyword1.DATA}}\n订单类型:{{keyword2.DATA}}\n订单状态:{{keyword3.DATA}}\n通知时间:{{keyword4.DATA}}', |
| | | example: '订单号:20190101001\r\n订单类型:衣柜\r\n订单状态:设计完成\r\n通知时间:2019年1月1日12:30' |
| | | }, |
| | | { |
| | | template_id: 'LOB-bbt9jVncGh7IOAUdESh1Sgzcbt62UwOqSqcK9ok', |
| | | title: '订单进度提醒(明科云)', |
| | | primary_industry: 'IT科技', |
| | | deputy_industry: 'IT软件与服务', |
| | | content: '订单类型:{{keyword1.DATA}}\n订单号:{{keyword2.DATA}}\n订单状态:{{keyword3.DATA}}', |
| | | example: '订单类型:退租申请\r\n订单号:TZ16101909\r\n订单状态:待取货' |
| | | }, |
| | | { |
| | | template_id: 'mk_category_temp', |
| | | title: '类目模板', |
| | | primary_industry: '', |
| | | deputy_industry: '', |
| | | content: '', |
| | | example: '' |
| | | } |
| | | ] |
| | | |
| | | let _wxTemps = [...wxTemps, ...sysTemps] |
| | |
| | | } else if (verify.wxNote === 'true') { |
| | | if (!verify.wxTemplateId) { |
| | | error = '开启公众号消息推送时,需要选择消息模板!' |
| | | } else if (verify.wxTemplateId === 'mk_category_temp' && !verify.wxCustomTempId) { |
| | | error = '开启公众号消息推送时,需要填写消息模板ID!' |
| | | } else if (verify.wxNoteLink === 'url' && !verify.wxNoteLinkUrl) { |
| | | error = '请填写网址!' |
| | | } |
| | |
| | | _verify.wxNoteLinkMenuId = '' |
| | | _verify.wxNoteCallback = 'false' |
| | | _verify.wxNoteKeys = null |
| | | |
| | | delete _verify.wxCustomTempId |
| | | |
| | | if (this.state.selectTemp) { |
| | | this.setState({selectTemp: null}) |
| | |
| | | keys = keys.map(key => key.replace(/{{|\.DATA}}/g, '')) |
| | | } |
| | | |
| | | let index = 1 |
| | | _verify.wxNoteKeys = keys.map(key => { |
| | | let item = { key: key } |
| | | |
| | | item.value = 'p' + index |
| | | index++ |
| | | delete _verify.wxCustomTempId |
| | | |
| | | return item |
| | | }) |
| | | if (selectTemp.template_id === 'mk_category_temp') { |
| | | _verify.wxNoteKeys = [] |
| | | for (let i = 1; i <= 10; i++) { |
| | | _verify.wxNoteKeys.push({ |
| | | key: '', |
| | | value: 'p' + i |
| | | }) |
| | | } |
| | | } else { |
| | | let index = 1 |
| | | _verify.wxNoteKeys = keys.map(key => { |
| | | let item = { key: key } |
| | | |
| | | item.value = 'p' + index |
| | | index++ |
| | | |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | this.setState({selectTemp}) |
| | | |
| | |
| | | |
| | | return m |
| | | }) |
| | | |
| | | this.props.onChange(_verify) |
| | | } |
| | | |
| | | onWxNoteValueChange = (value, val) => { |
| | | let _verify = fromJS(this.props.verify).toJS() |
| | | |
| | | _verify.wxNoteKeys = _verify.wxNoteKeys.map(m => { |
| | | if (m.value === value) { |
| | | m.key = val.replace(/\s+/ig, '') |
| | | } |
| | | |
| | | return m |
| | | }) |
| | | |
| | | this.props.onChange(_verify) |
| | | } |
| | | |
| | | onWxNoteTempIdChange = (value) => { |
| | | let _verify = fromJS(this.props.verify).toJS() |
| | | |
| | | _verify.wxCustomTempId = value.replace(/\s+/ig, '') |
| | | |
| | | this.props.onChange(_verify) |
| | | } |
| | |
| | | <Input placeholder="" autoComplete="off" value={verify.wxNoteLinkMenuId || ''} onChange={(e) => {this.onOptionChange(e.target.value, 'wxNoteLinkMenuId')}}/> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {verify.wxNote === 'true' && verify.wxNoteKeys ? verify.wxNoteKeys.map((item, index) => <Col span={8} key={'mk' + index}> |
| | | {verify.wxNote === 'true' && verify.wxNoteKeys && (!selectTemp || selectTemp.template_id !== 'mk_category_temp') ? verify.wxNoteKeys.map((item, index) => <Col span={8} key={'mk' + index}> |
| | | <Form.Item label={item.key} required> |
| | | <Select value={item.value} onSelect={(val) => this.onWxNoteKeyChange(item.key, val)}> |
| | | <Select.Option value="p1">p1</Select.Option> |
| | |
| | | <Select.Option value="p9">p9</Select.Option> |
| | | <Select.Option value="p10">p10</Select.Option> |
| | | </Select> |
| | | </Form.Item> |
| | | </Col>) : null} |
| | | {verify.wxNote === 'true' && verify.wxNoteKeys && (selectTemp && selectTemp.template_id === 'mk_category_temp') ? <Col span={8}> |
| | | <Form.Item label="模板ID" required> |
| | | <Input placeholder="" defaultValue={verify.wxCustomTempId} autoComplete="off" onChange={(e) => {this.onWxNoteTempIdChange(e.target.value)}}/> |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {verify.wxNote === 'true' && verify.wxNoteKeys && (selectTemp && selectTemp.template_id === 'mk_category_temp') ? verify.wxNoteKeys.map((item, index) => <Col span={8} key={'mk' + index}> |
| | | <Form.Item label={item.value}> |
| | | <Input placeholder="" defaultValue={item.key} autoComplete="off" onChange={(e) => {this.onWxNoteValueChange(item.value, e.target.value)}}/> |
| | | </Form.Item> |
| | | </Col>) : null} |
| | | {selectTemp && selectTemp.template_id !== 'mk_category_temp' && verify.wxNoteKeys ? <Col span={24} className="wx-note"> |
| | |
| | | </div> |
| | | </div> |
| | | </Col> : null} |
| | | {selectTemp && selectTemp.template_id === 'mk_category_temp' && verify.wxNoteKeys ? <Col span={24} className="wx-note"> |
| | | <div className="note-wrap"> |
| | | <div className="note"> |
| | | <p>消息体</p> |
| | | <div> |
| | | <p>openid: "接收者openid",</p> |
| | | <p>send_id: "防重入id",</p> |
| | | <p>bid: "跳转小程序时,可作为BID。"</p> |
| | | <p style={{color: '#1890ff'}}>请在通用字段中(p1~p10)填入模板中对应的字段名,如 time1.DATA 则填写 time1。</p> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </Col> : null} |
| | | </Row> |
| | | </Form> |
| | | ) |
| | |
| | | import { Form, Row, Col, Select, Button, InputNumber, Input, Tooltip } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | import './index.scss' |
| | | // import './index.scss' |
| | | |
| | | class BillCodeForm extends Component { |
| | | static propTpyes = { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Select, Button, Input } from 'antd' |
| | | import './index.scss' |
| | | // import './index.scss' |
| | | |
| | | class UniqueForm extends Component { |
| | | static propTpyes = { |
| | |
| | | import Utils from '@/utils/utils.js' |
| | | import Api from '@/api' |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | | import './index.scss' |
| | | // import './index.scss' |
| | | |
| | | class CustomForm extends Component { |
| | | static propTpyes = { |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Modal, notification, Typography, Popconfirm } from 'antd' |
| | | import { CheckCircleOutlined, StopOutlined, SwapOutlined, DeleteOutlined, BorderOutlined } from '@ant-design/icons' |
| | | |
| | | import MinView from '@/assets/img/minview.png' |
| | | import './index.scss' |
| | | |
| | | const { Paragraph } = Typography |
| | | |
| | | class fullScripts extends Component { |
| | | static propTpyes = { |
| | | verify: PropTypes.object, |
| | | getScriptsForm: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | visible: false, |
| | | scriptId: '', |
| | | columns: [] |
| | | } |
| | | |
| | | trigger = () => { |
| | | const { getScriptsForm } = this.props |
| | | |
| | | let scriptsForm = getScriptsForm() |
| | | |
| | | if (scriptsForm) { |
| | | let sql = scriptsForm.props.form.getFieldValue('sql') || '' |
| | | if (scriptsForm.state.editItem || (sql && !/^\s+$/.test(sql))) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请保存自定义脚本!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | } |
| | | |
| | | this.setState({visible: true, scriptId: ''}) |
| | | } |
| | | |
| | | render() { |
| | | const { verify, children } = this.props |
| | | const { visible, scriptId } = this.state |
| | | |
| | | return ( |
| | | <> |
| | | <BorderOutlined className="full-scripts" onClick={this.trigger}/> |
| | | <Modal |
| | | wrapClassName="model-custom-scripts-modal" |
| | | title="自定义脚本" |
| | | visible={visible} |
| | | width={'95vw'} |
| | | maskClosable={false} |
| | | destroyOnClose |
| | | > |
| | | <img className="unfull-scripts" src={MinView} onClick={() => this.setState({visible: false, scriptId: ''})} alt=""/> |
| | | <div className="script-table-wrap"> |
| | | {verify.scripts.map(item => { |
| | | let title = item.sql.match(/^\s*\/\*.+\*\//) |
| | | title = title && title[0] ? title[0] : '' |
| | | let _text = title ? item.sql.replace(title, '') : item.sql |
| | | |
| | | let position = null |
| | | if (item.position === 'init') { |
| | | position = <span style={{color: 'orange'}}>初始化</span> |
| | | } else if (item.position === 'front') { |
| | | position = <span style={{color: '#26C281'}}>sql前</span> |
| | | } else { |
| | | position = <span style={{color: '#1890ff'}}>sql后</span> |
| | | } |
| | | |
| | | if (item.status === 'false') { |
| | | return ( |
| | | <div className="script-item" key={item.uuid}> |
| | | <div style={{cursor: 'not-allowed'}}> |
| | | {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} |
| | | <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> |
| | | <div>{position} |
| | | <span style={{color: '#ff4d4f', marginLeft: '20px'}}> |
| | | 禁用 |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | <div style={{height: '24px'}}></div> |
| | | </div> |
| | | ) |
| | | } else { |
| | | return ( |
| | | <div className={'script-item ' + (scriptId === item.uuid ? 'active' : '') } key={item.uuid}> |
| | | <div style={{cursor: 'pointer'}} onClick={() => { |
| | | let scriptsFullForm = this.props.getScriptsFullForm() |
| | | scriptsFullForm && scriptsFullForm.edit(item) |
| | | |
| | | this.setState({scriptId: item.uuid}) |
| | | }}> |
| | | {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} |
| | | <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> |
| | | <div>{position} |
| | | <span style={{color: '#26C281', marginLeft: '20px'}}> |
| | | 启用 |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | <div style={{textAlign: 'right'}}> |
| | | <span className="operation-btn" onClick={() => this.props.handleStatus(item, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> |
| | | <Popconfirm |
| | | overlayClassName="popover-confirm" |
| | | title="确定删除吗?" |
| | | onConfirm={() => this.props.handleDelete(item, 'scripts') |
| | | }> |
| | | <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> |
| | | </Popconfirm> |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | })} |
| | | </div> |
| | | {visible ? children : null} |
| | | </Modal> |
| | | </> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default fullScripts |
New file |
| | |
| | | .model-custom-scripts-modal { |
| | | .ant-modal { |
| | | top: 30px; |
| | | .ant-modal-header { |
| | | padding: 10px 24px; |
| | | } |
| | | .ant-modal-footer { |
| | | display: none; |
| | | } |
| | | .ant-modal-close { |
| | | display: none; |
| | | } |
| | | .ant-modal-body { |
| | | padding: 0; |
| | | height: calc(100vh - 100px); |
| | | overflow: hidden; |
| | | display: flex; |
| | | |
| | | .script-table-wrap { |
| | | width: 240px; |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | height: calc(100vh - 100px); |
| | | |
| | | .operation-btn { |
| | | display: inline-block; |
| | | font-size: 16px; |
| | | padding: 0 5px; |
| | | cursor: pointer; |
| | | margin-left: 5px; |
| | | } |
| | | |
| | | .script-item { |
| | | border-bottom: 1px solid #eeeeee; |
| | | padding: 15px 10px 5px; |
| | | } |
| | | .script-item.active { |
| | | background-color: #bae7ff; |
| | | } |
| | | .ant-typography { |
| | | margin-bottom: 5px; |
| | | } |
| | | } |
| | | |
| | | .script-table-wrap::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .script-table-wrap::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | } |
| | | .script-table-wrap::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | |
| | | .unfull-scripts { |
| | | position: absolute; |
| | | right: 20px; |
| | | z-index: 2; |
| | | top: 10px; |
| | | color: #1890ff; |
| | | width: 26px; |
| | | cursor: pointer; |
| | | padding: 5px; |
| | | |
| | | } |
| | | |
| | | .verify-form { |
| | | flex: 1; |
| | | >.ant-row { |
| | | margin: 0!important; |
| | | position: unset; |
| | | } |
| | | .sql { |
| | | padding: 0!important; |
| | | .ant-form-item-label { |
| | | display: none; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | width: 100%; |
| | | } |
| | | .CodeMirror { |
| | | height: calc(100vh - 100px); |
| | | border-radius: 0; |
| | | } |
| | | .code-mirror-area { |
| | | border-radius: 0; |
| | | width: calc(95vw - 240px); |
| | | } |
| | | } |
| | | .sqlfield { |
| | | .ant-form-item { |
| | | margin-bottom: 5px; |
| | | } |
| | | .ant-form-item-control { |
| | | line-height: 24px; |
| | | } |
| | | .ant-form-item-label { |
| | | line-height: 25px; |
| | | } |
| | | .ant-form-item-children { |
| | | line-height: 22px; |
| | | } |
| | | .ant-col-sm-8 { |
| | | width: 10.5%; |
| | | } |
| | | .ant-col-sm-16 { |
| | | width: 89.5%; |
| | | } |
| | | } |
| | | .add { |
| | | position: absolute; |
| | | top: 10px; |
| | | z-index: 1; |
| | | .ant-btn { |
| | | height: 28px; |
| | | } |
| | | .mk-green { |
| | | margin-left: 0!important; |
| | | margin-right: 10px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Tabs, Row, Col, Button, Popconfirm, notification, Modal, message, InputNumber, Typography } from 'antd' |
| | | import { CheckCircleOutlined, StopOutlined, EditOutlined, SwapOutlined, DeleteOutlined, ExclamationOutlined, BorderOutlined } from '@ant-design/icons' |
| | | import { CheckCircleOutlined, StopOutlined, EditOutlined, SwapOutlined, DeleteOutlined, ExclamationOutlined } from '@ant-design/icons' |
| | | import Toast from 'antd-mobile/es/components/toast' |
| | | import Dialog from 'antd-mobile/es/components/dialog' |
| | | import moment from 'moment' |
| | |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | | import { updateForm } from '@/utils/utils-update.js' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import MinView from '@/assets/img/minview.png' |
| | | import './index.scss' |
| | | |
| | | const { TabPane } = Tabs |
| | | const { confirm } = Modal |
| | | const { Paragraph } = Typography |
| | | const EditTable = asyncComponent(() => import('@/templates/zshare/editTable')) |
| | | const FullScripts = asyncComponent(() => import('./fullScripts')) |
| | | |
| | | class VerifyCard extends Component { |
| | | static propTpyes = { |
| | |
| | | appType: sessionStorage.getItem('appType'), |
| | | notes: [], // 短信模板 |
| | | setting: null, |
| | | visible: false, |
| | | scriptId: '', |
| | | verify: {}, |
| | | fields: [], |
| | | usefulfields: '', |
| | |
| | | |
| | | render() { |
| | | const { card } = this.props |
| | | const { activeKey, verifyInter, setting, verify, fields, visible, uniqueFields, uniqueColumns, unionFields, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, cbScriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail, notes, appType } = this.state |
| | | const { activeKey, verifyInter, setting, verify, fields, uniqueFields, uniqueColumns, unionFields, onceUniqueColumns, columnsFields, contrastColumns, customColumns, orderColumns, scriptsColumns, cbScriptsColumns, orderModular, orderModularDetail, voucher, voucherDetail, notes, appType } = this.state |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | |
| | | {verify.scripts.length ? <span className="count-tip">{verify.scripts.length}</span> : null} |
| | | </span> |
| | | } key="scripts" id="mk-normal-script"> |
| | | <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({ |
| | | top: 92, |
| | | message: '请保存自定义脚本!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | this.setState({visible: true, scriptId: ''}) |
| | | }}/> |
| | | <FullScripts |
| | | verify={verify} |
| | | getScriptsFullForm={() => this.scriptsFullForm} |
| | | getScriptsForm={() => this.scriptsForm} |
| | | handleStatus={this.handleStatus} |
| | | handleDelete={this.handleDelete} |
| | | > |
| | | <CustomScript |
| | | type="fullscreen" |
| | | btn={this.props.card} |
| | | initsql={this.state.initsql} |
| | | customScripts={verify.scripts} |
| | | defaultsql={this.state.defaultsql} |
| | | usefulfields={this.state.usefulfields} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | wrappedComponentRef={(inst) => this.scriptsFullForm = inst} |
| | | /> |
| | | </FullScripts> |
| | | <CustomScript |
| | | btn={this.props.card} |
| | | initsql={this.state.initsql} |
| | |
| | | </Form> |
| | | </TabPane> |
| | | </Tabs> |
| | | <Modal |
| | | wrapClassName="model-custom-scripts-modal" |
| | | title="自定义脚本" |
| | | visible={visible} |
| | | width={'95vw'} |
| | | maskClosable={false} |
| | | destroyOnClose |
| | | > |
| | | <img className="unfull-scripts" src={MinView} onClick={() => this.setState({visible: false, scriptId: ''})} alt=""/> |
| | | <div className="script-table-wrap"> |
| | | {verify.scripts.map(item => { |
| | | let title = item.sql.match(/^\s*\/\*.+\*\//) |
| | | title = title && title[0] ? title[0] : '' |
| | | let _text = title ? item.sql.replace(title, '') : item.sql |
| | | |
| | | let position = null |
| | | if (item.position === 'init') { |
| | | position = <span style={{color: 'orange'}}>初始化</span> |
| | | } else if (item.position === 'front') { |
| | | position = <span style={{color: '#26C281'}}>sql前</span> |
| | | } else { |
| | | position = <span style={{color: '#1890ff'}}>sql后</span> |
| | | } |
| | | |
| | | if (item.status === 'false') { |
| | | return ( |
| | | <div className="script-item" key={item.uuid}> |
| | | <div style={{cursor: 'not-allowed'}}> |
| | | {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} |
| | | <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> |
| | | <div>{position} |
| | | <span style={{color: '#ff4d4f', marginLeft: '20px'}}> |
| | | 禁用 |
| | | <StopOutlined style={{marginLeft: '5px'}} /> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | <div style={{height: '24px'}}></div> |
| | | </div> |
| | | ) |
| | | } else { |
| | | return ( |
| | | <div className={'script-item ' + (this.state.scriptId === item.uuid ? 'active' : '') } key={item.uuid}> |
| | | <div style={{cursor: 'pointer'}} onClick={() => { |
| | | this.scriptsFullForm.edit(item) |
| | | this.setState({scriptId: item.uuid}) |
| | | }}> |
| | | {title ? <div style={{color: '#a50', whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis'}}>{title}</div> : null} |
| | | <Paragraph copyable={{ text: item.sql }} ellipsis={{ rows: 4 }}>{_text}</Paragraph> |
| | | <div>{position} |
| | | <span style={{color: '#26C281', marginLeft: '20px'}}> |
| | | 启用 |
| | | <CheckCircleOutlined style={{marginLeft: '5px'}}/> |
| | | </span> |
| | | </div> |
| | | </div> |
| | | <div style={{textAlign: 'right'}}> |
| | | <span className="operation-btn" onClick={() => this.handleStatus(item, 'scripts')} style={{color: '#8E44AD'}}><SwapOutlined /></span> |
| | | <Popconfirm |
| | | overlayClassName="popover-confirm" |
| | | title="确定删除吗?" |
| | | onConfirm={() => this.handleDelete(item, 'scripts') |
| | | }> |
| | | <span className="operation-btn" style={{color: '#ff4d4f'}}><DeleteOutlined /></span> |
| | | </Popconfirm> |
| | | </div> |
| | | </div> |
| | | ) |
| | | } |
| | | })} |
| | | </div> |
| | | <CustomScript |
| | | type="fullscreen" |
| | | btn={this.props.card} |
| | | initsql={this.state.initsql} |
| | | customScripts={verify.scripts} |
| | | defaultsql={this.state.defaultsql} |
| | | usefulfields={this.state.usefulfields} |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | wrappedComponentRef={(inst) => this.scriptsFullForm = inst} |
| | | /> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | z-index: 1; |
| | | } |
| | | } |
| | | .model-custom-scripts-modal { |
| | | .ant-modal { |
| | | top: 30px; |
| | | .ant-modal-header { |
| | | padding: 10px 24px; |
| | | } |
| | | .ant-modal-footer { |
| | | display: none; |
| | | } |
| | | .ant-modal-close { |
| | | display: none; |
| | | } |
| | | .ant-modal-body { |
| | | padding: 0; |
| | | height: calc(100vh - 100px); |
| | | overflow: hidden; |
| | | display: flex; |
| | | |
| | | .script-table-wrap { |
| | | width: 240px; |
| | | overflow-y: auto; |
| | | overflow-x: hidden; |
| | | height: calc(100vh - 100px); |
| | | |
| | | .operation-btn { |
| | | display: inline-block; |
| | | font-size: 16px; |
| | | padding: 0 5px; |
| | | cursor: pointer; |
| | | margin-left: 5px; |
| | | } |
| | | |
| | | .script-item { |
| | | border-bottom: 1px solid #eeeeee; |
| | | padding: 15px 10px 5px; |
| | | } |
| | | .script-item.active { |
| | | background-color: #bae7ff; |
| | | } |
| | | .ant-typography { |
| | | margin-bottom: 5px; |
| | | } |
| | | } |
| | | |
| | | .script-table-wrap::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .script-table-wrap::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | } |
| | | .script-table-wrap::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | |
| | | .unfull-scripts { |
| | | position: absolute; |
| | | right: 20px; |
| | | z-index: 2; |
| | | top: 10px; |
| | | color: #1890ff; |
| | | width: 26px; |
| | | cursor: pointer; |
| | | padding: 5px; |
| | | |
| | | } |
| | | |
| | | .verify-form { |
| | | flex: 1; |
| | | >.ant-row { |
| | | margin: 0!important; |
| | | position: unset; |
| | | } |
| | | .sql { |
| | | padding: 0!important; |
| | | .ant-form-item-label { |
| | | display: none; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | width: 100%; |
| | | } |
| | | .CodeMirror { |
| | | height: calc(100vh - 100px); |
| | | border-radius: 0; |
| | | } |
| | | .code-mirror-area { |
| | | border-radius: 0; |
| | | width: calc(95vw - 240px); |
| | | } |
| | | } |
| | | .sqlfield { |
| | | .ant-form-item { |
| | | margin-bottom: 5px; |
| | | } |
| | | .ant-form-item-control { |
| | | line-height: 24px; |
| | | } |
| | | .ant-form-item-label { |
| | | line-height: 25px; |
| | | } |
| | | .ant-form-item-children { |
| | | line-height: 22px; |
| | | } |
| | | .ant-col-sm-8 { |
| | | width: 10.5%; |
| | | } |
| | | .ant-col-sm-16 { |
| | | width: 89.5%; |
| | | } |
| | | } |
| | | .add { |
| | | position: absolute; |
| | | top: 10px; |
| | | z-index: 1; |
| | | .ant-btn { |
| | | height: 28px; |
| | | } |
| | | .mk-green { |
| | | margin-left: 0!important; |
| | | margin-right: 10px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .adm-mask { |
| | | z-index: 2000!important; |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Select, Button } from 'antd' |
| | | import './index.scss' |
| | | // import './index.scss' |
| | | |
| | | class UniqueForm extends Component { |
| | | static propTpyes = { |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Row, Col, Select, Switch, notification } from 'antd' |
| | | import './index.scss' |
| | | // import './index.scss' |
| | | |
| | | class UniqueForm extends Component { |
| | | static propTpyes = { |
| | |
| | | } |
| | | }) |
| | | } |
| | | } else if (/^int/ig.test(col.type)) { |
| | | } else if (/^Decimal/ig.test(col.type) || /^int/ig.test(col.type)) { |
| | | if (!val && val !== 0) { |
| | | errors.push(_position + '内容不可为空') |
| | | } else { |
| | | let _val = val + '' |
| | | |
| | | if (!/^(([^0][0-9]+|0)$)|^(([1-9]+)$)/.test(_val)) { // 检验是否为整数 |
| | | errors.push(_position + '内容应为整数') |
| | | } else if ((col.min || col.min === 0) && val < col.min) { // 最小值检验 |
| | | errors.push(_position + '小于最小值') |
| | | } else if ((col.max || col.max === 0) && val > col.max) { // 最大值检验 |
| | | errors.push(_position + '大于最大值') |
| | | } |
| | | } |
| | | } else if (/^Decimal/ig.test(col.type)) { |
| | | if (!val && val !== 0) { |
| | | errors.push(_position + '内容不可为空') |
| | | } else { |
| | | let _val = val + '' |
| | | let _vals = _val.split('.') |
| | | |
| | | if (!/^(([^0][0-9]+|0)\.([0-9]+)$)|^(([^0][0-9]+|0)$)|^(([1-9]+)\.([0-9]+)$)|^(([1-9]+)$)/.test(_val)) { // 检验是否为浮点数 |
| | | errors.push(_position + '内容应为浮点数') |
| | | } else if (_vals[0].length > 18) { // 检验整数位 |
| | | errors.push(_position + '整数位超出范围') |
| | | } else if (_vals[1] && _vals[1].length > col.limit) { // 最小值检验 |
| | | errors.push(_position + '小数位超出范围') |
| | | if (!/^(([^0][0-9]+|0)\.([0-9]+)$)|^(([^0][0-9]+|0)$)|^(([1-9]+)\.([0-9]+)$)|^(([1-9]+)$)/.test(val)) { // 检验是否为浮点数 |
| | | errors.push(_position + '内容应为数值') |
| | | } else if ((col.min || col.min === 0) && val < col.min) { // 最小值检验 |
| | | errors.push(_position + '小于最小值') |
| | | } else if ((col.max || col.max === 0) && val > col.max) { // 最大值检验 |
| | |
| | | if (item.$tables) { |
| | | tbs.push(...item.$tables) |
| | | } |
| | | |
| | | if (item.wrap && item.wrap.permission === 'false') { |
| | | return |
| | | } |
| | | |
| | | if (item.action && item.action.length > 0) { |
| | | item.action.forEach(btn => { |
| | | if (btn.hidden === 'true') return |