chunk-ea6fc480.fac55b3c.js 11 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ea6fc480"],{"0260":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",[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,sizeChange:t.sizeChange}}),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)},s=[],n=a("2909"),o=(a("99af"),a("a9e3"),a("4fef")),r={components:{},mixins:[].concat(Object(n["a"])(mixins),[o["default"]]),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")}}},c=r,l=a("2877"),u=Object(l["a"])(c,i,s,!1,null,"05d62a71",null);e["default"]=u.exports},"06d5":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",[a("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],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("base-form",{ref:"ruleForm",staticClass:"lib-edit",attrs:{data:t.formData,"is-inline":!1,"label-width":"110px"}},[a("div",{staticStyle:{"padding-top":"20px"},attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"xl-form-btn t2",on:{click:t.close}},[t._v("关 闭")]),a("el-button",{staticClass:"xl-form-btn t1",on:{click:function(e){return t.close("confirm")}}},[t._v("确定")])],1)])],1)],1)},s=[],n=a("5530"),o={components:{},mixins:mixins,props:{isShow:Boolean,curObj:Object},inject:["parentData"],data:function(){return{formData:[],loading:!0,cObj:{},isShowMap:!1}},watch:{isShow:function(t){t&&this.getDef()}},methods:{getDef:function(){var t=!1;this.curObj.id&&(t=!0),this.formData=[{label:"问题",key:"question_cont",type:"textarea",disabled:t},{label:"回答",key:"answer_cont",type:"textarea",rules:1}],this.setDefaultValue(this.curObj)},close:function(t){var e=this;"confirm"===t?this.$refs["ruleForm"].$refs["baseForm"].validate((function(t){if(t){var a=e.$refs.ruleForm.baseForm,i=Object(n["a"])({},a);e.curObj.id&&(i.question_id=e.curObj.id);var s="admansweradd";i.id&&(s="admansweradd"),delete i.question_cont,e.$api.user[s](i).then((function(t){e.$msgs(i.id?"编辑成功":"新增成功"),e.$emit("close",i)}))}})):(this.$emit("close"),this.setDefaultValue())}}},r=o,c=(a("8cf9"),a("2877")),l=Object(c["a"])(r,i,s,!1,null,"4be186ce",null);e["default"]=l.exports},"21fb":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",[a("el-dialog",{directives:[{name:"loading",rawName:"v-loading",value:t.loading,expression:"loading"}],attrs:{"show-close":!1,"close-on-click-modal":!1,visible:t.isShow,title:t.curObj.id?"编辑问题":"新增问题",fullscreen:!1,width:"700px","custom-class":"xl-dialog",center:""},on:{"update:visible":function(e){t.isShow=e}}},[a("base-form",{ref:"ruleForm",staticClass:"lib-edit",attrs:{data:t.formData,"is-inline":!1,"label-width":"110px"}},[a("div",{staticStyle:{"padding-top":"20px"},attrs:{slot:"footer"},slot:"footer"},[a("el-button",{staticClass:"xl-form-btn t2",on:{click:t.close}},[t._v("关 闭")]),a("el-button",{staticClass:"xl-form-btn t1",on:{click:function(e){return t.close("confirm")}}},[t._v("确定")])],1)])],1)],1)},s=[],n=a("5530"),o=(a("a15b"),{components:{},mixins:mixins,props:{isShow:Boolean,curObj:Object},inject:["parentData"],data:function(){return{formData:[],loading:!0,cObj:{},isShowMap:!1}},watch:{isShow:function(t){t&&this.getDef()}},methods:{getDef:function(){this.curObj.id,this.formData=[{label:"标签",key:"question_tag",multiple:!0,rules:1,type:"select",options:this.$dictData.question_tag},{label:"问题",key:"question_cont",type:"textarea",rules:1}]},close:function(t){var e=this;"confirm"===t?this.$refs["ruleForm"].$refs["baseForm"].validate((function(t){if(t){var a=e.$refs.ruleForm.baseForm,i=Object(n["a"])({},a);e.curObj.id&&(i.id=e.curObj.id);var s="admquestionadd";i.question_tag=i.question_tag.join(","),i.id&&(s="admquestionadd"),e.$api.user[s](i).then((function(t){e.$msgs(i.id?"编辑成功":"新增成功"),e.$emit("close",i)}))}})):(this.$emit("close"),this.setDefaultValue())}}}),r=o,c=(a("84cb"),a("2877")),l=Object(c["a"])(r,i,s,!1,null,"354b5c49",null);e["default"]=l.exports},"225e":function(t,e,a){},2480: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("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("查询")]),a("el-button",{staticClass:"xl-form-btn bgc2",attrs:{loading:t.listLoading,icon:"el-icon-search"},on:{click:t.linkMore}},[t._v("最新回答列表")])],1)])},s=[],n=a("5530"),o={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:{linkMore:function(){this.$router.push("/qa/index2")},searchHandle:function(){var t=this.$refs.ruleForm.baseForm,e=Object(n["a"])({},t);this.$emit("change",e)}}},r=o,c=a("2877"),l=Object(c["a"])(r,i,s,!1,null,null,null);e["default"]=l.exports},"4fef":function(t,e,a){"use strict";a.r(e);var i=a("ade3"),s=a("5530");a("4e82"),a("e9c4"),a("a9e3");e["default"]={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(s["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.searchForm=Object(s["a"])({},e),this.fetchData(e)},fetchData:function(t){var e=this;if(this.apiStr){var a={page:this.currentPage,page_size:this.pageSize};t?a=Object(s["a"])(Object(s["a"])({},a),t):this.searchForm&&(a=Object(s["a"])(Object(s["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}))}}}}},"84cb":function(t,e,a){"use strict";a("e2ec")},"8cf9":function(t,e,a){"use strict";a("225e")},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,isAdd:!0,operationsDefaultLength:6},on:{currentChange:t.pageHandle,sizeChange:t.sizeChange,add:t.openQPopup}}),a("popup-edit",{attrs:{isShow:t.isDtlShow,curObj:t.curObj},on:{close:t.closePopup}}),a("q-edit",{attrs:{isShow:t.isQShow,curObj:t.curObj},on:{close:t.closeQPopup}}),a("a-edit",{attrs:{isShow:t.isAShow,curObj:t.curObj},on:{close:t.closeAPopup}})],1)},s=[],n=a("2909"),o=(a("d81d"),a("a15b"),a("a9e3"),a("ed08")),r=a("2480"),c=a("0260"),l=a("21fb"),u=a("06d5"),d=a("4fef"),h={name:"index",components:{SearchForm:r["default"],PopupEdit:c["default"],QEdit:l["default"],AEdit:u["default"]},provide:function(){return{parentData:this}},mixins:[d["default"]],data:function(){return{apiStr:"user.admquestionlist",searchForm:null,isDtlShow:!1,curObj:{},isQShow:!1,isAShow:!1}},computed:{tableData2:function(){var t=this,e=Object(n["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(","),2!==Number(e.hide_status)&&(e.isHide=!0)})),e}},created:function(){},mounted:function(){this.listConfig={rows:[{label:"问题内容",prop:"question_cont",fullShow:!0,minWidth:200,align:"left"},{label:"状态",prop:"hide_status",type:"tag",tags:Object(o["a"])(this.$dictData.hide_status),tagTypeObj:{1:"success",2:"danger"}},{label:"浏览量",prop:"views"},{label:"昵称",prop:"nickname"},{label:"头像",prop:"avatar",type:"img"},{label:"提问时间",prop:"create_at"},{label:"操作",width:300,type:"handle2",operations:[{label:"显示",func:this.showHandle,btnType:"success",hide:"isHide"},{label:"我来回答",func:this.openAPopup,btnType:"primary"},{label:"查看回答",func:this.openPopup,btnType:"success"},{label:"删除",func:this.delHandle,btnType:"danger"}]}]}},methods:{showHandle:function(t){var e=this;this.$api.user.admquestionshow({question_id:t.id}).then((function(t){e.$msgs("已显示!"),e.$store.dispatch("user/getNotify"),e.fetchData()}))},openQPopup:function(){this.isQShow=!0},closeQPopup:function(t){this.isQShow=!1,t&&this.fetchData()},openAPopup:function(t){t&&t.id?this.curObj=t:this.curObj={},this.isAShow=!0},closeAPopup:function(t){this.isAShow=!1,t&&this.fetchData()},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}}},f=h,p=a("2877"),b=Object(p["a"])(f,i,s,!1,null,null,null);e["default"]=b.exports},e2ec:function(t,e,a){}}]);