From 1b0fd0a20d54068f0f4716177780e00a75b860ef Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 10 一月 2020 17:12:34 +0800 Subject: [PATCH] 2020-01-10 --- src/locales/en-US/header.js | 1 src/templates/formtabconfig/tabform/index.jsx | 0 src/components/header/index.jsx | 93 ++++++ src/templates/formtabconfig/index.jsx | 181 +----------- src/templates/formtabconfig/tabdragelement/index.jsx | 0 src/templates/comtableconfig/index.jsx | 61 +++- src/tabviews/tableshare/actionList/index.jsx | 18 + src/templates/modalconfig/index.jsx | 3 src/api/index.js | 111 +------ src/templates/formtabconfig/source.jsx | 88 ------ src/templates/modalconfig/dragelement/index.jsx | 2 src/templates/formtabconfig/tabdragelement/index.scss | 0 src/locales/zh-CN/comtable.js | 1 src/templates/formtabconfig/settingform/index.scss | 0 public/options.js | 2 src/components/header/loginform.jsx | 77 +++++ src/templates/modalconfig/dragelement/card.jsx | 5 src/locales/en-US/comtable.js | 1 src/templates/formtabconfig/index.scss | 0 src/templates/subtableconfig/actionform/index.jsx | 33 ++ src/index.js | 14 src/components/header/index.scss | 3 src/templates/comtableconfig/actionform/index.jsx | 37 ++ src/templates/modalconfig/index.scss | 1 src/templates/formtabconfig/settingform/index.jsx | 0 src/tabviews/rolemanage/index.jsx | 24 src/store/reducer.js | 7 src/components/sidemenu/editthdmenu/index.jsx | 28 + src/templates/formtabconfig/tabdragelement/card.jsx | 0 src/templates/formtabconfig/actionform/index.jsx | 0 src/templates/subtableconfig/index.jsx | 24 + src/templates/comtableconfig/settingform/index.jsx | 6 src/locales/zh-CN/header.js | 1 src/store/options.js | 1 src/templates/formtabconfig/tabform/index.scss | 0 src/templates/formtabconfig/actionform/index.scss | 0 src/components/sidemenu/index.jsx | 5 src/views/login/index.jsx | 5 38 files changed, 420 insertions(+), 413 deletions(-) diff --git a/public/options.js b/public/options.js index 2c96305..ae3dfc9 100644 --- a/public/options.js +++ b/public/options.js @@ -1,7 +1,7 @@ window.GLOB = { service: 'mkwms', appkey: '20191106103859640976D6E924E464D029CF0', - mainSystemApi: '', + mainSystemApi: 'http://qingqiumarket.cn/mkwms/webapi/dostar', title: '', platName: '', logo: '', diff --git a/src/api/index.js b/src/api/index.js index 0a4e201..485b065 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,6 +1,7 @@ import axios from 'axios' import qs from 'qs' import {notification } from 'antd' +import options from '@/store/options.js' // axios.defaults.baseURL = 'http://qingqiumarket.cn' axios.defaults.crossDomain = true @@ -102,21 +103,6 @@ } }) } - - /** - * @description 閲嶇疆瀵嗙爜 - */ - resetpassword (originpwd, newpwd) { - return axios({ - url: '/local/dostar', - data: { - func: 's_PwdUpt', - userid: sessionStorage.getItem('UserID'), - OriginPwd: originpwd, - NewPwd: newpwd - } - }) - } /** * @description 鑾峰彇鎴栦慨鏀圭郴缁熼厤缃紝澧炲姞appkey @@ -127,7 +113,13 @@ param.SessionUid = sessionStorage.getItem('SessionUid') || '' param.LoginUID = sessionStorage.getItem('LoginUID') || '' param.appkey = window.GLOB.appkey || '' - if (window.GLOB.mainSystemApi) { + + if (sessionStorage.getItem('isEditState') && options.cloudServiceApi) { // 缂栬緫鐘舵�侊紝涓斿瓨鍦ㄤ簯绔湴鍧� + param.rduri = options.cloudServiceApi + param.userid = sessionStorage.getItem('CloudUserID') + param.SessionUid = sessionStorage.getItem('CloudSessionUid') || '' + param.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' + } else if (window.GLOB.mainSystemApi) { param.rduri = window.GLOB.mainSystemApi } @@ -195,7 +187,11 @@ param.lang = localStorage.getItem('lang') || '' param.SessionUid = sessionStorage.getItem('SessionUid') || '' param.LoginUID = sessionStorage.getItem('LoginUID') || '' - + + if (param.func === 'RolesAdd') { // 瑙掕壊娣诲姞鏃讹紝浼燼ppkey + param.appkey = window.GLOB.appkey || '' + } + return axios({ url: '/webapi/dostar', data: param @@ -263,69 +259,7 @@ } /** - * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 - * @param {String} MenuNo 椤甸潰鑿滃崟鍙傛暟 - */ - getMainConfigsData (MenuNo) { - return axios({ - url: '/local/dostar', - data: { - func: 'GetMainConfigs', - userid: sessionStorage.getItem('UserID'), - MenuNo: MenuNo - } - }) - } - - /** - * @description 鑾峰彇椤甸潰鍒楄〃鏁版嵁 - * @param {String} MenuNo 椤甸潰鑿滃崟鍙傛暟 - */ - getMainTableData (MenuNo, pageIndex = 1, pageSize = 10, orderColumn = '', orderType = '', search) { - return axios({ - url: '/local/dostar', - data: { - func: 'GetMainData', - userid: sessionStorage.getItem('UserID'), - MenuNo: MenuNo, - PageIndex: pageIndex, - PageSize: pageSize, - orderColumn: orderColumn, - orderType: orderType, - search: search - } - }) - } - - /** - * @description 鑾峰彇椤甸潰閰嶇疆淇℃伅 - * @param {String} MenuNo 椤甸潰鑿滃崟鍙傛暟 - */ - getModelFormData (MenuNo) { - return axios({ - url: '/local/dostar', - data: { - func: 'getModelFormData', - userid: sessionStorage.getItem('UserID'), - MenuNo: MenuNo - } - }) - } - - /** - * @description 鑾峰彇椤甸潰鍒楄〃鏁版嵁 - * @param {String} param 鎻愪氦鍙傛暟 - */ - setActionSubmit (param) { - param.userid = sessionStorage.getItem('UserID') - return axios({ - url: '/local/dostar', - data: param - }) - } - - /** - * @description 閫氱敤鎺ュ彛 + * @description 閫氱敤鎺ュ彛(鏁版嵁绠$悊) * @param {Object} param 鏌ヨ鍙婃彁浜ゅ弬鏁� */ commonInterface (param) { @@ -335,6 +269,7 @@ param.LoginUID = sessionStorage.getItem('LoginUID') || '' param.BID = param.BID || '' param.debug = param.debug || '' + return axios({ url: '/webapi/dostar', data: param @@ -342,7 +277,7 @@ } /** - * @description 閫氱敤鎺ュ彛(鎻愪氦) + * @description 閫氱敤鎺ュ彛(鎻愪氦)(鏁版嵁绠$悊) * @param {Object} param 鏌ヨ鍙婃彁浜ゅ弬鏁� */ submitInterface (param) { @@ -350,24 +285,12 @@ param.lang = localStorage.getItem('lang') || '' param.SessionUid = sessionStorage.getItem('SessionUid') || '' param.LoginUID = sessionStorage.getItem('LoginUID') || '' + return axios({ url: '/webapi/dostar', data: param }) } - - // /** - // * @description 鐧诲嚭绯荤粺 - // */ - // logoutsystem () { - // return axios({ - // url: '/local/dostar', - // data: { - // func: 'logout', - // userid: sessionStorage.getItem('UserID') - // } - // }) - // } } export default new Api() \ No newline at end of file diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index 305f2f8..db7d91c 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -23,6 +23,7 @@ import logourl from '@/assets/img/main-logo.png' import avatar from '@/assets/img/avatar.jpg' import Resetpwd from './resetpwd' +import LoginForm from './loginform' import './index.scss' const EditMenu = asyncComponent(() => import('./editmenu')) @@ -42,7 +43,10 @@ dict: (!localStorage.getItem('lang') || localStorage.getItem('lang') === 'zh-CN') ? zhCN : enUS, confirmLoading: false, userName: sessionStorage.getItem('User_Name'), - logourl: window.GLOB.mainlogo || logourl + logourl: window.GLOB.mainlogo || logourl, + loginVisible: false, + loginLoading: false, + systems: [] } handleCollapse = () => { @@ -78,8 +82,14 @@ _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' // 鏃堕棿鎴� _param.secretkey = Utils.encrypt(_param.LText, _param.timestamp) // md5瀵嗛挜 - let result = await Api.getSystemConfig(_param) - if (result.status) { + let localResult = await Api.getLocalConfig(_param) + let result = {status: true} + + if (window.GLOB.mainSystemApi && window.GLOB.subSystemApi !== window.GLOB.mainSystemApi) { + result = await Api.getSystemConfig(_param) + } + + if (result.status && localResult.status) { this.setState({ visible: false, confirmLoading: false @@ -92,7 +102,7 @@ } else { notification.warning({ top: 92, - message: result.message, + message: result.message || localResult.message, duration: 10 }) this.setState({ @@ -178,7 +188,8 @@ item.PageParam = {OpenType: 'menu', linkUrl: ''} } return item - }) + }), + systems: result.Systems.filter(sys => sys.LinkUrl1) }) } else { notification.error({ @@ -223,7 +234,50 @@ changeEditState = (state) => { // 淇敼缂栬緫鐘舵�� - this.props.resetEditState(state) + let UserID = sessionStorage.getItem('CloudUserID') + let LoginUID = sessionStorage.getItem('CloudLoginUID') + + sessionStorage.setItem('isEditState', state) + if (state && (!UserID || !LoginUID)) { + this.setState({ + loginVisible: true + }) + } else { + this.setState({ + menulist: null + }) + this.loadmenu() + this.props.resetEditState(state) + } + } + + loginSubmit = () => { + this.setState({ + loginLoading: true + }) + this.loginRef.handleConfirm().then(param => { + Api.getusermsg(param.username, param.password).then(res => { + if (res.status) { + sessionStorage.setItem('CloudUserID', res.UserID) + sessionStorage.setItem('CloudSessionUid', Utils.getuuid()) + sessionStorage.setItem('CloudLoginUID', res.LoginUID) + + this.setState({ + menulist: null, + loginVisible: false, + loginLoading: false + }) + this.loadmenu() + this.props.resetEditState(true) + } else { + notification.error({ + top: 92, + message: res.message, + duration: 15 + }) + } + }) + }) } enterEdit = () => { @@ -234,6 +288,10 @@ exitEdit = () => { // 閫�鍑虹紪杈戠姸鎬� this.props.resetEditLevel(false) + } + + changeSystem = (system) => { + console.log(system) } UNSAFE_componentWillMount () { @@ -258,9 +316,14 @@ <Menu overlayclassname="header-dropdown"> {this.props.debug && <Menu.Item key="0"> {this.state.dict['header.edit']} - <Switch size="small" className="edit-switch" disabled={!!this.props.editLevel} onChange={this.changeEditState} /> + <Switch size="small" className="edit-switch" disabled={!!this.props.editLevel} checked={this.props.editState} onChange={this.changeEditState} /> </Menu.Item>} - <Menu.Item key="1" onClick={this.changePassword}>{this.state.dict['header.password']}</Menu.Item> + {!this.props.editState ? <Menu.Item key="1" onClick={this.changePassword}>{this.state.dict['header.password']}</Menu.Item> : null} + <Menu.SubMenu title="鍒囨崲绯荤粺"> + {this.state.systems.map((system, index) => ( + <Menu.Item className="header-subSystem" key={'sub' + index} onClick={() => {this.changeSystem(system)}}> {system.AppName} </Menu.Item> + ))} + </Menu.SubMenu> <Menu.Item key="2" onClick={this.logout}>{this.state.dict['header.logout']}</Menu.Item> </Menu> ) @@ -308,6 +371,20 @@ > <Resetpwd dict={this.state.dict} wrappedComponentRef={(inst) => this.formRef = inst} resetPwdSubmit={this.resetPwdSubmit}/> </Modal> + {/* 缂栬緫鐘舵�佺櫥褰� */} + <Modal + title={this.state.dict['header.login.develop']} + okText={this.state.dict['header.confirm']} + cancelText={this.state.dict['header.cancel']} + visible={this.state.loginVisible} + onOk={this.loginSubmit} + width={'430px'} + confirmLoading={this.state.loginLoading} + onCancel={() => {this.setState({ loginVisible: false, loginLoading: false })}} + destroyOnClose + > + <LoginForm handleSubmit={() => this.loginSubmit()} wrappedComponentRef={(inst) => this.loginRef = inst}/> + </Modal> </header> ) } diff --git a/src/components/header/index.scss b/src/components/header/index.scss index ddaf1df..f4a50f4 100644 --- a/src/components/header/index.scss +++ b/src/components/header/index.scss @@ -107,6 +107,9 @@ padding: 5px 25px; } } +.header-subSystem { + min-width: 100px; +} .edit-switch { margin-left: 10px; } diff --git a/src/components/header/loginform.jsx b/src/components/header/loginform.jsx new file mode 100644 index 0000000..680c392 --- /dev/null +++ b/src/components/header/loginform.jsx @@ -0,0 +1,77 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { Form, Icon, Input } from 'antd' +import zhCN from '@/locales/zh-CN/login.js' +import enUS from '@/locales/en-US/login.js' +import './index.scss' + +class HeaderLoginForm extends Component { + static propTpyes = { + handleSubmit: PropTypes.func + } + + state = { + dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS + } + + handleConfirm = () => { + // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� + return new Promise((resolve, reject) => { + this.props.form.validateFieldsAndScroll((err, values) => { + if (!err) { + resolve(values) + } else { + reject(err) + } + }) + }) + } + + handleSubmit = e => { + // 鐧诲綍鍙傛暟妫�楠� + e.preventDefault() + this.props.handleSubmit() + } + + componentDidMount () { + const input = document.getElementById('username') + if (input) { + input.focus() + } + } + + render() { + const { getFieldDecorator } = this.props.form + + return ( + <Form style={{margin: '0px 10px'}}> + <Form.Item> + {getFieldDecorator('username', { + rules: [{ required: true, message: this.state.dict['login.username.empty'] }], + initialValue: '', + })( + <Input + prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />} + placeholder={this.state.dict['login.username']} + autoComplete="off" + onPressEnter={this.handleSubmit} + /> + )} + </Form.Item> + <Form.Item> + {getFieldDecorator('password', { + initialValue: '', + rules: [ + { + required: true, + message: this.state.dict['login.password.empty'], + } + ] + })(<Input.Password onPressEnter={this.handleSubmit} placeholder={this.state.dict['login.password']} prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />} />)} + </Form.Item> + </Form> + ) + } +} + +export default Form.create()(HeaderLoginForm) \ No newline at end of file diff --git a/src/components/sidemenu/editthdmenu/index.jsx b/src/components/sidemenu/editthdmenu/index.jsx index c8d4b19..721b40a 100644 --- a/src/components/sidemenu/editthdmenu/index.jsx +++ b/src/components/sidemenu/editthdmenu/index.jsx @@ -18,6 +18,7 @@ import './index.scss' const ComTableConfig = asyncLoadComponent(() => import('@/templates/comtableconfig')) +const FormTabConfig = asyncLoadComponent(() => import('@/templates/formtabconfig')) const ModalConfig = asyncLoadComponent(() => import('@/templates/modalconfig')) const SubTable = asyncLoadComponent(() => import('@/templates/subtableconfig')) @@ -447,7 +448,7 @@ } handleSubConfig = (item, originMenu, config, type) => { - if (type === 'button') { + if (type === 'button') { // 涓夌骇鑿滃崟椤甸潰锛屾寜閽厤缃� if (item.OpenType === 'pop') { let pageParam = '' if (config && config.type === 'Modal') { @@ -462,7 +463,7 @@ tabview: 'Modal' }) } - } else if (type === 'tab') { + } else if (type === 'tab') { // 涓夌骇鑿滃崟椤甸潰锛屾爣绛鹃厤缃� if (item.type === 'SubTable' || item.tabType === 'SubTable') { this.setState({ editMenu: originMenu, @@ -471,7 +472,7 @@ tabview: 'SubTable' }) } - } else if (type === 'tabButton') { + } else if (type === 'tabButton') { // 涓夌骇鑿滃崟涓嬶紝鏍囩涓嬶紝鎸夐挳閰嶇疆 let pageParam = '' if (config && config.type === 'Modal') { pageParam = config @@ -482,6 +483,18 @@ editAction: item, btnParam: pageParam, tabview: 'Modal' + }) + } else if (type === 'tabview') { // 涓夌骇鑿滃崟涓嬶紝鎵撳紑鏂版爣绛鹃〉鎴栧綋鍓嶉〉璺宠浆锛岀被鍨嬬殑鎸夐挳閰嶇疆 + let pageParam = '' + if (config && config.type === 'formTab') { + pageParam = config + } + + this.setState({ + editMenu: originMenu, + editAction: item, + btnParam: pageParam, + tabview: 'FormTab' }) } } @@ -623,6 +636,15 @@ handleSubConfig={this.handleSubConfig} /> } + {this.state.tabview === 'FormTab' && + <FormTabConfig + menu={this.state.editMenu} + config={this.state.btnParam} + editAction={this.state.editAction} + handleConfig={this.handleConfig} + handleSubConfig={this.handleSubConfig} + /> + } {/* 鍥剧墖棰勮 */} <Preview cancel={this.cancelPrePicture} preview={this.state.preview} template={this.state.pretemplate} confirm={this.useTemplate}/> {/* 瑙e喕鑿滃崟妯℃�佹 */} diff --git a/src/components/sidemenu/index.jsx b/src/components/sidemenu/index.jsx index 56ced81..e52bbf3 100644 --- a/src/components/sidemenu/index.jsx +++ b/src/components/sidemenu/index.jsx @@ -144,6 +144,11 @@ } changemenu(e) { + if (this.props.editState) { + e.preventDefault() + return + } + let menu = JSON.parse(e.target.dataset.item) if (menu.Ot === 'NewPage') { window.open(menu.src) diff --git a/src/index.js b/src/index.js index 2763702..f688691 100644 --- a/src/index.js +++ b/src/index.js @@ -22,18 +22,28 @@ ) } -document.title = (window.GLOB && window.GLOB.title) || 'MinkeSoft' +window.GLOB = window.GLOB || {} + +document.title = window.GLOB.title || 'MinkeSoft' const option = { white: 'mk-white' } -if (window.GLOB && window.GLOB.style && option[window.GLOB.style]) { +if (window.GLOB.style && option[window.GLOB.style]) { document.getElementById('root').className = option[window.GLOB.style] } +if (process.env.NODE_ENV === 'production') { + let service = window.GLOB.service ? (/\/$/.test(window.GLOB.service) ? window.GLOB.service : window.GLOB.service + '/') : '' + window.GLOB.subSystemApi = document.location.origin + '/' + service + 'webapi/dostar' +} else { + window.GLOB.subSystemApi = 'http://qingqiumarket.cn/mkwms/webapi/dostar' +} +sessionStorage.removeItem('isEditState') + render(Route) serviceWorker.unregister() diff --git a/src/locales/en-US/comtable.js b/src/locales/en-US/comtable.js index a714d92..3357cac 100644 --- a/src/locales/en-US/comtable.js +++ b/src/locales/en-US/comtable.js @@ -76,6 +76,7 @@ 'header.form.grid': 'Table', 'header.form.intertype': 'The interface type', 'header.form.interface': '鎺ュ彛鍦板潃', + 'header.form.sysInterface': '绯荤粺鎺ュ彛', 'header.form.interface.inner': '鍐呴儴', 'header.form.interface.outer': '澶栭儴', 'header.form.pageTemplate': '椤甸潰妯℃澘', diff --git a/src/locales/en-US/header.js b/src/locales/en-US/header.js index 5a40bc7..3b703ad 100644 --- a/src/locales/en-US/header.js +++ b/src/locales/en-US/header.js @@ -20,6 +20,7 @@ 'header.password.maxlen': 'The maximum password length is 12 bits!', 'header.password.diff': 'Two passwords that you enter is inconsistent!', 'header.password.resetsuccess': 'Password modified successfully!', + 'header.login.develop': '鐧诲綍寮�鍙戞満', 'header.menu.close': 'Are you sure to delete the menu <<@M>> ?', 'header.menu.update': 'Are you sure to modify the configuration information of the menu <<@M>> ?', 'header.menu.presave': 'Menu order has been adjusted, Please save!', diff --git a/src/locales/zh-CN/comtable.js b/src/locales/zh-CN/comtable.js index f3c5374..917d5c1 100644 --- a/src/locales/zh-CN/comtable.js +++ b/src/locales/zh-CN/comtable.js @@ -76,6 +76,7 @@ 'header.form.grid': '琛ㄦ牸', 'header.form.intertype': '鎺ュ彛绫诲瀷', 'header.form.interface': '鎺ュ彛鍦板潃', + 'header.form.sysInterface': '绯荤粺鎺ュ彛', 'header.form.interface.inner': '鍐呴儴', 'header.form.interface.outer': '澶栭儴', 'header.form.pageTemplate': '椤甸潰妯℃澘', diff --git a/src/locales/zh-CN/header.js b/src/locales/zh-CN/header.js index addf3c1..c01c6ae 100644 --- a/src/locales/zh-CN/header.js +++ b/src/locales/zh-CN/header.js @@ -20,6 +20,7 @@ 'header.password.maxlen': '鏈�澶у瘑鐮侀暱搴︿负12浣嶏紒', 'header.password.diff': '涓ゆ杈撳叆瀵嗙爜涓嶄竴鑷达紒', 'header.password.resetsuccess': '瀵嗙爜淇敼鎴愬姛锛�', + 'header.login.develop': '鐧诲綍寮�鍙戞満', 'header.menu.close': '纭畾鍒犻櫎銆夽M銆嬭彍鍗曞悧锛�', 'header.menu.update': '纭畾淇敼鑿滃崟銆夽M銆嬬殑閰嶇疆淇℃伅鍚楋紵', 'header.menu.presave': '鑿滃崟椤哄簭宸茶皟鏁达紝璇蜂繚瀛橈紒', diff --git a/src/store/options.js b/src/store/options.js index eabd2ff..b670fdc 100644 --- a/src/store/options.js +++ b/src/store/options.js @@ -1,6 +1,7 @@ // 绯荤粺閰嶇疆 export default { AppId: '201912040924165801464FF1788654BC5AC73', + cloudServiceApi: 'http://qingqiumarket.cn/mkwms/webapi/dostar', cloudDatabase: 'sqlserver', localDatabase: 'mysql' } \ No newline at end of file diff --git a/src/store/reducer.js b/src/store/reducer.js index 8ad32ae..703ad78 100644 --- a/src/store/reducer.js +++ b/src/store/reducer.js @@ -65,7 +65,9 @@ } case Type.RESET_EDITSTATE: // 閲嶇疆缂栬緫鐘舵�� - if (state.tabviews.length === 0 && !action.editState) { + if (action.editState) { + state.tabviews = [] + } else { state.tabviews = [{ MenuID: '1576117946681plembmkk9akkv8sn0vtdfdsfaf', MenuName: '棣栭〉', @@ -84,8 +86,7 @@ // 閲嶇疆缂栬緫绾у埆 return { ...state, - editLevel: action.editLevel, - tabviews: [] + editLevel: action.editLevel } case Type.INIT_PERMISSION: // 鍒濆鍖栨寜閽潈闄愬強鍒涘缓瀛樺偍杩囩▼鍙敤瀛楁 diff --git a/src/tabviews/rolemanage/index.jsx b/src/tabviews/rolemanage/index.jsx index bf43834..e5fdeac 100644 --- a/src/tabviews/rolemanage/index.jsx +++ b/src/tabviews/rolemanage/index.jsx @@ -46,18 +46,18 @@ async loadmaindata (pageIndex = 1, pageSize = 10, orderColumn = '', orderType = '', search = '') { // 鑾峰彇鍒楄〃鏁版嵁 - let result = await Api.getMainTableData(this.props.MenuNo, pageIndex, pageSize, orderColumn, orderType, search) - if (result.status) { - this.setState({ - data: result.data.map((item, index) => { - item.key = index - item.rows = item.mkrows - return item - }), - total: result.total, - loading: false - }) - } + // let result = await Api.getMainTableData(this.props.MenuNo, pageIndex, pageSize, orderColumn, orderType, search) + // if (result.status) { + // this.setState({ + // data: result.data.map((item, index) => { + // item.key = index + // item.rows = item.mkrows + // return item + // }), + // total: result.total, + // loading: false + // }) + // } } UNSAFE_componentWillMount () { diff --git a/src/tabviews/tableshare/actionList/index.jsx b/src/tabviews/tableshare/actionList/index.jsx index 7e7a439..3957b61 100644 --- a/src/tabviews/tableshare/actionList/index.jsx +++ b/src/tabviews/tableshare/actionList/index.jsx @@ -317,7 +317,11 @@ delete res.message delete res.status - res.rduri = btn.interface + if (btn.sysInterface === 'true') { + res.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi + } else { + res.rduri = btn.interface + } // res.method = btn.method if (btn.outerFunc) { res.func = btn.outerFunc @@ -331,7 +335,11 @@ }) } else { // 涓嶅瓨鍦ㄥ唴閮ㄥ嚱鏁版椂锛岀敓鎴愬閮ㄨ姹傚弬鏁� - param.rduri = btn.interface + if (btn.sysInterface === 'true') { + param.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi + } else { + param.rduri = btn.interface + } // param.method = btn.method if (btn.outerFunc) { param.func = btn.outerFunc @@ -437,7 +445,11 @@ delete res.message delete res.status - res.rduri = btn.interface + if (btn.sysInterface === 'true') { + res.rduri = window.GLOB.mainSystemApi || window.GLOB.subSystemApi + } else { + res.rduri = btn.interface + } // res.method = btn.method if (btn.outerFunc) { res.func = btn.outerFunc diff --git a/src/templates/comtableconfig/actionform/index.jsx b/src/templates/comtableconfig/actionform/index.jsx index 94154e2..529d81a 100644 --- a/src/templates/comtableconfig/actionform/index.jsx +++ b/src/templates/comtableconfig/actionform/index.jsx @@ -97,18 +97,18 @@ } else if (_opentype === 'outerpage') { // 鏂伴〉闈紙澶栭儴锛夛紝闇�瑕侀〉闈㈠湴鍧� _options = ['label', 'Ot', 'OpenType', 'url', 'icon', 'class', 'position'] } else if (_opentype === 'blank' || _opentype === 'tab') { // 鏂版爣绛炬垨褰撳墠椤甸潰鏇挎崲 - _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position'] + _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabTemplate'] } else if (_opentype === 'popview') { // 妯℃�佹鏍囩椤� _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] } else if (_opentype === 'excelIn' || _opentype === 'excelOut') { // 瀵煎叆瀵煎嚭 if (_intertype === 'outer') { - _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] } else { _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] } } else { if (_intertype === 'outer') { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'method'] + _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'method'] } else { _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] } @@ -176,12 +176,12 @@ } else if (value === 'outerpage') { _options = ['label', 'Ot', 'OpenType', 'url', 'icon', 'class', 'position'] } else if (value === 'blank' || value === 'tab') { - _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position'] + _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabTemplate'] } else if (value === 'popview') { _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] } else if (value === 'excelIn' || value === 'excelOut') { if (this.state.interType === 'outer') { - _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] } else { _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] } @@ -189,7 +189,7 @@ if (this.state.interType === 'inner') { _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] } else { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method'] + _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'method'] } } this.setState({ @@ -304,12 +304,35 @@ if (value === 'inner') { _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] } else { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method'] + _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'method'] } this.setState({ interType: value, formlist: this.state.formlist.map(item => { item.hidden = !_options.includes(item.key) + if (item.key === 'interface') { + item.readonly = false + } else if (item.key === 'sysInterface') { + item.initVal = 'false' + } + return item + }) + }) + } else if (key === 'sysInterface') { + if (value === 'true') { + this.props.form.setFieldsValue({ + interface: window.GLOB.mainSystemApi || window.GLOB.subSystemApi + }) + } + this.setState({ + interType: value, + formlist: this.state.formlist.map(item => { + if (item.key === 'interface' && value === 'true') { + item.readonly = true + } else if (item.key === 'interface') { + item.readonly = false + } + return item }) }) diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index f4ab260..89d3e62 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -289,7 +289,7 @@ * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 */ componentWillUnmount () { - this.setState = (state, callback) => { + this.setState = () => { return } } @@ -652,18 +652,40 @@ readonly: false }, { - type: 'text', - key: 'interface', - label: this.state.dict['header.form.interface'], - initVal: card.interface, + type: 'radio', + key: 'sysInterface', + label: this.state.dict['header.form.sysInterface'], + initVal: card.sysInterface || 'false', required: true, - readonly: false + options: [{ + value: 'true', + text: this.state.dict['header.form.true'] + }, { + value: 'false', + text: this.state.dict['header.form.false'] + }] }, { type: 'text', key: 'outerFunc', label: this.state.dict['header.form.outerFunc'], initVal: card.outerFunc, + required: false, + readonly: false + }, + { + type: 'text', + key: 'interface', + label: this.state.dict['header.form.interface'], + initVal: card.sysInterface === 'true' ? (window.GLOB.mainSystemApi || window.GLOB.subSystemApi) : card.interface, + required: true, + readonly: card.sysInterface === 'true' + }, + { + type: 'text', + key: 'callbackFunc', + label: this.state.dict['header.form.callbackFunc'], + initVal: card.callbackFunc, required: false, readonly: false }, @@ -682,20 +704,23 @@ }] }, { - type: 'text', - key: 'callbackFunc', - label: this.state.dict['header.form.callbackFunc'], - initVal: card.callbackFunc, - required: false, - readonly: false - }, - { type: 'select', key: 'Ot', label: this.state.dict['header.form.isRequired'], initVal: card.Ot || 'requiredSgl', required: true, options: [] + }, + { + type: 'select', + key: 'tabTemplate', + label: '鏍囩妯℃澘', + initVal: card.tabTemplate || 'formTab', + required: true, + options: [{ + value: 'formTab', + text: '甯︽爣绛捐〃鍗�' + }] }, { type: 'select', @@ -2582,12 +2607,14 @@ let _type = type if (type === 'button' && btn.OpenType === 'popview') { _type = 'tab' + } else if (type === 'button' && (btn.OpenType === 'tab' || btn.OpenType === 'blank')) { + _type = 'tabview' } - if (_type === 'button') { - uuid = btn.uuid - } else { + if (_type === 'tab') { uuid = btn.linkTab + } else { + uuid = btn.uuid } Api.getSystemConfig({ diff --git a/src/templates/comtableconfig/settingform/index.jsx b/src/templates/comtableconfig/settingform/index.jsx index 24ce02c..14b8934 100644 --- a/src/templates/comtableconfig/settingform/index.jsx +++ b/src/templates/comtableconfig/settingform/index.jsx @@ -202,13 +202,13 @@ })(<Input placeholder="" autoComplete="off" />)} </Form.Item> </Col> : null} - {interType !== 'outer' ? <Col span={24}> - <Form.Item help={'鏁版嵁ID锛�' + menu.MenuID} label={ + {interType !== 'outer' ? <Col span={24} style={{paddingLeft: '7px'}}> + <Form.Item labelCol={{xs: { span: 24 }, sm: { span: 4 }}} wrapperCol={ {xs: { span: 24 }, sm: { span: 20 }} } help={'鏁版嵁ID锛�' + menu.MenuID} label={ <Tooltip placement="topLeft" title="浣跨敤绯荤粺鍑芥暟鏃讹紝闇�濉啓鏁版嵁婧愶紝鑷畾涔夊嚱鏁版椂锛屽彲蹇界暐銆�"> <Icon type="question-circle" /> {'鏁版嵁婧�'} </Tooltip> - } className="textarea"> + }> {getFieldDecorator('dataresource', { initialValue: data.dataresource })(<TextArea rows={4} />)} diff --git a/src/templates/modalviewconfig/actionform/index.jsx b/src/templates/formtabconfig/actionform/index.jsx similarity index 100% rename from src/templates/modalviewconfig/actionform/index.jsx rename to src/templates/formtabconfig/actionform/index.jsx diff --git a/src/templates/modalviewconfig/actionform/index.scss b/src/templates/formtabconfig/actionform/index.scss similarity index 100% rename from src/templates/modalviewconfig/actionform/index.scss rename to src/templates/formtabconfig/actionform/index.scss diff --git a/src/templates/modalviewconfig/index.jsx b/src/templates/formtabconfig/index.jsx similarity index 94% rename from src/templates/modalviewconfig/index.jsx rename to src/templates/formtabconfig/index.jsx index 98489b1..365fc19 100644 --- a/src/templates/modalviewconfig/index.jsx +++ b/src/templates/formtabconfig/index.jsx @@ -33,12 +33,11 @@ class ComTableConfig extends Component { static propTpyes = { - type: PropTypes.string, menu: PropTypes.any, - reloadmenu: PropTypes.func, + editAction: PropTypes.object, + config: PropTypes.any, handleConfig: PropTypes.func, - handleSubConfig: PropTypes.func, - supMenuList: PropTypes.array + handleSubConfig: PropTypes.func } state = { @@ -66,7 +65,6 @@ tables: [], // 鍙敤琛ㄥ悕 selectedTables: [], // 宸查�夎〃鍚� originMenu: null, // 鍘熷鑿滃崟 - originActions: null, // 鍘熷鎸夐挳淇℃伅锛屼娇鐢ㄥ凡鏈夌敤鎴锋ā鏉� delActions: [], // 鍒犻櫎鎸夐挳鍒楄〃 funcLoading: false, // 瀛樺偍杩囩▼鍒涘缓涓� showColumnName: false, // 鏄剧ず鍒楀瓧娈靛悕鎺у埗 @@ -80,90 +78,42 @@ * 2銆佽缃搷浣滅被鍨嬨�佸師濮嬭彍鍗曚俊鎭紙姣忔淇濆瓨鍚庨噸缃級銆佸凡浣跨敤琛ㄥ強鍩烘湰淇℃伅琛ㄥ崟 */ UNSAFE_componentWillMount () { - const { menu } = this.props + const { menu, editAction, config } = this.props - let _LongParam = menu.LongParam + console.log(menu) + console.log(editAction) + console.log(config) let _config = '' - if (!_LongParam) { + if (!config) { _config = JSON.parse(JSON.stringify(Source.baseConfig)) - if (!menu.isSubtable) { // 涓嶆槸閫夋嫨涓诲瓙琛ㄦ椂锛岄殣钘忔爣绛鹃〉 - _config.tabs = [] - } } else { - _config = _LongParam + _config = config } - let _oriActions = [] - if (_config.type === 'user') { - _config.action = _config.action.map(item => { - let uuid = Utils.getuuid() - - if (item.OpenType === 'pop') { // 鍚湁瀛愰厤缃」鐨勬寜閽�傘�傘�� - _oriActions.push({ - prebtn: JSON.parse(JSON.stringify(item)), - curuuid: uuid, - Template: 'Modal' - }) - } - - item.uuid = uuid - - return item - }) - } - - _config.tabs = _config.tabs || [] - _config.tabgroups = _config.tabgroups || ['tabs'] - _config.setting.subtabs = _config.setting.subtabs || [] + // _config.action = _config.action.map(item => { + // item.uuid = Utils.getuuid() + // return item + // }) this.setState({ config: _config, - originActions: _oriActions, originMenu: JSON.parse(JSON.stringify(menu)), - selectedTables: _config.tables || [], + selectedTables: _config.tables, menuformlist: [ - { - type: 'select', - key: 'parentId', - label: this.state.dict['header.menu.supMenu'], - initVal: menu.ParentID, - required: true, - readonly: false, - options: this.props.supMenuList - }, { type: 'text', key: 'menuName', label: this.state.dict['header.menu.menuName'], initVal: menu.MenuName, - required: true, - readonly: false + readonly: true }, { type: 'text', - key: 'menuNo', - label: this.state.dict['header.menu.menuNo'], - initVal: menu.MenuNo, - required: true, - readonly: false - }, - { - type: 'select', - key: 'opentype', - label: this.state.dict['header.menu.openType'], - initVal: menu.PageParam.OpenType, - required: true, - options: [{ - MenuID: 'newtab', - text: this.state.dict['header.form.tab'] - }, { - MenuID: 'newpage', - text: this.state.dict['header.form.newpage'] - }, { - MenuID: 'currenttab', - text: this.state.dict['header.form.currenttab'] - }] + key: 'actionName', + label: '鎸夐挳鍚嶇О', + initVal: editAction.label, + readonly: true } ] }) @@ -289,7 +239,7 @@ * @description 缁勪欢閿�姣侊紝娓呴櫎state鏇存柊 */ componentWillUnmount () { - this.setState = (state, callback) => { + this.setState = () => { return } } @@ -2022,7 +1972,6 @@ * @description 淇濆瓨鎴栦慨鏀硅彍鍗曟寜閽� */ submitAction = (btnParam, tabParam) => { - const { config } = this.state new Promise(resolve => { // 鍐呴儴璇锋眰 if (this.state.delActions.length > 0) { @@ -2079,13 +2028,13 @@ if (btnParam.LText) { return Api.getSystemConfig(btnParam) } else { - return 'copy' + return 'true' } }).then(response => { - if (response === false || response === 'copy') return response + if (response === false || response === 'true') return response if (response.status) { - return 'copy' + return 'true' } else { notification.warning({ top: 92, @@ -2094,57 +2043,6 @@ }) return false } - }).then(response => { - if (response === false) return response - - let oriActions = [] - this.state.originActions.forEach(item => { - let curBtn = config.action.filter(cell => item.curuuid === cell.uuid)[0] // 鏌ョ湅鍒濆鍖栨寜閽槸鍚﹀瓨鍦� - if (!curBtn) return - if (curBtn.OpenType !== item.prebtn.OpenType) return - - oriActions.push({ - prebtn: item.prebtn, - curBtn: curBtn - }) - }) - - if (oriActions.length === 0) return 'true' - - oriActions.forEach(action => { - Api.getSystemConfig({ - func: 'sPC_Get_LongParam', - MenuID: action.prebtn ? action.prebtn.uuid : '' - }).then(result => { - if (result.status && result.LongParam) { - let _LongParam = '' - - if (result.LongParam) { - _LongParam = window.decodeURIComponent(window.atob(result.LongParam)) - try { - _LongParam = JSON.parse(_LongParam) - } catch (e) { - _LongParam = '' - } - } - - if (_LongParam) { - let param = { - func: 'sPC_ButtonParam_AddUpt', - ParentID: this.props.menu.MenuID, - MenuID: action.curBtn.uuid, - MenuNo: this.props.menu.MenuNo, - Template: _LongParam.type, - MenuName: action.curBtn.label, - PageParam: JSON.stringify({Template: _LongParam.type}), - LongParam: result.LongParam - } - Api.getSystemConfig(param).then(() => {}) - } - } - }) - }) - return 'true' }).then(response => { if (response === 'true') { notification.success({ @@ -2732,10 +2630,6 @@ } render () { - const configAction = this.state.config.action.filter(_action => - !_action.origin && (_action.OpenType === 'pop' || _action.OpenType === 'popview' || _action.OpenType === 'blank' || _action.OpenType === 'tab') - ) - let configTabs = [] this.state.config.tabgroups.forEach(group => { configTabs.push(...this.state.config[group]) @@ -2809,35 +2703,6 @@ return (<SourceElement key={index} content={item}/>) })} </div> - {configAction.length > 0 ? - <p className="config-btn-title"> - <Tooltip placement="topLeft" title="鐐瑰嚮鎸夐挳锛屽彲瀹屾垚鎴栨煡鐪嬫寜閽厤缃俊鎭��"> - <Icon type="question-circle" /> - </Tooltip> - {this.state.dict['header.menu.action.configurable']} - </p> : null - } - {configAction.map((item, index) => { - return ( - <div key={index}> - <Button - icon={item.icon} - style={{marginBottom: '10px'}} - className={'config-button mk-btn mk-' + item.class} - onClick={() => this.setSubConfig(item, 'button')} - >{item.label}</Button> - </div> - ) - })} - </Panel> - {/* 娣诲姞鏄剧ず鍒� */} - <Panel header={this.state.dict['header.menu.column']} key="3"> - <div className="search-element"> - {Source.columnItems.map((item, index) => { - return (<SourceElement key={index} content={item}/>) - })} - </div> - <Button type="primary" block onClick={() => this.queryField('columns')}>{this.state.dict['header.menu.column.add']}</Button> </Panel> {/* 娣诲姞鏍囩 */} <Panel header={this.state.dict['header.menu.tab']} key="4"> diff --git a/src/templates/modalviewconfig/index.scss b/src/templates/formtabconfig/index.scss similarity index 100% rename from src/templates/modalviewconfig/index.scss rename to src/templates/formtabconfig/index.scss diff --git a/src/templates/modalviewconfig/settingform/index.jsx b/src/templates/formtabconfig/settingform/index.jsx similarity index 100% rename from src/templates/modalviewconfig/settingform/index.jsx rename to src/templates/formtabconfig/settingform/index.jsx diff --git a/src/templates/modalviewconfig/settingform/index.scss b/src/templates/formtabconfig/settingform/index.scss similarity index 100% rename from src/templates/modalviewconfig/settingform/index.scss rename to src/templates/formtabconfig/settingform/index.scss diff --git a/src/templates/modalviewconfig/source.jsx b/src/templates/formtabconfig/source.jsx similarity index 76% rename from src/templates/modalviewconfig/source.jsx rename to src/templates/formtabconfig/source.jsx index c0240de..aba4f91 100644 --- a/src/templates/modalviewconfig/source.jsx +++ b/src/templates/formtabconfig/source.jsx @@ -6,21 +6,16 @@ class CommonTableBaseData { baseConfig = { - type: 'system', + type: 'formTab', enabled: false, setting: { - actionfixed: false, - columnfixed: false, tableName: '', - tableType: 'checkbox', primaryKey: '', - order: '', dataresource: '', interType: 'inner', innerFunc: '', interface: '', outerFunc: '', - onload: 'true', subtabs: [] }, tables: [], @@ -153,60 +148,6 @@ verify: null } ], - columns: [ - { - origin: true, - uuid: Utils.getuuid(), - Align: 'left', - label: 'label', - field: '', - Hide: 'false', - IsSort: 'true', - type: 'text', - Width: 120 - }, { - origin: true, - uuid: Utils.getuuid(), - Align: 'left', - label: 'label', - field: '', - Hide: 'false', - IsSort: 'true', - type: 'text', - Width: 120 - }, { - origin: true, - uuid: Utils.getuuid(), - Align: 'left', - label: 'label', - field: '', - Hide: 'false', - IsSort: 'true', - type: 'text', - Width: 120 - }, { - origin: true, - uuid: Utils.getuuid(), - Align: 'left', - label: 'label', - field: '', - Hide: 'false', - IsSort: 'true', - type: 'text', - Width: 120 - } - ], - gridBtn: { - display: false, - Align: 'center', - IsSort: 'false', - uuid: Utils.getuuid(), - label: CommonDict['header.form.column.action'], - type: 'action', - style: 'button', - show: 'horizontal', - Width: 120 - }, tabs: [ { origin: true, // 鏄惁涓虹ず渚� @@ -332,33 +273,6 @@ type: 'action', label: CommonDict['header.form.newpage.outer'], subType: 'outerpage', - url: '' - } - ] - - columnItems = [ - { - type: 'columns', - label: CommonDict['header.form.text'], - subType: 'text', - url: '' - }, - { - type: 'columns', - label: CommonDict['header.form.number'], - subType: 'number', - url: '' - }, - { - type: 'columns', - label: CommonDict['header.form.picture'], - subType: 'picture', - url: '' - }, - { - type: 'columns', - label: CommonDict['header.form.colspan'], - subType: 'colspan', url: '' } ] diff --git a/src/templates/modalviewconfig/tabdragelement/card.jsx b/src/templates/formtabconfig/tabdragelement/card.jsx similarity index 100% rename from src/templates/modalviewconfig/tabdragelement/card.jsx rename to src/templates/formtabconfig/tabdragelement/card.jsx diff --git a/src/templates/modalviewconfig/tabdragelement/index.jsx b/src/templates/formtabconfig/tabdragelement/index.jsx similarity index 100% rename from src/templates/modalviewconfig/tabdragelement/index.jsx rename to src/templates/formtabconfig/tabdragelement/index.jsx diff --git a/src/templates/modalviewconfig/tabdragelement/index.scss b/src/templates/formtabconfig/tabdragelement/index.scss similarity index 100% rename from src/templates/modalviewconfig/tabdragelement/index.scss rename to src/templates/formtabconfig/tabdragelement/index.scss diff --git a/src/templates/modalviewconfig/tabform/index.jsx b/src/templates/formtabconfig/tabform/index.jsx similarity index 100% rename from src/templates/modalviewconfig/tabform/index.jsx rename to src/templates/formtabconfig/tabform/index.jsx diff --git a/src/templates/modalviewconfig/tabform/index.scss b/src/templates/formtabconfig/tabform/index.scss similarity index 100% rename from src/templates/modalviewconfig/tabform/index.scss rename to src/templates/formtabconfig/tabform/index.scss diff --git a/src/templates/modalconfig/dragelement/card.jsx b/src/templates/modalconfig/dragelement/card.jsx index 31dd057..ea5c8e2 100644 --- a/src/templates/modalconfig/dragelement/card.jsx +++ b/src/templates/modalconfig/dragelement/card.jsx @@ -6,6 +6,7 @@ import './index.scss' const { MonthPicker } = DatePicker +const { TextArea } = Input const Card = ({ id, card, moveCard, findCard, editCard, closeCard, hasDrop }) => { const originalIndex = findCard(id).index @@ -80,7 +81,9 @@ } {card.type === 'datetime' && <DatePicker showTime defaultValue={card.initval ? moment().subtract(card.initval, 'days') : null} /> - // <DatePicker showTime defaultValue={card.initval ? moment(card.initval, 'YYYY-MM-DD HH:mm:ss') : null} /> + } + {card.type === 'textarea' && + <TextArea autoSize={{ minRows: 2, maxRows: 6 }} /> } {card.type === 'fileupload' && <Button> diff --git a/src/templates/modalconfig/dragelement/index.jsx b/src/templates/modalconfig/dragelement/index.jsx index fc28b03..677b61d 100644 --- a/src/templates/modalconfig/dragelement/index.jsx +++ b/src/templates/modalconfig/dragelement/index.jsx @@ -115,7 +115,7 @@ return ( <div ref={drop} className="ant-row modal-fields-row"> {cards.map(card => ( - <Col key={card.uuid} span={_cols}> + <Col key={card.uuid} span={card.type !== 'textarea' ? _cols : 24}> <Card id={`${card.uuid}`} card={card} diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index d692cb9..00530a6 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -385,6 +385,9 @@ value: 'datetime', text: this.state.dict['header.form.datetime'] }, { + value: 'textarea', + text: '澶氳鏂囨湰' + }, { value: 'funcvar', text: '鍑芥暟鍙橀噺' }] diff --git a/src/templates/modalconfig/index.scss b/src/templates/modalconfig/index.scss index a40f2e0..04547e8 100644 --- a/src/templates/modalconfig/index.scss +++ b/src/templates/modalconfig/index.scss @@ -163,6 +163,7 @@ } .modal-form { + padding: 0px 24px; min-height: 87px; .group-title { position: relative; diff --git a/src/templates/subtableconfig/actionform/index.jsx b/src/templates/subtableconfig/actionform/index.jsx index 6f91fe3..61aa516 100644 --- a/src/templates/subtableconfig/actionform/index.jsx +++ b/src/templates/subtableconfig/actionform/index.jsx @@ -88,13 +88,13 @@ _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] } else if (_opentype === 'excelIn' || _opentype === 'excelOut') { if (_intertype === 'outer') { - _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] } else { _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] } } else { if (_intertype === 'outer') { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'method'] + _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'method'] } else { _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] } @@ -156,7 +156,7 @@ _options = ['label', 'Ot', 'OpenType', 'icon', 'class', 'position', 'tabType', 'linkTab', 'popClose'] } else if (value === 'excelIn' || value === 'excelOut') { if (this.state.interType === 'outer') { - _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] + _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'icon', 'class', 'execSuccess', 'execError', 'method'] } else { _options = ['label', 'OpenType', 'intertype', 'innerFunc', 'icon', 'class', 'execSuccess', 'execError'] } @@ -164,7 +164,7 @@ if (this.state.interType === 'inner') { _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] } else { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method'] + _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'method'] } } @@ -275,12 +275,35 @@ if (value === 'inner') { _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sql', 'sqlType'] } else { - _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'interface', 'outerFunc', 'callbackFunc', 'method'] + _options = ['label', 'position', 'OpenType', 'intertype', 'innerFunc', 'Ot', 'icon', 'class', 'execSuccess', 'execError', 'sysInterface', 'interface', 'outerFunc', 'callbackFunc', 'method'] } this.setState({ interType: value, formlist: this.state.formlist.map(item => { item.hidden = !_options.includes(item.key) + if (item.key === 'interface') { + item.readonly = false + } else if (item.key === 'sysInterface') { + item.initVal = 'false' + } + return item + }) + }) + } else if (key === 'sysInterface') { + if (value === 'true') { + this.props.form.setFieldsValue({ + interface: window.GLOB.mainSystemApi || window.GLOB.subSystemApi + }) + } + this.setState({ + interType: value, + formlist: this.state.formlist.map(item => { + if (item.key === 'interface' && value === 'true') { + item.readonly = true + } else if (item.key === 'interface') { + item.readonly = false + } + return item }) }) diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx index 17e5f10..1735682 100644 --- a/src/templates/subtableconfig/index.jsx +++ b/src/templates/subtableconfig/index.jsx @@ -577,12 +577,18 @@ readonly: false }, { - type: 'text', - key: 'interface', - label: this.state.dict['header.form.interface'], - initVal: card.interface, + type: 'radio', + key: 'sysInterface', + label: this.state.dict['header.form.sysInterface'], + initVal: card.sysInterface || 'false', required: true, - readonly: false + options: [{ + value: 'true', + text: this.state.dict['header.form.true'] + }, { + value: 'false', + text: this.state.dict['header.form.false'] + }] }, { type: 'text', @@ -594,6 +600,14 @@ }, { type: 'text', + key: 'interface', + label: this.state.dict['header.form.interface'], + initVal: card.sysInterface === 'true' ? (window.GLOB.mainSystemApi || window.GLOB.subSystemApi) : card.interface, + required: true, + readonly: card.sysInterface === 'true' + }, + { + type: 'text', key: 'callbackFunc', label: this.state.dict['header.form.callbackFunc'], initVal: card.callbackFunc, diff --git a/src/views/login/index.jsx b/src/views/login/index.jsx index eab86ed..8735bcb 100644 --- a/src/views/login/index.jsx +++ b/src/views/login/index.jsx @@ -56,10 +56,9 @@ async loginsubmit (param) { // 鐧诲綍鎻愪氦 // let password = this.md5Password(param.password) - let password = param.password - let result = await Api.loginsystem(param.username, password) + let result = await Api.loginsystem(param.username, param.password) if (!result.IsError) { - Api.getusermsg(param.username, password).then(res => { + Api.getusermsg(param.username, param.password).then(res => { if (res.status) { sessionStorage.setItem('UserID', res.UserID) sessionStorage.setItem('SessionUid', Utils.getuuid()) -- Gitblit v1.8.0