Commit ed4331b3 authored by Sixiang_Zzb's avatar Sixiang_Zzb

LIFE用户管理处理完成

parent f6dae9f3
......@@ -12,11 +12,11 @@ export default {
changeOrigin: true,
pathRewrite: { '^': '' },
},
/*'/api/': {
target: 'http://localhost:8080',
changeOrigin: true,
pathRewrite: { '^': '' },
},*/
// '/api/': {
// target: 'http://localhost:8080',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
'/res/': {
target: 'http://mapleonlyone.top',
changeOrigin: true,
......@@ -27,28 +27,28 @@ export default {
changeOrigin: true,
pathRewrite: { '^': '' },
},
/* '/tos/': {
target: 'http://47.74.233.180:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},*/
'/tos/': {
target: 'http://localhost:8651',
target: 'http://47.74.233.180:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},
// '/tos/': {
// target: 'http://localhost:8651',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
},
test: {
/* '/api/': {
target: 'https://preview.pro.ant.design',
changeOrigin: true,
pathRewrite: { '^': '' },
},*/
'/api/': {
target: 'http://localhost:8080',
target: 'https://preview.pro.ant.design',
changeOrigin: true,
pathRewrite: { '^': '' },
},
// '/api/': {
// target: 'http://localhost:8080',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
'/res/': {
target: 'http://mapleonlyone.top',
changeOrigin: true,
......@@ -59,16 +59,16 @@ export default {
changeOrigin: true,
pathRewrite: { '^': '' },
},
/* '/tos/': {
target: 'http://47.74.233.180:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},*/
'/tos/': {
target: 'http://localhost:8651',
target: 'http://47.74.233.180:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},
// '/tos/': {
// target: 'http://localhost:8651',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
},
pre: {
// '/api/': {
......@@ -91,10 +91,10 @@ export default {
changeOrigin: true,
pathRewrite: { '^': '' },
},
/* '/tos/': {
target: 'http://localhost:8651',
changeOrigin: true,
pathRewrite: { '^': '' },
},*/
// '/tos/': {
// target: 'http://localhost:8651',
// changeOrigin: true,
// pathRewrite: { '^': '' },
// },
},
};
......@@ -14,7 +14,7 @@ import { gray } from 'chalk';
import SearchOptionsCommnity from '../SearchOptions/SearchOptionsCommnity';
const TitleSearch = (props: any) => {
// console.log("===================================",props)
console.log("===================================", props)
const { dispatch, CommunityList } = props;
......
import React, { useState, useEffect,useRef} from 'react';
import { Input ,Tabs,Table,Result, Button} from 'antd';
import React, { useState, useEffect, useRef } from 'react';
import { Input, Tabs, Table, Result, Button } from 'antd';
const { TabPane } = Tabs;
import {connect,history} from 'umi';
import { connect, history } from 'umi';
import { getCookie } from '@/utils/method';
import { RA } from '@/utils/method';
const module="User"
const ResultPageFailed = (props:any) => {
const module = "User"
const ResultPageFailed = (props: any) => {
const { dispatch, Data } = props;
const formRef = useRef(null)
const [resultTime, setResultTime] = useState(3);
const backPage = () => {
history.go(-1)
}
......@@ -25,15 +24,15 @@ const ResultPageFailed = (props:any) => {
title="Error submit the file!"
subTitle={<p>server has been handled it ,please try again or back.</p>}
extra={[
<Button type="primary" key="ok" ><a href="http://47.74.233.180:8651/tos/excel/down?operator_id=123456" >Download</a></Button>, <Button key="back" onClick={backPage}>Back</Button>
<Button type="primary" key="ok" ><a href={"http://47.74.233.180:8651/tos/excel/down?operator_id=" + getCookie("id")}>Download</a></Button>, <Button key="back" onClick={backPage}>Back</Button>
]}
/>
</div>
);
};
function map(state:any) {
const { Data} = state[module]
return { Data}
function map(state: any) {
const { Data } = state[module]
return { Data }
}
export default connect(map)(ResultPageFailed);
......@@ -43,14 +43,16 @@ const Users = (props: any) => {
const [loading, setLoading] = useState(false)
const [fileUploading, setFileUploading] = useState(false)
const [pageNum, setPageNum] = useState(1)
const [readyData, setReadyData] = useState(null)
const [compent, setCompent] = useState({ loading: false, fileUploading: false })
const [TestData, setTestData] = useState(null)//{ rows: [], total:0,defaultCurrent:1 }
const [pageStart, setPageStart] = useState(false)
const [TestData, setTestData] = useState({})
// 存储当前页码
const [pageNum, setPageNum] = useState(1)
// 存储小区筛选条件
const [readyData, setReadyData] = useState(null as any)
// 表格模块
const columns = [
{ title: username, dataIndex: 'owerName', },
{ title: project, dataIndex: 'communityName', },
......@@ -70,12 +72,18 @@ const Users = (props: any) => {
},
];
// 上传的模块
const propsUpload = {
name: 'file',
action: () => { return "http://47.74.233.180:8651/tos/excel/upload?userId=" + getCookie("id") },
onChange(info) {
beforeUpload: (file: any) => {
if (file.type !== "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet") {
message.error(`${file.name} file format is incorrect!`);
}
return file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
},
onChange(info: any) {
console.log(info)
if (info.file.status == 'uploading') {
setFileUploading(true)
}
......@@ -95,46 +103,42 @@ const Users = (props: any) => {
showUploadList: false,
}
// 判断数据是否回来
useEffect(() => {
if (Data != null) {
setLoading(false)
console.log("核查的地方")
console.log(Data)
// console.log("核查的地方")
// console.log(Data)
}
}, [Data])
useEffect(() => {
//分页设置
if (location.query.pageNum != null) {
setPageNum(parseInt(location.query.pageNum))
} else {
setPageNum(1)
if (location.query.owerName) {
setTestData({
OwnerName: location.query.owerName
})
}
setPageNum(parseInt(location.query.pageNum) || 1)
// 前置数据
var tmp = filterObjbyTg(location.query, ["owerName", "pageNum"])
setReadyData(tmp)
//获取数据
setLoading(true)
//获取数据
RA(12, {
owerName: location.query.owerName != undefined ? (location.query.owerName) : null,
communityArray: TestData != null ? TestData : CommunityList,
pageNum,
owerName: location.query.owerName !== undefined ? (location.query.owerName) : null,
communityArray: readyData !== null ? readyData : CommunityList,
pageNum: location.query.pageNum || 1
}, module, dispatch);
console.log("发送请求了123123123123123")
}, [location])
const goToDetail = (values: any, e: any) => {
console.log(values, readyData, "137=========")
SA(values)
PAGE(curString, module3, dispatch)//保存页面参数
PAGE(readyData, module3, dispatch)//保存页面参数
history.push(location.pathname + '/Detail')
}
const goToEdit = (values: any, e: any) => {
SA(values)
PAGE(curString, module3, dispatch)
PAGE(readyData, module3, dispatch)
URL({ pathname: location.pathname + '/Edit', status: 1 }, module2, dispatch)
history.push(location.pathname + '/Edit')
}
......@@ -144,42 +148,63 @@ const Users = (props: any) => {
history.push(location.pathname + '/Add')
}
// LIFE用户管理页面的搜索按钮
const CallBackTitleSearch = (comment: any) => {
console.log("触发了按钮", comment)
setTestData(comment.serviceCommunityList)
// 将筛选条件存储起来
setReadyData(comment.serviceCommunityList)
setPageNum(1)
/*页面跳转*/
if (comment.OwnerName) {
history.push(location.pathname + urlEncode(filterObj({
owerName: comment.OwnerName,
pageNum: 1,
})))
} else {
history.push(location.pathname + urlEncode(filterObj({
pageNum: 1,
})))
}
}
const pageChange = (values: any) => {
// 将当前页码存储起来
setPageNum(values.current)
/*页面跳转*/
var tmp = filterObjbyTg(location.query, [])
tmp["pageNum"] = values.current
location.query.owerName ? tmp["owerName"] = location.query.owerName : null
history.push(location.pathname + urlEncode(tmp))
}
return (
<div className={styles.base}>
{/* 头部组件 */}
<TitleSearch listkey={["OwnerName"]} list={["Owner Name"]}
community={"serviceCommunityList"} onSubmit={CallBackTitleSearch} />
<TitleSearch
listkey={["OwnerName"]}
list={["Owner Name"]}
community={"serviceCommunityList"}
onSubmit={CallBackTitleSearch}
defaultValue={TestData}
checklist={pageData}
/>
{/* 内容组件 */}
<div className={styles.box2}>
<button className={styles.buttonAdd2} onClick={goToAdd}>Create New Owner</button>
<div className={styles.buttonAdd} >
<Upload {...propsUpload}>
<Button icon={compent.fileUploading ? null : <UploadOutlined />}>{compent.fileUploading ? <><Spin indicator={<LoadingOutlined style={{ fontSize: 16 }} spin />} /> Uploading</> : "Batch Upload"}</Button>
<Button icon={compent.fileUploading ? null : <UploadOutlined />}>
{compent.fileUploading ?
<>
<Spin indicator={<LoadingOutlined style={{ fontSize: 16 }} spin />} />
Uploading
</>
: "Batch Upload"}
</Button>
</Upload>
</div>
</div>
......
......@@ -111,19 +111,17 @@ const ServiceProviderManagement = (props: any) => {
//分页设置
if (location.query.pageNum != null) {
setPageNum(parseInt(location.query.pageNum))
TosTosServiceProviderGet({
...location.query,
serviceCommunityList: testData != null ? testData : CommunityList,
})
} else {
setPageNum(1)
//获取数据
setLoading(true)
}
TosTosServiceProviderGet({
...location.query,
serviceCommunityList: testData != null ? testData : CommunityList,
})
}
}, [location])
......
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