Files
houyi-admin/dist/src__pages__device__device__index.bba7816e.async.js
PC-202306242200\Administrator 23dc139a31 first commit
2026-03-28 23:25:01 +08:00

2 lines
9.1 KiB
JavaScript

"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[8078,9685],{17675:function(B,v,e){e.d(v,{Z:function(){return m}});var P=e(52319),a=e(93236),D={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},f=D,o=e(85651),s=function(d,c){return a.createElement(o.Z,(0,P.Z)({},d,{ref:c,icon:f}))},m=a.forwardRef(s)},52586:function(B,v,e){var P=e(88351),a=e(87841),D=e(93236),f=e(8263),o=e(62086),s=["fieldProps","proFieldProps"],m=function(d,c){var l=d.fieldProps,r=d.proFieldProps,i=(0,a.Z)(d,s);return(0,o.jsx)(f.Z,(0,P.Z)({ref:c,valueType:"textarea",fieldProps:l,proFieldProps:r},i))};v.Z=D.forwardRef(m)},61786:function(B,v,e){var P=e(88351),a=e(87841),D=e(93236),f=e(8263),o=e(62086),s=["fieldProps","proFieldProps"],m=["fieldProps","proFieldProps"],O="text",d=function(i){var A=i.fieldProps,C=i.proFieldProps,I=(0,a.Z)(i,s);return(0,o.jsx)(f.Z,(0,P.Z)({valueType:O,fieldProps:A,filedConfig:{valueType:O},proFieldProps:C},I))},c=function(i){var A=i.fieldProps,C=i.proFieldProps,I=(0,a.Z)(i,m);return(0,o.jsx)(f.Z,(0,P.Z)({valueType:"password",fieldProps:A,proFieldProps:C,filedConfig:{valueType:O}},I))},l=d;l.Password=c,l.displayName="ProFormComponent",v.Z=l},85968:function(B,v,e){var P=e(23674),a=e(62086),D=function(o){var s=(0,P.useModel)("@@initialState"),m=s.initialState,O=s.loading,d=s.error,c=s.refresh,l=s.setInitialState,r=m==null?void 0:m.authPermissionAction;if(!r)return(0,a.jsx)("span",{children:o.children});var i=r.indexOf(o.action);return i>=0?(0,a.jsx)("span",{children:o.children}):(0,a.jsx)(a.Fragment,{})};v.Z=D},48224:function(B,v,e){e.r(v);var P=e(57213),a=e.n(P),D=e(54306),f=e.n(D),o=e(93236),s=e(92750),m=e(33081),O=e(90627),d=e(62086),c=O.Z.DeviceLogsController.reportkw;v.default=function(l){var r=l.values,i=l.type,A=l.modalOpenState,C=l.onModalOpenState,I=(0,o.useState)(null),L=f()(I,2),S=L[0],W=L[1],K={data:S,xField:"name",yField:"value",seriesField:"category",xAxis:{},yAxis:{label:{formatter:function(U){return"".concat(U).replace(/\d{1,3}(?=(\d{3})+$)/g,function(x){return"".concat(x,",")})}}}};return(0,o.useEffect)(function(){c({device_id:r==null?void 0:r.device_id,order_id:i==1?r==null?void 0:r.id:""}).then(function(T){var U=T.data,x=T.success;x&&W(U||[])}).catch(function(){})},[r]),(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(s.Z,{width:"800px",title:"\u529F\u7387\u56FE",open:A,onOk:function(){C(!1)},onCancel:function(){C(!1)},children:(0,d.jsx)(d.Fragment,{children:(0,d.jsx)(m.Z,a()({},K))})})})}},60695:function(B,v,e){e.r(v);var P=e(93236),a=e(28931),D=e(61786),f=e(52586),o=e(62086);v.default=function(s){var m=s.values,O=s.modalOpenState,d=s.onModalOpenState,c=s.onSubmit,l=(0,P.useRef)();return(0,P.useEffect)(function(){var r;(r=l.current)===null||r===void 0||r.setFieldsValue(m)},[m]),(0,o.jsx)(o.Fragment,{children:(0,o.jsxs)(a.Y,{title:"\u5145\u7535\u6869-\u8BBE\u7F6E\u5730\u5740",formRef:l,submitter:{searchConfig:{resetText:"\u91CD\u7F6E"},resetButtonProps:{onClick:function(){var i;(i=l.current)===null||i===void 0||i.resetFields()}}},initialValues:m,onFinish:c,open:O,onOpenChange:d,children:[(0,o.jsx)(D.Z,{hidden:!0,width:"md",name:"id"}),(0,o.jsx)(D.Z,{width:"md",label:"\u8BBE\u5907\u53F7",name:"device_no",placeholder:"\u8BF7\u8F93\u5165"}),(0,o.jsx)(D.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],name:"site_name",label:"\u7535\u7AD9\u540D\u79F0",placeholder:"\u8BF7\u8F93\u5165"}),(0,o.jsx)(f.Z,{rules:[{required:!0,message:"\u8BF7\u8F93\u5165"}],name:"address",label:"\u8BE6\u7EC6\u5730\u5740",placeholder:"\u8BF7\u8F93\u5165"})]})})}},79224:function(B,v,e){e.r(v);var P=e(57213),a=e.n(P),D=e(12342),f=e.n(D),o=e(25359),s=e.n(o),m=e(49811),O=e.n(m),d=e(54306),c=e.n(d),l=e(93236),r=e(23674),i=e(17675),A=e(89971),C=e(85594),I=e(71516),L=e(11776),S=e(61385),W=e(14649),K=e(23041),T=e(50336),U=e(87708),x=e(85968),X=e(60695),w=e(48224),$=e(90627),k=e(5726),z=e.n(k),_=e(62086),q=["type","defaultRender","formItemProps","fieldProps"],y=$.Z.DeviceController,ee=y.deviceItems,ne=y.deviceSetinfo,fe=y.deviceCreate,te=$.Z.ShopController.shopItems;v.default=function(){var _e=(0,l.useState)(!1),V=c()(_e,2),ae=V[0],b=V[1],oe=(0,l.useState)(!1),H=c()(oe,2),se=H[0],le=H[1],re=(0,l.useState)(!1),N=c()(re,2),Oe=N[0],de=N[1],g=(0,l.useRef)(),ie={id:"",shop_id:"",store_id:"",num:1},ue=(0,l.useState)(ie),G=c()(ue,2),J=G[0],me=G[1],ve=(0,l.useState)([]),Q=c()(ve,2),ce=Q[0],pe=Q[1],Ee=function(){var p=O()(s()().mark(function t(n){var u,E,h;return s()().wrap(function(M){for(;;)switch(M.prev=M.next){case 0:return M.next=2,ne(n);case 2:u=M.sent,E=u.success,E&&(b(!1),(h=g.current)===null||h===void 0||h.reload());case 5:case"end":return M.stop()}},t)}));return function(n){return p.apply(this,arguments)}}(),Pe=function(t){te({username:t}).then(function(n){var u,E=n.data,h=[];E==null||(u=E.data)===null||u===void 0||u.map(function(R){R.label="".concat(R.username," ").concat(R.mobile),h.push(R)}),pe(h)})},he={name:"file",action:"https://shopapi.houyi2023.cn/admin/device/import1",headers:{Authorization:"Bearer "+(0,A.LP)()},onChange:function(t){if(t.file.status!=="uploading"&&console.log(t.file,t.fileList),t.file.status==="done"){var n;C.ZP.success("".concat(t.file.name," \u5BFC\u5165\u6210\u529F")),(n=g.current)===null||n===void 0||n.reload()}else t.file.status==="error"&&C.ZP.error("".concat(t.file.name," \u4E0A\u4F20\u5931\u8D25"))}},De=[{title:"\u5E8F\u53F7",dataIndex:"id",search:!0,render:function(t,n){var u=[];return(0,_.jsx)("div",{children:n==null?void 0:n.id})}},{title:"\u5B89\u88C5\u65F6\u95F4",dataIndex:"install_time",search:!0,render:function(t,n){return n!=null&&n.install_time?z()((n==null?void 0:n.install_time)*1e3).format("YYYY-MM-DD HH:mm:ss"):"\u672A\u5B89\u88C5"}},{title:"\u540C\u6B65\u65F6\u95F4",dataIndex:"sync_time",search:!1,render:function(t,n){return n!=null&&n.sync_time?z()((n==null?void 0:n.sync_time)*1e3).format("YYYY-MM-DD HH:mm:ss"):""}},{title:"\u6869\u4E3B",dataIndex:"shop_id",search:!0,render:function(t,n){var u,E,h;return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)("div",{children:(0,_.jsx)(I.Z,{preview:!1,width:50,src:n==null||(u=n.shop)===null||u===void 0?void 0:u.avatar_url})}),(0,_.jsx)("div",{children:n==null||(E=n.shop)===null||E===void 0?void 0:E.username}),(0,_.jsx)("div",{children:n==null||(h=n.shop)===null||h===void 0?void 0:h.mobile})]})},renderFormItem:function(t,n,u){var E=n.type,h=n.defaultRender,R=n.formItemProps,M=n.fieldProps,j=f()(n,q);return(0,_.jsx)(L.Z,a()(a()({},M),{},{allowClear:!0,showSearch:!0,placeholder:"\u8BF7\u8F93\u5165\u7528\u6237\u540D",style:{width:"100%"},filterOption:!1,onSearch:function(Y){Y&&Pe(Y)},fieldNames:{label:"label",value:"id"},options:ce}))}},{title:"\u8BBE\u5907\u4FE1\u606F",dataIndex:"site_name",search:!0,render:function(t,n){return(0,_.jsxs)(_.Fragment,{children:[(0,_.jsxs)("div",{children:["\u8BBE\u5907\u53F7\uFF1A",n==null?void 0:n.device_no]}),(0,_.jsxs)("div",{children:["\u5C0F\u533A\uFF1A",n==null?void 0:n.site_name]}),(0,_.jsxs)("div",{children:["\u5730\u5740\uFF1A",n==null?void 0:n.address]})]})}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"created_at",search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(t,n){return(0,_.jsx)(S.Z,{children:(0,_.jsx)(x.Z,{action:"admin/device/setinfo",children:(0,_.jsx)(W.ZP,{type:"link",onClick:function(){me(n),b(!0)},children:"\u8BBE\u7F6E\u5730\u5740"})},"admin/device/setinfo")})}}];return(0,_.jsx)(T._z,{ghost:!0,children:(0,_.jsxs)(_.Fragment,{children:[(0,_.jsx)(w.default,{values:J,type:0,modalOpenState:se,onModalOpenState:le}),(0,_.jsx)(X.default,{values:J,modalOpenState:ae,onModalOpenState:b,onSubmit:Ee}),(0,_.jsx)(U.Z,{actionRef:g,rowKey:"id",search:{defaultCollapsed:!1},toolBarRender:function(){return[(0,_.jsx)(x.Z,{action:"admin/device/import1",children:(0,_.jsx)(K.Z,a()(a()({},he),{},{children:(0,_.jsx)(W.ZP,{icon:(0,_.jsx)(i.Z,{}),children:"\u5BFC\u5165\u6570\u636E"})}))},"admin/device/import1")]},request:function(){var p=O()(s()().mark(function t(n,u,E){var h,R,M,j,Z;return s()().wrap(function(F){for(;;)switch(F.prev=F.next){case 0:return F.next=2,ee(a()(a()({},n),{},{sorter:u,filter:E}));case 2:return M=F.sent,j=M.data,Z=M.success,F.abrupt("return",{data:(j==null||(h=j.items)===null||h===void 0?void 0:h.data)||[],total:j==null||(R=j.items)===null||R===void 0?void 0:R.total,success:Z});case 6:case"end":return F.stop()}},t)}));return function(t,n,u){return p.apply(this,arguments)}}(),columns:De,rowSelection:{onChange:function(t,n){de(t)}},tableAlertRender:function(t){var n=t.selectedRowKeys,u=t.selectedRows,E=t.onCleanSelected;return(0,_.jsxs)(S.Z,{size:24,children:[(0,_.jsxs)("span",{children:["\u5DF2\u9009 ",n.length," \u9879"]}),(0,_.jsx)("span",{children:(0,_.jsx)("a",{style:{marginInlineStart:8},onClick:E,children:"\u53D6\u6D88\u9009\u62E9"})})]})},tableAlertOptionRender:function(t){var n=t.selectedRowKeys,u=t.selectedRows,E=t.onCleanSelected;return(0,_.jsx)(S.Z,{size:16})},pagination:{showSizeChanger:!0}})]})})}}}]);