import{E as z}from"./index-CCavIuTY.js";import{E as L}from"./el-tag-C_D80BPW.js";import{E as M}from"./el-table-DkdQ6gPU.js";import{d as P,G as V,c as h,s as o,w as s,y as c,o as d,q as f,x as n,f as b,aa as r,e as $,A as I,v as S}from"./index-CGB0A5x_.js";import{E as q}from"./index-BMrs0kLP.js";import"./el-checkbox-Ci1DH0Aj.js";import{D as A}from"./DataTablePage-CURtmoAI.js";import{g as F,d as G}from"./dataProcess-D7vRt2n_.js";import{d as v}from"./dataProcessStatus-BNY61_45.js";import{_ as R}from"./_plugin-vue_export-helper-DlAUqK2U.js";import"./el-scrollbar-p6_f_LH2.js";import"./index-DMVRI44M.js";import"./el-popper-DvBtRO32.js";import"./index-BPwPlcbL.js";import"./_baseClone-CX1E8HTZ.js";import"./_baseIteratee-uVh0OyD5.js";import"./castArray-Cgg396Sr.js";import"./debounce-Bqww2DS8.js";import"./toNumber-IRhFg6gN.js";import"./raf-CCivjDro.js";import"./validator-D7tSoy2w.js";import"./index-Coa9QRND.js";import"./clamp-BqqU4KQ-.js";import"./index-C5EKbiob.js";import"./scroll-C0BSy_Rk.js";import"./index-CbmPSBt0.js";import"./index-D2-3cnGo.js";import"./omit-DaFv1hTo.js";import"./el-card-BWcR1iD2.js";import"./el-pagination-DGQ0vO_O.js";import"./el-select-C59URVI0.js";import"./vnode-DFpZw5lG.js";import"./index-khuXz7sd.js";import"./directive-vzjADwzS.js";import"./el-tooltip-l0sNRNKZ.js";const j={class:"data-process-page",style:{height:"100%"}},H={key:1},J={class:"action-buttons"},K=P({__name:"DataProcessListView",setup(O){const x={structured:"结构化数据",unstructured:"非结构化数据",external:"外来数据源拉取"},k=S(),l=c([]),p=c(!1),m=c(null),u=c("");async function D(t=!1){t||(p.value=!0),u.value="";try{const a=await F({page:1,page_size:200});l.value=a.items}catch{u.value="数据处理任务加载失败，请稍后重试。"}finally{t||(p.value=!1)}}function C(t){const a=t.id;k.push({name:"data-process-detail",params:{id:a}})}async function E(t){try{await q.confirm(`确定删除数据处理任务“${t.name}”吗？删除后无法恢复。`,"确认删除",{type:"warning",confirmButtonText:"删除",cancelButtonText:"取消",confirmButtonClass:"el-button--danger"})}catch{return}m.value=t.id;try{await G(t.id),l.value=l.value.filter(a=>a.id!==t.id),I.success("数据处理任务已删除")}catch{}finally{m.value=null}}function T(t){if(!t)return"-";const a=new Date(t);return Number.isNaN(a.getTime())?t:a.toLocaleString("zh-CN",{hour12:!1})}function _(t){const a=Number(t);return Number.isFinite(a)?Math.max(0,Math.trunc(a)):0}function w(t){return`${_(t.source_file_count)} 个`}function B(t){return`${_(t.output_count)} 条`}return V(D),(t,a)=>{const i=M,g=L,y=z;return d(),h("div",j,[o(A,{title:"",data:l.value,loading:p.value,searchable:"","search-fields":["name"],"create-text":"新建数据处理","create-to":"/data-process/create","row-key":"id","page-size":10,"empty-text":u.value||"暂无数据处理任务"},{columns:s(()=>[o(i,{label:"任务ID",prop:"id",align:"center",width:"100"}),o(i,{label:"任务名称",prop:"name",align:"center","show-overflow-tooltip":""}),o(i,{label:"任务状态",align:"center",width:"110"},{default:s(({row:e})=>[o(g,{type:b(v)(e).type,size:"small",effect:"light"},{default:s(()=>[n(r(b(v)(e).label),1)]),_:2},1032,["type"])]),_:1}),o(i,{label:"处理类型",align:"center",width:"140"},{default:s(({row:e})=>[e.process_type?(d(),$(g,{key:0,size:"small",type:"info",effect:"plain"},{default:s(()=>[n(r(x[e.process_type]||e.process_type),1)]),_:2},1024)):(d(),h("span",H,"-"))]),_:1}),o(i,{label:"文档数量",align:"center",width:"120"},{default:s(({row:e})=>[n(r(w(e)),1)]),_:1}),o(i,{label:"生成个数",align:"center",width:"120"},{default:s(({row:e})=>[n(r(B(e)),1)]),_:1}),o(i,{label:"创建时间",align:"center",width:"190"},{default:s(({row:e})=>[n(r(T(e.create_time||e.created_at)),1)]),_:1})]),actions:s(({row:e})=>[f("div",J,[o(y,{type:"primary",link:"",size:"small",onClick:N=>C(e)},{default:s(()=>[...a[0]||(a[0]=[f("i",{class:"fa fa-file-text-o",style:{"margin-right":"4px"}},null,-1),n("详情 ",-1)])]),_:1},8,["onClick"]),o(y,{type:"danger",link:"",size:"small",loading:m.value===e.id,onClick:N=>E(e)},{default:s(()=>[...a[1]||(a[1]=[f("i",{class:"fa fa-trash-o",style:{"margin-right":"4px"}},null,-1),n("删除 ",-1)])]),_:1},8,["loading","onClick"])])]),_:1},8,["data","loading","empty-text"])])}}}),Nt=R(K,[["__scopeId","data-v-c2486738"]]);export{Nt as default};
