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
package/sohelp-process/README.md
CHANGED
|
@@ -1,24 +1,37 @@
|
|
|
1
|
-
# SohelpProcess
|
|
1
|
+
# SohelpProcess 进度条
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
自定义进度条组件,支持拖拽交互修改进度值、动画效果和自定义颜色。
|
|
4
4
|
|
|
5
5
|
## 基础用法
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
<
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<sohelp-process v-model="progress" color="#35b558" />
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { ref } from 'vue';
|
|
14
|
+
const progress = ref(50);
|
|
15
|
+
</script>
|
|
9
16
|
```
|
|
10
17
|
|
|
11
18
|
## 属性 (Props)
|
|
12
19
|
|
|
13
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
21
|
+
| --- | --- | --- | --- | --- |
|
|
22
|
+
| modelValue (v-model) | String / Number | `0` | 否 | 进度值(0-100) |
|
|
23
|
+
| readonly | Boolean | `false` | 否 | 是否只读(禁用拖拽) |
|
|
24
|
+
| height | Number / String | `8` | 否 | 进度条高度 |
|
|
25
|
+
| color | String | `'#35b558'` | 否 | 进度条颜色 |
|
|
26
|
+
| delay | Number | `1` | 否 | 动画延迟秒数 |
|
|
27
|
+
| duration | Number | `1` | 否 | 动画持续时间(秒) |
|
|
28
|
+
| animate | Boolean | `false` | 否 | 是否开启动画 |
|
|
29
|
+
| track | String | `'ease-out'` | 否 | 动画轨迹(CSS transition-timing-function) |
|
|
30
|
+
| margin | String | `'10px 0'` | 否 | 外边距 |
|
|
31
|
+
| showPercent | Boolean | `false` | 否 | 是否显示百分比文字 |
|
|
20
32
|
|
|
21
33
|
## 事件 (Events)
|
|
22
34
|
|
|
23
|
-
| 事件名 |
|
|
24
|
-
|
|
|
35
|
+
| 事件名 | 回调参数 | 说明 |
|
|
36
|
+
| --- | --- | --- |
|
|
37
|
+
| update:modelValue | `value: Number` | 进度值变化时触发 |
|
package/sohelp-process/index.vue
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="sohelp-progress-c">
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
<
|
|
3
|
+
<div class="sohelp-progress-wrap">
|
|
4
|
+
<div class="sohelp-progress-box" ref="progressBox" @mousedown="onDragStart" @touchstart="onDragStart">
|
|
5
|
+
<div class="sohelp-progress" :style="style"></div>
|
|
6
6
|
<!-- 拖拽句柄 -->
|
|
7
7
|
<div
|
|
8
8
|
v-if="!props.readonly"
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
@mousedown.stop="onHandleDown"
|
|
12
12
|
@touchstart.stop="onHandleDown"
|
|
13
13
|
></div>
|
|
14
|
-
</
|
|
15
|
-
<
|
|
16
|
-
</
|
|
14
|
+
</div>
|
|
15
|
+
<div class="percent">{{ Number(value) || 0 }}%</div>
|
|
16
|
+
</div>
|
|
17
17
|
</div>
|
|
18
18
|
</template>
|
|
19
19
|
|
package/sohelp-rate/README.md
CHANGED
|
@@ -1,23 +1,35 @@
|
|
|
1
|
-
# SohelpRate
|
|
1
|
+
# SohelpRate 评分
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
基于 `el-rate` 封装的评分组件,支持星星评分和下拉选择两种模式,默认显示文字提示。
|
|
4
4
|
|
|
5
5
|
## 基础用法
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<!-- 星星评分模式(默认) -->
|
|
10
|
+
<sohelp-rate v-model="score" />
|
|
10
11
|
|
|
11
|
-
<!--
|
|
12
|
-
<sohelp-rate v-model="score" type="select" />
|
|
12
|
+
<!-- 下拉选择模式 -->
|
|
13
|
+
<sohelp-rate v-model="score" type="select" />
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import { ref } from 'vue';
|
|
18
|
+
const score = ref(3);
|
|
19
|
+
</script>
|
|
13
20
|
```
|
|
14
21
|
|
|
15
22
|
## 属性 (Props)
|
|
16
23
|
|
|
17
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
18
|
-
|
|
|
19
|
-
|
|
|
24
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
25
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
26
|
+
| modelValue | Number / String / Array | - | 否 | 绑定值(支持 v-model) |
|
|
27
|
+
| type | String | `'rate'` | 否 | 显示模式:`'rate'` 星星评分,`'select'` 下拉选择 |
|
|
28
|
+
|
|
29
|
+
> `rate` 模式下支持通过 `v-bind="$attrs"` 透传所有 `el-rate` 原生属性;`select` 模式下透传给 `sohelp-select`。
|
|
20
30
|
|
|
21
|
-
##
|
|
31
|
+
## 事件 (Events)
|
|
22
32
|
|
|
23
|
-
|
|
33
|
+
| 事件名 | 回调参数 | 说明 |
|
|
34
|
+
| :--- | :--- | :--- |
|
|
35
|
+
| update:modelValue | `(value: Number / String)` | 评分值变化时触发 |
|
package/sohelp-rate/index.vue
CHANGED
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
modelValue: [Number, String, Array]
|
|
27
27
|
},
|
|
28
|
-
|
|
28
|
+
emits: ['update:modelValue'],
|
|
29
29
|
setup(props, { emit, attrs }) {
|
|
30
30
|
const datasource = Array.from({ length: 5 }, (_, i) => ({
|
|
31
31
|
label: '*'.repeat(i + 1),
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
46
|
|
|
47
|
+
watch(value, (val) => {
|
|
48
|
+
emit('update:modelValue', val);
|
|
49
|
+
});
|
|
50
|
+
|
|
47
51
|
return {
|
|
48
52
|
value,
|
|
49
53
|
datasource
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div class="sohelp-relation">
|
|
3
|
+
<!-- TODO: 待实现 - 外键关联输入框 -->
|
|
4
|
+
<el-empty description="外键关联输入框 - 待实现" />
|
|
5
|
+
</div>
|
|
3
6
|
</template>
|
|
7
|
+
<script setup>
|
|
8
|
+
// TODO: 待实现
|
|
9
|
+
</script>
|
|
4
10
|
<script>
|
|
5
|
-
export default {
|
|
6
|
-
name: "SohelpRelation"
|
|
7
|
-
}
|
|
11
|
+
export default { name: 'SohelpRelation' };
|
|
8
12
|
</script>
|
|
9
|
-
<style scoped>
|
|
10
|
-
|
|
11
|
-
</style>
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# SohelpRelationModalSelect 关联选择器
|
|
2
|
+
|
|
3
|
+
基于 `sohelp-modal-select` 封装的关联数据选择组件,支持自定义弹窗内容区域,以多选模式选择关联数据。
|
|
4
|
+
|
|
5
|
+
## 基础用法
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<sohelp-relation-modal-select
|
|
10
|
+
v-model="selectedIds"
|
|
11
|
+
valueField="id"
|
|
12
|
+
labelField="name"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import { ref } from 'vue';
|
|
18
|
+
const selectedIds = ref([]);
|
|
19
|
+
</script>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## 属性 (Props)
|
|
23
|
+
|
|
24
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
25
|
+
| --- | --- | --- | --- | --- |
|
|
26
|
+
| modelValue (v-model) | String / Array | `''` | 否 | 选中项的值 |
|
|
27
|
+
| data | Array / Object | `[]` | 否 | 关联数据 |
|
|
28
|
+
| valueField | String | `'id'` | 否 | 值字段名 |
|
|
29
|
+
| labelField | String | `'user_name'` | 否 | 显示字段名 |
|
|
30
|
+
| multiple | Boolean | `false` | 否 | 是否多选 |
|
|
31
|
+
| beforeConfirm | Function | `() => true` | 否 | 确认前回调,返回 false 阻止确认 |
|
|
32
|
+
| beforeOpen | Function | `() => true` | 否 | 打开前回调,返回 false 阻止打开 |
|
|
33
|
+
| selectionTemplate | String | `'${username}'` | 否 | 已选列表显示模板 |
|
|
34
|
+
|
|
35
|
+
## 事件 (Events)
|
|
36
|
+
|
|
37
|
+
| 事件名 | 回调参数 | 说明 |
|
|
38
|
+
| --- | --- | --- |
|
|
39
|
+
| change | - | 值变化时触发 |
|
|
40
|
+
| confirm | - | 确认选择后触发 |
|
|
41
|
+
| cancel | - | 取消选择时触发 |
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sohelp-modal-select
|
|
3
|
+
v-model="modalSelectValue"
|
|
4
|
+
v-model:data="data"
|
|
5
|
+
:labelField="labelField"
|
|
6
|
+
:valueField="valueField"
|
|
7
|
+
:gridProps="{
|
|
8
|
+
datasource: datasource,
|
|
9
|
+
columns: columns
|
|
10
|
+
}"
|
|
11
|
+
:selectionTemplate="selectionTemplate"
|
|
12
|
+
multiple
|
|
13
|
+
:modalProps="{
|
|
14
|
+
title: '选择用户'
|
|
15
|
+
}"
|
|
16
|
+
>
|
|
17
|
+
|
|
18
|
+
<template #default>
|
|
19
|
+
grid
|
|
20
|
+
</template>
|
|
21
|
+
|
|
22
|
+
</sohelp-modal-select>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script>
|
|
26
|
+
export default {
|
|
27
|
+
name: 'SohelpRelationModalSelect'
|
|
28
|
+
};
|
|
29
|
+
</script>
|
|
30
|
+
<script setup>
|
|
31
|
+
const modalSelectValue = defineModel('modelValue', {
|
|
32
|
+
type: [String, Array],
|
|
33
|
+
default: ''
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
const props = defineProps({
|
|
37
|
+
data:{
|
|
38
|
+
type: [Array,Object],
|
|
39
|
+
default: () => []
|
|
40
|
+
},
|
|
41
|
+
valueField: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: 'id'
|
|
44
|
+
},
|
|
45
|
+
labelField: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: 'user_name'
|
|
48
|
+
},
|
|
49
|
+
multiple: {
|
|
50
|
+
type: Boolean,
|
|
51
|
+
default: false
|
|
52
|
+
},
|
|
53
|
+
beforeConfirm: {
|
|
54
|
+
type: Function,
|
|
55
|
+
default: () => true
|
|
56
|
+
},
|
|
57
|
+
beforeOpen:{
|
|
58
|
+
type: Function,
|
|
59
|
+
default: () => true
|
|
60
|
+
},
|
|
61
|
+
selectionTemplate: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: '${username}'
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const emits = defineEmits(['change','confirm', 'cancel']);
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
</script>
|
|
@@ -1,23 +1,41 @@
|
|
|
1
1
|
# SohelpRichText 富文本编辑器
|
|
2
2
|
|
|
3
|
-
基于 TinyMCE
|
|
3
|
+
基于 TinyMCE 封装的富文本编辑器组件,支持 v-model 双向绑定、暗黑主题自动切换、内联模式等功能。
|
|
4
4
|
|
|
5
5
|
## 基础用法
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
<
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<sohelp-rich-text v-model="content" />
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script setup>
|
|
13
|
+
import { ref } from 'vue';
|
|
14
|
+
const content = ref('<p>Hello World</p>');
|
|
15
|
+
</script>
|
|
9
16
|
```
|
|
10
17
|
|
|
11
18
|
## 属性 (Props)
|
|
12
19
|
|
|
13
|
-
| 属性名 | 类型 | 默认值 | 说明 |
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
| init | Object | - | TinyMCE
|
|
18
|
-
|
|
|
20
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
21
|
+
| --- | --- | --- | --- | --- |
|
|
22
|
+
| id | String | 自动生成 | 否 | 编辑器唯一ID |
|
|
23
|
+
| modelValue (v-model) | String | - | 否 | 编辑器内容(HTML 字符串) |
|
|
24
|
+
| init | Object | - | 否 | TinyMCE 初始化配置 |
|
|
25
|
+
| inline | Boolean | `false` | 否 | 是否启用内联模式 |
|
|
26
|
+
| modelEvents | String | `'change input undo redo'` | 否 | 触发 v-model 更新的事件 |
|
|
27
|
+
| tagName | String | `'div'` | 否 | 内联模式下的容器标签名 |
|
|
28
|
+
| disabled | Boolean | `false` | 否 | 是否禁用编辑器 |
|
|
29
|
+
| autoTheme | Boolean | `true` | 否 | 是否跟随框架主题切换暗黑模式 |
|
|
30
|
+
| darkTheme | Boolean | `false` | 否 | 不跟随框架主题时是否使用暗黑主题 |
|
|
31
|
+
|
|
32
|
+
## 事件 (Events)
|
|
33
|
+
|
|
34
|
+
| 事件名 | 回调参数 | 说明 |
|
|
35
|
+
| --- | --- | --- |
|
|
36
|
+
| update:modelValue | `value: String` | 编辑器内容变化时触发 |
|
|
19
37
|
|
|
20
38
|
## 公开方法 (Expose)
|
|
21
39
|
|
|
22
|
-
- `editorIns
|
|
23
|
-
- `alert(option)
|
|
40
|
+
- `editorIns` - TinyMCE 编辑器实例
|
|
41
|
+
- `alert(option)` - 弹出编辑器提示框
|
|
@@ -5,14 +5,15 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script setup>
|
|
8
|
-
import { watch, onMounted, onBeforeUnmount, onActivated, onDeactivated, nextTick, useAttrs } from 'vue';
|
|
8
|
+
import { shallowRef, watch, onMounted, onBeforeUnmount, onActivated, onDeactivated, nextTick, useAttrs } from 'vue';
|
|
9
9
|
import tinymce from 'tinymce/tinymce';
|
|
10
10
|
import 'tinymce/themes/silver';
|
|
11
11
|
import 'tinymce/icons/default';
|
|
12
12
|
import 'tinymce/plugins/code';
|
|
13
13
|
import 'tinymce/plugins/preview';
|
|
14
14
|
import 'tinymce/plugins/fullscreen';
|
|
15
|
-
|
|
15
|
+
// paste 和 hr 插件在 TinyMCE v6+ 中已内置,无需单独引入
|
|
16
|
+
//import 'tinymce/plugins/paste';
|
|
16
17
|
import 'tinymce/plugins/searchreplace';
|
|
17
18
|
//import 'tinymce/plugins/save';
|
|
18
19
|
//import 'tinymce/plugins/autosave';
|
|
@@ -24,7 +25,7 @@
|
|
|
24
25
|
import 'tinymce/plugins/codesample';
|
|
25
26
|
import 'tinymce/plugins/lists';
|
|
26
27
|
import 'tinymce/plugins/advlist';
|
|
27
|
-
import 'tinymce/plugins/hr';
|
|
28
|
+
//import 'tinymce/plugins/hr';
|
|
28
29
|
import 'tinymce/plugins/charmap';
|
|
29
30
|
import 'tinymce/plugins/emoticons';
|
|
30
31
|
import 'tinymce/plugins/anchor';
|
|
@@ -80,7 +81,7 @@
|
|
|
80
81
|
const elementId = props.id || uuid('tiny-vue');
|
|
81
82
|
|
|
82
83
|
/** 编辑器实例 */
|
|
83
|
-
|
|
84
|
+
const editorIns = shallowRef(null);
|
|
84
85
|
|
|
85
86
|
/** 是否内联模式 */
|
|
86
87
|
const inlineEditor = props.init?.inline || props.inline;
|
|
@@ -92,8 +93,8 @@
|
|
|
92
93
|
|
|
93
94
|
/** 修改内容 */
|
|
94
95
|
const setContent = (value) => {
|
|
95
|
-
if (editorIns && typeof value === 'string' && value !== editorIns.getContent()) {
|
|
96
|
-
editorIns.setContent(value);
|
|
96
|
+
if (editorIns.value && typeof value === 'string' && value !== editorIns.value.getContent()) {
|
|
97
|
+
editorIns.value.setContent(value);
|
|
97
98
|
}
|
|
98
99
|
};
|
|
99
100
|
|
|
@@ -108,7 +109,7 @@
|
|
|
108
109
|
readonly: props.disabled,
|
|
109
110
|
inline: inlineEditor,
|
|
110
111
|
setup: (editor) => {
|
|
111
|
-
editorIns = editor;
|
|
112
|
+
editorIns.value = editor;
|
|
112
113
|
editor.on('init', (e) => {
|
|
113
114
|
// 回显初始值
|
|
114
115
|
if (props.modelValue) {
|
|
@@ -129,16 +130,16 @@
|
|
|
129
130
|
};
|
|
130
131
|
|
|
131
132
|
/** 销毁编辑器 */
|
|
132
|
-
const
|
|
133
|
-
if (tinymce != null && editorIns != null) {
|
|
134
|
-
tinymce.remove(editorIns);
|
|
135
|
-
editorIns = null;
|
|
133
|
+
const destroy = () => {
|
|
134
|
+
if (tinymce != null && editorIns.value != null) {
|
|
135
|
+
tinymce.remove(editorIns.value);
|
|
136
|
+
editorIns.value = null;
|
|
136
137
|
}
|
|
137
138
|
};
|
|
138
139
|
|
|
139
140
|
/** 弹出提示框 */
|
|
140
141
|
const alert = (option) => {
|
|
141
|
-
openAlert(editorIns, option);
|
|
142
|
+
openAlert(editorIns.value, option);
|
|
142
143
|
};
|
|
143
144
|
|
|
144
145
|
defineExpose({ editorIns, alert });
|
|
@@ -155,11 +156,11 @@
|
|
|
155
156
|
watch(
|
|
156
157
|
() => props.disabled,
|
|
157
158
|
(disable) => {
|
|
158
|
-
if (editorIns !== null) {
|
|
159
|
-
if (typeof editorIns.mode?.set === 'function') {
|
|
160
|
-
editorIns.mode.set(disable ? 'readonly' : 'design');
|
|
159
|
+
if (editorIns.value !== null) {
|
|
160
|
+
if (typeof editorIns.value.mode?.set === 'function') {
|
|
161
|
+
editorIns.value.mode.set(disable ? 'readonly' : 'design');
|
|
161
162
|
} else {
|
|
162
|
-
editorIns.setMode(disable ? 'readonly' : 'design');
|
|
163
|
+
editorIns.value.setMode(disable ? 'readonly' : 'design');
|
|
163
164
|
}
|
|
164
165
|
}
|
|
165
166
|
}
|
|
@@ -168,7 +169,7 @@
|
|
|
168
169
|
watch(
|
|
169
170
|
() => props.tagName,
|
|
170
171
|
() => {
|
|
171
|
-
|
|
172
|
+
destroy();
|
|
172
173
|
nextTick(() => {
|
|
173
174
|
render();
|
|
174
175
|
});
|
|
@@ -177,7 +178,7 @@
|
|
|
177
178
|
|
|
178
179
|
watch(darkMode, () => {
|
|
179
180
|
if (props.autoTheme) {
|
|
180
|
-
|
|
181
|
+
destroy();
|
|
181
182
|
nextTick(() => {
|
|
182
183
|
render();
|
|
183
184
|
});
|
|
@@ -189,7 +190,7 @@
|
|
|
189
190
|
});
|
|
190
191
|
|
|
191
192
|
onBeforeUnmount(() => {
|
|
192
|
-
|
|
193
|
+
destroy();
|
|
193
194
|
});
|
|
194
195
|
|
|
195
196
|
onActivated(() => {
|
|
@@ -197,7 +198,7 @@
|
|
|
197
198
|
});
|
|
198
199
|
|
|
199
200
|
onDeactivated(() => {
|
|
200
|
-
|
|
201
|
+
destroy();
|
|
201
202
|
});
|
|
202
203
|
</script>
|
|
203
204
|
|
|
@@ -1,3 +1,13 @@
|
|
|
1
|
-
# SohelpRichtext
|
|
1
|
+
# SohelpRichtext 富文本编辑器(占位)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
富文本编辑器冗余副本,当前为占位状态。建议使用 `sohelp-rich-text` 组件。
|
|
4
|
+
|
|
5
|
+
## 基础用法
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<sohelp-richtext />
|
|
10
|
+
</template>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
> 该组件当前为占位状态,功能待实现。考虑与 `sohelp-rich-text` 合并。
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div>
|
|
2
|
+
<div class="sohelp-richtext">
|
|
3
|
+
<!-- TODO: 待实现 - 富文本编辑器(注意:sohelp-rich-text 已有实现,此组件可能为冗余副本) -->
|
|
4
|
+
<el-empty description="富文本编辑器(冗余副本) - 待实现" />
|
|
5
|
+
</div>
|
|
3
6
|
</template>
|
|
4
|
-
|
|
5
7
|
<script setup>
|
|
6
|
-
|
|
8
|
+
// TODO: 待实现 - 考虑是否与 sohelp-rich-text 合并
|
|
9
|
+
</script>
|
|
10
|
+
<script>
|
|
11
|
+
export default { name: 'SohelpRichtext' };
|
|
7
12
|
</script>
|
|
8
|
-
<style scoped>
|
|
9
|
-
|
|
10
|
-
</style>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# SohelpRoleModalSelect 角色选择器
|
|
2
|
+
|
|
3
|
+
基于 `sohelp-modal-select` 封装的角色选择组件,预置了角色列表接口和列配置,支持单选/多选角色。
|
|
4
|
+
|
|
5
|
+
## 基础用法
|
|
6
|
+
|
|
7
|
+
```vue
|
|
8
|
+
<template>
|
|
9
|
+
<sohelp-role-modal-select
|
|
10
|
+
v-model="selectedRoles"
|
|
11
|
+
v-model:data="selectedRoleData"
|
|
12
|
+
multiple
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script setup>
|
|
17
|
+
import { ref } from 'vue';
|
|
18
|
+
const selectedRoles = ref([]);
|
|
19
|
+
const selectedRoleData = ref([]);
|
|
20
|
+
</script>
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## 属性 (Props)
|
|
24
|
+
|
|
25
|
+
| 属性名 | 类型 | 默认值 | 必填 | 说明 |
|
|
26
|
+
| --- | --- | --- | --- | --- |
|
|
27
|
+
| modelValue (v-model) | String / Array | `''` | 否 | 选中角色的 ID 值 |
|
|
28
|
+
| data (v-model:data) | Array / Object | `[]` | 否 | 选中角色的完整数据 |
|
|
29
|
+
| valueField | String | `'id'` | 否 | 值字段名 |
|
|
30
|
+
| labelField | String | `'role_name'` | 否 | 显示字段名 |
|
|
31
|
+
| multiple | Boolean | `true` | 否 | 是否多选 |
|
|
32
|
+
| selectionTemplate | String | `'${role_name}-${role_no}'` | 否 | 已选列表的显示模板 |
|
|
33
|
+
| modalProps | Object | `{}` | 否 | 传递给弹窗的属性配置 |
|
|
34
|
+
| gridProps | Object | `{}` | 否 | 传递给表格的属性配置,可覆盖默认列和接口 |
|
|
35
|
+
|
|
36
|
+
> 默认请求接口:`/admin/system/role/page`,默认列:角色名称 (`role_name`)、角色标识 (`role_no`)。
|
|
37
|
+
|
|
38
|
+
## 事件 (Events)
|
|
39
|
+
|
|
40
|
+
| 事件名 | 回调参数 | 说明 |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| update:modelValue | `(selectedIds)` | 选中值变化时触发 |
|
|
43
|
+
| confirm | `(selectedIds, data)` | 确认选择后触发 |
|
|
44
|
+
| change | - | 值变化时触发 |
|
|
45
|
+
| cancel | - | 取消时触发 |
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<sohelp-modal-select
|
|
3
|
+
v-bind="$attrs"
|
|
4
|
+
v-model="modelValue"
|
|
5
|
+
v-model:data="data"
|
|
6
|
+
:labelField="labelField"
|
|
7
|
+
:valueField="valueField"
|
|
8
|
+
:multiple="multiple"
|
|
9
|
+
:gridProps="mergedGridProps"
|
|
10
|
+
:selectionTemplate="selectionTemplate"
|
|
11
|
+
:modalProps="mergedModalProps"
|
|
12
|
+
@confirm="handleConfirm"
|
|
13
|
+
></sohelp-modal-select>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<script>
|
|
17
|
+
export default {
|
|
18
|
+
name: 'SohelpRoleModalSelect'
|
|
19
|
+
};
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<script setup>
|
|
23
|
+
import { computed } from 'vue';
|
|
24
|
+
import SohelpModalSelect from '../sohelp-modal-select/index.vue';
|
|
25
|
+
|
|
26
|
+
const defaultGridProps = {
|
|
27
|
+
url: '/admin/system/role/page',
|
|
28
|
+
autoLoad: true,
|
|
29
|
+
gridOptions: {
|
|
30
|
+
pagerConfig: {
|
|
31
|
+
enabled: false
|
|
32
|
+
},
|
|
33
|
+
columns: [
|
|
34
|
+
{ field: 'role_name', title: '岗位名称', minWidth: 120 },
|
|
35
|
+
{ field: 'role_no', title: '岗位标识', minWidth: 120 }
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const mergedGridProps = computed(() => {
|
|
41
|
+
const userGridOptions = props.gridProps?.gridOptions || {};
|
|
42
|
+
return {
|
|
43
|
+
url: props.gridProps?.url ?? defaultGridProps.url,
|
|
44
|
+
autoLoad: props.gridProps?.autoLoad ?? defaultGridProps.autoLoad,
|
|
45
|
+
gridOptions: {
|
|
46
|
+
...defaultGridProps.gridOptions,
|
|
47
|
+
...userGridOptions,
|
|
48
|
+
columns: userGridOptions.columns ?? defaultGridProps.gridOptions.columns
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const mergedModalProps = computed(() => {
|
|
54
|
+
const defaultWidth = props.multiple ? '900px' : '600px';
|
|
55
|
+
return {
|
|
56
|
+
title: '选择角色',
|
|
57
|
+
...props.modalProps,
|
|
58
|
+
width: props.modalProps?.width ?? defaultWidth
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
const props = defineProps({
|
|
63
|
+
valueField: {
|
|
64
|
+
type: String,
|
|
65
|
+
default: 'id'
|
|
66
|
+
},
|
|
67
|
+
labelField: {
|
|
68
|
+
type: String,
|
|
69
|
+
default: 'role_name'
|
|
70
|
+
},
|
|
71
|
+
multiple: {
|
|
72
|
+
type: Boolean,
|
|
73
|
+
default: true
|
|
74
|
+
},
|
|
75
|
+
selectionTemplate: {
|
|
76
|
+
type: String,
|
|
77
|
+
default: '${role_name}-${role_no}'
|
|
78
|
+
},
|
|
79
|
+
modalProps: {
|
|
80
|
+
type: Object,
|
|
81
|
+
default: () => ({})
|
|
82
|
+
},
|
|
83
|
+
gridProps: {
|
|
84
|
+
type: Object,
|
|
85
|
+
default: () => ({})
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
const emits = defineEmits([
|
|
90
|
+
'change',
|
|
91
|
+
'confirm',
|
|
92
|
+
'cancel',
|
|
93
|
+
'update:modelValue'
|
|
94
|
+
]);
|
|
95
|
+
|
|
96
|
+
const modelValue = defineModel('modelValue', {
|
|
97
|
+
type: [String, Array],
|
|
98
|
+
default: ''
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
const data = defineModel('data', {
|
|
102
|
+
type: [Array, Object],
|
|
103
|
+
default: () => []
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
const handleConfirm = (selections, _data) => {
|
|
107
|
+
emits('update:modelValue', selections);
|
|
108
|
+
data.value = _data;
|
|
109
|
+
emits('confirm', selections, _data);
|
|
110
|
+
};
|
|
111
|
+
</script>
|