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

[fix]新建小区

(cherry picked from commit 97d1d9ff)
parent 19cc11ab
This diff is collapsed.
import React, { useState,useEffect} from 'react';
import { Upload,Button, message,Row,Col } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
// { imageType: "tosContract", extends: extend }
//"/tos/image/upload"
import { Fromate2 } from '@/utils/method'
const FileUpload = (props: any) => {
const {value,onChange}=props
const [fileList, setFileList] = useState([]);
const uploadProps = {
accept:".pdf,",
action:props.url,
data: props.data,
fileList:fileList,
onChange({ file, fileList }) {
let tmp=fileList
setFileList(tmp.filter(file => !!file.status))
if (file.status == 'done') {
console.log(fileList);
message.success(file.name, 3)
if (props.reg != null) {
onChange(Fromate2(fileList,props.reg))
} else {
onChange(fileList)
}
}
},
};
return (
<>
<Row gutter={8}>
<Col><div style={{lineHeight:2}}>{props.title}</div></Col>
<Col>
<Upload {...uploadProps}>
<Button>
<UploadOutlined /> Upload
</Button>
</Upload>
</Col>
</Row>
</>
);
};
export default FileUpload;
......@@ -22,7 +22,7 @@ const Picture = (props:any) => {
useEffect(() => {
var tmp = props.defaultValue
// console.log(tmp)
console.log(tmp)
var checkFlag=false
if (tmp != null) {
tmp.map((item, index) => {
......@@ -37,7 +37,7 @@ const Picture = (props:any) => {
}
}
},[])
},[props.defaultValue])
const handleCancel = () => {
setPreviewVisible(false)
}
......
......@@ -11,7 +11,7 @@ import Picture from './Picture';
import { getUrlPicName } from '../../utils/string';
const PictureOptions = (props:any) => {
const { value, onChange }=props
const [fileList, setFileList] = useState([])
const [fileListLen, setFileListLen] = useState(0)
const add = () => {
......@@ -19,8 +19,10 @@ const PictureOptions = (props:any) => {
setFileList(fileList => ([...fileList, {index:fileListLen + 1,name:null,pic:null}]))
}
useEffect(() => {
var tmp = props.defultValue
if (tmp != null) {
var tmp = value
if (tmp != null&&tmp.length>0&&(typeof tmp[0])=="object") {
console.log("图片默认值")
console.log(tmp)
var initArray = new Array()
tmp.map((item: any, index: any) => {
if (item.pic == null) {
......@@ -35,21 +37,16 @@ const PictureOptions = (props:any) => {
status:"Done"})
})
setFileList(initArray)
props.putSubmit( CheckParm(initArray))
setFileListLen(initArray.length + 1)
} else {
setFileList([{index: 0,name:null,pic:null}])
}
},[])
}, [value])
const Delete = (index: any, e: any) => {
var tmp = fileList
tmp.splice(index, 1);
// console.log("删除")
// console.log(tmp)
setFileList(fileList => ([...tmp]))
// console.log(fileList)
props.putSubmit( CheckParm(tmp))
onChange( CheckParm(tmp))
}
const CheckParm = (values: Array<any>) => {
var tmp = new Array()
......@@ -65,8 +62,9 @@ const PictureOptions = (props:any) => {
}
const PictureName=(index: any,values:any) => {
var tmp = fileList
tmp[index].pic = values
props.putSubmit( CheckParm(tmp))
tmp[index].pic = values
console.log(tmp)
onChange( CheckParm(tmp))
}
const InputGet = (index: any, e: any) => {
var tmp = fileList
......@@ -75,14 +73,16 @@ const PictureOptions = (props:any) => {
} else {
tmp[index].name = e.target.value
}
// console.log(tmp)
props.putSubmit(CheckParm(tmp))
console.log(tmp)
onChange(CheckParm(tmp))
}
return (
<div>
{
fileList.map((item, index) => {
fileList.map((item, index) => {
console.log(index)
console.log(item)
return (
<Row key={item.index}>
<Col><Picture onSubmit={PictureName.bind(this, index)} data={props.data} defaultValue={[item]} disabled={props.disabled}/></Col>
......
......@@ -22,20 +22,20 @@ const uploadButton = (
</div>
);
import { getUrlPicName } from '../../utils/string';
const PictureOptionsRow = (props:any) => {
const PictureOptionsRow = (props: any) => {
// const [defa] = props;
const {value, onChange} = props;
const [fileList, setFileList] = useState([])
const [previewVisible, setPreviewVisible] = useState(false)
const [previewImage,setPreviewImage]=useState('')
const handleCancel = () => setPreviewVisible(false);
useEffect(() => {
if (props.defultValue!=null) {
var tmp = props.defultValue;
if (value!=null) {
var tmp = value
var result = new Array()
var resultToInside=new Array()
tmp.map((item, index) => {
tmp.map((item:any, index:any) => {
if (item.name == null) {
item.name = getUrlPicName(item.url)
item.uid=index
......@@ -44,7 +44,7 @@ const PictureOptionsRow = (props:any) => {
resultToInside.push(item.name)
})
setFileList(result)
props.putSubmit(resultToInside)
onChange(resultToInside)
}
}, [])
......@@ -54,7 +54,7 @@ const PictureOptionsRow = (props:any) => {
}
setPreviewImage(file.url || file.preview)
setPreviewVisible(true)
};
}
const handleChange = ({ file, fileList }) => {
......@@ -64,7 +64,7 @@ const PictureOptionsRow = (props:any) => {
fileList.map((item, index) => {
result.push(item.name)
})
props.putSubmit(result)
onChange(result)
}
const beforeUpload=( file:any) => {
if (file.type === 'image/png' || file.type === 'image/jpeg' || file.type === 'image/jpg') {
......
......@@ -5,7 +5,7 @@ import SearchOptions from './SearchOptions';
const SearchOptionsCommnity = (props: any) => {
const {dispatch, CommunityList,defaultValue,placeholder,disabled} = props;
const {dispatch, CommunityList,defaultValue,placeholder,disabled,value,onChange} = props;
const tosCommunityget = (values:any) => {dispatch({type: 'Init/tosCommunityget',playload:values})};
useEffect(() => {
......@@ -16,12 +16,12 @@ const SearchOptionsCommnity = (props: any) => {
const extendName = (values: any) => {
// console.log(values)
props.onSubmit(values);
onChange(values);
}
return (
<>{CommunityList!=null?
<SearchOptions disabled={disabled} placeholder={placeholder} defaultValue={defaultValue} list={CommunityList} onSubmit={extendName} />
<SearchOptions disabled={disabled} placeholder={placeholder} defaultValue={value} list={CommunityList} onSubmit={extendName} />
:null
}
</>
......
......@@ -30,19 +30,19 @@ const TimeSelect = (props:any) => {
} else if(type==1&&buttonNum.ButtonNum==0) {
buttonNum.ButtonNum+=1
}
console.log(buttonNum)
// console.log(buttonNum)
setCurString(buttonNum)
}
const saveResult = (values:any) => {
var tmp = curString
tmp.resultList = values
setCurString(tmp)
console.log("这里")
console.log(curString)
// console.log("这里")
// console.log(curString)
}
useEffect(() => {
console.log("时段选择器")
console.log(defaultValue)
// console.log("时段选择器")
// console.log(defaultValue)
if (defaultValue != null) {
var tmp = defaultValue
var result=new Array()
......@@ -53,7 +53,7 @@ const TimeSelect = (props:any) => {
setTimesLen(result.length)
var resultList= CheckParm(result)
saveResult(resultList)
console.log(resultList)
// console.log(resultList)
props.putSubmit(resultList)
}
}, [defaultValue]);
......@@ -84,7 +84,7 @@ const TimeSelect = (props:any) => {
showBtn(1)
}
saveResult(resultList)
console.log(resultList)
// console.log(resultList)
props.putSubmit(resultList)
}
const timeForm = (values: any) => {
......@@ -108,8 +108,8 @@ const TimeSelect = (props:any) => {
const timeChange = (index: any, values: any) => {
var tmp = times;
console.log("Maple诊断"+index)
console.log(values)
// console.log("Maple诊断"+index)
// console.log(values)
if (values != null) {
tmp[index].time =timeForm(values)
} else {
......
import React from 'react';
import styles from './index.less';
const TitleGet = (props:any) => {
return (
<>
<div className={styles.item}>{props.title}</div>
</>
);
};
export default TitleGet;
// 线栏
.font{
border-left: 5px solid rgba(24,144,255,1);
font-family:'Source Han Sans CN';
font-size: 18px;
font-weight: 600;
color: #000000;
}
.item{
.font();
text-indent: 15px;
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import { Link, useIntl, connect, Dispatch, history } from 'umi';
import { routerRedux } from 'dva/router'
import {Fromate} from '@/utils/method'
export default {
namespace: 'FacilityBookings',
state: {
......@@ -113,6 +114,8 @@ export default {
} break;
case 7: {
let tmp = resp.data;
const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
const reg2 = [["url", null]]
let sourceData = {
canReservationDay: tmp.canReservationDay,
canReservationNum: tmp.canReservationNum,
......@@ -125,10 +128,11 @@ export default {
nomarginCancelReservationDay: tmp.nomarginCancelReservationDay,
periodType: tmp.periodType,
reservationQuantumTime: tmp.reservationQuantumTime,
facilitiesImageList: tmp.facilitiesImageList,
categoriesList:tmp.categoriesList,
categoriesName: Fromate(tmp.categoriesList, reg),
categoriesDetailsImageName:Fromate(tmp.facilitiesImageList,reg2)
}
// console.log(sourceData)
console.log(sourceData)
console.log("##############################")
yield put({ type: 'returnSource', sourceData });
} break;
case 8: {
......
import React, { useState, useEffect,useRef } from 'react';
import { Input ,Tabs,Form,InputNumber,Col,Button, Row} from 'antd';
const { TabPane } = Tabs;
import {connect} from 'umi';
const layout = {
labelCol: { span: 2},
// wrapperCol: { span: 8 },
};
import { RA } from '@/utils/method';
const module = "CellList"
// const params=[
// ["residentialName":"A8",]
// ["residentialAddress":"TianHe Road No.28"]
// ["residentialHotline":"hotline"]
// ["residentialPhone":"200-8888888"]
// ["residentialEmail":"sales@huahuico.com"]
// ["residentialManagerUserName":"Mr Chen"]
// ["residentialHotlineName":"200-22122221"]
// [ "balouscheduleFile":["A.pdf"],]
// [ "serviceGuideFile":["B.pdf"],]
// ["lifeServiceFile": ["C.pdf"]]
// ]
// 小区名
// #工作时间
// 小区联系方式
// 小区管理员
// 楼巴时刻表
// 物业办事指南
// 保质期服务
// 帮助中心
import FileUpload from '@/components/FileUpload/FileUpload'
import TitleBack from '@/components/TitleBack/TitleBack'
import SearchOptionsCommnity from '@/components/SearchOptions/SearchOptionsCommnity'
import Line from '@/components/Line/Line';
const Add = (props:any) => {
const { dispatch, Data } = props;
const formRef =useRef(null)
const onFinish = (values:any) => {
console.log(values);
RA(29,values, module, dispatch);
}
useEffect(() => {
},[])
const validateMessages ={
required: '${label} is required!',
types: {
email: '${label} is not validate email!',
number: '${label} is not a validate number!',
string:'${label} is not a validate number!'
},
string: {
range: '${label} must be between ${min} and ${max}',
},
number: {
range: '${label} must be between ${min} and ${max}',
},
}
return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
<TitleBack title="Add Commnunity Infomation" ></TitleBack>
<Form ref={formRef} {...layout} name="nest-messages" onFinish={onFinish} validateMessages={validateMessages}>
<Form.Item name={"name"} label="小区名" rules={[{required:true}]}><SearchOptionsCommnity /></Form.Item>
<Form.Item name={"zipcode"} label="邮编" rules={[]}><Input style={{width: 200 }} /></Form.Item>
<Form.Item name={"residentialAddress"} label="地址" rules={[]}><Input style={{width: 300}} /></Form.Item>
<Form.Item label="小区联系方式" style={{marginBottom:0}}>
<Form.Item style={{ display: 'inline-block', width: '200' }} name={"residentialPhone"} rules={[]}><Input placeholder="小区联系电话" /></Form.Item>
<Form.Item style={{ display: 'inline-block', width: '200', marginLeft:20 }} name={"residentialEmail"} rules={[]}><Input placeholder="小区联系邮箱"/></Form.Item>
</Form.Item>
<Form.Item name={"residentialManagerUserName"} label="小区管理人员" rules={[]}><Input style={{width:200}} /></Form.Item>
<Line />
<Form.Item label="帮助中心" style={{ marginBottom: 0 }}>
<Form.Item style={{ display: 'inline-block', width: '200' }} name={"residentialHotlineName"} rules={[]}><Input placeholder="热线电话名称"/></Form.Item>
<Form.Item style={{ display: 'inline-block', width: '200', marginLeft:20 }} name={"residentialHotline"} rules={[]}><Input placeholder="热线电话"/></Form.Item>
</Form.Item>
<Line />
<Form.Item wrapperCol={{ ...layout.wrapperCol, offset: 2 }} style={{marginBottom:0}}>
<Form.Item style={{ display: 'inline-block', width: '200' }} name={"balouscheduleFile"} ><FileUpload title="choose" url={"/tos/image/upload"} data={{ imageType: "tosCreateCommunity", extends: "A9" }} reg="name" /></Form.Item>
<Form.Item style={{ display: 'inline-block', width: '200', marginLeft:100 }} name={"serviceGuideFile"}><FileUpload title="choose" url={"/tos/image/upload"} data={{ imageType: "tosCreateCommunity", extends: "A9" }} reg="name" /></Form.Item>
<Form.Item style={{ display: 'inline-block', width: '200', marginLeft:100 }} name={"lifeServiceFile"}><FileUpload title="choose" url={"/tos/image/upload"} data={{ imageType: "tosCreateCommunity", extends: "A9" }} reg="name" /></Form.Item>
</Form.Item>
<Form.Item wrapperCol={{ ...layout.wrapperCol, offset: 2 }}><Button type="primary" htmlType="submit">Submit</Button></Form.Item>
</Form>
</div>
);
};
function map(state:any) {
const { Data} = state[module]
return { Data}
}
export default connect(map)(Add);
{/* "zipcode":"510000"
"residentialName":"A8",
"residentialAddress":"TianHe Road No.28",
"residentialHotline":"hotline",
"residentialPhone":"200-8888888",
"residentialEmail":"sales@huahuico.com",
"residentialManagerUserName":"Mr Chen",
"residentialHotlineName":"200-22122221",
"balouscheduleFile":["A.pdf"],
"serviceGuideFile":["B.pdf"],
"lifeServiceFile":["C.pdf"] */}
\ No newline at end of file
......@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
import { Input ,Tabs,Table,Space, Button} from 'antd';
const { TabPane } = Tabs;
import {connect} from 'umi';
import {connect,history} from 'umi';
const columns = [
......@@ -45,12 +45,20 @@ const CellList = (props:any) => {
const CallbackSearch = (values:any) => {
RA(24, {communityName: values }, module, dispatch);
}
const goToAdd = () => {
history.push("./CellList/add");
}
return (
<div style={{ width: "100%", minWidth: 1020, padding: 34, backgroundColor: "#ffffff" }}>
{
Data != null ? <>
{/* <TitleSearch listkey={['communityName']} list={['Community Name']} onSubmit={CallBackTitleSearch}/> */}
<SearchOptionsCommnity onSubmit={CallbackSearch} />
<div style={{height:80,position:"relative"}}>
<div style={{ position: "absolute", right: 0 }}>
<Button type="primary" onClick={goToAdd}>Create new Community</Button>
</div>
</div>
<Table loading={false} rowKey="id" style={{ marginTop: 16 }}
dataSource={Data.rows}
columns={columnsVal}
......
......@@ -20,7 +20,7 @@ import SearchOptionsCommnity from '../../../components/SearchOptions/SearchOptio
// reservationQuantumTime: ["09:00-07:00"]
import { getUrlLast,numberToString } from '../../../utils/string'
import {checkParam} from '@/utils/method'
const Facility = (props:any) => {
......@@ -28,8 +28,7 @@ const Facility = (props:any) => {
const RA = (index:any,values: any) => { dispatch({ type: 'FacilityBookings/RA', playload: { index: index, body: values } }) };
const ResultClear = () => { dispatch({ type: 'FacilityBookings/ResultClear' })}
const [Ref1, setRef1] = useState([])
const [Ref2, setRef2] = useState([])
const [Ref3, setRef3] = useState([])
const [extend, setExtend] = useState(null)
......@@ -40,31 +39,9 @@ const Facility = (props:any) => {
const formRef = useRef(null);
const picFromate = (values: any) => {
var result=new Array()
if (values != null) {
values.map((item:any, index:any) => {
result.push({ url: item })
})
}
return result
}
const picFromate2 = (values: any) => {
var result=new Array()
if (values != null) {
values.map((item:any, index:any) => {
result.push({ url: item.categoriesImageUrl,name:item.categoriesName })
})
}
console.log(result)
return result
}
useEffect(() => {
if (Result != null) {
console.log("页面请求")
console.log("页面结果")
console.log(Result)
ResultClear()
history.push("/CommunityManagement/FacilityBookings")
......@@ -84,15 +61,13 @@ const Facility = (props:any) => {
}
useEffect(() => {
if (sourceData != null) {
console.log("当前数据不为空")
console.log("【传入详情,当前数据不为空】")
console.log(sourceData)
setExtend(sourceData.communityName)
setTimeExtend(sourceData.reservationQuantumTime)
// 中断
var data = sourceData.facilitiesImageList
var data2=sourceData.categoriesList
setPictrueExtend({tab:null,pic:picFromate2(data2),pics:picFromate(data)})
// setPictrueExtend({tab:null,pic:null,pics:null})
formRef.current.setFieldsValue(sourceData)
}
}, [sourceData])
......@@ -117,42 +92,21 @@ const Facility = (props:any) => {
setPATHNAME("Add Facility")
}
},[])
const PictureOptionsRef = (values:any) => {
console.log(values)
setRef1(values)
}
const TimeSelectRef = (values:any) => {
// console.log(values)
setRef3(values)
}
const PictureOptionsRowRef = (values:any) => {
// console.log(values)
setRef2(values)
}
const checkParam = (values: any) => {
var flag = true
for (var i in values) {
// console.log(values[i]);
if (values[i] == null) {
flag=false
} else {
if(values[i].length == 0){ flag=false}
}
}
return flag
}
const onFinish = (values: any) => {
var result = values
result.communityName=extend
result.categoriesName= Ref1
result.categoriesDetailsImageName = Ref2
if (Ref3.length!=0) {
result.reservationQuantumTime = Ref3
} else {
result.reservationQuantumTime = ["09:00-20:00"]
}
}
result.categoriesOpenTime = "09:00-20:00"
if (result.communityManagerFee == null) {
result.communityManagerFee=numberToString(0)
......@@ -172,10 +126,10 @@ const Facility = (props:any) => {
if (checkParam(result)) {
console.log('Success:', result);
//中断
if (pictrueExtend.tab == 3) {
console.log("提交")
if (pictrueExtend.tab == 3) {
if (Result == null) {
RA(6, result);
console.log("提交")
// RA(6, result);
}
} else {
result.id = DataSave.id
......@@ -190,12 +144,15 @@ const Facility = (props:any) => {
}else{message.error("Error,Please finish it,not empty!",3)}
};
const onBillChange = (values: any, allValues: any) => {
if (values["communityName"] != null) {
setExtend(values["communityName"])
}
}
const onFinishFailed = (errorInfo:any) => {
console.log('Failed:', errorInfo);
};
const extendName = (values:any) => {
setExtend(values)
}
const Subscribe = () => {
history.push(getUrlLast(location.pathname)+ "/FacilityApply")
}
......@@ -218,16 +175,19 @@ const Facility = (props:any) => {
formRef.current.setFieldsValue(tmp)
}
const test = () => {
console.log(extend)
}
return (
<div className={styles.base}>
{/* 头部组件v1.2 */}
<TitleBack title={PATHNAME} url={getUrlLast(location.pathname)+"?Facility=true"}/>
<Form ref={formRef} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed} >
<TitleBack title={PATHNAME} url={getUrlLast(location.pathname) + "?Facility=true"} />
<Form ref={formRef} name="basic" onFinish={onFinish} onFinishFailed={onFinishFailed} onValuesChange={onBillChange} >
<Row gutter={32}>
<Col>所属小区</Col>
<Col><SearchOptionsCommnity defaultValue={extend} onSubmit={extendName} disabled={pictrueExtend.tab!=3?true:false} /></Col>
<Col><Form.Item name="communityName" ><SearchOptionsCommnity disabled={pictrueExtend.tab!=3?true:false} /></Form.Item></Col>
</Row>
<Row gutter={32} style={{marginTop:28}}>
<Col>设施名称</Col>
......@@ -240,74 +200,34 @@ const Facility = (props:any) => {
<Row gutter={32} style={{ marginTop: 28 }}>
{
extend != null ?
<><Col>设施品类</Col>
<Col>
{
pictrueExtend.pic!=null
?
<PictureOptions disabled={facilityDetail} defultValue={[]} putSubmit={PictureOptionsRef}
data={{
userToken: token,
imageType: 'categoriesImageName',
extends: extend,
}}
defultValue={pictrueExtend.pic}
/>
:null
}
{
pictrueExtend.tab == 3 ? <>
<PictureOptions disabled={facilityDetail} defultValue={[]} putSubmit={PictureOptionsRef}
data={{
userToken: token,
imageType: 'categoriesImageName',
extends: extend,
}} />
</>
:null
}
</Col>
extend != null ?<>
<Col>设施品类</Col>
<Col>
<Form.Item name="categoriesName" >
<PictureOptions disabled={facilityDetail}
data={{
userToken: token,
imageType: 'categoriesImageName',
extends: extend,
}} /></Form.Item > </Col>
</> : null
}
</Row>
<Row gutter={32} style={{ marginTop: 28 }}>
{
extend != null ?
extend != null ?<>
<Col>设施详情</Col>
:null
}
{/* 未完成 */}
<Col>
{
pictrueExtend.pics!=null
?
<PictureOptionsRow disabled={facilityDetail} putSubmit={PictureOptionsRowRef} data={{
userToken: token,
imageType: 'categoriesDetailsImageName',
extends: extend,
}}
defultValue={pictrueExtend.pics} />
:null
}
{
pictrueExtend.tab == 3 ? <>
{
extend != null ?
<PictureOptionsRow disabled={facilityDetail} putSubmit={PictureOptionsRowRef} data={{
userToken: token,
imageType: 'categoriesDetailsImageName',
extends: extend,
}}/>
:null
}
<Col>
<Form.Item name="categoriesDetailsImageName" >
<PictureOptionsRow disabled={facilityDetail}
data={{
userToken: token,
imageType: 'categoriesDetailsImageName',
extends: extend,
}} /></Form.Item ></Col>
</>
:null
}
</Col>
}
</Row>
<Line />
<Row gutter={32} style={{marginTop:28}}>
......
import React, { useState, useEffect,useRef} from 'react';
import styles from './ContractContent.less';
import { Input ,Form,Table,Space,Pagination,Tooltip, message } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
import { Link, useIntl, connect, Dispatch } from 'umi';
import { DatePicker } from 'antd';
import { Upload, Button } from 'antd';
import { UploadOutlined } from '@ant-design/icons';
import LINE from '../../components/Line/Line';
import TextArea from 'antd/lib/input/TextArea';
......@@ -62,13 +62,13 @@ const ContractContent = (props: any) => {
if (editFlag) {
setExtend(DataSaveDetail.communityName)
var result=new Array()
if (DataSaveDetail.fileUrls != null) {
// if (DataSaveDetail.fileUrls != null) {
DataSaveDetail.fileUrls.map((item:any, index:any) => {
result.push({ uid: index,name:item })
})
}
setFileList(result)
// DataSaveDetail.contractFileName.map((item:any, index:any) => {
// result.push({ uid: index,name:item })
// })
// }
setFileList([{ uid: 1,name:DataSaveDetail.contractFileName }])
formRef.current.setFieldsValue({
contractFileName: "cleanFiles",
......@@ -180,7 +180,7 @@ const ContractContent = (props: any) => {
) : (
<div className={styles.box7}>
<div className={styles.box7item1}>Contract</div>
<div className={styles.box7item2}>.PDF</div>
<div className={styles.box7item2}>{DataSaveDetail!=null?DataSaveDetail.contractFileName:null}</div>
<div className={styles.box7item3}><a href={DataSaveDetail!=null?DataSaveDetail.fileUrls:null}>Preview</a></div>
</div>
)
......
......@@ -32,10 +32,8 @@ const Guard = (props:any) => {
);
return (
<div className={styles.base}>
<TitleGet title={"Version 1.0.6"} />
<TitleGet title={"Version 1.0.7"} />
<p>
token:{page.token}
</p>
......
......@@ -90,7 +90,9 @@ const requestList = [
["/tos/tosCommunity/get", "24 获取小区列表"],
["/tos/tosCommunityNotic/get", "25 获取小区公告列表"],
["/tos/tosVisitorRecord/get", "26 获取访客记录列表"],
["/tos/contract/add","27 合同新增和编辑"],
["/tos/contract/add", "27 合同新增和编辑"],
["/tos/tosCommunityNotic/add", "28 新增小区公告接口"],
["/tos/tosManageCommunity/save","29 新建一个小区"]
]
const params = [
......@@ -113,3 +115,40 @@ export function RA(playload: any) {
// console.log(playload)
// console.log(playload.index)
// console.log(requestList[playload.index])
// http://47.74.233.180:8651/tos/tosCommunityNotic/add
// {
// "noticTitle":"Garden公告",
// "communityNum":"珠江丽景小区",
// "noticText":"今晚晚上停水4小时",
// "noticScope":"1",
// "noticStartTime":"2020-07-01 12:30:00",
// "noticEndTime":"2020-08-01 9:30:00",
// "file":["A.jpg"]
// }
//新增小区公告接口文件上传 http://47.74.233.180:8651/tos/image/upload imageType 参数值为 tosNotice
// 48、新建一个小区
// http://47.74.233.180:8651/tos/tosManageCommunity/save
// {
// "residentialName":"A8",
// "residentialAddress":"TianHe Road No.28",
// "residentialHotline":"hotline",
// "residentialPhone":"200-8888888",
// "residentialEmail":"sales@huahuico.com",
// "residentialManagerUserName":"Mr Chen",
// "residentialHotlineName":"200-22122221",
// "balouscheduleFile":["A.pdf"],
// "serviceGuideFile":["B.pdf"],
// "lifeServiceFile":["C.pdf"]
// }
// 49、新建一个小区-上传楼巴办事指南
// http://localhost:8651/tos/image/upload
// imageType 值为 tosCreateCommunity
// extends 值为 对应小区名 如 A9
......@@ -14,6 +14,7 @@ export const checkParam = (values: any) => {
return flag
}
// onBlur={checkInput} maxLength={33}
export const checkInput = (e: any) => {
// console.log(e)
......@@ -55,14 +56,32 @@ export const setCookie=(key:string,value: string)=>{
export const RA = (index: any, values: any, module: string, dispatch: any) => { dispatch({ type: module + '/RA', playload: { index: index, body: values } }) };
const Fromate = (values: any,valuesForm) => {
// const reg = [["url", "categoriesImageUrl"], ["name", "categoriesName"]]
// const values = [{ categoriesImageUrl: "http://url", categoriesName: "A9" },{ categoriesImageUrl: "http://url...", categoriesName: "A8" }]
export const Fromate = (values:any,reg:any) => {
var result=new Array()
if (values != null) {
values.map((item:any, index:any) => {
result.push({ uid: index,name:item.categoriesName })
var obj={}
for (var i = 0; i < reg.length; i++){
if (reg[i][1] == null) {
obj[reg[i][0]]=item
} else {
obj[reg[i][0]] = item[reg[i][1]]
}
}
result.push(obj)
})
}
console.log(result)
return result
}
// const reg2 = "name"
// const values2 = [{name:"kat",url:"longtime"},{name:"jack",url:"longtime2"}]
export const Fromate2 = (values:any, reg:string) => {
var result = new Array()
values.map((item:any, index:number) => {
result.push(item[reg]);
})
return result
}
\ 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