text: (window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-4fd04ba3"],{"1bab":function(t,e,i){"use strict";i.d(e,"a",(function(){return s}));i("d3b7"),i("8237");var a=i("2b0e"),n=i("4328"),o=i.n(n);i("3a34");function s(t,e,i){return new Promise((function(n,s){var d={data:JSON.stringify(e)},r="60000";null!=i&&(r=i+"");var l=parseInt(r);t=t+"?"+(new Date).getTime()+Math.random()+Math.ceil(-89999*Math.random()+99999),a.default.prototype.$http.post(t,o.a.stringify(d),{timeout:l}).then((function(t){n(t)})).catch((function(t){s(t)}))}))}},5003:function(t,e,i){},"71de":function(t,e,i){"use strict";i.r(e);i("7db0"),i("a434");var a=i("1bab"),n={data:function(){var t=this;return{addPopup:!1,editPopup:!1,addloading:!1,editloading:!1,newTitle:null,addtitle:null,dataList:[{title:"我的归类",expand:!0,id:"root",render:function(e,i){i.root,i.node;var a=i.data;return e("span",{style:{display:"inline-block",width:"100%",fontSize:"18px"}},[e("span",[e("Icon",{props:{type:"md-desktop"},style:{marginRight:"8px",fontSize:"26px"}}),e("span",a.title)]),e("span",{style:{display:"inline-block",marginLeft:"12px"}},[e("Button",{props:Object.assign({},t.buttonProps,{icon:"ios-add",type:"primary"}),style:{width:"36px"},on:{click:function(){t.append(a)}}})])])},children:[]}],buttonProps:{type:"default",size:"small"},fromData:{title:null,parentid:null},addDataObj:null,editDataObj:null,delDataObj:null}},mounted:function(){this.$Spin.show(),this.getDatas()},methods:{getDatas:function(){var t=this;Object(a.a)("/admin/getClassificationList",{}).then((function(e){if(t.$Spin.hide(),200==e.status){var i=e.data.data;"200"==e.data.code?t.dataList[0].children=i:t.$Message.error(e.data.info)}else t.$Message.error("请求时出现错误")})).catch((function(e){console.log(e),t.$Message.error("服务器请求错误")}))},addClassification:function(){var t=this;if(this.addloading=!0,null==this.addtitle||""==this.addtitle)return this.$Message.warning("请输入类别名称"),!1;var e=this.addDataObj;this.addDataObj=null,this.fromData.title=null,this.fromData.parentid=null,this.fromData.title=encodeURIComponent(this.addtitle),this.fromData.parentid=e.id,Object(a.a)("/admin/addClassification",this.fromData).then((function(i){if(t.$Spin.hide(),200==i.status){var a=i.data.data;if("200"==i.data.code){var n=e.children||[];n.push({title:t.addtitle,id:a.id,expand:!0}),t.$set(e,"children",n),t.$Message.success(i.data.info),t.addPopup=!1,t.addloading=!1}else t.$Message.error(i.data.info)}else t.$Message.error("请求时出现错误")})).catch((function(e){console.log(e),t.$Message.error("服务器请求错误")}))},editClassification:function(){var t=this;if(null==this.newTitle||""==this.newTitle)return this.$Message.warning("请输入新的类别名称"),!1;var e=this.editDataObj;this.editDataObj=null;var i={title:this.newTitle,id:e.id};Object(a.a)("/admin/editClassification",i).then((function(i){if(t.$Spin.hide(),200==i.status){i.data.data;if("200"==i.data.code){e.title=t.newTitle;var a=e.children||[];t.$set(e,"children",a),t.$Message.success(i.data.info),t.editPopup=!1,t.editloading=!1}else t.$Message.error(i.data.info)}else t.$Message.error("请求时出现错误")})).catch((function(e){console.log(e),t.$Message.error("服务器请求错误")}))},renderContent:function(t,e){var i=this,a=e.root,n=e.node,o=e.data;return t("span",{style:{display:"inline-block",width:"100%",fontSize:"16px"}},[t("span",[t("Icon",{props:{type:"md-photos"},style:{marginRight:"8px",fontSize:"26px"}}),t("span",o.title)]),t("span",{style:{display:"inline-block",marginLeft:"16px"}},[t("Button",{props:Object.assign({},this.buttonProps,{icon:"md-create"}),style:{marginRight:"8px"},on:{click:function(){i.editData(o)}}}),t("Button",{props:Object.assign({},this.buttonProps,{icon:"md-add"}),style:{marginRight:"8px"},on:{click:function(){i.append(o)}}}),t("Button",{props:Object.assign({},this.buttonProps,{icon:"ios-trash"}),on:{click:function(){i.remove(a,n,o)}}})])])},editData:function(t){this.editPopup=!0,this.newTitle=t.title,this.editDataObj=t},append:function(t){this.addtitle=null,this.addPopup=!0,this.addDataObj=t},remove:function(t,e,i){var n=this;console.log(i),this.$Modal.confirm({title:"确认删除所选类别吗",content:"<p>注意,该操作将会移除该类别下所有子类别，并且该类别和所属子类别下的所有图像将清空类别标识</p>",onOk:function(){Object(a.a)("/admin/delClassification",{id:i.id}).then((function(a){if(n.$Spin.hide(),200==a.status)if("200"==a.data.code){var o=t.find((function(t){return t===e})).parent,s=t.find((function(t){return t.nodeKey===o})).node,d=s.children.indexOf(i);s.children.splice(d,1),n.$Message.success(a.data.info)}else n.$Message.error(a.data.info);else n.$Message.error("请求时出现错误")})).catch((function(t){console.log(t),n.$Message.error("服务器请求错误")}))},onCancel:function(){}})}}},o=(i("f47c"),i("2877")),s=Object(o.a)(n,(function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("Layout",{staticStyle:{"margin-top":"50px","margin-bottom":"50px"}},[i("Content",[i("div",{staticClass:"cardShadowByTree"},[i("br"),i("Tree",{staticClass:"demo-tree-render",attrs:{data:t.dataList,render:t.renderContent,"empty-text":"暂无类别"}}),i("br")],1)]),i("Modal",{attrs:{"footer-hide":!0},model:{value:t.addPopup,callback:function(e){t.addPopup=e},expression:"addPopup"}},[i("p",[t._v("增加归类")]),i("br"),i("Form",{nativeOn:{submit:function(t){t.preventDefault()}}},[i("FormItem",[i("Input",{staticStyle:{width:"100%"},attrs:{maxlength:20,"show-word-limit":"",prefix:"ios-contact",placeholder:"填写类别名称",size:"large"},model:{value:t.addtitle,callback:function(e){t.addtitle=e},expression:"addtitle"}})],1),i("FormItem",[i("Button",{attrs:{type:"primary",loading:t.addloading,icon:"ios-folder",long:"",shape:"circle"},on:{click:t.addClassification}},[t._v("保 存")])],1)],1)],1),i("Modal",{attrs:{"footer-hide":!0},model:{value:t.editPopup,callback:function(e){t.editPopup=e},expression:"editPopup"}},[i("p",[t._v("修改类别")]),i("br"),i("Form",{nativeOn:{submit:function(t){t.preventDefault()}}},[i("FormItem",[i("Input",{staticStyle:{width:"100%"},attrs:{maxlength:20,"show-word-limit":"",prefix:"ios-contact",placeholder:"填写新的类别名称",size:"large"},model:{value:t.newTitle,callback:function(e){t.newTitle=e},expression:"newTitle"}})],1),i("FormItem",[i("Button",{attrs:{type:"primary",loading:t.editloading,icon:"ios-folder",long:"",shape:"circle"},on:{click:t.editClassification}},[t._v("保 存")])],1)],1)],1),i("Footer",{staticClass:"layout-footer-center"},[t._v(t._s(this.$store.state.metaInfo.webname)+" © Control Panel")])],1)}),[],!1,null,null,null);e.default=s.exports},f47c:function(t,e,i){"use strict";i("5003")}}]);