import{D as m,U as s,A as a,a as l}from"./api.o0pCW0KB.js";import{D as e,V as d}from"./index.CN1lNsL-.js";import"./vue.YrNK8sx4.js";const{compute:i}=d(),Y=function({crudExpose:r}){return{crudOptions:{request:{pageRequest:async t=>await l(t),addRequest:async({form:t})=>await a(t),editRequest:async({form:t,row:o})=>(t.id=o.id,await s(t)),delRequest:async({row:t})=>await m(t.id)},actionbar:{buttons:{add:{show:!1,text:"创建借用单"}}},rowHandle:{fixed:"right",width:330,buttons:{view:{show:!0,order:1,click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-view",{detail:t}))}},edit:{show:!0,order:4,disabled:i(({row:t})=>t.borrow_type===0),click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-edit",{detail:t}))}},remove:{order:5,show:!1},settlement:{order:6,show:i(({row:t})=>t.status===5||t.status==7),text:"查看结算单",click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-settlement",{detail:t}))}},collectEquipment:{order:2,show:i(({row:t})=>t.status===2),text:"领取",click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-collect",{detail:t}))}},returnEquipment:{order:3,show:i(({row:t})=>t.status===5),text:"归还",click:({row:t})=>{window.dispatchEvent(new CustomEvent("borrow-return",{detail:t}))}}}},search:{show:!1},toolbar:{show:!0},columns:{_index:{title:"序号",form:{show:!1},column:{align:"center",width:"70px",columnSetDisabled:!0,formatter:t=>{let o=t.index??1,n=r.crudBinding.value.pagination;return((n.currentPage??1)-1)*n.pageSize+o+1}}},application_no:{title:"借用单编号",column:{minWidth:140}},borrower_type_label:{title:"借用人角色",column:{minWidth:100}},borrow_type_label:{search:{show:!0},title:"借用性质",column:{minWidth:100}},"borrower_info.user_code":{title:"学号/工号",column:{minWidth:100}},borrower_info:{title:"借用人",search:{show:!0},column:{minWidth:100,formatter:({row:t})=>{var o;return((o=t.borrower_info)==null?void 0:o.name)||""}},form:{component:{render:({value:t})=>(t==null?void 0:t.name)||""}}},emergency_contact:{title:"紧急联系人",column:{show:!1,minWidth:100}},emergency_phone:{title:"联系方式",column:{minWidth:120}},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 HH:mm:ss"):""}},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"):""}}}}}};export{Y as createCrudOptions};
