import{_ as y,o as i,c as _,a as s,n as p,t as o,d as l,w as a,b as m,F as k,i as F,j as L,z as x,C as r,r as c}from"./index-BKsb6cIX.js";const B={class:"pb-left"},H={class:"pb-info"},K={class:"pb-name"},O={class:"pb-date"},P={key:0,class:"pb-right"},U={class:"pb-switch-btn"},X={class:"pbd-name"},z={__name:"PeriodBanner",props:{periods:{type:Array,required:!0},modelValue:{type:Number,default:null}},emits:["update:modelValue"],setup(E,{emit:I}){const u=E,S=I,f=r(()=>(u.periods||[]).filter(e=>e.status!=="ARCHIVED")),t=r(()=>(u.periods||[]).find(d=>d.id===u.modelValue)||f.value[0]||{}),v=r(()=>f.value),N=r(()=>({DRAFT:"",OKR_ALIGN:"is-active",EXECUTING:"is-success",ASSESSING:"is-warning",ARCHIVED:""})[t.value.status]||""),w=r(()=>({DRAFT:"待发布",OKR_ALIGN:"对齐中",EXECUTING:"执行中",ASSESSING:"考评中",ARCHIVED:"已归档"})[t.value.status]||""),C=r(()=>({ASSESSING:"warning",EXECUTING:"success",OKR_ALIGN:"",DRAFT:"info",ARCHIVED:"info"})[t.value.status]||"info");function D(e){return{DRAFT:"待发布",OKR_ALIGN:"对齐中",EXECUTING:"执行中",ASSESSING:"考评中",ARCHIVED:"已归档"}[e]||e}function R(e){return{ASSESSING:"warning",EXECUTING:"success",OKR_ALIGN:"",DRAFT:"info",ARCHIVED:"info"}[e]||"info"}function G(e){S("update:modelValue",e)}return(e,d)=>{const A=c("el-tag"),T=c("ArrowDown"),V=c("el-icon"),g=c("el-dropdown-item"),h=c("el-dropdown-menu"),b=c("el-dropdown");return i(),_("div",{class:p(["period-status-strip","is-"+t.value.status])},[s("div",B,[s("span",{class:p(["status-dot",N.value])},null,2),s("div",H,[s("div",K,o(t.value.name),1),s("div",O,o(t.value.startDate)+" ~ "+o(t.value.endDate),1)]),l(A,{type:C.value,effect:"dark",size:"small",round:""},{default:a(()=>[m(o(w.value),1)]),_:1},8,["type"])]),v.value.length>1?(i(),_("div",P,[l(b,{trigger:"click",onCommand:G},{dropdown:a(()=>[l(h,null,{default:a(()=>[(i(!0),_(k,null,F(v.value,n=>(i(),L(g,{key:n.id,command:n.id,class:p({"is-active":n.id===t.value.id})},{default:a(()=>[s("span",X,o(n.name),1),l(A,{type:R(n.status),size:"small",effect:"plain",round:""},{default:a(()=>[m(o(D(n.status)),1)]),_:2},1032,["type"])]),_:2},1032,["command","class"]))),128))]),_:1})]),default:a(()=>[s("span",U,[d[0]||(d[0]=m(" 切换周期 ",-1)),l(V,null,{default:a(()=>[l(T)]),_:1})])]),_:1})])):x("",!0)],2)}}},q=y(z,[["__scopeId","data-v-a36045d4"]]);export{q as P};
