import{a as I,aU as M}from"./index-design-C8wrC2s6.js";import{A as N,B as U,d as j,l as F,m as R,e as A,v as O}from"./element-plus-DXXGg0hD.js";import{d as S,aQ as y,e as q,aR as L,f as p,w as h,X as f,O as m,Y as l,a1 as P,M as Q,a4 as t,R as _,$ as X,ab as c,u as b}from"./vue-BQyCGvUQ.js";const Y={class:"controller-event px-3"},G={class:"flex flex-row justify-start mt-3"},H={class:"flex flex-row justify-center"},Z=S({__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=q(()=>`翻译：${w.zhText||""}`),s=L(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=U,d=j,B=N,z=I,D=O;return m(),f(z,{modelValue:s.value,"onUpdate:modelValue":e[2]||(e[2]=o=>s.value=o),onClose:V,title:C.value,"append-to-body":!0},{default:l(()=>[P((m(),Q("div",Y,[t(B,{data:n.value,stripe:"","show-header":!0},{default:l(()=>[t(i,{prop:"",label:"序号",width:"60"},{default:l(({$index:o})=>[_("span",null,X(`${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",G,[t(b(F),{class:"w-full","label-width":"auto","label-position":"right"},{default:l(()=>[t(b(R),{label:"选中文本",prop:"ruleTitle",placeholder:"请输入"},{default:l(()=>[t(b(A),{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})])])),[[D,v.value]])]),_:1},8,["modelValue","title"])}}});export{Z as _};
