parent
33cf9765c1
commit
09b613755b
@ -0,0 +1,104 @@
|
|||||||
|
package com.da.dangan.controller;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
import com.da.common.annotation.Log;
|
||||||
|
import com.da.common.core.controller.BaseController;
|
||||||
|
import com.da.common.core.domain.AjaxResult;
|
||||||
|
import com.da.common.enums.BusinessType;
|
||||||
|
import com.da.dangan.domain.AreaSort;
|
||||||
|
import com.da.dangan.service.IAreaSortService;
|
||||||
|
import com.da.common.utils.poi.ExcelUtil;
|
||||||
|
import com.da.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 档案行政分类Controller
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-05-11
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/dangan/areaSort")
|
||||||
|
public class AreaSortController extends BaseController
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private IAreaSortService areaSortService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询档案行政分类列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('dangan:areaSort:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(AreaSort areaSort)
|
||||||
|
{
|
||||||
|
startPage();
|
||||||
|
List<AreaSort> list = areaSortService.selectAreaSortList(areaSort);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出档案行政分类列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('dangan:areaSort:export')")
|
||||||
|
@Log(title = "档案行政分类", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, AreaSort areaSort)
|
||||||
|
{
|
||||||
|
List<AreaSort> list = areaSortService.selectAreaSortList(areaSort);
|
||||||
|
ExcelUtil<AreaSort> util = new ExcelUtil<AreaSort>(AreaSort.class);
|
||||||
|
util.exportExcel(response, list, "档案行政分类数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取档案行政分类详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('dangan:areaSort:query')")
|
||||||
|
@GetMapping(value = "/{id}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||||
|
{
|
||||||
|
return success(areaSortService.selectAreaSortById(id));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增档案行政分类
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('dangan:areaSort:add')")
|
||||||
|
@Log(title = "档案行政分类", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody AreaSort areaSort)
|
||||||
|
{
|
||||||
|
return toAjax(areaSortService.insertAreaSort(areaSort));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改档案行政分类
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('dangan:areaSort:edit')")
|
||||||
|
@Log(title = "档案行政分类", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody AreaSort areaSort)
|
||||||
|
{
|
||||||
|
return toAjax(areaSortService.updateAreaSort(areaSort));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除档案行政分类
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('dangan:areaSort:remove')")
|
||||||
|
@Log(title = "档案行政分类", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{ids}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] ids)
|
||||||
|
{
|
||||||
|
return toAjax(areaSortService.deleteAreaSortByIds(ids));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,83 @@
|
|||||||
|
package com.da.dangan.domain;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
import com.da.common.annotation.Excel;
|
||||||
|
import com.da.common.core.domain.BaseEntity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 档案行政分类对象 area_sort
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-05-11
|
||||||
|
*/
|
||||||
|
public class AreaSort extends BaseEntity
|
||||||
|
{
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/** id */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 目录名称 */
|
||||||
|
@Excel(name = "目录名称")
|
||||||
|
private String muName;
|
||||||
|
|
||||||
|
/** 区域分类(字典) */
|
||||||
|
@Excel(name = "区域分类(字典)")
|
||||||
|
private String areaType;
|
||||||
|
|
||||||
|
/** 父区域ID */
|
||||||
|
@Excel(name = "父区域ID")
|
||||||
|
private Long pid;
|
||||||
|
|
||||||
|
public void setId(Long id)
|
||||||
|
{
|
||||||
|
this.id = id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getId()
|
||||||
|
{
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
public void setMuName(String muName)
|
||||||
|
{
|
||||||
|
this.muName = muName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMuName()
|
||||||
|
{
|
||||||
|
return muName;
|
||||||
|
}
|
||||||
|
public void setAreaType(String areaType)
|
||||||
|
{
|
||||||
|
this.areaType = areaType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getAreaType()
|
||||||
|
{
|
||||||
|
return areaType;
|
||||||
|
}
|
||||||
|
public void setPid(Long pid)
|
||||||
|
{
|
||||||
|
this.pid = pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Long getPid()
|
||||||
|
{
|
||||||
|
return pid;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
.append("id", getId())
|
||||||
|
.append("muName", getMuName())
|
||||||
|
.append("areaType", getAreaType())
|
||||||
|
.append("pid", getPid())
|
||||||
|
.append("createBy", getCreateBy())
|
||||||
|
.append("createTime", getCreateTime())
|
||||||
|
.append("updateBy", getUpdateBy())
|
||||||
|
.append("updateTime", getUpdateTime())
|
||||||
|
.toString();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.da.dangan.mapper;
|
||||||
|
|
||||||
|
import com.da.dangan.domain.AreaSort;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 档案行政分类Mapper接口
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-05-11
|
||||||
|
*/
|
||||||
|
public interface AreaSortMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询档案行政分类
|
||||||
|
*
|
||||||
|
* @param id 档案行政分类主键
|
||||||
|
* @return 档案行政分类
|
||||||
|
*/
|
||||||
|
public AreaSort selectAreaSortById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询档案行政分类列表
|
||||||
|
*
|
||||||
|
* @param areaSort 档案行政分类
|
||||||
|
* @return 档案行政分类集合
|
||||||
|
*/
|
||||||
|
public List<AreaSort> selectAreaSortList(AreaSort areaSort);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增档案行政分类
|
||||||
|
*
|
||||||
|
* @param areaSort 档案行政分类
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAreaSort(AreaSort areaSort);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改档案行政分类
|
||||||
|
*
|
||||||
|
* @param areaSort 档案行政分类
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAreaSort(AreaSort areaSort);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除档案行政分类
|
||||||
|
*
|
||||||
|
* @param id 档案行政分类主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAreaSortById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除档案行政分类
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAreaSortByIds(Long[] ids);
|
||||||
|
}
|
||||||
@ -0,0 +1,62 @@
|
|||||||
|
package com.da.dangan.service;
|
||||||
|
|
||||||
|
import com.da.dangan.domain.AreaSort;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 档案行政分类Service接口
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-05-11
|
||||||
|
*/
|
||||||
|
public interface IAreaSortService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询档案行政分类
|
||||||
|
*
|
||||||
|
* @param id 档案行政分类主键
|
||||||
|
* @return 档案行政分类
|
||||||
|
*/
|
||||||
|
public AreaSort selectAreaSortById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询档案行政分类列表
|
||||||
|
*
|
||||||
|
* @param areaSort 档案行政分类
|
||||||
|
* @return 档案行政分类集合
|
||||||
|
*/
|
||||||
|
public List<AreaSort> selectAreaSortList(AreaSort areaSort);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增档案行政分类
|
||||||
|
*
|
||||||
|
* @param areaSort 档案行政分类
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertAreaSort(AreaSort areaSort);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改档案行政分类
|
||||||
|
*
|
||||||
|
* @param areaSort 档案行政分类
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateAreaSort(AreaSort areaSort);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除档案行政分类
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的档案行政分类主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAreaSortByIds(Long[] ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除档案行政分类信息
|
||||||
|
*
|
||||||
|
* @param id 档案行政分类主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteAreaSortById(Long id);
|
||||||
|
}
|
||||||
@ -0,0 +1,97 @@
|
|||||||
|
package com.da.dangan.service.impl;
|
||||||
|
|
||||||
|
import com.da.common.utils.DateUtils;
|
||||||
|
import com.da.dangan.domain.AreaSort;
|
||||||
|
import com.da.dangan.mapper.AreaSortMapper;
|
||||||
|
import com.da.dangan.service.IAreaSortService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 档案行政分类Service业务层处理
|
||||||
|
*
|
||||||
|
* @author hs
|
||||||
|
* @date 2024-05-11
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class AreaSortServiceImpl implements IAreaSortService
|
||||||
|
{
|
||||||
|
@Autowired
|
||||||
|
private AreaSortMapper areaSortMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询档案行政分类
|
||||||
|
*
|
||||||
|
* @param id 档案行政分类主键
|
||||||
|
* @return 档案行政分类
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public AreaSort selectAreaSortById(Long id)
|
||||||
|
{
|
||||||
|
return areaSortMapper.selectAreaSortById(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询档案行政分类列表
|
||||||
|
*
|
||||||
|
* @param areaSort 档案行政分类
|
||||||
|
* @return 档案行政分类
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<AreaSort> selectAreaSortList(AreaSort areaSort)
|
||||||
|
{
|
||||||
|
return areaSortMapper.selectAreaSortList(areaSort);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增档案行政分类
|
||||||
|
*
|
||||||
|
* @param areaSort 档案行政分类
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertAreaSort(AreaSort areaSort)
|
||||||
|
{
|
||||||
|
areaSort.setCreateTime(DateUtils.getNowDate());
|
||||||
|
return areaSortMapper.insertAreaSort(areaSort);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改档案行政分类
|
||||||
|
*
|
||||||
|
* @param areaSort 档案行政分类
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateAreaSort(AreaSort areaSort)
|
||||||
|
{
|
||||||
|
areaSort.setUpdateTime(DateUtils.getNowDate());
|
||||||
|
return areaSortMapper.updateAreaSort(areaSort);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除档案行政分类
|
||||||
|
*
|
||||||
|
* @param ids 需要删除的档案行政分类主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAreaSortByIds(Long[] ids)
|
||||||
|
{
|
||||||
|
return areaSortMapper.deleteAreaSortByIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除档案行政分类信息
|
||||||
|
*
|
||||||
|
* @param id 档案行政分类主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteAreaSortById(Long id)
|
||||||
|
{
|
||||||
|
return areaSortMapper.deleteAreaSortById(id);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,82 @@
|
|||||||
|
<?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.da.dangan.mapper.AreaSortMapper">
|
||||||
|
|
||||||
|
<resultMap type="AreaSort" id="AreaSortResult">
|
||||||
|
<result property="id" column="id" />
|
||||||
|
<result property="muName" column="mu_name" />
|
||||||
|
<result property="areaType" column="area_type" />
|
||||||
|
<result property="pid" column="pid" />
|
||||||
|
<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="selectAreaSortVo">
|
||||||
|
select id, mu_name, area_type, pid, create_by, create_time, update_by, update_time from area_sort
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectAreaSortList" parameterType="AreaSort" resultMap="AreaSortResult">
|
||||||
|
<include refid="selectAreaSortVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="muName != null and muName != ''"> and mu_name like concat('%', #{muName}, '%')</if>
|
||||||
|
<if test="areaType != null and areaType != ''"> and area_type = #{areaType}</if>
|
||||||
|
<if test="pid != null "> and pid = #{pid}</if>
|
||||||
|
</where>
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectAreaSortById" parameterType="Long" resultMap="AreaSortResult">
|
||||||
|
<include refid="selectAreaSortVo"/>
|
||||||
|
where id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertAreaSort" parameterType="AreaSort" useGeneratedKeys="true" keyProperty="id">
|
||||||
|
insert into area_sort
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="muName != null and muName != ''">mu_name,</if>
|
||||||
|
<if test="areaType != null and areaType != ''">area_type,</if>
|
||||||
|
<if test="pid != null">pid,</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="muName != null and muName != ''">#{muName},</if>
|
||||||
|
<if test="areaType != null and areaType != ''">#{areaType},</if>
|
||||||
|
<if test="pid != null">#{pid},</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="updateAreaSort" parameterType="AreaSort">
|
||||||
|
update area_sort
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="muName != null and muName != ''">mu_name = #{muName},</if>
|
||||||
|
<if test="areaType != null and areaType != ''">area_type = #{areaType},</if>
|
||||||
|
<if test="pid != null">pid = #{pid},</if>
|
||||||
|
<if test="createBy != null">create_by = #{createBy},</if>
|
||||||
|
<if test="createTime != null">create_time = #{createTime},</if>
|
||||||
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||||
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||||
|
</trim>
|
||||||
|
where id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteAreaSortById" parameterType="Long">
|
||||||
|
delete from area_sort where id = #{id}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteAreaSortByIds" parameterType="String">
|
||||||
|
delete from area_sort where id in
|
||||||
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||||
|
#{id}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
||||||
@ -0,0 +1,44 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
// 查询档案行政分类列表
|
||||||
|
export function listAreaSort(query) {
|
||||||
|
return request({
|
||||||
|
url: '/dangan/areaSort/list',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询档案行政分类详细
|
||||||
|
export function getAreaSort(id) {
|
||||||
|
return request({
|
||||||
|
url: '/dangan/areaSort/' + id,
|
||||||
|
method: 'get'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 新增档案行政分类
|
||||||
|
export function addAreaSort(data) {
|
||||||
|
return request({
|
||||||
|
url: '/dangan/areaSort',
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改档案行政分类
|
||||||
|
export function updateAreaSort(data) {
|
||||||
|
return request({
|
||||||
|
url: '/dangan/areaSort',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除档案行政分类
|
||||||
|
export function delAreaSort(id) {
|
||||||
|
return request({
|
||||||
|
url: '/dangan/areaSort/' + id,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
@ -0,0 +1,275 @@
|
|||||||
|
<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="muName">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.muName"
|
||||||
|
placeholder="请输入目录名称"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="父区域ID" prop="pid">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.pid"
|
||||||
|
placeholder="请输入父区域ID"
|
||||||
|
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="['dangan:areaSort: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="['dangan:areaSort: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="['dangan:areaSort: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="['dangan:areaSort:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="areaSortList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
<el-table-column label="id" align="center" prop="id" />
|
||||||
|
<el-table-column label="目录名称" align="center" prop="muName" />
|
||||||
|
<el-table-column label="区域分类(字典)" align="center" prop="areaType" />
|
||||||
|
<el-table-column label="父区域ID" align="center" prop="pid" />
|
||||||
|
<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="['dangan:areaSort:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['dangan:areaSort: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="muName">
|
||||||
|
<el-input v-model="form.muName" placeholder="请输入目录名称" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="父区域ID" prop="pid">
|
||||||
|
<el-input v-model="form.pid" placeholder="请输入父区域ID" />
|
||||||
|
</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 { listAreaSort, getAreaSort, delAreaSort, addAreaSort, updateAreaSort } from "@/api/dangan/areaSort";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "AreaSort",
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 档案行政分类表格数据
|
||||||
|
areaSortList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
muName: null,
|
||||||
|
areaType: null,
|
||||||
|
pid: null,
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
muName: [
|
||||||
|
{ required: true, message: "目录名称不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
areaType: [
|
||||||
|
{ required: true, message: "区域分类(字典)不能为空", trigger: "change" }
|
||||||
|
],
|
||||||
|
pid: [
|
||||||
|
{ required: true, message: "父区域ID不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询档案行政分类列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listAreaSort(this.queryParams).then(response => {
|
||||||
|
this.areaSortList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: null,
|
||||||
|
muName: null,
|
||||||
|
areaType: null,
|
||||||
|
pid: null,
|
||||||
|
createBy: null,
|
||||||
|
createTime: null,
|
||||||
|
updateBy: null,
|
||||||
|
updateTime: null
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加档案行政分类";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getAreaSort(id).then(response => {
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改档案行政分类";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateAreaSort(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addAreaSort(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除档案行政分类编号为"' + ids + '"的数据项?').then(function() {
|
||||||
|
return delAreaSort(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('dangan/areaSort/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `areaSort_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Loading…
Reference in new issue