import{F as A}from"./index.d8717905.js";import{d as N,aX as $,r as G,b as D,p as S,c as d,e as V,f as z,h as l,i as u,u as s,g as f,t as T,k as b,A as k,F as J,m as _,E as g}from"./index.0308b213.js";import{H as M,I as P,J as I,K,L}from"./setting.644fa418.js";import{T as O}from"./TEditor.fed75c12.js";import"./index.esm.3fe50213.js";const X=f("span",null,"\u95EE\u9898\u5217\u8868",-1),j={style:{display:"flex"}},q=_("\u7F16\u8F91 "),Q=_("\u5220\u9664 "),R=_("\u6DFB\u52A0\u5E38\u89C1\u95EE\u9898"),W=f("span",null,"\u6570\u5B57\u8D8A\u5927\u8D8A\u9760\u524D",-1),Y={class:"dialog-footer"},Z=_("\u5173\u95ED"),ee=_(" \u786E\u8BA4 "),te=_("\u4FDD\u5B58"),de=N({setup(le){const B=$.get("uniacid"),n=G(!1);let i=D({count:0,pages:1,page:1,limit:12,list:[]}),o=D({id:0,uniacid:1,title:"\u6D4B\u8BD5\u6807\u9898",content:"<p>\u7F16\u8F91\u5668\u5185\u5BB9</p>",displayorder:99});const y=()=>{M({uniacid:B,page:i.page,limit:i.limit}).then(a=>{let e;for(e in i)i[e]=a[e]})},E=a=>{console.log(a),n.value=!n.value,a!==0&&P({uniacid:B,id:a}).then(e=>{o.id=e.id,o.title=e.title,o.content=e.content,o.displayorder=e.displayorder})},v=(a,e)=>{i.list=i.list.filter((r,p)=>p!=e),a!==0&&I({id:a}).then(r=>{r&&g({message:"\u5220\u9664\u6210\u529F",type:"success"})})},h=()=>{K({id:o.id===0?"":o.id,title:o.title,displayorder:o.displayorder,content:o.content}).then(a=>{a&&g({message:"\u4FDD\u5B58\u6210\u529F",type:"success"}),n.value=!n.value,y()})},w=()=>{L({list:JSON.stringify(i.list)}).then(a=>{a&&g({message:"\u4FDD\u5B58\u6210\u529F",type:"success"}),y()})};return y(),S(n,(a,e)=>{o.title="",o.content="",o.displayorder=0,o.id=0}),(a,e)=>{const r=d("el-input"),p=d("el-table-column"),m=d("el-button"),C=d("el-table"),H=d("el-card"),F=d("el-form-item"),x=d("el-form"),U=d("el-dialog");return V(),z(J,null,[l(H,null,{header:u(()=>[X]),default:u(()=>[l(C,{data:s(i).list,style:{width:"100%"}},{default:u(()=>[l(p,{fixed:"",prop:"displayorder",label:"\u6392\u5E8F",width:"150"},{default:u(t=>[l(r,{modelValue:t.row.displayorder,"onUpdate:modelValue":c=>t.row.displayorder=c,modelModifiers:{number:!0}},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{prop:"title",label:"\u5185\u5BB9\u6807\u9898",width:"420"},{default:u(t=>[l(r,{modelValue:t.row.title,"onUpdate:modelValue":c=>t.row.title=c},null,8,["modelValue","onUpdate:modelValue"])]),_:1}),l(p,{prop:"addtime",label:"\u6DFB\u52A0\u65F6\u95F4",width:"500"},{default:u(t=>[f("div",j,[f("span",null,T(t.row.addtime),1)])]),_:1}),l(p,{fixed:"right",label:"\u64CD\u4F5C",width:"280"},{default:u(t=>[t.row.is_system?k("",!0):(V(),b(m,{key:0,link:"",type:"primary",size:"small",onClick:c=>E(t.row.id)},{default:u(()=>[q]),_:2},1032,["onClick"])),t.row.is_system?k("",!0):(V(),b(m,{key:1,link:"",type:"danger",size:"small",onClick:c=>v(t.row.id,t.$index)},{default:u(()=>[Q]),_:2},1032,["onClick"]))]),_:1})]),_:1},8,["data"]),l(m,{type:"primary",style:{margin:"10px"},onClick:e[0]||(e[0]=t=>E(0))},{default:u(()=>[R]),_:1})]),_:1}),l(U,{modelValue:n.value,"onUpdate:modelValue":e[5]||(e[5]=t=>n.value=t),title:"\u7F16\u8F91\u5E38\u89C1\u95EE\u9898"},{footer:u(()=>[f("span",Y,[l(m,{onClick:e[4]||(e[4]=t=>n.value=!1)},{default:u(()=>[Z]),_:1}),l(m,{type:"primary",onClick:h},{default:u(()=>[ee]),_:1})])]),default:u(()=>[l(x,{model:s(o)},{default:u(()=>[l(F,{label:"\u5217\u8868\u6392\u5E8F"},{default:u(()=>[l(r,{modelValue:s(o).displayorder,"onUpdate:modelValue":e[1]||(e[1]=t=>s(o).displayorder=t),autocomplete:"off"},null,8,["modelValue"]),W]),_:1}),l(F,{label:"\u95EE\u9898\u6807\u9898"},{default:u(()=>[l(r,{modelValue:s(o).title,"onUpdate:modelValue":e[2]||(e[2]=t=>s(o).title=t),autocomplete:"off"},null,8,["modelValue"])]),_:1}),l(F,{label:"\u95EE\u9898\u5185\u5BB9"},{default:u(()=>[l(O,{modelValue:s(o).content,"onUpdate:modelValue":e[3]||(e[3]=t=>s(o).content=t)},null,8,["modelValue"])]),_:1})]),_:1},8,["model"])]),_:1},8,["modelValue"]),l(A,null,{default:u(()=>[l(m,{type:"primary",size:"small",onClick:w},{default:u(()=>[te]),_:1})]),_:1})],64)}}});export{de as default};
