import{D as s,U as a,A as m,c as l}from"./api.DPMoyOcC.js";import{D as e,V as c}from"./index.BKEMpsLA.js";import"./vue.YrNK8sx4.js";const{compute:o}=c(),b=function({crudExpose:n}){return{crudOptions:{request:{pageRequest:async t=>await l(t),addRequest:async({form:t})=>await m(t),editRequest:async({form:t,row:r})=>(t.id=r.id,await a(t)),delRequest:async({row:t})=>await s(t.id)},actionbar:{buttons:{add:{show:!1,text:"创建借用单",click:()=>{window.dispatchEvent(new CustomEvent("borrow-add"))}}}},rowHandle:{fixed:"right",width:330,buttons:{view:{show:!0,order:1,click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-view",{detail:t}))}},edit:{show:o(({row:t})=>t.status==1&&t.borrow_type!==0),order:4,disabled:o(({row:t})=>t.status!==1),click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-edit",{detail:t}))}},remove:{order:10,show:o(({row:t})=>t.status!==5||t.status===6)},settlement:{order:6,show:o(({row:t})=>t.status===5||t.status==7),text:"查看结算单",click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-settlement",{detail:t}))}},collectEquipment:{order:2,show:o(({row:t})=>t.status===2),text:"领取",click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-collect",{detail:t}))}},returnEquipment:{order:3,show:o(({row:t})=>t.status===5||t.status===6),text:"归还",click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-return",{detail:t}))}},renewdevice:{order:3,show:o(({row:t})=>t.status===5||t.status===6),text:"续借",click:({row:t})=>{window.dispatchEvent(new CustomEvent("renew-device",{detail:t}))}}}},search:{show:!0},toolbar:{show:!0},columns:{_index:{title:"序号",form:{show:!1},column:{align:"center",width:"70px",columnSetDisabled:!0,formatter:t=>{let r=t.index??1,i=n.crudBinding.value.pagination;return((i.currentPage??1)-1)*i.pageSize+r+1}}},application_no:{search:{show:!0},title:"借用单编号",column:{minWidth:140},form:{component:{placeholder:""},search:{component:{placeholder:""},rules:[{required:!0,message:""}]}}},borrower_type_label:{title:"借用人角色",column:{minWidth:100}},borrow_type_label:{search:{show:!1},title:"借用性质",column:{minWidth:100}},"borrower_info.user_code":{title:"学号/工号",search:{show:!0},column:{minWidth:100},form:{component:{placeholder:""}}},"borrower_info.name":{title:"借用人",search:{show:!0},column:{show:!0,minWidth:100},form:{component:{placeholder:""}}},external_borrower_name:{title:"借用人",column:{show:!1,minWidth:100}},emergency_phone:{title:"联系方式",search:{show:!0},column:{minWidth:120},form:{component:{placeholder:""}}},team_type_label:{title:"个人/团队",column:{minWidth:80}},team_members:{title:"团队成员",column:{show:!1,minWidth:120}},team_members_count:{title:"团队人数",column:{show:!1,minWidth:80}},create_datetime:{title:"创建时间",column:{minWidth:160,formatter:({value:t})=>t?e(t).format("YYYY-MM-DD HH:mm:ss"):""}},status_label:{title:"当前状态",column:{minWidth:80}},actual_start_time:{title:"借出时间",column:{minWidth:140,formatter:({value:t})=>t?e(t).format("YYYY-MM-DD HH:mm:ss"):""}},expected_end_time:{title:"预计归还",column:{minWidth:140,formatter:({value:t})=>t?e(t).format("YYYY-MM-DD"):""}},actual_end_time:{title:"完结时间",column:{minWidth:140,formatter:({value:t})=>t?e(t).format("YYYY-MM-DD HH:mm:ss"):""}},return_location:{title:"存放仓库",column:{minWidth:120}},purpose:{title:"借用目的",column:{minWidth:150,show:!1}},expected_start_time:{title:"预计开始",column:{minWidth:140,show:!1,formatter:({value:t})=>t?e(t).format("YYYY-MM-DD HH:mm:ss"):""}},approve_time:{title:"审批时间",column:{show:!1,minWidth:140,formatter:({value:t})=>t?e(t).format("YYYY-MM-DD HH:mm"):""}},approve_remark:{title:"审批备注",column:{show:!1,minWidth:120}},total_items:{title:"设备数量",column:{show:!1,minWidth:80}},applicant_remark:{title:"申请备注",column:{show:!1,minWidth:120}},update_datetime:{title:"更新时间",column:{show:!1,minWidth:160,formatter:({value:t})=>t?e(t).format("YYYY-MM-DD HH:mm:ss"):""}},"items.device_code":{title:"设备编号",search:{show:!0},column:{show:!1,minWidth:100},form:{show:!1,component:{placeholder:""}}},abnormal_status:{title:"异常记录",search:{show:!0},column:{show:!0,minWidth:100},form:{show:!1,component:{placeholder:""}}},accessories:{title:"扫设备编码",search:{show:!0},column:{show:!1,minWidth:100},form:{show:!1,component:{placeholder:""}}}}}}};export{b as createCrudOptions};
