优化代码生成模板

This commit is contained in:
不做码农
2023-05-18 18:29:49 +08:00
parent 07ea3d1c48
commit 01e7fbd94f
10 changed files with 32 additions and 39 deletions

View File

@@ -1,10 +1,7 @@
<!--
* @Descripttion: (${genTable.functionName}/${genTable.tableName})
* @version: (1.0)
* @Author: (${replaceDto.Author})
* @Date: (${replaceDto.AddTime})
* @LastEditors: (${replaceDto.Author})
* @LastEditTime: (${replaceDto.AddTime})
-->
<template>
<div>
@@ -70,7 +67,7 @@ $end
<el-col :span="1.5">
<el-button type="info" plain icon="sort" @click="toggleExpandAll">展开/折叠</el-button>
</el-col>
$if(replaceDto.ShowBtnDelete)
$if(replaceDto.ShowBtnMultiDel)
<el-col :span="1.5">
<el-button type="danger" :disabled="multiple" v-hasPermi="['${replaceDto.PermissionPrefix}:delete']" plain icon="delete" @click="handleDelete">
{{ ${t}t('btn.delete') }}
@@ -295,7 +292,11 @@ $end
</template>
<script setup name="${genTable.BusinessName.ToLower()}">
import { treelist${genTable.BusinessName}, list${genTable.BusinessName}, add${genTable.BusinessName}, del${genTable.BusinessName}, update${genTable.BusinessName}, get${genTable.BusinessName},
import { treelist${genTable.BusinessName}, list${genTable.BusinessName},
$if(replaceDto.ShowBtnAdd) add${genTable.BusinessName}, $end
$if(replaceDto.ShowBtnDelete || replaceDto.ShowBtnMultiDel)del${genTable.BusinessName},$end
$if(replaceDto.ShowBtnEdit) update${genTable.BusinessName},$end
get${genTable.BusinessName},
$if(showCustomInput) changeSort $end } from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
$if(replaceDto.ShowEditor == 1)
import Editor from '@/components/Editor'

View File

@@ -1,10 +1,7 @@
<!--
* @Descripttion: (${genTable.functionName}/${genTable.tableName})
* @version: (1.0)
* @Author: (${replaceDto.Author})
* @Date: (${replaceDto.AddTime})
* @LastEditors: (${replaceDto.Author})
* @LastEditTime: (${replaceDto.AddTime})
-->
<template>
<div>
@@ -340,8 +337,12 @@ $end
</template>
<script setup name="${genTable.BusinessName.ToLower()}">
import { list${genTable.BusinessName}, add${genTable.BusinessName}, del${genTable.BusinessName}, update${genTable.BusinessName}, get${genTable.BusinessName},
$if(replaceDto.ShowBtnTruncate) clear${genTable.BusinessName}, $end
import { list${genTable.BusinessName},
$if(replaceDto.ShowBtnAdd) add${genTable.BusinessName}, $end
$if(replaceDto.ShowBtnDelete || replaceDto.ShowBtnMultiDel)del${genTable.BusinessName},$end
$if(replaceDto.ShowBtnEdit) update${genTable.BusinessName},$end
get${genTable.BusinessName},
$if(replaceDto.ShowBtnTruncate) clear${genTable.BusinessName}, $end
$if(showCustomInput) changeSort $end }
from '@/api/${tool.FirstLowerCase(genTable.ModuleName)}/${genTable.BusinessName.ToLower()}.js'
$if(replaceDto.ShowEditor == 1)
@@ -349,7 +350,6 @@ import Editor from '@/components/Editor'
$end
const { proxy } = getCurrentInstance()
// 选中${replaceDto.FistLowerPk}数组
const ids = ref([])
const loading = ref(false)
const showSearch = ref(true)