| | |
| | | if (['pop', 'prompt', 'exec'].includes(cell.OpenType) && cell.verify && !cell.output) { |
| | | if (cell.verify.noteEnable === 'true') { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”未设置返回值短信发送无效!`}) |
| | | } else if (cell.verify.wxNote === 'true') { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”未设置返回值公众号消息无效!`}) |
| | | } else if (cell.verify.emailEnable === 'true') { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”未设置返回值邮件发送无效!`}) |
| | | } else if (cell.verify.DeepSeekable === 'true') { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”未设置返回值DeekSeek无效!`}) |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | if (cell.OpenType === 'form' && cell.formType === 'count_line') return |
| | | |
| | | if (cell.intertype === 'system') { |
| | | // if (cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) { |
| | | // errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`}) |
| | | // } |
| | | } else if (cell.intertype === 'custom' || cell.intertype === 'outer') { |
| | | if (cell.callbackType === 'script' && (!cell.verify || !cell.verify.cbScripts || cell.verify.cbScripts.filter(item => item.status !== 'false').length === 0)) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”使用了自定义脚本回调,回调脚本不可为空!`}) |
| | | // } else if (cell.procMode === 'system' && cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) { |
| | | // errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`}) |
| | | // if (cell.intertype === 'system') { |
| | | // // if (cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) { |
| | | // // errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`}) |
| | | // // } |
| | | // } else if (cell.intertype === 'custom' || cell.intertype === 'outer') { |
| | | // if (cell.callbackType === 'script' && (!cell.verify || !cell.verify.cbScripts || cell.verify.cbScripts.filter(item => item.status !== 'false').length === 0)) { |
| | | // errors.push({ level: 0, detail: `按钮“${cell.label}”使用了自定义脚本回调,回调脚本不可为空!`}) |
| | | // // } else if (cell.procMode === 'system' && cell.Ot === 'notRequired' && cell.verify && cell.verify.voucher && cell.verify.voucher.enabled) { |
| | | // // errors.push({ level: 0, detail: `按钮“${cell.label}”使用了创建凭证函数,需要选择行!`}) |
| | | // } |
| | | // } |
| | | if ((cell.intertype === 'custom' || cell.intertype === 'outer') && cell.callbackType === 'script') { |
| | | if (!cell.verify || !cell.verify.cbScripts) { |
| | | errors.push({ level: 0, detail: `按钮“${cell.label}”使用了自定义脚本回调,请设置验证信息!`}) |
| | | } |
| | | } |
| | | } else if (cell.OpenType === 'funcbutton') { |
| | |
| | | if (item.subButton.verify && !item.subButton.output) { |
| | | if (item.subButton.verify.noteEnable === 'true') { |
| | | errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值短信发送无效!`}) |
| | | } else if (item.subButton.verify.wxNote === 'true') { |
| | | errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值公众号消息无效!`}) |
| | | } else if (item.subButton.verify.emailEnable === 'true') { |
| | | errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值邮件发送无效!`}) |
| | | } else if (item.subButton.verify.DeepSeekable === 'true') { |
| | | errors.push({ level: 0, detail: `${item.subButton.label} 按钮未设置返回值DeekSeek无效!`}) |
| | | } |
| | | } |
| | | |
| | |
| | | let filterSql = (sl) => { |
| | | if (!sl) return |
| | | |
| | | let _sl = sl.replace(/\/\*[^*/]+\*\//g, '') |
| | | let cutreg = /[\u4E00-\u9FA5。!,、]+/ig |
| | | let tbs = sl.match(cutreg) |
| | | let tbs = _sl.match(cutreg) |
| | | |
| | | if (!tbs) return |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | let getuuid = () => { |
| | | let uuid = [] |
| | | let _options = '0123456789abcdefghigklmnopqrstuv' |
| | | for (let i = 0; i < 19; i++) { |
| | | uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1)) |
| | | } |
| | | return uuid.join('') |
| | | } |
| | | |
| | | let filterSql = (sl) => { |
| | | if (!sl) return |
| | | |
| | | let arr = [] |
| | | |
| | | sl = sl.replace(/\/\*[^*/]+\*\//g, (word) => { |
| | | let uuid = getuuid() |
| | | arr.push({id: `/*${uuid}*/`, value: word}) |
| | | return `/*${uuid}*/` |
| | | }) |
| | | |
| | | regs.forEach(item => { |
| | | sl = sl.replace(item.reg, item.value) |
| | | }) |
| | | |
| | | arr.forEach(item => { |
| | | sl = sl.replace(item.id, item.value) |
| | | }) |
| | | |
| | | return sl |
| | |
| | | |
| | | // 唯一性验证,必须存在表单(表单存在时,主键均为单值),必须填写数据源,多行拼接时不可用 |
| | | if (formdata && verify.uniques && verify.uniques.length > 0 && btn.Ot !== 'requiredOnce') { |
| | | let nFields = [] |
| | | let dataFields = [] |
| | | formdata.forEach(form => { |
| | | let _key = form.key.toLowerCase() |
| | | if (form.type === 'number' || form.type === 'rate') { |
| | | nFields.push(_key) |
| | | } else if (form.type === 'date') { |
| | | dataFields.push(_key) |
| | | } |
| | | }) |
| | | if (columns && columns.length > 0 && btn.Ot !== 'notRequired') { |
| | | columns.forEach(col => { |
| | | let _key = col.field.toLowerCase() |
| | | if (col.type === 'number') { |
| | | if (!nFields.includes(_key)) { |
| | | nFields.push(_key) |
| | | } |
| | | } else if (/^date/ig.test(col.datatype)) { |
| | | if (!dataFields.includes(_key)) { |
| | | dataFields.push(_key) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | verify.uniques.forEach(item => { |
| | | let _fieldValue = [] // 表单键值对field=value |
| | | let _value = [] // 表单值,用于错误提示 |
| | |
| | | _val2 = `' + ${BID} + '` |
| | | } else { |
| | | // _val2 = `@mk_${_key}_mk@` |
| | | _val2 = `' + @${_field} + '` |
| | | if (nFields.includes(_key)) { |
| | | _val2 = `' + cast (@${_field} as nvarchar(50)) + '` |
| | | } else if (dataFields.includes(_key)) { |
| | | _val2 = `' + CONVERT(nvarchar(50), @${_field}, 23) + '` |
| | | } else { |
| | | _val2 = `' + @${_field} + '` |
| | | } |
| | | } |
| | | |
| | | _value.push(`${_labels[index] || ''}:${_val2}`) |