| | |
| | | config.data = qs.stringify(config.data) |
| | | } else if (config.url.includes('Upload') || config.url.includes('doupload') || config.url.includes('dopreload')) { |
| | | config.headers = { 'Content-Type': 'multipart/form-data' } |
| | | } else if (config.method === 'post') { |
| | | } else if (config.method === 'post' && config.data) { |
| | | config.data = JSON.stringify(config.data) |
| | | } |
| | | |
| | |
| | | * @param {Object} param 查询及提交参数 |
| | | */ |
| | | directRequest (url, method = 'post', param, cross) { |
| | | if (cross === 'true') { |
| | | if (cross === 'true' && param) { |
| | | return axios({ |
| | | url, |
| | | method, |
| | | data: param |
| | | }) |
| | | } else if (cross === 'true') { |
| | | return axios({ |
| | | url, |
| | | method |
| | | }) |
| | | } |
| | | |
| | |
| | | * @description 获取或修改系统配置,增加appkey |
| | | */ |
| | | getSystemConfig (param) { |
| | | param.userid = sessionStorage.getItem('UserID') || '' |
| | | param.userid = param.userid || sessionStorage.getItem('UserID') || '' |
| | | param.lang = param.lang || sessionStorage.getItem('lang') || '' |
| | | param.SessionUid = localStorage.getItem('SessionUid') || '' |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | param.LoginUID = param.LoginUID || sessionStorage.getItem('LoginUID') || '' |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | let url = '/webapi/dostars' |
| | |
| | | * @description 获取或修改本地配置,增加appkey |
| | | */ |
| | | getLocalConfig (param) { |
| | | param.userid = sessionStorage.getItem('UserID') || '' |
| | | param.userid = param.userid || sessionStorage.getItem('UserID') || '' |
| | | param.lang = param.lang || sessionStorage.getItem('lang') || '' |
| | | param.SessionUid = localStorage.getItem('SessionUid') || '' |
| | | param.LoginUID = sessionStorage.getItem('LoginUID') || '' |
| | | param.LoginUID = param.LoginUID || sessionStorage.getItem('LoginUID') || '' |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | let url = '/webapi/dostars' |
| | |
| | | let _this = this |
| | | |
| | | confirm({ |
| | | content: `确定删除<<${card.label}>>吗?`, |
| | | content: `确定删除${card.label ? `<<${card.label}>>` : ''}吗?`, |
| | | onOk() { |
| | | let _config = fromJS(_this.state.config).toJS() |
| | | _config.fields = _config.fields.filter(item => !(item.uuid === card.uuid)) |
| | |
| | | <Col span={item.span || 24} key={index}> |
| | | <Form.Item |
| | | colon={!!item.label} |
| | | label={item.label || ' '} |
| | | label={item.label} |
| | | labelCol={item.labelCol} |
| | | wrapperCol={item.wrapperCol} |
| | | className="hint" |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { action } = this.props |
| | | |
| | | let _align = 'left_right' |
| | | if (action.setting && action.setting.align) { |
| | | _align = action.setting.align |
| | | } |
| | | |
| | | return ( |
| | | <Form className="main-form-field" id="main-form-box"> |
| | | <Form className={'main-form-field ' + _align} id="main-form-box"> |
| | | <Row gutter={24}>{this.getFields()}</Row> |
| | | </Form> |
| | | ) |
| | |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .main-form-field.up_down { |
| | | .ant-form-item { |
| | | display: block; |
| | | .ant-form-item-label { |
| | | width: 100%!important; |
| | | text-align: left; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | width: 100%!important; |
| | | } |
| | | } |
| | | } |
| | |
| | | <Checkbox value="D">D</Checkbox> |
| | | </Checkbox.Group>) |
| | | } else if (card.type === 'hint') { |
| | | formItem = <div style={{marginTop: '10px', color: 'rgba(0, 0, 0, 0.85)'}}>{card.message}</div> |
| | | formItem = <div style={{marginTop: '10px', color: 'rgba(0, 0, 0, 0.85)', lineHeight: '1.5'}}>{card.message}</div> |
| | | } else if (card.type === 'split') { |
| | | formItem = <div className="split-line">{card.label}</div> |
| | | } else if (card.type === 'checkcard') { |
| | | formItem = <CheckCard width={card.width} ratio={card.ratio} display={card.display} fields={card.fields} options={card.options} /> |
| | | } |
| | | |
| | | let _label = card.label |
| | | if (card.tooltip) { |
| | | _label = <span><Icon type="question-circle" />{card.label}</span> |
| | | } |
| | | if (card.type === 'brafteditor' && card.hidelabel === 'true') { |
| | | _label = null |
| | | } |
| | | |
| | | return ( |
| | |
| | | <div ref={node => drag(drop(node))}> |
| | | {card.type === 'split' ? formItem : <Form.Item |
| | | className="ant-form-item" |
| | | colon={!!card.label} |
| | | label={card.tooltip ? <span><Icon type="question-circle" />{card.label}</span> : card.label} |
| | | colon={!!_label} |
| | | label={_label} |
| | | required={card.required === 'true'} |
| | | extra={card.extra || null} |
| | | labelCol={card.labelwidth ? {style: {width: card.labelwidth + '%'}} : null} |
| | |
| | | width: 100%!important; |
| | | text-align: left; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | width: 100%!important; |
| | | } |
| | | } |
| | | } |
| | |
| | | let _this = this |
| | | |
| | | confirm({ |
| | | content: `确定删除<<${card.label}>>吗?`, |
| | | content: `确定删除${card.label ? `<<${card.label}>>` : ''}吗?`, |
| | | onOk() { |
| | | let _config = fromJS(_this.state.config).toJS() |
| | | _config.fields = _config.fields.filter(item => !(item.uuid === card.uuid)) |
| | |
| | | let _decimal = 0 |
| | | let _length = 50 |
| | | if (/^nvarchar/.test(_type)) { |
| | | _length = +_type.match(/\d+/)[0] || 50 |
| | | try { // 存在max |
| | | _length = +_type.match(/\d+/)[0] || 50 |
| | | } catch { |
| | | _length = 2048 |
| | | } |
| | | _type = 'text' |
| | | } else if (/^int/.test(_type)) { |
| | | _type = 'number' |
| | |
| | | }) |
| | | } |
| | | |
| | | if (['textarea', 'fileupload', 'multiselect', 'checkbox', 'brafteditor'].includes(card.type)) { |
| | | if (['fileupload', 'multiselect', 'checkbox'].includes(card.type)) { |
| | | _fieldlength = 512 |
| | | } else if (['textarea', 'brafteditor'].includes(card.type)) { |
| | | _fieldlength = 8000 |
| | | } |
| | | |
| | | return [ |
| | |
| | | } |
| | | } else if (form.key === 'fieldlength') { |
| | | form.initVal = 50 |
| | | if (value === 'textarea') { |
| | | if (value === 'textarea' || value === 'brafteditor') { |
| | | form.initVal = 8000 |
| | | } else if (value === 'fileupload' || value === 'multiselect' || value === 'checkbox') { |
| | | form.initVal = 512 |
| | |
| | | { |
| | | obj_name: 'modularDetail', |
| | | arr_field: 'ModularDetailCode,CodeName,BID,Type', |
| | | LText: window.btoa(window.encodeURIComponent(`select distinct ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,ModularCode as BID,Type from sModularDetail where Appkey= @Appkey@ and deleted=0 order by ModularDetailCode`)) |
| | | LText: window.btoa(window.encodeURIComponent(`select distinct ModularDetailCode,ModularDetailCode+ModularDetailName as CodeName,ModularCode as BID,Type from sModularDetail where Appkey= @Appkey@ and deleted=0 order by ModularDetailCode desc`)) |
| | | }, |
| | | { |
| | | obj_name: 'voucher', |
| | |
| | | select distinct a.ModularDetailCode,a.ModularDetailCode+ModularDetailName as CodeName,ModularCode as BID, VoucherTypeTwo, IDefine1 |
| | | from (select * from sModularDetail where Deleted=0 and VoucherTypeTwo!='' and Appkey='') a |
| | | left join (select distinct ModularDetailCode from sModularDetail where Deleted=0 and VoucherTypeTwo!='' |
| | | and Appkey=@Appkey@) m on a.ModularDetailCode=m.ModularDetailCode where m.ModularDetailCode is null order by ModularDetailCode` |
| | | and Appkey=@Appkey@) m on a.ModularDetailCode=m.ModularDetailCode where m.ModularDetailCode is null order by ModularDetailCode desc` |
| | | )) |
| | | }, |
| | | { |
| | |
| | | |
| | | localStorage.setItem(_url + 'lang', param.lang || 'zh-CN') |
| | | sessionStorage.setItem('lang', param.lang || 'zh-CN') |
| | | |
| | | sessionStorage.removeItem('visitorUserID') |
| | | sessionStorage.removeItem('visitorLoginUID') |
| | | |
| | | if (param.remember) { // 记住密码时账号密码存入localStorage |
| | | localStorage.setItem(_url, window.btoa(window.encodeURIComponent(JSON.stringify({username: param.username, password: param.password})))) |
| | |
| | | |
| | | localStorage.setItem(_url + 'lang', param.lang || 'zh-CN') |
| | | sessionStorage.setItem('lang', param.lang || 'zh-CN') |
| | | |
| | | sessionStorage.removeItem('visitorUserID') |
| | | sessionStorage.removeItem('visitorLoginUID') |
| | | |
| | | let _history = sessionStorage.getItem('history') |
| | | if (_history) { |
| | |
| | | |
| | | Api.getTouristMsg().then(result => { |
| | | if (result.status) { |
| | | if (result.UserID && !sessionStorage.getItem('UserID')) { |
| | | sessionStorage.setItem('UserID', result.UserID) |
| | | } |
| | | if (result.LoginUID && !sessionStorage.getItem('LoginUID')) { |
| | | sessionStorage.setItem('LoginUID', result.LoginUID) |
| | | } |
| | | sessionStorage.setItem('visitorUserID', result.UserID || '') |
| | | sessionStorage.setItem('visitorLoginUID', result.LoginUID || '') |
| | | |
| | | if (result.UserID && result.LoginUID) { |
| | | this.setState({touristLogin: true}) |
| | |
| | | LText: `select '${window.GLOB.appkey}'`, |
| | | } |
| | | |
| | | _param.userid = result.UserID |
| | | _param.LoginUID = result.LoginUID |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) |
| | | |
| | |
| | | } |
| | | |
| | | if (res.users_upt === 'true' && window.GLOB.systemType === 'production') { |
| | | Api.getLocalConfig ({func: 's_Get_local_u_deleted', users_upt_date: res.users_upt_date}).then(localres => { |
| | | Api.getLocalConfig ({ |
| | | func: 's_Get_local_u_deleted', |
| | | users_upt_date: res.users_upt_date, |
| | | userid: result.UserID, |
| | | LoginUID: result.LoginUID |
| | | }).then(localres => { |
| | | if (!localres.status) return |
| | | Api.getSystemConfig({func: 's_get_sso_u_create', user_ids: localres.user_ids, user_ids_local: localres.user_ids_local, users_upt_date: localres.users_upt_date}).then(ssores => { |
| | | Api.getSystemConfig({ |
| | | func: 's_get_sso_u_create', |
| | | user_ids: localres.user_ids, |
| | | user_ids_local: localres.user_ids_local, |
| | | users_upt_date: localres.users_upt_date, |
| | | userid: result.UserID, |
| | | LoginUID: result.LoginUID |
| | | }).then(ssores => { |
| | | if (!ssores.status) return |
| | | Api.getLocalConfig ({func: 's_get_local_u_create', user_ids_local: ssores.user_ids_local}) |
| | | Api.getLocalConfig ({ |
| | | func: 's_get_local_u_create', |
| | | user_ids_local: ssores.user_ids_local, |
| | | userid: result.UserID, |
| | | LoginUID: result.LoginUID |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | |
| | | param.LText = md5(`${_phone}mingke${window.GLOB.appkey}${param.timestamp}`) |
| | | param.secretkey = md5(`${param.LText}mingke${param.timestamp}`) |
| | | |
| | | param.userid = sessionStorage.getItem('visitorUserID') || '' |
| | | param.LoginUID = sessionStorage.getItem('visitorLoginUID') || '' |
| | | |
| | | this.setState({ |
| | | verdisabled: true, |
| | | delay: 60 |