Bläddra i källkod

可选匹配相似表

AE86 3 år sedan
förälder
incheckning
08f6c075bb

+ 6 - 2
dbsyncer-biz/src/main/java/org/dbsyncer/biz/impl/MappingServiceImpl.java

@@ -1,5 +1,6 @@
 package org.dbsyncer.biz.impl;
 
+import org.apache.commons.lang.StringUtils;
 import org.dbsyncer.biz.BizException;
 import org.dbsyncer.biz.MappingService;
 import org.dbsyncer.biz.TableGroupService;
@@ -49,8 +50,11 @@ public class MappingServiceImpl extends BaseServiceImpl implements MappingServic
 
         String id = manager.addMapping(model);
 
-        // 匹配相似表
-        matchSimilarTable(model);
+        // 匹配相似表 on
+        String autoMatchTable = params.get("autoMatchTable");
+        if(StringUtils.isNotBlank(autoMatchTable)){
+            matchSimilarTable(model);
+        }
 
         return id;
     }

+ 8 - 0
dbsyncer-web/src/main/resources/public/mapping/add.html

@@ -57,6 +57,14 @@
                                 </div>
                             </div>
 
+                            <!-- 匹配相似表 -->
+                            <div class="form-group">
+                                <div class="col-sm-2 text-right"><label>是否匹配相似表</label></div>
+                                <div class="col-sm-10">
+                                    <input id="autoMatchTableSelect" name="autoMatchTable" class="form-control" type="checkbox" />
+                                </div>
+                            </div>
+
                         </div>
                     </div>
                 </div>

+ 2 - 3
dbsyncer-web/src/main/resources/public/upload/upload.html

@@ -111,16 +111,15 @@ public class MyPlugin implements ConvertService{
                                 <th>类名</th>
                                 <th>版本</th>
                                 <th>文件</th>
-                                <th>操作</th>
                             </tr>
                             </thead>
                             <tbody id="pluginList">
                             <tr th:id="${p?.name}" th:each="p,state : ${plugins}">
-                                <td th:text="${p?.name}"/>
+                                <td th:if="${p?.unmodifiable}"><i class="fa fa-plug" aria-hidden="true" th:title="内置插件"></i> [[${p?.name}]]</td>
+                                <td th:if="${not p?.unmodifiable}"><i class="fa fa-star" aria-hidden="true" th:title="普通插件"></i> [[${p?.name}]]</td>
                                 <td th:text="${p?.className}"/>
                                 <td th:text="${p?.version}"/>
                                 <td th:text="${p?.fileName}"/>
-                                <td><a th:if="${not p?.unmodifiable}" th:id="${p?.name}" class='fa fa-remove fa-2x pluginDelete dbsyncer_pointer' title='暂不支持' aria-disabled="true"></a></td>
                             </tr>
                             </tbody>
                         </table>

+ 12 - 0
dbsyncer-web/src/main/resources/static/js/mapping/add.js

@@ -9,6 +9,15 @@ function submit(data) {
     });
 }
 
+// 绑定匹配相似表复选框事件
+function bindAutoMatchTableCheckBoxClick(){
+    $('#autoMatchTableSelect').iCheck({
+        checkboxClass: 'icheckbox_square-blue',
+        labelHover: false,
+        cursor: true
+    });
+}
+
 $(function () {
     // 兼容IE PlaceHolder
     $('input[type="text"],input[type="password"],textarea').PlaceHolder();
@@ -19,6 +28,9 @@ $(function () {
         theme: "classic"
     });
 
+    // 绑定匹配相似表复选框事件
+    bindAutoMatchTableCheckBoxClick();
+
     //保存
     $("#mappingSubmitBtn").click(function () {
         var $form = $("#mappingAddForm");