| | |
| | | |
| | | let _value = '' |
| | | if (value === 'default') { |
| | | let fields = usefulfields.filter(item => item.import !== 'false') |
| | | fields = fields.map(col => col.Column).join(',') |
| | | let fields = [] |
| | | let decls = [] |
| | | usefulfields.forEach(col => { |
| | | if (col.import === 'false') return |
| | | |
| | | if (col.type === 'date') { |
| | | decls.push(`${col.Column} Nvarchar(50)`) |
| | | } else { |
| | | decls.push(`${col.Column} ${col.type}`) |
| | | } |
| | | fields.push(col.Column) |
| | | }) |
| | | |
| | | decls = decls.join(',') |
| | | fields = fields.join(',') |
| | | |
| | | if (fields) { |
| | | fields = fields + ',' |
| | | decls = decls + ',' |
| | | } |
| | | |
| | | let database = btn.sheet.match(/(.*)\.(.*)\.|@db@/ig) || '' |
| | |
| | | |
| | | database = database ? (database[0] || '') : '' |
| | | |
| | | _value = `Insert into ${database}${sheet} (${fields}createuserid,createuser,createstaff,bid)\nSelect ${fields}@userid@,@username,@fullname,@BID@ From #${sheet}` |
| | | _value = `/* create table #${sheet} (${decls}jskey nvarchar(50),BID nvarchar(50) ) */\nInsert into ${database}${sheet} (${fields}createuserid,createuser,createstaff,bid)\nSelect ${fields}@userid@,@username,@fullname,@BID@ From #${sheet}` |
| | | } else if (value === 'flowSql') { |
| | | let sheet = btn.sheet.replace(/(.*)\.(.*)\.|@db@/ig, '') |
| | | |
| | |
| | | </Col> : null} |
| | | {!type ? <Col span={24} className="sqlfield"> |
| | | <Form.Item label="可用字段"> |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, time_id, typename</span></Tooltip>, |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'公共值,请按照@xxx@格式使用。'}><span style={{color: '#1890ff'}}>BID, ID, LoginUID, SessionUid, UserID, Appkey, lang, time_id, typename</span></Tooltip>, |
| | | {workFlow === 'true' ? <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title="工作流变量,请按照@xxx@格式使用。"><span style={{color: '#26C281'}}>works_flow_code, works_flow_name, works_flow_param, works_flow_detail_id, status, statusname, work_group, work_grade, start_type, </span></Tooltip> : null} |
| | | <Tooltip mouseLeaveDelay={0.3} mouseEnterDelay={0.3} placement="top" title={'系统变量,系统会定义变量并赋值。'}><span style={{color: '#fa8c16'}}>UserName, FullName, RoleID, mk_departmentcode, mk_organization, mk_user_type, mk_nation, mk_province, mk_city, mk_district, mk_address</span></Tooltip>, |
| | | {usefulfields} |