Commit 978b647e authored by maple's avatar maple

[error]修改小区服务,图片组件有问题

parent 05fda811
...@@ -253,7 +253,8 @@ export default defineConfig({ ...@@ -253,7 +253,8 @@ export default defineConfig({
{ {
path: '/AccountManagement', path: '/AccountManagement',
name: 'accountmanagement', name: 'accountmanagement',
icon:'UserSwitchOutlined', icon: 'UserSwitchOutlined',
authority: 'admin',
routes: [ routes: [
{ {
path: './AccountManagement', path: './AccountManagement',
......
...@@ -32,10 +32,15 @@ const PictureOptionsRow = (props: any) => { ...@@ -32,10 +32,15 @@ const PictureOptionsRow = (props: any) => {
const handleCancel = () => setPreviewVisible(false); const handleCancel = () => setPreviewVisible(false);
useEffect(() => { useEffect(() => {
console.log("是否刷新")
console.log(value);
if (value!=null) { if (value!=null) {
var tmp = value var tmp = value
var result = new Array() var result = new Array()
var resultToInside=new Array() var resultToInside = new Array()
console.log("组件");
console.log(tmp);
tmp.map((item:any, index:any) => { tmp.map((item:any, index:any) => {
if (item.name == null) { if (item.name == null) {
item.name = getUrlPicName(item.url) item.name = getUrlPicName(item.url)
......
...@@ -36,6 +36,11 @@ class SearchOptions extends React.Component { ...@@ -36,6 +36,11 @@ class SearchOptions extends React.Component {
}else{ }else{
rest.push(item) rest.push(item)
} }
if(this.props.titleSearch){
if(item.toLowerCase()===value.toLowerCase()){
this.props.onSubmit(value)
}
}
} }
this.setState({ data: tmp.concat(rest.sort()) }); this.setState({ data: tmp.concat(rest.sort()) });
}) })
...@@ -78,6 +83,7 @@ class SearchOptions extends React.Component { ...@@ -78,6 +83,7 @@ class SearchOptions extends React.Component {
notFoundContent={<div><Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />Please enter the correct Community Name!</div>} notFoundContent={<div><Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />Please enter the correct Community Name!</div>}
style={{ width: 200 }} style={{ width: 200 }}
disabled={this.props.disabled} disabled={this.props.disabled}
allowClear
> >
{options} {options}
</Select> </Select>
......
...@@ -5,7 +5,7 @@ import SearchOptions from './SearchOptions'; ...@@ -5,7 +5,7 @@ import SearchOptions from './SearchOptions';
const SearchOptionsCommnity = (props: any) => { const SearchOptionsCommnity = (props: any) => {
const {dispatch, CommunityList,defaultValue,placeholder,disabled,value,onChange} = props; const {dispatch, CommunityList,defaultValue,titleSearch,placeholder,disabled,value,onChange} = props;
const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})}; const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})};
useEffect(() => { useEffect(() => {
...@@ -23,7 +23,7 @@ const SearchOptionsCommnity = (props: any) => { ...@@ -23,7 +23,7 @@ const SearchOptionsCommnity = (props: any) => {
} }
return ( return (
<>{CommunityList!=null? <>{CommunityList!=null?
<SearchOptions disabled={disabled} placeholder={placeholder} defaultValue={props.defaultValue!=null?props.defaultValue:value} list={CommunityList} onSubmit={extendName} /> <SearchOptions titleSearch={titleSearch} disabled={disabled} placeholder={placeholder} defaultValue={props.defaultValue!=null?props.defaultValue:value} list={CommunityList} onSubmit={extendName} />
:null :null
} }
</> </>
......
import React, { useState,useEffect} from 'react'; import React, { useState,useEffect,useRef} from 'react';
import { Link, useIntl, connect, Dispatch, history } from 'umi'; import { Link, useIntl, connect, Dispatch, history } from 'umi';
import styles from './index.less'; import styles from './index.less';
...@@ -23,6 +23,7 @@ const TitleSearch= (props:any) => { ...@@ -23,6 +23,7 @@ const TitleSearch= (props:any) => {
const checklist = props.checklist; const checklist = props.checklist;
const status = props.status; const status = props.status;
const communitySelect=props.communitySelect const communitySelect=props.communitySelect
const defaultValue = props.defaultValue
const time = props.time; const time = props.time;
const community = props.community; const community = props.community;
...@@ -31,6 +32,8 @@ const TitleSearch= (props:any) => { ...@@ -31,6 +32,8 @@ const TitleSearch= (props:any) => {
const [communitySingle, setCommunitySingle] = useState(null) const [communitySingle, setCommunitySingle] = useState(null)
const [datePicker, setDate] = useState(null) const [datePicker, setDate] = useState(null)
const formRef = useRef(null)
const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})}; const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})};
useEffect(() => { useEffect(() => {
// console.log("标题搜寻组件初始化") OK // console.log("标题搜寻组件初始化") OK
...@@ -38,8 +41,17 @@ const TitleSearch= (props:any) => { ...@@ -38,8 +41,17 @@ const TitleSearch= (props:any) => {
// console.log("小区数量初始化") OK // console.log("小区数量初始化") OK
tosCommunityget(null) tosCommunityget(null)
} }
if (defaultValue != null) {
formRef.current.setFieldsValue(defaultValue)
}
}, []); }, []);
useEffect(()=>{
if (defaultValue != null) {
formRef.current.setFieldsValue(defaultValue)
}
},[defaultValue])
useEffect(()=>{ useEffect(()=>{
if (CommunityList != null) { if (CommunityList != null) {
...@@ -53,21 +65,18 @@ const TitleSearch= (props:any) => { ...@@ -53,21 +65,18 @@ const TitleSearch= (props:any) => {
const onFinish = values => { const onFinish = (values:any) => {
if (datePicker) { if (datePicker) {
values[time[0]] = datePicker; values[time[0]] = datePicker;
} }
if (community) { if (community) {
values[community]=communitys values[community]=communitys
} }
if (communitySingle) {
values["communityName"]=communitySingle
}
console.log('Success:', values); console.log('Success:', values);
props.onSubmit(values) props.onSubmit(values)
}; };
const onFinishFailed = errorInfo => { const onFinishFailed = (errorInfo:any) => {
console.log('Failed:', errorInfo); console.log('Failed:', errorInfo);
}; };
...@@ -78,17 +87,15 @@ const TitleSearch= (props:any) => { ...@@ -78,17 +87,15 @@ const TitleSearch= (props:any) => {
const printContent = (comment: any)=>{ const printContent = (comment: any)=>{
setCommunitys(comment) setCommunitys(comment)
} }
const extendName = (values: any) => {
setCommunitySingle(values)
}
return ( return (
<> <>
<Form name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed}> <Form ref={formRef} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed}>
<Row gutter={32}> <Row gutter={32}>
{ {
communitySelect != null ? communitySelect != null ?
<Col key={"communitySelect_"} ><SearchOptionsCommnity alone={true} onSubmit={extendName} /></Col> <Col key={"communitySelect_"} ><Form.Item name={"communityName"}><SearchOptionsCommnity titleSearch={true} /></Form.Item></Col>
: null : null
} }
{ {
......
...@@ -5,7 +5,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi'; ...@@ -5,7 +5,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router' import { routerRedux } from 'dva/router'
import { timestampToTime, timestampToTime4 } from '@/utils/time'; import { timestampToTime, timestampToTime4 } from '@/utils/time';
import { picFromate } from '@/utils/method'; import { picFromate, Fromate } from '@/utils/method';
export default { export default {
namespace: 'CommunityService', namespace: 'CommunityService',
...@@ -53,12 +53,12 @@ export default { ...@@ -53,12 +53,12 @@ export default {
//预订设施查询 //预订设施查询
*RA({ playload }, { call, put }) { *RA({ playload }, { call, put }) {
// switch (playload.index) { switch (playload.index) {
// case 21: { case 40: {
// var CurDataDetail=null var Data = null
// yield put({ type: 'returnCurDataDetail', CurDataDetail}); yield put({ type: 'returnPage', Data});
// } break; } break;
// } }
const resp = yield call(service.RA, playload); const resp = yield call(service.RA, playload);
console.log(resp) console.log(resp)
if (resp.code == 500||resp.error_code!="0000") { if (resp.code == 500||resp.error_code!="0000") {
...@@ -75,6 +75,9 @@ export default { ...@@ -75,6 +75,9 @@ export default {
{ {
var tmp = resp.data.rows[0].tosOwerModel; var tmp = resp.data.rows[0].tosOwerModel;
var tmp2 = resp.data.rows[0]; var tmp2 = resp.data.rows[0];
console.error(resp.data.rows[0].replyImgUrl)
console.error(Fromate(resp.data.rows[0].replyImgUrl,[["url",null]]))
var CurDataDetail = { var CurDataDetail = {
community: tmp.communityName, community: tmp.communityName,
address: tmp.addressAndpostalCode, address: tmp.addressAndpostalCode,
...@@ -83,6 +86,8 @@ export default { ...@@ -83,6 +86,8 @@ export default {
phone: tmp.owerPhone, phone: tmp.owerPhone,
email: tmp.owerEmail, email: tmp.owerEmail,
content: resp.data.rows[0].serviceContent, content: resp.data.rows[0].serviceContent,
replyContent: resp.data.rows[0].replyContent,
replyImgUrl: Fromate(resp.data.rows[0].replyImgUrl,[["url",null]]),
status: tmp2.handleStatus, status: tmp2.handleStatus,
pictrues: picFromate(tmp2.imgUrl), pictrues: picFromate(tmp2.imgUrl),
time: timestampToTime4(tmp2.createTime.time) time: timestampToTime4(tmp2.createTime.time)
...@@ -113,7 +118,7 @@ export default { ...@@ -113,7 +118,7 @@ export default {
yield put({ type: 'returnDataSaveDetail', DataSaveDetail, }); yield put({ type: 'returnDataSaveDetail', DataSaveDetail, });
} break; } break;
case 40: { case 40: {
let Data = resp.data.rows; let Data = resp;
yield put({ type: 'returnPage', Data, }); yield put({ type: 'returnPage', Data, });
} break; } break;
} }
......
...@@ -132,6 +132,8 @@ export default { ...@@ -132,6 +132,8 @@ export default {
categoriesDetailsImageName:Fromate(tmp.facilitiesImageList,reg2) categoriesDetailsImageName:Fromate(tmp.facilitiesImageList,reg2)
} }
console.log(sourceData) console.log(sourceData)
console.log(tmp.facilitiesImageList)
console.log(Fromate(tmp.facilitiesImageList,reg2))
console.log("##############################") console.log("##############################")
yield put({ type: 'returnSource', sourceData }); yield put({ type: 'returnSource', sourceData });
} break; } break;
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import styles from './css/Detail.less'; import styles from './css/Detail.less';
import { Input ,Form,Row,Col,Upload,Spin, Button,Descriptions} from 'antd'; import { Input ,Form,Row,Col,Upload,Spin, Button,Descriptions} from 'antd';
...@@ -21,8 +21,8 @@ const Detail = (props:any) => { ...@@ -21,8 +21,8 @@ const Detail = (props:any) => {
const [editorFlag, setEditorFlag] = useState(true); const [editorFlag, setEditorFlag] = useState(true);
const { dispatch, location, CurData,CurDataDetail } = props; const { dispatch, location,CurDataDetail } = props;
const fromRef=useRef(null)
const RA = (index:any,values: any) => { dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } }) }; const RA = (index:any,values: any) => { dispatch({ type: 'CommunityService/RA', playload: { index: index, body: values } }) };
const setCurDataDetail = () => { dispatch({ type: 'CommunityService/setCurDataDetail' }) }; const setCurDataDetail = () => { dispatch({ type: 'CommunityService/setCurDataDetail' }) };
...@@ -41,18 +41,6 @@ const Detail = (props:any) => { ...@@ -41,18 +41,6 @@ const Detail = (props:any) => {
const [fileList, setfileList] = useState([]); const [fileList, setfileList] = useState([]);
// useEffect(() => {
// // setCurDataDetail()
// // if (CurData != null) {
// // RA(21,{
// // serviceType: CurData.service_type,
// // id: CurData.id
// // })
// // setHeadTitle(headTitles[CurData.service_type - 1])
// // }
// }, []);
useEffect(() => { useEffect(() => {
if ((location.pathname).indexOf("/Edit")>-1) { if ((location.pathname).indexOf("/Edit")>-1) {
...@@ -73,8 +61,16 @@ const Detail = (props:any) => { ...@@ -73,8 +61,16 @@ const Detail = (props:any) => {
},[location.pathname]); },[location.pathname]);
useEffect(() => { useEffect(() => {
if (CurDataDetail != null&& curString.readyState==true) { if (CurDataDetail != null && curString.readyState == true) {
console.log("@@@@@@@@@@@@@@@@@@@@@@@@@@@@")
console.log(CurDataDetail) console.log(CurDataDetail)
if (!editorFlag) {
console.log(CurDataDetail.replyImgUrl);
var tmp = { replyContent: CurDataDetail.replyContent, file: CurDataDetail.replyImgUrl }
console.log(tmp)
fromRef.current.setFieldsValue(tmp)
}
setLoading({ data: false }) setLoading({ data: false })
} }
}, [CurDataDetail]) }, [CurDataDetail])
...@@ -87,11 +83,11 @@ const Detail = (props:any) => { ...@@ -87,11 +83,11 @@ const Detail = (props:any) => {
var val = values var val = values
val.handleName =getCookie("name") val.handleName =getCookie("name")
val.handleContacts=getCookie("phone") val.handleContacts=getCookie("phone")
val.type =""+CurData.service_type val.type =""+ location.query.serviceType
val.id =CurData.id val.id = location.query.id
val.userId = CurData.user_id val.userId = location.query.user_id
val.handleStatus = "1" val.handleStatus = "1"
val.file=fileList // val.file=fileList
console.log('Success:', val) console.log('Success:', val)
RA(22,val); RA(22,val);
}; };
...@@ -134,23 +130,23 @@ const Detail = (props:any) => { ...@@ -134,23 +130,23 @@ const Detail = (props:any) => {
<Row gutter={16} style={{marginTop:20}}> <Row gutter={16} style={{marginTop:20}}>
<Col>Picture:</Col> <Col>Picture:</Col>
<Col>{ <Col>{
CurDataDetail!=null? // CurDataDetail!=null?
<PictureOptionsRow // <PictureOptionsRow
action="/tos/communtiy/service/reply/img" // action="/tos/communtiy/service/reply/img"
disabled={true} putSubmit={PictureOptionsRowRef} // disabled={true} putSubmit={PictureOptionsRowRef}
data={{ // data={{
userToken: "token", // userToken: "token",
imageType: 'tosCommunityImageReply', // imageType: 'tosCommunityImageReply',
extends: "", // extends: "",
}} // }}
defultValue={CurDataDetail.pictrues} // // defultValue={CurDataDetail.pictrues}
/>:null // />:null
}</Col> }</Col>
</Row> </Row>
<Line /> <Line />
<Form name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed} validateMessages={validateMessages}> <Form ref={fromRef} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed} validateMessages={validateMessages}>
{!editorFlag ? {!editorFlag ?
<Row gutter={16}> <Row gutter={16}>
<Col>Response:</Col> <Col>Response:</Col>
...@@ -161,21 +157,31 @@ const Detail = (props:any) => { ...@@ -161,21 +157,31 @@ const Detail = (props:any) => {
: null} : null}
<Row gutter={16} style={{ marginTop: 20 }}> <Row gutter={16} style={{ marginTop: 20 }}>
<Col span={3.5}>Resolved Complaint:</Col> <Col span={3.5}>Resolved Complaint:</Col>
<Col ><Form.Item name="replyContent" rules={[{required:true,max:300}]} ><TextArea style={{ width: 394, height: 80 }} autoSize={false} disabled={!editorFlag} /></Form.Item></Col> <Col ><Form.Item name="replyContent" rules={[{required:true,max:300}]} ><TextArea style={{padding:8, width: 394, height: 80 }} autoSize={false} disabled={!editorFlag} /></Form.Item></Col>
</Row> </Row>
<Row gutter={16} style={{ marginTop: 20 }}> <Row gutter={16} style={{ marginTop: 20 }}>
<Col span={3}></Col> <Col span={3}></Col>
<Col > <Col >
{/* putSubmit={PictureOptionsRowRef} */}
{
CurDataDetail.replyImgUrl != null ? <>
<Form.Item name="file" label="filename" >
<PictureOptionsRow <PictureOptionsRow
action="/tos/communtiy/service/reply/img" action="/tos/communtiy/service/reply/img"
disabled={!editorFlag} disabled={!editorFlag}
putSubmit={PictureOptionsRowRef} data={{ data={{
userToken: "token", userToken: "token",
imageType: 'tosCommunityImageReply', imageType: 'tosCommunityImageReply',
extends: "", extends: "",
}} }} />
defultValue={[]} </Form.Item>
/> </>:null
}
</Col> </Col>
</Row> </Row>
{ {
...@@ -192,9 +198,8 @@ const Detail = (props:any) => { ...@@ -192,9 +198,8 @@ const Detail = (props:any) => {
}; };
function mapStateToProps(state:any) { function mapStateToProps(state:any) {
const { CurData, CurDataDetail } = state.CommunityService; const { CurDataDetail } = state.CommunityService;
return { return {
CurData,
CurDataDetail CurDataDetail
}; };
} }
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import styles from './css/index.less'; import styles from './css/index.less';
import { Input ,Menu,Table,Space,Upload,message,Button } from 'antd'; import { Input ,Menu,Table,Space,Upload,message,Pagination, Button } from 'antd';
import { Link, useIntl, connect, Dispatch,history } from 'umi'; import { Link, useIntl, connect, Dispatch,history } from 'umi';
import { timestampToTime3 } from '../../utils/time'; import { timestampToTime3 } from '../../utils/time';
import TitleSearch from '../../components/TitleSearch/TitleSearch'; import TitleSearch from '../../components/TitleSearch/TitleSearch';
import { RA, urlEncode } from '@/utils/method'; import { RA, urlEncode, filterObj, filterObjbyTg } from '@/utils/method';
import { query } from 'express';
const pathname = ["CommunityMaintenance", "ShelfLifeService", "OwnerComplaints", "ReportOnline", "ProblemFeedback"] const pathname = ["CommunityMaintenance", "ShelfLifeService", "OwnerComplaints", "ReportOnline", "ProblemFeedback"]
// const handle_status=["未处理","处理","拒绝"] const handle_Status = [[0,"Untreated"], [1,"Processed"]]//["未处理","处理","拒绝"] , [2,"Rejected"]
const handle_Status = ["Untreated", "Processed", "Rejected"]
const module="CommunityService" const module="CommunityService"
const PropertyServices = (props: any) => { const PropertyServices = (props: any) => {
const { dispatch, location, Data } = props; const { dispatch, location, Data } = props;
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
const [pageNum,setPageNum]=useState(1) const [pageNum, setPageNum] = useState(1)
const [curString, setCurString] = useState({ serviceType: null }) const [serviceTypeGobal, setServiceType] = useState("")
const changeValue = (key:any,value: any) => { const [readyData,setReadyData]=useState(null)
var tmp = curString;tmp[key] = value;setCurString(tmp)
}
const pagination = { defaultCurrent: pageNum, total: Data != null ? Data.length : 0 }
const columns = [ const columns = [
{ title: "Community Name",dataIndex: 'community_name',}, { title: "Community Name",dataIndex: 'community_name',},
{ title: "Ower Name",dataIndex: 'ower_name',}, { title: "Ower Name",dataIndex: 'ower_name',},
{ title: "Reply",dataIndex: 'handle_name',render: (text: any) => (<Space size="middle">{text!=null?text:"--"}</Space>)}, { title: "Reply",dataIndex: 'handle_name',render: (text: any) => (<Space size="middle">{text!=null?text:"--"}</Space>)},
{ title: "Create Time",dataIndex: "create_time",render: (text: any, record: any) => (<Space size="middle">{timestampToTime3(text.time)}</Space>)}, { title: "Create Time",dataIndex: "create_time",render: (text: any, record: any) => (<Space size="middle">{timestampToTime3(text.time)}</Space>)},
{ title: "Handle status", dataIndex: 'handle_status',render: (text: any, record: any) => (<Space size="middle">{handle_Status[text]}</Space>)}, { title: "Handle status", dataIndex: 'handle_status',render: (text: any, record: any) => (<Space size="middle">{handle_Status[text][1]}</Space>)},
{ title: "Actions",dataIndex: 'handle_status', { title: "Actions",dataIndex: 'handle_status',
render: (text: any, record: any) => ( render: (text: any, record: any) => (
<Space size="middle"> <a onClick={goToDetail.bind(this,text,record)}>{text==0?"Reply":"Detail"}</a></Space> <Space size="middle"> <a onClick={goToDetail.bind(this,text,record)}>{text==0?"Reply":"Detail"}</a></Space>
...@@ -41,50 +36,80 @@ const PropertyServices = (props: any) => { ...@@ -41,50 +36,80 @@ const PropertyServices = (props: any) => {
}, },
]; ];
const goToDetail = (value, record, e) => { const goToDetail = (value:any, record:any, e:any) => {
history.push(location.pathname+(value==0?"/Edit":"/Detail")+urlEncode({serviceType: curString.serviceType,id: record.id,user_id:record.user_id})) history.push(location.pathname+(value==0?"/Edit":"/Detail")+urlEncode({serviceType: serviceTypeGobal,id: record.id,user_id:record.user_id}))
} }
useEffect(() => { useEffect(() => {
setLoading(false) if (Data != null) {setLoading(false)}
}, [Data]); }, [Data]);
const TitleSearchContent = (comment: any)=>{
comment.serviceType = curString.serviceType const ClickTitleSearch = (comment: any)=>{
console.log(comment) comment.serviceType = serviceTypeGobal
history.push(location.pathname+urlEncode(comment)) comment.current = 1
history.push(location.pathname+urlEncode(filterObj(comment)))
} }
const PageChange = (values: any) => { //.current
var tmp = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName"])
tmp["current"]=values.current
history.push(location.pathname + urlEncode(tmp))
}
useEffect(()=>{ useEffect(()=>{
if (location != null) { if (location != null) {
var serviceType ="" var serviceType =""
pathname.map((item, index) => { pathname.map((item, index) => {
if ((location.pathname).indexOf(item) > -1) { if ((location.pathname).indexOf(item) > -1) {
serviceType = "" + (index + 1) serviceType = "" + (index + 1)
changeValue("serviceType",serviceType) setServiceType(serviceType)
} }
}) })
if (location.query.current) { if (location.query.current!=null) {
console.log("翻页") setPageNum(parseInt(location.query.current))
setPageNum(location.query.current)
} else { } else {
var tm=1 setPageNum(1)
setPageNum(tm)
} }
setLoading(true)
console.log("设置大数据");
var tmp = filterObjbyTg(location.query, ["handleStatus", "ownerName", "communityName"])
console.log(tmp)
setReadyData(tmp)
// var tmp=filterObj(location.query)
// console.log(tmp)
RA(40, { RA(40, {
serviceType: serviceType, serviceType: serviceType,
handleStatus: location.query.handleStatus != null ? parseInt(location.query.handleStatus) : null, handleStatus: location.query.handleStatus != undefined ? parseInt(location.query.handleStatus) : null,
ownerName: location.query.ownerName != undefined ? (location.query.ownerName) : null,
communityName: location.query.communityName != undefined ? (location.query.communityName) : null,
}, module, dispatch) }, module, dispatch)
setLoading(true)
}
}, [location.query])
const PageChange = (values: any) => {
history.push(location.pathname+urlEncode(values))
console.log(values)
} }
}, [location])
return ( return (
<div className={styles.base}> <div className={styles.base}>
<div>{pageNum}</div>
<TitleSearch communitySelect={true} listkey={['ownerName']} list={['Owner Name']} status={[{ name: ["handleStatus","Status"], data: [[0,"Processed"], [1,"Untreated"],[2,"Rejected"]]}]} onSubmit={TitleSearchContent}/> <TitleSearch
<Table loading={loading} rowKey={"id"} style={{ marginTop: 16 }} dataSource={Data} columns={columns} pagination={{ defaultCurrent: pageNum, total: Data != null ? Data.length : 0}} onChange={PageChange}/> communitySelect={true}
listkey={['ownerName']}
list={['Owner Name']}
status={[{ name: ["handleStatus", "Status"], data: handle_Status }]}
defaultValue={readyData}
onSubmit={ClickTitleSearch}
/>
<Table
rowKey={"id"}
style={{ marginTop: 16 }}
loading={loading}
columns={columns}
dataSource={ Data != null ?Data.data.rows:[]}
pagination={Data != null ? { current: pageNum, total: Data.data.rows.length } : {}}
onChange={PageChange}
/>
</div> </div>
); );
}; };
...@@ -96,3 +121,11 @@ function mapStateToProps(state:any) { ...@@ -96,3 +121,11 @@ function mapStateToProps(state:any) {
}; };
} }
export default connect(mapStateToProps)(PropertyServices); export default connect(mapStateToProps)(PropertyServices);
// 26、获取小区服务信息
// http://47.74.233.180:8651/tos/community/service/get
// {
// "serviceType":"1",
// "ownerName":"阿涛暗暗",
// "handleStatus":"1",
// "communityName":"TANGDE2"
// }
\ No newline at end of file
...@@ -15,8 +15,6 @@ import FileUpload from '@/components/FileUpload/FileUpload'; ...@@ -15,8 +15,6 @@ import FileUpload from '@/components/FileUpload/FileUpload';
import { validateMessages } from '@/utils/params'; import { validateMessages } from '@/utils/params';
import PictureOptionsRow from '@/components/PictureOptions/PictureOptionsRow'; import PictureOptionsRow from '@/components/PictureOptions/PictureOptionsRow';
import TextArea from 'antd/lib/input/TextArea'; import TextArea from 'antd/lib/input/TextArea';
import SelectOptions from '@/components/SelectOptions';
import TitleSearch from '@/components/TitleSearch/TitleSearch';
import SelectCommunity from '@/components/SelectCommunity'; import SelectCommunity from '@/components/SelectCommunity';
import Line from '@/components/Line/Line'; import Line from '@/components/Line/Line';
import TimeComfirm from '@/components/TimeComfirm/TimeComfirm'; import TimeComfirm from '@/components/TimeComfirm/TimeComfirm';
......
...@@ -68,6 +68,9 @@ const Facility = (props:any) => { ...@@ -68,6 +68,9 @@ const Facility = (props:any) => {
setTimeExtend(sourceData.reservationQuantumTime) setTimeExtend(sourceData.reservationQuantumTime)
// 中断 // 中断
// setPictrueExtend({tab:null,pic:null,pics:null}) // setPictrueExtend({tab:null,pic:null,pics:null})
console.log("重点检查");
console.log(sourceData);
formRef.current.setFieldsValue(sourceData) formRef.current.setFieldsValue(sourceData)
} }
}, [sourceData]) }, [sourceData])
......
...@@ -33,7 +33,7 @@ const Guard = (props:any) => { ...@@ -33,7 +33,7 @@ const Guard = (props:any) => {
return ( return (
<div className={styles.base}> <div className={styles.base}>
<TitleGet title={"Version 1.1.7"} /> <TitleGet title={"Version 1.1.9"} />
<p> <p>
token:{page.token} token:{page.token}
name:{getCookie("name")} name:{getCookie("name")}
......
...@@ -2,9 +2,11 @@ import { reloadAuthorized } from './Authorized'; ...@@ -2,9 +2,11 @@ import { reloadAuthorized } from './Authorized';
// use localStorage to store the authority info, which might be sent from server in actual project. // use localStorage to store the authority info, which might be sent from server in actual project.
export function getAuthority(str?: string): string | string[] { export function getAuthority(str?: string): string | string[] {
console.log("获取权限")
const authorityString = const authorityString =
typeof str === 'undefined' && localStorage ? localStorage.getItem('antd-pro-authority') : str; typeof str === 'undefined' && localStorage ? localStorage.getItem('antd-pro-authority') : str;
// authorityString could be admin, "admin", ["admin"] // authorityString could be admin, "admin", ["admin"]
console.log(authorityString)
let authority; let authority;
try { try {
if (authorityString) { if (authorityString) {
...@@ -18,6 +20,7 @@ export function getAuthority(str?: string): string | string[] { ...@@ -18,6 +20,7 @@ export function getAuthority(str?: string): string | string[] {
} }
// preview.pro.ant.design only do not use in your production. // preview.pro.ant.design only do not use in your production.
// preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。 // preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
if (!authority && ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') { if (!authority && ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION === 'site') {
return ['admin']; return ['admin'];
} }
......
...@@ -81,6 +81,7 @@ export const Fromate = (values:any,reg:any) => { ...@@ -81,6 +81,7 @@ export const Fromate = (values:any,reg:any) => {
} }
return result return result
} }
// 按键取值
// const reg2 = "name" // const reg2 = "name"
// const values2 = [{name:"kat",url:"longtime"},{name:"jack",url:"longtime2"}] // const values2 = [{name:"kat",url:"longtime"},{name:"jack",url:"longtime2"}]
export const Fromate2 = (values:any, reg:string) => { export const Fromate2 = (values:any, reg:string) => {
...@@ -99,9 +100,6 @@ export const getObjectInfo = (test: any) => { ...@@ -99,9 +100,6 @@ export const getObjectInfo = (test: any) => {
for (let item in test) { for (let item in test) {
array.push([item, typeof test[item]]) array.push([item, typeof test[item]])
} }
console.log(array)
console.log(array.length)
return array return array
} }
//对象转URL //对象转URL
...@@ -117,3 +115,25 @@ export const urlEncode = (obj:any) => { ...@@ -117,3 +115,25 @@ export const urlEncode = (obj:any) => {
} }
return url return url
} }
//对象抽空
export const filterObj = (obj:any) => {
var tmp = {}
for (var item in obj) {
if (obj[item] != null&&obj[item]!=undefined) {
tmp[item] = obj[item]
}
}
return tmp
}
//对象抽空根据关键字
export const filterObjbyTg = (obj:any,tg:any) => {
var tmp = {}
for (var item in obj) {
if (tg.indexOf(item)>-1) {
if (obj[item] != null) {
tmp[item] = obj[item]
}
}
}
return tmp
}
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