sh-view 1.5.2
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/.eslintrc.js +21 -0
- package/README.en.md +36 -0
- package/README.md +39 -0
- package/package.json +64 -0
- package/packages/assets/css/animated.scss +33 -0
- package/packages/assets/css/loader.scss +193 -0
- package/packages/assets/css/main.scss +235 -0
- package/packages/assets/css/theme.scss +52 -0
- package/packages/assets/icons/demo.css +539 -0
- package/packages/assets/icons/iconfont.css +415 -0
- package/packages/assets/icons/iconfont.js +1 -0
- package/packages/assets/icons/iconfont.json +709 -0
- package/packages/assets/icons/iconfont.ttf +0 -0
- package/packages/assets/icons/iconfont.woff +0 -0
- package/packages/assets/icons/iconfont.woff2 +0 -0
- package/packages/assets/img/image-error.png +0 -0
- package/packages/assets/img/square-image.png +0 -0
- package/packages/components/global-components/sh-card/index.vue +122 -0
- package/packages/components/global-components/sh-code-editor/index.vue +237 -0
- package/packages/components/global-components/sh-corner/index.vue +236 -0
- package/packages/components/global-components/sh-count-to/index.vue +46 -0
- package/packages/components/global-components/sh-empty/index.vue +43 -0
- package/packages/components/global-components/sh-header/index.vue +269 -0
- package/packages/components/global-components/sh-icon/icons.vue +32 -0
- package/packages/components/global-components/sh-icon/index.vue +27 -0
- package/packages/components/global-components/sh-iv-form/components/iv-group-item.vue +57 -0
- package/packages/components/global-components/sh-iv-form/components/iv-single-item.vue +76 -0
- package/packages/components/global-components/sh-iv-form/index.vue +255 -0
- package/packages/components/global-components/sh-layout/index.vue +142 -0
- package/packages/components/global-components/sh-loading/index.vue +42 -0
- package/packages/components/global-components/sh-noticebar/index.vue +201 -0
- package/packages/components/global-components/sh-preview/index.vue +62 -0
- package/packages/components/global-components/sh-pull-refresh/index.vue +290 -0
- package/packages/components/global-components/sh-result/index.vue +88 -0
- package/packages/components/global-components/sh-sheet/index.vue +173 -0
- package/packages/components/global-components/sh-upload/components/u-img.vue +63 -0
- package/packages/components/global-components/sh-upload/components/u-list.vue +100 -0
- package/packages/components/global-components/sh-upload/index.vue +418 -0
- package/packages/components/global-components/sh-vxe-form/components/form-item.vue +25 -0
- package/packages/components/global-components/sh-vxe-form/css/index.scss +55 -0
- package/packages/components/global-components/sh-vxe-form/index.vue +115 -0
- package/packages/components/global-components/sh-vxe-form/js/methods.js +170 -0
- package/packages/components/global-components/sh-vxe-form/js/props.js +63 -0
- package/packages/components/global-components/sh-vxe-form/mixin/defaultData.js +33 -0
- package/packages/components/global-components/sh-vxe-list/index.vue +129 -0
- package/packages/components/global-components/sh-vxe-modal/index.vue +209 -0
- package/packages/components/global-components/sh-vxe-query/index.vue +286 -0
- package/packages/components/global-components/sh-vxe-table/components/importModal.vue +377 -0
- package/packages/components/global-components/sh-vxe-table/css/index.scss +94 -0
- package/packages/components/global-components/sh-vxe-table/index.vue +350 -0
- package/packages/components/global-components/sh-vxe-table/js/excel_to_json.js +313 -0
- package/packages/components/global-components/sh-vxe-table/js/methods.js +614 -0
- package/packages/components/global-components/sh-vxe-table/js/props.js +311 -0
- package/packages/components/global-components/sh-vxe-table/mixin/defaultData.js +116 -0
- package/packages/components/global-components/sh-vxe-toolbar/index.vue +172 -0
- package/packages/components/global-components/sh-vxe-tree/components/table-tree.vue +251 -0
- package/packages/components/global-components/sh-vxe-tree/css/index.scss +20 -0
- package/packages/components/global-components/sh-vxe-tree/index.vue +85 -0
- package/packages/components/global-components/sh-vxe-tree/js/props.js +120 -0
- package/packages/components/global-components/sh-vxe-tree/js/treeMethods.js +171 -0
- package/packages/components/global-components/sh-vxe-tree/mixin/defaultData.js +48 -0
- package/packages/components/global-components/sh-vxe-tree/vxe-direct-tree.vue +202 -0
- package/packages/components/global-components/sh-vxe-tree/vxe-select-tree.vue +291 -0
- package/packages/components/global-components/sh-water-fall/index.vue +87 -0
- package/packages/components/global-components/sh-word/index.vue +110 -0
- package/packages/components/index.js +64 -0
- package/packages/components/other-components/sh-cron-modal/components/cron-content.vue +287 -0
- package/packages/components/other-components/sh-cron-modal/css/index.scss +45 -0
- package/packages/components/other-components/sh-cron-modal/index.vue +67 -0
- package/packages/components/other-components/sh-cron-modal/mixin/cron-box.js +169 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-day-box.vue +92 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-hour-box.vue +56 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-minute-box.vue +56 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-month-box.vue +56 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-second-box.vue +56 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-week-box.vue +115 -0
- package/packages/components/other-components/sh-cron-modal/tabs/cron-year-box.vue +46 -0
- package/packages/components/other-components/sh-cron-modal/utils/index.js +52 -0
- package/packages/components/other-components/sh-markdown/index.vue +170 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ar.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/az.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/bg_BG.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/bn_BD.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ca.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/cs.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/cy.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/da.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/de.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/dv.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/el.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/eo.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/es.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/es_MX.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/et.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/eu.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/fa.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/fi.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/fr_FR.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ga.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/gl.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/he_IL.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/hi.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/hr.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/hu_HU.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/hy.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/id.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/is_IS.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/it.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ja.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/kab.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/kk.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ko_KR.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ku.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/lt.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/lv.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/nb_NO.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ne.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/nl.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/nl_BE.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/oc.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/pl.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/pt_BR.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ro.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ru.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/sk.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/sl_SI.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/sq.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/sr.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/sv_SE.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ta.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/tg.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/th_TH.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/tr.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/ug.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/uk.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/vi.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/langs/zh-Hans.js +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/dark/content.css +72 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/dark/content.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/default/content.css +67 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/default/content.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/document/content.css +72 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/document/content.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/writer/content.css +68 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/content/writer/content.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/content.css +732 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/content.inline.css +726 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/content.inline.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/content.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/content.mobile.css +29 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/content.mobile.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/skin.css +3047 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/skin.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/skin.mobile.css +673 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.css +714 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.inline.css +726 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.css +3047 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -0
- package/packages/components/other-components/sh-markdown/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -0
- package/packages/components/other-components/sh-menu-card/index.vue +224 -0
- package/packages/components/other-components/sh-menu-card/menu-box.vue +68 -0
- package/packages/components/other-components/sh-system-tip/index.vue +113 -0
- package/packages/css/index.js +6 -0
- package/packages/directive/directives.js +27 -0
- package/packages/directive/index.js +19 -0
- package/packages/directive/module/draggable.js +42 -0
- package/packages/index.js +40 -0
- package/packages/iview/css/index.scss +32 -0
- package/packages/iview/index.js +24 -0
- package/packages/mixin/index.js +87 -0
- package/packages/vxeTable/css/index.scss +454 -0
- package/packages/vxeTable/css/variable.scss +256 -0
- package/packages/vxeTable/index.js +178 -0
- package/packages/vxeTable/render/cell/vxe-render-checkbox.vue +19 -0
- package/packages/vxeTable/render/cell/vxe-render-checkgroup.vue +36 -0
- package/packages/vxeTable/render/cell/vxe-render-code.vue +19 -0
- package/packages/vxeTable/render/cell/vxe-render-goption.vue +93 -0
- package/packages/vxeTable/render/cell/vxe-render-href.vue +11 -0
- package/packages/vxeTable/render/cell/vxe-render-img.vue +28 -0
- package/packages/vxeTable/render/cell/vxe-render-input.vue +51 -0
- package/packages/vxeTable/render/cell/vxe-render-money.vue +25 -0
- package/packages/vxeTable/render/cell/vxe-render-progress.vue +19 -0
- package/packages/vxeTable/render/cell/vxe-render-radio.vue +19 -0
- package/packages/vxeTable/render/cell/vxe-render-radiogroup.vue +36 -0
- package/packages/vxeTable/render/cell/vxe-render-select.vue +36 -0
- package/packages/vxeTable/render/cell/vxe-render-switch.vue +19 -0
- package/packages/vxeTable/render/cell/vxe-render-table.vue +78 -0
- package/packages/vxeTable/render/cell/vxe-render-textarea.vue +19 -0
- package/packages/vxeTable/render/cell/vxe-render-time.vue +34 -0
- package/packages/vxeTable/render/cell/vxe-render-tree.vue +59 -0
- package/packages/vxeTable/render/cell/vxe-render-upload.vue +24 -0
- package/packages/vxeTable/render/filters/vxe-filter-input.vue +43 -0
- package/packages/vxeTable/render/footer/vxe-footer-input.vue +13 -0
- package/packages/vxeTable/render/footer/vxe-footer-money.vue +20 -0
- package/packages/vxeTable/render/globalRenders.js +491 -0
- package/packages/vxeTable/render/header/vxe-header-money.vue +21 -0
- package/packages/vxeTable/render/mixin/cell-mixin.js +195 -0
|
Binary file
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Card class="sh-card" :size="size" :bordered="border" :dis-hover="disHover" :shadow="shadow" :padding="padding" :to="to" :replace="replace" :target="target" :append="append">
|
|
3
|
+
<template #title>
|
|
4
|
+
<div v-if="title || $slots.title" class="sh-card-head-title">
|
|
5
|
+
<sh-icon v-if="icon" :type="icon" :size="iconSize" :color="color" class="mr-2"></sh-icon>
|
|
6
|
+
<slot name="title">{{ title }}</slot>
|
|
7
|
+
</div>
|
|
8
|
+
</template>
|
|
9
|
+
<template #extra>
|
|
10
|
+
<div v-if="$slots.extra" class="sh-card-head-extra"><slot name="extra"></slot></div>
|
|
11
|
+
</template>
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</Card>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: 'ShCard',
|
|
19
|
+
components: {},
|
|
20
|
+
props: {
|
|
21
|
+
border: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
disHover: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
default: true
|
|
28
|
+
},
|
|
29
|
+
shadow: {
|
|
30
|
+
type: Boolean,
|
|
31
|
+
default: false
|
|
32
|
+
},
|
|
33
|
+
padding: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 10
|
|
36
|
+
},
|
|
37
|
+
title: {
|
|
38
|
+
type: String
|
|
39
|
+
},
|
|
40
|
+
color: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: '#2d8cf0'
|
|
43
|
+
},
|
|
44
|
+
icon: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ''
|
|
47
|
+
},
|
|
48
|
+
iconSize: {
|
|
49
|
+
type: Number,
|
|
50
|
+
default: 20
|
|
51
|
+
},
|
|
52
|
+
to: {
|
|
53
|
+
type: [String, Object]
|
|
54
|
+
},
|
|
55
|
+
replace: {
|
|
56
|
+
type: Boolean
|
|
57
|
+
},
|
|
58
|
+
target: {
|
|
59
|
+
type: String
|
|
60
|
+
},
|
|
61
|
+
append: {
|
|
62
|
+
type: Boolean
|
|
63
|
+
},
|
|
64
|
+
size: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: 'default'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
computed: {}
|
|
70
|
+
}
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<style lang="scss">
|
|
74
|
+
.sh-card {
|
|
75
|
+
&[size='default'] {
|
|
76
|
+
}
|
|
77
|
+
&[size='large'] {
|
|
78
|
+
.sh-card-head-title {
|
|
79
|
+
font-size: 20px;
|
|
80
|
+
line-height: 1.5;
|
|
81
|
+
}
|
|
82
|
+
.ivu-card-head {
|
|
83
|
+
padding: 14px 16px;
|
|
84
|
+
}
|
|
85
|
+
.ivu-card-body {
|
|
86
|
+
font-size: 1.1em;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
&[size='small'] {
|
|
90
|
+
.sh-card-head-title {
|
|
91
|
+
font-size: 15px;
|
|
92
|
+
line-height: 1.2;
|
|
93
|
+
}
|
|
94
|
+
.ivu-card-head {
|
|
95
|
+
padding: 10px 12px;
|
|
96
|
+
}
|
|
97
|
+
.ivu-card-body {
|
|
98
|
+
font-size: 0.9em;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
&[size='mini'] {
|
|
102
|
+
.sh-card-head-title {
|
|
103
|
+
font-size: 13px;
|
|
104
|
+
line-height: 1.1;
|
|
105
|
+
}
|
|
106
|
+
.ivu-card-head {
|
|
107
|
+
padding: 8px 10px;
|
|
108
|
+
}
|
|
109
|
+
.ivu-card-body {
|
|
110
|
+
font-size: 0.9em;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
.sh-card-head-title {
|
|
114
|
+
font-size: 17px;
|
|
115
|
+
line-height: 1.3;
|
|
116
|
+
}
|
|
117
|
+
.sh-card-head-extra {
|
|
118
|
+
cursor: pointer;
|
|
119
|
+
display: inline-block;
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
</style>
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sh-code-editor" :style="shStyles">
|
|
3
|
+
<div ref="codeMirror" class="sh-code-content" />
|
|
4
|
+
<div v-if="error" class="sh-code-error" v-html="error"></div>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import { basicSetup } from 'codemirror'
|
|
10
|
+
import { keymap, placeholder, drawSelection, lineNumbers, EditorView } from '@codemirror/view'
|
|
11
|
+
import { Compartment, EditorState, StateEffect } from '@codemirror/state'
|
|
12
|
+
import { defaultKeymap, indentWithTab, historyKeymap, history } from '@codemirror/commands'
|
|
13
|
+
import { javascript } from '@codemirror/lang-javascript'
|
|
14
|
+
import { sql } from '@codemirror/lang-sql'
|
|
15
|
+
import { json } from '@codemirror/lang-json'
|
|
16
|
+
const language = new Compartment()
|
|
17
|
+
const tabSize = new Compartment()
|
|
18
|
+
export default {
|
|
19
|
+
name: 'ShCodeEditor',
|
|
20
|
+
props: {
|
|
21
|
+
modelValue: {
|
|
22
|
+
type: [String, Object],
|
|
23
|
+
default: ''
|
|
24
|
+
},
|
|
25
|
+
option: {
|
|
26
|
+
type: Object,
|
|
27
|
+
default() {
|
|
28
|
+
return {}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
mode: {
|
|
32
|
+
type: String,
|
|
33
|
+
default: 'javascript'
|
|
34
|
+
},
|
|
35
|
+
theme: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: 'default'
|
|
38
|
+
},
|
|
39
|
+
placeholder: {
|
|
40
|
+
type: String,
|
|
41
|
+
default: ''
|
|
42
|
+
},
|
|
43
|
+
readonly: {
|
|
44
|
+
type: Boolean
|
|
45
|
+
},
|
|
46
|
+
border: {
|
|
47
|
+
type: Boolean
|
|
48
|
+
},
|
|
49
|
+
indent: {
|
|
50
|
+
type: Number,
|
|
51
|
+
default: 4
|
|
52
|
+
},
|
|
53
|
+
wrap: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: true
|
|
56
|
+
},
|
|
57
|
+
tab: {
|
|
58
|
+
type: Boolean
|
|
59
|
+
},
|
|
60
|
+
multipleSelection: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: true
|
|
63
|
+
},
|
|
64
|
+
extensions: {
|
|
65
|
+
type: Array,
|
|
66
|
+
default() {
|
|
67
|
+
return []
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
width: {
|
|
71
|
+
type: [String, Number],
|
|
72
|
+
default: '100%'
|
|
73
|
+
},
|
|
74
|
+
height: {
|
|
75
|
+
type: [String, Number],
|
|
76
|
+
default: 'auto'
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
emits: ['update:modelValue', 'change', 'loaded', 'focus', 'destroy'],
|
|
80
|
+
data() {
|
|
81
|
+
return {
|
|
82
|
+
codeEditor: null,
|
|
83
|
+
codeLength: 0,
|
|
84
|
+
result: '',
|
|
85
|
+
error: null
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
computed: {
|
|
89
|
+
shStyles() {
|
|
90
|
+
return {
|
|
91
|
+
width: this.width,
|
|
92
|
+
height: this.height,
|
|
93
|
+
border: this.border ? '1px solid var(--border-color)' : 'none'
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
codeFocus() {
|
|
97
|
+
return this.codeEditor && this.codeEditor?.hasFocus
|
|
98
|
+
},
|
|
99
|
+
codeExtensions() {
|
|
100
|
+
let defaultExtensions = [basicSetup, history(), drawSelection(), lineNumbers(), placeholder(this.placeholder), keymap.of([...defaultKeymap, ...historyKeymap])]
|
|
101
|
+
if (['javascript', 'js'].includes(this.mode.toLowerCase())) {
|
|
102
|
+
defaultExtensions.push(javascript())
|
|
103
|
+
} else if (['mysql', 'sql'].includes(this.mode.toLowerCase())) {
|
|
104
|
+
defaultExtensions.push(sql())
|
|
105
|
+
} else if (['json'].includes(this.mode.toLowerCase())) {
|
|
106
|
+
defaultExtensions.push(json())
|
|
107
|
+
}
|
|
108
|
+
return [
|
|
109
|
+
...defaultExtensions,
|
|
110
|
+
EditorView.updateListener.of(this.updateListener),
|
|
111
|
+
EditorView.theme(null, { dark: this.theme === 'dark' }),
|
|
112
|
+
EditorView.editable.of(!this.disabled),
|
|
113
|
+
EditorState.allowMultipleSelections.of(this.multipleSelection),
|
|
114
|
+
tabSize.of(EditorState.tabSize.of(this.indent)),
|
|
115
|
+
this.tab ? keymap.of([indentWithTab]) : undefined,
|
|
116
|
+
this.wrap ? EditorView.lineWrapping : undefined,
|
|
117
|
+
...this.extensions
|
|
118
|
+
].filter(item => !!item)
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
watch: {
|
|
122
|
+
modelValue: {
|
|
123
|
+
handler(value) {
|
|
124
|
+
if (this.codeEditor) {
|
|
125
|
+
if (this.codeEditor.composing) return
|
|
126
|
+
// this.codeEditor.dispatch({
|
|
127
|
+
// changes: { from: 0, to: this.codeEditor.state.doc.length, insert: value },
|
|
128
|
+
// selection: this.codeEditor.state.selection,
|
|
129
|
+
// scrollIntoView: true
|
|
130
|
+
// })
|
|
131
|
+
this.codeLength = this.codeEditor.state.doc.length
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
immediate: true
|
|
135
|
+
},
|
|
136
|
+
codeFocus(value) {
|
|
137
|
+
this.emitFocus(value)
|
|
138
|
+
},
|
|
139
|
+
codeExtensions: {
|
|
140
|
+
handler(exts) {
|
|
141
|
+
this.codeEditor?.dispatch({
|
|
142
|
+
effects: StateEffect.reconfigure.of(exts)
|
|
143
|
+
})
|
|
144
|
+
},
|
|
145
|
+
immediate: true
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
mounted() {
|
|
149
|
+
this.codeRender()
|
|
150
|
+
},
|
|
151
|
+
unmounted() {
|
|
152
|
+
if (this.codeEditor) this.codeEditor.destroy()
|
|
153
|
+
this.emitDestroy()
|
|
154
|
+
},
|
|
155
|
+
methods: {
|
|
156
|
+
codeRef() {
|
|
157
|
+
return this.$refs.codeMirror
|
|
158
|
+
},
|
|
159
|
+
async codeRender() {
|
|
160
|
+
const { codeRef, codeExtensions, modelValue, emitLoaded } = this
|
|
161
|
+
let docText = typeof modelValue === 'object' ? JSON.stringify(modelValue) : modelValue
|
|
162
|
+
let codeState = EditorState.create({
|
|
163
|
+
doc: docText,
|
|
164
|
+
extensions: codeExtensions
|
|
165
|
+
})
|
|
166
|
+
this.codeEditor = new EditorView({
|
|
167
|
+
parent: codeRef(),
|
|
168
|
+
state: codeState
|
|
169
|
+
})
|
|
170
|
+
await this.$nextTick()
|
|
171
|
+
emitLoaded()
|
|
172
|
+
},
|
|
173
|
+
async updateListener({ state, changes, docChanged }) {
|
|
174
|
+
if (changes.empty || !docChanged) {
|
|
175
|
+
return
|
|
176
|
+
}
|
|
177
|
+
let valueStr = state.doc.toString()
|
|
178
|
+
// if (props.linter) {
|
|
179
|
+
// // Linter process
|
|
180
|
+
// if (props.forceLinting) {
|
|
181
|
+
// // If forceLinting enabled, first liting.
|
|
182
|
+
// forceLinting(view.value);
|
|
183
|
+
// }
|
|
184
|
+
// // Count diagnostics.
|
|
185
|
+
// diagnosticCount.value = (
|
|
186
|
+
// props.linter(view.value) as readonly Diagnostic[]
|
|
187
|
+
// ).length;
|
|
188
|
+
// }
|
|
189
|
+
this.emitValue(valueStr)
|
|
190
|
+
this.emitChange(valueStr)
|
|
191
|
+
},
|
|
192
|
+
focus() {
|
|
193
|
+
this.codeEditor && this.codeEditor.focus()
|
|
194
|
+
},
|
|
195
|
+
emitValue(value) {
|
|
196
|
+
let emitValue = typeof this.modelValue === 'object' ? JSON.parse(value) : value
|
|
197
|
+
this.$emit('update:modelValue', emitValue)
|
|
198
|
+
},
|
|
199
|
+
emitChange(value) {
|
|
200
|
+
this.$emit('change', { value, $event: this.codeEditor })
|
|
201
|
+
this.emitValue(value)
|
|
202
|
+
},
|
|
203
|
+
emitFocus(value) {
|
|
204
|
+
this.$emit('focus', value)
|
|
205
|
+
},
|
|
206
|
+
emitLoaded() {
|
|
207
|
+
this.$emit('loaded', { value: this.modelValue, $event: this.codeEditor })
|
|
208
|
+
},
|
|
209
|
+
emitDestroy() {
|
|
210
|
+
this.$emit('destroy', { value: this.modelValue, $event: this.codeEditor })
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
</script>
|
|
215
|
+
|
|
216
|
+
<style lang="scss" scoped>
|
|
217
|
+
.sh-code-editor {
|
|
218
|
+
display: flex;
|
|
219
|
+
position: relative;
|
|
220
|
+
overflow: auto;
|
|
221
|
+
border-radius: var(--border-radius);
|
|
222
|
+
.sh-code-content {
|
|
223
|
+
flex: 1;
|
|
224
|
+
display: block;
|
|
225
|
+
}
|
|
226
|
+
.sh-code-error {
|
|
227
|
+
position: absolute;
|
|
228
|
+
left: 0;
|
|
229
|
+
right: 0;
|
|
230
|
+
bottom: 0;
|
|
231
|
+
background-color: var(--error-color);
|
|
232
|
+
color: #fff;
|
|
233
|
+
padding: 0 5px;
|
|
234
|
+
font-size: 12px;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
</style>
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<a class="sh-corner" :style="styles" :type="type" :size="size" :class="classes">
|
|
3
|
+
<div class="sh-corner-content">
|
|
4
|
+
<div v-if="title || $slots.title">{{ title }}</div>
|
|
5
|
+
<span v-if="$slots.default"><slot></slot></span>
|
|
6
|
+
</div>
|
|
7
|
+
<span class="sh-corner-bg" :style="cornerStyles"></span>
|
|
8
|
+
</a>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'ShCorner',
|
|
14
|
+
components: {},
|
|
15
|
+
props: {
|
|
16
|
+
type: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ''
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
type: String,
|
|
22
|
+
default: 'default'
|
|
23
|
+
},
|
|
24
|
+
color: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: '#e8e8e8'
|
|
27
|
+
},
|
|
28
|
+
title: {
|
|
29
|
+
type: [String, Number],
|
|
30
|
+
default: ''
|
|
31
|
+
},
|
|
32
|
+
width: {
|
|
33
|
+
type: [String, Number],
|
|
34
|
+
default: '60'
|
|
35
|
+
},
|
|
36
|
+
height: {
|
|
37
|
+
type: [String, Number],
|
|
38
|
+
default: '60'
|
|
39
|
+
},
|
|
40
|
+
font: {
|
|
41
|
+
type: [String, Number],
|
|
42
|
+
default: '10'
|
|
43
|
+
},
|
|
44
|
+
placement: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: 'top-right'
|
|
47
|
+
},
|
|
48
|
+
rotate: [Boolean],
|
|
49
|
+
dark: [Boolean]
|
|
50
|
+
},
|
|
51
|
+
data() {
|
|
52
|
+
return {}
|
|
53
|
+
},
|
|
54
|
+
computed: {
|
|
55
|
+
styles() {
|
|
56
|
+
return {
|
|
57
|
+
borderColor: this.color,
|
|
58
|
+
width: `${this.width}px`,
|
|
59
|
+
height: `${this.height}px`,
|
|
60
|
+
fontSize: `${this.font}px`,
|
|
61
|
+
color: this.dark ? '#fff' : ''
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
cornerStyles() {
|
|
65
|
+
return {
|
|
66
|
+
borderWidth: `${this.width}px`
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
placeClass() {
|
|
70
|
+
return this.placement.toLowerCase().split('-')
|
|
71
|
+
},
|
|
72
|
+
classes() {
|
|
73
|
+
return [
|
|
74
|
+
...this.placeClass,
|
|
75
|
+
{
|
|
76
|
+
'sh-rotate': this.rotate
|
|
77
|
+
}
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
watch: {},
|
|
82
|
+
created() {},
|
|
83
|
+
methods: {}
|
|
84
|
+
}
|
|
85
|
+
</script>
|
|
86
|
+
|
|
87
|
+
<style lang="scss">
|
|
88
|
+
$corner-size: 4em;
|
|
89
|
+
.sh-corner {
|
|
90
|
+
display: inline-block;
|
|
91
|
+
position: absolute;
|
|
92
|
+
top: 0;
|
|
93
|
+
right: 0;
|
|
94
|
+
margin: 0;
|
|
95
|
+
padding: 0 !important;
|
|
96
|
+
text-align: center;
|
|
97
|
+
border-color: #e8e8e8;
|
|
98
|
+
line-height: 1;
|
|
99
|
+
vertical-align: baseline;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
width: $corner-size;
|
|
102
|
+
height: $corner-size;
|
|
103
|
+
z-index: 1;
|
|
104
|
+
color: inherit;
|
|
105
|
+
background-color: transparent;
|
|
106
|
+
&:hover {
|
|
107
|
+
color: inherit;
|
|
108
|
+
}
|
|
109
|
+
> .sh-corner-content {
|
|
110
|
+
position: absolute;
|
|
111
|
+
margin: 0;
|
|
112
|
+
padding: 15% 5px;
|
|
113
|
+
width: 100%;
|
|
114
|
+
height: 100%;
|
|
115
|
+
right: 0;
|
|
116
|
+
top: 0;
|
|
117
|
+
display: inline-flex;
|
|
118
|
+
justify-content: flex-end;
|
|
119
|
+
align-items: flex-start;
|
|
120
|
+
flex-wrap: wrap;
|
|
121
|
+
}
|
|
122
|
+
&.sh-rotate {
|
|
123
|
+
> .sh-corner-content {
|
|
124
|
+
transform-origin: center;
|
|
125
|
+
justify-content: center !important;
|
|
126
|
+
}
|
|
127
|
+
&.top.left {
|
|
128
|
+
> .sh-corner-content {
|
|
129
|
+
right: auto;
|
|
130
|
+
left: 0;
|
|
131
|
+
top: 0;
|
|
132
|
+
transform: rotateZ(-45deg);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
&.top.right {
|
|
136
|
+
> .sh-corner-content {
|
|
137
|
+
right: 0;
|
|
138
|
+
left: auto;
|
|
139
|
+
top: 0;
|
|
140
|
+
transform: rotateZ(45deg);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
&.bottom.left {
|
|
144
|
+
> .sh-corner-content {
|
|
145
|
+
right: auto;
|
|
146
|
+
left: 0;
|
|
147
|
+
bottom: 0;
|
|
148
|
+
top: auto;
|
|
149
|
+
transform: rotateZ(45deg);
|
|
150
|
+
align-items: flex-end;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
&.bottom.right {
|
|
154
|
+
> .sh-corner-content {
|
|
155
|
+
right: 0;
|
|
156
|
+
left: auto;
|
|
157
|
+
bottom: 0;
|
|
158
|
+
top: auto;
|
|
159
|
+
transform: rotateZ(-45deg);
|
|
160
|
+
align-items: flex-end;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
& .sh-corner-bg {
|
|
165
|
+
position: absolute;
|
|
166
|
+
content: '';
|
|
167
|
+
right: 0;
|
|
168
|
+
top: 0;
|
|
169
|
+
z-index: -1;
|
|
170
|
+
width: 0;
|
|
171
|
+
height: 0;
|
|
172
|
+
background-color: transparent;
|
|
173
|
+
border-style: solid;
|
|
174
|
+
border-color: inherit;
|
|
175
|
+
}
|
|
176
|
+
&.top.left {
|
|
177
|
+
right: auto;
|
|
178
|
+
left: 0;
|
|
179
|
+
top: 0;
|
|
180
|
+
& .sh-corner-bg {
|
|
181
|
+
right: auto;
|
|
182
|
+
left: 0;
|
|
183
|
+
top: 0;
|
|
184
|
+
border-bottom-color: transparent !important;
|
|
185
|
+
border-right-color: transparent !important;
|
|
186
|
+
border-top-width: 0 !important;
|
|
187
|
+
}
|
|
188
|
+
> .sh-corner-content {
|
|
189
|
+
justify-content: flex-start;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
&.top.right {
|
|
193
|
+
right: 0;
|
|
194
|
+
left: auto;
|
|
195
|
+
top: 0;
|
|
196
|
+
& .sh-corner-bg {
|
|
197
|
+
border-bottom-color: transparent !important;
|
|
198
|
+
border-left-color: transparent !important;
|
|
199
|
+
border-top-width: 0 !important;
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
&.bottom.left {
|
|
203
|
+
right: auto;
|
|
204
|
+
left: 0;
|
|
205
|
+
bottom: 0;
|
|
206
|
+
top: auto;
|
|
207
|
+
& .sh-corner-bg {
|
|
208
|
+
right: auto;
|
|
209
|
+
left: 0;
|
|
210
|
+
bottom: 0;
|
|
211
|
+
top: auto;
|
|
212
|
+
border-top-color: transparent !important;
|
|
213
|
+
border-right-color: transparent !important;
|
|
214
|
+
border-bottom-width: 0 !important;
|
|
215
|
+
}
|
|
216
|
+
> .sh-corner-content {
|
|
217
|
+
justify-content: flex-start;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
&.bottom.right {
|
|
221
|
+
right: 0;
|
|
222
|
+
left: auto;
|
|
223
|
+
bottom: 0;
|
|
224
|
+
top: auto;
|
|
225
|
+
& .sh-corner-bg {
|
|
226
|
+
right: 0;
|
|
227
|
+
left: auto;
|
|
228
|
+
bottom: 0;
|
|
229
|
+
top: auto;
|
|
230
|
+
border-top-color: transparent !important;
|
|
231
|
+
border-left-color: transparent !important;
|
|
232
|
+
border-bottom-width: 0 !important;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
</style>
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sh-count-to">
|
|
3
|
+
<slot name="left"></slot>
|
|
4
|
+
<CountUp ref="count" :class="countClass" :start="start" :end="end" :decimals="decimals" :duration="duration" :options="options" :callback="callback" />
|
|
5
|
+
<slot name="right"></slot>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script>
|
|
10
|
+
export default {
|
|
11
|
+
name: 'ShCountTo',
|
|
12
|
+
props: {
|
|
13
|
+
start: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 0
|
|
16
|
+
},
|
|
17
|
+
end: {
|
|
18
|
+
type: Number
|
|
19
|
+
},
|
|
20
|
+
decimals: {
|
|
21
|
+
type: Number
|
|
22
|
+
},
|
|
23
|
+
duration: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: 2
|
|
26
|
+
},
|
|
27
|
+
options: {
|
|
28
|
+
type: Object,
|
|
29
|
+
default() {
|
|
30
|
+
return {}
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
callback: {
|
|
34
|
+
type: Function
|
|
35
|
+
},
|
|
36
|
+
countClass: {
|
|
37
|
+
type: String
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<style scoped lang="scss">
|
|
44
|
+
.sh-count-to {
|
|
45
|
+
}
|
|
46
|
+
</style>
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sh-empty-info">
|
|
3
|
+
<div v-if="noDataIcon" class="sh-empty-icon"><sh-icon :type="noDataIcon" size="24" /></div>
|
|
4
|
+
<div v-if="noDataText" v-line-clamp="clamp" class="sh-empty-text">{{ noDataText }}</div>
|
|
5
|
+
</div>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
export default {
|
|
10
|
+
name: 'ShEmpty',
|
|
11
|
+
components: {},
|
|
12
|
+
props: {
|
|
13
|
+
noDataIcon: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: 'ios-cube-outline'
|
|
16
|
+
},
|
|
17
|
+
noDataText: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: '暂无数据'
|
|
20
|
+
},
|
|
21
|
+
clamp: {
|
|
22
|
+
type: Number,
|
|
23
|
+
default: 2
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<style lang="scss" scoped>
|
|
30
|
+
.sh-empty-info {
|
|
31
|
+
width: 100%;
|
|
32
|
+
display: block;
|
|
33
|
+
text-align: center;
|
|
34
|
+
padding: 10px 0;
|
|
35
|
+
.sh-empty-icon {
|
|
36
|
+
padding: 3px;
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
color: var(--theme-color);
|
|
39
|
+
}
|
|
40
|
+
.sh-empty-text {
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
</style>
|