初始化本地仓库

This commit is contained in:
2026-08-31 11:33:59 +08:00
commit 663f74b633
2390 changed files with 402918 additions and 0 deletions
@@ -0,0 +1,10 @@
import BaseService from '@/api/core/base';
import type {{row_type_name}} from './types';
const baseUrl = '{base_url}';
export const {class_name}Service = {
...BaseService<{row_type_name}>({ baseUrl }),
};
export default {class_name}Service;
@@ -0,0 +1,3 @@
export interface {row_type_name} {
{fields}
}
@@ -0,0 +1,34 @@
{
"{module_name}": {
"common": {
"columns": {
"index": "序号"
}
},
"modules": {
"{dummy_class_name}": {
"title": "{class_name_comment}",
"search": {
"keywords": "关键字",
"keywords_placeholder": "请输入{class_name_comment}关键字"
},
"form": {
"create": "新增{class_name_comment}",
"edit": "编辑{class_name_comment}",
"view": "查看{class_name_comment}"
},
"messages": {
"create_success": "{class_name_comment}创建成功",
"create_fail": "{class_name_comment}创建失败",
"update_success": "{class_name_comment}更新成功",
"update_fail": "{class_name_comment}更新失败",
"delete_success": "{class_name_comment}删除成功",
"delete_fail": "{class_name_comment}删除失败"
},
"columns": {
{fields}
}
}
}
}
}
@@ -0,0 +1,26 @@
<template>
<div class="{kebab_module_name}-{kebab_class_name}-page art-full-height">
<BasicCrud />
</div>
</template>
<script setup lang="tsx">
import { useCrud } from '@/components/crud'
import { crudSchema } from './schemas'
defineOptions({ name: '{class_name}List' })
const [BasicCrud] = useCrud({
...crudSchema(),
toolbarActions: [],
dropDownToolbarActions: [],
tableActions: [],
dropDownActions: [],
})
</script>
<style scoped>
.{kebab_module_name}-{kebab_class_name}-page {
height: 100%;
}
</style>
@@ -0,0 +1,56 @@
import { CrudSchema } from '@/components/crud'
import { {service_name} } from '{api_import_path}'
import { $t } from '@/locales'
// crud配置
export const crudSchema = (): CrudSchema => {
return {
api: {service_name}.list,
dialogTitle: $t('{lang_key}.title'),
exportFileName: $t('{lang_key}.title'),
crudApi: {
add: {service_name}.create,
edit: {service_name}.update,
remove: {service_name}.remove,
view: {service_name}.get
},
useCrud: {use_crud},
hasAdd: {has_add},
hasRemove: {has_remove},
hasEdit: {has_edit},
hasView: {has_view},
addAuth: '{module_name}:{dummy_class_name}:create',
removeAuth: '{module_name}:{dummy_class_name}:delete',
editAuth: '{module_name}:{dummy_class_name}:update',
viewAuth: '{module_name}:{dummy_class_name}:read',
rowKey: 'id',
useSearchForm: true,
columns: [
{
type: 'selection'
},
{table_columns}
],
searchFormSchema: {
schema: [
{search_form_schema}
]
},
dialogProps: {
width: '{dialog_width}',
{dialog_type}
},
formSchema: {
showDefaultActions: false,
labelWidth: '100px',
schema: [
{form_schema}
]
}
}
}