{"remainingRequest":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/thread-loader/dist/cjs.js!/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/babel-loader/lib/index.js!/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/cache-loader/dist/cjs.js??ref--0-0!/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/src/components/Common/CodeMirror.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/src/components/Common/CodeMirror.vue","mtime":1701674859498},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/cache-loader/dist/cjs.js","mtime":1701674874584},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/thread-loader/dist/cjs.js","mtime":1701674873947},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/babel-loader/lib/index.js","mtime":1701674874357},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/cache-loader/dist/cjs.js","mtime":1701674874584},{"path":"/data/jenkins/workspace/test-v5in-source-front-01/src/badp-bcxin-5.x/obpm-designer-web/node_modules/vue-loader/lib/index.js","mtime":1701674874903}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\nimport { iscriptString } from \"../../assets/js/chartExample.js\"; // 核心样式\n\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: \"codeMirror\",\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 };\n },\n methods: {\n // 获取编辑器的值\n getEditor: function getEditor() {\n return this.editor.doc.getValue();\n },\n // 将值传给父组件去更新\n setEditor: function setEditor() {\n this.$emit(\"setEditor\", iscriptString(this.typeChart));\n return this.editor.doc.setValue(iscriptString(this.typeChart));\n },\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 refreshValue: function refreshValue() {\n alert();\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.code || '');\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 watch: {\n editorHeight: function editorHeight() {\n this.editor.setSize(\"auto\", this.editorHeight);\n },\n code: function code() {\n var _this4 = this;\n\n this.$nextTick(function () {\n _this4._initEditor();\n });\n },\n wrapStyle: function wrapStyle() {\n var _this5 = this;\n\n setTimeout(function () {\n _this5.refresh();\n }, 100);\n }\n },\n computed: {\n wrapStyle: function wrapStyle() {\n return {\n fontSize: this.fontSize + \"px\"\n };\n }\n },\n props: {\n fontSize: {\n type: String\n },\n // 内部真实的内容\n code: {\n type: String,\n default: \"\"\n },\n // 图表类型\n typeChart: {\n type: String,\n default: \"\"\n },\n // 脚本编辑器高度\n editorHeight: {\n type: String,\n default: \"600px\"\n }\n }\n};",null]}