Commit 41846a1d by zhaochengxiang

修改问题

parent 618c0e07
...@@ -88,8 +88,6 @@ class AssetListCOM extends Component { ...@@ -88,8 +88,6 @@ class AssetListCOM extends Component {
onSubscribeModel(item, tableModelId) { onSubscribeModel(item, tableModelId) {
const { updateItems } = this.props; const { updateItems } = this.props;
item.subscribed = true;
updateItems && updateItems();
dispatch({ dispatch({
type: 'assets.subscribeTableModel', type: 'assets.subscribeTableModel',
...@@ -103,6 +101,18 @@ class AssetListCOM extends Component { ...@@ -103,6 +101,18 @@ class AssetListCOM extends Component {
} }
onApplyModel(item, tableModelId) {
dispatch({
type: 'assets.apply',
payload: {params: { tableModelId }},
callback: () => {
message.success("申请成功!");
}
});
}
apply= (columnPositions, reason, expireDate, fileList) => { apply= (columnPositions, reason, expireDate, fileList) => {
const { tableModel, activeBtn } = this.state; const { tableModel, activeBtn } = this.state;
...@@ -208,23 +218,33 @@ class AssetListCOM extends Component { ...@@ -208,23 +218,33 @@ class AssetListCOM extends Component {
); );
const getActions = (item) => { const getActions = (item) => {
let actions = []
if (subscribeTableModel) { if (subscribeTableModel) {
return [ actions.push(
item.subscribed ? ( <>
<Button size="small" type="link" icon="book" disabled> {
已订阅 item.subscribed ? (
</Button> <Button size="small" type="link" icon="book" disabled>
) : ( 已订阅
<Button </Button>
size="small" ) : (
type="link" <Button
icon="book" size="small"
onClick={this.onSubscribeModel.bind(this, item, item.tableModelId)} type="link"
> icon="book"
订阅 onClick={this.onSubscribeModel.bind(this, item, item.tableModelId)}
</Button> >
), 订阅
item.subscribed && subscrible && ( </Button>
)
}
</>
);
if (item.subscribed && subscrible) {
actions.push(
<Button <Button
size="small" size="small"
type="link" type="link"
...@@ -249,10 +269,32 @@ class AssetListCOM extends Component { ...@@ -249,10 +269,32 @@ class AssetListCOM extends Component {
> >
取消订阅 取消订阅
</Button> </Button>
), )
]; }
} }
return [];
actions.push(
<>
{
item.privileged ? (
<Button size="small" type="link" icon="setting" disabled>
已申请
</Button>
) : (
<Button
size="small"
type="link"
icon="setting"
onClick={this.onApplyModel.bind(this, item, item.tableModelId)}
>
权限申请
</Button>
)
}
</>
);
return actions;
}; };
const getIcon = (type) => { const getIcon = (type) => {
......
...@@ -137,7 +137,7 @@ export class DataDetail extends Component { ...@@ -137,7 +137,7 @@ export class DataDetail extends Component {
} }
}} }}
> >
申请 字段申请
</span> </span>
</Descriptions.Item> </Descriptions.Item>
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment