U web update

pull/22/head
vapao 2020-01-13 21:05:46 +08:00
parent 6bfe26943f
commit f813610116
12 changed files with 34 additions and 35 deletions

View File

@ -21,12 +21,12 @@ export default [
{title: '应用配置', auth: 'config.app.view', path: '/config/app'},
]
},
{icon: 'monitor', title: '监控中心', path: '/monitor'},
{icon: 'monitor', title: '监控中心', auth: 'monitor.monitor.view', path: '/monitor'},
{
icon: 'alert', title: '报警中心', child: [
{title: '报警历史', path: '/alarm/alarm'},
{title: '报警联系人', path: '/alarm/contact'},
{title: '报警联系组', path: '/alarm/group'},
icon: 'alert', title: '报警中心', auth: 'alarm.alarm.view|alarm.contact.view|alarm.group.view', child: [
{title: '报警历史', auth: 'alarm.alarm.view', path: '/alarm/alarm'},
{title: '报警联系人', auth: 'alarm.contact.view', path: '/alarm/contact'},
{title: '报警联系组', auth: 'alarm.group.view', path: '/alarm/group'},
]
},
{

View File

@ -35,9 +35,9 @@ class ComTable extends React.Component {
title: '操作',
render: info => (
<span>
<LinkButton onClick={() => store.showForm(info)}>编辑</LinkButton>
<LinkButton auth="alarm.contact.edit" onClick={() => store.showForm(info)}>编辑</LinkButton>
<Divider type="vertical"/>
<LinkButton onClick={() => this.handleDelete(info)}>删除</LinkButton>
<LinkButton auth="alarm.contact.del" onClick={() => this.handleDelete(info)}>删除</LinkButton>
</span>
)
}];

View File

@ -1,7 +1,7 @@
import React from 'react';
import { observer } from 'mobx-react';
import { Card, Input, Button } from 'antd';
import { SearchForm } from 'components';
import { SearchForm, AuthDiv } from 'components';
import ComTable from './Table';
import store from './store';
@ -16,9 +16,9 @@ export default observer(function () {
<Button type="primary" icon="sync" onClick={store.fetchRecords}>刷新</Button>
</SearchForm.Item>
</SearchForm>
<div style={{marginBottom: 16}}>
<AuthDiv auth="alarm.contact.add" style={{marginBottom: 16}}>
<Button type="primary" icon="plus" onClick={() => store.showForm()}>新建</Button>
</div>
</AuthDiv>
<ComTable/>
</Card>
)

View File

@ -55,9 +55,9 @@ class ComTable extends React.Component {
title: '操作',
render: info => (
<span>
<LinkButton onClick={() => store.showForm(info)}>编辑</LinkButton>
<LinkButton auth="alarm.group.edit" onClick={() => store.showForm(info)}>编辑</LinkButton>
<Divider type="vertical"/>
<LinkButton onClick={() => this.handleDelete(info)}>删除</LinkButton>
<LinkButton auth="alarm.group.del" onClick={() => this.handleDelete(info)}>删除</LinkButton>
</span>
)
}];

View File

@ -1,7 +1,7 @@
import React from 'react';
import { observer } from 'mobx-react';
import { Card, Input, Button } from 'antd';
import { SearchForm } from 'components';
import { SearchForm, AuthDiv } from 'components';
import ComTable from './Table';
import store from './store';
@ -16,9 +16,9 @@ export default observer(function () {
<Button type="primary" icon="sync" onClick={store.fetchRecords}>刷新</Button>
</SearchForm.Item>
</SearchForm>
<div style={{marginBottom: 16}}>
<AuthDiv auth="alarm.group.add" style={{marginBottom: 16}}>
<Button type="primary" icon="plus" onClick={() => store.showForm()}>新建</Button>
</div>
</AuthDiv>
<ComTable/>
</Card>
)

View File

@ -31,9 +31,9 @@ class ComTable extends React.Component {
title: '操作',
render: info => (
<span>
<LinkButton onClick={() => store.showForm(info)}>编辑</LinkButton>
<LinkButton auth="config.env.edit" onClick={() => store.showForm(info)}>编辑</LinkButton>
<Divider type="vertical"/>
<LinkButton onClick={() => this.handleDelete(info)}>删除</LinkButton>
<LinkButton auth="config.env.del" onClick={() => this.handleDelete(info)}>删除</LinkButton>
</span>
)
}];

View File

@ -1,7 +1,7 @@
import React from 'react';
import { observer } from 'mobx-react';
import { Card, Input, Button } from 'antd';
import { SearchForm } from 'components';
import { SearchForm, AuthDiv } from 'components';
import ComTable from './Table';
import store from './store';
@ -16,9 +16,9 @@ export default observer(function () {
<Button type="primary" icon="sync" onClick={store.fetchRecords}>刷新</Button>
</SearchForm.Item>
</SearchForm>
<div style={{marginBottom: 16}}>
<AuthDiv auth="config.env.add" style={{marginBottom: 16}}>
<Button type="primary" icon="plus" onClick={() => store.showForm()}>新建</Button>
</div>
</AuthDiv>
<ComTable/>
</Card>
)

View File

@ -1,11 +1,10 @@
import React from 'react';
import { observer } from 'mobx-react';
import { Link } from 'react-router-dom';
import { Table, Divider, Modal, message } from 'antd';
import ComForm from './Form';
import http from 'libs/http';
import store from './store';
import { LinkButton } from "components";
import { LinkButton, AuthLink } from "components";
@observer
class ComTable extends React.Component {
@ -32,11 +31,11 @@ class ComTable extends React.Component {
title: '操作',
render: info => (
<span>
<LinkButton onClick={() => store.showForm(info)}>编辑</LinkButton>
<LinkButton auth="config.src.edit" onClick={() => store.showForm(info)}>编辑</LinkButton>
<Divider type="vertical"/>
<LinkButton onClick={() => this.handleDelete(info)}>删除</LinkButton>
<LinkButton auth="config.src.del" onClick={() => this.handleDelete(info)}>删除</LinkButton>
<Divider type="vertical"/>
<Link to={`/config/setting/src/${info.id}`}>配置</Link>
<AuthLink auth="config.src.view_config" to={`/config/setting/src/${info.id}`}>配置</AuthLink>
</span>
)
}];

View File

@ -1,7 +1,7 @@
import React from 'react';
import { observer } from 'mobx-react';
import { Card, Input, Button } from 'antd';
import { SearchForm } from 'components';
import { SearchForm, AuthDiv } from 'components';
import ComTable from './Table';
import store from './store';
@ -16,9 +16,9 @@ export default observer(function () {
<Button type="primary" icon="sync" onClick={store.fetchRecords}>刷新</Button>
</SearchForm.Item>
</SearchForm>
<div style={{marginBottom: 16}}>
<AuthDiv auth="config.src.add" style={{marginBottom: 16}}>
<Button type="primary" icon="plus" onClick={() => store.showForm()}>新建</Button>
</div>
</AuthDiv>
<ComTable/>
</Card>
)

View File

@ -85,11 +85,11 @@ class ComTable extends React.Component {
title: '操作',
render: info => (
<span>
<LinkButton onClick={() => this.handleActive(info)}>{info['is_active'] ? '禁用' : '启用'}</LinkButton>
<LinkButton auth="monitor.monitor.edit" onClick={() => this.handleActive(info)}>{info['is_active'] ? '禁用' : '启用'}</LinkButton>
<Divider type="vertical"/>
<LinkButton onClick={() => store.showForm(info)}>编辑</LinkButton>
<LinkButton auth="monitor.monitor.edit" onClick={() => store.showForm(info)}>编辑</LinkButton>
<Divider type="vertical"/>
<LinkButton onClick={() => this.handleDelete(info)}>删除</LinkButton>
<LinkButton auth="monitor.monitor.del" onClick={() => this.handleDelete(info)}>删除</LinkButton>
</span>
),
width: 180

View File

@ -1,6 +1,6 @@
import React from 'react';
import { Card, Input, Select, Button } from 'antd';
import { SearchForm } from 'components';
import { SearchForm, AuthDiv } from 'components';
import ComTable from './Table';
import store from './store';
@ -24,9 +24,9 @@ export default function () {
<Button type="primary" icon="sync" onClick={store.fetchRecords}>刷新</Button>
</SearchForm.Item>
</SearchForm>
<div style={{marginBottom: 16}}>
<AuthDiv auth="monitor.monitor.add" style={{marginBottom: 16}}>
<Button type="primary" icon="plus" onClick={() => store.showForm()}>新建</Button>
</div>
</AuthDiv>
<ComTable/>
</Card>
)

View File

@ -107,7 +107,7 @@ export default [{
key: 'monitor',
label: '监控中心',
pages: [{
key: '监控中心',
key: 'monitor',
label: '监控中心',
perms: [
{key: 'view', label: '查看监控'},