text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0d5c31"],{7057:function(t,e,o){"use strict";o.r(e);var l=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("div",[o("el-row",[o("el-col",[o("el-button",{attrs:{plain:""},on:{click:t.handleAdd}},[t._v("新增流")])],1)],1)],1),o("el-table",{staticStyle:{width:"100%"},attrs:{data:t.tableData}},[o("el-table-column",{attrs:{prop:"url",label:"流"}}),o("el-table-column",{attrs:{prop:"remark",label:"备注",width:"100px"}}),o("el-table-column",{attrs:{prop:"ffmpeg",label:"flv方式",width:"200px",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("div",[t._v(t._s(e.row.mode))])]}}])}),o("el-table-column",{attrs:{prop:"enabledFlv",label:"flv推流状态",width:"200px",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-switch",{staticStyle:{display:"block"},attrs:{"active-color":"#13ce66","inactive-color":"#ff4949","active-text":"开启推流","inactive-text":"停止"},on:{change:function(o){return t.changeStatus(o,e.row)}},model:{value:e.row.enabledFlv,callback:function(o){t.$set(e.row,"enabledFlv",o)},expression:"scope.row.enabledFlv"}})]}}])}),o("el-table-column",{attrs:{prop:"enabledStatus",label:"hls切片",width:"200px",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-switch",{staticStyle:{display:"block"},attrs:{"active-color":"#13ce66","inactive-color":"#ff4949","active-text":"开启切片","inactive-text":"停止"},on:{change:function(o){return t.changeHlsStatus(o,e.row)}},model:{value:e.row.enabledHls,callback:function(o){t.$set(e.row,"enabledHls",o)},expression:"scope.row.enabledHls"}})]}}])}),o("el-table-column",{attrs:{label:"操作",align:"center",width:"180px"},scopedSlots:t._u([{key:"default",fn:function(e){return[o("el-button",{attrs:{size:"mini",type:"text",icon:"el-icon-view"},on:{click:function(o){return t.handleStop(e.row)}}},[t._v("停止并删除")])]}}])})],1),o("el-dialog",{attrs:{title:"编辑流",visible:t.showAdd,width:"650px","append-to-body":""},on:{"update:visible":function(e){t.showAdd=e}}},[o("el-form",{ref:"form",attrs:{model:t.form,rules:t.rules,"label-width":"120px"}},[o("el-form-item",{attrs:{label:"url",prop:"url"}},[o("el-input",{attrs:{placeholder:"请输入流地址"},model:{value:t.form.url,callback:function(e){t.$set(t.form,"url",e)},expression:"form.url"}})],1),o("el-form-item",{attrs:{label:"备注",prop:"remark"}},[o("el-input",{attrs:{placeholder:"请输入备注"},model:{value:t.form.remark,callback:function(e){t.$set(t.form,"remark",e)},expression:"form.remark"}})],1)],1),o("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[o("el-button",{attrs:{type:"primary"},on:{click:t.submitForm}},[t._v("确 定")]),o("el-button",{on:{click:function(e){t.showAdd=!1}}},[t._v("取 消")])],1)],1)],1)},a=[],n={data:function(){return{form:{},rules:{},showAdd:!1,tableData:[]}},created:function(){this.getList()},methods:{getList:function(){var t=this;this.$http.get("/list").then((function(e){200==e.data.code&&(t.tableData=e.data.data)}))},handleAdd:function(){this.reset(),this.showAdd=!0},handleStop:function(t){var e=this,o=this.$loading({lock:!0,text:"Loading",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});this.$http.get("/del",{url:t.url}).then((function(t){200==t.data.code&&setTimeout((function(){e.getList(),o.close(),e.$message.success(t.data.msg)}),500)}))},submitForm:function(){var t=this,e=this.$loading({lock:!0,text:"Loading",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});this.$http.get("/add",this.form).then((function(o){200==o.data.code&&setTimeout((function(){t.getList(),e.close(),t.$message.success(o.data.msg),t.showAdd=!1}),500)}))},changeStatus:function(t,e){var o=this,l=this.$loading({lock:!0,text:"Loading",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});t?this.$http.get("/start",{url:e.url}).then((function(t){200==t.data.code&&setTimeout((function(){o.getList(),l.close(),o.$message.success(t.data.msg)}),2e3)})):this.$http.get("/stop",{url:e.url}).then((function(t){200==t.data.code&&setTimeout((function(){o.getList(),l.close(),o.$message.success(t.data.msg)}),2e3)}))},changeHlsStatus:function(t,e){var o=this;if("desktop"==e.url)return this.$message.error("桌面投影无法使用hls"),e.enabledHls=!1,!1;var l=this.$loading({lock:!0,text:"Loading",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});t?this.$http.get("/startHls",{url:e.url}).then((function(t){200==t.data.code&&setTimeout((function(){o.$message.success(t.data.msg),o.getList(),l.close()}),2e3)})):this.$http.get("/stopHls",{url:e.url}).then((function(t){200==t.data.code&&setTimeout((function(){o.$message.success(t.data.msg),o.getList(),l.close()}),2e3)}))},reset:function(){this.form={id:void 0,num:void 0,remark:void 0}}}},s=n,i=o("2877"),r=Object(i["a"])(s,l,a,!1,null,null,null);e["default"]=r.exports}}]);
  //# sourceMappingURL=chunk-2d0d5c31.d040fb8c.js.map