7 lines
39 KiB
JavaScript
7 lines
39 KiB
JavaScript
import{E as Tn}from"./el-alert-GKLeF-ml.js";import{O as Rn,E as Re}from"./el-popper-DwsDzc1A.js";import{f as Ye,E as le,e as Sn}from"./index-COtHB4lx.js";import{E as Se}from"./index-DvecKFrV.js";import{v as On}from"./directive-BNrYmpdY.js";import{d as z,h as j,B as H,G as He,f as U,H as We,y as _,F as ae,b as Nn,R as ke,V as _e,ba as W,D as qe,aT as Fn,a9 as ce,j as E,bb as Dn,P as Bn,ai as J,o as c,e as D,w as v,s as k,bc as Pn,bd as An,W as ve,S as Ln,E as Xe,a as Oe,aW as Mn,am as Kn,N as Ze,c as O,aX as Qe,Y as ye,n as fe,g as K,q as l,r as Jn,aL as Te,M as ne,be as Je,al as zn,l as jn,ab as xe,ad as he,x as P,aa as N,aR as Gn,K as ze,ac as Un,A as oe,aY as Yn,aZ as Hn}from"./index-DS73WiJW.js";import{E as $e}from"./index-ctkuqiuE.js";import"./el-tooltip-l0sNRNKZ.js";/* empty css */import{A as Wn}from"./AppConfirmDialog-DEq-NibG.js";import{P as qn}from"./PageCard-CXygDeSp.js";import{b as Xn,f as Zn,h as Ve,i as Qn,j as xn,k as et,l as nt}from"./dataset-DL0YrzrD.js";import{E as tt,a as ot}from"./el-select-CHKMfjyJ.js";import{_ as Z}from"./index-oP6kINt_.js";import{E as at}from"./el-scrollbar-DErsaip4.js";import{d as lt,a as en,b as rt}from"./dropdown-CJ-AVSl8.js";import{c as st}from"./castArray-PcoOufI5.js";import{c as nn,E as it}from"./el-dialog-BjL10OpB.js";import{_ as pe}from"./_plugin-vue_export-helper-DlAUqK2U.js";import{E as tn}from"./index-Bl2Fsjov.js";import{E as ut}from"./el-pagination-BezdVZVw.js";import{E as dt,a as ct}from"./el-table-DaKcBqZN.js";import"./el-checkbox-CphtzscD.js";import{E as vt,a as ft}from"./el-form-item-DFlzM9g_.js";import"./vnode-HiBZolW-.js";import"./index-CP7PpuwU.js";import"./validator-B_WzUu_x.js";import"./index-CdYGcoRT.js";import"./clamp-Cyl0wpX2.js";import"./toNumber-B0hxpsP6.js";import"./index-TDTe-u1-.js";import"./scroll-qUQMUB2J.js";import"./raf-G_xTfKfR.js";import"./el-card-DPafZG_Z.js";import"./index-D-GNa2lp.js";import"./index-Cz3aNuv2.js";import"./_baseIteratee-BtAnsxgT.js";import"./use-dialog-CStKyxge.js";import"./_baseClone--zSegXWR.js";import"./debounce-BVX_QT7H.js";import"./omit-BHigcQFy.js";const Ee=Symbol("elDropdown"),on="elDropdown";var pt=z({inheritAttrs:!1});function mt(e,a,r,n,p,s){return j(e.$slots,"default")}var gt=Z(pt,[["render",mt]]),wt=z({name:"ElCollectionItem",inheritAttrs:!1});function bt(e,a,r,n,p,s){return j(e.$slots,"default")}var yt=Z(wt,[["render",bt]]);const an="data-el-collection-item",_t=e=>{const a=`El${e}Collection`,r=`${a}Item`,n=Symbol(a),p=Symbol(r);return{COLLECTION_INJECTION_KEY:n,COLLECTION_ITEM_INJECTION_KEY:p,ElCollection:Object.assign({},gt,{name:a,setup(){const s=_(),t=new Map;ae(n,{itemMap:t,getItems:(()=>{const w=U(s);if(!w)return[];const f=Array.from(w.querySelectorAll(`[${an}]`));return[...t.values()].sort((b,y)=>f.indexOf(b.ref)-f.indexOf(y.ref))}),collectionRef:s})}}),ElCollectionItem:Object.assign({},yt,{name:r,setup(s,{attrs:t}){const m=_(),w=H(n,void 0);ae(p,{collectionItemRef:m}),He(()=>{const f=U(m);f&&w.itemMap.set(f,{ref:f,...t})}),We(()=>{const f=U(m);w.itemMap.delete(f)})}})}},ht=Nn({style:{type:ke([String,Array,Object,Boolean]),default:void 0},currentTabId:{type:ke(String)},defaultCurrentTabId:String,loop:Boolean,dir:{type:String,values:["ltr","rtl"],default:"ltr"},orientation:{type:ke(String)},onBlur:Function,onFocus:Function,onMousedown:Function}),{ElCollection:Et,ElCollectionItem:Ct,COLLECTION_INJECTION_KEY:ln,COLLECTION_ITEM_INJECTION_KEY:It}=_t("RovingFocusGroup"),Ne=Symbol("elRovingFocusGroup"),rn=Symbol("elRovingFocusGroupItem"),kt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"},$t=(e,a)=>e,Vt=(e,a,r)=>{const n=$t(_e(e));return kt[n]},Tt=(e,a)=>e.map((r,n)=>e[(n+a)%e.length]),je=e=>{const{activeElement:a}=document;for(const r of e)if(r===a||(r.focus(),a!==document.activeElement))return},Ge="currentTabIdChange",Ue="rovingFocusGroup.entryFocus",Rt={bubbles:!1,cancelable:!0};var St=z({name:"ElRovingFocusGroupImpl",inheritAttrs:!1,props:ht,emits:[Ge,"entryFocus"],setup(e,{emit:a}){const r=_((e.currentTabId||e.defaultCurrentTabId)??null),n=_(!1),p=_(!1),s=_(),{getItems:t}=H(ln,void 0),m=E(()=>[{outline:"none"},e.style]),w=T=>{a(Ge,T)},f=()=>{n.value=!0},b=W(T=>{var S;(S=e.onMousedown)==null||S.call(e,T)},()=>{p.value=!0}),y=W(T=>{var S;(S=e.onFocus)==null||S.call(e,T)},T=>{const S=!U(p),{target:g,currentTarget:d}=T;if(g===d&&S&&!U(n)){const $=new Event(Ue,Rt);if(d==null||d.dispatchEvent($),!$.defaultPrevented){const C=t().filter(I=>I.focusable);je([C.find(I=>I.active),C.find(I=>I.id===U(r)),...C].filter(Boolean).map(I=>I.ref))}}p.value=!1}),u=W(T=>{var S;(S=e.onBlur)==null||S.call(e,T)},()=>{n.value=!1}),R=(...T)=>{a("entryFocus",...T)},F=T=>{const S=Vt(T);if(S){T.preventDefault();let g=t().filter(d=>d.focusable).map(d=>d.ref);switch(S){case"last":g.reverse();break;case"prev":case"next":{S==="prev"&&g.reverse();const d=g.indexOf(T.currentTarget);g=e.loop?Tt(g,d+1):g.slice(d+1);break}}Bn(()=>{je(g)})}};ae(Ne,{currentTabbedId:Dn(r),loop:ce(e,"loop"),tabIndex:E(()=>U(n)?-1:0),rovingFocusGroupRef:s,rovingFocusGroupRootStyle:m,orientation:ce(e,"orientation"),dir:ce(e,"dir"),onItemFocus:w,onItemShiftTab:f,onBlur:u,onFocus:y,onMousedown:b,onKeydown:F}),qe(()=>e.currentTabId,T=>{r.value=T??null}),Fn(s,Ue,R)}});function Ot(e,a,r,n,p,s){return j(e.$slots,"default")}var Nt=Z(St,[["render",Ot]]),Ft=z({name:"ElRovingFocusGroup",components:{ElFocusGroupCollection:Et,ElRovingFocusGroupImpl:Nt}});function Dt(e,a,r,n,p,s){const t=J("el-roving-focus-group-impl"),m=J("el-focus-group-collection");return c(),D(m,null,{default:v(()=>[k(t,Pn(An(e.$attrs)),{default:v(()=>[j(e.$slots,"default")]),_:3},16)]),_:3})}var Bt=Z(Ft,[["render",Dt]]),Pt=z({components:{ElRovingFocusCollectionItem:Ct},props:{focusable:{type:Boolean,default:!0},active:Boolean},emits:["mousedown","focus","keydown"],setup(e,{emit:a}){const{currentTabbedId:r,onItemFocus:n,onItemShiftTab:p,onKeydown:s}=H(Ne,void 0),t=Ye(),m=_(),w=W(u=>{a("mousedown",u)},u=>{e.focusable?n(U(t)):u.preventDefault()}),f=W(u=>{a("focus",u)},()=>{n(U(t))}),b=W(u=>{a("keydown",u)},u=>{const{shiftKey:R,target:F,currentTarget:T}=u;if(_e(u)===ve.tab&&R){p();return}F===T&&s(u)}),y=E(()=>r.value===U(t));return ae(rn,{rovingFocusGroupItemRef:m,tabIndex:E(()=>U(y)?0:-1),handleMousedown:w,handleFocus:f,handleKeydown:b}),{id:t,handleKeydown:b,handleFocus:f,handleMousedown:w}}});function At(e,a,r,n,p,s){const t=J("el-roving-focus-collection-item");return c(),D(t,{id:e.id,focusable:e.focusable,active:e.active},{default:v(()=>[j(e.$slots,"default")]),_:3},8,["id","focusable","active"])}var Lt=Z(Pt,[["render",At]]),Mt=Bt;const{ButtonGroup:Kt}=le;var Jt=z({name:"ElDropdown",components:{ElButton:le,ElButtonGroup:Kt,ElScrollbar:at,ElTooltip:Re,ElRovingFocusGroup:Mt,ElOnlyChild:Rn,ElIcon:Xe,ArrowDown:Ln},props:lt,emits:["visible-change","click","command"],setup(e,{emit:a}){const r=Ze(),n=Oe("dropdown"),{t:p}=Mn(),s=_(),t=_(),m=_(),w=_(),f=_(null),b=_(null),y=_(!1),u=E(()=>({maxHeight:Kn(e.maxHeight)})),R=E(()=>[n.m(C.value)]),F=E(()=>st(e.trigger)),T=Ye().value,S=E(()=>e.id||T);function g(){var B;(B=m.value)==null||B.onClose(void 0,0)}function d(){var B;(B=m.value)==null||B.onClose()}function $(){var B;(B=m.value)==null||B.onOpen()}const C=Sn();function I(...B){a("command",...B)}function L(){}function G(){const B=U(w);F.value.includes("hover")&&(B==null||B.focus({preventScroll:!0})),b.value=null}function Q(B){b.value=B}function x(){a("visible-change",!0)}function V(B){var re;y.value=(B==null?void 0:B.type)==="keydown",(re=w.value)==null||re.focus()}function X(){a("visible-change",!1)}return ae(Ee,{contentRef:w,role:E(()=>e.role),triggerId:S,isUsingKeyboard:y,onItemEnter:L,onItemLeave:G,handleClose:d}),ae(on,{instance:r,dropdownSize:C,handleClick:g,commandHandler:I,trigger:ce(e,"trigger"),hideOnClick:ce(e,"hideOnClick")}),{t:p,ns:n,scrollbar:f,wrapStyle:u,dropdownTriggerKls:R,dropdownSize:C,triggerId:S,currentTabId:b,handleCurrentTabIdChange:Q,handlerMainButtonClick:B=>{a("click",B)},handleClose:d,handleOpen:$,handleBeforeShowTooltip:x,handleShowTooltip:V,handleBeforeHideTooltip:X,popperRef:m,contentRef:w,triggeringElementRef:s,referenceElementRef:t}}});function zt(e,a,r,n,p,s){const t=J("el-roving-focus-group"),m=J("el-scrollbar"),w=J("el-only-child"),f=J("el-tooltip"),b=J("el-button"),y=J("arrow-down"),u=J("el-icon"),R=J("el-button-group");return c(),O("div",{class:fe([e.ns.b(),e.ns.is("disabled",e.disabled)])},[k(f,{ref:"popperRef",role:e.role,effect:e.effect,"fallback-placements":["bottom","top"],"popper-options":e.popperOptions,"gpu-acceleration":!1,placement:e.placement,"popper-class":[e.ns.e("popper"),e.popperClass],"popper-style":e.popperStyle,trigger:e.trigger,"trigger-keys":e.triggerKeys,"trigger-target-el":e.contentRef,"show-arrow":e.showArrow,"show-after":e.trigger==="hover"?e.showTimeout:0,"hide-after":e.trigger==="hover"?e.hideTimeout:0,"virtual-ref":e.virtualRef??e.triggeringElementRef,"virtual-triggering":e.virtualTriggering||e.splitButton,disabled:e.disabled,transition:`${e.ns.namespace.value}-zoom-in-top`,teleported:e.teleported,"append-to":e.appendTo,pure:"","focus-on-target":"",persistent:e.persistent,onBeforeShow:e.handleBeforeShowTooltip,onShow:e.handleShowTooltip,onBeforeHide:e.handleBeforeHideTooltip},Qe({content:v(()=>[k(m,{ref:"scrollbar","wrap-style":e.wrapStyle,tag:"div","view-class":e.ns.e("list")},{default:v(()=>[k(t,{loop:e.loop,"current-tab-id":e.currentTabId,orientation:"horizontal",onCurrentTabIdChange:e.handleCurrentTabIdChange},{default:v(()=>[j(e.$slots,"dropdown")]),_:3},8,["loop","current-tab-id","onCurrentTabIdChange"])]),_:3},8,["wrap-style","view-class"])]),_:2},[e.splitButton?void 0:{name:"default",fn:v(()=>[k(w,{id:e.triggerId,ref:"triggeringElementRef",role:"button",tabindex:e.tabindex},{default:v(()=>[j(e.$slots,"default")]),_:3},8,["id","tabindex"])]),key:"0"}]),1032,["role","effect","popper-options","placement","popper-class","popper-style","trigger","trigger-keys","trigger-target-el","show-arrow","show-after","hide-after","virtual-ref","virtual-triggering","disabled","transition","teleported","append-to","persistent","onBeforeShow","onShow","onBeforeHide"]),e.splitButton?(c(),D(R,{key:0},{default:v(()=>[k(b,ye({ref:"referenceElementRef"},e.buttonProps,{size:e.dropdownSize,type:e.type,disabled:e.disabled,tabindex:e.tabindex,onClick:e.handlerMainButtonClick}),{default:v(()=>[j(e.$slots,"default")]),_:3},16,["size","type","disabled","tabindex","onClick"]),k(b,ye({id:e.triggerId,ref:"triggeringElementRef"},e.buttonProps,{role:"button",size:e.dropdownSize,type:e.type,class:e.ns.e("caret-button"),disabled:e.disabled,tabindex:e.tabindex,"aria-label":e.t("el.dropdown.toggleDropdown")}),{default:v(()=>[k(u,{class:fe(e.ns.e("icon"))},{default:v(()=>[k(y)]),_:1},8,["class"])]),_:1},16,["id","size","type","class","disabled","tabindex","aria-label"])]),_:3})):K("v-if",!0)],2)}var jt=Z(Jt,[["render",zt]]),Gt=z({name:"DropdownItemImpl",components:{ElIcon:Xe},props:en,emits:["pointermove","pointerleave","click","clickimpl"],setup(e,{emit:a}){const r=Oe("dropdown"),{role:n}=H(Ee,void 0),{collectionItemRef:p}=H(It,void 0),{rovingFocusGroupItemRef:s,tabIndex:t,handleFocus:m,handleKeydown:w,handleMousedown:f}=H(rn,void 0),b=nn(p,s),y=E(()=>n.value==="menu"?"menuitem":n.value==="navigation"?"link":"button"),u=W(R=>{const F=_e(R);if([ve.enter,ve.numpadEnter,ve.space].includes(F))return R.preventDefault(),R.stopImmediatePropagation(),a("clickimpl",R),!0},w);return{ns:r,itemRef:b,dataset:{[an]:""},role:y,tabIndex:t,handleFocus:m,handleKeydown:u,handleMousedown:f}}});const Ut=["aria-disabled","tabindex","role"];function Yt(e,a,r,n,p,s){const t=J("el-icon");return c(),O(ne,null,[e.divided?(c(),O("li",{key:0,role:"separator",class:fe(e.ns.bem("menu","item","divided"))},null,2)):K("v-if",!0),l("li",ye({ref:e.itemRef},{...e.dataset,...e.$attrs},{"aria-disabled":e.disabled,class:[e.ns.be("menu","item"),e.ns.is("disabled",e.disabled)],tabindex:e.tabIndex,role:e.role,onClick:a[0]||(a[0]=m=>e.$emit("clickimpl",m)),onFocus:a[1]||(a[1]=(...m)=>e.handleFocus&&e.handleFocus(...m)),onKeydown:a[2]||(a[2]=Te((...m)=>e.handleKeydown&&e.handleKeydown(...m),["self"])),onMousedown:a[3]||(a[3]=(...m)=>e.handleMousedown&&e.handleMousedown(...m)),onPointermove:a[4]||(a[4]=m=>e.$emit("pointermove",m)),onPointerleave:a[5]||(a[5]=m=>e.$emit("pointerleave",m))}),[e.icon||e.$slots.icon?(c(),D(t,{key:0},{default:v(()=>[j(e.$slots,"icon",{},()=>[(c(),D(Jn(e.icon)))])]),_:3})):K("v-if",!0),j(e.$slots,"default")],16,Ut)],64)}var Ht=Z(Gt,[["render",Yt]]);const sn=()=>{const e=H(on,{});return{elDropdown:e,_elDropdownSize:E(()=>e==null?void 0:e.dropdownSize)}};var Wt=z({name:"ElDropdownItem",components:{ElRovingFocusItem:Lt,ElDropdownItemImpl:Ht},inheritAttrs:!1,props:en,emits:["pointermove","pointerleave","click"],setup(e,{emit:a,attrs:r}){const{elDropdown:n}=sn(),p=Ze(),{onItemEnter:s,onItemLeave:t}=H(Ee,void 0),m=W(f=>(a("pointermove",f),f.defaultPrevented),Je(f=>{if(e.disabled){t(f);return}const b=f.currentTarget;b===document.activeElement||b.contains(document.activeElement)||(s(f),f.defaultPrevented||b==null||b.focus({preventScroll:!0}))})),w=W(f=>(a("pointerleave",f),f.defaultPrevented),Je(t));return{handleClick:W(f=>{if(!e.disabled)return a("click",f),f.type!=="keydown"&&f.defaultPrevented},f=>{var b,y,u;if(e.disabled){f.stopImmediatePropagation();return}(b=n==null?void 0:n.hideOnClick)!=null&&b.value&&((y=n.handleClick)==null||y.call(n)),(u=n.commandHandler)==null||u.call(n,e.command,p,f)}),handlePointerMove:m,handlePointerLeave:w,propsAndAttrs:E(()=>({...e,...r}))}}});function qt(e,a,r,n,p,s){const t=J("el-dropdown-item-impl"),m=J("el-roving-focus-item");return c(),D(m,{focusable:!e.disabled},{default:v(()=>[k(t,ye(e.propsAndAttrs,{onPointerleave:e.handlePointerLeave,onPointermove:e.handlePointerMove,onClickimpl:e.handleClick}),Qe({default:v(()=>[j(e.$slots,"default")]),_:2},[e.$slots.icon?{name:"icon",fn:v(()=>[j(e.$slots,"icon")]),key:"0"}:void 0]),1040,["onPointerleave","onPointermove","onClickimpl"])]),_:3},8,["focusable"])}var un=Z(Wt,[["render",qt]]),Xt=z({name:"ElDropdownMenu",props:rt,setup(e){const a=Oe("dropdown"),{_elDropdownSize:r}=sn(),n=r.value,{contentRef:p,role:s,triggerId:t,isUsingKeyboard:m,handleClose:w}=H(Ee,void 0),{rovingFocusGroupRef:f,rovingFocusGroupRootStyle:b,onBlur:y,onFocus:u,onKeydown:R,onMousedown:F}=H(Ne,void 0),{collectionRef:T}=H(ln,void 0),S=E(()=>[a.b("menu"),a.bm("menu",n==null?void 0:n.value)]),g=nn(p,f,T),d=W(C=>{var I;(I=e.onKeydown)==null||I.call(e,C)},C=>{const{currentTarget:I,target:L}=C,G=_e(C);if(I.contains(L),ve.tab===G)return w();R(C)});function $(C){m.value&&u(C)}return{size:n,rovingFocusGroupRootStyle:b,dropdownKls:S,role:s,triggerId:t,dropdownListWrapperRef:g,handleKeydown:d,onBlur:y,handleFocus:$,onMousedown:F}}});const Zt=["role","aria-labelledby"];function Qt(e,a,r,n,p,s){return c(),O("ul",{ref:e.dropdownListWrapperRef,class:fe(e.dropdownKls),style:zn(e.rovingFocusGroupRootStyle),tabindex:-1,role:e.role,"aria-labelledby":e.triggerId,onFocusin:a[0]||(a[0]=(...t)=>e.handleFocus&&e.handleFocus(...t)),onFocusout:a[1]||(a[1]=(...t)=>e.onBlur&&e.onBlur(...t)),onKeydown:a[2]||(a[2]=Te((...t)=>e.handleKeydown&&e.handleKeydown(...t),["self"])),onMousedown:a[3]||(a[3]=Te((...t)=>e.onMousedown&&e.onMousedown(...t),["self"]))},[j(e.$slots,"default")],46,Zt)}var dn=Z(Xt,[["render",Qt]]);const xt=jn(jt,{DropdownItem:un,DropdownMenu:dn}),eo=xe(un),no=xe(dn);function cn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function to(e,a,r){try{const n=JSON.parse(e);return{sourceIndex:a,displayIndex:r,raw:e,kind:cn(n)?"object":"primitive",value:n}}catch(n){return{sourceIndex:a,displayIndex:r,raw:e,kind:"invalid",value:e,error:n instanceof Error?n.message:"JSON 格式不正确"}}}function oo(e,a){const r=a.toLowerCase();if(r.endsWith(".jsonl")){const n=[];return e.split(`
|
||
`).forEach((p,s)=>{p.trim()&&n.push(to(p,s,n.length+1))}),{supported:!0,records:n}}if(r.endsWith(".json"))try{const n=JSON.parse(e);return{supported:!0,records:(Array.isArray(n)?n:[n]).map((s,t)=>({sourceIndex:t,displayIndex:t+1,raw:JSON.stringify(s),kind:cn(s)?"object":"primitive",value:s}))}}catch(n){return{supported:!0,records:[{sourceIndex:0,displayIndex:1,raw:e,kind:"invalid",value:e,error:n instanceof Error?n.message:"JSON 格式不正确"}]}}return{supported:!1,records:[]}}function ao(e,a,r,n){const p=a.toLowerCase();if(p.endsWith(".jsonl")){const s=e.split(`
|
||
`);if(r<0||r>=s.length)throw new Error("目标样本不存在");return s[r]=JSON.stringify(n),s.join(`
|
||
`)}if(p.endsWith(".json")){let s;try{s=JSON.parse(e)}catch{if(r!==0)throw new Error("目标样本不存在");return JSON.stringify(n,null,2)}if(Array.isArray(s)){if(r<0||r>=s.length)throw new Error("目标样本不存在");return s[r]=n,JSON.stringify(s,null,2)}if(r!==0)throw new Error("目标样本不存在");return JSON.stringify(n,null,2)}throw new Error("当前文件不支持逐条编辑")}const lo={class:"version-control-bar","aria-label":"数据集版本控制"},ro={class:"version-selector-group"},so={class:"version-status",role:"status","aria-live":"polite"},io={key:0,class:"fa fa-ellipsis-h","aria-hidden":"true"},uo=z({__name:"DatasetVersionBar",props:{modelValue:{},versions:{},viewedVersion:{},activeVersionId:{},isViewingActiveVersion:{type:Boolean},hasPendingVersionChanges:{type:Boolean},versionLoading:{type:Boolean},savingRecord:{type:Boolean},activatingVersion:{type:Boolean},deletingVersion:{type:Boolean}},emits:["update:modelValue","change","activate","delete"],setup(e,{emit:a}){const r=e,n=a,p=E(()=>r.versionLoading||r.savingRecord||r.activatingVersion||r.deletingVersion),s=E(()=>{var y;return((y=r.viewedVersion)==null?void 0:y.version)===1?"初始版本不可删除":r.versions.length<=1?"至少需要保留一个版本":""}),t=E(()=>p.value||!!s.value);function m(y){return new Date(y).toLocaleString("zh-CN",{hour12:!1})}function w(y){const u=y.id===r.activeVersionId?"当前版本":"历史版本";return`V${y.version} · ${u} · ${m(y.create_time)}`}function f(y){n("update:modelValue",y),n("change",y)}function b(y){if(!p.value){if(y==="activate"){n("activate");return}t.value||n("delete")}}return(y,u)=>{const R=ot,F=tt,T=Se,S=le,g=eo,d=no,$=xt;return c(),O("section",lo,[l("div",ro,[u[0]||(u[0]=l("label",{for:"dataset-version-select"},"数据版本",-1)),k(F,{id:"dataset-version-select","model-value":e.modelValue,class:"version-select",loading:e.versionLoading,disabled:e.versionLoading||e.savingRecord,"aria-label":"选择要查看的数据集版本",onChange:f},{default:v(()=>[(c(!0),O(ne,null,he(e.versions,C=>(c(),D(R,{key:C.id,label:w(C),value:C.id},null,8,["label","value"]))),128))]),_:1},8,["model-value","loading","disabled"])]),l("div",so,[e.viewedVersion?(c(),O(ne,{key:0},[e.isViewingActiveVersion?(c(),D(T,{key:0,type:"success"},{default:v(()=>[P(" V"+N(e.viewedVersion.version)+" · 当前版本 ",1)]),_:1})):(c(),D(T,{key:1,type:"info"},{default:v(()=>[P("V"+N(e.viewedVersion.version)+" · 历史版本(只读)",1)]),_:1})),e.hasPendingVersionChanges?(c(),D(T,{key:2,type:"warning"},{default:v(()=>[...u[1]||(u[1]=[P("有待保存修改",-1)])]),_:1})):K("",!0),l("span",null,N(e.viewedVersion.description||"无版本说明")+" · "+N(m(e.viewedVersion.create_time)),1)],64)):K("",!0)]),e.viewedVersion&&!e.isViewingActiveVersion?(c(),D($,{key:0,class:"version-actions",trigger:"click",placement:"bottom-end","popper-class":"version-actions-popper",disabled:p.value,onCommand:b},{dropdown:v(()=>[k(d,null,{default:v(()=>[k(g,{command:"activate",class:"version-action-primary",disabled:p.value},{default:v(()=>[...u[2]||(u[2]=[l("i",{class:"fa fa-check-circle","aria-hidden":"true"},null,-1),P(" 设为当前版本 ",-1)])]),_:1},8,["disabled"]),k(g,{command:"delete",class:"version-action-danger",disabled:t.value,title:s.value||void 0,divided:""},{default:v(()=>[...u[3]||(u[3]=[l("i",{class:"fa fa-trash-o","aria-hidden":"true"},null,-1),P(" 删除版本 ",-1)])]),_:1},8,["disabled","title"])]),_:1})]),default:v(()=>[k(S,{class:"version-actions-button",loading:e.activatingVersion||e.deletingVersion,disabled:p.value,"aria-label":"打开历史版本操作菜单"},{default:v(()=>[!e.activatingVersion&&!e.deletingVersion?(c(),O("i",io)):K("",!0)]),_:1},8,["loading","disabled"])]),_:1},8,["disabled"])):K("",!0)])}}}),co=pe(uo,[["__scopeId","data-v-e7e4bc14"]]),vo={class:"records-viewer"},fo={class:"records-toolbar"},po={key:0,class:"viewer-state record-empty-state"},mo={key:1,class:"record-table-shell","aria-label":"数据样本表格"},go={class:"table-index"},wo={class:"table-cell-text"},bo={class:"table-cell-text"},yo={key:2,class:"records-pagination"},be=10,_o=z({__name:"DatasetRecordTable",props:{records:{},isViewingActiveVersion:{type:Boolean},versionId:{}},emits:["edit"],setup(e,{emit:a}){const r=e,n=a,p=_(""),s=_(1),t=E(()=>{const g=new Set;r.records.forEach($=>{$.kind==="object"&&Object.keys($.value).forEach(C=>g.add(C))});const d=["instruction","question","prompt","input","context","output","answer","response"];return[...g].sort(($,C)=>{const I=L=>{const G=d.indexOf(L);return G===-1?d.length:G};return I($)-I(C)})}),m=E(()=>t.value.slice(0,6)),w=E(()=>r.records.filter(g=>g.kind==="invalid").length),f=E(()=>t.value.length>m.value.length),b=E(()=>{const g=p.value.trim().toLowerCase();return g?r.records.filter(d=>JSON.stringify(d.value).toLowerCase().includes(g)):r.records}),y=E(()=>{const g=(s.value-1)*be;return b.value.slice(g,g+be)});qe(()=>r.versionId,()=>{p.value="",s.value=1});function u(g){return g}function R(g){return typeof g=="string"?g||"(空)":JSON.stringify(g)}function F(g,d){if(g.kind!=="object")return g.kind==="invalid"?g.raw:R(g.value);const $=g.value;return Object.prototype.hasOwnProperty.call($,d)?R($[d]):"-"}function T(g){if(g.kind!=="object")return"-";const d=g.value;return t.value.filter($=>!m.value.includes($)&&Object.prototype.hasOwnProperty.call(d,$)).map($=>`${$}: ${R(d[$])}`).join(";")||"-"}function S({row:g}){return g.kind==="invalid"?"record-table-row-invalid":""}return(g,d)=>{const $=Se,C=tn,I=dt,L=Re,G=le,Q=ct,x=ut;return c(),O("div",vo,[l("div",fo,[l("div",null,[d[3]||(d[3]=l("strong",null,"样本数据",-1)),l("span",null,"共 "+N(e.records.length.toLocaleString())+" 条",1),w.value?(c(),D($,{key:0,size:"small",type:"danger"},{default:v(()=>[P(N(w.value)+" 条格式错误 ",1)]),_:1})):K("",!0)]),k(C,{modelValue:p.value,"onUpdate:modelValue":d[0]||(d[0]=V=>p.value=V),class:"record-search",clearable:"",placeholder:"搜索样本内容","aria-label":"搜索样本内容",onInput:d[1]||(d[1]=V=>s.value=1)},{prefix:v(()=>[...d[4]||(d[4]=[l("i",{class:"fa fa-search"},null,-1)])]),_:1},8,["modelValue"])]),b.value.length?(c(),O("div",mo,[k(Q,{data:y.value,"row-key":"sourceIndex",stripe:"",border:"",class:"record-table","row-class-name":S},{default:v(()=>[k(I,{label:"序号",width:"76",align:"center"},{default:v(({row:V})=>[l("div",go,[l("strong",null,N(V.displayIndex),1),l("small",null,"第 "+N(V.sourceIndex+1)+" 行",1)])]),_:1}),(c(!0),O(ne,null,he(m.value,V=>(c(),D(I,{key:V,label:V,"min-width":"220"},{default:v(({row:X})=>[k(L,{content:F(X,V),placement:"top","show-after":400},{default:v(()=>[l("div",wo,N(F(X,V)),1)]),_:2},1032,["content"])]),_:2},1032,["label"]))),128)),f.value?(c(),D(I,{key:0,label:"其他字段","min-width":"240"},{default:v(({row:V})=>[k(L,{content:T(V),placement:"top","show-after":400},{default:v(()=>[l("div",bo,N(T(V)),1)]),_:2},1032,["content"])]),_:1})):K("",!0),k(I,{label:"状态",width:"96",align:"center"},{default:v(({row:V})=>[V.kind==="invalid"?(c(),D($,{key:0,size:"small",type:"danger"},{default:v(()=>[...d[6]||(d[6]=[P(" 格式错误 ",-1)])]),_:1})):V.kind==="primitive"?(c(),D($,{key:1,size:"small",type:"warning"},{default:v(()=>[...d[7]||(d[7]=[P(" 非对象 ",-1)])]),_:1})):(c(),D($,{key:2,size:"small",type:"success"},{default:v(()=>[...d[8]||(d[8]=[P("正常",-1)])]),_:1}))]),_:1}),k(I,{label:"操作",width:"96",align:"center",fixed:"right"},{default:v(({row:V})=>[k(G,{type:"primary",link:"",disabled:!e.isViewingActiveVersion,title:e.isViewingActiveVersion?"":"历史版本为只读,请先设为当前版本","aria-label":`${V.kind==="invalid"?"修复":"编辑"}第 ${V.displayIndex} 条数据`,onClick:X=>n("edit",V)},{default:v(()=>[l("i",{class:fe(V.kind==="invalid"?"fa fa-wrench":"fa fa-pencil")},null,2),P(" "+N(V.kind==="invalid"?"修复":"编辑"),1)]),_:2},1032,["disabled","title","aria-label","onClick"])]),_:1})]),_:1},8,["data"])])):(c(),O("div",po,[...d[5]||(d[5]=[l("i",{class:"fa fa-search","aria-hidden":"true"},null,-1),l("span",null,"没有找到匹配的样本",-1)])])),b.value.length>be?(c(),O("div",yo,[k(x,{"current-page":s.value,"onUpdate:currentPage":d[2]||(d[2]=V=>s.value=V),"page-size":be,total:b.value.length,layout:"prev, pager, next",background:""},null,8,["current-page","total"])])):K("",!0)])}}}),ho=pe(_o,[["__scopeId","data-v-7e2fd767"]]),Eo={class:"editor-hint"},Co={key:0,class:"field-helper"},Io={key:1,class:"raw-record-editor"},ko={for:"raw-record-draft"},$o={class:"record-editor-actions"},Vo=z({__name:"DatasetRecordEditorDialog",props:{modelValue:{type:Boolean},record:{},editFields:{},rawDraft:{},savingRecord:{type:Boolean},hasDraftChanges:{type:Boolean},nextVersionNumber:{}},emits:["close","save","update:field","update:rawDraft"],setup(e,{emit:a}){const r=a;function n(s){r("close",s)}function p(s){(s.ctrlKey||s.metaKey)&&s.key.toLowerCase()==="s"&&(s.preventDefault(),r("save"))}return(s,t)=>{const m=tn,w=ft,f=vt,b=le,y=it;return c(),D(y,{"model-value":e.modelValue,class:"record-editor-dialog",width:"min(720px, 92vw)",title:e.record?`编辑第 ${e.record.displayIndex} 条数据`:"编辑数据","close-on-click-modal":!1,"close-on-press-escape":!e.savingRecord,"show-close":!e.savingRecord,"before-close":n,"destroy-on-close":""},{footer:v(()=>[l("div",$o,[l("span",null,N(e.hasDraftChanges?"有未暂存修改":"尚未修改")+" · Ctrl/⌘ + S 暂存",1),l("div",null,[k(b,{disabled:e.savingRecord,onClick:t[1]||(t[1]=u=>r("close"))},{default:v(()=>[...t[4]||(t[4]=[P("取消",-1)])]),_:1},8,["disabled"]),k(b,{type:"primary",loading:e.savingRecord,disabled:!e.hasDraftChanges,onClick:t[2]||(t[2]=u=>r("save"))},{default:v(()=>[...t[5]||(t[5]=[P(" 暂存修改 ",-1)])]),_:1},8,["loading","disabled"])])])]),default:v(()=>[e.record?(c(),O("div",{key:0,class:"record-editor",onKeydown:p},[l("div",Eo,[t[3]||(t[3]=l("i",{class:"fa fa-info-circle","aria-hidden":"true"},null,-1)),P(" 当前修改会先暂存;完成多条修改后,点击文件工具栏中的“保存版本”创建 V"+N(e.nextVersionNumber)+"。 ",1)]),e.record.kind==="object"?(c(),D(f,{key:0,"label-position":"top"},{default:v(()=>[(c(!0),O(ne,null,he(e.editFields,(u,R)=>(c(),D(w,{key:u.key,label:u.key},{default:v(()=>[k(m,{"model-value":u.value,type:"textarea",rows:u.isJson?5:3,"aria-label":`编辑字段 ${u.key}`,placeholder:u.isJson?"请输入合法 JSON":`请输入 ${u.key}`,"onUpdate:modelValue":F=>r("update:field",R,F)},null,8,["model-value","rows","aria-label","placeholder","onUpdate:modelValue"]),u.isJson?(c(),O("small",Co," 该字段为对象、数组或数值,请保持合法 JSON 格式。 ")):K("",!0)]),_:2},1032,["label"]))),128))]),_:1})):(c(),O("div",Io,[l("label",ko,N(e.record.kind==="invalid"?"修复 JSON 内容":"JSON 内容"),1),k(m,{id:"raw-record-draft","model-value":e.rawDraft,type:"textarea",rows:10,"aria-label":"编辑当前条 JSON 内容",placeholder:"请输入合法 JSON","onUpdate:modelValue":t[0]||(t[0]=u=>r("update:rawDraft",u))},null,8,["model-value"])]))],32)):K("",!0)]),_:1},8,["model-value","title","close-on-press-escape","show-close"])}}}),To=pe(Vo,[["__scopeId","data-v-3901358e"]]),Ro=["aria-label"],So={class:"line-number","aria-hidden":"true"},Oo=z({__name:"DatasetRawPreview",props:{content:{},fileName:{}},setup(e){const a=e,r=E(()=>a.content.split(`
|
||
`).slice(0,100));return(n,p)=>(c(),O("div",{class:"code-viewer",tabindex:"0","aria-label":`${e.fileName||""} 文件内容`},[(c(!0),O(ne,null,he(r.value,(s,t)=>(c(),O("div",{key:t,class:"code-line"},[l("span",So,N(t+1),1),l("code",null,N(s||" "),1)]))),128))],8,Ro))}}),No=pe(Oo,[["__scopeId","data-v-66746ea9"]]),Fo={class:"page-header"},Do={class:"page-heading"},Bo={class:"heading-row"},Po={class:"dataset-overview","aria-label":"数据集概览"},Ao={class:"overview-item"},Lo={class:"overview-item"},Mo={class:"overview-item overview-item-wide"},Ko={key:1,class:"preview-workspace","aria-label":"数据集文件详情"},Jo={class:"content-pane"},zo={class:"content-toolbar"},jo={class:"content-title"},Go={class:"toolbar-actions"},Uo=["aria-busy"],Yo={key:0,class:"viewer-state"},Ho={key:1,class:"viewer-state viewer-state-error",role:"alert"},Wo={key:2,class:"viewer-state"},qo={class:"viewer-footer"},Xo={key:0},Zo={key:1},Qo={key:2,class:"empty-files","aria-label":"空文件列表"},xo=z({__name:"DatasetPreviewView",setup(e){const r=Un().params.id,n=_(),p=_(!1),s=_(!1),t=_(null),m=_(""),w=_(""),f=_(""),b=_(""),y=_(!1),u=_(null),R=_([]),F=_(""),T=_(""),S=_(!1),g=_(!1),d=_([]),$=_(""),C=_(""),I=_(""),L=_(!1),G=_(!1),Q=_(!1),x=_(1);let V=0;const X=E(()=>{var o;return((o=t.value)==null?void 0:o.files)||[]}),A=E(()=>X.value.find(o=>q(o)===m.value)),B=E(()=>w.value?w.value.split(`
|
||
`).length:0),re=E(()=>{var o;return oo(w.value,((o=A.value)==null?void 0:o.name)||"")}),Ce=E(()=>re.value.supported),Fe=E(()=>re.value.records),te=E(()=>d.value.find(o=>o.id===I.value)),ee=E(()=>!!I.value&&I.value===C.value),vn=E(()=>{var o;return((o=u.value)==null?void 0:o.kind)==="object"?JSON.stringify(R.value):F.value}),Ie=E(()=>y.value&&vn.value!==T.value),me=E(()=>w.value!==f.value),De=E(()=>Ie.value||me.value),fn=E(()=>{var i,h;const o=String(((i=t.value)==null?void 0:i.type)||"").toLowerCase();return Yn[o]||((h=t.value)==null?void 0:h.type)||"-"}),pn=E(()=>{var i;const o=((i=t.value)==null?void 0:i.storage_type)||"";return Hn[o]||o||"-"}),mn=E(()=>{var o;return(o=t.value)!=null&&o.create_time?new Date(t.value.create_time).toLocaleString("zh-CN"):"-"});function q(o){return String(o.id||o.name)}async function gn(){p.value=!0;try{t.value=await Xn(r);const o=X.value[0];o&&(m.value=q(o),await Be(o))}finally{p.value=!1}}async function Be(o){s.value=!0,b.value="";const i=++V;try{const h=await Zn(q(o)),Y=await Ve(q(o),h.active_version_id);if(i!==V)return;d.value=h.versions,x.value=h.next_version_number??Math.max(0,...h.versions.map(M=>M.version))+1,C.value=h.active_version_id,$.value=h.active_version_id,I.value=h.active_version_id,w.value=Y.content,f.value=Y.content,se()}catch{i===V&&(b.value="版本内容加载失败,请稍后重试")}finally{i===V&&(s.value=!1)}}async function wn(o){if(!A.value||o===I.value)return;const i=I.value;if(!await Pe("切换版本后,当前样本的未保存修改将丢失。")){$.value=i;return}L.value=!0;const h=++V;try{const Y=await Ve(q(A.value),o);if(h!==V)return;w.value=Y.content,f.value=Y.content,I.value=Y.version.id,se()}catch{h===V&&($.value=i)}finally{h===V&&(L.value=!1)}}async function bn(){if(!(!A.value||!te.value||ee.value)){try{await $e.confirm(`确定将 V${te.value.version} 设为当前版本吗?后续任务将使用该版本。`,"切换当前版本",{type:"warning",confirmButtonText:"设为当前版本",cancelButtonText:"取消"})}catch{return}G.value=!0;try{const o=await et(q(A.value),te.value.id,C.value);C.value=o.version.id,w.value=o.content,f.value=o.content,oe.success(`已将 V${o.version.version} 设为当前版本`)}finally{G.value=!1}}}async function yn(){var h,Y;if(!A.value||!te.value||ee.value||Q.value)return;const o=te.value;if(await((Y=n.value)==null?void 0:Y.open({title:`删除 V${o.version} 版本?`,message:`删除后无法恢复。当前版本 V${((h=d.value.find(M=>M.id===C.value))==null?void 0:h.version)||"-"} 不受影响。`,confirmText:"删除版本",cancelText:"取消",tone:"danger"}))){Q.value=!0,L.value=!0;try{const M=await nt(q(A.value),o.id,C.value),ge=await Ve(q(A.value),M.active_version_id);d.value=M.versions,x.value=M.next_version_number??Math.max(0,...M.versions.map(we=>we.version))+1,C.value=M.active_version_id,$.value=M.active_version_id,I.value=M.active_version_id,w.value=ge.content,f.value=ge.content,se(),oe.success(`V${o.version} 版本已删除`)}finally{L.value=!1,Q.value=!1}}}function _n(o){if(!ee.value){oe.warning("历史版本为只读,请先设为当前版本");return}u.value=o,o.kind==="object"?(R.value=Object.entries(o.value).map(([i,h])=>({key:i,value:typeof h=="string"?h:JSON.stringify(h,null,2),isJson:typeof h!="string"})),F.value=""):(R.value=[],F.value=o.raw),y.value=!0,T.value=o.kind==="object"?JSON.stringify(R.value):F.value}function se(){y.value=!1,u.value=null,R.value=[],F.value="",T.value=""}function hn(o,i){const h=R.value[o];h&&(h.value=i)}async function Pe(o="当前存在尚未保存为版本的修改,放弃后将无法恢复。"){if(!De.value)return!0;try{return await $e.confirm(o,"确认放弃修改?",{type:"warning",confirmButtonText:"放弃修改",cancelButtonText:"继续编辑"}),!0}catch{return!1}}async function En(){if(!Ie.value)return!0;try{return await $e.confirm("当前样本存在未暂存修改,放弃后将无法恢复。","确认放弃修改?",{type:"warning",confirmButtonText:"放弃修改",cancelButtonText:"继续编辑"}),!0}catch{return!1}}async function Cn(o){S.value||await En()&&(se(),o==null||o())}function In(){var i;if(((i=u.value)==null?void 0:i.kind)!=="object")return JSON.parse(F.value);const o={};for(const h of R.value)o[h.key]=h.isJson?JSON.parse(h.value):h.value;return o}async function kn(){if(!A.value||!u.value||S.value)return;const o=u.value;let i;try{i=In()}catch(h){oe.error(`JSON 格式校验失败:${h instanceof Error?h.message:"内容格式不正确"}`);return}S.value=!0;try{const h=ao(w.value,A.value.name,o.sourceIndex,i);w.value=h,se(),oe.success(`第 ${o.displayIndex} 条修改已暂存`)}finally{S.value=!1}}async function $n(){if(!(!A.value||!me.value||!ee.value||g.value)){g.value=!0;try{const o=await Qn(q(A.value),w.value,{description:"在线编辑数据样本",baseVersionId:I.value,expectedCurrentVersionId:C.value});w.value=o.content,f.value=o.content,d.value=[o.version,...d.value],x.value=o.version.version+1,C.value=o.version.id,$.value=o.version.id,I.value=o.version.id,oe.success(`V${o.version.version} 创建成功,已设为当前版本`)}finally{g.value=!1}}}function Ae(o){De.value&&(o.preventDefault(),o.returnValue="")}function Vn(o){window.open(xn(r,q(o),I.value),"_blank")}return Gn(()=>Pe()),He(()=>{window.addEventListener("beforeunload",Ae),gn()}),We(()=>window.removeEventListener("beforeunload",Ae)),(o,i)=>{const h=Se,Y=Tn,M=le,ge=Re,we=On;return ze((c(),D(qn,{class:"dataset-preview-page"},{header:v(()=>{var ie,ue;return[l("div",Fo,[l("div",Do,[i[4]||(i[4]=l("div",{class:"heading-icon","aria-hidden":"true"},[l("i",{class:"fa fa-database"})],-1)),l("div",null,[l("div",Bo,[l("h1",null,N(((ie=t.value)==null?void 0:ie.name)||"数据集详情"),1),k(h,{size:"small",type:"primary"},{default:v(()=>[P(N(fn.value),1)]),_:1}),k(h,{size:"small",type:"success"},{default:v(()=>[P(N(pn.value),1)]),_:1})]),l("p",null,N(((ue=t.value)==null?void 0:ue.description)||"逐条查看和修改数据样本"),1)])])])]}),default:v(()=>{var ie,ue,Le,Me,Ke;return[l("section",Po,[l("div",Ao,[i[5]||(i[5]=l("span",null,"数据条数",-1)),l("strong",null,N((((ie=t.value)==null?void 0:ie.count)||0).toLocaleString()),1)]),l("div",Lo,[i[6]||(i[6]=l("span",null,"数据大小",-1)),l("strong",null,N(((ue=t.value)==null?void 0:ue.size)||"-"),1)]),l("div",Mo,[i[7]||(i[7]=l("span",null,"创建时间",-1)),l("strong",null,N(mn.value),1)])]),k(co,{modelValue:$.value,"onUpdate:modelValue":i[0]||(i[0]=de=>$.value=de),versions:d.value,"viewed-version":te.value,"active-version-id":C.value,"is-viewing-active-version":ee.value,"has-pending-version-changes":me.value,"version-loading":L.value,"saving-record":S.value,"activating-version":G.value,"deleting-version":Q.value,onChange:wn,onActivate:bn,onDelete:yn},null,8,["modelValue","versions","viewed-version","active-version-id","is-viewing-active-version","has-pending-version-changes","version-loading","saving-record","activating-version","deleting-version"]),te.value&&!ee.value?(c(),D(Y,{key:0,class:"historical-version-alert",type:"info",closable:!1,"show-icon":"",title:"你正在查看历史版本,数据默认只读;设为当前版本后才可编辑。"})):K("",!0),X.value.length?(c(),O("section",Ko,[l("div",Jo,[l("div",zo,[l("div",jo,[i[9]||(i[9]=l("span",{class:"file-icon","aria-hidden":"true"},[l("i",{class:"fa fa-file-text-o"})],-1)),l("div",null,[l("h2",null,N((Le=A.value)==null?void 0:Le.name),1),l("p",null,[P(N(((Me=A.value)==null?void 0:Me.size)||"未知大小")+" ",1),i[8]||(i[8]=l("span",{"aria-hidden":"true"},"·",-1)),Ce.value?(c(),O(ne,{key:0},[P(N(Fe.value.length.toLocaleString())+" 条记录",1)],64)):(c(),O(ne,{key:1},[P(N(B.value.toLocaleString())+" 行",1)],64))])])]),l("div",Go,[me.value&&ee.value?(c(),D(M,{key:0,type:"primary",loading:g.value,onClick:$n},{default:v(()=>[...i[10]||(i[10]=[l("i",{class:"fa fa-save"},null,-1),P("保存版本 ",-1)])]),_:1},8,["loading"])):K("",!0),k(ge,{content:"下载当前文件",placement:"top"},{default:v(()=>[k(M,{class:"download-button","aria-label":"下载当前文件",disabled:!A.value,onClick:i[1]||(i[1]=de=>A.value&&Vn(A.value))},{default:v(()=>[...i[11]||(i[11]=[l("i",{class:"fa fa-download"},null,-1),P("下载文件 ",-1)])]),_:1},8,["disabled"])]),_:1})])]),ze((c(),O("div",{class:"viewer-shell","aria-busy":s.value||L.value},[s.value?(c(),O("div",Yo,[...i[12]||(i[12]=[l("i",{class:"fa fa-circle-o-notch fa-spin","aria-hidden":"true"},null,-1),l("span",null,"正在加载文件内容…",-1)])])):b.value?(c(),O("div",Ho,[i[14]||(i[14]=l("i",{class:"fa fa-exclamation-circle","aria-hidden":"true"},null,-1)),l("strong",null,N(b.value),1),k(M,{size:"small",onClick:i[2]||(i[2]=de=>A.value&&Be(A.value))},{default:v(()=>[...i[13]||(i[13]=[P("重新加载",-1)])]),_:1})])):w.value?Ce.value?(c(),D(ho,{key:3,records:Fe.value,"is-viewing-active-version":ee.value,"version-id":I.value,onEdit:_n},null,8,["records","is-viewing-active-version","version-id"])):(c(),D(No,{key:4,content:w.value,"file-name":(Ke=A.value)==null?void 0:Ke.name},null,8,["content","file-name"])):(c(),O("div",Wo,[...i[15]||(i[15]=[l("i",{class:"fa fa-file-o","aria-hidden":"true"},null,-1),l("span",null,"当前文件暂无可预览内容",-1)])]))],8,Uo)),[[we,L.value]]),l("div",qo,[Ce.value?(c(),O("span",Xo,[...i[16]||(i[16]=[l("i",{class:"fa fa-list-alt","aria-hidden":"true"},null,-1),P(" 逐条查看与编辑",-1)])])):(c(),O("span",Zo,[...i[17]||(i[17]=[l("i",{class:"fa fa-eye","aria-hidden":"true"},null,-1),P(" 文本预览",-1)])])),i[18]||(i[18]=l("span",null,"UTF-8",-1))])])])):p.value?K("",!0):(c(),O("section",Qo,[...i[19]||(i[19]=[l("span",{class:"empty-icon","aria-hidden":"true"},[l("i",{class:"fa fa-folder-open-o"})],-1),l("h2",null,"暂无数据文件",-1),l("p",null,"该数据集还没有可供预览的文件。",-1)])])),k(To,{"model-value":y.value,record:u.value,"edit-fields":R.value,"raw-draft":F.value,"saving-record":S.value,"has-draft-changes":Ie.value,"next-version-number":x.value,onClose:Cn,onSave:kn,"onUpdate:field":hn,"onUpdate:rawDraft":i[3]||(i[3]=de=>F.value=de)},null,8,["model-value","record","edit-fields","raw-draft","saving-record","has-draft-changes","next-version-number"]),k(Wn,{ref_key:"confirmDialogRef",ref:n},null,512)]}),_:1})),[[we,p.value]])}}}),Ja=pe(xo,[["__scopeId","data-v-e31106e4"]]);export{Ja as default};
|