门户网站功能配置,包括前端和后端
master
xs 6 months ago
parent 8973798784
commit 84b1de6f3b

@ -0,0 +1,38 @@
package com.ruoyi.common.core.constant;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* @Description:
* @ClassName: HwPortalConstants
* @Author : xins
* @Date :2023-12-18 15:20
* @Version :1.0
*/
public class HwPortalConstants {
/**
*
* (1 ++42+3+24+25+6+73,894)
*/
public static final String PRODUCT_INFO_CONFIG_MODAL_ONE = "1";
public static final String PRODUCT_INFO_CONFIG_MODAL_TWO = "2";
// public static final List<String> ABNDON_FUNCTION_IDENTIFIERS = Arrays.asList("ts","value1","type");
//
// public static final String DEFAULT_FIRST_FIELD_NAME_DISPLAY = "时间";//timestamp格式首字段的显示名称
// public static final Map<String, String> DEVICE_DATA_COLUMN_MAP = new HashMap<String, String>();
//
// static {
// DEVICE_DATA_COLUMN_MAP.put(ST_TAG_DEVICECODE, "设备编号");
// DEVICE_DATA_COLUMN_MAP.put(ST_TAG_DEVICENAME, "设备名称");
// DEVICE_DATA_COLUMN_MAP.put(DEFAULT_FIRST_FIELD_NAME, DEFAULT_FIRST_FIELD_NAME_DISPLAY);
// }
}

@ -9,10 +9,8 @@ import com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DataSourcePrope
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.basic.domain.HwTemplate;
import com.ruoyi.basic.domain.LayoutConfig;
import com.ruoyi.basic.domain.LayoutDesc;
import com.ruoyi.basic.service.HwTemplateService;
import com.ruoyi.basic.service.LayoutConfigService;
import com.ruoyi.basic.service.LayoutDescService;
@ -44,8 +42,7 @@ public class LayoutConfigController {
private LayoutConfigService layoutConfigService;
@Autowired
private LayoutDescService layoutDescService;
@Autowired
private HwTemplateService hwTemplateService;
/**
*

@ -81,4 +81,4 @@ public class LayoutDescController {
return ResponseEntity.ok(this.layoutDescService.deleteById(id));
}
}
}

@ -116,4 +116,4 @@ public class LayoutConfig implements Serializable {
// this.updateTime = updateTime;
// }
}
}

@ -104,4 +104,4 @@ public class LayoutDesc implements Serializable {
// this.updateTime = updateTime;
// }
}
}

@ -84,4 +84,4 @@ public interface LayoutConfigDao {
List<LayoutConfig> selectConfigById(String sceneId);
List<LayoutDesc> selectAllScenes();
}
}

@ -157,4 +157,4 @@
delete from layout_config where config_id = #{configId}
</delete>
</mapper>
</mapper>

@ -133,4 +133,4 @@
delete from layout_desc where layout_id = #{layoutId}
</delete>
</mapper>
</mapper>

@ -139,5 +139,5 @@ public interface IHwDeviceModeService
List<HwDevice> getDeviceByModel(Long modelId);
Map getDeviceLocation(Long deviceId);
// Map getDeviceLocation(Long deviceId);
}

@ -450,14 +450,14 @@ public class HwDeviceModeServiceImpl implements IHwDeviceModeService {
System.out.println(hwDeviceMapper.getDeviceByModel(modelId));
return hwDeviceMapper.getDeviceByModel(modelId);
}
public Map getDeviceLocation(Long deviceId) {
TdSelectDto tdSelectDto = new TdSelectDto();
tdSelectDto.setDatabaseName("db_hwsaas");
tdSelectDto.setTableName("t_device_"+deviceId);
R<Map<String, Object>> deviceLocation = remoteTdEngineService.getDeviceLocation(tdSelectDto, SecurityConstants.FROM_SOURCE);
Map<String, Object> data = deviceLocation.getData();
return data;
}
// public Map getDeviceLocation(Long deviceId) {
// TdSelectDto tdSelectDto = new TdSelectDto();
// tdSelectDto.setDatabaseName("db_hwsaas");
// tdSelectDto.setTableName("t_device_"+deviceId);
// R<Map<String, Object>> deviceLocation = remoteTdEngineService.getDeviceLocation(tdSelectDto, SecurityConstants.FROM_SOURCE);
// Map<String, Object> data = deviceLocation.getData();
// return data;
// }
/**

@ -8,7 +8,7 @@ import com.ruoyi.business.domain.*;
import com.ruoyi.business.domain.VO.*;
import com.ruoyi.business.mapper.*;
import com.ruoyi.business.service.IHwDeviceService;
import com.ruoyi.business.utils.GpsCoordinateUtils;
//import com.ruoyi.business.utils.GpsCoordinateUtils;
import com.ruoyi.common.core.constant.Constants;
import com.ruoyi.common.core.constant.HwDictConstants;
import com.ruoyi.common.core.constant.SecurityConstants;
@ -27,20 +27,13 @@ import com.ruoyi.system.api.domain.SysUser;
import com.ruoyi.system.api.model.LoginUser;
import com.ruoyi.tdengine.api.RemoteTdEngineService;
import com.ruoyi.tdengine.api.domain.*;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.data.redis.RedisProperties;
import org.springframework.data.redis.cache.RedisCache;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import sun.reflect.generics.tree.Tree;
import javax.annotation.Resource;
import java.io.File;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.ZonedDateTime;
import java.time.format.DateTimeFormatter;
import java.util.*;
@ -1683,9 +1676,9 @@ public class HwDeviceServiceImpl implements IHwDeviceService {
TdSelectDto tdSelectDto = new TdSelectDto();
tdSelectDto.setDatabaseName("db_hwsaas");
tdSelectDto.setTableName("t_device_"+deviceId);
R<Map<String, Object>> deviceLocation = remoteTdEngineService.getDeviceLocation(tdSelectDto, SecurityConstants.INNER);
Map<String, Object> data = deviceLocation.getData();
return data;
// R<Map<String, Object>> deviceLocation = remoteTdEngineService.getDeviceLocation(tdSelectDto, SecurityConstants.INNER);
// Map<String, Object> data = deviceLocation.getData();
return null;
}
/**

@ -1,26 +1,19 @@
package com.ruoyi.portal.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.portal.domain.HwAboutUsInfo;
import com.ruoyi.portal.service.IHwAboutUsInfoService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller

@ -1,26 +1,19 @@
package com.ruoyi.portal.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.portal.domain.HwAboutUsInfoDetail;
import com.ruoyi.portal.service.IHwAboutUsInfoDetailService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller

@ -1,26 +1,19 @@
package com.ruoyi.portal.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.portal.domain.HwContactUsInfo;
import com.ruoyi.portal.service.IHwContactUsInfoService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller

@ -1,26 +1,19 @@
package com.ruoyi.portal.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.portal.domain.HwPortalConfig;
import com.ruoyi.portal.service.IHwPortalConfigService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller

@ -1,25 +1,18 @@
package com.ruoyi.portal.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.portal.domain.HwPortalConfigType;
import com.ruoyi.portal.service.IHwPortalConfigTypeService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller

@ -0,0 +1,178 @@
package com.ruoyi.portal.controller;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.portal.domain.*;
import com.ruoyi.portal.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* Controller
*
* @author xins
* @date 2024-12-12
*/
@RestController
@RequestMapping("/portal")
public class HwPortalController extends BaseController
{
@Autowired
private IHwPortalConfigService hwPortalConfigService;
@Autowired
private IHwPortalConfigTypeService hwPortalConfigTypeService;
@Autowired
private IHwProductCaseInfoService hwProductCaseInfoService;
@Autowired
private IHwContactUsInfoService hwContactUsInfoService;
@Autowired
private IHwProductInfoService productInfoService;
@Autowired
private IHwProductInfoDetailService hwProductInfoDetailService;
@Autowired
private IHwAboutUsInfoService hwAboutUsInfoService;
@Autowired
private IHwAboutUsInfoDetailService hwAboutUsInfoDetailService;
/**
* portal_config_type1;portal_config_type2,portalConfigTypeId
*/
@GetMapping("/getPortalConfigList")
public TableDataInfo getPortalConfigList(HwPortalConfig hwPortalConfig)
{
startPage();
List<HwPortalConfig> list = hwPortalConfigService.selectHwPortalConfigList(hwPortalConfig);
return getDataTable(list);
}
/**
* config_type_classfication1homeConfigTypeNameconfigTypeName
*/
@GetMapping("/getPortalConfigTypeList")
public TableDataInfo getPortalConfigTypeList(HwPortalConfigType hwPortalConfigType)
{
startPage();
List<HwPortalConfigType> list = hwPortalConfigTypeService.selectHwPortalConfigTypeList(hwPortalConfigType);
return getDataTable(list);
}
/**
* tab title()
*/
@GetMapping("/getHomeCaseTitleList")
public TableDataInfo getHomeCaseTitleList(HwPortalConfigType hwPortalConfigType)
{
startPage();
List<HwPortalConfigType> list = hwPortalConfigTypeService.selectHwPortalConfigTypeList(hwPortalConfigType);
return getDataTable(list);
}
/**
*
*/
@GetMapping("/getTypicalHomeCaseInfo")
public AjaxResult getTypicalHomeCaseInfo(HwProductCaseInfo queryProductCaseInfo)
{
HwProductCaseInfo hwProductCaseInfo = hwProductCaseInfoService.getTypicalHomeCaseInfo(queryProductCaseInfo);
return success(hwProductCaseInfo);
}
/**
*
*/
@Log(title = "联系我们", businessType = BusinessType.INSERT)
@PostMapping("/addContactUsInfo")
public AjaxResult addContactUsInfo(@RequestBody HwContactUsInfo hwContactUsInfo)
{
return toAjax(hwContactUsInfoService.insertHwContactUsInfo(hwContactUsInfo));
}
/**
* (,hw_product_info2+hw_product_info_detail)
*/
@GetMapping("/getProductCenterProductInfos")
public AjaxResult getProductCenterProductInfos(HwProductInfo hwProductInfo)
{
// 配置模式(1图标 +文字+内容横铺4个2左标题+内容右图片3左图标右标题+内容一行2个4左大图右标题+内容一行2个5上标题+下图片6上标题+内容下图片7图标标题内容一行3个,8左图右列表9上图下内容一行4个)
return success(productInfoService.selectHwProductInfoJoinDetailList(hwProductInfo));
}
/**
* tabtabproduct_info_detail_idchildren productinfodetail
* @param hwProductInfoDetail
* @return
*/
@GetMapping("/getProductCenterProductDetailInfos")
public AjaxResult getProductCenterProductDetailInfos(HwProductInfoDetail hwProductInfoDetail)
{
// productinfodetail的config_modal 配置模式(1图标 +文字+内容横铺4个2左标题+内容右图片3左图标右标题+内容一行2个4左大图右标题+内容一行2个5上标题+下图片6上标题+内容下图片7图标标题内容一行3个,8一张图9上图下内容一行4个)
return success(hwProductInfoDetailService.selectHwProductInfoDetailList(hwProductInfoDetail));
}
/**
* tabtabportalconfigtypeidproductcaseinfo
* @param hwProductCaseInfo
* @return
*/
@GetMapping("/getCaseCenterCaseInfos")
public AjaxResult getCaseCenterCaseInfos(HwProductCaseInfo hwProductCaseInfo)
{
return success(hwProductCaseInfoService.selectHwProductCaseInfoList(hwProductCaseInfo));
}
/**
* ID
* @param caseInfoId
* @return
*/
@GetMapping("/getCaseCenterCaseInfo/{caseInfoId}")
public AjaxResult getCaseCenterCaseInfo(@PathVariable("caseInfoId") Long caseInfoId)
{
return success(hwProductCaseInfoService.selectHwProductCaseInfoByCaseInfoId(caseInfoId));
}
/**
*
* @param hwAboutUsInfo
* @return
*/
@GetMapping("/getAboutUsInfo")
public AjaxResult getAboutUsInfo(HwAboutUsInfo hwAboutUsInfo)
{
return success(hwAboutUsInfoService.selectHwAboutUsInfoList(hwAboutUsInfo));
}
/**
*
* @param hwAboutUsInfoDetail
* @return
*/
@GetMapping("/getAboutUsInfoDetails")
public AjaxResult getAboutUsInfoDetails(HwAboutUsInfoDetail hwAboutUsInfoDetail)
{
return success(hwAboutUsInfoDetailService.selectHwAboutUsInfoDetailList(hwAboutUsInfoDetail));
}
}

@ -1,26 +1,19 @@
package com.ruoyi.portal.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.portal.domain.HwProductCaseInfo;
import com.ruoyi.portal.service.IHwProductCaseInfoService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller

@ -1,26 +1,19 @@
package com.ruoyi.portal.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.portal.domain.HwProductInfo;
import com.ruoyi.portal.service.IHwProductInfoService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller

@ -1,25 +1,18 @@
package com.ruoyi.portal.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.portal.domain.HwProductInfoDetail;
import com.ruoyi.portal.service.IHwProductInfoDetailService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Controller

@ -1,9 +1,9 @@
package com.ruoyi.portal.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* hw_about_us_info

@ -1,9 +1,9 @@
package com.ruoyi.portal.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* hw_about_us_info_detail

@ -1,9 +1,9 @@
package com.ruoyi.portal.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* hw_contact_us_info
@ -34,6 +34,8 @@ public class HwContactUsInfo extends BaseEntity
@Excel(name = "IP地址")
private String userIp;
private String remark;
public void setContactUsInfoId(Long contactUsInfoId)
{
this.contactUsInfoId = contactUsInfoId;
@ -80,6 +82,16 @@ public class HwContactUsInfo extends BaseEntity
return userIp;
}
@Override
public String getRemark() {
return remark;
}
@Override
public void setRemark(String remark) {
this.remark = remark;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -1,9 +1,9 @@
package com.ruoyi.portal.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* hw_portal_config
@ -22,6 +22,9 @@ public class HwPortalConfig extends BaseEntity
@Excel(name = "类型(1首页大图 2产品中心大图)")
private String portalConfigType;
/**如果类型是2的则需要关联hw_portal_config_type*/
private Long portalConfigTypeId;
/** 标题 */
@Excel(name = "标题")
private String portalConfigTitle;
@ -64,7 +67,16 @@ public class HwPortalConfig extends BaseEntity
{
return portalConfigType;
}
public void setPortalConfigTitle(String portalConfigTitle)
public Long getPortalConfigTypeId() {
return portalConfigTypeId;
}
public void setPortalConfigTypeId(Long portalConfigTypeId) {
this.portalConfigTypeId = portalConfigTypeId;
}
public void setPortalConfigTitle(String portalConfigTitle)
{
this.portalConfigTitle = portalConfigTitle;
}

@ -1,9 +1,11 @@
package com.ruoyi.portal.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.TreeEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
/**
* hw_portal_config_type
@ -42,6 +44,9 @@ public class HwPortalConfigType extends TreeEntity
@Excel(name = "首页图片地址")
private String homeConfigTypePic;
private List<HwProductCaseInfo> hwProductCaseInfoList;
public void setConfigTypeId(Long configTypeId)
{
this.configTypeId = configTypeId;
@ -106,6 +111,14 @@ public class HwPortalConfigType extends TreeEntity
return homeConfigTypePic;
}
public List<HwProductCaseInfo> getHwProductCaseInfoList() {
return hwProductCaseInfoList;
}
public void setHwProductCaseInfoList(List<HwProductCaseInfo> hwProductCaseInfoList) {
this.hwProductCaseInfoList = hwProductCaseInfoList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

@ -1,9 +1,9 @@
package com.ruoyi.portal.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* hw_product_case_info
@ -24,7 +24,7 @@ public class HwProductCaseInfo extends BaseEntity
/** 配置类型ID */
@Excel(name = "配置类型ID")
private Long caseTypeId;
private Long configTypeId;
/** 典型案例标识(1是0否) */
@Excel(name = "典型案例标识(1是0否)")
@ -42,6 +42,9 @@ public class HwProductCaseInfo extends BaseEntity
@Excel(name = "案例详情")
private String caseInfoHtml;
private String homeTypicalFlag;
public void setCaseInfoId(Long caseInfoId)
{
this.caseInfoId = caseInfoId;
@ -60,16 +63,16 @@ public class HwProductCaseInfo extends BaseEntity
{
return caseInfoTitle;
}
public void setCaseTypeId(Long caseTypeId)
{
this.caseTypeId = caseTypeId;
public Long getConfigTypeId() {
return configTypeId;
}
public Long getCaseTypeId()
{
return caseTypeId;
public void setConfigTypeId(Long configTypeId) {
this.configTypeId = configTypeId;
}
public void setTypicalFlag(String typicalFlag)
public void setTypicalFlag(String typicalFlag)
{
this.typicalFlag = typicalFlag;
}
@ -106,12 +109,20 @@ public class HwProductCaseInfo extends BaseEntity
return caseInfoHtml;
}
public String getHomeTypicalFlag() {
return homeTypicalFlag;
}
public void setHomeTypicalFlag(String homeTypicalFlag) {
this.homeTypicalFlag = homeTypicalFlag;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("caseInfoId", getCaseInfoId())
.append("caseInfoTitle", getCaseInfoTitle())
.append("caseTypeId", getCaseTypeId())
.append("configTypeId", getConfigTypeId())
.append("typicalFlag", getTypicalFlag())
.append("caseInfoDesc", getCaseInfoDesc())
.append("caseInfoPic", getCaseInfoPic())

@ -1,9 +1,11 @@
package com.ruoyi.portal.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
/**
* hw_product_info
@ -42,6 +44,11 @@ public class HwProductInfo extends BaseEntity
@Excel(name = "顺序")
private Long productInfoOrder;
/** 产品信息明细配置信息 */
private List<HwProductInfoDetail> hwProductInfoDetailList;
private Long parentId;
public void setProductInfoId(Long productInfoId)
{
this.productInfoId = productInfoId;
@ -106,20 +113,39 @@ public class HwProductInfo extends BaseEntity
return productInfoOrder;
}
public List<HwProductInfoDetail> getHwProductInfoDetailList()
{
return hwProductInfoDetailList;
}
public void setHwProductInfoDetailList(List<HwProductInfoDetail> hwProductInfoDetailList)
{
this.hwProductInfoDetailList = hwProductInfoDetailList;
}
public Long getParentId() {
return parentId;
}
public void setParentId(Long parentId) {
this.parentId = parentId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("productInfoId", getProductInfoId())
.append("configTypeId", getConfigTypeId())
.append("tabFlag", getTabFlag())
.append("configModal", getConfigModal())
.append("productInfoEtitle", getProductInfoEtitle())
.append("productInfoCtitle", getProductInfoCtitle())
.append("productInfoOrder", getProductInfoOrder())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
.append("productInfoId", getProductInfoId())
.append("configTypeId", getConfigTypeId())
.append("tabFlag", getTabFlag())
.append("configModal", getConfigModal())
.append("productInfoEtitle", getProductInfoEtitle())
.append("productInfoCtitle", getProductInfoCtitle())
.append("productInfoOrder", getProductInfoOrder())
.append("createTime", getCreateTime())
.append("createBy", getCreateBy())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.append("hwProductInfoDetailList", getHwProductInfoDetailList())
.toString();
}
}

@ -1,9 +1,9 @@
package com.ruoyi.portal.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.TreeEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* hw_product_info_detail

@ -1,8 +1,9 @@
package com.ruoyi.portal.mapper;
import java.util.List;
import com.ruoyi.portal.domain.HwAboutUsInfoDetail;
import java.util.List;
/**
* Mapper
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.mapper;
import java.util.List;
import com.ruoyi.portal.domain.HwAboutUsInfo;
import java.util.List;
/**
* Mapper
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.mapper;
import java.util.List;
import com.ruoyi.portal.domain.HwContactUsInfo;
import java.util.List;
/**
* Mapper
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.mapper;
import java.util.List;
import com.ruoyi.portal.domain.HwPortalConfig;
import java.util.List;
/**
* Mapper
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.mapper;
import java.util.List;
import com.ruoyi.portal.domain.HwPortalConfigType;
import java.util.List;
/**
* Mapper
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.mapper;
import java.util.List;
import com.ruoyi.portal.domain.HwProductCaseInfo;
import java.util.List;
/**
* Mapper
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.mapper;
import java.util.List;
import com.ruoyi.portal.domain.HwProductInfoDetail;
import java.util.List;
/**
* Mapper
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.mapper;
import java.util.List;
import com.ruoyi.portal.domain.HwProductInfo;
import java.util.List;
/**
* Mapper
*
@ -58,4 +59,13 @@ public interface HwProductInfoMapper
* @return
*/
public int deleteHwProductInfoByProductInfoIds(Long[] productInfoIds);
/**
* ,join product info detail
*
* @param hwProductInfo
* @return
*/
public List<HwProductInfo> selectHwProductInfoJoinDetailList(HwProductInfo hwProductInfo);
}

@ -1,8 +1,9 @@
package com.ruoyi.portal.service;
import java.util.List;
import com.ruoyi.portal.domain.HwAboutUsInfoDetail;
import java.util.List;
/**
* Service
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.service;
import java.util.List;
import com.ruoyi.portal.domain.HwAboutUsInfo;
import java.util.List;
/**
* Service
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.service;
import java.util.List;
import com.ruoyi.portal.domain.HwContactUsInfo;
import java.util.List;
/**
* Service
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.service;
import java.util.List;
import com.ruoyi.portal.domain.HwPortalConfig;
import java.util.List;
/**
* Service
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.service;
import java.util.List;
import com.ruoyi.portal.domain.HwPortalConfigType;
import java.util.List;
/**
* Service
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.service;
import java.util.List;
import com.ruoyi.portal.domain.HwProductCaseInfo;
import java.util.List;
/**
* Service
*
@ -58,4 +59,11 @@ public interface IHwProductCaseInfoService
* @return
*/
public int deleteHwProductCaseInfoByCaseInfoId(Long caseInfoId);
/**
* configTypeId
* @param hwProductCaseInfo
* @return
*/
public HwProductCaseInfo getTypicalHomeCaseInfo(HwProductCaseInfo hwProductCaseInfo);
}

@ -1,8 +1,9 @@
package com.ruoyi.portal.service;
import java.util.List;
import com.ruoyi.portal.domain.HwProductInfoDetail;
import java.util.List;
/**
* Service
*

@ -1,8 +1,9 @@
package com.ruoyi.portal.service;
import java.util.List;
import com.ruoyi.portal.domain.HwProductInfo;
import java.util.List;
/**
* Service
*
@ -58,4 +59,12 @@ public interface IHwProductInfoService
* @return
*/
public int deleteHwProductInfoByProductInfoId(Long productInfoId);
/**
* (,hw_product_info2+hw_product_info_detail)
*
* @param hwProductInfo
* @return
*/
public List<HwProductInfo> selectHwProductInfoJoinDetailList(HwProductInfo hwProductInfo);
}

@ -1,12 +1,13 @@
package com.ruoyi.portal.service.impl;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.portal.domain.HwAboutUsInfoDetail;
import com.ruoyi.portal.mapper.HwAboutUsInfoDetailMapper;
import com.ruoyi.portal.service.IHwAboutUsInfoDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.portal.mapper.HwAboutUsInfoDetailMapper;
import com.ruoyi.portal.domain.HwAboutUsInfoDetail;
import com.ruoyi.portal.service.IHwAboutUsInfoDetailService;
import java.util.List;
/**
* Service

@ -1,12 +1,13 @@
package com.ruoyi.portal.service.impl;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.portal.domain.HwAboutUsInfo;
import com.ruoyi.portal.mapper.HwAboutUsInfoMapper;
import com.ruoyi.portal.service.IHwAboutUsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.portal.mapper.HwAboutUsInfoMapper;
import com.ruoyi.portal.domain.HwAboutUsInfo;
import com.ruoyi.portal.service.IHwAboutUsInfoService;
import java.util.List;
/**
* Service

@ -1,12 +1,13 @@
package com.ruoyi.portal.service.impl;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.portal.domain.HwContactUsInfo;
import com.ruoyi.portal.mapper.HwContactUsInfoMapper;
import com.ruoyi.portal.service.IHwContactUsInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.portal.mapper.HwContactUsInfoMapper;
import com.ruoyi.portal.domain.HwContactUsInfo;
import com.ruoyi.portal.service.IHwContactUsInfoService;
import java.util.List;
/**
* Service

@ -1,12 +1,13 @@
package com.ruoyi.portal.service.impl;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.portal.domain.HwPortalConfig;
import com.ruoyi.portal.mapper.HwPortalConfigMapper;
import com.ruoyi.portal.service.IHwPortalConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.portal.mapper.HwPortalConfigMapper;
import com.ruoyi.portal.domain.HwPortalConfig;
import com.ruoyi.portal.service.IHwPortalConfigService;
import java.util.List;
/**
* Service

@ -1,12 +1,13 @@
package com.ruoyi.portal.service.impl;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.portal.domain.HwPortalConfigType;
import com.ruoyi.portal.mapper.HwPortalConfigTypeMapper;
import com.ruoyi.portal.service.IHwPortalConfigTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.portal.mapper.HwPortalConfigTypeMapper;
import com.ruoyi.portal.domain.HwPortalConfigType;
import com.ruoyi.portal.service.IHwPortalConfigTypeService;
import java.util.List;
/**
* Service

@ -1,12 +1,14 @@
package com.ruoyi.portal.service.impl;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.portal.domain.HwProductCaseInfo;
import com.ruoyi.portal.mapper.HwProductCaseInfoMapper;
import com.ruoyi.portal.service.IHwProductCaseInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.portal.mapper.HwProductCaseInfoMapper;
import com.ruoyi.portal.domain.HwProductCaseInfo;
import com.ruoyi.portal.service.IHwProductCaseInfoService;
import java.util.List;
import java.util.stream.Collectors;
/**
* Service
@ -93,4 +95,22 @@ public class HwProductCaseInfoServiceImpl implements IHwProductCaseInfoService
{
return hwProductCaseInfoMapper.deleteHwProductCaseInfoByCaseInfoId(caseInfoId);
}
/**
* configTypeId
* @param hwProductCaseInfo
* @return
*/
@Override
public HwProductCaseInfo getTypicalHomeCaseInfo(HwProductCaseInfo hwProductCaseInfo){
hwProductCaseInfo.setHomeTypicalFlag("1");
List<HwProductCaseInfo> productCaseInfoList = hwProductCaseInfoMapper.selectHwProductCaseInfoList(hwProductCaseInfo);
List<HwProductCaseInfo> typicalProductCaseInfoList = productCaseInfoList.stream().filter(pci -> pci.getTypicalFlag().equals("1")).collect(Collectors.toList());
if(typicalProductCaseInfoList!=null && ! typicalProductCaseInfoList.isEmpty()){
return typicalProductCaseInfoList.get(0);
}else if (productCaseInfoList!=null && !productCaseInfoList.isEmpty()){
return productCaseInfoList.get(0);
}
return new HwProductCaseInfo();
}
}

@ -1,12 +1,13 @@
package com.ruoyi.portal.service.impl;
import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.portal.domain.HwProductInfoDetail;
import com.ruoyi.portal.mapper.HwProductInfoDetailMapper;
import com.ruoyi.portal.service.IHwProductInfoDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.portal.mapper.HwProductInfoDetailMapper;
import com.ruoyi.portal.domain.HwProductInfoDetail;
import com.ruoyi.portal.service.IHwProductInfoDetailService;
import java.util.List;
/**
* Service

@ -1,12 +1,19 @@
package com.ruoyi.portal.service.impl;
import java.util.List;
import com.ruoyi.common.core.constant.HwPortalConstants;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.portal.domain.HwProductInfo;
import com.ruoyi.portal.domain.HwProductInfoDetail;
import com.ruoyi.portal.mapper.HwProductInfoMapper;
import com.ruoyi.portal.service.IHwProductInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.portal.mapper.HwProductInfoMapper;
import com.ruoyi.portal.domain.HwProductInfo;
import com.ruoyi.portal.service.IHwProductInfoService;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.stream.Collectors;
/**
* Service
@ -93,4 +100,80 @@ public class HwProductInfoServiceImpl implements IHwProductInfoService
{
return hwProductInfoMapper.deleteHwProductInfoByProductInfoId(productInfoId);
}
/**
* (,hw_product_info2+hw_product_info_detail)
*
* @param hwProductInfo
* @return
*/
@Override
public List<HwProductInfo> selectHwProductInfoJoinDetailList(HwProductInfo hwProductInfo)
{
List<HwProductInfo> hwProductInfoJoinDetailList = hwProductInfoMapper.selectHwProductInfoJoinDetailList(hwProductInfo);
return hwProductInfoJoinDetailList;
}
/**
*
*
* @param productInfoDetails
* @return
*/
// @Override
public List<HwProductInfoDetail> buildProductInfoDetailTree(List<HwProductInfoDetail> productInfoDetails) {
List<HwProductInfoDetail> returnList = new ArrayList<>();
List<Long> tempList = productInfoDetails.stream().map(HwProductInfoDetail::getProductInfoDetailId).collect(Collectors.toList());
for (HwProductInfoDetail hwProductInfoDetail : productInfoDetails) {
// 如果是顶级节点, 遍历该父节点的所有子节点
if (!tempList.contains(hwProductInfoDetail.getParentId())) {
recursionFn(productInfoDetails, hwProductInfoDetail);
returnList.add(hwProductInfoDetail);
}
}
if (returnList.isEmpty()) {
returnList = productInfoDetails;
}
return returnList;
}
/**
*
*/
private void recursionFn(List<HwProductInfoDetail> list, HwProductInfoDetail t) {
// 得到子节点列表
List<HwProductInfoDetail> childList = getChildList(list, t);
t.setChildren(childList);
for (HwProductInfoDetail tChild : childList) {
if (hasChild(list, tChild)) {
recursionFn(list, tChild);
}
}
}
/**
*
*/
private List<HwProductInfoDetail> getChildList(List<HwProductInfoDetail> list, HwProductInfoDetail t) {
List<HwProductInfoDetail> tlist = new ArrayList<HwProductInfoDetail>();
Iterator<HwProductInfoDetail> it = list.iterator();
while (it.hasNext()) {
HwProductInfoDetail n = (HwProductInfoDetail) it.next();
if (StringUtils.isNotNull(n.getParentId()) && n.getParentId().longValue() == t.getProductInfoDetailId().longValue()) {
tlist.add(n);
}
}
return tlist;
}
/**
*
*/
private boolean hasChild(List<HwProductInfoDetail> list, HwProductInfoDetail t) {
return getChildList(list, t).size() > 0 ? true : false;
}
}

@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userEmail" column="user_email" />
<result property="userPhone" column="user_phone" />
<result property="userIp" column="user_ip" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
@ -17,7 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectHwContactUsInfoVo">
select contact_us_info_id, user_name, user_email, user_phone, user_ip, create_time, create_by, update_time, update_by from hw_contact_us_info
select contact_us_info_id, user_name, user_email, user_phone, user_ip, remark,create_time, create_by, update_time, update_by from hw_contact_us_info
</sql>
<select id="selectHwContactUsInfoList" parameterType="HwContactUsInfo" resultMap="HwContactUsInfoResult">
@ -42,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userEmail != null">user_email,</if>
<if test="userPhone != null">user_phone,</if>
<if test="userIp != null">user_ip,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateTime != null">update_time,</if>
@ -52,6 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userEmail != null">#{userEmail},</if>
<if test="userPhone != null">#{userPhone},</if>
<if test="userIp != null">#{userIp},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateTime != null">#{updateTime},</if>
@ -66,6 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userEmail != null">user_email = #{userEmail},</if>
<if test="userPhone != null">user_phone = #{userPhone},</if>
<if test="userIp != null">user_ip = #{userIp},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>

@ -7,6 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="HwPortalConfig" id="HwPortalConfigResult">
<result property="portalConfigId" column="portal_config_id" />
<result property="portalConfigType" column="portal_config_type" />
<result property="portalConfigTypeId" column="portal_config_type_id" />
<result property="portalConfigTitle" column="portal_config_title" />
<result property="portalConfigOrder" column="portal_config_order" />
<result property="portalConfigDesc" column="portal_config_desc" />
@ -20,13 +21,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectHwPortalConfigVo">
select portal_config_id, portal_config_type, portal_config_title, portal_config_order, portal_config_desc, button_name, router_address, portal_config_pic, create_time, create_by, update_time, update_by from hw_portal_config
select portal_config_id, portal_config_type,portal_config_type_id, portal_config_title, portal_config_order, portal_config_desc, button_name, router_address, portal_config_pic, create_time, create_by, update_time, update_by from hw_portal_config
</sql>
<select id="selectHwPortalConfigList" parameterType="HwPortalConfig" resultMap="HwPortalConfigResult">
<include refid="selectHwPortalConfigVo"/>
<where>
<if test="portalConfigType != null and portalConfigType != ''"> and portal_config_type = #{portalConfigType}</if>
<if test="portalConfigTypeId != null "> and portal_config_type_id = #{portalConfigTypeId}</if>
<if test="portalConfigTitle != null and portalConfigTitle != ''"> and portal_config_title = #{portalConfigTitle}</if>
<if test="portalConfigOrder != null "> and portal_config_order = #{portalConfigOrder}</if>
<if test="portalConfigDesc != null and portalConfigDesc != ''"> and portal_config_desc = #{portalConfigDesc}</if>
@ -45,6 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into hw_portal_config
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="portalConfigType != null and portalConfigType != ''">portal_config_type,</if>
<if test="portalConfigTypeId != null">portal_config_type_id,</if>
<if test="portalConfigTitle != null and portalConfigTitle != ''">portal_config_title,</if>
<if test="portalConfigOrder != null">portal_config_order,</if>
<if test="portalConfigDesc != null">portal_config_desc,</if>
@ -58,6 +61,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="portalConfigType != null and portalConfigType != ''">#{portalConfigType},</if>
<if test="portalConfigTypeId != null">#{portalConfigTypeId},</if>
<if test="portalConfigTitle != null and portalConfigTitle != ''">#{portalConfigTitle},</if>
<if test="portalConfigOrder != null">#{portalConfigOrder},</if>
<if test="portalConfigDesc != null">#{portalConfigDesc},</if>
@ -75,6 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update hw_portal_config
<trim prefix="SET" suffixOverrides=",">
<if test="portalConfigType != null and portalConfigType != ''">portal_config_type = #{portalConfigType},</if>
<if test="portalConfigTypeId != null">portal_config_type_id = #{portalConfigTypeId},</if>
<if test="portalConfigTitle != null and portalConfigTitle != ''">portal_config_title = #{portalConfigTitle},</if>
<if test="portalConfigOrder != null">portal_config_order = #{portalConfigOrder},</if>
<if test="portalConfigDesc != null">portal_config_desc = #{portalConfigDesc},</if>

@ -7,7 +7,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="HwProductCaseInfo" id="HwProductCaseInfoResult">
<result property="caseInfoId" column="case_info_id" />
<result property="caseInfoTitle" column="case_info_title" />
<result property="caseTypeId" column="case_type_id" />
<result property="configTypeId" column="config_type_id" />
<result property="typicalFlag" column="typical_flag" />
<result property="caseInfoDesc" column="case_info_desc" />
<result property="caseInfoPic" column="case_info_pic" />
@ -18,24 +18,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectHwProductCaseInfoVo">
select case_info_id, case_info_title, case_type_id, typical_flag, case_info_desc, case_info_pic, case_info_html, create_time, create_by, update_time, update_by from hw_product_case_info
<sql id="selectHwProductCaseInfoWithHtmlVo">
select case_info_id, case_info_title, config_type_id, typical_flag, case_info_desc, case_info_pic, case_info_html, create_time, create_by, update_time, update_by from hw_product_case_info hpci
</sql>
<sql id="selectHwProductCaseInfoVo">
select case_info_id, case_info_title, config_type_id, typical_flag, case_info_desc, case_info_pic, create_time, create_by, update_time, update_by from hw_product_case_info hpci
</sql>
<select id="selectHwProductCaseInfoList" parameterType="HwProductCaseInfo" resultMap="HwProductCaseInfoResult">
<include refid="selectHwProductCaseInfoVo"/>
<where>
<if test="caseInfoTitle != null and caseInfoTitle != ''"> and case_info_title = #{caseInfoTitle}</if>
<if test="caseTypeId != null "> and case_type_id = #{caseTypeId}</if>
<if test="typicalFlag != null and typicalFlag != ''"> and typical_flag = #{typicalFlag}</if>
<if test="caseInfoDesc != null and caseInfoDesc != ''"> and case_info_desc = #{caseInfoDesc}</if>
<if test="caseInfoPic != null and caseInfoPic != ''"> and case_info_pic = #{caseInfoPic}</if>
<if test="caseInfoHtml != null and caseInfoHtml != ''"> and case_info_html = #{caseInfoHtml}</if>
<if test="homeTypicalFlag != null and homeTypicalFlag != '' and configTypeId!=null"> and exists (select 1 from hw_portal_config_type hpct where hpct.parent_id=#{configTypeId} and hpct.config_type_id =hpci.config_type_id)</if>
<if test='(homeTypicalFlag == null or homeTypicalFlag == "") and configTypeId != null '> and config_type_id = #{configTypeId}</if>
</where>
</select>
<select id="selectHwProductCaseInfoByCaseInfoId" parameterType="Long" resultMap="HwProductCaseInfoResult">
<include refid="selectHwProductCaseInfoVo"/>
<include refid="selectHwProductCaseInfoWithHtmlVo"/>
where case_info_id = #{caseInfoId}
</select>
@ -43,7 +51,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into hw_product_case_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="caseInfoTitle != null and caseInfoTitle != ''">case_info_title,</if>
<if test="caseTypeId != null">case_type_id,</if>
<if test="configTypeId != null">config_type_id,</if>
<if test="typicalFlag != null and typicalFlag != ''">typical_flag,</if>
<if test="caseInfoDesc != null and caseInfoDesc != ''">case_info_desc,</if>
<if test="caseInfoPic != null and caseInfoPic != ''">case_info_pic,</if>
@ -55,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="caseInfoTitle != null and caseInfoTitle != ''">#{caseInfoTitle},</if>
<if test="caseTypeId != null">#{caseTypeId},</if>
<if test="configTypeId != null">#{configTypeId},</if>
<if test="typicalFlag != null and typicalFlag != ''">#{typicalFlag},</if>
<if test="caseInfoDesc != null and caseInfoDesc != ''">#{caseInfoDesc},</if>
<if test="caseInfoPic != null and caseInfoPic != ''">#{caseInfoPic},</if>
@ -71,7 +79,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update hw_product_case_info
<trim prefix="SET" suffixOverrides=",">
<if test="caseInfoTitle != null and caseInfoTitle != ''">case_info_title = #{caseInfoTitle},</if>
<if test="caseTypeId != null">case_type_id = #{caseTypeId},</if>
<if test="configTypeId != null">config_type_id = #{configTypeId},</if>
<if test="typicalFlag != null and typicalFlag != ''">typical_flag = #{typicalFlag},</if>
<if test="caseInfoDesc != null and caseInfoDesc != ''">case_info_desc = #{caseInfoDesc},</if>
<if test="caseInfoPic != null and caseInfoPic != ''">case_info_pic = #{caseInfoPic},</if>

@ -16,6 +16,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="createBy" column="create_by" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="parentId" column="parent_id" />
</resultMap>
<resultMap id="HwProductInfoHwProductInfoDetailResult" type="HwProductInfo" extends="HwProductInfoResult">
<collection property="hwProductInfoDetailList" notNullColumn="sub_product_info_detail_id" javaType="java.util.List" resultMap="HwProductInfoDetailResult" />
</resultMap>
<resultMap type="HwProductInfoDetail" id="HwProductInfoDetailResult">
<result property="productInfoDetailId" column="sub_product_info_detail_id" />
<result property="parentId" column="sub_parent_id" />
<result property="productInfoId" column="sub_product_info_id" />
<result property="productInfoDetailTitle" column="sub_product_info_detail_title" />
<result property="productInfoDetailDesc" column="sub_product_info_detail_desc" />
<result property="productInfoDetailOrder" column="sub_product_info_detail_order" />
<result property="productInfoDetailPic" column="sub_product_info_detail_pic" />
<result property="ancestors" column="sub_ancestors" />
<result property="createTime" column="sub_create_time" />
<result property="createBy" column="sub_create_by" />
<result property="updateTime" column="sub_update_time" />
<result property="updateBy" column="sub_update_by" />
</resultMap>
<sql id="selectHwProductInfoVo">
@ -94,4 +115,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{productInfoId}
</foreach>
</delete>
<select id="selectHwProductInfoJoinDetailList" parameterType="HwProductInfo" resultMap="HwProductInfoHwProductInfoDetailResult">
select a.product_info_id, a.config_type_id, a.tab_flag, a.config_modal, a.product_info_etitle, a.product_info_ctitle, a.product_info_order, a.create_time, a.create_by, a.update_time, a.update_by,
b.product_info_detail_id as sub_product_info_detail_id, b.parent_id as sub_parent_id, b.product_info_id as sub_product_info_id, b.product_info_detail_title as sub_product_info_detail_title, b.product_info_detail_desc as sub_product_info_detail_desc, b.product_info_detail_order as sub_product_info_detail_order, b.product_info_detail_pic as sub_product_info_detail_pic, b.ancestors as sub_ancestors, b.create_time as sub_create_time, b.create_by as sub_create_by, b.update_time as sub_update_time, b.update_by as sub_update_by
from hw_product_info a
left join hw_product_info_detail b on b.product_info_id = a.product_info_id
<where>
<if test="configTypeId != null and configTypeId != ''"> and a.config_type_id = #{configTypeId}</if>
<if test="tabFlag != null and tabFlag != ''"> and a.tab_flag = #{tabFlag}</if>
<if test="configModal != null and configModal != ''"> and a.config_modal = #{configModal}</if>
<if test="productInfoEtitle != null "> and a.product_info_etitle = #{productInfoEtitle}</if>
<if test="productInfoCtitle != null and productInfoCtitle != ''"> and a.product_info_ctitle = #{productInfoCtitle}</if>
<if test="productInfoOrder != null "> and a.product_info_order = #{productInfoOrder}</if>
<if test="parentId != null"> and b.parent_id = #{parentId}</if>
</where>
</select>
</mapper>

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询关于我们信息列表
export function listAboutUsInfo(query) {
return request({
url: '/portal/aboutUsInfo/list',
method: 'get',
params: query
})
}
// 查询关于我们信息详细
export function getAboutUsInfo(aboutUsInfoId) {
return request({
url: '/portal/aboutUsInfo/' + aboutUsInfoId,
method: 'get'
})
}
// 新增关于我们信息
export function addAboutUsInfo(data) {
return request({
url: '/portal/aboutUsInfo',
method: 'post',
data: data
})
}
// 修改关于我们信息
export function updateAboutUsInfo(data) {
return request({
url: '/portal/aboutUsInfo',
method: 'put',
data: data
})
}
// 删除关于我们信息
export function delAboutUsInfo(aboutUsInfoId) {
return request({
url: '/portal/aboutUsInfo/' + aboutUsInfoId,
method: 'delete'
})
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询关于我们信息明细列表
export function listAboutUsInfoDetail(query) {
return request({
url: '/portal/aboutUsInfoDetail/list',
method: 'get',
params: query
})
}
// 查询关于我们信息明细详细
export function getAboutUsInfoDetail(usInfoDetailId) {
return request({
url: '/portal/aboutUsInfoDetail/' + usInfoDetailId,
method: 'get'
})
}
// 新增关于我们信息明细
export function addAboutUsInfoDetail(data) {
return request({
url: '/portal/aboutUsInfoDetail',
method: 'post',
data: data
})
}
// 修改关于我们信息明细
export function updateAboutUsInfoDetail(data) {
return request({
url: '/portal/aboutUsInfoDetail',
method: 'put',
data: data
})
}
// 删除关于我们信息明细
export function delAboutUsInfoDetail(usInfoDetailId) {
return request({
url: '/portal/aboutUsInfoDetail/' + usInfoDetailId,
method: 'delete'
})
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询联系我们信息列表
export function listContactUsInfo(query) {
return request({
url: '/portal/contactUsInfo/list',
method: 'get',
params: query
})
}
// 查询联系我们信息详细
export function getContactUsInfo(contactUsInfoId) {
return request({
url: '/portal/contactUsInfo/' + contactUsInfoId,
method: 'get'
})
}
// 新增联系我们信息
export function addContactUsInfo(data) {
return request({
url: '/portal/contactUsInfo',
method: 'post',
data: data
})
}
// 修改联系我们信息
export function updateContactUsInfo(data) {
return request({
url: '/portal/contactUsInfo',
method: 'put',
data: data
})
}
// 删除联系我们信息
export function delContactUsInfo(contactUsInfoId) {
return request({
url: '/portal/contactUsInfo/' + contactUsInfoId,
method: 'delete'
})
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询门户网站配置列表
export function listPortalConfig(query) {
return request({
url: '/portal/portalConfig/list',
method: 'get',
params: query
})
}
// 查询门户网站配置详细
export function getPortalConfig(portalConfigId) {
return request({
url: '/portal/portalConfig/' + portalConfigId,
method: 'get'
})
}
// 新增门户网站配置
export function addPortalConfig(data) {
return request({
url: '/portal/portalConfig',
method: 'post',
data: data
})
}
// 修改门户网站配置
export function updatePortalConfig(data) {
return request({
url: '/portal/portalConfig',
method: 'put',
data: data
})
}
// 删除门户网站配置
export function delPortalConfig(portalConfigId) {
return request({
url: '/portal/portalConfig/' + portalConfigId,
method: 'delete'
})
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询门户网站配置类型列表
export function listPortalConfigType(query) {
return request({
url: '/portal/portalConfigType/list',
method: 'get',
params: query
})
}
// 查询门户网站配置类型详细
export function getPortalConfigType(configTypeId) {
return request({
url: '/portal/portalConfigType/' + configTypeId,
method: 'get'
})
}
// 新增门户网站配置类型
export function addPortalConfigType(data) {
return request({
url: '/portal/portalConfigType',
method: 'post',
data: data
})
}
// 修改门户网站配置类型
export function updatePortalConfigType(data) {
return request({
url: '/portal/portalConfigType',
method: 'put',
data: data
})
}
// 删除门户网站配置类型
export function delPortalConfigType(configTypeId) {
return request({
url: '/portal/portalConfigType/' + configTypeId,
method: 'delete'
})
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询案例内容列表
export function listProductCaseInfo(query) {
return request({
url: '/portal/productCaseInfo/list',
method: 'get',
params: query
})
}
// 查询案例内容详细
export function getProductCaseInfo(caseInfoId) {
return request({
url: '/portal/productCaseInfo/' + caseInfoId,
method: 'get'
})
}
// 新增案例内容
export function addProductCaseInfo(data) {
return request({
url: '/portal/productCaseInfo',
method: 'post',
data: data
})
}
// 修改案例内容
export function updateProductCaseInfo(data) {
return request({
url: '/portal/productCaseInfo',
method: 'put',
data: data
})
}
// 删除案例内容
export function delProductCaseInfo(caseInfoId) {
return request({
url: '/portal/productCaseInfo/' + caseInfoId,
method: 'delete'
})
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询产品信息配置列表
export function listProductInfo(query) {
return request({
url: '/portal/productInfo/list',
method: 'get',
params: query
})
}
// 查询产品信息配置详细
export function getProductInfo(productInfoId) {
return request({
url: '/portal/productInfo/' + productInfoId,
method: 'get'
})
}
// 新增产品信息配置
export function addProductInfo(data) {
return request({
url: '/portal/productInfo',
method: 'post',
data: data
})
}
// 修改产品信息配置
export function updateProductInfo(data) {
return request({
url: '/portal/productInfo',
method: 'put',
data: data
})
}
// 删除产品信息配置
export function delProductInfo(productInfoId) {
return request({
url: '/portal/productInfo/' + productInfoId,
method: 'delete'
})
}

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询产品信息明细配置列表
export function listProductInfoDetail(query) {
return request({
url: '/portal/productInfoDetail/list',
method: 'get',
params: query
})
}
// 查询产品信息明细配置详细
export function getProductInfoDetail(productInfoDetailId) {
return request({
url: '/portal/productInfoDetail/' + productInfoDetailId,
method: 'get'
})
}
// 新增产品信息明细配置
export function addProductInfoDetail(data) {
return request({
url: '/portal/productInfoDetail',
method: 'post',
data: data
})
}
// 修改产品信息明细配置
export function updateProductInfoDetail(data) {
return request({
url: '/portal/productInfoDetail',
method: 'put',
data: data
})
}
// 删除产品信息明细配置
export function delProductInfoDetail(productInfoDetailId) {
return request({
url: '/portal/productInfoDetail/' + productInfoDetailId,
method: 'delete'
})
}

@ -289,6 +289,36 @@ export const dynamicRoutes = [
]
},
{
path: '/portal/product-info-detail',
component: Layout,
hidden: true,
permissions: ['portal:productInfo:edit'],
children: [
{
path: 'index/:productInfoId(\\d+)',
component: () => import('@/views/portal/productInfoDetail/index.vue'),
name: 'ProductInfoDetail',
meta: { title: '产品配置详情', activeMenu: '/portal/productInfo' }
}
]
},
{
path: '/portal/about-us-info-detail',
component: Layout,
hidden: true,
permissions: ['portal:aboutUsInfo:edit'],
children: [
{
path: 'index/:aboutUsInfoId(\\d+)',
component: () => import('@/views/portal/aboutUsInfoDetail/index.vue'),
name: 'AboutUsInfoDetail',
meta: { title: '关于我们配置详情', activeMenu: '/portal/aboutUsInfo' }
}
]
},
]
// 防止连续点击多次路由报错

@ -0,0 +1,501 @@
<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="aboutUsInfoTitle">
<el-input
v-model="queryParams.aboutUsInfoTitle"
placeholder="请输入标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="内容" prop="aboutUsInfoDesc">
<el-input
v-model="queryParams.aboutUsInfoDesc"
placeholder="请输入内容"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="顺序" prop="aboutUsInfoOrder">
<el-input
v-model="queryParams.aboutUsInfoOrder"
placeholder="请输入顺序"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="图片地址" prop="aboutUsInfoPic">
<el-input
v-model="queryParams.aboutUsInfoPic"
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="['portal:aboutUsInfo: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="['portal:aboutUsInfo: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="['portal:aboutUsInfo: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="['portal:aboutUsInfo:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="aboutUsInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="aboutUsInfoId" />
<el-table-column label="类型" align="center" prop="aboutUsInfoType" />
<el-table-column label="中文标题" align="center" prop="aboutUsInfoTitle" />
<el-table-column label="英文标题" align="center" prop="aboutUsInfoEtitle" />
<el-table-column label="内容" align="center" prop="aboutUsInfoDesc" />
<el-table-column label="顺序" align="center" prop="aboutUsInfoOrder" />
<el-table-column label="显示模式" align="center" prop="displayModal" />
<el-table-column label="图片地址" align="center" prop="aboutUsInfoPic" />
<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="['portal:aboutUsInfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleAboutUsInfoDetail(scope.row)"
v-hasPermi="['portal:aboutUsInfo:edit']"
>详情配置</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['portal:aboutUsInfo: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="aboutUsInfoTitle">
<el-input v-model="form.aboutUsInfoTitle" placeholder="请输入中文标题" />
</el-form-item>
<el-form-item label="英文标题" prop="aboutUsInfoEtitle">
<el-input v-model="form.aboutUsInfoEtitle" placeholder="请输入英文标题" />
</el-form-item>
<el-form-item label="类型" prop="aboutUsInfoType">
<el-input v-model="form.aboutUsInfoType" placeholder="请输入类型" />
</el-form-item>
<el-form-item label="内容" prop="aboutUsInfoDesc">
<el-input v-model="form.aboutUsInfoDesc" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="顺序" prop="aboutUsInfoOrder">
<el-input v-model="form.aboutUsInfoOrder" placeholder="请输入顺序" />
</el-form-item>
<el-form-item label="显示模式" prop="displayModal">
<el-input v-model="form.displayModal" placeholder="请输入显示模式" />
</el-form-item>
<el-form-item label="图片" prop="aboutUsInfoPic">
<el-upload
single
:action="uploadImgUrl"
list-type="picture-card"
:limit="limit"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:on-error="handleUploadError"
:on-exceed="handleExceed"
ref="imageUpload"
:on-remove="handleDeletePicture"
:show-file-list="true"
:headers="headers"
:file-list="fileList"
:on-preview="handlePictureCardPreview"
:class="{hide: this.fileList.length >= 1}"
>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
<i class="el-icon-plus"></i>
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip">
请上传
<template v-if="fileSize"> <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
<template v-if="fileType"> <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
的文件
</div>
<el-dialog
:visible.sync="dialogVisible"
title="预览"
width="800"
append-to-body
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</el-dialog>
</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 { listAboutUsInfo, getAboutUsInfo, delAboutUsInfo, addAboutUsInfo, updateAboutUsInfo } from "@/api/portal/aboutUsInfo";
import {getToken} from "@/utils/auth";
export default {
name: "AboutUsInfo",
props: {
value: [String, Object, Array],
//
limit: {
type: Number,
default: 1,
},
// (MB)
fileSize: {
type: Number,
default: 5,
},
// , ['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["png", "jpg", "jpeg"],
},
//
isShowTip: {
type: Boolean,
default: true
}
},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
aboutUsInfoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
aboutUsInfoType: null,
aboutUsInfoTitle: null,
aboutUsInfoDesc: null,
aboutUsInfoOrder: null,
aboutUsInfoPic: null,
},
//
form: {},
//
rules: {
aboutUsInfoTitle: [
{ required: true, message: "标题不能为空", trigger: "blur" }
],
aboutUsInfoDesc: [
{ required: true, message: "内容不能为空", trigger: "blur" }
],
aboutUsInfoOrder: [
{ required: true, message: "顺序不能为空", trigger: "blur" }
],
},
number: 0,
uploadList: [],
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", //
headers: {
Authorization: "Bearer " + getToken(),
},
fileList: [],
};
},
created() {
this.getList();
},
methods: {
/** 查询关于我们信息列表 */
getList() {
this.loading = true;
listAboutUsInfo(this.queryParams).then(response => {
this.aboutUsInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
aboutUsInfoId: null,
aboutUsInfoType: null,
aboutUsInfoEtitle: null,
aboutUsInfoTitle: null,
aboutUsInfoDesc: null,
aboutUsInfoOrder: null,
aboutUsInfoPic: null,
displayModal:null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null
};
this.resetForm("form");
this.fileList = [];
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.aboutUsInfoId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加关于我们信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const aboutUsInfoId = row.aboutUsInfoId || this.ids
getAboutUsInfo(aboutUsInfoId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改关于我们信息";
if (response.data.aboutUsInfoPic != null) {
let previewFile = {};
previewFile.url = response.data.aboutUsInfoPic
this.fileList.push(previewFile);
}
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.aboutUsInfoId != null) {
updateAboutUsInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addAboutUsInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const aboutUsInfoIds = row.aboutUsInfoId || this.ids;
this.$modal.confirm('是否确认删除关于我们信息编号为"' + aboutUsInfoIds + '"的数据项?').then(function() {
return delAboutUsInfo(aboutUsInfoIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('portal/aboutUsInfo/export', {
...this.queryParams
}, `aboutUsInfo_${new Date().getTime()}.xlsx`)
},
/**上传图片处理*/
// loading
handleBeforeUpload(file) {
let isImg = false;
if (this.fileType.length) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
isImg = this.fileType.some(type => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
} else {
isImg = file.type.indexOf("image") > -1;
}
if (!isImg) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
return false;
}
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
this.$modal.loading("正在上传图片,请稍候...");
this.number++;
},
//
handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} !`);
},
//
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.uploadList.push(res.data.url);
this.uploadedSuccessfully();
} else {
this.number--;
this.$modal.closeLoading();
this.$modal.msgError(res.msg);
this.$refs.imageUpload.handleRemove(file);
this.uploadedSuccessfully();
}
},
//
uploadedSuccessfully() {
if (this.number > 0 && this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList);
this.uploadList = [];
this.number = 0;
this.form.aboutUsInfoPic = this.fileList[0];
// this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading();
}
},
//
handleDeletePicture(file) {
const findex = this.fileList.map(f => f.name).indexOf(file.name);
if (findex > -1) {
this.fileList.splice(findex, 1);
// this.$emit("input", this.listToString(this.fileList));
}
this.form.aboutUsInfoPic = '';
},
//
handleUploadError() {
this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading();
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
/** 关于我们配置详情按钮操作 */
handleAboutUsInfoDetail(row) {
const aboutUsInfoId = row.aboutUsInfoId;
let aboutUsInfoTitle = row.aboutUsInfoTitle
const params = {pageNum: this.queryParams.pageNum};
this.$tab.openPage("关于我们配置详情["+aboutUsInfoTitle+"]", '/portal/about-us-info-detail/index/'+aboutUsInfoId, params);
},
}
};
</script>

@ -0,0 +1,487 @@
<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="关于我们信息ID" prop="aboutUsInfoId">
<el-input
v-model="queryParams.aboutUsInfoId"
placeholder="请输入关于我们信息ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="标题" prop="usInfoDetailTitle">
<el-input
v-model="queryParams.usInfoDetailTitle"
placeholder="请输入标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="内容" prop="usInfoDetailDesc">
<el-input
v-model="queryParams.usInfoDetailDesc"
placeholder="请输入内容"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="顺序" prop="usInfoDetailOrder">
<el-input
v-model="queryParams.usInfoDetailOrder"
placeholder="请输入顺序"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="图片地址" prop="usInfoDetailPic">
<el-input
v-model="queryParams.usInfoDetailPic"
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="['portal:aboutUsInfoDetail: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="['portal:aboutUsInfoDetail: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="['portal:aboutUsInfoDetail: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="['portal:aboutUsInfoDetail:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="aboutUsInfoDetailList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="usInfoDetailId" />
<el-table-column label="关于我们信息ID" align="center" prop="aboutUsInfoId" />
<el-table-column label="标题" align="center" prop="usInfoDetailTitle" />
<el-table-column label="内容" align="center" prop="usInfoDetailDesc" />
<el-table-column label="顺序" align="center" prop="usInfoDetailOrder" />
<el-table-column label="图片地址" align="center" prop="usInfoDetailPic" />
<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="['portal:aboutUsInfoDetail:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['portal:aboutUsInfoDetail: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="关于我们信息ID" prop="aboutUsInfoId">
<el-input v-model="form.aboutUsInfoId" placeholder="请输入关于我们信息ID" />
</el-form-item>
<el-form-item label="标题" prop="usInfoDetailTitle">
<el-input v-model="form.usInfoDetailTitle" placeholder="请输入标题" />
</el-form-item>
<el-form-item label="内容" prop="usInfoDetailDesc">
<el-input v-model="form.usInfoDetailDesc" placeholder="请输入内容" type="textarea" />
</el-form-item>
<el-form-item label="顺序" prop="usInfoDetailOrder">
<el-input v-model="form.usInfoDetailOrder" placeholder="请输入顺序" />
</el-form-item>
<el-form-item label="图片" prop="usInfoDetailPic">
<el-upload
single
:action="uploadImgUrl"
list-type="picture-card"
:limit="limit"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:on-error="handleUploadError"
:on-exceed="handleExceed"
ref="imageUpload"
:on-remove="handleDeletePicture"
:show-file-list="true"
:headers="headers"
:file-list="fileList"
:on-preview="handlePictureCardPreview"
:class="{hide: this.fileList.length >= 1}"
>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
<i class="el-icon-plus"></i>
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip">
请上传
<template v-if="fileSize"> <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
<template v-if="fileType"> <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
的文件
</div>
<el-dialog
:visible.sync="dialogVisible"
title="预览"
width="800"
append-to-body
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</el-dialog>
</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 { listAboutUsInfoDetail, getAboutUsInfoDetail, delAboutUsInfoDetail, addAboutUsInfoDetail, updateAboutUsInfoDetail } from "@/api/portal/aboutUsInfoDetail";
import {getToken} from "@/utils/auth";
export default {
name: "AboutUsInfoDetail",
props: {
value: [String, Object, Array],
//
limit: {
type: Number,
default: 1,
},
// (MB)
fileSize: {
type: Number,
default: 5,
},
// , ['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["png", "jpg", "jpeg"],
},
//
isShowTip: {
type: Boolean,
default: true
}
},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
aboutUsInfoDetailList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
aboutUsInfoId: null,
usInfoDetailTitle: null,
usInfoDetailDesc: null,
usInfoDetailOrder: null,
usInfoDetailPic: null,
},
//
form: {},
//
rules: {
aboutUsInfoId: [
{ required: true, message: "关于我们信息ID不能为空", trigger: "blur" }
],
usInfoDetailOrder: [
{ required: true, message: "顺序不能为空", trigger: "blur" }
],
},
aboutUsInfoId:null,
number: 0,
uploadList: [],
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", //
headers: {
Authorization: "Bearer " + getToken(),
},
fileList: [],
};
},
created() {
this.getList();
},
mounted(){
if (this.$route.params.aboutUsInfoId) {
this.aboutUsInfoId = this.$route.params.aboutUsInfoId
}
},
methods: {
/** 查询关于我们信息明细列表 */
getList() {
this.loading = true;
this.queryParams.aboutUsInfoId =this.$route.params.aboutUsInfoId
listAboutUsInfoDetail(this.queryParams).then(response => {
this.aboutUsInfoDetailList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
usInfoDetailId: null,
aboutUsInfoId: this.aboutUsInfoId,
usInfoDetailTitle: null,
usInfoDetailDesc: null,
usInfoDetailOrder: null,
usInfoDetailPic: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null
};
this.resetForm("form");
this.fileList = [];
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.usInfoDetailId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加关于我们信息明细";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const usInfoDetailId = row.usInfoDetailId || this.ids
getAboutUsInfoDetail(usInfoDetailId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改关于我们信息明细";
if (response.data.usInfoDetailPic != null) {
let previewFile = {};
previewFile.url = response.data.usInfoDetailPic
this.fileList.push(previewFile);
}
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.usInfoDetailId != null) {
updateAboutUsInfoDetail(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addAboutUsInfoDetail(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const usInfoDetailIds = row.usInfoDetailId || this.ids;
this.$modal.confirm('是否确认删除关于我们信息明细编号为"' + usInfoDetailIds + '"的数据项?').then(function() {
return delAboutUsInfoDetail(usInfoDetailIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('portal/aboutUsInfoDetail/export', {
...this.queryParams
}, `aboutUsInfoDetail_${new Date().getTime()}.xlsx`)
},
/**上传图片处理*/
// loading
handleBeforeUpload(file) {
let isImg = false;
if (this.fileType.length) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
isImg = this.fileType.some(type => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
} else {
isImg = file.type.indexOf("image") > -1;
}
if (!isImg) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
return false;
}
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
this.$modal.loading("正在上传图片,请稍候...");
this.number++;
},
//
handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} !`);
},
//
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.uploadList.push(res.data.url);
this.uploadedSuccessfully();
} else {
this.number--;
this.$modal.closeLoading();
this.$modal.msgError(res.msg);
this.$refs.imageUpload.handleRemove(file);
this.uploadedSuccessfully();
}
},
//
uploadedSuccessfully() {
if (this.number > 0 && this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList);
this.uploadList = [];
this.number = 0;
this.form.usInfoDetailPic = this.fileList[0];
// this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading();
}
},
//
handleDeletePicture(file) {
const findex = this.fileList.map(f => f.name).indexOf(file.name);
if (findex > -1) {
this.fileList.splice(findex, 1);
// this.$emit("input", this.listToString(this.fileList));
}
this.form.usInfoDetailPic = '';
},
//
handleUploadError() {
this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading();
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
}
};
</script>

@ -0,0 +1,294 @@
<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="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="邮箱" prop="userEmail">
<el-input
v-model="queryParams.userEmail"
placeholder="请输入邮箱"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="手机号" prop="userPhone">
<el-input
v-model="queryParams.userPhone"
placeholder="请输入手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="IP地址" prop="userIp">
<el-input
v-model="queryParams.userIp"
placeholder="请输入IP地址"
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="['portal:contactUsInfo: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="['portal:contactUsInfo: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="['portal:contactUsInfo: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="['portal:contactUsInfo:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="contactUsInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="contactUsInfoId" />
<el-table-column label="用户姓名" align="center" prop="userName" />
<el-table-column label="邮箱" align="center" prop="userEmail" />
<el-table-column label="手机号" align="center" prop="userPhone" />
<el-table-column label="IP地址" align="center" prop="userIp" />
<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="['portal:contactUsInfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['portal:contactUsInfo: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="userName">
<el-input v-model="form.userName" placeholder="请输入用户姓名" />
</el-form-item>
<el-form-item label="邮箱" prop="userEmail">
<el-input v-model="form.userEmail" placeholder="请输入邮箱" />
</el-form-item>
<el-form-item label="手机号" prop="userPhone">
<el-input v-model="form.userPhone" placeholder="请输入手机号" />
</el-form-item>
<el-form-item label="IP地址" prop="userIp">
<el-input v-model="form.userIp" placeholder="请输入IP地址" />
</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 { listContactUsInfo, getContactUsInfo, delContactUsInfo, addContactUsInfo, updateContactUsInfo } from "@/api/portal/contactUsInfo";
export default {
name: "ContactUsInfo",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
contactUsInfoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
userName: null,
userEmail: null,
userPhone: null,
userIp: null,
},
//
form: {},
//
rules: {
userName: [
{ required: true, message: "用户姓名不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询联系我们信息列表 */
getList() {
this.loading = true;
listContactUsInfo(this.queryParams).then(response => {
this.contactUsInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
contactUsInfoId: null,
userName: null,
userEmail: null,
userPhone: null,
userIp: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: 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.contactUsInfoId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加联系我们信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const contactUsInfoId = row.contactUsInfoId || this.ids
getContactUsInfo(contactUsInfoId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改联系我们信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.contactUsInfoId != null) {
updateContactUsInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addContactUsInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const contactUsInfoIds = row.contactUsInfoId || this.ids;
this.$modal.confirm('是否确认删除联系我们信息编号为"' + contactUsInfoIds + '"的数据项?').then(function() {
return delContactUsInfo(contactUsInfoIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('portal/contactUsInfo/export', {
...this.queryParams
}, `contactUsInfo_${new Date().getTime()}.xlsx`)
}
}
};
</script>

@ -0,0 +1,514 @@
<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="portalConfigTitle">
<el-input
v-model="queryParams.portalConfigTitle"
placeholder="请输入标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="顺序" prop="portalConfigOrder">
<el-input
v-model="queryParams.portalConfigOrder"
placeholder="请输入顺序"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="按钮名称" prop="buttonName">
<el-input
v-model="queryParams.buttonName"
placeholder="请输入按钮名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="按钮跳转地址" prop="routerAddress">
<el-input
v-model="queryParams.routerAddress"
placeholder="请输入按钮跳转地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="主图地址" prop="portalConfigPic">
<el-input
v-model="queryParams.portalConfigPic"
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="['portal:portalConfig: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="['portal:portalConfig: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="['portal:portalConfig: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="['portal:portalConfig:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="portalConfigList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="portalConfigId" />
<el-table-column label="类型(1首页大图 2产品中心大图)" align="center" prop="portalConfigType" />
<el-table-column label="类型ID" align="center" prop="portalConfigTypeId" />
<el-table-column label="标题" align="center" prop="portalConfigTitle" />
<el-table-column label="顺序" align="center" prop="portalConfigOrder" />
<el-table-column label="内容" align="center" prop="portalConfigDesc" />
<el-table-column label="按钮名称" align="center" prop="buttonName" />
<el-table-column label="按钮跳转地址" align="center" prop="routerAddress" />
<el-table-column label="主图地址" align="center" prop="portalConfigPic" />
<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="['portal:portalConfig:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['portal:portalConfig: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="portalConfigTitle">
<el-input v-model="form.portalConfigTitle" placeholder="请输入标题" />
</el-form-item>
<el-form-item label="配置类型ID" prop="portalConfigTypeId">
<el-input v-model="form.portalConfigTypeId" placeholder="请输入配置类型ID" />
</el-form-item>
<el-form-item label="类型" prop="portalConfigType">
<el-select v-model="form.portalConfigType" placeholder="请选择类型">
<el-option
v-for="dict in dict.type.hw_portal_config_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="顺序" prop="portalConfigOrder">
<el-input v-model="form.portalConfigOrder" placeholder="请输入顺序" />
</el-form-item>
<el-form-item label="内容" prop="portalConfigDesc">
<el-input v-model="form.portalConfigDesc" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="按钮名称" prop="buttonName">
<el-input v-model="form.buttonName" placeholder="请输入按钮名称" />
</el-form-item>
<el-form-item label="按钮跳转地址" prop="routerAddress">
<el-input v-model="form.routerAddress" placeholder="请输入按钮跳转地址" />
</el-form-item>
<el-form-item label="主图地址" prop="portalConfigPic">
<el-upload
single
:action="uploadImgUrl"
list-type="picture-card"
:limit="limit"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:on-error="handleUploadError"
:on-exceed="handleExceed"
ref="imageUpload"
:on-remove="handleDeletePicture"
:show-file-list="true"
:headers="headers"
:file-list="fileList"
:on-preview="handlePictureCardPreview"
:class="{hide: this.fileList.length >= 1}"
>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
<i class="el-icon-plus"></i>
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip">
请上传
<template v-if="fileSize"> <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
<template v-if="fileType"> <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
的文件
</div>
<el-dialog
:visible.sync="dialogVisible"
title="预览"
width="800"
append-to-body
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</el-dialog>
</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 { listPortalConfig, getPortalConfig, delPortalConfig, addPortalConfig, updatePortalConfig } from "@/api/portal/portalConfig";
import {getToken} from "@/utils/auth";
export default {
dicts: ['hw_portal_config_type'],
name: "PortalConfig",
props: {
value: [String, Object, Array],
//
limit: {
type: Number,
default: 1,
},
// (MB)
fileSize: {
type: Number,
default: 5,
},
// , ['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["png", "jpg", "jpeg"],
},
//
isShowTip: {
type: Boolean,
default: true
}
},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
portalConfigList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
portalConfigType: null,
portalConfigTitle: null,
portalConfigOrder: null,
portalConfigDesc: null,
buttonName: null,
routerAddress: null,
portalConfigPic: null,
},
//
form: {},
//
rules: {
portalConfigType: [
{ required: true, message: "类型(1首页大图 2产品中心大图)不能为空", trigger: "change" }
],
portalConfigTitle: [
{ required: true, message: "标题不能为空", trigger: "blur" }
],
portalConfigOrder: [
{ required: true, message: "顺序不能为空", trigger: "blur" }
],
},
number: 0,
uploadList: [],
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", //
headers: {
Authorization: "Bearer " + getToken(),
},
fileList: [],
};
},
created() {
this.getList();
},
methods: {
/** 查询门户网站配置列表 */
getList() {
this.loading = true;
listPortalConfig(this.queryParams).then(response => {
this.portalConfigList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
portalConfigId: null,
portalConfigType: null,
portalConfigTypeId:null,
portalConfigTitle: null,
portalConfigOrder: null,
portalConfigDesc: null,
buttonName: null,
routerAddress: null,
portalConfigPic: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null
};
this.resetForm("form");
this.fileList = [];
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.portalConfigId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加门户网站配置";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const portalConfigId = row.portalConfigId || this.ids
getPortalConfig(portalConfigId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改门户网站配置";
if (response.data.portalConfigPic != null) {
let previewFile = {};
previewFile.url = response.data.portalConfigPic
this.fileList.push(previewFile);
}
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.portalConfigId != null) {
updatePortalConfig(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPortalConfig(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const portalConfigIds = row.portalConfigId || this.ids;
this.$modal.confirm('是否确认删除门户网站配置编号为"' + portalConfigIds + '"的数据项?').then(function() {
return delPortalConfig(portalConfigIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('portal/portalConfig/export', {
...this.queryParams
}, `portalConfig_${new Date().getTime()}.xlsx`)
},
/**上传图片处理*/
// loading
handleBeforeUpload(file) {
let isImg = false;
if (this.fileType.length) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
isImg = this.fileType.some(type => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
} else {
isImg = file.type.indexOf("image") > -1;
}
if (!isImg) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
return false;
}
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
this.$modal.loading("正在上传图片,请稍候...");
this.number++;
},
//
handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} !`);
},
//
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.uploadList.push(res.data.url);
this.uploadedSuccessfully();
} else {
this.number--;
this.$modal.closeLoading();
this.$modal.msgError(res.msg);
this.$refs.imageUpload.handleRemove(file);
this.uploadedSuccessfully();
}
},
//
uploadedSuccessfully() {
if (this.number > 0 && this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList);
this.uploadList = [];
this.number = 0;
this.form.portalConfigPic = this.fileList[0];
// this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading();
}
},
//
handleDeletePicture(file) {
const findex = this.fileList.map(f => f.name).indexOf(file.name);
if (findex > -1) {
this.fileList.splice(findex, 1);
// this.$emit("input", this.listToString(this.fileList));
}
this.form.portalConfigPic = '';
},
//
handleUploadError() {
this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading();
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
}
};
</script>

@ -0,0 +1,659 @@
<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="大类(1产品中心2案例)" prop="configTypeClassfication">
<el-input
v-model="queryParams.configTypeClassfication"
placeholder="请输入大类(1产品中心2案例)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="类型名称" prop="configTypeName">
<el-input
v-model="queryParams.configTypeName"
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="['portal:portalConfigType:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-sort"
size="mini"
@click="toggleExpandAll"
>展开/折叠</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
v-if="refreshTable"
v-loading="loading"
:data="portalConfigTypeList"
row-key="configTypeId"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column label="首页名称" align="center" prop="homeConfigTypeName" />
<el-table-column label="类型名称" align="center" prop="configTypeName" />
<el-table-column label="大类(1产品中心2案例)" prop="configTypeClassfication" />
<el-table-column label="类型备注" align="center" prop="configTypeDesc" />
<el-table-column label="图片地址" align="center" prop="homeConfigTypePic" />
<el-table-column label="父级ID" align="center" prop="parentId" />
<el-table-column label="祖级列表" align="center" prop="ancestors" />
<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="['portal:portalConfigType:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['portal:portalConfigType:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['portal:portalConfigType:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改门户网站配置类型对话框 -->
<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="parentId">
<treeselect v-model="form.parentId" :options="portalConfigTypeOptions" :normalizer="normalizer" placeholder="请选择父级ID" />
</el-form-item>
<el-form-item label="大类(1产品中心2案例)" prop="configTypeClassfication">
<el-input v-model="form.configTypeClassfication" placeholder="请输入大类(1产品中心2案例)" />
</el-form-item>
<el-form-item label="首页显示名称" prop="homeConfigTypeName">
<el-input v-model="form.homeConfigTypeName" placeholder="请输入类型名称" />
</el-form-item>
<el-form-item label="类型名称" prop="configTypeName">
<el-input v-model="form.configTypeName" placeholder="请输入类型名称" />
</el-form-item>
<el-form-item label="类型备注" prop="configTypeDesc">
<el-input v-model="form.configTypeDesc" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="图标" prop="configTypeIcon">
<el-upload
single
:action="iconUploadImgUrl"
list-type="picture-card"
:limit="iconLimit"
:on-success="handleIconUploadSuccess"
:before-upload="handleIconBeforeUpload"
:on-error="handleIconUploadError"
:on-exceed="handleIconExceed"
ref="iconImageUpload"
:on-remove="handleIconDeletePicture"
:show-file-list="true"
:headers="iconHeaders"
:file-list="iconFileList"
:on-preview="handleIconPictureCardPreview"
:class="{hide: this.iconFileList.length >= 1}"
>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
<i class="el-icon-plus"></i>
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip">
请上传
<template v-if="iconFileSize"> <b style="color: #f56c6c">{{ iconFileSize }}MB</b></template>
<template v-if="iconFileType"> <b style="color: #f56c6c">{{ iconFileType.join("/") }}</b></template>
的文件
</div>
<el-dialog
:visible.sync="iconDialogVisible"
title="预览"
width="800"
append-to-body
>
<img
:src="iconDialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</el-dialog>
</el-form-item>
<el-form-item label="图片" prop="homeConfigTypePic">
<el-upload
single
:action="uploadImgUrl"
list-type="picture-card"
:limit="limit"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:on-error="handleUploadError"
:on-exceed="handleExceed"
ref="imageUpload"
:on-remove="handleDeletePicture"
:show-file-list="true"
:headers="headers"
:file-list="fileList"
:on-preview="handlePictureCardPreview"
:class="{hide: this.fileList.length >= 1}"
>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
<i class="el-icon-plus"></i>
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip">
请上传
<template v-if="fileSize"> <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
<template v-if="fileType"> <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
的文件
</div>
<el-dialog
:visible.sync="dialogVisible"
title="预览"
width="800"
append-to-body
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</el-dialog>
</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 { listPortalConfigType, getPortalConfigType, delPortalConfigType, addPortalConfigType, updatePortalConfigType } from "@/api/portal/portalConfigType";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {getToken} from "@/utils/auth";
export default {
name: "PortalConfigType",
props: {
value: [String, Object, Array],
//
limit: {
type: Number,
default: 1,
},
// (MB)
fileSize: {
type: Number,
default: 5,
},
// , ['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["png", "jpg", "jpeg"],
},
//
isShowTip: {
type: Boolean,
default: true
},
iconValue: [String, Object, Array],
//
iconLimit: {
type: Number,
default: 1,
},
// (MB)
iconFileSize: {
type: Number,
default: 5,
},
// , ['png', 'jpg', 'jpeg']
iconFileType: {
type: Array,
default: () => ["png", "jpg", "jpeg"],
},
//
iconIsShowTip: {
type: Boolean,
default: true
}
},
components: {
Treeselect
},
data() {
return {
//
loading: true,
//
showSearch: true,
//
portalConfigTypeList: [],
//
portalConfigTypeOptions: [],
//
title: "",
//
open: false,
//
isExpandAll: true,
//
refreshTable: true,
//
queryParams: {
configTypeClassfication: null,
configTypeName: null,
configTypeDesc: null,
configTypeIcon: null,
parentId: null,
ancestors: null,
},
//
form: {},
//
rules: {
configTypeClassfication: [
{ required: true, message: "大类(1产品中心2案例)不能为空", trigger: "blur" }
],
configTypeName: [
{ required: true, message: "类型名称不能为空", trigger: "blur" }
],
parentId: [
{ required: true, message: "父级ID不能为空", trigger: "blur" }
],
},
number: 0,
uploadList: [],
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", //
headers: {
Authorization: "Bearer " + getToken(),
},
fileList: [],
iconNumber: 0,
iconUploadList: [],
iconDialogImageUrl: "",
iconDialogVisible: false,
iconHideUpload: false,
iconUploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", //
iconHeaders: {
Authorization: "Bearer " + getToken(),
},
iconFileList: [],
};
},
created() {
this.getList();
},
methods: {
/** 查询门户网站配置类型列表 */
getList() {
this.loading = true;
listPortalConfigType(this.queryParams).then(response => {
this.portalConfigTypeList = this.handleTree(response.data, "configTypeId", "parentId");
this.loading = false;
});
},
/** 转换门户网站配置类型数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.configTypeId,
label: node.configTypeName,
children: node.children
};
},
/** 查询门户网站配置类型下拉树结构 */
getTreeselect() {
listPortalConfigType().then(response => {
this.portalConfigTypeOptions = [];
const data = { configTypeId: 0, configTypeName: '顶级节点', children: [] };
data.children = this.handleTree(response.data, "configTypeId", "parentId");
this.portalConfigTypeOptions.push(data);
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
configTypeId: null,
configTypeClassfication: null,
homeConfigTypeName: null,
configTypeName: null,
configTypeDesc: null,
configTypeIcon: null,
homeConfigTypePic: null,
parentId: null,
ancestors: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null
};
this.resetForm("form");
this.fileList = [];
this.iconFileList = [];
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
this.getTreeselect();
if (row != null && row.configTypeId) {
this.form.parentId = row.configTypeId;
} else {
this.form.parentId = 0;
}
this.open = true;
this.title = "添加门户网站配置类型";
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.$nextTick(() => {
this.refreshTable = true;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
if (row != null) {
this.form.parentId = row.configTypeId;
}
getPortalConfigType(row.configTypeId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改门户网站配置类型";
if (response.data.homeConfigTypePic != null) {
let previewFile = {};
previewFile.url = response.data.homeConfigTypePic
this.fileList.push(previewFile);
}
if (response.data.configTypeIcon != null) {
let previewFile = {};
previewFile.url = response.data.configTypeIcon
this.iconFileList.push(previewFile);
}
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.configTypeId != null) {
updatePortalConfigType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addPortalConfigType(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除门户网站配置类型编号为"' + row.configTypeId + '"的数据项?').then(function() {
return delPortalConfigType(row.configTypeId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/**上传图片处理*/
// loading
handleBeforeUpload(file) {
let isImg = false;
if (this.fileType.length) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
isImg = this.fileType.some(type => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
} else {
isImg = file.type.indexOf("image") > -1;
}
if (!isImg) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
return false;
}
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
this.$modal.loading("正在上传图片,请稍候...");
this.number++;
},
//
handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} !`);
},
//
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.uploadList.push(res.data.url);
this.uploadedSuccessfully();
} else {
this.number--;
this.$modal.closeLoading();
this.$modal.msgError(res.msg);
this.$refs.imageUpload.handleRemove(file);
this.uploadedSuccessfully();
}
},
//
uploadedSuccessfully() {
if (this.number > 0 && this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList);
this.uploadList = [];
this.number = 0;
this.form.homeConfigTypePic = this.fileList[0];
// this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading();
}
},
//
handleDeletePicture(file) {
const findex = this.fileList.map(f => f.name).indexOf(file.name);
if (findex > -1) {
this.fileList.splice(findex, 1);
// this.$emit("input", this.listToString(this.fileList));
}
this.form.homeConfigTypePic = '';
},
//
handleUploadError() {
this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading();
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
/**上传图片处理*/
// loading
handleIconBeforeUpload(file) {
let isImg = false;
if (this.iconFileType.length) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
isImg = this.iconFileType.some(type => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
} else {
isImg = file.type.indexOf("image") > -1;
}
if (!isImg) {
this.$modal.msgError(`文件格式不正确, 请上传${this.iconFileType.join("/")}图片格式文件!`);
return false;
}
if (this.iconFileSize) {
const isLt = file.size / 1024 / 1024 < this.iconFileSize;
if (!isLt) {
this.$modal.msgError(`上传头像图片大小不能超过 ${this.iconFileSize} MB!`);
return false;
}
}
this.$modal.loading("正在上传图片,请稍候...");
this.iconNumber++;
},
//
handleIconExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.iconLimit} !`);
},
//
handleIconUploadSuccess(res, file) {
if (res.code === 200) {
this.iconUploadList.push(res.data.url);
this.uploadedIconSuccessfully();
} else {
this.iconNumber--;
this.$modal.closeLoading();
this.$modal.msgError(res.msg);
this.$refs.iconImageUpload.handleRemove(file);
this.uploadedIconSuccessfully();
}
},
//
uploadedIconSuccessfully() {
alert(this.iconNumber)
if (this.iconNumber > 0 && this.iconUploadList.length === this.iconNumber) {
this.iconFileList = this.iconFileList.concat(this.iconUploadList);
this.iconUploadList = [];
this.iconNumber = 0;
this.form.configTypeIcon = this.iconFileList[0];
// this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading();
}
},
//
handleIconDeletePicture(file) {
const findex = this.iconFileList.map(f => f.name).indexOf(file.name);
if (findex > -1) {
this.iconFileList.splice(findex, 1);
// this.$emit("input", this.listToString(this.fileList));
}
this.form.configTypeIcon = '';
},
//
handleIconUploadError() {
this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading();
},
//
handleIconPictureCardPreview(file) {
this.iconDialogImageUrl = file.url;
this.iconDialogVisible = true;
},
}
};
</script>

@ -0,0 +1,491 @@
<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="caseInfoTitle">
<el-input
v-model="queryParams.caseInfoTitle"
placeholder="请输入案例标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="配置类型ID" prop="configTypeId">
<el-input
v-model="queryParams.configTypeId"
placeholder="请输入配置类型ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="典型案例标识(1是0否)" prop="typicalFlag">
<el-input
v-model="queryParams.typicalFlag"
placeholder="请输入典型案例标识(1是0否)"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="案例内容图片" prop="caseInfoPic">
<el-input
v-model="queryParams.caseInfoPic"
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="['portal:productCaseInfo: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="['portal:productCaseInfo: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="['portal:productCaseInfo: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="['portal:productCaseInfo:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="productCaseInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="caseInfoId" />
<el-table-column label="案例标题" align="center" prop="caseInfoTitle" />
<el-table-column label="配置类型ID" align="center" prop="configTypeId" />
<el-table-column label="典型案例标识(1是0否)" align="center" prop="typicalFlag" />
<el-table-column label="案例内容" align="center" prop="caseInfoDesc" />
<el-table-column label="案例内容图片" align="center" prop="caseInfoPic" />
<el-table-column label="案例详情" align="center" prop="caseInfoHtml" />
<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="['portal:productCaseInfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['portal:productCaseInfo: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="800px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="案例标题" prop="caseInfoTitle">
<el-input v-model="form.caseInfoTitle" placeholder="请输入案例标题" />
</el-form-item>
<el-form-item label="配置类型ID" prop="configTypeId">
<el-input v-model="form.configTypeId" placeholder="请输入配置类型ID" />
</el-form-item>
<el-form-item label="典型案例标识(1是0否)" prop="typicalFlag">
<el-input v-model="form.typicalFlag" placeholder="请输入典型案例标识(1是0否)" />
</el-form-item>
<el-form-item label="案例内容" prop="caseInfoDesc">
<el-input v-model="form.caseInfoDesc" type="textarea" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="案例内容图片" prop="caseInfoPic">
<el-upload
single
:action="uploadImgUrl"
list-type="picture-card"
:limit="limit"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:on-error="handleUploadError"
:on-exceed="handleExceed"
ref="imageUpload"
:on-remove="handleDeletePicture"
:show-file-list="true"
:headers="headers"
:file-list="fileList"
:on-preview="handlePictureCardPreview"
:class="{hide: this.fileList.length >= 1}"
>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
<i class="el-icon-plus"></i>
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip">
请上传
<template v-if="fileSize"> <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
<template v-if="fileType"> <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
的文件
</div>
<el-dialog
:visible.sync="dialogVisible"
title="预览"
width="800"
append-to-body
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</el-dialog>
</el-form-item>
<el-form-item label="案例详情" prop="caseInfoHtml">
<editor v-model="form.caseInfoHtml" :min-height="192"/>
</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 { listProductCaseInfo, getProductCaseInfo, delProductCaseInfo, addProductCaseInfo, updateProductCaseInfo } from "@/api/portal/productCaseInfo";
import {getToken} from "@/utils/auth";
export default {
name: "ProductCaseInfo",
props: {
value: [String, Object, Array],
//
limit: {
type: Number,
default: 1,
},
// (MB)
fileSize: {
type: Number,
default: 5,
},
// , ['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["png", "jpg", "jpeg"],
},
//
isShowTip: {
type: Boolean,
default: true
}
},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
productCaseInfoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
caseInfoTitle: null,
configTypeId: null,
typicalFlag: null,
caseInfoDesc: null,
caseInfoPic: null,
caseInfoHtml: null,
},
//
form: {},
//
rules: {
caseInfoTitle: [
{ required: true, message: "案例标题不能为空", trigger: "blur" }
],
configTypeId: [
{ required: true, message: "配置类型ID不能为空", trigger: "blur" }
],
typicalFlag: [
{ required: true, message: "典型案例标识(1是0否)不能为空", trigger: "blur" }
],
caseInfoDesc: [
{ required: true, message: "案例内容不能为空", trigger: "blur" }
],
caseInfoPic: [
{ required: true, message: "案例内容图片不能为空", trigger: "blur" }
],
caseInfoHtml: [
{ required: true, message: "案例详情不能为空", trigger: "blur" }
],
},
number: 0,
uploadList: [],
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", //
headers: {
Authorization: "Bearer " + getToken(),
},
fileList: [],
};
},
created() {
this.getList();
},
methods: {
/** 查询案例内容列表 */
getList() {
this.loading = true;
listProductCaseInfo(this.queryParams).then(response => {
this.productCaseInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
caseInfoId: null,
caseInfoTitle: null,
configTypeId: null,
typicalFlag: null,
caseInfoDesc: null,
caseInfoPic: null,
caseInfoHtml: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null
};
this.resetForm("form");
this.fileList = [];
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.caseInfoId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加案例内容";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const caseInfoId = row.caseInfoId || this.ids
getProductCaseInfo(caseInfoId).then(response => {
this.form = response.data;
this.form.caseInfoHtml = decodeURI(this.form.caseInfoHtml)
this.open = true;
this.title = "修改案例内容";
if (response.data.caseInfoPic != null) {
let previewFile = {};
previewFile.url = response.data.caseInfoPic
this.fileList.push(previewFile);
}
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.caseInfoHtml = encodeURI(this.form.caseInfoHtml)
if (this.form.caseInfoId != null) {
updateProductCaseInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
this.form.caseInfoHtml = encodeURI(this.form.caseInfoHtml);
addProductCaseInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const caseInfoIds = row.caseInfoId || this.ids;
this.$modal.confirm('是否确认删除案例内容编号为"' + caseInfoIds + '"的数据项?').then(function() {
return delProductCaseInfo(caseInfoIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('portal/productCaseInfo/export', {
...this.queryParams
}, `productCaseInfo_${new Date().getTime()}.xlsx`)
},
/**上传图片处理*/
// loading
handleBeforeUpload(file) {
let isImg = false;
if (this.fileType.length) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
isImg = this.fileType.some(type => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
} else {
isImg = file.type.indexOf("image") > -1;
}
if (!isImg) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
return false;
}
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
this.$modal.loading("正在上传图片,请稍候...");
this.number++;
},
//
handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} !`);
},
//
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.uploadList.push(res.data.url);
this.uploadedSuccessfully();
} else {
this.number--;
this.$modal.closeLoading();
this.$modal.msgError(res.msg);
this.$refs.imageUpload.handleRemove(file);
this.uploadedSuccessfully();
}
},
//
uploadedSuccessfully() {
if (this.number > 0 && this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList);
this.uploadList = [];
this.number = 0;
this.form.caseInfoPic = this.fileList[0];
// this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading();
}
},
//
handleDeletePicture(file) {
const findex = this.fileList.map(f => f.name).indexOf(file.name);
if (findex > -1) {
this.fileList.splice(findex, 1);
// this.$emit("input", this.listToString(this.fileList));
}
this.form.caseInfoPic = '';
},
//
handleUploadError() {
this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading();
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
}
};
</script>

@ -0,0 +1,354 @@
<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="configTypeId">
<el-input
v-model="queryParams.configTypeId"
placeholder="请输入配置类型"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否按tab显示" prop="tabFlag">
<el-input
v-model="queryParams.tabFlag"
placeholder="请输入是否按tab显示"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="配置模式" prop="configModal">
<el-input
v-model="queryParams.configModal"
placeholder="请输入配置模式"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="英文标题" prop="productInfoEtitle">
<el-input
v-model="queryParams.productInfoEtitle"
placeholder="请输入英文标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="中文标题" prop="productInfoCtitle">
<el-input
v-model="queryParams.productInfoCtitle"
placeholder="请输入中文标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="顺序" prop="productInfoOrder">
<el-input
v-model="queryParams.productInfoOrder"
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="['portal:productInfo: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="['portal:productInfo: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="['portal:productInfo: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="['portal:productInfo:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="productInfoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键标识" align="center" prop="productInfoId" />
<el-table-column label="配置类型" align="center" prop="configTypeId" />
<el-table-column label="是否按tab显示" align="center" prop="tabFlag" />
<el-table-column label="配置模式" align="center" prop="configModal" />
<el-table-column label="英文标题" align="center" prop="productInfoEtitle" />
<el-table-column label="中文标题" align="center" prop="productInfoCtitle" />
<el-table-column label="顺序" align="center" prop="productInfoOrder" />
<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="['portal:productInfo:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleProductInfoDetail(scope.row)"
v-hasPermi="['portal:productInfo:edit']"
>产品配置详情</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['portal:productInfo: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="configTypeId">
<el-input v-model="form.configTypeId" placeholder="请输入配置类型" />
</el-form-item>
<el-form-item label="是否按tab显示" prop="tabFlag">
<el-input v-model="form.tabFlag" placeholder="请输入是否按tab显示" />
</el-form-item>
<el-form-item label="配置模式(1图标 +文字+内容横铺4个2左标题+内容右图片3左图标右标题+内容一行2个4左大图右标题+内容一行2个5上标题+下图片6上标题+内容下图片7图标标题内容一行3个,8左图右图9上图下内容一行4个)" prop="configModal">
<el-input v-model="form.configModal" placeholder="请输入配置模式(1图标 +文字+内容横铺4个2左标题+内容右图片3左图标右标题+内容一行2个4左大图右标题+内容一行2个5上标题+下图片6上标题+内容下图片7图标标题内容一行3个,8左图右图9上图下内容一行4个)" />
</el-form-item>
<el-form-item label="英文标题" prop="productInfoEtitle">
<el-input v-model="form.productInfoEtitle" placeholder="请输入英文标题" />
</el-form-item>
<el-form-item label="中文标题" prop="productInfoCtitle">
<el-input v-model="form.productInfoCtitle" placeholder="请输入中文标题" />
</el-form-item>
<el-form-item label="顺序" prop="productInfoOrder">
<el-input v-model="form.productInfoOrder" 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 { listProductInfo, getProductInfo, delProductInfo, addProductInfo, updateProductInfo } from "@/api/portal/productInfo";
export default {
name: "ProductInfo",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
productInfoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
configTypeId: null,
tabFlag: null,
configModal: null,
productInfoEtitle: null,
productInfoCtitle: null,
productInfoOrder: null,
},
//
form: {},
//
rules: {
configTypeId: [
{ required: true, message: "配置类型不能为空", trigger: "blur" }
],
tabFlag: [
{ required: true, message: "是否按tab显示不能为空", trigger: "blur" }
],
configModal: [
{ required: true, message: "配置模式(1图标 +文字+内容横铺4个2左标题+内容右图片3左图标右标题+内容一行2个4左大图右标题+内容一行2个5上标题+下图片6上标题+内容下图片7图标标题内容一行3个,8左图右图9上图下内容一行4个)不能为空", trigger: "blur" }
],
productInfoEtitle: [
{ required: true, message: "英文标题不能为空", trigger: "blur" }
],
productInfoCtitle: [
{ required: true, message: "中文标题不能为空", trigger: "blur" }
],
productInfoOrder: [
{ required: true, message: "顺序不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询产品信息配置列表 */
getList() {
this.loading = true;
listProductInfo(this.queryParams).then(response => {
this.productInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
productInfoId: null,
configTypeId: null,
tabFlag: null,
configModal: null,
productInfoEtitle: null,
productInfoCtitle: null,
productInfoOrder: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: 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.productInfoId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加产品信息配置";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const productInfoId = row.productInfoId || this.ids
getProductInfo(productInfoId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改产品信息配置";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.productInfoId != null) {
updateProductInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addProductInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const productInfoIds = row.productInfoId || this.ids;
this.$modal.confirm('是否确认删除产品信息配置编号为"' + productInfoIds + '"的数据项?').then(function() {
return delProductInfo(productInfoIds);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('portal/productInfo/export', {
...this.queryParams
}, `productInfo_${new Date().getTime()}.xlsx`)
},
/** 产品配置详情按钮操作 */
handleProductInfoDetail(row) {
const productInfoId = row.productInfoId;
let productInfoCtitle = row.productInfoCtitle
const params = {pageNum: this.queryParams.pageNum};
this.$tab.openPage("产品配置详情["+productInfoCtitle+"]", '/portal/product-info-detail/index/'+productInfoId, params);
},
}
};
</script>

@ -0,0 +1,543 @@
<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="父级ID有tab的就是此父级ID" prop="parentId">
<el-input
v-model="queryParams.parentId"
placeholder="请输入父级ID有tab的就是此父级ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="产品信息配置ID" prop="productInfoId">
<el-input
v-model="queryParams.productInfoId"
placeholder="请输入产品信息配置ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="配置模式" prop="configModal">
<el-input
v-model="queryParams.configModal"
placeholder="请输入配置模式"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="标题" prop="productInfoDetailTitle">
<el-input
v-model="queryParams.productInfoDetailTitle"
placeholder="请输入标题"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="内容" prop="productInfoDetailDesc">
<el-input
v-model="queryParams.productInfoDetailDesc"
placeholder="请输入内容"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="顺序" prop="productInfoDetailOrder">
<el-input
v-model="queryParams.productInfoDetailOrder"
placeholder="请输入顺序"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="图片地址" prop="productInfoDetailPic">
<el-input
v-model="queryParams.productInfoDetailPic"
placeholder="请输入图片地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="祖级列表" prop="ancestors">
<el-input
v-model="queryParams.ancestors"
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="['portal:productInfoDetail:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="info"
plain
icon="el-icon-sort"
size="mini"
@click="toggleExpandAll"
>展开/折叠</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table
v-if="refreshTable"
v-loading="loading"
:data="productInfoDetailList"
row-key="productInfoDetailId"
:default-expand-all="isExpandAll"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
>
<el-table-column label="标题" align="center" prop="productInfoDetailTitle" />
<el-table-column label="父级ID有tab的就是此父级ID" prop="parentId" />
<el-table-column label="产品信息配置ID" align="center" prop="productInfoId" />
<el-table-column label="配置模式" align="center" prop="configModal" />
<el-table-column label="内容" align="center" prop="productInfoDetailDesc" />
<el-table-column label="顺序" align="center" prop="productInfoDetailOrder" />
<el-table-column label="图片地址" align="center" prop="productInfoDetailPic" />
<el-table-column label="祖级列表" align="center" prop="ancestors" />
<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="['portal:productInfoDetail:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-plus"
@click="handleAdd(scope.row)"
v-hasPermi="['portal:productInfoDetail:add']"
>新增</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['portal:productInfoDetail:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<!-- 添加或修改产品信息明细配置对话框 -->
<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="父级ID有tab的就是此父级ID" prop="parentId">
<treeselect v-model="form.parentId" :options="productInfoDetailOptions" :normalizer="normalizer" placeholder="请选择父级ID有tab的就是此父级ID" />
</el-form-item>
<el-form-item label="产品信息配置ID" prop="productInfoId">
<el-input v-model="form.productInfoId" placeholder="请输入产品信息配置ID" />
</el-form-item>
<el-form-item label="配置模式" prop="configModal">
<el-input v-model="form.configModal" placeholder="请输入配置模式" />
</el-form-item>
<el-form-item label="标题" prop="productInfoDetailTitle">
<el-input v-model="form.productInfoDetailTitle" placeholder="请输入标题" />
</el-form-item>
<el-form-item label="内容" prop="productInfoDetailDesc">
<el-input v-model="form.productInfoDetailDesc" placeholder="请输入内容" />
</el-form-item>
<el-form-item label="顺序" prop="productInfoDetailOrder">
<el-input v-model="form.productInfoDetailOrder" placeholder="请输入顺序" />
</el-form-item>
<el-form-item label="图片" prop="productInfoDetailPic">
<el-upload
single
:action="uploadImgUrl"
list-type="picture-card"
:limit="limit"
:on-success="handleUploadSuccess"
:before-upload="handleBeforeUpload"
:on-error="handleUploadError"
:on-exceed="handleExceed"
ref="imageUpload"
:on-remove="handleDeletePicture"
:show-file-list="true"
:headers="headers"
:file-list="fileList"
:on-preview="handlePictureCardPreview"
:class="{hide: this.fileList.length >= 1}"
>
<div slot="tip" class="el-upload__tip">只能上传jpg/png文件且不超过500kb</div>
<i class="el-icon-plus"></i>
</el-upload>
<!-- 上传提示 -->
<div class="el-upload__tip" slot="tip">
请上传
<template v-if="fileSize"> <b style="color: #f56c6c">{{ fileSize }}MB</b></template>
<template v-if="fileType"> <b style="color: #f56c6c">{{ fileType.join("/") }}</b></template>
的文件
</div>
<el-dialog
:visible.sync="dialogVisible"
title="预览"
width="800"
append-to-body
>
<img
:src="dialogImageUrl"
style="display: block; max-width: 100%; margin: 0 auto"
/>
</el-dialog>
</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 { listProductInfoDetail, getProductInfoDetail, delProductInfoDetail, addProductInfoDetail, updateProductInfoDetail } from "@/api/portal/productInfoDetail";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import {getToken} from "@/utils/auth";
export default {
name: "ProductInfoDetail",
props: {
value: [String, Object, Array],
//
limit: {
type: Number,
default: 1,
},
// (MB)
fileSize: {
type: Number,
default: 5,
},
// , ['png', 'jpg', 'jpeg']
fileType: {
type: Array,
default: () => ["png", "jpg", "jpeg"],
},
//
isShowTip: {
type: Boolean,
default: true
}
},
components: {
Treeselect
},
data() {
return {
//
loading: true,
//
showSearch: true,
//
productInfoDetailList: [],
//
productInfoDetailOptions: [],
//
title: "",
//
open: false,
//
isExpandAll: true,
//
refreshTable: true,
//
queryParams: {
parentId: null,
productInfoId: null,
configModal: null,
productInfoDetailTitle: null,
productInfoDetailDesc: null,
productInfoDetailOrder: null,
productInfoDetailPic: null,
ancestors: null,
},
//
form: {},
//
rules: {
productInfoId: [
{ required: true, message: "产品信息配置ID不能为空", trigger: "blur" }
],
productInfoDetailTitle: [
{ required: true, message: "标题不能为空", trigger: "blur" }
],
productInfoDetailDesc: [
{ required: true, message: "内容不能为空", trigger: "blur" }
],
productInfoDetailOrder: [
{ required: true, message: "顺序不能为空", trigger: "blur" }
],
ancestors: [
{ required: true, message: "祖级列表不能为空", trigger: "blur" }
],
},
productInfoId:null,//ID
number: 0,
uploadList: [],
dialogImageUrl: "",
dialogVisible: false,
hideUpload: false,
uploadImgUrl: process.env.VUE_APP_BASE_API + "/file/upload", //
headers: {
Authorization: "Bearer " + getToken(),
},
fileList: [],
};
},
created() {
this.getList();
},
mounted(){
if (this.$route.params.productInfoId) {
this.productInfoId = this.$route.params.productInfoId
}
},
methods: {
/** 查询产品信息明细配置列表 */
getList() {
this.loading = true;
this.queryParams.productInfoId =this.$route.params.productInfoId
listProductInfoDetail(this.queryParams).then(response => {
this.productInfoDetailList = this.handleTree(response.data, "productInfoDetailId", "parentId");
this.loading = false;
});
},
/** 转换产品信息明细配置数据结构 */
normalizer(node) {
if (node.children && !node.children.length) {
delete node.children;
}
return {
id: node.productInfoDetailId,
label: node.productInfoDetailTitle,
children: node.children
};
},
/** 查询产品信息明细配置下拉树结构 */
getTreeselect() {
listProductInfoDetail().then(response => {
this.productInfoDetailOptions = [];
const data = { productInfoDetailId: 0, productInfoDetailTitle: '顶级节点', children: [] };
data.children = this.handleTree(response.data, "productInfoDetailId", "parentId");
this.productInfoDetailOptions.push(data);
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
productInfoDetailId: null,
parentId: null,
productInfoId: this.productInfoId,
configModal: null,
productInfoDetailTitle: null,
productInfoDetailDesc: null,
productInfoDetailOrder: null,
productInfoDetailPic: null,
ancestors: null,
createTime: null,
createBy: null,
updateTime: null,
updateBy: null
};
this.resetForm("form");
this.fileList = [];
},
/** 搜索按钮操作 */
handleQuery() {
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd(row) {
this.reset();
this.getTreeselect();
if (row != null && row.productInfoDetailId) {
this.form.parentId = row.productInfoDetailId;
} else {
this.form.parentId = 0;
}
this.open = true;
this.title = "添加产品信息明细配置";
},
/** 展开/折叠操作 */
toggleExpandAll() {
this.refreshTable = false;
this.isExpandAll = !this.isExpandAll;
this.$nextTick(() => {
this.refreshTable = true;
});
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.getTreeselect();
if (row != null) {
this.form.parentId = row.productInfoDetailId;
}
getProductInfoDetail(row.productInfoDetailId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改产品信息明细配置";
if (response.data.productInfoDetailPic != null) {
let previewFile = {};
previewFile.url = response.data.productInfoDetailPic
this.fileList.push(previewFile);
}
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.productInfoDetailId != null) {
updateProductInfoDetail(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addProductInfoDetail(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除产品信息明细配置编号为"' + row.productInfoDetailId + '"的数据项?').then(function() {
return delProductInfoDetail(row.productInfoDetailId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/**上传图片处理*/
// loading
handleBeforeUpload(file) {
let isImg = false;
if (this.fileType.length) {
let fileExtension = "";
if (file.name.lastIndexOf(".") > -1) {
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
}
isImg = this.fileType.some(type => {
if (file.type.indexOf(type) > -1) return true;
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
return false;
});
} else {
isImg = file.type.indexOf("image") > -1;
}
if (!isImg) {
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
return false;
}
if (this.fileSize) {
const isLt = file.size / 1024 / 1024 < this.fileSize;
if (!isLt) {
this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
return false;
}
}
this.$modal.loading("正在上传图片,请稍候...");
this.number++;
},
//
handleExceed() {
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} !`);
},
//
handleUploadSuccess(res, file) {
if (res.code === 200) {
this.uploadList.push(res.data.url);
this.uploadedSuccessfully();
} else {
this.number--;
this.$modal.closeLoading();
this.$modal.msgError(res.msg);
this.$refs.imageUpload.handleRemove(file);
this.uploadedSuccessfully();
}
},
//
uploadedSuccessfully() {
if (this.number > 0 && this.uploadList.length === this.number) {
this.fileList = this.fileList.concat(this.uploadList);
this.uploadList = [];
this.number = 0;
this.form.productInfoDetailPic = this.fileList[0];
// this.$emit("input", this.listToString(this.fileList));
this.$modal.closeLoading();
}
},
//
handleDeletePicture(file) {
const findex = this.fileList.map(f => f.name).indexOf(file.name);
if (findex > -1) {
this.fileList.splice(findex, 1);
// this.$emit("input", this.listToString(this.fileList));
}
this.form.productInfoDetailPic = '';
},
//
handleUploadError() {
this.$modal.msgError("上传图片失败,请重试");
this.$modal.closeLoading();
},
//
handlePictureCardPreview(file) {
this.dialogImageUrl = file.url;
this.dialogVisible = true;
},
}
};
</script>
Loading…
Cancel
Save