import{_ as M,d as O,e as d,o as D,f as U,h as e,w as a,F as H,x as K,B as W,g as T,i as b,H as X,b as w,t as _e,c as I,M as A,N as B,u as p,R as P,z as j,S as pe,T as me,U as fe}from"./index.038313d9.js";import{p as be,u as q,s as ye,d as ge}from"./bookmark.c2da8665.js";import"./index.faf1141f.js";var ke=function(){var l=document.getSelection();if(!l.rangeCount)return function(){};for(var t=document.activeElement,n=[],i=0;i{t("on-concel")},u=()=>{const f={bk_id:n.dialog_form.bk_id,bk_type_id:n.dialog_form.bk_type_id,comment:n.dialog_form.comment,url:n.dialog_form.url};n.operate_code=="0"?be(f).then(o=>{t("on-submit")}):n.operate_code=="1"?q(f).then(o=>{t("on-submit")}):n.operate_code=="2"&&q(f).then(o=>{t("on-submit")})};return(f,o)=>{const v=d("el-option"),g=d("el-select"),_=d("el-input"),h=d("el-form-item"),C=d("el-form"),R=d("el-button");return D(),U("div",De,[e(C,{model:l.dialog_form},{default:a(()=>[e(h,{label:"\u5206\u7C7B","label-width":i},{default:a(()=>[e(g,{modelValue:l.dialog_form.bk_type_id,"onUpdate:modelValue":o[0]||(o[0]=k=>l.dialog_form.bk_type_id=k),placeholder:""},{default:a(()=>[(D(!0),U(H,null,K(l.types,k=>(D(),W(v,{key:k.bk_type_id,value:k.bk_type_id,label:k.bk_type_name},null,8,["value","label"]))),128))]),_:1},8,["modelValue"]),e(h,{label:"\u5907\u6CE8","label-width":i},{default:a(()=>[e(_,{modelValue:l.dialog_form.comment,"onUpdate:modelValue":o[1]||(o[1]=k=>l.dialog_form.comment=k),autocomplete:"off"},null,8,["modelValue"])]),_:1}),e(h,{label:"url","label-width":i},{default:a(()=>[e(_,{modelValue:l.dialog_form.url,"onUpdate:modelValue":o[2]||(o[2]=k=>l.dialog_form.url=k),autocomplete:"off"},null,8,["modelValue"])]),_:1})]),_:1})]),_:1},8,["model"]),T("span",Ee,[e(R,{onClick:m},{default:a(()=>[Ve]),_:1}),e(R,{type:"primary",onClick:u},{default:a(()=>[Se]),_:1})])])}}});var Ue=M(Te,[["__scopeId","data-v-84f682ae"]]);const $e=l=>X({url:"/bookmark/api/v1/bookmark_type/insert",method:"PUT",data:l}),Ae=()=>X({url:"/bookmark/api/v1/bookmark_type",method:"GET",data:{}});const Be={class:"dashboard"},Re={class:"dialog-footer"},Fe=b("\u63D0\u4EA4"),Ne=O({emits:["on-update"],setup(l,{emit:t}){const n=w(""),i=()=>{const m={bookmark_type_name:n.value};$e(m).then(u=>{t("on-update"),n.value=""})};return(m,u)=>{const f=d("el-input"),o=d("el-button");return D(),U("div",Be,[e(f,{modelValue:n.value,"onUpdate:modelValue":u[0]||(u[0]=v=>n.value=v),placeholder:"Please input"},null,8,["modelValue"]),T("span",Re,[e(o,{type:"primary",onClick:i},{default:a(()=>[Fe]),_:1})])])}}});var Ie=M(Ne,[["__scopeId","data-v-25eee70b"]]);const Oe={class:"dialog-footer"},ze=b("\u53D6\u6D88"),Pe=b("\u786E\u8BA4"),Me=O({props:{delete_id:null},emits:["on-concel","on-submit"],setup(l,{emit:t}){const n=l,i=()=>{t("on-concel")},m=()=>{t("on-submit",n.delete_id)};return(u,f)=>{const o=d("el-button");return D(),U("span",Oe,[e(o,{onClick:i},{default:a(()=>[ze]),_:1}),e(o,{type:"primary",onClick:m},{default:a(()=>[Pe]),_:1})])}}});const Le={class:"bookmark"},je=b("\u68C0\u7D22"),qe={class:"tag_list"},Ge=b("\u589E\u52A0"),He=b("\u81EA\u5B9A\u4E49"),Ke={class:"create_dialog"},We=b("\u65B0\u5EFA"),Xe=["onClick"],Je=b("\u7F16\u8F91 "),Qe=b(" \u5220\u9664 "),Ye={style:{"margin-top":"20px"}},Ze=b("\u53CD\u9009"),et=b("\u6E05\u9664"),tt=O({setup(l){const t=_e();let n=w("");const i=I({bk_type_ids:[],comment:""}),m=I([]),u=I({bk_id:"-1",bk_type_id:1,bk_type_name:"\u672A\u5206\u7C7B",comment:"",url:""}),f=w(),o=w([]),v=r=>{r?r.forEach(s=>{f.value.toggleRowSelection(s,void 0)}):f.value.clearSelection()};let g=w(!1),_=w(!1),h=w(!1),C=w(!1);const R=()=>{h.value=!0},k=()=>{C.value=!0},J=()=>{C.value=!1,V(),L()},$=I([]),L=()=>{Ae().then(r=>{$.splice(0,$.length),r.data.forEach(s=>{const y=s.split("|"),S={bk_type_id:Number(y[0]),bk_type_name:y[1],clicked:!1};$.push(S)})})},Q=()=>{n.value="0",u.bk_id="-1",u.bk_type_id=1,u.bk_type_name="\u672A\u5206\u7C7B",u.comment="",u.url="",g.value=!0},Y=(r,s)=>{Object.assign(u,s),n.value="2",_.value=!0},Z=(r,s)=>{Object.assign(u,s),n.value="1",g.value=!0},ee=r=>{r.clicked?(r.clicked=!1,i.bk_type_ids.forEach(function(s,y,S){s==r.bk_type_id&&S.splice(y,1)})):(r.clicked=!0,i.bk_type_ids.push(r.bk_type_id),V())},te=r=>{o.value=r},oe=r=>{window.open(r)},V=()=>{const r={comment:i.comment,type_id:i.bk_type_ids};m.splice(0,m.length),ye(r).then(s=>{s.data.forEach((y,S)=>{const F={bk_id:y.bk_id,bk_type_id:y.bk_type_id,bk_type_name:y.bk_type_name,comment:y.comment,url:y.url};m.push(F)})})},le=r=>{ge(r).then(y=>{_.value=!1,V()})},ae=()=>{g.value=!1},ne=()=>{g.value=!1,V()},se=r=>{we(r.url+""),me({title:"",message:fe("i",{style:"color: teal"},"\u590D\u5236\u6210\u529F")})};return V(),L(),(r,s)=>{const y=d("el-input"),S=d("el-form-item"),F=d("el-col"),x=d("el-button"),ce=d("el-row"),re=d("el-tag"),ie=d("el-form"),E=d("el-table-column"),ue=d("el-icon"),de=d("el-table"),z=d("el-dialog");return D(),U("div",Le,[e(ie,null,{default:a(()=>[e(ce,null,{default:a(()=>[e(F,{span:6},{default:a(()=>[e(S,null,{default:a(()=>[e(y,{modelValue:p(i).comment,"onUpdate:modelValue":s[0]||(s[0]=c=>p(i).comment=c),placeholder:"\u8BF7\u8F93\u5165",clearable:""},null,8,["modelValue"])]),_:1})]),_:1}),e(F,{span:6},{default:a(()=>[e(x,{type:"primary",onClick:V},{default:a(()=>[je]),_:1})]),_:1})]),_:1}),T("div",qe,[(D(!0),U(H,null,K(p($),c=>(D(),W(re,{class:"ml-2 click-icon",type:c.clicked?"danger":"info",onClick:N=>ee(c)},{default:a(()=>[b(j(c.bk_type_name),1)]),_:2},1032,["type","onClick"]))),256)),A(e(x,{type:"primary",onClick:k},{default:a(()=>[Ge]),_:1},512),[[B,p(t).tenant.account]]),A(e(x,{type:"primary",onClick:R},{default:a(()=>[He]),_:1},512),[[B,p(t).tenant.account]])])]),_:1}),T("div",Ke,[A(e(x,{type:"primary",onClick:Q},{default:a(()=>[We]),_:1},512),[[B,p(t).tenant.account]])]),e(de,{ref_key:"multipleTableRef",ref:f,data:p(m),onSelectionChange:te,style:{width:"100%"}},{default:a(()=>[e(E,{type:"selection",width:"55"}),e(E,{type:"index",label:"index",width:"80"}),e(E,{prop:"bk_type_name",label:"\u5206\u7C7B",width:"100"}),e(E,{prop:"comment",label:"\u540D\u79F0",width:"180"}),e(E,{prop:"facvion",label:"\u56FE\u6807",width:"60"}),e(E,{class:"click-icon",prop:"url",label:"url"},{default:a(c=>[T("span",{style:{cursor:"pointer"},onClick:N=>oe(c.row.url)},j(c.row.url),9,Xe)]),_:1}),e(E,{label:"\u64CD\u4F5C"},{default:a(c=>[e(ue,{size:20,onClick:N=>se(c.row),class:"click-icon"},{default:a(()=>[e(p(pe))]),_:2},1032,["onClick"]),A(e(x,{class:"click-icon",size:"small",onClick:N=>Z(c.$index,c.row)},{default:a(()=>[Je]),_:2},1032,["onClick"]),[[B,p(t).tenant.account]]),A(e(x,{size:"small",type:"danger",onClick:N=>Y(c.$index,c.row)},{default:a(()=>[Qe]),_:2},1032,["onClick"]),[[B,p(t).tenant.account]])]),_:1})]),_:1},8,["data"]),T("div",Ye,[e(x,{onClick:s[1]||(s[1]=c=>v([p(m)[1],p(m)[2]]))},{default:a(()=>[Ze]),_:1}),e(x,{onClick:s[2]||(s[2]=c=>v())},{default:a(()=>[et]),_:1})]),e(z,{modelValue:p(g),"onUpdate:modelValue":s[3]||(s[3]=c=>P(g)?g.value=c:g=c),title:"\u6DFB\u52A0\u4E66\u7B7E"},{default:a(()=>[e(Ue,{dialog_form:p(u),operate_code:p(n),types:p($),onOnConcel:ae,onOnSubmit:ne},null,8,["dialog_form","operate_code","types"])]),_:1},8,["modelValue"]),e(z,{modelValue:p(_),"onUpdate:modelValue":s[4]||(s[4]=c=>P(_)?_.value=c:_=c)},{default:a(()=>[e(Me,{delete_id:p(u).bk_id,onOnSubmit:le},null,8,["delete_id"])]),_:1},8,["modelValue"]),e(z,{modelValue:p(C),"onUpdate:modelValue":s[5]||(s[5]=c=>P(C)?C.value=c:C=c)},{default:a(()=>[e(Ie,{onOnUpdate:J})]),_:1},8,["modelValue"])])}}});var nt=M(tt,[["__scopeId","data-v-85509c2e"]]);export{nt as default};