sh-view 1.5.2 → 1.6.0
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/package.json +7 -6
- package/packages/components/global-components/sh-code-editor/index.vue +64 -40
- package/packages/components/global-components/sh-code-editor/themes/dark.js +100 -0
- package/packages/components/global-components/sh-code-editor/themes/dracula.js +100 -0
- package/packages/components/global-components/sh-code-editor/themes/index.js +7 -0
- package/packages/components/global-components/sh-icon/index.vue +1 -1
- package/packages/components/global-components/sh-iv-form/index.vue +1 -1
- package/packages/components/global-components/sh-upload/components/u-list.vue +1 -1
- package/packages/components/global-components/sh-upload/index.vue +1 -1
- package/packages/components/global-components/sh-vxe-table/index.vue +1 -1
- package/packages/components/global-components/sh-vxe-tree/index.vue +2 -2
- package/packages/components/global-components/sh-vxe-tree/vxe-direct-tree.vue +1 -1
- package/packages/components/global-components/sh-vxe-tree/vxe-select-tree.vue +1 -1
- package/packages/components/global-components/sh-word/index.vue +6 -10
- package/packages/components/index.js +25 -25
- package/packages/components/other-components/sh-menu-card/index.vue +1 -1
- package/packages/vxeTable/index.js +1 -1
- package/packages/vxeTable/render/{globalRenders.js → globalRenders.jsx} +22 -22
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sh-view",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "基于vxe-table、view-ui-plus二次封装",
|
|
5
5
|
"main": "packages/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -19,25 +19,26 @@
|
|
|
19
19
|
"@tinymce/tinymce-vue": "^5.0.0",
|
|
20
20
|
"babel-polyfill": "^6.26.0",
|
|
21
21
|
"codemirror": "^6.0.1",
|
|
22
|
-
"core-js": "^3.
|
|
22
|
+
"core-js": "^3.32.0",
|
|
23
23
|
"cron-parser": "^4.8.1",
|
|
24
|
-
"docx-preview": "^0.1.
|
|
24
|
+
"docx-preview": "^0.1.18",
|
|
25
25
|
"exceljs": "^4.3.0",
|
|
26
26
|
"file-saver": "^2.0.5",
|
|
27
27
|
"jspdf": "^2.5.1",
|
|
28
28
|
"jszip": "^3.10.1",
|
|
29
|
-
"tinymce": "^5.10.5",
|
|
30
29
|
"sh-tools": "^1.2.0",
|
|
30
|
+
"tinymce": "^5.10.5",
|
|
31
31
|
"view-ui-plus": "^1.3.14",
|
|
32
32
|
"vue": "^3.3.4",
|
|
33
|
+
"vue-masonry": "^0.16.0",
|
|
33
34
|
"vue-ripple-directive": "^2.0.1",
|
|
34
35
|
"vue-router": "^4.2.2",
|
|
35
|
-
"vue-masonry": "^0.16.0",
|
|
36
36
|
"vuex": "^4.1.0",
|
|
37
|
-
"vxe-table": "^4.5.0-beta.
|
|
37
|
+
"vxe-table": "^4.5.0-beta.16",
|
|
38
38
|
"vxe-table-plugin-export-pdf": "^3.0.4",
|
|
39
39
|
"vxe-table-plugin-export-xlsx": "^3.0.5",
|
|
40
40
|
"xe-clipboard": "^1.10.2",
|
|
41
|
+
"xe-utils": "^3.5.11",
|
|
41
42
|
"xlsx": "^0.18.5"
|
|
42
43
|
},
|
|
43
44
|
"devDependencies": {
|
|
@@ -10,10 +10,10 @@ import { basicSetup } from 'codemirror'
|
|
|
10
10
|
import { keymap, placeholder, drawSelection, lineNumbers, EditorView } from '@codemirror/view'
|
|
11
11
|
import { Compartment, EditorState, StateEffect } from '@codemirror/state'
|
|
12
12
|
import { defaultKeymap, indentWithTab, historyKeymap, history } from '@codemirror/commands'
|
|
13
|
+
import themes from './themes'
|
|
13
14
|
import { javascript } from '@codemirror/lang-javascript'
|
|
14
15
|
import { sql } from '@codemirror/lang-sql'
|
|
15
16
|
import { json } from '@codemirror/lang-json'
|
|
16
|
-
const language = new Compartment()
|
|
17
17
|
const tabSize = new Compartment()
|
|
18
18
|
export default {
|
|
19
19
|
name: 'ShCodeEditor',
|
|
@@ -34,7 +34,7 @@ export default {
|
|
|
34
34
|
},
|
|
35
35
|
theme: {
|
|
36
36
|
type: String,
|
|
37
|
-
default: '
|
|
37
|
+
default: ''
|
|
38
38
|
},
|
|
39
39
|
placeholder: {
|
|
40
40
|
type: String,
|
|
@@ -76,12 +76,11 @@ export default {
|
|
|
76
76
|
default: 'auto'
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
|
-
emits: ['update:modelValue', 'change', 'loaded', 'focus', 'destroy'],
|
|
79
|
+
emits: ['update:modelValue', 'change', 'loaded', 'focus', 'blur', 'destroy'],
|
|
80
80
|
data() {
|
|
81
81
|
return {
|
|
82
82
|
codeEditor: null,
|
|
83
83
|
codeLength: 0,
|
|
84
|
-
result: '',
|
|
85
84
|
error: null
|
|
86
85
|
}
|
|
87
86
|
},
|
|
@@ -93,48 +92,42 @@ export default {
|
|
|
93
92
|
border: this.border ? '1px solid var(--border-color)' : 'none'
|
|
94
93
|
}
|
|
95
94
|
},
|
|
96
|
-
codeFocus() {
|
|
97
|
-
return this.codeEditor && this.codeEditor?.hasFocus
|
|
98
|
-
},
|
|
99
95
|
codeExtensions() {
|
|
96
|
+
const { mode, disabled, multipleSelection, indent, theme, tab, wrap, extensions } = this
|
|
100
97
|
let defaultExtensions = [basicSetup, history(), drawSelection(), lineNumbers(), placeholder(this.placeholder), keymap.of([...defaultKeymap, ...historyKeymap])]
|
|
101
|
-
if (['javascript', 'js'].includes(
|
|
98
|
+
if (['javascript', 'js'].includes(mode.toLowerCase())) {
|
|
102
99
|
defaultExtensions.push(javascript())
|
|
103
|
-
} else if (['mysql', 'sql'].includes(
|
|
100
|
+
} else if (['mysql', 'sql'].includes(mode.toLowerCase())) {
|
|
104
101
|
defaultExtensions.push(sql())
|
|
105
|
-
} else if (['json'].includes(
|
|
102
|
+
} else if (['json'].includes(mode.toLowerCase())) {
|
|
106
103
|
defaultExtensions.push(json())
|
|
107
104
|
}
|
|
108
105
|
return [
|
|
109
106
|
...defaultExtensions,
|
|
110
107
|
EditorView.updateListener.of(this.updateListener),
|
|
111
|
-
EditorView.
|
|
112
|
-
EditorView.editable.of(!
|
|
113
|
-
EditorState.allowMultipleSelections.of(
|
|
114
|
-
tabSize.of(EditorState.tabSize.of(
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
108
|
+
EditorView.focusChangeEffect.of(this.focusListener),
|
|
109
|
+
EditorView.editable.of(!disabled),
|
|
110
|
+
EditorState.allowMultipleSelections.of(multipleSelection),
|
|
111
|
+
tabSize.of(EditorState.tabSize.of(indent)),
|
|
112
|
+
theme && themes[theme] ? themes[theme] : undefined,
|
|
113
|
+
tab ? keymap.of([indentWithTab]) : undefined,
|
|
114
|
+
wrap ? EditorView.lineWrapping : undefined,
|
|
115
|
+
...extensions
|
|
118
116
|
].filter(item => !!item)
|
|
119
117
|
}
|
|
120
118
|
},
|
|
121
119
|
watch: {
|
|
122
|
-
modelValue
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
},
|
|
134
|
-
immediate: true
|
|
135
|
-
},
|
|
136
|
-
codeFocus(value) {
|
|
137
|
-
this.emitFocus(value)
|
|
120
|
+
modelValue(value) {
|
|
121
|
+
if (this.codeEditor && !this.codeEditor.composing) {
|
|
122
|
+
let docLength = this.codeEditor.state.doc.length
|
|
123
|
+
let docValue = this.getTransformValue(value)
|
|
124
|
+
this.codeEditor.dispatch({
|
|
125
|
+
changes: { from: 0, to: docLength, insert: docValue },
|
|
126
|
+
selection: this.codeEditor.state.selection,
|
|
127
|
+
scrollIntoView: true
|
|
128
|
+
})
|
|
129
|
+
this.codeLength = docLength
|
|
130
|
+
}
|
|
138
131
|
},
|
|
139
132
|
codeExtensions: {
|
|
140
133
|
handler(exts) {
|
|
@@ -158,9 +151,9 @@ export default {
|
|
|
158
151
|
},
|
|
159
152
|
async codeRender() {
|
|
160
153
|
const { codeRef, codeExtensions, modelValue, emitLoaded } = this
|
|
161
|
-
let
|
|
154
|
+
let docValue = this.getTransformValue(modelValue)
|
|
162
155
|
let codeState = EditorState.create({
|
|
163
|
-
doc:
|
|
156
|
+
doc: docValue,
|
|
164
157
|
extensions: codeExtensions
|
|
165
158
|
})
|
|
166
159
|
this.codeEditor = new EditorView({
|
|
@@ -170,6 +163,15 @@ export default {
|
|
|
170
163
|
await this.$nextTick()
|
|
171
164
|
emitLoaded()
|
|
172
165
|
},
|
|
166
|
+
focusListener(state, focusing) {
|
|
167
|
+
let valueStr = state.doc.toString()
|
|
168
|
+
if (focusing) {
|
|
169
|
+
this.emitFocus(valueStr)
|
|
170
|
+
} else {
|
|
171
|
+
this.emitValue(valueStr)
|
|
172
|
+
this.emitBlur(valueStr)
|
|
173
|
+
}
|
|
174
|
+
},
|
|
173
175
|
async updateListener({ state, changes, docChanged }) {
|
|
174
176
|
if (changes.empty || !docChanged) {
|
|
175
177
|
return
|
|
@@ -186,22 +188,44 @@ export default {
|
|
|
186
188
|
// props.linter(view.value) as readonly Diagnostic[]
|
|
187
189
|
// ).length;
|
|
188
190
|
// }
|
|
189
|
-
this.emitValue(valueStr)
|
|
190
191
|
this.emitChange(valueStr)
|
|
191
192
|
},
|
|
192
193
|
focus() {
|
|
193
194
|
this.codeEditor && this.codeEditor.focus()
|
|
194
195
|
},
|
|
196
|
+
getTransformValue(value, out) {
|
|
197
|
+
const { modelValue, indent } = this
|
|
198
|
+
let result = '',
|
|
199
|
+
error = null
|
|
200
|
+
try {
|
|
201
|
+
if (typeof modelValue === 'object' && value) {
|
|
202
|
+
result = out ? JSON.parse(value, null, indent) : JSON.stringify(value, null, indent)
|
|
203
|
+
} else {
|
|
204
|
+
result = value
|
|
205
|
+
}
|
|
206
|
+
} catch (e) {
|
|
207
|
+
error = e
|
|
208
|
+
}
|
|
209
|
+
this.error = error
|
|
210
|
+
return result
|
|
211
|
+
},
|
|
195
212
|
emitValue(value) {
|
|
196
|
-
let
|
|
197
|
-
this
|
|
213
|
+
let outValue = this.getTransformValue(value, true)
|
|
214
|
+
if (this.error) return
|
|
215
|
+
this.$emit('update:modelValue', outValue)
|
|
198
216
|
},
|
|
199
217
|
emitChange(value) {
|
|
200
218
|
this.$emit('change', { value, $event: this.codeEditor })
|
|
201
|
-
this.emitValue(value)
|
|
202
219
|
},
|
|
203
220
|
emitFocus(value) {
|
|
204
|
-
this
|
|
221
|
+
let outValue = this.getTransformValue(value, true)
|
|
222
|
+
if (this.error) return
|
|
223
|
+
this.$emit('focus', { value: outValue, $event: this.codeEditor })
|
|
224
|
+
},
|
|
225
|
+
emitBlur(value) {
|
|
226
|
+
let outValue = this.getTransformValue(value, true)
|
|
227
|
+
if (this.error) return
|
|
228
|
+
this.$emit('blur', { value: outValue, $event: this.codeEditor })
|
|
205
229
|
},
|
|
206
230
|
emitLoaded() {
|
|
207
231
|
this.$emit('loaded', { value: this.modelValue, $event: this.codeEditor })
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { EditorView } from '@codemirror/view'
|
|
2
|
+
import { HighlightStyle, syntaxHighlighting } from '@codemirror/language'
|
|
3
|
+
import { tags } from '@lezer/highlight'
|
|
4
|
+
|
|
5
|
+
const chalky = '#e5c07b',
|
|
6
|
+
coral = '#e06c75',
|
|
7
|
+
cyan = '#56b6c2',
|
|
8
|
+
invalid = '#ffffff',
|
|
9
|
+
ivory = '#abb2bf',
|
|
10
|
+
stone = '#7d8799', // Brightened compared to original to increase contrast
|
|
11
|
+
malibu = '#61afef',
|
|
12
|
+
sage = '#98c379',
|
|
13
|
+
whiskey = '#d19a66',
|
|
14
|
+
violet = '#c678dd',
|
|
15
|
+
darkBackground = '#21252b',
|
|
16
|
+
highlightBackground = '#2c313a',
|
|
17
|
+
background = '#282c34',
|
|
18
|
+
tooltipBackground = '#353a42',
|
|
19
|
+
selection = '#3E4451',
|
|
20
|
+
cursor = '#528bff'
|
|
21
|
+
|
|
22
|
+
const theme = EditorView.theme({
|
|
23
|
+
'&': {
|
|
24
|
+
color: ivory,
|
|
25
|
+
backgroundColor: background,
|
|
26
|
+
height: '100%'
|
|
27
|
+
},
|
|
28
|
+
'.cm-content': {
|
|
29
|
+
caretColor: cursor
|
|
30
|
+
},
|
|
31
|
+
'.cm-cursor, .cm-dropCursor': { borderLeftColor: cursor },
|
|
32
|
+
'&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': { backgroundColor: selection },
|
|
33
|
+
'.cm-panels': { backgroundColor: darkBackground, color: ivory },
|
|
34
|
+
'.cm-panels.cm-panels-top': { borderBottom: '2px solid black' },
|
|
35
|
+
'.cm-panels.cm-panels-bottom': { borderTop: '2px solid black' },
|
|
36
|
+
'.cm-searchMatch': {
|
|
37
|
+
backgroundColor: '#72a1ff59',
|
|
38
|
+
outline: '1px solid #457dff'
|
|
39
|
+
},
|
|
40
|
+
'.cm-searchMatch.cm-searchMatch-selected': {
|
|
41
|
+
backgroundColor: '#6199ff2f'
|
|
42
|
+
},
|
|
43
|
+
'.cm-activeLine': { backgroundColor: '#6699ff0b' },
|
|
44
|
+
'.cm-selectionMatch': { backgroundColor: '#aafe661a' },
|
|
45
|
+
'&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {
|
|
46
|
+
backgroundColor: '#bad0f847'
|
|
47
|
+
},
|
|
48
|
+
'.cm-gutters': {
|
|
49
|
+
backgroundColor: background,
|
|
50
|
+
color: stone,
|
|
51
|
+
border: 'none'
|
|
52
|
+
},
|
|
53
|
+
'.cm-activeLineGutter': {
|
|
54
|
+
backgroundColor: highlightBackground
|
|
55
|
+
},
|
|
56
|
+
'.cm-foldPlaceholder': {
|
|
57
|
+
backgroundColor: 'transparent',
|
|
58
|
+
border: 'none',
|
|
59
|
+
color: '#ddd'
|
|
60
|
+
},
|
|
61
|
+
'.cm-tooltip': {
|
|
62
|
+
border: 'none',
|
|
63
|
+
backgroundColor: tooltipBackground
|
|
64
|
+
},
|
|
65
|
+
'.cm-tooltip .cm-tooltip-arrow:before': {
|
|
66
|
+
borderTopColor: 'transparent',
|
|
67
|
+
borderBottomColor: 'transparent'
|
|
68
|
+
},
|
|
69
|
+
'.cm-tooltip .cm-tooltip-arrow:after': {
|
|
70
|
+
borderTopColor: tooltipBackground,
|
|
71
|
+
borderBottomColor: tooltipBackground
|
|
72
|
+
},
|
|
73
|
+
'.cm-tooltip-autocomplete': {
|
|
74
|
+
'& > ul > li[aria-selected]': {
|
|
75
|
+
backgroundColor: highlightBackground,
|
|
76
|
+
color: ivory
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const themeHighlightStyle = HighlightStyle.define([
|
|
82
|
+
{ tag: tags.keyword, color: violet },
|
|
83
|
+
{ tag: [tags.name, tags.deleted, tags.character, tags.propertyName, tags.macroName], color: coral },
|
|
84
|
+
{ tag: [tags.function(tags.variableName), tags.labelName], color: malibu },
|
|
85
|
+
{ tag: [tags.color, tags.constant(tags.name), tags.standard(tags.name)], color: whiskey },
|
|
86
|
+
{ tag: [tags.definition(tags.name), tags.separator], color: ivory },
|
|
87
|
+
{ tag: [tags.typeName, tags.className, tags.number, tags.changed, tags.annotation, tags.modifier, tags.self, tags.namespace], color: chalky },
|
|
88
|
+
{ tag: [tags.operator, tags.operatorKeyword, tags.url, tags.escape, tags.regexp, tags.link, tags.special(tags.string)], color: cyan },
|
|
89
|
+
{ tag: [tags.meta, tags.comment], color: stone },
|
|
90
|
+
{ tag: tags.strong, fontWeight: 'bold' },
|
|
91
|
+
{ tag: tags.emphasis, fontStyle: 'italic' },
|
|
92
|
+
{ tag: tags.strikethrough, textDecoration: 'line-through' },
|
|
93
|
+
{ tag: tags.link, color: stone, textDecoration: 'underline' },
|
|
94
|
+
{ tag: tags.heading, fontWeight: 'bold', color: coral },
|
|
95
|
+
{ tag: [tags.atom, tags.bool, tags.special(tags.variableName)], color: whiskey },
|
|
96
|
+
{ tag: [tags.processingInstruction, tags.string, tags.inserted], color: sage },
|
|
97
|
+
{ tag: tags.invalid, color: invalid }
|
|
98
|
+
])
|
|
99
|
+
|
|
100
|
+
export default [theme, syntaxHighlighting(themeHighlightStyle)]
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { EditorView } from '@codemirror/view'
|
|
2
|
+
import { HighlightStyle, syntaxHighlighting } from '@codemirror/language'
|
|
3
|
+
import { tags } from '@lezer/highlight'
|
|
4
|
+
|
|
5
|
+
const chalky = '#bd93f9',
|
|
6
|
+
coral = '#e06c75',
|
|
7
|
+
cyan = '#56b6c2',
|
|
8
|
+
invalid = '#ffffff',
|
|
9
|
+
ivory = '#f8f8f2',
|
|
10
|
+
stone = '#7d8799', // Brightened compared to original to increase contrast
|
|
11
|
+
malibu = '#61afef',
|
|
12
|
+
sage = '#66d9ef',
|
|
13
|
+
whiskey = '#d19a66',
|
|
14
|
+
violet = '#c678dd',
|
|
15
|
+
darkBackground = '#21252b',
|
|
16
|
+
highlightBackground = '#2c313a',
|
|
17
|
+
background = '#282a36',
|
|
18
|
+
tooltipBackground = '#353a42',
|
|
19
|
+
selection = '#3E4451',
|
|
20
|
+
cursor = '#528bff'
|
|
21
|
+
|
|
22
|
+
const theme = EditorView.theme({
|
|
23
|
+
'&': {
|
|
24
|
+
color: ivory,
|
|
25
|
+
backgroundColor: background,
|
|
26
|
+
height: '100%'
|
|
27
|
+
},
|
|
28
|
+
'.cm-content': {
|
|
29
|
+
caretColor: cursor
|
|
30
|
+
},
|
|
31
|
+
'.cm-cursor, .cm-dropCursor': { borderLeftColor: cursor },
|
|
32
|
+
'&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection': { backgroundColor: selection },
|
|
33
|
+
'.cm-panels': { backgroundColor: darkBackground, color: ivory },
|
|
34
|
+
'.cm-panels.cm-panels-top': { borderBottom: '2px solid black' },
|
|
35
|
+
'.cm-panels.cm-panels-bottom': { borderTop: '2px solid black' },
|
|
36
|
+
'.cm-searchMatch': {
|
|
37
|
+
backgroundColor: '#72a1ff59',
|
|
38
|
+
outline: '1px solid #457dff'
|
|
39
|
+
},
|
|
40
|
+
'.cm-searchMatch.cm-searchMatch-selected': {
|
|
41
|
+
backgroundColor: '#6199ff2f'
|
|
42
|
+
},
|
|
43
|
+
'.cm-activeLine': { backgroundColor: '#6699ff0b' },
|
|
44
|
+
'.cm-selectionMatch': { backgroundColor: '#aafe661a' },
|
|
45
|
+
'&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket': {
|
|
46
|
+
backgroundColor: '#bad0f847'
|
|
47
|
+
},
|
|
48
|
+
'.cm-gutters': {
|
|
49
|
+
backgroundColor: background,
|
|
50
|
+
color: stone,
|
|
51
|
+
border: 'none'
|
|
52
|
+
},
|
|
53
|
+
'.cm-activeLineGutter': {
|
|
54
|
+
backgroundColor: highlightBackground
|
|
55
|
+
},
|
|
56
|
+
'.cm-foldPlaceholder': {
|
|
57
|
+
backgroundColor: 'transparent',
|
|
58
|
+
border: 'none',
|
|
59
|
+
color: '#ddd'
|
|
60
|
+
},
|
|
61
|
+
'.cm-tooltip': {
|
|
62
|
+
border: 'none',
|
|
63
|
+
backgroundColor: tooltipBackground
|
|
64
|
+
},
|
|
65
|
+
'.cm-tooltip .cm-tooltip-arrow:before': {
|
|
66
|
+
borderTopColor: 'transparent',
|
|
67
|
+
borderBottomColor: 'transparent'
|
|
68
|
+
},
|
|
69
|
+
'.cm-tooltip .cm-tooltip-arrow:after': {
|
|
70
|
+
borderTopColor: tooltipBackground,
|
|
71
|
+
borderBottomColor: tooltipBackground
|
|
72
|
+
},
|
|
73
|
+
'.cm-tooltip-autocomplete': {
|
|
74
|
+
'& > ul > li[aria-selected]': {
|
|
75
|
+
backgroundColor: highlightBackground,
|
|
76
|
+
color: ivory
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
})
|
|
80
|
+
|
|
81
|
+
const themeHighlightStyle = HighlightStyle.define([
|
|
82
|
+
{ tag: tags.keyword, color: violet },
|
|
83
|
+
{ tag: [tags.name, tags.deleted, tags.character, tags.propertyName, tags.macroName], color: coral },
|
|
84
|
+
{ tag: [tags.function(tags.variableName), tags.labelName], color: malibu },
|
|
85
|
+
{ tag: [tags.color, tags.constant(tags.name), tags.standard(tags.name)], color: whiskey },
|
|
86
|
+
{ tag: [tags.definition(tags.name), tags.separator], color: ivory },
|
|
87
|
+
{ tag: [tags.typeName, tags.className, tags.number, tags.changed, tags.annotation, tags.modifier, tags.self, tags.namespace], color: chalky },
|
|
88
|
+
{ tag: [tags.operator, tags.operatorKeyword, tags.url, tags.escape, tags.regexp, tags.link, tags.special(tags.string)], color: cyan },
|
|
89
|
+
{ tag: [tags.meta, tags.comment], color: stone },
|
|
90
|
+
{ tag: tags.strong, fontWeight: 'bold' },
|
|
91
|
+
{ tag: tags.emphasis, fontStyle: 'italic' },
|
|
92
|
+
{ tag: tags.strikethrough, textDecoration: 'line-through' },
|
|
93
|
+
{ tag: tags.link, color: stone, textDecoration: 'underline' },
|
|
94
|
+
{ tag: tags.heading, fontWeight: 'bold', color: coral },
|
|
95
|
+
{ tag: [tags.atom, tags.bool, tags.special(tags.variableName)], color: whiskey },
|
|
96
|
+
{ tag: [tags.processingInstruction, tags.string, tags.inserted], color: sage },
|
|
97
|
+
{ tag: tags.invalid, color: invalid }
|
|
98
|
+
])
|
|
99
|
+
|
|
100
|
+
export default [theme, syntaxHighlighting(themeHighlightStyle)]
|
|
@@ -178,7 +178,7 @@
|
|
|
178
178
|
import defaultData from './mixin/defaultData'
|
|
179
179
|
import props from './js/props'
|
|
180
180
|
import methods from './js/methods'
|
|
181
|
-
import importModal from './components/importModal'
|
|
181
|
+
import importModal from './components/importModal.vue'
|
|
182
182
|
export default {
|
|
183
183
|
name: 'ShTable',
|
|
184
184
|
components: {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
</template>
|
|
14
14
|
|
|
15
15
|
<script>
|
|
16
|
-
import vxeDirectTree from './vxe-direct-tree'
|
|
17
|
-
import vxeSelectTree from './vxe-select-tree'
|
|
16
|
+
import vxeDirectTree from './vxe-direct-tree.vue'
|
|
17
|
+
import vxeSelectTree from './vxe-select-tree.vue'
|
|
18
18
|
import props from './js/props'
|
|
19
19
|
export default {
|
|
20
20
|
name: 'ShTree',
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
<script>
|
|
24
24
|
import defaultData from './mixin/defaultData'
|
|
25
|
-
import tableTree from './components/table-tree'
|
|
25
|
+
import tableTree from './components/table-tree.vue'
|
|
26
26
|
import treeMethods from './js/treeMethods'
|
|
27
27
|
export default {
|
|
28
28
|
name: 'ShDirectTree',
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
<script>
|
|
46
46
|
import defaultData from './mixin/defaultData'
|
|
47
|
-
import tableTree from './components/table-tree'
|
|
47
|
+
import tableTree from './components/table-tree.vue'
|
|
48
48
|
import treeMethods from './js/treeMethods'
|
|
49
49
|
export default {
|
|
50
50
|
name: 'ShSelectTree',
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
</template>
|
|
4
4
|
|
|
5
5
|
<script>
|
|
6
|
-
|
|
6
|
+
import * as docx from 'docx-preview'
|
|
7
7
|
export default {
|
|
8
8
|
name: 'ShWord',
|
|
9
9
|
props: {
|
|
@@ -82,17 +82,13 @@ export default {
|
|
|
82
82
|
},
|
|
83
83
|
methods: {
|
|
84
84
|
async wordRender() {
|
|
85
|
-
|
|
85
|
+
if(!this.url) return
|
|
86
86
|
try {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
.renderAsync(content, that.$refs[that.wordRef], null, that.wordOption)
|
|
91
|
-
.then(res => {})
|
|
92
|
-
.catch(err => {})
|
|
93
|
-
}
|
|
87
|
+
let content = await this.getFileContent()
|
|
88
|
+
let res = await docx.renderAsync(content, this.$refs[this.wordRef], null, this.wordOption)
|
|
89
|
+
console.log(res)
|
|
94
90
|
} catch (e) {
|
|
95
|
-
|
|
91
|
+
this.msgerror(`初始化失败:${e.message}`)
|
|
96
92
|
}
|
|
97
93
|
},
|
|
98
94
|
// 获取文件流
|
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
// 全局公共封装组件
|
|
2
|
-
import ShCard from './global-components/sh-card'
|
|
3
|
-
import ShCodeEditor from './global-components/sh-code-editor'
|
|
4
|
-
import ShCorner from './global-components/sh-corner'
|
|
5
|
-
import ShCountTo from './global-components/sh-count-to'
|
|
6
|
-
import ShEmpty from './global-components/sh-empty'
|
|
7
|
-
import ShHeader from './global-components/sh-header'
|
|
8
|
-
import ShIcon from './global-components/sh-icon'
|
|
9
|
-
import ShIvForm from './global-components/sh-iv-form'
|
|
10
|
-
import ShLayout from './global-components/sh-layout'
|
|
11
|
-
import ShLoading from './global-components/sh-loading'
|
|
12
|
-
import ShNoticeBar from './global-components/sh-noticebar'
|
|
13
|
-
import ShPreview from './global-components/sh-preview'
|
|
14
|
-
import ShPullRefresh from './global-components/sh-pull-refresh'
|
|
15
|
-
import ShResult from './global-components/sh-result'
|
|
16
|
-
import ShSheet from './global-components/sh-sheet'
|
|
17
|
-
import ShUpload from './global-components/sh-upload'
|
|
18
|
-
import ShForm from './global-components/sh-vxe-form'
|
|
19
|
-
import ShList from './global-components/sh-vxe-list'
|
|
20
|
-
import ShModal from './global-components/sh-vxe-modal'
|
|
21
|
-
import ShQuery from './global-components/sh-vxe-query'
|
|
22
|
-
import ShTable from './global-components/sh-vxe-table'
|
|
23
|
-
import ShToolbar from './global-components/sh-vxe-toolbar'
|
|
24
|
-
import ShTree from './global-components/sh-vxe-tree'
|
|
25
|
-
import ShWaterFall from './global-components/sh-water-fall'
|
|
26
|
-
import ShWord from './global-components/sh-word'
|
|
2
|
+
import ShCard from './global-components/sh-card/index.vue'
|
|
3
|
+
import ShCodeEditor from './global-components/sh-code-editor/index.vue'
|
|
4
|
+
import ShCorner from './global-components/sh-corner/index.vue'
|
|
5
|
+
import ShCountTo from './global-components/sh-count-to/index.vue'
|
|
6
|
+
import ShEmpty from './global-components/sh-empty/index.vue'
|
|
7
|
+
import ShHeader from './global-components/sh-header/index.vue'
|
|
8
|
+
import ShIcon from './global-components/sh-icon/index.vue'
|
|
9
|
+
import ShIvForm from './global-components/sh-iv-form/index.vue'
|
|
10
|
+
import ShLayout from './global-components/sh-layout/index.vue'
|
|
11
|
+
import ShLoading from './global-components/sh-loading/index.vue'
|
|
12
|
+
import ShNoticeBar from './global-components/sh-noticebar/index.vue'
|
|
13
|
+
import ShPreview from './global-components/sh-preview/index.vue'
|
|
14
|
+
import ShPullRefresh from './global-components/sh-pull-refresh/index.vue'
|
|
15
|
+
import ShResult from './global-components/sh-result/index.vue'
|
|
16
|
+
import ShSheet from './global-components/sh-sheet/index.vue'
|
|
17
|
+
import ShUpload from './global-components/sh-upload/index.vue'
|
|
18
|
+
import ShForm from './global-components/sh-vxe-form/index.vue'
|
|
19
|
+
import ShList from './global-components/sh-vxe-list/index.vue'
|
|
20
|
+
import ShModal from './global-components/sh-vxe-modal/index.vue'
|
|
21
|
+
import ShQuery from './global-components/sh-vxe-query/index.vue'
|
|
22
|
+
import ShTable from './global-components/sh-vxe-table/index.vue'
|
|
23
|
+
import ShToolbar from './global-components/sh-vxe-toolbar/index.vue'
|
|
24
|
+
import ShTree from './global-components/sh-vxe-tree/index.vue'
|
|
25
|
+
import ShWaterFall from './global-components/sh-water-fall/index.vue'
|
|
26
|
+
import ShWord from './global-components/sh-word/index.vue'
|
|
27
27
|
|
|
28
28
|
const components = {
|
|
29
29
|
ShCard,
|
|
@@ -3,7 +3,7 @@ import './css/index.scss'
|
|
|
3
3
|
import VXETablePluginExportXLSX from 'vxe-table-plugin-export-xlsx'
|
|
4
4
|
import VXETablePluginExportPDF from 'vxe-table-plugin-export-pdf'
|
|
5
5
|
import XEClipboard from 'xe-clipboard'
|
|
6
|
-
import { defaultPublicRenders, defaultExtraRenders, defaultFilterRenders, defaultPublicRendersNames } from './render/globalRenders'
|
|
6
|
+
import { defaultPublicRenders, defaultExtraRenders, defaultFilterRenders, defaultPublicRendersNames } from './render/globalRenders.jsx'
|
|
7
7
|
|
|
8
8
|
let vxeOptions = {
|
|
9
9
|
zIndex: 599,
|
|
@@ -1,32 +1,32 @@
|
|
|
1
1
|
// 渲染器组件封装
|
|
2
|
-
import vxeRenderInput from './cell/vxe-render-input'
|
|
3
|
-
import vxeRenderTextarea from './cell/vxe-render-textarea'
|
|
4
|
-
import vxeRenderSelect from './cell/vxe-render-select'
|
|
5
|
-
import vxeRenderTree from './cell/vxe-render-tree'
|
|
6
|
-
import vxeRenderTime from './cell/vxe-render-time'
|
|
7
|
-
import vxeRenderProgress from './cell/vxe-render-progress'
|
|
8
|
-
import vxeRenderSwitch from './cell/vxe-render-switch'
|
|
9
|
-
import vxeRenderMoney from './cell/vxe-render-money'
|
|
10
|
-
import vxeRenderCheckbox from './cell/vxe-render-checkbox'
|
|
11
|
-
import vxeRenderCheckgroup from './cell/vxe-render-checkgroup'
|
|
12
|
-
import vxeRenderRadio from './cell/vxe-render-radio'
|
|
13
|
-
import vxeRenderRadiogroup from './cell/vxe-render-radiogroup'
|
|
14
|
-
import vxeRenderTable from './cell/vxe-render-table'
|
|
15
|
-
import vxeRenderImg from './cell/vxe-render-img'
|
|
16
|
-
import vxeRenderHref from './cell/vxe-render-href'
|
|
17
|
-
import vxeRenderUpload from './cell/vxe-render-upload'
|
|
18
|
-
import vxeRenderCode from './cell/vxe-render-code'
|
|
19
|
-
import vxeRenderGoption from './cell/vxe-render-goption'
|
|
2
|
+
import vxeRenderInput from './cell/vxe-render-input.vue'
|
|
3
|
+
import vxeRenderTextarea from './cell/vxe-render-textarea.vue'
|
|
4
|
+
import vxeRenderSelect from './cell/vxe-render-select.vue'
|
|
5
|
+
import vxeRenderTree from './cell/vxe-render-tree.vue'
|
|
6
|
+
import vxeRenderTime from './cell/vxe-render-time.vue'
|
|
7
|
+
import vxeRenderProgress from './cell/vxe-render-progress.vue'
|
|
8
|
+
import vxeRenderSwitch from './cell/vxe-render-switch.vue'
|
|
9
|
+
import vxeRenderMoney from './cell/vxe-render-money.vue'
|
|
10
|
+
import vxeRenderCheckbox from './cell/vxe-render-checkbox.vue'
|
|
11
|
+
import vxeRenderCheckgroup from './cell/vxe-render-checkgroup.vue'
|
|
12
|
+
import vxeRenderRadio from './cell/vxe-render-radio.vue'
|
|
13
|
+
import vxeRenderRadiogroup from './cell/vxe-render-radiogroup.vue'
|
|
14
|
+
import vxeRenderTable from './cell/vxe-render-table.vue'
|
|
15
|
+
import vxeRenderImg from './cell/vxe-render-img.vue'
|
|
16
|
+
import vxeRenderHref from './cell/vxe-render-href.vue'
|
|
17
|
+
import vxeRenderUpload from './cell/vxe-render-upload.vue'
|
|
18
|
+
import vxeRenderCode from './cell/vxe-render-code.vue'
|
|
19
|
+
import vxeRenderGoption from './cell/vxe-render-goption.vue'
|
|
20
20
|
|
|
21
21
|
// 头部渲染器封装
|
|
22
|
-
import vxeHeaderMoney from './header/vxe-header-money'
|
|
22
|
+
import vxeHeaderMoney from './header/vxe-header-money.vue'
|
|
23
23
|
|
|
24
24
|
// 底部渲染器封装
|
|
25
|
-
import vxeFooterInput from './footer/vxe-footer-input'
|
|
26
|
-
import vxeFooterMoney from './footer/vxe-footer-money'
|
|
25
|
+
import vxeFooterInput from './footer/vxe-footer-input.vue'
|
|
26
|
+
import vxeFooterMoney from './footer/vxe-footer-money.vue'
|
|
27
27
|
|
|
28
28
|
// 过滤器组件封装
|
|
29
|
-
import vxeFilterInput from './filters/vxe-filter-input'
|
|
29
|
+
import vxeFilterInput from './filters/vxe-filter-input.vue'
|
|
30
30
|
|
|
31
31
|
// 系统图片
|
|
32
32
|
import imgPlaceholder from '../../assets/img/square-image.png'
|