2 lines
3.3 KiB
JavaScript
2 lines
3.3 KiB
JavaScript
import{K as Q,L as $,C as G,D as Z,w as z,F as H,O as J,Q as W,T as X,R as Y}from"./element-plus.8c800afc.js";import{_ as ee}from"./index.vue_vue_type_script_setup_true_lang.7b224fce.js";import{d as le,Z as te,r as ae,o as l,c as m,M as ne,u as t,K as o,L as a,U as c,a3 as oe,T as b,a9 as y,R as v,a as D,Q as L,S as se,j as ue}from"./@vue.18505fe0.js";import{u as ce}from"./usePaging.6a6670f9.js";import{u as re}from"./useDictOptions.080d297e.js";import{a as ie}from"./goods_label.e35119a3.js";const de={class:"mt-4"},me={class:"flex justify-end mt-4"},pe={key:0,class:"flex justify-end mt-4"},he=le({__name:"index",props:{config:{type:Object,required:!0},query:Object,multipleChoice:Boolean},emits:["customEvent"],setup(p,{emit:B}){const s=p,F=()=>{const i=s.config.serchList.map(d=>d.value).reduce((d,h)=>(d[h]="",d),{});return Object.assign({},i,s.query)},w=u=>{if(!!s.query)return Object.keys(s.query).includes(u)},r=te({...F()}),{dictData:x}=re(s.config.dictData),C=B,S=u=>{s.multipleChoice||C("customEvent",u)},E=ae([]),q=u=>{E.value=u},T=()=>{C("customEvent",E.value)},{pager:_,getLists:V,resetParams:U,resetPage:P}=ce({fetchFun:s.config.fetchFn,params:r});return V(),(u,i)=>{const g=Q,d=$,h=G,j=Z,k=z,I=H,O=J,N=W,A=ee,R=X,K=Y;return l(),m("div",null,[ne((l(),o(R,{class:"!border-none",shadow:"never"},{default:a(()=>[c(I,{class:"mb-[-16px]",model:t(r),inline:"",onSubmit:i[0]||(i[0]=oe(()=>{},["prevent"]))},{default:a(()=>[(l(!0),m(b,null,y(p.config.serchList,(e,f)=>(l(),o(j,{label:e.label,key:f},{default:a(()=>[e.select?(l(),o(d,{key:0,modelValue:t(r)[e.value],"onUpdate:modelValue":n=>t(r)[e.value]=n,disabled:w(e.value)},{default:a(()=>[Array.isArray(e.select)?(l(!0),m(b,{key:0},y(e.select,n=>(l(),o(g,{label:n.name,value:n.value},null,8,["label","value"]))),256)):(l(!0),m(b,{key:1},y(t(x)[e.select],(n,M)=>(l(),o(g,{key:M,label:n.name,value:parseInt(n.value)},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","disabled"])):(l(),o(h,{key:1,class:"w-[280px]",modelValue:t(r)[e.value],"onUpdate:modelValue":n=>t(r)[e.value]=n,clearable:"",placeholder:`\u8BF7\u8F93\u5165${e.label}`},null,8,["modelValue","onUpdate:modelValue","placeholder"]))]),_:2},1032,["label"]))),128)),c(j,null,{default:a(()=>[c(k,{type:"primary",onClick:t(P)},{default:a(()=>[v("\u67E5\u8BE2")]),_:1},8,["onClick"]),c(k,{onClick:t(U)},{default:a(()=>[v("\u91CD\u7F6E")]),_:1},8,["onClick"])]),_:1})]),_:1},8,["model"]),D("div",de,[c(N,{data:t(_).lists,ref:"elTable",onCellClick:S,"row-key":"id",onSelectionChange:q},{default:a(()=>[p.multipleChoice?(l(),o(O,{key:0,type:"selection",width:"55"})):L("",!0),(l(!0),m(b,null,y(p.config.tableList,e=>(l(),o(O,{label:e[Object.keys(e)[0]],"show-overflow-tooltip":""},{default:a(({row:f})=>[v(se(Object.keys(e)[0].includes(".")?f[Object.keys(e)[0].split(".")[0]][Object.keys(e)[0].split(".")[1]]:f[Object.keys(e)[0]]),1)]),_:2},1032,["label"]))),256))]),_:1},8,["data"])]),D("div",me,[c(A,{modelValue:t(_),"onUpdate:modelValue":i[1]||(i[1]=e=>ue(_)?_.value=e:null),onChange:t(V)},null,8,["modelValue","onChange"])]),p.multipleChoice?(l(),m("div",pe,[c(k,{type:"primary",onClick:T},{default:a(()=>[v("\u786E\u5B9A")]),_:1})])):L("",!0)]),_:1})),[[K,t(_).loading]])])}}}),ke={fetchFn:ie,serchList:[{label:"\u6807\u7B7E\u540D",value:"name"}],tableList:[{id:"ID"},{name:"\u6807\u7B7E\u540D"}]};export{he as _,ke as g};
|