import{r as z}from"./framework.e8f655c8.js";import{u as C,G as q,k as N}from"./index.8c202964.js";import{g as i}from"./chart.860d5b23.js";import{u as P,a as U,b as D}from"./knowledgeDetail.14be4b1a.js";function K(){const n=C();function p({identifier:e,sourceId:t}){u({type:"person",identifier:e,sourceId:t})}function u(e){const{identifier:t,sourceId:r}=e;!t||!r||n.push({path:"/home/knowledgeDetail",query:e})}function c(e){const{sourceId:t}=e;if(!t)return;const r={sourceId:t};n.push({path:"/home/literature-detail",query:r})}const l=z(!1);function h({sourceId:e,identifier:t,volume:r}){l.value=!0,i({sourceId:e,identifier:t}).then(a=>{if(a.code===0){let o=n.resolve({path:"/read_book",query:{sourceId:e,identifier:t,volume:r,pageNum:a.data.page_number}});window.open(o.href,"_blank")}}).finally(()=>{l.value=!1})}function m({sourceId:e,tableName:t,personalName:r,chiOrganizationName:a,chiEventName:o,geographicalName:s,productName:w}){if(!e)return;const b={zsk_personal_temp:r,zsk_org_temp:a,zsk_event_temp:o,zsk_geographical_temp:s,zsk_product_temp:w}[t],v=n.resolve({path:"/read_book",query:{sourceId:e,searchNavValue:b}});window.open(v.href,"_blank")}function f({sourceId:e,identifier:t}){i({sourceId:e,identifier:t}).then(r=>{if(r.code===0){let a=n.resolve({path:"/read_book",query:{sourceId:e,identifier:t,pageNum:r.data.page_number}});window.open(a.href,"_blank")}})}function d(e,t,r,a,o,s){(o||s==="detail")&&n.push({path:"/home/visual-search-result",query:{sourceId:t,refSourceId:e,tableName:r,searchVal:a}})}function y(e){let r={type:"search",list:q([{relation:"must",field:"-",keyword:e,match:"fuzzy"}]),checkType:"2,3,4,5,6",t:new Date().getTime()};N.dispatch("cacheRouter/deleteCacheComponent","DashboardSearchResult").then(()=>{n.push({path:"/home/searchResult",query:r})})}function _({usercId:e,sourceId:t}){return new Promise(r=>{P({basicType:"\u56FE\u4E66",readHistoryType:"\u6536\u85CF",usercId:e,sourceId:t}).then(o=>{r(o)})})}function g({usercId:e,sourceId:t,title:r}){return new Promise(a=>{U({usercId:e,sourceId:t,title:r}).then(s=>{a(s)})})}function k({usercId:e,sourceId:t}){return new Promise(r=>{D({usercId:e,sourceId:t}).then(o=>{r(o)})})}return{goKnowledgeDetail:u,knowledgePersonUrl:p,provUrl:m,chart_provUrl:f,imgUrl:d,keywordUrl:y,isCollect:_,collectOn:g,collectOff:k,goLiteratureDetail:c,chart_proUrl:h,chartGoLoading:l}}export{K as u};
