| | |
| | | */ |
| | | static resetBtn (btn, commonId) { |
| | | if (btn.OpenType === 'pop' || (btn.OpenType === 'funcbutton' && btn.execMode === 'pop')) { |
| | | if (btn.modal && btn.modal.fields.length > 0) { |
| | | if (btn.modal && btn.modal.fields && btn.modal.fields.length > 0) { |
| | | btn.modal.fields = btn.modal.fields.map(m => { |
| | | m.uuid = this.getuuid() |
| | | return m |
| | |
| | | btn.anchors = btn.anchors.map(m => md5(commonId + m)) |
| | | } |
| | | if (btn.syncComponent && btn.syncComponent[0] === 'multiComponent' && btn.syncComponents) { |
| | | if (btn.syncComponents[0] && Array.isArray(btn.syncComponents[0])) { |
| | | btn.syncComponents = btn.syncComponents.map((item, i) => { |
| | | return { |
| | | syncComId: item, |
| | | label: '', |
| | | uuid: 'fixed' + i |
| | | } |
| | | }) |
| | | } |
| | | btn.syncComponents = btn.syncComponents.map(m => { |
| | | m.syncComId = m.syncComId.map(n => { |
| | | if (/\$focus/.test(n)) { |
| | |
| | | |
| | | return md5(commonId + m) |
| | | }) |
| | | } |
| | | |
| | | if (btn.OpenType === 'popview' && btn.config && btn.config.components) { |
| | | btn.config.components = this.resetConfig(btn.config.components, commonId) |
| | | } |
| | | } |
| | | |
| | |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (cell.modal && cell.modal.fields.length > 0) { |
| | | cell.modal.fields = cell.modal.fields.map(m => { |
| | | m.uuid = this.getuuid() |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | card.backElements = card.backElements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (cell.modal && cell.modal.fields.length > 0) { |
| | | cell.modal.fields = cell.modal.fields.map(m => { |
| | | m.uuid = this.getuuid() |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | |
| | | this.resetBtn(cell, commonId) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | item.elements = item.elements.map(cell => { |
| | | if (cell.eleType === 'button') { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (cell.modal && cell.modal.fields.length > 0) { |
| | | cell.modal.fields = cell.modal.fields.map(m => { |
| | | m.uuid = this.getuuid() |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | |
| | | this.resetBtn(cell, commonId) |
| | | } else { |
| | | cell.uuid = this.getuuid() |
| | | } |
| | |
| | | col.elements = col.elements.map(cell => { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (cell.eleType === 'button') { |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (cell.modal && cell.modal.fields.length > 0) { |
| | | cell.modal.fields = cell.modal.fields.map(m => { |
| | | m.uuid = this.getuuid() |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | } |
| | | return cell |
| | | }) |
| | |
| | | } |
| | | item.action = item.action.map(cell => { |
| | | cell.uuid = md5(commonId + cell.uuid) |
| | | if (cell.OpenType === 'pop' || (cell.OpenType === 'funcbutton' && cell.execMode === 'pop')) { |
| | | if (cell.modal && cell.modal.fields.length > 0) { |
| | | cell.modal.fields = cell.modal.fields.map(m => { |
| | | m.uuid = this.getuuid() |
| | | return m |
| | | }) |
| | | } |
| | | } |
| | | this.resetBtn(cell, commonId) |
| | | |
| | | return cell |
| | | }) |
| | |
| | | |
| | | if (config.interfaces) { |
| | | config.interfaces.forEach(item => { |
| | | if (item.status !== 'true') return |
| | | if (item.setting && item.setting.interType === 'outer' && item.setting.sysInterface !== 'true') { |
| | | inters = 'true' |
| | | } |
| | |
| | | }) |
| | | } |
| | | let emptys = [] |
| | | if (cell.Ot !== 'notRequired') { |
| | | forms.push(...columns) |
| | | } |
| | | |
| | | cell.verify.uniques.forEach(m => { |
| | | if (m.status === 'false') return |
| | | |
| | |
| | | }) |
| | | |
| | | if (emptys.length) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”唯一性验证字段${emptys.join('、')},在表单中不存在!`}) |
| | | if (cell.Ot === 'notRequired') { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”唯一性验证字段${emptys.join('、')},在表单中不存在!`}) |
| | | } else { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”唯一性验证字段${emptys.join('、')},在表单与字段集中不存在!`}) |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: label + `${lines},不可出现连续的英文逗号,,`, |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } else if (/,\./ig.test(sql)) { |
| | | let lines = [] |
| | | sql.split(/\n/).forEach((s, i) => { |
| | | if (/,\./ig.test(s)) { |
| | | lines.push(i + 1) |
| | | } |
| | | }) |
| | | |
| | | lines = lines.join('、') |
| | | lines = lines ? '(第' + lines + '行)' : '' |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: label + `${lines},不可出现英文逗号,.`, |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } else if (/\.,/ig.test(sql)) { |
| | | let lines = [] |
| | | sql.split(/\n/).forEach((s, i) => { |
| | | if (/\.,/ig.test(s)) { |
| | | lines.push(i + 1) |
| | | } |
| | | }) |
| | | |
| | | lines = lines.join('、') |
| | | lines = lines ? '(第' + lines + '行)' : '' |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: label + `${lines},不可出现英文逗号.,`, |
| | | duration: 5 |
| | | }) |
| | | return false |
| | |
| | | GOTO_RETURN: |
| | | ROLLBACK TRAN` |
| | | |
| | | let filterComponent = (components, mainSearch, label = '') => { |
| | | let filterComponent = (components, mainSearch, label = '', ispop) => { |
| | | components.forEach(item => { |
| | | item.$menuname = (config.MenuName || '') + label + '-' + (item.name || '') |
| | | |
| | | if (item.type === 'tabs') { |
| | | if (config.Template === 'BaseTable') { |
| | | item.subtabs.forEach(tab => { |
| | | if (tab.permission !== 'true' && tab.components[0] && tab.components[0].wrap) { |
| | | tab.components[0].wrap.permission = 'false' |
| | | } |
| | | }) |
| | | } |
| | | item.subtabs.forEach(tab => { |
| | | let _mainSearch = mainSearch || [] |
| | | |
| | |
| | | _mainSearch = com.search || [] |
| | | }) |
| | | } |
| | | filterComponent(tab.components, _mainSearch, label) |
| | | |
| | | filterComponent(tab.components, _mainSearch, label, ispop) |
| | | }) |
| | | } else if (item.type === 'group') { |
| | | filterComponent(item.components, mainSearch, label) |
| | | filterComponent(item.components, mainSearch, label, ispop) |
| | | } else { |
| | | if (item.wrap && item.setting) { |
| | | if (item.wrap.datatype === 'public' || item.wrap.datatype === 'static') { |
| | |
| | | roleId = '' |
| | | } else if (item.setting.database === 'sso') { |
| | | roleId = '' |
| | | } else if (ispop) { |
| | | roleId = '' |
| | | } |
| | | |
| | | sqls.push({uuid: item.uuid, roleId: roleId, type: 'datasource', ...msg}) |
| | |
| | | item.action && item.action.forEach(cell => { |
| | | if (cell.hidden === 'true') return false |
| | | |
| | | resetButton(item, cell) |
| | | resetButton(item, cell, false, ispop) |
| | | }) |
| | | |
| | | if (item.type === 'table') { |
| | |
| | | col.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button' || cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | resetButton(item, cell, false, ispop) |
| | | }) |
| | | } else if (item.subtype === 'editable' && col.editable === 'true') { |
| | | if (col.editType === 'select' && col.resourceType === '1') { |
| | |
| | | card.elements && card.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button' || cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | resetButton(item, cell, false, ispop) |
| | | }) |
| | | |
| | | if (!card.backElements || card.backElements.length === 0) return |
| | |
| | | card.backElements.forEach(cell => { |
| | | if (cell.eleType !== 'button' || cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell, true) |
| | | resetButton(item, cell, true, ispop) |
| | | }) |
| | | }) |
| | | } else if (item.type === 'balcony') { |
| | | item.elements.forEach(cell => { |
| | | if (cell.eleType !== 'button' || cell.hidden === 'true') return |
| | | |
| | | resetButton(item, cell) |
| | | resetButton(item, cell, false, ispop) |
| | | }) |
| | | } else if (item.type === 'form') { |
| | | item.subcards.forEach(group => { |
| | |
| | | fields: group.fields |
| | | } |
| | | |
| | | resetButton(item, group.subButton) |
| | | resetButton(item, group.subButton, false, ispop) |
| | | }) |
| | | } else if (item.type === 'module' && item.subtype === 'invoice') { |
| | | if (item.buyer.setting && item.buyer.setting.interType === 'system') { |
| | |
| | | }) |
| | | } |
| | | |
| | | let resetButton = (item, cell, isback) => { |
| | | let resetButton = (item, cell, isback, ispop) => { |
| | | cell.logLabel = item.$menuname + '-' + cell.label |
| | | let roleId = cell.uuid |
| | | if (item.wrap && item.wrap.permission === 'false') { |
| | |
| | | } else if (cell.hidden === 'true' || cell.permission === 'false') { |
| | | roleId = '' |
| | | } else if (cell.database === 'sso') { |
| | | roleId = '' |
| | | } else if (ispop) { |
| | | roleId = '' |
| | | } |
| | | |
| | |
| | | } else if (form.type === 'popSelect') { |
| | | let msg = getPopSelectSql(form) |
| | | |
| | | sqls.push({uuid: form.uuid, type: 'popSource', ...msg}) |
| | | sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', ...msg}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | } else if (form.type === 'popSelect') { |
| | | let msg = getPopSelectSql(form) |
| | | |
| | | sqls.push({uuid: form.uuid, type: 'popSource', ...msg}) |
| | | sqls.push({uuid: md5(cell.uuid + form.uuid), type: 'popSource', ...msg}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | sqls.push({uuid: cell.uuid, roleId: roleId, type: 'pay', ...msg}) |
| | | } |
| | | } else if (cell.OpenType === 'popview') { |
| | | if (cell.config && cell.config.components) { |
| | | if (cell.config && cell.config.components && cell.config.enabled) { |
| | | let _mainSearch = [] |
| | | |
| | | if (appType === 'mob') { |
| | |
| | | }) |
| | | } |
| | | |
| | | filterComponent(cell.config.components, _mainSearch, '-' + cell.label) |
| | | let label = (item.name ? '-' + item.name : '') + '-' + cell.label |
| | | |
| | | filterComponent(cell.config.components, _mainSearch, label, true) |
| | | } |
| | | } |
| | | } |
| | |
| | | let _val2 = '' |
| | | |
| | | arr.push(_key) |
| | | if (_key === 'bid') { // 表单中没有bid则使用系统bid变量 |
| | | if (_key === 'bid') { |
| | | _val = BID |
| | | } else { |
| | | _val = `'@mk_${_key}_mk@'` |
| | | // _val = `'@mk_${_key}_mk@'` |
| | | _val = `@${_field}` |
| | | } |
| | | |
| | | _fieldValue.push(`${_key}=${_val}`) |
| | | |
| | | if (_key === 'bid') { // 表单中没有bid则使用系统bid变量 |
| | | if (_key === 'bid') { |
| | | _val2 = `' + ${BID} + '` |
| | | } else { |
| | | _val2 = `@mk_${_key}_mk@` |
| | | // _val2 = `@mk_${_key}_mk@` |
| | | _val2 = `' + @${_field} + '` |
| | | } |
| | | |
| | | _value.push(`${_labels[index] || ''}:${_val2}`) |
| | | }) |
| | | |
| | | if (!arr.includes(primaryKey.toLowerCase())) { |
| | | if (!arr.includes(primaryKey.toLowerCase()) && btn.Ot !== 'notRequired') { |
| | | _fieldValue.push(`${primaryKey} !=${primaryId}`) |
| | | } |
| | | |
| | |
| | | _sql += ` |
| | | /* 工作流异常sql */ |
| | | if @works_flow_error@ != '' |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | begin |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | end |
| | | |
| | | /* 工作流默认sql */ |
| | | insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) |
| | |
| | | _sql += ` |
| | | /* 工作流异常sql */ |
| | | if @works_flow_error@ != '' |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | begin |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | end |
| | | |
| | | if @works_flow_countersign@ = 'Y' |
| | | begin |
| | | /* 工作流默认sql(会签) */ |
| | | set @retmsg ='' |
| | | select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and userid =@userid@ and works_flow_detail_id =@works_flow_detail_id |
| | | |
| | | if @retmsg ='' |
| | | begin |
| | | select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and userid=@userid@ and works_flow_detail_id =@works_flow_detail_id |
| | | if @retmsg !='' |
| | | begin |
| | | select @ErrorCode='E', @retmsg='当前单据已审核,请刷新后重试' |
| | | goto aaa |
| | | end |
| | | |
| | | set @retmsg ='' |
| | | select @retmsg=userid from s_my_works_flow_role where works_flow_id=@id@ and works_flow_code=@works_flow_code@ and deleted=0 and works_flow_detail_id =@works_flow_detail_id |
| | | |
| | | if @retmsg !='' |
| | | begin |
| | | select @retmsg=workerCode+workerName from BD_workers where id=@retmsg |
| | | |
| | | select @retmsg='页面数据已更新,或没有当前单据的审批权限,请联系'+@retmsg+'操作' |
| | | goto aaa |
| | | end |
| | | |
| | | select @retmsg='页面数据已更新,或没有当前单据的审批权限' |
| | | goto aaa |
| | | end |
| | | |
| | | declare @works_flow_statuscharone nvarchar(50),@works_flow_statuschartwo nvarchar(50),@works_flow_statuscharthree nvarchar(50),@works_flow_statuscharfour nvarchar(50),@works_flow_statuscharfive nvarchar(50),@works_flow_key_id nvarchar(50),@works_flow_key_status nvarchar(20),@s_my_works_flow_log_param nvarchar(max),@s_my_works_flow_log_status int,@s_my_works_flow_log_statusname nvarchar(50),@s_my_works_flow_log_detail_id nvarchar(50) |
| | | select @works_flow_statuscharone='',@works_flow_statuschartwo='',@works_flow_statuscharthree='',@works_flow_statuscharfour='',@works_flow_statuscharfive='',@works_flow_key_id='',@works_flow_key_status ='',@s_my_works_flow_log_param='',@s_my_works_flow_log_status=0,@s_my_works_flow_log_statusname='',@s_my_works_flow_log_detail_id='' |
| | | |
| | |
| | | begin |
| | | /* 工作流默认sql(或签) */ |
| | | set @retmsg ='' |
| | | select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and userid =@userid@ and works_flow_detail_id =@works_flow_detail_id@ |
| | | select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and userid =@userid@ and works_flow_detail_id =@works_flow_detail_id |
| | | |
| | | if @retmsg ='' |
| | | begin |
| | | select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and userid=@userid@ and works_flow_detail_id =@works_flow_detail_id@ |
| | | select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and userid=@userid@ and works_flow_detail_id =@works_flow_detail_id |
| | | |
| | | if @retmsg !='' |
| | | begin |
| | |
| | | if @dataM@ !='' |
| | | begin |
| | | set @retmsg ='' |
| | | select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and works_flow_detail_id =@works_flow_detail_id@ |
| | | select @retmsg='X' from s_my_works_flow_role where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and deleted=0 and works_flow_detail_id =@works_flow_detail_id |
| | | |
| | | if @retmsg != '' |
| | | begin |
| | |
| | | else |
| | | begin |
| | | set @retmsg ='' |
| | | select @retmsg=userid from s_my_works_flow_role where works_flow_id=@id@ and works_flow_code=@works_flow_code@ and deleted=0 and works_flow_detail_id =@works_flow_detail_id@ |
| | | select @retmsg=userid from s_my_works_flow_role where works_flow_id=@id@ and works_flow_code=@works_flow_code@ and deleted=0 and works_flow_detail_id =@works_flow_detail_id |
| | | |
| | | if @retmsg !='' |
| | | begin |
| | |
| | | |
| | | if @works_begin_branch@ = 'Y' |
| | | begin |
| | | update s_my_works_flow_role set deleted=0,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname |
| | | update s_my_works_flow_role set deleted=0,modifydate=getdate(),upid=@time_id@,modifyuserid=@userid@,modifyuser=@username,modifystaff=@fullname,works_flow_detail_id=@works_flow_detail_id@ |
| | | where works_flow_id=@ID@ and works_flow_code=@works_flow_code@ and typecharone='begin' |
| | | end |
| | | else |
| | |
| | | } |
| | | }) |
| | | |
| | | if (new RegExp('@mk_submit_type[^0-9a-z_]', 'ig').test(_sql)) { |
| | | decSql.push(`@mk_submit_type nvarchar(50)`) |
| | | secSql.push(`@mk_submit_type=@mk_submit_type@`) |
| | | reps.push('mk_submit_type') |
| | | } |
| | | |
| | | decSql = [...decSql, ..._declares] |
| | | |
| | | // INSERT INTO s_paas_api_log (appkey,api_name,api_count,menuname,createuserid,createuser,createstaff,cdefine1,cdefine2) |
| | |
| | | return true |
| | | }) |
| | | |
| | | reps.forEach(n => { |
| | | _sql = _sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | |
| | | if (/\$@/ig.test(_sql)) { |
| | | _sql = _sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | _sql = _sql.replace(/\$@/ig, ' @datam_begin@ ').replace(/@\$/ig, ' @datam_end@ ') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | if (btn.procMode === 'system') { |
| | |
| | | } |
| | | } else { |
| | | if (/\$check@|@check\$/ig.test(_sql)) { |
| | | _sql = _sql.replace(/\$check@/ig, '@mk_check_begin@').replace(/@check\$/ig, '@mk_check_end@') |
| | | _sql = _sql.replace(/\$check@/ig, ' @mk_check_begin@ ').replace(/@check\$/ig, ' @mk_check_end@ ') |
| | | reps.push('mk_check_begin', 'mk_check_end') |
| | | } |
| | | } |
| | | reps.forEach(n => { |
| | | if (['datam_begin', 'datam_end', 'mk_check_begin', 'mk_check_end'].includes(n)) return |
| | | |
| | | _sql = _sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | if (/@db@/ig.test(_sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | _sql = _sql.replace(/\n\x20{8,10}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, '') |
| | | _sql = _sql.replace(/\n\x20{8,10}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, ' ') |
| | | |
| | | reps = reps.filter(n => { |
| | | if (sysVars.includes(n.toLowerCase())) { |
| | |
| | | } else if (['mk_address'].includes(s)) { |
| | | decSql.push(`@mk_address nvarchar(100)`) |
| | | } else if (['mk_deleted'].includes(s)) { |
| | | secSql.push(`@mk_deleted int`) |
| | | decSql.push(`@mk_deleted int`) |
| | | } else { |
| | | decSql.push(`@${s} nvarchar(50)`) |
| | | } |
| | |
| | | } |
| | | } |
| | | }) |
| | | |
| | | if (new RegExp('@mk_submit_type[^0-9a-z_]', 'ig').test(_sql)) { |
| | | decSql.push(`@mk_submit_type nvarchar(50)`) |
| | | secSql.push(`@mk_submit_type=@mk_submit_type@`) |
| | | reps.push('mk_submit_type') |
| | | } |
| | | |
| | | decSql = [...decSql, ..._declares] |
| | | |
| | |
| | | return true |
| | | }) |
| | | |
| | | reps.forEach(n => { |
| | | _sql = _sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | |
| | | if (/\$@/ig.test(_sql)) { |
| | | _sql = _sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | _sql = _sql.replace(/\$@/ig, ' @datam_begin@ ').replace(/@\$/ig, ' @datam_end@ ') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | reps.forEach(n => { |
| | | if (['datam_begin', 'datam_end'].includes(n)) return |
| | | |
| | | _sql = _sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | if (/@db@/ig.test(_sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | _sql = _sql.replace(/\n\x20{8,10}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, '') |
| | | _sql = _sql.replace(/\n\x20{8,10}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, ' ') |
| | | |
| | | reps = reps.filter(n => { |
| | | if (sysVars.includes(n.toLowerCase())) { |
| | |
| | | let DateCount = '' |
| | | if (_dataresource) { |
| | | /*system_query*/ |
| | | if (/@pageSize@|@orderBy@|@mk_total/i.test(testSql)) { |
| | | if (/@pageSize@|@orderBy@|@mk_total/i.test(testSql) || (item.wrap && item.wrap.tree === 'true')) { |
| | | LText = `select ${arr_field} from ${_dataresource} ${_search} ` |
| | | } else if (item.setting.laypage === 'true' && item.setting.order) { |
| | | LText = `select top @pageSize@ ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by @orderBy@) as rows from ${_dataresource} ${_search}) tmptable where rows > @pageSize@ * (@pageIndex@ - 1) order by tmptable.rows ` |
| | |
| | | |
| | | return true |
| | | }) |
| | | |
| | | |
| | | if (/\$@/ig.test(sql)) { |
| | | sql = sql.replace(/\$@/ig, ' @datam_begin@ ').replace(/@\$/ig, ' @datam_end@ ') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | reps.forEach(n => { |
| | | if (['orderBy', 'pageSize', 'pageIndex'].includes(n)) return |
| | | if (['orderBy', 'pageSize', 'pageIndex', 'datam_begin', 'datam_end'].includes(n)) return |
| | | |
| | | sql = sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | if (/\$@/ig.test(sql)) { |
| | | sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | if (/@db@/ig.test(sql)) { |
| | | reps.push('db') |
| | | } |
| | | reps.push('mk_obj_name') |
| | | |
| | | sql = sql.replace(/\n\x20{6,8}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, '') |
| | | sql = sql.replace(/\n\x20{6,8}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, ' ') |
| | | |
| | | reps = reps.filter(n => { |
| | | if (sysVars.includes(n.toLowerCase())) { |
| | |
| | | sql += ` |
| | | /* 工作流异常sql */ |
| | | if @works_flow_error@ != '' |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | begin |
| | | select @ErrorCode='E',@retmsg=@works_flow_error@ goto aaa |
| | | end |
| | | |
| | | /* 工作流默认sql */ |
| | | insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff,upid) |
| | |
| | | return true |
| | | }) |
| | | |
| | | reps.forEach(n => { |
| | | sql = sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | |
| | | if (/\$@/ig.test(sql)) { |
| | | sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | sql = sql.replace(/\$@/ig, ' @datam_begin@ ').replace(/@\$/ig, ' @datam_end@ ') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | if (/\$check@|@check\$/ig.test(sql)) { |
| | | sql = sql.replace(/\$check@/ig, '@mk_check_begin@').replace(/@check\$/ig, '@mk_check_end@') |
| | | sql = sql.replace(/\$check@/ig, ' @mk_check_begin@ ').replace(/@check\$/ig, ' @mk_check_end@ ') |
| | | reps.push('mk_check_begin', 'mk_check_end') |
| | | } |
| | | reps.forEach(n => { |
| | | if (['datam_begin', 'datam_end', 'mk_check_begin', 'mk_check_end'].includes(n)) return |
| | | |
| | | sql = sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | |
| | | if (/@db@/ig.test(sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | sql = sql.replace(/\n\x20{6,10}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, '') |
| | | sql = sql.replace(/\n\x20{6,10}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, ' ') |
| | | |
| | | reps = reps.filter(n => { |
| | | if (sysVars.includes(n.toLowerCase())) { |
| | |
| | | return true |
| | | }) |
| | | |
| | | reps.forEach(n => { |
| | | sql = sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | |
| | | if (/\$@/ig.test(sql)) { |
| | | sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | sql = sql.replace(/\$@/ig, ' @datam_begin@ ').replace(/@\$/ig, ' @datam_end@ ') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | reps.forEach(n => { |
| | | if (['datam_begin', 'datam_end'].includes(n)) return |
| | | |
| | | sql = sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | if (/@db@/ig.test(sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | sql = sql.replace(/\n\x20{6,10}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, '') |
| | | sql = sql.replace(/\n\x20{6,10}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, ' ') |
| | | |
| | | reps = reps.filter(n => { |
| | | if (sysVars.includes(n.toLowerCase())) { |
| | |
| | | return true |
| | | }) |
| | | |
| | | reps.forEach(n => { |
| | | _sql = _sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | |
| | | if (/\$@/ig.test(_sql)) { |
| | | _sql = _sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | _sql = _sql.replace(/\$@/ig, ' @datam_begin@ ').replace(/@\$/ig, ' @datam_end@ ') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | reps.forEach(n => { |
| | | if (['datam_begin', 'datam_end'].includes(n)) return |
| | | |
| | | _sql = _sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | if (/@db@/ig.test(_sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | _sql = _sql.replace(/\n\x20{6,8}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, '') |
| | | _sql = _sql.replace(/\n\x20{6,8}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, ' ') |
| | | |
| | | reps = reps.filter(n => { |
| | | if (sysVars.includes(n.toLowerCase())) { |
| | |
| | | |
| | | reps.push(...sysVars) |
| | | |
| | | reps.forEach(n => { |
| | | sql = sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | |
| | | if (/\$@/ig.test(sql)) { |
| | | sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | sql = sql.replace(/\$@/ig, ' @datam_begin@ ').replace(/@\$/ig, ' @datam_end@ ') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | reps.forEach(n => { |
| | | if (['datam_begin', 'datam_end'].includes(n)) return |
| | | |
| | | sql = sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | if (/@db@/ig.test(sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | // reps.push('mk_obj_name') |
| | | |
| | | sql = sql.replace(/\n\x20{6,8}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, '') |
| | | sql = sql.replace(/\n\x20{6,8}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, ' ') |
| | | |
| | | reps = reps.filter(n => { |
| | | if (sysVars.includes(n.toLowerCase())) { |
| | |
| | | return true |
| | | }) |
| | | |
| | | if (/\$@/ig.test(sql)) { |
| | | sql = sql.replace(/\$@/ig, ' @datam_begin@ ').replace(/@\$/ig, ' @datam_end@ ') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | reps.forEach(n => { |
| | | if (['orderBy', 'pageSize', 'pageIndex'].includes(n)) return |
| | | if (['orderBy', 'pageSize', 'pageIndex', 'datam_begin', 'datam_end'].includes(n)) return |
| | | |
| | | sql = sql.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | if (/\$@/ig.test(sql)) { |
| | | sql = sql.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | if (/@db@/ig.test(sql)) { |
| | | reps.push('db') |
| | | } |
| | | |
| | | sql = sql.replace(/\n\x20{6,8}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, '') |
| | | sql = sql.replace(/\n\x20{6,8}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, ' ') |
| | | |
| | | reps = reps.filter(n => { |
| | | if (sysVars.includes(n.toLowerCase())) { |
| | |
| | | } |
| | | }) |
| | | |
| | | reps.forEach(n => { |
| | | _script = _script.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | if (/\$@/ig.test(_script)) { |
| | | _script = _script.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | _script = _script.replace(/\$@/ig, ' @datam_begin@ ').replace(/@\$/ig, ' @datam_end@ ') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | reps.forEach(n => { |
| | | if (['datam_begin', 'datam_end'].includes(n)) return |
| | | |
| | | _script = _script.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | if (/@db@/ig.test(_script)) { |
| | | reps.push('db') |
| | | } |
| | |
| | | return true |
| | | }) |
| | | |
| | | sql = sql.replace(/\n\x20{6,8}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, '') |
| | | sql = sql.replace(/\n\x20{6,8}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, ' ') |
| | | |
| | | return {LText: sql, md5: md5(sql), reps} |
| | | } |
| | |
| | | } |
| | | }) |
| | | |
| | | if (/\$@/ig.test(testSql)) { |
| | | _prev = _prev.replace(/\$@/ig, ' @datam_begin@ ').replace(/@\$/ig, ' @datam_end@ ') |
| | | _back = _back.replace(/\$@/ig, ' @datam_begin@ ').replace(/@\$/ig, ' @datam_end@ ') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | reps.forEach(n => { |
| | | if (['datam_begin', 'datam_end'].includes(n)) return |
| | | |
| | | _prev = _prev.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | _back = _back.replace(new RegExp('@' + n + '@', 'ig'), `'@${n}@'`) |
| | | }) |
| | | if (/\$@/ig.test(testSql)) { |
| | | _prev = _prev.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | _back = _back.replace(/\$@/ig, '@datam_begin@').replace(/@\$/ig, '@datam_end@') |
| | | reps.push('datam_begin', 'datam_end') |
| | | } |
| | | if (/@db@/ig.test(testSql)) { |
| | | reps.push('db') |
| | | } |
| | |
| | | ${callback} |
| | | ` |
| | | |
| | | _sql = _sql.replace(/\n\x20{6,8}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, '') |
| | | _sql = _sql.replace(/\n\x20{6,8}/g, '\n').replace(/\n{3,}/g, '\n\n').replace(/^\s+|\s+$/g, '').replace(/\t+|\v+/g, ' ') |
| | | |
| | | reps = reps.filter(n => { |
| | | if (sysVars.includes(n.toLowerCase())) { |
| | |
| | | |
| | | filterComponent(config.components, _mainSearch) |
| | | |
| | | let keys = sqls.map(item => item.uuid) |
| | | if (keys.length > Array.from(new Set(keys)).length) { |
| | | if (window.backend) { |
| | | let m = new Map() |
| | | let n = new Map() |
| | | sqls.forEach(item => { |
| | | if (m.has(item.uuid)) { |
| | | if (!n.has(item.uuid)) { |
| | | window.mkInfo(m.get(item.uuid)) |
| | | n.set(item.uuid, true) |
| | | } |
| | | window.mkInfo(item) |
| | | } else { |
| | | m.set(item.uuid, item) |
| | | } |
| | | }) |
| | | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '存在重复的后端脚本ID!', |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | | return [] |
| | | } |
| | | |
| | | return sqls |
| | | } |