webpackJsonp([29],{J8S4:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var s=i("p52L"),o=i("FevL"),a=i("AAHV");o.default.component(a.Button.name,a.Button);var n={data:()=>({title:"浏览历史",items:{},dateArray:[]}),created(){this.getList()},methods:{getList(){var t=localStorage.getItem("cim-info-history");if(t){t=JSON.parse(t),this.items=t;for(const e in t)t.hasOwnProperty(e)&&this.dateArray.unshift(e)}},removeHistoryAction(t,e){this.$dialog.confirm({title:"温馨提示",mes:"确定要删除此条记录吗?",opts:()=>{this.removeHistory(t,e)}})},removeHistory(t,e){var i=this.items[t];if(i.splice(e,1),0==i.length){delete this.items[t];this.dateArray.indexOf(t);this.dateArray.splice(t,1)}localStorage.setItem("cim-info-history",JSON.stringify(this.items))},removeAllAction(){this.$dialog.confirm({title:"温馨提示",mes:"确定要清空全部记录吗?",opts:()=>{this.removeAll()}})},removeAll(){localStorage.removeItem("cim-info-history"),this.items={},this.$dialog.toast({mes:"已清空"}),localStorage.setItem("cim-info-history",JSON.stringify(this.items))},goInfo(t,e){var i=this.items[t][e],s=i.cid,o=i.id,a=i.model;"info"==a?this.$router.push({name:"infoView",params:{cid:s,id:o}}):"news"==a&&this.$router.push({name:"newsView",params:{cid:s,id:o}})}},components:{Bottom:s.a}},r={render:function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("section",[i("v-title",{attrs:{title:t.title}}),t._v(" "),t.items?i("div",t._l(t.dateArray,function(e,s){return t.items[e].length>0?i("div",{key:s,staticClass:"panel"},[i("div",{staticClass:"panel-title mb-xs"},[t._v(t._s(e))]),t._v(" "),i("div",{staticClass:"panel-body"},t._l(t.items[e],function(s,o){return i("div",{key:o,staticClass:"flex"},[i("img",{directives:[{name:"lazy",rawName:"v-lazy",value:s.thumb,expression:"info.thumb"}]}),t._v(" "),i("div",{staticClass:"name"},[i("p",{staticClass:"overflow",on:{click:function(i){t.goInfo(e,o)}}},[t._v(t._s(s.title))]),t._v(" "),i("span",[t._v(t._s(s.time))])]),t._v(" "),i("span",{staticClass:"right",on:{click:function(i){t.removeHistoryAction(e,o)}}},[i("yd-icon",{attrs:{name:"error"}})],1)])}))]):t._e()})):t._e(),t._v(" "),"{}"!=JSON.stringify(t.items)?i("div",{staticClass:"option p-sm"},[i("yd-button",{attrs:{type:"danger",shape:"circle",size:"large"},nativeOn:{click:function(e){t.removeAllAction()}}},[t._v("清空全部")])],1):t._e(),t._v(" "),"{}"==JSON.stringify(t.items)?i("Bottom"):t._e()],1)},staticRenderFns:[]};var l=i("D8HT")(n,r,!1,function(t){i("Zzzi")},"data-v-26fcfc94",null);e.default=l.exports},Zzzi:function(t,e){}});