Pārlūkot izejas kodu

通用查询添加分类

suochencheng 7 gadi atpakaļ
vecāks
revīzija
a437803b39

+ 14 - 0
src/main/java/com/izouma/awesomeadmin/dao/QueryConfigMapper.xml

@@ -11,6 +11,7 @@
         <result column="modules" property="modules" jdbcType="VARCHAR"/>
         <result column="data_source_code" property="dataSourceCode" jdbcType="VARCHAR"/>
         <result column="config_json" property="configJson" jdbcType="VARCHAR"/>
+        <result column="type_flag" property="typeFlag" jdbcType="VARCHAR"/>
     </resultMap>
     <sql id="Base_Column_List">
         <trim suffixOverrides=",">
@@ -32,6 +33,8 @@
 
             config_json,
 
+            type_flag,
+
         </trim>
     </sql>
     <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
@@ -75,6 +78,9 @@
             <if test="configJson!= null">
                 config_json,
             </if>
+            <if test="typeFlag!= null">
+                type_flag,
+            </if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">
@@ -104,6 +110,9 @@
             <if test="configJson != null">
                 #{configJson,jdbcType=VARCHAR},
             </if>
+            <if test="typeFlag != null">
+                #{typeFlag,jdbcType=VARCHAR},
+            </if>
         </trim>
     </insert>
     <update id="updateByPrimaryKeySelective" parameterType="com.izouma.awesomeadmin.model.QueryConfig">
@@ -136,6 +145,9 @@
             <if test="configJson != null">
                 config_json= #{configJson,jdbcType=VARCHAR},
             </if>
+            <if test="typeFlag != null">
+                type_flag= #{typeFlag,jdbcType=VARCHAR},
+            </if>
         </set>
         where id = #{id,jdbcType=INTEGER}
     </update>
@@ -173,6 +185,7 @@
                     OR table_name LIKE concat('%',#{record.searchKey},'%')
                     OR tableColumns LIKE concat('%',#{record.searchKey},'%')
                     OR dataBaseType LIKE concat('%',#{record.searchKey},'%')
+                    OR type_flag LIKE concat('%',#{record.searchKey},'%')
                 </trim>
             </if>
 
@@ -248,6 +261,7 @@
                     OR table_name LIKE concat('%',#{searchKey},'%')
                     OR tableColumns LIKE concat('%',#{searchKey},'%')
                     OR dataBaseType LIKE concat('%',#{searchKey},'%')
+                    OR type_flag LIKE concat('%',#{searchKey},'%')
                 </trim>
             </if>
             <if test="advancedQuery != null and !&quot;&quot;.equals(advancedQuery)">

+ 10 - 0
src/main/java/com/izouma/awesomeadmin/model/QueryConfig.java

@@ -31,6 +31,8 @@ public class QueryConfig {
 
     private String configJson;
 
+    private String typeFlag;
+
     public Integer getId() {
         return this.id;
     }
@@ -126,5 +128,13 @@ public class QueryConfig {
     public void setConfigJson(String configJson) {
         this.configJson = configJson;
     }
+
+    public String getTypeFlag() {
+        return typeFlag;
+    }
+
+    public void setTypeFlag(String typeFlag) {
+        this.typeFlag = typeFlag;
+    }
 }
 

+ 7 - 0
src/main/vue/src/pages/QueryConfig.vue

@@ -30,6 +30,10 @@
                 <el-input v-model="formData.code"></el-input>
             </el-form-item>
 
+            <el-form-item prop="typeFlag" label="分类" style="width:300px;">
+                <el-input v-model="formData.typeFlag"></el-input>
+            </el-form-item>
+
             <el-form-item prop="modules" label="功能">
                 <el-select placeholder="modules" size="small" multiple v-model="formData.modules" class="filter-item">
                     <el-option label="搜索" value="search">
@@ -236,6 +240,9 @@ export default {
                 dataSourceCode: [
                     { required: true, message: '请填选择数据库', trigger: 'blur' },
                 ],
+                typeFlag: [
+                    { required: true, message: '请填写分类', trigger: 'blur' },
+                ],
             },
 
             tablecolumnsFields: [

+ 13 - 0
src/main/vue/src/pages/QueryConfigs.vue

@@ -31,6 +31,8 @@
             </el-table-column>
             <el-table-column v-if="isColumnShow('tableName')" prop="tableName" label="表名" min-width="100">
             </el-table-column>
+            <el-table-column v-if="isColumnShow('typeFlag')" prop="typeFlag" label="类型" min-width="100">
+            </el-table-column>
             <!--  <el-table-column v-if="isColumnShow('tablecolumns')" prop="tablecolumns" label="字段" min-width="100">
             </el-table-column> -->
             <el-table-column v-if="isColumnShow('databasetype')" prop="databasetype" label="数据库类型" min-width="100">
@@ -131,6 +133,11 @@ export default {
                     value: 'tableName',
                     show: true
                 },
+                {
+                    label: '类型',
+                    value: 'typeFlag',
+                    show: true
+                },
                 // {
                 //     label: '字段',
                 //     value: 'tablecolumns',
@@ -146,6 +153,7 @@ export default {
                     value: 'modules',
                     show: true
                 },
+
             ],
             multipleMode: false,
             showAdvancedQueryDialog: false,
@@ -160,6 +168,10 @@ export default {
                     label: '表名',
                     value: 'table_name'
                 },
+                {
+                    label: '类型',
+                    value: 'typeFlag'
+                },
                 /* {
                     label: '字段',
                     value: 'tableColumns'
@@ -172,6 +184,7 @@ export default {
                     label: '功能',
                     value: 'modules'
                 },
+
             ],
             advancedQuerySearchKey: '',
         }