| | |
| | | if (window.GLOB.CacheMap.has(_param)) { |
| | | return Promise.resolve(window.GLOB.CacheMap.get(_param)) |
| | | } else { |
| | | return Promise.resolve({ErrCode: 'S', ErrMesg: '', LongParam: '', message: '', status: false}) |
| | | return Promise.resolve({ErrCode: 'S', LongParam: '', message: '', status: false}) |
| | | } |
| | | } |
| | | |
| | |
| | | token = JSON.parse(window.decodeURIComponent(window.atob(token))) |
| | | } catch (e) { |
| | | token = null |
| | | _resolve({status: false, ErrCode: 'E', message: '接口信息解析失败!', ErrMesg: 'token_error'}) |
| | | _resolve({status: false, ErrCode: 'token_error', message: '接口信息解析失败!'}) |
| | | } |
| | | |
| | | if (!token) return |
| | |
| | | param.appkey = window.GLOB.appkey || '' |
| | | |
| | | if (param.$token === '') { |
| | | return Promise.resolve({status: false, ErrCode: 'E', message: '接口地址尚未设置!', ErrMesg: 'token_error'}) |
| | | return Promise.resolve({status: false, ErrCode: 'token_error', message: '接口地址尚未设置!'}) |
| | | } else if (param.$token) { |
| | | return new Promise(resolve => this.visitOuterSystem(param, resolve)) |
| | | } |
| | |
| | | value: GLOB.cloudServiceApi || '' |
| | | }) |
| | | |
| | | Object.defineProperty(GLOB, 'memberLevel', { |
| | | writable: false, |
| | | value: GLOB.memberLevel || 0 |
| | | }) |
| | | if (GLOB.memberLevel) { |
| | | Object.defineProperty(GLOB, 'memberLevel', { |
| | | writable: false, |
| | | value: GLOB.memberLevel |
| | | }) |
| | | } else { |
| | | GLOB.memberLevel = 0 |
| | | } |
| | | |
| | | if (GLOB.sysType === 'cloud') { |
| | | Object.defineProperty(GLOB, 'debugger', { |
| | |
| | | if (res && res.ErrCode === 'S') { // 执行成功 |
| | | notification.success({ |
| | | top: 92, |
| | | message: res.ErrMesg || '执行成功', |
| | | message: res.message || '执行成功', |
| | | duration: submit.stime ? submit.stime : 2 |
| | | }) |
| | | } else if (res && res.ErrCode === 'Y') { // 执行成功 |
| | | Modal.success({ |
| | | title: res.ErrMesg || '执行成功' |
| | | title: res.message || '执行成功' |
| | | }) |
| | | } else if (res && res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | |
| | | |
| | | if (res.ErrCode === 'E') { |
| | | Modal.error({ |
| | | title: res.message || res.ErrMesg, |
| | | title: res.message || '执行失败!', |
| | | }) |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | message: res.message || '执行失败!', |
| | | duration: submit.ntime ? submit.ntime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | message: res.message || '执行失败!', |
| | | duration: submit.ftime ? submit.ftime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || res.ErrMesg) |
| | | message.error(res.message || '执行失败!') |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | }).then(response => { |
| | | if (!response || response.ErrCode === 'LoginError') return |
| | | // 回调请求 |
| | | if (ver_token && response.ErrMesg === 'token_error') { |
| | | if (ver_token && response.ErrCode === 'token_error') { |
| | | response.ErrCode = 'E' |
| | | this.execError(response) |
| | | } else if (btn.callbackFunc ) { |
| | | // 存在回调函数时,调用 |
| | |
| | | } |
| | | |
| | | if (error) { |
| | | this.execError({ErrCode: 'E', ErrMesg: error}) |
| | | this.execError({ErrCode: 'E', message: error}) |
| | | return |
| | | } |
| | | |
| | |
| | | if (datas.length > 0) { |
| | | this.addUser(ip, datas, sessionId) |
| | | } else { |
| | | this.execSuccess({ErrCode: 'S', ErrMesg: '执行成功。'}) |
| | | this.execSuccess({ErrCode: 'S', message: '执行成功。'}) |
| | | } |
| | | }, (err) => { |
| | | this.execPreError(err, data) |
| | |
| | | if (res && (res.ErrCode === 'S' || !res.ErrCode)) { // 执行成功 |
| | | notification.success({ |
| | | top: 92, |
| | | message: res.ErrMesg || '执行成功', |
| | | message: res.message || '执行成功', |
| | | duration: btn.verify && btn.verify.stime ? btn.verify.stime : 2 |
| | | }) |
| | | } else if (res && res.ErrCode === 'Y') { // 执行成功 |
| | | Modal.success({ |
| | | title: res.ErrMesg || '执行成功' |
| | | title: res.message || '执行成功' |
| | | }) |
| | | } else if (res && res.ErrCode === '-1') { // 完成后不提示 |
| | | |
| | |
| | | |
| | | if (res.ErrCode === 'E') { |
| | | Modal.error({ |
| | | title: res.message || res.ErrMesg, |
| | | title: res.message || '执行失败!', |
| | | }) |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | message: res.message || '执行失败!', |
| | | duration: btn.verify && btn.verify.ntime ? btn.verify.ntime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | message: res.message || '执行失败!', |
| | | duration: btn.verify && btn.verify.ftime ? btn.verify.ftime : 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || res.ErrMesg) |
| | | message.error(res.message || '执行失败!') |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | return |
| | | } else if (res.ErrCode === 'E') { |
| | | Modal.error({ |
| | | title: res.message || res.ErrMesg, |
| | | title: res.message || '执行失败!', |
| | | }) |
| | | } else if (res.ErrCode === 'N') { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | message: res.message || '执行失败!', |
| | | duration: 10 |
| | | }) |
| | | } else if (res.ErrCode === 'F') { |
| | | notification.error({ |
| | | className: 'notification-custom-error', |
| | | top: 92, |
| | | message: res.message || res.ErrMesg, |
| | | message: res.message || '执行失败!', |
| | | duration: 10 |
| | | }) |
| | | } else if (res.ErrCode === 'NM') { |
| | | message.error(res.message || res.ErrMesg) |
| | | message.error(res.message || '执行失败!') |
| | | } |
| | | |
| | | if (btn.execError !== 'never') { |
| | |
| | | result.status = false |
| | | result.message = result.$ErrMesg |
| | | result.ErrCode = 'E' |
| | | result.ErrMesg = result.$ErrMesg |
| | | } else { |
| | | result.status = result.status !== false |
| | | result.ErrCode = result.ErrCode || '-1' |
| | |
| | | |
| | | Api.genericInterface(result).then(res => { |
| | | if (!res) return // LoginError时中断请求 |
| | | if (ver_token && res.ErrMesg === 'token_error') { |
| | | if (ver_token && res.ErrCode === 'token_error') { |
| | | res.ErrCode = 'E' |
| | | this.execError(res) |
| | | return |
| | | } |
| | |
| | | errorMsg = { |
| | | ErrCode: 'N', |
| | | message: _temp.error, |
| | | ErrMesg: _temp.error, |
| | | status: false |
| | | } |
| | | } else { |
| | |
| | | }).then(response => { |
| | | if (!response || response.ErrCode === 'LoginError') return |
| | | |
| | | if (ver_token && response.ErrMesg === 'token_error') { |
| | | if (ver_token && response.ErrCode === 'token_error') { |
| | | response.ErrCode = 'E' |
| | | this.execError(response) |
| | | _resolve({next: false, list: []}) |
| | | } else if (btn.callbackFunc) { |
| | |
| | | |
| | | if (item.advanced && !forbid) { |
| | | _setting.showAdv = true |
| | | if (!['group', 'check', 'switch'].includes(item.type)) { |
| | | item.signValue = true |
| | | } |
| | | } else { |
| | | item.advanced = false |
| | | } |
| | | |
| | | if (item.advanced && item.initval) { |
| | | let val = item.initval |
| | | if (item.precision === 'hour') { |
| | | if (/,/ig.test(val)) { |
| | | val = val.split(',').map(m => m + ':00').join(',') |
| | | } else { |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) { |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val}) |
| | | } |
| | | } |
| | | |
| | | if (item.type === 'group') { |
| | |
| | | if (item.type === 'checkcard' && item.multiple === 'dropdown' && item.resourceType === '0') { |
| | | this.resetCheckcard(item) |
| | | } |
| | | } |
| | | |
| | | if (item.signValue && item.initval) { |
| | | let val = item.initval |
| | | if (item.precision === 'hour') { |
| | | if (/,/ig.test(val)) { |
| | | val = val.split(',').map(m => m + ':00').join(',') |
| | | } else { |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | |
| | | let text = val |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'radio') { |
| | | item.oriOptions.forEach(cell => { |
| | | if (cell.Value === val) { |
| | | text = cell.Text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val, text}) |
| | | } |
| | | |
| | | fieldMap.set(item.field, item) |
| | |
| | | if (visible) { |
| | | let advanceValues = [] |
| | | this.state.searchlist.forEach(item => { |
| | | if (!item.advanced) return |
| | | if (!item.signValue) return |
| | | |
| | | let val = this.record[item.field] |
| | | if (val || val === 0) { |
| | |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) { |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val}) |
| | | |
| | | let text = val |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'radio') { |
| | | item.oriOptions.forEach(cell => { |
| | | if (cell.Value === val) { |
| | | text = cell.Text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val, text}) |
| | | } |
| | | }) |
| | | this.setState({advanceValues}) |
| | |
| | | } else { |
| | | record[item.field] = item.initval |
| | | } |
| | | if (item.advanced && item.initval) { |
| | | if (item.signValue && item.initval) { |
| | | let val = item.initval |
| | | if (item.precision === 'hour') { |
| | | if (/,/ig.test(val)) { |
| | |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) { |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val}) |
| | | |
| | | let text = val |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'radio') { |
| | | item.oriOptions.forEach(cell => { |
| | | if (cell.Value === val) { |
| | | text = cell.Text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val, text}) |
| | | } |
| | | |
| | | return item |
| | |
| | | |
| | | let advanceValues = [] |
| | | this.state.searchlist.forEach(item => { |
| | | if (!item.advanced) return |
| | | if (!item.signValue) return |
| | | |
| | | let val = this.record[item.field] |
| | | if (val || val === 0) { |
| | |
| | | val = val + ':00' |
| | | } |
| | | } |
| | | if (['text', 'date', 'datemonth', 'dateweek', 'daterange'].includes(item.type)) { |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val}) |
| | | |
| | | let text = val |
| | | |
| | | if (item.type === 'select' || item.type === 'link' || item.type === 'radio') { |
| | | item.oriOptions.forEach(cell => { |
| | | if (cell.Value === val) { |
| | | text = cell.Text |
| | | } |
| | | }) |
| | | } |
| | | |
| | | advanceValues.push({field: item.field, type: item.type, label: item.label, value: val, text}) |
| | | } |
| | | }) |
| | | |
| | |
| | | return ( |
| | | <div key={index}> |
| | | <span>{item.label}: </span> |
| | | <span className="advance-value">{item.value}</span> |
| | | <span className="advance-value">{item.text}</span> |
| | | <CloseOutlined onClick={() => this.closeAdvanceForm(item)} /> |
| | | </div>) |
| | | })} |
| | |
| | | import React from 'react' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Select, DatePicker, Input, Popover, Form } from 'antd' |
| | | import { Select, DatePicker, Input, Popover, Form, Switch, Radio, Checkbox } from 'antd' |
| | | import { EditOutlined, CopyOutlined, CloseOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | |
| | | } else if (card.type === 'checkcard') { |
| | | type = 'checkcard' |
| | | formItem = <CheckCard config={card} /> |
| | | } else if (card.type === 'switch') { |
| | | formItem = (<Switch checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''} checked={card.initval === card.openVal}/>) |
| | | } else if (card.type === 'radio') { |
| | | let options = card.options |
| | | if (options.length === 0) { |
| | | options = [{Value: '1', Text: '选项1'}, {Value: '2', Text: '选项2'}] |
| | | } |
| | | formItem = (<Radio.Group value={card.initval} style={{lineHeight: '36px'}}> |
| | | {options.map((item, i) => (<Radio key={i} value={item.Value}> {item.Text} </Radio>))} |
| | | </Radio.Group>) |
| | | } else if (card.type === 'check') { |
| | | formItem = <Checkbox style={{lineHeight: '36px'}} checked={card.initval === card.openVal}>{card.checkTip || ''}</Checkbox> |
| | | } |
| | | |
| | | let labelwidth = card.labelwidth || 33.3 |
| | |
| | | |
| | | if ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100].includes(res.member_level)) { |
| | | systemMsg.Member_Level = md5('mksoft' + window.GLOB.appkey + res.member_level) |
| | | Object.defineProperty(window.GLOB, 'memberLevel', { |
| | | writable: false, |
| | | value: res.member_level |
| | | }) |
| | | if (!window.GLOB.memberLevel) { |
| | | Object.defineProperty(window.GLOB, 'memberLevel', { |
| | | writable: false, |
| | | value: res.member_level |
| | | }) |
| | | } |
| | | } |
| | | |
| | | let level = res.pwd_level || '' |
| | |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.ErrMesg, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: error.ErrMesg, |
| | | message: error.message, |
| | | duration: 5 |
| | | }) |
| | | return |
| | |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.ErrMesg, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | this.setState({ |
| | |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.ErrMesg, |
| | | message: res.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | |
| | | |
| | | if ([10, 20, 30, 40, 50, 60, 70, 80, 90, 100].includes(res.member_level)) { |
| | | systemMsg.Member_Level = md5('mksoft' + window.GLOB.appkey + res.member_level) |
| | | Object.defineProperty(window.GLOB, 'memberLevel', { |
| | | writable: false, |
| | | value: res.member_level |
| | | }) |
| | | if (!window.GLOB.memberLevel) { |
| | | Object.defineProperty(window.GLOB, 'memberLevel', { |
| | | writable: false, |
| | | value: res.member_level |
| | | }) |
| | | } |
| | | } |
| | | |
| | | let level = res.pwd_level || '' |