diff --git a/package.json b/package.json index b4607bb..39fa0ad 100644 --- a/package.json +++ b/package.json @@ -39,36 +39,40 @@ "@riophae/vue-treeselect": "0.4.0", "axios": "0.24.0", "clipboard": "2.0.8", + "codemirror": "^5.65.12", "core-js": "3.25.3", "echarts": "5.4.0", "element-ui": "2.15.14", "file-saver": "2.0.5", "fuse.js": "6.4.3", "highlight.js": "9.18.5", + "jquery": "^3.5.1", "js-beautify": "1.13.0", "js-cookie": "3.0.1", "jsencrypt": "3.0.0-rc.1", "jsplumb": "^2.15.6", "nprogress": "0.2.0", + "panzoom": "^9.4.1", "quill": "1.3.7", "screenfull": "5.0.2", "sortablejs": "1.10.2", + "view-design": "^4.5.0-beta.3", "vue": "2.6.12", + "vue-click-outside": "^1.1.0", + "vue-codemirror": "^4.0.6", + "vue-contextmenujs": "^1.3.13", "vue-count-to": "1.0.13", "vue-cropper": "0.5.5", "vue-meta": "2.4.0", - "vuedraggable": "2.24.3", - "jquery": "^3.5.1", - "panzoom": "^9.4.1", - "view-design": "^4.5.0-beta.3", - "vue-click-outside": "^1.1.0", - "vue-contextmenujs": "^1.3.13", "vue-router": "^3.2.0", + "vuedraggable": "2.24.3", "vuex": "^3.4.0" }, "devDependencies": { "@vue/cli-plugin-babel": "4.4.6", "@vue/cli-plugin-eslint": "4.4.6", + "@vue/cli-plugin-router": "~4.5.0", + "@vue/cli-plugin-vuex": "~4.5.0", "@vue/cli-service": "4.4.6", "babel-eslint": "10.1.0", "babel-plugin-dynamic-import-node": "2.3.3", @@ -77,17 +81,15 @@ "connect": "3.6.6", "eslint": "7.15.0", "eslint-plugin-vue": "7.2.0", + "less": "^3.0.4", + "less-loader": "^5.0.0", "lint-staged": "10.5.3", "runjs": "4.4.2", "sass": "1.32.13", "sass-loader": "10.1.1", "script-ext-html-webpack-plugin": "2.1.5", "svg-sprite-loader": "5.1.1", - "vue-template-compiler": "2.6.12", - "@vue/cli-plugin-router": "~4.5.0", - "@vue/cli-plugin-vuex": "~4.5.0", - "less": "^3.0.4", - "less-loader": "^5.0.0" + "vue-template-compiler": "2.6.12" }, "engines": { "node": ">=8.9", diff --git a/src/main.js b/src/main.js index b264e8e..4aa6871 100644 --- a/src/main.js +++ b/src/main.js @@ -40,7 +40,11 @@ import DictTag from '@/components/DictTag' import VueMeta from 'vue-meta' // 字典数据组件 import DictData from '@/components/DictData' +//codemirror +import VueCodemirror from 'vue-codemirror' +import 'codemirror/lib/codemirror.css' +Vue.use(VueCodemirror) // 全局方法挂载 Vue.prototype.getDicts = getDicts Vue.prototype.getConfigKey = getConfigKey diff --git a/src/views/rule/rule/version.vue b/src/views/rule/rule/version.vue index 94a29e3..d2b19dc 100644 --- a/src/views/rule/rule/version.vue +++ b/src/views/rule/rule/version.vue @@ -303,6 +303,7 @@ + 生成版本类 @@ -328,7 +329,8 @@ - + + @@ -382,10 +386,25 @@ import {getRule, delRule} from "/src/api/rule/rule"; import {getEditionList, addRule, enable, disable, updateRule, getFindByEditionId} from "@/api/rule/ruleEdition"; + +import {codemirror} from 'vue-codemirror' +import "codemirror/theme/ambiance.css"; // 这里引入的是主题样式,根据设置的theme的主题引入,一定要引入!! +require("codemirror/mode/javascript/javascript"); // 这里引入的模式的js,根据设置的mode引入,一定要引入! + export default { name: "Rule", data() { return { + + curCode: '测---------------------------------------试', + cmOptions: { + lineNumbers: true, // 显示行号 + mode: 'text/x-yaml', // 语法model + gutters: ['CodeMirror-lint-markers'], // 语法检查器 + theme: "ambiance", + lint: true, // 开启语法检查 + }, + ruleAndEditionList: [], //版本 ruleAndEdition: {}, @@ -429,7 +448,7 @@ export default { rule: {}, // 表单参数 form: { - id:'', + id: '', ruleKind: '', name: '', ruleCoding: '', @@ -604,6 +623,17 @@ export default { ...this.queryParams }, `rule_${new Date().getTime()}.xlsx`) } - } + }, + components: { + codemirror + }, + }; +