import{A as e,C as t,Ct as n,E as r,M as i,S as a,St as o,X as s,cn as c,dt as l,ft as u,h as d,k as f,kt as p,lt as m,ot as h,t as g,w as _}from"./_plugin-vue_export-helper-9JxOV_6y.js";import{i as v,r as y}from"./GxPagination-CS4FI5Lo.js";import{n as b,t as x}from"./form-D3h-alBR.js";import{t as S}from"./button-BmZH_xSR.js";import{t as C}from"./dialog-0MPkyu-c.js";import{t as w}from"./directive-pNcZrfik.js";import{Sr as T,bt as E,yt as D}from"./stores-DGGArz7t.js";import{a as O}from"./validate-xgwjLZZ4.js";var k={class:`config-import-from-other-select-dialog`},A={class:`flex flex-row flex-nowrap w-full place-content-between`},j={style:{"text-align":`center`,"margin-top":`20px`}},M=g(i({__name:`choice-data-entity-field`,props:{visible:{type:Boolean},visibleModifiers:{}},emits:[`update:visible`],setup(i){let g=D(),M=E(),N=a(()=>M.dataEntitlyFieldConfigChildren.choosedFieldId),P=a(()=>M.dataEntitlyFieldConfigChildren.bizEntityObId),F=a(()=>{let e=P.value,t=g.curRequestDataEntityList;return e&&t.find(t=>t.bizEntityObId===e)||null}),I=h(i,`visible`),L=o([]);o(0),m(I,e=>{e&&B()});let R=()=>{I.value=!1},z=n({loading:!1}),B=async()=>{z.loading=!0;let e={zxlPrdId:g.zxlPrdId,bizEntityObId:P.value};try{if(!e.bizEntityObId)throw Error(`数据实体ID不能为空！`);L.value=await T(e)}catch(e){O({type:`error`,message:e?.message||`获取数据失败！`})}z.loading=!1},V=async e=>{let t=M.dataEntitlyFieldConfigChildren.callbackFn;typeof t==`function`&&t(e),R()};return(n,i)=>{let a=b,o=x,m=v,h=S,g=y,T=C,E=w;return s(),r(`div`,k,[e(T,{title:`选择数据实体字段`,modelValue:I.value,"onUpdate:modelValue":i[2]||=e=>I.value=e,width:`700px`,onClose:R,"append-to-body":``},{default:l(()=>[u((s(),r(`div`,null,[e(o,{model:p(z),"label-width":`auto`,onSubmit:i[0]||=d(()=>{},[`prevent`])},{default:l(()=>[e(a,{label:`接口名称`,prop:`openDialogTarget`},{default:l(()=>[t(`div`,A,[t(`div`,null,`当前数据实体为：【`+c(F.value?.bizEntityNameCn)+`】`,1)])]),_:1})]),_:1},8,[`model`]),e(g,{data:L.value,stripe:``,"max-height":500,border:``},{default:l(()=>[e(m,{label:`字段编号`,prop:`fieldNo`,width:`90`}),e(m,{label:`字段名称`,prop:`fieldNameCn`,width:`90`,"show-overflow-tooltip":!0}),e(m,{label:`英文名`,prop:`fieldName`,"show-overflow-tooltip":!0}),e(m,{label:`数据类型`,prop:`fieldTypeStr`,width:`90`,"show-overflow-tooltip":!0}),e(m,{label:`字段长度`,prop:`fieldLength`,width:`90`,"show-overflow-tooltip":!0}),e(m,{label:`操作`,prop:``,width:`200`,align:`center`},{default:l(({row:e})=>[N.value===e.fieldObId?(s(),_(h,{key:0,title:`已选中`,class:`!p-0 w-9`,text:``,onClick:d(e=>null,[`stop`]),disabled:``},{default:l(()=>[...i[3]||=[f(`已选中`,-1)]]),_:1})):(s(),_(h,{key:1,title:`选择`,class:`!p-0 w-9`,text:``,onClick:d(t=>V(e),[`stop`])},{default:l(()=>[...i[4]||=[f(`选择`,-1)]]),_:1},8,[`onClick`]))]),_:1})]),_:1},8,[`data`])])),[[E,p(z).loading]]),t(`div`,j,[e(h,{class:`pv20 mr20 ml20 mt20`,type:`info`,onClick:i[1]||=e=>I.value=!1},{default:l(()=>[...i[5]||=[f(` 关闭 `,-1)]]),_:1})])]),_:1},8,[`modelValue`])])}}}),[[`__scopeId`,`data-v-56da62a6`]]);export{M as t};