Agriculture-front-end/dist/assets/index.20d91cbb.js

2 lines
8.5 KiB
JavaScript
Raw Normal View History

2023-05-05 16:32:31 +08:00
import{J as V,_ as ce,K as fe,r as h,z as _e,T as he,d,S as L,o as p,c as P,M as b,N as ve,f as a,e,w as l,j as ge,F as Q,D as j,k as v,m,L as O,l as z,x as J,g as I,s as ye,R as be}from"./index.276e09af.js";function M(r){return V({url:"/system/dept/list",method:"get",params:r})}function Ve(r){return V({url:"/system/dept/list/exclude/"+r,method:"get"})}function ke(r){return V({url:"/system/dept/"+r,method:"get"})}function we(r){return V({url:"/system/dept",method:"post",data:r})}function xe(r){return V({url:"/system/dept",method:"put",data:r})}function Ne(r){return V({url:"/system/dept/"+r,method:"delete"})}const Ie={class:"app-container"},Ce={class:"dialog-footer"},De=fe({name:"Dept"}),Ue=Object.assign(De,{setup(r){const{proxy:s}=ye(),{sys_normal_disable:C}=s.useDict("sys_normal_disable"),E=h([]),_=h(!1),D=h(!0),x=h(!0),U=h(""),S=h([]),T=h(!0),R=h(!0),G=_e({form:{},queryParams:{deptName:void 0,status:void 0},rules:{parentId:[{required:!0,message:"\u4E0A\u7EA7\u90E8\u95E8\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],deptName:[{required:!0,message:"\u90E8\u95E8\u540D\u79F0\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],orderNum:[{required:!0,message:"\u663E\u793A\u6392\u5E8F\u4E0D\u80FD\u4E3A\u7A7A",trigger:"blur"}],email:[{type:"email",message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u90AE\u7BB1\u5730\u5740",trigger:["blur","change"]}],phone:[{pattern:/^1[3|4|5|6|7|8|9][0-9]\d{8}$/,message:"\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u624B\u673A\u53F7\u7801",trigger:"blur"}]}}),{queryParams:g,form:o,rules:H}=he(G);function y(){D.value=!0,M(g.value).then(u=>{E.value=s.handleTree(u.data,"deptId"),D.value=!1})}function W(){_.value=!1,$()}function $(){o.value={deptId:void 0,parentId:void 0,deptName:void 0,orderNum:0,leader:void 0,phone:void 0,email:void 0,status:"0"},s.resetForm("deptRef")}function q(){y()}function X(){s.resetForm("queryRef"),q()}function F(u){$(),M().then(n=>{S.value=s.handleTree(n.data,"deptId")}),u!=null&&(o.value.parentId=u.deptId),_.value=!0,U.value="\u6DFB\u52A0\u90E8\u95E8"}function Y(){R.value=!1,T.value=!T.value,be(()=>{R.value=!0})}function Z(u){$(),Ve(u.deptId).then(n=>{S.value=s.handleTree(n.data,"deptId")}),ke(u.deptId).then(n=>{o.value=n.data,_.value=!0,U.value="\u4FEE\u6539\u90E8\u95E8"})}function ee(){s.$refs.deptRef.validate(u=>{u&&(o.value.deptId!=null?xe(o.value).then(n=>{s.$modal.msgSuccess("\u4FEE\u6539\u6210\u529F"),_.value=!1,y()}):we(o.value).then(n=>{s.$modal.msgSuccess("\u65B0\u589E\u6210\u529F"),_.value=!1,y()}))})}function le(u){s.$modal.confirm('\u662F\u5426\u786E\u8BA4\u5220\u9664\u540D\u79F0\u4E3A"'+u.deptName+'"\u7684\u6570\u636E\u9879?').then(function(){return Ne(u.deptId)}).then(()=>{y(),s.$modal.msgSuccess("\u5220\u9664\u6210\u529F")}).catch(()=>{})}return y(),(u,n)=>{const k=d("el-input"),i=d("el-form-item"),te=d("el-option"),ae=d("el-select"),c=d("el-button"),A=d("el-form"),f=d("el-col"),ne=d("right-toolbar"),B=d("el-row"),w=d("el-table-column"),oe=d("dict-tag"),de=d("el-table"),ue=d("el-tree-select"),re=d("el-input-number"),se=d("el-radio"),pe=d("el-radio-group"),ie=d("el-dialog"),N=L("hasPermi"),me=L("loading");return p(),P("div",Ie,[b(e(A,{model:a(g),ref:"queryRef",inline:!0},{default:l(()=>[e(i,{label:"\u90E8\u95E8\u540D\u79F0",prop:"deptName"},{default:l(()=>[e(k,{modelValue:a(g).deptName,"onUpdate:modelValue":n[0]||(n[0]=t=>a(g).deptName=t),placeholder:"\u8BF7\u8F93\u5165\u90E8\u95E8\u540D\u79F0",clearable:"",style:{width:"200px"},onKeyup:ge(q,["enter"])},null,8,["modelValue","onKeyup"])]),_:1}),e(i,{label:"\u72B6\u6001",prop:"status"},{default:l(()=>[e(ae,{modelValue:a(g).status,"onUpdate:modelValue":n[1]||(n[1]=t=>a(g).status=t),placeholder:"\u90E8\u95E8\u72B6\u6001",clearable:"",style:{width:"200px"}},{default:l(()=>[(p(!0),P(Q,null,j(a(C),t=>(p(),v(te,{key:t.value,label:t.label,value:t.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])]),_:1}),e(i,null,{default:l(()=>[e(c,{type:"primary",icon:"Search",onClick:q},{default:l(()=>[m("\u641C\u7D22")]),_:1}),e(c,{icon:"Refresh",onClick:X},{default:l(()=>[m("\u91CD\u7F6E")]),_:1})]),_:1})]),_:1},8,["model"]),[[ve,a(x)]]