mirror of
https://gitee.com/myxzgzs/boyue_jnpf.git
synced 2025-08-08 07:12:42 +08:00
2 lines
4.3 KiB
JavaScript
2 lines
4.3 KiB
JavaScript
import{D as u,v as E,_ as O,r as n,j as R,o as _,d as v,w as r,k as y,b as i,m as b,f as s,C as j,c as w,a as K,t as M,F as $,E as I,G as T}from"./index-f87df9cc.js";const h=E+"/category",q=e=>u({url:h+"/list",method:"get",params:e}),A=e=>u({url:h+"/detail",method:"get",params:{id:e}}),F=e=>u({url:h+"/save",method:"post",data:e}),N=e=>u({url:h+"/update",method:"post",data:e}),z=e=>u({url:h+"/remove",method:"post",params:{ids:e}});const G={data(){return{search:{},loading:!1,form:{},data:[],option:{dialogWidth:"400",dialogMenuPosition:"center",height:"auto",calcHeight:330,header:!1,index:!0,align:"center",headerAlign:"center",column:[{label:"模块名",prop:"categoryKey",span:24,rules:[{required:!0,message:"请输入模块名",trigger:"blur"}]},{label:"模块值",prop:"categoryValue",type:"number",span:24,rules:[{required:!0,message:"请输入模块值",trigger:"blur"}]}]},publicPath:"/DataV/"}},created(){this.getList()},methods:{validData(e){return[0,1,2].includes(e)},beforeOpen(e,t){t=="edit"?A(this.form.id).then(a=>{const d=a.data.data;this.form=d,e()}):e()},rowDel(e,t){if(this.validData(t)&&this.$website.isDemo)return this.$message.error(this.$website.isDemoTip),!1;this.$confirm("此操作将永久删除, 是否继续?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(()=>{z(e.id).then(()=>{this.$message.success("删除成功"),this.getList()})}).catch(()=>{})},rowUpdate(e,t,a,d){if(this.validData(t)&&this.$website.isDemo)return a(),this.$message.error(this.$website.isDemoTip),!1;N(e).then(()=>{a(),this.$message.success("修改成功"),this.getList()}).catch(o=>{d()})},handleEdit(e,t){this.$refs.crud.rowEdit(e,t)},rowSave(e,t,a){F(e).then(()=>{this.$message.success("新增成功"),this.getList(),t()}).catch(d=>{a()})},getList(){this.loading=!0,q({categoryValue:this.search.name,current:1,size:100}).then(e=>{this.loading=!1;let a=e.data.data;a.forEach(d=>d._menu=!1),this.data=a})}}},H=e=>(I("data-v-208eda67"),e=e(),T(),e),W={class:"content__box content__nav"},J=["src"],Q=H(()=>s("div",null,[s("p",null,"创建分类"),s("span",null,"多种分类 更好管理")],-1)),X={class:"list-search"},Y={class:"content__box"},Z=["onMouseenter","onMouseleave"],ee={class:"content__main"},te={class:"content__logo"},se=["src"],oe={class:"content__name"},ne={class:"content__menu"},ae={class:"content__start"},ce=["onClick"],ie=["onClick"];function le(e,t,a,d,o,l){const D=n("avue-crud"),k=n("el-icon-search"),p=n("el-icon"),V=n("el-input"),C=n("el-header"),L=n("el-icon-edit"),x=n("el-icon-delete"),S=n("svg-icon"),P=n("el-empty"),U=n("el-main"),B=n("el-container"),f=R("loading");return _(),v(B,{class:"list category"},{default:r(()=>[y(i(D,b({ref:"crud",style:{display:"none"},option:o.option,modelValue:o.form,"onUpdate:modelValue":t[0]||(t[0]=c=>o.form=c),onRowSave:l.rowSave,onRowUpdate:l.rowUpdate,onRowDel:l.rowDel},e.$loadingParams,{"before-open":l.beforeOpen,data:o.data}),null,16,["option","modelValue","onRowSave","onRowUpdate","onRowDel","before-open","data"]),[[f,o.loading]]),i(C,{class:"content__header"},{default:r(()=>[s("div",W,[s("div",{class:"content__add",onClick:t[1]||(t[1]=c=>e.$refs.crud.rowAdd())},[s("img",{src:`${o.publicPath}img/category.png`,height:"40px",alt:""},null,8,J),Q]),s("div",X,[i(V,{modelValue:o.search.name,"onUpdate:modelValue":t[2]||(t[2]=c=>o.search.name=c),onKeyup:j(l.getList,["enter"]),placeholder:"请输入名称"},{suffix:r(()=>[i(p,{onClick:l.getList,class:"el-input__icon"},{default:r(()=>[i(k)]),_:1},8,["onClick"])]),_:1},8,["modelValue","onKeyup"])])])]),_:1}),y((_(),v(U,b({class:"content"},e.$loadingParams),{default:r(()=>[s("div",Y,[o.data.length>0?(_(!0),w($,{key:0},K(o.data,(c,m)=>(_(),w("div",{class:"content__item",onMouseenter:g=>c._menu=!0,onMouseleave:g=>c._menu=!1,key:m},[s("div",ee,[s("div",te,[s("img",{src:`${o.publicPath+"img/categorys.png"}`,alt:""},null,8,se)]),s("span",oe,M(c.categoryKey),1)]),s("div",ne,[s("div",ae,[s("div",{class:"content__btn",onClick:g=>l.handleEdit(c,m)},[i(p,null,{default:r(()=>[i(L)]),_:1})],8,ce),s("div",{class:"content__btn",onClick:g=>l.rowDel(c,m)},[i(p,null,{default:r(()=>[i(x)]),_:1})],8,ie)])])],40,Z))),128)):(_(),v(P,{key:1,class:"content__empty",description:"暂无数据"},{image:r(()=>[i(S,{"icon-class":"empty"})]),_:1}))])]),_:1},16)),[[f,o.loading]])]),_:1})}const de=O(G,[["render",le],["__scopeId","data-v-208eda67"]]);export{de as default};
|