1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-780db50a","chunk-607cf7f2"],{1273:function(t,e,a){"use strict";a("6f5e")},"3ff5":function(t,e,a){},"4e9a":function(t,e,a){"use strict";a("6a2c")},"6a2c":function(t,e,a){},"6c7c":function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-info"},[a("el-card",[a("el-form",{attrs:{model:t.dataForm,"label-width":"120px"}},[a("el-form-item",{attrs:{label:"组件类型:"}},[a("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 a("el-option",{key:t.value,attrs:{label:t.text,value:t.value}})})),1)],1),a("el-form-item",{attrs:{label:"组件名称:"}},[a("el-input",{model:{value:t.dataForm.title,callback:function(e){t.$set(t.dataForm,"title",e)},expression:"dataForm.title"}})],1),a("el-form-item",{attrs:{label:"产品状态:"}},[a("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 a("el-option",{key:t.status,attrs:{label:t.name,value:t.status}})})),1)],1),a("el-form-item",{attrs:{label:"说明介绍:"}},[a("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?a("el-form-item",{attrs:{label:"组件内容:"}},[a("Tinymce")],1):t._e()],1)],1),a("div",{staticStyle:{"text-align":"right","margin-top":"20px"}},[a("el-button",{attrs:{type:"warning"},on:{click:t.btnSave}},[t._v("确认保存")])],1)],1)},o=[],i=(a("a9e3"),function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"tinymce-container",class:{fullscreen:t.fullscreen},style:{width:t.containerWidth}},[a("textarea",{staticClass:"tinymce-textarea",attrs:{id:t.tinymceId}})])}),r=[],l=(a("b680"),a("d3b7"),a("ac1f"),a("00b4"),a("0643"),a("4e3e"),a("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"]),c=l,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=a("b85c"),m=(a("d9e2"),a("14d9"),[]);function f(){return window.tinymce}var p=function(t,e){var a=document.getElementById(t),n=e||function(){};if(!a){var o=document.createElement("script");o.src=t,o.id=t,document.body.appendChild(o),m.push(n);var i="onload"in o?r:l;i(o)}function r(e){e.onload=function(){this.onerror=this.onload=null;var t,a=Object(d["a"])(m);try{for(a.s();!(t=a.n()).done;){var n=t.value;n(null,e)}}catch(o){a.e(o)}finally{a.f()}m=null},e.onerror=function(){this.onerror=this.onload=null,n(new Error("Failed to load "+t),e)}}function l(t){t.onreadystatechange=function(){if("complete"===this.readyState||"loaded"===this.readyState){this.onreadystatechange=null;var e,a=Object(d["a"])(m);try{for(a.s();!(e=a.n()).done;){var n=e.value;n(null,t)}}catch(o){a.e(o)}finally{a.f()}m=null}}}a&&n&&(f()?n(null,a):m.push(n))},h=p,g="https://cdn.jsdelivr.net/npm/tinymce-all-in-one@4.9.3/tinymce.min.js",b={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;h(g,(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:c,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(a){e.value&&a.setContent(e.value),e.hasInit=!0,a.on("NodeChange Change KeyUp SetContent",(function(){t.hasChange=!0,t.$emit("input",a.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=b,v=(a("1273"),a("2877")),w=Object(v["a"])(y,i,r,!1,null,"76d08426",null),_=w.exports,C={components:{Tinymce:_},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(){}}},k=C,F=(a("4e9a"),Object(v["a"])(k,n,o,!1,null,null,null));e["default"]=F.exports},"6f5e":function(t,e,a){},a888:function(t,e,a){"use strict";a("99af"),a("caad"),a("ac1f"),a("2532"),a("5319");var n={bind:function(t,e,a){var n=t.querySelector(".el-dialog__header"),o=t.querySelector(".el-dialog");n.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]}}();n.onmousedown=function(t){var e=t.clientX-n.offsetLeft,r=t.clientY-n.offsetTop,l=o.offsetWidth,c=o.offsetHeight,s=document.body.clientWidth,u=document.body.clientHeight,d=o.offsetLeft,m=s-o.offsetLeft-l,f=o.offsetTop,p=u-o.offsetTop-c,h=i(o,"left"),g=i(o,"top");h.includes("%")?(h=+document.body.clientWidth*(+h.replace(/\%/g,"")/100),g=+document.body.clientHeight*(+g.replace(/\%/g,"")/100)):(h=+h.replace(/\px/g,""),g=+g.replace(/\px/g,"")),document.onmousemove=function(t){var n=t.clientX-e,i=t.clientY-r;-n>d?n=-d:n>m&&(n=m),-i>f?i=-f:i>p&&(i=p),o.style.cssText+=";left:".concat(n+h,"px;top:").concat(i+g,"px;"),a.child.$emit("dragDialog")},document.onmouseup=function(t){document.onmousemove=null,document.onmouseup=null}}}},o=function(t){t.directive("el-drag-dialog",n)};window.Vue&&(window["el-drag-dialog"]=n,Vue.use(o)),n.install=o;e["a"]=n},c621:function(t,e,a){"use strict";a.d(e,"j",(function(){return o})),a.d(e,"b",(function(){return i})),a.d(e,"m",(function(){return r})),a.d(e,"f",(function(){return l})),a.d(e,"d",(function(){return c})),a.d(e,"h",(function(){return s})),a.d(e,"i",(function(){return u})),a.d(e,"g",(function(){return d})),a.d(e,"c",(function(){return m})),a.d(e,"a",(function(){return f})),a.d(e,"l",(function(){return p})),a.d(e,"e",(function(){return h})),a.d(e,"k",(function(){return g}));var n=a("b775");function o(t){return Object(n["a"])({url:"/template/category/search",method:"post",data:t})}function i(t){return Object(n["a"])({url:"/template/category/create",method:"post",data:t})}function r(t){return Object(n["a"])({url:"/template/category/update",method:"post",data:t})}function l(t){return Object(n["a"])({url:"/template/category/info",method:"post",data:t})}function c(t){return Object(n["a"])({url:"/template/category/delete",method:"post",data:t})}function s(t){return Object(n["a"])({url:"/template/pageTemplate",method:"post",data:t})}function u(t){return Object(n["a"])({url:"/template/search",method:"post",data:t})}function d(t){return Object(n["a"])({url:"/template/info",method:"post",data:t})}function m(t){return Object(n["a"])({url:"/template/delete",method:"post",data:t})}function f(t){return Object(n["a"])({url:"/template/create",method:"post",data:t})}function p(t){return Object(n["a"])({url:"/template/update",method:"post",data:t})}function h(t){return Object(n["a"])({url:"/template/category/allList",method:"post",data:t})}function g(t){return Object(n["a"])({url:"/template/category/treeCategory",method:"post",data:t})}},defe:function(t,e,a){"use strict";a.r(e);var n=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"data-list"},[a("el-table",{attrs:{data:t.dataList,"header-row-class-name":"headerBg","empty-text":"没有项目信息","max-height":t.tableMaxHeight}},[a("el-table-column",{attrs:{prop:"id",label:"ID",align:"center",width:"80"}}),a("el-table-column",{attrs:{prop:"name",label:"模块名称",align:"left"}}),a("el-table-column",{attrs:{prop:"type_name",label:"所属分类",align:"left"}}),a("el-table-column",{attrs:{prop:"create_time",label:"创建时间",align:"center"}}),a("el-table-column",{attrs:{prop:"status",label:"模板状态",align:"center"},scopedSlots:t._u([{key:"default",fn:function(e){return[5==e.row.status?a("div",[t._v("启用")]):t._e(),6==e.row.status?a("div",[t._v("停用")]):t._e()]}}])}),a("el-table-column",{attrs:{label:"操作",fixed:"right",align:"center",width:"300"},scopedSlots:t._u([{key:"default",fn:function(e){return[a("div",{staticClass:"btns"},[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(a){return t.btnEdit(e.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v("编辑模块")],1),a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(a){return t.EditorInfo(e.row)}}},[a("svg-icon",{attrs:{"icon-class":"edit"}}),t._v("修改信息")],1),a("el-button",{attrs:{type:"danger",size:"small"},on:{click:function(a){return t.btnDelete(e.row.id)}}},[a("svg-icon",{attrs:{"icon-class":"delete"}}),t._v("删除")],1)],1)]}}])})],1),a("div",{staticClass:"page-info"},[a("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),a("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}}},[a("el-form",{ref:"moduleRef",attrs:{model:t.moduleForm,rules:t.moduleRules,"label-position":"left","label-width":"100px"}},[a("el-form-item",{attrs:{label:"模块名称:",prop:"name"}},[a("el-input",{staticStyle:{width:"220px"},attrs:{placeholder:"请选择模块名称"},model:{value:t.moduleForm.name,callback:function(e){t.$set(t.moduleForm,"name",e)},expression:"moduleForm.name"}})],1),a("el-form-item",{attrs:{label:"所属分类:",prop:"category_id"}},[a("el-cascader",{attrs:{clearable:"",options:t.categoryList,props:t.props,"show-all-levels":!1,placeholder:"请选择模块分类"},on:{change:t.onChangeCategory},model:{value:t.moduleForm.category_id,callback:function(e){t.$set(t.moduleForm,"category_id",e)},expression:"moduleForm.category_id"}})],1),a("el-form-item",{attrs:{label:"模块状态:",prop:"status"}},[a("el-select",{staticClass:"m-2",attrs:{placeholder:"请选择模板块态",size:"large"},model:{value:t.moduleForm.status,callback:function(e){t.$set(t.moduleForm,"status",e)},expression:"moduleForm.status"}},t._l(t.statusOptions,(function(t){return a("el-option",{key:t.value,attrs:{label:t.label,value:t.value}})})),1)],1)],1),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:t.closeModule}},[t._v("取 消")]),a("el-button",{attrs:{type:"primary"},on:{click:t.submitModule}},[t._v("确 定")])],1)],1)],1)},o=[],i=a("c7eb"),r=a("1da1"),l=a("ade3"),c=a("5530"),s=(a("4de4"),a("14d9"),a("d3b7"),a("ac1f"),a("841c"),a("0643"),a("2382"),a("2f62")),u=a("c621"),d=a("6c7c"),m=a("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(c["a"])({},Object(s["b"])(["roleInfo","authList"])),data:function(){return Object(l["a"])(Object(l["a"])(Object(l["a"])(Object(l["a"])(Object(l["a"])(Object(l["a"])(Object(l["a"])({dialogVisible:!1,currentDataId:0,recordCount:0,pageTotal:1,dataList:[],currentData:{}},"dialogVisible",!1),"moduleForm",{name:"",status:5,category_id:""}),"moduleRules",{name:[{required:!0,message:"请输模块名称",trigger:"blur"}],status:[{required:!0,message:"请选择状态",trigger:"change"}],category_id:[{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)},mounted:function(){this.search(),this.initCategoryList()},methods:{onChangeCategory:function(){},closeModule:function(){this.dialogVisible=!1,this.moduleForm={name:"",status:5,category_id:""}},submitModule:function(){var t=this;this.$refs.moduleRef.validate((function(e){e&&Object(u["l"])(t.moduleForm).then((function(e){200===e.status&&(t.$message.success("修改成功!"),t.dialogVisible=!1,t.moduleForm={name:"",status:5,category_id:""},t.onSubmit())}))}))},initCategoryList:function(){var t=this;return Object(r["a"])(Object(i["a"])().mark((function e(){var a;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:a=e.sent,t.categoryList=a.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,a={id:t};e.$confirm("您是否确认删除该记录?","提示",{confirmButtonText:"确认",cancelButtonText:"取消",type:"warning"}).then((function(t){Object(u["c"])(a).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()}}},p=f,h=(a("ea06"),a("2877")),g=Object(h["a"])(p,n,o,!1,null,null,null);e["default"]=g.exports},ea06:function(t,e,a){"use strict";a("3ff5")}}]);
|