| 1 |
- import{_ as e}from"./uni-easyinput.B3QBO_js.js";import{bb as t,r as a,aW as l,aV as s,aG as i,B as d,bp as o,S as n,N as r,a8 as u,G as c,F as h,aQ as p,av as g,aa as f,M as y,b8 as m,E as v,aT as k,aR as _,br as D,bh as C,x as V,aO as b,bo as S,aA as w,aU as x,bc as $,al as N,bq as T}from"./index-F6_4Jyh4.js";import{a as F}from"./cwg-combox.CWJXmSox.js";import{_ as B}from"./uni-datetime-picker.DBovkksY.js";import{_ as I}from"./uni-load-more.DfDVL4Cs.js";import{b as U,c as j}from"./uni-row.zq2qDVVW.js";import{_ as O}from"./liveChat.GIhP_1Cc.js";import{_ as L}from"./cwg-page-wrapper.BFOixv7j.js";const P={props:{localdata:{type:[Array,Object],default:()=>[]},spaceInfo:{type:Object,default:()=>({})},collection:{type:String,default:""},action:{type:String,default:""},field:{type:String,default:""},orderby:{type:String,default:""},where:{type:[String,Object],default:""},pageData:{type:String,default:"add"},pageCurrent:{type:Number,default:1},pageSize:{type:Number,default:500},getcount:{type:[Boolean,String],default:!1},getone:{type:[Boolean,String],default:!1},gettree:{type:[Boolean,String],default:!1},manual:{type:Boolean,default:!1},value:{type:[Array,String,Number],default:()=>[]},modelValue:{type:[Array,String,Number],default:()=>[]},preload:{type:Boolean,default:!1},stepSearh:{type:Boolean,default:!0},selfField:{type:String,default:""},parentField:{type:String,default:""},multiple:{type:Boolean,default:!1},map:{type:Object,default:()=>({text:"text",value:"value"})}},data(){return{loading:!1,errorMessage:"",loadMore:{contentdown:"",contentrefresh:"",contentnomore:""},dataList:[],selected:[],selectedIndex:0,page:{current:this.pageCurrent,size:this.pageSize,count:0}}},computed:{isLocalData(){return!this.collection.length},isCloudData(){return this.collection.length>0},isCloudDataList(){return this.isCloudData&&!this.parentField&&!this.selfField},isCloudDataTree(){return this.isCloudData&&this.parentField&&this.selfField},dataValue(){return(Array.isArray(this.modelValue)?this.modelValue.length>0:null!==this.modelValue||void 0!==this.modelValue)?this.modelValue:this.value},hasValue(){return"number"==typeof this.dataValue||null!=this.dataValue&&this.dataValue.length>0}},created(){this.$watch(()=>{var e=[];return["pageCurrent","pageSize","spaceInfo","value","modelValue","localdata","collection","action","field","orderby","where","getont","getcount","gettree"].forEach(t=>{e.push(this[t])}),e},(e,t)=>{for(let a=2;a<e.length&&e[a]==t[a];a++);e[0]!=t[0]&&(this.page.current=this.pageCurrent),this.page.size=this.pageSize,this.onPropsChange()}),this._treeData=[]},methods:{onPropsChange(){this._treeData=[]},async loadData(){this.isLocalData?this.loadLocalData():this.isCloudDataList?this.loadCloudDataList():this.isCloudDataTree&&this.loadCloudDataTree()},async loadLocalData(){this._treeData=[],this._extractTree(this.localdata,this._treeData);let e=this.dataValue;void 0!==e&&(Array.isArray(e)&&(e=e[e.length-1],"object"==typeof e&&e[this.map.value]&&(e=e[this.map.value])),this.selected=this._findNodePath(e,this.localdata))},async loadCloudDataList(){if(!this.loading){this.loading=!0;try{let e=(await this.getCommand()).result.data;this._treeData=e,this._updateBindData(),this._updateSelected(),this.onDataChange()}catch(e){this.errorMessage=e}finally{this.loading=!1}}},async loadCloudDataTree(){if(!this.loading){this.loading=!0;try{let e={field:this._cloudDataPostField(),where:this._cloudDataTreeWhere()};this.gettree&&(e.startwith=`${this.selfField}=='${this.dataValue}'`);let t=(await this.getCommand(e)).result.data;this._treeData=t,this._updateBindData(),this._updateSelected(),this.onDataChange()}catch(e){this.errorMessage=e}finally{this.loading=!1}}},async loadCloudDataNode(e){if(!this.loading){this.loading=!0;try{let t={field:this._cloudDataPostField(),where:this._cloudDataNodeWhere()};e((await this.getCommand(t)).result.data)}catch(t){this.errorMessage=t}finally{this.loading=!1}}},getCloudDataValue(){return this.isCloudDataList?this.getCloudDataListValue():this.isCloudDataTree?this.getCloudDataTreeValue():void 0},getCloudDataListValue(){let e=[],t=this._getForeignKeyByField();return t&&e.push(`${t} == '${this.dataValue}'`),e=e.join(" || "),this.where&&(e=`(${this.where}) && (${e})`),this.getCommand({field:this._cloudDataPostField(),where:e}).then(e=>(this.selected=e.result.data,e.result.data))},getCloudDataTreeValue(){return this.getCommand({field:this._cloudDataPostField(),getTreePath:{startWith:`${this.selfField}=='${this.dataValue}'`}}).then(e=>{let t=[];return this._extractTreePath(e.result.data,t),this.selected=t,t})},getCommand(e={}){let a=t.database(this.spaceInfo);const l=e.action||this.action;l&&(a=a.action(l));const s=e.collection||this.collection;a=a.collection(s);const i=e.where||this.where;i&&Object.keys(i).length&&(a=a.where(i));const d=e.field||this.field;d&&(a=a.field(d));const o=e.orderby||this.orderby;o&&(a=a.orderBy(o));const n=void 0!==e.pageCurrent?e.pageCurrent:this.page.current,r=void 0!==e.pageSize?e.pageSize:this.page.size,u={getCount:void 0!==e.getcount?e.getcount:this.getcount,getTree:void 0!==e.gettree?e.gettree:this.gettree};return e.getTreePath&&(u.getTreePath=e.getTreePath),a=a.skip(r*(n-1)).limit(r).get(u),a},_cloudDataPostField(){let e=[this.field];return this.parentField&&e.push(`${this.parentField} as parent_value`),e.join(",")},_cloudDataTreeWhere(){let e=[],t=this.selected,a=this.parentField;if(a&&e.push(`${a} == null || ${a} == ""`),t.length)for(var l=0;l<t.length-1;l++)e.push(`${a} == '${t[l].value}'`);let s=[];return this.where&&s.push(`(${this.where})`),e.length&&s.push(`(${e.join(" || ")})`),s.join(" && ")},_cloudDataNodeWhere(){let e=[],t=this.selected;return t.length&&e.push(`${this.parentField} == '${t[t.length-1].value}'`),e=e.join(" || "),this.where?`(${this.where}) && (${e})`:e},_getWhereByForeignKey(){let e=[],t=this._getForeignKeyByField();return t&&e.push(`${t} == '${this.dataValue}'`),this.where?`(${this.where}) && (${e.join(" || ")})`:e.join(" || ")},_getForeignKeyByField(){let e=this.field.split(","),t=null;for(let a=0;a<e.length;a++){const l=e[a].split("as");if(!(l.length<2)&&"value"===l[1].trim()){t=l[0].trim();break}}return t},_updateBindData(e){const{dataList:t,hasNodes:a}=this._filterData(this._treeData,this.selected);let l=!1===this._stepSearh&&!a;return e&&(e.isleaf=l),this.dataList=t,this.selectedIndex=t.length-1,!l&&this.selected.length<t.length&&this.selected.push({value:null,text:"请选择"}),{isleaf:l,hasNodes:a}},_updateSelected(){let e=this.dataList,t=this.selected,a=this.map.text,l=this.map.value;for(let s=0;s<t.length;s++){let i=t[s].value,d=e[s];for(let e=0;e<d.length;e++){let o=d[e];if(o[l]===i){t[s].text=o[a];break}}}},_filterData(e,t){let a=[],l=!0;a.push(e.filter(e=>null===e.parent_value||void 0===e.parent_value||""===e.parent_value));for(let s=0;s<t.length;s++){let i=t[s].value,d=e.filter(e=>e.parent_value===i);d.length?a.push(d):l=!1}return{dataList:a,hasNodes:l}},_extractTree(e,t,a){let l=this.map.value;for(let s=0;s<e.length;s++){let i=e[s],d={};for(let e in i)"children"!==e&&(d[e]=i[e]);null!=a&&""!==a&&(d.parent_value=a),t.push(d);let o=i.children;o&&this._extractTree(o,t,i[l])}},_extractTreePath(e,t){for(let a=0;a<e.length;a++){let l=e[a],s={};for(let e in l)"children"!==e&&(s[e]=l[e]);t.push(s);let i=l.children;i&&this._extractTreePath(i,t)}},_findNodePath(e,t,a=[]){let l=this.map.text,s=this.map.value;for(let i=0;i<t.length;i++){let d=t[i],o=d.children,n=d[l],r=d[s];if(a.push({value:r,text:n}),r===e)return a;if(o){const t=this._findNodePath(e,o,a);if(t.length)return t}a.pop()}return[]}}};const M=a({name:"UniDataPicker",emits:["popupopened","popupclosed","nodeclick","input","change","update:modelValue","inputclick"],mixins:[P],components:{DataPickerView:a({name:"UniDataPickerView",emits:["nodeclick","change","datachange","update:modelValue"],mixins:[P],props:{managedMode:{type:Boolean,default:!1},ellipsis:{type:Boolean,default:!0}},created(){this.managedMode||this.$nextTick(()=>{this.loadData()})},methods:{onPropsChange(){this._treeData=[],this.selectedIndex=0,this.$nextTick(()=>{this.loadData()})},handleSelect(e){this.selectedIndex=e},handleNodeClick(e,t,a){if(e.disable)return;const l=this.dataList[t][a],s=l[this.map.text],i=l[this.map.value];if(t<this.selected.length-1?(this.selected.splice(t,this.selected.length-t),this.selected.push({text:s,value:i})):t===this.selected.length-1&&this.selected.splice(t,1,{text:s,value:i}),l.isleaf)return void this.onSelectedChange(l,l.isleaf);const{isleaf:d,hasNodes:o}=this._updateBindData();this.isLocalData?this.onSelectedChange(l,!o||d):this.isCloudDataList?this.onSelectedChange(l,!0):this.isCloudDataTree&&(d?this.onSelectedChange(l,l.isleaf):o||this.loadCloudDataNode(e=>{e.length?(this._treeData.push(...e),this._updateBindData(l)):l.isleaf=!0,this.onSelectedChange(l,l.isleaf)}))},updateData(e){this._treeData=e.treeData,this.selected=e.selected,this._treeData.length?this._updateBindData():this.loadData()},onDataChange(){this.$emit("datachange")},onSelectedChange(e,t){t&&this._dispatchEvent(),e&&this.$emit("nodeclick",e)},_dispatchEvent(){this.$emit("change",this.selected.slice(0))}}},[["render",function(e,t,a,k,_,D){const C=f,V=u,b=n,S=l(s("uni-load-more"),I);return i(),d(V,{class:"uni-data-pickerview"},{default:o(()=>[e.isCloudDataList?v("",!0):(i(),d(b,{key:0,class:"selected-area","scroll-x":"true"},{default:o(()=>[r(V,{class:"selected-list"},{default:o(()=>[(i(!0),c(h,null,p(e.selected,(t,a)=>(i(),d(V,{class:g(["selected-item",{"selected-item-active":a==e.selectedIndex}]),key:a,onClick:e=>D.handleSelect(a)},{default:o(()=>[r(C,null,{default:o(()=>[y(m(t.text||""),1)]),_:2},1024)]),_:2},1032,["class","onClick"]))),128))]),_:1})]),_:1})),r(V,{class:"tab-c"},{default:o(()=>[r(b,{class:"list","scroll-y":!0},{default:o(()=>[(i(!0),c(h,null,p(e.dataList[e.selectedIndex],(t,a)=>(i(),d(V,{class:g(["item",{"is-disabled":!!t.disable}]),key:a,onClick:l=>D.handleNodeClick(t,e.selectedIndex,a)},{default:o(()=>[r(C,{class:"item-text"},{default:o(()=>[y(m(t[e.map.text]),1)]),_:2},1024),e.selected.length>e.selectedIndex&&t[e.map.value]==e.selected[e.selectedIndex].value?(i(),d(V,{key:0,class:"check"})):v("",!0)]),_:2},1032,["class","onClick"]))),128))]),_:1}),e.loading?(i(),d(V,{key:0,class:"loading-cover"},{default:o(()=>[r(S,{class:"load-more",contentText:e.loadMore,status:"loading"},null,8,["contentText"])]),_:1})):v("",!0),e.errorMessage?(i(),d(V,{key:1,class:"error-message"},{default:o(()=>[r(C,{class:"error-text"},{default:o(()=>[y(m(e.errorMessage),1)]),_:1})]),_:1})):v("",!0)]),_:1})]),_:1})}],["__scopeId","data-v-d9e0b6eb"]])},props:{options:{type:[Object,Array],default:()=>({})},popupTitle:{type:String,default:"请选择"},placeholder:{type:String,default:"请选择"},heightMobile:{type:String,default:""},readonly:{type:Boolean,default:!1},clearIcon:{type:Boolean,default:!0},border:{type:Boolean,default:!0},split:{type:String,default:"/"},ellipsis:{type:Boolean,default:!0}},data:()=>({isOpened:!1,inputSelected:[]}),created(){this.$nextTick(()=>{this.load()})},watch:{localdata:{handler(){this.load()},deep:!0}},methods:{clear(){this._dispatchEvent([])},onPropsChange(){this._treeData=[],this.selectedIndex=0,this.load()},load(){this.readonly?this._processReadonly(this.localdata,this.dataValue):this.isLocalData?(this.loadData(),this.inputSelected=this.selected.slice(0)):(this.isCloudDataList||this.isCloudDataTree)&&(this.loading=!0,this.getCloudDataValue().then(e=>{this.loading=!1,this.inputSelected=e}).catch(e=>{this.loading=!1,this.errorMessage=e}))},show(){this.isOpened=!0,setTimeout(()=>{this.$refs.pickerView.updateData({treeData:this._treeData,selected:this.selected,selectedIndex:this.selectedIndex})},200),this.$emit("popupopened")},hide(){this.isOpened=!1,this.$emit("popupclosed")},handleInput(){this.readonly?this.$emit("inputclick"):this.show()},handleClose(e){this.hide()},onnodeclick(e){this.$emit("nodeclick",e)},ondatachange(e){this._treeData=this.$refs.pickerView._treeData},onchange(e){this.hide(),this.$nextTick(()=>{this.inputSelected=e}),this._dispatchEvent(e)},_processReadonly(e,t){if(e.findIndex(e=>e.children)>-1){let e;return Array.isArray(t)?(e=t[t.length-1],"object"==typeof e&&e.value&&(e=e.value)):e=t,void(this.inputSelected=this._findNodePath(e,this.localdata))}if(!this.hasValue)return void(this.inputSelected=[]);let a=[];if(Array.isArray(t))for(let i=0;i<t.length;i++){var l=t[i],s=e.find(e=>e.value==l);s&&a.push(s)}else{let l=e.find(e=>e.value==t);l&&a.push(l)}a.length&&(this.inputSelected=a)},_filterForArray(e,t){var a=[];for(let i=0;i<t.length;i++){var l=t[i],s=e.find(e=>e.value==l);s&&a.push(s)}return a},_dispatchEvent(e){let t={};if(e.length){for(var a=new Array(e.length),l=0;l<e.length;l++)a[l]=e[l].value;t=e[e.length-1]}else t.value="";this.formItem&&this.formItem.setValue(t.value),this.$emit("input",t.value),this.$emit("update:modelValue",t.value),this.$emit("change",{detail:{value:e}})}}},[["render",function(e,t,a,C,V,b){const S=f,w=l(s("uni-load-more"),I),x=u,$=n,N=l(s("uni-icons"),U),T=k("data-picker-view");return i(),d(x,{class:"uni-data-tree"},{default:o(()=>[r(x,{class:"uni-data-tree-input",onClick:b.handleInput},{default:o(()=>[_(e.$slots,"default",{options:a.options,data:V.inputSelected,error:e.errorMessage},()=>[r(x,{class:g(["input-value",{"input-value-border":a.border}])},{default:o(()=>[e.errorMessage?(i(),d(S,{key:0,class:"selected-area error-text"},{default:o(()=>[y(m(e.errorMessage),1)]),_:1})):e.loading&&!V.isOpened?(i(),d(x,{key:1,class:"selected-area"},{default:o(()=>[r(w,{class:"load-more",contentText:e.loadMore,status:"loading"},null,8,["contentText"])]),_:1})):V.inputSelected.length?(i(),d($,{key:2,class:"selected-area","scroll-x":"true"},{default:o(()=>[r(x,{class:"selected-list"},{default:o(()=>[(i(!0),c(h,null,p(V.inputSelected,(e,t)=>(i(),d(x,{class:"selected-item",key:t},{default:o(()=>[r(S,{class:"text-color"},{default:o(()=>[y(m(e.text),1)]),_:2},1024),t<V.inputSelected.length-1?(i(),d(S,{key:0,class:"input-split-line"},{default:o(()=>[y(m(a.split),1)]),_:1})):v("",!0)]),_:2},1024))),128))]),_:1})]),_:1})):(i(),d(S,{key:3,class:"selected-area placeholder"},{default:o(()=>[y(m(a.placeholder),1)]),_:1})),a.clearIcon&&!a.readonly&&V.inputSelected.length?(i(),d(x,{key:4,class:"icon-clear",onClick:D(b.clear,["stop"])},{default:o(()=>[r(N,{type:"clear",color:"#c0c4cc",size:"24"})]),_:1},8,["onClick"])):v("",!0),a.clearIcon&&V.inputSelected.length||a.readonly?v("",!0):(i(),d(x,{key:5,class:"arrow-area"},{default:o(()=>[r(x,{class:"input-arrow"})]),_:1}))]),_:1},8,["class"])],!0)]),_:3},8,["onClick"]),V.isOpened?(i(),d(x,{key:0,class:"uni-data-tree-cover",onClick:b.handleClose},null,8,["onClick"])):v("",!0),V.isOpened?(i(),d(x,{key:1,class:"uni-data-tree-dialog"},{default:o(()=>[r(x,{class:"uni-popper__arrow"}),r(x,{class:"dialog-caption"},{default:o(()=>[r(x,{class:"title-area"},{default:o(()=>[r(S,{class:"dialog-title"},{default:o(()=>[y(m(a.popupTitle),1)]),_:1})]),_:1}),r(x,{class:"dialog-close",onClick:b.handleClose},{default:o(()=>[r(x,{class:"dialog-close-plus","data-id":"close"}),r(x,{class:"dialog-close-plus dialog-close-rotate","data-id":"close"})]),_:1},8,["onClick"])]),_:1}),r(T,{class:"picker-view",ref:"pickerView",modelValue:e.dataValue,"onUpdate:modelValue":t[0]||(t[0]=t=>e.dataValue=t),localdata:e.localdata,preload:e.preload,collection:e.collection,field:e.field,orderby:e.orderby,where:e.where,"step-searh":e.stepSearh,"self-field":e.selfField,"parent-field":e.parentField,"managed-mode":!0,map:e.map,ellipsis:a.ellipsis,onChange:b.onchange,onDatachange:b.ondatachange,onNodeclick:b.onnodeclick},null,8,["modelValue","localdata","preload","collection","field","orderby","where","step-searh","self-field","parent-field","map","ellipsis","onChange","onDatachange","onNodeclick"])]),_:1})):v("",!0)]),_:3})}],["__scopeId","data-v-02c14ef9"]]),A=a({__name:"cwg-complex-search",props:{fields:{type:Array,required:!0},columns:{type:Number,default:1},noData:{type:Boolean,default:!1},modelValue:{type:Object,default:()=>({})}},emits:["update:modelValue","search","reset"],setup(t,{emit:a}){const{t:k}=C(),_=t,D=a,I=V(()=>{const e=new Date,t=new Date(e),a=new Date(e);a.setDate(a.getDate()-365);return{start:"",end:(l=t,`${l.getFullYear()}-${String(l.getMonth()+1).padStart(2,"0")}-${String(l.getDate()).padStart(2,"0")}`)};var l}),U=e=>{const t=new Date,a=t.getFullYear(),l=t.getMonth(),s=new Date(a,l,1),i=new Date,d=e=>`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}`;return"daterange"===e.type?[d(s),d(i)]:"date"===e.type?d(i):""},P=b({}),A=b({}),z=b(!1),E=b(!1),J=V(()=>{const e=[];for(let t=0;t<_.fields.length;t+=_.columns)e.push(_.fields.slice(t,t+_.columns));return e}),W=V(()=>(console.log(window.innerWidth),window.innerWidth)),K=V(()=>E.value?J.value:W.value>1500?J.value.slice(0,4):J.value.slice(0,3)),R=V(()=>J.value.length>(W.value>1500?4:3)),Y=()=>{E.value=!E.value},q=()=>{const e={};_.noData||_.fields.forEach(t=>{if(_.modelValue&&null!=_.modelValue[t.key])e[t.key]=_.modelValue[t.key];else{if(void 0!==t.defaultValue)return void(e[t.key]=t.defaultValue);"date"===t.type||"daterange"===t.type?e[t.key]=U(t):"select"===t.type?e[t.key]=null:e[t.key]=""}}),P.value=e,A.value=JSON.parse(JSON.stringify(e)),te()},G=V(()=>_.fields.find(e=>"date"===e.type||"daterange"===e.type)),H=e=>!!e.options&&(e.options.length>10||!0===e.isSelect),Q=e=>{P.value[G.value.key]=e,A.value[G.value.key]=e,te()},X=V(()=>{const e=_.fields.filter(e=>"date"!==e.type&&"daterange"!==e.type),t=[],a=[];return e.forEach(e=>{"input"===e.type||"number"===e.type?t.push(e):"select"===e.type?H(e)?t.push(e):a.push(e):"picker"===e.type?t.push(e):a.push(e)}),[...t,...a]}),Z=e=>JSON.parse(JSON.stringify(e??{})),ee=(e,t)=>JSON.stringify(e??{})===JSON.stringify(t??{});S(()=>_.modelValue,e=>{if(!e)return;const t=Z(e),a={...P.value};_.fields.forEach(e=>{null!=t[e.key]?a[e.key]=t[e.key]:"date"!==e.type&&"daterange"!==e.type||(a[e.key]=U(e))}),ee(a,P.value)||(P.value=a,A.value=Z(a))},{deep:!0,immediate:!0}),S(P,e=>{const t=Z(e);ee(t,_.modelValue)||D("update:modelValue",t)},{deep:!0});const te=()=>{D("search",{...P.value})},ae=()=>{A.value=JSON.parse(JSON.stringify(P.value)),z.value=!0},le=()=>{P.value=JSON.parse(JSON.stringify(A.value)),z.value=!1,te()};return S(()=>_.fields,()=>{q()},{deep:!0,immediate:!1}),w(()=>{q()}),(t,a)=>{const _=l(s("uni-easyinput"),e),D=l(s("cwg-combox"),F),C=l(s("uni-datetime-picker"),B),V=l(s("uni-data-picker"),M),b=u,S=f,w=N,U=l(s("cwg-match-media"),j),J=l(s("cwg-icon"),O),W=n,q=l(s("cwg-popup"),L),Z=x("t");return i(),d(b,{class:"complex-search"},{default:o(()=>[r(U,{"min-width":991},{default:o(()=>[r(b,{class:"search-bar search-form"},{default:o(()=>[(i(!0),c(h,null,p(K.value,(e,t)=>(i(),d(b,{key:t,class:"form-row"},{default:o(()=>[(i(!0),c(h,null,p(e,e=>(i(),d(b,{key:e.key,class:"form-item"},{default:o(()=>[r(b,{class:"search-bar"},{default:o(()=>["input"===e.type?(i(),d(_,{key:0,modelValue:P.value[e.key],"onUpdate:modelValue":t=>P.value[e.key]=t,placeholder:e.placeholder||"请输入",clearable:""},null,8,["modelValue","onUpdate:modelValue","placeholder"])):"select"===e.type?(i(),d(D,{key:1,value:P.value[e.key],"onUpdate:value":t=>P.value[e.key]=t,options:e.options,placeholder:e.placeholder||"请选择",clearable:e.clearable||!1,onChange:t=>{var a;return(null==(a=e.onChange)?void 0:a.call(e,t))||te()}},null,8,["value","onUpdate:value","options","placeholder","clearable","onChange"])):"date"===e.type?(i(),d(C,{key:2,start:I.value.start,end:I.value.end,modelValue:P.value[e.key],"onUpdate:modelValue":t=>P.value[e.key]=t,type:"date",placeholder:e.placeholder||"请选择日期",onChange:Q},null,8,["start","end","modelValue","onUpdate:modelValue","placeholder"])):"daterange"===e.type?(i(),d(C,{key:3,start:I.value.start,end:I.value.end,modelValue:P.value[e.key],"onUpdate:modelValue":t=>P.value[e.key]=t,type:"daterange",placeholder:e.placeholder||"请选择日期范围",onChange:Q},null,8,["start","end","modelValue","onUpdate:modelValue","placeholder"])):"picker"===e.type?(i(),d(V,{key:4,style:{"min-width":"100px"},modelValue:P.value[e.key],"onUpdate:modelValue":t=>P.value[e.key]=t,localdata:e.options,"popup-title":e.popupTitle||$(k)("State.All"),map:e.map||{value:"value",text:"label"},onChange:t=>{var a;return null==(a=e.onChange)?void 0:a.call(e,t)},onNodeclick:t=>{var a;return null==(a=e.onNodeClick)?void 0:a.call(e,t)}},null,8,["modelValue","onUpdate:modelValue","localdata","popup-title","map","onChange","onNodeclick"])):"number"===e.type?(i(),d(_,{key:5,modelValue:P.value[e.key],"onUpdate:modelValue":t=>P.value[e.key]=t,type:"number",placeholder:e.placeholder||"请输入数字"},null,8,["modelValue","onUpdate:modelValue","placeholder"])):v("",!0)]),_:2},1024)]),_:2},1024))),128))]),_:2},1024))),128)),r(b,{class:"form-actions"},{default:o(()=>[R.value?(i(),d(w,{key:0,class:"search-btn",onClick:Y},{default:o(()=>[r(S,null,{default:o(()=>[y(m(E.value?$(k)("Btn.Hide"):$(k)("Btn.More")),1)]),_:1})]),_:1})):v("",!0),T(r(w,{class:"search-btn",onClick:te},null,512),[[Z,"Btn.Search"]])]),_:1})]),_:1})]),_:1}),r(U,{"max-width":991},{default:o(()=>[r(b,{class:"mobile-filter"},{default:o(()=>[G.value?(i(),d(b,{key:0,class:"mobile-date-wrapper"},{default:o(()=>[r(C,{start:I.value.start,end:I.value.end,modelValue:P.value[G.value.key],"onUpdate:modelValue":a[0]||(a[0]=e=>P.value[G.value.key]=e),type:"daterange"===G.value.type?"daterange":"date",placeholder:G.value.placeholder||("daterange"===G.value.type?"选择日期范围":"选择日期"),onChange:Q},null,8,["start","end","modelValue","type","placeholder"])]),_:1})):(i(),d(b,{key:1,class:"mobile-date-wrapper"})),r(w,{class:"filter-chip",onClick:ae},{default:o(()=>[r(J,{name:"cwg-filter",size:14,color:"#141d22"}),T(r(S,{class:"filter-label"},null,512),[[Z,"Documentary.tradingCenter.item3"]])]),_:1})]),_:1})]),_:1}),r(q,{visible:z.value,"onUpdate:visible":a[1]||(a[1]=e=>z.value=e),type:"center","mask-click":!1,showFooters:!0,title:$(k)("Documentary.tradingCenter.item3"),class:"search-dialog"},{footer:o(()=>[T(r(w,{class:"search-btn",onClick:le},null,512),[[Z,"Btn.Search"]])]),default:o(()=>[r(W,{"scroll-y":"",class:"drawer-content",style:{overflow:"visible"}},{default:o(()=>[(i(!0),c(h,null,p(X.value,e=>(i(),d(b,{key:e.key,class:"filter-item"},{default:o(()=>[r(b,{class:"label"},{default:o(()=>[y(m(e.label),1)]),_:2},1024),r(b,{class:"control"},{default:o(()=>["input"===e.type?(i(),d(_,{key:0,modelValue:A.value[e.key],"onUpdate:modelValue":t=>A.value[e.key]=t,placeholder:e.placeholder||"请输入",clearable:""},null,8,["modelValue","onUpdate:modelValue","placeholder"])):"select"===e.type?(i(),c(h,{key:1},[H(e)?(i(),d(D,{key:0,value:A.value[e.key],"onUpdate:value":t=>A.value[e.key]=t,options:e.options,placeholder:e.placeholder||"请选择",clearable:!1,placement:"bottom"},null,8,["value","onUpdate:value","options","placeholder"])):(i(),d(b,{key:1,class:"chip-group"},{default:o(()=>[r(b,{class:"chip-list"},{default:o(()=>[(i(!0),c(h,null,p(e.options,t=>(i(),d(b,{key:t.value,class:g(["chip",{"chip-filled":A.value[e.key]===t.value,"chip-outlined":A.value[e.key]!==t.value}]),onClick:a=>{return l=e.key,s=t.value,void(A.value[l]=s);var l,s}},{default:o(()=>[y(m(t.text),1)]),_:2},1032,["class","onClick"]))),128))]),_:2},1024)]),_:2},1024))],64)):"number"===e.type?(i(),d(_,{key:2,modelValue:A.value[e.key],"onUpdate:modelValue":t=>A.value[e.key]=t,type:"number",placeholder:e.placeholder||"请输入数字",clearable:""},null,8,["modelValue","onUpdate:modelValue","placeholder"])):"picker"===e.type?(i(),d(V,{key:3,modelValue:A.value[e.key],"onUpdate:modelValue":t=>A.value[e.key]=t,localdata:e.options,"popup-title":e.popupTitle||$(k)("State.All"),map:e.map||{value:"value",text:"label"},onChange:t=>{var a;return null==(a=e.onChange)?void 0:a.call(e,t)},onNodeclick:t=>{var a;return null==(a=e.onNodeClick)?void 0:a.call(e,t)}},null,8,["modelValue","onUpdate:modelValue","localdata","popup-title","map","onChange","onNodeclick"])):v("",!0)]),_:2},1024),1==X.value.length?(i(),d(b,{key:0,style:{height:"25vh"}})):v("",!0)]),_:2},1024))),128))]),_:1})]),_:1},8,["visible","title"])]),_:1})}}},[["__scopeId","data-v-8a054eea"]]);export{A as _};
|