| | |
| | | if (_menu) { |
| | | this.openTab(_menu, 0) |
| | | } |
| | | |
| | | setTimeout(() => { |
| | | this.getwork() |
| | | }, 100) |
| | | }) |
| | | |
| | | // 获取角色权限, edition_type 接口版本控制 ''、'Y'、'A' |
| | |
| | | }, 50) |
| | | } |
| | | |
| | | getwork = () => { |
| | | if (sessionStorage.getItem('work_grade')) return |
| | | |
| | | Api.genericInterface({func: 's_get_local_my_worker_v1'}).then(result => { |
| | | sessionStorage.setItem('work_grade', result.work_grade || 0) |
| | | sessionStorage.setItem('work_group', result.work_group || '') |
| | | |
| | | if (!result.status && sessionStorage.getItem('debug') === 'true') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: /s_get_local_my_worker_v1/.test(result.message) ? '职员信息获取失败,请联系管理员。' : result.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | openTab = (menu, times) => { |
| | | if (times > 50) return |
| | | times++ |
| | |
| | | mainSearch: [], |
| | | visible: false, |
| | | loading: false, |
| | | setting: null, |
| | | record: {} |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config } = this.props |
| | | |
| | | this.setState({setting: fromJS(config.setting).toJS()}) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | } |
| | | |
| | | this.setState({loading: false, visible: false}) |
| | | |
| | | if (res.cols) { |
| | | res.cols = [...config.cols, ...res.cols] |
| | | } else { |
| | | delete res.cols |
| | | } |
| | | |
| | | this.props.updateConfig({...config, ...res}) |
| | | }, () => { |
| | | this.setState({loading: false}) |
| | |
| | | searches: PropTypes.array, // 搜索条件 |
| | | systemScripts: PropTypes.array, // 系统脚本 |
| | | scriptSubmit: PropTypes.func, // 脚本验证后提交 |
| | | scriptsChange: PropTypes.func // 脚本验证 |
| | | scriptsChange: PropTypes.func, |
| | | addProcess: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | |
| | | |
| | | if (value === 'defaultsql') { |
| | | value = this.props.defaultsql |
| | | } else if (value === 'flowsql') { |
| | | value = `/* select a.*,w.remark as remark_w,w.statusname as statusname_w,w.status as status_w,w.works_flow_param from (数据源) a inner join (select * from s_my_works_flow where works_flow_code=@works_flow_code@ and status=0 and deleted=0) w on a.id=w.works_flow_id */` |
| | | this.props.addProcess() |
| | | } |
| | | |
| | | _sql = _sql.replace(/\s{6}$/, '') |
| | |
| | | onSelect={this.selectScript} |
| | | > |
| | | <Select.Option style={{whiteSpace: 'normal'}} key="default" value="defaultsql">默认sql</Select.Option> |
| | | {window.GLOB.process ? <Select.Option style={{whiteSpace: 'normal'}} key="default" value="flowsql">默认sql(工作流)</Select.Option> : null} |
| | | <Select.Option key="debugger" value={`z_debug: select @ErrorCode='E',@retmsg='测试断点' goto aaa`}> |
| | | 测试断点 |
| | | </Select.Option> |
| | |
| | | const { TabPane } = Tabs |
| | | const { Paragraph } = Typography |
| | | const { Search } = Input |
| | | const { confirm } = Modal |
| | | |
| | | const CodeMirror = asyncComponent(() => import('@/templates/zshare/codemirror')) |
| | | const FieldsComponent = asyncComponent(() => import('@/templates/sharecomponent/fieldscomponent')) |
| | |
| | | reload: false, |
| | | script: null, |
| | | scriptValue: '', |
| | | cols: null, |
| | | colColumns: [ |
| | | { |
| | | title: '名称', |
| | |
| | | |
| | | submitDataSource = () => { |
| | | const { config, mainSearch } = this.props |
| | | const { activeKey, setting, columns, subColumns, scripts } = this.state |
| | | const { activeKey, setting, columns, subColumns, scripts, cols } = this.state |
| | | |
| | | if (config.subtype === 'dualdatacard') { |
| | | let arr = columns.map(col => col.field.toLowerCase()) |
| | |
| | | defaultSearch: _search, |
| | | setting: res |
| | | }, () => { |
| | | this.sqlverify(() => { resolve({setting: res, columns, subColumns, scripts }) }, reject, false) |
| | | this.sqlverify(() => { resolve({setting: res, columns, subColumns, scripts, cols }) }, reject, false) |
| | | }) |
| | | }, () => { |
| | | reject() |
| | |
| | | reject() |
| | | return |
| | | } |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts }) }, reject, false) |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, false) |
| | | } else if (activeKey === 'subcolumns') { |
| | | if (this.subdatasource && this.subdatasource.state.editingKey) { |
| | | notification.warning({ |
| | |
| | | reject() |
| | | return |
| | | } |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts }) }, reject, false) |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, false) |
| | | } else if (activeKey === 'scripts') { |
| | | let _loading = false |
| | | if (this.scriptsForm && this.scriptsForm.state.editItem) { |
| | |
| | | return |
| | | } |
| | | |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts }) }, reject, false) |
| | | this.sqlverify(() => { resolve({setting, columns, subColumns, scripts, cols }) }, reject, false) |
| | | } |
| | | }) |
| | | } |
| | |
| | | message.success('复制成功。') |
| | | } |
| | | |
| | | addProcess = () => { |
| | | const { config } = this.props |
| | | const { columns } = this.state |
| | | |
| | | if (config.subtype === 'dualdatacard') return |
| | | |
| | | let fields = [] |
| | | let cols = [] |
| | | let _cols = columns.map(item => item.field.toLowerCase()) |
| | | |
| | | if (!_cols.includes('remark_w')) { |
| | | fields.push({ uuid: Utils.getuuid(), label: '备注', field: 'remark_w', datatype: 'Nvarchar(50)', fieldlength: 50, type: 'text' }) |
| | | cols.push({ uuid: Utils.getuuid(), Width: 120, label: '备注', field: 'remark_w', type: 'text', Hide: 'false', IsSort: 'false', fieldlength: 50 }) |
| | | } |
| | | if (!_cols.includes('statusname_w')) { |
| | | fields.push({ uuid: Utils.getuuid(), label: '状态', field: 'statusname_w', datatype: 'Nvarchar(50)', fieldlength: 50, type: 'text' }) |
| | | cols.push({ uuid: Utils.getuuid(), Width: 120, label: '状态', field: 'statusname_w', type: 'text', Hide: 'false', IsSort: 'false', fieldlength: 50 }) |
| | | } |
| | | if (!_cols.includes('works_flow_param')) { |
| | | fields.push({ uuid: Utils.getuuid(), label: '流程参数', field: 'works_flow_param', datatype: 'Nvarchar(512)', fieldlength: 512, type: 'text' }) |
| | | cols.push({ uuid: Utils.getuuid(), Width: 120, label: '流程参数', field: 'works_flow_param', type: 'text', Hide: 'true', IsSort: 'false', fieldlength: 512 }) |
| | | } |
| | | |
| | | if (fields.length === 0) return |
| | | |
| | | const that = this |
| | | |
| | | if (config.subtype !== 'basetable') { |
| | | cols = null |
| | | } |
| | | |
| | | confirm({ |
| | | content: cols ? '显示列中是否添加工作流字段?' : '字段集中是否添加工作流字段?', |
| | | onOk() { |
| | | that.setState({ |
| | | cols: cols, |
| | | columns: [...fields, ...columns] |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | |
| | | setting={setting} |
| | | scripts={scripts} |
| | | updateStatus={this.updateStatus} |
| | | addProcess={this.addProcess} |
| | | wrappedComponentRef={(inst) => this.settingForm = inst} |
| | | /> : null} |
| | | </TabPane> |
| | |
| | | systemScripts={this.state.systemScripts} |
| | | scriptsChange={this.scriptsChange} |
| | | scriptSubmit={this.scriptSubmit} |
| | | addProcess={this.addProcess} |
| | | wrappedComponentRef={(inst) => this.scriptsForm = inst} |
| | | /> |
| | | <EditTable actions={['move']} data={scripts} columns={scriptsColumns} onChange={this.changeScripts}/> |
| | |
| | | class SettingForm extends Component { |
| | | static propTpyes = { |
| | | updateStatus: PropTypes.func, |
| | | addProcess: PropTypes.func, |
| | | config: PropTypes.object, // 组件配置 |
| | | setting: PropTypes.object, // 数据源配置 |
| | | columns: PropTypes.array, // 列设置 |
| | |
| | | addProcess = () => { |
| | | let _sql = this.props.form.getFieldValue('dataresource') |
| | | |
| | | _sql = _sql + `\n/* select a.*, w.remark as remark_w, w.statusname as statusname_w,w.status as status_w from 数据源 a inner join (select * from s_my_works_flow where works_flow_code=@works_flow_code@ and status=0 and deleted=0) w on a.id=w.works_flow_id */` |
| | | _sql = _sql + `\n/* select a.*,w.remark as remark_w,w.statusname as statusname_w,w.status as status_w,w.works_flow_param from (数据源) a inner join (select * from s_my_works_flow where works_flow_code=@works_flow_code@ and status=0 and deleted=0) w on a.id=w.works_flow_id */` |
| | | |
| | | this.props.form.setFieldsValue({ |
| | | dataresource: _sql |
| | | }) |
| | | |
| | | this.props.addProcess() |
| | | } |
| | | |
| | | render() { |
| | |
| | | }) |
| | | } |
| | | |
| | | if (config.flow_code) { |
| | | regs.push({ reg: /@works_flow_code@/ig, value: config.flow_code }) |
| | | } |
| | | |
| | | config.components = this.filterComponent(config.components, roleId, window.GLOB.mkActions, skip, param, MenuID, config.MenuName, config.process === 'true') |
| | | |
| | | let autoMatic = null |
| | |
| | | }) |
| | | } |
| | | |
| | | if (config.flow_code) { |
| | | regs.push({ reg: /@works_flow_code@/ig, value: config.flow_code }) |
| | | } |
| | | |
| | | config.$cache = config.cacheLocal === 'true' |
| | | config.$time = config.localCacheTime || 0 |
| | | |
| | |
| | | }) |
| | | } |
| | | |
| | | if (Tab.$process && window.GLOB.UserCacheMap.has(Tab.$flowId)) { |
| | | let flow = window.GLOB.UserCacheMap.get(Tab.$flowId) |
| | | regs.push({ reg: /@works_flow_code@/ig, value: flow.flow_code || '' }) |
| | | } |
| | | |
| | | config.components = this.filterComponent(config.components, roleId, balMap, param, Tab, Tab.uuid, Tab.uuid) |
| | | |
| | | // 获取主搜索条件 |
| | |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') |
| | | } else { |
| | | param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') |
| | | } |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | |
| | | param.key_back_type = 'Y' |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') |
| | | } else { |
| | | param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') |
| | | } |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | if (btn.output) { |
| | | param.key_back_type = 'Y' |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') |
| | | } else { |
| | | param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') |
| | | } |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | |
| | | param.key_back_type = 'Y' |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') |
| | | } else { |
| | | param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') |
| | | } |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | param.key_back_type = 'Y' |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') |
| | | } else { |
| | | param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') |
| | | } |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | |
| | | if (btn.output) { |
| | | param.key_back_type = 'Y' |
| | | } |
| | | } |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | param.LText = param.LText.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, '\'Y\'') |
| | | } else { |
| | | param.LText = param.LText.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, '\'\'') |
| | | } |
| | | |
| | | param.exec_type = 'y' // 后台解码 |
| | |
| | | } |
| | | |
| | | if (retmsg) { |
| | | param.$callbacksql = this.getSysDeclareSql(btn, formdata, data[0], columns, primaryId, this.props.BID) |
| | | param.$callbacksql = this.getSysDeclareSql(btn, formdata, data[0], columns, this.props.BID) |
| | | } |
| | | |
| | | _params.push(param) |
| | |
| | | } |
| | | |
| | | if (retmsg) { |
| | | param.$callbacksql = this.getSysDeclareSql(btn, formdata, cell, columns, primaryId, this.props.BID) |
| | | param.$callbacksql = this.getSysDeclareSql(btn, formdata, cell, columns, this.props.BID) |
| | | } |
| | | |
| | | return param |
| | |
| | | /** |
| | | * @description 获取回调脚本的字段定义 |
| | | */ |
| | | getSysDeclareSql = (btn, formdata, data, columns, primaryId, BID = '') => { |
| | | getSysDeclareSql = (btn, formdata, data, columns, BID = '') => { |
| | | let datavars = {} // 声明的变量,表单及显示列 |
| | | // 需要声明的变量集 |
| | | let _vars = ['tbid', 'errorcode', 'retmsg', 'billcode', 'bvoucher', 'fibvoucherdate', 'fiyear', 'username', 'fullname', 'modulardetailcode', 'roleid', 'mk_departmentcode', 'mk_organization', 'mk_user_type', 'mk_nation', 'mk_province', 'mk_city', 'mk_district', 'mk_address', 'mk_deleted', 'bid'] |
| | |
| | | /* 显示列变量赋值 */ |
| | | select ${_initColfields.join(',')} |
| | | ` |
| | | } |
| | | |
| | | _sql = _sql.replace(/@ID@/ig, `'${primaryId || ''}'`) |
| | | _sql = _sql.replace(/@BID@/ig, `'${BID}'`) |
| | | _sql = _sql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |
| | | _sql = _sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) |
| | | _sql = _sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) |
| | | _sql = _sql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) |
| | | _sql = _sql.replace(/@typename@/ig, `'admin'`) |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | _sql = _sql.replace(/@datam@/ig, '\'Y\'') |
| | | } else { |
| | | _sql = _sql.replace(/@datam@/ig, '\'\'') |
| | | } |
| | | |
| | | return _sql |
| | |
| | | * @description 自定义请求循环执行 |
| | | */ |
| | | customLoopRequest = (params, _resolve) => { |
| | | const { setting, btn } = this.props |
| | | |
| | | let param = params.shift() |
| | | |
| | | this.setState({ |
| | |
| | | ID: param.ID || '', |
| | | callbacksql: param.$callbacksql || '', |
| | | mk_api_key: '' |
| | | } |
| | | |
| | | if (!record.ID && btn.Ot !== 'notRequired' && param[setting.primaryKey]) { |
| | | record.ID = param[setting.primaryKey] |
| | | } |
| | | |
| | | delete param.$callbacksql |
| | |
| | | param.func = 'sPC_TableData_InUpDe' |
| | | |
| | | if (record.BID) { |
| | | param.BID = this.props.BID |
| | | param.BID = record.BID |
| | | } |
| | | if (record.ID) { |
| | | param.ID = record.ID |
| | |
| | | if (btn.output) { |
| | | _backCustomScript += ` |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg,${btn.output} as mk_b_id` |
| | | |
| | | param.key_back_type = 'Y' |
| | | } else { |
| | | _backCustomScript += ` |
| | | aaa: select @ErrorCode as ErrorCode,@retmsg as retmsg` |
| | |
| | | sql = sql + _backCustomScript |
| | | |
| | | sql = sql.replace(/@ID@/ig, `'${record.ID || ''}'`) |
| | | sql = sql.replace(/@BID@/ig, `'${this.props.BID || ''}'`) |
| | | sql = sql.replace(/@BID@/ig, `'${record.BID || ''}'`) |
| | | sql = sql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |
| | | sql = sql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) |
| | | sql = sql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) |
| | |
| | | * @description 外部请求循环执行 |
| | | */ |
| | | outerLoopRequest = (params, _resolve) => { |
| | | if (!params && params.length === 0) return |
| | | const { setting, btn } = this.props |
| | | |
| | | let param = params.shift() |
| | | |
| | |
| | | callbacksql: param.$callbacksql || '' |
| | | } |
| | | |
| | | if (!record.ID && btn.Ot !== 'notRequired' && param[setting.primaryKey]) { |
| | | record.ID = param[setting.primaryKey] |
| | | } |
| | | |
| | | delete param.$callbacksql |
| | | |
| | | if (!param.func) { |
| | |
| | | param.LText = param.LText.replace(/@works_flow_name@/ig, `'${param.timestamp}'`) |
| | | param.LText = param.LText.replace(/@works_flow_param@/ig, `'${param.timestamp}'`) |
| | | param.LText = param.LText.replace(/@works_flow_detail_id@/ig, `'${param.timestamp}'`) |
| | | param.LText = param.LText.replace(/@status@/ig, `'${param.timestamp}'`) |
| | | param.LText = param.LText.replace(/@statusname@/ig, `'${param.timestamp}'`) |
| | | param.LText = param.LText.replace(/@work_group@/ig, `'${param.timestamp}'`) |
| | | param.LText = param.LText.replace(/@work_grade@/ig, `'${param.timestamp}'`) |
| | | } |
| | | |
| | | console.info(`/* sql 验证 */\n${param.LText.replace(/\n\s{6,20}/ig, '\n')}`) |
| | |
| | | |
| | | if (value === 'flowSql') { |
| | | if (flowType === 'start') { |
| | | value = `insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_param,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff) |
| | | select @ID@,@works_flow_code@,@works_flow_param@,'职员分组',@works_flow_detail_id@,'职员等级',@bid@,@UserID@,@UserName,@FullName |
| | | insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,status,statuscharone,statuschartwo,StatusCharThree,StatusCharFour,StatusCharFive,statusname,remark,CreateUserID,CreateUser,CreateStaff,works_flow_detail_id,sort,upid,work_group,work_grade,typecharone,deleted,statusname_suc,statusname_back )` |
| | | value = `insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff) |
| | | select @ID@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName |
| | | insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade) |
| | | select @works_flow_id@,@works_flow_code@,@works_flow_name@ ,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@` |
| | | } else { |
| | | value = `insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_param,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff) |
| | | select @ID@,@works_flow_code@,@works_flow_param@,'职员分组',@works_flow_detail_id@,'职员等级',@bid@,@UserID@,@UserName,@FullName` |
| | | value = `insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff) |
| | | select @ID@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName |
| | | insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade) |
| | | select @works_flow_id@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@` |
| | | } |
| | | |
| | | value = value.replace(/\n\s{8}/g, '\n') |
| | |
| | | } |
| | | |
| | | columns.forEach(col => { |
| | | if (col.field === 'works_flow_param') return |
| | | |
| | | if (col.type === 'colspan' || col.type === 'old_colspan') { |
| | | col.subcols.forEach(cell => { |
| | | setField(cell) |
| | |
| | | ` |
| | | } |
| | | |
| | | if (btn.$process && verify.workFlow === 'true' && window.GLOB.UserCacheMap.has(btn.$flowId)) { |
| | | let flow = window.GLOB.UserCacheMap.get(btn.$flowId) |
| | | let node = null |
| | | let line = null |
| | | let target = null |
| | | let status = 0 |
| | | let statusName = '' |
| | | let detailId = '' |
| | | |
| | | if (verify.flowSql === 'true') { |
| | | if (verify.flowType === 'start') { |
| | | target = flow.cells.filter(cell => cell.mknode === 'start')[0] |
| | | |
| | | if (target) { |
| | | detailId = target.id |
| | | status = target.mkdata.status |
| | | statusName = target.mkdata.statusName |
| | | } |
| | | } else if (_data.works_flow_param) { |
| | | node = JSON.parse(window.decodeURIComponent(window.atob(_data.works_flow_param))) |
| | | |
| | | if (node) { |
| | | line = flow.cells.filter(cell => cell.shape === 'edge' && cell.source.cell === node.id)[0] |
| | | } |
| | | |
| | | if (line) { |
| | | target = flow.cells.filter(cell => cell.id === line.target.cell)[0] |
| | | } |
| | | } |
| | | |
| | | if (target) { |
| | | _sql += ` |
| | | /* 工作流默认sql */ |
| | | insert into s_my_works_flow (works_flow_id,works_flow_code,works_flow_name,works_flow_param,work_group,works_flow_detail_id,work_grade,bid,createuserid,CreateUser,CreateStaff) |
| | | select @ID@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@work_group@,@works_flow_detail_id@,@work_grade@,@bid@,@UserID@,@UserName,@FullName |
| | | insert into s_my_works_flow_log (works_flow_id,works_flow_code,works_flow_name,works_flow_param,status,statusname,works_flow_detail_id,work_group,work_grade) |
| | | select @ID@,@works_flow_code@,@works_flow_name@,@works_flow_param@,@status@,@statusname@,@works_flow_detail_id@,@work_group@,@work_grade@ |
| | | ` |
| | | } |
| | | } |
| | | |
| | | _sql = _sql.replace(/@works_flow_code@/ig, `'${flow.flow_code}'`) |
| | | _sql = _sql.replace(/@works_flow_name@/ig, `'${flow.flow_name}'`) |
| | | if (target) { |
| | | let msg = {...target.mkdata, id: target.id} |
| | | _sql = _sql.replace(/@works_flow_param@/ig, `'${window.btoa(window.encodeURIComponent(JSON.stringify(msg)))}'`) |
| | | } else { |
| | | _sql = _sql.replace(/@works_flow_param@/ig, `''`) |
| | | } |
| | | _sql = _sql.replace(/@works_flow_detail_id@/ig, `'${detailId}'`) |
| | | _sql = _sql.replace(/@status@/ig, `'${status}'`) |
| | | _sql = _sql.replace(/@statusname@/ig, `'${statusName}'`) |
| | | _sql = _sql.replace(/@work_group@/ig, `'${sessionStorage.getItem('work_group') || ''}'`) |
| | | _sql = _sql.replace(/@work_grade@/ig, `'${sessionStorage.getItem('work_grade') || 0}'`) |
| | | } |
| | | |
| | | if (_backCustomScript) { |
| | | _sql += _backCustomScript |
| | | } |
| | |
| | | _sql = _sql.replace(/@typename@/ig, `'admin'`) |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | _sql = _sql.replace(/@datam@/ig, '\'Y\'') |
| | | _sql = _sql.replace(/\$@/ig, '/*').replace(/@\$/ig, '*/').replace(/@datam@/ig, `'Y'`) |
| | | } else { |
| | | _sql = _sql.replace(/@datam@/ig, '\'\'') |
| | | _sql = _sql.replace(/@\$|\$@/ig, '').replace(/@datam@/ig, `''`) |
| | | } |
| | | |
| | | if (window.GLOB.debugger === true) { |
| | |
| | | } |
| | | |
| | | if (retmsg) { |
| | | _callbacksql = _callbacksql.replace(/@ID@/ig, `'${primaryId || ''}'`) |
| | | _callbacksql = _callbacksql.replace(/@BID@/ig, `'${BID}'`) |
| | | _callbacksql = _callbacksql.replace(/@LoginUID@/ig, `'${sessionStorage.getItem('LoginUID') || ''}'`) |
| | | _callbacksql = _callbacksql.replace(/@SessionUid@/ig, `'${localStorage.getItem('SessionUid') || ''}'`) |
| | | _callbacksql = _callbacksql.replace(/@UserID@/ig, `'${sessionStorage.getItem('UserID') || ''}'`) |
| | | _callbacksql = _callbacksql.replace(/@Appkey@/ig, `'${window.GLOB.appkey || ''}'`) |
| | | _callbacksql = _callbacksql.replace(/@typename@/ig, `'admin'`) |
| | | |
| | | if (sessionStorage.getItem('dataM') === 'true') { // 数据权限 |
| | | _callbacksql = _callbacksql.replace(/@datam@/ig, '\'Y\'') |
| | | } else { |
| | | _callbacksql = _callbacksql.replace(/@datam@/ig, '\'\'') |
| | | } |
| | | |
| | | return { |
| | | sql: _sql, |
| | | callbacksql: _callbacksql |