Merge pull request '分权开关设置' (#13) from feature/cl into dev

Reviewed-on: http://221.226.25.34:3000/liang.cheng/trunk/pulls/13
This commit is contained in:
liang.cheng 2022-11-01 17:51:09 +08:00
commit bfc78bee60
7 changed files with 55 additions and 11 deletions

View File

@ -15,10 +15,14 @@ export const getAdvanceSearchCondition = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/detach/getSearchCondition', 'GET', params);
}
export const getSchemeForm = (params) => {
export const getForm = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/detach/getForm', 'GET', params);
}
export const doDetachSwitch = (params) => {
return WeaTools.callApi('/api/bs/hrmorganization/detach/doDetach', 'GET', params);
}
export const deleteTableData = (params) => {
return fetch('/api/bs/hrmorganization/detach/deleteByIds', {
method: 'POST',

View File

@ -237,17 +237,17 @@ export default class ManagerDetach extends React.Component {
// })
}
updateForbiddenTag(checked, id) {
doDetachSwitch(checked) {
const {
managerDetach
} = this.props;
confirm({
title: i18n.confirm.defaultTitle(),
content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(),
content: (checked == true) ? "确定启用组织管理分权吗" : "确定取消组织管理分权",
okText: i18n.button.ok(),
cancelText: i18n.button.cancel(),
onOk() {
managerDetach.updateForbiddenTag(checked, id);
managerDetach.setDetach(checked);
},
onCancel() {
return false;
@ -293,6 +293,8 @@ export default class ManagerDetach extends React.Component {
});
}
handleSave() {
const {
@ -369,7 +371,7 @@ export default class ManagerDetach extends React.Component {
} = this.props;
const {
isPanelShow, form2, managerName, conditionNum, tableStore, nEdialogTitle, visible, condition,
form, dialogLoading, isEdit, date, hasRight
form, dialogLoading, isEdit, date, hasRight,isDetach
} = managerDetach;
if (hasRight === false) {
@ -381,7 +383,11 @@ export default class ManagerDetach extends React.Component {
<WeaRightMenu ecId={`${this && this.props && this.props.ecId || ''}_WeaRightMenu@k6oc4u`}
datas={this.getDropMenuDatas()}
onClick={key => this.handleMenuClick(key)}
>
>
<div style={{"width":"100%","height":"50px","lineHeight":"50px"}}>
<span style={{"marginLeft":"20px","fontWeight":"bold"}}>启用组织管理分权:</span>
<Switch style={{"marginLeft":"20px"}} checked={isDetach == "true" ? true : false} onChange={checked => this.doDetachSwitch(checked)} />
</div>
<WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
title={i18n.label.mangerDetachName()}
icon={<i className='icon-coms-hrm' />}

View File

@ -5,6 +5,7 @@ import {
import {
Spin,
Button,
Tooltip
} from 'antd'
import {
@ -42,9 +43,12 @@ export default class FormItem extends React.Component {
return (
<div>
<span>{subItem.fieldId}</span>
<span>{subItem.fieldValue}</span>
{subItem.fieldValue.length > 10 ? <Tooltip placement="topLeft" title={subItem.fieldValue}>
<span>{subItem.fieldValue}</span>
</Tooltip> : <span>{subItem.fieldValue}</span>}
</div>
);
})}
</div>

View File

@ -74,7 +74,16 @@ export default class Resource extends React.Component {
resource
} = this.props;
resource.getHasRight();
resource.getTableInfo();
let {hash} = window.location;
hash = hash.split("?")[1].split("&");
if(hash.length >= 2) {
let params = {};
let arr = hash[0].split("=");
params[arr[0]] = arr[1];
resource.doSearch(params);
}else {
resource.getTableInfo();
}
}
//左侧树

View File

@ -44,6 +44,7 @@ export class ManagerDetachStore {
@observable detachId = '';
@observable date = '';
@observable hasRight = '';
@observable isDetach = '';
@action("列表数据加载") getTableInfo(isOnChange = false) {
let params;
@ -60,6 +61,7 @@ export class ManagerDetachStore {
Api.getSearchList(params).then(res => {
if (res.code === 200) {
this.setHasRight(res.data.hasRight);
this.isDetach = res.data.isDetach;
isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
} else {
message.warning(res.msg);
@ -145,7 +147,7 @@ export class ManagerDetachStore {
id: this.detachId
}
this.setDialogLoadingStatus(true);
Api.getSchemeForm(params).then(res => {
Api.getForm(params).then(res => {
if (res.code === 200) {
this.setDialogLoadingStatus(false);
res.data.condition && this.setCondition(res.data.condition);
@ -188,6 +190,19 @@ export class ManagerDetachStore {
})
}
@action("分权设置") setDetach(checked) {
Api.doDetachSwitch({idDetach:checked}).then(res => {
if (res.code === 200) {
this.isDetach = res.data;
message.success(res.msg);
} else {
message.warning(res.msg);
}
}, error => {
message.warning(error.msg);
})
}
updateFields(val) {
this.form2.updateFields({
ecManager: {

View File

@ -229,5 +229,9 @@ export class ResourceExtendStore {
this.buttons = buttons;
}
setDate(date) {
this.date = date;
}
}

View File

@ -132,8 +132,10 @@
display: flex;
div{
width: 33.3%;
display: inline-block;
height: 40px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
span:first-child{
color: #999999;
width: 80px;