From bb47f06e3c5eaf568aaecf870736787373ce73aa Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 18 六月 2021 13:28:11 +0800 Subject: [PATCH] 2021-06-18 --- src/mob/header/index.jsx | 16 + src/mob/components/navbar/normal-navbar/menusetting/menutable/index.jsx | 18 src/views/mobdesign/menuform/index.jsx | 4 src/views/pcdesign/menuform/index.jsx | 4 src/pc/createview/settingform/index.scss | 11 + src/utils/utils-custom.js | 4 src/menu/components/card/cardcellcomponent/dragaction/action.jsx | 2 src/pc/components/navbar/normal-navbar/menusetting/menutable/index.jsx | 30 +- src/templates/sharecomponent/fieldscomponent/index.jsx | 3 src/menu/components/form/formaction/index.jsx | 18 + src/templates/sharecomponent/tablecomponent/index.jsx | 1 src/views/mobdesign/index.scss | 4 src/views/billprint/index.jsx | 2 src/views/mobdesign/index.jsx | 70 ++++- src/mob/mobshell/card.jsx | 4 src/index.js | 2 src/menu/components/search/main-search/dragsearch/index.jsx | 4 src/views/pcdesign/index.jsx | 27 +- src/menu/components/share/actioncomponent/formconfig.jsx | 18 src/pc/menushell/card.jsx | 4 src/pc/createview/index.scss | 0 src/menu/components/card/cardcomponent/index.jsx | 10 src/pc/createview/index.jsx | 201 ++++++++++++++++++ src/menu/components/share/actioncomponent/index.jsx | 2 src/tabviews/custom/components/form/normal-form/index.jsx | 21 + src/tabviews/zshare/mutilform/checkCard/index.scss | 3 src/tabviews/zshare/mutilform/index.jsx | 2 src/menu/components/card/cardcellcomponent/formconfig.jsx | 20 src/tabviews/custom/index.jsx | 2 src/mob/header/index.scss | 8 src/views/appmanage/index.jsx | 13 package.json | 2 src/menu/stylecombcontrolbutton/index.jsx | 8 src/views/appmanage/submutilform/index.jsx | 13 - src/pc/createview/settingform/index.jsx | 107 +++++++++ 35 files changed, 531 insertions(+), 127 deletions(-) diff --git a/package.json b/package.json index e9d796b..aaef24f 100644 --- a/package.json +++ b/package.json @@ -192,7 +192,7 @@ ] ] }, - "homepage": "./build", + "homepage": ".", "devDependencies": { "typescript": "^4.0.2" } diff --git a/src/index.js b/src/index.js index fcc809d..3882a86 100644 --- a/src/index.js +++ b/src/index.js @@ -59,7 +59,7 @@ // 鏂扮郴缁熸枃浠剁疆浜巃dmin涓� ../options.json -fetch('./options.json') +fetch('../options.json') .then(response => response.json()) .catch(() => { document.getElementById('root').innerHTML = '<div style="text-align: center; font-size: 30px; margin-top: 40vh;">绯荤粺閰嶇疆淇℃伅鑾峰彇澶辫触锛岃鑱旂郴绠$悊鍛橈紒</div>' diff --git a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx b/src/menu/components/card/cardcellcomponent/dragaction/action.jsx index c70d6cc..4ce1876 100644 --- a/src/menu/components/card/cardcellcomponent/dragaction/action.jsx +++ b/src/menu/components/card/cardcellcomponent/dragaction/action.jsx @@ -56,7 +56,7 @@ {hasProfile ? <Icon className="profile" title="setting" type="profile" onClick={() => profileCard(id)} /> : null} </div> } trigger="hover"> - <div ref={node => drag(drop(node))} className={'ant-col card-button-cell ant-col-' + card.width} onDoubleClick={() => doubleClickCard(id)}> + <div ref={node => drag(drop(node))} className={'ant-col card-button-cell ant-col-' + card.width} onDoubleClick={(e) => {e.stopPropagation(); doubleClickCard(id)}}> <div style={{opacity: isDragging ? 0 : 1}}> {btnElement} </div> diff --git a/src/menu/components/card/cardcellcomponent/formconfig.jsx b/src/menu/components/card/cardcellcomponent/formconfig.jsx index 14fc7b3..ac0423d 100644 --- a/src/menu/components/card/cardcellcomponent/formconfig.jsx +++ b/src/menu/components/card/cardcellcomponent/formconfig.jsx @@ -362,7 +362,7 @@ forbid: !isApp, options: [ { value: '', text: '鏃�' }, - { value: 'page', text: '鑿滃崟' }, + // { value: 'page', text: '鑿滃崟' }, { value: 'linkpage', text: '鍏宠仈鑿滃崟' }, { value: 'custom', text: '閾炬帴' } ] @@ -388,15 +388,15 @@ { value: 'self', text: '褰撳墠椤甸潰' } ] }, - { - type: 'select', - key: 'copyMenuId', - label: '澶嶅埗鑿滃崟', - initVal: card.copyMenuId || '', - required: false, - forbid: !isApp, - options: appMenus - }, + // { + // type: 'select', + // key: 'copyMenuId', + // label: '澶嶅埗鑿滃崟', + // initVal: card.copyMenuId || '', + // required: false, + // forbid: !isApp, + // options: appMenus + // }, { type: 'radio', key: 'joint', diff --git a/src/menu/components/card/cardcomponent/index.jsx b/src/menu/components/card/cardcomponent/index.jsx index 79b4767..9d50255 100644 --- a/src/menu/components/card/cardcomponent/index.jsx +++ b/src/menu/components/card/cardcomponent/index.jsx @@ -221,6 +221,14 @@ } } + doubleClickCard = () => { + const { card } = this.state + + if (card.setting.click === 'menu' && card.setting.menu) { + MKEmitter.emit('changeEditMenu', {MenuID: card.setting.menu}) + } + } + render() { const { cards, offset } = this.props const { card, elements, side, settingVisible, dict } = this.state @@ -245,7 +253,7 @@ return ( <Col span={card.setting.width || 6} offset={offset || 0}> - <div className="card-item" style={_style} onClick={this.clickComponent} id={card.uuid}> + <div className="card-item" style={_style} onClick={this.clickComponent} onDoubleClick={(e) => {e.stopPropagation(); this.doubleClickCard()}} id={card.uuid}> <CardCellComponent cards={cards} cardCell={card} side={side} elements={elements} updateElement={this.updateCard}/> <div className="card-control"> <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ diff --git a/src/menu/components/form/formaction/index.jsx b/src/menu/components/form/formaction/index.jsx index 7d92ae8..34d1b60 100644 --- a/src/menu/components/form/formaction/index.jsx +++ b/src/menu/components/form/formaction/index.jsx @@ -24,6 +24,7 @@ state = { dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, + appType: sessionStorage.getItem('appType'), card: null, // 缂栬緫涓厓绱� formlist: null, // 琛ㄥ崟淇℃伅 visible: false, // 妯℃�佹鎺у埗 @@ -173,6 +174,21 @@ }) } + changeMenu = () => { + const { appType } = this.state + const { group } = this.props + + if (appType !== 'pc' && appType !== 'mob') return + if (!group.subButton.linkmenu) return + + MKEmitter.emit('changeEditMenu', { + MenuID: group.subButton.linkmenu, + copyMenuId: '', + MenuNo: '', + MenuName: '', + }) + } + render() { const { group, config } = this.props const { visible, profVisible, card, dict } = this.state @@ -194,7 +210,7 @@ <Icon className="profile" title="setting" type="profile" onClick={() => this.profileAction()} /> </div> } trigger="hover"> - <Button type="link" className="submit mk-primary" style={resetStyle(group.subButton.style)}>{group.subButton.label}</Button> + <Button type="link" className="submit mk-primary" onDoubleClick={this.changeMenu} style={resetStyle(group.subButton.style)}>{group.subButton.label}</Button> </Popover> {group.sort !== config.subcards.length ? <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ <div className="mk-popover-control"> diff --git a/src/menu/components/search/main-search/dragsearch/index.jsx b/src/menu/components/search/main-search/dragsearch/index.jsx index ce5e141..85609fd 100644 --- a/src/menu/components/search/main-search/dragsearch/index.jsx +++ b/src/menu/components/search/main-search/dragsearch/index.jsx @@ -77,6 +77,8 @@ drop() {} }) + const appType = sessionStorage.getItem('appType') + return ( <div ref={drop} className="ant-row"> {cards.map(card => ( @@ -99,7 +101,7 @@ </div> <div className="ant-col ant-form-item-control-wrapper ant-col-xs-24 ant-col-sm-16"> <Button type="primary">鎼滅储</Button> - <Button style={{ marginLeft: 8 }}>閲嶇疆</Button> + {appType !== 'mob' ? <Button style={{ marginLeft: 8 }}>閲嶇疆</Button> : null} <div style={{position: 'absolute', top: 0, bottom: 0, left: 0, right: 0}}></div> </div> </div> diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 1259cd5..c4b7f0f 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -59,7 +59,7 @@ if (isApp) { opentypes = opentypes.filter(item => item.value !== 'tab') pageTemps = [ - { value: 'page', text: '鑿滃崟' }, + // { value: 'page', text: '鑿滃崟' }, { value: 'linkpage', text: '鍏宠仈鑿滃崟' }, { value: 'billprint', text: '鍗曟嵁鎵撳嵃' }, { value: 'pay', text: Formdict['model.pay'] }, @@ -215,14 +215,14 @@ required: true, options: appMenus }, - { - type: 'select', - key: 'copyMenuId', - label: '澶嶅埗鑿滃崟', - initVal: card.copyMenuId || '', - required: false, - options: appMenus - }, + // { + // type: 'select', + // key: 'copyMenuId', + // label: '澶嶅埗鑿滃崟', + // initVal: card.copyMenuId || '', + // required: false, + // options: appMenus + // }, { type: 'textarea', key: 'url', diff --git a/src/menu/components/share/actioncomponent/index.jsx b/src/menu/components/share/actioncomponent/index.jsx index d9483e6..38ae2a2 100644 --- a/src/menu/components/share/actioncomponent/index.jsx +++ b/src/menu/components/share/actioncomponent/index.jsx @@ -405,7 +405,7 @@ */ btnDoubleClick = (element) => { if (sessionStorage.getItem('style-control') && sessionStorage.getItem('style-control') === 'true') return - + if (element.OpenType === 'pop' || element.OpenType === 'popview' || element.execMode === 'pop') { this.props.setSubConfig(element) } else if (element.OpenType === 'innerpage' && element.pageTemplate === 'page') { diff --git a/src/menu/stylecombcontrolbutton/index.jsx b/src/menu/stylecombcontrolbutton/index.jsx index 19f3454..b644e5b 100644 --- a/src/menu/stylecombcontrolbutton/index.jsx +++ b/src/menu/stylecombcontrolbutton/index.jsx @@ -12,7 +12,7 @@ } state = { - label: '璋冩暣', + label: '鎵归噺璋冩暣', parent: null, type: '', components: [] @@ -127,7 +127,7 @@ triggerStyleChange = () => { const { label, components } = this.state - if (label === '璋冩暣') { + if (label === '鎵归噺璋冩暣') { document.body.className = 'style-control' sessionStorage.setItem('style-control', 'true') this.setState({label: '閫�鍑�'}) @@ -141,14 +141,14 @@ MKEmitter.emit('closeCombineStyle') - this.setState({label: '璋冩暣', parent: null, components: []}) + this.setState({label: '鎵归噺璋冩暣', parent: null, components: []}) } } render() { const { label } = this.state return ( - <Button className="style-control-button" icon="font-colors" title="璋冩暣鏍峰紡" onClick={this.triggerStyleChange}>{label}</Button> + <Button className="style-control-button" icon="font-colors" title="鎵归噺璋冩暣鏍峰紡" onClick={this.triggerStyleChange}>{label}</Button> ) } } diff --git a/src/mob/components/navbar/normal-navbar/menusetting/menutable/index.jsx b/src/mob/components/navbar/normal-navbar/menusetting/menutable/index.jsx index 5327876..3379a03 100644 --- a/src/mob/components/navbar/normal-navbar/menusetting/menutable/index.jsx +++ b/src/mob/components/navbar/normal-navbar/menusetting/menutable/index.jsx @@ -5,7 +5,7 @@ import MenuForm from '../menuform' import Utils from '@/utils/utils.js' -import MKEmitter from '@/utils/events.js' +// import MKEmitter from '@/utils/events.js' import './index.scss' const { confirm } = Modal @@ -89,15 +89,15 @@ onOk() { _this.setState({data: data.filter(item => item.MenuID !== record.MenuID)}) - let uuids = [record.MenuID] - record.sublist && record.sublist.forEach(item => { - uuids.push(item.MenuID) + // let uuids = [record.MenuID] + // record.sublist && record.sublist.forEach(item => { + // uuids.push(item.MenuID) - item.sublist && item.sublist.forEach(cell => { - uuids.push(cell.MenuID) - }) - }) - MKEmitter.emit('delButtons', uuids) + // item.sublist && item.sublist.forEach(cell => { + // uuids.push(cell.MenuID) + // }) + // }) + // MKEmitter.emit('delButtons', uuids) }, onCancel() {} }) diff --git a/src/mob/header/index.jsx b/src/mob/header/index.jsx index 38c5863..5bf90ea 100644 --- a/src/mob/header/index.jsx +++ b/src/mob/header/index.jsx @@ -1,4 +1,5 @@ import React, {Component} from 'react' +import { Radio } from 'antd' import avatar from '@/assets/img/avatar.jpg' import MainLogo from '@/assets/img/main-logo.png' @@ -7,13 +8,26 @@ class MobHeader extends Component { state = { avatar: sessionStorage.getItem('CloudAvatar') || avatar, - userName: sessionStorage.getItem('CloudUserName') + userName: sessionStorage.getItem('CloudUserName'), + typename: sessionStorage.getItem('typename') + } + + changeView = (e) => { + let val = e.target.value + this.props.changeView(val) } render () { + const { typename } = this.state return ( <header className="mob-header-container"> <div className="header-logo"><img src={MainLogo} alt=""/></div> + {typename === 'pad' ? <div className="change-view"> + <Radio.Group defaultValue="vertical" onChange={this.changeView}> + <Radio value="vertical">绔栧睆</Radio> + <Radio value="horizontal">妯睆</Radio> + </Radio.Group> + </div> : null} <div className="header-user"> <img src={this.state.avatar} alt=""/> <span> diff --git a/src/mob/header/index.scss b/src/mob/header/index.scss index 40ac737..b4009e2 100644 --- a/src/mob/header/index.scss +++ b/src/mob/header/index.scss @@ -45,4 +45,12 @@ } } } + .change-view { + position: absolute; + left: calc(50% - 70px); + top: 12px; + .ant-radio-wrapper { + color: #ffffff; + } + } } \ No newline at end of file diff --git a/src/mob/mobshell/card.jsx b/src/mob/mobshell/card.jsx index 897383f..aa883db 100644 --- a/src/mob/mobshell/card.jsx +++ b/src/mob/mobshell/card.jsx @@ -64,10 +64,10 @@ if (card.wrap && card.wrap.height) { // scaleview height = card.wrap.height.replace(/\d+vw/ig, (word) => { - return parseFloat(word) * 420 / 100 + 'px' + return parseFloat(word) * (window.GLOB.winWidth || 420) / 100 + 'px' // return parseFloat(word) * 350 / 100 + 'px' }).replace(/\d+vh/ig, (word) => { - return parseFloat(word) * 738 / 100 + 'px' + return parseFloat(word) * (window.GLOB.winHeight || 738) / 100 + 'px' // return parseFloat(word) * 615 / 100 + 'px' }) } diff --git a/src/pc/components/navbar/normal-navbar/menusetting/menutable/index.jsx b/src/pc/components/navbar/normal-navbar/menusetting/menutable/index.jsx index 92d751b..d5a629a 100644 --- a/src/pc/components/navbar/normal-navbar/menusetting/menutable/index.jsx +++ b/src/pc/components/navbar/normal-navbar/menusetting/menutable/index.jsx @@ -5,7 +5,7 @@ import MenuForm from '../menuform' import Utils from '@/utils/utils.js' -import MKEmitter from '@/utils/events.js' +// import MKEmitter from '@/utils/events.js' import './index.scss' const { confirm } = Modal @@ -97,7 +97,7 @@ let _data = _this.state.data.filter(item => item.MenuID !== record.MenuID) _this.setState({data: _data}) _this.props.menuUpdate({...menu, sublist: _data}) - MKEmitter.emit('delButtons', [record.MenuID]) + // MKEmitter.emit('delButtons', [record.MenuID]) }, onCancel() {} }) @@ -264,11 +264,11 @@ _this.setState({data: _data}) _this.props.menuUpdate({...menu, sublist: _data}) - let uuids = [record.MenuID] - record.sublist && record.sublist.forEach(item => { - uuids.push(item.MenuID) - }) - MKEmitter.emit('delButtons', uuids) + // let uuids = [record.MenuID] + // record.sublist && record.sublist.forEach(item => { + // uuids.push(item.MenuID) + // }) + // MKEmitter.emit('delButtons', uuids) }, onCancel() {} }) @@ -445,15 +445,15 @@ onOk() { _this.setState({data: data.filter(item => item.MenuID !== record.MenuID)}) - let uuids = [record.MenuID] - record.sublist && record.sublist.forEach(item => { - uuids.push(item.MenuID) + // let uuids = [record.MenuID] + // record.sublist && record.sublist.forEach(item => { + // uuids.push(item.MenuID) - item.sublist && item.sublist.forEach(cell => { - uuids.push(cell.MenuID) - }) - }) - MKEmitter.emit('delButtons', uuids) + // item.sublist && item.sublist.forEach(cell => { + // uuids.push(cell.MenuID) + // }) + // }) + // MKEmitter.emit('delButtons', uuids) }, onCancel() {} }) diff --git a/src/pc/createview/index.jsx b/src/pc/createview/index.jsx new file mode 100644 index 0000000..9dd88d5 --- /dev/null +++ b/src/pc/createview/index.jsx @@ -0,0 +1,201 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { is, fromJS } from 'immutable' +import { Button, Modal, notification } from 'antd' +import moment from 'moment' + +import zhCN from '@/locales/zh-CN/model.js' +import enUS from '@/locales/en-US/model.js' +import Utils from '@/utils/utils.js' +import MenuUtils from '@/utils/utils-custom.js' +import SettingForm from './settingform' +import Api from '@/api' +import './index.scss' + +class CreateView extends Component { + static propTpyes = { + resetmenu: PropTypes.func + } + + state = { + dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, + visible: false, + loading: false + } + + shouldComponentUpdate (nextProps, nextState) { + return !is(fromJS(this.state), fromJS(nextState)) + } + + verifySubmit = () => { + this.verifyRef.handleConfirm().then(res => { + this.setState({ + loading: true + }) + + let parMenuId = sessionStorage.getItem('kei_no') + sessionStorage.getItem('typename') + sessionStorage.getItem('lang') + let menuId = Utils.getuuid() + let config = { + version: 1.0, + uuid: menuId, + MenuID: menuId, + Template: 'webPage', + enabled: false, + MenuName: res.MenuName || '', + MenuNo: res.MenuNo || '', + tables: [], + components: [], + viewType: 'menu', + style: {} + } + + let param = { + func: 'sPC_TrdMenu_AddUpt', + FstID: parMenuId, + SndID: parMenuId, + ParentID: parMenuId, + MenuID: menuId, + MenuNo: res.MenuNo || '', + EasyCode: '', + Template: 'webPage', + TypeCharOne: sessionStorage.getItem('kei_no'), + Typename: sessionStorage.getItem('typename'), + MenuName: res.MenuName || '', + PageParam: JSON.stringify({Template: 'webPage'}), + open_edition: '', + LText: '', + LTexttb: '' + } + + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + param.secretkey = Utils.encrypt('', param.timestamp) + + if (!res.copymenuId) { + param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config))) + + Api.getSystemConfig(param).then(result => { + if (!result.status) { + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } else { + notification.success({ + top: 92, + message: '鍒涘缓鎴愬姛', + duration: 5 + }) + } + + this.setState({ + visible: false, + loading: false + }) + + this.props.resetmenu() + }) + } else { + Api.getSystemConfig({ + func: 'sPC_Get_LongParam', + TypeCharOne: sessionStorage.getItem('kei_no'), + typename: sessionStorage.getItem('typename') || 'pc', + MenuID: res.copymenuId + }).then(result => { + if (!result.status) { + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + this.setState({ + loading: false + }) + return + } + + let _config = null + try { + _config = JSON.parse(window.decodeURIComponent(window.atob(result.LongParam))) + } catch (e) { + console.warn('Parse Failure') + _config = null + } + + if (!_config) { + notification.warning({ + top: 92, + message: '鏈幏鍙栧埌閰嶇疆淇℃伅锛�', + duration: 5 + }) + this.setState({ + loading: false + }) + return + } + + if (_config.components) { + config.components = MenuUtils.resetConfig(_config.components) + config.tables = _config.tables || [] + config.style = _config.style || {} + } + + param.LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(config))) + + Api.getSystemConfig(param).then(result => { + if (!result.status) { + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + } else { + notification.success({ + top: 92, + message: '鍒涘缓鎴愬姛', + duration: 5 + }) + } + + this.setState({ + visible: false, + loading: false + }) + + this.props.resetmenu() + }) + }) + } + }) + } + + render () { + const { config } = this.props + const { visible, dict, loading } = this.state + + return ( + <div className="create-view"> + <Button icon="plus" className="mk-border-green" onClick={() => {this.setState({visible: true, loading: false})}}>鏂板缓椤甸潰</Button> + <Modal + title="鏂板缓椤甸潰" + visible={visible} + width={500} + maskClosable={false} + okText={dict['model.submit']} + onOk={this.verifySubmit} + onCancel={() => { this.setState({ visible: false }) }} + confirmLoading={loading} + destroyOnClose + > + <SettingForm + dict={dict} + config={config} + wrappedComponentRef={(inst) => this.verifyRef = inst} + /> + </Modal> + </div> + ) + } +} + +export default CreateView \ No newline at end of file diff --git a/src/pc/createview/index.scss b/src/pc/createview/index.scss new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/src/pc/createview/index.scss diff --git a/src/pc/createview/settingform/index.jsx b/src/pc/createview/settingform/index.jsx new file mode 100644 index 0000000..87ee449 --- /dev/null +++ b/src/pc/createview/settingform/index.jsx @@ -0,0 +1,107 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { Form, Row, Col, Select, Input } from 'antd' + +import './index.scss' + +class SettingForm extends Component { + static propTpyes = { + dict: PropTypes.object, // 瀛楀吀椤� + } + + state = { + appMenus: [] + } + + UNSAFE_componentWillMount () { + let appMenus = sessionStorage.getItem('appMenus') + if (appMenus) { + try { + appMenus = JSON.parse(appMenus) + } catch { + appMenus = [] + } + } else { + appMenus = [] + } + + this.setState({appMenus}) + } + + handleConfirm = () => { + // 琛ㄥ崟鎻愪氦鏃舵鏌ヨ緭鍏ュ�兼槸鍚︽纭� + return new Promise((resolve, reject) => { + this.props.form.validateFieldsAndScroll((err, values) => { + if (!err) { + resolve(values) + } else { + reject(err) + } + }) + }) + } + + render() { + const { getFieldDecorator } = this.props.form + const { appMenus } = this.state + + const formItemLayout = { + labelCol: { + xs: { span: 24 }, + sm: { span: 8 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + } + } + + return ( + <Form {...formItemLayout}> + <Row gutter={24}> + <Col span={20}> + <Form.Item label="鑿滃崟鍚嶇О"> + {getFieldDecorator('MenuName', { + initialValue: '', + rules: [ + { + required: true, + message: this.props.dict['form.required.input'] + '鑿滃崟鍚嶇О!' + } + ] + })(<Input placeholder="" autoComplete="off" />)} + </Form.Item> + </Col> + <Col span={20}> + <Form.Item label="鑿滃崟鍙傛暟"> + {getFieldDecorator('MenuNo', { + initialValue: '', + rules: [ + { + required: true, + message: this.props.dict['form.required.input'] + '鑿滃崟鍙傛暟!' + } + ] + })(<Input placeholder="" autoComplete="off" />)} + </Form.Item> + </Col> + <Col span={20}> + <Form.Item label="澶嶅埗鑿滃崟"> + {getFieldDecorator('copymenuId', { + initialValue: '' + })( + <Select allowClear showSearch filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0}> + {appMenus.map(option => + <Select.Option key={option.MenuID} value={option.MenuID}>{option.MenuName}</Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> + </Row> + </Form> + ) + } +} + +export default Form.create()(SettingForm) \ No newline at end of file diff --git a/src/pc/createview/settingform/index.scss b/src/pc/createview/settingform/index.scss new file mode 100644 index 0000000..159130b --- /dev/null +++ b/src/pc/createview/settingform/index.scss @@ -0,0 +1,11 @@ +.model-menu-setting-form { + position: relative; + + .anticon-question-circle { + color: #c49f47; + margin-right: 3px; + } + .ant-input-number { + width: 100%; + } +} \ No newline at end of file diff --git a/src/pc/menushell/card.jsx b/src/pc/menushell/card.jsx index da9e868..412fe46 100644 --- a/src/pc/menushell/card.jsx +++ b/src/pc/menushell/card.jsx @@ -62,10 +62,10 @@ if (card.wrap && card.wrap.height) { // scaleview height = card.wrap.height.replace(/\d+vw/ig, (word) => { - return parseFloat(word) * 420 / 100 + 'px' + return parseFloat(word) * (window.GLOB.winWidth || 420) / 100 + 'px' // return parseFloat(word) * 350 / 100 + 'px' }).replace(/\d+vh/ig, (word) => { - return parseFloat(word) * 738 / 100 + 'px' + return parseFloat(word) * (window.GLOB.winHeight || 738) / 100 + 'px' // return parseFloat(word) * 615 / 100 + 'px' }) } diff --git a/src/tabviews/custom/components/form/normal-form/index.jsx b/src/tabviews/custom/components/form/normal-form/index.jsx index 03e0350..e9fb1b3 100644 --- a/src/tabviews/custom/components/form/normal-form/index.jsx +++ b/src/tabviews/custom/components/form/normal-form/index.jsx @@ -116,6 +116,7 @@ } componentDidMount () { + MKEmitter.addListener('reloadData', this.reloadData) MKEmitter.addListener('mkFormSubmit', this.mkFormSubmit) MKEmitter.addListener('resetSelectLine', this.resetParentParam) MKEmitter.addListener('refreshByButtonResult', this.refreshByButtonResult) @@ -129,6 +130,7 @@ this.setState = () => { return } + MKEmitter.removeListener('reloadData', this.reloadData) MKEmitter.removeListener('mkFormSubmit', this.mkFormSubmit) MKEmitter.removeListener('resetSelectLine', this.resetParentParam) MKEmitter.removeListener('refreshByButtonResult', this.refreshByButtonResult) @@ -163,6 +165,14 @@ }) } } + } + + reloadData = (menuId, id) => { + const { config } = this.state + + if (config.uuid !== menuId) return + + this.loadData(null, 'refresh') } /** @@ -237,7 +247,7 @@ } } - async loadData (btn) { + async loadData (btn, type) { const { mainSearch, menuType } = this.props const { config, arr_field, BID, group } = this.state @@ -288,16 +298,23 @@ this.execSuccess(btn) } else { let _group = group + + if (type === 'refresh') { + _group = config.subcards[0] + } + if (config.wrap.statusControl && _data[config.wrap.statusControl]) { let _status = _data[config.wrap.statusControl] let _groups = config.subcards.filter(item => item.setting.status === _status)[0] _group = _groups || _group } this.setState({ - group: _group, + group: null, step: _group.sort - 1, data: _data || {}, loading: false + }, () => { + this.setState({group: _group}) }) } } else { diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 7236e4d..26cde23 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -737,7 +737,7 @@ return component } - if (['propcard', 'brafteditor', 'sandbox', 'stepform'].includes(component.subtype) && component.wrap.datatype === 'static') { + if (component.wrap.datatype === 'static') { component.format = '' } diff --git a/src/tabviews/zshare/mutilform/checkCard/index.scss b/src/tabviews/zshare/mutilform/checkCard/index.scss index 0887939..c5f1119 100644 --- a/src/tabviews/zshare/mutilform/checkCard/index.scss +++ b/src/tabviews/zshare/mutilform/checkCard/index.scss @@ -8,7 +8,6 @@ padding: 6px; margin-bottom: 12px; line-height: 1.5; - transition: all 0.3s; cursor: pointer; span { display: block; @@ -16,6 +15,7 @@ text-overflow: ellipsis; white-space: nowrap; } + transition: all 0.3s; } .card-cell.active { border-color: #1890ff; @@ -33,6 +33,7 @@ margin-bottom: 12px; line-height: 1.5; cursor: pointer; + transition: all 0.3s; } .card-pic-cell.active { border-color: #1890ff; diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 77a19e4..dc06bf8 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -48,7 +48,7 @@ let formlist = fromJS(action.fields).toJS() formlist.forEach(item => { - if (item.type === 'text' || item.type === 'number') { // 鐢ㄤ簬杩囨护涓嬫媺鑿滃崟鍏宠仈琛ㄥ崟 + if (item.type === 'text' || item.type === 'number') { _inputfields.push(item.field) } else if (item.type === 'textarea') { _inputfields.push(item.field) diff --git a/src/templates/sharecomponent/fieldscomponent/index.jsx b/src/templates/sharecomponent/fieldscomponent/index.jsx index b2337f8..8f2a184 100644 --- a/src/templates/sharecomponent/fieldscomponent/index.jsx +++ b/src/templates/sharecomponent/fieldscomponent/index.jsx @@ -217,12 +217,13 @@ let _columns = [...columnsMap.values()] _columns.forEach(item => { + let _t = item.$datatype || (item.type === 'number' ? 'Decimal(18,0)' : 'Nvarchar(50)') if (item.selected) { let newcard = { uuid: Utils.getuuid(), label: item.label, field: item.field, - datatype: item.type === 'number' ? 'Decimal(18,0)' : 'Nvarchar(50)' + datatype: _t } items.push(newcard) diff --git a/src/templates/sharecomponent/tablecomponent/index.jsx b/src/templates/sharecomponent/tablecomponent/index.jsx index e52ef08..0ff4bcf 100644 --- a/src/templates/sharecomponent/tablecomponent/index.jsx +++ b/src/templates/sharecomponent/tablecomponent/index.jsx @@ -137,6 +137,7 @@ datatype: _type, decimal: _decimal, length: _length, + $datatype: item.FieldType.toLowerCase() } }) } diff --git a/src/utils/utils-custom.js b/src/utils/utils-custom.js index cf2d151..840ce6d 100644 --- a/src/utils/utils-custom.js +++ b/src/utils/utils-custom.js @@ -384,10 +384,10 @@ // scaleview _style = _style.replace(/\d+vw/ig, (word) => { - return parseFloat(word) * 420 / 100 + 'px' + return parseFloat(word) * (window.GLOB.winWidth || 420) / 100 + 'px' // return parseFloat(word) * 350 / 100 + 'px' }).replace(/\d+vh/ig, (word) => { - return parseFloat(word) * 738 / 100 + 'px' + return parseFloat(word) * (window.GLOB.winHeight || 738) / 100 + 'px' // return parseFloat(word) * 615 / 100 + 'px' }) diff --git a/src/views/appmanage/index.jsx b/src/views/appmanage/index.jsx index 9814d18..7b62f72 100644 --- a/src/views/appmanage/index.jsx +++ b/src/views/appmanage/index.jsx @@ -57,10 +57,6 @@ render: (text, record) => text === 'false' ? '涓嶅惎鐢�' : '鍚敤' }, { - title: '鐭繛鎺�', dataIndex: 'link_type', key: 'link_type', align: 'center', - render: (text, record) => text === 'false' ? '涓嶅惎鐢�' : '鍚敤' - }, - { title: '鐨偆', dataIndex: 'css', key: 'css', align: 'center', render: (text, record) => { const style = { @@ -246,7 +242,8 @@ let sublist = fromJS(selectApp.sublist).toJS() sublist = sublist.filter(item => item.ID !== record.ID) - param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) + // param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) + param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) @@ -393,7 +390,8 @@ param.secretkey = Utils.encrypt('', param.timestamp) if (visible === 'edit') { - param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) + // param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) + param.LText = selectApp.sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) } @@ -479,7 +477,8 @@ }) } - param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) + // param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','${item.link_type || 'true'}','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) + param.LText = sublist.map(item => `select '${item.ID}','${item.typename}','${selectApp.ID}','${sessionStorage.getItem('CloudUserID') || ''}','${window.GLOB.appkey || ''}','${item.login_types || 'true'}','false','${item.role_type || 'true'}','${item.lang || 'zh-CN'}','${item.css || ''}','${item.title || ''}','${item.favicon || ''}'`) param.LText = param.LText.join(' union all ') param.LText = Utils.formatOptions(param.LText) diff --git a/src/views/appmanage/submutilform/index.jsx b/src/views/appmanage/submutilform/index.jsx index 611f749..b069b3e 100644 --- a/src/views/appmanage/submutilform/index.jsx +++ b/src/views/appmanage/submutilform/index.jsx @@ -67,6 +67,7 @@ })( <Select disabled={type === 'edit'}> <Select.Option value="mob">绉诲姩绔�(鍖呮嫭android銆乮os)</Select.Option> + <Select.Option value="pad">Pad绔�</Select.Option> <Select.Option value="pc">PC绔�</Select.Option> </Select> )} @@ -100,18 +101,6 @@ <Form.Item label="鏉冮檺绠$悊"> {getFieldDecorator('role_type', { initialValue: card ? card.role_type || 'true' : 'true' - })( - <Radio.Group> - <Radio value="true">鍚敤</Radio> - <Radio value="false">涓嶅惎鐢�</Radio> - </Radio.Group> - )} - </Form.Item> - </Col> - <Col span={12}> - <Form.Item label="鐭繛鎺�"> - {getFieldDecorator('link_type', { - initialValue: card ? card.link_type || 'true' : 'true' })( <Radio.Group> <Radio value="true">鍚敤</Radio> diff --git a/src/views/billprint/index.jsx b/src/views/billprint/index.jsx index 048ff2e..38c9f1e 100644 --- a/src/views/billprint/index.jsx +++ b/src/views/billprint/index.jsx @@ -184,7 +184,7 @@ if (component.search) component.search = [] component.data = [] // 鍒濆鍖栨暟鎹负绌� - if (['propcard', 'brafteditor', 'sandbox'].includes(component.subtype) && component.wrap.datatype === 'static') { + if (component.wrap.datatype === 'static') { component.format = '' } diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index 3f3f415..9f22b01 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -25,6 +25,7 @@ const Header = asyncComponent(() => import('@/mob/header')) const MenuForm = asyncComponent(() => import('./menuform')) const MobShell = asyncComponent(() => import('@/mob/mobshell')) +const CreateView = asyncComponent(() => import('@/pc/createview')) const SourceWrap = asyncComponent(() => import('@/mob/modulesource')) const BgController = asyncComponent(() => import('@/pc/bgcontroller')) const SysInterface = asyncComponent(() => import('@/menu/sysinterface')) @@ -64,6 +65,8 @@ config: null, visible: false, customComponents: [], + direction: 'vertical', + comloading: false } UNSAFE_componentWillMount() { @@ -75,9 +78,9 @@ sessionStorage.setItem('appId', param.ID || '') sessionStorage.setItem('lang', param.lang || 'zh-CN') sessionStorage.setItem('kei_no', param.kei_no || '') - sessionStorage.setItem('link_type', param.link_type || 'true') sessionStorage.setItem('role_type', param.role_type || 'true') sessionStorage.setItem('login_types', param.login_types || 'true') + sessionStorage.setItem('typename', param.typename || 'mob') this.setState({ localedict: sessionStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS, @@ -85,6 +88,18 @@ }) this.getAppMessage() } else if (param.type === 'view') { + window.GLOB.winWidth = 420 + window.GLOB.winHeight = 738 + window.GLOB.shellWidth = 376 + window.GLOB.shellHeight = 680 + + if (sessionStorage.getItem('typename') === 'pad') { + window.GLOB.winWidth = 736 + window.GLOB.winHeight = 945 + window.GLOB.shellWidth = 640 + window.GLOB.shellHeight = 853 + } + this.setState({ MenuId: param.MenuID }, () => { @@ -193,9 +208,6 @@ type: 'view' } - if (menu.fixed && menu.MenuNo && menu.MenuName) { - param.fixed = true - } param.MenuNo = menu.MenuNo || '' param.MenuName = menu.MenuName || '' @@ -309,7 +321,7 @@ updateCustomComponent = () => { Api.getSystemConfig({ func: 's_get_custom_components', - typename: 'mob', + typename: sessionStorage.getItem('typename'), typecharone: '' }).then(res => { let coms = [] @@ -410,7 +422,7 @@ let param = { func: 'sPC_Get_LongParam', TypeCharOne: sessionStorage.getItem('kei_no'), - typename: 'mob', + typename: sessionStorage.getItem('typename'), MenuID: MenuId } @@ -460,10 +472,6 @@ config.open_edition = result.open_edition || '' window.GLOB.urlFields = config.urlFields || [] - if (urlParam.fixed && urlParam.MenuName && urlParam.MenuNo) { - config.fixed = true - } - let indeComs = [] config.components.forEach(item => { if (item.type === 'navbar') { @@ -491,7 +499,7 @@ let _param = { func: 's_get_app_menus', TypeCharOne: sessionStorage.getItem('kei_no'), - typename: 'mob', + typename: sessionStorage.getItem('typename'), LText: `select '${window.GLOB.appkey}'`, timestamp: moment().format('YYYY-MM-DD HH:mm:ss') } @@ -523,7 +531,7 @@ let param = { func: 'sPC_Get_LongParam', TypeCharOne: sessionStorage.getItem('kei_no'), - typename: 'mob', + typename: sessionStorage.getItem('typename'), MenuID: urlParam.copyMenuId } @@ -578,6 +586,8 @@ config.uuid = MenuId config.MenuID = MenuId config.open_edition = '' + config.MenuName = urlParam.MenuName || '' + config.MenuNo = urlParam.MenuNo || '' let indeComs = [] config.components.forEach(item => { @@ -606,7 +616,7 @@ Api.getSystemConfig({ func: 'sPC_Get_LongParam', TypeCharOne: sessionStorage.getItem('kei_no'), - typename: 'mob', + typename: sessionStorage.getItem('typename'), MenuID: item.uuid }).then(res => { res.uuid = item.uuid @@ -810,7 +820,7 @@ EasyCode: '', Template: 'webPage', TypeCharOne: sessionStorage.getItem('kei_no'), - Typename: 'mob', + Typename: sessionStorage.getItem('typename'), MenuName: config.MenuName || '', PageParam: JSON.stringify({Template: 'webPage'}), open_edition: config.open_edition, @@ -880,7 +890,7 @@ EasyCode: '', Template: item.type, TypeCharOne: sessionStorage.getItem('kei_no'), - Typename: 'mob', + Typename: sessionStorage.getItem('typename'), MenuName: item.name || '', PageParam: JSON.stringify({Template: item.type}), open_edition: item.open_edition || '', @@ -1424,13 +1434,34 @@ }) } + changeView = (val) => { + if (val !== 'vertical') { + window.GLOB.winWidth = 992 + window.GLOB.winHeight = 690 + window.GLOB.shellWidth = 853 + window.GLOB.shellHeight = 640 + } else { + window.GLOB.winWidth = 736 + window.GLOB.winHeight = 945 + window.GLOB.shellWidth = 640 + window.GLOB.shellHeight = 853 + } + + this.setState({ + direction: val, + comloading: true + }, () => { + this.setState({ comloading: false }) + }) + } + render () { - const { localedict, loading, activeKey, dict, MenuId, config, menuloading, customComponents } = this.state + const { localedict, comloading, loading, activeKey, dict, MenuId, config, menuloading, customComponents } = this.state return ( <ConfigProvider locale={localedict}> <div className="mk-mob-view" id="mk-mob-design-view"> - <Header /> + <Header changeView={this.changeView}/> {loading ? <Spin className="view-spin" size="large" /> : null} <DndProvider backend={HTML5Backend}> <div className="menu-setting"> @@ -1465,6 +1496,7 @@ <div className="menu-control"> <Button type="primary" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button> <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} /> + <CreateView resetmenu={this.getAppMenus} /> <PasteController type="menu" Tab={null} insert={this.insert} /> <StyleCombControlButton menu={config} /> <SysInterface config={config} updateConfig={this.updateConfig}/> @@ -1475,8 +1507,8 @@ <Button type="default" onClick={this.closeView}>鍏抽棴</Button> </div> <div className={'menu-body ' + (menuloading ? 'saving' : '')}> - <div className="mob-shell"> - {config ? <MobShell menu={config} handleList={this.updateConfig} /> : null} + <div className="mob-shell" style={{width: window.GLOB.shellWidth, height: window.GLOB.shellHeight}}> + {config && !comloading ? <MobShell menu={config} handleList={this.updateConfig} /> : null} </div> </div> </DndProvider> diff --git a/src/views/mobdesign/index.scss b/src/views/mobdesign/index.scss index 23ea471..d555f9e 100644 --- a/src/views/mobdesign/index.scss +++ b/src/views/mobdesign/index.scss @@ -103,8 +103,8 @@ } } .mob-shell { - width: 376px; - height: 680px; + // width: 376px; + // height: 680px; margin: 0 auto; background: #000000; background-size: 100% 100%; diff --git a/src/views/mobdesign/menuform/index.jsx b/src/views/mobdesign/menuform/index.jsx index 2335bcf..cedb3a5 100644 --- a/src/views/mobdesign/menuform/index.jsx +++ b/src/views/mobdesign/menuform/index.jsx @@ -69,7 +69,7 @@ message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.name'] + '!' } ] - })(<Input placeholder="" disabled={!!(config.fixed && config.MenuName)} autoComplete="off" onChange={this.changeName}/>)} + })(<Input placeholder="" autoComplete="off" onChange={this.changeName}/>)} </Form.Item> </Col> <Col span={24}> @@ -82,7 +82,7 @@ message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.param'] + '!' } ] - })(<Input placeholder="" disabled={!!(config.fixed && config.MenuName)} autoComplete="off" onChange={this.changeNo}/>)} + })(<Input placeholder="" autoComplete="off" onChange={this.changeNo}/>)} </Form.Item> </Col> <Col span={24}> diff --git a/src/views/pcdesign/index.jsx b/src/views/pcdesign/index.jsx index 837911a..ae885f2 100644 --- a/src/views/pcdesign/index.jsx +++ b/src/views/pcdesign/index.jsx @@ -25,6 +25,7 @@ const MenuForm = asyncComponent(() => import('./menuform')) const MenuShell = asyncComponent(() => import('@/pc/menushell')) const SourceWrap = asyncComponent(() => import('@/pc/modulesource')) +const CreateView = asyncComponent(() => import('@/pc/createview')) const BgController = asyncComponent(() => import('@/pc/bgcontroller')) const Quotecomponent = asyncComponent(() => import('@/pc/quotecomponent')) const PasteController = asyncComponent(() => import('@/menu/pastecontroller')) @@ -40,6 +41,7 @@ sessionStorage.setItem('isEditState', 'true') sessionStorage.setItem('editMenuType', 'menu') // 缂栬緫鑿滃崟绫诲瀷 sessionStorage.setItem('appType', 'pc') // 搴旂敤绫诲瀷 +sessionStorage.setItem('typename', 'pc') document.body.className = '' window.GLOB.UserComponentMap = new Map() // 缂撳瓨鐢ㄦ埛鑷畾涔夌粍浠� window.GLOB.CacheIndependent = new Map() @@ -77,7 +79,6 @@ sessionStorage.setItem('appId', param.ID || '') sessionStorage.setItem('lang', param.lang || 'zh-CN') sessionStorage.setItem('kei_no', param.kei_no || '') - sessionStorage.setItem('link_type', param.link_type || 'true') sessionStorage.setItem('role_type', param.role_type || 'true') sessionStorage.setItem('login_types', param.login_types || 'true') @@ -166,9 +167,6 @@ type: 'view' } - if (menu.fixed && menu.MenuNo && menu.MenuName) { - param.fixed = true - } param.MenuNo = menu.MenuNo || '' param.MenuName = menu.MenuName || '' @@ -502,10 +500,6 @@ config.open_edition = result.open_edition || '' window.GLOB.urlFields = config.urlFields || [] - if (urlParam.fixed && urlParam.MenuNo && urlParam.MenuName) { - config.fixed = true - } - let indeComs = [] config.components.forEach(item => { if (item.type === 'navbar') { @@ -620,6 +614,8 @@ config.uuid = MenuId config.MenuID = MenuId config.open_edition = '' + config.MenuName = urlParam.MenuName || '' + config.MenuNo = urlParam.MenuNo || '' let indeComs = [] config.components.forEach(item => { @@ -1045,21 +1041,21 @@ }) if (appViewList.length > _length) { - let param = { + let kparam = { func: 's_kei_link_keyids_addupt', BID: sessionStorage.getItem('appId'), exec_type: 'y', LText: '' } - param.LText = appViewList.map(item => `select '${item.keys_id}','${item.keys_type}','${item.kei_no}','${item.appkey}','${item.bid}','${sessionStorage.getItem('CloudUserID')}','${item.remark}'`) - param.LText = param.LText.join(' union all ') - param.LText = Utils.formatOptions(param.LText) + kparam.LText = appViewList.map(item => `select '${item.keys_id}','${item.keys_type}','${item.kei_no}','${item.appkey}','${item.bid}','${sessionStorage.getItem('CloudUserID')}','${item.remark}'`) + kparam.LText = kparam.LText.join(' union all ') + kparam.LText = Utils.formatOptions(kparam.LText) - param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') - param.secretkey = Utils.encrypt('', param.timestamp) + kparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + kparam.secretkey = Utils.encrypt('', kparam.timestamp) - Api.getSystemConfig(param).then(result => { + Api.getSystemConfig(kparam).then(result => { if (!result.status) { notification.warning({ top: 92, @@ -1514,6 +1510,7 @@ </div> <Button type="primary" onClick={this.submitConfig} loading={menuloading}>{dict['mob.save']}</Button> <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config && config.enabled} onChange={this.onEnabledChange} /> + <CreateView resetmenu={this.getAppMenus} /> <PasteController type="menu" Tab={null} insert={this.insert} /> <StyleCombControlButton menu={config} /> <SysInterface config={config} updateConfig={this.updateConfig}/> diff --git a/src/views/pcdesign/menuform/index.jsx b/src/views/pcdesign/menuform/index.jsx index 2335bcf..cedb3a5 100644 --- a/src/views/pcdesign/menuform/index.jsx +++ b/src/views/pcdesign/menuform/index.jsx @@ -69,7 +69,7 @@ message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.name'] + '!' } ] - })(<Input placeholder="" disabled={!!(config.fixed && config.MenuName)} autoComplete="off" onChange={this.changeName}/>)} + })(<Input placeholder="" autoComplete="off" onChange={this.changeName}/>)} </Form.Item> </Col> <Col span={24}> @@ -82,7 +82,7 @@ message: dict['mob.required.input'] + dict['mob.menu'] + dict['mob.param'] + '!' } ] - })(<Input placeholder="" disabled={!!(config.fixed && config.MenuName)} autoComplete="off" onChange={this.changeNo}/>)} + })(<Input placeholder="" autoComplete="off" onChange={this.changeNo}/>)} </Form.Item> </Col> <Col span={24}> -- Gitblit v1.8.0