12 |
- "use strict";(self.webpackChunkyge_admin=self.webpackChunkyge_admin||[]).push([[274],{3118:function(e,t,a){a.d(t,{f:function(){return l}});const l=[{label:"\u9152\u5668",value:"\u9152\u5668"},{label:"\u98df\u5668",value:"\u98df\u5668"},{label:"\u4e50\u5668",value:"\u4e50\u5668"},{label:"\u5175\u5668",value:"\u5175\u5668"},{label:"\u6c34\u5668",value:"\u6c34\u5668"},{label:"\u94dc\u955c",value:"\u94dc\u955c"}]},4274:function(e,t,a){a.r(t),a.d(t,{default:function(){return f}});var l=a(6231),n=a(4268),c=a(5223),i=a(4196),s=a(8926),r=a(7634),o=a(1295),u=a(4965),d=a(2079),h=a(5716),m=a(3118),x=a(1720),g=a(2518);const p={pageNum:1,pageSize:20,searchKey:"",dictTexture:m.f[0].value},b=[{label:"\u5168\u90e8",value:""},...m.f];function f(){const e=(0,h.s0)(),t=(0,h.TH)(),a=new URLSearchParams(t.search),m=(0,u.useRef)(null),[f,w]=(0,u.useState)(!1),[y,S]=(0,u.useState)([]),[j,v]=(0,u.useState)({...p,searchKey:a.get("searchKey")||"",dictTexture:a.get("dictTexture")||b[0].value}),[C,k]=(0,u.useState)(0),Z=(0,u.useCallback)((async()=>{w(!0);try{const e=await x.Wo.getList(j);S(e.records),k(e.total)}finally{w(!1)}}),[j]);(0,u.useEffect)((()=>{Z()}),[Z]);const T=(0,u.useCallback)((async e=>{await x.Wo.delete(e),Z()}),[Z]),I=(0,u.useMemo)((()=>[{title:"\u85cf\u54c1\u540d\u79f0",dataIndex:"name"},{title:"\u5c01\u9762\u56fe",width:92,render:e=>(0,g.jsx)(n.Z,{width:60,height:60,src:"".concat("https://bfcwall.4dage.com").concat(e.thumb)})},{title:"\u7c7b\u522b",dataIndex:"dictTexture"},{title:"\u5e74\u4ee3",dataIndex:"dictAge"},{title:"\u7b80\u4ecb",width:250,render:e=>(0,g.jsx)("p",{className:"limit-line line-2",children:e.description})},{title:"\u70b9\u8d5e",dataIndex:"star"},{title:"\u64cd\u4f5c",render:t=>(0,g.jsx)(l.J,{onEdit:()=>e("/collection/edit/".concat(t.id)),onDelete:T.bind(void 0,t.id)})}]),[e,T]),K=(0,u.useCallback)((()=>{v({...p}),setTimeout((()=>{var t;null===(t=m.current)||void 0===t||t.resetFields(),e("/collection?".concat(new URLSearchParams({searchKey:p.searchKey,dictTexture:p.dictTexture}).toString()),{replace:!0})}))}),[m,e]),N=(0,u.useMemo)((()=>(0,d.debounce)(((t,a)=>{v({...j,...a}),e("/collection?".concat(new URLSearchParams(a).toString()),{replace:!0})}),500)),[e,j]),z=(0,u.useCallback)((()=>(e,t)=>{v({...j,pageNum:e,pageSize:t})}),[j]);return(0,g.jsxs)("div",{className:"collection",children:[(0,g.jsxs)(c.Z,{ref:m,layout:"inline",initialValues:j,onValuesChange:N,children:[(0,g.jsx)(c.Z.Item,{label:"\u85cf\u54c1\u540d\u79f0",name:"searchKey",children:(0,g.jsx)(i.Z,{placeholder:"\u8bf7\u8f93\u5165",maxLength:10,showCount:!0,allowClear:!0})}),(0,g.jsx)(c.Z.Item,{label:"\u7c7b\u522b",name:"dictTexture",children:(0,g.jsx)(s.Z,{style:{width:220},options:b})}),(0,g.jsx)(c.Z.Item,{children:(0,g.jsx)(r.ZP,{type:"primary",onClick:()=>e("/collection/create"),children:"\u65b0\u589e"})}),(0,g.jsx)(c.Z.Item,{children:(0,g.jsx)(r.ZP,{onClick:K,children:"\u91cd\u7f6e"})})]}),(0,g.jsx)(o.Z,{loading:f,className:"page-table",dataSource:y,columns:I,rowKey:"id",pagination:{showQuickJumper:!0,position:["bottomCenter"],showSizeChanger:!0,current:j.pageNum,pageSize:j.pageSize,total:C,onChange:z()}})]})}}}]);
- //# sourceMappingURL=274.cc5b9884.chunk.js.map
|