content.0764ef88.js 66 KB

123
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["content"],{"0d7a":function(e,t,a){},"0fc8":function(e,t,a){},"146a":function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("a-spin",{attrs:{spinning:e.isLoading}},[t("a-form",{attrs:{form:e.form,labelCol:e.labelCol,wrapperCol:e.wrapperCol},on:{submit:e.handleSubmit}},[t("a-form-item",{attrs:{label:"文章标题"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["title",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['title', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}]})],1),t("a-form-item",{attrs:{label:"文章分类"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["category_id",{initialValue:0,rules:[{required:!0,message:"请选择文章分类"}]}],expression:"['category_id', { initialValue: 0, rules: [{ required: true, message: '请选择文章分类' }] }]"}],staticStyle:{width:"300px"}},[t("a-select-option",{attrs:{value:0}},[e._v("无分类")]),e._l(e.categoryList,(function(a,r){return t("a-select-option",{key:r,attrs:{value:a.category_id}},[e._v(e._s(a.name))])}))],2)],1),t("a-form-item",{attrs:{label:"列表显示方式"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["show_type",{initialValue:10,rules:[{required:!0}]}],expression:"['show_type', { initialValue: 10, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:10}},[e._v("小图模式")]),t("a-radio",{attrs:{value:20}},[e._v("大图模式")])],1),t("div",{staticClass:"form-item-help"},[t("p",{staticClass:"extra"},[e._v("小图模式建议封面图尺寸:300 * 188")]),t("p",{staticClass:"extra"},[e._v("大图模式建议封面图尺寸:750 * 455")])])],1),t("a-form-item",{attrs:{label:"封面图"}},[t("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["image_id",{rules:[{required:!0,message:"请选择1个封面图"}]}],expression:"['image_id', { rules: [{ required: true, message: '请选择1个封面图' }] }]"}]})],1),t("a-form-item",{attrs:{label:"文章内容"}},[t("Ueditor",{directives:[{name:"decorator",rawName:"v-decorator",value:["content",{rules:[{required:!0,message:"文章内容不能为空"}]}],expression:"['content', { rules: [{ required: true, message: '文章内容不能为空' }] }]"}]})],1),t("a-form-item",{attrs:{label:"虚拟阅读量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户看到的阅读量 = 实际阅读量 + 虚拟阅读量"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["virtual_views",{initialValue:100}],expression:"['virtual_views', { initialValue: 100 }]"}],attrs:{min:0}})],1),t("a-form-item",{attrs:{label:"状态",extra:"用户端是否展示"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("显示")]),t("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{attrs:{label:"排序",extra:"数字越小越靠前"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入至少1个数字' }] }]"}],attrs:{min:0}})],1),t("a-form-item",{staticClass:"mt-20",attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[t("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交")])],1)],1)],1)],1)},n=[],i=a("c7eb"),o=a("1da1"),s=(a("d3b7"),a("88bc"),a("2af9")),l=a("b63a"),c=a("89a2"),u={components:{SelectImage:s["f"],Ueditor:s["i"]},data:function(){return{isLoading:!1,isBtnLoading:!1,labelCol:{span:4},wrapperCol:{span:13},form:this.$form.createForm(this),categoryList:[]}},created:function(){var e=this;return Object(o["a"])(Object(i["a"])().mark((function t(){return Object(i["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,e.getCategoryList();case 2:case"end":return t.stop()}}),t)})))()},methods:{getCategoryList:function(){var e=this;return Object(o["a"])(Object(i["a"])().mark((function t(){return Object(i["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.isLoading=!0,t.next=3,c["d"]().then((function(t){return e.categoryList=t.data.list})).finally((function(){return e.isLoading=!1}));case 3:case"end":return t.stop()}}),t)})))()},handleSubmit:function(e){e.preventDefault();var t=this.form.validateFields,a=this.onFormSubmit;t((function(e,t){!e&&a(t)}))},onFormSubmit:function(e){var t=this;this.isLoading=!0,this.isBtnLoading=!0,l["a"]({form:e}).then((function(e){t.$message.success(e.message,1.5),setTimeout((function(){return t.$router.push("./index")}),1500)})).catch((function(){return t.isBtnLoading=!1})).finally((function(){return t.isLoading=!1}))}}},d=u,m=(a("9b89"),a("2877")),f=Object(m["a"])(d,r,n,!1,null,"23c1efef",null);t["default"]=f.exports},"1da1":function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));a("d3b7");function r(e,t,a,r,n,i,o){try{var s=e[i](o),l=s.value}catch(c){return void a(c)}s.done?t(l):Promise.resolve(l).then(r,n)}function n(e){return function(){var t=this,a=arguments;return new Promise((function(n,i){var o=e.apply(t,a);function s(e){r(o,n,i,s,l,"next",e)}function l(e){r(o,n,i,s,l,"throw",e)}s(void 0)}))}}},"2b0e8":function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("div",{staticClass:"table-operator"},[t("a-row",{staticClass:"row-item-search"},[t("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[t("a-form-item",{attrs:{label:"文件名称"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["fileName"],expression:"['fileName']"}],attrs:{placeholder:"请输入文件名称"}})],1),t("a-form-item",{attrs:{label:"文件分组"}},[t("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["groupId",{initialValue:-1}],expression:"['groupId', { initialValue: -1 }]"}],attrs:{treeDefaultExpandAll:"",allowClear:"",treeData:e.groupListTreeSelect,dropdownStyle:{maxHeight:"500px",overflow:"auto"}}})],1),t("a-form-item",{attrs:{label:"存储方式"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["storage",{initialValue:""}],expression:"['storage', { initialValue: '' }]"}]},[t("a-select-option",{attrs:{value:""}},[e._v("全部")]),e._l(e.StorageEnum.data,(function(a,r){return t("a-select-option",{key:r,attrs:{value:a.value}},[e._v(e._s(a.name))])}))],2)],1),t("a-form-item",{attrs:{label:"上传来源"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["channel",{initialValue:-1}],expression:"['channel', { initialValue: -1 }]"}]},[t("a-select-option",{attrs:{value:-1}},[e._v("全部")]),e._l(e.ChannelEnum.data,(function(a,r){return t("a-select-option",{key:r,attrs:{value:a.value}},[e._v(e._s(a.name))])}))],2)],1),t("a-form-item",{staticClass:"search-btn"},[t("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1),t("a-form-item",{staticClass:"search-btn"},[t("a-button",{on:{click:e.handleReset}},[e._v("重置")])],1)],1)],1),t("div",{staticClass:"row-item-tab clearfix"},[t("div",{staticClass:"tab-list fl-l"},[t("a-radio-group",{attrs:{defaultValue:e.queryParam.fileType},on:{change:e.handleTabs}},[t("a-radio-button",{attrs:{value:-1}},[e._v("全部")]),e._l(e.FileTypeEnum.data,(function(a,r){return t("a-radio-button",{key:r,attrs:{value:a.value}},[e._v(e._s(a.name))])}))],2)],1),e.selectedRowKeys.length?t("div",{staticClass:"button-group"},[t("a-button-group",[t("a-button",{attrs:{icon:"swap"},on:{click:e.handleBatchMove}},[e._v("移动")]),t("a-button",{attrs:{icon:"delete"},on:{click:e.handleBatchDelete}},[e._v("删除")])],1)],1):e._e()])],1),t("s-table",{ref:"table",attrs:{rowKey:"file_id",loading:e.isLoading,columns:e.columns,data:e.loadData,rowSelection:e.rowSelection,pageSize:15,scroll:{x:1300}},scopedSlots:e._u([{key:"preview_url",fn:function(e,a){return t("span",{},[t("div",{staticClass:"preview-box"},[t("a",{attrs:{href:a.external_url,target:"_blank"}},[t("img",{attrs:{src:e}})])])])}},{key:"file_name",fn:function(a){return t("span",{},[t("p",{staticClass:"oneline-hide"},[e._v(e._s(a))])])}},{key:"storage",fn:function(a){return t("span",{},[t("a-tag",[e._v(e._s(e.StorageEnum[a].name))])],1)}},{key:"file_type",fn:function(a){return t("span",{},[t("a-tag",[e._v(e._s(e.FileTypeEnum[a].name))])],1)}},{key:"action",fn:function(a,r){return t("span",{},[t("a",{directives:[{name:"action",rawName:"v-action:edit",arg:"edit"}],staticStyle:{"margin-right":"8px"},on:{click:function(t){return e.handleEdit(r)}}},[e._v("编辑")]),t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete(r)}}},[e._v("删除")])])}}])}),t("MoveGroupForm",{ref:"MoveGroupForm",attrs:{groupList:e.groupListTree},on:{handleSubmit:e.handleRefresh}}),t("EditForm",{ref:"EditForm",attrs:{groupList:e.groupListTree},on:{handleSubmit:e.handleRefresh}})],1)},n=[],i=a("5530"),o=(a("d3b7"),a("99af"),a("159b"),a("2518")),s=a("9aca"),l=a("2af9"),c=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:420,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("div",{staticClass:"group-tree"},[e.groupTreeData.length?t("a-tree",{attrs:{selectable:!0,blockNode:!0,treeData:e.groupTreeData,autoExpandParent:!0},on:{select:e.onSelect}}):e._e()],1)])],1)},u=[],d={props:{groupList:{type:Array,required:!0}},data:function(){return{title:"移动到分组",labelCol:{xs:{span:24},sm:{span:7}},wrapperCol:{xs:{span:24},sm:{span:13}},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),filesIds:{},groupTreeData:[],selectedKeys:[]}},methods:{show:function(e){this.visible=!0,this.filesIds=e,this.getList()},getList:function(){this.groupTreeData=[{title:"未分组",key:0,value:0}].concat(this.groupList)},onSelect:function(e){this.selectedKeys=e},handleSubmit:function(e){e.preventDefault(),this.selectedKeys.length?this.onFormSubmit():this.handleCancel()},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(){var e=this;this.confirmLoading=!0,o["d"]({groupId:this.selectedKeys[0],fileIds:this.filesIds}).then((function(t){e.$message.success(t.message),e.handleCancel(),e.$emit("handleSubmit")})).finally((function(){return e.confirmLoading=!1}))}}},m=d,f=(a("a9fb"),a("2877")),h=Object(f["a"])(m,c,u,!1,null,"e8efd35a",null),p=h.exports,v=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:"编辑文件",width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"文件名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["file_name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['file_name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}]})],1),t("a-form-item",{attrs:{label:"上级分组",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["group_id"],expression:"['group_id']"}],attrs:{treeData:e.groupTreeData,dropdownStyle:{maxHeight:"400px",overflow:"auto"},allowClear:""}})],1)],1)],1)],1)},b=[],g=a("2ef0"),y=a.n(g),_={props:{groupList:{type:Array,required:!0}},data:function(){return{title:"",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),record:{},groupTreeData:[]}},methods:{edit:function(e){this.visible=!0,this.record=e,this.getGroupList(),this.setFieldsValue()},setFieldsValue:function(){var e=this,t=this.$nextTick,a=this.form.setFieldsValue;t((function(){a(y.a.pick(e.record,["file_name","group_id"]))}))},getGroupList:function(){this.groupTreeData.length<=0&&(this.groupTreeData=[{title:"未分组",key:0,value:0}].concat(this.groupList))},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){e||(a.status=a.status?1:0,t.onFormSubmit(a))}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,o["b"]({fileId:this.record["file_id"],form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},w=_,x=Object(f["a"])(w,v,b,!1,null,null,null),C=x.exports,L=a("b7ea"),S=a("71b5"),F=a("c9cc"),k={name:"Index",components:{STable:l["c"],MoveGroupForm:p,EditForm:C},data:function(){var e=this;return{FileTypeEnum:L["a"],StorageEnum:S["a"],ChannelEnum:F["a"],searchForm:this.$form.createForm(this),queryParam:{fileType:-1},isLoading:!1,columns:[{title:"文件ID",dataIndex:"file_id"},{title:"文件预览",dataIndex:"preview_url",scopedSlots:{customRender:"preview_url"}},{title:"文件名称",width:"260px",dataIndex:"file_name",scopedSlots:{customRender:"file_name"}},{title:"存储方式",dataIndex:"storage",scopedSlots:{customRender:"storage"}},{title:"文件类型",dataIndex:"file_type",scopedSlots:{customRender:"file_type"}},{title:"文件大小(字节)",dataIndex:"file_size"},{title:"文件后缀",dataIndex:"file_ext"},{title:"上传时间",width:"180px",dataIndex:"create_time"},{title:"操作",dataIndex:"action",width:"150px",fixed:"right",scopedSlots:{customRender:"action"}}],selectedRowKeys:[],loadData:function(t){return o["c"](Object(i["a"])(Object(i["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))},groupListTree:[],groupListTreeSelect:[]}},created:function(){this.getGroupList()},computed:{rowSelection:function(){return{selectedRowKeys:this.selectedRowKeys,onChange:this.onSelectChange}}},methods:{onSelectChange:function(e){this.selectedRowKeys=e},handleTabs:function(e){this.queryParam.fileType=e.target.value,this.handleRefresh()},handleSearch:function(e){var t=this;e.preventDefault(),this.searchForm.validateFields((function(e,a){e||(t.queryParam=Object(i["a"])(Object(i["a"])({},t.queryParam),a),t.handleRefresh())}))},handleReset:function(){this.selectedRowKeys=[],this.searchForm.resetFields()},getGroupList:function(){var e=this;this.isLoading=!0,s["d"]().then((function(t){var a=t.data.list,r=e.formatTreeData(a);e.groupListTree=r,e.groupListTreeSelect=[{title:"全部",key:-1,value:-1},{title:"未分组",key:0,value:0}].concat(r)})).finally((function(){return e.isLoading=!1}))},formatTreeData:function(e){var t=this,a=[];return e.forEach((function(e){var r={title:e.name,key:e.group_id,value:e.group_id};e.children&&e.children.length&&(r["children"]=t.formatTreeData(e["children"])),a.push(r)})),a},handleEdit:function(e){this.$refs.EditForm.edit(e)},handleDelete:function(e){this.onDelete([e["file_id"]])},handleBatchDelete:function(){this.onDelete(this.selectedRowKeys)},onDelete:function(e){var t=this,a=this.$confirm({title:"您确定要删除该文件吗?",content:"删除后不可恢复,请谨慎操作",onOk:function(){return o["a"]({fileIds:e}).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).catch((function(){return!0})).finally((function(e){return a.destroy()}))}})},handleBatchMove:function(){this.$refs.MoveGroupForm.show(this.selectedRowKeys)},handleRefresh:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];this.selectedRowKeys=[],this.$refs.table.refresh(e)}}},I=k,O=(a("7d8b"),Object(f["a"])(I,r,n,!1,null,"3a09562e",null));t["default"]=O.exports},3226:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("div",{staticClass:"table-operator"},[t("a-button",{directives:[{name:"action",rawName:"v-action:add",arg:"add"}],attrs:{type:"primary",icon:"plus"},on:{click:function(t){return e.handleAdd()}}},[e._v("新增")])],1),e.isLoading?e._e():t("a-table",{attrs:{rowKey:"category_id",columns:e.columns,dataSource:e.categoryList,defaultExpandAllRows:!0,expandIconColumnIndex:1,pagination:!1,loading:e.isLoading},scopedSlots:e._u([{key:"status",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:a?"green":""}},[e._v(e._s(a?"显示":"隐藏"))])],1)}},{key:"action",fn:function(a,r){return t("span",{staticClass:"actions"},[t("a",{directives:[{name:"action",rawName:"v-action:edit",arg:"edit"}],on:{click:function(t){return e.handleEdit(r)}}},[e._v("编辑")]),t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete(r)}}},[e._v("删除")])])}}],null,!1,1870309169)}),t("AddForm",{ref:"AddForm",on:{handleSubmit:e.handleRefresh}}),t("EditForm",{ref:"EditForm",on:{handleSubmit:e.handleRefresh}})],1)},n=[],i=(a("d3b7"),a("89a2")),o=a("2af9"),s=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:"新增文章分类",width:620,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"分类名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}]})],1),t("a-form-item",{attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端是否展示"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("显示")]),t("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入至少1个数字' }] }]"}],attrs:{min:0}})],1)],1)],1)],1)},l=[],c={data:function(){return{title:"",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this)}},methods:{add:function(){this.visible=!0},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){e||t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,i["a"]({form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){return t.confirmLoading=!1}))}}},u=c,d=a("2877"),m=Object(d["a"])(u,s,l,!1,null,null,null),f=m.exports,h=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:"编辑文章分类",width:620,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1,destroyOnClose:!0},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"分类名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}]})],1),t("a-form-item",{attrs:{label:"状态",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户端是否展示"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("显示")]),t("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入至少1个数字' }] }]"}],attrs:{min:0}})],1)],1)],1)],1)},p=[],v=a("88bc"),b=a.n(v),g={data:function(){return{title:"",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),record:{}}},methods:{edit:function(e){this.visible=!0,this.record=e,this.setFieldsValue()},setFieldsValue:function(){var e=this,t=this.$nextTick,a=this.form.setFieldsValue;t((function(){a(b()(e.record,["name","status","sort"]))}))},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){e||t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,i["c"](this.record["category_id"],{form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){return t.confirmLoading=!1}))}}},y=g,_=Object(d["a"])(y,h,p,!1,null,null,null),w=_.exports,x={name:"Index",components:{STable:o["c"],AddForm:f,EditForm:w},data:function(){return{categoryList:[],queryParam:{},isLoading:!1,columns:[{title:"分类ID",dataIndex:"category_id"},{title:"分类名称",dataIndex:"name"},{title:"状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"排序",dataIndex:"sort"},{title:"添加时间",dataIndex:"create_time"},{title:"操作",dataIndex:"action",width:"180px",scopedSlots:{customRender:"action"}}]}},created:function(){this.getCategoryList(!0)},methods:{getCategoryList:function(e){var t=this;e&&(this.isLoading=!0),i["d"]().then((function(e){t.categoryList=e.data.list})).finally((function(){return t.isLoading=!1}))},handleAdd:function(){this.$refs.AddForm.add()},handleEdit:function(e){this.$refs.EditForm.edit(e)},handleDelete:function(e){var t=this,a=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return i["b"](e["category_id"]).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){return a.destroy()}))}})},handleRefresh:function(){this.getCategoryList()}}},C=x,L=Object(d["a"])(C,r,n,!1,null,null,null);t["default"]=L.exports},4639:function(e,t,a){"use strict";a("b3ec")},"4a98":function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("div",{staticClass:"table-operator"},[t("a-row",{staticClass:"row-item-search"},[t("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[t("a-form-item",{attrs:{label:"会员昵称"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["search"],expression:"['search']"}],attrs:{placeholder:"请输入会员昵称"}})],1),t("a-form-item",{attrs:{label:"余额变动场景"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["scene",{initialValue:0}],expression:"['scene', { initialValue: 0 }]"}]},[t("a-select-option",{attrs:{value:0}},[e._v("全部")]),e._l(e.SceneEnum.data,(function(a,r){return t("a-select-option",{key:r,attrs:{value:a.value}},[e._v(e._s(a.name))])}))],2)],1),t("a-form-item",{attrs:{label:"变动时间"}},[t("a-range-picker",{directives:[{name:"decorator",rawName:"v-decorator",value:["betweenTime"],expression:"['betweenTime']"}],attrs:{format:"YYYY-MM-DD"}})],1),t("a-form-item",{staticClass:"search-btn"},[t("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1)],1)],1)],1),t("s-table",{ref:"table",attrs:{rowKey:"log_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pageSize:15},scopedSlots:e._u([{key:"user",fn:function(e){return t("span",{},[t("UserItem",{attrs:{user:e}})],1)}},{key:"scene",fn:function(a){return t("span",{},[t("a-tag",[e._v(e._s(e.SceneEnum[a].name))])],1)}},{key:"remark",fn:function(a){return t("span",{},[t("a-tooltip",[a?t("template",{slot:"title"},[e._v(e._s(a||"--"))]):e._e(),t("p",{staticClass:"twoline-hide",staticStyle:{width:"150px"}},[e._v(e._s(a||"--"))])],2)],1)}}])})],1)},n=[],i=a("5530"),o=a("b775"),s={log:"/user.balance/log"};function l(e){return Object(o["b"])({url:s.log,method:"get",params:e})}var c=a("ab09"),u=a("fe7e"),d={name:"Index",components:{STable:c["b"],UserItem:c["c"]},data:function(){var e=this;return{SceneEnum:u["a"],searchForm:this.$form.createForm(this),queryParam:{},isLoading:!1,columns:[{title:"ID",dataIndex:"log_id"},{title:"会员信息",dataIndex:"user",scopedSlots:{customRender:"user"}},{title:"余额变动场景",dataIndex:"scene",scopedSlots:{customRender:"scene"}},{title:"变动金额",dataIndex:"money"},{title:"描述/说明",dataIndex:"describe"},{title:"管理员备注",dataIndex:"remark",scopedSlots:{customRender:"remark"}},{title:"变动时间",dataIndex:"create_time"}],loadData:function(t){return l(Object(i["a"])(Object(i["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},handleSearch:function(e){var t=this;e.preventDefault(),this.searchForm.validateFields((function(e,a){e||(t.queryParam=Object(i["a"])(Object(i["a"])({},t.queryParam),a),t.handleRefresh(!0))}))}}},m=d,f=(a("89ba"),a("2877")),h=Object(f["a"])(m,r,n,!1,null,"1b2d0b5a",null);t["default"]=h.exports},"53d2":function(e,t,a){},"66c9":function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("div",{staticClass:"table-operator"},[t("a-row",{staticClass:"row-item-search"},[t("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[t("a-form-item",{attrs:{label:"会员昵称/订单号"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["search"],expression:"['search']"}],attrs:{placeholder:"请输入会员昵称/订单号"}})],1),t("a-form-item",{attrs:{label:"充值方式"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["recharge_type",{initialValue:0}],expression:"['recharge_type', { initialValue: 0 }]"}]},[t("a-select-option",{attrs:{value:0}},[e._v("全部")]),e._l(e.RechargeTypeEnum.data,(function(a,r){return t("a-select-option",{key:r,attrs:{value:a.value}},[e._v(e._s(a.name))])}))],2)],1),t("a-form-item",{attrs:{label:"支付状态"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["pay_status",{initialValue:0}],expression:"['pay_status', { initialValue: 0 }]"}]},[t("a-select-option",{attrs:{value:0}},[e._v("全部")]),t("a-select-option",{attrs:{value:10}},[e._v("待支付")]),t("a-select-option",{attrs:{value:20}},[e._v("已支付")])],1)],1),t("a-form-item",{attrs:{label:"付款时间"}},[t("a-range-picker",{directives:[{name:"decorator",rawName:"v-decorator",value:["betweenTime"],expression:"['betweenTime']"}],attrs:{format:"YYYY-MM-DD"}})],1),t("a-form-item",{staticClass:"search-btn"},[t("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1)],1)],1)],1),t("s-table",{ref:"table",attrs:{rowKey:"order_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pageSize:15},scopedSlots:e._u([{key:"user",fn:function(e){return t("span",{},[t("UserItem",{attrs:{user:e}})],1)}},{key:"order_plan",fn:function(a){return t("span",{},[a?t("a-tag",[e._v(e._s(a.plan_name))]):t("span",[e._v("--")])],1)}},{key:"recharge_type",fn:function(a){return t("span",{},[t("a-tag",[e._v(e._s(e.RechargeTypeEnum[a].name))])],1)}},{key:"pay_status",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:20==a?"green":""}},[e._v(e._s(20==a?"已支付":"待支付"))])],1)}}])})],1)},n=[],i=a("5530"),o=a("b775"),s={order:"/user.recharge/order"};function l(e){return Object(o["b"])({url:s.order,method:"get",params:e})}var c=a("ab09"),u=a("5c06"),d=new u["a"]([{key:"PENDING",name:"待支付",value:10},{key:"SUCCESS",name:"支付成功",value:20}]),m=new u["a"]([{key:"CUSTOM",name:"自定义金额",value:10},{key:"PLAN",name:"套餐充值",value:20}]),f={name:"Index",components:{STable:c["b"],UserItem:c["c"]},data:function(){var e=this;return{PayStatusEnum:d,RechargeTypeEnum:m,searchForm:this.$form.createForm(this),queryParam:{},isLoading:!1,columns:[{title:"ID",dataIndex:"order_id"},{title:"会员信息",dataIndex:"user",scopedSlots:{customRender:"user"}},{title:"订单号",dataIndex:"order_no"},{title:"充值方式",dataIndex:"recharge_type",scopedSlots:{customRender:"recharge_type"}},{title:"套餐名称",dataIndex:"order_plan",scopedSlots:{customRender:"order_plan"}},{title:"支付金额",dataIndex:"pay_price"},{title:"赠送金额",dataIndex:"gift_money"},{title:"支付状态",dataIndex:"pay_status",scopedSlots:{customRender:"pay_status"}},{title:"付款时间",dataIndex:"pay_time"},{title:"创建时间",dataIndex:"create_time"}],loadData:function(t){return l(Object(i["a"])(Object(i["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},handleSearch:function(e){var t=this;e.preventDefault(),this.searchForm.validateFields((function(e,a){e||(t.queryParam=Object(i["a"])(Object(i["a"])({},t.queryParam),a),t.handleRefresh(!0))}))}}},h=f,p=(a("7c13"),a("2877")),v=Object(p["a"])(h,r,n,!1,null,"e7f9db82",null);t["default"]=v.exports},"71b5":function(e,t,a){"use strict";var r=a("5c06");t["a"]=new r["a"]([{key:"LOCAL",name:"本地",value:"local"},{key:"QINIU",name:"七牛云",value:"qiniu"},{key:"ALIYUN",name:"阿里云",value:"aliyun"},{key:"QCLOUD",name:"腾讯云",value:"qcloud"},{key:"EXTERNAL",name:"外部链接",value:"external",hide:!0}])},"75e0":function(e,t,a){},"7c13":function(e,t,a){"use strict";a("0fc8")},"7d8b":function(e,t,a){"use strict";a("53d2")},"87e8":function(e,t,a){},"88bc":function(e,t,a){(function(t){var a=1/0,r=9007199254740991,n="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",s="[object Symbol]",l="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,u=l||c||Function("return this")();function d(e,t,a){switch(a.length){case 0:return e.call(t);case 1:return e.call(t,a[0]);case 2:return e.call(t,a[0],a[1]);case 3:return e.call(t,a[0],a[1],a[2])}return e.apply(t,a)}function m(e,t){var a=-1,r=e?e.length:0,n=Array(r);while(++a<r)n[a]=t(e[a],a,e);return n}function f(e,t){var a=-1,r=t.length,n=e.length;while(++a<r)e[n+a]=t[a];return e}var h=Object.prototype,p=h.hasOwnProperty,v=h.toString,b=u.Symbol,g=h.propertyIsEnumerable,y=b?b.isConcatSpreadable:void 0,_=Math.max;function w(e,t,a,r,n){var i=-1,o=e.length;a||(a=S),n||(n=[]);while(++i<o){var s=e[i];t>0&&a(s)?t>1?w(s,t-1,a,r,n):f(n,s):r||(n[n.length]=s)}return n}function x(e,t){return e=Object(e),C(e,t,(function(t,a){return a in e}))}function C(e,t,a){var r=-1,n=t.length,i={};while(++r<n){var o=t[r],s=e[o];a(s,o)&&(i[o]=s)}return i}function L(e,t){return t=_(void 0===t?e.length-1:t,0),function(){var a=arguments,r=-1,n=_(a.length-t,0),i=Array(n);while(++r<n)i[r]=a[t+r];r=-1;var o=Array(t+1);while(++r<t)o[r]=a[r];return o[t]=i,d(e,this,o)}}function S(e){return I(e)||k(e)||!!(y&&e&&e[y])}function F(e){if("string"==typeof e||$(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function k(e){return j(e)&&p.call(e,"callee")&&(!g.call(e,"callee")||v.call(e)==n)}var I=Array.isArray;function O(e){return null!=e&&N(e.length)&&!q(e)}function j(e){return E(e)&&O(e)}function q(e){var t=D(e)?v.call(e):"";return t==i||t==o}function N(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function D(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function E(e){return!!e&&"object"==typeof e}function $(e){return"symbol"==typeof e||E(e)&&v.call(e)==s}var R=L((function(e,t){return null==e?{}:x(e,m(w(t,1),F))}));e.exports=R}).call(this,a("c8ba"))},"89a2":function(e,t,a){"use strict";a.d(t,"d",(function(){return i})),a.d(t,"a",(function(){return o})),a.d(t,"c",(function(){return s})),a.d(t,"b",(function(){return l}));var r=a("b775"),n={list:"/content.article.category/list",add:"/content.article.category/add",edit:"/content.article.category/edit",delete:"/content.article.category/delete"};function i(e){return Object(r["b"])({url:n.list,method:"get",params:e})}function o(e){return Object(r["b"])({url:n.add,method:"post",data:e})}function s(e,t){return Object(r["b"])({url:n.edit,method:"post",params:{categoryId:e},data:t})}function l(e,t){return Object(r["b"])({url:n.delete,method:"post",params:{categoryId:e},data:t})}},"89ba":function(e,t,a){"use strict";a("0d7a")},"92eb":function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("a-spin",{attrs:{spinning:e.isLoading}},[t("a-form",{attrs:{form:e.form,labelCol:e.labelCol,wrapperCol:e.wrapperCol},on:{submit:e.handleSubmit}},[t("a-form-item",{attrs:{label:"文章标题"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["title",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['title', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}]})],1),t("a-form-item",{attrs:{label:"文章分类"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["category_id",{initialValue:0,rules:[{required:!0,message:"请选择文章分类"}]}],expression:"['category_id', { initialValue: 0, rules: [{ required: true, message: '请选择文章分类' }] }]"}],staticStyle:{width:"300px"}},[t("a-select-option",{attrs:{value:0}},[e._v("无分类")]),e._l(e.categoryList,(function(a,r){return t("a-select-option",{key:r,attrs:{value:a.category_id}},[e._v(e._s(a.name))])}))],2)],1),t("a-form-item",{attrs:{label:"列表显示方式"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["show_type",{initialValue:10,rules:[{required:!0}]}],expression:"['show_type', { initialValue: 10, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:10}},[e._v("小图模式")]),t("a-radio",{attrs:{value:20}},[e._v("大图模式")])],1),t("div",{staticClass:"form-item-help"},[t("p",{staticClass:"extra"},[e._v("小图模式建议封面图尺寸:300 * 188")]),t("p",{staticClass:"extra"},[e._v("大图模式建议封面图尺寸:750 * 455")])])],1),t("a-form-item",{attrs:{label:"封面图"}},[t("SelectImage",{directives:[{name:"decorator",rawName:"v-decorator",value:["image_id",{rules:[{required:!0,message:"请选择1个封面图"}]}],expression:"['image_id', { rules: [{ required: true, message: '请选择1个封面图' }] }]"}],attrs:{defaultList:e.record.image?[e.record.image]:[]}})],1),t("a-form-item",{attrs:{label:"文章内容"}},[t("Ueditor",{directives:[{name:"decorator",rawName:"v-decorator",value:["content",{rules:[{required:!0,message:"文章内容不能为空"}]}],expression:"['content', { rules: [{ required: true, message: '文章内容不能为空' }] }]"}]})],1),t("a-form-item",{attrs:{label:"虚拟阅读量",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"用户看到的阅读量 = 实际阅读量 + 虚拟阅读量"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["virtual_views",{initialValue:100}],expression:"['virtual_views', { initialValue: 100 }]"}],attrs:{min:0}})],1),t("a-form-item",{attrs:{label:"状态",extra:"用户端是否展示"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:1,rules:[{required:!0}]}],expression:"['status', { initialValue: 1, rules: [{ required: true }] }]"}]},[t("a-radio",{attrs:{value:1}},[e._v("显示")]),t("a-radio",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{attrs:{label:"排序",extra:"数字越小越靠前"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入至少1个数字' }] }]"}],attrs:{min:0}})],1),t("a-form-item",{staticClass:"mt-20",attrs:{wrapperCol:{span:e.wrapperCol.span,offset:e.labelCol.span}}},[t("a-button",{attrs:{type:"primary","html-type":"submit",loading:e.isBtnLoading}},[e._v("提交")])],1)],1)],1)],1)},n=[],i=a("c7eb"),o=a("1da1"),s=(a("d3b7"),a("88bc")),l=a.n(s),c=a("2af9"),u=a("b63a"),d=a("89a2"),m={components:{SelectImage:c["f"],Ueditor:c["i"]},data:function(){return{isLoading:!1,isBtnLoading:!1,labelCol:{span:4},wrapperCol:{span:13},form:this.$form.createForm(this),categoryList:[],articleId:null,record:{}}},created:function(){var e=this;return Object(o["a"])(Object(i["a"])().mark((function t(){return Object(i["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.articleId=e.$route.query.articleId,t.next=3,e.getCategoryList();case 3:return t.next=5,e.getDetail();case 5:case"end":return t.stop()}}),t)})))()},methods:{getDetail:function(){var e=this;return Object(o["a"])(Object(i["a"])().mark((function t(){return Object(i["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.isLoading=!0,t.next=3,u["c"](e.articleId).then((function(t){e.record=t.data.detail,e.setFieldsValue()})).finally((function(t){return e.isLoading=!1}));case 3:case"end":return t.stop()}}),t)})))()},getCategoryList:function(){var e=this;return Object(o["a"])(Object(i["a"])().mark((function t(){return Object(i["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.isLoading=!0,t.next=3,d["d"]().then((function(t){return e.categoryList=t.data.list})).finally((function(){return e.isLoading=!1}));case 3:case"end":return t.stop()}}),t)})))()},setFieldsValue:function(){var e=this,t=this.form.setFieldsValue;this.$nextTick((function(){t(l()(e.record,["title","show_type","category_id","image_id","content","sort","status","virtual_views"]))}))},handleSubmit:function(e){e.preventDefault();var t=this.form.validateFields,a=this.onFormSubmit;t((function(e,t){!e&&a(t)}))},onFormSubmit:function(e){var t=this;this.isLoading=!0,this.isBtnLoading=!0,u["d"](this.articleId,{form:e}).then((function(e){t.$message.success(e.message,1.5),setTimeout((function(){return t.$router.push("./index")}),1500)})).catch((function(){return t.isBtnLoading=!1})).finally((function(){return t.isLoading=!1}))}}},f=m,h=(a("cfd2"),a("2877")),p=Object(h["a"])(f,r,n,!1,null,"71c15334",null);t["default"]=p.exports},"98bf":function(e,t,a){"use strict";a.r(t);a("b0c0");var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("div",{staticClass:"table-operator"},[t("a-row",{staticClass:"row-item-search"},[t("a-form",{staticClass:"search-form",attrs:{form:e.searchForm,layout:"inline"},on:{submit:e.handleSearch}},[t("a-form-item",{attrs:{label:"文章标题"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["title"],expression:"['title']"}],attrs:{placeholder:"请输入文章标题"}})],1),t("a-form-item",{attrs:{label:"文章分类"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["categoryId",{initialValue:-1}],expression:"['categoryId', { initialValue: -1 }]"}]},[t("a-select-option",{attrs:{value:-1}},[e._v("全部")]),e._l(e.categoryList,(function(a,r){return t("a-select-option",{key:r,attrs:{value:a.category_id}},[e._v(e._s(a.name))])}))],2)],1),t("a-form-item",{attrs:{label:"状态"}},[t("a-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:-1}],expression:"['status', { initialValue: -1 }]"}]},[t("a-select-option",{attrs:{value:-1}},[e._v("全部")]),t("a-select-option",{attrs:{value:1}},[e._v("显示")]),t("a-select-option",{attrs:{value:0}},[e._v("隐藏")])],1)],1),t("a-form-item",{staticClass:"search-btn"},[t("a-button",{attrs:{type:"primary",icon:"search","html-type":"submit"}},[e._v("搜索")])],1)],1)],1),t("div",{staticClass:"row-item-tab clearfix"},[e.$auth("/content/article/create")?t("a-button",{attrs:{type:"primary",icon:"plus"},on:{click:function(t){return e.handleAdd()}}},[e._v("新增")]):e._e()],1)],1),t("s-table",{ref:"table",attrs:{rowKey:"article_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pageSize:15,scroll:{x:1400}},scopedSlots:e._u([{key:"image_url",fn:function(e){return t("span",{},[t("a",{attrs:{title:"点击查看原图",href:e,target:"_blank"}},[t("img",{attrs:{height:"50",src:e,alt:"封面图"}})])])}},{key:"stitle",fn:function(a){return t("span",{},[t("p",{staticClass:"twoline-hide",staticStyle:{width:"270px"}},[e._v(e._s(a))])])}},{key:"category",fn:function(a){return t("span",{},[e._v(e._s(a?a.name:"--"))])}},{key:"status",fn:function(a){return t("span",{},[t("a-tag",{attrs:{color:a?"green":""}},[e._v(e._s(a?"显示":"隐藏"))])],1)}},{key:"action",fn:function(a,r){return t("span",{staticClass:"actions"},[e.$auth("/content/article/update")?t("a",{on:{click:function(t){return e.handleEdit(r)}}},[e._v("编辑")]):e._e(),t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete(r)}}},[e._v("删除")])])}}])})],1)},n=[],i=a("5530"),o=(a("d3b7"),a("2af9")),s=a("b63a"),l=a("89a2"),c=[{title:"ID",dataIndex:"article_id"},{title:"封面图",dataIndex:"image_url",scopedSlots:{customRender:"image_url"}},{title:"文章标题",dataIndex:"title",width:"320px",scopedSlots:{customRender:"stitle"}},{title:"所属分类",dataIndex:"category",scopedSlots:{customRender:"category"}},{title:"实际阅读量",dataIndex:"actual_views"},{title:"状态",dataIndex:"status",scopedSlots:{customRender:"status"}},{title:"排序",dataIndex:"sort"},{title:"创建时间",width:"180px",dataIndex:"create_time"},{title:"更新时间",width:"180px",dataIndex:"update_time"},{title:"操作",dataIndex:"action",width:"150px",fixed:"right",scopedSlots:{customRender:"action"}}],u={name:"Index",components:{STable:o["c"]},data:function(){var e=this;return{isLoading:!1,searchForm:this.$form.createForm(this),categoryList:[],queryParam:{},columns:c,loadData:function(t){return s["e"](Object(i["a"])(Object(i["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){this.getCategoryList()},methods:{getCategoryList:function(){var e=this;this.isLoading=!0,l["d"]().then((function(t){return e.categoryList=t.data.list})).finally((function(){return e.isLoading=!1}))},handleSearch:function(e){var t=this;e.preventDefault(),this.searchForm.validateFields((function(e,a){e||(t.queryParam=Object(i["a"])(Object(i["a"])({},t.queryParam),a),t.handleRefresh(!0))}))},handleDelete:function(e){var t=this,a=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return s["b"](e.article_id).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){return a.destroy()}))}})},handleAdd:function(){this.$router.push("./create")},handleEdit:function(e){this.$router.push({path:"./update",query:{articleId:e.article_id}})},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)}}},d=u,m=(a("4639"),a("2877")),f=Object(m["a"])(d,r,n,!1,null,"14d6f874",null);t["default"]=f.exports},"9b89":function(e,t,a){"use strict";a("75e0")},a9fb:function(e,t,a){"use strict";a("e2f9")},b3ec:function(e,t,a){},b63a:function(e,t,a){"use strict";a.d(t,"e",(function(){return o})),a.d(t,"c",(function(){return s})),a.d(t,"a",(function(){return l})),a.d(t,"d",(function(){return c})),a.d(t,"b",(function(){return u}));var r=a("5530"),n=a("b775"),i={list:"/content.article/list",detail:"/content.article/detail",add:"/content.article/add",edit:"/content.article/edit",delete:"/content.article/delete"};function o(e){return Object(n["b"])({url:i.list,method:"get",params:e})}function s(e,t){return Object(n["b"])({url:i.detail,method:"get",params:Object(r["a"])({articleId:e},t)})}function l(e){return Object(n["b"])({url:i.add,method:"post",data:e})}function c(e,t){return Object(n["b"])({url:i.edit,method:"post",params:{articleId:e},data:t})}function u(e,t){return Object(n["b"])({url:i.delete,method:"post",params:{articleId:e},data:t})}},bae3:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("div",{staticClass:"table-operator"},[t("a-button",{directives:[{name:"action",rawName:"v-action:add",arg:"add"}],attrs:{type:"primary",icon:"plus"},on:{click:e.handleAdd}},[e._v("新增")])],1),e.isLoading?e._e():t("a-table",{attrs:{rowKey:"group_id",columns:e.columns,dataSource:e.groupList,defaultExpandAllRows:!0,expandIconColumnIndex:1,pagination:!1,loading:e.isLoading},scopedSlots:e._u([{key:"action",fn:function(a,r){return t("span",{},[t("a",{directives:[{name:"action",rawName:"v-action:edit",arg:"edit"}],staticStyle:{"margin-right":"8px"},on:{click:function(t){return e.handleEdit(r)}}},[e._v("编辑")]),t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete(r)}}},[e._v("删除")])])}}],null,!1,1130629880)}),t("AddForm",{ref:"AddForm",attrs:{groupList:e.groupList},on:{handleSubmit:e.handleRefresh}}),t("EditForm",{ref:"EditForm",attrs:{groupList:e.groupList},on:{handleSubmit:e.handleRefresh}})],1)},n=[],i=(a("d3b7"),a("9aca")),o=a("2af9"),s=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:"新增文件分组",width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"分组名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}]})],1),t("a-form-item",{attrs:{label:"上级分组",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["parent_id",{initialValue:0}],expression:"['parent_id', { initialValue: 0 }]"}],attrs:{treeData:e.groupListTree,dropdownStyle:{maxHeight:"400px",overflow:"auto"},allowClear:""}})],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入至少1个数字' }] }]"}],attrs:{min:0}})],1)],1)],1)],1)},l=[],c=(a("99af"),a("159b"),a("b0c0"),{props:{groupList:{type:Array,required:!0}},data:function(){return{title:"",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),groupListTree:[]}},methods:{add:function(){this.visible=!0,this.getGroupList()},getGroupList:function(){var e=this.groupList;this.groupListTree=[{title:"顶级分组",key:0,value:0}].concat(this.formatTreeData(e))},formatTreeData:function(e){var t=this,a=[];return e.forEach((function(e){var r={title:e.name,key:e.group_id,value:e.group_id};e.children&&e.children.length&&(r["children"]=t.formatTreeData(e["children"],r.disabled)),a.push(r)})),a},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){e||t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,i["a"]({form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}}),u=c,d=a("2877"),m=Object(d["a"])(u,s,l,!1,null,null,null),f=m.exports,h=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:"编辑文件分组",width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"分组名称",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["name",{rules:[{required:!0,min:2,message:"请输入至少2个字符"}]}],expression:"['name', { rules: [{ required: true, min: 2, message: '请输入至少2个字符' }] }]"}]})],1),t("a-form-item",{attrs:{label:"上级分组",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-tree-select",{directives:[{name:"decorator",rawName:"v-decorator",value:["parent_id"],expression:"['parent_id']"}],attrs:{treeData:e.groupListTree,dropdownStyle:{maxHeight:"400px",overflow:"auto"},allowClear:""}})],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入至少1个数字"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入至少1个数字' }] }]"}],attrs:{min:0}})],1)],1)],1)],1)},p=[],v=(a("caad"),a("2532"),a("2ef0")),b=a.n(v),g={props:{groupList:{type:Array,required:!0}},data:function(){return{title:"",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),record:{},groupListTree:[]}},methods:{edit:function(e){this.visible=!0,this.record=e,this.getGroupList(),this.setFieldsValue()},setFieldsValue:function(){var e=this,t=this.$nextTick,a=this.form.setFieldsValue;t((function(){a(b.a.pick(e.record,["name","parent_id","sort"]))}))},getGroupList:function(){var e=this.groupList,t=this.formatTreeData(e);t.unshift({title:"顶级分组",key:0,value:0}),this.groupListTree=t},formatTreeData:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=[];return e.forEach((function(e){var n={title:e.name,key:e.group_id,value:e.group_id};([e.group_id,e.parent_id].includes(t.record.group_id)||!0===a)&&(n.disabled=!0),e.children&&e.children.length&&(n["children"]=t.formatTreeData(e["children"],n.disabled)),r.push(n)})),r},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){e||t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,i["c"]({groupId:this.record["group_id"],form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(e){t.confirmLoading=!1}))}}},y=g,_=Object(d["a"])(y,h,p,!1,null,null,null),w=_.exports,x={name:"Index",components:{STable:o["c"],AddForm:f,EditForm:w},data:function(){return{groupList:[],queryParam:{},isLoading:!1,columns:[{title:"分组ID",dataIndex:"group_id"},{title:"分组名称",dataIndex:"name"},{title:"排序",dataIndex:"sort"},{title:"添加时间",dataIndex:"create_time"},{title:"操作",dataIndex:"action",width:"180px",scopedSlots:{customRender:"action"}}]}},created:function(){this.getGroupList()},methods:{getGroupList:function(){var e=this;this.isLoading=!0,i["d"]().then((function(t){e.groupList=t.data.list})).finally((function(){return e.isLoading=!1}))},handleAdd:function(){this.$refs.AddForm.add()},handleEdit:function(e){this.$refs.EditForm.edit(e)},handleDelete:function(e){var t=this,a=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return i["b"]({groupId:e["group_id"]}).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){return a.destroy()}))}})},handleRefresh:function(){this.getGroupList()}}},C=x,L=Object(d["a"])(C,r,n,!1,null,null,null);t["default"]=L.exports},c7eb:function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));a("a4d3"),a("e01a"),a("d3b7"),a("d28b"),a("3ca3"),a("ddb0"),a("b636"),a("944a"),a("0c47"),a("23dc"),a("3410"),a("159b"),a("b0c0"),a("131a"),a("fb6a");var r=a("53ca");function n(){
  2. /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
  3. n=function(){return e};var e={},t=Object.prototype,a=t.hasOwnProperty,i=Object.defineProperty||function(e,t,a){e[t]=a.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",l=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(e,t,a){return Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(j){u=function(e,t,a){return e[t]=a}}function d(e,t,a,r){var n=t&&t.prototype instanceof h?t:h,o=Object.create(n.prototype),s=new k(r||[]);return i(o,"_invoke",{value:C(e,a,s)}),o}function m(e,t,a){try{return{type:"normal",arg:e.call(t,a)}}catch(j){return{type:"throw",arg:j}}}e.wrap=d;var f={};function h(){}function p(){}function v(){}var b={};u(b,s,(function(){return this}));var g=Object.getPrototypeOf,y=g&&g(g(I([])));y&&y!==t&&a.call(y,s)&&(b=y);var _=v.prototype=h.prototype=Object.create(b);function w(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function x(e,t){function n(i,o,s,l){var c=m(e[i],e,o);if("throw"!==c.type){var u=c.arg,d=u.value;return d&&"object"==Object(r["a"])(d)&&a.call(d,"__await")?t.resolve(d.__await).then((function(e){n("next",e,s,l)}),(function(e){n("throw",e,s,l)})):t.resolve(d).then((function(e){u.value=e,s(u)}),(function(e){return n("throw",e,s,l)}))}l(c.arg)}var o;i(this,"_invoke",{value:function(e,a){function r(){return new t((function(t,r){n(e,a,t,r)}))}return o=o?o.then(r,r):r()}})}function C(e,t,a){var r="suspendedStart";return function(n,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===n)throw i;return O()}for(a.method=n,a.arg=i;;){var o=a.delegate;if(o){var s=L(o,a);if(s){if(s===f)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if("suspendedStart"===r)throw r="completed",a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);r="executing";var l=m(e,t,a);if("normal"===l.type){if(r=a.done?"completed":"suspendedYield",l.arg===f)continue;return{value:l.arg,done:a.done}}"throw"===l.type&&(r="completed",a.method="throw",a.arg=l.arg)}}}function L(e,t){var a=t.method,r=e.iterator[a];if(void 0===r)return t.delegate=null,"throw"===a&&e.iterator["return"]&&(t.method="return",t.arg=void 0,L(e,t),"throw"===t.method)||"return"!==a&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+a+"' method")),f;var n=m(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function F(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function I(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(a.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:O}}function O(){return{value:void 0,done:!0}}return p.prototype=v,i(_,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:p,configurable:!0}),p.displayName=u(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,u(e,c,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},w(x.prototype),u(x.prototype,l,(function(){return this})),e.AsyncIterator=x,e.async=function(t,a,r,n,i){void 0===i&&(i=Promise);var o=new x(d(t,a,r,n),i);return e.isGeneratorFunction(a)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},w(_),u(_,c,"Generator"),u(_,s,(function(){return this})),u(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),a=[];for(var r in t)a.push(r);return a.reverse(),function e(){for(;a.length;){var r=a.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=I,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(F),!e)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(a,r){return o.type="throw",o.arg=e,t.next=a,r&&(t.method="next",t.arg=void 0),!!r}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],o=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=a.call(i,"catchLoc"),l=a.call(i,"finallyLoc");if(s&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var o=i?i.completion:{};return o.type=e,o.arg=t,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.finallyLoc===e)return this.complete(a.completion,a.afterLoc),F(a),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var a=this.tryEntries[t];if(a.tryLoc===e){var r=a.completion;if("throw"===r.type){var n=r.arg;F(a)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,a){return this.delegate={iterator:I(e),resultName:t,nextLoc:a},"next"===this.method&&(this.arg=void 0),f}},e}},cfd2:function(e,t,a){"use strict";a("87e8")},d1d6:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("a-card",{attrs:{bordered:!1}},[t("div",{staticClass:"card-title"},[e._v(e._s(e.$route.meta.title))]),t("div",{staticClass:"table-operator"},[t("a-button",{directives:[{name:"action",rawName:"v-action:add",arg:"add"}],attrs:{type:"primary",icon:"plus"},on:{click:e.handleAdd}},[e._v("新增")])],1),t("s-table",{ref:"table",attrs:{rowKey:"help_id",loading:e.isLoading,columns:e.columns,data:e.loadData,pageSize:15},scopedSlots:e._u([{key:"content",fn:function(a){return t("span",{},[t("p",{staticClass:"twoline-hide",staticStyle:{width:"420px"}},[e._v(e._s(a))])])}},{key:"action",fn:function(a,r){return t("span",{},[t("a",{directives:[{name:"action",rawName:"v-action:edit",arg:"edit"}],staticStyle:{"margin-right":"8px"},on:{click:function(t){return e.handleEdit(r)}}},[e._v("编辑")]),t("a",{directives:[{name:"action",rawName:"v-action:delete",arg:"delete"}],on:{click:function(t){return e.handleDelete(r)}}},[e._v("删除")])])}}])}),t("AddForm",{ref:"AddForm",on:{handleSubmit:e.handleRefresh}}),t("EditForm",{ref:"EditForm",on:{handleSubmit:e.handleRefresh}})],1)},n=[],i=a("5530"),o=(a("d3b7"),a("b775")),s={list:"/content.help/list",detail:"/content.help/detail",add:"/content.help/add",edit:"/content.help/edit",delete:"/content.help/delete"};function l(e){return Object(o["b"])({url:s.list,method:"get",params:e})}function c(e){return Object(o["b"])({url:s.add,method:"post",data:e})}function u(e){return Object(o["b"])({url:s.edit,method:"post",data:e})}function d(e){return Object(o["b"])({url:s.delete,method:"post",data:e})}var m=a("2af9"),f=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"帮助标题",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["title",{rules:[{required:!0,message:"请输入联系人姓名"}]}],expression:"['title', { rules: [{ required: true, message: '请输入联系人姓名' }] }]"}]})],1),t("a-form-item",{attrs:{label:"帮助内容",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["content",{rules:[{required:!0,message:"请输入帮助内容"}]}],expression:"['content', { rules: [{ required: true, message: '请输入帮助内容' }] }]"}],attrs:{autoSize:{minRows:4}}})],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入排序值"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入排序值' }] }]"}],attrs:{min:0}})],1)],1)],1)],1)},h=[],p=a("88bc"),v=a.n(p),b={components:{SelectRegion:m["g"]},data:function(){return{title:"编辑帮助",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this)}},methods:{add:function(){this.visible=!0},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){!e&&t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,c({form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(){return t.confirmLoading=!1}))}}},g=b,y=a("2877"),_=Object(y["a"])(g,f,h,!1,null,null,null),w=_.exports,x=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:720,visible:e.visible,confirmLoading:e.confirmLoading,maskClosable:!1},on:{ok:e.handleSubmit,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{label:"帮助标题",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["title",{rules:[{required:!0,message:"请输入联系人姓名"}]}],expression:"['title', { rules: [{ required: true, message: '请输入联系人姓名' }] }]"}]})],1),t("a-form-item",{attrs:{label:"帮助内容",labelCol:e.labelCol,wrapperCol:e.wrapperCol}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["content",{rules:[{required:!0,message:"请输入帮助内容"}]}],expression:"['content', { rules: [{ required: true, message: '请输入帮助内容' }] }]"}],attrs:{autoSize:{minRows:4}}})],1),t("a-form-item",{attrs:{label:"排序",labelCol:e.labelCol,wrapperCol:e.wrapperCol,extra:"数字越小越靠前"}},[t("a-input-number",{directives:[{name:"decorator",rawName:"v-decorator",value:["sort",{initialValue:100,rules:[{required:!0,message:"请输入排序值"}]}],expression:"['sort', { initialValue: 100, rules: [{ required: true, message: '请输入排序值' }] }]"}],attrs:{min:0}})],1)],1)],1)],1)},C=[],L={components:{SelectRegion:m["g"]},data:function(){return{title:"编辑帮助",labelCol:{span:7},wrapperCol:{span:13},visible:!1,confirmLoading:!1,form:this.$form.createForm(this),record:{}}},methods:{edit:function(e){this.visible=!0,this.record=e,this.setFieldsValue()},setFieldsValue:function(){var e=this.record,t=this.form.setFieldsValue;this.$nextTick((function(){t(v()(e,["title","content","sort"]))}))},handleSubmit:function(e){var t=this;e.preventDefault();var a=this.form.validateFields;a((function(e,a){!e&&t.onFormSubmit(a)}))},handleCancel:function(){this.visible=!1,this.form.resetFields()},onFormSubmit:function(e){var t=this;this.confirmLoading=!0,u({helpId:this.record.help_id,form:e}).then((function(a){t.$message.success(a.message,1.5),t.handleCancel(),t.$emit("handleSubmit",e)})).finally((function(){return t.confirmLoading=!1}))}}},S=L,F=Object(y["a"])(S,x,C,!1,null,null,null),k=F.exports,I={name:"Index",components:{STable:m["c"],AddForm:w,EditForm:k},data:function(){var e=this;return{queryParam:{},isLoading:!1,columns:[{title:"帮助ID",dataIndex:"help_id"},{title:"标题",dataIndex:"title"},{title:"内容",dataIndex:"content",scopedSlots:{customRender:"content"}},{title:"排序",dataIndex:"sort"},{title:"更新时间",dataIndex:"update_time"},{title:"操作",dataIndex:"action",width:"180px",scopedSlots:{customRender:"action"}}],loadData:function(t){return l(Object(i["a"])(Object(i["a"])({},t),e.queryParam)).then((function(e){return e.data.list}))}}},created:function(){},methods:{handleAdd:function(){this.$refs.AddForm.add()},handleEdit:function(e){this.$refs.EditForm.edit(e)},handleDelete:function(e){var t=this,a=this.$confirm({title:"您确定要删除该记录吗?",content:"删除后不可恢复",onOk:function(){return d({helpId:e.help_id}).then((function(e){t.$message.success(e.message,1.5),t.handleRefresh()})).finally((function(e){return a.destroy()}))}})},handleRefresh:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.$refs.table.refresh(e)},onSearch:function(){this.handleRefresh(!0)}}},O=I,j=Object(y["a"])(O,r,n,!1,null,null,null);t["default"]=j.exports},e2f9:function(e,t,a){},fe7e:function(e,t,a){"use strict";var r=a("5c06");t["a"]=new r["a"]([{key:"RECHARGE",name:"用户充值",value:10},{key:"CONSUME",name:"用户消费",value:20},{key:"ADMIN",name:"管理员操作",value:30},{key:"REFUND",name:"订单退款",value:40}])}}]);