1
0
xinmu_server 7 лет назад
Родитель
Сommit
9d104dc060
30 измененных файлов с 1116 добавлено и 3 удалено
  1. 33 0
      src/main/java/com/izouma/awesomeadmin/dao/TestgitMapper.java
  2. 218 0
      src/main/java/com/izouma/awesomeadmin/dao/TestgitMapper.xml
  3. 66 0
      src/main/java/com/izouma/awesomeadmin/model/Testgit.java
  4. 27 0
      src/main/java/com/izouma/awesomeadmin/service/TestgitService.java
  5. 137 0
      src/main/java/com/izouma/awesomeadmin/service/impl/TestgitServiceImpl.java
  6. 153 0
      src/main/java/com/izouma/awesomeadmin/web/TestgitController.java
  7. 87 0
      src/main/vue/src/pages/Testgit.vue
  8. 382 0
      src/main/vue/src/pages/Testgits.vue
  9. 10 0
      src/main/vue/src/router/index.js
  10. 1 1
      src/main/webapp/WEB-INF/html/admin.html
  11. 0 0
      src/main/webapp/static/css/app.44f99e2bf654117e6c2403eeafaa8870.css
  12. 0 0
      src/main/webapp/static/css/app.44f99e2bf654117e6c2403eeafaa8870.css.map
  13. 0 0
      src/main/webapp/static/js/32.1eb73e0f243c7d6a0d99.js
  14. 0 0
      src/main/webapp/static/js/32.1eb73e0f243c7d6a0d99.js.map
  15. 0 0
      src/main/webapp/static/js/32.5c9b7204e41e88fa72f5.js
  16. 0 0
      src/main/webapp/static/js/32.5c9b7204e41e88fa72f5.js.map
  17. 0 0
      src/main/webapp/static/js/33.4cae7323f6de35e1e333.js
  18. 0 0
      src/main/webapp/static/js/33.4cae7323f6de35e1e333.js.map
  19. 2 2
      src/main/webapp/static/js/34.89120440b2618ed564c4.js
  20. 0 0
      src/main/webapp/static/js/34.89120440b2618ed564c4.js.map
  21. 0 0
      src/main/webapp/static/js/35.dbdd4702d4fafc63cee0.js
  22. 0 0
      src/main/webapp/static/js/35.dbdd4702d4fafc63cee0.js.map
  23. 0 0
      src/main/webapp/static/js/36.bec09ddfba63d6ec649d.js
  24. 0 0
      src/main/webapp/static/js/36.bec09ddfba63d6ec649d.js.map
  25. 0 0
      src/main/webapp/static/js/37.130f4603473ae8b2953e.js
  26. 0 0
      src/main/webapp/static/js/37.130f4603473ae8b2953e.js.map
  27. 0 0
      src/main/webapp/static/js/app.6eb065a9a9873d3f2122.js
  28. 0 0
      src/main/webapp/static/js/app.6eb065a9a9873d3f2122.js.map
  29. 0 0
      src/main/webapp/static/js/manifest.7bf3850dc1a0c3e43473.js
  30. 0 0
      src/main/webapp/static/js/manifest.7bf3850dc1a0c3e43473.js.map

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

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

+ 218 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestgitMapper.xml

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

+ 66 - 0
src/main/java/com/izouma/awesomeadmin/model/Testgit.java

@@ -0,0 +1,66 @@
+package com.izouma.awesomeadmin.model;
+
+import java.util.*;
+import com.fasterxml.jackson.annotation.JsonAutoDetect;
+import com.fasterxml.jackson.annotation.JsonInclude;
+
+
+@JsonAutoDetect
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class Testgit{
+    private Integer id;
+    private String delFlag;
+
+private String searchKey;
+
+/**
+* and,test_name,like,value;or,remark,=,123
+*/
+private String advancedQuery;
+
+/**
+* column_name_,desc_;column_name_,asc
+*/
+private String orderByStr;
+
+    public Integer getId(){
+        return this.id;
+    }
+
+    public void setId(Integer id){
+        this.id = id;
+    }
+    public String getDelFlag(){
+        return this.delFlag;
+    }
+
+    public void setDelFlag(String delFlag){
+        this.delFlag = delFlag;
+    }
+
+public String getSearchKey() {
+    return searchKey;
+}
+
+public void setSearchKey(String searchKey) {
+    this.searchKey = searchKey;
+}
+
+public String getAdvancedQuery() {
+    return advancedQuery;
+}
+
+public void setAdvancedQuery(String advancedQuery) {
+    this.advancedQuery = advancedQuery;
+}
+
+public String getOrderByStr() {
+    return orderByStr;
+}
+
+public void setOrderByStr(String orderByStr) {
+    this.orderByStr = orderByStr;
+}
+
+}
+

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

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.Testgit;
+
+
+/**
+*  service接口类
+*/
+public interface TestgitService{
+
+    List<Testgit> getTestgitList(Testgit record);
+
+    List<Testgit> getTestgitByPage(Page page, Testgit record);
+
+    Testgit getTestgitById(String id);
+
+    Testgit getTestgit(Testgit record);
+
+    boolean createTestgit(Testgit record);
+
+    boolean deleteTestgit(String id);
+
+    boolean updateTestgit(Testgit record);
+}
+

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

@@ -0,0 +1,137 @@
+package com.izouma.awesomeadmin.service.impl;
+
+import java.util.*;
+import org.apache.log4j.Logger;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.izouma.awesomeadmin.constant.AppConstant;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.Testgit;
+import com.izouma.awesomeadmin.service.TestgitService;
+import com.izouma.awesomeadmin.dao.TestgitMapper;
+
+/**
+*  service接口实现类
+*/
+@Service
+public class TestgitServiceImpl implements TestgitService{
+
+    private static Logger logger = Logger.getLogger(TestgitServiceImpl.class);
+
+    @Autowired
+    private TestgitMapper testgitMapper;
+
+    @Override
+    public List<Testgit> getTestgitList(Testgit record) {
+
+        logger.info("getTestgitList");
+        try {
+
+        return testgitMapper.queryAllTestgit(record);
+        } catch (Exception e) {
+        logger.error("getTestgitList", e);
+        }
+
+        return null;
+    }
+    @Override
+    public List<Testgit> getTestgitByPage(Page page, Testgit record) {
+
+        logger.info("getTestgitByPage");
+        try {
+
+        Map<String, Object> parameter = new HashMap<String, Object>();
+        parameter.put("record", record);
+        parameter.put(AppConstant.PAGE, page);
+
+        return testgitMapper.queryTestgitByPage(parameter);
+        } catch (Exception e) {
+        logger.error("getTestgitByPage", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public Testgit getTestgitById(String id) {
+
+        logger.info("getTestgityId");
+        try {
+
+            return testgitMapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+        logger.error("getTestgitById", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public Testgit getTestgit(Testgit record) {
+
+        logger.info("getTestgit");
+        try {
+
+            return testgitMapper.queryTestgit(record);
+        } catch (Exception e) {
+        logger.error("getTestgit", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public boolean createTestgit(Testgit record) {
+
+        logger.info("createTestgit");
+        try {
+
+            int updates = testgitMapper.insertSelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+            logger.error("createTestgit", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean deleteTestgit(String id) {
+
+        logger.info("deleteTestgit");
+        try {
+
+             int updates = testgitMapper.delete(id);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("deleteTestgit", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean updateTestgit(Testgit record) {
+
+        logger.info("updateTestgit");
+        try {
+
+            int updates = testgitMapper.updateByPrimaryKeySelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("updateTestgit", e);
+        }
+
+        return false;
+    }
+}
+

+ 153 - 0
src/main/java/com/izouma/awesomeadmin/web/TestgitController.java

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

+ 87 - 0
src/main/vue/src/pages/Testgit.vue

@@ -0,0 +1,87 @@
+<template>
+    <div>
+        <el-form :model="formData" :rules="rules" ref="form" label-width="80px" label-position="right" size="small"
+                 style="max-width: 500px;">
+                                                                                <el-form-item>
+                <el-button @click="onSave" :loading="$store.state.fetchingData" type="primary">保存</el-button>
+                <el-button @click="onDelete" v-if="formData.id" type="danger">删除</el-button>
+                <el-button @click="$router.go(-1)">取消</el-button>
+            </el-form-item>
+        </el-form>
+    </div>
+</template>
+<script>
+    import formValidator from '../formValidator'
+
+    export default {
+        created() {
+            if (this.$route.query.id) {
+                this.$http.get({
+                    url: '/testgit/getOne',
+                    data: {
+                        id: this.$route.query.id
+                    }
+                }).then(res => {
+                    if (res.success) {
+
+                                                                                                                                
+                        this.formData = res.data;
+                    }
+                })
+            }
+
+                                                                            },
+        data() {
+            return {
+                saving: false,
+                formData: {},
+                rules: {
+                                                                            },
+                        }
+        },
+        methods: {
+            onSave() {
+                this.$refs.form.validate((valid) => {
+                    if (valid) {
+                        this.submit();
+                    } else {
+                        return false;
+                    }
+                });
+            },
+            submit() {
+                var data = JSON.parse(JSON.stringify(this.formData));
+                this.$http.post({
+                    url: this.formData.id ? '/testgit/update' : '/testgit/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: '/testgit/del',
+                    data: { id: this.formData.id }
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.$router.go(-1);
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+        }
+    }
+</script>
+<style lang="less" scoped>
+</style>

+ 382 - 0
src/main/vue/src/pages/Testgits.vue

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

+ 10 - 0
src/main/vue/src/router/index.js

@@ -249,6 +249,16 @@ const router = new Router({
                     path: '/testaaaones',
                     name: 'Testaaaones',
                     component: () => import('../pages/Testaaaones')
+                },
+                {
+                    path: '/testgit',
+                    name: 'Testgit',
+                    component: () => import('../pages/Testgit')
+                },
+                {
+                    path: '/testgits',
+                    name: 'Testgits',
+                    component: () => import('../pages/Testgits')
                 }
                 /**INSERT_LOCATION**/
             ]

+ 1 - 1
src/main/webapp/WEB-INF/html/admin.html

@@ -1 +1 @@
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>管理后台</title><link rel=icon href=static/favicon.ico><script src=static/fontawesome-v5.2.0.js></script><link href=/static/css/app.6bb7255ebfac248f3f9dcadcf3d82a3c.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.b7dda5037b783cb0d234.js></script><script type=text/javascript src=/static/js/vendor.3f86866ebafed14d9794.js></script><script type=text/javascript src=/static/js/app.958e7d687a2d631fdd95.js></script></body></html>
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>管理后台</title><link rel=icon href=static/favicon.ico><script src=static/fontawesome-v5.2.0.js></script><link href=/static/css/app.44f99e2bf654117e6c2403eeafaa8870.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.7bf3850dc1a0c3e43473.js></script><script type=text/javascript src=/static/js/vendor.3f86866ebafed14d9794.js></script><script type=text/javascript src=/static/js/app.6eb065a9a9873d3f2122.js></script></body></html>

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/css/app.44f99e2bf654117e6c2403eeafaa8870.css


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/css/app.44f99e2bf654117e6c2403eeafaa8870.css.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/32.1eb73e0f243c7d6a0d99.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/32.1eb73e0f243c7d6a0d99.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/32.5c9b7204e41e88fa72f5.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/32.5c9b7204e41e88fa72f5.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/33.4cae7323f6de35e1e333.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/33.4cae7323f6de35e1e333.js.map


+ 2 - 2
src/main/webapp/static/js/35.ff2dfa1ec6141f726df6.js → src/main/webapp/static/js/34.89120440b2618ed564c4.js

@@ -1,2 +1,2 @@
-webpackJsonp([35],{Wh3M:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-form",{ref:"form",staticStyle:{"max-width":"500px"},attrs:{model:e.formData,rules:e.rules,"label-width":"80px","label-position":"right",size:"small"}},[a("el-form-item",{attrs:{prop:"dataruleName",label:"权限名称"}},[a("el-input",{model:{value:e.formData.dataruleName,callback:function(t){e.$set(e.formData,"dataruleName",t)},expression:"formData.dataruleName"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"permission",label:"权限标识"}},[a("el-input",{model:{value:e.formData.permission,callback:function(t){e.$set(e.formData,"permission",t)},expression:"formData.permission"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{loading:e.$store.state.fetchingData,type:"primary"},on:{click:e.onSave}},[e._v("保存")]),e._v(" "),a("el-button",{on:{click:function(t){e.$router.go(-1)}}},[e._v("取消")])],1)],1)],1)},staticRenderFns:[]};var s=a("VU/8")({created:function(){var e=this;this.$route.query.id&&this.$http.get({url:"/sysDatarule/getOne",data:{id:this.$route.query.id}}).then(function(t){t.success&&(e.formData=t.data)})},data:function(){return{saving:!1,formData:{},rules:{dataruleName:[{required:!0,message:"请填写权限名称",trigger:"blur"}],permission:[{required:!0,message:"请填写权限标识",trigger:"blur"}]},menus:[]}},methods:{onSave:function(){var e=this;this.$refs.form.validate(function(t){if(!t)return!1;e.submit()})},submit:function(){var e=this;this.$http.post({url:this.formData.id?"/sysDatarule/update":"/sysDatarule/save",data:this.formData}).then(function(t){t.success?(e.$message.success("成功"),e.$router.go(-1)):e.$message.warning("失败")})}}},r,!1,function(e){a("awIv")},"data-v-3d1f3150",null);t.default=s.exports},awIv:function(e,t){}});
-//# sourceMappingURL=35.ff2dfa1ec6141f726df6.js.map
+webpackJsonp([34],{Wh3M:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-form",{ref:"form",staticStyle:{"max-width":"500px"},attrs:{model:e.formData,rules:e.rules,"label-width":"80px","label-position":"right",size:"small"}},[a("el-form-item",{attrs:{prop:"dataruleName",label:"权限名称"}},[a("el-input",{model:{value:e.formData.dataruleName,callback:function(t){e.$set(e.formData,"dataruleName",t)},expression:"formData.dataruleName"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"permission",label:"权限标识"}},[a("el-input",{model:{value:e.formData.permission,callback:function(t){e.$set(e.formData,"permission",t)},expression:"formData.permission"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{loading:e.$store.state.fetchingData,type:"primary"},on:{click:e.onSave}},[e._v("保存")]),e._v(" "),a("el-button",{on:{click:function(t){e.$router.go(-1)}}},[e._v("取消")])],1)],1)],1)},staticRenderFns:[]};var s=a("VU/8")({created:function(){var e=this;this.$route.query.id&&this.$http.get({url:"/sysDatarule/getOne",data:{id:this.$route.query.id}}).then(function(t){t.success&&(e.formData=t.data)})},data:function(){return{saving:!1,formData:{},rules:{dataruleName:[{required:!0,message:"请填写权限名称",trigger:"blur"}],permission:[{required:!0,message:"请填写权限标识",trigger:"blur"}]},menus:[]}},methods:{onSave:function(){var e=this;this.$refs.form.validate(function(t){if(!t)return!1;e.submit()})},submit:function(){var e=this;this.$http.post({url:this.formData.id?"/sysDatarule/update":"/sysDatarule/save",data:this.formData}).then(function(t){t.success?(e.$message.success("成功"),e.$router.go(-1)):e.$message.warning("失败")})}}},r,!1,function(e){a("awIv")},"data-v-3d1f3150",null);t.default=s.exports},awIv:function(e,t){}});
+//# sourceMappingURL=34.89120440b2618ed564c4.js.map

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/34.89120440b2618ed564c4.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/35.dbdd4702d4fafc63cee0.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/35.dbdd4702d4fafc63cee0.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/36.bec09ddfba63d6ec649d.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/36.bec09ddfba63d6ec649d.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/37.130f4603473ae8b2953e.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/37.130f4603473ae8b2953e.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/app.6eb065a9a9873d3f2122.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/app.6eb065a9a9873d3f2122.js.map


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/manifest.7bf3850dc1a0c3e43473.js


Разница между файлами не показана из-за своего большого размера
+ 0 - 0
src/main/webapp/static/js/manifest.7bf3850dc1a0c3e43473.js.map


Некоторые файлы не были показаны из-за большого количества измененных файлов