sohelp-eleplus 1.1.13
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/README.md +7 -0
- package/cache/DictCache.js +58 -0
- package/cache/ModuleCache.js +352 -0
- package/components.js +45 -0
- package/core-export.js +4 -0
- package/http/CrudHttp.js +115 -0
- package/http/DictHttp.js +12 -0
- package/http/ModuleHttp.js +68 -0
- package/http/SohelpHttp.js +125 -0
- package/index.js +6 -0
- package/installer.js +8 -0
- package/lang/en_US.js +4 -0
- package/lang/zh_CN.js +4 -0
- package/lang/zh_TW.js +4 -0
- package/package.json +9 -0
- package/sohelp-ace-editor/index.vue +198 -0
- package/sohelp-application-select/index.vue +15 -0
- package/sohelp-autocode/index.vue +53 -0
- package/sohelp-calendar-view/index.vue +11 -0
- package/sohelp-card-view/index.vue +11 -0
- package/sohelp-condition/index.vue +210 -0
- package/sohelp-cry-input/index.vue +64 -0
- package/sohelp-date/index.vue +27 -0
- package/sohelp-datetime/index.vue +44 -0
- package/sohelp-datetime-picker/index.vue +86 -0
- package/sohelp-datetime-range/index.vue +59 -0
- package/sohelp-dict/index.vue +207 -0
- package/sohelp-dict/props.js +68 -0
- package/sohelp-drawer/index.vue +31 -0
- package/sohelp-drop-card/index.vue +94 -0
- package/sohelp-drop-card/props.js +68 -0
- package/sohelp-dyn-select/index.vue +99 -0
- package/sohelp-dyn-select/props.js +67 -0
- package/sohelp-dyn-tree/index.vue +82 -0
- package/sohelp-dyn-tree-select/index.vue +114 -0
- package/sohelp-entity-form/index.vue +524 -0
- package/sohelp-entity-grid/index.vue +30 -0
- package/sohelp-file-upload/index.vue +218 -0
- package/sohelp-filter-scheme/components/condition.vue +102 -0
- package/sohelp-filter-scheme/components/filter.vue +45 -0
- package/sohelp-filter-scheme/components/keywords.vue +15 -0
- package/sohelp-filter-scheme/components/scheme.vue +49 -0
- package/sohelp-filter-scheme/index.vue +113 -0
- package/sohelp-grid/SohelpGridConfig.js~ +408 -0
- package/sohelp-grid/components/filter-condition-item.vue +298 -0
- package/sohelp-grid/index.vue +1886 -0
- package/sohelp-grid/js/ConditionType.js +101 -0
- package/sohelp-grid/js/DefaultGridOptions.js +141 -0
- package/sohelp-grid/js/DefaultProps.js +27 -0
- package/sohelp-grid/js/SohelpConfigFunction.js +0 -0
- package/sohelp-grid/js/SohelpGridConfig.js +101 -0
- package/sohelp-grid/js/useSohelpGridConfig.js +519 -0
- package/sohelp-grid-select/index.vue +245 -0
- package/sohelp-grid-view/filter/config/grid-filter-condition.vue +221 -0
- package/sohelp-grid-view/filter/config/grid-filter-config.vue +27 -0
- package/sohelp-grid-view/filter/config/grid-filter-field.vue +378 -0
- package/sohelp-grid-view/filter/config/grid-filter-keywords.vue +310 -0
- package/sohelp-grid-view/filter/config/grid-filter-list.vue +313 -0
- package/sohelp-grid-view/filter/config/grid-filter-scheme.vue +264 -0
- package/sohelp-grid-view/filter/config/grid-filter-sort.vue +310 -0
- package/sohelp-grid-view/filter/config/index.vue +206 -0
- package/sohelp-grid-view/filter/filter-form.vue +427 -0
- package/sohelp-grid-view/filter/filter-toolbar.vue +110 -0
- package/sohelp-grid-view/filter/index.vue +160 -0
- package/sohelp-grid-view/index.vue +379 -0
- package/sohelp-grid-view-select/index.vue +141 -0
- package/sohelp-group-view/index.vue +11 -0
- package/sohelp-icon-select/index.vue +96 -0
- package/sohelp-icon-select/vxeui-icon.js +90 -0
- package/sohelp-image-upload/index.vue +286 -0
- package/sohelp-input/index.vue +39 -0
- package/sohelp-modal/index.vue +49 -0
- package/sohelp-module/index.vue +54 -0
- package/sohelp-module/useModalManager.js +89 -0
- package/sohelp-module/useSohelpModule.js +66 -0
- package/sohelp-number-input/index.vue +32 -0
- package/sohelp-number-range/index.vue +135 -0
- package/sohelp-org-select/index.vue +30 -0
- package/sohelp-org-tree/index.vue +18 -0
- package/sohelp-org-tree-select/index.vue +93 -0
- package/sohelp-org-user-tree/index.vue +26 -0
- package/sohelp-org-user-tree-select/index.vue +11 -0
- package/sohelp-pagination/index.vue +11 -0
- package/sohelp-power/index.vue +105 -0
- package/sohelp-pro-form/components/pro-form-footer.vue +44 -0
- package/sohelp-pro-form/components/pro-form-item.vue +1133 -0
- package/sohelp-pro-form/index.vue +257 -0
- package/sohelp-pro-form/util.js +140 -0
- package/sohelp-pro-layout/index.vue +11 -0
- package/sohelp-pro-table/index.vue +14 -0
- package/sohelp-process/index.vue +216 -0
- package/sohelp-rate/index.vue +56 -0
- package/sohelp-rate/props.js +71 -0
- package/sohelp-relation/index.vue +11 -0
- package/sohelp-rich-text/index.vue +242 -0
- package/sohelp-rich-text/util.js +231 -0
- package/sohelp-richtext/index.vue +10 -0
- package/sohelp-role-select/index.vue +33 -0
- package/sohelp-search/components/search-config.vue +0 -0
- package/sohelp-search/index.vue +49 -0
- package/sohelp-search-pro-form/index.vue +11 -0
- package/sohelp-select/index.vue +120 -0
- package/sohelp-split-panel/index.vue +15 -0
- package/sohelp-switch/index.vue +56 -0
- package/sohelp-table/index.vue +151 -0
- package/sohelp-tenant-select/index.vue +128 -0
- package/sohelp-text/index.vue +14 -0
- package/sohelp-textarea-input/index.vue +36 -0
- package/sohelp-time/index.vue +10 -0
- package/sohelp-tree/index.vue +37 -0
- package/sohelp-tree-select/index.vue +18 -0
- package/sohelp-user-select/index.vue +44 -0
- package/sohelp-user-select/index.vue~ +53 -0
- package/sohelp-user-select/props.js +71 -0
- package/sohelp-user-tag/index.vue +12 -0
- package/sohelp-user-tree/index.vue +11 -0
- package/sohelp-vform-drawer/index.vue +40 -0
- package/sohelp-vform-eleplus/favicon.ico +0 -0
- package/sohelp-vform-eleplus/index.vue +297 -0
- package/sohelp-vform-eleplus/preview.html +91 -0
- package/sohelp-vform-eleplus/render.es.js +72433 -0
- package/sohelp-vform-eleplus/render.style.css +16 -0
- package/sohelp-vform-eleplus/render.umd.js +57 -0
- package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +462 -0
- package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +419 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -0
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/fonts/tinymce-mobile.woff +0 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/fonts/tinymce-mobile.woff +0 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -0
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -0
- package/sohelp-vform-modal/index.vue +41 -0
- package/sohelp-vform-select/index.vue +11 -0
- package/sohelp-vform-vant/favicon.ico +0 -0
- package/sohelp-vform-vant/render.es.js +14608 -0
- package/sohelp-vform-vant/render.style.css +1 -0
- package/sohelp-vform-vant/render.umd.js +22 -0
- package/sohelp-vxe-grid/DefaultGridOptions.js +102 -0
- package/sohelp-vxe-grid/DefaultProps.js +37 -0
- package/sohelp-vxe-grid/SohelpGridConfig.js +142 -0
- package/sohelp-vxe-grid/index.vue +518 -0
- package/sohelp-vxe-grid-select/index.vue +148 -0
- package/sohelp-vxe-table/index.vue +184 -0
- package/sohelp-workflow/index.vue +495 -0
- package/sohelp-workflow/nodeWrap.vue +53 -0
- package/sohelp-workflow/nodes/addNode.vue +27 -0
- package/sohelp-workflow/nodes/approver.vue +125 -0
- package/sohelp-workflow/nodes/branch.vue +434 -0
- package/sohelp-workflow/nodes/promoter.vue +80 -0
- package/sohelp-workflow/nodes/send.vue +95 -0
- package/sohelp-workflow-drawer/components/approval-modal.vue +182 -0
- package/sohelp-workflow-drawer/components/draw-box.vue +141 -0
- package/sohelp-workflow-drawer/components/form.vue +79 -0
- package/sohelp-workflow-drawer/components/table.vue +153 -0
- package/sohelp-workflow-drawer/components/timeline.vue +189 -0
- package/sohelp-workflow-drawer/components/workflow.vue +68 -0
- package/sohelp-workflow-drawer/index.vue +311 -0
- package/sohelp-workflow-drawer/js/index.js +119 -0
- package/style/index.scss +0 -0
- package/utils/ProFormConvertUtil.js +76 -0
- package/utils/core.js +310 -0
- package/utils/use-form-data.js +48 -0
- package/utils/use-mobile.js +43 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sohelp-cry-input">
|
|
3
|
+
<span class="unit-icon" :class="['left', 'right'].includes(unitPosition)?unitPosition:'left'">{{ unit || '¥' }}</span>
|
|
4
|
+
<sohelp-number-input
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
:formatter="formatCurrency"
|
|
7
|
+
:parser="parseCurrency"
|
|
8
|
+
></sohelp-number-input>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
<script>
|
|
12
|
+
export default {
|
|
13
|
+
name: 'SohelpCryInput',
|
|
14
|
+
props: {
|
|
15
|
+
unit: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: '¥'
|
|
18
|
+
},
|
|
19
|
+
unitPosition: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: 'left'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
<style lang="scss">
|
|
27
|
+
.sohelp-cry-input {
|
|
28
|
+
position: relative;
|
|
29
|
+
|
|
30
|
+
.el-input__inner {
|
|
31
|
+
box-sizing: border-box;
|
|
32
|
+
padding: 0 0px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.unit-icon {
|
|
36
|
+
color: #909399;
|
|
37
|
+
min-width: 15px;
|
|
38
|
+
max-width: 40px;
|
|
39
|
+
overflow: hidden;
|
|
40
|
+
text-align: center;
|
|
41
|
+
height: 50%;
|
|
42
|
+
display: flex;
|
|
43
|
+
align-items: center;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
|
|
46
|
+
position: absolute;
|
|
47
|
+
top: 0;
|
|
48
|
+
font-size: 14px;
|
|
49
|
+
bottom: 0;
|
|
50
|
+
margin: auto 0;
|
|
51
|
+
z-index: 99;
|
|
52
|
+
background: #fff;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.unit-icon.left {
|
|
56
|
+
left: 25%;
|
|
57
|
+
padding-right:3px;
|
|
58
|
+
}
|
|
59
|
+
.unit-icon.right {
|
|
60
|
+
right: 25%;
|
|
61
|
+
padding-left:3px;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
</style>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-date-picker ref="dateRef" v-bind="$attrs" value-format="YYYY-MM-DD"></el-date-picker>
|
|
3
|
+
</template>
|
|
4
|
+
<script setup>
|
|
5
|
+
import { nextTick, onMounted, ref } from 'vue';
|
|
6
|
+
const props = defineProps({
|
|
7
|
+
focus: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
default: false
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
const dateRef = ref(null);
|
|
13
|
+
onMounted(() => {
|
|
14
|
+
if (props.focus) {
|
|
15
|
+
nextTick(() => {
|
|
16
|
+
dateRef.value?.focus();
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
</script>
|
|
21
|
+
<script>
|
|
22
|
+
export default {
|
|
23
|
+
name: 'SohelpDate'
|
|
24
|
+
};
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<style scoped></style>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-date-picker
|
|
3
|
+
:type="type"
|
|
4
|
+
ref="dateRef"
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
:value-format="valueFormat"
|
|
7
|
+
v-model="modelValue"
|
|
8
|
+
></el-date-picker>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { ref, onMounted, nextTick, defineEmits, defineModel } from 'vue';
|
|
13
|
+
const modelValue = defineModel('modelValue', { default: '' });
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
focus: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: false
|
|
18
|
+
},
|
|
19
|
+
type: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: 'datetime'
|
|
22
|
+
},
|
|
23
|
+
valueFormat: {
|
|
24
|
+
type: String,
|
|
25
|
+
default: 'YYYY-MM-DD HH:mm:ss'
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
const dateRef = ref(null);
|
|
29
|
+
onMounted(() => {
|
|
30
|
+
if (props.focus) {
|
|
31
|
+
nextTick(() => {
|
|
32
|
+
dateRef.value?.focus();
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
</script>
|
|
37
|
+
|
|
38
|
+
<script>
|
|
39
|
+
export default {
|
|
40
|
+
name: 'SohelpDatetime'
|
|
41
|
+
};
|
|
42
|
+
</script>
|
|
43
|
+
|
|
44
|
+
<style scoped></style>
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<el-date-picker
|
|
3
|
+
:type="type"
|
|
4
|
+
v-bind="$attrs"
|
|
5
|
+
:value-format="valueFormat"
|
|
6
|
+
:shortcuts="dateType"
|
|
7
|
+
v-model="value"
|
|
8
|
+
></el-date-picker>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<script setup>
|
|
12
|
+
import { ref, reactive, watch } from 'vue';
|
|
13
|
+
import dayjs from 'dayjs';
|
|
14
|
+
const props = defineProps({
|
|
15
|
+
modelValue: String,
|
|
16
|
+
default: '',
|
|
17
|
+
type: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: 'datetimerange'
|
|
20
|
+
},
|
|
21
|
+
valueFormat: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: 'YYYY-MM-DD HH:mm:ss'
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
const emit = defineEmits('update:modelValue');
|
|
28
|
+
const value = ref([]);
|
|
29
|
+
const now = dayjs();
|
|
30
|
+
const dateType = reactive([
|
|
31
|
+
{
|
|
32
|
+
text: '今天',
|
|
33
|
+
value: [now.startOf('day'), now.endOf('day')]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
text: '昨天',
|
|
37
|
+
value: [now.subtract(1, 'day').startOf('day'), now.subtract(1, 'day').endOf('day')]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
text: '前天',
|
|
41
|
+
value: [now.subtract(2, 'day').startOf('day'), now.subtract(2, 'day').endOf('day')]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
text: '本周',
|
|
45
|
+
value: [now.startOf('week').add(1, 'day'), now.endOf('week').add(1, 'day')]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
text: '上周',
|
|
49
|
+
value: [
|
|
50
|
+
now.subtract(1, 'week').startOf('week').add(1, 'day'),
|
|
51
|
+
now.subtract(1, 'week').endOf('week').add(1, 'day')
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
text: '本月',
|
|
56
|
+
value: [now.startOf('month'), now.endOf('month')]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
text: '上月',
|
|
60
|
+
value: [now.subtract(1, 'month').startOf('month'), now.subtract(1, 'month').endOf('month')]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
text: '本年',
|
|
64
|
+
value: [now.startOf('year'), now.endOf('year')]
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
text: '去年',
|
|
68
|
+
value: [now.subtract(1, 'year').startOf('year'), now.subtract(1, 'year').endOf('year')]
|
|
69
|
+
}
|
|
70
|
+
]);
|
|
71
|
+
|
|
72
|
+
watch(
|
|
73
|
+
() => props.modelValue,
|
|
74
|
+
(val) => {
|
|
75
|
+
value.value = val;
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<script>
|
|
81
|
+
export default {
|
|
82
|
+
name: 'SohelpDatetimePicker'
|
|
83
|
+
};
|
|
84
|
+
</script>
|
|
85
|
+
|
|
86
|
+
<style scoped></style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="sohelp-datetime-range">
|
|
3
|
+
<sohelp-datetime v-model="value[0]" :format="format" :value-format="format" @change="onChange"></sohelp-datetime>
|
|
4
|
+
{{ separator }}
|
|
5
|
+
<sohelp-datetime v-model="value[1]" :format="format" :value-format="format" @change="onChange"></sohelp-datetime>
|
|
6
|
+
</div>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup>
|
|
10
|
+
import { ref, watch } from 'vue';
|
|
11
|
+
const emit = defineEmits(['update:modelValue', 'change']);
|
|
12
|
+
const props = defineProps({
|
|
13
|
+
modelValue: [String, Number, Array],
|
|
14
|
+
format: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: 'YYYY-MM-DD HH:mm:ss'
|
|
17
|
+
},
|
|
18
|
+
separator: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: '-'
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const value = ref([]);
|
|
25
|
+
const onChange = () => {
|
|
26
|
+
emit('update:modelValue', value.value);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* 监听props.modelValue的变化
|
|
31
|
+
*/
|
|
32
|
+
watch(
|
|
33
|
+
() => props.modelValue,
|
|
34
|
+
(val) => {
|
|
35
|
+
if (Array.isArray(val)) {
|
|
36
|
+
value.value = val;
|
|
37
|
+
} else {
|
|
38
|
+
value.value = [val, ''];
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
immediate: true
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
</script>
|
|
46
|
+
<script>
|
|
47
|
+
export default {
|
|
48
|
+
name: 'SohelpDatetimeRange'
|
|
49
|
+
};
|
|
50
|
+
</script>
|
|
51
|
+
|
|
52
|
+
<style lang="scss" scoped>
|
|
53
|
+
.sohelp-datetime-range {
|
|
54
|
+
display: flex;
|
|
55
|
+
align-items: center;
|
|
56
|
+
justify-content: flex-start;
|
|
57
|
+
gap: 6px;
|
|
58
|
+
}
|
|
59
|
+
</style>
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
<!-- 字典组件 -->
|
|
2
|
+
<template>
|
|
3
|
+
<template v-if="type === 'text'">
|
|
4
|
+
<el-text
|
|
5
|
+
v-bind="$attrs"
|
|
6
|
+
:style="getStyle(item)"
|
|
7
|
+
style="
|
|
8
|
+
border-radius: 3px;
|
|
9
|
+
margin-right: 3px;
|
|
10
|
+
padding-left: 6px;
|
|
11
|
+
padding-right: 6px;
|
|
12
|
+
padding-top: 3px;
|
|
13
|
+
padding-bottom: 3px;
|
|
14
|
+
"
|
|
15
|
+
v-for="(item, index) in valueData"
|
|
16
|
+
:key="item.value"
|
|
17
|
+
>{{ item.label }}
|
|
18
|
+
</el-text>
|
|
19
|
+
</template>
|
|
20
|
+
<template v-else-if="type === 'tag'">
|
|
21
|
+
<div class="tags" style="display: flex; gap: 5px; flex-wrap: wrap">
|
|
22
|
+
<el-tag
|
|
23
|
+
v-bind="$attrs"
|
|
24
|
+
style="margin-right: 3px"
|
|
25
|
+
:style="getStyle(item)"
|
|
26
|
+
v-for="item in valueData"
|
|
27
|
+
:key="item.value"
|
|
28
|
+
:disable-transitions="true"
|
|
29
|
+
>
|
|
30
|
+
{{ item.label }}
|
|
31
|
+
</el-tag>
|
|
32
|
+
</div>
|
|
33
|
+
</template>
|
|
34
|
+
<el-radio-group
|
|
35
|
+
v-bind="$attrs"
|
|
36
|
+
v-else-if="type === 'radio'"
|
|
37
|
+
:disabled="disabled"
|
|
38
|
+
:model-value="modelValue"
|
|
39
|
+
@change="change"
|
|
40
|
+
>
|
|
41
|
+
<el-radio v-for="item in data.value" :key="item.value" :label="item.value">
|
|
42
|
+
{{ item.label }}
|
|
43
|
+
</el-radio>
|
|
44
|
+
</el-radio-group>
|
|
45
|
+
<el-checkbox-group
|
|
46
|
+
v-bind="$attrs"
|
|
47
|
+
v-else-if="type === 'checkbox'"
|
|
48
|
+
:disabled="disabled"
|
|
49
|
+
:model-value="modelValue"
|
|
50
|
+
@change="change"
|
|
51
|
+
>
|
|
52
|
+
<el-checkbox v-for="item in data.value" :key="item.value" :label="item.value">
|
|
53
|
+
{{ item.label }}
|
|
54
|
+
</el-checkbox>
|
|
55
|
+
</el-checkbox-group>
|
|
56
|
+
|
|
57
|
+
<el-select
|
|
58
|
+
v-bind="$attrs"
|
|
59
|
+
filterable
|
|
60
|
+
clearable
|
|
61
|
+
v-else
|
|
62
|
+
v-model="modelValue"
|
|
63
|
+
:model-value="modelValue"
|
|
64
|
+
:disabled="disabled"
|
|
65
|
+
:placeholder="placeholder"
|
|
66
|
+
:multiple="type === 'multipleSelect'"
|
|
67
|
+
:teleported="teleported"
|
|
68
|
+
style="min-width: 120px"
|
|
69
|
+
@change="change"
|
|
70
|
+
ref="dictSelectRef"
|
|
71
|
+
>
|
|
72
|
+
<el-option v-for="item in data.value" :key="item.id" :value="item.value" :label="item.label"
|
|
73
|
+
:style="`color:${item.fontColor}`">
|
|
74
|
+
<component style="width:15px;height:15px;padding-right:5px;"
|
|
75
|
+
:is="ElementPlusIcons[item.icon]"
|
|
76
|
+
v-if="ElementPlusIcons[item.icon]" />
|
|
77
|
+
<component style="width:15px;height:15px;padding-right:5px;"
|
|
78
|
+
:is="EleAdminPlusIcons[item.icon]"
|
|
79
|
+
v-else-if="EleAdminPlusIcons[item.icon]" />
|
|
80
|
+
<span style="width:15px;height:15px;padding-right:5px;"
|
|
81
|
+
:class="item.icon" v-else></span>
|
|
82
|
+
{{ item.label }}
|
|
83
|
+
</el-option>
|
|
84
|
+
<template #prefix>
|
|
85
|
+
<component style="width:15px;height:15px;padding-right:5px;"
|
|
86
|
+
:is="ElementPlusIcons[icon]"
|
|
87
|
+
v-if="ElementPlusIcons[icon]" />
|
|
88
|
+
<component style="width:15px;height:15px;padding-right:5px;"
|
|
89
|
+
:is="EleAdminPlusIcons[icon]"
|
|
90
|
+
v-else-if="EleAdminPlusIcons[icon]" />
|
|
91
|
+
<span style="width:15px;height:15px;padding-right:5px;"
|
|
92
|
+
:class="icon" v-else></span>
|
|
93
|
+
</template>
|
|
94
|
+
</el-select>
|
|
95
|
+
</template>
|
|
96
|
+
|
|
97
|
+
<script setup>
|
|
98
|
+
import { computed, nextTick, onMounted, reactive, ref } from "vue";
|
|
99
|
+
import { dictCache } from "../cache/DictCache";
|
|
100
|
+
import * as ElementPlusIcons from "@element-plus/icons-vue";
|
|
101
|
+
import * as EleAdminPlusIcons from "@/components/icons";
|
|
102
|
+
|
|
103
|
+
const modelValue = defineModel("modelValue", { type: [String, Number, Array], default: "" });
|
|
104
|
+
const emit = defineEmits("change");
|
|
105
|
+
const props = defineProps({
|
|
106
|
+
/** 字典类型 */
|
|
107
|
+
code: {
|
|
108
|
+
type: String,
|
|
109
|
+
required: true
|
|
110
|
+
},
|
|
111
|
+
/** 组件类型 */
|
|
112
|
+
type: String,
|
|
113
|
+
/** 是否禁用 */
|
|
114
|
+
disabled: Boolean,
|
|
115
|
+
/** 提示文本 */
|
|
116
|
+
placeholder: String,
|
|
117
|
+
/** select的下拉是否插入到body下 */
|
|
118
|
+
teleported: {
|
|
119
|
+
type: Boolean,
|
|
120
|
+
default: true
|
|
121
|
+
},
|
|
122
|
+
autoFocus: {
|
|
123
|
+
type: Boolean,
|
|
124
|
+
default: false
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
/** 字典数据 */
|
|
129
|
+
const data = reactive({});
|
|
130
|
+
const dictSelectRef = ref(null);
|
|
131
|
+
|
|
132
|
+
const icon = computed(() => {
|
|
133
|
+
const item = data.value?.find((item) => item.value === modelValue.value);
|
|
134
|
+
return item?.icon;
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
//初始化菜单数据
|
|
138
|
+
onMounted(async () => {
|
|
139
|
+
data.value = (await dictCache.get(props.code)) || [];
|
|
140
|
+
//设置默认值
|
|
141
|
+
nextTick(() => {
|
|
142
|
+
if (!modelValue.value && (props.type === "select" || props.type === undefined) && data.value[0]) {
|
|
143
|
+
modelValue.value = data.value[0].value;
|
|
144
|
+
}
|
|
145
|
+
if (props.autoFocus) {
|
|
146
|
+
dictSelectRef.value?.focus();
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* 获取样式
|
|
153
|
+
* @param item
|
|
154
|
+
*/
|
|
155
|
+
const getStyle = (item) => {
|
|
156
|
+
const styles = [];
|
|
157
|
+
if (item?.fontColor) {
|
|
158
|
+
styles.push(`color:${item.fontColor};`);
|
|
159
|
+
}
|
|
160
|
+
if (item?.backgroundColor) {
|
|
161
|
+
styles.push(`background-color:${item.backgroundColor};`);
|
|
162
|
+
}
|
|
163
|
+
return styles.join("");
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* change
|
|
168
|
+
* @param val
|
|
169
|
+
*/
|
|
170
|
+
const change = (val) => {
|
|
171
|
+
emit("change", val);
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* 显示标签数据
|
|
176
|
+
*/
|
|
177
|
+
const valueData = computed(() => {
|
|
178
|
+
const val = props.modelValue;
|
|
179
|
+
if (val == null || val === "") return [];
|
|
180
|
+
const values = Array.isArray(val)
|
|
181
|
+
? val
|
|
182
|
+
: typeof val === "number"
|
|
183
|
+
? [val]
|
|
184
|
+
: val
|
|
185
|
+
.split(",")
|
|
186
|
+
.map((v) => v.trim())
|
|
187
|
+
.filter(Boolean);
|
|
188
|
+
|
|
189
|
+
return (data.value || [])
|
|
190
|
+
.map((d) => (values.includes(d.value) ? d : null))
|
|
191
|
+
.filter(Boolean)
|
|
192
|
+
.concat(
|
|
193
|
+
values.filter((v) => !(data.value || []).some((d) => d.value === v)).map((v) => ({ value: v, label: v }))
|
|
194
|
+
);
|
|
195
|
+
});
|
|
196
|
+
/** 更新选中数据 */
|
|
197
|
+
// const updateValue = (value) => {
|
|
198
|
+
// emit('update:modelValue', value);
|
|
199
|
+
// };
|
|
200
|
+
</script>
|
|
201
|
+
|
|
202
|
+
<script>
|
|
203
|
+
export default {
|
|
204
|
+
name: "SohelpDict",
|
|
205
|
+
inheritAttrs: false
|
|
206
|
+
};
|
|
207
|
+
</script>
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 属性
|
|
3
|
+
*/
|
|
4
|
+
export const prop = {
|
|
5
|
+
dict: {
|
|
6
|
+
type: String,
|
|
7
|
+
required: true
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
type: {
|
|
11
|
+
type: String,
|
|
12
|
+
default: 'select'
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
mappingFields:{
|
|
16
|
+
type: Object,
|
|
17
|
+
default: () => {
|
|
18
|
+
return {
|
|
19
|
+
label: 'label',
|
|
20
|
+
value: 'value'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
width: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: '200px'
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
placeholder: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: '请选择'
|
|
33
|
+
},
|
|
34
|
+
modelValue: {
|
|
35
|
+
type: Array || String || Number,
|
|
36
|
+
default: String,
|
|
37
|
+
required: true
|
|
38
|
+
},
|
|
39
|
+
filterable: {
|
|
40
|
+
type: Boolean,
|
|
41
|
+
default: true
|
|
42
|
+
},
|
|
43
|
+
clearable: {
|
|
44
|
+
type: Boolean,
|
|
45
|
+
default: true
|
|
46
|
+
},
|
|
47
|
+
disabled: {
|
|
48
|
+
type: Boolean,
|
|
49
|
+
default: false
|
|
50
|
+
},
|
|
51
|
+
size: {
|
|
52
|
+
type: String,
|
|
53
|
+
validator: function (value) {
|
|
54
|
+
return ['large', 'default', 'small', ''].includes(value);
|
|
55
|
+
},
|
|
56
|
+
default: 'default'
|
|
57
|
+
},
|
|
58
|
+
multiple: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* 事件
|
|
66
|
+
*/
|
|
67
|
+
|
|
68
|
+
export const emit = ['update:modelValue','change'];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ele-drawer v-bind="$attrs" style="max-width: 100%" class="sohelp-drawer">
|
|
3
|
+
<div class="drawer__container">
|
|
4
|
+
<!-- 主内容插槽 -->
|
|
5
|
+
<slot></slot>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<!-- 底部插槽 -->
|
|
9
|
+
<template #footer>
|
|
10
|
+
<div class="drawer__footer">
|
|
11
|
+
<slot name="footer" />
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
</ele-drawer>
|
|
15
|
+
</template>
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: 'SohelpDrawer'
|
|
19
|
+
};
|
|
20
|
+
</script>
|
|
21
|
+
<style scoped lang="scss">
|
|
22
|
+
/* 可选:添加样式 */
|
|
23
|
+
.drawer__container {
|
|
24
|
+
/* 样式定义 */
|
|
25
|
+
height: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.drawer__footer {
|
|
29
|
+
/* 样式定义 */
|
|
30
|
+
}
|
|
31
|
+
</style>
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ele-tooltip v-bind="propsBind" class="tooltip-wrap" ref="sohelpDropCardRef">
|
|
3
|
+
<template #default>
|
|
4
|
+
<el-button size="small"
|
|
5
|
+
><el-icon style="margin-right: 3px" v-if="icon"> <component :is="icon" /> </el-icon>{{ title }}
|
|
6
|
+
</el-button>
|
|
7
|
+
</template>
|
|
8
|
+
<template #content>
|
|
9
|
+
<ele-card
|
|
10
|
+
class="tooltip-card"
|
|
11
|
+
:bodyStyle="{ padding: '0 10px 0 0', height: 'auto', maxHeight: '40vh', overflow: 'auto' }"
|
|
12
|
+
:footerStyle="{ padding: '8px 0 2px 0' }"
|
|
13
|
+
>
|
|
14
|
+
<slot></slot>
|
|
15
|
+
<template #footer v-if="$slots.footer">
|
|
16
|
+
<div class="footer-right">
|
|
17
|
+
<slot name="footer"></slot>
|
|
18
|
+
</div>
|
|
19
|
+
</template>
|
|
20
|
+
</ele-card>
|
|
21
|
+
</template>
|
|
22
|
+
</ele-tooltip>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script setup>
|
|
26
|
+
import { computed, ref, onMounted, onBeforeUnmount } from 'vue';
|
|
27
|
+
const props = defineProps({
|
|
28
|
+
title: String,
|
|
29
|
+
icon: Object,
|
|
30
|
+
placement: {
|
|
31
|
+
default: 'bottom-end'
|
|
32
|
+
},
|
|
33
|
+
trigger: {
|
|
34
|
+
type: String,
|
|
35
|
+
default: 'click'
|
|
36
|
+
},
|
|
37
|
+
effect: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'light'
|
|
40
|
+
},
|
|
41
|
+
icon: {
|
|
42
|
+
type: [Object, String],
|
|
43
|
+
default: ''
|
|
44
|
+
},
|
|
45
|
+
modelValue: Boolean
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const windowHeight = ref(window.innerHeight);
|
|
49
|
+
const sohelpDropCardRef = ref(null);
|
|
50
|
+
|
|
51
|
+
const handleResize = () => {
|
|
52
|
+
windowHeight.value = window.innerHeight;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
onMounted(() => {
|
|
56
|
+
window.addEventListener('resize', handleResize);
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
onBeforeUnmount(() => {
|
|
60
|
+
window.removeEventListener('resize', handleResize);
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const propsBind = computed(() => ({
|
|
64
|
+
...props,
|
|
65
|
+
placement: windowHeight.value < 600 ? 'auto' : props.placement
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
defineExpose({
|
|
69
|
+
close: () => {
|
|
70
|
+
sohelpDropCardRef.value.hide();
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
</script>
|
|
74
|
+
|
|
75
|
+
<script>
|
|
76
|
+
export default {
|
|
77
|
+
name: 'SohelpDropCard'
|
|
78
|
+
};
|
|
79
|
+
</script>
|
|
80
|
+
|
|
81
|
+
<style lang="scss" scoped>
|
|
82
|
+
.tooltip-wrap {
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.tooltip-card {
|
|
86
|
+
min-width: 180px;
|
|
87
|
+
}
|
|
88
|
+
.footer-right {
|
|
89
|
+
display: flex;
|
|
90
|
+
flex-direction: row;
|
|
91
|
+
justify-content: flex-end;
|
|
92
|
+
flex-wrap: wrap;
|
|
93
|
+
}
|
|
94
|
+
</style>
|