| | |
| | | key: 'syncComponent', |
| | | label: '同步刷新', |
| | | initVal: card.syncComponent, |
| | | tooltip: '执行成功后需要刷新的组件。注:选择当前组件的上级组件无效。', |
| | | tooltip: '执行成功后需要刷新的组件。注:选择当前组件的上级组件无效,刷新上级组件请选择成功后“刷新上级组件 - 行”。', |
| | | required: false, |
| | | options: modules |
| | | }, |
| | |
| | | key: 'syncComponent', |
| | | label: '刷新组件', |
| | | initVal: card.syncComponent || [], |
| | | tooltip: '执行成功后(或弹窗标签关闭时),需要同步刷新的组件。注:选择当前组件的上级组件无效。', |
| | | tooltip: '执行成功后(或弹窗标签关闭时),需要同步刷新的组件。注:选择当前组件的上级组件无效,刷新上级组件请选择成功后“刷新上级组件 - 行”。', |
| | | required: false, |
| | | options: modules |
| | | }, |
| | |
| | | let timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | let r = SettingUtils.getDebugSql(setting, _scripts, columns, searches, defaultSearch, timestamp) |
| | | |
| | | if (r.error) { |
| | | if (r.errors) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: r.error, |
| | | message: r.errors, |
| | | duration: 5 |
| | | }) |
| | | reject() |
| | | return |
| | | } |
| | | |
| | | let param = { |
| | |
| | | // error = '系统函数' + _customScript.match(/\$ex@.{1,50}@ex\$/g)[0].replace(/\$ex@|@ex\$/g, '') + '未定义' |
| | | // } |
| | | |
| | | _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`) |
| | | _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`) |
| | | _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`) |
| | | _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`) |
| | | |
| | | _dataresource = _dataresource.replace(/@\$|\$@/ig, '') |
| | | _customScript = _customScript.replace(/@\$|\$@/ig, '') |
| | |
| | | ${_sql} |
| | | aaa: |
| | | if @ErrorCode!='' |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}' |
| | | ` |
| | | } else { |
| | | sumSql = `/* sql sum验证 */ |
| | |
| | | ${_dataresource} |
| | | aaa: |
| | | if @ErrorCode!='' |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}' |
| | | ` |
| | | } else { |
| | | sql = `/* sql 验证 */ |
| | |
| | | |
| | | console.info(sql) |
| | | |
| | | let errors = [] |
| | | |
| | | if (/@[0-9a-zA-Z_]+@/ig.test(sql)) { |
| | | let arr = sql.match(/@[0-9a-zA-Z_]+@/ig) |
| | | |
| | | arr.forEach(item => { |
| | | let reg = new RegExp(item, 'ig') |
| | | if (reg.test(_dataresource)) { |
| | | errors.push(`数据源中存在未替换值${item}`) |
| | | } |
| | | scripts && scripts.forEach(script => { |
| | | if (reg.test(script.sql)) { |
| | | errors.push(`自定义脚本(${script.$index})存在未替换值${item}`) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | if (sumSql) { |
| | | sumSql = sumSql.replace(/\n\s{10}/ig, '\n') |
| | | |
| | | console.info(sumSql) |
| | | } |
| | | |
| | | return { error, sql, sumSql } |
| | | return { error, sql, sumSql, errors: errors.join(';') } |
| | | } |
| | | } |
| | |
| | | |
| | | export default class RouteConfig extends Component { |
| | | controlRoute (item, props) { |
| | | if (!item.auth) { // 不需要授权,直接跳转 |
| | | if (!item.auth) { // 不需要授权,直接跳转 |
| | | return (<item.component {...props}/>) |
| | | } |
| | | |
| | | let userId = sessionStorage.getItem('UserID') // 判断登录信息是否存在,注用户可能保存主页链接 |
| | | let authCode = localStorage.getItem(window.location.href.split('#')[0] + 'AuthCode') // 判断系统是否在授权期限内 |
| | | let _s = md5('mksoft' + moment().format('YYYYMMDD')) |
| | | let isauth = authCode && authCode.includes(_s) |
| | |
| | | isauth = true |
| | | } |
| | | |
| | | if (isauth) { |
| | | if (userId && isauth) { |
| | | return (<item.component {...props}/>) |
| | | } else { |
| | | return (<Redirect to={{ pathname: '/login'}}/>) |
| | |
| | | param.timestamp = timestamp |
| | | param.secretkey = Utils.encrypt('', timestamp) |
| | | |
| | | if (r.errors) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: r.errors, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | | let sumParam = null |
| | | if (r.sumSql) { |
| | | sumParam = { |
| | |
| | | }) |
| | | } |
| | | |
| | | _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`) |
| | | _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id)@/ig, `'${timestamp}'`) |
| | | _dataresource = _dataresource.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`) |
| | | _customScript = _customScript.replace(/@(BID|ID|LoginUID|SessionUid|UserID|Appkey|time_id|datam|upid)@/ig, `'${timestamp}'`) |
| | | _dataresource = _dataresource.replace(/@\$|\$@/ig, '') |
| | | _customScript = _customScript.replace(/@\$|\$@/ig, '') |
| | | _dataresource = _dataresource.replace(/@select\$|\$select@/ig, '') |
| | |
| | | ${_sql} |
| | | aaa: |
| | | if @ErrorCode!='' |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}' |
| | | ` |
| | | } else { |
| | | sumSql = `/* sql sum验证 */ |
| | |
| | | ${_dataresource} |
| | | aaa: |
| | | if @ErrorCode!='' |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select @time_id@,@ErrorCode, @retmsg,@UserID@ |
| | | insert into tmp_err_retmsg (ID, ErrorCode, retmsg, CreateUserID) select '${timestamp}',@ErrorCode, @retmsg,'${timestamp}' |
| | | ` |
| | | } else { |
| | | sql = `/* sql 验证 */ |
| | | declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='' |
| | | ${_dataresource}` |
| | | } |
| | | |
| | | sql = sql.replace(/\n\s{8}/ig, '\n') |
| | | console.info(sql) |
| | | |
| | | let errors = [] |
| | | |
| | | if (/@[0-9a-zA-Z_]+@/ig.test(sql)) { |
| | | let arr = sql.match(/@[0-9a-zA-Z_]+@/ig) |
| | | |
| | | arr.forEach(item => { |
| | | let reg = new RegExp(item, 'ig') |
| | | if (reg.test(_dataresource)) { |
| | | errors.push(`数据源中存在未替换值${item}`) |
| | | } |
| | | scripts && scripts.forEach(script => { |
| | | if (reg.test(script.sql)) { |
| | | errors.push(`自定义脚本(${script.$index})存在未替换值${item}`) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | if (sumSql) { |
| | | sumSql = sumSql.replace(/\n\s{10}/ig, '\n') |
| | | console.info(sumSql) |
| | | } |
| | | |
| | | return { sql, sumSql } |
| | | return { sql, sumSql, errors: errors.join(';') } |
| | | } |
| | | |
| | | /** |