(window.webpackJsonp=window.webpackJsonp||[]).push([[71],{622:function(t,e,r){"use strict";r.r(e);var n=r(3),o=(r(17),r(35),{name:"user_search",data:function(){return{page:1,total:0,loading:!1,activeName:"real",timeType:"0",realData:[],sortData:[]}},mounted:function(){this.getData()},methods:{getData:function(){"real"===this.activeName?this.getRealList():"sort"===this.activeName&&this.getSortList()},getRealList:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var r,data,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.page,data={page:r},e.next=4,t.$post("/api/admin/search/getSearchLog",data);case 4:(n=e.sent)&&1===n.status&&(t.realData=n.data.list||[],t.total=1*n.data.total);case 6:case"end":return e.stop()}}),e)})))()},getSortList:function(){var t=this;return Object(n.a)(regeneratorRuntime.mark((function e(){var data,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return data={type:t.timeType},e.next=3,t.$post("/api/admin/search/getSortSearchLog",data);case 3:(r=e.sent)&&1===r.status&&(t.sortData=r.data||[]);case 5:case"end":return e.stop()}}),e)})))()},handleClick:function(t,e){this.activeName=t.name,this.getData()},handleCurrentChange:function(t){this.page=t,this.getData()},formatDate:function(time){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if("0"===time)return"--";var e=new Date(1e3*time),r=e.getFullYear(),n=e.getMonth()+1,o=e.getDate(),l=e.getHours(),c=e.getMinutes(),d=e.getSeconds();return l<10&&(l="0"+l),c<10&&(c="0"+c),d<10&&(d="0"+d),""==t?r+"-"+n+"-"+o+" "+l+":"+c+":"+d:r+"-"+n+"-"+o+" "+l+":"+c}}}),l=r(2),component=Object(l.a)(o,(function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",[r("div",[r("el-tabs",{on:{"tab-click":t.handleClick},model:{value:t.activeName,callback:function(e){t.activeName=e},expression:"activeName"}},[r("el-tab-pane",{attrs:{label:"实时数据",name:"real"}},[r("el-table",{staticStyle:{width:"100%"},attrs:{data:t.realData,border:""}},[r("el-table-column",{attrs:{prop:"",label:"用户"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",{staticClass:"lblue point"},[r("a",{attrs:{target:"_blank",href:e.row.host+"/rooter/user/"+e.row.uid}},[t._v(t._s(e.row.nickname+"("+e.row.uid+")"))])])]}}])}),t._v(" "),r("el-table-column",{attrs:{prop:"create_time",label:"搜索词"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v(t._s(e.row.keyword))])]}}])}),t._v(" "),r("el-table-column",{attrs:{prop:"create_time",label:"设备来源"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v(t._s(e.row.app_type)+"-"+t._s(e.row.version))])]}}])}),t._v(" "),r("el-table-column",{attrs:{prop:"create_time",label:"搜索时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v(t._s(t.formatDate(e.row.created_at,"Y-m-d H:i")))])]}}])})],1)],1),t._v(" "),r("el-tab-pane",{attrs:{label:"排名数据",name:"sort"}},[r("div",{staticStyle:{"margin-bottom":"10px"}},[r("el-radio-group",{attrs:{size:"small"},on:{change:function(e){return t.getSortList()}},model:{value:t.timeType,callback:function(e){t.timeType=e},expression:"timeType"}},[r("el-radio-button",{attrs:{label:"0"}},[t._v("全部")]),t._v(" "),r("el-radio-button",{attrs:{label:"1"}},[t._v("最近7天")]),t._v(" "),r("el-radio-button",{attrs:{label:"2"}},[t._v("最近30天")]),t._v(" "),r("el-radio-button",{attrs:{label:"3"}},[t._v("最近3个月")]),t._v(" "),r("el-radio-button",{attrs:{label:"4"}},[t._v("最近6个月")])],1)],1),t._v(" "),r("el-table",{staticStyle:{width:"100%"},attrs:{data:t.sortData,border:""}},[r("el-table-column",{attrs:{prop:"",type:"index",width:"50px",label:"排名"}}),t._v(" "),r("el-table-column",{attrs:{prop:"create_time",label:"搜索词"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v(t._s(e.row.keyword))])]}}])}),t._v(" "),r("el-table-column",{attrs:{prop:"create_time",label:"搜索次数"},scopedSlots:t._u([{key:"default",fn:function(e){return[r("span",[t._v(t._s(e.row.num))])]}}])})],1)],1)],1)],1),t._v(" "),r("div",{directives:[{name:"show",rawName:"v-show",value:"real"===t.activeName,expression:"activeName === 'real'"}],staticClass:"page"},[r("el-pagination",{staticClass:"order-footer",attrs:{background:"",layout:"total, prev, pager, next","page-size":20,total:t.total},on:{"current-change":t.handleCurrentChange}})],1)])}),[],!1,null,"6871cfe9",null);e.default=component.exports}}]);