提交 7b746a06 authored 作者: vipcxj's avatar vipcxj

clean ignored file

上级 2e8374a7
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
"padded-blocks": "off", "padded-blocks": "off",
"function-paren-newline": "off", "function-paren-newline": "off",
"jsx-a11y/anchor-is-valid": "off", "jsx-a11y/anchor-is-valid": "off",
"jsx-a11y/click-events-have-key-events": "off",
"no-multi-assign": "off", "no-multi-assign": "off",
"no-await-in-loop": "off", "no-await-in-loop": "off",
"prefer-destructuring": "off", "prefer-destructuring": "off",
......
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.tmp" />
<excludeFolder url="file://$MODULE_DIR$/temp" />
<excludeFolder url="file://$MODULE_DIR$/tmp" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
<component name="ProjectDictionaryState">
<dictionary name="yaohx_169" />
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="JavaScriptSettings">
<option name="languageLevel" value="JSX" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/app-manage-console.iml" filepath="$PROJECT_DIR$/.idea/app-manage-console.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RTProjectComponent">
<option name="nodeInterpreter" value="" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>
\ No newline at end of file
差异被折叠。
...@@ -3,8 +3,7 @@ import { authorize, login, userInfo } from '../services/login'; ...@@ -3,8 +3,7 @@ import { authorize, login, userInfo } from '../services/login';
import { validate as passValidate } from '../services/login/password'; import { validate as passValidate } from '../services/login/password';
import { requestCode, validate as ucaValidate } from '../services/login/uca'; import { requestCode, validate as ucaValidate } from '../services/login/uca';
import { encrypt } from '../utils/helper'; import { encrypt } from '../utils/helper';
import { setToken, setUser, setDomain, histories } from '../utils/auth'; import { setToken, setUser, histories } from '../utils/auth';
import { switchDomain, currentDomain } from '../services/domain';
import { errors } from '../utils/error'; import { errors } from '../utils/error';
import config from '../utils/config'; import config from '../utils/config';
import { getStore } from '../data/app'; import { getStore } from '../data/app';
...@@ -14,24 +13,12 @@ const successAuthed = async (tokenId, userName, remember) => { ...@@ -14,24 +13,12 @@ const successAuthed = async (tokenId, userName, remember) => {
await setToken(tokenId); await setToken(tokenId);
const uInfo = await userInfo(); const uInfo = await userInfo();
await setUser(uInfo.id, uInfo.name); await setUser(uInfo.id, uInfo.name);
const path = await histories.getLatest('domain', uInfo.id);
if (!path) {
getStore().dispatch(routerRedux.push('/domain'));
} else {
await switchDomain(path);
const domain = await currentDomain();
if (domain) {
await setDomain(domain.name, path);
const latest = await histories.getLatest('module', uInfo.id); const latest = await histories.getLatest('module', uInfo.id);
if (latest && config.fastNavigationPage) { if (latest && config.fastNavigationPage) {
getStore().dispatch(routerRedux.push('/fastNav')); getStore().dispatch(routerRedux.push('/fastNav'));
} else { } else {
getStore().dispatch(routerRedux.push('/main')); getStore().dispatch(routerRedux.push('/main'));
} }
} else {
getStore().dispatch(routerRedux.push('/domain'));
}
}
}; };
const processAuthRequirements = (requirements, supports) => { const processAuthRequirements = (requirements, supports) => {
......
...@@ -41,11 +41,9 @@ export default { ...@@ -41,11 +41,9 @@ export default {
throw new Error(response.message); throw new Error(response.message);
} }
const uploadURL = response.data[0]; const uploadURL = response.data[0];
console.log(uploadURL);
yield put({ type: 'queryUploadURL', payload: uploadURL }); yield put({ type: 'queryUploadURL', payload: uploadURL });
}, },
*addDeployApp({ payload: { values } }, { call, put }) { *addDeployApp({ payload: { values } }, { call, put }) {
console.log(values);
yield call(deployApp, values.idOrName, values.uri, values.description, values.release); yield call(deployApp, values.idOrName, values.uri, values.description, values.release);
const name = values.idOrName; const name = values.idOrName;
yield put({ type: 'getAppInfo', payload: { name } }); yield put({ type: 'getAppInfo', payload: { name } });
...@@ -55,7 +53,6 @@ export default { ...@@ -55,7 +53,6 @@ export default {
yield put({ type: 'getAppInfo', payload: { name } }); yield put({ type: 'getAppInfo', payload: { name } });
}, },
*editSaveDeploy({ payload: { values, name } }, { call, put }) { *editSaveDeploy({ payload: { values, name } }, { call, put }) {
console.log(values);
yield call(editDeployment, values.id, values.description, values.status); yield call(editDeployment, values.id, values.description, values.status);
yield put({ type: 'getAppInfo', payload: { name } }); yield put({ type: 'getAppInfo', payload: { name } });
}, },
......
...@@ -81,6 +81,7 @@ class HeaderPane extends React.Component { ...@@ -81,6 +81,7 @@ class HeaderPane extends React.Component {
} }
render() { render() {
const { dispatch, user, routes, params } = this.props; const { dispatch, user, routes, params } = this.props;
const nRoutes = normRoutes(routes);
const userTitle = ( const userTitle = (
<span> <span>
<Icon type="user" /> <Icon type="user" />
......
import React from 'react'; import React from 'react';
import { Button, Input, Form } from 'antd'; import { Button, Input, Form } from 'antd';
import { connect } from 'dva';
import styles from './add.less'; import styles from './add.less';
import { thisPush } from '../../../../services/route'; import { thisPush } from '../../../../services/route';
...@@ -74,4 +73,4 @@ class Add extends React.Component { ...@@ -74,4 +73,4 @@ class Add extends React.Component {
); );
} }
} }
export default connect(({ appInfo, loading }) => ({ appInfo, loading }))(Form.create()(Add)); export default Form.create()(Add);
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
import React from 'react'; import React from 'react';
import { uniqBy } from 'lodash'; import { uniqBy } from 'lodash';
import { Button, Input, Upload, Form, message, Icon, Modal, Radio } from 'antd'; import { Button, Input, Upload, Form, message, Icon, Modal, Radio } from 'antd';
import { connect } from 'dva';
import { encrypt } from '../../../../utils/helper'; import { encrypt } from '../../../../utils/helper';
import config from '../../../../utils/config'; import config from '../../../../utils/config';
import styles from './add.less'; import styles from './add.less';
...@@ -17,26 +16,24 @@ class AddDeploy extends React.Component { ...@@ -17,26 +16,24 @@ class AddDeploy extends React.Component {
state = { state = {
descriptionInfo: '', descriptionInfo: '',
radioValue: false, radioValue: false,
} };
componentDidMount() { componentDidMount() {
this.props.dispatch({ type: 'appInfo/getTokens' }); this.props.dispatch({ type: 'appInfo/getTokens' });
} }
onChangeInfo = (e) => { onChangeInfo = (e) => {
this.setState({ descriptionInfo: e.target.value }); this.setState({ descriptionInfo: e.target.value });
} };
onCancel = () => { onCancel = () => {
const { value } = this.props.location.state; const { value } = this.props.location.state;
console.log(value);
thisPush(this, { pathname: '../deploy', state: { value } }); thisPush(this, { pathname: '../deploy', state: { value } });
} };
onChange = (e) => { onChange = (e) => {
this.setState({ this.setState({
radioValue: e.target.value, radioValue: e.target.value,
}); });
} };
onSubmit = () => { onSubmit = () => {
const { descriptionInfo, radioValue } = this.state; const { descriptionInfo, radioValue } = this.state;
console.log(radioValue);
const { value } = this.props.location.state; const { value } = this.props.location.state;
const { uploadURL } = this.props.appInfo; const { uploadURL } = this.props.appInfo;
const name = value.name; const name = value.name;
...@@ -128,7 +125,7 @@ class AddDeploy extends React.Component { ...@@ -128,7 +125,7 @@ class AddDeploy extends React.Component {
<Button type="primary" icon="check" onClick={this.onSubmit}>提交</Button> <Button type="primary" icon="check" onClick={this.onSubmit}>提交</Button>
<Button type="primary" icon="close" onClick={this.onCancel}>取消</Button> <Button type="primary" icon="close" onClick={this.onCancel}>取消</Button>
<Upload {...props}> <Upload {...props}>
<Button type="primary" > <Button type="primary">
<Icon type="upload" /> 选择上传 <Icon type="upload" /> 选择上传
</Button> </Button>
</Upload> </Upload>
...@@ -138,4 +135,4 @@ class AddDeploy extends React.Component { ...@@ -138,4 +135,4 @@ class AddDeploy extends React.Component {
); );
} }
} }
export default connect(({ appInfo, loading }) => ({ appInfo, loading }))(Form.create()(AddDeploy)); export default Form.create()(AddDeploy);
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
* Created by zhouhuan on 2017/11/21. * Created by zhouhuan on 2017/11/21.
*/ */
import React from 'react'; import React from 'react';
import { connect } from 'dva';
import QRcode from 'qrcode'; import QRcode from 'qrcode';
import { Button, Table, Popconfirm, Modal } from 'antd'; import { Button, Table, Popconfirm, Modal } from 'antd';
import config from '../../../../utils/config'; import config from '../../../../utils/config';
...@@ -12,12 +11,47 @@ import styles from './list.less'; ...@@ -12,12 +11,47 @@ import styles from './list.less';
import { thisPush } from '../../../../services/route'; import { thisPush } from '../../../../services/route';
class Deploy extends React.Component { class Deploy extends React.Component {
static makeColumns() {
return [{
title: 'ID',
dataIndex: 'id',
}, {
title: '更新时间',
dataIndex: 'updateTime',
}, {
title: '状态',
dataIndex: 'status',
}, {
title: '版本号',
dataIndex: 'versionNumber',
}, {
title: '描述',
dataIndex: 'description',
}, {
title: 'uri',
dataIndex: 'uri',
}, {
title: '操作',
dataIndex: 'operation',
render: (text, record, index) => (
<span>
<span className="ant-divider" />
<a onClick={() => this.onEdit(record, index)}>Edit</a>
<span className="ant-divider" />
<Popconfirm title="确定删除?" okText="Yes" cancelText="No" onConfirm={() => this.onDelete(record, index)}>
<a>Delete</a>
</Popconfirm>
<span className="ant-divider" />
<a onClick={() => this.onQrcode(record, index)}>qrcode</a>
</span>
),
}];
}
state = { state = {
values: '',
urls: '', urls: '',
visible: false, visible: false,
completeUrl: '', completeUrl: '',
} };
componentDidMount() { componentDidMount() {
this.props.dispatch({ type: 'appInfo/getTokens' }); this.props.dispatch({ type: 'appInfo/getTokens' });
const { value } = this.props.location.state; const { value } = this.props.location.state;
...@@ -25,7 +59,6 @@ class Deploy extends React.Component { ...@@ -25,7 +59,6 @@ class Deploy extends React.Component {
this.props.dispatch({ type: 'appInfo/getAppInfo', payload: { name: value.name } }); this.props.dispatch({ type: 'appInfo/getAppInfo', payload: { name: value.name } });
} }
onDelete = (record) => { onDelete = (record) => {
console.log(record);
const id = record.id; const id = record.id;
const { value } = this.props.location.state; const { value } = this.props.location.state;
this.props.dispatch({ type: 'appInfo/removeDeployApp', payload: { id, name: value.name } }); this.props.dispatch({ type: 'appInfo/removeDeployApp', payload: { id, name: value.name } });
...@@ -45,64 +78,25 @@ class Deploy extends React.Component { ...@@ -45,64 +78,25 @@ class Deploy extends React.Component {
this.setState({ completeUrl }); this.setState({ completeUrl });
// console.log(completeUrl); // console.log(completeUrl);
QRcode.toDataURL(completeUrl, (err, url) => { QRcode.toDataURL(completeUrl, (err, url) => {
const qrcodeUrl = url; this.setState({ urls: url, visible: true });
this.setState({ urls: qrcodeUrl, visible: true });
}); });
// const w = window.open('about:blank'); // const w = window.open('about:blank');
// w.location.href = URL; // w.location.href = URL;
}; };
onClick = () => { onClick = () => {
const { value } = this.props.location.state; const { value } = this.props.location.state;
console.log(value);
thisPush(this, { pathname: '../addDeploy', state: { value } }); thisPush(this, { pathname: '../addDeploy', state: { value } });
}; };
handleOk = () => { handleOk = () => {
this.setState({ this.setState({
visible: false, visible: false,
}); });
} };
handleCancel = () => { handleCancel = () => {
this.setState({ this.setState({
visible: false, visible: false,
}); });
} };
makeColumns() {
const columns = [{
title: 'ID',
dataIndex: 'id',
}, {
title: '更新时间',
dataIndex: 'updateTime',
}, {
title: '状态',
dataIndex: 'status',
}, {
title: '版本号',
dataIndex: 'versionNumber',
}, {
title: '描述',
dataIndex: 'description',
}, {
title: 'uri',
dataIndex: 'uri',
}, {
title: '操作',
dataIndex: 'operation',
render: (text, record, index) => (
<span>
<span className="ant-divider" />
<a onClick={() => this.onEdit(record, index)}>Edit</a>
<span className="ant-divider" />
<Popconfirm title="确定删除?" okText="Yes" cancelText="No"onConfirm={() => this.onDelete(record, index)}>
<a>Delete</a>
</Popconfirm>
<span className="ant-divider" />
<a onClick={() => this.onQrcode(record, index)}>qrcode</a>
</span>
),
}];
return columns;
}
render() { render() {
const { allAppInfo } = this.props.appInfo; const { allAppInfo } = this.props.appInfo;
const { urls, visible, completeUrl } = this.state; const { urls, visible, completeUrl } = this.state;
...@@ -111,7 +105,7 @@ class Deploy extends React.Component { ...@@ -111,7 +105,7 @@ class Deploy extends React.Component {
allAppInfo.map(({ history }) => { allAppInfo.map(({ history }) => {
data = history.map(({ id, updateTime, status, versionNumber, description, uri }) => { data = history.map(({ id, updateTime, status, versionNumber, description, uri }) => {
const date = (new Date(updateTime)).toLocaleString(); const date = (new Date(updateTime)).toLocaleString();
const info = { return {
key: updateTime, key: updateTime,
id, id,
updateTime: date, updateTime: date,
...@@ -120,7 +114,6 @@ class Deploy extends React.Component { ...@@ -120,7 +114,6 @@ class Deploy extends React.Component {
description, description,
uri, uri,
}; };
return info;
}); });
return data; return data;
}); });
...@@ -132,7 +125,7 @@ class Deploy extends React.Component { ...@@ -132,7 +125,7 @@ class Deploy extends React.Component {
<Button type="primary" icon="plus" onClick={this.onClick}>新增</Button> <Button type="primary" icon="plus" onClick={this.onClick}>新增</Button>
</div> </div>
<div className={styles.divTable}> <div className={styles.divTable}>
<Table columns={this.makeColumns()} dataSource={data} /> <Table columns={Deploy.makeColumns()} dataSource={data} />
</div> </div>
<div> <div>
<Modal <Modal
...@@ -143,7 +136,7 @@ class Deploy extends React.Component { ...@@ -143,7 +136,7 @@ class Deploy extends React.Component {
footer={null} footer={null}
> >
<div style={{ textAlign: 'center' }}> <div style={{ textAlign: 'center' }}>
<img src={urls} /> <img src={urls} alt="二维码" />
<div> <div>
<a href={completeUrl} className={styles.a}>{completeUrl}</a> <a href={completeUrl} className={styles.a}>{completeUrl}</a>
</div> </div>
...@@ -156,5 +149,5 @@ class Deploy extends React.Component { ...@@ -156,5 +149,5 @@ class Deploy extends React.Component {
} }
} }
export default connect(({ appInfo, loading }) => ({ appInfo, loading }))(Deploy); export default Deploy;
import React from 'react'; import React from 'react';
import { Button, Input, Form } from 'antd'; import { Button, Input, Form } from 'antd';
import { connect } from 'dva';
import styles from './add.less'; import styles from './add.less';
import { thisPush } from '../../../../services/route'; import { thisPush } from '../../../../services/route';
...@@ -87,4 +86,4 @@ class Edit extends React.Component { ...@@ -87,4 +86,4 @@ class Edit extends React.Component {
); );
} }
} }
export default connect(({ appInfo, loading }) => ({ appInfo, loading }))(Form.create()(Edit)); export default Form.create()(Edit);
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
*/ */
import React from 'react'; import React from 'react';
import { Button, Input, Select, Form } from 'antd'; import { Button, Input, Select, Form } from 'antd';
import { connect } from 'dva';
import styles from './add.less'; import styles from './add.less';
import { thisPush } from '../../../../services/route'; import { thisPush } from '../../../../services/route';
...@@ -11,19 +10,13 @@ const FormItem = Form.Item; ...@@ -11,19 +10,13 @@ const FormItem = Form.Item;
const { TextArea } = Input; const { TextArea } = Input;
const Option = Select.Option; const Option = Select.Option;
class EditDeploy extends React.Component { class EditDeploy extends React.Component {
state = {
descriptionInfo: '',
}
componentDidMount() { componentDidMount() {
// this.props.dispatch({ type: 'appInfo/getTokens' }); // this.props.dispatch({ type: 'appInfo/getTokens' });
} }
onChangeInfo = (e) => {
this.setState({ descriptionInfo: e.target.value });
}
onCancel = () => { onCancel = () => {
const { value } = this.props.location.state; const { value } = this.props.location.state;
thisPush(this, { pathname: '../deploy', state: { value } }); thisPush(this, { pathname: '../deploy', state: { value } });
} };
handleSubmit = (e) => { handleSubmit = (e) => {
e.preventDefault(); e.preventDefault();
this.props.form.validateFields((err, values) => { this.props.form.validateFields((err, values) => {
...@@ -33,7 +26,7 @@ class EditDeploy extends React.Component { ...@@ -33,7 +26,7 @@ class EditDeploy extends React.Component {
thisPush(this, { pathname: '../deploy', state: { value } }); thisPush(this, { pathname: '../deploy', state: { value } });
} }
}); });
} };
render() { render() {
const { getFieldDecorator } = this.props.form; const { getFieldDecorator } = this.props.form;
const { record } = this.props.location.state; const { record } = this.props.location.state;
...@@ -98,4 +91,4 @@ class EditDeploy extends React.Component { ...@@ -98,4 +91,4 @@ class EditDeploy extends React.Component {
); );
} }
} }
export default connect(({ appInfo, loading }) => ({ appInfo, loading }))(Form.create()(EditDeploy)); export default Form.create()(EditDeploy);
/** /**
* Created by zhouhuan on 2017/11/20. * Created by zhouhuan on 2017/11/20.
*/ */
import { connect } from 'dva';
import { withRouter } from 'dva/router';
import List from './list'; import List from './list';
import Add from './add'; import Add from './add';
import Edit from './edit'; import Edit from './edit';
...@@ -10,38 +8,43 @@ import Deploy from './deploy'; ...@@ -10,38 +8,43 @@ import Deploy from './deploy';
import AddDeploy from './addDeploy'; import AddDeploy from './addDeploy';
import EditDeploy from './editDeploy'; import EditDeploy from './editDeploy';
import route from '../../../../components/hoc/routes'; import route from '../../../../components/hoc/routes';
import model from '../../../../models/main/modules/appManagement';
export default connect(({ appManagement }) => ({ appManagement }))(route({ // noinspection JSUnusedGlobalSymbols
export default (binder) => {
const connect = binder(model);
return route({
childRoutes: [ childRoutes: [
{ {
path: 'list', path: 'list',
name: '列表', name: '列表',
component: withRouter(List, { withRef: true }), component: connect(({ appInfo, loading }) => ({ appInfo, loading }))(List),
}, },
{ {
path: 'add', path: 'add',
name: '新增', name: '新增',
component: withRouter(Add, { withRef: true }), component: connect(({ appInfo, loading }) => ({ appInfo, loading }))(Add),
}, },
{ {
path: 'edit', path: 'edit',
name: '新增', name: '新增',
component: withRouter(Edit, { withRef: true }), component: connect(({ appInfo, loading }) => ({ appInfo, loading }))(Edit),
}, },
{ {
path: 'deploy', path: 'deploy',
name: '部署', name: '部署',
component: withRouter(Deploy, { withRef: true }), component: connect(({ appInfo, loading }) => ({ appInfo, loading }))(Deploy),
}, },
{ {
path: 'addDeploy', path: 'addDeploy',
name: '新增部署信息', name: '新增部署信息',
component: withRouter(AddDeploy, { withRef: true }), component: connect(({ appInfo, loading }) => ({ appInfo, loading }))(AddDeploy),
}, },
{ {
path: 'editDeploy', path: 'editDeploy',
name: '编辑部署信息', name: '编辑部署信息',
component: withRouter(EditDeploy, { withRef: true }), component: connect(({ appInfo, loading }) => ({ appInfo, loading }))(EditDeploy),
}, },
], ],
})); });
};
import React from 'react'; import React from 'react';
import { connect } from 'dva';
import { Button, Table, Popconfirm } from 'antd'; import { Button, Table, Popconfirm } from 'antd';
import styles from './list.less'; import styles from './list.less';
import { thisPush } from '../../../../services/route'; import { thisPush } from '../../../../services/route';
class List extends React.Component { class List extends React.Component {
state = { static makeColumns() {
values: '', return [{
}
componentDidMount() {
this.props.dispatch({ type: 'appInfo/getAppInfo', payload: { name: '' } });
}
onDelete = (record) => {
const name = record.name;
this.props.dispatch({ type: 'appInfo/delAppInfo', payload: { name } });
};
onEdit = (record) => {
console.log(record);
thisPush(this, { pathname: '../edit', state: { value: record } });
};
onDeploy = (record) => {
thisPush(this, { pathname: '../deploy', state: { value: record } });
this.props.dispatch({ type: 'appInfo/saveRecord', payload: { record } });
};
onClick = () => {
thisPush(this, { pathname: '../add', state: { value: '' } });
};
makeColumns() {
const columns = [{
title: '创建时间', title: '创建时间',
dataIndex: 'createTime', dataIndex: 'createTime',
}, { }, {
...@@ -47,7 +25,7 @@ class List extends React.Component { ...@@ -47,7 +25,7 @@ class List extends React.Component {
<span className="ant-divider" /> <span className="ant-divider" />
<a onClick={() => this.onEdit(record, index)}>Edit</a> <a onClick={() => this.onEdit(record, index)}>Edit</a>
<span className="ant-divider" /> <span className="ant-divider" />
<Popconfirm title="确定删除?" okText="Yes" cancelText="No"onConfirm={() => this.onDelete(record, index)}> <Popconfirm title="确定删除?" okText="Yes" cancelText="No" onConfirm={() => this.onDelete(record, index)}>
<a>Delete</a> <a>Delete</a>
</Popconfirm> </Popconfirm>
<span className="ant-divider" /> <span className="ant-divider" />
...@@ -55,20 +33,35 @@ class List extends React.Component { ...@@ -55,20 +33,35 @@ class List extends React.Component {
</span> </span>
), ),
}]; }];
return columns;
} }
componentDidMount() {
this.props.dispatch({ type: 'appInfo/getAppInfo', payload: { name: '' } });
}
onDelete = (record) => {
const name = record.name;
this.props.dispatch({ type: 'appInfo/delAppInfo', payload: { name } });
};
onEdit = (record) => {
thisPush(this, { pathname: '../edit', state: { value: record } });
};
onDeploy = (record) => {
thisPush(this, { pathname: '../deploy', state: { value: record } });
this.props.dispatch({ type: 'appInfo/saveRecord', payload: { record } });
};
onClick = () => {
thisPush(this, { pathname: '../add', state: { value: '' } });
};
render() { render() {
const { allAppInfo } = this.props.appInfo; const { allAppInfo } = this.props.appInfo;
const data = allAppInfo.map(({ createTime, name, packageName, description }) => { const data = allAppInfo.map(({ createTime, name, packageName, description }) => {
const date = (new Date(createTime)).toLocaleString(); const date = (new Date(createTime)).toLocaleString();
const info = { return {
key: createTime, key: createTime,
createTime: date, createTime: date,
name, name,
packageName, packageName,
description, description,
}; };
return info;
}); });
return ( return (
<div className={styles.wrapper}> <div className={styles.wrapper}>
...@@ -77,7 +70,7 @@ class List extends React.Component { ...@@ -77,7 +70,7 @@ class List extends React.Component {
<Button type="primary" icon="plus" onClick={this.onClick}>添加</Button> <Button type="primary" icon="plus" onClick={this.onClick}>添加</Button>
</div> </div>
<div className={styles.divTable}> <div className={styles.divTable}>
<Table columns={this.makeColumns()} dataSource={data} /> <Table columns={List.makeColumns()} dataSource={data} />
</div> </div>
</div> </div>
</div> </div>
...@@ -85,5 +78,5 @@ class List extends React.Component { ...@@ -85,5 +78,5 @@ class List extends React.Component {
} }
} }
export default connect(({ appInfo, loading }) => ({ appInfo, loading }))(List); export default List;
/** @module app */ /** @module app */
import _ from 'lodash'; import isNumber from 'lodash/isNumber';
import isFinite from 'lodash/isFinite';
import isString from 'lodash/isString';
import request from '../utils/request'; import request from '../utils/request';
import post from '../utils/post'; import post from '../utils/post';
import config from '../utils/config'; import config from '../utils/config';
const { isNumber, isFinite, isString } = _;
/** /**
* @typedef {Object} RestResponse * @typedef {Object} RestResponse
* @template T * @template T
......
...@@ -63,7 +63,7 @@ const config = { ...@@ -63,7 +63,7 @@ const config = {
basename, basename,
contextPath, contextPath,
apiContextPath, apiContextPath,
productId: 'big-machine-web-front', productId: 'app-manage-console',
fastNavigationPage: '', fastNavigationPage: '',
defaultDateFormat, defaultDateFormat,
defaultTimeFormat, defaultTimeFormat,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论