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,mn as p,ot as m,w as h,z as g}from"./_plugin-vue_export-helper-C0lsYS1a.js";import{J as _,i as v,r as y}from"./GxPagination-DaT0MOF0.js";import{n as b,t as x}from"./form-B9CYF2OU.js";import{t as S}from"./GxDialog-DixGJxSz.js";import{t as C}from"./button-CTBy3KbX.js";import{t as w}from"./directive-2hBfY9mU.js";import{Ia as T}from"./stores-PVUTfPb_.js";var E={class:`controller-event px-3`},D={class:`flex flex-row justify-start mt-3`},O={class:`flex flex-row justify-center`},k=r({__name:`ChooseTranslateDialog`,props:g({visible:{type:Boolean},zxlPrdId:{},zhText:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:g([`choosed`],[`update:visible`]),setup(r,{emit:p}){let g=r,k=p,A=i(()=>`翻译：${g.zhText||``}`),j=m(r,`visible`),M=a([]),N=a(!1),P=async()=>{let e=g.zhText;if(!e){M.value=[];return}N.value=!0;try{M.value=(await T({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=v,f=C,p=y,m=S,g=w;return o(),h(m,{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`,E,[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(),h(f,{key:0,type:`primary`,link:``,onClick:e=>null,disabled:``},{default:c(()=>[...i[3]||=[u(`已选中`,-1)]]),_:1})):(o(),h(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`,D,[e(d(x),{class:`w-full`,"label-width":`auto`,"label-position":`right`},{default:c(()=>[e(d(b),{label:`选中文本`,prop:`ruleTitle`,placeholder:`请输入`},{default:c(()=>[e(d(_),{modelValue:I.value,"onUpdate:modelValue":i[0]||=e=>I.value=e},null,8,[`modelValue`])]),_:1})]),_:1})]),t(`div`,O,[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})])])),[[g,N.value]])]),_:1},8,[`modelValue`,`title`])}}});export{k as t};