Commit 1421fe2b authored by cellee's avatar cellee

文字更改,小区列表上传模块重做

Signed-off-by: cellee's avatarcellee <893264950@qq.com>
parent f7f8ea16
...@@ -61,7 +61,7 @@ class AvatarDropdown extends React.Component<GlobalHeaderRightProps> { ...@@ -61,7 +61,7 @@ class AvatarDropdown extends React.Component<GlobalHeaderRightProps> {
<Menu.Item key="logout"> <Menu.Item key="logout">
<LogoutOutlined /> <LogoutOutlined />
退出登录 Sign Out
</Menu.Item> </Menu.Item>
</Menu> </Menu>
); );
...@@ -73,16 +73,16 @@ class AvatarDropdown extends React.Component<GlobalHeaderRightProps> { ...@@ -73,16 +73,16 @@ class AvatarDropdown extends React.Component<GlobalHeaderRightProps> {
</span> </span>
</HeaderDropdown> </HeaderDropdown>
) : ( ) : (
<span className={`${styles.action} ${styles.account}`}> <span className={`${styles.action} ${styles.account}`}>
<Spin <Spin
size="small" size="small"
style={{ style={{
marginLeft: 8, marginLeft: 8,
marginRight: 8, marginRight: 8,
}} }}
/> />
</span> </span>
); );
} }
} }
......
...@@ -138,15 +138,15 @@ class SelectOptions extends React.PureComponent { ...@@ -138,15 +138,15 @@ class SelectOptions extends React.PureComponent {
}); });
} else { } else {
this.setState({ this.setState({
selectoptionsOpen: 'Open', selectoptionsOpen: 'Collapse ',
selectoptionsPutItAway: 'Put It Away', selectoptionsPutItAway: 'Close ',
selectoptionsSelected: 'Selected', selectoptionsSelected: 'Selected',
selectoptionsSelectAll: 'Select All', selectoptionsSelectAll: 'Select All',
selectoptionsSelectNone: 'Unselect All', selectoptionsSelectNone: 'Unselect All',
selectoptionsAll: 'All', selectoptionsAll: 'All',
selectoptionsSearchCell: 'Search cell', selectoptionsSearchCell: 'Search cell',
selectoptionsAllCell: 'All Cell', selectoptionsAllCell: ' All',
componetVisible: 'Put It Away', componetVisible: 'Close',
}); });
} }
// console.log("初始化2") // console.log("初始化2")
......
This diff is collapsed.
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { connect } from 'dva'; import { connect } from 'dva';
import { LeftOutlined, EditOutlined, UploadOutlined, LinkOutlined } from '@ant-design/icons'; import {
LeftOutlined,
EditOutlined,
UploadOutlined,
LinkOutlined,
PlusOutlined,
} from '@ant-design/icons';
import { Form, Input, Button, TimePicker, Checkbox, Upload, message, Spin } from 'antd'; import { Form, Input, Button, TimePicker, Checkbox, Upload, message, Spin } from 'antd';
// 样式 // 样式
import './celllist.less'; import './celllist.less';
...@@ -10,6 +16,7 @@ import { village } from '@/utils/tip'; ...@@ -10,6 +16,7 @@ import { village } from '@/utils/tip';
import moment from 'moment'; import moment from 'moment';
import { getNumber } from '@/utils/string'; // 正则 import { getNumber } from '@/utils/string'; // 正则
import imgs from '@/assets/logo_icon_bg.png';
const { RangePicker } = TimePicker; const { RangePicker } = TimePicker;
...@@ -90,11 +97,11 @@ const Adds = (props: any) => { ...@@ -90,11 +97,11 @@ const Adds = (props: any) => {
}, [Data]); }, [Data]);
// 返回上传格式 和 地址 // 返回上传格式 和 地址
function backUpload(str: string, index: number) { function backUpload(str: string, index: number, url?: any) {
let a = { let a = {
uid: str + index, uid: str + index,
name: str, name: str,
url: 'http://', url: url ? url : imgs,
}; };
return a; return a;
} }
...@@ -109,63 +116,50 @@ const Adds = (props: any) => { ...@@ -109,63 +116,50 @@ const Adds = (props: any) => {
// 楼巴上传 // 楼巴上传
const upload1 = { const upload1 = {
onChange(info: any) { onChange({ file, fileList }: any) {
if (codename !== '') { console.log(file);
let po = new Array(); console.log(fileList);
po.push(info.fileList[info.fileList.length - 1]); if (file.status === 'done') {
// 给楼巴上传列表值 setLouba(fileList);
console.log(po);
setLouba(po);
setcodeStrat(true); setcodeStrat(true);
setTipMain('Binding Content Already Exists, Cannot Be Modified!'); setTipMain('Binding Content Already Exists, Cannot Be Modified!');
// 结果
uploadMsg(info);
} else {
message.warning('Please Fill In The Community Name');
} }
// 结果
uploadMsg(file);
}, },
}; };
// 指南上传 // 指南上传
const upload2 = { const upload2 = {
onChange(info: any) { onChange({ file, fileList }: any) {
if (codename !== '') { if (file.status === 'done') {
let po = new Array(); setGuide(fileList);
po.push(info.fileList[info.fileList.length - 1]);
// 给楼巴上传列表值
setGuide(po);
setcodeStrat(true); setcodeStrat(true);
setTipMain('Binding Content Already Exists, Cannot Be Modified!'); setTipMain('Binding Content Already Exists, Cannot Be Modified!');
// 结果
uploadMsg(info);
} else {
message.warning('Please Fill In The Community Name');
} }
// 结果
uploadMsg(file);
}, },
}; };
// 保质期上传 // 保质期上传
const upload3 = { const upload3 = {
onChange(info: any) { onChange({ file, fileList }: any) {
if (codename !== '') { if (file.status === 'done') {
let po = new Array(); setPeriod(fileList);
po.push(info.fileList[info.fileList.length - 1]);
// 给楼巴上传列表值 以及禁止修改小区名
setPeriod(po);
setcodeStrat(true); setcodeStrat(true);
setTipMain('Binding Content Already Exists, Cannot Be Modified!'); setTipMain('Binding Content Already Exists, Cannot Be Modified!');
// 结果
uploadMsg(info);
} else {
message.warning('Please Fill In The Community Name');
} }
// 结果
uploadMsg(file);
}, },
}; };
// 上传提示 // 上传提示
function uploadMsg(info: any) { function uploadMsg(file: any) {
if (info.file.status === 'done') { if (file.status === 'done') {
message.success(`${info.file.name} File Uploaded Successfully`); message.success(`${file.name} File Uploaded Successfully`);
} else if (info.file.status === 'error') { } else if (file.status === 'error') {
message.error(`${info.file.name} File Upload Failed.`); message.error(`${file.name} File Upload Failed.`);
} }
} }
...@@ -263,7 +257,7 @@ const Adds = (props: any) => { ...@@ -263,7 +257,7 @@ const Adds = (props: any) => {
}; };
// 小区名输入监听ant // 小区名输入监听ant
function insdInp(value: string, prevValue, prevValues) { function insdInp(value: string) {
setCodeName(value); setCodeName(value);
return value; return value;
} }
...@@ -278,13 +272,21 @@ const Adds = (props: any) => { ...@@ -278,13 +272,21 @@ const Adds = (props: any) => {
e.target.value = keyup_tool(e.target.value); e.target.value = keyup_tool(e.target.value);
}; };
// 上传按钮
const uploadButton = (
<div>
<PlusOutlined />
<div style={{ marginTop: 8 }}>Upload</div>
</div>
);
return ( return (
<> <>
<Spin spinning={loading} tip="loading..." size="large"> <Spin spinning={loading} tip="loading..." size="large">
<div className="form"> <div className="form">
<h3 className="capi"> <h3 className="capi">
<EditOutlined /> <EditOutlined />
&nbsp; {Data ? 'edit' : 'establish'} community &nbsp; {Data ? 'edit' : 'Create New'} community
<div className="back"> <div className="back">
<Button onClick={goToReturn}> <Button onClick={goToReturn}>
<LeftOutlined /> <LeftOutlined />
...@@ -363,7 +365,7 @@ const Adds = (props: any) => { ...@@ -363,7 +365,7 @@ const Adds = (props: any) => {
</Form.Item> </Form.Item>
<Form.Item <Form.Item
label="Administrators" label="Administrator"
name="residentialManagerUserName" name="residentialManagerUserName"
rules={village[6] as any} rules={village[6] as any}
> >
...@@ -393,54 +395,64 @@ const Adds = (props: any) => { ...@@ -393,54 +395,64 @@ const Adds = (props: any) => {
<hr /> <hr />
{/* 上传部分 */} {/* 上传部分 */}
<Form.Item <Form.Item
label="Louba Timetable" label="Shuttle Bus Timetable"
name="balouscheduleFile" name="balouscheduleFile"
style={{ marginBottom: '0' }} style={{ marginBottom: '0' }}
> >
<Upload {...uploads} {...upload1} fileList={loubaUpload} showUploadList={false}> <Upload
<Button icon={<UploadOutlined />}>Click to Upload</Button> {...uploads}
{...upload1}
fileList={loubaUpload}
listType="picture-card"
disabled={codename == '' ? true : false}
>
{loubaUpload.length >= 1 ? null : uploadButton}
</Upload> </Upload>
<div className="tip"> <div className="tip">
<p className={loubaUpload.length > 0 ? 'show' : ''}>
<LinkOutlined color="#409EFF" />
{loubaUpload.length > 0 ? loubaUpload[0].name : ''}
</p>
<span>Support Files:.jpg, .png, .pdf</span> <span>Support Files:.jpg, .png, .pdf</span>
</div> </div>
</Form.Item> </Form.Item>
{/* 上传部分 */}
<Form.Item label="Property Guide" name="serviceGuideFile" style={{ marginBottom: '0' }}> <Form.Item label="Property Guide" name="serviceGuideFile" style={{ marginBottom: '0' }}>
<Upload {...uploads} {...upload2} fileList={guideUpload} showUploadList={false}> <Upload
<Button icon={<UploadOutlined />}>Click to Upload</Button> {...uploads}
{...upload2}
fileList={guideUpload}
listType="picture-card"
disabled={codename == '' ? true : false}
>
{guideUpload.length >= 1 ? null : uploadButton}
</Upload> </Upload>
<div className="tip"> <div className="tip">
<p className={guideUpload.length > 0 ? 'show' : ''}>
<LinkOutlined color="#409EFF" />
{guideUpload.length > 0 ? guideUpload[0].name : ''}
</p>
<span>Support Files:.jpg, .png, .pdf</span> <span>Support Files:.jpg, .png, .pdf</span>
</div> </div>
</Form.Item> </Form.Item>
{/* 上传部分 */}
<Form.Item <Form.Item
label="Period Of Service" label="Warranty Period Service"
name="lifeServiceFile" name="lifeServiceFile"
style={{ marginBottom: '0' }} style={{ marginBottom: '0' }}
> >
<Upload {...uploads} {...upload3} fileList={periodUpload} showUploadList={false}> <Upload
<Button icon={<UploadOutlined />}>Click to Upload</Button> {...uploads}
{...upload3}
fileList={periodUpload}
listType="picture-card"
disabled={codename == '' ? true : false}
>
{periodUpload.length >= 1 ? null : uploadButton}
</Upload> </Upload>
<div className="tip"> <div className="tip">
<p className={periodUpload.length > 0 ? 'show' : ''}>
<LinkOutlined color="#409EFF" />
{periodUpload.length > 0 ? periodUpload[0].name : ''}
</p>
<span>Support Files:.jpg, .png, .pdf</span> <span>Support Files:.jpg, .png, .pdf</span>
</div> </div>
</Form.Item> </Form.Item>
<hr /> <hr />
{/* 帮助中心 */} {/* 帮助中心 */}
<Form.Item label="Help Center" name="help"> <Form.Item label="Help Center" name="help">
<Input.Group compact> <Input.Group compact>
......
...@@ -169,7 +169,7 @@ const CellLists = (props: any) => { ...@@ -169,7 +169,7 @@ const CellLists = (props: any) => {
toolBarRender={() => [ toolBarRender={() => [
<Button key="3" type="primary" onClick={goToAdd}> <Button key="3" type="primary" onClick={goToAdd}>
<PlusOutlined /> <PlusOutlined />
Create new Community Create New Community
</Button>, </Button>,
]} ]}
options={{ options={{
......
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