Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
package org.nl.acs.region.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class PageBean<T> implements Serializable {
|
||||
private long total; //总记录数
|
||||
|
||||
private List<T> records; //当前页数据集合
|
||||
}
|
||||
@@ -14,20 +14,14 @@ import java.math.BigDecimal;
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@TableName("acs_region")
|
||||
public class Region implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String id;
|
||||
private Long id;
|
||||
|
||||
|
||||
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private String region_id;
|
||||
|
||||
|
||||
@NotBlank
|
||||
private String region_code;
|
||||
|
||||
@@ -44,9 +38,6 @@ public class Region implements Serializable {
|
||||
@NotBlank
|
||||
private String has_agv;
|
||||
|
||||
|
||||
@NotBlank
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String create_by;
|
||||
|
||||
|
||||
@@ -55,8 +46,7 @@ public class Region implements Serializable {
|
||||
private String create_time;
|
||||
|
||||
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String update_by;
|
||||
private String update_user;
|
||||
|
||||
private String update_time;
|
||||
|
||||
|
||||
@@ -1,9 +1,52 @@
|
||||
package org.nl.acs.region.rest;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.nl.acs.region.service.RegionService;
|
||||
import org.nl.acs.region.service.dto.RegionDto;
|
||||
import org.nl.common.logging.annotation.Log;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
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;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("/api/region")
|
||||
@Slf4j
|
||||
public class RegionController {
|
||||
@Autowired
|
||||
private RegionService regionService;
|
||||
|
||||
@GetMapping
|
||||
@Log("查询自定义策略")
|
||||
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
|
||||
return new ResponseEntity<>(regionService.queryAll(whereJson, page), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增自定义策略基础信息")
|
||||
public ResponseEntity<Object> create(@Validated @RequestBody RegionDto dto) {
|
||||
regionService.create(dto);
|
||||
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改自定义策略")
|
||||
public ResponseEntity<Object> update(@Validated @RequestBody RegionDto dto) {
|
||||
regionService.update(dto);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@Log("删除自定义策略")
|
||||
@DeleteMapping
|
||||
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
|
||||
regionService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -2,11 +2,24 @@ package org.nl.acs.region.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import org.nl.acs.common.base.CommonService;
|
||||
import org.nl.acs.common.base.PageInfo;
|
||||
import org.nl.acs.custompolicy.server.dto.CustomPolicyDTO;
|
||||
import org.nl.acs.region.domain.Region;
|
||||
import org.nl.acs.region.service.dto.RegionDto;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
public interface RegionService extends CommonService<Region> {
|
||||
JSONArray queryAllRegions();
|
||||
|
||||
Region findByCode(String code);
|
||||
|
||||
PageInfo<RegionDto> queryAll(Map whereJson, Pageable page);
|
||||
|
||||
void create(RegionDto dto);
|
||||
|
||||
void update(RegionDto dto);
|
||||
|
||||
void deleteAll(String[] ids);
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ public class RegionDto implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
private String region_code;
|
||||
|
||||
|
||||
@@ -33,7 +35,7 @@ public class RegionDto implements Serializable {
|
||||
private String create_time;
|
||||
|
||||
|
||||
private String update_by;
|
||||
private String update_user;
|
||||
|
||||
private String update_time;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package org.nl.acs.region.service.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class RegionPageDTO {
|
||||
private Integer page = 1;
|
||||
private Integer pageSize = 5;
|
||||
}
|
||||
@@ -1,26 +1,42 @@
|
||||
package org.nl.acs.region.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.nl.acs.auto.initial.ApplicationAutoInitial;
|
||||
import org.nl.acs.common.base.CommonFinalParam;
|
||||
import org.nl.acs.common.base.PageInfo;
|
||||
import org.nl.acs.common.base.impl.CommonServiceImpl;
|
||||
import org.nl.acs.custompolicy.domain.CustomPolicy;
|
||||
import org.nl.acs.custompolicy.server.dto.CustomPolicyDTO;
|
||||
import org.nl.acs.device.domain.Device;
|
||||
import org.nl.acs.region.domain.Region;
|
||||
import org.nl.acs.region.service.RegionService;
|
||||
import org.nl.acs.region.service.dto.RegionDto;
|
||||
import org.nl.acs.region.service.mapper.RegionMapper;
|
||||
import org.nl.acs.task.domain.Task;
|
||||
import org.nl.acs.utils.ConvertUtil;
|
||||
import org.nl.acs.utils.PageUtil;
|
||||
import org.nl.common.exception.BadRequestException;
|
||||
import org.nl.common.utils.SecurityUtils;
|
||||
import org.nl.config.language.LangProcess;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
@@ -60,4 +76,54 @@ public class RegionServiceImpl extends CommonServiceImpl<RegionMapper,Region> im
|
||||
.one();
|
||||
return region;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<RegionDto> queryAll(Map whereJson, Pageable page) {
|
||||
IPage<Region> queryPage = PageUtil.toMybatisPage(page);
|
||||
IPage<Region> regionIPage = regionMapper.selectPage(queryPage,new LambdaQueryWrapper<>());
|
||||
PageInfo<RegionDto> regionDtoPageInfo = ConvertUtil.convertPage(regionIPage, RegionDto.class);
|
||||
return regionDtoPageInfo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void create(RegionDto dto) {
|
||||
if (StrUtil.isEmpty(dto.getRegion_code())){
|
||||
throw new BadRequestException("区域编码不能为空");
|
||||
}
|
||||
String currentUsername = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
dto.setCreate_by(currentUsername);
|
||||
dto.setUpdate_user(currentUsername);
|
||||
dto.setUpdate_time(now);
|
||||
dto.setCreate_time(now);
|
||||
if (StrUtil.isEmpty(dto.getHas_agv())){
|
||||
dto.setHas_agv(CommonFinalParam.ZERO);
|
||||
}
|
||||
if (StrUtil.isEmpty(dto.getIs_charge())){
|
||||
dto.setIs_charge(CommonFinalParam.ZERO);
|
||||
}
|
||||
Region region = ConvertUtil.convert(dto, Region.class);
|
||||
regionMapper.insert(region);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(RegionDto dto) {
|
||||
String currentUsername = SecurityUtils.getCurrentNickName();
|
||||
String now = DateUtil.now();
|
||||
dto.setUpdate_time(now);
|
||||
dto.setUpdate_user(currentUsername);
|
||||
Region convert = ConvertUtil.convert(dto, Region.class);
|
||||
regionMapper.updateById(convert);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteAll(String[] ids) {
|
||||
Set<String> idsSet = new HashSet<>(1);
|
||||
idsSet.addAll(Arrays.asList(ids));
|
||||
regionMapper.upBatchIds(idsSet);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
package org.nl.acs.region.service.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.nl.acs.common.base.CommonMapper;
|
||||
import org.nl.acs.region.domain.Region;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@Repository
|
||||
public interface RegionMapper extends CommonMapper<Region> {
|
||||
|
||||
/**
|
||||
* 批量更新
|
||||
* @param idsSet
|
||||
*/
|
||||
void upBatchIds(@Param("ids") Set<String> idsSet);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
package org.nl.acs.task.service.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TaskIdAndStatusDTO {
|
||||
private String task_id;
|
||||
|
||||
|
||||
@@ -842,12 +842,12 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
|
||||
//移除任务缓存信息
|
||||
this.removeByCodeFromCache(entity.getTask_code());
|
||||
//反馈上位系统任务状态
|
||||
this.feedWmsTaskStatus(entity);
|
||||
//关闭仙工运单序列
|
||||
if(StrUtil.equals(task.getTask_type(),TaskTypeEnum.Standard_AGV_Task.getCode()) && (StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.One_NDC_System_Type.getCode())||StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.XG_System_Type.getCode()))) {
|
||||
this.markComplete(entity);
|
||||
}
|
||||
// //反馈上位系统任务状态
|
||||
// this.feedWmsTaskStatus(entity);
|
||||
// //关闭仙工运单序列
|
||||
// if(StrUtil.equals(task.getTask_type(),TaskTypeEnum.Standard_AGV_Task.getCode()) && (StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.One_NDC_System_Type.getCode())||StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.XG_System_Type.getCode()))) {
|
||||
// this.markComplete(entity);
|
||||
// }
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -905,12 +905,12 @@ public class TaskServiceImpl extends CommonServiceImpl<TaskMapper, Task> impleme
|
||||
|
||||
//移除任务缓存信息
|
||||
this.removeByCodeFromCache(entity.getTask_code());
|
||||
//反馈上位系统任务状态
|
||||
this.feedWmsTaskStatus(entity);
|
||||
//关闭仙工运单序列
|
||||
if(StrUtil.equals(task.getTask_type(),TaskTypeEnum.Standard_AGV_Task.getCode()) && (StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.One_NDC_System_Type.getCode())||StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.XG_System_Type.getCode()))) {
|
||||
this.markComplete(entity);
|
||||
}
|
||||
// //反馈上位系统任务状态
|
||||
// this.feedWmsTaskStatus(entity);
|
||||
// //关闭仙工运单序列
|
||||
// if(StrUtil.equals(task.getTask_type(),TaskTypeEnum.Standard_AGV_Task.getCode()) && (StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.One_NDC_System_Type.getCode())||StrUtil.equals(task.getAgv_system_type(), AgvSystemTypeEnum.XG_System_Type.getCode()))) {
|
||||
// this.markComplete(entity);
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -44,12 +44,12 @@ public class PdaController {
|
||||
return new ResponseEntity<>(pdaService.queryAreas(), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryMaterials/{material_type}")
|
||||
@PostMapping("/queryMaterials")
|
||||
@Log("查询物料类型")
|
||||
@ApiOperation("查询物料类型")
|
||||
@SaIgnore
|
||||
//@PreAuthorize("@el.check('sect:list')")
|
||||
public ResponseEntity<Object> queryMaterials(@RequestParam String material_type) {
|
||||
public ResponseEntity<Object> queryMaterials(@RequestBody String material_type) {
|
||||
return new ResponseEntity<>(pdaService.queryMaterials(material_type), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@@ -83,8 +83,8 @@ public class PdaController {
|
||||
@ApiOperation("强制完成")
|
||||
@SaIgnore
|
||||
//@PreAuthorize("@el.check('sect:list')")
|
||||
public ResponseEntity<Object> forceFinish(@RequestBody HeadTaskDto dto) throws Exception {
|
||||
return new ResponseEntity<>(pdaService.forceFinish(dto), HttpStatus.OK);
|
||||
public ResponseEntity<Object> forceFinish(@RequestBody String whereJson) throws Exception {
|
||||
return new ResponseEntity<>(pdaService.forceFinish(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping("/queryTaskIds")
|
||||
@@ -101,8 +101,8 @@ public class PdaController {
|
||||
@ApiOperation("取消任务")
|
||||
@SaIgnore
|
||||
//@PreAuthorize("@el.check('sect:list')")
|
||||
public ResponseEntity<Object> cancel(TaskIdAndStatusDTO dto) throws Exception {
|
||||
return new ResponseEntity<>(pdaService.cancel(dto), HttpStatus.OK);
|
||||
public ResponseEntity<Object> cancel(@RequestBody String whereJson) throws Exception {
|
||||
return new ResponseEntity<>(pdaService.cancel(whereJson), HttpStatus.OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,11 +19,11 @@ public interface PdaService {
|
||||
|
||||
Map<String, Object> areaControl(String whereJson);
|
||||
|
||||
Map<String, Object> forceFinish(HeadTaskDto dto);
|
||||
Map<String, Object> forceFinish(String whereJson);
|
||||
|
||||
JSONArray queryTaskIds();
|
||||
|
||||
Map<String, Object> cancel(TaskIdAndStatusDTO dto) throws Exception;
|
||||
Map<String, Object> cancel(String whereJson) throws Exception;
|
||||
|
||||
JSONArray queryAreas();
|
||||
|
||||
|
||||
@@ -13,9 +13,12 @@ import org.nl.acs.common.base.CommonFinalParam;
|
||||
import org.nl.acs.device.domain.Device;
|
||||
import org.nl.acs.device.service.DeviceService;
|
||||
import org.nl.acs.device_driver.conveyor.standard_ordinary_site.StandardOrdinarySiteDeviceDriver;
|
||||
import org.nl.acs.instruction.domain.Instruction;
|
||||
import org.nl.acs.instruction.service.InstructionService;
|
||||
import org.nl.acs.opc.DeviceAppService;
|
||||
import org.nl.acs.region.domain.Region;
|
||||
import org.nl.acs.region.service.RegionService;
|
||||
import org.nl.acs.task.enums.TaskStatusEnum;
|
||||
import org.nl.acs.task.service.TaskService;
|
||||
import org.nl.acs.task.service.dto.TaskDto;
|
||||
import org.nl.acs.task.service.dto.TaskIdAndStatusDTO;
|
||||
@@ -55,6 +58,9 @@ public class PdaServiceImpl implements PdaService {
|
||||
@Autowired
|
||||
private TaskService taskserver;
|
||||
|
||||
@Autowired
|
||||
private InstructionService instructionService;
|
||||
|
||||
@Override
|
||||
public JSONArray queryAllPoints() {
|
||||
JSONArray data = new JSONArray();
|
||||
@@ -77,11 +83,13 @@ public class PdaServiceImpl implements PdaService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public JSONArray queryMaterials(String code) {
|
||||
public JSONArray queryMaterials(String whereJson) {
|
||||
JSONObject jsonObject = JSON.parseObject(whereJson);
|
||||
String code = jsonObject.getString("material_type");
|
||||
List<Dict> list = sysDictMapper.selectList(new LambdaQueryWrapper<Dict>()
|
||||
.eq(ObjectUtil.isNotEmpty(code), Dict::getCode, code));
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
throw new BadRequestException(LangProcess.msg("error_checkExist",code));
|
||||
if (ObjectUtil.isEmpty(list)) {
|
||||
throw new BadRequestException("物料类型未配置!");
|
||||
}
|
||||
JSONArray arr = JSONArray.parseArray(JSON.toJSONString(list));
|
||||
JSONArray result = new JSONArray();
|
||||
@@ -168,10 +176,22 @@ public class PdaServiceImpl implements PdaService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> forceFinish(HeadTaskDto dto) {
|
||||
public Map<String, Object> forceFinish(String whereJson) {
|
||||
JSONObject jsonObject = JSON.parseObject(whereJson);
|
||||
String task_code = jsonObject.getString("task_id");
|
||||
TaskDto dto = taskserver.findByCode(task_code);
|
||||
if (ObjectUtil.isEmpty(dto)) {
|
||||
throw new BadRequestException("当前任务不存在!");
|
||||
}
|
||||
JSONObject resultJson = new JSONObject();
|
||||
Instruction instruction = instructionService.findByTaskid(dto.getTask_id(), "instruction_status <2 ");
|
||||
if (instruction!=null){
|
||||
resultJson.put("message", "有指令未完成!");
|
||||
return resultJson;
|
||||
}
|
||||
TaskIdAndStatusDTO taskIdAndStatusDTO = new TaskIdAndStatusDTO();
|
||||
taskIdAndStatusDTO.setTask_id(dto.getTask_id());
|
||||
taskIdAndStatusDTO.setTask_status(TaskStatusEnum.FINISHED.getIndex());
|
||||
try {
|
||||
taskserver.finish(taskIdAndStatusDTO);
|
||||
} catch (Exception e) {
|
||||
@@ -194,17 +214,25 @@ public class PdaServiceImpl implements PdaService {
|
||||
for (int i = 0; i < arr.size(); i++) {
|
||||
JSONObject obj = arr.getJSONObject(i);
|
||||
JSONObject json = new JSONObject();
|
||||
json.put("task_id", obj.getString("task_id"));
|
||||
json.put("task_id", obj.getString("task_code"));
|
||||
result.add(json);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> cancel(TaskIdAndStatusDTO dto) {
|
||||
public Map<String, Object> cancel(String whereJson) {
|
||||
JSONObject jsonObject = JSON.parseObject(whereJson);
|
||||
String task_code = jsonObject.getString("task_id");
|
||||
JSONObject resultJson = new JSONObject();
|
||||
TaskDto dto = taskserver.findByCode(task_code);
|
||||
if (Integer.parseInt(dto.getTask_status())==0) {
|
||||
resultJson.put("message", "取消成功");
|
||||
return resultJson;
|
||||
}
|
||||
Instruction instruction = instructionService.findByTaskid(dto.getTask_id(),"instruction_status <2 ");
|
||||
try {
|
||||
taskserver.cancelAndInst(dto.getTask_id());
|
||||
instructionService.cancel(instruction.getInstruction_id());
|
||||
} catch (Exception e) {
|
||||
resultJson.put("message", e.getMessage());
|
||||
return resultJson;
|
||||
|
||||
27
acs2/nladmin-ui/src/api/acs/device/region.js
Normal file
27
acs2/nladmin-ui/src/api/acs/device/region.js
Normal file
@@ -0,0 +1,27 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function add(data) {
|
||||
return request({
|
||||
url: 'api/region',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export function del(ids) {
|
||||
return request({
|
||||
url: 'api/region/',
|
||||
method: 'delete',
|
||||
data: ids
|
||||
})
|
||||
}
|
||||
|
||||
export function edit(data) {
|
||||
return request({
|
||||
url: 'api/region',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
export default { add, edit, del }
|
||||
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
BIN
acs2/nladmin-ui/src/assets/images/newloge.png
Normal file
BIN
acs2/nladmin-ui/src/assets/images/newloge.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.2 KiB |
@@ -24,6 +24,7 @@ import dict from './dict/zh'
|
||||
import angle from './angle/zh'
|
||||
import regional from './regional/zh'
|
||||
import stage from './stage/zh'
|
||||
import region from './region/zh'
|
||||
|
||||
export default {
|
||||
...koLocale,
|
||||
@@ -51,6 +52,7 @@ export default {
|
||||
...dict,
|
||||
...angle,
|
||||
...regional,
|
||||
...stage
|
||||
...stage,
|
||||
...region
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import dict from './dict/zh'
|
||||
import angle from './angle/zh'
|
||||
import regional from './regional/zh'
|
||||
import stage from './stage/zh'
|
||||
import region from './region/zh'
|
||||
|
||||
export default {
|
||||
...zhLocale,
|
||||
@@ -51,6 +52,7 @@ export default {
|
||||
...dict,
|
||||
...angle,
|
||||
...regional,
|
||||
...stage
|
||||
...stage,
|
||||
...region
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import dict from './dict/en'
|
||||
import angle from './angle/en'
|
||||
import regional from './regional/en'
|
||||
import stage from './stage/en'
|
||||
import region from './region/en'
|
||||
|
||||
export default {
|
||||
...enLocale,
|
||||
@@ -51,6 +52,7 @@ export default {
|
||||
...dict,
|
||||
...angle,
|
||||
...regional,
|
||||
...stage
|
||||
...stage,
|
||||
...region
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import dict from './dict/in'
|
||||
import angle from './angle/in'
|
||||
import regional from './regional/in'
|
||||
import stage from './stage/in'
|
||||
import region from './region/in'
|
||||
|
||||
export default {
|
||||
...idLocale,
|
||||
@@ -52,5 +53,6 @@ export default {
|
||||
...dict,
|
||||
...angle,
|
||||
...regional,
|
||||
...stage
|
||||
...stage,
|
||||
...region
|
||||
}
|
||||
|
||||
12
acs2/nladmin-ui/src/i18n/langs/region/en.js
Normal file
12
acs2/nladmin-ui/src/i18n/langs/region/en.js
Normal file
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
'region': {
|
||||
'title': '区域',
|
||||
'region_code': '区域编号',
|
||||
'region_name': '区域名称',
|
||||
'is_charge': '是否管控',
|
||||
'has_agv': '是否存在agv'
|
||||
},
|
||||
'msg': {
|
||||
'delete_msg': 'Are You Sure To Delete It? If There Are Subordinate Nodes, they Will Be Deleted Together. This Operation Cannot Be Undone!'
|
||||
}
|
||||
}
|
||||
12
acs2/nladmin-ui/src/i18n/langs/region/in.js
Normal file
12
acs2/nladmin-ui/src/i18n/langs/region/in.js
Normal file
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
'region': {
|
||||
'title': '区域',
|
||||
'region_code': '区域编号',
|
||||
'region_name': '区域名称',
|
||||
'is_charge': '是否管控',
|
||||
'has_agv': '是否存在agv'
|
||||
},
|
||||
'msg': {
|
||||
'delete_msg': 'Are You Sure To Delete It? If There Are Subordinate Nodes, they Will Be Deleted Together. This Operation Cannot Be Undone!'
|
||||
}
|
||||
}
|
||||
12
acs2/nladmin-ui/src/i18n/langs/region/zh.js
Normal file
12
acs2/nladmin-ui/src/i18n/langs/region/zh.js
Normal file
@@ -0,0 +1,12 @@
|
||||
export default {
|
||||
'region': {
|
||||
'title': '区域',
|
||||
'region_code': '区域编号',
|
||||
'region_name': '区域名称',
|
||||
'is_charge': '是否管控',
|
||||
'has_agv': '是否存在agv'
|
||||
},
|
||||
'msg': {
|
||||
'delete_msg': 'Are You Sure To Delete It? If There Are Subordinate Nodes, they Will Be Deleted Together. This Operation Cannot Be Undone!'
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import Logo from '@/assets/images/newlogo.png'
|
||||
import Logo from '@/assets/images/newloge.png'
|
||||
import variables from '@/assets/styles/variables.scss'
|
||||
export default {
|
||||
name: 'SidebarLogo',
|
||||
|
||||
91
acs2/nladmin-ui/src/views/acs/device/region/index.vue
Normal file
91
acs2/nladmin-ui/src/views/acs/device/region/index.vue
Normal file
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<!--工具栏-->
|
||||
<div class="head-container">
|
||||
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||
<crudOperation :permission="permission" />
|
||||
<!--表单组件-->
|
||||
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="600px">
|
||||
<el-form ref="form" :model="form" :rules="rules" size="small" label-width="150px">
|
||||
<el-form-item :label="$t('region.region_code')" prop="region_code">
|
||||
<el-input v-model="form.region_code" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('region.region_name')" prop="region_name">
|
||||
<el-input v-model="form.region_name" style="width: 370px;" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="text" @click="crud.cancelCU">{{ $t('auto.common.Cancel') }}</el-button>
|
||||
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">{{ $t('auto.common.Confirm') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!--表格渲染-->
|
||||
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="small" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||
<el-table-column type="selection" width="55" />
|
||||
<el-table-column prop="region_code" :label="$t('region.region_code')" />
|
||||
<el-table-column prop="region_name" :label="$t('region.region_name')" />
|
||||
<el-table-column prop="is_charge" :label="$t('region.is_charge')" />
|
||||
<el-table-column prop="has_agv" :label="$t('region.has_agv')" />
|
||||
<el-table-column prop="create_by" :label="$t('auto.common.create_by')" />
|
||||
<el-table-column prop="update_user" :label="$t('auto.common.update_by')" />
|
||||
<el-table-column prop="create_time" :label="$t('auto.common.create_time')" />
|
||||
<el-table-column prop="update_time" :label="$t('auto.common.update_time')" />
|
||||
<el-table-column v-permission="['admin','customPolicy:del']" :label="$t('auto.common.Operate')" width="150px" align="center">
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页组件-->
|
||||
<pagination />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import crudRegion from '@/api/acs/device/region'
|
||||
import CRUD, { presenter, header, form, crud } from '@crud/crud'
|
||||
import rrOperation from '@crud/RR.operation'
|
||||
import crudOperation from '@crud/CRUD.operation'
|
||||
import udOperation from '@crud/UD.operation'
|
||||
import pagination from '@crud/Pagination'
|
||||
import i18n from '@/i18n'
|
||||
|
||||
const defaultForm = { id: null, create_time: null, update_time: null, region_code: null, region_name: null }
|
||||
export default {
|
||||
name: 'Region',
|
||||
// eslint-disable-next-line vue/no-unused-components
|
||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||
cruds() {
|
||||
return CRUD({ title: i18n.t('region.title'), url: 'api/region', idField: 'id', sort: 'id,desc', crudMethod: { ...crudRegion }})
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
permission: {
|
||||
add: ['admin', 'region:add'],
|
||||
edit: ['admin', 'region:edit'],
|
||||
del: ['admin', 'region:del']
|
||||
},
|
||||
deviceList: [],
|
||||
rules: {
|
||||
region_code: [
|
||||
{ required: true, message: '设备号不能为空', trigger: 'blur' }
|
||||
]
|
||||
}}
|
||||
},
|
||||
methods: {
|
||||
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||
[CRUD.HOOK.beforeRefresh]() {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user