人员卡片页面重做
This commit is contained in:
parent
e498634292
commit
edd7e4c2a6
|
|
@ -0,0 +1,8 @@
|
|||
|
||||
import {
|
||||
WeaTools
|
||||
} from 'ecCom'
|
||||
|
||||
export const getCardData = (id) => {
|
||||
return WeaTools.callApi(`/api/bs/hrmorganization/personnelcard/getPersonnelCard?id=${id}`, 'GET');
|
||||
}
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-05-18 14:52:39
|
||||
* @LastEditTime: 2022-09-08 17:11:51
|
||||
* @LastEditTime: 2022-10-12 18:01:56
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/company/CompanyExtend.js
|
||||
*/
|
||||
|
|
@ -277,7 +277,8 @@ export default class CompanyExtend extends React.Component {
|
|||
|
||||
</div>
|
||||
)
|
||||
} catch (e) {
|
||||
}
|
||||
catch (e) {
|
||||
return <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@h1wgnu`}>
|
||||
<div style={{ color: '#000' }}>{i18n.message.authFailed()}</div>
|
||||
</WeaAlertPage>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ import {
|
|||
|
||||
const Step = Steps.Step;
|
||||
import StepContent from './stepContent';
|
||||
import "../../style/common.less";
|
||||
|
||||
@inject("newImport")
|
||||
@observer
|
||||
|
|
@ -71,6 +72,7 @@ export default class StepDialog extends React.Component {
|
|||
|
||||
return (
|
||||
<WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@1txk5f`}
|
||||
className="new-edit-wrapper"
|
||||
title={title}
|
||||
icon="icon-coms-upload"
|
||||
iconBgcolor="#217346"
|
||||
|
|
@ -80,6 +82,7 @@ export default class StepDialog extends React.Component {
|
|||
onCancel={() => newImport.init()}
|
||||
buttons={buttons}
|
||||
style={{ width: width, height: height }}
|
||||
initLoadCss
|
||||
>
|
||||
<div style={{ marginTop: 24 }}>
|
||||
<Steps current={current}>
|
||||
|
|
|
|||
|
|
@ -28,13 +28,24 @@ export default class IframeItem extends React.Component {
|
|||
} = this.state;
|
||||
|
||||
return (
|
||||
<div className='iframe-item' id={iframeInfo.id}>
|
||||
<div className='iframe-item' id={iframeInfo.id} >
|
||||
<div className='title'>
|
||||
<div></div>
|
||||
<p>{iframeInfo.title}</p>
|
||||
</div>
|
||||
<div className='content'>
|
||||
<iframe src={iframeInfo.url} width="100%" frameBorder="0"/>
|
||||
<div className='content' >
|
||||
<iframe
|
||||
id={iframeInfo.id+"-iframe"}
|
||||
src={iframeInfo.url}
|
||||
width="100%"
|
||||
height="500px"
|
||||
frameBorder="0"
|
||||
scrolling="auto"
|
||||
onLoad={() => {
|
||||
// console.log(document.getElementById(iframeInfo.id+"-iframe").scrollHeight)
|
||||
// document.getElementById(iframeInfo.id+"-iframe").height = 500 + "px"
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ import {
|
|||
Button,
|
||||
message,
|
||||
Switch,
|
||||
Menu, Dropdown,Icon,Anchor
|
||||
Menu, Dropdown, Icon, Anchor
|
||||
} from 'antd';
|
||||
|
||||
import {
|
||||
|
|
@ -46,10 +46,9 @@ export default class ResourceCard extends React.Component {
|
|||
constructor(props) {
|
||||
super(props);
|
||||
this.state = {
|
||||
activity:0,//激活的锚点
|
||||
detectElements: [], // 受监控元素,可能存在空项
|
||||
activity: 0,//激活的锚点
|
||||
}
|
||||
this.flag = false; // 点击Anchor菜单项,不执行监听滚动事件
|
||||
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
|
|
@ -95,62 +94,76 @@ export default class ResourceCard extends React.Component {
|
|||
const {
|
||||
resourceCard
|
||||
} = this.props;
|
||||
let { hash } = window.location;
|
||||
hash = hash.split("?")[0];
|
||||
let id = hash.match("[^/]+(?=/$|$)")[0];
|
||||
resourceCard.userid = id;
|
||||
resourceCard.init();
|
||||
this.buildDetectElements(); //生成受监控元素
|
||||
}
|
||||
|
||||
buildDetectElements = () => {
|
||||
const {
|
||||
resourceCard
|
||||
} = this.props,{
|
||||
data
|
||||
} = resourceCard;
|
||||
|
||||
data.anchorList.map((item,index) => {
|
||||
item.activity = index;
|
||||
item.offset = document.getElementById(item.id).offsetTop + document.getElementById(item.id).clientHeight;
|
||||
})
|
||||
|
||||
this.setState({
|
||||
detectElements:data.anchorList
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
onScrollEnd = () => {
|
||||
const {
|
||||
resourceCard
|
||||
} = this.props;
|
||||
resourceCard.scrollLoading = true;
|
||||
resourceCard.iframeList.push({
|
||||
id:"job",
|
||||
title:"岗位管理",
|
||||
url:'/spa/organization/static/index.html#/main/organization/companyExtend/7'
|
||||
})
|
||||
setTimeout(() => {
|
||||
resourceCard.scrollLoading = false;
|
||||
}, 2000);
|
||||
// resourceCard.scrollLoading = true;
|
||||
|
||||
// setTimeout(() => {
|
||||
// // resourceCard.data.iframeList.push({
|
||||
// // id: "job",
|
||||
// // title: "岗位管理",
|
||||
// // url: '/spa/organization/static/index.html#/main/organization/companyExtend/7'
|
||||
// // })
|
||||
// resourceCard.scrollLoading = false;
|
||||
// }, 2000);
|
||||
|
||||
};
|
||||
|
||||
// buildDetectElements = () => {
|
||||
// const {
|
||||
// resourceCard
|
||||
// } = this.props,{
|
||||
// data
|
||||
// } =resourceCard;
|
||||
|
||||
// !this.isEmptyObject(data) && data.anchorList.map((item, index) => {
|
||||
// item.activity = index;
|
||||
// item.offset = document.getElementById(item.id).offsetTop + document.getElementById(item.id).clientHeight;
|
||||
// })
|
||||
// resourceCard.setDetectElements(data.anchorList);
|
||||
// }
|
||||
|
||||
handleMenuClick = (e) => {
|
||||
console.log('click', e);
|
||||
}
|
||||
|
||||
onScroll = (event) => {
|
||||
const {
|
||||
resourceCard
|
||||
} = this.props,{
|
||||
detectElements,
|
||||
flag
|
||||
} = resourceCard;
|
||||
const postion = event.target.scrollTop;
|
||||
let getActivityCurrent = this.state.activity;
|
||||
this.state.detectElements.map((item,index) => {
|
||||
if(postion >= document.getElementById(item.id).offsetTop &&postion <= item.offset){
|
||||
detectElements.map((item, index) => {
|
||||
if (postion >= document.getElementById(item.id).offsetTop && postion <= item.offset) {
|
||||
return getActivityCurrent = item.activity;
|
||||
}
|
||||
})
|
||||
|
||||
if(event.target.scrollHeight == postion + event.target.clientHeight) {
|
||||
getActivityCurrent = detectElements.length - 1
|
||||
}
|
||||
|
||||
this.setState({
|
||||
activity: getActivityCurrent
|
||||
})
|
||||
}
|
||||
|
||||
scrollToAnchor = (anchorName,index) => {
|
||||
}
|
||||
|
||||
scrollToAnchor = (anchorName, index) => {
|
||||
const {
|
||||
resourceCard
|
||||
} = this.props;
|
||||
|
||||
let _this = this;
|
||||
if (anchorName) {
|
||||
// 找到锚点
|
||||
let anchorElement = document.getElementById(anchorName);
|
||||
|
|
@ -159,6 +172,13 @@ export default class ResourceCard extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
isEmptyObject(obj) {
|
||||
for (let key in obj) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
render() {
|
||||
const {
|
||||
resourceCard
|
||||
|
|
@ -168,8 +188,7 @@ export default class ResourceCard extends React.Component {
|
|||
offset,
|
||||
overtime,
|
||||
intervalTime,
|
||||
data,
|
||||
iframeList,
|
||||
data
|
||||
} = resourceCard;
|
||||
|
||||
const menu = (
|
||||
|
|
@ -181,120 +200,117 @@ export default class ResourceCard extends React.Component {
|
|||
);
|
||||
|
||||
return (
|
||||
<WeaNewScrollPagination
|
||||
height='100%'
|
||||
onScrollEnd={this.onScrollEnd}
|
||||
onScroll = {this.onScroll}
|
||||
>
|
||||
<div className="gutter-resource-card">
|
||||
<div className="gutter-row">
|
||||
<div className='top'>
|
||||
<img src={require('../../images/resource.png')} />
|
||||
<div className='user'>
|
||||
<div className='name'>{data.user.name}
|
||||
<span>{data.user.sex == 0 ? <i className="icon-coms-men" /> : <i className="icon-coms-women" />}</span>
|
||||
</div>
|
||||
<div className='icon-info'>
|
||||
<i className="icon-coms-Send-message" />
|
||||
<i className="icon-coms-message-o" />
|
||||
<i className="icon-coms-Send-emails" />
|
||||
<i className="icon-coms-New-schedule-o" />
|
||||
</div>
|
||||
<div className='content'>
|
||||
<div>
|
||||
<span className='label'><i className="icon-portal-email-o" /></span>
|
||||
<span className='value'>{data.user.email}</span>
|
||||
<span className='label'><i className="icon-coms-contact" /></span>
|
||||
<span className='value'>{data.user.phone}</span>
|
||||
!this.isEmptyObject(data) && <WeaNewScrollPagination
|
||||
height='100%'
|
||||
onScrollEnd={this.onScrollEnd}
|
||||
onScroll={this.onScroll}
|
||||
>
|
||||
<div className="gutter-resource-card">
|
||||
<div className="gutter-row">
|
||||
<div className='top'>
|
||||
<img src={data.user.image} />
|
||||
<div className='user'>
|
||||
<div className='name'>{data.user.name}
|
||||
<span>{data.user.sex == 0 ? <i className="icon-coms-men" /> : <i className="icon-coms-women" />}</span>
|
||||
</div>
|
||||
<div className='icon-info'>
|
||||
<i className="icon-coms-Send-message" />
|
||||
<i className="icon-coms-message-o" />
|
||||
<i className="icon-coms-Send-emails" />
|
||||
<i className="icon-coms-New-schedule-o" />
|
||||
</div>
|
||||
<div className='content'>
|
||||
<div>
|
||||
<span className='label'><i className="icon-portal-email-o" /></span>
|
||||
<span className='value'>{data.user.email}</span>
|
||||
<span className='label'><i className="icon-coms-contact" /></span>
|
||||
<span className='value'>{data.user.phone}</span>
|
||||
</div>
|
||||
<div style={{ marginTop: '10px' }}>
|
||||
<span className='label'>账号类型:</span>
|
||||
<span className='value'>{data.user.belongTo}</span>
|
||||
<span className='label'>状态:</span>
|
||||
<span className='value'>{data.user.status}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ marginTop: '10px' }}>
|
||||
<span className='label'>账号类型:</span>
|
||||
<span className='value'>{data.user.belongTo}</span>
|
||||
<span className='label'>状态:</span>
|
||||
<span className='value'>{data.user.status}</span>
|
||||
<div className='right-button'>
|
||||
<Button className='item' onClick={() => { window.location.href = `/spa/organization/static/index.html#/main/organization/resourceExtend/${data.user.id}`}}>编辑人员</Button>
|
||||
<Button className='item'>调动</Button>
|
||||
<Button className='item'>离职</Button>
|
||||
<Dropdown overlay={menu}>
|
||||
<Button style={{ marginLeft: 8 }} className='item'>
|
||||
更多操作 <Icon type="down" />
|
||||
</Button>
|
||||
</Dropdown>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div className='data'>
|
||||
<Row type="flex" justify="space-between" style={{ height: '100%' }}>
|
||||
<Col className='ant-col' span={4}>
|
||||
<img src="/hrm/hrm_e9/image/workflow.png" alt="" />
|
||||
<div>
|
||||
<p>流程总数</p>
|
||||
<p onClick={() => { window.open(`/spa/workflow/static/index.html#/main/workflow/listDoing?resourceid=${data.user.id}`) }}>{data.statistical.workflowCount}</p>
|
||||
</div>
|
||||
</Col>
|
||||
<Col className='ant-col' span={4}>
|
||||
<img src="/hrm/hrm_e9/image/doc.png" alt="" />
|
||||
<div>
|
||||
<p>文档总数</p>
|
||||
<p onClick={() => { window.open(`/spa/document/static/index.html#/main/document/search?viewcondition=2&doccreaterid=${data.user.id}`) }}>{data.statistical.docCount}</p>
|
||||
</div>
|
||||
</Col>
|
||||
<Col className='ant-col' span={4}>
|
||||
<img src="/hrm/hrm_e9/image/custom.png" alt="" />
|
||||
<div>
|
||||
<p>我的客户</p>
|
||||
<p onClick={() => { window.open(`/spa/crm/static/index.html#/main/crm/customer/hrmView?searchHrmId=${data.user.id}`) }}>{data.statistical.cusCount}</p>
|
||||
</div>
|
||||
</Col>
|
||||
<Col className='ant-col' span={4}>
|
||||
<img src="/hrm/hrm_e9/image/cowork.png" alt="" />
|
||||
<div>
|
||||
<p>我的协作</p>
|
||||
<p onClick={() => { window.open(`/spa/cowork/static/index.html#/main/cowork/hrmview?searchHrmid=${data.user.id}`) }}>{data.statistical.collaborationCount}</p>
|
||||
</div>
|
||||
</Col>
|
||||
<Col className='ant-col' span={4}>
|
||||
<img src="/hrm/hrm_e9/image/weibo.png" alt="" />
|
||||
<div>
|
||||
<p>微博总数</p>
|
||||
<p onClick={() => { window.open(`/spa/blog/static/index.html#/user/${data.user.id}`) }}>{data.statistical.weiboCount}</p>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
{
|
||||
data.formItems.map((item, index) => {
|
||||
return (
|
||||
<FormItem groupInfo={item} />
|
||||
)
|
||||
})
|
||||
}
|
||||
{
|
||||
data.iframeList.map((item, index) => {
|
||||
return (
|
||||
<IframeItem iframeInfo={item} />
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
<div className='right-button'>
|
||||
<Button className='item'>编辑人员</Button>
|
||||
<Button className='item'>调动</Button>
|
||||
<Button className='item'>离职</Button>
|
||||
<Dropdown overlay={menu}>
|
||||
<Button style={{ marginLeft: 8 }} className='item'>
|
||||
更多操作 <Icon type="down" />
|
||||
</Button>
|
||||
</Dropdown>
|
||||
<div className="gutter-row">
|
||||
<AnchorDetect
|
||||
anchorList={data.anchorList}
|
||||
container={window}
|
||||
activity={this.state.activity}
|
||||
onChange={this.scrollToAnchor}
|
||||
/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div className='data'>
|
||||
<Row type="flex" justify="space-between" style={{height:'100%'}}>
|
||||
<Col className='ant-col' span={4}>
|
||||
<img src="/hrm/hrm_e9/image/workflow.png" alt="" />
|
||||
<div>
|
||||
<p>流程总数</p>
|
||||
<p onClick={() => {window.open(`/spa/workflow/static/index.html#/main/workflow/listDoing?resourceid=${data.user.id}`)}}>{data.statistical.workflowCount}</p>
|
||||
</div>
|
||||
</Col>
|
||||
<Col className='ant-col' span={4}>
|
||||
<img src="/hrm/hrm_e9/image/doc.png" alt="" />
|
||||
<div>
|
||||
<p>文档总数</p>
|
||||
<p onClick={() => {window.open(`/spa/document/static/index.html#/main/document/search?viewcondition=2&doccreaterid=${data.user.id}`)}}>{data.statistical.docCount}</p>
|
||||
</div>
|
||||
</Col>
|
||||
<Col className='ant-col' span={4}>
|
||||
<img src="/hrm/hrm_e9/image/custom.png" alt="" />
|
||||
<div>
|
||||
<p>我的客户</p>
|
||||
<p onClick={() => {window.open(`/spa/crm/static/index.html#/main/crm/customer/hrmView?searchHrmId=${data.user.id}`)}}>{data.statistical.cusCount}</p>
|
||||
</div>
|
||||
</Col>
|
||||
<Col className='ant-col' span={4}>
|
||||
<img src="/hrm/hrm_e9/image/cowork.png" alt="" />
|
||||
<div>
|
||||
<p>我的协作</p>
|
||||
<p onClick={() => {window.open(`/spa/cowork/static/index.html#/main/cowork/hrmview?searchHrmid=${data.user.id}`)}}>{data.statistical.collaborationCount}</p>
|
||||
</div>
|
||||
</Col>
|
||||
<Col className='ant-col' span={4}>
|
||||
<img src="/hrm/hrm_e9/image/weibo.png" alt="" />
|
||||
<div>
|
||||
<p>微博总数</p>
|
||||
<p onClick={() => {window.open(`/spa/blog/static/index.html#/user/${data.user.id}`)}}>{data.statistical.weiboCount}</p>
|
||||
</div>
|
||||
</Col>
|
||||
</Row>
|
||||
</div>
|
||||
{
|
||||
data.formItems.map((item,index)=>{
|
||||
return(
|
||||
<FormItem groupInfo={item}/>
|
||||
)
|
||||
})
|
||||
}
|
||||
{
|
||||
iframeList.map((item,index) => {
|
||||
return(
|
||||
<IframeItem iframeInfo={item}/>
|
||||
)
|
||||
})
|
||||
}
|
||||
</div>
|
||||
<div className="gutter-row">
|
||||
<AnchorDetect
|
||||
anchorList={data.anchorList}
|
||||
container={window}
|
||||
activity={this.state.activity}
|
||||
onChange={this.scrollToAnchor}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<Spin size="large" tip="" className='scroll-spin' spinning={scrollLoading} />
|
||||
|
||||
|
||||
</WeaNewScrollPagination>
|
||||
|
||||
<Spin size="large" tip="" className='scroll-spin' spinning={scrollLoading} />
|
||||
</WeaNewScrollPagination>
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
/**
|
||||
* @Author: 程亮
|
||||
* @Date: 2022-06-20 14:59:21
|
||||
* @LastEditTime: 2022-06-21 18:05:35
|
||||
* @LastEditTime: 2022-10-18 11:18:05
|
||||
* @Description:
|
||||
* @FilePath: /trunk/src4js/pc4mobx/organization/components/resource/ResourceExtend.js
|
||||
*/
|
||||
|
|
@ -160,22 +160,6 @@
|
|||
onClick: key => {
|
||||
this.saveEditCard();
|
||||
}
|
||||
}, {
|
||||
icon: <i className='icon-coms-go-back' />,
|
||||
content: i18n.button.back(),
|
||||
key: 'back',
|
||||
onClick: key => {
|
||||
this.backCard();
|
||||
}
|
||||
}]
|
||||
} else {
|
||||
arr = [{
|
||||
icon: <i className='icon-coms-edit' />,
|
||||
content: i18n.button.modify(),
|
||||
key: 'editCard',
|
||||
onClick: key => {
|
||||
this.editCard();
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -188,37 +172,19 @@
|
|||
const { resourceExtend } = this.props;
|
||||
const { isEditor, buttons } = resourceExtend;
|
||||
const save = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pkes6y`} type="primary" onClick={this.saveEditCard} >{i18n.button.save()}</Button>;
|
||||
const back = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@pl1fw8`} type="primary" onClick={this.backCard} >{i18n.button.back()}</Button>;
|
||||
const edit = <Button ecId={`${this && this.props && this.props.ecId || ''}_Button@vkeda5`} type="primary" onClick={this.editCard} >{i18n.button.modify()}</Button>;
|
||||
const btns = [];
|
||||
try {
|
||||
if (isEditor) {
|
||||
if (buttons.hasSave) {
|
||||
btns.push(save);
|
||||
btns.push(back);
|
||||
}
|
||||
} else {
|
||||
if (buttons.hasEdit) {
|
||||
btns.push(edit);
|
||||
}
|
||||
}
|
||||
} catch (e) { }
|
||||
btns.push(save);
|
||||
return btns;
|
||||
}
|
||||
|
||||
editCard = () => {
|
||||
const { resourceExtend } = this.props;
|
||||
resourceExtend.edit();
|
||||
}
|
||||
|
||||
|
||||
saveEditCard = () => {
|
||||
const { resourceExtend } = this.props;
|
||||
resourceExtend.save();
|
||||
}
|
||||
|
||||
backCard = () => {
|
||||
this.init();
|
||||
}
|
||||
|
||||
|
||||
changeData(key) {
|
||||
const {
|
||||
|
|
|
|||
|
|
@ -101,12 +101,22 @@ export default class Resource extends React.Component {
|
|||
inputLeftDom={`<b>${i18n.label.organization()}</b>`}
|
||||
treeNodeClick={this.treeNodeClick}
|
||||
expandAllChildrenOnSearch={true}
|
||||
renderNode={item => this.renderNode(item)}
|
||||
/>
|
||||
)
|
||||
|
||||
return tree;
|
||||
}
|
||||
|
||||
renderNode(item) {
|
||||
return <div className='text-elli' title={item.name}>
|
||||
<i className={item.icon} style={{ marginRight: '5px' }}></i>
|
||||
{item.name}
|
||||
{item.canceled && <span style={{ color: 'red' }}>({i18n.label.forbidden()})</span>}
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
getTopMenuBtns() {
|
||||
const {
|
||||
resource
|
||||
|
|
@ -192,42 +202,6 @@ export default class Resource extends React.Component {
|
|||
datasImport.getImportForm();
|
||||
}
|
||||
|
||||
|
||||
batchDelete() {
|
||||
const {
|
||||
resource
|
||||
} = this.props;
|
||||
const {
|
||||
tableStore
|
||||
} = resource;
|
||||
|
||||
let keys = toJS(tableStore.selectedRowKeys).toString();
|
||||
resource.setIds(keys);
|
||||
this.showConfirm('batchDel');
|
||||
}
|
||||
showConfirm(v) {
|
||||
let _this = this;
|
||||
confirm({
|
||||
title: i18n.confirm.defaultTitle(),
|
||||
content: (v == 'del') ? i18n.confirm.delete() : i18n.confirm.batchDeleteConfirm(),
|
||||
okText: i18n.button.ok(),
|
||||
cancelText: i18n.button.cancel(),
|
||||
onOk() {
|
||||
_this.onOk();
|
||||
},
|
||||
onCancel() {
|
||||
return false;
|
||||
},
|
||||
});
|
||||
}
|
||||
onOk() {
|
||||
const {
|
||||
resource
|
||||
} = this.props;
|
||||
resource.delete();
|
||||
}
|
||||
|
||||
|
||||
getDropMenuDatas() {
|
||||
const {
|
||||
resource
|
||||
|
|
@ -309,50 +283,25 @@ export default class Resource extends React.Component {
|
|||
if (c.dataIndex == 'last_name') {
|
||||
c.render = function (text, record) {
|
||||
return <a href='javascript:void(0);' onClick={() => {
|
||||
window.open(`/spa/organization/static/index.html#/main/organization/ResourceExtend/${record.id}`, "_blank")
|
||||
window.open(`/spa/organization/static/index.html#/main/organization/resourceCard/${record.id}`);
|
||||
}}>{text}</a>
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
updateForbiddenTag(checked, id) {
|
||||
const {
|
||||
resource
|
||||
} = this.props;
|
||||
resource.updateForbiddenTag(checked, id);
|
||||
}
|
||||
|
||||
onOperatesClick(record, rowIndex, operate) {
|
||||
const {
|
||||
index
|
||||
} = operate;
|
||||
(index == '0') && this.doEdit(record.randomFieldId);
|
||||
(index == '1') && this.doDel(record.randomFieldId);
|
||||
|
||||
(index == '0') && this.view(record.randomFieldId);
|
||||
}
|
||||
|
||||
doEdit(id) {
|
||||
const {
|
||||
resource
|
||||
} = this.props;
|
||||
|
||||
resource.setNeDialogTitle(i18n.label.editRankScheme());
|
||||
resource.setSchemeId(id);
|
||||
resource.setIsNew(false);
|
||||
resource.setVisible(true);
|
||||
resource.getForm();
|
||||
view(id) {
|
||||
window.open(`/spa/organization/static/index.html#/main/organization/resourceCard/${id}`);
|
||||
}
|
||||
|
||||
doDel(id) {
|
||||
const {
|
||||
resource
|
||||
} = this.props;
|
||||
resource.setIds(id);
|
||||
this.showConfirm('del');
|
||||
}
|
||||
|
||||
|
||||
handleSave() {
|
||||
const {
|
||||
resource
|
||||
|
|
@ -426,8 +375,6 @@ export default class Resource extends React.Component {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
render() {
|
||||
|
||||
const {
|
||||
|
|
@ -495,7 +442,7 @@ export default class Resource extends React.Component {
|
|||
conditionLen={3}
|
||||
save={() => this.handleSave()}
|
||||
onCancel={() => resource.setVisible(false)}
|
||||
saveAndSetting={() => this.handleSaveAndSetting()}
|
||||
// saveAndSetting={() => this.handleSaveAndSetting()}
|
||||
/>
|
||||
<DatasImport ecId={`${this && this.props && this.props.ecId || ''}_DatasImport@q4rrwm`} />
|
||||
</div>
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 32 KiB |
|
|
@ -95,7 +95,7 @@ const Routes = (
|
|||
<Route key="newImport" path="newImport" component={NewImport} />
|
||||
<Route key="staffWorkflowSet" path="staffWorkflowSet" component={StaffWorkflowSet} />
|
||||
<Route key="resourceBasicInfo" path="resourceBasicInfo" component={ResourceBasicInfo} />
|
||||
<Route key="resourceCard" path="resourceCard" component={ResourceCard} />
|
||||
<Route key="resourceCard" path="resourceCard/:id" component={ResourceCard} />
|
||||
</Route>
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,168 +7,210 @@ import * as Api from '../apis/resourceCard'; // 引入API接口文件
|
|||
|
||||
|
||||
export class ResourceCardStore {
|
||||
@observable userid = '';
|
||||
@observable height = 2000;
|
||||
@observable scrollLoading = true;
|
||||
@observable scrollLoading = false;
|
||||
@observable offset = 20;
|
||||
@observable overtime = 1000;
|
||||
@observable intervalTime = 500;
|
||||
|
||||
@observable data = {};
|
||||
@observable detectElements = [] // 受监控元素,可能存在空项
|
||||
@observable flag = true; // 点击Anchor菜单项,不执行监听滚动事件
|
||||
|
||||
@action("初始化") init = () => {
|
||||
//const { userid } = JSON.parse(localStorage.getItem("theme-account"));
|
||||
this.getCardData();
|
||||
|
||||
}
|
||||
|
||||
@action("获取卡片信息") getCardData = () => {
|
||||
Api.getCardData(this.userid).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.setData(res.data)
|
||||
this.buildDetectElements(res.data); //生成受监控元素
|
||||
} else {
|
||||
message.warning(res.msg);
|
||||
}
|
||||
}, error => {
|
||||
message.warning(error.msg);
|
||||
})
|
||||
}
|
||||
|
||||
buildDetectElements = (data) => {
|
||||
!this.isEmptyObject(data) && data.anchorList.map((item, index) => {
|
||||
item.activity = index;
|
||||
item.offset = document.getElementById(item.id).offsetTop + document.getElementById(item.id).clientHeight;
|
||||
})
|
||||
this.setDetectElements(data.anchorList);
|
||||
}
|
||||
|
||||
isEmptyObject(obj) {
|
||||
for (let key in obj) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
setData(value){
|
||||
this.data = value;
|
||||
}
|
||||
|
||||
|
||||
setDetectElements(value) {
|
||||
this.detectElements = value;
|
||||
}
|
||||
/************** json数据*****************/
|
||||
@observable data = {
|
||||
user: {
|
||||
id:23,
|
||||
image: "",
|
||||
name: "萧言",
|
||||
sex:"0",
|
||||
email: "1546584672@qq.com",
|
||||
phone: "18822349878",
|
||||
belongTo: "主账号",
|
||||
status: "正式"
|
||||
},
|
||||
statistical: {
|
||||
workflowCount:190,
|
||||
docCount:134,
|
||||
cusCount:28,
|
||||
collaborationCount:28,
|
||||
weiboCount:166
|
||||
},
|
||||
formItems:[
|
||||
{
|
||||
id:'userInfo',
|
||||
title:'员工信息',
|
||||
items:[
|
||||
{
|
||||
fieldId:'姓名',
|
||||
fieldValue:'萧言'
|
||||
},{
|
||||
fieldId:'性别',
|
||||
fieldValue:'男'
|
||||
},{
|
||||
fieldId:'出生日期',
|
||||
fieldValue:'1987年9月1日'
|
||||
},{
|
||||
fieldId:'个人邮箱',
|
||||
fieldValue:'1546875925@qq.com'
|
||||
},{
|
||||
fieldId:'电话号码',
|
||||
fieldValue:'18925689752'
|
||||
},{
|
||||
fieldId:'岗位级别',
|
||||
fieldValue:'-'
|
||||
},{
|
||||
fieldId:'职务信息',
|
||||
fieldValue:'产品运营'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id:'workInfo',
|
||||
title:'工作信息',
|
||||
items:[
|
||||
{
|
||||
fieldId:'姓名',
|
||||
fieldValue:'萧言'
|
||||
},{
|
||||
fieldId:'性别',
|
||||
fieldValue:'男'
|
||||
},{
|
||||
fieldId:'出生日期',
|
||||
fieldValue:'1987年9月1日'
|
||||
},{
|
||||
fieldId:'个人邮箱',
|
||||
fieldValue:'1546875925@qq.com'
|
||||
},{
|
||||
fieldId:'姓名',
|
||||
fieldValue:'萧言'
|
||||
},{
|
||||
fieldId:'性别',
|
||||
fieldValue:'男'
|
||||
},{
|
||||
fieldId:'出生日期',
|
||||
fieldValue:'1987年9月1日'
|
||||
},{
|
||||
fieldId:'个人邮箱',
|
||||
fieldValue:'1546875925@qq.com'
|
||||
},{
|
||||
fieldId:'姓名',
|
||||
fieldValue:'萧言'
|
||||
},{
|
||||
fieldId:'性别',
|
||||
fieldValue:'男'
|
||||
},{
|
||||
fieldId:'出生日期',
|
||||
fieldValue:'1987年9月1日'
|
||||
},{
|
||||
fieldId:'个人邮箱',
|
||||
fieldValue:'1546875925@qq.com'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id:'educationInfo',
|
||||
title:'教育经历',
|
||||
items:[
|
||||
{
|
||||
fieldId:'本科',
|
||||
fieldValue:'南京大学'
|
||||
},{
|
||||
fieldId:'研究生',
|
||||
fieldValue:'北京大学'
|
||||
},{
|
||||
fieldId:'毕业时间',
|
||||
fieldValue:'1987-09-21'
|
||||
},{
|
||||
fieldId:'获得奖项',
|
||||
fieldValue:'优秀毕业生'
|
||||
},{
|
||||
fieldId:'备注',
|
||||
fieldValue:'无'
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
anchorList:[
|
||||
{
|
||||
id:'userInfo',
|
||||
title:'员工信息'
|
||||
},
|
||||
{
|
||||
id:'workInfo',
|
||||
title:'工作信息'
|
||||
},
|
||||
{
|
||||
id:'educationInfo',
|
||||
title:'教育经历'
|
||||
},
|
||||
{
|
||||
id:'comp',
|
||||
title:'分部扩展页'
|
||||
},
|
||||
{
|
||||
id:'dept',
|
||||
title:'部门扩展页'
|
||||
}
|
||||
// @observable data = {
|
||||
// user: {
|
||||
// id:23,
|
||||
// image: "",
|
||||
// name: "萧言",
|
||||
// sex:"0",
|
||||
// email: "1546584672@qq.com",
|
||||
// phone: "18822349878",
|
||||
// belongTo: "主账号",
|
||||
// status: "正式"
|
||||
// },
|
||||
// statistical: {
|
||||
// workflowCount:190,
|
||||
// docCount:134,
|
||||
// cusCount:28,
|
||||
// collaborationCount:28,
|
||||
// weiboCount:166
|
||||
// },
|
||||
// formItems:[
|
||||
// {
|
||||
// id:'userInfo',
|
||||
// title:'员工信息',
|
||||
// items:[
|
||||
// {
|
||||
// fieldId:'姓名',
|
||||
// fieldValue:'萧言'
|
||||
// },{
|
||||
// fieldId:'性别',
|
||||
// fieldValue:'男'
|
||||
// },{
|
||||
// fieldId:'出生日期',
|
||||
// fieldValue:'1987年9月1日'
|
||||
// },{
|
||||
// fieldId:'个人邮箱',
|
||||
// fieldValue:'1546875925@qq.com'
|
||||
// },{
|
||||
// fieldId:'电话号码',
|
||||
// fieldValue:'18925689752'
|
||||
// },{
|
||||
// fieldId:'岗位级别',
|
||||
// fieldValue:'-'
|
||||
// },{
|
||||
// fieldId:'职务信息',
|
||||
// fieldValue:'产品运营'
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// id:'workInfo',
|
||||
// title:'工作信息',
|
||||
// items:[
|
||||
// {
|
||||
// fieldId:'姓名',
|
||||
// fieldValue:'萧言'
|
||||
// },{
|
||||
// fieldId:'性别',
|
||||
// fieldValue:'男'
|
||||
// },{
|
||||
// fieldId:'出生日期',
|
||||
// fieldValue:'1987年9月1日'
|
||||
// },{
|
||||
// fieldId:'个人邮箱',
|
||||
// fieldValue:'1546875925@qq.com'
|
||||
// },{
|
||||
// fieldId:'姓名',
|
||||
// fieldValue:'萧言'
|
||||
// },{
|
||||
// fieldId:'性别',
|
||||
// fieldValue:'男'
|
||||
// },{
|
||||
// fieldId:'出生日期',
|
||||
// fieldValue:'1987年9月1日'
|
||||
// },{
|
||||
// fieldId:'个人邮箱',
|
||||
// fieldValue:'1546875925@qq.com'
|
||||
// },{
|
||||
// fieldId:'姓名',
|
||||
// fieldValue:'萧言'
|
||||
// },{
|
||||
// fieldId:'性别',
|
||||
// fieldValue:'男'
|
||||
// },{
|
||||
// fieldId:'出生日期',
|
||||
// fieldValue:'1987年9月1日'
|
||||
// },{
|
||||
// fieldId:'个人邮箱',
|
||||
// fieldValue:'1546875925@qq.com'
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
// {
|
||||
// id:'educationInfo',
|
||||
// title:'教育经历',
|
||||
// items:[
|
||||
// {
|
||||
// fieldId:'本科',
|
||||
// fieldValue:'南京大学'
|
||||
// },{
|
||||
// fieldId:'研究生',
|
||||
// fieldValue:'北京大学'
|
||||
// },{
|
||||
// fieldId:'毕业时间',
|
||||
// fieldValue:'1987-09-21'
|
||||
// },{
|
||||
// fieldId:'获得奖项',
|
||||
// fieldValue:'优秀毕业生'
|
||||
// },{
|
||||
// fieldId:'备注',
|
||||
// fieldValue:'无'
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
// ],
|
||||
// anchorList:[
|
||||
// {
|
||||
// id:'userInfo',
|
||||
// title:'员工信息'
|
||||
// },
|
||||
// {
|
||||
// id:'workInfo',
|
||||
// title:'工作信息'
|
||||
// },
|
||||
// {
|
||||
// id:'educationInfo',
|
||||
// title:'教育经历'
|
||||
// },
|
||||
// {
|
||||
// id:'comp',
|
||||
// title:'分部扩展页'
|
||||
// },
|
||||
// {
|
||||
// id:'dept',
|
||||
// title:'部门扩展页'
|
||||
// }
|
||||
|
||||
]
|
||||
|
||||
}
|
||||
// ],
|
||||
// iframeList: [
|
||||
// {
|
||||
// id:"comp",
|
||||
// title:"分部管理",
|
||||
// url:'/spa/organization/static/index.html#/main/organization/companyExtend/7'
|
||||
// },
|
||||
// {
|
||||
// id:"dept",
|
||||
// title:"部门管理",
|
||||
// url:'/spa/organization/static/index.html#/main/organization/company'
|
||||
// },
|
||||
// ]
|
||||
|
||||
// }
|
||||
|
||||
@observable iframeList = [
|
||||
{
|
||||
id:"comp",
|
||||
title:"分部管理",
|
||||
url:'/spa/organization/static/index.html#/main/organization/companyExtend/7'
|
||||
},
|
||||
{
|
||||
id:"dept",
|
||||
title:"部门管理",
|
||||
url:'/spa/organization/static/index.html#/main/organization/companyExtend/7'
|
||||
},
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export class ResourceExtendStore {
|
|||
@observable form = new WeaForm();
|
||||
@observable tableInfo = []
|
||||
@observable conditions = [];
|
||||
@observable isEditor = false;
|
||||
@observable isEditor = true;
|
||||
@observable isNew = true;
|
||||
@observable loading = true;
|
||||
@observable tabInfo = [];
|
||||
|
|
@ -48,7 +48,6 @@ export class ResourceExtendStore {
|
|||
|
||||
init = () => {
|
||||
this.detailSelectedKey = '0'
|
||||
this.isEditor = false;
|
||||
}
|
||||
|
||||
save = () => {
|
||||
|
|
@ -86,9 +85,10 @@ export class ResourceExtendStore {
|
|||
}).then(data => {
|
||||
if (data.code == 200) {
|
||||
message.success(i18n.message.saveSuccess());
|
||||
this.init();
|
||||
this.getData();
|
||||
this.selectedRowKeys = [];
|
||||
window.location.href = `/spa/organization/static/index.html#/main/organization/resourceCard/${this.id}`;
|
||||
// this.init();
|
||||
// this.getData();
|
||||
// this.selectedRowKeys = [];
|
||||
} else {
|
||||
message.warning(data.message);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@
|
|||
height: 40px;
|
||||
span:first-child{
|
||||
color: #999999;
|
||||
width: 60px;
|
||||
width: 80px;
|
||||
display: inline-block;
|
||||
text-align: right;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue