chunk-11fca9ac.6d51f9f6.js 15 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-11fca9ac"],{1177:function(e,t,a){"use strict";var n=a("7a23");function o(e,t,a,o,r,c){var i=Object(n["resolveComponent"])("editor");return Object(n["openBlock"])(),Object(n["createBlock"])(i,{init:r.config,disabled:a.disabled,"model-value":a.value,"onUpdate:modelValue":c.updateValue},null,8,["init","disabled","model-value","onUpdate:modelValue"])}a("a15b"),a("b0c0"),a("159b"),a("ac1f"),a("5319");var r=a("e562"),c=a.n(r),i=(a("ec27"),a("0d68"),a("64d8"),a("840a"),a("0a9d"),a("3154"),a("bc54"),a("62e5"),a("6957"),a("ffbe"),a("4237"),a("2fec"),a("4ea8"),a("8863"),a("3aea"),a("07d1"),a("07d7"),a("84ec"),a("0902"),a("2b07"),a("c3d7"),a("69e4"),a("d2dc"),a("855b"),a("ebac"),a("90e7"),a("eda9"),a("0efa"),a("365e"),a("9434"),a("4cb4"),a("ca72")),l=(a("d3b7"),a("b775")),d=a("f64c");function u(e){return new Promise((function(t,a){Object(l["a"])({url:"/Oss/apiUpload",method:"post",headers:{hostname:window.location.hostname},data:e}).then((function(e){1==e.data.code?(d["a"].success(e.data.msg),t(e.data.data)):a(new Error(e.data.msg))})).catch((function(e){a(e)}))}))}var s="",f={height:500,branding:!1,skin_url:s+"tinymce/skins/ui/oxide",content_css:s+"tinymce/skins/content/default/content.min.css",language_url:s+"tinymce/langs/zh_CN.js",language:"zh_CN",plugins:["code","print","preview","fullscreen","paste","searchreplace","save","autosave","link","autolink","image","imagetools","media","table","codesample","lists","advlist","hr","charmap","emoticons","anchor","directionality","pagebreak","quickbars","nonbreaking","visualblocks","visualchars","wordcount"].join(" "),toolbar:["fullscreen","preview","code","|","image","|","undo","redo","|","forecolor","backcolor","|","bold","italic","underline","strikethrough","|","alignleft","aligncenter","alignright","alignjustify","|","outdent","indent","|","numlist","bullist","|","formatselect","fontselect","fontsizeselect","|","link","media","emoticons","charmap","anchor","pagebreak","codesample","|","ltr","rtl"].join(" "),draggable_modal:!0,toolbar_mode:"sliding",quickbars_insert_toolbar:"quicktable",quickbars_selection_toolbar:"bold italic | quicklink h2 h3 blockquote",images_upload_handler:function(e,t){var a=e.blob(),n=new FormData;n.append("file",a,a.name),n.append("type","TinymceEditor "),u(n).then((function(e){e.full_url?t(e.full_url):t("")})).catch((function(){t("")}))},file_picker_types:"media",file_picker_callback:function(){}},m={skin_url:s+"tinymce/skins/ui/oxide-dark",content_css:s+"tinymce/skins/content/dark/content.min.css"},b={name:"TinymceImageEditor",components:{Editor:i["a"]},emits:["update:value"],props:{value:String,init:Object,disabled:Boolean,autoTheme:{type:Boolean,default:!0},darkTheme:Boolean},data:function(){var e=this.autoTheme?this.$store.state.theme.darkMode:this.darkTheme;return{config:Object.assign({},f,e?m:{},this.init)}},computed:{darkMode:function(){try{return this.$store.state.theme.darkMode}catch(e){return!1}}},created:function(){c.a.init({})},methods:{updateValue:function(e){this.$emit("update:value",e)},changeTheme:function(e){document.head.querySelectorAll('[id^="mce-"]').forEach((function(t){var a=t.getAttribute("href");-1!==a.indexOf("/oxide-dark/")?e||(a=a.replace("/oxide-dark/","/oxide/"),t.setAttribute("href",a)):e&&(a=a.replace("/oxide/","/oxide-dark/"),t.setAttribute("href",a))})),this.changeContentTheme(e)},changeContentTheme:function(e){document.body.querySelectorAll('iframe[id^="tiny-vue_"]').forEach((function(t){var a=t.contentWindow;if(a){var n=a.document;n&&[].forEach.call(n.head.querySelectorAll('[id^="mce-"]'),(function(t){var a=t.getAttribute("href");-1!==a.indexOf("/skins/ui/")?-1!==a.indexOf("/oxide-dark/")?e||(a=a.replace("/oxide-dark/","/oxide/"),t.setAttribute("href",a)):e&&(a=a.replace("/oxide/","/oxide-dark/"),t.setAttribute("href",a)):-1!==a.indexOf("/skins/content/")&&(-1!==a.indexOf("/dark/")?e||(a=a.replace("/dark/","/default/"),t.setAttribute("href",a)):e&&(a=a.replace("/default/","/dark/"),t.setAttribute("href",a)))}))}}))}},watch:{darkMode:function(){this.autoTheme&&this.changeTheme(this.darkMode)}}},p=(a("4afa"),a("6b0d")),h=a.n(p);const v=h()(b,[["render",o]]);t["a"]=v},1694:function(e,t,a){"use strict";var n=a("7a23"),o=Object(n["withScopeId"])("data-v-571a5ff5");Object(n["pushScopeId"])("data-v-571a5ff5");var r={key:0},c={class:"avatar-uploader"},i={class:"avatar-uploader"},l={class:"ant-upload-text"},d={key:1,class:"avatar-uploader-wrap"},u={class:"avatar-uploader"},s={class:"ant-upload-text"};Object(n["popScopeId"])();var f=o((function(e,t,a,f,m,b){var p=Object(n["resolveComponent"])("a-image"),h=Object(n["resolveComponent"])("LoadingOutlined"),v=Object(n["resolveComponent"])("CloseCircleOutlined"),g=Object(n["resolveComponent"])("PlusOutlined"),O=Object(n["resolveComponent"])("a-row");return Object(n["openBlock"])(),Object(n["createBlock"])("div",null,[a.urls.length>0?(Object(n["openBlock"])(),Object(n["createBlock"])("div",r,[Object(n["createVNode"])(O,{wrap:!0},{default:o((function(){return[(Object(n["openBlock"])(!0),Object(n["createBlock"])(n["Fragment"],null,Object(n["renderList"])(a.urls,(function(e,o){return Object(n["openBlock"])(),Object(n["createBlock"])("div",{class:"avatar-uploader-wrap",style:{margin:"5px"},key:o},[Object(n["createVNode"])("div",c,[e?(Object(n["openBlock"])(),Object(n["createBlock"])(p,{key:0,onClick:t[1]||(t[1]=Object(n["withModifiers"])((function(){}),["stop"])),style:{overflow:"hidden","max-width":"100%","max-height":"100%"},width:"100%",preview:!0,src:e.url,alt:a.alt},null,8,["src","alt"])):Object(n["createCommentVNode"])("",!0),Object(n["createVNode"])("div",null,[Object(n["withDirectives"])(Object(n["createVNode"])(h,null,null,512),[[n["vShow"],a.loading]])])]),a.disabled?Object(n["createCommentVNode"])("",!0):Object(n["withDirectives"])((Object(n["openBlock"])(),Object(n["createBlock"])(v,{key:0,class:"close-btn",onClick:Object(n["withModifiers"])((function(e){return b.remove(o)}),["stop"])},null,8,["onClick"])),[[n["vShow"],e]])])})),128)),Object(n["withDirectives"])(Object(n["createVNode"])("div",{class:"avatar-uploader-wrap",style:{margin:"5px"},onClick:t[2]||(t[2]=function(){return b.handleImg&&b.handleImg.apply(b,arguments)})},[Object(n["createVNode"])("div",i,[Object(n["createVNode"])("div",null,[Object(n["withDirectives"])(Object(n["createVNode"])(h,null,null,512),[[n["vShow"],a.loading]]),Object(n["withDirectives"])(Object(n["createVNode"])(g,null,null,512),[[n["vShow"],!a.loading]]),Object(n["createVNode"])("div",l,Object(n["toDisplayString"])(a.tips),1)])])],512),[[n["vShow"],a.urls.length<a.max&&!a.disabled]])]})),_:1})])):(Object(n["openBlock"])(),Object(n["createBlock"])("div",d,[Object(n["createVNode"])("div",u,[a.url?(Object(n["openBlock"])(),Object(n["createBlock"])(p,{key:0,onClick:t[3]||(t[3]=Object(n["withModifiers"])((function(){}),["stop"])),style:{overflow:"hidden","max-width":"100%","max-height":"100%"},width:"100%",preview:!0,src:a.url,alt:a.alt},null,8,["src","alt"])):Object(n["createCommentVNode"])("",!0),Object(n["withDirectives"])(Object(n["createVNode"])("div",{onClick:t[4]||(t[4]=function(){return b.handleImg&&b.handleImg.apply(b,arguments)})},[Object(n["withDirectives"])(Object(n["createVNode"])(h,null,null,512),[[n["vShow"],a.loading]]),Object(n["withDirectives"])(Object(n["createVNode"])(g,null,null,512),[[n["vShow"],!a.loading]]),Object(n["createVNode"])("div",s,Object(n["toDisplayString"])(a.tips),1)],512),[[n["vShow"],!a.url]])]),a.disabled?Object(n["createCommentVNode"])("",!0):Object(n["withDirectives"])((Object(n["openBlock"])(),Object(n["createBlock"])(v,{key:0,class:"close-btn",onClick:Object(n["withModifiers"])(b.remove,["stop"])},null,8,["onClick"])),[[n["vShow"],a.url]])]))])})),m=(a("a9e3"),a("8fe6")),b=a("47ce"),p=a("411c"),h={name:"uploadButton",components:{LoadingOutlined:m["a"],PlusOutlined:b["a"],CloseCircleOutlined:p["a"]},props:{disabled:{type:Boolean,default:function(){return!1}},urls:{type:Array,default:function(){return[]}},url:{type:String,default:function(){return""}},max:{type:Number,default:function(){return 999}},loading:{type:Boolean,default:function(){return!1}},alt:{type:String,default:function(){return""}},tips:{type:String,default:function(){return"上传图片"}}},data:function(){return{}},methods:{remove:function(e){this.disabled||this.$emit("remove",e)},handleImg:function(){this.disabled||this.$emit("handleImg")}}},v=(a("6556"),a("6b0d")),g=a.n(v);const O=g()(h,[["render",f],["__scopeId","data-v-571a5ff5"]]);t["a"]=O},"35ff":function(e,t,a){},"4afa":function(e,t,a){"use strict";a("8276")},6556:function(e,t,a){"use strict";a("35ff")},6795:function(e,t,a){},"7d9e":function(e,t,a){"use strict";a.r(t);a("4e82");var n=a("7a23"),o=Object(n["withScopeId"])("data-v-742c8296");Object(n["pushScopeId"])("data-v-742c8296");var r=Object(n["createTextVNode"])("显示"),c=Object(n["createTextVNode"])("隐藏");Object(n["popScopeId"])();var i=o((function(e,t,a,i,l,d){var u=Object(n["resolveComponent"])("a-input"),s=Object(n["resolveComponent"])("a-form-item"),f=Object(n["resolveComponent"])("uploadButton"),m=Object(n["resolveComponent"])("a-radio"),b=Object(n["resolveComponent"])("a-radio-group"),p=Object(n["resolveComponent"])("tinymce-image-editor"),h=Object(n["resolveComponent"])("a-form"),v=Object(n["resolveComponent"])("a-modal"),g=Object(n["resolveComponent"])("imageSelector");return Object(n["openBlock"])(),Object(n["createBlock"])("div",null,[Object(n["createVNode"])(v,{destroyOnClose:"",width:700,visible:a.visible,"confirm-loading":l.loading,title:l.isUpdate?"修改":"添加","body-style":{paddingBottom:"8px",maxHeight:"60vh",overflowY:"auto"},"onUpdate:visible":d.updateVisible,onOk:d.save},{default:o((function(){return[Object(n["createVNode"])(h,{ref:"form",model:l.form,rules:l.rules,"label-col":{span:2},"wrapper-col":{span:22}},{default:o((function(){return[Object(n["createVNode"])(s,{label:"标题:",name:"title"},{default:o((function(){return[Object(n["createVNode"])(u,{"allow-clear":"",placeholder:"请输入标题",value:l.form.title,"onUpdate:value":t[1]||(t[1]=function(e){return l.form.title=e})},null,8,["value"])]})),_:1}),Object(n["createVNode"])(s,{label:"封面:",name:"cover_image"},{default:o((function(){return[Object(n["createVNode"])(f,{url:l.form.cover_image,onRemove:t[2]||(t[2]=function(e){return l.form.cover_image=""}),onClick:d.openImageSelector},null,8,["url","onClick"])]})),_:1}),Object(n["createVNode"])(s,{label:"排序:",name:"sort"},{default:o((function(){return[Object(n["createVNode"])(u,{type:"number","allow-clear":"",placeholder:"数字越大越靠前",value:l.form.sort,"onUpdate:value":t[3]||(t[3]=function(e){return l.form.sort=e})},null,8,["value"])]})),_:1}),Object(n["createVNode"])(s,{label:"状态:",name:"status"},{default:o((function(){return[Object(n["createVNode"])(b,{value:l.form.status,"onUpdate:value":t[4]||(t[4]=function(e){return l.form.status=e})},{default:o((function(){return[Object(n["createVNode"])(m,{value:1},{default:o((function(){return[r]})),_:1}),Object(n["createVNode"])(m,{value:2},{default:o((function(){return[c]})),_:1})]})),_:1},8,["value"])]})),_:1}),Object(n["createVNode"])(s,{label:"内容:",name:"content"},{default:o((function(){return[Object(n["createVNode"])(p,{value:l.form.content,"onUpdate:value":t[5]||(t[5]=function(e){return l.form.content=e}),placeholder:"可使用全屏操作",init:{height:300}},null,8,["value"])]})),_:1})]})),_:1},8,["model","rules"])]})),_:1},8,["visible","confirm-loading","title","onUpdate:visible","onOk"]),Object(n["createVNode"])(g,{onConfirm:d.confirmImageSelect,visible:l.visibleImageSelector,"onUpdate:visible":t[6]||(t[6]=function(e){return l.visibleImageSelector=e})},null,8,["onConfirm","visible"])])})),l=(a("d3b7"),a("1177")),d=a("9e53"),u=a("be58"),s=a("1694"),f={name:"addOrEdit",components:{imageSelector:d["a"],TinymceImageEditor:l["a"],uploadButton:s["a"]},emits:["done","update:visible"],props:{visible:Boolean,data:Object},data:function(){return{form:Object.assign({},this.data),rules:{title:[{required:!0,message:"请输入标题",trigger:"blur"}],cover_image:[{required:!0,message:"请上传封面",trigger:"change"}],content:[{required:!0,message:"请输入内容",type:"string",trigger:"blur"}]},loading:!1,isUpdate:!1,uploadLoading:!1,visibleImageSelector:!1}},watch:{data:function(){this.form=Object.assign({},this.data),this.form.id?(this.isUpdate=!0,this.getInformationDetail(this.form.id)):this.isUpdate=!1,this.$refs.form&&this.$refs.form.clearValidate()}},methods:{getInformationDetail:function(e){var t=this,a={id:e};Object(u["b"])(a).then((function(e){t.form.content=e.content}))},openImageSelector:function(){this.visibleImageSelector=!0},confirmImageSelect:function(e){this.form.cover_image=e.imageList[0].url},save:function(){var e=this;this.$refs.form.validate().then((function(){e.loading=!0,Object(u["c"])(e.form).then((function(t){console.log(t),e.isUpdate||(e.form={}),e.updateVisible(!1),e.$emit("done")})).finally((function(){e.loading=!1}))})).catch((function(){}))},updateVisible:function(e){this.$emit("update:visible",e)}}},m=(a("bfbe"),a("6b0d")),b=a.n(m);const p=b()(f,[["render",i],["__scopeId","data-v-742c8296"]]);t["default"]=p},8276:function(e,t,a){},b775:function(e,t,a){"use strict";a("d3b7"),a("ac1f"),a("5319");var n=a("bc3a"),o=a.n(n),r=a("4360"),c=a("a18c"),i=a("d2b8"),l=a("f64c"),d=a("ed3b"),u=o.a.create({baseURL:"https://book.shuhi.com/api"});function s(e){r["a"].dispatch("user/removeToken").then((function(){if(!e){var t=c["a"].currentRoute.path;return c["a"].push({path:"/login",query:t&&"/"!==t?{form:t}:null})}location.replace("/login")}))}u.interceptors.request.use((function(e){var t=i["a"].takeToken();return t&&(e.headers[i["a"].tokenHeaderName]=t),e}),(function(e){return Promise.reject(e)})),u.interceptors.response.use((function(e){return 1!=e.data.code&&401!=e.data.code&&403!=e.data.code&&l["a"].error(e.data.msg),e}),(function(e){var t=e.response;return 401===t.data.code&&(t.config.url===i["a"].menuUrl?s():(d["a"].destroyAll(),d["a"].info({title:"系统提示",content:"登录状态已过期, 请退出重新登录!",okText:"重新登录",onOk:function(){s(!0)}}))),403===t.data.code&&l["a"].error(t.data.msg),Promise.reject(e)})),t["a"]=u},be58:function(e,t,a){"use strict";a.d(t,"c",(function(){return c})),a.d(t,"a",(function(){return i})),a.d(t,"b",(function(){return l}));a("d3b7");var n=a("bc3a"),o=a.n(n),r=a("f64c");function c(e){return new Promise((function(t,a){o()({url:"/api/manager/Information/saveItem",method:"post",data:e}).then((function(e){1==e.data.code?(r["a"].success(e.data.msg),t(e.data.data)):a(new Error(e.data.msg))})).catch((function(e){a(e)}))}))}function i(e){return new Promise((function(t,a){o()({url:"/api/manager/Information/deleteItem",method:"post",data:e}).then((function(e){1==e.data.code?(r["a"].success(e.data.msg),t(e.data.data)):a(new Error(e.data.msg))})).catch((function(e){a(e)}))}))}function l(e){return new Promise((function(t,a){o()({url:"/api/manager/Information/detail",method:"post",data:e}).then((function(e){1==e.data.code?t(e.data.data):a(new Error(e.data.msg))})).catch((function(e){a(e)}))}))}},bfbe:function(e,t,a){"use strict";a("6795")}}]);