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.
Files changed (205) hide show
  1. package/components.js +1 -0
  2. package/icons/flag/README.md +2 -2
  3. package/icons/flag/index.js +0 -1
  4. package/package.json +1 -1
  5. package/sohelp-ace-editor/README.md +32 -42
  6. package/sohelp-ace-editor/index.vue +166 -156
  7. package/sohelp-api-doc/README.md +36 -0
  8. package/sohelp-api-doc/index.vue +160 -0
  9. package/sohelp-application-select/README.md +9 -7
  10. package/sohelp-application-select/index.vue +10 -13
  11. package/sohelp-autocode/README.md +14 -26
  12. package/sohelp-calendar-view/README.md +9 -7
  13. package/sohelp-calendar-view/index.vue +10 -9
  14. package/sohelp-card/README.md +15 -17
  15. package/sohelp-card/index.vue +1 -1
  16. package/sohelp-card-view/README.md +9 -7
  17. package/sohelp-card-view/index.vue +10 -9
  18. package/sohelp-condition/README.md +29 -49
  19. package/sohelp-condition/index.vue +2 -1
  20. package/sohelp-country-select/README.md +15 -123
  21. package/sohelp-country-select/index.vue +1 -1
  22. package/sohelp-cry-input/README.md +19 -195
  23. package/sohelp-cry-input/index.vue +6 -2
  24. package/sohelp-date/README.md +12 -15
  25. package/sohelp-datetime/README.md +15 -17
  26. package/sohelp-datetime-picker/README.md +18 -18
  27. package/sohelp-datetime-picker/index.vue +11 -4
  28. package/sohelp-datetime-range/README.md +20 -23
  29. package/sohelp-demo-block/README.md +43 -0
  30. package/sohelp-demo-block/index.vue +229 -0
  31. package/sohelp-dict/README.md +28 -23
  32. package/sohelp-dict/index.vue +17 -17
  33. package/sohelp-drawer/README.md +28 -26
  34. package/sohelp-drop-card/README.md +29 -28
  35. package/sohelp-drop-card/index.vue +0 -1
  36. package/sohelp-dyn-select/README.md +31 -16
  37. package/sohelp-dyn-select/index.vue +65 -67
  38. package/sohelp-dyn-tree/README.md +26 -20
  39. package/sohelp-dyn-tree/index.vue +2 -2
  40. package/sohelp-dyn-tree-select/README.md +28 -19
  41. package/sohelp-dyn-tree-select/index.vue +23 -7
  42. package/sohelp-entity-form/README.md +65 -30
  43. package/sohelp-entity-form/index.vue +3 -2
  44. package/sohelp-entity-grid/README.md +13 -11
  45. package/sohelp-entity-grid/index.vue +1 -1
  46. package/sohelp-file-upload/README.md +25 -27
  47. package/sohelp-file-upload/index.vue +1 -1
  48. package/sohelp-filter-scheme/README.md +34 -30
  49. package/sohelp-filter-scheme/index.vue +2 -2
  50. package/sohelp-grid/README.md +52 -33
  51. package/sohelp-grid/index.vue +41 -39
  52. package/sohelp-grid/js/SohelpGridConfig.js +3 -3
  53. package/sohelp-grid/js/useSohelpGridConfig.js +4 -6
  54. package/sohelp-grid-select/README.md +32 -27
  55. package/sohelp-grid-select/index.vue +6 -5
  56. package/sohelp-grid-view/README.md +51 -22
  57. package/sohelp-grid-view-select/README.md +33 -25
  58. package/sohelp-grid-view-select/index.vue +2 -1
  59. package/sohelp-group-view/README.md +14 -4
  60. package/sohelp-group-view/index.vue +10 -9
  61. package/sohelp-icon-select/README.md +14 -12
  62. package/sohelp-image-upload/README.md +27 -27
  63. package/sohelp-image-upload/index.vue +2 -2
  64. package/sohelp-import/README.md +25 -24
  65. package/sohelp-input/README.md +27 -11
  66. package/sohelp-input/index.vue +15 -2
  67. package/sohelp-input-tag/README.md +53 -0
  68. package/sohelp-input-tag/index.vue +337 -0
  69. package/sohelp-modal/README.md +42 -16
  70. package/sohelp-modal/index.vue +21 -4
  71. package/sohelp-modal-select/README.md +745 -0
  72. package/sohelp-modal-select/index.vue +705 -0
  73. package/sohelp-module/README.md +24 -13
  74. package/sohelp-number-input/README.md +15 -8
  75. package/sohelp-number-input/index.vue +3 -0
  76. package/sohelp-number-range/README.md +22 -12
  77. package/sohelp-number-range/index.vue +3 -11
  78. package/sohelp-org-modal-select/README.md +47 -0
  79. package/sohelp-org-modal-select/index.vue +411 -0
  80. package/sohelp-org-select/README.md +23 -10
  81. package/sohelp-org-select/index.vue +41 -24
  82. package/sohelp-org-tree/README.md +19 -7
  83. package/sohelp-org-tree/index.vue +1 -2
  84. package/sohelp-org-tree-select/README.md +22 -11
  85. package/sohelp-org-tree-select/index.vue +1 -2
  86. package/sohelp-org-user-tree/README.md +19 -7
  87. package/sohelp-org-user-tree/index.vue +1 -2
  88. package/sohelp-org-user-tree-select/README.md +8 -3
  89. package/sohelp-org-user-tree-select/index.vue +8 -7
  90. package/sohelp-page/README.md +20 -11
  91. package/sohelp-page/index.vue +1 -1
  92. package/sohelp-pagination/README.md +14 -6
  93. package/sohelp-pagination/index.vue +1 -1
  94. package/sohelp-power/README.md +34 -19
  95. package/sohelp-power/index.vue +2 -2
  96. package/sohelp-pro-form/README.md +64 -21
  97. package/sohelp-pro-layout/README.md +10 -4
  98. package/sohelp-pro-layout/index.vue +8 -7
  99. package/sohelp-pro-table/README.md +30 -6
  100. package/sohelp-process/README.md +26 -13
  101. package/sohelp-process/index.vue +6 -6
  102. package/sohelp-rate/README.md +24 -12
  103. package/sohelp-rate/index.vue +5 -1
  104. package/sohelp-relation/README.md +10 -4
  105. package/sohelp-relation/index.vue +8 -7
  106. package/sohelp-relation-modal-select/README.md +41 -0
  107. package/sohelp-relation-modal-select/index.vue +70 -0
  108. package/sohelp-rich-text/README.md +29 -11
  109. package/sohelp-rich-text/index.vue +21 -20
  110. package/sohelp-richtext/README.md +12 -2
  111. package/sohelp-richtext/index.vue +8 -6
  112. package/sohelp-role-modal-select/README.md +45 -0
  113. package/sohelp-role-modal-select/index.vue +111 -0
  114. package/sohelp-role-select/README.md +18 -10
  115. package/sohelp-role-select/index.vue +36 -27
  116. package/sohelp-search/README.md +12 -4
  117. package/sohelp-search/index.vue +2 -2
  118. package/sohelp-search-pro-form/README.md +15 -1
  119. package/sohelp-search-pro-form/index.vue +2 -1
  120. package/sohelp-select/README.md +31 -30
  121. package/sohelp-select/index.vue +79 -84
  122. package/sohelp-split-panel/README.md +17 -18
  123. package/sohelp-switch/README.md +21 -19
  124. package/sohelp-switch/index.vue +34 -33
  125. package/sohelp-table/README.md +35 -27
  126. package/sohelp-table/index.vue +110 -109
  127. package/sohelp-table-select/README.md +55 -0
  128. package/sohelp-tenant-select/README.md +19 -18
  129. package/sohelp-tenant-select/index.vue +105 -109
  130. package/sohelp-text/README.md +16 -10
  131. package/sohelp-text/index.vue +5 -5
  132. package/sohelp-textarea-input/README.md +19 -12
  133. package/sohelp-time/README.md +11 -10
  134. package/sohelp-tree/README.md +24 -19
  135. package/sohelp-tree/index.vue +21 -23
  136. package/sohelp-tree-select/README.md +23 -10
  137. package/sohelp-user-modal-select/README.md +739 -0
  138. package/sohelp-user-modal-select/index.vue +87 -0
  139. package/sohelp-user-select/README.md +26 -15
  140. package/sohelp-user-select/index.vue +6 -2
  141. package/sohelp-user-tag/README.md +5 -7
  142. package/sohelp-user-tag/index.vue +8 -8
  143. package/sohelp-user-tree/README.md +5 -8
  144. package/sohelp-user-tree/index.vue +8 -7
  145. package/sohelp-vform-drawer/README.md +36 -18
  146. package/sohelp-vform-drawer/index.vue +2 -2
  147. package/sohelp-vform-eleplus/README.md +33 -31
  148. package/sohelp-vform-eleplus/index.vue +2 -2
  149. package/sohelp-vform-eleplus/tinymce/langs/zh_CN.js +461 -461
  150. package/sohelp-vform-eleplus/tinymce/langs/zh_TW.js +418 -418
  151. package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.css +72 -72
  152. package/sohelp-vform-eleplus/tinymce/skins/content/dark/content.min.css +7 -7
  153. package/sohelp-vform-eleplus/tinymce/skins/content/default/content.css +67 -67
  154. package/sohelp-vform-eleplus/tinymce/skins/content/default/content.min.css +7 -7
  155. package/sohelp-vform-eleplus/tinymce/skins/content/document/content.css +72 -72
  156. package/sohelp-vform-eleplus/tinymce/skins/content/document/content.min.css +7 -7
  157. package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.css +68 -68
  158. package/sohelp-vform-eleplus/tinymce/skins/content/writer/content.min.css +7 -7
  159. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.css +732 -732
  160. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.css +726 -726
  161. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.inline.min.css +7 -7
  162. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.min.css +7 -7
  163. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.css +29 -29
  164. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/content.mobile.min.css +7 -7
  165. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.css +3047 -3047
  166. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.min.css +7 -7
  167. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.css +673 -673
  168. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.mobile.min.css +7 -7
  169. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.css +37 -37
  170. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide/skin.shadowdom.min.css +7 -7
  171. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.css +714 -714
  172. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.css +726 -726
  173. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.inline.min.css +7 -7
  174. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.min.css +7 -7
  175. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.css +29 -29
  176. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/content.mobile.min.css +7 -7
  177. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.css +3047 -3047
  178. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.min.css +7 -7
  179. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.css +673 -673
  180. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.mobile.min.css +7 -7
  181. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.css +37 -37
  182. package/sohelp-vform-eleplus/tinymce/skins/ui/oxide-dark/skin.shadowdom.min.css +7 -7
  183. package/sohelp-vform-modal/README.md +36 -18
  184. package/sohelp-vform-modal/index.vue +2 -2
  185. package/sohelp-vform-select/README.md +9 -7
  186. package/sohelp-vform-select/index.vue +8 -7
  187. package/sohelp-vxe-grid/DefaultGridOptions.js +5 -3
  188. package/sohelp-vxe-grid/DefaultProps.js +0 -1
  189. package/sohelp-vxe-grid/README.md +540 -35
  190. package/sohelp-vxe-grid/SohelpGridConfig.js +8 -6
  191. package/sohelp-vxe-grid/index.vue +141 -94
  192. package/sohelp-vxe-grid-select/README.md +41 -26
  193. package/sohelp-vxe-table/README.md +23 -20
  194. package/sohelp-vxe-table/index.vue +5 -4
  195. package/sohelp-workflow/README.md +21 -17
  196. package/sohelp-workflow/index.vue +25 -22
  197. package/sohelp-workflow-drawer/README.md +41 -28
  198. package/sohelp-workflow-drawer/components/table.vue +7 -1
  199. package/sohelp-workflow-drawer/index.vue +86 -71
  200. package/sohelp-workflow-drawer/js/index.js +15 -13
  201. package/style/index.scss +0 -0
  202. package/utils/safe-eval.js +89 -0
  203. package/sohelp-dyn-select/props.js +0 -67
  204. package/sohelp-user-select/index.vue~ +0 -53
  205. package/sohelp-user-select/props.js +0 -71
@@ -1,24 +1,37 @@
1
- # SohelpProcess 进度条组件
1
+ # SohelpProcess 进度条
2
2
 
3
- 可拖拽的进度条组件,支持只读模式和动画效果。
3
+ 自定义进度条组件,支持拖拽交互修改进度值、动画效果和自定义颜色。
4
4
 
5
5
  ## 基础用法
6
6
 
7
- ```html
8
- <sohelp-process v-model="percent" :color="'#35b558'" />
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
- | modelValue | Number | 0 | 进度值 (0-100) |
15
- | readonly | Boolean | false | 是否只读(不可拖拽) |
16
- | height | Number | 8 | 进度条高度 |
17
- | color | String | '#35b558' | 进度条颜色 |
18
- | animate | Boolean | false | 是否启用动画 |
19
- | showPercent | Boolean | false | 是否显示百分比文字 |
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
- | update:modelValue | 拖拽改变进度时触发 | (value: Number) |
35
+ | 事件名 | 回调参数 | 说明 |
36
+ | --- | --- | --- |
37
+ | update:modelValue | `value: Number` | 进度值变化时触发 |
@@ -1,8 +1,8 @@
1
1
  <template>
2
2
  <div class="sohelp-progress-c">
3
- <view class="sohelp-progress-wrap">
4
- <view class="sohelp-progress-box" ref="progressBox" @mousedown="onDragStart" @touchstart="onDragStart">
5
- <view class="sohelp-progress" :style="style"></view>
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
- </view>
15
- <view class="percent">{{ Number(value) || 0 }}%</view>
16
- </view>
14
+ </div>
15
+ <div class="percent">{{ Number(value) || 0 }}%</div>
16
+ </div>
17
17
  </div>
18
18
  </template>
19
19
 
@@ -1,23 +1,35 @@
1
- # SohelpRate 评分组件
1
+ # SohelpRate 评分
2
2
 
3
- 支持两种模式:星星评分和下拉选择评分。
3
+ 基于 `el-rate` 封装的评分组件,支持星星评分和下拉选择两种模式,默认显示文字提示。
4
4
 
5
5
  ## 基础用法
6
6
 
7
- ```html
8
- <!-- 星星模式 -->
9
- <sohelp-rate v-model="score" />
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
- | modelValue | Number/String | - | 评分值 |
19
- | type | String | 'rate' | 显示模式:'rate' (星星) 'select' (下拉) |
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
- 支持 `el-rate` `sohelp-select` 的相关属性。
33
+ | 事件名 | 回调参数 | 说明 |
34
+ | :--- | :--- | :--- |
35
+ | update:modelValue | `(value: Number / String)` | 评分值变化时触发 |
@@ -25,7 +25,7 @@
25
25
  },
26
26
  modelValue: [Number, String, Array]
27
27
  },
28
- emit: ['update:modelValue'],
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,7 +1,13 @@
1
- # SohelpRelation 外键关联组件
1
+ # SohelpRelation 外键关联输入框
2
2
 
3
- *当前版本仅为占位组件。*
3
+ 外键关联输入框组件(待实现)。
4
4
 
5
- ## 描述
5
+ ## 基础用法
6
6
 
7
- 预留用于处理外键关联数据的输入组件。
7
+ ```vue
8
+ <template>
9
+ <sohelp-relation />
10
+ </template>
11
+ ```
12
+
13
+ > 该组件当前为占位状态,功能待实现。
@@ -1,11 +1,12 @@
1
1
  <template>
2
- <div>输入框,外键关键</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
- ```html
8
- <sohelp-rich-text v-model="content" />
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
- | modelValue | String | - | 绑定的 HTML 内容 |
15
- | disabled | Boolean | false | 是否禁用(只读) |
16
- | inline | Boolean | false | 是否开启内联模式 |
17
- | init | Object | - | TinyMCE 初始化配置对象 |
18
- | autoTheme | Boolean | true | 是否跟随系统主题自动切换 |
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`: 获取 TinyMCE 编辑器实例。
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
- import 'tinymce/plugins/paste';
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
- let editorIns = null;
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 destory = () => {
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
- destory();
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
- destory();
181
+ destroy();
181
182
  nextTick(() => {
182
183
  render();
183
184
  });
@@ -189,7 +190,7 @@
189
190
  });
190
191
 
191
192
  onBeforeUnmount(() => {
192
- destory();
193
+ destroy();
193
194
  });
194
195
 
195
196
  onActivated(() => {
@@ -197,7 +198,7 @@
197
198
  });
198
199
 
199
200
  onDeactivated(() => {
200
- destory();
201
+ destroy();
201
202
  });
202
203
  </script>
203
204
 
@@ -1,3 +1,13 @@
1
- # SohelpRichtext 富文本组件 (Legacy)
1
+ # SohelpRichtext 富文本编辑器(占位)
2
2
 
3
- *当前版本仅为占位组件,请使用 `sohelp-rich-text`。*
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>Richtext</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>