-
-
-
{data.user.email}
-
-
{data.user.phone}
+ !this.isEmptyObject(data) &&
+
+
+
+

+
+
{data.user.name}
+ {data.user.sex == 0 ? : }
+
+
+
+
+
+
+
+
+
+
+ {data.user.email}
+
+ {data.user.phone}
+
+
+ 账号类型:
+ {data.user.belongTo}
+ 状态:
+ {data.user.status}
+
+
-
-
账号类型:
-
{data.user.belongTo}
-
状态:
-
{data.user.status}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
流程总数
+
{ window.open(`/spa/workflow/static/index.html#/main/workflow/listDoing?resourceid=${data.user.id}`) }}>{data.statistical.workflowCount}
+
+
+
+
+
+
文档总数
+
{ window.open(`/spa/document/static/index.html#/main/document/search?viewcondition=2&doccreaterid=${data.user.id}`) }}>{data.statistical.docCount}
+
+
+
+
+
+
我的客户
+
{ window.open(`/spa/crm/static/index.html#/main/crm/customer/hrmView?searchHrmId=${data.user.id}`) }}>{data.statistical.cusCount}
+
+
+
+
+
+
我的协作
+
{ window.open(`/spa/cowork/static/index.html#/main/cowork/hrmview?searchHrmid=${data.user.id}`) }}>{data.statistical.collaborationCount}
+
+
+
+
+
+
微博总数
+
{ window.open(`/spa/blog/static/index.html#/user/${data.user.id}`) }}>{data.statistical.weiboCount}
+
+
+
+
+ {
+ data.formItems.map((item, index) => {
+ return (
+
+ )
+ })
+ }
+ {
+ data.iframeList.map((item, index) => {
+ return (
+
+ )
+ })
+ }
-
-
-
-
-
-
-
+
-
-
-
-
-
-
-
流程总数
-
{window.open(`/spa/workflow/static/index.html#/main/workflow/listDoing?resourceid=${data.user.id}`)}}>{data.statistical.workflowCount}
-
-
-
-
-
-
文档总数
-
{window.open(`/spa/document/static/index.html#/main/document/search?viewcondition=2&doccreaterid=${data.user.id}`)}}>{data.statistical.docCount}
-
-
-
-
-
-
我的客户
-
{window.open(`/spa/crm/static/index.html#/main/crm/customer/hrmView?searchHrmId=${data.user.id}`)}}>{data.statistical.cusCount}
-
-
-
-
-
-
我的协作
-
{window.open(`/spa/cowork/static/index.html#/main/cowork/hrmview?searchHrmid=${data.user.id}`)}}>{data.statistical.collaborationCount}
-
-
-
-
-
-
微博总数
-
{window.open(`/spa/blog/static/index.html#/user/${data.user.id}`)}}>{data.statistical.weiboCount}
-
-
-
-
- {
- data.formItems.map((item,index)=>{
- return(
-
- )
- })
- }
- {
- iframeList.map((item,index) => {
- return(
-
- )
- })
- }
-
-
-
-
-
-
-
-
+
+
)
}
diff --git a/pc4mobx/organization/components/resource/ResourceExtend.js b/pc4mobx/organization/components/resource/ResourceExtend.js
index a241998..6862342 100644
--- a/pc4mobx/organization/components/resource/ResourceExtend.js
+++ b/pc4mobx/organization/components/resource/ResourceExtend.js
@@ -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
*/
@@ -159,23 +159,7 @@
key: 'save',
onClick: key => {
this.saveEditCard();
- }
- }, {
- icon:
,
- content: i18n.button.back(),
- key: 'back',
- onClick: key => {
- this.backCard();
- }
- }]
- } else {
- arr = [{
- icon:
,
- content: i18n.button.modify(),
- key: 'editCard',
- onClick: key => {
- this.editCard();
- }
+ }
}
]
}
@@ -188,37 +172,19 @@
const { resourceExtend } = this.props;
const { isEditor, buttons } = resourceExtend;
const save =
;
- const back =
;
- const edit =
;
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 {
diff --git a/pc4mobx/organization/components/resource/resource.js b/pc4mobx/organization/components/resource/resource.js
index 2914f81..c2b9d7f 100644
--- a/pc4mobx/organization/components/resource/resource.js
+++ b/pc4mobx/organization/components/resource/resource.js
@@ -101,12 +101,22 @@ export default class Resource extends React.Component {
inputLeftDom={`
${i18n.label.organization()}`}
treeNodeClick={this.treeNodeClick}
expandAllChildrenOnSearch={true}
+ renderNode={item => this.renderNode(item)}
/>
)
return tree;
}
+ renderNode(item) {
+ return
+
+ {item.name}
+ {item.canceled && ({i18n.label.forbidden()})}
+
+ }
+
+
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
{
- 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}
}
}
})
}
- 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()}
/>
diff --git a/pc4mobx/organization/images/workflow.jpg b/pc4mobx/organization/images/workflow.jpg
index dc93067..94565f4 100644
Binary files a/pc4mobx/organization/images/workflow.jpg and b/pc4mobx/organization/images/workflow.jpg differ
diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js
index 45f21a9..11feb4c 100644
--- a/pc4mobx/organization/index.js
+++ b/pc4mobx/organization/index.js
@@ -95,7 +95,7 @@ const Routes = (
-
+
);
diff --git a/pc4mobx/organization/stores/resourceCard.js b/pc4mobx/organization/stores/resourceCard.js
index 8bbaef3..5d7f144 100644
--- a/pc4mobx/organization/stores/resourceCard.js
+++ b/pc4mobx/organization/stores/resourceCard.js
@@ -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'
- },
- ]
}
diff --git a/pc4mobx/organization/stores/resourceExtend.js b/pc4mobx/organization/stores/resourceExtend.js
index 98f645a..b4aea58 100644
--- a/pc4mobx/organization/stores/resourceExtend.js
+++ b/pc4mobx/organization/stores/resourceExtend.js
@@ -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);
}
diff --git a/pc4mobx/organization/style/card.less b/pc4mobx/organization/style/card.less
index d5bda3d..4a0d3ce 100644
--- a/pc4mobx/organization/style/card.less
+++ b/pc4mobx/organization/style/card.less
@@ -136,7 +136,7 @@
height: 40px;
span:first-child{
color: #999999;
- width: 60px;
+ width: 80px;
display: inline-block;
text-align: right;
}
@@ -171,7 +171,7 @@
}
.content {
width: 100%;
- padding: 15px;
+ padding: 15px;
}
}