@agile-team/wl-skills-kit 1.0.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.
Files changed (112) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +328 -0
  3. package/bin/wl-skills.js +104 -0
  4. package/files/.github/copilot-instructions.md +211 -0
  5. package/files/.github/docs/SYS_MENU_INFO.md +247 -0
  6. package/files/.github/docs/menu-sync-design.md +265 -0
  7. package/files/.github/docs/use-skill.md +379 -0
  8. package/files/.github/docs/wl-skills-kit.md +266 -0
  9. package/files/.github/skills/api-contract/SKILL.md +247 -0
  10. package/files/.github/skills/convention-extract/SKILL.md +355 -0
  11. package/files/.github/skills/menu-sync/SKILL.md +255 -0
  12. package/files/.github/skills/menu-sync/env/guide.md +73 -0
  13. package/files/.github/skills/page-codegen/SKILL.md +825 -0
  14. package/files/.github/skills/page-codegen/TPL-CHANGE-HISTORY.md +281 -0
  15. package/files/.github/skills/page-codegen/TPL-DETAIL-TABS.md +1112 -0
  16. package/files/.github/skills/page-codegen/TPL-DRIVEN.md +124 -0
  17. package/files/.github/skills/page-codegen/TPL-FORM-ROUTE.md +441 -0
  18. package/files/.github/skills/page-codegen/TPL-LIST.md +196 -0
  19. package/files/.github/skills/page-codegen/TPL-MASTER-DETAIL.md +153 -0
  20. package/files/.github/skills/page-codegen/TPL-OPERATION-STATION.md +442 -0
  21. package/files/.github/skills/page-codegen/TPL-RECORD-FORM.md +376 -0
  22. package/files/.github/skills/page-codegen/TPL-TREE-LIST.md +191 -0
  23. package/files/.github/skills/prototype-scan/SKILL.md +414 -0
  24. package/files/demo/README.md +44 -0
  25. package/files/demo/produce/aiflow/mmwr-customer-apply-add/api.md +54 -0
  26. package/files/demo/produce/aiflow/mmwr-customer-apply-add/data.ts +346 -0
  27. package/files/demo/produce/aiflow/mmwr-customer-apply-add/index.scss +1 -0
  28. package/files/demo/produce/aiflow/mmwr-customer-apply-add/index.vue +28 -0
  29. package/files/demo/produce/aiflow/mmwr-customer-apply-add-form/data.ts +115 -0
  30. package/files/demo/produce/aiflow/mmwr-customer-apply-add-form/index.scss +44 -0
  31. package/files/demo/produce/aiflow/mmwr-customer-apply-add-form/index.vue +43 -0
  32. package/files/demo/produce/aiflow/mmwr-customer-apply-change/data.ts +338 -0
  33. package/files/demo/produce/aiflow/mmwr-customer-apply-change/index.scss +1 -0
  34. package/files/demo/produce/aiflow/mmwr-customer-apply-change/index.vue +28 -0
  35. package/files/demo/produce/aiflow/mmwr-customer-apply-change-form/data.ts +115 -0
  36. package/files/demo/produce/aiflow/mmwr-customer-apply-change-form/index.scss +44 -0
  37. package/files/demo/produce/aiflow/mmwr-customer-apply-change-form/index.vue +43 -0
  38. package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/data.ts +196 -0
  39. package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.scss +150 -0
  40. package/files/demo/produce/aiflow/mmwr-customer-apply-change-history/index.vue +79 -0
  41. package/files/demo/produce/aiflow/mmwr-customer-archive/api.md +88 -0
  42. package/files/demo/produce/aiflow/mmwr-customer-archive/data.ts +601 -0
  43. package/files/demo/produce/aiflow/mmwr-customer-archive/index.scss +1 -0
  44. package/files/demo/produce/aiflow/mmwr-customer-archive/index.vue +64 -0
  45. package/files/demo/produce/aiflow/mmwr-customer-detail/api.md +67 -0
  46. package/files/demo/produce/aiflow/mmwr-customer-detail/data.ts +286 -0
  47. package/files/demo/produce/aiflow/mmwr-customer-detail/index.scss +139 -0
  48. package/files/demo/produce/aiflow/mmwr-customer-detail/index.vue +318 -0
  49. package/files/demo/produce/aiflow/mmwr-temp-customer-archive/api.md +98 -0
  50. package/files/demo/produce/aiflow/mmwr-temp-customer-archive/data.ts +543 -0
  51. package/files/demo/produce/aiflow/mmwr-temp-customer-archive/index.scss +1 -0
  52. package/files/demo/produce/aiflow/mmwr-temp-customer-archive/index.vue +52 -0
  53. package/files/demo/sale/demo/add-demo/data.ts +518 -0
  54. package/files/demo/sale/demo/add-demo/index.scss +207 -0
  55. package/files/demo/sale/demo/add-demo/index.vue +167 -0
  56. package/files/demo/sale/demo/billet-flame-cut-plan/data.ts +524 -0
  57. package/files/demo/sale/demo/billet-flame-cut-plan/index.scss +155 -0
  58. package/files/demo/sale/demo/billet-flame-cut-plan/index.vue +117 -0
  59. package/files/demo/sale/demo/domestic-trade-order/data.ts +308 -0
  60. package/files/demo/sale/demo/domestic-trade-order/index.scss +99 -0
  61. package/files/demo/sale/demo/domestic-trade-order/index.vue +77 -0
  62. package/files/demo/sale/demo/heat-batch-return/data.ts +367 -0
  63. package/files/demo/sale/demo/heat-batch-return/index.scss +100 -0
  64. package/files/demo/sale/demo/heat-batch-return/index.vue +170 -0
  65. package/files/demo/sale/demo/heat-batch-return/meltDialog.vue +320 -0
  66. package/files/demo/sale/demo/metallurgical-spec/data.ts +825 -0
  67. package/files/demo/sale/demo/metallurgical-spec/index.scss +264 -0
  68. package/files/demo/sale/demo/metallurgical-spec/index.vue +309 -0
  69. package/files/docs/jh-date-range.md +257 -0
  70. package/files/docs/jh-date.md +222 -0
  71. package/files/docs/jh-dept-picker.md +190 -0
  72. package/files/docs/jh-drag-row.md +590 -0
  73. package/files/docs/jh-file-upload.md +216 -0
  74. package/files/docs/jh-pagination.md +505 -0
  75. package/files/docs/jh-picker.md +218 -0
  76. package/files/docs/jh-select.md +148 -0
  77. package/files/docs/jh-text.md +248 -0
  78. package/files/docs/jh-user-picker.md +197 -0
  79. package/files/docs/page-query-hook-best-practices.md +362 -0
  80. package/files/docs/request.md +925 -0
  81. package/files/src/components/global/C_ParentView/index.vue +3 -0
  82. package/files/src/components/global/C_RightToolbar/index.vue +459 -0
  83. package/files/src/components/global/C_Splitter/index.vue +195 -0
  84. package/files/src/components/global/C_SvgIcon/index.vue +61 -0
  85. package/files/src/components/global/C_SvgIcon/svgicon.js +10 -0
  86. package/files/src/components/global/C_TagStatus/README.md +264 -0
  87. package/files/src/components/global/C_TagStatus/config.ts +192 -0
  88. package/files/src/components/global/C_TagStatus/index.vue +127 -0
  89. package/files/src/components/global/C_TagStatus/types.ts +64 -0
  90. package/files/src/components/global/C_Tree/README.md +153 -0
  91. package/files/src/components/global/C_Tree/index.scss +42 -0
  92. package/files/src/components/global/C_Tree/index.vue +119 -0
  93. package/files/src/components/global/C_Tree/types.ts +59 -0
  94. package/files/src/components/local/c_formModal/README.md +235 -0
  95. package/files/src/components/local/c_formModal/data.ts +95 -0
  96. package/files/src/components/local/c_formModal/index.scss +8 -0
  97. package/files/src/components/local/c_formModal/index.vue +107 -0
  98. package/files/src/components/local/c_formSections/README.md +496 -0
  99. package/files/src/components/local/c_formSections/data.ts +175 -0
  100. package/files/src/components/local/c_formSections/index.scss +280 -0
  101. package/files/src/components/local/c_formSections/index.vue +429 -0
  102. package/files/src/components/local/c_listModal/data.ts +41 -0
  103. package/files/src/components/local/c_listModal/index.vue +136 -0
  104. package/files/src/components/local/c_spliterTitle/index.scss +25 -0
  105. package/files/src/components/local/c_spliterTitle/index.vue +21 -0
  106. package/files/src/components/remote/AGGrid/README.md +530 -0
  107. package/files/src/components/remote/BaseForm/README.md +508 -0
  108. package/files/src/components/remote/BaseQuery/README.md +865 -0
  109. package/files/src/components/remote/BaseTable/README.md +941 -0
  110. package/files/src/components/remote/BaseToolbar/README.md +496 -0
  111. package/files/src/types/page.ts +24 -0
  112. package/package.json +31 -0
@@ -0,0 +1,175 @@
1
+ /*
2
+ * @Author: ChenYu ycyplus@gmail.com
3
+ * @Date: 2026-01-01 13:30:00
4
+ * @LastEditors: ChenYu ycyplus@gmail.com
5
+ * @LastEditTime: 2026-01-01 13:30:00
6
+ * @FilePath: \cx-ui-sale\src\components\local\c_formSections\data.ts
7
+ * @Description: 表单区块组件 - 类型定义
8
+ * Copyright (c) 2026 by CHENY, All Rights Reserved 😎.
9
+ */
10
+
11
+ import type { Component } from "vue";
12
+
13
+ // ========== 类型定义 ==========
14
+
15
+ /**
16
+ * 字段配置接口
17
+ * 定义表单字段的基本属性和行为
18
+ */
19
+ export interface FieldConfig {
20
+ /** 字段属性名(对应 form 对象的 key) */
21
+ prop: string;
22
+ /** 字段标签 */
23
+ label: string;
24
+ /** 字段类型 */
25
+ type?:
26
+ | "input"
27
+ | "select"
28
+ | "textarea"
29
+ | "date"
30
+ | "datetime"
31
+ | "number"
32
+ | "custom";
33
+ /** 栅格占据列数(1-24) */
34
+ span?: number;
35
+ /** 是否必填 */
36
+ required?: boolean;
37
+ /** 占位符文本 */
38
+ placeholder?: string;
39
+ /** 是否可清空(select) */
40
+ clearable?: boolean;
41
+ /** 下拉选项(select) */
42
+ options?: Array<{ label: string; value: string | number }>;
43
+ /** 文本域行数(textarea) */
44
+ rows?: number;
45
+ /** 最小值(number) */
46
+ min?: number;
47
+ /** 最大值(number) */
48
+ max?: number;
49
+ /** 数字精度(number) */
50
+ precision?: number;
51
+ /** 步长(number) */
52
+ step?: number;
53
+ }
54
+
55
+ /**
56
+ * 区块配置接口
57
+ * 定义折叠面板区块的结构和行为
58
+ */
59
+ export interface SectionConfig {
60
+ /** 折叠面板的 name 值(唯一标识) */
61
+ name: string;
62
+ /** 折叠面板 ID(用于锚点跳转) */
63
+ id: string;
64
+ /** 显示的标题 */
65
+ title: string;
66
+ /** 字段配置数组 */
67
+ fieldsConfig: FieldConfig[];
68
+ /** 显示条件函数(可选,返回 true 显示,false 隐藏) */
69
+ visible?: () => boolean;
70
+ /** 是否为特殊处理的区块(如特殊需求) */
71
+ isSpecial?: boolean;
72
+ }
73
+
74
+ /**
75
+ * 表单数据类型
76
+ * 使用索引签名支持动态字段
77
+ */
78
+ export interface FormDataType {
79
+ [key: string]: any;
80
+ }
81
+
82
+ /**
83
+ * 楼层导航配置接口
84
+ */
85
+ export interface NavTabConfig {
86
+ /** 标签名称(唯一标识) */
87
+ name: string;
88
+ /** 显示文本 */
89
+ label: string;
90
+ /** 关联的 section name(用于锚点跳转) */
91
+ sectionName?: string | null;
92
+ }
93
+
94
+ /**
95
+ * 顶部操作按钮配置接口
96
+ */
97
+ export interface HeaderAction {
98
+ /** 按钮文本 */
99
+ label: string;
100
+ /** 按钮类型 */
101
+ type?: "primary" | "success" | "warning" | "danger" | "info" | "text" | "";
102
+ /** 图标名称(Element Plus Icon 组件或字符串) */
103
+ icon?: string | Component;
104
+ /** 点击事件回调 */
105
+ onClick: () => void;
106
+ /** 是否禁用 */
107
+ disabled?: boolean;
108
+ }
109
+
110
+ /**
111
+ * 布局选项配置接口
112
+ */
113
+ export interface LayoutOption {
114
+ /** 列数 */
115
+ columns: 2 | 3 | 4 | 5;
116
+ /** 显示图标 */
117
+ icon: string;
118
+ /** 提示文本 */
119
+ title: string;
120
+ }
121
+
122
+ // ========== 工具函数 ==========
123
+
124
+ /**
125
+ * 根据必填条件过滤字段配置
126
+ * @param fields 原始字段配置数组
127
+ * @param onlyRequired 是否只显示必填字段
128
+ */
129
+ export function filterFieldsByRequired(
130
+ fields: FieldConfig[],
131
+ onlyRequired: boolean
132
+ ): FieldConfig[] {
133
+ if (!onlyRequired) return fields;
134
+ return fields.filter((field) => field.required);
135
+ }
136
+
137
+ /**
138
+ * 判断区块是否有可显示的字段
139
+ * @param fields 字段配置数组
140
+ */
141
+ export function hasSectionFields(fields: FieldConfig[]): boolean {
142
+ return fields.length > 0;
143
+ }
144
+
145
+ /**
146
+ * 生成默认表单数据
147
+ * @param sections 区块配置数组
148
+ */
149
+ export function generateDefaultFormData(
150
+ sections: SectionConfig[]
151
+ ): FormDataType {
152
+ const formData: FormDataType = {};
153
+
154
+ sections.forEach((section) => {
155
+ section.fieldsConfig.forEach((field) => {
156
+ // 根据字段类型设置默认值
157
+ switch (field.type) {
158
+ case "number":
159
+ formData[field.prop] = field.min || 0;
160
+ break;
161
+ case "select":
162
+ formData[field.prop] = "";
163
+ break;
164
+ case "date":
165
+ case "datetime":
166
+ formData[field.prop] = null;
167
+ break;
168
+ default:
169
+ formData[field.prop] = "";
170
+ }
171
+ });
172
+ });
173
+
174
+ return formData;
175
+ }
@@ -0,0 +1,280 @@
1
+ /*
2
+ * @Author: ChenYu ycyplus@gmail.com
3
+ * @Date: 2026-01-01 13:30:00
4
+ * @LastEditors: ChenYu ycyplus@gmail.com
5
+ * @LastEditTime: 2026-01-01 16:30:00
6
+ * @FilePath: \cx-ui-sale\src\components\local\c_formSections\index.scss
7
+ * @Description: 表单区块组件 - 样式
8
+ * Copyright (c) 2026 by CHENY, All Rights Reserved 😎.
9
+ */
10
+
11
+ // ===== 组件包裹容器 =====
12
+ .c-form-sections-wrapper {
13
+ display: flex;
14
+ flex-direction: column;
15
+ height: 100%;
16
+ background: #fff;
17
+ }
18
+
19
+ // ===== 顶部标题栏 =====
20
+ .c-form-header {
21
+ display: flex;
22
+ justify-content: space-between;
23
+ align-items: center;
24
+ padding: 10px 16px;
25
+ background: #fff;
26
+ border-bottom: 1px solid #e4e7ed;
27
+ flex-shrink: 0;
28
+
29
+ .header-title {
30
+ font-size: 14px;
31
+ font-weight: 600;
32
+ color: #303133;
33
+ }
34
+
35
+ .header-right {
36
+ display: flex;
37
+ align-items: center;
38
+ gap: 8px;
39
+ // 按钮样式优化
40
+ .el-button {
41
+ font-size: 13px;
42
+
43
+ .el-icon {
44
+ margin-right: 4px;
45
+ }
46
+ }
47
+ }
48
+ }
49
+
50
+ // ===== 布局切换器 =====
51
+ .layout-switcher {
52
+ display: flex;
53
+ align-items: center;
54
+ gap: 6px;
55
+ border: 1px dashed #dcdfe6;
56
+ padding: 4px 8px;
57
+ border-radius: 2px;
58
+
59
+ .layout-icon {
60
+ font-size: 11px;
61
+ color: #c0c4cc;
62
+ cursor: pointer;
63
+ padding: 2px 6px;
64
+ border-radius: 2px;
65
+ font-family: Arial, sans-serif;
66
+ letter-spacing: -1px;
67
+ user-select: none;
68
+ transition: color 0.2s;
69
+
70
+ &:hover {
71
+ color: #409eff;
72
+ }
73
+
74
+ &.active {
75
+ color: #409eff;
76
+ }
77
+ }
78
+ }
79
+
80
+ // ===== 工具栏 =====
81
+ .c-form-toolbar {
82
+ display: flex;
83
+ justify-content: space-between;
84
+ align-items: center;
85
+ padding: 10px 20px;
86
+ background: #fafafa;
87
+ border-bottom: 1px solid #e4e7ed;
88
+
89
+ .toolbar-left,
90
+ .toolbar-right {
91
+ display: flex;
92
+ align-items: center;
93
+ gap: 16px;
94
+ }
95
+
96
+ .required-toggle {
97
+ display: flex;
98
+ align-items: center;
99
+ gap: 8px;
100
+
101
+ .label {
102
+ font-size: 13px;
103
+ color: #606266;
104
+ user-select: none;
105
+ }
106
+ }
107
+ }
108
+
109
+ // ===== 主体内容区域 =====
110
+ .c-form-content {
111
+ display: flex;
112
+ flex: 1;
113
+ overflow: hidden;
114
+
115
+ // 左侧导航
116
+ .nav-tabs {
117
+ flex-shrink: 0;
118
+ width: 140px;
119
+ border-right: 1px solid #e4e7ed;
120
+
121
+ :deep(.el-tabs__header) {
122
+ margin: 0;
123
+ }
124
+
125
+ :deep(.el-tabs__nav-wrap) {
126
+ &::after {
127
+ display: none;
128
+ }
129
+ }
130
+
131
+ // 隐藏 Element Plus 默认的激活指示器竖线
132
+ :deep(.el-tabs__active-bar) {
133
+ display: none;
134
+ }
135
+
136
+ :deep(.el-tabs__item) {
137
+ padding: 0 16px;
138
+ height: 36px;
139
+ line-height: 36px;
140
+ font-size: 13px;
141
+ color: #606266;
142
+ text-align: left;
143
+
144
+ &:hover {
145
+ background-color: #f5f7fa !important;
146
+ }
147
+
148
+ &.is-active {
149
+ color: #409eff !important;
150
+ background-color: rgba(64, 158, 255, 0.1) !important;
151
+ font-weight: 500;
152
+ }
153
+ }
154
+ }
155
+
156
+ // 表单容器
157
+ .form-container {
158
+ flex: 1;
159
+ overflow-y: auto;
160
+ padding: 16px 20px;
161
+ }
162
+ }
163
+
164
+ // ===== 折叠面板标题样式 =====
165
+ .section-title {
166
+ font-size: 14px;
167
+ font-weight: 600;
168
+ color: #303133;
169
+ margin-right: 12px;
170
+ padding-left: 12px;
171
+ position: relative;
172
+
173
+ // 左侧短竖线装饰
174
+ &::before {
175
+ content: "";
176
+ position: absolute;
177
+ left: 0;
178
+ top: 50%;
179
+ transform: translateY(-50%);
180
+ width: 3px;
181
+ height: 14px;
182
+ background-color: #409eff;
183
+ border-radius: 2px;
184
+ }
185
+ }
186
+
187
+ // ===== 折叠面板内容样式 =====
188
+ :deep(.el-collapse-item__content) {
189
+ padding-top: 10px;
190
+ padding-bottom: 10px;
191
+ }
192
+
193
+ // ===== 表单项样式优化 =====
194
+ :deep(.el-form-item) {
195
+ margin-bottom: 14px;
196
+
197
+ // 标签样式
198
+ .el-form-item__label {
199
+ font-size: 13px;
200
+ color: #606266;
201
+
202
+ // 必填标记样式
203
+ &::before {
204
+ margin-right: 2px;
205
+ }
206
+ }
207
+
208
+ // 输入框样式
209
+ .el-input__inner,
210
+ .el-textarea__inner {
211
+ font-size: 13px;
212
+ }
213
+
214
+ // 选择框样式
215
+ .el-select {
216
+ width: 100%;
217
+ }
218
+ }
219
+
220
+ // ===== 分割线样式 =====
221
+ :deep(.el-divider) {
222
+ margin: 0;
223
+ flex: 1;
224
+ }
225
+
226
+ // ===== 折叠面板标题容器 =====
227
+ :deep(.el-collapse) {
228
+ border-top: 0;
229
+ border-bottom: 0;
230
+ }
231
+ :deep(.el-collapse-item__header) {
232
+ display: flex;
233
+ align-items: center;
234
+ padding: 0 16px;
235
+ height: 48px;
236
+ font-weight: normal;
237
+ border-bottom: 0;
238
+ border-top: 0;
239
+ // hover 效果
240
+ &:hover {
241
+ background-color: #f5f7fa;
242
+ }
243
+
244
+ // 展开箭头
245
+ .el-collapse-item__arrow {
246
+ margin-right: 8px;
247
+ }
248
+ }
249
+ :deep(.el-collapse-item__wrap) {
250
+ border-bottom: 0;
251
+ }
252
+
253
+ // ===== 空状态样式 =====
254
+ :deep(.el-empty) {
255
+ padding: 24px 0;
256
+
257
+ .el-empty__description {
258
+ font-size: 13px;
259
+ color: #909399;
260
+ }
261
+ }
262
+
263
+ // ===== 响应式适配 =====
264
+ @media screen and (max-width: 1440px) {
265
+ :deep(.el-form-item) {
266
+ margin-bottom: 16px;
267
+ }
268
+
269
+ .section-title {
270
+ font-size: 13px;
271
+ }
272
+
273
+ .c-form-header .header-title {
274
+ font-size: 15px;
275
+ }
276
+
277
+ .nav-tabs {
278
+ width: 120px;
279
+ }
280
+ }