{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/cache-loader/dist/cjs.js??ref--0-0!/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/src/components/admin/CompanyAdmin/ScriptEditor.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/src/components/admin/CompanyAdmin/ScriptEditor.vue","mtime":1742796810165},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/babel.config.js","mtime":1742796810089},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-kms/src/badp-bcxin-5.x/obpm-kms-web/kmspc/node_modules/vue-loader/lib/index.js","mtime":1655715099000}],"contextDependencies":[],"result":["// 核心样式\nimport \"codemirror/lib/codemirror.css\"; // 引入主题后还需要在 options 中指定主题才会生效\n// 需要引入具体的语法高亮库才会有对应的语法高亮效果\n\nimport \"codemirror/mode/javascript/javascript.js\"; // require active-line.js\n\nimport \"codemirror/addon/selection/active-line.js\";\n\nvar CodeMirror = require(\"codemirror/lib/codemirror\");\n\nexport default {\n name: 'ScriptEditor',\n data: function data() {\n return {\n editor: null,\n options: {\n mode: \"javascript\",\n tabSize: 0,\n // 缩进格式\n lineNumbers: true,\n // 显示行号\n // autofocus: true, //初始化时自动获取焦点\n autoRefresh: true\n },\n fontSize: 12,\n code: ''\n };\n },\n methods: {\n // 弹框关闭回调\n handleClose: function handleClose() {\n this.$emit(\"closeScriptEditorDialog\");\n },\n // 回退上一步\n preStep: function preStep() {\n // 判断是否与原来的代码一致,一致就操作\n var chartCode = this.code;\n\n if (chartCode !== this.getEditor()) {\n this.editor.doc.undo();\n }\n },\n // 下一步\n nextStep: function nextStep() {\n this.editor.doc.redo();\n },\n // 获取编辑器的值\n getEditor: function getEditor() {\n return this.editor.doc.getValue();\n },\n // 将值传给父组件去更新\n setEditor: function setEditor() {},\n // 传值进来设置\n setCodeEditor: function setCodeEditor(val) {\n var _this = this;\n\n this.editor.doc.setValue(val);\n setTimeout(function () {\n _this.editor.refresh();\n }, 100);\n },\n undo: function undo() {\n // 判断是否与原来的代码一致,一致就操作\n var chartCode = this.code;\n\n if (chartCode !== this.getEditor()) {\n this.editor.doc.undo();\n }\n },\n redo: function redo() {\n this.editor.doc.redo();\n },\n refresh: function refresh() {\n var _this2 = this;\n\n // return this.editor.refresh();\n setTimeout(function () {\n _this2.editor.refresh();\n }, 1);\n },\n confirm: function confirm() {\n // 写入文本框中\n this.$emit(\"saveScriptEditor\", this.editor.doc.getValue());\n this.$emit(\"closeScriptEditorDialog\");\n },\n cancel: function cancel() {\n this.$emit(\"closeScriptEditorDialog\");\n },\n _initEditor: function _initEditor() {\n if (!this.editor) {\n this.editor = CodeMirror.fromTextArea(this.$refs.mycode, this.options);\n }\n\n this.editor.setValue(this.value || this.editorCode || '');\n this.editor.setSize(\"auto\", this.editorHeight);\n }\n },\n mounted: function mounted() {\n var _this3 = this;\n\n this.$nextTick(function () {\n _this3._initEditor();\n });\n },\n props: {\n scriptEditorVisible: Boolean,\n editorCode: String,\n // 脚本编辑器高度\n editorHeight: {\n type: String,\n default: \"350px\"\n }\n }\n};",null]}