
管理员
站长
- UID
- 1
- 积分
- 224400
- 余额
- 13 R
- Moe币
- 84881
- 在线时间
- 279 小时
- 注册时间
- 2025-12-28
- 最后登录
- 2026-11-9
|
|
lectSize:"",selectStyle:"",allowPreview:!0,isCateError:!1,isDefaultOrSinger:!0,isUpdateColorStatus:0,isFirstEnterPage:!0,disabledReset:!1,originCount:""}},watch:{keyword:{handler(e){e&&this.$nextTick(async()=>{this.originCount=await this.getDiagramCount(),this.selectCount=this.originCount,this.setInitKeyword(e),this.isFirstEnterPage&&await this.getSearchFilterData(),this.isFirstEnterPage=!1,this.reload()})},immediate:!0},getMbType:{handler(e){Array.isArray(e)&&e.forEach(e=>{this.$track.emit({act:"display",mId:"category_area.payment_type",params:{payment_type:w[e.name]}})})}},showColorPanel(e){e||(this.$refs.headerRef.showColorPanel=!1)},showCatePanel(e){e||(this.$refs.headerRef.showCatePanel=!1)},"$route.name":function(e){"search"===e&&this.emitDisplay()}},computed:{...(0,l.mapGetters)(["keyword","isFollowTheme","searchData","CurrentCount","searchFilter","getDesignColorList"]),getCnt(){return Array.isArray(this.searchFilter)&&this.searchFilter?.find(e=>"item_cnt"===e.mark)?.list||[]},getMbType(){return Array.isArray(this.searchFilter)&&this.searchFilter?.find(e=>"mb_types"===e.mark)?.list||[]},getSizeList(){return Array.isArray(this.searchFilter)&&this.searchFilter?.find(e=>"size"===e.mark)?.list||[]},getStyleList(){return Array.isArray(this.searchFilter)&&this.searchFilter?.find(e=>"style"===e.mark)?.list||[]},cateList(){let e=[{source:"cnt",title:"项数",type:"cnt",activeValue:this.selectCount||"",list:this.getCnt},{source:"size",title:"尺寸",type:"size",activeValue:this.selectSize||"",list:this.getSizeList},{source:"style",title:"风格",type:"style",activeValue:this.selectStyle||"",list:this.getStyleList},{source:"mb_type",activeValue:this.currentPayType.name||0,title:"付费类型",component:"wpp",list:this.getMbType}];return Array.isArray(this.searchFilter)&&(-1===this.searchFilter?.findIndex(e=>"style"===e.mark)&&(e=e.filter(e=>!["style"].includes(e.source))),-1===this.searchFilter?.findIndex(e=>"size"===e.mark)&&(e=e.filter(e=>!["size"].includes(e.source)))),this.disabledReset=this.originCount===this.selectCount&&this.selectStyle===this.getStyleList[0]?.name&&this.selectSize===this.getSizeList[0]?.name&&0===this.currentPayType.name,e},isWps(){return"wps"===r.qi.name},selectPaymentLabel(){return w[this.currentPayType.name]||w[0]},selectSizeLabel(){return this.getSizeList.find(e=>e.name===this.selectSize)?.label||"全部"},selectStyleLabel(){return this.getStyleList.find(e=>e.name===this.selectStyle)?.label||"全部"},mtData(){return{first_cat_name:"smartart_searchresult",items:this.selectCount,payment_type:this.selectPaymentLabel,keyword:this.keyword,recommend_id:"",resource_uuid:"",policy:"occ",style:this.selectStyleLabel,size:this.selectSizeLabel}}},methods:{...(0,l.mapActions)(["changeSearchData","setDialogSnowBallData","setInitKeyword"]),...(0,l.mapMutations)("TaskPanel",["setSearchGatherText","setCurrentColorIndex"]),handleUpdateColor(){this.isDefaultOrSinger=0===this.currentSelector.length||this.currentSelector.every(e=>e===this.currentSelector[0]),this.isUpdateColorStatus=Date.now()},handleAllowPreview(e){this.allowPreview=e},setGatherText(e){const t=e?.replaceAll("/全部","");this.setSearchGatherText(""===t?"筛选":t)},async reset(){this.searchFilter.forEach(e=>{const{name:t,label:s}=e?.list?.length>0?e?.list[0]:{},a=e.mark;"item_cnt"===a&&(this.selectCount=this.originCount),"mb_types"===a&&(this.currentPayType={name:t,label:s}),"style"===a&&(this.selectStyle=t),"size"===a&&(this.selectSize=t)}),this.reload()},async change(e){const{value:t,source:s}=e,a={cnt:"selectCount",style:"selectStyle",size:"selectSize"};this[a[e.source]]=t.name,"mb_type"===s&&(this.currentPayType=t);const i={category:"category",cnt:"number",mb_type:"payment",style:"style",size:"size"};this.handleTrack({act:"click",mId:`category_area.${i[e.source]}`,...this.mtData}),this.reload()},emitListScroll(e){this.$refs?.listRef?.$el&&(this.$refs.listRef.$el.scrollTop=e||0)},handleChangeColorPanel(e){this.showColorPanel=!this.showColorPanel,this.showCatePanel=!1,e&&this.emitListScroll()},handleChangeCatePanel(e){this.showCatePanel=!this.showCatePanel,this.showColorPanel=!1,e&&this.emitListScroll()},onScroll(e){e.scrollTop>250&&(this.showCatePanel=!1,this.showColorPanel=!1,this.$refs.headerRef.showCatePanel=!1,this.$refs.headerRef.showColorPanel=!1),e.scrollTop>0?this.showBackToTop=!0:this.showBackToTop=!1},backToTop(){const e=this.$refs.listRef.$el;e&&e.scrollTo({left:0,top:0,behavior:"smooth"}),this.$track.emit({act:"click",mId:"nav_bar.back_top",params:{}})},reload(){this.$refs?.listRef?.reload()},handleBack(){this.total=0,this.$router.push({path:"/Home/TaskPanel/List",query:{pre_klm:this.$route.query.pre_klm}}),this.setInitKeyword(""),this.setCurrentColorIndex(-1),this.changeSearchData({keyword:"",isSearchPage:!1}),this.$track.emit({act:"click",mId:"search.clean_recent",params:{}})},async fetchSearchData(e){this.snowBallRecData=f;const t=(new Date).getTime();let s=null;if(this.isCateError)return[{msg:"加载错误"},{list:[]}];const a=[];try{const e=JSON.parse(this.selectSize)||[];e.length&&a.push(e)}catch(l){}try{const e=JSON.parse(this.selectStyle)||[];e.length&&a.push(e)}catch(l){}const i={offset:25*e,limit:25,hdid:r.qi.hdid,keyword:this.keyword,item_cnt:this.selectCount,with_total:"true",mb_types:[this.currentPayType.name],position:r.nL.SEARCH};a.length&&(i.mix_22_tag_ids=a);try{if(s=await this.fetchSearchRecData(i),"ok"!==s.result)return this.total=0,this.$track.emit({act:"load",mId:"",params:{load_status:"fail",erro_code:s.result,load_error_code:s.code,load_error_msg:s.msg,...this.searchData,duration:(new Date).getTime()-t}}),[{msg:"加载错误"},{list:[]}];const a=s.data||{};let{list:l,total:o}=a;const{items:n=[],alg:c="OCC_OP",is_backup:h=!1}=a;this.isWps||(l=n),h&&"wpp"===r.qi.name&&l.length&&(this.snowBallRecData={list:l,total:o},l=0,o=0);const d={resource_count:o,policy:c};return"associate"!==this.searchData.search_type&&(d.inputword=""),this.changeSearchData(d),this.total=o,l?.length||0!==e?this.showRecList=!1:(this.showRecList=!0,this.$track.emit({act:"display",mId:"null_recommend",params:{payment_type:this.selectPaymentLabel,...this.searchData,duration:(new Date).getTime()-t}})),this.$track.emit({act:"load",mId:"",params:{load_status:"success",erro_code:"",...this.searchData,duration:(new Date).getTime()-t}}),this.mark=(new Date).getTime(),[!1,{list:l||[],total:o}]}catch(o){const{code:e,msg:s}=o?.response?.data||{};return this.total=0,this.showRecList=!1,this.$track.emit({act:"load",mId:"",params:{load_status:"fail",load_error_code:e||o?.code,load_error_msg:s||JSON.stringify(o),erro_code:o,duration:(new Date).getTime()-t}}),[{msg:"加载错误"},{list:[]}]}},hideRecPage(){this.showRecList=!1},async getDiagramCount(){let e="3";try{e=await c.A.getDiagramCount()}catch(t){}return"1"!==e&&"2"!==e||(e="1,2"),1*e>=6&&(e="6,7,8,9,10,11,12"),e},async getSearchFilterData(){try{const e=await this.fetchSearchFilterData();if(e?.data?.filters&&Array.isArray(e?.data?.filters)){const t=e.data.filters.map(e=>g.formatFilters(e.config,e.mark))||[];this.selectStyle=t.filter(e=>"style"===e.mark)[0]?.list?.[0]?.name||"[]",this.selectSize=t.filter(e=>"size"===e.mark)[0]?.list?.[0]?.name||"[]",this.setDialogSnowBallData({type:"search",filters:t})}}catch(e){this.isCateError=!0,this.keyword&&this.reload()}},fetchSearchFilterData(){return p.A.get("docer-api").userConfig({data:{offset:0,limit:9,position:r.nL.SEARCH}})},fetchSearchRecData(e){return p.A.get("docer-api").rec({data:{...e}})},checkFilterCount(e,t){if(!t.length)return;const s=t.filter(t=>t.name===e)[0];return!!s},onRefresh(){this.getCnt.length&&this.getMbType.length?this.$refs?.listRef?.refresh():this.getSearchFilterData()},handleTrack({mId:e="",act:t="",sourceAct:s="",...a}){this.$track.emit({mId:e,act:t,params:{act:s,...this.mtData,...a}})},emitDisplay(){this.handleTrack({act:"display",first_cat_name:"smartart_searchresult"})}},mounted(){},deactivated(){this.showCatePanel=!1,this.showColorPanel=!1,this.getSizeList.length&&(this.selectSize=this.getSizeList[0].name),this.getStyleList.length&&(this.selectStyle=this.getStyleList[0].name)},async activated(){this.emitDisplay(),this.showCatePanel=!1,this.showColorPanel=!1,this.currentPayType={name:0,label:"全部资源"};const e={"":"全部","1,2":"1-2项",3:"3项",4:"4项",5:"5项","6,7,8,9,10,11,12":"6项及以上"},t={0:"全部",1:"免费",3:"付费"},s=`${e[this.selectCount]}/${t[this.currentPayType.name]}`,a=s?.replaceAll("/全部","");this.setSearchGatherText("全部"===a?"筛选":a)}},S=C,_=s(343),k=(0,_.A)(S,a,i,!1,null,"34c9e950",null),P=k.exports}}]); |
|