feat: 组织架构图跳转链接修改
This commit is contained in:
parent
ae4ea5deae
commit
8152c798ca
|
|
@ -1786,7 +1786,7 @@ export class OrgChart {
|
|||
xhr.send();
|
||||
}
|
||||
|
||||
exportImg({ full = false, scale = 12, onLoad = (d) => d, save = true } = {}) {
|
||||
exportImg({ full = false, scale = 6, onLoad = (d) => d, save = true } = {}) {
|
||||
const that = this;
|
||||
const attrs = this.getChartState();
|
||||
const { svg: svgImg, root } = attrs;
|
||||
|
|
|
|||
|
|
@ -46,11 +46,11 @@ export default function companyPage() {
|
|||
if (topBarSearchRequest) {
|
||||
let request = { ...topBarSearchRequest, ids: idsStr };
|
||||
api =
|
||||
'/api/bs/hrmorganization/orgchart/asyncCompanyData' +
|
||||
'/api/bs/hrmorganization/jclorgchart/asyncCompanyData' +
|
||||
qs.stringify(request, { addQueryPrefix: true });
|
||||
} else {
|
||||
api =
|
||||
'/api/bs/hrmorganization/orgchart/asyncCompanyData?fclass=0&root=0&date=' +
|
||||
'/api/bs/hrmorganization/jclorgchart/asyncCompanyData?fclass=0&root=0&date=' +
|
||||
moment(new Date()).format('YYYY-MM-DD') +
|
||||
'&ids=' +
|
||||
idsStr;
|
||||
|
|
@ -86,7 +86,7 @@ export default function companyPage() {
|
|||
useEffect(() => {
|
||||
d3.json(
|
||||
// "/company/data"
|
||||
'/api/bs/hrmorganization/orgchart/companyData?fclass=0&isvitual=0&root=0&date=' +
|
||||
'/api/bs/hrmorganization/jclorgchart/companyData?fclass=0&isvitual=0&root=0&date=' +
|
||||
moment(new Date()).format('YYYY-MM-DD'),
|
||||
).then((data) => {
|
||||
setData(data.data);
|
||||
|
|
@ -131,12 +131,12 @@ export default function companyPage() {
|
|||
let companyUrl =
|
||||
'/spa/organization/static/index.html#/main/organization/group';
|
||||
// 分部地址
|
||||
let subcompanyUrl = `/spa/organization/static/index.html#/main/organization/companyExtend/${d.data.fobjid}`;
|
||||
let subcompanyUrl = `/spa/hrm/engine.html#/hrmengine/organization?showTree=false&type=subcompany&id=${d.data.fobjid}`;
|
||||
// 部门地址
|
||||
let departmentUrl = `/spa/organization/static/index.html#/main/organization/departmentExtend/${d.data.fobjid}`;
|
||||
let departmentUrl = `/spa/hrm/engine.html#/hrmengine/organization?showTree=false&isView=1&type=department&id=${d.data.fobjid}`;
|
||||
|
||||
if (d.data.ftype == 0) {
|
||||
return `<div onclick="if(${d.data.fisvitual}==1) return;window.open('${companyUrl}', '_blank')" style="text-align:center">
|
||||
return `<div onclick="if(${d.data.fisvitual}==1) return;" style="text-align:center">
|
||||
<div style="display: inline-block; vertical-align: top;">
|
||||
<img src="./img/company.png" />
|
||||
</div>
|
||||
|
|
@ -271,7 +271,7 @@ export default function companyPage() {
|
|||
|
||||
const handleExport = (type) => {
|
||||
if (type == 'png') {
|
||||
orgChart && orgChart.exportImg({ full: true });
|
||||
orgChart && orgChart.exportImg({ full: true, scale: 12 });
|
||||
} else {
|
||||
orgChart && downloadPdf(orgChart);
|
||||
}
|
||||
|
|
@ -280,7 +280,7 @@ export default function companyPage() {
|
|||
const handleSearch = (requestData) => {
|
||||
topBarSearchRequest = requestData;
|
||||
let api =
|
||||
'/api/bs/hrmorganization/orgchart/companyData' +
|
||||
'/api/bs/hrmorganization/jclorgchart/companyData' +
|
||||
qs.stringify(requestData, { addQueryPrefix: true });
|
||||
fetch(api)
|
||||
.then((res) => res.json())
|
||||
|
|
@ -336,7 +336,7 @@ export default function companyPage() {
|
|||
handleSearch(requestData);
|
||||
}}
|
||||
type="company"
|
||||
url="/api/bs/hrmorganization/orgchart/getCondition?type=company"
|
||||
url="/api/bs/hrmorganization/jclorgchart/getCondition?type=company"
|
||||
/>
|
||||
<ToolBar
|
||||
onTopLayoutClick={(progressBtn) => handleTopLayoutClick(progressBtn)}
|
||||
|
|
|
|||
|
|
@ -50,11 +50,11 @@ export default function userPage() {
|
|||
if (topBarSearchRequest) {
|
||||
let request = { ...topBarSearchRequest, ids: idsStr };
|
||||
api =
|
||||
'/api/bs/hrmorganization/orgchart/asyncUserData' +
|
||||
'/api/bs/hrmorganization/jclorgchart/asyncUserData' +
|
||||
qs.stringify(request, { addQueryPrefix: true });
|
||||
} else {
|
||||
api =
|
||||
'/api/bs/hrmorganization/orgchart/asyncUserData?fclass=0&root=0&date=' +
|
||||
'/api/bs/hrmorganization/jclorgchart/asyncUserData?fclass=0&root=0&date=' +
|
||||
moment(new Date()).format('YYYY-MM-DD') +
|
||||
'&ids=' +
|
||||
idsStr;
|
||||
|
|
@ -87,10 +87,10 @@ export default function userPage() {
|
|||
// 获取数据
|
||||
useEffect(() => {
|
||||
document.cookie =
|
||||
'loginidweaver=1; languageidweaver=7; loginuuids=1; JSESSIONID=aaa1QNMWge48Bh-3oq6oy; ecology_JSessionid=aaa1QNMWge48Bh-3oq6oy; __randcode__=5c4300d1-05d6-4ca6-adb4-f4e23a47acb5';
|
||||
'ecology_JSessionid=aaa88PIn8LCwM_Y7mkOsy; JSESSIONID=aaa88PIn8LCwM_Y7mkOsy; loginidweaver=1; languageidweaver=7; loginuuids=1; __randcode__=e261bb82-0800-442e-889e-0720b8cf16fb';
|
||||
d3.json(
|
||||
// "/user/data"
|
||||
'/api/bs/hrmorganization/orgchart/userData?fclass=0&root=0&date=' +
|
||||
'/api/bs/hrmorganization/jclorgchart/userData?fclass=0&root=0&date=' +
|
||||
moment(new Date()).format('YYYY-MM-DD'),
|
||||
).then((data) => {
|
||||
setData(data.data);
|
||||
|
|
@ -190,7 +190,7 @@ export default function userPage() {
|
|||
|
||||
const handleExport = (type) => {
|
||||
if (type == 'png') {
|
||||
orgChart && orgChart.exportImg({ full: true });
|
||||
orgChart && orgChart.exportImg({ full: true, scale: 12 });
|
||||
} else {
|
||||
orgChart && downloadPdf(orgChart);
|
||||
}
|
||||
|
|
@ -199,7 +199,7 @@ export default function userPage() {
|
|||
const handleSearch = (requestData) => {
|
||||
setTpBarSearchRequest(requestData);
|
||||
let api =
|
||||
'/api/bs/hrmorganization/orgchart/userData' +
|
||||
'/api/bs/hrmorganization/jclorgchart/userData' +
|
||||
qs.stringify(requestData, { addQueryPrefix: true });
|
||||
fetch(api)
|
||||
.then((res) => res.json())
|
||||
|
|
@ -236,15 +236,15 @@ export default function userPage() {
|
|||
let companyUrl =
|
||||
'/spa/organization/static/index.html#/main/organization/group';
|
||||
// 分部地址
|
||||
let subcompanyUrl = `/spa/organization/static/index.html#/main/organization/companyExtend/${d.data.fobjid}`;
|
||||
let subcompanyUrl = `/spa/hrm/engine.html#/hrmengine/organization?showTree=false&type=subcompany&id=${d.data.fobjid}`;
|
||||
// 部门地址
|
||||
let departmentUrl = `/spa/organization/static/index.html#/main/organization/departmentExtend/${d.data.fobjid}`;
|
||||
let departmentUrl = `/spa/hrm/engine.html#/hrmengine/organization?showTree=false&isView=1&type=department&id=${d.data.fobjid}`;
|
||||
// 岗位地址
|
||||
let jobtitleUrl = `/spa/organization/static/index.html#/main/organization/jobExtend/${d.data.fobjid}`;
|
||||
// 人员地址
|
||||
let userUrl = `/spa/organization/static/index.html#/main/organization/resourceCard/${d.data.fleader}`;
|
||||
// 部门负责人人员地址
|
||||
let userUrl = `/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/${d.data.fleader}`;
|
||||
// 岗位人员地址
|
||||
let postUserUrl = `/spa/organization/static/index.html#/main/organization/resourceCard/${d.data.fobjid}`;
|
||||
let postUserUrl = `/spa/hrm/index_mobx.html#/main/hrm/card/cardInfo/${d.data.fobjid}`;
|
||||
//集团通讯录
|
||||
let addressBookGroupUrl = `/spa/organization/static/index.html#/main/organization/resource/?virtualtype=0`;
|
||||
// 分部通讯录
|
||||
|
|
@ -269,7 +269,9 @@ export default function userPage() {
|
|||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: #000000;
|
||||
" onclick="if(${d.data.fisvitual}==1) return;window.open('${
|
||||
" onclick="if(${d.data.fisvitual}==1||${
|
||||
d.data.ftype
|
||||
}==0) return;window.open('${
|
||||
d.data.ftype == 0
|
||||
? companyUrl
|
||||
: d.data.ftype == 1
|
||||
|
|
@ -327,17 +329,9 @@ export default function userPage() {
|
|||
<div style="height: 28px;border: 1px solid #00C2FF; border-radius: 10px; line-height: 24px; padding: 0px 5px; min-width: 60px;">编制: ${
|
||||
d.data.fplan
|
||||
}</div>
|
||||
<div style="height: 28px;border: 1px solid #00C2FF; border-radius: 10px; line-height: 24px; padding: 0px 5px; min-width: 60px; margin-left: 10px;" onclick="if(${
|
||||
d.data.fisvitual
|
||||
}==1) return;event.stopPropagation();window.open('${
|
||||
d.data.ftype == 0
|
||||
? addressBookGroupUrl
|
||||
: d.data.ftype == 1
|
||||
? addressBookUrl
|
||||
: d.data.ftype == 2
|
||||
? addressBookDepartmentUrl
|
||||
: ''
|
||||
}', '_blank')">在岗: ${d.data.fonjob}</div>
|
||||
<div style="height: 28px;border: 1px solid #00C2FF; border-radius: 10px; line-height: 24px; padding: 0px 5px; min-width: 60px; margin-left: 10px;">在岗: ${
|
||||
d.data.fonjob
|
||||
}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -358,9 +352,7 @@ export default function userPage() {
|
|||
font-family: Microsoft YaHei-Bold, Microsoft YaHei;
|
||||
font-weight: bold;
|
||||
color: #000000;
|
||||
" onclick="if(${
|
||||
d.data.fisvitual
|
||||
}==1) return;window.open('${jobtitleUrl}', '_blank')">${
|
||||
" onclick="if(${d.data.fisvitual}==1) return;">${
|
||||
d.data.fname
|
||||
}</span>
|
||||
<span style="margin-left: 70px;">
|
||||
|
|
@ -379,9 +371,7 @@ export default function userPage() {
|
|||
font-weight: bold;
|
||||
color: #333333;
|
||||
margin-bottom: 23px;
|
||||
" onclick="if(${
|
||||
d.data.fisvitual
|
||||
}==1) return;window.open('${jobtitleUrl}', '_blank')">${
|
||||
" onclick="if(${d.data.fisvitual}==1) return;">${
|
||||
d.data.fname
|
||||
}</div>
|
||||
<div style="
|
||||
|
|
@ -392,11 +382,7 @@ export default function userPage() {
|
|||
display: ${d.data.fisvitual == 0 ? 'flex' : 'none'};
|
||||
">
|
||||
<span>编制:${d.data.fplan}</span>
|
||||
<span style="margin-left: 10px;" onclick="if(${
|
||||
d.data.fisvitual
|
||||
}==1) return;window.open('${addressBookPostUrl}', '_blank')">在岗:${
|
||||
d.data.fonjob
|
||||
}</span>
|
||||
<span style="margin-left: 10px;">在岗:${d.data.fonjob}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -497,7 +483,7 @@ export default function userPage() {
|
|||
handleSearch(requestData);
|
||||
}}
|
||||
type="user"
|
||||
url="/api/bs/hrmorganization/orgchart/getCondition?type=user"
|
||||
url="/api/bs/hrmorganization/jclorgchart/getCondition?type=user"
|
||||
/>
|
||||
<ToolBar
|
||||
onTopLayoutClick={handleTopLayoutClick}
|
||||
|
|
|
|||
Loading…
Reference in New Issue