(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7a26dadf"],{"0fa4":function(e,t,a){"use strict";a.r(t);a("b0c0"),a("99af");var i=function(){var e=this,t=e._self._c;return t("a-card",{staticClass:"manuals-catelog"},[t("h2",{staticClass:"v-title"},[e._v("手册信息")]),t("div",{staticClass:"manuals-info-editor"},[t("div",{staticClass:"form-left"},[t("div",{staticClass:"form-item"},[t("div",{staticClass:"label"},[e._v("手册名称")]),e._v(" : "),t("div",{staticClass:"input"},[t("a-input",{attrs:{placeholder:"请输入手册名称"},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1)]),t("div",{staticClass:"form-item"},[t("div",{staticClass:"label"},[e._v("编著")]),e._v(" : "),t("div",{staticClass:"input"},[t("a-input",{attrs:{placeholder:"请输入编著名称"},model:{value:e.form.compile,callback:function(t){e.$set(e.form,"compile",t)},expression:"form.compile"}})],1)]),t("div",{staticClass:"form-item"},[t("div",{staticClass:"label"},[e._v("出版")]),e._v(" : "),t("div",{staticClass:"input"},[t("a-input",{attrs:{placeholder:"请输入出版信息"},model:{value:e.form.publish,callback:function(t){e.$set(e.form,"publish",t)},expression:"form.publish"}})],1)]),t("div",{staticClass:"form-item textarea"},[t("div",{staticClass:"label"},[e._v("手册简介")]),e._v(" : "),t("div",{staticClass:"input"},[t("a-textarea",{attrs:{placeholder:"请输入简介信息"},model:{value:e.form.explain,callback:function(t){e.$set(e.form,"explain",t)},expression:"form.explain"}})],1)])]),t("div",{staticClass:"form-right"},[t("div",{staticClass:"form-item"},[t("div",{staticClass:"label"},[e._v("手册分类")]),e._v(" : "),t("div",{staticClass:"input"},[t("a-tree-select",{staticStyle:{width:"100%"},attrs:{replaceFields:{key:"id",title:"name",value:"id"},"tree-data":e.classifyData,"tree-default-expand-all":"","search-placeholder":"请选择分类"},model:{value:e.form.classify,callback:function(t){e.$set(e.form,"classify",t)},expression:"form.classify"}})],1)]),t("div",{staticClass:"form-item"},[t("div",{staticClass:"label"},[e._v("手册封面")]),e._v(" : "),t("div",{staticClass:"input"},[t("a-upload",{staticClass:"avatar-uploader",attrs:{accept:"image/*",name:"avatar","list-type":"picture-card","show-upload-list":!1,customRequest:e.uploadCover}},[e.form.cover?t("img",{staticStyle:{width:"100%"},attrs:{src:e.$fileLinkTransfer(e.form.cover),alt:"avatar"}}):t("div",[t("a-icon",{attrs:{type:e.uploadloading?"loading":"plus"}}),t("div",{staticClass:"ant-upload-text"},[e._v("上传")])],1),e.form.cover?t("div",{staticClass:"delete-box",on:{click:function(t){return t.stopPropagation(),function(){e.form.cover="",e.coverFile=null}.apply(null,arguments)}}},[t("a-icon",{attrs:{type:"delete"}})],1):e._e()])],1)])])]),t("div",{staticClass:"save-info-box"},[t("a-button",{attrs:{type:"primary",shape:"round",size:"small"},on:{click:e.saveManual}},[e._v(" 保存 ")]),t("a-button",{attrs:{type:"danger",shape:"round",size:"small"},on:{click:e.reset}},[e._v(" 重置 ")]),t("a-button",{attrs:{size:"small",shape:"round"},on:{click:function(t){return e.$router.push("/manuals")}}},[e._v(" 返回 ")])],1),t("h2",{staticClass:"v-title"},[e._v("手册目录")]),t("div",{staticClass:"draggable-tree-box"},["editor"==e.type?t("div",{staticClass:"draggable-tree-top"},[t("div",{staticClass:"draggable-tree-top-left"},[t("div",{on:{click:e.selectAllTreeNode}},[t("a-checkbox",{staticStyle:{"margin-right":"5px"},attrs:{checked:e.isAllChecked,indeterminate:e.indeterminate},on:{click:function(t){return t.stopPropagation(),e.selectAllTreeNode.apply(null,arguments)}}}),e.indeterminate?t("span",[e._v(" 已选择"+e._s(e.checkedKeys.length)+"个")]):t("span",[e._v(" 所有文档")])],1),t("div",{on:{click:function(t){return e.checkAllNodeExpand(!1)}}},[t("a-icon",{staticStyle:{"margin-right":"5px"},attrs:{type:"pic-center"}}),e._v(" 全部折叠 ")],1),t("div",{on:{click:function(t){return e.checkAllNodeExpand(!0)}}},[t("a-icon",{staticStyle:{"margin-right":"5px"},attrs:{type:"pic-left"}}),e._v(" 全部展开 ")],1),t("div",{on:{click:function(t){return e.addAtricle(0,"atricle")}}},[t("a-icon",{staticStyle:{"margin-right":"5px"},attrs:{type:"plus-circle"}}),e._v(" 添加文档 ")],1),t("div",{on:{click:function(t){return e.addAtricle(0,"group")}}},[t("a-icon",{staticStyle:{"margin-right":"5px"},attrs:{type:"plus-square"}}),e._v("添加分组 ")],1),t("div",[t("a-select",{staticStyle:{width:"200px"},attrs:{"show-search":"",size:"small",mode:"multiple",placeholder:"请输入搜索内容","default-active-first-option":!1},on:{change:e.changeSelectArticle},model:{value:e.searchArticle,callback:function(t){e.searchArticle=t},expression:"searchArticle"}},[t("a-icon",{attrs:{slot:"suffixIcon",type:"smile"},slot:"suffixIcon"}),e._l(e.allArticleList,(function(a){return t("a-select-option",{key:"".concat(a.title,"-$$-").concat(a.id)},[e._v(" "+e._s(a.title)+" ")])}))],2)],1)]),e.checkedKeys.length?t("div",{staticClass:"draggable-tree-top-right"},[t("a-button",{attrs:{type:"danger",size:"small"},on:{click:function(t){return e.deleteArticle(null,!0)}}},[e._v(" 删除 ")])],1):e._e()]):e._e(),"editor"==e.type?t("a-tree",{staticClass:"draggable-tree",attrs:{blockNode:!0,draggable:"","tree-data":e.articleList,checkable:"",expandedKeys:e.expandedKeys,"selected-keys":e.selectedKeys},on:{drop:e.onDrop,dragend:e.dragend,dragstart:e.dragstart,expand:e.articleExpandTree,select:e.onSelect},scopedSlots:e._u([{key:"title",fn:function(a){return[t("div",{staticClass:"tree-node-title",style:{width:"100%",left:"0px",paddingLeft:"".concat(40+17.8*a.level,"px")},attrs:{id:a.key+"title-left"},on:{dblclick:function(t){return t.stopPropagation(),e.renName(a)}}},[e.showInputNodeKey!==a.key?t("div",{staticClass:"tree-title-left"},[e._v(" "+e._s(a.title)+" ")]):e._e(),a.isShowButton?e._e():t("div",{staticClass:"tree-title-right"},[t("span",{staticClass:"article-time"},[e._v(e._s(a.updateTime))]),"atricle"==a.dataRef.type?t("a-icon",{staticClass:"line-button-icon",attrs:{type:"eye"},on:{click:function(t){return t.stopPropagation(),e.lookArticle(a.dataRef)}}}):e._e(),t("a-dropdown",{attrs:{id:a.key+"button",trigger:["click"]}},[t("a-icon",{staticClass:"line-button-icon",attrs:{type:"plus-square"},on:{click:function(t){t.stopPropagation(),e.selectedKeys=[a.key]}}}),t("a-menu",{attrs:{slot:"overlay"},slot:"overlay"},[t("a-menu-item",{key:"1"},[t("span",{staticStyle:{width:"100%",display:"inline-block"},on:{click:function(t){return e.addAtricle(a.id,"atricle",a)}}},[t("a-icon",{attrs:{type:"container",theme:"twoTone"}}),e._v("新建文档 ")],1)]),t("a-menu-item",{key:"2"},[t("span",{staticStyle:{width:"100%",display:"inline-block"},on:{click:function(t){return e.addAtricle(a.id,"group",a)}}},[t("a-icon",{attrs:{type:"database",theme:"twoTone"}}),e._v("新建分组 ")],1)]),"atricle"==a.dataRef.type?t("a-menu-item",{key:"3",on:{click:function(t){return e.editorDoc(a.dataRef)}}},[t("span",{staticStyle:{width:"100%",display:"inline-block"}},[t("a-icon",{attrs:{type:"edit",theme:"twoTone"}}),e._v("编辑文档 ")],1)]):e._e(),t("a-menu-divider"),t("a-menu-item",{key:"4"},[t("span",{staticStyle:{width:"100%",display:"inline-block"},on:{click:function(t){return e.renName(a)}}},[t("a-icon",{attrs:{type:"highlight",theme:"twoTone"}}),e._v("重命名 ")],1)]),t("a-menu-item",{key:"5"},[t("span",{staticStyle:{width:"100%",display:"inline-block"},on:{click:function(t){return e.deleteArticle(a)}}},[t("a-icon",{attrs:{type:"delete",theme:"twoTone"}}),e._v("删除 ")],1)])],1)],1)],1)])]}}],null,!1,380687893),model:{value:e.checkedKeys,callback:function(t){e.checkedKeys=t},expression:"checkedKeys"}}):e._e()],1)])},n=[],r=a("5530"),s=a("2909"),c=a("c7eb"),l=a("1da1"),o=(a("d3b7"),a("159b"),a("25f0"),a("498a"),a("ac1f"),a("1276"),a("c740"),a("a9e3"),a("a434"),a("4de4"),a("4e82"),a("d81d"),a("07ac"),a("c1fa")),d=a("dbdf"),u=a("fc35"),p={data:function(){return{type:"",isAllChecked:!1,indeterminate:!1,checkedKeys:[],searchArticle:[],baseForm:{name:"",explain:"",compile:"",publish:"",cover:"",stick:!1,password:"",canEditor:[1],canView:[1],classify:0},coverFile:null,copyFrom:{},allArticleList:[],articleList:[],expandedKeys:[],showInputNodeKey:"",selectedKeys:[],classifyData:[],classifyBaseData:[],manualsId:{},baseAtricleformData:{title:"",explain:"",content:"",manuals:"",type:"",parentId:"",authorityUser:[],authorityRole:[],resourceAuthority:!1,index:0,video:0,audio:0,image:0,model:0},form:{},uploadloading:!1,routerQueryInfo:{}}},created:function(){var e=this;return Object(l["a"])(Object(c["a"])().mark((function t(){return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.init(),e.routerQueryInfo=e.$route.query;case 2:case"end":return t.stop()}}),t)})))()},activated:function(){var e=this;return Object(l["a"])(Object(c["a"])().mark((function t(){return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:e.init();case 1:case"end":return t.stop()}}),t)})))()},methods:{init:function(){var e=this;return Object(l["a"])(Object(c["a"])().mark((function t(){return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(e.getClassifyData(),e.manualsId=parseInt(e.$route.query.id),e.type=e.$route.query.type,"editor"!=e.type){t.next=10;break}return t.next=6,e.getCatelogInfo();case 6:return t.next=8,e.getOneManuals();case 8:t.next=11;break;case 10:e.form=e.baseForm;case 11:e.form.classify=parseInt(e.$route.query.classify||0);case 12:case"end":return t.stop()}}),t)})))()},getClassifyData:function(){var e=this;return Object(l["a"])(Object(c["a"])().mark((function t(){var a;return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(o["k"])();case 2:a=t.sent,e.classifyBaseData=a.data.data;case 4:case"end":return t.stop()}}),t)})))()},selectAllTreeNode:function(e){if(this.checkedKeys.length>=this.allArticleList.length)this.checkedKeys=[];else{var t=[];this.allArticleList.forEach((function(e){t.push(e.key)})),this.checkedKeys=t}},getOneManuals:function(){var e=this;return Object(l["a"])(Object(c["a"])().mark((function t(){var a;return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,Object(o["l"])(e.manualsId);case 2:a=t.sent,e.form=a.data.data,e.copyFrom=e.$myClone(a.data.data);case 5:case"end":return t.stop()}}),t)})))()},checkAllNodeExpand:function(e){if(e){var t=[];this.allArticleList.forEach((function(e){t.push(e.key)})),this.expandedKeys=t}else this.expandedKeys=[]},onSelect:function(e,t){this.selectedKeys=e},getCatelogInfo:function(){var e=this;return Object(l["a"])(Object(c["a"])().mark((function t(){var a,i;return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,Object(o["j"])(e.manualsId);case 3:a=t.sent,i=a.data,e.allArticleList=i.data,e.articleList=e.initArticleTree(i.data),t.next=12;break;case 9:t.prev=9,t.t0=t["catch"](0),e.$message.error(t.t0.toString());case 12:case"end":return t.stop()}}),t,null,[[0,9]])})))()},saveManual:function(){var e=this;return Object(l["a"])(Object(c["a"])().mark((function t(){var a,i,n,r,s,l,u,p;return Object(c["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(t.prev=0,e.form.name.trim()){t.next=4;break}return e.$message.warn("手册名称不可为空"),t.abrupt("return");case 4:if(a={},!e.form.cover||!e.coverFile){t.next=13;break}return i=new FormData,i.append("file",e.coverFile),t.next=10,Object(d["a"])(i);case 10:n=t.sent,r=n.data,e.form.cover=r.data.diskname;case 13:if("create"!=e.type){t.next=23;break}return t.next=16,Object(o["b"])(e.form);case 16:s=t.sent,l=s.data,a=l.data,e.$router.push({path:"/editorManuals",query:{type:"editor",classify:a.classify,id:a.id}}),location.reload(),t.next=28;break;case 23:return t.next=25,Object(o["g"])(e.form.id,e.form);case 25:u=t.sent,p=u.data,a=p;case 28:e.$message.success("编辑成功"),t.next=35;break;case 31:t.prev=31,t.t0=t["catch"](0),e.confirmLoading=!1,e.$message.error(t.t0.toString());case 35:e.tableLoading=!1;case 36:case"end":return t.stop()}}),t,null,[[0,31]])})))()},reset:function(){this.form=this.copyFrom},addAtricle:function(e,t,a){var i=this;return Object(l["a"])(Object(c["a"])().mark((function n(){var r,s,l,d;return Object(c["a"])().wrap((function(n){while(1)switch(n.prev=n.next){case 0:return n.prev=0,r=i.$myClone(i.baseAtricleformData),r.title="atricle"==t?"新增文档":"新增分组",r.type=t,r.index=0,r.manuals=i.manualsId,r.parentId=e,n.next=9,Object(o["a"])(r);case 9:s=n.sent,l=s.data,i.allArticleList.unshift(l.data),i.articleList=i.initArticleTree(i.allArticleList),a&&i.expandedKeys.push(a.key),d=i.$myClone(l.data),d.dataRef=l.data,i.$nextTick((function(){i.renName(d)})),n.next=22;break;case 19:n.prev=19,n.t0=n["catch"](0),i.$message.error(n.t0.toString());case 22:case"end":return n.stop()}}),n,null,[[0,19]])})))()},articleExpandTree:function(e){this.expandedKeys=e},changeSelectArticle:function(e){this.searchArticle=[];var t=parseInt(e[0].split("-$$-")[1]);if(t){var a=this.allArticleList.findIndex((function(e){if(e.id==t)return!0}));this.selectedKeys=[this.allArticleList[a].key],this.expandedKeys=this.getExpandeKeys(this.allArticleList[a].parentId)}},getExpandeKeys:function(e){if(0==e)return[0];var t=[],a=this.allArticleList.findIndex((function(t){if(t.id==e)return!0}));return-1!==a&&(t.push(this.allArticleList[a].key),0!==this.allArticleList[a].parentId&&t.push.apply(t,Object(s["a"])(this.getExpandeKeys(this.allArticleList[a].parentId)))),t},editorDoc:function(e){var t=this.$router.resolve({path:"/article",query:{manuals:e.manuals,article:e.id,isEditor:!0}});window.open(t.href,"_blank")},onDrop:function(e){var t=this;return Object(l["a"])(Object(c["a"])().mark((function a(){var i,n,r,s,l,d,u,p,h,f,m,v,y,b,k,g;return Object(c["a"])().wrap((function(a){while(1)switch(a.prev=a.next){case 0:if(a.prev=0,i=e.node.eventKey,n=e.dragNode.eventKey,r=e.node.pos.split("-"),s=e.dropPosition-Number(r[r.length-1]),l=function e(t,a,i){t.forEach((function(t,n,r){return t.key===a?i(t,n,r):t.children?e(t.children,a,i):void 0}))},d=t.articleList,l(d,n,(function(e,t,a){a.splice(t,1),u=e})),e.dropToGap?(e.node.children||[]).length>0&&e.node.expanded&&1===s?l(d,i,(function(e){alert("这里是未知的区域"),e.children=e.children||[],e.children.unshift(u)})):(l(d,i,(function(e,t,a){f=a,m=t,e})),p=f[m].parentId,u.level=f[m].level,-1===s?f.splice(m,0,u):f.splice(m+1,0,u),h=[],f.forEach((function(e){h.push(e.id)}))):l(d,i,(function(e,t,a){e.children=e.children||[],u.level=e.level+1,e.children.push(u),p=e.id,h=[],a[t].children.forEach((function(e){h.push(e.id)}))})),t.articleList=d,t.dragend(),!h){a.next=17;break}return a.next=14,Object(o["d"])(h);case 14:y=a.sent,b=y.data,v=b.data;case 17:if(0!=p&&!p){a.next=23;break}return a.next=20,Object(o["n"])({manuals:t.manualsId,id:u.id,data:{parentId:p}});case 20:k=a.sent,g=k.data,v=g.data;case 23:t.$nextTick((function(){t.allArticleList=v,t.articleList=t.initArticleTree(v)})),a.next=30;break;case 26:a.prev=26,a.t0=a["catch"](0),t.$message.error(a.t0.toString()),t.dragend();case 30:case"end":return a.stop()}}),a,null,[[0,26]])})))()},dragend:function(){this.allArticleList.forEach((function(e){e.isShowButton=!1}))},lookArticle:function(e){var t=this.$router.resolve({path:"/article",query:Object(r["a"])(Object(r["a"])({},this.routerQueryInfo),{},{manuals:e.manuals,article:e.id})});window.open(t.href,"_self")},dragstart:function(e){},renName:function(e){var t=this;this.canDraggable=!0,this.showInputNodeKey=e.key,this.newName=e.title,this.selectedKeys=[e.key];var a=document.getElementById("".concat(e.key,"input")),i={},n=document.getElementById(e.key+"title-left"),r=n.parentElement.parentElement.parentElement;r.style.position="relative",a||(i=document.createElement("span"),i.innerHTML=''),r.appendChild(i),i.className="tree-node-input-box",a=document.getElementById("".concat(e.key,"input")),i.style.left="55px"),a.style.display="inline",a.value=e.title;var s=a.value;a.setSelectionRange(0,s.length),a.focus(),this.$nextTick((function(){a.addEventListener("blur",c)}));var c=function i(){t.saveNewName(e,a),r.style.position="static",a.style.display="none",a.removeEventListener("blur",i,!1)}},saveNewName:function(e,t){var a=this;return Object(l["a"])(Object(c["a"])().mark((function i(){var n;return Object(c["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(a.newName=t.value,i.prev=1,a.showInputNodeKey="",a.selectedKeys=[],e.dataRef.title,e.dataRef.title=a.newName,a.newName!=e.title){i.next=8;break}return i.abrupt("return");case 8:return i.next=10,Object(o["n"])({manuals:a.manualsId,id:e.id,data:{title:a.newName}});case 10:n=i.sent,n.data,i.next=17;break;case 14:i.prev=14,i.t0=i["catch"](1),a.$message.error(i.t0.toString());case 17:case"end":return i.stop()}}),i,null,[[1,14]])})))()},deleteArticle:function(e,t){var a=this;return Object(l["a"])(Object(c["a"])().mark((function i(){var n,r,s,d;return Object(c["a"])().wrap((function(i){while(1)switch(i.prev=i.next){case 0:try{n=[],"",r=[],t?a.checkedKeys.forEach((function(e){for(var t=0;t0&&"同时删除包括".concat(e.title,"下的的所有文档"),r=[e.id].concat(n)),s=function(){var e=Object(l["a"])(Object(c["a"])().mark((function e(t){var i,n,l;return Object(c["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:if(i=t.data,window.removeEventListener("message",s),!i.status){e.next=11;break}return e.next=5,Object(o["n"])({manuals:a.manualsId,id:r,data:{delFlag:1}});case 5:n=e.sent,l=n.data,a.allArticleList=l.data,a.articleList=a.initArticleTree(l.data),a.selectedKeys=[],a.checkedKeys=[];case 11:if(i.id!==i.id){e.next=13;break}return e.abrupt("return",i.status);case 13:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),d=(new Date).getTime(),a.$selfConfirm({title:t?"确定要删除所选的 ".concat(a.checkedKeys.length,"个文档吗? "):"确定要删除 ".concat(e.title,"吗?"),id:d},s)}catch(u){a.$message.error(u.toString())}case 1:case"end":return i.stop()}}),i)})))()},initArticleTree:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=[];return r=e.filter((function(e){if(e.parentId==a)return!0})),r.length>0&&(n++,r.forEach((function(a,r){a.scopedSlots={title:"title"},a.isShowButton=!1,a.level=n,a.status="",a.updateTime=t.$getTime(a.updateTime),a.key=Object(u["isUndefined"])(i)?r:i+"-"+r,a.key=a.key.toString(),a.children=t.initArticleTree(e,a.id,a.key,n)}))),r.sort((function(e,t){return e.index-t.index})),r},uploadCover:function(e){var t=e.file;this.form.cover=this.$fileToUrl(t),this.coverFile=t},beforeUpload:function(){},handleChange:function(){}},watch:{classifyBaseData:function(e){var t=this.$toTree({},e);this.classifyData=t.tree,this.mapList=t.map,this.formatList=Object.values(t.map),this.classifyData.unshift({id:0,name:"无分类"})},checkedKeys:function(){this.checkedKeys.length&&this.checkedKeys.length!==this.allArticleList.length?(this.indeterminate=!0,this.isAllChecked&&(this.isAllChecked=!1)):this.checkedKeys.length==this.allArticleList.length?(!this.isAllChecked&&(this.isAllChecked=!0),this.indeterminate=!1):this.checkedKeys.length||(this.isAllChecked&&(this.isAllChecked=!1),this.indeterminate=!1)}}},h=p,f=(a("833b"),a("2877")),m=Object(f["a"])(h,i,n,!1,null,"7e4f8886",null);t["default"]=m.exports},"833b":function(e,t,a){"use strict";a("91b3")},"91b3":function(e,t,a){}}]);