Compare commits

...

2 Commits

Author SHA1 Message Date
姜玉琦 04c7450903 提交代码 2024-02-24 14:09:05 +08:00
姜玉琦 238fa041ca 提交代码 2024-02-24 14:05:13 +08:00
18 changed files with 1129 additions and 80 deletions

View File

@ -77,7 +77,7 @@ public class FlowDefinitionController extends BaseController {
InputStream in = null;
try {
in = file.getInputStream();
flowDefinitionService.importFile(name, category, in);
flowDefinitionService.importFile(name, category, null , in);
} catch (Exception e) {
log.error("导入失败:", e);
return AjaxResult.success(e.getMessage());
@ -102,7 +102,6 @@ public class FlowDefinitionController extends BaseController {
} catch (Exception e) {
return AjaxResult.error("加载xml文件异常");
}
}
@ApiOperation(value = "读取图片文件")
@ -129,7 +128,6 @@ public class FlowDefinitionController extends BaseController {
e.printStackTrace();
}
}
}
@ApiOperation(value = "保存流程设计器内的xml文件")
@ -138,7 +136,7 @@ public class FlowDefinitionController extends BaseController {
InputStream in = null;
try {
in = new ByteArrayInputStream(vo.getXml().getBytes(StandardCharsets.UTF_8));
flowDefinitionService.importFile(vo.getName(), vo.getCategory(), in);
flowDefinitionService.importFile(vo.getName(), vo.getCategory(), vo.getOwnerDeptId(), in);
} catch (Exception e) {
log.error("导入失败:", e);
return AjaxResult.error(e.getMessage());
@ -151,7 +149,6 @@ public class FlowDefinitionController extends BaseController {
log.error("关闭输入流出错", e);
}
}
return AjaxResult.success("导入成功");
}

View File

@ -21,6 +21,11 @@ public class FlowSaveXmlVo implements Serializable {
*/
private String category;
/**
*
*/
private String ownerDeptId;
/**
* xml
*/

View File

@ -33,7 +33,7 @@ public interface IFlowDefinitionService {
* @param category
* @param in
*/
void importFile(String name, String category, InputStream in);
void importFile(String name, String category, String OwnerDeptId, InputStream in);
/**
* xml

View File

@ -3,10 +3,13 @@ package com.yanzhu.flowable.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.yanzhu.common.core.text.Convert;
import com.yanzhu.common.utils.StringUtils;
import com.yanzhu.flowable.common.constant.ProcessConstants;
import com.yanzhu.common.core.domain.AjaxResult;
import com.yanzhu.common.core.domain.entity.SysUser;
import com.yanzhu.common.utils.SecurityUtils;
import com.yanzhu.system.domain.flowable.FlowDeptVo;
import com.yanzhu.system.domain.flowable.FlowQueryVo;
import com.yanzhu.system.domain.FlowProcDefDto;
import com.yanzhu.flowable.factory.FlowServiceFactory;
@ -98,16 +101,31 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
*
* key1使key
* key1key
* @param name
* @param category
* @param in
* @param name
* @param category
* @param OwnerDeptId
* @param in
*/
@Override
public void importFile(String name, String category, InputStream in) {
public void importFile(String name, String category, String OwnerDeptId, InputStream in) {
Deployment deploy = repositoryService.createDeployment().addInputStream(name + BPMN_FILE_SUFFIX, in).name(name).category(category).deploy();
ProcessDefinition definition = repositoryService.createProcessDefinitionQuery().deploymentId(deploy.getId()).singleResult();
repositoryService.setProcessDefinitionCategory(definition.getId(), category);
/**新增流程单位关系**/
FlowDeptVo flowDeptVo = new FlowDeptVo();
flowDeptVo.setProcdefId(definition.getId());
//超管能为
if(SecurityUtils.isAdmin(SecurityUtils.getUserId())){
if(StringUtils.isNotEmpty(OwnerDeptId)){
// OwnerDeptId转换Long失败...默认返回null
flowDeptVo.setDeptId(Convert.toLong(OwnerDeptId));
}
}else{
// 从部门祖籍列表中获取项目单位信息...
Long projectDeptId = Convert.toLong(SecurityUtils.getLoginUser().getUser().getDept().getAncestors().split(",")[2]);
flowDeptVo.setDeptId(projectDeptId);
}
flowDeployMapper.insertActReProcdefDept(flowDeptVo);
}
/**

View File

@ -0,0 +1,104 @@
package com.yanzhu.base.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.yanzhu.common.annotation.Log;
import com.yanzhu.common.core.controller.BaseController;
import com.yanzhu.common.core.domain.AjaxResult;
import com.yanzhu.common.enums.BusinessType;
import com.yanzhu.base.domain.BaseAssetsType;
import com.yanzhu.base.service.IBaseAssetsTypeService;
import com.yanzhu.common.utils.poi.ExcelUtil;
import com.yanzhu.common.core.page.TableDataInfo;
/**
* Controller
*
* @author yanZhu
* @date 2024-02-24
*/
@RestController
@RequestMapping("/base/assetsType")
public class BaseAssetsTypeController extends BaseController
{
@Autowired
private IBaseAssetsTypeService baseAssetsTypeService;
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:assetsType:list')")
@GetMapping("/list")
public TableDataInfo list(BaseAssetsType baseAssetsType)
{
startPage();
List<BaseAssetsType> list = baseAssetsTypeService.selectBaseAssetsTypeList(baseAssetsType);
return getDataTable(list);
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:assetsType:export')")
@Log(title = "物资类型", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, BaseAssetsType baseAssetsType)
{
List<BaseAssetsType> list = baseAssetsTypeService.selectBaseAssetsTypeList(baseAssetsType);
ExcelUtil<BaseAssetsType> util = new ExcelUtil<BaseAssetsType>(BaseAssetsType.class);
util.exportExcel(response, list, "物资类型数据");
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:assetsType:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(baseAssetsTypeService.selectBaseAssetsTypeById(id));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:assetsType:add')")
@Log(title = "物资类型", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody BaseAssetsType baseAssetsType)
{
return toAjax(baseAssetsTypeService.insertBaseAssetsType(baseAssetsType));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:assetsType:edit')")
@Log(title = "物资类型", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody BaseAssetsType baseAssetsType)
{
return toAjax(baseAssetsTypeService.updateBaseAssetsType(baseAssetsType));
}
/**
*
*/
@PreAuthorize("@ss.hasPermi('base:assetsType:remove')")
@Log(title = "物资类型", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(baseAssetsTypeService.deleteBaseAssetsTypeByIds(ids));
}
}

View File

@ -0,0 +1,126 @@
package com.yanzhu.base.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.yanzhu.common.annotation.Excel;
import com.yanzhu.common.core.domain.BaseEntity;
/**
* base_assets_type
*
* @author yanZhu
* @date 2024-02-24
*/
public class BaseAssetsType extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
private Long id;
/** 父级分类 */
@Excel(name = "父级分类")
private Long parentId;
/** 单位主键 */
@Excel(name = "单位主键")
private Long deptId;
/** 资产类型 */
@Excel(name = "资产类型")
private String type;
/** 资产名称 */
@Excel(name = "资产名称")
private String name;
/** 资产单位 */
@Excel(name = "资产单位")
private String unit;
/** 是否删除 */
@Excel(name = "是否删除")
private String isDel;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setParentId(Long parentId)
{
this.parentId = parentId;
}
public Long getParentId()
{
return parentId;
}
public void setDeptId(Long deptId)
{
this.deptId = deptId;
}
public Long getDeptId()
{
return deptId;
}
public void setType(String type)
{
this.type = type;
}
public String getType()
{
return type;
}
public void setName(String name)
{
this.name = name;
}
public String getName()
{
return name;
}
public void setUnit(String unit)
{
this.unit = unit;
}
public String getUnit()
{
return unit;
}
public void setIsDel(String isDel)
{
this.isDel = isDel;
}
public String getIsDel()
{
return isDel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("parentId", getParentId())
.append("deptId", getDeptId())
.append("type", getType())
.append("name", getName())
.append("unit", getUnit())
.append("isDel", getIsDel())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("remark", getRemark())
.toString();
}
}

View File

@ -0,0 +1,61 @@
package com.yanzhu.base.mapper;
import java.util.List;
import com.yanzhu.base.domain.BaseAssetsType;
/**
* Mapper
*
* @author yanZhu
* @date 2024-02-24
*/
public interface BaseAssetsTypeMapper
{
/**
*
*
* @param id
* @return
*/
public BaseAssetsType selectBaseAssetsTypeById(Long id);
/**
*
*
* @param baseAssetsType
* @return
*/
public List<BaseAssetsType> selectBaseAssetsTypeList(BaseAssetsType baseAssetsType);
/**
*
*
* @param baseAssetsType
* @return
*/
public int insertBaseAssetsType(BaseAssetsType baseAssetsType);
/**
*
*
* @param baseAssetsType
* @return
*/
public int updateBaseAssetsType(BaseAssetsType baseAssetsType);
/**
*
*
* @param id
* @return
*/
public int deleteBaseAssetsTypeById(Long id);
/**
*
*
* @param ids
* @return
*/
public int deleteBaseAssetsTypeByIds(Long[] ids);
}

View File

@ -0,0 +1,61 @@
package com.yanzhu.base.service;
import java.util.List;
import com.yanzhu.base.domain.BaseAssetsType;
/**
* Service
*
* @author yanZhu
* @date 2024-02-24
*/
public interface IBaseAssetsTypeService
{
/**
*
*
* @param id
* @return
*/
public BaseAssetsType selectBaseAssetsTypeById(Long id);
/**
*
*
* @param baseAssetsType
* @return
*/
public List<BaseAssetsType> selectBaseAssetsTypeList(BaseAssetsType baseAssetsType);
/**
*
*
* @param baseAssetsType
* @return
*/
public int insertBaseAssetsType(BaseAssetsType baseAssetsType);
/**
*
*
* @param baseAssetsType
* @return
*/
public int updateBaseAssetsType(BaseAssetsType baseAssetsType);
/**
*
*
* @param ids
* @return
*/
public int deleteBaseAssetsTypeByIds(Long[] ids);
/**
*
*
* @param id
* @return
*/
public int deleteBaseAssetsTypeById(Long id);
}

View File

@ -0,0 +1,96 @@
package com.yanzhu.base.service.impl;
import java.util.List;
import com.yanzhu.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanzhu.base.mapper.BaseAssetsTypeMapper;
import com.yanzhu.base.domain.BaseAssetsType;
import com.yanzhu.base.service.IBaseAssetsTypeService;
/**
* Service
*
* @author yanZhu
* @date 2024-02-24
*/
@Service
public class BaseAssetsTypeServiceImpl implements IBaseAssetsTypeService
{
@Autowired
private BaseAssetsTypeMapper baseAssetsTypeMapper;
/**
*
*
* @param id
* @return
*/
@Override
public BaseAssetsType selectBaseAssetsTypeById(Long id)
{
return baseAssetsTypeMapper.selectBaseAssetsTypeById(id);
}
/**
*
*
* @param baseAssetsType
* @return
*/
@Override
public List<BaseAssetsType> selectBaseAssetsTypeList(BaseAssetsType baseAssetsType)
{
return baseAssetsTypeMapper.selectBaseAssetsTypeList(baseAssetsType);
}
/**
*
*
* @param baseAssetsType
* @return
*/
@Override
public int insertBaseAssetsType(BaseAssetsType baseAssetsType)
{
baseAssetsType.setCreateTime(DateUtils.getNowDate());
return baseAssetsTypeMapper.insertBaseAssetsType(baseAssetsType);
}
/**
*
*
* @param baseAssetsType
* @return
*/
@Override
public int updateBaseAssetsType(BaseAssetsType baseAssetsType)
{
baseAssetsType.setUpdateTime(DateUtils.getNowDate());
return baseAssetsTypeMapper.updateBaseAssetsType(baseAssetsType);
}
/**
*
*
* @param ids
* @return
*/
@Override
public int deleteBaseAssetsTypeByIds(Long[] ids)
{
return baseAssetsTypeMapper.deleteBaseAssetsTypeByIds(ids);
}
/**
*
*
* @param id
* @return
*/
@Override
public int deleteBaseAssetsTypeById(Long id)
{
return baseAssetsTypeMapper.deleteBaseAssetsTypeById(id);
}
}

View File

@ -0,0 +1,103 @@
<?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.yanzhu.base.mapper.BaseAssetsTypeMapper">
<resultMap type="BaseAssetsType" id="BaseAssetsTypeResult">
<result property="id" column="id" />
<result property="parentId" column="parent_id" />
<result property="deptId" column="dept_id" />
<result property="type" column="type" />
<result property="name" column="name" />
<result property="unit" column="unit" />
<result property="isDel" column="is_del" />
<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="selectBaseAssetsTypeVo">
select id, parent_id, dept_id, type, name, unit, is_del, create_by, create_time, update_by, update_time, remark from base_assets_type
</sql>
<select id="selectBaseAssetsTypeList" parameterType="BaseAssetsType" resultMap="BaseAssetsTypeResult">
<include refid="selectBaseAssetsTypeVo"/>
<where>
<if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="type != null and type != ''"> and type = #{type}</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="unit != null and unit != ''"> and unit = #{unit}</if>
<if test="isDel != null and isDel != ''"> and is_del = #{isDel}</if>
</where>
</select>
<select id="selectBaseAssetsTypeById" parameterType="Long" resultMap="BaseAssetsTypeResult">
<include refid="selectBaseAssetsTypeVo"/>
where id = #{id}
</select>
<insert id="insertBaseAssetsType" parameterType="BaseAssetsType">
insert into base_assets_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="parentId != null">parent_id,</if>
<if test="deptId != null">dept_id,</if>
<if test="type != null">type,</if>
<if test="name != null">name,</if>
<if test="unit != null">unit,</if>
<if test="isDel != null">is_del,</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="id != null">#{id},</if>
<if test="parentId != null">#{parentId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="type != null">#{type},</if>
<if test="name != null">#{name},</if>
<if test="unit != null">#{unit},</if>
<if test="isDel != null">#{isDel},</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="updateBaseAssetsType" parameterType="BaseAssetsType">
update base_assets_type
<trim prefix="SET" suffixOverrides=",">
<if test="parentId != null">parent_id = #{parentId},</if>
<if test="deptId != null">dept_id = #{deptId},</if>
<if test="type != null">type = #{type},</if>
<if test="name != null">name = #{name},</if>
<if test="unit != null">unit = #{unit},</if>
<if test="isDel != null">is_del = #{isDel},</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 id = #{id}
</update>
<delete id="deleteBaseAssetsTypeById" parameterType="Long">
delete from base_assets_type where id = #{id}
</delete>
<delete id="deleteBaseAssetsTypeByIds" parameterType="String">
delete from base_assets_type where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,39 @@
package com.yanzhu.system.domain.flowable;
import com.yanzhu.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* <p><p>
*
* @author JiangYuQi
* @date 2024-02-23
*/
@Data
@ApiModel("工作流项目单位关系")
public class FlowDeptVo extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 流程定义主键 */
private String procdefId;
/** 流程定义单位 */
private Long deptId;
/** 流程定义排序 */
private String sort;
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("procdefId", getProcdefId())
.append("deptId", getDeptId())
.append("sort", getSort())
.toString();
}
}

View File

@ -1,6 +1,7 @@
package com.yanzhu.system.mapper;
import com.yanzhu.system.domain.FlowProcDefDto;
import com.yanzhu.system.domain.flowable.FlowDeptVo;
import com.yanzhu.system.domain.flowable.FlowQueryVo;
import org.apache.ibatis.annotations.Param;
@ -21,4 +22,12 @@ public interface FlowDeployMapper {
* @return
*/
List<FlowProcDefDto> selectDeployList(FlowQueryVo flowQueryVo);
/**
*
*
* @param flowDeptVo
* @return
*/
public int insertActReProcdefDept(FlowDeptVo flowDeptVo);
}

View File

@ -38,5 +38,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<!--新增单位流程关系-->
<insert id="insertActReProcdefDept" parameterType="com.yanzhu.system.domain.flowable.FlowDeptVo">
insert into act_re_procdef_dept
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="procdefId != null">PROCDEF_ID_,</if>
<if test="deptId != null">DEPT_ID_,</if>
<if test="sort != null">SORT_,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="procdefId != null">#{procdefId},</if>
<if test="deptId != null">#{deptId},</if>
<if test="sort != null">#{sort},</if>
</trim>
</insert>
</mapper>

View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询物资类型列表
export function listAssetsType(query) {
return request({
url: '/base/assetsType/list',
method: 'get',
params: query
})
}
// 查询物资类型详细
export function getAssetsType(id) {
return request({
url: '/base/assetsType/' + id,
method: 'get'
})
}
// 新增物资类型
export function addAssetsType(data) {
return request({
url: '/base/assetsType',
method: 'post',
data: data
})
}
// 修改物资类型
export function updateAssetsType(data) {
return request({
url: '/base/assetsType',
method: 'put',
data: data
})
}
// 删除物资类型
export function delAssetsType(id) {
return request({
url: '/base/assetsType/' + id,
method: 'delete'
})
}

View File

@ -3,7 +3,9 @@
<x-form ref="xForm" v-model="formData" :config="formConfig">
<template #executionListener>
<el-badge :value="executionListenerLength">
<el-button size="small" @click="dialogName = 'executionListenerDialog'">编辑</el-button>
<el-button size="small" @click="dialogName = 'executionListenerDialog'"
>编辑</el-button
>
</el-badge>
</template>
<template #signal>
@ -28,86 +30,104 @@
</template>
<script>
import mixinPanel from '../../common/mixinPanel'
import mixinExecutionListener from '../../common/mixinExecutionListener'
import signalDialog from './property/signal'
import { commonParse } from '../../common/parseElement'
import mixinPanel from "../../common/mixinPanel";
import mixinExecutionListener from "../../common/mixinExecutionListener";
import signalDialog from "./property/signal";
import { commonParse } from "../../common/parseElement";
export default {
components: {
signalDialog
signalDialog,
},
mixins: [mixinPanel, mixinExecutionListener],
data() {
return {
signalLength: 0,
formData: {}
}
formData: {},
xmlOption: [
{
xType: "input",
name: "id",
label: "流程标识key",
rules: [{ required: true, message: "Id 不能为空" }],
},
{
xType: "input",
name: "name",
label: "流程名称",
},
{
xType: "input",
name: "documentation",
label: "节点描述",
},
{
xType: "slot",
name: "executionListener",
label: "执行监听器",
},
{
xType: "slot",
name: "signal",
label: "信号定义",
},
],
};
},
computed: {
formConfig() {
const _this = this
const _this = this;
// ...
if (_this.categorys.length > 0) {
let category = {
xType: "select",
name: "processCategory",
label: "流程分类",
rules: [{ required: true, message: "流程类型不能为空" }],
dic: { data: _this.categorys, label: "dictLabel", value: "dictValue" },
};
_this.xmlOption.unshift(category);
// &&
if (_this.$store.getters.userId == 1) {
console.log("我是超管...{}");
_this.xmlOption.unshift({
xType: "input",
name: "ownerDeptId",
label: "所属项目主键",
});
}
}
return {
inline: false,
item: [
{
xType: 'select',
name: 'processCategory',
label: '流程分类',
dic: { data: _this.categorys, label: 'dictLabel', value: 'dictValue' }
},
{
xType: 'input',
name: 'id',
label: '流程标识key',
rules: [{ required: true, message: 'Id 不能为空' }]
},
{
xType: 'input',
name: 'name',
label: '流程名称'
},
{
xType: 'input',
name: 'documentation',
label: '节点描述'
},
{
xType: 'slot',
name: 'executionListener',
label: '执行监听器'
},
{
xType: 'slot',
name: 'signal',
label: '信号定义'
}
]
}
}
item: _this.xmlOption,
};
},
},
watch: {
'formData.processCategory': function(val) {
if (val === '') val = null
this.updateProperties({ 'flowable:processCategory': val })
}
"formData.processCategory": function (val) {
if (val === "") val = null;
this.updateProperties({ "flowable:processCategory": val });
},
},
created() {
this.formData = commonParse(this.element)
this.formData = commonParse(this.element);
},
methods: {
computedSignalLength() {
this.signalLength = this.element.businessObject.extensionElements?.values?.length ?? 0
this.signalLength =
this.element.businessObject.extensionElements?.values?.length ?? 0;
},
finishSignal() {
if (this.dialogName === 'signalDialog') {
this.computedSignalLength()
if (this.dialogName === "signalDialog") {
this.computedSignalLength();
}
this.dialogName = ''
}
}
}
this.dialogName = "";
},
},
};
</script>
<style>
.bjs-powered-by {
display: none !important;
}
</style>

View File

@ -7,6 +7,7 @@ const getters = {
cachedViews: state => state.tagsView.cachedViews,
token: state => state.user.token,
avatar: state => state.user.avatar,
userId: state => state.user.id,
name: state => state.user.name,
introduction: state => state.user.introduction,
roles: state => state.user.roles,

View File

@ -0,0 +1,327 @@
<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="parentId">
<el-input
v-model="queryParams.parentId"
placeholder="请输入父级分类"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单位主键" prop="deptId">
<el-input
v-model="queryParams.deptId"
placeholder="请输入单位主键"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<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="unit">
<el-input
v-model="queryParams.unit"
placeholder="请输入资产单位"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="是否删除" prop="isDel">
<el-select v-model="queryParams.isDel" placeholder="请选择是否删除" clearable>
<el-option
v-for="dict in dict.type.sys_is_del"
: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="['base:assetsType: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="['base:assetsType: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="['base:assetsType: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="['base:assetsType:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="assetsTypeList" @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="parentId" />
<el-table-column label="单位主键" align="center" prop="deptId" />
<el-table-column label="资产类型" align="center" prop="type" />
<el-table-column label="资产名称" align="center" prop="name" />
<el-table-column label="资产单位" align="center" prop="unit" />
<el-table-column label="是否删除" align="center" prop="isDel">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_is_del" :value="scope.row.isDel"/>
</template>
</el-table-column>
<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="['base:assetsType:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['base:assetsType: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="parentId">
<el-input v-model="form.parentId" placeholder="请输入父级分类" />
</el-form-item>
<el-form-item label="单位主键" prop="deptId">
<el-input v-model="form.deptId" placeholder="请输入单位主键" />
</el-form-item>
<el-form-item label="资产名称" prop="name">
<el-input v-model="form.name" placeholder="请输入资产名称" />
</el-form-item>
<el-form-item label="资产单位" prop="unit">
<el-input v-model="form.unit" placeholder="请输入资产单位" />
</el-form-item>
<el-form-item label="是否删除" prop="isDel">
<el-select v-model="form.isDel" placeholder="请选择是否删除">
<el-option
v-for="dict in dict.type.sys_is_del"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</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 { listAssetsType, getAssetsType, delAssetsType, addAssetsType, updateAssetsType } from "@/api/base/assetsType";
export default {
name: "AssetsType",
dicts: ['sys_is_del'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
assetsTypeList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
parentId: null,
deptId: null,
type: null,
name: null,
unit: null,
isDel: null,
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询物资类型列表 */
getList() {
this.loading = true;
listAssetsType(this.queryParams).then(response => {
this.assetsTypeList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
parentId: null,
deptId: null,
type: null,
name: null,
unit: null,
isDel: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: 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
getAssetsType(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) {
updateAssetsType(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addAssetsType(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 delAssetsType(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('base/assetsType/export', {
...this.queryParams
}, `assetsType_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@ -1,16 +1,40 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="name">
<el-form-item label="流程名称" prop="name">
<el-input
v-model="queryParams.name"
placeholder="请输入名称"
placeholder="请输入流程名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开始时间" prop="deployTime">
<el-form-item label="项目名称" prop="deptName">
<el-input
v-model="queryParams.deptName"
placeholder="请输入项目名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="流程类型" prop="category">
<el-select
v-model="queryParams.category"
@keyup.enter.native="handleQuery"
placeholder="请选择流程类型"
clearable
>
<el-option
v-for="dict in dict.type.sys_process_category"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="开始时间" prop="deployTime" v-if="false">
<el-date-picker clearable size="small"
v-model="queryParams.deployTime"
type="date"
@ -77,12 +101,11 @@
</el-button>
</template>
</el-table-column>
<el-table-column label="业务表单" align="center" :show-overflow-tooltip="true">
<el-table-column label="项目名称" align="center" :show-overflow-tooltip="true">
<template slot-scope="scope">
<el-button v-if="scope.row.formId" type="text" @click="handleForm(scope.row.formId)">
<span>{{ scope.row.formName }}</span>
</el-button>
<label v-else></label>
<!-- @click="handleForm(scope.row.formId)" -->
<el-tag type="info" v-if="scope.row.deptId">{{ scope.row.deptName }}</el-tag>
<el-tag>缺省工作流</el-tag>
</template>
</el-table-column>
<el-table-column label="流程版本" align="center">
@ -100,10 +123,10 @@
<el-table-column label="操作" width="250" fixed="right"class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button @click="handleLoadXml(scope.row)" icon="el-icon-edit-outline" type="text" size="small">设计</el-button>
<el-button @click="handleAddForm(scope.row)" icon="el-icon-edit-el-icon-s-promotion" type="text" size="small" v-if="scope.row.formId == null"></el-button>
<!-- <el-button @click="handleAddForm(scope.row)" icon="el-icon-edit-el-icon-s-promotion" type="text" size="small" v-if="scope.row.formId == null"></el-button> -->
<el-button @click="handleUpdateSuspensionState(scope.row)" icon="el-icon-video-pause" type="text" size="small" v-if="scope.row.suspensionState === 1"></el-button>
<el-button @click="handleUpdateSuspensionState(scope.row)" icon="el-icon-video-play" type="text" size="small" v-if="scope.row.suspensionState === 2"></el-button>
<el-button @click="handleDelete(scope.row)" icon="el-icon-delete" type="text" size="small" v-hasPermi="['system:deployment:remove']"></el-button>
<el-button v-if="scope.row.deptId" @click="handleDelete(scope.row)" icon="el-icon-delete" type="text" size="small" v-hasPermi="['system:deployment:remove']"></el-button>
</template>
</el-table-column>
</el-table>
@ -319,7 +342,8 @@ export default {
derivedFrom: null,
derivedFromRoot: null,
parentDeploymentId: null,
engineVersion: null
engineVersion: null,
deptName: null
},
formQueryParams:{
pageNum: 1,