11 lines
21 KiB
JavaScript
11 lines
21 KiB
JavaScript
import{j as e,s as p}from"./index-3808da28.js";import{r as x,F as w,B as c,P as z,ag as A,T as O,m as d,I as F,y as q,J as H,K as J,Q as K,V as L,E as U,X as Q,af as B,z as W,d as X,C as R,ah as G,ai as Y,H as M,a5 as Z,a8 as ee}from"./vendor-61f0f29a.js";const te=()=>{const[D,b]=x.useState([]),[I,f]=x.useState(!1),[k,S]=x.useState(!1),[j,h]=x.useState(""),[y]=w.useForm(),v=async()=>{f(!0);try{const{data:i,error:l}=await p.from("resources").select("*").eq("type","units").order("created_at",{ascending:!1});if(l)throw l;b(i||[])}catch(i){d.error("获取单位数据失败"),console.error(i)}finally{f(!1)}};x.useEffect(()=>{k&&v()},[k]);const C=()=>{const i={id:Date.now().toString(),attributes:{name:""},isNew:!0};b([i,...D]),h(i.id),y.setFieldsValue(i.attributes)},T=async i=>{try{const l=await y.validateFields();if(i.isNew){const{error:s}=await p.from("resources").insert([{type:"units",attributes:{name:l.name},schema_version:1}]);if(s)throw s}else{const{error:s}=await p.from("resources").update({attributes:{name:l.name},updated_at:new Date().toISOString()}).eq("id",i.id);if(s)throw s}d.success("保存成功"),h(""),v()}catch(l){d.error("保存失败"),console.error(l)}},$=async i=>{try{const{error:l}=await p.from("resources").delete().eq("id",i);if(l)throw l;d.success("删除成功"),v()}catch(l){d.error("删除失败"),console.error(l)}},_=i=>{h(""),i.isNew&&b(D.filter(l=>l.id!==i.id)),y.resetFields()},m=[{title:"单位名称",dataIndex:["attributes","name"],width:"60%",render:(i,l)=>l.id===j?e.jsx(w.Item,{name:"name",rules:[{required:!0,message:"请输入单位名称!"}],style:{margin:0},initialValue:i,children:e.jsx(F,{placeholder:"请输入单位名称"})}):i},{title:"操作",width:"40%",render:(i,l)=>l.id===j?e.jsxs(q,{children:[e.jsx(c,{type:"link",icon:e.jsx(H,{}),onClick:()=>T(l),className:"text-green-600 hover:text-green-500",children:"保存"}),e.jsx(c,{type:"link",icon:e.jsx(J,{}),onClick:()=>_(l),className:"text-gray-600 hover:text-gray-500",children:"取消"})]}):e.jsxs(q,{children:[e.jsx(c,{type:"link",disabled:j!=="",onClick:()=>{h(l.id),y.setFieldsValue(l.attributes)},className:"text-blue-600 hover:text-blue-500 disabled:text-gray-400",children:"编辑"}),e.jsx(K,{title:"确定要删除吗?",onConfirm:()=>$(l.id),okButtonProps:{className:"bg-red-500 hover:bg-red-600 border-red-500"},children:e.jsx(c,{type:"link",danger:!0,disabled:j!=="",icon:e.jsx(L,{}),className:"text-red-600 hover:text-red-500 disabled:text-gray-400"})})]})}];return e.jsxs("div",{children:[e.jsx(c,{type:"primary",icon:e.jsx(z,{}),onClick:()=>S(!0),className:"flex items-center",children:"单位管理"}),e.jsx(A,{title:e.jsx("span",{className:"text-lg font-medium text-gray-800 dark:text-gray-200",children:"单位管理"}),placement:"right",width:600,onClose:()=>{S(!1),h(""),y.resetFields()},open:k,className:"dark:bg-gray-800",children:e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(c,{type:"primary",icon:e.jsx(z,{}),onClick:C,disabled:j!=="",className:"mb-4 w-32 flex items-center justify-center",children:"新增单位"}),e.jsx(w,{form:y,className:"flex-1",children:e.jsx(O,{dataSource:D,columns:m,rowKey:"id",loading:I,pagination:{pageSize:10,className:"dark:text-gray-300"},className:"bg-white dark:bg-gray-800 rounded-lg shadow-sm",rowClassName:i=>`transition-colors ${i.id===j?"bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-gray-700/50"}`})})]})})]})},se=()=>{const[D,b]=x.useState([]),[I,f]=x.useState(!1),[k,S]=x.useState(!1),[j,h]=x.useState(!1),[y,v]=x.useState(null),[C]=w.useForm(),[T,$]=x.useState([]),_=async()=>{f(!0);try{const{data:a,error:r}=await p.from("resources").select("*").eq("type","sections");if(r)throw r;b(a||[])}catch(a){d.error("获取子模块数据失败"),console.error(a)}finally{f(!1)}},m=async()=>{try{const{data:a,error:r}=await p.from("resources").select("*").eq("type","units").order("created_at",{ascending:!1});if(r)throw r;$(a||[])}catch(a){d.error("获取单位数据失败"),console.error(a)}};x.useEffect(()=>{k&&_(),m()},[k]);const i=async(a=null)=>{if(h(!0),v(a),a)try{const{data:r,error:n}=await p.from("resources").select("*").eq("id",a.id).single();if(n)throw n;C.setFieldsValue({name:r.attributes.name,items:r.attributes.items})}catch(r){d.error("获取子模块详情失败"),console.error(r)}else C.setFieldsValue({name:"",items:[{name:"",description:"",price:0,quantity:1,unit:""}]})},l=async a=>{try{if(y){const{error:r}=await p.from("resources").update({attributes:{name:a.name,items:a.items},updated_at:new Date().toISOString()}).eq("id",y.id);if(r)throw r}else{const{error:r}=await p.from("resources").insert([{type:"sections",attributes:{name:a.name,items:a.items},schema_version:1}]);if(r)throw r}d.success("保存成功"),h(!1),C.resetFields(),_()}catch(r){d.error("保存失败"),console.error(r)}},s=async a=>{try{const{error:r}=await p.from("resources").delete().eq("id",a);if(r)throw r;d.success("删除成功"),_()}catch(r){d.error("删除失败"),console.error(r)}},t=[{title:"项目名称",dataIndex:"name",width:"20%"},{title:"描述",dataIndex:"description",width:"25%"},{title:"单价",dataIndex:"price",width:"15%",render:a=>`¥${a}`},{title:"数量",dataIndex:"quantity",width:"15%"},{title:"单位",dataIndex:"unit",width:"15%"}],g=[{title:"项目名称",dataIndex:"name",width:"20%",render:(a,r,n)=>e.jsx(w.Item,{name:[n,"name"],style:{margin:0},children:e.jsx(F,{placeholder:"项目名称"})})},{title:"描述",dataIndex:"description",width:"25%",render:(a,r,n)=>e.jsx(w.Item,{name:[n,"description"],style:{margin:0},children:e.jsx(F,{placeholder:"描述"})})},{title:"单价",dataIndex:"price",width:"15%",render:(a,r,n)=>e.jsx(w.Item,{name:[n,"price"],rules:[{required:!0,message:"请输入单价!"}],style:{margin:0},children:e.jsx(B,{min:0,placeholder:"单价",className:"w-full"})})},{title:"数量",dataIndex:"quantity",width:"15%",render:(a,r,n)=>e.jsx(w.Item,{name:[n,"quantity"],rules:[{required:!0,message:"请输入数量!"}],style:{margin:0},children:e.jsx(B,{min:1,placeholder:"数量",className:"w-full"})})},{title:"单位",dataIndex:"unit",width:"15%",render:(a,r,n)=>e.jsx(w.Item,{name:[n,"unit"],rules:[{required:!0,message:"请选择或输入单位!"}],style:{margin:0},children:e.jsx(W,{placeholder:"请选择或输入单位",className:"w-full",showSearch:!0,allowClear:!0,options:T.map(u=>({label:u.attributes.name,value:u.attributes.name})),filterOption:(u,o)=>((o==null?void 0:o.label)??"").toLowerCase().includes(u.toLowerCase())})})},{title:"操作",width:"10%",render:(a,r,n,{remove:u})=>e.jsx(c,{type:"link",danger:!0,icon:e.jsx(L,{}),onClick:()=>u(n)})}];return e.jsxs("div",{children:[e.jsx(c,{type:"primary",icon:e.jsx(z,{}),onClick:()=>S(!0),className:"flex items-center",children:"子模块管理"}),e.jsx(A,{title:e.jsx("span",{className:"text-lg font-medium text-gray-800 dark:text-gray-200",children:"子模块管理"}),placement:"right",width:1e3,onClose:()=>S(!1),open:k,className:"dark:bg-gray-800",children:e.jsxs("div",{className:"flex flex-col h-full",children:[e.jsx(c,{type:"primary",icon:e.jsx(z,{}),onClick:()=>i(),className:"mb-4 w-32 flex items-center justify-center",children:"新增子模块"}),e.jsx("div",{className:"space-y-6",children:D.map(a=>e.jsxs("div",{className:"bg-white rounded-lg shadow-sm dark:bg-gray-800 border border-gray-200 dark:border-gray-700",children:[e.jsxs("div",{className:"p-4 border-b border-gray-200 dark:border-gray-700 flex justify-between items-center",children:[e.jsx("h3",{className:"text-lg font-medium text-gray-800 dark:text-gray-200",children:a.attributes.name}),e.jsxs(q,{children:[e.jsx(c,{type:"link",icon:e.jsx(U,{}),onClick:()=>i(a),className:"text-blue-600 hover:text-blue-500",children:"编辑"}),e.jsx(K,{title:"确定要删除吗?",onConfirm:()=>s(a.id),okButtonProps:{className:"bg-red-500 hover:bg-red-600 border-red-500"},children:e.jsx(c,{type:"link",danger:!0,icon:e.jsx(L,{}),className:"text-red-600 hover:text-red-500"})})]})]}),e.jsx("div",{className:"p-4",children:e.jsx(O,{dataSource:a.attributes.items,columns:t,pagination:!1,rowKey:(r,n)=>`${a.id}-${n}`,className:"border dark:border-gray-700 rounded-lg",rowClassName:"hover:bg-gray-50 dark:hover:bg-gray-700/50",size:"small"})})]},a.id))})]})}),e.jsx(Q,{title:`${y?"编辑":"新增"}子模块`,open:j,onCancel:()=>{h(!1),v(null),C.resetFields()},footer:null,width:1200,destroyOnClose:!0,children:e.jsxs(w,{form:C,onFinish:l,layout:"vertical",className:"mt-4",children:[e.jsx(w.Item,{name:"name",label:"子模块名称",rules:[{required:!0,message:"请输入子模块名称!"}],children:e.jsx(F,{placeholder:"请输入子模块名称"})}),e.jsx(w.List,{name:"items",children:(a,{add:r,remove:n})=>e.jsxs("div",{className:"bg-white rounded-lg border dark:bg-gray-800 dark:border-gray-700",children:[e.jsx(O,{dataSource:a,columns:g.map(u=>({...u,render:(...o)=>u.render(...o,{remove:n})})),pagination:!1,rowKey:"key",className:"mb-4"}),e.jsx("div",{className:"p-4 border-t dark:border-gray-700",children:e.jsx(c,{type:"dashed",onClick:()=>r({name:"",description:"",price:0,quantity:1,unit:""}),icon:e.jsx(z,{}),className:`w-full hover:border-blue-400 hover:text-blue-500
|
|
dark:border-gray-600 dark:text-gray-400 dark:hover:text-blue-400`,children:"添加项目"})})]})}),e.jsxs("div",{className:"flex justify-end gap-4 mt-6",children:[e.jsx(c,{onClick:()=>{h(!1),v(null),C.resetFields()},children:"取消"}),e.jsx(c,{type:"primary",htmlType:"submit",children:"保存"})]})]})})]})},re=()=>{const[D,b]=x.useState([]),[I,f]=x.useState(!1),[k,S]=x.useState(""),[j,h]=x.useState(!1),[y]=w.useForm(),v=async()=>{f(!0);try{const{data:m,error:i}=await p.from("resources").select("*").eq("type","categories").order("created_at",{ascending:!1});if(i)throw i;b(m||[])}catch(m){d.error("获取分类数据失败"),console.error(m)}finally{f(!1)}};x.useEffect(()=>{j&&v()},[j]);const C=()=>{const m={id:Date.now().toString(),attributes:{name:""},isNew:!0};b([m,...D]),S(m.id),y.setFieldsValue(m.attributes)},T=async m=>{try{const i=await y.validateFields();if(m.isNew){const{error:l}=await p.from("resources").insert([{type:"categories",attributes:{name:i.name},schema_version:1}]);if(l)throw l}else{const{error:l}=await p.from("resources").update({attributes:{name:i.name},updated_at:new Date().toISOString()}).eq("id",m.id);if(l)throw l}d.success("保存成功"),S(""),v()}catch(i){d.error("保存失败"),console.error(i)}},$=async m=>{try{const{error:i}=await p.from("resources").delete().eq("id",m.id);if(i)throw i;d.success("删除成功"),v()}catch(i){d.error("删除失败"),console.error(i)}},_=[{title:"分类名称",dataIndex:["attributes","name"],width:"60%",render:(m,i)=>i.id===k?e.jsx(w.Item,{name:"name",style:{margin:0},rules:[{required:!0,message:"请输入分类名称!"}],children:e.jsx(F,{placeholder:"请输入分类名称"})}):e.jsx("span",{className:"text-gray-600",children:m})},{title:"操作",width:"40%",render:(m,i)=>i.id===k?e.jsxs(q,{children:[e.jsx(c,{type:"link",className:"text-green-600 hover:text-green-500",onClick:()=>T(i),children:"保存"}),e.jsx(c,{type:"link",className:"text-gray-600 hover:text-gray-500",onClick:()=>{S(""),i.isNew&&b(D.filter(s=>s.id!==i.id))},children:"取消"})]}):e.jsxs(q,{children:[e.jsx(c,{type:"link",className:"text-blue-600 hover:text-blue-500",disabled:k!=="",onClick:()=>{S(i.id),y.setFieldsValue({name:i.attributes.name})},children:"编辑"}),e.jsx(K,{title:"确认删除",description:"确定要删除这个分类吗?",onConfirm:()=>$(i),okText:"确定",cancelText:"取消",okButtonProps:{className:"bg-red-500 hover:bg-red-600 border-red-500"},children:e.jsx(c,{type:"link",className:"text-red-600 hover:text-red-500",disabled:k!=="",children:"删除"})})]})}];return e.jsxs(e.Fragment,{children:[e.jsx(c,{type:"primary",onClick:()=>h(!0),icon:e.jsx(z,{}),children:"分类管理"}),e.jsx(A,{title:"分类管理",placement:"right",width:800,onClose:()=>h(!1),open:j,className:"category-drawer",children:e.jsxs("div",{className:"p-6",children:[e.jsx(c,{type:"primary",onClick:C,className:"mb-4",icon:e.jsx(z,{}),children:"新增分类"}),e.jsx(w,{form:y,children:e.jsx(O,{columns:_,dataSource:D,rowKey:"id",loading:I,pagination:{pageSize:10,showTotal:m=>`共 ${m} 条`},className:"bg-white rounded-lg shadow"})})]})})]})},{Paragraph:P}=ee,ne=()=>{const[D,b]=x.useState(!1),[I,f]=x.useState([]),[k,S]=x.useState([]),j=X(),[h,y]=x.useState(""),v=async()=>{try{b(!0);const{data:s,error:t}=await p.from("resources").select("*").eq("type","serviceTemplate").order("created_at",{ascending:!1});if(t)throw t;f(s)}catch(s){console.error("获取服务模板失败:",s),d.error("获取服务模板失败")}finally{b(!1)}},C=async()=>{try{const{data:s,error:t}=await p.from("resources").select("*").eq("type","categories").order("created_at",{ascending:!1});if(t)throw t;S(s||[])}catch(s){console.error("获取分类数据失败:",s),d.error("获取分类数据失败")}},T=async s=>{try{b(!0);const{serviceId:t,sectionIndex:g,itemIndex:a}=s,r=I.find(o=>o.id===t);if(!r)throw new Error("Service not found");const n={...r.attributes,templateName:r.attributes.templateName,description:r.attributes.description,category:r.attributes.category||[],sections:r.attributes.sections.map((o,N)=>N===g?{...o,items:o.items.map((V,E)=>E===a?{name:s.name,price:Number(s.price)||0,quantity:Number(s.quantity)||0,description:s.description||"",unit:s.unit||""}:V)}:o)};n.totalAmount=n.sections.reduce((o,N)=>o+N.items.reduce((V,E)=>V+(Number(E.price)||0)*(Number(E.quantity)||0),0),0);const{error:u}=await p.from("resources").update({type:"serviceTemplate",attributes:n}).eq("id",t);if(u)throw u;f(o=>o.map(N=>N.id===t?{...N,attributes:n}:N)),y(""),d.success("保存成功")}catch(t){console.error("保存失败:",t),d.error("保存失败")}finally{b(!1)}},$=async s=>{try{b(!0);const{serviceId:t,sectionIndex:g,itemIndex:a}=s,r=I.find(o=>o.id===t);if(!r)throw new Error("Service not found");const n={...r.attributes,sections:r.attributes.sections.map((o,N)=>N===g?{...o,items:o.items.filter((V,E)=>E!==a)}:o)};n.totalAmount=n.sections.reduce((o,N)=>o+N.items.reduce((V,E)=>V+(Number(E.price)||0)*(Number(E.quantity)||0),0),0);const{error:u}=await p.from("resources").update({attributes:n}).eq("id",t);if(u)throw u;f(o=>o.map(N=>N.id===t?{...N,attributes:n}:N)),d.success("删除成功")}catch(t){console.error("删除失败:",t),d.error("删除失败")}finally{b(!1)}},_=async s=>{try{b(!0);const{error:t}=await p.from("resources").delete().eq("id",s);if(t)throw t;f(g=>g.filter(a=>a.id!==s)),d.success("删除成功")}catch(t){console.error("删除失败:",t),d.error("删除失败")}finally{b(!1)}},m=[{title:"模板名称",dataIndex:["attributes","templateName"],key:"templateName",className:"min-w-[200px]"},{title:"分类",dataIndex:["attributes","category"],key:"category",render:s=>!s||!Array.isArray(s)?null:e.jsx(P,{ellipsis:{rows:1,tooltip:e.jsx(q,{size:[0,8],wrap:!0,children:s.map(t=>e.jsx(M,{size:"small",color:"blue",className:"px-2 py-1 rounded-md",children:t.name},t.id))})},className:"mb-0",children:e.jsx(q,{size:[0,8],nowrap:!0,children:s.map(t=>e.jsx(M,{size:"small",color:"blue",className:"px-2 py-1 rounded-md",children:t.name},t.id))})})},{title:"描述",dataIndex:["attributes","description"],key:"description",className:"min-w-[100px] ",render:s=>e.jsx(P,{ellipsis:{rows:2,tooltip:s},className:"mb-0",children:s})},{title:"总金额",dataIndex:["attributes","totalAmount"],key:"totalAmount",className:"min-w-[150px] text-right",render:s=>e.jsxs("span",{style:{color:"#f50",fontWeight:"bold"},children:["¥",(s==null?void 0:s.toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2}))||"0.00"]})},{title:"操作",key:"action",fixed:"right",width:220,render:(s,t)=>e.jsxs(q,{onClick:g=>g.stopPropagation(),children:[e.jsx(c,{type:"link",icon:e.jsx(Z,{}),onClick:()=>j(`/company/serviceTemplateInfo/${t.id}`),children:"查看"}),e.jsx(c,{type:"link",icon:e.jsx(U,{}),onClick:()=>j(`/company/serviceTemplateInfo/${t.id}?edit=true`),children:"编辑"}),e.jsx(K,{title:"删除确认",description:"确定要删除这个服务模板吗?此操作不可恢复。",okText:"确定",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>_(t.id),children:e.jsx(c,{type:"link",danger:!0,className:"text-red-600",children:"删除"})})]})}],i=[{title:"项目名称",dataIndex:"name",key:"name",width:"25%",render:(s,t)=>t.key===h?e.jsx(w.Item,{name:[t.sectionIndex,"items",t.itemIndex,"name"],className:"!mb-0",children:e.jsx(F,{value:s,onChange:a=>{const r=[...I],u=r.find(o=>o.id===t.serviceId).attributes.sections[t.sectionIndex].items[t.itemIndex];u.name=a.target.value,f(r)}})},`name-${t.key}`):s},{title:"描述",dataIndex:"description",key:"description",width:"25%",render:(s,t)=>t.key===h?e.jsx(w.Item,{name:[t.sectionIndex,"items",t.itemIndex,"description"],className:"!mb-0",children:e.jsx(F,{value:s,onChange:a=>{const r=[...I],u=r.find(o=>o.id===t.serviceId).attributes.sections[t.sectionIndex].items[t.itemIndex];u.description=a.target.value,f(r)}})}):e.jsx(P,{ellipsis:{rows:2,tooltip:s},className:"mb-0",children:s})},{title:"单价",dataIndex:"price",key:"price",width:"15%",render:(s,t)=>t.key===h?e.jsx(F,{type:"number",value:s,onChange:a=>{const r=[...I],u=r.find(o=>o.id===t.serviceId).attributes.sections[t.sectionIndex].items[t.itemIndex];u.price=Number(a.target.value),f(r)}}):e.jsxs("span",{className:"text-gray-600",children:["¥",s==null?void 0:s.toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})]})},{title:"数量",dataIndex:"quantity",key:"quantity",width:"15%",render:(s,t)=>t.key===h?e.jsx(F,{type:"number",value:s,onChange:a=>{const r=[...I],u=r.find(o=>o.id===t.serviceId).attributes.sections[t.sectionIndex].items[t.itemIndex];u.quantity=Number(a.target.value),f(r)}}):e.jsx("span",{className:"text-gray-600",children:s})},{title:"小计",key:"subtotal",width:"20%",render:(s,t)=>e.jsxs("span",{className:"text-blue-600 font-medium",children:["¥",((t.price||0)*(t.quantity||0)).toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})]})},{title:"操作",key:"action",width:"150px",render:(s,t)=>t.key===h?e.jsxs(q,{children:[e.jsx(c,{type:"link",size:"small",className:"text-green-600",onClick:()=>T(t,t.sectionIndex,t.itemIndex),children:"保存"}),e.jsx(c,{type:"link",size:"small",className:"text-gray-600",onClick:()=>y(""),children:"取消"})]}):e.jsxs(q,{children:[e.jsx(c,{type:"link",size:"small",className:"text-blue-600",disabled:h!=="",onClick:()=>y(t.key),children:"编辑"}),e.jsx(K,{title:"删除确认",description:"确定要删除这个项目吗?",okText:"确定",cancelText:"取消",okButtonProps:{danger:!0},onConfirm:()=>$(t),children:e.jsx(c,{type:"link",size:"small",className:"text-red-600",disabled:h!=="",children:"删除"})})]})}],l=s=>{var t;return e.jsx("div",{className:"bg-white dark:bg-gray-800 p-4 rounded-lg",children:(t=s.attributes.sections)==null?void 0:t.map((g,a)=>e.jsx(R,{className:"mb-4 shadow-sm border-blue-100 dark:border-blue-900/30 hover:shadow-md transition-shadow duration-300",title:e.jsxs("div",{className:"flex items-center justify-between py-2",children:[e.jsx("span",{className:"text-lg font-medium text-blue-600 dark:text-blue-400",children:g.sectionName||`服务类型 ${a+1}`}),e.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-medium",children:["总计: ¥",g.items.reduce((r,n)=>r+(Number(n.price)||0)*(Number(n.quantity)||0),0).toLocaleString("zh-CN",{minimumFractionDigits:2,maximumFractionDigits:2})]})]}),headStyle:{background:"rgba(59, 130, 246, 0.05)",borderBottom:"1px solid rgba(59, 130, 246, 0.1)"},style:{background:"rgba(59, 130, 246, 0.02)"},children:e.jsx(O,{columns:i,dataSource:g.items.map((r,n)=>({...r,key:`${s.id}-${a}-${n}`,serviceId:s.id,sectionIndex:a,itemIndex:n})),pagination:!1,className:"rounded-lg overflow-hidden",rowClassName:"hover:bg-blue-50/50 dark:hover:bg-blue-900/20 transition-colors"})},`${s.id}-section-${a}`))})};return x.useEffect(()=>{v(),C()},[]),e.jsx("div",{className:"min-h-screen",children:e.jsx(R,{title:e.jsx("span",{className:"text-xl font-medium",children:"服务模版管理"}),className:"h-full w-full overflow-auto",extra:e.jsxs(q,{children:[e.jsx(se,{}),e.jsx(te,{}),e.jsx(re,{}),e.jsx(c,{type:"primary",onClick:()=>j("/company/serviceTemplateInfo"),children:"新建模版"})]}),children:e.jsx(O,{columns:m,dataSource:I,loading:D,rowKey:"id",scroll:{x:!0},expandable:{expandedRowRender:l,expandRowByClick:!0,expandIcon:({expanded:s,onExpand:t,record:g})=>e.jsx(c,{type:"link",onClick:a=>{a.stopPropagation(),t(g,a)},icon:s?e.jsx(G,{}):e.jsx(Y,{}),className:`
|
|
transition-all duration-300
|
|
${s?"text-blue-600":"text-gray-400 hover:text-blue-600"}
|
|
`}),rowExpandable:s=>{var t;return((t=s.attributes.sections)==null?void 0:t.length)>0}},className:"rounded-lg overflow-hidden",rowClassName:(s,t)=>`
|
|
cursor-pointer transition-colors
|
|
${t%2===0?"bg-white dark:bg-gray-800":"bg-gray-50 dark:bg-gray-750"}
|
|
hover:bg-blue-50 dark:hover:bg-blue-900/20
|
|
`,expandedRowClassName:()=>"bg-blue-50/50 dark:bg-blue-900/10"})})})};export{ne as default};
|
|
//# sourceMappingURL=index-8c177bec.js.map
|