From 669f92dbf26fa0cc79f589c89efd3b580312947e Mon Sep 17 00:00:00 2001 From: Chengliang <1546584672@qq.com> Date: Thu, 19 May 2022 09:35:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=A9=E5=B1=95=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/company/CompanyExtend.js | 7 +++-- .../components/company/company.js | 3 +- pc4mobx/organization/index.js | 2 +- pc4mobx/organization/stores/companyextend.js | 29 +++++++++++-------- 4 files changed, 24 insertions(+), 17 deletions(-) diff --git a/pc4mobx/organization/components/company/CompanyExtend.js b/pc4mobx/organization/components/company/CompanyExtend.js index 7fa7d9a..c9ff330 100644 --- a/pc4mobx/organization/components/company/CompanyExtend.js +++ b/pc4mobx/organization/components/company/CompanyExtend.js @@ -22,9 +22,12 @@ export default class CompanyExtend extends React.Component { } init = () => { const { companyExtend,company } = this.props; - const {id} = company; + //const {id} = company; + const {hash} = window.location; + let id = hash.replace("[^/]+(?=/$|$)"); + console.log("id",id) companyExtend.init(); - // companyExtend.hrmId=hrmId; + companyExtend.setId(id); companyExtend.getData(); } diff --git a/pc4mobx/organization/components/company/company.js b/pc4mobx/organization/components/company/company.js index 87539ba..6d7bd83 100644 --- a/pc4mobx/organization/components/company/company.js +++ b/pc4mobx/organization/components/company/company.js @@ -217,8 +217,7 @@ export default class Company extends React.Component { if (c.dataIndex == 'compName') { c.render = function (text, record) { return { - company.setId(record.id); - window.open('/spa/organization/static/index.html#/main/organization/companyExtend',"_blank") + window.open(`/spa/organization/static/index.html#/main/organization/companyExtend/${record.id}`,"_blank") }}>{text} } } diff --git a/pc4mobx/organization/index.js b/pc4mobx/organization/index.js index 8abf7ad..b8bc76d 100644 --- a/pc4mobx/organization/index.js +++ b/pc4mobx/organization/index.js @@ -43,7 +43,7 @@ const Routes = ( - + diff --git a/pc4mobx/organization/stores/companyextend.js b/pc4mobx/organization/stores/companyextend.js index 8993851..85cf6e5 100644 --- a/pc4mobx/organization/stores/companyextend.js +++ b/pc4mobx/organization/stores/companyextend.js @@ -18,7 +18,8 @@ export class CompanyExtendStore { @observable selectedKey = 0; @observable detailSelectedKey = 0; @observable topTab = []; - @observable buttons = {} + @observable buttons = {}; + @observable id = ''; //分部id @observable date; @observable personalEditTables; @@ -122,7 +123,7 @@ export class CompanyExtendStore { this.loading = true; params = { ...params, - viewAttr:this.isEditor ? 2 : 1 + viewAttr: this.isEditor ? 2 : 1 } let data = { "result": { @@ -1090,10 +1091,10 @@ export class CompanyExtendStore { ], "topTab": [ { - "title": "总部信息", - "viewCondition": "1" + "title": "总部信息", + "viewCondition": "1" } - ] + ] } } // API.getResourceCard(params).then((data) => { @@ -1120,12 +1121,12 @@ export class CompanyExtendStore { handleTable = (datas) => { return datas && datas.map(data => { - const {tabinfo:{columns}} = data; + const { tabinfo: { columns } } = data; const length = columns.length; - columns.map(c => { - c.width = `${95/length}%` - }) - return data + columns.map(c => { + c.width = `${95 / length}%` + }) + return data }) } @@ -1170,13 +1171,17 @@ export class CompanyExtendStore { } - setTopTab (topTab) { + setTopTab(topTab) { this.topTab = topTab; } changeData(key) { this.setSelectedKey(key); -} + } + + setId(id) { + this.id = id; + } }