| | |
| | | return (<TabManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) |
| | | } else if (view.type === 'RolePermission') { |
| | | return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) |
| | | } else if (view.type === 'appRolePermission') { |
| | | return (<RoleManage MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID}/>) |
| | | } else if (view.type === 'FormTab') { |
| | | return (<FormTab MenuNo={view.MenuNo} MenuID={view.MenuID} MenuName={view.MenuName} key={view.MenuID} param={view.param}/>) |
| | | } else if (view.type === 'iframe') { |
| | |
| | | sessionStorage.setItem('role_id', sessionStorage.getItem('localRole_id') || '') |
| | | sessionStorage.setItem('dataM', sessionStorage.getItem('localDataM') || '') |
| | | |
| | | // 新系统文件置于admin中 ../options.json |
| | | // 新系统文件置于admin中 ../options.json , { cache: 'no-cache'} |
| | | |
| | | fetch('../options.json') |
| | | .then(response => response.json()) |
| | |
| | | |
| | | if (item.subcards) { |
| | | item.subcards.forEach(card => { |
| | | if (card.elements) { |
| | | if (card.elements) { // 卡片 |
| | | card.elements = card.elements.map(m => { |
| | | if (m.datatype === 'dynamic' && map[m.field]) { |
| | | m.field = map[m.field].FieldName |
| | |
| | | }) |
| | | } |
| | | |
| | | if (card.backElements) { |
| | | if (card.backElements) { // 卡片 |
| | | card.backElements = card.backElements.map(m => { |
| | | if (m.datatype === 'dynamic' && map[m.field]) { |
| | | m.field = map[m.field].FieldName |
| | |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | return m |
| | | }) |
| | | } |
| | | |
| | | if (card.fields) { // 表单 |
| | | card.fields = card.fields.map(m => { |
| | | if (map[m.field]) { |
| | | m.field = map[m.field].FieldName |
| | | } |
| | | return m |
| | | }) |
| | |
| | | } |
| | | |
| | | config.components = _replace(config.components) |
| | | } else if (this.props.type === 'table') { |
| | | config.columns = config.columns.map(col => { |
| | | if (col.field && map[col.field]) { |
| | | col.field = map[col.field].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | config.search = config.search.map(col => { |
| | | if (col.field && map[col.field]) { |
| | | col.field = map[col.field].FieldName |
| | | } |
| | | if (col.datefield && map[col.datefield]) { |
| | | col.datefield = map[col.datefield].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | } else if (this.props.type === 'form') { |
| | | config.fields = config.fields.map(col => { |
| | | if (col.field && map[col.field]) { |
| | | col.field = map[col.field].FieldName |
| | | } |
| | | return col |
| | | }) |
| | | } |
| | | |
| | | this.setState({ |
| | |
| | | const { Panel } = Collapse |
| | | const { confirm } = Modal |
| | | const UrlFieldComponent = asyncComponent(() => import('@/menu/urlfieldcomponent')) |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) |
| | | const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/settingcomponent')) |
| | | const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) |
| | |
| | | </div> |
| | | } bordered={false} extra={ |
| | | <div> |
| | | <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> |
| | | <EditComponent dict={this.state.dict} options={['search', 'action', 'columns']} config={this.state.config} MenuID={this.props.menu.MenuID} thawButtons={this.state.thawButtons} refresh={this.editConfig}/> |
| | | <Switch className="big" checkedChildren={this.state.dict['model.enable']} unCheckedChildren={this.state.dict['model.disable']} checked={this.state.config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> |
| | |
| | | } else if (temp.Template === 'CustomPage' && memberLevel < 20) { |
| | | return |
| | | } |
| | | |
| | | |
| | | _templates.push({ |
| | | uuid: temp.MenuID, |
| | | title: temp.MenuName, |
| | |
| | | let sysTemplates = fromJS(this.state.sysTemplates).toJS() |
| | | |
| | | // 角色权限分配模板,只可以添加一次 |
| | | if (sysMenu.isSystem && sysMenu.Template === 'RolePermission') { |
| | | if (sysMenu.isSystem && (sysMenu.Template === 'RolePermission')) { |
| | | sysTemplates = sysTemplates.map(temp => { |
| | | if (temp.type === sysMenu.type) { |
| | | temp.hidden = true |
| | |
| | | const { Panel } = Collapse |
| | | const { confirm } = Modal |
| | | const CommonDict = sessionStorage.getItem('lang') !== 'en-US' ? zhCN : enUS |
| | | |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const ModalForm = asyncComponent(() => import('@/templates/zshare/modalform')) |
| | | const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) |
| | | const DragElement = asyncComponent(() => import('./dragelement')) |
| | |
| | | <div className="setting"> |
| | | <Card title={dict['header.menu.form.configurable']} bordered={false} extra={ |
| | | <div> |
| | | <ReplaceField type="form" config={config} updateConfig={this.updateconfig}/> |
| | | <EditComponent dict={dict} options={['form']} config={this.state.config} refresh={this.updateEditConfig}/> |
| | | <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{dict['model.save']}</Button> |
| | | <Button onClick={this.cancelConfig}>{dict['model.back']}</Button> |
| | |
| | | const { Panel } = Collapse |
| | | const { confirm } = Modal |
| | | |
| | | const ReplaceField = asyncComponent(() => import('@/menu/replaceField')) |
| | | const EditComponent = asyncComponent(() => import('@/templates/zshare/editcomponent')) |
| | | const SettingComponent = asyncComponent(() => import('@/templates/sharecomponent/settingcomponent')) |
| | | const TableComponent = asyncComponent(() => import('@/templates/sharecomponent/tablecomponent')) |
| | |
| | | </div> |
| | | } bordered={false} extra={ |
| | | <div> |
| | | <ReplaceField type="table" config={config} updateConfig={this.updateconfig}/> |
| | | <EditComponent dict={this.state.dict} options={['search', 'action', 'columns']} config={config} MenuID={config.uuid} thawButtons={this.state.thawButtons} refresh={this.updateConfig}/> |
| | | <Switch className="big" checkedChildren="启" unCheckedChildren="停" checked={config.enabled} onChange={this.onEnabledChange} /> |
| | | <Button type="primary" onClick={this.submitConfig} loading={this.state.menuloading}>{this.state.dict['model.save']}</Button> |
| | |
| | | import React, {Component} from 'react' |
| | | import PropTypes from 'prop-types' |
| | | import { fromJS } from 'immutable' |
| | | import { Menu, Dropdown, Icon, Modal, Spin, notification } from 'antd' |
| | | import { Modal, Spin, notification, Button } from 'antd' |
| | | |
| | | import Api from '@/api' |
| | | import Utils from '@/utils/utils.js' |
| | |
| | | thawVisible: false, |
| | | thawbtnlist: null, |
| | | pasteVisible: false, |
| | | } |
| | | |
| | | handleMenuClick = e => { |
| | | if (e.key === 'thaw') { |
| | | this.handleThaw() |
| | | } else if (e.key === 'paste') { |
| | | this.setState({pasteVisible: true}) |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | }) |
| | | } |
| | | |
| | | handleMenuClick = e => { |
| | | if (e.key === 'thaw') { |
| | | this.handleThaw() |
| | | } else if (e.key === 'paste') { |
| | | this.setState({pasteVisible: true}) |
| | | } |
| | | } |
| | | |
| | | render() { |
| | | const { MenuID } = this.props |
| | | const { dict } = this.state |
| | | const menu = ( |
| | | <Menu onClick={this.handleMenuClick}> |
| | | {MenuID ? <Menu.Item key="thaw"><Icon type="unlock" />{dict['header.form.thawbutton']}</Menu.Item> : null} |
| | | <Menu.Item key="paste"><Icon type="snippets" />{dict['header.form.paste']}</Menu.Item> |
| | | </Menu> |
| | | ) |
| | | |
| | | return ( |
| | | <div style={{display: 'inline-block'}}> |
| | | <Dropdown overlay={menu} overlayClassName="edit-component-box"> |
| | | <span style={{color: '#1890ff', display: 'inline-block', height: 25}}> |
| | | {dict['model.edit']} <Icon type="down" /> |
| | | </span> |
| | | </Dropdown> |
| | | {MenuID ? <Button className="mk-border-green" onClick={this.handleThaw} icon="unlock">{dict['header.form.thawbutton']}</Button> : null} |
| | | <Button style={{borderColor: '#40a9ff', color: '#40a9ff'}} onClick={() => this.setState({pasteVisible: true})} icon="snippets">{dict['header.form.paste']}</Button> |
| | | {/* 解冻按钮模态框 */} |
| | | <Modal |
| | | title={dict['header.form.thawbutton']} |
| | |
| | | isSystem: true |
| | | }, |
| | | { |
| | | title: '角色权限分配', |
| | | type: 'RolePermission', |
| | | url: rolemanage, |
| | | isSystem: true, |
| | | hidden: true |
| | | }, |
| | | { |
| | | title: '外部页面', |
| | | type: 'NewPage', |
| | | url: customImg, |
| | | baseconfig: '', |
| | | isSystem: true |
| | | }, |
| | | { |
| | | title: '角色权限分配', |
| | | type: 'RolePermission', |
| | | url: rolemanage, |
| | | isSystem: true, |
| | | hidden: true |
| | | } |
| | | ] |
| | | |
| | |
| | | visible: false, |
| | | subVisible: false, |
| | | transcolumns: [ |
| | | { title: '传输号', dataIndex: 'VersionName', key: 'VersionName', align: 'left' }, |
| | | { title: '传输号', dataIndex: 'VersionName', key: 'VersionName', align: 'left', render: (text, record) => ( |
| | | <Paragraph copyable={{text}}>{text}</Paragraph> |
| | | )}, |
| | | { title: '说明', dataIndex: 'ProgramName', key: 'ProgramName', align: 'left' }, |
| | | { title: '状态', dataIndex: 'StatusName', key: 'StatusName', align: 'left' }, |
| | | { title: '创建时间', dataIndex: 'CreateDate', key: 'CreateDate', align: 'left' }, |
| | |
| | | width: 250px; |
| | | float: right; |
| | | } |
| | | .ant-typography, .ant-typography p { |
| | | margin-bottom: 0; |
| | | } |
| | | } |
| | | .trans-table.no-footer { |
| | | .ant-pagination { |
| | |
| | | let keys = Object.keys(param).sort() |
| | | let values = '' |
| | | keys.forEach(key => { |
| | | if (key.toLowerCase() === 'rduri' || key.toLowerCase() === 't') return |
| | | if (param[key] === undefined) { |
| | | if (key.toLowerCase() === 'rduri') return |
| | | if (key.toLowerCase() === 't' || key.toLowerCase() === 'sign' || param[key] === undefined) { |
| | | delete param[key] |
| | | } else if (typeof(param[key]) === 'object') { |
| | | return |
| | | } |
| | | |
| | | if (typeof(param[key]) === 'object') { |
| | | values += key + JSON.stringify(param[key]) |
| | | } else { |
| | | if (param[key] && /: =$/.test(param[key])) { |
| | | param[key] = param[key].replace(/: =$/, '==') |
| | | } |
| | | values += key + param[key] |
| | | } |
| | | }) |
| | |
| | | <Button type="primary" onClick={this.send}>Send</Button> |
| | | <Button onClick={this.save}>Save</Button> |
| | | </div> |
| | | <Tabs animated={false}> |
| | | <Tabs animated={false} defaultActiveKey={hasBody ? 'Body' : 'Params'}> |
| | | <Tabs.TabPane forceRender={true} tab={<span className={hasParam ? 'active' : ''}>Params</span>} key="Params"> |
| | | <EditTable data={config.params} onChange={this.changeParams}/> |
| | | </Tabs.TabPane> |
| | |
| | | <div className="response"> |
| | | {response ? <div className="header"> |
| | | {body ? 'Body' : 'Response'} |
| | | {status ? <span className="status">Status: <span className={status === '200OK' ? 'green' : ''}>{status}</span></span> : null} |
| | | {status ? <span className="status">Status: <span className={status === '200OK' ? 'green' : 'yellow'}>{status}</span></span> : null} |
| | | </div> : <div className="header"> |
| | | Response |
| | | <span className="empty">Hit the Send button to get a response.</span> |
| | |
| | | span.green { |
| | | color: #26C281; |
| | | } |
| | | span.yellow { |
| | | color: #fa541c; |
| | | } |
| | | } |
| | | } |
| | | } |