allen před 1 rokem
rodič
revize
e91d8c84bd
30 změnil soubory, kde provedl 1136 přidání a 935 odebrání
  1. binární
      doc/若依环境使用手册.docx
  2. 20 0
      tfis-admin/src/main/java/com/tfis/system/controller/AircraftSubsystemController.java
  3. 21 8
      tfis-admin/src/main/java/com/tfis/system/controller/AircraftSystemController.java
  4. 0 104
      tfis-admin/src/main/java/com/tfis/system/controller/FaultCaseViewCountController.java
  5. 0 69
      tfis-admin/src/main/java/com/tfis/system/domain/FaultCaseViewCount.java
  6. 13 0
      tfis-admin/src/main/java/com/tfis/system/mapper/AircraftSubsystemMapper.java
  7. 13 0
      tfis-admin/src/main/java/com/tfis/system/mapper/AircraftSystemMapper.java
  8. 0 61
      tfis-admin/src/main/java/com/tfis/system/mapper/FaultCaseViewCountMapper.java
  9. 5 0
      tfis-admin/src/main/java/com/tfis/system/service/IAircraftSubsystemService.java
  10. 7 0
      tfis-admin/src/main/java/com/tfis/system/service/IAircraftSystemService.java
  11. 0 61
      tfis-admin/src/main/java/com/tfis/system/service/IFaultCaseViewCountService.java
  12. 12 0
      tfis-admin/src/main/java/com/tfis/system/service/impl/AircraftSubsystemServiceImpl.java
  13. 10 0
      tfis-admin/src/main/java/com/tfis/system/service/impl/AircraftSystemServiceImpl.java
  14. 0 96
      tfis-admin/src/main/java/com/tfis/system/service/impl/FaultCaseViewCountServiceImpl.java
  15. 6 0
      tfis-admin/src/main/resources/mapper/system/AircraftSubsystemMapper.xml
  16. 10 0
      tfis-admin/src/main/resources/mapper/system/AircraftSystemMapper.xml
  17. 0 77
      tfis-admin/src/main/resources/mapper/system/FaultCaseViewCountMapper.xml
  18. 4 1
      tfis-ui/package.json
  19. 10 0
      tfis-ui/src/api/system/case.js
  20. 0 44
      tfis-ui/src/api/system/count.js
  21. 8 0
      tfis-ui/src/api/system/subsystem.js
  22. 20 0
      tfis-ui/src/api/system/system.js
  23. 1 0
      tfis-ui/src/api/system/type.js
  24. 1 0
      tfis-ui/src/components/Breadcrumb/index.vue
  25. 230 5
      tfis-ui/src/views/index.vue
  26. 554 109
      tfis-ui/src/views/system/case/index.vue
  27. 0 255
      tfis-ui/src/views/system/count/index.vue
  28. 70 17
      tfis-ui/src/views/system/subsystem/index.vue
  29. 82 17
      tfis-ui/src/views/system/system/index.vue
  30. 39 11
      tfis-ui/src/views/system/type/index.vue

binární
doc/若依环境使用手册.docx


+ 20 - 0
tfis-admin/src/main/java/com/tfis/system/controller/AircraftSubsystemController.java

@@ -2,6 +2,8 @@ package com.tfis.system.controller;
 
 import java.util.List;
 import javax.servlet.http.HttpServletResponse;
+
+import com.tfis.common.core.domain.entity.SysUser;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.GetMapping;
@@ -77,6 +79,7 @@ public class AircraftSubsystemController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody AircraftSubsystem aircraftSubsystem)
     {
+        aircraftSubsystem.setCreateBy(getLoginUser().getUser().getUserName());
         return toAjax(aircraftSubsystemService.insertAircraftSubsystem(aircraftSubsystem));
     }
 
@@ -88,6 +91,7 @@ public class AircraftSubsystemController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody AircraftSubsystem aircraftSubsystem)
     {
+        aircraftSubsystem.setUpdateBy(getLoginUser().getUser().getUserName());
         return toAjax(aircraftSubsystemService.updateAircraftSubsystem(aircraftSubsystem));
     }
 
@@ -101,4 +105,20 @@ public class AircraftSubsystemController extends BaseController
     {
         return toAjax(aircraftSubsystemService.deleteAircraftSubsystemByIds(ids));
     }
+
+    @PreAuthorize("@ss.hasPermi('system:subsystem:getsubsystemoption')")
+    @GetMapping(value = "/airsubsystem/{aircraftSystemId}")
+    public AjaxResult getSystemOption(@PathVariable("aircraftSystemId") Long aircraftsystemid)
+    {
+//        System.out.println("系统搜索");
+        System.out.println(aircraftsystemid);
+        return success(aircraftSubsystemService.getSubSystemOption(aircraftsystemid));
+    }
+
+
+    @GetMapping("/getSubOption")
+    public AjaxResult getOption()
+    {
+        return success(aircraftSubsystemService.getSubOption());
+    }
 }

+ 21 - 8
tfis-admin/src/main/java/com/tfis/system/controller/AircraftSystemController.java

@@ -4,14 +4,7 @@ import java.util.List;
 import javax.servlet.http.HttpServletResponse;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
 import com.tfis.common.annotation.Log;
 import com.tfis.common.core.controller.BaseController;
 import com.tfis.common.core.domain.AjaxResult;
@@ -77,6 +70,7 @@ public class AircraftSystemController extends BaseController
     @PostMapping
     public AjaxResult add(@RequestBody AircraftSystem aircraftSystem)
     {
+        aircraftSystem.setCreateBy(getLoginUser().getUser().getUserName());
         return toAjax(aircraftSystemService.insertAircraftSystem(aircraftSystem));
     }
 
@@ -88,6 +82,7 @@ public class AircraftSystemController extends BaseController
     @PutMapping
     public AjaxResult edit(@RequestBody AircraftSystem aircraftSystem)
     {
+        aircraftSystem.setUpdateBy(getLoginUser().getUser().getUserName());
         return toAjax(aircraftSystemService.updateAircraftSystem(aircraftSystem));
     }
 
@@ -101,4 +96,22 @@ public class AircraftSystemController extends BaseController
     {
         return toAjax(aircraftSystemService.deleteAircraftSystemByIds(ids));
     }
+
+    @PreAuthorize("@ss.hasPermi('system:system:getsystemoption')")
+    @GetMapping(value = "/airsystem/{aircraftTypeId}")
+    public AjaxResult getSystemOption(@PathVariable("aircraftTypeId") Long aircraftTypeId)
+    {
+//        System.out.println("系统搜索");
+        System.out.println(aircraftTypeId);
+        return success(aircraftSystemService.getSystemOption(aircraftTypeId));
+    }
+
+
+
+    @GetMapping("/getSysOption")
+    public AjaxResult getOption()
+    {
+        return success(aircraftSystemService.getSysOption());
+    }
 }
+

+ 0 - 104
tfis-admin/src/main/java/com/tfis/system/controller/FaultCaseViewCountController.java

@@ -1,104 +0,0 @@
-package com.tfis.system.controller;
-
-import java.util.List;
-import javax.servlet.http.HttpServletResponse;
-import org.springframework.security.access.prepost.PreAuthorize;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.PutMapping;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
-import com.tfis.common.annotation.Log;
-import com.tfis.common.core.controller.BaseController;
-import com.tfis.common.core.domain.AjaxResult;
-import com.tfis.common.enums.BusinessType;
-import com.tfis.system.domain.FaultCaseViewCount;
-import com.tfis.system.service.IFaultCaseViewCountService;
-import com.tfis.common.utils.poi.ExcelUtil;
-import com.tfis.common.core.page.TableDataInfo;
-
-/**
- * 故障案例查看次数管理Controller
- * 
- * @author allen
- * @date 2023-11-23
- */
-@RestController
-@RequestMapping("/system/count")
-public class FaultCaseViewCountController extends BaseController
-{
-    @Autowired
-    private IFaultCaseViewCountService faultCaseViewCountService;
-
-    /**
-     * 查询故障案例查看次数管理列表
-     */
-    @PreAuthorize("@ss.hasPermi('system:count:list')")
-    @GetMapping("/list")
-    public TableDataInfo list(FaultCaseViewCount faultCaseViewCount)
-    {
-        startPage();
-        List<FaultCaseViewCount> list = faultCaseViewCountService.selectFaultCaseViewCountList(faultCaseViewCount);
-        return getDataTable(list);
-    }
-
-    /**
-     * 导出故障案例查看次数管理列表
-     */
-    @PreAuthorize("@ss.hasPermi('system:count:export')")
-    @Log(title = "故障案例查看次数管理", businessType = BusinessType.EXPORT)
-    @PostMapping("/export")
-    public void export(HttpServletResponse response, FaultCaseViewCount faultCaseViewCount)
-    {
-        List<FaultCaseViewCount> list = faultCaseViewCountService.selectFaultCaseViewCountList(faultCaseViewCount);
-        ExcelUtil<FaultCaseViewCount> util = new ExcelUtil<FaultCaseViewCount>(FaultCaseViewCount.class);
-        util.exportExcel(response, list, "故障案例查看次数管理数据");
-    }
-
-    /**
-     * 获取故障案例查看次数管理详细信息
-     */
-    @PreAuthorize("@ss.hasPermi('system:count:query')")
-    @GetMapping(value = "/{id}")
-    public AjaxResult getInfo(@PathVariable("id") Long id)
-    {
-        return success(faultCaseViewCountService.selectFaultCaseViewCountById(id));
-    }
-
-    /**
-     * 新增故障案例查看次数管理
-     */
-    @PreAuthorize("@ss.hasPermi('system:count:add')")
-    @Log(title = "故障案例查看次数管理", businessType = BusinessType.INSERT)
-    @PostMapping
-    public AjaxResult add(@RequestBody FaultCaseViewCount faultCaseViewCount)
-    {
-        return toAjax(faultCaseViewCountService.insertFaultCaseViewCount(faultCaseViewCount));
-    }
-
-    /**
-     * 修改故障案例查看次数管理
-     */
-    @PreAuthorize("@ss.hasPermi('system:count:edit')")
-    @Log(title = "故障案例查看次数管理", businessType = BusinessType.UPDATE)
-    @PutMapping
-    public AjaxResult edit(@RequestBody FaultCaseViewCount faultCaseViewCount)
-    {
-        return toAjax(faultCaseViewCountService.updateFaultCaseViewCount(faultCaseViewCount));
-    }
-
-    /**
-     * 删除故障案例查看次数管理
-     */
-    @PreAuthorize("@ss.hasPermi('system:count:remove')")
-    @Log(title = "故障案例查看次数管理", businessType = BusinessType.DELETE)
-	@DeleteMapping("/{ids}")
-    public AjaxResult remove(@PathVariable Long[] ids)
-    {
-        return toAjax(faultCaseViewCountService.deleteFaultCaseViewCountByIds(ids));
-    }
-}

+ 0 - 69
tfis-admin/src/main/java/com/tfis/system/domain/FaultCaseViewCount.java

@@ -1,69 +0,0 @@
-package com.tfis.system.domain;
-
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-import com.tfis.common.annotation.Excel;
-import com.tfis.common.core.domain.BaseEntity;
-
-/**
- * 故障案例查看次数管理对象 biz_fault_case_view_count
- * 
- * @author allen
- * @date 2023-11-23
- */
-public class FaultCaseViewCount extends BaseEntity
-{
-    private static final long serialVersionUID = 1L;
-
-    /** 编号 */
-    private Long id;
-
-    /** 故障案例 */
-    @Excel(name = "故障案例")
-    private Long faultCaseId;
-
-    /** 浏览次数 */
-    @Excel(name = "浏览次数")
-    private Long viewCount;
-
-    public void setId(Long id) 
-    {
-        this.id = id;
-    }
-
-    public Long getId() 
-    {
-        return id;
-    }
-    public void setFaultCaseId(Long faultCaseId) 
-    {
-        this.faultCaseId = faultCaseId;
-    }
-
-    public Long getFaultCaseId() 
-    {
-        return faultCaseId;
-    }
-    public void setViewCount(Long viewCount) 
-    {
-        this.viewCount = viewCount;
-    }
-
-    public Long getViewCount() 
-    {
-        return viewCount;
-    }
-
-    @Override
-    public String toString() {
-        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
-            .append("id", getId())
-            .append("faultCaseId", getFaultCaseId())
-            .append("viewCount", getViewCount())
-            .append("createBy", getCreateBy())
-            .append("createTime", getCreateTime())
-            .append("updateBy", getUpdateBy())
-            .append("updateTime", getUpdateTime())
-            .toString();
-    }
-}

+ 13 - 0
tfis-admin/src/main/java/com/tfis/system/mapper/AircraftSubsystemMapper.java

@@ -58,4 +58,17 @@ public interface AircraftSubsystemMapper
      * @return 结果
      */
     public int deleteAircraftSubsystemByIds(Long[] ids);
+
+    /**
+     * 返回所有系统信息
+     * @return
+     */
+    List getSubOption();
+
+    /**
+     * 根据系统返回分系统信息
+     * @param aircraftsystemid
+     * @return
+     */
+    List getSubSystemOption(Long aircraftsystemid);
 }

+ 13 - 0
tfis-admin/src/main/java/com/tfis/system/mapper/AircraftSystemMapper.java

@@ -58,4 +58,17 @@ public interface AircraftSystemMapper
      * @return 结果
      */
     public int deleteAircraftSystemByIds(Long[] ids);
+
+    /**
+     * 根据机型返回系统信息
+     * @param aircraftTypeId
+     * @return
+     */
+    List getSystemOption(Long aircraftTypeId);
+
+    /**
+     * 返回系统信息
+     * @return
+     */
+    List getSysOption();
 }

+ 0 - 61
tfis-admin/src/main/java/com/tfis/system/mapper/FaultCaseViewCountMapper.java

@@ -1,61 +0,0 @@
-package com.tfis.system.mapper;
-
-import java.util.List;
-import com.tfis.system.domain.FaultCaseViewCount;
-
-/**
- * 故障案例查看次数管理Mapper接口
- * 
- * @author allen
- * @date 2023-11-23
- */
-public interface FaultCaseViewCountMapper 
-{
-    /**
-     * 查询故障案例查看次数管理
-     * 
-     * @param id 故障案例查看次数管理主键
-     * @return 故障案例查看次数管理
-     */
-    public FaultCaseViewCount selectFaultCaseViewCountById(Long id);
-
-    /**
-     * 查询故障案例查看次数管理列表
-     * 
-     * @param faultCaseViewCount 故障案例查看次数管理
-     * @return 故障案例查看次数管理集合
-     */
-    public List<FaultCaseViewCount> selectFaultCaseViewCountList(FaultCaseViewCount faultCaseViewCount);
-
-    /**
-     * 新增故障案例查看次数管理
-     * 
-     * @param faultCaseViewCount 故障案例查看次数管理
-     * @return 结果
-     */
-    public int insertFaultCaseViewCount(FaultCaseViewCount faultCaseViewCount);
-
-    /**
-     * 修改故障案例查看次数管理
-     * 
-     * @param faultCaseViewCount 故障案例查看次数管理
-     * @return 结果
-     */
-    public int updateFaultCaseViewCount(FaultCaseViewCount faultCaseViewCount);
-
-    /**
-     * 删除故障案例查看次数管理
-     * 
-     * @param id 故障案例查看次数管理主键
-     * @return 结果
-     */
-    public int deleteFaultCaseViewCountById(Long id);
-
-    /**
-     * 批量删除故障案例查看次数管理
-     * 
-     * @param ids 需要删除的数据主键集合
-     * @return 结果
-     */
-    public int deleteFaultCaseViewCountByIds(Long[] ids);
-}

+ 5 - 0
tfis-admin/src/main/java/com/tfis/system/service/IAircraftSubsystemService.java

@@ -58,4 +58,9 @@ public interface IAircraftSubsystemService
      * @return 结果
      */
     public int deleteAircraftSubsystemById(Long id);
+
+
+    List getSubSystemOption(Long aircraftsystemid);
+
+    List getSubOption();
 }

+ 7 - 0
tfis-admin/src/main/java/com/tfis/system/service/IAircraftSystemService.java

@@ -19,6 +19,8 @@ public interface IAircraftSystemService
      */
     public AircraftSystem selectAircraftSystemById(Long id);
 
+
+
     /**
      * 查询系统信息管理列表
      * 
@@ -58,4 +60,9 @@ public interface IAircraftSystemService
      * @return 结果
      */
     public int deleteAircraftSystemById(Long id);
+
+
+    List  getSystemOption(Long aircraftTypeId);
+
+    List getSysOption();
 }

+ 0 - 61
tfis-admin/src/main/java/com/tfis/system/service/IFaultCaseViewCountService.java

@@ -1,61 +0,0 @@
-package com.tfis.system.service;
-
-import java.util.List;
-import com.tfis.system.domain.FaultCaseViewCount;
-
-/**
- * 故障案例查看次数管理Service接口
- * 
- * @author allen
- * @date 2023-11-23
- */
-public interface IFaultCaseViewCountService 
-{
-    /**
-     * 查询故障案例查看次数管理
-     * 
-     * @param id 故障案例查看次数管理主键
-     * @return 故障案例查看次数管理
-     */
-    public FaultCaseViewCount selectFaultCaseViewCountById(Long id);
-
-    /**
-     * 查询故障案例查看次数管理列表
-     * 
-     * @param faultCaseViewCount 故障案例查看次数管理
-     * @return 故障案例查看次数管理集合
-     */
-    public List<FaultCaseViewCount> selectFaultCaseViewCountList(FaultCaseViewCount faultCaseViewCount);
-
-    /**
-     * 新增故障案例查看次数管理
-     * 
-     * @param faultCaseViewCount 故障案例查看次数管理
-     * @return 结果
-     */
-    public int insertFaultCaseViewCount(FaultCaseViewCount faultCaseViewCount);
-
-    /**
-     * 修改故障案例查看次数管理
-     * 
-     * @param faultCaseViewCount 故障案例查看次数管理
-     * @return 结果
-     */
-    public int updateFaultCaseViewCount(FaultCaseViewCount faultCaseViewCount);
-
-    /**
-     * 批量删除故障案例查看次数管理
-     * 
-     * @param ids 需要删除的故障案例查看次数管理主键集合
-     * @return 结果
-     */
-    public int deleteFaultCaseViewCountByIds(Long[] ids);
-
-    /**
-     * 删除故障案例查看次数管理信息
-     * 
-     * @param id 故障案例查看次数管理主键
-     * @return 结果
-     */
-    public int deleteFaultCaseViewCountById(Long id);
-}

+ 12 - 0
tfis-admin/src/main/java/com/tfis/system/service/impl/AircraftSubsystemServiceImpl.java

@@ -93,4 +93,16 @@ public class AircraftSubsystemServiceImpl implements IAircraftSubsystemService
     {
         return aircraftSubsystemMapper.deleteAircraftSubsystemById(id);
     }
+
+    @Override
+    public List getSubSystemOption(Long aircraftsystemid){
+        return aircraftSubsystemMapper.getSubSystemOption(aircraftsystemid);
+    }
+
+
+    @Override
+    public List getSubOption() {
+        return aircraftSubsystemMapper.getSubOption();
+    }
+
 }

+ 10 - 0
tfis-admin/src/main/java/com/tfis/system/service/impl/AircraftSystemServiceImpl.java

@@ -93,4 +93,14 @@ public class AircraftSystemServiceImpl implements IAircraftSystemService
     {
         return aircraftSystemMapper.deleteAircraftSystemById(id);
     }
+
+    @Override
+    public List  getSystemOption(Long aircraftTypeId){
+        return aircraftSystemMapper.getSystemOption(aircraftTypeId);
+    }
+
+    @Override
+    public List getSysOption() {
+        return aircraftSystemMapper.getSysOption();
+    }
 }

+ 0 - 96
tfis-admin/src/main/java/com/tfis/system/service/impl/FaultCaseViewCountServiceImpl.java

@@ -1,96 +0,0 @@
-package com.tfis.system.service.impl;
-
-import java.util.List;
-import com.tfis.common.utils.DateUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-import com.tfis.system.mapper.FaultCaseViewCountMapper;
-import com.tfis.system.domain.FaultCaseViewCount;
-import com.tfis.system.service.IFaultCaseViewCountService;
-
-/**
- * 故障案例查看次数管理Service业务层处理
- * 
- * @author allen
- * @date 2023-11-23
- */
-@Service
-public class FaultCaseViewCountServiceImpl implements IFaultCaseViewCountService 
-{
-    @Autowired
-    private FaultCaseViewCountMapper faultCaseViewCountMapper;
-
-    /**
-     * 查询故障案例查看次数管理
-     * 
-     * @param id 故障案例查看次数管理主键
-     * @return 故障案例查看次数管理
-     */
-    @Override
-    public FaultCaseViewCount selectFaultCaseViewCountById(Long id)
-    {
-        return faultCaseViewCountMapper.selectFaultCaseViewCountById(id);
-    }
-
-    /**
-     * 查询故障案例查看次数管理列表
-     * 
-     * @param faultCaseViewCount 故障案例查看次数管理
-     * @return 故障案例查看次数管理
-     */
-    @Override
-    public List<FaultCaseViewCount> selectFaultCaseViewCountList(FaultCaseViewCount faultCaseViewCount)
-    {
-        return faultCaseViewCountMapper.selectFaultCaseViewCountList(faultCaseViewCount);
-    }
-
-    /**
-     * 新增故障案例查看次数管理
-     * 
-     * @param faultCaseViewCount 故障案例查看次数管理
-     * @return 结果
-     */
-    @Override
-    public int insertFaultCaseViewCount(FaultCaseViewCount faultCaseViewCount)
-    {
-        faultCaseViewCount.setCreateTime(DateUtils.getNowDate());
-        return faultCaseViewCountMapper.insertFaultCaseViewCount(faultCaseViewCount);
-    }
-
-    /**
-     * 修改故障案例查看次数管理
-     * 
-     * @param faultCaseViewCount 故障案例查看次数管理
-     * @return 结果
-     */
-    @Override
-    public int updateFaultCaseViewCount(FaultCaseViewCount faultCaseViewCount)
-    {
-        faultCaseViewCount.setUpdateTime(DateUtils.getNowDate());
-        return faultCaseViewCountMapper.updateFaultCaseViewCount(faultCaseViewCount);
-    }
-
-    /**
-     * 批量删除故障案例查看次数管理
-     * 
-     * @param ids 需要删除的故障案例查看次数管理主键
-     * @return 结果
-     */
-    @Override
-    public int deleteFaultCaseViewCountByIds(Long[] ids)
-    {
-        return faultCaseViewCountMapper.deleteFaultCaseViewCountByIds(ids);
-    }
-
-    /**
-     * 删除故障案例查看次数管理信息
-     * 
-     * @param id 故障案例查看次数管理主键
-     * @return 结果
-     */
-    @Override
-    public int deleteFaultCaseViewCountById(Long id)
-    {
-        return faultCaseViewCountMapper.deleteFaultCaseViewCountById(id);
-    }
-}

+ 6 - 0
tfis-admin/src/main/resources/mapper/system/AircraftSubsystemMapper.xml

@@ -19,6 +19,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select id, aircraft_system_id, aircraft_type_name, remark, create_by, create_time, update_by, update_time from biz_aircraft_subsystem
     </sql>
 
+
+    <select id="getSubSystemOption" parameterType="Long" resultMap="AircraftSubsystemResult">
+        <include refid="selectAircraftSubsystemVo"/>
+        where aircraft_system_id = #{aircraftSystemId}
+    </select>
+
     <select id="selectAircraftSubsystemList" parameterType="AircraftSubsystem" resultMap="AircraftSubsystemResult">
         <include refid="selectAircraftSubsystemVo"/>
         <where>  

+ 10 - 0
tfis-admin/src/main/resources/mapper/system/AircraftSystemMapper.xml

@@ -31,6 +31,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <include refid="selectAircraftSystemVo"/>
         where id = #{id}
     </select>
+
+    <select id="getSystemOption" parameterType="Long" resultMap="AircraftSystemResult">
+        <include refid="selectAircraftSystemVo"/>
+        where aircraft_type_id = #{aircraftTypeId}
+    </select>
         
     <insert id="insertAircraftSystem" parameterType="AircraftSystem" useGeneratedKeys="true" keyProperty="id">
         insert into biz_aircraft_system
@@ -78,4 +83,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{id}
         </foreach>
     </delete>
+
+
+    <select id="getSysOption" resultType="Map">
+        select id, aircraft_type_id, aircraft_type_name, remark, create_by, create_time, update_by, update_time from biz_aircraft_system  order by id
+    </select>
 </mapper>

+ 0 - 77
tfis-admin/src/main/resources/mapper/system/FaultCaseViewCountMapper.xml

@@ -1,77 +0,0 @@
-<?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.tfis.system.mapper.FaultCaseViewCountMapper">
-    
-    <resultMap type="FaultCaseViewCount" id="FaultCaseViewCountResult">
-        <result property="id"    column="id"    />
-        <result property="faultCaseId"    column="fault_case_id"    />
-        <result property="viewCount"    column="view_count"    />
-        <result property="createBy"    column="create_by"    />
-        <result property="createTime"    column="create_time"    />
-        <result property="updateBy"    column="update_by"    />
-        <result property="updateTime"    column="update_time"    />
-    </resultMap>
-
-    <sql id="selectFaultCaseViewCountVo">
-        select id, fault_case_id, view_count, create_by, create_time, update_by, update_time from biz_fault_case_view_count
-    </sql>
-
-    <select id="selectFaultCaseViewCountList" parameterType="FaultCaseViewCount" resultMap="FaultCaseViewCountResult">
-        <include refid="selectFaultCaseViewCountVo"/>
-        <where>  
-            <if test="faultCaseId != null "> and fault_case_id = #{faultCaseId}</if>
-            <if test="viewCount != null "> and view_count = #{viewCount}</if>
-        </where>
-    </select>
-    
-    <select id="selectFaultCaseViewCountById" parameterType="Long" resultMap="FaultCaseViewCountResult">
-        <include refid="selectFaultCaseViewCountVo"/>
-        where id = #{id}
-    </select>
-        
-    <insert id="insertFaultCaseViewCount" parameterType="FaultCaseViewCount" useGeneratedKeys="true" keyProperty="id">
-        insert into biz_fault_case_view_count
-        <trim prefix="(" suffix=")" suffixOverrides=",">
-            <if test="faultCaseId != null">fault_case_id,</if>
-            <if test="viewCount != null">view_count,</if>
-            <if test="createBy != null">create_by,</if>
-            <if test="createTime != null">create_time,</if>
-            <if test="updateBy != null">update_by,</if>
-            <if test="updateTime != null">update_time,</if>
-         </trim>
-        <trim prefix="values (" suffix=")" suffixOverrides=",">
-            <if test="faultCaseId != null">#{faultCaseId},</if>
-            <if test="viewCount != null">#{viewCount},</if>
-            <if test="createBy != null">#{createBy},</if>
-            <if test="createTime != null">#{createTime},</if>
-            <if test="updateBy != null">#{updateBy},</if>
-            <if test="updateTime != null">#{updateTime},</if>
-         </trim>
-    </insert>
-
-    <update id="updateFaultCaseViewCount" parameterType="FaultCaseViewCount">
-        update biz_fault_case_view_count
-        <trim prefix="SET" suffixOverrides=",">
-            <if test="faultCaseId != null">fault_case_id = #{faultCaseId},</if>
-            <if test="viewCount != null">view_count = #{viewCount},</if>
-            <if test="createBy != null">create_by = #{createBy},</if>
-            <if test="createTime != null">create_time = #{createTime},</if>
-            <if test="updateBy != null">update_by = #{updateBy},</if>
-            <if test="updateTime != null">update_time = #{updateTime},</if>
-        </trim>
-        where id = #{id}
-    </update>
-
-    <delete id="deleteFaultCaseViewCountById" parameterType="Long">
-        delete from biz_fault_case_view_count where id = #{id}
-    </delete>
-
-    <delete id="deleteFaultCaseViewCountByIds" parameterType="String">
-        delete from biz_fault_case_view_count where id in 
-        <foreach item="id" collection="array" open="(" separator="," close=")">
-            #{id}
-        </foreach>
-    </delete>
-</mapper>

+ 4 - 1
tfis-ui/package.json

@@ -40,6 +40,7 @@
     "axios": "0.24.0",
     "clipboard": "2.0.8",
     "core-js": "3.25.3",
+    "docx-preview": "^0.1.20",
     "echarts": "5.4.0",
     "element-ui": "2.15.12",
     "file-saver": "2.0.5",
@@ -48,6 +49,7 @@
     "js-beautify": "1.13.0",
     "js-cookie": "3.0.1",
     "jsencrypt": "3.0.0-rc.1",
+    "mammoth": "^1.6.0",
     "nprogress": "0.2.0",
     "quill": "1.3.7",
     "screenfull": "5.0.2",
@@ -58,7 +60,8 @@
     "vue-meta": "2.4.0",
     "vue-router": "3.4.9",
     "vuedraggable": "2.24.3",
-    "vuex": "3.6.0"
+    "vuex": "3.6.0",
+    "xlsx": "^0.18.5"
   },
   "devDependencies": {
     "@vue/cli-plugin-babel": "4.4.6",

+ 10 - 0
tfis-ui/src/api/system/case.js

@@ -42,3 +42,13 @@ export function delCase(id) {
     method: 'delete'
   })
 }
+
+
+// // 下拉框响应事件
+// export function getSystemOption(aircraftTypeId) {
+//   return request({
+//     url: '/system/system/getSystemOption/${aircraftTypeId}',
+//     method: 'get'
+//   })
+// }
+

+ 0 - 44
tfis-ui/src/api/system/count.js

@@ -1,44 +0,0 @@
-import request from '@/utils/request'
-
-// 查询故障案例查看次数管理列表
-export function listCount(query) {
-  return request({
-    url: '/system/count/list',
-    method: 'get',
-    params: query
-  })
-}
-
-// 查询故障案例查看次数管理详细
-export function getCount(id) {
-  return request({
-    url: '/system/count/' + id,
-    method: 'get'
-  })
-}
-
-// 新增故障案例查看次数管理
-export function addCount(data) {
-  return request({
-    url: '/system/count',
-    method: 'post',
-    data: data
-  })
-}
-
-// 修改故障案例查看次数管理
-export function updateCount(data) {
-  return request({
-    url: '/system/count',
-    method: 'put',
-    data: data
-  })
-}
-
-// 删除故障案例查看次数管理
-export function delCount(id) {
-  return request({
-    url: '/system/count/' + id,
-    method: 'delete'
-  })
-}

+ 8 - 0
tfis-ui/src/api/system/subsystem.js

@@ -42,3 +42,11 @@ export function delSubsystem(id) {
     method: 'delete'
   })
 }
+
+// getSystemOption
+export function getSubSystemOption(aircraftSystemId) {
+  return request({
+    url: '/system/subsystem/airsubsystem/' +aircraftSystemId,
+    method: 'get'
+  })
+}

+ 20 - 0
tfis-ui/src/api/system/system.js

@@ -42,3 +42,23 @@ export function delSystem(id) {
     method: 'delete'
   })
 }
+
+
+// getSystemOptionbyid
+export function getSystemOption(aircraftTypeId) {
+  return request({
+    url: '/system/system/airsystem/' +aircraftTypeId,
+    method: 'get'
+  })
+}
+
+// getSysoptionOption
+export function getSysOption() {
+  return request({
+    url: '/system/system/getSysOption',
+    method: 'get'
+  })
+}
+
+
+

+ 1 - 0
tfis-ui/src/api/system/type.js

@@ -50,3 +50,4 @@ export function getTypeOption() {
     method: 'get'
   })
 }
+

+ 1 - 0
tfis-ui/src/components/Breadcrumb/index.vue

@@ -4,6 +4,7 @@
       <el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
         <span v-if="item.redirect === 'noRedirect' || index == levelList.length - 1" class="no-redirect">{{ item.meta.title }}</span>
         <a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
+        <p>1111111</p>
       </el-breadcrumb-item>
     </transition-group>
   </el-breadcrumb>

+ 230 - 5
tfis-ui/src/views/index.vue

@@ -1,20 +1,245 @@
 <template>
   <div class="app-container home">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+      <el-form-item label="机型" prop="aircraftTypeId">
+        <el-select v-model="queryParams.aircraftTypeId" placeholder="请选择" @change="handleaircraftChange">
+            <el-option
+              v-for="item in typeOption"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id">
+            </el-option>
+          </el-select>
+      </el-form-item>
+      <el-form-item label="系统" prop="aircraftSystemId">
+        <!-- <el-input
+          v-model="queryParams.aircraftSystemId"
+          placeholder="请输入系统"
+          clearable
+          @keyup.enter.native="handleQuery"
+        /> -->
+        <el-select v-model="queryParams.aircraftSystemId" placeholder="请选择" @change="handlesystemChange">
+            <el-option
+              v-for="item in systemOption"
+              :key="item.id"
+              :label="item.aircraftTypeName"
+              :value="item.id">
+            </el-option>
+          </el-select>
+      </el-form-item>
+
+
+      <el-form-item label="分系统" prop="aircraftSubsystemId">
+        <!-- <el-input
+          v-model="queryParams.aircraftSubsystemId"
+          placeholder="请输入分系统"
+          clearable
+          @keyup.enter.native="handleQuery"
+        /> -->
+        <el-select v-model="queryParams.aircraftSubsystemId" placeholder="请选择">
+            <el-option
+              v-for="item in subSystemOption"
+              :key="item.id"
+              :label="item.aircraftTypeName"
+              :value="item.id">
+            </el-option>
+          </el-select>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+
+    
   </div>
 </template>
 
 <script>
+import { listCase, getCase, delCase, addCase, updateCase } from "@/api/system/case";
+import { getTypeOption } from "@/api/system/type";
+import { getSystemOption } from "@/api/system/system";
+import { getSubSystemOption } from "@/api/system/subsystem"
 export default {
-  name: "Index",
+  name: "Case",
   data() {
     return {
-      // 版本号
-      version: "1.0.0"
+      // 遮罩层
+      loading: true,
+      // 选中数组
+      ids: [],
+      // 非单个禁用
+      single: true,
+      // 非多个禁用
+      multiple: true,
+      // 显示搜索条件
+      showSearch: true,
+      // 总条数
+      total: 0,
+      // 故障案例管理表格数据
+      caseList: [],
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      open: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+        aircraftTypeId: null,
+        aircraftSystemId: null,
+        aircraftSubsystemId: null,
+        faultPhenomenon: null,
+        faultCause: null,
+        faultTreePath: null,
+        faultPicturePath: null,
+        troubleshootingMethodPath: null,
+        viewCount: null,
+      },
+      // 表单参数
+      form: {},
+      // 表单校验
+      rules: {
+      },
+      typeOption: [],
+      systemOption:[],
+      subSystemOption:[],
     };
   },
+  created() {
+    this.getList();
+    this.getOption();
+
+  },
   methods: {
-    goTarget(href) {
-      window.open(href, "_blank");
+    getOption() {
+      getTypeOption().then(resp => {
+        this.typeOption = resp.data
+      })
+    },
+
+    /** 查询故障案例管理列表 */
+    getList() {
+      this.loading = true;
+      listCase(this.queryParams).then(response => {
+        this.caseList = response.rows;
+        this.total = response.total;
+        this.loading = false;
+      });
+    },
+
+        //机型变化后更新系统下拉框
+        handleaircraftChange() {
+      this.queryParams.aircraftSystemId = '';
+      this.queryParams.aircraftSubsystemId = '';
+      //alert(this.queryParams.aircraftTypeId)
+      getSystemOption(this.queryParams.aircraftTypeId).then(resp => {
+        this.systemOption = resp.data;
+      });
+    },
+
+    //系统变化后更新分系统
+    handlesystemChange(){
+       this.queryParams.aircraftSubsystemId = '';
+      getSubSystemOption(this.queryParams.aircraftSystemId).then(resp =>{
+        this.subSystemOption = resp.data;
+      })
+    },
+
+    // 取消按钮
+    cancel() {
+      this.open = false;
+      this.reset();
+    },
+    // 表单重置
+    reset() {
+      this.form = {
+        id: null,
+        aircraftTypeId: null,
+        aircraftSystemId: null,
+        aircraftSubsystemId: null,
+        faultPhenomenon: null,
+        faultCause: null,
+        faultTreePath: null,
+        faultPicturePath: null,
+        troubleshootingMethodPath: null,
+        viewCount: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null
+      };
+      this.resetForm("form");
+    },
+    /** 搜索按钮操作 */
+    handleQuery() {
+      this.queryParams.pageNum = 1;
+      this.getList();
+    },
+    /** 重置按钮操作 */
+    resetQuery() {
+      this.resetForm("queryForm");
+      this.handleQuery();
+    },
+    // 多选框选中数据
+    handleSelectionChange(selection) {
+      this.ids = selection.map(item => item.id)
+      this.single = selection.length!==1
+      this.multiple = !selection.length
+    },
+    /** 新增按钮操作 */
+    handleAdd() {
+      this.reset();
+      this.open = true;
+      this.title = "添加故障案例管理";
+    },
+    /** 修改按钮操作 */
+    handleUpdate(row) {
+      this.reset();
+      const id = row.id || this.ids
+      getCase(id).then(response => {
+        this.form = response.data;
+        this.open = true;
+        this.title = "修改故障案例管理";
+      });
+    },
+    /** 提交按钮 */
+    submitForm() {
+      this.$refs["form"].validate(valid => {
+        if (valid) {
+          if (this.form.id != null) {
+            updateCase(this.form).then(response => {
+              this.$modal.msgSuccess("修改成功");
+              this.open = false;
+              this.getList();
+            });
+          } else {
+            addCase(this.form).then(response => {
+              this.$modal.msgSuccess("新增成功");
+              this.open = false;
+              this.getList();
+            });
+          }
+        }
+      });
+    },
+    /** 删除按钮操作 */
+    handleDelete(row) {
+      const ids = row.id || this.ids;
+      this.$modal.confirm('是否确认删除故障案例管理编号为"' + ids + '"的数据项?').then(function() {
+        return delCase(ids);
+      }).then(() => {
+        this.getList();
+        this.$modal.msgSuccess("删除成功");
+      }).catch(() => {});
+    },
+    /** 导出按钮操作 */
+    handleExport() {
+      this.download('system/case/export', {
+        ...this.queryParams
+      }, `case_${new Date().getTime()}.xlsx`)
     }
   }
 };

+ 554 - 109
tfis-ui/src/views/system/case/index.vue

@@ -1,39 +1,75 @@
 <template>
   <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
+    <el-form v-show="showSearch" ref="queryForm" :model="queryParams" size="small" :inline="true" label-width="68px">
       <el-form-item label="机型" prop="aircraftTypeId">
-        <el-input
-          v-model="queryParams.aircraftTypeId"
-          placeholder="请输入机型"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+        <el-select v-model="queryParams.aircraftTypeId" placeholder="请选择" @change="handleaircraftChange">
+          <el-option
+            v-for="item in typeOption"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          />
+        </el-select>
       </el-form-item>
       <el-form-item label="系统" prop="aircraftSystemId">
-        <el-input
+        <!-- <el-input
           v-model="queryParams.aircraftSystemId"
           placeholder="请输入系统"
           clearable
           @keyup.enter.native="handleQuery"
-        />
+        /> -->
+        <el-select v-model="queryParams.aircraftSystemId" placeholder="请选择" @change="handlesystemChange">
+          <el-option
+            v-for="item in systemOption"
+            :key="item.id"
+            :label="item.aircraftTypeName"
+            :value="item.id"
+          />
+        </el-select>
       </el-form-item>
+
       <el-form-item label="分系统" prop="aircraftSubsystemId">
-        <el-input
+        <!-- <el-input
           v-model="queryParams.aircraftSubsystemId"
           placeholder="请输入分系统"
           clearable
           @keyup.enter.native="handleQuery"
+        /> -->
+        <el-select v-model="queryParams.aircraftSubsystemId" placeholder="请选择">
+          <el-option
+            v-for="item in subSystemOption"
+            :key="item.id"
+            :label="item.aircraftTypeName"
+            :value="item.id"
+          />
+        </el-select>
+      </el-form-item>
+      <el-form-item label="故障现象" prop="faultPhenomenon">
+        <el-input
+          v-model="queryParams.faultPhenomenon"
+          placeholder="请输入故障现象"
+          clearable
+          @keyup.enter.native="handleQuery"
+        />
+      </el-form-item>
+      <el-form-item label="故障原因" prop="faultCause">
+        <el-input
+          v-model="queryParams.faultCause"
+          placeholder="请输入故障原因"
+          clearable
+          @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <el-form-item label="故障树" prop="faultTreePath">
+
+      <!-- <el-form-item label="故障树" prop="faultTreePath">
         <el-input
           v-model="queryParams.faultTreePath"
           placeholder="请输入故障树"
           clearable
           @keyup.enter.native="handleQuery"
         />
-      </el-form-item>
-      <el-form-item label="故障图" prop="faultPicturePath">
+      </el-form-item> -->
+      <!-- <el-form-item label="故障图" prop="faultPicturePath">
         <el-input
           v-model="queryParams.faultPicturePath"
           placeholder="请输入故障图"
@@ -56,7 +92,7 @@
           clearable
           @keyup.enter.native="handleQuery"
         />
-      </el-form-item>
+      </el-form-item> -->
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -66,76 +102,88 @@
     <el-row :gutter="10" class="mb8">
       <el-col :span="1.5">
         <el-button
+          v-hasPermi="['system:case:add']"
           type="primary"
           plain
           icon="el-icon-plus"
           size="mini"
           @click="handleAdd"
-          v-hasPermi="['system:case:add']"
         >新增</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-hasPermi="['system:case:edit']"
           type="success"
           plain
           icon="el-icon-edit"
           size="mini"
           :disabled="single"
           @click="handleUpdate"
-          v-hasPermi="['system:case:edit']"
         >修改</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-hasPermi="['system:case:remove']"
           type="danger"
           plain
           icon="el-icon-delete"
           size="mini"
           :disabled="multiple"
           @click="handleDelete"
-          v-hasPermi="['system:case:remove']"
         >删除</el-button>
       </el-col>
       <el-col :span="1.5">
         <el-button
+          v-hasPermi="['system:case:export']"
           type="warning"
           plain
           icon="el-icon-download"
           size="mini"
           @click="handleExport"
-          v-hasPermi="['system:case:export']"
         >导出</el-button>
       </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
+      <right-toolbar :show-search.sync="showSearch" @queryTable="getList" />
     </el-row>
 
     <el-table v-loading="loading" :data="caseList" @selection-change="handleSelectionChange">
       <el-table-column type="selection" width="55" align="center" />
       <el-table-column label="编号" align="center" prop="id" />
-      <el-table-column label="机型" align="center" prop="aircraftTypeId" />
-      <el-table-column label="系统" align="center" prop="aircraftSystemId" />
-      <el-table-column label="分系统" align="center" prop="aircraftSubsystemId" />
+      <el-table-column label="机型" align="center" prop="aircraftTypeName" />
+      <el-table-column label="系统" align="center" prop="aircraftSystemName" />
+      <el-table-column label="分系统" align="center" prop="aircraftSubsystemName" />
       <el-table-column label="故障现象" align="center" prop="faultPhenomenon" />
       <el-table-column label="故障原因" align="center" prop="faultCause" />
-      <el-table-column label="故障树" align="center" prop="faultTreePath" />
+      <!-- <el-table-column label="故障树" align="center" prop="faultTreePath" />
       <el-table-column label="故障图" align="center" prop="faultPicturePath" />
-      <el-table-column label="排故方法" align="center" prop="troubleshootingMethodPath" />
+      <el-table-column label="排故方法" align="center" prop="troubleshootingMethodPath" /> -->
       <el-table-column label="浏览次数" align="center" prop="viewCount" />
+      <el-table-column label="创建人" align="center" prop="createBy" />
+      <el-table-column label="创建时间" align="center" prop="createTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.createTime) }}</span>
+        </template>
+      </el-table-column>
+      <el-table-column label="最后修改人" align="center" prop="updateBy" />
+      <el-table-column label="最后修改时间" align="center" prop="updateTime" width="180">
+        <template slot-scope="scope">
+          <span>{{ parseTime(scope.row.updateTime) }}</span>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
+            v-hasPermi="['system:case:edit']"
             size="mini"
             type="text"
             icon="el-icon-edit"
             @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:case:edit']"
           >修改</el-button>
           <el-button
+            v-hasPermi="['system:case:remove']"
             size="mini"
             type="text"
             icon="el-icon-delete"
             @click="handleDelete(scope.row)"
-            v-hasPermi="['system:case:remove']"
           >删除</el-button>
         </template>
       </el-table-column>
@@ -150,58 +198,187 @@
     />
 
     <!-- 添加或修改故障案例管理对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
+    <el-dialog :title="title" :visible.sync="open" width="80%" append-to-body :close-on-click-modal="false" :close-on-press-escape="false">
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="机型" prop="faultPhenomenon">
-          <el-select v-model="form.aircraftTypeId" placeholder="请选择">
-            <el-option
-              v-for="item in typeOption"
-              :key="item.id"
-              :label="item.name"
-              :value="item.id">
-            </el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="系统" prop="aircraftSystemId">
-          <el-input v-model="form.aircraftSystemId" placeholder="请输入系统" />
-        </el-form-item>
-        <el-form-item label="分系统" prop="aircraftSubsystemId">
-          <el-input v-model="form.aircraftSubsystemId" placeholder="请输入分系统" />
-        </el-form-item>
-        <el-form-item label="故障现象" prop="faultPhenomenon">
-          <el-input v-model="form.faultPhenomenon" type="textarea" placeholder="请输入内容" />
-        </el-form-item>
-        <el-form-item label="故障原因" prop="faultCause">
-          <el-input v-model="form.faultCause" type="textarea" placeholder="请输入内容" />
-        </el-form-item>
-        <el-form-item label="故障树" prop="faultTreePath">
-          <el-input v-model="form.faultTreePath" placeholder="请输入故障树" />
-        </el-form-item>
-        <el-form-item label="故障图" prop="faultPicturePath">
-          <el-input v-model="form.faultPicturePath" placeholder="请输入故障图" />
-        </el-form-item>
-        <el-form-item label="排故方法" prop="troubleshootingMethodPath">
-          <el-input v-model="form.troubleshootingMethodPath" placeholder="请输入排故方法" />
-        </el-form-item>
-        <el-form-item label="浏览次数" prop="viewCount">
-          <el-input v-model="form.viewCount" placeholder="请输入浏览次数" />
-        </el-form-item>
+        <el-row>
+          <el-col :span="6"><div class="grid-content bg-purple">
+            <el-form-item label="机型" prop="faultPhenomenon">
+              <el-select v-model="form.aircraftTypeId" placeholder="请选择" @change="handleaircraftChange1">
+                <el-option
+                  v-for="item in typeOption1"
+                  :key="item.id"
+                  :label="item.name"
+                  :value="item.id"
+                />
+              </el-select>
+            </el-form-item>
+          </div></el-col>
+          <el-col :span="6"><div class="grid-content bg-purple">
+            <el-form-item label="系统" prop="aircraftSystemId">
+              <el-select v-model="form.aircraftSystemId" placeholder="请选择" @change="handlesystemChange1">
+                <el-option
+                  v-for="item in systemOption1"
+                  :key="item.id"
+                  :label="item.aircraftTypeName"
+                  :value="item.id"
+                />
+              </el-select>
+            </el-form-item>
+          </div></el-col>
+          <el-col :span="6"><div class="grid-content bg-purple">
+            <el-form-item label="分系统" prop="aircraftSubsystemId">
+              <el-select v-model="form.aircraftSubsystemId" placeholder="请选择">
+                <el-option
+                  v-for="item in subSystemOption1"
+                  :key="item.id"
+                  :label="item.aircraftTypeName"
+                  :value="item.id"
+                />
+              </el-select>
+            </el-form-item>
+          </div>
+          </el-col>
+          <el-col :span="6"><div class="grid-content bg-purple" /></el-col>
+        </el-row>
+        <el-row>
+          <el-col :span="12">
+            <el-card class="box-card" style="margin:5px">
+              <div slot="header" class="clearfix">
+                <span>故障现象</span>
+              </div>
+              <div>
+                <el-input v-model="form.faultPhenomenon" type="textarea" :rows="5" placeholder="请输入内容" />
+              </div>
+            </el-card>
+          </el-col>
+          <el-col :span="12">
+            <el-card class="box-card" style="margin:5px">
+              <div slot="header" class="clearfix">
+                <span>故障原因</span>
+              </div>
+              <div>
+                <el-input v-model="form.faultCause" type="textarea" :rows="5" placeholder="请输入内容" />
+              </div>
+            </el-card>
+          </el-col>
+        </el-row>
+        <el-row>
+          <el-card class="box-card" style="margin:5px">
+            <div slot="header" class="clearfix">
+              <span>故障树</span>
+            </div>
+            <div>
+              <el-upload
+                v-if="!form.faultTreePath"
+                ref="loadtree"
+                v-model="form.faultTreePath"
+                class="avatar-uploader"
+                :action="uploadFileUrl"
+                :multiple="false"
+                list-type="picture-card"
+                :before-upload="beforeTreeUpload"
+                :on-success="afterTreeUpload"
+                :headers="headers"
+              >
+                <i class="el-icon-plus" />
+              </el-upload>
+              <div v-if="form.faultTreePath">
+                <img :src="baseUrl+form.faultTreePath" style="max-width: 100%;" @load="showResetBtn = true;">
+                <div style="flex: 1;" /> <!-- 占位符,用于将重置按钮推到最右侧 -->
+                <el-button v-if="showResetBtn" type="danger" @click="reuploadTree">重置</el-button>
+              </div>
+            </div>
+          </el-card>
+        </el-row>
+        <el-row>
+          <el-card class="box-card" style="margin:5px">
+            <div slot="header" class="clearfix">
+              <span>排故方法</span>
+            </div>
+            <el-row>
+              <el-col :span="4">
+                <span>故障图</span>
+                <div>
+                  <el-upload
+                    v-if="!form.faultPicturePath"
+                    v-model="form.faultPicturePath"
+                    class="avatar-uploader"
+                    :action="uploadFileUrl"
+                    :multiple="false"
+                    list-type="picture-card"
+                    :before-upload="beforePicUpload"
+                    :on-success="afterPicUpload"
+                    :headers="headers"
+                  >
+                    <i class="el-icon-plus" />
+                  </el-upload>
+                  <div v-if="form.faultPicturePath">
+                    <img :src="baseUrl+form.faultPicturePath" style="max-width: 100px;" @load="showResetBtnpic = true" @click="showModal = true;imageSrc=form.faultPicturePath">
+                    <div style="flex: 1;" /> <!-- 占位符,用于将重置按钮推到最右侧 -->
+                    <el-button v-if="showResetBtnpic" type="danger" @click="reuploadPic">重置</el-button>
+                  </div>
+                </div>
+              </el-col>
+              <el-col :span="20">
+                <span>文档</span>
+                <div>
+                  <el-upload
+                    v-if="!form.troubleshootingMethodPath"
+                    v-model="form.troubleshootingMethodPath"
+                    class="avatar-uploader"
+                    :action="uploadFileUrl"
+                    :multiple="false"
+                    list-type="picture-card"
+                    :before-upload="beforeMethodUpload"
+                    :on-success="afterMethodUpload"
+                    :headers="headers"
+                  >
+                    <i class="el-icon-plus" />
+                  </el-upload>
+                  <div v-if="form.troubleshootingMethodPath">
+                    <div ref="troubleshootingMethodFile" />
+                    <div style="flex: 1;" /> <!-- 占位符,用于将重置按钮推到最右侧 -->
+                    <el-button type="danger" @click="reuploadMethod">重置</el-button>
+                  </div>
+                </div>
+              </el-col>
+            </el-row>
+          </el-card>
+        </el-row>
+        <div v-if="showModal" class="modal" @click="showModal = false">
+          <img :src="baseUrl+imageSrc" class="full-image">
+        </div>
       </el-form>
+
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
       </div>
     </el-dialog>
+
   </div>
 </template>
 
 <script>
-import { listCase, getCase, delCase, addCase, updateCase } from "@/api/system/case";
-import { getTypeOption } from "@/api/system/type";
+import { listCase, getCase, delCase, addCase, updateCase } from '@/api/system/case'
+import { getTypeOption } from '@/api/system/type'
+import { getSystemOption } from '@/api/system/system'
+import { getSubSystemOption } from '@/api/system/subsystem'
+import { renderAsync } from 'docx-preview'
+import { getToken } from '@/utils/auth'
+import axios from 'axios'
+
 export default {
-  name: "Case",
+  name: 'Case',
   data() {
     return {
+      wordText: '',
+      wordURL: 'test.docx', // 文件地址,看你对应怎末获取、赋值
+      showResetBtn: false,
+      showResetBtnpic: false,
+      name: '',
+      fileList: [],
+      hideUpload: false,
       // 遮罩层
       loading: true,
       // 选中数组
@@ -217,9 +394,11 @@ export default {
       // 故障案例管理表格数据
       caseList: [],
       // 弹出层标题
-      title: "",
+      title: '',
       // 是否显示弹出层
       open: false,
+      picUrl_tree: '',
+      faultTreePath: '',
       // 查询参数
       queryParams: {
         pageNum: 1,
@@ -232,19 +411,50 @@ export default {
         faultTreePath: null,
         faultPicturePath: null,
         troubleshootingMethodPath: null,
-        viewCount: null,
+        viewCount: null
       },
       // 表单参数
-      form: {},
+      form: {
+        aircraftTypeId: null,
+        aircraftSystemId: null,
+        aircraftSubsystemId: null,
+        faultPhenomenon: null,
+        faultCause: null,
+        id: null,
+        faultTreePath: null, // 存储上传成功后的文件路径
+        faultPicturePath: null,
+        troubleshootingMethodPath: null,
+        viewCount: null,
+        createBy: null,
+        createTime: null,
+        updateBy: null,
+        updateTime: null
+      },
       // 表单校验
       rules: {
       },
-      typeOption: []
-    };
+      fileList: [], // 存储上传文件列表
+      typeOption: [],
+      typeOption1: [],
+      systemOption: [],
+      subSystemOption: [],
+      systemOption1: [],
+      subSystemOption1: [],
+      showModal: false, // 控制模态框显示的变量
+      imageSrc: '', // 图片路径
+      showResetBtnMethod: false,
+      // file upload
+      baseUrl: process.env.VUE_APP_BASE_API,
+      uploadFileUrl: process.env.VUE_APP_BASE_API + '/common/upload', // 上传文件服务器地址
+      headers: {
+        Authorization: 'Bearer ' + getToken()
+      }
+    }
   },
   created() {
-    this.getList();
-    this.getOption();
+    this.getList()
+    this.getOption()
+    this.getOption1()
   },
   methods: {
     getOption() {
@@ -252,19 +462,167 @@ export default {
         this.typeOption = resp.data
       })
     },
+    // 用于获取飞机机型(放到添加功能中)
+    getOption1() {
+      getTypeOption().then(resp => {
+        this.typeOption1 = resp.data
+      })
+    },
+
+    // 故障树
+    beforeTreeUpload(file) {
+      const fileName = file.name
+      const fileType = fileName.substring(fileName.lastIndexOf('.'))
+      const isOKType =
+        fileType === '.jpg' ||
+        fileType === '.png' ||
+        fileType === '.jpeg' ||
+        fileType === '.bmp' ||
+        fileType === '.gif'
+      if (!isOKType) {
+        this.$message.error('图片格式只能为jpeg/png/jpg/bmp/gif')
+      }
+
+      const isLt2M = file.size / 1024 / 1024 < 2
+      if (!isLt2M) {
+        this.$message.error('图片大小不能超过 2MB!')
+      }
+      return isLt2M && isOKType
+    },
+    afterTreeUpload(response, file) {
+      // 上传完成后的处理逻辑
+      console.log('上传完成', response, file)
+      if (response.code === 200) {
+        this.form.faultTreePath = response.fileName
+      }
+    },
+    reuploadTree() {
+      this.form.faultTreePath = ''
+      this.showResetBtn = false
+    },
+
+    // 故障图
+    beforePicUpload(file) {
+      const fileName = file.name
+      const fileType = fileName.substring(fileName.lastIndexOf('.'))
+      const isOKType =
+        fileType === '.jpg' ||
+        fileType === '.png' ||
+        fileType === '.jpeg' ||
+        fileType === '.bmp' ||
+        fileType === '.gif'
+      if (!isOKType) {
+        this.$message.error('图片格式只能为jpeg/png/jpg/bmp/gif')
+      }
+
+      const isLt2M = file.size / 1024 / 1024 < 2
+      if (!isLt2M) {
+        this.$message.error('图片大小不能超过 2MB!')
+      }
+      return isLt2M && isOKType
+    },
+
+    afterPicUpload(response, file) {
+      if (response.code === 200) {
+        this.form.faultPicturePath = response.fileName
+      }
+      // 上传完成后的处理逻辑
+      console.log('上传完成', response, file)
+    },
+    reuploadPic() {
+      this.form.faultPicturePath = ''
+      // this.$refs.loadtree.clearFiles();
+      this.showResetBtnpic = false
+    },
+
+    // 排故流程word文档
+    beforeMethodUpload(file) {
+      const fileName = file.name
+      const fileType = fileName.substring(fileName.lastIndexOf('.'))
+      const isOKType =
+        fileType === '.doc' ||
+        fileType === '.docx'
+      if (!isOKType) {
+        this.$message.error('文件格式只能为doc/docx')
+      }
+
+      const isLt2M = file.size / 1024 / 1024 < 5
+      if (!isLt2M) {
+        this.$message.error('图片大小不能超过 5MB!')
+      }
+      return isLt2M && isOKType
+    },
+    afterMethodUpload(response, file) {
+      debugger
+      if (response.code === 200) {
+        this.form.troubleshootingMethodPath = response.fileName
+        axios({
+          method: 'get',
+          responseType: 'blob',
+          url: this.baseUrl + this.form.troubleshootingMethodPath
+        }).then((response) => {
+          debugger;
+          renderAsync(response.data, this.$refs.troubleshootingMethodFile)
+        })
+      }
+      // 上传完成后的处理逻辑
+      console.log('上传完成', response, file)
+    },
+    reuploadMethod() {
+      this.form.troubleshootingMethodPath = ''
+      // this.$refs.loadtree.clearFiles();
+      this.showResetBtnMethod = false
+    },
+
+    // 机型变化后更新系统下拉框
+    handleaircraftChange() {
+      this.queryParams.aircraftSystemId = ''
+      this.queryParams.aircraftSubsystemId = ''
+      // alert(this.queryParams.aircraftTypeId)
+      getSystemOption(this.queryParams.aircraftTypeId).then(resp => {
+        this.systemOption = resp.data
+      })
+    },
+
+    // 系统变化后更新分系统
+    handlesystemChange() {
+      this.queryParams.aircraftSubsystemId = ''
+      getSubSystemOption(this.queryParams.aircraftSystemId).then(resp => {
+        this.subSystemOption = resp.data
+      })
+    },
+
+    // 添加或修改对话框中机型变化后,修改系统
+    handleaircraftChange1() {
+      this.form.aircraftSystemId = ''
+      this.form.aircraftSubsystemId = ''
+      // alert(this.queryParams.aircraftTypeId)
+      getSystemOption(this.form.aircraftTypeId).then(resp => {
+        this.systemOption1 = resp.data
+      })
+    },
+
+    // 添加或修改对话框中系统变化后,修改分系统
+    handlesystemChange1() {
+      this.form.aircraftSubsystemId = ''
+      getSubSystemOption(this.form.aircraftSystemId).then(resp => {
+        this.subSystemOption1 = resp.data
+      })
+    },
+
     /** 查询故障案例管理列表 */
     getList() {
-      this.loading = true;
+      this.loading = true
       listCase(this.queryParams).then(response => {
-        this.caseList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
+        this.caseList = response.rows
+        this.total = response.total
+        this.loading = false
+      })
     },
     // 取消按钮
     cancel() {
-      this.open = false;
-      this.reset();
+      this.open = false
+      this.reset()
     },
     // 表单重置
     reset() {
@@ -283,70 +641,107 @@ export default {
         createTime: null,
         updateBy: null,
         updateTime: null
-      };
-      this.resetForm("form");
+      }
+      this.resetForm('form')
     },
     /** 搜索按钮操作 */
     handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
+      this.queryParams.pageNum = 1
+      this.getList()
     },
     /** 重置按钮操作 */
     resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
+      this.resetForm('queryForm')
+      this.handleQuery()
     },
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
+      this.single = selection.length !== 1
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
     handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加故障案例管理";
+      this.reset()
+      this.open = true
+      this.title = '添加故障案例管理'
+    },
+    /** 修改按钮操作 */
+    handleUpdate() {
+      this.resetForm('queryForm')
+      const id = row.id || this.ids
+      getCase(id).then(response => {
+        debugger;
+        this.form = response.data
+        this.open = true
+        this.title = '修改故障案例管理'
+        if (this.form.troubleshootingMethodPath) {
+          axios({
+            method: 'get',
+            responseType: 'blob',
+            url: this.baseUrl + this.form.troubleshootingMethodPath
+          }).then((response) => {
+            debugger;
+            renderAsync(response.data, this.$refs.troubleshootingMethodFile)
+          })
+        }
+      })
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
-      this.reset();
+      this.resetForm('queryForm')
       const id = row.id || this.ids
       getCase(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改故障案例管理";
-      });
+        this.form = response.data
+        this.open = true
+        this.title = '修改故障案例管理'
+        if (this.form.troubleshootingMethodPath) {
+          axios({
+            method: 'get',
+            responseType: 'blob',
+            url: this.baseUrl + this.form.troubleshootingMethodPath
+          }).then((response) => {
+            debugger;
+            renderAsync(response.data, this.$refs.troubleshootingMethodFile)
+          })
+        }
+      })
     },
     /** 提交按钮 */
     submitForm() {
-      this.$refs["form"].validate(valid => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           if (this.form.id != null) {
             updateCase(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
+              this.$modal.msgSuccess('修改成功')
+              this.open = false
+              this.queryParams.aircraftTypeId = null
+              this.queryParams.aircraftSystemId = null
+              this.queryParams.aircraftSubsystemId = null
+              this.getList()
+            })
           } else {
             addCase(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
+              this.$modal.msgSuccess('新增成功')
+              this.open = false
+              this.queryParams.aircraftTypeId = null
+              this.queryParams.aircraftSystemId = null
+              this.queryParams.aircraftSubsystemId = null
+              this.getList()
+            })
           }
         }
-      });
+      })
     },
     /** 删除按钮操作 */
     handleDelete(row) {
-      const ids = row.id || this.ids;
+      const ids = row.id || this.ids
       this.$modal.confirm('是否确认删除故障案例管理编号为"' + ids + '"的数据项?').then(function() {
-        return delCase(ids);
+        return delCase(ids)
       }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
+        this.getList()
+        this.$modal.msgSuccess('删除成功')
+      }).catch(() => {})
     },
     /** 导出按钮操作 */
     handleExport() {
@@ -355,5 +750,55 @@ export default {
       }, `case_${new Date().getTime()}.xlsx`)
     }
   }
-};
+}
 </script>
+
+<style>
+  .avatar-uploader {
+    display: inline-block;
+    text-align: center;
+    position: relative;
+    overflow: hidden;
+  }
+  .avatar {
+    width: 100px;
+    height: 100px;
+    display: block;
+  }
+
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    display: block;
+    width: 100px;
+    height: 100px;
+    line-height: 100px;
+  }
+
+  .modal {
+    position: fixed;
+    top: 0;
+    left: 0;
+    width: 100%;
+    height: 100%;
+    background-color: rgba(0, 0, 0, 0.8);
+    display: flex;
+    justify-content: center;
+    align-items: center;
+    z-index: 9999;
+  }
+
+  .full-image {
+    max-width: 80%;
+    max-height: 80%;
+  }
+
+  /* .disabled .el-upload.el-upload--picture-card {
+    display: none !important;
+}
+
+.disabled .el-button--success.is-plain {
+    display: none !important;
+} */
+
+</style>

+ 0 - 255
tfis-ui/src/views/system/count/index.vue

@@ -1,255 +0,0 @@
-<template>
-  <div class="app-container">
-    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="浏览次数" prop="viewCount">
-        <el-input
-          v-model="queryParams.viewCount"
-          placeholder="请输入浏览次数"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
-      </el-form-item>
-      <el-form-item>
-        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
-      </el-form-item>
-    </el-form>
-
-    <el-row :gutter="10" class="mb8">
-      <el-col :span="1.5">
-        <el-button
-          type="primary"
-          plain
-          icon="el-icon-plus"
-          size="mini"
-          @click="handleAdd"
-          v-hasPermi="['system:count:add']"
-        >新增</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="success"
-          plain
-          icon="el-icon-edit"
-          size="mini"
-          :disabled="single"
-          @click="handleUpdate"
-          v-hasPermi="['system:count:edit']"
-        >修改</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="danger"
-          plain
-          icon="el-icon-delete"
-          size="mini"
-          :disabled="multiple"
-          @click="handleDelete"
-          v-hasPermi="['system:count:remove']"
-        >删除</el-button>
-      </el-col>
-      <el-col :span="1.5">
-        <el-button
-          type="warning"
-          plain
-          icon="el-icon-download"
-          size="mini"
-          @click="handleExport"
-          v-hasPermi="['system:count:export']"
-        >导出</el-button>
-      </el-col>
-      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
-    </el-row>
-
-    <el-table v-loading="loading" :data="countList" @selection-change="handleSelectionChange">
-      <el-table-column type="selection" width="55" align="center" />
-      <el-table-column label="编号" align="center" prop="id" />
-      <el-table-column label="故障案例" align="center" prop="faultCaseId" />
-      <el-table-column label="浏览次数" align="center" prop="viewCount" />
-      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
-        <template slot-scope="scope">
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['system:count:edit']"
-          >修改</el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row)"
-            v-hasPermi="['system:count:remove']"
-          >删除</el-button>
-        </template>
-      </el-table-column>
-    </el-table>
-    
-    <pagination
-      v-show="total>0"
-      :total="total"
-      :page.sync="queryParams.pageNum"
-      :limit.sync="queryParams.pageSize"
-      @pagination="getList"
-    />
-
-    <!-- 添加或修改故障案例查看次数管理对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="浏览次数" prop="viewCount">
-          <el-input v-model="form.viewCount" placeholder="请输入浏览次数" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-import { listCount, getCount, delCount, addCount, updateCount } from "@/api/system/count";
-
-export default {
-  name: "Count",
-  data() {
-    return {
-      // 遮罩层
-      loading: true,
-      // 选中数组
-      ids: [],
-      // 非单个禁用
-      single: true,
-      // 非多个禁用
-      multiple: true,
-      // 显示搜索条件
-      showSearch: true,
-      // 总条数
-      total: 0,
-      // 故障案例查看次数管理表格数据
-      countList: [],
-      // 弹出层标题
-      title: "",
-      // 是否显示弹出层
-      open: false,
-      // 查询参数
-      queryParams: {
-        pageNum: 1,
-        pageSize: 10,
-        faultCaseId: null,
-        viewCount: null,
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        faultCaseId: [
-          { required: true, message: "故障案例不能为空", trigger: "change" }
-        ],
-      }
-    };
-  },
-  created() {
-    this.getList();
-  },
-  methods: {
-    /** 查询故障案例查看次数管理列表 */
-    getList() {
-      this.loading = true;
-      listCount(this.queryParams).then(response => {
-        this.countList = response.rows;
-        this.total = response.total;
-        this.loading = false;
-      });
-    },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
-    // 表单重置
-    reset() {
-      this.form = {
-        id: null,
-        faultCaseId: null,
-        viewCount: null,
-        createBy: null,
-        createTime: null,
-        updateBy: null,
-        updateTime: null
-      };
-      this.resetForm("form");
-    },
-    /** 搜索按钮操作 */
-    handleQuery() {
-      this.queryParams.pageNum = 1;
-      this.getList();
-    },
-    /** 重置按钮操作 */
-    resetQuery() {
-      this.resetForm("queryForm");
-      this.handleQuery();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map(item => item.id)
-      this.single = selection.length!==1
-      this.multiple = !selection.length
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加故障案例查看次数管理";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids
-      getCount(id).then(response => {
-        this.form = response.data;
-        this.open = true;
-        this.title = "修改故障案例查看次数管理";
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate(valid => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateCount(this.form).then(response => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addCount(this.form).then(response => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row) {
-      const ids = row.id || this.ids;
-      this.$modal.confirm('是否确认删除故障案例查看次数管理编号为"' + ids + '"的数据项?').then(function() {
-        return delCount(ids);
-      }).then(() => {
-        this.getList();
-        this.$modal.msgSuccess("删除成功");
-      }).catch(() => {});
-    },
-    /** 导出按钮操作 */
-    handleExport() {
-      this.download('system/count/export', {
-        ...this.queryParams
-      }, `count_${new Date().getTime()}.xlsx`)
-    }
-  }
-};
-</script>

+ 70 - 17
tfis-ui/src/views/system/subsystem/index.vue

@@ -2,21 +2,29 @@
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="系统" prop="aircraftSystemId">
-        <el-input
-          v-model="queryParams.aircraftSystemId"
-          placeholder="请输入系统"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+        <el-select v-model="queryParams.aircraftSystemId" placeholder="请选择" @change="handlesystemChange">
+          <!--  -->
+            <el-option
+              v-for="item in allsystemOption"
+              :key="item.id"
+              :label="item.aircraft_type_name"
+              :value="item.id">
+            </el-option>
+          </el-select>
       </el-form-item>
-      <el-form-item label="分系统名称" prop="aircraftTypeName">
-        <el-input
-          v-model="queryParams.aircraftTypeName"
-          placeholder="请输入分系统名称"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+
+
+      <el-form-item label="分系统" prop="aircraftTypeName">
+        <el-select v-model="queryParams.aircraftTypeName" placeholder="请选择">
+            <el-option
+              v-for="item in subSystemOption"
+              :key="item.id"
+              :label="item.aircraftTypeName"
+              :value="item.aircraftTypeName">
+            </el-option>
+          </el-select>
       </el-form-item>
+
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
         <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
@@ -107,8 +115,16 @@
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
         <el-form-item label="系统" prop="aircraftSystemId">
-          <el-input v-model="form.aircraftSystemId" placeholder="请输入系统" />
-        </el-form-item>
+        <el-select v-model="form.aircraftSystemId" placeholder="请选择">
+            <el-option
+              v-for="item in allsystemOption1"
+              :key="item.id"
+              :label="item.aircraft_type_name"
+              :value="item.id">
+            </el-option>
+          </el-select>
+      </el-form-item>
+
         <el-form-item label="分系统名称" prop="aircraftTypeName">
           <el-input v-model="form.aircraftTypeName" placeholder="请输入分系统名称" />
         </el-form-item>
@@ -126,6 +142,8 @@
 
 <script>
 import { listSubsystem, getSubsystem, delSubsystem, addSubsystem, updateSubsystem } from "@/api/system/subsystem";
+import { getSysOption } from "@/api/system/system";
+import { getSubSystemOption } from "@/api/system/subsystem"
 
 export default {
   name: "Subsystem",
@@ -155,18 +173,50 @@ export default {
         pageSize: 10,
         aircraftSystemId: null,
         aircraftTypeName: null,
+        aircraftSubsystemId:null
       },
       // 表单参数
-      form: {},
+      form: {
+        aircraftSystemId: null,
+        aircraftTypeName: null,
+        remark:null,
+      },
       // 表单校验
       rules: {
-      }
+      },
+      allsystemOption:[],
+      allsystemOption1:[],
+      subSystemOption:[],
+      systemOption1:[],
     };
   },
   created() {
     this.getList();
+    this.getSystemOption();
+    this.getSystemOption1();
+  },
+  activated() {
+    this.getSystemOption();
+    this.getSystemOption1();
   },
   methods: {
+    getSystemOption() {
+      getSysOption().then(resp => {
+        this.allsystemOption = resp.data
+      })
+    },
+    getSystemOption1() {
+      getSysOption().then(resp => {
+        this.allsystemOption1 = resp.data
+      })
+    },
+     //系统变化后更新分系统
+     handlesystemChange(){
+       this.queryParams.aircraftSubsystemId = '';
+      getSubSystemOption(this.queryParams.aircraftSystemId).then(resp =>{
+        this.subSystemOption = resp.data;
+      })
+    },
     /** 查询分系统信息管理列表 */
     getList() {
       this.loading = true;
@@ -241,6 +291,9 @@ export default {
             addSubsystem(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
+              this.queryParams.aircraftSystemId= null;
+              this.queryParams.aircraftTypeName= null;
+              this.queryParams.aircraftSubsystemId=null;
               this.getList();
             });
           }

+ 82 - 17
tfis-ui/src/views/system/system/index.vue

@@ -2,20 +2,24 @@
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
       <el-form-item label="机型" prop="aircraftTypeId">
-        <el-input
-          v-model="queryParams.aircraftTypeId"
-          placeholder="请输入机型"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+        <el-select v-model="queryParams.aircraftTypeId" placeholder="请选择" @change="handleaircraftChange">
+            <el-option
+              v-for="item in typeOption"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id">
+            </el-option>
+          </el-select>
       </el-form-item>
-      <el-form-item label="系统名称" prop="aircraftTypeName">
-        <el-input
-          v-model="queryParams.aircraftTypeName"
-          placeholder="请输入系统名称"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="系统" prop="aircraftSystemId">
+        <el-select v-model="queryParams.aircraftTypeName" placeholder="请选择">
+            <el-option
+              v-for="item in systemOption"
+              :key="item.aircraftTypeName"
+              :label="item.aircraftTypeName"
+              :value="item.aircraftTypeName">
+            </el-option>
+          </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -106,8 +110,15 @@
     <!-- 添加或修改系统信息管理对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="机型" prop="aircraftTypeId">
-          <el-input v-model="form.aircraftTypeId" placeholder="请输入机型" />
+        <el-form-item label="机型" prop="faultPhenomenon">
+          <el-select v-model="form.aircraftTypeId" placeholder="请选择" @change="handleaircraftChange1">
+            <el-option
+              v-for="item in typeOption1"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id">
+            </el-option>
+          </el-select>
         </el-form-item>
         <el-form-item label="系统名称" prop="aircraftTypeName">
           <el-input v-model="form.aircraftTypeName" placeholder="请输入系统名称" />
@@ -126,6 +137,9 @@
 
 <script>
 import { listSystem, getSystem, delSystem, addSystem, updateSystem } from "@/api/system/system";
+import { getTypeOption } from "@/api/system/type";
+import { getSystemOption,getSysOption } from "@/api/system/system";
+
 
 export default {
   name: "System",
@@ -155,18 +169,63 @@ export default {
         pageSize: 10,
         aircraftTypeId: null,
         aircraftTypeName: null,
+        aircraftSystemId:null,
       },
       // 表单参数
-      form: {},
+      form: {
+        aircraftTypeId: null,
+        aircraftTypeName: null,
+        aircraftSystemId:null,
+        remark:null
+      },
       // 表单校验
       rules: {
-      }
+      },
+      typeOption: [],
+      typeOption1: [],
+      systemOption:[],
+      subSystemOption:[],
+      systemOption1:[]
     };
   },
   created() {
     this.getList();
+    this.getOption();
+    this.getOption1();
+    // this.getSysOption();
+  },
+  activated() {
+    this.getOption();
+    this.getOption1();
   },
   methods: {
+      getOption() {
+        getTypeOption().then(resp => {
+          this.typeOption = resp.data
+        })
+      },
+       //用于获取飞机机型(放到添加功能中)
+    getOption1() {
+      getTypeOption().then(resp => {
+        this.typeOption1 = resp.data
+      })
+    },
+        //机型变化后更新系统下拉框
+    handleaircraftChange() {
+      this.queryParams.aircraftSystemId = '';
+      //alert(this.queryParams.aircraftTypeId)
+      getSystemOption(this.queryParams.aircraftTypeId).then(resp => {
+        this.systemOption = resp.data;
+      });
+    },
+     //添加或修改对话框中机型变化后,修改系统
+    handleaircraftChange1() {
+      this.form.aircraftSystemId = '';
+      //alert(this.queryParams.aircraftTypeId)
+      getSystemOption(this.form.aircraftTypeId).then(resp => {
+        this.systemOption1 = resp.data;
+      });
+    },
     /** 查询系统信息管理列表 */
     getList() {
       this.loading = true;
@@ -235,12 +294,18 @@ export default {
             updateSystem(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
+              this.queryParams.aircraftTypeId = null;
+              this.queryParams.aircraftTypeName= null;
+              this.queryParams.aircraftSystemId=null;
               this.getList();
             });
           } else {
             addSystem(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
+              this.queryParams.aircraftTypeId = null;
+              this.queryParams.aircraftTypeName= null;
+              this.queryParams.aircraftSystemId=null;
               this.getList();
             });
           }

+ 39 - 11
tfis-ui/src/views/system/type/index.vue

@@ -1,13 +1,15 @@
 <template>
   <div class="app-container">
     <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
-      <el-form-item label="机型名称" prop="aircraftTypeName">
-        <el-input
-          v-model="queryParams.aircraftTypeName"
-          placeholder="请输入机型名称"
-          clearable
-          @keyup.enter.native="handleQuery"
-        />
+      <el-form-item label="机型名称" prop="aircraftTypeName" @change="handleaircraftChange">
+        <el-select v-model="queryParams.aircraftTypeName" placeholder="请选择">
+            <el-option
+              v-for="item in typeOption"
+              :key="item.name"
+              :label="item.name"
+              :value="item.name">
+            </el-option>
+          </el-select>
       </el-form-item>
       <el-form-item>
         <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
@@ -97,8 +99,8 @@
     <!-- 添加或修改机型信息管理对话框 -->
     <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="机型名称" prop="aircraftTypeName">
-          <el-input v-model="form.aircraftTypeName" placeholder="请输入机型名称" />
+        <el-form-item label="机型" prop="faultPhenomenon">
+          <el-input v-model="form.aircraftTypeName" placeholder="请输入机型" />
         </el-form-item>
         <el-form-item label="备注" prop="remark">
           <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
@@ -114,6 +116,8 @@
 
 <script>
 import { listType, getType, delType, addType, updateType } from "@/api/system/type";
+import { getTypeOption } from "@/api/system/type";
+import { getSystemOption } from "@/api/system/system";
 
 export default {
   name: "Type",
@@ -142,19 +146,29 @@ export default {
         pageNum: 1,
         pageSize: 10,
         aircraftTypeName: null,
+        aircraftTypeId:null
       },
       // 表单参数
-      form: {},
+      form: {
+        aircraftTypeName:null
+      },
       // 表单校验
       rules: {
-      }
+      },
+      typeOption: [],
     };
   },
   created() {
+    this.getOption();
     this.getList();
   },
   methods: {
     /** 查询机型信息管理列表 */
+    getOption() {
+      getTypeOption().then(resp => {
+        this.typeOption = resp.data
+      })
+    },
     getList() {
       this.loading = true;
       listType(this.queryParams).then(response => {
@@ -162,6 +176,14 @@ export default {
         this.total = response.total;
         this.loading = false;
       });
+    },
+     //机型变化后更新系统下拉框
+     handleaircraftChange() {
+      this.queryParams.aircraftSystemId = '';
+      //alert(this.queryParams.aircraftTypeId)
+      getSystemOption(this.queryParams.aircraftTypeId).then(resp => {
+        this.systemOption = resp.data;
+      });
     },
     // 取消按钮
     cancel() {
@@ -221,13 +243,19 @@ export default {
             updateType(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
+              this.queryParams.aircraftTypeName = null;
+              this.queryParams.aircraftTypeId=null;
               this.getList();
+              this.getOption();
             });
           } else {
             addType(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
+              this.queryParams.aircraftTypeName = null;
+              this.queryParams.aircraftTypeId=null;
               this.getList();
+              this.getOption();
             });
           }
         }