xiaoct 7 роки тому
батько
коміт
2ba595911b

+ 6 - 6
src/components/chart/distributeBox.jsx

@@ -1,5 +1,5 @@
 import React from 'react'
 import React from 'react'
-import { Modal, Table, Col, Row, Button, Input, Icon, Switch} from 'antd'
+import { Modal, Table, Col, Row, Button, Input, Icon, Switch, Tag} from 'antd'
 import { connect } from 'dva'
 import { connect } from 'dva'
 import DistributeObjectBox from './distributeObjectBox';
 import DistributeObjectBox from './distributeObjectBox';
 import DistributePolicyRuleBox from './distributePolicyRuleBox';
 import DistributePolicyRuleBox from './distributePolicyRuleBox';
@@ -45,8 +45,8 @@ class DistributeBox extends React.Component {
             dataIndex: 'targets',
             dataIndex: 'targets',
             render: targets => {return (
             render: targets => {return (
                 <div>
                 <div>
-                    {targets.map((item, index) => {return <p key={index}>{item.value}</p>})}
-                    <Button onClick={() => {this.setState({visibleDistributeObjectBox: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>
                 </div>
             )}
             )}
         }, {
         }, {
@@ -55,20 +55,20 @@ class DistributeBox extends React.Component {
             render: rowFilters => {return (
             render: rowFilters => {return (
                 <div>
                 <div>
                     {rowFilters.map((filter, index) => {return <p key={index}>{filter.value}</p>})}
                     {rowFilters.map((filter, index) => {return <p key={index}>{filter.value}</p>})}
-                    <Button onClick={() => {this.setState({visibleDistributePolicyRuleBox:true})}}>设置规则</Button>
+                    <Tag onClick={() => {this.setState({visibleDistributePolicyRuleBox:true})}}><Icon type='plus'/></Tag>
                 </div>
                 </div>
             )}
             )}
         }, {
         }, {
             title: '操作',
             title: '操作',
             dataIndex: 'operation',
             dataIndex: 'operation',
-            render: () => { return <span>预览  删除</span>}
+            render: () => { return <span>删除</span>}
         }]
         }]
         
         
         const data = [{
         const data = [{
             key: '1',
             key: '1',
             enabled: true,
             enabled: true,
             policyName: '分发策略1',
             policyName: '分发策略1',
-            targets: [{value:'部门为销售'}, {value:'部门为售后'}],
+            targets: [{isGroup: true, value:'销售'}, {isGroup: false, value:'陈炜'}],
             rowFilters: [{value:'部门字段包含售后,销售'}, {value:'公司名包含公司A'}],
             rowFilters: [{value:'部门字段包含售后,销售'}, {value:'公司名包含公司A'}],
             columns: [{name:'department', alias:'部门', enabled: true}, {name:'company', alias:'公司', enabled: false}]
             columns: [{name:'department', alias:'部门', enabled: true}, {name:'company', alias:'公司', enabled: false}]
         }];
         }];

+ 6 - 6
src/components/dashboard/distributeBox.jsx

@@ -1,5 +1,5 @@
 import React from 'react'
 import React from 'react'
-import { Modal, Table, Col, Row, Button, Input, Icon, Switch} from 'antd'
+import { Modal, Table, Col, Row, Button, Input, Icon, Switch, Tag} from 'antd'
 import { connect } from 'dva'
 import { connect } from 'dva'
 import DistributeObjectBox from './distributeObjectBox';
 import DistributeObjectBox from './distributeObjectBox';
 import DistributePolicyRuleBox from './distributePolicyRuleBox';
 import DistributePolicyRuleBox from './distributePolicyRuleBox';
@@ -45,8 +45,8 @@ class DistributeBox extends React.Component {
             dataIndex: 'targets',
             dataIndex: 'targets',
             render: targets => {return (
             render: targets => {return (
                 <div>
                 <div>
-                    {targets.map((item, index) => {return <p key={index}>{item.value}</p>})}
-                    <Button onClick={() => {this.setState({visibleDistributeObjectBox: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>
                 </div>
             )}
             )}
         }, {
         }, {
@@ -55,20 +55,20 @@ class DistributeBox extends React.Component {
             render: rowFilters => {return (
             render: rowFilters => {return (
                 <div>
                 <div>
                     {rowFilters.map((filter, index) => {return <p key={index}>{filter.value}</p>})}
                     {rowFilters.map((filter, index) => {return <p key={index}>{filter.value}</p>})}
-                    <Button onClick={() => {this.setState({visibleDistributePolicyRuleBox:true})}}>设置规则</Button>
+                    <Tag onClick={() => {this.setState({visibleDistributePolicyRuleBox:true})}}><Icon type='plus'/></Tag>
                 </div>
                 </div>
             )}
             )}
         }, {
         }, {
             title: '操作',
             title: '操作',
             dataIndex: 'operation',
             dataIndex: 'operation',
-            render: () => { return <span>预览  删除</span>}
+            render: () => { return <span>删除</span>}
         }]
         }]
         
         
         const data = [{
         const data = [{
             key: '1',
             key: '1',
             enabled: true,
             enabled: true,
             policyName: '分发策略1',
             policyName: '分发策略1',
-            targets: [{value:'部门为销售'}, {value:'部门为售后'}],
+            targets: [{isGroup: true, value:'销售'}, {isGroup: false, value:'贺骎伟'}],
             rowFilters: [{value:'部门字段包含售后,销售'}, {value:'公司名包含公司A'}],
             rowFilters: [{value:'部门字段包含售后,销售'}, {value:'公司名包含公司A'}],
             columns: [{name:'department', alias:'部门', enabled: true}, {name:'company', alias:'公司', enabled: false}]
             columns: [{name:'department', alias:'部门', enabled: true}, {name:'company', alias:'公司', enabled: false}]
         }];
         }];

+ 20 - 18
src/components/datasource/accessConfig.jsx

@@ -1,7 +1,7 @@
 import React from 'react'
 import React from 'react'
 import { connect } from 'dva'
 import { connect } from 'dva'
 import '../../models/dataSource'
 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 PolicyRuleBox from './policyRuleBox'
 import AccessObjectBox from './accessObjectBox'
 import AccessObjectBox from './accessObjectBox'
 
 
@@ -44,8 +44,8 @@ class DataSourceAccessConfig extends React.Component{
             render: targets => {
             render: targets => {
                 return (
                 return (
                     <div>
                     <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>
                     </div>
                 )
                 )
             }
             }
@@ -55,26 +55,28 @@ class DataSourceAccessConfig extends React.Component{
             render: rowFilters => {
             render: rowFilters => {
                 return (
                 return (
                     <div>
                     <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>
                     </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: '操作',
             title: '操作',
             dataIndex: 'operation',
             dataIndex: 'operation',
-            render: () => { return <span>预览  删除</span>}
+            render: () => { return <span>显示影响 删除</span>}
         }];
         }];
 
 
         const data = [{
         const data = [{
             key: '1',
             key: '1',
             enabled: true,
             enabled: true,
             policyName: '开放策略1',
             policyName: '开放策略1',
-            targets: [{ value: '部门为销售' }, { value: '部门为售后' }],
+            targets: [{ isGroup: true, value: '销售' }, { isGroup:false, value: '李嘉' }],
             rowFilters: [{ value: '部门字段包含售后,销售' }, { value: '公司名包含公司A' }],
             rowFilters: [{ value: '部门字段包含售后,销售' }, { value: '公司名包含公司A' }],
             columns: [{ name: 'department', alias: '部门', enabled: true }, { name: 'company', alias: '公司', enabled: false }]
             columns: [{ name: 'department', alias: '部门', enabled: true }, { name: 'company', alias: '公司', enabled: false }]
         }];
         }];
@@ -88,6 +90,11 @@ class DataSourceAccessConfig extends React.Component{
                     title={() => {
                     title={() => {
                         return (
                         return (
                             <div style={{ display: "flex", justifyContent: "space-between" }}>
                             <div style={{ display: "flex", justifyContent: "space-between" }}>
+                                <Col span={4}>
+                                    <Switch></Switch><span>完全开放数据源</span>
+                                </Col>
+                                <Col span={12}>
+                                </Col>
                                 <Col span={4}>
                                 <Col span={4}>
                                     <Search
                                     <Search
                                         style={{ display: "inline" }}
                                         style={{ display: "inline" }}
@@ -96,12 +103,7 @@ class DataSourceAccessConfig extends React.Component{
                                         enterButton
                                         enterButton
                                     />
                                     />
                                 </Col>
                                 </Col>
-                                <Col span={4}>
-                                    <Switch></Switch><span>完全开放</span>
-                                </Col>
-                                <Col span={8}>
-                                </Col>
-                                <Col span={4}>
+                                <Col span={4} style={{textAlign:'right'}}>
                                     <Button>新增策略</Button>
                                     <Button>新增策略</Button>
                                 </Col>
                                 </Col>
                             </div>)
                             </div>)