index.d945fe0e.js 5.1 KB

1
  1. import{u as H,r as J}from"./index.34b03be2.js";import{d as K,ay as L,r as i,Z as Q,k as W,ai as s,aq as X,o as N,M as T,O as l,U as o,a as t,P as Y,T as u,S as c}from"./vue.adf17aba.js";import"./elementPlus.4833989a.js";import"./echarts.72dc8373.js";const ee={style:{width:"100%",height:"520px",display:"flex",border:"1px solid #c2c7cf","border-radius":"6px"}},te={style:{width:"50%","border-right":"1px solid #c2c7cf"}},le={style:{"margin-bottom":"10px"}},oe={style:{display:"flex","align-items":"center"}},ae={style:{"margin-right":"8px","line-height":"normal"}},ne={class:"single-line"},se={class:"data-color",style:{"margin-right":"8px"}},ie={style:{display:"flex","flex-direction":"row-reverse","margin-top":"10px"}},de={style:{width:"50%"}},re={class:"card-header"},ce={style:{"font-weight":"550","font-size":"15px",color:"#1f2128"}},ue=t("div",{class:"card-body"},null,-1),_e={style:{padding:"0 10px 0 10px","margin-top":"-12px"}},me={style:{display:"flex","align-items":"center"}},pe={style:{"margin-right":"8px","line-height":"normal"}},fe={class:"single-line"},ge={class:"data-color",style:{"margin-right":"8px"}},we=K({__name:"index",setup(he){const V=H(),{profile:I}=L(V),S=i("default"),A=i("top"),f=i(!0),G=i(),_=Q({negativeGoodsTextarea:""}),z=W(()=>({})),h=i("first"),v=i(""),g=i([]),d=i([]);function x(a=""){return J({url:"/api/sellers/listings/",method:"GET",params:{profile_id:I.value.profile_id,asin:a}}).then(n=>{g.value=n.data,f.value=!1}).catch(n=>{console.error("Error fetching data:",n),f.value=!1})}function D(a){a===""?g.value=[]:x(a)}function F(a){console.log("scope",a.row),d.value.some(r=>r.sku===a.row.sku)?console.log("Item is already added."):d.value.push(a.row)}function U(){const a=x(_.negativeGoodsTextarea);console.log("x",a)}function B(){d.value=[]}function R(a){const n=d.value.findIndex(r=>r.sku===a.row.sku);n!==-1?(d.value.splice(n,1),console.log("Item removed successfully.")):console.log("Item not found.")}function q(a){}const E=(a,n)=>{console.log(a,n)},b=a=>{if(a.rowIndex===0)return{backgroundColor:"rgba(245, 245, 245, 0.9)"}};return(a,n)=>{const r=s("el-input"),y=s("el-image"),w=s("el-tooltip"),m=s("el-table-column"),p=s("el-button"),k=s("el-table"),C=s("el-tab-pane"),P=s("el-tabs"),$=s("el-card"),M=s("el-form-item"),O=s("el-form"),Z=X("loading");return N(),T(O,{"label-position":A.value,ref_key:"ruleFormRef",ref:G,model:_,rules:z.value,"label-width":"120px",class:"demo-ruleForm",size:S.value,"status-icon":""},{default:l(()=>[o(M,{prop:"matchType",style:{width:"100%","margin-top":"20px"}},{default:l(()=>[t("div",ee,[t("div",te,[o(P,{modelValue:h.value,"onUpdate:modelValue":n[2]||(n[2]=e=>h.value=e),class:"demo-tabs",onTabClick:E},{default:l(()=>[o(C,{label:"搜索",name:"first"},{default:l(()=>[t("div",le,[o(r,{placeholder:"按ASIN搜索",modelValue:v.value,"onUpdate:modelValue":n[0]||(n[0]=e=>v.value=e),onChange:D,clearable:""},null,8,["modelValue"])]),Y((N(),T(k,{height:"415",style:{width:"100%"},data:g.value,"header-cell-style":b,"show-header":!1},{default:l(()=>[o(m,{prop:"asin",label:"商品"},{default:l(e=>[t("div",oe,[t("div",ae,[o(y,{class:"img-box",src:e.row.image_link},null,8,["src"])]),t("div",null,[o(w,{class:"box-item",effect:"dark",content:e.row.title,placement:"top"},{default:l(()=>[t("div",ne,u(e.row.title?e.row.title:"--"),1)]),_:2},1032,["content"]),t("span",null,[c(" ASIN: "),t("span",se,u(e.row.asin?e.row.asin:"--"),1)])])])]),_:1}),o(m,{prop:"name",label:"Name",width:"120",align:"right"},{header:l(()=>[]),default:l(e=>[o(p,{type:"primary",size:"small",onClick:j=>F(e),text:""},{default:l(()=>[c("添加")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])),[[Z,f.value]])]),_:1}),o(C,{label:"输入",name:"second"},{default:l(()=>[o(r,{modelValue:_.negativeGoodsTextarea,"onUpdate:modelValue":n[1]||(n[1]=e=>_.negativeGoodsTextarea=e),rows:17,type:"textarea",placeholder:"请输入关键词,多个关键词使用逗号或者换行符分隔。(最多添加1000个关键词)",maxlength:"11000",style:{padding:"10px 10px"}},null,8,["modelValue"]),t("div",ie,[o(p,{style:{"margin-right":"10px"},type:"primary",text:"",bg:"",onClick:U},{default:l(()=>[c("添加")]),_:1})])]),_:1})]),_:1},8,["modelValue"])]),t("div",de,[o($,{class:"box-card",shadow:"never"},{header:l(()=>[t("div",re,[t("span",ce,"已添加: "+u(d.value.length),1),o(p,{class:"button",text:"",bg:"",onClick:B},{default:l(()=>[c("全部删除")]),_:1})])]),default:l(()=>[ue]),_:1}),t("div",_e,[o(k,{data:d.value,height:"415",style:{width:"100%"},"header-cell-style":b,onSelectionChange:q},{default:l(()=>[o(m,{prop:"asin",label:"商品"},{default:l(e=>[t("div",me,[t("div",pe,[o(y,{class:"img-box",src:e.row.image_link},null,8,["src"])]),t("div",null,[o(w,{class:"box-item",effect:"dark",content:e.row.title,placement:"top"},{default:l(()=>[t("div",fe,u(e.row.title?e.row.title:"--"),1)]),_:2},1032,["content"]),t("span",null,[c("ASIN: "),t("span",ge,u(e.row.asin?e.row.asin:"--"),1)])])])]),_:1}),o(m,{label:"操作",width:"120",align:"right"},{default:l(e=>[o(p,{type:"primary",size:"small",onClick:j=>R(e),text:""},{default:l(()=>[c("删除")]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])])])])]),_:1})]),_:1},8,["label-position","model","rules","size"])}}});export{we as default};