var w=Object.getOwnPropertySymbols;var N=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var C=(n,p)=>{var i={};for(var o in n)N.call(n,o)&&p.indexOf(o)<0&&(i[o]=n[o]);if(n!=null&&w)for(var o of w(n))p.indexOf(o)<0&&V.call(n,o)&&(i[o]=n[o]);return i};import{l as z,o as L,j as q,q as W}from"./index.js";import{u as Z,B as J}from"./useTable-e949a6b7.js";import{T as Q}from"./useForm-baba730a.js";import{j as b,aa as X,P as ee}from"./antd-0679333d.js";import{s as te,c as oe,a as E,r as se,b as ae}from"./taskProgressApi-ab295ee1.js";import{u as ne}from"./index-679d8a0a.js";import{_ as re}from"./drawer.vue_vue_type_script_setup_true_lang-06391f52.js";import{d as ie,f as le,a6 as ce,n as de,Z as m,_ as v,k as S,a5 as c,u as a,F as me,$ as P,a0 as ue,G as x,a4 as y,a8 as Y,m as fe}from"./vue-72a104e4.js";import"./index-8a6826ba.js";import"./useWindowSizeFn-1db11f4f.js";import"./onMountedOrActivated-ee461833.js";import"./sortable.esm-15c0a34e.js";import"./copyTextToClipboard-3ca69a78.js";const pe={key:1},Ee=ie({name:"AUTH_DATA_TASK_PROGRESS",__name:"index",setup(n){const{createMessage:p}=W(),{hasPermission:i}=z(),o=L(),u=le([]),B=e=>{u.value=e.filter(t=>typeof t!="undefined")},[H,{openDrawer:R}]=ne(),[K,{reload:A,setSelectedRowKeys:T}]=Z({title:"任务检测过程数据表",api:e=>te(O(e)),columns:oe,formConfig:{labelWidth:120,schemas:E,showAdvancedButton:!1},rowSelection:{type:"checkbox",onChange:B},useSearchForm:!0,showTableSetting:!1,bordered:!1,showIndexColumn:!1,canResize:!1,rowKey:e=>e.id,actionColumn:{width:170,title:"操作",dataIndex:"action",fixed:"right"}}),O=e=>{const k=e,{pageNum:t,pageSize:h,field:g="id",order:_="descend"}=k,f=C(k,["pageNum","pageSize","field","order"]),r={pageNum:t,pageSize:h,orderByClause:`${g} ${_==="descend"?"desc":"asc"}`};return Object.keys(f).forEach(D=>{const d=E.find(I=>I.field===D),s=e[D],l=D;d?s!==void 0&&s!==""&&(d.component==="Input"?r[l]=`%${s.trim()}%`:["Select","ApiSelect","ApiTreeSelect"].includes(d.component)?r[l]=q(s)?s.value:s:d.component==="RangePicker"?(r[`${l}From`]=b(s[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),r[`${l}To`]=b(s[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):d.component==="DatePicker"?r[l]=b(s).format(d.componentProps.format||"YYYY-MM-DD"):r[l]=s):r[l]=s}),r},M=()=>{R(!0,{isUpdate:!1})},$=e=>{R(!0,{record:e,isUpdate:!0})},G=e=>{se(e.id).then(t=>{A(),T([])})},U=()=>{if(u.value.length===0){p.error("当前未选中任何项目！");return}ae(u.value).then(e=>{A(),T([])})},j=()=>{A()},F=e=>{o("/data/task-progress/detail/"+e.id)};return(e,t)=>{const h=ce("a-button"),g=de("auth");return m(),v("div",null,[S(a(J),{onRegister:a(K)},{headerTop:c(()=>[S(a(X),{type:"info","show-icon":""},{message:c(()=>[u.value.length>0?(m(),v(me,{key:0},[P("span",null,"已选中"+ue(u.value.length)+"条记录",1),S(h,{type:"link",onClick:t[0]||(t[0]=_=>a(T)([])),size:"small"},{default:c(()=>t[1]||(t[1]=[x("清空")])),_:1}),a(i)("AUTH_DATA_TASK_PROGRESS:DELETE")?(m(),y(a(ee),{key:0,class:"ml-4",title:"确定要全部删除吗？","ok-text":"是","cancel-text":"否",onConfirm:U},{default:c(()=>t[2]||(t[2]=[P("a",{href:"#",class:"text-red-500"},"删除",-1)])),_:1})):Y("",!0)],64)):(m(),v("span",pe,"未选中任何项目"))]),_:1})]),toolbar:c(()=>[fe((m(),y(h,{type:"primary",onClick:M},{default:c(()=>t[3]||(t[3]=[x(" 新增")])),_:1})),[[g,"AUTH_DATA_TASK_PROGRESS:ADD"]])]),bodyCell:c(({column:_,record:f})=>[_.dataIndex==="action"?(m(),y(a(Q),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:$.bind(null,f),ifShow:a(i)("AUTH_DATA_TASK_PROGRESS:EDIT"),divider:!0},{label:"详情",icon:"ant-design:eye-outlined",onClick:F.bind(null,f),divider:!0}],dropDownActions:[{label:"删除",icon:"ant-design:delete-outlined",color:"error",popConfirm:{title:"是否确认删除",confirm:G.bind(null,f),placement:"topRight"},ifShow:a(i)("AUTH_DATA_TASK_PROGRESS:DELETE")}]},null,8,["actions","dropDownActions"])):Y("",!0)]),_:1},8,["onRegister"]),S(re,{onRegister:a(H),onSuccess:j},null,8,["onRegister"])])}}});export{Ee as default};
