Commit 254df036 by yuananting

fix:解决合并代码的冲突

parents 509895d4 1899b2ec
...@@ -1605,7 +1605,13 @@ input:focus { ...@@ -1605,7 +1605,13 @@ input:focus {
color: #2966FF !important; color: #2966FF !important;
margin-right: 16px !important; margin-right: 16px !important;
} }
.default-warning-icon {
font-size: 22px !important;
line-height: 22px !important;
float: left !important;
color: #FF4F4F !important;
margin-right: 16px !important;
}
.m-content { .m-content {
position: absolute; position: absolute;
top: 0; top: 0;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* @Author: 吴文洁 * @Author: 吴文洁
* @Date: 2020-08-24 12:20:57 * @Date: 2020-08-24 12:20:57
* @LastEditors: yuananting * @LastEditors: yuananting
* @LastEditTime: 2021-08-05 19:50:10 * @LastEditTime: 2021-08-11 15:06:32
* @Description: * @Description:
* @Copyright: 杭州杰竞科技有限公司 版权所有 * @Copyright: 杭州杰竞科技有限公司 版权所有
--> -->
......
...@@ -23,4 +23,7 @@ ...@@ -23,4 +23,7 @@
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.edit-disable{
color:#666;
}
} }
\ No newline at end of file
...@@ -28,11 +28,15 @@ function DepartMentTabCon(props) { ...@@ -28,11 +28,15 @@ function DepartMentTabCon(props) {
const [userListdata, setUserListData] = useState([]); const [userListdata, setUserListData] = useState([]);
const [selectUser,setSelectUser] = useState([]); // 设置选中的用户 const [selectUser,setSelectUser] = useState([]); // 设置选中的用户
const [selectDep,setSelectDep] = useState({}); const [selectDep,setSelectDep] = useState({});
useEffect(()=>{
setSelectUser([]);
},[selectDep]);
const columns = [ const columns = [
{ {
title: "学员", title: "学员",
dataIndex: "nickName", dataIndex: "nickName",
width: 220, width: 220,
fixed: 'left',
render: (val, item) => { render: (val, item) => {
return ( return (
<div> <div>
...@@ -71,6 +75,7 @@ function DepartMentTabCon(props) { ...@@ -71,6 +75,7 @@ function DepartMentTabCon(props) {
}, },
{ {
title: "岗位", title: "岗位",
width: "15%",
dataIndex: "depNameList", dataIndex: "depNameList",
render: (val, record) => { render: (val, record) => {
if(!record.depNameList){ if(!record.depNameList){
...@@ -91,6 +96,7 @@ function DepartMentTabCon(props) { ...@@ -91,6 +96,7 @@ function DepartMentTabCon(props) {
{ {
title: "手机号", title: "手机号",
dataIndex: "phone", dataIndex: "phone",
width: "15%",
render: (val, item) => { render: (val, item) => {
if(!val){ if(!val){
return <span>-</span> return <span>-</span>
...@@ -102,6 +108,7 @@ function DepartMentTabCon(props) { ...@@ -102,6 +108,7 @@ function DepartMentTabCon(props) {
{ {
title: "注册时间", title: "注册时间",
dataIndex: "created", dataIndex: "created",
width: "15%",
render: (val, item) => { render: (val, item) => {
return <div>{moment(val).format("YYYY-MM-DD HH:mm:ss")}</div>; return <div>{moment(val).format("YYYY-MM-DD HH:mm:ss")}</div>;
}, },
...@@ -110,6 +117,8 @@ function DepartMentTabCon(props) { ...@@ -110,6 +117,8 @@ function DepartMentTabCon(props) {
title: "操作", title: "操作",
key: "operate", key: "operate",
dataIndex: "operate", dataIndex: "operate",
width: "15%",
fixed: 'right',
render: (val, item) => { render: (val, item) => {
return ( return (
<div className="operate"> <div className="operate">
...@@ -181,6 +190,9 @@ function DepartMentTabCon(props) { ...@@ -181,6 +190,9 @@ function DepartMentTabCon(props) {
function delUser(type,userId){ function delUser(type,userId){
let idList = []; let idList = [];
let title = '';
let content = '';
let okText = '';
if(type === 'single'){ if(type === 'single'){
idList.push(userId); idList.push(userId);
} }
...@@ -191,13 +203,35 @@ function DepartMentTabCon(props) { ...@@ -191,13 +203,35 @@ function DepartMentTabCon(props) {
message.warning('请先选择要删除的学员') message.warning('请先选择要删除的学员')
return; return;
} }
switch (props.currentTab){
case 'departMentTab':
title = '确定要删除学员吗?';
content = '删除后,该学员将从员工列表中删除,且看不到该学院用户端。';
okText = '删除';
break;
case 'postGrouptab':
title = '确定要移出该学员吗?';
content = '移出后,该学员将从岗位列表中移出。';
okText = '移出';
break;
case 'customGroupTab':
title = '确定要移出该学员吗?';
content = '移出后,该学员将从分组列表中移出。';
okText = '移出';
break;
default:
title = '确定要删除学员吗?';
content = '删除后,该学员将从员工列表中删除,且看不到该学院用户端。';
okText = '删除';
break;
}
return confirm({ return confirm({
title: "确定要删除学员吗?", title,
content: "删除后,该学员将从员工列表中删除,且看不到该学院用户端。", content,
icon: ( icon: (
<span className="icon iconfont default-confirm-icon">&#xe839; </span> <span className="icon iconfont default-confirm-icon">&#xe839; </span>
), ),
okText: "删除", okText,
okType: "danger", okType: "danger",
cancelText: "取消", cancelText: "取消",
onOk: () => { onOk: () => {
...@@ -218,8 +252,13 @@ function DepartMentTabCon(props) { ...@@ -218,8 +252,13 @@ function DepartMentTabCon(props) {
}else{ }else{
params.userType='WORK_WE_CHAT'; params.userType='WORK_WE_CHAT';
} }
params.departmentId = selectDep.id;
StoreService.delDepartmentUser(params).then((res) => { StoreService.delDepartmentUser(params).then((res) => {
if(props.currentTab === "departMentTab"){
message.success(`删除成功`); message.success(`删除成功`);
}else{
message.success(`移出成功`);
}
getUserList(); getUserList();
Bus.trigger("changeTreeData",{treeType:props.currentTab}); Bus.trigger("changeTreeData",{treeType:props.currentTab});
}); });
...@@ -349,11 +388,11 @@ function DepartMentTabCon(props) { ...@@ -349,11 +388,11 @@ function DepartMentTabCon(props) {
image: college, image: college,
description: "暂无数据", description: "暂无数据",
}} }}
scroll={{ x: 800 }}
bordered bordered
size="middle" size="middle"
pagination={false} pagination={false}
columns={columns} columns={columns}
scroll={{ x: 800 }}
dataSource={userListdata} dataSource={userListdata}
rowKey={(record) => record.userId} rowKey={(record) => record.userId}
rowSelection={{ rowSelection={{
...@@ -371,7 +410,7 @@ function DepartMentTabCon(props) { ...@@ -371,7 +410,7 @@ function DepartMentTabCon(props) {
_list = _.reject(selectUser, (item) => _.find(changeRows, (data) => data.userId === item.userId)); _list = _.reject(selectUser, (item) => _.find(changeRows, (data) => data.userId === item.userId));
} }
if (_list.length > 50) { if (_list.length > 50) {
message.warning('无法继续选择,一个任务最多关联50个课程'); message.warning('无法继续选择,最多选择50个');
const extraLength = _list.length - 50; const extraLength = _list.length - 50;
_list.splice(_list.length - extraLength, extraLength); _list.splice(_list.length - extraLength, extraLength);
} }
......
.department-tab-con{ .department-tab-con{
display: flex; display: flex;
.table-con{ .table-con{
margin-left:16px;
flex:1; flex:1;
.post-name{ .post-name{
max-width: 200px; max-width: 200px;
......
...@@ -40,6 +40,8 @@ function LeftStructureTree(props) { ...@@ -40,6 +40,8 @@ function LeftStructureTree(props) {
setSelectedKeys(_defaultSelectedKeys); setSelectedKeys(_defaultSelectedKeys);
props.onChangeSelectDep(res[0]) props.onChangeSelectDep(res[0])
props.searchUserList(res[0],treeType,1); props.searchUserList(res[0],treeType,1);
}else{
props.searchUserList({id:null},treeType,1);
} }
}); });
},[props.treeType]); },[props.treeType]);
...@@ -63,6 +65,8 @@ function LeftStructureTree(props) { ...@@ -63,6 +65,8 @@ function LeftStructureTree(props) {
display: 'flex', display: 'flex',
justifyContent: 'space-between', justifyContent: 'space-between',
}} }}
depId={record.id}
type={type}
> >
{type === 'user'? {type === 'user'?
<div><WWOpenDataCom type="userName" openid={record.userName}/></div> <div><WWOpenDataCom type="userName" openid={record.userName}/></div>
...@@ -75,7 +79,7 @@ function LeftStructureTree(props) { ...@@ -75,7 +79,7 @@ function LeftStructureTree(props) {
}) })
} }
{type === 'post' && {type === 'post' &&
<span>{record.parentName}</span> <span type='post' openid={record.parentName}>{record.parentName}</span>
} }
</div> </div>
), ),
...@@ -102,16 +106,21 @@ function LeftStructureTree(props) { ...@@ -102,16 +106,21 @@ function LeftStructureTree(props) {
return placeholder return placeholder
} }
function confirmSearchSelect(value,option){ function confirmSearchSelect(value,option){
const param = {}
setOpen(false); setOpen(false);
setQueryName(value); setQueryName(value);
// console.log('option',option); if(option.label.props.type === 'user'){
// setSelctQueryName(option) param.queryName = value;
props.searchUserList({queryName:value},treeType,1); }else{
param.id = option.label.props.depId;
}
props.searchUserList(param,treeType,1);
} }
// 获取关键词的搜索结果 // 获取关键词的搜索结果
function getCompleteOptionData(value){ function getCompleteOptionData(value){
// setQueryName(value); // setQueryName(value);
setCompleteOption([]);
console.log("treeType",props.treeType); console.log("treeType",props.treeType);
const params = { const params = {
depType:DepType[props.treeType], depType:DepType[props.treeType],
...@@ -243,11 +252,11 @@ function LeftStructureTree(props) { ...@@ -243,11 +252,11 @@ function LeftStructureTree(props) {
</span> </span>
</Menu.Item> </Menu.Item>
} }
{ (record.departmentCount === 0 || !record.departmentCount) && {/* { (record.departmentCount === 0 || !record.departmentCount) && */}
<Menu.Item key="del"> <Menu.Item key="del">
<span onClick={()=>{props.treeType==='postGrouptab'?delPostGroup(record):delCustomGroup(record)}}>删除</span> <span onClick={()=>{props.treeType==='postGrouptab'?delPostGroup(record):delCustomGroup(record)}}>删除</span>
</Menu.Item> </Menu.Item>
} {/* } */}
</Menu> </Menu>
); );
...@@ -321,7 +330,21 @@ function LeftStructureTree(props) { ...@@ -321,7 +330,21 @@ function LeftStructureTree(props) {
function delPostGroup(record){ function delPostGroup(record){
let title = '确认删除该岗位组吗?'; let title = '确认删除该岗位组吗?';
let content= '删除后,该岗位组下的岗位及也将全部删除。'; let content= '删除后,该岗位组下的岗位及也将全部删除。';
if(record.departmentCount && record.departmentCount>0 ){
title = '删除失败';
if(record.depLevel>0){
content = `${record.name}存在学员,不能删除该岗位`;
}else{
content = `${record.name}存在学员,不能删除该岗位组`;
}
Modal.warning({
title,
content,
icon: <span className='icon iconfont default-warning-icon'>&#xe80d;</span>,
okText: "我知道了"
})
return
}
if(record.level>0){ if(record.level>0){
title = '确认删除该岗位吗?'; title = '确认删除该岗位吗?';
content = '删除后,不可恢复'; content = '删除后,不可恢复';
...@@ -405,7 +428,21 @@ function LeftStructureTree(props) { ...@@ -405,7 +428,21 @@ function LeftStructureTree(props) {
function delCustomGroup(record){ function delCustomGroup(record){
let title = '确认删除该分组集合吗?'; let title = '确认删除该分组集合吗?';
let content= '删除后,该分组集合下的岗位及也将全部删除。'; let content= '删除后,该分组集合下的岗位及也将全部删除。';
if(record.departmentCount && record.departmentCount>0 ){
title = '删除失败';
if(record.level>0){
content = `${record.name}存在学员,不能删除该分组`;
}else{
content = `${record.name}存在学员,不能删除该分组集合`;
}
Modal.warning({
title,
content,
icon: <span className='icon iconfont default-warning-icon'>&#xe80d;</span>,
okText: "我知道了"
})
return
}
if(record.level>0){ if(record.level>0){
title = '确认删除该分组吗?'; title = '确认删除该分组吗?';
content = '删除后,不可恢复'; content = '删除后,不可恢复';
...@@ -565,17 +602,17 @@ function LeftStructureTree(props) { ...@@ -565,17 +602,17 @@ function LeftStructureTree(props) {
/> />
: :
<div> <div>
{ (props.treeType==='departMentTab') && {/* { (props.treeType==='departMentTab') && */}
<div> <div>
{ option.name? { selctQueryName.type==='userName'?
<WWOpenDataCom type="departmentName" openid={option.name}/> <WWOpenDataCom type="userName" openid={selctQueryName.openid}/>
: :
<WWOpenDataCom type="userName" openid={option.userName}/> <WWOpenDataCom type="departmentName" openid={selctQueryName.openid}/>
} }
</div> </div>
} {/* } */}
{ (props.treeType==='postGrouptab' || props.treeType=== 'customGroupTab') && {/* { (props.treeType==='postGrouptab' || props.treeType=== 'customGroupTab') &&
<div> <div>
{ option.name? { option.name?
<span>{option.name}</span> <span>{option.name}</span>
...@@ -584,7 +621,7 @@ function LeftStructureTree(props) { ...@@ -584,7 +621,7 @@ function LeftStructureTree(props) {
} }
</div> </div>
} } */}
</div> </div>
} }
......
.left-structure-tree { .left-structure-tree {
margin-right: 24px; margin-right: 17px;
width:260px; width:260px;
flex-shrink: 0;
height: calc(~'100vh - 260px'); height: calc(~'100vh - 260px');
overflow-y: scroll;
.organization{
overflow: scroll; overflow: scroll;
border-right:1px solid #eee;
.organization{
.search-con{ .search-con{
margin-bottom: 10px; margin-bottom: 10px;
} }
......
...@@ -239,6 +239,12 @@ class NewChooseMembersModal extends React.Component { ...@@ -239,6 +239,12 @@ class NewChooseMembersModal extends React.Component {
userId:User.getUserId(), userId:User.getUserId(),
whetherCount:false whetherCount:false
} }
if(this.props.addDepType){
params.nowDepType = this.props.addDepType;
}
if(this.props.selectDep){
params.departmentId = this.props.selectDep.id;
}
StoreService.getDepartmentUser(params).then((res) => { StoreService.getDepartmentUser(params).then((res) => {
const { result = {}} = res; const { result = {}} = res;
this.setState({ this.setState({
......
...@@ -61,8 +61,8 @@ function PlanFilter(props) { ...@@ -61,8 +61,8 @@ function PlanFilter(props) {
delete _query.startTime; delete _query.startTime;
delete _query.endTime; delete _query.endTime;
} else { } else {
_query.startTime = dates[0].valueOf(); _query.startTime = dates[0]?.startOf('day').valueOf()
_query.endTime = dates[1].valueOf(); _query.endTime = dates[1]?.endOf('day').valueOf()
} }
const param ={ const param ={
..._query, ..._query,
......
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