2024-09-19 11:09:33 +08:00
|
|
|
import{_ as R}from"./index.vue_vue_type_script_setup_true_lang.305bb481.js";import{w as U,D as A,R as G,S as J,F as M,G as Q,J as W,b as X,M as H,N as K}from"./element-plus.6b125791.js";import{o as t,P as i,ab as B,Q as o,W as r,U as k,V as D,d as Y,$ as Z,c as p,F as f,a9 as h,T as V,u as _,a as O,R as ee,L as te,X as oe,j as ne,r as ae}from"./@vue.340249d8.js";import{b as le}from"./index.8eb121a3.js";import{u as re}from"./usePaging.fff444fa.js";import{b as se}from"./axios.ebd1d4d0.js";import{a as ce}from"./goodsList.3f1cb318.js";import"./lodash-es.edba6135.js";import"./@vueuse.e3650918.js";import"./@element-plus.558a564d.js";import"./@popperjs.36402333.js";import"./@ctrl.b082b0c1.js";import"./dayjs.6b964ca4.js";import"./async-validator.fb49d0f5.js";import"./memoize-one.4ee5c96d.js";import"./normalize-wheel-es.8aeb3683.js";import"./@floating-ui.0f9ce7c3.js";import"./lodash.ab1d8f92.js";import"./vue-router.9ddb0e92.js";import"./pinia.97fe9b12.js";import"./css-color-function.7a4c1284.js";import"./color.10b8b3bd.js";import"./clone.623e4e2d.js";import"./color-convert.755d189f.js";import"./color-name.e7a4e1d3.js";import"./color-string.e356f5de.js";import"./balanced-match.d2a36341.js";import"./ms.564e106c.js";import"./nprogress.518a19eb.js";import"./vue-clipboard3.c098b37d.js";import"./clipboard.a67a48a7.js";import"./echarts.8535e5a6.js";import"./zrender.3eba8991.js";import"./tslib.60310f1a.js";import"./highlight.js.31cd7941.js";import"./@highlightjs.309a94da.js";const P={__name:"genBtn",props:{config:{type:Object,default:()=>{}}},emits:["add","edit","del"],setup(n,{emit:s}){const a=s,l=c=>{switch(c){case"handleCreate":a("add");break;case"handleUpdate":a("edit");break;default:a("del");break}};return(c,g)=>{const v=le,w=U;return t(),i(w,{type:n.config.type,size:n.config.size,onClick:g[0]||(g[0]=x=>l(n.config.click))},B({default:o(()=>[k(" "+D(n.config.label),1)]),_:2},[n.config.icon?{name:"icon",fn:o(()=>[r(v,{name:n.config.icon},null,8,["name"])]),key:"0"}:void 0]),1032,["type","size"])}}},ie={class:"mt-4"},de={class:"flex justify-end mt-4"},ue=Y({name:"asd"}),me=Object.assign(ue,{props:{config:{type:Object,required:!0},tabFetchFn:{type:Function,required:!0}},setup(n){const s=n,l=Z({...(()=>{const y=s.config.search.map(u=>u.field).reduce((u,F)=>(u[F]="",u),{});return Object.assign({},y,s.query)})()}),{pager:c,getLists:g,resetParams:v,resetPage:w}=re({fetchFun:s.tabFetchFn,params:l}),x=()=>{alert("add")},S=b=>{console.log(b)};return g(),(b,y)=>{const C=A,u=G,F=J,E=M,j=U,L=Q,$=W,N=X,T=H,q=K,z=R;return t(),p(f,null,[k(D(l)+" ",1),r($,{class:"!border-none",shadow:"never"},{default:o(()=>[r(L,{class:"mb-[-16px]",model:l,inline:""},{default:o(()=>[(t(!0),p(f,null,h(n.config.search,(e,m)=>(t(),i(E,{label:e.title,key:m},{default:o(()=>[e.type=="input"?(t(),i(C,{key:0,class:"w-[280px]",modelValue:l[e.field],"onUpdate:modelValue":d=>l[e.field]=d,clearable:"",placeholder:e.props.placeholder},null,8,["modelValue","onUpdate:modelValue","placeholder"])):V("",!0),e.type=="select"?(t(),i(F,{key:1,modelValue:l[e.field],"onUpdate:modelValue":d=>l[e.field]=d},{default:o(()=>[(t(!0),p(f,null,h(e.options,d=>(t(),i(u,{label:d.label,value:d.value},null,8,["label","value"]))),256))]),_:2},1032,["modelValue","onUpdate:modelValue"])):V("",!0)]),_:2},1032,["label"]))),128)),r(E,null,{default:o(()=>[r(j,{type:"primary",onClick:_(w)},{default:o(()=>[k("\u67E5\u8BE2")]),_:1},8,["onClick"]),r(j,{onClick:_(v)},{default:o(()=>[k("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"])]),_:1}),r($,{class:"!border-none mt-5",shadow:"never"},{default:o(()=>[(t(!0),p(f,null,h(n.config.actions,e=>(t(),i(P,{config:e,onAdd:x},null,8,["config"]))),256)),O("div",ie,[r(q,{data:_(c).lists},{default:o(()=>[(t(!0),p(f,null,h(n.config.headers,e=>ee((t(),i(T,{label:e.label,prop:e.prop,"show-overflow-tooltip":"",width:e.width&&e.width,fixed:e.fixed&&e.fixed},B({_:2},[e.component?{name:"default",fn:o(({row:m})=>[r(N,{style:te({width:e.component[0].options.width,height:e.component[0].options.height}),src:m[e.prop]},null,8,["style","src"])]),key:"0"}:void 0,e.action?
|