classifyList.ad635410.js 10 KB

1
  1. import{P as z}from"./page.3b4d44cb.js";import{b7 as j,b as L,ar as M,aT as T,dy as N,aV as R,E as w,N as q,_ as G,c,at as H,e as h,f as g,h as o,i,F as $,w as J,k as x,A,t as F,j as I,g as v,m,R as K,S as O}from"./index.0308b213.js";import{d as Q,g as W,f as X,h as Y,i as Z,j as ee,k as te}from"./classifyManage.6f51847c.js";import{c as oe}from"./browser.d69bddfa.js";const ae={components:{Page:z},setup(){const a=j(),s=L({total:0,loading:!1,tableData:[],openDialog:!1,categoryList:[]}),P=(n,l)=>{console.log(n,l);let e="",t={};switch(console.log(n),n){case"\u6DFB\u52A0\u5206\u7C7B":{e="/store/goods/classifyList/addClassify";break}case"\u6DFB\u52A0\u5B50\u5206\u7C7B":{e="/store/goods/classifyList/addSubClassify",t={id:l};break}case"\u4FEE\u6539\u5206\u7C7B":{e="/store/goods/classifyList/addClassify",t={id:l};break}case"\u67E5\u770B\u5546\u54C1":{e="/store/goods/goodsManage/goodsList",t={cid:l};break}case"\u6DFB\u52A0\u5546\u54C1":{e="/store/goods/goodsManage/addGoods";break}}e&&a.push({path:e,query:t})},C=L({page:1,limit:10}),S=n=>{s.openDialog=!0},E=()=>{s.categoryList.push({name:""})},r=()=>{s.openDialog=!1,s.categoryList=[]},u=()=>{Q({categoryList:s.categoryList}).then(n=>{w.success(n.msg),r(),_()})},_=()=>{s.loading=!0,W(C).then(n=>{console.log("\u8BF7\u6C42\u7ED3\u679C:",n),s.total=n.count,s.tableData=n.lists}).finally(()=>{s.loading=!1})};_();const f=()=>{s.loading=!0;let n=[],l=[],e=[],t=[];for(let d of s.tableData)if(n.push(d.id),l.push(d.min_fee),e.push(d.displayorder),t.push(d.title),d.child&&d.child.length)for(let k of d.child)n.push(k.id),l.push(k.min_fee),e.push(k.displayorder),t.push(k.title);X({ids:n,min_fees:l,displayorders:e,titles:t}).then(d=>{w.success("\u63D0\u4EA4\u6210\u529F"),_()},d=>{s.loading=!1})},p=n=>{q.prompt("\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u5206\u7C7B\u5417\uFF1F","\u63D0\u793A",{showInput:!1}).then(l=>{Y({ids:n}).then(e=>{w.success("\u5220\u9664\u6210\u529F"),_()})}).catch(l=>{})},y=(n,l)=>{Z({id:n,status:l}).then(e=>{w.success("\u5207\u6362\u6210\u529F")})},V=(n,l,e)=>{ee({id:l,field:n,platform_status:e}).then(t=>{w.success("\u5207\u6362\u6210\u529F")})},b=(n,l)=>{te({id:n,is_promotion:l}).then(e=>{w.success("\u5207\u6362\u6210\u529F")})},D=n=>{let l="\u661F\u671F";switch(n){case"1":l+="\u4E00";break;case"2":l+="\u4E8C";break;case"3":l+="\u4E09";break;case"4":l+="\u56DB";break;case"5":l+="\u4E94";break;case"6":l+="\u516D";break;case"7":l+="\u4E03";break;default:l=n}return l},U=(n,l)=>{n=="page"?C.page=l:C.limit=l,_()},B=n=>{let l=`store-page/category/category?cid=${n}`;oe.write(l).then(()=>{w({message:"\u590D\u5236\u5730\u5740\u6210\u529F:"+l,showClose:!0,duration:3e3,center:!0,type:"success"})})};return{...M(s),Plus:T,View:N,Delete:R,to:P,getPage:_,submit:f,del:p,changeShow:y,weekText:D,pagination:U,handleAddCategorys:S,handleAddCategory:E,CategoryCancel:r,Categorysubmit:u,changeIsPromotion:b,copyLink:B,changePlatformShow:V}}};const le=a=>(K("data-v-9fa90605"),a=a(),O(),a),ne={class:"container"},ie=m("\u6DFB\u52A0\u5206\u7C7B"),se=m("\u6279\u91CF\u6DFB\u52A0\u5206\u7C7B"),re={key:0,class:"wrap"},de={key:0},ue={key:1},ce=m(" \u662F\u5426\u663E\u793A "),me=le(()=>v("br",null,null,-1)),he=m(" \u662F\u5426\u4FC3\u9500 "),pe={style:{display:"flex","flex-direction":"column","justify-content":"center","text-align":"center","align-items":"center"}},ge=m(" \u5E73\u53F0\u663E\u793A "),_e={style:{display:"flex","flex-direction":"column","justify-content":"center","text-align":"center","align-items":"center"}},we=m("\u6DFB\u52A0\u5B50\u5206\u7C7B"),fe=m("\u4FEE\u6539\u5206\u7C7B"),ve=m("\u590D\u5236\u94FE\u63A5"),ye={class:"footer"},Ce={class:"footer-left"},ke={class:"footer-right"},Ve=m("\u63D0\u4EA4\u4FEE\u6539"),be=m("\u6DFB\u52A0\u5206\u7C7B"),De=m("\u63D0\u4EA4"),Ue=m("\u53D6\u6D88");function Be(a,s,P,C,S,E){const r=c("el-button"),u=c("el-table-column"),_=c("el-image"),f=c("el-input"),p=c("el-switch"),y=c("el-tooltip"),V=c("el-table"),b=c("el-pagination"),D=c("Page"),U=c("el-form-item"),B=c("el-form"),n=c("el-dialog"),l=H("loading");return h(),g($,null,[o(D,{showBorder:!1},{main:i(()=>[J((h(),g("div",ne,[o(r,{class:"add-btn",type:"primary",onClick:s[0]||(s[0]=e=>a.to("\u6DFB\u52A0\u5206\u7C7B"))},{default:i(()=>[ie]),_:1}),o(r,{class:"add-btn",type:"primary",onClick:a.handleAddCategorys},{default:i(()=>[se]),_:1},8,["onClick"]),o(V,{data:a.tableData,border:"",style:{width:"100%"},"row-key":"id","tree-props":{children:"child",hasChildren:!0},"default-expand-all":!0},{default:i(()=>[o(u,{align:"center",label:"\u5206\u7C7Bid",prop:"id"}),o(u,{align:"center","class-name":"pic",label:"\u56FE\u6807",width:"120"},{default:i(e=>[o(_,{style:{width:"50px",height:"50px"},src:e.row.thumb,fit:"contain"},null,8,["src"])]),_:1}),o(u,{align:"center",label:"\u5206\u7C7B\u540D\u79F0"},{default:i(e=>[o(f,{modelValue:e.row.title,"onUpdate:modelValue":t=>e.row.title=t},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),o(u,{align:"center",label:"\u6700\u4F4E\u6D88\u8D39\u91D1\u989D(\u5143)"},{default:i(e=>[e.row.parentid?A("",!0):(h(),x(f,{key:0,type:"number",min:0,modelValue:e.row.min_fee,"onUpdate:modelValue":t=>e.row.min_fee=t},null,8,["modelValue","onUpdate:modelValue"]))]),_:1}),o(u,{align:"center",label:"\u6392\u5E8F"},{default:i(e=>[o(f,{type:"number",min:0,modelValue:e.row.displayorder,"onUpdate:modelValue":t=>e.row.displayorder=t},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),o(u,{align:"center",label:"\u663E\u793A\u65F6\u95F4\u6BB5"},{default:i(e=>[e.row.parentid?A("",!0):(h(),g("div",re,[e.row.is_showtime==0||e.row.is_showtime==1&&!e.row.start_time?(h(),g("span",de,"\u4E0D\u9650")):(h(),g("span",ue,F(e.row.start_time)+" \u5230 "+F(e.row.end_time),1))]))]),_:1}),o(u,{align:"center",label:"\u661F\u671F\u51E0\u663E\u793A",prop:"week"},{default:i(e=>[(h(!0),g($,null,I(e.row.week,(t,d)=>(h(),g("span",{key:d},F(a.weekText(t)+(e.row.week.length-1!=d?"\u3001":"\u4E0D\u9650")),1))),128))]),_:1}),o(u,{align:"center",label:"\u662F\u5426\u663E\u793A"},{header:i(()=>[ce,me,he]),default:i(e=>[v("view",pe,[o(p,{modelValue:e.row.status,"onUpdate:modelValue":t=>e.row.status=t,"active-value":1,"inactive-value":0,"inline-prompt":"","active-text":"\u662F","inactive-text":"\u5426",onChange:t=>a.changeShow(e.row.id,e.row.status)},null,8,["modelValue","onUpdate:modelValue","onChange"]),o(p,{modelValue:e.row.is_promotion,"onUpdate:modelValue":t=>e.row.is_promotion=t,"active-value":1,"inactive-value":0,"inline-prompt":"","active-text":"\u662F","inactive-text":"\u5426",onChange:t=>a.changeIsPromotion(e.row.id,e.row.is_promotion)},null,8,["modelValue","onUpdate:modelValue","onChange"])])]),_:1}),o(u,{align:"center",label:"\u663E\u793A\u5E73\u53F0"},{header:i(()=>[ge]),default:i(e=>[v("view",_e,[o(p,{modelValue:e.row.android_show,"onUpdate:modelValue":t=>e.row.android_show=t,"active-value":1,"inactive-value":2,"inline-prompt":"","active-text":"\u5B89\u5353\uFF1A\u662F","inactive-text":"\u5B89\u5353\uFF1A\u5426",onChange:t=>a.changePlatformShow("android_show",e.row.id,e.row.android_show)},null,8,["modelValue","onUpdate:modelValue","onChange"]),o(p,{modelValue:e.row.ios_show,"onUpdate:modelValue":t=>e.row.ios_show=t,"active-value":1,"inactive-value":2,"inline-prompt":"","active-text":"ios\uFF1A\u662F","inactive-text":"ios\uFF1A\u5426",onChange:t=>a.changePlatformShow("ios_show",e.row.id,e.row.ios_show)},null,8,["modelValue","onUpdate:modelValue","onChange"]),o(p,{modelValue:e.row.h5_show,"onUpdate:modelValue":t=>e.row.h5_show=t,"active-value":1,"inactive-value":2,"inline-prompt":"","active-text":"h5\uFF1A\u662F","inactive-text":"h5\uFF1A\u5426",onChange:t=>a.changePlatformShow("h5_show",e.row.id,e.row.h5_show)},null,8,["modelValue","onUpdate:modelValue","onChange"]),o(p,{modelValue:e.row.wx_show,"onUpdate:modelValue":t=>e.row.wx_show=t,"active-value":1,"inactive-value":2,"inline-prompt":"","active-text":"\u5FAE\u4FE1\uFF1A\u662F","inactive-text":"\u5FAE\u4FE1\uFF1A\u5426",onChange:t=>a.changePlatformShow("wx_show",e.row.id,e.row.wx_show)},null,8,["modelValue","onUpdate:modelValue","onChange"]),o(p,{modelValue:e.row.zfb_show,"onUpdate:modelValue":t=>e.row.zfb_show=t,"active-value":1,"inactive-value":2,"inline-prompt":"","active-text":"\u652F\u4ED8\u5B9D\uFF1A\u662F","inactive-text":"\u652F\u4ED8\u5B9D\uFF1A\u5426",onChange:t=>a.changePlatformShow("zfb_show",e.row.id,e.row.zfb_show)},null,8,["modelValue","onUpdate:modelValue","onChange"])])]),_:1}),o(u,{"header-align":"center",align:"right",label:"\u64CD\u4F5C",width:"390"},{default:i(e=>[e.row.parentid?A("",!0):(h(),x(r,{key:0,onClick:t=>a.to("\u6DFB\u52A0\u5B50\u5206\u7C7B",e.row.id)},{default:i(()=>[we]),_:2},1032,["onClick"])),o(r,{onClick:t=>a.to("\u4FEE\u6539\u5206\u7C7B",e.row.id)},{default:i(()=>[fe]),_:2},1032,["onClick"]),o(r,{onClick:t=>a.copyLink(e.row.id)},{default:i(()=>[ve]),_:2},1032,["onClick"]),o(y,{effect:"dark",content:"\u67E5\u770B\u5546\u54C1",placement:"top"},{default:i(()=>[o(r,{icon:a.View,onClick:t=>a.to("\u67E5\u770B\u5546\u54C1",e.row.id)},null,8,["icon","onClick"])]),_:2},1024),o(y,{effect:"dark",content:"\u6DFB\u52A0\u5546\u54C1",placement:"top"},{default:i(()=>[o(r,{icon:a.Plus,onClick:s[1]||(s[1]=t=>a.to("\u6DFB\u52A0\u5546\u54C1"))},null,8,["icon"])]),_:1}),o(y,{effect:"dark",content:"\u5220\u9664",placement:"top"},{default:i(()=>[o(r,{icon:a.Delete,onClick:t=>a.del([e.row.id])},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"])])),[[l,a.loading]])]),footer:i(()=>[v("div",ye,[v("div",Ce,[o(b,{layout:"total, sizes, prev, pager, next, jumper",total:a.total,onSizeChange:s[2]||(s[2]=e=>a.pagination("limit",e)),onCurrentChange:s[3]||(s[3]=e=>a.pagination("page",e))},null,8,["total"])]),v("div",ke,[o(r,{class:"submit-btn",type:"primary",onClick:s[4]||(s[4]=e=>a.submit())},{default:i(()=>[Ve]),_:1})])])]),_:1}),o(n,{modelValue:a.openDialog,"onUpdate:modelValue":s[5]||(s[5]=e=>a.openDialog=e),title:"\u6279\u91CF\u6DFB\u52A0\u5206\u7C7B",width:"20%",onClose:a.CategoryCancel},{default:i(()=>[o(B,{"label-width":"120px"},{default:i(()=>[o(r,{onClick:a.handleAddCategory,type:"primary"},{default:i(()=>[be]),_:1},8,["onClick"]),(h(!0),g($,null,I(a.categoryList,(e,t)=>(h(),g("div",{style:{"margin-top":"10px"},key:t},[o(f,{style:{width:"300px"},modelValue:e.name,"onUpdate:modelValue":d=>e.name=d,placeholder:"\u8BF7\u8F93\u5165\u5206\u7C7B\u540D\u79F0"},null,8,["modelValue","onUpdate:modelValue"])]))),128)),o(U,{style:{"margin-left":"0","margin-top":"10px"}},{default:i(()=>[o(r,{type:"primary",onClick:a.Categorysubmit},{default:i(()=>[De]),_:1},8,["onClick"]),o(r,{onClick:a.CategoryCancel},{default:i(()=>[Ue]),_:1},8,["onClick"])]),_:1})]),_:1})]),_:1},8,["modelValue","onClose"])],64)}const Se=G(ae,[["render",Be],["__scopeId","data-v-9fa90605"]]);export{Se as default};