diff --git a/nladmin-system/pom.xml b/nladmin-system/pom.xml index 073ab9d1b..954dcc2e5 100644 --- a/nladmin-system/pom.xml +++ b/nladmin-system/pom.xml @@ -20,11 +20,11 @@ - - com.alicp.jetcache - jetcache-starter-redis - 2.5.14 - + + + + + diff --git a/nladmin-system/src/main/java/org/nl/modules/logicflow/rest/StageController.java b/nladmin-system/src/main/java/org/nl/modules/logicflow/rest/StageController.java new file mode 100644 index 000000000..708ee82cf --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/modules/logicflow/rest/StageController.java @@ -0,0 +1,88 @@ +package org.nl.modules.logicflow.rest; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.annotation.Log; +import org.nl.modules.logicflow.service.StageService; +import org.nl.modules.logicflow.service.dto.StageDto; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +/** + * @Author: lyd + * @Description: 舞台管理 + * @Date: 2022-07-29 10:49 + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "舞台管理") +@RequestMapping("/api/stage") +@Slf4j +public class StageController { + private final StageService stageService; + @GetMapping + @Log("查询舞台") + @ApiOperation("查询舞台") + //@PreAuthorize("@el.check('stage:list')") + public ResponseEntity query(@RequestParam Map whereJson, Pageable page) { + return new ResponseEntity<>(stageService.queryAll(whereJson, page), HttpStatus.OK); + } + + @PostMapping + @Log("新增舞台") + @ApiOperation("新增舞台") + //@PreAuthorize("@el.check('stage:add')") + public ResponseEntity create(@Validated @RequestBody StageDto dto) { + stageService.create(dto); + return new ResponseEntity<>(HttpStatus.CREATED); + } + + @PutMapping + @Log("修改舞台") + @ApiOperation("修改舞台") + //@PreAuthorize("@el.check('stage:edit')") + public ResponseEntity update(@Validated @RequestBody StageDto dto) { + stageService.update(dto); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除舞台") + @ApiOperation("删除舞台") + //@PreAuthorize("@el.check('stage:del')") + @DeleteMapping + public ResponseEntity delete(@RequestBody String[] ids) { + stageService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } + + @GetMapping("/selectList") + @Log("下拉选舞台") + @ApiOperation("下拉选舞台") + //@PreAuthorize("@el.check('routePlan:list')") + public ResponseEntity selectList() { + return new ResponseEntity<>(stageService.selectList(), HttpStatus.OK); + } + + @PostMapping("/addNewStage") + @Log("保存舞台数据") + @ApiOperation("保存舞台数据") + public ResponseEntity addNewStage(@Validated @RequestBody StageDto dto) { + log.info("dto{}",dto); + stageService.addNewStage(dto); + return new ResponseEntity<>(HttpStatus.CREATED); + } + + @PostMapping("/getNewStageDataByCode") + @Log("根据stage_code获取舞台数据") + @ApiOperation("根据stage_code获取舞台数据") + public ResponseEntity getNewStageDataByCode(@RequestBody String code) { + return new ResponseEntity<>(stageService.findByCode(code), HttpStatus.CREATED); + } +} diff --git a/nladmin-system/src/main/java/org/nl/modules/logicflow/rest/StageImageController.java b/nladmin-system/src/main/java/org/nl/modules/logicflow/rest/StageImageController.java new file mode 100644 index 000000000..d75d7650b --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/modules/logicflow/rest/StageImageController.java @@ -0,0 +1,73 @@ +package org.nl.modules.logicflow.rest; + +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.annotation.Log; +import org.nl.modules.logicflow.service.StageImageService; +import org.nl.modules.logicflow.service.dto.StageImageDto; +import org.springframework.data.domain.Pageable; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; + +import java.util.Map; + +/** + * @Author: lyd + * @Description: 舞台图标控制层 + * @Date: 2022-07-29 + */ +@RestController +@RequiredArgsConstructor +@Api(tags = "舞台管理") +@RequestMapping("/api/stageImage") +@Slf4j +public class StageImageController { + private final StageImageService stageImageService; + + @GetMapping + @Log("查询舞台") + @ApiOperation("查询舞台") + //@PreAuthorize("@el.check('stageImage:list')") + public ResponseEntity query(@RequestParam Map whereJson, Pageable page) { + return new ResponseEntity<>(stageImageService.queryAll(whereJson, page), HttpStatus.OK); + } + + @PostMapping + @Log("新增舞台") + @ApiOperation("新增舞台") + //@PreAuthorize("@el.check('stageImage:add')") + public ResponseEntity create(@Validated @RequestBody StageImageDto dto) { + stageImageService.create(dto); + return new ResponseEntity<>(HttpStatus.CREATED); + } + + @PutMapping + @Log("修改舞台") + @ApiOperation("修改舞台") + //@PreAuthorize("@el.check('stageImage:edit')") + public ResponseEntity update(@Validated @RequestBody StageImageDto dto) { + stageImageService.update(dto); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @Log("删除舞台") + @ApiOperation("删除舞台") + //@PreAuthorize("@el.check('stageImage:del')") + @DeleteMapping + public ResponseEntity delete(@RequestBody String[] ids) { + stageImageService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } + + @GetMapping("/selectList") + @Log("下拉选设备图标") + @ApiOperation("下拉选设备图标") + //@PreAuthorize("@el.check('routePlan:list')") + public ResponseEntity selectList() { + return new ResponseEntity<>(stageImageService.selectList(), HttpStatus.OK); + } +} diff --git a/nladmin-system/src/main/java/org/nl/modules/logicflow/service/StageImageService.java b/nladmin-system/src/main/java/org/nl/modules/logicflow/service/StageImageService.java new file mode 100644 index 000000000..f282923d7 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/modules/logicflow/service/StageImageService.java @@ -0,0 +1,59 @@ +package org.nl.modules.logicflow.service; + +import com.alibaba.fastjson.JSONArray; +import org.nl.modules.logicflow.service.dto.StageImageDto; +import org.springframework.data.domain.Pageable; + +import java.util.Map; + +/** + * @Author: lyd + * @Description: 舞台图标的服务层 + * @Date: 2022-07-29 + */ +public interface StageImageService { + /** + * 查询数据分页 + * + * @param whereJson 条件 + * @param page 分页参数 + * @return Map + */ + Map queryAll(Map whereJson, Pageable page); + + /** + * 创建 + * + * @param dto / + */ + void create(StageImageDto dto); + + /** + * 编辑 + * + * @param dto / + */ + void update(StageImageDto dto); + + /** + * 根据ID查询 + * + * @param image_uuid ID + * @return StageImage + */ + StageImageDto findById(String image_uuid); + + /** + * 多选删除 + * + * @param ids / + */ + void deleteAll(String[] ids); + + /** + * 前端舞台编辑选择设备图标下拉选列表 + * + * @return + */ + JSONArray selectList(); +} diff --git a/nladmin-system/src/main/java/org/nl/modules/logicflow/service/StageService.java b/nladmin-system/src/main/java/org/nl/modules/logicflow/service/StageService.java new file mode 100644 index 000000000..857c476ab --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/modules/logicflow/service/StageService.java @@ -0,0 +1,74 @@ +package org.nl.modules.logicflow.service; + +import com.alibaba.fastjson.JSONArray; +import org.nl.modules.logicflow.service.dto.StageDto; +import org.springframework.data.domain.Pageable; + +import java.util.Map; + +/** + * @Author: lyd + * @Description: + * @Date: 2022-07-29 10:50 + */ +public interface StageService { + /** + * 查询数据分页 + * + * @param whereJson 条件 + * @param page 分页参数 + * @return Map + */ + Map queryAll(Map whereJson, Pageable page); + + /** + * 创建 + * + * @param dto / + */ + void create(StageDto dto); + + /** + * 编辑 + * + * @param dto / + */ + void update(StageDto dto); + + /** + * 根据ID查询 + * + * @param stage_uuid ID + * @return Stage + */ + StageDto findById(String stage_uuid); + + /** + * 多选删除 + * + * @param ids / + */ + void deleteAll(String[] ids); + + /** + * 前端舞台下拉选列表 + * + * @return + */ + JSONArray selectList(); + + /** + * 新增舞台信息 + * 将数据保存到remark---保存数据 + * @param dto + */ + void addNewStage(StageDto dto); + + /** + * 根据编码查询 + * + * @param code code + * @return Stage + */ + StageDto findByCode(String code); +} diff --git a/nladmin-system/src/main/java/org/nl/modules/logicflow/service/dto/StageDto.java b/nladmin-system/src/main/java/org/nl/modules/logicflow/service/dto/StageDto.java new file mode 100644 index 000000000..ed7420312 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/modules/logicflow/service/dto/StageDto.java @@ -0,0 +1,63 @@ +package org.nl.modules.logicflow.service.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author: lyd + * @Description: 舞台数据的Dto + * @Date: 2022-07-29 13:28 + */ +@Data +public class StageDto implements Serializable { + /** + * 舞台标识 + */ + private String stage_uuid; + + /** + * 舞台编码 + */ + private String stage_code; + + /** + * 舞台名字 + */ + private String stage_name; + + /** + * 舞台数据 + */ + private String stage_data; + + /** + * 是否启用 + */ + private String is_active; + + /** + * 是否删除 + */ + private String is_delete; + + /** + * 创建者 + */ + private String create_by; + + /** + * 创建时间 + */ + private String create_time; + + /** + * 修改者 + */ + private String update_by; + + /** + * 修改时间 + */ + private String update_time; +} diff --git a/nladmin-system/src/main/java/org/nl/modules/logicflow/service/dto/StageImageDto.java b/nladmin-system/src/main/java/org/nl/modules/logicflow/service/dto/StageImageDto.java new file mode 100644 index 000000000..2d6cf493b --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/modules/logicflow/service/dto/StageImageDto.java @@ -0,0 +1,68 @@ +package org.nl.modules.logicflow.service.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @Author: lyd + * @Description: 设备图标dto + * @Date: 2022-07-29 + */ +@Data +public class StageImageDto implements Serializable { + /** + * 设备标识 + */ + private String image_uuid; + + /** + * 设备名字 + */ + private String image_name; + + /** + * 适用驱动 + */ + private String driver_code_json; + + /** + * 备注 + */ + private String remark; + + /** + * 是否启用 + */ + private String is_active; + + /** + * 是否删除 + */ + private String is_delete; + + /** + * 创建者 + */ + private String create_by; + + /** + * 创建时间 + */ + private String create_time; + + /** + * 修改者 + */ + private String update_by; + + /** + * 修改时间 + */ + private String update_time; + + /** + * 图标编码 + */ + private String image_code; +} diff --git a/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageImageServiceImpl.java b/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageImageServiceImpl.java new file mode 100644 index 000000000..e4a531c88 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageImageServiceImpl.java @@ -0,0 +1,110 @@ +package org.nl.modules.logicflow.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.exception.BadRequestException; +import org.nl.modules.logicflow.service.StageImageService; +import org.nl.modules.logicflow.service.dto.StageImageDto; +import org.nl.utils.SecurityUtils; +import org.nl.wql.core.bean.ResultBean; +import org.nl.wql.core.bean.WQLObject; +import org.nl.wql.util.WqlUtil; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Map; + +/** + * @Author: lyd + * @Description: 舞台图标的服务实现 + * @Date: 2022-07-29 + */ +@Service +@RequiredArgsConstructor +@Slf4j +public class StageImageServiceImpl implements StageImageService { + @Override + public Map queryAll(Map whereJson, Pageable page) { + String where = "1=1"; + if (whereJson.get("device_type") != null) { + where = "driver_code_json like ('%" + whereJson.get("device_type") + "%')"; + } + WQLObject wo = WQLObject.getWQLObject("stage_image"); + ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), where, "update_time desc"); + final JSONObject json = rb.pageResult(); + return json; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void create(StageImageDto dto) { + String currentUsername = SecurityUtils.getCurrentUsername(); + String now = DateUtil.now(); + + dto.setImage_uuid(IdUtil.simpleUUID()); + dto.setCreate_by(currentUsername); + dto.setUpdate_by(currentUsername); + dto.setUpdate_time(now); + dto.setCreate_time(now); + + WQLObject wo = WQLObject.getWQLObject("stage_image"); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); + + wo.insert(json); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(StageImageDto dto) { + StageImageDto entity = this.findById(dto.getImage_uuid()); + if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); + + String currentUsername = SecurityUtils.getCurrentUsername(); + String now = DateUtil.now(); + dto.setUpdate_time(now); + dto.setUpdate_by(currentUsername); + + WQLObject wo = WQLObject.getWQLObject("stage_image"); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); + + wo.update(json); + } + + @Override + public StageImageDto findById(String image_uuid) { + WQLObject wo = WQLObject.getWQLObject("stage_image"); + JSONObject json = wo.query("image_uuid ='" + image_uuid + "'").uniqueResult(0); + final StageImageDto obj = json.toJavaObject(StageImageDto.class); + return obj; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteAll(String[] ids) { + WQLObject wo = WQLObject.getWQLObject("stage_image"); + for (String image_uuid : ids) { + wo.delete("image_uuid = '" + image_uuid + "'"); + } + } + + @Override + public JSONArray selectList() { + //设备基础信息表【acs_stage_image】 + JSONArray arr = WQLObject.getWQLObject("stage_image").query("is_delete= '0' AND is_active= '1'", "update_time desc").getResultJSONArray(0); + JSONArray result = new JSONArray(); + for (int i = 0; i < arr.size(); i++) { + JSONObject obj = arr.getJSONObject(i); + JSONObject json = new JSONObject(); + json.put("image_uuid", obj.getString("image_uuid")); + json.put("image_code", obj.getString("image_code")); + json.put("image_name", obj.getString("image_code").toString().split("-")[0]); + result.add(json); + } + return result; + } +} diff --git a/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageServiceImpl.java b/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageServiceImpl.java new file mode 100644 index 000000000..fc046af99 --- /dev/null +++ b/nladmin-system/src/main/java/org/nl/modules/logicflow/service/impl/StageServiceImpl.java @@ -0,0 +1,132 @@ +package org.nl.modules.logicflow.service.impl; + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.nl.exception.BadRequestException; +import org.nl.modules.logicflow.service.StageService; +import org.nl.modules.logicflow.service.dto.StageDto; +import org.nl.utils.SecurityUtils; +import org.nl.wql.core.bean.ResultBean; +import org.nl.wql.core.bean.WQLObject; +import org.nl.wql.util.WqlUtil; +import org.springframework.data.domain.Pageable; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Map; + +/** + * @Author: lyd + * @Description: + * @Date: 2022-07-29 10:51 + */ +@Service +@RequiredArgsConstructor +@Slf4j +public class StageServiceImpl implements StageService { + @Override + public Map queryAll(Map whereJson, Pageable page) { + log.info("分页查找"); + WQLObject wo = WQLObject.getWQLObject("stage"); + ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "", "update_time desc"); + final JSONObject json = rb.pageResult(); + return json; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void create(StageDto dto) { + String currentUsername = SecurityUtils.getCurrentUsername(); + String now = DateUtil.now(); + + dto.setStage_uuid(IdUtil.simpleUUID()); + dto.setCreate_by(currentUsername); + dto.setUpdate_by(currentUsername); + dto.setUpdate_time(now); + dto.setCreate_time(now); + + WQLObject wo = WQLObject.getWQLObject("stage"); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); + + wo.insert(json); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(StageDto dto) { + StageDto entity = this.findById(dto.getStage_uuid()); + if (entity == null) throw new BadRequestException("被删除或无权限,操作失败!"); + + String currentUsername = SecurityUtils.getCurrentUsername(); + String now = DateUtil.now(); + dto.setUpdate_time(now); + dto.setUpdate_by(currentUsername); + + WQLObject wo = WQLObject.getWQLObject("stage"); + JSONObject json = (JSONObject) JSONObject.toJSON(dto); + + wo.update(json); + } + + @Override + public StageDto findById(String stage_uuid) { + WQLObject wo = WQLObject.getWQLObject("stage"); + JSONObject json = wo.query("stage_uuid ='" + stage_uuid + "'").uniqueResult(0); + final StageDto obj = json.toJavaObject(StageDto.class); + return obj; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteAll(String[] ids) { + WQLObject wo = WQLObject.getWQLObject("stage"); + for (String stage_uuid : ids) { + wo.delete("stage_uuid = '" + stage_uuid + "'"); + } + } + + @Override + public JSONArray selectList() { + //设备基础信息表【stage】 + JSONArray arr = WQLObject.getWQLObject("stage").query("is_delete= '0' AND is_active= '1'").getResultJSONArray(0); + JSONArray result = new JSONArray(); + for (int i = 0; i < arr.size(); i++) { + JSONObject obj = arr.getJSONObject(i); + JSONObject json = new JSONObject(); + json.put("stage_id", obj.getString("stage_id")); + json.put("stage_code", obj.getString("stage_code")); + json.put("stage_name", obj.getString("stage_name")); + result.add(json); + } + return result; + } + + @Override + public void addNewStage(StageDto dto) { + // 根据dto的code找到数据 + StageDto stageDto = this.findByCode(dto.getStage_code()); + // 设置内容 + stageDto.setStage_data(dto.getStage_data()); + // 获取当前用户与时间 + String currentUsername = SecurityUtils.getCurrentUsername(); + String now = DateUtil.now(); + stageDto.setUpdate_time(now); + stageDto.setUpdate_by(currentUsername); + System.out.println(stageDto); + WQLObject wo = WQLObject.getWQLObject("stage"); + JSONObject json = (JSONObject) JSONObject.toJSON(stageDto); + wo.update(json); + } + + @Override + public StageDto findByCode(String code) { + WQLObject wo = WQLObject.getWQLObject("stage"); + JSONObject json = wo.query("stage_code ='" + code + "'").uniqueResult(0); + final StageDto obj = json.toJavaObject(StageDto.class); + return obj; + } +} diff --git a/nladmin-system/src/main/java/org/nl/modules/logicflow/wql/device.xls b/nladmin-system/src/main/java/org/nl/modules/logicflow/wql/device.xls new file mode 100644 index 000000000..f15ea83e1 Binary files /dev/null and b/nladmin-system/src/main/java/org/nl/modules/logicflow/wql/device.xls differ diff --git a/nladmin-system/src/main/java/org/nl/modules/system/rest/ParamController.java b/nladmin-system/src/main/java/org/nl/modules/system/rest/ParamController.java index edb403bbb..06182a96c 100644 --- a/nladmin-system/src/main/java/org/nl/modules/system/rest/ParamController.java +++ b/nladmin-system/src/main/java/org/nl/modules/system/rest/ParamController.java @@ -75,4 +75,11 @@ public class ParamController { public void download(HttpServletResponse response, Map whereJson) throws IOException { paramService.download(paramService.queryAll(whereJson), response); } + + @PostMapping("/getStageCodeByCode") + @Log("根据编码获取舞台编码") + @ApiOperation("根据编码获取舞台编码") + public ResponseEntity getStageCodeByCode(@RequestBody String code) { + return new ResponseEntity<>(paramService.findByCode(code), HttpStatus.CREATED); + } } diff --git a/nladmin-system/src/main/java/org/nl/modules/system/wql/sys.xls b/nladmin-system/src/main/java/org/nl/modules/system/wql/sys.xls index b3aa2d521..47e23f404 100644 Binary files a/nladmin-system/src/main/java/org/nl/modules/system/wql/sys.xls and b/nladmin-system/src/main/java/org/nl/modules/system/wql/sys.xls differ diff --git a/nladmin-ui/package.json b/nladmin-ui/package.json index 652c22dfc..22e8b7780 100644 --- a/nladmin-ui/package.json +++ b/nladmin-ui/package.json @@ -33,6 +33,8 @@ "url": "https://github.com/elunez/eladmin/issues" }, "dependencies": { + "@logicflow/core": "^1.1.22", + "@logicflow/extension": "^1.1.22", "@riophae/vue-treeselect": "0.4.0", "af-table-column": "^1.0.3", "axios": "0.18.1", @@ -61,6 +63,7 @@ "screenfull": "4.2.0", "sortablejs": "1.8.4", "vue": "2.6.10", + "vue-color": "^2.8.1", "vue-count-to": "1.0.13", "vue-cropper": "0.4.9", "vue-easy-print": "0.0.8", diff --git a/nladmin-ui/src/api/logicflow/stage.js b/nladmin-ui/src/api/logicflow/stage.js new file mode 100644 index 000000000..7c6c95558 --- /dev/null +++ b/nladmin-ui/src/api/logicflow/stage.js @@ -0,0 +1,50 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/stage', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/stage/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/stage', + method: 'put', + data + }) +} + +export function selectStageList() { + return request({ + url: 'api/stage/selectList', + method: 'get' + }) +} + +export function addNewStage(data) { // 保存舞台数据 + return request({ + url: 'api/stage/addNewStage', + method: 'post', + data + }) +} + +export function getNewStageDataByCode(code) { + return request({ + url: 'api/stage/getNewStageDataByCode', + method: 'post', + data: code + }) +} + +export default { add, edit, del, selectStageList, addNewStage, getNewStageDataByCode } diff --git a/nladmin-ui/src/api/logicflow/stageImage.js b/nladmin-ui/src/api/logicflow/stageImage.js new file mode 100644 index 000000000..20b902def --- /dev/null +++ b/nladmin-ui/src/api/logicflow/stageImage.js @@ -0,0 +1,34 @@ +import request from '@/utils/request' + +export function add(data) { + return request({ + url: 'api/stageImage', + method: 'post', + data + }) +} + +export function del(ids) { + return request({ + url: 'api/stageImage/', + method: 'delete', + data: ids + }) +} + +export function edit(data) { + return request({ + url: 'api/stageImage', + method: 'put', + data + }) +} + +export function selectStageIconList() { + return request({ + url: 'api/stageImage/selectList', + method: 'get' + }) +} + +export default { add, edit, del, selectStageIconList } diff --git a/nladmin-ui/src/api/system/param.js b/nladmin-ui/src/api/system/param.js index 0763489c7..07a8e5c94 100644 --- a/nladmin-ui/src/api/system/param.js +++ b/nladmin-ui/src/api/system/param.js @@ -24,4 +24,12 @@ export function edit(data) { }) } -export default { add, edit, del } +export function getStageCodeByCode(code) { + return request({ + url: 'api/param/getStageCodeByCode', + method: 'post', + data: code + }) +} + +export default { add, edit, del, getStageCodeByCode } diff --git a/nladmin-ui/src/main.js b/nladmin-ui/src/main.js index 1ffa5d8c6..d0fc1eda8 100644 --- a/nladmin-ui/src/main.js +++ b/nladmin-ui/src/main.js @@ -40,6 +40,12 @@ import 'echarts-gl' import 'jquery' +// 全局引入LogicFlow +import LogicFlow from '@logicflow/core' +import { Menu } from '@logicflow/extension' +import '@logicflow/extension/lib/style/index.css' +LogicFlow.use(Menu) + Vue.use(scroll) Vue.use(AFTableColumn) diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/Diagram.vue b/nladmin-ui/src/views/system/logicflow/editor/components/Diagram.vue new file mode 100644 index 000000000..fbd00de05 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/Diagram.vue @@ -0,0 +1,604 @@ + + + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/DiagramSidebar.vue b/nladmin-ui/src/views/system/logicflow/editor/components/DiagramSidebar.vue new file mode 100644 index 000000000..75eb62085 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/DiagramSidebar.vue @@ -0,0 +1,196 @@ + + + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/DiagramToolbar.vue b/nladmin-ui/src/views/system/logicflow/editor/components/DiagramToolbar.vue new file mode 100644 index 000000000..42d0f9821 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/DiagramToolbar.vue @@ -0,0 +1,251 @@ + + + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/PropertyPanel.vue b/nladmin-ui/src/views/system/logicflow/editor/components/PropertyPanel.vue new file mode 100644 index 000000000..b59e078e4 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/PropertyPanel.vue @@ -0,0 +1,375 @@ + + + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Actor.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Actor.vue new file mode 100644 index 000000000..dc3818d88 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Actor.vue @@ -0,0 +1,38 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/AreaSelect.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/AreaSelect.vue new file mode 100644 index 000000000..edb8929ff --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/AreaSelect.vue @@ -0,0 +1,15 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Blod.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Blod.vue new file mode 100644 index 000000000..3444a373b --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Blod.vue @@ -0,0 +1,15 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Circle.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Circle.vue new file mode 100644 index 000000000..b8355a4a8 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Circle.vue @@ -0,0 +1,31 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/ColorFill.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/ColorFill.vue new file mode 100644 index 000000000..1c12d2a92 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/ColorFill.vue @@ -0,0 +1,15 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/ColorText.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/ColorText.vue new file mode 100644 index 000000000..8aa7da1b0 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/ColorText.vue @@ -0,0 +1,15 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Cross.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Cross.vue new file mode 100644 index 000000000..ba015272d --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Cross.vue @@ -0,0 +1,19 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Cylinde.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Cylinde.vue new file mode 100644 index 000000000..c32f508c3 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Cylinde.vue @@ -0,0 +1,27 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Diamond.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Diamond.vue new file mode 100644 index 000000000..ae6e48a3e --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Diamond.vue @@ -0,0 +1,19 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Divide.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Divide.vue new file mode 100644 index 000000000..32bbd4fb5 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Divide.vue @@ -0,0 +1,37 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/DownArrow.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/DownArrow.vue new file mode 100644 index 000000000..01de6a0e6 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/DownArrow.vue @@ -0,0 +1,18 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Ellipse.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Ellipse.vue new file mode 100644 index 000000000..e006feeec --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Ellipse.vue @@ -0,0 +1,21 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Font.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Font.vue new file mode 100644 index 000000000..e9a1bb211 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Font.vue @@ -0,0 +1,15 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Heptagon.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Heptagon.vue new file mode 100644 index 000000000..1f10cb23d --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Heptagon.vue @@ -0,0 +1,19 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Hexagon.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Hexagon.vue new file mode 100644 index 000000000..1a9c5136c --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Hexagon.vue @@ -0,0 +1,19 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/HorizontalArrow.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/HorizontalArrow.vue new file mode 100644 index 000000000..640f85cd0 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/HorizontalArrow.vue @@ -0,0 +1,18 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/LeftArrow.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/LeftArrow.vue new file mode 100644 index 000000000..c62689e2a --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/LeftArrow.vue @@ -0,0 +1,18 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Line.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Line.vue new file mode 100644 index 000000000..d4b7141fa --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Line.vue @@ -0,0 +1,15 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Minus.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Minus.vue new file mode 100644 index 000000000..e8a5c19c7 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Minus.vue @@ -0,0 +1,19 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Parallelogram.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Parallelogram.vue new file mode 100644 index 000000000..1929f7297 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Parallelogram.vue @@ -0,0 +1,19 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Pentagon.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Pentagon.vue new file mode 100644 index 000000000..1f41d424d --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Pentagon.vue @@ -0,0 +1,19 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Rect.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Rect.vue new file mode 100644 index 000000000..5a62bb46d --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Rect.vue @@ -0,0 +1,31 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/RectRadius.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/RectRadius.vue new file mode 100644 index 000000000..ee233aa66 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/RectRadius.vue @@ -0,0 +1,23 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/RightArrow.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/RightArrow.vue new file mode 100644 index 000000000..509914129 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/RightArrow.vue @@ -0,0 +1,18 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Septagon.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Septagon.vue new file mode 100644 index 000000000..af7024203 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Septagon.vue @@ -0,0 +1,19 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/StepBack.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/StepBack.vue new file mode 100644 index 000000000..254da46d0 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/StepBack.vue @@ -0,0 +1,16 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/StepFoward.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/StepFoward.vue new file mode 100644 index 000000000..cd96b6bfb --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/StepFoward.vue @@ -0,0 +1,16 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Table.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Table.vue new file mode 100644 index 000000000..50bdcedab --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Table.vue @@ -0,0 +1,158 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Text.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Text.vue new file mode 100644 index 000000000..c1af1cd52 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Text.vue @@ -0,0 +1,46 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Times.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Times.vue new file mode 100644 index 000000000..cbe890cc5 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Times.vue @@ -0,0 +1,19 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Trapezoid.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Trapezoid.vue new file mode 100644 index 000000000..5d23b928e --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Trapezoid.vue @@ -0,0 +1,19 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/Triangle.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Triangle.vue new file mode 100644 index 000000000..e40db5686 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/Triangle.vue @@ -0,0 +1,19 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/UpArrow.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/UpArrow.vue new file mode 100644 index 000000000..2ce28d72a --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/UpArrow.vue @@ -0,0 +1,19 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/VerticalArrow.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/VerticalArrow.vue new file mode 100644 index 000000000..360d21bc4 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/VerticalArrow.vue @@ -0,0 +1,18 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/ZoomIn.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/ZoomIn.vue new file mode 100644 index 000000000..a52571697 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/ZoomIn.vue @@ -0,0 +1,16 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/icon/ZoomOut.vue b/nladmin-ui/src/views/system/logicflow/editor/components/icon/ZoomOut.vue new file mode 100644 index 000000000..c30a25f24 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/icon/ZoomOut.vue @@ -0,0 +1,16 @@ + + + diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/DownArrowNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/DownArrowNode.js new file mode 100644 index 000000000..e32d3c964 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/DownArrowNode.js @@ -0,0 +1,49 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 下箭头 + +class DownArrowModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 50 + this.height = 80 + } +} +class DownArrowView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowWidth = 1 / 3 * width + const upY = y - 1 / 2 * height + const downY = y + 1 / 2 * height + const downY2 = y + 1 / 5 * height + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + [x - 1 / 2 * ArrowWidth, downY2], + [x - 1 / 2 * width, downY2], + [x, downY], + [x + 1 / 2 * width, downY2], + [x + 1 / 2 * ArrowWidth, downY2], + [x + 1 / 2 * ArrowWidth, upY], + [x - 1 / 2 * ArrowWidth, upY] + ] + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'down-arrow', + view: DownArrowView, + model: DownArrowModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/HorizontalArrowNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/HorizontalArrowNode.js new file mode 100644 index 000000000..0a8bf8098 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/HorizontalArrowNode.js @@ -0,0 +1,56 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 水平双箭头 + +class HorizontalArrowModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 40 + } +} + +class HorizontalArrowView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowHeight = 1 / 3 * height + const leftX = x - 1 / 2 * width + const leftX2 = x - 1 / 5 * width + const rightX = x + 1 / 2 * width + const rightX2 = x + 1 / 5 * width + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + // 右箭头 + [rightX2, y - 1 / 2 * ArrowHeight], + [rightX2, y - 1 / 2 * height], + [rightX, y], + [rightX2, y + 1 / 2 * height], + [rightX2, y + 1 / 2 * ArrowHeight], + // 左箭头 + [leftX2, y + 1 / 2 * ArrowHeight], + [leftX2, y + 1 / 2 * height], + [leftX, y], + [leftX2, y - 1 / 2 * height], + [leftX2, y - 1 / 2 * ArrowHeight] + ] + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'horizontal-arrow', + view: HorizontalArrowView, + model: HorizontalArrowModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/LeftArrow.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/LeftArrow.js new file mode 100644 index 000000000..0405e10f7 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/LeftArrow.js @@ -0,0 +1,48 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 左箭头 +class LeftArrowModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 50 + } +} +class LeftArrowView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowHeight = 1 / 3 * height + const leftX = x - 1 / 2 * width + const leftX2 = x - 1 / 5 * width + const rightX = x + 1 / 2 * width + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + [leftX2, y - 1 / 2 * ArrowHeight], + [leftX2, y - 1 / 2 * height], + [leftX, y], + [leftX2, y + 1 / 2 * height], + [leftX2, y + 1 / 2 * ArrowHeight], + [rightX, y + 1 / 2 * ArrowHeight], + [rightX, y - 1 / 2 * ArrowHeight] + ] + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'left-arrow', + view: LeftArrowView, + model: LeftArrowModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/RightArrow.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/RightArrow.js new file mode 100644 index 000000000..f963d0e3c --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/RightArrow.js @@ -0,0 +1,50 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 右箭头 + +class RightArrowModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 50 + } +} + +class RightArrowView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowHeight = 1 / 3 * height + const leftX = x - 1 / 2 * width + const rightX = x + 1 / 2 * width + const rightX2 = x + 1 / 5 * width + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + [rightX2, y - 1 / 2 * ArrowHeight], + [rightX2, y - 1 / 2 * height], + [rightX, y], + [rightX2, y + 1 / 2 * height], + [rightX2, y + 1 / 2 * ArrowHeight], + [leftX, y + 1 / 2 * ArrowHeight], + [leftX, y - 1 / 2 * ArrowHeight] + ] + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'right-arrow', + view: RightArrowView, + model: RightArrowModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/UpArrowNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/UpArrowNode.js new file mode 100644 index 000000000..ae9b53864 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/UpArrowNode.js @@ -0,0 +1,49 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 上箭头 +class UpArrowModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 50 + this.height = 80 + } +} + +class UpArrowView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowWidth = 1 / 3 * width + const upY = y - 1 / 2 * height + const upY2 = y - 1 / 5 * height + const downY = y + 1 / 2 * height + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + [x - 1 / 2 * ArrowWidth, upY2], + [x - 1 / 2 * width, upY2], + [x, upY], + [x + 1 / 2 * width, upY2], + [x + 1 / 2 * ArrowWidth, upY2], + [x + 1 / 2 * ArrowWidth, downY], + [x - 1 / 2 * ArrowWidth, downY] + ] + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'up-arrow', + view: UpArrowView, + model: UpArrowModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/VerticalArrowNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/VerticalArrowNode.js new file mode 100644 index 000000000..0a0fa261a --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/arrow/VerticalArrowNode.js @@ -0,0 +1,56 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 竖直箭头 + +class VerticalArrowModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 40 + this.height = 80 + } +} + +class VerticalArrowView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const ArrowWidth = 1 / 3 * width + const upY = y - 1 / 2 * height + const upY2 = y - 1 / 5 * height + const downY = y + 1 / 2 * height + const downY2 = y + 1 / 5 * height + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + // 上箭头 + [x - 1 / 2 * ArrowWidth, upY2], + [x - 1 / 2 * width, upY2], + [x, upY], + [x + 1 / 2 * width, upY2], + [x + 1 / 2 * ArrowWidth, upY2], + // 下箭头 + [x + 1 / 2 * ArrowWidth, downY2], + [x + 1 / 2 * width, downY2], + [x, downY], + [x - 1 / 2 * width, downY2], + [x - 1 / 2 * ArrowWidth, downY2] + ] + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'vertical-arrow', + view: VerticalArrowView, + model: VerticalArrowModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/BaseNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/BaseNode.js new file mode 100644 index 000000000..6c297ce81 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/BaseNode.js @@ -0,0 +1,16 @@ +import { BaseNode, BaseNodeModel } from '@logicflow/core' + +class BaseNewNode extends BaseNode { +} + +class BaseNewModel extends BaseNodeModel { + setAttributes() { + this.fill = 'red' + } +} + +export default { + type: 'BaseNode', + view: BaseNewNode, + model: BaseNewModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/CircleNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/CircleNode.js new file mode 100644 index 000000000..cc37250e3 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/CircleNode.js @@ -0,0 +1,33 @@ +import { EllipseResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 圆形 +class CircleNewModel extends EllipseResize.model { + initNodeData(data) { + super.initNodeData(data) + this.rx = 35 + this.ry = 35 + } + + setToBottom() { + this.zIndex = 0 + } + + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +export default { + type: 'pro-circle', + view: EllipseResize.view, + model: CircleNewModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/DiamondNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/DiamondNode.js new file mode 100644 index 000000000..38dc3152f --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/DiamondNode.js @@ -0,0 +1,35 @@ +import { DiamondResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 菱形 +/** + * model控制初始化的值 + */ +class DiamondModel extends DiamondResize.model { + initNodeData(data) { + super.initNodeData(data) + this.rx = 35 + this.ry = 35 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } + + setToBottom() { + this.zIndex = 0 + } +} + +export default { + type: 'pro-diamond', + view: DiamondResize.view, + model: DiamondModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/EllipseNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/EllipseNode.js new file mode 100644 index 000000000..c2976389c --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/EllipseNode.js @@ -0,0 +1,19 @@ +import CircleNode from './CircleNode' + +// 椭圆 +class EllipseNewModel extends CircleNode.model { + initNodeData(data) { + super.initNodeData(data) + this.rx = 60 + this.ry = 30 + } + getNodeStyle() { + const style = super.getNodeStyle() + return { ...style } + } +} +export default { + type: 'pro-ellipse', + view: CircleNode.view, + model: EllipseNewModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/RectNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/RectNode.js new file mode 100644 index 000000000..ee242e26d --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/RectNode.js @@ -0,0 +1,27 @@ +import { RectResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 矩形 +class RectNewModel extends RectResize.model { + setToBottom() { + this.zIndex = 0 + } + + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +export default { + type: 'pro-rect', + view: RectResize.view, + model: RectNewModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/RectRadiusNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/RectRadiusNode.js new file mode 100644 index 000000000..9a336d63a --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/RectRadiusNode.js @@ -0,0 +1,14 @@ +import RectNode from './RectNode' + +// 带圆角的矩形 +class RectRadiusModel extends RectNode.model { + setAttributes() { + super.setAttributes() + this.radius = 20 + } +} +export default { + type: 'rect-radius', + view: RectNode.view, + model: RectRadiusModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/TextNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/TextNode.js new file mode 100644 index 000000000..b3a091170 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/basic/TextNode.js @@ -0,0 +1,37 @@ +import { TextNodeModel, TextNode } from '@logicflow/core' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 文本节点 +class TextNewNode extends TextNode { +} +class TextNewModel extends TextNodeModel { + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + if (properties.backgroundColor) { + style.backgroundStyle = { + fill: properties.backgroundColor + } + } + return getTextStyleFunction(style, properties) + } + + setAttributes() { + super.setAttributes() + if (!this.text.value) { + this.text.value = 'text' + } + } +} + +export default { + type: 'pro-text', + view: TextNewNode, + model: TextNewModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/edge/Bezier.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/edge/Bezier.js new file mode 100644 index 000000000..ecfc48eb9 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/edge/Bezier.js @@ -0,0 +1,26 @@ +import { BezierEdge, BezierEdgeModel } from '@logicflow/core' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 贝塞尔曲线 +class Model extends BezierEdgeModel { + constructor(data, graphModel) { + super(data, graphModel) + this.strokeWidth = 1 + } + getTextStyle() { + const style = super.getTextStyle() + return getTextStyleFunction(style, this.properties) + } + + getEdgeStyle() { + const attributes = super.getEdgeStyle() + const properties = this.properties + const style = getShapeStyleFuction(attributes, properties) + return { ...style, fill: 'none' } + } +} +export default { + type: 'pro-bezier', + view: BezierEdge, + model: Model +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/edge/Line.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/edge/Line.js new file mode 100644 index 000000000..c5ef06e0a --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/edge/Line.js @@ -0,0 +1,26 @@ +import { LineEdge, LineEdgeModel } from '@logicflow/core' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 直线 +class Model extends LineEdgeModel { + constructor(data, graphModel) { + super(data, graphModel) + this.strokeWidth = 1 + } + getTextStyle() { + const style = super.getTextStyle() + return getTextStyleFunction(style, this.properties) + } + + getEdgeStyle() { + const attributes = super.getEdgeStyle() + const properties = this.properties + const style = getShapeStyleFuction(attributes, properties) + return { ...style, fill: 'none' } + } +} +export default { + type: 'pro-line', + view: LineEdge, + model: Model +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/edge/Polyline.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/edge/Polyline.js new file mode 100644 index 000000000..86d53c295 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/edge/Polyline.js @@ -0,0 +1,26 @@ +import { PolylineEdge, PolylineEdgeModel } from '@logicflow/core' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 折线 +class Model extends PolylineEdgeModel { + constructor(data, graphModel) { + super(data, graphModel) + this.strokeWidth = 1 + } + getTextStyle() { + const style = super.getTextStyle() + return getTextStyleFunction(style, this.properties) + } + + getEdgeStyle() { + const attributes = super.getEdgeStyle() + const properties = this.properties + const style = getShapeStyleFuction(attributes, properties) + return { ...style, fill: 'none' } + } +} +export default { + type: 'pro-polyline', + view: PolylineEdge, + model: Model +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/getShapeStyleUtil.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/getShapeStyleUtil.js new file mode 100644 index 000000000..ccea7ddc5 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/getShapeStyleUtil.js @@ -0,0 +1,70 @@ +export const getShapeStyleFuction = (style, properties) => { + if (properties.backgroundColor) { + style.fill = properties.backgroundColor + } + if (properties.transform) { // 旋转 + style.transform = properties.transform + } + if (properties.imageWidth) { // 宽度 + style.imageWidth = properties.imageWidth + } + if (properties.imageHeight) { // 高度 + style.imageHeight = properties.imageHeight + } + if (properties.gradientColor && style.fill !== properties.gradientColor) { + style.fillGradient = properties.gradientColor + } + if (properties.borderColor) { + style.stroke = properties.borderColor + } + if (properties.borderWidth) { + style.strokeWidth = properties.borderWidth + } + if (properties.borderStyle) { + if (properties.borderStyle === 'solid') { + style.strokeDashArray = '0' + // nodeResize里的bug导致的,array小写了 + style.strokeDasharray = '0' + } + if (properties.borderStyle === 'dashed') { + style.strokeDashArray = '3 3' + style.strokeDasharray = '3 3' + } + if (properties.borderStyle === 'dotted') { + style.strokeDashArray = '1 1' + style.strokeDasharray = '1 1' + } + if (properties.borderStyle === 'hidden') { + style.stroke = style.fill + } + } + return style +} + +export const getTextStyleFunction = (style = {}, properties) => { + if (properties.fontColor) { + style.color = properties.fontColor + } + if (properties.fontSize) { + style.fontSize = properties.fontSize + } + if (properties.fontFamily) { + style.fontFamily = properties.fontFamily + } + if (properties.lineHeight) { + style.lineHeight = properties.lineHeight + } + if (properties.textAlign) { + style.textAlign = properties.textAlign + } + if (properties.fontWeight) { + style.fontWeight = properties.fontWeight + } + if (properties.textDecoration) { + style.textDecoration = properties.textDecoration + } + if (properties.fontStyle) { + style.fontStyle = properties.fontStyle + } + return style +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/html/htmlNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/html/htmlNode.js new file mode 100644 index 000000000..bbd4d84d9 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/html/htmlNode.js @@ -0,0 +1,89 @@ +import { HtmlResize } from '@logicflow/extension' +import defaultUrl from '../../../image/agv.svg' +import api from '@/store/modules/api' +import tray from '../../../image/托盘.svg' +import icon_alert from '../../../image/icon_alert.png' +class ButtonNodeModel extends HtmlResize.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 100 + this.height = 100 + this.text.draggable = true + this.text.editable = false + } +} + +class ButtonNode extends HtmlResize.view { + setHtml(rootEl) { + /** + * 自己设置的宽高在 imageHeight/imageWidth + * 用拖动设置的宽高在 properties.nodeSize.height/properties.nodeSize.width + */ + const oldNode = this.props.model + const properties = oldNode.getProperties() + // console.log(properties) + // console.log('oldNode', oldNode) + // 路径前缀 + const baseUrl = api.state.baseApi + // 颜色 + let statusColor = '#1a912a' + // 默认图片 + // let imageUrl = baseUrl + '/file/图片/专机-20220722094234555.png' + let imageUrl = defaultUrl + // 托盘图片 + const goods = tray + const trayHeight = Math.round(2 / 3 * oldNode._height) + const trayWidth = Math.round(2 / 3 * oldNode._width) + let trayDisplay = 'none' + // 故障图片 + const fault = icon_alert + let faultDisplay = 'none' + if (properties.imageUrl) { // 与图片尾部拼接 + imageUrl = baseUrl + '/file/图片/' + properties.imageUrl + } + if (!properties.transform) { // 如果没有值,设置默认为0度 + properties.transform = 0 + } + if (properties.isOnline) { + statusColor = '#54dc5f' + } + if (!properties.device) { + statusColor = 'rgba(255,255,255,0)' + } + if (properties.hasGoods) { + // 显示图片,并设置宽高 + trayDisplay = 'flex' + } + if (properties.isError) { + // 显示图片,并设置宽高 + faultDisplay = 'flex' + } + if (properties.isLock !== undefined) { + oldNode.draggable = !properties.isLock + } + const el = document.createElement('div') + el.className = 'uml-wrapper' + // el.id = 'uml-app' + const html = ` +
+
+ + + +
+ ` + el.innerHTML = html + rootEl.innerHTML = '' + rootEl.appendChild(el) + window.setData = () => { + const { graphModel, model } = this.props + graphModel.eventCenter.emit('custom:button-click', model) + } + } +} + +export default { + type: 'html-node', + view: ButtonNode, + model: ButtonNodeModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/index.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/index.js new file mode 100644 index 000000000..ec1544aed --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/index.js @@ -0,0 +1,74 @@ +// 导入组件并且注册 +// 基础图形 +import CircleNode from './basic/CircleNode' +import RectNode from './basic/RectNode' +import RectRadiusNode from './basic/RectRadiusNode' +import EllipseNode from './basic/EllipseNode' +import TextNode from './basic/TextNode' +import DiamondNode from './basic/DiamondNode' +// path绘制的个性化图形 +import CylindeNode from './path/CylindeNode' +import TriangleNode from './path/TriangleNode' +import ParallelogramNode from './path/ParallelogramNode' +import ActorNode from './path/ActorNode' +import StarNode from './path/Star' +import PentagonNode from './path/PentagonNode' +import HexagonNode from './path/HexagonNode' +import SeptagonNode from './path/SeptagonNode' +import HeptagonNode from './path/HeptagonNode' +import TrapezoidNode from './path/TrapezoidNode' +import CrossNode from './path/CrossNode' +import MinusNode from './path/MinusNode' +import TimesNode from './path/TimesNode' +import DivideNode from './path/DivideNode' +// 多边形绘制的箭头 +import LeftArrow from './arrow/LeftArrow' +import RightArrow from './arrow/RightArrow' +import HorizontalArrow from './arrow/HorizontalArrowNode' +import UpArrow from './arrow/UpArrowNode' +import DownArrow from './arrow/DownArrowNode' +import VerticalArrow from './arrow/VerticalArrowNode' +// 注册边 +import Ployline from './edge/Polyline' +import Line from './edge/Line' +import Bezier from './edge/Bezier' +// html图片 +import HtmlNode from './html/htmlNode' + +export const registerCustomElement = (lf) => { + // 注册基础图形 + lf.register(CircleNode) + lf.register(RectNode) + lf.register(RectRadiusNode) + lf.register(EllipseNode) + lf.register(DiamondNode) + lf.register(TextNode) + // 注册path绘制的个性化图形 + lf.register(CylindeNode) + lf.register(TriangleNode) + lf.register(ParallelogramNode) + lf.register(ActorNode) + lf.register(StarNode) + lf.register(PentagonNode) + lf.register(HexagonNode) + lf.register(SeptagonNode) + lf.register(HeptagonNode) + lf.register(TrapezoidNode) + lf.register(CrossNode) + lf.register(MinusNode) + lf.register(TimesNode) + lf.register(DivideNode) + // 注册多边形绘制的箭头 + lf.register(LeftArrow) + lf.register(RightArrow) + lf.register(HorizontalArrow) + lf.register(UpArrow) + lf.register(DownArrow) + lf.register(VerticalArrow) + // 注册边 + lf.register(Ployline) + lf.register(Line) + lf.register(Bezier) + // 注册html结点 + lf.register(HtmlNode) +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/ActorNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/ActorNode.js new file mode 100644 index 000000000..718e51172 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/ActorNode.js @@ -0,0 +1,95 @@ +import { h } from '@logicflow/core' +import { RectResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' +// 人物 +class ActorModel extends RectResize.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 40 + this.height = 80 + } + + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class ActorView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + // 人物头部圆形 + const ellipseAttrs = { + ...style, + cx: x, + cy: y - 3 / 8 * height, + rx: 1 / 4 * width, + ry: 1 / 8 * height, + width, + height + } + // 人物肩膀横线 + const pathAAttrs = { + ...style, + d: `M ${x - 1 / 2 * width} ${y - 1 / 8 * height} L ${x + 1 / 2 * width} ${y - 1 / 8 * height}` + } + // 人物身体躯干竖线 + const pathBAttrs = { + ...style, + d: `M ${x} ${y - 1 / 4 * height} L ${x} ${y + 1 / 5 * height}` + } + // 人物左腿斜线 + const pathCAttrs = { + ...style, + d: `M ${x} ${y + 1 / 5 * height} L ${x - 1 / 2 * width} ${y + 1 / 2 * height}` + } + // 人物右腿斜线 + const pathDAttrs = { + ...style, + d: `M ${x} ${y + 1 / 5 * height} L ${x + 1 / 2 * width} ${y + 1 / 2 * height}` + } + // 人物透明背景板 + const bgAttrs = { + x: x - 1 / 5 * width, + y: y - 1 / 2 * height, + width: 2 / 5 * width, + height, + style: 'fill: transparent' + } + return h('g', {}, [ + h('ellipse', { + ...ellipseAttrs + }), + h('path', { + ...pathAAttrs + }), + h('path', { + ...pathBAttrs + }), + h('path', { + ...pathCAttrs + }), + h('path', { + ...pathDAttrs + }), + h('rect', { + ...bgAttrs + }) + ] + ) + } +} + +export default { + type: 'actor', + view: ActorView, + model: ActorModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/CrossNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/CrossNode.js new file mode 100644 index 000000000..a9b4bbc71 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/CrossNode.js @@ -0,0 +1,65 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 加号 +class CrossModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class CrossView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 1 / 2 * width, y - 1 / 6 * height], + [x - 1 / 6 * width, y - 1 / 6 * height], + [x - 1 / 6 * width, y - 1 / 2 * height], + [x + 1 / 6 * width, y - 1 / 2 * height], + [x + 1 / 6 * width, y - 1 / 6 * height], + [x + 1 / 2 * width, y - 1 / 6 * height], + [x + 1 / 2 * width, y + 1 / 6 * height], + [x + 1 / 6 * width, y + 1 / 6 * height], + [x + 1 / 6 * width, y + 1 / 2 * height], + [x - 1 / 6 * width, y + 1 / 2 * height], + [x - 1 / 6 * width, y + 1 / 6 * height], + [x - 1 / 2 * width, y + 1 / 6 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'cross', + view: CrossView, + model: CrossModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/CylindeNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/CylindeNode.js new file mode 100644 index 000000000..a719c7e30 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/CylindeNode.js @@ -0,0 +1,92 @@ +import { h } from '@logicflow/core' +import { RectResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 圆柱体 +class CylindeModel extends RectResize.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 60 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class CylindeView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + // 圆柱体顶部椭圆 + const ellipseAAttrs = { + ...style, + cx: x, + cy: y - 1 / 3 * height, + rx: 1 / 2 * width, + ry: 1 / 6 * height, + width, + height + } + // 圆柱体左直线 + const pathAAttrs = { + ...style, + d: `M ${x - 1 / 2 * width} ${y - 1 / 3 * height} L ${x - 1 / 2 * width} ${y + 1 / 3 * height}` + } + // 圆柱体右直线 + const pathBAttrs = { + ...style, + d: `M ${x + 1 / 2 * width} ${y - 1 / 3 * height} L ${x + 1 / 2 * width} ${y + 1 / 3 * height}` + } + // 圆柱体下椭圆 + const ellipseBAttrs = { + ...style, + cx: x, + cy: y + 1 / 3 * height, + rx: 1 / 2 * width, + ry: 1 / 6 * height, + width, + height + } + // 圆柱体中间填充部分 + const rectAttrs = { + ...style, + x: x - 1 / 2 * width, + y: y - 1 / 3 * height, + width, + height: 2 / 3 * height, + stroke: 'transparent' + } + return h('g', {}, [ + h('ellipse', { + ...ellipseBAttrs + }), + h('rect', { + ...rectAttrs + }), + h('path', { + ...pathAAttrs + }), + h('path', { + ...pathBAttrs + }), + h('ellipse', { + ...ellipseAAttrs + }) + ]) + } +} + +export default { + type: 'cylinde', + model: CylindeModel, + view: CylindeView +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/DivideNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/DivideNode.js new file mode 100644 index 000000000..1fa2d9896 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/DivideNode.js @@ -0,0 +1,83 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 除号 +class DivideModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class DivideView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 1 / 2 * width, y - 1 / 8 * height], + [x + 1 / 2 * width, y - 1 / 8 * height], + [x + 1 / 2 * width, y + 1 / 8 * height], + [x - 1 / 2 * width, y + 1 / 8 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + + const attrs = { + ...style, + x, + y, + width, + height + } + + // 除号中间横线 + const lineAttrs = { + ...attrs, + points: points.join(' ') + } + + // 除号上圆点 + const upEllipseAttrs = { + ...attrs, + cy: y - 3 / 8 * height, + cx: x, + rx: 1 / 8 * width, + ry: 1 / 8 * height + } + + // 除号下圆点 + const downEllipseAttrs = { + ...attrs, + cy: y + 3 / 8 * height, + cx: x, + rx: 1 / 8 * width, + ry: 1 / 8 * height + } + + return h('g', {}, [ + h('polygon', { ...lineAttrs }), + h('ellipse', { ...upEllipseAttrs }), + h('ellipse', { ...downEllipseAttrs }) + ]) + } +} + +export default { + type: 'divide', + view: DivideView, + model: DivideModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/HeptagonNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/HeptagonNode.js new file mode 100644 index 000000000..b28d42b1f --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/HeptagonNode.js @@ -0,0 +1,61 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 五边形 +class HeptagonModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class HeptagonView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 0.205 * width, y - 0.5 * height], + [x + 0.205 * width, y - 0.5 * height], + [x + 0.5 * width, y - 0.205 * height], + [x + 0.5 * width, y + 0.205 * height], + [x + 0.205 * width, y + 0.5 * height], + [x - 0.205 * width, y + 0.5 * height], + [x - 0.5 * width, y + 0.205 * height], + [x - 0.5 * width, y - 0.205 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'heptagon', + view: HeptagonView, + model: HeptagonModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/HexagonNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/HexagonNode.js new file mode 100644 index 000000000..a0e281fbb --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/HexagonNode.js @@ -0,0 +1,59 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 六边形 +class HexagonModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class HexagonView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 0.28 * width, y - 0.5 * height], + [x + 0.28 * width, y - 0.5 * height], + [x + 0.5 * width, y], + [x + 0.28 * width, y + 0.5 * height], + [x - 0.28 * width, y + 0.5 * height], + [x - 0.5 * width, y] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'hexagon', + view: HexagonView, + model: HexagonModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/MinusNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/MinusNode.js new file mode 100644 index 000000000..5f29f1e27 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/MinusNode.js @@ -0,0 +1,57 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 减号 +class MinusModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 20 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class MinusView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 1 / 2 * width, y - 1 / 2 * height], + [x + 1 / 2 * width, y - 1 / 2 * height], + [x + 1 / 2 * width, y + 1 / 2 * height], + [x - 1 / 2 * width, y + 1 / 2 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'minus', + view: MinusView, + model: MinusModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/ParallelogramNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/ParallelogramNode.js new file mode 100644 index 000000000..96b07f882 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/ParallelogramNode.js @@ -0,0 +1,57 @@ +import { h } from '@logicflow/core' +import { RectResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 平行四边形 +class ParallelogramModel extends RectResize.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 100 + this.height = 60 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class ParallelogramView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - width / 2, y + height / 2], + [x - width / 5, y - height / 2], + [x + width / 2, y - height / 2], + [x + width / 5, y + height / 2] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'parallelogram', + view: ParallelogramView, + model: ParallelogramModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/PentagonNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/PentagonNode.js new file mode 100644 index 000000000..0bf20aad3 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/PentagonNode.js @@ -0,0 +1,58 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 八边形 +class PentagonModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class PentagonView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 0.5 * width, y], + [x, y - 0.5 * height], + [x + 0.5 * width, y], + [x + 0.3 * width, y + 0.5 * height], + [x - 0.3 * width, y + 0.5 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'pentagon', + view: PentagonView, + model: PentagonModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/SeptagonNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/SeptagonNode.js new file mode 100644 index 000000000..9ea030a49 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/SeptagonNode.js @@ -0,0 +1,60 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 七边形 +class SeptagonModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class SeptagonView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x, y - 0.5 * height], + [x + 0.395 * width, y - 0.3 * height], + [x + 0.5 * width, y + 0.145 * height], + [x + 0.225 * width, y + 0.5 * height], + [x - 0.225 * width, y + 0.5 * height], + [x - 0.5 * width, y + 0.145 * height], + [x - 0.395 * width, y - 0.3 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'septagon', + view: SeptagonView, + model: SeptagonModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/Star.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/Star.js new file mode 100644 index 000000000..28eaededc --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/Star.js @@ -0,0 +1,40 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' + +// 五角星 +class StarModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } +} + +class StarView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const svgAttr = { + x: x - 1 / 2 * width, + y: y - 1 / 2 * height, + width, + height + } + const pathAAttrs = { + ...style, + d: 'm0.36922,13.46587l12.98695,0l4.01307,-13.36885l4.01307,13.36885l12.98694,0l-10.50664,8.26231l4.01327,13.36885l-10.50665,-8.26253l-10.50664,8.26253l4.01327,-13.36885l-10.50665,-8.26231l0,0z' + } + + return h('svg', { ...svgAttr, viewBox: '0 0 37 37' }, [ + h('path', { + ...pathAAttrs + }) + ]) + } +} + +export default { + type: 'star', + view: StarView, + model: StarModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/TimesNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/TimesNode.js new file mode 100644 index 000000000..6d67a2fc1 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/TimesNode.js @@ -0,0 +1,65 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 乘号 +class TimesModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class TimesView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 1 / 2 * width, y - 1 / 3 * height], + [x - 1 / 3 * width, y - 1 / 2 * height], + [x, y - 1 / 6 * height], + [x + 1 / 3 * width, y - 1 / 2 * height], + [x + 1 / 2 * width, y - 1 / 3 * height], + [x + 1 / 6 * width, y], + [x + 1 / 2 * width, y + 1 / 3 * height], + [x + 1 / 3 * width, y + 1 / 2 * height], + [x, y + 1 / 6 * height], + [x - 1 / 3 * width, y + 1 / 2 * height], + [x - 1 / 2 * width, y + 1 / 3 * height], + [x - 1 / 6 * width, y] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'times', + view: TimesView, + model: TimesModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/TrapezoidNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/TrapezoidNode.js new file mode 100644 index 000000000..3ffe197b4 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/TrapezoidNode.js @@ -0,0 +1,57 @@ +import { h } from '@logicflow/core' +import RectNode from '../basic/RectNode' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 五边形 +class TrapezoidModel extends RectNode.model { + initNodeData(data) { + super.initNodeData(data) + this.width = 80 + this.height = 80 + } + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class TrapezoidView extends RectNode.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const pointList = [ + [x - 0.31 * width, y - 0.5 * height], + [x + 0.31 * width, y - 0.5 * height], + [x + 0.5 * width, y + 0.5 * height], + [x - 0.5 * width, y + 0.5 * height] + ] + const points = pointList.map(item => { + return `${item[0]},${item[1]}` + }) + const attrs = { + ...style, + x, + y, + width, + height, + points: points.join(' ') + } + + return h('g', {}, [ + h('polygon', { ...attrs }) + ]) + } +} + +export default { + type: 'trapezoid', + view: TrapezoidView, + model: TrapezoidModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/components/node/path/TriangleNode.js b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/TriangleNode.js new file mode 100644 index 000000000..67ff9e369 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/components/node/path/TriangleNode.js @@ -0,0 +1,47 @@ +import { h } from '@logicflow/core' +import { RectResize } from '@logicflow/extension' +import { getShapeStyleFuction, getTextStyleFunction } from '../getShapeStyleUtil' + +// 三角形 +class TriangleModel extends RectResize.model { + getNodeStyle() { + const style = super.getNodeStyle() + const properties = this.getProperties() + return getShapeStyleFuction(style, properties) + } + + getTextStyle() { + const style = super.getTextStyle() + const properties = this.getProperties() + return getTextStyleFunction(style, properties) + } +} + +class TriangleView extends RectResize.view { + getResizeShape() { + const { x, y, width, height } = this.props.model + const style = this.props.model.getNodeStyle() + const attrs = { + ...style, + x, + y, + width, + height, + points: [ + [x - width / 2, y + height / 2], + [x - width / 2, y - height / 2], + [x + width / 2, y] + ] + } + return h('g', {}, [ + h('polygon', { ...attrs }) + ] + ) + } +} + +export default { + type: 'triangle', + view: TriangleView, + model: TriangleModel +} diff --git a/nladmin-ui/src/views/system/logicflow/editor/constant/index.js b/nladmin-ui/src/views/system/logicflow/editor/constant/index.js new file mode 100644 index 000000000..710a725bf --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/constant/index.js @@ -0,0 +1,69 @@ +export const shortStyles = [ + { + backgroundColor: 'rgb(255, 255, 255)', + borderWidth: '1px', + borderColor: 'rgb(42, 42, 42)' + }, + { + backgroundColor: 'rgb(245, 245, 245)', + borderWidth: '1px', + borderColor: 'rgb(102, 102, 102)' + }, + { + backgroundColor: 'rgb(218, 232, 252)', + borderWidth: '1px', + borderColor: 'rgb(108, 142, 191)' + }, + { + backgroundColor: 'rgb(213, 232, 212)', + borderWidth: '1px', + borderColor: 'rgb(130, 179, 102)' + }, + { + backgroundColor: 'rgb(255, 230, 204)', + borderWidth: '1px', + borderColor: 'rgb(215, 155, 0)' + }, + { + backgroundColor: 'rgb(255, 242, 204)', + borderWidth: '1px', + borderColor: 'rgb(214, 182, 86)' + }, + { + backgroundColor: 'rgb(248, 206, 204)', + borderWidth: '1px', + borderColor: 'rgb(184, 84, 80)' + }, + { + backgroundColor: 'rgb(220, 210, 230)', + borderWidth: '1px', + borderColor: 'rgb(150, 115, 166)' + } +] + +export const borderStyles = [ + { + value: 'solid' + }, + { + value: 'dashed' + }, + { + value: 'dotted' + } +] + +export const fontFamilies = [ + { + value: 'Arial' + }, + { + value: 'Verdana' + }, + { + value: 'Georgia' + }, + { + value: 'Times New Roman' + } +] diff --git a/nladmin-ui/src/views/system/logicflow/editor/image/agv.svg b/nladmin-ui/src/views/system/logicflow/editor/image/agv.svg new file mode 100644 index 000000000..d7a91d45e --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/image/agv.svg @@ -0,0 +1,60 @@ + + + + agv@1x + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/nladmin-ui/src/views/system/logicflow/editor/image/icon_alert.png b/nladmin-ui/src/views/system/logicflow/editor/image/icon_alert.png new file mode 100644 index 000000000..c224792e5 Binary files /dev/null and b/nladmin-ui/src/views/system/logicflow/editor/image/icon_alert.png differ diff --git a/nladmin-ui/src/views/system/logicflow/editor/image/托盘.svg b/nladmin-ui/src/views/system/logicflow/editor/image/托盘.svg new file mode 100644 index 000000000..552024a41 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/image/托盘.svg @@ -0,0 +1,14 @@ + + + + 托盘@1x + Created with Sketch. + + + + + + + + + \ No newline at end of file diff --git a/nladmin-ui/src/views/system/logicflow/editor/index.vue b/nladmin-ui/src/views/system/logicflow/editor/index.vue new file mode 100644 index 000000000..4b0e21381 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/editor/index.vue @@ -0,0 +1,34 @@ + + + + + + diff --git a/nladmin-ui/src/views/system/logicflow/image/index.vue b/nladmin-ui/src/views/system/logicflow/image/index.vue new file mode 100644 index 000000000..6c1eb6492 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/image/index.vue @@ -0,0 +1,310 @@ + + + + + diff --git a/nladmin-ui/src/views/system/logicflow/index.vue b/nladmin-ui/src/views/system/logicflow/index.vue new file mode 100644 index 000000000..cc41a4640 --- /dev/null +++ b/nladmin-ui/src/views/system/logicflow/index.vue @@ -0,0 +1,129 @@ + + + + + diff --git a/nladmin-ui/src/views/system/monitor/device/XJDeviceMonitor.vue b/nladmin-ui/src/views/system/monitor/device/XJDeviceMonitor.vue new file mode 100644 index 000000000..f6a8a1609 --- /dev/null +++ b/nladmin-ui/src/views/system/monitor/device/XJDeviceMonitor.vue @@ -0,0 +1,223 @@ + + + + + diff --git a/nladmin-ui/src/views/system/monitor/device/index.vue b/nladmin-ui/src/views/system/monitor/device/index.vue new file mode 100644 index 000000000..7f6596baf --- /dev/null +++ b/nladmin-ui/src/views/system/monitor/device/index.vue @@ -0,0 +1,154 @@ + + + + + +