import{d as E,aI as C,r as x,E as M,j as I,Y as U,ai as c,o as p,M as d,O as u,U as h,P as w,V as R,u as f,a as b,R as k}from"./vue.1RczIYhx.js";import{i as D}from"./echarts.DoXO02ct.js";import{u as L}from"./useResponse.DqThFJSa.js";import{h as j,i as G}from"./api.CeyMUdte.js";import{_ as P}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.fM6cvGYs.js";import"./elementPlus.CXoFsoPv.js";const T=E({__name:"NegativeClassification",props:{asin:String},setup(S){const O=S,{asin:m}=O;let i=C("chartRef"),t=null,o=x([]),a=null,s=C("lineChartRef"),n=null,r=x([]);M(()=>{z(),A()}),I(()=>{B(),N()}),U(()=>{a==null||a.disconnect(),t==null||t.dispose()});function v(){if(!t||o.value.length===0)return;o.value.sort((g,l)=>g.value-l.value);const e={title:{text:"负面标签分类"},tooltip:{trigger:"axis"},grid:{top:"15%",left:"20%",right:"5%",bottom:"10%"},dataset:{dimensions:["name","value"],source:o.value},xAxis:{type:"value",axisLine:{show:!0,lineStyle:{color:"#3480CE",width:1}}},yAxis:{type:"category",name:"名称",nameGap:16,axisLabel:{interval:0,rotate:30,textStyle:{fontSize:12,color:"#333"}}},series:[{type:"bar",name:" ",color:"#3480CE",barWidth:"18px"}]};t.setOption(e)}function _(){if(!n||r.value.length===0)return;const e={tooltip:{trigger:"axis"},grid:{top:"12%",left:"10%",right:"10%",bottom:"10%"},dataset:{dimensions:["name","value"],source:r.value},xAxis:{type:"category",name:"日期"},yAxis:{type:"value",axisLine:{show:!0,lineStyle:{color:"#FF5733",width:1}}},series:[{name:"all",type:"line",smooth:!0,itemStyle:{color:"#FF5733"}}]};n.setOption(e)}function B(){i.value&&(t=D(i.value),v(),a=new ResizeObserver(()=>{t==null||t.resize()}),i.value&&a.observe(i.value))}function N(){s.value&&(n=D(s.value),_(),a=new ResizeObserver(()=>{n==null||n.resize()}),s.value&&a.observe(s.value))}async function z(){const e=await L(j,{asin:m,agg_field:"kind"});e.code===2e3&&e.data&&(o.value=e.data,v())}async function A(){const e=await L(G,{asin:m,agg_field:"review_date"});e.code===2e3&&e.data&&(r.value=e.data,_())}return(e,g)=>{const l=c("el-empty"),y=c("el-col"),F=c("el-row"),V=c("el-card");return p(),d(V,{class:"border-none",shadow:"hover"},{default:u(()=>[h(F,{gutter:10},{default:u(()=>[h(y,{span:12},{default:u(()=>[w(b("div",{ref_key:"chartRef",ref:i,class:"chart"},null,512),[[R,f(o).length>0]]),f(o).length==0?(p(),d(l,{key:0,class:"chart",description:"暂无数据"})):k("",!0)]),_:1}),h(y,{span:12},{default:u(()=>[w(b("div",{ref_key:"lineChartRef",ref:s,class:"chart"},null,512),[[R,f(r).length>0]]),f(r).length==0?(p(),d(l,{key:0,class:"chart",description:"暂无数据"})):k("",!0)]),_:1})]),_:1})]),_:1})}}}),X=P(T,[["__scopeId","data-v-75082ea1"]]);export{X as default};
