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