| | |
| | | btn: null |
| | | } |
| | | |
| | | /** |
| | | * @description 触发创建读数据接口 |
| | | * @param { object } menu 菜单类型(三级菜单或标签页)、菜单ID、菜单参数、菜单名称 |
| | | * @param { object } config 菜单配置信息 |
| | | */ |
| | | triggerOutInterface = (menu, config) => { |
| | | let _search = [] |
| | | let _index = 1 |
| | | |
| | | if (menu.type !== 'main') { |
| | | // 子表页面增加BID字段,数据源中使用了@BID@时,BID类型为必传 |
| | | if (config.setting.dataresource && /@BID@/ig.test(config.setting.dataresource)) { |
| | | _search.push(`select 'BID' as searchfield,'BID' as label,'0' as Sort,'' as defaultvalue,'required' as DefaultType`) |
| | | } else { |
| | |
| | | Ltextsearchparam: _search.join(' union all '), |
| | | AppendWhere: config.setting.queryType === 'query' ? searchText.join(' AND ') : '', |
| | | WhereType: config.setting.queryType === 'statistics' ? 'Statistics' : 'query', |
| | | custom_script: config.setting.customScript || '', |
| | | // default_sql: config.setting.default || 'true', |
| | | OrderCol: config.setting.order |
| | | } |
| | | |
| | | param.Ltextsearchparam = Utils.formatOptions(param.Ltextsearchparam) |
| | | param.AppendWhere = Utils.formatOptions(param.AppendWhere) |
| | | param.custom_script = Utils.formatOptions(param.custom_script) |
| | | |
| | | this.setState({ |
| | | type: 'out', |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | resolve(false) |
| | | } else { |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } else { |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 触发创建写入接口(按钮) |
| | | */ |
| | | triggerInInterface = (btn, config, menu) => { |
| | | if (!['pop', 'exec', 'prompt'].includes(btn.OpenType) || btn.funcType || btn.intertype !== 'inner' || btn.innerFunc ) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '打开方式为 弹窗(表单)、提示框或直接执行,且使用系统函数时,才可以创建接口!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } else if (btn.Ot === 'requiredOnce') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '多行拼接时,不支持创建接口!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let param = { |
| | | func: 's_get_para_for_in', |
| | | Menuid: btn.uuid, |
| | |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 执行接口创建 |
| | | */ |
| | | createBtnInterfaceExec = (param, config, btn) => { |
| | | let formlist = [] |
| | | let receipt = param.Return === 'Y' |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | resolve(false) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请完善表单信息!', |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | resolve(false) |
| | | } |
| | |
| | | }) |
| | | |
| | | if (param.menuType !== 'main' && !_keys.includes('bid')) { |
| | | _keys.push('bid') |
| | | param.Ltexttableparam.unshift(`select 'BID' as searchfield,'BID' as label,'0' as Sort,'nvarchar(50)' as fieldtype,'required' as requiredtype,'' as defaultvalue`) |
| | | } |
| | | |
| | | if (btn.Ot !== 'notRequired' && !_keys.includes(config.setting.primaryKey.toLowerCase())) { |
| | | param.Ltexttableparam.unshift(`select '${config.setting.primaryKey}' as searchfield,'${config.setting.primaryKey}' as label,'1' as Sort,'nvarchar(50)' as fieldtype,'required' as requiredtype,'' as defaultvalue`) |
| | | } |
| | | |
| | | param.Ltexttableparam = param.Ltexttableparam.join(' union all ') |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } else { |
| | |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | } else { |
| | |
| | | let _fieldValue = [] // 表单键值对field=value |
| | | let _value = [] // 表单值,用于错误提示 |
| | | let _labels = item.fieldlabel.split(',') // 表单提示文字 |
| | | let arr = [] // 验证主键 |
| | | |
| | | item.field.split(',').forEach((_field, index) => { |
| | | _fieldValue.push(`${_field}=@${_field}@`) |
| | | _value.push(`${_labels[index] || ''}:'+@${_field}@+'`) |
| | | arr.push(_field.toLowerCase()) |
| | | }) |
| | | |
| | | let _verifyType = '' |
| | |
| | | _verifyType = ' and deleted=0' |
| | | } |
| | | |
| | | if (!arr.includes(primaryKey.toLowerCase())) { |
| | | _fieldValue.push(`${primaryKey} !=@${primaryKey}@`) |
| | | } |
| | | |
| | | _sql += `select @tbid='', @ErrorCode='',@retmsg='' |
| | | select @tbid='X' from ${btn.sql} where ${_fieldValue.join(' and ')} and ${primaryKey} !=@${primaryKey}@${_verifyType} |
| | | select @tbid='X' from ${btn.sql} where ${_fieldValue.join(' and ')}${_verifyType} |
| | | If @tbid!='' |
| | | Begin |
| | | select @ErrorCode='${item.errorCode}',@retmsg='${_value.join(', ')} 已存在' |
| | |
| | | @VoucherTypeOne ='${_voucher.VoucherTypeOne}', |
| | | @VoucherTypeTwo ='${_voucher.VoucherTypeTwo}', |
| | | @Type =${_voucher.Type}, |
| | | @UserID=@UserID@, |
| | | @Username=@Username, |
| | | @FullName=@FullName, |
| | | @BVoucher =@BVoucher OUTPUT , |
| | | @FIBVoucherDate =@FIBVoucherDate OUTPUT , |
| | | @FiYear =@FiYear OUTPUT , |
| | |
| | | receiptKeys.push(item.key.toLowerCase()) |
| | | }) |
| | | |
| | | if (!receiptKeys.includes(primaryKey)) { |
| | | receiptKeys.push(primaryKey) |
| | | if (!receiptKeys.includes(primaryKey.toLowerCase())) { |
| | | receiptKeys.push(primaryKey.toLowerCase()) |
| | | } |
| | | |
| | | if (!receiptKeys.includes('bid') && BID) { |
| | |
| | | values.push('@' + item.key + '@') |
| | | }) |
| | | |
| | | if (!keys.includes(primaryKey)) { |
| | | keys.push(primaryKey) |
| | | if (!keys.includes(primaryKey.toLowerCase())) { |
| | | keys.push(primaryKey.toLowerCase()) |
| | | values.push(`@${primaryKey}@`) |
| | | } |
| | | |
| | |
| | | |
| | | _sql += ` |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg,'${_ltext}' as Ltext` |
| | | console.log(_sql) |
| | | |
| | | return _sql |
| | | } |
| | | |