File: /var/www/html/public/static/js/hook-a645ef2d.js
import{be as l}from"./message-2472a54a.js";import{delWorkShop as S,getWorkShopList as x}from"./workshop-4558403d.js";import{A as c,r as o,c as y,o as k}from"./runtime-core.esm-bundler-6128546f.js";import"./index-cdc44ec6.js";import"./preload-helper-78dc9057.js";import"./vue-i18n.runtime.esm-bundler-6949bcab.js";import"./index-b7f916e1.js";import"./_commonjsHelpers-87174ba5.js";import"./vue-router-a383d220.js";import"./utils-2ab4f76a.js";function A(){const r=c({name:""}),s=o([]),a=o(!0);o({});const n=c({total:0,pageSize:10,currentPage:1,background:!0}),d=[{type:"selection",width:55,align:"left",hide:({checkList:e})=>!e.includes("勾选列")},{label:"序号",type:"index",width:70,hide:({checkList:e})=>!e.includes("序号列")},{label:"ID",prop:"id",minWidth:100,hide:({checkList:e})=>!e.includes("ID")},{label:"产线名称",prop:"name",minWidth:120,hide:({checkList:e})=>!e.includes("产线名称")},{label:"备注",prop:"cmt",minWidth:150,hide:({checkList:e})=>!e.includes("备注")},{label:"操作",fixed:"right",width:180,slot:"operation"}],p=["序号列","ID","产线名称","备注"],u=y(()=>["!h-[20px]","reset-margin","!text-gray-500","dark:!text-white","dark:hover:!text-primary"]);function h(e){}function m(e){S(e.id).then(i=>{l("删除产线成功",{type:"success"}),t()}).catch(i=>{l("删除产线失败",{type:"error"})})}function g(e){t()}function f(e){t()}function b(e){}async function t(){a.value=!0;const{data:e,total:i}=await x(Object.assign(r,{page:n.currentPage,resault:n.pageSize}));s.value=e,n.total=i,setTimeout(()=>{a.value=!1},500)}const v=e=>{e&&(e.resetFields(),t())};return k(()=>{t()}),{selectList:p,form:r,loading:a,columns:d,dataList:s,pagination:n,buttonClass:u,onSearch:t,resetForm:v,handleUpdate:h,handleDelete:m,handleSizeChange:g,handleCurrentChange:f,handleSelectionChange:b}}export{A as useWorkShop};