mcp-vue-codegen 1.3.0 → 1.3.1

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 CHANGED
@@ -1,25 +1,49 @@
1
1
  # mcp-vue-codegen
2
2
 
3
- MCP Server,根据数据库表字段 JSON 文档自动生成 Vue3 前端 CRUD 模块代码。
3
+ MCP Server,根据数据库表字段 JSON 文档自动生成 **Vue3 前端** + **Java 后端** 完整 CRUD 模块代码。
4
4
 
5
- ## 生成文件
5
+ ## 功能概览
6
6
 
7
- - `options.ts` 表单字段配置、过滤类型
8
- - `api/*.ts` — 5 个标准 CRUD 接口
9
- - `index.vue` — 列表页(表格、搜索、按钮、分页、工作流)
10
- - `form.vue` — 表单页(折叠面板、字段控件、校验规则、主从表)
7
+ ### 前端生成(Vue3 + Element Plus)
11
8
 
12
- ## 使用方式
9
+ | 文件 | 说明 |
10
+ |------|------|
11
+ | `options.ts` | 表单字段配置、过滤类型 |
12
+ | `api/*.ts` | 5 个标准 CRUD 接口(fetchList / addObj / getObj / delObjs / putObj) |
13
+ | `index.vue` | 列表页:表格、智能搜索、分页、按钮(增删改查/提交/流转/导出/打印) |
14
+ | `form.vue` | 表单页:折叠面板、字段控件、校验规则、弹窗选择器、主从表 |
13
15
 
14
- ### npx 直接运行
16
+ ### 后端生成(Spring Boot + MyBatis-Plus)
15
17
 
16
- ```bash
17
- npx mcp-vue-codegen
18
- ```
18
+ | 文件 | 说明 |
19
+ |------|------|
20
+ | `{Entity}Entity.java` | 主表实体类(含 @TableId、@Dict、@Schema 等注解) |
21
+ | `{Entity}DetailEntity.java` | 从表实体类(有从表时生成) |
22
+ | `{Entity}Mapper.java` + `.xml` | MyBatis-Plus Mapper 接口及 XML |
23
+ | `{Entity}Service.java` | Service 接口 |
24
+ | `{Entity}ServiceImpl.java` | Service 实现(主从表级联 CRUD、工作流回调) |
25
+ | `{Entity}Controller.java` | REST Controller(分页查询、增删改查、导出、打印) |
26
+
27
+ ## 快速开始
28
+
29
+ ### 1. 配置 MCP
30
+
31
+ 在你的 IDE 中添加 MCP Server 配置:
19
32
 
20
- ### IDE 配置
33
+ **Claude Code**(`~/.claude/settings.json` 或项目下 `.claude/settings.json`):
34
+
35
+ ```json
36
+ {
37
+ "mcpServers": {
38
+ "vue-codegen": {
39
+ "command": "npx",
40
+ "args": ["-y", "mcp-vue-codegen"]
41
+ }
42
+ }
43
+ }
44
+ ```
21
45
 
22
- Claude CodeMCP 设置中添加:
46
+ **Trae / VS Code**(MCP 设置中添加):
23
47
 
24
48
  ```json
25
49
  {
@@ -32,51 +56,130 @@ npx mcp-vue-codegen
32
56
  }
33
57
  ```
34
58
 
59
+ ### 2. 准备 JSON 文档
60
+
61
+ 参考 [example/table-schema.json](./example/table-schema.json) 编写你的表字段描述文件。
62
+
63
+ ### 3. 在 IDE 中调用
64
+
65
+ 配置好后,直接在 AI 对话中用自然语言调用即可:
66
+
67
+ **生成前端代码:**
68
+
69
+ > 用 generate_vue_crud 工具,schemaInput 为 E:/codegen/template/table-schema.json
70
+
71
+ 输出路径自动推导为 `{projectRoot}/src/views/{moduleName}/{componentName}/`
72
+
73
+ **生成后端代码:**
74
+
75
+ > 用 generate_java_crud 工具,schemaInput 为 E:/codegen/template/table-schema.json,projectRoot 为 E:/vue3/worsoft5.3
76
+
77
+ 输出路径自动推导为 `{projectRoot}/worsoft-{moduleName}/` 下的标准 Java 包结构
78
+
79
+ **校验 JSON 文档:**
80
+
81
+ > 用 validate_schema 工具,schemaInput 为 E:/codegen/template/table-schema.json
82
+
35
83
  ## MCP Tools
36
84
 
37
85
  ### validate_schema
38
86
 
39
- 校验 JSON 文档是否符合规范。
87
+ 校验 JSON 文档是否符合代码生成规范。
40
88
 
41
- | 参数 | 类型 | 说明 |
42
- |------|------|------|
43
- | schemaJson | string | JSON 文档内容 |
89
+ | 参数 | 类型 | 必填 | 说明 |
90
+ |------|------|------|------|
91
+ | schemaInput | string | 是 | JSON 文件路径 或 JSON 字符串 |
44
92
 
45
93
  ### generate_vue_crud
46
94
 
47
- 根据 JSON 文档生成完整 CRUD 代码。
95
+ 生成 Vue3 前端 CRUD 代码。
96
+
97
+ | 参数 | 类型 | 必填 | 说明 |
98
+ |------|------|------|------|
99
+ | schemaInput | string | 是 | JSON 文件路径 或 JSON 字符串 |
100
+ | projectRoot | string | 否 | 前端项目根目录,默认当前工作目录 |
101
+ | outputDir | string | 否 | 直接指定输出目录,指定后忽略自动推导 |
48
102
 
49
- | 参数 | 类型 | 说明 |
50
- |------|------|------|
51
- | schemaJson | string | JSON 文档内容 |
52
- | outputDir | string | 输出目录路径 |
103
+ ### generate_java_crud
104
+
105
+ 生成 Java 后端 CRUD 代码。
106
+
107
+ | 参数 | 类型 | 必填 | 说明 |
108
+ |------|------|------|------|
109
+ | schemaInput | string | 是 | JSON 文件路径 或 JSON 字符串 |
110
+ | projectRoot | string | 否 | 后端项目根目录,默认当前工作目录 |
53
111
 
54
112
  ## JSON 文档格式
55
113
 
114
+ 完整示例见 [example/table-schema.json](./example/table-schema.json),核心结构如下:
115
+
56
116
  ```json
57
117
  {
58
118
  "module": {
59
119
  "moduleName": "oa",
60
120
  "businessName": "企业证照借用",
61
121
  "entityName": "CertBorrow",
122
+ "componentName": "CertBorrow",
62
123
  "apiBasePath": "/oa/certBorrow",
124
+ "apiFilePath": "api/oa/CertBorrow",
63
125
  "permissionPrefix": "oa_OaCertificatesBorrow",
64
126
  "hasWorkflow": true,
65
127
  "hasExport": true,
66
- "hasPrint": true
128
+ "hasPrint": true,
129
+ "labelWidth": "100px"
67
130
  },
68
131
  "master": {
69
132
  "tableName": "oa_cert_borrow",
70
- "formSections": [...],
71
- "fields": [...]
133
+ "formSections": [
134
+ { "name": "basic", "collapseIndex": "0", "title": "基本信息" }
135
+ ],
136
+ "filterTypes": { "billStateId": 30 },
137
+ "fields": [
138
+ {
139
+ "columnName": "id",
140
+ "fieldName": "id",
141
+ "label": "单据ID",
142
+ "dataType": "varchar(64)",
143
+ "inputType": "hidden",
144
+ "required": false,
145
+ "showInTable": false,
146
+ "alwaysHide": true,
147
+ "smartSearch": false,
148
+ "tableWidth": "0",
149
+ "isPrimaryKey": true
150
+ }
151
+ ]
72
152
  },
73
153
  "detail": {
74
154
  "tableName": "oa_cert_borrow_detail",
75
- "fields": [...]
155
+ "detailTitle": "企业证照借用从表",
156
+ "detailFkField": "mainId",
157
+ "detailListName": "details",
158
+ "fields": []
76
159
  }
77
160
  }
78
161
  ```
79
162
 
163
+ ### 关键字段说明
164
+
165
+ | 字段属性 | 作用 |
166
+ |---------|------|
167
+ | `hasWorkflow` | 控制流程相关按钮(提交/流转)和后端 processCompleted 回调 |
168
+ | `hasExport` / `hasPrint` | 控制导出/打印按钮及后端对应接口 |
169
+ | `showInTable` + `alwaysHide` | 决定表格列是否显示 |
170
+ | `showInForm` + `formSection` + `formRow` + `formColSpan` | 决定表单字段布局 |
171
+ | `inputType` | 控件类型:input / date / textarea / file / select / userRef / personRef |
172
+ | `smartSearch` | 是否纳入智能搜索范围 |
173
+ | `dictCode` + `needFormatter` | 字典格式化(前端 formatter + 后端 @Dict 注解) |
174
+ | `refConfig` | 弹窗选择器配置(组件、字段映射) |
175
+ | `editableInTable` | 从表行内编辑(select / date) |
176
+ | `required` | 前端校验规则 |
177
+ | `isPrimaryKey` / `isForeignKey` / `isSystemField` | 后端实体类字段类型推导和过滤 |
178
+
179
+ ## 环境要求
180
+
181
+ - Node.js >= 18
182
+
80
183
  ## License
81
184
 
82
185
  MIT
@@ -0,0 +1,937 @@
1
+ {
2
+ "module": {
3
+ "moduleName": "oa",
4
+ "businessName": "企业证照借用",
5
+ "entityName": "CertBorrow",
6
+ "componentName": "CertBorrow",
7
+ "apiBasePath": "/oa/certBorrow",
8
+ "apiFilePath": "api/oa/CertBorrow",
9
+ "permissionPrefix": "oa_OaCertificatesBorrow",
10
+ "processDefKey": "动态取自菜单modelId",
11
+ "hasWorkflow": true,
12
+ "hasExport": true,
13
+ "exportUrl": "/oa/certBorrow/export",
14
+ "hasPrint": true,
15
+ "printFileNameField": "person",
16
+ "labelWidth": "100px"
17
+ },
18
+ "master": {
19
+ "tableName": "oa_cert_borrow",
20
+ "collapseTitle": "masterCollapseTitle",
21
+ "createInfoTitle": "masterCreateCollapseTitle",
22
+ "formSections": [
23
+ { "name": "basic", "collapseIndex": "0", "title": "基本信息" },
24
+ { "name": "detail", "collapseIndex": "1", "title": "企业证照借用从表" },
25
+ { "name": "createInfo", "collapseIndex": "2", "title": "填报信息" }
26
+ ],
27
+ "filterTypes": {
28
+ "billStateId": 30
29
+ },
30
+ "fields": [
31
+ {
32
+ "columnName": "id",
33
+ "fieldName": "id",
34
+ "label": "单据ID",
35
+ "dataType": "varchar(64)",
36
+ "inputType": "hidden",
37
+ "required": false,
38
+ "showInTable": false,
39
+ "alwaysHide": true,
40
+ "showInForm": false,
41
+ "smartSearch": false,
42
+ "tableWidth": "0",
43
+ "isSystemField": true,
44
+ "isPrimaryKey": true,
45
+ "defaultValue": "null"
46
+ },
47
+ {
48
+ "columnName": "version",
49
+ "fieldName": "version",
50
+ "label": "版本号",
51
+ "dataType": "varchar(10)",
52
+ "inputType": "hidden",
53
+ "required": false,
54
+ "showInTable": false,
55
+ "alwaysHide": true,
56
+ "showInForm": false,
57
+ "smartSearch": false,
58
+ "tableWidth": "0",
59
+ "isSystemField": true,
60
+ "defaultValue": "''"
61
+ },
62
+ {
63
+ "columnName": "bill_state_id",
64
+ "fieldName": "billStateId",
65
+ "label": "单据状态",
66
+ "dataType": "varchar(10)",
67
+ "inputType": "select",
68
+ "required": false,
69
+ "showInTable": true,
70
+ "alwaysHide": false,
71
+ "showInForm": false,
72
+ "smartSearch": false,
73
+ "tableWidth": "80",
74
+ "isSystemField": true,
75
+ "dictCode": "bill_state",
76
+ "needFormatter": true,
77
+ "defaultValue": "'0'"
78
+ },
79
+ {
80
+ "columnName": "bill_code",
81
+ "fieldName": "billCode",
82
+ "label": "单据编号",
83
+ "dataType": "varchar(100)",
84
+ "inputType": "input",
85
+ "required": false,
86
+ "showInTable": true,
87
+ "alwaysHide": false,
88
+ "showInForm": true,
89
+ "smartSearch": false,
90
+ "tableWidth": "180",
91
+ "formColSpan": 6,
92
+ "disabled": true,
93
+ "formSection": "basic",
94
+ "formRow": 1,
95
+ "defaultValue": "null"
96
+ },
97
+ {
98
+ "columnName": "bill_date",
99
+ "fieldName": "billDate",
100
+ "label": "单据日期",
101
+ "dataType": "date",
102
+ "inputType": "date",
103
+ "dateFormat": "YYYY-MM-DD",
104
+ "required": true,
105
+ "showInTable": true,
106
+ "alwaysHide": false,
107
+ "showInForm": true,
108
+ "smartSearch": false,
109
+ "tableWidth": "100",
110
+ "formColSpan": 6,
111
+ "disabled": false,
112
+ "formSection": "basic",
113
+ "formRow": 1,
114
+ "defaultValue": "moment(new Date()).format('YYYY-MM-DD')"
115
+ },
116
+ {
117
+ "columnName": "person_id",
118
+ "fieldName": "personId",
119
+ "label": "申请人ID",
120
+ "dataType": "varchar(64)",
121
+ "inputType": "hidden",
122
+ "required": false,
123
+ "showInTable": false,
124
+ "alwaysHide": true,
125
+ "showInForm": false,
126
+ "smartSearch": false,
127
+ "tableWidth": "0",
128
+ "isSystemField": false,
129
+ "defaultValue": "null"
130
+ },
131
+ {
132
+ "columnName": "person",
133
+ "fieldName": "person",
134
+ "label": "申请人",
135
+ "dataType": "varchar(100)",
136
+ "inputType": "userRef",
137
+ "required": true,
138
+ "showInTable": true,
139
+ "alwaysHide": false,
140
+ "showInForm": true,
141
+ "smartSearch": true,
142
+ "tableWidth": "100",
143
+ "formColSpan": 6,
144
+ "disabled": false,
145
+ "formSection": "basic",
146
+ "formRow": 1,
147
+ "defaultValue": "null",
148
+ "refConfig": {
149
+ "refComponent": "select-user",
150
+ "refTitle": "personSelectPersonDialog",
151
+ "idField": "personId",
152
+ "nameField": "person",
153
+ "rootId": "getCurrPsmInfo().ognId",
154
+ "extraMappings": [
155
+ { "source": "personId", "target": "personId" },
156
+ { "source": "name", "target": "person" },
157
+ { "source": "dptId", "target": "deptId" },
158
+ { "source": "dptFullName", "target": "dept" }
159
+ ]
160
+ }
161
+ },
162
+ {
163
+ "columnName": "dept_id",
164
+ "fieldName": "deptId",
165
+ "label": "申请人部门ID",
166
+ "dataType": "varchar(64)",
167
+ "inputType": "hidden",
168
+ "required": false,
169
+ "showInTable": false,
170
+ "alwaysHide": true,
171
+ "showInForm": false,
172
+ "smartSearch": false,
173
+ "tableWidth": "0",
174
+ "defaultValue": "null"
175
+ },
176
+ {
177
+ "columnName": "dept",
178
+ "fieldName": "dept",
179
+ "label": "申请人部门",
180
+ "dataType": "varchar(500)",
181
+ "inputType": "input",
182
+ "required": false,
183
+ "showInTable": true,
184
+ "alwaysHide": false,
185
+ "showInForm": true,
186
+ "smartSearch": false,
187
+ "tableWidth": "150",
188
+ "formColSpan": 6,
189
+ "disabled": true,
190
+ "maxLength": 500,
191
+ "formSection": "basic",
192
+ "formRow": 1,
193
+ "defaultValue": "null"
194
+ },
195
+ {
196
+ "columnName": "contact_person_id",
197
+ "fieldName": "contactPersonId",
198
+ "label": "我方联系人ID",
199
+ "dataType": "varchar(64)",
200
+ "inputType": "hidden",
201
+ "required": false,
202
+ "showInTable": false,
203
+ "alwaysHide": true,
204
+ "showInForm": false,
205
+ "smartSearch": false,
206
+ "tableWidth": "0",
207
+ "defaultValue": "null"
208
+ },
209
+ {
210
+ "columnName": "contact_person",
211
+ "fieldName": "contactPerson",
212
+ "label": "我方联系人",
213
+ "dataType": "varchar(100)",
214
+ "inputType": "personRef",
215
+ "required": true,
216
+ "showInTable": true,
217
+ "alwaysHide": false,
218
+ "showInForm": true,
219
+ "smartSearch": true,
220
+ "tableWidth": "100",
221
+ "formColSpan": 6,
222
+ "disabled": false,
223
+ "formSection": "basic",
224
+ "formRow": 2,
225
+ "defaultValue": "null",
226
+ "refConfig": {
227
+ "refComponent": "select-person",
228
+ "refTitle": "contactPersonSelectUserDialog",
229
+ "idField": "contactPersonId",
230
+ "nameField": "contactPerson",
231
+ "rootId": "getCurrPsmInfo().ognId",
232
+ "containParentFlag": "false",
233
+ "extraMappings": [
234
+ { "source": "person.id", "target": "contactPersonId" },
235
+ { "source": "sysMyInform.name", "target": "contactPerson" },
236
+ { "source": "sysMyInform.phoneMobile", "target": "phoneMobile" }
237
+ ]
238
+ }
239
+ },
240
+ {
241
+ "columnName": "phone_mobile",
242
+ "fieldName": "phoneMobile",
243
+ "label": "联系电话",
244
+ "dataType": "varchar(50)",
245
+ "inputType": "input",
246
+ "required": false,
247
+ "showInTable": true,
248
+ "alwaysHide": false,
249
+ "showInForm": true,
250
+ "smartSearch": false,
251
+ "tableWidth": "150",
252
+ "formColSpan": 6,
253
+ "disabled": true,
254
+ "formSection": "basic",
255
+ "formRow": 2,
256
+ "defaultValue": "null"
257
+ },
258
+ {
259
+ "columnName": "certificates_opinion",
260
+ "fieldName": "certificatesOpinion",
261
+ "label": "证书描述",
262
+ "dataType": "varchar(100)",
263
+ "inputType": "input",
264
+ "required": false,
265
+ "showInTable": true,
266
+ "alwaysHide": false,
267
+ "showInForm": true,
268
+ "smartSearch": true,
269
+ "tableWidth": "150",
270
+ "formColSpan": 12,
271
+ "maxLength": 100,
272
+ "disabled": false,
273
+ "formSection": "basic",
274
+ "formRow": 2,
275
+ "defaultValue": "null"
276
+ },
277
+ {
278
+ "columnName": "borrow_reason",
279
+ "fieldName": "borrowReason",
280
+ "label": "借用原因",
281
+ "dataType": "varchar(100)",
282
+ "inputType": "textarea",
283
+ "required": true,
284
+ "showInTable": true,
285
+ "alwaysHide": false,
286
+ "showInForm": true,
287
+ "smartSearch": true,
288
+ "tableWidth": "200",
289
+ "formColSpan": 24,
290
+ "maxLength": 100,
291
+ "textareaRows": 3,
292
+ "showWordLimit": true,
293
+ "disabled": false,
294
+ "formSection": "basic",
295
+ "formRow": 3,
296
+ "defaultValue": "null"
297
+ },
298
+ {
299
+ "columnName": "remark",
300
+ "fieldName": "remark",
301
+ "label": "备注",
302
+ "dataType": "varchar(500)",
303
+ "inputType": "textarea",
304
+ "required": false,
305
+ "showInTable": true,
306
+ "alwaysHide": false,
307
+ "showInForm": true,
308
+ "smartSearch": true,
309
+ "tableWidth": "200",
310
+ "formColSpan": 24,
311
+ "maxLength": 500,
312
+ "textareaRows": 5,
313
+ "showWordLimit": true,
314
+ "disabled": false,
315
+ "formSection": "basic",
316
+ "formRow": 4,
317
+ "defaultValue": "null"
318
+ },
319
+ {
320
+ "columnName": "attachment",
321
+ "fieldName": "attachment",
322
+ "label": "附件",
323
+ "dataType": "text",
324
+ "inputType": "file",
325
+ "required": false,
326
+ "showInTable": false,
327
+ "alwaysHide": true,
328
+ "showInForm": true,
329
+ "smartSearch": false,
330
+ "tableWidth": "0",
331
+ "formColSpan": 24,
332
+ "disabled": false,
333
+ "formSection": "basic",
334
+ "formRow": 5,
335
+ "defaultValue": "null"
336
+ },
337
+ {
338
+ "columnName": "create_user_id",
339
+ "fieldName": "createUserId",
340
+ "label": "填报人id",
341
+ "dataType": "varchar(64)",
342
+ "inputType": "hidden",
343
+ "required": false,
344
+ "showInTable": false,
345
+ "alwaysHide": true,
346
+ "showInForm": false,
347
+ "smartSearch": false,
348
+ "tableWidth": "0",
349
+ "isSystemField": true,
350
+ "defaultValue": "getCurrPsmInfo().userId"
351
+ },
352
+ {
353
+ "columnName": "create_user",
354
+ "fieldName": "createUser",
355
+ "label": "填报人",
356
+ "dataType": "varchar(100)",
357
+ "inputType": "input",
358
+ "required": false,
359
+ "showInTable": true,
360
+ "alwaysHide": false,
361
+ "showInForm": true,
362
+ "smartSearch": false,
363
+ "tableWidth": "100",
364
+ "formColSpan": 6,
365
+ "disabled": true,
366
+ "isSystemField": true,
367
+ "formSection": "createInfo",
368
+ "formRow": 1,
369
+ "defaultValue": "getCurrPsmInfo().user"
370
+ },
371
+ {
372
+ "columnName": "create_pos_id",
373
+ "fieldName": "createPosId",
374
+ "label": "填报岗位id",
375
+ "dataType": "varchar(64)",
376
+ "inputType": "hidden",
377
+ "required": false,
378
+ "showInTable": false,
379
+ "alwaysHide": true,
380
+ "showInForm": false,
381
+ "smartSearch": false,
382
+ "tableWidth": "0",
383
+ "isSystemField": true,
384
+ "defaultValue": "null"
385
+ },
386
+ {
387
+ "columnName": "create_pos",
388
+ "fieldName": "createPos",
389
+ "label": "填报岗位",
390
+ "dataType": "varchar(100)",
391
+ "inputType": "hidden",
392
+ "required": false,
393
+ "showInTable": false,
394
+ "alwaysHide": true,
395
+ "showInForm": false,
396
+ "smartSearch": false,
397
+ "tableWidth": "0",
398
+ "isSystemField": true,
399
+ "defaultValue": "null"
400
+ },
401
+ {
402
+ "columnName": "create_dpt_id",
403
+ "fieldName": "createDptId",
404
+ "label": "填报部门id",
405
+ "dataType": "varchar(64)",
406
+ "inputType": "hidden",
407
+ "required": false,
408
+ "showInTable": false,
409
+ "alwaysHide": true,
410
+ "showInForm": false,
411
+ "smartSearch": false,
412
+ "tableWidth": "0",
413
+ "isSystemField": true,
414
+ "defaultValue": "null"
415
+ },
416
+ {
417
+ "columnName": "create_dpt",
418
+ "fieldName": "createDpt",
419
+ "label": "填报部门",
420
+ "dataType": "varchar(200)",
421
+ "inputType": "hidden",
422
+ "required": false,
423
+ "showInTable": false,
424
+ "alwaysHide": true,
425
+ "showInForm": false,
426
+ "smartSearch": false,
427
+ "tableWidth": "0",
428
+ "isSystemField": true,
429
+ "defaultValue": "null"
430
+ },
431
+ {
432
+ "columnName": "create_ogn_id",
433
+ "fieldName": "createOgnId",
434
+ "label": "填报单位id",
435
+ "dataType": "varchar(64)",
436
+ "inputType": "hidden",
437
+ "required": false,
438
+ "showInTable": false,
439
+ "alwaysHide": true,
440
+ "showInForm": false,
441
+ "smartSearch": false,
442
+ "tableWidth": "0",
443
+ "isSystemField": true,
444
+ "defaultValue": "null"
445
+ },
446
+ {
447
+ "columnName": "create_ogn",
448
+ "fieldName": "createOgn",
449
+ "label": "填报单位",
450
+ "dataType": "varchar(200)",
451
+ "inputType": "hidden",
452
+ "required": false,
453
+ "showInTable": false,
454
+ "alwaysHide": true,
455
+ "showInForm": false,
456
+ "smartSearch": false,
457
+ "tableWidth": "0",
458
+ "isSystemField": true,
459
+ "defaultValue": "null"
460
+ },
461
+ {
462
+ "columnName": "create_psm_full_id",
463
+ "fieldName": "createPsmFullId",
464
+ "label": "填报人全id",
465
+ "dataType": "varchar(500)",
466
+ "inputType": "hidden",
467
+ "required": false,
468
+ "showInTable": false,
469
+ "alwaysHide": true,
470
+ "showInForm": false,
471
+ "smartSearch": false,
472
+ "tableWidth": "0",
473
+ "isSystemField": true,
474
+ "defaultValue": "null"
475
+ },
476
+ {
477
+ "columnName": "create_psm_full_name",
478
+ "fieldName": "createPsmFullName",
479
+ "label": "填报人全名称",
480
+ "dataType": "varchar(500)",
481
+ "inputType": "hidden",
482
+ "required": false,
483
+ "showInTable": false,
484
+ "alwaysHide": true,
485
+ "showInForm": false,
486
+ "smartSearch": false,
487
+ "tableWidth": "0",
488
+ "isSystemField": true,
489
+ "defaultValue": "null"
490
+ },
491
+ {
492
+ "columnName": "update_psm_full_id",
493
+ "fieldName": "updatePsmFullId",
494
+ "label": "修改人全id",
495
+ "dataType": "varchar(500)",
496
+ "inputType": "hidden",
497
+ "required": false,
498
+ "showInTable": false,
499
+ "alwaysHide": true,
500
+ "showInForm": false,
501
+ "smartSearch": false,
502
+ "tableWidth": "0",
503
+ "isSystemField": true,
504
+ "defaultValue": "null"
505
+ },
506
+ {
507
+ "columnName": "update_psm_full_name",
508
+ "fieldName": "updatePsmFullName",
509
+ "label": "修改人全名称",
510
+ "dataType": "varchar(500)",
511
+ "inputType": "hidden",
512
+ "required": false,
513
+ "showInTable": false,
514
+ "alwaysHide": true,
515
+ "showInForm": false,
516
+ "smartSearch": false,
517
+ "tableWidth": "0",
518
+ "isSystemField": true,
519
+ "defaultValue": "null"
520
+ },
521
+ {
522
+ "columnName": "create_time",
523
+ "fieldName": "createTime",
524
+ "label": "创建时间",
525
+ "dataType": "datetime",
526
+ "inputType": "input",
527
+ "required": false,
528
+ "showInTable": true,
529
+ "alwaysHide": false,
530
+ "showInForm": true,
531
+ "smartSearch": false,
532
+ "tableWidth": "180",
533
+ "formColSpan": 6,
534
+ "disabled": true,
535
+ "isSystemField": true,
536
+ "formSection": "createInfo",
537
+ "formRow": 1,
538
+ "defaultValue": "null",
539
+ "isTimeQueryField": true
540
+ },
541
+ {
542
+ "columnName": "update_time",
543
+ "fieldName": "updateTime",
544
+ "label": "更新时间",
545
+ "dataType": "datetime",
546
+ "inputType": "hidden",
547
+ "required": false,
548
+ "showInTable": false,
549
+ "alwaysHide": true,
550
+ "showInForm": false,
551
+ "smartSearch": false,
552
+ "tableWidth": "0",
553
+ "isSystemField": true,
554
+ "defaultValue": "null"
555
+ },
556
+ {
557
+ "columnName": "tenant_id",
558
+ "fieldName": "tenantId",
559
+ "label": "租户ID",
560
+ "dataType": "varchar(64)",
561
+ "inputType": "hidden",
562
+ "required": false,
563
+ "showInTable": false,
564
+ "alwaysHide": true,
565
+ "showInForm": false,
566
+ "smartSearch": false,
567
+ "tableWidth": "0",
568
+ "isSystemField": true,
569
+ "defaultValue": "null"
570
+ },
571
+ {
572
+ "columnName": "finished_time",
573
+ "fieldName": "finishedTime",
574
+ "label": "完成时间",
575
+ "dataType": "datetime",
576
+ "inputType": "input",
577
+ "required": false,
578
+ "showInTable": false,
579
+ "alwaysHide": true,
580
+ "showInForm": true,
581
+ "smartSearch": false,
582
+ "tableWidth": "0",
583
+ "formColSpan": 6,
584
+ "disabled": true,
585
+ "isSystemField": true,
586
+ "formSection": "createInfo",
587
+ "formRow": 1,
588
+ "defaultValue": "null"
589
+ }
590
+ ]
591
+ },
592
+ "detail": {
593
+ "tableName": "oa_cert_borrow_detail",
594
+ "detailTitle": "企业证照借用从表",
595
+ "detailCollapseTitle": "detailCollapseTitle",
596
+ "detailFkField": "mainId",
597
+ "detailRowKey": "certificatesId",
598
+ "detailListName": "details",
599
+ "detailRefType": "dialog",
600
+ "detailRefConfig": {
601
+ "component": "select-registes",
602
+ "componentPath": "/@/privatelyComponents/select-registes/index.vue",
603
+ "idMapping": { "source": "id", "target": "certificatesId" },
604
+ "nameMapping": { "source": "name", "target": "certificatesName" },
605
+ "codeMapping": { "source": "code", "target": "certificatesCode" },
606
+ "extraMappings": [
607
+ { "source": "useType", "target": "useType" },
608
+ { "source": "useTypeId", "target": "useTypeId" },
609
+ { "source": "returnDate", "target": "returnDate" }
610
+ ]
611
+ },
612
+ "detailValidateConfig": {
613
+ "rowNameType": "value",
614
+ "rowName": "certificatesName"
615
+ },
616
+ "fields": [
617
+ {
618
+ "columnName": "id",
619
+ "fieldName": "id",
620
+ "label": "主键",
621
+ "dataType": "varchar(64)",
622
+ "inputType": "hidden",
623
+ "required": false,
624
+ "showInTable": false,
625
+ "alwaysHide": true,
626
+ "smartSearch": false,
627
+ "tableWidth": "0",
628
+ "isSystemField": true,
629
+ "isPrimaryKey": true
630
+ },
631
+ {
632
+ "columnName": "version",
633
+ "fieldName": "version",
634
+ "label": "版本号",
635
+ "dataType": "varchar(10)",
636
+ "inputType": "hidden",
637
+ "required": false,
638
+ "showInTable": false,
639
+ "alwaysHide": true,
640
+ "smartSearch": false,
641
+ "tableWidth": "0",
642
+ "isSystemField": true
643
+ },
644
+ {
645
+ "columnName": "main_id",
646
+ "fieldName": "mainId",
647
+ "label": "主表ID",
648
+ "dataType": "varchar(64)",
649
+ "inputType": "hidden",
650
+ "required": false,
651
+ "showInTable": false,
652
+ "alwaysHide": true,
653
+ "smartSearch": false,
654
+ "tableWidth": "0",
655
+ "isSystemField": true,
656
+ "isForeignKey": true
657
+ },
658
+ {
659
+ "columnName": "certificates_id",
660
+ "fieldName": "certificatesId",
661
+ "label": "证书ID",
662
+ "dataType": "varchar(64)",
663
+ "inputType": "hidden",
664
+ "required": false,
665
+ "showInTable": false,
666
+ "alwaysHide": true,
667
+ "smartSearch": false,
668
+ "tableWidth": "0"
669
+ },
670
+ {
671
+ "columnName": "certificates_name",
672
+ "fieldName": "certificatesName",
673
+ "label": "证书名称",
674
+ "dataType": "varchar(200)",
675
+ "inputType": "input",
676
+ "required": true,
677
+ "showInTable": true,
678
+ "alwaysHide": false,
679
+ "smartSearch": true,
680
+ "tableWidth": "100",
681
+ "editableInTable": false
682
+ },
683
+ {
684
+ "columnName": "certificates_code",
685
+ "fieldName": "certificatesCode",
686
+ "label": "证书编号",
687
+ "dataType": "varchar(100)",
688
+ "inputType": "input",
689
+ "required": true,
690
+ "showInTable": true,
691
+ "alwaysHide": false,
692
+ "smartSearch": true,
693
+ "tableWidth": "100",
694
+ "editableInTable": false
695
+ },
696
+ {
697
+ "columnName": "use_type_id",
698
+ "fieldName": "useTypeId",
699
+ "label": "使用方式ID",
700
+ "dataType": "varchar(10)",
701
+ "inputType": "hidden",
702
+ "required": false,
703
+ "showInTable": false,
704
+ "alwaysHide": true,
705
+ "smartSearch": false,
706
+ "tableWidth": "0"
707
+ },
708
+ {
709
+ "columnName": "use_type",
710
+ "fieldName": "useType",
711
+ "label": "使用方式",
712
+ "dataType": "varchar(50)",
713
+ "inputType": "select",
714
+ "required": true,
715
+ "showInTable": true,
716
+ "alwaysHide": false,
717
+ "smartSearch": true,
718
+ "tableWidth": "100",
719
+ "editableInTable": true,
720
+ "editInputType": "select",
721
+ "dictCode": "certificates_borrow_usage_mode",
722
+ "editBindField": "useTypeId",
723
+ "editRuleProp": "useTypeId"
724
+ },
725
+ {
726
+ "columnName": "return_date",
727
+ "fieldName": "returnDate",
728
+ "label": "拟归还日期",
729
+ "dataType": "date",
730
+ "inputType": "date",
731
+ "dateFormat": "YYYY-MM-DD",
732
+ "required": true,
733
+ "showInTable": true,
734
+ "alwaysHide": false,
735
+ "smartSearch": false,
736
+ "tableWidth": "150",
737
+ "editableInTable": true,
738
+ "editInputType": "date"
739
+ },
740
+ {
741
+ "columnName": "create_user_id",
742
+ "fieldName": "createUserId",
743
+ "label": "填报人id",
744
+ "dataType": "varchar(64)",
745
+ "inputType": "hidden",
746
+ "required": false,
747
+ "showInTable": false,
748
+ "alwaysHide": true,
749
+ "smartSearch": false,
750
+ "tableWidth": "0",
751
+ "isSystemField": true
752
+ },
753
+ {
754
+ "columnName": "create_user",
755
+ "fieldName": "createUser",
756
+ "label": "填报人",
757
+ "dataType": "varchar(100)",
758
+ "inputType": "hidden",
759
+ "required": false,
760
+ "showInTable": false,
761
+ "alwaysHide": true,
762
+ "smartSearch": false,
763
+ "tableWidth": "0",
764
+ "isSystemField": true
765
+ },
766
+ {
767
+ "columnName": "create_pos_id",
768
+ "fieldName": "createPosId",
769
+ "label": "填报岗位id",
770
+ "dataType": "varchar(64)",
771
+ "inputType": "hidden",
772
+ "required": false,
773
+ "showInTable": false,
774
+ "alwaysHide": true,
775
+ "smartSearch": false,
776
+ "tableWidth": "0",
777
+ "isSystemField": true
778
+ },
779
+ {
780
+ "columnName": "create_pos",
781
+ "fieldName": "createPos",
782
+ "label": "填报岗位",
783
+ "dataType": "varchar(100)",
784
+ "inputType": "hidden",
785
+ "required": false,
786
+ "showInTable": false,
787
+ "alwaysHide": true,
788
+ "smartSearch": false,
789
+ "tableWidth": "0",
790
+ "isSystemField": true
791
+ },
792
+ {
793
+ "columnName": "create_dpt_id",
794
+ "fieldName": "createDptId",
795
+ "label": "填报部门id",
796
+ "dataType": "varchar(64)",
797
+ "inputType": "hidden",
798
+ "required": false,
799
+ "showInTable": false,
800
+ "alwaysHide": true,
801
+ "smartSearch": false,
802
+ "tableWidth": "0",
803
+ "isSystemField": true
804
+ },
805
+ {
806
+ "columnName": "create_dpt",
807
+ "fieldName": "createDpt",
808
+ "label": "填报部门",
809
+ "dataType": "varchar(200)",
810
+ "inputType": "hidden",
811
+ "required": false,
812
+ "showInTable": false,
813
+ "alwaysHide": true,
814
+ "smartSearch": false,
815
+ "tableWidth": "0",
816
+ "isSystemField": true
817
+ },
818
+ {
819
+ "columnName": "create_ogn_id",
820
+ "fieldName": "createOgnId",
821
+ "label": "填报单位id",
822
+ "dataType": "varchar(64)",
823
+ "inputType": "hidden",
824
+ "required": false,
825
+ "showInTable": false,
826
+ "alwaysHide": true,
827
+ "smartSearch": false,
828
+ "tableWidth": "0",
829
+ "isSystemField": true
830
+ },
831
+ {
832
+ "columnName": "create_ogn",
833
+ "fieldName": "createOgn",
834
+ "label": "填报单位",
835
+ "dataType": "varchar(200)",
836
+ "inputType": "hidden",
837
+ "required": false,
838
+ "showInTable": false,
839
+ "alwaysHide": true,
840
+ "smartSearch": false,
841
+ "tableWidth": "0",
842
+ "isSystemField": true
843
+ },
844
+ {
845
+ "columnName": "create_psm_full_id",
846
+ "fieldName": "createPsmFullId",
847
+ "label": "填报人全id",
848
+ "dataType": "varchar(500)",
849
+ "inputType": "hidden",
850
+ "required": false,
851
+ "showInTable": false,
852
+ "alwaysHide": true,
853
+ "smartSearch": false,
854
+ "tableWidth": "0",
855
+ "isSystemField": true
856
+ },
857
+ {
858
+ "columnName": "create_psm_full_name",
859
+ "fieldName": "createPsmFullName",
860
+ "label": "填报人全名称",
861
+ "dataType": "varchar(500)",
862
+ "inputType": "hidden",
863
+ "required": false,
864
+ "showInTable": false,
865
+ "alwaysHide": true,
866
+ "smartSearch": false,
867
+ "tableWidth": "0",
868
+ "isSystemField": true
869
+ },
870
+ {
871
+ "columnName": "update_psm_full_id",
872
+ "fieldName": "updatePsmFullId",
873
+ "label": "修改人全id",
874
+ "dataType": "varchar(500)",
875
+ "inputType": "hidden",
876
+ "required": false,
877
+ "showInTable": false,
878
+ "alwaysHide": true,
879
+ "smartSearch": false,
880
+ "tableWidth": "0",
881
+ "isSystemField": true
882
+ },
883
+ {
884
+ "columnName": "update_psm_full_name",
885
+ "fieldName": "updatePsmFullName",
886
+ "label": "修改人全名称",
887
+ "dataType": "varchar(500)",
888
+ "inputType": "hidden",
889
+ "required": false,
890
+ "showInTable": false,
891
+ "alwaysHide": true,
892
+ "smartSearch": false,
893
+ "tableWidth": "0",
894
+ "isSystemField": true
895
+ },
896
+ {
897
+ "columnName": "create_time",
898
+ "fieldName": "createTime",
899
+ "label": "创建时间",
900
+ "dataType": "datetime",
901
+ "inputType": "hidden",
902
+ "required": false,
903
+ "showInTable": false,
904
+ "alwaysHide": true,
905
+ "smartSearch": false,
906
+ "tableWidth": "0",
907
+ "isSystemField": true
908
+ },
909
+ {
910
+ "columnName": "update_time",
911
+ "fieldName": "updateTime",
912
+ "label": "更新时间",
913
+ "dataType": "datetime",
914
+ "inputType": "hidden",
915
+ "required": false,
916
+ "showInTable": false,
917
+ "alwaysHide": true,
918
+ "smartSearch": false,
919
+ "tableWidth": "0",
920
+ "isSystemField": true
921
+ },
922
+ {
923
+ "columnName": "tenant_id",
924
+ "fieldName": "tenantId",
925
+ "label": "租户ID",
926
+ "dataType": "varchar(64)",
927
+ "inputType": "hidden",
928
+ "required": false,
929
+ "showInTable": false,
930
+ "alwaysHide": true,
931
+ "smartSearch": false,
932
+ "tableWidth": "0",
933
+ "isSystemField": true
934
+ }
935
+ ]
936
+ }
937
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-vue-codegen",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "MCP Server for generating Vue3 CRUD module code from database table schema JSON",
5
5
  "author": "anshu",
6
6
  "main": "build/index.js",
@@ -9,6 +9,7 @@
9
9
  },
10
10
  "files": [
11
11
  "build",
12
+ "example",
12
13
  "README.md",
13
14
  "LICENSE"
14
15
  ],