Browse Source

AUTO COMMITTED BY SERVER

xiongzhu 7 years ago
parent
commit
1971c0c278

+ 33 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestDeploy1Mapper.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.TestDeploy1;
+
+
+/**
+*  Dao接口
+*/
+@Repository("com.zoumaframe.dao.TestDeploy1Mapper")
+public interface TestDeploy1Mapper{
+
+    int deleteByPrimaryKey(Integer id);
+
+    int insertSelective(TestDeploy1 record);
+
+    TestDeploy1 selectByPrimaryKey(Integer id);
+
+    int updateByPrimaryKeySelective(TestDeploy1 record);
+
+    List<TestDeploy1> queryAllTestDeploy1(TestDeploy1 record);
+
+    List<TestDeploy1> queryTestDeploy1ByPage(Map<String, Object> parameter);
+
+    int delete(String id);
+
+    TestDeploy1 queryTestDeploy1(TestDeploy1 record);
+
+    List<TestDeploy1> query(TestDeploy1 record);
+}
+

+ 189 - 0
src/main/java/com/izouma/awesomeadmin/dao/TestDeploy1Mapper.xml

@@ -0,0 +1,189 @@
+<?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.TestDeploy1Mapper" >
+    <resultMap id="BaseResultMap" type="com.izouma.awesomeadmin.model.TestDeploy1" >
+        <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_deploy1
+        where id = #{id,jdbcType=INTEGER}
+    </select>
+    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
+        delete from test_deploy1
+        where id = #{id,jdbcType=INTEGER}
+    </delete>
+    <insert id="insertSelective" parameterType="com.izouma.awesomeadmin.model.TestDeploy1" useGeneratedKeys="true" keyProperty="id">
+        insert into test_deploy1
+        <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.TestDeploy1" >
+        update test_deploy1
+        <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="queryTestDeploy1ByPage" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestDeploy1">
+        select <include refid="Base_Column_List"/> from test_deploy1
+        <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 id desc
+    </select>
+    <select id="queryAllTestDeploy1" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestDeploy1">
+        select <include refid="Base_Column_List"/> from test_deploy1
+        <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 id desc
+    </select>
+    <select id="queryTestDeploy1" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestDeploy1">
+        select <include refid="Base_Column_List"/> from test_deploy1
+        <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_deploy1 SET del_flag = 'Y'
+        <where>
+            AND id = #{id}
+        </where>
+    </update>
+    <select id="query" parameterType="java.util.Map" resultType="com.izouma.awesomeadmin.model.TestDeploy1">
+        select <include refid="Base_Column_List"/> from test_deploy1
+        <where>
+            and del_flag = 'N'
+        </where>
+        order by id desc
+    </select>
+</mapper>
+

+ 53 - 0
src/main/java/com/izouma/awesomeadmin/model/TestDeploy1.java

@@ -0,0 +1,53 @@
+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 TestDeploy1{
+    private Integer id;
+    private String delFlag;
+
+private String searchKey;
+
+/**
+* and,test_name,like,value;or,remark,=,123
+*/
+private String advancedQuery;
+
+    public Integer getId(){
+        return this.id;
+    }
+
+    public void setId(Integer id){
+        this.id = id;
+    }
+    public String getDelFlag(){
+        return this.delFlag;
+    }
+
+    public void setDelFlag(String delFlag){
+        this.delFlag = delFlag;
+    }
+
+public String getSearchKey() {
+    return searchKey;
+}
+
+public void setSearchKey(String searchKey) {
+    this.searchKey = searchKey;
+}
+
+public String getAdvancedQuery() {
+    return advancedQuery;
+}
+
+public void setAdvancedQuery(String advancedQuery) {
+    this.advancedQuery = advancedQuery;
+}
+
+}
+

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

@@ -0,0 +1,27 @@
+package com.izouma.awesomeadmin.service;
+
+import java.util.*;
+import com.izouma.awesomeadmin.dto.Page;
+import com.izouma.awesomeadmin.model.TestDeploy1;
+
+
+/**
+*  service接口类
+*/
+public interface TestDeploy1Service{
+
+    List<TestDeploy1> getTestDeploy1List(TestDeploy1 record);
+
+    List<TestDeploy1> getTestDeploy1ByPage(Page page, TestDeploy1 record);
+
+    TestDeploy1 getTestDeploy1ById(String id);
+
+    TestDeploy1 getTestDeploy1(TestDeploy1 record);
+
+    boolean createTestDeploy1(TestDeploy1 record);
+
+    boolean deleteTestDeploy1(String id);
+
+    boolean updateTestDeploy1(TestDeploy1 record);
+}
+

+ 137 - 0
src/main/java/com/izouma/awesomeadmin/service/impl/TestDeploy1ServiceImpl.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.TestDeploy1;
+import com.izouma.awesomeadmin.service.TestDeploy1Service;
+import com.izouma.awesomeadmin.dao.TestDeploy1Mapper;
+
+/**
+*  service接口实现类
+*/
+@Service
+public class TestDeploy1ServiceImpl implements TestDeploy1Service{
+
+    private static Logger logger = Logger.getLogger(TestDeploy1ServiceImpl.class);
+
+    @Autowired
+    private TestDeploy1Mapper testDeploy1Mapper;
+
+    @Override
+    public List<TestDeploy1> getTestDeploy1List(TestDeploy1 record) {
+
+        logger.info("getTestDeploy1List");
+        try {
+
+        return testDeploy1Mapper.queryAllTestDeploy1(record);
+        } catch (Exception e) {
+        logger.error("getTestDeploy1List", e);
+        }
+
+        return null;
+    }
+    @Override
+    public List<TestDeploy1> getTestDeploy1ByPage(Page page, TestDeploy1 record) {
+
+        logger.info("getTestDeploy1ByPage");
+        try {
+
+        Map<String, Object> parameter = new HashMap<String, Object>();
+        parameter.put("record", record);
+        parameter.put(AppConstant.PAGE, page);
+
+        return testDeploy1Mapper.queryTestDeploy1ByPage(parameter);
+        } catch (Exception e) {
+        logger.error("getTestDeploy1ByPage", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public TestDeploy1 getTestDeploy1ById(String id) {
+
+        logger.info("getTestDeploy1yId");
+        try {
+
+            return testDeploy1Mapper.selectByPrimaryKey(Integer.valueOf(id));
+        } catch (Exception e) {
+        logger.error("getTestDeploy1ById", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public TestDeploy1 getTestDeploy1(TestDeploy1 record) {
+
+        logger.info("getTestDeploy1");
+        try {
+
+            return testDeploy1Mapper.queryTestDeploy1(record);
+        } catch (Exception e) {
+        logger.error("getTestDeploy1", e);
+        }
+
+        return null;
+    }
+
+    @Override
+    public boolean createTestDeploy1(TestDeploy1 record) {
+
+        logger.info("createTestDeploy1");
+        try {
+
+            int updates = testDeploy1Mapper.insertSelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+            logger.error("createTestDeploy1", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean deleteTestDeploy1(String id) {
+
+        logger.info("deleteTestDeploy1");
+        try {
+
+             int updates = testDeploy1Mapper.delete(id);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("deleteTestDeploy1", e);
+        }
+
+        return false;
+    }
+
+    @Override
+    public boolean updateTestDeploy1(TestDeploy1 record) {
+
+        logger.info("updateTestDeploy1");
+        try {
+
+            int updates = testDeploy1Mapper.updateByPrimaryKeySelective(record);
+
+            if (updates > 0) {
+                 return true;
+            }
+        } catch (Exception e) {
+             logger.error("updateTestDeploy1", e);
+        }
+
+        return false;
+    }
+}
+

+ 153 - 0
src/main/java/com/izouma/awesomeadmin/web/TestDeploy1Controller.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.TestDeploy1;
+import com.izouma.awesomeadmin.service.TestDeploy1Service;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+*  controller类
+*/
+@Controller
+@RequestMapping("/testDeploy1")
+public class TestDeploy1Controller extends BaseController{
+
+    @Autowired
+    private TestDeploy1Service testDeploy1Service;
+
+    /**
+    * <p>获取全部记录。</p>
+    */
+    @RequiresAuthentication
+    @RequestMapping(value = "/all", method = RequestMethod.GET)
+    @ResponseBody
+    public Result all(TestDeploy1 record) {
+        List<TestDeploy1> pp = testDeploy1Service.getTestDeploy1List(record);
+        return new Result(true, pp);
+    }
+
+    /**
+    * <p>根据Id。</p>
+    */
+    @RequestMapping(value = "/getTestDeploy1", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getTestDeploy1(@RequestParam(required = false, value = "id") String id) {
+        TestDeploy1 data = testDeploy1Service.getTestDeploy1ById(id);
+        return new Result(true, data);
+    }
+
+    /**
+    * <p>根据条件获取。</p>
+    */
+    @RequestMapping(value = "/getOne", method = RequestMethod.GET)
+    @ResponseBody
+    public Result getOne(TestDeploy1 record) {
+        TestDeploy1 data = testDeploy1Service.getTestDeploy1(record);
+        return new Result(true, data);
+    }
+
+
+    /**
+    * <p>分页查询。</p>
+    */
+    @RequestMapping(value = "/page", method = RequestMethod.GET)
+    @ResponseBody
+    public Result page(Page page, TestDeploy1 record) {
+        Map<String, Object> result = new HashMap<>();
+
+        List<TestDeploy1> pp =testDeploy1Service.getTestDeploy1ByPage(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(TestDeploy1 record) {
+        boolean num = testDeploy1Service.createTestDeploy1(record);
+        if (num) {
+        return new Result(true, record.getId());
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>更新信息。</p>
+    */
+    @RequestMapping(value = "/update", method = RequestMethod.POST)
+    @ResponseBody
+    public Result updateTestDeploy1(TestDeploy1 record) {
+        boolean num = testDeploy1Service.updateTestDeploy1(record);
+        if (num) {
+        return new Result(true, "保存成功");
+        }
+        return new Result(false, "保存异常");
+    }
+
+    /**
+    * <p>删除。</p>
+    */
+    @RequestMapping(value = "/del", method = RequestMethod.POST)
+    @ResponseBody
+    public Result deleteTestDeploy1(@RequestParam(required = true, value = "id") String id) {
+
+        boolean num = testDeploy1Service.deleteTestDeploy1(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, TestDeploy1 record) throws Exception {
+
+    List<TestDeploy1> testDeploy1s = testDeploy1Service.getTestDeploy1List(record);
+
+
+        String sheetName = "test_deploy1";
+        String titleName = "test_deploy1数据表";
+        String fileName = "test_deploy1表";
+        int columnNumber = 2;
+        int[] columnWidth = { 20,  20 };
+        String[] columnName = {  "id",   "删除标识"  };
+        String[][] dataList = new String[testDeploy1s.size()][2];
+
+        for (int i = 0; i < testDeploy1s.size(); i++) {
+
+            dataList[i][0] = String.valueOf(testDeploy1s.get(i).getId());
+            dataList[i][1] = String.valueOf(testDeploy1s.get(i).getDelFlag());
+        }
+
+
+        ExportExcelUtil.ExportWithResponse(sheetName, titleName, fileName,
+        columnNumber, columnWidth, columnName, dataList, response);
+
+
+        }
+    }
+

+ 84 - 0
src/main/vue/src/pages/TestDeploy1.vue

@@ -0,0 +1,84 @@
+<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: '/testDeploy1/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 ? '/testDeploy1/update' : '/testDeploy1/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: '/testDeploy1/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>

+ 286 - 0
src/main/vue/src/pages/TestDeploy1s.vue

@@ -0,0 +1,286 @@
+<template>
+    <div>
+        <div class="filters-container">
+          
+            <el-input placeholder="关键字" size="small" v-model="filter1" clearable class="filter-item"></el-input>
+              <!--<el-select placeholder="性别" size="small" v-model="filter2" clearable class="filter-item">
+                <el-option
+                        label="女"
+                        value="item1">
+                </el-option>
+                <el-option
+                        label="男"
+                        value="item2">
+                </el-option>
+            </el-select>-->
+              <el-button @click="searchData" type="primary" size="small" icon="el-icon-search" class="filter-item">搜索
+              </el-button>
+            <el-button @click="showAdvancedQueryDialog = !showAdvancedQueryDialog" type="primary" size="small" icon="el-icon-search" class="filter-item">高级查询
+            </el-button>
+
+            <el-button @click="$router.push('/testDeploy1')" 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>
+
+    </div>
+</template>
+<script>
+    import {mapState} from 'vuex'
+
+    export default {
+        created() {
+            this.getData();
+        },
+        data() {
+            return {
+                totalNumber: 0,
+                totalPage: 10,
+                currentPage: 1,
+                pageSize: 20,
+                tableData: [],
+                filter1: '',
+                filter2: '',
+                tableColumns: [
+                ],
+                multipleMode: false,
+                showAdvancedQueryDialog: false,
+                advancedQueryFields: [],
+                searchMethods: ['=', '!=', '>', '>=', '<', '<=', 'like'],
+                advancedQueryColumns: [
+                ],
+                advancedQuerySearchKey: '',
+            }
+        },
+        computed: {
+            ...mapState(['tableHeight']),
+            selection() {
+                return this.$refs.table.selection.map(i => i.id);
+            }
+        },
+        methods: {
+            pageSizeChange(size) {
+                this.currentPage = 1;
+                this.pageSize = size;
+                this.getData();
+            },
+            currentPageChange(page) {
+                this.currentPage = page;
+                this.getData();
+            },
+            getData() {
+                this.$http.get({
+                url: '/testDeploy1/page',
+                data: {
+                    currentPage: this.currentPage,
+                    pageNumber: this.pageSize,
+                    searchKey: this.filter1,
+                    advancedQuery: this.advancedQuerySearchKey,
+                }
+                }).then(res => {
+                    if (res.success) {
+                        this.totalNumber = res.data.page.totalNumber;
+                        this.tableData = res.data.pp;
+                    }
+                })
+            },
+            isColumnShow(column) {
+                var row = this.tableColumns.find(i => i.value === column);
+                return row ? row.show : false;
+            },
+            toggleMultipleMode(multipleMode) {
+                this.multipleMode = multipleMode;
+                if (!multipleMode) {
+                    this.$refs.table.clearSelection();
+                }
+            },
+            editRow(row) {
+                this.$router.push({
+                    path: '/testDeploy1',
+                    query: {
+                        id: row.id
+                    }
+                })
+            },
+            operation1() {
+                this.$notify({
+                    title: '提示',
+                    message: this.selection
+                });
+            },
+            operation2() {
+                this.$message('操作2');
+            },
+            addField() {
+                this.advancedQueryFields.push({
+                    link: 'AND',
+                    name: '',
+                    searchMethod: '=',
+                    value: '',
+                });
+            },
+            removeField(i) {
+                if (this.advancedQueryFields.length > 0) {
+                    this.advancedQueryFields.splice(i, 1);
+                }
+            },
+            advancedQuery() {
+
+                this.advancedQuerySearchKey = '';
+
+                if (this.advancedQueryFields.length > 0) {
+
+                    var templist = [];
+
+                    this.advancedQueryFields.forEach(item => {
+                        if (item.link && item.name && item.searchMethod && item.value) {
+                            var tempItem = item.link + '_,' + item.name + '_,' + item.searchMethod + '_,' + item.value;
+                            templist.push(tempItem);
+                        }
+                    })
+
+                    if (templist.length > 0) {
+
+                        this.advancedQuerySearchKey = templist.join('_;');
+                    }
+                }
+
+                this.getData();
+                this.showAdvancedQueryDialog = false;
+            },
+            exportExcel() {
+                window.location.href = this.$baseUrl + "/testDeploy1/exportExcel?searchKey=" + this.filter1 + "&advancedQuery=" + this.advancedQuerySearchKey
+            },
+            searchData() {
+                this.currentPage = 1;
+                this.getData();
+            },
+            deleteRow(row) {
+                this.$alert('删除将无法恢复,确认要删除么?', '警告', { type: 'error' }).then(() => {
+                    return this.$http.post({
+                    url: '/testDeploy1/del',
+                    data: { id: row.id }
+                    })
+                }).then(() => {
+                    this.$message.success('删除成功');
+                    this.getData();
+                }).catch(action => {
+                    if (action === 'cancel') {
+                        this.$message.info('删除取消');
+                    } else {
+                        this.$message.error('删除失败');
+                    }
+                })
+            },
+
+        }
+    }
+</script>
+<style lang="less" scoped>
+
+</style>

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

@@ -229,6 +229,16 @@ const router = new Router({
                     path: '/testDeploys',
                     name: 'TestDeploys',
                     component: () => import('../pages/TestDeploys')
+                },
+                {
+                    path: '/testDeploy1',
+                    name: 'TestDeploy1',
+                    component: () => import('../pages/TestDeploy1')
+                },
+                {
+                    path: '/testDeploy1s',
+                    name: 'TestDeploy1s',
+                    component: () => import('../pages/TestDeploy1s')
                 }
                 /**INSERT_LOCATION**/
             ]

File diff suppressed because it is too large
+ 0 - 0
src/main/webapp/static/js/manifest.c79524b2e6c9b9a13938.js.map


Some files were not shown because too many files changed in this diff