From 051eb785a36ec3b6cd3b4305fdb65f6940415e9b Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期二, 14 九月 2021 13:17:48 +0800 Subject: [PATCH] 2021-09-14 --- src/pc/components/navbar/normal-navbar/index.jsx | 2 src/tabviews/zshare/actionList/tabbutton/index.jsx | 3 src/components/normalform/modalform/index.jsx | 11 +++ src/views/mobdesign/menuform/index.jsx | 36 ++++++++++++ src/menu/components/share/actioncomponent/formconfig.jsx | 1 src/pc/components/login/normal-login/loginform.jsx | 13 ++- src/pc/components/login/normal-login/index.jsx | 14 +++- src/pc/components/login/normal-login/options.jsx | 18 +++++ src/views/rolemanage/index.jsx | 59 +++++++++++++++++++ src/menu/components/share/actioncomponent/actionform/index.jsx | 2 src/views/mobdesign/menuform/index.scss | 3 + src/utils/option.js | 2 src/pc/components/login/normal-login/index.scss | 5 + 13 files changed, 152 insertions(+), 17 deletions(-) diff --git a/src/components/normalform/modalform/index.jsx b/src/components/normalform/modalform/index.jsx index 99658a4..5fc454c 100644 --- a/src/components/normalform/modalform/index.jsx +++ b/src/components/normalform/modalform/index.jsx @@ -101,10 +101,17 @@ if (cell.hidden) return - if (supItem.hidden || !item.values.includes(supItem.initval)) { + if (supItem.hidden) { cell.hidden = true - fieldMap.set(item.field, cell) + } else if (supItem.type === 'checkbox') { + let vals = [...supItem.initval, ...item.values] + if (vals.length === new Set(vals).size) { + cell.hidden = true + } + } else if (!item.values.includes(supItem.initval)) { + cell.hidden = true } + fieldMap.set(item.field, cell) fields.push(item) }) diff --git a/src/menu/components/share/actioncomponent/actionform/index.jsx b/src/menu/components/share/actioncomponent/actionform/index.jsx index 45c9cec..abc4db4 100644 --- a/src/menu/components/share/actioncomponent/actionform/index.jsx +++ b/src/menu/components/share/actioncomponent/actionform/index.jsx @@ -339,7 +339,7 @@ _fieldval.Ot = 'requiredSgl' } else if (value === 'audit') { _fieldval.label = '瀹℃牳' - _fieldval.class = 'purple' + _fieldval.class = 'primary' _fieldval.Ot = 'requiredSgl' } else if (value === 'LogicDelete' || value === 'delete') { _fieldval.label = '鍒犻櫎' diff --git a/src/menu/components/share/actioncomponent/formconfig.jsx b/src/menu/components/share/actioncomponent/formconfig.jsx index 59cc710..fccf2a1 100644 --- a/src/menu/components/share/actioncomponent/formconfig.jsx +++ b/src/menu/components/share/actioncomponent/formconfig.jsx @@ -78,6 +78,7 @@ { value: 'mkBinding', text: '寮�閫氭壂鐮佺櫥褰�' }, { value: 'mkUnBinding', text: '鐢ㄦ埛瑙g粦' }, { value: 'reAuth', text: '閲嶆柊鎺堟潈' }, + { value: 'goBack', text: '杩斿洖' }, ] pageTemps = [ { value: 'linkpage', text: '鍏宠仈鑿滃崟' }, diff --git a/src/pc/components/login/normal-login/index.jsx b/src/pc/components/login/normal-login/index.jsx index bd48443..390a8cb 100644 --- a/src/pc/components/login/normal-login/index.jsx +++ b/src/pc/components/login/normal-login/index.jsx @@ -44,10 +44,10 @@ width: card.width || 24, name: card.name, subtype: card.subtype, - wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd'] }, + wrap: { name: card.name, width: card.width || 24, loginWays: ['uname_pwd'], shortcut: 'remember' }, style: { background: '#ffffff', width: '330px', borderRadius: '4px', marginLeft: '55vw'}, loginWays: [ - {type: 'uname_pwd', label: '璐﹀彿瀵嗙爜鐧诲綍', remember: 'true'}, + {type: 'uname_pwd', label: '璐﹀彿瀵嗙爜鐧诲綍', shortcut: 'remember'}, {type: 'sms_vcode', label: '鐭俊楠岃瘉鐮�'}, {type: 'app_scan', label: '鎵爜鐧诲綍'}, ] @@ -149,7 +149,15 @@ } updateWrap = (res) => { - this.updateComponent({...this.state.card, wrap: res}) + let card = fromJS(this.state.card).toJS() + + card.wrap = res + + if (res.shortcut) { + card.loginWays[0].shortcut = res.shortcut + } + + this.updateComponent(card) } render() { diff --git a/src/pc/components/login/normal-login/index.scss b/src/pc/components/login/normal-login/index.scss index 43bd1ed..2ee7fbb 100644 --- a/src/pc/components/login/normal-login/index.scss +++ b/src/pc/components/login/normal-login/index.scss @@ -119,6 +119,11 @@ } } } + .no-short.form-item-wrap { + .btn-login { + margin-top: 45px; + } + } } .login-edit-box::after { display: block; diff --git a/src/pc/components/login/normal-login/loginform.jsx b/src/pc/components/login/normal-login/loginform.jsx index 0bce326..19ede79 100644 --- a/src/pc/components/login/normal-login/loginform.jsx +++ b/src/pc/components/login/normal-login/loginform.jsx @@ -39,11 +39,11 @@ } UNSAFE_componentWillReceiveProps (nextProps) { - const { loginWays, wrap } = this.props + const { wrap } = this.props if (!is(fromJS(wrap), fromJS(nextProps.wrap))) { let _loginWays = [] - loginWays.forEach(item => { + nextProps.loginWays.forEach(item => { if (!nextProps.wrap.loginWays || nextProps.wrap.loginWays.includes(item.type)) { _loginWays.push(item) } @@ -90,7 +90,7 @@ <div className={'login-way' + (activeWay.type === item.type ? ' active' : '')} onClick={() => this.onChangeTab(item)} key={item.type}>{item.label}</div> ))} </div> - {activeWay.type === 'uname_pwd' ? <div className="form-item-wrap"> + {activeWay.type === 'uname_pwd' ? <div className={'form-item-wrap ' + (activeWay.shortcut === 'none' ? 'no-short' : '')}> <Form.Item> <Input prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />} @@ -101,9 +101,12 @@ <Form.Item> <Input.Password placeholder="瀵嗙爜" prefix={<Icon type="lock" style={{ color: 'rgba(0,0,0,.25)' }} />} /> </Form.Item> - <Form.Item className="minline"> + {!activeWay.shortcut || activeWay.shortcut === 'remember' ? <Form.Item className="minline"> <Checkbox>璁颁綇瀵嗙爜</Checkbox> - </Form.Item> + </Form.Item> : null} + {activeWay.shortcut === 'autologon' ? <Form.Item className="minline"> + <Checkbox>鑷姩鐧诲綍</Checkbox> + </Form.Item> : null} <Form.Item className="btn-login"> <Button type="primary" onDoubleClick={() => this.changeMenu()} className="login-form-button"> 鐧诲綍 diff --git a/src/pc/components/login/normal-login/options.jsx b/src/pc/components/login/normal-login/options.jsx index c423354..4d5b6aa 100644 --- a/src/pc/components/login/normal-login/options.jsx +++ b/src/pc/components/login/normal-login/options.jsx @@ -52,7 +52,8 @@ { label: '鎵爜', value: 'app_scan', disabled: appType === 'mob' }, ], controlFields: [ - {field: 'tempId', values: ['sms_vcode']} + {field: 'tempId', values: ['sms_vcode']}, + {field: 'shortcut', values: ['uname_pwd']}, ] }, { @@ -116,7 +117,20 @@ tooltip: '鐭俊妯℃澘鍙湪绠$悊绯荤粺 HS-濂囦簯鐭俊妯℃澘 澶勬坊鍔犮��', required: true, options: msgTemps - } + }, + { + type: 'radio', + field: 'shortcut', + label: '蹇嵎鏂瑰紡', + initval: wrap.shortcut || 'remember', + tooltip: '璐﹀彿瀵嗙爜鐧诲綍鏃剁殑蹇嵎鏂瑰紡銆�', + required: false, + options: [ + {value: 'none', label: '鏃�'}, + {value: 'remember', label: '璁颁綇瀵嗙爜'}, + {value: 'autologon', label: '鑷姩鐧诲綍'}, + ] + }, ] return wrapForm diff --git a/src/pc/components/navbar/normal-navbar/index.jsx b/src/pc/components/navbar/normal-navbar/index.jsx index 908e70a..6e1d078 100644 --- a/src/pc/components/navbar/normal-navbar/index.jsx +++ b/src/pc/components/navbar/normal-navbar/index.jsx @@ -41,7 +41,7 @@ dataName: card.dataName || '', name: card.name, subtype: card.subtype, - wrap: { name: card.name, width: card.width || 1200 }, + wrap: { name: card.name, width: card.width || 1200, height: 50 }, logoStyle: { width: '100px' }, style: { }, links: [], diff --git a/src/tabviews/zshare/actionList/tabbutton/index.jsx b/src/tabviews/zshare/actionList/tabbutton/index.jsx index d59c2d5..15b2adf 100644 --- a/src/tabviews/zshare/actionList/tabbutton/index.jsx +++ b/src/tabviews/zshare/actionList/tabbutton/index.jsx @@ -116,7 +116,8 @@ primaryId: primaryId } } - } else if (btn.tabTemplate === 'ThdMenu') { + // } else if (btn.tabTemplate === 'ThdMenu') { + } else { let menu = null if (btn.linkmenu && btn.linkmenu.length > 0) { diff --git a/src/utils/option.js b/src/utils/option.js index 4306074..b91afd5 100644 --- a/src/utils/option.js +++ b/src/utils/option.js @@ -777,6 +777,8 @@ 'credit-card', 'customer-service', 'dashboard', + 'ellipsis', + 'more', 'database', 'dislike', 'environment', diff --git a/src/views/mobdesign/menuform/index.jsx b/src/views/mobdesign/menuform/index.jsx index 7e656b6..61d7111 100644 --- a/src/views/mobdesign/menuform/index.jsx +++ b/src/views/mobdesign/menuform/index.jsx @@ -2,7 +2,10 @@ import PropTypes from 'prop-types' import { Form, Row, Col, Input, Radio, Icon, Tooltip, InputNumber } from 'antd' +import asyncComponent from '@/utils/asyncComponent' import './index.scss' + +const SourceComponent = asyncComponent(() => import('@/menu/components/share/sourcecomponent')) class CustomMenuForm extends Component { static propTpyes = { @@ -22,6 +25,10 @@ this.props.updateConfig({...config, cacheUseful: value}) } else if (key === 'timeUnit') { this.props.updateConfig({...config, timeUnit: value}) + } else if (key === 'advertUrl') { + this.props.updateConfig({...config, advertUrl: value}) + } else if (key === 'advertTime') { + this.props.updateConfig({...config, advertTime: value}) } } @@ -146,6 +153,35 @@ )} </Form.Item> </Col> : null} + <Col span={24}> + <Form.Item label={ + <Tooltip placement="topLeft" title="鍦ㄦ槑绉戜簯APP涓湁鏁堛��"> + <Icon type="question-circle" /> + 骞垮憡椤� + </Tooltip> + }> + {getFieldDecorator('advertUrl', { + initialValue: config.advertUrl || '' + })( + <SourceComponent type="picture" placement="right" onChange={(val) => {this.selectChange('advertUrl', val)}}/> + )} + </Form.Item> + </Col> + {config.advertUrl ? <Col span={24}> + <Form.Item label="鍋滅暀(s)"> + {getFieldDecorator('advertTime', { + initialValue: config.advertTime || 3, + rules: [ + { + required: true, + message: dict['mob.required.input'] + '鍋滅暀鏃堕棿!' + } + ] + })( + <InputNumber min={1} max={10} precision={0} onChange={(val) => {this.selectChange('advertTime', val)}}/> + )} + </Form.Item> + </Col> : null} </Row> </Form> ) diff --git a/src/views/mobdesign/menuform/index.scss b/src/views/mobdesign/menuform/index.scss index fb20291..2f72f46 100644 --- a/src/views/mobdesign/menuform/index.scss +++ b/src/views/mobdesign/menuform/index.scss @@ -13,4 +13,7 @@ font-size: 12px; } } + .ant-radio-group { + white-space: nowrap; + } } \ No newline at end of file diff --git a/src/views/rolemanage/index.jsx b/src/views/rolemanage/index.jsx index 255cc5a..61acc7f 100644 --- a/src/views/rolemanage/index.jsx +++ b/src/views/rolemanage/index.jsx @@ -48,7 +48,8 @@ targetKeys: [], trees: null, expandedKeys: [], - searchkey: '' + searchkey: '', + appViewList: [] } oriTrees = null @@ -59,6 +60,7 @@ this.setState({app: param}, () => { this.getTreeList() this.getMenuList() + this.getAppViewList() }) } @@ -69,6 +71,25 @@ this.setState = () => { return } + } + + getAppViewList = () => { + const { app } = this.state + + Api.getSystemConfig({ + func: 's_get_keyids', + bid: app.ID + }).then(result => { + if (!result.status) { + notification.warning({ + top: 92, + message: result.message, + duration: 5 + }) + return + } + this.setState({appViewList: result.data || []}) + }) } getMenuList = (reset) => { @@ -318,7 +339,7 @@ } deleteMenu = (record) => { - const { app } = this.state + const { app, appViewList } = this.state const _this = this let param = { @@ -333,6 +354,26 @@ param.MenuID = param.MenuID + ',' + record.nodes.popviews.join(',') } + let _param = { + func: 's_kei_link_keyids_addupt', + BID: app.ID, + exec_type: 'y', + LText: '' + } + + let _appViewList = appViewList.filter(item => item.keys_id !== record.MenuID) + + if (appViewList.length !== _appViewList.length) { + _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) + + _param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + _param.secretkey = Utils.encrypt('', _param.timestamp) + } else { + _param = null + } + confirm({ content: '纭畾鍒犻櫎璇ヨ彍鍗曞悧锛�', onOk() { @@ -345,6 +386,20 @@ duration: 3 }) _this.getMenuList(true) + + if (_param) { + Api.getCloudConfig(_param).then(res => { + if (!res.status) { + notification.warning({ + top: 92, + message: res.message, + duration: 5 + }) + } else { + _this.setState({appViewList: _appViewList}) + } + }) + } } else { notification.warning({ top: 92, -- Gitblit v1.8.0