Files
Electron_Test/front/js/editor-edit.7f0f4022.js
2024-04-07 09:46:14 +08:00

2 lines
11 KiB
JavaScript

"use strict";(self["webpackChunk_object_Object_"]=self["webpackChunk_object_Object_"]||[]).push([[604],{93814:function(e,t,n){n.r(t),n.d(t,{default:function(){return z}});var i=n(73396),a=n(87139);const l={class:"editor-container"},o={class:"editor-content"},s={ref:"container"};function r(e,t,n,r,c,d){const u=(0,i.up)("am-toolbar"),h=(0,i.up)("manual-article"),g=(0,i.up)("am-outline"),p=(0,i.up)("am-loading");return(0,i.wg)(),(0,i.j4)(p,{loading:e.loading},{default:(0,i.w5)((()=>[e.engine?((0,i.wg)(),(0,i.j4)(u,{key:0,engine:e.engine,items:e.items},null,8,["engine","items"])):(0,i.kq)("",!0),(0,i._)("div",{class:(0,a.C_)(["editor-wrapper",{"editor-mobile":e.isMobile}])},[(0,i._)("div",l,[(0,i._)("div",o,[!e.isMobile&&e.engine?((0,i.wg)(),(0,i.j4)(h,{key:0,list:e.listData,onChange:e.handleChange},null,8,["list","onChange"])):(0,i.kq)("",!0),(0,i._)("div",s,null,512),!e.isMobile&&e.engine?((0,i.wg)(),(0,i.j4)(g,{key:1,engine:e.engine},null,8,["engine"])):(0,i.kq)("",!0)])])],2)])),_:1},8,["loading"])}var c=n(44870),d=n(83438),u=n(40521),h=n(43629),g=n(46194),p=n(43693),v=n(93654),m=n(24607),w=n(657),y=n(42024),k=n(8286),f=n(22483),b=(0,i.aZ)({name:"engine-edit",components:{AmLoading:p.Z,AmToolbar:g.ZP,AmOutline:v.Z,ManualArticle:m.Z},data(){return{items:[[{type:"collapse",groups:[{items:["image-uploader","codeblock","table","file-uploader","video-uploader","math","status",{name:"tag",icon:'<span style="width:23px;height:23px;display: inline-block;border:1px solid #E8E8E8;"><svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><rect stroke="#E8E8E8" fill="#FFF" x=".5" y=".5" width="23" height="23" rx="2"></rect><g transform="scale(0.3, 0.3) translate(16 16)"><path d="M8 44L8 6C8 4.89543 8.89543 4 10 4H38C39.1046 4 40 4.89543 40 6V44L24 35.7273L8 44Z" fill="none" stroke="#595959" stroke-width="2" stroke-linejoin="round"></path><path d="M16 18H32" stroke="#595959" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></g></g></svg><span>',title:"标签",search:"标签,tag,biaoqian,bq"},{name:"embed",icon:'<span style="width:23px;height:23px;display: inline-block;border:1px solid #E8E8E8;"><svg width="24" height="24" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><rect stroke="#E8E8E8" fill="#FFF" x=".5" y=".5" width="23" height="23" rx="2"></rect><g transform="scale(0.3, 0.3) translate(16 16)"><path d="M8 44L8 6C8 4.89543 8.89543 4 10 4H38C39.1046 4 40 4.89543 40 6V44L24 35.7273L8 44Z" fill="none" stroke="#595959" stroke-width="2" stroke-linejoin="round"></path><path d="M16 18H32" stroke="#595959" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path></g></g></svg><span>',title:"嵌入网址",search:"嵌入网址,embed,qianruwangzhi,qrwz"},{name:"lightblock",icon:'<span style="width:23px;height:23px;display: inline-block;border:1px solid #E8E8E8;"><svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="24" height="24"><g><rect stroke="#E8E8E8" fill="#FFF" x=".5" y=".5" width="23" height="23" rx="2"></rect><g transform="scale(0.02, 0.02) translate(90, 66)"><path d="M334.381005 532.396498c-43.065755-49.294608-63.309781-112.604389-57.006228-178.291306 10.574825-110.073758 97.919974-198.776832 207.71744-210.893776 68.155127-7.538682 133.543239 13.271232 184.12721 58.571883 49.904497 44.705089 78.529384 108.733229 78.529384 175.681881 0 58.288428-21.461758 114.226326-60.43532 157.530511-33.148915 36.840996-52.83217 85.053971-56.389176 137.225087H528.321701V438.869569c0-9.007123-7.311508-16.319655-16.323748-16.319655-9.014286 0-16.312492 7.312531-16.312491 16.324771v233.34507H393.113547c-3.619427-51.119159-24.146908-100.241852-58.732542-139.823257z m267.534684 349.898389H422.088404c-15.65553 0-28.397714-12.72888-28.397714-28.38441v-13.222113h236.617596v13.222113c0.001023 15.648367-12.737067 28.384411-28.392597 28.38441z m28.393621-176.619226v40.79095h-236.61862V704.913299l236.61862 0.762362z m0 102.380557h-236.61862v-28.945182h236.617596v28.945182h0.001024z m-269.255882 45.853236c0 33.645217 27.378503 61.036 61.035999 61.035999h179.827286c33.65238 0 61.036-27.390782 61.035999-61.035999V689.406148c0-50.646392 17.267234-97.71736 48.62639-132.56803 44.377631-49.313027 68.815158-113.009617 68.815158-179.372938 0-76.212623-32.576888-149.107695-89.390734-199.987401-57.609977-51.586809-132.021585-75.230251-209.499013-66.725571-125.072327 13.823816-224.583539 114.852588-236.613503 240.230883-7.177455 74.713483 15.876564 146.765352 64.907159 202.899725 33.056817 37.817228 51.255258 85.643394 51.255259 134.65557v165.371068z"></path></g></g></svg><span>',title:"高亮块",search:"高亮块,lightblock"},{name:"audio-uploader",icon:'<span style="width:23px;height:23px;display: inline-block;border:1px solid #E8E8E8;"><svg style="top: 2px;position: relative;" t="1636128560405" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="28042" width="16" height="16"><path d="M877.854 269.225l-56.805-56.806-121.726-123.079c-24.345-21.64-41.928-27.050-68.978-27.050h-451.737c-31.108 0-55.453 24.345-55.453 55.453v789.865c0 29.755 24.345 54.1 55.453 54.1h666.787c31.108 0 55.453-24.345 55.453-54.1v-584.284c0-24.345-8.115-35.165-22.993-54.1v0zM830.516 289.513h-156.891v-156.891l156.891 156.891zM856.213 907.609c0 5.409-4.057 10.821-10.821 10.821h-666.787c-6.762 0-12.172-5.409-12.172-10.821v-789.865c0-6.762 5.409-12.172 12.172-12.172 0 0 451.737 0 451.737 0v205.582c0 12.173 9.468 21.64 21.64 21.64h204.229v574.816zM723.668 413.943c-117.668-1.353-246.157 22.993-363.825 59.511-9.468 4.058-10.821 5.409-10.821 14.877v210.991c-12.172-5.409-27.050-6.762-41.927-5.409-45.985 1.353-82.503 29.755-82.503 60.862 0 31.108 36.517 55.453 82.503 52.748 45.985-2.706 82.503-29.755 82.503-60.863v-193.409c109.553-25.698 209.638-43.28 312.429-51.395v150.128c-12.173-5.409-25.698-6.762-40.576-6.762-45.985 2.706-82.503 29.755-82.503 62.215 0 31.108 36.517 55.453 82.503 52.748 44.632-2.706 82.503-29.755 82.503-60.863v-267.797c0-13.525-6.762-16.23-20.287-17.583z" p-id="28043"></path></svg><span>',title:"音频",search:"音频,audio,yinpin,YP"},{name:"draw",icon:'<span style="width:23px;height:23px;display: inline-block;border:1px solid #E8E8E8;"><svg style="top: 2px;position: relative;" t="1636128560405" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="28042" width="16" height="16"><path d="M877.854 269.225l-56.805-56.806-121.726-123.079c-24.345-21.64-41.928-27.050-68.978-27.050h-451.737c-31.108 0-55.453 24.345-55.453 55.453v789.865c0 29.755 24.345 54.1 55.453 54.1h666.787c31.108 0 55.453-24.345 55.453-54.1v-584.284c0-24.345-8.115-35.165-22.993-54.1v0zM830.516 289.513h-156.891v-156.891l156.891 156.891zM856.213 907.609c0 5.409-4.057 10.821-10.821 10.821h-666.787c-6.762 0-12.172-5.409-12.172-10.821v-789.865c0-6.762 5.409-12.172 12.172-12.172 0 0 451.737 0 451.737 0v205.582c0 12.173 9.468 21.64 21.64 21.64h204.229v574.816zM723.668 413.943c-117.668-1.353-246.157 22.993-363.825 59.511-9.468 4.058-10.821 5.409-10.821 14.877v210.991c-12.172-5.409-27.050-6.762-41.927-5.409-45.985 1.353-82.503 29.755-82.503 60.862 0 31.108 36.517 55.453 82.503 52.748 45.985-2.706 82.503-29.755 82.503-60.863v-193.409c109.553-25.698 209.638-43.28 312.429-51.395v150.128c-12.173-5.409-25.698-6.762-40.576-6.762-45.985 2.706-82.503 29.755-82.503 62.215 0 31.108 36.517 55.453 82.503 52.748 44.632-2.706 82.503-29.755 82.503-60.863v-267.797c0-13.525-6.762-16.23-20.287-17.583z" p-id="28043"></path></svg><span>',title:"绘图",search:"绘图,draw"}]}]}],["undo","redo","paintformat","removeformat"],["heading","fontfamily","fontsize"],["bold","italic","strikethrough","underline","moremark"],["fontcolor","backcolor"],["alignment"],["unorderedlist","orderedlist","tasklist","indent","line-height"],["link","quote","hr"],["test",{type:"button",name:"cancel",content:"取消",title:"取消",onDisabled:()=>!1,onClick:()=>{location.href=location.origin+"/#/manual"}},{type:"button",name:"save",content:"保存",title:"保存",className:"btn-primary",onDisabled:()=>!1,onClick:async(e,t)=>{const n=await t.getValueAsync(),i=this.manualInfo,a={outline:[],image:[],video:[],audio:[]};["outline","video","image","audio"].forEach((e=>{const n=(0,v.s)(t,e);a[e]=n})),await(0,k.Ct)({content:n,title:i.title,id:i.id,manuals:i.manuals,resourceAuthority:i.resourceAuthority,video:a?.video?.length,image:a?.image?.length,audio:a?.audio?.length}),this.getManualArticleList(),(0,y.J1)()}}]]}},setup(){const e=(0,c.iH)(null),t=(0,c.iH)(null),n=(0,c.iH)([]),a=(0,c.iH)(!0),l=(0,c.iH)(),o=(0,c.iH)(),s=(0,c.iH)([]),r=(0,c.iH)(null);(0,i.YP)([()=>l.value],(()=>v())),(0,i.YP)([()=>o.value,()=>s.value],(()=>m())),(0,i.bv)((async()=>{const e=(0,f.yj)();e&&e.query&&(l.value=Number(e.query.id),o.value=Number(e.query.articleId)),g()}));const g=()=>{if(e.value){const n=new h.ZP(e.value,{plugins:w.Gr,cards:w._u,config:w.GJ});(0,w.lA)(n),n.messageSuccess=e=>{d.ZP.success(e)},n.messageError=e=>{d.ZP.error(e)},n.messageConfirm=e=>new Promise(((t,n)=>{u.Z.confirm({content:e,onOk:()=>t(!0),onCancel:()=>n()})})),n.on("card:maximize",(()=>{(0,h.$)(".editor-toolbar").css("z-index","9999").css("top","55px")})),n.on("card:minimize",(()=>{(0,h.$)(".editor-toolbar").css("z-index","").css("top","")}));n.on("change",(()=>{const{value:e,paths:t}=n.command.executeMethod("mark-range","action","mark","filter",n.getValue());(0,y.t$)(e)})),t.value=n}};(0,i.Ah)((()=>{t.value&&t.value.destroy()}));const p=e=>{o.value=e},v=async()=>{if(l.value){const e=await(0,k.GX)(l.value);s.value=e||[]}},m=()=>{const e=s.value.find((e=>e.id===o.value));r.value=e||{};const n=e?.content||"";t.value.setValue(n,(()=>{a.value=!1}))};return{loading:a,isMobile:h.tq,container:e,engine:t,members:n,listData:s,manualInfo:r,handleChange:p,getManualArticleList:v}}}),x=n(40089);const E=(0,x.Z)(b,[["render",r],["__scopeId","data-v-68315a51"]]);var z=E},24607:function(e,t,n){n.d(t,{Z:function(){return k}});var i=n(73396),a=n(87139);const l=e=>((0,i.dD)("data-v-3f66adee"),e=e(),(0,i.Cn)(),e),o={class:"manual-article"},s=l((()=>(0,i._)("h2",null,"手册目录",-1))),r={class:"article-tree"},c={key:0,style:{color:"#1890ff"}};function d(e,t,n,l,d,u){const h=(0,i.up)("InputSearch"),g=(0,i.up)("Tree");return(0,i.wg)(),(0,i.iD)("div",o,[s,(0,i.Wm)(h,{value:e.searchValue,"onUpdate:value":t[0]||(t[0]=t=>e.searchValue=t),placeholder:"请输入搜索内容","enter-button":"",onSearch:e.handleSearch},null,8,["value","onSearch"]),(0,i._)("div",r,[(0,i.Wm)(g,{selectedKeys:e.selectedKeys,"onUpdate:selectedKeys":t[1]||(t[1]=t=>e.selectedKeys=t),"tree-data":e.treeData,onSelect:e.selectArticle,fieldNames:{key:"id"}},{title:(0,i.w5)((({title:e,key:t})=>["0-0-1-0"===t?((0,i.wg)(),(0,i.iD)("span",c,(0,a.zw)(e),1)):((0,i.wg)(),(0,i.iD)(i.HY,{key:1},[(0,i.Uk)((0,a.zw)(e),1)],64))])),_:1},8,["selectedKeys","tree-data","onSelect"])])])}var u=n(44870),h=n(89044),g=n(185),p=n(22483),v=n(42024),m=(0,i.aZ)({name:"manual-article",components:{InputSearch:h.Z,Tree:g.ZP},props:["list"],emits:["change"],setup(e,{emit:t}){const n=(0,p.yj)(),a=(0,u.iH)(""),l=(0,u.iH)([]),o=(0,u.iH)([]),s=(0,u.iH)([]);(0,i.YP)((()=>e.list),(e=>r(e))),(0,i.bv)((()=>{if(n.query&&n.query.id&&n.query.articleId){const e=Number(n.query.articleId);s.value=[e]}}));const r=e=>{l.value=e,o.value=(0,v.OH)(e,"parentId")},c=e=>{const t=(0,u.IU)(l.value).filter((t=>t.title.toLowerCase().indexOf(e.toLowerCase())>=0));o.value=(0,v.OH)(t,"parentId")},d=e=>{t("change",e[0])};return{searchValue:a,treeData:o,selectedKeys:s,handleSearch:c,selectArticle:d}}}),w=n(40089);const y=(0,w.Z)(m,[["render",d],["__scopeId","data-v-3f66adee"]]);var k=y}}]);
//# sourceMappingURL=editor-edit.7f0f4022.js.map