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,m as W,l 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{j as C,N as X,P as ee}from"./antd-fb8ca017.js";import{s as te,c as oe,a as x,r as se,b as ae}from"./detectTaskItemApi-545b782c.js";import{u as ne}from"./index-922f0b14.js";import{_ as re}from"./drawer.vue_vue_type_script_setup_true_lang-b602bc1d.js";import{d as ie,f as le,a6 as ce,n as de,Z as m,_ as b,k as h,a5 as c,u as a,F as me,$ as M,a0 as ue,G as Y,a4 as v,a8 as I,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_ITEM",__name:"index",setup(n){const{createMessage:p}=Z(),{hasPermission:i}=G(),o=L(),u=le([]),B=e=>{u.value=e.filter(t=>typeof t!="undefined")},[H,{openDrawer:S}]=ne(),[K,{reload:D,setSelectedRowKeys:A}]=q({title:"任务检测项表",api:e=>te(P(e)),columns:oe,formConfig:{labelWidth:120,schemas:x,showAdvancedButton:!1},rowSelection:{type:"checkbox",onChange:B},useSearchForm:!0,showTableSetting:!1,bordered:!0,showIndexColumn:!1,canResize:!1,rowKey:e=>e.id,actionColumn:{width:170,title:"操作",dataIndex:"action",fixed:"right"}}),P=e=>{const k=e,{pageNum:t,pageSize:T,field:g="id",order:_="descend"}=k,f=w(k,["pageNum","pageSize","field","order"]),r={pageNum:t,pageSize:T,orderByClause:`${g} ${_==="descend"?"desc":"asc"}`};return Object.keys(f).forEach(E=>{const d=x.find(V=>V.field===E),s=e[E],l=E;d?s!==void 0&&s!==""&&(d.component==="Input"?r[l]=`%${s.trim()}%`:["Select","ApiSelect","ApiTreeSelect"].includes(d.component)?r[l]=W(s)?s.value:s:d.component==="RangePicker"?(r[`${l}From`]=C(s[0]).startOf("d").format("YYYY-MM-DD HH:mm:ss"),r[`${l}To`]=C(s[1]).endOf("d").format("YYYY-MM-DD HH:mm:ss")):d.component==="DatePicker"?r[l]=C(s).format(d.componentProps.format||"YYYY-MM-DD"):r[l]=s):r[l]=s}),r},R=()=>{S(!0,{isUpdate:!1})},$=e=>{S(!0,{record:e,isUpdate:!0})},U=e=>{se(e.id).then(t=>{D(),A([])})},N=()=>{if(u.value.length===0){p.error("当前未选中任何项目！");return}ae(u.value).then(e=>{D(),A([])})},j=()=>{D()},F=e=>{o("/data/detect-task-item/detail/"+e.id)};return(e,t)=>{const T=ce("a-button"),g=de("auth");return m(),b("div",null,[h(a(J),{onRegister:a(K)},{headerTop:c(()=>[h(a(X),{type:"info","show-icon":""},{message:c(()=>[u.value.length>0?(m(),b(me,{key:0},[M("span",null,"已选中"+ue(u.value.length)+"条记录",1),h(T,{type:"link",onClick:t[0]||(t[0]=_=>a(A)([])),size:"small"},{default:c(()=>t[1]||(t[1]=[Y("清空")])),_:1}),a(i)("AUTH_DATA_DETECT_TASK_ITEM:DELETE")?(m(),v(a(ee),{key:0,class:"ml-4",title:"确定要全部删除吗？","ok-text":"是","cancel-text":"否",onConfirm:N},{default:c(()=>t[2]||(t[2]=[M("a",{href:"#",class:"text-red-500"},"删除",-1)])),_:1})):I("",!0)],64)):(m(),b("span",pe,"未选中任何项目"))]),_:1})]),toolbar:c(()=>[fe((m(),v(T,{type:"primary",onClick:R},{default:c(()=>t[3]||(t[3]=[Y(" 新增")])),_:1})),[[g,"AUTH_DATA_DETECT_TASK_ITEM:ADD"]])]),bodyCell:c(({column:_,record:f})=>[_.dataIndex==="action"?(m(),v(a(Q),{key:0,actions:[{label:"编辑",icon:"clarity:note-edit-line",onClick:$.bind(null,f),ifShow:a(i)("AUTH_DATA_DETECT_TASK_ITEM: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:U.bind(null,f),placement:"topRight"},ifShow:a(i)("AUTH_DATA_DETECT_TASK_ITEM:DELETE")}]},null,8,["actions","dropDownActions"])):I("",!0)]),_:1},8,["onRegister"]),h(re,{onRegister:a(H),onSuccess:j},null,8,["onRegister"])])}}});export{xe as default};
