import{q as A,k as H,u as I,a as f,r as O,R as Q,ak as Z,b as u,M as F,o as d,c as G,d as s,e,g as n,N as z,s as r,f as J,t as E,i as p,H as i,Z as K,E as v,S as b}from"./index.699f1124.js";import{g as W,d as X,u as N}from"./product.e8b8d59d.js";const Y={class:"app-container"},ee=i("\u53D1\u5E03\u4EA7\u54C1"),te=i("\u5F85\u5BA1\u6838"),ae=i("\u5DF2\u53D1\u5E03"),se=i("\u5DF2\u9A73\u56DE"),oe=i("\u8349\u7A3F\u7BB1"),le=i("\u7F16\u8F91"),ne=i("\u5220\u9664"),ie=i("\u67E5\u770B\u5339\u914D\u7ED3\u679C"),ce=i("\u6D4F\u89C8\u4F01\u4E1A\u4FE1\u606F"),ue=i("\u79FB\u5230\u8349\u7A3F\u7BB1"),de=A({name:"Product"}),me=Object.assign(de,{setup(re){const C=H();I();const x=f([]),y=f(!0);f(!0);const k=f(0);f([]);const V=O({queryParams:{pageNum:1,pageSize:10,status:0}}),{queryParams:o}=Q(V),_=async()=>{y.value=!0;const t=await W(o.value);x.value=t.rows,k.value=t.total,y.value=!1},P=t=>{v.confirm('\u662F\u5426\u786E\u8BA4\u5220\u9664\u6570\u636E\u7F16\u53F7\u4E3A"'+t+'"\u7684\u4EA7\u54C1\u9879\uFF1F').then(async()=>{await X(t),b.success("\u5220\u9664\u6210\u529F"),_()}).catch(l=>{console.log("\u5DF2\u53D6\u6D88")})};function D(){o.value.pageNum=1,_()}const q=t=>{v.confirm('\u786E\u8BA4\u8981\u53D6\u6D88\u53D1\u5E03id\u4E3A"'+t+'"\u7684\u4EA7\u54C1\u5417?').then(async()=>{await N({id:t,status:3}),b.success("\u53D6\u6D88\u53D1\u5E03\u6210\u529F"),_()}).catch(l=>{console.log(l)})},w=t=>{let l=t.shelfStatus==2?"\u4E0A\u67B6":"\u4E0B\u67B6";v.confirm('\u786E\u8BA4\u8981"'+l+'""'+t.id+'"\u7684\u4EA7\u54C1\u5417?').then(function(){let c=t.shelfStatus==1?2:1;return N({id:t.id,shelfStatus:c})}).then(()=>{_(),b.success(l+"\u6210\u529F")}).catch(()=>{})},B=t=>{C.push({path:"./results",query:{keyword:t.title}})},U=t=>{C.push({path:"./business"})};return Z(()=>{_()}),(t,l)=>{const c=u("el-button"),S=u("router-link"),$=u("el-col"),R=u("el-row"),h=u("el-radio-button"),M=u("el-radio-group"),m=u("el-table-column"),T=u("el-table"),L=u("pagination"),j=F("loading");return d(),G("div",Y,[s(R,{gutter:10,class:"mb8"},{default:e(()=>[s($,{span:1.5},{default:e(()=>[s(S,{to:"./release"},{default:e(()=>[s(c,{type:"primary",size:"small"},{default:e(()=>[ee]),_:1})]),_:1})]),_:1},8,["span"])]),_:1}),s(M,{modelValue:n(o).status,"onUpdate:modelValue":l[0]||(l[0]=a=>n(o).status=a),size:"small",onChange:D},{default:e(()=>[s(h,{label:0},{default:e(()=>[te]),_:1}),s(h,{label:1},{default:e(()=>[ae]),_:1}),s(h,{label:2},{default:e(()=>[se]),_:1}),s(h,{label:3},{default:e(()=>[oe]),_:1})]),_:1},8,["modelValue"]),z((d(),r(T,{data:x.value,style:{"margin-top":"20px"}},{default:e(()=>[s(m,{label:"\u6570\u636E\u7F16\u53F7",prop:"id"}),s(m,{label:"\u4EA7\u54C1\u540D\u79F0",prop:"title"}),s(m,{label:"\u4EA7\u54C1\u9886\u57DF",prop:"industryStr"}),s(m,{label:"\u53D1\u5E03\u65F6\u95F4",prop:"createTime",width:"180"},{default:e(({row:a})=>[J("span",null,E(a.createTime),1)]),_:1}),s(m,{label:"\u64CD\u4F5C","class-name":"small-padding fixed-width"},{default:e(({row:a})=>[n(o).status==3?(d(),r(S,{key:0,to:{path:"./release",query:{id:a.id}}},{default:e(()=>[s(c,{size:"small",type:"text",icon:"Edit"},{default:e(()=>[le]),_:1})]),_:2},1032,["to"])):p("",!0),n(o).status==1?(d(),r(c,{key:1,size:"small",type:"text",icon:a.shelfStatus==2?"Upload":"Download",onClick:g=>w(a)},{default:e(()=>[i(E(a.shelfStatus==2?"\u4E0A\u67B6":"\u4E0B\u67B6"),1)]),_:2},1032,["icon","onClick"])):p("",!0),n(o).status!=1?(d(),r(c,{key:2,size:"small",type:"text",icon:"Delete",onClick:g=>P(a.id)},{default:e(()=>[ne]),_:2},1032,["onClick"])):p("",!0),n(o).status==1?(d(),r(c,{key:3,size:"small",type:"text",icon:"View",onClick:g=>B(a)},{default:e(()=>[ie]),_:2},1032,["onClick"])):p("",!0),n(o).status==1?(d(),r(c,{key:4,disabled:"",size:"small",type:"text",icon:"View",onClick:g=>U(a.id)},{default:e(()=>[ce]),_:2},1032,["onClick"])):p("",!0),n(o).status==0?(d(),r(c,{key:5,size:"small",type:"text",icon:"Close",onClick:g=>q(a.id)},{default:e(()=>[ue]),_:2},1032,["onClick"])):p("",!0)]),_:1})]),_:1},8,["data"])),[[j,y.value]]),z(s(L,{total:k.value,page:n(o).pageNum,"onUpdate:page":l[1]||(l[1]=a=>n(o).pageNum=a),limit:n(o).pageSize,"onUpdate:limit":l[2]||(l[2]=a=>n(o).pageSize=a),onPagination:_},null,8,["total","page","limit"]),[[K,k.value>0]])])}}});export{me as default};
