找回密码
 立即注册
搜索
热搜: 丝袜 魅魔 黑丝
查看: 24|回复: 0

27852103_父虏(六)

[复制链接]

13万

主题

343

回帖

22万

积分

管理员

站长

UID
1
积分
224394
余额
13 R
Moe币
84875
在线时间
279 小时
注册时间
2025-12-28
最后登录
2026-11-3
发表于 2026-9-3 23:00:59 | 显示全部楼层 |阅读模式
taticClass:"sf-bottom-ul"},t._l(t.sort,function(e,a){return i("li",{key:a,staticClass:"sf-bottom-li",class:{"sort-active":t.sortActive.val==e.val},on:{click:function(e){return t.sortChange(a)}}},[t._v(" "+t._s(e.name)+" ")])}),0):t._e(),t._l(t.switchList,function(e,a){return i("SfSwitch",{key:a,class:{"split-lint":0==a},attrs:{title:e.title,filterKey:e.key,isOpen:t.switchOpenList.includes(e.key)||!1},on:{change:t.switchChange}})})],2),t.isFilter?i("div",{staticClass:"sf-bottom__reset",on:{click:t.resetAll}},[i("SvgIcon",{attrs:{svgName:"trash-can"}}),t._v(" 清除 ")],1):t._e()])]],2)},$=[],L=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.list.length&&t.filterKey?i("div",{staticClass:"cate"},[i("div",{staticClass:"cate__content"},[i("ul",{ref:"fiBox-"+t.filterKey,staticClass:"cate-ul",class:{"height-auto":t.expand}},[i("li",{staticClass:"cate-li",class:{"is-active":!t.activeId},on:{click:function(e){return t.handleClick("")}}},[t._v("全部")]),t._l(t.list,function(e,a){return i("li",{key:e.id||e,ref:"fiItem",refInFor:!0,staticClass:"cate-li",class:{"is-active":t.activeId==(e.id||e)},attrs:{title:e.name||e},on:{click:function(i){return t.handleClick(e)}}},[i("span",[t._v(t._s(e.name||e))]),a==t.list.length-1?t._t("default"):t._e()],2)})],2),t.sliceIndex-1<t.list.length?i("div",{staticClass:"cate__more",on:{click:t.expandChange}},[t._v(" "+t._s(t.expand?"收起":"更多")+" "),i("SvgIcon",{class:{"transform-180":t.expand},attrs:{svgName:"arrow-bottom-16"}})],1):t._e()])]):t._e()},D=[];const E={__componentId:"__cid_087fcfc7",name:"CategoryTree",props:{title:{type:String,required:!0},list:{type:Array,default:()=>[]},filterKey:{type:[String,Number],default:""},elementType:{type:[String,Number],default:""},activeId:{type:[String,Number],default:""},index:{type:Number,default:0}},data(){return{expand:!1,sliceIndex:0,calculating:!1,debounce:v["default"].debounce(200)}},mounted(){T["default"].$on(g.eventName.resizeWindow,this.ajustTplLayout),this.countSliceIndex(),this.list.forEach(t=>{this.handleDisplay(t)})},beforeDestroy(){T["default"].$off(g.eventName.resizeWindow,this.ajustTplLayout)},methods:{ajustTplLayout(){this.debounce(()=>{this.countSliceIndex()})},handleClick(t){this.activeId!=(t.id||t)&&this.$emit("change",{key:this.filterKey,val:t.id||t||"",name:t.name||t||"",index:this.index})},handleDisplay(t){this.$emit("collect",{element_name:this.elementType,...this.elementType.includes("_cat")?{[`${this.elementType}_name`]:t.name,[`${this.elementType}_id`]:t.id}:{tag_text:t.name||t}})},expandChange(){this.expand=!this.expand,this.$emit("collect",{event:"click",element_name:"more",type:this.expand?"more":"retract",content_type:this.elementType})},countSliceIndex(){try{const t=this.$refs&&this.$refs[`fiBox-${this.filterKey}`]||{},e=t&&t.getBoundingClientRect&&t.getBoundingClientRect();if(!t.children||!t.children.length)return void(this.sliceIndex=this.list.length);let i=0,a=0;for(const s of t.children){if(!s||!s.getBoundingClientRect||!e)continue;const t=s.getBoundingClientRect();if(i+=t.width?t.width+8:0,i>e.width)break;a++}this.sliceIndex=a>0?a:this.list.length}catch(e){this.sliceIndex=this.list.length}if(!this.activeId||this.sliceIndex>=this.list.length||this.expand)return;const t=this.list.findIndex(t=>t.id==this.activeId);this.expand=t+1>=this.sliceIndex}},watch:{list:{handler(t,e){this.$nextTick(()=>{JSON.stringify(t)!=JSON.stringify(e)&&this.countSliceIndex()})},immediate:!1}}},M=E;var x=(0,u.A)(M,L,D,!1,null,"56cb54d3",null);const O=x.exports;var F=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.colorList.length?i("div",{staticClass:"cf"},[t.sliceNum>0?[i("ul",{staticClass:"cf-ul"},[i("li",{staticClass:"cf-tag-all",class:{"is-active":!t.activeId},attrs:{title:"全部"},on:{click:function(e){return t.change("")}}},[t._v("全部")]),t._l(t.colorList.slice(0,t.sliceNum),function(e){return i("li",{key:e,staticClass:"cf-li sf-tag-li",class:{"is-active":t.activeId==e},style:{background:t.colorMap[e]||""},attrs:{title:e},on:{click:function(i){return t.change(e)}}},[i("div",{staticClass:"cf-li-boder",class:{"cf-special-back":"白色"==e}})])})],2),t.colorList.length>t.sliceNum?i("Dropdown",{attrs:{list:t.colorList.slice(t.sliceNum),nomalTitle:"",activeId:t.activeId,isSlot:""},on:{change:t.change}},[i("div",{attrs:{slot:"dw-title"},slot:"dw-title"},[t.activeId&&t.colorList.slice(t.sliceNum).includes(t.activeId)?i("li",{staticClass:"cf-li sf-tag-li cf-more-title is-active",style:{background:t.colorMap[t.activeId]||""},attrs:{title:t.activeId||"全部"}},[i("div",{staticClass:"cf-li-boder",class:{"cf-special-back":"白色"==t.activeId}})]):i("span",[t._v("更多")])]),i("ul",{staticClass:"cf-dw",attrs:{slot:"dw-content"},slot:"dw-content"},t._l(t.colorList.slice(t.sliceNum),function(e){return i("li",{key:e,staticClass:"cf-li",class:{"is-active":t.activeId==e},style:{background:t.colorMap[e]||""},attrs:{title:e},on:{click:function(i){return t.change(e)}}},[i("div",{staticClass:"cf-li-boder",class:{"cf-special-back":"白色"==e}})])}),0)]):t._e()]:i("div",{staticClass:"min-screen"},[t.colorList.length?i("Dropdown",{attrs:{nomalTitle:"",list:t.colorList,activeId:t.activeId,isSlot:""},on:{change:t.change}},[i("ul",{attrs:{slot:"dw-title"},slot:"dw-title"},[i("li",{staticClass:"cf-li cf-more-title",class:{"cf-all":!t.activeId},style:{background:t.colorMap[t.activeId]||""},attrs:{title:t.activeId||"全部"}})]),i("div",{attrs:{slot:"dw-title"},slot:"dw-title"}),i("ul",{staticClass:"cf-dw",attrs:{slot:"dw-content"},slot:"dw-content"},[i("li",{staticClass:"cf-li cf-all sf-tag-li",class:{"is-active":!t.activeId},attrs:{title:"全部"},on:{click:function(e){return t.change("")}}},[i("div",{staticClass:"cf-li-boder"})]),t._l(t.colorList,function(e){return i("li",{key:e,staticClass:"cf-li",class:{"is-active":t.activeId==e},style:{background:t.colorMap[e]||""},attrs:{title:e},on:{click:function(i){return t.change(e)}}},[i("div",{staticClass:"cf-li-boder",class:{"cf-special-back":"白色"==e}})])})],2)]):t._e()],1)],2):t._e()},K=[],B=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"dw"},[i("div",{staticClass:"dw-btn",class:{"dw-is-active":t.list.includes(t.activeId)&&!t.nomalTitle},on:{mouseenter:t.mouseenter,mouseleave:t.mouseleave,click:t.toggleDropdown}},[t._t("dw-title",function(){return[t.moreTip?i("span",[t._v(t._s(t.moreTip.length>6?t.moreTip.slice(0,6)+"...":t.moreTip))]):t._e()]}),i("SvgIcon",{staticClass:"item-svg",attrs:{svgName:"arrow-bottom-18"}}),t.isShow?i("div",{staticClass:"dw-body",class:{"absolute-right":t.bodyRight}},[i("div",{staticClass:"dw-body-back"},[t._t("dw-content",function(){return[i("ul",{staticClass:"dw-body-ul"},t._l(t.list,function(e,a){return i("li",{key:e+a,staticClass:"dw-body-li",class:{"is-active":t.activeId==e||t.includeAll&&!t.activeId&&"全部"==e},attrs:{title:e},on:{click:function(i){return t.change(e)}}},[i("span",[t._v(t._s(e))])])}),0)]})],2)]):t._e()],2)])},W=[];const j={__componentId:"__cid_cf65130f",name:"Dropdown",props:{title:{type:String,default:""},list:{type:Array,default:()=>[]},isSlot:{type:Boolean,default:!1},activeId:{type:String,default:""},bodyRight:{type:Boolean,default:!1},includeAll:{type:Boolean,default:!1},nomalTitle:{type:Boolean,default:!1}},data(){return{isShow:!1,timeout:null}},mounted(){this.list.forEach(t=>{this.handleDisplay(t)})},methods:{change(t){this.$emit("change",this.includeAll&&"全部"==t?"":t)},handleDisplay(t){this.$emit("collect",t)},mouseenter(){this.timeout=setTimeout(()=>{this.isShow=!0},200)},mouseleave(){clearTimeout(this.timeout),this.timeout=null,this.isShow=!1},toggleDropdown(){this.isShow=!this.isShow}},computed:{moreTip(){return!this.title&&this.list.length&&this.activeId?this.list.includes(this.activeId)?this.activeId:"更多":this.title||"更多"}}},q=j;var G=(0,u.A)(q,B,W,!1,null,"644b6ad4",null);const H=G.exports,J={__componentId:"__cid_9d240157",name:"ColorFilter",props:{val:{type:Object,required:!0},activeId:{type:String,default:""},firstStyle:{type:Boolean,default:!1},sliceNum:{type:Number,default:2}},components:{Dropdown:H},mounted(){this.sliceNum>0?(this.colorList.slice(0,this.sliceNum).forEach(t=>{this.handleDisplay(t)}),this.colorList.length>this.sliceNum&&this.colorList.slice(this.sliceNum).forEach(t=>{this.handleDisplay(t)})):this.colorList.forEach(t=>{this.handleDisplay(t)})},data(){return{colorMap:{黑色:"#000000",灰色:"#D8D8D8",棕色:"#683B3B",粉色:"#FF2E78",紫色:"#8979F0",黄色:"#FFC500",绿色:"#1FBB7D",红色:"#F14441",蓝色:"#4991F2",橙色:"#F46D43",白色:"#ffffff"},colorList:[]}},methods:{change(t){this.$emit("change",{key:this.val.type,val:t})},handleDisplay(t){this.$emit("collect",{element_name:"color",tag_text:t})}},watch:{val:{handler(t){if(t.list&&t.list.length){const e=Object.keys(this.colorMap);this.colorList=t.list.filter(t=>e.includes(t))||[]}},immediate:!0,deep:!0}}},z=J;var U=(0,u.A)(z,F,K,!1,null,"4d3e603c",null);const Y=U.exports;var V=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.val.list.length?i("div",{staticClass:"sf-tag"},[t.sliceNum>0?[i("ul",{staticClass:"sf-tag-ul"},[i("li",{staticClass:"sf-tag-li",class:{"is-active":!t.activeId},on:{click:function(e){return t.change("")}}},[t._v("全部")]),t._l(t.val.list.slice(0,t.sliceNum),function(e,a){return i("li",{key:e,staticClass:"sf-tag-li",class:{"is-active":t.activeId==e},attrs:{title:a==t.sliceNum-1&&e.tip?"":e},on:{click:function(i){return t.change(e)}}},[i("span",[t._v(t._s(e.slice(0,6)+(e.length>6?"...":"")))]),a==t.sliceNum-1?t._t("default"):t._e()],2)}),t.val.list.length>t.sliceNum?i("Dropdown",{attrs:{list:t.val.list.slice(t.sliceNum),activeId:t.activeId},on:{collect:t.dropDownReport,change:t.change}}):t._e()],2)]:i("Dropdown",{staticClass:"margin-right-12",attrs:{nomalTitle:"",includeAll:"",list:t.includeAllList,title:t.activeId||t.val.title,activeId:t.activeId},on:{collect:t.dropDownReport,change:t.change}})],2):t._e()},Q=[];const X={__componentId:"__cid_1d8ba4cb",name:"SfTag",props:{val:{type:Object,required:!0},activeId:{type:String,default:""},index:{type:Number,default:0},firstStyle:{type:Boolean,default:!1},sliceNum:{type:Number,default:2}},components:{Dropdown:H},mounted(){this.sliceNum>0&&this.val.list.length&&this.val.list.slice(0,this.sliceNum).forEach(t=>{this.handleDisplay(t)})},methods:{change(t){this.$emit("change",{key:this.val.type,val:t})},handleDisplay(t){this.$emit("collect",{element_name:this.val.type,tag_text:t})},dropDownReport(t){this.$emit("collect",{element_name:this.val.type,tag_text:t})}},computed:{includeAllList(){return["全部",...this.val.list]}}},Z=X;var tt=(0,u.A)(Z,V,Q,!1,null,"fbedb8d2",null);const et=tt.exports;var it=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",[i("div",{staticClass:"switch",on:{click:t.handleClick}},[i("div",{staticClass:"switch-box"},[t.isOpen?i("SvgIcon",{staticClass:"switch-all",attrs:{svgName:"rec-switch-all"}}):i("SvgIcon",{staticClass:"switch-unselect",attrs:{svgName:"rec-switch-unselect"}})],1),t._v(" "+t._s(t.title)+" ")])])},at=[];const st={__componentId:"__cid_9abaa927",name:"SfSwitch",props:{title:{type:String,required:!0},filterKey:{type:String,required:!0},isOpen:{type:Boolean,default:!1}},methods:{handleClick(){this.$emit("change",this.filterKey)}}},lt=st;var ot=(0,u.A)(lt,it,at,!1,null,"6695a33a",null);const rt=ot.exports;var nt=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"msg"},[i("SvgIcon",{attrs:{svgName:"preview-info-16"}}),i("div",{staticClass:"msg__tip"},[i("div",{staticClass:"msg__tip__icon"}),i("div",[t._v(t._s(t.tips))])])],1)},ct=[];const dt={__componentId:"__cid_820a0a5d",name:"IconTip",props:{tips:{type:String,default:""}}},ht=dt;var mt=(0,u.A)(ht,nt,ct,!1,null,"2c09c4b9",null);const pt=mt.exports,ut=v["default"].debounce(200),_t={__componentId:"__cid_ac5e8400",name:"SearchFilter",components:{CateTree:O,ColorFilte:Y,TagFilter:et,SfSwitch:rt,IconTips:pt},props:{sortFilterKey:{type:String,default:"order_by"},tagFilterKey:{type:String,default:"tags"},sort:{type:Array,default:()=>[]},cateList:{type:Array,default:()=>[]},tagTreeList:{type:Array,default:()=>[]},tagList:{type:Array,default:()=>[]},switchList:{type:Array,default:()=>[]},appName:{type:String,default:"wps"},isFilter:{type:Boolean,default:!1},isSkeleton:{type:Boolean,default:!1}},data(){return{catParams:{},tagActiveMap:{},sortSelectIndex:0,switchOpenList:[],sliceNum:2,tagGroupMaxWidth:0}},mounted(){T["default"].$on(g.eventName.resizeWindow,this.ajustTplLayout)},beforeDestroy(){T["default"].$off(g.eventName.resizeWindow,this.ajustTplLayout)},methods:{reset(t=!1){t&&(this.catParams={}),this.tagActiveMap={},this.sortSelectIndex=0,this.switchOpenList=[]},resetAll(){this.$emit("reset"),this.report({event:"click",element_name:"delete"})},initData(t={}){t.cat&&(this.catParams=t.cat),t.tag&&(this.tagActiveMap=t.tag)},cateTreeChange(t={}){if(t.key){if(t.val?this.$set(this.catParams,t.key,t.val):this.$delete(this.catParams,t.key),this.tagActiveMap={},t.index<this.cateList.length-1){const e=this.cateList[t.index+1]&&this.cateList[t.index+1].filterKey;this.catParams[e]=""}this.$emit("catChange",{name:t.name||"",key:t.key,index:t.index}),this.normalizeAndEmit(),this.report({event:"click",element_name:t.index?"second_cat":"first_cat",[(t.index?"second":"first")+"_cat_name"]:t.name,[(t.index?"second":"first")+"_cat_id"]:t.val})}},tagChange(t={}){const{key:e,val:i}=t;e&&this.$set(this.tagActiveMap,e,i||""),this.normalizeAndEmit(),this.report({event:"click",element_name:e,tag_text:i||""})},sortChange(t){this.sortSelectIndex=t,this.normalizeAndEmit(),this.report({event:"click",element_name:"sort",sort_name:this.sortActive.val||"cool"})},switchChange(t){const e=this.switchOpenList.indexOf(t);e>-1?this.switchOpenList.splice(e,1):this.switchOpenList.push(t),this.normalizeAndEmit(),this.report({event:"click",element_name:"quality"!=t?"mb_type"==t?"is_free":t:"is_quality"})},normalizeAndEmit(){const t={};this.sortActive&&this.sortActive.val&&(t[this.sortFilterKey]=this.sortActive.val);const e=Object.values(this.tagActiveMap).filter(t=>t).join("@");e&&(t[this.tagFilterKey]=e),Object.assign(t,this.catParams),this.switchOpenList.map(e=>(t[e]=1,e)),this.$emit("change",t,this.tagActiveMap)},report(t){const e=t.event||"display";delete t.event,this.$emit("report",{event:e,params:t})},ajustTplLayout(){ut(()=>{this.countTagSliceIndex()})},countTagSliceIndex(){try{this.$nextTick(()=>{const t=this.$refs&&this.$refs.tagGroup;if(!t||!t.children||!t.children.length)return;const e=t&&t.getBoundingClientRect&&t.getBoundingClientRect(),i=e.width;if(1==this.tagList.length)this.tagList[0]&&"color"==this.tagList[0].type&&(this.sliceNum=this.tagList[0].list.length);else{let a=0;for(const i of t.children){if(!i||!i.getBoundingClientRect||!e)continue;const t=i.getBoundingClientRect();a+=t.width?t.width+8:0}a>this.tagGroupMaxWidth&&(this.tagGroupMaxWidth=a),this.sliceNum=this.tagGroupMaxWidth>=i?0:2}})}catch(t){this.sliceNum=2}}},computed:{...(0,h.mapState)("common",["isDarkSkin"]),sortActive(){return this.sort[this.sortSelectIndex]||{}},firstTagGroup(){return this.tagList[0]||{}}},watch:{tagList:{handler(t,e){t.length&&JSON.stringify(t)!=JSON.stringify(e)&&(this.tagGroupMaxWidth=0,this.sliceNum=2,this.countTagSliceIndex())},immediate:!0}}},ft=_t;var gt=(0,u.A)(ft,R,$,!1,null,"14f6afa2",null);const yt=gt.exports;var vt=i(49147),Ct=i(16788);const kt={methods:{$_search_collect_initPageDisplay(){var t;null===(t=Ct["default"].get())||void 0===t||t.send("display",{page_name:"search_page",$e_t:"page",search_type:this.reportSearchType,$track:""})},$_search_collect_initPageLeave(){var t,e;null===(t=Ct["default"].get())||void 0===t||t.setCollectInfo("searchId"),null===(e=Ct["default"].get())||void 0===e||e.setCollectInfo("subSearchId")},$_search_collect_renderSearch(){var t;null===(t=Ct["default"].get())||void 0===t||t.send("display",{page_name:"search_page",$m_n:"template_list",$e_t:"module",mk_key:this.mk_key,search_type:this.reportSearchType,keyword:this.word,policy:this.policy,resource_count:this.totalNum,page_num:this.page,sort_name:this.filterParams[this.orderbyKey]||"cool",...this.$_search_collect_ftCommonReport()})},$_search_collect_filterChange(){var t;null===(t=Ct["default"].get())||void 0===t||t.setCollectInfo("subSearchId",v["default"].getRandomKey())},$_search_collect_homeClick(){var t;null===(t=Ct["default"].get())||void 0===t||t.send("click",{page_name:"search_page",$m_n:"nav_bar",$e_n:"back",$e_t:"botton",policy:this.policy,...this.$_search_collect_ftCommonReport()})},$_search_collect_ftCommonReport(){return{sort_name:this.filterParams[this.orderbyKey]||"cool",first_cat_id:this.filterParams.category_id,first_cat_name:this.filterCategoryName,is_quality:!!this.filterParams.is_quality,...this.reportTagMap}},$_search_collect_ftReport({event:t,params:e}){var i;null===(i=Ct["default"].get())||void 0===i||i.send(t,{page_name:"search_page",$m_n:"screen_classify",$e_t:"button",policy:this.policy,keyword:this.word,search_type:this.reportSearchType,$track:"",...this.$_search_collect_ftCommonReport(),...e})}},computed:{$_search_commonCollectParams(){var t,e,i,a;return"SEARTCH_EMPTY"===this.statusCode?{$m_n:"null_recommend",keyword:this.word,inputword:this.word,search_type:this.reportSearchType,policy:this.noSearchPolicy,resource_count:30,$track:"",search_id:null===(t=Ct["default"].get())||void 0===t?void 0:t.getCollectInfo("searchId"),sub_search_id:null===(e=Ct["default"].get())||void 0===e?void 0:e.getCollectInfo("subSearchId"),component:y.appInfo.name,search_workboard:y.appInfo.name,category_name:"热门推荐"}:{$m_n:"template_list",$e_i:{display:363,click:362},resource_count:this.maxCount,first_cat_name:this.filterCategoryName,sort_name:"",$track:"",policy:this.policy,keyword:this.word,search_type:this.reportSearchType,mk_key:this.mk_key,word_policy:this.reportWordPolicy,recommend_id:this.reportRecommendId,search_id:null===(i=Ct["default"].get())||void 0===i?void 0:i.getCollectInfo("searchId"),sub_search_id:null===(a=Ct["default"].get())||void 0===a?void 0:a.getCollectInfo("subSearchId"),component:y.appInfo.name,search_workboard:y.appInfo.name,predict:this.searchPredict,...this.$_search_collect_ftCommonReport()}}}};var Tt=i(19371),It=i(23604),wt=i(3048),St=function(){var t=this,e=t.$createElement,i=t._self._c||e;return t.showModule?i("div",{staticClass:"ai-template-recommend"},[t.floorConfig.title||t.floorIcon?i("div",{staticClass:"ai-template-recommend__header"},[i("div",{staticClass:"ai-template-recommend__title"},[t.floorIcon?i("img",{staticClass:"title-icon",attrs:{src:t.floorIcon,alt:"icon"}}):t._e(),t.floorIcon?t._e():i("span",{staticClass:"title-text"},[t._v(t._s(t.floorConfig.title))]),t.floorConfig.subTitle?i("div",{staticClass:"title-divider"}):t._e(),t.floorConfig.subTitle?i("span",{staticClass:"title-desc"},[t._v(t._s(t.floorConfig.subTitle))]):t._e(),t.floorVipIcon?i("img",{staticClass:"title-vip-tag",attrs:{src:t.floorVipIcon,alt:"vip_icon"}}):t._e()]),t.shouldShowMoreBtn?i("div",{staticClass:"ai-template-recommend__more",on:{click:t.handleMoreClick}},[t._v(" "+t._s(t.floorConfig.moreBtnText)+" "),i("SvgIcon",{staticClass:"more-icon",attrs:{svgName:"arrow-right-15"}})],1):t._e()]):t._e(),i("div",{staticClass:"ai-template-recommend__content",style:t.contentStyle},t._l(t.displayedList,function(e,a){return i("div",{key:e.id||a,staticClass:"ai-tpl-card-wrap",style:t.cardStyle},[i("AiTemplateCard",{attrs:{templateData:e,commonCollectParams:Object.assign({},{element_position:a+1},t.cardCollectParams),isAiRecommendEnabled:!0,keyword:t.keyword}})],1)}),0)]):t._e()},bt=[],At=i(73181),Nt=i(46345);const Pt={__componentId:"__cid_aa216be9",name:"AiTemplateRecommend",components:{AiTemplateCard:Nt.A},watch:{requestTrigger:{handler(){this.initData()},immediate:!0}},data(){return{aiTemplateRecommendList:[],loading:!1,mkKey:"",policy:"",floorData:{contentPackageId:0,nodeCfgId:0},floorConfig:{title:"",subTitle:"",icon:"",moreBtnText:"",showMoreBtn:!1,redirect:null,collectId:"",blackIcon:"",moduleName:"ai_template_recommend",mark:"",dark_mark:""}}},props:{columns:{type:Number,default:7},rowWidth:{type:[Number,String],default:0},columnGap:{type:[Number,String],default:0},requestTrigger:{type:[String,Number],default:""},currentTab:{type:String,default:"wpp"},position:{type:String,default:"NRSYYMLCXJSCSSJGYJLZSMKLC"},scene:{type:String,default:"search"},keyword:{type:String,default:""},commonCollectParams:{type:Object,default:()=>({})}},methods:{async initData(){if(this.loading)return;this.loading=!0;let t=!1;try{const r=await this.fetchFloorConfig();var e,i,a,s;if(this.checkDataIsValid(r))this.parseFloorConfig((null===(e=r.data)||void 0===e||null===(i=e.children)||void 0===i||null===(a=i[0])||void 0===a?void 0:a.children)||[]),this.mkKey=(null===(s=r.data)||void 0===s?void 0:s.mk_key)||"";if(this.floorData.contentPackageId){const e=await this.fetchAiTemplateRecommendData();var l,o;if(this.checkRecDataIsValid(e))this.policy=(null===(l=e.data)||void 0===l?void 0:l.alg)||"",this.aiTemplateRecommendList=this.formatRecData((null===(o=e.data)||void 0===o?void 0:o.items)||[]),t=!0}}catch(r){t=!1}finally{this.loading=!1;const e=t&&this.showModule;this.$emit("loaded",e,this.requestTrigger)}},parseFloorConfig(t){t&&Array.isArray(t)&&t.forEach(t=>{if(t.props&&"string"===typeof t.props)try{const e=JSON.parse(t.props);this.updateFloorConfig(e)}catch(e){}if(t.children&&t.children.length>0){const e=t.children[0];if(e.content_package_id){this.floorData.contentPackageId=e.content_package_id,this.floorData.nodeCfgId=e.nodeCfgId||0;try{const t=JSON.parse(e.props);this.floorData.position=t.position||""}catch(i){}}}})},async fetchAiTemplateRecommendData(){var t;const e=await(null===(t=k().get())||void 0===t?void 0:t.get("docerApi").pageListV2({data:{hdid:g.appInfo.hdid,content_package_id:this.floorData.contentPackageId,node_cfg_id:this.floorData.nodeCfgId,limit:20,offset:0,with_total:"true",mk_key:this.mkKey,recommend_id:this.recommendId,keyword:this.keyword||""}}));return e},async fetchFloorConfig(){const t={platform:g.appInfo.isMac?g.tiancePlatformMap.MAC:g.tiancePlatformMap.PC,position:this.position,hdid:g.appInfo.hdid,recommend_id:v["default"].getRandomKey(),version:g.appInfo.version,filter_info:{comp:g.COMPONENT_NAME_MAP[g.appInfo.name],resource_key:"0",is_pad:"pad"===g.appInfo.deviceType?"1":"0",platform:g.tiancePlatformMap[g.appInfo.platform.toLocaleUpperCase()]||g.tiancePlatformMap.PC,word:this.keyword||""}};try{var e;const i=await(null===(e=k().get())||void 0===e?void 0:e.get("docerApi").getCategoryConfigTree({data:t}));return i}catch(i){return null}},checkDataIsValid(t){return t&&"ok"===t.result&&t.data},checkRecDataIsValid(t){return t&&"ok"===t.result&&t.data&&t.data.items},formatRecData(t){return t&&Array.isArray(t)?t.map(t=>({id:t.id,name:t.title||t.name,thumb_img:t.thumb_medium_url||t.thumb_big_url||t.thumb_small_url||"",thumb_big_url:t.thumb_big_url||t.thumb_medium_url||t.thumb_small_url||"",tag:"ai演示模板",moban_app:t.moban_app,file_type:t.file_type,rectScale:142,...t})):[]},updateFloorConfig(t){this.floorConfig={title:t.title||this.floorConfig.title,subTitle:t.sub_title||this.floorConfig.subTitle,icon:t.icon||this.floorConfig.icon,moreBtnText:t.more_btn_text,showMoreBtn:void 0!==t.show_more_btn?t.show_more_btn:this.floorConfig.showMoreBtn,redirect:t.redirect||this.floorConfig.redirect,collectId:t.collect_id||this.floorConfig.collectId,moduleName:t.module_name||this.floorConfig.moduleName,blackIcon:t.black_icon||this.floorConfig.blackIcon,mark:t.mark||this.floorConfig.mark,dark_mark:t.dark_mark||this.floorConfig.dark_mark}},handleMoreClick(){try{var t;if(!this.floorConfig.redirect)return;const e=this.floorConfig.redirect;null===(t=this.$_get_collect())||void 0===t||t.send("click",{$m_n:"assistant_floor",keyword:this.keyword,search_type:this.commonCollectParams.search_type,element_name:"more",element_type:"button"}),At.A.gotoTag({type:"link",content:e.content.url,promebrowser:e.content.promebrowser})}catch(e){}}},computed:{cardCollectParams(){return{policy:this.policy,mk_key:this.mkKey,keyword:this.keyword,search_type:this.commonCollectParams.search_type,module_name:"assistant_floor"}},showModule(){return this.aiTemplateRecommendList.length>=3},displayedList(){return this.aiTemplateRecommendList.slice(0,this.columns)},shouldShowMoreBtn(){return this.floorConfig.showMoreBtn&&this.floorConfig.moreBtnText&&this.floorConfig.redirect},floorIcon(){const t=this.$store.state.common.isDarkSkin;return t&&this.floorConfig.blackIcon?this.floorConfig.blackIcon:this.floorConfig.icon},floorVipIcon(){const t=this.$store.state.common.isDarkSkin;return t&&this.floorConfig.dark_mark?this.floorConfig.dark_mark:this.floorConfig.mark},contentStyle(){return this.columnGap?{gap:`${this.columnGap}px`}:{}},cardStyle(){return this.rowWidth?{width:`${this.rowWidth}px`}:{}}}},Rt=Pt;var $t=(0,u.A)(Rt,St,bt,!1,null,"0205baa5",null);const Lt=$t.exports,Dt={__componentId:"__cid_c3ada91f",mixins:[vt.A,kt,d.A,wt.A],data(){return{word:"",totalPage:0,totalNum:0,page:1,statusCode:"",query:{},data:[],policy:"",topMbId:"",eventTime:"",requestId:"",homeRouter:"/screen",isFromAiScreen:"win"===y.appInfo.platform&&"pdf"!==y.appInfo.name&&window.__AI_SWITCH_ENABLED__,mk_key:"",reportSearchType:"",searchMarkType:{1:131073,2:131074,3:131075},filterParams:{},orderbyKey:"order_by",filterSortList:[{name:"综合",val:""},{name:"最新",val:"publish_time"},{name:"最热",val:"down_value"}],filterSwitchList:[],filterTagList:[],filterTagTreeList:[],filterCateList:[],sessionId:"",filterCategoryName:"",reportTagMap:{},netStatus:g.netStatus,limit:0,bodyStyle:{},isInterfaceLoading:!1,reportWordPolicy:"",reportRecommendId:"",noSearchPolicy:"",resumeData:[],searchResultAD:[],resumeRecommendEnabled:!1,resumeModuleDisplayed:!1,resumeRequestTrigger:"",resumePromiseResolve:null,aiTemplateRecommendEnabled:!1,aiTemplateModuleDisplayed:!1,aiTemplateRecommendTrigger:"",aiTemplatePromiseResolve:null,aiTools:{},searchPredict:"",noResultAiTools:[],showSkeleton:!1,listRowWidth:0,listColumnGap:0}},beforeRouteEnter(t,e,i){i(e=>{T["default"].$on(g.eventName.resizeWindow,e.ajustTplLayout),I.A.setOriginInfo({secondPage:"ssjgy",sort:"",policy:""}),e.init(t)})},beforeRouteUpdate(t,e,i){this.init(t),i()},beforeRouteLeave(t,e,i){this.data=[],this.resumeData=[],I.A.setOriginInfo({scenesEntrance:""}),T["default"].$emit(g.eventName.keywordChange,""),T["default"].$emit(g.eventName.scrollFixed,!1),T["default"].$off(g.eventName.resizeWindow,this.ajustTplLayout),this.$_search_collect_initPageLeave(),T["default"].$emit(g.eventName.aiSearchBarFlex,""),i()},mounted(){this.getFpcCombConfig()},methods:{handleScroll(){var t;const e=null===(t=this.$refs.nSearchList.$el)||void 0===t?void 0:t.scrollTop;e>50?T["default"].$emit(g.eventName.scrollFixed,!0):T["default"].$emit(g.eventName.scrollFixed,!1)},loadMore(){if(this.isInterfaceLoading)return;const t=this.page+1;t>0&&t<=this.totalPage&&(this.page!=t||1==t)&&(this.page=t,this.getData())},init(t){this.initQuery(t.query),T["default"].$emit(g.eventName.keywordChange,this.word||""),this.resetPageData(),this.ajustTplLayout(),this.$_search_collect_initPageDisplay(),this.showSkeleton=!0,this.$nextTick(()=>{this.getData()})},resetPageData(t=!0){this.filter={},this.eventTime="",this.policy="",this.requestId="",this.page=1,this.statusCode="",this.data=[],this.resumeData=[],this.filterCategoryName="",this.resumeRecommendEnabled=!1,this.resumeModuleDisplayed=!1,this.resumePromiseResolve&&(this.resumePromiseResolve(!1),this.resumePromiseResolve=null),this.aiTemplateRecommendEnabled=!1,this.aiTemplateModuleDisplayed=!1,this.aiTemplatePromiseResolve&&(this.aiTemplatePromiseResolve(!1),this.aiTemplatePromiseResolve=null),t&&(this.$refs&&this.$refs.sfComp&&this.$refs.sfComp.reset(!0),this.filterCateList=[],this.filterParams={},this.filterTagList=[],this.filterTagTreeList=[]),this.$refs.nSearchList&&(this.$refs.nSearchList.$el.scrollTop=0)},initQuery(t){var e,i;this.word=t.word||"",this.topMbId=t.topMbId||"",this.query=t;const a=t.from||"";if(["aiwpsscreen","aietscreen","aipptscreen"].includes(a))this.homeRouter=`/${a}`;else if("win"===y.appInfo.platform&&window.__AI_SWITCH_ENABLED__){const t={wps:"aiwpsscreen",et:"aietscreen",wpp:"aipptscreen"};this.homeRouter=`/${t[y.appInfo.name]||"screen"}`}try{t.collect=JSON.parse(t.collect)}catch(l){t.collect={}}this.reportSearchType=t.collect&&t.collect.reportSearchType,this.mk_key=null===t||void 0===t||null===(e=t.collect)||void 0===e?void 0:e.mk_key;const s=null===(i=t.collect)||void 0===i?void 0:i.scenesEntrance;s&&I.A.setOriginInfo({scenesEntrance:s}),this.reportWordPolicy=t.collect&&t.collect.word_policy,this.reportRecommendId=t.collect&&t.collect.recommend_id},async getData(){this.getClientEntryStatus.hideDockerEntry?this.getSearchData():this.isInterfaceLoading||(this.isInterfaceLoading=!0,1==this.page&&(this.data=Array(this.pageSize).fill({})),this.sessionId=v["default"].getRandomKey(),1===this.page&&await Promise.allSettled([this.fetchResumeData(),this.fetchSearchResultAD(),this.fetchResumeRecommend(),this.fetchAiTemplateRecommend(),this.fetchAiTools()]),await this.searchByDeliver(this.sessionId),this.showSkeleton=!1,this.isInterfaceLoading=!1)},getRecomList(){const t=v["default"].getRandomKey();k().get().get("deliver").getDeliverRec({data:{hdid:y.appInfo.hdid,position:g.adFlag.NO_SEARCH_RECO,mb_apps:[y.appInfo.mark],limit:30,offset:0,with_total:"true",recommend_id:t}}).then(e=>{if("ok"===e.result&&e.data&&e.data.items){this.noSearchPolicy=e.data.alg;const i=e.data.items.length-e.data.items.length%this.limit;this.data=e.data.items.slice(0,i).map(e=>(e.recommend_id=t,e))}}).catch(t=>{})},renderSearch(t,e){if(this.sessionId==e){if(this.policy=t.data&&t.data.policy||"",this.eventTime=t.data&&t.data.event_time||"",this.requestId=t["wps-docer-request-id"]||"","ok"==t.result){if(t.data&&(t.data.data||t.data.tmpls)){const e=t.data.data||t.data.tmpls||[];if(e.forEach(e=>{e.mk_key=t.data.mk_key}),1==this.page){var i;this.data=[],null!==(i=this.aiTools.list)&&void 0!==i&&i.length&&e.length&&!this.resumeModuleDisplayed&&!this.aiTemplateModuleDisplayed&&this.data.push(this.aiTools);const a=!this.resumeModuleDisplayed&&!this.aiTemplateModuleDisplayed&&this.resumeData.length>0;a&&this.data.push(...this.resumeData),this.data.push(...e),this.totalPage=Math.ceil((t.data.total_num||t.data.count||0)/this.pageSize);const s=t.data.total_num||t.data.count||0;this.totalNum=s>5e3?5e3:s,this.initFilterData(t.data||{})}else this.data=this.data.concat(e);this.searchResultAD.length&&this.searchResultAD.forEach((t,e)=>{var i;isNaN(t.insert_position)||1===t.insert_position&&null!==(i=this.data[0])&&void 0!==i&&i.isAiToolsCard||this.data.length>t.insert_position&&!t.load&&(t.jump_type==g.TIANCE_JUMP_TYPE_MAP.PAY_WINDOW&&(t.btnName=`adsrchbtn${e+1}`),t.load=!0,this.data.splice(t.insert_position-1,0,t))})}else this.totalPage=0,this.totalNum=0;this.statusCode=this.data.length?"":"SEARTCH_EMPTY"}else this.totalNum=0,this.totalPage=0,1===this.page&&(this.data=[],this.statusCode=g.netStatus.error);this.$_search_collect_renderSearch()}},initFilterData(t){if(this.filterCateList=[],t.categories&&t.categories.length&&this.filterCateList.push({title:"分类",list:t.categories,filterKey:"category_id",reportElementType:"first_cat"}),this.filterParams.tags)return;const e=[],i=[];t.tag_groups&&t.tag_groups.map(t=>{if(t&&t.mb_tag_group_type&&t.tags&&t.tags.length){let e=[];["type","content"].includes(t.mb_tag_group_type)?e=[...e,...t.tags||[]]:i.push({title:t.mb_tag_group_name,type:t.mb_tag_group_type,list:t.tags}),e.length&&i.push({title:"猜你想找",type:"guess",list:e})}return t}),this.filterTagTreeList=e||[];const a=i.findIndex(t=>"style"==t.type);this.filterTagList=-1!==a?i.splice(a,1).concat(i):i},filterCatChange(t={}){this.filterCategoryName=t.name},filterChange(t={},e={}){try{if(JSON.stringify(this.filterParams)==JSON.stringify(t))return;this.$_search_collect_filterChange(),this.reportTagMap=JSON.parse(JSON.stringify(e)),this.filterParams[this.orderbyKey]!=t[this.orderbyKey]&&I.A.setOriginInfo({sort:t[this.orderbyKey]}),I.A.setOriginInfo({secondPage:v["default"].isEmptyObject(t)?"ssjgy":"jgysx"}),this.filterParams=JSON.parse(JSON.stringify(t)),this.resetPageData(!1),this.getData()}catch(i){}},onRetry(){this.resetPageData(),this.getData()},ajustTplLayout(){this.$nextTick(()=>{if(this.isFromAiScreen){var t;const e=null===(t=this.$refs.nSearchList)||void 0===t?void 0:t.$el;if(!e)return;const i={wps:{cardWidth:200,gap:54},et:{cardWidth:273,gap:54},wpp:{cardWidth:298,gap:50}},a=i[y.appInfo.name];if(a){const t=e.offsetWidth-100;let i=Math.floor((t+a.gap)/(a.cardWidth+a.gap));i=Math.min(i,9),i=Math.max(i,2),this.limit!==i&&(this.limit=i),this.listRowWidth=a.cardWidth,this.listColumnGap=a.gap;const s=i*(a.cardWidth+a.gap)-a.gap;return this.bodyStyle={width:`${s}px`},void T["default"].$emit(g.eventName.aiSearchBarFlex,`0 0 ${s}px`)}}const[,e,i]=v["default"].getScreenDisplay(this.$refs.nSearchList.$el);this.limit!=e&&(this.limit=e),this.bodyStyle={width:`${i}px`}})},getFpcCombConfig(){var t;const e=y.appInfo.isMac?"51512":"44471";null===(t=Tt["default"].get())||void 0===t||t.getFpcCombConfig(e).then(t=>{const{showQualityFilter:e}=t||{};e&&this.filterSwitchList.push({title:"只看精品",key:"is_quality"})})},async fetchResumeData(){try{var t;if("wps"!==this.appName||0!==Object.keys(this.filterParams).length)return;let e={};e=await this.$_ad_getTiance({noCache:!0,params:{channel_code:g.adFlag.TIANCE_SEARCH_RESUME,filter_info:{keyword:this.word}},timeout:2e3}),e=this.$_tiance_handleAdRes(e);const i=(null===(t=e[g.adFlag.TIANCE_SEARCH_RESUME])||void 0===t?void 0:t.data)||{},{list:a=[],resource_key:s}=i;if(!a.length)return;const l=await k().get().get("deliver").getDeliverInfo({data:{position:"PC_NEW_RESUME_HELP_SEARCH",resource_key:s,ids:a.join(":")}});this.resumeData=((null===l||void 0===l?void 0:l.data)||[]).slice(0,this.limit)}catch(e){this.resumeData=[]}},searchByDeliver(t){const e=this.filterParams.category_id?[this.filterParams.category_id]:[],i={keyword:this.word,hdid:y.appInfo.hdid,limit:this.pageSize,with_total:"true",offset:(this.page-1)*this.pageSize,position:g.adFlag.PDF_SEARCH_POSITION,mb_apps:[v["default"].convertAppName(y.appInfo.name)],sortby:this.filterParams[this.orderbyKey]||"cool",is_new_22_category_aggs:1,is_quality:this.filterParams.is_quality||0,mix_22_category_ids:[e].filter(t=>t.length)};return this.isPdf||(delete i.mix_22_category_ids,delete i.is_new_22_category_aggs,Object.assign(i,{position:g.adFlag.COMMON_SEARCH_POSITION,is_category_aggs:1,is_tag_aggs:1,mb_filter_cat_id:this.filterParams.category_id,tags:this.filterParams.tags,cat_id:this.filterParams.category_id})),k().get().get("deliver").getDeliverRec({data:i}).then(e=>{var i,a,s,l,o,r,n,c,d,h;const m=t=>t&&Array.isArray(t)&&0!==t.length?t.map(t=>({id:t.cat_id,name:t.cat_name})):[],p=this.isPdf?null===(i=e.data)||void 0===i||null===(a=i.aggs)||void 0===a?void 0:a.agg_new_22_categorys:m(null===(s=e.data)||void 0===s||null===(l=s.aggs)||void 0===l||null===(o=l.agg_categorys[0])||void 0===o?void 0:o.thrid_categorys);Object.assign(e.data,{data:null===(r=e.data)||void 0===r?void 0:r.items,policy:null===(n=e.data)||void 0===n?void 0:n.alg,categories:p,tag_groups:(null===(c=e.data)||void 0===c||null===(d=c.filters)||void 0===d?void 0:d.mb_tag_group)||[],total_num:null===(h=e.data)||void 0===h?void 0:h.total}),this.renderSearch(e,t)}).catch(()=>{1===this.page&&(this.data=[],this.statusCode=g.netStatus.error),this.totalNum=0,this.totalPage=0,this.policy=""})},async fetchSearchResultAD(){if(0===Object.keys(this.filterParams).length)try{let t=await this.$_ad_getTiance({noCache:!0,params:{channel_code:[g.TIANCE_POSITION.TIANCE_SEARCH_LIST_AD_1,g.TIANCE_POSITION.TIANCE_SEARCH_LIST_AD_2].join(","),filter_info:{comp:g.COMPONENT_NAME_MAP[y.appInfo.name],word:this.word,platform:g.tiancePlatformMap[y.appInfo.platform.toLocaleUpperCase()]}}}),e=await this.$_tiance_handleAdResWithCheck(t);this.searchResultAD=Object.values(e).filter(t=>t.pic_url).map(t=>(t.isAd=!0,t))}catch(t){}else this.searchResultAD=[]},closeAd(t){const e=this.data.findIndex(e=>e.id===t.id&&e.isAd);this.data.splice(e,1)},fetchResumeRecommend(){return new Promise(t=>{if(this.resumePromiseResolve=t,1!==this.page)return this.resumeRecommendEnabled=!1,this.resumeModuleDisplayed=!1,void t(!1);const e="wps"===this.appName,i=this.filterParams[this.orderbyKey]||"",a=!i&&0===Object.keys(this.filterParams).length,s=e&&a;s?(this.resumeRecommendEnabled=!0,this.resumeRequestTrigger=`${Date.now()}_${Math.random()}`):(this.resumeRecommendEnabled=!1,this.resumeModuleDisplayed=!1,t(!1))})},handleResumeLoaded(t,e){e===this.resumeRequestTrigger&&(this.resumeModuleDisplayed=!!t,this.resumePromiseResolve&&(this.resumePromiseResolve(t),this.resumePromiseResolve=null))},fetchAiTemplateRecommend(){return new Promise(t=>{if(this.aiTemplatePromiseResolve=t,1!==this.page)return this.aiTemplateRecommendEnabled=!1,this.aiTemplateModuleDisplayed=!1,void t(!1);const e="wpp"===this.appName,i=this.filterParams[this.orderbyKey]||"",a=!i&&0===Object.keys(this.filterParams).length,s=e&&a;s?(this.aiTemplateRecommendEnabled=!0,this.aiTemplateRecommendTrigger=`${Date.now()}_${Math.random()}`):(this.aiTemplateRecommendEnabled=!1,th
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|M男之家

GMT+8, 2026-11-4 16:29 , Processed in 0.079409 second(s), 22 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表