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); 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); 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) => { export const deleteTableData = (params) => {
return fetch('/api/bs/hrmorganization/detach/deleteByIds', { return fetch('/api/bs/hrmorganization/detach/deleteByIds', {
method: 'POST', method: 'POST',

View File

@ -237,17 +237,17 @@ export default class ManagerDetach extends React.Component {
// }) // })
} }
updateForbiddenTag(checked, id) { doDetachSwitch(checked) {
const { const {
managerDetach managerDetach
} = this.props; } = this.props;
confirm({ confirm({
title: i18n.confirm.defaultTitle(), title: i18n.confirm.defaultTitle(),
content: (checked == true) ? i18n.confirm.enableTag() : i18n.confirm.forbiddenTag(), content: (checked == true) ? "确定启用组织管理分权吗" : "确定取消组织管理分权",
okText: i18n.button.ok(), okText: i18n.button.ok(),
cancelText: i18n.button.cancel(), cancelText: i18n.button.cancel(),
onOk() { onOk() {
managerDetach.updateForbiddenTag(checked, id); managerDetach.setDetach(checked);
}, },
onCancel() { onCancel() {
return false; return false;
@ -294,6 +294,8 @@ export default class ManagerDetach extends React.Component {
} }
handleSave() { handleSave() {
const { const {
managerDetach managerDetach
@ -369,7 +371,7 @@ export default class ManagerDetach extends React.Component {
} = this.props; } = this.props;
const { const {
isPanelShow, form2, managerName, conditionNum, tableStore, nEdialogTitle, visible, condition, isPanelShow, form2, managerName, conditionNum, tableStore, nEdialogTitle, visible, condition,
form, dialogLoading, isEdit, date, hasRight form, dialogLoading, isEdit, date, hasRight,isDetach
} = managerDetach; } = managerDetach;
if (hasRight === false) { if (hasRight === false) {
@ -382,6 +384,10 @@ export default class ManagerDetach extends React.Component {
datas={this.getDropMenuDatas()} datas={this.getDropMenuDatas()}
onClick={key => this.handleMenuClick(key)} 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`} <WeaTop ecId={`${this && this.props && this.props.ecId || ''}_WeaTop@bj98s7`}
title={i18n.label.mangerDetachName()} title={i18n.label.mangerDetachName()}
icon={<i className='icon-coms-hrm' />} icon={<i className='icon-coms-hrm' />}

View File

@ -5,6 +5,7 @@ import {
import { import {
Spin, Spin,
Button, Button,
Tooltip
} from 'antd' } from 'antd'
import { import {
@ -42,7 +43,10 @@ export default class FormItem extends React.Component {
return ( return (
<div> <div>
<span>{subItem.fieldId}</span> <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 resource
} = this.props; } = this.props;
resource.getHasRight(); 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 detachId = '';
@observable date = ''; @observable date = '';
@observable hasRight = ''; @observable hasRight = '';
@observable isDetach = '';
@action("列表数据加载") getTableInfo(isOnChange = false) { @action("列表数据加载") getTableInfo(isOnChange = false) {
let params; let params;
@ -60,6 +61,7 @@ export class ManagerDetachStore {
Api.getSearchList(params).then(res => { Api.getSearchList(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.setHasRight(res.data.hasRight); 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); isOnChange ? this.tableStore.getDatas(res.data.datas, current) : this.tableStore.getDatas(res.data.datas,1);
} else { } else {
message.warning(res.msg); message.warning(res.msg);
@ -145,7 +147,7 @@ export class ManagerDetachStore {
id: this.detachId id: this.detachId
} }
this.setDialogLoadingStatus(true); this.setDialogLoadingStatus(true);
Api.getSchemeForm(params).then(res => { Api.getForm(params).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.setDialogLoadingStatus(false); this.setDialogLoadingStatus(false);
res.data.condition && this.setCondition(res.data.condition); 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) { updateFields(val) {
this.form2.updateFields({ this.form2.updateFields({
ecManager: { ecManager: {

View File

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

View File

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