From b3547d1c531e479021219fda5df153a11b9b52a3 Mon Sep 17 00:00:00 2001 From: king <18310653075@163.com> Date: 星期一, 31 八月 2020 17:28:09 +0800 Subject: [PATCH] 2020-08-31 --- src/menu/components/chart/antv-bar/chartcompile/index.jsx | 3 src/templates/zshare/modalform/index.jsx | 26 src/templates/zshare/transferform/index.scss | 13 src/templates/sharecomponent/datasourcecomponent/verifycard/index.jsx | 6 src/mob/header/index.jsx | 2 src/templates/headerconfig/dragelement/card.jsx | 25 src/templates/sharecomponent/datasourcecomponent/index.jsx | 1 src/tabviews/zshare/normalTable/index.jsx | 5 src/tabviews/custom/components/chart/antv-bar/index.scss | 38 src/views/main/index.jsx | 13 src/templates/sharecomponent/actioncomponent/verifyprint/editable/index.jsx | 3 src/templates/treepageconfig/index.jsx | 2 src/templates/sharecomponent/cardcomponent/dragdetail/card.jsx | 17 src/locales/zh-CN/model.js | 12 src/templates/sharecomponent/columncomponent/markcolumn/index.jsx | 3 src/templates/modalconfig/index.jsx | 6 src/templates/sharecomponent/tablecomponent/index.jsx | 20 src/tabviews/custom/tools/simpleSearch/index.jsx | 784 +++++++++++++++++++ src/templates/formtabconfig/groupform/index.jsx | 2 src/templates/menuconfig/editthdmenu/index.jsx | 11 src/menu/searchcomponent/index.jsx | 4 src/templates/sharecomponent/settingcomponent/settingform/index.jsx | 7 src/locales/en-US/main.js | 4 src/tabviews/commontable/index.jsx | 2 src/menu/header/index.jsx | 2 src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx | 13 src/views/menudesign/index.jsx | 108 +- src/mob/mobcard/index.jsx | 4 src/assets/css/main.scss | 9 src/menu/actioncomponent/verifyexcelin/index.jsx | 13 src/templates/headerconfig/index.jsx | 31 src/mob/datasource/verifycard/index.jsx | 6 src/templates/calendarconfig/index.jsx | 2 src/templates/subtableconfig/index.jsx | 2 src/templates/modalconfig/transferform/index.jsx | 5 src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx | 7 src/tabviews/zshare/mutilform/index.jsx | 13 src/mob/contdelete/index.jsx | 2 src/templates/zshare/basetransferform/index.scss | 3 src/templates/calendarconfig/tabcomponent/index.jsx | 4 src/tabviews/tabmanage/transferform/index.jsx | 6 src/templates/modalconfig/groupform/index.jsx | 2 src/templates/zshare/modalform/modaleditable/index.jsx | 6 src/components/tabview/index.jsx | 93 +- src/templates/sharecomponent/searchcomponent/searcheditable/index.jsx | 6 src/templates/zshare/transferform/index.jsx | 32 src/components/header/index.jsx | 8 src/templates/zshare/basetransferform/index.jsx | 6 src/templates/formtabconfig/index.jsx | 6 src/mob/datasource/index.jsx | 3 src/tabviews/custom/tools/simpleSearch/index.scss | 41 + src/templates/comtableconfig/index.jsx | 2 src/menu/actioncomponent/index.jsx | 2 src/templates/sharecomponent/searchcomponent/index.jsx | 2 src/templates/headerconfig/dragelement/index.jsx | 8 src/templates/zshare/editcomponent/index.jsx | 4 src/templates/sharecomponent/fieldscomponent/index.jsx | 6 src/templates/sharecomponent/columncomponent/index.jsx | 4 src/templates/sharecomponent/columncomponent/colspanform/index.jsx | 2 src/locales/en-US/model.js | 12 src/menu/actioncomponent/verifyprint/editable/index.jsx | 3 src/templates/formtabconfig/transferform/index.jsx | 5 src/templates/sharecomponent/cardcomponent/index.jsx | 87 + src/tabviews/custom/components/chart/antv-bar/index.jsx | 583 ++++++++++++++ src/menu/datasourcecomponent/index.jsx | 1 src/templates/sharecomponent/tabscomponent/index.jsx | 6 src/utils/utils.js | 4 src/templates/calendarconfig/calcomponent/index.jsx | 2 src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx | 5 src/tabviews/tabmanage/transferform/index.scss | 3 src/menu/datasourcecomponent/verifycard/index.jsx | 6 src/locales/zh-CN/main.js | 4 src/templates/zshare/formconfig.jsx | 17 src/menu/actioncomponent/verifyexcelout/index.jsx | 11 src/templates/zshare/verifycard/index.jsx | 20 src/templates/sharecomponent/cardcomponent/dragdetail/index.scss | 21 src/templates/headerconfig/dragelement/index.scss | 59 src/store/options.js | 3 /dev/null | 29 src/templates/menuconfig/editsecmenu/index.jsx | 11 src/templates/sharecomponent/actioncomponent/index.jsx | 2 src/mob/contupdate/index.jsx | 2 src/tabviews/tabmanage/index.jsx | 5 src/menu/searchcomponent/searcheditable/index.jsx | 6 src/templates/sharecomponent/chartgroupcomponent/index.jsx | 2 85 files changed, 1,832 insertions(+), 549 deletions(-) diff --git a/src/assets/css/main.scss b/src/assets/css/main.scss index a31a13f..8fa787e 100644 --- a/src/assets/css/main.scss +++ b/src/assets/css/main.scss @@ -204,6 +204,10 @@ .ant-popover { z-index: 1070!important; } +// 姘旀场纭妗� +.ant-popover.popover-confirm { + z-index: 1080!important; +} .ant-notification-notice.notification-custom-error { background: #f5222d; @@ -283,8 +287,9 @@ } .mk-popover-control { i { - padding: 0 5px; + padding: 5px 8px; cursor: pointer; + font-size: 16px; } .edit { color: #1890ff; @@ -300,7 +305,7 @@ } } .ant-popover-inner-content { - padding: 5px 10px; + padding: 5px 20px; } } } \ No newline at end of file diff --git a/src/components/header/index.jsx b/src/components/header/index.jsx index eb80ffe..c77fff7 100644 --- a/src/components/header/index.jsx +++ b/src/components/header/index.jsx @@ -131,8 +131,6 @@ confirm({ title: this.state.dict['main.logout.hint'], content: '', - okText: this.state.dict['main.confirm'], - cancelText: this.state.dict['main.cancel'], onOk() { sessionStorage.clear() _this.props.logout() @@ -658,8 +656,6 @@ confirm({ title: this.state.dict['main.verup'], content: `鏈�鏂扮増鏈�${newVersion}锛屽綋鍓嶇増鏈�${oriVersion}`, - okText: this.state.dict['main.confirm'], - cancelText: this.state.dict['main.cancel'], onOk() { return new Promise(resolve => { Api.updateAppVersion(newVersion).then(res => { @@ -797,8 +793,6 @@ {/* 淇敼瀵嗙爜 */} <Modal title={this.state.dict['main.password']} - okText={this.state.dict['main.confirm']} - cancelText={this.state.dict['main.cancel']} visible={this.state.visible} onOk={this.resetPwdSubmit} confirmLoading={this.state.confirmLoading} @@ -810,8 +804,6 @@ {/* 缂栬緫鐘舵�佺櫥褰� */} <Modal title={this.state.dict['main.login.develop']} - okText={this.state.dict['main.confirm']} - cancelText={this.state.dict['main.cancel']} visible={this.state.loginVisible} onOk={this.loginSubmit} width={'430px'} diff --git a/src/components/tabview/index.jsx b/src/components/tabview/index.jsx index 05c86cc..e4e25b2 100644 --- a/src/components/tabview/index.jsx +++ b/src/components/tabview/index.jsx @@ -2,9 +2,7 @@ import PropTypes from 'prop-types' import {connect} from 'react-redux' import { is, fromJS } from 'immutable' -import {Tabs, Icon, Button, ConfigProvider, message, BackTop} from 'antd' -import enUS from 'antd/es/locale/en_US' -import zhCN from 'antd/es/locale/zh_CN' +import {Tabs, Icon, Button, message, BackTop} from 'antd' import moment from 'moment' import 'moment/locale/zh-cn' @@ -48,8 +46,7 @@ state = { tabviews: null, // 鏍囩闆� iFrameHeight: 0, - dict: localStorage.getItem('lang') !== 'en-US' ? mzhCN : menUS, - locale: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS + dict: localStorage.getItem('lang') !== 'en-US' ? mzhCN : menUS } handleTabview = (e, menu) => { @@ -216,52 +213,50 @@ return ( <section className={'flex-container content-box' + (this.props.collapse ? ' collapsed' : '')}> - <ConfigProvider locale={this.state.locale}> - <div className="content-header"> - {tabviews && tabviews.length > 0 && - <Tabs activeKey={selectedTabId}> - {tabviews.map(view => { - return ( - <Tabs.TabPane - tab={ - <span className="tab-control"> - {['CommonTable', 'FormTab', 'TreePage', 'CalendarPage', 'CustomPage'].includes(view.type) ? - <Icon type="redo" onClick={(e) => {this.refreshTabview(e, view)}}/> : null - } - <span className="tab-name" onClick={(e) => {this.changeTab(e, view)}}> - {view.MenuName} - </span> - {view.type !== 'Home' ? - <Icon type="close" onClick={(e) => {this.handleTabview(e, view)}}/> : null - } + <div className="content-header"> + {tabviews && tabviews.length > 0 && + <Tabs activeKey={selectedTabId}> + {tabviews.map(view => { + return ( + <Tabs.TabPane + tab={ + <span className="tab-control"> + {['CommonTable', 'FormTab', 'TreePage', 'CalendarPage', 'CustomPage'].includes(view.type) ? + <Icon type="redo" onClick={(e) => {this.refreshTabview(e, view)}}/> : null + } + <span className="tab-name" onClick={(e) => {this.changeTab(e, view)}}> + {view.MenuName} </span> - } - key={view.MenuID} - > - {this.selectcomponent(view)} - {options.sysType !== 'cloud' && !['CommonTable', 'TreePage', 'ManageTable', 'CalendarPage'].includes(view.type) ? - <Button - icon="copy" - shape="circle" - className={'main-copy ' + (view.type === 'iframe' ? 'ifr-copy' : '')} - data-menuno={view.MenuNo} - onClick={this.copyMenuNo} - /> : null - } - <BackTop> - <div className="ant-back-top"> - <div className="ant-back-top-content"> - <div className="ant-back-top-icon"></div> - </div> + {view.type !== 'Home' ? + <Icon type="close" onClick={(e) => {this.handleTabview(e, view)}}/> : null + } + </span> + } + key={view.MenuID} + > + {this.selectcomponent(view)} + {options.sysType !== 'cloud' && !['CommonTable', 'TreePage', 'ManageTable', 'CalendarPage'].includes(view.type) ? + <Button + icon="copy" + shape="circle" + className={'main-copy ' + (view.type === 'iframe' ? 'ifr-copy' : '')} + data-menuno={view.MenuNo} + onClick={this.copyMenuNo} + /> : null + } + <BackTop> + <div className="ant-back-top"> + <div className="ant-back-top-content"> + <div className="ant-back-top-icon"></div> </div> - </BackTop> - </Tabs.TabPane> - ) - })} - </Tabs> - } - </div> - </ConfigProvider> + </div> + </BackTop> + </Tabs.TabPane> + ) + })} + </Tabs> + } + </div> </section> ) } diff --git a/src/locales/en-US/main.js b/src/locales/en-US/main.js index d91a40c..30d4aa3 100644 --- a/src/locales/en-US/main.js +++ b/src/locales/en-US/main.js @@ -53,10 +53,6 @@ 'main.excel.content.limitmax': '澶т簬鏈�澶у��', 'main.form.link.error': '鑱斿姩鑿滃崟璁剧疆閿欒锛�', 'main.form.picture.check': '鏌ョ湅鍥剧墖', - 'main.thawmenu.source': 'Frozen', - 'main.thawmenu.target': 'Unfreeze', - 'main.thawmenu.itemUnit': 'item', - 'main.thawmenu.itemsUnit': 'items', 'main.role.title': 'The role list', 'main.view.notFound': '鎶辨瓑锛屼綘璁块棶鐨勯〉闈笉瀛樺湪锛岃鑱旂郴绠$悊鍛樸��', 'form.required.input': 'Please enter the ', diff --git a/src/locales/en-US/model.js b/src/locales/en-US/model.js index 6f09d8d..39c4ced 100644 --- a/src/locales/en-US/model.js +++ b/src/locales/en-US/model.js @@ -39,10 +39,6 @@ 'model.menu.level1': 'Level 1 menu', 'model.menu.level2': 'Level 2 menu', 'model.menu.level3': 'Level 3 menu', - 'model.menu.all': 'All', - 'model.menu.selected': 'Selected', - 'model.menu.itemUnit': 'Item', - 'model.menu.itemsUnit': 'Items', 'model.menu.close': 'Are you sure to delete the menu <<@M>> ?', 'model.menu.resetorder': 'Are you sure to adjust the menu sequence ?', 'model.menu.basemsg': 'Please complete the basic information !', @@ -84,10 +80,6 @@ 'header.form.modal.placeholder': 'Please add the form', 'header.form.action.placeholder': 'Please add buttons', 'header.form.column.placeholder': 'Please add columns', - 'header.form.column.source': 'Columns', - 'header.form.column.target': 'Have been added', - 'header.form.column.itemUnit': 'Item', - 'header.form.column.itemsUnit': 'Items', 'model.form.column.action': 'Action', 'model.form.width': 'Width', 'header.form.title': 'Title', @@ -224,8 +216,8 @@ 'header.form.status.change': '鐘舵�佸垏鎹�', 'header.form.status.forbidden': '绂佺敤', 'header.form.status.open': '鍚敤', - 'header.form.readin': '鏁版嵁鍐欏叆', - 'header.form.readin.tooltip': '鏄惁灏嗚〃鏍兼垨涓昏〃涓殑鏁版嵁鍐欏叆琛ㄥ崟', + 'header.form.readin': '鑷姩濉厖', + 'header.form.readin.tooltip': '鏄惁灏嗚〃鏍奸�変腑鐨勬暟鎹嚜鍔ㄥ~鍏呭埌琛ㄥ崟锛堝瓧娈电浉鍚岋級', 'header.form.afterExecSuccess': '鎴愬姛鍚�', 'header.form.afterExecError': '澶辫触鍚�', 'header.form.pagination': '鍒嗛〉', diff --git a/src/locales/zh-CN/main.js b/src/locales/zh-CN/main.js index a2f0315..600ca52 100644 --- a/src/locales/zh-CN/main.js +++ b/src/locales/zh-CN/main.js @@ -54,10 +54,6 @@ 'main.excel.content.limitmax': '澶т簬鏈�澶у��', 'main.form.link.error': '鑱斿姩鑿滃崟璁剧疆閿欒锛�', 'main.form.picture.check': '鏌ョ湅鍥剧墖', - 'main.thawmenu.source': '鍏ㄩ儴', - 'main.thawmenu.target': '宸查�夋嫨', - 'main.thawmenu.itemUnit': '椤�', - 'main.thawmenu.itemsUnit': '椤�', 'main.role.title': '瑙掕壊鍒楄〃', 'main.view.notFound': '鎶辨瓑锛屼綘璁块棶鐨勯〉闈笉瀛樺湪锛岃鑱旂郴绠$悊鍛樸��', 'form.required.input': '璇疯緭鍏�', diff --git a/src/locales/zh-CN/model.js b/src/locales/zh-CN/model.js index 3f921aa..1eacd91 100644 --- a/src/locales/zh-CN/model.js +++ b/src/locales/zh-CN/model.js @@ -39,10 +39,6 @@ 'model.menu.level1': '涓�绾ц彍鍗�', 'model.menu.level2': '浜岀骇鑿滃崟', 'model.menu.level3': '涓夌骇鑿滃崟', - 'model.menu.all': '鍏ㄩ儴', - 'model.menu.selected': '宸查�夋嫨', - 'model.menu.itemUnit': '椤�', - 'model.menu.itemsUnit': '椤�', 'model.menu.close': '纭畾鍒犻櫎銆夽M銆嬭彍鍗曞悧锛�', 'model.menu.resetorder': '纭璋冩暣鑿滃崟椤哄簭鍚楋紵', 'model.menu.basemsg': '璇峰畬鍠勮彍鍗曞熀鏈俊鎭紒', @@ -84,10 +80,6 @@ 'header.form.modal.placeholder': '璇锋坊鍔犺〃鍗�', 'header.form.action.placeholder': '璇锋坊鍔犳寜閽�', 'header.form.column.placeholder': '璇锋坊鍔犳樉绀哄垪', - 'header.form.column.source': '鏄剧ず鍒�', - 'header.form.column.target': '宸叉坊鍔�', - 'header.form.column.itemUnit': '椤�', - 'header.form.column.itemsUnit': '椤�', 'model.form.column.action': '鎿嶄綔', 'model.form.width': '瀹藉害', 'header.form.title': '鏍囬', @@ -224,8 +216,8 @@ 'header.form.status.change': '鐘舵�佸垏鎹�', 'header.form.status.forbidden': '绂佺敤', 'header.form.status.open': '鍚敤', - 'header.form.readin': '鏁版嵁鍐欏叆', - 'header.form.readin.tooltip': '鏄惁灏嗚〃鏍间腑鐨勬暟鎹啓鍏ヨ〃鍗�', + 'header.form.readin': '鑷姩濉厖', + 'header.form.readin.tooltip': '鏄惁灏嗚〃鏍奸�変腑鐨勬暟鎹嚜鍔ㄥ~鍏呭埌琛ㄥ崟锛堝瓧娈电浉鍚岋級', 'header.form.afterExecSuccess': '鎴愬姛鍚�', 'header.form.afterExecError': '澶辫触鍚�', 'header.form.pagination': '鍒嗛〉', diff --git a/src/menu/actioncomponent/index.jsx b/src/menu/actioncomponent/index.jsx index b9185b7..6c626c7 100644 --- a/src/menu/actioncomponent/index.jsx +++ b/src/menu/actioncomponent/index.jsx @@ -602,8 +602,6 @@ confirm({ content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋, - okText: dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { let _actionlist = fromJS(_this.state.actionlist).toJS() diff --git a/src/menu/actioncomponent/verifyexcelin/index.jsx b/src/menu/actioncomponent/verifyexcelin/index.jsx index b511cc1..2103682 100644 --- a/src/menu/actioncomponent/verifyexcelin/index.jsx +++ b/src/menu/actioncomponent/verifyexcelin/index.jsx @@ -83,9 +83,8 @@ <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'columns', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'columns', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'columns') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -141,9 +140,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'unique', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'unique')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'unique') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -206,9 +204,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'scripts', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'scripts') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -375,8 +372,6 @@ confirm({ content: `纭畾娓呯┖Excel鍒楀悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { _this.setState({ verify: { @@ -637,8 +632,6 @@ if (_loading) { confirm({ content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氭彁浜ゅ悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { resolve(_verify) }, diff --git a/src/menu/actioncomponent/verifyexcelout/index.jsx b/src/menu/actioncomponent/verifyexcelout/index.jsx index a2fd460..0d62f6b 100644 --- a/src/menu/actioncomponent/verifyexcelout/index.jsx +++ b/src/menu/actioncomponent/verifyexcelout/index.jsx @@ -51,12 +51,11 @@ <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'columns', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'columns', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} - onConfirm={() => this.handleDelete(record, 'columns') + onConfirm={() => this.handleDelete(record) }> - <span style={{color: '#ff4d4f', cursor: 'pointer'}}><Icon type="delete" /></span> + <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> </Popconfirm> </div> ) @@ -185,7 +184,7 @@ }) } - handleDelete = (record, type) => { + handleDelete = (record) => { const { verify } = this.state verify.columns = verify.columns.filter(item => item.uuid !== record.uuid) @@ -416,8 +415,6 @@ confirm({ content: `纭畾娓呯┖Excel鍒楀悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { _this.setState({ verify: { diff --git a/src/menu/actioncomponent/verifyprint/editable/index.jsx b/src/menu/actioncomponent/verifyprint/editable/index.jsx index cafd233..e014257 100644 --- a/src/menu/actioncomponent/verifyprint/editable/index.jsx +++ b/src/menu/actioncomponent/verifyprint/editable/index.jsx @@ -117,9 +117,8 @@ <span className="operation-btn" title={props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={props.dict['header.form.query.delete']} - okText={props.dict['model.confirm']} - cancelText={props.dict['model.cancel']} onConfirm={() => this.handleDelete(record.key) }> <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> diff --git a/src/menu/components/chart/antv-bar/chartcompile/index.jsx b/src/menu/components/chart/antv-bar/chartcompile/index.jsx index 315d9bd..d708a36 100644 --- a/src/menu/components/chart/antv-bar/chartcompile/index.jsx +++ b/src/menu/components/chart/antv-bar/chartcompile/index.jsx @@ -472,7 +472,6 @@ } render() { - const { dict } = this.props const { view, visible, disabled } = this.state const formItemLayout = { labelCol: { @@ -494,8 +493,6 @@ visible={visible} width={850} maskClosable={false} - okText={dict['model.submit']} - cancelText={dict['model.cancel']} onOk={this.onSubmit} onCancel={() => { this.setState({ visible: false }) }} destroyOnClose diff --git a/src/menu/datasourcecomponent/index.jsx b/src/menu/datasourcecomponent/index.jsx index 4c285ae..a5baeb0 100644 --- a/src/menu/datasourcecomponent/index.jsx +++ b/src/menu/datasourcecomponent/index.jsx @@ -69,7 +69,6 @@ maskClosable={false} style={{minWidth: '900px', maxWidth: '1200px'}} okText={dict['model.submit']} - cancelText={dict['model.cancel']} onOk={this.verifySubmit} confirmLoading={loading} onCancel={() => { this.setState({ visible: false }) }} diff --git a/src/menu/datasourcecomponent/verifycard/index.jsx b/src/menu/datasourcecomponent/verifycard/index.jsx index 19276e6..a4491da 100644 --- a/src/menu/datasourcecomponent/verifycard/index.jsx +++ b/src/menu/datasourcecomponent/verifycard/index.jsx @@ -65,9 +65,8 @@ (<div> <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'columns')} style={{color: '#1890ff'}}><Icon type="edit" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['model.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.deleteColumn(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -114,9 +113,8 @@ <span className="operation-btn" onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['model.status.change']} onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['model.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.deleteScript(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> diff --git a/src/menu/header/index.jsx b/src/menu/header/index.jsx index e8ab7dc..348c2e1 100644 --- a/src/menu/header/index.jsx +++ b/src/menu/header/index.jsx @@ -33,8 +33,6 @@ // confirm({ // title: this.state.dict['mob.logout.hint'], // content: '', - // okText: this.state.dict['mob.confirm'], - // cancelText: this.state.dict['mob.cancel'], // onOk() { // sessionStorage.clear() // _this.props.logout() diff --git a/src/menu/searchcomponent/index.jsx b/src/menu/searchcomponent/index.jsx index e8e7ab4..39d093b 100644 --- a/src/menu/searchcomponent/index.jsx +++ b/src/menu/searchcomponent/index.jsx @@ -241,8 +241,6 @@ confirm({ content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋, - okText: dict['model.confirm'], - cancelText: dict['model.cancel'], onOk() { let _searchlist = fromJS(_this.state.searchlist).toJS() @@ -289,8 +287,6 @@ width={850} maskClosable={false} onOk={this.handleSubmit} - okText={dict['model.confirm']} - cancelText={dict['model.cancel']} confirmLoading={sqlVerifing} onCancel={this.editModalCancel} destroyOnClose diff --git a/src/menu/searchcomponent/searcheditable/index.jsx b/src/menu/searchcomponent/searcheditable/index.jsx index 4a560c4..bf2b160 100644 --- a/src/menu/searchcomponent/searcheditable/index.jsx +++ b/src/menu/searchcomponent/searcheditable/index.jsx @@ -116,9 +116,8 @@ <span className="operation-btn" title={props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={props.dict['header.form.query.delete']} - okText={props.dict['model.confirm']} - cancelText={props.dict['model.cancel']} onConfirm={() => this.handleDelete(record.key) }> <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> @@ -227,9 +226,8 @@ <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record.key) }> <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> diff --git a/src/mob/contdelete/index.jsx b/src/mob/contdelete/index.jsx index f18fa66..05c09bc 100644 --- a/src/mob/contdelete/index.jsx +++ b/src/mob/contdelete/index.jsx @@ -36,8 +36,6 @@ confirm({ title: '纭畾鍒犻櫎鍏冪礌鍚楋紵', - okText: this.state.dict['mob.confirm'], - cancelText: this.state.dict['mob.cancel'], onOk() { _this.props.updateContent({...list, subItems: list.subItems.filter(item => item.uuid !== element.uuid)}) }, diff --git a/src/mob/contupdate/index.jsx b/src/mob/contupdate/index.jsx index e31dd45..1fc2b9a 100644 --- a/src/mob/contupdate/index.jsx +++ b/src/mob/contupdate/index.jsx @@ -76,8 +76,6 @@ confirm({ title: '纭畾鍒犻櫎鍏冪礌鍚楋紵', - okText: this.state.dict['mob.confirm'], - cancelText: this.state.dict['mob.cancel'], onOk() { _this.props.updateContent(null) }, diff --git a/src/mob/datasource/index.jsx b/src/mob/datasource/index.jsx index cf08081..4cc50a0 100644 --- a/src/mob/datasource/index.jsx +++ b/src/mob/datasource/index.jsx @@ -69,8 +69,6 @@ confirm({ title: '纭畾鍒犻櫎鏁版嵁婧愬悧锛�', content: '', - okText: _this.state.dict['mob.confirm'], - cancelText: _this.state.dict['mob.cancel'], onOk() { _this.setState({sourcelist}) _this.props.updateConfig({...config, sourcelist: fromJS(sourcelist).toJS()}) @@ -143,7 +141,6 @@ maskClosable={false} style={{minWidth: '900px', maxWidth: '1200px'}} okText={dict['mob.submit']} - cancelText={dict['mob.cancel']} onOk={this.verifySubmit} confirmLoading={loading} onCancel={() => { this.setState({ visible: false }) }} diff --git a/src/mob/datasource/verifycard/index.jsx b/src/mob/datasource/verifycard/index.jsx index aab6910..8f45ee7 100644 --- a/src/mob/datasource/verifycard/index.jsx +++ b/src/mob/datasource/verifycard/index.jsx @@ -57,9 +57,8 @@ (<div> <span className="operation-btn" title={this.props.dict['mob.edit']} onClick={() => this.handleEdit(record, 'columns')} style={{color: '#1890ff'}}><Icon type="edit" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['mob.query.delete']} - okText={this.props.dict['mob.confirm']} - cancelText={this.props.dict['mob.cancel']} onConfirm={() => this.deleteColumn(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -106,9 +105,8 @@ <span className="operation-btn" onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['mob.status.change']} onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['mob.query.delete']} - okText={this.props.dict['mob.confirm']} - cancelText={this.props.dict['mob.cancel']} onConfirm={() => this.deleteScript(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> diff --git a/src/mob/header/index.jsx b/src/mob/header/index.jsx index f9547a3..5c5383e 100644 --- a/src/mob/header/index.jsx +++ b/src/mob/header/index.jsx @@ -34,8 +34,6 @@ confirm({ title: this.state.dict['mob.logout.hint'], content: '', - okText: this.state.dict['mob.confirm'], - cancelText: this.state.dict['mob.cancel'], onOk() { sessionStorage.clear() _this.props.logout() diff --git a/src/mob/mobcard/index.jsx b/src/mob/mobcard/index.jsx index 6daee4f..9bcb24d 100644 --- a/src/mob/mobcard/index.jsx +++ b/src/mob/mobcard/index.jsx @@ -80,8 +80,6 @@ confirm({ title: '纭畾鍒犻櫎銆�' + card.name + '銆嬪悧锛�', content: '', - okText: this.state.dict['mob.confirm'], - cancelText: this.state.dict['mob.cancel'], onOk() { return new Promise(resolve => { let param = { @@ -209,8 +207,6 @@ width={'600px'} maskClosable={false} visible={this.state.visible} - okText={this.state.dict['mob.confirm']} - cancelText={this.state.dict['mob.cancel']} onCancel={() => this.setState({visible: false})} confirmLoading={this.state.confirmloading} onOk={this.submitCard} diff --git a/src/store/options.js b/src/store/options.js index a009d38..fc36c60 100644 --- a/src/store/options.js +++ b/src/store/options.js @@ -3,8 +3,7 @@ sysType: 'bG9j$mkYWw=', // yun ( Y2xv$mkdWQ= ) 銆� dandian ( U1$mkNP ) 銆� yewu ( bG9j$mkYWw= ) caId: 'MjAyMDAxMTYxMjMzMzU1MDd$mkGQzkyMzI1Rjk4MDY0QUNGQjQ2Mg==', cakey: 'MjAyMDAxMTYxMjQwMDQ2NDM$mk2N0QzODE2MjExNUI0MTc4OTVDMQ==', - cdomain: 'aHR0cDovL2Nsb3V$mkkLm1rOWguY24=', // window.btoa('') 鍩熷悕 涓嶅甫 / - // cdomain: 'aHR0cDovL2Nsb3VkLnBv$mkc2l0ZWNncm91cC5jb206ODA4MA==', // bao鈥攕hi-de + cdomain: 'aHR0cDovL2Nsb3V$mkkLm1rOWguY24=', // window.btoa('') 鍩熷悕 涓嶅甫 /; baoshide ( aHR0cDovL2Nsb3VkLnBv$mkc2l0ZWNncm91cC5jb206ODA4MA== ) styles: { white: 'mk-white' } diff --git a/src/tabviews/commontable/index.jsx b/src/tabviews/commontable/index.jsx index 49bf1a7..31fe1ae 100644 --- a/src/tabviews/commontable/index.jsx +++ b/src/tabviews/commontable/index.jsx @@ -389,6 +389,8 @@ }) } + console.log(_columns) + this.setState({ BID: param && param.BID ? param.BID : '', loadingview: false, diff --git a/src/tabviews/custom/components/chart/antv-bar/index.jsx b/src/tabviews/custom/components/chart/antv-bar/index.jsx new file mode 100644 index 0000000..e83f89a --- /dev/null +++ b/src/tabviews/custom/components/chart/antv-bar/index.jsx @@ -0,0 +1,583 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { is, fromJS } from 'immutable' +import { Chart } from '@antv/g2' +import DataSet from '@antv/data-set' + +import asyncComponent from '@/utils/asyncComponent' + +import zhCN from '@/locales/zh-CN/model.js' +import enUS from '@/locales/en-US/model.js' +import './index.scss' + +const SettingComponent = asyncComponent(() => import('@/menu/datasourcecomponent')) +const SearchComponent = asyncComponent(() => import('@/menu/searchcomponent')) +const ActionComponent = asyncComponent(() => import('@/menu/actioncomponent')) + +class antvBarLineChart extends Component { + static propTpyes = { + config: PropTypes.object, + card: PropTypes.object, + editId: PropTypes.any, + triggerEdit: PropTypes.func, + updateConfig: PropTypes.func, + } + + state = { + dict: localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, + card: null, + visible: true + } + + UNSAFE_componentWillMount () { + const { card, config } = this.props + + if (card.isNew) { + let _plot = { + chartType: card.type, // 鍥捐〃绫诲瀷 + enabled: 'false', // 鏄惁浣跨敤鑷畾涔夎缃� + datatype: 'query', // 鏁版嵁绫诲瀷鏌ヨ鎴栫粺璁� + customs: [] + } + + if (card.subtype === 'bar') { + _plot.coordinate = 'angle' // 浜岀淮鍧愭爣鎴栨瀬鍧愭爣 + _plot.transpose = 'false' // 鍧愭爣杞村彉鎹� + } else if (card.subtype === 'bar1') { + _plot.coordinate = 'angle' + _plot.transpose = 'true' + } else if (card.subtype === 'line') { + _plot.shape = 'smooth' + } else if (card.subtype === 'line1') { + _plot.shape = 'hv' + } + + let name = '' + let names = { + bar: '鏌辩姸鍥�', + line: '鎶樼嚎鍥�', + } + let i = 1 + + while (!name) { + let _name = names[card.type] + i + if (config.components.filter(com => com.setting && com.setting.name === _name).length === 0) { + name = _name + } + i++ + } + + let _card = { + uuid: card.uuid, + type: card.type, + subtype: card.subtype, + setting: {span: 12, height: 400, name}, + columns: [], + scripts: [], + search: [], + action: [], + plot: _plot + } + this.setState({ + card: _card + }) + this.props.updateConfig(_card) + } else { + this.setState({ + card: fromJS(card).toJS() + }) + } + } + + componentDidMount () { + this.viewrender() + } + + UNSAFE_componentWillReceiveProps (nextProps) { + if (!is(fromJS(this.props.plot), fromJS(nextProps.plot))) { + + } + } + + getdata = (X_axis, Y_axis) => { + let data = [] + let xdata = ['鍛ㄤ竴', '鍛ㄤ簩', '鍛ㄤ笁', '鍛ㄥ洓', '鍛ㄤ簲', '鍛ㄥ叚', '鍛ㄦ棩'] + let point = 7 + + for (let i = 0; i < point; i++) { + let item = {} + + item[X_axis] = xdata[i] + + if (typeof(Y_axis) === 'string') { + item[Y_axis] = Math.floor(Math.random() * 5 * (i + 1)) + i + } else { + Y_axis.forEach(y => { + item[y] = Math.floor(Math.random() * 5 * (i + 1)) + i + }) + } + + data.push(item) + } + + return data + } + + viewrender = () => { + const { card } = this.state + + if (card.plot.chartType === 'line') { + this.linerender() + } else if (card.plot.chartType === 'bar') { + this.barrender() + } + } + + linerender = () => { + const { card } = this.state + let plot = {...card.plot, height: card.setting.height - 70} + + let transfield = {} + card.columns.forEach(col => { + if (col.field) { + transfield[col.field] = col.label + } + }) + + let X_axis = plot.Xaxis || 'x' + let Y_axis = plot.Yaxis || ['y'] + + let data = this.getdata(X_axis, Y_axis) + + if (plot.enabled !== 'true') { + const ds = new DataSet() + const dv = ds.createView().source(data) + + dv.transform({ + type: 'fold', + fields: [...Y_axis], + key: 'key', + value: 'value' + }) + + if (plot.Xaxis) { + dv.transform({ + type: 'map', + callback(row) { + row.key = transfield[row.key] + return row + }, + }) + } + + const chart = new Chart({ + container: card.uuid, + autoFit: true, + height: plot.height || 400 + }) + + chart.data(dv.rows) + + if (plot.coordinate !== 'polar') { + chart.scale(X_axis, { + range: [0, 1] + }) + } + chart.scale('value', { + nice: true + }) + + if (!plot.legend || plot.legend === 'hidden') { + chart.legend(false) + } else { + chart.legend({ + position: plot.legend + }) + } + + if (plot.tooltip !== 'true') { + chart.tooltip(false) + } else { + chart.tooltip({ + shared: true + }) + } + + if (plot.transpose === 'true') { + chart.coordinate().transpose() + } + + if (plot.coordinate === 'polar') { + chart.coordinate('polar', { + innerRadius: 0.1, + radius: 0.8 + }) + } + + let _chart = chart + .line() + .position(`${X_axis}*value`) + .color('key') + .shape(plot.shape || 'smooth') + + if (plot.label === 'true') { + _chart.label('value') + } + + if (plot.point === 'true') { + chart + .point() + .position(`${X_axis}*value`) + .color('key') + .size(3) + .shape('circle') + } + chart.render() + } else { + this.customrender(data, transfield) + } + } + + customrender = (data, transfield) => { + const { plot } = this.props + + let barfields = [] + let fields = [] + let legends = [] + + plot.customs.forEach(item => { + item.name = transfield[item.field] || item.field + if (item.axis === 'left') { + item.index = 0 + } else if (item.axis === 'right') { + item.index = 1 + } else { + item.index = 2 + } + + if (item.chartType === 'bar') { + barfields.push(item.field) + fields.unshift(item) + } else { + fields.push(item) + } + + legends.push({ + value: item.name, + name: item.name, + marker: { symbol: item.chartType === 'bar' ? 'square' : 'hyphen', style: { stroke: item.color,fill: item.color, r: 5, lineWidth: 2 } } + }) + }) + + fields.sort((a, b) => a.index - b.index) + + const ds = new DataSet() + const dv = ds.createView().source(data) + dv.transform({ + type: 'map', + callback(row) { + fields.forEach(line => { + row[line.name] = row[line.field] + }) + return row + } + }) + + const chart = new Chart({ + container: plot.uuid, + autoFit: true, + height: plot.height || 400 + }) + + chart.data(dv.rows) + + if (plot.coordinate !== 'polar' && barfields.length === 0) { + chart.scale(plot.Xaxis, { + range: [0, 1] + }) + } + + if (!plot.legend || plot.legend === 'hidden') { + chart.legend(false) + } else { + chart.legend({ + custom: true, + position: plot.legend, + items: legends, + }) + } + + if (plot.tooltip !== 'true') { + chart.tooltip(false) + } else { + chart.tooltip({ + shared: true + }) + } + + if (plot.transpose === 'true') { + chart.coordinate().transpose() + } + + if (plot.coordinate === 'polar') { + chart.coordinate('polar', { + innerRadius: 0.1, + radius: 0.8 + }) + } + + chart.scale({ + nice: true + }) + + fields.forEach((item, i) => { + if (i === 0) { + chart.axis(item.name, { + grid: {}, + title: {}, + label: {} + }) + } else if (i === 1 && item.axis !== 'unset') { + chart.axis(item.name, { + grid: null, + title: {}, + label: {} + }) + } else { + chart.axis(item.name, { + grid: null, + title: null, + label: null + }) + } + + if (item.chartType === 'bar') { + let _chart = chart + .interval() + .position(`${plot.Xaxis}*${item.name}`) + .color(item.color) + .shape(item.shape) + + if (item.label === 'true') { + _chart.label(item.name) + } + } else if (item.chartType === 'line') { + let _chart = chart + .line() + .position(`${plot.Xaxis}*${item.name}`) + .color(item.color) + .shape(item.shape) + + if (item.label === 'true') { + _chart.label(item.name) + } + + if (plot.point === 'true') { + chart + .point() + .position(`${plot.Xaxis}*${item.name}`) + .color(item.color) + .size(3) + .shape('circle') + } + } + }) + + chart.render() + } + + barrender = () => { + const { card } = this.state + + let plot = {...card.plot, height: card.setting.height - 70} + + let transfield = {} + card.columns.forEach(col => { + if (col.field) { + transfield[col.field] = col.label + } + }) + let X_axis = plot.Xaxis || 'x' + let Y_axis = plot.Yaxis || ['y'] + + let data = this.getdata(X_axis, Y_axis) + + if (plot.enabled !== 'true') { + const ds = new DataSet() + const dv = ds.createView().source(data) + + dv.transform({ + type: 'fold', + fields: [...Y_axis], + key: 'key', + value: 'value' + }) + + if (plot.Xaxis) { + dv.transform({ + type: 'map', + callback(row) { + row.key = transfield[row.key] + return row + }, + }) + } + + const chart = new Chart({ + container: card.uuid, + autoFit: true, + height: plot.height || 400 + }) + + chart.data(dv.rows) + + chart.scale('value', { + nice: true + }) + + if (!plot.legend || plot.legend === 'hidden') { + chart.legend(false) + } else { + chart.legend({ + position: plot.legend + }) + } + + if (plot.tooltip !== 'true') { + chart.tooltip(false) + } else { + chart.tooltip({ + shared: true + }) + } + + if (plot.transpose === 'true') { + chart.coordinate().transpose() + } + + if (plot.coordinate === 'polar') { + chart.coordinate('polar', { + innerRadius: 0.1, + radius: 0.8 + }) + } + + if (plot.adjust !== 'stack') { + let _chart = chart + .interval() + .position(`${X_axis}*value`) + .color('key') + .adjust([ + { + type: 'dodge', + marginRatio: 0 + } + ]) + .shape(plot.shape || 'rect') + + if (plot.label === 'true') { + _chart.label('value') + } + } else if (plot.adjust === 'stack') { + let _chart = chart + .interval() + .position(`${X_axis}*value`) + .color('key') + .adjust('stack') + .shape(plot.shape || 'rect') + + if (plot.label === 'true') { + _chart.label('value') + } + } + + chart.render() + } else { + this.customrender(data, transfield) + } + } + + plotChange = (_plot) => { + const { config } = this.props + + if (_plot.datatype === 'statistics') { + _plot.Yaxis = [_plot.InfoValue] + } + + let _charts = fromJS(config.charts).toJS() + + _charts = _charts.map(item => { + if (item.uuid === _plot.uuid) { + if (!is(fromJS(item), fromJS(_plot))) { + let _element = document.getElementById(_plot.uuid) + if (_element) { + _element.innerHTML = '' + } + } + return _plot + } + return item + }) + + this.props.plotchange({...config, charts: _charts}) + } + + shouldComponentUpdate (nextProps, nextState) { + return !is(fromJS(this.props), fromJS(nextProps)) || !is(fromJS(this.state), fromJS(nextState)) + } + + updateComponent = (component) => { + const card = fromJS(this.state.card).toJS() + let refresh = false + if (card.setting.span !== component.setting.span || card.setting.height !== component.setting.height || !is(fromJS(component.plot), fromJS(card.plot))) { + let _element = document.getElementById(card.uuid) + if (_element) { + _element.innerHTML = '' + } + refresh = true + } + + this.setState({ + card: component + }, () => { + if (refresh) { + setTimeout(() => { + this.viewrender() + }, 100) + } + }) + this.props.updateConfig(component) + } + + render() { + const { card } = this.state + const { config } = this.props + + return ( + <div className="menu-line-chart-edit-box" style={{height: card.setting.height || 400}}> + <div className="chart-header"> + <span className="chart-title">{card.setting.title || ''}</span> + <SearchComponent + menu={config} + config={card} + sysRoles={config.sysRoles} + optionLibs={null} + updatesearch={this.updateComponent} + /> + </div> + <ActionComponent + type="chart" + menu={config} + config={card} + tabs={[]} + usefulFields={config.permFuncField || []} + // setSubConfig={(_btn) => this.setSubConfig(_btn, 'button')} + updateaction={this.updateComponent} + /> + <div className="canvas" id={card.uuid}></div> + </div> + ) + } +} + +export default antvBarLineChart \ No newline at end of file diff --git a/src/tabviews/custom/components/chart/antv-bar/index.scss b/src/tabviews/custom/components/chart/antv-bar/index.scss new file mode 100644 index 0000000..e96a3a6 --- /dev/null +++ b/src/tabviews/custom/components/chart/antv-bar/index.scss @@ -0,0 +1,38 @@ +.menu-line-chart-edit-box { + position: relative; + // margin-bottom: 0px; + border: 1px solid #e8e8e8; + + .canvas { + margin: 0px; + padding: 10px 15px; + } + + .chart-header { + height: 50px; + border-bottom: 1px solid #e8e8e8; + overflow: hidden; + + .chart-title { + font-size: 16px; + float: left; + line-height: 50px; + margin-left: 10px; + } + } + + .model-custom-chart-action-list { + position: absolute; + right: 0px; + z-index: 4; + padding-top: 10px; + + .ant-row .anticon-plus { + float: right; + } + + .page-card { + float: right; + } + } +} diff --git a/src/tabviews/custom/tools/simpleSearch/index.jsx b/src/tabviews/custom/tools/simpleSearch/index.jsx new file mode 100644 index 0000000..a809ad3 --- /dev/null +++ b/src/tabviews/custom/tools/simpleSearch/index.jsx @@ -0,0 +1,784 @@ +import React, {Component} from 'react' +import PropTypes from 'prop-types' +import { fromJS } from 'immutable' +import { Form, Row, Col, Input, Button, Select, DatePicker, notification } from 'antd' +import moment from 'moment' + +import Api from '@/api' +import options from '@/store/options.js' +import DateGroup from '@/tabviews/zshare/dategroup' +import Utils from '@/utils/utils.js' +import './index.scss' + +const {MonthPicker, WeekPicker, RangePicker} = DatePicker + +class MainSearch extends Component { + static propTpyes = { + BID: PropTypes.any, // 鐖剁骇Id锛岀敤浜庢煡璇笅鎷夐�夋嫨椤� + dataManager: PropTypes.any, // 鏁版嵁鏉冮檺 + menuType: PropTypes.any, // 鑿滃崟鏉冮檺锛屾槸鍚︿负HS + searchlist: PropTypes.array, // 鎼滅储鏉′欢鍒楄〃 + dict: PropTypes.object // 瀛楀吀椤� + } + + state = { + match: null, // 鎼滅储鏉′欢鍖归厤瑙勫垯 + style: null, // 鎼滅储鏉′欢绫诲瀷 + label: null, // 鎻愮ず鏂囧瓧 + required: null, // 鏄惁蹇呭~ + searchlist: null, // 鎼滅储椤� + groups: null, // 缁勫悎鎼滅储椤� + formId: Utils.getuuid() // 鎼滅储琛ㄥ崟Id + } + + UNSAFE_componentWillMount () { + let searchlist = fromJS(this.props.searchlist).toJS() + let match = {} + let label = {} + let style = {} + let required = {} + let _list = [] + let fieldMap = new Map() + let mainItems = [] // 浜戠鎴栧崟鐐规暟鎹� + let localItems = [] // 鏈湴鏁版嵁 + let deForms = [] // 娴嬭瘯绯荤粺锛屽崟涓姹� + + searchlist.forEach(item => { + if (fieldMap.has(item.field)) { + item.field = item.field + '@tail@' + } + fieldMap.set(item.field, true) + + match[item.field] = item.match + label[item.field] = item.label + style[item.field] = item.type + required[item.field] = item.required === 'true' + + if (['select', 'link', 'multiselect'].includes(item.type)) { + if (item.setAll === 'true' && item.type !== 'multiselect') { + item.options.unshift({ + key: Utils.getuuid(), + Value: '', + Text: this.props.dict['main.all'] + }) + } + + // 鏁版嵁婧愭煡璇㈣鍙� + if (item.resourceType === '1' && item.dataSource) { + let _option = Utils.getSelectQueryOptions(item) + + if (this.props.dataManager) { // 鏁版嵁鏉冮檺 + _option.sql = _option.sql.replace(/\$@/ig, '/*') + _option.sql = _option.sql.replace(/@\$/ig, '*/') + } else { + _option.sql = _option.sql.replace(/@\$|\$@/ig, '') + } + + // 娴嬭瘯绯荤粺鍗曚釜璇锋眰 + if (this.props.menuType !== 'HS' && options.sysType === 'local' && !window.GLOB.systemType) { + deForms.push({ + ...item, + arr_field: _option.field, + data_sql: Utils.formatOptions(_option.sql) + }) + } else { // 鍚堝苟璇锋眰锛屽尯鍒嗘湰鍦板強绯荤粺 + if (item.database === 'sso') { + mainItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_option.sql))}' as LText`) + } else { + localItems.push(`select '${item.field}' as obj_name,'${_option.field}' as arr_field,'${window.btoa(window.encodeURIComponent(_option.sql))}' as LText`) + } + } + } + item.oriOptions = fromJS(item.options).toJS() + } + + _list.push(item) + }) + + let _groups = [] + _list = _list.map(item => { + if (item.type === 'link') { + let supItem = _list.filter(form => form.field === item.linkField)[0] + + if (!supItem) { + notification.warning({ + top: 92, + message: '鏈煡璇㈠埌鎼滅储鏉′欢銆�' + item.label + '銆嬪叧鑱斿瓧娈碉紒', + duration: 5 + }) + item.supInitVal = '' + } else { + item.supInitVal = supItem.initval + item.options = item.oriOptions.filter(option => option.ParentID === supItem.initval) + } + } else if (item.type === 'group' && item.Hide !== 'true') { + _groups.push(fromJS(item).toJS()) + } + + return item + }) + + this.setState({ + match: match, + label: label, + style: style, + required: required, + searchlist: _list, + groups: _groups + }, () => { + if (this.props.menuType !== 'HS' && options.sysType === 'local' && !window.GLOB.systemType) { + this.improveSimpleSearch(deForms) + } else { + this.improveSearch(mainItems, localItems) + } + }) + } + + // 鏌ヨ涓嬫媺鑿滃崟 + improveSearch = (mainItems, localItems) => { + const { menuType, BID } = this.props + let deffers = [] + + if (menuType !== 'HS' && window.GLOB.systemType !== 'production') { + localItems = [...localItems, ...mainItems] + mainItems = [] + } + + // 鏈湴璇锋眰 + let param = { + func: 'sPC_Get_SelectedList', + LText: localItems.join(' union all '), + obj_name: '', + arr_field: '', + table_type: 'Y' + } + + if (BID) { + param.BID = BID + } + + if (param.LText) { + param.LText = Utils.formatOptions(param.LText) + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' + param.secretkey = Utils.encrypt(param.LText, param.timestamp) + + if (menuType === 'HS') { // 浜戠鏁版嵁楠岃瘉 + param.open_key = Utils.encrypt(param.secretkey, param.timestamp, true) + } + + deffers.push( + new Promise(resolve => { + Api.getSystemCacheConfig(param).then(res => { + if (!res.status) { + notification.warning({ + top: 92, + message: res.message, + duration: 5 + }) + } + resolve(res) + }) + }) + ) + } + + // 绯荤粺璇锋眰 + let mainparam = { + func: 'sPC_Get_SelectedList', + LText: mainItems.join(' union all '), + obj_name: '', + arr_field: '', + table_type: 'Y' + } + + if (BID) { + mainparam.BID = BID + } + + if (mainparam.LText) { + mainparam.LText = Utils.formatOptions(mainparam.LText) + mainparam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' + mainparam.secretkey = Utils.encrypt(mainparam.LText, mainparam.timestamp) + + if (menuType === 'HS') { // 浜戠鏁版嵁楠岃瘉 + mainparam.open_key = Utils.encrypt(mainparam.secretkey, mainparam.timestamp, true) + if (options.cloudServiceApi) { + mainparam.rduri = options.cloudServiceApi + mainparam.userid = sessionStorage.getItem('CloudUserID') || '' + mainparam.LoginUID = sessionStorage.getItem('CloudLoginUID') || '' + } + } else if (window.GLOB.mainSystemApi) { + mainparam.rduri = window.GLOB.mainSystemApi + } + + deffers.push( + new Promise(resolve => { + Api.getSystemCacheConfig(mainparam).then(res => { + if (!res.status) { + notification.warning({ + top: 92, + message: res.message, + duration: 5 + }) + } + resolve(res) + }) + }) + ) + } + + Promise.all(deffers).then(response => { + let result = {...response[0], ...(response[1] || {})} + + delete result.ErrCode + delete result.ErrMesg + delete result.message + delete result.status + + let _searchlist = this.state.searchlist.map(item => { + if (['select', 'link', 'multiselect'].includes(item.type) && result[item.field] && result[item.field].length > 0) { + let options = result[item.field].map(cell => { + let _item = { + key: Utils.getuuid(), + Value: cell[item.valueField], + Text: cell[item.valueText] + } + + if (item.type === 'link') { + _item.ParentID = cell[item.linkField] + } + + return _item + }) + + item.oriOptions = [...item.oriOptions, ...options] + } + return item + }) + + this.setState({ + searchlist: _searchlist.map(item => { + if (item.type === 'link') { + if (item.supInitVal) { + item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal) + } else { + item.options = item.oriOptions + } + } else if (item.type === 'select' || item.type === 'multiselect') { + item.options = item.oriOptions + } + + return item + }) + }) + }) + } + + // 娴嬭瘯绯荤粺鍗曚釜璇锋眰涓嬫媺閫夐」 + improveSimpleSearch = (deForms) => { + if (deForms.length === 0) return + + let deffers = deForms.map(item => { + let param = { + func: 'sPC_Get_SelectedList', + LText: item.data_sql, + obj_name: item.field, + arr_field: item.arr_field + } + + if (this.props.BID) { + param.BID = this.props.BID + } + + param.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' + param.secretkey = Utils.encrypt(param.LText, param.timestamp) + + return ( + new Promise(resolve => { + Api.getSystemCacheConfig(param).then(res => { + if (!res.status) { + notification.warning({ + top: 92, + message: res.message, + duration: 5 + }) + } + resolve(res) + }) + }) + ) + }) + + Promise.all(deffers).then(response => { + let result = {} + + response.forEach(res => { + result = {...result, ...res} + }) + + delete result.ErrCode + delete result.ErrMesg + delete result.message + delete result.status + + let _searchlist = this.state.searchlist.map(item => { + if (['select', 'link', 'multiselect'].includes(item.type) && result[item.field] && result[item.field].length > 0) { + let options = result[item.field].map(cell => { + let _item = { + key: Utils.getuuid(), + Value: cell[item.valueField], + Text: cell[item.valueText] + } + + if (item.type === 'link') { + _item.ParentID = cell[item.linkField] + } + + return _item + }) + + item.oriOptions = [...item.oriOptions, ...options] + } + return item + }) + + this.setState({ + searchlist: _searchlist.map(item => { + if (item.type === 'link') { + if (item.supInitVal) { + item.options = item.oriOptions.filter(option => option.ParentID === item.supInitVal) + } else { + item.options = item.oriOptions + } + } else if (item.type === 'select' || item.type === 'multiselect') { + item.options = item.oriOptions + } + + return item + }) + }) + }) + } + + resetform = (formlist, supfields, index, fieldsvalue) => { + index++ + let subfields = [] + + supfields.forEach(supfield => { + formlist = formlist.map(item => { + if (item.type === 'link' && item.linkField === supfield.field) { + item.options = item.oriOptions.filter(option => option.ParentID === supfield.initval) + item.initval = item.options[0] ? item.options[0].Value : '' + + if (this.props.form.getFieldValue(item.field) !== undefined) { + fieldsvalue[item.field] = item.initval + } + + subfields.push(item) + } + return item + }) + }) + + if (subfields.length === 0 || index > 6) { + return formlist + } else { + return this.resetform(formlist, subfields, index, fieldsvalue) + } + } + + selectChange = (_field, value) => { + let formlist = fromJS(this.state.searchlist).toJS() + + let subfields = [] + let fieldsvalue = {} + formlist = formlist.map(item => { + if (item.type === 'link' && item.linkField === _field.field) { + item.options = item.oriOptions.filter(option => option.ParentID === value) + item.initval = item.options[0] ? item.options[0].Value : '' + + if (this.props.form.getFieldValue(item.field) !== undefined) { + fieldsvalue[item.field] = item.initval + } + + subfields.push(item) + } + return item + }) + + if (subfields.length === 0) { + this.searchChange() + return + } + + formlist = this.resetform(formlist, subfields, 0, fieldsvalue) + + if (Object.keys(fieldsvalue).length > 0) { + this.props.form.setFieldsValue(fieldsvalue) + } + + this.setState({ + searchlist: formlist + }, () => { + this.searchChange() + }) + } + + getFields() { + const { getFieldDecorator } = this.props.form + const fields = [] + + this.state.searchlist.forEach((item, index) => { + if (item.Hide === 'true') return + + if (item.type === 'text') { // 鏂囨湰鎼滅储 + fields.push( + <Col span={item.ratio || 6} key={index}> + <Form.Item label={item.label}> + {getFieldDecorator(item.field, { + initialValue: item.initval, + rules: [ + { + required: item.required === 'true', + message: this.props.dict['form.required.input'] + item.label + '!' + } + ] + })(<Input placeholder="" autoComplete="off" />)} + </Form.Item> + </Col> + ) + } else if (item.type === 'select') { // 涓嬫媺鎼滅储 + fields.push( + <Col span={item.ratio || 6} key={index}> + <Form.Item label={item.label}> + {getFieldDecorator(item.field, { + initialValue: item.initval, + rules: [ + { + required: item.required === 'true', + message: this.props.dict['form.required.select'] + item.label + '!' + } + ] + })( + <Select + showSearch + onChange={(value) => {this.selectChange(item, value)}} + filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} + getPopupContainer={() => document.getElementById(this.state.formId)} + > + {item.options.map((option, i) => + <Select.Option id={`${i}`} title={option.Text} key={`${i}`} value={option.Value}>{option.Text}</Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> + ) + } else if (item.type === 'multiselect') { // 涓嬫媺澶氶�� + let _initval = item.initval ? item.initval.split(',').filter(Boolean) : [] + fields.push( + <Col span={item.ratio || 6} key={index}> + <Form.Item label={item.label}> + {getFieldDecorator(item.field, { + initialValue: _initval, + rules: [ + { + required: item.required === 'true', + message: this.props.dict['form.required.select'] + item.label + '!' + } + ] + })( + <Select + showSearch + mode="multiple" + onChange={this.searchChange} + filterOption={(input, option) => option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0} + getPopupContainer={() => document.getElementById(this.state.formId)} + > + {item.options.map((option, i) => + <Select.Option id={`${i}`} title={option.Text} key={`${i}`} value={option.Value}>{option.Text}</Select.Option> + )} + </Select> + )} + </Form.Item> + </Col> + ) + } else if (item.type === 'date') { // 鏃堕棿鎼滅储 + fields.push( + <Col span={item.ratio || 6} key={index}> + <Form.Item label={item.label}> + {getFieldDecorator(item.field, { + initialValue: item.initval ? moment().subtract(item.initval, 'days') : null, + rules: [ + { + required: item.required === 'true', + message: this.props.dict['form.required.select'] + item.label + '!' + } + ] + })( + <DatePicker onChange={this.searchChange} getCalendarContainer={() => document.getElementById(this.state.formId)} /> + )} + </Form.Item> + </Col> + ) + } else if (item.type === 'datemonth') { + fields.push( + <Col span={item.ratio || 6} key={index}> + <Form.Item label={item.label}> + {getFieldDecorator(item.field, { + initialValue: item.initval ? moment().subtract(item.initval, 'month') : null, + rules: [ + { + required: item.required === 'true', + message: this.props.dict['form.required.select'] + item.label + '!' + } + ] + })( + <MonthPicker onChange={this.searchChange} getCalendarContainer={() => document.getElementById(this.state.formId)} /> + )} + </Form.Item> + </Col> + ) + } else if (item.type === 'dateweek') { + fields.push( + <Col span={item.ratio || 6} key={index}> + <Form.Item label={item.label}> + {getFieldDecorator(item.field, { + initialValue: item.initval ? moment().subtract(item.initval * 7, 'days') : null, + rules: [ + { + required: item.required === 'true', + message: this.props.dict['form.required.select'] + item.label + '!' + } + ] + })( + <WeekPicker onChange={this.searchChange} getCalendarContainer={() => document.getElementById(this.state.formId)} /> + )} + </Form.Item> + </Col> + ) + } else if (item.type === 'daterange') { + let _defaultValue = [null, null] + + if (item.initval) { + try { + let _initval = JSON.parse(item.initval) + _defaultValue = [moment().subtract(_initval[0], 'days'), moment().subtract(_initval[1], 'days')] + } catch { + _defaultValue = [null, null] + } + } + + fields.push( + <Col className="daterange" span={item.ratio || 6} key={index}> + <Form.Item label={item.label}> + {getFieldDecorator(item.field, + { + initialValue: _defaultValue, + rules: [ + { + required: item.required === 'true', + message: this.props.dict['form.required.select'] + item.label + '!' + } + ] + })( + <RangePicker + placeholder={['寮�濮嬫棩鏈�', '缁撴潫鏃ユ湡']} + renderExtraFooter={() => 'extra footer'} + onChange={this.searchChange} + getCalendarContainer={() => document.getElementById(this.state.formId)} + /> + )} + </Form.Item> + </Col> + ) + } else if (item.type === 'group') { + fields.push( + <Col span={item.ratio || 6} key={index}> + <Form.Item label={item.label} className={item.required === 'true' ? 'group-required' : ''}> + <DateGroup ref={item.uuid} position={index} card={item} onGroupChange={this.searchChange} /> + </Form.Item> + </Col> + ) + } + }) + + fields.push( + <Col span={6} style={{ whiteSpace: 'nowrap' }} key="actions"> + <Form.Item label={' '} colon={false} style={{ minHeight: '40px' }}> + <Button type="primary" htmlType="submit"> + {this.props.dict['main.search']} + </Button> + <Button style={{ marginLeft: 8 }} onClick={this.handleReset}> + {this.props.dict['main.reset']} + </Button> + </Form.Item> + </Col> + ) + + return fields + } + + addHideFieldValue = (values) => { + const { searchlist } = this.state + let hideValue = {} + searchlist.forEach(item => { + if (item.Hide === 'true') { + let value = '' + + if (item.type === 'multiselect') { // 涓嬫媺澶氶�� + value = item.initval ? item.initval.split(',').filter(Boolean) : [] + } else if (item.type === 'date') { // 鏃堕棿鎼滅储 + value = item.initval ? moment().subtract(item.initval, 'days') : '' + } else if (item.type === 'datemonth') { + value = item.initval ? moment().subtract(item.initval, 'month') : '' + } else if (item.type === 'dateweek') { + value = item.initval ? moment().subtract(item.initval * 7, 'days') : '' + } else if (item.type === 'daterange') { + if (item.initval) { + try { + let _initval = JSON.parse(item.initval) + value = [moment().subtract(_initval[0], 'days'), moment().subtract(_initval[1], 'days')] + } catch { + value = '' + } + } + } else if (item.type !== 'group') { + value = item.initval + } + + hideValue[item.field] = value + } + }) + + return {...hideValue, ...values} + } + + handleSearch = (e) => { + // 鍥炶溅鎴栫偣鍑绘悳绱� + e.preventDefault() + this.props.form.validateFields((err, values) => { + if (!err) { + values = this.addHideFieldValue(values) + let searches = this.getFieldsValues(values) + this.props.refreshdata(searches) + } + }) + } + + searchChange = () => { + this.setState({}, () => { + this.props.form.validateFields((err, values) => { + if (!err) { + values = this.addHideFieldValue(values) + let searches = this.getFieldsValues(values) + this.props.refreshdata(searches) + } + }) + }) + } + + /** + * @description 鎼滅储鏉′欢閲嶇疆 + */ + handleReset = () => { + const { groups } = this.state + + if (groups.length > 0) { + groups.forEach(item => { + this.refs[item.uuid].reset() + }) + } + + let searchlist = this.state.searchlist.map(item => { + item.initval = item.oriInitval + return item + }) + + this.setState({searchlist}, () => { + this.props.form.resetFields() + this.props.form.validateFields((err, values) => { + if (!err) { + // 寮傛鑾峰彇鏇存柊鍚庣殑鏃堕棿缁� + this.setState({}, () => { + values = this.addHideFieldValue(values) + let searches = this.getFieldsValues(values) + this.props.refreshdata(searches) + }) + } + }) + }) + } + + getFieldsValues = (values) => { + const { groups } = this.state + // 鑾峰彇鎼滅储鏉′欢鍊� + let search = [] + Object.keys(values).forEach(key => { + let _value = '' + if (this.state.style[key] === 'daterange') { + if (values[key].length > 0 && values[key][0] && values[key][1]) { + _value = [moment(values[key][0]).format('YYYY-MM-DD'), moment(values[key][1]).format('YYYY-MM-DD')] + } + } else if (this.state.style[key] === 'dateweek') { + if (values[key]) { + _value = [moment(values[key]).startOf('week').format('YYYY-MM-DD'), moment(values[key]).endOf('week').format('YYYY-MM-DD')] + } + } else if (this.state.style[key] === 'date') { + if (values[key]) { + _value = moment(values[key]).format('YYYY-MM-DD') + } + } else if (this.state.style[key] === 'datemonth') { + if (values[key]) { + _value = moment(values[key]).format('YYYY-MM') + } + } else if (this.state.style[key] === 'multiselect') { + _value = values[key] || [] + + } else { + _value = (values[key] || values[key] === 0) ? values[key] : '' + + _value = _value.replace(/(^\s*|\s*$)/ig, '') + } + + search.push({ + type: this.state.style[key], + key: key.replace(/@tail@$/, ''), + value: _value, + label: this.state.label[key], + match: this.state.match[key], + required: this.state.required[key] + }) + }) + + if (groups.length > 0) { + groups.forEach(item => { + let items = this.refs[item.uuid].getSearchItems() + search.push(...items) + }) + } + + return search + } + + render() { + const formItemLayout = { + labelCol: { + xs: { span: 24 }, + sm: { span: 8 } + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 } + } + } + + return ( + <Form {...formItemLayout} className="ant-advanced-search-form top-search" id={this.state.formId} onSubmit={this.handleSearch}> + <Row gutter={24}>{this.getFields()}</Row> + </Form> + ) + } +} + +export default Form.create()(MainSearch) \ No newline at end of file diff --git a/src/tabviews/custom/tools/simpleSearch/index.scss b/src/tabviews/custom/tools/simpleSearch/index.scss new file mode 100644 index 0000000..ee84ed1 --- /dev/null +++ b/src/tabviews/custom/tools/simpleSearch/index.scss @@ -0,0 +1,41 @@ +.ant-advanced-search-form.top-search { + padding: 0px 24px 10px; + border-bottom: 1px solid #efefef; + .ant-form-item { + display: flex; + margin-bottom: 0px; + min-height: 60px; + .ant-form-explain { + white-space: nowrap; + } + } + .ant-form-item-control-wrapper { + flex: 1; + width: calc(100% - 100px); + } + .ant-form-item-label { + // width: 100px; + text-overflow: ellipsis; + } + .daterange .ant-calendar-picker-input { + padding: 4px 20px 4px 5px; + font-size: 13px; + } + .ant-select-dropdown { + z-index: 10 !important; + } + .ant-calendar-picker-container { + z-index: 10 !important; + } + .group-required { + label::before { + display: inline-block; + margin-right: 4px; + color: #f5222d; + font-size: 14px; + font-family: SimSun, sans-serif; + line-height: 1; + content: '*'; + } + } +} \ No newline at end of file diff --git a/src/tabviews/tabmanage/index.jsx b/src/tabviews/tabmanage/index.jsx index 9240441..9ee302d 100644 --- a/src/tabviews/tabmanage/index.jsx +++ b/src/tabviews/tabmanage/index.jsx @@ -538,16 +538,15 @@ {/* 瑙e喕鏍囩妯℃�佹 */} <Modal title="鏍囩瑙i櫎鍐荤粨" - okText={this.state.dict['main.confirm']} - cancelText={this.state.dict['main.cancel']} visible={this.state.thawVisible} + width={600} onOk={this.thawMenuSubmit} confirmLoading={this.state.submitloading} onCancel={() => {this.setState({thawVisible: false, thawmenulist: null})}} destroyOnClose > {!this.state.thawmenulist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} - {this.state.thawmenulist && <TransferForm ref="trawmenu" dict={this.state.dict} menulist={this.state.thawmenulist}/>} + {this.state.thawmenulist && <TransferForm ref="trawmenu" menulist={this.state.thawmenulist}/>} </Modal> </div> ) diff --git a/src/tabviews/tabmanage/transferform/index.jsx b/src/tabviews/tabmanage/transferform/index.jsx index 14b3a82..8dd7462 100644 --- a/src/tabviews/tabmanage/transferform/index.jsx +++ b/src/tabviews/tabmanage/transferform/index.jsx @@ -6,8 +6,7 @@ class TransferForm extends Component { static propTypes = { - menulist: PropTypes.array, - dict: PropTypes.object + menulist: PropTypes.array } state = { @@ -24,16 +23,13 @@ } render() { - const { dict } = this.props const { targetKeys, selectedKeys } = this.state return ( <div className="trawmenutransfer"> <Transfer dataSource={this.props.menulist} - titles={[dict['main.thawmenu.source'], dict['main.thawmenu.target']]} targetKeys={targetKeys} - locale={{itemUnit: dict['main.thawmenu.itemUnit'], itemsUnit: dict['main.thawmenu.itemsUnit']}} selectedKeys={selectedKeys} onChange={this.handleChange} onSelectChange={this.handleSelectChange} diff --git a/src/tabviews/tabmanage/transferform/index.scss b/src/tabviews/tabmanage/transferform/index.scss index 7959ddd..2e7be3b 100644 --- a/src/tabviews/tabmanage/transferform/index.scss +++ b/src/tabviews/tabmanage/transferform/index.scss @@ -1,5 +1,6 @@ .trawmenutransfer { .ant-transfer-list { - width: 210px; + width: calc(50% - 20px); + height: 250px; } } \ No newline at end of file diff --git a/src/tabviews/zshare/mutilform/index.jsx b/src/tabviews/zshare/mutilform/index.jsx index 08a4407..ac9f76c 100644 --- a/src/tabviews/zshare/mutilform/index.jsx +++ b/src/tabviews/zshare/mutilform/index.jsx @@ -30,6 +30,7 @@ datatype: null, // 鏁版嵁绫诲瀷 readtype: null, // 鏄惁鍙 readin: null, // 琛屾暟鎹槸鍚﹀啓鍏� + writein: null, // 鎵ц鏃舵槸鍚﹀~鍏ラ粯璁ql fieldlen: null, // 瀛楁闀垮害 formlist: [], // 琛ㄥ崟椤� encrypts: [], // 鍔犲瘑瀛楁 @@ -58,6 +59,7 @@ let datatype = {} let readtype = {} let readin = {} + let writein = {} let fieldlen = {} let formlist = [] let encrypts = [] @@ -96,7 +98,7 @@ intercepts.push(item.field) } - // 鏁版嵁鍐欏叆 + // 鏁版嵁鑷姩濉厖 let _readin = item.readin !== 'false' if (item.type === 'linkMain' || item.type === 'funcvar') { _readin = false @@ -115,6 +117,7 @@ datatype[item.field] = item.type readtype[item.field] = item.readonly === 'true' readin[item.field] = _readin + writein[item.field] = item.writein !== 'false' fieldlen[item.field] = _fieldlen if (item.type === 'select' || item.type === 'link' || item.type === 'multiselect') { @@ -239,6 +242,7 @@ readtype: readtype, datatype: datatype, readin: readin, + writein: writein, fieldlen: fieldlen, encrypts: encrypts, intercepts: intercepts, @@ -935,7 +939,7 @@ } handleConfirm = () => { - const { record, intercepts } = this.state + const { record, intercepts, writein } = this.state let _encrypts = fromJS(this.state.encrypts).toJS() let _format = { date: 'YYYY-MM-DD', @@ -958,6 +962,7 @@ type: 'funcvar', readonly: 'true', readin: false, + writein: writein[item.field], fieldlen: this.state.fieldlen[item.field], key: item.field, value: '' @@ -973,6 +978,7 @@ type: this.state.datatype[item.field], readonly: this.state.readtype[item.field], readin: this.state.readin[item.field], + writein: writein[item.field], fieldlen: this.state.fieldlen[item.field], key: item.field, value: _val @@ -982,6 +988,7 @@ type: this.state.datatype[item.field], readonly: this.state.readtype[item.field], readin: this.state.readin[item.field], + writein: writein[item.field], fieldlen: this.state.fieldlen[item.field], key: item.field, value: item.initval @@ -1008,6 +1015,7 @@ type: this.state.datatype[key], readonly: this.state.readtype[key], readin: this.state.readin[key], + writein: writein[key], fieldlen: this.state.fieldlen[key], key: key, value: '' @@ -1058,6 +1066,7 @@ type: this.state.datatype[key], readonly: this.state.readtype[key], readin: this.state.readin[key], + writein: writein[key], fieldlen: this.state.fieldlen[key], key: key, value: _value diff --git a/src/tabviews/zshare/normalTable/index.jsx b/src/tabviews/zshare/normalTable/index.jsx index 5eb8327..d5b303d 100644 --- a/src/tabviews/zshare/normalTable/index.jsx +++ b/src/tabviews/zshare/normalTable/index.jsx @@ -512,11 +512,8 @@ let contents = [] let images = [] - item.subColumn.forEach((col, index) => { + item.subColumn.forEach(col => { if (!col.field || !record.hasOwnProperty(col.field)) return - if (index) { - col.Align = 'right' - } if (col.type === 'number') { let content = '' diff --git a/src/templates/calendarconfig/calcomponent/index.jsx b/src/templates/calendarconfig/calcomponent/index.jsx index c23c868..935fa1d 100644 --- a/src/templates/calendarconfig/calcomponent/index.jsx +++ b/src/templates/calendarconfig/calcomponent/index.jsx @@ -78,8 +78,6 @@ width={700} maskClosable={false} onCancel={() => { this.setState({ visible: false })}} - cancelText={this.state.dict['model.cancel']} - okText={this.state.dict['model.confirm']} onOk={this.calendarSave} destroyOnClose > diff --git a/src/templates/calendarconfig/index.jsx b/src/templates/calendarconfig/index.jsx index 46db80f..8b0a6d8 100644 --- a/src/templates/calendarconfig/index.jsx +++ b/src/templates/calendarconfig/index.jsx @@ -505,8 +505,6 @@ if (config.isAdd) { confirm({ content: '鑿滃崟灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�', - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { _this.props.handleView() }, diff --git a/src/templates/calendarconfig/tabcomponent/index.jsx b/src/templates/calendarconfig/tabcomponent/index.jsx index 0f0a1f9..700b5d4 100644 --- a/src/templates/calendarconfig/tabcomponent/index.jsx +++ b/src/templates/calendarconfig/tabcomponent/index.jsx @@ -73,8 +73,6 @@ confirm({ content: '纭畾鍒犻櫎鏍囩鍚楋紵', - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { _this.props.updateConfig({...config, tab: ''}) }, @@ -101,8 +99,6 @@ width={900} maskClosable={false} onCancel={() => { this.setState({ visible: false })}} - cancelText={this.state.dict['model.cancel']} - okText={this.state.dict['model.confirm']} onOk={this.tabSave} destroyOnClose > diff --git a/src/templates/comtableconfig/index.jsx b/src/templates/comtableconfig/index.jsx index 6d3530e..2601a67 100644 --- a/src/templates/comtableconfig/index.jsx +++ b/src/templates/comtableconfig/index.jsx @@ -927,8 +927,6 @@ if (config.isAdd) { confirm({ content: '鑿滃崟灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�', - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { _this.props.handleView() }, diff --git a/src/templates/formtabconfig/groupform/index.jsx b/src/templates/formtabconfig/groupform/index.jsx index 4689d8e..821b0cc 100644 --- a/src/templates/formtabconfig/groupform/index.jsx +++ b/src/templates/formtabconfig/groupform/index.jsx @@ -119,7 +119,7 @@ </Form.Item> </Col> {!group.isDefault ? <Col span={24}> - <TransferForm dict={this.props.dict} fields={this.state.source} ref="fields-transfer" selected={this.state.selectds}/> + <TransferForm fields={this.state.source} ref="fields-transfer" selected={this.state.selectds}/> </Col> : null} </Row> </Form> diff --git a/src/templates/formtabconfig/index.jsx b/src/templates/formtabconfig/index.jsx index 032994c..306bfb7 100644 --- a/src/templates/formtabconfig/index.jsx +++ b/src/templates/formtabconfig/index.jsx @@ -833,8 +833,6 @@ let _this = this confirm({ content: `纭畾鍒犻櫎<<${element.card.label}>>鍚楋紵`, - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { let _config = JSON.parse(JSON.stringify(_this.state.config)) let _delActions = _this.state.delActions @@ -1292,8 +1290,6 @@ if (config.isAdd) { confirm({ content: '鎸夐挳閰嶇疆灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�', - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { _this.handleViewBack() }, @@ -1739,8 +1735,6 @@ confirm({ content: `纭畾鍒犻櫎鍒嗙粍<<${group.label}>>鍚楋紵`, - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { let groups = config.groups.filter(item => !(item.uuid === group.uuid)) groups = groups.map(item => { diff --git a/src/templates/formtabconfig/transferform/index.jsx b/src/templates/formtabconfig/transferform/index.jsx index 7f15de8..3ff7f65 100644 --- a/src/templates/formtabconfig/transferform/index.jsx +++ b/src/templates/formtabconfig/transferform/index.jsx @@ -6,8 +6,7 @@ class TransferForm extends Component { static propTypes = { fields: PropTypes.array, - selected: PropTypes.array, - dict: PropTypes.object, // 瀛楀吀椤� + selected: PropTypes.array } state = { @@ -59,9 +58,7 @@ <div className="modal-fields-transfer"> <Transfer dataSource={data} - titles={[this.props.dict['header.form.column.source'], this.props.dict['header.form.column.target']]} targetKeys={targetKeys} - locale={{itemUnit: this.props.dict['header.form.column.itemUnit'], itemsUnit: this.props.dict['header.form.column.itemsUnit']}} selectedKeys={selectedKeys} onChange={this.handleChange} onSelectChange={this.handleSelectChange} diff --git a/src/templates/headerconfig/dragelement/card.jsx b/src/templates/headerconfig/dragelement/card.jsx index 0f0aa3e..951f711 100644 --- a/src/templates/headerconfig/dragelement/card.jsx +++ b/src/templates/headerconfig/dragelement/card.jsx @@ -1,10 +1,10 @@ import React from 'react' import { useDrag, useDrop } from 'react-dnd' -import { Icon } from 'antd' +import { Icon, Popover } from 'antd' import ItemTypes from './itemtypes' import './index.scss' -const Card = ({ id, text, moveCard, findCard, editCard }) => { +const Card = ({ id, text, moveCard, findCard, editCard, delCard }) => { const originalIndex = findCard(id).index const [{ isDragging }, drag] = useDrag({ item: { type: ItemTypes.CARD, id, originalIndex }, @@ -27,13 +27,24 @@ const edit = () => { editCard(id) } + + const del = () => { + delCard(id) + } + return ( - <div className="card" style={{ opacity }}> - <div ref={node => drag(drop(node))}> - {text} + <Popover overlayClassName="mk-popover-control-wrap header-menu" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control"> + <Icon className="edit" type="edit" onClick={edit} /> + <Icon className="close" type="close" onClick={del} /> </div> - <Icon className="edit" type="edit" onClick={edit} /> - </div> + } trigger="hover"> + <div className="card" style={{ opacity }}> + <div ref={node => drag(drop(node))}> + {text} + </div> + </div> + </Popover> ) } export default Card diff --git a/src/templates/headerconfig/dragelement/index.jsx b/src/templates/headerconfig/dragelement/index.jsx index 8100ebe..365437c 100644 --- a/src/templates/headerconfig/dragelement/index.jsx +++ b/src/templates/headerconfig/dragelement/index.jsx @@ -6,7 +6,7 @@ import ItemTypes from './itemtypes' import './index.scss' -const Container = ({dict, list, handlePreviewList, handleMenu, handleButton }) => { +const Container = ({dict, list, handlePreviewList, handleMenu, deleteMemu, handleButton }) => { const [cards, setCards] = useState(list) const moveCard = (id, atIndex) => { const { card, index } = findCard(id) @@ -30,6 +30,11 @@ index, type: 'edit' }) + } + + const delCard = id => { + const { card } = findCard(id) + deleteMemu(card) } const add = () => { @@ -58,6 +63,7 @@ text={card.text} moveCard={moveCard} editCard={editCard} + delCard={delCard} findCard={findCard} /> ))} diff --git a/src/templates/headerconfig/dragelement/index.scss b/src/templates/headerconfig/dragelement/index.scss index 19aad3e..aceb422 100644 --- a/src/templates/headerconfig/dragelement/index.scss +++ b/src/templates/headerconfig/dragelement/index.scss @@ -24,44 +24,31 @@ .btn-group { display: inline-block; } -} -.card { - position: relative; - border: 1px dashed gray; - margin-top: 7px; - margin-right: 10px; - float: left; - div { - padding: 5px 20px 5px 5px; - cursor: move; - min-width: 43px; - max-width: 85px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } - .close { - position: absolute; - right: 0; - top: 0; - cursor: pointer; - :hover { - color: #ffffff; - } - } - .edit { - display: none; - position: absolute; - right: 0; - bottom: 0; - cursor: pointer; - :hover { - color: #ffffff; + .card { + position: relative; + border: 1px dashed gray; + margin-top: 8px; + margin-right: 5px; + float: left; + div { + padding: 3px 6px; + font-size: 16px; + cursor: move; + min-width: 43px; + max-width: 85px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } } } -.card:hover { - .edit { - display: inline-block; + +.mk-popover-control-wrap.header-menu { + .ant-popover-content { + position: relative; + top: -8px; + .ant-popover-arrow { + top: -3.8px!important; + } } } diff --git a/src/templates/headerconfig/index.jsx b/src/templates/headerconfig/index.jsx index baa7b2c..95e19f8 100644 --- a/src/templates/headerconfig/index.jsx +++ b/src/templates/headerconfig/index.jsx @@ -3,7 +3,7 @@ import { is, fromJS } from 'immutable' import { DndProvider } from 'react-dnd' import HTML5Backend from 'react-dnd-html5-backend' -import { notification, Modal, Button, Spin } from 'antd' +import { notification, Modal, Spin } from 'antd' import moment from 'moment' import TransferForm from '@/templates/zshare/basetransferform' @@ -138,24 +138,18 @@ }) } - deleteMemu = () => { + deleteMemu = (item) => { let _this = this confirm({ - title: this.state.dict['model.menu.close'].replace('@M', this.state.editMenu.MenuName), + title: this.state.dict['model.menu.close'].replace('@M', item.MenuName), content: '', - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { let param = { func: 'sPC_MainMenu_Del', - MenuID: _this.state.editMenu.MenuID + MenuID: item.MenuID } return Api.getSystemConfig(param).then(res => { if (res.status) { - _this.setState({ - editMvisible: false, - editMenu: null, - }) _this.props.reload() } else { notification.warning({ @@ -253,8 +247,6 @@ confirm({ title: this.state.dict['model.menu.resetorder'], content: '', - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { return Api.getSystemConfig(param).then(res => { if (res.status) { @@ -342,14 +334,13 @@ list={this.props.menulist} handlePreviewList={this.handlePreviewList} handleMenu={this.editMenuModal} + deleteMemu={this.deleteMemu} handleButton={this.handleButton} /> </DndProvider>} {/* 鏂板缓鑿滃崟妯℃�佹 */} <Modal title={dict['model.add'] + dict['model.menu']} - okText={dict['model.confirm']} - cancelText={dict['model.cancel']} visible={this.state.addMvisible} onOk={this.addMemuSubmit} confirmLoading={this.state.confirmLoading} @@ -366,26 +357,22 @@ {/* 瑙i櫎鍐荤粨鑿滃崟妯℃�佹 */} <Modal title={dict['model.thaw'] + dict['model.menu']} - okText={dict['model.confirm']} - cancelText={dict['model.cancel']} visible={this.state.thawMvisible} + width={600} onOk={this.thawMemuSubmit} confirmLoading={this.state.confirmLoading} onCancel={this.thawMemuCancel} destroyOnClose > {!this.state.thawmenulist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} - {this.state.thawmenulist && <TransferForm ref="trawmenu" dict={dict} menulist={this.state.thawmenulist}/>} + {this.state.thawmenulist && <TransferForm ref="trawmenu" menulist={this.state.thawmenulist}/>} </Modal> {/* 缂栬緫鑿滃崟妯℃�佹 */} <Modal title={dict['model.edit'] + dict['model.menu']} visible={this.state.editMvisible} - footer={[ - <Button key="cancel" onClick={this.editMemuCancel}>{dict['model.cancel']}</Button>, - <Button key="confirm" type="primary" onClick={this.editMemuSubmit} loading={this.state.confirmLoading}>{dict['model.confirm']}</Button>, - <Button key="delete" type="danger" onClick={this.deleteMemu}>{dict['model.delete']}</Button> - ]} + onOk={this.editMemuSubmit} + confirmLoading={this.state.confirmLoading} onCancel={this.editMemuCancel} destroyOnClose > diff --git a/src/templates/menuconfig/editsecmenu/index.jsx b/src/templates/menuconfig/editsecmenu/index.jsx index ab01748..a0af72a 100644 --- a/src/templates/menuconfig/editsecmenu/index.jsx +++ b/src/templates/menuconfig/editsecmenu/index.jsx @@ -65,8 +65,6 @@ confirm({ title: dict['model.menu.close'].replace('@M', menu.card.text), content: '', - okText: dict['model.confirm'], - cancelText: dict['model.cancel'], onOk() { let param = { func: 'sPC_MainMenu_Del', @@ -214,8 +212,6 @@ confirm({ title: this.state.dict['model.menu.resetorder'], content: '', - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { return Api.getSystemConfig(param).then(res => { if (res.status) { @@ -427,8 +423,6 @@ </div> <Modal title={this.state.title} - okText={dict['model.confirm']} - cancelText={dict['model.cancel']} visible={this.state.visible} onOk={this.memuHandleSubmit} confirmLoading={this.state.confirmLoading} @@ -443,15 +437,14 @@ </Modal> <Modal title={dict['model.thaw'] + dict['model.menu']} - okText={dict['model.confirm']} - cancelText={dict['model.cancel']} + width={600} visible={this.state.thawMvisible} onOk={this.thawMemuSubmit} confirmLoading={this.state.confirmLoading} onCancel={this.thawMemuCancel} > {!this.state.thawmenulist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} - {this.state.thawmenulist && <TransferForm ref="trawmenu" dict={dict} menulist={this.state.thawmenulist}/>} + {this.state.thawmenulist && <TransferForm ref="trawmenu" menulist={this.state.thawmenulist}/>} </Modal> </div> ) diff --git a/src/templates/menuconfig/editthdmenu/index.jsx b/src/templates/menuconfig/editthdmenu/index.jsx index 5bafb55..68924a5 100644 --- a/src/templates/menuconfig/editthdmenu/index.jsx +++ b/src/templates/menuconfig/editthdmenu/index.jsx @@ -109,8 +109,6 @@ confirm({ title: this.state.dict['model.menu.close'].replace('@M', menu.card.text), content: '', - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { let param = { func: 'sPC_MainMenu_Del', @@ -332,8 +330,6 @@ confirm({ title: this.state.dict['model.menu.resetorder'], content: '', - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { return Api.getSystemConfig(param).then(res => { if (res.status) { @@ -931,8 +927,7 @@ {/* 瑙e喕鑿滃崟妯℃�佹 */} <Modal title={dict['model.thaw'] + dict['model.menu']} - okText={dict['model.confirm']} - cancelText={dict['model.cancel']} + width={600} visible={this.state.thawMvisible} onOk={this.thawMemuSubmit} confirmLoading={this.state.confirmLoading} @@ -940,13 +935,11 @@ destroyOnClose > {!this.state.thawmenulist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} - {this.state.thawmenulist && <TransferForm ref="trawmenu" dict={dict} menulist={this.state.thawmenulist}/>} + {this.state.thawmenulist && <TransferForm ref="trawmenu" menulist={this.state.thawmenulist}/>} </Modal> {/* 娣诲姞绯荤粺鑿滃崟 */} <Modal title={this.state.sysMenu && this.state.sysMenu.isSystem ? dict['model.add'] + dict['model.menu'] : dict['model.update'] + dict['model.menu']} - okText={dict['model.confirm']} - cancelText={dict['model.cancel']} visible={this.state.handleMVisible} onOk={this.memuSubmit} confirmLoading={this.state.confirmLoading} diff --git a/src/templates/modalconfig/groupform/index.jsx b/src/templates/modalconfig/groupform/index.jsx index 426ba3c..77863ce 100644 --- a/src/templates/modalconfig/groupform/index.jsx +++ b/src/templates/modalconfig/groupform/index.jsx @@ -124,7 +124,7 @@ </Form.Item> </Col> <Col span={24}> - <TransferForm dict={this.props.dict} fields={this.state.source} ref="fields-transfer" selected={this.state.selectds}/> + <TransferForm fields={this.state.source} ref="fields-transfer" selected={this.state.selectds}/> </Col> </Row> </Form> diff --git a/src/templates/modalconfig/index.jsx b/src/templates/modalconfig/index.jsx index e6e7173..f9eabbf 100644 --- a/src/templates/modalconfig/index.jsx +++ b/src/templates/modalconfig/index.jsx @@ -698,8 +698,6 @@ confirm({ content: `纭畾鍒犻櫎<<${card.label}>>鍚楋紵`, - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { let _config = JSON.parse(JSON.stringify(_this.state.config)) @@ -808,8 +806,6 @@ if (isOrigin) { confirm({ content: '灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�', - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { _this.handleViewBack() }, @@ -1124,8 +1120,6 @@ confirm({ content: `纭畾鍒犻櫎鍒嗙粍<<${group.label}>>鍚楋紵`, - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { let _config = JSON.parse(JSON.stringify(_this.state.config)) _config.groups = _config.groups.filter(item => !(item.uuid === group.uuid)) diff --git a/src/templates/modalconfig/transferform/index.jsx b/src/templates/modalconfig/transferform/index.jsx index 7f15de8..3ff7f65 100644 --- a/src/templates/modalconfig/transferform/index.jsx +++ b/src/templates/modalconfig/transferform/index.jsx @@ -6,8 +6,7 @@ class TransferForm extends Component { static propTypes = { fields: PropTypes.array, - selected: PropTypes.array, - dict: PropTypes.object, // 瀛楀吀椤� + selected: PropTypes.array } state = { @@ -59,9 +58,7 @@ <div className="modal-fields-transfer"> <Transfer dataSource={data} - titles={[this.props.dict['header.form.column.source'], this.props.dict['header.form.column.target']]} targetKeys={targetKeys} - locale={{itemUnit: this.props.dict['header.form.column.itemUnit'], itemsUnit: this.props.dict['header.form.column.itemsUnit']}} selectedKeys={selectedKeys} onChange={this.handleChange} onSelectChange={this.handleSelectChange} diff --git a/src/templates/sharecomponent/actioncomponent/index.jsx b/src/templates/sharecomponent/actioncomponent/index.jsx index e2d16bb..32319d3 100644 --- a/src/templates/sharecomponent/actioncomponent/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/index.jsx @@ -605,8 +605,6 @@ confirm({ content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋, - okText: dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { let _actionlist = fromJS(_this.state.actionlist).toJS() diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx index b511cc1..2103682 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelin/index.jsx @@ -83,9 +83,8 @@ <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'columns', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'columns', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'columns') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -141,9 +140,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'unique', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'unique')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'unique') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -206,9 +204,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'scripts', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'scripts') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -375,8 +372,6 @@ confirm({ content: `纭畾娓呯┖Excel鍒楀悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { _this.setState({ verify: { @@ -637,8 +632,6 @@ if (_loading) { confirm({ content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氭彁浜ゅ悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { resolve(_verify) }, diff --git a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx index a2fd460..68a3a63 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyexcelout/index.jsx @@ -51,9 +51,8 @@ <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'columns', 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'columns', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'columns') }> <span style={{color: '#ff4d4f', cursor: 'pointer'}}><Icon type="delete" /></span> @@ -416,8 +415,6 @@ confirm({ content: `纭畾娓呯┖Excel鍒楀悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { _this.setState({ verify: { diff --git a/src/templates/sharecomponent/actioncomponent/verifyprint/editable/index.jsx b/src/templates/sharecomponent/actioncomponent/verifyprint/editable/index.jsx index cafd233..e014257 100644 --- a/src/templates/sharecomponent/actioncomponent/verifyprint/editable/index.jsx +++ b/src/templates/sharecomponent/actioncomponent/verifyprint/editable/index.jsx @@ -117,9 +117,8 @@ <span className="operation-btn" title={props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={props.dict['header.form.query.delete']} - okText={props.dict['model.confirm']} - cancelText={props.dict['model.cancel']} onConfirm={() => this.handleDelete(record.key) }> <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> diff --git a/src/templates/sharecomponent/cardcomponent/dragdetail/card.jsx b/src/templates/sharecomponent/cardcomponent/dragdetail/card.jsx index 0129e9b..db22571 100644 --- a/src/templates/sharecomponent/cardcomponent/dragdetail/card.jsx +++ b/src/templates/sharecomponent/cardcomponent/dragdetail/card.jsx @@ -1,6 +1,6 @@ import React from 'react' import { useDrag, useDrop } from 'react-dnd' -import { Icon } from 'antd' +import { Icon, Popover } from 'antd' import './index.scss' const Card = ({ id, card, moveCard, findCard, editCard, delCard }) => { @@ -28,11 +28,16 @@ }) return ( - <div ref={node => drag(drop(node))} className={'mk-card-meta-item ' + card.align} style={{opacity: opacity, width: card.width + '%'}}> - <div className={'content line' + card.height} style={{fontWeight: card.fontWeight, fontSize: card.fontSize + 'px', height: card.height * card.fontSize * 1.5}} title={card.content}>{card.content}</div> - <Icon className="edit" title="缂栬緫" type="edit" onClick={() => editCard(card)} /> - <Icon className="edit close" title="鍒犻櫎" type="close" onClick={() => delCard(card)} /> - </div> + <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control"> + <Icon className="edit" title="缂栬緫" type="edit" onClick={() => editCard(card)} /> + <Icon className="edit close" title="鍒犻櫎" type="close" onClick={() => delCard(card)} /> + </div> + } trigger="hover"> + <div ref={node => drag(drop(node))} className={'mk-card-meta-item ' + card.align} style={{opacity: opacity, width: card.width + '%'}}> + <div className={'content line' + card.height} style={{fontWeight: card.fontWeight, fontSize: card.fontSize + 'px', height: card.height * card.fontSize * 1.5}} title={card.content}>{card.content}</div> + </div> + </Popover> ) } export default Card diff --git a/src/templates/sharecomponent/cardcomponent/dragdetail/index.scss b/src/templates/sharecomponent/cardcomponent/dragdetail/index.scss index 72378f3..39bd514 100644 --- a/src/templates/sharecomponent/cardcomponent/dragdetail/index.scss +++ b/src/templates/sharecomponent/cardcomponent/dragdetail/index.scss @@ -9,7 +9,7 @@ vertical-align: top; font-size: 14px; margin-bottom: 2px; - + transition: box-shadow 0.2s; .content.line1 { overflow: hidden; @@ -60,22 +60,7 @@ text-align: right; } - .edit { - position: absolute; - left: 0; - top: -10px; - font-size: 13px; - color: #1890ff; - cursor: pointer; - display: none; - padding: 0 5px; - } - .edit.close { - left: 20px; - color: #ff4d4f; - } - - .mk-card-meta-item:hover .edit { - display: inline-block; + .mk-card-meta-item:hover, .mk-card-meta-item.ant-popover-open { + box-shadow: 0px 0px 1px #1890ff; } } \ No newline at end of file diff --git a/src/templates/sharecomponent/cardcomponent/index.jsx b/src/templates/sharecomponent/cardcomponent/index.jsx index 350c9f5..eb6002a 100644 --- a/src/templates/sharecomponent/cardcomponent/index.jsx +++ b/src/templates/sharecomponent/cardcomponent/index.jsx @@ -1,7 +1,7 @@ import React, {Component} from 'react' import PropTypes from 'prop-types' import { is, fromJS } from 'immutable' -import { Icon, Modal } from 'antd' +import { Icon, Modal, Popover } from 'antd' import Utils from '@/utils/utils.js' import zhCN from '@/locales/zh-CN/model.js' @@ -81,7 +81,7 @@ } } - let _columns = config.columns.filter(col => ['text', 'number', 'link'].includes(col.type)) + let _columns = config.columns.filter(col => ['text', 'number', 'link', 'textarea'].includes(col.type)) _columns = _columns.map(col => { return { uuid: col.uuid, @@ -277,8 +277,6 @@ confirm({ content: dict['model.confirm'] + dict['model.delete'] + ` - ${cell.content} 锛焋, - okText: dict['model.confirm'], - cancelText: dict['model.cancel'], onOk() { let _details = fromJS(card.details).toJS() @@ -296,8 +294,6 @@ confirm({ content: dict['model.confirm'] + dict['model.delete'] + '锛�', - okText: dict['model.confirm'], - cancelText: dict['model.cancel'], onOk() { let _subelement = fromJS(_this.props.card.subelement).toJS() _subelement = _subelement.filter(_type => _type !== type) @@ -385,34 +381,44 @@ style={card.widthType === 'absolute' ? { width: card.cardWidth } : null} > {card.subelement.includes('header') ? - <div className="ant-card-head"> - <Icon className="edit" title="Edit" type="edit" onClick={this.editHeader} /> - <Icon className="edit close" title="close" type="close" onClick={() => this.deleteElem('header')} /> - <div className="ant-card-head-wrapper"> - <div className="ant-card-head-title">{card.header.content}</div> - {card.header.actions && card.header.actions.length > 0 ? - <div className="ant-card-extra"> - <span> - {['icon', 'all'].includes(card.header.show) ? <Icon type={card.header.actions[0].icon || 'dash'}/> : null} - {['text', 'all'].includes(card.header.show) ? card.header.actions[0].text : null} - </span> - </div> : null - } + <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control"> + <Icon className="edit" title="Edit" type="edit" onClick={this.editHeader} /> + <Icon className="close" title="close" type="close" onClick={() => this.deleteElem('header')} /> </div> - </div> : null + } trigger="hover"> + <div className="ant-card-head"> + <div className="ant-card-head-wrapper"> + <div className="ant-card-head-title">{card.header.content}</div> + {card.header.actions && card.header.actions.length > 0 ? + <div className="ant-card-extra"> + <span> + {['icon', 'all'].includes(card.header.show) ? <Icon type={card.header.actions[0].icon || 'dash'}/> : null} + {['text', 'all'].includes(card.header.show) ? card.header.actions[0].text : null} + </span> + </div> : null + } + </div> + </div> + </Popover> : null } <div className="ant-card-body"> <div className="ant-card-meta" style={metastyle}> <Icon type="plus" onClick={() => this.editdetail()} /> {card.subelement.includes('avatar') ? - <div className="ant-card-meta-avatar" style={{width: card.avatar.avatarWidth || 32, paddingTop: card.avatar.avatarWidth || 32}}> - <Icon className="edit" title="Edit" type="edit" onClick={this.editAvatar} /> - <Icon className="edit close" title="close" type="close" onClick={() => this.deleteElem('avatar')} /> - <span className="ant-avatar ant-avatar-circle ant-avatar-image" style={{borderRadius: card.avatar.radius === 'true' ? '50%' : 0}}> - {card.avatar.type === 'picture' ? <img src={avatar} alt=""/> : null} - {card.avatar.type === 'icon' ? <Icon className={'font ' + card.avatar.color} style={{fontSize: card.avatar.size + 'px'}} type={card.avatar.icon} /> : null} - </span> - </div> : null + <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control"> + <Icon className="edit" title="Edit" type="edit" onClick={this.editAvatar} /> + <Icon className="close" title="close" type="close" onClick={() => this.deleteElem('avatar')} /> + </div> + } trigger="hover"> + <div className="ant-card-meta-avatar" style={{width: card.avatar.avatarWidth || 32, paddingTop: card.avatar.avatarWidth || 32}}> + <span className="ant-avatar ant-avatar-circle ant-avatar-image" style={{borderRadius: card.avatar.radius === 'true' ? '50%' : 0}}> + {card.avatar.type === 'picture' ? <img src={avatar} alt=""/> : null} + {card.avatar.type === 'icon' ? <Icon className={'font ' + card.avatar.color} style={{fontSize: card.avatar.size + 'px'}} type={card.avatar.icon} /> : null} + </span> + </div> + </Popover> : null } <div className="ant-card-meta-detail" style={metastyle.display ? {flex: 1} : null}> <DragDetail @@ -425,16 +431,21 @@ </div> </div> {card.subelement.includes('bottom') ? - <ul className="ant-card-actions"> - <Icon className="edit" title="Edit" type="edit" onClick={this.editBottom} /> - <Icon className="edit close" title="close" type="close" onClick={() => this.deleteElem('bottom')} /> - {card.bottom.actions.map((item, i) => (<li key={i} style={{width: _width}}> - <span> - {['icon', 'all'].includes(card.bottom.show) ? <Icon type={item.icon || 'dash'}/> : null} - {['text', 'all'].includes(card.bottom.show) ? item.text : null} - </span> - </li>))} - </ul> : null + <Popover overlayClassName="mk-popover-control-wrap" mouseLeaveDelay={0.2} mouseEnterDelay={0.2} content={ + <div className="mk-popover-control"> + <Icon className="edit" title="Edit" type="edit" onClick={this.editBottom} /> + <Icon className="close" title="close" type="close" onClick={() => this.deleteElem('bottom')} /> + </div> + } trigger="hover"> + <ul className="ant-card-actions"> + {card.bottom.actions.map((item, i) => (<li key={i} style={{width: _width}}> + <span> + {['icon', 'all'].includes(card.bottom.show) ? <Icon type={item.icon || 'dash'}/> : null} + {['text', 'all'].includes(card.bottom.show) ? item.text : null} + </span> + </li>))} + </ul> + </Popover> : null } </div> {card.extraAction ? diff --git a/src/templates/sharecomponent/chartgroupcomponent/index.jsx b/src/templates/sharecomponent/chartgroupcomponent/index.jsx index 58fae66..647e706 100644 --- a/src/templates/sharecomponent/chartgroupcomponent/index.jsx +++ b/src/templates/sharecomponent/chartgroupcomponent/index.jsx @@ -211,8 +211,6 @@ confirm({ content: dict['model.confirm'] + dict['model.delete'] + ` ${plot.title} 锛焋, - okText: dict['model.confirm'], - cancelText: dict['model.cancel'], onOk() { let _chartlist = fromJS(_this.state.chartlist).toJS() let _chartview = _this.state.chartview diff --git a/src/templates/sharecomponent/columncomponent/colspanform/index.jsx b/src/templates/sharecomponent/columncomponent/colspanform/index.jsx index 2fdbe29..2364967 100644 --- a/src/templates/sharecomponent/columncomponent/colspanform/index.jsx +++ b/src/templates/sharecomponent/columncomponent/colspanform/index.jsx @@ -182,7 +182,7 @@ </Form.Item> </Col> <Col span={24}> - <TransferForm dict={this.props.dict} columns={this.props.columns} ref="column-transfer" selected={this.props.card.sublist}/> + <TransferForm columns={this.props.columns} ref="column-transfer" selected={this.props.card.sublist}/> </Col> </Row> </Form> diff --git a/src/templates/sharecomponent/columncomponent/index.jsx b/src/templates/sharecomponent/columncomponent/index.jsx index 471e6b1..30538c5 100644 --- a/src/templates/sharecomponent/columncomponent/index.jsx +++ b/src/templates/sharecomponent/columncomponent/index.jsx @@ -355,8 +355,6 @@ confirm({ content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋, - okText: dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { let _columnlist = fromJS(_this.state.columnlist).toJS() @@ -578,7 +576,7 @@ </Modal> {/* 鍚堝苟鍒楃紪杈� */} <Modal - title={dict['model.modal.colspan'] + '-' + dict['model.edit']} + title={dict['model.form.colspan'] + '-' + dict['model.edit']} visible={modaltype === 'colspan'} width={800} maskClosable={false} diff --git a/src/templates/sharecomponent/columncomponent/markcolumn/index.jsx b/src/templates/sharecomponent/columncomponent/markcolumn/index.jsx index 9ad2c68..e3aa138 100644 --- a/src/templates/sharecomponent/columncomponent/markcolumn/index.jsx +++ b/src/templates/sharecomponent/columncomponent/markcolumn/index.jsx @@ -117,9 +117,8 @@ <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> diff --git a/src/templates/sharecomponent/datasourcecomponent/index.jsx b/src/templates/sharecomponent/datasourcecomponent/index.jsx index 4c285ae..a5baeb0 100644 --- a/src/templates/sharecomponent/datasourcecomponent/index.jsx +++ b/src/templates/sharecomponent/datasourcecomponent/index.jsx @@ -69,7 +69,6 @@ maskClosable={false} style={{minWidth: '900px', maxWidth: '1200px'}} okText={dict['model.submit']} - cancelText={dict['model.cancel']} onOk={this.verifySubmit} confirmLoading={loading} onCancel={() => { this.setState({ visible: false }) }} diff --git a/src/templates/sharecomponent/datasourcecomponent/verifycard/index.jsx b/src/templates/sharecomponent/datasourcecomponent/verifycard/index.jsx index 3e6abed..821bf0d 100644 --- a/src/templates/sharecomponent/datasourcecomponent/verifycard/index.jsx +++ b/src/templates/sharecomponent/datasourcecomponent/verifycard/index.jsx @@ -65,9 +65,8 @@ (<div> <span className="operation-btn" title={this.props.dict['model.edit']} onClick={() => this.handleEdit(record, 'columns')} style={{color: '#1890ff'}}><Icon type="edit" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['model.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.deleteColumn(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -114,9 +113,8 @@ <span className="operation-btn" onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['model.status.change']} onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['model.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.deleteScript(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> diff --git a/src/templates/sharecomponent/fieldscomponent/index.jsx b/src/templates/sharecomponent/fieldscomponent/index.jsx index b6f937b..d96efa9 100644 --- a/src/templates/sharecomponent/fieldscomponent/index.jsx +++ b/src/templates/sharecomponent/fieldscomponent/index.jsx @@ -187,6 +187,12 @@ Width: 120 } + if (item.type === 'number') { + newcard.decimal = item.decimal + } else { + newcard.fieldlength = item.length || 50 + } + items.push(newcard) } }) diff --git a/src/templates/sharecomponent/searchcomponent/index.jsx b/src/templates/sharecomponent/searchcomponent/index.jsx index d8855cd..2414c91 100644 --- a/src/templates/sharecomponent/searchcomponent/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/index.jsx @@ -257,8 +257,6 @@ confirm({ content: dict['model.confirm'] + dict['model.delete'] + ` - ${card.label} 锛焋, - okText: dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { let _searchlist = fromJS(_this.state.searchlist).toJS() diff --git a/src/templates/sharecomponent/searchcomponent/searcheditable/index.jsx b/src/templates/sharecomponent/searchcomponent/searcheditable/index.jsx index 4a560c4..bf2b160 100644 --- a/src/templates/sharecomponent/searchcomponent/searcheditable/index.jsx +++ b/src/templates/sharecomponent/searchcomponent/searcheditable/index.jsx @@ -116,9 +116,8 @@ <span className="operation-btn" title={props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={props.dict['header.form.query.delete']} - okText={props.dict['model.confirm']} - cancelText={props.dict['model.cancel']} onConfirm={() => this.handleDelete(record.key) }> <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> @@ -227,9 +226,8 @@ <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record.key) }> <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> diff --git a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx index 177bd92..3c8e2e3 100644 --- a/src/templates/sharecomponent/settingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/settingcomponent/settingform/index.jsx @@ -76,9 +76,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -306,8 +305,6 @@ if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { confirm({ content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氭彁浜ゅ悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { _this.sqlverify(_setting, resolve, reject) }, @@ -559,8 +556,6 @@ if (_loading) { confirm({ content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氬垏鎹㈠悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { _this.setState({ view: 'normal' diff --git a/src/templates/sharecomponent/tablecomponent/index.jsx b/src/templates/sharecomponent/tablecomponent/index.jsx index 543f4ee..3979db7 100644 --- a/src/templates/sharecomponent/tablecomponent/index.jsx +++ b/src/templates/sharecomponent/tablecomponent/index.jsx @@ -97,23 +97,15 @@ columns: res.FDName.map(item => { let _type = item.FieldType.toLowerCase() let _decimal = 0 + let _length = 50 if (/^nvarchar/.test(_type)) { + _length = +_type.match(/\d+/)[0] || 50 _type = 'text' } else if (/^int/.test(_type)) { _type = 'number' } else if (/^decimal/.test(_type)) { _decimal = _type.split(',')[1] _decimal = parseInt(_decimal) - if (_decimal > 4) { - _decimal = 4 - } - _type = 'number' - } else if (/^decimal/.test(_type)) { - _decimal = _type.split(',')[1] - _decimal = parseInt(_decimal) - if (_decimal > 4) { - _decimal = 4 - } _type = 'number' } else if (/^datetime/.test(_type)) { _type = 'datetime' @@ -128,7 +120,8 @@ label: item.FieldDec, type: _type, datatype: _type, - decimal: _decimal + decimal: _decimal, + length: _length, } }) } @@ -173,7 +166,9 @@ columns: res.FDName.map(item => { let _type = item.FieldType.toLowerCase() let _decimal = 0 + let _length = 50 if (/^nvarchar/.test(_type)) { + _length = +_type.match(/\d+/)[0] || 50 _type = 'text' } else if (/^int/.test(_type)) { _type = 'number' @@ -194,7 +189,8 @@ label: item.FieldDec, type: _type, datatype: _type, - decimal: _decimal + decimal: _decimal, + length: _length } }) } diff --git a/src/templates/sharecomponent/tabscomponent/index.jsx b/src/templates/sharecomponent/tabscomponent/index.jsx index 1f0b759..901b1b0 100644 --- a/src/templates/sharecomponent/tabscomponent/index.jsx +++ b/src/templates/sharecomponent/tabscomponent/index.jsx @@ -226,8 +226,6 @@ confirm({ content: `纭畾鍒犻櫎<<${card.label}>>鍚楋紵`, - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { tabgroups = tabgroups.map(_group => { if (_group.uuid === group.uuid) { @@ -267,8 +265,6 @@ confirm({ content: `纭畾鏂板缓鏍囩缁勫悧锛焋, - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { if (_tabgroups.length === 1) { _tabgroups.forEach(group => { @@ -301,8 +297,6 @@ confirm({ content: `纭畾鍒犻櫎鏍囩缁勫悧锛焋, - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { _tabgroups = _tabgroups.filter(_group => _group.uuid !== group.uuid) diff --git a/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx b/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx index 345a05e..9a85eba 100644 --- a/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx +++ b/src/templates/sharecomponent/treesettingcomponent/settingform/index.jsx @@ -72,9 +72,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record)} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record) }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -237,8 +236,6 @@ if (this.scriptsForm && this.scriptsForm.props.form.getFieldValue('sql')) { confirm({ content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氭彁浜ゅ悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { _this.sqlverify(_setting, resolve, reject) }, @@ -421,8 +418,6 @@ if (_loading) { confirm({ content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氬垏鎹㈠悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { _this.setState({ view: 'normal' diff --git a/src/templates/subtableconfig/index.jsx b/src/templates/subtableconfig/index.jsx index 2597d1f..9effe34 100644 --- a/src/templates/subtableconfig/index.jsx +++ b/src/templates/subtableconfig/index.jsx @@ -781,8 +781,6 @@ if (originConfig.isAdd) { confirm({ content: '鑿滃崟灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�', - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { _this.handleViewBack() }, diff --git a/src/templates/treepageconfig/index.jsx b/src/templates/treepageconfig/index.jsx index abfd481..d987549 100644 --- a/src/templates/treepageconfig/index.jsx +++ b/src/templates/treepageconfig/index.jsx @@ -527,8 +527,6 @@ if (config.isAdd) { confirm({ content: '鑿滃崟灏氭湭鎻愪氦锛岀‘瀹氭斁寮冧繚瀛樺悧锛�', - okText: this.state.dict['model.confirm'], - cancelText: this.state.dict['model.cancel'], onOk() { _this.props.handleView() }, diff --git a/src/templates/zshare/adjustransferform/index.jsx b/src/templates/zshare/adjustransferform/index.jsx deleted file mode 100644 index 4e492b5..0000000 --- a/src/templates/zshare/adjustransferform/index.jsx +++ /dev/null @@ -1,114 +0,0 @@ -import React, {Component} from 'react' -import PropTypes from 'prop-types' -import { Transfer, Icon } from 'antd' -import './index.scss' - -class TransferForm extends Component { - static propTypes = { - columns: PropTypes.array, - selected: PropTypes.array, - dict: PropTypes.object, // 瀛楀吀椤� - } - - state = { - data: [], - targetKeys: [], - selectedKeys: [] - } - - handleChange = (nextTargetKeys, direction, moveKeys) => { - this.setState({ targetKeys: nextTargetKeys }) - } - - handleSelectChange = (sourceSelectedKeys, targetSelectedKeys) => { - this.setState({ selectedKeys: [...sourceSelectedKeys, ...targetSelectedKeys] }) - } - - UNSAFE_componentWillMount() { - let datas = new Map() - this.props.columns.forEach(item => { - if (item.field && item.Hide !== 'true') { - datas.set(item.uuid, item) - } - }) - - let selecteds = [] - - this.props.selected.forEach(item => { - if (datas.has(item)) { - selecteds.push(item) - } - }) - - this.setState({ - data: [...datas.values()].map(item => { - return { - key: item.uuid, - title: item.label, - field: item.field, - description: '' - } - }), - targetKeys: selecteds - }) - } - - changeorder = (e, item, type) => { - const { targetKeys } = this.state - e.stopPropagation() - - let _index = 0 - let keys = targetKeys.filter((key, i) => { - if (key === item.key) { - _index = i - return false - } else { - return true - } - }) - - if ((_index === 0 && type === 'up') || (_index === targetKeys.length - 1 && type === 'down')) { - return - } - - if (type === 'up') { - keys.splice(_index - 1, 0, item.key) - } else { - keys.splice(_index + 1, 0, item.key) - } - - this.setState({ - targetKeys: keys - }) - } - - getItem = (item) => { - let content = item.title + '(' + item.field + ')' - return <span title={content}> - {content} - <Icon type="arrow-up" onClick={(e) => {this.changeorder(e, item, 'up')}} /> - <Icon type="arrow-down" onClick={(e) => {this.changeorder(e, item, 'down')}} /> - </span> - } - - render() { - const { targetKeys, selectedKeys } = this.state - - return ( - <div className="common-table-columns-transfer"> - <Transfer - dataSource={this.state.data} - titles={[this.props.dict['header.form.column.source'], this.props.dict['header.form.column.target']]} - targetKeys={targetKeys} - locale={{itemUnit: this.props.dict['header.form.column.itemUnit'], itemsUnit: this.props.dict['header.form.column.itemsUnit']}} - selectedKeys={selectedKeys} - onChange={this.handleChange} - onSelectChange={this.handleSelectChange} - render={this.getItem} - /> - </div> - ) - } -} - -export default TransferForm diff --git a/src/templates/zshare/adjustransferform/index.scss b/src/templates/zshare/adjustransferform/index.scss deleted file mode 100644 index 1ebb78b..0000000 --- a/src/templates/zshare/adjustransferform/index.scss +++ /dev/null @@ -1,29 +0,0 @@ -.common-table-columns-transfer { - padding-left: 18px; - .ant-transfer-list { - width: 296px; - i { - display: none; - } - } - .ant-transfer-operation + .ant-transfer-list { - .ant-transfer-list-content-item { - padding-right: 50px; - position: relative; - - i { - display: inline-block; - } - .anticon { - position: absolute; - right: 10px; - color: #ff4d4f; - } - .anticon-arrow-up { - position: absolute; - right: 30px; - color: #1890ff; - } - } - } -} \ No newline at end of file diff --git a/src/templates/zshare/basetransferform/index.jsx b/src/templates/zshare/basetransferform/index.jsx index 14851f5..8dd7462 100644 --- a/src/templates/zshare/basetransferform/index.jsx +++ b/src/templates/zshare/basetransferform/index.jsx @@ -6,8 +6,7 @@ class TransferForm extends Component { static propTypes = { - menulist: PropTypes.array, - dict: PropTypes.object + menulist: PropTypes.array } state = { @@ -24,16 +23,13 @@ } render() { - const { dict } = this.props const { targetKeys, selectedKeys } = this.state return ( <div className="trawmenutransfer"> <Transfer dataSource={this.props.menulist} - titles={[dict['model.menu.all'], dict['model.menu.selected']]} targetKeys={targetKeys} - locale={{itemUnit: dict['model.menu.itemUnit'], itemsUnit: dict['model.menu.itemsUnit']}} selectedKeys={selectedKeys} onChange={this.handleChange} onSelectChange={this.handleSelectChange} diff --git a/src/templates/zshare/basetransferform/index.scss b/src/templates/zshare/basetransferform/index.scss index 7959ddd..2e7be3b 100644 --- a/src/templates/zshare/basetransferform/index.scss +++ b/src/templates/zshare/basetransferform/index.scss @@ -1,5 +1,6 @@ .trawmenutransfer { .ant-transfer-list { - width: 210px; + width: calc(50% - 20px); + height: 250px; } } \ No newline at end of file diff --git a/src/templates/zshare/editcomponent/index.jsx b/src/templates/zshare/editcomponent/index.jsx index bf29357..7c52871 100644 --- a/src/templates/zshare/editcomponent/index.jsx +++ b/src/templates/zshare/editcomponent/index.jsx @@ -205,15 +205,13 @@ {/* 瑙e喕鎸夐挳妯℃�佹 */} <Modal title={dict['header.form.thawbutton']} - okText={dict['model.confirm']} - cancelText={dict['model.cancel']} visible={this.state.thawVisible} onOk={this.thawBtnSubmit} onCancel={() => {this.setState({thawVisible: false, thawbtnlist: null})}} destroyOnClose > {!this.state.thawbtnlist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} - {this.state.thawbtnlist && <TransferForm ref="trawmenu" dict={dict} menulist={this.state.thawbtnlist}/>} + {this.state.thawbtnlist && <TransferForm ref="trawmenu" menulist={this.state.thawbtnlist}/>} </Modal> {/* 鎸夐挳閰嶇疆淇℃伅绮樿创澶嶅埗 */} <Modal diff --git a/src/templates/zshare/formconfig.jsx b/src/templates/zshare/formconfig.jsx index 1033580..8f46157 100644 --- a/src/templates/zshare/formconfig.jsx +++ b/src/templates/zshare/formconfig.jsx @@ -2316,7 +2316,20 @@ text: Formdict['model.false'] }] }, - + { + type: 'radio', + key: 'writein', + label: '鍐欏叆', + tooltip: '琛ㄥ崟鎻愪氦鏃讹紝鏄惁灏嗚瀛楁鍊煎啓鍏ラ粯璁ql璇彞涓��', + initVal: card.writein || 'true', + options: [{ + value: 'true', + text: Formdict['model.true'] + }, { + value: 'false', + text: Formdict['model.false'] + }] + }, { type: 'radio', key: 'encryption', @@ -2536,7 +2549,7 @@ key: 'content', label: '鍐呭', initVal: card.content || '', - required: true, + required: _type !== 'header', forbid: !['detail', 'header'].includes(_type), }, { diff --git a/src/templates/zshare/modalform/index.jsx b/src/templates/zshare/modalform/index.jsx index fe6507a..bcc8328 100644 --- a/src/templates/zshare/modalform/index.jsx +++ b/src/templates/zshare/modalform/index.jsx @@ -9,19 +9,19 @@ import './index.scss' const modalTypeOptions = { - text: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'fieldlength', 'regular', 'interception'], - number: ['label', 'field', 'initval', 'type', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'blacklist'], - select: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'resourceType', 'setAll', 'linkSubField'], - multiselect: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'resourceType', 'fieldlength'], - link: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'resourceType', 'setAll', 'linkField'], - fileupload: ['label', 'field', 'type', 'readonly', 'required', 'readin', 'fieldlength', 'blacklist', 'maxfile', 'fileType'], - date: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'], - datemonth: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'], - datetime: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist'], - textarea: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'fieldlength', 'maxRows', 'encryption', 'interception'], - color: ['label', 'field', 'type', 'blacklist', 'readonly', 'required', 'hidden', 'readin'], - funcvar: ['label', 'field', 'type', 'blacklist', 'hidden'], - linkMain: ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength', 'blacklist'] + text: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'fieldlength', 'regular', 'interception', 'writein'], + number: ['label', 'field', 'initval', 'type', 'readonly', 'hidden', 'decimal', 'min', 'max', 'readin', 'blacklist', 'writein'], + select: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'resourceType', 'setAll', 'linkSubField', 'writein'], + multiselect: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'resourceType', 'fieldlength', 'writein'], + link: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'resourceType', 'setAll', 'linkField', 'writein'], + fileupload: ['label', 'field', 'type', 'readonly', 'required', 'readin', 'fieldlength', 'blacklist', 'maxfile', 'fileType', 'writein'], + date: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'writein'], + datemonth: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'writein'], + datetime: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'writein'], + textarea: ['label', 'field', 'initval', 'type', 'readonly', 'required', 'hidden', 'readin', 'blacklist', 'fieldlength', 'maxRows', 'encryption', 'interception', 'writein'], + color: ['label', 'field', 'type', 'blacklist', 'readonly', 'required', 'hidden', 'readin', 'writein'], + funcvar: ['label', 'field', 'type', 'blacklist', 'hidden', 'writein'], + linkMain: ['label', 'field', 'type', 'readonly', 'required', 'hidden', 'fieldlength', 'blacklist', 'writein'] } class MainSearch extends Component { diff --git a/src/templates/zshare/modalform/modaleditable/index.jsx b/src/templates/zshare/modalform/modaleditable/index.jsx index b74b4de..a6fe297 100644 --- a/src/templates/zshare/modalform/modaleditable/index.jsx +++ b/src/templates/zshare/modalform/modaleditable/index.jsx @@ -157,9 +157,8 @@ <span className="operation-btn" title={props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={props.dict['header.form.query.delete']} - okText={props.dict['model.confirm']} - cancelText={props.dict['model.cancel']} onConfirm={() => this.handleDelete(record.key) }> <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> @@ -363,9 +362,8 @@ <span className="operation-btn" title={this.props.dict['header.form.up']} onClick={() => this.handleUpDown(record, 'up')} style={{color: '#1890ff'}}><Icon type="arrow-up" /></span> <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record.key) }> <span style={{color: '#1890ff', cursor: 'pointer'}}><Icon type="delete" /></span> diff --git a/src/templates/zshare/transferform/index.jsx b/src/templates/zshare/transferform/index.jsx index 4e492b5..f788ee9 100644 --- a/src/templates/zshare/transferform/index.jsx +++ b/src/templates/zshare/transferform/index.jsx @@ -6,8 +6,7 @@ class TransferForm extends Component { static propTypes = { columns: PropTypes.array, - selected: PropTypes.array, - dict: PropTypes.object, // 瀛楀吀椤� + selected: PropTypes.array } state = { @@ -46,7 +45,7 @@ key: item.uuid, title: item.label, field: item.field, - description: '' + description: item.label + '(' + item.field + ')' } }), targetKeys: selecteds @@ -83,12 +82,23 @@ } getItem = (item) => { - let content = item.title + '(' + item.field + ')' - return <span title={content}> - {content} - <Icon type="arrow-up" onClick={(e) => {this.changeorder(e, item, 'up')}} /> - <Icon type="arrow-down" onClick={(e) => {this.changeorder(e, item, 'down')}} /> - </span> + const { targetKeys } = this.state + + if (targetKeys.includes(item.key)) { + return <span title={item.description}> + {item.description} + <Icon type="arrow-up" onClick={(e) => {this.changeorder(e, item, 'up')}} /> + <Icon type="arrow-down" onClick={(e) => {this.changeorder(e, item, 'down')}} /> + </span> + } else { + return item.description + } + } + + filterdata = (inputValue, option) => { + if (!inputValue) return true + + return option.description.toLowerCase().indexOf(inputValue.toLowerCase()) > -1 } render() { @@ -98,9 +108,9 @@ <div className="common-table-columns-transfer"> <Transfer dataSource={this.state.data} - titles={[this.props.dict['header.form.column.source'], this.props.dict['header.form.column.target']]} + showSearch={this.state.data.length > 10} + filterOption={this.filterdata} targetKeys={targetKeys} - locale={{itemUnit: this.props.dict['header.form.column.itemUnit'], itemsUnit: this.props.dict['header.form.column.itemsUnit']}} selectedKeys={selectedKeys} onChange={this.handleChange} onSelectChange={this.handleSelectChange} diff --git a/src/templates/zshare/transferform/index.scss b/src/templates/zshare/transferform/index.scss index 1ebb78b..8afcf12 100644 --- a/src/templates/zshare/transferform/index.scss +++ b/src/templates/zshare/transferform/index.scss @@ -1,7 +1,18 @@ .common-table-columns-transfer { padding-left: 18px; + + .ant-transfer { + white-space: nowrap; + } + .ant-transfer-list-body-with-search { + padding-top: 45px; + .ant-transfer-list-body-search-wrapper { + padding: 5px; + } + } .ant-transfer-list { - width: 296px; + width: calc(50% - 20px); + height: 250px; i { display: none; } diff --git a/src/templates/zshare/verifycard/index.jsx b/src/templates/zshare/verifycard/index.jsx index 1dae903..cbfb1e4 100644 --- a/src/templates/zshare/verifycard/index.jsx +++ b/src/templates/zshare/verifycard/index.jsx @@ -88,9 +88,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'unique', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'unique')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'unique') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -134,9 +133,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'unique', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'unique')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'unique') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -200,9 +198,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'contrast', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'contrast')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'contrast') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -264,9 +261,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'customverify', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'customverify')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'customverify') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -327,9 +323,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'scripts', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'scripts')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'scripts') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -431,9 +426,8 @@ <span className="operation-btn" title={this.props.dict['header.form.down']} onClick={() => this.handleUpDown(record, 'ordercode', 'down')} style={{color: '#ff4d4f'}}><Icon type="arrow-down" /></span> <span className="operation-btn" title={this.props.dict['header.form.status.change']} onClick={() => this.handleStatus(record, 'ordercode')} style={{color: '#8E44AD'}}><Icon type="swap" /></span> <Popconfirm + overlayClassName="popover-confirm" title={this.props.dict['header.form.query.delete']} - okText={this.props.dict['model.confirm']} - cancelText={this.props.dict['model.cancel']} onConfirm={() => this.handleDelete(record, 'ordercode') }> <span className="operation-btn" style={{color: '#ff4d4f'}}><Icon type="delete" /></span> @@ -1572,8 +1566,6 @@ if (_loading) { confirm({ content: `瀛樺湪鏈繚瀛橀」锛岀‘瀹氭彁浜ゅ悧锛焋, - okText: this.props.dict['model.confirm'], - cancelText: this.props.dict['model.cancel'], onOk() { resolve(verify) }, diff --git a/src/utils/utils.js b/src/utils/utils.js index 19cc904..3c58522 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -1429,6 +1429,8 @@ let values = [] formdata.forEach(item => { + if (item.writein === false) return + keys.push(item.key.toLowerCase()) values.push('@' + item.key) }) @@ -1472,6 +1474,8 @@ let _arr = [] formdata.forEach(item => { + if (item.writein === false) return + _arr.push(item.key.toLowerCase()) _form.push(item.key + '=@' + item.key) }) diff --git a/src/views/main/index.jsx b/src/views/main/index.jsx index a02f7c2..dab2cfa 100644 --- a/src/views/main/index.jsx +++ b/src/views/main/index.jsx @@ -1,16 +1,23 @@ import React, {Component} from 'react' +import { ConfigProvider } from 'antd' +import enUS from 'antd/es/locale/en_US' +import zhCN from 'antd/es/locale/zh_CN' import Header from '@/components/header' import Sidemenu from '@/components/sidemenu' import Tabview from '@/components/tabview' import './index.scss' +const _locale = localStorage.getItem('lang') !== 'en-US' ? zhCN : enUS + class Main extends Component { render () { return ( <div className="flex-container"> - <Header key="header"/> - <Sidemenu key="sidemenu"/> - <Tabview key="tabview"/> + <ConfigProvider locale={_locale}> + <Header key="header"/> + <Sidemenu key="sidemenu"/> + <Tabview key="tabview"/> + </ConfigProvider> </div> ) } diff --git a/src/views/menudesign/index.jsx b/src/views/menudesign/index.jsx index f7c06e1..b3bcbdf 100644 --- a/src/views/menudesign/index.jsx +++ b/src/views/menudesign/index.jsx @@ -4,12 +4,14 @@ import { is, fromJS } from 'immutable' import moment from 'moment' import HTML5Backend from 'react-dnd-html5-backend' -import { notification, Modal, Collapse, Card, Icon, Switch, Button } from 'antd' +import { ConfigProvider, notification, Modal, Collapse, Card, Icon, Switch, Button } from 'antd' import Api from '@/api' import Utils from '@/utils/utils.js' import zhCN from '@/locales/zh-CN/mob.js' import enUS from '@/locales/en-US/mob.js' +import antdEnUS from 'antd/es/locale/en_US' +import antdZhCN from 'antd/es/locale/zh_CN' import asyncComponent from '@/utils/asyncComponent' import './index.scss' @@ -17,6 +19,7 @@ // const { TabPane } = Tabs const { Panel } = Collapse const { confirm } = Modal +const _locale = localStorage.getItem('lang') !== 'en-US' ? antdZhCN : antdEnUS const Header = asyncComponent(() => import('@/menu/header')) const MenuForm = asyncComponent(() => import('@/menu/menuform')) @@ -62,14 +65,11 @@ closeView = () => { const { oriConfig, config } = this.state - const _this = this if (!is(fromJS(oriConfig), fromJS(config))) { confirm({ title: '閰嶇疆宸蹭慨鏀癸紝鏀惧純淇濆瓨鍚楋紵', content: '', - okText: _this.state.dict['mob.confirm'], - cancelText: _this.state.dict['mob.cancel'], onOk() { window.close() }, @@ -267,8 +267,6 @@ confirm({ title: '纭畾鍒犻櫎鍏冪礌鍚楋紵', content: '', - okText: this.state.dict['mob.confirm'], - cancelText: this.state.dict['mob.cancel'], onOk() { config.components = config.components.filter(item => item.uuid !== id) @@ -355,55 +353,57 @@ const { activeKey, dict, MenuId, config } = this.state return ( - <div className="pc-menu-view" id="view"> - <Header view="design" closeView={this.closeView} /> - <DndProvider backend={HTML5Backend}> - <div className="menu-body"> - <div className="menu-setting"> - <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> - {/* 鍩烘湰淇℃伅 */} - <Panel header={dict['mob.basemsg']} key="basedata"> - {/* 鑿滃崟淇℃伅 */} - <MenuForm - dict={dict} - config={config} - MenuId={MenuId} - parentId={this.props.match.params.ParentId} - MenuName={this.props.match.params.MenuName} - MenuNo={this.props.match.params.MenuNo} - initMenuList={this.initMenuList} - updateConfig={this.updateConfig} - /> - {/* 琛ㄥ悕娣诲姞 */} - {config ? <TableComponent config={config} updatetable={this.updatetable}/> : null} - </Panel> - {/* 缁勪欢娣诲姞 */} - <Panel header={dict['mob.component']} key="component"> - <SourceWrap /> - </Panel> - {/* <Panel header={dict['mob.style']} key="style"> - <Controller /> - </Panel> */} - </Collapse> + <ConfigProvider locale={_locale}> + <div className="pc-menu-view" id="view"> + <Header view="design" closeView={this.closeView} /> + <DndProvider backend={HTML5Backend}> + <div className="menu-body"> + <div className="menu-setting"> + <Collapse accordion activeKey={activeKey} bordered={false} onChange={(key) => this.setState({activeKey: key})}> + {/* 鍩烘湰淇℃伅 */} + <Panel header={dict['mob.basemsg']} key="basedata"> + {/* 鑿滃崟淇℃伅 */} + <MenuForm + dict={dict} + config={config} + MenuId={MenuId} + parentId={this.props.match.params.ParentId} + MenuName={this.props.match.params.MenuName} + MenuNo={this.props.match.params.MenuNo} + initMenuList={this.initMenuList} + updateConfig={this.updateConfig} + /> + {/* 琛ㄥ悕娣诲姞 */} + {config ? <TableComponent config={config} updatetable={this.updatetable}/> : null} + </Panel> + {/* 缁勪欢娣诲姞 */} + <Panel header={dict['mob.component']} key="component"> + <SourceWrap /> + </Panel> + {/* <Panel header={dict['mob.style']} key="style"> + <Controller /> + </Panel> */} + </Collapse> + </div> + <div className="menu-view"> + <Card title={ + <div> + {config && config.MenuName} + <Icon type="redo" style={{marginLeft: '10px'}} title="鍒锋柊鏍囩鍒楄〃" onClick={() => this.reloadTab()} /> + </div> + } bordered={false} extra={ + <div> + {config ? <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config.enabled} onChange={this.onEnabledChange} /> : null} + <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{dict['mob.save']}</Button> + </div> + } style={{ width: '100%' }}> + {config && config.components ? <MenuShell config={config} handleList={this.updateConfig} deleteCard={this.deleteCard} /> : null} + </Card> + </div> </div> - <div className="menu-view"> - <Card title={ - <div> - {config && config.MenuName} - <Icon type="redo" style={{marginLeft: '10px'}} title="鍒锋柊鏍囩鍒楄〃" onClick={() => this.reloadTab()} /> - </div> - } bordered={false} extra={ - <div> - {config ? <Switch className="big" checkedChildren={dict['mob.enable']} unCheckedChildren={dict['mob.disable']} checked={config.enabled} onChange={this.onEnabledChange} /> : null} - <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{dict['mob.save']}</Button> - </div> - } style={{ width: '100%' }}> - {config && config.components ? <MenuShell config={config} handleList={this.updateConfig} deleteCard={this.deleteCard} /> : null} - </Card> - </div> - </div> - </DndProvider> - </div> + </DndProvider> + </div> + </ConfigProvider> ) } } -- Gitblit v1.8.0