mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-31 06:50:51 +00:00
增加备注说明
This commit is contained in:
parent
6280ddc723
commit
df270e50b4
@ -179,7 +179,6 @@ class SystemCrud extends AuthController
|
||||
}
|
||||
|
||||
return app('json')->success($data);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -208,7 +208,7 @@ class SystemCrudServices extends BaseServices
|
||||
}
|
||||
|
||||
$routeName = 'crud/' . Str::snake($tableName);
|
||||
$uniqueAuth = $routeName . '-index-list';
|
||||
$uniqueAuth = Str::snake($tableName) . '-crud-list-index';
|
||||
|
||||
foreach ($filePath as $k => $i) {
|
||||
if (in_array($k, ['pages', 'router', 'api'])) {
|
||||
@ -293,7 +293,7 @@ class SystemCrudServices extends BaseServices
|
||||
foreach ($ruleData as $item) {
|
||||
$menuData[] = [
|
||||
'pid' => $menuInfo->id,
|
||||
'method' => $item['method'],
|
||||
'methods' => $item['method'],
|
||||
'api_url' => $item['path'],
|
||||
'name' => $item['name'],
|
||||
'is_del' => 0,
|
||||
@ -385,11 +385,11 @@ class SystemCrudServices extends BaseServices
|
||||
$options['columnField'] = is_array($options['columnField']) ? $options['columnField'] : [];
|
||||
//生成模型
|
||||
$model = app()->make(Model::class);
|
||||
[$modelContent, $modelPath, $usePath, $nameCamel] = $model->setFilePathName($filePath['model'] ?? '')->isMake($isMake)->handle($tableName);
|
||||
[$modelContent, $modelPath, $usePath] = $model->setFilePathName($filePath['model'] ?? '')->isMake($isMake)->handle($tableName);
|
||||
//生成dao
|
||||
$dao = app()->make(Dao::class);
|
||||
[$daoContent, $daoPath, $usePath, $nameCamel] = $dao->setFilePathName($filePath['dao'] ?? '')->isMake($isMake)->handle($tableName, [
|
||||
'usePath' => $usePath . $nameCamel,
|
||||
[$daoContent, $daoPath, $usePath] = $dao->setFilePathName($filePath['dao'] ?? '')->isMake($isMake)->handle($tableName, [
|
||||
'usePath' => $usePath,
|
||||
]);
|
||||
//生成service
|
||||
$service = app()->make(Service::class);
|
||||
@ -425,7 +425,8 @@ class SystemCrudServices extends BaseServices
|
||||
//生成前台页面
|
||||
$viewPages = app()->make(ViewPages::class);
|
||||
[$pagesContent, $pagesPath] = $viewPages->setFilePathName($filePath['pages'] ?? '')->isMake($isMake)->handle($tableName, [
|
||||
'field' => $options['columnField']
|
||||
'field' => $options['columnField'],
|
||||
'pathApiJs' => '@/' . str_replace('\\', '/', str_replace([Make::adminTemplatePath(), '.js'], '', $apiPath)),
|
||||
]);
|
||||
|
||||
return [
|
||||
|
||||
@ -231,16 +231,17 @@ abstract class Make
|
||||
if (isset($this->value['path'])) {
|
||||
$this->value['path'] = $this->getfolderPath($path);
|
||||
}
|
||||
if (isset($this->value['use-php']) && !empty($options['usePath'])) {
|
||||
$this->value['use-php'] = "use " . $options['usePath'] . ";\n";
|
||||
}
|
||||
|
||||
$contentStr = str_replace($this->var, $this->value, $content);
|
||||
|
||||
$filePath = $this->getFilePathName($path, $this->value['nameCamel']);
|
||||
|
||||
return [
|
||||
$this->makeFile($filePath, $contentStr),
|
||||
$this->filePathName ?: $filePath,
|
||||
$this->value['path'] ?? '',
|
||||
$this->value['nameCamel']
|
||||
$this->baseDir . '\\' . $this->value['nameCamel']
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@ -72,6 +72,8 @@ class Service extends Make
|
||||
if ($from) {
|
||||
$this->value['use-php'] .= "\n" . 'use crmeb\services\FormBuilder;';
|
||||
$value[] = implode("\n", $from);
|
||||
} else {
|
||||
$value[] = '';
|
||||
}
|
||||
$value[] = $options['menus'] ?? $name;
|
||||
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
<script>
|
||||
import { mapState } from 'vuex';
|
||||
import { {%name%}SaveApi, {%name%}DeleteApi, {%name%}UpdateApi, get{%nameCamel%}CreateApi, get{%nameCamel%}EditApi, get{%nameCamel%}ListApi} from '@/api/{%pathApiJs%}';
|
||||
import { {%name%}SaveApi, {%name%}DeleteApi, {%name%}UpdateApi, get{%nameCamel%}CreateApi, get{%nameCamel%}EditApi, get{%nameCamel%}ListApi} from '{%pathApiJs%}';
|
||||
export default {
|
||||
name: 'user_group',
|
||||
data() {
|
||||
|
||||
@ -30,10 +30,10 @@ export default {
|
||||
path: 'list',
|
||||
name: `${pre}list`,
|
||||
meta: {
|
||||
auth: ['{%name%}-list-index'],
|
||||
auth: ['{%name%}-crud-list-index'],
|
||||
title: '{%menus%}',
|
||||
},
|
||||
component: () => import('@/pages/{%pagePath%}/index'),
|
||||
component: () => import('@/pages/crud/{%pagePath%}/index'),
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
@ -66,6 +66,7 @@ class Arr
|
||||
$temp['icon'] = $v['icon'];
|
||||
$temp['header'] = $v['header'];
|
||||
$temp['is_header'] = $v['is_header'];
|
||||
$temp['is_show_path'] = $v['is_show_path'];
|
||||
if ($v['is_show_path']) {
|
||||
$temp['auth'] = ['hidden'];
|
||||
}
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div class="main">
|
||||
<Alert type="warning" closable>列表展示的表格字段,默认有id和操作项;字段的选择由第一步自己添加的字段生成或者是由已存在的数据表自动读取出的字段;最多选择10列进行展示;可以为空不填写,生成后由开发者自行编写</Alert>
|
||||
<div class="mb20">
|
||||
<Button class="mr10" type="primary" @click="addRow">添加列</Button>
|
||||
</div>
|
||||
@ -30,7 +31,7 @@
|
||||
<div class="fied-item">
|
||||
<div class="set-up">
|
||||
<div class="name">操作</div>
|
||||
<div class="field">删除</div>
|
||||
<div class="field">编辑|删除</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<div class="main">
|
||||
<Alert type="warning" closable>表单项添加的内容将会展示在生成页面后自动生成的表单里面;
|
||||
编辑和新增都会调用此表单;生成后会新增对应的表单规则代码;可以为空不填写,生成后由开发者自行编写</Alert>
|
||||
<div class="mb20">
|
||||
<Button class="mr10" type="primary" @click="addRow">添加行</Button>
|
||||
<Button class="mr10" type="primary" @click="addRow">添加表单项</Button>
|
||||
</div>
|
||||
<div>
|
||||
<div class="item" v-for="(item, index) in dataList" :key="index">
|
||||
|
||||
@ -15,22 +15,22 @@
|
||||
:props="{ checkStrictly: true, multiple: false, emitPath: false }"
|
||||
clearable
|
||||
></el-cascader>
|
||||
<div class="tip">我是一段备注</div>
|
||||
<div class="tip">可选项去,选择的菜单成功后会自动写入到此菜单下</div>
|
||||
</FormItem>
|
||||
<FormItem label="菜单名称">
|
||||
<Input class="form-width" v-model="foundation.menuName" placeholder="请输入表名"></Input>
|
||||
<div class="tip">我是一段备注</div>
|
||||
<div class="tip">生成菜单为可选项,不填写默认生成的菜单名称将为表名</div>
|
||||
</FormItem>
|
||||
<FormItem label="表名">
|
||||
<Input class="form-width" v-model="foundation.tableName" placeholder="请输入表名"></Input>
|
||||
<div class="tip">我是一段备注</div>
|
||||
<div class="tip">用于生成CRUD指定的表名,不需要携带表前缀;对于生成过的表将不能在进行生成;或者可以删除对应的文件重新生成!对应系统中重要的数据表将不允许生成!</div>
|
||||
</FormItem>
|
||||
<FormItem label="是否存在">
|
||||
<RadioGroup v-model="foundation.isTable">
|
||||
<Radio :label="0">否</Radio>
|
||||
<Radio :label="1">是</Radio>
|
||||
<Radio :label="0">否</Radio>
|
||||
</RadioGroup>
|
||||
<div class="tip">我是一段备注</div>
|
||||
<div class="tip">数据库表可以生成系统存在的,也可以选择【否】后手动生成,不过此生成方式不交单一;如果不满足使用需求可以先在数据库中创建表,然后选择【是】再进行操作</div>
|
||||
</FormItem>
|
||||
<FormItem label="表SQL" v-if="!foundation.isTable">
|
||||
<div>
|
||||
@ -39,25 +39,30 @@
|
||||
<Select v-model="item.type" transfer>
|
||||
<Option v-for="item in columnTypeList" :value="item" :key="item">{{ item }}</Option>
|
||||
</Select>
|
||||
<div class="tip">字段类型</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<Input v-model="item.field" class="priceBox" placeholder="字段名称(英文或_)"></Input>
|
||||
<div class="tip">字段名称为英文加下划线</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<Input v-model="item.limit" type="number" class="priceBox" placeholder="长度"></Input>
|
||||
<div class="tip">字段长度</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<Select v-model="item.index" transfer placeholder="是否为索引">
|
||||
<Option :value="0">否</Option>
|
||||
<Option :value="1">是</Option>
|
||||
</Select>
|
||||
<div class="tip">是否为索引</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<Input v-model="item.comment" class="priceBox" placeholder="备注"></Input>
|
||||
<div class="tip">字段备注</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Button class="mr10" type="primary" @click="addRow">添加行</Button>
|
||||
<Button class="mr10" type="primary" @click="addRow">添加字段</Button>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
@ -1,32 +1,41 @@
|
||||
<template>
|
||||
<div class="main">
|
||||
<Form ref="foundation" :model="storage" :rules="storageRules" :label-width="130">
|
||||
<FormItem label="生成api位置">
|
||||
<Input class="form-width" v-model="storage.api" placeholder="请输入"></Input>
|
||||
</FormItem>
|
||||
<FormItem label="生成controller位置">
|
||||
<Input class="form-width" v-model="storage.controller" placeholder="请输入"></Input>
|
||||
<div class="tip">生成后端控制器文件存放位置</div>
|
||||
</FormItem>
|
||||
<FormItem label="生成service位置">
|
||||
<Input class="form-width" v-model="storage.service" placeholder="请输入"></Input>
|
||||
<div class="tip">生成后端service文件存放位置</div>
|
||||
</FormItem>
|
||||
<FormItem label="生成dao位置">
|
||||
<Input class="form-width" v-model="storage.dao" placeholder="请输入"></Input>
|
||||
<div class="tip">生成后端dao文件存放位置</div>
|
||||
</FormItem>
|
||||
<FormItem label="生成model位置">
|
||||
<Input class="form-width" v-model="storage.model" placeholder="请输入"></Input>
|
||||
</FormItem>
|
||||
<FormItem label="生成pages位置">
|
||||
<Input class="form-width" v-model="storage.pages" placeholder="请输入"></Input>
|
||||
<div class="tip">生成后端model文件存放位置</div>
|
||||
</FormItem>
|
||||
<FormItem label="生成route位置">
|
||||
<Input class="form-width" v-model="storage.route" placeholder="请输入"></Input>
|
||||
</FormItem>
|
||||
<FormItem label="生成router位置">
|
||||
<Input class="form-width" v-model="storage.router" placeholder="请输入"></Input>
|
||||
<div class="tip">生成后端路由存放位置</div>
|
||||
</FormItem>
|
||||
<FormItem label="生成validate位置">
|
||||
<Input class="form-width" v-model="storage.validate" placeholder="请输入"></Input>
|
||||
<div class="tip">生成后端验证器存放位置</div>
|
||||
</FormItem>
|
||||
<FormItem label="生成pages位置">
|
||||
<Input class="form-width" v-model="storage.pages" placeholder="请输入"></Input>
|
||||
<div class="tip">生成前端页面文件存放位置</div>
|
||||
</FormItem>
|
||||
<FormItem label="生成api位置">
|
||||
<Input class="form-width" v-model="storage.api" placeholder="请输入"></Input>
|
||||
<div class="tip">生成前端api接口文件存放位置</div>
|
||||
</FormItem>
|
||||
<FormItem label="生成router位置">
|
||||
<Input class="form-width" v-model="storage.router" placeholder="请输入"></Input>
|
||||
<div class="tip">生成前端路由存放位置</div>
|
||||
</FormItem>
|
||||
</Form>
|
||||
</div>
|
||||
|
||||
@ -66,7 +66,7 @@ export default {
|
||||
foundation: {
|
||||
pid: '',
|
||||
tableName: '',
|
||||
isTable: 0,
|
||||
isTable: 1,
|
||||
menuName: '',
|
||||
},
|
||||
storage: {},
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user