import{A as e,C as t,E as n,M as r,S as i,St as a,X as o,cn as s,dt as c,ft as l,k as u,kt as d,lt as f,ot as p,w as m,z as h}from"./_plugin-vue_export-helper-9JxOV_6y.js";import{J as g,i as _,r as v}from"./GxPagination-1gJXbpdv.js";import{n as y,t as b}from"./form-CR2ksibI.js";import{t as x}from"./GxDialog-D15Qks3A.js";import{t as S}from"./button-CENWFHkZ.js";import{t as C}from"./directive-CkUp73VW.js";import{Ua as w}from"./stores-CQxCz3yU.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=r({__name:`ChooseTranslateDialog`,props:h({visible:{type:Boolean},zxlPrdId:{},zhText:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:h([`choosed`],[`update:visible`]),setup(r,{emit:h}){let O=r,k=h,A=i(()=>`翻译：${O.zhText||``}`),j=p(r,`visible`),M=a([]),N=a(!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};f(j,e=>{e&&P()},{immediate:!0});let F=a();f(F,e=>{I.value=(e?.termEn||``).replace(/\s+/g,`_`)});let I=a(``),L=()=>{k(`choosed`,Object.assign(F.value||{},{termEn:I.value})),j.value=!1},R=()=>{M.value=[],I.value=``};return(r,i)=>{let a=_,f=S,p=v,h=x,w=C;return o(),m(h,{modelValue:j.value,"onUpdate:modelValue":i[2]||=e=>j.value=e,onClose:R,title:A.value,"append-to-body":!0},{default:c(()=>[l((o(),n(`div`,T,[e(p,{data:M.value,stripe:``,"show-header":!0},{default:c(()=>[e(a,{prop:``,label:`序号`,width:`60`},{default:c(({$index:e})=>[t(`span`,null,s(`${e+1}、`),1)]),_:1}),e(a,{prop:`termEn`,label:`结果`,"min-width":`100`,"show-overflow-tooltip":``}),e(a,{prop:`source`,label:`来源`,"min-width":`100`,"show-overflow-tooltip":``}),e(a,{prop:`priority`,label:`权重`,width:`100`}),e(a,{prop:`ruleNote`,label:`操作`,width:`120`},{default:c(({row:e})=>[F.value===e?(o(),m(f,{key:0,type:`primary`,link:``,onClick:e=>null,disabled:``},{default:c(()=>[...i[3]||=[u(`已选中`,-1)]]),_:1})):(o(),m(f,{key:1,type:`primary`,link:``,onClick:t=>F.value=e},{default:c(()=>[...i[4]||=[u(`选择`,-1)]]),_:1},8,[`onClick`]))]),_:1})]),_:1},8,[`data`]),t(`div`,E,[e(d(b),{class:`w-full`,"label-width":`auto`,"label-position":`right`},{default:c(()=>[e(d(y),{label:`选中文本`,prop:`ruleTitle`,placeholder:`请输入`},{default:c(()=>[e(d(g),{modelValue:I.value,"onUpdate:modelValue":i[0]||=e=>I.value=e},null,8,[`modelValue`])]),_:1})]),_:1})]),t(`div`,D,[e(f,{onClick:i[1]||=e=>j.value=!1},{default:c(()=>[...i[5]||=[u(`取消`,-1)]]),_:1}),e(f,{type:`primary`,onClick:L},{default:c(()=>[...i[6]||=[u(`确定`,-1)]]),_:1})])])),[[w,N.value]])]),_:1},8,[`modelValue`,`title`])}}});export{O as t};