parent
1b8a6773c7
commit
765b93281f
@ -0,0 +1,300 @@
|
|||||||
|
package org.jeecg.modules.tianxian.controller;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.net.URLDecoder;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianXianVo;
|
||||||
|
import org.jeecg.modules.tianxian.mapper.TianxianGongcanMapper;
|
||||||
|
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||||
|
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||||
|
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||||
|
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||||
|
import org.jeecg.common.system.vo.LoginUser;
|
||||||
|
import org.apache.shiro.SecurityUtils;
|
||||||
|
import org.jeecg.common.api.vo.Result;
|
||||||
|
import org.jeecg.common.system.query.QueryGenerator;
|
||||||
|
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||||
|
import org.jeecg.common.util.oConvertUtils;
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianxianGongcanXiaoquData;
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianxianGongcan;
|
||||||
|
import org.jeecg.modules.tianxian.vo.TianxianGongcanPage;
|
||||||
|
import org.jeecg.modules.tianxian.service.ITianxianGongcanService;
|
||||||
|
import org.jeecg.modules.tianxian.service.ITianxianGongcanXiaoquDataService;
|
||||||
|
import org.springframework.beans.BeanUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import com.alibaba.fastjson.JSON;
|
||||||
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||||
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||||
|
/**
|
||||||
|
* @Description: 天线工参
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-04-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Tag(name="天线工参")
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/tianxian/tianxianGongcan")
|
||||||
|
@Slf4j
|
||||||
|
public class TianxianGongcanController {
|
||||||
|
@Autowired
|
||||||
|
private ITianxianGongcanService tianxianGongcanService;
|
||||||
|
@Autowired
|
||||||
|
private ITianxianGongcanXiaoquDataService tianxianGongcanXiaoquDataService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页列表查询
|
||||||
|
*
|
||||||
|
* @param tianxianGongcan
|
||||||
|
* @param pageNo
|
||||||
|
* @param pageSize
|
||||||
|
* @param req
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "天线工参-分页列表查询")
|
||||||
|
@Operation(summary = "天线工参-分页列表查询")
|
||||||
|
@GetMapping(value = "/list")
|
||||||
|
public Result<IPage<TianXianVo>> queryPageList(TianxianGongcan tianxianGongcan,
|
||||||
|
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||||
|
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||||
|
HttpServletRequest req) {
|
||||||
|
// 1. Create QueryWrapper (same as before)
|
||||||
|
QueryWrapper<TianxianGongcan> queryWrapper = QueryGenerator.initQueryWrapper(tianxianGongcan, req.getParameterMap());
|
||||||
|
|
||||||
|
// 2. Create Page object for the VO type
|
||||||
|
Page<TianxianGongcan> page = new Page<>(pageNo, pageSize);
|
||||||
|
|
||||||
|
// 3. Inject TianxianGongcanMapper (assuming you have @Autowired)
|
||||||
|
|
||||||
|
// 4. Call the custom mapper method
|
||||||
|
// IPage<TianxianGongcan> pageList = tianxianGongcanService.page(page, queryWrapper);
|
||||||
|
|
||||||
|
IPage<TianxianGongcan> pageList = tianxianGongcanService.page(page, queryWrapper);
|
||||||
|
IPage<TianXianVo> pageList2 = new Page<>(pageList.getCurrent(), pageList.getSize(), pageList.getTotal());
|
||||||
|
List<TianxianGongcan> records = pageList.getRecords();
|
||||||
|
|
||||||
|
List<TianXianVo> pageList1 = new ArrayList<>();
|
||||||
|
|
||||||
|
for (TianxianGongcan main : records) {
|
||||||
|
TianXianVo vo = new TianXianVo();
|
||||||
|
BeanUtils.copyProperties(main, vo);
|
||||||
|
List<TianxianGongcanXiaoquData> tianxianGongcanXiaoquDataList = tianxianGongcanXiaoquDataService.selectByMainId(main.getId());
|
||||||
|
vo.setTxConfig(tianxianGongcanXiaoquDataList);
|
||||||
|
pageList1.add(vo);
|
||||||
|
}
|
||||||
|
// 5. Set the records back to the page object
|
||||||
|
pageList2.setRecords(pageList1);
|
||||||
|
// 6. Set the total count
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 5. Return the result directly
|
||||||
|
return Result.OK(pageList2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*
|
||||||
|
* @param tianxianGongcanPage
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "天线工参-添加")
|
||||||
|
@Operation(summary = "天线工参-添加")
|
||||||
|
@RequiresPermissions("tianxian:tianxian_gongcan:add")
|
||||||
|
@PostMapping(value = "/add")
|
||||||
|
public Result<String> add(@RequestBody TianxianGongcanPage tianxianGongcanPage) {
|
||||||
|
TianxianGongcan tianxianGongcan = new TianxianGongcan();
|
||||||
|
BeanUtils.copyProperties(tianxianGongcanPage, tianxianGongcan);
|
||||||
|
tianxianGongcanService.saveMain(tianxianGongcan, tianxianGongcanPage.getTianxianGongcanXiaoquDataList());
|
||||||
|
return Result.OK("添加成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*
|
||||||
|
* @param tianxianGongcanPage
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "天线工参-编辑")
|
||||||
|
@Operation(summary = "天线工参-编辑")
|
||||||
|
@RequiresPermissions("tianxian:tianxian_gongcan:edit")
|
||||||
|
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||||
|
public Result<String> edit(@RequestBody TianxianGongcanPage tianxianGongcanPage) {
|
||||||
|
TianxianGongcan tianxianGongcan = new TianxianGongcan();
|
||||||
|
BeanUtils.copyProperties(tianxianGongcanPage, tianxianGongcan);
|
||||||
|
TianxianGongcan tianxianGongcanEntity = tianxianGongcanService.getById(tianxianGongcan.getId());
|
||||||
|
if(tianxianGongcanEntity==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
tianxianGongcanService.updateMain(tianxianGongcan, tianxianGongcanPage.getTianxianGongcanXiaoquDataList());
|
||||||
|
return Result.OK("编辑成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id删除
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "天线工参-通过id删除")
|
||||||
|
@Operation(summary = "天线工参-通过id删除")
|
||||||
|
@RequiresPermissions("tianxian:tianxian_gongcan:delete")
|
||||||
|
@DeleteMapping(value = "/delete")
|
||||||
|
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||||
|
tianxianGongcanService.delMain(id);
|
||||||
|
return Result.OK("删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
*
|
||||||
|
* @param ids
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@AutoLog(value = "天线工参-批量删除")
|
||||||
|
@Operation(summary = "天线工参-批量删除")
|
||||||
|
@RequiresPermissions("tianxian:tianxian_gongcan:deleteBatch")
|
||||||
|
@DeleteMapping(value = "/deleteBatch")
|
||||||
|
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||||
|
this.tianxianGongcanService.delBatchMain(Arrays.asList(ids.split(",")));
|
||||||
|
return Result.OK("批量删除成功!");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "天线工参-通过id查询")
|
||||||
|
@Operation(summary = "天线工参-通过id查询")
|
||||||
|
@GetMapping(value = "/queryById")
|
||||||
|
public Result<TianxianGongcan> queryById(@RequestParam(name="id",required=true) String id) {
|
||||||
|
TianxianGongcan tianxianGongcan = tianxianGongcanService.getById(id);
|
||||||
|
if(tianxianGongcan==null) {
|
||||||
|
return Result.error("未找到对应数据");
|
||||||
|
}
|
||||||
|
return Result.OK(tianxianGongcan);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过id查询
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
//@AutoLog(value = "天线工参小区数据-通过主表ID查询")
|
||||||
|
@Operation(summary = "天线工参小区数据-通过主表ID查询")
|
||||||
|
@GetMapping(value = "/queryTianxianGongcanXiaoquDataByMainId")
|
||||||
|
public Result<IPage<TianxianGongcanXiaoquData>> queryTianxianGongcanXiaoquDataListByMainId(@RequestParam(name="id",required=true) String id) {
|
||||||
|
List<TianxianGongcanXiaoquData> tianxianGongcanXiaoquDataList = tianxianGongcanXiaoquDataService.selectByMainId(id);
|
||||||
|
IPage <TianxianGongcanXiaoquData> page = new Page<>();
|
||||||
|
page.setRecords(tianxianGongcanXiaoquDataList);
|
||||||
|
page.setTotal(tianxianGongcanXiaoquDataList.size());
|
||||||
|
return Result.OK(page);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出excel
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param tianxianGongcan
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("tianxian:tianxian_gongcan:exportXls")
|
||||||
|
@RequestMapping(value = "/exportXls")
|
||||||
|
public ModelAndView exportXls(HttpServletRequest request, TianxianGongcan tianxianGongcan) {
|
||||||
|
// Step.1 组装查询条件查询数据
|
||||||
|
QueryWrapper<TianxianGongcan> queryWrapper = QueryGenerator.initQueryWrapper(tianxianGongcan, request.getParameterMap());
|
||||||
|
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||||
|
|
||||||
|
//配置选中数据查询条件
|
||||||
|
String selections = request.getParameter("selections");
|
||||||
|
if(oConvertUtils.isNotEmpty(selections)) {
|
||||||
|
List<String> selectionList = Arrays.asList(selections.split(","));
|
||||||
|
queryWrapper.in("id",selectionList);
|
||||||
|
}
|
||||||
|
//Step.2 获取导出数据
|
||||||
|
List<TianxianGongcan> tianxianGongcanList = tianxianGongcanService.list(queryWrapper);
|
||||||
|
|
||||||
|
// Step.3 组装pageList
|
||||||
|
List<TianxianGongcanPage> pageList = new ArrayList<TianxianGongcanPage>();
|
||||||
|
for (TianxianGongcan main : tianxianGongcanList) {
|
||||||
|
TianxianGongcanPage vo = new TianxianGongcanPage();
|
||||||
|
BeanUtils.copyProperties(main, vo);
|
||||||
|
List<TianxianGongcanXiaoquData> tianxianGongcanXiaoquDataList = tianxianGongcanXiaoquDataService.selectByMainId(main.getId());
|
||||||
|
vo.setTianxianGongcanXiaoquDataList(tianxianGongcanXiaoquDataList);
|
||||||
|
pageList.add(vo);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step.4 AutoPoi 导出Excel
|
||||||
|
ModelAndView mv = new ModelAndView(new JeecgEntityExcelView());
|
||||||
|
mv.addObject(NormalExcelConstants.FILE_NAME, "天线工参列表");
|
||||||
|
mv.addObject(NormalExcelConstants.CLASS, TianxianGongcanPage.class);
|
||||||
|
mv.addObject(NormalExcelConstants.PARAMS, new ExportParams("天线工参数据", "导出人:"+sysUser.getRealname(), "天线工参"));
|
||||||
|
mv.addObject(NormalExcelConstants.DATA_LIST, pageList);
|
||||||
|
return mv;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过excel导入数据
|
||||||
|
*
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("tianxian:tianxian_gongcan:importExcel")
|
||||||
|
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||||
|
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||||
|
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||||
|
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||||
|
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||||
|
// 获取上传文件对象
|
||||||
|
MultipartFile file = entity.getValue();
|
||||||
|
ImportParams params = new ImportParams();
|
||||||
|
params.setTitleRows(2);
|
||||||
|
params.setHeadRows(1);
|
||||||
|
params.setNeedSave(true);
|
||||||
|
try {
|
||||||
|
List<TianxianGongcanPage> list = ExcelImportUtil.importExcel(file.getInputStream(), TianxianGongcanPage.class, params);
|
||||||
|
for (TianxianGongcanPage page : list) {
|
||||||
|
TianxianGongcan po = new TianxianGongcan();
|
||||||
|
BeanUtils.copyProperties(page, po);
|
||||||
|
tianxianGongcanService.saveMain(po, page.getTianxianGongcanXiaoquDataList());
|
||||||
|
}
|
||||||
|
return Result.OK("文件导入成功!数据行数:" + list.size());
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(),e);
|
||||||
|
return Result.error("文件导入失败:"+e.getMessage());
|
||||||
|
} finally {
|
||||||
|
try {
|
||||||
|
file.getInputStream().close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Result.OK("文件导入失败!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
package org.jeecg.modules.tianxian.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
@Schema(description="天线工参")
|
||||||
|
@Data
|
||||||
|
public class TianXianVo extends TianxianGongcan{
|
||||||
|
|
||||||
|
@Schema(description = "天线配置")
|
||||||
|
private List<TianxianGongcanXiaoquData> txConfig;
|
||||||
|
}
|
@ -0,0 +1,75 @@
|
|||||||
|
package org.jeecg.modules.tianxian.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.util.Date;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 天线工参
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-04-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Schema(description="天线工参")
|
||||||
|
@Data
|
||||||
|
@TableName("tianxian_gongcan")
|
||||||
|
public class TianxianGongcan implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
/**所属部门*/
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private java.lang.String sysOrgCode;
|
||||||
|
/**城市*/
|
||||||
|
@Excel(name = "城市", width = 15)
|
||||||
|
@Schema(description = "城市")
|
||||||
|
private java.lang.String cityName;
|
||||||
|
/**基站名称*/
|
||||||
|
@Excel(name = "基站名称", width = 15)
|
||||||
|
@Schema(description = "基站名称")
|
||||||
|
private java.lang.String jizhanName;
|
||||||
|
/**经度*/
|
||||||
|
@Excel(name = "经度", width = 15)
|
||||||
|
@Schema(description = "经度")
|
||||||
|
private java.lang.String log;
|
||||||
|
/**纬度*/
|
||||||
|
@Excel(name = "纬度", width = 15)
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
private java.lang.String lat;
|
||||||
|
/**运营商*/
|
||||||
|
@Excel(name = "运营商", width = 15)
|
||||||
|
@Schema(description = "运营商")
|
||||||
|
private java.lang.String yunyingshangName;
|
||||||
|
}
|
@ -0,0 +1,110 @@
|
|||||||
|
package org.jeecg.modules.tianxian.entity;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import lombok.Data;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import java.util.Date;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 天线工参小区数据
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-04-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Schema(description="天线工参小区数据")
|
||||||
|
@Data
|
||||||
|
@TableName("tianxian_gongcan_xiaoqu_data")
|
||||||
|
public class TianxianGongcanXiaoquData implements Serializable {
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@TableId(type = IdType.ASSIGN_ID)
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
/**vr拍摄*/
|
||||||
|
@Excel(name = "vr拍摄", width = 15)
|
||||||
|
@Schema(description = "vr拍摄")
|
||||||
|
private java.lang.String vrPaishe;
|
||||||
|
/**小区名称*/
|
||||||
|
@Excel(name = "小区名称", width = 15)
|
||||||
|
@Schema(description = "小区名称")
|
||||||
|
private java.lang.String xiaoquName;
|
||||||
|
/**照片*/
|
||||||
|
@Excel(name = "照片", width = 15)
|
||||||
|
@Schema(description = "照片")
|
||||||
|
private java.lang.String zhaopian;
|
||||||
|
@Excel(name = "覆盖图", width = 15)
|
||||||
|
@Schema(description = "照片")
|
||||||
|
private java.lang.String fugaitu;
|
||||||
|
/**方向角*/
|
||||||
|
@Excel(name = "方向角", width = 15)
|
||||||
|
@Schema(description = "方向角")
|
||||||
|
private java.lang.String fangxiaojiao;
|
||||||
|
/**下倾角图片*/
|
||||||
|
@Excel(name = "下倾角图片", width = 15)
|
||||||
|
@Schema(description = "下倾角图片")
|
||||||
|
private java.lang.String xiaoqingjiaotupian;
|
||||||
|
/**机械倾角*/
|
||||||
|
@Excel(name = "机械倾角", width = 15)
|
||||||
|
@Schema(description = "机械倾角")
|
||||||
|
private java.lang.String jiexieqingjiao;
|
||||||
|
/**天线挂高*/
|
||||||
|
@Excel(name = "天线挂高", width = 15)
|
||||||
|
@Schema(description = "天线挂高")
|
||||||
|
private java.lang.String tianxianguagao;
|
||||||
|
/**楼高*/
|
||||||
|
@Excel(name = "楼高", width = 15)
|
||||||
|
@Schema(description = "楼高")
|
||||||
|
private java.lang.String lougao;
|
||||||
|
/**平台*/
|
||||||
|
@Excel(name = "平台", width = 15)
|
||||||
|
@Schema(description = "平台")
|
||||||
|
private java.lang.String pingtai;
|
||||||
|
/**基站id*/
|
||||||
|
@Schema(description = "基站id")
|
||||||
|
private java.lang.String jizhanid;
|
||||||
|
/**天线数量*/
|
||||||
|
@Excel(name = "天线数量", width = 15)
|
||||||
|
@Schema(description = "天线数量")
|
||||||
|
private java.lang.String tianxianNum;
|
||||||
|
/**运营商*/
|
||||||
|
@Excel(name = "运营商", width = 15)
|
||||||
|
@Schema(description = "运营商")
|
||||||
|
private java.lang.String yunyingshang;
|
||||||
|
/**网络制式*/
|
||||||
|
@Excel(name = "网络制式", width = 15)
|
||||||
|
@Schema(description = "网络制式")
|
||||||
|
private java.lang.String wangluozhishi;
|
||||||
|
/**频点号*/
|
||||||
|
@Excel(name = "频点号", width = 15)
|
||||||
|
@Schema(description = "频点号")
|
||||||
|
private java.lang.String pindianhao;
|
||||||
|
}
|
@ -0,0 +1,21 @@
|
|||||||
|
package org.jeecg.modules.tianxian.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianXianVo;
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianxianGongcan;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 天线工参
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-04-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface TianxianGongcanMapper extends BaseMapper<TianxianGongcan> {
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,31 @@
|
|||||||
|
package org.jeecg.modules.tianxian.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianxianGongcanXiaoquData;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 天线工参小区数据
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-04-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface TianxianGongcanXiaoquDataMapper extends BaseMapper<TianxianGongcanXiaoquData> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过主表id删除子表数据
|
||||||
|
*
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public boolean deleteByMainId(@Param("mainId") String mainId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过主表id查询子表数据
|
||||||
|
*
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @return List<TianxianGongcanXiaoquData>
|
||||||
|
*/
|
||||||
|
public List<TianxianGongcanXiaoquData> selectByMainId(@Param("mainId") String mainId);
|
||||||
|
}
|
@ -0,0 +1,8 @@
|
|||||||
|
<?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">
|
||||||
|
<!-- 请确保 namespace 指向你的 TianxianGongcanMapper 接口 -->
|
||||||
|
<mapper namespace="org.jeecg.modules.tianxian.mapper.TianxianGongcanMapper">
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
|
|
@ -0,0 +1,16 @@
|
|||||||
|
<?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="org.jeecg.modules.tianxian.mapper.TianxianGongcanXiaoquDataMapper">
|
||||||
|
|
||||||
|
<delete id="deleteByMainId" parameterType="java.lang.String">
|
||||||
|
DELETE
|
||||||
|
FROM tianxian_gongcan_xiaoqu_data
|
||||||
|
WHERE
|
||||||
|
jizhanid = #{mainId} </delete>
|
||||||
|
|
||||||
|
<select id="selectByMainId" parameterType="java.lang.String" resultType="org.jeecg.modules.tianxian.entity.TianxianGongcanXiaoquData">
|
||||||
|
SELECT *
|
||||||
|
FROM tianxian_gongcan_xiaoqu_data
|
||||||
|
WHERE
|
||||||
|
jizhanid = #{mainId} </select>
|
||||||
|
</mapper>
|
@ -0,0 +1,48 @@
|
|||||||
|
package org.jeecg.modules.tianxian.service;
|
||||||
|
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianxianGongcanXiaoquData;
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianxianGongcan;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.Collection;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 天线工参
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-04-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ITianxianGongcanService extends IService<TianxianGongcan> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加一对多
|
||||||
|
*
|
||||||
|
* @param tianxianGongcan
|
||||||
|
* @param tianxianGongcanXiaoquDataList
|
||||||
|
*/
|
||||||
|
public void saveMain(TianxianGongcan tianxianGongcan,List<TianxianGongcanXiaoquData> tianxianGongcanXiaoquDataList) ;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改一对多
|
||||||
|
*
|
||||||
|
* @param tianxianGongcan
|
||||||
|
* @param tianxianGongcanXiaoquDataList
|
||||||
|
*/
|
||||||
|
public void updateMain(TianxianGongcan tianxianGongcan,List<TianxianGongcanXiaoquData> tianxianGongcanXiaoquDataList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除一对多
|
||||||
|
*
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
public void delMain (String id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除一对多
|
||||||
|
*
|
||||||
|
* @param idList
|
||||||
|
*/
|
||||||
|
public void delBatchMain (Collection<? extends Serializable> idList);
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,22 @@
|
|||||||
|
package org.jeecg.modules.tianxian.service;
|
||||||
|
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianxianGongcanXiaoquData;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 天线工参小区数据
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-04-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
public interface ITianxianGongcanXiaoquDataService extends IService<TianxianGongcanXiaoquData> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过主表id查询子表数据
|
||||||
|
*
|
||||||
|
* @param mainId 主表id
|
||||||
|
* @return List<TianxianGongcanXiaoquData>
|
||||||
|
*/
|
||||||
|
public List<TianxianGongcanXiaoquData> selectByMainId(String mainId);
|
||||||
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
package org.jeecg.modules.tianxian.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianxianGongcan;
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianxianGongcanXiaoquData;
|
||||||
|
import org.jeecg.modules.tianxian.mapper.TianxianGongcanXiaoquDataMapper;
|
||||||
|
import org.jeecg.modules.tianxian.mapper.TianxianGongcanMapper;
|
||||||
|
import org.jeecg.modules.tianxian.service.ITianxianGongcanService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 天线工参
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-04-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TianxianGongcanServiceImpl extends ServiceImpl<TianxianGongcanMapper, TianxianGongcan> implements ITianxianGongcanService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TianxianGongcanMapper tianxianGongcanMapper;
|
||||||
|
@Autowired
|
||||||
|
private TianxianGongcanXiaoquDataMapper tianxianGongcanXiaoquDataMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void saveMain(TianxianGongcan tianxianGongcan, List<TianxianGongcanXiaoquData> tianxianGongcanXiaoquDataList) {
|
||||||
|
tianxianGongcanMapper.insert(tianxianGongcan);
|
||||||
|
if(tianxianGongcanXiaoquDataList!=null && tianxianGongcanXiaoquDataList.size()>0) {
|
||||||
|
for(TianxianGongcanXiaoquData entity:tianxianGongcanXiaoquDataList) {
|
||||||
|
//外键设置
|
||||||
|
entity.setJizhanid(tianxianGongcan.getId());
|
||||||
|
tianxianGongcanXiaoquDataMapper.insert(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void updateMain(TianxianGongcan tianxianGongcan,List<TianxianGongcanXiaoquData> tianxianGongcanXiaoquDataList) {
|
||||||
|
tianxianGongcanMapper.updateById(tianxianGongcan);
|
||||||
|
|
||||||
|
//1.先删除子表数据
|
||||||
|
tianxianGongcanXiaoquDataMapper.deleteByMainId(tianxianGongcan.getId());
|
||||||
|
|
||||||
|
//2.子表数据重新插入
|
||||||
|
if(tianxianGongcanXiaoquDataList!=null && tianxianGongcanXiaoquDataList.size()>0) {
|
||||||
|
for(TianxianGongcanXiaoquData entity:tianxianGongcanXiaoquDataList) {
|
||||||
|
//外键设置
|
||||||
|
entity.setJizhanid(tianxianGongcan.getId());
|
||||||
|
tianxianGongcanXiaoquDataMapper.insert(entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void delMain(String id) {
|
||||||
|
tianxianGongcanXiaoquDataMapper.deleteByMainId(id);
|
||||||
|
tianxianGongcanMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
|
public void delBatchMain(Collection<? extends Serializable> idList) {
|
||||||
|
for(Serializable id:idList) {
|
||||||
|
tianxianGongcanXiaoquDataMapper.deleteByMainId(id.toString());
|
||||||
|
tianxianGongcanMapper.deleteById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
package org.jeecg.modules.tianxian.service.impl;
|
||||||
|
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianxianGongcanXiaoquData;
|
||||||
|
import org.jeecg.modules.tianxian.mapper.TianxianGongcanXiaoquDataMapper;
|
||||||
|
import org.jeecg.modules.tianxian.service.ITianxianGongcanXiaoquDataService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.util.List;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 天线工参小区数据
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-04-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class TianxianGongcanXiaoquDataServiceImpl extends ServiceImpl<TianxianGongcanXiaoquDataMapper, TianxianGongcanXiaoquData> implements ITianxianGongcanXiaoquDataService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private TianxianGongcanXiaoquDataMapper tianxianGongcanXiaoquDataMapper;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<TianxianGongcanXiaoquData> selectByMainId(String mainId) {
|
||||||
|
return tianxianGongcanXiaoquDataMapper.selectByMainId(mainId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,76 @@
|
|||||||
|
package org.jeecg.modules.tianxian.vo;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianxianGongcan;
|
||||||
|
import org.jeecg.modules.tianxian.entity.TianxianGongcanXiaoquData;
|
||||||
|
import lombok.Data;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.ExcelEntity;
|
||||||
|
import org.jeecgframework.poi.excel.annotation.ExcelCollection;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
import org.jeecg.common.aspect.annotation.Dict;
|
||||||
|
import org.jeecg.common.constant.ProvinceCityArea;
|
||||||
|
import org.jeecg.common.util.SpringContextUtils;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Description: 天线工参
|
||||||
|
* @Author: jeecg-boot
|
||||||
|
* @Date: 2025-04-12
|
||||||
|
* @Version: V1.0
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Schema(description="天线工参")
|
||||||
|
public class TianxianGongcanPage {
|
||||||
|
|
||||||
|
/**主键*/
|
||||||
|
@Schema(description = "主键")
|
||||||
|
private java.lang.String id;
|
||||||
|
/**创建人*/
|
||||||
|
@Schema(description = "创建人")
|
||||||
|
private java.lang.String createBy;
|
||||||
|
/**创建日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "创建日期")
|
||||||
|
private java.util.Date createTime;
|
||||||
|
/**更新人*/
|
||||||
|
@Schema(description = "更新人")
|
||||||
|
private java.lang.String updateBy;
|
||||||
|
/**更新日期*/
|
||||||
|
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||||
|
@Schema(description = "更新日期")
|
||||||
|
private java.util.Date updateTime;
|
||||||
|
/**所属部门*/
|
||||||
|
@Schema(description = "所属部门")
|
||||||
|
private java.lang.String sysOrgCode;
|
||||||
|
/**城市*/
|
||||||
|
@Excel(name = "城市", width = 15)
|
||||||
|
@Schema(description = "城市")
|
||||||
|
private java.lang.String cityName;
|
||||||
|
/**基站名称*/
|
||||||
|
@Excel(name = "基站名称", width = 15)
|
||||||
|
@Schema(description = "基站名称")
|
||||||
|
private java.lang.String jizhanName;
|
||||||
|
/**经度*/
|
||||||
|
@Excel(name = "经度", width = 15)
|
||||||
|
@Schema(description = "经度")
|
||||||
|
private java.lang.String log;
|
||||||
|
/**纬度*/
|
||||||
|
@Excel(name = "纬度", width = 15)
|
||||||
|
@Schema(description = "纬度")
|
||||||
|
private java.lang.String lat;
|
||||||
|
/**运营商*/
|
||||||
|
@Excel(name = "运营商", width = 15)
|
||||||
|
@Schema(description = "运营商")
|
||||||
|
private java.lang.String yunyingshangName;
|
||||||
|
|
||||||
|
@ExcelCollection(name="天线工参小区数据")
|
||||||
|
@Schema(description = "天线工参小区数据")
|
||||||
|
private List<TianxianGongcanXiaoquData> tianxianGongcanXiaoquDataList;
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,77 @@
|
|||||||
|
import {defHttp} from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from "/@/hooks/web/useMessage";
|
||||||
|
|
||||||
|
const { createConfirm } = useMessage();
|
||||||
|
|
||||||
|
enum Api {
|
||||||
|
list = '/tianxian/tianxianGongcan/list',
|
||||||
|
save='/tianxian/tianxianGongcan/add',
|
||||||
|
edit='/tianxian/tianxianGongcan/edit',
|
||||||
|
deleteOne = '/tianxian/tianxianGongcan/delete',
|
||||||
|
deleteBatch = '/tianxian/tianxianGongcan/deleteBatch',
|
||||||
|
importExcel = '/tianxian/tianxianGongcan/importExcel',
|
||||||
|
exportXls = '/tianxian/tianxianGongcan/exportXls',
|
||||||
|
tianxianGongcanXiaoquDataList = '/tianxian/tianxianGongcan/queryTianxianGongcanXiaoquDataByMainId',
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 导出api
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const getExportUrl = Api.exportXls;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导入api
|
||||||
|
*/
|
||||||
|
export const getImportUrl = Api.importExcel;
|
||||||
|
/**
|
||||||
|
* 子表单查询接口
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const queryTianxianGongcanXiaoquData = Api.tianxianGongcanXiaoquDataList
|
||||||
|
/**
|
||||||
|
* 列表接口
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const list = (params) =>
|
||||||
|
defHttp.get({url: Api.list, params});
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除单个
|
||||||
|
*/
|
||||||
|
export const deleteOne = (params,handleSuccess) => {
|
||||||
|
return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
handleSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 批量删除
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const batchDelete = (params, handleSuccess) => {
|
||||||
|
createConfirm({
|
||||||
|
iconType: 'warning',
|
||||||
|
title: '确认删除',
|
||||||
|
content: '是否删除选中数据',
|
||||||
|
okText: '确认',
|
||||||
|
cancelText: '取消',
|
||||||
|
onOk: () => {
|
||||||
|
return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => {
|
||||||
|
handleSuccess();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 保存或者更新
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const saveOrUpdate = (params, isUpdate) => {
|
||||||
|
let url = isUpdate ? Api.edit : Api.save;
|
||||||
|
return defHttp.post({url: url, params});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 子表列表接口
|
||||||
|
* @param params
|
||||||
|
*/
|
||||||
|
export const tianxianGongcanXiaoquDataList = (params) =>
|
||||||
|
defHttp.get({url: Api.tianxianGongcanXiaoquDataList, params},{isTransformResponse:false});
|
@ -0,0 +1,212 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable @register="registerTable" :rowSelection="rowSelection" :expandedRowKeys="expandedRowKeys" @expand="handleExpand">
|
||||||
|
<!-- 内嵌table区域 begin -->
|
||||||
|
<template #expandedRowRender="{record}">
|
||||||
|
<a-tabs tabPosition="top">
|
||||||
|
<a-tab-pane tab="天线工参小区数据" key="tianxianGongcanXiaoquData" forceRender>
|
||||||
|
<tianxianGongcanXiaoquDataSubTable v-if="expandedRowKeys.includes(record.id)" :id="record.id" />
|
||||||
|
</a-tab-pane>
|
||||||
|
</a-tabs>
|
||||||
|
</template>
|
||||||
|
<!-- 内嵌table区域 end -->
|
||||||
|
<!--插槽:table标题-->
|
||||||
|
<template #tableTitle>
|
||||||
|
<a-button type="primary" v-auth="'tianxian:tianxian_gongcan:add'" @click="handleAdd" preIcon="ant-design:plus-outlined"> 新增</a-button>
|
||||||
|
<a-button type="primary" v-auth="'tianxian:tianxian_gongcan:exportXls'" preIcon="ant-design:export-outlined" @click="onExportXls"> 导出</a-button>
|
||||||
|
<j-upload-button type="primary" v-auth="'tianxian:tianxian_gongcan:importExcel'" preIcon="ant-design:import-outlined" @click="onImportXls">导入</j-upload-button>
|
||||||
|
<a-dropdown v-if="selectedRowKeys.length > 0">
|
||||||
|
<template #overlay>
|
||||||
|
<a-menu>
|
||||||
|
<a-menu-item key="1" @click="batchHandleDelete">
|
||||||
|
<Icon icon="ant-design:delete-outlined"></Icon>
|
||||||
|
删除
|
||||||
|
</a-menu-item>
|
||||||
|
</a-menu>
|
||||||
|
</template>
|
||||||
|
<a-button v-auth="'tianxian:tianxian_gongcan:deleteBatch'">批量操作
|
||||||
|
<Icon icon="mdi:chevron-down"></Icon>
|
||||||
|
</a-button>
|
||||||
|
</a-dropdown>
|
||||||
|
<!-- 高级查询 -->
|
||||||
|
<super-query :config="superQueryConfig" @search="handleSuperQuery" />
|
||||||
|
</template>
|
||||||
|
<!--操作栏-->
|
||||||
|
<template #action="{ record }">
|
||||||
|
<TableAction :actions="getTableAction(record)" :dropDownActions="getDropDownAction(record)"/>
|
||||||
|
</template>
|
||||||
|
<!--字段回显插槽-->
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
<!-- 表单区域 -->
|
||||||
|
<TianxianGongcanModal @register="registerModal" @success="handleSuccess"></TianxianGongcanModal>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" name="tianxian-tianxianGongcan" setup>
|
||||||
|
import {ref, reactive, computed, unref} from 'vue';
|
||||||
|
import {BasicTable, useTable, TableAction} from '/@/components/Table';
|
||||||
|
import { useListPage } from '/@/hooks/system/useListPage'
|
||||||
|
import {useModal} from '/@/components/Modal';
|
||||||
|
import TianxianGongcanModal from './components/TianxianGongcanModal.vue'
|
||||||
|
import TianxianGongcanXiaoquDataSubTable from './subTables/TianxianGongcanXiaoquDataSubTable.vue'
|
||||||
|
import {columns, searchFormSchema, superQuerySchema} from './TianxianGongcan.data';
|
||||||
|
import {list, deleteOne, batchDelete, getImportUrl,getExportUrl} from './TianxianGongcan.api';
|
||||||
|
import {downloadFile} from '/@/utils/common/renderUtils';
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
const queryParam = reactive<any>({});
|
||||||
|
// 展开key
|
||||||
|
const expandedRowKeys = ref<any[]>([]);
|
||||||
|
//注册model
|
||||||
|
const [registerModal, {openModal}] = useModal();
|
||||||
|
const userStore = useUserStore();
|
||||||
|
//注册table数据
|
||||||
|
const { prefixCls,tableContext,onExportXls,onImportXls } = useListPage({
|
||||||
|
tableProps:{
|
||||||
|
title: '天线工参',
|
||||||
|
api: list,
|
||||||
|
columns,
|
||||||
|
canResize:false,
|
||||||
|
formConfig: {
|
||||||
|
//labelWidth: 120,
|
||||||
|
schemas: searchFormSchema,
|
||||||
|
autoSubmitOnEnter:true,
|
||||||
|
showAdvancedButton:true,
|
||||||
|
fieldMapToNumber: [
|
||||||
|
],
|
||||||
|
fieldMapToTime: [
|
||||||
|
],
|
||||||
|
},
|
||||||
|
actionColumn: {
|
||||||
|
width: 120,
|
||||||
|
fixed:'right'
|
||||||
|
},
|
||||||
|
beforeFetch: (params) => {
|
||||||
|
return Object.assign(params, queryParam);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
exportConfig: {
|
||||||
|
name:"天线工参",
|
||||||
|
url: getExportUrl,
|
||||||
|
params: queryParam,
|
||||||
|
},
|
||||||
|
importConfig: {
|
||||||
|
url: getImportUrl,
|
||||||
|
success: handleSuccess
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const [registerTable, {reload},{ rowSelection, selectedRowKeys }] = tableContext
|
||||||
|
|
||||||
|
// 高级查询配置
|
||||||
|
const superQueryConfig = reactive(superQuerySchema);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 高级查询事件
|
||||||
|
*/
|
||||||
|
function handleSuperQuery(params) {
|
||||||
|
Object.keys(params).map((k) => {
|
||||||
|
queryParam[k] = params[k];
|
||||||
|
});
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 展开事件
|
||||||
|
* */
|
||||||
|
function handleExpand(expanded, record){
|
||||||
|
expandedRowKeys.value=[];
|
||||||
|
if (expanded === true) {
|
||||||
|
expandedRowKeys.value.push(record.id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 新增事件
|
||||||
|
*/
|
||||||
|
function handleAdd() {
|
||||||
|
openModal(true, {
|
||||||
|
isUpdate: false,
|
||||||
|
showFooter: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 编辑事件
|
||||||
|
*/
|
||||||
|
function handleEdit(record: Recordable) {
|
||||||
|
openModal(true, {
|
||||||
|
record,
|
||||||
|
isUpdate: true,
|
||||||
|
showFooter: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
function handleDetail(record: Recordable) {
|
||||||
|
openModal(true, {
|
||||||
|
record,
|
||||||
|
isUpdate: true,
|
||||||
|
showFooter: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 删除事件
|
||||||
|
*/
|
||||||
|
async function handleDelete(record) {
|
||||||
|
await deleteOne({id: record.id}, handleSuccess);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 批量删除事件
|
||||||
|
*/
|
||||||
|
async function batchHandleDelete() {
|
||||||
|
await batchDelete({ids: selectedRowKeys.value},handleSuccess);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 成功回调
|
||||||
|
*/
|
||||||
|
function handleSuccess() {
|
||||||
|
(selectedRowKeys.value = []) && reload();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 操作栏
|
||||||
|
*/
|
||||||
|
function getTableAction(record){
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '编辑',
|
||||||
|
onClick: handleEdit.bind(null, record),
|
||||||
|
auth: 'tianxian:tianxian_gongcan:edit'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下拉操作栏
|
||||||
|
*/
|
||||||
|
function getDropDownAction(record){
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
label: '详情',
|
||||||
|
onClick: handleDetail.bind(null, record),
|
||||||
|
}, {
|
||||||
|
label: '删除',
|
||||||
|
popConfirm: {
|
||||||
|
title: '是否确认删除',
|
||||||
|
confirm: handleDelete.bind(null, record),
|
||||||
|
placement: 'topLeft'
|
||||||
|
},
|
||||||
|
auth: 'tianxian:tianxian_gongcan:delete'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
:deep(.ant-picker),:deep(.ant-input-number){
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,134 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<BasicForm @register="registerForm" ref="formRef"/>
|
||||||
|
<!-- 子表单区域 -->
|
||||||
|
<a-tabs v-model:activeKey="activeKey" animated @change="handleChangeTabs">
|
||||||
|
<a-tab-pane tab="天线工参小区数据" key="tianxianGongcanXiaoquData" :forceRender="true">
|
||||||
|
<JVxeTable
|
||||||
|
v-if="tianxianGongcanXiaoquDataTable.show"
|
||||||
|
keep-source
|
||||||
|
resizable
|
||||||
|
ref="tianxianGongcanXiaoquData"
|
||||||
|
:loading="tianxianGongcanXiaoquDataTable.loading"
|
||||||
|
:columns="tianxianGongcanXiaoquDataTable.columns"
|
||||||
|
:dataSource="tianxianGongcanXiaoquDataTable.dataSource"
|
||||||
|
:height="340"
|
||||||
|
:disabled="formDisabled"
|
||||||
|
:rowNumber="true"
|
||||||
|
:rowSelection="true"
|
||||||
|
:toolbar="true"
|
||||||
|
/>
|
||||||
|
</a-tab-pane>
|
||||||
|
</a-tabs>
|
||||||
|
<div style="width: 100%;text-align: center;margin-top: 10px;" v-if="showFlowSubmitButton">
|
||||||
|
<a-button preIcon="ant-design:check-outlined" style="width: 126px" type="primary" @click="handleSubmit">提 交</a-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import {ref, computed, unref,reactive, onMounted, defineProps } from 'vue';
|
||||||
|
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||||
|
import { JVxeTable } from '/@/components/jeecg/JVxeTable'
|
||||||
|
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
|
||||||
|
import {formSchema,tianxianGongcanXiaoquDataJVxeColumns} from '../TianxianGongcan.data';
|
||||||
|
import {saveOrUpdate,queryTianxianGongcanXiaoquData} from '../TianxianGongcan.api';
|
||||||
|
import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils'
|
||||||
|
const isUpdate = ref(true);
|
||||||
|
|
||||||
|
const refKeys = ref(['tianxianGongcanXiaoquData', ]);
|
||||||
|
const activeKey = ref('tianxianGongcanXiaoquData');
|
||||||
|
const tianxianGongcanXiaoquData = ref();
|
||||||
|
const tableRefs = {tianxianGongcanXiaoquData, };
|
||||||
|
const tianxianGongcanXiaoquDataTable = reactive({
|
||||||
|
loading: false,
|
||||||
|
dataSource: [],
|
||||||
|
columns:tianxianGongcanXiaoquDataJVxeColumns,
|
||||||
|
show: false
|
||||||
|
})
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
formData: { type: Object, default: ()=>{} },
|
||||||
|
formBpm: { type: Boolean, default: true }
|
||||||
|
});
|
||||||
|
const formDisabled = computed(()=>{
|
||||||
|
if(props.formBpm === true){
|
||||||
|
if(props.formData.disabled === false){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
// 是否显示提交按钮
|
||||||
|
const showFlowSubmitButton = computed(()=>{
|
||||||
|
if(props.formBpm === true){
|
||||||
|
if(props.formData.disabled === false){
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false
|
||||||
|
});
|
||||||
|
|
||||||
|
//表单配置
|
||||||
|
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
|
||||||
|
labelWidth: 150,
|
||||||
|
schemas: formSchema,
|
||||||
|
showActionButtonGroup: false,
|
||||||
|
baseColProps: {span: 24}
|
||||||
|
});
|
||||||
|
|
||||||
|
onMounted(()=>{
|
||||||
|
initFormData();
|
||||||
|
});
|
||||||
|
//渲染流程表单数据
|
||||||
|
const queryByIdUrl = '/tianxian/tianxianGongcan/queryById';
|
||||||
|
async function initFormData(){
|
||||||
|
if(props.formBpm === true){
|
||||||
|
await reset();
|
||||||
|
let params = {id: props.formData.dataId};
|
||||||
|
const data = await defHttp.get({url: queryByIdUrl, params});
|
||||||
|
//表单赋值
|
||||||
|
await setFieldsValue({
|
||||||
|
...data
|
||||||
|
});
|
||||||
|
requestSubTableData(queryTianxianGongcanXiaoquData, {id: data.id}, tianxianGongcanXiaoquDataTable, ()=>{
|
||||||
|
tianxianGongcanXiaoquDataTable.show = true;
|
||||||
|
});
|
||||||
|
// 隐藏底部时禁用整个表单
|
||||||
|
setProps({ disabled: formDisabled.value })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//方法配置
|
||||||
|
const [handleChangeTabs,handleSubmit,requestSubTableData,formRef] = useJvxeMethod(requestAddOrEdit,classifyIntoFormData,tableRefs,activeKey,refKeys);
|
||||||
|
|
||||||
|
async function reset(){
|
||||||
|
await resetFields();
|
||||||
|
activeKey.value = 'tianxianGongcanXiaoquData';
|
||||||
|
tianxianGongcanXiaoquDataTable.dataSource = [];
|
||||||
|
}
|
||||||
|
function classifyIntoFormData(allValues) {
|
||||||
|
let main = Object.assign({}, allValues.formValue)
|
||||||
|
return {
|
||||||
|
...main, // 展开
|
||||||
|
tianxianGongcanXiaoquDataList: allValues.tablesValue[0].tableData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//表单提交事件
|
||||||
|
async function requestAddOrEdit(values) {
|
||||||
|
//提交表单
|
||||||
|
await saveOrUpdate(values, true);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
/** 时间和数字输入框样式 */
|
||||||
|
:deep(.ant-input-number) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-calendar-picker) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,114 @@
|
|||||||
|
<template>
|
||||||
|
<BasicModal v-bind="$attrs" @register="registerModal" destroyOnClose :title="title" :width="800" @ok="handleSubmit">
|
||||||
|
<BasicForm @register="registerForm" ref="formRef" name="TianxianGongcanForm" />
|
||||||
|
<!-- 子表单区域 -->
|
||||||
|
<a-tabs v-model:activeKey="activeKey" animated @change="handleChangeTabs">
|
||||||
|
<a-tab-pane tab="天线工参小区数据" key="tianxianGongcanXiaoquData" :forceRender="true">
|
||||||
|
<JVxeTable
|
||||||
|
keep-source
|
||||||
|
resizable
|
||||||
|
ref="tianxianGongcanXiaoquData"
|
||||||
|
:loading="tianxianGongcanXiaoquDataTable.loading"
|
||||||
|
:columns="tianxianGongcanXiaoquDataTable.columns"
|
||||||
|
:dataSource="tianxianGongcanXiaoquDataTable.dataSource"
|
||||||
|
:height="340"
|
||||||
|
:disabled="formDisabled"
|
||||||
|
:rowNumber="true"
|
||||||
|
:rowSelection="true"
|
||||||
|
:toolbar="true"
|
||||||
|
/>
|
||||||
|
</a-tab-pane>
|
||||||
|
</a-tabs>
|
||||||
|
</BasicModal>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import {ref, computed, unref,reactive} from 'vue';
|
||||||
|
import {BasicModal, useModalInner} from '/@/components/Modal';
|
||||||
|
import {BasicForm, useForm} from '/@/components/Form/index';
|
||||||
|
import { JVxeTable } from '/@/components/jeecg/JVxeTable'
|
||||||
|
import { useJvxeMethod } from '/@/hooks/system/useJvxeMethods.ts'
|
||||||
|
import {formSchema,tianxianGongcanXiaoquDataJVxeColumns} from '../TianxianGongcan.data';
|
||||||
|
import {saveOrUpdate,queryTianxianGongcanXiaoquData} from '../TianxianGongcan.api';
|
||||||
|
import { VALIDATE_FAILED } from '/@/utils/common/vxeUtils'
|
||||||
|
// Emits声明
|
||||||
|
const emit = defineEmits(['register','success']);
|
||||||
|
const isUpdate = ref(true);
|
||||||
|
const formDisabled = ref(false);
|
||||||
|
const refKeys = ref(['tianxianGongcanXiaoquData', ]);
|
||||||
|
const activeKey = ref('tianxianGongcanXiaoquData');
|
||||||
|
const tianxianGongcanXiaoquData = ref();
|
||||||
|
const tableRefs = {tianxianGongcanXiaoquData, };
|
||||||
|
const tianxianGongcanXiaoquDataTable = reactive({
|
||||||
|
loading: false,
|
||||||
|
dataSource: [],
|
||||||
|
columns:tianxianGongcanXiaoquDataJVxeColumns
|
||||||
|
})
|
||||||
|
//表单配置
|
||||||
|
const [registerForm, {setProps,resetFields, setFieldsValue, validate}] = useForm({
|
||||||
|
labelWidth: 150,
|
||||||
|
schemas: formSchema,
|
||||||
|
showActionButtonGroup: false,
|
||||||
|
baseColProps: {span: 24}
|
||||||
|
});
|
||||||
|
//表单赋值
|
||||||
|
const [registerModal, {setModalProps, closeModal}] = useModalInner(async (data) => {
|
||||||
|
//重置表单
|
||||||
|
await reset();
|
||||||
|
setModalProps({confirmLoading: false,showCancelBtn:data?.showFooter,showOkBtn:data?.showFooter});
|
||||||
|
isUpdate.value = !!data?.isUpdate;
|
||||||
|
formDisabled.value = !data?.showFooter;
|
||||||
|
if (unref(isUpdate)) {
|
||||||
|
//表单赋值
|
||||||
|
await setFieldsValue({
|
||||||
|
...data.record,
|
||||||
|
});
|
||||||
|
requestSubTableData(queryTianxianGongcanXiaoquData, {id:data?.record?.id}, tianxianGongcanXiaoquDataTable)
|
||||||
|
}
|
||||||
|
// 隐藏底部时禁用整个表单
|
||||||
|
setProps({ disabled: !data?.showFooter })
|
||||||
|
});
|
||||||
|
//方法配置
|
||||||
|
const [handleChangeTabs,handleSubmit,requestSubTableData,formRef] = useJvxeMethod(requestAddOrEdit,classifyIntoFormData,tableRefs,activeKey,refKeys);
|
||||||
|
|
||||||
|
//设置标题
|
||||||
|
const title = computed(() => (!unref(isUpdate) ? '新增' : !unref(formDisabled) ? '编辑' : '详情'));
|
||||||
|
|
||||||
|
async function reset(){
|
||||||
|
await resetFields();
|
||||||
|
activeKey.value = 'tianxianGongcanXiaoquData';
|
||||||
|
tianxianGongcanXiaoquDataTable.dataSource = [];
|
||||||
|
}
|
||||||
|
function classifyIntoFormData(allValues) {
|
||||||
|
let main = Object.assign({}, allValues.formValue)
|
||||||
|
return {
|
||||||
|
...main, // 展开
|
||||||
|
tianxianGongcanXiaoquDataList: allValues.tablesValue[0].tableData,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//表单提交事件
|
||||||
|
async function requestAddOrEdit(values) {
|
||||||
|
try {
|
||||||
|
setModalProps({confirmLoading: true});
|
||||||
|
//提交表单
|
||||||
|
await saveOrUpdate(values, isUpdate.value);
|
||||||
|
//关闭弹窗
|
||||||
|
closeModal();
|
||||||
|
//刷新列表
|
||||||
|
emit('success');
|
||||||
|
} finally {
|
||||||
|
setModalProps({confirmLoading: false});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
/** 时间和数字输入框样式 */
|
||||||
|
:deep(.ant-input-number) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.ant-calendar-picker) {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
@ -0,0 +1,44 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<!--引用表格-->
|
||||||
|
<BasicTable bordered size="middle" :loading="loading" rowKey="id" :canResize="false" :columns="tianxianGongcanXiaoquDataColumns" :dataSource="dataSource" :pagination="false">
|
||||||
|
<!--字段回显插槽-->
|
||||||
|
<template v-slot:bodyCell="{ column, record, index, text }">
|
||||||
|
</template>
|
||||||
|
</BasicTable>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import {ref,watchEffect} from 'vue';
|
||||||
|
import {BasicTable} from '/@/components/Table';
|
||||||
|
import {tianxianGongcanXiaoquDataColumns} from '../TianxianGongcan.data';
|
||||||
|
import {tianxianGongcanXiaoquDataList} from '../TianxianGongcan.api';
|
||||||
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
id: {
|
||||||
|
type: String,
|
||||||
|
default: '',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
const loading = ref(false);
|
||||||
|
const dataSource = ref([]);
|
||||||
|
|
||||||
|
watchEffect(() => {
|
||||||
|
props.id && loadData(props.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
function loadData(id) {
|
||||||
|
dataSource.value = []
|
||||||
|
loading.value = true
|
||||||
|
tianxianGongcanXiaoquDataList({id}).then((res) => {
|
||||||
|
if (res.success) {
|
||||||
|
dataSource.value = res.result.records
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
loading.value = false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
</script>
|
@ -0,0 +1,18 @@
|
|||||||
|
package org.jeecg.modules.weixn.entity.Dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
public class UserDto implements Serializable {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private String code;
|
||||||
|
private String city;
|
||||||
|
}
|
Loading…
Reference in new issue