import{C as e,O as t,R as n,S as r,St as i,T as a,Y as o,at as s,cn as c,ct as l,dt as u,ft as d,j as f,k as p,kt as m,x as h}from"./vue.runtime.esm-bundler-DpGzKKN4.js";import"./GxPagination-DOexUzbO.js";import{m as g}from"./vnode-DU8g6Rf7.js";import{n as _,t as v}from"./table-C_Bpc8FZ.js";import{n as y,t as b}from"./form-Bb1_iOEA.js";import{t as x}from"./button-CHjzS7b0.js";import{t as S}from"./directive-9SA1IQHd.js";import{t as C}from"./GxDialog-BUqY5Fq3.js";import{Zo as w}from"./stores-BWYw2E2w.js";import"./css-CW_FwBqc2.js";import"./css-DunA3L7q.js";import"./css-ropEN6qH.js";import"./css-BrGVMe3H.js";var T={class:`controller-event px-3`},E={class:`flex flex-row justify-start mt-3`},D={class:`flex flex-row justify-center`},O=f({__name:`ChooseTranslateDialog`,props:n({visible:{type:Boolean},zxlPrdId:{},zhText:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:n([`choosed`],[`update:visible`]),setup(n,{emit:f}){let O=n,k=f,A=h(()=>`翻译：${O.zhText||``}`),j=s(n,`visible`),M=i([]),N=i(!1),P=async()=>{let e=O.zhText;if(!e){M.value=[];return}N.value=!0;try{M.value=(await w({url:`/zxl_rm/translate.svc`,method:`post`,params:{cmd:`getTextAllTranslate`,isUseExternalService:!0,text:e}}))?.data||[]}catch{M.value=[]}N.value=!1};l(j,e=>{e&&P()},{immediate:!0});let F=i();l(F,e=>{I.value=(e?.termEn||``).replace(/\s+/g,`_`)});let I=i(``),L=()=>{k(`choosed`,Object.assign(F.value||{},{termEn:I.value})),j.value=!1},R=()=>{M.value=[],I.value=``};return(n,i)=>{let s=_,l=x,f=v,h=C,w=S;return o(),e(h,{modelValue:j.value,"onUpdate:modelValue":i[2]||=e=>j.value=e,onClose:R,title:A.value,"append-to-body":!0},{default:u(()=>[d((o(),a(`div`,T,[p(f,{data:M.value,stripe:``,"show-header":!0},{default:u(()=>[p(s,{prop:``,label:`序号`,width:`60`},{default:u(({$index:e})=>[r(`span`,null,c(`${e+1}、`),1)]),_:1}),p(s,{prop:`termEn`,label:`结果`,"min-width":`100`,"show-overflow-tooltip":``}),p(s,{prop:`source`,label:`来源`,"min-width":`100`,"show-overflow-tooltip":``}),p(s,{prop:`priority`,label:`权重`,width:`100`}),p(s,{prop:`ruleNote`,label:`操作`,width:`120`},{default:u(({row:n})=>[F.value===n?(o(),e(l,{key:0,type:`primary`,link:``,onClick:e=>null,disabled:``},{default:u(()=>[...i[3]||=[t(`已选中`,-1)]]),_:1})):(o(),e(l,{key:1,type:`primary`,link:``,onClick:e=>F.value=n},{default:u(()=>[...i[4]||=[t(`选择`,-1)]]),_:1},8,[`onClick`]))]),_:1})]),_:1},8,[`data`]),r(`div`,E,[p(m(b),{class:`w-full`,"label-width":`auto`,"label-position":`right`},{default:u(()=>[p(m(y),{label:`选中文本`,prop:`ruleTitle`,placeholder:`请输入`},{default:u(()=>[p(m(g),{modelValue:I.value,"onUpdate:modelValue":i[0]||=e=>I.value=e},null,8,[`modelValue`])]),_:1})]),_:1})]),r(`div`,D,[p(l,{onClick:i[1]||=e=>j.value=!1},{default:u(()=>[...i[5]||=[t(`取消`,-1)]]),_:1}),p(l,{type:`primary`,onClick:L},{default:u(()=>[...i[6]||=[t(`确定`,-1)]]),_:1})])])),[[w,N.value]])]),_:1},8,[`modelValue`,`title`])}}});export{O as t};