26 changed files with 2037 additions and 367 deletions
@ -0,0 +1,104 @@ |
|||
package com.ruoyi.web.controller.system; |
|||
|
|||
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.ruoyi.common.annotation.Log; |
|||
import com.ruoyi.common.core.controller.BaseController; |
|||
import com.ruoyi.common.core.domain.AjaxResult; |
|||
import com.ruoyi.common.enums.BusinessType; |
|||
import com.ruoyi.system.domain.SysExpression; |
|||
import com.ruoyi.system.service.ISysExpressionService; |
|||
import com.ruoyi.common.utils.poi.ExcelUtil; |
|||
import com.ruoyi.common.core.page.TableDataInfo; |
|||
|
|||
/** |
|||
* 流程达式Controller |
|||
* |
|||
* @author ruoyi |
|||
* @date 2022-12-12 |
|||
*/ |
|||
@RestController |
|||
@RequestMapping("/system/expression") |
|||
public class SysExpressionController extends BaseController |
|||
{ |
|||
@Autowired |
|||
private ISysExpressionService sysExpressionService; |
|||
|
|||
/** |
|||
* 查询流程达式列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:expression:list')") |
|||
@GetMapping("/list") |
|||
public TableDataInfo list(SysExpression sysExpression) |
|||
{ |
|||
startPage(); |
|||
List<SysExpression> list = sysExpressionService.selectSysExpressionList(sysExpression); |
|||
return getDataTable(list); |
|||
} |
|||
|
|||
/** |
|||
* 导出流程达式列表 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:expression:export')") |
|||
@Log(title = "流程达式", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
public void export(HttpServletResponse response, SysExpression sysExpression) |
|||
{ |
|||
List<SysExpression> list = sysExpressionService.selectSysExpressionList(sysExpression); |
|||
ExcelUtil<SysExpression> util = new ExcelUtil<SysExpression>(SysExpression.class); |
|||
util.exportExcel(response, list, "流程达式数据"); |
|||
} |
|||
|
|||
/** |
|||
* 获取流程达式详细信息 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:expression:query')") |
|||
@GetMapping(value = "/{id}") |
|||
public AjaxResult getInfo(@PathVariable("id") Long id) |
|||
{ |
|||
return success(sysExpressionService.selectSysExpressionById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增流程达式 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:expression:add')") |
|||
@Log(title = "流程达式", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
public AjaxResult add(@RequestBody SysExpression sysExpression) |
|||
{ |
|||
return toAjax(sysExpressionService.insertSysExpression(sysExpression)); |
|||
} |
|||
|
|||
/** |
|||
* 修改流程达式 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:expression:edit')") |
|||
@Log(title = "流程达式", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public AjaxResult edit(@RequestBody SysExpression sysExpression) |
|||
{ |
|||
return toAjax(sysExpressionService.updateSysExpression(sysExpression)); |
|||
} |
|||
|
|||
/** |
|||
* 删除流程达式 |
|||
*/ |
|||
@PreAuthorize("@ss.hasPermi('system:expression:remove')") |
|||
@Log(title = "流程达式", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public AjaxResult remove(@PathVariable Long[] ids) |
|||
{ |
|||
return toAjax(sysExpressionService.deleteSysExpressionByIds(ids)); |
|||
} |
|||
} |
@ -0,0 +1,83 @@ |
|||
package com.ruoyi.system.domain; |
|||
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder; |
|||
import org.apache.commons.lang3.builder.ToStringStyle; |
|||
import com.ruoyi.common.annotation.Excel; |
|||
import com.ruoyi.common.core.domain.BaseEntity; |
|||
|
|||
/** |
|||
* 流程达式对象 sys_expression |
|||
* |
|||
* @author ruoyi |
|||
* @date 2022-12-12 |
|||
*/ |
|||
public class SysExpression extends BaseEntity |
|||
{ |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** 表单主键 */ |
|||
private Long id; |
|||
|
|||
/** 表达式名称 */ |
|||
@Excel(name = "表达式名称") |
|||
private String name; |
|||
|
|||
/** 表达式内容 */ |
|||
@Excel(name = "表达式内容") |
|||
private String expression; |
|||
|
|||
/** 状态 */ |
|||
private Integer status; |
|||
|
|||
public void setId(Long id) |
|||
{ |
|||
this.id = id; |
|||
} |
|||
|
|||
public Long getId() |
|||
{ |
|||
return id; |
|||
} |
|||
public void setName(String name) |
|||
{ |
|||
this.name = name; |
|||
} |
|||
|
|||
public String getName() |
|||
{ |
|||
return name; |
|||
} |
|||
public void setExpression(String expression) |
|||
{ |
|||
this.expression = expression; |
|||
} |
|||
|
|||
public String getExpression() |
|||
{ |
|||
return expression; |
|||
} |
|||
public void setStatus(Integer status) |
|||
{ |
|||
this.status = status; |
|||
} |
|||
|
|||
public Integer getStatus() |
|||
{ |
|||
return status; |
|||
} |
|||
|
|||
@Override |
|||
public String toString() { |
|||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
|||
.append("id", getId()) |
|||
.append("name", getName()) |
|||
.append("expression", getExpression()) |
|||
.append("createTime", getCreateTime()) |
|||
.append("updateTime", getUpdateTime()) |
|||
.append("createBy", getCreateBy()) |
|||
.append("updateBy", getUpdateBy()) |
|||
.append("status", getStatus()) |
|||
.append("remark", getRemark()) |
|||
.toString(); |
|||
} |
|||
} |
@ -0,0 +1,61 @@ |
|||
package com.ruoyi.system.mapper; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.SysExpression; |
|||
|
|||
/** |
|||
* 流程达式Mapper接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2022-12-12 |
|||
*/ |
|||
public interface SysExpressionMapper |
|||
{ |
|||
/** |
|||
* 查询流程达式 |
|||
* |
|||
* @param id 流程达式主键 |
|||
* @return 流程达式 |
|||
*/ |
|||
public SysExpression selectSysExpressionById(Long id); |
|||
|
|||
/** |
|||
* 查询流程达式列表 |
|||
* |
|||
* @param sysExpression 流程达式 |
|||
* @return 流程达式集合 |
|||
*/ |
|||
public List<SysExpression> selectSysExpressionList(SysExpression sysExpression); |
|||
|
|||
/** |
|||
* 新增流程达式 |
|||
* |
|||
* @param sysExpression 流程达式 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSysExpression(SysExpression sysExpression); |
|||
|
|||
/** |
|||
* 修改流程达式 |
|||
* |
|||
* @param sysExpression 流程达式 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSysExpression(SysExpression sysExpression); |
|||
|
|||
/** |
|||
* 删除流程达式 |
|||
* |
|||
* @param id 流程达式主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysExpressionById(Long id); |
|||
|
|||
/** |
|||
* 批量删除流程达式 |
|||
* |
|||
* @param ids 需要删除的数据主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysExpressionByIds(Long[] ids); |
|||
} |
@ -0,0 +1,61 @@ |
|||
package com.ruoyi.system.service; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.system.domain.SysExpression; |
|||
|
|||
/** |
|||
* 流程达式Service接口 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2022-12-12 |
|||
*/ |
|||
public interface ISysExpressionService |
|||
{ |
|||
/** |
|||
* 查询流程达式 |
|||
* |
|||
* @param id 流程达式主键 |
|||
* @return 流程达式 |
|||
*/ |
|||
public SysExpression selectSysExpressionById(Long id); |
|||
|
|||
/** |
|||
* 查询流程达式列表 |
|||
* |
|||
* @param sysExpression 流程达式 |
|||
* @return 流程达式集合 |
|||
*/ |
|||
public List<SysExpression> selectSysExpressionList(SysExpression sysExpression); |
|||
|
|||
/** |
|||
* 新增流程达式 |
|||
* |
|||
* @param sysExpression 流程达式 |
|||
* @return 结果 |
|||
*/ |
|||
public int insertSysExpression(SysExpression sysExpression); |
|||
|
|||
/** |
|||
* 修改流程达式 |
|||
* |
|||
* @param sysExpression 流程达式 |
|||
* @return 结果 |
|||
*/ |
|||
public int updateSysExpression(SysExpression sysExpression); |
|||
|
|||
/** |
|||
* 批量删除流程达式 |
|||
* |
|||
* @param ids 需要删除的流程达式主键集合 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysExpressionByIds(Long[] ids); |
|||
|
|||
/** |
|||
* 删除流程达式信息 |
|||
* |
|||
* @param id 流程达式主键 |
|||
* @return 结果 |
|||
*/ |
|||
public int deleteSysExpressionById(Long id); |
|||
} |
@ -0,0 +1,96 @@ |
|||
package com.ruoyi.system.service.impl; |
|||
|
|||
import java.util.List; |
|||
import com.ruoyi.common.utils.DateUtils; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import com.ruoyi.system.mapper.SysExpressionMapper; |
|||
import com.ruoyi.system.domain.SysExpression; |
|||
import com.ruoyi.system.service.ISysExpressionService; |
|||
|
|||
/** |
|||
* 流程达式Service业务层处理 |
|||
* |
|||
* @author ruoyi |
|||
* @date 2022-12-12 |
|||
*/ |
|||
@Service |
|||
public class SysExpressionServiceImpl implements ISysExpressionService |
|||
{ |
|||
@Autowired |
|||
private SysExpressionMapper sysExpressionMapper; |
|||
|
|||
/** |
|||
* 查询流程达式 |
|||
* |
|||
* @param id 流程达式主键 |
|||
* @return 流程达式 |
|||
*/ |
|||
@Override |
|||
public SysExpression selectSysExpressionById(Long id) |
|||
{ |
|||
return sysExpressionMapper.selectSysExpressionById(id); |
|||
} |
|||
|
|||
/** |
|||
* 查询流程达式列表 |
|||
* |
|||
* @param sysExpression 流程达式 |
|||
* @return 流程达式 |
|||
*/ |
|||
@Override |
|||
public List<SysExpression> selectSysExpressionList(SysExpression sysExpression) |
|||
{ |
|||
return sysExpressionMapper.selectSysExpressionList(sysExpression); |
|||
} |
|||
|
|||
/** |
|||
* 新增流程达式 |
|||
* |
|||
* @param sysExpression 流程达式 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int insertSysExpression(SysExpression sysExpression) |
|||
{ |
|||
sysExpression.setCreateTime(DateUtils.getNowDate()); |
|||
return sysExpressionMapper.insertSysExpression(sysExpression); |
|||
} |
|||
|
|||
/** |
|||
* 修改流程达式 |
|||
* |
|||
* @param sysExpression 流程达式 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int updateSysExpression(SysExpression sysExpression) |
|||
{ |
|||
sysExpression.setUpdateTime(DateUtils.getNowDate()); |
|||
return sysExpressionMapper.updateSysExpression(sysExpression); |
|||
} |
|||
|
|||
/** |
|||
* 批量删除流程达式 |
|||
* |
|||
* @param ids 需要删除的流程达式主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSysExpressionByIds(Long[] ids) |
|||
{ |
|||
return sysExpressionMapper.deleteSysExpressionByIds(ids); |
|||
} |
|||
|
|||
/** |
|||
* 删除流程达式信息 |
|||
* |
|||
* @param id 流程达式主键 |
|||
* @return 结果 |
|||
*/ |
|||
@Override |
|||
public int deleteSysExpressionById(Long id) |
|||
{ |
|||
return sysExpressionMapper.deleteSysExpressionById(id); |
|||
} |
|||
} |
@ -0,0 +1,86 @@ |
|||
<?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.system.mapper.SysExpressionMapper"> |
|||
|
|||
<resultMap type="SysExpression" id="SysExpressionResult"> |
|||
<result property="id" column="id" /> |
|||
<result property="name" column="name" /> |
|||
<result property="expression" column="expression" /> |
|||
<result property="createTime" column="create_time" /> |
|||
<result property="updateTime" column="update_time" /> |
|||
<result property="createBy" column="create_by" /> |
|||
<result property="updateBy" column="update_by" /> |
|||
<result property="status" column="status" /> |
|||
<result property="remark" column="remark" /> |
|||
</resultMap> |
|||
|
|||
<sql id="selectSysExpressionVo"> |
|||
select id, name, expression, create_time, update_time, create_by, update_by, status, remark from sys_expression |
|||
</sql> |
|||
|
|||
<select id="selectSysExpressionList" parameterType="SysExpression" resultMap="SysExpressionResult"> |
|||
<include refid="selectSysExpressionVo"/> |
|||
<where> |
|||
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> |
|||
<if test="expression != null and expression != ''"> and expression = #{expression}</if> |
|||
<if test="status != null "> and status = #{status}</if> |
|||
</where> |
|||
</select> |
|||
|
|||
<select id="selectSysExpressionById" parameterType="Long" resultMap="SysExpressionResult"> |
|||
<include refid="selectSysExpressionVo"/> |
|||
where id = #{id} |
|||
</select> |
|||
|
|||
<insert id="insertSysExpression" parameterType="SysExpression" useGeneratedKeys="true" keyProperty="id"> |
|||
insert into sys_expression |
|||
<trim prefix="(" suffix=")" suffixOverrides=","> |
|||
<if test="name != null">name,</if> |
|||
<if test="expression != null">expression,</if> |
|||
<if test="createTime != null">create_time,</if> |
|||
<if test="updateTime != null">update_time,</if> |
|||
<if test="createBy != null">create_by,</if> |
|||
<if test="updateBy != null">update_by,</if> |
|||
<if test="status != null">status,</if> |
|||
<if test="remark != null">remark,</if> |
|||
</trim> |
|||
<trim prefix="values (" suffix=")" suffixOverrides=","> |
|||
<if test="name != null">#{name},</if> |
|||
<if test="expression != null">#{expression},</if> |
|||
<if test="createTime != null">#{createTime},</if> |
|||
<if test="updateTime != null">#{updateTime},</if> |
|||
<if test="createBy != null">#{createBy},</if> |
|||
<if test="updateBy != null">#{updateBy},</if> |
|||
<if test="status != null">#{status},</if> |
|||
<if test="remark != null">#{remark},</if> |
|||
</trim> |
|||
</insert> |
|||
|
|||
<update id="updateSysExpression" parameterType="SysExpression"> |
|||
update sys_expression |
|||
<trim prefix="SET" suffixOverrides=","> |
|||
<if test="name != null">name = #{name},</if> |
|||
<if test="expression != null">expression = #{expression},</if> |
|||
<if test="createTime != null">create_time = #{createTime},</if> |
|||
<if test="updateTime != null">update_time = #{updateTime},</if> |
|||
<if test="createBy != null">create_by = #{createBy},</if> |
|||
<if test="updateBy != null">update_by = #{updateBy},</if> |
|||
<if test="status != null">status = #{status},</if> |
|||
<if test="remark != null">remark = #{remark},</if> |
|||
</trim> |
|||
where id = #{id} |
|||
</update> |
|||
|
|||
<delete id="deleteSysExpressionById" parameterType="Long"> |
|||
delete from sys_expression where id = #{id} |
|||
</delete> |
|||
|
|||
<delete id="deleteSysExpressionByIds" parameterType="String"> |
|||
delete from sys_expression 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 listExpression(query) { |
|||
return request({ |
|||
url: '/system/expression/list', |
|||
method: 'get', |
|||
params: query |
|||
}) |
|||
} |
|||
|
|||
// 查询流程达式详细
|
|||
export function getExpression(id) { |
|||
return request({ |
|||
url: '/system/expression/' + id, |
|||
method: 'get' |
|||
}) |
|||
} |
|||
|
|||
// 新增流程达式
|
|||
export function addExpression(data) { |
|||
return request({ |
|||
url: '/system/expression', |
|||
method: 'post', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 修改流程达式
|
|||
export function updateExpression(data) { |
|||
return request({ |
|||
url: '/system/expression', |
|||
method: 'put', |
|||
data: data |
|||
}) |
|||
} |
|||
|
|||
// 删除流程达式
|
|||
export function delExpression(id) { |
|||
return request({ |
|||
url: '/system/expression/' + id, |
|||
method: 'delete' |
|||
}) |
|||
} |
@ -1,191 +1,191 @@ |
|||
@import './variables.scss'; |
|||
@import './mixin.scss'; |
|||
@import './transition.scss'; |
|||
@import './element-ui.scss'; |
|||
@import './sidebar.scss'; |
|||
@import './btn.scss'; |
|||
|
|||
body { |
|||
height: 100%; |
|||
-moz-osx-font-smoothing: grayscale; |
|||
-webkit-font-smoothing: antialiased; |
|||
text-rendering: optimizeLegibility; |
|||
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; |
|||
} |
|||
|
|||
label { |
|||
font-weight: 700; |
|||
} |
|||
|
|||
html { |
|||
height: 100%; |
|||
box-sizing: border-box; |
|||
} |
|||
|
|||
#app { |
|||
height: 100%; |
|||
} |
|||
|
|||
*, |
|||
*:before, |
|||
*:after { |
|||
box-sizing: inherit; |
|||
} |
|||
|
|||
.no-padding { |
|||
padding: 0px !important; |
|||
} |
|||
|
|||
.padding-content { |
|||
padding: 4px 0; |
|||
} |
|||
|
|||
a:focus, |
|||
a:active { |
|||
outline: none; |
|||
} |
|||
|
|||
a, |
|||
a:focus, |
|||
a:hover { |
|||
cursor: pointer; |
|||
color: inherit; |
|||
text-decoration: none; |
|||
} |
|||
|
|||
div:focus { |
|||
outline: none; |
|||
} |
|||
|
|||
.fr { |
|||
float: right; |
|||
} |
|||
|
|||
.fl { |
|||
float: left; |
|||
} |
|||
|
|||
.pr-5 { |
|||
padding-right: 5px; |
|||
} |
|||
|
|||
.pl-5 { |
|||
padding-left: 5px; |
|||
} |
|||
|
|||
.block { |
|||
display: block; |
|||
} |
|||
|
|||
.pointer { |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.inlineBlock { |
|||
display: block; |
|||
} |
|||
|
|||
.clearfix { |
|||
&:after { |
|||
visibility: hidden; |
|||
display: block; |
|||
font-size: 0; |
|||
content: " "; |
|||
clear: both; |
|||
height: 0; |
|||
} |
|||
} |
|||
|
|||
aside { |
|||
background: #eef1f6; |
|||
padding: 8px 24px; |
|||
margin-bottom: 20px; |
|||
border-radius: 2px; |
|||
display: block; |
|||
line-height: 32px; |
|||
font-size: 16px; |
|||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; |
|||
color: #2c3e50; |
|||
-webkit-font-smoothing: antialiased; |
|||
-moz-osx-font-smoothing: grayscale; |
|||
|
|||
a { |
|||
color: #337ab7; |
|||
cursor: pointer; |
|||
|
|||
&:hover { |
|||
color: rgb(32, 160, 255); |
|||
} |
|||
} |
|||
} |
|||
|
|||
//main-container全局样式 |
|||
.app-container { |
|||
padding: 20px; |
|||
} |
|||
|
|||
.components-container { |
|||
margin: 30px 50px; |
|||
position: relative; |
|||
} |
|||
|
|||
.pagination-container { |
|||
margin-top: 30px; |
|||
} |
|||
|
|||
.text-center { |
|||
text-align: center |
|||
} |
|||
|
|||
.sub-navbar { |
|||
height: 50px; |
|||
line-height: 50px; |
|||
position: relative; |
|||
width: 100%; |
|||
text-align: right; |
|||
padding-right: 20px; |
|||
transition: 600ms ease position; |
|||
background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%); |
|||
|
|||
.subtitle { |
|||
font-size: 20px; |
|||
color: #fff; |
|||
} |
|||
|
|||
&.draft { |
|||
background: #d0d0d0; |
|||
} |
|||
|
|||
&.deleted { |
|||
background: #d0d0d0; |
|||
} |
|||
} |
|||
|
|||
.link-type, |
|||
.link-type:focus { |
|||
color: #337ab7; |
|||
cursor: pointer; |
|||
|
|||
&:hover { |
|||
color: rgb(32, 160, 255); |
|||
} |
|||
} |
|||
|
|||
.filter-container { |
|||
padding-bottom: 10px; |
|||
|
|||
.filter-item { |
|||
display: inline-block; |
|||
vertical-align: middle; |
|||
margin-bottom: 10px; |
|||
} |
|||
} |
|||
|
|||
//refine vue-multiselect plugin |
|||
.multiselect { |
|||
line-height: 16px; |
|||
} |
|||
|
|||
.multiselect--active { |
|||
z-index: 1000 !important; |
|||
} |
|||
@import './variables.scss'; |
|||
@import './mixin.scss'; |
|||
@import './transition.scss'; |
|||
@import './element-ui.scss'; |
|||
@import './sidebar.scss'; |
|||
@import './btn.scss'; |
|||
|
|||
body { |
|||
height: 100%; |
|||
-moz-osx-font-smoothing: grayscale; |
|||
-webkit-font-smoothing: antialiased; |
|||
text-rendering: optimizeLegibility; |
|||
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif; |
|||
} |
|||
|
|||
label { |
|||
font-weight: 700; |
|||
} |
|||
|
|||
html { |
|||
height: 100%; |
|||
box-sizing: border-box; |
|||
} |
|||
|
|||
#app { |
|||
height: 100%; |
|||
} |
|||
|
|||
*, |
|||
*:before, |
|||
*:after { |
|||
box-sizing: inherit; |
|||
} |
|||
|
|||
.no-padding { |
|||
padding: 0px !important; |
|||
} |
|||
|
|||
.padding-content { |
|||
padding: 4px 0; |
|||
} |
|||
|
|||
a:focus, |
|||
a:active { |
|||
outline: none; |
|||
} |
|||
|
|||
a, |
|||
a:focus, |
|||
a:hover { |
|||
cursor: pointer; |
|||
color: inherit; |
|||
text-decoration: none; |
|||
} |
|||
|
|||
div:focus { |
|||
outline: none; |
|||
} |
|||
|
|||
.fr { |
|||
float: right; |
|||
} |
|||
|
|||
.fl { |
|||
float: left; |
|||
} |
|||
|
|||
.pr-5 { |
|||
padding-right: 5px; |
|||
} |
|||
|
|||
.pl-5 { |
|||
padding-left: 5px; |
|||
} |
|||
|
|||
.block { |
|||
display: block; |
|||
} |
|||
|
|||
.pointer { |
|||
cursor: pointer; |
|||
} |
|||
|
|||
.inlineBlock { |
|||
display: block; |
|||
} |
|||
|
|||
.clearfix { |
|||
&:after { |
|||
visibility: hidden; |
|||
display: block; |
|||
font-size: 0; |
|||
content: " "; |
|||
clear: both; |
|||
height: 0; |
|||
} |
|||
} |
|||
|
|||
aside { |
|||
background: #eef1f6; |
|||
padding: 8px 24px; |
|||
margin-bottom: 20px; |
|||
border-radius: 2px; |
|||
display: block; |
|||
line-height: 32px; |
|||
font-size: 16px; |
|||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif; |
|||
color: #2c3e50; |
|||
-webkit-font-smoothing: antialiased; |
|||
-moz-osx-font-smoothing: grayscale; |
|||
|
|||
a { |
|||
color: #337ab7; |
|||
cursor: pointer; |
|||
|
|||
&:hover { |
|||
color: rgb(32, 160, 255); |
|||
} |
|||
} |
|||
} |
|||
|
|||
//main-container全局样式 |
|||
.app-container { |
|||
padding: 20px; |
|||
} |
|||
|
|||
.components-container { |
|||
margin: 30px 50px; |
|||
position: relative; |
|||
} |
|||
|
|||
.pagination-container { |
|||
margin-top: 30px; |
|||
} |
|||
|
|||
.text-center { |
|||
text-align: center |
|||
} |
|||
|
|||
.sub-navbar { |
|||
height: 50px; |
|||
line-height: 50px; |
|||
position: relative; |
|||
width: 100%; |
|||
text-align: right; |
|||
padding-right: 20px; |
|||
transition: 600ms ease position; |
|||
background: linear-gradient(90deg, rgba(32, 182, 249, 1) 0%, rgba(32, 182, 249, 1) 0%, rgba(33, 120, 241, 1) 100%, rgba(33, 120, 241, 1) 100%); |
|||
|
|||
.subtitle { |
|||
font-size: 20px; |
|||
color: #fff; |
|||
} |
|||
|
|||
&.draft { |
|||
background: #d0d0d0; |
|||
} |
|||
|
|||
&.deleted { |
|||
background: #d0d0d0; |
|||
} |
|||
} |
|||
|
|||
.link-type, |
|||
.link-type:focus { |
|||
color: #337ab7; |
|||
cursor: pointer; |
|||
|
|||
&:hover { |
|||
color: rgb(32, 160, 255); |
|||
} |
|||
} |
|||
|
|||
.filter-container { |
|||
padding-bottom: 10px; |
|||
|
|||
.filter-item { |
|||
display: inline-block; |
|||
vertical-align: middle; |
|||
margin-bottom: 10px; |
|||
} |
|||
} |
|||
|
|||
//refine vue-multiselect plugin |
|||
.multiselect { |
|||
line-height: 16px; |
|||
} |
|||
|
|||
.multiselect--active { |
|||
z-index: 1000 !important; |
|||
} |
|||
|
@ -0,0 +1,120 @@ |
|||
<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="name"> |
|||
<el-input |
|||
v-model="queryParams.name" |
|||
placeholder="请输入表达式名称" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="状态" prop="status"> |
|||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable> |
|||
<el-option |
|||
v-for="dict in dict.type.sys_common_status" |
|||
:key="dict.value" |
|||
:label="dict.label" |
|||
:value="dict.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-table v-loading="loading" :data="expressionList" @current-change="handleSingleExpSelect"> |
|||
<el-table-column width="55" align="center" > |
|||
<template slot-scope="scope"> |
|||
<!-- 可以手动的修改label的值,从而控制选择哪一项 --> |
|||
<el-radio v-model="radioSelected" :label="scope.row.id"> </el-radio> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="主键" align="center" prop="id" /> |
|||
<el-table-column label="名称" align="center" prop="name" /> |
|||
<el-table-column label="表达式内容" align="center" prop="expression" /> |
|||
<el-table-column label="备注" align="center" prop="remark" /> |
|||
</el-table> |
|||
|
|||
<pagination |
|||
v-show="total>0" |
|||
:total="total" |
|||
:page-sizes="[5,10]" |
|||
:page.sync="queryParams.pageNum" |
|||
:limit.sync="queryParams.pageSize" |
|||
@pagination="getList" |
|||
/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { listExpression, getExpression, delExpression, addExpression, updateExpression } from "@/api/system/expression"; |
|||
|
|||
export default { |
|||
name: "Expression", |
|||
dicts: ['sys_common_status'], |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 流程达式表格数据 |
|||
expressionList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
name: null, |
|||
expression: null, |
|||
status: null, |
|||
}, |
|||
radioSelected:null |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
methods: { |
|||
/** 查询流程达式列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
listExpression(this.queryParams).then(response => { |
|||
this.expressionList = response.rows; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
this.queryParams.pageNum = 1; |
|||
this.getList(); |
|||
}, |
|||
/** 重置按钮操作 */ |
|||
resetQuery() { |
|||
this.resetForm("queryForm"); |
|||
this.handleQuery(); |
|||
}, |
|||
// 单选框选中数据 |
|||
handleSingleExpSelect(selection) { |
|||
this.radioSelected = selection.id;//点击当前行时,radio同样有选中效果 |
|||
// console.log( this.radioSelected ,"handleSingleExpSelect"); |
|||
this.$emit('handleSingleExpSelect',selection); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
@ -0,0 +1,200 @@ |
|||
<template> |
|||
<div class="app-container"> |
|||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> |
|||
<el-form-item label="角色名称" prop="roleName"> |
|||
<el-input |
|||
v-model="queryParams.roleName" |
|||
placeholder="请输入角色名称" |
|||
clearable |
|||
style="width: 240px" |
|||
@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-table v-if="selectType === 'multiple'" v-loading="loading" :data="roleList" @selection-change="handleMultipleRoleSelect"> |
|||
<el-table-column type="selection" width="50" align="center" /> |
|||
<el-table-column label="角色编号" prop="roleId" width="120" /> |
|||
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" /> |
|||
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" /> |
|||
<el-table-column label="显示顺序" prop="roleSort" width="100" /> |
|||
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.createTime) }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<el-table v-else v-loading="loading" :data="roleList" @current-change="handleSingleRoleSelect"> |
|||
<el-table-column width="55" align="center" > |
|||
<template slot-scope="scope"> |
|||
<!-- 可以手动的修改label的值,从而控制选择哪一项 --> |
|||
<el-radio v-model="radioSelected" :label="scope.row.roleId"> </el-radio> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="角色编号" prop="roleId" width="120" /> |
|||
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" /> |
|||
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" /> |
|||
<el-table-column label="显示顺序" prop="roleSort" width="100" /> |
|||
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
|||
<template slot-scope="scope"> |
|||
<span>{{ parseTime(scope.row.createTime) }}</span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<pagination |
|||
v-show="total>0" |
|||
:total="total" |
|||
:page-sizes="[5,10]" |
|||
:page.sync="queryParams.pageNum" |
|||
:limit.sync="queryParams.pageSize" |
|||
@pagination="getList" |
|||
/> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { listRole, getRole, delRole, addRole, updateRole, dataScope, changeRoleStatus, deptTreeSelect } from "@/api/system/role"; |
|||
import { treeselect as menuTreeselect, roleMenuTreeselect } from "@/api/system/menu"; |
|||
|
|||
export default { |
|||
name: "FlowRole", |
|||
dicts: ['sys_normal_disable'], |
|||
// 接受父组件的值 |
|||
props: { |
|||
checkType: String, |
|||
default: 'multiple', |
|||
required: false |
|||
}, |
|||
data() { |
|||
return { |
|||
selectType: this.checkType, |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 角色表格数据 |
|||
roleList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 是否显示弹出层(数据权限) |
|||
openDataScope: false, |
|||
menuExpand: false, |
|||
menuNodeAll: false, |
|||
deptExpand: true, |
|||
deptNodeAll: false, |
|||
// 日期范围 |
|||
dateRange: [], |
|||
// 数据范围选项 |
|||
dataScopeOptions: [ |
|||
{ |
|||
value: "1", |
|||
label: "全部数据权限" |
|||
}, |
|||
{ |
|||
value: "2", |
|||
label: "自定数据权限" |
|||
}, |
|||
{ |
|||
value: "3", |
|||
label: "本部门数据权限" |
|||
}, |
|||
{ |
|||
value: "4", |
|||
label: "本部门及以下数据权限" |
|||
}, |
|||
{ |
|||
value: "5", |
|||
label: "仅本人数据权限" |
|||
} |
|||
], |
|||
// 菜单列表 |
|||
menuOptions: [], |
|||
// 部门列表 |
|||
deptOptions: [], |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 5, |
|||
roleName: undefined, |
|||
roleKey: undefined, |
|||
status: undefined |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
defaultProps: { |
|||
children: "children", |
|||
label: "label" |
|||
}, |
|||
radioSelected:'' |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
methods: { |
|||
/** 查询角色列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
listRole(this.addDateRange(this.queryParams, this.dateRange)).then(response => { |
|||
this.roleList = response.rows; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
} |
|||
); |
|||
}, |
|||
// 多选框选中数据 |
|||
handleRoleSelect(selection) { |
|||
// this.ids = selection.map(item => item.userId); |
|||
this.radioSelected = selection.roleId;//点击当前行时,radio同样有选中效果 |
|||
console.log(selection,"handleRoleSelect"); |
|||
this.$emit('handleRoleSelect', selection); |
|||
|
|||
}, |
|||
// 多选框选中数据 |
|||
handleMultipleRoleSelect(selection) { |
|||
this.ids = selection.map(item => item.roleId); |
|||
const nameList = selection.map(item => item.roleName); |
|||
console.log( this.ids,"handleRoleSelect"); |
|||
this.$emit('handleRoleSelect',this.ids.join(','),nameList.join(',')); |
|||
}, |
|||
// 单选框选中数据 |
|||
handleSingleRoleSelect(selection) { |
|||
this.radioSelected = selection.roleId;//点击当前行时,radio同样有选中效果 |
|||
const name = selection.roleName;//点击当前行时,radio同样有选中效果 |
|||
console.log(this.radioSelected.toString() ,"handleRoleSelect"); |
|||
this.$emit('handleRoleSelect',this.radioSelected.toString(),name); |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
this.queryParams.pageNum = 1; |
|||
this.getList(); |
|||
}, |
|||
/** 重置按钮操作 */ |
|||
resetQuery() { |
|||
this.dateRange = []; |
|||
this.handleQuery(); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
<style> |
|||
/*隐藏radio展示的label及本身自带的样式*/ |
|||
.el-radio__label{ |
|||
display:none; |
|||
} |
|||
</style> |
@ -0,0 +1,235 @@ |
|||
<template> |
|||
<div> |
|||
<el-row :gutter="20"> |
|||
<!--部门数据--> |
|||
<el-col :span="6" :xs="24"> |
|||
<div class="head-container"> |
|||
<el-input |
|||
v-model="deptName" |
|||
placeholder="请输入部门名称" |
|||
clearable |
|||
size="small" |
|||
prefix-icon="el-icon-search" |
|||
style="margin-bottom: 20px" |
|||
/> |
|||
</div> |
|||
<div class="head-container"> |
|||
<el-tree |
|||
:data="deptOptions" |
|||
:props="defaultProps" |
|||
:expand-on-click-node="false" |
|||
:filter-node-method="filterNode" |
|||
ref="tree" |
|||
node-key="id" |
|||
default-expand-all |
|||
highlight-current |
|||
@node-click="handleNodeClick" |
|||
/> |
|||
</div> |
|||
</el-col> |
|||
<!--用户数据--> |
|||
<el-col :span="18" :xs="24"> |
|||
<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 |
|||
style="width: 240px" |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="手机号码" prop="phonenumber"> |
|||
<el-input |
|||
v-model="queryParams.phonenumber" |
|||
placeholder="请输入手机号码" |
|||
clearable |
|||
style="width: 240px" |
|||
@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-table v-if="selectType === 'multiple'" v-loading="loading" :data="userList" @selection-change="handleMultipleUserSelect"> |
|||
<el-table-column type="selection" width="50" align="center" /> |
|||
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> |
|||
<el-table-column label="登录账号" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" /> |
|||
<el-table-column label="用户姓名" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" /> |
|||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" /> |
|||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|||
</el-table> |
|||
<el-table v-else v-loading="loading" :data="userList" @current-change="handleSingleUserSelect"> |
|||
<el-table-column width="55" align="center" > |
|||
<template slot-scope="scope"> |
|||
<el-radio v-model="radioSelected" :label="scope.row.userId"> </el-radio> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> |
|||
<el-table-column label="登录账号" align="center" key="userName" prop="userName" v-if="columns[1].visible" :show-overflow-tooltip="true" /> |
|||
<el-table-column label="用户姓名" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" :show-overflow-tooltip="true" /> |
|||
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" :show-overflow-tooltip="true" /> |
|||
<el-table-column label="手机号码" align="center" key="phonenumber" prop="phonenumber" v-if="columns[4].visible" width="120" /> |
|||
</el-table> |
|||
<pagination |
|||
v-show="total>0" |
|||
:total="total" |
|||
:page-sizes="[5,10]" |
|||
:page.sync="queryParams.pageNum" |
|||
:limit.sync="queryParams.pageSize" |
|||
@pagination="getList" |
|||
/> |
|||
</el-col> |
|||
</el-row> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { listUser, deptTreeSelect } from "@/api/system/user"; |
|||
import Treeselect from "@riophae/vue-treeselect"; |
|||
import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
|||
|
|||
export default { |
|||
name: "FlowUser", |
|||
dicts: ['sys_normal_disable', 'sys_user_sex'], |
|||
components: { Treeselect }, |
|||
// 接受父组件的值 |
|||
props: { |
|||
checkType: String, |
|||
default: 'multiple', |
|||
required: false |
|||
}, |
|||
data() { |
|||
return { |
|||
selectType: this.checkType, |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 用户表格数据 |
|||
userList: null, |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 部门树选项 |
|||
deptOptions: undefined, |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 部门名称 |
|||
deptName: undefined, |
|||
// 默认密码 |
|||
initPassword: undefined, |
|||
// 日期范围 |
|||
dateRange: [], |
|||
// 岗位选项 |
|||
postOptions: [], |
|||
// 角色选项 |
|||
roleOptions: [], |
|||
// 表单参数 |
|||
form: {}, |
|||
defaultProps: { |
|||
children: "children", |
|||
label: "label" |
|||
}, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 5, |
|||
userName: undefined, |
|||
phonenumber: undefined, |
|||
status: undefined, |
|||
deptId: undefined |
|||
}, |
|||
// 列信息 |
|||
columns: [ |
|||
{ key: 0, label: `用户编号`, visible: true }, |
|||
{ key: 1, label: `用户名称`, visible: true }, |
|||
{ key: 2, label: `用户昵称`, visible: true }, |
|||
{ key: 3, label: `部门`, visible: true }, |
|||
{ key: 4, label: `手机号码`, visible: true }, |
|||
{ key: 5, label: `状态`, visible: true }, |
|||
{ key: 6, label: `创建时间`, visible: true } |
|||
], |
|||
radioSelected:null |
|||
}; |
|||
}, |
|||
watch: { |
|||
// 根据名称筛选部门树 |
|||
deptName(val) { |
|||
this.$refs.tree.filter(val); |
|||
} |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
this.getDeptTree(); |
|||
this.getConfigKey("sys.user.initPassword").then(response => { |
|||
this.initPassword = response.msg; |
|||
}); |
|||
}, |
|||
methods: { |
|||
/** 查询用户列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
listUser(this.addDateRange(this.queryParams, this.dateRange)).then(response => { |
|||
this.userList = response.rows; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
} |
|||
); |
|||
}, |
|||
/** 查询部门下拉树结构 */ |
|||
getDeptTree() { |
|||
deptTreeSelect().then(response => { |
|||
this.deptOptions = response.data; |
|||
}); |
|||
}, |
|||
// 筛选节点 |
|||
filterNode(value, data) { |
|||
if (!value) return true; |
|||
return data.label.indexOf(value) !== -1; |
|||
}, |
|||
// 节点单击事件 |
|||
handleNodeClick(data) { |
|||
this.queryParams.deptId = data.id; |
|||
this.handleQuery(); |
|||
}, |
|||
// 多选框选中数据 |
|||
handleMultipleUserSelect(selection) { |
|||
this.$emit('handleUserSelect', selection); |
|||
}, |
|||
// 单选框选中数据 |
|||
handleSingleUserSelect(selection) { |
|||
this.radioSelected = selection.userId;//点击当前行时,radio同样有选中效果 |
|||
this.$emit('handleUserSelect', selection.toString()); |
|||
}, |
|||
/** 搜索按钮操作 */ |
|||
handleQuery() { |
|||
this.queryParams.pageNum = 1; |
|||
this.getList(); |
|||
}, |
|||
/** 重置按钮操作 */ |
|||
resetQuery() { |
|||
this.dateRange = []; |
|||
this.resetForm("queryForm"); |
|||
this.queryParams.deptId = undefined; |
|||
this.$refs.tree.setCurrentKey(null); |
|||
this.handleQuery(); |
|||
}, |
|||
} |
|||
}; |
|||
</script> |
|||
<style> |
|||
/*隐藏radio展示的label及本身自带的样式*/ |
|||
.el-radio__label{ |
|||
display:none; |
|||
} |
|||
</style> |
@ -0,0 +1,282 @@ |
|||
<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="name"> |
|||
<el-input |
|||
v-model="queryParams.name" |
|||
placeholder="请输入表达式名称" |
|||
clearable |
|||
@keyup.enter.native="handleQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item label="状态" prop="status"> |
|||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable> |
|||
<el-option |
|||
v-for="dict in dict.type.sys_common_status" |
|||
:key="dict.value" |
|||
:label="dict.label" |
|||
:value="dict.value" |
|||
/> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> |
|||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<el-row :gutter="10" class="mb8"> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="primary" |
|||
plain |
|||
icon="el-icon-plus" |
|||
size="mini" |
|||
@click="handleAdd" |
|||
v-hasPermi="['system:expression:add']" |
|||
>新增</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="success" |
|||
plain |
|||
icon="el-icon-edit" |
|||
size="mini" |
|||
:disabled="single" |
|||
@click="handleUpdate" |
|||
v-hasPermi="['system:expression:edit']" |
|||
>修改</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="danger" |
|||
plain |
|||
icon="el-icon-delete" |
|||
size="mini" |
|||
:disabled="multiple" |
|||
@click="handleDelete" |
|||
v-hasPermi="['system:expression:remove']" |
|||
>删除</el-button> |
|||
</el-col> |
|||
<el-col :span="1.5"> |
|||
<el-button |
|||
type="warning" |
|||
plain |
|||
icon="el-icon-download" |
|||
size="mini" |
|||
@click="handleExport" |
|||
v-hasPermi="['system:expression:export']" |
|||
>导出</el-button> |
|||
</el-col> |
|||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
|||
</el-row> |
|||
|
|||
<el-table v-loading="loading" :data="expressionList" @selection-change="handleSelectionChange"> |
|||
<el-table-column type="selection" width="55" align="center" /> |
|||
<el-table-column label="主键" align="center" prop="id" /> |
|||
<el-table-column label="名称" align="center" prop="name" /> |
|||
<el-table-column label="表达式内容" align="center" prop="expression" /> |
|||
<el-table-column label="备注" align="center" prop="remark" /> |
|||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-edit" |
|||
@click="handleUpdate(scope.row)" |
|||
v-hasPermi="['system:expression:edit']" |
|||
>修改</el-button> |
|||
<el-button |
|||
size="mini" |
|||
type="text" |
|||
icon="el-icon-delete" |
|||
@click="handleDelete(scope.row)" |
|||
v-hasPermi="['system:expression: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="name"> |
|||
<el-input v-model="form.name" placeholder="请输入表达式名称" /> |
|||
</el-form-item> |
|||
<el-form-item label="内容" prop="expression"> |
|||
<el-input v-model="form.expression" placeholder="请输入表达式内容" /> |
|||
</el-form-item> |
|||
<el-form-item label="状态" prop="status"> |
|||
<el-radio-group v-model="form.status"> |
|||
<el-radio |
|||
v-for="dict in dict.type.sys_common_status" |
|||
:key="dict.value" |
|||
:label="parseInt(dict.value)" |
|||
>{{dict.label}}</el-radio> |
|||
</el-radio-group> |
|||
</el-form-item> |
|||
<el-form-item label="备注" prop="remark"> |
|||
<el-input v-model="form.remark" 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 { listExpression, getExpression, delExpression, addExpression, updateExpression } from "@/api/system/expression"; |
|||
|
|||
export default { |
|||
name: "FlowExp", |
|||
dicts: ['sys_common_status'], |
|||
data() { |
|||
return { |
|||
// 遮罩层 |
|||
loading: true, |
|||
// 选中数组 |
|||
ids: [], |
|||
// 非单个禁用 |
|||
single: true, |
|||
// 非多个禁用 |
|||
multiple: true, |
|||
// 显示搜索条件 |
|||
showSearch: true, |
|||
// 总条数 |
|||
total: 0, |
|||
// 流程达式表格数据 |
|||
expressionList: [], |
|||
// 弹出层标题 |
|||
title: "", |
|||
// 是否显示弹出层 |
|||
open: false, |
|||
// 查询参数 |
|||
queryParams: { |
|||
pageNum: 1, |
|||
pageSize: 10, |
|||
name: null, |
|||
expression: null, |
|||
status: null, |
|||
}, |
|||
// 表单参数 |
|||
form: {}, |
|||
// 表单校验 |
|||
rules: { |
|||
} |
|||
}; |
|||
}, |
|||
created() { |
|||
this.getList(); |
|||
}, |
|||
methods: { |
|||
/** 查询流程达式列表 */ |
|||
getList() { |
|||
this.loading = true; |
|||
listExpression(this.queryParams).then(response => { |
|||
this.expressionList = response.rows; |
|||
this.total = response.total; |
|||
this.loading = false; |
|||
}); |
|||
}, |
|||
// 取消按钮 |
|||
cancel() { |
|||
this.open = false; |
|||
this.reset(); |
|||
}, |
|||
// 表单重置 |
|||
reset() { |
|||
this.form = { |
|||
id: null, |
|||
name: null, |
|||
expression: null, |
|||
createTime: null, |
|||
updateTime: null, |
|||
createBy: null, |
|||
updateBy: null, |
|||
status: null, |
|||
remark: 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 |
|||
getExpression(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) { |
|||
updateExpression(this.form).then(response => { |
|||
this.$modal.msgSuccess("修改成功"); |
|||
this.open = false; |
|||
this.getList(); |
|||
}); |
|||
} else { |
|||
addExpression(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 delExpression(ids); |
|||
}).then(() => { |
|||
this.getList(); |
|||
this.$modal.msgSuccess("删除成功"); |
|||
}).catch(() => {}); |
|||
}, |
|||
/** 导出按钮操作 */ |
|||
handleExport() { |
|||
this.download('system/expression/export', { |
|||
...this.queryParams |
|||
}, `expression_${new Date().getTime()}.xlsx`) |
|||
} |
|||
} |
|||
}; |
|||
</script> |
Loading…
Reference in new issue