import{p as v,r as a,A as S,t as I,F as o,g as k,j as e,B as C,h as A,I as d,v as N}from"./index-CKIL6d0V.js";import{R as x}from"./PlusCircleOutlined-C3dgw0Zs.js";const B=v.div`
  height: 100%;
  display: flex;
  flex-direction: column;
  .addbtn {
      height: 60px;
      line-height: 60px;
      padding-right: 16px;
      text-align: right;
      background-color: ${s=>s.theme.colorBgContainer};
    }
    .bottomList {
      flex: 1;
      padding: 16px;
      font-size: 16px;
      overflow: auto;
      .noData {
        height: 36px;
        line-height: 36px;
        font-size: 20px;
        text-align: center;
      }
      li {
        margin-bottom: 16px;
        border-radius: 16px;
        border: 1px solid ${s=>s.theme.colorBorderSecondary};
        background-color: ${s=>s.theme.colorBgContainer};
        .topc {
          height: 36px;
          padding: 0 20px;
          line-height: 36px;
          font-size: 18px;
          border-bottom: 1px solid ${s=>s.theme.colorBorderSecondary};
          display: flex;
          justify-content: space-between;
          span {

          }

        }
        .botc {
          min-height: 60px;
          padding: 16px;
          white-space: pre-wrap;
        }
      }
    }

`,{TextArea:F}=d,L=a.memo(()=>{const{message:s}=S.useApp(),{token:m}=I.useToken(),[r]=o.useForm(),[p,g]=a.useState([]),[u,i]=a.useState(!1),l=a.useCallback(async()=>{try{const{code:t,data:c,msg:n}=await k("/api/SysLog/ProjectListAll",{pageIndex:1,pageSize:9999});t===200?g(c.items):s.warning(n)}catch(t){s.error(t)}},[s]);a.useEffect(()=>{l()},[l]);const j=()=>{i(!0)},f=()=>{r.submit()},b=()=>{i(!1)},y=async t=>{const c={...t};try{const{code:n,msg:h}=await N("/api/SysLog/ProjectAdd",c);n===200?(s.success(h),await l(),i(!1)):s.warning(h)}catch(n){s.error(n)}},w=()=>{r.resetFields()};return e.jsxs(B,{theme:m,children:[e.jsx("div",{className:"addbtn",children:e.jsxs(C,{type:"primary",onClick:()=>j(),children:[e.jsx(x,{}),"添加"]})}),e.jsx("ul",{className:"bottomList",children:p.length>0?p.map(t=>e.jsxs("li",{children:[e.jsxs("div",{className:"topc",children:[e.jsx("span",{}),e.jsx("span",{children:t.version}),e.jsx("span",{children:t.contenter})]}),e.jsx("div",{className:"botc",children:t.content})]},t.id)):e.jsx("div",{className:"noData",children:"暂无数据"})}),e.jsx(A,{className:"ysh_antd_modal",text:e.jsxs("span",{style:{fontSize:"24px"},children:[e.jsx(x,{}),"   添 加"]}),width:618,open:u,onOk:f,onCancel:b,afterClose:w,children:e.jsxs(o,{form:r,labelAlign:"right",labelCol:{span:4},onFinish:y,initialValues:{id:"",version:"",contenter:"",content:""},children:[e.jsx(o.Item,{label:"提交人 : ",name:"contenter",rules:[{required:!0,message:"请输入提交人"}],children:e.jsx(d,{placeholder:"提交人"})}),e.jsx(o.Item,{label:"版 本 : ",name:"version",rules:[{required:!0,message:"请输入版本"}],children:e.jsx(d,{placeholder:"版本"})}),e.jsx(o.Item,{label:"内 容 : ",name:"content",rules:[{required:!0,message:"请输入内容"}],children:e.jsx(F,{placeholder:"内容"})})]})})]})});L.displayName="SystemVersion";export{L as default};
