Commit ed4331b3 authored by Sixiang_Zzb's avatar Sixiang_Zzb

LIFE用户管理处理完成

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