1
0
suochencheng 7 лет назад
Родитель
Сommit
1a6019c66d

+ 9 - 2
pom.xml

@@ -931,12 +931,19 @@
             <version>1.1.4c</version>
         </dependency>
 
+        <!--<dependency>-->
+            <!--<groupId>org.apache.velocity</groupId>-->
+            <!--<artifactId>velocity-engine-core</artifactId>-->
+            <!--<version>2.0</version>-->
+        <!--</dependency>-->
+        <!-- https://mvnrepository.com/artifact/org.apache.velocity/velocity -->
         <dependency>
             <groupId>org.apache.velocity</groupId>
-            <artifactId>velocity-engine-core</artifactId>
-            <version>2.0</version>
+            <artifactId>velocity</artifactId>
+            <version>1.7</version>
         </dependency>
 
+
         <dependency>
             <groupId>org.apache.velocity</groupId>
             <artifactId>velocity-tools</artifactId>

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestaaaoneMapper.java

@@ -0,0 +1,33 @@
+package com.izouma.awesomeadmin.dao;
+
+import java.util.*;
+import com.izouma.awesomeadmin.datasource.DataSource;
+import org.springframework.stereotype.Repository;
+import com.izouma.awesomeadmin.model.Testaaaone;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.TestaaaoneMapper")
+public interface TestaaaoneMapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(Testaaaone record);
+
+    Testaaaone selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(Testaaaone record);
+
+    List<Testaaaone> queryAllTestaaaone(Testaaaone record);
+
+    List<Testaaaone> queryTestaaaoneByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    Testaaaone queryTestaaaone(Testaaaone record);
+
+    List<Testaaaone> query(Testaaaone record);
+}
+

+ 235 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestaaaoneMapper.xml

@@ -0,0 +1,235 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
+<mapper namespace="com.izouma.awesomeadmin.dao.TestaaaoneMapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.Testaaaone" >
+                <id column="id" property="id" jdbcType="INTEGER" />
+                                        <result column="del_flag" property="delFlag" jdbcType="CHAR" />
+                                <result column="test_name" property="testName" jdbcType="VARCHAR" />
+                                <result column="remark" property="remark" jdbcType="VARCHAR" />
+            </resultMap>
+    <sql id="Base_Column_List" >
+        <trim  suffixOverrides="," >
+            id,
+
+            del_flag,
+
+            test_name,
+
+            remark,
+
+            </trim>
+    </sql>
+    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
+        select
+        <include refid="Base_Column_List" />
+        from test_aaa
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from test_aaa
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.Testaaaone" useGeneratedKeys="true" keyProperty="id">
+        insert into test_aaa
+        <trim prefix="(" suffix=")" suffixOverrides="," >
+                <if test="id!= null" >
+                id,
+            </if>
+                <if test="delFlag!= null" >
+                del_flag,
+            </if>
+                <if test="testName!= null" >
+                test_name,
+            </if>
+                <if test="remark!= null" >
+                remark,
+            </if>
+            </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides="," >
+                    <if test="id != null" >
+                #{id,jdbcType=INTEGER},
+            </if>
+                    <if test="delFlag != null" >
+                #{delFlag,jdbcType=CHAR},
+            </if>
+                    <if test="testName != null" >
+                #{testName,jdbcType=VARCHAR},
+            </if>
+                    <if test="remark != null" >
+                #{remark,jdbcType=VARCHAR},
+            </if>
+                </trim>
+    </insert>
+    <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.Testaaaone" >
+        update test_aaa
+        <set >
+                    <if test="id != null" >
+               id= #{id,jdbcType=INTEGER},
+            </if>
+                     <if test="delFlag != null" >
+               del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+                     <if test="testName != null" >
+               test_name= #{testName,jdbcType=VARCHAR},
+            </if>
+                     <if test="remark != null" >
+               remark= #{remark,jdbcType=VARCHAR},
+            </if>
+                 </set>
+        where id = #{id,jdbcType=INTEGER}
+    </update>
+    <select id="queryTestaaaoneByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.Testaaaone">
+        select <include refid="Base_Column_List"/> from test_aaa
+        <where>
+            and del_flag = 'N'
+                    <if test="record.id != null and !&quot;&quot;.equals(record.id)">
+                and  id = #{record.id}
+            </if>
+                     <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
+                and  del_flag = #{record.delFlag}
+            </if>
+                     <if test="record.testName != null and !&quot;&quot;.equals(record.testName)">
+                and  test_name = #{record.testName}
+            </if>
+                     <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
+                and  remark = #{record.remark}
+            </if>
+                  <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
+             <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                OR  test_name LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  remark LIKE concat('%',#{record.searchKey},'%')
+                                                             </trim>
+         </if>
+
+            <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
+                <foreach item="item" index="index" collection="record.advancedQuery.split('_;')">
+                    <choose>
+                        <when test="item.indexOf('like') != -1">
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    concat('%',#{itemDetail},'%')
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </when>
+                        <otherwise>
+                            <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                                <if test="detailIndex == 3">
+                                    #{itemDetail}
+                                </if>
+
+                                <if test="detailIndex &lt; 3">
+                                    ${itemDetail}
+                                </if>
+
+                            </foreach>
+                        </otherwise>
+                    </choose>
+
+
+                </foreach>
+
+
+            </if>
+
+        </where>
+        order by id desc
+    </select>
+    <select id="queryAllTestaaaone" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.Testaaaone">
+        select <include refid="Base_Column_List"/> from test_aaa
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and  id = #{id}
+            </if>
+                    <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and  del_flag = #{delFlag}
+            </if>
+                    <if test="testName != null and !&quot;&quot;.equals(testName)">
+                and  test_name = #{testName}
+            </if>
+                    <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and  remark = #{remark}
+            </if>
+                    <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
+                <trim prefix="and (" suffix=")" prefixOverrides="OR" >
+                                                                                                                                                                                                                                                OR  test_name LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  remark LIKE concat('%',#{searchKey},'%')
+                                                                                        </trim>
+            </if>
+<if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
+    <foreach item="item" index="index" collection="advancedQuery.split('_;')">
+        <choose>
+            <when test="item.indexOf('like') != -1">
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        concat('%',#{itemDetail},'%')
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </when>
+            <otherwise>
+                <foreach item="itemDetail" index="detailIndex" collection="item.split('_,')">
+                    <if test="detailIndex == 3">
+                        #{itemDetail}
+                    </if>
+
+                    <if test="detailIndex &lt; 3">
+                        ${itemDetail}
+                    </if>
+
+                </foreach>
+            </otherwise>
+        </choose>
+
+
+    </foreach>
+
+
+</if>
+        </where>
+        order by id desc
+    </select>
+    <select id="queryTestaaaone" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.Testaaaone">
+        select <include refid="Base_Column_List"/> from test_aaa
+        <where>
+            and del_flag = 'N'
+                    <if test="id != null and !&quot;&quot;.equals(id)">
+                and id = #{id}
+            </if>
+                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
+                and del_flag = #{delFlag}
+            </if>
+                     <if test="testName != null and !&quot;&quot;.equals(testName)">
+                and test_name = #{testName}
+            </if>
+                     <if test="remark != null and !&quot;&quot;.equals(remark)">
+                and remark = #{remark}
+            </if>
+         
+        </where>
+        LIMIT 1
+    </select>
+    <update id="delete">
+        UPDATE test_aaa SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.Testaaaone">
+        select <include refid="Base_Column_List"/> from test_aaa
+        <where>
+            and del_flag = 'N'
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 49 - 35
src/main/java/com/izouma/awesomeadmin/model/DataSourceInfo.java

@@ -1,13 +1,12 @@
 package com.izouma.awesomeadmin.model;
 
-import java.util.*;
 import com.fasterxml.jackson.annotation.JsonAutoDetect;
 import com.fasterxml.jackson.annotation.JsonInclude;
 
 
 @JsonAutoDetect
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class DataSourceInfo{
+public class DataSourceInfo {
     private Integer id;
     private String delFlag;
     private String code;
@@ -16,86 +15,101 @@ public class DataSourceInfo{
     private String username;
     private String password;
     private String databaseName;
+    private String tableName;
 
-private String searchKey;
+    private String searchKey;
 
-/**
-* and,test_name,like,value;or,remark,=,123
-*/
-private String advancedQuery;
+    /**
+     * and,test_name,like,value;or,remark,=,123
+     */
+    private String advancedQuery;
 
-    public Integer getId(){
+    public Integer getId() {
         return this.id;
     }
 
-    public void setId(Integer id){
+    public void setId(Integer id) {
         this.id = id;
     }
-    public String getDelFlag(){
+
+    public String getDelFlag() {
         return this.delFlag;
     }
 
-    public void setDelFlag(String delFlag){
+    public void setDelFlag(String delFlag) {
         this.delFlag = delFlag;
     }
-    public String getCode(){
+
+    public String getCode() {
         return this.code;
     }
 
-    public void setCode(String code){
+    public void setCode(String code) {
         this.code = code;
     }
-    public String getDatabaseType(){
+
+    public String getDatabaseType() {
         return this.databaseType;
     }
 
-    public void setDatabaseType(String databaseType){
+    public void setDatabaseType(String databaseType) {
         this.databaseType = databaseType;
     }
-    public String getUrl(){
+
+    public String getUrl() {
         return this.url;
     }
 
-    public void setUrl(String url){
+    public void setUrl(String url) {
         this.url = url;
     }
-    public String getUsername(){
+
+    public String getUsername() {
         return this.username;
     }
 
-    public void setUsername(String username){
+    public void setUsername(String username) {
         this.username = username;
     }
-    public String getPassword(){
+
+    public String getPassword() {
         return this.password;
     }
 
-    public void setPassword(String password){
+    public void setPassword(String password) {
         this.password = password;
     }
-    public String getDatabaseName(){
+
+    public String getDatabaseName() {
         return this.databaseName;
     }
 
-    public void setDatabaseName(String databaseName){
+    public void setDatabaseName(String databaseName) {
         this.databaseName = databaseName;
     }
 
-public String getSearchKey() {
-    return searchKey;
-}
+    public String getSearchKey() {
+        return searchKey;
+    }
 
-public void setSearchKey(String searchKey) {
-    this.searchKey = searchKey;
-}
+    public void setSearchKey(String searchKey) {
+        this.searchKey = searchKey;
+    }
 
-public String getAdvancedQuery() {
-    return advancedQuery;
-}
+    public String getAdvancedQuery() {
+        return advancedQuery;
+    }
 
-public void setAdvancedQuery(String advancedQuery) {
-    this.advancedQuery = advancedQuery;
-}
+    public void setAdvancedQuery(String advancedQuery) {
+        this.advancedQuery = advancedQuery;
+    }
+
+    public String getTableName() {
+        return tableName;
+    }
 
+    public void setTableName(String tableName) {
+        this.tableName = tableName;
+    }
 }
 

+ 1 - 1
src/main/java/com/izouma/awesomeadmin/model/GenCode.java

@@ -25,7 +25,7 @@ public class GenCode {
     private String tableName;
 
     /**
-     * 
+     * 
      */
     private String className;
 

+ 69 - 0
src/main/java/com/izouma/awesomeadmin/model/Testaaaone.java

@@ -0,0 +1,69 @@
+package com.izouma.awesomeadmin.model;
+
+import java.util.*;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class Testaaaone{
+    private Integer id;
+    private String delFlag;
+    private String testName;
+    private String remark;
+
+private String searchKey;
+
+/**
+* and,test_name,like,value;or,remark,=,123
+*/
+private String advancedQuery;
+
+    public Integer getId(){
+        return this.id;
+    }
+
+    public void setId(Integer id){
+        this.id = id;
+    }
+    public String getDelFlag(){
+        return this.delFlag;
+    }
+
+    public void setDelFlag(String delFlag){
+        this.delFlag = delFlag;
+    }
+    public String getTestName(){
+        return this.testName;
+    }
+
+    public void setTestName(String testName){
+        this.testName = testName;
+    }
+    public String getRemark(){
+        return this.remark;
+    }
+
+    public void setRemark(String remark){
+        this.remark = remark;
+    }
+
+public String getSearchKey() {
+    return searchKey;
+}
+
+public void setSearchKey(String searchKey) {
+    this.searchKey = searchKey;
+}
+
+public String getAdvancedQuery() {
+    return advancedQuery;
+}
+
+public void setAdvancedQuery(String advancedQuery) {
+    this.advancedQuery = advancedQuery;
+}
+
+}
+

+ 27 - 0
src/main/java/com/izouma/awesomeadmin/service/TestaaaoneService.java

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.Testaaaone;
+
+
+/**
+*  service接口类
+*/
+public interface TestaaaoneService{
+
+    List<Testaaaone> getTestaaaoneList(Testaaaone record);
+
+    List<Testaaaone> getTestaaaoneByPage(Page page, Testaaaone record);
+
+    Testaaaone getTestaaaoneById(String id);
+
+    Testaaaone getTestaaaone(Testaaaone record);
+
+    boolean createTestaaaone(Testaaaone record);
+
+    boolean deleteTestaaaone(String id);
+
+    boolean updateTestaaaone(Testaaaone record);
+}
+

+ 137 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/TestaaaoneServiceImpl.java

@@ -0,0 +1,137 @@
+package com.izouma.awesomeadmin.service.impl;
+
+import java.util.*;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.Testaaaone;
+import com.izouma.awesomeadmin.service.TestaaaoneService;
+import com.izouma.awesomeadmin.dao.TestaaaoneMapper;
+
+/**
+*  service接口实现类
+*/
+@Service
+public class TestaaaoneServiceImpl implements TestaaaoneService{
+
+    private static Logger logger = Logger.getLogger(TestaaaoneServiceImpl.class);
+
+    @Autowired
+    private TestaaaoneMapper testaaaoneMapper;
+
+    @Override
+    public List<Testaaaone> getTestaaaoneList(Testaaaone record) {
+
+        logger.info("getTestaaaoneList");
+        try {
+
+        return testaaaoneMapper.queryAllTestaaaone(record);
+        } catch (Exception e) {
+        logger.error("getTestaaaoneList", e);
+        }
+
+        return null;
+    }
+    @Override
+    public List<Testaaaone> getTestaaaoneByPage(Page page, Testaaaone record) {
+
+        logger.info("getTestaaaoneByPage");
+        try {
+
+        Map<String, Object> parameter = new HashMap<String, Object>();
+        parameter.put("record", record);
+        parameter.put(AppConstant.PAGE, page);
+
+        return testaaaoneMapper.queryTestaaaoneByPage(parameter);
+        } catch (Exception e) {
+        logger.error("getTestaaaoneByPage", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public Testaaaone getTestaaaoneById(String id) {
+
+        logger.info("getTestaaaoneyId");
+        try {
+
+            return testaaaoneMapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+        logger.error("getTestaaaoneById", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public Testaaaone getTestaaaone(Testaaaone record) {
+
+        logger.info("getTestaaaone");
+        try {
+
+            return testaaaoneMapper.queryTestaaaone(record);
+        } catch (Exception e) {
+        logger.error("getTestaaaone", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public boolean createTestaaaone(Testaaaone record) {
+
+        logger.info("createTestaaaone");
+        try {
+
+            int updates = testaaaoneMapper.insertSelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+            logger.error("createTestaaaone", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean deleteTestaaaone(String id) {
+
+        logger.info("deleteTestaaaone");
+        try {
+
+             int updates = testaaaoneMapper.delete(id);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("deleteTestaaaone", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean updateTestaaaone(Testaaaone record) {
+
+        logger.info("updateTestaaaone");
+        try {
+
+            int updates = testaaaoneMapper.updateByPrimaryKeySelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("updateTestaaaone", e);
+        }
+
+        return false;
+    }
+}
+

+ 89 - 0
src/main/java/com/izouma/awesomeadmin/util/DatabaseUtil.java

@@ -1,6 +1,9 @@
 package com.izouma.awesomeadmin.util;
 
 import com.izouma.awesomeadmin.model.DataSourceInfo;
+import com.izouma.awesomeadmin.model.TableField;
+import com.izouma.codegenerator.GeneratorTool;
+import org.apache.commons.lang.StringUtils;
 
 import java.sql.Connection;
 import java.sql.ResultSet;
@@ -70,5 +73,91 @@ public class DatabaseUtil {
         return tables;
     }
 
+    public static List<TableField> loadTableFields(DataSourceInfo dataSourceInfo) {
+
+
+        List<TableField> tableFields = new ArrayList<>();
+
+
+        String DRIVER = "com.mysql.jdbc.Driver";
+
+        PropertiesFileLoader propertiesFileLoader = PropertiesFileLoader.getInstance();
+
+        String databaseName = propertiesFileLoader.getProperties("properties/jdbc.properties", "jdbc.databaseName");
+        String sql = "select * from information_schema.columns where  table_schema ='" + databaseName + "' and table_name = '" + dataSourceInfo.getTableName() + "' ;";
+
+        String url = propertiesFileLoader.getProperties("properties/jdbc.properties", "jdbc.url");
+        String user = propertiesFileLoader.getProperties("properties/jdbc.properties", "jdbc.username");
+        String password = propertiesFileLoader.getProperties("properties/jdbc.properties", "jdbc.password");
+
+        if (!StringUtils.isNotEmpty(dataSourceInfo.getCode())) {
+            dataSourceInfo.setDatabaseType("Mysql");
+            dataSourceInfo.setCode("dataSource");
+        }
+
+        if (!"dataSource".equals(dataSourceInfo.getCode())) {
+            if ("Mysql".equals(dataSourceInfo.getDatabaseType())) {
+                url = "jdbc:mysql://" + dataSourceInfo.getUrl() + "/" + dataSourceInfo.getDatabaseName();
+                user = dataSourceInfo.getUsername();
+                password = dataSourceInfo.getPassword();
+            } else if ("SqlServer".equals(dataSourceInfo.getDatabaseType())) {
+                DRIVER = "com.microsoft.sqlserver.jdbc.SQLServerDriver";
+                url = "jdbc:sqlserver://" + dataSourceInfo.getUrl() + ";DatabaseName=" + dataSourceInfo.getDatabaseName();
+                user = dataSourceInfo.getUsername();
+                password = dataSourceInfo.getPassword();
+                sql = "sp_columns " + dataSourceInfo.getTableName() + ";";
+            }
+
+        }
+
+
+        Connection conn = JDBC.connectDB(DRIVER, url, user, password);
+        try {
+            Statement stmt = conn.createStatement();
+            ResultSet rs = stmt.executeQuery(sql);
+            while (rs.next()) {
+                TableField tableField = new TableField();
+
+                if ("Mysql".equals(dataSourceInfo.getDatabaseType())) {
+                    tableField.setName(rs.getString("COLUMN_NAME"));
+                    tableField.setDefaultValue(rs.getString("COLUMN_DEFAULT"));
+                    tableField.setJdbcType(rs.getString("DATA_TYPE"));
+                    tableField.setLength(rs.getInt("CHARACTER_MAXIMUM_LENGTH"));
+                    tableField.setNotNull("NO".equals(rs.getString("IS_NULLABLE")) ? true : false);
+                    tableField.setPrimaryKey("PRI".equals(rs.getString("COLUMN_KEY")) ? true : false);
+                    tableField.setAutoIncrease("auto_increment".equals(rs.getString("EXTRA")) ? true : false);
+                    tableField.setRemark(rs.getString("COLUMN_COMMENT"));
+                    tableField.setShowInForm(true);
+                    tableField.setShowInList(true);
+                    tableField.setSearchable("varchar".equalsIgnoreCase(tableField.getJdbcType()) ? true : false);
+                    tableField.setFormType("singleLineText");
+
+                } else if ("SqlServer".equals(dataSourceInfo.getDatabaseType())) {
+                    tableField.setName(rs.getString("COLUMN_NAME"));
+                    tableField.setJdbcType(GeneratorTool.SqlServerJdbcType2Mysql(rs.getString("TYPE_NAME")));
+                    tableField.setLength(rs.getInt("PRECISION"));
+                    tableField.setNotNull("NO".equals(rs.getString("IS_NULLABLE")) ? true : false);
+                    tableField.setShowInForm(true);
+                    tableField.setShowInList(true);
+                    tableField.setSearchable("varchar".equalsIgnoreCase(tableField.getJdbcType()) ? true : false);
+                    tableField.setFormType("singleLineText");
+                }
+
+
+                tableFields.add(tableField);
+            }
+        } catch (SQLException e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                conn.close();
+            } catch (SQLException e) {
+                e.printStackTrace();
+            }
+        }
+
+        return tableFields;
+    }
+
 
 }

+ 62 - 3
src/main/java/com/izouma/awesomeadmin/web/GenCodeController.java

@@ -5,9 +5,14 @@ import java.util.*;
 import java.util.regex.Pattern;
 
 import com.google.gson.Gson;
+import com.izouma.awesomeadmin.model.DataSourceInfo;
 import com.izouma.awesomeadmin.model.GenCode;
+import com.izouma.awesomeadmin.model.TableField;
+import com.izouma.awesomeadmin.service.DataSourceInfoService;
+import com.izouma.awesomeadmin.util.DatabaseUtil;
 import com.izouma.awesomeadmin.util.PinYinUtil;
 import com.izouma.codegenerator.*;
+import org.apache.commons.lang.StringUtils;
 import org.apache.commons.text.CaseUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
@@ -30,6 +35,9 @@ public class GenCodeController extends BaseController {
     @Autowired
     private GenCodeService genCodeService;
 
+    @Autowired
+    private DataSourceInfoService dataSourceInfoService;
+
     /**
      * <p>获取全部记录。</p>
      */
@@ -128,12 +136,17 @@ public class GenCodeController extends BaseController {
             tableName = PinYinUtil.getStringPinYin(tableName);
         }
 
-        record.setClassName(CaseUtils.toCamelCase(tableName, true, '_'));
+        if (StringUtils.isNotEmpty(record.getClassName())) {
 
-        if (record.getReadTable()) {
-            ReadTableGenerator.ReadTable(record);
+            record.setClassName(CaseUtils.toCamelCase(record.getClassName(), true, '_'));
+        } else {
+            record.setClassName(CaseUtils.toCamelCase(tableName, true, '_'));
         }
 
+//        if (record.getReadTable()) {
+//            ReadTableGenerator.ReadTable(record);
+//        }
+
 
         GeneratorTool.getImports(record);
 
@@ -197,5 +210,51 @@ public class GenCodeController extends BaseController {
         return new Result(true, map);
     }
 
+    @RequestMapping(value = "/tables", method = RequestMethod.GET)
+    @ResponseBody
+    public Result tables(DataSourceInfo dataSourceInfo) {
+
+        if (StringUtils.isNotEmpty(dataSourceInfo.getCode())) {
+            dataSourceInfo = dataSourceInfoService.getDataSourceInfo(dataSourceInfo);
+            if (dataSourceInfo != null) {
+
+                List<String> pp = DatabaseUtil.loadDatabaseTables(dataSourceInfo);
+                return new Result(true, pp);
+            }
+        } else {
+            List<String> pp = DatabaseUtil.loadDatabaseTables(dataSourceInfo);
+            return new Result(true, pp);
+        }
+
+
+        return new Result(false, "获取失败");
+    }
+
+    @RequestMapping(value = "/tableFields", method = RequestMethod.GET)
+    @ResponseBody
+    public Result tableFields(DataSourceInfo dataSourceInfo) {
+
+        String tableName = dataSourceInfo.getTableName();
+
+        if (StringUtils.isNotEmpty(dataSourceInfo.getCode())) {
+
+            if (!"dataSource".equals(dataSourceInfo.getCode())) {
+
+                dataSourceInfo = dataSourceInfoService.getDataSourceInfo(dataSourceInfo);
+            }
+            if (dataSourceInfo != null) {
+                dataSourceInfo.setTableName(tableName);
+                List<TableField> pp = DatabaseUtil.loadTableFields(dataSourceInfo);
+                return new Result(true, pp);
+            }
+        } else {
+            List<TableField> pp = DatabaseUtil.loadTableFields(dataSourceInfo);
+            return new Result(true, pp);
+        }
+
+
+        return new Result(false, "获取失败");
+    }
+
 }
 

+ 155 - 0
src/main/java/com/izouma/awesomeadmin/web/TestaaaoneController.java

@@ -0,0 +1,155 @@
+package com.izouma.awesomeadmin.web;
+
+import java.util.*;
+
+import com.izouma.awesomeadmin.util.ExportExcelUtil;
+import org.apache.commons.lang.StringUtils;
+import org.apache.shiro.authz.annotation.RequiresAuthentication;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.dto.Result;
+import com.izouma.awesomeadmin.model.Testaaaone;
+import com.izouma.awesomeadmin.service.TestaaaoneService;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+*  controller类
+*/
+@Controller
+@RequestMapping("/testaaaone")
+public class TestaaaoneController extends BaseController{
+
+    @Autowired
+    private TestaaaoneService testaaaoneService;
+
+    /**
+    * <p>获取全部记录。</p>
+    */
+    @RequiresAuthentication
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ResponseBody
+    public Result all(Testaaaone record) {
+        List<Testaaaone> pp = testaaaoneService.getTestaaaoneList(record);
+        return new Result(true, pp);
+    }
+
+    /**
+    * <p>根据Id。</p>
+    */
+    @RequestMapping(value = "/getTestaaaone", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getTestaaaone(@RequestParam(required = false, value = "id") String id) {
+        Testaaaone data = testaaaoneService.getTestaaaoneById(id);
+        return new Result(true, data);
+    }
+
+    /**
+    * <p>根据条件获取。</p>
+    */
+    @RequestMapping(value = "/getOne", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getOne(Testaaaone record) {
+        Testaaaone data = testaaaoneService.getTestaaaone(record);
+        return new Result(true, data);
+    }
+
+
+    /**
+    * <p>分页查询。</p>
+    */
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    @ResponseBody
+    public Result page(Page page, Testaaaone record) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<Testaaaone> pp =testaaaoneService.getTestaaaoneByPage(page, record);
+
+        result.put(AppConstant.PAGE, page);
+        result.put("pp", pp);
+        return new Result(true, result);
+    }
+
+
+    /**
+    * <p>保存。</p>
+    */
+    @RequestMapping(value = "/save", method = RequestMethod.POST)
+    @ResponseBody
+    public Result save(Testaaaone record) {
+        boolean num = testaaaoneService.createTestaaaone(record);
+        if (num) {
+        return new Result(true, record.getId());
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>更新信息。</p>
+    */
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public Result updateTestaaaone(Testaaaone record) {
+        boolean num = testaaaoneService.updateTestaaaone(record);
+        if (num) {
+        return new Result(true, "保存成功");
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>删除。</p>
+    */
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    @ResponseBody
+    public Result deleteTestaaaone(@RequestParam(required = true, value = "id") String id) {
+
+        boolean num = testaaaoneService.deleteTestaaaone(id);
+        if (num) {
+        return new Result(true, "删除成功");
+        }
+        return new Result(false, "删除异常");
+    }
+
+    /**
+    * 导出Excel
+    * @param request
+    * @param response
+    * @param record
+    * @throws Exception
+    */
+    @RequestMapping(value = "/exportExcel", method = RequestMethod.GET)
+    @ResponseBody
+    public void exportExcel(HttpServletRequest request, HttpServletResponse response, Testaaaone record) throws Exception {
+
+    List<Testaaaone> testaaaones = testaaaoneService.getTestaaaoneList(record);
+
+
+        String sheetName = "test_aaa";
+        String titleName = "Testaaaone数据表";
+        String fileName = "Testaaaone表";
+        int columnNumber = 4;
+        int[] columnWidth = { 20,  20,  20,  20 };
+        String[] columnName = {  "" ,   "删除标识" ,   "名字" ,   "备注"  };
+        String[][] dataList = new String[testaaaones.size()][4];
+
+        for (int i = 0; i < testaaaones.size(); i++) {
+
+                        dataList[i][0] = String.valueOf(testaaaones.get(i).getId());
+                        dataList[i][1] = String.valueOf(testaaaones.get(i).getDelFlag());
+                        dataList[i][2] = String.valueOf(testaaaones.get(i).getTestName());
+                        dataList[i][3] = String.valueOf(testaaaones.get(i).getRemark());
+                    }
+
+
+        ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
+        columnNumber, columnWidth, columnName, dataList, response);
+
+
+        }
+    }
+

+ 17 - 0
src/main/java/com/izouma/codegenerator/GeneratorTool.java

@@ -82,7 +82,24 @@ public class GeneratorTool {
     }
 
 
+
+    public static String SqlServerJdbcType2Mysql(String jdbcType) {
+
+        if (jdbcType.equalsIgnoreCase("int identity")) {
+            return "int";
+        } else if (jdbcType.equalsIgnoreCase("nvarchar")) {
+            return "varchar";
+        } else if (jdbcType.equalsIgnoreCase("ntext")) {
+            return "text";
+        }else if (jdbcType.equalsIgnoreCase("nchar")) {
+            return "char";
+        }
+        return jdbcType;
+    }
+
     public static void main(String[] args) {
 
     }
+
+
 }

+ 1 - 0
src/main/resources/properties/jdbc.properties

@@ -4,6 +4,7 @@ jdbc.driverClassName=org.gjt.mm.mysql.Driver
 jdbc.url=jdbc:mysql://120.55.131.232:3306/jee_zouma
 jdbc.username=microball
 jdbc.password=2wsx@WSX#EDC
+jdbc.databaseName=jee_zouma
 
 DRIVER="com.mysql.jdbc.Driver";
 

+ 1 - 2
src/main/resources/templates/ControllerTemplate.vm

@@ -143,8 +143,7 @@ public class ${model.className}Controller extends BaseController{
         for (int i = 0; i < ${display.uncapitalize(${model.className})}s.size(); i++) {
 
             #foreach(${field} in ${model.fields})
-                #set($fund=$foreach.count - 1)
-            dataList[i][$fund] = String.valueOf(${display.uncapitalize(${model.className})}s.get(i).get${display.capitalize($field.modelName)}());
+            dataList[i][${foreach.index}] = String.valueOf(${display.uncapitalize(${model.className})}s.get(i).get${display.capitalize($field.modelName)}());
             #end
         }
 

+ 0 - 10
src/main/resources/templates/ListTemplate.vm

@@ -7,16 +7,6 @@
              #end
              #end*#
             <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
-              <!--<el-select placeholder="性别" size="small" v-model="filter2" clearable class="filter-item">
-                <el-option
-                        label="女"
-                        value="item1">
-                </el-option>
-                <el-option
-                        label="男"
-                        value="item2">
-                </el-option>
-            </el-select>-->
               <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
               </el-button>
             <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询

+ 4 - 0
src/main/resources/templates/MapperXmlSqlServerTemplate.vm

@@ -78,7 +78,9 @@
                 <trim prefix="and (" suffix=")" prefixOverrides="OR" >
                     #foreach($field in $model.fields)
                         #if(${field.name}!='id'&&${field.name}!='ID')
+                            #if(${field.searchable})
                             OR  ${field.name} LIKE concat('%',#{record.searchKey},'%')
+                            #end
                         #end
                     #end
                 </trim>
@@ -137,7 +139,9 @@
                 <trim prefix="and (" suffix=")" prefixOverrides="OR" >
                     #foreach($field in $model.fields)
                         #if(${field.name}!='id'&&${field.name}!='ID')
+                            #if(${field.searchable})
                             OR  ${field.name} LIKE concat('%',#{searchKey},'%')
+                            #end
                         #end
                     #end
                 </trim>

+ 2 - 2
src/main/resources/templates/MapperXmlTemplate.vm

@@ -70,7 +70,7 @@
              <trim prefix="and (" suffix=")" prefixOverrides="OR" >
              #foreach($field in $model.fields)
                  #if(${field.name}!='id'&&${field.name}!='ID')
-                  #if(${field.showInForm})
+                  #if(${field.searchable})
                  OR  ${field.name} LIKE concat('%',#{record.searchKey},'%')
                   #end
                  #end
@@ -129,7 +129,7 @@
                 <trim prefix="and (" suffix=")" prefixOverrides="OR" >
                     #foreach($field in $model.fields)
                         #if(${field.name}!='id'&&${field.name}!='ID')
-                            #if(${field.showInForm})
+                            #if(${field.searchable})
                             OR  ${field.name} LIKE concat('%',#{searchKey},'%')
                             #end
                         #end

+ 304 - 229
src/main/vue/src/pages/GenCode.vue

@@ -1,21 +1,22 @@
 <template>
     <div v-loading="loading" element-loading-text="拼命加载中">
         <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small">
-            <el-form-item prop="tableName" label="表名">
-                <el-input v-model="formData.tableName" style="width: 400px;"></el-input>
-            </el-form-item>
-            <el-form-item prop="remark" label="描述">
-                <el-input v-model="formData.remark" style="width: 400px;"></el-input>
-            </el-form-item>
             <el-form-item prop="readTable" label="读表">
 
                 <el-switch :value="formData.readTable" on-text="读表" off-text="不读" @change="updateReadTable()">
                 </el-switch>
 
             </el-form-item>
+            <el-form-item prop="className" label="类名">
+                <el-input v-model="formData.className" style="width: 400px;"></el-input>
+            </el-form-item>
+
+            <el-form-item prop="remark" label="描述">
+                <el-input v-model="formData.remark" style="width: 400px;"></el-input>
+            </el-form-item>
+
             <el-form-item prop="dataBaseType" label="库类型">
-                <el-select placeholder="库类型" size="small" v-model="formData.dataBaseType" @change="cityDataBaseType"
-                           class="filter-item">
+                <el-select placeholder="库类型" size="small" v-model="formData.dataBaseType" @change="changeDataBaseType" class="filter-item">
                     <el-option label="Mysql" value="Mysql">
                     </el-option>
                     <el-option label="SqlServer" value="SqlServer">
@@ -24,9 +25,19 @@
             </el-form-item>
             <el-form-item prop="datasourceInfo" label="数据库">
 
-                <el-select placeholder="数据库" size="small" v-model="formData.dataSourceCode" class="filter-item">
-                    <el-option v-for="item in datasourceInfoList" :label="item.databaseName" :value="item.code"
-                               :key="item.code"></el-option>
+                <el-select placeholder="数据库" size="small" v-model="formData.dataSourceCode" @change="changeDataSourceCode" class="filter-item">
+                    <el-option v-for="item in datasourceInfoList" :label="item.databaseName" :value="item.code" :key="item.code"></el-option>
+                </el-select>
+
+            </el-form-item>
+
+            <el-form-item prop="tableName" label="表名" v-if="!formData.readTable">
+                <el-input v-model="formData.tableName" style="width: 400px;"></el-input>
+            </el-form-item>
+            <el-form-item prop="tableName" label="表名" v-if="formData.readTable">
+
+                <el-select placeholder="表名" size="small" clearable filterable v-model="formData.tableName" @change="changeTableName" class="filter-item">
+                    <el-option v-for="item in tableList" :label="item" :value="item" :key="item"></el-option>
                 </el-select>
 
             </el-form-item>
@@ -41,7 +52,7 @@
             <el-form-item prop="javaPath" label="根目录">
                 <el-input v-model="formData.rootPath"></el-input>
             </el-form-item>
-            <el-form-item prop="fields" label="数据" v-if="!formData.readTable">
+            <el-form-item prop="fields" label="数据">
                 <el-tabs value="1" type="border-card">
                     <el-tab-pane label="字段" name="1">
                         <el-table :data="fields">
@@ -53,8 +64,7 @@
                             <el-table-column prop="type" label="类型" width="150" align="center">
                                 <template slot-scope="{row}">
                                     <el-select v-model="row.jdbcType" filterable>
-                                        <el-option v-for="item in fieldTypes" :value="item" :label="item"
-                                                   :key="item"></el-option>
+                                        <el-option v-for="item in fieldTypes" :value="item" :label="item" :key="item"></el-option>
                                     </el-select>
                                 </template>
                             </el-table-column>
@@ -112,7 +122,7 @@
                             </el-table-column>
                             <el-table-column prop="showInForm" label="表单" width="50" align="center">
                                 <template slot-scope="{row}">
-                                    <el-checkbox v-model="row.showInForm" :disabled="row.primaryKey"></el-checkbox>
+                                    <el-checkbox v-model="row.showInForm" :disabled="row.primaryKey&&!formData.readTable"></el-checkbox>
                                 </template>
                             </el-table-column>
                             <el-table-column prop="searchable" label="搜索" width="50" align="center">
@@ -123,19 +133,17 @@
                             <el-table-column prop="formType" label="表单类型" width="150" align="center">
                                 <template slot-scope="{row}">
                                     <el-select v-model="row.formType">
-                                        <el-option v-for="item in formTypes" :label="item.label" :value="item.value"
-                                                   :key="item.value"></el-option>
+                                        <el-option v-for="item in formTypes" :label="item.label" :value="item.value" :key="item.value"></el-option>
                                     </el-select>
                                 </template>
                             </el-table-column>
-                            <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
+                            <!-- <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
                                 <template slot-scope="{row}">
                                     <el-select v-model="row.searchMethod">
-                                        <el-option v-for="item in searchMethods" :label="item" :value="item"
-                                                   :key="item"></el-option>
+                                        <el-option v-for="item in searchMethods" :label="item" :value="item" :key="item"></el-option>
                                     </el-select>
                                 </template>
-                            </el-table-column>
+                            </el-table-column> -->
                         </el-table>
                     </el-tab-pane>
                     <el-tab-pane label="表单校验" name="3">
@@ -175,8 +183,7 @@
                             <el-table-column prop="validatorType" label="校验类型" width="150" align="center">
                                 <template slot-scope="{row}">
                                     <el-select v-model="row.validatorType">
-                                        <el-option v-for="item in validatorTypes" :label="item.label"
-                                                   :value="item.label" :key="item.label"></el-option>
+                                        <el-option v-for="item in validatorTypes" :label="item.label" :value="item.label" :key="item.label"></el-option>
                                     </el-select>
                                 </template>
                             </el-table-column>
@@ -194,234 +201,302 @@
 </template>
 
 <script>
-    import axios from 'axios'
-
-    export default {
-        created() {
-            if (this.$route.query.id) {
-                this.loading = true;
-                this.$http.get({
-                    url: '/genCode/getOne',
-                    data: {
-                        id: this.$route.query.id
-                    }
-                }).then(res => {
-                    this.loading = false;
-                    if (res.success) {
-                        this.formData = {
-                            ...this.formData,
-                            ...JSON.parse(res.data.genJson)
-                        };
-                        this.fields = this.formData.fields;
-                        this.formData.id = res.data.id;
-                        this.formData.genRouter = false;
-                    }
-                }).catch(e => this.loading = false)
-            }
+import axios from 'axios'
 
+export default {
+    created() {
+        if (this.$route.query.id) {
+            this.loading = true;
             this.$http.get({
-                url: '/genCode/getSrcPath'
-            }).then(res => {
-                if (res.success) {
-                    this.formData.rootPath = res.data.root;
-                    this.formData.javaPathRelative = res.data.javaPath;
-                    this.formData.viewPathRelative = res.data.viewPath;
-                    this.formData.routerPathRelative = res.data.routerPath;
+                url: '/genCode/getOne',
+                data: {
+                    id: this.$route.query.id
                 }
-            });
-            this.$http.get({
-                url: '/dataSourceInfo/all'
             }).then(res => {
+                this.loading = false;
                 if (res.success) {
-                    this.MysqlDataSourceInfos.push(this.baseDataSource);
+                    this.formData = {
+                        ...this.formData,
+                        ...JSON.parse(res.data.genJson)
+                    };
+                    this.fields = this.formData.fields;
+                    this.formData.id = res.data.id;
+                    this.formData.genRouter = false;
+                }
+            }).catch(e => this.loading = false)
+        }
+
+        this.$http.get({
+            url: '/genCode/getSrcPath'
+        }).then(res => {
+            if (res.success) {
+                this.formData.rootPath = res.data.root;
+                this.formData.javaPathRelative = res.data.javaPath;
+                this.formData.viewPathRelative = res.data.viewPath;
+                this.formData.routerPathRelative = res.data.routerPath;
+            }
+        });
+        this.$http.get({
+            url: '/dataSourceInfo/all'
+        }).then(res => {
+            if (res.success) {
+                this.MysqlDataSourceInfos.push(this.baseDataSource);
+
+                if (res.data.length > 0) {
+                    res.data.forEach(item => {
+                        if ('Mysql' == item.databaseType) {
+                            this.MysqlDataSourceInfos.push(item);
+                        } else if ('SqlServer' == item.databaseType) {
+                            this.SqlServerDataSourceInfos.push(item);
+                        }
+                    })
+                }
+                this.datasourceInfoList = this.MysqlDataSourceInfos;
+            }
+        });
+
+
+        this.getDatabaseTables();
+
 
-                    if (res.data.length > 0) {
-                        res.data.forEach(item => {
-                            if ('Mysql' == item.databaseType) {
-                                this.MysqlDataSourceInfos.push(item);
-                            } else if ('SqlServer' == item.databaseType) {
-                                this.SqlServerDataSourceInfos.push(item);
+    },
+    data() {
+        return {
+            loading: false,
+            fieldTypes: ['char', 'varchar', 'int', 'text', 'timestamp', 'datetime', 'decimal', 'float'],
+            searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'between', 'like', 'left like', 'right like'],
+            formTypes: [
+                { label: '单行文本', value: 'singleLineText' },
+                { label: '多行文本', value: 'textarea' },
+                { label: '富文本', value: 'richText' },
+                { label: '数字', value: 'number' },
+                { label: '日期选择', value: 'date' },
+                { label: '单选下拉框', value: 'select' },
+                { label: '多选下拉框', value: 'multiSelect' },
+                { label: '单图上传', value: 'singleImage' },
+                { label: '多图上传', value: 'multiImage' },
+                { label: '文件上传', value: 'fileUpload' },
+                { label: '树形选择', value: 'tree' },
+                { label: '开关', value: 'switch' }
+            ],
+            validatorTypes: [
+                { label: '英文', value: 'english' },
+                { label: '数字', value: 'number' },
+                { label: '手机', value: 'phone' },
+                { label: '网址', value: 'url' },
+                { label: '电子邮件', value: 'email' },
+                { label: '身份证', value: 'id' }
+            ],
+            rules: {
+                className: [
+                    { required: true, message: '请填写类名', trigger: 'blur' },
+                    {
+                        validator: (rule, value, callback) => {
+                            if (value) {
+                                if (/^[\u4e00-\u9fa5a-zA-Z0-9_]*$/.test(value)) {
+                                    callback();
+                                } else {
+                                    callback(new Error('类名不正确'));
+                                }
                             }
-                        })
+                        }, trigger: 'blur'
                     }
-                    this.datasourceInfoList = this.MysqlDataSourceInfos;
-                }
-            })
-        },
-        data() {
-            return {
-                loading: false,
-                fieldTypes: ['char', 'varchar', 'int', 'text', 'timestamp', 'datetime', 'decimal', 'float'],
-                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'between', 'like', 'left like', 'right like'],
-                formTypes: [
-                    {label: '单行文本', value: 'singleLineText'},
-                    {label: '多行文本', value: 'textarea'},
-                    {label: '富文本', value: 'richText'},
-                    {label: '数字', value: 'number'},
-                    {label: '日期选择', value: 'date'},
-                    {label: '单选下拉框', value: 'select'},
-                    {label: '多选下拉框', value: 'multiSelect'},
-                    {label: '单图上传', value: 'singleImage'},
-                    {label: '多图上传', value: 'multiImage'},
-                    {label: '文件上传', value: 'fileUpload'},
-                    {label: '树形选择', value: 'tree'},
-                    {label: '开关', value: 'switch'}
                 ],
-                validatorTypes: [
-                    {label: '英文', value: 'english'},
-                    {label: '数字', value: 'number'},
-                    {label: '手机', value: 'phone'},
-                    {label: '网址', value: 'url'},
-                    {label: '电子邮件', value: 'email'},
-                    {label: '身份证', value: 'id'}
-                ],
-                rules: {
-                    tableName: [
-                        {required: true, message: '请填写表名', trigger: 'blur'},
-                        {
-                            validator: (rule, value, callback) => {
-                                if (value) {
-                                    if (/^[\u4e00-\u9fa5a-zA-Z0-9_]*$/.test(value)) {
-                                        callback();
-                                    } else {
-                                        callback(new Error('表名不正确'));
-                                    }
-                                }
-                            }, trigger: 'blur'
-                        }
-                    ],
-                    remark: [{required: true, message: '请填写描述', trigger: 'blur'}],
-                    rootPath: [{required: true, message: '请填写生成目录', trigger: 'blur'}],
-                    dataBaseType: [{required: true, message: '请选择数据库类型', trigger: 'blur'}],
-                    dataSourceCode: [{required: true, message: '请填选择数据库', trigger: 'blur'}],
-                },
-                formData: {
-                    tableName: '',
-                    remark: '',
-                    genTable: true,
-                    genClass: true,
-                    genList: true,
-                    genForm: true,
-                    genRouter: true,
-                    rootPath: '',
-                    javaPathRelative: '',
-                    viewPathRelative: '',
-                    dataBaseType: 'Mysql',
-                    readTable: false,
-                    dataSourceCode: 'dataSource'
-                },
-                fields: [
-                    {
-                        name: 'id',
-                        jdbcType: 'int',
-                        notNull: true,
-                        primaryKey: true,
-                        autoIncrease: true,
-                        remark: '',
-                        showInList: false,
-                        showInForm: false,
-                        searchable: false
-                    },
+                tableName: [
+                    { required: true, message: '请填写表名', trigger: 'blur' },
                     {
-                        name: 'del_flag',
-                        jdbcType: 'char',
-                        notNull: true,
-                        primaryKey: false,
-                        autoIncrease: false,
-                        remark: '删除标识',
-                        showInList: false,
-                        showInForm: false,
-                        searchable: false,
-                        defaultValue: 'N',
-                        length: 1
-                    },
+                        validator: (rule, value, callback) => {
+                            if (value) {
+                                if (/^[\u4e00-\u9fa5a-zA-Z0-9_]*$/.test(value)) {
+                                    callback();
+                                } else {
+                                    callback(new Error('表名不正确'));
+                                }
+                            }
+                        }, trigger: 'blur'
+                    }
                 ],
-                MysqlDataSourceInfos: [],
-                SqlServerDataSourceInfos: [],
-                baseDataSource: {
-                    databaseType: 'Mysql',
-                    code: 'dataSource',
-                    databaseName: '基础数据库'
+                remark: [{ required: true, message: '请填写描述', trigger: 'blur' }],
+                rootPath: [{ required: true, message: '请填写生成目录', trigger: 'blur' }],
+                dataBaseType: [{ required: true, message: '请选择数据库类型', trigger: 'blur' }],
+                dataSourceCode: [{ required: true, message: '请填选择数据库', trigger: 'blur' }],
+            },
+            formData: {
+                tableName: '',
+                remark: '',
+                genTable: true,
+                genClass: true,
+                genList: true,
+                genForm: true,
+                genRouter: true,
+                rootPath: '',
+                javaPathRelative: '',
+                viewPathRelative: '',
+                dataBaseType: 'Mysql',
+                readTable: false,
+                dataSourceCode: 'dataSource',
+                className: '',
 
+            },
+            fields: [
+                {
+                    name: 'id',
+                    jdbcType: 'int',
+                    notNull: true,
+                    primaryKey: true,
+                    autoIncrease: true,
+                    remark: '',
+                    showInList: false,
+                    showInForm: false,
+                    searchable: false
                 },
-                datasourceInfoList: [],
+                {
+                    name: 'del_flag',
+                    jdbcType: 'char',
+                    notNull: true,
+                    primaryKey: false,
+                    autoIncrease: false,
+                    remark: '删除标识',
+                    showInList: false,
+                    showInForm: false,
+                    searchable: false,
+                    defaultValue: 'N',
+                    length: 1
+                },
+            ],
+            MysqlDataSourceInfos: [],
+            SqlServerDataSourceInfos: [],
+            baseDataSource: {
+                databaseType: 'Mysql',
+                code: 'dataSource',
+                databaseName: '基础数据库'
+
+            },
+            datasourceInfoList: [],
+            tableList: [],
+        }
+    },
+    computed: {
+        editableFields() {
+            return this.fields.filter(i => {
+                return i.name
+            });
+        }
+    },
+    methods: {
+        onSave() {
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    this.submit();
+                } else {
+                    return false;
+                }
+            });
+        },
+        submit() {
+
+            this.formData.fields = this.fields;
+            this.formData.javaPath = this.formData.rootPath + this.formData.javaPathRelative;
+            this.formData.viewPath = this.formData.rootPath + this.formData.viewPathRelative;
+            this.formData.routerPath = this.formData.rootPath + this.formData.routerPathRelative;
+            this.formData.genJson = '';
+
+            this.$alert('生成代码可能会删除已有同名表、数据或文件,确认要生成么?', '警告', { type: 'error' }).then(() => {
+                this.loading = true;
+                return axios.post(this.formData.id ? '/genCode/update' : '/genCode/save', this.formData)
+            }).then(() => {
+                this.loading = false;
+                this.$message.success('代码生成成功');
+                this.$router.go(-1);
+            }).catch(res => {
+                this.loading = false;
+                if ('cancel' === res) {
+                    this.$msgbox({ title: '提示', type: 'error', message: '生成取消' });
+                } else {
+                    this.$msgbox({ title: '提示', type: 'error', message: '生成失败' });
+                }
+            })
+        },
+        addField() {
+            this.fields.push({
+                name: '',
+                jdbcType: 'varchar',
+                notNull: false,
+                primaryKey: false,
+                autoIncrease: false,
+                remark: '',
+                showInList: true,
+                showInForm: true,
+                searchable: true,
+                formType: 'singleLineText'
+            });
+        },
+        removeField(i) {
+            if (this.fields.length > 1) {
+                this.fields.splice(i, 1);
             }
         },
-        computed: {
-            editableFields() {
-                return this.fields.filter(i => {
-                    return i.name
-                });
+        updateReadTable() {
+            this.formData.readTable = !this.formData.readTable;
+            this.formData.genTable = !this.formData.readTable;
+        },
+        changeDataBaseType() {
+            if ('Mysql' == this.formData.dataBaseType) {
+                this.datasourceInfoList = this.MysqlDataSourceInfos;
+                this.formData.dataSourceCode = 'dataSource';
+                this.getDatabaseTables();
+            } else if ('SqlServer' == this.formData.dataBaseType) {
+                this.datasourceInfoList = this.SqlServerDataSourceInfos;
+                this.formData.dataSourceCode = '';
             }
         },
-        methods: {
-            onSave() {
-                this.$refs.form.validate((valid) => {
-                    if (valid) {
-                        this.submit();
-                    } else {
-                        return false;
-                    }
-                });
-            },
-            submit() {
+        getDatabaseTables(code) {
+            this.tableList=[];
+            this.$http.get({
+                url: '/genCode/tables',
+                data: {
+                    code: code
+                }
+            }).then(res => {
+                if (res.success) {
 
-                this.formData.fields = this.fields;
-                this.formData.javaPath = this.formData.rootPath + this.formData.javaPathRelative;
-                this.formData.viewPath = this.formData.rootPath + this.formData.viewPathRelative;
-                this.formData.routerPath = this.formData.rootPath + this.formData.routerPathRelative;
-                this.formData.genJson = '';
+                    this.tableList = res.data;
+                }
+            })
+        },
+        changeDataSourceCode() {
+            if (this.formData.readTable) {
 
-                this.$alert('生成代码可能会删除已有同名表、数据或文件,确认要生成么?', '警告', {type: 'error'}).then(() => {
-                    this.loading = true;
-                    return axios.post(this.formData.id ? '/genCode/update' : '/genCode/save', this.formData)
-                }).then(() => {
-                    this.loading = false;
-                    this.$message.success('代码生成成功');
-                    this.$router.go(-1);
-                }).catch(res => {
-                    this.loading = false;
-                    if ('cancel' === res) {
-                        this.$msgbox({title: '提示', type: 'error', message: '生成取消'});
-                    } else {
-                        this.$msgbox({title: '提示', type: 'error', message: '生成失败'});
-                    }
-                })
-            },
-            addField() {
-                this.fields.push({
-                    name: '',
-                    jdbcType: 'varchar',
-                    notNull: false,
-                    primaryKey: false,
-                    autoIncrease: false,
-                    remark: '',
-                    showInList: true,
-                    showInForm: true,
-                    searchable: false,
-                    formType: 'singleLineText'
-                });
-            },
-            removeField(i) {
-                if (this.fields.length > 1) {
-                    this.fields.splice(i, 1);
+                this.formData.tableName = '';
+                this.getDatabaseTables(this.formData.dataSourceCode);
+            }
+        },
+        changeTableName() {
+            if (this.formData.readTable) {
+
+                this.fields = [];
+
+                this.getTableFields(this.formData.tableName);
+            }
+        },
+        getTableFields(tableName) {
+            this.$http.get({
+                url: '/genCode/tableFields',
+                data: {
+                    code: this.formData.dataSourceCode,
+                    tableName: tableName,
+                    databaseType:this.formData.dataBaseType,
                 }
-            },
-            updateReadTable() {
-                this.formData.readTable = !this.formData.readTable;
-                this.formData.genTable = !this.formData.readTable;
-            },
-            cityDataBaseType() {
-                if ('Mysql' == this.formData.dataBaseType) {
-                    this.datasourceInfoList = this.MysqlDataSourceInfos;
-                    this.formData.dataSourceCode = 'dataSource';
-                } else if ('SqlServer' == this.formData.dataBaseType) {
-                    this.datasourceInfoList = this.SqlServerDataSourceInfos;
-                    this.formData.dataSourceCode = '';
+            }).then(res => {
+                if (res.success) {
+
+                    this.fields = res.data;
                 }
-            },
-        }
+            })
+        },
+
     }
+}
 </script>
 
 <style lang="less" scoped>

+ 93 - 0
src/main/vue/src/pages/Testaaaone.vue

@@ -0,0 +1,93 @@
+<template>
+    <div>
+        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small"
+                 style="max-width: 500px;">
+                                                                                        <el-form-item prop="delFlag" label="删除标识">
+                <el-input v-model="formData.delFlag"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                        <el-form-item prop="testName" label="名字">
+                <el-input v-model="formData.testName"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                                                        <el-form-item prop="remark" label="备注">
+                <el-input v-model="formData.remark"></el-input>
+            </el-form-item>
+                                                                                                                                                                                                                                                                    <el-form-item>
+                <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
+                <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
+                <el-button @click="$router.go(-1)">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+    import formValidator from '../formValidator'
+
+    export default {
+        created() {
+            if (this.$route.query.id) {
+                this.$http.get({
+                    url: '/testaaaone/getOne',
+                    data: {
+                        id: this.$route.query.id
+                    }
+                }).then(res => {
+                    if (res.success) {
+                        this.formData = res.data;
+                    }
+                })
+            }
+        },
+        data() {
+            return {
+                saving: false,
+                formData: {},
+                rules: {
+                                                                                                                                    },
+        }
+        },
+        methods: {
+            onSave() {
+                this.$refs.form.validate((valid) => {
+                    if (valid) {
+                        this.submit();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            submit() {
+                var data = JSON.parse(JSON.stringify(this.formData));
+                this.$http.post({
+                    url: this.formData.id ? '/testaaaone/update' : '/testaaaone/save',
+                    data: data
+                }).then(res => {
+                    if (res.success) {
+                        this.$message.success('成功');
+                        this.$router.go(-1);
+                    } else {
+                        this.$message.warning('失败')
+                    }
+                });
+            },
+            onDelete() {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                    return this.$http.post({
+                    url: '/testaaaone/del',
+                    data: { id: this.formData.id }
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>

+ 321 - 0
src/main/vue/src/pages/Testaaaones.vue

@@ -0,0 +1,321 @@
+<template>
+    <div>
+        <div class="filters-container">
+          
+            <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
+              <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
+              </el-button>
+            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
+            </el-button>
+
+            <el-button @click="$router.push('/testaaaone')" type="primary" size="small" icon="el-icon-edit"
+                       class="filter-item">添加
+            </el-button>
+            <el-button @click="exportExcel" type="primary" size="small" icon="el-icon-share" class="filter-item">导出EXCEL
+            </el-button>
+            <el-dropdown trigger="click" size="medium" class="table-column-filter">
+                <span>
+                  筛选数据<i class="el-icon-arrow-down el-icon--right"></i>
+                </span>
+                <el-dropdown-menu slot="dropdown" class="table-column-filter-wrapper">
+                    <el-checkbox v-for="item in tableColumns" :key="item.value" v-model="item.show">{{item.label}}
+                    </el-checkbox>
+                </el-dropdown-menu>
+            </el-dropdown>
+        </div>
+        <el-table
+                :data="tableData"
+                :height="tableHeight"
+                row-key="id"
+                ref="table">
+            <el-table-column
+                    v-if="multipleMode"
+                    align="center"
+                    type="selection"
+                    width="50">
+            </el-table-column>
+            <el-table-column
+                    type="index"
+                    min-width="50"
+                    align="center">
+            </el-table-column>
+                                                                    <el-table-column
+                    v-if="isColumnShow('delFlag')"
+                    prop="delFlag"
+                    label="删除标识"
+                    min-width="100">
+            </el-table-column>
+                                                        <el-table-column
+                    v-if="isColumnShow('testName')"
+                    prop="testName"
+                    label="名字"
+                    min-width="100">
+            </el-table-column>
+                                                        <el-table-column
+                    v-if="isColumnShow('remark')"
+                    prop="remark"
+                    label="备注"
+                    min-width="100">
+            </el-table-column>
+                                        <el-table-column
+                    label="操作"
+                    align="center"
+                    fixed="right"
+                    min-width="150"
+            >
+                <template slot-scope="scope">
+                    <el-button @click="editRow(scope.row)" type="primary" size="mini" plain>编辑</el-button>
+                    <el-button @click="deleteRow(scope.row)" type="danger" size="mini" plain>删除</el-button>
+                </template>
+            </el-table-column>
+        </el-table>
+        <div class="pagination-wrapper">
+            <div class="multiple-mode-wrapper">
+                <el-button size="small" v-if="!multipleMode" @click="toggleMultipleMode(true)">批量编辑</el-button>
+                <el-button-group v-else>
+                    <el-button size="small" @click="operation1">批量操作1</el-button>
+                    <el-button size="small" @click="operation2">批量操作2</el-button>
+                    <el-button size="small" @click="toggleMultipleMode(false)">取消</el-button>
+                </el-button-group>
+            </div>
+            <el-pagination
+                    background
+                    @size-change="pageSizeChange"
+                    @current-change="currentPageChange"
+                    :current-page="currentPage"
+                    :page-sizes="[10, 20, 30, 40, 50]"
+                    :page-size="pageSize"
+                    layout="total, sizes, prev, pager, next, jumper"
+                    :total="totalNumber">
+            </el-pagination>
+        </div>
+        <el-dialog title="高级查询" :visible.sync="showAdvancedQueryDialog">
+            <el-button @click="addField" type="text" icon="el-icon-plus">添加</el-button>
+            <el-table :data="advancedQueryFields">
+
+                <el-table-column prop="link" label="链接符" align="center">
+                    <template slot-scope="{row}">
+                        <el-select placeholder="链接" size="small" v-model="row.link" class="filter-item">
+                            <el-option label="AND" value="AND">
+                            </el-option>
+                            <el-option label="OR" value="OR">
+                            </el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="字段" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.name">
+
+                            <el-option v-for="item in advancedQueryColumns" :label="item.label" :value="item.value" :key="item.value"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="searchMethod" label="搜索方式" width="150" align="center">
+                    <template slot-scope="{row}">
+                        <el-select v-model="row.searchMethod">
+                            <el-option v-for="item in searchMethods" :label="item" :value="item" :key="item"></el-option>
+                        </el-select>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="value" label="参数" align="center">
+                    <template slot-scope="{row}">
+                        <el-input v-model="row.value"></el-input>
+                    </template>
+                </el-table-column>
+                <el-table-column width="60" align="center">
+                    <template slot-scope="{ row, column, $index }">
+                        <el-button @click="removeField($index)" size="small" type="text">删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+
+            <span slot="footer" class="dialog-footer">
+
+                <el-button @click="advancedQuery" :loading="$store.state.fetchingData">确定</el-button>
+            </span>
+        </el-dialog>
+
+    </div>
+</template>
+<script>
+    import {mapState} from 'vuex'
+
+    export default {
+        created() {
+            this.getData();
+        },
+        data() {
+            return {
+                totalNumber: 0,
+                totalPage: 10,
+                currentPage: 1,
+                pageSize: 20,
+                tableData: [],
+                filter1: '',
+                filter2: '',
+                tableColumns: [
+                                                            {
+                        label: '删除标识',
+                        value: 'delFlag',
+                        show: true
+                    },
+                                                    {
+                        label: '名字',
+                        value: 'testName',
+                        show: true
+                    },
+                                                    {
+                        label: '备注',
+                        value: 'remark',
+                        show: true
+                    },
+                                    ],
+                multipleMode: false,
+                showAdvancedQueryDialog: false,
+                advancedQueryFields: [],
+                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+                advancedQueryColumns: [
+                                                                                                                    {
+                                label: '删除标识',
+                                value: 'del_flag'
+                            },
+                                                                                                {
+                                label: '名字',
+                                value: 'test_name'
+                            },
+                                                                                                {
+                                label: '备注',
+                                value: 'remark'
+                            },
+                                                            ],
+                advancedQuerySearchKey: '',
+            }
+        },
+        computed: {
+            ...mapState(['tableHeight']),
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
+        },
+        methods: {
+            pageSizeChange(size) {
+                this.currentPage = 1;
+                this.pageSize = size;
+                this.getData();
+            },
+            currentPageChange(page) {
+                this.currentPage = page;
+                this.getData();
+            },
+            getData() {
+                this.$http.get({
+                url: '/testaaaone/page',
+                data: {
+                    currentPage: this.currentPage,
+                    pageNumber: this.pageSize,
+                    searchKey: this.filter1,
+                    advancedQuery: this.advancedQuerySearchKey,
+                }
+                }).then(res => {
+                    if (res.success) {
+                        this.totalNumber = res.data.page.totalNumber;
+                        this.tableData = res.data.pp;
+                    }
+                })
+            },
+            isColumnShow(column) {
+                var row = this.tableColumns.find(i => i.value === column);
+                return row ? row.show : false;
+            },
+            toggleMultipleMode(multipleMode) {
+                this.multipleMode = multipleMode;
+                if (!multipleMode) {
+                    this.$refs.table.clearSelection();
+                }
+            },
+            editRow(row) {
+                this.$router.push({
+                    path: '/testaaaone',
+                    query: {
+                        id: row.id
+                    }
+                })
+            },
+            operation1() {
+                this.$notify({
+                    title: '提示',
+                    message: this.selection
+                });
+            },
+            operation2() {
+                this.$message('操作2');
+            },
+            addField() {
+                this.advancedQueryFields.push({
+                    link: 'AND',
+                    name: '',
+                    searchMethod: '=',
+                    value: '',
+                });
+            },
+            removeField(i) {
+                if (this.advancedQueryFields.length > 0) {
+                    this.advancedQueryFields.splice(i, 1);
+                }
+            },
+            advancedQuery() {
+
+                this.advancedQuerySearchKey = '';
+
+                if (this.advancedQueryFields.length > 0) {
+
+                    var templist = [];
+
+                    this.advancedQueryFields.forEach(item => {
+                        if (item.link && item.name && item.searchMethod && item.value) {
+                            var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                            templist.push(tempItem);
+                        }
+                    })
+
+                    if (templist.length > 0) {
+
+                        this.advancedQuerySearchKey = templist.join('_;');
+                    }
+                }
+
+                this.getData();
+                this.showAdvancedQueryDialog = false;
+            },
+            exportExcel() {
+                window.location.href = this.$baseUrl + "/testaaaone/exportExcel?searchKey=" + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey
+            },
+            searchData() {
+                this.currentPage = 1;
+                this.getData();
+            },
+            deleteRow(row) {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                    return this.$http.post({
+                    url: '/testaaaone/del',
+                    data: { id: row.id }
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+
+        }
+    }
+</script>
+<style lang="less" scoped>
+
+</style>

+ 11 - 1
src/main/vue/src/router/index.js

@@ -229,6 +229,16 @@ const router = new Router({
                     path: '/testDeploys',
                     name: 'TestDeploys',
                     component: () => import('../pages/TestDeploys')
+                },
+                {
+                    path: '/testaaaone',
+                    name: 'Testaaaone',
+                    component: () => import('../pages/Testaaaone')
+                },
+                {
+                    path: '/testaaaones',
+                    name: 'Testaaaones',
+                    component: () => import('../pages/Testaaaones')
                 }
                 /**INSERT_LOCATION**/
             ]
@@ -283,4 +293,4 @@ router.afterEach((to, from) => {
     window.onresize();
 });
 
-export default router;
+export default router;