| | |
| | | */ |
| | | getCloudConfig (param) { |
| | | param.lang = param.lang || sessionStorage.getItem('lang') || '' |
| | | param.appkey = window.GLOB.appkey || '' |
| | | param.appkey = param.appkey || window.GLOB.appkey || '' |
| | | param.SessionUid = localStorage.getItem('SessionUid') || '' |
| | | param.userid = sessionStorage.getItem('CloudUserID') || '' |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | | param.userid = param.userid || sessionStorage.getItem('CloudUserID') || '' |
| | | param.LoginUID = param.LoginUID || sessionStorage.getItem('CloudLoginUID') || '' |
| | | |
| | | param = this.encryptParam(param) |
| | | |
| | |
| | | param.appkey = param.appkey || window.GLOB.appkey |
| | | |
| | | let url = '/webapi/dostars' |
| | | if (sessionStorage.getItem('isEditState') === 'true' && options.cloudServiceApi) { // 编辑状态,且存在云端地址 |
| | | if (window.GLOB.mkHS && options.cloudServiceApi) { // HS下,且存在云端地址 |
| | | url = options.cloudServiceApi |
| | | param.userid = sessionStorage.getItem('CloudUserID') || '' |
| | | param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' |
| | |
| | | param.appkey = param.appkey || window.GLOB.appkey || '' |
| | | |
| | | let url = '/webapi/dostars' |
| | | if (sessionStorage.getItem('isEditState') === 'true') { // 编辑状态,单点登录服务器为云端 |
| | | if (window.GLOB.mkHS) { // HS下,单点登录服务器为云端 |
| | | if (options.cloudServiceApi) { // 存在云端地址时,使用云端系统参数 |
| | | url = options.cloudServiceApi |
| | | param.userid = sessionStorage.getItem('CloudUserID') || '' |
| | |
| | | return new Promise(resolve => this.visitOuterSystem(param, resolve)) |
| | | } |
| | | |
| | | if (['sPC_Get_TableData', 'sPC_Get_TableData_debug', 'sPC_TableData_InUpDe', 'sPC_TableData_InUpDe_debug', 'sPC_Get_structured_data'].includes(param.func)) { |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | param.username = sessionStorage.getItem('CloudUserName') || '' |
| | | param.fullname = sessionStorage.getItem('CloudFullName') || '' |
| | | } else { |
| | | param.username = sessionStorage.getItem('User_Name') || '' |
| | | param.fullname = sessionStorage.getItem('Full_Name') || '' |
| | | } |
| | | if (['sPC_TableData_InUpDe', 'sPC_TableData_InUpDe_debug'].includes(param.func)) { |
| | | param.username = sessionStorage.getItem('User_Name') || '' |
| | | param.fullname = sessionStorage.getItem('Full_Name') || '' |
| | | } |
| | | |
| | | let login = false |
| | |
| | | loginVisible: true |
| | | }) |
| | | } else { |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | this.props.modifyMainMenu(null) |
| | | |
| | | this.props.history.replace('/design') |
| | |
| | | sessionStorage.setItem('CloudAvatar', res.icon) |
| | | sessionStorage.setItem('cloudDataM', res.dataM ? 'true' : '') |
| | | sessionStorage.setItem('cloudRole_id', res.role_id || '') |
| | | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | let _url = window.location.href.split('#')[0] + 'cloud' |
| | | if (param.remember) { |
| | |
| | | } |
| | | |
| | | getIcons = () => { |
| | | Api.getSystemConfig({ func: 's_get_icons' }).then(res => { |
| | | Api.getCloudConfig({ func: 's_get_icons' }).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | |
| | | state = { |
| | | activeId: '', |
| | | tabviews: null, // 标签集 |
| | | tabviews: [], |
| | | iFrameHeight: 0, |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | if (!window.GLOB.mkHS) { |
| | | this.setState({ |
| | | activeId: 'home_page_id', |
| | | tabviews: [{ |
| | | MenuID: 'home_page_id', |
| | | MenuName: '首页', |
| | | type: 'Home' |
| | | }] |
| | | }) |
| | | } |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.addListener('closeTabView', this.closeTabView) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.removeListener('closeTabView', this.closeTabView) |
| | | } |
| | | |
| | | // 关闭tab页,重新选择显示页 |
| | |
| | | } |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | if (sessionStorage.getItem('isEditState') !== 'true') { |
| | | this.setState({ |
| | | activeId: 'home_page_id', |
| | | tabviews: [{ |
| | | MenuID: 'home_page_id', |
| | | MenuName: '首页', |
| | | type: 'Home' |
| | | }] |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | activeId: '', |
| | | tabviews: [] |
| | | }) |
| | | } |
| | | } |
| | | |
| | | componentDidMount () { |
| | | MKEmitter.addListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.addListener('closeTabView', this.closeTabView) |
| | | } |
| | | |
| | | /** |
| | | * @description 组件销毁,清除state更新 |
| | | */ |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | MKEmitter.removeListener('modifyTabs', this.modifyTabs) |
| | | MKEmitter.removeListener('closeTabView', this.closeTabView) |
| | | } |
| | | |
| | | render () { |
| | | const { tabviews, activeId } = this.state |
| | | |
| | | return ( |
| | | <section id="mk-tabgroup-wrap" className={'mk-tabview-wrap' + (this.props.collapse ? ' collapsed' : '')}> |
| | | <div className="content-header"> |
| | | {tabviews && tabviews.length > 0 && |
| | | {tabviews.length > 0 && |
| | | <Tabs activeKey={activeId}> |
| | | {tabviews.map(view => { |
| | | return ( |
| | |
| | | loading: false |
| | | }) |
| | | |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_FrozenMenu', |
| | | ParentID: this.props.ParentId, |
| | | TYPE: +this.props.Type |
| | |
| | | }) |
| | | let defers = targetKeys.map(item => { |
| | | return new Promise((resolve) => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_MainMenu_ReDel', |
| | | MenuID: item |
| | | }).then(res => { |
| | |
| | | import '@/assets/css/action.scss' |
| | | import '@/assets/css/viewstyle.scss' |
| | | |
| | | if (window.location.href.indexOf('#/design') > -1) { // 编辑页面刷新时,跳转至主页 |
| | | window.location.replace(window.location.href.replace(/design/ig, 'main')) |
| | | } |
| | | |
| | | options.sysType = window.atob(options.sysType.replace('$mk', '')) |
| | | options.caId = window.atob(options.caId.replace('$mk', '')) |
| | | options.cakey = window.atob(options.cakey.replace('$mk', '')) |
| | | options.cdomain = window.atob(options.cdomain.replace('$mk', '')) |
| | | |
| | | if (options.cdomain && options.sysType !== 'cloud') { |
| | | options.cloudServiceApi = options.cdomain + '/webapi/dostars' |
| | | } |
| | | |
| | | if (!localStorage.getItem('SessionUid')) { |
| | | localStorage.setItem('SessionUid', (() => { |
| | | let uuid = [] |
| | |
| | | ) |
| | | } |
| | | |
| | | sessionStorage.removeItem('isEditState') |
| | | |
| | | fetch('../options.json') |
| | | .then(response => response.json()) |
| | | .catch(() => { |
| | |
| | | } |
| | | } |
| | | |
| | | if (options.cdomain && options.sysType !== 'cloud') { |
| | | options.cloudServiceApi = options.cdomain + '/webapi/dostars' |
| | | } |
| | | |
| | | let GLOB = {} |
| | | GLOB.appId = config.appId || '' |
| | | GLOB.lineColor = config.lineColor || '' |
| | |
| | | import React from 'react' |
| | | import { useDrag, useDrop } from 'react-dnd' |
| | | import { Select, DatePicker, Input, Popover, Form, Switch, Checkbox } from 'antd' |
| | | import { Select, Radio, DatePicker, Input, Popover, Form, Switch, Checkbox } from 'antd' |
| | | import { CopyOutlined, EditOutlined, CloseOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | |
| | | _defaultValue = [moment().startOf('week'), moment().endOf('week')] |
| | | } else if (card.initval === 'month') { |
| | | _defaultValue = [moment().startOf('month'), moment().endOf('month')] |
| | | } else if (card.initval === 'lastMonth') { |
| | | _defaultValue = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] |
| | | } else if (card.initval) { |
| | | try { |
| | | let _initval = JSON.parse(card.initval) |
| | |
| | | formItem = <CheckCard config={card} /> |
| | | } else if (card.type === 'switch') { |
| | | formItem = (<Switch checkedChildren={card.openText || ''} unCheckedChildren={card.closeText || ''} style={{marginTop: '8px'}} 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> |
| | | } |
| | |
| | | { pattern: formRule.func.pattern, message: formRule.func.message }, |
| | | { max: formRule.func.max, message: formRule.func.maxMessage } |
| | | ) |
| | | } else if (item.key === 'outerBlacklist') { |
| | | rules.push( |
| | | { max: 512, message: '最多512个字符' } |
| | | ) |
| | | } else if (item.key === 'output') { |
| | | if (this.record.intertype === 'system' || ((this.record.intertype === 'outer' || this.record.intertype === 'custom') && this.record.callbackType === 'script')) { |
| | | rules = [{ |
| | |
| | | _defaultValue = [moment().startOf('week'), moment().endOf('week')] |
| | | } else if (card.initval === 'month') { |
| | | _defaultValue = [moment().startOf('month'), moment().endOf('month')] |
| | | } else if (card.initval === 'lastMonth') { |
| | | _defaultValue = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] |
| | | } else if (card.initval) { |
| | | try { |
| | | let _initval = JSON.parse(card.initval) |
| | |
| | | res.id = Utils.getuuid() |
| | | } |
| | | |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_url_db_adduptdel', |
| | | id: res.id, |
| | | PageIndex: 0, // 0 代表全部 |
| | |
| | | |
| | | Api.fileuploadbase64(param).then(result => { |
| | | if (result.status) { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_custom_components_adduptdel', |
| | | c_id: config.uuid, |
| | | images: Utils.getcloudurl(result.Images), |
| | |
| | | |
| | | _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(_sParam).then(res => { |
| | | Api.getCloudConfig(_sParam).then(res => { |
| | | if (res.status) { |
| | | let _scripts = res.data.map(item => { |
| | | return { |
| | |
| | | |
| | | _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(_sParam).then(res => { |
| | | Api.getCloudConfig(_sParam).then(res => { |
| | | if (res.status) { |
| | | let _scripts = res.data.map(item => { |
| | | return { |
| | |
| | | content: '', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_custom_components_adduptdel', |
| | | c_id: item.uuid, |
| | | images: '', |
| | |
| | | res.id = Utils.getuuid() |
| | | } |
| | | |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_url_db_adduptdel', |
| | | id: res.id, |
| | | PageIndex: 0, // 0 代表全部 |
| | |
| | | content: '', |
| | | onOk() { |
| | | return new Promise((resolve) => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_url_db_adduptdel', |
| | | id: item.id, |
| | | PageIndex: 0, // 0 代表全部 |
| | |
| | | MenuID: config.uuid |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | _resolve() |
| | | if (!res.status) { |
| | | Modal.warning({ |
| | |
| | | par_menuid: MenuId |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | content: '', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_custom_components_adduptdel', |
| | | c_id: item.uuid, |
| | | images: '', |
| | |
| | | </div> |
| | | </div> |
| | | </div>) |
| | | // } else if (card.type === 'daterange') { |
| | | // let value = '请选择' |
| | | // if (card.initval === 'week') { |
| | | // value = [moment().startOf('week').format('YYYY-MM-DD'), moment().endOf('week').format('YYYY-MM-DD')].join(' ~ ') |
| | | // } else if (card.initval === 'month') { |
| | | // value = [moment().startOf('month').format('YYYY-MM-DD'), moment().endOf('month').format('YYYY-MM-DD')].join(' ~ ') |
| | | // } else if (card.initval) { |
| | | // try { |
| | | // let _initval = JSON.parse(card.initval) |
| | | // value = [moment().subtract(_initval[0], 'days').format('YYYY-MM-DD'), moment().subtract(_initval[1], 'days').format('YYYY-MM-DD')].join(' ~ ') |
| | | // } catch (e) { |
| | | // value = '请选择' |
| | | // } |
| | | // } |
| | | // formItem = (<div className="am-list-item"> |
| | | // <div className="am-list-line"> |
| | | // {card.labelShow !== 'false' ? <div className="am-input-label">{card.label}</div> : null} |
| | | // <div className="am-input-control">{value}</div> |
| | | // <div className="am-list-extra"><RightOutlined /></div> |
| | | // </div> |
| | | // </div>) |
| | | } else if (card.type === 'checkcard') { |
| | | formItem = (<div className="am-list-item check-card"> |
| | | <div className="am-list-line"> |
| | |
| | | if (!res.copymenuId) { |
| | | param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config))) |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | this.props.resetmenu() |
| | | }) |
| | | } else { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | typename: sessionStorage.getItem('typename') || 'pc', |
| | |
| | | |
| | | param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config))) |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | content: '', |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_custom_components_adduptdel', |
| | | c_id: item.uuid, |
| | | images: '', |
| | |
| | | return |
| | | } |
| | | |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | typename: sessionStorage.getItem('typename') || 'pc', |
| | |
| | | * @description 系统信息 |
| | | * 1、yun ( Y2xv$mkdWQ= ) 、 dandian ( U1$mkNP ) 、 yewu ( bG9j$mkYWw= ) |
| | | * 2、window.btoa('') 域名 不带 / |
| | | * 3、baoshide old ( aHR0cDovL2Nsb3VkLnBv$mkc2l0ZWNncm91cC5jb206ODA4MA== ) |
| | | * 4、positecgroup ( aHR0cHM6Ly9jbG91ZC5$mkwb3NpdGVjZ3JvdXAuY29t ) |
| | | * 3、positecgroup ( aHR0cHM6Ly9jbG91ZC5$mkwb3NpdGVjZ3JvdXAuY29t ) |
| | | */ |
| | | export default { |
| | | sysType: 'bG9j$mkYWw=', |
| | | caId: 'MjAyMDAxMTYxMjMzMzU1MDd$mkGQzkyMzI1Rjk4MDY0QUNGQjQ2Mg==', |
| | | cakey: 'MjAyMDAxMTYxMjQwMDQ2NDM$mk2N0QzODE2MjExNUI0MTc4OTVDMQ==', |
| | | cdomain: 'aHR0cHM6Ly9jbG91ZC5$mkwb3NpdGVjZ3JvdXAuY29t' |
| | | sysType: window.atob('bG9j$mkYWw='.replace('$mk', '')), |
| | | caId: window.atob('MjAyMDAxMTYxMjMzMzU1MDd$mkGQzkyMzI1Rjk4MDY0QUNGQjQ2Mg=='.replace('$mk', '')), |
| | | cakey: window.atob('MjAyMDAxMTYxMjQwMDQ2NDM$mk2N0QzODE2MjExNUI0MTc4OTVDMQ=='.replace('$mk', '')), |
| | | cdomain: window.atob('aHR0cHM6Ly9jbG91ZC5$mkwb3NpdGVjZ3JvdXAuY29t'.replace('$mk', '')) |
| | | } |
| | | |
| | | /** |
| | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let regs = [ |
| | | { reg: /@userName@/ig, value: `'${userName}'` }, |
| | | { reg: /@fullName@/ig, value: `'${fullName}'` } |
| | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let regs = [ |
| | | { reg: /@userName@/ig, value: `'${userName}'` }, |
| | | { reg: /@fullName@/ig, value: `'${fullName}'` } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Spin, Tooltip, message, Modal, notification } from 'antd' |
| | | import { Spin, Tooltip, message, Modal, notification, Switch } from 'antd' |
| | | import { UndoOutlined, RedoOutlined, VerticalAlignTopOutlined, VerticalAlignBottomOutlined, SaveOutlined, ZoomInOutlined, ZoomOutOutlined, OneToOneOutlined, QuestionCircleOutlined, ClearOutlined } from '@ant-design/icons' |
| | | import { Graph, Shape } from '@antv/x6' |
| | | import { Stencil } from '@antv/x6-plugin-stencil' |
| | |
| | | { |
| | | inherit: 'rect', |
| | | width: 66, |
| | | height: 36, |
| | | height: 40, |
| | | attrs: { |
| | | body: { |
| | | strokeWidth: 1, |
| | |
| | | { |
| | | inherit: 'polygon', |
| | | width: 66, |
| | | height: 36, |
| | | height: 40, |
| | | attrs: { |
| | | body: { |
| | | strokeWidth: 1, |
| | |
| | | { |
| | | inherit: 'polygon', |
| | | width: 66, |
| | | height: 36, |
| | | height: 40, |
| | | attrs: { |
| | | body: { |
| | | strokeWidth: 1, |
| | |
| | | 'mk-circle', |
| | | { |
| | | inherit: 'circle', |
| | | width: 36, |
| | | height: 36, |
| | | width: 40, |
| | | height: 40, |
| | | attrs: { |
| | | body: { |
| | | strokeWidth: 1, |
| | |
| | | { |
| | | inherit: 'ellipse', |
| | | width: 66, |
| | | height: 36, |
| | | height: 40, |
| | | attrs: { |
| | | body: { |
| | | strokeWidth: 1, |
| | |
| | | 'mk-star', |
| | | { |
| | | inherit: 'polygon', |
| | | width: 36, |
| | | height: 36, |
| | | width: 40, |
| | | height: 40, |
| | | points: '100,10 40,198 190,78 10,78 160,198', |
| | | attrs: { |
| | | body: { |
| | |
| | | { |
| | | inherit: 'text-block', |
| | | width: 66, |
| | | height: 36, |
| | | height: 40, |
| | | text: '文本域', |
| | | attrs: { |
| | | body: { |
| | |
| | | editing: false, |
| | | node: null, |
| | | loading: false, |
| | | rolelist: [] |
| | | status: 0, |
| | | orgs: [] |
| | | } |
| | | |
| | | selectNode = null |
| | |
| | | this.loadData() |
| | | |
| | | if (_config.plot.function === 'edit') { |
| | | this.getrolelist() |
| | | this.getorganizations() |
| | | } |
| | | }) |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | getrolelist = () => { |
| | | Api.getSystemConfig({func: 's_get_rolelist', OrderCol: 'RoleID desc', PageIndex: 1, PageSize: 1000}).then(res => { |
| | | getorganizations = () => { |
| | | Api.genericInterface({func: 's_get_organizations_v1'}).then(res => { |
| | | if (!res.status) { |
| | | notification.error({ |
| | | top: 92, |
| | |
| | | return |
| | | } |
| | | |
| | | this.setState({rolelist: res.data || []}) |
| | | let orgs = [] |
| | | res.organizations && res.organizations.forEach(com => { |
| | | let _com = { |
| | | key: com.OrgCode, |
| | | title: com.OrgName, |
| | | shortName: com.ShortName, |
| | | checkable: false, |
| | | disabled: true, |
| | | children: [] |
| | | } |
| | | |
| | | com.departments.forEach(dep => { |
| | | let _dep = { |
| | | key: dep.co_pro_code, |
| | | title: dep.co_pro_name, |
| | | checkable: false, |
| | | disabled: true, |
| | | children: [] |
| | | } |
| | | |
| | | dep.jobs.forEach(job => { |
| | | let _job = { |
| | | key: job.jobcode, |
| | | title: job.jobname, |
| | | checkable: false, |
| | | disabled: true, |
| | | children: [] |
| | | } |
| | | |
| | | job.work_group.forEach(group => { |
| | | if (group.work_group === 'normal') { |
| | | group.workers.forEach(work => { |
| | | let _work = { |
| | | key: work.worker_id, |
| | | title: work.workername, |
| | | email: work.email || '', |
| | | images: work.images || '', |
| | | mob: work.mob || '', |
| | | sex: work.sex || '', |
| | | work_grade: work.work_grade || '', |
| | | worker_id: work.worker_id || '', |
| | | workercode: work.workercode || '', |
| | | workername: work.workername || '', |
| | | } |
| | | |
| | | _job.children.push(_work) |
| | | }) |
| | | } else { |
| | | let _group = { |
| | | key: group.work_group, |
| | | title: group.work_group, |
| | | checkable: false, |
| | | disabled: true, |
| | | children: [] |
| | | } |
| | | |
| | | group.workers.forEach(work => { |
| | | let _work = { |
| | | key: work.worker_id, |
| | | title: work.workername, |
| | | email: work.email || '', |
| | | images: work.images || '', |
| | | mob: work.mob || '', |
| | | sex: work.sex || '', |
| | | work_grade: work.work_grade || '', |
| | | worker_id: work.worker_id || '', |
| | | workercode: work.workercode || '', |
| | | workername: work.workername || '', |
| | | } |
| | | |
| | | _group.children.push(_work) |
| | | }) |
| | | |
| | | if (_group.children.length > 0) { |
| | | _job.children.push(_group) |
| | | } |
| | | } |
| | | }) |
| | | |
| | | if (_job.children.length > 0) { |
| | | _dep.children.push(_job) |
| | | } |
| | | }) |
| | | |
| | | if (_dep.children.length > 0) { |
| | | _com.children.push(_dep) |
| | | } |
| | | }) |
| | | |
| | | if (_com.children.length > 0) { |
| | | orgs.push(_com) |
| | | } |
| | | }) |
| | | |
| | | this.setState({orgs: orgs}) |
| | | }) |
| | | } |
| | | |
| | |
| | | this.handleData() |
| | | |
| | | this.setState({ |
| | | status: item.status || 0, |
| | | loading: false |
| | | }) |
| | | |
| | |
| | | groups: [ |
| | | { |
| | | title: '通用节点', |
| | | name: 'group1' |
| | | name: 'group1', |
| | | graphHeight: 240 |
| | | }, |
| | | { |
| | | title: '自定义', |
| | |
| | | |
| | | const r1 = graph.createNode({ |
| | | shape: 'mk-rect', |
| | | label: '开始', |
| | | mknode: 'start', |
| | | mkdata: {status: 0, statusName: '开始'}, |
| | | attrs: { |
| | | body: { |
| | | rx: 20, |
| | | ry: 26 |
| | | ry: 26, |
| | | fill: '#52c41a', |
| | | stroke: '#52c41a' |
| | | }, |
| | | text: { |
| | | fill: '#ffffff', |
| | | text: '开始' |
| | | } |
| | | } |
| | | }) |
| | | const r2 = graph.createNode({ |
| | | shape: 'mk-rect', |
| | | label: '过程' |
| | | attrs: { |
| | | body: { |
| | | rx: 20, |
| | | ry: 26, |
| | | fill: '#e6f4ff', |
| | | stroke: '#1890ff' |
| | | }, |
| | | text: { |
| | | text: '过程' |
| | | } |
| | | } |
| | | }) |
| | | const r3 = graph.createNode({ |
| | | shape: 'mk-rect', |
| | | attrs: { |
| | | body: { |
| | | rx: 6, |
| | | ry: 6 |
| | | ry: 6, |
| | | fill: '#fff7e6', |
| | | stroke: '#fa8c16' |
| | | }, |
| | | text: { |
| | | text: '可选过程' |
| | | } |
| | | }, |
| | | label: '可选过程' |
| | | } |
| | | }) |
| | | const r4 = graph.createNode({ |
| | | shape: 'mk-rect', |
| | | attrs: { |
| | | body: { |
| | | rx: 0, |
| | | ry: 0, |
| | | fill: '#fff7e6', |
| | | stroke: '#fa8c16' |
| | | }, |
| | | text: { |
| | | text: '节点' |
| | | } |
| | | } |
| | | }) |
| | | const r5 = graph.createNode({ |
| | | shape: 'mk-polygon', |
| | | attrs: { |
| | | body: { |
| | | refPoints: '0,10 10,0 20,10 10,20' |
| | | refPoints: '0,10 10,0 20,10 10,20', |
| | | fill: '#f9f0ff', |
| | | stroke: '#722ed1' |
| | | }, |
| | | text: { |
| | | text: '决策' |
| | | } |
| | | }, |
| | | label: '决策' |
| | | } |
| | | }) |
| | | const r5 = graph.createNode({ |
| | | const r6 = graph.createNode({ |
| | | shape: 'mk-paral', |
| | | attrs: { |
| | | body: { |
| | | refPoints: '10,0 40,0 30,20 0,20' |
| | | refPoints: '10,0 40,0 30,20 0,20', |
| | | fill: '#e6fffb', |
| | | stroke: '#13c2c2' |
| | | }, |
| | | text: { |
| | | text: '数据' |
| | | } |
| | | }, |
| | | label: '数据' |
| | | } |
| | | }) |
| | | const r6 = graph.createNode({ |
| | | const r7 = graph.createNode({ |
| | | shape: 'mk-circle', |
| | | label: '连接' |
| | | attrs: { |
| | | body: { |
| | | fill: '#e6f4ff', |
| | | stroke: '#1890ff' |
| | | }, |
| | | text: { |
| | | text: '连接' |
| | | } |
| | | } |
| | | }) |
| | | |
| | | const r8 = graph.createNode({ |
| | | shape: 'mk-rect', |
| | | mknode: 'end', |
| | | mkdata: {status: '', statusName: '结束'}, |
| | | attrs: { |
| | | body: { |
| | | rx: 20, |
| | | ry: 26, |
| | | fill: '#fa8c16', |
| | | stroke: '#fa8c16' |
| | | }, |
| | | text: { |
| | | fill: '#ffffff', |
| | | text: '结束' |
| | | } |
| | | } |
| | | }) |
| | | |
| | | stencil.load([r1, r2, r3, r4, r5, r6], 'group1') |
| | | stencil.load([r1, r2, r3, r4, r5, r6, r7, r8], 'group1') |
| | | |
| | | const p1 = graph.createNode({ |
| | | shape: 'mk-ellipse', |
| | |
| | | } |
| | | |
| | | save = () => { |
| | | const { BID } = this.state |
| | | const { BID, plot, status } = this.state |
| | | |
| | | if (!BID) { |
| | | Modal.error({ |
| | |
| | | return |
| | | } |
| | | |
| | | let nodes = this.mkGraph.toJSON() |
| | | let _status = status |
| | | |
| | | if (plot.subtype === 'xflow' && status === 10) { |
| | | let start_num = nodes.cells.filter(cell => cell.mknode === 'start').length |
| | | let end_num = nodes.cells.filter(cell => cell.mknode === 'end').length |
| | | |
| | | if (start_num !== 1 || end_num !== 1) { |
| | | _status = 0 |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | |
| | | let nodes = this.mkGraph.toJSON() |
| | | this.mkGraph.toPNG((dataUri) => { |
| | | let param = { |
| | | func: 's_works_flow_param_upt_v6', |
| | | long_param: window.btoa(window.encodeURIComponent(JSON.stringify(nodes))), |
| | | flow_image: dataUri, |
| | | status: status, |
| | | ID: BID, |
| | | BID: '' |
| | | } |
| | |
| | | message: '保存成功!', |
| | | duration: 2 |
| | | }) |
| | | this.setState({ |
| | | loading: false, |
| | | status: _status |
| | | }) |
| | | } else { |
| | | notification.error({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | }) |
| | | }, {padding: 20}) |
| | | } |
| | |
| | | } else { |
| | | this.selectNode.attr('line/strokeDasharray', 0) |
| | | } |
| | | } else if (key === 'mkdata') { |
| | | this.selectNode.prop('mkdata', value) |
| | | } |
| | | } else if (node.shape === 'lane') { |
| | | if (key === 'title') { |
| | |
| | | this.selectNode.attr('text/fontSize', value) |
| | | } else if (key === 'fontFill') { |
| | | this.selectNode.attr('text/fill', value) |
| | | } else if (key === 'mksign') { |
| | | this.selectNode.prop('mksign', value) |
| | | } else if (key === 'mkdata') { |
| | | this.selectNode.prop('mkdata', value) |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | changeStatus = () => { |
| | | const { plot, status } = this.state |
| | | |
| | | let _status = status === 10 ? 0 : 10 |
| | | |
| | | if (plot.subtype === 'xflow' && _status === 10) { |
| | | let nodes = this.mkGraph.toJSON() |
| | | let start_num = nodes.cells.filter(cell => cell.mknode === 'start').length |
| | | let end_num = nodes.cells.filter(cell => cell.mknode === 'end').length |
| | | |
| | | if (start_num === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请添加开始节点!', |
| | | duration: 2 |
| | | }) |
| | | } else if (start_num > 1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '开始节点不可添加多个!', |
| | | duration: 2 |
| | | }) |
| | | } else if (end_num === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请添加结束节点!', |
| | | duration: 2 |
| | | }) |
| | | } else if (end_num > 1) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '结束节点不可添加多个!', |
| | | duration: 2 |
| | | }) |
| | | } else { |
| | | this.setState({status: _status}) |
| | | } |
| | | } else { |
| | | this.setState({status: _status}) |
| | | } |
| | | } |
| | | |
| | | resetlane = (id, x, offset) => { |
| | | let nodes = this.mkGraph.getNodes() |
| | | |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { loading, config, node, rolelist } = this.state |
| | | const { loading, config, node, orgs, status } = this.state |
| | | |
| | | let style = {...config.style} |
| | | |
| | |
| | | </Tooltip> |
| | | </div> |
| | | <div className="right-tool"> |
| | | <Tooltip title="启用/停用"> |
| | | <Switch size="small" style={{marginRight: '10px'}} checked={status === 10} onChange={this.changeStatus} /> |
| | | </Tooltip> |
| | | <Tooltip title="保存"> |
| | | <SaveOutlined onClick={this.save}/> |
| | | <SaveOutlined style={{marginRight: '10px'}} onClick={this.save}/> |
| | | </Tooltip> |
| | | </div> |
| | | </div> |
| | |
| | | <div id={config.uuid + 'container'} className="mk-container"></div> |
| | | <div className="mk-node-edit"> |
| | | <div className="header">设置</div> |
| | | {!node ? <div className="empty">未选中</div> : <NodeUpdate node={node} rolelist={rolelist} onChange={this.changeProps}/>} |
| | | {!node ? <div className="empty">未选中</div> : <NodeUpdate node={node} orgs={orgs} onChange={this.changeProps}/>} |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Form, Row, Col, Input, Select, Radio, InputNumber } from 'antd' |
| | | import { Form, Row, Col, Input, Select, Radio, InputNumber, Modal } from 'antd' |
| | | import { FormOutlined } from '@ant-design/icons' |
| | | |
| | | import ColorSketch from '@/mob/colorsketch' |
| | | |
| | | import NodeForm from './nodeform' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | |
| | | class NodeUpdate extends Component { |
| | | static propTpyes = { |
| | | node: PropTypes.object, |
| | | rolelist: PropTypes.array |
| | | orgs: PropTypes.array |
| | | } |
| | | |
| | | state = { |
| | | formlist: null |
| | | formlist: null, |
| | | mknode: null, |
| | | mkdata: null |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | this.setState({ |
| | | mknode: this.props.node, |
| | | mkdata: this.props.node.mkdata || '', |
| | | formlist: this.getFormList(this.props.node) |
| | | }) |
| | | } |
| | |
| | | formlist: null |
| | | }, () => { |
| | | this.setState({ |
| | | mknode: nextProps.node, |
| | | mkdata: nextProps.node.mkdata || '', |
| | | formlist: this.getFormList(nextProps.node) |
| | | }) |
| | | }) |
| | |
| | | field: 'fontFill', |
| | | label: '颜色', |
| | | initval: font.fill || '#000000' |
| | | }, |
| | | { |
| | | type: 'other', |
| | | label: '自定义信息' |
| | | } |
| | | ] |
| | | } else if (node.shape === 'lane') { |
| | |
| | | initval: fontFill |
| | | }, |
| | | { |
| | | type: 'title', |
| | | type: 'other', |
| | | label: '自定义信息' |
| | | }, |
| | | { |
| | | type: 'text', |
| | | field: 'mksign', |
| | | label: '标记', |
| | | initval: node.mksign || '' |
| | | }, |
| | | { |
| | | type: 'select', |
| | | field: 'mkroleid', |
| | | label: '角色', |
| | | initval: node.mkroleid || '', |
| | | options: this.props.rolelist.map(item => ({value: item.RoleID, text: item.RoleName})) |
| | | }, |
| | | } |
| | | ] |
| | | } |
| | | } |
| | |
| | | this.props.onChange(value, key) |
| | | } |
| | | |
| | | confirm = () => { |
| | | this.nodeRef.handleConfirm().then(res => { |
| | | this.setState({visible: false, mkdata: res}) |
| | | this.props.onChange(res, 'mkdata') |
| | | }) |
| | | } |
| | | |
| | | getFields() { |
| | | const { formlist } = this.state |
| | | const { formlist, mkdata, mknode } = this.state |
| | | const fields = [] |
| | | |
| | | if (!formlist) return |
| | |
| | | </Form.Item> |
| | | </Col> |
| | | ) |
| | | } else if (item.type === 'other') { |
| | | fields.push( |
| | | <Col span={24} key={index}> |
| | | <span className="split-line">{item.label}:<FormOutlined onClick={() => {this.setState({visible: true})}}/></span> |
| | | {mkdata ? <div className="mk-data"> |
| | | <div>状态:{mkdata.status}<span style={{float: 'right'}}>{mkdata.statusName}</span></div> |
| | | {mknode.shape !== 'edge' && !mknode.mknode ? <div>标记:{mkdata.sign || ''}</div> : null} |
| | | {mkdata.roleId ? <div>角色:{mkdata.roleName || ''}</div> : null} |
| | | {mkdata.depId ? <div>部门:{mkdata.depName || ''}</div> : null} |
| | | <div>备注:{mkdata.remark || ''}</div> |
| | | </div> : null} |
| | | </Col> |
| | | ) |
| | | } |
| | | }) |
| | | return fields |
| | | } |
| | | |
| | | render() { |
| | | const { visible, mkdata, mknode } = this.state |
| | | |
| | | return ( |
| | | <div className="node-edit-form-wrap"> |
| | | <Form className="node-edit-form"> |
| | | <Row>{this.getFields()}</Row> |
| | | </Form> |
| | | <Modal |
| | | title="节点编辑" |
| | | visible={visible} |
| | | closable={false} |
| | | maskClosable={false} |
| | | width={1000} |
| | | onOk={this.confirm} |
| | | onCancel={() => this.setState({visible: false})} |
| | | destroyOnClose |
| | | > |
| | | <NodeForm node={mknode} data={mkdata} orgs={this.props.orgs} handleSubmit={() => this.confirm()} wrappedComponentRef={(inst) => this.nodeRef = inst}/> |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | padding-bottom: 2px; |
| | | font-size: 13px; |
| | | } |
| | | .mk-data { |
| | | font-size: 13px; |
| | | padding: 0 12px; |
| | | >div { |
| | | padding-bottom: 2px; |
| | | } |
| | | } |
| | | textarea.ant-input { |
| | | padding: 0px 4px; |
| | | border-radius: 0px; |
| | |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | |
| | | .normal-node-form { |
| | | >.ant-row >.ant-col-24 { |
| | | .ant-form-item-label { |
| | | width: 16%; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | width: 84%; |
| | | } |
| | | } |
| | | .member-input { |
| | | display: inline-block; |
| | | width: 100%; |
| | | height: 32px; |
| | | padding: 4px 11px; |
| | | color: rgba(0, 0, 0, 0.65); |
| | | font-size: 14px; |
| | | line-height: 1.5; |
| | | background-color: #fff; |
| | | background-image: none; |
| | | border: 1px solid #d9d9d9; |
| | | border-radius: 4px; |
| | | |
| | | .anticon-form { |
| | | float: right; |
| | | margin-top: 3px; |
| | | } |
| | | } |
| | | } |
| | | .member-transfer { |
| | | .ant-transfer-list:first-child { |
| | | width: 60%; |
| | | } |
| | | .ant-transfer-list:last-child { |
| | | width: 40%; |
| | | } |
| | | .ant-transfer-list-header { |
| | | .ant-transfer-list-header-selected { |
| | | span:not(.ant-transfer-list-header-title) { |
| | | display: none; |
| | | } |
| | | .ant-transfer-list-header-title { |
| | | position: unset; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .member-modal { |
| | | .ant-modal { |
| | | top: 50px; |
| | | } |
| | | .ant-modal-body { |
| | | min-height: 150px; |
| | | max-height: calc(100vh - 200px); |
| | | overflow-y: auto; |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar { |
| | | width: 7px; |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar-thumb { |
| | | border-radius: 5px; |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.13); |
| | | background: rgba(0, 0, 0, 0.13); |
| | | } |
| | | .ant-modal-body::-webkit-scrollbar-track { |
| | | box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05); |
| | | border-radius: 3px; |
| | | border: 1px solid rgba(0, 0, 0, 0.07); |
| | | background: rgba(0, 0, 0, 0); |
| | | } |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Modal, Transfer, Tree } from 'antd' |
| | | import { FormOutlined } from '@ant-design/icons' |
| | | |
| | | const { TreeNode } = Tree |
| | | |
| | | const isChecked = (selectedKeys, eventKey) => { |
| | | return selectedKeys.indexOf(eventKey) !== -1 |
| | | } |
| | | |
| | | const generateTree = (treeNodes = [], checkedKeys = []) => { |
| | | return treeNodes.map(({ children, ...props }) => ( |
| | | <TreeNode {...props} disabled={checkedKeys.includes(props.key)} key={props.key}> |
| | | {generateTree(children, checkedKeys)} |
| | | </TreeNode> |
| | | )) |
| | | } |
| | | |
| | | const TreeTransfer = ({ dataSource, targetKeys, ...restProps }) => { |
| | | const transferDataSource = [] |
| | | function flatten(list = []) { |
| | | list.forEach(item => { |
| | | transferDataSource.push(item) |
| | | flatten(item.children) |
| | | }) |
| | | } |
| | | flatten(dataSource) |
| | | |
| | | return ( |
| | | <Transfer |
| | | {...restProps} |
| | | targetKeys={targetKeys} |
| | | dataSource={transferDataSource} |
| | | className="member-transfer" |
| | | titles={['全部人员', '已选']} |
| | | render={item => item.title} |
| | | showSelectAll={false} |
| | | > |
| | | {({ direction, onItemSelect, selectedKeys }) => { |
| | | if (direction === 'left') { |
| | | const checkedKeys = [...selectedKeys, ...targetKeys] |
| | | return ( |
| | | <Tree |
| | | blockNode |
| | | checkable |
| | | checkStrictly |
| | | defaultExpandAll |
| | | checkedKeys={checkedKeys} |
| | | onCheck={(_, { node: { props: { eventKey } } }) => { |
| | | onItemSelect(eventKey, !isChecked(checkedKeys, eventKey)) |
| | | }} |
| | | onSelect={(_, { node: { props: { eventKey } } }) => { |
| | | onItemSelect(eventKey, !isChecked(checkedKeys, eventKey)) |
| | | }} |
| | | > |
| | | {generateTree(dataSource, targetKeys)} |
| | | </Tree> |
| | | ) |
| | | } |
| | | }} |
| | | </Transfer> |
| | | ) |
| | | } |
| | | |
| | | class MemberForm extends Component { |
| | | static propTpyes = { |
| | | node: PropTypes.any, |
| | | data: PropTypes.any, |
| | | orgs: PropTypes.array |
| | | } |
| | | |
| | | state = { |
| | | visible: false, |
| | | targetKeys: ['sifuweoifuweifuo'] |
| | | } |
| | | |
| | | onChange = targetKeys => { |
| | | this.setState({ targetKeys }) |
| | | } |
| | | |
| | | render() { |
| | | const { orgs } = this.props |
| | | const { visible, targetKeys } = this.state |
| | | |
| | | return ( |
| | | <> |
| | | <div className="member-input">0人<FormOutlined onClick={() => this.setState({visible: true})} /></div> |
| | | <Modal |
| | | wrapClassName="member-modal" |
| | | title="选择人员" |
| | | visible={visible} |
| | | closable={false} |
| | | maskClosable={false} |
| | | width={1000} |
| | | onOk={this.confirm} |
| | | onCancel={() => this.setState({visible: false})} |
| | | destroyOnClose |
| | | > |
| | | <TreeTransfer dataSource={orgs} targetKeys={targetKeys} onChange={this.onChange} /> |
| | | </Modal> |
| | | </> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default MemberForm |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Radio, Tooltip, InputNumber } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | |
| | | import MemberForm from './memberform' |
| | | const { TextArea } = Input |
| | | |
| | | class NodeForm extends Component { |
| | | static propTpyes = { |
| | | node: PropTypes.any, |
| | | data: PropTypes.any, |
| | | orgs: PropTypes.array |
| | | } |
| | | |
| | | state = {} |
| | | |
| | | handleConfirm = () => { |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | const { node, orgs } = this.props |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | } |
| | | } |
| | | let data = this.props.data || {} |
| | | let nodetype = node.shape !== 'edge' ? 'node' : 'edge' |
| | | if (node.mknode === 'start') { |
| | | nodetype = 'start' |
| | | } else if (node.mknode === 'end') { |
| | | nodetype = 'end' |
| | | } |
| | | |
| | | return ( |
| | | <Form {...formItemLayout} className="normal-node-form"> |
| | | <Row gutter={24}> |
| | | <Col span={12}> |
| | | <Form.Item label="状态值"> |
| | | {getFieldDecorator('status', { |
| | | initialValue: data.status === undefined ? 0 : data.status, |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请输入状态值!' |
| | | } |
| | | ] |
| | | })( |
| | | <InputNumber precision={0}/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="状态名"> |
| | | {getFieldDecorator('statusName', { |
| | | initialValue: data.statusName || '' |
| | | })( |
| | | <Input placeholder="" autoComplete="off"/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | {nodetype === 'node' ? <Col span={12}> |
| | | <Form.Item label={ |
| | | <Tooltip placement="topLeft" title="标记将作为节点ID"> |
| | | <QuestionCircleOutlined className="mk-form-tip" /> |
| | | 标记 |
| | | </Tooltip> |
| | | }> |
| | | {getFieldDecorator('sign', { |
| | | initialValue: data.sign || '' |
| | | })( |
| | | <Input placeholder="" autoComplete="off"/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {nodetype === 'node' ? <Col span={12}> |
| | | <Form.Item label="审批人"> |
| | | {getFieldDecorator('approver', { |
| | | initialValue: data.approver || 'member' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="member">指定成员</Radio> |
| | | <Radio value="departmentManager">部门主管</Radio> |
| | | <Radio value="directManager">直属主管</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | {nodetype === 'node' ? <Col span={12}> |
| | | <Form.Item label="审批方式"> |
| | | {getFieldDecorator('approvalMethod', { |
| | | initialValue: data.approvalMethod || 'countersign' |
| | | })( |
| | | <Radio.Group> |
| | | <Radio value="countersign">会签</Radio> |
| | | <Radio value="orsign">或签</Radio> |
| | | </Radio.Group> |
| | | )} |
| | | </Form.Item> |
| | | </Col> : null} |
| | | <Col span={12}> |
| | | <Form.Item label="人员"> |
| | | {getFieldDecorator('roleId', { |
| | | initialValue: data.roleId || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: '请选择人员!' |
| | | } |
| | | ] |
| | | })( |
| | | <MemberForm orgs={orgs}/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={12}> |
| | | <Form.Item label="抄送"> |
| | | {getFieldDecorator('depId', { |
| | | initialValue: data.depId || '' |
| | | })( |
| | | <MemberForm orgs={orgs}/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="备注"> |
| | | {getFieldDecorator('remark', { |
| | | initialValue: data.remark || '' |
| | | })( |
| | | <TextArea rows={2}/> |
| | | )} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default Form.create()(NodeForm) |
| | |
| | | <Col span={12}> |
| | | <Form.Item label="文件夹"> |
| | | {getFieldDecorator('data_code', { |
| | | initialValue: '', |
| | | initialValue: files[0] ? files[0].data_code : '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | |
| | | return <div className="attach-item" key={item.id}> |
| | | <img src={item.icon} alt=""/> |
| | | <div className="attach-msg"> |
| | | <div>{item.attachments_title}</div> |
| | | <div>{item.data_name ? item.data_name + ' / ' : ''}{item.attachments_url}</div> |
| | | {/* <div>{item.attachments_title}</div> */} |
| | | <div>{item.data_name ? item.data_name + ' / ' : ''}{item.attachments_title}</div> |
| | | </div> |
| | | <div> |
| | | <DeleteOutlined onClick={() => this.deleteFile(item.id)}/> |
| | |
| | | flex: 1; |
| | | width: calc(100% - 95px); |
| | | padding: 5px 0px; |
| | | line-height: 45px; |
| | | div { |
| | | color: #000000; |
| | | overflow: hidden; |
| | |
| | | let rowspans = [] |
| | | let orderfields = {} |
| | | |
| | | if (window.GLOB.dataFormat && !window.GLOB.mkHS) { |
| | | if (window.GLOB.dataFormat) { |
| | | _format = true |
| | | |
| | | if (window.GLOB.memberLevel >= 30) { |
| | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let regs = [ |
| | | { reg: /@userName@/ig, value: `'${userName}'` }, |
| | | { reg: /@fullName@/ig, value: `'${fullName}'` } |
| | |
| | | |
| | | let _searchId = searchId |
| | | |
| | | tab.components.forEach(cell => { |
| | | if (cell.type !== 'search') return |
| | | _searchId = cell.uuid |
| | | window.GLOB.SearchBox.set(cell.uuid, cell.$searches) |
| | | if (cell.$s_req) { |
| | | window.GLOB.SearchBox.set(cell.uuid + 'required', true) |
| | | } |
| | | }) |
| | | if (tab.components.findIndex(cell => cell.type === 'search') > -1) { |
| | | _searchId = tab.uuid |
| | | } |
| | | |
| | | tab.components = this.filterComponent(tab.components, roleId, permAction, balMap, skip, urlparam, pageId, interfaces, popview, cache, time, MenuName, _searchId, tab.uuid) |
| | | |
| | | if (_searchId === tab.uuid) { |
| | | tab.components.forEach(cell => { |
| | | if (cell.type !== 'search') return |
| | | window.GLOB.SearchBox.set(_searchId, cell.$searches) |
| | | if (cell.$s_req) { |
| | | window.GLOB.SearchBox.set(_searchId + 'required', true) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return tab |
| | | }) |
| | | |
| | |
| | | } |
| | | |
| | | // 搜索条件初始化 |
| | | if (item.type === 'search' && item.search.length === 0) { |
| | | return false |
| | | } else if (item.search) { |
| | | if (item.search) { |
| | | Utils.initSearchVal(item) |
| | | |
| | | item.$searches = Utils.initMainSearch(item.search) |
| | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let regs = [ |
| | | { reg: /@userName@/ig, value: `'${userName}'` }, |
| | | { reg: /@fullName@/ig, value: `'${fullName}'` } |
| | |
| | | |
| | | let _searchId = searchId |
| | | |
| | | tab.components.forEach(cell => { |
| | | if (cell.type !== 'search') return |
| | | _searchId = cell.uuid |
| | | window.GLOB.SearchBox.set(cell.uuid, cell.$searches) |
| | | if (cell.$s_req) { |
| | | window.GLOB.SearchBox.set(cell.uuid + 'required', true) |
| | | } |
| | | }) |
| | | if (tab.components.findIndex(cell => cell.type === 'search') > -1) { |
| | | _searchId = tab.uuid |
| | | } |
| | | |
| | | tab.components = this.filterComponent(tab.components, roleId, balMap, urlparam, Tab, _searchId, tab.uuid) |
| | | |
| | | if (_searchId === tab.uuid) { |
| | | tab.components.forEach(cell => { |
| | | if (cell.type !== 'search') return |
| | | window.GLOB.SearchBox.set(_searchId, cell.$searches) |
| | | if (cell.$s_req) { |
| | | window.GLOB.SearchBox.set(_searchId + 'required', true) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | return tab |
| | | }) |
| | | |
| | |
| | | } |
| | | |
| | | // 搜索条件初始化 |
| | | if (item.type === 'search' && item.search.length === 0) { |
| | | return false |
| | | } else if (item.search) { |
| | | if (item.search) { |
| | | Utils.initSearchVal(item) |
| | | |
| | | item.$searches = Utils.initMainSearch(item.search) |
| | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let regs = [ |
| | | { reg: /@userName@/ig, value: `'${userName}'` }, |
| | | { reg: /@fullName@/ig, value: `'${fullName}'` } |
| | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let regs = [ |
| | | { reg: /@userName@/ig, value: `'${userName}'` }, |
| | | { reg: /@fullName@/ig, value: `'${fullName}'` } |
| | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let regs = [ |
| | | { reg: /@userName@/ig, value: `'${userName}'` }, |
| | | { reg: /@fullName@/ig, value: `'${fullName}'` } |
| | |
| | | /** |
| | | * @description 获取默认存储过程请求参数 |
| | | */ |
| | | getExcelDefaultParam = (arr_field, orderBy, search, pagination = false, pageIndex = 1, pageSize = 100) => { |
| | | getExcelDefaultParam = (arr_field, orderBy, search, pagination = false, pageIndex = 1, pageSize = 9999) => { |
| | | const { setting, btn, selectedData, BID } = this.props |
| | | |
| | | let defaultSql = setting.execute || setting.default || 'true' |
| | |
| | | } |
| | | } |
| | | |
| | | let custompage = /@pageSize@/i.test(_dataresource + customScript) |
| | | let _search = Utils.joinMainSearchkey(search) |
| | | |
| | | _search = _search ? 'where ' + _search : '' |
| | | |
| | | let param = { |
| | |
| | | let district = sessionStorage.getItem('district') || '' |
| | | let address = sessionStorage.getItem('address') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | let allSearch = Utils.getAllSearchOptions(search) |
| | | let regoptions = allSearch.map(item => { |
| | | return { |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'${item.value}'` |
| | | } |
| | | }) |
| | | |
| | | let regoptions = null |
| | | if (queryType === 'statistics' || param.custom_script) { |
| | | let allSearch = Utils.getAllSearchOptions(search) |
| | | regoptions.push({ |
| | | reg: new RegExp('@userName@', 'ig'), |
| | | value: userName |
| | | }, { |
| | | reg: new RegExp('@fullName@', 'ig'), |
| | | value: fullName |
| | | }, { |
| | | reg: new RegExp('@orderBy@', 'ig'), |
| | | value: orderBy || '' |
| | | }, { |
| | | reg: new RegExp('@pageSize@', 'ig'), |
| | | value: pageSize |
| | | }, { |
| | | reg: new RegExp('@pageIndex@', 'ig'), |
| | | value: pageIndex |
| | | }) |
| | | |
| | | regoptions = allSearch.map(item => { |
| | | return { |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'${item.value}'` |
| | | } |
| | | }) |
| | | |
| | | regoptions.push({ |
| | | reg: new RegExp('@userName@', 'ig'), |
| | | value: userName |
| | | }, { |
| | | reg: new RegExp('@fullName@', 'ig'), |
| | | value: fullName |
| | | }, { |
| | | reg: new RegExp('@orderBy@', 'ig'), |
| | | value: orderBy || '' |
| | | }, { |
| | | reg: new RegExp('@pageSize@', 'ig'), |
| | | value: pageSize |
| | | }, { |
| | | reg: new RegExp('@pageIndex@', 'ig'), |
| | | value: pageIndex |
| | | }) |
| | | } |
| | | regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | param.custom_script = param.custom_script.replace(item.reg, item.value) |
| | | }) |
| | | |
| | | if (queryType === 'statistics') { // 统计数据源,内容替换 |
| | | regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | }) |
| | | _search = '' |
| | | } |
| | | |
| | |
| | | |
| | | let LText = '' |
| | | |
| | | if (defaultSql !== 'false' && !pagination) { |
| | | LText = ` select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows ` |
| | | if (custompage) { |
| | | LText = `/*system_query*/select ${arr_field} from ${_dataresource} ${_search} ` |
| | | } else if (defaultSql !== 'false' && !pagination) { |
| | | LText = `/*system_query*/select ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable order by tmptable.rows ` |
| | | } else if (defaultSql !== 'false') { |
| | | LText = ` select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows ` |
| | | LText = `/*system_query*/select top ${pageSize} ${arr_field} from (select ${arr_field} ,ROW_NUMBER() over(order by ${orderBy}) as rows from ${_dataresource} ${_search}) tmptable where rows > ${pageSize * (pageIndex - 1)} order by tmptable.rows ` |
| | | } |
| | | |
| | | if (param.custom_script) { |
| | | param.custom_script = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}' |
| | | ${param.custom_script} |
| | | ` |
| | | regoptions.forEach(item => { |
| | | param.custom_script = param.custom_script.replace(item.reg, item.value) |
| | | }) |
| | | |
| | | if (LText) { |
| | | LText += ` |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.DateCount = '' |
| | | param.username = userName |
| | | param.fullname = fullName |
| | | |
| | | if (window.GLOB.mkHS) { // 云端数据验证 |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | |
| | | let district = sessionStorage.getItem('district') || '' |
| | | let address = sessionStorage.getItem('address') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | // 初始化凭证及用户信息字段 |
| | | _sql += ` |
| | | /* 凭证及用户信息初始化赋值 */ |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | param.username = userName |
| | | param.fullname = fullName |
| | | |
| | | if (window.GLOB.probation) { |
| | | param.s_debug_type = 'Y' |
| | | } |
| | |
| | | _columns.push(cell) |
| | | }) |
| | | } else { |
| | | if (window.GLOB.dataFormat && !window.GLOB.mkHS) { |
| | | if (window.GLOB.dataFormat) { |
| | | _format = true |
| | | |
| | | if (window.GLOB.memberLevel >= 30) { |
| | |
| | | |
| | | const MKCheckCard = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkCheckCard')) |
| | | const MKSelect = asyncComponent(() => import('../mkSelect')) |
| | | const MKCheck = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkCheck')) |
| | | const MKSwitch = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkSwitch')) |
| | | const MKRadio = asyncComponent(() => import('../mkRadio')) |
| | | const MKDatePicker = asyncComponent(() => import('../mkDatePicker')) |
| | | |
| | | class AdvanceSearch extends Component { |
| | |
| | | content = (<MKDatePicker config={item}/>) |
| | | } else if (item.type === 'checkcard') { |
| | | content = <MKCheckCard config={item}/> |
| | | } else if (item.type === 'radio') { |
| | | content = <MKRadio config={item} onChange={(val) => this.recordChange(val, false, item)} /> |
| | | } else if (item.type === 'check') { |
| | | content = <MKCheck config={item}/> |
| | | } else if (item.type === 'switch') { |
| | | content = <MKSwitch config={item}/> |
| | | } |
| | | |
| | | if (content) { |
| | |
| | | const MKCheckCard = asyncComponent(() => import('./mkCheckCard')) |
| | | const MKCheck = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkCheck')) |
| | | const MKSwitch = asyncComponent(() => import('@/tabviews/zshare/mutilform/mkSwitch')) |
| | | const MKRadio = asyncComponent(() => import('./mkRadio')) |
| | | const MKSelect = asyncComponent(() => import('./mkSelect')) |
| | | const DateGroup = asyncComponent(() => import('./dategroup')) |
| | | const MKDatePicker = asyncComponent(() => import('./mkDatePicker')) |
| | |
| | | record[item.field] = item.initval |
| | | } |
| | | |
| | | if (['select', 'link', 'multiselect', 'checkcard'].includes(item.type)) { |
| | | if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(item.type)) { |
| | | item.options = item.options || [] |
| | | item.options = item.options.filter(op => !op.Hide) |
| | | if (item.setAll === 'true' && ['select', 'link'].includes(item.type)) { |
| | |
| | | |
| | | resetSearch = (result) => { |
| | | let _searchlist = fromJS(this.state.searchlist).toJS().map(item => { |
| | | if (['select', 'link', 'multiselect', 'checkcard'].includes(item.type) && result[item.field] && result[item.field].length > 0) { |
| | | if (['select', 'link', 'multiselect', 'checkcard', 'radio'].includes(item.type) && result[item.field] && result[item.field].length > 0) { |
| | | let options = [] |
| | | let map = new Map() |
| | | let all = false |
| | |
| | | content = <DateGroup position={index} config={item} onChange={(val, type) => this.dateGroupChange(val, type, item)} /> |
| | | } else if (item.type === 'checkcard') { |
| | | content = <MKCheckCard config={item} onChange={(val) => this.cardChange(val, item)} /> |
| | | } else if (item.type === 'radio') { |
| | | content = <MKRadio config={item} onChange={(val) => this.recordChange(val, false, item)} /> |
| | | } else if (item.type === 'check') { |
| | | content = <MKCheck config={item} onChange={(val) => this.recordChange(val, false, item)} /> |
| | | } else if (item.type === 'switch') { |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Radio } from 'antd' |
| | | |
| | | class MKRadio extends Component { |
| | | static propTpyes = { |
| | | config: PropTypes.object, |
| | | onChange: PropTypes.func |
| | | } |
| | | |
| | | state = { |
| | | value: '', |
| | | config: null, |
| | | options: [] |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | const { config } = this.props |
| | | let value = config.initval |
| | | |
| | | if (value) { |
| | | let option = null |
| | | option= config.oriOptions[0] |
| | | if (typeof(value) === 'string' && option && typeof(option.value) === 'number') { |
| | | value = +value |
| | | if (isNaN(value)) { |
| | | value = config.initval |
| | | } |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | config: fromJS(config).toJS(), |
| | | options: fromJS(config.options).toJS(), |
| | | value, |
| | | }) |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | | return !is(fromJS(this.state), fromJS(nextState)) |
| | | } |
| | | |
| | | UNSAFE_componentWillReceiveProps (nextProps) { |
| | | const { config } = this.state |
| | | |
| | | if (!is(fromJS(config.oriOptions), fromJS(nextProps.config.oriOptions))) { |
| | | this.setState({ |
| | | config: fromJS(nextProps.config).toJS(), |
| | | options: fromJS(nextProps.config.options).toJS() |
| | | }) |
| | | } |
| | | } |
| | | |
| | | componentWillUnmount () { |
| | | this.setState = () => { |
| | | return |
| | | } |
| | | } |
| | | |
| | | onChange = (val) => { |
| | | this.props.onChange(val) |
| | | this.setState({value: val}) |
| | | } |
| | | |
| | | render() { |
| | | const { value, options } = this.state |
| | | |
| | | return ( |
| | | <Radio.Group value={value} onChange={(e) => this.onChange(e.target.value)}> |
| | | {options.map(option => <Radio key={option.key} value={option.Value}>{option.Text}</Radio>)} |
| | | </Radio.Group> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default MKRadio |
| | |
| | | const { config } = this.state |
| | | |
| | | if (config.type === 'multiselect') { |
| | | this.props.onChange(val.join(',')) |
| | | this.props.onChange(val.join(','), true) |
| | | } else { |
| | | config.linkFields && config.linkFields.forEach((m, i) => { |
| | | setTimeout(() => { |
| | |
| | | loading: type, |
| | | tabviews: [] |
| | | }) |
| | | Api.getSystemConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => { |
| | | Api.getCloudConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | |
| | | } |
| | | |
| | | return new Promise(resolve => { |
| | | Api.getSystemConfig(_param).then(response => { |
| | | Api.getCloudConfig(_param).then(response => { |
| | | resolve(response) |
| | | }) |
| | | }) |
| | |
| | | } |
| | | }).then(resp => { |
| | | if (resp === false) return |
| | | let localParam = fromJS(param).toJS() |
| | | Api.getSystemConfig(param).then(response => { |
| | | Api.getCloudConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | config: _config, |
| | |
| | | originMenu: fromJS(_config).toJS() |
| | | }) |
| | | |
| | | localParam.func = 'sPC_TrdMenu_AddUpt_For_Local' |
| | | delete localParam.LongParam |
| | | delete localParam.PageParam |
| | | delete localParam.Template |
| | | delete localParam.Sort |
| | | delete localParam.EasyCode |
| | | delete localParam.open_edition |
| | | |
| | | this.submitAction(btnParam, localParam) |
| | | this.submitAction(btnParam) |
| | | } else { |
| | | this.setState({ |
| | | menuloading: false, |
| | |
| | | /** |
| | | * @description 保存或修改菜单按钮集 |
| | | */ |
| | | submitAction = (btnParam, localParam) => { |
| | | submitAction = (btnParam) => { |
| | | const { config } = this.state |
| | | |
| | | new Promise(resolve => { |
| | | if (btnParam.LText) { |
| | | Api.getSystemConfig(btnParam).then(result => { |
| | | Api.getCloudConfig(btnParam).then(result => { |
| | | if (result.status) { |
| | | this.setState({ // 保存成功后清空复制列表 |
| | | copyActions: [] |
| | |
| | | oriActions.forEach(action => { |
| | | if (!action.prebtn || !action.prebtn.uuid) return |
| | | |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: action.prebtn.uuid |
| | | }).then(result => { |
| | |
| | | PageParam: JSON.stringify({Template: _temp}), |
| | | LongParam: result.LongParam |
| | | } |
| | | Api.getSystemConfig(param).then(() => {}) |
| | | Api.getCloudConfig(param).then(() => {}) |
| | | } |
| | | }) |
| | | }) |
| | |
| | | }) |
| | | } |
| | | this.props.reloadmenu() |
| | | Api.genericInterface(localParam) |
| | | } else { |
| | | this.setState({ |
| | | menuloading: false, |
| | |
| | | loading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: uuid |
| | | }).then(res => { |
| | |
| | | func: 'sPC_MainMenu_Del', |
| | | MenuID: item |
| | | } |
| | | Api.getSystemConfig(_param) |
| | | Api.getCloudConfig(_param) |
| | | }) |
| | | this.props.handleView() |
| | | } |
| | |
| | | MenuID: menu.MenuID |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | let _config = '' |
| | | if (res.LongParam) { |
| | |
| | | let defers = _tbs.map((item, i) => { |
| | | return new Promise((resolve) => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.linkTab |
| | | }).then(res => { |
| | |
| | | let defers = popActions.map((item, i) => { |
| | | return new Promise((resolve) => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.linkTab |
| | | }).then(res => { |
| | |
| | | let defers = formActions.map((item, i) => { |
| | | return new Promise((resolve) => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.origin |
| | | }).then(res => { |
| | |
| | | let save = false |
| | | |
| | | new Promise(resolve => { |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | resolve(res) |
| | | }) |
| | | }).then(res => { // 删除原菜单 |
| | |
| | | |
| | | if (this.delButtons.length === 0) return res |
| | | |
| | | return Api.getSystemConfig({ |
| | | return Api.getCloudConfig({ |
| | | func: 'sPC_MainMenu_Del', |
| | | up_type: 'Y', |
| | | MenuID: this.delButtons.join(',') |
| | |
| | | }) |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(response => { |
| | | Api.getCloudConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | openEdition: response.open_edition || '', |
| | |
| | | MenuID: editAction.uuid |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | let _config = '' |
| | | if (res.LongParam) { |
| | |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import Utils, { FuncUtils } from '@/utils/utils.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import { getActionForm } from '@/templates/zshare/formconfig' |
| | | import asyncSpinComponent from '@/utils/asyncSpinComponent' |
| | | |
| | | import ActionForm from './actionform' |
| | | import CreateFunc from '@/templates/zshare/createfunc' |
| | | import CreateInterface from '@/templates/zshare/createinterface' |
| | | import { updateForm } from '@/utils/utils-update.js' |
| | | import DragElement from './dragaction' |
| | | import MKEmitter from '@/utils/events.js' |
| | | import './index.scss' |
| | |
| | | |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | let temps = res.data.map(temp => { |
| | | return { |
| | |
| | | * 4、下拉菜单数据源语法验证 |
| | | */ |
| | | handleSubmit = () => { |
| | | const { config, menu } = this.props |
| | | const { card } = this.state |
| | | const { config } = this.props |
| | | let _actionlist = fromJS(this.state.actionlist).toJS() |
| | | |
| | | this.actionFormRef.handleConfirm().then(btn => { |
| | |
| | | return |
| | | } |
| | | |
| | | this.setState({ |
| | | copying: true |
| | | }) |
| | | |
| | | let copyActionId = '' // 按钮为复制时,记录当前按钮的Id,菜单取消保存时,删除复制按钮配置信息 |
| | | |
| | | /** |
| | | * @description 按钮保存校验 |
| | | * 1、检查按钮是否为表单或表单标签页,如前后一致,则复制其内容 |
| | | * 2、检查按钮是否为标签页,如前后一致,则复制标签页 |
| | | */ |
| | | new Promise(resolve => { |
| | | if ( |
| | | !card.originCard || |
| | | (btn.OpenType !== card.originCard.OpenType) || |
| | | (btn.OpenType === 'tab' && btn.tabTemplate !== 'FormTab') || |
| | | (btn.OpenType === 'funcbutton' && btn.execMode !== 'pop') |
| | | ) { // 按钮不是复制,或按钮前后类型不一致时,直接保存 |
| | | resolve('save') |
| | | } else if (btn.OpenType === 'pop' || btn.OpenType === 'tab' || btn.execMode === 'pop') { |
| | | resolve('subconf') |
| | | } else if (btn.OpenType === 'popview') { |
| | | resolve('subtab') |
| | | } else { |
| | | resolve('save') |
| | | } |
| | | }).then(result => { // 查询原按钮配置信息 |
| | | if (result === 'save' || result === 'subtab') return result |
| | | // 判断是否存在操作列 |
| | | let _hasGridbtn = _actionlist.filter(act => act.position === 'grid').length > 0 |
| | | let _gridBtn = config.gridBtn ? fromJS(config.gridBtn).toJS() : null |
| | | |
| | | return Api.getSystemConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: card.originCard.uuid, |
| | | appkey: card.originCard.appkey || '' |
| | | }) |
| | | }).then(result => { // 复制按钮配置信息,保存至新添加按钮 |
| | | if (result === 'save' || result === 'subtab') return result |
| | | |
| | | if (result.status && result.LongParam) { |
| | | let _LongParam = '' |
| | | |
| | | // 解析配置 |
| | | if (result.LongParam) { |
| | | try { |
| | | _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | _LongParam = '' |
| | | } |
| | | } |
| | | |
| | | if (!_LongParam) return 'save' |
| | | |
| | | let _temp = '' // 配置信息类型 |
| | | |
| | | // 修改模态框标题名称 |
| | | if ((btn.OpenType === 'pop' || btn.execMode === 'pop') && _LongParam.type === 'Modal') { |
| | | try { |
| | | _LongParam.setting.title = btn.label |
| | | _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_LongParam))) |
| | | _temp = 'Modal' |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | | _temp = '' |
| | | } |
| | | } else if (btn.OpenType === 'tab' && _LongParam.type === 'FormTab') { |
| | | try { |
| | | _LongParam.action = _LongParam.action.map(_btn => { |
| | | _btn.uuid = Utils.getuuid() |
| | | |
| | | return _btn |
| | | }) |
| | | _LongParam.tabgroups.forEach(_groupId => { |
| | | _LongParam[_groupId] = _LongParam[_groupId].map(_tab => { |
| | | _tab.uuid = Utils.getuuid() |
| | | |
| | | return _tab |
| | | }) |
| | | }) |
| | | _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_LongParam))) |
| | | _temp = 'FormTab' |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | | _temp = '' |
| | | } |
| | | } |
| | | |
| | | if (!_temp) return 'save' |
| | | |
| | | let param = { |
| | | func: 'sPC_ButtonParam_AddUpt', |
| | | ParentID: menu.MenuID, |
| | | MenuID: btn.uuid, |
| | | MenuNo: menu.MenuNo, |
| | | Template: _temp, |
| | | MenuName: btn.label, |
| | | PageParam: JSON.stringify({Template: _temp}), |
| | | LongParam: _LongParam |
| | | } |
| | | |
| | | return Api.getSystemConfig(param) |
| | | } else { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | return 'save' |
| | | } |
| | | }).then(result => { |
| | | if (result === 'save' || result === 'subtab') return result |
| | | |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } else { |
| | | copyActionId = btn.uuid |
| | | } |
| | | |
| | | return 'save' |
| | | }).then(result => { // 查询原按钮关联标签信息 |
| | | if (result === 'save') return result |
| | | |
| | | return Api.getSystemConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: card.originCard.linkTab, |
| | | appkey: card.originCard.appkey || '' |
| | | }) |
| | | }).then(result => { // 标签复制 |
| | | if (result === 'save') return result |
| | | |
| | | let _LongParam = '' // 标签配置信息 |
| | | |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | } else if (result.LongParam) { |
| | | // 解析标签配置 |
| | | try { |
| | | _LongParam = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | _LongParam = '' |
| | | } |
| | | } |
| | | |
| | | if (!_LongParam) { |
| | | return 'save' |
| | | } else { |
| | | copyActionId = btn.linkTab |
| | | |
| | | return new Promise(resolve => { |
| | | this.copytab(btn, _LongParam, resolve) |
| | | }) |
| | | } |
| | | }).then(() => { |
| | | // 判断是否存在操作列 |
| | | let _hasGridbtn = _actionlist.filter(act => act.position === 'grid').length > 0 |
| | | let _gridBtn = config.gridBtn ? fromJS(config.gridBtn).toJS() : null |
| | | |
| | | if (_gridBtn) { |
| | | _gridBtn.display = _hasGridbtn |
| | | } else { |
| | | _gridBtn = { |
| | | display: _hasGridbtn, |
| | | Align: 'center', |
| | | IsSort: 'false', |
| | | uuid: Utils.getuuid(), |
| | | label: '操作', |
| | | type: 'action', |
| | | style: 'button', |
| | | show: 'horizontal', |
| | | Width: 120 |
| | | } |
| | | } |
| | | |
| | | this.setState({ |
| | | actionlist: _actionlist, |
| | | copying: false, |
| | | visible: false |
| | | }, () => { |
| | | this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}, copyActionId) |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 标签复制 |
| | | * 1、保存按钮关联的新标签 |
| | | * 2、保存标签按钮信息 |
| | | * 3、保存新标签中按钮的子配置信息 |
| | | */ |
| | | copytab = (btn, _tab, _resolve) => { |
| | | let _LongParam = '' |
| | | |
| | | _tab.uuid = btn.linkTab |
| | | _tab.tabName = _tab.tabName + moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _tab.tabNo = _tab.tabNo + moment().format('YYYY-MM-DD HH:mm:ss') |
| | | |
| | | let param = { |
| | | func: 'sPC_Tab_AddUpt', |
| | | MenuID: _tab.uuid, |
| | | MenuNo: _tab.tabNo, |
| | | Template: _tab.Template, |
| | | MenuName: _tab.tabName, |
| | | Remark: _tab.Remark, |
| | | PageParam: JSON.stringify({Template: _tab.Template}), |
| | | Sort: 0 |
| | | } |
| | | |
| | | let _oriActions = [] |
| | | |
| | | let btnParam = { |
| | | func: 'sPC_Button_AddUpt', |
| | | Type: 40, |
| | | ParentID: _tab.uuid, |
| | | MenuNo: _tab.tabNo, |
| | | Template: _tab.Template, |
| | | PageParam: '', |
| | | LongParam: '', |
| | | LText: '' |
| | | } |
| | | |
| | | try { |
| | | let _linkchange = {} |
| | | btnParam.LText = [] |
| | | |
| | | _tab.action = _tab.action.map((item, index) => { |
| | | let uuid = Utils.getuuid() |
| | | |
| | | if (item.OpenType === 'pop' || item.execMode === 'pop') { |
| | | _oriActions.push({ |
| | | prebtn: JSON.parse(JSON.stringify(item)), |
| | | curuuid: uuid, |
| | | Template: 'Modal' |
| | | }) |
| | | } else if (item.OpenType === 'popview') { |
| | | _linkchange[item.linkTab] = Utils.getuuid() |
| | | |
| | | item.linkTab = _linkchange[item.linkTab] |
| | | } |
| | | |
| | | item.uuid = uuid |
| | | |
| | | btnParam.LText.push(`select '${item.uuid}' as menuid, '${item.label}' as menuname, '${(index + 1) * 10}' as Sort`) |
| | | |
| | | return item |
| | | }) |
| | | |
| | | if (_tab.funcs && _tab.funcs.length > 0) { |
| | | _tab.funcs = _tab.funcs.map(item => { |
| | | if (item.type === 'tab') { |
| | | item.linkTab = _linkchange[item.linkTab] |
| | | item.menuNo = '' |
| | | item.subfuncs = [] |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | btnParam.LText = btnParam.LText.join(' union all ') |
| | | btnParam.LText = Utils.formatOptions(btnParam.LText) |
| | | btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp) |
| | | |
| | | _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_tab))) |
| | | } catch (e) { |
| | | console.warn('Stringify Failure') |
| | | _LongParam = '' |
| | | _resolve('save') |
| | | return |
| | | } |
| | | |
| | | param.LongParam = _LongParam |
| | | |
| | | new Promise(resolve => { |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (response.status) { |
| | | resolve(true) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: response.message, |
| | | duration: 5 |
| | | }) |
| | | resolve(false) |
| | | } |
| | | }) |
| | | }).then(result => { |
| | | if (!result) return result |
| | | if (!btnParam.LText) return true |
| | | |
| | | return Api.getSystemConfig(btnParam) |
| | | }).then(result => { |
| | | if (result === false || result === true) return result |
| | | |
| | | if (result.status) { |
| | | return true |
| | | if (_gridBtn) { |
| | | _gridBtn.display = _hasGridbtn |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 5 |
| | | }) |
| | | return false |
| | | _gridBtn = { |
| | | display: _hasGridbtn, |
| | | Align: 'center', |
| | | IsSort: 'false', |
| | | uuid: Utils.getuuid(), |
| | | label: '操作', |
| | | type: 'action', |
| | | style: 'button', |
| | | show: 'horizontal', |
| | | Width: 120 |
| | | } |
| | | } |
| | | }).then(result => { |
| | | if (!result) return result |
| | | if (_oriActions.length === 0) return true |
| | | |
| | | let deffers = _oriActions.map(item => { |
| | | return new Promise(resolve => { |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.prebtn.uuid |
| | | }).then(response => { |
| | | if (!response.status || !response.LongParam) { |
| | | resolve(response) |
| | | } else { |
| | | let _param = { |
| | | func: 'sPC_ButtonParam_AddUpt', |
| | | ParentID: _tab.uuid, |
| | | MenuID: item.curuuid, |
| | | MenuNo: _tab.tabNo, |
| | | Template: item.Template, |
| | | MenuName: item.prebtn.label, |
| | | PageParam: JSON.stringify({Template: item.Template}), |
| | | LongParam: response.LongParam |
| | | } |
| | | Api.getSystemConfig(_param).then(resp => { |
| | | resolve(resp) |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | this.setState({ |
| | | actionlist: _actionlist, |
| | | visible: false |
| | | }, () => { |
| | | this.props.updateaction({...config, action: _actionlist, gridBtn: _gridBtn}, copyActionId) |
| | | }) |
| | | |
| | | return Promise.all(deffers) |
| | | }).then(result => { |
| | | let error = '' |
| | | |
| | | if (typeof(result) === 'object') { |
| | | result.forEach(resul => { |
| | | if (!resul.status && !error) { |
| | | error = resul |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (error) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: error.message, |
| | | duration: 5 |
| | | }) |
| | | } |
| | | |
| | | _resolve('save') |
| | | }) |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * @description 创建按钮存储过程 |
| | | */ |
| | | creatFunc = () => { |
| | | const { menu } = this.props |
| | | let _config = fromJS(this.props.config).toJS() |
| | | |
| | | this.actionFormRef.handleConfirm().then(res => { |
| | | let btn = res // 按钮信息 |
| | | let newLText = '' // 创建存储过程sql |
| | | let DelText = '' // 删除存储过程sql |
| | | |
| | | // 创建存储过程,必须填写内部函数名 |
| | | if (btn.intertype !== 'inner') { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '使用内部函数时,才可以创建存储过程!', |
| | | duration: 5 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | new Promise(resolve => { |
| | | // 弹窗(表单)类按钮,先获取按钮配置信息,如果尚未配置按钮则会报错并终止。 |
| | | // 获取信息后生成删除和创建存储过程的语句 |
| | | if (btn.OpenType === 'pop') { |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: btn.uuid |
| | | }).then(res => { |
| | | let _LongParam = '' |
| | | if (res.status && res.LongParam) { |
| | | try { |
| | | _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | _LongParam = '' |
| | | } |
| | | } |
| | | |
| | | if (_LongParam) { |
| | | _LongParam = updateForm(_LongParam) |
| | | |
| | | let _param = { |
| | | funcName: btn.innerFunc, |
| | | name: _config.setting.tableName || '', |
| | | fields: _LongParam.fields, |
| | | menuNo: menu.MenuNo |
| | | } |
| | | newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config)) |
| | | DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) |
| | | resolve(true) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '弹窗(表单)按钮,请先配置表单信息!', |
| | | duration: 5 |
| | | }) |
| | | resolve(false) |
| | | } |
| | | }) |
| | | } else if (btn.OpenType === 'excelIn') { |
| | | if (btn.verify && btn.verify.sheet && btn.verify.columns && btn.verify.columns.length > 0) { |
| | | let _param = { |
| | | funcName: btn.innerFunc, |
| | | menuNo: menu.MenuNo |
| | | } |
| | | newLText = Utils.formatOptions(FuncUtils.getexcelInfunc(_param, btn, menu)) |
| | | DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) |
| | | resolve(true) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请完善导入Excel验证信息!', |
| | | duration: 5 |
| | | }) |
| | | resolve(false) |
| | | } |
| | | } else if (btn.OpenType === 'excelOut') { |
| | | newLText = Utils.formatOptions(FuncUtils.getTableFunc(btn.innerFunc, menu, _config)) // 创建存储过程sql |
| | | DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) |
| | | |
| | | resolve(true) |
| | | } else { |
| | | let _param = { |
| | | funcName: btn.innerFunc, |
| | | name: _config.setting.tableName || '', |
| | | fields: '', |
| | | menuNo: menu.MenuNo |
| | | } |
| | | newLText = Utils.formatOptions(FuncUtils.getfunc(_param, btn, menu, _config)) |
| | | DelText = Utils.formatOptions(FuncUtils.dropfunc(btn.innerFunc)) |
| | | resolve(true) |
| | | } |
| | | }).then(res => { |
| | | if (!res) return |
| | | |
| | | this.refs.btnCreatFunc.exec(btn.innerFunc, newLText, DelText) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 创建按钮接口(写入) |
| | | */ |
| | | btnCreatInterface = () => { |
| | | const { config, type, menu } = this.props |
| | | |
| | | this.actionFormRef.handleConfirm().then(result => { |
| | | let _menu = { |
| | | type: type, |
| | | MenuID: menu.MenuID, |
| | | menuName: menu.MenuName, |
| | | menuNo: menu.MenuNo |
| | | } |
| | | |
| | | this.refs.btnCreatInterface.triggerInInterface(result, config, _menu) |
| | | }) |
| | | } |
| | | |
| | | /** |
| | | * @description 按钮双击触发子配置 |
| | | */ |
| | | btnDoubleClick = (el) => { |
| | |
| | | |
| | | render() { |
| | | const { config } = this.props |
| | | const { actionlist, visible, card, copying, profVisible, record } = this.state |
| | | const { actionlist, visible, card, copying, profVisible } = this.state |
| | | |
| | | return ( |
| | | <div className="model-table-action-list" style={config.charts && config.charts.length > 1 ? {paddingTop: 25} : null}> |
| | |
| | | maskClosable={false} |
| | | onCancel={this.editModalCancel} |
| | | footer={[ |
| | | record && ['pop', 'exec', 'prompt'].includes(record.OpenType) && record.intertype === 'system' ? <CreateInterface key="interface" ref="btnCreatInterface" trigger={this.btnCreatInterface}/> : null, |
| | | record && record.intertype === 'inner' ? <CreateFunc key="create" ref="btnCreatFunc" trigger={this.creatFunc}/> : null, |
| | | <Button key="cancel" onClick={this.editModalCancel}>取消</Button>, |
| | | <Button key="confirm" type="primary" loading={copying} onClick={this.handleSubmit}>确定</Button> |
| | | ]} |
| | |
| | | _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp) |
| | | _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(_sParam).then(res => { |
| | | Api.getCloudConfig(_sParam).then(res => { |
| | | if (res.status) { |
| | | let _scripts = res.data.map(item => { |
| | | return { |
| | |
| | | _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp) |
| | | _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(_sParam).then(res => { |
| | | Api.getCloudConfig(_sParam).then(res => { |
| | | if (res.status) { |
| | | let _scripts = res.data.map(item => { |
| | | return { |
| | |
| | | let _regoptions = regoptions.map(item => { |
| | | return { |
| | | reg: new RegExp('@' + item.key + '@', 'ig'), |
| | | value: `'0'`, |
| | | type: item.type || '' |
| | | value: `'0'` |
| | | } |
| | | }) |
| | | |
| | |
| | | value: 1 |
| | | }) |
| | | |
| | | if (verify.queryType === 'statistics' && _dataresource) { |
| | | _regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | }) |
| | | _search = '' |
| | | } else if (_dataresource) { |
| | | _regoptions.forEach(item => { |
| | | if (item.type !== 'url') return |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | }) |
| | | } |
| | | _regoptions.forEach(item => { |
| | | _dataresource = _dataresource.replace(item.reg, item.value) |
| | | _customScript = _customScript.replace(item.reg, item.value) |
| | | }) |
| | | |
| | | if (_customScript) { |
| | | _regoptions.forEach(item => { |
| | | _customScript = _customScript.replace(item.reg, item.value) |
| | | }) |
| | | if (verify.queryType === 'statistics' && _dataresource) { |
| | | _search = '' |
| | | } |
| | | |
| | | // 数据源处理, 存在显示列时 |
| | |
| | | |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | let temps = res.data.map(temp => { |
| | | return { |
| | |
| | | _defaultValue = [moment().startOf('week'), moment().endOf('week')] |
| | | } else if (card.initval === 'month') { |
| | | _defaultValue = [moment().startOf('month'), moment().endOf('month')] |
| | | } else if (card.initval === 'lastMonth') { |
| | | _defaultValue = [moment().subtract(1, 'months').startOf('month'), moment().subtract(1, 'months').endOf('month')] |
| | | } else if (card.initval) { |
| | | try { |
| | | let _initval = JSON.parse(card.initval) |
| | |
| | | {value: '[3, 0]', label: '近三天'}, |
| | | {value: '[7, 0]', label: '近七天'}, |
| | | {value: '[30, 0]', label: '近30天'}, |
| | | {value: '[90, 0]', label: '近90天'}, |
| | | {value: '[7, -7]', label: '前后七天'}, |
| | | {value: '[30, -30]', label: '前后30天'}, |
| | | {value: '[90, -90]', label: '前后90天'}, |
| | |
| | | const searchTypeOptions = { |
| | | text: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'inputType', 'advanced', 'query', 'labelwidth'], |
| | | select: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll', 'dropdown', 'query', 'labelwidth'], |
| | | radio: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll', 'query', 'labelwidth'], |
| | | multiselect: ['label', 'field', 'resourceType', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'query', 'labelwidth'], |
| | | link: ['label', 'field', 'resourceType', 'initval', 'type', 'linkField', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'setAll', 'dropdown', 'query', 'labelwidth'], |
| | | date: ['label', 'field', 'initval', 'type', 'match', 'ratio', 'blacklist', 'required', 'Hide', 'labelShow', 'advanced', 'query', 'precision', 'labelwidth'], |
| | |
| | | let reRequired = {} |
| | | let reLabel = {} |
| | | |
| | | if (['multiselect', 'select', 'link'].includes(type)) { |
| | | if (['multiselect', 'select', 'link', 'radio'].includes(type)) { |
| | | reRequired.linkField = true |
| | | if (this.record.resourceType === '0') { // 自定义资源 |
| | | shows.push('options') |
| | |
| | | uuid: key |
| | | }] |
| | | } |
| | | } else if (['multiselect', 'select', 'link'].includes(value)) { |
| | | } else if (['multiselect', 'select', 'link', 'radio'].includes(value)) { |
| | | if (!this.record.options[0].Text && this.record.fields.length > 0) { |
| | | let field = this.record.fields[0].field |
| | | |
| | |
| | | if (!err) { |
| | | values.uuid = this.props.card.uuid |
| | | // 下拉菜单或联动菜单 |
| | | if (['multiselect', 'select', 'link'].includes(values.type)) { |
| | | if (['multiselect', 'select', 'link', 'radio'].includes(values.type)) { |
| | | if (values.resourceType === '0') { |
| | | values.options = values.options || [] |
| | | values.dataSource = '' |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Radio, Tooltip, notification, Select, InputNumber } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import { formRule } from '@/utils/option.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import asyncComponent from '@/utils/asyncComponent' |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { setting } = this.props |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | |
| | | reject() |
| | | return |
| | | } |
| | | } |
| | | |
| | | // 数据源保存 |
| | | if ( |
| | | values.interType === 'system' && values.default !== 'false' && |
| | | /[^\s]+\s+[^\s]+/ig.test(values.dataresource) && setting.dataresource !== values.dataresource |
| | | ) { |
| | | let param = { |
| | | func: 's_DataSrc_Save', |
| | | LText: values.dataresource, |
| | | MenuID: this.props.menu.MenuID |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | Api.genericInterface(param) |
| | | } |
| | | |
| | | resolve(values) |
| | |
| | | _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp) |
| | | _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(_sParam).then(res => { |
| | | Api.getCloudConfig(_sParam).then(res => { |
| | | if (res.status) { |
| | | let _scripts = res.data.map(item => { |
| | | return { |
| | |
| | | |
| | | let _config = {...config, tables: _tables} |
| | | |
| | | Api.getSystemConfig({func: 'sPC_Get_FieldName', TBName: value}).then(res => { |
| | | Api.getCloudConfig({func: 'sPC_Get_FieldName', TBName: value}).then(res => { |
| | | if (res.status) { |
| | | let tabmsg = { |
| | | tableName: _table.TbName, |
| | |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input, Radio, Tooltip, notification, InputNumber } from 'antd' |
| | | import { QuestionCircleOutlined } from '@ant-design/icons' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import { formRule } from '@/utils/option.js' |
| | | import Utils from '@/utils/utils.js' |
| | | import CodeMirror from '@/templates/zshare/codemirror' |
| | |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | const { setting } = this.props |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | |
| | | reject() |
| | | return |
| | | } |
| | | } |
| | | |
| | | // 数据源保存 |
| | | if ( |
| | | values.interType === 'system' && values.default !== 'false' && |
| | | /[^\s]+\s+[^\s]+/ig.test(values.dataresource) && setting.dataresource !== values.dataresource |
| | | ) { |
| | | let param = { |
| | | func: 's_DataSrc_Save', |
| | | LText: values.dataresource, |
| | | MenuID: this.props.menu.MenuID |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | Api.genericInterface(param) |
| | | } |
| | | |
| | | resolve(values) |
| | |
| | | loading: type, |
| | | tabviews: [] |
| | | }) |
| | | Api.getSystemConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => { |
| | | Api.getCloudConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => { |
| | | if (res.status) { |
| | | let _tabviews = [] |
| | | res.UserTemp.forEach(temp => { |
| | |
| | | func: 'sPC_MainMenu_Del', |
| | | MenuID: item |
| | | } |
| | | Api.getSystemConfig(_param) |
| | | Api.getCloudConfig(_param) |
| | | }) |
| | | |
| | | this.props.handleView(param) |
| | |
| | | } |
| | | |
| | | return new Promise(resolve => { |
| | | Api.getSystemConfig(_param).then(response => { |
| | | Api.getCloudConfig(_param).then(response => { |
| | | resolve(response) |
| | | }) |
| | | }) |
| | |
| | | }).then(resp => { |
| | | if (resp === false) return |
| | | |
| | | Api.getSystemConfig(param).then(response => { |
| | | Api.getCloudConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | openEdition: response.open_edition || '', |
| | |
| | | if (oriActions.length === 0) return |
| | | |
| | | oriActions.forEach(action => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: action.prebtn ? action.prebtn.uuid : '' |
| | | }).then(result => { |
| | |
| | | PageParam: JSON.stringify({Template: _LongParam.type}), |
| | | LongParam: result.LongParam |
| | | } |
| | | Api.getSystemConfig(param).then(() => {}) |
| | | Api.getCloudConfig(param).then(() => {}) |
| | | } |
| | | } |
| | | }) |
| | |
| | | loading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: btn.OpenType === 'popview' ? btn.linkTab : btn.uuid |
| | | }).then(res => { |
| | |
| | | MenuID: config.uuid |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | let _config = '' |
| | | if (res.LongParam) { |
| | |
| | | loading: type, |
| | | tabviews: [] |
| | | }) |
| | | Api.getSystemConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => { |
| | | Api.getCloudConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | |
| | | } |
| | | |
| | | return new Promise(resolve => { |
| | | Api.getSystemConfig(_param).then(response => { |
| | | Api.getCloudConfig(_param).then(response => { |
| | | resolve(response) |
| | | }) |
| | | }) |
| | |
| | | } |
| | | }).then(resp => { |
| | | if (resp === false) return |
| | | let localParam = fromJS(param).toJS() |
| | | localParam.func = 'sPC_TrdMenu_AddUpt_For_Local' |
| | | delete localParam.LongParam |
| | | delete localParam.PageParam |
| | | delete localParam.Template |
| | | delete localParam.Sort |
| | | delete localParam.EasyCode |
| | | delete localParam.open_edition |
| | | |
| | | Api.getSystemConfig(param).then(response => { |
| | | Api.getCloudConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | config: _config, |
| | |
| | | }) |
| | | |
| | | this.props.reloadmenu() |
| | | Api.genericInterface(localParam) |
| | | |
| | | if (this.state.closeVisible) { |
| | | this.props.handleView() |
| | |
| | | loading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.linkTab |
| | | }).then(res => { |
| | |
| | | let defers = _tbs.map((item, i) => { |
| | | return new Promise((resolve) => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.linkTab |
| | | }).then(res => { |
| | |
| | | let defers = popActions.map((item, i) => { |
| | | return new Promise((resolve) => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.linkTab |
| | | }).then(res => { |
| | |
| | | let defers = formActions.map((item, i) => { |
| | | return new Promise((resolve) => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.origin |
| | | }).then(res => { |
| | |
| | | let save = false |
| | | |
| | | new Promise(resolve => { |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | resolve(res) |
| | | }) |
| | | }).then(res => { // 删除原菜单 |
| | |
| | | |
| | | if (this.delButtons.length === 0) return res |
| | | |
| | | return Api.getSystemConfig({ |
| | | return Api.getCloudConfig({ |
| | | func: 'sPC_MainMenu_Del', |
| | | up_type: 'Y', |
| | | MenuID: this.delButtons.join(',') |
| | |
| | | |
| | | new Promise(resolve => { |
| | | // 获取云端存储过程信息 |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_TVP', |
| | | TVPName: innerFunc |
| | | }).then(result => { |
| | |
| | | return 'drop' |
| | | } else if (!localfunc || (cloudText === localfunc)) { |
| | | // 本地存储过程不存在,或云端和本地存储过程一致时,将新的存储过程更新至云端 |
| | | return Api.getSystemConfig({ |
| | | return Api.getCloudConfig({ |
| | | func: 'sPC_TVP_InUp', |
| | | TVPName: innerFunc, |
| | | TVPText: newLText, |
| | |
| | | }) |
| | | } else { |
| | | return new Promise(resolve => { |
| | | Api.getSystemConfig({ // 添加现有的本地存储过程至云端 |
| | | Api.getCloudConfig({ // 添加现有的本地存储过程至云端 |
| | | func: 'sPC_TVP_InUp', |
| | | TVPName: innerFunc, |
| | | TVPText: localfunc, |
| | | TypeName: 'P' |
| | | }).then(result => { |
| | | if (result.status) { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_TVP_InUp', // 添加最新的存储过程至云端 |
| | | TVPName: innerFunc, |
| | | TVPText: newLText, |
| | |
| | | |
| | | new Promise(resolve => { |
| | | if (btn.OpenType === 'pop') { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: btn.uuid |
| | | }).then(result => { |
| | |
| | | _sParam.secretkey = Utils.encrypt(_sParam.LText, _sParam.timestamp) |
| | | _sParam.open_key = Utils.encryptOpenKey(_sParam.secretkey, _sParam.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(_sParam).then(res => { |
| | | Api.getCloudConfig(_sParam).then(res => { |
| | | if (res.status) { |
| | | let _scripts = res.data.map(item => { |
| | | let _item = { |
| | |
| | | value: 'switch', |
| | | text: '开关' |
| | | }, { |
| | | value: 'radio', |
| | | text: '单选框' |
| | | }, { |
| | | value: 'check', |
| | | text: '勾选框' |
| | | }] |
| | |
| | | if (card.focus) { |
| | | if (['text', 'multiselect'].includes(card.type)) { |
| | | card.match = 'like' |
| | | } else if (['select', 'link', 'checkcard'].includes(card.type)) { |
| | | } else if (['select', 'link', 'checkcard', 'radio'].includes(card.type)) { |
| | | card.match = '=' |
| | | } else if (card.type === 'date') { |
| | | card.match = '>=' |
| | |
| | | _fields = card.modal.fields || [] |
| | | resolve(_fields) |
| | | } else if (card.OpenType === 'pop') { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: card.uuid |
| | | }).then(res => { |
| | |
| | | {value: '[3, 0]', text: '近三天'}, |
| | | {value: '[7, 0]', text: '近七天'}, |
| | | {value: '[30, 0]', text: '近30天'}, |
| | | {value: '[90, 0]', text: '近90天'}, |
| | | {value: '[7, -7]', text: '前后七天'}, |
| | | {value: '[30, -30]', text: '前后30天'}, |
| | | {value: '[90, -90]', text: '前后90天'}, |
| | |
| | | {value: '[-2, -2]', text: '后天'}, |
| | | {value: 'week', text: '本周'}, |
| | | {value: 'month', text: '本月'}, |
| | | {value: 'lastMonth', text: '上月'}, |
| | | ], |
| | | datetime: [ |
| | | {value: '', text: '空'}, |
| | |
| | | let district = sessionStorage.getItem('district') || '' |
| | | let address = sessionStorage.getItem('address') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let _dataresource = setting.dataresource |
| | | let _customScript = '' |
| | | |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | param.username = userName |
| | | param.fullname = fullName |
| | | |
| | | if (window.GLOB.probation) { |
| | | param.s_debug_type = 'Y' |
| | | } |
| | |
| | | arr_field: statFields.map(col => col.field).join(','), |
| | | default_sql: setting.execute ? 'true' : 'false' |
| | | } |
| | | |
| | | // if (setting.transaction === 'true') { |
| | | // param.func = 'sPC_Get_TableData_try' |
| | | // } |
| | | |
| | | let _dataresource = setting.dataresource |
| | | let _customScript = '' |
| | |
| | | let city = sessionStorage.getItem('city') || '' |
| | | let district = sessionStorage.getItem('district') || '' |
| | | let address = sessionStorage.getItem('address') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | if (setting.customScript) { |
| | | _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | param.username = userName |
| | | param.fullname = fullName |
| | | |
| | | if (window.GLOB.mkHS) { // 云端数据验证 |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) |
| | | } |
| | |
| | | let city = sessionStorage.getItem('city') || '' |
| | | let district = sessionStorage.getItem('district') || '' |
| | | let address = sessionStorage.getItem('address') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | _customScript = `declare @ErrorCode nvarchar(50),@retmsg nvarchar(4000),@UserName nvarchar(50),@FullName nvarchar(50),@RoleID nvarchar(512),@mk_departmentcode nvarchar(512),@mk_organization nvarchar(512),@mk_user_type nvarchar(20),@mk_nation nvarchar(50),@mk_province nvarchar(50),@mk_city nvarchar(50),@mk_district nvarchar(50),@mk_address nvarchar(100) |
| | | select @ErrorCode='',@retmsg ='',@UserName='${userName}', @FullName='${fullName}', @RoleID='${RoleID}', @mk_departmentcode='${departmentcode}', @mk_organization='${organization}', @mk_user_type='${mk_user_type}', @mk_nation='${nation}', @mk_province='${province}', @mk_city='${city}', @mk_district='${district}', @mk_address='${address}' |
| | | ${_customScript} |
| | |
| | | func: 'sPC_Get_structured_data', |
| | | LText: _LText.join(' union all '), |
| | | LText_field: LText_field.join(' union all '), |
| | | BID: BID |
| | | BID: BID, |
| | | username: sessionStorage.getItem('User_Name') || '', |
| | | fullName: sessionStorage.getItem('Full_Name') || '' |
| | | } |
| | | |
| | | if (config.MenuName) { |
| | |
| | | item.initval = [moment().startOf('week').format(format), moment().endOf('week').format(format)].join(',') |
| | | } else if (item.initval === 'month') { |
| | | item.initval = [moment().startOf('month').format(format), moment().endOf('month').format(format)].join(',') |
| | | } else if (item.initval === 'lastMonth') { |
| | | item.initval = [moment().subtract(1, 'months').startOf('month').format(format), moment().subtract(1, 'months').endOf('month').format(format)].join(',') |
| | | } else if (item.initval) { |
| | | try { |
| | | let _initval = JSON.parse(item.initval) |
| | |
| | | let address = sessionStorage.getItem('address') || '' |
| | | let _sheet = item.sheet |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | if (window.GLOB.externalDatabase !== null) { |
| | | _sheet = _sheet.replace(/@db@/ig, window.GLOB.externalDatabase) |
| | | } |
| | |
| | | |
| | | let _sheet = btn.sheet |
| | | let BID = data[0].$$BID || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | if (window.GLOB.externalDatabase !== null) { |
| | | _sheet = _sheet.replace(/@db@/ig, window.GLOB.externalDatabase) |
| | |
| | | let city = sessionStorage.getItem('city') || '' |
| | | let district = sessionStorage.getItem('district') || '' |
| | | let address = sessionStorage.getItem('address') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | // 初始化凭证及用户信息字段 |
| | | _sql += ` |
| | |
| | | const ScriptForm = asyncComponent(() => import('./scriptform')) |
| | | const SubMutilForm = asyncComponent(() => import('./submutilform')) |
| | | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | const skinStyle = { |
| | | bg_black_style_blue: {name: '蓝色', color: '#1890ff'}, |
| | | bg_black_style_red: {name: '红色', color: '#f5222d'}, |
| | |
| | | } |
| | | |
| | | if (!sessionStorage.getItem('UserID')) { |
| | | sessionStorage.removeItem('isEditState') |
| | | this.props.history.replace('/login') |
| | | return |
| | | } |
| | |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | let msgs = [] |
| | | if (!res.status) { |
| | | notification.warning({ |
| | |
| | | const UpdateFormTab = asyncLoadComponent(() => import('./updateFormTab')) |
| | | |
| | | document.body.className = '' |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | class BaseDesign extends Component { |
| | | state = { |
| | |
| | | } |
| | | |
| | | if (!sessionStorage.getItem('UserID')) { |
| | | sessionStorage.removeItem('isEditState') |
| | | this.props.history.replace('/login') |
| | | return |
| | | } |
| | |
| | | loading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | editMenu.open_edition = res.open_edition || '' |
| | | editMenu.LongParam = '' |
| | |
| | | MenuID: editMenu.PageParam.copyMenuId |
| | | } |
| | | |
| | | Api.getSystemConfig(_param).then(res => { |
| | | Api.getCloudConfig(_param).then(res => { |
| | | if (res.status) { |
| | | if (res.LongParam) { |
| | | let _LongParam = '' |
| | |
| | | let defers = _tbs.map((item, i) => { |
| | | return new Promise((resolve) => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.linkTab |
| | | }).then(res => { |
| | |
| | | let defers = popActions.map((item, i) => { |
| | | return new Promise((resolve) => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.linkTab |
| | | }).then(res => { |
| | |
| | | let defers = formActions.map((item, i) => { |
| | | return new Promise((resolve) => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.origin |
| | | }).then(res => { |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | _resolve() |
| | | if (res.status) { |
| | | // if (this.delButtons.length > 0) { |
| | | // Api.getSystemConfig({ |
| | | // Api.getCloudConfig({ |
| | | // func: 'sPC_MainMenu_Del', |
| | | // up_type: 'Y', |
| | | // MenuID: this.delButtons.join(',') |
| | |
| | | let userName = sessionStorage.getItem('User_Name') || '' |
| | | let fullName = sessionStorage.getItem('Full_Name') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let regs = [ |
| | | { reg: /@userName@/ig, value: `'${userName}'` }, |
| | | { reg: /@fullName@/ig, value: `'${fullName}'` } |
| | |
| | | let city = sessionStorage.getItem('city') || '' |
| | | let district = sessionStorage.getItem('district') || '' |
| | | let address = sessionStorage.getItem('address') || '' |
| | | |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | userName = sessionStorage.getItem('CloudUserName') || '' |
| | | fullName = sessionStorage.getItem('CloudFullName') || '' |
| | | } |
| | | |
| | | let LText = params.map((item, index) => { |
| | | let _sql = item.sql |
| | |
| | | func: 'sPC_Get_structured_data', |
| | | LText: LText.join(' union all '), |
| | | LText_field: LText_field.join(' union all '), |
| | | BID: BID || '' |
| | | BID: BID || '', |
| | | username: userName, |
| | | fullName: fullName |
| | | } |
| | | |
| | | param.LText = Utils.formatOptions(param.LText) |
| | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | |
| | | func: 'sPC_MainMenu_Del', |
| | | MenuID: item.MenuID |
| | | } |
| | | return Api.getSystemConfig(param).then(res => { |
| | | return Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | _this.props.reload() |
| | | } else { |
| | |
| | | title: '确认调整菜单顺序吗?', |
| | | content: '', |
| | | onOk() { |
| | | return Api.getSystemConfig(param).then(res => { |
| | | return Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | that.setState({ change: false }) |
| | | that.props.reload() |
| | |
| | | debug: 'Y' |
| | | } |
| | | |
| | | let result = await Api.getSystemConfig(_param) |
| | | let result = await Api.getCloudConfig(_param) |
| | | |
| | | // 登录超时 |
| | | if (!result) return |
| | |
| | | } |
| | | |
| | | changeEditState = () => { |
| | | sessionStorage.removeItem('isEditState') |
| | | this.props.history.replace('/main') |
| | | window.location.reload() |
| | | } |
| | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | |
| | | param.secretkey = Utils.encrypt(param.LText, param.timestamp) |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | let msgs = [] |
| | | if (!res.status) { |
| | | notification.warning({ |
| | |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | document.body.className = '' |
| | | |
| | | // 组件加载时,获取菜单数据 |
| | |
| | | |
| | | if (window.GLOB.systemType !== 'production') { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | Api.getCloudConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | if (res.status) { |
| | | let _permFuncField = [] |
| | | let _sysRoles = [] |
| | |
| | | func: 's_get_sversions_sys', |
| | | } |
| | | |
| | | Api.getSystemConfig(_param).then(result => { |
| | | Api.getCloudConfig(_param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | import React, {Component} from 'react' |
| | | import { withRouter } from 'react-router-dom' |
| | | import { ConfigProvider } from 'antd' |
| | | import enUS from 'antd/es/locale/en_US' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | |
| | | |
| | | class Design extends Component { |
| | | componentDidMount() { |
| | | window.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | window.GLOB.designView = true |
| | | sessionStorage.removeItem('breakpoint') |
| | | setGLOBFuncs() |
| | | if (sessionStorage.getItem('isEditState') === 'true') { |
| | | sessionStorage.removeItem('isEditState') |
| | | this.props.history.replace('/main') |
| | | window.location.reload() |
| | | } else { |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | window.debugger = false |
| | | window.GLOB.breakpoint = false |
| | | window.GLOB.designView = true |
| | | sessionStorage.removeItem('breakpoint') |
| | | setGLOBFuncs() |
| | | } |
| | | } |
| | | |
| | | render () { |
| | |
| | | } |
| | | } |
| | | |
| | | export default Design |
| | | export default withRouter(Design) |
| | |
| | | func: 'sPC_MainMenu_Del', |
| | | MenuID: menu.card.MenuID |
| | | } |
| | | return Api.getSystemConfig(param).then(res => { |
| | | return Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | MKEmitter.emit('mkUpdateMenuList') |
| | | } else { |
| | |
| | | title: '确认调整菜单顺序吗?', |
| | | content: '', |
| | | onOk() { |
| | | return Api.getSystemConfig(param).then(res => { |
| | | return Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | that.setState({ change: false }) |
| | | MKEmitter.emit('mkUpdateMenuList') |
| | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | |
| | | func: 'sPC_MainMenu_Del', |
| | | MenuID: menu.card.MenuID |
| | | } |
| | | return Api.getSystemConfig(param).then(res => { |
| | | return Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | MKEmitter.emit('mkUpdateMenuList') |
| | | } else { |
| | |
| | | title: '确认调整菜单顺序吗?', |
| | | content: '', |
| | | onOk() { |
| | | return Api.getSystemConfig(param).then(res => { |
| | | return Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | that.setState({ change: false }) |
| | | MKEmitter.emit('mkUpdateMenuList') |
| | |
| | | confirmLoading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig(param).then(response => { |
| | | Api.getCloudConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | confirmLoading: false, |
| | |
| | | this.setState({ |
| | | loading: true |
| | | }) |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | |
| | | loading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig(param).then(response => { |
| | | Api.getCloudConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | loading: false, |
| | |
| | | CustomPage: customImg |
| | | } |
| | | |
| | | Api.getSystemConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'menu'}).then(res => { |
| | | Api.getCloudConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'menu'}).then(res => { |
| | | let _templates = [] |
| | | |
| | | res.UserTemp.forEach(temp => { |
| | |
| | | if ((sysMenu.Template === 'CustomPage' || sysMenu.Template === 'BaseTable') && sysMenu.copyId) { |
| | | this.copyMenu(param, sysMenu.copyId) |
| | | } else { |
| | | Api.getSystemConfig(param).then(response => { |
| | | Api.getCloudConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | loading: false, |
| | |
| | | } |
| | | |
| | | copyMenu = (param, MenuId) => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: MenuId |
| | | }).then(result => { |
| | |
| | | param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config))) |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(response => { |
| | | Api.getCloudConfig(param).then(response => { |
| | | if (response.status) { |
| | | this.setState({ |
| | | loading: false, |
| | |
| | | const StyleController = asyncComponent(() => import('@/menu/stylecontroller')) |
| | | const NormalForm = asyncComponent(() => import('@/components/normalform')) |
| | | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | sessionStorage.setItem('appType', 'mob') // 应用类型 |
| | | document.body.className = '' |
| | | window.GLOB.CacheIndependent = new Map() |
| | |
| | | } |
| | | |
| | | getAppMessage = (MenuID) => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_get_keyids', |
| | | bid: sessionStorage.getItem('appId') |
| | | }).then(res => { |
| | |
| | | } |
| | | deffers = [new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'image'}).then(res => { |
| | | Api.getCloudConfig({...param, typecharone: 'image'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 500) |
| | | }), new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'video'}).then(res => { |
| | | Api.getCloudConfig({...param, typecharone: 'video'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 1000) |
| | | }), new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'color'}).then(res => { |
| | | Api.getCloudConfig({...param, typecharone: 'color'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 1500) |
| | |
| | | MenuID: MenuId |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) |
| | | |
| | | Api.getSystemConfig(_param).then(res => { |
| | | Api.getCloudConfig(_param).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config))) |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | } |
| | | |
| | | getMenus = () => { |
| | | Api.getSystemConfig({func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'}).then(result => { |
| | | Api.getCloudConfig({func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'}).then(result => { |
| | | if (result.status) { |
| | | let thdMenuList = [] |
| | | let menulist = result.fst_menu.map(fst => { |
| | |
| | | const StyleCombControlButton = asyncComponent(() => import('@/menu/stylecombcontrolbutton')) |
| | | const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) |
| | | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | sessionStorage.setItem('appType', '') // 应用类型 |
| | | document.body.className = '' |
| | | |
| | |
| | | } |
| | | |
| | | if (!sessionStorage.getItem('UserID')) { |
| | | sessionStorage.removeItem('isEditState') |
| | | sessionStorage.removeItem('appType') |
| | | this.props.history.replace('/login') |
| | | return |
| | |
| | | |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | let temps = res.data.map(temp => { |
| | | return { |
| | |
| | | } |
| | | deffers = [new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'image'}).then(res => { |
| | | Api.getCloudConfig({...param, typecharone: 'image'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 500) |
| | | }), new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'video'}).then(res => { |
| | | Api.getCloudConfig({...param, typecharone: 'video'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 1000) |
| | | }), new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'color'}).then(res => { |
| | | Api.getCloudConfig({...param, typecharone: 'color'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 1500) |
| | |
| | | } |
| | | |
| | | updateCustomComponent = () => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_get_custom_components', |
| | | typename: '', |
| | | typecharone: '' |
| | |
| | | MenuID: MenuId |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (result.status) { |
| | | let config = null |
| | | |
| | |
| | | } |
| | | |
| | | setTimeout(() => { |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | let _config = null |
| | | try { |
| | | _config = res.LongParam ? JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) : null |
| | |
| | | |
| | | Api.fileuploadbase64(param).then(result => { |
| | | if (result.status) { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_PrintTemplateMSub', |
| | | ID: config.uuid, |
| | | Images: Utils.getcloudurl(result.Images), |
| | |
| | | }).then(res => { // 页面保存 |
| | | if (!res || !res.status) return res |
| | | |
| | | return Api.getSystemConfig(param) |
| | | return Api.getCloudConfig(param) |
| | | }).then(res => { // 按钮删除 |
| | | if (!res || !res.status) return res |
| | | |
| | |
| | | func: 'sPC_MainMenu_Del', |
| | | MenuID: this.state.delButtons.join(',') |
| | | } |
| | | return Api.getSystemConfig(_param) |
| | | return Api.getCloudConfig(_param) |
| | | } |
| | | }, this.netError).then(res => { // 页面按钮关系保存 |
| | | if (!res || !res.status) return res |
| | |
| | | }) |
| | | |
| | | if (MenuType !== 'billPrint') { |
| | | return Api.getSystemConfig(btnParam) |
| | | return Api.getCloudConfig(btnParam) |
| | | } else { |
| | | return { |
| | | status: true |
| | |
| | | getRoleFields = () => { |
| | | if (sessionStorage.getItem('sysRoles')) return |
| | | |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | Api.getCloudConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | if (res.status) { |
| | | let _permFuncField = [] |
| | | let _sysRoles = [] |
| | |
| | | getMenus = () => { |
| | | const { MenuId, config } = this.props |
| | | |
| | | Api.getSystemConfig({func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'}).then(result => { |
| | | Api.getCloudConfig({func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'}).then(result => { |
| | | if (result.status) { |
| | | let thdMenu = null |
| | | let thdMenuList = [] |
| | |
| | | const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) |
| | | const PopView = asyncComponent(() => import('./popview')) |
| | | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | sessionStorage.setItem('editMenuType', 'menu') // 编辑菜单类型 |
| | | sessionStorage.setItem('appType', 'mob') // 应用类型 |
| | | document.body.className = '' |
| | |
| | | } |
| | | |
| | | if (!sessionStorage.getItem('UserID')) { |
| | | sessionStorage.removeItem('isEditState') |
| | | sessionStorage.removeItem('editMenuType') |
| | | sessionStorage.removeItem('appType') |
| | | this.props.history.replace('/login') |
| | |
| | | } |
| | | |
| | | getAppMessage = (MenuID) => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_get_keyids', |
| | | bid: sessionStorage.getItem('appId') |
| | | }).then(res => { |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | } |
| | | deffers = [new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'image'}).then(res => { |
| | | Api.getCloudConfig({...param, typecharone: 'image'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 500) |
| | | }), new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'video'}).then(res => { |
| | | Api.getCloudConfig({...param, typecharone: 'video'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 1000) |
| | | }), new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'color'}).then(res => { |
| | | Api.getCloudConfig({...param, typecharone: 'color'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 1500) |
| | |
| | | MenuID: MenuId |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) |
| | | |
| | | Api.getSystemConfig(_param).then(res => { |
| | | Api.getCloudConfig(_param).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | MenuID: urlParam.copyMenuId |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | } |
| | | |
| | | jointComponents = (config, navItem) => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | typename: sessionStorage.getItem('typename'), |
| | |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _param.secretkey = Utils.encrypt('', _param.timestamp) |
| | | |
| | | Api.getSystemConfig(_param).then(res => { |
| | | Api.getCloudConfig(_param).then(res => { |
| | | if (res.status) { |
| | | NavBar.open_edition = res.open_edition || '' |
| | | window.GLOB.CacheIndependent.set(NavBar.uuid, fromJS(NavBar).toJS()) |
| | |
| | | kparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | kparam.secretkey = Utils.encrypt('', kparam.timestamp) |
| | | |
| | | Api.getSystemConfig(kparam).then(result => { |
| | | Api.getCloudConfig(kparam).then(result => { |
| | | if (result.status) { |
| | | sessionStorage.setItem('appViewList', viewList) |
| | | } |
| | |
| | | }).then(res => { // 页面保存 |
| | | if (!res || !res.status) return res |
| | | |
| | | return Api.getSystemConfig(param) |
| | | return Api.getCloudConfig(param) |
| | | }).then(res => { |
| | | this.setState({ |
| | | menuloading: false |
| | |
| | | getRoleFields = () => { |
| | | if (sessionStorage.getItem('sysRoles')) return |
| | | |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | Api.getCloudConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | if (res.status) { |
| | | let _permFuncField = [] |
| | | let _sysRoles = [] |
| | |
| | | title: '确定设置本页面为首页吗?', |
| | | content: '', |
| | | onOk() { |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | title: '确定设置本页面为登录页吗?', |
| | | content: hasLogin ? '' : '当前页面尚未添加登录组件。', |
| | | onOk() { |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | const StyleCombControlButton = asyncComponent(() => import('@/menu/stylecombcontrolbutton')) |
| | | const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) |
| | | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | sessionStorage.setItem('appType', 'pc') // 应用类型 |
| | | sessionStorage.setItem('typename', 'pc') |
| | | document.body.className = '' |
| | |
| | | } |
| | | |
| | | if (!sessionStorage.getItem('UserID')) { |
| | | sessionStorage.removeItem('isEditState') |
| | | sessionStorage.removeItem('appType') |
| | | this.props.history.replace('/login') |
| | | return |
| | |
| | | } |
| | | |
| | | getAppMessage = (MenuID) => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_get_keyids', |
| | | bid: sessionStorage.getItem('appId') |
| | | }).then(res => { |
| | |
| | | param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | param.secretkey = Utils.encrypt('', param.timestamp) |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | } |
| | | deffers = [new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'image'}).then(res => { |
| | | Api.getCloudConfig({...param, typecharone: 'image'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 500) |
| | | }), new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'video'}).then(res => { |
| | | Api.getCloudConfig({...param, typecharone: 'video'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 1000) |
| | | }), new Promise(resolve => { |
| | | setTimeout(() => { |
| | | Api.getSystemConfig({...param, typecharone: 'color'}).then(res => { |
| | | Api.getCloudConfig({...param, typecharone: 'color'}).then(res => { |
| | | resolve(res.data) |
| | | }) |
| | | }, 1500) |
| | |
| | | MenuID: MenuId |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | |
| | | _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) |
| | | |
| | | Api.getSystemConfig(_param).then(res => { |
| | | Api.getCloudConfig(_param).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | MenuID: urlParam.copyMenuId |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | } |
| | | |
| | | jointComponents = (config, navItem) => { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | TypeCharOne: sessionStorage.getItem('kei_no'), |
| | | typename: 'pc', |
| | |
| | | _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | _param.secretkey = Utils.encrypt('', _param.timestamp) |
| | | |
| | | Api.getSystemConfig(_param).then(res => { |
| | | Api.getCloudConfig(_param).then(res => { |
| | | if (res.status) { |
| | | NavBar.open_edition = res.open_edition || '' |
| | | window.GLOB.CacheIndependent.set(NavBar.uuid, fromJS(NavBar).toJS()) |
| | |
| | | kparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | kparam.secretkey = Utils.encrypt('', kparam.timestamp) |
| | | |
| | | Api.getSystemConfig(kparam).then(result => { |
| | | Api.getCloudConfig(kparam).then(result => { |
| | | if (result.status) { |
| | | sessionStorage.setItem('appViewList', viewList) |
| | | } |
| | |
| | | }).then(res => { // 页面保存 |
| | | if (!res || !res.status) return res |
| | | |
| | | return Api.getSystemConfig(param) |
| | | return Api.getCloudConfig(param) |
| | | }).then(res => { |
| | | this.setState({ |
| | | menuloading: false |
| | |
| | | |
| | | getRoleFields = () => { |
| | | if (sessionStorage.getItem('sysRoles') || sessionStorage.getItem('permFuncField')) return |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | Api.getCloudConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | if (res.status) { |
| | | let _permFuncField = [] |
| | | let _sysRoles = [] |
| | |
| | | title: '确定设置本页面为首页吗?', |
| | | content: '', |
| | | onOk() { |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | title: '确定设置本页面为登录页吗?', |
| | | content: hasLogin ? '' : '当前页面尚未添加登录组件。', |
| | | onOk() { |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (!result.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | |
| | | |
| | | let deffers = tables.map(name => { |
| | | return new Promise(resolve => { |
| | | Api.getSystemConfig({func: 'sPC_Get_FieldName', TBName: name}).then(res => { |
| | | Api.getCloudConfig({func: 'sPC_Get_FieldName', TBName: name}).then(res => { |
| | | resolve(res) |
| | | }) |
| | | }) |
| | |
| | | const Header = asyncComponent(() => import('./header')) |
| | | const TransferForm = asyncComponent(() => import('@/templates/zshare/basetransferform')) |
| | | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | |
| | | class RoleManage extends Component { |
| | | state = { |
| | | app: null, |
| | |
| | | getAppViewList = () => { |
| | | const { app } = this.state |
| | | |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 's_get_keyids', |
| | | bid: app.ID |
| | | }).then(result => { |
| | |
| | | confirmLoading: true |
| | | }) |
| | | |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_MainMenu_ReDel', |
| | | MenuID: targetKeys.join(','), |
| | | TypeCharOne: app.kei_no, |
| | |
| | | }) |
| | | |
| | | if (app.typename === 'pc' && list.length > 0) { |
| | | Api.getSystemConfig({ |
| | | Api.getCloudConfig({ |
| | | func: 'sPC_MainMenu_ReDel', |
| | | MenuID: list.join(','), |
| | | TypeCharOne: app.kei_no, |
| | |
| | | UNSAFE_componentWillMount() { |
| | | sessionStorage.setItem('role_id', sessionStorage.getItem('cloudRole_id')) |
| | | sessionStorage.setItem('dataM', sessionStorage.getItem('cloudDataM')) |
| | | sessionStorage.setItem('User_Name', sessionStorage.getItem('CloudUserName')) |
| | | sessionStorage.setItem('Full_Name', sessionStorage.getItem('CloudFullName')) |
| | | |
| | | document.body.className = 'mk-blue-black' |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | window.GLOB.dataFormat = false // 去除水印 |
| | | window.GLOB.mkHS = true |
| | | |
| | | // HS下不可开启断点调试 |
| | |
| | | import { ConfigProvider } from 'antd' |
| | | import zhCN from 'antd/es/locale/zh_CN' |
| | | |
| | | // import Api from '@/api' |
| | | // import Utils from '@/utils/utils.js' |
| | | import Header from '../systemfunc/header' |
| | | import Proc from './proc' |
| | | import './index.scss' |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | sessionStorage.setItem('User_Name', sessionStorage.getItem('CloudUserName')) |
| | | sessionStorage.setItem('Full_Name', sessionStorage.getItem('CloudFullName')) |
| | | |
| | | if (sessionStorage.getItem('permFuncField')) { |
| | | this.setState({permFuncs: JSON.parse(sessionStorage.getItem('permFuncField'))}) |
| | | } else { |
| | |
| | | dropParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') |
| | | dropParam.secretkey = Utils.encrypt(dropParam.LText, dropParam.timestamp) |
| | | dropParam.open_key = Utils.encryptOpenKey(dropParam.secretkey, dropParam.timestamp) |
| | | |
| | | |
| | | let createParam = { |
| | | func: 'sPC_TableData_InUpDe', |
| | |
| | | .code-mirror-wrap .anticon-font-size { |
| | | position: absolute; |
| | | } |
| | | |
| | | .anticon-swap { |
| | | position: absolute; |
| | | z-index: 11; |
| | | left: auto; |
| | | right: 10px; |
| | | top: auto; |
| | | bottom: 20px; |
| | | } |
| | | } |
| | | |
| | | .mk-create-func { |
| | |
| | | const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) |
| | | const PasteBaseTable = asyncComponent(() => import('@/menu/components/share/pastebasetable')) |
| | | |
| | | sessionStorage.setItem('isEditState', 'true') |
| | | sessionStorage.setItem('appType', '') // 应用类型 |
| | | document.body.className = '' |
| | | |
| | |
| | | } |
| | | |
| | | if (!sessionStorage.getItem('UserID')) { |
| | | sessionStorage.removeItem('isEditState') |
| | | sessionStorage.removeItem('appType') |
| | | this.props.history.replace('/login') |
| | | return |
| | |
| | | |
| | | param.open_key = Utils.encryptOpenKey(param.secretkey, param.timestamp) // 云端数据验证 |
| | | |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | if (res.status) { |
| | | let temps = res.data.map(temp => { |
| | | return { |
| | |
| | | MenuID: MenuId |
| | | } |
| | | |
| | | Api.getSystemConfig(param).then(result => { |
| | | Api.getCloudConfig(param).then(result => { |
| | | if (result.status) { |
| | | let config = null |
| | | |
| | |
| | | btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp) |
| | | |
| | | new Promise(resolve => { |
| | | Api.getSystemConfig(param).then(res => { |
| | | Api.getCloudConfig(param).then(res => { |
| | | resolve(res) |
| | | }, this.netError) |
| | | }).then(res => { |
| | |
| | | oriConfig: fromJS(config).toJS(), |
| | | }) |
| | | |
| | | return Api.getSystemConfig(btnParam) |
| | | return Api.getCloudConfig(btnParam) |
| | | }).then(res => { |
| | | this.setState({ |
| | | menuloading: false |
| | |
| | | |
| | | getRoleFields = () => { |
| | | if (sessionStorage.getItem('sysRoles')) return |
| | | Api.getSystemConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | Api.getCloudConfig({func: 'sPC_Get_Roles_sModular'}).then(res => { |
| | | if (res.status) { |
| | | let _permFuncField = [] |
| | | let _sysRoles = [] |
| | |
| | | getMenus = () => { |
| | | const { MenuId, config } = this.props |
| | | |
| | | Api.getSystemConfig({func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'}).then(result => { |
| | | Api.getCloudConfig({func: 's_get_pc_menus', systemType: options.sysType, debug: 'Y'}).then(result => { |
| | | if (result.status) { |
| | | let thdMenu = null |
| | | let thdMenuList = [] |