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
|
@@ -15,85 +15,83 @@
|
|
|
15
15
|
/>
|
|
16
16
|
</div>
|
|
17
17
|
</template>
|
|
18
|
-
<script>
|
|
19
|
-
import { computed,
|
|
18
|
+
<script setup>
|
|
19
|
+
import { computed, ref, onMounted, watch } from 'vue';
|
|
20
20
|
import { ElMessage } from 'element-plus';
|
|
21
21
|
import SohelpSelect from '../sohelp-select/index.vue';
|
|
22
|
+
import SohelpHttp from '../http/SohelpHttp.js';
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
readonly: {
|
|
36
|
-
type: Boolean,
|
|
37
|
-
default: false
|
|
38
|
-
},
|
|
39
|
-
labelField: String,
|
|
40
|
-
valueField: String,
|
|
41
|
-
modelValue: [String, Number, Array, Object]
|
|
24
|
+
const props = defineProps({
|
|
25
|
+
datasource: {
|
|
26
|
+
type: [Array, Function, Promise],
|
|
27
|
+
default: undefined
|
|
28
|
+
},
|
|
29
|
+
url: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ''
|
|
32
|
+
},
|
|
33
|
+
readonly: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
42
36
|
},
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
37
|
+
labelField: String,
|
|
38
|
+
valueField: String,
|
|
39
|
+
modelValue: [String, Number, Array, Object]
|
|
40
|
+
});
|
|
46
41
|
|
|
47
|
-
|
|
48
|
-
if (Array.isArray(props.datasource)) {
|
|
49
|
-
selectData.value = props.datasource;
|
|
50
|
-
} else if (typeof props.datasource === 'function') {
|
|
51
|
-
const result = await props.datasource();
|
|
52
|
-
selectData.value = result;
|
|
53
|
-
} else if (props.datasource instanceof Promise) {
|
|
54
|
-
const result = await props.datasource;
|
|
55
|
-
selectData.value = result;
|
|
56
|
-
} else {
|
|
57
|
-
load();
|
|
58
|
-
}
|
|
59
|
-
});
|
|
42
|
+
const emit = defineEmits(['update:modelValue']);
|
|
60
43
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const res = await SohelpHttp.get(props?.url, {}).catch((err) => {
|
|
64
|
-
ElMessage.error(err.message || 'error');
|
|
65
|
-
});
|
|
44
|
+
const value = ref('');
|
|
45
|
+
const selectData = ref(null);
|
|
66
46
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
47
|
+
onMounted(async () => {
|
|
48
|
+
if (Array.isArray(props.datasource)) {
|
|
49
|
+
selectData.value = props.datasource;
|
|
50
|
+
} else if (typeof props.datasource === 'function') {
|
|
51
|
+
const result = await props.datasource();
|
|
52
|
+
selectData.value = result;
|
|
53
|
+
} else if (props.datasource instanceof Promise) {
|
|
54
|
+
const result = await props.datasource;
|
|
55
|
+
selectData.value = result;
|
|
56
|
+
} else {
|
|
57
|
+
load();
|
|
58
|
+
}
|
|
59
|
+
});
|
|
72
60
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
return selectData.value.find((item) => item.id === props.modelValue)?.[props.labelField];
|
|
61
|
+
const load = async () => {
|
|
62
|
+
if (props.url && props?.url?.length > 0) {
|
|
63
|
+
const res = await SohelpHttp.get(props?.url, {}).catch((err) => {
|
|
64
|
+
ElMessage.error(err.message || 'error');
|
|
78
65
|
});
|
|
66
|
+
selectData.value = res?.data || [];
|
|
67
|
+
}
|
|
68
|
+
};
|
|
79
69
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
immediate: true,
|
|
87
|
-
deep: true
|
|
88
|
-
}
|
|
89
|
-
);
|
|
70
|
+
/**
|
|
71
|
+
* 获取label
|
|
72
|
+
*/
|
|
73
|
+
const getLabel = computed(() => {
|
|
74
|
+
return selectData.value?.find((item) => item[props.valueField] === props.modelValue)?.[props.labelField];
|
|
75
|
+
});
|
|
90
76
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
77
|
+
watch(
|
|
78
|
+
() => props.modelValue,
|
|
79
|
+
(val) => {
|
|
80
|
+
value.value = val;
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
immediate: true,
|
|
84
|
+
deep: true
|
|
96
85
|
}
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
watch(value, (val) => {
|
|
89
|
+
emit('update:modelValue', val);
|
|
90
|
+
});
|
|
91
|
+
</script>
|
|
92
|
+
<script>
|
|
93
|
+
export default {
|
|
94
|
+
name: 'SohelpDynSelect'
|
|
97
95
|
};
|
|
98
96
|
</script>
|
|
99
97
|
<style></style>
|
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
# 动态树
|
|
1
|
+
# SohelpDynTree 动态树
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于 `sohelp-tree` 封装的动态树形组件,通过 URL 从后端加载扁平数据并自动转换为树形结构展示。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
8
|
-
| :--- | :--- | :--- | :--- |
|
|
9
|
-
| url | String | - | 数据接口 URL (Required)。 |
|
|
10
|
-
| valueField | String | 'id' | ID 字段名。 |
|
|
11
|
-
| labelField | String | 'org_name' | 显示字段名。 |
|
|
12
|
-
| parentField | String | 'parent_id' | 父级 ID 字段名。 |
|
|
13
|
-
| ... | - | - | 支持 `sohelp-tree` (el-tree) 的其他属性。 |
|
|
14
|
-
|
|
15
|
-
## 事件 (Events)
|
|
16
|
-
|
|
17
|
-
| 事件名 | 说明 | 回调参数 |
|
|
18
|
-
| :--- | :--- | :--- |
|
|
19
|
-
| node-click | 节点点击事件。 | `data, node, el` |
|
|
20
|
-
|
|
21
|
-
## 使用示例
|
|
5
|
+
## 基础用法
|
|
22
6
|
|
|
23
7
|
```vue
|
|
24
8
|
<template>
|
|
25
9
|
<sohelp-dyn-tree
|
|
26
10
|
url="/engine/web/org/list"
|
|
27
|
-
|
|
11
|
+
label-field="org_name"
|
|
28
12
|
@node-click="handleNodeClick"
|
|
29
13
|
/>
|
|
30
14
|
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
const handleNodeClick = (data, node, el) => {
|
|
18
|
+
console.log('点击节点:', data);
|
|
19
|
+
};
|
|
20
|
+
</script>
|
|
31
21
|
```
|
|
22
|
+
|
|
23
|
+
## 属性 (Props)
|
|
24
|
+
|
|
25
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
26
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
27
|
+
| url | String | - | 是 | 数据接口 URL |
|
|
28
|
+
| valueField | String | `id` | 否 | 数据中作为节点唯一标识的字段名 |
|
|
29
|
+
| labelField | String | `org_name` | 否 | 数据中作为节点显示文本的字段名 |
|
|
30
|
+
| parentField | String | `parent_id` | 否 | 数据中作为父级标识的字段名 |
|
|
31
|
+
| ...attrs | - | - | 否 | 支持所有 `sohelp-tree`(el-tree)属性透传 |
|
|
32
|
+
|
|
33
|
+
## 事件 (Events)
|
|
34
|
+
|
|
35
|
+
| 事件名 | 回调参数 | 说明 |
|
|
36
|
+
| :--- | :--- | :--- |
|
|
37
|
+
| node-click | `(data, node, el)` | 节点被点击时触发 |
|
|
@@ -1,28 +1,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# SohelpDynTreeSelect 动态树选择器
|
|
2
2
|
|
|
3
|
-
基于 `ele-tree-select
|
|
3
|
+
基于 `ele-tree-select` 封装,通过 URL 从后端加载扁平数据并自动转换为树形结构的下拉选择组件,支持双向绑定。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
8
|
-
| :--- | :--- | :--- | :--- |
|
|
9
|
-
| modelValue | String/Number/Array | - | 绑定的值 (v-model)。 |
|
|
10
|
-
| url | String | '/engine/web/org/list' | 数据接口 URL。 |
|
|
11
|
-
| valueField | String | 'id' | ID 字段名。 |
|
|
12
|
-
| labelField | String | 'org_name' | 显示字段名。 |
|
|
13
|
-
| parentField | String | 'parent_id' | 父级 ID 字段名。 |
|
|
14
|
-
| height | String | '255' | 下拉框高度。 |
|
|
15
|
-
| checkStrictly | Boolean | false | 是否严格的遵循父子不互相关联。 |
|
|
16
|
-
| ... | - | - | 支持 `ele-tree-select` 的其他属性。 |
|
|
17
|
-
|
|
18
|
-
## 使用示例
|
|
5
|
+
## 基础用法
|
|
19
6
|
|
|
20
7
|
```vue
|
|
21
8
|
<template>
|
|
22
9
|
<sohelp-dyn-tree-select
|
|
23
|
-
v-model="
|
|
24
|
-
url="/
|
|
25
|
-
|
|
10
|
+
v-model="selectedId"
|
|
11
|
+
url="/engine/web/org/list"
|
|
12
|
+
label-field="org_name"
|
|
13
|
+
placeholder="请选择"
|
|
26
14
|
/>
|
|
27
15
|
</template>
|
|
16
|
+
|
|
17
|
+
<script setup>
|
|
18
|
+
import { ref } from 'vue';
|
|
19
|
+
const selectedId = ref('');
|
|
20
|
+
</script>
|
|
28
21
|
```
|
|
22
|
+
|
|
23
|
+
## 属性 (Props)
|
|
24
|
+
|
|
25
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
26
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
27
|
+
| modelValue (v-model) | String / Number / Array | - | 是 | 绑定值 |
|
|
28
|
+
| url | String | `/engine/web/org/list` | 是 | 数据接口 URL |
|
|
29
|
+
| valueField | String | `id` | 否 | 数据中作为节点值的字段名 |
|
|
30
|
+
| labelField | String | `org_name` | 否 | 数据中作为节点显示文本的字段名 |
|
|
31
|
+
| parentField | String | `parent_id` | 否 | 数据中作为父级标识的字段名 |
|
|
32
|
+
| highlightCurrent | Boolean | `false` | 否 | 是否高亮当前选中节点 |
|
|
33
|
+
| expandOnClickNode | Boolean | `false` | 否 | 是否在点击节点时展开/收起 |
|
|
34
|
+
| defaultExpandedKeys | Array / String | `[]` | 否 | 默认展开的节点 key 数组(字符串以逗号分隔) |
|
|
35
|
+
| checkStrictly | Boolean | `false` | 否 | 父子节点是否不互相关联 |
|
|
36
|
+
| height | String | `255` | 否 | 下拉面板高度(px) |
|
|
37
|
+
| ...attrs | - | - | 否 | 支持所有 `ele-tree-select` 属性透传 |
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
/>
|
|
9
9
|
</template>
|
|
10
10
|
<script>
|
|
11
|
-
import { reactive, onMounted, ref } from 'vue';
|
|
11
|
+
import { reactive, onMounted, ref, watch } from 'vue';
|
|
12
12
|
import { toTree } from '../utils/core.js';
|
|
13
13
|
|
|
14
14
|
export default {
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
default: false
|
|
41
41
|
},
|
|
42
42
|
defaultExpandedKeys: {
|
|
43
|
-
type: Array,
|
|
44
|
-
default: []
|
|
43
|
+
type: [Array, String],
|
|
44
|
+
default: () => []
|
|
45
45
|
},
|
|
46
46
|
checkStrictly: {
|
|
47
47
|
type: Boolean,
|
|
@@ -69,7 +69,22 @@
|
|
|
69
69
|
nodeKey: 'id'
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
const selectedValue = ref();
|
|
72
|
+
const selectedValue = ref(props.modelValue);
|
|
73
|
+
|
|
74
|
+
watch(
|
|
75
|
+
() => props.modelValue,
|
|
76
|
+
(val) => {
|
|
77
|
+
selectedValue.value = val;
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
watch(selectedValue, (val) => {
|
|
82
|
+
emit('update:modelValue', val);
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
const handleChange = (val) => {
|
|
86
|
+
emit('update:modelValue', val);
|
|
87
|
+
};
|
|
73
88
|
|
|
74
89
|
onMounted(async () => {
|
|
75
90
|
// 初始化树形结构数据
|
|
@@ -77,8 +92,8 @@
|
|
|
77
92
|
treeProps.expandOnclickNode = props.expandOnClickNode;
|
|
78
93
|
treeProps.highlightCurrent = props.highlightCurrent;
|
|
79
94
|
treeProps.checkStrictly = props.checkStrictly;
|
|
80
|
-
|
|
81
|
-
|
|
95
|
+
const keys = Array.isArray(props.defaultExpandedKeys) ? props.defaultExpandedKeys : props.defaultExpandedKeys.split(',').filter(item => item);
|
|
96
|
+
treeProps.defaultExpandedKeys = keys;
|
|
82
97
|
|
|
83
98
|
if (props.url && props?.url?.length > 0) {
|
|
84
99
|
const res = await SohelpHttp.get(props?.url, {}).catch((err) => {
|
|
@@ -106,7 +121,8 @@
|
|
|
106
121
|
|
|
107
122
|
return {
|
|
108
123
|
treeProps,
|
|
109
|
-
selectedValue
|
|
124
|
+
selectedValue,
|
|
125
|
+
handleChange
|
|
110
126
|
};
|
|
111
127
|
}
|
|
112
128
|
};
|
|
@@ -1,45 +1,80 @@
|
|
|
1
|
-
# 实体表单
|
|
1
|
+
# SohelpEntityForm 实体表单
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于实体元数据配置(`refid`)自动渲染的表单组件,内部封装了 `SohelpProForm`,支持公式计算、自动数据加载和 CRUD 操作。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
- **元数据驱动**:通过 `refid` 自动加载表单配置。
|
|
8
|
-
- **公式计算**:支持字段间的自动计算公式。
|
|
9
|
-
- **响应式布局**:支持 `grid` 布局配置。
|
|
10
|
-
- **自定义插槽**:支持插槽覆盖特定字段的渲染。
|
|
11
|
-
|
|
12
|
-
## 属性 (Props)
|
|
13
|
-
|
|
14
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
15
|
-
| :--- | :--- | :--- | :--- |
|
|
16
|
-
| modelValue | Object | - | 表单数据对象 (v-model)。 |
|
|
17
|
-
| refid | String | - | 实体引用 ID (Required)。 |
|
|
18
|
-
| formConfig | Object | - | 表单配置对象 (Required)。 |
|
|
19
|
-
| readonly | Boolean | false | 是否只读。 |
|
|
20
|
-
| autoLoad | Boolean | true | 是否自动加载数据。 |
|
|
21
|
-
| labelWidth | String | 'auto' | 标签宽度。 |
|
|
22
|
-
| gridNum | Number | 1 | 列数。 |
|
|
23
|
-
|
|
24
|
-
## 方法 (Exposed Methods)
|
|
25
|
-
|
|
26
|
-
可通过 `ref` 获取实例调用:
|
|
27
|
-
- `getRef(name)`: 获取内部字段组件实例。
|
|
28
|
-
|
|
29
|
-
## 使用示例
|
|
5
|
+
## 基础用法
|
|
30
6
|
|
|
31
7
|
```vue
|
|
32
8
|
<template>
|
|
33
9
|
<sohelp-entity-form
|
|
10
|
+
ref="entityFormRef"
|
|
34
11
|
v-model="formData"
|
|
35
|
-
refid="
|
|
36
|
-
:formConfig="
|
|
12
|
+
refid="module!entity"
|
|
13
|
+
:formConfig="formConfig"
|
|
14
|
+
:gridNum="2"
|
|
37
15
|
/>
|
|
38
16
|
</template>
|
|
39
17
|
|
|
40
18
|
<script setup>
|
|
41
19
|
import { ref } from 'vue';
|
|
42
20
|
const formData = ref({});
|
|
43
|
-
const
|
|
21
|
+
const formConfig = {};
|
|
22
|
+
const entityFormRef = ref();
|
|
23
|
+
|
|
24
|
+
// 加载数据
|
|
25
|
+
entityFormRef.value.load({ id: '1' });
|
|
26
|
+
// 保存数据
|
|
27
|
+
entityFormRef.value.save();
|
|
44
28
|
</script>
|
|
45
29
|
```
|
|
30
|
+
|
|
31
|
+
## 属性 (Props)
|
|
32
|
+
|
|
33
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
34
|
+
| --- | --- | --- | --- | --- |
|
|
35
|
+
| modelValue | Object | - | 否 | 表单数据对象,支持 v-model |
|
|
36
|
+
| data | Object | - | 否 | 表单关联数据对象 |
|
|
37
|
+
| refid | String | - | 是 | 实体引用 ID,用于加载元数据配置 |
|
|
38
|
+
| readonly | Boolean | false | 否 | 是否只读模式 |
|
|
39
|
+
| autoLoad | Boolean | true | 否 | 是否自动加载数据 |
|
|
40
|
+
| formConfig | Object | - | 是 | 表单配置对象 |
|
|
41
|
+
| labelWidth | String | - | 否 | 标签宽度,默认从实体配置读取或 'auto' |
|
|
42
|
+
| gridNum | Number | 1 | 否 | 表单列数 |
|
|
43
|
+
| saveParams | Object | {} | 否 | 保存时附加的额外参数 |
|
|
44
|
+
|
|
45
|
+
## 事件 (Events)
|
|
46
|
+
|
|
47
|
+
| 事件名 | 回调参数 | 说明 |
|
|
48
|
+
| --- | --- | --- |
|
|
49
|
+
| update:modelValue | (value: Object) | 表单值变化时触发 |
|
|
50
|
+
| update:data | (data: Object) | 表单关联数据变化时触发 |
|
|
51
|
+
|
|
52
|
+
## 插槽 (Slots)
|
|
53
|
+
|
|
54
|
+
| 插槽名 | 说明 |
|
|
55
|
+
| --- | --- |
|
|
56
|
+
| [动态插槽] | 透传至内部 SohelpProForm 的自定义插槽,可用于覆盖特定字段渲染 |
|
|
57
|
+
|
|
58
|
+
## 公开方法 (Expose)
|
|
59
|
+
|
|
60
|
+
- `loadConfig(refid?)` - 重新加载实体表单配置
|
|
61
|
+
- `load(params?, callback?)` - 通过引擎根据参数加载表单数据
|
|
62
|
+
- `loadByInitial(params?, callback?)` - 加载表单初始化数据
|
|
63
|
+
- `save(params?, callback?)` - 通过引擎保存表单数据
|
|
64
|
+
- `getFormData()` - 获取表单关联数据对象
|
|
65
|
+
- `getFormValue()` - 获取表单值对象
|
|
66
|
+
- `setFormData(data, params?)` - 设置表单数据
|
|
67
|
+
- `setFormValue(value)` - 设置表单值
|
|
68
|
+
- `setFieldValue(fieldName, fieldValue)` - 设置单个字段值
|
|
69
|
+
- `getFieldValue(fieldName)` - 获取单个字段值
|
|
70
|
+
- `getItemValue(fieldName)` - 获取配置项信息
|
|
71
|
+
- `setItemValue(fieldName, objectValue)` - 修改配置项属性
|
|
72
|
+
- `getCrudUpdater()` - 获取相对初始值变更过的字段(增量更新对象)
|
|
73
|
+
- `resetFormValue()` - 重置表单到默认值
|
|
74
|
+
- `validate()` - 验证表单
|
|
75
|
+
- `clearValidate()` - 清除表单验证信息
|
|
76
|
+
- `getRef(refName)` - 获取内部字段组件实例
|
|
77
|
+
- `proFormRef` - 内部 ProForm 组件引用
|
|
78
|
+
- `labelWidth` - 当前标签宽度
|
|
79
|
+
- `grid` - 当前列数
|
|
80
|
+
- `globalConfig` - 全局配置对象
|
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
import { useMobile } from '@/utils/use-mobile';
|
|
38
38
|
import { useI18n } from 'vue-i18n';
|
|
39
39
|
import { EleMessage } from '@/components/ele-admin-plus/components';
|
|
40
|
+
import { safeEval } from '../utils/safe-eval.js';
|
|
40
41
|
|
|
41
42
|
const formValue = ref({});
|
|
42
43
|
const formData = ref({});
|
|
@@ -145,8 +146,8 @@
|
|
|
145
146
|
/**提取计算公式中涉及的字段 */
|
|
146
147
|
const extractFields = (list) => {
|
|
147
148
|
const fieldMap = {};
|
|
148
|
-
const regex = /{\s*(\w+)\s*}/g;
|
|
149
149
|
list.forEach((item) => {
|
|
150
|
+
const regex = /{\s*(\w+)\s*}/g;
|
|
150
151
|
let match;
|
|
151
152
|
while ((match = regex.exec(item.formulaValue)) !== null) {
|
|
152
153
|
const field = match[1];
|
|
@@ -477,7 +478,7 @@
|
|
|
477
478
|
try {
|
|
478
479
|
// 公式表达式处理
|
|
479
480
|
const expr = formula.formulaValue.replace(/\s+/g, '').replace(/\${/g, 'row.').replace(/}/g, '');
|
|
480
|
-
val[formula.field] =
|
|
481
|
+
val[formula.field] = safeEval(expr, { row: val });
|
|
481
482
|
} catch (e) {
|
|
482
483
|
console.error('计算公式错误', e);
|
|
483
484
|
EleMessage.error('计算公式错误' + e.message);
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
# 实体表格
|
|
1
|
+
# SohelpEntityGrid 实体表格
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于实体元数据配置(`refid`)自动渲染的表格组件,内部封装了 `SohelpGridView`,并固定 `isEntityGrid` 为 `true`。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
8
|
-
| :--- | :--- | :--- | :--- |
|
|
9
|
-
| refid | String | - | 实体引用 ID (Required)。 |
|
|
10
|
-
| modelValue | Object | - | 绑定的值。 |
|
|
11
|
-
|
|
12
|
-
## 使用示例
|
|
5
|
+
## 基础用法
|
|
13
6
|
|
|
14
7
|
```vue
|
|
15
8
|
<template>
|
|
16
|
-
<sohelp-entity-grid refid="
|
|
9
|
+
<sohelp-entity-grid refid="module!entity" />
|
|
17
10
|
</template>
|
|
18
11
|
```
|
|
12
|
+
|
|
13
|
+
## 属性 (Props)
|
|
14
|
+
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
16
|
+
| --- | --- | --- | --- | --- |
|
|
17
|
+
| refid | String | - | 是 | 实体引用 ID,用于加载表格配置 |
|
|
18
|
+
| modelValue | Object | - | 否 | 绑定值 |
|
|
19
|
+
|
|
20
|
+
> 组件通过 `v-bind="$attrs"` 将其余属性透传至内部 `SohelpGridView`。
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
# SohelpFileUpload
|
|
1
|
+
# SohelpFileUpload 文件上传
|
|
2
2
|
|
|
3
|
-
基于 `vxe-upload`
|
|
3
|
+
基于 `vxe-upload` 封装的文件上传组件,支持拖拽上传、粘贴上传、文件下载和预览,自动对接后端文件接口。
|
|
4
4
|
|
|
5
5
|
## 基础用法
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
<
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<sohelp-file-upload v-model="fileId" v-model:data="fileData" refid="myRefId" ref_id="recordId" ref_type="1" />
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { ref } from 'vue';
|
|
14
|
+
const fileId = ref('');
|
|
15
|
+
const fileData = ref([]);
|
|
16
|
+
</script>
|
|
9
17
|
```
|
|
10
18
|
|
|
11
19
|
## 属性 (Props)
|
|
12
20
|
|
|
13
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
14
|
-
|
|
|
15
|
-
| modelValue |
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
|
26
|
-
| update:modelValue | 更新绑定的 ID 集合 | (ids: Array) |
|
|
27
|
-
| update:data | 更新文件对象数组 | (files: Array) |
|
|
28
|
-
|
|
29
|
-
## 功能特性
|
|
30
|
-
|
|
31
|
-
- **上传**: 调用后端接口 `/engine/web/file/upload` 上传文件。
|
|
32
|
-
- **下载**: 点击文件名可下载文件,调用 `/engine/web/file/download/{id}`。
|
|
33
|
-
- **删除**: 支持删除已上传文件。
|
|
34
|
-
- **进度**: 显示上传进度。
|
|
35
|
-
- **校验**: 校验文件数量、大小和类型。
|
|
21
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
22
|
+
| --- | --- | --- | --- | --- |
|
|
23
|
+
| modelValue (v-model) | String / Array | - | 否 | 文件ID,多文件时为数组 |
|
|
24
|
+
| data (v-model:data) | Array | - | 否 | 文件详细数据(含 id 和 filename) |
|
|
25
|
+
| readonly | Boolean | `false` | 否 | 是否只读 |
|
|
26
|
+
| multiple | Boolean | `false` | 否 | 是否支持多文件上传 |
|
|
27
|
+
| limitSize | Number | `1` | 否 | 单个文件大小限制(MB) |
|
|
28
|
+
| moreConfig | Object | `{ maxCount: 1, layout: 'horizontal' }` | 否 | 上传组件额外配置 |
|
|
29
|
+
| refid | String | - | 否 | 业务关联ID |
|
|
30
|
+
| ref_id | String | - | 否 | 引用记录ID |
|
|
31
|
+
| ref_type | String / Number | - | 否 | 引用类型 |
|
|
32
|
+
| drag | Boolean | `true` | 否 | 是否启用拖拽上传 |
|
|
33
|
+
| showButtonText | Boolean | `false` | 否 | 是否显示按钮文字 |
|
|
@@ -208,7 +208,7 @@
|
|
|
208
208
|
const arr = Array.isArray(val) ? val : [val];
|
|
209
209
|
const v = Array.isArray(data.value) ? data.value : [data.value];
|
|
210
210
|
originList.value = arr.map((item) => {
|
|
211
|
-
const filename = v?.find((row) => row?.id === item)?.filename || item
|
|
211
|
+
const filename = v?.find((row) => row?.id === item)?.filename || item;
|
|
212
212
|
return {
|
|
213
213
|
id: item,
|
|
214
214
|
name: filename,
|
|
@@ -1,41 +1,45 @@
|
|
|
1
|
-
# SohelpFilterScheme
|
|
1
|
+
# SohelpFilterScheme 筛选方案
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于 `ele-card` 和 `ele-tabs` 封装的多模式筛选组件,支持快捷筛选(关键字)、高级筛选和场景筛选三种模式。
|
|
4
4
|
|
|
5
5
|
## 基础用法
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<sohelp-filter-scheme
|
|
10
|
+
v-model="filterData"
|
|
11
|
+
:filterConfig="filterConfig"
|
|
12
|
+
:propertiesMap="propertiesMap"
|
|
13
|
+
refid="myRefId"
|
|
14
|
+
@filter="onFilter"
|
|
15
|
+
/>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script setup>
|
|
19
|
+
import { ref } from 'vue';
|
|
20
|
+
const filterData = ref({ keywords: '', filter: {}, scheme: '' });
|
|
21
|
+
const filterConfig = ref({ keywords: ['name', 'phone'] });
|
|
22
|
+
const propertiesMap = ref({
|
|
23
|
+
name: { label: '姓名' },
|
|
24
|
+
phone: { label: '电话' }
|
|
25
|
+
});
|
|
26
|
+
const onFilter = () => { /* 执行筛选 */ };
|
|
27
|
+
</script>
|
|
13
28
|
```
|
|
14
29
|
|
|
15
30
|
## 属性 (Props)
|
|
16
31
|
|
|
17
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
18
|
-
|
|
|
19
|
-
|
|
|
32
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
33
|
+
| --- | --- | --- | --- | --- |
|
|
34
|
+
| modelValue (v-model) | Object | `{ keywords: '', filter: {}, scheme: '' }` | 是 | 筛选表单数据 |
|
|
35
|
+
| filterConfig | Object | `{}` | 是 | 筛选配置,如 `{ keywords: ['field1', 'field2'] }` |
|
|
36
|
+
| propertiesMap | Object | - | 否 | 字段属性映射,用于显示字段标签 |
|
|
37
|
+
| refid | String | - | 否 | 业务关联ID |
|
|
20
38
|
|
|
21
39
|
## 事件 (Events)
|
|
22
40
|
|
|
23
|
-
| 事件名 |
|
|
24
|
-
|
|
|
25
|
-
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
1. **关键字搜索**: 提供简单的输入框进行模糊查询。
|
|
30
|
-
2. **高级筛选**: 根据配置的字段生成表单,支持多种输入类型(文本、日期、选择器等)。
|
|
31
|
-
3. **筛选方案**:
|
|
32
|
-
- 支持保存当前的筛选条件为方案。
|
|
33
|
-
- 支持切换不同的筛选方案。
|
|
34
|
-
- 支持设置默认方案。
|
|
35
|
-
4. **常用条件**: 快速选择预设的常用条件。
|
|
36
|
-
|
|
37
|
-
## 内部方法
|
|
38
|
-
|
|
39
|
-
- `onFilter`: 触发筛选事件。
|
|
40
|
-
- `onReset`: 重置筛选条件为初始值。
|
|
41
|
-
- `saveScheme`: 保存当前筛选条件为新方案。
|
|
41
|
+
| 事件名 | 回调参数 | 说明 |
|
|
42
|
+
| --- | --- | --- |
|
|
43
|
+
| update:modelValue | `value: Object` | 筛选数据变更时触发 |
|
|
44
|
+
| filter | - | 点击"筛选"或"重置"按钮时触发 |
|
|
45
|
+
| reset | - | 点击"重置"按钮时触发 |
|