UNPKG

ll-package

Version:

2 lines (1 loc) 5.18 kB
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("vue"),C=require("./advanced-filtering.js");require("../../../assets/iconfont/iconfont.js");require("../../../../node_modules/ant-design-vue/dist/reset.css.js");require("../../../assets/styles/index.less.js");require("../index.js");require("../../Alert/index.js");require("../../Avatar/index.js");require("../../Badge/index.js");require("../../Barcode/index.js");require("../../Basic/index.js");require("../../BasicTreeSelect/index.js");require("../../Breadcrumb/index.js");require("../../Button/index.js");require("../../Calculate/index.js");require("../../Calendar/index.js");require("../../Cascader/index.js");require("../../Checkbox/index.js");require("../../CodeEditor/index.js");require("../../ColorPicker/index.js");require("../../ConfigProvider/index.js");require("../../Container/index.js");require("../../Copy/index.js");require("../../Cron/index.js");require("../../Cropper/index.js");require("../../DatePicker/index.js");require("../../Descriptions/index.js");require("../../Divider/index.js");require("../../Drawer/index.js");require("../../Dropdown/index.js");require("../../Editor/index.js");require("../../Empty/index.js");require("../../ErrorLog/index.js");require("../../FloatButton/index.js");require("../../Form/index.js");require("../../FormItem/index.js");require("../../Icon/index.js");require("../../IconPicker/index.js");require("../../Image/index.js");require("../../IconGroup/index.js");require("../../Input/index.js");require("../../InputSearch/index.js");require("../../InputGroup/index.js");require("../../InputNumber/index.js");require("../../MdEditor/index.js");require("../../MdViewer/index.js");require("../../Modal/index.js");require("../../MonthPicker/index.js");require("../../NumberRange/index.js");require("../../PopConfirm/index.js");require("../../Popover/index.js");require("../../Progress/index.js");require("../../Qrcode/index.js");require("../../Radio/index.js");require("../../Rate/index.js");require("../../Segmented/index.js");require("../../Select/index.js");require("../../SelectGroup/index.js");require("../../Slider/index.js");require("../../Space/index.js");require("../../Spin/index.js");require("../../Steps/index.js");require("../../Switch/index.js");require("../../Table/index.js");require("../../Tabs/index.js");require("../../Tag/index.js");require("../../TagGroup/index.js");require("../../Text/index.js");require("../../Transfer/index.js");require("../../Textarea/index.js");require("../../Timeline/index.js");require("../../Tooltip/index.js");require("../../Tree/index.js");require("../../TreeSearch/index.js");require("../../TreeSelect/index.js");require("../../Upload/index.js");require("../../UploadDrag/index.js");require("../../UploadImage/index.js");require("../../Watermark/index.js");const _=require("./components/advanced-filtering-params.vue.js"),g=require("./components/advanced-filtering-tags.vue.js"),k=require("../../Button/src/Index.vue.js"),S=require("../../Icon/src/Index.vue.js"),w=a=>(r.pushScopeId("data-v-e680f62f"),a=a(),r.popScopeId(),a),x=w(()=>r.createElementVNode("span",null,"高级筛选",-1)),V=r.defineComponent({__name:"advanced-filtering",props:C.llAvancedFilteringProps,setup(a,{emit:f}){const i=a,c=f,l=r.ref(i.value),o=r.ref(!1),t=r.ref(!1),q=r.ref([]),d=u=>{o.value||(t.value=u)},p=()=>{o.value=!o.value,t.value=!1},y=()=>{o.value=!1,t.value=!1},v=u=>{const e=q.value.find(n=>n.key===u);e?e.type==="multiple"?l.value[u]=["_all"]:e!=null&&e.options?l.value[u]=[]:l.value[u]="":delete l.value[u]},h=u=>{if(u)v(u.key);else for(const e in l.value)v(e)};return r.watch(()=>i.value,u=>{l.value=u,c("update:value",u),c("change",u)},{immediate:!0,deep:!0}),r.watchEffect(()=>{const u=i.value||{};q.value=i.filterCols.map(e=>(e.type==="multiple"&&(e!=null&&e.options||(e.options=[]),e!=null&&e.options.find(s=>s.value==="_all")||e.options.unshift({label:"全部",value:"_all"})),e!=null&&e.options?u[e.key]?l.value[e.key]=Array.isArray(u[e.key])?[...u[e.key]]:[...u[e.key].split(",")]:l.value[e.key]=e.type==="multiple"?["_all"]:[]:l.value[e.key]=e.key in u?u[e.key]:"",e))}),(u,e)=>{const n=r.resolveComponent("a-popover");return r.openBlock(),r.createBlock(n,{overlayClassName:["ll-advanced-filtering"],placement:"bottomRight",overlayStyle:i.overlayStyle,open:o.value},{content:r.withCtx(()=>[r.createVNode(_.default,{value:l.value,"onUpdate:value":e[0]||(e[0]=s=>l.value=s),"filter-cols":q.value,onClose:y},null,8,["value","filter-cols"])]),default:r.withCtx(()=>[r.createVNode(n,{overlayClassName:["ll-advanced-filtering"],trigger:"hover",placement:"bottomRight",open:t.value,overlayStyle:i.overlayStyle,onOpenChange:d},{content:r.withCtx(()=>[r.createVNode(g.default,{value:l.value,"filter-cols":q.value,onClean:h},null,8,["value","filter-cols"])]),default:r.withCtx(()=>[r.createVNode(r.unref(k.default),{onClick:r.withModifiers(p,["stop"])},{default:r.withCtx(()=>[r.createVNode(r.unref(S.default),{"icon-name":"icon-Screening",style:{"margin-right":"10px"}}),x]),_:1})]),_:1},8,["open","overlayStyle"])]),_:1},8,["overlayStyle","open"])}}});exports.default=V;