|
- (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[2580],{64317:function(Ve,ve,a){"use strict";var $=a(28991),Q=a(81253),ne=a(85893),xe=a(22270),T=a(67294),c=a(66758),V=a(31649),Fe=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","showSearch","options"],ue=["fieldProps","children","params","proFieldProps","mode","valueEnum","request","options"],Te=T.forwardRef(function(o,fe){var p=o.fieldProps,l=o.children,u=o.params,le=o.proFieldProps,oe=o.mode,re=o.valueEnum,q=o.request,U=o.showSearch,w=o.options,se=(0,Q.Z)(o,Fe),_=(0,T.useContext)(c.Z);return(0,ne.jsx)(V.Z,(0,$.Z)((0,$.Z)({valueEnum:(0,xe.h)(re),request:q,params:u,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,$.Z)({options:w,mode:oe,showSearch:U,getPopupContainer:_.getPopupContainer},p),ref:fe,proFieldProps:le},se),{},{children:l}))}),Se=T.forwardRef(function(o,fe){var p=o.fieldProps,l=o.children,u=o.params,le=o.proFieldProps,oe=o.mode,re=o.valueEnum,q=o.request,U=o.options,w=(0,Q.Z)(o,ue),se=(0,$.Z)({options:U,mode:oe||"multiple",labelInValue:!0,showSearch:!0,showArrow:!1,autoClearSearchValue:!0,optionLabelProp:"label"},p),_=(0,T.useContext)(c.Z);return(0,ne.jsx)(V.Z,(0,$.Z)((0,$.Z)({valueEnum:(0,xe.h)(re),request:q,params:u,valueType:"select",filedConfig:{customLightMode:!0},fieldProps:(0,$.Z)({getPopupContainer:_.getPopupContainer},se),ref:fe,proFieldProps:le},w),{},{children:l}))}),Ee=Te,X=Se,he=Ee;he.SearchSelect=X,he.displayName="ProFormComponent",ve.Z=he},19488:function(Ve,ve,a){"use strict";a.r(ve),a.d(ve,{default:function(){return Ue}});var $=a(71194),Q=a(50146),ne=a(11849),xe=a(43358),T=a(34041),c=a(39428),V=a(3182),Fe=a(57663),ue=a(71577),Te=a(62350),Se=a(24565),Ee=a(43185),X=a(93349),he=a(34792),o=a(48086),fe=a(9715),p=a(55843),l=a(2824),u=a(67294),le=a(28790),oe=a(85224),re=a(49101),q=a(16894),U=a(48971),w=a(96690);function se(x){return _.apply(this,arguments)}function _(){return _=(0,V.Z)((0,c.Z)().mark(function x(t){return(0,c.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,U.WY)((0,w.w)()+"/api/technology/page",{method:"POST",data:t}));case 1:case"end":return r.stop()}},x)})),_.apply(this,arguments)}function be(){return ye.apply(this,arguments)}function ye(){return ye=(0,V.Z)((0,c.Z)().mark(function x(){return(0,c.Z)().wrap(function(h){for(;;)switch(h.prev=h.next){case 0:return h.abrupt("return",(0,U.WY)((0,w.w)()+"/api/product/list",{method:"Get"}));case 1:case"end":return h.stop()}},x)})),ye.apply(this,arguments)}function Ae(x){return ge.apply(this,arguments)}function ge(){return ge=(0,V.Z)((0,c.Z)().mark(function x(t){return(0,c.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,U.WY)((0,w.w)()+"/api/devicevesion/getdevicevesion?productId="+t,{method:"Get"}));case 1:case"end":return r.stop()}},x)})),ge.apply(this,arguments)}function Re(x){return Ce.apply(this,arguments)}function Ce(){return Ce=(0,V.Z)((0,c.Z)().mark(function x(t){return(0,c.Z)().wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",(0,U.WY)((0,w.w)()+"/api/technology/delete?id="+t,{method:"Get"}));case 1:case"end":return r.stop()}},x)})),Ce.apply(this,arguments)}var qe=a(47673),me=a(4107),Be=a(64317),Me=a(76615),e=a(85893),we=function(t){var h=p.Z.useForm(),r=(0,l.Z)(h,1),te=r[0],f=u.useRef(null),ee=(0,u.useState)("text"),E=(0,l.Z)(ee,2),I=E[0],b=E[1],O=(0,u.useState)("Form"),A=(0,l.Z)(O,2),L=A[0],y=A[1],K=(0,u.useState)([]),R=(0,l.Z)(K,2),Y=R[0],J=R[1],G=(0,u.useState)(!1),B=(0,l.Z)(G,2),g=B[0],P=B[1],ae=(0,u.useState)(!1),N=(0,l.Z)(ae,2),j=N[0],M=N[1];(0,u.useEffect)(function(){var s;if((s=f.current)===null||s===void 0||s.setFieldsValue(t.values),t.createModalVisible)if(t.values.actionType==null){var v;(v=f.current)===null||v===void 0||v.setFieldsValue({actionType:"text"}),t.values.actionType="text",b("text"),y("Form"),J([])}else{var F;if((F=f.current)===null||F===void 0||F.setFieldsValue({actionType:t.values.actionType}),b(t.values.actionType),t.values.actionType=="select"){y("ModalForm");var W=[];if(t.values.technologyType==0)for(var k=JSON.parse(t.values.actionValue),D=0;D<k.length;D++)W.push({actionValueName:k[D].actionValueName});J(W)}else b(t.values.actionType),y("Form"),J([])}},[t.createModalVisible]);var C=function(v){if(console.log(JSON.stringify(v)),v){var F;(F=f.current)===null||F===void 0||F.setFieldsValue({actionValue:JSON.stringify(v)})}P(!1),o.default.success("\u4FDD\u5B58\u6210\u529F")},Z=[{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"}],z=[{dataIndex:"actionValue",valueType:"dependency",name:["valueType"],columns:function(v){var F=v.actionType;switch(console.log(I),I){case"select":return[{dataIndex:"list",valueType:"formList",initialValue:Y,columns:[{valueType:"group",columns:[{title:"\u9009\u9879\u540D\u79F0",dataIndex:"actionValueName",width:"md",disabled:!0,formItemProps:{rules:[{required:!0,message:"\u6B64\u9879\u4E3A\u5FC5\u586B\u9879"}]}}]}]},{renderFormItem:function(k,D,ie){return[(0,e.jsx)("div",{style:{float:"right"}})]}}];case"text":return[{dataIndex:"actionValue",valueType:"text",renderFormItem:function(){return(0,e.jsx)(me.Z,{placeholder:"\u8F93\u5165\u7C7B\u578B\u503C",disabled:!0})}}];default:return[{dataIndex:"actionValue",valueType:I,fieldProps:{disabled:!0}}]}}}];return(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(Q.Z,{title:"\u52A8\u4F5C\u914D\u7F6E",width:640,ref:f,visible:t==null?void 0:t.createModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){t==null||t.onCancel()},destroyOnClose:!0,maskClosable:!1,children:(0,e.jsxs)(p.Z,{layout:"vertical",preserve:!1,initialValues:t==null?void 0:t.values,onFinish:t==null?void 0:t.onFinish,ref:f,children:[(0,e.jsx)(p.Z.Item,{name:"id",hidden:!0,children:(0,e.jsx)(me.Z,{})}),(0,e.jsxs)(p.Z.Item,{children:[(0,e.jsx)(p.Z.Item,{name:"actionName",label:"\u6A21\u578B\u540D\u79F0",rules:[{required:!0,max:64,whitespace:!0}],children:(0,e.jsx)(me.Z,{placeholder:"\u8BF7\u8F93\u5165\u6A21\u578B\u540D\u79F0",disabled:!0})}),(0,e.jsx)(p.Z.Item,{name:"actionType",label:"\u8F93\u5165\u7C7B\u578B",rules:[{required:!0,max:64,whitespace:!0}],children:(0,e.jsx)(Be.Z,{options:Z,disabled:!0,fieldProps:{value:I,onChange:function(v){v=="select"?y("ModalForm"):y("Form"),b(v)}}})}),(0,e.jsx)(p.Z.Item,{name:"actionValue",label:"\u8F93\u5165\u7C7B\u578B\u63A7\u4EF6",children:(0,e.jsx)(Me.Z,{trigger:(0,e.jsx)("a",{onClick:function(){return P(!0)},children:"\u67E5\u770B\u9009\u9879"}),columns:z,layoutType:L,visible:g,modalProps:{forceRender:!0,onCancel:function(){return P(!1)}},onVisibleChange:function(v){M(v)},width:420,shouldUpdate:j,submitter:!1,style:{padding:"40px 10px 1px 10px;"}})}),(0,e.jsx)(p.Z.Item,{name:"sort",label:"\u6392\u5E8F",children:(0,e.jsx)(me.Z,{placeholder:"\u8BF7\u8F93\u5165\u6392\u5E8F",disabled:!0})})]})]})})})},Oe=we,_e=T.Z.Option,et=T.Z.OptGroup,Le=function(t){var h=(0,u.useState)([]),r=(0,l.Z)(h,2),te=r[0],f=r[1],ee=(0,u.useState)([]),E=(0,l.Z)(ee,2),I=E[0],b=E[1],O=(0,u.useRef)(),A=p.Z.useForm(),L=(0,l.Z)(A,1),y=L[0],K=(0,u.useState)(),R=(0,l.Z)(K,2),Y=R[0],J=R[1],G=(0,u.useState)(!1),B=(0,l.Z)(G,2),g=B[0],P=B[1],ae={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"}},N=[{title:"\u6A21\u578B\u540D\u79F0",dataIndex:"actionName",width:"15%"},{title:"\u8F93\u5165\u7C7B\u578B",key:"actionType",dataIndex:"actionType",valueType:"select",width:"15%",valueEnum:ae},{title:"\u8F93\u5165\u503C\u7C7B\u578B",dataIndex:"technologyType",valueType:"select",hideInSearch:!0,valueEnum:{"0":{text:" "},"1":{text:"\u7269\u6599"}}},{title:"\u6392\u5E8F",dataIndex:"sort",valueType:"digit",width:"8%"},{title:"\u64CD\u4F5C",valueType:"option",width:200,render:function(M,C,Z,z){return[(0,e.jsx)("a",{onClick:function(){P(!0),f(C)},children:"\u67E5\u770B"},"editable")]}}];return(0,e.jsx)(e.Fragment,{children:(0,e.jsxs)(Q.Z,{title:"\u6A21\u578B\u914D\u7F6E",width:1140,visible:t==null?void 0:t.actionFormModalVisible,bodyStyle:{padding:"32px 40px 1px 48px"},footer:null,onCancel:function(){t==null||t.onCancel()},destroyOnClose:!0,maskClosable:!1,children:[(0,e.jsx)(q.ZP,{rowKey:"id",headerTitle:"\u6A21\u578B\u914D\u7F6E\u5217\u8868",actionRef:O,pagination:!1,search:!1,toolBarRender:!1,columns:N,dataSource:t.dataSource}),(0,e.jsx)(Oe,{onFinish:function(){var j=(0,V.Z)((0,c.Z)().mark(function M(C){var Z;return(0,c.Z)().wrap(function(s){for(;;)switch(s.prev=s.next){case 0:if(Z=!1,console.log(C),console.log(C.actionValue),C.goodstechnologyId=t.values.id,!C.id){s.next=10;break}return s.next=7,handleUpdate(C);case 7:Z=s.sent,s.next=13;break;case 10:return s.next=12,onFinish(C);case 12:Z=s.sent;case 13:Z&&(P(!1),O.current&&O.current.reload());case 14:case"end":return s.stop()}},M)}));return function(M){return j.apply(this,arguments)}}(),onCancel:function(){f(void 0),P(!1)},createModalVisible:g,actionValueName:Y,values:te||{}})]})})},Ge=Le,Ne=function(t){var h=(0,u.useState)(!1),r=(0,l.Z)(h,2),te=r[0],f=r[1],ee=(0,u.useState)(!1),E=(0,l.Z)(ee,2),I=E[0],b=E[1],O=(0,u.useState)(!1),A=(0,l.Z)(O,2),L=A[0],y=A[1],K=(0,u.useRef)(),R=(0,u.useState)(),Y=(0,l.Z)(R,2),J=Y[0],G=Y[1],B=(0,u.useState)([]),g=(0,l.Z)(B,2),P=g[0],ae=g[1],N=(0,u.useState)([]),j=(0,l.Z)(N,2),M=j[0],C=j[1],Z=(0,u.useState)([]),z=(0,l.Z)(Z,2),s=z[0],v=z[1],F=[{title:"\u4E3B\u952E",dataIndex:"id",tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key",hideInSearch:!0,hideInTable:!0,render:function(k,D){return(0,e.jsx)("a",{onClick:function(){G(D),y(!0)},children:k})}},{title:"\u540D\u79F0",dataIndex:"name",valueType:"textarea",ellipsis:!0,search:!1},{title:"\u521B\u5EFA\u65F6\u95F4",dataIndex:"createAt",valueType:"date",hideInSearch:!0},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",render:function(k,D){return[(0,e.jsx)("a",{onClick:function(){var H,de;b(!0),G(D.technologyActionInfo),(H=K.current)===null||H===void 0||(de=H.reloadAndRest)===null||de===void 0||de.call(H)},children:"\u6A21\u578B\u914D\u7F6E"},"config")]}}];return(0,u.useEffect)(function(){},[]),(0,e.jsxs)(Q.Z,{title:"\u5DE5\u827A\u8BE6\u60C5",width:1040,visible:t.createModalVisible,bodyStyle:{padding:"32px 40px 48px"},footer:null,onCancel:function(){t.onCancel()},maskClosable:!1,destroyOnClose:!0,children:[(0,e.jsx)(q.ZP,{headerTitle:"\u5DE5\u827A",actionRef:K,rowKey:"id",search:!1,columns:F,toolBarRender:!1,dataSource:t.dataSource,rowSelection:!1}),(0,e.jsx)(Ge,{actionFormModalVisible:I,dataSource:J||{},onCancel:function(){G(void 0),b(!1)}})]})},We=Ne,tt="message",$e=function(){var t=(0,u.useState)(!1),h=(0,l.Z)(t,2),r=h[0],te=h[1],f=(0,u.useRef)(),ee=(0,u.useState)([]),E=(0,l.Z)(ee,2),I=E[0],b=E[1],O=(0,u.useState)([]),A=(0,l.Z)(O,2),L=A[0],y=A[1],K=(0,u.useState)(),R=(0,l.Z)(K,2),Y=R[0],J=R[1],G=(0,u.useState)([]),B=(0,l.Z)(G,2),g=B[0],P=B[1],ae=(0,u.useState)(!1),N=(0,l.Z)(ae,2),j=N[0],M=N[1],C=(0,u.useState)(!1),Z=(0,l.Z)(C,2),z=Z[0],s=Z[1],v=p.Z.useForm(),F=(0,l.Z)(v,1),W=F[0],k=(0,u.useState)(""),D=(0,l.Z)(k,2),ie=D[0],H=D[1],de=(0,u.useState)(""),Ie=(0,l.Z)(de,2),Pe=Ie[0],Ze=Ie[1],Ke=(0,u.useState)(""),je=(0,l.Z)(Ke,2),Ye=je[0],Je=je[1],ze={beforeUpload:function(n){return n.type!=="application/vnd.ms-excel"&&n.type!=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"&&o.default.error("".concat(n.name," \u4E0D\u662F exelce \u6587\u4EF6")),ie.length==0?(o.default.error("\u8BF7\u9009\u62E9\u7248\u672C"),X.Z.LIST_IGNORE,X.Z.LIST_IGNORE):Pe.length==0?(o.default.error("\u8BF7\u9009\u62E9\u4EA7\u54C1"),X.Z.LIST_IGNORE):n.type=="application/vnd.ms-excel"||n.type=="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"?!0:X.Z.LIST_IGNORE},name:"file",data:{id:ie,deviceClientType:Pe,version:Ye,isAddGoodsTemplate:z},action:(0,w.w)()+"/api/goods/goodstemplateexport",headers:{Authorization:"Bearer "+localStorage.getItem("token")},onChange:function(n){console.log(n),n.file.status!=="uploading"&&console.log(n.file,n.fileList),s(!1),n.file.status==="done"?(M(!1),f.current.reload(),o.default.success("".concat(n.file.name," \u6587\u4EF6\u4E0A\u4F20\u6210\u529F."))):n.file.status==="error"&&o.default.error("".concat(n.file.name," \u6587\u4EF6\u4E0A\u8F7D\u5931\u8D25."))}},ke=[{title:"\u4E3B\u952E",dataIndex:"id",hideInSearch:!0,hideInTable:!0,tip:"\u89C4\u5219\u540D\u79F0\u662F\u552F\u4E00\u7684 key"},{title:"\u6240\u5C5E\u4EA7\u54C1",dataIndex:"productName",valueType:"textarea"},{title:"\u7248\u672C\u53F7",dataIndex:"vesion",valueType:"textarea"},{title:"\u65F6\u95F4",dataIndex:"createAt",valueType:"textarea",search:!1},{title:"\u64CD\u4F5C",dataIndex:"option",valueType:"option",fixed:"right",width:700,render:function(n,d){return[(0,e.jsx)("a",{onClick:function(){te(!0),J(d.technologyInfo)},children:" \u8BE6\u60C5"},"config"),(0,e.jsx)("a",{href:d.templatePath,children:" \u4E0B\u8F7D"},"config"),(0,e.jsx)(Se.Z,{type:"primary",title:"\u786E\u8BA4\u5220\u9664\u5417\uFF1F",okText:"\u662F",cancelText:"\u5426",onConfirm:function(){Re(d.id).then(function(S){S.data?(o.default.success("\u5220\u9664\u6210\u529F"),f.current.reload()):o.default.error(S.errors)})},onCancel:function(){},children:(0,e.jsx)("a",{href:"#",children:"\u5220\u9664"})},"primary11")]}}];(0,u.useEffect)(function(){be().then(function(i){var n=i.data;if(i.succeeded){var d=[];n.forEach(function(m){d.push({label:m.name,text:m.name,id:m.id})}),b(d)}})},[]);var He=function(n){console.log("selected ".concat(n)),Ze(n),Ae(n).then(function(d){var m=d.data;if(d.succeeded){var S=[];m.forEach(function(pe){S.push({label:pe.vesion,text:pe.vesion,id:pe.id})}),y(S)}})},Qe=function(n){console.log("selected ".concat(n)),H(n);var d=L.find(function(m){return m.id==n});Je(d==null?void 0:d.label)},Xe=function(){console.log("ss"),Ze(""),H(""),y([]),te(!1)};return(0,e.jsxs)(le.ZP,{host:!0,header:{title:"",breadcrumb:{}},children:[(0,e.jsx)(q.ZP,{headerTitle:"\u8BBE\u5907\u7248\u672C",actionRef:f,rowKey:"id",pagination:{defaultPageSize:10},search:{labelWidth:120},toolBarRender:function(){return[(0,e.jsxs)(ue.Z,{type:"primary",onClick:function(){M(!0)},children:[(0,e.jsx)(re.Z,{})," \u5BFC\u5165\u5DE5\u827A\u6A21\u7248"]},"primary")]},request:function(){var i=(0,V.Z)((0,c.Z)().mark(function n(d){var m,S;return(0,c.Z)().wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:return m=[],S=0,ce.next=4,se(d).then(function(De){m=De.data.data,S=De.data.total});case 4:return ce.abrupt("return",{data:m,success:!0,total:S});case 5:case"end":return ce.stop()}},n)}));return function(n){return i.apply(this,arguments)}}(),columns:ke,rowSelection:{onChange:function(n,d){P(d)}}}),(g==null?void 0:g.length)>0&&(0,e.jsx)(oe.Z,{extra:(0,e.jsxs)("div",{children:["\u5DF2\u9009\u62E9"," ",(0,e.jsx)("a",{style:{fontWeight:600},children:g.length})," ","\u9879 \xA0\xA0"]}),children:(0,e.jsx)(ue.Z,{onClick:(0,V.Z)((0,c.Z)().mark(function i(){var n,d;return(0,c.Z)().wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return S.next=2,handleRemove(g);case 2:P([]),(n=f.current)===null||n===void 0||(d=n.reloadAndRest)===null||d===void 0||d.call(n);case 4:case"end":return S.stop()}},i)})),children:"\u5220\u9664"})}),(0,e.jsxs)(Q.Z,{title:"\u4E0A\u4F20\u5DE5\u827A\u6A21\u7248",open:j,footer:null,maskClosable:!1,destroyOnClose:!0,onCancel:function(){y(),Ze(""),H(""),M(!1)},children:[(0,e.jsxs)("div",{style:{marginBottom:10},children:[(0,e.jsx)("span",{style:{marginRight:10},children:"\u9009\u62E9\u4EA7\u54C1"}),(0,e.jsx)(T.Z,{style:{width:"60%"},onChange:He,children:I==null?void 0:I.map(function(i,n){return(0,e.jsx)(T.Z.Option,{index:n,value:i.id,children:i.label},i.id)})})]}),(0,e.jsxs)("div",{style:{marginBottom:10},children:[(0,e.jsx)("span",{style:{marginRight:10},children:"\u9009\u62E9\u7248\u672C"}),(0,e.jsx)(T.Z,{style:{width:"60%"},onChange:Qe,children:L==null?void 0:L.map(function(i,n){return(0,e.jsx)(T.Z.Option,{index:n,value:i.id,children:i.label},i.id)})})]}),(0,e.jsx)(X.Z,(0,ne.Z)((0,ne.Z)({},ze),{},{maxCount:1,children:(0,e.jsx)(ue.Z,{style:{marginLeft:"55%"},children:"\u5BFC\u5165\u5DE5\u827A\u6A21\u7248"})}))]}),(0,e.jsx)(We,{createModalVisible:r,dataSource:Y,onCancel:Xe})]})},Ue=$e}}]);
|