import{v as E,$ as I,ax as C}from"./index.17037962789732.js";import"./index.1703796278973300.js";import"./index.170379627897315.js";import"./index.170379627897317.js";import"./index.1703796278973301.js";import"./index.1703796278973302.js";import"./index.170379627897332.js";import"./index.1703796278973303.js";import"./index.170379627897339.js";import"./index.170379627897316.js";import"./index.170379627897314.js";import"./index.1703796278973304.js";import"./index.1703796278973305.js";import"./index.1703796278973306.js";import"./index.170379627897335.js";import"./index.170379627897318.js";import"./index.170379627897319.js";import"./index.170379627897320.js";import"./index.170379627897321.js";import"./index.170379627897322.js";import"./index.170379627897323.js";import"./index.170379627897324.js";import"./index.170379627897325.js";import"./index.170379627897326.js";import"./index.170379627897327.js";import"./index.170379627897328.js";import"./Item.1703796278973.js";import{a as c}from"./comm.1703796278973.js";import{g as R}from"./department.1703796278973.js";import{d as v,k as l,l as S,o as k,x as F,b as g,u as _,F as L}from"./vue.1703796278973.js";import{_ as A}from"./_plugin-vue_export-helper.1703796278973.js";import"./index.17037962789733.js";import"./dayjs.min.1703796278973.js";import"./isArray.1703796278973.js";import"./editor.api.1703796278973.js";import"./preload-helper.1703796278973.js";import"./monaco.contribution.1703796278973.js";import"./system.1703796278973.js";import"./index.170379627897333.js";import"./index.170379627897334.js";import"./default.1703796278973.js";import"./permission.1703796278973.js";import"./consts.1703796278973.js";import"./404.1703796278973.js";c("/scene/reportProperty.png"),c("/scene/reportProperty.png"),c("/scene/readProperty.png"),c("/scene/writeProperty.png"),c("/scene/invokeFunction.png");const B=(u,m)=>{const o=[],p=new Map,s=a=>{a.forEach(r=>{p.set(r.id,{pid:r.parentId}),r.children&&r.children.length&&s(r.children)})},i=a=>{const r=p.get(a);r&&(o.push(a),p.has(p)&&i(r.pid))};return s(m),i(u),o},T=v({name:"OrgList"}),j=v({...T,props:{rowKeys:{type:Array,default:()=>[]},productId:{type:String,default:""}},emits:["update"],setup(u,{emit:m}){const o=u,p=l(),s=l([]);l(o.rowKeys.map(e=>e.value));const i=l({name:"sortIndex",order:"asc"}),a=l(!0),r=S(()=>o.rowKeys.map(e=>e.value)),y=[{title:"名称",width:300,ellipsis:!0,dataIndex:"name",search:{type:"string"}},{title:"排序",dataIndex:"sortIndex",sorter:!0}],f=e=>{p.value=e},h=(e,n,t)=>{t.order?i.value={name:t.columnKey,order:t.order.replace("end","")}:i.value={name:"sortIndex",order:"asc"}},x=async e=>{var d;const n={paging:!1,sorts:[i.value]};e.terms&&e.terms.length&&(n.terms=e.terms);const t=await R(n);return a.value&&o.rowKeys.length&&(a.value=!1,s.value=B((d=o.rowKeys[0])==null?void 0:d.value,t.result)),t},w=(e,n)=>{const t=n[0];console.log(e,n),m("update",[{name:t.name,value:t.id}])},b=()=>{m("update",[])},P=e=>{s.value=e};return(e,n)=>{const t=E,d=I,K=C;return k(),F(L,null,[g(t,{columns:y,type:"simple",onSearch:f,class:"scene-search",target:"scene-triggrt-device-category"}),g(d,{style:{margin:"0"}}),g(K,{ref:"instanceRef",model:"TABLE",type:"TREE",columns:y,request:x,scroll:{y:200},bodyStyle:{padding:"16px 0 0 0"},expandable:{expandedRowKeys:_(s),onExpandedRowsChange:P},rowSelection:{type:"radio",selectedRowKeys:_(r),onChange:w},onChange:h,onSelectCancel:b},null,8,["expandable","rowSelection"])],64)}}});const Ce=A(j,[["__scopeId","data-v-7d6e8bd5"]]);export{Ce as default};