mirror of
https://github.com/1024-lab/smart-admin.git
synced 2026-01-13 06:04:18 +08:00
v3.16.0 【新增】优化代码生成 字典和文件预览;【新增】代码生成 菜单SQL;【新增】登录页面GIF炫酷图片
This commit is contained in:
@@ -12,9 +12,8 @@
|
||||
- 前端:JavaScript/TypeScript + Vue3 + Vite5 + Pinia + Ant Design Vue 4.X
|
||||
- 移动端:uniapp (vue3版本) + uni-ui + (同时支持APP、小程序、H5)
|
||||
- 后端:Java8/17 + SpringBoot2/3 + Sa Token + Mybatis-plus + 多种数据库
|
||||
- 电脑在线预览:[https://preview.smartadmin.vip](https://preview.smartadmin.vip)
|
||||
- 官方文档:[https://smartadmin.vip](https://smartadmin.vip)
|
||||
- 移动端在线预览:[https://app.smartadmin.vip](https://app.smartadmin.vip/#/pages/login/login)
|
||||
- 官方文档:[http://115.190.111.229/smart-admin/](http://115.190.111.229/smart-admin/)
|
||||
- 在线预览:[http://115.190.111.229/smart-admin-preview/](http://115.190.111.229/smart-admin-preview/)
|
||||
### **理念与思想**
|
||||
|
||||
- 我们分享的不是徒劳无功的各种功能,而是必须有的功能,如:数据变动记录、系统说明文档、版本更新记录、意见反馈、日志、心跳、单号生成器等等。
|
||||
|
||||
@@ -159,7 +159,7 @@ public class CodeGeneratorTemplateService {
|
||||
CodeDelete deleteInfo = JSON.parseObject(codeGeneratorConfigEntity.getDeleteInfo(), CodeDelete.class);
|
||||
List<CodeQueryField> queryFields = JSONArray.parseArray(codeGeneratorConfigEntity.getQueryFields(), CodeQueryField.class);
|
||||
List<CodeTableField> tableFields = JSONArray.parseArray(codeGeneratorConfigEntity.getTableFields(), CodeTableField.class);
|
||||
tableFields.stream().forEach(e -> e.setWidth(e.getWidth() == null ? 0 : e.getWidth()));
|
||||
tableFields.forEach(e -> e.setWidth(e.getWidth() == null ? 0 : e.getWidth()));
|
||||
|
||||
CodeGeneratorConfigForm form = CodeGeneratorConfigForm.builder().basic(basic).fields(fields).insertAndUpdate(insertAndUpdate).deleteInfo(deleteInfo).queryFields(queryFields).tableFields(tableFields).deleteInfo(deleteInfo).build();
|
||||
form.setTableName(tableName);
|
||||
|
||||
@@ -64,8 +64,7 @@ public abstract class CodeGenerateBaseVariableService {
|
||||
return null;
|
||||
}
|
||||
|
||||
return fields.stream().filter(e -> columnName.equals(e.getColumnName()))
|
||||
.findFirst().get();
|
||||
return fields.stream().filter(e -> SmartStringUtil.equals(columnName, e.getColumnName())).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +88,7 @@ public abstract class CodeGenerateBaseVariableService {
|
||||
}
|
||||
|
||||
CodeInsertAndUpdateField field = first.get();
|
||||
return SmartStringUtil.equals(field.getFrontComponent(), CodeFrontComponentEnum.FILE_UPLOAD.getValue());
|
||||
return CodeFrontComponentEnum.FILE_UPLOAD.equalsValue(field.getFrontComponent());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,8 +113,7 @@ public abstract class CodeGenerateBaseVariableService {
|
||||
return null;
|
||||
}
|
||||
|
||||
Optional<CodeField> first = fields.stream().filter(e -> columnName.equals(e.getColumnName())).findFirst();
|
||||
return first.orElse(null);
|
||||
return fields.stream().filter(e -> columnName.equals(e.getColumnName())).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -67,6 +67,7 @@ public class FormVariableService extends CodeGenerateBaseVariableService {
|
||||
|
||||
if (CodeFrontComponentEnum.DICT_SELECT.equalsValue(field.getFrontComponent())) {
|
||||
frontImportSet.add("import DictSelect from '/@/components/support/dict-select/index.vue';");
|
||||
frontImportSet.add("import { DICT_CODE_ENUM } from '/@/constants/support/dict-const.js';");
|
||||
}
|
||||
|
||||
if (CodeFrontComponentEnum.FILE_UPLOAD.equalsValue(field.getFrontComponent())) {
|
||||
|
||||
@@ -2,10 +2,14 @@ package net.lab1024.sa.base.module.support.codegenerator.service.variable.front;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.google.common.base.CaseFormat;
|
||||
import net.lab1024.sa.base.common.util.SmartStringUtil;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.constant.CodeFrontComponentEnum;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.constant.CodeQueryFieldQueryTypeEnum;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeField;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeInsertAndUpdateField;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeQueryField;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeTableField;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService;
|
||||
|
||||
import java.util.*;
|
||||
@@ -29,34 +33,74 @@ public class ListVariableService extends CodeGenerateBaseVariableService {
|
||||
public Map<String, Object> getInjectVariablesMap(CodeGeneratorConfigForm form) {
|
||||
Map<String, Object> variablesMap = new HashMap<>();
|
||||
|
||||
List<Map<String, Object>> variableList = new ArrayList<>();
|
||||
List<CodeQueryField> queryFields = form.getQueryFields();
|
||||
|
||||
HashSet<String> frontImportSet = new HashSet<>();
|
||||
frontImportSet.add("import " + CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, form.getBasic().getModuleName()) + "Form from './" + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, form.getBasic().getModuleName()) + "-form.vue';");
|
||||
|
||||
// 查询参数
|
||||
List<Map<String, Object>> queryVariable = new ArrayList<>();
|
||||
List<CodeQueryField> queryFields = form.getQueryFields();
|
||||
|
||||
for (CodeQueryField queryField : queryFields) {
|
||||
Map<String, Object> objectMap = BeanUtil.beanToMap(queryField);
|
||||
|
||||
CodeField codeField = getCodeFieldByColumnName(queryField.getColumnNameList().get(0), form);
|
||||
objectMap.put("frontEnumName", codeField.getEnumName());
|
||||
objectMap.put("dict", codeField.getDict());
|
||||
|
||||
if(CodeQueryFieldQueryTypeEnum.ENUM.equalsValue(queryField.getQueryTypeEnum())){
|
||||
if (CodeQueryFieldQueryTypeEnum.ENUM.equalsValue(queryField.getQueryTypeEnum())) {
|
||||
objectMap.put("frontEnumName", codeField.getEnumName());
|
||||
frontImportSet.add("import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';");
|
||||
}
|
||||
|
||||
if(CodeQueryFieldQueryTypeEnum.DICT.equalsValue(queryField.getQueryTypeEnum())){
|
||||
if (CodeQueryFieldQueryTypeEnum.DICT.equalsValue(queryField.getQueryTypeEnum())) {
|
||||
objectMap.put("dict", codeField.getDict());
|
||||
frontImportSet.add("import DictSelect from '/@/components/support/dict-select/index.vue';");
|
||||
}
|
||||
|
||||
if(CodeQueryFieldQueryTypeEnum.DATE_RANGE.equalsValue(queryField.getQueryTypeEnum())){
|
||||
if (CodeQueryFieldQueryTypeEnum.DATE_RANGE.equalsValue(queryField.getQueryTypeEnum())) {
|
||||
frontImportSet.add("import { defaultTimeRanges } from '/@/lib/default-time-ranges';");
|
||||
}
|
||||
variableList.add(objectMap);
|
||||
|
||||
queryVariable.add(objectMap);
|
||||
}
|
||||
variablesMap.put("queryFields",variableList);
|
||||
variablesMap.put("frontImportList",new ArrayList<>(frontImportSet));
|
||||
|
||||
// 表格列表
|
||||
List<Map<String, Object>> listVariable = new ArrayList<>();
|
||||
// 过滤掉不显示的字段
|
||||
List<CodeTableField> tableFields = form.getTableFields().stream().filter(CodeTableField::getShowFlag).toList();
|
||||
|
||||
for (CodeTableField tableField : tableFields) {
|
||||
Map<String, Object> objectMap = BeanUtil.beanToMap(tableField);
|
||||
objectMap.put("fieldName", tableField.getFieldName());
|
||||
|
||||
CodeField codeField = getCodeFieldByColumnName(tableField.getColumnName(), form);
|
||||
if (codeField == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 是否存在字典
|
||||
if (SmartStringUtil.isNotBlank(codeField.getDict())) {
|
||||
objectMap.put("dict", codeField.getDict());
|
||||
frontImportSet.add("import { DICT_CODE_ENUM } from '/@/constants/support/dict-const.js';");
|
||||
frontImportSet.add("import DictLabel from '/@/components/support/dict-label/index.vue';");
|
||||
}
|
||||
|
||||
CodeInsertAndUpdateField codeInsertAndUpdateField = form.getInsertAndUpdate().getFieldList().stream().filter(e -> SmartStringUtil.equals(tableField.getColumnName(), e.getColumnName())).findFirst().orElse(null);
|
||||
if (codeInsertAndUpdateField == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 是否存在上传组件
|
||||
if (CodeFrontComponentEnum.FILE_UPLOAD.equalsValue(codeInsertAndUpdateField.getFrontComponent())) {
|
||||
objectMap.put("frontComponent", codeInsertAndUpdateField.getFrontComponent());
|
||||
frontImportSet.add("import FilePreview from '/@/components/support/file-preview/index.vue';");
|
||||
}
|
||||
|
||||
listVariable.add(objectMap);
|
||||
}
|
||||
|
||||
variablesMap.put("queryFields", queryVariable);
|
||||
variablesMap.put("listFields", listVariable);
|
||||
variablesMap.put("frontImportList", new ArrayList<>(frontImportSet));
|
||||
|
||||
return variablesMap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,14 +9,14 @@ VALUES ( '${basic.description}', 2, 0, '/${name.lowerHyphenCamel}/list', '/busin
|
||||
SET @parent_id = NULL;
|
||||
SELECT t_menu.menu_id INTO @parent_id FROM t_menu WHERE t_menu.menu_name = '${basic.description}';
|
||||
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||
VALUES ( '查询', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:query', 1, @parent_id, 1 );
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, perms_type, api_perms, web_perms, context_menu_id, create_user_id )
|
||||
VALUES ( '查询', 3, @parent_id, false, false, true, false, 1, '${name.lowerCamel}:query', '${name.lowerCamel}:query', @parent_id, 1 );
|
||||
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||
VALUES ( '添加', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:add', 1, @parent_id, 1 );
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, perms_type, api_perms, web_perms, context_menu_id, create_user_id )
|
||||
VALUES ( '添加', 3, @parent_id, false, false, true, false, 1, '${name.lowerCamel}:add', '${name.lowerCamel}:add', @parent_id, 1 );
|
||||
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||
VALUES ( '更新', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:update', 1, @parent_id, 1 );
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, perms_type, api_perms, web_perms, context_menu_id, create_user_id )
|
||||
VALUES ( '更新', 3, @parent_id, false, false, true, false, 1, '${name.lowerCamel}:update', '${name.lowerCamel}:update', @parent_id, 1 );
|
||||
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||
VALUES ( '删除', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:delete', 1, @parent_id, 1 );
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, perms_type, api_perms, web_perms, context_menu_id, create_user_id )
|
||||
VALUES ( '删除', 3, @parent_id, false, false, true, false, 1, '${name.lowerCamel}:delete', '${name.lowerCamel}:delete', @parent_id, 1 );
|
||||
|
||||
@@ -43,12 +43,12 @@
|
||||
#end
|
||||
#if($field.frontComponent == "SmartEnumSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enumName="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
|
||||
<SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enum-name="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "DictSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<DictSelect width="100%" v-model:value="form.${field.fieldName}" dictCode="$!{field.dict}" placeholder="$!{field.label}"/>
|
||||
<DictSelect width="100%" v-model:value="form.${field.fieldName}" dict-code="DICT_CODE_ENUM.$!{field.dict} || '$!{field.dict}'" placeholder="$!{field.label}"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "Date")
|
||||
@@ -101,12 +101,12 @@
|
||||
#end
|
||||
#if($field.frontComponent == "SmartEnumSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enumName="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
|
||||
<SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enum-name="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "DictSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<DictSelect width="100%" v-model:value="form.${field.fieldName}" dictCode="$!{field.dict}" placeholder="$!{field.label}"/>
|
||||
<DictSelect width="100%" v-model:value="form.${field.fieldName}" dict-code="DICT_CODE_ENUM.$!{field.dict} || '$!{field.dict}'" placeholder="$!{field.label}"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "Date")
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Dict")
|
||||
<a-form-item label="${field.label}" class="smart-query-form-item">
|
||||
<DictSelect dictCode="$!{field.dict}" placeholder="${field.label}" v-model:value="queryForm.${field.fieldName}" width="${field.width}" />
|
||||
<DictSelect dict-code="DICT_CODE_ENUM.$!{field.dict} || '$!{field.dict}'" placeholder="${field.label}" v-model:value="queryForm.${field.fieldName}" width="${field.width}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Enum")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc(${field.label})" class="smart-query-form-item">
|
||||
<SmartEnumSelect width="${field.width}" v-model:value="queryForm.${field.fieldName}" enumName="$!{field.frontEnumName}" placeholder="$codeGeneratorTool.removeEnumDesc(${field.label})"/>
|
||||
<SmartEnumSelect width="${field.width}" v-model:value="queryForm.${field.fieldName}" enum-name="$!{field.frontEnumName}" placeholder="$codeGeneratorTool.removeEnumDesc(${field.label})"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Date")
|
||||
@@ -101,18 +101,20 @@
|
||||
>
|
||||
<template #bodyCell="{ text, record, column }">
|
||||
|
||||
<!-- 有图片预览时 注释解开并把下面的'picture'修改成自己的图片字段名即可 -->
|
||||
<!-- <template v-if="column.dataIndex === 'picture'">
|
||||
<FilePreview :fileList="text" type="picture" />
|
||||
</template> -->
|
||||
|
||||
<!-- 使用字典时 注释解开并把下面的'dict'修改成自己的字典字段名即可 有多个字典字段就复制多份同理修改 不然不显示字典 -->
|
||||
<!-- 方便修改tag的颜色 orange green purple success processing error default warning -->
|
||||
<!-- <template v-if="column.dataIndex === 'dict'">
|
||||
<a-tag color="cyan">
|
||||
{{ text && text.length > 0 ? text.map((e) => e.valueName).join(',') : '暂无' }}
|
||||
</a-tag>
|
||||
</template> -->
|
||||
#foreach ($field in $listFields)
|
||||
#if($field.frontComponent == "FileUpload")
|
||||
<template v-if="column.dataIndex === '$field.fieldName'">
|
||||
<FilePreview :file-list="text" type="picture" />
|
||||
</template>
|
||||
#end
|
||||
#end
|
||||
#foreach ($field in $listFields)
|
||||
#if($field.dict)
|
||||
<template v-if="column.dataIndex === '$!{field.fieldName}'">
|
||||
<DictLabel :dict-code="DICT_CODE_ENUM.$!{field.dict} || '$!{field.dict}'" :data-value="text" />
|
||||
</template>
|
||||
#end
|
||||
#end
|
||||
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<div class="smart-table-operate">
|
||||
@@ -159,7 +161,6 @@
|
||||
#foreach ($import in $frontImportList)
|
||||
$!{import}
|
||||
#end
|
||||
//import FilePreview from '/@/components/support/file-preview/index.vue'; // 图片预览组件
|
||||
|
||||
// ---------------------------- 表格列 ----------------------------
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
and table_name = #{tableName}
|
||||
</select>
|
||||
|
||||
<select id="selectTableColumn"
|
||||
resultType="net.lab1024.sa.base.module.support.codegenerator.domain.vo.TableColumnVO">
|
||||
<select id="selectTableColumn" resultType="net.lab1024.sa.base.module.support.codegenerator.domain.vo.TableColumnVO">
|
||||
select *
|
||||
from information_schema.columns
|
||||
where table_schema = (select database())
|
||||
@@ -18,19 +17,18 @@
|
||||
order by ordinal_position
|
||||
</select>
|
||||
|
||||
<select id="queryTableList"
|
||||
resultType="net.lab1024.sa.base.module.support.codegenerator.domain.vo.TableVO">
|
||||
<select id="queryTableList" resultType="net.lab1024.sa.base.module.support.codegenerator.domain.vo.TableVO">
|
||||
select
|
||||
tables.table_name,
|
||||
tables.table_comment,
|
||||
tables.create_time,
|
||||
tables.update_time,
|
||||
`tables`.table_name,
|
||||
`tables`.table_comment,
|
||||
`tables`.create_time,
|
||||
`tables`.update_time,
|
||||
t_code_generator_config.update_time configTime
|
||||
from information_schema.tables tables
|
||||
left join t_code_generator_config on tables.table_name = t_code_generator_config.table_name
|
||||
where tables.table_schema = (select database())
|
||||
from information_schema.tables `tables`
|
||||
left join t_code_generator_config on `tables`.table_name = t_code_generator_config.table_name
|
||||
where `tables`.table_schema = (select database())
|
||||
<if test="queryForm.tableNameKeywords != null and queryForm.tableNameKeywords != ''">
|
||||
AND INSTR(tables.table_name,#{queryForm.tableNameKeywords})
|
||||
AND INSTR(`tables`.table_name,#{queryForm.tableNameKeywords})
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -39,7 +39,7 @@ spring:
|
||||
host: smtp.163.com
|
||||
port: 465
|
||||
username: lab1024@163.com
|
||||
password: LAB1024LAB
|
||||
password: 1024lab
|
||||
properties:
|
||||
mail:
|
||||
smtp:
|
||||
|
||||
@@ -158,7 +158,7 @@ public class CodeGeneratorTemplateService {
|
||||
CodeDelete deleteInfo = JSON.parseObject(codeGeneratorConfigEntity.getDeleteInfo(), CodeDelete.class);
|
||||
List<CodeQueryField> queryFields = JSONArray.parseArray(codeGeneratorConfigEntity.getQueryFields(), CodeQueryField.class);
|
||||
List<CodeTableField> tableFields = JSONArray.parseArray(codeGeneratorConfigEntity.getTableFields(), CodeTableField.class);
|
||||
tableFields.stream().forEach(e -> e.setWidth(e.getWidth() == null ? 0 : e.getWidth()));
|
||||
tableFields.forEach(e -> e.setWidth(e.getWidth() == null ? 0 : e.getWidth()));
|
||||
|
||||
CodeGeneratorConfigForm form = CodeGeneratorConfigForm.builder().basic(basic).fields(fields).insertAndUpdate(insertAndUpdate).deleteInfo(deleteInfo).queryFields(queryFields).tableFields(tableFields).deleteInfo(deleteInfo).build();
|
||||
form.setTableName(tableName);
|
||||
|
||||
@@ -64,8 +64,7 @@ public abstract class CodeGenerateBaseVariableService {
|
||||
return null;
|
||||
}
|
||||
|
||||
return fields.stream().filter(e -> columnName.equals(e.getColumnName()))
|
||||
.findFirst().get();
|
||||
return fields.stream().filter(e -> SmartStringUtil.equals(columnName, e.getColumnName())).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +88,7 @@ public abstract class CodeGenerateBaseVariableService {
|
||||
}
|
||||
|
||||
CodeInsertAndUpdateField field = first.get();
|
||||
return SmartStringUtil.equals(field.getFrontComponent(), CodeFrontComponentEnum.FILE_UPLOAD.getValue());
|
||||
return CodeFrontComponentEnum.FILE_UPLOAD.equalsValue(field.getFrontComponent());
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,8 +113,7 @@ public abstract class CodeGenerateBaseVariableService {
|
||||
return null;
|
||||
}
|
||||
|
||||
Optional<CodeField> first = fields.stream().filter(e -> columnName.equals(e.getColumnName())).findFirst();
|
||||
return first.orElse(null);
|
||||
return fields.stream().filter(e -> columnName.equals(e.getColumnName())).findFirst().orElse(null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -67,6 +67,7 @@ public class FormVariableService extends CodeGenerateBaseVariableService {
|
||||
|
||||
if (CodeFrontComponentEnum.DICT_SELECT.equalsValue(field.getFrontComponent())) {
|
||||
frontImportSet.add("import DictSelect from '/@/components/support/dict-select/index.vue';");
|
||||
frontImportSet.add("import { DICT_CODE_ENUM } from '/@/constants/support/dict-const.js';");
|
||||
}
|
||||
|
||||
if (CodeFrontComponentEnum.FILE_UPLOAD.equalsValue(field.getFrontComponent())) {
|
||||
|
||||
@@ -2,13 +2,18 @@ package net.lab1024.sa.base.module.support.codegenerator.service.variable.front;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.google.common.base.CaseFormat;
|
||||
import net.lab1024.sa.base.common.util.SmartStringUtil;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.constant.CodeFrontComponentEnum;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.constant.CodeQueryFieldQueryTypeEnum;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.domain.form.CodeGeneratorConfigForm;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeField;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeInsertAndUpdateField;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeQueryField;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.domain.model.CodeTableField;
|
||||
import net.lab1024.sa.base.module.support.codegenerator.service.variable.CodeGenerateBaseVariableService;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Author 1024创新实验室-主任:卓大
|
||||
@@ -29,34 +34,74 @@ public class ListVariableService extends CodeGenerateBaseVariableService {
|
||||
public Map<String, Object> getInjectVariablesMap(CodeGeneratorConfigForm form) {
|
||||
Map<String, Object> variablesMap = new HashMap<>();
|
||||
|
||||
List<Map<String, Object>> variableList = new ArrayList<>();
|
||||
List<CodeQueryField> queryFields = form.getQueryFields();
|
||||
|
||||
HashSet<String> frontImportSet = new HashSet<>();
|
||||
frontImportSet.add("import " + CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, form.getBasic().getModuleName()) + "Form from './" + CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_HYPHEN, form.getBasic().getModuleName()) + "-form.vue';");
|
||||
|
||||
// 查询参数
|
||||
List<Map<String, Object>> queryVariable = new ArrayList<>();
|
||||
List<CodeQueryField> queryFields = form.getQueryFields();
|
||||
|
||||
for (CodeQueryField queryField : queryFields) {
|
||||
Map<String, Object> objectMap = BeanUtil.beanToMap(queryField);
|
||||
|
||||
CodeField codeField = getCodeFieldByColumnName(queryField.getColumnNameList().get(0), form);
|
||||
objectMap.put("frontEnumName", codeField.getEnumName());
|
||||
objectMap.put("dict", codeField.getDict());
|
||||
|
||||
if(CodeQueryFieldQueryTypeEnum.ENUM.equalsValue(queryField.getQueryTypeEnum())){
|
||||
if (CodeQueryFieldQueryTypeEnum.ENUM.equalsValue(queryField.getQueryTypeEnum())) {
|
||||
objectMap.put("frontEnumName", codeField.getEnumName());
|
||||
frontImportSet.add("import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';");
|
||||
}
|
||||
|
||||
if(CodeQueryFieldQueryTypeEnum.DICT.equalsValue(queryField.getQueryTypeEnum())){
|
||||
if (CodeQueryFieldQueryTypeEnum.DICT.equalsValue(queryField.getQueryTypeEnum())) {
|
||||
objectMap.put("dict", codeField.getDict());
|
||||
frontImportSet.add("import DictSelect from '/@/components/support/dict-select/index.vue';");
|
||||
}
|
||||
|
||||
if(CodeQueryFieldQueryTypeEnum.DATE_RANGE.equalsValue(queryField.getQueryTypeEnum())){
|
||||
if (CodeQueryFieldQueryTypeEnum.DATE_RANGE.equalsValue(queryField.getQueryTypeEnum())) {
|
||||
frontImportSet.add("import { defaultTimeRanges } from '/@/lib/default-time-ranges';");
|
||||
}
|
||||
variableList.add(objectMap);
|
||||
|
||||
queryVariable.add(objectMap);
|
||||
}
|
||||
variablesMap.put("queryFields",variableList);
|
||||
variablesMap.put("frontImportList",new ArrayList<>(frontImportSet));
|
||||
|
||||
// 表格列表
|
||||
List<Map<String, Object>> listVariable = new ArrayList<>();
|
||||
// 过滤掉不显示的字段
|
||||
List<CodeTableField> tableFields = form.getTableFields().stream().filter(CodeTableField::getShowFlag).collect(Collectors.toList());
|
||||
|
||||
for (CodeTableField tableField : tableFields) {
|
||||
Map<String, Object> objectMap = BeanUtil.beanToMap(tableField);
|
||||
objectMap.put("fieldName", tableField.getFieldName());
|
||||
|
||||
CodeField codeField = getCodeFieldByColumnName(tableField.getColumnName(), form);
|
||||
if (codeField == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 是否存在字典
|
||||
if (SmartStringUtil.isNotBlank(codeField.getDict())) {
|
||||
objectMap.put("dict", codeField.getDict());
|
||||
frontImportSet.add("import { DICT_CODE_ENUM } from '/@/constants/support/dict-const.js';");
|
||||
frontImportSet.add("import DictLabel from '/@/components/support/dict-label/index.vue';");
|
||||
}
|
||||
|
||||
CodeInsertAndUpdateField codeInsertAndUpdateField = form.getInsertAndUpdate().getFieldList().stream().filter(e -> SmartStringUtil.equals(tableField.getColumnName(), e.getColumnName())).findFirst().orElse(null);
|
||||
if (codeInsertAndUpdateField == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// 是否存在上传组件
|
||||
if (CodeFrontComponentEnum.FILE_UPLOAD.equalsValue(codeInsertAndUpdateField.getFrontComponent())) {
|
||||
objectMap.put("frontComponent", codeInsertAndUpdateField.getFrontComponent());
|
||||
frontImportSet.add("import FilePreview from '/@/components/support/file-preview/index.vue';");
|
||||
}
|
||||
|
||||
listVariable.add(objectMap);
|
||||
}
|
||||
|
||||
variablesMap.put("queryFields", queryVariable);
|
||||
variablesMap.put("listFields", listVariable);
|
||||
variablesMap.put("frontImportList", new ArrayList<>(frontImportSet));
|
||||
|
||||
return variablesMap;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,14 +9,14 @@ VALUES ( '${basic.description}', 2, 0, '/${name.lowerHyphenCamel}/list', '/busin
|
||||
SET @parent_id = NULL;
|
||||
SELECT t_menu.menu_id INTO @parent_id FROM t_menu WHERE t_menu.menu_name = '${basic.description}';
|
||||
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||
VALUES ( '查询', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:query', 1, @parent_id, 1 );
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, perms_type, api_perms, web_perms, context_menu_id, create_user_id )
|
||||
VALUES ( '查询', 3, @parent_id, false, false, true, false, 1, '${name.lowerCamel}:query', '${name.lowerCamel}:query', @parent_id, 1 );
|
||||
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||
VALUES ( '添加', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:add', 1, @parent_id, 1 );
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, perms_type, api_perms, web_perms, context_menu_id, create_user_id )
|
||||
VALUES ( '添加', 3, @parent_id, false, false, true, false, 1, '${name.lowerCamel}:add', '${name.lowerCamel}:add', @parent_id, 1 );
|
||||
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||
VALUES ( '更新', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:update', 1, @parent_id, 1 );
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, perms_type, api_perms, web_perms, context_menu_id, create_user_id )
|
||||
VALUES ( '更新', 3, @parent_id, false, false, true, false, 1, '${name.lowerCamel}:update', '${name.lowerCamel}:update', @parent_id, 1 );
|
||||
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, api_perms, perms_type, context_menu_id, create_user_id )
|
||||
VALUES ( '删除', 3, @parent_id, false, true, true, false, '${name.lowerCamel}:delete', 1, @parent_id, 1 );
|
||||
INSERT INTO t_menu ( menu_name, menu_type, parent_id, frame_flag, cache_flag, visible_flag, disabled_flag, perms_type, api_perms, web_perms, context_menu_id, create_user_id )
|
||||
VALUES ( '删除', 3, @parent_id, false, false, true, false, 1, '${name.lowerCamel}:delete', '${name.lowerCamel}:delete', @parent_id, 1 );
|
||||
|
||||
@@ -43,12 +43,12 @@
|
||||
#end
|
||||
#if($field.frontComponent == "SmartEnumSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enumName="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
|
||||
<SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enum-name="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "DictSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<DictSelect width="100%" v-model:value="form.${field.fieldName}" dictCode="$!{field.dict}" placeholder="$!{field.label}"/>
|
||||
<DictSelect width="100%" v-model:value="form.${field.fieldName}" dict-code="DICT_CODE_ENUM.$!{field.dict} || '$!{field.dict}'" placeholder="$!{field.label}"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "Date")
|
||||
@@ -101,12 +101,12 @@
|
||||
#end
|
||||
#if($field.frontComponent == "SmartEnumSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enumName="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
|
||||
<SmartEnumSelect width="100%" v-model:value="form.${field.fieldName}" enum-name="$!{field.upperUnderscoreEnum}" placeholder="$codeGeneratorTool.removeEnumDesc($!{field.label})"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "DictSelect")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc($!{field.label})" name="${field.fieldName}">
|
||||
<DictSelect width="100%" v-model:value="form.${field.fieldName}" dictCode="$!{field.dict}" placeholder="$!{field.label}"/>
|
||||
<DictSelect width="100%" v-model:value="form.${field.fieldName}" dict-code="DICT_CODE_ENUM.$!{field.dict} || '$!{field.dict}'" placeholder="$!{field.label}"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.frontComponent == "Date")
|
||||
|
||||
@@ -22,12 +22,12 @@
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Dict")
|
||||
<a-form-item label="${field.label}" class="smart-query-form-item">
|
||||
<DictSelect dictCode="$!{field.dict}" placeholder="${field.label}" v-model:value="queryForm.${field.fieldName}" width="${field.width}" />
|
||||
<DictSelect dict-code="DICT_CODE_ENUM.$!{field.dict} || '$!{field.dict}'" placeholder="${field.label}" v-model:value="queryForm.${field.fieldName}" width="${field.width}" />
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Enum")
|
||||
<a-form-item label="$codeGeneratorTool.removeEnumDesc(${field.label})" class="smart-query-form-item">
|
||||
<SmartEnumSelect width="${field.width}" v-model:value="queryForm.${field.fieldName}" enumName="$!{field.frontEnumName}" placeholder="$codeGeneratorTool.removeEnumDesc(${field.label})"/>
|
||||
<SmartEnumSelect width="${field.width}" v-model:value="queryForm.${field.fieldName}" enum-name="$!{field.frontEnumName}" placeholder="$codeGeneratorTool.removeEnumDesc(${field.label})"/>
|
||||
</a-form-item>
|
||||
#end
|
||||
#if($field.queryTypeEnum == "Date")
|
||||
@@ -101,18 +101,20 @@
|
||||
>
|
||||
<template #bodyCell="{ text, record, column }">
|
||||
|
||||
<!-- 有图片预览时 注释解开并把下面的'picture'修改成自己的图片字段名即可 -->
|
||||
<!-- <template v-if="column.dataIndex === 'picture'">
|
||||
<FilePreview :fileList="text" type="picture" />
|
||||
</template> -->
|
||||
|
||||
<!-- 使用字典时 注释解开并把下面的'dict'修改成自己的字典字段名即可 有多个字典字段就复制多份同理修改 不然不显示字典 -->
|
||||
<!-- 方便修改tag的颜色 orange green purple success processing error default warning -->
|
||||
<!-- <template v-if="column.dataIndex === 'dict'">
|
||||
<a-tag color="cyan">
|
||||
{{ text && text.length > 0 ? text.map((e) => e.valueName).join(',') : '暂无' }}
|
||||
</a-tag>
|
||||
</template> -->
|
||||
#foreach ($field in $listFields)
|
||||
#if($field.frontComponent == "FileUpload")
|
||||
<template v-if="column.dataIndex === '$field.fieldName'">
|
||||
<FilePreview :file-list="text" type="picture" />
|
||||
</template>
|
||||
#end
|
||||
#end
|
||||
#foreach ($field in $listFields)
|
||||
#if($field.dict)
|
||||
<template v-if="column.dataIndex === '$!{field.fieldName}'">
|
||||
<DictLabel :dict-code="DICT_CODE_ENUM.$!{field.dict} || '$!{field.dict}'" :data-value="text" />
|
||||
</template>
|
||||
#end
|
||||
#end
|
||||
|
||||
<template v-if="column.dataIndex === 'action'">
|
||||
<div class="smart-table-operate">
|
||||
@@ -159,7 +161,6 @@
|
||||
#foreach ($import in $frontImportList)
|
||||
$!{import}
|
||||
#end
|
||||
//import FilePreview from '/@/components/support/file-preview/index.vue'; // 图片预览组件
|
||||
|
||||
// ---------------------------- 表格列 ----------------------------
|
||||
|
||||
|
||||
@@ -9,8 +9,7 @@
|
||||
and table_name = #{tableName}
|
||||
</select>
|
||||
|
||||
<select id="selectTableColumn"
|
||||
resultType="net.lab1024.sa.base.module.support.codegenerator.domain.vo.TableColumnVO">
|
||||
<select id="selectTableColumn" resultType="net.lab1024.sa.base.module.support.codegenerator.domain.vo.TableColumnVO">
|
||||
select *
|
||||
from information_schema.columns
|
||||
where table_schema = (select database())
|
||||
@@ -18,19 +17,18 @@
|
||||
order by ordinal_position
|
||||
</select>
|
||||
|
||||
<select id="queryTableList"
|
||||
resultType="net.lab1024.sa.base.module.support.codegenerator.domain.vo.TableVO">
|
||||
<select id="queryTableList" resultType="net.lab1024.sa.base.module.support.codegenerator.domain.vo.TableVO">
|
||||
select
|
||||
tables.table_name,
|
||||
tables.table_comment,
|
||||
tables.create_time,
|
||||
tables.update_time,
|
||||
`tables`.table_name,
|
||||
`tables`.table_comment,
|
||||
`tables`.create_time,
|
||||
`tables`.update_time,
|
||||
t_code_generator_config.update_time configTime
|
||||
from information_schema.tables tables
|
||||
left join t_code_generator_config on tables.table_name = t_code_generator_config.table_name
|
||||
where tables.table_schema = (select database())
|
||||
from information_schema.tables `tables`
|
||||
left join t_code_generator_config on `tables`.table_name = t_code_generator_config.table_name
|
||||
where `tables`.table_schema = (select database())
|
||||
<if test="queryForm.tableNameKeywords != null and queryForm.tableNameKeywords != ''">
|
||||
AND INSTR(tables.table_name,#{queryForm.tableNameKeywords})
|
||||
AND INSTR(`tables`.table_name,#{queryForm.tableNameKeywords})
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
||||
@@ -87,8 +87,8 @@ file:
|
||||
region: oss-cn-hangzhou
|
||||
endpoint: oss-cn-hangzhou.aliyuncs.com
|
||||
bucket-name: 1024lab-smart-admin
|
||||
access-key:
|
||||
secret-key:
|
||||
access-key:
|
||||
secret-key:
|
||||
url-prefix: https://${file.storage.cloud.bucket-name}.${file.storage.cloud.endpoint}/
|
||||
private-url-expire-seconds: 3600
|
||||
|
||||
|
||||
BIN
smart-admin-web-javascript/src/assets/images/login/login.gif
Normal file
BIN
smart-admin-web-javascript/src/assets/images/login/login.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 MiB |
@@ -25,7 +25,7 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="产地" name="place" class="smart-query-form-item">
|
||||
<DictSelect :dictCode="DICT_CODE_ENUM.GOODS_PLACE" v-model:value="queryForm.place" width="120px" />
|
||||
<DictSelect :dict-code="DICT_CODE_ENUM.GOODS_PLACE" v-model:value="queryForm.place" width="120px" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="商品状态" name="goodsStatus" class="smart-query-form-item">
|
||||
@@ -93,7 +93,7 @@
|
||||
</a-button>
|
||||
</div>
|
||||
<div class="smart-table-setting-block">
|
||||
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.ERP.GOODS" :refresh="queryData"/>
|
||||
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.ERP.GOODS" :refresh="queryData" />
|
||||
</div>
|
||||
</a-row>
|
||||
<!---------- 表格操作行 end ----------->
|
||||
@@ -120,7 +120,7 @@
|
||||
{{ text }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'place'">
|
||||
<DictLabel :dict-code="DICT_CODE_ENUM.GOODS_PLACE" :dataValue="text" />
|
||||
<DictLabel :dict-code="DICT_CODE_ENUM.GOODS_PLACE" :data-value="text" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'remark'">
|
||||
<span>{{ text ? text : '' }}</span>
|
||||
@@ -199,7 +199,6 @@
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
|
||||
import { GOODS_STATUS_ENUM } from '/@/constants/business/erp/goods-const';
|
||||
import DictSelect from '/@/components/support/dict-select/index.vue';
|
||||
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
|
||||
import _ from 'lodash';
|
||||
@@ -235,7 +234,6 @@
|
||||
title: '商品状态',
|
||||
dataIndex: 'goodsStatus',
|
||||
resizable: true,
|
||||
sorter: true,
|
||||
filterOptions: {
|
||||
type: 'enum-select',
|
||||
enumName: 'GOODS_STATUS_ENUM',
|
||||
@@ -248,7 +246,7 @@
|
||||
resizable: true,
|
||||
filterOptions: {
|
||||
type: 'dict-select',
|
||||
dictCode: DICT_CODE_ENUM.GOODS_PLACE,
|
||||
dictCode: DICT_CODE_ENUM.GOODS_PLACE || 'GOODS_PLACE',
|
||||
},
|
||||
width: 150,
|
||||
},
|
||||
|
||||
@@ -39,7 +39,16 @@
|
||||
<TableOperator class="smart-margin-bottom5" v-model="columns" :tableId="TABLE_ID_CONST.SUPPORT.CONFIG" :refresh="ajaxQuery" />
|
||||
</a-row>
|
||||
|
||||
<a-table size="small" :loading="tableLoading" bordered :dataSource="tableData" :columns="columns" rowKey="configId" :pagination="false">
|
||||
<a-table
|
||||
size="small"
|
||||
:scroll="{ x: 1000 }"
|
||||
:loading="tableLoading"
|
||||
bordered
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
rowKey="configId"
|
||||
:pagination="false"
|
||||
>
|
||||
<template #bodyCell="{ record, index, column }">
|
||||
<template v-if="column.dataIndex === 'seq'">
|
||||
{{ index + 1 }}
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
|
||||
<a-table
|
||||
size="small"
|
||||
:scroll="{ x: 1000 }"
|
||||
bordered
|
||||
class="smart-margin-top10"
|
||||
:dataSource="tableData"
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
:loading="tableLoading"
|
||||
rowKey="dictKeyId"
|
||||
rowKey="dictId"
|
||||
:pagination="false"
|
||||
bordered
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.box-item {
|
||||
width: 444px;
|
||||
width: 460px;
|
||||
height: 600px;
|
||||
&.desc {
|
||||
background: #ffffff;
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
<div class="box-item desc">
|
||||
<div class="welcome">
|
||||
<p>欢迎登录 SmartAdmin V3</p>
|
||||
<p class="sub-welcome">「高质量代码、简洁、安全」的开发平台</p>
|
||||
<p class="sub-welcome">「高质量代码、简洁、高效、安全」的开发平台</p>
|
||||
</div>
|
||||
<img class="welcome-img" :src="leftBg2" />
|
||||
<img class="welcome-img" :src="loginGif" />
|
||||
</div>
|
||||
<div class="box-item login">
|
||||
<img class="login-qr" :src="loginQR" />
|
||||
@@ -81,6 +81,7 @@
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import loginQR from '/@/assets/images/login/login-qr.png';
|
||||
import leftBg2 from '/@/assets/images/login/left-bg2.png';
|
||||
import loginGif from '/@/assets/images/login/login.gif';
|
||||
import wechatIcon from '/@/assets/images/login/wechat-icon.png';
|
||||
import aliIcon from '/@/assets/images/login/ali-icon.png';
|
||||
import douyinIcon from '/@/assets/images/login/douyin-icon.png';
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
<a-table
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
size="small"
|
||||
:scroll="{ x: 1000 }"
|
||||
:defaultExpandAllRows="true"
|
||||
:dataSource="tableData"
|
||||
bordered
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
"type": "module",
|
||||
"dependencies": {
|
||||
"@ant-design/icons-vue": "^7.0.1",
|
||||
"@wangeditor/editor": "5.1.14",
|
||||
"@wangeditor/editor-for-vue": "5.1.12",
|
||||
"@wangeditor-next/editor": "5.6.34",
|
||||
"@wangeditor-next/editor-for-vue": "5.1.14",
|
||||
"ant-design-vue": "4.2.5",
|
||||
"axios": "1.6.8",
|
||||
"clipboard": "2.0.11",
|
||||
|
||||
BIN
smart-admin-web-typescript/src/assets/images/login/login.gif
Normal file
BIN
smart-admin-web-typescript/src/assets/images/login/login.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 MiB |
@@ -25,7 +25,7 @@
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="产地" name="place" class="smart-query-form-item">
|
||||
<DictSelect :dictCode="DICT_CODE_ENUM.GOODS_PLACE" v-model:value="queryForm.place" width="120px" />
|
||||
<DictSelect :dict-code="DICT_CODE_ENUM.GOODS_PLACE" v-model:value="queryForm.place" width="120px" />
|
||||
</a-form-item>
|
||||
|
||||
<a-form-item label="商品状态" name="goodsStatus" class="smart-query-form-item">
|
||||
@@ -93,7 +93,7 @@
|
||||
</a-button>
|
||||
</div>
|
||||
<div class="smart-table-setting-block">
|
||||
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.ERP.GOODS" :refresh="queryData"/>
|
||||
<TableOperator v-model="columns" :tableId="TABLE_ID_CONST.BUSINESS.ERP.GOODS" :refresh="queryData" />
|
||||
</div>
|
||||
</a-row>
|
||||
<!---------- 表格操作行 end ----------->
|
||||
@@ -120,7 +120,7 @@
|
||||
{{ text }}
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'place'">
|
||||
<DictLabel :dict-code="DICT_CODE_ENUM.GOODS_PLACE" :dataValue="text" />
|
||||
<DictLabel :dict-code="DICT_CODE_ENUM.GOODS_PLACE" :data-value="text" />
|
||||
</template>
|
||||
<template v-if="column.dataIndex === 'remark'">
|
||||
<span>{{ text ? text : '' }}</span>
|
||||
@@ -199,7 +199,6 @@
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import TableOperator from '/@/components/support/table-operator/index.vue';
|
||||
import { TABLE_ID_CONST } from '/@/constants/support/table-id-const';
|
||||
import { GOODS_STATUS_ENUM } from '/@/constants/business/erp/goods-const';
|
||||
import DictSelect from '/@/components/support/dict-select/index.vue';
|
||||
import SmartEnumSelect from '/@/components/framework/smart-enum-select/index.vue';
|
||||
import _ from 'lodash';
|
||||
@@ -235,7 +234,6 @@
|
||||
title: '商品状态',
|
||||
dataIndex: 'goodsStatus',
|
||||
resizable: true,
|
||||
sorter: true,
|
||||
filterOptions: {
|
||||
type: 'enum-select',
|
||||
enumName: 'GOODS_STATUS_ENUM',
|
||||
@@ -248,7 +246,7 @@
|
||||
resizable: true,
|
||||
filterOptions: {
|
||||
type: 'dict-select',
|
||||
dictCode: DICT_CODE_ENUM.GOODS_PLACE,
|
||||
dictCode: DICT_CODE_ENUM.GOODS_PLACE || 'GOODS_PLACE',
|
||||
},
|
||||
width: 150,
|
||||
},
|
||||
|
||||
@@ -39,7 +39,16 @@
|
||||
<TableOperator class="smart-margin-bottom5" v-model="columns" :tableId="TABLE_ID_CONST.SUPPORT.CONFIG" :refresh="ajaxQuery" />
|
||||
</a-row>
|
||||
|
||||
<a-table size="small" :loading="tableLoading" bordered :dataSource="tableData" :columns="columns" rowKey="configId" :pagination="false">
|
||||
<a-table
|
||||
size="small"
|
||||
:scroll="{ x: 1000 }"
|
||||
:loading="tableLoading"
|
||||
bordered
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
rowKey="configId"
|
||||
:pagination="false"
|
||||
>
|
||||
<template #bodyCell="{ record, index, column }">
|
||||
<template v-if="column.dataIndex === 'seq'">
|
||||
{{ index + 1 }}
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
|
||||
<a-table
|
||||
size="small"
|
||||
:scroll="{ x: 1000 }"
|
||||
bordered
|
||||
class="smart-margin-top10"
|
||||
:dataSource="tableData"
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
:dataSource="tableData"
|
||||
:columns="columns"
|
||||
:loading="tableLoading"
|
||||
rowKey="dictKeyId"
|
||||
rowKey="dictId"
|
||||
:pagination="false"
|
||||
bordered
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeyList, onChange: onSelectChange }"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.box-item {
|
||||
width: 444px;
|
||||
width: 460px;
|
||||
height: 600px;
|
||||
&.desc {
|
||||
background: #ffffff;
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
<div class="box-item desc">
|
||||
<div class="welcome">
|
||||
<p>欢迎登录 SmartAdmin V3</p>
|
||||
<p class="sub-welcome">「高质量代码、简洁、安全」的开发平台</p>
|
||||
<p class="sub-welcome">「高质量代码、简洁、高效、安全」的开发平台</p>
|
||||
</div>
|
||||
<img class="welcome-img" :src="leftBg2" />
|
||||
<img class="welcome-img" :src="loginGif" />
|
||||
</div>
|
||||
<div class="box-item login">
|
||||
<img class="login-qr" :src="loginQR" />
|
||||
@@ -81,6 +81,7 @@
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import loginQR from '/@/assets/images/login/login-qr.png';
|
||||
import leftBg2 from '/@/assets/images/login/left-bg2.png';
|
||||
import loginGif from '/@/assets/images/login/login.gif';
|
||||
import wechatIcon from '/@/assets/images/login/wechat-icon.png';
|
||||
import aliIcon from '/@/assets/images/login/ali-icon.png';
|
||||
import douyinIcon from '/@/assets/images/login/douyin-icon.png';
|
||||
|
||||
@@ -88,6 +88,7 @@
|
||||
<a-table
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
size="small"
|
||||
:scroll="{ x: 1000 }"
|
||||
:defaultExpandAllRows="true"
|
||||
:dataSource="tableData"
|
||||
bordered
|
||||
|
||||
9
sql/README.md
Normal file
9
sql/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
### 数据库脚本
|
||||
|
||||
|
||||
#### 第一次
|
||||
如果是第一次部署,只需要执行 smart_admin_v3.sql 文件中的SQL语句即可;
|
||||
|
||||
|
||||
#### 更新
|
||||
跟随 SmartAdmin更新,则需要执行 sql-update-log目录中的SQL脚本,需要按照文件版本大小,从小到达执行;
|
||||
74
sql/sql-update-log/v3.15.0.sql
Normal file
74
sql/sql-update-log/v3.15.0.sql
Normal file
@@ -0,0 +1,74 @@
|
||||
DROP TABLE IF EXISTS `t_dict_key`;
|
||||
|
||||
DROP TABLE IF EXISTS `t_dict_value`;
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_dict
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_dict`;
|
||||
CREATE TABLE `t_dict` (
|
||||
`dict_id` bigint NOT NULL AUTO_INCREMENT COMMENT '字典id',
|
||||
`dict_name` varchar(500) NOT NULL COMMENT '字典名字',
|
||||
`dict_code` varchar(500) NOT NULL COMMENT '字典编码',
|
||||
`remark` varchar(1000) DEFAULT NULL COMMENT '字典备注',
|
||||
`disabled_flag` tinyint NOT NULL DEFAULT '0' COMMENT '禁用状态',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
PRIMARY KEY (`dict_id`),
|
||||
UNIQUE KEY `unique_code` (`dict_code`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='字典表';
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_dict
|
||||
-- ----------------------------
|
||||
INSERT INTO `t_dict`(`dict_id`, `dict_name`, `dict_code`, `remark`, `disabled_flag`, `create_time`, `update_time`) VALUES (1, '商品地区', 'GOODS_PLACE', '用于商品管理中的商品地区1', 0, '2025-03-27 14:42:26', '2025-03-31 11:23:03');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_dict_data
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_dict_data`;
|
||||
CREATE TABLE `t_dict_data` (
|
||||
`dict_data_id` bigint NOT NULL AUTO_INCREMENT COMMENT '字典数据id',
|
||||
`dict_id` bigint NOT NULL COMMENT '字典id',
|
||||
`data_value` varchar(500) NOT NULL COMMENT '字典项值',
|
||||
`data_label` varchar(500) NOT NULL COMMENT '字典项显示名称',
|
||||
`remark` varchar(1000) DEFAULT NULL COMMENT '备注',
|
||||
`sort_order` int NOT NULL COMMENT '排序(越大越靠前)',
|
||||
`disabled_flag` tinyint NOT NULL DEFAULT '0' COMMENT '禁用状态',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
PRIMARY KEY (`dict_data_id`)
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='字典数据表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Records of t_dict_data
|
||||
-- ----------------------------
|
||||
INSERT INTO `t_dict_data` VALUES (2, 1, 'LUO_YANG', '洛阳', 'sad', 2, 0, '2025-03-27 15:52:39', '2025-03-27 20:53:21');
|
||||
INSERT INTO `t_dict_data` VALUES (3, 1, 'ZHENG_ZHOU', '郑州', '', 0, 0, '2025-03-27 18:58:16', '2025-03-27 20:53:32');
|
||||
INSERT INTO `t_dict_data` VALUES (7, 1, 'BEI_JING', '北京', '', 0, 0, '2025-03-27 20:53:45', '2025-03-27 20:53:45');
|
||||
INSERT INTO `t_dict_data` VALUES (8, 1, 'SHANG_HAI', '上海', '', 0, 0, '2025-03-27 20:53:45', '2025-03-27 20:53:45');
|
||||
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for t_login_log
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS `t_login_log`;
|
||||
CREATE TABLE `t_login_log` (
|
||||
`login_log_id` bigint NOT NULL AUTO_INCREMENT COMMENT '主键',
|
||||
`user_id` int NOT NULL COMMENT '用户id',
|
||||
`user_type` int NOT NULL COMMENT '用户类型',
|
||||
`user_name` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '用户名',
|
||||
`login_ip` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户ip',
|
||||
`login_ip_region` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '用户ip地区',
|
||||
`user_agent` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci COMMENT 'user-agent信息',
|
||||
`login_device` varchar(1000) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '登录设备',
|
||||
`login_result` int NOT NULL COMMENT '登录结果:0成功 1失败 2 退出',
|
||||
`remark` varchar(2000) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '备注',
|
||||
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
|
||||
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
|
||||
PRIMARY KEY (`login_log_id`) USING BTREE,
|
||||
KEY `customer_id` (`user_id`) USING BTREE
|
||||
) ENGINE=InnoDB AUTO_INCREMENT=1905 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='用户登录日志';
|
||||
Reference in New Issue
Block a user