Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

p__device__devicetechnology.0ee3d0f2.async.js 22 KiB

pirms 11 mēnešiem
1
  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[4685],{64317:function(De,ae,s){"use strict";var $=s(28991),B=s(81253),he=s(85893),z=s(22270),v=s(67294),fe=s(66758),ne=s(31649),r=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],Se=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],y=v.forwardRef(function(Z,ue){var U=Z.fieldProps,le=Z.children,C=Z.params,ie=Z.proFieldProps,I=Z.mode,se=Z.valueEnum,b=Z.request,T=Z.showSearch,Q=Z.options,K=(0,B.Z)(Z,r),X=(0,v.useContext)(fe.Z);return(0,he.jsx)(ne.Z,(0,$.Z)((0,$.Z)({valueEnum:(0,z.h)(se),request:b,params:C,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,$.Z)({options:Q,mode:I,showSearch:T,getPopupContainer:X.getPopupContainer},U),ref:ue,proFieldProps:ie},K),{},{children:le}))}),g=v.forwardRef(function(Z,ue){var U=Z.fieldProps,le=Z.children,C=Z.params,ie=Z.proFieldProps,I=Z.mode,se=Z.valueEnum,b=Z.request,T=Z.options,Q=(0,B.Z)(Z,Se),K=(0,$.Z)({options:T,mode:I||"multiple",labelInValue:!0,showSearch:!0,showArrow:!1,autoClearSearchValue:!0,optionLabelProp:"label"},U),X=(0,v.useContext)(fe.Z);return(0,he.jsx)(ne.Z,(0,$.Z)((0,$.Z)({valueEnum:(0,z.h)(se),request:b,params:C,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,$.Z)({getPopupContainer:X.getPopupContainer},K),ref:ue,proFieldProps:ie},Q),{},{children:le}))}),re=y,p=g,H=re;H.SearchSelect=p,H.displayName="ProFormComponent",ae.Z=H},10060:function(De,ae,s){"use strict";s.r(ae),s.d(ae,{default:function(){return Ye}});var $=s(57663),B=s(71577),he=s(62350),z=s(24565),v=s(2824),fe=s(43185),ne=s(93009),r=s(39428),Se=s(34792),y=s(48086),g=s(3182),re=s(49101),p=s(67294),H=s(78009),Z=s(16894),ue=s(71194),U=s(50146),le=s(9715),C=s(55843),ie=s(47673),I=s(4107),se=s(43358),b=s(34041),T=s(48971);function Q(u){return K.apply(this,arguments)}function K(){return K=(0,g.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,T.WY)("/kitchen/api/goodstechnology/getGoodstechnologypage",{method:"Post",data:e}));case 1:case"end":return a.stop()}},u)})),K.apply(this,arguments)}function X(u){return ve.apply(this,arguments)}function ve(){return ve=(0,g.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,T.WY)("/kitchen/api/goodstechnology/addgoodstechnology",{method:"Post",data:e}));case 1:case"end":return a.stop()}},u)})),ve.apply(this,arguments)}function Te(u){return pe.apply(this,arguments)}function pe(){return pe=(0,g.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,T.WY)("/kitchen/api/goodstechnology/updategoodstechnology",{method:"Post",data:e}));case 1:case"end":return a.stop()}},u)})),pe.apply(this,arguments)}function Pe(u){return me.apply(this,arguments)}function me(){return me=(0,g.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,T.WY)("/kitchen/api/goodstechnology/deletegoodstechnology",{method:"Post",data:e}));case 1:case"end":return a.stop()}},u)})),me.apply(this,arguments)}function be(u){return ye.apply(this,arguments)}function ye(){return ye=(0,g.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,T.WY)("/kitchen/api/goodstechnology/gettechnologyactionList?GoodstechnologyId="+e,{method:"Get"}));case 1:case"end":return a.stop()}},u)})),ye.apply(this,arguments)}function Ee(u){return ge.apply(this,arguments)}function ge(){return ge=(0,g.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,T.WY)("/kitchen/api/goodstechnology/addtechnologyaction",{method:"Post",data:e}));case 1:case"end":return a.stop()}},u)})),ge.apply(this,arguments)}function Ve(u){return Ze.apply(this,arguments)}function Ze(){return Ze=(0,g.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,T.WY)("/kitchen/api/goodstechnology/updatetechnologyaction",{method:"Post",data:e}));case 1:case"end":return a.stop()}},u)})),Ze.apply(this,arguments)}function Ie(u){return Fe.apply(this,arguments)}function Fe(){return Fe=(0,g.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,T.WY)("/kitchen/api/goodstechnology/deletetechnologyaction",{method:"Post",data:e}));case 1:case"end":return a.stop()}},u)})),Fe.apply(this,arguments)}function Re(u){return Ce.apply(this,arguments)}function Ce(){return Ce=(0,g.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,T.WY)("/kitchen/api/dict-data/dic-list/".concat(e),{method:"Get"}));case 1:case"end":return a.stop()}},u)})),Ce.apply(this,arguments)}function Be(u){return xe.apply(this,arguments)}function xe(){return xe=(0,g.Z)((0,r.Z)().mark(function u(e){return(0,r.Z)().wrap(function(a){for(;;)switch(a.prev=a.next){case 0:return a.abrupt("return",(0,T.WY)("/kitchen/api/DeviceVesion/GetDeviceVesion?Code=".concat(e),{method:"Get"}));case 1:case"end":return a.stop()}},u)})),xe.apply(this,arguments)}var t=s(85893),Ae=function(e){var h,a,l=b.Z.Option,F=b.Z.OptGroup,W=(0,p.useState)([]),A=(0,v.Z)(W,2),O=A[0],M=A[1],E=function(R){Be(R).then(function(w){M(w.data)})};return(0,t.jsx)(U.Z,{title:e!=null&&(h=e.values)!==null&&h!==void 0&&h.id?"\u7F16\u8F91":"\u65B0\u5EFA",width:640,visible:e==null?void 0:e.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){e==null||e.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,t.jsxs)(C.Z,{layout:"vertical",preserve:!1,initialValues:e==null?void 0:e.values,onFinish:e==null?void 0:e.onFinish,children:[(0,t.jsx)(C.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(I.Z,{})}),(0,t.jsx)(C.Z.Item,{name:"name",label:"\u5DE5\u827A\u540D\u79F0",rules:[{required:!0,max:64,whitespace:!0}],children:(0,t.jsx)(I.Z,{placeholder:"\u8BF7\u8F93\u5165\u5DE5\u827A\u540D\u79F0"})}),(0,t.jsx)(C.Z.Item,{label:"\u8BBE\u5907\u7C7B\u578B",name:"deviceType",rules:[{required:!0,max:50}],children:(0,t.jsx)(b.Z,{onChange:E,children:e.dicData.map(function(D,R){return(0,t.jsx)(b.Z.Option,{index:R,value:D.code,children:D.value},D.code)})})}),(0,t.jsx)(C.Z.Item,{label:"\u8BBE\u5907\u7248\u672C",name:"deviceVersionKey",rules:[{required:!0}],children:(0,t.jsx)(b.Z,{children:O.map(function(D,R){return(0,t.jsx)(b.Z.Option,{index:R,value:D.id,children:D.vesion},D.id)})})}),(0,t.jsx)(C.Z.Item,{name:"status",label:"\u72B6\u6001",defaultValue:e==null||(a=e.values)===null||a===void 0?void 0:a.status,rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u72B6\u6001"}],children:(0,t.jsxs)(b.Z,{placeholder:"\u8BF7\u9009\u62E9\u72B6\u6001",children:[(0,t.jsx)(l,{value:"0",children:"\u6B63\u5E38"}),(0,t.jsx)(l,{value:"1",children:"\u505C\u7528"})]})}),(0,t.jsx)(C.Z.Item,{name:"foreignKeyRe",label:"\u5173\u8054\u5916\u952E",rules:[{required:!1}],children:(0,t.jsx)(I.Z,{placeholder:"\u8BF7\u8F93\u5165\u5173\u8054\u5916\u952E"})}),(0,t.jsxs)(C.Z.Item,{children:[(0,t.jsx)(B.Z,{htmlType:"button",style:{float:"right",left:10},onClick:e.onCancel,children:"\u53D6\u6D88"}),(0,t.jsx)(B.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})},Oe=Ae,ke=s(64317),Me=s(64107),$e=function(e){var h=C.Z.useForm(),a=(0,v.Z)(h,1),l=a[0],F=p.useRef(null),W=(0,p.useState)("text"),A=(0,v.Z)(W,2),O=A[0],M=A[1],E=(0,p.useState)("Form"),D=(0,v.Z)(E,2),R=D[0],w=D[1],q=(0,p.useState)([]),L=(0,v.Z)(q,2),J=L[0],V=L[1],_=(0,p.useState)(!1),G=(0,v.Z)(_,2),oe=G[0],k=G[1],ee=(0,p.useState)(!1),Y=(0,v.Z)(ee,2),ce=Y[0],de=Y[1];(0,p.useEffect)(function(){var o;if((o=F.current)===null||o===void 0||o.setFieldsValue(e.values),e.createModalVisible)if(e.values.actionType==null){var c;(c=F.current)===null||c===void 0||c.setFieldsValue({actionType:"text"}),e.values.actionType="text",M("text"),w("Form"),V([])}else{var n;if((n=F.current)===null||n===void 0||n.setFieldsValue({actionType:e.values.actionType}),M(e.values.actionType),e.values.actionType=="select"){w("ModalForm");for(var i=[],f=JSON.parse(e.values.actionValue),m=0;m<f.length;m++)i.push({actionValueName:f[m].actionValueName});V(i)}else M(e.values.actionType),w("Form"),V([])}},[e.createModalVisible]);var te=function(c){if(console.log(JSON.stringify(c)),c){var n;(n=F.current)===null||n===void 0||n.setFieldsValue({actionValue:JSON.stringify(c)})}k(!1),y.default.success("\u4FDD\u5B58\u6210\u529F")},j=[{value:"text",label:"\u6587\u672C\u6846"},{value:"select",label:"\u4E0B\u62C9\u6846"},{value:"textarea",label:"\u6587\u672C\u57DF"},{value:"digit",label:"\u6570\u5B57\u8F93\u5165\u6846"},{value:"switch",label:"\u5F00\u5173"}],x=[{dataIndex:"actionValue",valueType:"dependency",name:["valueType"],columns:function(c){var n=c.actionType;switch(console.log(O),O){case"select":return[{dataIndex:"list",valueType:"formList",initialValue:J,columns:[{valueType:"group",columns:[{title:"\u9009\u9879\u540D\u79F0",dataIndex:"actionValueName",width:"md",formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}}]}]},{renderFormItem:function(f,m,d){return[(0,t.jsx)("div",{style:{float:"right"},children:(0,t.jsx)(B.Z,{type:"primary",style:{"margin-left":"5px"},onClick:function(){var P,N;return te(d==null||(P=d.formRef)===null||P===void 0||(N=P.current)===null||N===void 0?void 0:N.getFieldValue("list")),!0},children:"\u4FDD\u5B58"})})]}}];case"text":return[{dataIndex:"actionValue",valueType:"text",renderFormItem:function(){return(0,t.jsx)(I.Z,{placeholder:"\u8F93\u5165\u7C7B\u578B\u503C",disabled:!0})}}];default:return[{dataIndex:"actionValue",valueType:O,fieldProps:{disabled:!0}}]}}}];return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(U.Z,{title:"\u52A8\u4F5C\u914D\u7F6E",width:640,ref:F,visible:e==null?void 0:e.createModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){e==null||e.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,t.jsxs)(C.Z,{layout:"vertical",preserve:!1,initialValues:e==null?void 0:e.values,onFinish:e==null?void 0:e.onFinish,ref:F,children:[(0,t.jsx)(C.Z.Item,{name:"id",hidden:!0,children:(0,t.jsx)(I.Z,{})}),(0,t.jsxs)(C.Z.Item,{children:[(0,t.jsx)(C.Z.Item,{name:"actionName",label:"\u6A21\u578B\u540D\u79F0",rules:[{required:!0,max:64,whitespace:!0}],children:(0,t.jsx)(I.Z,{placeholder:"\u8BF7\u8F93\u5165\u6A21\u578B\u540D\u79F0"})}),(0,t.jsx)(C.Z.Item,{name:"actionType",label:"\u8F93\u5165\u7C7B\u578B",rules:[{required:!0,max:64,whitespace:!0}],children:(0,t.jsx)(ke.Z,{options:j,fieldProps:{value:O,onChange:function(c){c=="select"?w("ModalForm"):w("Form"),M(c)}}})}),(0,t.jsx)(C.Z.Item,{name:"actionValue",label:"\u8F93\u5165\u7C7B\u578B\u63A7\u4EF6",children:(0,t.jsx)(Me.Z,{trigger:(0,t.jsx)("a",{onClick:function(){return k(!0)},children:"\u6DFB\u52A0\u9009\u9879"}),columns:x,layoutType:R,visible:oe,modalProps:{forceRender:!0,onCancel:function(){return k(!1)}},onVisibleChange:function(c){de(c)},width:420,shouldUpdate:ce,submitter:!1,style:{padding:"40px 10px 1px 10px;"}})}),(0,t.jsx)(C.Z.Item,{name:"sort",label:"\u6392\u5E8F",children:(0,t.jsx)(I.Z,{placeholder:"\u8BF7\u8F93\u5165\u6392\u5E8F"})}),(0,t.jsx)(B.Z,{htmlType:"button",style:{float:"right",left:10},onClick:e.onCancel,children:"\u53D6\u6D88"}),(0,t.jsx)(B.Z,{type:"primary",htmlType:"submit",style:{float:"right"},children:"\u4FDD\u5B58"})]})]})})})},We=$e,Je=b.Z.Option,ze=b.Z.OptGroup,Le=function(e){var h=(0,p.useState)([]),a=(0,v.Z)(h,2),l=a[0],F=a[1],W=(0,p.useState)([]),A=(0,v.Z)(W,2),O=A[0],M=A[1],E=(0,p.useRef)(),D=C.Z.useForm(),R=(0,v.Z)(D,1),w=R[0],q=(0,p.useState)(),L=(0,v.Z)(q,2),J=L[0],V=L[1],_=(0,p.useState)(!1),G=(0,v.Z)(_,2),oe=G[0],k=G[1],ee={text:{value:"text",text:"\u6587\u672C\u6846"},select:{value:"select",text:"\u4E0B\u62C9\u6846"},textarea:{value:"textarea",text:"\u6587\u672C\u57DF"},digit:{value:"digit",text:"\u6570\u5B57\u8F93\u5165\u6846"},switch:{value:"switch",text:"\u5F00\u5173"}},Y=[{title:"\u6A21\u578B\u540D\u79F0",dataIndex:"actionName",width:"15%"},{title:"\u8F93\u5165\u7C7B\u578B",key:"actionType",dataIndex:"actionType",valueType:"select",width:"15%",valueEnum:ee},{title:"\u6392\u5E8F",dataIndex:"sort",valueType:"digit",width:"8%"},{title:"\u64CD\u4F5C",valueType:"option",width:200,render:function(x,o,c,n){return[(0,t.jsx)("a",{onClick:function(){k(!0),F(o)},children:"\u7F16\u8F91"},"editable"),(0,t.jsx)(z.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var f;te([o.id]),(f=E.current)===null||f===void 0||f.reloadAndRest()},onCancel:function(){},children:(0,t.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary"),,]}}],ce=function(){var j=(0,g.Z)((0,r.Z)().mark(function x(o){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return console.log(o),n.next=3,Ee(JSON.stringify(o)).then(function(i){i.data?y.default.success("\u6DFB\u52A0\u6210\u529F"):y.default.error(i.errors)});case 3:return n.abrupt("return",!0);case 4:case"end":return n.stop()}},x)}));return function(o){return j.apply(this,arguments)}}(),de=function(){var j=(0,g.Z)((0,r.Z)().mark(function x(o){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,Ve(JSON.stringify(o)).then(function(i){i.data?y.default.success("\u4FEE\u6539\u6210\u529F"):y.default.error(i.errors)});case 2:return n.abrupt("return",!0);case 3:case"end":return n.stop()}},x)}));return function(o){return j.apply(this,arguments)}}(),te=function(){var j=(0,g.Z)((0,r.Z)().mark(function x(o){return(0,r.Z)().wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,Ie(o).then(function(i){i.data?(y.default.success("\u5220\u9664\u6210\u529F"),E.current.reload()):y.default.error(i.errors)}),n.abrupt("return",!0);case 5:n.prev=5,n.t0=n.catch(0),y.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");case 8:case"end":return n.stop()}},x,null,[[0,5]])}));return function(o){return j.apply(this,arguments)}}();return(0,t.jsx)(t.Fragment,{children:(0,t.jsxs)(U.Z,{title:"\u6A21\u578B\u914D\u7F6E",width:1140,visible:e==null?void 0:e.actionFormModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){e==null||e.onCancel()},destroyOnClose:!0,maskClosable:!1,children:[(0,t.jsx)(Z.ZP,{rowKey:"id",headerTitle:"\u6A21\u578B\u914D\u7F6E\u5217\u8868",actionRef:E,pagination:!1,search:!1,toolBarRender:function(){return[(0,t.jsxs)(B.Z,{type:"primary",onClick:function(){k(!0),F({})},children:[(0,t.jsx)(re.Z,{})," \u65B0\u5EFA"]},"primary")]},columns:Y,request:(0,g.Z)((0,r.Z)().mark(function j(){var x;return(0,r.Z)().wrap(function(c){for(;;)switch(c.prev=c.next){case 0:return x=[],console.log(e.values.id),c.next=4,be(e.values.id).then(function(n){x=n.data});case 4:return c.abrupt("return",{data:x,success:!0});case 5:case"end":return c.stop()}},j)}))}),(0,t.jsx)(We,{onFinish:function(){var j=(0,g.Z)((0,r.Z)().mark(function x(o){var c;return(0,r.Z)().wrap(function(i){for(;;)switch(i.prev=i.next){case 0:if(c=!1,console.log(o),console.log(o.actionValue),o.goodstechnologyId=e.values.id,!o.id){i.next=10;break}return i.next=7,de(o);case 7:c=i.sent,i.next=13;break;case 10:return i.next=12,ce(o);case 12:c=i.sent;case 13:c&&(k(!1),E.current&&E.current.reload());case 14:case"end":return i.stop()}},x)}));return function(x){return j.apply(this,arguments)}}(),onCancel:function(){F(void 0),k(!1)},createModalVisible:oe,actionValueName:J,values:l||{}})]})})},Ge=Le,Ne=function(){var u=(0,g.Z)((0,r.Z)().mark(function e(h){return(0,r.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,l.next=3,X(JSON.stringify(h)).then(function(F){F.data?y.default.success("\u6DFB\u52A0\u6210\u529F"):y.default.error(F.errors)});case 3:return l.abrupt("return",!0);case 6:return l.prev=6,l.t0=l.catch(0),y.default.error("\u6DFB\u52A0\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),l.abrupt("return",!1);case 10:case"end":return l.stop()}},e,null,[[0,6]])}));return function(h){return u.apply(this,arguments)}}(),Ue=function(){var u=(0,g.Z)((0,r.Z)().mark(function e(h){return(0,r.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,Pe(h).then(function(F){F.data?y.default.success("\u5220\u9664\u6210\u529F"):y.default.error(F.errors)}),l.abrupt("return",!0);case 5:l.prev=5,l.t0=l.catch(0),y.default.error("\u5220\u9664\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5");case 8:case"end":return l.stop()}},e,null,[[0,5]])}));return function(h){return u.apply(this,arguments)}}(),He={beforeUpload:function(e){return e.type!=="application/vnd.ms-excel"&&e.type!=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"&&y.default.error("".concat(e.name," \u4E0D\u662F exelce \u6587\u4EF6")),e.type=="application/vnd.ms-excel"||e.type=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?!0:ne.Z.LIST_IGNORE},name:"file",action:"/kitchen/api/goodes/DeviceVersionTemplateImport",headers:{Authorization:"Bearer "+localStorage.getItem("token")},onChange:function(e){e.file.status!=="uploading"&&console.log(e.file,e.fileList),e.file.status==="done"?y.default.success("".concat(e.file.name," file uploaded successfully")):e.file.status==="error"&&y.default.error("".concat(e.file.name," file upload failed."))}},je=function(){var u=(0,g.Z)((0,r.Z)().mark(function e(h){return(0,r.Z)().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,Te(h).then(function(F){F.data?y.default.success("\u4FEE\u6539\u6210\u529F"):y.default.error(F.errors)}),l.abrupt("return",!0);case 5:return l.prev=5,l.t0=l.catch(0),y.default.error("\u4FEE\u6539\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01"),l.abrupt("return",!1);case 9:case"end":return l.stop()}},e,null,[[0,5]])}));return function(h){return u.apply(this,arguments)}}(),Ke=function(){var e=(0,p.useState)(!1),h=(0,v.Z)(e,2),a=h[0],l=h[1],F=(0,p.useState)(!1),W=(0,v.Z)(F,2),A=W[0],O=W[1],M=(0,p.useState)(!1),E=(0,v.Z)(M,2),D=E[0],R=E[1],w=(0,p.useRef)(),q=(0,p.useState)(),L=(0,v.Z)(q,2),J=L[0],V=L[1],_=(0,p.useState)([]),G=(0,v.Z)(_,2),oe=G[0],k=G[1],ee=(0,p.useState)([]),Y=(0,v.Z)(ee,2),ce=Y[0],de=Y[1],te=(0,p.useState)([]),j=(0,v.Z)(te,2),x=j[0],o=j[1],c=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(i,f){return(0,t.jsx)("a",{onClick:function(){V(f),R(!0)},children:i})}},{title:"\u540D\u79F0",dataIndex:"name",valueType:"textarea",ellipsis:!0,search:!0},{title:"\u5173\u8054\u5916\u952E",dataIndex:"foreignKeyRe",valueType:"textarea",ellipsis:!0,search:!0},{title:"\u8BBE\u5907\u7C7B\u578B",dataIndex:"deviceTypeKey",valueType:"textarea",ellipsis:!0,search:!0},{title:"\u7248\u672C",dataIndex:"vesion",valueType:"textarea",ellipsis:!0,search:!0},{title:"\u72B6\u6001",dataIndex:"status",hideInForm:!0,search:!0,valueEnum:{0:{text:"\u6B63\u5E38",status:"Processing"},1:{text:"\u505C\u7528",status:"Success"}}},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"date",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(i,f){return[(0,t.jsx)("a",{onClick:(0,g.Z)((0,r.Z)().mark(function m(){var d;return(0,r.Z)().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return d=0,f.status==0&&(d=1),V(f.status=d),P.next=5,je(f).then(function(N){N?w.current.reload():y.default.error("\u914D\u7F6E\u5931\u8D25\u8BF7\u91CD\u8BD5\uFF01")});case 5:case"end":return P.stop()}},m)})),children:f.status==0?"\u505C\u7528":"\u4F7F\u7528"},"state"),(0,t.jsx)("a",{onClick:function(){var d,S;l(!0),V(f),(d=w.current)===null||d===void 0||(S=d.reloadAndRest)===null||S===void 0||S.call(d)},children:"\u66F4\u65B0"},"config"),(0,t.jsx)("a",{onClick:function(){var d,S;O(!0),V(f),(d=w.current)===null||d===void 0||(S=d.reloadAndRest)===null||S===void 0||S.call(d)},children:"\u6A21\u578B\u914D\u7F6E"},"config"),(0,t.jsx)(z.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){var d;Ue([f.id]),(d=w.current)===null||d===void 0||d.reloadAndRest()},onCancel:function(){},children:(0,t.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary")]}}];return(0,p.useEffect)(function(){Re("DeviceClientType").then(function(n){var i=n.data,f={};if(n.succeeded){var m=[];i.forEach(function(d){f[d.code]={text:d.code},m.push({code:d.code,value:d.code})}),o(m)}})},[]),(0,t.jsxs)(H.ZP,{children:[(0,t.jsx)(Z.ZP,{headerTitle:"\u5DE5\u827A",actionRef:w,rowKey:"id",search:{labelWidth:120},columns:c,toolBarRender:function(){return[(0,t.jsxs)(B.Z,{type:"primary",onClick:function(){l(!0),V({})},children:[(0,t.jsx)(re.Z,{})," \u65B0\u5EFA"]},"primary")]},request:function(){var n=(0,g.Z)((0,r.Z)().mark(function i(f){var m,d;return(0,r.Z)().wrap(function(P){for(;;)switch(P.prev=P.next){case 0:return m=[],d=0,P.next=4,Q(f).then(function(N){m=N.data.data,m.forEach(function(we){we.status=we.status.toString()}),d=N.data.total});case 4:return P.abrupt("return",{data:m,success:!0,total:d});case 5:case"end":return P.stop()}},i)}));return function(i){return n.apply(this,arguments)}}(),rowSelection:{onChange:function(i,f){k(f)}}}),(0,t.jsx)(Oe,{onFinish:function(){var n=(0,g.Z)((0,r.Z)().mark(function i(f){var m;return(0,r.Z)().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(m=!1,!f.id){S.next=7;break}return S.next=4,je(f);case 4:m=S.sent,S.next=10;break;case 7:return S.next=9,Ne(f);case 9:m=S.sent;case 10:m&&(l(!1),w.current&&w.current.reload());case 11:case"end":return S.stop()}},i)}));return function(i){return n.apply(this,arguments)}}(),onCancel:function(){V(void 0),l(!1)},createModalVisible:a,values:J||{},dicData:x}),(0,t.jsx)(Ge,{actionFormModalVisible:A,values:J||{},onCancel:function(){V(void 0),O(!1)}})]})},Ye=Ke}}]);