import{d as I}from"./index-sxX6oYqj.js";/* empty css                   *//* empty css                   *//* empty css                        *//* empty css                  */import{u as N}from"./common-controller-tool-CauSZAqV.js";import"./request-yGlVfSRy.js";import{y as j,r as M,k as F,i as U,j as O,f as R,x as S}from"./element-plus-xvP3-5Ws.js";import{d as q,aQ as y,c as A,aR as L,b as p,w as h,V as f,W as l,N as m,X as P,M as Q,a1 as t,O as _,$ as W,_ as c,u as b}from"./vue-ChXMuCsz.js";const X={class:"controller-event px-3"},G={class:"flex flex-row justify-start mt-3"},H={class:"flex flex-row justify-center"},se=q({__name:"ChooseTranslateDialog",props:y({visible:{type:Boolean},zxlPrdId:{},zhText:{}},{visible:{type:Boolean},visibleModifiers:{}}),emits:y(["choosed"],["update:visible"]),setup(x,{emit:g}){const w=x,T=g,k=A(()=>`翻译：${w.zhText||""}`),s=L(x,"visible"),r=p([]),v=p(!1),C=async()=>{const o=w.zhText;if(!o){r.value=[];return}v.value=!0;try{const e=await N({url:"/zxl_rm/translate.svc",method:"post",params:{cmd:"getTextAllTranslate",isUseExternalService:!0,text:o}});r.value=e?.data||[]}catch{r.value=[]}v.value=!1};h(s,o=>{o&&C()},{immediate:!0});const u=p();h(u,o=>{const e=o?.termEn||"";n.value=e.replace(/\s+/g,"_")});const n=p(""),E=()=>{const o=Object.assign(u.value||{},{termEn:n.value});T("choosed",o),s.value=!1},V=()=>{r.value=[],n.value=""};return(o,e)=>{const i=M,d=F,B=j,z=I,D=S;return m(),f(z,{modelValue:s.value,"onUpdate:modelValue":e[2]||(e[2]=a=>s.value=a),onClose:V,title:k.value,"append-to-body":!0},{default:l(()=>[P((m(),Q("div",X,[t(B,{data:r.value,stripe:"","show-header":!0},{default:l(()=>[t(i,{prop:"",label:"序号",width:"60"},{default:l(({$index:a})=>[_("span",null,W(`${a+1}、`),1)]),_:1}),t(i,{prop:"termEn",label:"结果","min-width":"100","show-overflow-tooltip":""}),t(i,{prop:"source",label:"来源","min-width":"100","show-overflow-tooltip":""}),t(i,{prop:"priority",label:"权重",width:"100"}),t(i,{prop:"ruleNote",label:"操作",width:"120"},{default:l(({row:a})=>[u.value===a?(m(),f(d,{key:0,type:"primary",link:"",onClick:$=>null,disabled:""},{default:l(()=>[...e[3]||(e[3]=[c("已选中",-1)])]),_:1})):(m(),f(d,{key:1,type:"primary",link:"",onClick:$=>u.value=a},{default:l(()=>[...e[4]||(e[4]=[c("选择",-1)])]),_:1},8,["onClick"]))]),_:1})]),_:1},8,["data"]),_("div",G,[t(b(U),{class:"w-full","label-width":"auto","label-position":"right"},{default:l(()=>[t(b(O),{label:"选中文本",prop:"ruleTitle",placeholder:"请输入"},{default:l(()=>[t(b(R),{modelValue:n.value,"onUpdate:modelValue":e[0]||(e[0]=a=>n.value=a)},null,8,["modelValue"])]),_:1})]),_:1})]),_("div",H,[t(d,{onClick:e[1]||(e[1]=a=>s.value=!1)},{default:l(()=>[...e[5]||(e[5]=[c("取消",-1)])]),_:1}),t(d,{type:"primary",onClick:E},{default:l(()=>[...e[6]||(e[6]=[c("确定",-1)])]),_:1})])])),[[D,v.value]])]),_:1},8,["modelValue","title"])}}});export{se as _};
