From b816a38598a2b96f244ba1aacec05f7071b1a803 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期五, 26 三月 2021 16:09:56 +0800 Subject: [PATCH] 2021-03-26 --- src/mob/header/index.jsx | 86 +------------------- src/tabviews/custom/components/chart/antv-bar-line/index.jsx | 2 src/components/header/index.jsx | 2 src/tabviews/verupmanage/subtabtable/index.jsx | 1 src/tabviews/zshare/normalTable/index.jsx | 2 src/tabviews/calendar/index.jsx | 2 src/assets/mobimg/form.png | 0 src/tabviews/custom/components/carousel/data-card/index.jsx | 2 src/menu/components/form/formaction/index.jsx | 1 src/views/design/sidemenu/index.jsx | 2 src/tabviews/subtable/index.jsx | 8 - src/tabviews/commontable/index.jsx | 4 src/tabviews/zshare/actionList/normalbutton/index.jsx | 8 - src/views/mobdesign/index.jsx | 10 -- src/tabviews/custom/components/card/data-card/index.jsx | 2 src/tabviews/custom/components/card/prop-card/index.jsx | 2 src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx | 2 src/tabviews/custom/components/chart/antv-pie/index.jsx | 2 src/tabviews/custom/components/form/normal-form/index.jsx | 25 +++++ src/tabviews/zshare/mutilform/index.jsx | 2 src/tabviews/custom/components/carousel/prop-card/index.jsx | 2 src/tabviews/custom/index.jsx | 8 + src/mob/header/index.scss | 48 ----------- src/pc/components/navbar/normal-navbar/index.scss | 3 src/tabviews/scriptmanage/index.jsx | 2 src/components/sidemenu/index.jsx | 2 src/tabviews/verupmanage/index.jsx | 1 27 files changed, 62 insertions(+), 169 deletions(-) diff --git a/src/assets/mobimg/form.png b/src/assets/mobimg/form.png index 6403b32..fe05d33 100644 --- a/src/assets/mobimg/form.png +++ b/src/assets/mobimg/form.png Binary files differ diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index ce3a860..aa7b4d2 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -571,7 +571,7 @@ return tab.MenuID !== menu.MenuID }) - if (this.props.tabviews.length !== tabs.length) { + if (this.props.tabviews.length > tabs.length) { this.props.modifyTabview(fromJS(tabs).toJS()) } diff --git a/src/components/sidemenu/index.jsx b/src/components/sidemenu/index.jsx index eec4dc5..4bb0b8b 100644 --- a/src/components/sidemenu/index.jsx +++ b/src/components/sidemenu/index.jsx @@ -64,7 +64,7 @@ return tab.MenuID !== menu.MenuID }) - if (this.props.tabviews.length !== tabs.length) { + if (this.props.tabviews.length > tabs.length) { this.props.modifyTabview(fromJS(tabs).toJS()) } diff --git a/src/menu/components/form/formaction/index.jsx b/src/menu/components/form/formaction/index.jsx index c4dd07e..ba84729 100644 --- a/src/menu/components/form/formaction/index.jsx +++ b/src/menu/components/form/formaction/index.jsx @@ -133,6 +133,7 @@ this.actionFormRef.handleConfirm().then(res => { res.type = card.type + res.style = card.style || null if (card.verify) { res.verify = card.verify } diff --git a/src/mob/header/index.jsx b/src/mob/header/index.jsx index b3af10d..38c5863 100644 --- a/src/mob/header/index.jsx +++ b/src/mob/header/index.jsx @@ -1,100 +1,28 @@ import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { is, fromJS } from 'immutable' -import { connect } from 'react-redux' -import { withRouter } from 'react-router-dom' -import {Dropdown, Menu, Icon, Modal, Tooltip, Button } from 'antd' -import { logout } from '@/store/action' -import zhCN from '@/locales/zh-CN/mob.js' -import enUS from '@/locales/en-US/mob.js' import avatar from '@/assets/img/avatar.jpg' import MainLogo from '@/assets/img/main-logo.png' import './index.scss' -const { confirm } = Modal - class MobHeader extends Component { - static propTpyes = { - view: PropTypes.string, - saveIng: PropTypes.any, - triggerSave: PropTypes.func, - } - state = { - dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, avatar: sessionStorage.getItem('CloudAvatar') || avatar, userName: sessionStorage.getItem('CloudUserName') } - logout = () => { - // 閫�鍑虹櫥褰� - let _this = this - confirm({ - title: this.state.dict['mob.logout.hint'], - content: '', - onOk() { - sessionStorage.clear() - _this.props.logout() - _this.props.history.replace('/login') - }, - onCancel() {} - }) - } - - shouldComponentUpdate (nextProps, nextState) { - return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) - } - render () { - const { view } = this.props - return ( <header className="mob-header-container"> <div className="header-logo"><img src={MainLogo} alt=""/></div> - {view === 'manage' ? - <div className="mob-manage-title"> - 搴旂敤绠$悊 - </div> :null - } - {view === 'design' ? - <Menu - mode="inline" - theme="dark" - inlineCollapsed={this.state.collapsed} - > - <Menu.Item key="2"> - <Tooltip placement="bottom" title="淇濆瓨"> - <Button icon="save" loading={this.props.saveIng} onClick={this.props.triggerSave}></Button> - </Tooltip> - </Menu.Item> - </Menu> : null - } - <Dropdown className="header-setting" overlay={ - <Menu> - <Menu.Item key="2" onClick={this.logout}>{this.state.dict['mob.logout']}</Menu.Item> - </Menu> - }> - <div> - <img src={this.state.avatar} alt=""/> - <span> - <span className="username">{this.state.userName}</span> <Icon type="down" /> - </span> - </div> - </Dropdown> + <div className="header-user"> + <img src={this.state.avatar} alt=""/> + <span> + <span className="username">{this.state.userName}</span> + </span> + </div> </header> ) } } -const mapStateToProps = () => { - return {} -} - -const mapDispatchToProps = (dispatch) => { - return { - logout: () => dispatch(logout()) - } -} - -export default withRouter(connect(mapStateToProps, mapDispatchToProps)(MobHeader)) \ No newline at end of file +export default MobHeader \ No newline at end of file diff --git a/src/mob/header/index.scss b/src/mob/header/index.scss index 1e07272..40ac737 100644 --- a/src/mob/header/index.scss +++ b/src/mob/header/index.scss @@ -1,7 +1,6 @@ .mob-header-container { width: 100%; height: 48px; - padding-right: 320px; color: rgba(255, 255, 255, 0.65); position: fixed; top: 0px; @@ -23,7 +22,7 @@ max-height: 40px; } } - .header-setting { + .header-user { float: right; line-height: 48px; margin-right: 10px; @@ -44,51 +43,6 @@ text-overflow: ellipsis; white-space: nowrap; } - } - } - .mob-manage-title { - position: absolute; - left: calc(50vw - 45px); - color: #ffffff; - font-size: 16px; - line-height: 48px; - letter-spacing: 2px; - } - >.ant-menu { - float: left; - width: unset!important; - .ant-menu-item { - margin-bottom: 0!important; - float: left; - width: unset!important; - cursor: default; - .anticon-arrow-left { - height: 24px; - cursor: pointer; - } - .ant-btn { - color: #fff; - width: unset; - cursor: pointer; - height: 37px; - background: transparent; - border: 0; - .anticon-save { - margin-right: 0; - } - } - .ant-btn[ant-click-animating-without-extra-node="true"]::after { - display: none!important; - } - .ant-btn::before { - display: none!important; - } - } - .ant-menu-item.ant-menu-item-selected { - background-color: transparent; - } - .ant-menu-item:not(:last-child) { - border-right: 1px solid #353535; } } } \ No newline at end of file diff --git a/src/pc/components/navbar/normal-navbar/index.scss b/src/pc/components/navbar/normal-navbar/index.scss index 92e03cb..5882cf7 100644 --- a/src/pc/components/navbar/normal-navbar/index.scss +++ b/src/pc/components/navbar/normal-navbar/index.scss @@ -9,7 +9,7 @@ background-repeat: no-repeat; background-size: cover; min-height: 50px; - z-index: 2; + z-index: 3; .navbar-wrap { margin: 0 auto; @@ -133,7 +133,6 @@ clear: both; } .normal-navbar-edit-box:hover { - z-index: 1; box-shadow: 0px 0px 4px #1890ff; } .top-menu-popover { diff --git a/src/tabviews/calendar/index.jsx b/src/tabviews/calendar/index.jsx index 550326c..197c3ce 100644 --- a/src/tabviews/calendar/index.jsx +++ b/src/tabviews/calendar/index.jsx @@ -127,8 +127,6 @@ if (['text', 'select', 'link'].includes(item.type) && param) { if (param.searchkey === item.field) { item.initval = param.searchval - } else if (param.BID && item.field.toLowerCase() === 'bid') { - item.initval = param.BID } else if (param.data && param.data[item.field]) { item.initval = param.data[item.field] } diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index a2f2f10..4b8dad6 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -182,8 +182,6 @@ if (['text', 'select', 'link'].includes(item.type) && param) { if (param.searchkey === item.field) { item.initval = param.searchval - } else if (param.BID && item.field.toLowerCase() === 'bid') { - item.initval = param.BID } else if (param.data && param.data[item.field]) { item.initval = param.data[item.field] } @@ -994,7 +992,7 @@ } UNSAFE_componentWillReceiveProps(nextProps) { - if (!is(fromJS(this.props.tabviews), fromJS(nextProps.tabviews))) { + if (!is(fromJS(this.props.tabviews), fromJS(nextProps.tabviews))) { let selectTab = nextProps.tabviews.filter(tab => tab.selected)[0] if (selectTab && selectTab.MenuID === this.props.MenuID) { this.setShortcut() diff --git a/src/tabviews/custom/components/card/data-card/index.jsx b/src/tabviews/custom/components/card/data-card/index.jsx index 313cd88..e668118 100644 --- a/src/tabviews/custom/components/card/data-card/index.jsx +++ b/src/tabviews/custom/components/card/data-card/index.jsx @@ -474,7 +474,7 @@ return tab.MenuID !== newtab.MenuID }) - if (this.props.tabviews.length !== tabs.length) { + if (this.props.tabviews.length > tabs.length) { this.props.modifyTabview(fromJS(tabs).toJS()) } diff --git a/src/tabviews/custom/components/card/prop-card/index.jsx b/src/tabviews/custom/components/card/prop-card/index.jsx index 555429a..9c03651 100644 --- a/src/tabviews/custom/components/card/prop-card/index.jsx +++ b/src/tabviews/custom/components/card/prop-card/index.jsx @@ -373,7 +373,7 @@ return tab.MenuID !== newtab.MenuID }) - if (this.props.tabviews.length !== tabs.length) { + if (this.props.tabviews.length > tabs.length) { this.props.modifyTabview(fromJS(tabs).toJS()) } diff --git a/src/tabviews/custom/components/carousel/data-card/index.jsx b/src/tabviews/custom/components/carousel/data-card/index.jsx index 56b9535..d276867 100644 --- a/src/tabviews/custom/components/carousel/data-card/index.jsx +++ b/src/tabviews/custom/components/carousel/data-card/index.jsx @@ -272,7 +272,7 @@ return tab.MenuID !== newtab.MenuID }) - if (this.props.tabviews.length !== tabs.length) { + if (this.props.tabviews.length > tabs.length) { this.props.modifyTabview(fromJS(tabs).toJS()) } diff --git a/src/tabviews/custom/components/carousel/prop-card/index.jsx b/src/tabviews/custom/components/carousel/prop-card/index.jsx index 4387d0c..ea1eca7 100644 --- a/src/tabviews/custom/components/carousel/prop-card/index.jsx +++ b/src/tabviews/custom/components/carousel/prop-card/index.jsx @@ -278,7 +278,7 @@ return tab.MenuID !== newtab.MenuID }) - if (this.props.tabviews.length !== tabs.length) { + if (this.props.tabviews.length > tabs.length) { this.props.modifyTabview(fromJS(tabs).toJS()) } diff --git a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx index 1d2ba36..6ee1ac9 100644 --- a/src/tabviews/custom/components/chart/antv-bar-line/index.jsx +++ b/src/tabviews/custom/components/chart/antv-bar-line/index.jsx @@ -1360,7 +1360,7 @@ return tab.MenuID !== newtab.MenuID }) - if (this.props.tabviews.length !== tabs.length) { + if (this.props.tabviews.length > tabs.length) { this.props.modifyTabview(fromJS(tabs).toJS()) } diff --git a/src/tabviews/custom/components/chart/antv-pie/index.jsx b/src/tabviews/custom/components/chart/antv-pie/index.jsx index 076dcfd..2221453 100644 --- a/src/tabviews/custom/components/chart/antv-pie/index.jsx +++ b/src/tabviews/custom/components/chart/antv-pie/index.jsx @@ -612,7 +612,7 @@ return tab.MenuID !== newtab.MenuID }) - if (this.props.tabviews.length !== tabs.length) { + if (this.props.tabviews.length > tabs.length) { this.props.modifyTabview(fromJS(tabs).toJS()) } diff --git a/src/tabviews/custom/components/form/normal-form/index.jsx b/src/tabviews/custom/components/form/normal-form/index.jsx index d94b17b..8d3fc08 100644 --- a/src/tabviews/custom/components/form/normal-form/index.jsx +++ b/src/tabviews/custom/components/form/normal-form/index.jsx @@ -6,7 +6,7 @@ // import moment from 'moment' import Api from '@/api' -// import Utils from '@/utils/utils.js' +import Utils from '@/utils/utils.js' import UtilsDM from '@/utils/utils-datamanage.js' import asyncComponent from '@/utils/asyncComponent' import asyncSpinComponent from '@/utils/asyncSpinComponent' @@ -46,7 +46,7 @@ let _data = null let _sync = false - if (config.setting && config.wrap.datatype !== 'static') { + if (config.wrap.datatype !== 'static') { _sync = config.setting.sync === 'true' if (_sync && data && data[config.dataName]) { @@ -60,6 +60,8 @@ _data = {} } + let roleId = sessionStorage.getItem('role_id') || '' + config.subcards = config.subcards.map(group => { group.subButton.uuid = group.uuid group.subButton.$menuId = group.uuid @@ -68,6 +70,25 @@ group.subButton.OpenType = 'formSubmit' group.subButton.execError = 'never' + group.fields = group.fields.map(cell => { + // 鏁版嵁婧恠ql璇彞锛岄澶勭悊锛屾潈闄愰粦鍚嶅崟瀛楁璁剧疆涓洪殣钘忚〃鍗� + if (['select', 'link', 'multiselect', 'radio', 'checkbox', 'checkcard'].includes(cell.type) && cell.resourceType === '1') { + let _option = Utils.getSelectQueryOptions(cell) + + cell.data_sql = Utils.formatOptions(_option.sql) + cell.base_sql = window.btoa(window.encodeURIComponent(_option.sql)) + cell.arr_field = _option.field + } + + // 瀛楁鏉冮檺榛戝悕鍗� + if (!cell.blacklist || !roleId || cell.blacklist.length === 0) return cell + if (cell.blacklist.filter(v => roleId.indexOf(v) > -1).length > 0) { + cell.hidden = 'true' + } + + return cell + }) + return group }) diff --git a/src/tabviews/custom/index.jsx b/src/tabviews/custom/index.jsx index 0df7a58..7b61a0a 100644 --- a/src/tabviews/custom/index.jsx +++ b/src/tabviews/custom/index.jsx @@ -140,8 +140,6 @@ if (['text', 'select', 'link'].includes(item.type) && param) { if (param.searchkey === item.field) { item.initval = param.searchval - } else if (param.BID && item.field.toLowerCase() === 'bid') { - item.initval = param.BID } else if (param.data && param.data[item.field]) { item.initval = param.data[item.field] } @@ -714,6 +712,12 @@ _customScript = _customScript.replace(/@\$|\$@/ig, '') } + // 澶栬仈鏁版嵁搴撴浛鎹� + if (window.GLOB.externalDatabase !== null) { + component.setting.dataresource = component.setting.dataresource.replace(/@db@/ig, window.GLOB.externalDatabase) + _customScript = _customScript.replace(/@db@/ig, window.GLOB.externalDatabase) + } + component.setting.customScript = _customScript // 鏁寸悊鍚庤嚜瀹氫箟鑴氭湰 // floor 缁勪欢鐨勫眰绾� diff --git a/src/tabviews/scriptmanage/index.jsx b/src/tabviews/scriptmanage/index.jsx index ed0910c..68a4ce8 100644 --- a/src/tabviews/scriptmanage/index.jsx +++ b/src/tabviews/scriptmanage/index.jsx @@ -120,6 +120,7 @@ * @description 涓昏〃鏁版嵁鍔犺浇 */ async loadmaindata () { + const { setting } = this.state let param = this.getDefaultParam() this.setState({ @@ -136,6 +137,7 @@ data: result.data.map((item, index) => { // item.LongParam = this.UnformatOptions(item.LongParam) item.key = index + item.$$uuid = item[setting.primaryKey] || '' return item }), total: result.total, diff --git a/src/tabviews/subtable/index.jsx b/src/tabviews/subtable/index.jsx index e5655a7..6d806fc 100644 --- a/src/tabviews/subtable/index.jsx +++ b/src/tabviews/subtable/index.jsx @@ -11,7 +11,6 @@ import options from '@/store/options.js' import UtilsDM from '@/utils/utils-datamanage.js' import { updateSubTable } from '@/utils/utils-update.js' -import { modifyTabview } from '@/store/action' import asyncComponent from '@/utils/asyncComponent' import asyncSpinComponent from '@/utils/asyncSpinComponent' import NotFount from '@/components/404' @@ -1031,17 +1030,14 @@ const mapStateToProps = (state) => { return { - tabviews: state.tabviews, menuType: state.editLevel, permAction: state.permAction, permMenus: state.permMenus, } } -const mapDispatchToProps = (dispatch) => { - return { - modifyTabview: (tabviews) => dispatch(modifyTabview(tabviews)) - } +const mapDispatchToProps = () => { + return {} } export default connect(mapStateToProps, mapDispatchToProps)(SubTabViewTable) \ No newline at end of file diff --git a/src/tabviews/verupmanage/index.jsx b/src/tabviews/verupmanage/index.jsx index e069f0f..8aa29d5 100644 --- a/src/tabviews/verupmanage/index.jsx +++ b/src/tabviews/verupmanage/index.jsx @@ -152,6 +152,7 @@ this.setState({ data: result.data.map((item, index) => { item.key = index + item.$$uuid = item[setting.primaryKey] || '' return item }), total: result.total, diff --git a/src/tabviews/verupmanage/subtabtable/index.jsx b/src/tabviews/verupmanage/subtabtable/index.jsx index 553cb4a..f33788b 100644 --- a/src/tabviews/verupmanage/subtabtable/index.jsx +++ b/src/tabviews/verupmanage/subtabtable/index.jsx @@ -183,6 +183,7 @@ this.setState({ data: result.data.map((item, index) => { item.key = index + item.$$uuid = item[setting.primaryKey] || '' item.$$BID = _BID || '' return item }), diff --git a/src/tabviews/zshare/actionList/normalbutton/index.jsx b/src/tabviews/zshare/actionList/normalbutton/index.jsx index fe80068..076f844 100644 --- a/src/tabviews/zshare/actionList/normalbutton/index.jsx +++ b/src/tabviews/zshare/actionList/normalbutton/index.jsx @@ -73,14 +73,10 @@ if (btn.uuid !== res.menuId) return this.setState({ - confirmLoading: true + loading: true }) - this.execSubmit(this.state.tabledata, () => { - this.setState({ - confirmLoading: false - }) - }, res.form) + this.execSubmit(this.state.tabledata, () => {}, res.form) } /** diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index e1d34c5..f25ea69 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -45,7 +45,7 @@ componentDidMount () { const { data, BData, action } = this.props - + let datatype = {} let readtype = {} let readin = {} diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 97df8d2..76c1f9e 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -221,7 +221,7 @@ tabmenu.param = { searchkey: item.field, searchval: record[item.field] || '', - BID: record[setting.primaryKey] + BID: record.$$uuid } tabmenu.selected = true diff --git a/src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx b/src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx index de77471..4fbbbac 100644 --- a/src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/markcolumn/markform/index.jsx @@ -235,7 +235,7 @@ <Select> <Select.Option value="="> = </Select.Option> <Select.Option value="!="> != </Select.Option> - <Select.Option value=">"> > </Select.Option> + <Select.Option value=">"> > </Select.Option> <Select.Option value="<"> < </Select.Option> <Select.Option value="like"> like </Select.Option> </Select> diff --git a/src/views/design/sidemenu/index.jsx b/src/views/design/sidemenu/index.jsx index ba7518c..99c1da2 100644 --- a/src/views/design/sidemenu/index.jsx +++ b/src/views/design/sidemenu/index.jsx @@ -88,7 +88,7 @@ return tab.MenuID !== menu.MenuID }) - if (this.props.tabviews.length !== tabs.length) { + if (this.props.tabviews.length > tabs.length) { this.props.modifyTabview(fromJS(tabs).toJS()) } diff --git a/src/views/mobdesign/index.jsx b/src/views/mobdesign/index.jsx index 20102be..a126428 100644 --- a/src/views/mobdesign/index.jsx +++ b/src/views/mobdesign/index.jsx @@ -34,7 +34,6 @@ oriConfig: null, parentId: '', openEdition: '', - saveIng: false, config: null, pageIndex: 0, editElem: null @@ -55,10 +54,6 @@ triggerSave = () => { const { config, openEdition, parentId } = this.state - - this.setState({ - saveIng: true - }) let param = { func: 'sPC_TrdMenu_AddUpt', @@ -94,7 +89,6 @@ this.setState({ oriConfig: fromJS(config).toJS(), openEdition: response.open_edition || '', - saveIng: false }) } else { notification.warning({ @@ -212,11 +206,11 @@ } render () { - const { saveIng, appType, config, editElem } = this.state + const { appType, config, editElem } = this.state return ( <div className="mobile-view"> - <Header view="design" jumpToManage={this.jumpToManage} triggerSave={this.triggerSave} saveIng={saveIng} /> + <Header /> <DndProvider backend={HTML5Backend}> <div className="mob-body"> <div className="mob-tool"> -- Gitblit v1.8.0