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