ERP-admin/build/admin/assets/dialogTableConfig.4df2343c.js

2 lines
3.2 KiB
JavaScript
Raw Normal View History

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