(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6601b677","chunk-4635d4c5"],{"04e8":function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e._self._c;return t("ant-modal",{attrs:{modalWidth:"1500",modalHeight:"800",visible:e.open,"modal-title":e.formTitle,"adjust-size":!0},on:{cancel:e.cancel}},[t("template",{slot:"content"},[e.editorOpen?t("monaco-editor",{ref:"monacoRef",attrs:{monacoId:"monaco_editor_diff",height:"40rem","diff-value":e.modifiedSource,"show-diff":!0,language:e.sourceLanguage},model:{value:e.originalSource,callback:function(t){e.originalSource=t},expression:"originalSource"}}):e._e()],1),t("template",{slot:"footer"},[t("a-button",{on:{click:e.cancel}},[e._v(" 关闭 ")])],1)],2)},o=[],n=i("3d3e"),r=i("2dd7"),s=function(){var e=this,t=e._self._c;return t("div",{staticClass:"m-e",attrs:{id:"m-e-id"}},[t("div",{staticClass:"m-e-main"},[t("div",{staticClass:"m-e-main_toolbar",class:e.isThemeLightOrBlack?"themeLight":"themeBlack"},[t("div",{staticClass:"m-e-main_toolbar_left"},[t("span",[e._v(e._s(e.title))])]),t("div",{staticClass:"m-e-main_toolbar_right",class:e.isThemeLightOrBlack?"themeLightToolbar":"themeBlackToolbar"},[t("a",{attrs:{title:"查找"},on:{click:e.findByKeyword}},[t("i",{staticClass:"fa fa-search"})]),t("a",{attrs:{title:"回到顶部"},on:{click:e.scrollToTop}},[t("i",{staticClass:"fa fa-chevron-circle-up"})]),t("a",{attrs:{title:"回到底部"},on:{click:e.scrollToBottom}},[t("i",{staticClass:"fa fa-chevron-circle-down"})]),t("a",{attrs:{title:"切换白天或暗夜模式"},on:{click:e.setEditorTheme}},[t("i",{staticClass:"fa fa-adjust"})]),t("a",{attrs:{title:"切换显示方式"},on:{click:e.setRenderSide}},[t("i",{staticClass:"fa fa-columns"})]),t("select",{staticClass:"language-picker",class:e.isThemeLightOrBlack?"themeLightSelect":"themeBlackSelect",attrs:{title:"语言",id:"language-picker"},on:{change:e.languagePickerChange}},e._l(e.languageOptions,(function(i,a){return t("option",{key:a,domProps:{value:i.value}},[e._v(e._s(i.value))])})),0)])]),t("div",{key:Math.random(),staticClass:"m-e-main_container",style:{width:e.width,height:e.height},attrs:{id:e.monacoId}})])])},c=[],d=i("c7eb"),l=i("1da1"),u=(i("4de4"),i("d81d"),i("4e82"),i("4ec9"),i("a9e3"),i("b64b"),i("d3b7"),i("3ca3"),i("ddb0"),i("1f54"),i("33f9")),h={name:"MonacoDiffEditor",props:{monacoId:{type:String,default:"monacoDiffEditor"},title:{type:String},value:{type:String,default:""},readOnly:{type:Boolean,default:!1},selectOnLineNumbers:{type:Boolean,default:!0},minimap:{type:Boolean,default:!0},language:{type:String,default:"css"},fontSize:{type:Number,default:12},theme:{type:String,default:"vs"},width:{type:String,default:"100%"},height:{type:String,default:"600px"},diffValue:{type:String,default:""}},data:function(){return{monacoEditor:null,isThemeLightOrBlack:!0,content:this.value,languageOptions:[],diffContent:this.diffValue,renderSideBySide:!0,useTheme:this.theme}},mounted:function(){this.getLanguageOptions(),this.initDiffEditor()},beforeDestroy:function(){this.monacoEditor&&this.monacoEditor.dispose(),this.content="",this.diffContent=""},methods:{initDiffEditor:function(){var e=this;return Object(l["a"])(Object(d["a"])().mark((function t(){var i;return Object(d["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:return i=e,t.next=3,document.getElementById(i.monacoId);case 3:i.monacoEditor=u.editor.createDiffEditor(document.getElementById(i.monacoId),{automaticLayout:!0,theme:i.useTheme,selectOnLineNumbers:i.selectOnLineNumbers,readOnly:!0,fontSize:i.fontSize,contextmenu:!1,roundedSelection:!1,minimap:{enabled:!1},overviewRulerLanes:0,overviewRulerBorder:!0,renderSideBySide:e.renderSideBySide}),i.monacoEditor.setModel({original:u.editor.createModel(e.content,e.language),modified:u.editor.createModel(e.diffContent,e.language)}),i.scrollToTop();case 6:case"end":return t.stop()}}),t)})))()},findByKeyword:function(){try{this.monacoEditor.focus(),this.monacoEditor.setSelection(new u.Range(1,9999,1,1e4)),this.monacoEditor.trigger("","actions.find")}catch(e){}},setEditorTheme:function(){this.isThemeLightOrBlack=!this.isThemeLightOrBlack,this.useTheme=this.isThemeLightOrBlack?"vs":"vs-dark",this.monacoEditor&&this.monacoEditor.dispose(),this.initDiffEditor()},setEditorLanguage:function(e){if(e){var t={},i=this.monacoEditor.getModel();Object.keys(i).map((function(a){var o=i[a].getValue();t[a]=u.editor.createModel(o,e),i[a]&&i[a].dispose()})),this.monacoEditor.setModel(t)}},scrollToTop:function(){this.monacoEditor.revealLine(0)},scrollToBottom:function(){var e=0,t=this.monacoEditor.getModel();t&&Object.keys(t).map((function(i){var a=t[i].getLineCount()||0;a>e&&(e=a)})),this.monacoEditor.revealLine(e)},setRenderSide:function(){this.renderSideBySide=!this.renderSideBySide,this.monacoEditor&&this.monacoEditor.dispose(),this.initDiffEditor()},languagePickerChange:function(e){var t=e.target.value;this.setEditorLanguage(t)},getLanguageOptions:function(){var e=u.languages.getLanguages().map((function(e){return e.id}));e.sort();var t=[];e.map((function(e){t.push({value:e})}));var i=new Map;this.languageOptions=t.filter((function(e){return!i.has(e.value)&&i.set(e.value,1)}))}}},f=h,m=(i("9cb0"),i("2877")),g=Object(m["a"])(f,s,c,!1,null,"0187d66c",null),p=g.exports,v={name:"ResourceDiff",props:{},components:{AntModal:r["a"],MonacoEditor:p},data:function(){return{open:!1,formTitle:"内容比对",editorOpen:!1,sourceLanguage:"html",originalSource:"",modifiedSource:"",dataId:void 0}},filters:{},created:function(){},computed:{},watch:{},mounted:function(){},methods:{show:function(e){this.reset(),e&&(this.dataId=e.dataId,this.getResourceData(this.dataId)),this.open=!0},cancel:function(){this.open=!1,this.reset()},reset:function(){var e=this.$options.data();e&&(this.editorOpen=e.editorOpen,this.originalSource=e.originalSource,this.modifiedSource=e.modifiedSource)},getResourceData:function(e){var t=this;Object(n["a"])({id:e}).then((function(e){var i=e.data;t.modifiedSource=i.modified||"",t.originalSource=i.original||"",t.editorOpen=!0}))}}},y=v,b=Object(m["a"])(y,a,o,!1,null,null,null);t["default"]=b.exports},"3d3e":function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return n})),i.d(t,"a",(function(){return r}));var a=i("b775");function o(e){return Object(a["b"])({url:"/cms/cmsResourceHistory/list",method:"get",params:e})}function n(e){return Object(a["b"])({url:"/cms/cmsResourceHistory/useVersion",method:"get",params:e})}function r(e){return Object(a["b"])({url:"/cms/cmsResourceHistory/diffVersion",method:"get",params:e})}},"3ecd":function(e,t,i){},"774a":function(e,t,i){"use strict";i.r(t);i("99af");var a=function(){var e=this,t=e._self._c;return t("ant-modal",{attrs:{modalWidth:"1200",modalHeight:"550",visible:e.open,"modal-title":e.formTitle,"adjust-size":!0},on:{cancel:e.cancel}},[t("template",{slot:"content"},[t("a-card",{staticClass:"table-card",attrs:{bordered:!1}},[e.showDiffModal?t("cms-resource-diff",{ref:"cmsResourceDiff",on:{close:function(t){e.showDiffModal=!1}}}):e._e(),t("advance-table",{attrs:{title:e.formTitle,pagination:{current:e.queryParam.pageNum,pageSize:e.queryParam.pageSize,total:e.total,showSizeChanger:!0,showLessItems:!0,showQuickJumper:!0,showTotal:function(e,t){return"第 ".concat(t[0],"-").concat(t[1]," 条，总计 ").concat(e," 条")},onChange:e.changeSize,onShowSizeChange:e.onShowSizeChange},tableKey:"base-cmsResourceVersion-index-table",rowKey:"id",size:"middle",columns:e.columns,"data-source":e.tableList,loading:e.loading,"format-conditions":!0},on:{change:e.handleTableChange,refresh:e.getList},scopedSlots:e._u([{key:"num",fn:function(i){i.text,i.record;var a=i.index;return t("span",{},[e._v(" "+e._s((e.queryParam.pageNum-1)*e.queryParam.pageSize+parseInt(a)+1)+" ")])}},{key:"resourcePath",fn:function(i){var a=i.text;i.record;return t("span",{},[e._v(" "+e._s(a||e.defaultValue)+" ")])}},{key:"historyVersion",fn:function(i){var a=i.text;i.record;return t("span",{},[e._v(" "+e._s(a||e.defaultValue)+" ")])}},{key:"originalSource",fn:function(i){var a=i.text;i.record;return t("span",{},[e._v(" "+e._s((a?a.substring(0,200):e.defaultValue)||e.defaultValue)+" ")])}},{key:"createTime",fn:function(i){var a=i.text;i.record;return t("span",{},[e._v(" "+e._s(e.parseTime(a,"{y}-{m}-{d}")||e.defaultValue)+" ")])}},{key:"operation",fn:function(i){i.text;var a=i.record;return t("span",{},[t("a",{staticStyle:{color:"#2f54eb"},on:{click:function(t){return e.handleDiff(a)}}},[e._v("查看")]),t("a-divider",{attrs:{type:"vertical"}}),t("a",{staticStyle:{color:"#2f54eb"},on:{click:function(t){return e.handleUseVersion(a)}}},[e._v("使用")])],1)}}])},[t("div",{staticClass:"table-operations",attrs:{slot:"button"},slot:"button"},[t("a-button",{attrs:{type:"default"},on:{click:e.resetQuery}},[t("a-icon",{attrs:{type:"redo"}}),e._v("刷新")],1)],1)])],1)],1),t("template",{slot:"footer"},[t("a-button",{attrs:{disabled:e.disabled},on:{click:e.cancel}},[e._v(" 关闭 ")])],1)],2)},o=[],n=(i("d81d"),i("3d3e")),r=i("2dd7"),s=i("5d9e"),c=i("04e8"),d={name:"CmsResourceVersion",components:{AntModal:r["a"],AdvanceTable:s["a"],CmsResourceDiff:c["default"]},props:{},data:function(){return{open:!1,formTitle:"历史记录",disabled:!1,loading:!0,ids:[],selectedRowKeys:[],selectedRows:[],advanced:!1,single:!0,multiple:!0,total:0,dateRange:[],labelCol:{span:6},wrapperCol:{span:18},tableList:[],defaultValue:"-/-",queryParam:{pageNum:1,pageSize:10,resourcePath:void 0},columns:[{title:"序号",dataIndex:"num",width:50,align:"center",scopedSlots:{customRender:"num"}},{title:"文件路径",dataIndex:"resourcePath",width:180,ellipsis:!0,align:"center",scopedSlots:{customRender:"resourcePath"}},{title:"版本内容（概要）",dataIndex:"originalSource",ellipsis:!0,align:"left",copedSlots:{customRender:"originalSource"}},{title:"版本",dataIndex:"historyVersion",width:80,align:"center",scopedSlots:{customRender:"historyVersion"}},{title:"创建时间",dataIndex:"createTime",width:100,align:"center",scopedSlots:{customRender:"createTime"}},{title:"操作",dataIndex:"operation",width:100,align:"center",scopedSlots:{customRender:"operation"}}],resourceType:void 0,resourcePath:void 0,showDiffModal:!1}},created:function(){},methods:{show:function(e){e&&(this.resourceType=e.resourceType,this.resourcePath=e.resourcePath),this.resetQuery(),this.open=!0},cancel:function(){this.open=!1,this.resetQuery(),this.$emit("close")},getList:function(){var e=this;this.resourcePath?(this.loading=!0,this.queryParam.resourcePath=this.resourcePath,Object(n["b"])(this.queryParam).then((function(t){e.tableList=t.data.list,e.total=t.data.total,e.loading=!1}))):this.loading=!1},handleQuery:function(){this.queryParam.pageNum=1,this.getList()},resetQuery:function(){this.queryParam=this.$options.data().queryParam,this.handleQuery()},onShowSizeChange:function(e,t){this.queryParam.pageSize=t,this.getList()},onSizeChange:function(e,t){this.queryParam.pageNum=1,this.queryParam.pageSize=t,this.getList()},changeSize:function(e,t){this.queryParam.pageNum=e,this.queryParam.pageSize=t,this.getList()},onSelectChange:function(e,t){this.selectedRowKeys=e,this.selectedRows=t,this.ids=this.selectedRows.map((function(e){return e.id})),this.single=1!==e.length,this.multiple=!e.length},toggleAdvanced:function(){this.advanced=!this.advanced},handleTableChange:function(e,t,i){void 0!==i.field&&null!==i.field&&""!==i.field&&(this.queryParam.orderByColumn="a."+i.field,this.queryParam.isAsc=i.order),this.getList()},handleUseVersion:function(e){var t=this;this.$confirm({title:"确认是否使用该版本",content:"提示：原文件内容将会被覆盖！",onOk:function(){Object(n["c"])({id:e.id}).then((function(e){t.$message.success("操作成功",3),t.open=!1,t.$emit("ok"),t.$emit("close"),t.disabled=!1}))},onCancel:function(){}})},handleDiff:function(e){var t=this;this.showDiffModal=!0,this.$nextTick((function(){return t.$refs.cmsResourceDiff.show({dataId:e.id})}))}}},l=d,u=i("2877"),h=Object(u["a"])(l,a,o,!1,null,null,null);t["default"]=h.exports},"9cb0":function(e,t,i){"use strict";i("3ecd")}}]);