Files
sgxt_web/gsxt/static/js/chunk-102d9007.b9ecb34a.js
2025-07-28 10:47:50 +08:00

1 line
11 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-102d9007"],{"0297":function(e,t,l){"use strict";l("56c7")},"2d16":function(e,t,l){"use strict";var a=l("7a23"),o=l("7902");const c={class:"box"},r={key:0,class:"label"},n=Object(a["createTextVNode"])("全选"),p={key:11},s={class:"flex"},d=Object(a["createTextVNode"])("确定"),u=Object(a["createTextVNode"])("重置");var b={__name:"Search",props:{searchArr:{type:Array,default:()=>[{showType:"select",prop:"selectKey",options:[{value:1,label:"选择1"}],defaultVal:"",label:"选择",dict:""},{showType:"input",prop:"inputKey",defaultVal:"",label:"输入"},{showType:"department",prop:"deptKey",defaultVal:"",label:"输入"},{showType:"daterange",prop:"daterangeKey",defaultVal:"",label:"输入"},{showType:"date",prop:"date",defaultVal:""},{showType:"checkbox",prop:"checkboxKey1",options:[{value:1,label:"选择1"}],defaultVal:""},{showType:"cascader",prop:"cascaderKey",label:"级联选择",checkStrictly:!1,defaultVal:""},{showType:"radio",defaultVal:""},{showType:"defaultTime",prop:"timeField",options:[]}]},marginBottom:{type:Number,default:15},backgroundColor:{type:String,default:"rgb(255, 255, 255, 1)"}},emits:["submit","reset"],setup(e,{emit:t}){const l=e,{proxy:b}=Object(a["getCurrentInstance"])();let i=Object(a["ref"])(!1),m=Object(a["reactive"])({});const h={clearable:!0,filterable:!0,multiple:!1,placeholder:"请选择"};let O=Object(a["reactive"])({});const j={clearable:!0,placeholder:"请输入"},k=[{text:"今天",value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-0),[t,e]}},{text:"昨天",value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-864e5),e.setTime(e.getTime()-864e5),[t,e]}},{text:"最近7天",value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-6048e5),[t,e]}},{text:"最近30天",value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-2592e6),[t,e]}},{text:"最近90天",value:()=>{const e=new Date,t=new Date;return t.setTime(t.getTime()-7776e6),[t,e]}}],f={rangeSeparator:"至",startPlaceholder:"开始日期",endPlaceholder:"结束日期",shortcuts:[],defaultShortcuts:!0},v={clearable:!0,placeholder:"请输入",shortcuts:[],defaultShortcuts:!0},y=[{text:"今天",value:new Date},{text:"昨天",value:()=>{const e=new Date;return e.setTime(e.getTime()-864e5),e}},{text:"7天前",value:()=>{const e=new Date;return e.setTime(e.getTime()-6048e5),e}},{text:"30天前",value:()=>{const e=new Date;return e.setTime(e.getTime()-2592e6),e}},{text:"90天前",value:()=>{const e=new Date;return e.setTime(e.getTime()-7776e6),e}}],V=e=>e.getTime()>Date.now(),w=Object(a["reactive"])({defaultVal:[],checkAll:!1,isIndeterminate:!1,showSelectAll:!0}),g=(e,t)=>{m[t.prop]=e?t.checkboxValueArr:[],t.isIndeterminate=!1},T=(e,t)=>{const l=e.length;t.checkAll=l===t.checkboxValueArr.length,t.isIndeterminate=l>0&&l<t.checkboxValueArr.length},B=(e,t)=>{console.log(e,t)};let x={filterable:!0,clearable:!0,placeholder:"请选择",checkStrictly:!0,showAllLevels:!1,lazy:!0,portUrl:"",props:{label:"label",value:"value",children:"children"},options:[]};const C=Object(a["reactive"])({value:"value",label:"label",lazy:!0,lazyLoad(e,t){const{level:l}=e;let a=[];switch(l){case 0:a=[{value:1,label:"选择1",leaf:!1},{value:2,label:"选择2",leaf:!1},{value:3,label:"选择3",leaf:!1},{value:4,label:"选择4",leaf:!0}];break;case 1:a=[{value:11,label:"选择1_1",leaf:!0},{value:21,label:"选择2_1",leaf:!0},{value:31,label:"选择3_1",leaf:!0},{value:41,label:"选择4_1",leaf:!0}]}t(a)}});let D=Object(a["reactive"])([]);const S=()=>{t("submit",m)},U=()=>{D.forEach(e=>{m[e.prop]=e.defaultVal}),t("submit",m),t("reset",!1)};return Object(a["watchEffect"])(()=>{i.value=!0;let e=JSON.parse(JSON.stringify(l.searchArr));D=e.map(e=>{switch(e.showType){case"select":e={...h,...e},e.options=Object(a["reactive"])(e.options),O[e.prop]=e.options;break;case"input":e={...j,...e};break;case"daterange":e={...f,...e},e.defaultShortcuts&&(e.shortcuts=k);break;case"date":e={...v,...e},e.defaultShortcuts&&(e.shortcuts=y);break;case"checkbox":e=Object(a["reactive"])({...w,...e}),e.checkboxValueArr=e.options.map(e=>e.value);break;case"cascader":e={...x,...e},e.lazy?(C.checkStrictly=e.checkStrictly,e.props={...C,...e.props||{}},delete e.options):(e.props={...x.props,...e.props||{},checkStrictly:e.checkStrictly},O[e.prop]=Object(a["reactive"])(e.options));break}return i.value=!1,m[e.prop]=e.defaultVal,e})}),(t,l)=>{const b=Object(a["resolveComponent"])("el-option"),h=Object(a["resolveComponent"])("el-select"),j=Object(a["resolveComponent"])("el-input"),k=Object(a["resolveComponent"])("el-date-picker"),f=Object(a["resolveComponent"])("el-checkbox"),v=Object(a["resolveComponent"])("el-checkbox-group"),y=Object(a["resolveComponent"])("el-radio"),w=Object(a["resolveComponent"])("el-radio-group"),x=Object(a["resolveComponent"])("el-cascader"),C=Object(a["resolveComponent"])("el-button"),N=Object(a["resolveDirective"])("loading");return Object(a["withDirectives"])((Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{class:"pageSearch searchBox",style:Object(a["normalizeStyle"])(`margin-bottom: ${e.marginBottom}px;background-color: ${e.backgroundColor}`)},[Object(a["createElementVNode"])("div",c,[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(Object(a["unref"])(D),(e,l)=>(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",{key:l,class:"item"},[e.label?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",r,Object(a["toDisplayString"])(e.label),1)):Object(a["createCommentVNode"])("",!0),"select"===e.showType?(Object(a["openBlock"])(),Object(a["createBlock"])(h,{key:1,modelValue:Object(a["unref"])(m)[e.prop],"onUpdate:modelValue":t=>Object(a["unref"])(m)[e.prop]=t,multiple:e.multiple,clearable:e.clearable,filterable:e.filterable,placeholder:e.placeholder,"collapse-tags":"","collapse-tags-tooltip":""},{default:Object(a["withCtx"])(()=>[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(Object(a["unref"])(O)[e.prop],e=>(Object(a["openBlock"])(),Object(a["createBlock"])(b,{key:e.value,label:e.label||e.lable,value:e.value},null,8,["label","value"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","multiple","clearable","filterable","placeholder"])):"input"===e.showType?(Object(a["openBlock"])(),Object(a["createBlock"])(j,{key:2,class:"input",modelValue:Object(a["unref"])(m)[e.prop],"onUpdate:modelValue":t=>Object(a["unref"])(m)[e.prop]=t,clearable:e.clearable,placeholder:e.placeholder},null,8,["modelValue","onUpdate:modelValue","clearable","placeholder"])):"daterange"===e.showType?(Object(a["openBlock"])(),Object(a["createBlock"])(k,{key:3,modelValue:Object(a["unref"])(m)[e.prop],"onUpdate:modelValue":t=>Object(a["unref"])(m)[e.prop]=t,type:"daterange","unlink-panels":"","range-separator":e.rangeSeparator,"start-placeholder":e.startPlaceholder,"end-placeholder":e.endPlaceholder,shortcuts:e.shortcuts,disabledDate:V,"value-format":"YYYY-MM-DD"},null,8,["modelValue","onUpdate:modelValue","range-separator","start-placeholder","end-placeholder","shortcuts"])):"datetimerange"===e.showType?(Object(a["openBlock"])(),Object(a["createBlock"])(k,{key:4,modelValue:Object(a["unref"])(m)[e.prop],"onUpdate:modelValue":t=>Object(a["unref"])(m)[e.prop]=t,type:"datetimerange","unlink-panels":"","range-separator":e.rangeSeparator||"至","start-placeholder":e.startPlaceholder||"开始日期","end-placeholder":e.endPlaceholder||"结束日期",shortcuts:e.shortcuts,"value-format":"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue","onUpdate:modelValue","range-separator","start-placeholder","end-placeholder","shortcuts"])):"date"===e.showType?(Object(a["openBlock"])(),Object(a["createBlock"])(k,{key:5,modelValue:Object(a["unref"])(m)[e.prop],"onUpdate:modelValue":t=>Object(a["unref"])(m)[e.prop]=t,type:"date",placeholder:e.placeholder,"disabled-date":V,shortcuts:e.shortcuts,"value-format":"YYYY-MM-DD"},null,8,["modelValue","onUpdate:modelValue","placeholder","shortcuts"])):"datetime"===e.showType?(Object(a["openBlock"])(),Object(a["createBlock"])(k,{key:6,modelValue:Object(a["unref"])(m)[e.prop],"onUpdate:modelValue":t=>Object(a["unref"])(m)[e.prop]=t,type:"datetime",placeholder:e.placeholder,"value-format":"YYYY-MM-DD HH:mm:ss"},null,8,["modelValue","onUpdate:modelValue","placeholder"])):"department"===e.showType?(Object(a["openBlock"])(),Object(a["createBlock"])(o["c"],{key:7,clearable:"",modelValue:Object(a["unref"])(m)[e.prop],"onUpdate:modelValue":t=>Object(a["unref"])(m)[e.prop]=t},null,8,["modelValue","onUpdate:modelValue"])):"checkbox"===e.showType?(Object(a["openBlock"])(),Object(a["createElementBlock"])(a["Fragment"],{key:8},[e.showSelectAll?(Object(a["openBlock"])(),Object(a["createBlock"])(f,{key:0,modelValue:e.checkAll,"onUpdate:modelValue":t=>e.checkAll=t,indeterminate:e.isIndeterminate,onChange:t=>{g(t,e)}},{default:Object(a["withCtx"])(()=>[n]),_:2},1032,["modelValue","onUpdate:modelValue","indeterminate","onChange"])):Object(a["createCommentVNode"])("",!0),Object(a["createVNode"])(v,{modelValue:Object(a["unref"])(m)[e.prop],"onUpdate:modelValue":t=>Object(a["unref"])(m)[e.prop]=t,onChange:t=>{T(t,e)}},{default:Object(a["withCtx"])(()=>[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.options,e=>(Object(a["openBlock"])(),Object(a["createBlock"])(f,{key:e.value,label:e.value},{default:Object(a["withCtx"])(()=>[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])],64)):"radio"===e.showType?(Object(a["openBlock"])(),Object(a["createBlock"])(w,{key:9,modelValue:Object(a["unref"])(m)[e.prop],"onUpdate:modelValue":t=>Object(a["unref"])(m)[e.prop]=t,onChange:t=>{B(t,e)}},{default:Object(a["withCtx"])(()=>[(Object(a["openBlock"])(!0),Object(a["createElementBlock"])(a["Fragment"],null,Object(a["renderList"])(e.options,e=>(Object(a["openBlock"])(),Object(a["createBlock"])(y,{key:e.value,label:e.value},{default:Object(a["withCtx"])(()=>[Object(a["createTextVNode"])(Object(a["toDisplayString"])(e.label),1)]),_:2},1032,["label"]))),128))]),_:2},1032,["modelValue","onUpdate:modelValue","onChange"])):"cascader"===e.showType?(Object(a["openBlock"])(),Object(a["createBlock"])(x,{key:10,modelValue:Object(a["unref"])(m)[e.prop],"onUpdate:modelValue":t=>Object(a["unref"])(m)[e.prop]=t,props:e.props,"show-all-levels":e.showAllLevels,clearable:e.clearable,options:Object(a["unref"])(O)[e.prop],placeholder:e.placeholder},null,8,["modelValue","onUpdate:modelValue","props","show-all-levels","clearable","options","placeholder"])):"defaultSlot"===e.showType?(Object(a["openBlock"])(),Object(a["createElementBlock"])("div",p,[Object(a["renderSlot"])(t.$slots,"defaultSlot")])):Object(a["createCommentVNode"])("",!0)]))),128)),Object(a["createElementVNode"])("div",s,[Object(a["createVNode"])(C,{type:"primary",onClick:S},{default:Object(a["withCtx"])(()=>[d]),_:1}),Object(a["createVNode"])(C,{type:"",onClick:U},{default:Object(a["withCtx"])(()=>[u]),_:1}),Object(a["renderSlot"])(t.$slots,"default")])])],4)),[[N,Object(a["unref"])(i)]])}}},i=(l("0297"),l("6b0d")),m=l.n(i);const h=m()(b,[["__scopeId","data-v-60710fed"]]);t["a"]=h},"56c7":function(e,t,l){}}]);