Commit b570b13b authored by maple's avatar maple Committed by MrShi

[fix]小区管理

(cherry picked from commit 817395e6)
parent 9a6d7464
......@@ -224,8 +224,11 @@ export default defineConfig({
/* {
path: './CellList',
name: 'celllist',
component:'./runTest/Template'
},*/
routes:[
{path:'./',component:'./CommunityManagement/CellList/CellList'}
]
},
*/
{
path: './housingList',
name: 'celllist',
......@@ -241,6 +244,9 @@ export default defineConfig({
/* {
path: './CommunityAnnouncement',
name: 'communityannouncement',
routes: [
{path:"./",component:'./CommunityManagement/CommunityAnnouncement/CommunityAnnouncement'}
]
component:'./runTest/Template'
},*/
{
......@@ -271,6 +277,9 @@ export default defineConfig({
/*{
path: './VisitorRecord',
name: 'visitorrecord',
routes: [
{path:"./",component:'./CommunityManagement/VisitorRecord/VisitorRecord'}
]
component:'./runTest/Template'
},*/
{
......
......@@ -16,7 +16,7 @@ const proSettings: DefaultSettings = {
menu: {
locale: true,
},
title: 'TOS_v1.0.5',
title: 'TOS_v1.0.6',
pwa: false,
iconfontUrl: '',
};
......
......@@ -85,7 +85,7 @@ const PictureOptionsRow = (props:any) => {
fileList={fileList}
onPreview={handlePreview}
onChange={handleChange}
disabled={props.disabled}
disabled={props.disabled}
beforeUpload={beforeUpload}
>
{fileList.length >= 8 ? null : (props.disabled?null:uploadButton)}
......
......@@ -20,8 +20,10 @@ const SearchOptionsCommnity = (props: any) => {
props.onSubmit(values);
}
return (
<>
<SearchOptions disabled={disabled} placeholder={placeholder} defaultValue={defaultValue} list={CommunityList} onSubmit={extendName} />
<>{CommunityList!=null?
<SearchOptions disabled={disabled} placeholder={placeholder} defaultValue={defaultValue} list={CommunityList} onSubmit={extendName} />
:null
}
</>
);
};
......@@ -32,3 +34,4 @@ function mapStateToProps(state:any) {
};
}
export default connect(mapStateToProps)(SearchOptionsCommnity);
// <SearchOptionsCommnity onSubmit={extendName} />
......@@ -5,6 +5,7 @@ import { stringify } from 'querystring';
import { ConnectState } from '@/models/connect';
import { CurrentUser } from '@/models/user';
import login from '@/pages/user/login';
import { getCookie } from '@/utils/method';
interface SecurityLayoutProps extends ConnectProps {
loading?: boolean;
......@@ -13,12 +14,14 @@ interface SecurityLayoutProps extends ConnectProps {
}
interface SecurityLayoutState {
token:String,
isReady: boolean;
}
class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayoutState> {
state: SecurityLayoutState = {
isReady: false,
token:"abc123",
};
componentDidMount() {
......@@ -26,7 +29,8 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
isReady: true,
});
const { dispatch ,login} = this.props;
console.log("登录中")
// console.log("安全登录中")
// console.log(login)
if (dispatch) {
dispatch({
type: 'user/fetchCurrent',
......@@ -39,21 +43,19 @@ class SecurityLayout extends React.Component<SecurityLayoutProps, SecurityLayout
}
render() {
const { isReady } = this.state;
const { isReady,token } = this.state;
const { children, loading, currentUser,login } = this.props;
// You can replace it to your authentication rule (such as check token exists)
// 你可以把它替换成你自己的登录认证规则(比如判断 token 是否存在)
console.log("是否已登录"+login?.token)
// 你可以把它替换成你自己的登录认证规则(比如判断 token 是否存在)
// console.log("是否已登录" + getCookie("token"))
// const isLogin = currentUser && currentUser.name;//isLogin为关键点
var isLogin = false
if (currentUser.name != null) {
if (getCookie("token").length!=0) {
isLogin=true
}
isLogin = true
if ((login?.token).length==0) {
// isLogin=false
}
const queryString = stringify({
redirect: window.location.href,
});
......
......@@ -69,7 +69,7 @@ export default {
'menu.communitymanagement.celllist': 'Cell List',
'menu.communitymanagement.communityannouncement': 'Community Announcement',
'menu.communitymanagement.facilitybookings': 'Facility Bookings',
'menu.communitymanagement.visitorrecord': 'visitorrecord',
'menu.communitymanagement.visitorrecord': 'Visitor Record',
'menu.accountmanagement': 'Account Management',
'menu.accountmanagement.accountmanagement1': 'Account Management',
'menu.accountmanagement.companyinformation': 'Company Information',
......
import * as service from '../../services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
import { printf } from '@/utils/log';
export default {
namespace: 'CellList',
state: {
Data: null,
curString:{},
Result: null,
DataSave: null,
DataSaveDetail:null,
},
reducers: {
returnPage(state, { Data}) {
return { ...state, Data };
},
returnResult(state, { Result}) {
return { ...state, Result};
},
returnDataSave(state, { DataSave }) {
return {...state,DataSave}
},
returnDataSaveDetail(state, { DataSaveDetail }) {
return {...state,DataSaveDetail}
},
},
effects: {
//标准请求
*RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload);
console.log(resp)
if (resp.code == 500||resp.error_code!="0000") {
}
if (resp.error_code != "0000") {
printf(playload, resp)
}
else {
switch (playload.index) {
case 24: {
let Data = resp.data;
yield put({ type: 'returnPage', Data });
} break;
}
}
},
*ResultClear({ }, { put }) {
var tmp=null
yield put({type: 'returnResult', tmp} )
},
*SA({ playload }, { call, put }) {
var DataSave = playload
yield put({type: 'returnDataSave', DataSave} )
},
},
};
import * as service from '../../services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
import { printf } from '@/utils/log';
export default {
namespace: 'CommunityAnnouncement',
state: {
Data: null,
Result: null,
DataSave: null,
DataSaveDetail:null,
},
reducers: {
returnPage(state, { Data}) {
return { ...state, Data };
},
returnResult(state, { Result}) {
return { ...state, Result};
},
returnDataSave(state, { DataSave }) {
return {...state,DataSave}
},
returnDataSaveDetail(state, { DataSaveDetail }) {
return {...state,DataSaveDetail}
},
},
effects: {
//标准请求
*RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload);
console.log(resp)
if (resp.code == 500||resp.error_code!="0000") {
}
if (resp.error_code != "0000") {
printf(playload, resp)
}
else {
switch (playload.index) {
case 25: {
let Data = resp.data;
yield put({ type: 'returnPage', Data });
} break;
}
}
},
*ResultClear({ }, { put }) {
var tmp=null
yield put({type: 'returnResult', tmp} )
},
*SA({ playload }, { call, put }) {
var DataSave = playload
yield put({type: 'returnDataSave', DataSave} )
},
},
};
import * as service from '../../services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
import { printf } from '@/utils/log';
export default {
namespace: 'VisitorRecord',
state: {
Data: null,
Result: null,
DataSave: null,
DataSaveDetail:null,
},
reducers: {
returnPage(state, { Data}) {
return { ...state, Data };
},
returnResult(state, { Result}) {
return { ...state, Result};
},
returnDataSave(state, { DataSave }) {
return {...state,DataSave}
},
returnDataSaveDetail(state, { DataSaveDetail }) {
return {...state,DataSaveDetail}
},
},
effects: {
//标准请求
*RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload);
console.log(resp)
if (resp.code == 500||resp.error_code!="0000") {
}
if (resp.error_code != "0000") {
printf(playload, resp)
}
else {
switch (playload.index) {
case 26: {
let Data = resp.data;
yield put({ type: 'returnPage', Data });
} break;
}
}
},
*ResultClear({ }, { put }) {
var tmp=null
yield put({type: 'returnResult', tmp} )
},
*SA({ playload }, { call, put }) {
var DataSave = playload
yield put({type: 'returnDataSave', DataSave} )
},
},
};
......@@ -5,6 +5,7 @@ import { AccountLogin,AccountCheckLogin,AccountOut } from '@/services/login';
import { setAuthority } from '@/utils/authority';
import { getPageQuery } from '@/utils/utils';
import { setCookie, getCookie } from '@/utils/method';
export interface StateType {
status?: 'ok' | 'error';
type?: string;
......@@ -60,11 +61,13 @@ const Model: LoginModelType = {
});
// Login successfully
if (response.status === 'ok') {
console.log("登录成功")
console.log(response)
console.log("用户名密码登录成功")
console.log(response)
const userMessage = yield call(AccountCheckLogin, payload);//请求时间网络
console.log(userMessage)
console.log(userMessage.token)
setCookie("token",userMessage.token)
console.log("获取到Token:" + getCookie("token"))
yield put({type: 'saveToken',token: userMessage.token,userName:payload.userName,password:payload.password});
const urlParams = new URL(window.location.href);
const params = getPageQuery();
......
......@@ -47,7 +47,7 @@ const UserModel: UserModelType = {
},
*fetchCurrent({playload}, { call, put }) {
const response = yield call(queryCurrent,playload);
console.log(response)
// console.log(response)
yield put({
type: 'saveCurrentUser',
payload: response,
......
......@@ -69,7 +69,7 @@ const PropertyServices = (props: any) => {
case "/CommercialService/ReportOnline": init = "4"
{
TosCommunityServiceGet({serviceType:init})
} break;
} break;
case "/CommercialService/ProblemFeedback":init = "5"
{
TosCommunityServiceGet({serviceType:init})
......
import React, { useState, useEffect } from 'react';
import { Input ,Tabs,Table,Space, Button} from 'antd';
const { TabPane } = Tabs;
import {connect} from 'umi';
const columns = [
["Community", "residentialName"],
["Administrator", "residentialManagerUserName"],
["Operation Hours", null, (text: any, record: any) => (<div></div>)],
["Office Tel", "residentialPhone"],
["Address", "residentialAddress"],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)],
]
import TitleSearch from '@/components/TitleSearch/TitleSearch'
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity'
import { RA } from '@/utils/method';
import { objectColumns } from '@/utils/string';
import { timestampToTime } from '@/utils/time';
const module="CellList"
const CellList = (props:any) => {
const { dispatch, Data } = props;
const Pagechange = () => {
}
const [columnsVal,setColumnsVal]=useState([])
useEffect(() => {
var tmp = objectColumns(columns)
console.log(tmp)
setColumnsVal(tmp)
RA(24, {communityName: "" }, module, dispatch);
}, [])
useEffect(() => {
if (Data != null) {
//console.log(columnsVal)
}
}, [Data])
const CallbackSearch = (values:any) => {
RA(24, {communityName: values }, module, dispatch);
}
return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
{
Data != null ? <>
{/* <TitleSearch listkey={['communityName']} list={['Community Name']} onSubmit={CallBackTitleSearch}/> */}
<SearchOptionsCommnity onSubmit={CallbackSearch} />
<Table loading={false} rowKey="id" style={{ marginTop: 16 }}
dataSource={Data.rows}
columns={columnsVal}
pagination={{ current: 1, total: Data.total}} />
</> : null
}
</div>
);
};
function map(state:any) {
const { Data} = state[module]
return { Data}
}
export default connect(map)(CellList);
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import { Input ,Tabs,Table,Space, Button} from 'antd';
const { TabPane } = Tabs;
import {connect} from 'umi';
import { objectColumns } from '@/utils/string';
import {timestampToTime3} from '@/utils/time'
// communityNum: "A7"
// count: 0
// createTime: "Jul 8, 2020 7:38:37 PM"
// deleted: 0
// extend: ""
// id: "2f9b5e98a2ea4b79b75242b1b34301bd"
// noticEndTime: "Aug 23, 2020 7:38:29 PM"
// noticImageName: "3.jpg"
// noticScope: 0
// noticStartTime: "Aug 20, 2020 7:38:26 PM"
// noticText: "噶防范发更好覅单号梵蒂冈很反感辅导班梵蒂冈房管局覅北京饭店个法币发动机盖我甲方的GV第八届发第十九GIF大锅饭"
// noticTitlel: "大家好,今年端午节不放假"
// updateTime: "Jun 28, 2020 7:38:39 PM"
const columns = objectColumns( [
["community", "communityNum"],
["Title", "noticTitlel"],
["Publish Time", null, (text: any, record: any) => (<Space size="middle">{record.noticStartTime.time}</Space>)],
["noticScope", "noticScope"],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)],
])
import { RA } from '@/utils/method';
const module="CommunityAnnouncement"
const CommunityAnnouncement = (props:any) => {
const { dispatch, Data } = props;
useEffect(() => {
RA(25,{communityNum: "", noticTitlel: "" },module,dispatch)
},[])
return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
{Data!=null?
<Table
loading={false}
rowKey="id"
style={{ marginTop: 16 }}
dataSource={Data.rows}
columns={columns}
pagination={{ current: 1, total: Data.total}} />:null}
</div>
);
};
function map(state:any) {
const { Data} = state[module]
return { Data}
}
export default connect(map)(CommunityAnnouncement);
//备注 发布人缺少 发布时间格式错误
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import { Input ,Tabs,Table,Space, Button} from 'antd';
const { TabPane } = Tabs;
import {connect} from 'umi';
import { objectColumns } from '@/utils/string';
// cdkCode: 998974
// cdkStatus: "0"
// count: 0
// createTime: "Sep 7, 2020 6:12:35 PM"
// deleted: 0
// enable: 0
// extend: ""
// id: "8f8b49308c0b4fb4a0e6b9d6af0aaa1e"
// inviterAddress: "TANGDE2#01#01#01"
// inviterId: "2597108b72f64a5da34892c14f0e6a57"
// inviterName: "啊啊啊"
// inviterPhone: "2536727886@qq.com"
// linkStatus: 1
// numberPlate: "粤A465123"
// securityGuardCommunity: "unkown"
// securityGuardName: "unkown"
// securityGuardPhone: "unkown"
// status: 1
// updateTime: "Sep 7, 2020 6:13:06 PM"
// visitorsName: "销赃"
// visitorsPhone: "18535669865"
const columns = objectColumns( [
["User Name", "inviterName"],
["Visitor", "visitorsName"],
["Security Guard", "securityGuardName"],
["Number Plate", "numberPlate"],
["Address", "inviterAddress"],
["Actions",null, (text: any, record: any) => (<Space size="middle"> <a>Detail</a></Space>)],
])
import TitleSearch from '@/components/TitleSearch/TitleSearch'
import { RA } from '@/utils/method';
const module="VisitorRecord"
const VisitorRecord = (props:any) => {
const { dispatch, Data } = props;
useEffect(() => {
RA(26,{inviterAddress: "", visitorCommunity: ""},module,dispatch)
}, [])
const CallBackTitleSearch = (values:any) => {
console.log(values)
}
return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
<TitleSearch listkey={['inviterAddress']} list={['Community Name']} onSubmit={CallBackTitleSearch}/>
{Data!=null?
<Table
loading={false}
rowKey="id"
style={{ marginTop: 16 }}
dataSource={Data.rows}
columns={columns}
pagination={{ current: 1, total: Data.total}} />:null}
</div>
);
};
function map(state:any) {
const { Data} = state[module]
return { Data}
}
export default connect(map)(VisitorRecord);
// 备注
// 列表缺少访客时间
// 搜索缺少到达时间、访客姓名
......@@ -9,13 +9,17 @@ import BackButton from '../../components/BackButton/BackButton';
import TitleGet from '../../components/TitleGet/TitleGet';
import TableShow from '../../components/TableShow/TableShow';
import { getCookie } from '@/utils/method';
const Guard = (props:any) => {
const { dispatch, CommunityList,token} = props;
const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})};
const tosCommunityget = (values: any) => { dispatch({ type: 'Init/tosCommunityget', playload: values }) };
const [page, setPage] = useState({ token: "" })
useEffect(() => {
tosCommunityget(null)
setPage({ token: getCookie("token") });
}, []);
const onFinish = (values:any) => {
......@@ -31,10 +35,10 @@ const Guard = (props:any) => {
<TitleGet title={"Version 1.0.5"} />
<TitleGet title={"Version 1.0.6"} />
<p>
token:{token}
</p>
token:{page.token}
</p>
{/* <TableShow /> */}
{/* <div>{token}</div>
<Line /> */}
......
......@@ -86,17 +86,27 @@ const requestList = [
["/tos/contract/detail/query", "20 获取合同列表详情"],
["/tos/community/service/get/detail", "21 小区服务获取详情"],
["/tos/communtiy/service/reply", "22 小区回复"],
["/tos/property/decorate/record/get","23 装修列表获取"],
["/tos/property/decorate/record/get", "23 装修列表获取"],
["/tos/tosCommunity/get", "24 获取小区列表"],
["/tos/tosCommunityNotic/get", "25 获取小区公告列表"],
["/tos/tosVisitorRecord/get","26 获取访客记录列表"],
]
const params = [
{ "communityName": "" },
{ "communityNum": "", "noticTitlel": "" },
{ "inviterAddress": "", "visitorCommunity": "" },
]
function requestAuto(url:string,values:any) {
return request(url, Body(values))
}
export function RA(playload: any) {
// console.log(playload)
// console.log(playload.index)
// console.log(requestList[playload.index])
var url =(requestList[playload.index])[0]
console.log(playload.index+"》【发送请求】"+url+(requestList[playload.index])[1])
console.log(playload.index + "》【发送请求】" + url + " " + (requestList[playload.index])[1])
console.log("参数如下:")
console.log(playload.body)
return requestAuto(url,playload.body)
}
// console.log(playload)
// console.log(playload.index)
// console.log(requestList[playload.index])
// import {message } from 'antd';
export const printf = (playload: any,resp:any) => {
console.log("请求错误码:"+"("+playload.index+")" + resp.error_code)
console.log(playload)
}
......@@ -32,4 +32,25 @@ export const picFromate = (values: any) => {
})
}
return result
}
\ No newline at end of file
}
export const getCookie=(key:string)=>{
const name = key + "=";
const ca = document.cookie.split(';');
for (let i = 0; i < ca.length; i++) {
const c = ca[i].trim();
if (c.indexOf(name) === 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
export const setCookie=(key:string,value: string)=>{
document.cookie=key + "=" + value + "; ";
}
export const RA = (index:any,values:any,module:string,dispatch:any) => { dispatch({ type: module+'/RA', playload: {index:index, body:values } }) };
\ No newline at end of file
import React, { useState, useEffect } from 'react';
import { Input ,Tabs,Table,Space, Button} from 'antd';
const { TabPane } = Tabs;
import {connect} from 'umi';
import { RA } from '@/utils/method';
const module="XXX"
const XXX = (props:any) => {
const { dispatch, Data } = props;
return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
</div>
);
};
function map(state:any) {
const { Data} = state[module]
return { Data}
}
export default connect(map)(XXX);
\ No newline at end of file
import * as service from '../../services/tos';
import { message } from 'antd';
import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
import { printf } from '@/utils/log';
export default {
namespace: 'XXX',
state: {
Data: null,
Result: null,
DataSave: null,
DataSaveDetail:null,
},
reducers: {
returnPage(state, { Data}) {
return { ...state, Data };
},
returnResult(state, { Result}) {
return { ...state, Result};
},
returnDataSave(state, { DataSave }) {
return {...state,DataSave}
},
returnDataSaveDetail(state, { DataSaveDetail }) {
return {...state,DataSaveDetail}
},
},
effects: {
//标准请求
*RA({ playload }, { call, put }) {
const resp = yield call(service.RA, playload);
console.log(resp)
if (resp.code == 500||resp.error_code!="0000") {
}
if (resp.error_code != "0000") {
printf(playload, resp)
}
else {
switch (playload.index) {
case 24: {
let Data = resp.data;
yield put({ type: 'returnPage', Data });
} break;
}
}
},
*ResultClear({ }, { put }) {
var tmp=null
yield put({type: 'returnResult', tmp} )
},
*SA({ playload }, { call, put }) {
var DataSave = playload
yield put({type: 'returnDataSave', DataSave} )
},
},
};
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