| | |
| | | func: 'sPC_TableData_InUpDe', |
| | | BID: this.props.BID |
| | | } |
| | | |
| | | if (setting.primaryKey) { // 主键值预设,从表格数据第一项选取 |
| | | param[setting.primaryKey] = (data[0] && data[0][setting.primaryKey]) || '' |
| | | } |
| | | let primaryId = setting.primaryKey && data[0] ? data[0][setting.primaryKey] : '' |
| | | |
| | | if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 是否弹框或直接执行 |
| | | let ID = '' |
| | |
| | | ID = ids.join(',') |
| | | } |
| | | |
| | | if (setting.primaryKey) { |
| | | param[setting.primaryKey] = ID |
| | | } |
| | | |
| | | if (btn.innerFunc) { // 使用自定义函数 |
| | | param.func = btn.innerFunc |
| | | if (setting.primaryKey) { // 主键存在时,设置主键参数 |
| | | param[setting.primaryKey] = ID |
| | | } |
| | | } else if (btn.sql) { |
| | | param.ID = primaryId |
| | | param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, '', param, data[0])) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | |
| | | if (btn.innerFunc) { |
| | | param.func = btn.innerFunc |
| | | |
| | | if (setting.primaryKey) { // 主键存在时,设置主键参数 |
| | | param[setting.primaryKey] = primaryId |
| | | } |
| | | |
| | | formdata.forEach(_data => { |
| | | param[_data.key] = _data.value |
| | | }) |
| | | |
| | | } else if (btn.sql && btn.sqlType === 'insert') { // 系统函数添加时,生成uuid |
| | | if (setting.primaryKey) { |
| | | param[setting.primaryKey] = Utils.getguid() |
| | | } |
| | | |
| | | param.ID = Utils.getguid() |
| | | param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, data[0])) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | } else if (btn.sql) { |
| | | param.ID = primaryId |
| | | param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, data[0])) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | |
| | | func: 'sPC_TableData_InUpDe', |
| | | BID: this.props.BID |
| | | } |
| | | |
| | | if (setting.primaryKey) { |
| | | param[setting.primaryKey] = cell[setting.primaryKey] || '' |
| | | } |
| | | let primaryId = setting.primaryKey ? cell[setting.primaryKey] : '' |
| | | |
| | | if (btn.OpenType === 'prompt' || btn.OpenType === 'exec') { // 是否弹框或直接执行 |
| | | |
| | | if (btn.innerFunc) { |
| | | param.func = btn.innerFunc |
| | | if (setting.primaryKey) { |
| | | param[setting.primaryKey] = primaryId |
| | | } |
| | | } else if (btn.sql) { |
| | | param.ID = primaryId |
| | | param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, '', param, cell)) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | |
| | | } else if (btn.OpenType === 'pop') { // 表单 |
| | | if (btn.innerFunc) { |
| | | param.func = btn.innerFunc |
| | | |
| | | |
| | | if (setting.primaryKey) { |
| | | param[setting.primaryKey] = primaryId |
| | | } |
| | | |
| | | formdata.forEach(_data => { |
| | | param[_data.key] = _data.value |
| | | }) |
| | | |
| | | } else if (btn.sql) { |
| | | if (setting.primaryKey) { |
| | | param[setting.primaryKey] = cell[setting.primaryKey] |
| | | } |
| | | param.ID = primaryId |
| | | param.LText = Utils.formatOptions(Utils.getSysDefaultSql(btn, setting, formdata, param, cell)) // 数据源 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | |
| | | if (execAction.groups.length > 0) { |
| | | execAction.groups.forEach(group => { |
| | | group.sublist.forEach(field => { |
| | | if ((field.type === 'select' || field.type === 'link') && field.resourceType === '1' && field.dataSource) { |
| | | if ((field.type === 'select' || field.type === 'link' || field.type === 'multiselect') && field.resourceType === '1' && field.dataSource) { |
| | | subfields.push(field) |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | execAction.fields.forEach(field => { |
| | | if ((field.type === 'select' || field.type === 'link') && field.resourceType === '1' && field.dataSource) { |
| | | if ((field.type === 'select' || field.type === 'link' || field.type === 'multiselect') && field.resourceType === '1' && field.dataSource) { |
| | | subfields.push(field) |
| | | } |
| | | }) |
| | |
| | | |
| | | if (item.type === 'link') { |
| | | arrfield = arrfield + ',' + item.linkField |
| | | } else if (item.type === 'select' && item.linkSubField && item.linkSubField.length > 0) { |
| | | arrfield = arrfield + ',' + item.linkSubField.join(',') |
| | | } |
| | | |
| | | let _sql = Utils.getSelectQuerySql(item) |
| | |
| | | |
| | | if (res.search.type === 'link') { |
| | | item.parentId = cell[res.search.linkField] |
| | | } else if (res.search.type === 'select' && res.search.linkSubField && res.search.linkSubField.length > 0) { |
| | | res.search.linkSubField.forEach(_field => { |
| | | item[_field] = (cell[_field] || cell[_field] === 0) ? cell[_field] : '' |
| | | }) |
| | | } |
| | | |
| | | return item |