add - 语言信息、区域管理
parent
d826e53a08
commit
e98a95c7e5
@ -0,0 +1,103 @@
|
|||||||
|
package com.ruoyi.basic.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.log.annotation.Log;
|
||||||
|
import com.ruoyi.common.log.enums.BusinessType;
|
||||||
|
import com.ruoyi.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.ruoyi.basic.domain.HwArea;
|
||||||
|
import com.ruoyi.basic.service.IHwAreaService;
|
||||||
|
import com.ruoyi.common.core.web.controller.BaseController;
|
||||||
|
import com.ruoyi.common.core.web.domain.AjaxResult;
|
||||||
|
import com.ruoyi.common.core.utils.poi.ExcelUtil;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域管理Controller
|
||||||
|
*
|
||||||
|
* @author YINQ
|
||||||
|
* @date 2023-08-30
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/area")
|
||||||
|
public class HwAreaController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IHwAreaService hwAreaService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询区域管理列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("basic:area:list")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public AjaxResult list(HwArea hwArea)
|
||||||
|
{
|
||||||
|
List<HwArea> list = hwAreaService.selectHwAreaList(hwArea);
|
||||||
|
return success(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出区域管理列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("basic:area:export")
|
||||||
|
@Log(title = "区域管理", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, HwArea hwArea)
|
||||||
|
{
|
||||||
|
List<HwArea> list = hwAreaService.selectHwAreaList(hwArea);
|
||||||
|
ExcelUtil<HwArea> util = new ExcelUtil<HwArea>(HwArea.class);
|
||||||
|
util.exportExcel(response, list, "区域管理数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取区域管理详细信息
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("basic:area:query")
|
||||||
|
@GetMapping(value = "/{areaId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("areaId") Long areaId)
|
||||||
|
{
|
||||||
|
return success(hwAreaService.selectHwAreaByAreaId(areaId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增区域管理
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("basic:area:add")
|
||||||
|
@Log(title = "区域管理", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody HwArea hwArea)
|
||||||
|
{
|
||||||
|
return toAjax(hwAreaService.insertHwArea(hwArea));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改区域管理
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("basic:area:edit")
|
||||||
|
@Log(title = "区域管理", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody HwArea hwArea)
|
||||||
|
{
|
||||||
|
return toAjax(hwAreaService.updateHwArea(hwArea));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除区域管理
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("basic:area:remove")
|
||||||
|
@Log(title = "区域管理", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{areaIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] areaIds)
|
||||||
|
{
|
||||||
|
return toAjax(hwAreaService.deleteHwAreaByAreaIds(areaIds));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,72 @@
|
|||||||
|
package com.ruoyi.basic.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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域管理对象 hw_area
|
||||||
|
*
|
||||||
|
* @author YINQ
|
||||||
|
* @date 2023-08-30
|
||||||
|
*/
|
||||||
|
public class HwArea extends TreeEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** 区域ID */
|
||||||
|
private Long areaId;
|
||||||
|
|
||||||
|
/** 区域名称 */
|
||||||
|
@Excel(name = "区域名称")
|
||||||
|
private String areaName;
|
||||||
|
|
||||||
|
/** 区域状态 */
|
||||||
|
@Excel(name = "区域状态")
|
||||||
|
private Long areaStatus;
|
||||||
|
|
||||||
|
public void setAreaId(Long areaId)
|
||||||
|
{
|
||||||
|
this.areaId = areaId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAreaId()
|
||||||
|
{
|
||||||
|
return areaId;
|
||||||
|
}
|
||||||
|
public void setAreaName(String areaName)
|
||||||
|
{
|
||||||
|
this.areaName = areaName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAreaName()
|
||||||
|
{
|
||||||
|
return areaName;
|
||||||
|
}
|
||||||
|
public void setAreaStatus(Long areaStatus)
|
||||||
|
{
|
||||||
|
this.areaStatus = areaStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getAreaStatus()
|
||||||
|
{
|
||||||
|
return areaStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("areaId", getAreaId())
|
||||||
|
.append("areaName", getAreaName())
|
||||||
|
.append("ancestors", getAncestors())
|
||||||
|
.append("parentId", getParentId())
|
||||||
|
.append("areaStatus", getAreaStatus())
|
||||||
|
.append("orderNum", getOrderNum())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.basic.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.basic.domain.HwArea;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域管理Mapper接口
|
||||||
|
*
|
||||||
|
* @author YINQ
|
||||||
|
* @date 2023-08-30
|
||||||
|
*/
|
||||||
|
public interface HwAreaMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询区域管理
|
||||||
|
*
|
||||||
|
* @param areaId 区域管理主键
|
||||||
|
* @return 区域管理
|
||||||
|
*/
|
||||||
|
public HwArea selectHwAreaByAreaId(Long areaId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询区域管理列表
|
||||||
|
*
|
||||||
|
* @param hwArea 区域管理
|
||||||
|
* @return 区域管理集合
|
||||||
|
*/
|
||||||
|
public List<HwArea> selectHwAreaList(HwArea hwArea);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增区域管理
|
||||||
|
*
|
||||||
|
* @param hwArea 区域管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertHwArea(HwArea hwArea);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改区域管理
|
||||||
|
*
|
||||||
|
* @param hwArea 区域管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateHwArea(HwArea hwArea);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除区域管理
|
||||||
|
*
|
||||||
|
* @param areaId 区域管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteHwAreaByAreaId(Long areaId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除区域管理
|
||||||
|
*
|
||||||
|
* @param areaIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteHwAreaByAreaIds(Long[] areaIds);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.ruoyi.basic.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.basic.domain.HwArea;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域管理Service接口
|
||||||
|
*
|
||||||
|
* @author YINQ
|
||||||
|
* @date 2023-08-30
|
||||||
|
*/
|
||||||
|
public interface IHwAreaService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询区域管理
|
||||||
|
*
|
||||||
|
* @param areaId 区域管理主键
|
||||||
|
* @return 区域管理
|
||||||
|
*/
|
||||||
|
public HwArea selectHwAreaByAreaId(Long areaId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询区域管理列表
|
||||||
|
*
|
||||||
|
* @param hwArea 区域管理
|
||||||
|
* @return 区域管理集合
|
||||||
|
*/
|
||||||
|
public List<HwArea> selectHwAreaList(HwArea hwArea);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增区域管理
|
||||||
|
*
|
||||||
|
* @param hwArea 区域管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertHwArea(HwArea hwArea);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改区域管理
|
||||||
|
*
|
||||||
|
* @param hwArea 区域管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateHwArea(HwArea hwArea);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除区域管理
|
||||||
|
*
|
||||||
|
* @param areaIds 需要删除的区域管理主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteHwAreaByAreaIds(Long[] areaIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除区域管理信息
|
||||||
|
*
|
||||||
|
* @param areaId 区域管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteHwAreaByAreaId(Long areaId);
|
||||||
|
}
|
@ -0,0 +1,96 @@
|
|||||||
|
package com.ruoyi.basic.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.ruoyi.common.core.utils.DateUtils;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.ruoyi.basic.mapper.HwAreaMapper;
|
||||||
|
import com.ruoyi.basic.domain.HwArea;
|
||||||
|
import com.ruoyi.basic.service.IHwAreaService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 区域管理Service业务层处理
|
||||||
|
*
|
||||||
|
* @author YINQ
|
||||||
|
* @date 2023-08-30
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class HwAreaServiceImpl implements IHwAreaService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private HwAreaMapper hwAreaMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询区域管理
|
||||||
|
*
|
||||||
|
* @param areaId 区域管理主键
|
||||||
|
* @return 区域管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public HwArea selectHwAreaByAreaId(Long areaId)
|
||||||
|
{
|
||||||
|
return hwAreaMapper.selectHwAreaByAreaId(areaId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询区域管理列表
|
||||||
|
*
|
||||||
|
* @param hwArea 区域管理
|
||||||
|
* @return 区域管理
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<HwArea> selectHwAreaList(HwArea hwArea)
|
||||||
|
{
|
||||||
|
return hwAreaMapper.selectHwAreaList(hwArea);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增区域管理
|
||||||
|
*
|
||||||
|
* @param hwArea 区域管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertHwArea(HwArea hwArea)
|
||||||
|
{
|
||||||
|
hwArea.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return hwAreaMapper.insertHwArea(hwArea);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改区域管理
|
||||||
|
*
|
||||||
|
* @param hwArea 区域管理
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateHwArea(HwArea hwArea)
|
||||||
|
{
|
||||||
|
hwArea.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return hwAreaMapper.updateHwArea(hwArea);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除区域管理
|
||||||
|
*
|
||||||
|
* @param areaIds 需要删除的区域管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteHwAreaByAreaIds(Long[] areaIds)
|
||||||
|
{
|
||||||
|
return hwAreaMapper.deleteHwAreaByAreaIds(areaIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除区域管理信息
|
||||||
|
*
|
||||||
|
* @param areaId 区域管理主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteHwAreaByAreaId(Long areaId)
|
||||||
|
{
|
||||||
|
return hwAreaMapper.deleteHwAreaByAreaId(areaId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,92 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<!DOCTYPE mapper
|
||||||
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
|
<mapper namespace="com.ruoyi.basic.mapper.HwAreaMapper">
|
||||||
|
|
||||||
|
<resultMap type="HwArea" id="HwAreaResult">
|
||||||
|
<result property="areaId" column="area_id" />
|
||||||
|
<result property="areaName" column="area_name" />
|
||||||
|
<result property="ancestors" column="ancestors" />
|
||||||
|
<result property="parentId" column="parent_id" />
|
||||||
|
<result property="areaStatus" column="area_status" />
|
||||||
|
<result property="orderNum" column="order_num" />
|
||||||
|
<result property="createBy" column="create_by" />
|
||||||
|
<result property="createTime" column="create_time" />
|
||||||
|
<result property="updateBy" column="update_by" />
|
||||||
|
<result property="updateTime" column="update_time" />
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectHwAreaVo">
|
||||||
|
select area_id, area_name, ancestors, parent_id, area_status, order_num, create_by, create_time, update_by, update_time from hw_area
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectHwAreaList" parameterType="HwArea" resultMap="HwAreaResult">
|
||||||
|
<include refid="selectHwAreaVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="areaName != null and areaName != ''"> and area_name like concat('%', #{areaName}, '%')</if>
|
||||||
|
<if test="ancestors != null and ancestors != ''"> and ancestors = #{ancestors}</if>
|
||||||
|
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||||
|
<if test="areaStatus != null "> and area_status = #{areaStatus}</if>
|
||||||
|
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectHwAreaByAreaId" parameterType="Long" resultMap="HwAreaResult">
|
||||||
|
<include refid="selectHwAreaVo"/>
|
||||||
|
where area_id = #{areaId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertHwArea" parameterType="HwArea" useGeneratedKeys="true" keyProperty="areaId">
|
||||||
|
insert into hw_area
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="areaName != null and areaName != ''">area_name,</if>
|
||||||
|
<if test="ancestors != null">ancestors,</if>
|
||||||
|
<if test="parentId != null">parent_id,</if>
|
||||||
|
<if test="areaStatus != null">area_status,</if>
|
||||||
|
<if test="orderNum != null">order_num,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
<if test="createTime != null">create_time,</if>
|
||||||
|
<if test="updateBy != null">update_by,</if>
|
||||||
|
<if test="updateTime != null">update_time,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="areaName != null and areaName != ''">#{areaName},</if>
|
||||||
|
<if test="ancestors != null">#{ancestors},</if>
|
||||||
|
<if test="parentId != null">#{parentId},</if>
|
||||||
|
<if test="areaStatus != null">#{areaStatus},</if>
|
||||||
|
<if test="orderNum != null">#{orderNum},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
<if test="createTime != null">#{createTime},</if>
|
||||||
|
<if test="updateBy != null">#{updateBy},</if>
|
||||||
|
<if test="updateTime != null">#{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateHwArea" parameterType="HwArea">
|
||||||
|
update hw_area
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="areaName != null and areaName != ''">area_name = #{areaName},</if>
|
||||||
|
<if test="ancestors != null">ancestors = #{ancestors},</if>
|
||||||
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||||
|
<if test="areaStatus != null">area_status = #{areaStatus},</if>
|
||||||
|
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where area_id = #{areaId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteHwAreaByAreaId" parameterType="Long">
|
||||||
|
delete from hw_area where area_id = #{areaId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteHwAreaByAreaIds" parameterType="String">
|
||||||
|
delete from hw_area where area_id in
|
||||||
|
<foreach item="areaId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{areaId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
@ -1,66 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.ruoyi.basic.mapper.HwDictDataLanguageMapper">
|
|
||||||
|
|
||||||
<resultMap type="HwDictDataLanguage" id="HwDictDataLanguageResult">
|
|
||||||
<result property="dataLanguageId" column="data_language_id" />
|
|
||||||
<result property="dictCode" column="dict_code" />
|
|
||||||
<result property="dictLabel" column="dict_label" />
|
|
||||||
<result property="languageCode" column="language_code" />
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="selectHwDictDataLanguageVo">
|
|
||||||
select data_language_id, dict_code, dict_label, language_code from hw_dict_data_language
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="selectHwDictDataLanguageList" parameterType="HwDictDataLanguage" resultMap="HwDictDataLanguageResult">
|
|
||||||
<include refid="selectHwDictDataLanguageVo"/>
|
|
||||||
<where>
|
|
||||||
<if test="dictCode != null "> and dict_code = #{dictCode}</if>
|
|
||||||
<if test="dictLabel != null and dictLabel != ''"> and dict_label = #{dictLabel}</if>
|
|
||||||
<if test="languageCode != null and languageCode != ''"> and language_code = #{languageCode}</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectHwDictDataLanguageByDataLanguageId" parameterType="Long" resultMap="HwDictDataLanguageResult">
|
|
||||||
<include refid="selectHwDictDataLanguageVo"/>
|
|
||||||
where data_language_id = #{dataLanguageId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertHwDictDataLanguage" parameterType="HwDictDataLanguage" useGeneratedKeys="true" keyProperty="dataLanguageId">
|
|
||||||
insert into hw_dict_data_language
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="dictCode != null">dict_code,</if>
|
|
||||||
<if test="dictLabel != null">dict_label,</if>
|
|
||||||
<if test="languageCode != null and languageCode != ''">language_code,</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="dictCode != null">#{dictCode},</if>
|
|
||||||
<if test="dictLabel != null">#{dictLabel},</if>
|
|
||||||
<if test="languageCode != null and languageCode != ''">#{languageCode},</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="updateHwDictDataLanguage" parameterType="HwDictDataLanguage">
|
|
||||||
update hw_dict_data_language
|
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
|
||||||
<if test="dictCode != null">dict_code = #{dictCode},</if>
|
|
||||||
<if test="dictLabel != null">dict_label = #{dictLabel},</if>
|
|
||||||
<if test="languageCode != null and languageCode != ''">language_code = #{languageCode},</if>
|
|
||||||
</trim>
|
|
||||||
where data_language_id = #{dataLanguageId}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="deleteHwDictDataLanguageByDataLanguageId" parameterType="Long">
|
|
||||||
delete from hw_dict_data_language where data_language_id = #{dataLanguageId}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="deleteHwDictDataLanguageByDataLanguageIds" parameterType="String">
|
|
||||||
delete from hw_dict_data_language where data_language_id in
|
|
||||||
<foreach item="dataLanguageId" collection="array" open="(" separator="," close=")">
|
|
||||||
#{dataLanguageId}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
</mapper>
|
|
@ -1,118 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.ruoyi.basic.mapper.HwDictDataMapper">
|
|
||||||
|
|
||||||
<resultMap type="HwDictData" id="HwDictDataResult">
|
|
||||||
<result property="dictCode" column="dict_code" />
|
|
||||||
<result property="dictSort" column="dict_sort" />
|
|
||||||
<result property="dictLabel" column="dict_label" />
|
|
||||||
<result property="dictValue" column="dict_value" />
|
|
||||||
<result property="dictType" column="dict_type" />
|
|
||||||
<result property="cssClass" column="css_class" />
|
|
||||||
<result property="listClass" column="list_class" />
|
|
||||||
<result property="isDefault" column="is_default" />
|
|
||||||
<result property="status" column="status" />
|
|
||||||
<result property="createBy" column="create_by" />
|
|
||||||
<result property="createTime" column="create_time" />
|
|
||||||
<result property="updateBy" column="update_by" />
|
|
||||||
<result property="updateTime" column="update_time" />
|
|
||||||
<result property="remark" column="remark" />
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="selectHwDictDataVo">
|
|
||||||
select dict_code, dict_sort, dict_label, dict_value, dict_type, css_class, list_class, is_default, status, create_by, create_time, update_by, update_time, remark from hw_dict_data
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="selectHwDictDataByType" parameterType="HwDictData" resultMap="HwDictDataResult">
|
|
||||||
<include refid="selectHwDictDataVo"/>
|
|
||||||
where status = '1' and dict_type = #{dictType} order by dict_sort asc
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<select id="selectHwDictDataList" parameterType="HwDictData" resultMap="HwDictDataResult">
|
|
||||||
<include refid="selectHwDictDataVo"/>
|
|
||||||
<where>
|
|
||||||
<if test="dictSort != null "> and dict_sort = #{dictSort}</if>
|
|
||||||
<if test="dictLabel != null and dictLabel != ''"> and dict_label = #{dictLabel}</if>
|
|
||||||
<if test="dictValue != null and dictValue != ''"> and dict_value = #{dictValue}</if>
|
|
||||||
<if test="dictType != null and dictType != ''"> and dict_type = #{dictType}</if>
|
|
||||||
<if test="cssClass != null and cssClass != ''"> and css_class = #{cssClass}</if>
|
|
||||||
<if test="listClass != null and listClass != ''"> and list_class = #{listClass}</if>
|
|
||||||
<if test="isDefault != null and isDefault != ''"> and is_default = #{isDefault}</if>
|
|
||||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectHwDictDataByDictCode" parameterType="Long" resultMap="HwDictDataResult">
|
|
||||||
<include refid="selectHwDictDataVo"/>
|
|
||||||
where dict_code = #{dictCode}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertHwDictData" parameterType="HwDictData" useGeneratedKeys="true" keyProperty="dictCode">
|
|
||||||
insert into hw_dict_data
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="dictSort != null">dict_sort,</if>
|
|
||||||
<if test="dictLabel != null">dict_label,</if>
|
|
||||||
<if test="dictValue != null">dict_value,</if>
|
|
||||||
<if test="dictType != null">dict_type,</if>
|
|
||||||
<if test="cssClass != null">css_class,</if>
|
|
||||||
<if test="listClass != null">list_class,</if>
|
|
||||||
<if test="isDefault != null">is_default,</if>
|
|
||||||
<if test="status != null">status,</if>
|
|
||||||
<if test="createBy != null">create_by,</if>
|
|
||||||
<if test="createTime != null">create_time,</if>
|
|
||||||
<if test="updateBy != null">update_by,</if>
|
|
||||||
<if test="updateTime != null">update_time,</if>
|
|
||||||
<if test="remark != null">remark,</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="dictSort != null">#{dictSort},</if>
|
|
||||||
<if test="dictLabel != null">#{dictLabel},</if>
|
|
||||||
<if test="dictValue != null">#{dictValue},</if>
|
|
||||||
<if test="dictType != null">#{dictType},</if>
|
|
||||||
<if test="cssClass != null">#{cssClass},</if>
|
|
||||||
<if test="listClass != null">#{listClass},</if>
|
|
||||||
<if test="isDefault != null">#{isDefault},</if>
|
|
||||||
<if test="status != null">#{status},</if>
|
|
||||||
<if test="createBy != null">#{createBy},</if>
|
|
||||||
<if test="createTime != null">#{createTime},</if>
|
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
|
||||||
<if test="remark != null">#{remark},</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="updateHwDictData" parameterType="HwDictData">
|
|
||||||
update hw_dict_data
|
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
|
||||||
<if test="dictSort != null">dict_sort = #{dictSort},</if>
|
|
||||||
<if test="dictLabel != null">dict_label = #{dictLabel},</if>
|
|
||||||
<if test="dictValue != null">dict_value = #{dictValue},</if>
|
|
||||||
<if test="dictType != null">dict_type = #{dictType},</if>
|
|
||||||
<if test="cssClass != null">css_class = #{cssClass},</if>
|
|
||||||
<if test="listClass != null">list_class = #{listClass},</if>
|
|
||||||
<if test="isDefault != null">is_default = #{isDefault},</if>
|
|
||||||
<if test="status != null">status = #{status},</if>
|
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
|
||||||
</trim>
|
|
||||||
where dict_code = #{dictCode}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="deleteHwDictDataByDictCode" parameterType="Long">
|
|
||||||
delete from hw_dict_data where dict_code = #{dictCode}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="deleteHwDictDataByDictCodes" parameterType="String">
|
|
||||||
delete from hw_dict_data where dict_code in
|
|
||||||
<foreach item="dictCode" collection="array" open="(" separator="," close=")">
|
|
||||||
#{dictCode}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
</mapper>
|
|
@ -1,86 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.ruoyi.basic.mapper.HwDictTypeMapper">
|
|
||||||
|
|
||||||
<resultMap type="HwDictType" id="HwDictTypeResult">
|
|
||||||
<result property="dictId" column="dict_id" />
|
|
||||||
<result property="dictName" column="dict_name" />
|
|
||||||
<result property="dictType" column="dict_type" />
|
|
||||||
<result property="status" column="status" />
|
|
||||||
<result property="createBy" column="create_by" />
|
|
||||||
<result property="createTime" column="create_time" />
|
|
||||||
<result property="updateBy" column="update_by" />
|
|
||||||
<result property="updateTime" column="update_time" />
|
|
||||||
<result property="remark" column="remark" />
|
|
||||||
</resultMap>
|
|
||||||
|
|
||||||
<sql id="selectHwDictTypeVo">
|
|
||||||
select dict_id, dict_name, dict_type, status, create_by, create_time, update_by, update_time, remark from hw_dict_type
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<select id="selectHwDictTypeList" parameterType="HwDictType" resultMap="HwDictTypeResult">
|
|
||||||
<include refid="selectHwDictTypeVo"/>
|
|
||||||
<where>
|
|
||||||
<if test="dictName != null and dictName != ''"> and dict_name like concat('%', #{dictName}, '%')</if>
|
|
||||||
<if test="dictType != null and dictType != ''"> and dict_type = #{dictType}</if>
|
|
||||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
||||||
</where>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<select id="selectHwDictTypeByDictId" parameterType="Long" resultMap="HwDictTypeResult">
|
|
||||||
<include refid="selectHwDictTypeVo"/>
|
|
||||||
where dict_id = #{dictId}
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<insert id="insertHwDictType" parameterType="HwDictType" useGeneratedKeys="true" keyProperty="dictId">
|
|
||||||
insert into hw_dict_type
|
|
||||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="dictName != null">dict_name,</if>
|
|
||||||
<if test="dictType != null">dict_type,</if>
|
|
||||||
<if test="status != null">status,</if>
|
|
||||||
<if test="createBy != null">create_by,</if>
|
|
||||||
<if test="createTime != null">create_time,</if>
|
|
||||||
<if test="updateBy != null">update_by,</if>
|
|
||||||
<if test="updateTime != null">update_time,</if>
|
|
||||||
<if test="remark != null">remark,</if>
|
|
||||||
</trim>
|
|
||||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
||||||
<if test="dictName != null">#{dictName},</if>
|
|
||||||
<if test="dictType != null">#{dictType},</if>
|
|
||||||
<if test="status != null">#{status},</if>
|
|
||||||
<if test="createBy != null">#{createBy},</if>
|
|
||||||
<if test="createTime != null">#{createTime},</if>
|
|
||||||
<if test="updateBy != null">#{updateBy},</if>
|
|
||||||
<if test="updateTime != null">#{updateTime},</if>
|
|
||||||
<if test="remark != null">#{remark},</if>
|
|
||||||
</trim>
|
|
||||||
</insert>
|
|
||||||
|
|
||||||
<update id="updateHwDictType" parameterType="HwDictType">
|
|
||||||
update hw_dict_type
|
|
||||||
<trim prefix="SET" suffixOverrides=",">
|
|
||||||
<if test="dictName != null">dict_name = #{dictName},</if>
|
|
||||||
<if test="dictType != null">dict_type = #{dictType},</if>
|
|
||||||
<if test="status != null">status = #{status},</if>
|
|
||||||
<if test="createBy != null">create_by = #{createBy},</if>
|
|
||||||
<if test="createTime != null">create_time = #{createTime},</if>
|
|
||||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
||||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
||||||
<if test="remark != null">remark = #{remark},</if>
|
|
||||||
</trim>
|
|
||||||
where dict_id = #{dictId}
|
|
||||||
</update>
|
|
||||||
|
|
||||||
<delete id="deleteHwDictTypeByDictId" parameterType="Long">
|
|
||||||
delete from hw_dict_type where dict_id = #{dictId}
|
|
||||||
</delete>
|
|
||||||
|
|
||||||
<delete id="deleteHwDictTypeByDictIds" parameterType="String">
|
|
||||||
delete from hw_dict_type where dict_id in
|
|
||||||
<foreach item="dictId" collection="array" open="(" separator="," close=")">
|
|
||||||
#{dictId}
|
|
||||||
</foreach>
|
|
||||||
</delete>
|
|
||||||
</mapper>
|
|
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询区域管理列表
|
||||||
|
export function listArea(query) {
|
||||||
|
return request({
|
||||||
|
url: '/basic/area/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询区域管理详细
|
||||||
|
export function getArea(areaId) {
|
||||||
|
return request({
|
||||||
|
url: '/basic/area/' + areaId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增区域管理
|
||||||
|
export function addArea(data) {
|
||||||
|
return request({
|
||||||
|
url: '/basic/area',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改区域管理
|
||||||
|
export function updateArea(data) {
|
||||||
|
return request({
|
||||||
|
url: '/basic/area',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除区域管理
|
||||||
|
export function delArea(areaId) {
|
||||||
|
return request({
|
||||||
|
url: '/basic/area/' + areaId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询语言信息列表
|
||||||
|
export function listLanguage(query) {
|
||||||
|
return request({
|
||||||
|
url: '/basic/language/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询语言信息详细
|
||||||
|
export function getLanguage(languageId) {
|
||||||
|
return request({
|
||||||
|
url: '/basic/language/' + languageId,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增语言信息
|
||||||
|
export function addLanguage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/basic/language',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改语言信息
|
||||||
|
export function updateLanguage(data) {
|
||||||
|
return request({
|
||||||
|
url: '/basic/language',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除语言信息
|
||||||
|
export function delLanguage(languageId) {
|
||||||
|
return request({
|
||||||
|
url: '/basic/language/' + languageId,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
@ -0,0 +1,310 @@
|
|||||||
|
<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="languageCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.languageCode"
|
||||||
|
placeholder="请输入语言编码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="语言名称" prop="languageName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.languageName"
|
||||||
|
placeholder="请输入语言名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="语言代码" prop="languageLang">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.languageLang"
|
||||||
|
placeholder="请输入语言代码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="语言国家" prop="languageCountry">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.languageCountry"
|
||||||
|
placeholder="请输入语言国家"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否默认" prop="defaultFlag">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.defaultFlag"
|
||||||
|
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="['basic:language: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="['basic:language: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="['basic:language: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="['basic:language:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="languageList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="语言ID" align="center" prop="languageId" />
|
||||||
|
<el-table-column label="语言编码" align="center" prop="languageCode" />
|
||||||
|
<el-table-column label="语言名称" align="center" prop="languageName" />
|
||||||
|
<el-table-column label="语言代码" align="center" prop="languageLang" />
|
||||||
|
<el-table-column label="语言国家" align="center" prop="languageCountry" />
|
||||||
|
<el-table-column label="是否默认" align="center" prop="defaultFlag" />
|
||||||
|
<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="['basic:language:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['basic:language: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="languageCode">
|
||||||
|
<el-input v-model="form.languageCode" placeholder="请输入语言编码" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="语言名称" prop="languageName">
|
||||||
|
<el-input v-model="form.languageName" placeholder="请输入语言名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="语言代码" prop="languageLang">
|
||||||
|
<el-input v-model="form.languageLang" placeholder="请输入语言代码" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="语言国家" prop="languageCountry">
|
||||||
|
<el-input v-model="form.languageCountry" placeholder="请输入语言国家" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="是否默认" prop="defaultFlag">
|
||||||
|
<el-input v-model="form.defaultFlag" 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 { listLanguage, getLanguage, delLanguage, addLanguage, updateLanguage } from "@/api/basic/language";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "Language",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 语言信息表格数据
|
||||||
|
languageList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
languageCode: null,
|
||||||
|
languageName: null,
|
||||||
|
languageLang: null,
|
||||||
|
languageCountry: null,
|
||||||
|
defaultFlag: null
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
languageCode: [
|
||||||
|
{ required: true, message: "语言编码不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
languageName: [
|
||||||
|
{ required: true, message: "语言名称不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
defaultFlag: [
|
||||||
|
{ required: true, message: "是否默认不能为空", trigger: "blur" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询语言信息列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listLanguage(this.queryParams).then(response => {
|
||||||
|
this.languageList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
languageId: null,
|
||||||
|
languageCode: null,
|
||||||
|
languageName: null,
|
||||||
|
languageLang: null,
|
||||||
|
languageCountry: null,
|
||||||
|
defaultFlag: 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.languageId)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加语言信息";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const languageId = row.languageId || this.ids
|
||||||
|
getLanguage(languageId).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改语言信息";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.languageId != null) {
|
||||||
|
updateLanguage(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addLanguage(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const languageIds = row.languageId || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除语言信息编号为"' + languageIds + '"的数据项?').then(function() {
|
||||||
|
return delLanguage(languageIds);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('basic/language/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `language_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
Loading…
Reference in New Issue