webpackJsonp([11],{fhOb:function(t,a,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var s=[{title:"剧本名称",dataIndex:"name",key:"name",scopedSlots:{customRender:"name"},width:260},{title:"APP 名称",dataIndex:"app_name",key:"app_name",scopedSlots:{customRender:"app_name"},width:160},{title:"执行结果",dataIndex:"result",key:"result",scopedSlots:{customRender:"result"}},{title:"状态",dataIndex:"status",key:"status",scopedSlots:{customRender:"status"},width:60},{title:"创建时间",key:"create_time",dataIndex:"create_time",scopedSlots:{customRender:"create_time"},width:190},{title:"操作",key:"action",scopedSlots:{customRender:"action"},width:60}],n={name:"logsHome",data:function(){return{columns:s,loading:!1,data:[],type_data:[],so_text:""}},mounted:function(){this.onLoad()},methods:{onLoad:function(){var t=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;this.loading=!0,this.$http.post("/api/v1/w5/get/logs/list",{keywords:a,type:e}).then(function(a){0==a.code?(t.data=a.data,t.onSelectType(),t.loading=!1):(t.$message.error(a.msg),t.loading=!1)})},onSelectType:function(){var t=this;this.$http.post("/api/v1/w5/get/workflow/list",{type:0}).then(function(a){0==a.code?t.type_data=a.data:t.$message.error(a.msg)})},del:function(t){var a=this;this.$http.post("/api/v1/w5/post/logs/del",{id:t}).then(function(t){0==t.code?(a.$message.success("删除成功"),a.onLoad()):a.$message.error(t.msg)})},onSearch:function(t){this.so_text=t,this.onLoad(this.so_text,this.select_type)},onSelect:function(t){this.select_type=t,this.onLoad(this.so_text,this.select_type)},onFilterOption:function(t,a){return a.componentOptions.children[0].text.toLowerCase().indexOf(t.toLowerCase())>=0}}},o={render:function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("a-layout-content",[e("div",{staticClass:"header_div"},[e("a-select",{staticClass:"align",staticStyle:{width:"120px"},attrs:{"show-search":"","filter-option":t.onFilterOption,"default-value":"0"},on:{change:t.onSelect}},[e("a-select-option",{attrs:{value:"0"}},[t._v("全部")]),t._v(" "),t._l(t.type_data,function(a,s){return e("a-select-option",{key:s,attrs:{value:a.uuid}},[t._v(t._s(a.name))])})],2),t._v(" "),e("a-input-search",{staticClass:"align",staticStyle:{width:"200px"},attrs:{placeholder:"请输入关键字"},on:{search:t.onSearch}})],1),t._v(" "),e("a-table",{attrs:{rowKey:"id",columns:t.columns,"data-source":t.data,loading:t.loading},scopedSlots:t._u([{key:"name",fn:function(a){return e("span",{},[e("b",[t._v(t._s(a))])])}},{key:"app_name",fn:function(a,s){return e("span",{},"开始"==a?[e("a-avatar",{staticStyle:{"margin-right":"3px"},attrs:{size:22,src:t.BaseURL+"/app/basic/start.png"}}),t._v(" "),e("a-tag",{attrs:{color:"#1863d4"}},[t._v(t._s(a)+" ")])]:"结束"==a?[e("a-avatar",{staticStyle:{"margin-right":"3px"},attrs:{size:22,src:t.BaseURL+"/app/basic/end.png"}}),t._v(" "),e("a-tag",{attrs:{color:"#b92525"}},[t._v(t._s(a)+" ")])]:"定时器"==a?[e("a-avatar",{staticStyle:{"margin-right":"3px"},attrs:{size:22,src:t.BaseURL+"/app/basic/timer.png"}}),t._v(" "),e("a-tag",{attrs:{color:"#3ca03b"}},[t._v(t._s(a)+" ")])]:"用户输入"==a?[e("a-avatar",{staticStyle:{"margin-right":"3px"},attrs:{size:22,src:t.BaseURL+"/app/basic/input.png"}}),t._v(" "),e("a-tag",{attrs:{color:"#b628da"}},[t._v(t._s(a)+" ")])]:"WebHook"==a?[e("a-avatar",{staticStyle:{"margin-right":"3px"},attrs:{size:22,src:t.BaseURL+"/app/basic/webhook.png"}}),t._v(" "),e("a-tag",{attrs:{color:"#53b0b5"}},[t._v(t._s(a)+" ")])]:""==a?[e("a-avatar",{staticStyle:{"margin-right":"3px"},attrs:{size:22,src:t.BaseURL+"/app/basic/unknown.png"}}),t._v(" "),e("a-tag",{attrs:{color:"#53b0b5"}},[t._v(t._s(a)+" ")])]:[e("a-avatar",{staticStyle:{"margin-right":"3px"},attrs:{size:22,src:t.BaseURL+"/app/"+JSON.parse(s.args).app_dir+"/icon.png"}}),t._v(" "),e("a-tag",{attrs:{color:"#7d838c"}},[t._v(t._s(a)+" ")])],1)}},{key:"status",fn:function(a){return e("span",{},[0==a?e("a-tag",{attrs:{color:"#469823"}},[t._v("正常")]):t._e(),t._v(" "),1==a?e("a-tag",{attrs:{color:"#9e8c0a"}},[t._v("警告")]):t._e(),t._v(" "),2==a?e("a-tag",{attrs:{color:"#9c5656"}},[t._v("错误")]):t._e(),t._v(" "),3==a?e("a-tag",{attrs:{color:"#bf0c0c"}},[t._v("危险")]):t._e()],1)}},{key:"create_time",fn:function(a){return e("di",{},[t._v("\n            "+t._s(t.Dayjs(a).subtract(8,"hour").format("YYYY-MM-DD HH:mm:ss"))+"\n        ")])}},{key:"action",fn:function(a,s){return e("div",{staticStyle:{"text-align":"center"}},[e("a-space",{attrs:{size:"small"}},[e("a-tooltip",{attrs:{placement:"left"}},[e("template",{slot:"title"},[e("span",[t._v("删除")])]),t._v(" "),e("a-popconfirm",{attrs:{title:"是否要删除该日记?","ok-text":"是","cancel-text":"否"},on:{confirm:function(a){return t.del(s.id)}}},[e("a-icon",{staticClass:"pointer",attrs:{type:"delete"}})],1)],2)],1)],1)}}],null,!0)})],1)},staticRenderFns:[]};var i=e("VU/8")(n,o,!1,function(t){e("luex")},"data-v-1ea0ead6",null);a.default=i.exports},luex:function(t,a){}});