mirror of https://github.com/openspug/spug
A 新建发布申请选择应用支持过滤
parent
b175f51a33
commit
6da1371d28
|
@ -6,7 +6,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { Link } from 'react-router-dom';
|
import { Link } from 'react-router-dom';
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import { Modal, Button, Menu, Spin, Icon, Tooltip } from 'antd';
|
import { Modal, Button, Menu, Spin, Icon, Input, Tooltip } from 'antd';
|
||||||
import store from './store';
|
import store from './store';
|
||||||
import styles from './index.module.css';
|
import styles from './index.module.css';
|
||||||
import envStore from 'pages/config/environment/store';
|
import envStore from 'pages/config/environment/store';
|
||||||
|
@ -17,7 +17,8 @@ class SelectApp extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
this.state = {
|
this.state = {
|
||||||
env_id: 0
|
env_id: 0,
|
||||||
|
search: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -58,7 +59,10 @@ class SelectApp extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {env_id} = this.state;
|
const {env_id} = this.state;
|
||||||
const records = store.deploys.filter(x => x.env_id === Number(env_id));
|
let records = store.deploys.filter(x => x.env_id === Number(env_id));
|
||||||
|
if (this.state.search) {
|
||||||
|
records = records.filter(x => x['app_name'].toLowerCase().includes(this.state.search.toLowerCase()))
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<Modal
|
<Modal
|
||||||
visible
|
visible
|
||||||
|
@ -83,7 +87,14 @@ class SelectApp extends React.Component {
|
||||||
|
|
||||||
<div className={styles.right}>
|
<div className={styles.right}>
|
||||||
<Spin spinning={store.isLoading}>
|
<Spin spinning={store.isLoading}>
|
||||||
<div className={styles.title}>{lds.get(envStore.idMap, `${env_id}.name`)}</div>
|
<div className={styles.title}>
|
||||||
|
<div>{lds.get(envStore.idMap, `${env_id}.name`)}</div>
|
||||||
|
<Input.Search
|
||||||
|
allowClear
|
||||||
|
style={{width: 200}}
|
||||||
|
placeholder="请输入快速搜应用"
|
||||||
|
onChange={e => this.setState({search: e.target.value})}/>
|
||||||
|
</div>
|
||||||
{records.map(item => (
|
{records.map(item => (
|
||||||
<Tooltip key={item.id} title={store.refs[item.id] ? item['app_name'] : null}>
|
<Tooltip key={item.id} title={store.refs[item.id] ? item['app_name'] : null}>
|
||||||
<Button type="primary" className={styles.appBlock} onClick={() => this.handleClick(item)}>
|
<Button type="primary" className={styles.appBlock} onClick={() => this.handleClick(item)}>
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { observer } from 'mobx-react';
|
import { observer } from 'mobx-react';
|
||||||
import { Button, Select, DatePicker, Radio, Row, Col, Modal, Form, message } from 'antd';
|
import { Button, Select, DatePicker, Radio, Row, Col, Modal, Form, message } from 'antd';
|
||||||
import { SearchForm, AuthButton, AuthCard } from 'components';
|
import { SearchForm, AuthFragment, AuthCard } from 'components';
|
||||||
import SelectApp from './SelectApp';
|
import SelectApp from './SelectApp';
|
||||||
import Ext1Form from './Ext1Form';
|
import Ext1Form from './Ext1Form';
|
||||||
import Ext2Form from './Ext2Form';
|
import Ext2Form from './Ext2Form';
|
||||||
|
@ -91,18 +91,16 @@ class Index extends React.Component {
|
||||||
</Radio.Group>
|
</Radio.Group>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={8} style={{textAlign: 'right'}}>
|
<Col span={8} style={{textAlign: 'right'}}>
|
||||||
<AuthButton
|
<AuthFragment auth="deploy.request.del">
|
||||||
hide
|
<Button type="primary" icon="delete" onClick={this.handleBatchDel}>批量删除</Button>
|
||||||
type="primary"
|
</AuthFragment>
|
||||||
icon="delete"
|
<AuthFragment auth="deploy.request.add">
|
||||||
auth="deploy.request.del"
|
<Button
|
||||||
onClick={this.handleBatchDel} style={{marginRight: 20}}>批量删除</AuthButton>
|
type="primary"
|
||||||
<AuthButton
|
icon="plus"
|
||||||
hide
|
onClick={() => store.addVisible = true}
|
||||||
type="primary"
|
style={{marginLeft: 20}}>新建发布申请</Button>
|
||||||
icon="plus"
|
</AuthFragment>
|
||||||
auth="deploy.request.add"
|
|
||||||
onClick={() => store.addVisible = true}>新建发布申请</AuthButton>
|
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
<ComTable/>
|
<ComTable/>
|
||||||
|
|
|
@ -14,6 +14,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
color: rgba(0, 0, 0, .85);
|
color: rgba(0, 0, 0, .85);
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
|
|
Loading…
Reference in New Issue