(self["webpackChunkautoshopee_kit"]=self["webpackChunkautoshopee_kit"]||[]).push([[3546],{23546:function(t,e,a){"use strict";a.r(e),a.d(e,{default:function(){return w}});var i=function(){var t=this,e=t._self._c;return e("layout-single",[e("template",{slot:"header"},[e("h1",{staticClass:"text-warning"},[e("i",{staticClass:"fa fa-location-arrow",attrs:{"aria-hidden":"true"}}),e("span",{staticClass:"ml-5"},[t._v(t._s(t.$t("SHOPEE_ADS")))])])]),e("div",[e("wrap-require-paid",[e("Row",[e("Col",{attrs:{span:24}},[e("ads-list")],1)],1)],1)],1)],2)},n=[],s=function(){var t=this,e=t._self._c;return e("div",[e("Table",{attrs:{loading:t.tableCampagin.loading,columns:t.tableCampagin.column,data:t.tableCampagin.data,"highlight-row":"",size:"small"},scopedSlots:t._u([{key:"name",fn:function({row:a}){return[e("a",{attrs:{href:"#"},on:{click:function(e){return t.openCampagin(a.id)}}},[t._v(t._s(a.name)+" ")])]}}])})],1)},r=[],o=a(18182),l=a(19387),p=a(51579),c=a.n(p),d=a(61833),u=a(75511),m=(0,u.aZ)({data(){return{tableCampagin:{column:d.JR,data:[],loading:!0},query:{limit:10,page:0,state:"all",type:"",search:""}}},methods:{openCampagin(t){return this.openExternalUrl(this.createPopupUrl(`/shopee/ads/${t}`))},async getList(){this.tableCampagin.loading=!0;const t=await(0,o.EF)(this.query.limit,this.query.page,this.query.state,this.query.type,this.query.search);this.tableCampagin.data=t.map(((t,e)=>{const a=t.product.images?t.product.images.split(",")[0]:"",i=c().get(t,"advertisements[1].extinfo.keywords",[]),n={index:e+1,id:t.campaign.campaignid,type:this.$t(`SHOPEE_ADS_TYPE_BY.${t.campaign.type}`),state:this.$t(`SHOPEE_ADS_STATE_BY.${t.campaign.state}`),name:t.product.name||this.getShopeeShopName,itemid:t.product.itemid,stock:t.product.stock,image:a?(0,l.sQ)(a):this.getShopeeShopImage,timeStart:(0,d.bt)(t.campaign.start_time),timeEnd:t.campaign.end_time?(0,d.bt)(t.campaign.end_time):"",dailyExpense:Number(t.campaign.daily_expense)||0,dailyQuota:Number(t.campaign.daily_quota)||0,totalExpense:Number(t.campaign.total_expense)||0,listKeyword:i,countKeyword:i.length};return n.dailyExpense=this.$n((0,d.QV)(n.dailyExpense)),n.dailyQuota=this.$n((0,d.QV)(n.dailyQuota)),n.totalExpense=this.$n((0,d.QV)(n.totalExpense)),n.timeStart=this.$d(n.timeStart),n.timeEnd=n.timeEnd?this.$d(n.timeEnd):"",n})),this.tableCampagin.loading=!1}},created(){this.getList()}}),_={name:"ShopeeAdsList",mixins:[m]},h=_,g=a(1001),y=(0,g.Z)(h,s,r,!1,null,null,null),A=y.exports,E={name:"ShopeeAdsIndex",metaInfo(){return{title:this.$t("SHOPEE_ADS")}},components:{"ads-list":A}},C=E,S=(0,g.Z)(C,i,n,!1,null,null,null),w=S.exports},18182:function(t,e,a){"use strict";a.d(e,{EF:function(){return r},X6:function(){return o},pW:function(){return p},w4:function(){return l}});a(7830);var i=a(71602),n=a.n(i),s=a(16158);const r=async(t=10,e=0,a="all",i="",r="")=>{const o={campaign_state:a,sort_key:"performance",sort_direction:"1",start_time:n()().subtract(12,"months").unix(),end_time:n()().unix(),offset:e,limit:t};r&&(o.campaign_type="search",o.search_content=r),i&&(o.campaign_type=i);const l=await s.Uo.get("/api/marketing/v3/pas/homepage/",{params:o});return l.data.campaign_ads_list||[]},o=async t=>{const e=await s.Uo.get("/api/marketing/v3/pas/campaign/",{params:{campaignid:t}});return e.data||null},l=async(t,e)=>{const a={campaignid:Number(t),placement:0,keyword_list:[e]},i=await s.Uo.put("/api/marketing/v3/pas/search/",a);return i},p=async(t,e)=>{const a={campaignid:Number(t),placement:0,keyword_list:[e]},i=await s.Uo.put("/api/marketing/v3/pas/search/",a);return i}},61833:function(t,e,a){"use strict";a.d(e,{JR:function(){return n},QO:function(){return s},QV:function(){return r},bt:function(){return o}});var i=a(17752);i.Z.t("ADS_CAMPAGIN_STATUS.all"),i.Z.t("ADS_CAMPAGIN_STATUS.ongoing"),i.Z.t("ADS_CAMPAGIN_TYPE.keyword"),i.Z.t("ADS_CAMPAGIN_TYPE.shop");const n=[{title:"#",key:"index",width:60},{title:i.Z.t("ADS_CAMPAGIN_COLUM_TYPE"),key:"type",width:100},{title:i.Z.t("ADS_CAMPAGIN_COLUM_NAME"),key:"name",slot:"name"},{title:i.Z.t("ADS_CAMPAGIN_COLUM_KEYWORD"),key:"countKeyword",width:100},{title:i.Z.t("ADS_CAMPAGIN_COLUM_STATE"),key:"state",width:100},{title:i.Z.t("ADS_CAMPAGIN_COLUM_START"),key:"timeStart",width:120},{title:i.Z.t("ADS_CAMPAGIN_COLUM_DAILY_EXPENSE"),key:"dailyExpense",width:120},{title:i.Z.t("ADS_CAMPAGIN_COLUM_DAILY_QUOTA"),key:"dailyQuota",width:120},{title:i.Z.t("ADS_CAMPAGIN_COLUM_TOTAL_EXPENSE"),key:"totalExpense",width:120}],s=[{type:"selection",width:60,align:"center"},{title:"#",key:"index",width:60},{title:i.Z.t("KEYWORD_COLUM.KEYWORD"),key:"keyword",slot:"keyword",width:220},{title:i.Z.t("KEYWORD_COLUM.TYPE"),slot:"type",width:120,key:"type"},{title:i.Z.t("KEYWORD_COLUM.PRICE_OLD"),key:"priceOld"},{title:i.Z.t("KEYWORD_COLUM.PRICE_CHANGE"),key:"price",slot:"price"},{title:i.Z.t("TABLE_COLUM_ACTION"),slot:"action"}],r=t=>Math.floor(t,0),o=t=>new Date(1e3*t)},7830:function(){}}]);
//# sourceMappingURL=3546.2ce7584c.js.map