Skip to content

Commit

Permalink
feat: 支持导出表格复制,优化增加方法页面。
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelmaxQm committed Dec 8, 2024
1 parent 6f61565 commit 31cfdac
Show file tree
Hide file tree
Showing 2 changed files with 91 additions and 45 deletions.
103 changes: 59 additions & 44 deletions web/src/view/systemTools/autoCodeAdmin/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -148,49 +148,64 @@
:model="autoFunc"
label-width="80px"
>
<el-form-item label="包名:">
<el-input
v-model="autoFunc.package"
placeholder="请输入包名"
disabled
/>
</el-form-item>
<el-form-item label="结构体名:">
<el-input
v-model="autoFunc.structName"
placeholder="请输入结构体名"
disabled
/>
</el-form-item>
<el-form-item label="前端文件名:">
<el-input
v-model="autoFunc.packageName"
placeholder="请输入文件名"
disabled
/>
</el-form-item>
<el-form-item label="后端文件名:">
<el-input
v-model="autoFunc.humpPackageName"
placeholder="请输入文件名"
disabled
/>
</el-form-item>
<el-form-item label="描述:">
<el-input
v-model="autoFunc.description"
placeholder="请输入描述"
disabled
/>
</el-form-item>
<el-form-item label="缩写:">
<el-input
v-model="autoFunc.abbreviation"
placeholder="请输入缩写"
disabled
/>
</el-form-item>

<el-row :gutter="12">
<el-col :span="8">
<el-form-item label="包名:">
<el-input
v-model="autoFunc.package"
placeholder="请输入包名"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="结构体名:">
<el-input
v-model="autoFunc.structName"
placeholder="请输入结构体名"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="前端文件名:">
<el-input
v-model="autoFunc.packageName"
placeholder="请输入文件名"
disabled
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="12">
<el-col :span="8">
<el-form-item label="后端文件名:">
<el-input
v-model="autoFunc.humpPackageName"
placeholder="请输入文件名"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="描述:">
<el-input
v-model="autoFunc.description"
placeholder="请输入描述"
disabled
/>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="缩写:">
<el-input
v-model="autoFunc.abbreviation"
placeholder="请输入缩写"
disabled
/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="是否AI填充:">
<el-switch v-model="autoFunc.isAi" />
<span class="text-sm text-red-600 p-2"
Expand Down Expand Up @@ -378,7 +393,7 @@
funcFlag.value = true
}
const funcFlag = ref(false)
const funcFlag = ref(true)
const closeFunc = () => {
funcFlag.value = false
Expand Down
33 changes: 32 additions & 1 deletion web/src/view/systemTools/exportTemplate/exportTemplate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,18 @@
label="模板信息"
prop="templateInfo"
min-width="120"
show-overflow-tooltip
/>
<el-table-column align="left" label="操作" min-width="120">
<el-table-column align="left" label="操作" min-width="280">
<template #default="scope">
<el-button
type="primary"
link
icon="documentCopy"
class="table-button"
@click="copyFunc(scope.row)"
>复制</el-button
>
<el-button
type="primary"
link
Expand Down Expand Up @@ -834,6 +843,28 @@ JOINS模式下不支持导入
// 行为控制标记(弹窗内部需要增还是改)
const type = ref('')
// 复制
const copyFunc = async (row) => {
let copyData
const res = await findSysExportTemplate({ ID: row.ID })
if (res.code === 0) {
copyData = JSON.parse(JSON.stringify(res.data.resysExportTemplate))
if (!copyData.conditions) {
copyData.conditions = []
}
if (!copyData.joinTemplate) {
copyData.joinTemplate = []
}
delete copyData.ID
delete copyData.CreatedAt
delete copyData.UpdatedAt
copyData.templateID = copyData.templateID + '_copy'
copyData.name = copyData.name + '_copy'
formData.value = copyData
dialogFormVisible.value = true
}
}
// 更新行
const updateSysExportTemplateFunc = async (row) => {
const res = await findSysExportTemplate({ ID: row.ID })
Expand Down

0 comments on commit 31cfdac

Please sign in to comment.