Commit 9342b445 authored by cellee's avatar cellee

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

parents 1890b26c ca331f73
...@@ -57,9 +57,6 @@ class TagSelect extends React.Component { ...@@ -57,9 +57,6 @@ class TagSelect extends React.Component {
handleInputConfirm = () => { handleInputConfirm = () => {
const { inputValue } = this.state; const { inputValue } = this.state;
let { value } = this.state; let { value } = this.state;
console.log(value);
console.log(inputValue);
if (!inputValue.trim()) { if (!inputValue.trim()) {
message.error('Not Null!!!'); message.error('Not Null!!!');
return; return;
...@@ -78,6 +75,7 @@ class TagSelect extends React.Component { ...@@ -78,6 +75,7 @@ class TagSelect extends React.Component {
}; };
handleEditInputChange = (e) => { handleEditInputChange = (e) => {
console.log(e.target.value);
this.setState({ editInputValue: e.target.value }); this.setState({ editInputValue: e.target.value });
}; };
...@@ -85,6 +83,7 @@ class TagSelect extends React.Component { ...@@ -85,6 +83,7 @@ class TagSelect extends React.Component {
this.setState(({ value, editInputIndex, editInputValue }) => { this.setState(({ value, editInputIndex, editInputValue }) => {
const newTags = [...value]; const newTags = [...value];
newTags[editInputIndex] = editInputValue; newTags[editInputIndex] = editInputValue;
this.props.onAdd(editInputValue, editInputIndex);
this.props.onChange(newTags); this.props.onChange(newTags);
return { return {
value: newTags, value: newTags,
...@@ -104,19 +103,14 @@ class TagSelect extends React.Component { ...@@ -104,19 +103,14 @@ class TagSelect extends React.Component {
render() { render() {
const { value, inputVisible, inputValue, editInputIndex, editInputValue, visible } = this.state; const { value, inputVisible, inputValue, editInputIndex, editInputValue, visible } = this.state;
return ( return (
<> <>
<Tag className="editTag" key="Accountant">
Accountant
</Tag>
{value.map((tag, index) => { {value.map((tag, index) => {
if (editInputIndex === index) { if (editInputIndex === index) {
return ( return (
<Input <Input
ref={this.saveEditInputRef} ref={this.saveEditInputRef}
key={tag.serviceName} key={tag}
size="small" size="small"
className={styles.tagInput} className={styles.tagInput}
value={editInputValue} value={editInputValue}
...@@ -132,25 +126,27 @@ class TagSelect extends React.Component { ...@@ -132,25 +126,27 @@ class TagSelect extends React.Component {
const tagElem = ( const tagElem = (
<Tag <Tag
className="editTag" className="editTag"
key={tag.serviceName} key={tag}
closable={index !== -1} closable={index !== 0 && index !== 1}
onClose={(e) => this.handleClose(tag, e)} onClose={(e) => this.handleClose(tag, e)}
visible={true} visible={true}
> >
{/* <span <span
onDoubleClick={(e) => { onDoubleClick={(e) => {
this.setState({ editInputIndex: index, editInputValue: tag.serviceName }, () => { if (index !== 0 && index !== 1) {
this.editInput.focus(); this.setState({ editInputIndex: index, editInputValue: tag }, () => {
}); this.editInput.focus();
e.preventDefault(); });
e.preventDefault();
}
}} }}
> */} >
{isLongTag ? `${value.slice(0, 20)}...` : tag.serviceName} {isLongTag ? `${value.slice(0, 20)}...` : tag}
{/* </span> */} </span>
</Tag> </Tag>
); );
return isLongTag ? ( return isLongTag ? (
<Tooltip title={tag.serviceName} key={tag.serviceName}> <Tooltip title={tag} key={tag}>
{tagElem} {tagElem}
</Tooltip> </Tooltip>
) : ( ) : (
......
...@@ -111,6 +111,12 @@ export default { ...@@ -111,6 +111,12 @@ export default {
console.log(playload); console.log(playload);
const res = yield call(service.TosGuarderDel, playload); const res = yield call(service.TosGuarderDel, playload);
console.log(res); console.log(res);
if (res.error_code === '0000') {
message.success(res.error_msg);
history.go(-1);
} else {
message.error('Deletion failed,Please try again');
}
}, },
}, },
}; };
...@@ -111,6 +111,9 @@ const UsersDetail = (props: any) => { ...@@ -111,6 +111,9 @@ const UsersDetail = (props: any) => {
id: DataSave.id, id: DataSave.id,
owerName: DataSave.owerName, owerName: DataSave.owerName,
enable: DataSave.enable, enable: DataSave.enable,
buildingNumber: DataSave.buildingNumber,
floorNumber: DataSave.floorNumber,
roomNumber: DataSave.roomNumber,
}); });
} else { } else {
history.go(-1); history.go(-1);
......
...@@ -9,10 +9,14 @@ import { RA, ClearResult } from '@/utils/method'; ...@@ -9,10 +9,14 @@ import { RA, ClearResult } from '@/utils/method';
import TitleBack from '@/components/TitleBack/TitleBack'; import TitleBack from '@/components/TitleBack/TitleBack';
const module = 'User'; const module = 'User';
interface DataType {
serviceName: string;
id: string;
}
const Services = (props: any) => { const Services = (props: any) => {
const { dispatch, DataServices, Result } = props; const { dispatch, DataServices, Result } = props;
const formRef = useRef(null as any); const formRef = useRef(null as any);
const [DataList, setDataList] = useState(Object);
useEffect(() => { useEffect(() => {
RA(43, {}, module, dispatch); RA(43, {}, module, dispatch);
...@@ -21,17 +25,10 @@ const Services = (props: any) => { ...@@ -21,17 +25,10 @@ const Services = (props: any) => {
useEffect(() => { useEffect(() => {
if (DataServices != null) { if (DataServices != null) {
console.log(DataServices); console.log(DataServices);
// let tmp = DataServices.data.rows.map((v: object, i: number) => { setDataList(DataServices.data.rows);
// return v['serviceName']; let tmp = DataServices.data.rows.map(
// });
// console.log(tmp);
// tmp = tmp.filter((v: string) => {
// return v !== 'Accountant';
// });
let tmp = DataServices.data.rows.filter(
(v: { serviceName: string; deleted: number }, i: number) => { (v: { serviceName: string; deleted: number }, i: number) => {
return v.serviceName !== 'Accountant' && v.deleted !== 1 && v; return v.deleted !== 1 && v.serviceName;
}, },
); );
console.log(tmp); console.log(tmp);
...@@ -40,12 +37,12 @@ const Services = (props: any) => { ...@@ -40,12 +37,12 @@ const Services = (props: any) => {
}, [DataServices]); }, [DataServices]);
// 添加服务范围 // 添加服务范围
const Add = (values: string) => { const Add = (values: string, index?: number) => {
console.log(values);
RA( RA(
44, 44,
{ {
serviceName: values, serviceName: values,
id: index ? DataList[index].id : null,
}, },
module, module,
dispatch, dispatch,
...@@ -53,16 +50,19 @@ const Services = (props: any) => { ...@@ -53,16 +50,19 @@ const Services = (props: any) => {
}; };
// 删除服务范围 // 删除服务范围
const Remove = (values: { id: string }) => { const Remove = (values: string) => {
console.log(values); DataList.forEach((obj: DataType) => {
RA( if (obj.serviceName === values) {
53, RA(
{ 53,
id: values.id, {
}, id: obj.id,
module, },
dispatch, module,
); dispatch,
);
}
});
}; };
useEffect(() => { useEffect(() => {
...@@ -71,7 +71,7 @@ const Services = (props: any) => { ...@@ -71,7 +71,7 @@ const Services = (props: any) => {
if (Result.error_code !== '0000') { if (Result.error_code !== '0000') {
message.error('Failed: binding service provider!!!'); message.error('Failed: binding service provider!!!');
} else { } else {
message.success(Result.error_msg); message.success('Operate Success!!!');
} }
ClearResult('User', dispatch); ClearResult('User', dispatch);
RA(43, {}, module, dispatch); RA(43, {}, module, dispatch);
......
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