import{P}from"./page.3b4d44cb.js";import{b7 as w,b as g,ar as V,E as h,_ as v,c as d,e as k,k as C,i as l,g as $,h as e,m as c}from"./index.0308b213.js";import{f as B,h as D,i as E}from"./printer.6dc17f12.js";const F={components:{Page:P},setup(){const s=w(),t=g({loading:!1,btnLoading:!1,tableData:[]}),p=g({page:1,limit:10}),m=()=>{s.push({path:"/store/shop/addPrintsLabels"})},r=()=>{t.loading=!0,B(p).then(a=>{console.log("\u8BF7\u6C42\u7ED3\u679C",a),t.tableData=a.lists}).finally(()=>{t.loading=!1})};r();const f=a=>{D({ids:[a]}).then(n=>{h.success("\u5220\u9664\u6210\u529F"),r()})},i=()=>{let a={ids:[],titles:[],displayorders:[]};for(let n of t.tableData)a.ids.push(n.id),a.titles.push(n.title),a.displayorders.push(n.displayorder);t.btnLoading=!0,E(a).then(n=>{h.success("\u4FEE\u6539\u6210\u529F"),r()}).finally(()=>{t.btnLoading=!1})};return{...V(t),addPrintsLabels:m,del:f,submit:i}}};const U={class:"container"},N=c("\u6DFB\u52A0\u6253\u5370\u6807\u7B7E"),R=c("\u5220\u9664"),A=c("\u63D0\u4EA4\u4FEE\u6539");function I(s,t,p,m,r,f){const i=d("el-button"),a=d("el-col"),n=d("el-row"),b=d("el-input"),_=d("el-table-column"),y=d("el-table"),L=d("Page");return k(),C(L,{showBorder:!1,loading:s.loading},{main:l(()=>[$("div",U,[e(n,null,{default:l(()=>[e(a,null,{default:l(()=>[e(i,{type:"primary",onClick:t[0]||(t[0]=o=>s.addPrintsLabels())},{default:l(()=>[N]),_:1})]),_:1})]),_:1}),e(n,null,{default:l(()=>[e(a,null,{default:l(()=>[e(y,{border:"",data:s.tableData,style:{width:"100%"}},{default:l(()=>[e(_,{align:"center",label:"\u6807\u7B7E\u540D\u79F0"},{default:l(o=>[e(b,{modelValue:o.row.title,"onUpdate:modelValue":u=>o.row.title=u},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(_,{align:"center",label:"\u6392\u5E8F"},{default:l(o=>[e(b,{modelValue:o.row.displayorder,"onUpdate:modelValue":u=>o.row.displayorder=u},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),e(_,{align:"center",label:"\u64CD\u4F5C",width:"200"},{default:l(o=>[e(i,{onClick:u=>s.del(o.row.id)},{default:l(()=>[R]),_:2},1032,["onClick"])]),_:1})]),_:1},8,["data"])]),_:1})]),_:1}),e(i,{type:"primary",loading:s.btnLoading,onClick:t[1]||(t[1]=o=>s.submit())},{default:l(()=>[A]),_:1},8,["loading"])])]),_:1},8,["loading"])}const q=v(F,[["render",I],["__scopeId","data-v-87fde4f6"]]);export{q as default};
