Browse Source

应用列表、人员管理,筛选

fanmiyou
nili 7 months ago
parent
commit
4a570f095f
  1. 2
      dist/index.html
  2. 1
      dist/p__AdminManagement.8c0c25d4.async.js
  3. 1
      dist/p__AdminManagement.ac6ffc01.async.js
  4. 1
      dist/p__AppManagement.16d305c4.async.js
  5. 1
      dist/p__AppManagement.50f52b64.async.js
  6. 2
      dist/umi.1c2fd8af.js
  7. 28
      src/pages/AdminManagement.tsx
  8. 43
      src/pages/AppManagement.tsx

2
dist/index.html

@ -9,6 +9,6 @@
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
<script src="/umi.a7e407cb.js"></script> <script src="/umi.1c2fd8af.js"></script>
</body></html> </body></html>

1
dist/p__AdminManagement.8c0c25d4.async.js

File diff suppressed because one or more lines are too long

1
dist/p__AdminManagement.ac6ffc01.async.js

File diff suppressed because one or more lines are too long

1
dist/p__AppManagement.16d305c4.async.js

@ -1 +0,0 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[39],{84702:function(H,p,e){e.r(p);var j=e(15009),u=e.n(j),P=e(99289),v=e.n(P),A=e(5574),m=e.n(A),U=e(90930),C=e(85601),T=e(35312),t=e(8232),x=e(10397),I=e(14726),B=e(17788),i=e(96365),E=e(67294),f=e(48357),r=e(85893),b=function(){var R=(0,E.useState)(!1),h=m()(R,2),W=h[0],d=h[1],K=t.Z.useForm(),L=m()(K,1),o=L[0],y=(0,E.useState)([]),M=m()(y,2),F=M[0],Z=M[1],S=(0,T.useModel)("@@initialState"),c=S.initialState,l=c==null?void 0:c.currentUser,g=l&&l.role&&l.role<2,$=function(_){o.setFieldsValue(_),d(!0)},O=[{title:"\u6E38\u620F",dataIndex:"name"},{title:"\u4E0B\u8F7D\u5730\u5740",dataIndex:"url",renderText:function(_){return(0,r.jsx)(x.Z,{size:120,value:_||"",bordered:!1})}}],z=[].concat(O,[{title:"secret",dataIndex:"secret",ellipsis:!0,copyable:!0},{title:"\u64CD\u4F5C",width:80,renderText:function(_){return(0,r.jsx)("a",{onClick:function(){return $(_)},children:"\u7F16\u8F91"},"edit")}}]),G=function(){o.submit()},N=function(){d(!1)},D=function(){var a=v()(u()().mark(function _(){var s;return u()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,(0,f.ln)();case 2:s=n.sent,s.data&&Z(s.data);case 4:case"end":return n.stop()}},_)}));return function(){return a.apply(this,arguments)}}();(0,E.useEffect)(function(){D()},[]);var V=function(){o.resetFields(),d(!0)},J=function(){var a=v()(u()().mark(function _(s){return u()().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,(0,f.XJ)(s);case 3:n.next=8;break;case 5:return n.prev=5,n.t0=n.catch(0),n.abrupt("return");case 8:d(!1),D();case 10:case"end":return n.stop()}},_,null,[[0,5]])}));return function(s){return a.apply(this,arguments)}}();return(0,r.jsxs)(U._z,{children:[l&&l.role&&l.role<2&&(0,r.jsx)(I.ZP,{style:{marginBottom:"20px"},onClick:V,children:"\u65B0\u5EFA\u5E94\u7528"}),(0,r.jsx)(C.Z,{search:!1,columns:g?z:O,dataSource:F}),(0,r.jsx)(B.Z,{title:"\u7F16\u8F91",visible:W,onOk:G,onCancel:N,children:(0,r.jsxs)(t.Z,{form:o,onFinish:J,children:[(0,r.jsx)(t.Z.Item,{name:"id",style:{display:"none"},children:(0,r.jsx)(i.Z,{type:"hidden"})}),(0,r.jsx)(t.Z.Item,{name:"code",style:{display:"none"},children:(0,r.jsx)(i.Z,{type:"hidden"})}),(0,r.jsx)(t.Z.Item,{label:"\u5E94\u7528\u540D",name:"name",children:(0,r.jsx)(i.Z,{})}),(0,r.jsx)(t.Z.Item,{label:"\u4E0B\u8F7D\u5730\u5740",name:"url",children:(0,r.jsx)(i.Z,{})})]})})]})};p.default=b}}]);

1
dist/p__AppManagement.50f52b64.async.js

@ -0,0 +1 @@
"use strict";(self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[39],{40110:function(y,o,e){var c=e(1413),s=e(67294),O=e(509),m=e(91146),E=function(D,P){return s.createElement(m.Z,(0,c.Z)((0,c.Z)({},D),{},{ref:P,icon:O.Z}))};E.displayName="SearchOutlined",o.Z=s.forwardRef(E)},84702:function(y,o,e){e.r(o);var c=e(15009),s=e.n(c),O=e(99289),m=e.n(O),E=e(5574),v=e.n(E),D=e(90930),P=e(85601),R=e(35312),i=e(8232),u=e(96365),Z=e(42075),p=e(14726),L=e(71230),A=e(10397),W=e(55241),g=e(17788),M=e(67294),I=e(48357),F=e(40110),n=e(85893),S=function(){var b=(0,M.useState)(!1),x=v()(b,2),$=x[0],f=x[1],z=i.Z.useForm(),N=v()(z,1),h=N[0],G=(0,M.useState)([]),U=v()(G,2),V=U[0],J=U[1],X=(0,R.useModel)("@@initialState"),j=X.initialState,d=j==null?void 0:j.currentUser,H=d&&d.role&&d.role<2,Q=function(r){h.setFieldsValue(r),f(!0)},T=[{title:"\u6E38\u620F",dataIndex:"name",filterDropdown:function(r){var a=r.setSelectedKeys,l=r.selectedKeys,t=r.confirm,ne=r.clearFilters;return(0,n.jsxs)("div",{style:{padding:8},children:[(0,n.jsx)(u.Z,{placeholder:"\u641C\u7D22\u8D26\u53F7",value:l[0],onChange:function(K){return a(K.target.value?[K.target.value]:[])},onPressEnter:function(){return t()},style:{marginBottom:8,display:"block"}}),(0,n.jsxs)(Z.Z,{children:[(0,n.jsx)(p.ZP,{onClick:function(){return t()},type:"primary",children:"\u641C\u7D22"}),(0,n.jsx)(p.ZP,{onClick:function(){return ne()},type:"link",children:"\u6E05\u9664"})]})]})},onFilter:function(r,a){var l;return a==null||(l=a.name)===null||l===void 0?void 0:l.includes(r)},filterIcon:function(r){return(0,n.jsx)(F.Z,{style:{color:r?"#1890ff":void 0},onPointerEnterCapture:void 0,onPointerLeaveCapture:void 0})}},{title:"\u4E0B\u8F7D\u5730\u5740",dataIndex:"url",renderText:function(r){return r&&(0,n.jsxs)(L.Z,{align:"middle",children:[(0,n.jsx)(A.Z,{size:80,value:r||"",bordered:!1}),(0,n.jsx)(W.Z,{overlayInnerStyle:{padding:0},content:(0,n.jsx)(A.Z,{size:300,value:r||"",bordered:!1}),children:(0,n.jsx)("a",{children:"\u67E5\u770B\u5927\u56FE"})})]})}}],Y=[].concat(T,[{title:"secret",dataIndex:"secret",ellipsis:!0,copyable:!0},{title:"\u64CD\u4F5C",width:80,renderText:function(r){return(0,n.jsx)("a",{onClick:function(){return Q(r)},children:"\u7F16\u8F91"},"edit")}}]),k=function(){h.submit()},w=function(){f(!1)},B=function(){var _=m()(s()().mark(function r(){var a;return s()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,I.ln)();case 2:a=t.sent,a.data&&J(a.data);case 4:case"end":return t.stop()}},r)}));return function(){return _.apply(this,arguments)}}();(0,M.useEffect)(function(){B()},[]);var q=function(){h.resetFields(),f(!0)},ee=function(){var _=m()(s()().mark(function r(a){return s()().wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,(0,I.XJ)(a);case 3:t.next=8;break;case 5:return t.prev=5,t.t0=t.catch(0),t.abrupt("return");case 8:f(!1),B();case 10:case"end":return t.stop()}},r,null,[[0,5]])}));return function(a){return _.apply(this,arguments)}}();return(0,n.jsxs)(D._z,{children:[d&&d.role&&d.role<2&&(0,n.jsx)(p.ZP,{style:{marginBottom:"20px"},onClick:q,children:"\u65B0\u5EFA\u5E94\u7528"}),(0,n.jsx)(P.Z,{search:!1,columns:H?Y:T,dataSource:V}),(0,n.jsx)(g.Z,{title:"\u7F16\u8F91",visible:$,onOk:k,onCancel:w,children:(0,n.jsxs)(i.Z,{form:h,onFinish:ee,children:[(0,n.jsx)(i.Z.Item,{name:"id",style:{display:"none"},children:(0,n.jsx)(u.Z,{type:"hidden"})}),(0,n.jsx)(i.Z.Item,{name:"code",style:{display:"none"},children:(0,n.jsx)(u.Z,{type:"hidden"})}),(0,n.jsx)(i.Z.Item,{label:"\u5E94\u7528\u540D",name:"name",children:(0,n.jsx)(u.Z,{})}),(0,n.jsx)(i.Z.Item,{label:"\u4E0B\u8F7D\u5730\u5740",name:"url",children:(0,n.jsx)(u.Z,{})})]})})]})};o.default=S}}]);

2
dist/umi.a7e407cb.js → dist/umi.1c2fd8af.js

File diff suppressed because one or more lines are too long

28
src/pages/AdminManagement.tsx

@ -1,9 +1,10 @@
import { useModel } from '@umijs/max'; import { useModel } from '@umijs/max';
import { Button, Col, Form, Input, InputNumber, Modal, Row, Select, Table, Tag } from 'antd'; import { Button, Col, Form, Input, InputNumber, Modal, Row, Select, Space, Table, Tag } from 'antd';
import { ColumnsType } from 'antd/es/table'; import { ColumnsType } from 'antd/es/table';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { adminList, appList, saveAdmin } from '@/services/matrix/admin'; import { adminList, appList, saveAdmin } from '@/services/matrix/admin';
import { SearchOutlined } from '@ant-design/icons';
const AdminManagement = () => { const AdminManagement = () => {
const [data, setData] = useState<API.MatrixAdminBo[]>([]); const [data, setData] = useState<API.MatrixAdminBo[]>([]);
@ -31,6 +32,29 @@ const AdminManagement = () => {
{ {
title: '账号', title: '账号',
dataIndex: 'name', dataIndex: 'name',
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
<div style={{ padding: 8 }}>
<Input
placeholder="搜索账号"
value={selectedKeys[0]}
onChange={(e) => setSelectedKeys(e.target.value ? [e.target.value] : [])}
onPressEnter={() => confirm()}
style={{ marginBottom: 8, display: 'block' }}
/>
<Space>
<Button onClick={() => confirm()} type="primary">
</Button>
<Button onClick={() => clearFilters()} type="link">
</Button>
</Space>
</div>
),
onFilter: (value, record) => record?.name?.includes(value),
filterIcon: (filtered) => (
<SearchOutlined style={{ color: filtered ? '#1890ff' : undefined }} onPointerEnterCapture={undefined} onPointerLeaveCapture={undefined} />
),
}, },
{ {
@ -135,7 +159,7 @@ const AdminManagement = () => {
<Input type="hidden" /> <Input type="hidden" />
</Form.Item> </Form.Item>
<Form.Item label="账号" name="name"> <Form.Item label="账号" name="name">
<Input disabled={editing} /> <Input disabled={editing} maxLength={32} />
</Form.Item> </Form.Item>
<Form.Item label="密码" name="password"> <Form.Item label="密码" name="password">
<Input.Password disabled={editing} /> <Input.Password disabled={editing} />

43
src/pages/AppManagement.tsx

@ -1,9 +1,10 @@
import { PageContainer, ProColumns, ProTable } from '@ant-design/pro-components'; import { PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
import { useModel } from '@umijs/max'; import { useModel } from '@umijs/max';
import { Button, Form, Input, Modal, QRCode } from 'antd'; import { Button, Form, Input, Modal, Popover, QRCode, Row, Space } from 'antd';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import { appList, saveApp } from '@/services/matrix/admin'; import { appList, saveApp } from '@/services/matrix/admin';
import { SearchOutlined } from '@ant-design/icons';
const AppManagement = () => { const AppManagement = () => {
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
@ -22,6 +23,33 @@ const AppManagement = () => {
{ {
title: '游戏', title: '游戏',
dataIndex: 'name', dataIndex: 'name',
filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => (
<div style={{ padding: 8 }}>
<Input
placeholder="搜索账号"
value={selectedKeys[0]}
onChange={(e) => setSelectedKeys(e.target.value ? [e.target.value] : [])}
onPressEnter={() => confirm()}
style={{ marginBottom: 8, display: 'block' }}
/>
<Space>
<Button onClick={() => confirm()} type="primary">
</Button>
<Button onClick={() => clearFilters()} type="link">
</Button>
</Space>
</div>
),
onFilter: (value, record) => record?.name?.includes(value),
filterIcon: (filtered) => (
<SearchOutlined
style={{ color: filtered ? '#1890ff' : undefined }}
onPointerEnterCapture={undefined}
onPointerLeaveCapture={undefined}
/>
),
}, },
// { // {
// title: 'code', // title: 'code',
@ -30,7 +58,18 @@ const AppManagement = () => {
{ {
title: '下载地址', title: '下载地址',
dataIndex: 'url', dataIndex: 'url',
renderText: (url: string) => <QRCode size={120} value={url || ''} bordered={false} />, renderText: (url: string) =>
url && (
<Row align="middle">
<QRCode size={80} value={url || ''} bordered={false} />
<Popover
overlayInnerStyle={{ padding: 0 }}
content={<QRCode size={300} value={url || ''} bordered={false} />}
>
<a></a>
</Popover>
</Row>
),
}, },
]; ];

Loading…
Cancel
Save