npmapps 1.0.21 → 1.0.23

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 (105) hide show
  1. package/app/Wscats.vue-1.0.26.vsix +0 -0
  2. package/app/febean.vue-format-0.1.8.vsix +0 -0
  3. package/app/wujie-vue3-child/.claude/settings.local.json +8 -0
  4. package/app/wujie-vue3-child/.vscode/extensions.json +3 -0
  5. package/app/wujie-vue3-child/PROJECT_MEMORY.md +427 -0
  6. package/app/wujie-vue3-child/README.md +5 -0
  7. package/app/wujie-vue3-child/index.html +13 -0
  8. package/app/wujie-vue3-child/package-lock.json +5744 -0
  9. package/app/wujie-vue3-child/package.json +28 -0
  10. package/app/wujie-vue3-child/public/vite.svg +1 -0
  11. package/app/wujie-vue3-child/src/App.vue +130 -0
  12. package/app/wujie-vue3-child/src/assets/vue.svg +1 -0
  13. package/app/wujie-vue3-child/src/components/HelloWorld.vue +43 -0
  14. package/app/wujie-vue3-child/src/components/tags-view.vue +193 -0
  15. package/app/wujie-vue3-child/src/components/tags-view1.vue +131 -0
  16. package/app/wujie-vue3-child/src/hooks/useClickOutside.js +11 -0
  17. package/app/wujie-vue3-child/src/hooks/useTableDragSort.js +28 -0
  18. package/app/wujie-vue3-child/src/main.js +15 -0
  19. package/app/wujie-vue3-child/src/router/index.js +104 -0
  20. package/app/wujie-vue3-child/src/store/tagsViewStroe.js +34 -0
  21. package/app/wujie-vue3-child/src/style.css +4 -0
  22. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/README.md +836 -0
  23. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/REFLEX_EXAMPLES.md +728 -0
  24. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.jsx +687 -0
  25. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentPersonnelSelector.module.scss +560 -0
  26. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.jsx +570 -0
  27. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelector.module.scss +330 -0
  28. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.jsx +378 -0
  29. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/DepartmentSelectorV2.module.scss +228 -0
  30. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.jsx +399 -0
  31. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/OptionsSelector.module.scss +252 -0
  32. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.jsx +585 -0
  33. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PersonnelSelector.module.scss +331 -0
  34. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.jsx +392 -0
  35. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/PopoverSelector.module.scss +39 -0
  36. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/README.md +248 -0
  37. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/components/SelectorTrigger.jsx +194 -0
  38. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/index.jsx +1459 -0
  39. package/app/wujie-vue3-child/src/views/aiCoach/departmentPersonnel/mockData.js +301 -0
  40. package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/dialogueSegment/index.jsx +28 -4
  41. package/app/wujie-vue3-child/src/views/aiCoach/index.jsx +32 -0
  42. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.jsx +121 -0
  43. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ChartsPanel/index.module.scss +76 -0
  44. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/DonutChart/index.jsx +104 -0
  45. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.jsx +75 -0
  46. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/PracticeTable/index.module.scss +12 -0
  47. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.jsx +62 -0
  48. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankBarChart/index.module.scss +43 -0
  49. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.jsx +29 -0
  50. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingGroup/index.module.scss +5 -0
  51. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.jsx +58 -0
  52. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/RankingList/index.module.scss +85 -0
  53. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.jsx +92 -0
  54. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/ScriptStatsPanel/index.module.scss +56 -0
  55. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.jsx +40 -0
  56. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/StatCardsRow/index.module.scss +53 -0
  57. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsDonut.jsx +106 -0
  58. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/components/echarts/EchartsRankBar.jsx +132 -0
  59. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.jsx +176 -0
  60. package/app/wujie-vue3-child/src/views/aiCoach/practiceStatus/index.module.scss +96 -0
  61. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.jsx +162 -0
  62. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/CoachReport/index.module.scss +16 -0
  63. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.jsx +29 -0
  64. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ComprehensiveEvaluation/index.module.scss +25 -0
  65. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.jsx +106 -0
  66. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueBubble/index.module.scss +164 -0
  67. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.jsx +182 -0
  68. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DialogueRecord/index.module.scss +203 -0
  69. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.jsx +145 -0
  70. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionDetail/index.module.scss +126 -0
  71. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.jsx +67 -0
  72. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/DimensionScores/index.module.scss +105 -0
  73. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.jsx +81 -0
  74. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ReportHeader/index.module.scss +47 -0
  75. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.jsx +64 -0
  76. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/RoleInfo/index.module.scss +85 -0
  77. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.jsx +39 -0
  78. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/ScoreBadge/index.module.scss +44 -0
  79. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.jsx +83 -0
  80. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/components/SubDimensionItem/index.module.scss +101 -0
  81. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.jsx +50 -0
  82. package/app/wujie-vue3-child/src/views/aiCoach/reportDetail/index.module.scss +25 -0
  83. package/app/wujie-vue3-child/src/views/child-to-parent.vue +117 -0
  84. package/app/wujie-vue3-child/src/views/home.vue +53 -0
  85. package/app/wujie-vue3-child/src/views/jsx/btnSelect/btnSelect.vue +169 -0
  86. package/app/wujie-vue3-child/src/views/jsx/btnSelect/index.vue +69 -0
  87. package/app/wujie-vue3-child/src/views/jsx/com.vue +44 -0
  88. package/app/wujie-vue3-child/src/views/jsx/dialog.jsx +66 -0
  89. package/app/wujie-vue3-child/src/views/jsx/index.vue +72 -0
  90. package/app/wujie-vue3-child/src/views/jsx/props.vue +33 -0
  91. package/app/wujie-vue3-child/src/views/parent-to-child.vue +225 -0
  92. package/app/wujie-vue3-child/src/views/phone-code.vue +318 -0
  93. package/app/wujie-vue3-child/src/views/router-jump.vue +123 -0
  94. package/app/wujie-vue3-child/src/views/test.vue +192 -0
  95. package/app/wujie-vue3-child/vite.config.js +15 -0
  96. package/package.json +1 -1
  97. package/app/aiCoach/index.jsx +0 -20
  98. package/npmapps-1.0.20.tgz +0 -0
  99. /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/collapseExpand/index.jsx +0 -0
  100. /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/collapseExpand/index.module.scss +0 -0
  101. /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/dialogueSegment/index.module.scss +0 -0
  102. /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/scriptTable/index.jsx +0 -0
  103. /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/scriptTable/index.module.scss +0 -0
  104. /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/scriptTable/inputColumn/index.jsx +0 -0
  105. /package/app/{aiCoach → wujie-vue3-child/src/views/aiCoach}/scriptTable/inputColumn/index.module.scss +0 -0
@@ -0,0 +1,39 @@
1
+ // 通用悬浮窗选择器样式
2
+ .popoverSelector {
3
+ position: relative;
4
+ display: inline-block;
5
+ }
6
+
7
+ // 触发器容器
8
+ .trigger {
9
+ display: inline-block;
10
+ }
11
+
12
+ // 悬浮窗容器
13
+ .dropdown {
14
+ position: fixed;
15
+ background: #fff;
16
+ border: 1px solid #e4e7ed;
17
+ border-radius: 4px;
18
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
19
+ z-index: 2000;
20
+ overflow: hidden;
21
+ }
22
+
23
+ // 带动画的悬浮窗
24
+ .dropdown.animated {
25
+ animation: dropdownSlideIn 0.2s ease-out;
26
+ transform-origin: top;
27
+ }
28
+
29
+ // 下拉框淡入动画
30
+ @keyframes dropdownSlideIn {
31
+ from {
32
+ opacity: 0;
33
+ transform: scaleY(0.8);
34
+ }
35
+ to {
36
+ opacity: 1;
37
+ transform: scaleY(1);
38
+ }
39
+ }
@@ -0,0 +1,248 @@
1
+ # 部门选择器组件
2
+
3
+ 本目录包含一个核心组件:`DepartmentSelector`(部门选择器)。
4
+
5
+ ## 组件说明
6
+
7
+ ### DepartmentSelector(部门选择器)
8
+
9
+ 下拉树形结构的部门选择器,支持单选或多选,聚焦时悬浮显示。
10
+
11
+ **功能特性:**
12
+ - 使用 Element Plus 的 el-tree 组件
13
+ - 输入框聚焦时才显示树形结构
14
+ - 智能悬浮定位(根据可用空间自动显示在输入框上方或下方)
15
+ - 支持单选和多选模式
16
+ - 单选时显示文本,右侧带下拉箭头图标
17
+ - 多选时以 Tag 组件形式展示选中值,每个 Tag 可单独删除
18
+ - 支持 `collapse-tags` 属性折叠标签(显示第一个 + 剩余数量)
19
+ - 支持 `collapse-tags-tooltip` 属性,鼠标悬停显示所有选中值
20
+ - 支持 `max-collapse-tags` 属性限制显示的标签数量
21
+ - 支持清空按钮(通过 `clearable` 属性控制,默认关闭)
22
+ - 支持搜索过滤
23
+ - 异步加载数据(模拟接口)
24
+ - 响应式定位(窗口大小改变或滚动时自动调整)
25
+
26
+ **Props:**
27
+ - `modelValue: number|string|Array` - 选中的部门ID(单选时为 number/string,多选时为 Array)
28
+ - `multiple: boolean` - 是否多选,默认 `false`
29
+ - `placeholder: string` - 输入框占位文本,默认 `"请选择部门"`
30
+ - `disabled: boolean` - 是否禁用,默认 `false`
31
+ - `clearable: boolean` - 是否可清空,默认 `false`
32
+ - `collapseTags: boolean` - 多选时是否将选中值折叠显示(显示第一个+剩余数量),默认 `false`
33
+ - `collapseTagsTooltip: boolean` - 当鼠标悬停于折叠标签时是否显示所有选中的标签,需要配合 `collapseTags` 使用,默认 `false`
34
+ - `maxCollapseTags: number` - 多选时最多显示的标签数量,超出部分折叠显示,为 0 则不限制,默认 `0`
35
+
36
+ **Events:**
37
+ - `update:modelValue` - 选择变化时触发
38
+ - `change` - 选择变化时触发,参数为选中的部门ID(单选)或ID数组(多选)
39
+
40
+ **使用示例:**
41
+
42
+ ```jsx
43
+ import DepartmentSelector from './components/DepartmentSelector'
44
+
45
+ // 单选模式
46
+ const selectedDept = ref(null)
47
+ <DepartmentSelector
48
+ v-model={selectedDept.value}
49
+ placeholder="请选择部门"
50
+ clearable={true}
51
+ onChange={(id) => console.log('选中部门ID:', id)}
52
+ />
53
+
54
+ // 多选模式 - 默认(显示所有标签)
55
+ const selectedDepts = ref([])
56
+ <DepartmentSelector
57
+ v-model={selectedDepts.value}
58
+ multiple={true}
59
+ placeholder="请选择部门(可多选)"
60
+ clearable={true}
61
+ onChange={(ids) => console.log('选中部门ID列表:', ids)}
62
+ />
63
+
64
+ // 多选模式 - collapse-tags(折叠标签)
65
+ <DepartmentSelector
66
+ v-model={selectedDepts.value}
67
+ multiple={true}
68
+ collapseTags={true}
69
+ clearable={true}
70
+ />
71
+
72
+ // 多选模式 - collapse-tags-tooltip(悬停显示详情)
73
+ <DepartmentSelector
74
+ v-model={selectedDepts.value}
75
+ multiple={true}
76
+ collapseTags={true}
77
+ collapseTagsTooltip={true}
78
+ clearable={true}
79
+ />
80
+
81
+ // 多选模式 - max-collapse-tags(限制显示标签数量)
82
+ <DepartmentSelector
83
+ v-model={selectedDepts.value}
84
+ multiple={true}
85
+ maxCollapseTags={2}
86
+ clearable={true}
87
+ />
88
+
89
+ // 禁用状态
90
+ <DepartmentSelector
91
+ v-model={selectedDept.value}
92
+ disabled={true}
93
+ />
94
+ ```
95
+
96
+ ---
97
+
98
+ ## 多选标签展示模式
99
+
100
+ 组件支持多种标签展示模式:
101
+
102
+ ### 1. 默认模式
103
+ 显示所有选中的标签,每个标签都可以单独删除。
104
+
105
+ ```jsx
106
+ <DepartmentSelector
107
+ v-model={selectedDepts.value}
108
+ multiple={true}
109
+ />
110
+ ```
111
+
112
+ ### 2. collapse-tags 模式
113
+ 只显示第一个标签 + 剩余数量(如:`部门A × +3`)
114
+
115
+ ```jsx
116
+ <DepartmentSelector
117
+ v-model={selectedDepts.value}
118
+ multiple={true}
119
+ collapseTags={true}
120
+ />
121
+ ```
122
+
123
+ ### 3. collapse-tags-tooltip 模式
124
+ 在 collapse-tags 基础上,鼠标悬停在剩余数量上时显示所有选中值的提示
125
+
126
+ ```jsx
127
+ <DepartmentSelector
128
+ v-model={selectedDepts.value}
129
+ multiple={true}
130
+ collapseTags={true}
131
+ collapseTagsTooltip={true}
132
+ />
133
+ ```
134
+
135
+ ### 4. max-collapse-tags 模式
136
+ 限制显示的标签数量,超出部分显示为 `+N`(如:`部门A × 部门B × +3`)
137
+
138
+ ```jsx
139
+ <DepartmentSelector
140
+ v-model={selectedDepts.value}
141
+ multiple={true}
142
+ maxCollapseTags={2}
143
+ />
144
+ ```
145
+
146
+ ---
147
+
148
+ ## 数据格式说明
149
+
150
+ ### 部门数据格式
151
+ ```javascript
152
+ {
153
+ id: number | string, // 部门ID
154
+ label: string, // 部门名称
155
+ children?: Array // 子部门列表(可选)
156
+ }
157
+ ```
158
+
159
+ ### 模拟数据和接口
160
+
161
+ 部门数据存储在 `mockData.js` 文件中,提供以下方法:
162
+
163
+ **1. fetchDepartments(delay)**
164
+ - 模拟异步获取部门树数据
165
+ - 参数:`delay` - 延迟时间(毫秒),默认 500ms
166
+ - 返回:Promise<Array>
167
+
168
+ ```javascript
169
+ import { fetchDepartments } from './mockData.js'
170
+
171
+ const departments = await fetchDepartments(300)
172
+ ```
173
+
174
+ **2. searchDepartments(keyword, departments)**
175
+ - 根据关键词搜索部门
176
+ - 参数:
177
+ - `keyword` - 搜索关键词
178
+ - `departments` - 部门树数据(可选,默认使用 mockDepartments)
179
+ - 返回:过滤后的部门树数组
180
+
181
+ ```javascript
182
+ import { searchDepartments } from './mockData.js'
183
+
184
+ const filteredDepts = searchDepartments('人力资源', departments)
185
+ ```
186
+
187
+ ---
188
+
189
+ ## 悬浮定位逻辑
190
+
191
+ 组件实现了智能的悬浮定位:
192
+
193
+ 1. **空间检测**:计算输入框下方和上方的可用空间
194
+ 2. **自动定位**:
195
+ - 如果下方空间足够(≥400px),显示在输入框下方
196
+ - 如果下方空间不足且上方空间更大,显示在输入框上方
197
+ 3. **动态调整**:
198
+ - 监听窗口大小改变(resize)
199
+ - 监听页面滚动(scroll)
200
+ - 自动重新计算位置
201
+
202
+ ---
203
+
204
+ ## 文件结构
205
+
206
+ ```
207
+ departmentPersonnel/
208
+ ├── components/
209
+ │ ├── DepartmentSelector.jsx # 部门选择器组件
210
+ │ ├── DepartmentSelector.module.scss # 部门选择器样式
211
+ │ └── README.md # 组件说明文档
212
+ ├── mockData.js # 模拟数据和接口
213
+ └── index.jsx # 演示页面
214
+ ```
215
+
216
+ ---
217
+
218
+ ## 技术实现
219
+
220
+ 1. **使用的技术**:
221
+ - Vue 3 Composition API
222
+ - JSX 语法
223
+ - Element Plus(el-tree, el-input)
224
+ - CSS Modules
225
+
226
+ 2. **核心功能实现**:
227
+ - 使用 `getBoundingClientRect()` 获取元素位置
228
+ - 使用 `position: fixed` 实现悬浮定位
229
+ - 使用 `el-tree` 的 `filter-node-method` 实现搜索
230
+ - 使用事件监听实现点击外部关闭
231
+
232
+ 3. **性能优化**:
233
+ - 懒加载:首次聚焦时才加载数据
234
+ - 事件节流:滚动和 resize 事件自动重新计算位置
235
+ - 组件卸载时清理事件监听器
236
+
237
+ ---
238
+
239
+ ## 注意事项
240
+
241
+ 1. 确保项目已安装并正确配置 Element Plus
242
+ 2. 组件使用 Vue 3 Composition API 和 JSX 语法
243
+ 3. 样式使用 CSS Modules,确保样式隔离
244
+ 4. 下拉框使用 `position: fixed` 定位,不受父容器 overflow 限制
245
+ 5. 组件会自动处理窗口滚动和大小改变事件
246
+ 6. `clearable` 属性默认为 `false`,需要显示清除按钮时需要手动设置为 `true`
247
+ 7. 多选模式下,单击 Tag 的关闭按钮可以删除单个选项,点击清除按钮可以清空所有选项
248
+ 8. `collapse-tags-tooltip` 需要配合 `collapse-tags` 一起使用才有效果
@@ -0,0 +1,194 @@
1
+ import { defineComponent, ref } from 'vue'
2
+ import { ArrowDown, CircleClose } from '@element-plus/icons-vue'
3
+ import styles from './DepartmentSelector.module.scss'
4
+
5
+ /**
6
+ * 选择器触发器组件
7
+ * @component SelectorTrigger
8
+ * @description 提供统一的触发器UI,支持输入框和按钮两种模式
9
+ *
10
+ * @example
11
+ * // 输入框模式
12
+ * <SelectorTrigger
13
+ * displayType="input"
14
+ * visible={visible}
15
+ * disabled={false}
16
+ * clearable={true}
17
+ * hasValue={true}
18
+ * onClick={handleOpen}
19
+ * onClear={handleClear}
20
+ * >
21
+ * <span>选择的内容</span>
22
+ * </SelectorTrigger>
23
+ *
24
+ * // 按钮模式
25
+ * <SelectorTrigger
26
+ * displayType="button"
27
+ * visible={visible}
28
+ * disabled={false}
29
+ * clearable={true}
30
+ * hasValue={true}
31
+ * onClick={handleOpen}
32
+ * onClear={handleClear}
33
+ * >
34
+ * <span>选择的内容</span>
35
+ * </SelectorTrigger>
36
+ */
37
+ export default defineComponent({
38
+ name: 'SelectorTrigger',
39
+
40
+ props: {
41
+ /**
42
+ * 显示类型:input 输入框模式 | button 按钮模式
43
+ * @type {string}
44
+ */
45
+ displayType: {
46
+ type: String,
47
+ default: 'input',
48
+ validator: (value) => ['input', 'button'].includes(value),
49
+ },
50
+ /**
51
+ * 悬浮窗是否可见
52
+ * @type {boolean}
53
+ */
54
+ visible: {
55
+ type: Boolean,
56
+ default: false,
57
+ },
58
+ /**
59
+ * 是否禁用
60
+ * @type {boolean}
61
+ */
62
+ disabled: {
63
+ type: Boolean,
64
+ default: false,
65
+ },
66
+ /**
67
+ * 是否可清空
68
+ * @type {boolean}
69
+ */
70
+ clearable: {
71
+ type: Boolean,
72
+ default: false,
73
+ },
74
+ /**
75
+ * 是否有选中值
76
+ * @type {boolean}
77
+ */
78
+ hasValue: {
79
+ type: Boolean,
80
+ default: false,
81
+ },
82
+ },
83
+
84
+ emits: ['click', 'clear'],
85
+
86
+ setup(props, { emit, slots }) {
87
+ // 输入框/按钮是否被hover
88
+ const isHovering = ref(false)
89
+
90
+ /**
91
+ * 点击处理
92
+ */
93
+ const handleClick = () => {
94
+ if (!props.disabled) {
95
+ emit('click')
96
+ }
97
+ }
98
+
99
+ /**
100
+ * 清空处理
101
+ * @param {Event} e - 事件对象
102
+ */
103
+ const handleClear = (e) => {
104
+ e.stopPropagation()
105
+ emit('clear', e)
106
+ }
107
+
108
+ /**
109
+ * 渲染图标区域
110
+ */
111
+ const renderIcons = () => {
112
+ // 是否显示清除图标(有值 + hover + clearable)
113
+ const showClearIcon = props.clearable && props.hasValue && isHovering.value
114
+
115
+ return (
116
+ <div class={styles.suffixIcons}>
117
+ {/* 清除按钮(hover时显示) */}
118
+ {showClearIcon && (
119
+ <el-icon
120
+ class={styles.clearIcon}
121
+ onClick={handleClear}
122
+ >
123
+ <CircleClose />
124
+ </el-icon>
125
+ )}
126
+
127
+ {/* 下拉箭头(未hover或无值时显示) */}
128
+ {!showClearIcon && (
129
+ <el-icon
130
+ class={[
131
+ styles.arrowIcon,
132
+ props.visible && styles.reverse,
133
+ ]}
134
+ >
135
+ <ArrowDown />
136
+ </el-icon>
137
+ )}
138
+ </div>
139
+ )
140
+ }
141
+
142
+ return () => {
143
+ // 获取插槽内容
144
+ const content = slots.default?.()
145
+
146
+ if (props.displayType === 'button') {
147
+ return (
148
+ <el-button
149
+ disabled={props.disabled}
150
+ onClick={handleClick}
151
+ onMouseenter={() => (isHovering.value = true)}
152
+ onMouseleave={() => (isHovering.value = false)}
153
+ class={styles.buttonWrapper}
154
+ >
155
+ {{
156
+ default: () => (
157
+ <div class={styles.buttonInner}>
158
+ {/* 内容区域 */}
159
+ <div class={styles.buttonContent}>
160
+ {content}
161
+ </div>
162
+
163
+ {/* 右侧图标区域 */}
164
+ {renderIcons()}
165
+ </div>
166
+ ),
167
+ }}
168
+ </el-button>
169
+ )
170
+ }
171
+
172
+ return (
173
+ <div
174
+ class={[
175
+ styles.customInput,
176
+ props.disabled && styles.disabled,
177
+ props.visible && styles.focused,
178
+ ]}
179
+ onClick={handleClick}
180
+ onMouseenter={() => (isHovering.value = true)}
181
+ onMouseleave={() => (isHovering.value = false)}
182
+ >
183
+ {/* 内容区域 */}
184
+ <div class={styles.inputContent}>
185
+ {content}
186
+ </div>
187
+
188
+ {/* 右侧图标区域 */}
189
+ {renderIcons()}
190
+ </div>
191
+ )
192
+ }
193
+ },
194
+ })