sohelp-eleplus 1.1.26 → 1.1.28
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/components.js +1 -0
- package/icons/flag/README.md +2 -2
- package/icons/flag/index.js +0 -1
- package/package.json +1 -1
- package/sohelp-ace-editor/README.md +32 -42
- package/sohelp-ace-editor/index.vue +166 -156
- package/sohelp-api-doc/README.md +36 -0
- package/sohelp-api-doc/index.vue +160 -0
- package/sohelp-application-select/README.md +9 -7
- package/sohelp-application-select/index.vue +10 -13
- package/sohelp-autocode/README.md +14 -26
- package/sohelp-calendar-view/README.md +9 -7
- package/sohelp-calendar-view/index.vue +10 -9
- package/sohelp-card/README.md +15 -17
- package/sohelp-card/index.vue +1 -1
- package/sohelp-card-view/README.md +9 -7
- package/sohelp-card-view/index.vue +10 -9
- package/sohelp-condition/README.md +29 -49
- package/sohelp-condition/index.vue +2 -1
- package/sohelp-country-select/README.md +15 -123
- package/sohelp-country-select/index.vue +1 -1
- package/sohelp-cry-input/README.md +19 -195
- package/sohelp-cry-input/index.vue +6 -2
- package/sohelp-date/README.md +12 -15
- package/sohelp-datetime/README.md +15 -17
- package/sohelp-datetime-picker/README.md +18 -18
- package/sohelp-datetime-picker/index.vue +11 -4
- package/sohelp-datetime-range/README.md +20 -23
- package/sohelp-demo-block/README.md +43 -0
- package/sohelp-demo-block/index.vue +229 -0
- package/sohelp-dict/README.md +28 -23
- package/sohelp-dict/index.vue +17 -17
- package/sohelp-drawer/README.md +28 -26
- package/sohelp-drop-card/README.md +29 -28
- package/sohelp-drop-card/index.vue +0 -1
- package/sohelp-dyn-select/README.md +31 -16
- package/sohelp-dyn-select/index.vue +65 -67
- package/sohelp-dyn-tree/README.md +26 -20
- package/sohelp-dyn-tree/index.vue +2 -2
- package/sohelp-dyn-tree-select/README.md +28 -19
- package/sohelp-dyn-tree-select/index.vue +23 -7
- package/sohelp-entity-form/README.md +65 -30
- package/sohelp-entity-form/index.vue +3 -2
- package/sohelp-entity-grid/README.md +13 -11
- package/sohelp-entity-grid/index.vue +1 -1
- package/sohelp-file-upload/README.md +25 -27
- package/sohelp-file-upload/index.vue +1 -1
- package/sohelp-filter-scheme/README.md +34 -30
- package/sohelp-filter-scheme/index.vue +2 -2
- package/sohelp-grid/README.md +52 -33
- package/sohelp-grid/index.vue +41 -39
- package/sohelp-grid/js/SohelpGridConfig.js +3 -3
- package/sohelp-grid/js/useSohelpGridConfig.js +4 -6
- package/sohelp-grid-select/README.md +32 -27
- package/sohelp-grid-select/index.vue +6 -5
- package/sohelp-grid-view/README.md +51 -22
- package/sohelp-grid-view-select/README.md +33 -25
- package/sohelp-grid-view-select/index.vue +2 -1
- package/sohelp-group-view/README.md +14 -4
- package/sohelp-group-view/index.vue +10 -9
- package/sohelp-icon-select/README.md +14 -12
- package/sohelp-image-upload/README.md +27 -27
- package/sohelp-image-upload/index.vue +2 -2
- package/sohelp-import/README.md +25 -24
- package/sohelp-input/README.md +27 -11
- package/sohelp-input/index.vue +15 -2
- package/sohelp-input-tag/README.md +53 -0
- package/sohelp-input-tag/index.vue +337 -0
- package/sohelp-modal/README.md +42 -16
- package/sohelp-modal/index.vue +21 -4
- package/sohelp-modal-select/README.md +745 -0
- package/sohelp-modal-select/index.vue +705 -0
- package/sohelp-module/README.md +24 -13
- package/sohelp-number-input/README.md +15 -8
- package/sohelp-number-input/index.vue +3 -0
- package/sohelp-number-range/README.md +22 -12
- package/sohelp-number-range/index.vue +3 -11
- package/sohelp-org-modal-select/README.md +47 -0
- package/sohelp-org-modal-select/index.vue +411 -0
- package/sohelp-org-select/README.md +23 -10
- package/sohelp-org-select/index.vue +41 -24
- package/sohelp-org-tree/README.md +19 -7
- package/sohelp-org-tree/index.vue +1 -2
- package/sohelp-org-tree-select/README.md +22 -11
- package/sohelp-org-tree-select/index.vue +1 -2
- package/sohelp-org-user-tree/README.md +19 -7
- package/sohelp-org-user-tree/index.vue +1 -2
- package/sohelp-org-user-tree-select/README.md +8 -3
- package/sohelp-org-user-tree-select/index.vue +8 -7
- package/sohelp-page/README.md +20 -11
- package/sohelp-page/index.vue +1 -1
- package/sohelp-pagination/README.md +14 -6
- package/sohelp-pagination/index.vue +1 -1
- package/sohelp-power/README.md +34 -19
- package/sohelp-power/index.vue +2 -2
- package/sohelp-pro-form/README.md +64 -21
- package/sohelp-pro-layout/README.md +10 -4
- package/sohelp-pro-layout/index.vue +8 -7
- package/sohelp-pro-table/README.md +30 -6
- package/sohelp-process/README.md +26 -13
- package/sohelp-process/index.vue +6 -6
- package/sohelp-rate/README.md +24 -12
- package/sohelp-rate/index.vue +5 -1
- package/sohelp-relation/README.md +10 -4
- package/sohelp-relation/index.vue +8 -7
- package/sohelp-relation-modal-select/README.md +41 -0
- package/sohelp-relation-modal-select/index.vue +70 -0
- package/sohelp-rich-text/README.md +29 -11
- package/sohelp-rich-text/index.vue +21 -20
- package/sohelp-richtext/README.md +12 -2
- package/sohelp-richtext/index.vue +8 -6
- package/sohelp-role-modal-select/README.md +45 -0
- package/sohelp-role-modal-select/index.vue +111 -0
- package/sohelp-role-select/README.md +18 -10
- package/sohelp-role-select/index.vue +36 -27
- package/sohelp-search/README.md +12 -4
- package/sohelp-search/index.vue +2 -2
- package/sohelp-search-pro-form/README.md +15 -1
- package/sohelp-search-pro-form/index.vue +2 -1
- package/sohelp-select/README.md +31 -30
- package/sohelp-select/index.vue +79 -84
- package/sohelp-split-panel/README.md +17 -18
- package/sohelp-switch/README.md +21 -19
- package/sohelp-switch/index.vue +34 -33
- package/sohelp-table/README.md +35 -27
- package/sohelp-table/index.vue +110 -109
- package/sohelp-table-select/README.md +55 -0
- package/sohelp-tenant-select/README.md +19 -18
- package/sohelp-tenant-select/index.vue +105 -109
- package/sohelp-text/README.md +16 -10
- package/sohelp-text/index.vue +5 -5
- package/sohelp-textarea-input/README.md +19 -12
- package/sohelp-time/README.md +11 -10
- package/sohelp-tree/README.md +24 -19
- package/sohelp-tree/index.vue +21 -23
- package/sohelp-tree-select/README.md +23 -10
- package/sohelp-user-modal-select/README.md +739 -0
- package/sohelp-user-modal-select/index.vue +87 -0
- package/sohelp-user-select/README.md +26 -15
- package/sohelp-user-select/index.vue +6 -2
- package/sohelp-user-tag/README.md +5 -7
- package/sohelp-user-tag/index.vue +8 -8
- package/sohelp-user-tree/README.md +5 -8
- package/sohelp-user-tree/index.vue +8 -7
- package/sohelp-vform-drawer/README.md +36 -18
- package/sohelp-vform-drawer/index.vue +2 -2
- package/sohelp-vform-eleplus/README.md +33 -31
- package/sohelp-vform-eleplus/index.vue +2 -2
- package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +461 -461
- package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +418 -418
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -72
- package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -67
- package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -72
- package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -68
- package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -732
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -726
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -29
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -3047
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -673
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -37
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -714
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -726
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -29
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -3047
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -673
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -7
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -37
- package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -7
- package/sohelp-vform-modal/README.md +36 -18
- package/sohelp-vform-modal/index.vue +2 -2
- package/sohelp-vform-select/README.md +9 -7
- package/sohelp-vform-select/index.vue +8 -7
- package/sohelp-vxe-grid/DefaultGridOptions.js +5 -3
- package/sohelp-vxe-grid/DefaultProps.js +0 -1
- package/sohelp-vxe-grid/README.md +540 -35
- package/sohelp-vxe-grid/SohelpGridConfig.js +8 -6
- package/sohelp-vxe-grid/index.vue +141 -94
- package/sohelp-vxe-grid-select/README.md +41 -26
- package/sohelp-vxe-table/README.md +23 -20
- package/sohelp-vxe-table/index.vue +5 -4
- package/sohelp-workflow/README.md +21 -17
- package/sohelp-workflow/index.vue +25 -22
- package/sohelp-workflow-drawer/README.md +41 -28
- package/sohelp-workflow-drawer/components/table.vue +7 -1
- package/sohelp-workflow-drawer/index.vue +86 -71
- package/sohelp-workflow-drawer/js/index.js +15 -13
- package/style/index.scss +0 -0
- package/utils/safe-eval.js +89 -0
- package/sohelp-dyn-select/props.js +0 -67
- package/sohelp-user-select/index.vue~ +0 -53
- package/sohelp-user-select/props.js +0 -71
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sohelp-modal-select v-bind="$attrs" :labelField="labelField" :valueField="valueField" :gridProps="mergedGridProps"
|
|
3
|
+
:selectionTemplate="selectionTemplate" :modalProps="mergedModalProps"></sohelp-modal-select>
|
|
4
|
+
</template>
|
|
5
|
+
|
|
6
|
+
<script>
|
|
7
|
+
export default {
|
|
8
|
+
name: 'SohelpUserModalSelect'
|
|
9
|
+
};
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { computed } from 'vue';
|
|
14
|
+
|
|
15
|
+
import SohelpModalSelect from '../sohelp-modal-select/index.vue';
|
|
16
|
+
|
|
17
|
+
const defaultGridProps = {
|
|
18
|
+
url: '/admin/system/user/page',
|
|
19
|
+
gridOptions: {
|
|
20
|
+
columns: [
|
|
21
|
+
{
|
|
22
|
+
field: 'user_name',
|
|
23
|
+
title: '用户姓名',
|
|
24
|
+
width: 120
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
field: 'login_name',
|
|
28
|
+
title: '登录账户',
|
|
29
|
+
width: 200
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
field: 'nickname',
|
|
33
|
+
title: '昵称',
|
|
34
|
+
width: 120
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const props = defineProps({
|
|
41
|
+
gridProps: {
|
|
42
|
+
type: Object,
|
|
43
|
+
default: () => ({})
|
|
44
|
+
},
|
|
45
|
+
modalProps: {
|
|
46
|
+
type: Object,
|
|
47
|
+
default: () => ({})
|
|
48
|
+
},
|
|
49
|
+
valueField: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: 'id'
|
|
52
|
+
},
|
|
53
|
+
labelField: {
|
|
54
|
+
type: String,
|
|
55
|
+
default: 'user_name'
|
|
56
|
+
},
|
|
57
|
+
selectionTemplate: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: '${user_name}-${login_name}'
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
const mergedGridProps = computed(() => {
|
|
64
|
+
const { gridProps } = props;
|
|
65
|
+
return {
|
|
66
|
+
url: gridProps?.url ?? defaultGridProps.url,
|
|
67
|
+
gridOptions: gridProps?.gridOptions ?? defaultGridProps.gridOptions
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const mergedModalProps = computed(() => {
|
|
72
|
+
return {
|
|
73
|
+
title: '选择用户',
|
|
74
|
+
...props.modalProps,
|
|
75
|
+
width: props.modalProps?.width || 800,
|
|
76
|
+
};
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
</script>
|
|
@@ -1,22 +1,33 @@
|
|
|
1
|
-
# SohelpUserSelect
|
|
1
|
+
# SohelpUserSelect 用户选择器
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于 `sohelp-dyn-select` 封装的用户选择组件,预设了用户列表接口地址和字段映射,开箱即用。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
| Name | Type | Default | Description |
|
|
8
|
-
| :--- | :--- | :--- | :--- |
|
|
9
|
-
| `datasource` | `Array`, `Function`, `Promise` | Required | The data source for user options. |
|
|
10
|
-
| `url` | `String` | `'/engine/web/user/list'` | The default URL for fetching user data. |
|
|
11
|
-
| `labelField` | `String` | `'user_name'` | The field name for the user label. |
|
|
12
|
-
| `valueField` | `String` | `'id'` | The field name for the user value. |
|
|
13
|
-
| `modelValue` | `String`, `Number`, `Array` | `""` | The selected value (v-model). |
|
|
14
|
-
| `...` | - | - | Supports all `sohelp-dyn-select` props. |
|
|
15
|
-
|
|
16
|
-
## Usage
|
|
5
|
+
## 基础用法
|
|
17
6
|
|
|
18
7
|
```vue
|
|
19
8
|
<template>
|
|
20
|
-
<sohelp-user-select v-model="userId"
|
|
9
|
+
<sohelp-user-select v-model="userId" />
|
|
21
10
|
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { ref } from 'vue';
|
|
14
|
+
|
|
15
|
+
const userId = ref('');
|
|
16
|
+
</script>
|
|
22
17
|
```
|
|
18
|
+
|
|
19
|
+
## 属性 (Props)
|
|
20
|
+
|
|
21
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
22
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
23
|
+
| modelValue | String / Number / Array | `''` | 否 | 绑定值(v-model) |
|
|
24
|
+
| datasource | Array / Function / Promise | `undefined` | 否 | 自定义数据源,优先级高于 url |
|
|
25
|
+
| url | String | `'/engine/web/user/list'` | 否 | 用户列表接口地址 |
|
|
26
|
+
| labelField | String | `'user_name'` | 否 | 显示文本字段名 |
|
|
27
|
+
| valueField | String | `'id'` | 否 | 值字段名 |
|
|
28
|
+
|
|
29
|
+
> 同时支持所有 `sohelp-dyn-select` 和 `el-select` 原生属性,通过 `v-bind="$attrs"` 透传。
|
|
30
|
+
|
|
31
|
+
## 公开方法 (Expose)
|
|
32
|
+
|
|
33
|
+
组件通过 `defineExpose({})` 暴露,当前无额外公开方法。
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
const props = defineProps({
|
|
19
19
|
datasource: {
|
|
20
20
|
type: [Array, Function, Promise],
|
|
21
|
-
|
|
21
|
+
default: undefined
|
|
22
22
|
},
|
|
23
23
|
url: {
|
|
24
24
|
type: String,
|
|
@@ -41,4 +41,8 @@
|
|
|
41
41
|
name: 'SohelpUserSelect'
|
|
42
42
|
};
|
|
43
43
|
</script>
|
|
44
|
-
<style
|
|
44
|
+
<style>
|
|
45
|
+
.sohelp-user-select{
|
|
46
|
+
width: 100%;
|
|
47
|
+
}
|
|
48
|
+
</style>
|
|
@@ -1,15 +1,13 @@
|
|
|
1
|
-
# SohelpUserTag
|
|
1
|
+
# SohelpUserTag 用户头像标签
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
用户头像标签组件,显示用户头像和昵称,无头像时显示公司 LOGO(待实现)。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
Displays user avatar and nickname. Currently a placeholder/simple implementation.
|
|
8
|
-
|
|
9
|
-
## Usage
|
|
5
|
+
## 基础用法
|
|
10
6
|
|
|
11
7
|
```vue
|
|
12
8
|
<template>
|
|
13
9
|
<sohelp-user-tag />
|
|
14
10
|
</template>
|
|
15
11
|
```
|
|
12
|
+
|
|
13
|
+
> 该组件当前为占位状态,功能待实现。
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div class="sohelp-user-tag">
|
|
3
|
+
<!-- TODO: 待实现 - 用户头像标签(头像+昵称,无头像显示公司LOGO) -->
|
|
4
|
+
<el-empty description="用户头像标签 - 待实现" />
|
|
5
|
+
</div>
|
|
3
6
|
</template>
|
|
7
|
+
<script setup>
|
|
8
|
+
// TODO: 待实现
|
|
9
|
+
</script>
|
|
4
10
|
<script>
|
|
5
|
-
export default {
|
|
6
|
-
name: "SohelpUserTag"
|
|
7
|
-
}
|
|
11
|
+
export default { name: 'SohelpUserTag' };
|
|
8
12
|
</script>
|
|
9
|
-
|
|
10
|
-
<style scoped>
|
|
11
|
-
|
|
12
|
-
</style>
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
# SohelpUserTree
|
|
1
|
+
# SohelpUserTree 用户树
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
用户树组件,用于以树形结构展示和选择用户。当前版本为占位组件,功能待实现。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
Intended for user selection in a tree structure. Currently a wrapper/placeholder inheriting from `SohelpTree`.
|
|
8
|
-
|
|
9
|
-
## Usage
|
|
5
|
+
## 基础用法
|
|
10
6
|
|
|
11
7
|
```vue
|
|
12
8
|
<template>
|
|
13
|
-
|
|
9
|
+
<!-- 当前版本为占位组件,功能待实现 -->
|
|
10
|
+
<sohelp-user-tree />
|
|
14
11
|
</template>
|
|
15
12
|
```
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
2
|
+
<div class="sohelp-user-tree">
|
|
3
|
+
<!-- TODO: 待实现 - 用户树选择弹窗(继承SohelpTree) -->
|
|
4
|
+
<el-empty description="用户树选择弹窗 - 待实现" />
|
|
5
|
+
</div>
|
|
3
6
|
</template>
|
|
7
|
+
<script setup>
|
|
8
|
+
// TODO: 待实现
|
|
9
|
+
</script>
|
|
4
10
|
<script>
|
|
5
|
-
export default {
|
|
6
|
-
name: "SohelpUserTree"
|
|
7
|
-
}
|
|
11
|
+
export default { name: 'SohelpUserTree' };
|
|
8
12
|
</script>
|
|
9
|
-
<style scoped>
|
|
10
|
-
|
|
11
|
-
</style>
|
|
@@ -1,25 +1,43 @@
|
|
|
1
|
-
# SohelpVformDrawer
|
|
1
|
+
# SohelpVformDrawer 表单抽屉
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于 `sohelp-drawer` 和 `sohelp-vform-eleplus` 封装的表单抽屉组件,在抽屉中加载动态表单。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
| Name | Type | Default | Description |
|
|
8
|
-
| :--- | :--- | :--- | :--- |
|
|
9
|
-
| `refid` | `String` | Required | The configuration ID for the form. |
|
|
10
|
-
| `...` | - | - | Supports all `sohelp-drawer` props. |
|
|
11
|
-
|
|
12
|
-
## Methods
|
|
13
|
-
|
|
14
|
-
| Name | Description |
|
|
15
|
-
| :--- | :--- |
|
|
16
|
-
| `getFormJson()` | Returns the form JSON configuration. |
|
|
17
|
-
| `getFormData()` | Returns the current form data. |
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
5
|
+
## 基础用法
|
|
20
6
|
|
|
21
7
|
```vue
|
|
22
8
|
<template>
|
|
23
|
-
<sohelp-vform-drawer
|
|
9
|
+
<sohelp-vform-drawer ref="vformDrawerRef" refid="myForm" />
|
|
24
10
|
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { ref } from 'vue';
|
|
14
|
+
const vformDrawerRef = ref(null);
|
|
15
|
+
|
|
16
|
+
// 获取表单 JSON 配置
|
|
17
|
+
const json = vformDrawerRef.value?.getFormJson();
|
|
18
|
+
// 获取表单数据
|
|
19
|
+
const data = vformDrawerRef.value?.getFormData();
|
|
20
|
+
</script>
|
|
25
21
|
```
|
|
22
|
+
|
|
23
|
+
## 属性 (Props)
|
|
24
|
+
|
|
25
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
26
|
+
| --- | --- | --- | --- | --- |
|
|
27
|
+
| refid | String | - | 是 | 表单引用 ID,用于加载对应的 vform 配置 |
|
|
28
|
+
|
|
29
|
+
> 支持透传 `sohelp-vform-eleplus` 的所有属性。
|
|
30
|
+
|
|
31
|
+
## 插槽 (Slots)
|
|
32
|
+
|
|
33
|
+
| 插槽名 | 说明 |
|
|
34
|
+
| --- | --- |
|
|
35
|
+
| default | 自定义表单内容,透传至 sohelp-vform-eleplus |
|
|
36
|
+
| footer | 自定义底部操作区域 |
|
|
37
|
+
|
|
38
|
+
## 公开方法 (Expose)
|
|
39
|
+
|
|
40
|
+
| 方法名 | 返回值 | 说明 |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| getFormJson() | Object | 获取表单的 JSON 配置 |
|
|
43
|
+
| getFormData() | Object | 获取表单当前数据 |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<sohelp-drawer>
|
|
3
3
|
<sohelp-vform v-bind="$attrs" :refid="refid" ref="sohelpVformRef">
|
|
4
4
|
<slot>
|
|
5
|
-
<template v-for="(slotProps, slotName) in $
|
|
5
|
+
<template v-for="(slotProps, slotName) in $slots" :key="slotName">
|
|
6
6
|
<slot :name="slotName" v-bind="slotProps" />
|
|
7
7
|
</template>
|
|
8
8
|
</slot>
|
|
@@ -25,7 +25,7 @@ export default {
|
|
|
25
25
|
required: true
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
|
-
setup(props, {
|
|
28
|
+
setup(props, {emit, attrs}) {
|
|
29
29
|
const sohelpVformRef = ref(null);
|
|
30
30
|
const getFormJson =()=>{
|
|
31
31
|
return sohelpVformRef.value.getFormJson();
|
|
@@ -1,39 +1,41 @@
|
|
|
1
|
-
# SohelpVformEleplus
|
|
1
|
+
# SohelpVformEleplus 可视化表单渲染器
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于 VFormRender 封装的动态表单渲染组件,通过 `refid` 从模块缓存加载表单布局配置,支持工具栏按钮和自定义脚本执行。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 基础用法
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<sohelp-vform-eleplus
|
|
10
|
+
refid="my_form_layout"
|
|
11
|
+
v-model="formData"
|
|
12
|
+
v-model:data="extraData"
|
|
13
|
+
title="表单标题"
|
|
14
|
+
/>
|
|
15
|
+
</template>
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
| `getFormData(validate)` | Retrieves the form data, optionally validating it. |
|
|
24
|
-
| `toolbarButtonClick(config)` | Handles toolbar button clicks and executes configured handlers. |
|
|
17
|
+
<script setup>
|
|
18
|
+
import { ref } from 'vue';
|
|
19
|
+
const formData = ref({});
|
|
20
|
+
const extraData = ref({});
|
|
21
|
+
</script>
|
|
22
|
+
```
|
|
25
23
|
|
|
26
|
-
##
|
|
24
|
+
## 属性 (Props)
|
|
27
25
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
27
|
+
| --- | --- | --- | --- | --- |
|
|
28
|
+
| refid | String | '' | 否 | 表单布局配置 ID,用于从模块缓存加载配置 |
|
|
29
|
+
| moduleType | String | 'tab' | 否 | 显示模式/样式类名,影响工具栏和主体布局方向 |
|
|
30
|
+
| title | String | '' | 否 | 表单页面标题 |
|
|
31
|
+
| modelValue | Object | {} | 否 | 表单数据对象,支持 v-model |
|
|
32
|
+
| data | Object | {} | 否 | 附加数据上下文,支持 v-model:data |
|
|
32
33
|
|
|
33
|
-
##
|
|
34
|
+
## 公开方法 (Expose)
|
|
34
35
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
- `loadConfig(refid)` - 根据配置 ID 加载表单布局
|
|
37
|
+
- `setFormJson(json)` - 手动设置 VForm JSON 配置
|
|
38
|
+
- `setFormData(data)` - 设置表单数据
|
|
39
|
+
- `setModelValue(value)` - 设置 modelValue
|
|
40
|
+
- `getFormData(validate?)` - 获取表单数据,可选是否验证(默认 true)
|
|
41
|
+
- `toolbarButtonClick(config)` - 手动触发工具栏按钮点击事件
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
<script setup>
|
|
29
29
|
import { defineProps, getCurrentInstance, inject, onMounted, reactive, ref, watch } from 'vue';
|
|
30
30
|
import { moduleCache } from '../cache/ModuleCache.js';
|
|
31
|
+
import { safeFunctionExec } from '../utils/safe-eval.js';
|
|
31
32
|
import { useRoute } from 'vue-router';
|
|
32
33
|
import { ElMessage } from 'element-plus';
|
|
33
34
|
import { usePageTab } from '@/utils/use-page-tab.js';
|
|
@@ -154,8 +155,7 @@
|
|
|
154
155
|
$param: route.query,
|
|
155
156
|
$config: config
|
|
156
157
|
};
|
|
157
|
-
|
|
158
|
-
func.call(scope, modelValue.value || {});
|
|
158
|
+
safeFunctionExec(config.handler, ['modelValue'], [modelValue.value || {}], scope);
|
|
159
159
|
} catch (e) {
|
|
160
160
|
console.error('工具栏按钮单击事件出错:' + props.refid, e);
|
|
161
161
|
ElMessage.error(e);
|