Przeglądaj źródła

登录用户,当前时间

suochencheng 7 lat temu
rodzic
commit
dbe8a8f683

+ 1 - 1
src/main/java/com/izouma/awesomeadmin/dao/TestAaaMapper.java

@@ -24,7 +24,7 @@ public interface TestAaaMapper{
 
 
     List<TestAaa> queryTestAaaByPage(Map<String, Object> parameter);
     List<TestAaa> queryTestAaaByPage(Map<String, Object> parameter);
 
 
-    int delete(String id);
+    int delete(TestAaa record);
 
 
     TestAaa queryTestAaa(TestAaa record);
     TestAaa queryTestAaa(TestAaa record);
 
 

+ 124 - 41
src/main/java/com/izouma/awesomeadmin/dao/TestAaaMapper.xml

@@ -4,11 +4,14 @@
     <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestAaa" >
     <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestAaa" >
                 <id column="id" property="id" jdbcType="INTEGER" />
                 <id column="id" property="id" jdbcType="INTEGER" />
                                         <result column="del_flag" property="delFlag" jdbcType="CHAR" />
                                         <result column="del_flag" property="delFlag" jdbcType="CHAR" />
+                                <result column="image_url" property="imageUrl" jdbcType="VARCHAR" />
                                 <result column="test_name" property="testName" jdbcType="VARCHAR" />
                                 <result column="test_name" property="testName" jdbcType="VARCHAR" />
                                 <result column="remark" property="remark" jdbcType="VARCHAR" />
                                 <result column="remark" property="remark" jdbcType="VARCHAR" />
-                                <result column="image_url" property="imageUrl" jdbcType="VARCHAR" />
-                                <result column="test_time" property="testTime" jdbcType="TIMESTAMP" />
                                 <result column="multi_select" property="multiSelect" jdbcType="VARCHAR" />
                                 <result column="multi_select" property="multiSelect" jdbcType="VARCHAR" />
+                                <result column="test_time" property="testTime" jdbcType="TIMESTAMP" />
+                                <result column="login_user" property="loginUser" jdbcType="VARCHAR" />
+                                <result column="testc_time" property="testcTime" jdbcType="TIMESTAMP" />
+                                <result column="testc_date" property="testcDate" jdbcType="TIMESTAMP" />
             </resultMap>
             </resultMap>
     <sql id="Base_Column_List" >
     <sql id="Base_Column_List" >
         <trim  suffixOverrides="," >
         <trim  suffixOverrides="," >
@@ -16,15 +19,21 @@
 
 
             del_flag,
             del_flag,
 
 
+            image_url,
+
             test_name,
             test_name,
 
 
             remark,
             remark,
 
 
-            image_url,
+            multi_select,
 
 
             test_time,
             test_time,
 
 
-            multi_select,
+            login_user,
+
+            testc_time,
+
+            testc_date,
 
 
             </trim>
             </trim>
     </sql>
     </sql>
@@ -46,6 +55,9 @@
             </if>
             </if>
                 <if test="delFlag!= null" >
                 <if test="delFlag!= null" >
                 del_flag,
                 del_flag,
+            </if>
+                <if test="imageUrl!= null" >
+                image_url,
             </if>
             </if>
                 <if test="testName!= null" >
                 <if test="testName!= null" >
                 test_name,
                 test_name,
@@ -53,14 +65,20 @@
                 <if test="remark!= null" >
                 <if test="remark!= null" >
                 remark,
                 remark,
             </if>
             </if>
-                <if test="imageUrl!= null" >
-                image_url,
+                <if test="multiSelect!= null" >
+                multi_select,
             </if>
             </if>
                 <if test="testTime!= null" >
                 <if test="testTime!= null" >
                 test_time,
                 test_time,
             </if>
             </if>
-                <if test="multiSelect!= null" >
-                multi_select,
+                <if test="loginUser!= null" >
+                login_user,
+            </if>
+                <if test="testcTime!= null" >
+                testc_time,
+            </if>
+                <if test="testcDate!= null" >
+                testc_date,
             </if>
             </if>
             </trim>
             </trim>
         <trim prefix="values (" suffix=")" suffixOverrides="," >
         <trim prefix="values (" suffix=")" suffixOverrides="," >
@@ -69,6 +87,9 @@
             </if>
             </if>
                     <if test="delFlag != null" >
                     <if test="delFlag != null" >
                 #{delFlag,jdbcType=CHAR},
                 #{delFlag,jdbcType=CHAR},
+            </if>
+                    <if test="imageUrl != null" >
+                #{imageUrl,jdbcType=VARCHAR},
             </if>
             </if>
                     <if test="testName != null" >
                     <if test="testName != null" >
                 #{testName,jdbcType=VARCHAR},
                 #{testName,jdbcType=VARCHAR},
@@ -76,14 +97,20 @@
                     <if test="remark != null" >
                     <if test="remark != null" >
                 #{remark,jdbcType=VARCHAR},
                 #{remark,jdbcType=VARCHAR},
             </if>
             </if>
-                    <if test="imageUrl != null" >
-                #{imageUrl,jdbcType=VARCHAR},
+                    <if test="multiSelect != null" >
+                #{multiSelect,jdbcType=VARCHAR},
             </if>
             </if>
                     <if test="testTime != null" >
                     <if test="testTime != null" >
                 #{testTime,jdbcType=TIMESTAMP},
                 #{testTime,jdbcType=TIMESTAMP},
             </if>
             </if>
-                    <if test="multiSelect != null" >
-                #{multiSelect,jdbcType=VARCHAR},
+                    <if test="loginUser != null" >
+                #{loginUser,jdbcType=VARCHAR},
+            </if>
+                    <if test="testcTime != null" >
+                #{testcTime,jdbcType=TIMESTAMP},
+            </if>
+                    <if test="testcDate != null" >
+                #{testcDate,jdbcType=TIMESTAMP},
             </if>
             </if>
                 </trim>
                 </trim>
     </insert>
     </insert>
@@ -95,6 +122,9 @@
             </if>
             </if>
                      <if test="delFlag != null" >
                      <if test="delFlag != null" >
                del_flag= #{delFlag,jdbcType=CHAR},
                del_flag= #{delFlag,jdbcType=CHAR},
+            </if>
+                     <if test="imageUrl != null" >
+               image_url= #{imageUrl,jdbcType=VARCHAR},
             </if>
             </if>
                      <if test="testName != null" >
                      <if test="testName != null" >
                test_name= #{testName,jdbcType=VARCHAR},
                test_name= #{testName,jdbcType=VARCHAR},
@@ -102,27 +132,46 @@
                      <if test="remark != null" >
                      <if test="remark != null" >
                remark= #{remark,jdbcType=VARCHAR},
                remark= #{remark,jdbcType=VARCHAR},
             </if>
             </if>
-                     <if test="imageUrl != null" >
-               image_url= #{imageUrl,jdbcType=VARCHAR},
+                     <if test="multiSelect != null" >
+               multi_select= #{multiSelect,jdbcType=VARCHAR},
             </if>
             </if>
                      <if test="testTime != null" >
                      <if test="testTime != null" >
                test_time= #{testTime,jdbcType=TIMESTAMP},
                test_time= #{testTime,jdbcType=TIMESTAMP},
             </if>
             </if>
-                     <if test="multiSelect != null" >
-               multi_select= #{multiSelect,jdbcType=VARCHAR},
+                     <if test="loginUser != null" >
+               login_user= #{loginUser,jdbcType=VARCHAR},
+            </if>
+                     <if test="testcTime != null" >
+               testc_time= #{testcTime,jdbcType=TIMESTAMP},
+            </if>
+                     <if test="testcDate != null" >
+               testc_date= #{testcDate,jdbcType=TIMESTAMP},
             </if>
             </if>
                  </set>
                  </set>
-        where id = #{id,jdbcType=INTEGER}
+        where
+        <if test="id != null and !&quot;&quot;.equals(id)">
+            id = #{id,jdbcType=INTEGER}
+        </if>
+
+        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+            id in (${idStr})
+        </if>
     </update>
     </update>
     <select id="queryTestAaaByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
     <select id="queryTestAaaByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
         select <include refid="Base_Column_List"/> from test_aaa
         select <include refid="Base_Column_List"/> from test_aaa
         <where>
         <where>
             and del_flag = 'N'
             and del_flag = 'N'
+            <if test="record.idStr != null and !&quot;&quot;.equals(record.idStr)">
+                and id in (${record.idStr})
+            </if>
                     <if test="record.id != null and !&quot;&quot;.equals(record.id)">
                     <if test="record.id != null and !&quot;&quot;.equals(record.id)">
                 and  id = #{record.id}
                 and  id = #{record.id}
             </if>
             </if>
                      <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
                      <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
                 and  del_flag = #{record.delFlag}
                 and  del_flag = #{record.delFlag}
+            </if>
+                     <if test="record.imageUrl != null and !&quot;&quot;.equals(record.imageUrl)">
+                and  image_url = #{record.imageUrl}
             </if>
             </if>
                      <if test="record.testName != null and !&quot;&quot;.equals(record.testName)">
                      <if test="record.testName != null and !&quot;&quot;.equals(record.testName)">
                 and  test_name = #{record.testName}
                 and  test_name = #{record.testName}
@@ -130,22 +179,29 @@
                      <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
                      <if test="record.remark != null and !&quot;&quot;.equals(record.remark)">
                 and  remark = #{record.remark}
                 and  remark = #{record.remark}
             </if>
             </if>
-                     <if test="record.imageUrl != null and !&quot;&quot;.equals(record.imageUrl)">
-                and  image_url = #{record.imageUrl}
+                     <if test="record.multiSelect != null and !&quot;&quot;.equals(record.multiSelect)">
+                and  multi_select = #{record.multiSelect}
             </if>
             </if>
                      <if test="record.testTime != null and !&quot;&quot;.equals(record.testTime)">
                      <if test="record.testTime != null and !&quot;&quot;.equals(record.testTime)">
                 and  test_time = #{record.testTime}
                 and  test_time = #{record.testTime}
             </if>
             </if>
-                     <if test="record.multiSelect != null and !&quot;&quot;.equals(record.multiSelect)">
-                and  multi_select = #{record.multiSelect}
+                     <if test="record.loginUser != null and !&quot;&quot;.equals(record.loginUser)">
+                and  login_user = #{record.loginUser}
+            </if>
+                     <if test="record.testcTime != null and !&quot;&quot;.equals(record.testcTime)">
+                and  testc_time = #{record.testcTime}
+            </if>
+                     <if test="record.testcDate != null and !&quot;&quot;.equals(record.testcDate)">
+                and  testc_date = #{record.testcDate}
             </if>
             </if>
                   <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
                   <if test="record.searchKey != null and !&quot;&quot;.equals(record.searchKey)">
              <trim prefix="and (" suffix=")" prefixOverrides="OR" >
              <trim prefix="and (" suffix=")" prefixOverrides="OR" >
-                                                                                                                                                                OR  test_name LIKE concat('%',#{record.searchKey},'%')
+                                                                                                                                                                OR  image_url LIKE concat('%',#{record.searchKey},'%')
+                                                                                                    OR  test_name LIKE concat('%',#{record.searchKey},'%')
                                                                                                     OR  remark LIKE concat('%',#{record.searchKey},'%')
                                                                                                     OR  remark LIKE concat('%',#{record.searchKey},'%')
-                                                                                                    OR  image_url LIKE concat('%',#{record.searchKey},'%')
-                                                                                                                                                                     OR  multi_select LIKE concat('%',#{record.searchKey},'%')
-                                                             </trim>
+                                                                                                    OR  multi_select LIKE concat('%',#{record.searchKey},'%')
+                                                                                                                                                                     OR  login_user LIKE concat('%',#{record.searchKey},'%')
+                                                                                                                                                                                               </trim>
          </if>
          </if>
 
 
             <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
             <if test="record.advancedQuery != null and !&quot;&quot;.equals(record.advancedQuery)">
@@ -204,11 +260,17 @@
         select <include refid="Base_Column_List"/> from test_aaa
         select <include refid="Base_Column_List"/> from test_aaa
         <where>
         <where>
             and del_flag = 'N'
             and del_flag = 'N'
+            <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+                and id in (${idStr})
+            </if>
                     <if test="id != null and !&quot;&quot;.equals(id)">
                     <if test="id != null and !&quot;&quot;.equals(id)">
                 and  id = #{id}
                 and  id = #{id}
             </if>
             </if>
                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                     <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                 and  del_flag = #{delFlag}
                 and  del_flag = #{delFlag}
+            </if>
+                    <if test="imageUrl != null and !&quot;&quot;.equals(imageUrl)">
+                and  image_url = #{imageUrl}
             </if>
             </if>
                     <if test="testName != null and !&quot;&quot;.equals(testName)">
                     <if test="testName != null and !&quot;&quot;.equals(testName)">
                 and  test_name = #{testName}
                 and  test_name = #{testName}
@@ -216,22 +278,29 @@
                     <if test="remark != null and !&quot;&quot;.equals(remark)">
                     <if test="remark != null and !&quot;&quot;.equals(remark)">
                 and  remark = #{remark}
                 and  remark = #{remark}
             </if>
             </if>
-                    <if test="imageUrl != null and !&quot;&quot;.equals(imageUrl)">
-                and  image_url = #{imageUrl}
+                    <if test="multiSelect != null and !&quot;&quot;.equals(multiSelect)">
+                and  multi_select = #{multiSelect}
             </if>
             </if>
                     <if test="testTime != null and !&quot;&quot;.equals(testTime)">
                     <if test="testTime != null and !&quot;&quot;.equals(testTime)">
                 and  test_time = #{testTime}
                 and  test_time = #{testTime}
             </if>
             </if>
-                    <if test="multiSelect != null and !&quot;&quot;.equals(multiSelect)">
-                and  multi_select = #{multiSelect}
+                    <if test="loginUser != null and !&quot;&quot;.equals(loginUser)">
+                and  login_user = #{loginUser}
+            </if>
+                    <if test="testcTime != null and !&quot;&quot;.equals(testcTime)">
+                and  testc_time = #{testcTime}
+            </if>
+                    <if test="testcDate != null and !&quot;&quot;.equals(testcDate)">
+                and  testc_date = #{testcDate}
             </if>
             </if>
                     <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
                     <if test="searchKey != null and !&quot;&quot;.equals(searchKey)">
                 <trim prefix="and (" suffix=")" prefixOverrides="OR" >
                 <trim prefix="and (" suffix=")" prefixOverrides="OR" >
-                                                                                                                                                                                                                                                OR  test_name LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                                                                                                                OR  image_url LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                        OR  test_name LIKE concat('%',#{searchKey},'%')
                                                                                                                                                         OR  remark LIKE concat('%',#{searchKey},'%')
                                                                                                                                                         OR  remark LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                        OR  image_url LIKE concat('%',#{searchKey},'%')
-                                                                                                                                                                                                                                                        OR  multi_select LIKE concat('%',#{searchKey},'%')
-                                                                                        </trim>
+                                                                                                                                                        OR  multi_select LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                                                                                                                        OR  login_user LIKE concat('%',#{searchKey},'%')
+                                                                                                                                                                                                                                                                                        </trim>
             </if>
             </if>
 <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
 <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">
     <foreach item="item" index="index" collection="advancedQuery.split('_;')">
     <foreach item="item" index="index" collection="advancedQuery.split('_;')">
@@ -294,6 +363,9 @@
             </if>
             </if>
                      <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                      <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
                 and del_flag = #{delFlag}
                 and del_flag = #{delFlag}
+            </if>
+                     <if test="imageUrl != null and !&quot;&quot;.equals(imageUrl)">
+                and image_url = #{imageUrl}
             </if>
             </if>
                      <if test="testName != null and !&quot;&quot;.equals(testName)">
                      <if test="testName != null and !&quot;&quot;.equals(testName)">
                 and test_name = #{testName}
                 and test_name = #{testName}
@@ -301,14 +373,20 @@
                      <if test="remark != null and !&quot;&quot;.equals(remark)">
                      <if test="remark != null and !&quot;&quot;.equals(remark)">
                 and remark = #{remark}
                 and remark = #{remark}
             </if>
             </if>
-                     <if test="imageUrl != null and !&quot;&quot;.equals(imageUrl)">
-                and image_url = #{imageUrl}
+                     <if test="multiSelect != null and !&quot;&quot;.equals(multiSelect)">
+                and multi_select = #{multiSelect}
             </if>
             </if>
                      <if test="testTime != null and !&quot;&quot;.equals(testTime)">
                      <if test="testTime != null and !&quot;&quot;.equals(testTime)">
                 and test_time = #{testTime}
                 and test_time = #{testTime}
             </if>
             </if>
-                     <if test="multiSelect != null and !&quot;&quot;.equals(multiSelect)">
-                and multi_select = #{multiSelect}
+                     <if test="loginUser != null and !&quot;&quot;.equals(loginUser)">
+                and login_user = #{loginUser}
+            </if>
+                     <if test="testcTime != null and !&quot;&quot;.equals(testcTime)">
+                and testc_time = #{testcTime}
+            </if>
+                     <if test="testcDate != null and !&quot;&quot;.equals(testcDate)">
+                and testc_date = #{testcDate}
             </if>
             </if>
          
          
         </where>
         </where>
@@ -316,15 +394,20 @@
     </select>
     </select>
     <update id="delete">
     <update id="delete">
         UPDATE test_aaa SET del_flag = 'Y'
         UPDATE test_aaa SET del_flag = 'Y'
-        <where>
-            AND id = #{id}
-        </where>
+        where
+        <if test="id != null and !&quot;&quot;.equals(id)">
+            id = #{id,jdbcType=INTEGER}
+        </if>
+
+        <if test="idStr != null and !&quot;&quot;.equals(idStr)">
+            id in (${idStr})
+        </if>
     </update>
     </update>
     <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
     <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestAaa">
         select <include refid="Base_Column_List"/> from test_aaa
         select <include refid="Base_Column_List"/> from test_aaa
         <where>
         <where>
             and del_flag = 'N'
             and del_flag = 'N'
-                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        </where>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                </where>
         order by id desc
         order by id desc
     </select>
     </select>
 </mapper>
 </mapper>

+ 44 - 10
src/main/java/com/izouma/awesomeadmin/model/TestAaa.java

@@ -10,11 +10,16 @@ import com.fasterxml.jackson.annotation.JsonInclude;
 public class TestAaa{
 public class TestAaa{
     private Integer id;
     private Integer id;
     private String delFlag;
     private String delFlag;
+    private String imageUrl;
     private String testName;
     private String testName;
     private String remark;
     private String remark;
-    private String imageUrl;
-    private Date testTime;
     private String multiSelect;
     private String multiSelect;
+    private Date testTime;
+    private String loginUser;
+    private Date testcTime;
+    private Date testcDate;
+
+private String idStr;
 
 
 private String searchKey;
 private String searchKey;
 
 
@@ -42,6 +47,13 @@ private String orderByStr;
     public void setDelFlag(String delFlag){
     public void setDelFlag(String delFlag){
         this.delFlag = delFlag;
         this.delFlag = delFlag;
     }
     }
+    public String getImageUrl(){
+        return this.imageUrl;
+    }
+
+    public void setImageUrl(String imageUrl){
+        this.imageUrl = imageUrl;
+    }
     public String getTestName(){
     public String getTestName(){
         return this.testName;
         return this.testName;
     }
     }
@@ -56,12 +68,12 @@ private String orderByStr;
     public void setRemark(String remark){
     public void setRemark(String remark){
         this.remark = remark;
         this.remark = remark;
     }
     }
-    public String getImageUrl(){
-        return this.imageUrl;
+    public String getMultiSelect(){
+        return this.multiSelect;
     }
     }
 
 
-    public void setImageUrl(String imageUrl){
-        this.imageUrl = imageUrl;
+    public void setMultiSelect(String multiSelect){
+        this.multiSelect = multiSelect;
     }
     }
     public Date getTestTime(){
     public Date getTestTime(){
         return this.testTime;
         return this.testTime;
@@ -70,12 +82,26 @@ private String orderByStr;
     public void setTestTime(Date testTime){
     public void setTestTime(Date testTime){
         this.testTime = testTime;
         this.testTime = testTime;
     }
     }
-    public String getMultiSelect(){
-        return this.multiSelect;
+    public String getLoginUser(){
+        return this.loginUser;
     }
     }
 
 
-    public void setMultiSelect(String multiSelect){
-        this.multiSelect = multiSelect;
+    public void setLoginUser(String loginUser){
+        this.loginUser = loginUser;
+    }
+    public Date getTestcTime(){
+        return this.testcTime;
+    }
+
+    public void setTestcTime(Date testcTime){
+        this.testcTime = testcTime;
+    }
+    public Date getTestcDate(){
+        return this.testcDate;
+    }
+
+    public void setTestcDate(Date testcDate){
+        this.testcDate = testcDate;
     }
     }
 
 
 public String getSearchKey() {
 public String getSearchKey() {
@@ -102,5 +128,13 @@ public void setOrderByStr(String orderByStr) {
     this.orderByStr = orderByStr;
     this.orderByStr = orderByStr;
 }
 }
 
 
+public String getIdStr() {
+    return idStr;
+}
+
+public void setIdStr(String idStr) {
+    this.idStr = idStr;
+}
+
 }
 }
 
 

+ 1 - 1
src/main/java/com/izouma/awesomeadmin/service/TestAaaService.java

@@ -20,7 +20,7 @@ public interface TestAaaService{
 
 
     boolean createTestAaa(TestAaa record);
     boolean createTestAaa(TestAaa record);
 
 
-    boolean deleteTestAaa(String id);
+    boolean deleteTestAaa(TestAaa record);
 
 
     boolean updateTestAaa(TestAaa record);
     boolean updateTestAaa(TestAaa record);
 }
 }

+ 2 - 2
src/main/java/com/izouma/awesomeadmin/service/impl/TestAaaServiceImpl.java

@@ -99,12 +99,12 @@ public class TestAaaServiceImpl implements TestAaaService{
     }
     }
 
 
     @Override
     @Override
-    public boolean deleteTestAaa(String id) {
+    public boolean deleteTestAaa(TestAaa record) {
 
 
         logger.info("deleteTestAaa");
         logger.info("deleteTestAaa");
         try {
         try {
 
 
-             int updates = testAaaMapper.delete(id);
+             int updates = testAaaMapper.delete(record);
 
 
             if (updates > 0) {
             if (updates > 0) {
                  return true;
                  return true;

+ 15 - 11
src/main/java/com/izouma/awesomeadmin/web/TestAaaController.java

@@ -3,6 +3,7 @@ package com.izouma.awesomeadmin.web;
 import java.util.*;
 import java.util.*;
 
 
 import com.izouma.awesomeadmin.util.ExportExcelUtil;
 import com.izouma.awesomeadmin.util.ExportExcelUtil;
+import org.apache.commons.lang.StringUtils;
 import org.apache.shiro.authz.annotation.RequiresAuthentication;
 import org.apache.shiro.authz.annotation.RequiresAuthentication;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.stereotype.Controller;
@@ -105,9 +106,9 @@ public class TestAaaController {
     */
     */
     @RequestMapping(value = "/del", method = RequestMethod.POST)
     @RequestMapping(value = "/del", method = RequestMethod.POST)
     @ResponseBody
     @ResponseBody
-    public Result deleteTestAaa(@RequestParam(required = true, value = "id") String id) {
+    public Result deleteTestAaa(TestAaa record) {
 
 
-        boolean num = testAaaService.deleteTestAaa(id);
+        boolean num = testAaaService.deleteTestAaa(record);
         if (num) {
         if (num) {
         return new Result(true, "删除成功");
         return new Result(true, "删除成功");
         }
         }
@@ -131,20 +132,23 @@ public class TestAaaController {
         String sheetName = "test_aaa";
         String sheetName = "test_aaa";
         String titleName = "test_aaa数据表";
         String titleName = "test_aaa数据表";
         String fileName = "test_aaa表";
         String fileName = "test_aaa表";
-        int columnNumber = 7;
-        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20 };
-        String[] columnName = {  "id" ,   "删除标识" ,   "名字" ,   "备注" ,   "图片" ,   "时间" ,   "多选"  };
-        String[][] dataList = new String[testAaas.size()][7];
+        int columnNumber = 10;
+        int[] columnWidth = { 20,  20,  20,  20,  20,  20,  20,  20,  20,  20 };
+        String[] columnName = {  "id" ,   "删除" ,   "图片" ,   "枚举单选" ,   "接口单选" ,   "表多选" ,   "时间" ,   "登录名" ,   "当前时间" ,   "当前日期"  };
+        String[][] dataList = new String[testAaas.size()][10];
 
 
         for (int i = 0; i < testAaas.size(); i++) {
         for (int i = 0; i < testAaas.size(); i++) {
 
 
                         dataList[i][0] = String.valueOf(testAaas.get(i).getId());
                         dataList[i][0] = String.valueOf(testAaas.get(i).getId());
                         dataList[i][1] = String.valueOf(testAaas.get(i).getDelFlag());
                         dataList[i][1] = String.valueOf(testAaas.get(i).getDelFlag());
-                        dataList[i][2] = String.valueOf(testAaas.get(i).getTestName());
-                        dataList[i][3] = String.valueOf(testAaas.get(i).getRemark());
-                        dataList[i][4] = String.valueOf(testAaas.get(i).getImageUrl());
-                        dataList[i][5] = String.valueOf(testAaas.get(i).getTestTime());
-                        dataList[i][6] = String.valueOf(testAaas.get(i).getMultiSelect());
+                        dataList[i][2] = String.valueOf(testAaas.get(i).getImageUrl());
+                        dataList[i][3] = String.valueOf(testAaas.get(i).getTestName());
+                        dataList[i][4] = String.valueOf(testAaas.get(i).getRemark());
+                        dataList[i][5] = String.valueOf(testAaas.get(i).getMultiSelect());
+                        dataList[i][6] = String.valueOf(testAaas.get(i).getTestTime());
+                        dataList[i][7] = String.valueOf(testAaas.get(i).getLoginUser());
+                        dataList[i][8] = String.valueOf(testAaas.get(i).getTestcTime());
+                        dataList[i][9] = String.valueOf(testAaas.get(i).getTestcDate());
                     }
                     }
 
 
 
 

+ 230 - 171
src/main/resources/templates/FormTemplate.vm

@@ -127,6 +127,21 @@
                             </rich-text>
                             </rich-text>
                         </el-form-item>
                         </el-form-item>
                     #end
                     #end
+                    #if(${field.formType}=="loginName")
+                        <el-form-item prop="${field.modelName}" label="${field.remark}">
+                            <el-input v-model="formData.${field.modelName}" disabled></el-input>
+                        </el-form-item>
+                    #end
+                    #if(${field.formType}=="currentTime")
+                        <el-form-item prop="${field.modelName}" label="${field.remark}">
+                            <el-input v-model="formData.${field.modelName}" disabled></el-input>
+                        </el-form-item>
+                    #end
+                    #if(${field.formType}=="currentDate")
+                        <el-form-item prop="${field.modelName}" label="${field.remark}">
+                            <el-input v-model="formData.${field.modelName}" disabled></el-input>
+                        </el-form-item>
+                    #end
                 #end
                 #end
             #end
             #end
             <el-form-item>
             <el-form-item>
@@ -138,243 +153,287 @@
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
-    import formValidator from '../formValidator'
+import formValidator from '../formValidator'
+import { mapState } from 'vuex'
+import { format } from 'date-fns'
+import zh from 'date-fns/locale/zh_cn'
 
 
-    export default {
-        created() {
-            if (this.${esc.d}route.query.column) {
-                this.subColumn = this.${esc.d}route.query.column.split(',')[1];
-                this.subValue = this.${esc.d}route.query.column.split(',')[0];
-            }
+export default {
+    created() {
 
 
-            if (this.${esc.d}route.query.id) {
-                this.${esc.d}http.get({
-                    url: '/${display.uncapitalize($model.className)}/getOne',
-                    data: {
-                        id: this.${esc.d}route.query.id
-                    }
-                }).then(res => {
-                    if (res.success) {
+        if (this.${esc.d}route.query.column) {
+            this.subColumn = this.${esc.d}route.query.column.split(',')[1];
+            this.subValue = this.${esc.d}route.query.column.split(',')[0];
+        }
 
 
-                        #foreach($field in $model.fields)
-                            #if(${field.formType}=="multiSelect")
+        if (this.${esc.d}route.query.id) {
+            this.${esc.d}http.get({
+                url: '/${display.uncapitalize($model.className)}/getOne',
+                data: {
+                    id: this.${esc.d}route.query.id
+                }
+            }).then(res => {
+                if (res.success) {
 
 
-                                if(res.data.${field.modelName}){
-                                    res.data.${field.modelName} = res.data.${field.modelName}.split(',');
-                                }else{
-                                    res.data.${field.modelName} = [];
-                                }
+                #foreach($field in $model.fields)
+                    #if(${field.formType}=="multiSelect")
 
 
-                            #end
-                        #end
+                        if(res.data.${field.modelName}){
+                            res.data.${field.modelName} = res.data.${field.modelName}.split(',');
+                        }else{
+                            res.data.${field.modelName} = [];
+                        }
 
 
-                        this.formData = res.data;
+                    #end
+                    #if(${field.formType}=="currentTime")
+                        if(res.data.${field.modelName}){
+                            res.data.${field.modelName} = format(new Date(res.data.${field.modelName}), 'YYYY/MM/DD HH:mm', { locale: zh });
+                        }
+
+                    #end
+                    #if(${field.formType}=="currentDate")
+                        if(res.data.${field.modelName}){
+                            res.data.${field.modelName} = format(new Date(res.data.${field.modelName}), 'YYYY/MM/DD', { locale: zh });
+                        }
+
+                    #end
+                #end
+
+                this.formData = res.data;
 
 
-                    if (this.${esc.d}route.query.column) {
-                        this.formData[this.subColumn] = this.subValue;
-                    }
-                    }
-                })
-            }else {
                 if (this.${esc.d}route.query.column) {
                 if (this.${esc.d}route.query.column) {
                     this.formData[this.subColumn] = this.subValue;
                     this.formData[this.subColumn] = this.subValue;
                 }
                 }
             }
             }
+        })
+        }else {
+            if (this.${esc.d}route.query.column) {
+                this.formData[this.subColumn] = this.subValue;
+            }
+        }
 
 
-            #foreach($field in $model.fields)
-                #if(${field.formType}=="select"||${field.formType}=="multiSelect")
-                    #if(${field.apiFlag}=="2")
+        #foreach($field in $model.fields)
+            #if(${field.formType}=="select"||${field.formType}=="multiSelect")
+                #if(${field.apiFlag}=="2")
 
 
 
 
 
 
-                        this.${esc.d}http.get({
+                    this.${esc.d}http.get({
                         url:'${field.optionsMethod}'
                         url:'${field.optionsMethod}'
-                        }).then(res => {
+                    }).then(res => {
                         if (res.success) {
                         if (res.success) {
 
 
-                        if (res.data.length > 0) {
+                    if (res.data.length > 0) {
                         res.data.forEach(item => {
                         res.data.forEach(item => {
-                        this.${field.modelName}Options.push({label: item.${field.optionsLabel}, value:item.${field.optionsValue}});
-                        })
-                        }
+                            this.${field.modelName}Options.push({label: item.${field.optionsLabel}, value:item.${field.optionsValue}});
+                    })
+                    }
+                }
+                });
+                #elseif(${field.apiFlag}=="3")
+                    this.${esc.d}http.get({
+                        url:'/commonQuery/all',
+                        data: {
+                            tableName: '${field.optionsMethod}',
+                            databasetype: '${field.optionsDataBaseType}',
+                            dataSourceCode: '${field.optionsDataSourceCode}',
                         }
                         }
-                        });
-                    #elseif(${field.apiFlag}=="3")
-                        this.${esc.d}http.get({
-                            url:'/commonQuery/all',
-                            data: {
-                                tableName: '${field.optionsMethod}',
-                                databasetype: '${field.optionsDataBaseType}',
-                                dataSourceCode: '${field.optionsDataSourceCode}',
-                            }
-                        }).then(res => {
-                            if (res.success) {
+                    }).then(res => {
+                        if (res.success) {
 
 
-                        if (res.data.length > 0) {
-                            res.data.forEach(item => {
-                                this.${field.modelName}Options.push({label: item.${field.optionsLabel}, value:item.${field.optionsValue}});
-                        })
-                        }
+                    if (res.data.length > 0) {
+                        res.data.forEach(item => {
+                            this.${field.modelName}Options.push({label: item.${field.optionsLabel}, value:item.${field.optionsValue}});
+                    })
                     }
                     }
-                    });
-                    #end
+                }
+                });
                 #end
                 #end
             #end
             #end
-        },
-        data() {
-            return {
-                saving: false,
-                formData: {},
-                rules: {
+            #if(${field.formType}=="loginName")
+                this.formData.${field.modelName} = this.userInfo.username;
+            #end
+        #end
+    },
+    data() {
+        return {
+            saving: false,
+            formData: {
+        #foreach($field in $model.fields)
+            #if(${field.formType}=="loginName")
+                ${field.modelName}:'',
+            #end
+            #if(${field.formType}=="currentTime")
+                ${field.modelName}:format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh }),
+            #end
+            #if(${field.formType}=="currentDate")
+                ${field.modelName}:format(new Date(), 'YYYY/MM/DD', { locale: zh }),
+            #end
+        #end
+    },
+        rules: {
             #foreach($field in $model.fields)
             #foreach($field in $model.fields)
                 #if(${field.required}||${field.validate})
                 #if(${field.required}||${field.validate})
                     ${field.modelName}:
                     ${field.modelName}:
-                    [
-                        #if(${field.required})
+                [
+                    #if(${field.required})
                         {required: true, message: '请输入 $display.alt(${field.remark},${field.modelName})', trigger: 'blur'},
                         {required: true, message: '请输入 $display.alt(${field.remark},${field.modelName})', trigger: 'blur'},
-                        #end
-                        #if(${field.validate})
+                    #end
+                    #if(${field.validate})
                         #if(${field.maxLength}&&${field.minLength})
                         #if(${field.maxLength}&&${field.minLength})
-                        { min: ${field.minLength}, max: ${field.maxLength}, message: '长度在 ${field.minLength} 到 ${field.maxLength} 个字符', trigger: 'blur' },
+                            { min: ${field.minLength}, max: ${field.maxLength}, message: '长度在 ${field.minLength} 到 ${field.maxLength} 个字符', trigger: 'blur' },
                         #end
                         #end
                         #if(${field.min}&&${field.max})
                         #if(${field.min}&&${field.max})
                             {
                             {
                                 validator: (rule, value, callback) => {
                                 validator: (rule, value, callback) => {
-                                    if (value) {
-                                        if (value <= ${field.max} && value >= ${field.min}) {
-                                            callback();
-                                        } else {
-                                            callback(new Error('值在 ${field.min} 到 ${field.max} 之间'));
-                                        }
+                                if (value) {
+                                    if (value <= ${field.max} && value >= ${field.min}) {
+                                        callback();
+                                    } else {
+                                        callback(new Error('值在 ${field.min} 到 ${field.max} 之间'));
                                     }
                                     }
-                                }, trigger: 'blur'
-                            },
+                                }
+                            }, trigger: 'blur'
+                        },
                         #end
                         #end
                         #if(${field.validatorType}=="phone")
                         #if(${field.validatorType}=="phone")
-                         formValidator.phone,
+                                formValidator.phone,
                         #end
                         #end
                         #if(${field.validatorType}=="number")
                         #if(${field.validatorType}=="number")
-                         formValidator.number,
+                                formValidator.number,
                         #end
                         #end
                         #if(${field.validatorType}=="url")
                         #if(${field.validatorType}=="url")
-                         formValidator.url,
+                                formValidator.url,
                         #end
                         #end
                         #if(${field.validatorType}=="email")
                         #if(${field.validatorType}=="email")
-                         formValidator.email,
+                                formValidator.email,
                         #end
                         #end
                         #if(${field.validatorType}=="idCard")
                         #if(${field.validatorType}=="idCard")
-                         formValidator.idCard,
+                                formValidator.idCard,
                         #end
                         #end
                         #if(${field.validatorType}=="english")
                         #if(${field.validatorType}=="english")
-                         formValidator.english,
-                        #end
+                                formValidator.english,
                         #end
                         #end
-                    ],
+                    #end
+                ],
                 #end
                 #end
             #end
             #end
         },
         },
-#foreach($field in $model.fields)
-    #if(${field.formType}=="select"||${field.formType}=="multiSelect")
-        #if(${field.apiFlag}=="2"||${field.apiFlag}=="3")
-            ${field.modelName}Options:[],
-        #else
-            ${field.modelName}Options:${field.optionsValue},
-        #end
+        #foreach($field in $model.fields)
+            #if(${field.formType}=="select"||${field.formType}=="multiSelect")
+                #if(${field.apiFlag}=="2"||${field.apiFlag}=="3")
+                    ${field.modelName}Options:[],
+                #else
+                            ${field.modelName}Options:${field.optionsValue},
+                #end
+            #end
         #end
         #end
-    #end
-            subColumn: '',
-            subValue: '',
-        }
-        },
-        methods: {
-            onSave() {
-                this.${esc.d}refs.form.validate((valid) => {
-                    if (valid) {
-                        this.logicalValidate();
-                    } else {
-                        return false;
-                    }
-                });
-            },
-            logicalValidate() {
-                var data = JSON.parse(JSON.stringify(this.formData));
+        subColumn: '',
+                subValue: '',
+    }
+    },
+    computed: {
+            ...mapState(['userInfo']),
+},
+methods: {
+    onSave() {
+        this.${esc.d}refs.form.validate((valid) => {
+            if (valid) {
+                this.logicalValidate();
+            } else {
+                return false;
+    }
+    });
+    },
+    logicalValidate() {
+        var data = JSON.parse(JSON.stringify(this.formData));
 
 
-                var logicalData = {
-                    #foreach($field in $model.fields)
-                    #if(${field.logicalKey})
-                            ${field.modelName}:data.${field.modelName},
-                    #end
-                    #end
-                }
+        var logicalData = {
+        #foreach($field in $model.fields)
+            #if(${field.logicalKey})
+                ${field.modelName}:data.${field.modelName},
+            #end
+        #end
+    }
 
 
-                if (JSON.stringify(logicalData) == '{}') {
-                    this.submit();
-                } else {
-                    this.${esc.d}http.get({
-                    url: '/${display.uncapitalize($model.className)}/getOne',
-                    data: logicalData
-                    }).then(res => {
-                    if (res.success) {
+        if (JSON.stringify(logicalData) == '{}') {
+            this.submit();
+        } else {
+            this.${esc.d}http.get({
+                url: '/${display.uncapitalize($model.className)}/getOne',
+                data: logicalData
+            }).then(res => {
+                if (res.success) {
 
 
-                    var logicalFlag = true;
+                var logicalFlag = true;
 
 
-                    if (res.data) {
+                if (res.data) {
                     if (this.formData.id) {
                     if (this.formData.id) {
-                    if (res.data.id != this.formData.id) {
-                    logicalFlag = false;
-                    }
+                        if (res.data.id != this.formData.id) {
+                            logicalFlag = false;
+                        }
                     } else {
                     } else {
-                    logicalFlag = false;
+                        logicalFlag = false;
                     }
                     }
 
 
-                    }
+                }
 
 
-                    if (logicalFlag) {
+                if (logicalFlag) {
                     this.submit();
                     this.submit();
-                    } else {
+                } else {
                     this.${esc.d}message.warning('逻辑关键字:'+'#foreach($field in $model.fields)#if(${field.logicalKey})${field.remark},#end#end'+'验证失败')
                     this.${esc.d}message.warning('逻辑关键字:'+'#foreach($field in $model.fields)#if(${field.logicalKey})${field.remark},#end#end'+'验证失败')
-                    }
+                }
 
 
 
 
-                    } else {
-                    this.${esc.d}message.warning('逻辑关键字:'+'#foreach($field in $model.fields)#if(${field.logicalKey})${field.remark},#end#end'+'验证失败')
-                    }
-                    });
+            } else {
+                this.${esc.d}message.warning('逻辑关键字:'+'#foreach($field in $model.fields)#if(${field.logicalKey})${field.remark},#end#end'+'验证失败')
+            }
+        });
+        }
+    },
+    submit() {
+        var data = JSON.parse(JSON.stringify(this.formData));
+
+        #foreach($field in $model.fields)
+            #if(${field.formType}=="currentTime"||${field.formType}=="currentDate")
+                if(data.${field.modelName}){
+                    data.${field.modelName} = Date.parse(new Date(data.${field.modelName}));
                 }
                 }
-            },
-            submit() {
-                var data = JSON.parse(JSON.stringify(this.formData));
-                this.${esc.d}http.post({
-                    url: this.formData.id ? '/${display.uncapitalize($model.className)}/update' : '/${display.uncapitalize($model.className)}/save',
-                    data: data
-                }).then(res => {
-                    if (res.success) {
-                        this.${esc.d}message.success('成功');
-                        this.${esc.d}router.go(-1);
-                    } else {
-                        this.${esc.d}message.warning('失败')
-                    }
-                });
-            },
-            onDelete() {
-                this.${esc.d}alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
-                    return this.${esc.d}http.post({
-                    url: '/${display.uncapitalize($model.className)}/del',
-                    data: { id: this.formData.id }
-                    })
-                }).then(() => {
-                    this.${esc.d}message.success('删除成功');
-                    this.${esc.d}router.go(-1);
-                }).catch(action => {
-                    if (action === 'cancel') {
-                        this.${esc.d}message.info('删除取消');
-                    } else {
-                        this.${esc.d}message.error('删除失败');
-                    }
-                })
-            },
+
+            #end
+        #end
+
+    this.${esc.d}http.post({
+        url: this.formData.id ? '/${display.uncapitalize($model.className)}/update' : '/${display.uncapitalize($model.className)}/save',
+        data: data
+    }).then(res => {
+        if (res.success) {
+            this.${esc.d}message.success('成功');
+            this.${esc.d}router.go(-1);
+        } else {
+            this.${esc.d}message.warning('失败')
         }
         }
-    }
+    });
+    },
+    onDelete() {
+        this.${esc.d}alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+            return this.${esc.d}http.post({
+                url: '/${display.uncapitalize($model.className)}/del',
+                data: { id: this.formData.id }
+            })
+        }).then(() => {
+            this.${esc.d}message.success('删除成功');
+        this.${esc.d}router.go(-1);
+    }).catch(action => {
+            if (action === 'cancel') {
+            this.${esc.d}message.info('删除取消');
+        } else {
+            this.${esc.d}message.error('删除失败');
+        }
+    })
+    },
+}
+}
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>
 </style>
 </style>

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

@@ -50,7 +50,7 @@
             #foreach($field in $model.fields)
             #foreach($field in $model.fields)
                 #if(${field.showInList})
                 #if(${field.showInList})
 
 
-                    #if(${field.formType}=="date")
+                    #if(${field.formType}=="date"||${field.formType}=="currentDate")
                         <el-table-column
                         <el-table-column
                                 v-if="isColumnShow('${field.modelName}')"
                                 v-if="isColumnShow('${field.modelName}')"
                                 prop="${field.modelName}"
                                 prop="${field.modelName}"
@@ -58,7 +58,7 @@
                                 :formatter="DateFormatter"
                                 :formatter="DateFormatter"
                                 min-width="100">
                                 min-width="100">
                         </el-table-column>
                         </el-table-column>
-                    #elseif(${field.formType}=="datetime")
+                    #elseif(${field.formType}=="datetime"||${field.formType}=="currentTime")
                         <el-table-column
                         <el-table-column
                                 v-if="isColumnShow('${field.modelName}')"
                                 v-if="isColumnShow('${field.modelName}')"
                                 prop="${field.modelName}"
                                 prop="${field.modelName}"

+ 7 - 3
src/main/vue/src/pages/GenCode.vue

@@ -424,19 +424,23 @@ export default {
 			fieldTypes: ['char', 'varchar', 'int', 'text', 'timestamp', 'datetime', 'decimal', 'float', 'vue'],
 			fieldTypes: ['char', 'varchar', 'int', 'text', 'timestamp', 'datetime', 'decimal', 'float', 'vue'],
 			searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'between', 'like', 'left like', 'right like'],
 			searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'between', 'like', 'left like', 'right like'],
 			formTypes: [
 			formTypes: [
+				
 				{ label: '单行文本', value: 'singleLineText' },
 				{ label: '单行文本', value: 'singleLineText' },
-				{ label: '多行文本', value: 'textarea' },
-				{ label: '富文本', value: 'richText' },
 				{ label: '数字', value: 'number' },
 				{ label: '数字', value: 'number' },
 				{ label: '日期选择', value: 'date' },
 				{ label: '日期选择', value: 'date' },
 				{ label: '日期时间选择', value: 'datetime' },
 				{ label: '日期时间选择', value: 'datetime' },
+				{ label: '登录名', value: 'loginName' },
+				{ label: '当前时间', value: 'currentTime' },
+				{ label: '当前日期', value: 'currentDate' },
 				{ label: '单选下拉框', value: 'select' },
 				{ label: '单选下拉框', value: 'select' },
 				{ label: '多选下拉框', value: 'multiSelect' },
 				{ label: '多选下拉框', value: 'multiSelect' },
 				{ label: '单图上传', value: 'singleImage' },
 				{ label: '单图上传', value: 'singleImage' },
 				{ label: '多图上传', value: 'multiImage' },
 				{ label: '多图上传', value: 'multiImage' },
 				{ label: '文件上传', value: 'fileUpload' },
 				{ label: '文件上传', value: 'fileUpload' },
 				{ label: '树形选择', value: 'tree' },
 				{ label: '树形选择', value: 'tree' },
-				{ label: '开关', value: 'switch' }
+				{ label: '开关', value: 'switch' },
+				{ label: '多行文本', value: 'textarea' },
+				{ label: '富文本', value: 'richText' },
 			],
 			],
 			validatorTypes: [
 			validatorTypes: [
 				{ label: '英文', value: 'english' },
 				{ label: '英文', value: 'english' },

+ 203 - 146
src/main/vue/src/pages/TestAaa.vue

@@ -1,42 +1,69 @@
 <template>
 <template>
     <div>
     <div>
-        <el-form :model="formData" :rules="rules" ref="form" label-width="120px" label-position="right" size="small" style="max-width: 500px;">
-            <el-form-item prop="imageUrl" label="图片">
-                <single-upload v-model="formData.imageUrl" :disabled="'imageUrl'==subColumn"></single-upload>
-            </el-form-item>
-            <el-form-item prop="testName" label="名称">
+        <el-form :model="formData" :rules="rules" ref="form" label-width="120px" label-position="right" size="small"
+                 style="max-width: 500px;">
+                                                                                                                                                                                                                                                                 <el-form-item prop="imageUrl" label="图片">
+                 <single-upload v-model="formData.imageUrl" :disabled="'imageUrl'==subColumn"></single-upload>
+             </el-form-item>
+                                                                                                                                                                                                                                                                                                                                                                    <el-form-item prop="testName" label="枚举单选">
                 <template>
                 <template>
-                    <el-select v-model="formData.testName" clearable placeholder="请选择" :disabled="'testName'==subColumn">
-                        <el-option v-for="item in testNameOptions" :key="item.value" :label="item.label" :value="item.value">
+                    <el-select v-model="formData.testName" clearable  placeholder="请选择" :disabled="'testName'==subColumn">
+                        <el-option
+                                v-for="item in testNameOptions"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
                         </el-option>
                         </el-option>
                     </el-select>
                     </el-select>
                 </template>
                 </template>
             </el-form-item>
             </el-form-item>
-            <el-form-item prop="remark" label="嗯嗯">
+                                                                                                                                                                                                                                                                                                                                                                                                            <el-form-item prop="remark" label="接口单选">
                 <template>
                 <template>
-                    <el-select v-model="formData.remark" clearable placeholder="请选择" :disabled="'remark'==subColumn">
-                        <el-option v-for="item in remarkOptions" :key="item.value" :label="item.label" :value="item.value">
+                    <el-select v-model="formData.remark" clearable  placeholder="请选择" :disabled="'remark'==subColumn">
+                        <el-option
+                                v-for="item in remarkOptions"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
                         </el-option>
                         </el-option>
                     </el-select>
                     </el-select>
                 </template>
                 </template>
             </el-form-item>
             </el-form-item>
-            <el-form-item prop="multiSelect" label="多选">
+                                                                                                                                                                                                                                                                                                                                                                                                                                <el-form-item prop="multiSelect" label="多选">
                 <template>
                 <template>
                     <el-select v-model="formData.multiSelect" multiple clearable placeholder="请选择" :disabled="'multiSelect'==subColumn">
                     <el-select v-model="formData.multiSelect" multiple clearable placeholder="请选择" :disabled="'multiSelect'==subColumn">
-                        <el-option v-for="item in multiSelectOptions" :key="item.value" :label="item.label" :value="item.value">
+                        <el-option
+                                v-for="item in multiSelectOptions"
+                                :key="item.value"
+                                :label="item.label"
+                                :value="item.value">
                         </el-option>
                         </el-option>
                     </el-select>
                     </el-select>
                 </template>
                 </template>
             </el-form-item>
             </el-form-item>
-            <el-form-item prop="testTime" label="时间">
+                                                                                                                                                                                                                                                                                                                                                <el-form-item prop="testTime" label="时间">
                 <template>
                 <template>
                     <div class="block">
                     <div class="block">
-                        <el-date-picker v-model="formData.testTime" type="date" value-format="timestamp" placeholder="选择日期" :disabled="'testTime'==subColumn">
+                        <el-date-picker
+                                v-model="formData.testTime"
+                                type="date"
+                                value-format="timestamp"
+                                placeholder="选择日期"
+                                :disabled="'testTime'==subColumn">
                         </el-date-picker>
                         </el-date-picker>
                     </div>
                     </div>
                 </template>
                 </template>
             </el-form-item>
             </el-form-item>
-            <el-form-item>
+                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <el-form-item prop="loginUser" label="登录名">
+                            <el-input v-model="formData.loginUser" disabled></el-input>
+                        </el-form-item>
+                                                                                                                                                                                                                                                                                                                                                                                                                                            <el-form-item prop="testcTime" label="当前时间">
+                            <el-input v-model="formData.testcTime" disabled></el-input>
+                        </el-form-item>
+                                                                                                                                                                                                                                                                                                                                                                                                                                            <el-form-item prop="testcDate" label="当前日期">
+                            <el-input v-model="formData.testcDate" disabled></el-input>
+                        </el-form-item>
+                                                            <el-form-item>
                 <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
                 <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="onDelete" v-if="formData.id" type="danger">删除</el-button>
                 <el-button @click="$router.go(-1)">取消</el-button>
                 <el-button @click="$router.go(-1)">取消</el-button>
@@ -46,9 +73,13 @@
 </template>
 </template>
 <script>
 <script>
 import formValidator from '../formValidator'
 import formValidator from '../formValidator'
+import { mapState } from 'vuex'
+import { format } from 'date-fns'
+import zh from 'date-fns/locale/zh_cn'
 
 
 export default {
 export default {
     created() {
     created() {
+
         if (this.$route.query.column) {
         if (this.$route.query.column) {
             this.subColumn = this.$route.query.column.split(',')[1];
             this.subColumn = this.$route.query.column.split(',')[1];
             this.subValue = this.$route.query.column.split(',')[0];
             this.subValue = this.$route.query.column.split(',')[0];
@@ -63,170 +94,196 @@ export default {
             }).then(res => {
             }).then(res => {
                 if (res.success) {
                 if (res.success) {
 
 
+                                                                                                                                                                                                                                                                                                                                                                                                                                
+                        if(res.data.multiSelect){
+                            res.data.multiSelect = res.data.multiSelect.split(',');
+                        }else{
+                            res.data.multiSelect = [];
+                        }
 
 
-                    if (res.data.multiSelect) {
-                        res.data.multiSelect = res.data.multiSelect.split(',');
-                    } else {
-                        res.data.multiSelect = [];
-                    }
+                                                                                                                                                                                                                                                                                                    if(res.data.testcTime){
+                            res.data.testcTime = format(new Date(res.data.testcTime), 'YYYY/MM/DD HH:mm', { locale: zh });
+                        }
 
 
+                                                                                                                                            if(res.data.testcDate){
+                            res.data.testcDate = format(new Date(res.data.testcDate), 'YYYY/MM/DD', { locale: zh });
+                        }
 
 
-                    this.formData = res.data;
+                                    
+                this.formData = res.data;
 
 
-                    if (this.$route.query.column) {
-                        this.formData[this.subColumn] = this.subValue;
-                    }
+                if (this.$route.query.column) {
+                    this.formData[this.subColumn] = this.subValue;
                 }
                 }
-            })
-        } else {
+            }
+        })
+        }else {
             if (this.$route.query.column) {
             if (this.$route.query.column) {
                 this.formData[this.subColumn] = this.subValue;
                 this.formData[this.subColumn] = this.subValue;
             }
             }
         }
         }
 
 
+                                                                                                                                                                                                
 
 
 
 
+                    this.$http.get({
+                        url:'/testBbb/all'
+                    }).then(res => {
+                        if (res.success) {
 
 
-        this.$http.get({
-            url: '/testBbb/all'
-        }).then(res => {
-            if (res.success) {
-
-                if (res.data.length > 0) {
-                    res.data.forEach(item => {
-                        this.remarkOptions.push({ label: item.nameAaa, value: item.nameBbb });
+                    if (res.data.length > 0) {
+                        res.data.forEach(item => {
+                            this.remarkOptions.push({label: item.nameAaa, value:item.nameBbb});
                     })
                     })
+                    }
                 }
                 }
-            }
-        });
-        this.$http.get({
-            url: '/commonQuery/all',
-            data: {
-                tableName: 'test_bbb',
-                databasetype: 'Mysql',
-                dataSourceCode: 'dataSource',
-            }
-        }).then(res => {
-            if (res.success) {
+                });
+                                                                                                this.$http.get({
+                        url:'/commonQuery/all',
+                        data: {
+                            tableName: 'test_bbb',
+                            databasetype: 'Mysql',
+                            dataSourceCode: 'dataSource',
+                        }
+                    }).then(res => {
+                        if (res.success) {
 
 
-                if (res.data.length > 0) {
-                    res.data.forEach(item => {
-                        this.multiSelectOptions.push({ label: item.name_bbb, value: item.name_ccc });
+                    if (res.data.length > 0) {
+                        res.data.forEach(item => {
+                            this.multiSelectOptions.push({label: item.name_bbb, value:item.name_ccc});
                     })
                     })
+                    }
                 }
                 }
-            }
-        });
-    },
+                });
+                                                                                                                        this.formData.loginUser = this.userInfo.username;
+                                                                                        },
     data() {
     data() {
         return {
         return {
             saving: false,
             saving: false,
-            formData: {},
-            rules: {
-                testName:
-                    [
-                        { required: true, message: '请输入 名称', trigger: 'blur' },
-                    ],
-                remark:
-                    [
-                        { required: true, message: '请输入 嗯嗯', trigger: 'blur' },
-                    ],
-                multiSelect:
-                    [
-                        { required: true, message: '请输入 多选', trigger: 'blur' },
-                    ],
-            },
-            testNameOptions: [{ label: 'A', value: 'A' }, { label: 'B', value: 'B' }, { label: 'C', value: 'C' }],
-            remarkOptions: [],
-            multiSelectOptions: [],
-            subColumn: '',
-            subValue: '',
-        }
+            formData: {
+                                                                                                                                                                                                                                                                                                                                                        loginUser:'',
+                                                                                    testcTime:format(new Date(), 'YYYY/MM/DD HH:mm', { locale: zh }),
+                                                                                    testcDate:format(new Date(), 'YYYY/MM/DD', { locale: zh }),
+                        },
+        rules: {
+                                                                                                                                    testName:
+                [
+                                            {required: true, message: '请输入 枚举单选', trigger: 'blur'},
+                                                        ],
+                                                                remark:
+                [
+                                            {required: true, message: '请输入 接口单选', trigger: 'blur'},
+                                                        ],
+                                                                multiSelect:
+                [
+                                            {required: true, message: '请输入 表多选', trigger: 'blur'},
+                                                        ],
+                                                                                                                                                    },
+                                                                                                                            testNameOptions:[{ label: 'A', value: 'A' }, { label: 'B', value: 'B' },{ label: 'C', value: 'C' }],
+                                                                                    remarkOptions:[],
+                                                                                    multiSelectOptions:[],
+                                                                                                                            subColumn: '',
+                subValue: '',
+    }
     },
     },
-    methods: {
-        onSave() {
-            this.$refs.form.validate((valid) => {
-                if (valid) {
-                    this.logicalValidate();
-                } else {
-                    return false;
-                }
-            });
-        },
-        logicalValidate() {
-            var data = JSON.parse(JSON.stringify(this.formData));
-
-            var logicalData = {
-                testName: data.testName,
-                remark: data.remark,
-            }
-
-            if (JSON.stringify(logicalData) == '{}') {
-                this.submit();
+    computed: {
+            ...mapState(['userInfo']),
+},
+methods: {
+    onSave() {
+        this.$refs.form.validate((valid) => {
+            if (valid) {
+                this.logicalValidate();
             } else {
             } else {
-                this.$http.get({
-                    url: '/testAaa/getOne',
-                    data: logicalData
-                }).then(res => {
-                    if (res.success) {
-
-                        var logicalFlag = true;
-
-                        if (res.data) {
-                            if (this.formData.id) {
-                                if (res.data.id != this.formData.id) {
-                                    logicalFlag = false;
-                                }
-                            } else {
-                                logicalFlag = false;
-                            }
+                return false;
+    }
+    });
+    },
+    logicalValidate() {
+        var data = JSON.parse(JSON.stringify(this.formData));
 
 
-                        }
+        var logicalData = {
+                                                                                                testName:data.testName,
+                                                remark:data.remark,
+                                                                                                                            }
 
 
-                        if (logicalFlag) {
-                            this.submit();
-                        } else {
-                            this.$message.warning('逻辑关键字:' + '名称,嗯嗯,' + '验证失败')
-                        }
+        if (JSON.stringify(logicalData) == '{}') {
+            this.submit();
+        } else {
+            this.$http.get({
+                url: '/testAaa/getOne',
+                data: logicalData
+            }).then(res => {
+                if (res.success) {
 
 
+                var logicalFlag = true;
 
 
+                if (res.data) {
+                    if (this.formData.id) {
+                        if (res.data.id != this.formData.id) {
+                            logicalFlag = false;
+                        }
                     } else {
                     } else {
-                        this.$message.warning('逻辑关键字:' + '名称,嗯嗯,' + '验证失败')
+                        logicalFlag = false;
                     }
                     }
-                });
-            }
-        },
-        submit() {
-            var data = JSON.parse(JSON.stringify(this.formData));
-            this.$http.post({
-                url: this.formData.id ? '/testAaa/update' : '/testAaa/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: '/testAaa/del',
-                    data: { id: this.formData.id }
-                })
-            }).then(() => {
-                this.$message.success('删除成功');
-                this.$router.go(-1);
-            }).catch(action => {
-                if (action === 'cancel') {
-                    this.$message.info('删除取消');
+
+                if (logicalFlag) {
+                    this.submit();
                 } else {
                 } else {
-                    this.$message.error('删除失败');
+                    this.$message.warning('逻辑关键字:'+'枚举单选,接口单选,'+'验证失败')
                 }
                 }
+
+
+            } else {
+                this.$message.warning('逻辑关键字:'+'枚举单选,接口单选,'+'验证失败')
+            }
+        });
+        }
+    },
+    submit() {
+        var data = JSON.parse(JSON.stringify(this.formData));
+
+                                                                                                                                                                                                    if(data.testcTime){
+                    data.testcTime = Date.parse(new Date(data.testcTime));
+                }
+
+                                                if(data.testcDate){
+                    data.testcDate = Date.parse(new Date(data.testcDate));
+                }
+
+                    
+    this.$http.post({
+        url: this.formData.id ? '/testAaa/update' : '/testAaa/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: '/testAaa/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>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>

+ 59 - 9
src/main/vue/src/pages/TestAaas.vue

@@ -65,21 +65,21 @@
                                             <el-table-column
                                             <el-table-column
                                 v-if="isColumnShow('testName')"
                                 v-if="isColumnShow('testName')"
                                 prop="testName"
                                 prop="testName"
-                                label="名称"
+                                label="枚举单选"
                                 min-width="100">
                                 min-width="100">
                         </el-table-column>
                         </el-table-column>
                                                                 
                                                                 
                                             <el-table-column
                                             <el-table-column
                                 v-if="isColumnShow('remark')"
                                 v-if="isColumnShow('remark')"
                                 prop="remark"
                                 prop="remark"
-                                label="嗯嗯"
+                                label="接口单选"
                                 min-width="100">
                                 min-width="100">
                         </el-table-column>
                         </el-table-column>
                                                                 
                                                                 
                                             <el-table-column
                                             <el-table-column
                                 v-if="isColumnShow('multiSelect')"
                                 v-if="isColumnShow('multiSelect')"
                                 prop="multiSelect"
                                 prop="multiSelect"
-                                label="多选"
+                                label="多选"
                                 min-width="100">
                                 min-width="100">
                         </el-table-column>
                         </el-table-column>
                                                                 
                                                                 
@@ -90,6 +90,29 @@
                                 :formatter="DateFormatter"
                                 :formatter="DateFormatter"
                                 min-width="100">
                                 min-width="100">
                         </el-table-column>
                         </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('loginUser')"
+                                prop="loginUser"
+                                label="登录名"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('testcTime')"
+                                prop="testcTime"
+                                label="当前时间"
+                                :formatter="DateTimeFormatter"
+                                min-width="100">
+                        </el-table-column>
+                                                                
+                                            <el-table-column
+                                v-if="isColumnShow('testcDate')"
+                                prop="testcDate"
+                                label="当前日期"
+                                :formatter="DateFormatter"
+                                min-width="100">
+                        </el-table-column>
                                                             <el-table-column
                                                             <el-table-column
                     label="操作"
                     label="操作"
                     align="center"
                     align="center"
@@ -245,17 +268,17 @@
                                 show: true
                                 show: true
                             },
                             },
                                                                                                 {
                                                                                                 {
-                                label: '名称',
+                                label: '枚举单选',
                                 value: 'testName',
                                 value: 'testName',
                                 show: true
                                 show: true
                             },
                             },
                                                                                                 {
                                                                                                 {
-                                label: '嗯嗯',
+                                label: '接口单选',
                                 value: 'remark',
                                 value: 'remark',
                                 show: true
                                 show: true
                             },
                             },
                                                                                                 {
                                                                                                 {
-                                label: '多选',
+                                label: '多选',
                                 value: 'multiSelect',
                                 value: 'multiSelect',
                                 show: true
                                 show: true
                             },
                             },
@@ -263,6 +286,21 @@
                                 label: '时间',
                                 label: '时间',
                                 value: 'testTime',
                                 value: 'testTime',
                                 show: true
                                 show: true
+                            },
+                                                                                                {
+                                label: '登录名',
+                                value: 'loginUser',
+                                show: true
+                            },
+                                                                                                {
+                                label: '当前时间',
+                                value: 'testcTime',
+                                show: true
+                            },
+                                                                                                {
+                                label: '当前日期',
+                                value: 'testcDate',
+                                show: true
                             },
                             },
                                                             ],
                                                             ],
                 multipleMode: false,
                 multipleMode: false,
@@ -281,20 +319,32 @@
                                 value: 'image_url'
                                 value: 'image_url'
                             },
                             },
                                                                                                 {
                                                                                                 {
-                                label: '名称',
+                                label: '枚举单选',
                                 value: 'test_name'
                                 value: 'test_name'
                             },
                             },
                                                                                                 {
                                                                                                 {
-                                label: '嗯嗯',
+                                label: '接口单选',
                                 value: 'remark'
                                 value: 'remark'
                             },
                             },
                                                                                                 {
                                                                                                 {
-                                label: '多选',
+                                label: '多选',
                                 value: 'multi_select'
                                 value: 'multi_select'
                             },
                             },
                                                                                                 {
                                                                                                 {
                                 label: '时间',
                                 label: '时间',
                                 value: 'test_time'
                                 value: 'test_time'
+                            },
+                                                                                                {
+                                label: '登录名',
+                                value: 'login_user'
+                            },
+                                                                                                {
+                                label: '当前时间',
+                                value: 'testc_time'
+                            },
+                                                                                                {
+                                label: '当前日期',
+                                value: 'testc_date'
                             },
                             },
                                                             ],
                                                             ],
                 advancedQuerySearchKey: '',
                 advancedQuerySearchKey: '',

+ 75 - 76
src/main/vue/src/pages/Testaaaone.vue

@@ -1,17 +1,16 @@
 <template>
 <template>
     <div>
     <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-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-input v-model="formData.delFlag"></el-input>
             </el-form-item>
             </el-form-item>
-                                                                                                                                                                                                                                                                                                                            <el-form-item prop="testName" label="名字">
+            <el-form-item prop="testName" label="名字">
                 <el-input v-model="formData.testName"></el-input>
                 <el-input v-model="formData.testName"></el-input>
             </el-form-item>
             </el-form-item>
-                                                                                                                                                                                                                                                                                                                            <el-form-item prop="remark" label="备注">
+            <el-form-item prop="remark" label="备注">
                 <el-input v-model="formData.remark"></el-input>
                 <el-input v-model="formData.remark"></el-input>
             </el-form-item>
             </el-form-item>
-                                                                                                                                                                                                                                                                                        <el-form-item>
+            <el-form-item>
                 <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
                 <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="onDelete" v-if="formData.id" type="danger">删除</el-button>
                 <el-button @click="$router.go(-1)">取消</el-button>
                 <el-button @click="$router.go(-1)">取消</el-button>
@@ -20,86 +19,86 @@
     </div>
     </div>
 </template>
 </template>
 <script>
 <script>
-    import formValidator from '../formValidator'
+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) {
+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: {
-                                                                                                        testName:
+                    this.formData = res.data;
+                }
+            })
+        }
+
+    },
+    data() {
+        return {
+            saving: false,
+            formData: {},
+            rules: {
+                testName:
                     [
                     [
-                                                {required: true, message: '请输入 名字', trigger: 'blur'},
-                                                                                                                                                                         formValidator.number,
-                                                                                                                                                                    ],
-                                                                remark:
+                        { required: true, message: '请输入 名字', trigger: 'blur' },
+                        formValidator.number,
+                    ],
+                remark:
                     [
                     [
-                                                {required: true, message: '请输入 备注', trigger: 'blur'},
-                                                                    ],
-                                    },
-                                        }
-        },
-        methods: {
-            onSave() {
-                this.$refs.form.validate((valid) => {
-                    if (valid) {
-                        this.submit();
-                    } else {
-                        return false;
-                    }
-                });
+                        { required: true, message: '请输入 备注', trigger: 'blur' },
+                    ],
             },
             },
-            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({
+        }
+    },
+    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',
                     url: '/testaaaone/del',
                     data: { id: this.formData.id }
                     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('删除失败');
-                    }
                 })
                 })
-            },
-        }
+            }).then(() => {
+                this.$message.success('删除成功');
+                this.$router.go(-1);
+            }).catch(action => {
+                if (action === 'cancel') {
+                    this.$message.info('删除取消');
+                } else {
+                    this.$message.error('删除失败');
+                }
+            })
+        },
     }
     }
+}
 </script>
 </script>
 <style lang="less" scoped>
 <style lang="less" scoped>
 </style>
 </style>