| | |
| | | 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> |
| | | {/* 编辑菜单模态框 */} |
| | | <Modal |
| | |
| | | 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={this.state.dict} menulist={this.state.thawmenulist}/>} |
| | | {this.state.thawmenulist && <TransferForm ref="trawmenu" menulist={this.state.thawmenulist}/>} |
| | | </Modal> |
| | | </div> |
| | | ) |
| | |
| | | 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> |
| | | {/* 添加系统菜单 */} |
| | | <Modal |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Transfer } from 'antd' |
| | | |
| | | import zhCN from '@/locales/zh-CN/share.js' |
| | | import enUS from '@/locales/en-US/share.js' |
| | | import './index.scss' |
| | | |
| | | class TransferForm extends Component { |
| | | static propTypes = { |
| | | menulist: PropTypes.array, |
| | | dict: PropTypes.object, // 字典项 |
| | | menulist: PropTypes.array |
| | | } |
| | | |
| | | state = { |
| | | dict: sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS, |
| | | targetKeys: [], |
| | | selectedKeys: [] |
| | | } |
| | |
| | | } |
| | | |
| | | render() { |
| | | const { targetKeys, selectedKeys } = this.state |
| | | const { targetKeys, selectedKeys, dict } = this.state |
| | | |
| | | return ( |
| | | <div className="trawmenutransfer"> |
| | | <Transfer |
| | | dataSource={this.props.menulist} |
| | | titles={[this.props.dict['header.menu.thawmenu.source'], this.props.dict['header.menu.thawmenu.target']]} |
| | | titles={[dict['thawmenu.source'], dict['thawmenu.target']]} |
| | | targetKeys={targetKeys} |
| | | locale={{itemUnit: this.props.dict['header.menu.thawmenu.itemUnit'], itemsUnit: this.props.dict['header.menu.thawmenu.itemsUnit']}} |
| | | locale={{itemUnit: dict['thawmenu.itemUnit'], itemsUnit: dict['thawmenu.itemsUnit']}} |
| | | selectedKeys={selectedKeys} |
| | | onChange={this.handleChange} |
| | | onSelectChange={this.handleSelectChange} |
| | |
| | | 'header.menu.maintable': '主表', |
| | | 'header.menu.query': '查询', |
| | | 'header.menu.printTemplate': '打印模板', |
| | | 'header.menu.thawmenu.source': '已冻结', |
| | | 'header.menu.thawmenu.target': '解除冻结', |
| | | 'header.menu.thawmenu.itemUnit': '项', |
| | | 'header.menu.thawmenu.itemsUnit': '项', |
| | | 'header.form.tabType': '标签类型', |
| | | 'header.form.search.placeholder': 'Please add search criteria', |
| | | 'header.form.modal.placeholder': 'Please add the form', |
| | |
| | | 'header.menu.openType.newWindow': 'A new window', |
| | | 'header.menu.newpage.service': 'Customer Service', |
| | | 'header.menu.thawmenu.select': 'Please select the menu to unfreeze !', |
| | | 'header.menu.thawmenu.source': 'Frozen', |
| | | 'header.menu.thawmenu.target': 'Unfreeze', |
| | | 'header.menu.thawmenu.itemUnit': 'item', |
| | | 'header.menu.thawmenu.itemsUnit': 'items', |
| | | 'form.required.input': 'Please enter the ', |
| | | 'form.required.select': '请选择' |
| | | } |
| | |
| | | 'main.return': 'Cancel', |
| | | 'main.close': '关闭', |
| | | 'main.all': 'All', |
| | | 'main.cancel': '取消', |
| | | 'main.copy.success': 'Copy success', |
| | | 'main.pagination.of': 'of', |
| | | 'main.pagination.items': 'items', |
| | |
| | | export default { |
| | | 'view.notFound': '抱歉,你访问的页面不存在,请联系管理员。', |
| | | 'date.empty': '空' |
| | | 'date.empty': '空', |
| | | 'thawmenu.source': 'Frozen', |
| | | 'thawmenu.target': 'Unfreeze', |
| | | 'thawmenu.itemUnit': 'item', |
| | | 'thawmenu.itemsUnit': 'items', |
| | | } |
| | |
| | | 'header.menu.maintable': '主表', |
| | | 'header.menu.query': '查询', |
| | | 'header.menu.printTemplate': '打印模板', |
| | | 'header.menu.thawmenu.source': '已冻结', |
| | | 'header.menu.thawmenu.target': '解除冻结', |
| | | 'header.menu.thawmenu.itemUnit': '项', |
| | | 'header.menu.thawmenu.itemsUnit': '项', |
| | | 'header.form.tabType': '标签类型', |
| | | 'header.form.search.placeholder': '请添加搜索条件', |
| | | 'header.form.modal.placeholder': '请添加表单', |
| | |
| | | 'header.menu.openType.newWindow': '新窗口', |
| | | 'header.menu.newpage.service': '客服', |
| | | 'header.menu.thawmenu.select': '请选择要解除冻结的菜单!', |
| | | 'header.menu.thawmenu.source': '已冻结', |
| | | 'header.menu.thawmenu.target': '解除冻结', |
| | | 'header.menu.thawmenu.itemUnit': '项', |
| | | 'header.menu.thawmenu.itemsUnit': '项', |
| | | 'form.required.input': '请输入', |
| | | 'form.required.select': '请选择' |
| | | } |
| | |
| | | 'main.return': '返回', |
| | | 'main.close': '关闭', |
| | | 'main.all': '全部', |
| | | 'main.cancel': '取消', |
| | | 'main.copy.success': '复制成功', |
| | | 'main.pagination.of': '共', |
| | | 'main.pagination.items': '条', |
| | |
| | | export default { |
| | | 'view.notFound': '抱歉,你访问的页面不存在,请联系管理员。', |
| | | 'date.empty': '空' |
| | | 'date.empty': '空', |
| | | 'thawmenu.source': '全部', |
| | | 'thawmenu.target': '已选择', |
| | | 'thawmenu.itemUnit': '项', |
| | | 'thawmenu.itemsUnit': '项', |
| | | } |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Card, Col, Row, Icon, Menu, notification, Spin, Input, Tabs, Button, Tree } from 'antd' |
| | | import { Card, Col, Row, Icon, Menu, notification, Spin, Input, Tabs, Button, Tree, Empty } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | > |
| | | {this.renderTreeNodes(menuTrees)} |
| | | </Tree> : null} |
| | | {menuTrees && menuTrees.length === 0 ? <p className="nodata">未查询到菜单列表</p> : null} |
| | | {menuTrees && menuTrees.length === 0 ? <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> : null} |
| | | {!loading && !menuTrees ? <Spin className="load-tree" /> : null} |
| | | </TabPane> |
| | | <TabPane tab="已授权菜单" key="selected"> |
| | | {selectMenuTrees && selectMenuTrees.length > 0 ? <DirectoryTree multiple defaultExpandedKeys={selectMenuOpenKeys}> |
| | | {this.renderTreeNodes(selectMenuTrees)} |
| | | </DirectoryTree> : null} |
| | | {selectMenuTrees && selectMenuTrees.length === 0 ? <p className="nodata">未查询到已授权菜单</p> : null} |
| | | {selectMenuTrees && selectMenuTrees.length === 0 ? <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> : null} |
| | | {!loading && !selectMenuTrees ? <Spin className="load-tree" /> : null} |
| | | </TabPane> |
| | | </Tabs> |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { is, fromJS } from 'immutable' |
| | | import { Row, Col, Input, Button, Card, notification } from 'antd' |
| | | // import moment from 'moment' |
| | | import { Row, Col, Input, Button, Card, notification, Modal, Empty, Spin } from 'antd' |
| | | import moment from 'moment' |
| | | |
| | | import Api from '@/api' |
| | | import zhCN from '@/locales/zh-CN/main.js' |
| | | import enUS from '@/locales/en-US/main.js' |
| | | import Utils from '@/utils/utils.js' |
| | | // import options from '@/store/options.js' |
| | | // import { verupMainTable } from './config.js' |
| | | import TransferForm from '@/components/transferform' |
| | | import subtableurl from '@/assets/img/subtable.jpg' |
| | | import MutilForm from './mutilform' |
| | | |
| | | import './index.scss' |
| | | |
| | | const { Search } = Input |
| | | const { confirm } = Modal |
| | | |
| | | class TabManage extends Component { |
| | | static propTpyes = { |
| | |
| | | ContainerId: Utils.getuuid(), // 菜单外层html Id |
| | | searchKey: '', |
| | | tabviews: null, |
| | | cols: 8 |
| | | loading: true, |
| | | modaltype: '', |
| | | editTab: null, |
| | | submitloading: false, |
| | | cols: 8, |
| | | thawVisible: false, |
| | | thawmenulist: null |
| | | |
| | | } |
| | | |
| | | getTabs = () => { |
| | | Api.getSystemConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | loading: false, |
| | | tabviews: res.UserTemp.map(temp => { |
| | | return { |
| | | uuid: temp.MenuID, |
| | | value: temp.MenuID, |
| | | MenuName: temp.MenuName, |
| | | type: temp.Template, |
| | | MenuNo: temp.MenuNo, |
| | | Remark: temp.Remark |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | loading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | UNSAFE_componentWillMount () { |
| | | let docwidth = document.body.offsetWidth |
| | | let cols = 8 |
| | | |
| | | if (docwidth > 1500) { |
| | | if (docwidth > 1800) { |
| | | cols = 6 |
| | | } else if (docwidth > 1900) { |
| | | cols = 4 |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | Api.getSystemConfig({func: 'sPC_Get_UserTemp', TypeCharTwo: 'tab'}).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | tabviews: res.UserTemp.map(temp => { |
| | | return { |
| | | uuid: temp.MenuID, |
| | | value: temp.MenuID, |
| | | text: temp.MenuName, |
| | | type: temp.Template, |
| | | MenuNo: temp.MenuNo |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | this.getTabs() |
| | | } |
| | | |
| | | shouldComponentUpdate (nextProps, nextState) { |
| | |
| | | } |
| | | } |
| | | |
| | | handleTab = (tab, type) => { |
| | | let _this = this |
| | | |
| | | if (type === 'delete') { |
| | | confirm({ |
| | | title: "确定删除该标签吗?", |
| | | onOk() { |
| | | return new Promise(resolve => { |
| | | let _param = { |
| | | func: 'sPC_MainMenu_Del', |
| | | MenuID: tab.uuid |
| | | } |
| | | |
| | | Api.getSystemConfig(_param).then(res => { |
| | | if (!res.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '执行成功', |
| | | duration: 2 |
| | | }) |
| | | _this.setState({ |
| | | loading: true, |
| | | tabviews: null |
| | | }, () => { |
| | | _this.getTabs() |
| | | }) |
| | | } |
| | | resolve() |
| | | }) |
| | | }) |
| | | }, |
| | | onCancel() {} |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | editTab: tab, |
| | | modaltype: type |
| | | }) |
| | | } |
| | | } |
| | | |
| | | handleSubmit = () => { |
| | | const { editTab, modaltype } = this.state |
| | | |
| | | this.tabFormRef.handleConfirm().then(res => { |
| | | |
| | | let _tab = {...editTab, ...res} |
| | | |
| | | this.setState({submitloading: true}) |
| | | |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: _tab.uuid |
| | | }).then(res => { |
| | | |
| | | if (!res.status) { |
| | | this.setState({ |
| | | submitloading: false |
| | | }) |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let param = { |
| | | func: 'sPC_Tab_AddUpt', |
| | | MenuID: _tab.uuid, |
| | | MenuNo: _tab.MenuNo, |
| | | Template: _tab.type, |
| | | MenuName: _tab.MenuName, |
| | | Remark: _tab.Remark, |
| | | PageParam: JSON.stringify({Template: _tab.type}), |
| | | Sort: 0 |
| | | } |
| | | |
| | | let _oriActions = [] |
| | | |
| | | let btnParam = { |
| | | func: 'sPC_Button_AddUpt', |
| | | Type: 40, |
| | | ParentID: _tab.uuid, |
| | | MenuNo: _tab.MenuNo, |
| | | Template: _tab.type, |
| | | PageParam: '', |
| | | LongParam: '', |
| | | LText: '' |
| | | } |
| | | |
| | | if (modaltype === 'edit') { |
| | | param.LongParam = res.LongParam |
| | | } else { |
| | | let _LongParam = '' |
| | | let _menuId = Utils.getuuid() |
| | | |
| | | // 解析配置 |
| | | if (res.LongParam) { |
| | | try { |
| | | _LongParam = JSON.parse(window.decodeURIComponent(window.atob(res.LongParam))) |
| | | } catch (e) { |
| | | console.warn('Parse Failure') |
| | | _LongParam = '' |
| | | } |
| | | } |
| | | |
| | | if (_LongParam) { |
| | | try { |
| | | _LongParam.uuid = _menuId |
| | | _LongParam.tabName = _tab.MenuName |
| | | _LongParam.tabNo = _tab.MenuNo |
| | | _LongParam.Remark = _tab.Remark |
| | | |
| | | let _linkchange = {} |
| | | btnParam.LText = [] |
| | | |
| | | _LongParam.action = _LongParam.action.map((item, index) => { |
| | | let uuid = Utils.getuuid() |
| | | |
| | | if (item.OpenType === 'pop') { |
| | | _oriActions.push({ |
| | | prebtn: JSON.parse(JSON.stringify(item)), |
| | | curuuid: uuid, |
| | | Template: 'Modal' |
| | | }) |
| | | } else if (item.OpenType === 'popview') { |
| | | _linkchange[item.linkTab] = Utils.getuuid() |
| | | |
| | | item.linkTab = _linkchange[item.linkTab] |
| | | } |
| | | |
| | | item.uuid = uuid |
| | | |
| | | btnParam.LText.push(`select '${item.uuid}' as menuid, '${item.label}' as menuname, '${(index + 1) * 10}' as Sort`) |
| | | |
| | | return item |
| | | }) |
| | | |
| | | if (_LongParam.funcs && _LongParam.funcs.length > 0) { |
| | | _LongParam.funcs = _LongParam.funcs.map(item => { |
| | | if (item.type === 'tab') { |
| | | item.linkTab = _linkchange[item.linkTab] |
| | | item.menuNo = '' |
| | | item.subfuncs = [] |
| | | } |
| | | |
| | | return item |
| | | }) |
| | | } |
| | | |
| | | btnParam.LText = btnParam.LText.join(' union all ') |
| | | btnParam.LText = Utils.formatOptions(btnParam.LText) |
| | | btnParam.timestamp = moment().format('YYYY-MM-DD HH:mm:ss') + '.000' |
| | | btnParam.secretkey = Utils.encrypt(btnParam.LText, btnParam.timestamp) |
| | | |
| | | _LongParam = window.btoa(window.encodeURIComponent(JSON.stringify(_LongParam))) |
| | | } catch { |
| | | console.warn('Stringify Failure') |
| | | _LongParam = '' |
| | | } |
| | | } |
| | | |
| | | param.MenuID = _menuId |
| | | param.LongParam = _LongParam |
| | | |
| | | btnParam.ParentID = _menuId |
| | | } |
| | | |
| | | new Promise(resolve => { |
| | | Api.getSystemConfig(param).then(response => { |
| | | if (response.status) { |
| | | resolve(true) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: response.message, |
| | | duration: 10 |
| | | }) |
| | | resolve(false) |
| | | } |
| | | }) |
| | | }).then(result => { |
| | | if (!result) return result |
| | | if (modaltype === 'edit') return true |
| | | if (!btnParam.LText) return true |
| | | |
| | | return Api.getSystemConfig(btnParam) |
| | | }).then(result => { |
| | | if (!result) return result |
| | | if (modaltype === 'edit') return true |
| | | if (!btnParam.LText) return true |
| | | |
| | | if (result.status) { |
| | | return true |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: result.message, |
| | | duration: 10 |
| | | }) |
| | | return false |
| | | } |
| | | }).then(result => { |
| | | if (!result) return result |
| | | if (modaltype === 'edit') return true |
| | | if (_oriActions.length === 0) return true |
| | | |
| | | let deffers = _oriActions.map(item => { |
| | | return new Promise(resolve => { |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_LongParam', |
| | | MenuID: item.prebtn.uuid |
| | | }).then(response => { |
| | | if (!response.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: response.message, |
| | | duration: 10 |
| | | }) |
| | | resolve(false) |
| | | } else if (response.status && response.LongParam) { |
| | | let _param = { |
| | | func: 'sPC_ButtonParam_AddUpt', |
| | | ParentID: _tab.uuid, |
| | | MenuID: item.curuuid, |
| | | MenuNo: _tab.MenuNo, |
| | | Template: item.Template, |
| | | MenuName: item.prebtn.label, |
| | | PageParam: JSON.stringify({Template: item.Template}), |
| | | LongParam: response.LongParam |
| | | } |
| | | Api.getSystemConfig(_param).then(resp => { |
| | | if (!resp.status) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: resp.message, |
| | | duration: 10 |
| | | }) |
| | | resolve(false) |
| | | } else { |
| | | resolve(true) |
| | | } |
| | | }) |
| | | } else { |
| | | resolve(true) |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | |
| | | return Promise.all(deffers) |
| | | }).then(result => { |
| | | if (!result) { |
| | | this.setState({ |
| | | submitloading: false |
| | | }) |
| | | return |
| | | } |
| | | |
| | | let isSuccess = true |
| | | |
| | | if (typeof(result) === 'object') { |
| | | result.forEach(resul => { |
| | | if (!resul) { |
| | | isSuccess = false |
| | | } |
| | | }) |
| | | } |
| | | |
| | | if (isSuccess) { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '执行成功', |
| | | duration: 2 |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | | loading: true, |
| | | submitloading: false, |
| | | modaltype: '', |
| | | tabviews: null |
| | | }, () => { |
| | | this.getTabs() |
| | | }) |
| | | }) |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | triggerDraw = () => { |
| | | this.setState({ |
| | | thawVisible: true |
| | | }) |
| | | |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_Get_FrozenMenu', |
| | | TYPE: 50 |
| | | }).then(res => { |
| | | if (res.status) { |
| | | this.setState({ |
| | | thawmenulist: res.data.map(menu => { |
| | | return { |
| | | key: menu.MenuID, |
| | | title: menu.MenuName |
| | | } |
| | | }) |
| | | }) |
| | | } else { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: res.message, |
| | | duration: 10 |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | |
| | | thawMenuSubmit = () => { |
| | | if (this.refs.trawmenu.state.targetKeys.length === 0) { |
| | | notification.warning({ |
| | | top: 92, |
| | | message: '请选择要解除冻结的标签!', |
| | | duration: 10 |
| | | }) |
| | | } else { |
| | | this.setState({ |
| | | submitloading: true |
| | | }) |
| | | let defers = this.refs.trawmenu.state.targetKeys.map(item => { |
| | | return new Promise((resolve) => { |
| | | Api.getSystemConfig({ |
| | | func: 'sPC_MainMenu_ReDel', |
| | | MenuID: item |
| | | }).then(res => { |
| | | if (res.status) { |
| | | resolve('') |
| | | } else { |
| | | resolve(res.message) |
| | | } |
| | | }) |
| | | }) |
| | | }) |
| | | Promise.all(defers).then(res => { |
| | | let msg = res.filter(Boolean)[0] |
| | | if (msg) { |
| | | notification.error({ |
| | | top: 92, |
| | | message: msg, |
| | | duration: 15 |
| | | }) |
| | | this.setState({ |
| | | submitloading: false |
| | | }) |
| | | } else { |
| | | notification.success({ |
| | | top: 92, |
| | | message: '执行成功', |
| | | duration: 2 |
| | | }) |
| | | this.setState({ |
| | | submitloading: false, |
| | | thawVisible: false, |
| | | thawmenulist: null, |
| | | tabviews: null |
| | | }, () => { |
| | | this.getTabs() |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { cols, tabviews } = this.state |
| | | const { cols, tabviews, modaltype, editTab, searchKey, loading } = this.state |
| | | |
| | | let _tabviews = [] |
| | | if (tabviews) { |
| | | _tabviews = tabviews.filter(tab => tab.MenuName.toLowerCase().indexOf(searchKey.toLowerCase()) >= 0) |
| | | } |
| | | |
| | | return ( |
| | | <div className="tab-manage" id={this.state.ContainerId}> |
| | | {loading && <Spin size="large" />} |
| | | <Row> |
| | | <Col className="tab-search" span={6}> |
| | | <Search placeholder="请输入标签名称" onSearch={value => {this.setState({searchKey: value})}} enterButton /> |
| | | </Col> |
| | | <Col className="tab-thaw" span={6} offset={12}> |
| | | <Button type="primary">标签解冻</Button> |
| | | <Button type="primary" onClick={this.triggerDraw}>标签解冻</Button> |
| | | </Col> |
| | | </Row> |
| | | <Row className="tab-list"> |
| | | {tabviews && tabviews.map((tab, index) => { |
| | | {_tabviews.length > 0 ? <Row className="tab-list"> |
| | | {_tabviews.map((tab, index) => { |
| | | return ( |
| | | <Col span={cols} key={index}> |
| | | <Card |
| | | className="tab-card" |
| | | title={tab.text} |
| | | title={tab.MenuName} |
| | | > |
| | | <img onClick={() => {this.previewPicture()}} src={subtableurl} alt=""/> |
| | | <div className="card-operation"> |
| | | <Button type="primary">使用模板</Button> |
| | | <div className="tab-operation"> |
| | | <Button type="primary" onClick={() => this.handleTab(tab, 'edit')}>编辑</Button> |
| | | <Button className="mk-green" onClick={() => this.handleTab(tab, 'copy')}>复制</Button> |
| | | <Button type="danger" onClick={() => this.handleTab(tab, 'delete')}>删除</Button> |
| | | </div> |
| | | </Card> |
| | | </Col> |
| | | ) |
| | | })} |
| | | </Row> |
| | | </Row> : null} |
| | | {tabviews && _tabviews.length === 0 ? <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} /> : null} |
| | | {/* 标签修改或复制 */} |
| | | <Modal |
| | | title={modaltype === 'edit' ? '标签编辑' : '标签复制'} |
| | | visible={!!modaltype} |
| | | width={600} |
| | | maskClosable={false} |
| | | onOk={this.handleSubmit} |
| | | confirmLoading={this.state.submitloading} |
| | | onCancel={() => {this.setState({modaltype: '', editTab: null})}} |
| | | destroyOnClose |
| | | > |
| | | <MutilForm |
| | | dict={this.state.dict} |
| | | tab={editTab} |
| | | inputSubmit={this.handleSubmit} |
| | | wrappedComponentRef={(inst) => this.tabFormRef = inst} |
| | | /> |
| | | </Modal> |
| | | {/* 解冻标签模态框 */} |
| | | <Modal |
| | | title="标签解除冻结" |
| | | okText={this.state.dict['main.confirm']} |
| | | cancelText={this.state.dict['main.cancel']} |
| | | visible={this.state.thawVisible} |
| | | 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" menulist={this.state.thawmenulist}/>} |
| | | </Modal> |
| | | </div> |
| | | ) |
| | | } |
| | |
| | | } |
| | | .tab-list { |
| | | padding-top: 20px; |
| | | margin-left: -10px; |
| | | margin-right: -10px; |
| | | .ant-col { |
| | | padding: 0 10px 20px; |
| | | padding: 0 10px 30px; |
| | | } |
| | | .tab-card { |
| | | .ant-card-body { |
| | | padding: 0; |
| | | position: relative; |
| | | padding: 20px 0; |
| | | img { |
| | | max-width: 100%; |
| | | } |
| | | .tab-operation { |
| | | position: absolute; |
| | | top: -10px; |
| | | right: 10px; |
| | | opacity: 0; |
| | | transition: all 0.1s linear; |
| | | |
| | | button { |
| | | margin-left: 10px; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .tab-card:hover { |
| | | .ant-card-body { |
| | | .tab-operation { |
| | | top: 10px; |
| | | opacity: 1; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | .ant-empty { |
| | | margin: 25vh 0; |
| | | } |
| | | > .ant-spin { |
| | | position: fixed; |
| | | z-index: 10; |
| | | left: calc(50vw - 22px); |
| | | top: calc(50vh - 70px); |
| | | } |
| | | } |
New file |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { Form, Row, Col, Input } from 'antd' |
| | | import './index.scss' |
| | | |
| | | const { TextArea } = Input |
| | | |
| | | class TabHandleForm extends Component { |
| | | static propTpyes = { |
| | | tab: PropTypes.object, // 标签信息 |
| | | dict: PropTypes.object, // 字典项 |
| | | inputSubmit: PropTypes.func // input回车提交 |
| | | } |
| | | |
| | | componentDidMount () { |
| | | try { |
| | | let _form = document.getElementById('MenuName') |
| | | |
| | | if (_form && _form.select) { |
| | | _form.select() |
| | | } |
| | | } catch { |
| | | console.warn('focus error!') |
| | | } |
| | | } |
| | | |
| | | handleConfirm = () => { |
| | | // 表单提交时检查输入值是否正确 |
| | | return new Promise((resolve, reject) => { |
| | | this.props.form.validateFieldsAndScroll((err, values) => { |
| | | if (!err) { |
| | | resolve(values) |
| | | } else { |
| | | reject(err) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | |
| | | handleSubmit = (e) => { |
| | | e.preventDefault() |
| | | this.props.inputSubmit() |
| | | } |
| | | |
| | | render() { |
| | | const { getFieldDecorator } = this.props.form |
| | | const formItemLayout = { |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 } |
| | | } |
| | | } |
| | | return ( |
| | | <Form {...formItemLayout} className="ant-advanced-search-form main-form-field" id="tab-handle-form-box"> |
| | | <Row gutter={24}> |
| | | <Col span={24}> |
| | | <Form.Item label="标签名称"> |
| | | {getFieldDecorator('MenuName', { |
| | | initialValue: this.props.tab.MenuName || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + '标签名称!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="标签参数"> |
| | | {getFieldDecorator('MenuNo', { |
| | | initialValue: this.props.tab.MenuNo || '', |
| | | rules: [ |
| | | { |
| | | required: true, |
| | | message: this.props.dict['form.required.input'] + '标签参数!' |
| | | } |
| | | ] |
| | | })(<Input placeholder="" autoComplete="off" onPressEnter={this.handleSubmit} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | <Col span={24}> |
| | | <Form.Item label="备注"> |
| | | {getFieldDecorator('Remark', { |
| | | initialValue: this.props.tab.Remark || '' |
| | | })(<TextArea autosize={{ minRows: 2, maxRows: 6 }} />)} |
| | | </Form.Item> |
| | | </Col> |
| | | </Row> |
| | | </Form> |
| | | ) |
| | | } |
| | | } |
| | | |
| | | export default Form.create()(TabHandleForm) |
New file |
| | |
| | | .ant-advanced-search-form.main-form-field { |
| | | position: relative; |
| | | padding: 0px 24px 20px; |
| | | .ant-form-item { |
| | | display: flex; |
| | | } |
| | | .ant-form-item-control-wrapper { |
| | | flex: 1; |
| | | } |
| | | .ant-form-item-label { |
| | | overflow: hidden; |
| | | display: inline-block; |
| | | text-overflow: ellipsis; |
| | | white-space: nowrap; |
| | | } |
| | | .textarea-row { |
| | | .ant-col-sm-3 { |
| | | width: 10.5%; |
| | | } |
| | | .ant-col-sm-21 { |
| | | width: 89.5%; |
| | | } |
| | | } |
| | | .ant-input-number { |
| | | width: 100%; |
| | | } |
| | | .ant-form-explain { |
| | | overflow:hidden; |
| | | text-overflow:ellipsis; |
| | | white-space:nowrap; |
| | | } |
| | | p { |
| | | color: #1890ff; |
| | | border-bottom: 1px solid #d9d9d9; |
| | | } |
| | | .ant-input-disabled { |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | cursor: default!important; |
| | | } |
| | | .ant-input-number-input { |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | cursor: default!important; |
| | | } |
| | | .ant-select-disabled { |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | .ant-select-selection--multiple .ant-select-selection__choice { |
| | | color: rgba(0, 0, 0, 0.65)!important; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | let printlist = [] |
| | | let templates = [btn.verify.Template] |
| | | let printCount = 1 |
| | | |
| | | if (formdata.printCount && typeof(formdata.printCount) === 'number' && formdata.printCount >= 1) { |
| | | printCount = formdata.printCount |
| | | |
| | | delete formdata.printCount |
| | | } |
| | | |
| | | this.setState({loadingUuid: btn.uuid}) |
| | | |
| | |
| | | formdata.TemplateID = btn.verify.Template |
| | | |
| | | if (btn.Ot === 'notRequired') { |
| | | if (formdata.printCount && typeof(formdata.printCount) === 'number' && formdata.printCount > 1) { |
| | | for (let i = 0; i < formdata.printCount; i++) { |
| | | printlist.push(JSON.parse(JSON.stringify(formdata))) |
| | | } |
| | | } else { |
| | | printlist.push(formdata) |
| | | for (let i = 0; i < printCount; i++) { |
| | | printlist.push(JSON.parse(JSON.stringify(formdata))) |
| | | } |
| | | } else { |
| | | data.forEach(cell => { |
| | | let _cell = {...cell, ...formdata} |
| | | |
| | | if (formdata.printCount && typeof(formdata.printCount) === 'number' && formdata.printCount > 1) { |
| | | for (let i = 0; i < formdata.printCount; i++) { |
| | | printlist.push(JSON.parse(JSON.stringify(_cell))) |
| | | } |
| | | } else { |
| | | printlist.push(_cell) |
| | | for (let i = 0; i < printCount; i++) { |
| | | printlist.push(JSON.parse(JSON.stringify(_cell))) |
| | | } |
| | | }) |
| | | } |
| | |
| | | _cell.TemplateID = btn.verify.Template |
| | | } |
| | | |
| | | if (item.count && typeof(item.count) === 'number' && item.count > 1) { |
| | | for (let i = 0; i < item.count; i++) { |
| | | printlist.push(JSON.parse(JSON.stringify(_cell))) |
| | | } |
| | | } else { |
| | | printlist.push(_cell) |
| | | let _count = printCount |
| | | |
| | | if (item.count && typeof(item.count) === 'number' && item.count >= 1) { |
| | | _count = item.count |
| | | } |
| | | |
| | | for (let i = 0; i < _count; i++) { |
| | | printlist.push({...formdata, ..._cell}) |
| | | } |
| | | }) |
| | | |
| | |
| | | _ParentParam = null |
| | | } |
| | | |
| | | if (_ParentParam) { |
| | | if (_ParentParam) { // 删除按钮时,保存按钮配置信息,用于恢复按钮 |
| | | _param.ParentParam = _ParentParam |
| | | } |
| | | } |
| | |
| | | destroyOnClose |
| | | > |
| | | {!this.state.thawbtnlist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} |
| | | {this.state.thawbtnlist && <TransferForm ref="trawmenu" dict={this.state.dict} menulist={this.state.thawbtnlist}/>} |
| | | {this.state.thawbtnlist && <TransferForm ref="trawmenu" menulist={this.state.thawbtnlist}/>} |
| | | </Modal> |
| | | {/* 按钮配置信息粘贴复制 */} |
| | | <Modal |
| | |
| | | }) |
| | | } |
| | | |
| | | // _config.uuid = Utils.getuuid() |
| | | // _config.action = _config.action.map(item => { |
| | | // let uuid = Utils.getuuid() |
| | | // if (item.OpenType === 'pop') { // 含有子配置项的按钮 |
| | | // _oriActions.push({ |
| | | // prebtn: JSON.parse(JSON.stringify(item)), |
| | | // curuuid: uuid, |
| | | // Template: 'Modal' |
| | | // }) |
| | | // } |
| | | |
| | | // item.uuid = uuid |
| | | // return item |
| | | // }) |
| | | |
| | | this.setState({ |
| | | originActions: _oriActions, |
| | | optionLibs: optionLibs, |
| | |
| | | _ParentParam = null |
| | | } |
| | | |
| | | if (_ParentParam) { |
| | | if (_ParentParam) { // 删除按钮时,保存按钮配置信息,用于恢复按钮 |
| | | _param.ParentParam = _ParentParam |
| | | } |
| | | |
| | |
| | | destroyOnClose |
| | | > |
| | | {!this.state.thawbtnlist && <Spin style={{marginLeft: 'calc(50% - 22px)', marginTop: '70px', marginBottom: '70px'}} size="large" />} |
| | | {this.state.thawbtnlist && <TransferForm ref="trawmenu" dict={this.state.dict} menulist={this.state.thawbtnlist}/>} |
| | | {this.state.thawbtnlist && <TransferForm ref="trawmenu" menulist={this.state.thawbtnlist}/>} |
| | | </Modal> |
| | | {/* 按钮配置信息粘贴复制 */} |
| | | <Modal |
| | |
| | | } |
| | | |
| | | componentDidMount () { |
| | | const { card } = this.props |
| | | |
| | | if (card.focus) { |
| | | try { |
| | | let _form = document.getElementById('label') |
| | | try { |
| | | let _form = document.getElementById('label') |
| | | if (_form && _form.select) { |
| | | _form.select() |
| | | } catch { |
| | | console.warn('表单focus失败!') |
| | | } |
| | | } catch { |
| | | console.warn('表单focus失败!') |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | let _card = {...this.props.card, ...values, sublist: targetKeys, subfield: subfield} |
| | | |
| | | delete _card.focus |
| | | |
| | | resolve(_card) |
| | | } else { |
| | | reject(err) |