worsoft-frontend-codegen-local-mcp 0.1.64 → 0.1.65
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/assets/templates/master_child_jump/form.tpl +8 -0
- package/assets/templates/master_child_jump/index.tpl +10 -0
- package/assets/templates/single_table_dialog/form.tpl +4 -0
- package/assets/templates/single_table_dialog/index.tpl +6 -0
- package/assets/templates/single_table_jump/form.tpl +7 -0
- package/assets/templates/single_table_jump/index.tpl +8 -0
- package/mcp_server.js +61 -23
- package/package.json +1 -1
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- 页面布局:{{FEATURE_TITLE}}主子表表单页 -->
|
|
2
3
|
<div class="layout-padding-auto layout-padding-view">
|
|
4
|
+
<!-- 表单卡片:承载标题、操作按钮、主表字段和子表明细 -->
|
|
3
5
|
<el-card shadow="never" class="w100">
|
|
4
6
|
<template #header>
|
|
7
|
+
<!-- 表单页头:根据新增、编辑、详情模式展示标题和按钮 -->
|
|
5
8
|
<div style="display: flex; justify-content: space-between; align-items: center;">
|
|
6
9
|
<span style="font-size: 16px; font-weight: bold;">{{ form.{{PK_ATTR}} ? (detail ? t('common.viewBtn') : t('common.editBtn')) : t('common.addBtn') }}</span>
|
|
10
|
+
<!-- 编辑模式操作按钮:保存、流转、提交、取消 -->
|
|
7
11
|
<div v-if="!detail">
|
|
8
12
|
<el-button @click="onSubmit('save')" :disabled="loading" icon="document">{{ commonActionLabel('save') }}</el-button>
|
|
9
13
|
<el-button @click="onSubmit('flow')" :disabled="loading" plain type="success" icon="position">{{ commonActionLabel('flow') }}</el-button>
|
|
@@ -11,15 +15,19 @@
|
|
|
11
15
|
<el-divider direction="vertical" />
|
|
12
16
|
<el-button @click="handleBack" icon="close">{{ t('common.cancelButtonText') }}</el-button>
|
|
13
17
|
</div>
|
|
18
|
+
<!-- 详情模式操作按钮:返回列表页 -->
|
|
14
19
|
<div v-else>
|
|
15
20
|
<el-button @click="handleBack" icon="back">{{ commonActionLabel('back') }}</el-button>
|
|
16
21
|
</div>
|
|
17
22
|
</div>
|
|
18
23
|
</template>
|
|
24
|
+
<!-- 主子表表单:按 PRD 表单显隐和顺序渲染字段 -->
|
|
19
25
|
<el-form ref="dataFormRef" :model="form" :rules="dataRules" :disabled="detail" v-loading="loading">
|
|
26
|
+
<!-- 主表字段区:字段级注释由 MCP 根据字段名称生成 -->
|
|
20
27
|
<el-row :gutter="24">
|
|
21
28
|
{{FORM_FIELDS}}
|
|
22
29
|
</el-row>
|
|
30
|
+
<!-- 子表明细区:按 children 配置渲染多个子表 -->
|
|
23
31
|
<el-row :gutter="24">
|
|
24
32
|
{{CHILD_SECTIONS}}
|
|
25
33
|
</el-row>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<!-- 功能名称:{{FEATURE_TITLE}} -->
|
|
2
2
|
<template>
|
|
3
|
+
<!-- 页面布局:{{FEATURE_TITLE}}列表页 -->
|
|
3
4
|
<div class="layout-padding">
|
|
4
5
|
<div class="layout-padding-auto layout-padding-view flex h-full flex-col">
|
|
6
|
+
<!-- 列表工具栏:搜索、新增、导入、批量删除、导出、刷新 -->
|
|
5
7
|
<SchemaListToolbar
|
|
6
8
|
v-bind="toolbarProps"
|
|
7
9
|
@update:keyword="state.queryForm.smartVal = $event"
|
|
@@ -15,6 +17,7 @@
|
|
|
15
17
|
@refresh="handleToolbarRefresh"
|
|
16
18
|
/>
|
|
17
19
|
|
|
20
|
+
<!-- 列表表格:展示{{FEATURE_TITLE}}列表数据、分页、排序和行操作 -->
|
|
18
21
|
<SchemaListTable
|
|
19
22
|
v-bind="tableProps"
|
|
20
23
|
row-id-key="{{PK_ATTR}}"
|
|
@@ -23,16 +26,23 @@
|
|
|
23
26
|
@size-change="handleTableSizeChange"
|
|
24
27
|
@current-change="handleTableCurrentChange"
|
|
25
28
|
>
|
|
29
|
+
<!-- 行操作按钮:查看、编辑、提交、流转、删除 -->
|
|
26
30
|
<template #actions="{ row }">
|
|
31
|
+
<!-- 查看{{FEATURE_TITLE}}详情 -->
|
|
27
32
|
<el-button text type="primary" icon="view" v-auth="'{{PERMISSION_PREFIX}}_view'" @click="handleDetail(row.{{PK_ATTR}})">{{ t('common.viewBtn') }}</el-button>
|
|
33
|
+
<!-- 编辑{{FEATURE_TITLE}}:业务单据编辑态控制按需生效 -->
|
|
28
34
|
<el-button{{BUSINESS_EDIT_IF}} icon="edit-pen" text type="primary" v-auth="'{{PERMISSION_PREFIX}}_edit'" @click="handleEdit(row.{{PK_ATTR}})">{{ t('common.editBtn') }}</el-button>
|
|
35
|
+
<!-- 提交{{FEATURE_TITLE}} -->
|
|
29
36
|
<el-button text type="primary" icon="check" @click="handleQuickAction(row, 'submit')">{{ commonActionLabel('submit') }}</el-button>
|
|
37
|
+
<!-- 流转{{FEATURE_TITLE}} -->
|
|
30
38
|
<el-button text type="success" icon="position" @click="handleQuickAction(row, 'flow')">{{ commonActionLabel('flow') }}</el-button>
|
|
39
|
+
<!-- 删除{{FEATURE_TITLE}} -->
|
|
31
40
|
<el-button icon="delete" text type="primary" v-auth="'{{PERMISSION_PREFIX}}_del'" @click="handleDelete([row.{{PK_ATTR}}])">{{ t('common.delBtn') }}</el-button>
|
|
32
41
|
</template>
|
|
33
42
|
</SchemaListTable>
|
|
34
43
|
</div>
|
|
35
44
|
|
|
45
|
+
<!-- Excel 导入组件:导入{{FEATURE_TITLE}}列表数据 -->
|
|
36
46
|
<upload-excel ref="excelUploadRef" :title="t('common.importBtn')" url="/{{API_PATH}}/import" temp-url="/admin/sys-file/local/file/{{FUNCTION_NAME}}.xlsx" @refreshDataList="getDataList" />
|
|
37
47
|
</div>
|
|
38
48
|
</template>
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- 表单弹窗:新增或编辑{{FEATURE_TITLE}}数据 -->
|
|
2
3
|
<el-dialog v-model="visible" :title="form.{{PK_ATTR}} ? t('common.editBtn') : t('common.addBtn')" :close-on-click-modal="false" draggable>
|
|
4
|
+
<!-- 弹窗表单:按 PRD 表单显隐和顺序渲染字段 -->
|
|
3
5
|
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="100px" v-loading="loading">
|
|
6
|
+
<!-- 主表字段区:字段级注释由 MCP 根据字段名称生成 -->
|
|
4
7
|
<el-row :gutter="24">
|
|
5
8
|
{{FORM_FIELDS}}
|
|
6
9
|
</el-row>
|
|
7
10
|
</el-form>
|
|
11
|
+
<!-- 弹窗底部操作按钮:取消和确认提交 -->
|
|
8
12
|
<template #footer>
|
|
9
13
|
<span class="dialog-footer">
|
|
10
14
|
<el-button @click="visible = false">{{ t('common.cancelButtonText') }}</el-button>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<!-- 功能名称:{{FEATURE_TITLE}} -->
|
|
2
2
|
<template>
|
|
3
|
+
<!-- 页面布局:{{FEATURE_TITLE}}列表页 -->
|
|
3
4
|
<div class="layout-padding">
|
|
4
5
|
<div class="layout-padding-auto layout-padding-view flex h-full flex-col">
|
|
6
|
+
<!-- 列表工具栏:搜索、新增、导入、批量删除、导出、刷新 -->
|
|
5
7
|
<SchemaListToolbar
|
|
6
8
|
v-bind="toolbarProps"
|
|
7
9
|
@update:keyword="state.queryForm.smartVal = $event"
|
|
@@ -15,6 +17,7 @@
|
|
|
15
17
|
@refresh="handleToolbarRefresh"
|
|
16
18
|
/>
|
|
17
19
|
|
|
20
|
+
<!-- 列表表格:展示{{FEATURE_TITLE}}列表数据、分页、排序和行操作 -->
|
|
18
21
|
<SchemaListTable
|
|
19
22
|
v-bind="tableProps"
|
|
20
23
|
row-id-key="{{PK_ATTR}}"
|
|
@@ -24,13 +27,16 @@
|
|
|
24
27
|
@size-change="handleTableSizeChange"
|
|
25
28
|
@current-change="handleTableCurrentChange"
|
|
26
29
|
>
|
|
30
|
+
<!-- 行操作按钮:编辑、删除、启用、禁用 -->
|
|
27
31
|
<template #actions="{ row }">
|
|
28
32
|
{{LIST_ACTIONS}}
|
|
29
33
|
</template>
|
|
30
34
|
</SchemaListTable>
|
|
31
35
|
</div>
|
|
32
36
|
|
|
37
|
+
<!-- 表单弹窗组件:新增和编辑{{FEATURE_TITLE}}数据 -->
|
|
33
38
|
<form-dialog ref="formDialogRef" @refresh="getDataList(false)" />
|
|
39
|
+
<!-- Excel 导入组件:导入{{FEATURE_TITLE}}列表数据 -->
|
|
34
40
|
<upload-excel ref="excelUploadRef" :title="t('common.importBtn')" url="/{{API_PATH}}/import" temp-url="/admin/sys-file/local/file/{{FUNCTION_NAME}}.xlsx" @refreshDataList="getDataList" />
|
|
35
41
|
</div>
|
|
36
42
|
</template>
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
<template>
|
|
2
|
+
<!-- 页面布局:{{FEATURE_TITLE}}表单页 -->
|
|
2
3
|
<div class="layout-padding-auto layout-padding-view">
|
|
4
|
+
<!-- 表单卡片:承载标题、操作按钮和主表字段 -->
|
|
3
5
|
<el-card shadow="never" class="w100">
|
|
4
6
|
<template #header>
|
|
7
|
+
<!-- 表单页头:根据新增、编辑、详情模式展示标题和按钮 -->
|
|
5
8
|
<div style="display: flex; justify-content: space-between; align-items: center;">
|
|
6
9
|
<span style="font-size: 16px; font-weight: bold;">{{ form.{{PK_ATTR}} ? (detail ? t('common.viewBtn') : t('common.editBtn')) : t('common.addBtn') }}</span>
|
|
10
|
+
<!-- 编辑模式操作按钮:保存、流转、提交、取消 -->
|
|
7
11
|
<div v-if="!detail">
|
|
8
12
|
<el-button @click="onSubmit('save')" :disabled="loading" icon="document">{{ commonActionLabel('save') }}</el-button>
|
|
9
13
|
<el-button @click="onSubmit('flow')" :disabled="loading" plain type="success" icon="position">{{ commonActionLabel('flow') }}</el-button>
|
|
@@ -11,12 +15,15 @@
|
|
|
11
15
|
<el-divider direction="vertical" />
|
|
12
16
|
<el-button @click="handleBack" icon="close">{{ t('common.cancelButtonText') }}</el-button>
|
|
13
17
|
</div>
|
|
18
|
+
<!-- 详情模式操作按钮:返回列表页 -->
|
|
14
19
|
<div v-else>
|
|
15
20
|
<el-button @click="handleBack" icon="back">{{ commonActionLabel('back') }}</el-button>
|
|
16
21
|
</div>
|
|
17
22
|
</div>
|
|
18
23
|
</template>
|
|
24
|
+
<!-- 主表表单:按 PRD 表单显隐和顺序渲染字段 -->
|
|
19
25
|
<el-form ref="dataFormRef" :model="form" :rules="dataRules" :disabled="detail" v-loading="loading">
|
|
26
|
+
<!-- 主表字段区:字段级注释由 MCP 根据字段名称生成 -->
|
|
20
27
|
<el-row :gutter="24">
|
|
21
28
|
{{FORM_FIELDS}}
|
|
22
29
|
</el-row>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<!-- 功能名称:{{FEATURE_TITLE}} -->
|
|
2
2
|
<template>
|
|
3
|
+
<!-- 页面布局:{{FEATURE_TITLE}}列表页 -->
|
|
3
4
|
<div class="layout-padding">
|
|
4
5
|
<div class="layout-padding-auto layout-padding-view flex h-full flex-col">
|
|
6
|
+
<!-- 列表工具栏:搜索、新增、导入、批量删除、导出、刷新 -->
|
|
5
7
|
<SchemaListToolbar
|
|
6
8
|
v-bind="toolbarProps"
|
|
7
9
|
@update:keyword="state.queryForm.smartVal = $event"
|
|
@@ -15,6 +17,7 @@
|
|
|
15
17
|
@refresh="handleToolbarRefresh"
|
|
16
18
|
/>
|
|
17
19
|
|
|
20
|
+
<!-- 列表表格:展示{{FEATURE_TITLE}}列表数据、分页、排序和行操作 -->
|
|
18
21
|
<SchemaListTable
|
|
19
22
|
v-bind="tableProps"
|
|
20
23
|
row-id-key="{{PK_ATTR}}"
|
|
@@ -24,14 +27,19 @@
|
|
|
24
27
|
@size-change="handleTableSizeChange"
|
|
25
28
|
@current-change="handleTableCurrentChange"
|
|
26
29
|
>
|
|
30
|
+
<!-- 行操作按钮:查看、编辑、删除 -->
|
|
27
31
|
<template #actions="{ row }">
|
|
32
|
+
<!-- 查看{{FEATURE_TITLE}}详情 -->
|
|
28
33
|
<el-button text type="primary" icon="view" v-auth="'{{PERMISSION_PREFIX}}_view'" @click="handleDetail(row.{{PK_ATTR}})">{{ t('common.viewBtn') }}</el-button>
|
|
34
|
+
<!-- 编辑{{FEATURE_TITLE}}:业务单据编辑态控制按需生效 -->
|
|
29
35
|
<el-button{{BUSINESS_EDIT_IF}} icon="edit-pen" text type="primary" v-auth="'{{PERMISSION_PREFIX}}_edit'" @click="handleEdit(row.{{PK_ATTR}})">{{ t('common.editBtn') }}</el-button>
|
|
36
|
+
<!-- 删除{{FEATURE_TITLE}} -->
|
|
30
37
|
<el-button icon="delete" text type="primary" v-auth="'{{PERMISSION_PREFIX}}_del'" @click="handleDelete([row.{{PK_ATTR}}])">{{ t('common.delBtn') }}</el-button>
|
|
31
38
|
</template>
|
|
32
39
|
</SchemaListTable>
|
|
33
40
|
</div>
|
|
34
41
|
|
|
42
|
+
<!-- Excel 导入组件:导入{{FEATURE_TITLE}}列表数据 -->
|
|
35
43
|
<upload-excel ref="excelUploadRef" :title="t('common.importBtn')" url="/{{API_PATH}}/import" temp-url="/admin/sys-file/local/file/{{FUNCTION_NAME}}.xlsx" @refreshDataList="getDataList" />
|
|
36
44
|
</div>
|
|
37
45
|
</template>
|
package/mcp_server.js
CHANGED
|
@@ -5,7 +5,7 @@ const fs = require('fs');
|
|
|
5
5
|
const path = require('path');
|
|
6
6
|
|
|
7
7
|
const SERVER_NAME = 'worsoft-codegen-local';
|
|
8
|
-
const SERVER_VERSION = '0.1.
|
|
8
|
+
const SERVER_VERSION = '0.1.65';
|
|
9
9
|
const PROTOCOL_VERSION = '2024-11-05';
|
|
10
10
|
const TOOL_NAME = 'worsoft_codegen_local_generate_frontend';
|
|
11
11
|
const STYLE_CATALOG_PATH = path.join(__dirname, 'assets', 'style-catalog.json');
|
|
@@ -1956,10 +1956,12 @@ function renderChildSection(childModel, childCount) {
|
|
|
1956
1956
|
|
|
1957
1957
|
return [
|
|
1958
1958
|
' <el-col :span="24" class="mb20">',
|
|
1959
|
+
` <!-- 子表区域:${sanitizeHtmlComment(childModel.comment || childModel.tableName)} -->`,
|
|
1959
1960
|
` <div class="mb10" style="font-weight: 600;">{{ childSectionTitle('${childModel.listName}') }}</div>`,
|
|
1961
|
+
' <!-- 子表编辑表格:支持新增行、删除行和行内字段编辑 -->',
|
|
1960
1962
|
` <sc-form-table v-model="form.${childModel.listName}" :addTemplate="childTemp${childModel.className}" @delete="(obj) => ${deleteExpression}" :placeholder="t('common.noData')">`,
|
|
1961
1963
|
childModel.visibleFields.map((field) => renderChildTableColumn(field, childModel.listName)).join('\n'),
|
|
1962
|
-
' </sc-form-table>',
|
|
1964
|
+
' </sc-form-table>',
|
|
1963
1965
|
' </el-col>',
|
|
1964
1966
|
].join('\n');
|
|
1965
1967
|
}
|
|
@@ -2504,14 +2506,18 @@ function renderMultiLevelFormVue(model, moduleModel) {
|
|
|
2504
2506
|
].join('\n');
|
|
2505
2507
|
const rules = renderFormRulesV2(moduleModel.visibleFields);
|
|
2506
2508
|
return `<template>
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2509
|
+
<!-- 表单弹窗:新增或编辑${sanitizeHtmlComment(moduleModel.comment || moduleModel.tableName)}数据 -->
|
|
2510
|
+
<el-dialog v-model="visible" :title="form.${moduleModel.pk.attrName} ? t('common.editBtn') : t('common.addBtn')" :close-on-click-modal="false" draggable>
|
|
2511
|
+
<!-- 弹窗表单:按 PRD 表单显隐和顺序渲染字段 -->
|
|
2512
|
+
<el-form ref="dataFormRef" :model="form" :rules="dataRules" label-width="100px" v-loading="loading">
|
|
2513
|
+
<!-- 字典字段区:字段级注释由 MCP 根据字段名称生成 -->
|
|
2514
|
+
<el-row :gutter="24">
|
|
2515
|
+
${moduleModel.visibleFields.map(renderMultiLevelFormField).join('\n')}
|
|
2516
|
+
</el-row>
|
|
2517
|
+
</el-form>
|
|
2518
|
+
<!-- 弹窗底部操作按钮:取消和确认提交 -->
|
|
2519
|
+
<template #footer>
|
|
2520
|
+
<span class="dialog-footer">
|
|
2515
2521
|
<el-button @click="visible = false">{{ t('common.cancelButtonText') }}</el-button>
|
|
2516
2522
|
<el-button type="primary" @click="onSubmit" :disabled="loading">{{ t('common.confirmButtonText') }}</el-button>
|
|
2517
2523
|
</span>
|
|
@@ -2642,11 +2648,14 @@ ${moduleModel.visibleFields.map(renderMultiLevelFormField).join('\n')}
|
|
|
2642
2648
|
function renderMultiLevelSchemaListSlot(levelVarName, activeKeyVarName, activeModuleVarName) {
|
|
2643
2649
|
return [
|
|
2644
2650
|
` <div class="multi-level-slot" v-if="${levelVarName}">`,
|
|
2651
|
+
' <!-- 多层字典页签:切换当前层级下的字典模块 -->',
|
|
2645
2652
|
' <el-tabs class="multi-level-tabs" v-if="' + `${levelVarName}.moduleKeys.length > 1` + `" v-model="${activeKeyVarName}">`,
|
|
2646
2653
|
` <el-tab-pane v-for="moduleKey in ${levelVarName}.moduleKeys" :key="moduleKey" :label="resolveModuleTitle(moduleConfigs[moduleKey])" :name="moduleKey" />`,
|
|
2647
2654
|
' </el-tabs>',
|
|
2655
|
+
' <!-- 多层字典列表面板:承载当前层级的工具栏和表格 -->',
|
|
2648
2656
|
' <div class="multi-level-panel" v-if="' + `${activeModuleVarName}` + `">`,
|
|
2649
2657
|
' <div class="layout-padding-auto layout-padding-view flex h-full flex-col">',
|
|
2658
|
+
' <!-- 当前层级工具栏:搜索、新增和重置 -->',
|
|
2650
2659
|
` <SchemaListToolbar`,
|
|
2651
2660
|
` v-bind="getPanelToolbarProps(${activeModuleVarName}.key)"`,
|
|
2652
2661
|
` @update:keyword="handlePanelKeywordChange(${activeModuleVarName}.key, $event)"`,
|
|
@@ -2654,16 +2663,22 @@ function renderMultiLevelSchemaListSlot(levelVarName, activeKeyVarName, activeMo
|
|
|
2654
2663
|
` @query="handlePanelQuery(${activeModuleVarName}.key)"`,
|
|
2655
2664
|
` @reset="handlePanelReset(${activeModuleVarName}.key)"`,
|
|
2656
2665
|
` />`,
|
|
2666
|
+
' <!-- 当前层级表格:展示字典数据、分页和行操作 -->',
|
|
2657
2667
|
` <SchemaListTable`,
|
|
2658
2668
|
` v-bind="getPanelTableProps(${activeModuleVarName}.key)"`,
|
|
2659
2669
|
` @row-current-change="handlePanelCurrentChange(${activeModuleVarName}.key, $event.row)"`,
|
|
2660
2670
|
` @current-change="handleCurrentPageChange(${activeModuleVarName}.key, $event.current)"`,
|
|
2661
2671
|
` @size-change="handlePageSizeChange(${activeModuleVarName}.key, $event.size)"`,
|
|
2662
2672
|
` >`,
|
|
2673
|
+
' <!-- 行操作按钮:编辑、删除、启用、禁用 -->',
|
|
2663
2674
|
` <template #actions="{ row }">`,
|
|
2675
|
+
' <!-- 编辑当前字典数据 -->',
|
|
2664
2676
|
` <el-button v-if="showModuleAction(${activeModuleVarName}.key, 'edit', row)" icon="edit-pen" text type="primary" @click="openEdit(${activeModuleVarName}.key, row)">{{ t('common.editBtn') }}</el-button>`,
|
|
2677
|
+
' <!-- 删除当前字典数据 -->',
|
|
2665
2678
|
` <el-button v-if="showModuleAction(${activeModuleVarName}.key, 'delete', row)" icon="delete" text type="primary" @click="handleDelete(${activeModuleVarName}.key, row)">{{ t('common.delBtn') }}</el-button>`,
|
|
2679
|
+
' <!-- 启用当前字典数据 -->',
|
|
2666
2680
|
` <el-button v-if="showModuleAction(${activeModuleVarName}.key, 'enable', row)" icon="circle-check" text type="primary" @click="handleEnable(${activeModuleVarName}.key, row)">闁告凹鍨抽弫?/el-button>`,
|
|
2681
|
+
' <!-- 禁用当前字典数据 -->',
|
|
2667
2682
|
` <el-button v-if="showModuleAction(${activeModuleVarName}.key, 'disable', row)" icon="remove" text type="primary" @click="handleDisable(${activeModuleVarName}.key, row)">缂佸倷鑳堕弫?/el-button>`,
|
|
2668
2683
|
` </template>`,
|
|
2669
2684
|
` </SchemaListTable>`,
|
|
@@ -2676,14 +2691,18 @@ function renderMultiLevelSchemaListSlot(levelVarName, activeKeyVarName, activeMo
|
|
|
2676
2691
|
function renderMultiLevelLevelSlot(levelVarName, activeKeyVarName, activeModuleVarName) {
|
|
2677
2692
|
return [
|
|
2678
2693
|
` <div class="multi-level-slot" v-if="${levelVarName}">`,
|
|
2694
|
+
' <!-- 多层字典页签:切换当前层级下的字典模块 -->',
|
|
2679
2695
|
' <el-tabs class="multi-level-tabs" v-if="' + `${levelVarName}.moduleKeys.length > 1` + `" v-model="${activeKeyVarName}">`,
|
|
2680
2696
|
` <el-tab-pane v-for="moduleKey in ${levelVarName}.moduleKeys" :key="moduleKey" :label="resolveModuleTitle(moduleConfigs[moduleKey])" :name="moduleKey" />`,
|
|
2681
2697
|
' </el-tabs>',
|
|
2698
|
+
' <!-- 多层字典列表面板:承载当前层级的新增按钮、表格和分页 -->',
|
|
2682
2699
|
' <div class="multi-level-panel" v-if="' + `${activeModuleVarName}` + `">`,
|
|
2683
2700
|
' <div class="layout-padding-auto layout-padding-view flex h-full flex-col">',
|
|
2701
|
+
' <!-- 当前层级新增按钮:受父级状态约束控制 -->',
|
|
2684
2702
|
' <div class="mb8" style="width: 100%">',
|
|
2685
2703
|
` <el-button icon="folder-add" type="primary" class="ml10" :disabled="isAddDisabled(${activeModuleVarName}.key)" @click="openCreate(${activeModuleVarName}.key)">{{ t('common.addBtn') }}</el-button>`,
|
|
2686
2704
|
' </div>',
|
|
2705
|
+
' <!-- 当前层级表格:展示字典数据并处理行选中联动 -->',
|
|
2687
2706
|
' <el-table',
|
|
2688
2707
|
` :data="moduleStateMap[${activeModuleVarName}.key].dataList"`,
|
|
2689
2708
|
` v-loading="moduleStateMap[${activeModuleVarName}.key].loading"`,
|
|
@@ -2692,7 +2711,9 @@ function renderMultiLevelLevelSlot(levelVarName, activeKeyVarName, activeModuleV
|
|
|
2692
2711
|
' highlight-current-row',
|
|
2693
2712
|
` @current-change="handlePanelCurrentChange(${activeModuleVarName}.key, $event)"`,
|
|
2694
2713
|
' >',
|
|
2714
|
+
' <!-- 序号列 -->',
|
|
2695
2715
|
` <el-table-column type="index" :label="t('common.serial')" width="60" />`,
|
|
2716
|
+
' <!-- 字典业务字段列 -->',
|
|
2696
2717
|
` <el-table-column`,
|
|
2697
2718
|
` v-for="column in getListFields(${activeModuleVarName}.key)"`,
|
|
2698
2719
|
' :key="column.key"',
|
|
@@ -2706,15 +2727,21 @@ function renderMultiLevelLevelSlot(levelVarName, activeKeyVarName, activeModuleV
|
|
|
2706
2727
|
' <span v-else>{{ scope.row[column.key] }}</span>',
|
|
2707
2728
|
' </template>',
|
|
2708
2729
|
' </el-table-column>',
|
|
2730
|
+
' <!-- 行操作按钮:编辑、删除、启用、禁用 -->',
|
|
2709
2731
|
` <el-table-column :label="t('common.action')" width="260">`,
|
|
2710
2732
|
' <template #default="{ row }">',
|
|
2733
|
+
' <!-- 编辑当前字典数据 -->',
|
|
2711
2734
|
` <el-button v-if="showModuleAction(${activeModuleVarName}.key, 'edit', row)" icon="edit-pen" text type="primary" @click="openEdit(${activeModuleVarName}.key, row)">{{ t('common.editBtn') }}</el-button>`,
|
|
2735
|
+
' <!-- 删除当前字典数据 -->',
|
|
2712
2736
|
` <el-button v-if="showModuleAction(${activeModuleVarName}.key, 'delete', row)" icon="delete" text type="primary" @click="handleDelete(${activeModuleVarName}.key, row)">{{ t('common.delBtn') }}</el-button>`,
|
|
2737
|
+
' <!-- 启用当前字典数据 -->',
|
|
2713
2738
|
` <el-button v-if="showModuleAction(${activeModuleVarName}.key, 'enable', row)" icon="circle-check" text type="primary" @click="handleEnable(${activeModuleVarName}.key, row)">{{ t('common.actions.enable') }}</el-button>`,
|
|
2739
|
+
' <!-- 禁用当前字典数据 -->',
|
|
2714
2740
|
` <el-button v-if="showModuleAction(${activeModuleVarName}.key, 'disable', row)" icon="remove" text type="primary" @click="handleDisable(${activeModuleVarName}.key, row)">{{ t('common.actions.disable') }}</el-button>`,
|
|
2715
2741
|
' </template>',
|
|
2716
2742
|
' </el-table-column>',
|
|
2717
2743
|
' </el-table>',
|
|
2744
|
+
' <!-- 当前层级分页组件 -->',
|
|
2718
2745
|
' <div class="mt-2.5 flex shrink-0 justify-end">',
|
|
2719
2746
|
' <pagination',
|
|
2720
2747
|
` :current-page="moduleStateMap[${activeModuleVarName}.key].currentPage"`,
|
|
@@ -2766,24 +2793,31 @@ function renderMultiLevelIndexVue(model) {
|
|
|
2766
2793
|
|
|
2767
2794
|
return `<!-- 功能名称:${sanitizeHtmlComment(model.featureTitle)} -->
|
|
2768
2795
|
<template>
|
|
2796
|
+
<!-- 页面布局:${sanitizeHtmlComment(model.featureTitle)}多层字典列表页 -->
|
|
2769
2797
|
<div class="layout-padding">
|
|
2798
|
+
<!-- 多层字典主布局:左侧一级字典,右侧二级和三级字典联动 -->
|
|
2770
2799
|
<div class="multi-level-dict-layout">
|
|
2771
|
-
|
|
2800
|
+
<!-- 一级字典区域 -->
|
|
2801
|
+
<div class="multi-level-left">
|
|
2772
2802
|
${renderMultiLevelSchemaListSlot('level1Config', 'activeLevel1Key', 'activeLevel1Module')}
|
|
2773
|
-
</div>
|
|
2774
|
-
|
|
2775
|
-
|
|
2803
|
+
</div>
|
|
2804
|
+
<!-- 二级和三级字典区域 -->
|
|
2805
|
+
<div class="multi-level-right">
|
|
2806
|
+
<!-- 二级字典区域 -->
|
|
2807
|
+
<div class="multi-level-right-top">
|
|
2776
2808
|
${level2 ? renderMultiLevelSchemaListSlot('level2Config', 'activeLevel2Key', 'activeLevel2Module') : ''}
|
|
2777
|
-
</div>
|
|
2778
|
-
|
|
2809
|
+
</div>
|
|
2810
|
+
<!-- 三级字典区域 -->
|
|
2811
|
+
<div v-if="level3Config" class="multi-level-right-bottom">
|
|
2779
2812
|
${level3 ? renderMultiLevelSchemaListSlot('level3Config', 'activeLevel3Key', 'activeLevel3Module') : ''}
|
|
2780
|
-
</div>
|
|
2781
|
-
</div>
|
|
2782
|
-
</div>
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
</
|
|
2813
|
+
</div>
|
|
2814
|
+
</div>
|
|
2815
|
+
</div>
|
|
2816
|
+
|
|
2817
|
+
<!-- 多层字典表单弹窗:按模块异步挂载 -->
|
|
2818
|
+
${formComponents}
|
|
2819
|
+
</div>
|
|
2820
|
+
</template>
|
|
2787
2821
|
|
|
2788
2822
|
<script setup lang="ts" name="system${model.className}">
|
|
2789
2823
|
// 通用消息与确认弹窗
|
|
@@ -3055,11 +3089,15 @@ function renderSingleTableDialogActions(model, permissionPrefix) {
|
|
|
3055
3089
|
const pkAttr = model.pk.attrName;
|
|
3056
3090
|
const isDictWithStatus = model.pageType === 'dict' && model.statusField;
|
|
3057
3091
|
const lines = [
|
|
3092
|
+
` <!-- 编辑${sanitizeHtmlComment(model.featureTitle)} -->`,
|
|
3058
3093
|
` <el-button${isDictWithStatus ? ` v-if="showDictAction('edit', row)"` : ''} icon="edit-pen" text type="primary" v-auth="'${permissionPrefix}_edit'" @click="formDialogRef.openDialog(row.${pkAttr})">{{ t('common.editBtn') }}</el-button>`,
|
|
3094
|
+
` <!-- 删除${sanitizeHtmlComment(model.featureTitle)} -->`,
|
|
3059
3095
|
` <el-button${isDictWithStatus ? ` v-if="showDictAction('delete', row)"` : ''} icon="delete" text type="primary" v-auth="'${permissionPrefix}_del'" @click="handleDelete([row.${pkAttr}])">{{ t('common.delBtn') }}</el-button>`,
|
|
3060
3096
|
];
|
|
3061
3097
|
if (isDictWithStatus) {
|
|
3098
|
+
lines.push(` <!-- 启用${sanitizeHtmlComment(model.featureTitle)} -->`);
|
|
3062
3099
|
lines.push(` <el-button v-if="showDictAction('enable', row)" icon="circle-check" text type="primary" @click="handleEnable(row.${pkAttr})">{{ t('common.actions.enable') }}</el-button>`);
|
|
3100
|
+
lines.push(` <!-- 禁用${sanitizeHtmlComment(model.featureTitle)} -->`);
|
|
3063
3101
|
lines.push(` <el-button v-if="showDictAction('disable', row)" icon="remove" text type="primary" @click="handleDisable(row.${pkAttr})">{{ t('common.actions.disable') }}</el-button>`);
|
|
3064
3102
|
}
|
|
3065
3103
|
return lines.join('\n');
|
package/package.json
CHANGED