!24 组织架构树

Merge pull request !24 from reset/feature/cl
This commit is contained in:
reset 2022-05-30 01:51:39 +00:00 committed by Gitee
commit 74e4f4ca88
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
5 changed files with 152 additions and 94 deletions

View File

@ -1,7 +1,7 @@
/** /**
* @Author: 程亮 * @Author: 程亮
* @Date: 2022-05-18 16:23:32 * @Date: 2022-05-18 16:23:32
* @LastEditTime: 2022-05-26 09:12:59 * @LastEditTime: 2022-05-27 15:05:49
* @Description: * @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js * @FilePath: /trunk/src4js/pc4mobx/organization/components/company/company.js
*/ */
@ -25,7 +25,8 @@ import {
Modal, Modal,
Button, Button,
message, message,
Switch Switch,
Menu, Dropdown, Icon
} from 'antd' } from 'antd'
import { import {
WeaSwitch, WeaSwitch,
@ -227,6 +228,40 @@ export default class Company extends React.Component {
company company
} = this.props; } = this.props;
let _this = this; let _this = this;
// `${columns}` && columns.push({
// title: '',
// dataIndex: 'ops',
// key: 'ops',
// width: 80,
// className:"wea-table-operates",
// render: ( text, record, index )=> {
// const menu = (
// <Menu>
// <Menu.Item>
// <a href='javascript:void(0);' onClick={() => { _this.doDel(record.id) }}>删除</a>
// </Menu.Item>
// <Menu.Item>
// <a href='javascript:void(0);' onClick={() => { _this.select(record.id) }}>联查部门</a>
// </Menu.Item>
// </Menu>
// )
// return (
// <Dropdown overlay={menu}>
// <i class="icon-coms-more" />
// </Dropdown>
// )
// }
// });
const menu = (
<Menu>
<Menu.Item>
<a href='javascript:void(0);' onClick={() => { _this.doDel(record.id) }}>删除</a>
</Menu.Item>
<Menu.Item>
<a href='javascript:void(0);' onClick={() => { _this.select(record.id) }}>联查部门</a>
</Menu.Item>
</Menu>
)
columns.forEach((c, index) => { columns.forEach((c, index) => {
if (c.dataIndex == 'forbiddenTag') { if (c.dataIndex == 'forbiddenTag') {
c.render = function (text, record) { c.render = function (text, record) {
@ -241,16 +276,27 @@ export default class Company extends React.Component {
} }
} }
if (c.dataIndex == 'operate') { if (c.dataIndex == 'operate') {
c.className = "wea-table-operates"
c.width = 80
c.render = function (text, record) { c.render = function (text, record) {
return <span> const menu = (
<a onClick={() => { _this.doDel(record.id) }}>删除</a> <Menu>
<span className="ant-divider"></span> <Menu.Item>
<a onClick={() => { _this.select(record.id) }}>联查部门</a> <a href='javascript:void(0);' onClick={() => { _this.doDel(record.id) }}>删除</a>
</span> </Menu.Item>
<Menu.Item>
<a href='javascript:void(0);' onClick={() => { _this.select(record.id) }}>联查部门</a>
</Menu.Item>
</Menu>
)
return <Dropdown overlay={menu}>
<i class="icon-coms-more" />
</Dropdown>
} }
} }
}) })
return columns; return columns;
} }
@ -286,7 +332,7 @@ export default class Company extends React.Component {
} = company; } = company;
const btn = [ const btn = [
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bx87i8`} type="primary" onClick={() => { company.setCurrent(1); company.setPageSize(10);company.getTableInfo(); company.setPanelStatus(false) }}>{i18n.button.search()}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@bx87i8`} type="primary" onClick={() => { company.setCurrent(1); company.setPageSize(10); company.getTableInfo(); company.setPanelStatus(false) }}>{i18n.button.search()}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju6`} onClick={() => form.reset()}>{i18n.button.reset()}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@218ju6`} onClick={() => form.reset()}>{i18n.button.reset()}</Button>),
(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5u9mfz`} onClick={() => company.setPanelStatus(false)}>{i18n.button.cancel()}</Button>), (<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@5u9mfz`} onClick={() => company.setPanelStatus(false)}>{i18n.button.cancel()}</Button>),
]; ];
@ -360,7 +406,7 @@ export default class Company extends React.Component {
const { const {
isPanelShow, companyName, conditionNum, visible, condition, form, isPanelShow, companyName, conditionNum, visible, condition, form,
tableStore, dataSource, columns, loading, date, nEdialogTitle, dialogLoading, tableStore, dataSource, columns, loading, date, nEdialogTitle, dialogLoading,
form1, isEdit, newVisible, deptDataSource, deptColumns, selectedRowKeys, total,current,pageSize,init form1, isEdit, newVisible, deptDataSource, deptColumns, selectedRowKeys, total, current, pageSize, init
} = company; } = company;
const rowSelection = { const rowSelection = {
@ -370,8 +416,8 @@ export default class Company extends React.Component {
}; };
const pagination = { const pagination = {
current:current, current: current,
pageSize:pageSize, pageSize: pageSize,
total: total, total: total,
showSizeChanger: true, showSizeChanger: true,
showQuickJumper: true, showQuickJumper: true,
@ -379,7 +425,7 @@ export default class Company extends React.Component {
}, },
onChange(current) { onChange(current) {
}, },
showTotal(total){ showTotal(total) {
return `${total}` return `${total}`
} }
}; };

View File

@ -1,7 +1,7 @@
/** /**
* @Author: 程亮 * @Author: 程亮
* @Date: 2022-05-26 14:05:59 * @Date: 2022-05-26 14:05:59
* @LastEditTime: 2022-05-26 16:42:44 * @LastEditTime: 2022-05-30 09:48:35
* @Description: * @Description:
* @FilePath: /trunk/src4js/pc4mobx/organization/components/job/job.js * @FilePath: /trunk/src4js/pc4mobx/organization/components/job/job.js
*/ */
@ -18,6 +18,7 @@ import {
WeaRightMenu, WeaRightMenu,
WeaTable, WeaTable,
WeaLeftRightLayout, WeaLeftRightLayout,
WeaOrgTree
} from 'ecCom' } from 'ecCom'
import { import {
Row, Row,
@ -26,7 +27,8 @@ import {
Modal, Modal,
Button, Button,
message, message,
Switch Switch,
Menu, Dropdown, Icon
} from 'antd' } from 'antd'
import { import {
WeaSwitch, WeaSwitch,
@ -236,31 +238,34 @@ export default class Job extends React.Component {
}; };
if (c.dataIndex == 'compName') { if (c.dataIndex == 'compName') {
c.render = function (text, record) { c.render = function (text, record) {
return <a onClick={() => { return <a href='javascript:void(0);' onClick={() => {
window.open(`/spa/organization/static/index.html#/main/organization/companyExtend/${record.id}`, "_blank") window.open(`/spa/organization/static/index.html#/main/organization/companyExtend/${record.id}`, "_blank")
}}>{text}</a> }}>{text}</a>
} }
} }
if (c.dataIndex == 'operate') { if (c.dataIndex == 'operate') {
c.className = "wea-table-operates"
c.width = 80
c.render = function (text, record) { c.render = function (text, record) {
return <span> const menu = (
<a onClick={() => { _this.doDel(record.id) }}>删除</a> <Menu>
<span className="ant-divider"></span> <Menu.Item>
<a onClick={() => { _this.select(record.id) }}>联查部门</a> <a href='javascript:void(0);' onClick={() => { _this.doDel(record.id) }}>删除</a>
</span> </Menu.Item>
<Menu.Item>
<a href='javascript:void(0);' onClick={() => { _this.select(record.id) }}>联查部门</a>
</Menu.Item>
</Menu>
)
return <Dropdown overlay={menu}>
<i class="icon-coms-more" />
</Dropdown>
} }
} }
}) })
return columns; return columns;
} }
updateForbiddenTag(checked, id) {
const {
job
} = this.props;
job.updateForbiddenTag(checked, id);
}
doDel(id) { doDel(id) {
const { const {
@ -353,55 +358,60 @@ export default class Job extends React.Component {
//左侧树 //左侧树
getTree = () => { getTree = () => {
// const { const {
// hrmAddressBook job
// } = this.props; } = this.props;
// const { const {
// companysId, companysId,
// hrmAddressBookPlus: plusStore } = job
// } = hrmAddressBook, {
// leftTabDatas, let tree = (
// leftTab, <WeaOrgTree ecId={`${this && this.props && this.props.ecId || ''}_WeaOrgTree@dhi1ro`}
// ORGTREE, ref='WeaOrgTree'
// } = plusStore; //dataUrl={"/api/bs/hrmorganization/job/getSearchTree"}
loading
// Object.assign(ORGTREE,{ needSearch
// expandAllChildrenOnSearch:true noCache={true}
// }); needDropMenu={false}
//onSelect={this.selectVirtual} //组织维度回调函数
// let tree; isLoadSubDepartment={true}
// if (leftTab.selectedKey === '0') { topPrefix={'hrmSearch'}
// tree = ( companysId={companysId}
// <WeaOrgTree ecId={`${this && this.props && this.props.ecId || ''}_WeaOrgTree@dhi1ro`} inputLeftDom={`<b>${i18n.label.organization()}</b>`}
// ref='WeaOrgTree' treeNodeClick={this.treeNodeClick}
// loading expandAllChildrenOnSearch={true}
// needSearch />
// noCache={true} )
// needDropMenu={true}
// onSelect={this.selectVirtual} return tree;
// isLoadSubDepartment={true} }
// topPrefix={'hrmSearch'}
// companysId={companysId} treeNodeClick = (event, ids, nodeids, nodes) => {
// inputLeftDom = {`<b>${i18n.label.organization()}</b`} const {
// treeNodeClick={this.treeNodeClick} job
// expandAllChildrenOnSearch={true} } = this.props;
// /> const {
// ) form,
// } else { companysId
// tree = <OrgTree ecId={`${this && this.props && this.props.ecId || ''}_OrgTree@xphsyb`} ORGTREE={ORGTREE}/>; } = job;
// } const type = event.node.props.type || '0';
// const leftCom = ( const id = event.node.props.id || '';
// <div style={{height:'100%'}} className='leftCom'> let params = {};
// <WeaTab ecId={`${this && this.props && this.props.ecId || ''}_WeaTab@80rg76`} {...leftTabDatas} {...leftTab}/> form.resetConditionValue();
// <div className='orgTree'> job.setPanelStatus(false)
// { // job.tabkey = 'default_3';
// tree job.nodeType = type;
// } if (type == '0') {
// </div> params['virtualtype'] = companysId;
// </div> }
// ) if (type == '1') {
return <div></div>; params['subcompanyid1'] = id;
} }
if (type == '2') {
params['departmentid'] = id;
}
job.doSearch(params);
}
@ -490,14 +500,6 @@ export default class Job extends React.Component {
}} }}
indentSize={15} indentSize={15}
/> />
// <NewWeaTable ecId={`${this && this.props && this.props.ecId || ''}_NewWeaTable@q4rrwm`}
// dataSource={dataSource}
// columns={this.reRenderColumns(columns)}
// rowSelection={rowSelection}
// pagination={pagination}
// loading={loading}
// indentSize={15}
// />
} }
</WeaLeftRightLayout> </WeaLeftRightLayout>
</WeaTop> </WeaTop>

View File

@ -121,7 +121,7 @@ export class CompanyStore {
} }
//删除 //删除
delete() { @action delete() {
let params = { let params = {
ids: this.ids ids: this.ids
}; };
@ -149,6 +149,7 @@ export class CompanyStore {
}).then(data => { }).then(data => {
if (data.code === 200) { if (data.code === 200) {
message.success(data.msg); message.success(data.msg);
this.getTableInfo();
} else { } else {
message.warning(data.msg); message.warning(data.msg);
} }

View File

@ -56,15 +56,17 @@ import {
@observable current = 1; @observable current = 1;
@observable pageSize = 10; @observable pageSize = 10;
@observable defaultShowLeft = true @observable defaultShowLeft = true;
@observable companysId = 1
@action @action
getTableInfo() { getTableInfo(params) {
this.setLoading(true); this.setLoading(true);
let params = { params = {
...params,
current:this.current, current:this.current,
pageSize:this.pageSize pageSize:this.pageSize
} }
@ -94,12 +96,13 @@ import {
} }
}).catch(error => { }).catch(error => {
message.warning(error.msg); message.warning(error.msg);
}) })
}
@action("nodetree事件")
doSearch (params){
this.setInit(true);
this.getTableInfo(params);
} }
@action("联查部门") @action("联查部门")

View File

@ -31,6 +31,12 @@
} }
.wea-table-operates {
width: 70px !important;
}
//集团管理 //集团管理
.organization-group { .organization-group {
padding-left: 25%; padding-left: 25%;