PageSourceSearch

https://dashboard.waffo.com/app/p__marketing__promotion-codes__list__index.135eae1d.async.js

js waffo.com collected 2026-09-24 12:20:14 UTC 7,977 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkwaffo_merchant_web=self.webpackChunkwaffo_merchant_web||[]).push([[8234],{30603:function(B,p,t){t.d(p,{O:function(){return I}});var s=t(39740),_=t(1573),I=function(v){var u=v.newActive,m=v.onOk;_.Z.confirm({title:u?(0,s.tr)("promotionCode.activateTitle"):(0,s.tr)("promotionCode.deactivateTitle"),content:u?(0,s.tr)("promotionCode.activateConfirm"):(0,s.tr)("promotionCode.deactivateConfirm"),onOk:m})}},58278:function(B,p,t){t.r(p);var s=t(26068),_=t.n(s),I=t(48305),M=t.n(I),v=t(56568),u=t(51540),m=t(21858),b=t(77488),D=t(25914),n=t(39740),l=t(90304),a=t(17023),c=t(12197),g=t(59280),k=t(54702),C=t(48615),w=t(45552),j=t(7692),z=t(86520),L=t(451),$=t(7966),F=t(30603),G=t(35748),e=t(52676),V=[{value:"true",label:(0,n.tr)("i18n.active.a733b80")},{value:"false",label:(0,n.tr)("i18n.inactive.09af574")}],J=function(P){return P?P.split(/,\s*/).map(function(y){var E=y.trim(),f=E.match(/^perCustomer\s*=\s*(\d+)/i);if(f)return(0,n.tr)("promotionCode.perCustomerLimit",{count:f[1]});var A=E.match(/^minimumAmount(?:\s*=\s*|\s*:\s*)?(.*)$/i);if(A){var T,h=(T=A[1])===null||T===void 0?void 0:T.trim();return h?"".concat((0,n.tr)("promotionCode.minimumAmount"),": ").concat(h):(0,n.tr)("promotionCode.minimumAmount")}return/^firstTimeTransaction$/i.test(E)?(0,n.tr)("promotionCode.firstTimeTransactionOnly"):E}).join(", "):"\u2014"};function H(){var x,P,y=C.Z.useForm(),E=M()(y,1),f=E[0],A=(0,c.useSearchParams)(),T=M()(A,1),h=T[0],Q=h.get("couponId")||h.get("coupon_id")||void 0,X=h.get("batchId")||void 0,Y=(0,c.useModel)("permission",function(r){return{permission:r.permission}}),O=Y.permission,q=!!(O!=null&&O.API_MARKETING_COUPONS_CREATE),oo=!!(O!=null&&O.API_MARKETING_COUPONS_LIST),U=(0,g.Z)(function(){return(0,b.KV)({pageNum:1,pageSize:100})}),Z=(((x=U.data)===null||x===void 0?void 0:x.list)||[]).reduce(function(r,o){return r[o.couponId]=o,r},{}),W=function(){var o=f.getFieldsValue();return{code:o.code||void 0,couponId:o.couponId||void 0,batchId:o.batchId||X,active:o.status===void 0?void 0:o.status==="true"}},K=(0,k.Z)(function(r){return(0,D.PK)(_()(_()({},W()),{},{pageNum:r.current,pageSize:r.pageSize}))},{defaultPageSize:10,form:f}),to=K.tableProps,S=K.search,no=K.refresh,eo=(0,g.Z)(D.JO,{manual:!0}),N=(0,g.Z)(function(){return(0,D.d$)(W())},{manual:!0}),ro=function(){N.runAsync().then(function(o){var d,i,R=(0,l.L)(o==null||(d=o.data)===null||d===void 0?void 0:d.fileUrl,o==null||(i=o.data)===null||i===void 0?void 0:i.exportTaskId);R&&(window.location.href=R)})},ao=function(o){var d=!o.active;(0,F.O)({newActive:d,onOk:function(){return eo.runAsync({promotionCodeId:o.promotionCodeId,active:d}).then(function(){w.ZP.success(d?(0,n.tr)("promotionCode.activated"):(0,n.tr)("promotionCode.deactivated")),no()}).catch(function(){})}})},io=(((P=U.data)===null||P===void 0?void 0:P.list)||[]).map(function(r){return{value:r.couponId,label:r.name}}),so=[{title:(0,n.tr)("i18n.code.adac693"),dataIndex:"code",key:"code",render:function(o){return(0,e.jsx)("span",{className:"font-bold",children:o})}},{title:(0,n.tr)("i18n.coupon.31943e5"),dataIndex:"couponId",key:"couponId",render:function(o,d){var i=Z[o],R=d.couponName||(i==null?void 0:i.name)||o;return(0,e.jsx)(u.zx,{type:"link",onClick:function(){return c.history.push("".concat(m.Z.MARKETING_COUPONS_DETAIL,"?couponId=").concat(encodeURIComponent(o)))},children:R})}},{title:(0,n.tr)("i18n.discount.b524936"),key:"discount",render:function(o,d){var i=Z[d.couponId];return i?(0,e.jsx)($.V,{discountType:i.discountType,discountValue:i.discountValue,currencyOptions:i.currencyOptions}):"\u2014"}},{title:(0,n.tr)("i18n.redeemed.35cc3d7"),dataIndex:"timesRedeemed",key:"timesRedeemed",render:function(o,d){var i;return(0,e.jsxs)("span",{children:[o!=null?o:0," / ",(i=d.maxRedemptions)!==null&&i!==void 0?i:"\u221E"]})}},{title:(0,n.tr)("i18n.restrictions.38ad851"),dataIndex:"restrictionSummary",key:"restrictionSummary",render:function(o){return J(o)}},{title:(0,n.tr)("i18n.status.bae7d5b"),dataIndex:"active",key:"active",render:function(o){return(0,e.jsx)(u.Vp,{color:o?"success":"default",hasIcon:!1,children:o?(0,n.tr)("i18n.active.a733b80"):(0,n.tr)("i18n.inactive.09af574")})}},{title:(0,n.tr)("i18n.expires.a99be3d"),dataIndex:"expiresAt",key:"expiresAt",render:function(o){return(0,G.cv)(o)}},{title:(0,n.tr)("i18n.action.97c89a4"),key:"action",fixed:"right",render:function(o,d){return(0,e.jsxs)(j.Z,{children:[(0,e.jsx)(u.zx,{type:"link",onClick:function(){return c.history.push("".concat(m.Z.MARKETING_PROMOTION_CODES_DETAIL,"?promotionCodeId=").concat(encodeURIComponent(d.promotionCodeId)))},children:(0,n.tr)("i18n.view.69bd4ef")}),(0,e.jsx)(u.zx,{type:"link",onClick:function(){return ao(d)},children:d.active?(0,n.tr)("promotionCode.deactivate"):(0,n.tr)("promotionCode.activate")})]})}}];return(0,e.jsxs)(v.Z,{title:(0,n.tr)("i18n.promotion.codes.1eb840f"),extra:q?(0,e.jsxs)(j.Z,{children:[(0,e.jsx)(u.zx,{onClick:function(){return c.history.push(m.Z.MARKETING_PROMOTION_CODES_BATCH_TASKS)},children:(0,n.tr)("i18n.batch.tasks.fd5750a")}
1),(0,e.jsx)(u.zx,{onClick:function(){return c.history.push(m.Z.MARKETING_PROMOTION_CODES_BATCH_CREATE)},children:(0,n.tr)("i18n.batch.create.0b50c28")}),(0,e.jsx)(u.zx,{type:"primary",onClick:function(){return c.history.push(m.Z.MARKETING_PROMOTION_CODES_CREATE)},children:(0,n.tr)("i18n.create.code.8073a07")})]}):null,children:[(0,e.jsx)("div",{className:"text-secondary mb-12",children:(0,n.tr)("i18n.manage.codes.that.customers.use.to.redeem.coupons.05ca1ab")}),(0,e.jsxs)(C.Z,{form:f,layout:"inline",className:"mb-16 gap-8",initialValues:{couponId:Q},children:[(0,e.jsx)(C.Z.Item,{name:"code",className:"mb-0 min-w-[240px]",children:(0,e.jsx)(z.Z,{prefix:(0,e.jsx)(a.Z,{className:"text-secondary"}),placeholder:(0,n.tr)("i18n.search.by.code.a8854d5"),allowClear:!0,onChange:S.submit})}),(0,e.jsx)(C.Z.Item,{name:"couponId",className:"mb-0 min-w-[200px]",children:(0,e.jsx)(L.Z,{options:io,placeholder:(0,n.tr)("i18n.all.coupons.f9fe4f3"),allowClear:!0,showSearch:!0,optionFilterProp:"label",onChange:S.submit})}),(0,e.jsx)(C.Z.Item,{name:"status",className:"mb-0 min-w-[160px]",children:(0,e.jsx)(L.Z,{options:V,placeholder:(0,n.tr)("i18n.status.bae7d5b"),allowClear:!0,onChange:S.submit})}),oo&&(0,e.jsx)(C.Z.Item,{className:"mb-0 ml-auto",children:(0,e.jsx)(u.zx,{onClick:ro,loading:N.loading,children:(0,n.tr)("i18n.export.f3e4fad")})})]}),(0,e.jsx)(u.iA,_()(_()({columns:so},to),{},{rowKey:"promotionCodeId"}))]})}p.default=H},25914:function(B,p,t){t.d(p,{JE:function(){return b},JO:function(){return v},PK:function(){return _},d$:function(){return u},gs:function(){return M},kg:function(){return n},ly:function(){return I},z8:function(){return m}});var s=t(95965),_=function(a){return(0,s.Z)({method:"POST",url:"/promotion/web/v1/coupons/promotion-code/list",data:a}).then(function(c){return{total:c.data.total,list:c.data.records}})},I=function(a){return(0,s.Z)({method:"POST",url:"/promotion/web/v1/coupons/promotion-code/query",data:{promotionCodeId:a}})},M=function(a){return(0,s.Z)({method:"POST",url:"/promotion/web/v1/coupons/promotion-code/create",data:a,showErrorMessage:!0})},v=function(a){return(0,s.Z)({method:"POST",url:"/promotion/web/v1/coupons/promotion-code/status/update",data:a,showErrorMessage:!0})},u=function(a){return(0,s.Z)({method:"POST",url:"/promotion/web/v1/coupons/promotion-code/export",data:a,showErrorMessage:!0})},m=function(a){return(0,s.Z)({method:"POST",url:"/promotion/web/v1/coupons/promotion-codes/batch/preview",data:a,showErrorMessage:!0})},b=function(a){return(0,s.Z)({method:"POST",url:"/promotion/web/v1/coupons/promotion-codes/batch",data:a,showErrorMessage:!0})},D=function(a){return ajax({method:"POST",url:"/promotion/web/v1/coupons/promotion-codes/batch/query",data:{taskId:a}})},n=function(a){return(0,s.Z)({method:"POST",url:"/promotion/web/v1/coupons/promotion-codes/batch/list",data:a}).then(function(c){return{total:c.data.total,list:c.data.records}})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.