chunk-0cf2b486.7f002a61.js 5.9 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0cf2b486"],{"4fef":function(t,e,a){"use strict";var i=a("ade3"),n=a("5530");a("1276"),a("ac1f"),a("a9e3");e["a"]={data:function(){return{listLoading:!1,tableData:[],currentPage:1,pageSize:10,totalRecords:1,listConfig:{},operations:[]}},created:function(){var t=this;this.$nextTick((function(){t.noCreated||t.fetchData()}))},methods:{searchHandle:function(t){this.currentPage=1,this.searchForm=t,this.fetchData()},sizeChange:function(t){this.pageSize=t,this.currentPage=1,this.fetchData()},pageHandle:function(t){this.currentPage=t,this.fetchData()},sortChange:function(t){this.currentPage=1;var e=Object(n["a"])({},this.searchForm);"ascending"===t.order?e.sort=JSON.stringify(Object(i["a"])({},t.prop,"asc")):e.sort=JSON.stringify(Object(i["a"])({},t.prop,"desc")),this.fetchData(e)},fetchData:function(t){var e=this;if(this.apiStr){var a={page:this.currentPage,page_size:this.pageSize};t?a=Object(n["a"])(Object(n["a"])({},a),t):this.searchForm&&(a=Object(n["a"])(Object(n["a"])({},a),this.searchForm)),this.getDataBefore&&this.getDataBefore(a),this.listLoading=!0;var i=this.apiStr.split(".");this.$api[i[0]][i[1]](a).then((function(t){return 1===e.currentPage&&(e.pageSize=t.page_size||1),e.totalRecords=t.total?Number(t.total):0,e.tableData=t.list||[],e.listLoading=!1,e.getMoreData&&e.getMoreData(t,a),t})).catch((function(t){e.listLoading=!1}))}}}}},c988:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("search-form",{attrs:{"list-loading":t.listLoading},on:{change:t.searchHandle}}),a("table-list",{attrs:{"list-loading":t.listLoading,data:t.tableData2,columns:t.listConfig,"current-page":t.currentPage,"page-size":t.pageSize,"total-records":t.totalRecords},on:{currentChange:t.pageHandle}}),a("popup-edit",{attrs:{isShow:t.isDtlShow,curObj:t.curObj},on:{close:t.closePopup}})],1)},n=[],s=a("2909"),o=(a("d81d"),a("1276"),a("ac1f"),a("a15b"),a("ed08")),r=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("base-form",{ref:"ruleForm",attrs:{slot:"content",data:t.searchData},slot:"content"},[a("div",{attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"xl-form-btn bgc1",attrs:{loading:t.listLoading,icon:"el-icon-search"},on:{click:t.searchHandle}},[t._v("查询")])],1)])},c=[],l=a("5530"),u={mixins:[],props:{listLoading:Boolean},inject:["parentData"],data:function(){return{searchData:[{label:"问题",key:"question_cont"},{label:"标签",key:"question_tag",type:"select",options:this.$dictData.question_tag}]}},methods:{searchHandle:function(){var t=this.$refs.ruleForm.baseForm,e=Object(l["a"])({},t);this.$emit("change",e)}}},h=u,p=a("2877"),d=Object(p["a"])(h,r,c,!1,null,null,null),f=d.exports,g=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("el-dialog",{attrs:{"show-close":!1,"close-on-click-modal":!1,visible:t.isShow,title:"查看回答",fullscreen:!1,width:"700px","custom-class":"xl-dialog",center:""},on:{"update:visible":function(e){t.isShow=e}}},[a("table-list",{attrs:{"list-loading":t.listLoading,data:t.aList,columns:t.listConfig,"current-page":t.currentPage,"page-size":t.pageSize,"total-records":t.totalRecords},on:{currentChange:t.pageHandle}}),a("div",{staticClass:"xl-form"},[a("div",{staticClass:"xl-form-footer"},[a("el-button",{staticClass:"xl-form-btn t2",on:{click:t.close}},[t._v("关 闭")])],1)])],1)],1)},b=[],m=(a("99af"),a("a9e3"),a("4fef")),w={components:{},mixins:[].concat(Object(s["a"])(mixins),[m["a"]]),props:{isShow:Boolean,curObj:Object},inject:["parentData"],data:function(){return{apiStr:"user.admanswerlist",noCreated:!0,searchForm:{},aList:[]}},mounted:function(){this.listConfig={rows:[{label:"回答内容",prop:"answer_cont",fullShow:!0,minWidth:200,align:"left"},{label:"昵称",prop:"nickname"},{label:"头像",prop:"avatar",type:"img"},{label:"回答时间",prop:"create_at"},{label:"操作",width:80,type:"handle2",operations:[{label:"删除",func:this.delHandle,btnType:"danger"}]}]}},watch:{isShow:function(t){t&&(this.searchForm={question_id:this.curObj.id},this.fetchData())}},methods:{getMoreData:function(t){var e=t.answer_list||{};this.aList=e.list||[],1===this.currentPage&&(this.pageSize=e.page_size||1),this.totalRecords=e.total?Number(e.total):0},delHandle:function(t){var e=this;this.$msg("您确定要删除该问题吗?","confirm",(function(){e.$api.user.admanswerdel({answer_id:t.answer_id}).then((function(t){e.$msgs("已删除!"),e.fetchData()}))}),null,!0)},close:function(t){this.$emit("close")}}},D=w,v=Object(p["a"])(D,g,b,!1,null,"7ceb94b4",null),_=v.exports,j={name:"index",components:{SearchForm:f,PopupEdit:_},provide:function(){return{parentData:this}},mixins:[m["a"]],data:function(){return{apiStr:"user.admquestionlist",searchForm:null,isDtlShow:!1,curObj:{}}},computed:{tableData2:function(){var t=this,e=Object(s["a"])(this.tableData);return e.map((function(e){var a=e.question_tag?e.question_tag.split(","):[],i=a.map((function(e){return Object(o["a"])(t.$dictData.question_tag)[e]}));e.qtName=i.join(",")})),e}},created:function(){},mounted:function(){this.listConfig={rows:[{label:"问题内容",prop:"question_cont",fullShow:!0,minWidth:200,align:"left"},{label:"标签",prop:"qtName"},{label:"昵称",prop:"nickname"},{label:"头像",prop:"avatar",type:"img"},{label:"提问时间",prop:"create_at"},{label:"操作",width:200,type:"handle2",operations:[{label:"查看回答",func:this.openPopup,btnType:"primary"},{label:"删除",func:this.delHandle,btnType:"danger"}]}]}},methods:{delHandle:function(t){var e=this;this.$msg("您确定要删除该问题吗?","confirm",(function(){e.$api.user.admquestiondel({question_id:t.id}).then((function(t){e.$msgs("已删除!"),e.fetchData()}))}),null,!0)},openPopup:function(t){t&&t.id?this.curObj=t:this.curObj={},this.isDtlShow=!0},closePopup:function(t){this.isDtlShow=!1}}},S=j,O=Object(p["a"])(S,i,n,!1,null,null,null);e["default"]=O.exports}}]);