jinlin
2024-07-15 8bf8713da9f9ebf844af7ceefd462c2966070128
修改
9个文件已修改
374 ■■■■ 已修改文件
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java 174 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/ParamData.vue 42 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/ProductModelTree.vue 37 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/basicInfo/XhProductModel.vue 55 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/Task.vue 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
web/src/views/modules/taskReliability/TaskPhase.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/controller/XhProductModelController.java
@@ -11,10 +11,13 @@
import com.zt.common.validator.group.AddGroup;
import com.zt.common.validator.group.DefaultGroup;
import com.zt.common.validator.group.UpdateGroup;
import com.zt.life.core.service.ZtProductService;
import com.zt.life.dto.ImportErrDto;
import com.zt.life.modules.mainPart.basicInfo.model.ProductImg;
import com.zt.life.modules.mainPart.basicInfo.model.XhProductModel;
import com.zt.life.modules.mainPart.basicInfo.service.XhProductModelService;
import com.zt.life.modules.mainPart.sysPictureBase.service.SysPictureBaseService;
import com.zt.life.util.ImportUtil;
import com.zt.modules.oss.service.SysOssService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -22,9 +25,12 @@
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import springfox.documentation.annotations.ApiIgnore;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
@@ -40,9 +46,6 @@
    @Autowired
    private XhProductModelService xhProductModelService;
    @Autowired
    private SysOssService sysOssService;
    @Autowired
    private SysPictureBaseService sysPictureBaseService;
@@ -60,8 +63,8 @@
    }
    @GetMapping("tree")
    public Result<List<XhProductModel>> getTreeList(Boolean showXdy) {
        List<XhProductModel> list = xhProductModelService.getAllTree(showXdy);
    public Result<List<XhProductModel>> getTreeList(Boolean showXdy,Integer ztShow) {
        List<XhProductModel> list = xhProductModelService.getAllTree(showXdy,ztShow);
        return Result.ok(list);
    }
@@ -94,6 +97,24 @@
        return Result.ok(list);
    }
    @PostMapping("importProductExcel")
    @ApiOperation("导入产品模型")
    @LogOperation("导入产品模型")
    public Result importProductExcel(MultipartFile file, String progressId,Long pid) {
        Result<List<ImportErrDto>> result = Result.ok();
        try {
            List<Map<String, Object>> importResults = xhProductModelService.importProductExcel(file,progressId,pid);
            StringBuilder str = new StringBuilder();
            ImportUtil.importResult(result, importResults, str);
            ImportUtil.ImportErrResult(result, importResults, str);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    @PostMapping
    @ApiOperation("新增")
    @LogOperation("新增")
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/model/XhProductModel.java
@@ -27,6 +27,8 @@
    @ApiModelProperty(value = "上级ID")
    private Long pid;
    @ApiModelProperty(value = "总体ID")
    private Long shipId;
    @ApiModelProperty(value = "源ID")
    private Long srcId;
    @ApiModelProperty(value = "名称")
modules/mainPart/src/main/java/com/zt/life/modules/mainPart/basicInfo/service/XhProductModelService.java
@@ -3,14 +3,35 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.zt.common.constant.Constant;
import com.zt.common.service.BaseService;
import com.zt.common.utils.CacheUtils;
import com.zt.common.utils.CommonUtils;
import com.zt.common.utils.TreeUtils;
import com.zt.common.utils.UUIDUtil;
import com.zt.core.shiro.ImportUtil;
import com.zt.life.core.model.ZtProduct;
import com.zt.life.modules.mainPart.basicInfo.dao.XhProductModelDao;
import com.zt.life.modules.mainPart.basicInfo.model.ParamData;
import com.zt.life.modules.mainPart.basicInfo.model.ProductImg;
import com.zt.life.modules.mainPart.basicInfo.model.XhProductModel;
import com.zt.modules.sys.dto.DictTypeDto;
import com.zt.modules.sys.model.SysDictData;
import com.zt.modules.sys.model.SysDictType;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zt.common.db.query.QueryFilter;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
@@ -21,7 +42,7 @@
 */
@Service
public class XhProductModelService extends BaseService<XhProductModelDao, XhProductModel> {
      @Autowired ParamDataService paramDataService;
    /**
     * 分页查询
     *
@@ -42,14 +63,22 @@
        super.deleteLogic(ids);
    }
    public List<XhProductModel> getAllTree(Boolean showXdy) {
        List<XhProductModel> productList;
    public List<XhProductModel> getAllTree(Boolean showXdy, Integer ztShow) {
        List<XhProductModel> productList = null;
        if (showXdy) {
            productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
                    Constant.Bool.NO).gt("product_type", 1).orderByAsc(Constant.TableColumn.SORT));
        } else {
            productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
                    Constant.Bool.NO).gt("product_type", 1).ne("product_type", 10).orderByAsc(Constant.TableColumn.SORT));
            if (ztShow == 1) {
                productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
                        Constant.Bool.NO).gt("product_type", 1).ne("product_type", 10).orderByAsc(Constant.TableColumn.SORT));
            } else if (ztShow == 2) {
                productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
                        Constant.Bool.NO).gt("product_type", 2).ne("product_type", 10).orderByAsc(Constant.TableColumn.SORT));
            } else if (ztShow == 3) {
                productList = baseDao.selectList(new QueryWrapper<XhProductModel>().eq(Constant.TableColumn.IS_DELETE,
                        Constant.Bool.NO).gt("product_type", 3).ne("product_type", 10).orderByAsc(Constant.TableColumn.SORT));
            }
        }
        return TreeUtils.build(productList);
@@ -59,7 +88,7 @@
        if (baseDao.getNo(pid, productType) == null) {
            return 0;
        }
        return baseDao.getNo(pid,productType);
        return baseDao.getNo(pid, productType);
    }
    public List<XhProductModel> getProductList() {
@@ -68,12 +97,139 @@
    }
    public List<ProductImg> getProduct(Long productId) {
        XhProductModel model =this.get(productId);
        XhProductModel model = this.get(productId);
        Long parentId = model.getPid();
        return baseDao.getProduct(productId,parentId);
        return baseDao.getProduct(productId, parentId);
    }
    public List<XhProductModel> getTaskProductList() {
        return baseDao.getTaskProductList();
    }
    public List<Map<String, Object>> importProductExcel(MultipartFile mutFile, String progressId, Long shipId) {
        int count = 0;
        Date beginDate = new Date();
        List<Map<String, Object>> list = new ArrayList<>();//存储所有的导入状态
        Map<String, Object> map;//存储每一行的状态
        Integer sum = 0; // 总共的条数
        Integer suc = 0; // 成功的条数
        Integer err = 0; // 失败的条数
        int row1 = 0;
        Map<String, Object> errMap = new HashMap<>();
        Map<String, Integer> reliabType = new HashMap<>();
        reliabType.put("指数分布", 1);
        reliabType.put("二项分布", 2);
        reliabType.put("威布尔分布", 3);
        Map<String, Integer> repairType = new HashMap<>();
        repairType.put("指数分布", 1);
        repairType.put("威布尔分布", 2);
        Map<String, Integer> isOrNot = new HashMap<>();
        isOrNot.put("是", 1);
        isOrNot.put("否", 2);
        try {
            // 获取导入文件的后缀名
            String fileName = mutFile.getOriginalFilename();
            Workbook workbook = null;
            //解决excel版本问题
            if (fileName != null && fileName.endsWith(".xls")) {
                workbook = new HSSFWorkbook(mutFile.getInputStream());
            } else if (fileName != null && fileName.endsWith(".xlsx")) {
                workbook = new XSSFWorkbook(mutFile.getInputStream());
            }
            assert workbook != null; //断言如果[boolean表达式]为true,则程序继续执行。 如果为false,则程序抛出AssertionError,并终止执行。
            int sheets = workbook.getNumberOfSheets();
            //List<LifeManagement> lifeManagementList = new ArrayList<LifeManagement>();
            String xt = null;
            String fxt = null;
            if (sheets == 1) {
                for (int i = 0; i < sheets; i++) {
                    Sheet sheet = workbook.getSheetAt(i);
                    int num = sheet.getLastRowNum(); // 一共有多少行
                    for (int j = 1; j <= num; j++) {
                        CacheUtils.put(progressId, "speed", CommonUtils.getPercent(j, num));
                        CacheUtils.put(progressId, "msg", "共" + num + "行,已完成第" + j + "行");
                        DictTypeDto lifeManagement = new DictTypeDto();
                        boolean isErr = false;
                        row1 = j + 1;
                        String pattern = "yyyy-MM-dd";
                        Row row = sheet.getRow(row1);
                        String sort = com.zt.core.shiro.ImportUtil.getCellValue(row, 0, pattern); //序号
                        if (com.zt.core.shiro.ImportUtil.getCellValue(row, 1, pattern) != null) {
                            xt = com.zt.core.shiro.ImportUtil.getCellValue(row, 1, pattern); //系统
                        }
                        if (com.zt.core.shiro.ImportUtil.getCellValue(row, 2, pattern) != null) {
                            fxt = com.zt.core.shiro.ImportUtil.getCellValue(row, 2, pattern); //分系统
                        }
                        String sb = com.zt.core.shiro.ImportUtil.getCellValue(row, 3, pattern); //设备
                        String reliabDistribType = com.zt.core.shiro.ImportUtil.getCellValue(row, 4, pattern); //可靠性分布类型
                        String basicJoinCompute = com.zt.core.shiro.ImportUtil.getCellValue(row, 5, pattern); //参加计算
                        String basicMtbfRegulate = com.zt.core.shiro.ImportUtil.getCellValue(row, 6, pattern); //mtbf
                        String basicMtbfRegulSuccRate = com.zt.core.shiro.ImportUtil.getCellValue(row, 7, pattern); //成功率
                        String basicMtbfOperatingRatio = com.zt.core.shiro.ImportUtil.getCellValue(row, 8, pattern); //运行比
                        String taskMtbcfRegulate = com.zt.core.shiro.ImportUtil.getCellValue(row, 9, pattern); //mtbcf
                        String taskMtbcfOtherParams2 = com.zt.core.shiro.ImportUtil.getCellValue(row, 10, pattern); //mtbcf其他参数2
                        String taskMtbcfOtherParams3 = com.zt.core.shiro.ImportUtil.getCellValue(row, 11, pattern); //mtbcf其他参数3
                        String taskMtbcfRegulSuccRate = com.zt.core.shiro.ImportUtil.getCellValue(row, 12, pattern); //mtbcf成功率
                        String taskMtbcfOperatingRatio = com.zt.core.shiro.ImportUtil.getCellValue(row, 13, pattern); //mtbcf运行比
                        String repairable = com.zt.core.shiro.ImportUtil.getCellValue(row, 14, pattern); //是否可维修
                        String repairDistribType = com.zt.core.shiro.ImportUtil.getCellValue(row, 15, pattern); //维修发布类型
                        String repairMttcr = com.zt.core.shiro.ImportUtil.getCellValue(row, 16, pattern); //mttcr
                        String repairMttcrOtherParams2 = com.zt.core.shiro.ImportUtil.getCellValue(row, 17, pattern); //mttcr其他参数2
                        String repairMttcrOtherParams3 = com.zt.core.shiro.ImportUtil.getCellValue(row, 18, pattern); //mttcr其他参数3
                        XhProductModel xhProductModel = new XhProductModel();
                        xhProductModel.setShipId(shipId);
                        Long id =UUIDUtil.generateId();
                        xhProductModel.setId(id);
                        xhProductModel.setName(xt);
                        xhProductModel.setProductType("3");
                        this.insert(xhProductModel);
                        //导入预计参数
                        ParamData itemEntity = new ParamData();
                        //绑定设备ID
                        itemEntity.setProductId(id);
                        itemEntity.setName(sb);
                        itemEntity.setReliabDistribType(reliabType.get(reliabDistribType));
                        itemEntity.setBasicJoinCompute(isOrNot.get(basicJoinCompute));
                        itemEntity.setBasicMtbfRegulate(basicMtbfRegulate);
                        itemEntity.setBasicMtbfRegulSuccRate(basicMtbfRegulSuccRate);
                        itemEntity.setBasicMtbfOperatingRatio(basicMtbfOperatingRatio);
                        itemEntity.setTaskMtbcfRegulate(taskMtbcfRegulate);
                        itemEntity.setTaskMtbcfOtherParams(taskMtbcfOtherParams2 + "," + taskMtbcfOtherParams3);
                        itemEntity.setTaskMtbcfRegulSuccRate(taskMtbcfRegulSuccRate);
                        itemEntity.setTaskMtbcfOperatingRatio(taskMtbcfOperatingRatio);
                        itemEntity.setRepairable(isOrNot.get(repairable));
                        itemEntity.setRepairDistribType(repairType.get(repairDistribType));
                        itemEntity.setRepairMttcr(repairMttcr);
                        itemEntity.setRepairMttcrOtherParams(repairMttcrOtherParams2 + "," + repairMttcrOtherParams3);
                        paramDataService.insert(itemEntity);
                    }
                }
            }
        } catch (Exception e) {
            e.printStackTrace();
            ImportUtil.updateErrMap(errMap, "导入异常" + e.getMessage(), "", row1);
            //err++;
        }
      /*  if (batchList.size() > 0 && err == 0) {
            super.insertBatch(batchList, 100);
            baseDao.updateOldId();
        }
        if (batchUpdateList.size() > 0) {
            super.updateBatch(batchUpdateList, 100);
        }*/
        Date nowDate = new Date();
        String msg = "产品模型导入时间:" + CommonUtils.getDatePoor(nowDate, beginDate) + "\r\n";
        System.out.println(msg);
        suc = sum - err;
        map = new HashMap<>();
        map.put("sum", sum + ""); // 所有导入的条数
        map.put("suc", suc + ""); // 成功的条数
        map.put("err", err + ""); // 失败的条数
        list.add(map);
        list.add(errMap);
        return list;
    }
}
web/src/views/modules/basicInfo/ParamData.vue
@@ -46,7 +46,7 @@
                  <el-table-column v-if="dataForm.productType==='3'||dataForm.productType==='2'"
                                   prop="reliabDistribType"
                                   label="可靠性分布类型" :key="27"
                                   width="100">
                                   >
                    <template v-slot="{ row }">
                      <el-select v-if="row.isEdit" v-model="row.reliabDistribType"
                                 placeholder="请选择">
@@ -78,7 +78,7 @@
                  <el-table-column v-if="dataForm.productType==='3'||dataForm.productType==='2'" :key="5"
                                   label="基本可靠性计算">
                    <!--                <zt-table-column-dict prop="joinCompute" :keys="6" label="参加计算" width="100" dict="is_or_not"/>-->
                    <el-table-column prop="basicJoinCompute" label="参加计算" :key="6">
                    <el-table-column prop="basicJoinCompute" label="参加计算" :key="6"  width="100">
                      <template v-slot="{ row }">
                        <el-select v-if="row.isEdit" v-model="row.basicJoinCompute"
                                   placeholder="参加计算">
@@ -93,30 +93,30 @@
                                     :typeColor="typeColor" :size="size" :effect="effect" :hit="hit"/>
                      </template>
                    </el-table-column>
                    <el-table-column prop="basicMtbfRegulate" :key="7" label="规定MTBF">
                    <el-table-column prop="basicMtbfRegulate" :key="7" label="MTBF">
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.basicMtbfRegulate"></el-input>
                        <span v-else v-text="scope.row.basicMtbfRegulate"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="basicMtbfAccept" :key="8" label="可接受的MTBF" width="100">
                    <!--<el-table-column prop="basicMtbfAccept" :key="8" label="可接受的MTBF" width="100">
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.basicMtbfAccept"></el-input>
                        <span v-else v-text="scope.row.basicMtbfAccept"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="basicMtbfRegulSuccRate" :key="9" label="MTBF规定成功率">
                    </el-table-column>-->
                    <el-table-column prop="basicMtbfRegulSuccRate" :key="9" label="MTBF成功率" >
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.basicMtbfRegulSuccRate"></el-input>
                        <span v-else v-text="scope.row.basicMtbfRegulSuccRate"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="basicMtbfAcceptSuccRate" :key="10" label="MTBF可接受成功率" width="140">
                   <!-- <el-table-column prop="basicMtbfAcceptSuccRate" :key="10" label="MTBF可接受成功率" width="120">
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.basicMtbfAcceptSuccRate"></el-input>
                        <span v-else v-text="scope.row.basicMtbfAcceptSuccRate"></span>
                      </template>
                    </el-table-column>
                    </el-table-column>-->
                    <el-table-column prop="basicUnitNum" label="单元数量" :key="11" width="100">
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.basicUnitNum"></el-input>
@@ -129,13 +129,13 @@
                        <span v-else v-text="scope.row.basicRunsNum"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="basicMtbfOperatingRatio" :key="13" label="MTBF运行比" width="80">
                    <el-table-column prop="basicMtbfOperatingRatio" :key="13" label="MTBF运行比" >
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.basicMtbfOperatingRatio"></el-input>
                        <span v-else v-text="scope.row.basicMtbfOperatingRatio"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="basicSingleRunTime" :key="14" label="运行时间" width="100">
                    <el-table-column prop="basicSingleRunTime" :key="14" label="运行时间" >
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.basicSingleRunTime"></el-input>
                        <span v-else v-text="scope.row.basicSingleRunTime"></span>
@@ -164,37 +164,37 @@
                  <el-table-column v-if="dataForm.productType==='3'||dataForm.productType==='2'" :key="15"
                                   label="任务可靠性计算">
                    <el-table-column prop="taskMtbcfRegulate" :key="16" label="规定MTBCF" width="100">
                    <el-table-column prop="taskMtbcfRegulate" :key="16" label="MTBCF" width="100">
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfRegulate"></el-input>
                        <span v-else v-text="scope.row.taskMtbcfRegulate"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="taskMtbcfAccept" :key="17" label="可接受的MTBCF" width="100">
                    <!--<el-table-column prop="taskMtbcfAccept" :key="17" label="可接受的MTBCF" width="100">
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfAccept"></el-input>
                        <span v-else v-text="scope.row.taskMtbcfAccept"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="taskMtbcfRegulSuccRate" :key="18" label="MTBCF规定成功率" width="120">
                    </el-table-column>-->
                    <el-table-column prop="taskMtbcfRegulSuccRate" :key="18" label="MTBCF成功率" >
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfRegulSuccRate"></el-input>
                        <span v-else v-text="scope.row.taskMtbcfRegulSuccRate"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="taskMtbcfAcceptSuccRate" :key="19" label="MTBCF可接受成功率" width="140">
                   <!-- <el-table-column prop="taskMtbcfAcceptSuccRate" :key="19" label="MTBCF可接受成功率" width="100">
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfAcceptSuccRate"></el-input>
                        <span v-else v-text="scope.row.taskMtbcfAcceptSuccRate"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="taskMtbcfOperatingRatio" :key="20" label="MTBCF运行比" width="100">
                    </el-table-column>-->
                    <el-table-column prop="taskMtbcfOperatingRatio" :key="20" label="MTBCF运行比">
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfOperatingRatio"></el-input>
                        <span v-else v-text="scope.row.taskMtbcfOperatingRatio"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="taskMtbcfOtherParams" :key="21" label="MTBCF其他参数">
                    <el-table-column prop="taskMtbcfOtherParams" :key="21" label="MTBCF其他参数" >
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.taskMtbcfOtherParams"></el-input>
                        <span v-else v-text="scope.row.taskMtbcfOtherParams"></span>
@@ -203,7 +203,7 @@
                  </el-table-column>
                  <el-table-column v-if="dataForm.productType==='3'||dataForm.productType==='2'" :key="22" label="维修分布">
                    <!--                <zt-table-column-dict prop="repairable" :keys="23" label="可维修" dict="is_or_not"/>-->
                    <el-table-column prop="repairable" label="可维修" :key="23">
                    <el-table-column prop="repairable" label="可维修" :key="23" width="80">
                      <template v-slot="{ row }">
                        <el-select v-if="row.isEdit" v-model="row.repairable"
                                   placeholder="请选择">
@@ -219,7 +219,7 @@
                      </template>
                    </el-table-column>
                    <!--                <zt-table-column-dict prop="repairDistribType" :keys="24" label="维修分布类型" width="140" dict="RepairDistribType"/>-->
                    <el-table-column prop="repairDistribType" label="维修分布类型" :key="24" width="100">
                    <el-table-column prop="repairDistribType" label="维修分布类型" :key="24" width="130">
                      <template v-slot="{ row }">
                        <el-select v-if="row.isEdit" v-model="row.repairDistribType"
                                   placeholder="请选择">
@@ -240,7 +240,7 @@
                        <span v-else v-text="scope.row.repairMttcr"></span>
                      </template>
                    </el-table-column>
                    <el-table-column prop="repairMttcrOtherParams" :key="26" label="MTTCR其他参数" width="120">
                    <el-table-column prop="repairMttcrOtherParams" :key="26" label="MTTCR其他参数" >
                      <template slot-scope="scope">
                        <el-input v-if="scope.row.isEdit" v-model="scope.row.repairMttcrOtherParams"></el-input>
                        <span v-else v-text="scope.row.repairMttcrOtherParams"></span>
web/src/views/modules/basicInfo/ProductModelTree.vue
@@ -7,7 +7,7 @@
      size="small"
      clearable
    ></el-input>
    <el-button type="primary" @click="add()" style="margin: 10px 0 0 10px;padding: 9px 18px !important;">新增</el-button>
    <el-button type="primary" @click="add()" style="margin: 10px 0 0 10px;padding: 9px 18px !important;">新增型号</el-button>
    <el-divider></el-divider>
    <el-tree
      style="height: 90%;overflow: auto"
@@ -15,6 +15,8 @@
      :data="productList"
      :props="defaultProps"
      default-expand-all
      node-key="id"
      :current-node-key="defaultId"
      :expand-on-click-node="false"
      :highlight-current="true"
      @node-click="handleNodeClick"
@@ -35,12 +37,17 @@
        type: Boolean,
        default: true
      },
      basic: {
        type: Number,
        default: 1
      },
    },
    data() {
      return {
        filterText: '',
        productList: [],
        defaultId: '',
        defaultProps: {
          children: 'children',
          label: 'name'
@@ -60,30 +67,38 @@
    ,
    mounted() {
      this.getProductList()
    }
    ,
    },
    methods: {
      // 获取系统列表
      async getProductList() {
        let params = {
          showXdy:this.showXdy
          showXdy: this.showXdy,
          ztShow: this.basic
        }
        let res = await this.$http.get('/basicInfo/XhProductModel/tree',{params:params})
        let res = await this.$http.get('/basicInfo/XhProductModel/tree', {params: params})
        this.productList = res.data
        if (this.basic) {
          if (this.productList && this.productList[0].children) {
            this.defaultId = this.productList[0].children[0].id
            console.log(this.defaultId, 'this.defaultID')
            this.$nextTick(() => {
              this.$refs.tree.setCurrentKey(this.defaultId); //一定要加这个选中了否则样式没有出来
            });
            this.$emit('on-default', this.defaultId)
          }
        }
        console.log(res.data, 'async getProductList()')
      }
      ,
      },
      add() {
        this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, type: 'tree'})
      }
      ,
        this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, type: 'xh'})
      },
      filterNode(value, data) {
        if (!value) return true
        return data.name.indexOf(value) !== -1
      },
      handleNodeClick(data) {
        this.$emit('on-selected', data)
      }
      },
    }
  }
</script>
web/src/views/modules/basicInfo/XhProductModel-AddOrUpdate.vue
@@ -1,7 +1,7 @@
<template>
  <zt-dialog ref="dialog" @confirm="formSubmit">
    <el-form :model="dataForm" ref="dataForm" :disabled="dataForm.disabled" label-width="120px">
      <zt-form-item label="上级系统" prop="pid" v-if="isTree">
      <zt-form-item label="上级系统" prop="pid" v-if="isShow">
        <zt-combo-tree v-model="dataForm.pid" :datas="productList"/>
      </zt-form-item>
      <zt-form-item label="名称" prop="name" rules="required">
@@ -33,7 +33,6 @@
      return {
        disabled: false,
        url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=`,
        isTree: false,
        isShow: true,
        fileId: '',
        productList: [],
@@ -54,9 +53,13 @@
    },
    methods: {
      init(id, params) {
        if (params.type === 'tree') {
          this.isTree = true
        if (params.type === 'xh') {
          this.isShow = false
          this.dataForm.pid = null
          this.dataForm.productType = 5
        } else if (params.type === 'zt') {
          this.dataForm.pid = params.pid
          this.dataForm.productType = 4
          this.getProductList()
        } else {
          this.dataForm.pid = params.pid
@@ -65,7 +68,6 @@
        if (this.dataForm.productType === 10 && id == null) {
          this.getDefaultImg(this.dataForm.productType)
        }
        this.disabled = !!id;
      },
      // 获取系统列表
      async getProductList() {
@@ -101,18 +103,12 @@
      // 表单提交
      async formSubmit() {
        let flag = true
        if (this.isTree) {
          if (this.dataForm.productType !== '5' || this.dataForm.productType !== '4') {
            this.$alert("不支持新增此节点")
            flag = false
          }
        } else {
          if (this.dataForm.productType === '5' || this.dataForm.productType === '4') {
        if (this.isShow) {
          if (this.dataForm.productType === '5') {
            this.$alert("不支持新增此节点")
            flag = false
          }
        }
        if (!flag) {
          return
        }
web/src/views/modules/basicInfo/XhProductModel.vue
@@ -8,7 +8,7 @@
      </el-col>
      <el-col :span="19">
        <div class="mod-basicInfo-xhProductModel fa-card-a" style="margin-left: 5px;">
          <zt-table-wraper ref="tableObj"  defaultNotQuery="true" query-url="/basicInfo/XhProductModel/page"
          <zt-table-wraper ref="tableObj" defaultNotQuery="true" query-url="/basicInfo/XhProductModel/page"
                           delete-url="/basicInfo/XhProductModel/ "
                           :paging='false'
                           v-slot="{ table }">
@@ -35,11 +35,18 @@
                </template>
              </el-table-column>
              <el-table-column prop="sort" label="排序" width="100px"/>
              <zt-table-column-handle :table="table" width="150px"/>
              <zt-table-column-handle :table="table" width="180px">
                <template v-slot="{ row }">
                  <zt-table-button v-if="productType==='5'" size="small" type="primary"
                                   @click="importData(row)">导入
                  </zt-table-button>
                </template>
              </zt-table-column-handle>
            </el-table>
            <!-- 弹窗, 新增 / 修改 -->
            <add-or-update @refreshDataList="refreshData" ref="AddOrUpdate"/>
            <select-ty-model @refreshDataList="refreshData" ref="SelectTyModel"/>
            <product-import @refreshDataList="refreshData" ref="ProductImport" />
          </zt-table-wraper>
        </div>
      </el-col>
@@ -53,6 +60,7 @@
  import ProductModelTree from "./ProductModelTree";
  import Cookies from "js-cookie";
  import TyProductModel from "./TyProductModel-AddOrUpdate";
  import ProductImport from "./ProductImport";
  export default {
    data() {
@@ -61,13 +69,14 @@
        productType: '',
        dataForm: {
          name: '',
          type:'',
          type: '',
          pid: '',
          srcId:'',
          srcId: '',
        }
      }
    },
    components: {
      ProductImport,
      TyProductModel,
      ProductModelTree,
      AddOrUpdate,
@@ -75,31 +84,30 @@
    },
    methods: {
      add() {
        this.dataForm.type=this.productType
        if (this.dataForm.type !== '3') {
          console.log(1111)
          console.log(this.dataForm.type,'add() {')
          this.dataForm.type = this.dataForm.type - 1
        } else if (this.dataForm.type === '3') {
          console.log(2222)
          console.log(this.dataForm.type,'add() {')
          this.dataForm.type = this.dataForm.type - 2
        }else if (this.dataForm.type === '0'){
          console.log(this.dataForm.type,'add() {')
          this.$alert("当前节点不可新增子节点,请重新设置")
          return
        this.dataForm.type = this.productType
        if (this.dataForm.type !== '5') {
          if (this.dataForm.type !== '3') {
            this.dataForm.type = this.dataForm.type - 1
          } else if (this.dataForm.type === '3') {
            this.dataForm.type = this.dataForm.type - 2
          } else if (this.dataForm.type === '0') {
            this.$alert("当前节点不可新增子节点,请重新设置")
            return
          }
          this.$refs.SelectTyModel.$refs.dialog.init(null, {type: this.dataForm.type, id: this.dataForm.pid})
        } else {
          this.$refs.AddOrUpdate.$refs.dialog.init(null, {id: null, type: 'zt', pid: this.dataForm.pid})
        }
        this.$refs.SelectTyModel.$refs.dialog.init(null,{type:this.dataForm.type,id:this.dataForm.pid})
      },
      addCell(){
        this.$refs.AddOrUpdate.$refs.dialog.init(null,{type:10,pid:this.dataForm.pid})
      addCell() {
        this.$refs.AddOrUpdate.$refs.dialog.init(null, {type: 10, pid: this.dataForm.pid})
      },
      cellStyle({column}) {
        if (column.label === '名称') {
          return 'text-align: left !important;'
        }
      },
      refreshData(){
      refreshData() {
        this.$refs.tableObj.query()
        this.$refs.ProductModelTree.getProductList()
      },
@@ -108,9 +116,12 @@
        this.dataForm.pid = data.id
        this.dataForm.type = data.productType
        this.productType = data.productType
        if(data.productType!=='10'){
        if (data.productType !== '10') {
          this.$refs.tableObj.query()
        }
      },
      importData(row) {
        this.$refs.ProductImport.$refs.dialog.init(row.id)
      }
    }
  }
web/src/views/modules/taskReliability/Task.vue
@@ -19,15 +19,18 @@
                @row-click="selectTask"
                @selection-change="table.selectionChangeHandle">
        <el-table-column type="selection" width="40" align="center"/>
        <el-table-column prop="taskName" label="任务名称" align="center"/>
        <el-table-column prop="taskName" label="任务名称" align="center" width="120"/>
        <!--<el-table-column prop="taskSort" label="任务顺序" align="center"/>-->
        <el-table-column prop="taskDuration" label="任务总时长" align="right" width="120"/>
        <el-table-column prop="taskStaus" label="状态" align="center" width="75">
        </el-table-column>
        <zt-table-column-handle :table="table"
                                delete-perm="taskReliability::delete"/>
      </el-table>
      <!-- 弹窗, 新增 / 修改 -->
      <add-or-update @refreshDataList="table.query" ref="AddOrUpdate"/>
      <task-bino-param  ref="taskBinoParam"></task-bino-param>
      <task-bino-param ref="taskBinoParam"></task-bino-param>
    </zt-table-wraper>
  </div>
</template>
web/src/views/modules/taskReliability/TaskPhase.vue
@@ -1,12 +1,12 @@
<template>
  <div>
    <el-row :gutter="5">
      <el-col :span="7">
      <el-col :span="8">
        <div class="fa-card-a" style="margin-right: 5px;">
          <task @onTaskSelected="onTaskSelected" ref="task"/>
        </div>
      </el-col>
      <el-col :span="11">
      <el-col :span="10">
        <div class="mod-taskReliability-taskPhase fa-card-a" style="margin-left: 5px;margin-right: 5px;">
          <zt-table-wraper ref="tableObj" defaultNotQuery="true" query-url="/taskReliability/TaskPhase/page"
                           delete-url="/taskReliability/TaskPhase/"