import{ee as T,ef as v,eg as x,m as r,eh as g,ei as q,_}from"./index-design-C8wrC2s6.js";import{d as w,aQ as m,aR as R,r as z,f as E,w as B,M as C,O as F,a1 as P,R as c,$ as A,a2 as $,a4 as V,n as b}from"./vue-BQyCGvUQ.js";import{e as k}from"./element-plus-DXXGg0hD.js";const M={class:"intercom-room"},U={class:"text-sm text-gray-600 mb-2"},D={class:"chart-input"},L=w({__name:"IntercomRoom",props:m({zxlPrdId:{},qType:{},defaultText:{},stopUpdateTextFocus:{type:Boolean},autoUpdateTextFocus:{type:Boolean},hiddenTip:{type:Boolean}},{loading:{},loadingModifiers:{}}),emits:m(["confim-successed","confim-failed"],["update:loading"]),setup(d,{expose:f,emit:y}){const t=d,u=y,o=R(d,"loading"),n=z({placeholder:"请输入",val:""}),p=E(),h=()=>p.value?.focus();return B(()=>t.defaultText,s=>{n.val=s||"",t.autoUpdateTextFocus&&b(()=>{h()})},{immediate:!0}),f({confimChartInput:async()=>{const s=t.zxlPrdId;o.value=!0;let e=null;try{if(/^module|function$/.test(t.qType)){const a=t.qType;e=await T(s,a,n.val)}else if(/^role$/.test(t.qType)){const a=t.qType;e=await v(s,a,n.val)}else if(/^businessRule$/.test(t.qType)){const l=await x(s,"bizRule",n.val);if(l){const I=l.data||[];e={total:l.total,data:I.map(i=>({sort:i.sort,function:i.ruleTitle,explanation:i.ruleDesc}))}}}u("confim-successed",e)}catch(a){u("confim-failed",a),r({type:"warning",message:a||"无返回值！"})}return o.value=!1,e},confimChartInputEntityField:async()=>{const s=t.zxlPrdId;o.value=!0;let e=null;try{if(/^entityField$/.test(t.qType)){const a=t.qType;e=await g(s,"entity",n.val)}}catch(a){r({type:"warning",message:a||"无返回值！"})}return o.value=!1,e},confimChartInputEnumItemList:async()=>{const s=t.zxlPrdId;o.value=!0;let e=null;try{if(/^fieldEnum$/.test(t.qType)){const a=t.qType;e=await q(s,"fieldEnum",n.val)}}catch(a){r({type:"warning",message:a||"无返回值！"})}return o.value=!1,e}}),(s,e)=>{const a=k;return F(),C("div",M,[P(c("p",U,A("您将询问AI如下需求："),512),[[$,!t.hiddenTip]]),e[1]||(e[1]=c("div",{class:"chart-history"},null,-1)),c("div",D,[V(a,{ref_key:"chartInputRef",ref:p,type:"textarea",modelValue:n.val,"onUpdate:modelValue":e[0]||(e[0]=l=>n.val=l),autosize:{minRows:5,maxRows:10},autofocus:"",placeholder:n.placeholder,resize:"none"},null,8,["modelValue","placeholder"])])])}}}),H=_(L,[["__scopeId","data-v-596a13be"]]);export{H as I};
