mirror of
https://gitee.com/270580156/weiyu.git
synced 2025-12-30 19:02:26 +00:00
1 line
23 KiB
JavaScript
1 line
23 KiB
JavaScript
"use strict";(self.webpackChunkadmin=self.webpackChunkadmin||[]).push([[3505],{11090:function(e,t,a){a.d(t,{Z:function(){return o}});var r=a(83910),n=a(44194),i={icon:{tag:"svg",attrs:{"fill-rule":"evenodd",viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 912H144c-17.7 0-32-14.3-32-32V144c0-17.7 14.3-32 32-32h360c4.4 0 8 3.6 8 8v56c0 4.4-3.6 8-8 8H184v656h656V520c0-4.4 3.6-8 8-8h56c4.4 0 8 3.6 8 8v360c0 17.7-14.3 32-32 32zM770.87 199.13l-52.2-52.2a8.01 8.01 0 014.7-13.6l179.4-21c5.1-.6 9.5 3.7 8.9 8.9l-21 179.4c-.8 6.6-8.9 9.4-13.6 4.7l-52.4-52.4-256.2 256.2a8.03 8.03 0 01-11.3 0l-42.4-42.4a8.03 8.03 0 010-11.3l256.1-256.3z"}}]},name:"export",theme:"outlined"},s=a(54183),c=function(e,t){return n.createElement(s.Z,(0,r.Z)({},e,{ref:t,icon:i}))};var o=n.forwardRef(c)},2484:function(e,t,a){a.d(t,{Z:function(){return o}});var r=a(83910),n=a(44194),i={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M456 231a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0zm0 280a56 56 0 10112 0 56 56 0 10-112 0z"}}]},name:"more",theme:"outlined"},s=a(54183),c=function(e,t){return n.createElement(s.Z,(0,r.Z)({},e,{ref:t,icon:i}))};var o=n.forwardRef(c)},437:function(e,t,a){a.d(t,{GF:function(){return g},Nf:function(){return d},TM:function(){return p},XX:function(){return k},w_:function(){return h}});var r=a(90819),n=a.n(r),i=a(73193),s=a.n(i),c=a(89933),o=a.n(c),l=a(39497),u=a(14906);function d(e){return f.apply(this,arguments)}function f(){return(f=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/appeal/query/org",{method:"GET",params:s()({},t)}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return m.apply(this,arguments)}function m(){return(m=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/appeal/create",{method:"POST",data:s()(s()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e){return y.apply(this,arguments)}function y(){return(y=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/appeal/delete",{method:"POST",data:s()(s()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function g(e){return x.apply(this,arguments)}function x(){return(x=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/appeal/approve",{method:"POST",data:s()(s()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function k(e){return M.apply(this,arguments)}function M(){return(M=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/appeal/reject",{method:"POST",data:s()(s()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},34642:function(e,t,a){a.d(t,{EP:function(){return d},md:function(){return p},t7:function(){return h}});var r=a(90819),n=a.n(r),i=a(73193),s=a.n(i),c=a(89933),o=a.n(c),l=a(39497),u=a(14906);function d(e){return f.apply(this,arguments)}function f(){return(f=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/check/query/org",{method:"GET",params:s()({},t)}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function p(e){return m.apply(this,arguments)}function m(){return(m=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/check/create",{method:"POST",data:s()(s()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e){return y.apply(this,arguments)}function y(){return(y=o()(n()().mark((function e(t){return n()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",(0,u.request)("/api/v1/quality/check/delete",{method:"POST",data:s()(s()({},t),{},{channel:l.XtJ})}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}},89139:function(e,t,a){a.r(t),a.d(t,{default:function(){return K}});var r=a(73193),n=a.n(r),i=a(84176),s=a.n(i),c=a(10154),o=a.n(c),l=a(86222),u=a.n(l),d=a(90819),f=a.n(d),p=a(89933),m=a.n(p),h=a(45332),y=a.n(h),g=a(44194),x=a(81739),k=a(78578),M=a(63649),v=a(82770),q=a(86895),b=a(2907),j=a(80556),S=a(11090),w=a(54881),Z=a(2484),E=a(89246),A=a(14906),I=a(34642),L=a(98830),P=a(96596),C=a.n(P),T=a(19433),z=a(85245),R=a(32525),O=a(41196),F=a(59533),D=a(82864),N=a(40110),Y=a(40122),B=a(34201),_=a(79489),H=a(94447),X=a(437),J=a(39497),V=a(31549),W=R.Z.TextArea,G=function(e){var t=e.visible,a=e.onClose,r=e.record,n=e.onSuccess,i=(0,A.useIntl)(),s=O.Z.useForm(),c=y()(s,1)[0],o=(0,g.useState)(!1),l=y()(o,2),u=l[0],d=l[1],p=(0,L.u)((function(e){return e.currentOrg})),h=function(){var e=m()(f()().mark((function e(){var t,s,o;return f()().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,c.validateFields();case 3:return t=e.sent,d(!0),s={qualityCheckUid:null==r?void 0:r.uid,comment:t.comment,orgUid:null==p?void 0:p.uid},e.next=8,(0,X.TM)(s);case 8:200===(o=e.sent).code?(F.ZP.success(i.formatMessage({id:"quality.appeal.create.success",defaultMessage:"申诉提交成功"})),c.resetFields(),a(),null==n||n()):F.ZP.error(o.message||i.formatMessage({id:"quality.appeal.create.error",defaultMessage:"申诉提交失败"})),e.next=16;break;case 12:e.prev=12,e.t0=e.catch(0),console.error("Create appeal error:",e.t0),F.ZP.error(i.formatMessage({id:"quality.appeal.create.error",defaultMessage:"申诉提交失败"}));case 16:return e.prev=16,d(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[0,12,16,19]])})));return function(){return e.apply(this,arguments)}}(),k=function(){c.resetFields(),a()};return(0,V.jsx)(D.Z,{title:i.formatMessage({id:"quality.appeal.create",defaultMessage:"创建申诉"}),width:600,open:t,onClose:k,footer:(0,V.jsxs)("div",{style:{textAlign:"right"},children:[(0,V.jsx)(v.ZP,{onClick:k,style:{marginRight:8},children:i.formatMessage({id:"cancel"})}),(0,V.jsx)(v.ZP,{type:"primary",loading:u,onClick:h,children:i.formatMessage({id:"submit"})})]}),children:r&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(N.Z,{title:i.formatMessage({id:"quality.check.basic.info"}),size:"small",style:{marginBottom:16},children:(0,V.jsxs)(Y.Z,{column:2,size:"small",children:[(0,V.jsx)(Y.Z.Item,{label:i.formatMessage({id:"quality.check.uid"}),children:r.uid}),(0,V.jsx)(Y.Z.Item,{label:i.formatMessage({id:"quality.check.type"}),children:function(){var e=J.DMM[r.type]||"blue",t=r.type;switch(r.type){case J.fmk.ONLINE_SERVICE:t=i.formatMessage({id:"quality.check.type.onlineService"});break;case J.fmk.BOT:t=i.formatMessage({id:"quality.check.type.bot"});break;case J.fmk.CALL_CENTER:t=i.formatMessage({id:"quality.check.type.callCenter"});break;default:t=r.type||i.formatMessage({id:"quality.check.type.onlineService"})}return(0,V.jsx)(x.Z,{color:e,children:t})}()}),(0,V.jsx)(Y.Z.Item,{label:i.formatMessage({id:"quality.check.createdAt"}),children:r.createdAt?C()(r.createdAt).format("YYYY-MM-DD HH:mm:ss"):"-"}),(0,V.jsx)(Y.Z.Item,{label:i.formatMessage({id:"quality.check.updatedAt"}),children:r.updatedAt?C()(r.updatedAt).format("YYYY-MM-DD HH:mm:ss"):"-"})]})}),(0,V.jsx)(N.Z,{title:i.formatMessage({id:"quality.check.score.statistics"}),size:"small",style:{marginBottom:16},children:(0,V.jsxs)(B.Z,{gutter:16,children:[(0,V.jsx)(_.Z,{span:8,children:(0,V.jsx)(H.Z,{title:i.formatMessage({id:"quality.check.totalScore"}),value:r.totalScore||0,valueStyle:{color:(r.totalScore||0)>=90?"#52c41a":(r.totalScore||0)>=80?"#1890ff":"#faad14",fontWeight:"bold"}})}),(0,V.jsx)(_.Z,{span:8,children:(0,V.jsx)(H.Z,{title:i.formatMessage({id:"quality.check.bonusScore"}),value:r.bonusScore||0,valueStyle:{color:"#52c41a"}})}),(0,V.jsx)(_.Z,{span:8,children:(0,V.jsx)(H.Z,{title:i.formatMessage({id:"quality.check.deductionScore"}),value:r.deductionScore||0,valueStyle:{color:"#ff4d4f"}})})]})}),r.indicators&&r.indicators.length>0&&(0,V.jsx)(N.Z,{title:i.formatMessage({id:"quality.check.indicators.details",defaultMessage:"质检指标详情"}),size:"small",style:{marginBottom:16},children:(0,V.jsx)("div",{children:r.indicators.map((function(e,t){return(0,V.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"8px 0",borderBottom:t<r.indicators.length-1?"1px solid #f0f0f0":"none"},children:[(0,V.jsxs)("div",{style:{flex:1},children:[(0,V.jsxs)("div",{style:{display:"flex",alignItems:"center",marginBottom:"4px"},children:[(0,V.jsx)("span",{style:{fontWeight:"bold",marginRight:"8px"},children:e.indicatorName}),e.mandatory&&(0,V.jsx)(x.Z,{color:"red",style:{fontSize:"12px"},children:i.formatMessage({id:"quality.indicator.mandatory",defaultMessage:"必检"})}),e.deduction?(0,V.jsx)(x.Z,{color:"red",style:{fontSize:"12px"},children:i.formatMessage({id:"quality.indicator.deduction",defaultMessage:"减分项"})}):(0,V.jsx)(x.Z,{color:"green",style:{fontSize:"12px"},children:i.formatMessage({id:"quality.indicator.bonus",defaultMessage:"加分项"})})]}),e.description&&(0,V.jsx)("div",{style:{color:"#666",fontSize:"12px"},children:e.description})]}),(0,V.jsx)("div",{style:{textAlign:"right",minWidth:"80px"},children:(0,V.jsxs)("span",{style:{fontSize:"16px",fontWeight:"bold",color:e.deduction?"#ff4d4f":"#52c41a"},children:[e.deduction?"-":"+",e.indicatorScore||0,"分"]})})]},t)}))})}),r.comment&&(0,V.jsx)(N.Z,{title:i.formatMessage({id:"quality.check.comment"}),size:"small",style:{marginBottom:16},children:(0,V.jsx)("div",{style:{background:"#f5f5f5",padding:"12px",borderRadius:"4px"},children:r.comment})}),(0,V.jsx)(N.Z,{title:i.formatMessage({id:"quality.appeal.form",defaultMessage:"申诉信息"}),size:"small",children:(0,V.jsx)(O.Z,{form:c,layout:"vertical",children:(0,V.jsx)(O.Z.Item,{name:"comment",label:i.formatMessage({id:"quality.appeal.comment"}),rules:[{required:!0,message:i.formatMessage({id:"quality.appeal.comment.required",defaultMessage:"请输入申诉理由"})},{min:10,message:i.formatMessage({id:"quality.appeal.comment.min",defaultMessage:"申诉理由至少需要10个字符"})}],children:(0,V.jsx)(W,{rows:6,placeholder:i.formatMessage({id:"quality.appeal.comment.placeholder",defaultMessage:"请详细说明申诉理由,包括对质检结果的不同意见和依据..."}),showCount:!0,maxLength:500})})})})]})})},U=["current","pageSize"],K=function(){var e=(0,A.useIntl)(),t=(0,g.useRef)(),a=(0,g.useState)([]),r=y()(a,2),i=r[0],c=r[1],l=(0,g.useState)([]),d=y()(l,2),p=d[0],h=d[1],P=(0,L.u)((function(e){return e.currentOrg})),R=(0,g.useState)(!1),O=y()(R,2),F=O[0],D=O[1],N=(0,g.useState)(null),Y=y()(N,2),B=Y[0],_=Y[1],H=(0,g.useState)(!1),X=y()(H,2),W=X[0],K=X[1],Q=(0,g.useState)(null),$=y()(Q,2),ee=$[0],te=$[1],ae=function(){var a=m()(f()().mark((function a(r){var n;return f()().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,(0,I.t7)({uid:r.uid});case 3:200===a.sent.code?(null==t||null===(n=t.current)||void 0===n||n.reload(),T.yw.success(e.formatMessage({id:"quality.check.delete.success"}))):T.yw.error(e.formatMessage({id:"quality.check.delete.error"})),a.next=11;break;case 7:a.prev=7,a.t0=a.catch(0),T.yw.error(e.formatMessage({id:"quality.check.delete.error"})),console.error("Delete quality check error:",a.t0);case 11:case"end":return a.stop()}}),a,null,[[0,7]])})));return function(e){return a.apply(this,arguments)}}(),re=function(){var a=m()(f()().mark((function a(){var r,n,i,s,o,l;return f()().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(0!==p.length){a.next=3;break}return T.yw.warning(e.formatMessage({id:"quality.check.batch.delete.noselection"})),a.abrupt("return");case 3:T.yw.loading(e.formatMessage({id:"quality.check.deleting"})),n=0,i=0,s=u()(p),a.prev=7,s.s();case 9:if((o=s.n()).done){a.next=23;break}return l=o.value,a.prev=11,a.next=14,(0,I.t7)({uid:l.uid});case 14:200===a.sent.code?n++:i++,a.next=21;break;case 18:a.prev=18,a.t0=a.catch(11),i++;case 21:a.next=9;break;case 23:a.next=28;break;case 25:a.prev=25,a.t1=a.catch(7),s.e(a.t1);case 28:return a.prev=28,s.f(),a.finish(28);case 31:T.yw.destroy(),0===i?T.yw.success(e.formatMessage({id:"quality.check.batch.delete.success"},{count:n})):T.yw.warning(e.formatMessage({id:"quality.check.batch.delete.partial"},{success:n,fail:i})),c([]),h([]),null===(r=t.current)||void 0===r||r.reloadAndRest();case 36:case"end":return a.stop()}}),a,null,[[7,25,28,31],[11,18]])})));return function(){return a.apply(this,arguments)}}(),ne=[{dataIndex:"index",valueType:"indexBorder",width:48,fixed:"left"},{title:(0,V.jsx)(A.FormattedMessage,{id:"uid"}),dataIndex:"uid",copyable:!0,fixed:"left",ellipsis:!0,hideInSearch:!0,tooltip:(0,V.jsx)(A.FormattedMessage,{id:"queue.member.nickname.tooltip"}),render:function(e,t){return t.uid||"-"}},{title:(0,V.jsx)(A.FormattedMessage,{id:"queue.member.agent"}),dataIndex:"agentNickname",key:"agentNickname",ellipsis:!0,hideInSearch:!0,tooltip:(0,V.jsx)(A.FormattedMessage,{id:"queue.member.agent.tooltip"}),render:function(e,t){var a,r,n=null===(a=t.queueMember)||void 0===a||null===(a=a.thread)||void 0===a||null===(a=a.robotProtobuf)||void 0===a?void 0:a.nickname,i=null===(r=t.queueMember)||void 0===r||null===(r=r.thread)||void 0===r||null===(r=r.agentProtobuf)||void 0===r?void 0:r.nickname;return n&&i?"".concat(n," / ").concat(i):n||(i||"-")}},{title:(0,V.jsx)(A.FormattedMessage,{id:"queue.member.nickname"}),dataIndex:"visitorNickname",key:"visitorNickname",ellipsis:!0,search:!0,tooltip:(0,V.jsx)(A.FormattedMessage,{id:"queue.member.nickname.tooltip"}),render:function(e,t){var a;return(null===(a=t.queueMember)||void 0===a||null===(a=a.thread)||void 0===a||null===(a=a.user)||void 0===a?void 0:a.nickname)||"-"}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.type"}),dataIndex:"type",key:"type",width:120,tooltip:e.formatMessage({id:"quality.check.type.tooltip"}),valueEnum:o()(o()(o()({},J.fmk.ONLINE_SERVICE,{text:e.formatMessage({id:"quality.check.type.onlineService"}),status:"Processing"}),J.fmk.BOT,{text:e.formatMessage({id:"quality.check.type.bot"}),status:"Success"}),J.fmk.CALL_CENTER,{text:e.formatMessage({id:"quality.check.type.callCenter"}),status:"Warning"}),render:function(t){var a=J.DMM[t]||"blue",r=t;switch(t){case J.fmk.ONLINE_SERVICE:r=e.formatMessage({id:"quality.check.type.onlineService"});break;case J.fmk.BOT:r=e.formatMessage({id:"quality.check.type.bot"});break;case J.fmk.CALL_CENTER:r=e.formatMessage({id:"quality.check.type.callCenter"});break;default:r=t||e.formatMessage({id:"quality.check.type.onlineService"})}return(0,V.jsx)(x.Z,{color:a,children:r})}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.status"}),dataIndex:"status",key:"status",width:100,search:!0,tooltip:e.formatMessage({id:"quality.check.status.tooltip"}),valueEnum:o()(o()(o()(o()(o()({},J.izL.COMPLETED,{text:e.formatMessage({id:"quality.check.status.completed"}),status:"Success"}),J.izL.APPEALING,{text:e.formatMessage({id:"quality.check.status.appealing"}),status:"Processing"}),J.izL.APPEAL_APPROVED,{text:e.formatMessage({id:"quality.check.status.appealApproved"}),status:"Success"}),J.izL.APPEAL_REJECTED,{text:e.formatMessage({id:"quality.check.status.appealRejected"}),status:"Error"}),J.izL.CLOSED,{text:e.formatMessage({id:"quality.check.status.closed"}),status:"Default"}),render:function(t){var a=J.EtT[t]||"default",r=t;switch(t){case J.izL.COMPLETED:r=e.formatMessage({id:"quality.check.status.completed"});break;case J.izL.APPEALING:r=e.formatMessage({id:"quality.check.status.appealing"});break;case J.izL.APPEAL_APPROVED:r=e.formatMessage({id:"quality.check.status.appealApproved"});break;case J.izL.APPEAL_REJECTED:r=e.formatMessage({id:"quality.check.status.appealRejected"});break;case J.izL.CLOSED:r=e.formatMessage({id:"quality.check.status.closed"});break;default:r=t||e.formatMessage({id:"quality.check.status.completed"})}return(0,V.jsx)(x.Z,{color:a,children:r})}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.totalScore"}),dataIndex:"totalScore",key:"totalScore",width:80,hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.totalScore.tooltip"}),render:function(e){return(0,V.jsx)("span",{style:{fontWeight:"bold",color:e>=90?"#52c41a":e>=80?"#1890ff":"#faad14"},children:e||0})}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.bonusScore"}),dataIndex:"bonusScore",key:"bonusScore",width:80,hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.bonusScore.tooltip"}),render:function(e){return(0,V.jsx)("span",{style:{color:"#52c41a"},children:e||0})}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.deductionScore"}),dataIndex:"deductionScore",key:"deductionScore",width:80,hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.deductionScore.tooltip"}),render:function(e){return(0,V.jsx)("span",{style:{color:"#ff4d4f"},children:e||0})}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.qualityLevel"}),dataIndex:"qualityLevel",key:"qualityLevel",width:100,hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.qualityLevel.tooltip"}),render:function(t){var a=J.S6D[t]||"default",r=t;switch(t){case J.YRj.EXCELLENT:r=e.formatMessage({id:"quality.check.qualityLevel.excellent"});break;case J.YRj.GOOD:r=e.formatMessage({id:"quality.check.qualityLevel.good"});break;case J.YRj.PASS:r=e.formatMessage({id:"quality.check.qualityLevel.pass"});break;case J.YRj.FAIL:r=e.formatMessage({id:"quality.check.qualityLevel.fail"});break;default:r=t||"-"}return(0,V.jsx)(x.Z,{color:a,children:r})}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.indicators"}),dataIndex:"indicators",key:"indicators",width:400,hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.indicators.tooltip"}),render:function(e,t){var a=t.indicators||[],r=a.length>3;return(0,V.jsx)(k.Z,{title:(0,V.jsx)("div",{children:a.map((function(e,t){return(0,V.jsx)("div",{style:{marginBottom:"4px"},children:(0,V.jsxs)(x.Z,{color:e.deduction?"red":"green",style:{marginRight:"4px"},children:[e.indicatorName,e.indicatorScore&&"(".concat(e.deduction?"-":"+").concat(e.indicatorScore,"分)")]})},t)}))}),placement:"topLeft",children:(0,V.jsxs)("div",{style:{cursor:"pointer"},children:[a.slice(0,3).map((function(e,t){return(0,V.jsxs)(x.Z,{color:e.deduction?"red":"green",style:{marginBottom:"2px",marginRight:"4px"},children:[e.indicatorName,e.indicatorScore&&"(".concat(e.deduction?"-":"+").concat(e.indicatorScore,"分)")]},t)})),r&&(0,V.jsxs)(x.Z,{color:"default",style:{marginBottom:"2px"},children:["+",a.length-3]})]})})}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.comment"}),dataIndex:"comment",key:"comment",width:180,hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.comment.tooltip"})},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.createdAt"}),dataIndex:"createdAt",key:"createdAt",width:180,valueType:"dateTime",hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.createdAt.tooltip"}),render:function(e,t){return t.createdAt?C()(t.createdAt).format("YYYY-MM-DD HH:mm:ss"):"-"}},{title:(0,V.jsx)(A.FormattedMessage,{id:"quality.check.updatedAt"}),dataIndex:"updatedAt",key:"updatedAt",width:180,valueType:"dateTime",hideInSearch:!0,tooltip:e.formatMessage({id:"quality.check.updatedAt.tooltip"}),render:function(e,t){return t.updatedAt?C()(t.updatedAt).format("YYYY-MM-DD HH:mm:ss"):"-"}},{title:e.formatMessage({id:"actions"}),valueType:"option",key:"option",width:180,fixed:"right",render:function(t,a,r,n){return[(0,V.jsx)("a",{onClick:function(){!function(e){_(e),D(!0)}(a)},children:e.formatMessage({id:"view"})},"view"),(0,V.jsx)("a",{onClick:function(){!function(e){te(e),K(!0)}(a)},children:e.formatMessage({id:"quality.appeal.create",defaultMessage:"申诉"})},"appeal"),(0,V.jsx)(M.Z,{title:e.formatMessage({id:"deleteTip"}),description:e.formatMessage({id:"quality.check.delete.confirm"},{uid:null==a?void 0:a.uid}),onConfirm:function(){return ae(a)},okText:e.formatMessage({id:"ok"}),cancelText:e.formatMessage({id:"cancel"}),children:(0,V.jsx)(v.ZP,{size:"small",type:"link",danger:!0,children:e.formatMessage({id:"delete"})})},"delete")]}}],ie={selectedRowKeys:i,onChange:function(e,t){c(e),h(t)}},se=function(){var t=m()(f()().mark((function t(a,r,i){var c,o,l,u,d,p,m,h;return f()().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return console.log("request:",a,r,i),T.yw.loading(e.formatMessage({id:"quality.check.loading"})),c=a.current,o=a.pageSize,l=s()(a,U),u=void 0,d=void 0,r&&Object.keys(r).length>0&&(p=Object.keys(r)[0],u=p,d="ascend"===r[p]?"ascend":"descend"),m=n()(n()({pageNumber:c-1,pageSize:o},l),{},{sortBy:u,sortDirection:d,orgUid:null==P?void 0:P.uid}),t.prev=7,t.next=10,(0,I.EP)(m);case 10:if(h=t.sent,console.log("queryQualityChecksByOrg response:",h.data,m),T.yw.destroy(),200!==h.code||!h.data){t.next=17;break}return t.abrupt("return",{data:h.data.content||[],success:!0,total:h.data.totalElements||0});case 17:return T.yw.error(h.message||e.formatMessage({id:"quality.check.fetch.error"})),t.abrupt("return",{data:[],success:!1,total:0});case 19:t.next=27;break;case 21:return t.prev=21,t.t0=t.catch(7),T.yw.destroy(),T.yw.error(e.formatMessage({id:"quality.check.fetch.error"})),console.error("Fetch quality checks error:",t.t0),t.abrupt("return",{data:[],success:!1,total:0});case 27:case"end":return t.stop()}}),t,null,[[7,21]])})));return function(e,a,r){return t.apply(this,arguments)}}();return(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(E.Z,{columns:ne,actionRef:t,cardBordered:!0,rowSelection:ie,request:se,scroll:{x:2400},rowKey:"uid",search:{labelWidth:"auto"},pagination:{pageSize:10},dateFormatter:"string",headerTitle:e.formatMessage({id:"quality.check.management"}),toolBarRender:function(){return function(){var a=[];a.push((0,V.jsx)(v.ZP,{icon:(0,V.jsx)(j.Z,{}),onClick:function(){var e;return null===(e=t.current)||void 0===e?void 0:e.reload()},children:e.formatMessage({id:"refresh"})},"refresh")),a.push((0,V.jsx)(v.ZP,{icon:(0,V.jsx)(S.Z,{}),type:"primary",onClick:function(){T.yw.info(e.formatMessage({id:"quality.check.export.info"}))},children:e.formatMessage({id:"export"})},"export"));var r=[];return i.length>0&&r.push({key:"batchDelete",icon:(0,V.jsx)(w.Z,{}),danger:!0,label:e.formatMessage({id:"quality.check.batch.delete"})+" (".concat(i.length,")"),onClick:function(){q.Z.confirm({title:e.formatMessage({id:"deleteTip"}),content:e.formatMessage({id:"quality.check.batch.delete.confirm"},{count:i.length}),onOk:re,okText:e.formatMessage({id:"ok"}),cancelText:e.formatMessage({id:"cancel"})})}}),r.length>0&&a.push((0,V.jsx)(b.Z,{menu:{items:r},placement:"bottom",children:(0,V.jsxs)(v.ZP,{type:i.length>0?"primary":"default",danger:i.length>0,children:[i.length>0?e.formatMessage({id:"quality.check.batch.operations"})+" (".concat(i.length,")"):e.formatMessage({id:"more.operations"}),(0,V.jsx)(Z.Z,{})]})},"batchOperations")),a}()}}),(0,V.jsx)(z.Z,{visible:F,onClose:function(){D(!1),_(null)},record:B}),(0,V.jsx)(G,{visible:W,onClose:function(){K(!1),te(null)},record:ee,onSuccess:function(){var e;null===(e=t.current)||void 0===e||e.reload()}})]})}}}]); |