unis_crm/frontend1/dist/assets/index-DtaOMvW8.js

2 lines
6.1 KiB
JavaScript
Raw Normal View History

2026-04-13 01:35:05 +00:00
import{u as B,G as M,r as l,aN as G,j as e,z as d,T as U,Q as T,B as i,U as J,V as W,H as X,M as j,I as Y,K as Z,aD as ee,aO as ae,aP as se,s as I,aQ as te,aR as re}from"./index-D2cxrzyv.js";import{u as C}from"./useDict-BN4y0n-Y.js";import{P as le}from"./index-DICUnuN_.js";import{g as ie}from"./pagination-m5F4NDQi.js";import{F as r}from"./index-KuslyOWx.js";import{T as f}from"./index-C8Xnkbw4.js";import{P as ne}from"./index-Dv-9vGc2.js";import{C as v}from"./index-BFDbUxK1.js";import{I as y}from"./index-4zw5l6IX.js";import{F as me}from"./Table-BLvbgkX9.js";import{R as oe,C as _}from"./row-C5EMotZ4.js";import{S as ce}from"./index-DPZE8XLS.js";import"./useForm-CaItC8xb.js";import"./iconUtil-CAY5Il88.js";import"./index-COTHVrjr.js";import"./index-Iw46KAPi.js";import"./Pagination-lXX40XmA.js";const{Text:N}=U;function _e(){const{t:a}=B(),{can:u}=M(),{items:g}=C("sys_common_status"),{items:P}=C("sys_param_type"),[V,b]=l.useState(!1),[k,w]=l.useState(!1),[E,F]=l.useState([]),[K,R]=l.useState(0),[m,x]=l.useState({pageNum:1,pageSize:10}),[D,o]=l.useState(!1),[c,S]=l.useState(null),[n]=r.useForm(),p=l.useCallback(async(s=m)=>{b(!0);try{const t=await G(s);F(t.records||[]),R(t.total||0)}finally{b(!1)}},[m]);l.useEffect(()=>{p()},[p]);const z=s=>{x({...m,...s,pageNum:1})},L=()=>{n.resetFields(),x({pageNum:1,pageSize:10})},$=(s,t)=>{x(h=>({...h,pageNum:s,pageSize:t}))},q=()=>{S(null),n.resetFields(),n.setFieldsValue({isSystem:0,status:1}),o(!0)},O=s=>{S(s),n.setFieldsValue(s),o(!0)},H=async s=>{try{await se(s),I.success(a("common.success")),p()}catch{}},Q=async()=>{try{const s=await n.validateFields();w(!0),c?await te(c.paramId,s):await re(s),I.success(a("common.success")),o(!1),p()}finally{w(!1)}},A=[{title:a("sysParams.paramKey"),dataIndex:"paramKey",key:"paramKey",render:(s,t)=>e.jsxs(d,{direction:"vertical",size:0,children:[e.jsx(N,{className:"param-key-text",children:s}),t.isSystem===1&&e.jsx(f,{color:"orange",style:{fontSize:10,marginTop:2,padding:"0 4px"},children:a("sysParams.isSystem")})]})},{title:a("sysParams.paramValue"),dataIndex:"paramValue",key:"paramValue",ellipsis:!0,render:s=>e.jsx(T,{title:s,children:e.jsx(N,{code:!0,children:s})})},{title:a("sysParams.paramType"),dataIndex:"paramType",key:"paramType",width:120,render:s=>e.jsx(f,{className:"param-type-tag",children:s||a("sysParamsExt.defaultType")})},{title:a("sysParams.description"),dataIndex:"description",key:"description",ellipsis:!0},{title:a("common.status"),dataIndex:"status",width:80,render:s=>{const t=g.find(h=>h.itemValue===String(s));return e.jsx(f,{color:s===1?"green":"red",children:t?t.itemLabel:a(s===1?"sysParamsExt.enabled":"sysParamsExt.disabled")})}},{title:a("common.action"),key:"action",width:110,fixed:"right",render:(s,t)=>e.jsxs(d,{children:[u("sys_param:update")&&e.jsx(i,{type:"text",icon:e.jsx(J,{}),onClick:()=>O(t)}),u("sys_param:delete")&&t.isSystem!==1&&e.jsx(ne,{title:a("sysParamsExt.deleteConfirm"),okText:a("common.confirm"),cancelText:a("common.cancel"),onConfirm:()=>H(t.paramId),children:e.jsx(i,{type:"text",danger:!0,icon:e.jsx(W,{})})})]})}];return e.jsxs("div",{className:"app-page sys-params-page",children:[e.jsx(le,{title:a("sysParams.title"),subtitle:a("sysParams.subtitle")}),e.jsx(v,{className:"sys-params-table-card app-page__filter-card",styles:{body:{padding:"16px"}},children:e.jsxs("div",{className:"app-page__toolbar",style:{justifyContent:"space-between",width:"100%"},children:[e.jsxs(r,{layout:"inline",onFinish:z,className:"app-page__toolbar",children:[e.jsx(r.Item,{name:"paramKey",children:e.jsx(y,{placeholder:a("sysParams.paramKey"),prefix:e.jsx(X,{}),allowClear:!0,style:{width:200}})}),e.jsx(r.Item,{name:"paramType",children:e.jsx(j,{placeholder:a("sysParams.paramType"),allowClear:!0,style:{width:150},options:P.map(s=>({label:s.itemLabel,value:s.itemValue}))})}),e.jsx(r.Item,{children:e.jsxs(d,{children:[e.jsx(i,{type:"primary",htmlType:"submit",children:a("common.search")}),e.jsx(i,{onClick:L,children:a("common.reset")})]})})]}),u("sys_param:create")&&e.jsx(i,{type:"primary",icon:e.jsx(Y,{}),onClick:q,children:a("common.cr