| | |
| | | field: item.field || '', |
| | | width: item.span || 12, |
| | | value: '', |
| | | style: {marginBottom: '15px', color: 'rgba(0, 0, 0, 0.85)'} |
| | | style: {marginBottom: '15px', color: 'rgba(0, 0, 0, 0.85)'}, |
| | | fixStyle: 'alone' |
| | | } |
| | | |
| | | if (item.type === 'number') { |
| | |
| | | field: item.field || '', |
| | | width: item.span || 12, |
| | | value: '', |
| | | style: {marginBottom: '15px', color: 'rgba(0, 0, 0, 0.85)'} |
| | | style: {marginBottom: '15px', color: 'rgba(0, 0, 0, 0.85)'}, |
| | | fixStyle: 'alone' |
| | | } |
| | | |
| | | if (item.type === 'number') { |
| | |
| | | field: item.field || '', |
| | | width: item.span || 12, |
| | | value: '', |
| | | style: {marginBottom: '15px', color: 'rgba(0, 0, 0, 0.85)'} |
| | | style: {marginBottom: '15px', color: 'rgba(0, 0, 0, 0.85)'}, |
| | | fixStyle: 'alone' |
| | | } |
| | | |
| | | if (item.type === 'number') { |
| | |
| | | |
| | | // 唯一性验证,必须存在表单(表单存在时,主键均为单值),必须填写数据源,多行拼接时不可用 |
| | | 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}`) |
| | |
| | | let _initColfields = [] |
| | | let _declarefields = [] |
| | | let verifyValSql = '' |
| | | let datavars = {} |
| | | |
| | | // 获取字段键值对 |
| | | formdata && formdata.forEach(form => { |
| | |
| | | } |
| | | |
| | | let _key = form.key.toLowerCase() |
| | | datavars[_key] = form.value |
| | | |
| | | if (!_initvars.includes(_key)) { |
| | | _initvars.push(_key) |
| | |
| | | |
| | | // 添加数据中字段,表单值优先(按钮不选行或多行拼接时跳过) |
| | | if (data && btn.Ot !== 'notRequired' && columns && columns.length > 0) { |
| | | datavars = {..._data, ...datavars} |
| | | |
| | | const setField = (col) => { |
| | | if (!col.field) return |
| | | let _key = col.field.toLowerCase() |
| | |
| | | item.field.split(',').forEach((_field, index) => { |
| | | let _key = _field.toLowerCase() |
| | | let _val = '' |
| | | let _val2 = '' |
| | | let _val2 = datavars[_key] !== undefined ? datavars[_key] : '' |
| | | |
| | | arr.push(_key) |
| | | if (_key === 'bid') { |
| | |
| | | |
| | | if (_key === 'bid') { |
| | | _val2 = BID |
| | | } else { |
| | | _val2 = `' + @${_field} + '` |
| | | } |
| | | |
| | | _fieldValue.push(`${_key}=${_val}`) |