Commit 7eab4fdc authored by cellee's avatar cellee

Merge branch 'final' of http://120.77.240.215:9701/Maple/tostumi.git into final

parents 212aeb1a 37a02ed2
...@@ -5,4 +5,7 @@ module.exports = { ...@@ -5,4 +5,7 @@ module.exports = {
page: true, page: true,
REACT_APP_ENV: true, REACT_APP_ENV: true,
}, },
rules: {
}
}; };
import React, { useState, useEffect, useRef } from 'react'; import React, { useState, useEffect, useRef } from 'react';
import styles from './Edit.less'; import { Input, Button, Form, Spin, message, Checkbox } from 'antd';
import { Input, Button, Form, Spin, Radio, message, Checkbox } from 'antd';
import { connect, history } from 'umi'; import { connect, history } from 'umi';
import { RA } from '@/utils/method';
import { CheckboxValueType } from 'antd/lib/checkbox/Group';
import SelectOptions from '../../../components/SelectOptions/index'; import SelectOptions from '../../../components/SelectOptions/index';
import TitleBack from '../../../components/TitleBack/TitleBack'; import TitleBack from '../../../components/TitleBack/TitleBack';
import { RA } from '@/utils/method'; import styles from './Edit.less';
const module = 'User'; const module = 'User';
let options: Array<{ label: string; value: number }> = []; let options: Array<{ label: string; value: number }> = [];
...@@ -30,6 +31,11 @@ const Edit = (props: any) => { ...@@ -30,6 +31,11 @@ const Edit = (props: any) => {
}; };
const formRef = useRef(null as any); const formRef = useRef(null as any);
// 选择服务商事件
const onSelectCheckBox = (checkedValue: CheckboxValueType[]) => {
console.log(checkedValue);
};
// 拿取服务范围数据 // 拿取服务范围数据
useEffect(() => { useEffect(() => {
RA(43, {}, module, dispatch); RA(43, {}, module, dispatch);
...@@ -57,7 +63,6 @@ const Edit = (props: any) => { ...@@ -57,7 +63,6 @@ const Edit = (props: any) => {
}, []); }, []);
useEffect(() => { useEffect(() => {
console.log(CurData);
if (CurData != null) { if (CurData != null) {
setload(false); setload(false);
dispatch({ type: 'ServiceProvider/CurDataClear', playload: {} }); dispatch({ type: 'ServiceProvider/CurDataClear', playload: {} });
...@@ -69,7 +74,7 @@ const Edit = (props: any) => { ...@@ -69,7 +74,7 @@ const Edit = (props: any) => {
setCList(SaveChooseData.serviceCommunityList); setCList(SaveChooseData.serviceCommunityList);
if (SaveChooseData.serviceScopeList.length <= 1) { if (SaveChooseData.serviceScopeList.length <= 1) {
// 处理服务范围数据 // 处理服务范围数据
optionsList.forEach((v, index) => { optionsList.forEach((v) => {
if (v.serviceName === SaveChooseData.serviceScope) { if (v.serviceName === SaveChooseData.serviceScope) {
SaveChooseData.serviceScopeList[0] = v.serviceCode; SaveChooseData.serviceScopeList[0] = v.serviceCode;
} }
...@@ -92,10 +97,10 @@ const Edit = (props: any) => { ...@@ -92,10 +97,10 @@ const Edit = (props: any) => {
// 提交按钮 // 提交按钮
const onFinish = (values: any) => { const onFinish = (values: any) => {
if (CList.length === 0) { if (CList.length === 0) {
message.warning('Please select at least one service Community!', 3); // message.warning('Please select at least one service Community!', 3);
return; return;
} }
var val = values; const val = values;
val.serviceCommunityList = CList; val.serviceCommunityList = CList;
val.creator = 'admin'; val.creator = 'admin';
val.updater = 'admin'; val.updater = 'admin';
...@@ -147,7 +152,7 @@ const Edit = (props: any) => { ...@@ -147,7 +152,7 @@ const Edit = (props: any) => {
</div> </div>
</div> </div>
<div className={styles.line}></div> <div className={styles.line} />
<SelectOptions <SelectOptions
list={CommunityList ? CommunityList.sort() : []} list={CommunityList ? CommunityList.sort() : []}
...@@ -167,7 +172,7 @@ const Edit = (props: any) => { ...@@ -167,7 +172,7 @@ const Edit = (props: any) => {
}, },
]} ]}
> >
<Checkbox.Group options={options as any} /> <Checkbox.Group options={options as any} onChange={onSelectCheckBox} />
{/* <Radio.Group options={options as any} /> */} {/* <Radio.Group options={options as any} /> */}
</Form.Item> </Form.Item>
</div> </div>
...@@ -227,7 +232,7 @@ const Edit = (props: any) => { ...@@ -227,7 +232,7 @@ const Edit = (props: any) => {
</div> </div>
</div> </div>
<div className={styles.line}></div> <div className={styles.line} />
<Form.Item> <Form.Item>
<Button type="primary" htmlType="submit"> <Button type="primary" htmlType="submit">
Submit Submit
......
import React, { useEffect } from 'react'; import React, { useEffect } from 'react';
import styles from './Guard.less';
import { Modal, Button, message } from 'antd'; import { Modal, Button, message } from 'antd';
import { ExclamationCircleOutlined } from '@ant-design/icons';
const { confirm } = Modal;
import { connect } from 'umi'; import { connect } from 'umi';
import { ExclamationCircleOutlined } from '@ant-design/icons';
import styles from './Guard.less';
import { timestampToTime } from '../../../utils/time';
import Line from '../../../components/Line/Line'; import Line from '../../../components/Line/Line';
import BackButton from '../../../components/BackButton/BackButton'; import BackButton from '../../../components/BackButton/BackButton';
import TitleGet from '../../../components/TitleGet/TitleGet'; import TitleGet from '../../../components/TitleGet/TitleGet';
import { timestampToTime } from '../../../utils/time';
const { confirm } = Modal;
const Guard = (props: any) => { const Guard = (props: any) => {
const { CurDataFollowDetail, dispatch, history } = props; const { CurDataFollowDetail, dispatch, history } = props;
console.log(CurDataFollowDetail);
useEffect(() => { useEffect(() => {
if (!CurDataFollowDetail) { if (!CurDataFollowDetail) {
history.goBack(); history.goBack();
...@@ -25,7 +23,7 @@ const Guard = (props: any) => { ...@@ -25,7 +23,7 @@ const Guard = (props: any) => {
const handleClickBtn = (id: string) => { const handleClickBtn = (id: string) => {
const permissionArr = JSON.parse(localStorage.getItem('permission') || ''); const permissionArr = JSON.parse(localStorage.getItem('permission') || '');
if (permissionArr.indexOf('14') < 0) { if (permissionArr.indexOf('14') < 0) {
message.error('No Permissions!!!', 3); // message.error('No Permissions!!!', 3);
return; return;
} }
confirm({ confirm({
...@@ -38,16 +36,13 @@ const Guard = (props: any) => { ...@@ -38,16 +36,13 @@ const Guard = (props: any) => {
playload: { id }, playload: { id },
}); });
}, },
onCancel() {
console.log('Cancel');
},
}); });
}; };
return CurDataFollowDetail ? ( return CurDataFollowDetail ? (
<div className={styles.base}> <div className={styles.base}>
<div className={styles.item0}> <div className={styles.item0}>
<TitleGet title={'Edit Security Guard Account'} /> <TitleGet title="Security Guard Account Details" />
</div> </div>
<div className={styles.item0_1}>Status:Normal</div> <div className={styles.item0_1}>Status:Normal</div>
<div className={styles.item0_1}> <div className={styles.item0_1}>
...@@ -59,23 +54,23 @@ const Guard = (props: any) => { ...@@ -59,23 +54,23 @@ const Guard = (props: any) => {
<div className={styles.item2}> <div className={styles.item2}>
<BackButton /> <BackButton />
</div> </div>
<div className={styles.clear0}></div> <div className={styles.clear0} />
<div className={styles.item1}>Company Name</div> <div className={styles.item1}>Company Name</div>
<div className={styles.item1_1}>{CurDataFollowDetail.companyName}</div> <div className={styles.item1_1}>{CurDataFollowDetail.companyName}</div>
<div className={styles.clear1}></div> <div className={styles.clear1} />
<div className={styles.item1}>User Name</div> <div className={styles.item1}>User Name</div>
<div className={styles.item1_1}>{CurDataFollowDetail.saferName}</div> <div className={styles.item1_1}>{CurDataFollowDetail.saferName}</div>
<div className={styles.clear1}></div> <div className={styles.clear1} />
<div className={styles.item1}>Contact Details</div> <div className={styles.item1}>Contact Details</div>
<div className={styles.item1_1}>{CurDataFollowDetail.saferPhone}</div> <div className={styles.item1_1}>{CurDataFollowDetail.saferPhone}</div>
<div className={styles.clear1}></div> <div className={styles.clear1} />
<div className={styles.item1}>Email</div> <div className={styles.item1}>Email</div>
<div className={styles.item1_1}>{CurDataFollowDetail.saferEmail}</div> <div className={styles.item1_1}>{CurDataFollowDetail.saferEmail}</div>
<div className={styles.clear1}></div> <div className={styles.clear1} />
<Line /> <Line />
......
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