import{p as i,g as p}from"./helper-ByM4DLer.js";import{V as g,r as f,a4 as w,cZ as y,aj as k}from"./index-9PRMimni.js";import{i as d}from"./isEmpty-BUg1OsQj.js";import{c as C}from"./_createRound-MlkJBLNh.js";var b=C("floor");const{t:c}=g(),S=y(),v=p(),m=a=>v[a],A=()=>Object.fromEntries(new Array(48).fill(0).map((a,n)=>[m(n),i(String(b(n/2)),2,"0")])),D=a=>Object.fromEntries(new Array(48).fill(0).map((n,e)=>[m(e),a])),O=a=>{const n=f(a.selectedColor),e=f(D());return{tableOptions:w(()=>({showHeader:!1,records:[A(),e.value],columnResizeMode:"none",columns:[...new Array(48).fill(0).map((t,r)=>({field:m(r),title:i(String(r),2,"0"),width:"30",headerStyle:{textAlign:"center"},style:{bgColor:s=>{const{row:l,value:u}=s;return l===0?"#d8f5e7":d(u)?"#fff":u.taskColor},textAlign:"center"},customRender(){return{elements:[],renderDefault:!1}}}))],customMergeCell:(t,r,s)=>{let l={};return new Array(24).fill(0).some((u,o)=>r===0&&(t===o*2||t===o*2+1)?(l={text:i(String(o),2,"0"),range:{start:{col:o*2,row:0},end:{col:o*2+1,row:0}}},!0):!1),l},select:{disableSelect(t,r,s){return r===0?!0:d(n.value)?(S.warning("请选择一种颜色"),!0):!1},outsideClickDeselect:!0},theme:{selectionStyle:{cellBorderColor:"#ffcc00"}}})),updateSelectedColor:t=>{n.value=t},updateRowData:t=>{const r=k(e.value);return e.value={...r,...t},e.value}}},T=()=>({columns:[{title:c("common.messagedefine.Num"),key:"num",width:50,render:(n,e)=>e+1},{title:c("operation.rankTaskPlan.year"),key:"planYear"},{title:c("operation.rankTaskPlan.month"),key:"planMonth"}]});export{T as a,m as f,O as g};
