1 line
2.5 KiB
JavaScript
1 line
2.5 KiB
JavaScript
import{At as e,Bt as t,C as n,Er as r,K as i,Pt as a,U as o,Wn as s,er as c,mn as l,tt as u,xn as d}from"./vendor-ag-grid~XmMajorFactor~XmConsultCategoryFactor~xmInfo~ZxFwView~HtFeeMethodTypeLineVie~ntegcu2a-CFxQnYK4.js";import"./vendor-ag-grid~XmMajorFactor~XmConsultCategoryFactor~xmInfo~ZxFwView~HtFeeMethodTypeLineVie~ntegcu2a-BnO-wAhh.js";import"./vendor-vue-CSlAvuUs.js";import{D as f}from"./workspace-DxKKyh8w.js";import"./decimal-D3bp1pbs.js";import{C as p,n as m}from"./index-CAPJG_im.js";var h={class:`h-full min-h-0 flex flex-col`},g={class:`rounded-lg border bg-card p-5`},_={class:`mb-4 border-b pb-3`},v={class:`text-sm font-semibold text-foreground`},y={class:`grid grid-cols-1 gap-5`},b={class:`space-y-1.5`},x={class:`text-xs font-medium text-muted-foreground`},S=[`placeholder`],C={class:`space-y-1.5`},w={class:`text-xs font-medium text-muted-foreground`},T=[`placeholder`],E=``,D=u({__name:`HtBaseInfo`,props:{contractId:{}},setup(u){let{t:D}=f(),O=D(`htBaseInfo.defaultQuality`),k=u,A=p(),j=()=>`ht-base-info-${k.contractId}`,M=s(O),N=s(``),P=s(``),F=async(e=!1)=>{let t={quality:M.value,duration:N.value},n=JSON.stringify(t);if(!e&&n===P.value)return;A.setKeyState(j(),t);let r=[];t.id=k.contractId,r.push(t);let i=r.map(e=>({...e,type:`${k.contractId}-Htbaseinfo`}));await m().upsertBatch(i),P.value=n},I=async()=>{let e=await A.loadKeyState(j()),t=!!(e&&(Object.prototype.hasOwnProperty.call(e,`quality`)||Object.prototype.hasOwnProperty.call(e,`duration`)));M.value=typeof e?.quality==`string`&&e.quality?e.quality:O,N.value=typeof e?.duration==`string`?e.duration:t?``:E,P.value=JSON.stringify({quality:M.value,duration:N.value}),t||F(!0)};return l([M,N],()=>{F()}),a(()=>{I()}),e(()=>{F(!0)}),(e,a)=>(t(),i(`div`,h,[o(`div`,g,[o(`div`,_,[o(`h3`,v,r(c(D)(`htBaseInfo.title`)),1)]),o(`div`,y,[o(`label`,b,[o(`div`,x,r(c(D)(`htBaseInfo.qualityLabel`)),1),d(o(`textarea`,{"onUpdate:modelValue":a[0]||=e=>M.value=e,rows:`5`,placeholder:c(D)(`htBaseInfo.qualityPlaceholder`),class:`w-full rounded-md border bg-background px-3 py-2 text-sm text-foreground outline-none focus:ring-2 focus:ring-primary/30 resize-none`},null,8,S),[[n,M.value]])]),o(`label`,C,[o(`div`,w,r(c(D)(`htBaseInfo.durationLabel`)),1),d(o(`textarea`,{"onUpdate:modelValue":a[1]||=e=>N.value=e,rows:`5`,placeholder:c(D)(`htBaseInfo.durationPlaceholder`),class:`w-full rounded-md border bg-background px-3 py-2 text-sm text-foreground outline-none focus:ring-2 focus:ring-primary/30 resize-none`},null,8,T),[[n,N.value]])])])])]))}});export{D as default}; |