| | |
| | | MenuID: card.originCard.uuid |
| | | }).then(result => { |
| | | if (result.status && result.LongParam) { |
| | | let _LongParam = '' |
| | | |
| | | // 解析配置,修改模态框标题名称 |
| | | if (result.LongParam) { |
| | | try { |
| | | _LongParam = window.decodeURIComponent(window.atob(result.LongParam)) |
| | | _LongParam = JSON.parse(_LongParam) |
| | | } catch (e) { |
| | | _LongParam = '' |
| | | } |
| | | } |
| | | if (_LongParam && _LongParam.type === 'Modal') { |
| | | try { |
| | | _LongParam.setting.title = res.label |
| | | _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_LongParam))) |
| | | } catch { |
| | | _LongParam = '' |
| | | } |
| | | } else { |
| | | _LongParam = '' |
| | | } |
| | | |
| | | let param = { |
| | | func: 'sPC_ButtonParam_AddUpt', |
| | | ParentID: config.uuid, |
| | |
| | | Template: 'Modal', |
| | | MenuName: res.label, |
| | | PageParam: JSON.stringify({Template: 'Modal'}), |
| | | LongParam: result.LongParam |
| | | LongParam: _LongParam |
| | | } |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (!response.status) { |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Select, Button } from 'antd' |
| | | import { Form, Row, Col, Input, Select, Button, notification } from 'antd' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | |
| | | if (!err) { |
| | | values.uuid = this.state.editItem ? this.state.editItem.uuid : '' |
| | | values.resultName = values.result === 'false' ? '不存在' : '存在' |
| | | |
| | | let _quot = values.sql.match(/'{1}/g) |
| | | let _lparen = values.sql.match(/\({1}/g) |
| | | let _rparen = values.sql.match(/\){1}/g) |
| | | |
| | | _quot = _quot ? _quot.length : 0 |
| | | _lparen = _lparen ? _lparen.length : 0 |
| | | _rparen = _rparen ? _rparen.length : 0 |
| | | |
| | | if (_quot % 2 !== 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'sql中\'必须成对出现', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (_lparen !== _rparen) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'sql中()必须成对出现', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.props.customChange(values) |
| | | this.setState({ |
| | |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + '提示信息!' |
| | | }, |
| | | { |
| | | pattern: /^[^']*$/ig, |
| | | message: '提示信息不允许包含\'' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" />)} |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Button } from 'antd' |
| | | import { Form, Row, Col, Input, Button, notification } from 'antd' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | |
| | | if (!err) { |
| | | values.uuid = this.state.editItem ? this.state.editItem.uuid : '' |
| | | |
| | | let _quot = values.sql.match(/'{1}/g) |
| | | let _lparen = values.sql.match(/\({1}/g) |
| | | let _rparen = values.sql.match(/\){1}/g) |
| | | |
| | | _quot = _quot ? _quot.length : 0 |
| | | _lparen = _lparen ? _lparen.length : 0 |
| | | _rparen = _rparen ? _rparen.length : 0 |
| | | |
| | | if (_quot % 2 !== 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'sql中\'必须成对出现', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } else if (_lparen !== _rparen) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: 'sql中()必须成对出现', |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | this.props.scriptsChange(values) |
| | | this.setState({ |
| | | editItem: null |
| | |
| | | }) |
| | | } |
| | | |
| | | let _vars = ['tbid', 'ErrorCode', 'retmsg', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear', 'UserName', 'FullName'] |
| | | |
| | | let primaryKey = setting.primaryKey || 'id' // 主键字段 |
| | | // 系统变量声明与设置初始值 |
| | | let _sql = `Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50) |
| | | let _sql = `Declare @tbid nvarchar(50),@ErrorCode nvarchar(50),@retmsg nvarchar(4000),@BillCode nvarchar(50),@BVoucher nvarchar(50),@FIBVoucherDate nvarchar(50), @FiYear nvarchar(50), @UserName nvarchar(50),@FullName nvarchar(50) |
| | | ` |
| | | if (verify && verify.scripts && verify.scripts.length > 0 && formdata) { |
| | | let _formfields = formdata.filter(form => !['tbid', 'ErrorCode', 'retmsg', 'BillCode', 'BVoucher', 'FIBVoucherDate', 'FiYear'].includes(form.key)) |
| | | _formfields = _formfields.map(form => `@${form.key} nvarchar(50)`) |
| | | let _formfields = formdata.filter(form => !_vars.includes(form.key)) |
| | | _formfields = _formfields.map(form => { |
| | | _vars.push(form.key) |
| | | return `@${form.key} nvarchar(50)` |
| | | }) |
| | | _formfields = _formfields.join(',') |
| | | _sql += `${_formfields} |
| | | _sql += `,${_formfields} |
| | | ` |
| | | } |
| | | |
| | |
| | | _ModularDetailCode = item.ModularDetailCode |
| | | } |
| | | |
| | | _sql += `Declare @${item.field} nvarchar(50) |
| | | let _declare = '' |
| | | if (!_vars.includes(item.field)) { |
| | | _declare = `Declare @${item.field} nvarchar(50)` |
| | | } |
| | | _vars.push(item.field) |
| | | |
| | | _sql += `${_declare} |
| | | select @BillCode='', @${item.field}='' |
| | | exec s_get_BillCode |
| | | @ModularDetailCode='${_ModularDetailCode}', |
| | |
| | | ` |
| | | } |
| | | |
| | | let _user = `select @UserName=UserName,@FullName=FullName from SUsers where UID=@UserID |
| | | ` |
| | | |
| | | if (btn.OpenType === 'pop' && btn.sqlType === 'insert') { |
| | | let keys = [] |
| | | let values = [] |
| | |
| | | |
| | | keys = keys.join(',') |
| | | values = values.join(',') |
| | | _sql += `declare @UserName nvarchar(50),@FullName nvarchar(50) |
| | | select @UserName=UserName,@FullName=FullName from SUsers where UID=@UserID |
| | | ` |
| | | _sql += `insert into ${btn.sql} (${keys},createuserid,CreateUser,CreateStaff,BID) select ${values},@userid,@username,@fullname,@BID` |
| | | _sql += _user |
| | | _sql += `insert into ${btn.sql} (${keys},createuserid,CreateUser,CreateStaff,BID) select ${values},@userid,@username,@fullname,@BID;` |
| | | } else if (btn.OpenType === 'pop' && btn.sqlType === 'update') { |
| | | let _form = [] |
| | | formdata.forEach(item => { |
| | |
| | | } |
| | | }) |
| | | _form = _form.join(',') |
| | | _sql += `update ${btn.sql} set ${_form},modifydate=getdate(),modifyuserid=@userid${_updateconfig} where ${primaryKey}=@${primaryKey}` |
| | | _sql += `update ${btn.sql} set ${_form},modifydate=getdate(),modifyuserid=@userid${_updateconfig} where ${primaryKey}=@${primaryKey};` |
| | | } else if ((btn.OpenType === 'prompt' || btn.OpenType === 'exec') && btn.sqlType === 'LogicDelete') { // 逻辑删除 |
| | | _sql += `update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid where ${primaryKey}=@${primaryKey}` |
| | | _sql += `update ${btn.sql} set deleted=1,modifydate=getdate(),modifyuserid=@userid where ${primaryKey}=@${primaryKey};` |
| | | } else if ((btn.OpenType === 'prompt' || btn.OpenType === 'exec') && btn.sqlType === 'delete') { // 物理删除 |
| | | _sql += `insert into snote (remark,createuserid) select '删除表:${btn.sql} 数据: ${primaryKey}='+@${primaryKey},@userid,@username,@fullname delete ${btn.sql} where ${primaryKey}=@${primaryKey}` |
| | | _sql += _user |
| | | _sql += `insert into snote (remark,createuserid) select '删除表:${btn.sql} 数据: ${primaryKey}='+@${primaryKey},@userid,@username,@fullname delete ${btn.sql} where ${primaryKey}=@${primaryKey};` |
| | | } |
| | | |
| | | if (verify && verify.scripts && verify.scripts.length > 0) { |
| | | let _scripts = '' |
| | | verify.scripts.forEach(item => { |
| | | _scripts += `${item.sql} |
| | | ` |
| | | _scripts += ` |
| | | ${item.sql}` |
| | | }) |
| | | _sql += ` |
| | | ${_scripts}` |
| | | _sql += `${_scripts}` |
| | | } |
| | | |
| | | _sql += `aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg |
| | | ` |
| | | _sql += ` |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` |
| | | console.log(_sql) |
| | | return _sql |
| | | } |