import{G as I,c as M}from"./index-share-B6-9kT2P.js";import{A as N,B as j,d as F,l as U,m as A,e as G,v as O}from"./element-plus-BbvtkfL8.js";import{d as P,aP as y,e as R,aQ as S,f as p,w as h,X as f,O as m,Y as l,a1 as q,M as L,a4 as t,R as _,$ as Q,ab as c,u as b}from"./vue-CrDyBScg.js";const X={class:"controller-event px-3"},Y={class:"flex flex-row justify-start mt-3"},H={class:"flex flex-row justify-center"},Z=P({__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,C=R(()=>`翻译：${w.zhText||""}`),s=S(x,"visible"),n=p([]),v=p(!1),k=async()=>{const a=w.zhText;if(!a){n.value=[];return}v.value=!0;try{const e=await M({url:"/zxl_rm/translate.svc",method:"post",params:{cmd:"getTextAllTranslate",isUseExternalService:!0,text:a}});n.value=e?.data||[]}catch{n.value=[]}v.value=!1};h(s,a=>{a&&k()},{immediate:!0});const u=p();h(u,a=>{const e=a?.termEn||"";r.value=e.replace(/\s+/g,"_")});const r=p(""),E=()=>{const a=Object.assign(u.value||{},{termEn:r.value});T("choosed",a),s.value=!1},V=()=>{n.value=[],r.value=""};return(a,e)=>{const i=j,d=F,B=N,D=I,z=O;return m(),f(D,{modelValue:s.value,"onUpdate:modelValue":e[2]||(e[2]=o=>s.value=o),onClose:V,title:C.value,"append-to-body":!0},{default:l(()=>[q((m(),L("div",X,[t(B,{data:n.value,stripe:"","show-header":!0},{default:l(()=>[t(i,{prop:"",label:"序号",width:"60"},{default:l(({$index:o})=>[_("span",null,Q(`${o+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:o})=>[u.value===o?(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=o},{default:l(()=>[...e[4]||(e[4]=[c("选择",-1)])]),_:1},8,["onClick"]))]),_:1})]),_:1},8,["data"]),_("div",Y,[t(b(U),{class:"w-full","label-width":"auto","label-position":"right"},{default:l(()=>[t(b(A),{label:"选中文本",prop:"ruleTitle",placeholder:"请输入"},{default:l(()=>[t(b(G),{modelValue:r.value,"onUpdate:modelValue":e[0]||(e[0]=o=>r.value=o)},null,8,["modelValue"])]),_:1})]),_:1})]),_("div",H,[t(d,{onClick:e[1]||(e[1]=o=>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})])])),[[z,v.value]])]),_:1},8,["modelValue","title"])}}});export{Z as _};
