chunk-b8dc2d72.d1e8bdeb.js 16 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b8dc2d72","chunk-607cf7f2"],{1273:function(t,e,n){"use strict";n("6f5e")},"4e9a":function(t,e,n){"use strict";n("6a2c")},"567f":function(t,e,n){},"6a2c":function(t,e,n){},"6c7c":function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"data-info"},[n("el-card",[n("el-form",{attrs:{model:t.dataForm,"label-width":"120px"}},[n("el-form-item",{attrs:{label:"组件类型:"}},[n("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择类型",size:"large"},on:{change:t.onChangeStatus},model:{value:t.dataForm.type,callback:function(e){t.$set(t.dataForm,"type",e)},expression:"dataForm.type"}},t._l(t.typeList,(function(t){return n("el-option",{key:t.value,attrs:{label:t.text,value:t.value}})})),1)],1),n("el-form-item",{attrs:{label:"组件名称:"}},[n("el-input",{model:{value:t.dataForm.title,callback:function(e){t.$set(t.dataForm,"title",e)},expression:"dataForm.title"}})],1),n("el-form-item",{attrs:{label:"产品状态:"}},[n("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择状态",size:"large"},on:{change:t.onChangeStatus},model:{value:t.dataForm.statusName,callback:function(e){t.$set(t.dataForm,"statusName",e)},expression:"dataForm.statusName"}},t._l(t.statusOptions,(function(t){return n("el-option",{key:t.status,attrs:{label:t.name,value:t.status}})})),1)],1),n("el-form-item",{attrs:{label:"说明介绍:"}},[n("el-input",{attrs:{type:"textarea"},model:{value:t.dataForm.title,callback:function(e){t.$set(t.dataForm,"title",e)},expression:"dataForm.title"}})],1),1==t.dataForm.type?n("el-form-item",{attrs:{label:"组件内容:"}},[n("Tinymce")],1):t._e()],1)],1),n("div",{staticStyle:{"text-align":"right","margin-top":"20px"}},[n("el-button",{attrs:{type:"warning"},on:{click:t.btnSave}},[t._v("确认保存")])],1)],1)},o=[],i=(n("a9e3"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"tinymce-container",class:{fullscreen:t.fullscreen},style:{width:t.containerWidth}},[n("textarea",{staticClass:"tinymce-textarea",attrs:{id:t.tinymceId}})])}),r=[],c=(n("b680"),n("d3b7"),n("ac1f"),n("00b4"),n("0643"),n("4e3e"),n("159b"),["advlist anchor autolink autosave code codesample colorpicker colorpicker contextmenu directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textcolor textpattern visualblocks visualchars wordcount"]),l=c,s=["searchreplace bold italic underline strikethrough alignleft aligncenter alignright outdent indent blockquote undo redo removeformat subscript superscript code codesample","hr bullist numlist link image charmap preview anchor pagebreak insertdatetime media table emoticons forecolor backcolor fullscreen"],u=s,d=n("b85c"),m=(n("d9e2"),n("14d9"),[]);function f(){return window.tinymce}var h=function(t,e){var n=document.getElementById(t),a=e||function(){};if(!n){var o=document.createElement("script");o.src=t,o.id=t,document.body.appendChild(o),m.push(a);var i="onload"in o?r:c;i(o)}function r(e){e.onload=function(){this.onerror=this.onload=null;var t,n=Object(d["a"])(m);try{for(n.s();!(t=n.n()).done;){var a=t.value;a(null,e)}}catch(o){n.e(o)}finally{n.f()}m=null},e.onerror=function(){this.onerror=this.onload=null,a(new Error("Failed to load "+t),e)}}function c(t){t.onreadystatechange=function(){if("complete"===this.readyState||"loaded"===this.readyState){this.onreadystatechange=null;var e,n=Object(d["a"])(m);try{for(n.s();!(e=n.n()).done;){var a=e.value;a(null,t)}}catch(o){n.e(o)}finally{n.f()}m=null}}}n&&a&&(f()?a(null,n):m.push(a))},p=h,b="https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js",g={name:"Tinymce",props:{id:{type:String,default:function(){return"vue-tinymce-"+ +new Date+(1e3*Math.random()).toFixed(0)}},value:{type:String,default:""},toolbar:{type:Array,required:!1,default:function(){return[]}},menubar:{type:String,default:"file edit insert view format table"},height:{type:[Number,String],required:!1,default:360},width:{type:[Number,String],required:!1,default:"auto"}},data:function(){return{hasChange:!1,hasInit:!1,tinymceId:this.id,fullscreen:!1,languageTypeList:{en:"en",zh:"zh_CN",es:"es_MX",ja:"ja"}}},computed:{containerWidth:function(){var t=this.width;return/^[\d]+(\.[\d]+)?$/.test(t)?"".concat(t,"px"):t}},watch:{value:function(t){var e=this;!this.hasChange&&this.hasInit&&this.$nextTick((function(){return window.tinymce.get(e.tinymceId).setContent(t||"")}))}},mounted:function(){this.init()},activated:function(){window.tinymce&&this.initTinymce()},deactivated:function(){this.destroyTinymce()},destroyed:function(){this.destroyTinymce()},methods:{init:function(){var t=this;p(b,(function(e){e?t.$message.error(e.message):t.initTinymce()}))},initTinymce:function(){var t=this,e=this;window.tinymce.init({selector:"#".concat(this.tinymceId),language:this.languageTypeList["en"],height:this.height,body_class:"panel-body ",object_resizing:!1,toolbar:this.toolbar.length>=0?this.toolbar:u,menubar:this.menubar,plugins:l,end_container_on_empty_block:!0,powerpaste_word_import:"clean",code_dialog_height:450,code_dialog_width:1e3,advlist_bullet_styles:"square",advlist_number_styles:"default",imagetools_cors_hosts:["www.tinymce.com","codepen.io"],default_link_target:"_blank",link_title:!1,nonbreaking_force_tab:!0,init_instance_callback:function(n){e.value&&n.setContent(e.value),e.hasInit=!0,n.on("NodeChange Change KeyUp SetContent",(function(){t.hasChange=!0,t.$emit("input",n.getContent())}))},setup:function(t){t.on("FullscreenStateChanged",(function(t){e.fullscreen=t.state}))},convert_urls:!1})},destroyTinymce:function(){var t=window.tinymce.get(this.tinymceId);this.fullscreen&&t.execCommand("mceFullScreen"),t&&t.destroy()},setContent:function(t){window.tinymce.get(this.tinymceId).setContent(t)},getContent:function(){window.tinymce.get(this.tinymceId).getContent()},imageSuccessCBK:function(t){var e=this;t.forEach((function(t){return window.tinymce.get(e.tinymceId).insertContent('<img class="wscnph" src="'.concat(t.url,'" >'))}))}}},y=g,v=(n("1273"),n("2877")),_=Object(v["a"])(y,i,r,!1,null,"76d08426",null),w=_.exports,k={components:{Tinymce:w},emits:["onClose"],props:{id:{type:Number,default:0}},watch:{id:{handler:function(t){var e=this;null==t||t<0||e.getInfo(t)},immediate:!0,deep:!0}},data:function(){return{activeName:"base",currentCategory:[],allCategories:[],typeList:[{value:1,text:"文本"},{value:2,text:"二维表"}],dataForm:{type:1,prod:{items:[]}},statusOptions:[{status:5,name:"启用"},{status:6,name:"停用"}]}},mounted:function(){var t=this;t.initAllCategory()},methods:{btnSave:function(t){var e=this;if(""!=e.dataForm.title)e.dataForm.id,e.dataForm.title,e.dataForm.status,e.dataForm.categoryId,e.dataForm.sku;else e.$alert("产品标题不能为空")},getInfo:function(t){},onChangeStatus:function(t){this.dataForm.status=t},onChangeCategory:function(t){var e=this;e.dataForm.categoryId=t},initAllCategory:function(){}}},C=k,x=(n("4e9a"),Object(v["a"])(C,a,o,!1,null,null,null));e["default"]=x.exports},"6f5e":function(t,e,n){},"990c":function(t,e,n){"use strict";n("567f")},a888:function(t,e,n){"use strict";n("99af"),n("caad"),n("ac1f"),n("2532"),n("5319");var a={bind:function(t,e,n){var a=t.querySelector(".el-dialog__header"),o=t.querySelector(".el-dialog");a.style.cssText+=";cursor:move;",o.style.cssText+=";top:0px;";var i=function(){return window.document.currentStyle?function(t,e){return t.currentStyle[e]}:function(t,e){return getComputedStyle(t,!1)[e]}}();a.onmousedown=function(t){var e=t.clientX-a.offsetLeft,r=t.clientY-a.offsetTop,c=o.offsetWidth,l=o.offsetHeight,s=document.body.clientWidth,u=document.body.clientHeight,d=o.offsetLeft,m=s-o.offsetLeft-c,f=o.offsetTop,h=u-o.offsetTop-l,p=i(o,"left"),b=i(o,"top");p.includes("%")?(p=+document.body.clientWidth*(+p.replace(/\%/g,"")/100),b=+document.body.clientHeight*(+b.replace(/\%/g,"")/100)):(p=+p.replace(/\px/g,""),b=+b.replace(/\px/g,"")),document.onmousemove=function(t){var a=t.clientX-e,i=t.clientY-r;-a>d?a=-d:a>m&&(a=m),-i>f?i=-f:i>h&&(i=h),o.style.cssText+=";left:".concat(a+p,"px;top:").concat(i+b,"px;"),n.child.$emit("dragDialog")},document.onmouseup=function(t){document.onmousemove=null,document.onmouseup=null}}}},o=function(t){t.directive("el-drag-dialog",a)};window.Vue&&(window["el-drag-dialog"]=a,Vue.use(o)),a.install=o;e["a"]=a},c621:function(t,e,n){"use strict";n.d(e,"j",(function(){return o})),n.d(e,"b",(function(){return i})),n.d(e,"m",(function(){return r})),n.d(e,"f",(function(){return c})),n.d(e,"d",(function(){return l})),n.d(e,"h",(function(){return s})),n.d(e,"i",(function(){return u})),n.d(e,"g",(function(){return d})),n.d(e,"c",(function(){return m})),n.d(e,"a",(function(){return f})),n.d(e,"l",(function(){return h})),n.d(e,"e",(function(){return p})),n.d(e,"k",(function(){return b}));var a=n("b775");function o(t){return Object(a["a"])({url:"/template/category/search",method:"post",data:t})}function i(t){return Object(a["a"])({url:"/template/category/create",method:"post",data:t})}function r(t){return Object(a["a"])({url:"/template/category/update",method:"post",data:t})}function c(t){return Object(a["a"])({url:"/template/category/info",method:"post",data:t})}function l(t){return Object(a["a"])({url:"/template/category/delete",method:"post",data:t})}function s(t){return Object(a["a"])({url:"/document/block/list",method:"post",data:t})}function u(t){return Object(a["a"])({url:"/template/search",method:"post",data:t})}function d(t){return Object(a["a"])({url:"/template/info",method:"post",data:t})}function m(t){return Object(a["a"])({url:"/document/block/dele/".concat(t),method:"get"})}function f(t){return Object(a["a"])({url:"/document/block/add",method:"post",data:t})}function h(t){return Object(a["a"])({url:"/document/block/edit",method:"post",data:t})}function p(t){return Object(a["a"])({url:"/template/category/allList",method:"post",data:t})}function b(t){return Object(a["a"])({url:"/template/category/treeCategory",method:"post",data:t})}},defe:function(t,e,n){"use strict";n.r(e);var a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"data-list"},[n("el-table",{attrs:{data:t.dataList,"header-row-class-name":"headerBg","empty-text":"没有项目信息","max-height":t.tableMaxHeight}},[n("el-table-column",{attrs:{prop:"dcb_id",label:"ID",align:"center",width:"80"}}),n("el-table-column",{attrs:{prop:"dcb_name",label:"文档块名称",align:"center"}}),n("el-table-column",{attrs:{prop:"dcb_share",label:"共享类型",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[1==e.row.dcb_share?n("div",[t._v("官方")]):t._e(),2==e.row.dcb_share?n("div",[t._v("私有")]):t._e(),3==e.row.dcb_share?n("div",[t._v("共享")]):t._e()]}}])}),n("el-table-column",{attrs:{label:"操作",fixed:"right",align:"center",width:"300"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("div",{staticClass:"btns"},[n("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(n){return t.btnEdit(e.row.dcb_id)}}},[n("svg-icon",{attrs:{"icon-class":"edit"}}),t._v("编辑模块")],1),n("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(n){return t.EditorInfo(e.row)}}},[n("svg-icon",{attrs:{"icon-class":"edit"}}),t._v("修改信息")],1),n("el-button",{attrs:{type:"danger",size:"small"},on:{click:function(n){return t.btnDelete(e.row.dcb_id)}}},[n("svg-icon",{attrs:{"icon-class":"delete"}}),t._v("删除")],1)],1)]}}])})],1),n("div",{staticClass:"page-info"},[n("el-pagination",{attrs:{currentPage:t.queryForm.page,"page-size":t.queryForm.pageSize,total:t.recordCount,"page-count":t.pageTotal,background:"",layout:"prev, pager, next"},on:{"current-change":t.ChangePage}})],1),n("el-dialog",{directives:[{name:"el-drag-dialog",rawName:"v-el-drag-dialog"}],attrs:{visible:t.dialogVisible,"append-to-body":"","close-on-click-modal":!1,width:"30%","custom-class":"prod-verify",title:"修改模块信息"},on:{"update:visible":function(e){t.dialogVisible=e}}},[n("el-form",{ref:"moduleRef",attrs:{model:t.moduleForm,rules:t.moduleRules,"label-position":"left","label-width":"100px"}},[n("el-form-item",{attrs:{label:"文档块名称:",prop:"dcb_name"}},[n("el-input",{staticStyle:{width:"220px"},attrs:{placeholder:"请选择文档块名称"},model:{value:t.moduleForm.dcb_name,callback:function(e){t.$set(t.moduleForm,"dcb_name",e)},expression:"moduleForm.dcb_name"}})],1),n("el-form-item",{attrs:{label:"共享类型:",prop:"dcb_share"}},[n("el-select",{staticClass:"m-2",attrs:{clearable:"",placeholder:"请选择共享类型",size:"large"},model:{value:t.moduleForm.dcb_share,callback:function(e){t.$set(t.moduleForm,"dcb_share",e)},expression:"moduleForm.dcb_share"}},t._l(t.dcbShareList,(function(t){return n("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:t.closeModule}},[t._v("取 消")]),n("el-button",{attrs:{type:"primary"},on:{click:t.submitModule}},[t._v("确 定")])],1)],1)],1)},o=[],i=n("c7eb"),r=n("1da1"),c=n("ade3"),l=n("5530"),s=(n("4de4"),n("14d9"),n("d3b7"),n("ac1f"),n("841c"),n("0643"),n("2382"),n("2f62")),u=n("c621"),d=n("6c7c"),m=n("a888"),f={components:{dataInfo:d["default"]},directives:{elDragDialog:m["a"]},props:{queryForm:{type:Object,default:function(){return{page:1,pageSize:10,name:"",sign:""}}}},watch:{queryForm:{handler:function(t){this.search()},deep:!0}},computed:Object(l["a"])({},Object(s["b"])(["roleInfo","authList"])),data:function(){return Object(c["a"])(Object(c["a"])(Object(c["a"])(Object(c["a"])(Object(c["a"])(Object(c["a"])(Object(c["a"])(Object(c["a"])({dialogVisible:!1,currentDataId:0,recordCount:0,pageTotal:1,dataList:[],currentData:{}},"dialogVisible",!1),"moduleForm",{name:"",dcb_share:""}),"moduleRules",{dcb_name:[{required:!0,message:"请输入文档块名称",trigger:"blur"}],dcb_share:[{required:!0,message:"请选择共享类型",trigger:"change"}]}),"props",{value:"id",label:"name",children:"children",checkStrictly:!0}),"statusOptions",[{value:"",label:"请选择状态"},{value:5,label:"启用"},{value:6,label:"停用"}]),"categoryList",[]),"tableMaxHeight",500),"dcbShareList",[{value:1,label:"官方"},{value:2,label:"私有"},{value:3,label:"共享"}])},mounted:function(){this.search(),this.initCategoryList()},methods:{refreshList:function(){this.search()},onChangeCategory:function(){},closeModule:function(){this.dialogVisible=!1,this.moduleForm={dcb_name:"",dcb_share:""}},submitModule:function(){var t=this;this.$refs.moduleRef.validate((function(e){e&&Object(u["l"])(t.moduleForm).then((function(e){200===e.code&&(t.$message.success("修改成功!"),t.dialogVisible=!1,t.moduleForm={dcb_name:"",dcb_share:""},t.search())}))}))},initCategoryList:function(){var t=this;return Object(r["a"])(Object(i["a"])().mark((function e(){var n;return Object(i["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t,e.next=3,Object(u["k"])();case 3:n=e.sent,t.categoryList=n.data;case 5:case"end":return e.stop()}}),e)})))()},EditorInfo:function(t){this.dialogVisible=!0,this.moduleForm=t},checkAuth:function(t){if(1==this.roleInfo.is_admin)return!0;var e=this.authList.filter((function(e){return 999==e.type&&e.path==t}));return e.length>0},btnDelete:function(t){var e=this;e.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(n){console.log(t),Object(u["c"])(t).then((function(t){e.search()}))})).catch((function(){}))},searchData:function(){var t=this;t.dialogVisible=!1,t.search()},btnEdit:function(t){this.$router.push("/document/system/document/create?templateId="+t+"&type=module")},handleClose:function(){var t=this;t.currentDataId=0,t.dialogVisible=!1,t.search()},search:function(){var t=this;Object(u["h"])(t.queryForm).then((function(e){e&&(t.dataList=e.data.dataList,t.recordCount=e.data.totalRecord,t.pageTotal=e.data.totalPage)}))},ChangePage:function(t){var e=this;e.queryForm.page=t,e.search()}}},h=f,p=(n("990c"),n("2877")),b=Object(p["a"])(h,a,o,!1,null,null,null);e["default"]=b.exports}}]);