Commit aa62b187 authored by maple's avatar maple

[new]作业中

parent 46efa679
...@@ -211,9 +211,12 @@ export default defineConfig({ ...@@ -211,9 +211,12 @@ export default defineConfig({
icon:'UserSwitchOutlined', icon:'UserSwitchOutlined',
routes: [ routes: [
{ {
path: '/AccountManagement/AccountManagement', path: './AccountManagement',
name: 'accountmanagement1', name: 'accountmanagement1',
component:'./AccountManagement/AccountManagement/AccountManagement' routes: [
{path:'./',component: './AccountManagement/AccountManagement/Account'},
{path: './AccountManagementEdit',component:'./AccountManagement/AccountManagement/AccountManagement'},
]
}, },
{ {
path: '/AccountManagement/CompanyInformation', path: '/AccountManagement/CompanyInformation',
......
...@@ -37,9 +37,14 @@ export default { ...@@ -37,9 +37,14 @@ export default {
pathRewrite: { '^': '' }, pathRewrite: { '^': '' },
}, },
'/tos/': { '/tos/': {
target: 'http://localhost:8651', target: 'http://47.74.233.180:8651',
changeOrigin: true, changeOrigin: true,
pathRewrite: { '^': '' }, pathRewrite: { '^': '' },
}, },
// '/tos/': {
// target: 'http://localhost:8651',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
}, },
}; };
import { stringify } from 'querystring'; import { stringify } from 'querystring';
import { history, Reducer, Effect } from 'umi'; import { history, Reducer, Effect } from 'umi';
import { fakeAccountLogin } from '@/services/login'; import { AccountLogin } from '@/services/login';
import { setAuthority } from '@/utils/authority'; import { setAuthority } from '@/utils/authority';
import { getPageQuery } from '@/utils/utils'; import { getPageQuery } from '@/utils/utils';
...@@ -32,7 +32,7 @@ const Model: LoginModelType = { ...@@ -32,7 +32,7 @@ const Model: LoginModelType = {
effects: { effects: {
*login({ payload }, { call, put }) { *login({ payload }, { call, put }) {
const response = yield call(fakeAccountLogin, payload); const response = yield call(AccountLogin, payload);
yield put({ yield put({
type: 'changeLoginStatus', type: 'changeLoginStatus',
payload: response, payload: response,
......
@import '~antd/lib/style/themes/default.less';
//基石
.base {
width: 100%;
background-color: #ffffff;
padding: 34px;
}
//边栏1
//头部组件
.box{
width: 100%;
height: 64px;
position: relative;
}
.input{
width:200px;
height:32px;
background:none;
outline: none;
border:1px solid rgba(217,217,217,1);
border-radius:2px;
font-size:14px;
font-weight:400;
line-height:30px;
text-indent: 19px;
}
.item1{
.input();
}
.item2{
.input();
margin-left: 20px;
}
.item3{
width:80px;
height:32px;
border:1px solid rgba(24,144,255,1);
border-radius:2px;
background-color:#e7f4ff;
outline: none;
font-size:14px;
font-weight:400;
color:rgba(24,144,255,1);
line-height:30px;
cursor: pointer;
margin-top: 16px;
}
.item3:active{
background-color:#ffffff;
}
//边栏2
.box2{
width: 100%;
height: 40px;
margin-top: 0px;
position: relative;
}
//小组件1
.buttonLine{
width:200px;
height:32px;
border:none;
background:none;
outline: none;
font-size:14px;
font-weight:400;
line-height:30px;
cursor: pointer;
}
.buttonWait{
.buttonLine();
border-bottom:2px solid#dedede;
color:#454545;
}
.buttonWait:hover{
border-bottom:3px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
}
.buttonChoose{
.buttonLine();
border-bottom:3px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
}
.buttonAdd{
background:none;
outline: none;
cursor: pointer;
font-size:14px;
width:154px;
height:32px;
border:1px solid rgba(24,144,255,1);
color:rgba(24,144,255,1);
border-radius:2px;
position: absolute;
right: 0;
}
.buttonAdd2{
.buttonAdd();
right: 168px;
}
import React, { useState, useEffect,useRef} from 'react';
import styles from './Account.less';
import {Form, Input ,Button,Table,Space} from 'antd';
import { Link, useIntl, connect, Dispatch,history } from 'umi';
import SelectOptions from '../../../components/SelectOptions/index';
const Account = (props: any) => {
const { formatMessage } = useIntl();
const { dispatch, location,Data,CommunityList} = props;
const get = (values:any) => {dispatch({type: 'ServiceProvider/get',playload:values})};
useEffect(() => {
get(null)
}, []);
const formRef = useRef(null);
const onFinish = (values: any) => {get(values)};
const onFinishFailed = (errorInfo: any) => { console.log('Failed:', errorInfo) };
const goToDetail = (values:any,e:any) => {
history.push(location.pathname +'/Detail?providerName='+values.providerName)
}
const goToCreate = () => {
history.push(location.pathname + '/AccountManagementEdit')
}
const goToEdit = (values:any,e:any) => {
history.push(location.pathname + '/Edit?providerName='+values.providerName)
}
const goToServices = () => {history.push(location.pathname +'/Services')}
const pagination={defaultCurrent:1,total: 16}
const columns = [
{ title: "Service Provider",dataIndex: 'providerName',},
{ title: "Contacts",dataIndex: 'contactPhone',},
{ title: "Contact Details",dataIndex: 'contactEmail',},
{ title: "Services Available",dataIndex: 'enable',},
{ title: "Account Status",dataIndex: 'enable',},
{ title: "Actions",
render: (text: any, record: any) => (
<Space size="middle"><a onClick={goToDetail.bind(this,record)}>Detail</a><a onClick={goToEdit.bind(this,record)}>edit</a></Space>
),
},
];
const dataSource = (values:any) => {
let tmp = values;
return tmp;
}
return (
<div className={styles.base}>
{/* 头部组件 */}
<Form ref={formRef} name="basic" initialValues={{}} onFinish={onFinish} onFinishFailed={onFinishFailed}>
<div className={styles.box}>
<Form.Item name="providerName" ><Input placeholder="Service Provider" /></Form.Item>
<Form.Item name="providerName" ><Input placeholder="Service Provider" /></Form.Item>
</div>
</Form>
{/* 内容组件 */}
<div className={styles.box2}>
<Button className={styles.buttonAdd} onClick={goToCreate}>create new</Button>
</div>
{/* 列表组件 */}
<Table size="small" rowKey={"id"} style={{ marginTop: 16 }} columns={columns} dataSource={Data.data!=null?dataSource(Data.data.rows):null} pagination={pagination} />
</div>
);
};
function mapStateToProps(state:any) {
const { Data } = state.ServiceProvider;
const { CommunityList } = state.Init;
console.log(CommunityList)
return {
Data,
CommunityList
};
}
export default connect(mapStateToProps)(Account);
...@@ -7,6 +7,8 @@ import { Link, useIntl, connect, Dispatch } from 'umi'; ...@@ -7,6 +7,8 @@ import { Link, useIntl, connect, Dispatch } from 'umi';
import SelectOptions from '../../../components/SelectOptions/index'; import SelectOptions from '../../../components/SelectOptions/index';
import TreeAction from '../../../components/TreeAction/TreeAction'; import TreeAction from '../../../components/TreeAction/TreeAction';
import TitleBack from '../../../components/TitleBack/TitleBack';
const printContent = (comment: any)=>{ const printContent = (comment: any)=>{
console.log(comment) console.log(comment)
} }
...@@ -24,10 +26,7 @@ const AccountManagement = () => { ...@@ -24,10 +26,7 @@ const AccountManagement = () => {
<div className={styles.base}> <div className={styles.base}>
{/* 头部组件 */} {/* 头部组件 */}
<div className={styles.box}> <TitleBack title="Admin Account Adding" />
<div className={styles.item1}>Add Admin Account</div>
<button className={styles.item3}>返回</button>
</div>
<div className={styles.box1}> <div className={styles.box1}>
<div className={styles.box1item1}>Account ID</div> <div className={styles.box1item1}>Account ID</div>
......
...@@ -90,6 +90,7 @@ const ServiceProviderManagement = (props: any) => { ...@@ -90,6 +90,7 @@ const ServiceProviderManagement = (props: any) => {
function mapStateToProps(state:any) { function mapStateToProps(state:any) {
const { Data } = state.ServiceProvider; const { Data } = state.ServiceProvider;
const { CommunityList } = state.Init; const { CommunityList } = state.Init;
console.log(CommunityList)
return { return {
Data, Data,
CommunityList CommunityList
......
...@@ -30,7 +30,7 @@ const Login: React.FC<LoginProps> = (props) => { ...@@ -30,7 +30,7 @@ const Login: React.FC<LoginProps> = (props) => {
console.log({ ...values, type,userName,password }) console.log({ ...values, type,userName,password })
dispatch({ dispatch({
type: 'login/login', type: 'login/login',
payload: { ...values, type,userName,password }, payload: {userName,password },
}); });
}; };
const usernameHandle = (e: any) => { const usernameHandle = (e: any) => {
......
...@@ -17,3 +17,10 @@ export async function fakeAccountLogin(params: LoginParamsType) { ...@@ -17,3 +17,10 @@ export async function fakeAccountLogin(params: LoginParamsType) {
export async function getFakeCaptcha(mobile: string) { export async function getFakeCaptcha(mobile: string) {
return request(`/api/login/captcha?mobile=${mobile}`); return request(`/api/login/captcha?mobile=${mobile}`);
} }
export async function AccountLogin(params: LoginParamsType) {
return request('/tos/user/login', {
method: 'POST',
data: params,
});
}
\ No newline at end of file
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