浏览代码

修改群控管理功能

xuzuoyun 5 年之前
父节点
当前提交
0d46592d54
共有 27 个文件被更改,包括 672 次插入2010 次删除
  1. 1 1
      jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java
  2. 1 5
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumDeviceController.java
  3. 208 206
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumTaskController.java
  4. 17 21
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumTaskItemController.java
  5. 14 16
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumDevice.java
  6. 18 16
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumTask.java
  7. 114 108
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumTaskItem.java
  8. 1 2
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumDeviceMapper.java
  9. 2 3
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumTaskItemMapper.java
  10. 2 3
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumTaskMapper.java
  11. 1 2
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumDeviceService.java
  12. 5 4
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumTaskItemService.java
  13. 3 4
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumTaskService.java
  14. 1 2
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumDeviceServiceImpl.java
  15. 26 3
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumTaskItemServiceImpl.java
  16. 37 3
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumTaskServiceImpl.java
  17. 0 173
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/AppiumDeviceList.vue
  18. 0 243
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/AppiumTaskItemList.vue
  19. 0 173
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/AppiumTaskList.vue
  20. 0 138
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumDeviceModal.vue
  21. 0 145
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumDeviceModal__Style#Drawer.vue
  22. 0 224
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskItemModal.vue
  23. 0 231
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskItemModal__Style#Drawer.vue
  24. 0 138
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskModal.vue
  25. 0 145
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskModal__Style#Drawer.vue
  26. 217 0
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/util/AppiumUtil.java
  27. 4 1
      module-crawler/src/main/java/cn/com/ctop/crawler/modules/test/AppiumTest.java

+ 1 - 1
jeecg-boot-module-system/src/main/java/org/jeecg/config/ShiroConfig.java

@@ -119,7 +119,7 @@ public class ShiroConfig {
 		filterChainDefinitionMap.put("/template/convert/list/url", "anon");
         //文件上传接口
 		filterChainDefinitionMap.put("/upload/**", "anon");
-
+		filterChainDefinitionMap.put("/appium/appiumTask/run", "anon");
 
 		//爬虫接口
 		filterChainDefinitionMap.put("/graphql/video", "anon");

+ 1 - 5
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumDeviceController.java

@@ -8,16 +8,13 @@ import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.util.oConvertUtils;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumDevice;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumDeviceService;
-
 import java.util.Date;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -40,10 +37,9 @@ import io.swagger.annotations.ApiOperation;
 
 /**
  * 手机设备表
- *
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Slf4j
 @Api(tags = "手机设备表")

+ 208 - 206
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumTaskController.java

@@ -8,16 +8,13 @@ import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.util.oConvertUtils;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumTask;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskService;
-
 import java.util.Date;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -39,215 +36,220 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
 /**
- * 手机任务表
- *
+ * 任务表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Slf4j
-@Api(tags = "手机任务表")
+@Api(tags = "任务表")
 @RestController
 @RequestMapping("/appium/appiumTask")
 public class AppiumTaskController {
-    @Autowired
-    private IAppiumTaskService appiumTaskService;
-
-    /**
-     * 分页列表查询
-     *
-     * @param appiumTask
-     * @param pageNo
-     * @param pageSize
-     * @param req
-     * @return
-     */
-    @AutoLog(value = "手机任务表-分页列表查询")
-    @ApiOperation(value = "手机任务表-分页列表查询", notes = "手机任务表-分页列表查询")
-    @GetMapping(value = "/list")
-    public Result<IPage<AppiumTask>> queryPageList(AppiumTask appiumTask,
-                                                   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
-                                                   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
-                                                   HttpServletRequest req) {
-        Result<IPage<AppiumTask>> result = new Result<IPage<AppiumTask>>();
-        QueryWrapper<AppiumTask> queryWrapper = QueryGenerator.initQueryWrapper(appiumTask, req.getParameterMap());
-        Page<AppiumTask> page = new Page<AppiumTask>(pageNo, pageSize);
-        IPage<AppiumTask> pageList = appiumTaskService.page(page, queryWrapper);
-        result.setSuccess(true);
-        result.setResult(pageList);
-        return result;
-    }
-
-    /**
-     * 添加
-     *
-     * @param appiumTask
-     * @return
-     */
-    @AutoLog(value = "手机任务表-添加")
-    @ApiOperation(value = "手机任务表-添加", notes = "手机任务表-添加")
-    @PostMapping(value = "/add")
-    public Result<AppiumTask> add(@RequestBody AppiumTask appiumTask) {
-        Result<AppiumTask> result = new Result<AppiumTask>();
-        try {
-            appiumTaskService.save(appiumTask);
-            result.success("添加成功!");
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            result.error500("操作失败");
-        }
-        return result;
-    }
-
-    /**
-     * 编辑
-     *
-     * @param appiumTask
-     * @return
-     */
-    @AutoLog(value = "手机任务表-编辑")
-    @ApiOperation(value = "手机任务表-编辑", notes = "手机任务表-编辑")
-    @PutMapping(value = "/edit")
-    public Result<AppiumTask> edit(@RequestBody AppiumTask appiumTask) {
-        Result<AppiumTask> result = new Result<AppiumTask>();
-        AppiumTask appiumTaskEntity = appiumTaskService.getById(appiumTask.getId());
-        if (appiumTaskEntity == null) {
-            result.error500("未找到对应实体");
-        } else {
-            boolean ok = appiumTaskService.updateById(appiumTask);
-            if (ok) {
-                result.success("修改成功!");
-            }
-        }
-
-        return result;
-    }
-
-    /**
-     * 通过id删除
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "手机任务表-通过id删除")
-    @ApiOperation(value = "手机任务表-通过id删除", notes = "手机任务表-通过id删除")
-    @DeleteMapping(value = "/delete")
-    public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
-        try {
-            appiumTaskService.removeById(id);
-        } catch (Exception e) {
-            log.error("删除失败", e.getMessage());
-            return Result.error("删除失败!");
-        }
-        return Result.ok("删除成功!");
-    }
-
-    /**
-     * 批量删除
-     *
-     * @param ids
-     * @return
-     */
-    @AutoLog(value = "手机任务表-批量删除")
-    @ApiOperation(value = "手机任务表-批量删除", notes = "手机任务表-批量删除")
-    @DeleteMapping(value = "/deleteBatch")
-    public Result<AppiumTask> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
-        Result<AppiumTask> result = new Result<AppiumTask>();
-        if (ids == null || "".equals(ids.trim())) {
-            result.error500("参数不识别!");
-        } else {
-            this.appiumTaskService.removeByIds(Arrays.asList(ids.split(",")));
-            result.success("删除成功!");
-        }
-        return result;
-    }
-
-    /**
-     * 通过id查询
-     *
-     * @param id
-     * @return
-     */
-    @AutoLog(value = "手机任务表-通过id查询")
-    @ApiOperation(value = "手机任务表-通过id查询", notes = "手机任务表-通过id查询")
-    @GetMapping(value = "/queryById")
-    public Result<AppiumTask> queryById(@RequestParam(name = "id", required = true) String id) {
-        Result<AppiumTask> result = new Result<AppiumTask>();
-        AppiumTask appiumTask = appiumTaskService.getById(id);
-        if (appiumTask == null) {
-            result.error500("未找到对应实体");
-        } else {
-            result.setResult(appiumTask);
-            result.setSuccess(true);
-        }
-        return result;
-    }
-
-    /**
-     * 导出excel
-     *
-     * @param request
-     * @param response
-     */
-    @RequestMapping(value = "/exportXls")
-    public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
-        // Step.1 组装查询条件
-        QueryWrapper<AppiumTask> queryWrapper = null;
-        try {
-            String paramsStr = request.getParameter("paramsStr");
-            if (oConvertUtils.isNotEmpty(paramsStr)) {
-                String deString = URLDecoder.decode(paramsStr, "UTF-8");
-                AppiumTask appiumTask = JSON.parseObject(deString, AppiumTask.class);
-                queryWrapper = QueryGenerator.initQueryWrapper(appiumTask, request.getParameterMap());
-            }
-        } catch (UnsupportedEncodingException e) {
-            e.printStackTrace();
-        }
-
-        //Step.2 AutoPoi 导出Excel
-        ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
-        List<AppiumTask> pageList = appiumTaskService.list(queryWrapper);
-        //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "手机任务表列表");
-        mv.addObject(NormalExcelConstants.CLASS, AppiumTask.class);
-        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("手机任务表列表数据", "导出人:Jeecg", "导出信息"));
-        mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
-        return mv;
-    }
-
-    /**
-     * 通过excel导入数据
-     *
-     * @param request
-     * @param response
-     * @return
-     */
-    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
-    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
-        MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
-        Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
-        for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
-            MultipartFile file = entity.getValue();
-            ImportParams params = new ImportParams();
-            params.setTitleRows(2);
-            params.setHeadRows(1);
-            params.setNeedSave(true);
-            try {
-                List<AppiumTask> listAppiumTasks = ExcelImportUtil.importExcel(file.getInputStream(), AppiumTask.class, params);
-                appiumTaskService.saveBatch(listAppiumTasks);
-                return Result.ok("文件导入成功!数据行数:" + listAppiumTasks.size());
-            } catch (Exception e) {
-                log.error(e.getMessage(), e);
-                return Result.error("文件导入失败:" + e.getMessage());
-            } finally {
-                try {
-                    file.getInputStream().close();
-                } catch (IOException e) {
-                    e.printStackTrace();
-                }
-            }
-        }
-        return Result.ok("文件导入失败!");
-    }
+	@Autowired
+	private IAppiumTaskService appiumTaskService;
+
+	/**
+	 * 分页列表查询
+	 *
+	 * @param appiumTask
+	 * @param pageNo
+	 * @param pageSize
+	 * @param req
+	 * @return
+	 */
+	@AutoLog(value = "任务表-分页列表查询")
+	@ApiOperation(value = "任务表-分页列表查询", notes = "任务表-分页列表查询")
+	@GetMapping(value = "/list")
+	public Result<IPage<AppiumTask>> queryPageList(AppiumTask appiumTask,
+												   @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
+												   @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
+												   HttpServletRequest req) {
+		Result<IPage<AppiumTask>> result = new Result<IPage<AppiumTask>>();
+		QueryWrapper<AppiumTask> queryWrapper = QueryGenerator.initQueryWrapper(appiumTask, req.getParameterMap());
+		Page<AppiumTask> page = new Page<AppiumTask>(pageNo, pageSize);
+		IPage<AppiumTask> pageList = appiumTaskService.page(page, queryWrapper);
+		result.setSuccess(true);
+		result.setResult(pageList);
+		return result;
+	}
+
+	/**
+	 * 添加
+	 *
+	 * @param appiumTask
+	 * @return
+	 */
+	@AutoLog(value = "任务表-添加")
+	@ApiOperation(value = "任务表-添加", notes = "任务表-添加")
+	@PostMapping(value = "/add")
+	public Result<AppiumTask> add(@RequestBody AppiumTask appiumTask) {
+		Result<AppiumTask> result = new Result<AppiumTask>();
+		try {
+			appiumTaskService.save(appiumTask);
+			result.success("添加成功!");
+		} catch (Exception e) {
+			log.error(e.getMessage(), e);
+			result.error500("操作失败");
+		}
+		return result;
+	}
+
+	/**
+	 * 编辑
+	 *
+	 * @param appiumTask
+	 * @return
+	 */
+	@AutoLog(value = "任务表-编辑")
+	@ApiOperation(value = "任务表-编辑", notes = "任务表-编辑")
+	@PutMapping(value = "/edit")
+	public Result<AppiumTask> edit(@RequestBody AppiumTask appiumTask) {
+		Result<AppiumTask> result = new Result<AppiumTask>();
+		AppiumTask appiumTaskEntity = appiumTaskService.getById(appiumTask.getId());
+		if (appiumTaskEntity == null) {
+			result.error500("未找到对应实体");
+		} else {
+			boolean ok = appiumTaskService.updateById(appiumTask);
+			if (ok) {
+				result.success("修改成功!");
+			}
+		}
+
+		return result;
+	}
+
+	/**
+	 * 通过id删除
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "任务表-通过id删除")
+	@ApiOperation(value = "任务表-通过id删除", notes = "任务表-通过id删除")
+	@DeleteMapping(value = "/delete")
+	public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
+		try {
+			appiumTaskService.removeById(id);
+		} catch (Exception e) {
+			log.error("删除失败", e.getMessage());
+			return Result.error("删除失败!");
+		}
+		return Result.ok("删除成功!");
+	}
+
+	/**
+	 * 批量删除
+	 *
+	 * @param ids
+	 * @return
+	 */
+	@AutoLog(value = "任务表-批量删除")
+	@ApiOperation(value = "任务表-批量删除", notes = "任务表-批量删除")
+	@DeleteMapping(value = "/deleteBatch")
+	public Result<AppiumTask> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
+		Result<AppiumTask> result = new Result<AppiumTask>();
+		if (ids == null || "".equals(ids.trim())) {
+			result.error500("参数不识别!");
+		} else {
+			this.appiumTaskService.removeByIds(Arrays.asList(ids.split(",")));
+			result.success("删除成功!");
+		}
+		return result;
+	}
+
+	/**
+	 * 通过id查询
+	 *
+	 * @param id
+	 * @return
+	 */
+	@AutoLog(value = "任务表-通过id查询")
+	@ApiOperation(value = "任务表-通过id查询", notes = "任务表-通过id查询")
+	@GetMapping(value = "/queryById")
+	public Result<AppiumTask> queryById(@RequestParam(name = "id", required = true) String id) {
+		Result<AppiumTask> result = new Result<AppiumTask>();
+		AppiumTask appiumTask = appiumTaskService.getById(id);
+		if (appiumTask == null) {
+			result.error500("未找到对应实体");
+		} else {
+			result.setResult(appiumTask);
+			result.setSuccess(true);
+		}
+		return result;
+	}
+
+	/**
+	 * 导出excel
+	 *
+	 * @param request
+	 * @param response
+	 */
+	@RequestMapping(value = "/exportXls")
+	public ModelAndView exportXls(HttpServletRequest request, HttpServletResponse response) {
+		// Step.1 组装查询条件
+		QueryWrapper<AppiumTask> queryWrapper = null;
+		try {
+			String paramsStr = request.getParameter("paramsStr");
+			if (oConvertUtils.isNotEmpty(paramsStr)) {
+				String deString = URLDecoder.decode(paramsStr, "UTF-8");
+				AppiumTask appiumTask = JSON.parseObject(deString, AppiumTask.class);
+				queryWrapper = QueryGenerator.initQueryWrapper(appiumTask, request.getParameterMap());
+			}
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+
+		//Step.2 AutoPoi 导出Excel
+		ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
+		List<AppiumTask> pageList = appiumTaskService.list(queryWrapper);
+		//导出文件名称
+		mv.addObject(NormalExcelConstants.FILE_NAME, "任务表列表");
+		mv.addObject(NormalExcelConstants.CLASS, AppiumTask.class);
+		mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("任务表列表数据", "导出人:Jeecg", "导出信息"));
+		mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
+		return mv;
+	}
+
+	@RequestMapping(value = "/run", method = RequestMethod.POST)
+	public Result<?> run(HttpServletRequest request, HttpServletResponse response, Integer taskId, Integer deviceId) {
+		appiumTaskService.runTask(taskId, deviceId);
+		return Result.ok("任务执行完成");
+	}
+
+	/**
+	 * 通过excel导入数据
+	 *
+	 * @param request
+	 * @param response
+	 * @return
+	 */
+	@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
+	public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
+		MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+		Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
+		for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
+			MultipartFile file = entity.getValue();
+			ImportParams params = new ImportParams();
+			params.setTitleRows(2);
+			params.setHeadRows(1);
+			params.setNeedSave(true);
+			try {
+				List<AppiumTask> listAppiumTasks = ExcelImportUtil.importExcel(file.getInputStream(), AppiumTask.class, params);
+				appiumTaskService.saveBatch(listAppiumTasks);
+				return Result.ok("文件导入成功!数据行数:" + listAppiumTasks.size());
+			} catch (Exception e) {
+				log.error(e.getMessage(), e);
+				return Result.error("文件导入失败:" + e.getMessage());
+			} finally {
+				try {
+					file.getInputStream().close();
+				} catch (IOException e) {
+					e.printStackTrace();
+				}
+			}
+		}
+		return Result.ok("文件导入失败!");
+	}
 
 }

+ 17 - 21
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/controller/AppiumTaskItemController.java

@@ -8,16 +8,13 @@ import java.io.UnsupportedEncodingException;
 import java.net.URLDecoder;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
-
 import org.jeecg.common.api.vo.Result;
 import org.jeecg.common.system.query.QueryGenerator;
 import org.jeecg.common.aspect.annotation.AutoLog;
 import org.jeecg.common.util.oConvertUtils;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskItem;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskItemService;
-
 import java.util.Date;
-
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -39,14 +36,13 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 
 /**
- * 手机任务步骤表
- *
+ * 任务内容表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Slf4j
-@Api(tags = "手机任务步骤表")
+@Api(tags = "任务内容表")
 @RestController
 @RequestMapping("/appium/appiumTaskItem")
 public class AppiumTaskItemController {
@@ -62,8 +58,8 @@ public class AppiumTaskItemController {
      * @param req
      * @return
      */
-    @AutoLog(value = "手机任务步骤表-分页列表查询")
-    @ApiOperation(value = "手机任务步骤表-分页列表查询", notes = "手机任务步骤表-分页列表查询")
+    @AutoLog(value = "任务内容表-分页列表查询")
+    @ApiOperation(value = "任务内容表-分页列表查询", notes = "任务内容表-分页列表查询")
     @GetMapping(value = "/list")
     public Result<IPage<AppiumTaskItem>> queryPageList(AppiumTaskItem appiumTaskItem,
                                                        @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@@ -84,8 +80,8 @@ public class AppiumTaskItemController {
      * @param appiumTaskItem
      * @return
      */
-    @AutoLog(value = "手机任务步骤表-添加")
-    @ApiOperation(value = "手机任务步骤表-添加", notes = "手机任务步骤表-添加")
+    @AutoLog(value = "任务内容表-添加")
+    @ApiOperation(value = "任务内容表-添加", notes = "任务内容表-添加")
     @PostMapping(value = "/add")
     public Result<AppiumTaskItem> add(@RequestBody AppiumTaskItem appiumTaskItem) {
         Result<AppiumTaskItem> result = new Result<AppiumTaskItem>();
@@ -105,8 +101,8 @@ public class AppiumTaskItemController {
      * @param appiumTaskItem
      * @return
      */
-    @AutoLog(value = "手机任务步骤表-编辑")
-    @ApiOperation(value = "手机任务步骤表-编辑", notes = "手机任务步骤表-编辑")
+    @AutoLog(value = "任务内容表-编辑")
+    @ApiOperation(value = "任务内容表-编辑", notes = "任务内容表-编辑")
     @PutMapping(value = "/edit")
     public Result<AppiumTaskItem> edit(@RequestBody AppiumTaskItem appiumTaskItem) {
         Result<AppiumTaskItem> result = new Result<AppiumTaskItem>();
@@ -129,8 +125,8 @@ public class AppiumTaskItemController {
      * @param id
      * @return
      */
-    @AutoLog(value = "手机任务步骤表-通过id删除")
-    @ApiOperation(value = "手机任务步骤表-通过id删除", notes = "手机任务步骤表-通过id删除")
+    @AutoLog(value = "任务内容表-通过id删除")
+    @ApiOperation(value = "任务内容表-通过id删除", notes = "任务内容表-通过id删除")
     @DeleteMapping(value = "/delete")
     public Result<?> delete(@RequestParam(name = "id", required = true) String id) {
         try {
@@ -148,8 +144,8 @@ public class AppiumTaskItemController {
      * @param ids
      * @return
      */
-    @AutoLog(value = "手机任务步骤表-批量删除")
-    @ApiOperation(value = "手机任务步骤表-批量删除", notes = "手机任务步骤表-批量删除")
+    @AutoLog(value = "任务内容表-批量删除")
+    @ApiOperation(value = "任务内容表-批量删除", notes = "任务内容表-批量删除")
     @DeleteMapping(value = "/deleteBatch")
     public Result<AppiumTaskItem> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
         Result<AppiumTaskItem> result = new Result<AppiumTaskItem>();
@@ -168,8 +164,8 @@ public class AppiumTaskItemController {
      * @param id
      * @return
      */
-    @AutoLog(value = "手机任务步骤表-通过id查询")
-    @ApiOperation(value = "手机任务步骤表-通过id查询", notes = "手机任务步骤表-通过id查询")
+    @AutoLog(value = "任务内容表-通过id查询")
+    @ApiOperation(value = "任务内容表-通过id查询", notes = "任务内容表-通过id查询")
     @GetMapping(value = "/queryById")
     public Result<AppiumTaskItem> queryById(@RequestParam(name = "id", required = true) String id) {
         Result<AppiumTaskItem> result = new Result<AppiumTaskItem>();
@@ -208,9 +204,9 @@ public class AppiumTaskItemController {
         ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
         List<AppiumTaskItem> pageList = appiumTaskItemService.list(queryWrapper);
         //导出文件名称
-        mv.addObject(NormalExcelConstants.FILE_NAME, "手机任务步骤表列表");
+        mv.addObject(NormalExcelConstants.FILE_NAME, "任务内容表列表");
         mv.addObject(NormalExcelConstants.CLASS, AppiumTaskItem.class);
-        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("手机任务步骤表列表数据", "导出人:Jeecg", "导出信息"));
+        mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("任务内容表列表数据", "导出人:Jeecg", "导出信息"));
         mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
         return mv;
     }

+ 14 - 16
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumDevice.java

@@ -2,7 +2,6 @@ package cn.com.ctop.crawler.modules.appium.entity;
 
 import java.io.Serializable;
 import java.util.Date;
-
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
@@ -18,10 +17,9 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 
 /**
  * 手机设备表
- *
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Data
 @TableName("ctop_appium_device")
@@ -31,37 +29,37 @@ import org.jeecgframework.poi.excel.annotation.Excel;
 public class AppiumDevice {
 
     /**
-     * id
+     * 主键
      */
     @TableId(type = IdType.INPUT)
-    @ApiModelProperty(value = "id")
+    @ApiModelProperty(value = "主键")
     private Integer id;
     /**
-     * ip
+     * IP
      */
-    @Excel(name = "ip", width = 15)
-    @ApiModelProperty(value = "ip")
+    @Excel(name = "IP", width = 15)
+    @ApiModelProperty(value = "IP")
     private String ip;
     /**
-     * port
+     * 端口号
      */
-    @Excel(name = "port", width = 15)
-    @ApiModelProperty(value = "port")
+    @Excel(name = "端口号", width = 15)
+    @ApiModelProperty(value = "端口号")
     private String port;
     /**
-     * status
+     * 状态
      */
-    @Excel(name = "status", width = 15)
-    @ApiModelProperty(value = "status")
+    @Excel(name = "状态", width = 15)
+    @ApiModelProperty(value = "状态")
     private Integer status;
     /**
      * createTime
      */
     @ApiModelProperty(value = "createTime")
-    private Date createTime;
+	private Date createTime;
     /**
      * updateTime
      */
     @ApiModelProperty(value = "updateTime")
-    private Date updateTime;
+	private Date updateTime;
 }

+ 18 - 16
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumTask.java

@@ -2,6 +2,7 @@ package cn.com.ctop.crawler.modules.appium.entity;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -17,51 +18,52 @@ import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
 /**
- * 手机任务表
- *
+ * 任务表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Data
 @TableName("ctop_appium_task")
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
-@ApiModel(value = "ctop_appium_task对象", description = "手机任务表")
+@ApiModel(value = "ctop_appium_task对象", description = "任务表")
 public class AppiumTask {
 
     /**
-     * id
+     * 主键
      */
     @TableId(type = IdType.INPUT)
-    @ApiModelProperty(value = "id")
+    @ApiModelProperty(value = "主键")
     private Integer id;
     /**
-     * taskName
+     * 任务名称
      */
-    @Excel(name = "taskName", width = 15)
-    @ApiModelProperty(value = "taskName")
+    @Excel(name = "任务名称", width = 15)
+    @ApiModelProperty(value = "任务名称")
     private String taskName;
     /**
-     * appPackage
+     * APP包名
      */
-    @Excel(name = "appPackage", width = 15)
-    @ApiModelProperty(value = "appPackage")
+    @Excel(name = "APP包名", width = 15)
+    @ApiModelProperty(value = "APP包名")
     private String appPackage;
     /**
-     * appActivity
+     * APP界面名
      */
-    @Excel(name = "appActivity", width = 15)
-    @ApiModelProperty(value = "appActivity")
+    @Excel(name = "APP界面名", width = 15)
+    @ApiModelProperty(value = "APP界面名")
     private String appActivity;
     /**
      * createTime
      */
     @ApiModelProperty(value = "createTime")
-    private Date createTime;
+	private Date createTime;
     /**
      * updateTime
      */
     @ApiModelProperty(value = "updateTime")
     private Date updateTime;
+    @TableField(exist = false)
+    private List<AppiumTask> subList;
 }

+ 114 - 108
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/entity/AppiumTaskItem.java

@@ -2,6 +2,7 @@ package cn.com.ctop.crawler.modules.appium.entity;
 
 import java.io.Serializable;
 import java.util.Date;
+import java.util.List;
 
 import com.baomidou.mybatisplus.annotation.IdType;
 import com.baomidou.mybatisplus.annotation.TableId;
@@ -17,123 +18,128 @@ import org.springframework.format.annotation.DateTimeFormat;
 import org.jeecgframework.poi.excel.annotation.Excel;
 
 /**
- * 手机任务步骤表
- *
+ * 任务内容表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Data
 @TableName("ctop_appium_task_item")
 @EqualsAndHashCode(callSuper = false)
 @Accessors(chain = true)
-@ApiModel(value = "ctop_appium_task_item对象", description = "手机任务步骤表")
+@ApiModel(value = "ctop_appium_task_item对象", description = "任务内容表")
 public class AppiumTaskItem {
 
-    /**
-     * id
-     */
-    @TableId(type = IdType.INPUT)
-    @ApiModelProperty(value = "id")
-    private Integer id;
-    /**
-     * taskId
-     */
-    @Excel(name = "taskId", width = 15)
-    @ApiModelProperty(value = "taskId")
-    private Integer taskId;
-    /**
-     * parentId
-     */
-    @Excel(name = "parentId", width = 15)
-    @ApiModelProperty(value = "parentId")
-    private Integer parentId;
-    /**
-     * seq
-     */
-    @Excel(name = "seq", width = 15)
-    @ApiModelProperty(value = "seq")
-    private Integer seq;
-    /**
-     * findType
-     */
-    @Excel(name = "findType", width = 15)
-    @ApiModelProperty(value = "findType")
-    private String findType;
-    /**
-     * findKey
-     */
-    @Excel(name = "findKey", width = 15)
-    @ApiModelProperty(value = "findKey")
-    private String findKey;
-    /**
-     * clickType
-     */
-    @Excel(name = "clickType", width = 15)
-    @ApiModelProperty(value = "clickType")
-    private String clickType;
-    /**
-     * offsiteX
-     */
-    @Excel(name = "offsiteX", width = 15)
-    @ApiModelProperty(value = "offsiteX")
-    private Integer offsiteX;
-    /**
-     * offsiteY
-     */
-    @Excel(name = "offsiteY", width = 15)
-    @ApiModelProperty(value = "offsiteY")
-    private Integer offsiteY;
-    /**
-     * loopRate
-     */
-    @Excel(name = "loopRate", width = 15)
-    @ApiModelProperty(value = "loopRate")
-    private Integer loopRate;
-    /**
-     * isMust
-     */
-    @Excel(name = "isMust", width = 15)
-    @ApiModelProperty(value = "isMust")
-    private Boolean isMust;
-    /**
-     * textEqualType
-     */
-    @Excel(name = "textEqualType", width = 15)
-    @ApiModelProperty(value = "textEqualType")
-    private String textEqualType;
-    /**
-     * textEqualKey
-     */
-    @Excel(name = "textEqualKey", width = 15)
-    @ApiModelProperty(value = "textEqualKey")
-    private String textEqualKey;
-    /**
-     * swapType
-     */
-    @Excel(name = "swapType", width = 15)
-    @ApiModelProperty(value = "swapType")
-    private String swapType;
-    /**
-     * waitTime
-     */
-    @Excel(name = "waitTime", width = 15)
-    @ApiModelProperty(value = "waitTime")
-    private Integer waitTime;
-    /**
-     * isClose
-     */
-    @Excel(name = "isClose", width = 15)
-    @ApiModelProperty(value = "isClose")
-    private Boolean isClose;
-    /**
-     * createTime
-     */
+	/**
+	 * 主键
+	 */
+	@TableId(type = IdType.INPUT)
+	@ApiModelProperty(value = "主键")
+	private Integer id;
+	/**
+	 * 任务ID
+	 */
+	@Excel(name = "任务ID", width = 15)
+	@ApiModelProperty(value = "任务ID")
+	private Integer taskId;
+	/**
+	 * 父ID
+	 */
+	@Excel(name = "父ID", width = 15)
+	@ApiModelProperty(value = "父ID")
+	private Integer parentId;
+	/**
+	 * 顺序
+	 */
+	@Excel(name = "顺序", width = 15)
+	@ApiModelProperty(value = "顺序")
+	private Integer seq;
+	/**
+	 * 查找类型
+	 */
+	@Excel(name = "查找类型", width = 15)
+	@ApiModelProperty(value = "查找类型")
+	private String findType;
+	/**
+	 * 查找关键字
+	 */
+	@Excel(name = "查找关键字", width = 15)
+	@ApiModelProperty(value = "查找关键字")
+	private String findKey;
+	/**
+	 * 点击类型
+	 */
+	@Excel(name = "点击类型", width = 15)
+	@ApiModelProperty(value = "点击类型")
+	private String clickType;
+	/**
+	 * 偏移量X
+	 */
+	@Excel(name = "偏移量X", width = 15)
+	@ApiModelProperty(value = "偏移量X")
+	private Integer offsiteX;
+	/**
+	 * 偏移量Y
+	 */
+	@Excel(name = "偏移量Y", width = 15)
+	@ApiModelProperty(value = "偏移量Y")
+	private Integer offsiteY;
+	/**
+	 * 循环间隔
+	 */
+	@Excel(name = "循环间隔", width = 15)
+	@ApiModelProperty(value = "循环间隔")
+	private Integer loopRate;
+	/**
+	 * 循环类型
+	 */
+	@Excel(name = "循环类型", width = 15)
+	@ApiModelProperty(value = "循环类型")
+	private String loopType;
+	/**
+	 * 是否必经执行
+	 */
+	@Excel(name = "是否必经执行", width = 15)
+	@ApiModelProperty(value = "是否必经执行")
+	private Integer isMust;
+	/**
+	 * 文本查找类型
+	 */
+	@Excel(name = "文本查找类型", width = 15)
+	@ApiModelProperty(value = "文本查找类型")
+	private String textEqualType;
+	/**
+	 * 文本查找关键字
+	 */
+	@Excel(name = "文本查找关键字", width = 15)
+	@ApiModelProperty(value = "文本查找关键字")
+	private String textEqualKey;
+	/**
+	 * 滑动类型
+	 */
+	@Excel(name = "滑动类型", width = 15)
+	@ApiModelProperty(value = "滑动类型")
+	private String swapType;
+	/**
+	 * 延迟时长
+	 */
+	@Excel(name = "延迟时长", width = 15)
+	@ApiModelProperty(value = "延迟时长")
+	private Integer waitTime;
+	/**
+	 * 是否执行完关闭
+	 */
+	@Excel(name = "是否执行完关闭", width = 15)
+	@ApiModelProperty(value = "是否执行完关闭")
+	private Integer isClose;
+	/**
+	 * createTime
+	 */
     @ApiModelProperty(value = "createTime")
-    private Date createTime;
-    /**
-     * updateTime
-     */
+	private Date createTime;
+	/**updateTime*/
     @ApiModelProperty(value = "updateTime")
-    private Date updateTime;
+	private Date updateTime;
+    @TableField(exist = false)
+    private List<AppiumTaskItem> subList;
 }

+ 1 - 2
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumDeviceMapper.java

@@ -8,9 +8,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
  * 手机设备表
- *
  * @author: jeecg-boot
- * @date: 2019-10-30
+ * @date: 2019-10-31
  * @cersion: V1.0
  */
 public interface AppiumDeviceMapper extends BaseMapper<AppiumDevice> {

+ 2 - 3
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumTaskItemMapper.java

@@ -7,10 +7,9 @@ import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskItem;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
- * 手机任务步骤表
- *
+ * 任务内容表
  * @author: jeecg-boot
- * @date: 2019-10-30
+ * @date: 2019-10-31
  * @cersion: V1.0
  */
 public interface AppiumTaskItemMapper extends BaseMapper<AppiumTaskItem> {

+ 2 - 3
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/mapper/AppiumTaskMapper.java

@@ -7,10 +7,9 @@ import cn.com.ctop.crawler.modules.appium.entity.AppiumTask;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 
 /**
- * 手机任务表
- *
+ * 任务表
  * @author: jeecg-boot
- * @date: 2019-10-30
+ * @date: 2019-10-31
  * @cersion: V1.0
  */
 public interface AppiumTaskMapper extends BaseMapper<AppiumTask> {

+ 1 - 2
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumDeviceService.java

@@ -5,10 +5,9 @@ import com.baomidou.mybatisplus.extension.service.IService;
 
 /**
  * 手机设备表
- *
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 public interface IAppiumDeviceService extends IService<AppiumDevice> {
 

+ 5 - 4
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumTaskItemService.java

@@ -3,13 +3,14 @@ package cn.com.ctop.crawler.modules.appium.service;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskItem;
 import com.baomidou.mybatisplus.extension.service.IService;
 
+import java.util.List;
+
 /**
- * 手机任务步骤表
- *
+ * 任务内容表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 public interface IAppiumTaskItemService extends IService<AppiumTaskItem> {
-
+    public List<AppiumTaskItem> initTaskItemList(Integer taskId, Integer parentId);
 }

+ 3 - 4
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/IAppiumTaskService.java

@@ -4,12 +4,11 @@ import cn.com.ctop.crawler.modules.appium.entity.AppiumTask;
 import com.baomidou.mybatisplus.extension.service.IService;
 
 /**
- * 手机任务表
- *
+ * 任务表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 public interface IAppiumTaskService extends IService<AppiumTask> {
-
+    public void runTask(Integer taskId, Integer deviceId);
 }

+ 1 - 2
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumDeviceServiceImpl.java

@@ -9,10 +9,9 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
 /**
  * 手机设备表
- *
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Service
 public class AppiumDeviceServiceImpl extends ServiceImpl<AppiumDeviceMapper, AppiumDevice> implements IAppiumDeviceService {

+ 26 - 3
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumTaskItemServiceImpl.java

@@ -3,18 +3,41 @@ package cn.com.ctop.crawler.modules.appium.service.impl;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskItem;
 import cn.com.ctop.crawler.modules.appium.mapper.AppiumTaskItemMapper;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskItemService;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import java.util.ArrayList;
+import java.util.List;
+
 /**
- * 手机任务步骤表
- *
+ * 任务内容表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Service
 public class AppiumTaskItemServiceImpl extends ServiceImpl<AppiumTaskItemMapper, AppiumTaskItem> implements IAppiumTaskItemService {
+    public List<AppiumTaskItem> initTaskItemList(Integer taskId, Integer parentId) {
+        List<AppiumTaskItem> list = new ArrayList<>();
+        QueryWrapper<AppiumTaskItem> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq("task_id", taskId);
+        if (parentId == null) {
+            queryWrapper.isNull("parent_id");
+        } else {
+            queryWrapper.eq("parent_id", parentId);
+        }
 
+        queryWrapper.orderByAsc("seq");
+        list = this.list(queryWrapper);
+        if (list != null && list.size() > 0) {
+            for (int i = 0; i < list.size(); i++) {
+                AppiumTaskItem taskItem = list.get(i);
+                taskItem.setSubList(initTaskItemList(taskItem.getTaskId(), taskItem.getId()));
+                list.set(i, taskItem);
+            }
+        }
+        return list;
+    }
 }

+ 37 - 3
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/service/impl/AppiumTaskServiceImpl.java

@@ -1,20 +1,54 @@
 package cn.com.ctop.crawler.modules.appium.service.impl;
 
+import cn.com.ctop.crawler.modules.appium.entity.AppiumDevice;
 import cn.com.ctop.crawler.modules.appium.entity.AppiumTask;
+import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskItem;
+import cn.com.ctop.crawler.modules.appium.mapper.AppiumTaskItemMapper;
 import cn.com.ctop.crawler.modules.appium.mapper.AppiumTaskMapper;
+import cn.com.ctop.crawler.modules.appium.service.IAppiumDeviceService;
+import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskItemService;
 import cn.com.ctop.crawler.modules.appium.service.IAppiumTaskService;
+import cn.com.ctop.crawler.modules.core.util.AppiumUtil;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import io.appium.java_client.android.AndroidDriver;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 
+import java.util.ArrayList;
+import java.util.Calendar;
+import java.util.List;
+
 /**
- * 手机任务表
- *
+ * 任务表
  * @author jeecg-boot
+ * @date 2019-10-31
  * @version V1.0
- * @date 2019-10-30
  */
 @Service
 public class AppiumTaskServiceImpl extends ServiceImpl<AppiumTaskMapper, AppiumTask> implements IAppiumTaskService {
+    @Autowired
+    private IAppiumTaskItemService iAppiumTaskItemService;
+    @Autowired
+    private IAppiumDeviceService iAppiumDeviceService;
+
+    public void runTask(Integer taskId, Integer deviceId) {
+        AppiumTask task = this.getById(taskId);
+        AppiumDevice appiumDevice = iAppiumDeviceService.getById(deviceId);
+        List<AppiumTaskItem> taskItemList = iAppiumTaskItemService.initTaskItemList(taskId, null);
+        AppiumUtil appiumUtil = new AppiumUtil();
+        try {
+            AndroidDriver androidDriver = appiumUtil.initAndroidDriver("http://127.0.0.1:4723/wd/hub", appiumDevice.getIp() + ":" + appiumDevice.getPort(), task.getAppPackage(), task.getAppActivity());
+            if (taskItemList != null && taskItemList.size() > 0) {
+                for (AppiumTaskItem appiumTaskItem : taskItemList) {
+                    appiumUtil.runTask(androidDriver, appiumTaskItem, null);
+                }
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
 
 }

+ 0 - 173
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/AppiumDeviceList.vue

@@ -1,173 +0,0 @@
-<template>
-    <a-card :bordered="false">
-
-        <!-- 查询区域 -->
-        <div class="table-page-search-wrapper">
-            <a-form layout="inline">
-                <a-row :gutter="24">
-
-                    <a-col :md="6" :sm="8">
-                        <a-form-item label="ip">
-                            <a-input placeholder="请输入ip" v-model="queryParam.ip"></a-input>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :md="6" :sm="8">
-                        <a-form-item label="port">
-                            <a-input placeholder="请输入port" v-model="queryParam.port"></a-input>
-                        </a-form-item>
-                    </a-col>
-                    <template v-if="toggleSearchStatus">
-                        <a-col :md="6" :sm="8">
-                            <a-form-item label="status">
-                                <a-input placeholder="请输入status" v-model="queryParam.status"></a-input>
-                            </a-form-item>
-                        </a-col>
-                    </template>
-                    <a-col :md="6" :sm="8">
-            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-              <a @click="handleToggleSearch" style="margin-left: 8px">
-                {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
-              </a>
-            </span>
-                    </a-col>
-
-                </a-row>
-            </a-form>
-        </div>
-
-        <!-- 操作按钮区域 -->
-        <div class="table-operator">
-            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-            <a-button type="primary" icon="download" @click="handleExportXls('手机设备表')">导出</a-button>
-            <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
-                      :action="importExcelUrl" @change="handleImportExcel">
-                <a-button type="primary" icon="import">导入</a-button>
-            </a-upload>
-            <a-dropdown v-if="selectedRowKeys.length > 0">
-                <a-menu slot="overlay">
-                    <a-menu-item key="1" @click="batchDel">
-                        <a-icon type="delete"/>
-                        删除
-                    </a-menu-item>
-                </a-menu>
-                <a-button style="margin-left: 8px"> 批量操作
-                    <a-icon type="down"/>
-                </a-button>
-            </a-dropdown>
-        </div>
-
-        <!-- table区域-begin -->
-        <div>
-            <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-                <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
-                selectedRowKeys.length }}</a>项
-                <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-            </div>
-
-            <a-table
-                    ref="table"
-                    size="middle"
-                    bordered
-                    rowKey="id"
-                    :columns="columns"
-                    :dataSource="dataSource"
-                    :pagination="ipagination"
-                    :loading="loading"
-                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-                    @change="handleTableChange">
-
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
-
-          <a-divider type="vertical"/>
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span>
-
-            </a-table>
-        </div>
-        <!-- table区域-end -->
-
-        <!-- 表单区域 -->
-        <appiumDevice-modal ref="modalForm" @ok="modalFormOk"></appiumDevice-modal>
-    </a-card>
-</template>
-
-<script>
-    import AppiumDeviceModal from './modules/AppiumDeviceModal'
-    import {JeecgListMixin} from '@/mixins/JeecgListMixin'
-
-    export default {
-        name: "AppiumDeviceList",
-        mixins: [JeecgListMixin],
-        components: {
-            AppiumDeviceModal
-        },
-        data() {
-            return {
-                description: '手机设备表管理页面',
-                // 表头
-                columns: [
-                    {
-                        title: '#',
-                        dataIndex: '',
-                        key: 'rowIndex',
-                        width: 60,
-                        align: "center",
-                        customRender: function (t, r, index) {
-                            return parseInt(index) + 1;
-                        }
-                    },
-                    {
-                        title: 'ip',
-                        align: "center",
-                        dataIndex: 'ip'
-                    },
-                    {
-                        title: 'port',
-                        align: "center",
-                        dataIndex: 'port'
-                    },
-                    {
-                        title: 'status',
-                        align: "center",
-                        dataIndex: 'status'
-                    },
-                    {
-                        title: '操作',
-                        dataIndex: 'action',
-                        align: "center",
-                        scopedSlots: {customRender: 'action'},
-                    }
-                ],
-                url: {
-                    list: "/appium/appiumDevice/list",
-                    delete: "/appium/appiumDevice/delete",
-                    deleteBatch: "/appium/appiumDevice/deleteBatch",
-                    exportXlsUrl: "appium/appiumDevice/exportXls",
-                    importExcelUrl: "appium/appiumDevice/importExcel",
-                },
-            }
-        },
-        computed: {
-            importExcelUrl: function () {
-                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-            }
-        },
-        methods: {}
-    }
-</script>
-<style scoped>
-    @import '~@assets/less/common.less'
-</style>

+ 0 - 243
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/AppiumTaskItemList.vue

@@ -1,243 +0,0 @@
-<template>
-    <a-card :bordered="false">
-
-        <!-- 查询区域 -->
-        <div class="table-page-search-wrapper">
-            <a-form layout="inline">
-                <a-row :gutter="24">
-
-                    <a-col :md="6" :sm="8">
-                        <a-form-item label="taskId">
-                            <a-input placeholder="请输入taskId" v-model="queryParam.taskId"></a-input>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :md="6" :sm="8">
-                        <a-form-item label="parentId">
-                            <a-input placeholder="请输入parentId" v-model="queryParam.parentId"></a-input>
-                        </a-form-item>
-                    </a-col>
-                    <template v-if="toggleSearchStatus">
-                        <a-col :md="6" :sm="8">
-                            <a-form-item label="seq">
-                                <a-input placeholder="请输入seq" v-model="queryParam.seq"></a-input>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
-                            <a-form-item label="findType">
-                                <a-input placeholder="请输入findType" v-model="queryParam.findType"></a-input>
-                            </a-form-item>
-                        </a-col>
-                        <a-col :md="6" :sm="8">
-                            <a-form-item label="findKey">
-                                <a-input placeholder="请输入findKey" v-model="queryParam.findKey"></a-input>
-                            </a-form-item>
-                        </a-col>
-                    </template>
-                    <a-col :md="6" :sm="8">
-            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-              <a @click="handleToggleSearch" style="margin-left: 8px">
-                {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
-              </a>
-            </span>
-                    </a-col>
-
-                </a-row>
-            </a-form>
-        </div>
-
-        <!-- 操作按钮区域 -->
-        <div class="table-operator">
-            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-            <a-button type="primary" icon="download" @click="handleExportXls('手机任务步骤表')">导出</a-button>
-            <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
-                      :action="importExcelUrl" @change="handleImportExcel">
-                <a-button type="primary" icon="import">导入</a-button>
-            </a-upload>
-            <a-dropdown v-if="selectedRowKeys.length > 0">
-                <a-menu slot="overlay">
-                    <a-menu-item key="1" @click="batchDel">
-                        <a-icon type="delete"/>
-                        删除
-                    </a-menu-item>
-                </a-menu>
-                <a-button style="margin-left: 8px"> 批量操作
-                    <a-icon type="down"/>
-                </a-button>
-            </a-dropdown>
-        </div>
-
-        <!-- table区域-begin -->
-        <div>
-            <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-                <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
-                selectedRowKeys.length }}</a>项
-                <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-            </div>
-
-            <a-table
-                    ref="table"
-                    size="middle"
-                    bordered
-                    rowKey="id"
-                    :columns="columns"
-                    :dataSource="dataSource"
-                    :pagination="ipagination"
-                    :loading="loading"
-                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-                    @change="handleTableChange">
-
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
-
-          <a-divider type="vertical"/>
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span>
-
-            </a-table>
-        </div>
-        <!-- table区域-end -->
-
-        <!-- 表单区域 -->
-        <appiumTaskItem-modal ref="modalForm" @ok="modalFormOk"></appiumTaskItem-modal>
-    </a-card>
-</template>
-
-<script>
-    import AppiumTaskItemModal from './modules/AppiumTaskItemModal'
-    import {JeecgListMixin} from '@/mixins/JeecgListMixin'
-
-    export default {
-        name: "AppiumTaskItemList",
-        mixins: [JeecgListMixin],
-        components: {
-            AppiumTaskItemModal
-        },
-        data() {
-            return {
-                description: '手机任务步骤表管理页面',
-                // 表头
-                columns: [
-                    {
-                        title: '#',
-                        dataIndex: '',
-                        key: 'rowIndex',
-                        width: 60,
-                        align: "center",
-                        customRender: function (t, r, index) {
-                            return parseInt(index) + 1;
-                        }
-                    },
-                    {
-                        title: 'taskId',
-                        align: "center",
-                        dataIndex: 'taskId'
-                    },
-                    {
-                        title: 'parentId',
-                        align: "center",
-                        dataIndex: 'parentId'
-                    },
-                    {
-                        title: 'seq',
-                        align: "center",
-                        dataIndex: 'seq'
-                    },
-                    {
-                        title: 'findType',
-                        align: "center",
-                        dataIndex: 'findType'
-                    },
-                    {
-                        title: 'findKey',
-                        align: "center",
-                        dataIndex: 'findKey'
-                    },
-                    {
-                        title: 'clickType',
-                        align: "center",
-                        dataIndex: 'clickType'
-                    },
-                    {
-                        title: 'offsiteX',
-                        align: "center",
-                        dataIndex: 'offsiteX'
-                    },
-                    {
-                        title: 'offsiteY',
-                        align: "center",
-                        dataIndex: 'offsiteY'
-                    },
-                    {
-                        title: 'loopRate',
-                        align: "center",
-                        dataIndex: 'loopRate'
-                    },
-                    {
-                        title: 'isMust',
-                        align: "center",
-                        dataIndex: 'isMust'
-                    },
-                    {
-                        title: 'textEqualType',
-                        align: "center",
-                        dataIndex: 'textEqualType'
-                    },
-                    {
-                        title: 'textEqualKey',
-                        align: "center",
-                        dataIndex: 'textEqualKey'
-                    },
-                    {
-                        title: 'swapType',
-                        align: "center",
-                        dataIndex: 'swapType'
-                    },
-                    {
-                        title: 'waitTime',
-                        align: "center",
-                        dataIndex: 'waitTime'
-                    },
-                    {
-                        title: 'isClose',
-                        align: "center",
-                        dataIndex: 'isClose'
-                    },
-                    {
-                        title: '操作',
-                        dataIndex: 'action',
-                        align: "center",
-                        scopedSlots: {customRender: 'action'},
-                    }
-                ],
-                url: {
-                    list: "/appium/appiumTaskItem/list",
-                    delete: "/appium/appiumTaskItem/delete",
-                    deleteBatch: "/appium/appiumTaskItem/deleteBatch",
-                    exportXlsUrl: "appium/appiumTaskItem/exportXls",
-                    importExcelUrl: "appium/appiumTaskItem/importExcel",
-                },
-            }
-        },
-        computed: {
-            importExcelUrl: function () {
-                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-            }
-        },
-        methods: {}
-    }
-</script>
-<style scoped>
-    @import '~@assets/less/common.less'
-</style>

+ 0 - 173
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/AppiumTaskList.vue

@@ -1,173 +0,0 @@
-<template>
-    <a-card :bordered="false">
-
-        <!-- 查询区域 -->
-        <div class="table-page-search-wrapper">
-            <a-form layout="inline">
-                <a-row :gutter="24">
-
-                    <a-col :md="6" :sm="8">
-                        <a-form-item label="taskName">
-                            <a-input placeholder="请输入taskName" v-model="queryParam.taskName"></a-input>
-                        </a-form-item>
-                    </a-col>
-                    <a-col :md="6" :sm="8">
-                        <a-form-item label="appPackage">
-                            <a-input placeholder="请输入appPackage" v-model="queryParam.appPackage"></a-input>
-                        </a-form-item>
-                    </a-col>
-                    <template v-if="toggleSearchStatus">
-                        <a-col :md="6" :sm="8">
-                            <a-form-item label="appActivity">
-                                <a-input placeholder="请输入appActivity" v-model="queryParam.appActivity"></a-input>
-                            </a-form-item>
-                        </a-col>
-                    </template>
-                    <a-col :md="6" :sm="8">
-            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
-              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
-              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
-              <a @click="handleToggleSearch" style="margin-left: 8px">
-                {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
-              </a>
-            </span>
-                    </a-col>
-
-                </a-row>
-            </a-form>
-        </div>
-
-        <!-- 操作按钮区域 -->
-        <div class="table-operator">
-            <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-            <a-button type="primary" icon="download" @click="handleExportXls('手机任务表')">导出</a-button>
-            <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader"
-                      :action="importExcelUrl" @change="handleImportExcel">
-                <a-button type="primary" icon="import">导入</a-button>
-            </a-upload>
-            <a-dropdown v-if="selectedRowKeys.length > 0">
-                <a-menu slot="overlay">
-                    <a-menu-item key="1" @click="batchDel">
-                        <a-icon type="delete"/>
-                        删除
-                    </a-menu-item>
-                </a-menu>
-                <a-button style="margin-left: 8px"> 批量操作
-                    <a-icon type="down"/>
-                </a-button>
-            </a-dropdown>
-        </div>
-
-        <!-- table区域-begin -->
-        <div>
-            <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-                <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{
-                selectedRowKeys.length }}</a>项
-                <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-            </div>
-
-            <a-table
-                    ref="table"
-                    size="middle"
-                    bordered
-                    rowKey="id"
-                    :columns="columns"
-                    :dataSource="dataSource"
-                    :pagination="ipagination"
-                    :loading="loading"
-                    :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-                    @change="handleTableChange">
-
-        <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
-
-          <a-divider type="vertical"/>
-          <a-dropdown>
-            <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
-        </span>
-
-            </a-table>
-        </div>
-        <!-- table区域-end -->
-
-        <!-- 表单区域 -->
-        <appiumTask-modal ref="modalForm" @ok="modalFormOk"></appiumTask-modal>
-    </a-card>
-</template>
-
-<script>
-    import AppiumTaskModal from './modules/AppiumTaskModal'
-    import {JeecgListMixin} from '@/mixins/JeecgListMixin'
-
-    export default {
-        name: "AppiumTaskList",
-        mixins: [JeecgListMixin],
-        components: {
-            AppiumTaskModal
-        },
-        data() {
-            return {
-                description: '手机任务表管理页面',
-                // 表头
-                columns: [
-                    {
-                        title: '#',
-                        dataIndex: '',
-                        key: 'rowIndex',
-                        width: 60,
-                        align: "center",
-                        customRender: function (t, r, index) {
-                            return parseInt(index) + 1;
-                        }
-                    },
-                    {
-                        title: 'taskName',
-                        align: "center",
-                        dataIndex: 'taskName'
-                    },
-                    {
-                        title: 'appPackage',
-                        align: "center",
-                        dataIndex: 'appPackage'
-                    },
-                    {
-                        title: 'appActivity',
-                        align: "center",
-                        dataIndex: 'appActivity'
-                    },
-                    {
-                        title: '操作',
-                        dataIndex: 'action',
-                        align: "center",
-                        scopedSlots: {customRender: 'action'},
-                    }
-                ],
-                url: {
-                    list: "/appium/appiumTask/list",
-                    delete: "/appium/appiumTask/delete",
-                    deleteBatch: "/appium/appiumTask/deleteBatch",
-                    exportXlsUrl: "appium/appiumTask/exportXls",
-                    importExcelUrl: "appium/appiumTask/importExcel",
-                },
-            }
-        },
-        computed: {
-            importExcelUrl: function () {
-                return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
-            }
-        },
-        methods: {}
-    }
-</script>
-<style scoped>
-    @import '~@assets/less/common.less'
-</style>

+ 0 - 138
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumDeviceModal.vue

@@ -1,138 +0,0 @@
-<template>
-    <a-modal
-            :title="title"
-            :width="800"
-            :visible="visible"
-            :confirmLoading="confirmLoading"
-            @ok="handleOk"
-            @cancel="handleCancel"
-            cancelText="关闭">
-
-        <a-spin :spinning="confirmLoading">
-            <a-form :form="form">
-
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="ip">
-                    <a-input placeholder="请输入ip" v-decorator="['ip', validatorRules.ip ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="port">
-                    <a-input placeholder="请输入port" v-decorator="['port', validatorRules.port ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="status">
-                    <a-input placeholder="请输入status" v-decorator="['status', validatorRules.status ]"/>
-                </a-form-item>
-
-            </a-form>
-        </a-spin>
-    </a-modal>
-</template>
-
-<script>
-    import {httpAction} from '@/api/manage'
-    import pick from 'lodash.pick'
-    import moment from "moment"
-
-    export default {
-        name: "AppiumDeviceModal",
-        data() {
-            return {
-                title: "操作",
-                visible: false,
-                model: {},
-                labelCol: {
-                    xs: {span: 24},
-                    sm: {span: 5},
-                },
-                wrapperCol: {
-                    xs: {span: 24},
-                    sm: {span: 16},
-                },
-
-                confirmLoading: false,
-                form: this.$form.createForm(this),
-                validatorRules: {
-                    ip: {rules: [{required: true, message: '请输入ip!'}]},
-                    port: {rules: [{required: true, message: '请输入port!'}]},
-                    status: {rules: [{required: true, message: '请输入status!'}]},
-                },
-                url: {
-                    add: "/appium/appiumDevice/add",
-                    edit: "/appium/appiumDevice/edit",
-                },
-            }
-        },
-        created() {
-        },
-        methods: {
-            add() {
-                this.edit({});
-            },
-            edit(record) {
-                this.form.resetFields();
-                this.model = Object.assign({}, record);
-                this.visible = true;
-                this.$nextTick(() => {
-                    this.form.setFieldsValue(pick(this.model, 'ip', 'port', 'status'))
-                    //时间格式化
-                });
-
-            },
-            close() {
-                this.$emit('close');
-                this.visible = false;
-            },
-            handleOk() {
-                const that = this;
-                // 触发表单验证
-                this.form.validateFields((err, values) => {
-                    if (!err) {
-                        that.confirmLoading = true;
-                        let httpurl = '';
-                        let method = '';
-                        if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = 'post';
-                        } else {
-                            httpurl += this.url.edit;
-                            method = 'put';
-                        }
-                        let formData = Object.assign(this.model, values);
-                        //时间格式化
-
-                        console.log(formData)
-                        httpAction(httpurl, formData, method).then((res) => {
-                            if (res.success) {
-                                that.$message.success(res.message);
-                                that.$emit('ok');
-                            } else {
-                                that.$message.warning(res.message);
-                            }
-                        }).finally(() => {
-                            that.confirmLoading = false;
-                            that.close();
-                        })
-
-
-                    }
-                })
-            },
-            handleCancel() {
-                this.close()
-            },
-
-
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-
-</style>

+ 0 - 145
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumDeviceModal__Style#Drawer.vue

@@ -1,145 +0,0 @@
-<template>
-    <a-drawer
-            :title="title"
-            :width="800"
-            placement="right"
-            :closable="false"
-            @close="close"
-            :visible="visible"
-    >
-
-        <a-spin :spinning="confirmLoading">
-            <a-form :form="form">
-
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="ip">
-                    <a-input placeholder="请输入ip" v-decorator="['ip', validatorRules.ip ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="port">
-                    <a-input placeholder="请输入port" v-decorator="['port', validatorRules.port ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="status">
-                    <a-input placeholder="请输入status" v-decorator="['status', validatorRules.status ]"/>
-                </a-form-item>
-
-            </a-form>
-        </a-spin>
-        <a-button type="primary" @click="handleOk">确定</a-button>
-        <a-button type="primary" @click="handleCancel">取消</a-button>
-    </a-drawer>
-</template>
-
-<script>
-    import {httpAction} from '@/api/manage'
-    import pick from 'lodash.pick'
-    import moment from "moment"
-
-    export default {
-        name: "AppiumDeviceModal",
-        data() {
-            return {
-                title: "操作",
-                visible: false,
-                model: {},
-                labelCol: {
-                    xs: {span: 24},
-                    sm: {span: 5},
-                },
-                wrapperCol: {
-                    xs: {span: 24},
-                    sm: {span: 16},
-                },
-
-                confirmLoading: false,
-                form: this.$form.createForm(this),
-                validatorRules: {
-                    ip: {rules: [{required: true, message: '请输入ip!'}]},
-                    port: {rules: [{required: true, message: '请输入port!'}]},
-                    status: {rules: [{required: true, message: '请输入status!'}]},
-                },
-                url: {
-                    add: "/appium/appiumDevice/add",
-                    edit: "/appium/appiumDevice/edit",
-                },
-            }
-        },
-        created() {
-        },
-        methods: {
-            add() {
-                this.edit({});
-            },
-            edit(record) {
-                this.form.resetFields();
-                this.model = Object.assign({}, record);
-                this.visible = true;
-                this.$nextTick(() => {
-                    this.form.setFieldsValue(pick(this.model, 'ip', 'port', 'status'))
-                    //时间格式化
-                });
-
-            },
-            close() {
-                this.$emit('close');
-                this.visible = false;
-            },
-            handleOk() {
-                const that = this;
-                // 触发表单验证
-                this.form.validateFields((err, values) => {
-                    if (!err) {
-                        that.confirmLoading = true;
-                        let httpurl = '';
-                        let method = '';
-                        if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = 'post';
-                        } else {
-                            httpurl += this.url.edit;
-                            method = 'put';
-                        }
-                        let formData = Object.assign(this.model, values);
-                        //时间格式化
-
-                        console.log(formData)
-                        httpAction(httpurl, formData, method).then((res) => {
-                            if (res.success) {
-                                that.$message.success(res.message);
-                                that.$emit('ok');
-                            } else {
-                                that.$message.warning(res.message);
-                            }
-                        }).finally(() => {
-                            that.confirmLoading = false;
-                            that.close();
-                        })
-
-
-                    }
-                })
-            },
-            handleCancel() {
-                this.close()
-            },
-
-
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-    /** Button按钮间距 */
-    .ant-btn {
-        margin-left: 30px;
-        margin-bottom: 30px;
-        float: right;
-    }
-</style>

+ 0 - 224
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskItemModal.vue

@@ -1,224 +0,0 @@
-<template>
-    <a-modal
-            :title="title"
-            :width="800"
-            :visible="visible"
-            :confirmLoading="confirmLoading"
-            @ok="handleOk"
-            @cancel="handleCancel"
-            cancelText="关闭">
-
-        <a-spin :spinning="confirmLoading">
-            <a-form :form="form">
-
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="taskId">
-                    <a-input placeholder="请输入taskId" v-decorator="['taskId', validatorRules.taskId ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="parentId">
-                    <a-input placeholder="请输入parentId" v-decorator="['parentId', validatorRules.parentId ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="seq">
-                    <a-input-number v-decorator="[ 'seq', validatorRules.seq ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="findType">
-                    <a-input placeholder="请输入findType" v-decorator="['findType', validatorRules.findType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="findKey">
-                    <a-input placeholder="请输入findKey" v-decorator="['findKey', validatorRules.findKey ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="clickType">
-                    <a-input placeholder="请输入clickType" v-decorator="['clickType', validatorRules.clickType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="offsiteX">
-                    <a-input-number v-decorator="[ 'offsiteX', validatorRules.offsiteX ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="offsiteY">
-                    <a-input-number v-decorator="[ 'offsiteY', validatorRules.offsiteY ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="loopRate">
-                    <a-input placeholder="请输入loopRate" v-decorator="['loopRate', validatorRules.loopRate ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="isMust">
-                    <a-input placeholder="请输入isMust" v-decorator="['isMust', validatorRules.isMust ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="textEqualType">
-                    <a-input placeholder="请输入textEqualType"
-                             v-decorator="['textEqualType', validatorRules.textEqualType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="textEqualKey">
-                    <a-input placeholder="请输入textEqualKey"
-                             v-decorator="['textEqualKey', validatorRules.textEqualKey ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="swapType">
-                    <a-input placeholder="请输入swapType" v-decorator="['swapType', validatorRules.swapType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="waitTime">
-                    <a-input placeholder="请输入waitTime" v-decorator="['waitTime', validatorRules.waitTime ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="isClose">
-                    <a-input placeholder="请输入isClose" v-decorator="['isClose', validatorRules.isClose ]"/>
-                </a-form-item>
-
-            </a-form>
-        </a-spin>
-    </a-modal>
-</template>
-
-<script>
-    import {httpAction} from '@/api/manage'
-    import pick from 'lodash.pick'
-    import moment from "moment"
-
-    export default {
-        name: "AppiumTaskItemModal",
-        data() {
-            return {
-                title: "操作",
-                visible: false,
-                model: {},
-                labelCol: {
-                    xs: {span: 24},
-                    sm: {span: 5},
-                },
-                wrapperCol: {
-                    xs: {span: 24},
-                    sm: {span: 16},
-                },
-
-                confirmLoading: false,
-                form: this.$form.createForm(this),
-                validatorRules: {
-                    taskId: {rules: [{required: true, message: '请输入taskId!'}]},
-                    parentId: {rules: [{required: true, message: '请输入parentId!'}]},
-                    seq: {rules: [{required: true, message: '请输入seq!'}]},
-                    findType: {rules: [{required: true, message: '请输入findType!'}]},
-                    findKey: {rules: [{required: true, message: '请输入findKey!'}]},
-                    clickType: {rules: [{required: true, message: '请输入clickType!'}]},
-                    offsiteX: {rules: [{required: true, message: '请输入offsiteX!'}]},
-                    offsiteY: {rules: [{required: true, message: '请输入offsiteY!'}]},
-                    loopRate: {rules: [{required: true, message: '请输入loopRate!'}]},
-                    isMust: {rules: [{required: true, message: '请输入isMust!'}]},
-                    textEqualType: {rules: [{required: true, message: '请输入textEqualType!'}]},
-                    textEqualKey: {rules: [{required: true, message: '请输入textEqualKey!'}]},
-                    swapType: {rules: [{required: true, message: '请输入swapType!'}]},
-                    waitTime: {rules: [{required: true, message: '请输入waitTime!'}]},
-                    isClose: {rules: [{required: true, message: '请输入isClose!'}]},
-                },
-                url: {
-                    add: "/appium/appiumTaskItem/add",
-                    edit: "/appium/appiumTaskItem/edit",
-                },
-            }
-        },
-        created() {
-        },
-        methods: {
-            add() {
-                this.edit({});
-            },
-            edit(record) {
-                this.form.resetFields();
-                this.model = Object.assign({}, record);
-                this.visible = true;
-                this.$nextTick(() => {
-                    this.form.setFieldsValue(pick(this.model, 'taskId', 'parentId', 'seq', 'findType', 'findKey', 'clickType', 'offsiteX', 'offsiteY', 'loopRate', 'isMust', 'textEqualType', 'textEqualKey', 'swapType', 'waitTime', 'isClose'))
-                    //时间格式化
-                });
-
-            },
-            close() {
-                this.$emit('close');
-                this.visible = false;
-            },
-            handleOk() {
-                const that = this;
-                // 触发表单验证
-                this.form.validateFields((err, values) => {
-                    if (!err) {
-                        that.confirmLoading = true;
-                        let httpurl = '';
-                        let method = '';
-                        if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = 'post';
-                        } else {
-                            httpurl += this.url.edit;
-                            method = 'put';
-                        }
-                        let formData = Object.assign(this.model, values);
-                        //时间格式化
-
-                        console.log(formData)
-                        httpAction(httpurl, formData, method).then((res) => {
-                            if (res.success) {
-                                that.$message.success(res.message);
-                                that.$emit('ok');
-                            } else {
-                                that.$message.warning(res.message);
-                            }
-                        }).finally(() => {
-                            that.confirmLoading = false;
-                            that.close();
-                        })
-
-
-                    }
-                })
-            },
-            handleCancel() {
-                this.close()
-            },
-
-
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-
-</style>

+ 0 - 231
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskItemModal__Style#Drawer.vue

@@ -1,231 +0,0 @@
-<template>
-    <a-drawer
-            :title="title"
-            :width="800"
-            placement="right"
-            :closable="false"
-            @close="close"
-            :visible="visible"
-    >
-
-        <a-spin :spinning="confirmLoading">
-            <a-form :form="form">
-
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="taskId">
-                    <a-input placeholder="请输入taskId" v-decorator="['taskId', validatorRules.taskId ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="parentId">
-                    <a-input placeholder="请输入parentId" v-decorator="['parentId', validatorRules.parentId ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="seq">
-                    <a-input-number v-decorator="[ 'seq', validatorRules.seq ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="findType">
-                    <a-input placeholder="请输入findType" v-decorator="['findType', validatorRules.findType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="findKey">
-                    <a-input placeholder="请输入findKey" v-decorator="['findKey', validatorRules.findKey ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="clickType">
-                    <a-input placeholder="请输入clickType" v-decorator="['clickType', validatorRules.clickType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="offsiteX">
-                    <a-input-number v-decorator="[ 'offsiteX', validatorRules.offsiteX ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="offsiteY">
-                    <a-input-number v-decorator="[ 'offsiteY', validatorRules.offsiteY ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="loopRate">
-                    <a-input placeholder="请输入loopRate" v-decorator="['loopRate', validatorRules.loopRate ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="isMust">
-                    <a-input placeholder="请输入isMust" v-decorator="['isMust', validatorRules.isMust ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="textEqualType">
-                    <a-input placeholder="请输入textEqualType"
-                             v-decorator="['textEqualType', validatorRules.textEqualType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="textEqualKey">
-                    <a-input placeholder="请输入textEqualKey"
-                             v-decorator="['textEqualKey', validatorRules.textEqualKey ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="swapType">
-                    <a-input placeholder="请输入swapType" v-decorator="['swapType', validatorRules.swapType ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="waitTime">
-                    <a-input placeholder="请输入waitTime" v-decorator="['waitTime', validatorRules.waitTime ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="isClose">
-                    <a-input placeholder="请输入isClose" v-decorator="['isClose', validatorRules.isClose ]"/>
-                </a-form-item>
-
-            </a-form>
-        </a-spin>
-        <a-button type="primary" @click="handleOk">确定</a-button>
-        <a-button type="primary" @click="handleCancel">取消</a-button>
-    </a-drawer>
-</template>
-
-<script>
-    import {httpAction} from '@/api/manage'
-    import pick from 'lodash.pick'
-    import moment from "moment"
-
-    export default {
-        name: "AppiumTaskItemModal",
-        data() {
-            return {
-                title: "操作",
-                visible: false,
-                model: {},
-                labelCol: {
-                    xs: {span: 24},
-                    sm: {span: 5},
-                },
-                wrapperCol: {
-                    xs: {span: 24},
-                    sm: {span: 16},
-                },
-
-                confirmLoading: false,
-                form: this.$form.createForm(this),
-                validatorRules: {
-                    taskId: {rules: [{required: true, message: '请输入taskId!'}]},
-                    parentId: {rules: [{required: true, message: '请输入parentId!'}]},
-                    seq: {rules: [{required: true, message: '请输入seq!'}]},
-                    findType: {rules: [{required: true, message: '请输入findType!'}]},
-                    findKey: {rules: [{required: true, message: '请输入findKey!'}]},
-                    clickType: {rules: [{required: true, message: '请输入clickType!'}]},
-                    offsiteX: {rules: [{required: true, message: '请输入offsiteX!'}]},
-                    offsiteY: {rules: [{required: true, message: '请输入offsiteY!'}]},
-                    loopRate: {rules: [{required: true, message: '请输入loopRate!'}]},
-                    isMust: {rules: [{required: true, message: '请输入isMust!'}]},
-                    textEqualType: {rules: [{required: true, message: '请输入textEqualType!'}]},
-                    textEqualKey: {rules: [{required: true, message: '请输入textEqualKey!'}]},
-                    swapType: {rules: [{required: true, message: '请输入swapType!'}]},
-                    waitTime: {rules: [{required: true, message: '请输入waitTime!'}]},
-                    isClose: {rules: [{required: true, message: '请输入isClose!'}]},
-                },
-                url: {
-                    add: "/appium/appiumTaskItem/add",
-                    edit: "/appium/appiumTaskItem/edit",
-                },
-            }
-        },
-        created() {
-        },
-        methods: {
-            add() {
-                this.edit({});
-            },
-            edit(record) {
-                this.form.resetFields();
-                this.model = Object.assign({}, record);
-                this.visible = true;
-                this.$nextTick(() => {
-                    this.form.setFieldsValue(pick(this.model, 'taskId', 'parentId', 'seq', 'findType', 'findKey', 'clickType', 'offsiteX', 'offsiteY', 'loopRate', 'isMust', 'textEqualType', 'textEqualKey', 'swapType', 'waitTime', 'isClose'))
-                    //时间格式化
-                });
-
-            },
-            close() {
-                this.$emit('close');
-                this.visible = false;
-            },
-            handleOk() {
-                const that = this;
-                // 触发表单验证
-                this.form.validateFields((err, values) => {
-                    if (!err) {
-                        that.confirmLoading = true;
-                        let httpurl = '';
-                        let method = '';
-                        if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = 'post';
-                        } else {
-                            httpurl += this.url.edit;
-                            method = 'put';
-                        }
-                        let formData = Object.assign(this.model, values);
-                        //时间格式化
-
-                        console.log(formData)
-                        httpAction(httpurl, formData, method).then((res) => {
-                            if (res.success) {
-                                that.$message.success(res.message);
-                                that.$emit('ok');
-                            } else {
-                                that.$message.warning(res.message);
-                            }
-                        }).finally(() => {
-                            that.confirmLoading = false;
-                            that.close();
-                        })
-
-
-                    }
-                })
-            },
-            handleCancel() {
-                this.close()
-            },
-
-
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-    /** Button按钮间距 */
-    .ant-btn {
-        margin-left: 30px;
-        margin-bottom: 30px;
-        float: right;
-    }
-</style>

+ 0 - 138
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskModal.vue

@@ -1,138 +0,0 @@
-<template>
-    <a-modal
-            :title="title"
-            :width="800"
-            :visible="visible"
-            :confirmLoading="confirmLoading"
-            @ok="handleOk"
-            @cancel="handleCancel"
-            cancelText="关闭">
-
-        <a-spin :spinning="confirmLoading">
-            <a-form :form="form">
-
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="taskName">
-                    <a-input placeholder="请输入taskName" v-decorator="['taskName', validatorRules.taskName ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="appPackage">
-                    <a-input placeholder="请输入appPackage" v-decorator="['appPackage', validatorRules.appPackage ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="appActivity">
-                    <a-input placeholder="请输入appActivity" v-decorator="['appActivity', validatorRules.appActivity ]"/>
-                </a-form-item>
-
-            </a-form>
-        </a-spin>
-    </a-modal>
-</template>
-
-<script>
-    import {httpAction} from '@/api/manage'
-    import pick from 'lodash.pick'
-    import moment from "moment"
-
-    export default {
-        name: "AppiumTaskModal",
-        data() {
-            return {
-                title: "操作",
-                visible: false,
-                model: {},
-                labelCol: {
-                    xs: {span: 24},
-                    sm: {span: 5},
-                },
-                wrapperCol: {
-                    xs: {span: 24},
-                    sm: {span: 16},
-                },
-
-                confirmLoading: false,
-                form: this.$form.createForm(this),
-                validatorRules: {
-                    taskName: {rules: [{required: true, message: '请输入taskName!'}]},
-                    appPackage: {rules: [{required: true, message: '请输入appPackage!'}]},
-                    appActivity: {rules: [{required: true, message: '请输入appActivity!'}]},
-                },
-                url: {
-                    add: "/appium/appiumTask/add",
-                    edit: "/appium/appiumTask/edit",
-                },
-            }
-        },
-        created() {
-        },
-        methods: {
-            add() {
-                this.edit({});
-            },
-            edit(record) {
-                this.form.resetFields();
-                this.model = Object.assign({}, record);
-                this.visible = true;
-                this.$nextTick(() => {
-                    this.form.setFieldsValue(pick(this.model, 'taskName', 'appPackage', 'appActivity'))
-                    //时间格式化
-                });
-
-            },
-            close() {
-                this.$emit('close');
-                this.visible = false;
-            },
-            handleOk() {
-                const that = this;
-                // 触发表单验证
-                this.form.validateFields((err, values) => {
-                    if (!err) {
-                        that.confirmLoading = true;
-                        let httpurl = '';
-                        let method = '';
-                        if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = 'post';
-                        } else {
-                            httpurl += this.url.edit;
-                            method = 'put';
-                        }
-                        let formData = Object.assign(this.model, values);
-                        //时间格式化
-
-                        console.log(formData)
-                        httpAction(httpurl, formData, method).then((res) => {
-                            if (res.success) {
-                                that.$message.success(res.message);
-                                that.$emit('ok');
-                            } else {
-                                that.$message.warning(res.message);
-                            }
-                        }).finally(() => {
-                            that.confirmLoading = false;
-                            that.close();
-                        })
-
-
-                    }
-                })
-            },
-            handleCancel() {
-                this.close()
-            },
-
-
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-
-</style>

+ 0 - 145
module-crawler/src/main/java/cn/com/ctop/crawler/modules/appium/vue/modules/AppiumTaskModal__Style#Drawer.vue

@@ -1,145 +0,0 @@
-<template>
-    <a-drawer
-            :title="title"
-            :width="800"
-            placement="right"
-            :closable="false"
-            @close="close"
-            :visible="visible"
-    >
-
-        <a-spin :spinning="confirmLoading">
-            <a-form :form="form">
-
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="taskName">
-                    <a-input placeholder="请输入taskName" v-decorator="['taskName', validatorRules.taskName ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="appPackage">
-                    <a-input placeholder="请输入appPackage" v-decorator="['appPackage', validatorRules.appPackage ]"/>
-                </a-form-item>
-                <a-form-item
-                        :labelCol="labelCol"
-                        :wrapperCol="wrapperCol"
-                        label="appActivity">
-                    <a-input placeholder="请输入appActivity" v-decorator="['appActivity', validatorRules.appActivity ]"/>
-                </a-form-item>
-
-            </a-form>
-        </a-spin>
-        <a-button type="primary" @click="handleOk">确定</a-button>
-        <a-button type="primary" @click="handleCancel">取消</a-button>
-    </a-drawer>
-</template>
-
-<script>
-    import {httpAction} from '@/api/manage'
-    import pick from 'lodash.pick'
-    import moment from "moment"
-
-    export default {
-        name: "AppiumTaskModal",
-        data() {
-            return {
-                title: "操作",
-                visible: false,
-                model: {},
-                labelCol: {
-                    xs: {span: 24},
-                    sm: {span: 5},
-                },
-                wrapperCol: {
-                    xs: {span: 24},
-                    sm: {span: 16},
-                },
-
-                confirmLoading: false,
-                form: this.$form.createForm(this),
-                validatorRules: {
-                    taskName: {rules: [{required: true, message: '请输入taskName!'}]},
-                    appPackage: {rules: [{required: true, message: '请输入appPackage!'}]},
-                    appActivity: {rules: [{required: true, message: '请输入appActivity!'}]},
-                },
-                url: {
-                    add: "/appium/appiumTask/add",
-                    edit: "/appium/appiumTask/edit",
-                },
-            }
-        },
-        created() {
-        },
-        methods: {
-            add() {
-                this.edit({});
-            },
-            edit(record) {
-                this.form.resetFields();
-                this.model = Object.assign({}, record);
-                this.visible = true;
-                this.$nextTick(() => {
-                    this.form.setFieldsValue(pick(this.model, 'taskName', 'appPackage', 'appActivity'))
-                    //时间格式化
-                });
-
-            },
-            close() {
-                this.$emit('close');
-                this.visible = false;
-            },
-            handleOk() {
-                const that = this;
-                // 触发表单验证
-                this.form.validateFields((err, values) => {
-                    if (!err) {
-                        that.confirmLoading = true;
-                        let httpurl = '';
-                        let method = '';
-                        if (!this.model.id) {
-                            httpurl += this.url.add;
-                            method = 'post';
-                        } else {
-                            httpurl += this.url.edit;
-                            method = 'put';
-                        }
-                        let formData = Object.assign(this.model, values);
-                        //时间格式化
-
-                        console.log(formData)
-                        httpAction(httpurl, formData, method).then((res) => {
-                            if (res.success) {
-                                that.$message.success(res.message);
-                                that.$emit('ok');
-                            } else {
-                                that.$message.warning(res.message);
-                            }
-                        }).finally(() => {
-                            that.confirmLoading = false;
-                            that.close();
-                        })
-
-
-                    }
-                })
-            },
-            handleCancel() {
-                this.close()
-            },
-
-
-        }
-    }
-</script>
-
-<style lang="less" scoped>
-    /** Button按钮间距 */
-    .ant-btn {
-        margin-left: 30px;
-        margin-bottom: 30px;
-        float: right;
-    }
-</style>

+ 217 - 0
module-crawler/src/main/java/cn/com/ctop/crawler/modules/core/util/AppiumUtil.java

@@ -0,0 +1,217 @@
+package cn.com.ctop.crawler.modules.core.util;
+
+import cn.com.ctop.crawler.modules.appium.entity.AppiumTaskItem;
+import com.google.gson.Gson;
+import io.appium.java_client.TouchAction;
+import io.appium.java_client.android.AndroidDriver;
+import io.appium.java_client.touch.WaitOptions;
+import io.appium.java_client.touch.offset.PointOption;
+import org.openqa.selenium.Point;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import java.net.URL;
+import java.time.Duration;
+import java.util.List;
+
+public class AppiumUtil {
+    private Boolean isLoop = true;
+    private Duration duration = Duration.ofSeconds(1);
+
+    public void swipeToUp(AndroidDriver driver) {
+        int width = driver.manage().window().getSize().width;
+        int height = driver.manage().window().getSize().height;
+        TouchAction action1 = new TouchAction(driver).press(PointOption.point(width / 2, height * 3 / 4)).waitAction(WaitOptions.waitOptions(duration))
+                .moveTo(PointOption.point(width / 2, height / 4)).release();
+        action1.perform();
+    }
+
+    public void swipeToDown(AndroidDriver driver) {
+        int width = driver.manage().window().getSize().width;
+        int height = driver.manage().window().getSize().height;
+        TouchAction action2 = new TouchAction(driver).press(PointOption.point(width / 2, height / 4)).waitAction(WaitOptions.waitOptions(duration))
+                .moveTo(PointOption.point(width / 2, height * 3 / 4)).release();
+        action2.perform();
+    }
+
+    public void swipeToLeft(AndroidDriver driver) {
+        int width = driver.manage().window().getSize().width;
+        int height = driver.manage().window().getSize().height;
+        TouchAction action3 = new TouchAction(driver).press(PointOption.point(width * 3 / 4, height / 2)).waitAction(WaitOptions.waitOptions(duration))
+                .moveTo(PointOption.point(width / 4, height / 2)).release();
+        action3.perform();
+    }
+
+    public void tapPoint(AndroidDriver driver, Integer x, Integer y) {
+        TouchAction action = new TouchAction(driver).tap(PointOption.point(x, y)).release();
+        action.perform();
+    }
+
+    public void swipeToRight(AndroidDriver driver) {
+        int width = driver.manage().window().getSize().width;
+        int height = driver.manage().window().getSize().height;
+        TouchAction action4 = new TouchAction(driver).press(PointOption.point(width / 4, height / 2)).waitAction(WaitOptions.waitOptions(duration))
+                .moveTo(PointOption.point(width * 3 / 4, height / 2)).release();
+        action4.perform();
+    }
+
+    public AndroidDriver initAndroidDriver(String serverUrl, String deviceName, String appPackage, String appActivity) throws Exception {
+        return new AndroidDriver(new URL(serverUrl), initCapabilities(deviceName, appPackage, appActivity));
+    }
+
+    public DesiredCapabilities initCapabilities(String deviceName, String appPackage, String appActivity) {
+        DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
+        desiredCapabilities.setCapability("deviceName", deviceName);
+        desiredCapabilities.setCapability("platformName", "Android");
+        desiredCapabilities.setCapability("appPackage", appPackage);
+        desiredCapabilities.setCapability("noReset", true);
+        desiredCapabilities.setCapability("unicodeKeyboard", true);
+        desiredCapabilities.setCapability("resetKeyboard", true);
+        desiredCapabilities.setCapability("appActivity", appActivity);
+        return desiredCapabilities;
+    }
+
+    public WebElement getElementById(AndroidDriver androidDriver, String id) {
+        WebElement element = null;
+        List<WebElement> elements = androidDriver.findElementsById(id);
+        if (elements != null && elements.size() > 0) {
+            element = elements.get(0);
+        }
+        return element;
+    }
+
+    public WebElement getElementByClass(AndroidDriver androidDriver, String className) {
+        WebElement element = null;
+        List<WebElement> elements = androidDriver.findElementsByClassName(className);
+        if (elements != null && elements.size() > 0) {
+            element = elements.get(0);
+        }
+        return element;
+    }
+
+    public WebElement getElementByXpath(AndroidDriver androidDriver, String xpath) {
+        WebElement element = null;
+        List<WebElement> elements = androidDriver.findElementsByXPath(xpath);
+        if (elements != null && elements.size() > 0) {
+            element = elements.get(0);
+        }
+        return element;
+    }
+
+    public void runTask(AndroidDriver androidDriver, AppiumTaskItem appiumTaskItem, WebElement loopElement) throws Exception {
+        if (appiumTaskItem != null) {
+            System.out.println(new Gson().toJson(appiumTaskItem));
+            if (appiumTaskItem.getWaitTime() != null && appiumTaskItem.getWaitTime() > 0) {
+                Thread.sleep(appiumTaskItem.getWaitTime());
+            }
+            if (appiumTaskItem.getLoopType() != null && appiumTaskItem.getLoopType().equals("noloop")) {
+                if (appiumTaskItem.getFindType() != null) {
+                    WebElement element = null;
+                    if (appiumTaskItem.getFindType().equals("id")) {
+                        element = getElementById(androidDriver, appiumTaskItem.getFindKey());
+                    } else if (appiumTaskItem.getFindType().equals("class")) {
+                        element = getElementByClass(androidDriver, appiumTaskItem.getFindKey());
+                    } else if (appiumTaskItem.getFindType().equals("xpath")) {
+                        element = getElementByXpath(androidDriver, appiumTaskItem.getFindKey());
+                    } else if (appiumTaskItem.getFindType().equals("loop")) {
+                        element = loopElement;
+                    }
+                    if (element != null) {
+                        if (appiumTaskItem.getTextEqualType() != null) {
+                            if (appiumTaskItem.getTextEqualType().equals("eq")) {
+                                if (!element.getText().equals(appiumTaskItem.getTextEqualKey())) {
+                                    return;
+                                }
+                            } else if (appiumTaskItem.getTextEqualType().equals("neq")) {
+                                if (element.getText() == null || element.getText().equals(appiumTaskItem.getTextEqualKey())) {
+                                    return;
+                                }
+                            }
+                        }
+                        if (appiumTaskItem.getClickType() != null) {
+                            if (appiumTaskItem.getClickType().equals("element")) {
+                                element.click();
+                            } else if (appiumTaskItem.getClickType().equals("point")) {
+                                Point point = element.getLocation();
+                                tapPoint(androidDriver, point.getX() + appiumTaskItem.getOffsiteX(), point.getY() + appiumTaskItem.getOffsiteY());
+                            }
+                        }
+                        List<AppiumTaskItem> subTask = appiumTaskItem.getSubList();
+                        if (subTask != null && subTask.size() > 0) {
+                            for (AppiumTaskItem task : subTask) {
+                                runTask(androidDriver, task, element);
+                            }
+                        }
+                    } else {
+                        if (appiumTaskItem.getIsMust() != null && appiumTaskItem.getIsMust() == 1) {
+                            if (appiumTaskItem.getLoopRate() != null && appiumTaskItem.getLoopRate() > 0) {
+                                Thread.sleep(appiumTaskItem.getLoopRate());
+                            }
+                            runTask(androidDriver, appiumTaskItem, element);
+                            return;
+                        }
+                        if (appiumTaskItem.getClickType() != null && appiumTaskItem.getClickType().equals("point")) {
+                            tapPoint(androidDriver, appiumTaskItem.getOffsiteX(), appiumTaskItem.getOffsiteY());
+                        }
+                    }
+                }
+                if (appiumTaskItem.getSwapType() != null) {
+                    if (appiumTaskItem.getSwapType().equals("up")) {
+                        this.swipeToUp(androidDriver);
+                    } else if (appiumTaskItem.getSwapType().equals("down")) {
+                        this.swipeToDown(androidDriver);
+                    } else if (appiumTaskItem.getSwapType().equals("left")) {
+                        this.swipeToLeft(androidDriver);
+                    } else if (appiumTaskItem.getSwapType().equals("right")) {
+                        this.swipeToRight(androidDriver);
+                    }
+                }
+            } else if (appiumTaskItem.getLoopType() != null && appiumTaskItem.getLoopType().equals("loop")) {
+                while (isLoop) {
+                    System.out.println("loop:" + isLoop);
+                    if (appiumTaskItem.getFindType() != null) {
+                        List<WebElement> list = null;
+                        if (appiumTaskItem.getFindType().equals("id")) {
+                            list = androidDriver.findElementsById(appiumTaskItem.getFindKey());
+                        } else if (appiumTaskItem.getFindType().equals("class")) {
+                            list = androidDriver.findElementsByClassName(appiumTaskItem.getFindKey());
+                        } else if (appiumTaskItem.getFindType().equals("xpath")) {
+                            list = androidDriver.findElementsByXPath(appiumTaskItem.getFindKey());
+                        }
+                        if (list != null && list.size() > 0) {
+                            for (WebElement element : list) {
+                                if (!isLoop) {
+                                    break;
+                                }
+                                if (appiumTaskItem.getLoopRate() != null && appiumTaskItem.getLoopRate() > 0) {
+                                    Thread.sleep(appiumTaskItem.getLoopRate());
+                                }
+                                List<AppiumTaskItem> subTask = appiumTaskItem.getSubList();
+                                if (subTask != null && subTask.size() > 0) {
+                                    for (AppiumTaskItem task : subTask) {
+                                        runTask(androidDriver, task, element);
+                                    }
+                                }
+                            }
+                        }
+                    }
+                    if (appiumTaskItem.getSwapType() != null) {
+                        if (appiumTaskItem.getSwapType().equals("up")) {
+                            this.swipeToUp(androidDriver);
+                        } else if (appiumTaskItem.getSwapType().equals("down")) {
+                            this.swipeToDown(androidDriver);
+                        } else if (appiumTaskItem.getSwapType().equals("left")) {
+                            this.swipeToLeft(androidDriver);
+                        } else if (appiumTaskItem.getSwapType().equals("right")) {
+                            this.swipeToRight(androidDriver);
+                        }
+                    }
+                }
+
+            }
+            if (appiumTaskItem.getIsClose() != null && appiumTaskItem.getIsClose() == 1) {
+                this.isLoop = false;
+            }
+        }
+    }
+}

+ 4 - 1
module-crawler/src/main/java/cn/com/ctop/crawler/modules/test/AppiumTest.java

@@ -237,7 +237,7 @@ public class AppiumTest {
     public void t() {
         try {
 //            AndroidDriver androidDriver = initAndroidDriver("http://39.106.184.70:4723/wd/hub","183.131.157.66:10005","com.smile.gifmaker","com.yxcorp.gifshow.HomeActivity");
-            AndroidDriver androidDriver = initAndroidDriver("http://127.0.0.1:4723/wd/hub", "127.0.0.1:62001", "com.smile.gifmaker", "com.yxcorp.gifshow.HomeActivity");
+            AndroidDriver androidDriver = initAndroidDriver("http://39.106.184.70:4723/wd/hub", "183.131.157.66:10005", "com.smile.gifmaker", "com.yxcorp.gifshow.HomeActivity");
 
             List<AppiumTask> list = initTask();
             for (AppiumTask task : list) {
@@ -304,6 +304,9 @@ public class AppiumTest {
                             runTask(androidDriver, appiumTask, element);
                             return;
                         }
+                        if (appiumTask.getClickType() != null && appiumTask.getClickType().equals("point")) {
+                            tapPoint(androidDriver, appiumTask.getOffsiteX(), appiumTask.getOffsiteY());
+                        }
                     }
                 }
                 if (appiumTask.getSwapType() != null) {