Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maple
TOSTUMI
Commits
ca331f73
Commit
ca331f73
authored
Nov 27, 2020
by
Sixiang_Zzb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务范围bug处理
parent
94fd5d44
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
44 deletions
+40
-44
index.jsx
src/components/TagSelect/index.jsx
+16
-20
Services.tsx
...ges/UserManagement/ServiceProviderManagement/Services.tsx
+24
-24
No files found.
src/components/TagSelect/index.jsx
View file @
ca331f73
...
...
@@ -57,9 +57,6 @@ class TagSelect extends React.Component {
handleInputConfirm
=
()
=>
{
const
{
inputValue
}
=
this
.
state
;
let
{
value
}
=
this
.
state
;
console
.
log
(
value
);
console
.
log
(
inputValue
);
if
(
!
inputValue
.
trim
())
{
message
.
error
(
'Not Null!!!'
);
return
;
...
...
@@ -78,6 +75,7 @@ class TagSelect extends React.Component {
};
handleEditInputChange
=
(
e
)
=>
{
console
.
log
(
e
.
target
.
value
);
this
.
setState
({
editInputValue
:
e
.
target
.
value
});
};
...
...
@@ -85,6 +83,7 @@ class TagSelect extends React.Component {
this
.
setState
(({
value
,
editInputIndex
,
editInputValue
})
=>
{
const
newTags
=
[...
value
];
newTags
[
editInputIndex
]
=
editInputValue
;
this
.
props
.
onAdd
(
editInputValue
,
editInputIndex
);
this
.
props
.
onChange
(
newTags
);
return
{
value
:
newTags
,
...
...
@@ -104,19 +103,14 @@ class TagSelect extends React.Component {
render
()
{
const
{
value
,
inputVisible
,
inputValue
,
editInputIndex
,
editInputValue
,
visible
}
=
this
.
state
;
return
(
<>
<
Tag
className=
"editTag"
key=
"Accountant"
>
Accountant
</
Tag
>
{
value
.
map
((
tag
,
index
)
=>
{
if
(
editInputIndex
===
index
)
{
return
(
<
Input
ref=
{
this
.
saveEditInputRef
}
key=
{
tag
.
serviceName
}
key=
{
tag
}
size=
"small"
className=
{
styles
.
tagInput
}
value=
{
editInputValue
}
...
...
@@ -132,25 +126,27 @@ class TagSelect extends React.Component {
const
tagElem
=
(
<
Tag
className=
"editTag"
key=
{
tag
.
serviceName
}
closable=
{
index
!==
-
1
}
key=
{
tag
}
closable=
{
index
!==
0
&&
index
!==
1
}
onClose=
{
(
e
)
=>
this
.
handleClose
(
tag
,
e
)
}
visible=
{
true
}
>
{
/*
<span
<
span
onDoubleClick=
{
(
e
)
=>
{
this.setState({ editInputIndex: index, editInputValue: tag.serviceName }, () => {
this.editInput.focus();
});
e.preventDefault();
if
(
index
!==
0
&&
index
!==
1
)
{
this
.
setState
({
editInputIndex
:
index
,
editInputValue
:
tag
},
()
=>
{
this
.
editInput
.
focus
();
});
e
.
preventDefault
();
}
}
}
>
*/
}
{
isLongTag
?
`${value.slice(0, 20)}
...
`
:
tag
.
serviceName
}
{
/* </span> */
}
>
{
isLongTag
?
`${value.slice(0, 20)}
...
`
:
tag
}
</
span
>
</
Tag
>
);
return
isLongTag
?
(
<
Tooltip
title=
{
tag
.
serviceName
}
key=
{
tag
.
serviceName
}
>
<
Tooltip
title=
{
tag
}
key=
{
tag
}
>
{
tagElem
}
</
Tooltip
>
)
:
(
...
...
src/pages/UserManagement/ServiceProviderManagement/Services.tsx
View file @
ca331f73
...
...
@@ -9,10 +9,14 @@ import { RA, ClearResult } from '@/utils/method';
import
TitleBack
from
'@/components/TitleBack/TitleBack'
;
const
module
=
'User'
;
interface
DataType
{
serviceName
:
string
;
id
:
string
;
}
const
Services
=
(
props
:
any
)
=>
{
const
{
dispatch
,
DataServices
,
Result
}
=
props
;
const
formRef
=
useRef
(
null
as
any
);
const
[
DataList
,
setDataList
]
=
useState
(
Object
);
useEffect
(()
=>
{
RA
(
43
,
{},
module
,
dispatch
);
...
...
@@ -21,17 +25,10 @@ const Services = (props: any) => {
useEffect
(()
=>
{
if
(
DataServices
!=
null
)
{
console
.
log
(
DataServices
);
// let tmp = DataServices.data.rows.map((v: object, i: number) => {
// return v['serviceName'];
// });
// console.log(tmp);
// tmp = tmp.filter((v: string) => {
// return v !== 'Accountant';
// });
let
tmp
=
DataServices
.
data
.
rows
.
filter
(
setDataList
(
DataServices
.
data
.
rows
);
let
tmp
=
DataServices
.
data
.
rows
.
map
(
(
v
:
{
serviceName
:
string
;
deleted
:
number
},
i
:
number
)
=>
{
return
v
.
serviceName
!==
'Accountant'
&&
v
.
deleted
!==
1
&&
v
;
return
v
.
deleted
!==
1
&&
v
.
serviceName
;
},
);
console
.
log
(
tmp
);
...
...
@@ -40,12 +37,12 @@ const Services = (props: any) => {
},
[
DataServices
]);
// 添加服务范围
const
Add
=
(
values
:
string
)
=>
{
console
.
log
(
values
);
const
Add
=
(
values
:
string
,
index
?:
number
)
=>
{
RA
(
44
,
{
serviceName
:
values
,
id
:
index
?
DataList
[
index
].
id
:
null
,
},
module
,
dispatch
,
...
...
@@ -53,16 +50,19 @@ const Services = (props: any) => {
};
// 删除服务范围
const
Remove
=
(
values
:
{
id
:
string
})
=>
{
console
.
log
(
values
);
RA
(
53
,
{
id
:
values
.
id
,
},
module
,
dispatch
,
);
const
Remove
=
(
values
:
string
)
=>
{
DataList
.
forEach
((
obj
:
DataType
)
=>
{
if
(
obj
.
serviceName
===
values
)
{
RA
(
53
,
{
id
:
obj
.
id
,
},
module
,
dispatch
,
);
}
});
};
useEffect
(()
=>
{
...
...
@@ -71,7 +71,7 @@ const Services = (props: any) => {
if
(
Result
.
error_code
!==
'0000'
)
{
message
.
error
(
'Failed: binding service provider!!!'
);
}
else
{
message
.
success
(
Result
.
error_msg
);
message
.
success
(
'Operate Success!!!'
);
}
ClearResult
(
'User'
,
dispatch
);
RA
(
43
,
{},
module
,
dispatch
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment