diff --git a/pc4mobx/organization/apis/managerDetach.js b/pc4mobx/organization/apis/managerDetach.js index c80c271..79b9766 100644 --- a/pc4mobx/organization/apis/managerDetach.js +++ b/pc4mobx/organization/apis/managerDetach.js @@ -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', diff --git a/pc4mobx/organization/components/detach/ManagerDetach.js b/pc4mobx/organization/components/detach/ManagerDetach.js index 929e496..08ba43c 100644 --- a/pc4mobx/organization/components/detach/ManagerDetach.js +++ b/pc4mobx/organization/components/detach/ManagerDetach.js @@ -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 { this.handleMenuClick(key)} - > + > +
+ 启用组织管理分权: + this.doDetachSwitch(checked)} /> +
} diff --git a/pc4mobx/organization/components/resource/FormItem.js b/pc4mobx/organization/components/resource/FormItem.js index 5451681..511e3a9 100644 --- a/pc4mobx/organization/components/resource/FormItem.js +++ b/pc4mobx/organization/components/resource/FormItem.js @@ -5,6 +5,7 @@ import { import { Spin, Button, + Tooltip } from 'antd' import { @@ -42,9 +43,12 @@ export default class FormItem extends React.Component { return (
{subItem.fieldId} - {subItem.fieldValue} + {subItem.fieldValue.length > 10 ? + {subItem.fieldValue} + : {subItem.fieldValue}} +
- + ); })} diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js index 0464614..3a88c60 100644 --- a/pc4mobx/organization/components/resource/resource.js +++ b/pc4mobx/organization/components/resource/resource.js @@ -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(); + } } //左侧树 diff --git a/pc4mobx/organization/stores/managerDetach.js b/pc4mobx/organization/stores/managerDetach.js index 9e7ea88..6f3e7a4 100644 --- a/pc4mobx/organization/stores/managerDetach.js +++ b/pc4mobx/organization/stores/managerDetach.js @@ -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: { diff --git a/pc4mobx/organization/stores/resourceExtend.js b/pc4mobx/organization/stores/resourceExtend.js index b4aea58..35367c2 100644 --- a/pc4mobx/organization/stores/resourceExtend.js +++ b/pc4mobx/organization/stores/resourceExtend.js @@ -229,5 +229,9 @@ export class ResourceExtendStore { this.buttons = buttons; } + setDate(date) { + this.date = date; + } + } diff --git a/pc4mobx/organization/style/card.less b/pc4mobx/organization/style/card.less index 564a2e7..a4e0958 100644 --- a/pc4mobx/organization/style/card.less +++ b/pc4mobx/organization/style/card.less @@ -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;