import{D as r,U as i,A as l,b as n}from"./api.C-HcXaQ1.js";import{W as u,T as c}from"./index.D93ign_E.js";import{aH as d,S as s,aj as m}from"./vue.D1BjjNmv.js";const v=function({crudExpose:o}){return d(),{crudOptions:{toolbar:{buttons:{search:{show:!1},refresh:{show:!1},compact:{show:!1},export:{text:"导出",type:"primary",size:"small",icon:"upload",circle:!1,display:!0},columns:{show:!1}}},request:{pageRequest:async e=>await n(e),addRequest:async({form:e})=>await l(e),editRequest:async({form:e,row:t})=>(e.id=t.id,await i(e)),delRequest:async({row:e})=>await r(e.id)},actionbar:{buttons:{add:{show:!0,size:"small",click:()=>{o.emit("add-digital-human")}}}},rowHandle:{fixed:"right",width:300,buttons:{view:{iconRight:"view",show:!1,type:"text",click:({row:e})=>{}},edit:{iconRight:"Edit",type:"text",show:!1},remove:{iconRight:"Delete",type:"text",show:!1}}},pagination:{show:!0},table:{rowKey:"id"},search:{show:!0,layout:"auto",buttons:{search:{size:"small"},reset:{size:"small"}}},columns:{_index:{title:"序号",form:{show:!1},column:{type:"index",align:"center",width:"70px",columnSetDisabled:!0}},name:{title:"数字人名称",search:{show:!0,component:{placeholder:"请输入数字人名称"},size:"small",col:{span:3}},type:"input",column:{minWidth:150},form:{rules:[{required:!0,message:"数字人名称为必填项"}]}},description:{title:"描述",search:{show:!1,size:"small",col:{span:3}},type:"textarea",column:{minWidth:200,showOverflowTooltip:!0},form:{component:{span:24}}},avatar_url:{title:"头像",type:"cropper-uploader",form:{component:{uploader:{action:"/api/system/admin_upload/",multiple:!1,limit:1,accept:".jpg,.png,.jpeg",headers:()=>({Authorization:`JWT ${localStorage.getItem("token")||""}`}),data:{tenant_id:"1"},onSuccessHandle(e){return e.data.url},beforeUpload(e){const t=e.type.startsWith("image/"),a=e.size/1024/1024<2;return t?a?!0:(this.$message.error("图片大小不能超过 2MB!"),!1):(this.$message.error("只能上传图片文件!"),!1)}},slots:{default:({modelValue:e})=>e?s("img",{src:e,class:"avatar",style:"width:100px;height:100px;"},null):s(m("el-icon"),{class:"avatar-uploader-icon"},{default:()=>[s(c,null,null)]})}},rules:[{required:!0,message:"请上传头像"}]}},template_video_url:{title:"模板视频",type:"file-uploader",form:{component:{uploader:{action:"/api/system/admin_upload/",multiple:!1,limit:1,accept:".mp4,.mov,.avi",headers:()=>({Authorization:`JWT ${localStorage.getItem("token")||""}`}),data:{tenant_id:"1"},onSuccessHandle(e){return e.data.url},beforeUpload(e){const t=e.type.startsWith("video/"),a=e.size/1024/1024<50;return t?a?!0:(this.$message.error("视频大小不能超过 50MB!"),!1):(this.$message.error("只能上传视频文件!"),!1)}},placeholder:"请上传模板视频"}},column:{minWidth:180}},status:{title:"状态",search:{show:!0,component:{name:"el-select",placeholder:"请选择状态"},size:"small",col:{span:3}},type:"dict-select",column:{minWidth:100},dict:u({data:[{value:1,label:"启用"},{value:0,label:"禁用"}]})},creator_name:{title:"创建人",type:"text",column:{minWidth:120},form:{show:!1}},create_datetime:{title:"创建时间",type:"datetime",column:{minWidth:160},form:{show:!1}},update_datetime:{title:"更新时间",type:"datetime",column:{minWidth:160},form:{show:!1}}}}}};export{v as createCrudOptions};
