(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-99060f64"],{5795:function(t,e,n){"use strict";var a=n("58af"),o=n.n(a);o.a},"58af":function(t,e,n){},"7a72":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-list-content"},[n("cl-crud",{staticClass:"liu-crud-wrap",on:{load:t.onLoad},scopedSlots:t._u([{key:"slot-tabs",fn:function(e){e.scope;return[n("el-tabs",{staticClass:"liu-tabs",attrs:{type:"border-card"},on:{"tab-click":t.handleClick},model:{value:t.tabIndex,callback:function(e){t.tabIndex=e},expression:"tabIndex"}},t._l(t.tabsData,(function(t,e){return n("el-tab-pane",{key:e,attrs:{label:t.text,name:t.key}})})),1)]}},{key:"table-column-avatarUrl",fn:function(e){var a=e.scope;return[n("cl-avatar",{style:{margin:"auto"},attrs:{shape:"square",size:40,src:t._f("default_avatar")(a.row.smallImgList[0])}})]}},{key:"table-column-goodsName",fn:function(e){var a=e.scope;return[n("span",[t._v(t._s(a.row.goodsName))]),n("span",{staticClass:"short-link",on:{click:function(e){return t.openLinkFn(a.row)}}},[t._v("链接")])]}},{key:"slot-add-goods-btn",fn:function(e){e.scope;return[n("el-button",{attrs:{type:"primary",size:"mini"},on:{click:t.addFn}},[t._v("添加")])]}},{key:"table-column-status",fn:function(e){var a=e.scope;return[n("span",[t._v(t._s(1==a.row.status?"上架":"下架"))])]}},{key:"slot-modify",fn:function(e){e.scope;return[n("el-button",{attrs:{type:"text"}},[t._v("修改")])]}},{key:"slot-takeOff",fn:function(e){var a=e.scope;return[n("el-button",{attrs:{type:"text"},on:{click:function(e){return t.downFn(a.row)}}},[t._v("下架")])]}}])}),n("el-dialog",{attrs:{title:"商品短链接：",visible:t.dialogFormVisible,width:"40%"},on:{"update:visible":function(e){t.dialogFormVisible=e}}},[n("div",[n("el-input",{attrs:{disabled:!0},model:{value:t.sortLink,callback:function(e){t.sortLink=e},expression:"sortLink"}})],1),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.dialogFormVisible=!1}}},[t._v("取 消")]),n("el-button",{attrs:{type:"primary"},on:{click:t.sendPhoneFn}},[t._v("发到手机")])],1)])],1)},o=[],s={data:function(){return{app:null,dialogFormVisible:!1,sortLink:"",operateData:{},tabIndex:"-1",tabsData:[{text:"全部",key:"-1"},{text:"上架",key:"1"},{text:"下架",key:"0"}]}},methods:{handleClick:function(t,e){console.log(t,e),this.app.refresh({type:this.tabIndex})},openLinkFn:function(t){this.operateData=t,this.sortLink=t.shortUrl||"",this.dialogFormVisible=!0},sendPhoneFn:function(){var t=this;this.$service.goods.sendPhone({id:this.operateData.id}).then((function(e){t.$message.success("发送成功！"),t.dialogFormVisible=!1}))},addFn:function(){this.$router.push("/goods/add")},downFn:function(t){var e=this;this.$confirm("是否下架该商品?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((function(){e.$service.goods.changeStatus({id:t.id,status:0==t.status?1:0}).then((function(n){t.status=0==t.status?1:0,e.$message.success("操作成功！")})).catch((function(t){e.$message.error(t)}))})).catch((function(){e.$message({type:"info",message:"已取消删除"})}))},onLoad:function(t){var e=t.ctx,n=t.app;this.app=n,e.service(this.$service.goods).set("table",{columns:[{prop:"id",label:"ID",align:"center"},{prop:"avatarUrl",label:"封面",align:"center"},{prop:"goodsName",label:"标题",align:"center","min-width":180},{prop:"inTurn",label:"顺序",align:"center"},{prop:"price",label:"价格",align:"center",emptyText:"无","min-width":150},{prop:"actualSold",label:"销量",align:"center"},{prop:"viewNum",label:"浏览量",align:"center"},{prop:"status",label:"状态",align:"center"},{prop:"createDate",label:"创建时间",align:"center"}],op:{visible:!0,props:{width:150,align:"center",fixed:"right",label:"操作"},layout:["slot-modify","slot-takeOff"]}}).set("dict",{search:{keyWord:"goodsName"}}).set("search",{key:{placeholder:"商品名称"}}).set("layout",[["slot-tabs"],["search-key","flex1","refresh-btn","slot-add-goods-btn"],["data-table"],["flex1","pagination"]]).done(),n.refresh({status:this.tabIndex})}}},i=s,r=(n("5795"),n("5511")),l=Object(r["a"])(i,a,o,!1,null,"668c807f",null);e["default"]=l.exports}}]);