|
|
@@ -1,7 +1,7 @@
|
|
|
import React from 'react'
|
|
|
import { connect } from 'dva'
|
|
|
import '../../models/dataSource'
|
|
|
-import { Table, Input, Col, Button, Switch, Icon } from 'antd'
|
|
|
+import { Table, Input, Col, Button, Switch, Icon, Tag } from 'antd'
|
|
|
import PolicyRuleBox from './policyRuleBox'
|
|
|
import AccessObjectBox from './accessObjectBox'
|
|
|
|
|
|
@@ -44,8 +44,8 @@ class DataSourceAccessConfig extends React.Component{
|
|
|
render: targets => {
|
|
|
return (
|
|
|
<div>
|
|
|
- {targets.map((item,index) => { return <p key={index}>{item.value}</p> })}
|
|
|
- <Button onClick={() => {this.setState({visibleAccessObjectBox:true})}}>添加对象</Button>
|
|
|
+ {targets.map((item, index) => { return <Tag key={index}>{item.isGroup ? <Icon type='tags' /> : <Icon type='user' />}{item.value}</Tag> })}
|
|
|
+ <Tag onClick={() => { this.setState({ visibleDistributeObjectBox: true }) }}><Icon type='plus' /></Tag>
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
@@ -55,26 +55,28 @@ class DataSourceAccessConfig extends React.Component{
|
|
|
render: rowFilters => {
|
|
|
return (
|
|
|
<div>
|
|
|
- {rowFilters.map((filter, index) => { return <p key={index}>{filter.value}</p> })}
|
|
|
- <Button onClick={() => {this.setState({visiblePolicyRuleBox:true})}}>设置策略</Button>
|
|
|
+ {rowFilters.map((filter, index) => {return <p key={index}>{filter.value}</p>})}
|
|
|
+ <Tag onClick={() => {this.setState({visibleDistributePolicyRuleBox:true})}}><Icon type='plus'/></Tag>
|
|
|
</div>
|
|
|
)
|
|
|
}
|
|
|
- }, {
|
|
|
- title: '列开放策略',
|
|
|
- dataIndex: 'columns',
|
|
|
- render: columns => { return columns.filter((column) => !column.enabled).map((column, index) => { return (<span key={index}>全部开放</span>) }) }
|
|
|
- }, {
|
|
|
+ },
|
|
|
+ // {
|
|
|
+ // title: '列开放策略',
|
|
|
+ // dataIndex: 'columns',
|
|
|
+ // render: columns => { return columns.filter((column) => !column.enabled).map((column, index) => { return (<span key={index}>全部开放</span>) }) }
|
|
|
+ // },
|
|
|
+ {
|
|
|
title: '操作',
|
|
|
dataIndex: 'operation',
|
|
|
- render: () => { return <span>预览 删除</span>}
|
|
|
+ render: () => { return <span>显示影响 删除</span>}
|
|
|
}];
|
|
|
|
|
|
const data = [{
|
|
|
key: '1',
|
|
|
enabled: true,
|
|
|
policyName: '开放策略1',
|
|
|
- targets: [{ value: '部门为销售' }, { value: '部门为售后' }],
|
|
|
+ targets: [{ isGroup: true, value: '销售' }, { isGroup:false, value: '李嘉' }],
|
|
|
rowFilters: [{ value: '部门字段包含售后,销售' }, { value: '公司名包含公司A' }],
|
|
|
columns: [{ name: 'department', alias: '部门', enabled: true }, { name: 'company', alias: '公司', enabled: false }]
|
|
|
}];
|
|
|
@@ -88,6 +90,11 @@ class DataSourceAccessConfig extends React.Component{
|
|
|
title={() => {
|
|
|
return (
|
|
|
<div style={{ display: "flex", justifyContent: "space-between" }}>
|
|
|
+ <Col span={4}>
|
|
|
+ <Switch></Switch><span>完全开放数据源</span>
|
|
|
+ </Col>
|
|
|
+ <Col span={12}>
|
|
|
+ </Col>
|
|
|
<Col span={4}>
|
|
|
<Search
|
|
|
style={{ display: "inline" }}
|
|
|
@@ -96,12 +103,7 @@ class DataSourceAccessConfig extends React.Component{
|
|
|
enterButton
|
|
|
/>
|
|
|
</Col>
|
|
|
- <Col span={4}>
|
|
|
- <Switch></Switch><span>完全开放</span>
|
|
|
- </Col>
|
|
|
- <Col span={8}>
|
|
|
- </Col>
|
|
|
- <Col span={4}>
|
|
|
+ <Col span={4} style={{textAlign:'right'}}>
|
|
|
<Button>新增策略</Button>
|
|
|
</Col>
|
|
|
</div>)
|