From 43a517b80f2803e0dcf6658113520c4a14c8c17f Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 22 五月 2023 18:21:52 +0800 Subject: [PATCH] 2023-05-22 --- src/menu/components/timeline/normal-timeline/options.jsx | 4 src/menu/components/module/voucher/voucherTable/index.scss | 9 src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx | 9 src/menu/components/table/edit-table/columns/tableIn/index.jsx | 117 ---- src/menu/components/table/normal-table/options.jsx | 4 src/menu/components/card/balcony/options.jsx | 4 src/templates/zshare/verifycard/fullScripts/index.jsx | 130 +++++ src/templates/zshare/verifycard/billcodeform/index.jsx | 2 src/tabviews/custom/components/table/edit-table/index.jsx | 4 src/menu/components/table/edit-table/options.jsx | 4 src/templates/zshare/verifycard/customform/index.jsx | 2 src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx | 65 ++ src/templates/zshare/verifycard/contrastform/index.jsx | 2 src/tabviews/zshare/actionList/normalbutton/index.jsx | 23 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 29 + src/views/menudesign/index.jsx | 5 src/menu/components/table/edit-table/columns/tableIn/index.scss | 130 ----- src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss | 8 src/templates/zshare/verifycard/index.scss | 130 ----- src/utils/utils.js | 27 - src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 28 src/templates/zshare/verifycard/fullScripts/index.scss | 130 +++++ src/templates/zshare/verifycard/voucherform/index.jsx | 2 src/menu/components/card/double-data-card/options.jsx | 4 src/menu/components/carousel/data-card/options.jsx | 4 src/menu/components/card/data-card/options.jsx | 4 src/tabviews/custom/components/module/voucher/voucherTable/index.scss | 9 src/templates/zshare/verifycard/index.jsx | 121 +---- src/templates/zshare/verifycard/uniqueform/index.jsx | 2 src/tabviews/custom/components/table/edit-table/normalTable/index.jsx | 75 +-- src/tabviews/custom/index.jsx | 16 src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx | 14 src/templates/zshare/verifycard/baseform/index.jsx | 127 ++++- src/menu/components/table/edit-table/columns/index.jsx | 17 34 files changed, 620 insertions(+), 641 deletions(-) diff --git a/src/menu/components/card/balcony/options.jsx b/src/menu/components/card/balcony/options.jsx index 4cce86c..97a6d83 100644 --- a/src/menu/components/card/balcony/options.jsx +++ b/src/menu/components/card/balcony/options.jsx @@ -261,13 +261,13 @@ 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', diff --git a/src/menu/components/card/data-card/options.jsx b/src/menu/components/card/data-card/options.jsx index 5808332..12783c8 100644 --- a/src/menu/components/card/data-card/options.jsx +++ b/src/menu/components/card/data-card/options.jsx @@ -522,13 +522,13 @@ 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', diff --git a/src/menu/components/card/double-data-card/options.jsx b/src/menu/components/card/double-data-card/options.jsx index 3ff8529..522c7ed 100644 --- a/src/menu/components/card/double-data-card/options.jsx +++ b/src/menu/components/card/double-data-card/options.jsx @@ -233,13 +233,13 @@ 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', diff --git a/src/menu/components/carousel/data-card/options.jsx b/src/menu/components/carousel/data-card/options.jsx index 8c6e414..20aeec8 100644 --- a/src/menu/components/carousel/data-card/options.jsx +++ b/src/menu/components/carousel/data-card/options.jsx @@ -206,13 +206,13 @@ 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', diff --git a/src/menu/components/module/voucher/voucherTable/index.scss b/src/menu/components/module/voucher/voucherTable/index.scss index bf74398..c46fe8d 100644 --- a/src/menu/components/module/voucher/voucherTable/index.scss +++ b/src/menu/components/module/voucher/voucherTable/index.scss @@ -31,10 +31,10 @@ 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; } } @@ -45,7 +45,7 @@ tr { th { position: relative; - background-color: transparent; + background-color: #E3E7F2; padding: 0; height: 60px; line-height: 60px; @@ -83,6 +83,9 @@ max-width: 60px; } .ant-table-tbody { + tr:last-child { + background-color: #FBF8EF; + } tr td { position: relative; background-color: transparent; diff --git a/src/menu/components/table/edit-table/columns/index.jsx b/src/menu/components/table/edit-table/columns/index.jsx index cc785fd..51b977c 100644 --- a/src/menu/components/table/edit-table/columns/index.jsx +++ b/src/menu/components/table/edit-table/columns/index.jsx @@ -482,7 +482,22 @@ 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 diff --git a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx index dd50594..a4a7025 100644 --- a/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx +++ b/src/menu/components/table/edit-table/columns/tableIn/customscript/index.jsx @@ -300,29 +300,27 @@ } } - 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琛ㄧず鏁版嵁涓嶅洖婊氾紝濡侲NT銆丯NT銆丗NT銆丯MNT锛�, 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锛堟敞锛歫skey涓轰富閿�硷紝鏂板鏃跺墠绔敓鎴愶紱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" /> @@ -340,7 +338,7 @@ )} </Form.Item> </Col> : null} - {!_type ? <Col span={10}> + {!type ? <Col span={10}> <Form.Item style={{marginBottom: 0}} label={'蹇嵎娣诲姞'}> <Select showSearch @@ -364,7 +362,7 @@ </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}}> 鍙栨秷 diff --git a/src/menu/components/table/edit-table/columns/tableIn/index.jsx b/src/menu/components/table/edit-table/columns/tableIn/index.jsx index b452acf..4bdb8d8 100644 --- a/src/menu/components/table/edit-table/columns/tableIn/index.jsx +++ b/src/menu/components/table/edit-table/columns/tableIn/index.jsx @@ -2,7 +2,7 @@ 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' @@ -10,7 +10,6 @@ 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' @@ -18,6 +17,7 @@ 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 = { @@ -26,8 +26,6 @@ } state = { - visible: false, - scriptId: '', verify: {}, fields: [], fieldLabel: {}, @@ -493,7 +491,7 @@ } render() { - const { verify, scriptsColumns, uniqueColumns, activeKey, fields, visible } = this.state + const { verify, scriptsColumns, uniqueColumns, activeKey, fields } = this.state const formItemLayout = { labelCol: { xs: { span: 24 }, @@ -582,17 +580,23 @@ {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} @@ -691,87 +695,6 @@ </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> ) } diff --git a/src/menu/components/table/edit-table/columns/tableIn/index.scss b/src/menu/components/table/edit-table/columns/tableIn/index.scss index 737083e..16b42cb 100644 --- a/src/menu/components/table/edit-table/columns/tableIn/index.scss +++ b/src/menu/components/table/edit-table/columns/tableIn/index.scss @@ -85,134 +85,4 @@ 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; - } - } - } - } - } } \ No newline at end of file diff --git a/src/menu/components/table/edit-table/options.jsx b/src/menu/components/table/edit-table/options.jsx index c1dc662..9fd58b0 100644 --- a/src/menu/components/table/edit-table/options.jsx +++ b/src/menu/components/table/edit-table/options.jsx @@ -274,13 +274,13 @@ 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', diff --git a/src/menu/components/table/normal-table/options.jsx b/src/menu/components/table/normal-table/options.jsx index 8265890..688c674 100644 --- a/src/menu/components/table/normal-table/options.jsx +++ b/src/menu/components/table/normal-table/options.jsx @@ -269,13 +269,13 @@ 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', diff --git a/src/menu/components/timeline/normal-timeline/options.jsx b/src/menu/components/timeline/normal-timeline/options.jsx index 01c6e41..f9537e1 100644 --- a/src/menu/components/timeline/normal-timeline/options.jsx +++ b/src/menu/components/timeline/normal-timeline/options.jsx @@ -165,13 +165,13 @@ 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', diff --git a/src/tabviews/custom/components/module/voucher/voucherTable/index.scss b/src/tabviews/custom/components/module/voucher/voucherTable/index.scss index daf9cb2..131b529 100644 --- a/src/tabviews/custom/components/module/voucher/voucherTable/index.scss +++ b/src/tabviews/custom/components/module/voucher/voucherTable/index.scss @@ -31,10 +31,10 @@ 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; } } @@ -45,7 +45,7 @@ tr { th { position: relative; - background-color: transparent; + background-color: #E3E7F2; padding: 0; height: 60px; line-height: 60px; @@ -83,6 +83,9 @@ max-width: 60px; } .ant-table-tbody { + tr:last-child { + background-color: #FBF8EF; + } tr td { position: relative; background-color: transparent; diff --git a/src/tabviews/custom/components/table/edit-table/index.jsx b/src/tabviews/custom/components/table/edit-table/index.jsx index ad11edd..96dfbb6 100644 --- a/src/tabviews/custom/components/table/edit-table/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/index.jsx @@ -481,7 +481,9 @@ BID: id, BData: data }, () => { - this.loadmaindata(true, 'true') + setTimeout(() => { + this.loadmaindata(true, 'true') + }, setting.delay || 0) }) } } diff --git a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx index 36e29df..2b09bfb 100644 --- a/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx +++ b/src/tabviews/custom/components/table/edit-table/normalTable/index.jsx @@ -220,15 +220,7 @@ } }, 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) => { @@ -244,12 +236,7 @@ }) } - // 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}) @@ -333,22 +320,14 @@ <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 @@ -641,15 +620,7 @@ } }, 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) => { @@ -665,12 +636,7 @@ }) } - // if (col.editField) { - // values[col.field] = _option.label - // values[col.editField] = val - // } else { - values[col.field] = val - // } + values[col.field] = val } setTimeout(() => { @@ -707,12 +673,7 @@ 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 = (<> @@ -776,6 +737,11 @@ 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') { @@ -838,6 +804,11 @@ 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') { @@ -1111,7 +1082,13 @@ 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(() => { diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index bf7075e..f10ec65 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -486,6 +486,12 @@ } } + 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 => { @@ -506,7 +512,7 @@ cell = this.getPrinter(cell, item.uuid) } - return skip || permAction[cell.uuid] + return pass || permAction[cell.uuid] }) } @@ -559,7 +565,7 @@ cell = this.getPrinter(cell, item.uuid) } - return skip || permAction[cell.uuid] + return pass || permAction[cell.uuid] } else { cell = this.resetElement(cell) } @@ -618,7 +624,7 @@ 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 @@ -643,7 +649,7 @@ 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') { @@ -674,7 +680,7 @@ 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 => { diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index 8a351f8..abea1d7 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -2105,7 +2105,18 @@ 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) + } } } @@ -2129,7 +2140,7 @@ 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, @@ -2196,13 +2207,19 @@ 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()) diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx index 149c255..2895d40 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/customscript/index.jsx @@ -61,19 +61,39 @@ } 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: '璇疯緭鍏ql!', + duration: 5 + }) + return + } + if (!err) { if (/^[\s\n]+$/.test(values.sql)) { notification.warning({ @@ -84,7 +104,11 @@ 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) @@ -211,7 +235,7 @@ this.props.scriptsChange(values) }) this.props.form.setFieldsValue({ - sql: '' + sql: ' ' }) } else { this.setState({loading: false}) @@ -231,7 +255,7 @@ }) this.props.form.setFieldsValue({ - sql: '' + sql: ' ' }) } @@ -258,6 +282,9 @@ } let _sql = this.props.form.getFieldValue('sql') + if (/^\s+$/.test(_sql)) { + _sql = '' + } if (_sql) { _sql = _sql + ` @@ -276,8 +303,8 @@ } 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: { @@ -293,24 +320,24 @@ 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琛ㄧず鏁版嵁涓嶅洖婊氾紝濡侲NT銆丯NT銆丗NT銆丯MNT锛�, 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" /> @@ -327,8 +354,8 @@ </Radio.Group> )} </Form.Item> - </Col> - <Col span={10}> + </Col> : null} + {!type ? <Col span={10}> <Form.Item style={{marginBottom: 0}} label={'蹇嵎娣诲姞'}> <Select showSearch @@ -349,10 +376,10 @@ )} </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}}> 鍙栨秷 diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index 4580eb7..85fbe84 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -19,6 +19,7 @@ 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 = { @@ -464,6 +465,7 @@ 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') { @@ -476,8 +478,14 @@ 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 = '' @@ -488,6 +496,10 @@ return col }) + + if (reset) { + message.warn('鏁板�肩被鍨嬪潎涓哄繀濉��') + } this.setState({verify: {...verify, columns}}, () => { this.resetUniqueColumns() @@ -844,6 +856,23 @@ {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} diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss index 604f0a8..a9f4ffa 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.scss @@ -77,4 +77,12 @@ z-index: 1; } } + .full-scripts { + position: absolute; + right: 24px; + top: 0px; + font-size: 16px; + color: #1890ff; + z-index: 1; + } } \ No newline at end of file diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx index b76445a..cadda16 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/customscript/index.jsx @@ -115,7 +115,7 @@ this.props.form.setFieldsValue({ sql: record.sql, - position: record.position || 'back' + // position: record.position || 'back' }) } @@ -194,7 +194,7 @@ editItem: null }) this.props.form.setFieldsValue({ - sql: '' + sql: ' ' }) } else { this.setState({ @@ -212,7 +212,7 @@ }) this.props.form.setFieldsValue({ - sql: '' + sql: ' ' }) } @@ -232,6 +232,9 @@ } let _sql = this.props.form.getFieldValue('sql') + if (/^\s+$/.test(_sql)) { + _sql = '' + } if (_sql) { _sql = _sql + ` diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index 46f1560..5421c48 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -160,20 +160,20 @@ ) } }, - { - 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', diff --git a/src/templates/zshare/verifycard/baseform/index.jsx b/src/templates/zshare/verifycard/baseform/index.jsx index 606b0a8..00171d3 100644 --- a/src/templates/zshare/verifycard/baseform/index.jsx +++ b/src/templates/zshare/verifycard/baseform/index.jsx @@ -82,30 +82,30 @@ 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] @@ -131,6 +131,8 @@ } else if (verify.wxNote === 'true') { if (!verify.wxTemplateId) { error = '寮�鍚叕浼楀彿娑堟伅鎺ㄩ�佹椂锛岄渶瑕侀�夋嫨娑堟伅妯℃澘锛�' + } else if (verify.wxTemplateId === 'mk_category_temp' && !verify.wxCustomTempId) { + error = '寮�鍚叕浼楀彿娑堟伅鎺ㄩ�佹椂锛岄渶瑕佸~鍐欐秷鎭ā鏉縄D锛�' } else if (verify.wxNoteLink === 'url' && !verify.wxNoteLinkUrl) { error = '璇峰~鍐欑綉鍧�锛�' } @@ -158,6 +160,8 @@ _verify.wxNoteLinkMenuId = '' _verify.wxNoteCallback = 'false' _verify.wxNoteKeys = null + + delete _verify.wxCustomTempId if (this.state.selectTemp) { this.setState({selectTemp: null}) @@ -196,15 +200,27 @@ 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}) @@ -221,6 +237,28 @@ 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) } @@ -421,7 +459,7 @@ <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> @@ -435,6 +473,16 @@ <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"> @@ -462,6 +510,19 @@ </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: "鎺ユ敹鑰卭penid",</p> + <p>send_id: "闃查噸鍏d",</p> + <p>bid: "璺宠浆灏忕▼搴忔椂锛屽彲浣滀负BID銆�"</p> + <p style={{color: '#1890ff'}}>璇峰湪閫氱敤瀛楁涓紙p1~p10锛夊~鍏ユā鏉夸腑瀵瑰簲鐨勫瓧娈靛悕锛屽 time1.DATA 鍒欏~鍐� time1銆�</p> + </div> + </div> + </div> + </Col> : null} </Row> </Form> ) diff --git a/src/templates/zshare/verifycard/billcodeform/index.jsx b/src/templates/zshare/verifycard/billcodeform/index.jsx index 6aed692..235a1fe 100644 --- a/src/templates/zshare/verifycard/billcodeform/index.jsx +++ b/src/templates/zshare/verifycard/billcodeform/index.jsx @@ -4,7 +4,7 @@ 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 = { diff --git a/src/templates/zshare/verifycard/contrastform/index.jsx b/src/templates/zshare/verifycard/contrastform/index.jsx index 19f4de9..1de6e45 100644 --- a/src/templates/zshare/verifycard/contrastform/index.jsx +++ b/src/templates/zshare/verifycard/contrastform/index.jsx @@ -1,7 +1,7 @@ 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 = { diff --git a/src/templates/zshare/verifycard/customform/index.jsx b/src/templates/zshare/verifycard/customform/index.jsx index 276694e..2af2b05 100644 --- a/src/templates/zshare/verifycard/customform/index.jsx +++ b/src/templates/zshare/verifycard/customform/index.jsx @@ -6,7 +6,7 @@ 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 = { diff --git a/src/templates/zshare/verifycard/fullScripts/index.jsx b/src/templates/zshare/verifycard/fullScripts/index.jsx new file mode 100644 index 0000000..116fdbb --- /dev/null +++ b/src/templates/zshare/verifycard/fullScripts/index.jsx @@ -0,0 +1,130 @@ +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 \ No newline at end of file diff --git a/src/templates/zshare/verifycard/fullScripts/index.scss b/src/templates/zshare/verifycard/fullScripts/index.scss new file mode 100644 index 0000000..4cdba1c --- /dev/null +++ b/src/templates/zshare/verifycard/fullScripts/index.scss @@ -0,0 +1,130 @@ +.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; + } + } + } + } + } +} \ No newline at end of file diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index e688eb0..e7930e1 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -2,7 +2,7 @@ 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' @@ -21,13 +21,13 @@ 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 = { @@ -44,8 +44,6 @@ appType: sessionStorage.getItem('appType'), notes: [], // 鐭俊妯℃澘 setting: null, - visible: false, - scriptId: '', verify: {}, fields: [], usefulfields: '', @@ -1540,7 +1538,7 @@ 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 }, @@ -1640,17 +1638,25 @@ {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} @@ -1768,89 +1774,6 @@ </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> ) } diff --git a/src/templates/zshare/verifycard/index.scss b/src/templates/zshare/verifycard/index.scss index 055f770..6ee9eb2 100644 --- a/src/templates/zshare/verifycard/index.scss +++ b/src/templates/zshare/verifycard/index.scss @@ -89,136 +89,6 @@ 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; } diff --git a/src/templates/zshare/verifycard/uniqueform/index.jsx b/src/templates/zshare/verifycard/uniqueform/index.jsx index 556e2d4..2c1e3d2 100644 --- a/src/templates/zshare/verifycard/uniqueform/index.jsx +++ b/src/templates/zshare/verifycard/uniqueform/index.jsx @@ -1,7 +1,7 @@ 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 = { diff --git a/src/templates/zshare/verifycard/voucherform/index.jsx b/src/templates/zshare/verifycard/voucherform/index.jsx index 7dd3ba2..e0ea747 100644 --- a/src/templates/zshare/verifycard/voucherform/index.jsx +++ b/src/templates/zshare/verifycard/voucherform/index.jsx @@ -2,7 +2,7 @@ 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 = { diff --git a/src/utils/utils.js b/src/utils/utils.js index 630fc57..cf01abb 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -982,33 +982,12 @@ } }) } - } 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) { // 鏈�澶у�兼楠� diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index 10235d1..f5bc9e6 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -723,6 +723,11 @@ 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 -- Gitblit v1.8.0