vue2-client 1.8.112 → 1.8.114
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue2-client",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.114",
|
|
4
4
|
"private": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"serve": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve --no-eslint",
|
|
@@ -43,6 +43,7 @@
|
|
|
43
43
|
"videojs-contrib-hls": "^5.15.0",
|
|
44
44
|
"viser-vue": "^2.4.8",
|
|
45
45
|
"vue": "^2.7.14",
|
|
46
|
+
"vue-codemirror": "4.0.6",
|
|
46
47
|
"vue-i18n": "^8.28.2",
|
|
47
48
|
"vue-json-viewer": "^2.2.22",
|
|
48
49
|
"vue-router": "^3.6.5",
|
|
Binary file
|
|
@@ -48,6 +48,7 @@ const GetAppDataService = {
|
|
|
48
48
|
}
|
|
49
49
|
})
|
|
50
50
|
},
|
|
51
|
+
// 旧版获取配置中心字典
|
|
51
52
|
getDictionaryList (key) {
|
|
52
53
|
const str = localStorage.getItem(process.env.VUE_APP_DICTIONARY_KEY)
|
|
53
54
|
const object = JSON.parse(str)
|
|
@@ -78,6 +79,12 @@ const GetAppDataService = {
|
|
|
78
79
|
return processResult(result)
|
|
79
80
|
}
|
|
80
81
|
},
|
|
82
|
+
// 新版获取配置中心字典推荐使用 服务名默认为当前服务
|
|
83
|
+
getDictByKey (dictKey, serviceName = process.env.VUE_APP_SYSTEM_NAME, callback) {
|
|
84
|
+
getConfigByName(dictKey, undefined, result => {
|
|
85
|
+
callback(result.value)
|
|
86
|
+
})
|
|
87
|
+
},
|
|
81
88
|
getParam (key, value, callback) {
|
|
82
89
|
const str = localStorage.getItem(process.env.VUE_APP_BADGE_KEY)
|
|
83
90
|
const object = JSON.parse(str)
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<codemirror
|
|
3
|
+
v-model="item"
|
|
4
|
+
:options="cmOption"
|
|
5
|
+
class="code-mirror"
|
|
6
|
+
:style="{fontSize}"
|
|
7
|
+
@ready="onCmReady"
|
|
8
|
+
@focus="onCmFocus"
|
|
9
|
+
@input="onCmCodeChange"
|
|
10
|
+
ref="myCmGenerate"></codemirror>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import { codemirror } from 'vue-codemirror'
|
|
15
|
+
import 'codemirror/mode/javascript/javascript.js'
|
|
16
|
+
import './setting.js'
|
|
17
|
+
// https://github.com/surmon-china/vue-codemirror/tree/v4.0.6
|
|
18
|
+
export default {
|
|
19
|
+
components: {
|
|
20
|
+
codemirror
|
|
21
|
+
},
|
|
22
|
+
props: {
|
|
23
|
+
value: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: ''
|
|
26
|
+
},
|
|
27
|
+
readonly: {
|
|
28
|
+
type: Boolean,
|
|
29
|
+
default: false
|
|
30
|
+
},
|
|
31
|
+
mode: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'sql' // 目前只有 sql/go 如果需要配置其他语言,需要在 setting.js 中配置 更多看官方文档
|
|
34
|
+
},
|
|
35
|
+
fontSize: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: '16px'
|
|
38
|
+
},
|
|
39
|
+
theme: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: 'dracula'
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
watch: {},
|
|
45
|
+
data () {
|
|
46
|
+
return {
|
|
47
|
+
item: this.value,
|
|
48
|
+
cmOption: {
|
|
49
|
+
autoCloseBrackets: true,
|
|
50
|
+
extraKeys: { Ctrl: 'autocomplete' },
|
|
51
|
+
foldGutter: true,
|
|
52
|
+
gutters: ['CodeMirror-linenumbers', 'CodeMirror-foldgutter'],
|
|
53
|
+
highlightSelectionMatches: { showToken: /\w/, annotateScrollbar: true },
|
|
54
|
+
hintOptions: { completeSingle: false },
|
|
55
|
+
keyMap: 'sublime',
|
|
56
|
+
line: true,
|
|
57
|
+
lineNumbers: true,
|
|
58
|
+
matchBrackets: true,
|
|
59
|
+
mode: { name: this.mode, json: true },
|
|
60
|
+
readOnly: this.readonly ? 'nocursor' : undefined,
|
|
61
|
+
showCursorWhenSelecting: true,
|
|
62
|
+
styleActiveLine: true,
|
|
63
|
+
styleSelectedText: true,
|
|
64
|
+
tabSize: 2,
|
|
65
|
+
theme: this.theme,
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
methods: {
|
|
70
|
+
onCmReady () {
|
|
71
|
+
this.$refs.myCmGenerate.codemirror.setSize('400px', '400px')
|
|
72
|
+
},
|
|
73
|
+
onCmFocus (instance, event) {
|
|
74
|
+
// console.log(instance)
|
|
75
|
+
// console.log(event)
|
|
76
|
+
},
|
|
77
|
+
onCmCodeChange (instance, _obj) {
|
|
78
|
+
this.$emit('input', instance)
|
|
79
|
+
// console.log(instance)
|
|
80
|
+
// console.log(_obj)
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
</script>
|
|
85
|
+
<style lang="less" scoped>
|
|
86
|
+
.CodeMirror-scroll {
|
|
87
|
+
overflow: scroll !important;
|
|
88
|
+
margin-bottom: 0;
|
|
89
|
+
margin-right: 0;
|
|
90
|
+
padding-bottom: 0;
|
|
91
|
+
height: 100%;
|
|
92
|
+
outline: none;
|
|
93
|
+
position: relative;
|
|
94
|
+
border: 1px solid #dddddd;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
@font-face {
|
|
98
|
+
font-family: 'JetBrains Mono';
|
|
99
|
+
src: url('@vue2-client/assets/ttf/JetBrainsMono-Light.woff2') format('woff2'), /* 字体文件路径和格式 */
|
|
100
|
+
url('@vue2-client/assets/ttf/JetBrainsMono-Light.woff2') format('woff');
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.code-mirror {
|
|
104
|
+
line-height: 150%;
|
|
105
|
+
text-align: left;
|
|
106
|
+
font-family: "JetBrains Mono",serif !important;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
:deep(.CodeMirror-line),:deep(.CodeMirror-line-like) {
|
|
110
|
+
font-family: "JetBrains Mono",serif !important;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
</style>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import 'codemirror/lib/codemirror.css'
|
|
2
|
+
// require active-line.js
|
|
3
|
+
import 'codemirror/addon/selection/active-line.js'
|
|
4
|
+
// styleSelectedText
|
|
5
|
+
import 'codemirror/addon/selection/mark-selection.js'
|
|
6
|
+
// hint
|
|
7
|
+
import 'codemirror/addon/hint/show-hint.js'
|
|
8
|
+
import 'codemirror/addon/hint/sql-hint.js'
|
|
9
|
+
import 'codemirror/addon/hint/show-hint.css'
|
|
10
|
+
import 'codemirror/addon/hint/javascript-hint.js'
|
|
11
|
+
// highlightSelectionMatches
|
|
12
|
+
import 'codemirror/addon/scroll/annotatescrollbar.js'
|
|
13
|
+
import 'codemirror/addon/search/matchesonscrollbar.js'
|
|
14
|
+
import 'codemirror/addon/search/match-highlighter.js'
|
|
15
|
+
// keyMap
|
|
16
|
+
import 'codemirror/mode/go/go.js'
|
|
17
|
+
import 'codemirror/mode/sql/sql.js'
|
|
18
|
+
import 'codemirror/addon/edit/matchbrackets.js'
|
|
19
|
+
import 'codemirror/addon/comment/comment.js'
|
|
20
|
+
import 'codemirror/addon/dialog/dialog.js'
|
|
21
|
+
import 'codemirror/addon/dialog/dialog.css'
|
|
22
|
+
import 'codemirror/addon/search/searchcursor.js'
|
|
23
|
+
import 'codemirror/addon/search/search.js'
|
|
24
|
+
import 'codemirror/keymap/sublime.js'
|
|
25
|
+
// foldGutter
|
|
26
|
+
import 'codemirror/addon/fold/foldgutter.css'
|
|
27
|
+
import 'codemirror/addon/fold/brace-fold.js'
|
|
28
|
+
import 'codemirror/addon/fold/comment-fold.js'
|
|
29
|
+
import 'codemirror/addon/fold/foldcode.js'
|
|
30
|
+
import 'codemirror/addon/fold/foldgutter.js'
|
|
31
|
+
import 'codemirror/addon/fold/indent-fold.js'
|
|
32
|
+
import 'codemirror/addon/fold/markdown-fold.js'
|
|
33
|
+
import 'codemirror/addon/fold/xml-fold.js'
|
|
34
|
+
// 编辑的主题文件
|
|
35
|
+
import 'codemirror/theme/dracula.css'
|
|
36
|
+
import 'codemirror/theme/base16-light.css'
|
|
37
|
+
// 括号自动不全
|
|
38
|
+
import 'codemirror/addon/edit/closebrackets.js'
|