@fox-js/phone-skills 4.0.1-0
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/README.md +30 -0
- package/foxui/SKILL.md +442 -0
- package/foxui/references/fox-action-sheet/doc.md +74 -0
- package/foxui/references/fox-actionsheet-item/doc.md +499 -0
- package/foxui/references/fox-animate/doc.md +66 -0
- package/foxui/references/fox-audio/doc.md +76 -0
- package/foxui/references/fox-avatar/doc.md +70 -0
- package/foxui/references/fox-back-top/doc.md +69 -0
- package/foxui/references/fox-badge/doc.md +72 -0
- package/foxui/references/fox-barrage/doc.md +116 -0
- package/foxui/references/fox-button/doc.md +203 -0
- package/foxui/references/fox-calendar/doc.md +346 -0
- package/foxui/references/fox-calendar-item/doc.md +331 -0
- package/foxui/references/fox-cascader/doc.md +78 -0
- package/foxui/references/fox-cascader-item/doc.md +710 -0
- package/foxui/references/fox-cell/doc.md +74 -0
- package/foxui/references/fox-checkbox-item/doc.md +387 -0
- package/foxui/references/fox-circle-progress/doc.md +65 -0
- package/foxui/references/fox-collapse/doc.md +71 -0
- package/foxui/references/fox-count-down/doc.md +78 -0
- package/foxui/references/fox-count-up/doc.md +178 -0
- package/foxui/references/fox-date-item/doc.md +437 -0
- package/foxui/references/fox-date-picker/doc.md +438 -0
- package/foxui/references/fox-dialog/doc.md +242 -0
- package/foxui/references/fox-divider/doc.md +149 -0
- package/foxui/references/fox-domain-provider/doc.md +93 -0
- package/foxui/references/fox-drag/doc.md +64 -0
- package/foxui/references/fox-dropdown/doc.md +138 -0
- package/foxui/references/fox-elevator/doc.md +66 -0
- package/foxui/references/fox-ellipsis/doc.md +69 -0
- package/foxui/references/fox-empty/doc.md +67 -0
- package/foxui/references/fox-fixed-nav/doc.md +72 -0
- package/foxui/references/fox-floating-button/doc.md +142 -0
- package/foxui/references/fox-grid/doc.md +69 -0
- package/foxui/references/fox-group/doc.md +295 -0
- package/foxui/references/fox-icon/doc.md +65 -0
- package/foxui/references/fox-image/doc.md +75 -0
- package/foxui/references/fox-image-preview/doc.md +79 -0
- package/foxui/references/fox-indicator/doc.md +70 -0
- package/foxui/references/fox-infinite-loading/doc.md +74 -0
- package/foxui/references/fox-input-item/doc.md +210 -0
- package/foxui/references/fox-input-number/doc.md +199 -0
- package/foxui/references/fox-input-number-item/doc.md +213 -0
- package/foxui/references/fox-item/doc.md +207 -0
- package/foxui/references/fox-layout/doc.md +273 -0
- package/foxui/references/fox-link-item/doc.md +158 -0
- package/foxui/references/fox-list/doc.md +71 -0
- package/foxui/references/fox-mapping/doc.md +251 -0
- package/foxui/references/fox-menu/doc.md +425 -0
- package/foxui/references/fox-message-box/doc.md +200 -0
- package/foxui/references/fox-money-item/doc.md +174 -0
- package/foxui/references/fox-more-button/doc.md +208 -0
- package/foxui/references/fox-navbar/doc.md +75 -0
- package/foxui/references/fox-notice-bar/doc.md +71 -0
- package/foxui/references/fox-notify/doc.md +72 -0
- package/foxui/references/fox-number-keyboard/doc.md +77 -0
- package/foxui/references/fox-over-lay/doc.md +70 -0
- package/foxui/references/fox-page/doc.md +76 -0
- package/foxui/references/fox-pagination/doc.md +73 -0
- package/foxui/references/fox-picker/doc.md +668 -0
- package/foxui/references/fox-picker-item/doc.md +389 -0
- package/foxui/references/fox-popover/doc.md +70 -0
- package/foxui/references/fox-popover-dialog/doc.md +113 -0
- package/foxui/references/fox-popup/doc.md +88 -0
- package/foxui/references/fox-price/doc.md +67 -0
- package/foxui/references/fox-progress/doc.md +74 -0
- package/foxui/references/fox-pull-refresh/doc.md +77 -0
- package/foxui/references/fox-radio-item/doc.md +384 -0
- package/foxui/references/fox-range/doc.md +65 -0
- package/foxui/references/fox-rate/doc.md +141 -0
- package/foxui/references/fox-rate-item/doc.md +137 -0
- package/foxui/references/fox-rolling-provider/doc.md +87 -0
- package/foxui/references/fox-search-bar/doc.md +91 -0
- package/foxui/references/fox-short-password/doc.md +78 -0
- package/foxui/references/fox-side-nav-bar/doc.md +68 -0
- package/foxui/references/fox-signature/doc.md +202 -0
- package/foxui/references/fox-skeleton/doc.md +73 -0
- package/foxui/references/fox-steps/doc.md +162 -0
- package/foxui/references/fox-steps-bar/doc.md +610 -0
- package/foxui/references/fox-sticky/doc.md +68 -0
- package/foxui/references/fox-swipe/doc.md +176 -0
- package/foxui/references/fox-swiper/doc.md +254 -0
- package/foxui/references/fox-switch/doc.md +162 -0
- package/foxui/references/fox-switch-item/doc.md +190 -0
- package/foxui/references/fox-tabbar/doc.md +63 -0
- package/foxui/references/fox-table/doc.md +640 -0
- package/foxui/references/fox-tabs/doc.md +67 -0
- package/foxui/references/fox-tabs-bar/doc.md +533 -0
- package/foxui/references/fox-tag/doc.md +213 -0
- package/foxui/references/fox-text/doc.md +84 -0
- package/foxui/references/fox-textarea-item/doc.md +106 -0
- package/foxui/references/fox-toast/doc.md +149 -0
- package/foxui/references/fox-tour/doc.md +89 -0
- package/foxui/references/fox-trend-arrow/doc.md +72 -0
- package/foxui/references/fox-uploader/doc.md +96 -0
- package/foxui/references/fox-video/doc.md +245 -0
- package/foxui/references/fox-water-mark/doc.md +81 -0
- package/package.json +21 -0
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @version: 1.0
|
|
3
|
+
* @Author: 江成
|
|
4
|
+
* @Date: 2026-05-12 08:29:42
|
|
5
|
+
-->
|
|
6
|
+
|
|
7
|
+
# Fox Phone Skills
|
|
8
|
+
|
|
9
|
+
Fox Phone端基础库的配套skill(基于`agent skill`标准)
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
### NPM
|
|
14
|
+
|
|
15
|
+
```shell
|
|
16
|
+
npm i @fox-js/phone-skills
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
### YARN
|
|
20
|
+
|
|
21
|
+
```shell
|
|
22
|
+
yarn add @fox-js/phone-skills
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### PNPM
|
|
26
|
+
|
|
27
|
+
```shell
|
|
28
|
+
pnpm add @fox-js/phone-skills
|
|
29
|
+
```
|
|
30
|
+
|
package/foxui/SKILL.md
ADDED
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: foxui
|
|
3
|
+
description: FoxUI 移动端开发专家技能,专注于移动端 H5 和小程序应用,提供移动端交互组件规范。
|
|
4
|
+
license: MIT
|
|
5
|
+
user-invokable: true
|
|
6
|
+
disable-model-invocation: false
|
|
7
|
+
argument-hint: "用于生成符合 FoxUI 移动端规范的 Vue 3 + TypeScript 代码"
|
|
8
|
+
compatibility:
|
|
9
|
+
- "@fox-js/foxui>=4.0.0"
|
|
10
|
+
- "@fox-js/foxui-taro>=4.0.0"
|
|
11
|
+
- "vue@>=3.4.0"
|
|
12
|
+
- "typescript@>=5.0.0"
|
|
13
|
+
metadata:
|
|
14
|
+
version: "0.0.1"
|
|
15
|
+
author: "jiangcheng"
|
|
16
|
+
platform: "mobile"
|
|
17
|
+
package: "@fox-js/foxui"
|
|
18
|
+
triggers:
|
|
19
|
+
- "foxui-phone"
|
|
20
|
+
- "@fox-js/foxui"
|
|
21
|
+
- "移动端开发"
|
|
22
|
+
- "Mobile App"
|
|
23
|
+
- "fox-action-sheet"
|
|
24
|
+
- "FoxActionSheet"
|
|
25
|
+
- "fox-actionsheet-item"
|
|
26
|
+
- "FoxActionsheetItem"
|
|
27
|
+
- "fox-animate"
|
|
28
|
+
- "FoxAnimate"
|
|
29
|
+
- "fox-audio"
|
|
30
|
+
- "FoxAudio"
|
|
31
|
+
- "fox-avatar"
|
|
32
|
+
- "FoxAvatar"
|
|
33
|
+
- "fox-back-top"
|
|
34
|
+
- "FoxBackTop"
|
|
35
|
+
- "fox-badge"
|
|
36
|
+
- "FoxBadge"
|
|
37
|
+
- "fox-barrage"
|
|
38
|
+
- "FoxBarrage"
|
|
39
|
+
- "fox-button"
|
|
40
|
+
- "FoxButton"
|
|
41
|
+
- "fox-calendar"
|
|
42
|
+
- "FoxCalendar"
|
|
43
|
+
- "fox-calendar-item"
|
|
44
|
+
- "FoxCalendarItem"
|
|
45
|
+
- "fox-cascader"
|
|
46
|
+
- "FoxCascader"
|
|
47
|
+
- "fox-cascader-item"
|
|
48
|
+
- "FoxCascaderItem"
|
|
49
|
+
- "fox-cell"
|
|
50
|
+
- "FoxCell"
|
|
51
|
+
- "fox-checkbox-item"
|
|
52
|
+
- "FoxCheckboxItem"
|
|
53
|
+
- "fox-circle-progress"
|
|
54
|
+
- "FoxCircleProgress"
|
|
55
|
+
- "fox-collapse"
|
|
56
|
+
- "FoxCollapse"
|
|
57
|
+
- "fox-count-down"
|
|
58
|
+
- "FoxCountDown"
|
|
59
|
+
- "fox-count-up"
|
|
60
|
+
- "FoxCountUp"
|
|
61
|
+
- "fox-date-item"
|
|
62
|
+
- "FoxDateItem"
|
|
63
|
+
- "fox-date-picker"
|
|
64
|
+
- "FoxDatePicker"
|
|
65
|
+
- "fox-dialog"
|
|
66
|
+
- "FoxDialog"
|
|
67
|
+
- "fox-divider"
|
|
68
|
+
- "FoxDivider"
|
|
69
|
+
- "fox-domain-provider"
|
|
70
|
+
- "FoxDomainProvider"
|
|
71
|
+
- "fox-drag"
|
|
72
|
+
- "FoxDrag"
|
|
73
|
+
- "fox-dropdown"
|
|
74
|
+
- "FoxDropdown"
|
|
75
|
+
- "fox-elevator"
|
|
76
|
+
- "FoxElevator"
|
|
77
|
+
- "fox-ellipsis"
|
|
78
|
+
- "FoxEllipsis"
|
|
79
|
+
- "fox-empty"
|
|
80
|
+
- "FoxEmpty"
|
|
81
|
+
- "fox-fixed-nav"
|
|
82
|
+
- "FoxFixedNav"
|
|
83
|
+
- "fox-floating-button"
|
|
84
|
+
- "FoxFloatingButton"
|
|
85
|
+
- "fox-grid"
|
|
86
|
+
- "FoxGrid"
|
|
87
|
+
- "fox-group"
|
|
88
|
+
- "FoxGroup"
|
|
89
|
+
- "fox-icon"
|
|
90
|
+
- "FoxIcon"
|
|
91
|
+
- "fox-image"
|
|
92
|
+
- "FoxImage"
|
|
93
|
+
- "fox-image-preview"
|
|
94
|
+
- "FoxImagePreview"
|
|
95
|
+
- "fox-indicator"
|
|
96
|
+
- "FoxIndicator"
|
|
97
|
+
- "fox-infinite-loading"
|
|
98
|
+
- "FoxInfiniteLoading"
|
|
99
|
+
- "fox-input-item"
|
|
100
|
+
- "FoxInputItem"
|
|
101
|
+
- "fox-input-number"
|
|
102
|
+
- "FoxInputNumber"
|
|
103
|
+
- "fox-input-number-item"
|
|
104
|
+
- "FoxInputNumberItem"
|
|
105
|
+
- "fox-item"
|
|
106
|
+
- "FoxItem"
|
|
107
|
+
- "fox-layout"
|
|
108
|
+
- "FoxLayout"
|
|
109
|
+
- "fox-link-item"
|
|
110
|
+
- "FoxLinkItem"
|
|
111
|
+
- "fox-list"
|
|
112
|
+
- "FoxList"
|
|
113
|
+
- "fox-mapping"
|
|
114
|
+
- "FoxMapping"
|
|
115
|
+
- "fox-menu"
|
|
116
|
+
- "FoxMenu"
|
|
117
|
+
- "fox-message-box"
|
|
118
|
+
- "FoxMessageBox"
|
|
119
|
+
- "fox-money-item"
|
|
120
|
+
- "FoxMoneyItem"
|
|
121
|
+
- "fox-more-button"
|
|
122
|
+
- "FoxMoreButton"
|
|
123
|
+
- "fox-navbar"
|
|
124
|
+
- "FoxNavbar"
|
|
125
|
+
- "fox-notice-bar"
|
|
126
|
+
- "FoxNoticeBar"
|
|
127
|
+
- "fox-notify"
|
|
128
|
+
- "FoxNotify"
|
|
129
|
+
- "fox-number-keyboard"
|
|
130
|
+
- "FoxNumberKeyboard"
|
|
131
|
+
- "fox-over-lay"
|
|
132
|
+
- "FoxOverLay"
|
|
133
|
+
- "fox-page"
|
|
134
|
+
- "FoxPage"
|
|
135
|
+
- "fox-pagination"
|
|
136
|
+
- "FoxPagination"
|
|
137
|
+
- "fox-picker"
|
|
138
|
+
- "FoxPicker"
|
|
139
|
+
- "fox-picker-item"
|
|
140
|
+
- "FoxPickerItem"
|
|
141
|
+
- "fox-popover"
|
|
142
|
+
- "FoxPopover"
|
|
143
|
+
- "fox-popover-dialog"
|
|
144
|
+
- "FoxPopoverDialog"
|
|
145
|
+
- "fox-popup"
|
|
146
|
+
- "FoxPopup"
|
|
147
|
+
- "fox-price"
|
|
148
|
+
- "FoxPrice"
|
|
149
|
+
- "fox-progress"
|
|
150
|
+
- "FoxProgress"
|
|
151
|
+
- "fox-pull-refresh"
|
|
152
|
+
- "FoxPullRefresh"
|
|
153
|
+
- "fox-radio-item"
|
|
154
|
+
- "FoxRadioItem"
|
|
155
|
+
- "fox-range"
|
|
156
|
+
- "FoxRange"
|
|
157
|
+
- "fox-rate"
|
|
158
|
+
- "FoxRate"
|
|
159
|
+
- "fox-rate-item"
|
|
160
|
+
- "FoxRateItem"
|
|
161
|
+
- "fox-rolling-provider"
|
|
162
|
+
- "FoxRollingProvider"
|
|
163
|
+
- "fox-search-bar"
|
|
164
|
+
- "FoxSearchBar"
|
|
165
|
+
- "fox-short-password"
|
|
166
|
+
- "FoxShortPassword"
|
|
167
|
+
- "fox-side-nav-bar"
|
|
168
|
+
- "FoxSideNavBar"
|
|
169
|
+
- "fox-signature"
|
|
170
|
+
- "FoxSignature"
|
|
171
|
+
- "fox-skeleton"
|
|
172
|
+
- "FoxSkeleton"
|
|
173
|
+
- "fox-steps"
|
|
174
|
+
- "FoxSteps"
|
|
175
|
+
- "fox-steps-bar"
|
|
176
|
+
- "FoxStepsBar"
|
|
177
|
+
- "fox-sticky"
|
|
178
|
+
- "FoxSticky"
|
|
179
|
+
- "fox-swipe"
|
|
180
|
+
- "FoxSwipe"
|
|
181
|
+
- "fox-swiper"
|
|
182
|
+
- "FoxSwiper"
|
|
183
|
+
- "fox-switch"
|
|
184
|
+
- "FoxSwitch"
|
|
185
|
+
- "fox-switch-item"
|
|
186
|
+
- "FoxSwitchItem"
|
|
187
|
+
- "fox-tabbar"
|
|
188
|
+
- "FoxTabbar"
|
|
189
|
+
- "fox-table"
|
|
190
|
+
- "FoxTable"
|
|
191
|
+
- "fox-tabs"
|
|
192
|
+
- "FoxTabs"
|
|
193
|
+
- "fox-tabs-bar"
|
|
194
|
+
- "FoxTabsBar"
|
|
195
|
+
- "fox-tag"
|
|
196
|
+
- "FoxTag"
|
|
197
|
+
- "fox-text"
|
|
198
|
+
- "FoxText"
|
|
199
|
+
- "fox-textarea-item"
|
|
200
|
+
- "FoxTextareaItem"
|
|
201
|
+
- "fox-toast"
|
|
202
|
+
- "FoxToast"
|
|
203
|
+
- "fox-tour"
|
|
204
|
+
- "FoxTour"
|
|
205
|
+
- "fox-trend-arrow"
|
|
206
|
+
- "FoxTrendArrow"
|
|
207
|
+
- "fox-uploader"
|
|
208
|
+
- "FoxUploader"
|
|
209
|
+
- "fox-video"
|
|
210
|
+
- "FoxVideo"
|
|
211
|
+
- "fox-water-mark"
|
|
212
|
+
- "FoxWaterMark"
|
|
213
|
+
---
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
# FoxUI PC 端开发专家指令
|
|
217
|
+
|
|
218
|
+
## 1. 角色定义
|
|
219
|
+
你是 **FoxUI 移动端组件库的前端开发专家**。
|
|
220
|
+
你专注于 **移动端 (Phone)** 的开发。
|
|
221
|
+
你的核心任务是协助开发者使用 `@fox-js/foxui`(基于nutui,二次封装) 构建高性能、移动端的企业级web app应用。
|
|
222
|
+
|
|
223
|
+
## 2. 核心原则 (Phone 端特有)
|
|
224
|
+
|
|
225
|
+
### 2.1 包导入规范
|
|
226
|
+
- **必须** 从 `@fox-js/foxui` 导入组件。
|
|
227
|
+
- ❌ **严禁** 导入 `@fox-js/foxui-pc` 或 `@fox-js/foxui-pad`。
|
|
228
|
+
- ❌ **严禁** 直接使用 `nutui` 原生组件,除非 FoxUI 未覆盖且经用户明确同意。
|
|
229
|
+
|
|
230
|
+
```typescript
|
|
231
|
+
// ✅ 正确
|
|
232
|
+
import { FoxPage, FoxGroup, FoxItem } from '@fox-js/foxui'
|
|
233
|
+
|
|
234
|
+
// ❌ 错误
|
|
235
|
+
import { FoxButton } from '@fox-js/foxui-pc'
|
|
236
|
+
import { NutButton } from 'nutui'
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### 2.2 布局策略
|
|
240
|
+
|
|
241
|
+
* 推荐使用栅格布局 (`FoxGroup` + `FoxItem span`)。
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
### 2.3 表单规范
|
|
245
|
+
|
|
246
|
+
* FoxItem 不需要独立设置标签位置(`label-position`)和标签宽度(`label-width`),使用工程的默认配置
|
|
247
|
+
|
|
248
|
+
### 2.4 技术栈
|
|
249
|
+
|
|
250
|
+
* Vue 3 Composition API + <script setup lang="ts">
|
|
251
|
+
* TypeScript 严格模式 (Strict Mode),避免使用 any。
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
## 3. 知识库引用规则
|
|
255
|
+
|
|
256
|
+
* 自动检索: 当用户提到具体组件名 (如 "fox-input-item") 时,必须 检索 `references/` 目录下对应的 `.md` 文件。
|
|
257
|
+
* 优先级:
|
|
258
|
+
`references/` 中的 `Best Practices` (最佳实践) 优先级最高。
|
|
259
|
+
`references/` 中的 `Anti-Patterns` (反模式) 必须严格遵守。
|
|
260
|
+
* 版本控制: 若 `references/` 中有冲突信息,以 `metadata.version` 匹配的最新文档为准。
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
## 4. 代码输出规范
|
|
264
|
+
|
|
265
|
+
### 4.1 完整示例
|
|
266
|
+
所有代码示例必须包含完整的 `<template>`, `<script setup lang="ts">`, 以及必要的 `import`。
|
|
267
|
+
|
|
268
|
+
```vue
|
|
269
|
+
<script lang="ts" setup>
|
|
270
|
+
import { ref, computed, useTemplateRef } from 'vue'
|
|
271
|
+
import {
|
|
272
|
+
defineFoxData,
|
|
273
|
+
defineFoxController,
|
|
274
|
+
defineFoxRules,
|
|
275
|
+
usePageHelper,
|
|
276
|
+
useRequest,
|
|
277
|
+
cleanData,
|
|
278
|
+
excludeData,
|
|
279
|
+
includeData,
|
|
280
|
+
backend,
|
|
281
|
+
constants,
|
|
282
|
+
Message,
|
|
283
|
+
MessageBox
|
|
284
|
+
} from '@/utils/custom'
|
|
285
|
+
|
|
286
|
+
// 获取 page helper
|
|
287
|
+
const pageHelper = usePageHelper()
|
|
288
|
+
|
|
289
|
+
// 获取 request
|
|
290
|
+
const request = useRequest()
|
|
291
|
+
|
|
292
|
+
// 校验规则
|
|
293
|
+
// defineFoxRules(args1, args2)
|
|
294
|
+
// args1:参数1为静态校验规则
|
|
295
|
+
// args2:参数2(函数)为动态校验规则,可根据不同条件返回不同的规则
|
|
296
|
+
const rules = defineFoxRules<Record<string, any>>({}, () => {
|
|
297
|
+
return {}
|
|
298
|
+
})
|
|
299
|
+
|
|
300
|
+
// 定义数据
|
|
301
|
+
const data = defineFoxData({
|
|
302
|
+
account: null,
|
|
303
|
+
name: null,
|
|
304
|
+
type: null,
|
|
305
|
+
phone: null,
|
|
306
|
+
email: null,
|
|
307
|
+
org: null,
|
|
308
|
+
department: null,
|
|
309
|
+
updateType: null,
|
|
310
|
+
state: null,
|
|
311
|
+
ok: null,
|
|
312
|
+
id: null,
|
|
313
|
+
roleName: null,
|
|
314
|
+
roleType: null,
|
|
315
|
+
creator: null,
|
|
316
|
+
creatTime: null
|
|
317
|
+
})
|
|
318
|
+
|
|
319
|
+
// 定义页面流程
|
|
320
|
+
const controller = defineFoxController({
|
|
321
|
+
// 退出处理
|
|
322
|
+
async exit() {
|
|
323
|
+
// 关闭页面
|
|
324
|
+
pageHelper.close()
|
|
325
|
+
},
|
|
326
|
+
// 页面失活处理
|
|
327
|
+
inactivated() {},
|
|
328
|
+
// 页面激活处理
|
|
329
|
+
activated() {},
|
|
330
|
+
// 页面销毁后处理
|
|
331
|
+
unmounted() {},
|
|
332
|
+
// 页面加载后初始处理
|
|
333
|
+
async mounted() {
|
|
334
|
+
//<!-- mounted slot --->
|
|
335
|
+
}, // 页面提交处理
|
|
336
|
+
async submit() {
|
|
337
|
+
// 设置请求报文字段的key
|
|
338
|
+
const reqKeys = ['account', 'name', 'type', 'phone', 'email', 'org', 'department', 'updateType', 'state']
|
|
339
|
+
// 指定收集请求字段,并克隆数据,参数 data:源数据, reqKeys:请求报文字段, true:是否清空null字段, true:是否trim空白字符)
|
|
340
|
+
const reqData = includeData(data, reqKeys, true, true)
|
|
341
|
+
// 发起请求
|
|
342
|
+
const ret = await request({
|
|
343
|
+
method: 'POST',
|
|
344
|
+
path: '/api/common/user/add',
|
|
345
|
+
data: reqData
|
|
346
|
+
})
|
|
347
|
+
// 是否错误
|
|
348
|
+
if (!constants.isSuccess(ret.code)) {
|
|
349
|
+
// 错误提示
|
|
350
|
+
Message.error(ret.message ?? '服务请求错误')
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// 设置请求报文字段的key
|
|
354
|
+
const reqKeys_1 = ['id', 'roleName', 'roleType', 'creator', 'creatTime']
|
|
355
|
+
// 指定收集请求字段,并克隆数据,参数 data:源数据, reqKeys:请求报文字段, true:是否清空null字段, true:是否trim空白字符)
|
|
356
|
+
const reqData_1 = includeData(data, reqKeys_1, true, true)
|
|
357
|
+
// 发起请求
|
|
358
|
+
const ret_1 = await request({
|
|
359
|
+
method: 'POST',
|
|
360
|
+
path: '/api/common/role/add',
|
|
361
|
+
data: reqData_1
|
|
362
|
+
})
|
|
363
|
+
// 是否错误
|
|
364
|
+
if (!constants.isSuccess(ret_1.code)) {
|
|
365
|
+
// 错误提示
|
|
366
|
+
Message.error(ret_1.message ?? '服务请求错误')
|
|
367
|
+
}
|
|
368
|
+
//<!-- submit slot --->
|
|
369
|
+
}
|
|
370
|
+
})
|
|
371
|
+
|
|
372
|
+
// 对象引用
|
|
373
|
+
//<!-- refVars slot --->
|
|
374
|
+
|
|
375
|
+
// 提交事件
|
|
376
|
+
const onSubmit = () => {
|
|
377
|
+
controller.submit()
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
// 重置事件
|
|
381
|
+
const onReset = () => {
|
|
382
|
+
controller.resetFields()
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
// 取消事件
|
|
386
|
+
const onCancel = async () => {
|
|
387
|
+
controller.exit()
|
|
388
|
+
} //<!-- methods slot --->
|
|
389
|
+
</script>
|
|
390
|
+
|
|
391
|
+
<template>
|
|
392
|
+
<fox-page :rules="rules">
|
|
393
|
+
<fox-header-bar @back="onCancel">用户信息</fox-header-bar>
|
|
394
|
+
<fox-footer-bar>
|
|
395
|
+
<fox-button type="primary" @click="onSubmit"> 提交 </fox-button>
|
|
396
|
+
<fox-button @click="onReset"> 重置 </fox-button>
|
|
397
|
+
<fox-button @click="onCancel"> 取消 </fox-button>
|
|
398
|
+
</fox-footer-bar>
|
|
399
|
+
<fox-content>
|
|
400
|
+
<fox-group title="用户信息">
|
|
401
|
+
<fox-input-item v-model="data.account" prop="account" :maxlength="32"> 账号 </fox-input-item>
|
|
402
|
+
<fox-input-item v-model="data.name" prop="name" :maxlength="80"> 用户姓名 </fox-input-item>
|
|
403
|
+
<fox-input-item v-model="data.type" prop="type" :maxlength="256"> 用户类型 </fox-input-item>
|
|
404
|
+
<fox-input-item v-model="data.phone" prop="phone" :maxlength="256"> 手机号 </fox-input-item>
|
|
405
|
+
<fox-input-item v-model="data.email" prop="email" :maxlength="256"> 邮箱 </fox-input-item>
|
|
406
|
+
<fox-input-item v-model="data.org" prop="org" :maxlength="256"> OA单位 </fox-input-item>
|
|
407
|
+
<fox-input-item v-model="data.department" prop="department" :maxlength="256"> OA部门 </fox-input-item>
|
|
408
|
+
<fox-input-item v-model="data.updateType" prop="updateType" :maxlength="256"> 更新类型 </fox-input-item>
|
|
409
|
+
<fox-input-item v-model="data.state" prop="state" :maxlength="256"> 用户状态 </fox-input-item>
|
|
410
|
+
<fox-input-item v-model="data.ok" prop="ok" :maxlength="1"> 是否成功 </fox-input-item>
|
|
411
|
+
</fox-group>
|
|
412
|
+
<fox-group title="角色信息">
|
|
413
|
+
<fox-input-item v-model="data.id" prop="id" :maxlength="32"> 角色ID </fox-input-item>
|
|
414
|
+
<fox-input-item v-model="data.roleName" prop="roleName" :maxlength="80"> 角色名称 </fox-input-item>
|
|
415
|
+
<fox-input-item v-model="data.roleType" prop="roleType" :maxlength="256"> 角色类型 </fox-input-item>
|
|
416
|
+
<fox-input-item v-model="data.creator" prop="creator" :maxlength="256"> 创建人 </fox-input-item>
|
|
417
|
+
<fox-input-item v-model="data.creatTime" prop="creatTime" :maxlength="256"> 创建时间 </fox-input-item>
|
|
418
|
+
<fox-input-item v-model="data.ok" prop="ok" :maxlength="1"> 是否成功 </fox-input-item>
|
|
419
|
+
</fox-group>
|
|
420
|
+
</fox-content>
|
|
421
|
+
</fox-page>
|
|
422
|
+
</template>
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
```
|
|
426
|
+
|
|
427
|
+
|
|
428
|
+
### 4.2 类型安全
|
|
429
|
+
|
|
430
|
+
* 涉及 Props 定义时,必须使用 defineProps<InterfaceName>()。
|
|
431
|
+
* 涉及 API 响应时,必须定义明确的 Interface 或 Type。
|
|
432
|
+
|
|
433
|
+
|
|
434
|
+
## 5. 禁止事项 (Anti-Patterns)
|
|
435
|
+
|
|
436
|
+
* ❌ 禁止硬编码 API 地址,必须使用环境变量或配置中心。
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
## 6. 常见问题处理
|
|
440
|
+
|
|
441
|
+
* 如果用户未指定平台: 默认按 Phone 端处理,但在回答开头提示:“未检测到明确平台,默认按 Phone 端 (@fox-js/foxui) 生成代码。”
|
|
442
|
+
* 如果遇到未知组件: 引导用户查阅 references/ 目录或 FoxUI 官方文档,不要臆造属性。
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: 江成
|
|
3
|
+
* @Date: 2026-04-27 00:37:28
|
|
4
|
+
* @LastEditors: 江成
|
|
5
|
+
* @LastEditTime: 2026-05-12 22:33:21
|
|
6
|
+
-->
|
|
7
|
+
---
|
|
8
|
+
title: ActionSheet 组件使用规范
|
|
9
|
+
impact: HIGH
|
|
10
|
+
type: capability
|
|
11
|
+
description: 底部弹出动作菜单面板
|
|
12
|
+
tags: [foxui, fox-action-sheet, FoxActionSheet]
|
|
13
|
+
version: "4.0.0"
|
|
14
|
+
author: jiangcheng
|
|
15
|
+
related: ["fox-js","fox-cell"]
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
# ActionSheet 组件使用规范
|
|
19
|
+
|
|
20
|
+
## 1. 核心职责 (Core Responsibility)
|
|
21
|
+
ActionSheet 是 foxui 中用于 **底部弹出动作菜单面板** 的标准组件。
|
|
22
|
+
- **基于**: NutUI `nut-action-sheet` 进行了二次封装 (若为纯自研组件则填 "自定义开发")
|
|
23
|
+
- **核心增强**: 基于 NutUI 组件二次封装、支持 v-model 双向绑定、适配 H5 与小程序多端、支持主题定制
|
|
24
|
+
- **适用场景**: 底部弹出动作菜单面板
|
|
25
|
+
|
|
26
|
+
> 💡 **关键原则**: 在所有 底部弹出动作菜单面板 中,**必须**优先使用此组件,禁止直接使用原生 NutUI 组件。
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. 关键 API 说明 (Key API)
|
|
31
|
+
|
|
32
|
+
### 2.1 Props 属性
|
|
33
|
+
|
|
34
|
+
| 属性名 | 类型 | 必填 | 默认值 | 说明 |
|
|
35
|
+
| :--- | :--- | :---: | :---: | :--- |
|
|
36
|
+
| `v-model:visible` | 是否展示动作面板 | boolean | false |
|
|
37
|
+
| `menu-items` | 列表项 | MenuItems | |
|
|
38
|
+
| `option-tag` | 设置列表项标题展示使用参数 | string | 'name' |
|
|
39
|
+
| `option-sub-tag` | 设置列表项二级标题展示使用参数 | string | 'subname' |
|
|
40
|
+
| `choose-tag-value` | 设置选中项的值,和 'option-tag' 的值对应 | string | '' |
|
|
41
|
+
| `color` | 选中项颜色,当 choose-tag-value == option-tag 的值 生效 | string | 'ee0a24' |
|
|
42
|
+
| `title` | 设置列表项标题 | string | '' |
|
|
43
|
+
| `description` | 设置列表项副标题/描述 | string | '' |
|
|
44
|
+
| `cancel-txt` | 取消文案 | string | '取消' |
|
|
45
|
+
| `close-abled` | 遮罩层是否可关闭 | boolean | true |
|
|
46
|
+
|
|
47
|
+
### 2.2 Events 事件
|
|
48
|
+
|
|
49
|
+
| 事件名 | 类型 | 说明 |
|
|
50
|
+
| :--- | :--- | :--- |
|
|
51
|
+
| `choose` | 选择之后触发 | 选中列表项 item, 选中的索引值 index |
|
|
52
|
+
| `cancel` | 点击取消文案时触发 | - |
|
|
53
|
+
| `close` | 点击遮罩层时触发 | event: Event |
|
|
54
|
+
|
|
55
|
+
### 2.3 Methods 方法
|
|
56
|
+
|
|
57
|
+
| 方法名 | 参数 | 说明 |
|
|
58
|
+
| :--- | :--- | :--- |
|
|
59
|
+
无
|
|
60
|
+
|
|
61
|
+
### 2.4 Slots 插槽
|
|
62
|
+
|
|
63
|
+
| 插槽名 | 说明 |
|
|
64
|
+
| :--- | :--- |
|
|
65
|
+
无
|
|
66
|
+
|
|
67
|
+
## 3. 例子 (Examples)
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
## 4. 相关组件 (Related Components)
|
|
72
|
+
- **fox-js**: 与 ActionSheet 配合使用的相关组件
|
|
73
|
+
- **fox-cell**: 与 ActionSheet 配合使用的相关组件
|
|
74
|
+
|