organize-tree.6f5c7d.js 3.1 KB

1
  1. import{_ as j,d as M,aU as q,w as C,b0 as L,r as m,aC as O,l as a,H as P,o as f,c as v,j as t,C as i,J as E,F as R,D as V,aq as $,b4 as H,aN as _,h as I,L as J,M as G}from"./index.js";import{a as K,b as Q,c as W}from"./index.da6d65fd.js";import X from"./modal.ce6af8.js";const Y={key:0,class:"mt-[10px]"},Z=["type"],ee={key:1,class:"w-full leading-[198px] text-center border-[#ccc] border rounded-sm mt-2 color-[#ccc] font-bold"},te=M({__name:"organize-tree",props:{otherParms:{type:Object,required:!0}},emits:["breadcrumbChange"],setup(y,{expose:k,emit:h}){const B=y,r=q(!1),l=C(""),d=C({}),{data:b,run:D,loading:x,isError:F}=L({initalData:{}});function w(e){l.value=e.id,c(),h("breadcrumbChange",e)}function c(){const e={...l.value?{pid:l.value}:{},...B.otherParms};D(K({...e,page:1,size:1e3}))}function N(){c()}function T(e){H.confirm("\u786E\u5B9A\u8981\u5220\u9664?",{confirmButtonText:"\u786E\u5B9A",cancelButtonText:"\u53D6\u6D88",type:"warning"}).then(async()=>{(await Q({id:e})).code===0?(_.success("\u5220\u9664\u6210\u529F"),c()):_.warning("\u5220\u9664\u5931\u8D25")})}function z(e){d.value=e,r.value=!0}async function A(){const{name:e,id:o,companyNo:s}=d.value,u={name:e,id:o,companyNo:s,pid:l.value===""?"0":l.value};(await W(u)).code===0?(r.value=!1,_.success("\u66F4\u65B0\u6210\u529F"),c()):_.warning("\u66F4\u65B0\u6210\u529F")}return N(),k({changePid:e=>l.value=e,onSearch:()=>c()}),(e,o)=>{const s=m("ElTableColumn"),u=m("ElButton"),p=m("el-tooltip"),S=m("ElTable"),U=O("loading");return a(b).list&&!a(F)?P((f(),v("ul",Y,[t(S,{data:a(b).list,border:"",size:"small"},{default:i(()=>[t(s,{label:"\u7EC4\u7EC7\u540D\u79F0",prop:"name"}),t(s,{label:"\u516C\u53F8\u7F16\u7801",prop:"companyNo"}),t(s,{label:"\u516C\u53F8\u540D\u79F0",prop:"companyName"}),t(s,{label:"\u64CD\u4F5C",width:"140px"},{default:i(({row:n})=>[t(p,{effect:"dark",content:"\u7F16\u8F91\u7EC4\u7EC7",placement:"top"},{default:i(()=>[t(u,{link:"",class:"reset-margin",type:"primary",icon:a(E)("edits"),onClick:g=>z(n)},null,8,["icon","onClick"])]),_:2},1024),t(p,{effect:"dark",content:"\u5220\u9664\u7EC4\u7EC7",placement:"top"},{default:i(()=>[t(u,{link:"",class:"reset-margin",type:"primary",icon:a(E)("delete"),onClick:g=>T(n.id)},null,8,["icon","onClick"])]),_:2},1024),t(p,{effect:"dark",content:"\u4E0B\u4E00\u7EA7",placement:"top"},{default:i(()=>[t(u,{link:"",class:"reset-margin",type:"primary",icon:a(E)("arrow-right-s-line"),onClick:g=>w(n)},null,8,["icon","onClick"])]),_:2},1024)]),_:1})]),_:1},8,["data"]),(f(!0),v(R,null,V(a(b).item,n=>(f(),v("li",{class:"leading-[40px] flex gap-1 select-none cursor-pointer flex justify-between items-center",type:n.position+""=="1"?"primary":"info",key:n.id},[I("p",null,J(n.nickname),1),t(u,null,{default:i(()=>[G("\u8BBE\u4E3A\u8D1F\u8D23\u4EBA")]),_:1})],8,Z))),128)),t(X,{data:d.value,"onUpdate:data":o[0]||(o[0]=n=>d.value=n),visible:a(r),"onUpdate:visible":o[1]||(o[1]=n=>$(r)?r.value=n:null),disabledBusiness:!0,onSubmit:A},null,8,["data","visible"])])),[[U,a(x)]]):(f(),v("div",ee," \u6682\u65E0\u6570\u636E "))}}});var se=j(te,[["__file","C:/Users/Administrator/Desktop/projects/purchase-vue3/src/views/interest/organize/cpns/organize-tree.vue"]]);export{se as default};