dfe0aa5.js 19 KB

1
  1. (window.webpackJsonp=window.webpackJsonp||[]).push([[113],{565:function(e,t,r){},706:function(e,t,r){"use strict";r(565)},832:function(e,t,r){"use strict";r.r(t);r(18);var o=r(6);r(30),r(191),r(28),r(12),r(15),r(38),r(37),r(33);function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return l(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,d=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return d=e.done,e},e:function(e){c=!0,n=e},f:function(){try{d||null==r.return||r.return()}finally{if(c)throw n}}}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,r=new Array(t);i<t;i++)r[i]=e[i];return r}var d={name:"user_cards_list",components:{user_workfile_check:r(582).a},data:function(){return{drawer_obj:{user_workfile_check:!1,id:0},page:1,total:0,status:0,cate_id:0,type:"0",keywords:"",workfileData:[],loading:!1,outerVisible:!1,addDialog:!1,editDialog:!1,editCateDialog:!1,cate_form:{id:0,cate_id:[]},cateList:[],add_form:{parent_id:0,category_id:0,name:"",f_name:"",order:"1",type:1,seo_title:"",seo_desc:"",seo_keywords:"",customer_type:2},count:{total:0,type1:0,type2:0,status0:0,status1:0,status2:0},tableData:[]}},mounted:function(){this.getAuditList(),this.getTableData()},methods:{addDialogEvent:function(e){this.add_form.parent_id=e.category_id,this.addDialog=!0},addFirstCate:function(){this.add_form.parent_id=0,this.add_form.category_id=0,this.addDialog=!0},formAdd:function(){var e=this;this.$post("/api/admin/common/addCategory",this.add_form).then((function(t){t&&1===t.status&&(e.getTableData(),e.$message.success("操作成功"),e.addDialog=!1,e.add_form.parent_id=0,e.add_form.category_id=0,e.add_form.name="",e.add_form.f_name="",e.add_form.order=0,e.add_form.customer_type=1,e.editDialog=!1,e.add_form.seo_title="",e.add_form.seo_desc="",e.add_form.seo_keywords="")}))},form:function(){},onChangePost:function(e,t,content){var r=this;return Object(o.a)(regeneratorRuntime.mark((function o(){var n;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return r.loading=!0,o.next=3,r.$post("/api/admin/UserWorks/changeWorkFile",{id:e,type:t,content:content});case 3:(n=o.sent)&&1===n.status&&(r.$message({type:"success",message:"操作成功!"}),r.getAuditList(),r.loading=!1);case 5:case"end":return o.stop()}}),o)})))()},onChange:function(e,t){var r=this;return Object(o.a)(regeneratorRuntime.mark((function o(){return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:1==t?r.onChangePost(e,t,""):(r.drawer_obj.user_workfile_check=!0,r.drawer_obj.id=e);case 1:case"end":return o.stop()}}),o)})))()},editDialogEvent:function(e){var form=this.add_form;form.parent_id=e.parent_id,form.category_id=e.category_id,form.name=e.name,form.f_name=e.f_name,form.order=e.order,form.seo_title=e.seo_title,form.seo_desc=e.seo_desc,form.seo_keywords=e.seo_keywords,form.customer_type=Number(e.customer_type),this.editDialog=!0},typechange:function(e){var t=this;return Object(o.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:t.page=1,t.type=e,t.keywords="",t.getAuditList();case 4:case"end":return r.stop()}}),r)})))()},statuschange:function(e){var t=this;return Object(o.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:t.page=1,t.status=e,t.keywords="",t.getAuditList();case 4:case"end":return r.stop()}}),r)})))()},searchkeywords:function(){var e=this;return Object(o.a)(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.page=1,e.keywords=e.keywords,e.getAuditList();case 3:case"end":return t.stop()}}),t)})))()},getTableData:function(){var e=this;return Object(o.a)(regeneratorRuntime.mark((function t(){var r,o,l,d,c,_,m,i,f,v,y,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=1,o=[],l={type:1},t.next=5,e.$post("/api/admin/common/getCategoryMap",l);case 5:d=t.sent,c=d.data,_=n(c);try{for(_.s();!(m=_.n()).done;){if(i=m.value,f={id:r,type:1,category_id:i.category_id,name:i.name,f_name:i.f_name,parent_id:i.parent_id,order:i.order,customer_type:i.customer_type,seo_title:i.seo_title,seo_desc:i.seo_desc,seo_keywords:i.seo_keywords,label:i.name,value:i.category_id,children:[]},r++,i.child){v=n(i.child);try{for(v.s();!(y=v.n()).done;)h=y.value,f.children.push({id:r,type:1,category_id:h.category_id,parent_id:h.parent_id,name:h.name,f_name:h.f_name,order:h.order,seo_title:h.seo_title,seo_desc:h.seo_desc,seo_keywords:h.seo_keywords,customer_type:h.customer_type,label:h.name,value:h.category_id}),r++}catch(e){v.e(e)}finally{v.f()}}o.push(f)}}catch(e){_.e(e)}finally{_.f()}e.tableData=o,e.cateList=o;case 11:case"end":return t.stop()}}),t)})))()},getAuditList:function(){var e=this;return Object(o.a)(regeneratorRuntime.mark((function t(){var data,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return data={page:e.page,status:e.status,type:e.type,cate_id:e.cate_id,keywords:e.keywords},t.next=3,e.$post("/api/admin/UserWorks/getWorkFileList",data);case 3:(r=t.sent)&&1===r.status&&(e.workfileData=r.data.list||[],e.total=1*r.data.total,e.count=r.data.count);case 5:case"end":return t.stop()}}),t)})))()},deleteWorkFile:function(e){var t=this;return Object(o.a)(regeneratorRuntime.mark((function r(){var o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t.$post("/api/admin/UserWorks/deleteWorkFile",{id:e});case 2:(o=r.sent)&&1===o.status&&(t.$message({type:"success",message:"删除成功!"}),t.getAuditList(),t.loading=!1);case 4:case"end":return r.stop()}}),r)})))()},handleCurrentChange:function(e){this.page=e,this.getAuditList()},delEvent:function(e){var t=this;return Object(o.a)(regeneratorRuntime.mark((function r(){return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:t.$confirm("确认删除该分类?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then(function(){var r=Object(o.a)(regeneratorRuntime.mark((function r(o){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return o.value,r.next=3,t.$post("/api/admin/common/categoryDel",{category_id:e.category_id});case 3:(n=r.sent)&&1===n.status&&(t.$message.success("删除成功"),t.getTableData());case 5:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}());case 1:case"end":return r.stop()}}),r)})))()},showEditCate:function(e){this.editCateDialog=!0,this.cate_form.id=e.id},updateCate:function(){var e=this;return Object(o.a)(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.$post("/api/admin/UserWorks/updateWorkFile",{id:e.cate_form.id,cate_id:e.cate_form.cate_id[1]});case 2:(r=t.sent)&&1===r.status&&(e.$message({type:"success",message:"修改成功!"}),e.editCateDialog=!1,e.getAuditList());case 4:case"end":return t.stop()}}),t)})))()}}},c=d,_=(r(706),r(4)),component=Object(_.a)(c,(function(){var e=this,t=e._self._c;e._self._setupProxy;return t("div",[t("el-radio-group",{staticStyle:{"margin-top":"15px"},attrs:{size:"medium"},on:{change:e.typechange},model:{value:e.type,callback:function(t){e.type=t},expression:"type"}},[t("el-radio-button",{attrs:{label:0}},[e._v("全部("+e._s(e.count.type_total)+")")]),e._v(" "),t("el-radio-button",{attrs:{label:1}},[e._v("免费资源("+e._s(e.count.type1)+")")]),e._v(" "),t("el-radio-button",{attrs:{label:2}},[e._v("付费资源("+e._s(e.count.type2)+")")])],1),e._v(" "),t("div",{staticStyle:{clear:"both"}}),e._v(" "),t("el-radio-group",{staticStyle:{"margin-top":"15px"},attrs:{size:"medium"},on:{change:e.statuschange},model:{value:e.status,callback:function(t){e.status=t},expression:"status"}},[t("el-radio-button",{attrs:{label:-1}},[e._v("全部("+e._s(e.count.status_total)+")")]),e._v(" "),t("el-radio-button",{attrs:{label:0}},[e._v("待审核("+e._s(e.count.status0)+")")]),e._v(" "),t("el-radio-button",{attrs:{label:1}},[e._v("审核通过("+e._s(e.count.status1)+")")]),e._v(" "),t("el-radio-button",{attrs:{label:2}},[e._v("审核拒绝("+e._s(e.count.status2)+")")])],1),e._v(" "),t("div",{staticStyle:{clear:"both"}}),e._v(" "),t("div",{staticStyle:{"margin-top":"15px","margin-bottom":"15px"}},[t("div",{staticStyle:{float:"left",width:"200px","margin-right":"15px"}},[t("el-input",{attrs:{placeholder:"UID搜索"},model:{value:e.keywords,callback:function(t){e.keywords=t},expression:"keywords"}})],1),e._v(" "),t("div",{staticStyle:{float:"left",width:"200px","margin-right":"15px"}},[t("el-button",{attrs:{type:"primary"},on:{click:e.searchkeywords}},[e._v("搜索")])],1),e._v(" "),t("div",{staticStyle:{clear:"both"}})]),e._v(" "),t("div",[t("el-table",{directives:[{name:"loading",rawName:"v-loading",value:e.loading,expression:"loading"}],staticStyle:{width:"100%"},attrs:{data:e.workfileData,border:""}},[t("el-table-column",{attrs:{prop:"",label:"资源简介"},scopedSlots:e._u([{key:"default",fn:function(r){return[t("span",{staticClass:"lblue point"},[t("a",{attrs:{target:"_blank",href:r.row.host+"/w/"+r.row.wid}},[e._v(e._s(r.row.work_name))])])]}}])}),e._v(" "),t("el-table-column",{attrs:{prop:"file_size_name",label:"资源大小"}}),e._v(" "),t("el-table-column",{attrs:{prop:"file_name",label:"资源类型"}}),e._v(" "),t("el-table-column",{attrs:{prop:"cate",label:"资源分类"},scopedSlots:e._u([{key:"default",fn:function(r){return[""!=r.row.customer_type_name?t("span",[e._v(e._s(r.row.customer_type_name)),t("br")]):e._e(),e._v(" "),t("span",{staticClass:"lblue point"},[t("a",{on:{click:function(t){return e.showEditCate(r.row)}}},[e._v(e._s(r.row.cate))])])]}}])}),e._v(" "),t("el-table-column",{attrs:{prop:"price",label:"出售价格"}}),e._v(" "),t("el-table-column",{attrs:{prop:"",label:"作者"},scopedSlots:e._u([{key:"default",fn:function(r){return[t("span",{staticClass:"lblue point"},["-"==r.row.nickname?t("a",{attrs:{onclick:"javascript:void(0)"}},[e._v(e._s(r.row.nickname))]):t("a",{attrs:{target:"_blank",href:r.row.host+"/wo/"+r.row.uid}},[e._v(e._s(r.row.nickname))])])]}}])}),e._v(" "),t("el-table-column",{attrs:{prop:"pay_time",label:"上传时间"},scopedSlots:e._u([{key:"default",fn:function(r){return[t("span",[e._v(e._s(r.row.file_time))])]}}])}),e._v(" "),t("el-table-column",{attrs:{prop:"pay_time",label:"基本数据",width:"320px"},scopedSlots:e._u([{key:"default",fn:function(r){return[t("el-tag",{attrs:{type:"success"}},[e._v("购买"+e._s(r.row.buy_num))]),e._v(" "),t("el-tag",{attrs:{type:"success"}},[e._v("浏览"+e._s(r.row.browse))]),e._v(" "),t("el-tag",{attrs:{type:"info"}},[e._v("点赞"+e._s(r.row.plus_co))])]}}])}),e._v(" "),t("el-table-column",{attrs:{prop:"pay_time",label:"当前状态"},scopedSlots:e._u([{key:"default",fn:function(r){return["0"==r.row.status?t("span",[e._v("待审核")]):"1"==r.row.status?t("span",[e._v("审核通过")]):"2"==r.row.status?t("span",[e._v("审核拒绝")]):t("span",[e._v("--")])]}}])}),e._v(" "),t("el-table-column",{attrs:{prop:"uid",label:"操作",width:"220px"},scopedSlots:e._u([{key:"default",fn:function(r){return["1"!=r.row.status?t("el-button",{attrs:{type:"text"},on:{click:function(t){return e.onChange(r.row.id,1)}}},[e._v("审核通过")]):e._e(),e._v(" "),"2"!=r.row.status?t("el-button",{attrs:{type:"text"},on:{click:function(t){return e.onChange(r.row.id,2)}}},[e._v("审核拒绝")]):e._e()]}}])})],1)],1),e._v(" "),t("div",{staticStyle:{"padding-top":"5px"}},[t("el-pagination",{staticClass:"order-footer",attrs:{background:"",layout:"total, prev, pager, next","page-size":20,total:e.total,"current-page":e.page},on:{"update:currentPage":function(t){e.page=t},"update:current-page":function(t){e.page=t},"current-change":e.handleCurrentChange}})],1),e._v(" "),t("el-dialog",{attrs:{title:"分类管理",visible:e.outerVisible,"custom-class":"mall_list","lock-scroll":"",width:"70%"},on:{"update:visible":function(t){e.outerVisible=t}}},[t("el-button",{staticStyle:{margin:"15px",float:"right"},attrs:{type:"primary"},on:{click:function(t){return e.addFirstCate()}}},[e._v("添加一级分类")]),e._v(" "),t("el-table",{staticStyle:{width:"100%","margin-bottom":"20px"},attrs:{data:e.tableData,"row-key":"id",border:"","tree-props":{children:"children",hasChildren:"hasChildren"}}},[t("el-table-column",{attrs:{prop:"name",label:"名称"}}),e._v(" "),t("el-table-column",{attrs:{prop:"f_name",label:"别名",width:"200"},scopedSlots:e._u([{key:"default",fn:function(r){return[t("span",{on:{click:function(t){return e.editDialogEvent(r.row)}}},[e._v(e._s(r.row.f_name))])]}}])}),e._v(" "),t("el-table-column",{attrs:{prop:"order",label:"排序",width:"200"}}),e._v(" "),t("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(r){return[r.row.children?t("el-button",{attrs:{size:"mini",type:"success"},on:{click:function(t){return e.addDialogEvent(r.row)}}},[e._v("新增")]):e._e(),e._v(" "),t("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){return e.editDialogEvent(r.row)}}},[e._v("编辑")]),e._v(" "),t("el-button",{attrs:{size:"mini",type:"danger"},on:{click:function(t){return e.delEvent(r.row)}}},[e._v("删除")])]}}])})],1)],1),e._v(" "),t("el-dialog",{attrs:{title:"添加分类",visible:e.addDialog,width:"500px"},on:{"update:visible":function(t){e.addDialog=t}}},[t("el-form",{attrs:{model:e.add_form,"label-width":"70px"}},[t("el-form-item",{attrs:{label:"名称"}},[t("el-input",{attrs:{autocomplete:"off"},model:{value:e.add_form.name,callback:function(t){e.$set(e.add_form,"name",t)},expression:"add_form.name"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"别名"}},[t("el-input",{attrs:{autocomplete:"off"},model:{value:e.add_form.f_name,callback:function(t){e.$set(e.add_form,"f_name",t)},expression:"add_form.f_name"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"排序"}},[t("el-input",{attrs:{autocomplete:"off",placeholder:"请输入数字"},model:{value:e.add_form.order,callback:function(t){e.$set(e.add_form,"order",t)},expression:"add_form.order"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"标题"}},[t("el-input",{attrs:{autocomplete:"off",placeholder:""},model:{value:e.add_form.seo_title,callback:function(t){e.$set(e.add_form,"seo_title",t)},expression:"add_form.seo_title"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"描述"}},[t("el-input",{attrs:{autocomplete:"off",placeholder:""},model:{value:e.add_form.seo_desc,callback:function(t){e.$set(e.add_form,"seo_desc",t)},expression:"add_form.seo_desc"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"关键字"}},[t("el-input",{attrs:{autocomplete:"off",placeholder:""},model:{value:e.add_form.seo_keywords,callback:function(t){e.$set(e.add_form,"seo_keywords",t)},expression:"add_form.seo_keywords"}})],1),e._v(" "),0==e.add_form.parent_id?t("el-form-item",{attrs:{label:"类别"}},[t("el-radio-group",{attrs:{size:"mini"},model:{value:e.add_form.customer_type,callback:function(t){e.$set(e.add_form,"customer_type",t)},expression:"add_form.customer_type"}},[t("el-radio",{attrs:{label:2}},[e._v("面向开发者")]),e._v(" "),t("el-radio",{attrs:{label:1}},[e._v("面向企业方")])],1)],1):e._e()],1),e._v(" "),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{size:"medium"},on:{click:function(t){e.addDialog=!1}}},[e._v("取消")]),e._v(" "),t("el-button",{attrs:{size:"medium",type:"primary"},on:{click:e.formAdd}},[e._v("确定")])],1)],1),e._v(" "),t("el-dialog",{attrs:{title:"编辑分类",visible:e.editDialog,width:"500px"},on:{"update:visible":function(t){e.editDialog=t}}},[t("el-form",{attrs:{model:e.add_form,"label-width":"70px"}},[t("el-form-item",{attrs:{label:"名称"}},[t("el-input",{attrs:{autocomplete:"off"},model:{value:e.add_form.name,callback:function(t){e.$set(e.add_form,"name",t)},expression:"add_form.name"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"别名"}},[t("el-input",{attrs:{autocomplete:"off"},model:{value:e.add_form.f_name,callback:function(t){e.$set(e.add_form,"f_name",t)},expression:"add_form.f_name"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"排序"}},[t("el-input",{attrs:{autocomplete:"off",placeholder:"请输入数字"},model:{value:e.add_form.order,callback:function(t){e.$set(e.add_form,"order",t)},expression:"add_form.order"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"标题"}},[t("el-input",{attrs:{autocomplete:"off",placeholder:""},model:{value:e.add_form.seo_title,callback:function(t){e.$set(e.add_form,"seo_title",t)},expression:"add_form.seo_title"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"描述"}},[t("el-input",{attrs:{autocomplete:"off",placeholder:""},model:{value:e.add_form.seo_desc,callback:function(t){e.$set(e.add_form,"seo_desc",t)},expression:"add_form.seo_desc"}})],1),e._v(" "),t("el-form-item",{attrs:{label:"关键字"}},[t("el-input",{attrs:{autocomplete:"off",placeholder:""},model:{value:e.add_form.seo_keywords,callback:function(t){e.$set(e.add_form,"seo_keywords",t)},expression:"add_form.seo_keywords"}})],1),e._v(" "),0==e.add_form.parent_id?t("el-form-item",{attrs:{label:"类别"}},[t("el-radio-group",{attrs:{size:"mini"},model:{value:e.add_form.customer_type,callback:function(t){e.$set(e.add_form,"customer_type",t)},expression:"add_form.customer_type"}},[t("el-radio",{attrs:{label:2}},[e._v("面向开发者")]),e._v(" "),t("el-radio",{attrs:{label:1}},[e._v("面向企业方")])],1)],1):e._e()],1),e._v(" "),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{size:"medium"},on:{click:function(t){e.editDialog=!1}}},[e._v("取消")]),e._v(" "),t("el-button",{attrs:{size:"medium",type:"primary"},on:{click:e.formAdd}},[e._v("确定")])],1)],1),e._v(" "),t("el-dialog",{attrs:{title:"修改资源分类",visible:e.editCateDialog,width:"300px"},on:{"update:visible":function(t){e.editCateDialog=t}}},[t("el-form",{attrs:{model:e.cate_form,"label-width":"70px"}},[t("el-form-item",{attrs:{label:"资源分类"}},[t("el-cascader",{staticStyle:{width:"150px"},attrs:{clearable:"",filterable:"",options:e.cateList},model:{value:e.cate_form.cate_id,callback:function(t){e.$set(e.cate_form,"cate_id",t)},expression:"cate_form.cate_id"}})],1)],1),e._v(" "),t("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[t("el-button",{attrs:{size:"medium"},on:{click:function(t){e.editCateDialog=!1}}},[e._v("取消")]),e._v(" "),t("el-button",{attrs:{size:"medium",type:"primary"},on:{click:e.updateCate}},[e._v("确定")])],1)],1),e._v(" "),e.drawer_obj.user_workfile_check?t("user_workfile_check",{attrs:{back:this,pro_id:e.drawer_obj.id}}):e._e()],1)}),[],!1,null,"b7d4cd2c",null);t.default=component.exports}}]);