text: (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([[26],{XDkH:function(e,t,a){"use strict";var n=a("g09b"),d=a("tAuX");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,a("DjyN");var i=n(a("NUBc"));a("g9YV");var o=n(a("wCAj"));a("+L6B");var r=n(a("2/Rp"));a("sPJy");var s=n(a("bE4q"));a("Pwec");var l=n(a("CtXQ"));a("+BJd");var c=n(a("mr32"));a("miYZ");var u=n(a("tsqr"));a("2qtc");var f=n(a("kLXV")),m=n(a("2Taf")),p=n(a("vZ4D")),g=n(a("MhPg")),y=n(a("l4Ni")),v=n(a("ujKo"));a("y8nQ");var h=n(a("Vl3Y"));a("5NDa");var k=n(a("5rEg"));a("iQDF");var M=n(a("+eQT"));a("OaEy");var b,E,C,w,x=n(a("2fM7")),S=a("GRak"),I=(a("+n12"),a("MuoO")),L=d(a("q1tI")),_=n(a("LvDl")),N=a("LLXN"),D=(n(a("3a4m")),a("fPeI"),n(a("hodE"))),q=n(a("DWLU")),R=n(a("XIkw"));function O(e){return function(){var t,a=(0,v.default)(e);if(P()){var n=(0,v.default)(this).constructor;t=Reflect.construct(a,arguments,n)}else t=a.apply(this,arguments);return(0,y.default)(this,t)}}function P(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(e){return!1}}x.default.Option,M.default.RangePicker;var T=k.default.Search;a("wd/R");var B=(b=h.default.create(),E=(0,I.connect)(function(e){var t=e.feedbackcate,a=t.data,n=a.page,d=a.list,i=a.total_count,o=t.faqCateStatusList,r=t.posmap,s=e.routing.location.pathname,l=e.memberInfo.data.keys;return{list:d,page:n,total_count:i,faqCateStatusList:o,pathname:s,keys:l,posmap:r}}),b(C=E((w=function(e){(0,g.default)(a,e);var t=O(a);function a(e){var n;return(0,m.default)(this,a),n=t.call(this,e),n.state={pagination:{page:1,page_size:20,id:"",version:"",name:"",status:""},modifyId:"",showModelAdd:!1,showModelEdit:!1},n.addGlob=function(){n.setState({showModelAdd:!0})},n.onSearch=function(e){var t=n.state.pagination;e.trim()&&n.setState({pagination:_.default.merge({},t,{name:e})},function(){n.updataConfiList()})},n.updataConfiList=function(){var e=n.props.dispatch,t=n.state.pagination;e({type:"feedbackcate/getList",payload:t})},n.handleTableChange=function(e){var t=n.state.pagination,a=_.default.merge({},t,{page:e});n.setState({pagination:a},function(){n.updataConfiList()})},n.onChangeStatus=function(e,t){0!=t?(0,S.modifyFaqCateStatus)({status:t,id:e}).then(function(e){e.code?u.default.error(e.message):(u.default.success(e.message),n.updataConfiList())}):f.default.confirm({title:(0,N.formatMessage)({id:"app.activity.tip"}),content:(0,N.formatMessage)({id:"app.activity.sureDown"}),okText:(0,N.formatMessage)({id:"app.activity.sure"}),cancelText:(0,N.formatMessage)({id:"app.activity.cancel"}),onOk:function(){(0,S.modifyFaqCateStatus)({status:t,id:e}).then(function(e){e.code?u.default.error(e.message):(u.default.success(e.message),n.updataConfiList())})}})},n.openModel=function(e){n.setState({showModelEdit:!0,modifyId:e})},n.handleDel=function(e,t){0==t?f.default.warn({title:(0,N.formatMessage)({id:"app.activity.tip"}),content:(0,N.formatMessage)({id:"app.activity.makesureNoDel"}),okText:(0,N.formatMessage)({id:"app.activity.iknow"})}):f.default.confirm({title:(0,N.formatMessage)({id:"app.activity.tip"}),content:(0,N.formatMessage)({id:"app.activity.sureDel"}),okText:(0,N.formatMessage)({id:"app.activity.sure"}),cancelText:(0,N.formatMessage)({id:"app.activity.cancel"}),onOk:function(){(0,S.delFaqCate)({id:e}).then(function(e){e.code?u.default.error(e.message):(u.default.success(e.message),n.updataConfiList())})}})},n.closeModel=function(e){n.setState({showModelAdd:!1,showModelEdit:!1,modifyId:""}),e&&n.updataConfiList()},n.onChangeRecommend=function(e,t){var a=0==parseInt(t)?1:0;(0,S.modifyFaqCateRecommend)({id:e,is_recommend:a}).then(function(e){e.code?u.default.error(e.message):(u.default.success(e.message),n.updataConfiList())})},n}return(0,p.default)(a,[{key:"componentDidMount",value:function(){var e=this.props.dispatch;e({type:"feedbackcate/getFaqCateStatusList"}),e({type:"feedbackcate/faqCateDisplayPosMap"}),this.updataConfiList()}},{key:"render",value:function(){var e=this,t=this.props,a=t.total_count,n=t.list,d=t.faqCateStatusList,u=t.posmap,f=[{title:(0,N.formatMessage)({id:"app.feedbackcategory.id"}),dataIndex:"id",key:"id"},{title:(0,N.formatMessage)({id:"app.feedbackcategory.name"}),dataIndex:"name",key:"name",render:function(e,t){var a=function(){if(t.multi_name){var a=JSON.parse(t.multi_name).filter(function(e){return 2==e.lan});return a.length||(a=JSON.parse(t.multi_name).filter(function(e){return 0==e.lan})),a[0].name}return e};return L.default.createElement("div",null,L.default.createElement("span",{style:{marginRight:5}},a()),1==t.is_recommend?L.default.createElement(c.default,{color:"#108ee9"},(0,N.formatMessage)({id:"app.activity.recommend"})):"")}},{title:(0,N.formatMessage)({id:"app.feedbackcategory.des"}),dataIndex:"desc",key:"desc"},{title:(0,N.formatMessage)({id:"app.feedbackcategory.sort"}),dataIndex:"sort",key:"sort"},{title:(0,N.formatMessage)({id:"app.feedbackcategory.status"}),dataIndex:"status",key:"status",render:function(e,t){return d[e]}},{title:(0,N.formatMessage)({id:"app.feedbackcategory.time"}),dataIndex:"time",key:"time",render:function(e,t){return L.default.createElement("div",null,L.default.createElement("p",null,(0,N.formatMessage)({id:"app.feedbackcategory.createtime"}),"\uff1a",t.create_at),L.default.createElement("p",null,(0,N.formatMessage)({id:"app.feedbackcategory.updatetime"}),"\uff1a",t.update_at))}},{title:(0,N.formatMessage)({id:"app.faq.pos"}),dataIndex:"display_pos",key:"display_pos",width:"120",render:function(e,t){return u.length?u.reduce(function(t,a){return e.split(",").indexOf(a.value+"")>-1&&(t+=t?",".concat(a.name):a.name),t},""):""}},{title:(0,N.formatMessage)({id:"app.feedbackcategory.act"}),dataIndex:"act",key:"act",width:"300",fixed:"right",render:function(t,a){var n=Object.keys(d),i=n.filter(function(e){if(a.status!=e)return e});return L.default.createElement("p",{className:"active"},L.default.createElement("a",{onClick:e.onChangeStatus.bind(e,a["id"],i[0]),className:0==i[0]?"danger":null},d[i[0]]),L.default.createElement("a",{onClick:e.openModel.bind(e,a["id"])},(0,N.formatMessage)({id:"app.activity.edit"})),L.default.createElement("a",{onClick:e.onChangeRecommend.bind(e,a["id"],a.is_recommend),className:0==a.is_recommend?null:"danger"},0==a.is_recommend?(0,N.formatMessage)({id:"app.activity.recommend"}):(0,N.formatMessage)({id:"app.feedbackcategory.norecommend"})),L.default.createElement("a",{className:"danger",onClick:e.handleDel.bind(e,a["id"],i[0])},(0,N.formatMessage)({id:"app.activity.del"})))}}];return L.default.createElement("div",null,L.default.createElement("div",{className:D.default.breadcrumbBox},L.default.createElement(s.default,{style:{borderBottom:" 1px solid #ccc",paddingBottom:" 10px"}},L.default.createElement(s.default.Item,null,L.default.createElement(l.default,{type:"lock"}),L.default.createElement("span",null,(0,N.formatMessage)({id:"menu.feedback"}))),L.default.createElement(s.default.Item,null,(0,N.formatMessage)({id:"menu.feedback.feedbackcategory"})))),L.default.createElement("div",{className:D.default.addBtn},L.default.createElement("style",null,"\n                    .active a{\n                      margin-left:6px;\n                      text-decoration: none !important;\n                    }\n                    .active a.danger{\n                      color:#ff4d4f\n                    }\n                  "),L.default.createElement("div",null,L.default.createElement(T,{placeholder:(0,N.formatMessage)({id:"app.feedbackcategory.pleaseName"}),enterButton:(0,N.formatMessage)({id:"app.pages.search"}),size:"default",onSearch:this.onSearch})),L.default.createElement("div",{className:D.default.btnBox},L.default.createElement(r.default,{type:"primary",onClick:this.addGlob},(0,N.formatMessage)({id:"app.versions.add"}))),L.default.createElement("div",null),L.default.createElement("div",null)),L.default.createElement(o.default,{columns:f,dataSource:n,pagination:!1,scroll:{x:2e3},bordered:!0,rowKey:function(e,t){return"".concat(e.id).concat(t)}}),L.default.createElement("div",{className:D.default.rightPagination},L.default.createElement(i.default,{showTotal:function(e){return(0,N.formatMessage)({id:"app.glob.pagetotal"},{total:e})},current:1,pageSize:20,onChange:this.handleTableChange,total:a})),this.state.showModelAdd&&L.default.createElement(q.default,{onCallback:this.closeModel}),this.state.showModelEdit&&L.default.createElement(R.default,{onCallback:this.closeModel,modifyId:this.state.modifyId}))}}]),a}(L.PureComponent),C=w))||C)||C),A=B;t.default=A}}]);