sohelp-eleplus 1.1.27 → 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/package.json +2 -2
- 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-cry-input/README.md +19 -195
- package/sohelp-cry-input/index.vue +5 -1
- 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 +2217 -2210
- package/sohelp-grid/js/SohelpGridConfig.js +3 -3
- package/sohelp-grid/js/useSohelpGridConfig.js +641 -642
- 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 +158 -158
- 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
package/sohelp-table/README.md
CHANGED
|
@@ -1,36 +1,44 @@
|
|
|
1
|
-
# SohelpTable
|
|
1
|
+
# SohelpTable 表格
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于 ele-pro-table 封装的配置化表格组件。通过 `refid` 从后端加载表格列配置,自动渲染列定义、支持分页查询、选择行数据等功能,并内置序号列和多选列。
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## 基础用法
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<sohelp-table ref="tableRef" refid="demo_table" url="/api/data/list">
|
|
10
|
+
<template #action="{ row }">
|
|
11
|
+
<el-button size="small" @click="handleEdit(row)">编辑</el-button>
|
|
12
|
+
</template>
|
|
13
|
+
</sohelp-table>
|
|
14
|
+
</template>
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
<script setup>
|
|
17
|
+
import { ref } from 'vue';
|
|
18
|
+
const tableRef = ref(null);
|
|
19
|
+
</script>
|
|
20
|
+
```
|
|
15
21
|
|
|
16
|
-
|
|
17
|
-
| :--- | :--- |
|
|
18
|
-
| `toolbar` | Custom content for the table toolbar. Scope: `{ row }`. |
|
|
19
|
-
| `action` | Custom content for the action column. Scope: `{ row }`. |
|
|
20
|
-
| `...` | - | Passes through all slots supported by `ele-pro-table`. |
|
|
22
|
+
## 属性 (Props)
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
25
|
+
| --- | --- | --- | --- | --- |
|
|
26
|
+
| refid | String | `''` | 是 | 网格列表配置ID,用于从后端加载列配置 |
|
|
27
|
+
| url | String | `''` | 否 | 数据源请求URL |
|
|
28
|
+
| where | Object | `{}` | 否 | 额外的查询条件参数 |
|
|
23
29
|
|
|
24
|
-
|
|
25
|
-
| :--- | :--- |
|
|
26
|
-
| `reload(param)` | Reloads the table data. |
|
|
27
|
-
| `getData()` | Returns the current table data. |
|
|
28
|
-
| `getTableRef()` | Returns the underlying table reference. |
|
|
30
|
+
## 插槽 (Slots)
|
|
29
31
|
|
|
30
|
-
|
|
32
|
+
| 插槽名 | 说明 |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| toolbar | 工具栏区域自定义内容,作用域参数: `{ row }` |
|
|
35
|
+
| action | 操作列自定义内容,作用域参数: `{ row }` |
|
|
36
|
+
| default | 默认插槽,透传到 ele-pro-table |
|
|
31
37
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
38
|
+
## 公开方法 (Expose)
|
|
39
|
+
|
|
40
|
+
- `reload(param)` - 重新加载表格数据
|
|
41
|
+
- `getData()` - 获取当前表格数据
|
|
42
|
+
- `getTableRef()` - 获取内部 ele-pro-table 实例引用
|
|
43
|
+
- `datasource` - 数据源函数
|
|
44
|
+
- `sohelpConfig` - 表格配置对象
|
package/sohelp-table/index.vue
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
highlight-current-row
|
|
13
13
|
>
|
|
14
14
|
<slot>
|
|
15
|
-
<template v-for="(slotProps, slotName) in $
|
|
15
|
+
<template v-for="(slotProps, slotName) in $slots" :key="slotName">
|
|
16
16
|
<slot :name="slotName" v-bind="slotProps" />
|
|
17
17
|
</template>
|
|
18
18
|
</slot>
|
|
@@ -25,125 +25,126 @@
|
|
|
25
25
|
</template>
|
|
26
26
|
</ele-pro-table>
|
|
27
27
|
</template>
|
|
28
|
-
<script>
|
|
28
|
+
<script setup>
|
|
29
29
|
import { reactive, ref } from 'vue';
|
|
30
30
|
import { moduleCache } from '../cache/ModuleCache';
|
|
31
31
|
import { EleMessage } from '@/components/ele-admin-plus/components';
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
type: String,
|
|
45
|
-
default: ''
|
|
46
|
-
},
|
|
47
|
-
/**数据源URL**/
|
|
48
|
-
where: {
|
|
49
|
-
type: Object,
|
|
50
|
-
default: {}
|
|
51
|
-
}
|
|
33
|
+
const props = defineProps({
|
|
34
|
+
/**网格列表配置ID*/
|
|
35
|
+
refid: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: '',
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
/**数据源URL**/
|
|
41
|
+
url: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: ''
|
|
52
44
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
const selections = ref([]);
|
|
60
|
-
/**默认加载数据**/
|
|
61
|
-
const loadOnCreated = ref(false);
|
|
45
|
+
/**数据源URL**/
|
|
46
|
+
where: {
|
|
47
|
+
type: Object,
|
|
48
|
+
default: {}
|
|
49
|
+
}
|
|
50
|
+
});
|
|
62
51
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
type: 'index',
|
|
74
|
-
columnKey: 'index',
|
|
75
|
-
width: 50,
|
|
76
|
-
align: 'center',
|
|
77
|
-
fixed: 'left'
|
|
78
|
-
}
|
|
79
|
-
]);
|
|
52
|
+
/**列表实例*/
|
|
53
|
+
const sohelpTableRef = ref(null);
|
|
54
|
+
/**存储表格配置*/
|
|
55
|
+
const sohelpConfig = reactive({});
|
|
56
|
+
/**在放选中数据列表**/
|
|
57
|
+
const selections = ref([]);
|
|
58
|
+
/**默认加载数据**/
|
|
59
|
+
const loadOnCreated = ref(false);
|
|
80
60
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
61
|
+
/**自定义列配置 **/
|
|
62
|
+
const columns = reactive([
|
|
63
|
+
{
|
|
64
|
+
type: 'selection',
|
|
65
|
+
columnKey: 'selection',
|
|
66
|
+
width: 50,
|
|
67
|
+
align: 'center',
|
|
68
|
+
fixed: 'left'
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: 'index',
|
|
72
|
+
columnKey: 'index',
|
|
73
|
+
width: 50,
|
|
74
|
+
align: 'center',
|
|
75
|
+
fixed: 'left'
|
|
76
|
+
}
|
|
77
|
+
]);
|
|
78
|
+
|
|
79
|
+
/** 表格数据源 */
|
|
80
|
+
const datasource = async ({ page, limit, where, orders }) => {
|
|
81
|
+
if (!loadOnCreated.value) {
|
|
82
|
+
return { total: 0, results: [] };
|
|
83
|
+
}
|
|
84
|
+
const res = await SohelpHttp.get(props.url || sohelpConfig.requestValue, {
|
|
85
|
+
page,
|
|
86
|
+
limit,
|
|
87
|
+
...where,
|
|
88
|
+
...props.where,
|
|
89
|
+
orders
|
|
90
|
+
}).catch((e) => {
|
|
91
|
+
EleMessage.error(e.message);
|
|
92
|
+
});
|
|
93
|
+
if (!res) return;
|
|
94
|
+
return res.data;
|
|
95
|
+
};
|
|
97
96
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
97
|
+
/**根据配置列转成ProTable格式的列*/
|
|
98
|
+
const switchProperty = (property) => {
|
|
99
|
+
return {
|
|
100
|
+
prop: property.name,
|
|
101
|
+
columnKey: property.name,
|
|
102
|
+
label: property.label,
|
|
103
|
+
width: property.width || 100
|
|
104
|
+
};
|
|
105
|
+
};
|
|
107
106
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
107
|
+
/***初始化网格列表配置**/
|
|
108
|
+
const initProTableConfiguration = (cfg) => {
|
|
109
|
+
loadOnCreated.value = true;
|
|
110
|
+
reload();
|
|
111
|
+
};
|
|
112
|
+
/**获取列表配置*/
|
|
113
|
+
moduleCache.getGrid(props.refid).then((data) => {
|
|
114
|
+
Object.assign(sohelpConfig, { ...data });
|
|
115
|
+
//初始化属性列表配置
|
|
116
|
+
data.properties.map((property) => {
|
|
117
|
+
columns.push(switchProperty(property));
|
|
118
|
+
});
|
|
119
|
+
/**添加操作列**/
|
|
120
|
+
columns.push({
|
|
121
|
+
field: 'action',
|
|
122
|
+
label: '操作',
|
|
123
|
+
width: 200,
|
|
124
|
+
align: 'center',
|
|
125
|
+
slot: 'action'
|
|
126
|
+
});
|
|
127
|
+
//初始化表格配置
|
|
128
|
+
initProTableConfiguration();
|
|
129
|
+
});
|
|
131
130
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
131
|
+
const reload = (param) => {
|
|
132
|
+
sohelpTableRef.value?.reload?.(param);
|
|
133
|
+
};
|
|
134
|
+
const getData = () => {
|
|
135
|
+
return sohelpTableRef.value?.getData?.();
|
|
136
|
+
};
|
|
137
|
+
const getTableRef = () => {
|
|
138
|
+
return sohelpTableRef.value?.getTableRef?.();
|
|
139
|
+
};
|
|
141
140
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
141
|
+
defineExpose({
|
|
142
|
+
reload, getData, getTableRef, datasource, sohelpConfig
|
|
143
|
+
});
|
|
144
|
+
</script>
|
|
145
|
+
<script>
|
|
146
|
+
export default {
|
|
147
|
+
name: 'SohelpTable'
|
|
147
148
|
};
|
|
148
149
|
</script>
|
|
149
150
|
<style scoped></style>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# SohelpTableSelect 表格弹窗选择器
|
|
2
|
+
|
|
3
|
+
基于 el-input、sohelp-modal 和 SohelpGridView 封装的弹窗表格选择组件。点击搜索图标弹出模态窗口,内嵌网格列表进行数据选择,支持单选和多选模式,多选时右侧显示已选列表面板。
|
|
4
|
+
|
|
5
|
+
## 基础用法
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<sohelp-table-select
|
|
10
|
+
v-model="selectedValue"
|
|
11
|
+
v-model:data="selectedData"
|
|
12
|
+
refid="demo_grid"
|
|
13
|
+
labelField="name"
|
|
14
|
+
valueField="id"
|
|
15
|
+
:multiple="true"
|
|
16
|
+
title="选择用户"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<script setup>
|
|
21
|
+
import { ref } from 'vue';
|
|
22
|
+
const selectedValue = ref([]);
|
|
23
|
+
const selectedData = ref([]);
|
|
24
|
+
</script>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 属性 (Props)
|
|
28
|
+
|
|
29
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
30
|
+
| --- | --- | --- | --- | --- |
|
|
31
|
+
| multiple | Boolean | `false` | 否 | 是否允许多选 |
|
|
32
|
+
| placeholder | String | `'请选择'` | 否 | 输入框占位文本 |
|
|
33
|
+
| title | String | `'请选择'` | 否 | 弹窗标题 |
|
|
34
|
+
| valueField | String | `'id'` | 否 | 值字段名 |
|
|
35
|
+
| labelField | String | `'label'` | 否 | 显示文本对应的字段名 |
|
|
36
|
+
| refid | String | `''` | 否 | 网格列表配置ID |
|
|
37
|
+
|
|
38
|
+
## 双向绑定 (v-model)
|
|
39
|
+
|
|
40
|
+
| 属性名 | 类型 | 说明 |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| modelValue | String / Array | 绑定值,单选时为字符串,多选时为数组 |
|
|
43
|
+
| data | Object / Array | 已选中的数据对象或数组 |
|
|
44
|
+
|
|
45
|
+
## 事件 (Events)
|
|
46
|
+
|
|
47
|
+
| 事件名 | 回调参数 | 说明 |
|
|
48
|
+
| --- | --- | --- |
|
|
49
|
+
| change | (selectedList) | 确认选择后触发,参数为选中项列表 |
|
|
50
|
+
|
|
51
|
+
## 插槽 (Slots)
|
|
52
|
+
|
|
53
|
+
| 插槽名 | 说明 |
|
|
54
|
+
| --- | --- |
|
|
55
|
+
| trigger | 自定义触发器区域,作用域参数: `{ selected }` |
|
|
@@ -1,22 +1,8 @@
|
|
|
1
|
-
# SohelpTenantSelect
|
|
1
|
+
# SohelpTenantSelect 租户选择器
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于 `sohelp-vxe-grid-select` 封装的租户选择组件,以表格弹窗形式展示租户列表,支持分页和多选确认。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
| Name | Type | Default | Description |
|
|
8
|
-
| :--- | :--- | :--- | :--- |
|
|
9
|
-
| `url` | `String` | `'/engine/web/tenant/page'` | The API URL to fetch tenant data. |
|
|
10
|
-
| `title` | `String` | `'选择租户'` | The title of the selection dialog. |
|
|
11
|
-
| `...` | - | - | Supports all `sohelp-vxe-grid-select` props. |
|
|
12
|
-
|
|
13
|
-
## Events
|
|
14
|
-
|
|
15
|
-
| Name | Parameters | Description |
|
|
16
|
-
| :--- | :--- | :--- |
|
|
17
|
-
| `confirm` | `(rows: Array)` | Triggered when the user confirms the selection. Returns the selected rows. |
|
|
18
|
-
|
|
19
|
-
## Usage
|
|
5
|
+
## 基础用法
|
|
20
6
|
|
|
21
7
|
```vue
|
|
22
8
|
<template>
|
|
@@ -25,7 +11,22 @@ A component for selecting tenants using a grid view (`sohelp-vxe-grid-select`).
|
|
|
25
11
|
|
|
26
12
|
<script setup>
|
|
27
13
|
const handleConfirm = (rows) => {
|
|
28
|
-
console.log('
|
|
14
|
+
console.log('选中的租户:', rows);
|
|
29
15
|
};
|
|
30
16
|
</script>
|
|
31
17
|
```
|
|
18
|
+
|
|
19
|
+
## 属性 (Props)
|
|
20
|
+
|
|
21
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
22
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
23
|
+
| url | String | `'/engine/web/tenant/page'` | 否 | 租户数据分页接口地址 |
|
|
24
|
+
| title | String | `'选择租户'` | 否 | 选择弹窗标题 |
|
|
25
|
+
|
|
26
|
+
> 同时支持所有 `sohelp-vxe-grid-select` 原生属性,通过 `v-bind="$attrs"` 透传。
|
|
27
|
+
|
|
28
|
+
## 事件 (Events)
|
|
29
|
+
|
|
30
|
+
| 事件名 | 回调参数 | 说明 |
|
|
31
|
+
| :--- | :--- | :--- |
|
|
32
|
+
| confirm | `(rows: Array)` | 用户确认选择后触发,返回选中的行数据数组 |
|
|
@@ -1,126 +1,122 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<sohelp-vxe-grid-select label-field="tenant_name" :title="title" ref="vxeGridSelectRef" v-bind="$attrs" :gridOptions="gridOptions" @show="show" @confirm="confirm"></sohelp-vxe-grid-select>
|
|
3
3
|
</template>
|
|
4
|
-
<script>
|
|
4
|
+
<script setup>
|
|
5
5
|
import SohelpVxeGridSelect from "../sohelp-vxe-grid-select/index.vue";
|
|
6
6
|
import { nextTick, reactive, ref } from "vue";
|
|
7
7
|
import { EleMessage } from "@/components/ele-admin-plus/components";
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
url:{
|
|
14
|
-
type:String,
|
|
15
|
-
default:'/engine/web/tenant/page'
|
|
16
|
-
},
|
|
17
|
-
title:{
|
|
18
|
-
type:String,
|
|
19
|
-
default:'选择租户'
|
|
20
|
-
}
|
|
21
|
-
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
url:{
|
|
11
|
+
type:String,
|
|
12
|
+
default:'/engine/web/tenant/page'
|
|
22
13
|
},
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
vxeGridSelectRef.value.$grid.loadData(res.data.results);
|
|
31
|
-
})
|
|
14
|
+
title:{
|
|
15
|
+
type:String,
|
|
16
|
+
default:'选择租户'
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
const emit = defineEmits(['confirm']);
|
|
32
21
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
const vxeGridSelectRef= ref();
|
|
23
|
+
const show = (options) => {
|
|
24
|
+
SohelpHttp.get(props.url,{}).then(res=>{
|
|
25
|
+
if(res.meta.success){
|
|
26
|
+
nextTick(()=>{
|
|
27
|
+
gridOptions.pagerConfig.total = res.data.total;
|
|
28
|
+
vxeGridSelectRef.value.$grid.loadData(res.data.results);
|
|
36
29
|
})
|
|
37
|
-
}
|
|
38
30
|
|
|
39
|
-
|
|
40
|
-
|
|
31
|
+
}else{
|
|
32
|
+
EleMessage.error(res.meta.message);
|
|
41
33
|
}
|
|
34
|
+
})
|
|
35
|
+
}
|
|
42
36
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
customConfig: {
|
|
46
|
-
placement: 'top-right' // 自定义列工具栏位置
|
|
47
|
-
},
|
|
48
|
-
rowConfig: {
|
|
49
|
-
useKey: true,
|
|
50
|
-
sHover: true,
|
|
51
|
-
isCurrent: true
|
|
52
|
-
},
|
|
53
|
-
keyboardConfig: {
|
|
54
|
-
isEdit: true,
|
|
55
|
-
isArrow: true,
|
|
56
|
-
isEnter: true,
|
|
57
|
-
isTab: true,
|
|
58
|
-
isDel: true,
|
|
59
|
-
isBack: true
|
|
60
|
-
},
|
|
61
|
-
mouseConfig: {
|
|
62
|
-
selected: false
|
|
63
|
-
},
|
|
64
|
-
checkboxConfig: {
|
|
65
|
-
highlight: true,
|
|
66
|
-
range: true
|
|
67
|
-
},
|
|
68
|
-
pagerConfig: {
|
|
69
|
-
enabled: true,
|
|
70
|
-
total: 0,
|
|
71
|
-
currentPage: 1,
|
|
72
|
-
pageSize: 50,
|
|
73
|
-
align: 'center'
|
|
74
|
-
},
|
|
75
|
-
border: true,
|
|
76
|
-
stripe: true,
|
|
77
|
-
loading: false,
|
|
78
|
-
minHeight: 200,
|
|
79
|
-
maxHeight: '100%',
|
|
80
|
-
size: 'mini',
|
|
81
|
-
columnConfig: {
|
|
82
|
-
resizable: true
|
|
83
|
-
},
|
|
84
|
-
columns: [
|
|
85
|
-
{ field: 'checkbox', fixed: 'left', type: 'checkbox', align: 'center', width: 40 },
|
|
86
|
-
{
|
|
87
|
-
type: 'seq',
|
|
88
|
-
title: '#',
|
|
89
|
-
fixe: 'left',
|
|
90
|
-
align: 'center',
|
|
91
|
-
width: 40
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
title: 'id',
|
|
95
|
-
width: 200,
|
|
96
|
-
field: 'id',
|
|
97
|
-
visible: false
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
title: '租户',
|
|
101
|
-
width: 200,
|
|
102
|
-
field: 'tenant_name',
|
|
103
|
-
showOverflow: 'tooltip'
|
|
104
|
-
}, {
|
|
105
|
-
title: '备注',
|
|
106
|
-
minWidth: 200,
|
|
107
|
-
field: 'comments',
|
|
108
|
-
showOverflow: 'tooltip'
|
|
109
|
-
}, {
|
|
110
|
-
title: '创建日期',
|
|
111
|
-
width: 160,
|
|
112
|
-
field: 'create_time'
|
|
113
|
-
}
|
|
114
|
-
],
|
|
115
|
-
data: []
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
return {vxeGridSelectRef,gridOptions,show,confirm}
|
|
121
|
-
|
|
122
|
-
}
|
|
37
|
+
const confirm = (rows) => {
|
|
38
|
+
emit('confirm',rows);
|
|
123
39
|
}
|
|
40
|
+
|
|
41
|
+
/** 表格配置 */
|
|
42
|
+
const gridOptions = reactive({
|
|
43
|
+
customConfig: {
|
|
44
|
+
placement: 'top-right' // 自定义列工具栏位置
|
|
45
|
+
},
|
|
46
|
+
rowConfig: {
|
|
47
|
+
useKey: true,
|
|
48
|
+
sHover: true,
|
|
49
|
+
isCurrent: true
|
|
50
|
+
},
|
|
51
|
+
keyboardConfig: {
|
|
52
|
+
isEdit: true,
|
|
53
|
+
isArrow: true,
|
|
54
|
+
isEnter: true,
|
|
55
|
+
isTab: true,
|
|
56
|
+
isDel: true,
|
|
57
|
+
isBack: true
|
|
58
|
+
},
|
|
59
|
+
mouseConfig: {
|
|
60
|
+
selected: false
|
|
61
|
+
},
|
|
62
|
+
checkboxConfig: {
|
|
63
|
+
highlight: true,
|
|
64
|
+
range: true
|
|
65
|
+
},
|
|
66
|
+
pagerConfig: {
|
|
67
|
+
enabled: true,
|
|
68
|
+
total: 0,
|
|
69
|
+
currentPage: 1,
|
|
70
|
+
pageSize: 50,
|
|
71
|
+
align: 'center'
|
|
72
|
+
},
|
|
73
|
+
border: true,
|
|
74
|
+
stripe: true,
|
|
75
|
+
loading: false,
|
|
76
|
+
minHeight: 200,
|
|
77
|
+
maxHeight: '100%',
|
|
78
|
+
size: 'mini',
|
|
79
|
+
columnConfig: {
|
|
80
|
+
resizable: true
|
|
81
|
+
},
|
|
82
|
+
columns: [
|
|
83
|
+
{ field: 'checkbox', fixed: 'left', type: 'checkbox', align: 'center', width: 40 },
|
|
84
|
+
{
|
|
85
|
+
type: 'seq',
|
|
86
|
+
title: '#',
|
|
87
|
+
fixed: 'left',
|
|
88
|
+
align: 'center',
|
|
89
|
+
width: 40
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
title: 'id',
|
|
93
|
+
width: 200,
|
|
94
|
+
field: 'id',
|
|
95
|
+
visible: false
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
title: '租户',
|
|
99
|
+
width: 200,
|
|
100
|
+
field: 'tenant_name',
|
|
101
|
+
showOverflow: 'tooltip'
|
|
102
|
+
}, {
|
|
103
|
+
title: '备注',
|
|
104
|
+
minWidth: 200,
|
|
105
|
+
field: 'comments',
|
|
106
|
+
showOverflow: 'tooltip'
|
|
107
|
+
}, {
|
|
108
|
+
title: '创建日期',
|
|
109
|
+
width: 160,
|
|
110
|
+
field: 'create_time'
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
data: []
|
|
114
|
+
});
|
|
115
|
+
</script>
|
|
116
|
+
<script>
|
|
117
|
+
export default {
|
|
118
|
+
name: "SohelpTenantSelect"
|
|
119
|
+
};
|
|
124
120
|
</script>
|
|
125
121
|
|
|
126
122
|
<style scoped>
|
package/sohelp-text/README.md
CHANGED
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
# SohelpText
|
|
1
|
+
# SohelpText 文本展示
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于 `ele-text` 封装的文本展示组件,默认开启字数统计显示。
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
| Name | Type | Default | Description |
|
|
8
|
-
| :--- | :--- | :--- | :--- |
|
|
9
|
-
| `...` | - | - | Supports all `ele-text` props. |
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
5
|
+
## 基础用法
|
|
12
6
|
|
|
13
7
|
```vue
|
|
14
8
|
<template>
|
|
15
|
-
<sohelp-text
|
|
9
|
+
<sohelp-text>这是一段文本内容</sohelp-text>
|
|
16
10
|
</template>
|
|
17
11
|
```
|
|
12
|
+
|
|
13
|
+
## 属性 (Props)
|
|
14
|
+
|
|
15
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
16
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
17
|
+
| - | - | - | - | 支持通过 `v-bind="$attrs"` 透传所有 `ele-text` 原生属性 |
|
|
18
|
+
|
|
19
|
+
## 插槽 (Slots)
|
|
20
|
+
|
|
21
|
+
| 插槽名 | 说明 |
|
|
22
|
+
| :--- | :--- |
|
|
23
|
+
| default | 文本内容 |
|