import{d as g,gF as y,gG as h,V as v,r as b,Z as k,k as l,ay as x,ac as S,l as o,c as D,o as w,w as B,j as c,i as p,A as I,X as T}from"./index-9PRMimni.js";import{B as q}from"./Table-0PViRYCf.js";import"./Table.vue_vue_type_style_index_0_scoped_7b9e6ece_lang-BoW2DV_e.js";import"./vuedraggable.umd-Co2xEC3p.js";import"./Render.vue_vue_type_script_lang-DKUYY0Zw.js";import"./componentMap-CElCaWis.js";import"./propTypes-CebMRUpe.js";import"./format-DgF6KtHk.js";import"./omit-B2_8Y6O_.js";import"./_flatRest-DBrd2CHT.js";import"./flatten-DeoUZLdb.js";import"./print-CT_2hrjP.js";import"./basicModal.vue_vue_type_script_setup_true_lang-CsJydKhW.js";import"./basicModal.vue_vue_type_style_index_0_lang-8QZP7ApW.js";import"./useModal-CO65vga3.js";import"./componentSetting-DVhNDBTO.js";import"./useTimeout-BxFilWvD.js";import"./usePageCache-DluHn7Yy.js";import"./tabsView-BXskTdVh.js";import"./Flex-CTSf12gq.js";const V={class:"mt-5"},K=g({__name:"GoodPracticesDiscovered",props:y({tabReadonly:{type:Boolean}},{formData:{type:Object,default:()=>({})},formDataModifiers:{}}),emits:["update:formData"],setup(i){const u=i,a=h(i,"formData"),{t:n}=v(),s=b([]),d=[{title:n("hsqe.planner.no"),key:"num",width:80,render:(t,e)=>e+1},{title:n("hsqe.auditInspection.qualitySafetyInspection.scoreItemContent"),key:"content",ellipsis:!1,align:"left",render:t=>k(l,{value:t.content,type:"textarea",placeholder:n("common.inputText"),disabled:u.tabReadonly,onUpdateValue:e=>{t.content=e,f()}})}];x(()=>a,()=>{S(()=>{m()})},{immediate:!0,deep:!0});async function m(){s.value=[];let t=0;for(let e=1;e<=20;e++)a.value[`good_practices_discovered_${e}`]&&(t=e);for(let e=1;e<=t;e++)s.value.push({content:a.value[`good_practices_discovered_${e}`]})}function f(){for(let t=1;t<=20;t++)a.value[`good_practices_discovered_${t}`]=o(s)?.[t-1]?.content||""}return(t,e)=>{const _=T;return w(),D(_,null,{default:B(()=>[c(o(q),{ref:"basicTableRef",columns:d,dataSource:o(s),"row-key":r=>r.id,autoScrollX:!0,immediate:!1,pagination:!1,showTableSetting:!1,"virtual-scroll":""},null,8,["dataSource","row-key"]),p("div",V,[p("h1",null,I(o(n)("hsqe.auditInspection.qualitySafetyInspection.summaryAndSuggestions")),1),c(o(l),{type:"textarea",value:a.value.summary_and_suggestions,"onUpdate:value":e[0]||(e[0]=r=>a.value.summary_and_suggestions=r),placeholder:o(n)("common.inputText"),disabled:t.tabReadonly},null,8,["value","placeholder","disabled"])])]),_:1})}}});export{K as default};
