mirror of https://github.com/openspug/spug
fix issue
parent
08b5f03bda
commit
c49345be38
|
@ -15,7 +15,7 @@ import store from './store';
|
|||
@observer
|
||||
class TableView extends React.Component {
|
||||
lockIcon = <Tooltip title="私有配置应用专用,不会被其他应用获取到">
|
||||
<LockOutlined style={{marginRight: 5}} />
|
||||
<LockOutlined style={{marginRight: 5}}/>
|
||||
</Tooltip>;
|
||||
|
||||
columns = [{
|
||||
|
@ -47,8 +47,10 @@ class TableView extends React.Component {
|
|||
render: info => (
|
||||
<Action>
|
||||
<Action.Button auth={`config.${store.type}.edit_config`} onClick={() => store.showForm(info)}>编辑</Action.Button>
|
||||
<Action.Button auth={`config.${store.type}.edit_config`}
|
||||
onClick={() => this.handleDelete(info)}>删除</Action.Button>
|
||||
<Action.Button
|
||||
danger
|
||||
auth={`config.${store.type}.edit_config`}
|
||||
onClick={() => this.handleDelete(info)}>删除</Action.Button>
|
||||
</Action>
|
||||
)
|
||||
}];
|
||||
|
|
|
@ -5,20 +5,19 @@
|
|||
*/
|
||||
import React from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
import { Menu, Input, Button, PageHeader, Modal, Space, Radio } from 'antd';
|
||||
import { Menu, Input, Button, PageHeader, Modal, Space, Radio, Form } from 'antd';
|
||||
import {
|
||||
DiffOutlined,
|
||||
HistoryOutlined,
|
||||
NumberOutlined,
|
||||
SyncOutlined,
|
||||
TableOutlined,
|
||||
UnorderedListOutlined,
|
||||
PlusOutlined,
|
||||
PlusOutlined
|
||||
} from '@ant-design/icons';
|
||||
import envStore from '../environment/store';
|
||||
import styles from './index.module.css';
|
||||
import history from 'libs/history';
|
||||
import { SearchForm, AuthDiv, AuthButton, Breadcrumb } from 'components';
|
||||
import { AuthDiv, AuthButton, Breadcrumb } from 'components';
|
||||
import DiffConfig from './DiffConfig';
|
||||
import TableView from './TableView';
|
||||
import TextView from './TextView';
|
||||
|
@ -100,36 +99,31 @@ class Index extends React.Component {
|
|||
</Menu>
|
||||
</div>
|
||||
<div className={styles.right}>
|
||||
<SearchForm>
|
||||
<SearchForm.Item span={6} title="视图" style={{paddingLeft: 0}}>
|
||||
<Form layout="inline" style={{marginBottom: 16}}>
|
||||
<Form.Item label="视图" style={{paddingLeft: 0}}>
|
||||
<Radio.Group value={view} onChange={e => this.setState({view: e.target.value})}>
|
||||
<Radio.Button value="1"><TableOutlined title="表格视图"/></Radio.Button>
|
||||
<Radio.Button value="2"><UnorderedListOutlined title="文本视图"/></Radio.Button>
|
||||
<Radio.Button value="3"><NumberOutlined title="JSON视图"/></Radio.Button>
|
||||
</Radio.Group>
|
||||
</SearchForm.Item>
|
||||
<SearchForm.Item span={7} title="Key">
|
||||
</Form.Item>
|
||||
<Form.Item label="Key">
|
||||
<Input allowClear value={store.f_name} onChange={e => store.f_name = e.target.value} placeholder="请输入"/>
|
||||
</SearchForm.Item>
|
||||
<SearchForm.Item span={3}>
|
||||
<Button type="primary" icon={<SyncOutlined/>} onClick={this.handleRefresh}>刷新</Button>
|
||||
</SearchForm.Item>
|
||||
<SearchForm.Item span={8} style={{textAlign: 'right', padding: 0}}>
|
||||
<Space size="large">
|
||||
<AuthButton
|
||||
auth="config.app.edit_config|config.service.edit_config"
|
||||
disabled={view !== '1'}
|
||||
type="primary"
|
||||
icon={<PlusOutlined/>}
|
||||
onClick={() => store.showForm()}>新增配置</AuthButton>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{backgroundColor: 'orange', borderColor: 'orange'}}
|
||||
icon={<HistoryOutlined/>}
|
||||
onClick={store.showRecord}>更改历史</Button>
|
||||
</Space>
|
||||
</SearchForm.Item>
|
||||
</SearchForm>
|
||||
</Form.Item>
|
||||
<Space style={{flex: 1, justifyContent: 'flex-end'}}>
|
||||
<AuthButton
|
||||
auth="config.app.edit_config|config.service.edit_config"
|
||||
disabled={view !== '1'}
|
||||
type="primary"
|
||||
icon={<PlusOutlined/>}
|
||||
onClick={() => store.showForm()}>新增配置</AuthButton>
|
||||
<Button
|
||||
type="primary"
|
||||
style={{backgroundColor: 'orange', borderColor: 'orange'}}
|
||||
icon={<HistoryOutlined/>}
|
||||
onClick={store.showRecord}>更改历史</Button>
|
||||
</Space>
|
||||
</Form>
|
||||
|
||||
{view === '1' && <TableView/>}
|
||||
{view === '2' && <TextView ref={ref => this.textView = ref}/>}
|
||||
|
|
Loading…
Reference in New Issue