添加导出列表

This commit is contained in:
高嵩
2023-09-26 17:46:26 +08:00
parent 5212badb26
commit 552f196a0b
12 changed files with 737 additions and 20 deletions
@@ -0,0 +1,177 @@
package com.jero.modules.cert.collect.controller;
import java.util.Arrays;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.jero.common.api.vo.Result;
import com.jero.common.system.query.QueryGenerator;
import com.jero.modules.cert.collect.entity.ParamsCollectExport;
import com.jero.modules.cert.collect.enums.ExportStateEnum;
import com.jero.modules.cert.collect.service.IParamsCollectExportService;
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.jero.common.system.base.controller.JeroController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.servlet.ModelAndView;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import com.jero.common.aspect.annotation.AutoLog;
/**
* @Description: 参数收集导出列表
* @Author: jero-boot
* @Date: 2023-09-26
* @Version: V1.0
*/
@Api(tags="参数收集导出列表")
@RestController
@RequestMapping("/params/paramsCollectExport")
@Slf4j
public class ParamsCollectExportController extends JeroController<ParamsCollectExport, IParamsCollectExportService> {
@Autowired
private IParamsCollectExportService paramsCollectExportService;
/**
* 分页列表查询
*
* @param paramsCollectExport
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@AutoLog(value = "参数收集导出列表-分页列表查询")
@ApiOperation(value="参数收集导出列表-分页列表查询", notes="参数收集导出列表-分页列表查询")
@GetMapping(value = "/page")
public Result<?> queryPageList(ParamsCollectExport paramsCollectExport,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
@RequestParam(name = "cut") String cut,
HttpServletRequest req) {
QueryWrapper<ParamsCollectExport> queryWrapper = QueryGenerator.initQueryWrapper(paramsCollectExport, req.getParameterMap());
queryWrapper.orderByDesc("create_time");
Page<ParamsCollectExport> page = new Page<ParamsCollectExport>(pageNo, pageSize);
IPage<ParamsCollectExport> pageList = paramsCollectExportService.page(page, queryWrapper);
List<ParamsCollectExport> resList = pageList.getRecords();
for (ParamsCollectExport pce : resList) {
pce.setStateText(ExportStateEnum.getNameByVal(pce.getState(),cut));
}
return Result.OK(pageList);
}
/**
* 列表查询
*
* @return
*/
@AutoLog(value = "参数收集导出列表-列表查询")
@ApiOperation(value="参数收集导出列表-列表查询", notes="参数收集导出列表-列表查询")
@GetMapping(value = "/list")
public Result<List<ParamsCollectExport>> queryList() {
List<ParamsCollectExport> list = paramsCollectExportService.queryList();
return Result.OK(list);
}
/**
* 添加
*
* @param paramsCollectExport
* @return
*/
@AutoLog(value = "参数收集导出列表-添加")
@ApiOperation(value="参数收集导出列表-添加", notes="参数收集导出列表-添加")
@PostMapping(value = "/add")
public Result<?> add(@Validated @RequestBody ParamsCollectExport paramsCollectExport) {
paramsCollectExportService.add(paramsCollectExport);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param paramsCollectExport
* @return
*/
@AutoLog(value = "参数收集导出列表-编辑")
@ApiOperation(value="参数收集导出列表-编辑", notes="参数收集导出列表-编辑")
@PutMapping(value = "/edit")
public Result<?> edit(@Validated @RequestBody ParamsCollectExport paramsCollectExport) {
paramsCollectExportService.editById(paramsCollectExport);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "参数收集导出列表-通过id删除")
@ApiOperation(value="参数收集导出列表-通过id删除", notes="参数收集导出列表-通过id删除")
@DeleteMapping(value = "/delete")
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
paramsCollectExportService.deleteById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "参数收集导出列表-批量删除")
@ApiOperation(value="参数收集导出列表-批量删除", notes="参数收集导出列表-批量删除")
@DeleteMapping(value = "/deleteBatch")
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.paramsCollectExportService.deleteByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
@AutoLog(value = "参数收集导出列表-通过id查询")
@ApiOperation(value="参数收集导出列表-通过id查询", notes="参数收集导出列表-通过id查询")
@GetMapping(value = "/queryById")
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
ParamsCollectExport paramsCollectExport = paramsCollectExportService.queryById(id);
if(paramsCollectExport==null) {
return Result.error("未找到对应数据");
}
return Result.OK(paramsCollectExport);
}
/**
* 导出excel
*
* @param request
* @param paramsCollectExport
*/
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, ParamsCollectExport paramsCollectExport) {
return super.exportXls(request, paramsCollectExport, ParamsCollectExport.class, "参数收集导出列表");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, ParamsCollectExport.class);
}
}
@@ -0,0 +1,88 @@
package com.jero.modules.cert.collect.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import com.jero.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
/**
* @Description: 参数收集导出列表
* @Author: jero-boot
* @Date: 2023-09-26
* @Version: V1.0
*/
@Data
@TableName("params_collect_export")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="params_collect_export对象", description="参数收集导出列表")
public class ParamsCollectExport implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private java.util.Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**文件名称*/
@Excel(name = "文件名称", width = 15)
@ApiModelProperty(value = "文件名称")
private String fileName;
/**导出状态*/
@Excel(name = "导出状态", width = 15)
@ApiModelProperty(value = "导出状态")
private String state;
@TableField(exist = false)
private String stateText;
/**文件关联ID*/
@Excel(name = "文件关联ID", width = 15)
@ApiModelProperty(value = "文件关联ID")
private String fileId;
/**参数清单id*/
@Excel(name = "参数清单id", width = 15)
@ApiModelProperty(value = "参数清单id")
private String paramsManifestId;
}
@@ -0,0 +1,63 @@
package com.jero.modules.cert.collect.enums;
import com.jero.common.constant.enums.CutEnum;
/**
* @Author: liyawei
* @Description: 参数收集清单-配置数据单个类型
* @Date: Created in 11:33 2022/5/7
*/
public enum ExportStateEnum {
EXPORTING("导出中", "Exporting", "0"),
SUCCESSFULLY("导出成功", "Export Successfully", "1"),
FAILURE("导出失败", "Export Failure", "2");
String nameCn;
String nameEn;
String value;
ExportStateEnum(String nameCn, String nameEn, String value) {
this.nameCn = nameCn;
this.nameEn = nameEn;
this.value = value;
}
public String getNameCn() {
return nameCn;
}
public void setNameCn(String nameCn) {
this.nameCn = nameCn;
}
public String getNameEn() {
return nameEn;
}
public void setNameEn(String nameEn) {
this.nameEn = nameEn;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
public static String getNameByVal(String val, String cut) {
ExportStateEnum res = EXPORTING;
for (ExportStateEnum es : ExportStateEnum.values()) {
if (es.getValue().equals(val)) {
res = es;
break;
}
}
if (CutEnum.CN.getValue().equals(cut)) {
return res.getNameCn();
} else {
return res.getNameEn();
}
}
}
@@ -0,0 +1,17 @@
package com.jero.modules.cert.collect.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import com.jero.modules.cert.collect.entity.ParamsCollectExport;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 参数收集导出列表
* @Author: jero-boot
* @Date: 2023-09-26
* @Version: V1.0
*/
public interface ParamsCollectExportMapper extends BaseMapper<ParamsCollectExport> {
}
@@ -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="com.jero.modules.cert.collect.mapper.ParamsCollectExportMapper">
<resultMap id="ParamsCollectExportResultMap" type="com.jero.modules.cert.collect.entity.ParamsCollectExport">
<id column="id" property="id" />
<result column="create_by" property="createBy" />
<result column="create_time" property="createTime" />
<result column="update_by" property="updateBy" />
<result column="update_time" property="updateTime" />
<result column="sys_org_code" property="sysOrgCode" />
<result column="file_name" property="fileName" />
<result column="state" property="state" />
<result column="file_id" property="fileId" />
<result column="params_manifest_id" property="paramsManifestId" />
</resultMap>
</mapper>
@@ -0,0 +1,61 @@
package com.jero.modules.cert.collect.service;
import com.jero.modules.cert.collect.entity.ParamsCollectExport;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @Description: 参数收集导出列表
* @Author: jero-boot
* @Date: 2023-09-26
* @Version: V1.0
*/
public interface IParamsCollectExportService extends IService<ParamsCollectExport> {
/**
* 保存
*
* @param paramsCollectExport
* @return
*/
void add(ParamsCollectExport paramsCollectExport);
/**
* 更新
*
* @param paramsCollectExport
* @return
*/
void editById(ParamsCollectExport paramsCollectExport);
/**
* 通过id删除
*
* @param id
* @return
*/
void deleteById(String id);
/**
* 批量删除
*
* @param ids
* @return
*/
void deleteByIds(List<String> ids);
/**
* 通过id查询
*
* @param id
* @return
*/
ParamsCollectExport queryById(String id);
/**
* 列表查询
*
* @return
*/
List<ParamsCollectExport> queryList();
}
@@ -0,0 +1,89 @@
package com.jero.modules.cert.collect.service.impl;
import com.jero.modules.cert.collect.entity.ParamsCollectExport;
import com.jero.modules.cert.collect.mapper.ParamsCollectExportMapper;
import com.jero.modules.cert.collect.service.IParamsCollectExportService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Date;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 参数收集导出列表
* @Author: jero-boot
* @Date: 2023-09-26
* @Version: V1.0
*/
@Service
public class ParamsCollectExportServiceImpl extends ServiceImpl<ParamsCollectExportMapper, ParamsCollectExport> implements IParamsCollectExportService {
/**
* 保存
*
* @param paramsCollectExport
* @return
*/
@Override
public void add(ParamsCollectExport paramsCollectExport) {
Date now = new Date();
paramsCollectExport.setCreateTime(now);
paramsCollectExport.setUpdateTime(now);
save(paramsCollectExport);
}
/**
* 更新
*
* @param paramsCollectExport
* @return
*/
@Override
public void editById(ParamsCollectExport paramsCollectExport) {
Date now = new Date();
paramsCollectExport.setUpdateTime(now);
saveOrUpdate(paramsCollectExport);
}
/**
* 通过id删除
*
* @param id
* @return
*/
@Override
public void deleteById(String id) {
removeById(id);
}
/**
* 批量删除
*
* @param ids
* @return
*/
@Override
public void deleteByIds(List<String> ids) {
removeByIds(ids);
}
/**
* 通过id查询
*
* @param id
* @return
*/
@Override
public ParamsCollectExport queryById(String id) {
return getById(id);
}
/**
* 列表查询
*
* @return
*/
@Override
public List<ParamsCollectExport> queryList() {
return list();
}
}
@@ -183,6 +183,8 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
private IProjectUserDutyTerritoryService projectUserDutyTerritoryService; private IProjectUserDutyTerritoryService projectUserDutyTerritoryService;
@Autowired @Autowired
private IParamsCollectManifestUserTypeLogEOService paramsCollectManifestUserTypeLogEOService; private IParamsCollectManifestUserTypeLogEOService paramsCollectManifestUserTypeLogEOService;
@Autowired
private IParamsCollectExportService paramsCollectExportService;
/** /**
* 保存 * 保存
@@ -3596,6 +3598,15 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
if (StringUtils.isNotEmpty(paramsCollectManifestVO.getExportName())) { if (StringUtils.isNotEmpty(paramsCollectManifestVO.getExportName())) {
fileOriName = paramsCollectManifestVO.getExportName(); fileOriName = paramsCollectManifestVO.getExportName();
} }
//创建导出记录
ParamsCollectExport pce = new ParamsCollectExport();
String pceId = UUID.randomUUID().toString().replace("-", "");
pce.setId(pceId);
pce.setParamsManifestId(paramsCollectManifestVO.getParamsManifestId());
pce.setState(ExportStateEnum.EXPORTING.getValue());
pce.setFileName(fileOriName+ ".zip");
paramsCollectExportService.add(pce);
//创建临时文件夹 //创建临时文件夹
String fileNowPath = uploadpath + "/tempZip/" + UUID.randomUUID().toString().replace("-", "") + File.separator + fileOriName; String fileNowPath = uploadpath + "/tempZip/" + UUID.randomUUID().toString().replace("-", "") + File.separator + fileOriName;
File nowFile = new File(fileNowPath); File nowFile = new File(fileNowPath);
@@ -3691,17 +3702,17 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
excelOS.flush(); excelOS.flush();
excelOS.close(); excelOS.close();
ZipUtil.zip(fileNowPath, fileNowPath + ".zip"); ZipUtil.zip(fileNowPath, fileNowPath + ".zip");
FileInputStream fis = new FileInputStream(fileNowPath + ".zip"); // FileInputStream fis = new FileInputStream(fileNowPath + ".zip");
int len = 0; // int len = 0;
while ((len = fis.read()) != -1) { // while ((len = fis.read()) != -1) {
os.write(len); // os.write(len);
} // }
// // 将导出文件上传到cos上 // 将导出文件上传到cos上
// String uploadFileName = fileOriName + ".zip"; String uploadFileName = fileOriName + ".zip";
// InputStream uploadFileio = new FileInputStream(new File(fileNowPath+".zip")); InputStream uploadFileio = new FileInputStream(new File(fileNowPath+".zip"));
// MultipartFile mFile = new MockMultipartFile(uploadFileName, uploadFileName, "text/plain", uploadFileio); // 用于上传 MultipartFile mFile = new MockMultipartFile(uploadFileName, uploadFileName, "text/plain", uploadFileio); // 用于上传
// OSSFile ossFile = ossFileService.uploadLocalOfCos(mFile, "/manifest", "", CutEnum.CN.getValue()); // 上传导出的压缩包 OSSFile ossFile = ossFileService.uploadLocalOfCos(mFile, "/manifest", "", CutEnum.CN.getValue()); // 上传导出的压缩包
// //
// // 系统向用户发消息 // // 系统向用户发消息
// LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录人 // LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录人
@@ -3733,8 +3744,13 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
// uploadFileio.close(); // uploadFileio.close();
os.flush(); os.flush();
os.close(); // 后开先关 os.close(); // 后开先关
fis.close(); // 先开后关 // fis.close(); // 先开后关
pce.setState(ExportStateEnum.SUCCESSFULLY.getValue());
pce.setFileId(ossFile.getId());
paramsCollectExportService.updateById(pce);
} catch (Exception e) { } catch (Exception e) {
pce.setState(ExportStateEnum.FAILURE.getValue());
paramsCollectExportService.updateById(pce);
if (e instanceof JeroBootException) { if (e instanceof JeroBootException) {
throw new JeroBootException(e.getMessage()); throw new JeroBootException(e.getMessage());
} else { } else {
@@ -3744,7 +3760,6 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
} else { } else {
throw new JeroBootException("下载文件失败,请重试"); throw new JeroBootException("下载文件失败,请重试");
} }
} }
} finally { } finally {
IOUtils.closeQuietly(os); IOUtils.closeQuietly(os);
@@ -7447,10 +7462,12 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
JSONArray resList = new JSONArray(); JSONArray resList = new JSONArray();
if(ObjectUtils.isNotEmpty(dtList)){ if(ObjectUtils.isNotEmpty(dtList)){
for (String dtId : dtList) { for (String dtId : dtList) {
JSONObject dt = new JSONObject(); if(StringUtils.isNotBlank(dtId)){
dt.put("key",dtId); JSONObject dt = new JSONObject();
dt.put("value",dictItemsMap.get(dtId)); dt.put("key",dtId);
resList.add(dt); dt.put("value",dictItemsMap.get(dtId));
resList.add(dt);
}
} }
} }
return Result.OK(resList); return Result.OK(resList);
@@ -91,8 +91,8 @@
and and
</if>--> </if>-->
( (
design_flow_status =#{ncrTrackVO.inconformity} design_flow_status =#{ncrTrackVO.inconformity} or design_flow_status =#{ncrTrackVO.track}
or verify_flow_status =#{ncrTrackVO.inconformity} or verify_flow_status =#{ncrTrackVO.inconformity} or verify_flow_status =#{ncrTrackVO.track}
) )
<!--( <!--(
design_flow_status =#{ncrTrackVO.inconformity} or design_flow_status =#{ncrTrackVO.track} design_flow_status =#{ncrTrackVO.inconformity} or design_flow_status =#{ncrTrackVO.track}
@@ -104,7 +104,6 @@
and (pli.regulation_owner_id =#{ncrTrackVO.userId} and (pli.regulation_owner_id =#{ncrTrackVO.userId}
or pli.homologation_engineer_id =#{ncrTrackVO.userId} or pli.homologation_engineer_id =#{ncrTrackVO.userId}
or pli.engineering_interface_person =#{ncrTrackVO.userId} or pli.engineering_interface_person =#{ncrTrackVO.userId}
or ptid.user_id =#{ncrTrackVO.userId}
) )
</if> </if>
</if> </if>
+2
View File
@@ -1973,4 +1973,6 @@ module.exports = {
by:'By', by:'By',
Changeto:'Change to', Changeto:'Change to',
emptyc:'empty', emptyc:'empty',
Exportsuccessexportlist:'Export success! Check in the export list',
Derivedlist:'Derived list',
} }
+2
View File
@@ -3929,4 +3929,6 @@ module.exports = {
by:'由', by:'由',
Changeto:'改为了', Changeto:'改为了',
emptyc:'空', emptyc:'空',
Exportsuccessexportlist:'导出成功请在导出列表中查看',
Derivedlist:'导出列表',
} }
@@ -185,6 +185,11 @@
<a-icon type="export" :rotate="-90"/> <a-icon type="export" :rotate="-90"/>
{{$t('dataExport')}} {{$t('dataExport')}}
</div> </div>
<!-- 导出列表-->
<div @click="Derivedlist" class="operator-text-title" v-if='currentPersonRole == "homo"'>
<a-icon type="export" :rotate="-90"/>
{{$t('Derivedlist')}}
</div>
<!-- 一键下发收集 --> <!-- 一键下发收集 -->
<div @click="defOneclickCollection" class="operator-text-title" v-if='currentPersonRole == "homo"'> <div @click="defOneclickCollection" class="operator-text-title" v-if='currentPersonRole == "homo"'>
<a-icon type="solution"/> <a-icon type="solution"/>
@@ -266,6 +271,11 @@
<a-icon type="export"/> <a-icon type="export"/>
{{$t('dataExport')}} {{$t('dataExport')}}
</div> </div>
<!-- 导出列表-->
<div @click="Derivedlist" class="operator-text" v-if='currentPersonRole == "sdt" || currentPersonRole == "admin" || currentPersonRole == "studio"'>
<a-icon type="export"/>
{{$t('Derivedlist')}}
</div>
<!-- 引用参数--> <!-- 引用参数-->
<div @click="referenceparameter" class="operator-text" v-if='currentPersonRole == "dre" || currentPersonRole == "homo"'> <div @click="referenceparameter" class="operator-text" v-if='currentPersonRole == "dre" || currentPersonRole == "homo"'>
<a-icon type="plus"/> <a-icon type="plus"/>
@@ -598,6 +608,50 @@
</div> </div>
</div> </div>
</a-modal> </a-modal>
<!-- 导出列表-->
<a-modal
:title="$t('Derivedlist')"
:width="900"
:visible="exportvisible"
:confirm-loading="confirmLoading"
:maskClosable="false"
@ok="exportok"
@cancel="exportvisiblecancel"
>
<!-- <historyTable :columnshistory='columnshistory' :dataSourcehistory='dataSourcehistory'></historyTable>-->
<a-table
class="table"
:components="drag(columnsexport,'columnsexport')"
:columns="columnsexport"
:pagination="false"
rowKey="id"
:scroll="{x: '100%',y: 400}"
:data-source="dataSourceexport"
:loading="loading"
>
<span slot="operation" slot-scope="text,record">
<a @click="exportdata(record)" v-if="record.state == '1'">{{$t('download')}}</a>
<a style="margin-left: 5px;" @click="exportdelete(record)">{{$t('delete')}}</a>
</span>
<!-- <span slot="detailText" slot-scope="text,record">-->
<!-- <span class="text" :title="text">-->
<!-- {{text && text.length > 40?text.slice(0,39)+'...':text}}-->
<!-- </span>-->
<!-- </span>-->
</a-table>
<div class="page" v-if="dataSourceexport.length > 0">
<a-pagination
:show-total="total => $t('total')+` ${total} `+$t('strip')"
show-quick-jumper
show-size-changer
:page-size.sync="pageSizehistory"
:total="total"
:current="pageNohistory"
@change="onChangehistory"
@showSizeChange="SizeChangehistory"
/>
</div>
</a-modal>
<!-- 数据导出弹框--> <!-- 数据导出弹框-->
<a-modal <a-modal
:title="$t('dataExport')" :title="$t('dataExport')"
@@ -639,6 +693,27 @@
</a-row> </a-row>
</a-form-model> </a-form-model>
</a-modal> </a-modal>
<!-- 数据导出异步弹窗-->
<a-modal
:title="$t('dataExport')"
:width="500"
:visible="ExportFailed"
:maskClosable="false"
@ok="exportsubmit"
@cancel="exportcancel"
>
<a-row :gutter="24">
<a-col :span="24">
<div style='font-size: 18px;margin-bottom: 20px;display: flex;justify-content: center'
class="box-title-text-index">
<span>{{$t('Exportsuccessexportlist')}}</span>
<!-- <div>{{$t('NiOnumberis')}}{{ item.nioNumber }},{{$t('Statusis')}}-->
<!-- <span style='color: red'>{{ item.state }}</span>,{{$t('NoOperationPermissionForthisbutton')}}。-->
<!-- </div>-->
</div>
</a-col>
</a-row>
</a-modal>
<JLoading :loading="textLoading">{{this.$t('pleaseWaitWhileRunning')}}</JLoading> <JLoading :loading="textLoading">{{this.$t('pleaseWaitWhileRunning')}}</JLoading>
<batchUpdateDeadline ref="batchUpdateDeadlineRef" @batchUpdateDeadlineForm="batchUpdateDeadlineForm"/> <batchUpdateDeadline ref="batchUpdateDeadlineRef" @batchUpdateDeadlineForm="batchUpdateDeadlineForm"/>
@@ -666,6 +741,7 @@
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue' import Vue from 'vue'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { ResizeHeader, ResizeColumnProvide } from '@/mixins/header'
export default { export default {
name: 'ParameterItemCollectionList', name: 'ParameterItemCollectionList',
@@ -685,6 +761,7 @@
globalAdvancedQuery, globalAdvancedQuery,
batchUpdateDeadline batchUpdateDeadline
}, },
mixins:[ResizeHeader, ResizeColumnProvide],
data() { data() {
this.statusList = [ this.statusList = [
{ {
@@ -742,6 +819,10 @@
// 系统管理员 admin // 系统管理员 admin
// 游客 guest // 游客 guest
toggleSearchStatus: false, toggleSearchStatus: false,
ExportFailed: false,
pageNohistory: 1,
pageSizehistory: 10,
exportvisible: false,
columns: [ columns: [
{ {
title: this.$t('title'), title: this.$t('title'),
@@ -787,6 +868,35 @@
scopedSlots: { customRender: 'operation' } scopedSlots: { customRender: 'operation' }
} }
], ],
columnsexport: [
{
title: this.$t('fileName'),
align: 'left',
dataIndex: 'fileName',
width: 300,
ellipsis: true,
scopedSlots: { customRender: 'detailText' }
},
{
title: this.$t('status'),
align: 'left',
dataIndex: 'stateText',
width: 120,
},
{
title: this.$t('Exporttime'),
align: 'left',
dataIndex: 'createTime',
width: 200
},
{
title: this.$t('operation'),
align: 'left',
fixed: 'right',
width: 100,
scopedSlots: { customRender: 'operation' }
}
],
fieldList: [ fieldList: [
{ {
type: '', type: '',
@@ -829,6 +939,7 @@
checkAll: false, checkAll: false,
visible: false, visible: false,
selectedValue: [], selectedValue: [],
dataSourceexport: [],
checkedList: ['nio_number', 'params_name', 'operation'], checkedList: ['nio_number', 'params_name', 'operation'],
// customizeList: [ // customizeList: [
// { // {
@@ -1448,6 +1559,75 @@
// let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip' // let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip'
// downloadFile('/params/collectManifest/exportAll', name, query, this.selectClear) // downloadFile('/params/collectManifest/exportAll', name, query, this.selectClear)
}, },
// 导出列表
Derivedlist(){
this.exportvisible = true
this.expoteList()
},
onChangehistory(page, pageSize) {
this.pageNohistory = page
this.expoteList()
},
SizeChangehistory(page, pageSize) {
this.pageNohistory = 1
this.pageSizehistory = pageSize
this.expoteList()
},
exportok(){
this.exportvisible = false
},
exportvisiblecancel(){
this.exportvisible = false
},
exportsubmit(){
this.ExportFailed = false
},
exportcancel(){
this.ExportFailed = false
},
exportdata(item){
downloadFile('/sys/common/downLoadFile', item.fileName, { id: item.fileId })
},
exportdelete(item){
this.$confirm({
title: this.$t('confirmDeletion'),
content: '',
onOk:
async () => {
getAction(`tag/onlCgformArea/delete`, { id: item.id }).then((res) => {
if (res.success) {
this.$message.success(this.$t('OperationSuccessful'))
this.expoteList()
} else {
this.$message.warning(this.$t('operationFailed'))
}
})
}
})
},
expoteList(val) {
let query = {
pageNo: this.pageNohistory,
pageSize: this.pageSizehistory,
paramsManifestId: this.$route.query.id,
paramsCollectManifestId: this.paramsReportDetailId
}
this.loading = true
getAction('params/paramsCollectExport/page', query).then((res) => {
if (res.success) {
this.dataSourceexport = res.result.records
// if (this.dataSourcehistory && this.dataSourcehistory.length > 0) {
// this.dataSourcehistory.forEach(val => {
// val.logContent = val.logContent.replace(/\"/g, '<span class=\'textData\'>"</span>')
// })
// }
this.total = res.result.total
this.loading = false
} else {
this.loading = false
}
})
},
// 导出确定 // 导出确定
handleExportSubmit() { handleExportSubmit() {
this.$refs.dataExportruleForm.validate(valid => { this.$refs.dataExportruleForm.validate(valid => {
@@ -1470,7 +1650,13 @@
exportName: this.$route.query.projectName + '(' + this.$route.query.title + ')' exportName: this.$route.query.projectName + '(' + this.$route.query.title + ')'
} }
let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip' let name = this.$route.query.projectName + '(' + this.$route.query.title + ')' + '.zip'
downloadFile('/params/collectManifest/exportAll', name, query, this.selectClear) getAction('/params/collectManifest/exportAll', query).then((res) => {
// if (res.success) {
this.dataExportFailed = false
this.ExportFailed = true
// }
})
// downloadFile('/params/collectManifest/exportAll', name, query, this.selectClear)
} }
}) })
}, },