Compare commits

...

3 Commits

Author SHA1 Message Date
vayne 6cedb8e83d Merge branch 'master' of http://222.71.165.188:3000/yangshiqiang/NX-zhihui
3 months ago
vayne 43888861ff Merge branch 'master' of http://222.71.165.188:3000/yangshiqiang/NX-zhihui
3 months ago
vayne 144e7de92b 园区管理
3 months ago

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.RegionalMapper">
</mapper>

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="jnpf.mapper.SpatialMapper">
</mapper>

@ -0,0 +1,16 @@
package jnpf.mapper;
import jnpf.entity.AreaEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* area
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
public interface AreaMapper extends BaseMapper<AreaEntity> {
}

@ -5,11 +5,11 @@ import jnpf.entity.ParkEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* Park
* park
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-15
* 2024-07-17
*/
public interface ParkMapper extends BaseMapper<ParkEntity> {

@ -0,0 +1,35 @@
package jnpf.service;
import jnpf.model.area.*;
import jnpf.entity.*;
import java.util.*;
import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* area
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
public interface AreaService extends IService<AreaEntity> {
List<AreaEntity> getList(AreaPagination areaPagination);
List<AreaEntity> getTypeList(AreaPagination areaPagination,String dataType);
AreaEntity getInfo(String id);
void delete(AreaEntity entity);
void create(AreaEntity entity);
boolean update(String id, AreaEntity entity);
//子表方法
//副表数据方法
String checkForm(AreaForm form,int i);
void saveOrUpdate(AreaForm areaForm,String id, boolean isSave) throws Exception;
}

@ -7,11 +7,11 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
/**
* Park
* park
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-15
* 2024-07-17
*/
public interface ParkService extends IService<ParkEntity> {
List<ParkEntity> getList(ParkPagination parkPagination);

@ -0,0 +1,314 @@
package jnpf.service.impl;
import jnpf.entity.*;
import jnpf.mapper.AreaMapper;
import jnpf.service.*;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import jnpf.model.area.*;
import java.math.BigDecimal;
import cn.hutool.core.util.ObjectUtil;
import jnpf.permission.model.authorize.AuthorizeConditionModel;
import jnpf.util.GeneraterSwapUtil;
import jnpf.database.model.superQuery.SuperQueryJsonModel;
import jnpf.database.model.superQuery.ConditionJsonModel;
import jnpf.database.model.superQuery.SuperQueryConditionModel;
import java.lang.reflect.Field;
import com.baomidou.mybatisplus.annotation.TableField;
import java.util.regex.Pattern;
import jnpf.model.QueryModel;
import java.util.stream.Collectors;
import jnpf.base.model.ColumnDataModel;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import jnpf.database.model.superQuery.SuperJsonModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import java.text.SimpleDateFormat;
import jnpf.util.*;
import java.util.*;
import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* area
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-16
*/
@Service
public class AreaServiceImpl extends ServiceImpl<AreaMapper, AreaEntity> implements AreaService{
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@Autowired
private UserProvider userProvider;
@Override
public List<AreaEntity> getList(AreaPagination areaPagination){
return getTypeList(areaPagination,areaPagination.getDataType());
}
/** 列表查询 */
@Override
public List<AreaEntity> getTypeList(AreaPagination areaPagination,String dataType){
String userId=userProvider.get().getUserId();
List<String> AllIdList =new ArrayList();
List<List<String>> intersectionList =new ArrayList<>();
boolean isPc = ServletUtil.getHeader("jnpf-origin").equals("pc");
String columnData = !isPc ? AreaConstant.getAppColumnData() : AreaConstant.getColumnData();
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(columnData, ColumnDataModel.class);
String ruleJson = !isPc ? JsonUtil.getObjectToString(columnDataModel.getRuleListApp()) : JsonUtil.getObjectToString(columnDataModel.getRuleList());
int total=0;
int areaNum =0;
QueryWrapper<AreaEntity> areaQueryWrapper=new QueryWrapper<>();
List<String> allSuperIDlist = new ArrayList<>();
String superOp ="";
if (ObjectUtil.isNotEmpty(areaPagination.getSuperQueryJson())){
List<String> allSuperList = new ArrayList<>();
List<List<String>> intersectionSuperList = new ArrayList<>();
String queryJson = areaPagination.getSuperQueryJson();
SuperJsonModel superJsonModel = JsonUtil.getJsonToBean(queryJson, SuperJsonModel.class);
int superNum = 0;
QueryWrapper<AreaEntity> areaSuperWrapper = new QueryWrapper<>();
areaSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(areaSuperWrapper,AreaEntity.class,queryJson,"0"));
int areaNum1 = areaSuperWrapper.getExpression().getNormal().size();
if (areaNum1>0){
List<String> areaList =this.list(areaSuperWrapper).stream().map(AreaEntity::getId).collect(Collectors.toList());
allSuperList.addAll(areaList);
intersectionSuperList.add(areaList);
superNum++;
}
superOp = superNum > 0 ? superJsonModel.getMatchLogic() : "";
//and or
if(superOp.equalsIgnoreCase("and")){
allSuperIDlist = generaterSwapUtil.getIntersection(intersectionSuperList);
}else{
allSuperIDlist = allSuperList;
}
}
List<String> allRuleIDlist = new ArrayList<>();
String ruleOp ="";
if (ObjectUtil.isNotEmpty(ruleJson)){
List<String> allRuleList = new ArrayList<>();
List<List<String>> intersectionRuleList = new ArrayList<>();
SuperJsonModel ruleJsonModel = JsonUtil.getJsonToBean(ruleJson, SuperJsonModel.class);
int ruleNum = 0;
QueryWrapper<AreaEntity> areaSuperWrapper = new QueryWrapper<>();
areaSuperWrapper = generaterSwapUtil.getCondition(new QueryModel(areaSuperWrapper,AreaEntity.class,ruleJson,"0"));
int areaNum1 = areaSuperWrapper.getExpression().getNormal().size();
if (areaNum1>0){
List<String> areaList =this.list(areaSuperWrapper).stream().map(AreaEntity::getId).collect(Collectors.toList());
allRuleList.addAll(areaList);
intersectionRuleList.add(areaList);
ruleNum++;
}
ruleOp = ruleNum > 0 ? ruleJsonModel.getMatchLogic() : "";
//and or
if(ruleOp.equalsIgnoreCase("and")){
allRuleIDlist = generaterSwapUtil.getIntersection(intersectionRuleList);
}else{
allRuleIDlist = allRuleList;
}
}
boolean pcPermission = false;
boolean appPermission = false;
if(isPc && pcPermission){
if (!userProvider.get().getIsAdministrator()){
Object areaObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(areaQueryWrapper,AreaEntity.class,areaPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(areaObj)){
return new ArrayList<>();
} else {
areaQueryWrapper = (QueryWrapper<AreaEntity>)areaObj;
if( areaQueryWrapper.getExpression().getNormal().size()>0){
areaNum++;
}
}
}
}
if(!isPc && appPermission){
if (!userProvider.get().getIsAdministrator()){
Object areaObj=generaterSwapUtil.getAuthorizeCondition(new QueryModel(areaQueryWrapper,AreaEntity.class,areaPagination.getMenuId(),"0"));
if (ObjectUtil.isEmpty(areaObj)){
return new ArrayList<>();
} else {
areaQueryWrapper = (QueryWrapper<AreaEntity>)areaObj;
if( areaQueryWrapper.getExpression().getNormal().size()>0){
areaNum++;
}
}
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(areaPagination.getName())){
areaNum++;
String value = areaPagination.getName() instanceof List ?
JsonUtil.getObjectToString(areaPagination.getName()) :
String.valueOf(areaPagination.getName());
areaQueryWrapper.lambda().like(AreaEntity::getName,value);
}
if(ObjectUtil.isNotEmpty(areaPagination.getPid())){
areaNum++;
String value = areaPagination.getPid() instanceof List ?
JsonUtil.getObjectToString(areaPagination.getPid()) :
String.valueOf(areaPagination.getPid());
areaQueryWrapper.lambda().like(AreaEntity::getPid,value);
}
}
if(!isPc){
if(ObjectUtil.isNotEmpty(areaPagination.getPid())){
areaNum++;
String value = areaPagination.getPid() instanceof List ?
JsonUtil.getObjectToString(areaPagination.getPid()) :
String.valueOf(areaPagination.getPid());
areaQueryWrapper.lambda().like(AreaEntity::getPid,value);
}
}
List<String> intersection = generaterSwapUtil.getIntersection(intersectionList);
if (total>0){
if (intersection.size()==0){
intersection.add("jnpfNullList");
}
areaQueryWrapper.lambda().in(AreaEntity::getId, intersection);
}
//是否有高级查询
if (StringUtil.isNotEmpty(superOp)){
if (allSuperIDlist.size()==0){
allSuperIDlist.add("jnpfNullList");
}
List<String> finalAllSuperIDlist = allSuperIDlist;
areaQueryWrapper.lambda().and(t->t.in(AreaEntity::getId, finalAllSuperIDlist));
}
//是否有数据过滤查询
if (StringUtil.isNotEmpty(ruleOp)){
if (allRuleIDlist.size()==0){
allRuleIDlist.add("jnpfNullList");
}
List<String> finalAllRuleIDlist = allRuleIDlist;
areaQueryWrapper.lambda().and(t->t.in(AreaEntity::getId, finalAllRuleIDlist));
}
//假删除标志
areaQueryWrapper.lambda().isNull(AreaEntity::getDeleteMark);
//排序
if(StringUtil.isEmpty(areaPagination.getSidx())){
areaQueryWrapper.lambda().orderByDesc(AreaEntity::getId);
}else{
try {
String sidx = areaPagination.getSidx();
String[] strs= sidx.split("_name");
AreaEntity areaEntity = new AreaEntity();
Field declaredField = areaEntity.getClass().getDeclaredField(strs[0]);
declaredField.setAccessible(true);
String value = declaredField.getAnnotation(TableField.class).value();
areaQueryWrapper="asc".equals(areaPagination.getSort().toLowerCase())?areaQueryWrapper.orderByAsc(value):areaQueryWrapper.orderByDesc(value);
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
}
if("0".equals(dataType)){
if((total>0 && AllIdList.size()>0) || total==0){
Page<AreaEntity> page=new Page<>(areaPagination.getCurrentPage(), areaPagination.getPageSize());
IPage<AreaEntity> userIPage=this.page(page, areaQueryWrapper);
return areaPagination.setData(userIPage.getRecords(),userIPage.getTotal());
}else{
List<AreaEntity> list = new ArrayList();
return areaPagination.setData(list, list.size());
}
}else{
return this.list(areaQueryWrapper);
}
}
@Override
public AreaEntity getInfo(String id){
QueryWrapper<AreaEntity> queryWrapper=new QueryWrapper<>();
queryWrapper.lambda().eq(AreaEntity::getId,id);
return this.getOne(queryWrapper);
}
@Override
public void create(AreaEntity entity){
this.save(entity);
}
@Override
public boolean update(String id, AreaEntity entity){
return this.updateById(entity);
}
@Override
public void delete(AreaEntity entity){
if(entity!=null){
this.removeById(entity.getId());
}
}
/** 验证表单唯一字段,正则,非空 i-0新增-1修改*/
@Override
public String checkForm(AreaForm form,int i) {
boolean isUp =StringUtil.isNotEmpty(form.getId()) && !form.getId().equals("0");
String id="";
String countRecover = "";
if (isUp){
id = form.getId();
}
//主表字段验证
if(StringUtil.isEmpty(form.getPid())){
return "园区名称不能为空";
}
if(StringUtil.isEmpty(form.getCode())){
return "区域编码不能为空";
}
if(StringUtil.isNotEmpty(form.getCode())){
form.setCode(form.getCode().trim());
QueryWrapper<AreaEntity> codeWrapper=new QueryWrapper<>();
codeWrapper.lambda().eq(AreaEntity::getCode,form.getCode());
//假删除标志
codeWrapper.lambda().isNull(AreaEntity::getDeleteMark);
if (isUp){
codeWrapper.lambda().ne(AreaEntity::getId, id);
}
if((int) this.count(codeWrapper)>0){
countRecover = "区域编码"+form.getCode()+"不能重复";
}
}
if(StringUtil.isEmpty(form.getName())){
return "区域名称不能为空";
}
return countRecover;
}
/**
* ()
* @param id
* @param areaForm
* @return
*/
@Override
@Transactional
public void saveOrUpdate(AreaForm areaForm,String id, boolean isSave) throws Exception{
UserInfo userInfo=userProvider.get();
UserEntity userEntity = generaterSwapUtil.getUser(userInfo.getUserId());
areaForm = JsonUtil.getJsonToBean(
generaterSwapUtil.swapDatetime(AreaConstant.getFormData(),areaForm),AreaForm.class);
AreaEntity entity = JsonUtil.getJsonToBean(areaForm, AreaEntity.class);
if(isSave){
String mainId = RandomUtil.uuId() ;
entity.setId(mainId);
entity.setVersion(0);
}else{
}
this.saveOrUpdate(entity);
}
}

@ -32,11 +32,11 @@ import jnpf.base.UserInfo;
import jnpf.permission.entity.UserEntity;
/**
*
* Park
* park
* V3.5
* https://www.jnpfsoft.com
* JNPF
* 2024-07-15
* 2024-07-17
*/
@Service
public class ParkServiceImpl extends ServiceImpl<ParkMapper, ParkEntity> implements ParkService{
@ -144,13 +144,13 @@ public class ParkServiceImpl extends ServiceImpl<ParkMapper, ParkEntity> impleme
}
}
if(isPc){
if(ObjectUtil.isNotEmpty(parkPagination.getParkName())){
if(ObjectUtil.isNotEmpty(parkPagination.getName())){
parkNum++;
String value = parkPagination.getParkName() instanceof List ?
JsonUtil.getObjectToString(parkPagination.getParkName()) :
String.valueOf(parkPagination.getParkName());
parkQueryWrapper.lambda().like(ParkEntity::getParkName,value);
String value = parkPagination.getName() instanceof List ?
JsonUtil.getObjectToString(parkPagination.getName()) :
String.valueOf(parkPagination.getName());
parkQueryWrapper.lambda().like(ParkEntity::getName,value);
}
@ -241,23 +241,23 @@ public class ParkServiceImpl extends ServiceImpl<ParkMapper, ParkEntity> impleme
id = form.getId();
}
//主表字段验证
if(StringUtil.isEmpty(form.getParkNumber())){
if(StringUtil.isEmpty(form.getCode())){
return "园区编码不能为空";
}
if(StringUtil.isNotEmpty(form.getParkNumber())){
form.setParkNumber(form.getParkNumber().trim());
QueryWrapper<ParkEntity> parkNumberWrapper=new QueryWrapper<>();
parkNumberWrapper.lambda().eq(ParkEntity::getParkNumber,form.getParkNumber());
if(StringUtil.isNotEmpty(form.getCode())){
form.setCode(form.getCode().trim());
QueryWrapper<ParkEntity> codeWrapper=new QueryWrapper<>();
codeWrapper.lambda().eq(ParkEntity::getCode,form.getCode());
//假删除标志
parkNumberWrapper.lambda().isNull(ParkEntity::getDeleteMark);
codeWrapper.lambda().isNull(ParkEntity::getDeleteMark);
if (isUp){
parkNumberWrapper.lambda().ne(ParkEntity::getId, id);
codeWrapper.lambda().ne(ParkEntity::getId, id);
}
if((int) this.count(parkNumberWrapper)>0){
countRecover = "园区编码不能重复";
if((int) this.count(codeWrapper)>0){
countRecover = "园区编码"+form.getCode()+"不能重复";
}
}
if(StringUtil.isEmpty(form.getParkName())){
if(StringUtil.isEmpty(form.getName())){
return "园区名称不能为空";
}
return countRecover;

@ -1,32 +1,26 @@
package jnpf.controller;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jnpf.base.ActionResult;
import jnpf.base.UserInfo;
import jnpf.exception.DataException;
import jnpf.permission.entity.UserEntity;
import jnpf.service.*;
import jnpf.entity.*;
import jnpf.util.*;
import jnpf.model.park.*;
import jnpf.model.area.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import java.util.*;
import jnpf.annotation.JnpfField;
import jnpf.base.vo.PageListVO;
import jnpf.base.vo.PaginationVO;
import jnpf.base.vo.DownloadVO;
import jnpf.config.ConfigValueUtil;
import jnpf.base.entity.ProvinceEntity;
import java.io.IOException;
import java.util.stream.Collectors;
import jnpf.engine.entity.FlowTaskEntity;
import jnpf.exception.WorkFlowException;
import org.springframework.web.multipart.MultipartFile;
import cn.afterturn.easypoi.excel.ExcelExportUtil;
import cn.afterturn.easypoi.excel.ExcelImportUtil;
@ -50,17 +44,17 @@ import jnpf.base.util.VisualUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* Park
* area
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-16
*/
@Slf4j
@RestController
@Tag(name = "Park" , description = "scm")
@RequestMapping("/api/scm/Park")
public class ParkController {
@Tag(name = "area" , description = "example")
@RequestMapping("/api/example/Area")
public class AreaRenameController {
@Autowired
private GeneraterSwapUtil generaterSwapUtil;
@ -69,7 +63,7 @@ public class ParkController {
private UserProvider userProvider;
@Autowired
private ParkService parkService;
private AreaService areaService;
@ -79,46 +73,46 @@ public class ParkController {
/**
*
*
* @param parkPagination
* @param areaPagination
* @return
*/
@Operation(summary = "获取列表")
@PostMapping("/getList")
public ActionResult list(@RequestBody ParkPagination parkPagination)throws IOException{
List<ParkEntity> list= parkService.getList(parkPagination);
public ActionResult list(@RequestBody AreaPagination areaPagination)throws IOException{
List<AreaEntity> list= areaService.getList(areaPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (ParkEntity entity : list) {
Map<String, Object> parkMap=JsonUtil.entityToMap(entity);
parkMap.put("id", parkMap.get("id"));
for (AreaEntity entity : list) {
Map<String, Object> areaMap=JsonUtil.entityToMap(entity);
areaMap.put("id", areaMap.get("id"));
//副表数据
//子表数据
realList.add(parkMap);
realList.add(areaMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, ParkConstant.getFormData(), ParkConstant.getColumnData(), parkPagination.getModuleId(),false);
realList = generaterSwapUtil.swapDataList(realList, AreaConstant.getFormData(), AreaConstant.getColumnData(), areaPagination.getModuleId(),false);
//返回对象
PageListVO vo = new PageListVO();
vo.setList(realList);
PaginationVO page = JsonUtil.getJsonToBean(parkPagination, PaginationVO.class);
PaginationVO page = JsonUtil.getJsonToBean(areaPagination, PaginationVO.class);
vo.setPagination(page);
return ActionResult.success(vo);
}
/**
*
*
* @param parkForm
* @param areaForm
* @return
*/
@PostMapping()
@Operation(summary = "创建")
public ActionResult create(@RequestBody @Valid ParkForm parkForm) {
String b = parkService.checkForm(parkForm,0);
public ActionResult create(@RequestBody @Valid AreaForm areaForm) {
String b = areaService.checkForm(areaForm,0);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
try{
parkService.saveOrUpdate(parkForm, null ,true);
areaService.saveOrUpdate(areaForm, null ,true);
}catch(Exception e){
return ActionResult.fail("新增数据失败");
}
@ -131,22 +125,22 @@ public class ParkController {
*/
@Operation(summary = "导出Excel")
@PostMapping("/Actions/Export")
public ActionResult Export(@RequestBody ParkPagination parkPagination) throws IOException {
if (StringUtil.isEmpty(parkPagination.getSelectKey())){
public ActionResult Export(@RequestBody AreaPagination areaPagination) throws IOException {
if (StringUtil.isEmpty(areaPagination.getSelectKey())){
return ActionResult.fail("请选择导出字段");
}
List<ParkEntity> list= parkService.getList(parkPagination);
List<AreaEntity> list= areaService.getList(areaPagination);
List<Map<String, Object>> realList=new ArrayList<>();
for (ParkEntity entity : list) {
Map<String, Object> parkMap=JsonUtil.entityToMap(entity);
parkMap.put("id", parkMap.get("id"));
for (AreaEntity entity : list) {
Map<String, Object> areaMap=JsonUtil.entityToMap(entity);
areaMap.put("id", areaMap.get("id"));
//副表数据
//子表数据
realList.add(parkMap);
realList.add(areaMap);
}
//数据转换
realList = generaterSwapUtil.swapDataList(realList, ParkConstant.getFormData(), ParkConstant.getColumnData(), parkPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(parkPagination.getSelectKey())?parkPagination.getSelectKey():new String[0];
realList = generaterSwapUtil.swapDataList(realList, AreaConstant.getFormData(), AreaConstant.getColumnData(), areaPagination.getModuleId(),false);
String[]keys=!StringUtil.isEmpty(areaPagination.getSelectKey())?areaPagination.getSelectKey():new String[0];
UserInfo userInfo=userProvider.get();
DownloadVO vo=this.creatModelExcel(configValueUtil.getTemporaryFilePath(),realList,keys,userInfo);
return ActionResult.success(vo);
@ -161,14 +155,20 @@ public class ParkController {
if(keys.length>0){
for(String key:keys){
switch(key){
case "parkNumber" :
entitys.add(new ExcelExportEntity("园区编码" ,"parkNumber"));
case "pid" :
entitys.add(new ExcelExportEntity("园区名称" ,"pid"));
break;
case "code" :
entitys.add(new ExcelExportEntity("区域编码" ,"code"));
break;
case "spaceNum" :
entitys.add(new ExcelExportEntity("空间数量" ,"spaceNum"));
break;
case "parkName" :
entitys.add(new ExcelExportEntity("园区名称" ,"parkName"));
case "name" :
entitys.add(new ExcelExportEntity("区域名称" ,"name"));
break;
case "parkDescribe" :
entitys.add(new ExcelExportEntity("园区描述" ,"parkDescribe"));
case "description" :
entitys.add(new ExcelExportEntity("区域描述" ,"description"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
@ -217,7 +217,7 @@ public class ParkController {
}
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(ParkConstant.getColumnData(), ColumnDataModel.class);
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(AreaConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
@ -270,12 +270,14 @@ public class ParkController {
//主表对象
List<ExcelExportEntity> entitys = new ArrayList<>();
//以下添加字段
entitys.add(new ExcelExportEntity("园区编码" ,"parkNumber"));
entitys.add(new ExcelExportEntity("园区名称" ,"parkName"));
entitys.add(new ExcelExportEntity("园区名称" ,"pid"));
entitys.add(new ExcelExportEntity("区域编码" ,"code"));
entitys.add(new ExcelExportEntity("空间数量" ,"spaceNum"));
entitys.add(new ExcelExportEntity("区域名称" ,"name"));
List<Map<String, Object>> list = new ArrayList<>();
list.add(dataMap);
ExportParams exportParams = new ExportParams(null, "区管理模板");
ExportParams exportParams = new ExportParams(null, "管理模板");
exportParams.setType(ExcelType.XSSF);
try{
@Cleanup Workbook workbook = new HSSFWorkbook();
@ -284,7 +286,7 @@ public class ParkController {
list.add(new HashMap<>());
}
//复杂表头-表头和数据处理
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(ParkConstant.getColumnData(), ColumnDataModel.class);
ColumnDataModel columnDataModel = JsonUtil.getJsonToBean(AreaConstant.getColumnData(), ColumnDataModel.class);
List<HeaderModel> complexHeaderList = columnDataModel.getComplexHeaderList();
if (!Objects.equals(columnDataModel.getType(), 3) && !Objects.equals(columnDataModel.getType(), 5)) {
entitys = VisualUtils.complexHeaderHandel(entitys, complexHeaderList);
@ -292,7 +294,7 @@ public class ParkController {
}
workbook = ExcelExportUtil.exportExcel(exportParams, entitys, list);
}
String fileName = "区管理模板" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xlsx";
String fileName = "管理模板" + DateUtil.dateNow("yyyyMMddHHmmss") + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
String temporaryFilePath = configValueUtil.getTemporaryFilePath();
FileInfo fileInfo = FileUploadUtils.uploadFile(multipartFile, temporaryFilePath, fileName);
@ -323,11 +325,13 @@ public class ParkController {
params.setHeadRows(headerRowIndex);
params.setNeedVerify(true);
try {
List<ParkExcelVO> excelDataList = ExcelImportUtil.importExcel(temporary, ParkExcelVO.class, params);
List<AreaExcelVO> excelDataList = ExcelImportUtil.importExcel(temporary, AreaExcelVO.class, params);
// 导入字段
List<ExcelImFieldModel> columns = new ArrayList<>();
columns.add(new ExcelImFieldModel("parkNumber","园区编码"));
columns.add(new ExcelImFieldModel("parkName","园区名称"));
columns.add(new ExcelImFieldModel("pid","园区名称"));
columns.add(new ExcelImFieldModel("code","区域编码"));
columns.add(new ExcelImFieldModel("spaceNum","空间数量"));
columns.add(new ExcelImFieldModel("name","区域名称"));
headAndDataMap.put("dataRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList)));
headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns)));
} catch (Exception e){
@ -350,18 +354,18 @@ public class ParkController {
listData.add(map);
}
ImportFormCheckUniqueModel uniqueModel = new ImportFormCheckUniqueModel();
uniqueModel.setDbLinkId(ParkConstant.DBLINKID);
uniqueModel.setUpdate(Objects.equals("1", "2"));
ExcelImportModel excelImportModel = generaterSwapUtil.importData(ParkConstant.getFormData(),listData,uniqueModel,
ParkConstant.TABLEFIELDKEY,ParkConstant.getTableList());
uniqueModel.setDbLinkId(AreaConstant.DBLINKID);
uniqueModel.setUpdate(Objects.equals("2", "2"));
ExcelImportModel excelImportModel = generaterSwapUtil.importData(AreaConstant.getFormData(),listData,uniqueModel,
AreaConstant.TABLEFIELDKEY,AreaConstant.getTableList());
List<ImportDataModel> importDataModel = uniqueModel.getImportDataModel();
for (ImportDataModel model : importDataModel) {
String id = model.getId();
Map<String, Object> result = model.getResultData();
if(StringUtil.isNotEmpty(id)){
update(id, JsonUtil.getJsonToBean(result,ParkForm.class), true);
update(id, JsonUtil.getJsonToBean(result,AreaForm.class), true);
}else {
create( JsonUtil.getJsonToBean(result,ParkForm.class));
create( JsonUtil.getJsonToBean(result,AreaForm.class));
}
}
return ActionResult.success(excelImportModel);
@ -376,7 +380,7 @@ public class ParkController {
@PostMapping("/ImportExceptionData")
public ActionResult<DownloadVO> ImportExceptionData(@RequestBody VisualImportModel visualImportModel) {
DownloadVO vo=DownloadVO.builder().build();
List<ParkExcelErrorVO> parkVOList = JsonUtil.getJsonToList(visualImportModel.getList(), ParkExcelErrorVO.class);
List<AreaExcelErrorVO> areaVOList = JsonUtil.getJsonToList(visualImportModel.getList(), AreaExcelErrorVO.class);
UserInfo userInfo = userProvider.get();
try{
@ -384,7 +388,7 @@ public class ParkController {
ExportParams exportParams = new ExportParams(null, "错误报告");
exportParams.setType(ExcelType.XSSF);
workbook = ExcelExportUtil.exportExcel(exportParams,
ParkExcelErrorVO.class, parkVOList);
AreaExcelErrorVO.class, areaVOList);
String fileName = "错误报告" + DateUtil.dateNow("yyyyMMdd") + "_" + RandomUtil.uuId() + ".xlsx";
MultipartFile multipartFile = ExcelUtil.workbookToCommonsMultipartFile(workbook, fileName);
@ -420,24 +424,24 @@ public class ParkController {
/**
*
* @param id
* @param parkForm
* @param areaForm
* @return
*/
@PutMapping("/{id}")
@Operation(summary = "更新")
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid ParkForm parkForm,
public ActionResult update(@PathVariable("id") String id,@RequestBody @Valid AreaForm areaForm,
@RequestParam(value = "isImport", required = false) boolean isImport){
parkForm.setId(id);
areaForm.setId(id);
if (!isImport) {
String b = parkService.checkForm(parkForm,1);
String b = areaService.checkForm(areaForm,1);
if (StringUtil.isNotEmpty(b)){
return ActionResult.fail(b );
}
}
ParkEntity entity= parkService.getInfo(id);
AreaEntity entity= areaService.getInfo(id);
if(entity!=null){
try{
parkService.saveOrUpdate(parkForm,id,false);
areaService.saveOrUpdate(areaForm,id,false);
}catch(Exception e){
return ActionResult.fail("修改数据失败");
}
@ -455,11 +459,11 @@ public class ParkController {
@DeleteMapping("/{id}")
@Transactional
public ActionResult delete(@PathVariable("id") String id){
ParkEntity entity= parkService.getInfo(id);
AreaEntity entity= areaService.getInfo(id);
if(entity!=null){
//假删除
entity.setDeleteMark(1);
parkService.update(id,entity);
areaService.update(id,entity);
}
return ActionResult.success("删除成功");
}
@ -472,16 +476,16 @@ public class ParkController {
@Operation(summary = "表单信息(详情页)")
@GetMapping("/detail/{id}")
public ActionResult detailInfo(@PathVariable("id") String id){
ParkEntity entity= parkService.getInfo(id);
AreaEntity entity= areaService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> parkMap=JsonUtil.entityToMap(entity);
parkMap.put("id", parkMap.get("id"));
Map<String, Object> areaMap=JsonUtil.entityToMap(entity);
areaMap.put("id", areaMap.get("id"));
//副表数据
//子表数据
parkMap = generaterSwapUtil.swapDataDetail(parkMap,ParkConstant.getFormData(),"581462239718932549",false);
return ActionResult.success(parkMap);
areaMap = generaterSwapUtil.swapDataDetail(areaMap,AreaConstant.getFormData(),"582494130148475397",false);
return ActionResult.success(areaMap);
}
/**
* ()
@ -492,16 +496,16 @@ public class ParkController {
@Operation(summary = "信息")
@GetMapping("/{id}")
public ActionResult info(@PathVariable("id") String id){
ParkEntity entity= parkService.getInfo(id);
AreaEntity entity= areaService.getInfo(id);
if(entity==null){
return ActionResult.fail("表单数据不存在!");
}
Map<String, Object> parkMap=JsonUtil.entityToMap(entity);
parkMap.put("id", parkMap.get("id"));
Map<String, Object> areaMap=JsonUtil.entityToMap(entity);
areaMap.put("id", areaMap.get("id"));
//副表数据
//子表数据
parkMap = generaterSwapUtil.swapDataForm(parkMap,ParkConstant.getFormData(),ParkConstant.TABLEFIELDKEY,ParkConstant.TABLERENAMES);
return ActionResult.success(parkMap);
areaMap = generaterSwapUtil.swapDataForm(areaMap,AreaConstant.getFormData(),AreaConstant.TABLEFIELDKEY,AreaConstant.TABLERENAMES);
return ActionResult.success(areaMap);
}
}

@ -50,15 +50,15 @@ import jnpf.base.util.VisualUtils;
import org.springframework.transaction.annotation.Transactional;
/**
* Park
* park
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-17
*/
@Slf4j
@RestController
@Tag(name = "Park" , description = "example")
@Tag(name = "park" , description = "example")
@RequestMapping("/api/example/Park")
public class ParkController {
@ -161,18 +161,21 @@ public class ParkController {
if(keys.length>0){
for(String key:keys){
switch(key){
case "parkNumber" :
entitys.add(new ExcelExportEntity("园区编码" ,"parkNumber"));
case "code" :
entitys.add(new ExcelExportEntity("园区编码" ,"code"));
break;
case "parkName" :
entitys.add(new ExcelExportEntity("园区名称" ,"parkName"));
case "name" :
entitys.add(new ExcelExportEntity("园区名称" ,"name"));
break;
case "parkDescribe" :
entitys.add(new ExcelExportEntity("园区描述" ,"parkDescribe"));
case "description" :
entitys.add(new ExcelExportEntity("园区描述" ,"description"));
break;
case "remark" :
entitys.add(new ExcelExportEntity("备注" ,"remark"));
break;
case "type" :
entitys.add(new ExcelExportEntity("类型" ,"type"));
break;
default:
break;
}
@ -270,8 +273,8 @@ public class ParkController {
//主表对象
List<ExcelExportEntity> entitys = new ArrayList<>();
//以下添加字段
entitys.add(new ExcelExportEntity("园区编码" ,"parkNumber"));
entitys.add(new ExcelExportEntity("园区名称" ,"parkName"));
entitys.add(new ExcelExportEntity("园区编码" ,"code"));
entitys.add(new ExcelExportEntity("园区名称" ,"name"));
List<Map<String, Object>> list = new ArrayList<>();
list.add(dataMap);
@ -326,8 +329,8 @@ public class ParkController {
List<ParkExcelVO> excelDataList = ExcelImportUtil.importExcel(temporary, ParkExcelVO.class, params);
// 导入字段
List<ExcelImFieldModel> columns = new ArrayList<>();
columns.add(new ExcelImFieldModel("parkNumber","园区编码"));
columns.add(new ExcelImFieldModel("parkName","园区名称"));
columns.add(new ExcelImFieldModel("code","园区编码"));
columns.add(new ExcelImFieldModel("name","园区名称"));
headAndDataMap.put("dataRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(excelDataList)));
headAndDataMap.put("headerRow" , JsonUtil.getJsonToList(JsonUtil.getListToJsonArray(columns)));
} catch (Exception e){

@ -0,0 +1,76 @@
package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
@TableName("yq_park_area_space")
public class AreaEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "CODE" , updateStrategy = FieldStrategy.IGNORED)
private String code;
@TableField(value = "NAME" , updateStrategy = FieldStrategy.IGNORED)
private String name;
@TableField(value = "PID" , updateStrategy = FieldStrategy.IGNORED)
private String pid;
@TableField(value = "DESCRIPTION" , updateStrategy = FieldStrategy.IGNORED)
private String description;
@TableField("TYPE")
private String type;
@TableField(value = "SPACE_NUM" , updateStrategy = FieldStrategy.IGNORED)
private BigDecimal spaceNum;
@TableField("SPACE_AREA")
private BigDecimal spaceArea;
@TableField("SPACE_TYPE")
private String spaceType;
@TableField("STATE")
private String state;
@TableField("UNIT_PRICE")
private BigDecimal unitPrice;
@TableField("LEASE_START_TIME")
private Date leaseStartTime;
@TableField("LEASE_END_IME")
private Date leaseEndIme;
@TableField("SORT")
private Long sort;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)
private String remark;
@TableField("F_CREATOR_TIME")
private Date creatorTime;
@TableField("F_CREATOR_USER_ID")
private String creatorUserId;
@TableField("F_LAST_MODIFY_TIME")
private Date lastModifyTime;
@TableField("F_LAST_MODIFY_USER_ID")
private String lastModifyUserId;
@TableField("F_DELETE_TIME")
private Date deleteTime;
@TableField("F_DELETE_USER_ID")
private String deleteUserId;
@TableField("F_DELETE_MARK")
private Integer deleteMark;
@TableField("F_TENANT_ID")
private String tenantId;
@TableField("COMPANY_ID")
private String companyId;
@TableField("DEPARTMENT_ID")
private String departmentId;
@TableField("ORGANIZE_JSON_ID")
private String organizeJsonId;
@TableField("F_VERSION")
private Integer version;
@TableField("F_FLOW_ID")
private String flowId;
}

@ -3,25 +3,46 @@ package jnpf.entity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import java.util.Date;
import java.math.BigDecimal;
import java.math.BigDecimal;
import java.math.BigDecimal;
/**
*
*
*
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-17
*/
@Data
@TableName("yq_park")
@TableName("yq_park_area_space")
public class ParkEntity {
@TableId(value ="ID" )
private String id;
@TableField(value = "PARK_NUMBER" , updateStrategy = FieldStrategy.IGNORED)
private String parkNumber;
@TableField(value = "PARK_NAME" , updateStrategy = FieldStrategy.IGNORED)
private String parkName;
@TableField(value = "PARK_DESCRIBE" , updateStrategy = FieldStrategy.IGNORED)
private String parkDescribe;
@TableField(value = "CODE" , updateStrategy = FieldStrategy.IGNORED)
private String code;
@TableField(value = "NAME" , updateStrategy = FieldStrategy.IGNORED)
private String name;
@TableField("PID")
private String pid;
@TableField(value = "DESCRIPTION" , updateStrategy = FieldStrategy.IGNORED)
private String description;
@TableField(value = "TYPE" , updateStrategy = FieldStrategy.IGNORED)
private String type;
@TableField("SPACE_NUM")
private BigDecimal spaceNum;
@TableField("SPACE_AREA")
private BigDecimal spaceArea;
@TableField("SPACE_TYPE")
private String spaceType;
@TableField("STATE")
private String state;
@TableField("UNIT_PRICE")
private BigDecimal unitPrice;
@TableField("LEASE_START_TIME")
private Date leaseStartTime;
@TableField("LEASE_END_IME")
private Date leaseEndIme;
@TableField("SORT")
private Long sort;
@TableField(value = "REMARK" , updateStrategy = FieldStrategy.IGNORED)

@ -0,0 +1,22 @@
package jnpf.model.area;
import lombok.Data;
import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* area
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
public class AreaExcelErrorVO extends AreaExcelVO{
@Excel(name = "异常原因",orderNum = "999")
@JSONField(name = "errorsInfo")
private String errorsInfo;
}

@ -0,0 +1,46 @@
package jnpf.model.area;
import lombok.Data;
import java.sql.Time;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.alibaba.fastjson.annotation.JSONField;
import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelEntity;
import cn.afterturn.easypoi.excel.annotation.ExcelCollection;
import java.math.BigDecimal;
import java.util.List;
/**
*
* area
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
public class AreaExcelVO{
/** 园区名称 **/
@JSONField(name = "pid")
@Excel(name = "园区名称",orderNum = "1", isImportField = "true" )
private String pid;
/** 区域编码 **/
@JSONField(name = "code")
@Excel(name = "区域编码",orderNum = "1", isImportField = "true" )
private String code;
/** 空间数量 **/
@JSONField(name = "spaceNum")
@Excel(name = "空间数量",orderNum = "1", isImportField = "true" )
private Integer spaceNum;
/** 区域名称 **/
@JSONField(name = "name")
@Excel(name = "区域名称",orderNum = "1", isImportField = "true" )
private String name;
}

@ -0,0 +1,41 @@
package jnpf.model.area;
import lombok.Data;
import java.util.List;
import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* area
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
public class AreaForm {
/** 主键 */
private String id;
/** 乐观锁 **/
@JsonProperty("version")
private Integer version;
/** 园区名称 **/
@JsonProperty("pid")
private String pid;
/** 区域编码 **/
@JsonProperty("code")
private String code;
/** 空间数量 **/
@JsonProperty("spaceNum")
private BigDecimal spaceNum;
/** 区域名称 **/
@JsonProperty("name")
private String name;
/** 区域描述 **/
@JsonProperty("description")
private String description;
/** 备注 **/
@JsonProperty("remark")
private String remark;
}

@ -0,0 +1,36 @@
package jnpf.model.area;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import jnpf.base.Pagination;
import java.util.List;
/**
*
* area
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-16
*/
@Data
public class AreaPagination extends Pagination {
/** 查询key */
private String[] selectKey;
/** json */
private String json;
/** 数据类型 0-当前页1-全部数据 */
private String dataType;
/** 高级查询 */
private String superQueryJson;
/** 功能id */
private String moduleId;
/** 菜单id */
private String menuId;
/** 区域名称 */
@JsonProperty("name")
private Object name;
/** tree */
@JsonProperty("pid")
private Object pid;
}

@ -7,11 +7,11 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
import com.alibaba.fastjson.annotation.JSONField;
/**
*
* Park
* park
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-17
*/
@Data
public class ParkExcelErrorVO extends ParkExcelVO{

@ -13,24 +13,24 @@ import java.math.BigDecimal;
import java.util.List;
/**
*
* Park
* park
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-17
*/
@Data
public class ParkExcelVO{
/** 园区编码 **/
@JSONField(name = "parkNumber")
@JSONField(name = "code")
@Excel(name = "园区编码",orderNum = "1", isImportField = "true" )
private String parkNumber;
private String code;
/** 园区名称 **/
@JSONField(name = "parkName")
@JSONField(name = "name")
@Excel(name = "园区名称",orderNum = "1", isImportField = "true" )
private String parkName;
private String name;
}

@ -6,11 +6,11 @@ import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Park
* park
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-17
*/
@Data
public class ParkForm {
@ -21,15 +21,18 @@ public class ParkForm {
private Integer version;
/** 园区编码 **/
@JsonProperty("parkNumber")
private String parkNumber;
@JsonProperty("code")
private String code;
/** 园区名称 **/
@JsonProperty("parkName")
private String parkName;
@JsonProperty("name")
private String name;
/** 园区描述 **/
@JsonProperty("parkDescribe")
private String parkDescribe;
@JsonProperty("description")
private String description;
/** 备注 **/
@JsonProperty("remark")
private String remark;
/** 类型 **/
@JsonProperty("type")
private Object type;
}

@ -7,11 +7,11 @@ import java.util.List;
/**
*
* Park
* park
* @ V3.5
* @ https://www.jnpfsoft.com
* @ JNPF
* @ 2024-07-15
* @ 2024-07-17
*/
@Data
public class ParkPagination extends Pagination {
@ -28,6 +28,6 @@ public class ParkPagination extends Pagination {
/** 菜单id */
private String menuId;
/** 园区名称 */
@JsonProperty("parkName")
private Object parkName;
@JsonProperty("name")
private Object name;
}

@ -41,7 +41,7 @@ Thumbs.db
.svn/
*.swp
*.swo
*.log
# *.log
*.log.*
*.json.gzip
node_modules/

@ -0,0 +1,135 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
content="详情"/>
<div class="options">
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<jnpf-form-tip-item label="园区名称"
prop="pid" >
<p>{{dataForm.pid}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="区域编码"
prop="code" >
<p>{{dataForm.code}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="空间数量"
prop="spaceNum" >
<JnpfNumber v-model="dataForm.spaceNum"
placeholder="数字文本" disabled
:step="1" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="区域名称"
prop="name" >
<p>{{dataForm.name}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="区域描述"
prop="description" >
<p>{{dataForm.description}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="备注"
prop="remark" >
<p>{{dataForm.remark}}</p>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { Detail},
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
dataForm: {
id :'',
pid : '',
code : '',
spaceNum : '',
name : '',
description : '',
remark : '',
},
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue)
})
})
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
goBack() {
this.$emit('refresh')
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/Area/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,482 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
:content="!dataForm.id ? '新建':'编辑'"/>
<div class="options">
<el-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px">
<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled='prevDis'>
{{'上一条'}}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled='nextDis'>
{{'下一条'}}
</el-dropdown-item>
</template>
<el-dropdown-item type="primary" @click.native="dataFormSubmit(2)"
:loading="continueBtnLoading" :disabled='btnLoading'>
{{!dataForm.id ?'确定并新增':'确定并继续'}}</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
<el-button type="primary" @click="dataFormSubmit()" :loading="btnLoading" :disabled='continueBtnLoading'> </el-button>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="24" >
<jnpf-form-tip-item
label="园区名称" prop="pid" >
<JnpfInput v-model="dataForm.pid" @change="changeData('pid',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item
label="区域编码" prop="code" >
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item
label="空间数量" prop="spaceNum" >
<JnpfInputNumber v-model="dataForm.spaceNum" @change="changeData('spaceNum',-1)"
placeholder="数字文本" :step="1" >
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item
label="区域名称" prop="name" >
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="区域描述" prop="description" >
<JnpfInput v-model="dataForm.description" @change="changeData('description',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item
label="备注" prop="remark" >
<JnpfInput v-model="dataForm.remark" @change="changeData('remark',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog v-if="selectDialogVisible" :config="currTableConf" :formData="dataForm"
ref="selectDialog" @select="addForSelect" @close="selectDialogVisible=false"/>
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import {mapGetters} from "vuex";
import { getDataInterfaceRes } from '@/api/systemData/dataInterface'
import { getDictionaryDataSelector } from '@/api/systemData/dictionary'
import { getDefaultCurrentValueUserId } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentId } from '@/api/permission/organize'
import { getDateDay, getLaterData, getBeforeData, getBeforeTime, getLaterTime } from '@/components/Generator/utils/index.js'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { },
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: 'formRef',
setting:{},
eventType: '',
userBoxVisible:false,
selectDialogVisible: false,
currTableConf:{},
dataValueAll:{},
addTableConf:{
},
//
ableAll:{
},
tableRows:{
},
Vmodel:"",
currVmodel:"",
dataForm: {
pid : undefined,
code : undefined,
spaceNum : undefined,
name : undefined,
description : undefined,
remark : undefined,
version: 0,
},
tableRequiredData: {},
dataRule:
{
pid: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
code: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
spaceNum: [
{
required: true,
message: '数字文本',
trigger: ["blur","change"]
},
],
name: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
},
childIndex:-1,
isEdit:false,
interfaceRes: {
pid:[] ,
code:[] ,
spaceNum:[] ,
name:[] ,
description:[] ,
remark:[] ,
},
}
},
computed: {
...mapGetters(['userInfo'])
},
watch: {},
created() {
this.dataAll()
this.initDefaultData()
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm))
},
mounted() {},
methods: {
prev() {
this.index--
if (this.index === 0) {
this.prevDis = true
}
this.nextDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
next() {
this.index++
if (this.index === this.allList.length - 1) {
this.nextDis = true
}
this.prevDis = false
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id)
}
}
},
getInfo(id) {
request({
url: '/api/example/Area/'+ id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
});
},
goBack() {
this.visible = false
this.$emit('refreshDataList', true)
},
changeData(model, index) {
this.isEdit = false
this.childIndex = index
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key]
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = 'get' + key + 'Options';
if(this[options]){
this[options]()
}
this.changeData(key, index)
}
}
}
}
},
changeDataFormData(type, data, model,index,defaultValue) {
if(!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue
}
}
} else {
this.dataForm[data] = defaultValue
}
}
},
dataAll(){
},
goBack() {
this.$emit('refresh')
},
clearData(){
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll))
},
init(id,isDetail,allList) {
this.prevDis = false
this.nextDis = false
this.allList = allList || []
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id)
if (this.index == 0) {
this.prevDis = true
}
if (this.index == this.allList.length - 1) {
this.nextDis = true
}
} else {
this.prevDis = true
this.nextDis = true
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/Area/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
});
}else{
this.clearData()
this.initDefaultData()
}
});
this.$store.commit('generator/UPDATE_RELATION_DATA', {})
},
//
initDefaultData() {
},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0
this.$refs['formRef'].validate((valid) => {
if (valid) {
this.request()
}
})
},
request() {
let _data =this.dataList()
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true
} else {
this.btnLoading = true
}
if (!this.dataForm.id) {
request({
url: '/api/example/Area',
method: 'post',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData()
this.initDefaultData()
})
this.continueBtnLoading = false
return
}
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(()=>{
this.btnLoading = false
this.continueBtnLoading = false
})
}else{
request({
url: '/api/example/Area/'+this.dataForm.id,
method: 'PUT',
data: _data
}).then((res) => {
this.$message({
message: res.msg,
type: 'success',
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) return this.continueBtnLoading = false
this.visible = false
this.btnLoading = false
this.$emit('refresh', true)
}
})
}).catch(()=>{
this.btnLoading = false
this.continueBtnLoading = false
})
}
},
openSelectDialog(key) {
this.currTableConf=this.addTableConf[key]
this.currVmodel=key
this.selectDialogVisible = true
this.$nextTick(() => {
this.$refs.selectDialog.init()
})
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i]
if(this['get'+this.currVmodel]){
this['get'+this.currVmodel](t)
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData)
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = new Date().getTime()
} else if (timeType == 4) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime()
}
} else if (timeType == 5) {
let previousDate = '';
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue)
timeDataValue = new Date(previousDate).getTime()
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue)
timeDataValue = new Date(previousDate).getTime()
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime()
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == 'HH:mm' ? 'HH:mm:00' : formatType
let timeDataValue = null
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || '00:00:00'
if (timeDataValue.split(':').length == 3) {
timeDataValue = timeDataValue
} else {
timeDataValue = timeDataValue + ':00'
}
} else if (timeType == 2) {
timeDataValue = dataValue
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format)
} else if (timeType == 4) {
let previousDate = '';
previousDate = getBeforeTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
} else if (timeType == 5) {
let previousDate = '';
previousDate = getLaterTime(timeTarget, timeValue)
timeDataValue = this.jnpf.toDate(previousDate, format)
}
}
return timeDataValue;
},
dataList(){
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
this.isEdit = true
this.dataAll()
this.childIndex=-1
},
},
}
</script>

@ -0,0 +1,572 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-left">
<div class="JNPF-common-title">
<h2>左侧标题</h2>
<el-dropdown>
<el-link icon="icon-ym icon-ym-mpMenu" :underline="false" />
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="toggleTreeExpand(true)">展开全部</el-dropdown-item>
<el-dropdown-item @click.native="toggleTreeExpand(false)">折叠全部</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="JNPF-common-tree-search-box">
<el-input placeholder="输入关键字" v-model="keyword" suffix-icon="el-icon-search" clearable />
</div>
<el-tree :data="treeData"
class="JNPF-common-el-tree" highlight-current
ref="treeBox" :expand-on-click-node="false" @node-click="handleNodeClick"
node-key="id"
:props="treeProps"
:default-expand-all="expandsTree"
:filter-node-method="filterNode"
:lazy="false"
v-if="refreshTree">
<span class="custom-tree-node" slot-scope="{ node, data }">
<i :class="data.icon"></i>
<span class="text">{{node.label}}</span>
</span>
</el-tree>
</div>
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="区域名称">
<el-input v-model="query.name" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"></el-button>
<el-button icon="el-icon-refresh-right" @click="reset()"></el-button>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button type="primary" icon="icon-ym icon-ym-btn-add" @click="addOrUpdateHandle()">
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-download" @click="exportData()" >导出
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-upload" @click="handelUpload()" >导入
</el-button>
<el-button type="text" icon="icon-ym icon-ym-btn-clearn" @click="handleBatchRemoveDel()" >批量删除
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link icon="icon-ym icon-ym-filter JNPF-common-head-icon" :underline="false"
@click="openSuperQuery()" />
</el-tooltip>
<el-tooltip effect="dark" :content="$t('common.refresh')" placement="top">
<el-link icon="icon-ym icon-ym-Refresh JNPF-common-head-icon" :underline="false"
@click="initData()" />
</el-tooltip>
</div>
</div>
<JNPF-table v-loading="listLoading" :data="list" @sort-change='sortChange' has-c @selection-change="handleSelectionChange"
:span-method="arraySpanMethod"
>
<el-table-column
prop="pid"
label="园区名称" align="left"
>
</el-table-column>
<el-table-column
prop="code"
label="区域编码" align="left"
>
</el-table-column>
<el-table-column
prop="spaceNum"
label="空间数量" align="left"
>
<template slot-scope="scope" v-if="scope.row.spaceNum" >
<JnpfNumber v-model="scope.row.spaceNum" :thousands="false"/>
</template>
</el-table-column>
<el-table-column
prop="name"
label="区域名称" align="left"
>
</el-table-column>
<el-table-column
prop="description"
label="区域描述" align="left"
>
</el-table-column>
<el-table-column
prop="remark"
label="备注" align="left"
>
</el-table-column>
<el-table-column label="操作"
fixed="right" width="150" >
<template slot-scope="scope" >
<el-button type="text"
@click="addOrUpdateHandle(scope.row)" >编辑
</el-button>
<el-button type="text" class="JNPF-table-delBtn" @click="handleDel(scope.row.id)">
</el-button>
<el-button type="text"
@click="goDetail(scope.row.id)">详情
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination :total="total" :page.sync="listQuery.currentPage" :limit.sync="listQuery.pageSize" @pagination="initData"/>
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh"/>
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download"/>
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail v-if="detailVisible" ref="Detail" @refresh="detailVisible=false"/>
<ToFormDetail v-if="toFormDetailVisible" ref="toFormDetail" @close="toFormDetailVisible = false" />
<SuperQuery v-if="superQueryVisible" ref="SuperQuery" :columnOptions="superQueryJson"
@superQuery="superQuery" />
</div>
</template>
<script>
import request from '@/utils/request'
import {mapGetters} from "vuex";
import {getDictionaryDataSelector} from '@/api/systemData/dictionary'
import JNPFForm from './form'
import Detail from './Detail'
import ExportBox from '@/components/ExportBox'
import ToFormDetail from '@/views/basic/dynamicModel/list/detail'
import {getDataInterfaceRes} from '@/api/systemData/dataInterface'
import { getConfigData } from '@/api/onlineDev/visualDev'
import { getDefaultCurrentValueUserIdAsync } from '@/api/permission/user'
import { getDefaultCurrentValueDepartmentIdAsync } from '@/api/permission/organize'
import columnList from './columnList'
import { thousandsFormat } from "@/components/Generator/utils/index"
import SuperQuery from '@/components/SuperQuery'
import superQueryJson from './superQueryJson'
export default {
components: {
JNPFForm,
Detail,
ExportBox,ToFormDetail , SuperQuery
},
data() {
return {
keyword:'',
expandsTree: true,
refreshTree: true,
toFormDetailVisible:false,
expandObj:{},
columnOptions: [],
mergeList: [],
exportList:[],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
name:undefined,
},
treeProps: {
children: 'children',
label: 'name',
value: 'id',
isLeaf: 'isLeaf'
},
list: [],
listLoading: true,
multipleSelection: [], total: 0,
queryData: {},
listQuery: {
superQueryJson: '',
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
treeData: [],
treeActiveId: '',
interfaceRes: {
},
}
},
watch: {
keyword(val) {
this.$refs.treeBox.filter(val)
}
},
computed: {
...mapGetters(['userInfo']),
menuId() {
return this.$route.meta.modelId || ''
}
},
created() {
this.getColumnList(),
this.getTreeView();
this.queryData = JSON.parse(JSON.stringify(this.query))
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.toFormDetailVisible = true
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue)
})
})
},
toggleTreeExpand(expands) {
this.refreshTree = false
this.expandsTree = expands
this.$nextTick(() => {
this.refreshTree = true
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null)
})
})
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data
const config ={
treeInterfaceId:"",
treeTemplateJson:[]
}
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || ''
}
}
//
let query = {
paramList: config.treeTemplateJson || [],
}
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
})
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList)
},
transformColumnList(columnList) {
let list = []
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes('-')) {
list.push(e)
} else {
let prop = e.prop.split('-')[0]
let label = e.label.split('-')[0]
let vModel = e.prop.split('-')[1]
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
}
e.vModel = vModel
if (!this.expandObj.hasOwnProperty(`${prop}Expand`)) this.$set(this.expandObj, `${prop}Expand`, false)
if (!list.some(o => o.prop === prop)) list.push(newItem)
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e)
break
}
}
}
}
this.getMergeList(list)
this.getExportList(list)
return list
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan]
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list))
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + '-child-first'
}
item.children.unshift(child)
}
})
newList.forEach(item => {
if (item.children && item.children.length ) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
})
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
})
}
})
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
})
}
})
},
getExportList(list) {
let exportList = []
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === 'table') {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j])
}
} else {
exportList.push(list[i])
}
}
this.exportList = exportList
},
goDetail(id){
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(id)
})
},
sortChange({column, prop, order}) {
this.listQuery.sort = order == 'ascending' ? 'asc' : 'desc'
this.listQuery.sidx = !order ? '' : prop
this.initData()
},
getTreeView() {
getDataInterfaceRes('582550261134787397').then(res => {
let data = res.data
this.treeData = data
this.initSearchDataAndListData()
})
},
getNodePath(node) {
let fullPath = []
const loop = (node) => {
if (node.level) fullPath.unshift(node.data)
if (node.parent) loop(node.parent)
}
loop(node)
return fullPath
},
handleNodeClick(data,node) {
this.treeActiveId = data.id
for(let key in this.query)
{
this.query[key] = undefined
}
this.query.pid = data.id
this.listQuery = {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: "",
}
this.initData()
},
async initSearchDataAndListData() {
await this.initSearchData()
this.initData()
},
//
async initSearchData() {
},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId:this.menuId,
moduleId:'582494130148475397',
type:2,
};
request({
url: `/api/example/Area/getList`,
method: 'post',
data: _query
}).then(res => {
var _list =res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj,
}))
this.total = res.data.pagination.total
this.listLoading = false
})
},
handleDel(id) {
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/Area/${id}`,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
});
},
handelUpload(){
this.uploadBoxVisible = true
this.$nextTick(() => {
this.$refs.UploadBox.init("","example/Area")
})
},
handleSelectionChange(val) {
const res = val.map(item => item.id)
this.multipleSelection = res
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: 'error',
message: '请选择一条数据',
duration: 1500,
})
return
}
const ids = this.multipleSelection
this.$confirm('您确定要删除这些数据吗, 是否继续?', '提示', {
type: 'warning'
}).then(() => {
request({
url: `/api/example/Area/batchRemove`,
data: ids,
method: 'DELETE'
}).then(res => {
this.$message({
type: 'success',
message: res.msg,
onClose: () => {
this.initData()
}
});
})
}).catch(() => {
})
},
openSuperQuery() {
this.superQueryVisible = true
this.$nextTick(() => {
this.$refs.SuperQuery.init()
})
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson
this.listQuery.currentPage = 1
this.initData()
},
addOrUpdateHandle(row, isDetail) {
let id = row?row.id:""
this.formVisible = true
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail,this.list)
})
},
exportData() {
this.exportBoxVisible = true
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList)
})
},
download(data) {
let query = {...data, ...this.listQuery, ...this.query,menuId:this.menuId}
request({
url: `/api/example/Area/Actions/Export`,
method: 'post',
data: query
}).then(res => {
if (!res.data.url) return
this.jnpf.downloadFile(res.data.url)
this.$refs.ExportBox.visible = false
this.exportBoxVisible = false
})
},
search() {
this.listQuery.currentPage=1
this.listQuery.pageSize=20
this.listQuery.sort="desc"
this.listQuery.sidx=""
this.initData()
},
refresh(isrRefresh) {
this.formVisible = false
if (isrRefresh) this.reset()
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData))
this.search()
},
colseFlow(isrRefresh) {
this.flowVisible = false
if (isrRefresh) this.reset()
},
}
}
</script>

File diff suppressed because one or more lines are too long

@ -2,26 +2,26 @@
<el-dialog title="详情"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
width="800px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="24" >
<el-col :span="12" >
<jnpf-form-tip-item label="园区编码"
prop="parkNumber" >
<p>{{dataForm.parkNumber}}</p>
prop="code" >
<p>{{dataForm.code}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<el-col :span="12" >
<jnpf-form-tip-item label="园区名称"
prop="parkName" >
<p>{{dataForm.parkName}}</p>
prop="name" >
<p>{{dataForm.name}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<el-col :span="12" >
<jnpf-form-tip-item label="园区描述"
prop="parkDescribe" >
<p>{{dataForm.parkDescribe}}</p>
prop="description" >
<p>{{dataForm.description}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
@ -57,11 +57,14 @@
dataForm: {
id :'',
parkNumber : '',
parkName : '',
parkDescribe : '',
code : '',
name : '',
description : '',
remark : '',
type : "1",
},
typeOptions:[{"fullName":"园区","id":"1"},{"fullName":"区域","id":"2"},{"fullName":"空间","id":"3"}],
typeProps:{"label":"fullName","value":"id" },
}
},

@ -1,2 +1,2 @@
const columnList = [{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"园区编码","label":"园区编码","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区编码","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park","renderKey":1720767684035,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":true,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"parkNumber","showWordLimit":false,"width":0,"__vModel__":"parkNumber","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"parkNumber","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"园区名称","label":"园区名称","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区名称","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park","renderKey":1720767686366,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"parkName","showWordLimit":false,"width":0,"__vModel__":"parkName","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"parkName","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"园区描述","label":"园区描述","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区描述","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park","renderKey":1720767686553,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"parkDescribe","showWordLimit":false,"width":0,"__vModel__":"parkDescribe","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"parkDescribe","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"备注","label":"备注","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"备注","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park","renderKey":1720767686749,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"remark","showWordLimit":false,"width":0,"__vModel__":"remark","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"remark","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
const columnList = [{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"园区编码","label":"园区编码","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区编码","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park_area_space","renderKey":1720767684035,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":true,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"prop":"code","showWordLimit":false,"width":0,"__vModel__":"code","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"code","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"园区名称","label":"园区名称","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区名称","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park_area_space","renderKey":1720767686366,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"prop":"name","showWordLimit":false,"width":0,"__vModel__":"name","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"name","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"园区描述","label":"园区描述","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区描述","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1720767686553,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"prop":"description","showWordLimit":false,"width":0,"__vModel__":"description","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"description","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"jnpfKey":"input","suffixIcon":"","fullName":"备注","label":"备注","sortable":false,"align":"left","addonAfter":"","__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"备注","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1720767686749,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"prop":"remark","showWordLimit":false,"width":0,"__vModel__":"remark","showPassword":false,"fixed":"none","style":{"width":"100%"},"disabled":false,"id":"remark","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
export default columnList

@ -5,31 +5,31 @@
<el-dialog :title="!dataForm.id ? '新建' :'编辑'"
:close-on-click-modal="false" append-to-body
:visible.sync="visible" class="JNPF-dialog JNPF-dialog_center" lock-scroll
width="600px">
width="800px">
<el-row :gutter="15" class="">
<el-form ref="formRef" :model="dataForm" :rules="dataRule" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="24" >
<el-col :span="12" >
<jnpf-form-tip-item
label="园区编码" prop="parkNumber" >
<JnpfInput v-model="dataForm.parkNumber" @change="changeData('parkNumber',-1)"
label="园区编码" prop="code" >
<JnpfInput v-model="dataForm.code" @change="changeData('code',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<el-col :span="12" >
<jnpf-form-tip-item
label="园区名称" prop="parkName" >
<JnpfInput v-model="dataForm.parkName" @change="changeData('parkName',-1)"
label="园区名称" prop="name" >
<JnpfInput v-model="dataForm.name" @change="changeData('name',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<el-col :span="12" >
<jnpf-form-tip-item
label="园区描述" prop="parkDescribe" >
<JnpfInput v-model="dataForm.parkDescribe" @change="changeData('parkDescribe',-1)"
label="园区描述" prop="description" >
<JnpfInput v-model="dataForm.description" @change="changeData('description',-1)"
placeholder="请输入" clearable :style='{"width":"100%"}'>
</JnpfInput>
</jnpf-form-tip-item>
@ -106,23 +106,24 @@
Vmodel:"",
currVmodel:"",
dataForm: {
parkNumber : undefined,
parkName : undefined,
parkDescribe : undefined,
code : undefined,
name : undefined,
description : undefined,
remark : undefined,
type : "1",
version: 0,
},
tableRequiredData: {},
dataRule:
{
parkNumber: [
code: [
{
required: true,
message: '请输入',
trigger: 'blur'
},
],
parkName: [
name: [
{
required: true,
message: '请输入',
@ -130,13 +131,16 @@
},
],
},
typeOptions:[{"fullName":"园区","id":"1"},{"fullName":"区域","id":"2"},{"fullName":"空间","id":"3"}],
typeProps:{"label":"fullName","value":"id" },
childIndex:-1,
isEdit:false,
interfaceRes: {
parkNumber:[] ,
parkName:[] ,
parkDescribe:[] ,
code:[] ,
name:[] ,
description:[] ,
remark:[] ,
type:[] ,
},
}
},

@ -12,7 +12,7 @@
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="园区名称">
<el-input v-model="query.parkName" placeholder="请输入" clearable> </el-input>
<el-input v-model="query.name" placeholder="请输入" clearable> </el-input>
</el-form-item>
</el-col>
<el-col :span="6">
@ -51,17 +51,17 @@
>
<el-table-column
prop="parkNumber"
prop="code"
label="园区编码" align="left"
>
</el-table-column>
<el-table-column
prop="parkName"
prop="name"
label="园区名称" align="left"
>
</el-table-column>
<el-table-column
prop="parkDescribe"
prop="description"
label="园区描述" align="left"
>
</el-table-column>
@ -143,7 +143,7 @@
uploadBoxVisible: false,
detailVisible: false,
query: {
parkName:undefined,
name:undefined,
},
treeProps: {
children: 'children',
@ -167,6 +167,8 @@
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
typeOptions:[{"fullName":"园区","id":"1"},{"fullName":"区域","id":"2"},{"fullName":"空间","id":"3"}],
typeProps:{"label":"fullName","value":"id" },
interfaceRes: {
},
}

@ -1,2 +1,2 @@
const superQueryJson = [{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区编码","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区编码","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park","renderKey":1720767684035,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":true,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"parkNumber","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"parkNumber","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区名称","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区名称","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park","renderKey":1720767686366,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"parkName","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"parkName","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区描述","addonAfter":"","__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区描述","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park","renderKey":1720767686553,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"parkDescribe","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"parkDescribe","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"备注","addonAfter":"","__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"备注","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park","renderKey":1720767686749,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"remark","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"remark","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
const superQueryJson = [{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区编码","addonAfter":"","__config__":{"formId":101,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区编码","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park_area_space","renderKey":1720767684035,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":true,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"code","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"code","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区名称","addonAfter":"","__config__":{"formId":102,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区名称","trigger":"blur","showLabel":true,"required":true,"tableName":"yq_park_area_space","renderKey":1720767686366,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"name","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"name","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"园区描述","addonAfter":"","__config__":{"formId":103,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"园区描述","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1720767686553,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":12},"readonly":false,"showWordLimit":false,"__vModel__":"description","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"description","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"clearable":true,"maxlength":null,"suffixIcon":"","fullName":"备注","addonAfter":"","__config__":{"formId":104,"visibility":["pc","app"],"jnpfKey":"input","noShow":false,"tipLabel":"","dragDisabled":false,"className":[],"label":"备注","trigger":"blur","showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1720767686749,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-input","unique":false,"tag":"JnpfInput","regList":[],"span":24},"readonly":false,"showWordLimit":false,"__vModel__":"remark","showPassword":false,"style":{"width":"100%"},"disabled":false,"id":"remark","placeholder":"请输入","prefixIcon":"","addonBefore":"","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}","blur":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}},{"filterable":false,"clearable":true,"multiple":false,"fullName":"类型","props":{"label":"fullName","value":"id"},"__config__":{"formId":105,"visibility":["pc","app"],"jnpfKey":"select","defaultValue":"1","noShow":true,"dataType":"static","dictionaryType":"","tipLabel":"","dragDisabled":false,"className":[],"label":"类型","trigger":"change","propsUrl":"","templateJson":[],"showLabel":true,"required":false,"tableName":"yq_park_area_space","renderKey":1721036412554,"layout":"colFormItem","tagIcon":"icon-ym icon-ym-generator-select","propsName":"","tag":"JnpfSelect","regList":[],"span":24},"options":[{"fullName":"园区","id":"1"},{"fullName":"区域","id":"2"},{"fullName":"空间","id":"3"}],"__vModel__":"type","style":{"width":"100%"},"disabled":false,"interfaceHasPage":false,"id":"type","placeholder":"请选择","on":{"change":"({ data, formData, setFormData, setShowOrHide, setRequired, setDisabled, onlineUtils }) => {\n // 在此编写代码\n \n}"}}]
export default superQueryJson

@ -0,0 +1,135 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
content="详情"/>
<div class="options">
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="12" >
<jnpf-form-tip-item label="园区名称"
prop="parkId" >
<p>{{dataForm.parkId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="区域编码"
prop="regionNumber" >
<p>{{dataForm.regionNumber}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="区域名称"
prop="regionName" >
<p>{{dataForm.regionName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="空间数量"
prop="spacesNumber" >
<JnpfNumber v-model="dataForm.spacesNumber"
placeholder="数字文本" disabled
:step="1" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="区域描述"
prop="regionDescribe" >
<p>{{dataForm.regionDescribe}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="备注"
prop="remarks" >
<p>{{dataForm.remarks}}</p>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { Detail},
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
dataForm: {
id :'',
parkId : "",
regionNumber : '',
regionName : '',
spacesNumber : '',
regionDescribe : '',
remarks : '',
},
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue)
})
})
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
goBack() {
this.$emit('refresh')
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/Regional/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,553 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header
@back="goBack"
:content="!dataForm.id ? '新建' : '编辑'"
/>
<div class="options">
<el-dropdown class="dropdown" placement="bottom">
<el-button style="width:70px">
<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled="prevDis">
{{ "上一条" }}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled="nextDis">
{{ "下一条" }}
</el-dropdown-item>
</template>
<el-dropdown-item
type="primary"
@click.native="dataFormSubmit(2)"
:loading="continueBtnLoading"
:disabled="btnLoading"
>
{{
!dataForm.id ? "确定并新增" : "确定并继续"
}}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
<el-button
type="primary"
@click="dataFormSubmit()"
:loading="btnLoading"
:disabled="continueBtnLoading"
>
</el-button
>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row
:gutter="15"
class=" main"
:style="{ margin: '0 auto', width: '100%' }"
>
<el-form
ref="formRef"
:model="dataForm"
:rules="dataRule"
size="small"
label-width="100px"
label-position="right"
>
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="12">
<jnpf-form-tip-item label="园区名称" prop="parkId">
<JnpfPopupSelect
v-model="dataForm.parkId"
@change="changeData('parkId', -1)"
:rowIndex="null"
:formData="dataForm"
:templateJson="interfaceRes.parkId"
placeholder="请选择"
propsValue="id"
popupWidth="800px"
popupTitle="选择数据"
popupType="dialog"
relationField="park_name"
field="parkId"
interfaceId="582491427901014533"
:pageSize="20"
:columnOptions="parkIdcolumnOptions"
clearable
:style="{ width: '100%' }"
>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="区域编码" prop="regionNumber">
<JnpfInput
v-model="dataForm.regionNumber"
@change="changeData('regionNumber', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="区域名称" prop="regionName">
<JnpfInput
v-model="dataForm.regionName"
@change="changeData('regionName', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="空间数量" prop="spacesNumber">
<JnpfInputNumber
v-model="dataForm.spacesNumber"
@change="changeData('spacesNumber', -1)"
placeholder="数字文本"
:step="1"
>
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="区域描述" prop="regionDescribe">
<JnpfInput
v-model="dataForm.regionDescribe"
@change="changeData('regionDescribe', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="备注" prop="remarks">
<JnpfInput
v-model="dataForm.remarks"
@change="changeData('remarks', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog
v-if="selectDialogVisible"
:config="currTableConf"
:formData="dataForm"
ref="selectDialog"
@select="addForSelect"
@close="selectDialogVisible = false"
/>
</el-row>
</div>
</transition>
</template>
<script>
import request from "@/utils/request";
import { mapGetters } from "vuex";
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
import { getDefaultCurrentValueUserId } from "@/api/permission/user";
import { getDefaultCurrentValueDepartmentId } from "@/api/permission/organize";
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime
} from "@/components/Generator/utils/index.js";
import { thousandsFormat } from "@/components/Generator/utils/index";
export default {
components: {},
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: "formRef",
setting: {},
eventType: "",
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {},
//
ableAll: {},
tableRows: {},
Vmodel: "",
currVmodel: "",
dataForm: {
parkId: undefined,
regionNumber: undefined,
regionName: undefined,
spacesNumber: undefined,
regionDescribe: undefined,
remarks: undefined,
version: 0
},
tableRequiredData: {},
dataRule: {
parkId: [
{
required: true,
message: "请选择",
trigger: "change"
}
],
regionNumber: [
{
required: true,
message: "请输入",
trigger: "blur"
}
],
regionName: [
{
required: true,
message: "请输入",
trigger: "blur"
}
],
spacesNumber: [
{
required: true,
message: "数字文本",
trigger: ["blur", "change"]
}
]
},
parkIdcolumnOptions: [
{ label: "园区编码", value: "park_number" },
{ label: "园区名称", value: "park_name" }
],
childIndex: -1,
isEdit: false,
interfaceRes: {
parkId: [],
regionNumber: [],
regionName: [],
spacesNumber: [],
regionDescribe: [],
remarks: []
}
};
},
computed: {
...mapGetters(["userInfo"])
},
watch: {},
created() {
this.dataAll();
this.initDefaultData();
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm));
},
mounted() {},
methods: {
prev() {
this.index--;
if (this.index === 0) {
this.prevDis = true;
}
this.nextDis = false;
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id);
}
}
},
next() {
this.index++;
if (this.index === this.allList.length - 1) {
this.nextDis = true;
}
this.prevDis = false;
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id);
}
}
},
getInfo(id) {
request({
url: "/api/example/Regional/" + id,
method: "get"
}).then(res => {
this.dataInfo(res.data);
});
},
goBack() {
this.visible = false;
this.$emit("refreshDataList", true);
},
changeData(model, index) {
this.isEdit = false;
this.childIndex = index;
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key];
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = "get" + key + "Options";
if (this[options]) {
this[options]();
}
this.changeData(key, index);
}
}
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue;
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue;
}
}
} else {
this.dataForm[data] = defaultValue;
}
}
},
dataAll() {},
goBack() {
this.$emit("refresh");
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll));
},
init(id, isDetail, allList) {
this.prevDis = false;
this.nextDis = false;
this.allList = allList || [];
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id);
if (this.index == 0) {
this.prevDis = true;
}
if (this.index == this.allList.length - 1) {
this.nextDis = true;
}
} else {
this.prevDis = true;
this.nextDis = true;
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true;
request({
url: "/api/example/Regional/" + this.dataForm.id,
method: "get"
}).then(res => {
this.dataInfo(res.data);
this.loading = false;
});
} else {
this.clearData();
this.initDefaultData();
}
});
this.$store.commit("generator/UPDATE_RELATION_DATA", {});
},
//
initDefaultData() {},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0;
this.$refs["formRef"].validate(valid => {
if (valid) {
this.request();
}
});
},
request() {
let _data = this.dataList();
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true;
} else {
this.btnLoading = true;
}
if (!this.dataForm.id) {
request({
url: "/api/example/Regional",
method: "post",
data: _data
})
.then(res => {
this.$message({
message: res.msg,
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData();
this.initDefaultData();
});
this.continueBtnLoading = false;
return;
}
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
}
});
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
} else {
request({
url: "/api/example/Regional/" + this.dataForm.id,
method: "PUT",
data: _data
})
.then(res => {
this.$message({
message: res.msg,
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2)
return (this.continueBtnLoading = false);
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
}
});
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key];
this.currVmodel = key;
this.selectDialogVisible = true;
this.$nextTick(() => {
this.$refs.selectDialog.init();
});
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i];
if (this["get" + this.currVmodel]) {
this["get" + this.currVmodel](t);
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData);
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue;
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = new Date().getTime();
} else if (timeType == 4) {
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime();
}
} else if (timeType == 5) {
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime();
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == "HH:mm" ? "HH:mm:00" : formatType;
let timeDataValue = null;
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || "00:00:00";
if (timeDataValue.split(":").length == 3) {
timeDataValue = timeDataValue;
} else {
timeDataValue = timeDataValue + ":00";
}
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format);
} else if (timeType == 4) {
let previousDate = "";
previousDate = getBeforeTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
} else if (timeType == 5) {
let previousDate = "";
previousDate = getLaterTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll;
this.dataForm = _dataAll;
this.isEdit = true;
this.dataAll();
this.childIndex = -1;
}
}
};
</script>

@ -0,0 +1,631 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-left">
<div class="JNPF-common-title">
<h2>{{ title }}</h2>
<el-dropdown>
<el-link icon="icon-ym icon-ym-mpMenu" :underline="false" />
<el-dropdown-menu slot="dropdown">
<el-dropdown-item @click.native="toggleTreeExpand(true)"
>展开全部</el-dropdown-item
>
<el-dropdown-item @click.native="toggleTreeExpand(false)"
>折叠全部</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
</div>
<div class="JNPF-common-tree-search-box">
<el-input
placeholder="输入关键字"
v-model="keyword"
suffix-icon="el-icon-search"
clearable
/>
</div>
<el-tree
:data="treeData"
class="JNPF-common-el-tree"
highlight-current
ref="treeBox"
:expand-on-click-node="false"
@node-click="handleNodeClick"
node-key="id"
:props="treeProps"
:default-expand-all="expandsTree"
:filter-node-method="filterNode"
:lazy="false"
v-if="refreshTree"
>
<span class="custom-tree-node" slot-scope="{ node, data }">
<i :class="data.icon"></i>
<span class="text">{{ node.label }}</span>
</span>
</el-tree>
</div>
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="区域名称">
<el-input
v-model="query.regionName"
placeholder="请输入"
clearable
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"
>查询</el-button
>
<el-button icon="el-icon-refresh-right" @click="reset()"
>重置</el-button
>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button
type="primary"
icon="icon-ym icon-ym-btn-add"
@click="addOrUpdateHandle()"
>新增
</el-button>
<el-button
type="text"
icon="icon-ym icon-ym-btn-download"
@click="exportData()"
>导出
</el-button>
<el-button
type="text"
icon="icon-ym icon-ym-btn-upload"
@click="handelUpload()"
>导入
</el-button>
<el-button
type="text"
icon="icon-ym icon-ym-btn-clearn"
@click="handleBatchRemoveDel()"
>
批量删除
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link
icon="icon-ym icon-ym-filter JNPF-common-head-icon"
:underline="false"
@click="openSuperQuery()"
/>
</el-tooltip>
<el-tooltip
effect="dark"
:content="$t('common.refresh')"
placement="top"
>
<el-link
icon="icon-ym icon-ym-Refresh JNPF-common-head-icon"
:underline="false"
@click="initData()"
/>
</el-tooltip>
</div>
</div>
<JNPF-table
v-loading="listLoading"
:data="list"
@sort-change="sortChange"
has-c
@selection-change="handleSelectionChange"
:span-method="arraySpanMethod"
>
<el-table-column prop="parkId" label="园区名称" align="left">
</el-table-column>
<el-table-column prop="regionNumber" label="区域编码" align="left">
</el-table-column>
<el-table-column prop="regionName" label="区域名称" align="left">
</el-table-column>
<el-table-column prop="regionDescribe" label="区域描述" align="left">
</el-table-column>
<el-table-column prop="spacesNumber" label="空间数量" align="left">
<template slot-scope="scope" v-if="scope.row.spacesNumber">
<JnpfNumber v-model="scope.row.spacesNumber" :thousands="false" />
</template>
</el-table-column>
<el-table-column prop="remarks" label="备注" align="left">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)"
>编辑
</el-button>
<el-button
type="text"
class="JNPF-table-delBtn"
@click="handleDel(scope.row.id)"
>删除
</el-button>
<el-button type="text" @click="goDetail(scope.row.id)"
>详情
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination
:total="total"
:page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize"
@pagination="initData"
/>
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail
v-if="detailVisible"
ref="Detail"
@refresh="detailVisible = false"
/>
<ToFormDetail
v-if="toFormDetailVisible"
ref="toFormDetail"
@close="toFormDetailVisible = false"
/>
<SuperQuery
v-if="superQueryVisible"
ref="SuperQuery"
:columnOptions="superQueryJson"
@superQuery="superQuery"
/>
</div>
</template>
<script>
import request from "@/utils/request";
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
import JNPFForm from "./form";
import Detail from "./Detail";
import ExportBox from "@/components/ExportBox";
import ToFormDetail from "@/views/basic/dynamicModel/list/detail";
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import { getConfigData } from "@/api/onlineDev/visualDev";
import { getDefaultCurrentValueUserIdAsync } from "@/api/permission/user";
import { getDefaultCurrentValueDepartmentIdAsync } from "@/api/permission/organize";
import columnList from "./columnList";
import { thousandsFormat } from "@/components/Generator/utils/index";
import SuperQuery from "@/components/SuperQuery";
import superQueryJson from "./superQueryJson";
export default {
components: {
JNPFForm,
Detail,
ExportBox,
ToFormDetail,
SuperQuery
},
data() {
return {
title: "",
keyword: "",
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
regionName: undefined
},
treeProps: {
children: "children",
label: "name",
value: "id",
isLeaf: "isLeaf"
},
list: [],
listLoading: true,
multipleSelection: [],
total: 0,
queryData: {},
listQuery: {
superQueryJson: "",
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: ""
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
treeData: [],
treeActiveId: "",
interfaceRes: {
parkId: []
}
};
},
watch: {
keyword(val) {
this.$refs.treeBox.filter(val);
}
},
computed: {
...mapGetters(["userInfo"]),
menuId() {
return this.$route.meta.modelId || "";
}
},
created() {
this.getColumnList(), this.getTreeView();
this.queryData = JSON.parse(JSON.stringify(this.query));
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return;
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return;
let formData = JSON.parse(res.data.formData);
formData.popupType = "general";
this.toFormDetailVisible = true;
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue);
});
});
},
toggleTreeExpand(expands) {
this.refreshTree = false;
this.expandsTree = expands;
this.$nextTick(() => {
this.refreshTree = true;
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null);
});
});
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data;
const config = {
treeInterfaceId: "",
treeTemplateJson: []
};
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || "";
}
}
//
let query = {
paramList: config.treeTemplateJson || []
};
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data;
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
});
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList);
},
transformColumnList(columnList) {
let list = [];
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes("-")) {
list.push(e);
} else {
let prop = e.prop.split("-")[0];
let label = e.label.split("-")[0];
let vModel = e.prop.split("-")[1];
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
};
e.vModel = vModel;
if (!this.expandObj.hasOwnProperty(`${prop}Expand`))
this.$set(this.expandObj, `${prop}Expand`, false);
if (!list.some(o => o.prop === prop)) list.push(newItem);
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e);
break;
}
}
}
}
this.getMergeList(list);
this.getExportList(list);
return list;
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan];
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list));
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + "-child-first"
};
item.children.unshift(child);
}
});
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
});
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
});
}
});
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
});
}
});
},
getExportList(list) {
let exportList = [];
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === "table") {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j]);
}
} else {
exportList.push(list[i]);
}
}
this.exportList = exportList;
},
goDetail(id) {
this.detailVisible = true;
this.$nextTick(() => {
this.$refs.Detail.init(id);
});
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == "ascending" ? "asc" : "desc";
this.listQuery.sidx = !order ? "" : prop;
this.initData();
},
getTreeView() {
request({
url: `/api/example/Regional/regionalTree`,
method: "get"
}).then(res => {
debugger;
this.treeData = res.data;
this.initSearchDataAndListData();
});
},
getNodePath(node) {
let fullPath = [];
const loop = node => {
if (node.level) fullPath.unshift(node.data);
if (node.parent) loop(node.parent);
};
loop(node);
return fullPath;
},
handleNodeClick(data, node) {
debugger;
this.title = data.name;
this.treeActiveId = data.id;
for (let key in this.query) {
this.query[key] = undefined;
}
this.query.parkId = data.id;
this.listQuery = {
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: ""
};
this.initData();
},
async initSearchDataAndListData() {
await this.initSearchData();
this.initData();
},
//
async initSearchData() {},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: "582494130148475397",
type: 2
};
request({
url: `/api/example/Regional/getList`,
method: "post",
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj
}));
this.total = res.data.pagination.total;
this.listLoading = false;
});
},
handleDel(id) {
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
type: "warning"
})
.then(() => {
request({
url: `/api/example/Regional/${id}`,
method: "DELETE"
}).then(res => {
this.$message({
type: "success",
message: res.msg,
onClose: () => {
this.initData();
}
});
});
})
.catch(() => {});
},
handelUpload() {
this.uploadBoxVisible = true;
this.$nextTick(() => {
this.$refs.UploadBox.init("", "example/Regional");
});
},
handleSelectionChange(val) {
const res = val.map(item => item.id);
this.multipleSelection = res;
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: "error",
message: "请选择一条数据",
duration: 1500
});
return;
}
const ids = this.multipleSelection;
this.$confirm("您确定要删除这些数据吗, 是否继续?", "提示", {
type: "warning"
})
.then(() => {
request({
url: `/api/example/Regional/batchRemove`,
data: ids,
method: "DELETE"
}).then(res => {
this.$message({
type: "success",
message: res.msg,
onClose: () => {
this.initData();
}
});
});
})
.catch(() => {});
},
openSuperQuery() {
this.superQueryVisible = true;
this.$nextTick(() => {
this.$refs.SuperQuery.init();
});
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson;
this.listQuery.currentPage = 1;
this.initData();
},
addOrUpdateHandle(row, isDetail) {
let id = row ? row.id : "";
this.formVisible = true;
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail, this.list);
});
},
exportData() {
this.exportBoxVisible = true;
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList);
});
},
download(data) {
let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
};
request({
url: `/api/example/Regional/Actions/Export`,
method: "post",
data: query
}).then(res => {
if (!res.data.url) return;
this.jnpf.downloadFile(res.data.url);
this.$refs.ExportBox.visible = false;
this.exportBoxVisible = false;
});
},
search() {
this.listQuery.currentPage = 1;
this.listQuery.pageSize = 20;
this.listQuery.sort = "desc";
this.listQuery.sidx = "";
this.initData();
},
refresh(isrRefresh) {
this.formVisible = false;
if (isrRefresh) this.reset();
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData));
this.search();
},
colseFlow(isrRefresh) {
this.flowVisible = false;
if (isrRefresh) this.reset();
}
}
};
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,156 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<Detail v-if="detailVisible" ref="Detail" @close="detailVisible = false" />
<div class="JNPF-common-page-header">
<el-page-header @back="goBack"
content="详情"/>
<div class="options">
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row :gutter="15" class=" main" :style="{margin: '0 auto',width: '100%'}">
<el-form ref="formRef" :model="dataForm" size="small" label-width="100px" label-position="right" >
<template v-if="!loading">
<el-col :span="12" >
<jnpf-form-tip-item label="区域名称"
prop="regionId" >
<p>{{dataForm.regionId}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="空间编码"
prop="spaceCode" >
<p>{{dataForm.spaceCode}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="空间名称"
prop="spaceName" >
<p>{{dataForm.spaceName}}</p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="空间面积"
prop="spaceArea" >
<JnpfNumber v-model="dataForm.spaceArea"
placeholder="数字文本" disabled
:step="1" addonAfter="m²" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="空间类型"
prop="spaceType" >
<p>{{ dataForm.spaceType }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="单价"
prop="unitPrice" >
<JnpfNumber v-model="dataForm.unitPrice"
placeholder="数字文本" disabled
:step="1" addonAfter="元/m²" >
</JnpfNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12" >
<jnpf-form-tip-item label="状态"
prop="state" >
<p>{{ dataForm.state }} </p>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24" >
<jnpf-form-tip-item label="备注"
prop="remark" >
<p>{{dataForm.remark}}</p>
</jnpf-form-tip-item>
</el-col>
</template>
</el-form>
</el-row>
</div>
</transition>
</template>
<script>
import request from '@/utils/request'
import { getConfigData } from '@/api/onlineDev/visualDev'
import jnpf from '@/utils/jnpf'
import Detail from '@/views/basic/dynamicModel/list/detail'
import { thousandsFormat } from "@/components/Generator/utils/index"
export default {
components: { Detail},
props: [],
data() {
return {
visible: false,
detailVisible: false,
loading: false,
dataForm: {
id :'',
regionId : "",
spaceCode : '',
spaceName : '',
spaceArea : '',
spaceType : "",
unitPrice : '',
state : "10",
remark : '',
},
spaceTypeOptions:[{"fullName":"办公室","id":"10"},{"fullName":"加工车间","id":"20"}],
spaceTypeProps:{"label":"fullName","value":"id" },
stateOptions:[{"fullName":"待租","id":"10"},{"fullName":"已租","id":"20"},{"fullName":"装修","id":"30"},{"fullName":"预约","id":"40"}],
stateProps:{"label":"fullName","value":"id" },
}
},
computed: {},
watch: {},
created() {
},
mounted() {},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return
let formData = JSON.parse(res.data.formData)
formData.popupType = 'general'
this.detailVisible = true
this.$nextTick(() => {
this.$refs.Detail.init(formData, modelId, defaultValue)
})
})
},
dataInfo(dataAll){
let _dataAll =dataAll
this.dataForm = _dataAll
},
goBack() {
this.$emit('refresh')
},
init(id) {
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if(this.dataForm.id){
this.loading = true
request({
url: '/api/example/Spatial/detail/'+this.dataForm.id,
method: 'get'
}).then(res => {
this.dataInfo(res.data)
this.loading = false
})
}
})
},
},
}
</script>

File diff suppressed because one or more lines are too long

@ -0,0 +1,606 @@
<template>
<transition name="el-zoom-in-center">
<div class="JNPF-preview-main">
<div class="JNPF-common-page-header">
<el-page-header
@back="goBack"
:content="!dataForm.id ? '新建' : '编辑'"
/>
<div class="options">
<el-dropdown class="dropdown" placement="bottom">
<el-button style="width: 70px">
<i class="el-icon-arrow-down el-icon--right"></i>
</el-button>
<el-dropdown-menu slot="dropdown">
<template v-if="dataForm.id">
<el-dropdown-item @click.native="prev" :disabled="prevDis">
{{ "上一条" }}
</el-dropdown-item>
<el-dropdown-item @click.native="next" :disabled="nextDis">
{{ "下一条" }}
</el-dropdown-item>
</template>
<el-dropdown-item
type="primary"
@click.native="dataFormSubmit(2)"
:loading="continueBtnLoading"
:disabled="btnLoading"
>
{{
!dataForm.id ? "确定并新增" : "确定并继续"
}}</el-dropdown-item
>
</el-dropdown-menu>
</el-dropdown>
<el-button
type="primary"
@click="dataFormSubmit()"
:loading="btnLoading"
:disabled="continueBtnLoading"
>
</el-button
>
<el-button @click="goBack"> </el-button>
</div>
</div>
<el-row
:gutter="15"
class="main"
:style="{ margin: '0 auto', width: '100%' }"
>
<el-form
ref="formRef"
:model="dataForm"
:rules="dataRule"
size="small"
label-width="100px"
label-position="right"
>
<template v-if="!loading">
<!-- 具体表单 -->
<el-col :span="12">
<jnpf-form-tip-item label="区域名称" prop="regionId">
<JnpfPopupSelect
v-model="dataForm.regionId"
@change="changeData('regionId', -1)"
:rowIndex="null"
:formData="dataForm"
:templateJson="interfaceRes.regionId"
placeholder="请选择"
propsValue="id"
popupWidth="800px"
popupTitle="选择数据"
popupType="dialog"
relationField="region_name"
field="regionId"
interfaceId="582538983687324421"
:pageSize="20"
:columnOptions="regionIdcolumnOptions"
clearable
:style="{ width: '100%' }"
>
</JnpfPopupSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="空间编码" prop="spaceCode">
<JnpfInput
v-model="dataForm.spaceCode"
@change="changeData('spaceCode', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="空间名称" prop="spaceName">
<JnpfInput
v-model="dataForm.spaceName"
@change="changeData('spaceName', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="空间面积" prop="spaceArea">
<JnpfInputNumber
v-model="dataForm.spaceArea"
@change="changeData('spaceArea', -1)"
placeholder="数字文本"
addonAfter="m²"
:step="1"
>
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="空间类型" prop="spaceType">
<JnpfSelect
v-model="dataForm.spaceType"
@change="changeData('spaceType', -1)"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
:options="spaceTypeOptions"
:props="spaceTypeProps"
>
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="单价" prop="unitPrice">
<JnpfInputNumber
v-model="dataForm.unitPrice"
@change="changeData('unitPrice', -1)"
placeholder="数字文本"
addonAfter="元/m²"
:step="1"
>
</JnpfInputNumber>
</jnpf-form-tip-item>
</el-col>
<el-col :span="12">
<jnpf-form-tip-item label="状态" prop="state">
<JnpfSelect
v-model="dataForm.state"
@change="changeData('state', -1)"
placeholder="请选择"
clearable
:style="{ width: '100%' }"
:options="stateOptions"
:props="stateProps"
>
</JnpfSelect>
</jnpf-form-tip-item>
</el-col>
<el-col :span="24">
<jnpf-form-tip-item label="备注" prop="remark">
<JnpfInput
v-model="dataForm.remark"
@change="changeData('remark', -1)"
placeholder="请输入"
clearable
:style="{ width: '100%' }"
>
</JnpfInput>
</jnpf-form-tip-item>
</el-col>
<!-- 表单结束 -->
</template>
</el-form>
<SelectDialog
v-if="selectDialogVisible"
:config="currTableConf"
:formData="dataForm"
ref="selectDialog"
@select="addForSelect"
@close="selectDialogVisible = false"
/>
</el-row>
</div>
</transition>
</template>
<script>
import request from "@/utils/request";
import { mapGetters } from "vuex";
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
import { getDefaultCurrentValueUserId } from "@/api/permission/user";
import { getDefaultCurrentValueDepartmentId } from "@/api/permission/organize";
import {
getDateDay,
getLaterData,
getBeforeData,
getBeforeTime,
getLaterTime
} from "@/components/Generator/utils/index.js";
import { thousandsFormat } from "@/components/Generator/utils/index";
export default {
components: {},
props: [],
data() {
return {
dataFormSubmitType: 0,
continueBtnLoading: false,
index: 0,
prevDis: false,
nextDis: false,
allList: [],
visible: false,
loading: false,
btnLoading: false,
formRef: "formRef",
setting: {},
eventType: "",
userBoxVisible: false,
selectDialogVisible: false,
currTableConf: {},
dataValueAll: {},
addTableConf: {},
//
ableAll: {},
tableRows: {},
Vmodel: "",
currVmodel: "",
dataForm: {
regionId: undefined,
spaceCode: undefined,
spaceName: undefined,
spaceArea: undefined,
spaceType: undefined,
unitPrice: undefined,
state: "10",
remark: undefined,
version: 0
},
tableRequiredData: {},
dataRule: {
regionId: [
{
required: true,
message: "请选择",
trigger: "change"
}
],
spaceCode: [
{
required: true,
message: "请输入",
trigger: "blur"
}
],
spaceName: [
{
required: true,
message: "请输入",
trigger: "blur"
}
],
spaceArea: [
{
required: true,
message: "数字文本",
trigger: ["blur", "change"]
}
],
spaceType: [
{
required: true,
message: "请选择",
trigger: "change"
}
]
},
regionIdcolumnOptions: [
{ label: "区域编码", value: "region_number" },
{ label: "区域名称", value: "region_name" },
{ label: "空间数量", value: "spaces_number" }
],
spaceTypeOptions: [
{ fullName: "办公室", id: "10" },
{ fullName: "加工车间", id: "20" }
],
spaceTypeProps: { label: "fullName", value: "id" },
stateOptions: [
{ fullName: "待租", id: "10" },
{ fullName: "已租", id: "20" },
{ fullName: "装修", id: "30" },
{ fullName: "预约", id: "40" }
],
stateProps: { label: "fullName", value: "id" },
childIndex: -1,
isEdit: false,
interfaceRes: {
regionId: [],
spaceCode: [],
spaceName: [],
spaceArea: [],
spaceType: [],
unitPrice: [],
state: [],
remark: []
}
};
},
computed: {
...mapGetters(["userInfo"])
},
watch: {},
created() {
this.dataAll();
this.initDefaultData();
this.dataValueAll = JSON.parse(JSON.stringify(this.dataForm));
},
mounted() {},
methods: {
prev() {
this.index--;
if (this.index === 0) {
this.prevDis = true;
}
this.nextDis = false;
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id);
}
}
},
next() {
this.index++;
if (this.index === this.allList.length - 1) {
this.nextDis = true;
}
this.prevDis = false;
for (let index = 0; index < this.allList.length; index++) {
const element = this.allList[index];
if (this.index == index) {
this.getInfo(element.id);
}
}
},
getInfo(id) {
request({
url: "/api/example/Spatial/" + id,
method: "get"
}).then(res => {
this.dataInfo(res.data);
});
},
goBack() {
this.visible = false;
this.$emit("refreshDataList", true);
},
changeData(model, index) {
this.isEdit = false;
this.childIndex = index;
let modelAll = model.split("-");
let faceMode = "";
for (let i = 0; i < modelAll.length; i++) {
faceMode += modelAll[i];
}
for (let key in this.interfaceRes) {
if (key != faceMode) {
let faceReList = this.interfaceRes[key];
for (let i = 0; i < faceReList.length; i++) {
if (faceReList[i].relationField == model) {
let options = "get" + key + "Options";
if (this[options]) {
this[options]();
}
this.changeData(key, index);
}
}
}
}
},
changeDataFormData(type, data, model, index, defaultValue) {
if (!this.isEdit) {
if (type == 2) {
for (let i = 0; i < this.dataForm[data].length; i++) {
if (index == -1) {
this.dataForm[data][i][model] = defaultValue;
} else if (index == i) {
this.dataForm[data][i][model] = defaultValue;
}
}
} else {
this.dataForm[data] = defaultValue;
}
}
},
dataAll() {},
goBack() {
this.$emit("refresh");
},
clearData() {
this.dataForm = JSON.parse(JSON.stringify(this.dataValueAll));
},
init(id, isDetail, allList) {
this.prevDis = false;
this.nextDis = false;
this.allList = allList || [];
if (allList.length) {
this.index = this.allList.findIndex(item => item.id === id);
if (this.index == 0) {
this.prevDis = true;
}
if (this.index == this.allList.length - 1) {
this.nextDis = true;
}
} else {
this.prevDis = true;
this.nextDis = true;
}
this.dataForm.id = id || 0;
this.visible = true;
this.$nextTick(() => {
if (this.dataForm.id) {
this.loading = true;
request({
url: "/api/example/Spatial/" + this.dataForm.id,
method: "get"
}).then(res => {
this.dataInfo(res.data);
this.loading = false;
});
} else {
this.clearData();
this.initDefaultData();
}
});
this.$store.commit("generator/UPDATE_RELATION_DATA", {});
},
//
initDefaultData() {},
//
dataFormSubmit(type) {
this.dataFormSubmitType = type ? type : 0;
this.$refs["formRef"].validate(valid => {
if (valid) {
this.request();
}
});
},
request() {
let _data = this.dataList();
if (this.dataFormSubmitType == 2) {
this.continueBtnLoading = true;
} else {
this.btnLoading = true;
}
if (!this.dataForm.id) {
request({
url: "/api/example/Spatial",
method: "post",
data: _data
})
.then(res => {
this.$message({
message: res.msg,
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2) {
this.$nextTick(() => {
this.clearData();
this.initDefaultData();
});
this.continueBtnLoading = false;
return;
}
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
}
});
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
} else {
request({
url: "/api/example/Spatial/" + this.dataForm.id,
method: "PUT",
data: _data
})
.then(res => {
this.$message({
message: res.msg,
type: "success",
duration: 1000,
onClose: () => {
if (this.dataFormSubmitType == 2)
return (this.continueBtnLoading = false);
this.visible = false;
this.btnLoading = false;
this.$emit("refresh", true);
}
});
})
.catch(() => {
this.btnLoading = false;
this.continueBtnLoading = false;
});
}
},
openSelectDialog(key) {
this.currTableConf = this.addTableConf[key];
this.currVmodel = key;
this.selectDialogVisible = true;
this.$nextTick(() => {
this.$refs.selectDialog.init();
});
},
addForSelect(data) {
for (let i = 0; i < data.length; i++) {
let t = data[i];
if (this["get" + this.currVmodel]) {
this["get" + this.currVmodel](t);
}
}
},
dateTime(timeRule, timeType, timeTarget, timeValueData, dataValue) {
let timeDataValue = null;
let timeValue = Number(timeValueData);
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue;
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = new Date().getTime();
} else if (timeType == 4) {
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getBeforeData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getBeforeTime(timeTarget, timeValue).getTime();
}
} else if (timeType == 5) {
let previousDate = "";
if (timeTarget == 1 || timeTarget == 2) {
previousDate = getDateDay(timeTarget, timeType, timeValue);
timeDataValue = new Date(previousDate).getTime();
} else if (timeTarget == 3) {
previousDate = getLaterData(timeValue);
timeDataValue = new Date(previousDate).getTime();
} else {
timeDataValue = getLaterTime(timeTarget, timeValue).getTime();
}
}
}
return timeDataValue;
},
time(timeRule, timeType, timeTarget, timeValue, formatType, dataValue) {
let format = formatType == "HH:mm" ? "HH:mm:00" : formatType;
let timeDataValue = null;
if (timeRule) {
if (timeType == 1) {
timeDataValue = timeValue || "00:00:00";
if (timeDataValue.split(":").length == 3) {
timeDataValue = timeDataValue;
} else {
timeDataValue = timeDataValue + ":00";
}
} else if (timeType == 2) {
timeDataValue = dataValue;
} else if (timeType == 3) {
timeDataValue = this.jnpf.toDate(new Date(), format);
} else if (timeType == 4) {
let previousDate = "";
previousDate = getBeforeTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
} else if (timeType == 5) {
let previousDate = "";
previousDate = getLaterTime(timeTarget, timeValue);
timeDataValue = this.jnpf.toDate(previousDate, format);
}
}
return timeDataValue;
},
dataList() {
var _data = this.dataForm;
return _data;
},
dataInfo(dataAll) {
let _dataAll = dataAll;
this.dataForm = _dataAll;
this.isEdit = true;
this.dataAll();
this.childIndex = -1;
}
}
};
</script>

@ -0,0 +1,569 @@
<template>
<div class="JNPF-common-layout">
<div class="JNPF-common-layout-center">
<el-row class="JNPF-common-search-box" :gutter="16">
<el-form @submit.native.prevent>
<el-col :span="6">
<el-form-item label="空间名称">
<el-input
v-model="query.spaceName"
placeholder="请输入"
clearable
>
</el-input>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="search()"
>查询</el-button
>
<el-button icon="el-icon-refresh-right" @click="reset()"
>重置</el-button
>
</el-form-item>
</el-col>
</el-form>
</el-row>
<div class="JNPF-common-layout-main JNPF-flex-main">
<div class="JNPF-common-head">
<div>
<el-button
type="primary"
icon="icon-ym icon-ym-btn-add"
@click="addOrUpdateHandle()"
>新增
</el-button>
<el-button
type="text"
icon="icon-ym icon-ym-btn-download"
@click="exportData()"
>导出
</el-button>
<el-button
type="text"
icon="icon-ym icon-ym-btn-upload"
@click="handelUpload()"
>导入
</el-button>
<el-button
type="text"
icon="icon-ym icon-ym-btn-clearn"
@click="handleBatchRemoveDel()"
>批量删除
</el-button>
</div>
<div class="JNPF-common-head-right">
<el-tooltip content="高级查询" placement="top" v-if="true">
<el-link
icon="icon-ym icon-ym-filter JNPF-common-head-icon"
:underline="false"
@click="openSuperQuery()"
/>
</el-tooltip>
<el-tooltip
effect="dark"
:content="$t('common.refresh')"
placement="top"
>
<el-link
icon="icon-ym icon-ym-Refresh JNPF-common-head-icon"
:underline="false"
@click="initData()"
/>
</el-tooltip>
</div>
</div>
<JNPF-table
v-loading="listLoading"
:data="list"
@sort-change="sortChange"
has-c
@selection-change="handleSelectionChange"
:span-method="arraySpanMethod"
>
<el-table-column prop="regionId" label="区域名称" align="left">
</el-table-column>
<el-table-column prop="spaceCode" label="空间编码" align="left">
</el-table-column>
<el-table-column prop="spaceName" label="空间名称" align="left">
</el-table-column>
<el-table-column prop="spaceArea" label="空间面积" align="left">
<template slot-scope="scope" v-if="scope.row.spaceArea">
<JnpfNumber v-model="scope.row.spaceArea" :thousands="false" />
</template>
</el-table-column>
<el-table-column label="空间类型" prop="spaceType" algin="left">
<template slot-scope="scope">
{{ scope.row.spaceType }}
</template>
</el-table-column>
<el-table-column prop="unitPrice" label="单价" align="left">
<template slot-scope="scope" v-if="scope.row.unitPrice">
<JnpfNumber v-model="scope.row.unitPrice" :thousands="false" />
</template>
</el-table-column>
<el-table-column label="状态" prop="state" algin="left">
<template slot-scope="scope">
{{ scope.row.state }}
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" align="left">
</el-table-column>
<el-table-column label="操作" fixed="right" width="150">
<template slot-scope="scope">
<el-button type="text" @click="addOrUpdateHandle(scope.row)"
>编辑
</el-button>
<el-button
type="text"
class="JNPF-table-delBtn"
@click="handleDel(scope.row.id)"
>删除
</el-button>
<el-button type="text" @click="goDetail(scope.row.id)"
>详情
</el-button>
</template>
</el-table-column>
</JNPF-table>
<pagination
:total="total"
:page.sync="listQuery.currentPage"
:limit.sync="listQuery.pageSize"
@pagination="initData"
/>
</div>
</div>
<JNPF-Form v-if="formVisible" ref="JNPFForm" @refresh="refresh" />
<ExportBox v-if="exportBoxVisible" ref="ExportBox" @download="download" />
<ImportBox v-if="uploadBoxVisible" ref="UploadBox" @refresh="initData" />
<Detail
v-if="detailVisible"
ref="Detail"
@refresh="detailVisible = false"
/>
<ToFormDetail
v-if="toFormDetailVisible"
ref="toFormDetail"
@close="toFormDetailVisible = false"
/>
<SuperQuery
v-if="superQueryVisible"
ref="SuperQuery"
:columnOptions="superQueryJson"
@superQuery="superQuery"
/>
</div>
</template>
<script>
import request from "@/utils/request";
import { mapGetters } from "vuex";
import { getDictionaryDataSelector } from "@/api/systemData/dictionary";
import JNPFForm from "./form";
import Detail from "./Detail";
import ExportBox from "@/components/ExportBox";
import ToFormDetail from "@/views/basic/dynamicModel/list/detail";
import { getDataInterfaceRes } from "@/api/systemData/dataInterface";
import { getConfigData } from "@/api/onlineDev/visualDev";
import { getDefaultCurrentValueUserIdAsync } from "@/api/permission/user";
import { getDefaultCurrentValueDepartmentIdAsync } from "@/api/permission/organize";
import columnList from "./columnList";
import { thousandsFormat } from "@/components/Generator/utils/index";
import SuperQuery from "@/components/SuperQuery";
import superQueryJson from "./superQueryJson";
export default {
components: {
JNPFForm,
Detail,
ExportBox,
ToFormDetail,
SuperQuery
},
data() {
return {
keyword: "",
expandsTree: true,
refreshTree: true,
toFormDetailVisible: false,
expandObj: {},
columnOptions: [],
mergeList: [],
exportList: [],
columnList,
superQueryVisible: false,
superQueryJson,
uploadBoxVisible: false,
detailVisible: false,
query: {
spaceName: undefined
},
treeProps: {
children: "children",
label: "fullName",
value: "id",
isLeaf: "isLeaf"
},
list: [],
listLoading: true,
multipleSelection: [],
total: 0,
queryData: {},
listQuery: {
superQueryJson: "",
currentPage: 1,
pageSize: 20,
sort: "desc",
sidx: ""
},
formVisible: false,
flowVisible: false,
flowListVisible: false,
flowList: [],
exportBoxVisible: false,
spaceTypeOptions: [
{ fullName: "办公室", id: "10" },
{ fullName: "加工车间", id: "20" }
],
spaceTypeProps: { label: "fullName", value: "id" },
stateOptions: [
{ fullName: "待租", id: "10" },
{ fullName: "已租", id: "20" },
{ fullName: "装修", id: "30" },
{ fullName: "预约", id: "40" }
],
stateProps: { label: "fullName", value: "id" },
interfaceRes: {
regionId: []
}
};
},
computed: {
...mapGetters(["userInfo"]),
menuId() {
return this.$route.meta.modelId || "";
}
},
created() {
this.getColumnList(), this.initSearchDataAndListData();
this.queryData = JSON.parse(JSON.stringify(this.query));
},
methods: {
toDetail(defaultValue, modelId) {
if (!defaultValue) return;
getConfigData(modelId).then(res => {
if (!res.data || !res.data.formData) return;
let formData = JSON.parse(res.data.formData);
formData.popupType = "general";
this.toFormDetailVisible = true;
this.$nextTick(() => {
this.$refs.toFormDetail.init(formData, modelId, defaultValue);
});
});
},
toggleTreeExpand(expands) {
this.refreshTree = false;
this.expandsTree = expands;
this.$nextTick(() => {
this.refreshTree = true;
this.$nextTick(() => {
this.$refs.treeBox.setCurrentKey(null);
});
});
},
filterNode(value, data) {
if (!value) return true;
return data[this.treeProps.label].indexOf(value) !== -1;
},
loadNode(node, resolve) {
const nodeData = node.data;
const config = {
treeInterfaceId: "",
treeTemplateJson: []
};
if (config.treeInterfaceId) {
//
if (config.treeTemplateJson && config.treeTemplateJson.length) {
for (let i = 0; i < config.treeTemplateJson.length; i++) {
const element = config.treeTemplateJson[i];
element.defaultValue = nodeData[element.relationField] || "";
}
}
//
let query = {
paramList: config.treeTemplateJson || []
};
//
getDataInterfaceRes(config.treeInterfaceId, query).then(res => {
let data = res.data;
if (Array.isArray(data)) {
resolve(data);
} else {
resolve([]);
}
});
}
},
getColumnList() {
//
this.columnOptions = this.transformColumnList(this.columnList);
},
transformColumnList(columnList) {
let list = [];
for (let i = 0; i < columnList.length; i++) {
const e = columnList[i];
if (!e.prop.includes("-")) {
list.push(e);
} else {
let prop = e.prop.split("-")[0];
let label = e.label.split("-")[0];
let vModel = e.prop.split("-")[1];
let newItem = {
align: "center",
jnpfKey: "table",
prop,
label,
children: []
};
e.vModel = vModel;
if (!this.expandObj.hasOwnProperty(`${prop}Expand`))
this.$set(this.expandObj, `${prop}Expand`, false);
if (!list.some(o => o.prop === prop)) list.push(newItem);
for (let i = 0; i < list.length; i++) {
if (list[i].prop === prop) {
list[i].children.push(e);
break;
}
}
}
}
this.getMergeList(list);
this.getExportList(list);
return list;
},
arraySpanMethod({ column }) {
for (let i = 0; i < this.mergeList.length; i++) {
if (column.property == this.mergeList[i].prop) {
return [this.mergeList[i].rowspan, this.mergeList[i].colspan];
}
}
},
getMergeList(list) {
let newList = JSON.parse(JSON.stringify(list));
newList.forEach(item => {
if (item.children && item.children.length) {
let child = {
prop: item.prop + "-child-first"
};
item.children.unshift(child);
}
});
newList.forEach(item => {
if (item.children && item.children.length) {
item.children.forEach((child, index) => {
if (index == 0) {
this.mergeList.push({
prop: child.prop,
rowspan: 1,
colspan: item.children.length
});
} else {
this.mergeList.push({
prop: child.prop,
rowspan: 0,
colspan: 0
});
}
});
} else {
this.mergeList.push({
prop: item.prop,
rowspan: 1,
colspan: 1
});
}
});
},
getExportList(list) {
let exportList = [];
for (let i = 0; i < list.length; i++) {
if (list[i].jnpfKey === "table") {
for (let j = 0; j < list[i].children.length; j++) {
exportList.push(list[i].children[j]);
}
} else {
exportList.push(list[i]);
}
}
this.exportList = exportList;
},
goDetail(id) {
this.detailVisible = true;
this.$nextTick(() => {
this.$refs.Detail.init(id);
});
},
sortChange({ column, prop, order }) {
this.listQuery.sort = order == "ascending" ? "asc" : "desc";
this.listQuery.sidx = !order ? "" : prop;
this.initData();
},
async initSearchDataAndListData() {
await this.initSearchData();
this.initData();
},
//
async initSearchData() {},
initData() {
this.listLoading = true;
let _query = {
...this.listQuery,
...this.query,
keyword: this.keyword,
dataType: 0,
menuId: this.menuId,
moduleId: "582541735268188933",
type: 1
};
request({
url: `/api/example/Spatial/getList`,
method: "post",
data: _query
}).then(res => {
var _list = res.data.list;
this.list = _list.map(o => ({
...o,
...this.expandObj
}));
this.total = res.data.pagination.total;
this.listLoading = false;
});
},
handleDel(id) {
this.$confirm("此操作将永久删除该数据, 是否继续?", "提示", {
type: "warning"
})
.then(() => {
request({
url: `/api/example/Spatial/${id}`,
method: "DELETE"
}).then(res => {
this.$message({
type: "success",
message: res.msg,
onClose: () => {
this.initData();
}
});
});
})
.catch(() => {});
},
handelUpload() {
this.uploadBoxVisible = true;
this.$nextTick(() => {
this.$refs.UploadBox.init("", "example/Spatial");
});
},
handleSelectionChange(val) {
const res = val.map(item => item.id);
this.multipleSelection = res;
},
handleBatchRemoveDel() {
if (!this.multipleSelection.length) {
this.$message({
type: "error",
message: "请选择一条数据",
duration: 1500
});
return;
}
const ids = this.multipleSelection;
this.$confirm("您确定要删除这些数据吗, 是否继续?", "提示", {
type: "warning"
})
.then(() => {
request({
url: `/api/example/Spatial/batchRemove`,
data: ids,
method: "DELETE"
}).then(res => {
this.$message({
type: "success",
message: res.msg,
onClose: () => {
this.initData();
}
});
});
})
.catch(() => {});
},
openSuperQuery() {
this.superQueryVisible = true;
this.$nextTick(() => {
this.$refs.SuperQuery.init();
});
},
superQuery(queryJson) {
this.listQuery.superQueryJson = queryJson;
this.listQuery.currentPage = 1;
this.initData();
},
addOrUpdateHandle(row, isDetail) {
let id = row ? row.id : "";
this.formVisible = true;
this.$nextTick(() => {
this.$refs.JNPFForm.init(id, isDetail, this.list);
});
},
exportData() {
this.exportBoxVisible = true;
this.$nextTick(() => {
this.$refs.ExportBox.init(this.exportList);
});
},
download(data) {
let query = {
...data,
...this.listQuery,
...this.query,
menuId: this.menuId
};
request({
url: `/api/example/Spatial/Actions/Export`,
method: "post",
data: query
}).then(res => {
if (!res.data.url) return;
this.jnpf.downloadFile(res.data.url);
this.$refs.ExportBox.visible = false;
this.exportBoxVisible = false;
});
},
search() {
this.listQuery.currentPage = 1;
this.listQuery.pageSize = 20;
this.listQuery.sort = "desc";
this.listQuery.sidx = "";
this.initData();
},
refresh(isrRefresh) {
this.formVisible = false;
if (isrRefresh) this.reset();
},
reset() {
this.query = JSON.parse(JSON.stringify(this.queryData));
this.search();
},
colseFlow(isrRefresh) {
this.flowVisible = false;
if (isrRefresh) this.reset();
}
}
};
</script>

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save