初始版本提交

This commit is contained in:
yaoyn
2024-02-05 09:15:37 +08:00
parent b52d4414be
commit 445292105f
1848 changed files with 236859 additions and 75 deletions

View File

@ -0,0 +1,471 @@
import { EChartsOption } from 'echarts';
import {
AlignType,
DashboardShowType,
DesktopComponent,
ImgType,
LegendType,
OrientType,
ButtonType,
TableType,
ExecuteType,
} from '/@/enums/desktop';
import { ApiConfig } from '/@/components/ApiConfig/src/interface';
import { FormTypeEnum } from '/@/enums/formtypeEnum';
export type DesktopInfoId = string;
export type InfoType = DesktopComponent;
export interface DesktopData extends DesktopBasicData {
jsonContent: string; ////桌面设计json
}
export interface DesktopBasicData {
systemId?: string;
id?: string;
code: string; //编码
name: string; //名称
icon: string; //图标
parentId: string; //上级
sortCode: number; //排序
isFirst: number; //首屏
isMenu: number; //菜单
remark: string; //描述
backgroundUrl: string; //封面图片
}
export interface DesktopConfig {
title: string;
renderKey: number;
echarts?: undefined | EChartsOption;
}
export interface processEventItem {
operateType: ExecuteType;
operateConfig: any;
}
export interface ButtonItem {
apiConfig?: any;
name: string;
type: ButtonType;
formName?: string;
formId?: string;
apiColumn?: Array<any>;
processEvent: Array<processEventItem>;
}
export interface TableColumnItem {
dataIndex: string;
title: string;
show: boolean;
width?: number;
align?: string;
}
export interface TableConfig {
title: string;
type: TableType;
formId: string;
pageSize: number;
formName: string;
formType: FormTypeEnum;
apiColumns: Array<any>;
primaryKey: string;
associatedForm?: boolean;
apiConfig?: ApiConfig;
releaseId: string;
updateIds: Array<string>;
columns: Array<TableColumnItem>;
renderKey: number;
systemComponent: {
functionalModule: string;
functionName: string;
functionFormName: string;
};
}
export interface tablePanesItem {
title: string;
type: TableType;
key: string;
closable: boolean;
count: boolean;
formId?: string;
pageSize: number;
current: number;
total: number;
formName?: string;
formType: FormTypeEnum;
apiColumns?: Array<any>;
primaryKey?: string;
associatedForm?: boolean;
apiConfig?: ApiConfig;
releaseId?: string;
updateIds?: Array<string>;
columns?: Array<TableColumnItem>;
renderKey: number;
systemComponent?: {
functionalModule: string;
functionName: string;
functionFormName: string;
};
}
export interface TabsTableConfig {
title: string;
renderKey: number;
panes: Array<tablePanesItem>;
}
export interface TabsTableInfo extends BasicInfo {
config: TabsTableConfig;
}
export interface TableInfo extends BasicInfo {
config: TableConfig;
}
export interface ImageConfig {
title: string;
renderKey: number;
showTitle: boolean;
folderId: string;
}
export interface ImageInfo extends BasicInfo {
config: ImageConfig;
}
export interface MapConfig {
title: string;
renderKey: number;
showTitle: boolean;
apiConfig?: ApiConfig;
apiColumns?: Array<any>;
primaryKey?: string;
primaryName?: string;
}
export interface MapInfo extends BasicInfo {
config: MapConfig;
}
export interface BasicInfo {
x: number;
y: number;
w: number;
h: number;
i: string;
maxH: number;
minH: number;
maxW: number;
minW: number;
type: DesktopComponent;
}
export interface ApiInfo {
apiData: { [x: string]: number };
apiColumns: any;
apiConfig: ApiConfig;
}
export interface DesktopInfoItem extends BasicInfo {
config: DesktopConfig | MixLineBarConfig;
}
// 饼图 config
export interface PieConfig extends ApiInfo {
title: string; //标题
renderKey: number;
labelKey: string; //维度
valueKey: string; //指标
colors: Array<string>; //颜色配置
autoWidth?: boolean; //宽度自动
echarts: EChartsOption;
}
// 柱状图 config
export interface ChartBarConfig extends ApiInfo {
title: string; //标题
renderKey: number;
labelKey: string; //维度
valueKey: string; //指标
targetKey: string; //目标值
unit: string;
}
// 甘特图 config
export interface CategoryStackConfig extends ApiInfo {
labelKey?: string; //维度
valueKey?: string; //指标
targetKey?: string; //指标
}
export interface ColumnItem {
id: string;
name?: string;
width: number;
align: AlignType;
}
export interface InformationConfig extends ApiInfo {
title: string; //标题
renderKey: number;
jumpId: string | undefined;
path: string | undefined;
maxRows: number;
columns: Array<ColumnItem>;
apiColumns: Array<ChartApiColumn>;
apiConfig: ApiConfig;
}
export interface DashboardConfig extends ApiInfo {
title: string; //标题
renderKey: number;
labelKey: string;
valueKey: string;
title1: string; //标题1
title2: string; //标题2
showType: DashboardShowType; //风格
imgType: ImgType; //图片类型
imgIcon: string; //图标
imgIconColor: string; //图标颜色
pictureUrl: string; //图片地址
flagKey: string | undefined; //标记
flagIsUp: number | undefined; //标记值
mainIndex: string | undefined; //主指标
mainIndexValue: number; //主指标值
mainIndex2: string | undefined; //主指标2
mainIndex2Value: number; //主指标2值
secondaryIndex: string | undefined; //副指标
secondaryIndexValue: number | undefined; ///副指标值
jumpId: string | undefined;
path: string | undefined;
numColor: string | undefined;
des: string | undefined;
}
export interface ButtonConfig {
title: string;
buttons: Array<ButtonItem>;
}
export interface ButtonInfo extends BasicInfo {
config: ButtonConfig;
}
export interface DefaultInfo extends BasicInfo {
config: DesktopConfig;
}
export interface ChartsInfo extends BasicInfo {
config: DesktopConfig;
}
export interface DashboardInfo extends BasicInfo {
config: DesktopConfig & DashboardConfig;
}
export interface InformationInfo extends BasicInfo {
config: DesktopConfig & InformationConfig;
}
// 饼图配置
export interface PieItemInfo extends BasicInfo {
config: DesktopConfig & PieConfig;
}
// 柱状图
export interface ChartBarInfo extends BasicInfo {
config: DesktopConfig & ChartBarConfig;
}
// 甘特图
export interface CategoryStackInfo extends BasicInfo {
config: DesktopConfig & CategoryStackConfig;
}
export interface ChartLineItemInfo extends BasicInfo {
config: {
title: string;
echarts: EChartsOption;
};
}
interface functionItem {
id: string;
name: string;
icon: string;
path: string;
color: string;
}
export interface ModulesConfig {
functions: Array<functionItem>;
}
export interface ModulesInfo extends BasicInfo {
config: DesktopConfig & ModulesConfig;
}
export interface TodoListConfig {
title: string;
renderKey: number;
maxRows: number;
path: {};
}
export interface TodoListInfo extends BasicInfo {
config: DesktopConfig & TodoListConfig;
}
export interface ChartXAxis {
position: string;
name: string;
nameLocation: string;
nameTextStyle: {
color: string;
fontSize: number;
fontWeight: string;
};
type: string;
axisLabel: {
formatter: string;
color: string;
};
axisLine: {
show: boolean;
lineStyle: {
color: string;
};
};
data: Array<any>;
}
export interface ChartYAxis {
name: string;
nameLocation: string;
nameTextStyle: {
color: string;
fontSize: number;
fontWeight: string;
};
min: string;
max: string;
interval: null;
position: string;
type: string;
axisLabel: {
formatter: string;
color: string;
};
axisLine: {
show: boolean;
lineStyle: {
color: string;
};
};
}
export interface ChartLabel {
show: boolean;
color: string;
position: string;
fontWeight: string;
fontSize: number;
formatter: string | null;
}
export interface ChartApiColumn {
prop: string;
label: string;
}
export interface ChartLegend {
show: true;
orient: OrientType;
left: string;
top: string;
right: string;
bottom: string;
padding: number;
icon: LegendType;
itemWidth: number;
itemHeight: number;
textStyle: {
color: string;
};
formatter: string;
width?: string | number;
}
// 柱状图折线图混合
export interface MixLineIndicator {
title: string;
type: string;
color: string;
name: string;
value: string;
showAreaStyle: boolean; //是否显示面积图
gradualStartColor: string;
gradualEndColor: string;
}
export interface MixLineBarDataItem {
title: string;
valueKey: string;
total: number;
apiData: Array<any>;
apiColumns: Array<ChartApiColumn>;
apiConfig: ApiConfig;
indicator: Array<MixLineIndicator>;
}
export interface EchartsSeriesItem {
name: string;
type: string;
smooth: boolean;
areaStyle: any;
stack: string;
label: {
show: boolean;
color: string;
};
data: Array<any>;
showAreaStyle: boolean;
gradualEndColor: string;
gradualStartColor: string;
symbol?: string;
}
export interface IndicatorItem {
title: string;
type: string;
color: string;
name: string;
value: string;
}
export interface MixLineBarDataListItem {
title: string;
valueKey: string;
apiData: Object;
indicator: Array<IndicatorItem>;
apiConfig: ApiConfig;
}
export interface EchartsItem {
color: Array<string>;
legend: {
data: Array<string>;
};
xAxis: Array<{
type: string;
data: Array<any>;
}>;
yAxis: Array<{
type: string;
}>;
series: Array<EchartsSeriesItem>;
}
export interface MixLineBarConfig {
title: string;
renderKey: number;
condition: {
color: string;
selected: string;
};
legend: ChartLegend;
isCrosswise: boolean; //是否横向
// 统计
count: {
show: boolean;
unit: string;
title: string;
};
dataList: Array<MixLineBarDataItem>;
bar: {
stack: boolean; //是否显示堆叠
label: {
show: boolean;
color: string;
};
};
line: {
smooth: boolean;
stack: boolean; //是否显示堆叠
showAreaStyle: boolean; //是否显示面积图
gradualStartColor: string;
gradualEndColor: string;
showSymbol: boolean; //是否显示标记
label?: ChartLabel;
};
label: ChartLabel;
yAxis: Array<ChartYAxis>;
xAxis: Array<ChartXAxis>;
echarts: Array<EchartsItem>;
}
export interface MixLineBarInfo extends BasicInfo {
config: MixLineBarConfig;
}

View File

@ -0,0 +1,91 @@
/**
* 手机端表单props
*/
export interface AppFormProps {
rules: Object; //校验规则
validateTrigger: string; //各组件配置
labelPosition: string; //label 位置 top/left
labelWidth: number; //label 宽度,单位 px 75
labelAlign: string; //label 居中方式 left/center/right
errShowType: string; //表单错误信息提示方式 undertext/toast/modal
border: boolean; //是否显示分格线
schemas: AppFormSchema[]; //组件模板
}
/**
* 手机端组件配置模板
*/
export interface AppFormSchema {
key: string; //唯一标识 用于处理某些无字段组件
name: string; //表单域的属性名,在使用校验规则时必填
field?: string; //字段名
label?: string; //输入框左边的文字提示
component?: AppComponentType; //组件类型
labelWidth?: number; //label 宽度,单位 px
labelAlign?: string; //label 居中方式
rules?: {
required: boolean;
errorMessage: string;
}[]; //表单校验规则
required?: boolean; //label 右边显示红色"*"号,样式显示不会对校验规则产生效果
defaultValue?: any; //默认值
events?: {
[key: string]: string;
};
componentProps?: any; //组件的所有配置信息
layout?: any[]; //tab 等组件特有
columns?: AppFormSchema[]; //子表单组件特有
preloadType?: string; //子表单预加载类型
itemId?: string; //子表单预加载数据字典
apiConfig?: any; //子表单预加载api
associateOptions?: any; //子表单按钮选数据数据选择的配置
useSelectButton?: boolean; //子表单是否按钮选数据
buttonName?: string; //子表单 按钮选数据按钮名称
url?: string;
}
export enum AppComponentType {
input = 'Input',
inputNumber = 'InputNumber',
picker = 'Picker',
associatePicker = 'AssociatePicker',
select = 'Select',
checkbox = 'Checkbox',
radio = 'Radio',
switch = 'Switch',
date = 'Date',
dateTime = 'DateTime',
dateRange = 'DateRange',
dateTimeRange = 'DateTimeRange',
collapse = 'Collapse',
tab = 'Tab',
segmented = 'Segmented',
divider = 'Divider',
subForm = 'SubForm',
singleForm = 'SingleForm',
autoCode = 'AutoCode',
editor = 'Editor',
cascader = 'Cascader',
slider = 'Slider',
timeRange = 'TimeRange',
rate = 'Rate',
image = 'Image',
color = 'colorPicker',
qrcode = 'QRcode',
title = 'Title',
map = 'SelectMap',
upload = 'FileUpload',
opinion = 'Opinion',
organization = 'Organization',
user = 'User',
computation = 'Computation',
moneyChinese = 'MoneyChinese',
associatePopup = 'AssociatePopup',
multiplePopup = 'MultiplePopup',
info = 'Info',
button = 'CustomButton',
tableLayout = 'TableLayout',
text = 'Text',
formView = 'FormView',
iframe = 'Iframe',
}

View File

@ -0,0 +1,290 @@
import { ColEx } from '/@/components/TableForm/src/types';
import { ButtonLocation, FormSchema, Rule } from '/@/components/Form';
import { HiddenComponentInfo } from '/@/components/Designer/src/types/index';
/**
* 表单设计器 返回类型
*/
export interface FormJson {
//表单总体配置
config: FormOptionModel;
//各组件配置
list: ComponentOptionModel[];
hiddenComponent: HiddenComponentInfo[];
}
export interface GeneratorFormSchema extends FormSchema {
key: string;
group: string;
name: string;
icon: string;
}
/**
* 组件通用配置 实体模型
*/
export interface ComponentOptionModel {
//key 唯一
key: string;
//field name
bindField: string;
//table name
bindTable: string;
//名称
label: string;
//图标
rules?: Rule[];
//类型
type: string;
//各组件 特殊配置信息 具体配置信息
options?: ComponentConfigModel;
//栅格布局的子节点 栅格布局特有
layout?: LayoutOptionModel[];
//子表单子节点 子表单特有
children?: ComponentOptionModel[];
//range特有
bindStartTime?: string;
bindEndTime?: string;
//隐藏组件特有
code?: string; //编码
value?: string; //值
//界面优先-结构配置 字段备注展示
typeName?: string; //类型的中文名称
//是否是子表组件
isSubFormChild?: boolean;
//是否是单表组件
isSingleFormChild?: boolean;
}
/**
* 表单整体配置 实体模型
*/
export interface FormOptionModel {
//是否需要隐藏 必填标记
hideRequiredMark?: boolean;
//表单尺寸
size?: 'default' | 'small' | 'large';
//对齐方式
layout?: 'vertical' | 'inline' | 'horizontal';
//label配置
labelCol?: Partial<ColEx>;
//对齐方式
labelAlign?: 'left' | 'right';
//按钮位置
buttonLocation?: ButtonLocation;
//表单形式
formType?: 'modal' | 'drawer';
//表单宽度
formWidth?: number;
}
/**
* 组件具体配置 实体模型
*/
export interface ComponentConfigModel {
//绑定表
table: string;
//绑定字段
field: string;
//宽度
width?: string;
// 占位符
placeholder?: string;
// 栅格布局占多少列
col?: number;
//是否只读
readonly?: boolean;
//是否启用
disabled?: boolean;
//是否需要label
isLabel?: boolean;
showLabel?: boolean;
//label
labelWidth?: number;
//子表单 表格列宽
columnWidth?: number;
//默认值
defaultValue?: any;
//是否必填
required?: boolean;
//是否能够清空
allowClear: boolean;
//自定义验证 正则
rules?: Rule[];
//事件配置
events: any;
//下拉框模式(下拉框框特有) 'default' | 'multiple' | 'tags' | 'combobox'
mode?: string;
//是否为远程组件(下拉,单选,多选等组件)
remote?: boolean;
//如果是远程组件,代表远程类型
datasourceType: 'staticData' | 'dic' | 'datasource' | 'api';
//静态数据默认选择
defaultSelect?: string | number;
//datasourceType 是 dic 数据字典项目code
itemId: string;
//datasourceType 是datasrouce 存入数据源Id
sourceId: string;
//选项 (下拉,单选,多选等组件)
staticOptions?: any[];
// 请求地址 (下拉,单选,多选等组件)
api?: string;
//api配置信息下拉单选多选等组件
apiConfig: any;
//数据字典配置信息(下拉,单选,多选等组件)
dicOptions: Array<any>;
//返回值数据字段 (下拉,单选,多选等组件)
resultField?: string;
//显示字段 (下拉,单选,多选等组件)
labelField?: string;
//保存字段 (下拉,单选,多选等组件)
valueField?: string;
//子字段(树下拉,级联等)
childrenField?: string;
//最大输入
maxLength?: number;
//是否可以半选(评分特有)
allowHalf?: boolean;
//最大值(数字框特有)
max?: number;
//最小值(数字框特有)
min?: number;
//数值精度(数字框特有)
precision: number;
//小数点(数字框特有)
decimalSeparator: string;
//最大行 (多行文本框特有)
maxRow?: number;
//是否自适应高度(多行文本特有)
autoSize: boolean;
// // 是否显示字数(多行文本特有)
// showCount: boolean;
//步长(数字框特有)
step?: number;
//前缀input特有
addonBefore?: string;
//后缀input特有
addonAfter?: string;
//前缀图标input特有
prefix?: string;
//后缀图标input特有
suffix?: string;
//分割线文字位置 (分割线特有)
orientation?: string;
//tab页签位置tab特有
tabPosition?: string;
//tab大小 tab独有
tabSize: string;
//card布局特有
title?: string;
//时间组件特有
format?: string;
showTime?: boolean;
//编码规则(编码组件特有)
autoCodeRule: string;
//上间距(分割线特有)
marginTop: number;
//下间距(分割线特有)
marginBottom: number;
//开始占位(时间范围组件特有)
startTimePlaceholder: string;
//结束占位(时间范围组件特有)
endTimePlaceholder: string;
//按钮高度(按钮组件特有)
buttonHeight: string;
//按钮宽度(按钮组件特有)
buttonWidth: string;
//选项卡风格(选项卡组件特有)
type: string;
//信息体类型(信息体组件特有)
infoType: number;
//预加载数据源类型(表格组件特有)
preloadType: string;
//是否选择按钮选数据(表格组件特有)
useSelectButton: boolean;
//选数据按钮名称(表格组件特有)
buttonName: string;
span?: string | number;
maxlength?: string | number;
controls?: boolean;
subTotal?: boolean;
//预加载数据绑定字段(表格组件特有)
prestrainField?: string;
//单行文本不存表
isSave?: boolean;
//是否显示
isShow?: boolean;
url?: string;
}
/**
* 栅格布局 实体模型
*/
export interface LayoutOptionModel {
name?: string;
span: number;
list: ComponentOptionModel[];
}
/**
* 前端代码模型
*/
export interface FrontCodeModel {
listCode: string; // 列表代码
formCode: string; //表单代码
apiCode: string; //请求代码
modelCode?: string; //模型代码
configJsonCode: string; //配置json模型代码
workflowPermissionCode: string; //配置工作流权限数据
simpleFormCode: string; //simpleForm页面
}
/**
* 展示代码模型
*/
export interface ShowFrontCodeModel extends FrontCodeModel {
controllerCode?: string; //控制器代码
entityCode?: object; //实体类代码
}
//表单尺寸
export enum FormSizeEnum {
FULL,
BIG,
MEDIUM,
SMALL,
}
export enum AlignTypeEnum {
LEFT,
RIGHT,
CENTER,
}

View File

@ -0,0 +1,38 @@
/**
* 表单事件
*/
export interface FormEventStyleConfig {
color?: string;
icon?: string;
text?: string;
detail?: string;
type?: string;
bgcColor?: string;
lineHeight?: string;
isLast?: boolean;
isUserDefined: boolean;
isClick?: boolean;
nodeInfo?: nodeInfoConfig;
}
export interface FormEventColumnConfig {
0: FormEventStyleConfig[];
1: FormEventStyleConfig[];
2: FormEventStyleConfig[];
3: FormEventStyleConfig[];
4: FormEventStyleConfig[];
}
export interface selectedNodeConfig {
columnIndex: number;
index: number;
}
export interface nodeInfoConfig {
processEvent?: processEventConfig[];
}
export interface processEventConfig {
operateConfig: any;
operateType: string;
}

View File

@ -0,0 +1,82 @@
import { FormJson } from './codeGenerator';
import { ListConfig } from './listConfig';
import { MenuConfig } from './menuConfig';
import { OutputConfig } from './outputConfig';
import { TableConfig } from './tableConfig';
import { TableStructureConfig } from './tableStructureConfig';
import { FormEventColumnConfig } from './formEventConfig';
import { FormTypeEnum } from '/@/enums/formtypeEnum';
/**
* 表单设计器 代码优先/界面优先
*/
export interface GeneratorConfig {
//数据库id
databaseId: string | null;
//数据表配置
tableConfigs?: TableConfig[];
//表单配置
formJson: FormJson;
//列表页面配置
listConfig: ListConfig;
//输出配置
outputConfig: OutputConfig;
//菜单配置
menuConfig?: MenuConfig;
//表结构配置
tableStructureConfigs?: TableStructureConfig[];
//表单事件配置
formEventConfig: FormEventColumnConfig;
//是否开启数据权限(自定义表单)
isDataAuth?: boolean;
//数据权限选择(自定义表单)
dataAuthList?: string[] | number[];
//表单分类id
categoryId?: string;
//代码模板名称
name?: string;
formId?: string;
}
/**
* 自定义表单 配置项
*/
export interface CustomFormConfig {
name: string;
category: string; //分类
formDesignType: number; // 0-数据优先 1-界面优先 2-简易模板
formType: FormTypeEnum; //表单类型
remark: string;
formJson: CustomFormJson;
isChange?: boolean; //是否是编辑状态
}
export interface CustomFormJson {
//数据库id
databaseId: string;
//数据表配置
tableConfigs?: TableConfig[];
//表单配置
formJson: FormJson;
//表结构配置
tableStructureConfigs?: TableStructureConfig[];
//表单事件配置
formEventConfig?: FormEventColumnConfig;
//是否开启数据权限
isDataAuth: boolean;
//数据权限选择
dataAuthList: string[] | number[];
}
/**
* 表单发布
*/
export interface FormReleaseConfig {
//表单id
formId: string;
//列表配置
listConfig?: ListConfig;
//菜单配置
menuConfig: MenuConfig;
}

View File

@ -0,0 +1,137 @@
/**
* 列表配置
*/
export interface ListConfig {
//是否有左侧菜单
isLeftMenu: boolean;
//是否分页
isPage: boolean;
//分页 每页显示条数
pageSize?: number;
//左侧菜单配置
leftMenuConfig?: LeftMenuConfig;
//查询配置
queryConfigs: QueryConfig[];
//列表配置
columnConfigs: ColumnConfig[];
//按钮配置
buttonConfigs: ButtonConfig[];
// //合计配置
// totalConfigs?: TotalConfig[];
//列表标题
listTitle?: string;
//是否默认排序
defaultOrder?: boolean;
//排序字段
orderBy?: string;
//排序类型 (默认 倒叙)
orderType?: 'desc' | 'asc';
}
/**
* 左侧菜单配置
*/
export interface LeftMenuConfig {
//左侧菜单是否树结构
// isTree: boolean;
//左侧菜单宽度 分为 按照 1/3 | 1/4 | 1/5
leftWidth?: 1 | 2 | 3;
//如果不是数据字典 就是数据源
datasourceType: string; //dic | datasource | api
//如果是静态数据 则需要静态数据列表
staticData?: Array<any>;
//如果是数据源 就需要有数据源id
datasourceId?: string;
//如果是数据源 则需要配置 数据字段名 与parentFiledName 搭配拼接树结构)
fieldName?: string;
//如果是数据源 则需要配置 父级字段名 与fieldName 搭配拼接树结构)
parentFiledName?: string;
// 显示字段
showFieldName?: string;
//如果是数据源 需要 关联字段 关联 列表关联字段
relationFieldName?: string;
//列表关联字段
listFieldName?: string;
//数据项Id 用户查询数据字典详情
dictionaryItemId?: string;
//如果是api 则需要api配置
apiConfig?: any;
//菜单显示名称
menuName?: string;
//父级菜单图标
parentIcon?: string;
//子级菜单图标
childIcon?: string;
}
/**
* 查询配置
*/
export interface QueryConfig {
//查询字段
fieldName: string;
//查询框所占宽度
width?: number;
//是否时间字段
isDate: boolean;
//时间选择和日期选择需要
format?: string;
}
/**
* 列表配置
*/
export interface ColumnConfig {
//组件唯一标识
key?: string;
//显示名
label?: string;
//列名
columnName: string;
//对齐
alignType?: string;
//宽度
columnWidth?: string;
//自适应
autoWidth?: boolean;
//是否合计
isTotal?: boolean;
//是否是数字类型
isNumber?: boolean;
//组件类型
componentType?: string;
//时间选择、日期选择、时间范围、日期范围需要
format?: string;
//组件配置
componentProps?: any;
//手机端是否显示标签
showLabel?: boolean;
//手机端是否主字段当主字段启用时该字段的标签和内容的字体大小增加2px然后字体加粗
mainField?: boolean;
//是否列头筛选
isFilter?: boolean;
}
/**
* 按钮配置
*/
export interface ButtonConfig {
//是否启用
isUse: boolean;
//按钮名
name: string;
//编码
code: string;
//图标
icon: string;
//是否新增
isDefault: boolean;
}
/**
* 合计配置
*/
export interface TotalConfig {
//需要合计字段
fieldName: string;
}

View File

@ -0,0 +1,14 @@
export interface MenuConfig {
//编号
code: string;
//菜单名
name: string;
//父级菜单Id
parentId: string;
// 图标
icon: string;
//排序
sortCode: number;
//备注
remark: string;
}

View File

@ -0,0 +1,40 @@
/**
* 输出配置
*/
export interface OutputConfig {
//创建人
creator?: string;
//功能类名(必须英文字母开头 首字母不能使用字符以及数字)
className?: string;
//描述 注释
comment?: string;
// 输出区域(数据字典显示)
outputArea?: string;
//只生成前端源码
onlyFront?: boolean;
//只生成接口
onlyInterface?: boolean;
//是否生成移动端
isApp?: boolean;
//是否需要生成菜单
isMenu?: boolean;
//备注
remarks?: string;
//是否开启数据权限
isDataAuth?: boolean;
//数据权限选择
dataAuthList?: string[] | number[];
//代码模板类型
type?: number;
//生成接口名需要
outputValue?: string;
//手机端代码功能类型
funcType?: number;
//手机端选择要转换的表单
formObj?: {
formId: string;
formName?: string;
};
//手机端自定义表单是否开启生成代码功能
createCode?: boolean;
}

View File

@ -0,0 +1,33 @@
import { BasicFetchResult } from '/@/api/model/baseModel';
export interface PrintBasicData {
id?: string;
code: string; //编码
name: string; //名称
category: string; //类别
apiConfig: string; //api
isMenu: number; //菜单
sortCode: number; //排序
parentId: string; //上级
icon: string; //图标
remark: string; //描述
enabledMark?: number; //启用1 禁用0
content: string; // 设计器Json string
}
export type PageResult = BasicFetchResult<PrintBasicData>;
export interface SearchParams {
keyword: string;
}
export interface PrintConfigData {
apiConfig: string;
buttonCode: string;
buttonId: string;
menuId: string;
schemaId: string;
}
export interface PrintButtonRowItem {
code: string;
id: string;
name: string;
menuId: string;
}

View File

@ -0,0 +1,16 @@
/**
* 数据表配置
*/
export interface TableConfig {
[x: string]: any;
//表名
tableName: string;
//是否主表
isMain: boolean;
//主键字段
pkField?: string;
//关联字段
relationField?: string;
//关联表字段
relationTableField?: string;
}

View File

@ -0,0 +1,30 @@
export interface TableInfo {
//表名
tableName: string;
//列信息
columnInfo: ColumnInfo[];
}
export interface ColumnInfo {
//列名
columnName: string;
//列类型
columnType: ColumnType;
//列长度
columnLength: string;
//是否主键
isPrimaryKey: boolean;
//是否可空
isNullable: boolean;
}
export enum ColumnType {
//字符串
STRING,
//数字
NUMBER,
//布尔
BOOL,
//时间
DATE,
}

View File

@ -0,0 +1,34 @@
/**
* 表单设计器 代码优先/界面优先
*/
export interface TableStructureConfig {
//表的唯一标识(主要用于区分子表)
key?: string;
//表名
tableName: string;
//表注释
tableComment: string;
//是否主表
isMain: boolean;
//表的字段配置
tableFieldConfigs: TableFieldConfig[];
//数据表操作(界面优先编辑时)
operator?: number;
}
export interface TableFieldConfig {
key?: string;
//字段名称
fieldName?: string;
//字段开始名称(范围组件特有)
fieldStartName?: string;
//字段结束名称(范围组件特有)
fieldEndName?: string;
//字段长度
fieldLength: number | null;
//字段类型 0:文本 默认255 1:长文本 max 2:数字 3:小数 4:日期 5:日期时间 6:外键 7:长整数
fieldType: number;
//字段备注
fieldComment: string;
tableName?: string;
}

View File

@ -0,0 +1,336 @@
import { EChartsOption } from 'echarts';
import { AlignType, DesktopComponent, LegendType, OrientType } from '/@/enums/desktop';
import { ApiConfig } from '/@/components/ApiConfig/src/interface';
export type DesktopInfoId = string;
export type InfoType = DesktopComponent;
export interface MobileData extends MobileBasicData {
jsonContent: string; ////移动数据设计json
pageCode?: string; ////移动数据设计前端代码
}
export interface MobileBasicData {
id?: string;
code: string; //编码
name: string; //名称
icon?: string; //图标
sortCode?: number; //排序
categoryId?: string | null; //功能类别
isMenu: number; //菜单
remark: string; //描述
enabledMark?: number; //状态 1:启用0禁用-1草稿
appMenuId?: string; //菜单ID
}
export interface DesktopConfig {
title: string;
renderKey: number;
echarts?: undefined | EChartsOption;
}
export interface BasicInfo {
h?: number | undefined;
i: string;
minH?: number | undefined;
type: DesktopComponent;
}
export interface ApiInfo {
apiData: { [x: string]: number };
apiColumns: any;
apiConfig: ApiConfig;
}
export interface DesktopInfoItem extends BasicInfo {
config: DesktopConfig | MixLineBarConfig;
}
// 饼图 config
export interface PieConfig extends ApiInfo {
title: string; //标题
renderKey: number;
labelKey: string; //维度
valueKey: string; //指标
colors: Array<string>; //颜色配置
autoWidth?: boolean; //宽度自动
echarts: EChartsOption;
}
// 柱状图 config
export interface ChartBarConfig extends ApiInfo {
title: string; //标题
renderKey: number;
labelKey: string; //维度
valueKey: string; //指标
targetKey: string; //目标值
unit: string;
}
export interface ColumnItem {
id: string;
name: string;
width: number;
align: AlignType;
}
export interface InformationConfig extends ApiInfo {
title: string; //标题
renderKey: number;
jumpId: string | undefined;
path: string | undefined;
maxRows: number;
columns: Array<ColumnItem>;
}
export interface DashboardConfig extends ApiInfo {
renderKey: number;
dashboard: Array<dashboardItem>;
numColor: string | undefined;
labelColor: string | undefined;
}
export interface BannerConfig {
renderKey: number;
imgs: Array<bannerItem>;
}
export interface DefaultInfo extends BasicInfo {
config: DesktopConfig;
}
export interface ChartsInfo extends BasicInfo {
config: DesktopConfig;
}
export interface DashboardInfo extends BasicInfo {
config: DesktopConfig & DashboardConfig;
}
export interface BannerInfo extends BasicInfo {
config: DesktopConfig & BannerConfig;
}
export interface InformationInfo extends BasicInfo {
config: DesktopConfig & InformationConfig;
}
// 饼图配置
export interface PieItemInfo extends BasicInfo {
config: DesktopConfig & PieConfig;
}
// 柱状图
export interface ChartBarInfo extends BasicInfo {
config: DesktopConfig & ChartBarConfig;
}
export interface ChartLineItemInfo extends BasicInfo {
config: {
title: string;
echarts: EChartsOption;
};
}
export interface functionItem {
id: string;
name: string;
icon: string;
url: string;
color: string;
}
export interface dashboardItem {
name: string;
field: string | null;
}
export interface bannerItem {
index: number;
url: string | null;
}
export interface ModulesConfig {
functions: Array<functionItem>;
isShowTitle: boolean;
}
export interface ModulesInfo extends BasicInfo {
config: DesktopConfig & ModulesConfig;
}
export interface TodoListConfig {
title: string;
renderKey: number;
maxRows: number;
path: {};
}
export interface TodoListInfo extends BasicInfo {
config: DesktopConfig & TodoListConfig;
}
export interface ChartXAxis {
position: string;
name: string;
nameLocation: string;
nameTextStyle: {
color: string;
fontSize: number;
fontWeight: string;
};
type: string;
axisLabel: {
formatter: string;
color: string;
};
axisLine: {
show: boolean;
lineStyle: {
color: string;
};
};
data: Array<any>;
}
export interface ChartYAxis {
name: string;
nameLocation: string;
nameTextStyle: {
color: string;
fontSize: number;
fontWeight: string;
};
min?: string;
max?: string;
interval: null;
position: string;
type: string;
axisLabel: {
formatter: string;
color: string;
};
axisLine: {
show: boolean;
lineStyle: {
color: string;
};
};
}
export interface ChartLabel {
show: boolean;
color: string;
position?: string;
fontWeight?: string;
fontSize: number;
formatter: string | null;
}
export interface ChartApiColumn {
prop: string;
label: string;
}
export interface ChartLegend {
show: true;
orient: OrientType;
left: string;
top: string;
right: string;
bottom: string;
padding: number;
icon: LegendType;
itemWidth: number;
itemHeight: number;
textStyle: {
color: string;
};
formatter: string;
width?: string | number;
position: number;
}
// 柱状图折线图混合
export interface MixLineIndicator {
//title: string;
type: string;
color: string;
name: string;
value: string;
showAreaStyle: boolean; //是否显示面积图
gradualStartColor: string;
gradualEndColor: string;
}
export interface MixLineBarDataItem {
title: string;
valueKey: string;
total: number;
apiData: Array<any>;
apiColumns: Array<ChartApiColumn>;
apiConfig: ApiConfig;
indicator: Array<MixLineIndicator>;
}
export interface EchartsSeriesItem {
name: string;
type: string;
smooth: boolean;
areaStyle: any;
stack: string;
label: {
show: boolean;
color: string;
};
data: Array<any>;
showAreaStyle: boolean;
gradualEndColor: string;
gradualStartColor: string;
symbol?: string;
yAxisIndex?: number;
}
export interface IndicatorItem {
title: string;
type: string;
color: string;
name: string;
value: string;
}
export interface MixLineBarDataListItem {
title: string;
valueKey: string;
apiData: Object;
indicator: Array<IndicatorItem>;
apiConfig: ApiConfig;
}
export interface EchartsItem {
color: Array<string>;
legend: {
data: Array<string>;
};
xAxis: Array<{
type: string;
data: Array<any>;
}>;
yAxis: Array<{
type: string;
}>;
series: Array<EchartsSeriesItem>;
}
export interface MixLineBarConfig {
title: string;
renderKey: number;
condition: {
color: string;
selected: string;
};
legend: ChartLegend;
isCrosswise?: boolean; //是否横向
// 统计
count: {
show: boolean;
unit: string;
title: string;
};
dataList: Array<MixLineBarDataItem>;
bar: {
stack: boolean; //是否显示堆叠
label: {
show: boolean;
color: string;
};
};
line: {
smooth: boolean;
stack: boolean; //是否显示堆叠
showAreaStyle: boolean; //是否显示面积图
gradualStartColor: string;
gradualEndColor: string;
showSymbol: boolean; //是否显示标记
label?: ChartLabel;
};
label: ChartLabel;
yAxis: Array<ChartYAxis>;
xAxis: Array<ChartXAxis>;
echarts: Array<EchartsItem>;
}
export interface MixLineBarInfo extends BasicInfo {
config: MixLineBarConfig;
}

View File

@ -0,0 +1,59 @@
import { ApiConfig } from '/@/components/ApiConfig/src/interface';
import { ParamType } from '/@/enums/workflowEnum';
export interface ParamAssignmentConfig {
type: ParamType; //赋值类别
value: string; // 如果是 type === 值 就存储值
varValue: string; // 如果type === 变量 存储所选变量
apiConfig: ApiConfig; // 如果type === api 存储api配置
formConfig: FormAssignmentSourceConfig; // 如果type === 表单配置 存储api配置
target: string; // 目标变量 存储 流程变量名 processConfig 的 id
}
export interface scriptNodeConfig {
//脚本参数配置
scriptConfig: {
enabled: boolean; //是否开始
scriptFormat: number; //脚本格式
scriptContent: string; //脚本内容
};
}
// 流程参数配置
export interface ProcessParamConfig {
paramName: string; //流程参数
paramType: ParamType; //参数类型
paramValue: string; //如果是流程类型==值
paramApi: ApiConfig; //如果是流程类型==api
paramVariable: {}; //如果是流程类型==变量
// ParamConfigs: Array<ProcessParamConfigItem>;
}
// 参数操作 表单赋值 来源 配置
export interface FormAssignmentSourceConfig {
key: string; //唯一树id
formId: string; // 表单id
formField: string; //表单字段
}
// 参数操作 表单赋值 配置
export interface FormAssignmentConfig {
source: string; // 来源 变量
target: FormAssignmentSourceConfig; // 目标 表单字段
}
/**
* 参数操作 参数赋值 配置
*/
export interface AssignmentConfig {
formAssignmentConfigs: FormAssignmentConfig[]; //表单赋值
paramAssignmentConfigs: ParamAssignmentConfig[]; //参数赋值
}
/**
* 超时处理 配置
*/
export interface TimeOutConfig {
isHandle: number; //超时处理
rule: number; //超时机制
type: number; //处理方式
user: number; //指定人员
auto: number; //无处理人
}

View File

@ -0,0 +1,234 @@
import { MemberConfig } from './memberSetting';
import { FormConfigItem, FormSettingItem } from './formSetting';
import {
EndEventConfig,
GatewayConfig,
ProcessConfig,
ScriptTaskConfig,
StartEventConfig,
UserTaskConfig,
OpinionConfig,
SequenceFlowConfig,
CallActivityConfig,
} from './workflowConfig';
import { ApproveType, BpmnNodeKey, FormType } from '/@/enums/workflowEnum';
import { ButtonConfigItem } from '/@/model/workflow/workflowConfig';
interface basicInfoItem {
id: string;
name: string;
type: BpmnNodeKey;
remark: string;
}
export type InfoId = string;
export type InfoItem = basicInfoItem &
StartEventConfig &
UserTaskConfig &
ScriptTaskConfig &
GatewayConfig &
SequenceFlowConfig &
CallActivityConfig &
EndEventConfig;
export type InfoType = BpmnNodeKey;
export interface ProcessJson {
resourceId: string; //流程id 唯一id
processConfig: ProcessConfig; //流程属性配置
childNodeConfig: basicInfoItem[]; //子节点配置
}
export interface BpmnState {
modelId: string;
info: Map<InfoId, InfoItem>;
infoId: InfoId;
processInfo: ProcessConfig;
defaultFormList: Array<FormSettingItem>;
}
export interface FormInfoItem {
formData: Record<string, any> | undefined;
formConfig: FormConfigItem;
formJson: string;
formType: FormType;
}
export interface FlowInfo {
isCountersign: boolean;
isAddOrSubSign: boolean;
schemaInfo: {
category: string;
xmlContent: string;
name: string;
id: string;
code: string;
remark: string;
};
formInfos: Array<FormInfoItem>;
taskRecords: Array<TaskRecord>;
otherProcessApproveRecord: Array<TaskRecordList>;
taskApproveOpinions: Array<TaskApproveOpinion>;
relationTasks: Array<any>;
buttonConfigs?: Array<ButtonConfigItem>;
opinionConfig?: OpinionConfig;
formAssignmentData: null | undefined | Recordable; //参数赋值
}
export interface BpmnFlowFormItem {
id: string;
name: string;
code: string;
categoryName: string;
remark: string;
}
export interface TaskRecord {
comment: string;
nodeName: string;
nodeType: string;
startTime: string;
}
export interface TaskRecordList {
records: Array<TaskRecord>;
schemaName: string;
}
export interface TaskApproveOpinion {
approveComment: string;
id: string;
approveStampUrl: string;
approveTime: string;
approveUserName: string;
approveType: ApproveType;
approveResult: string;
}
export interface BpmnFlowForm {
// schemaId: string;
item: BpmnFlowFormItem;
xml: string;
formInfos: Array<FormInfoItem>;
relationTasks: Array<{ schemaId: string; schemaName: string }>;
taskRecords: Array<TaskRecordList>;
taskApproveOpinions: Array<TaskApproveOpinion>;
predecessorTasks: Array<SchemaTaskItem>;
opinions: Array<TaskApproveOpinion>;
opinionsComponents: Array<string>;
hasStamp: Boolean;
hasStampPassword: Boolean;
submitLoading: Boolean;
formAssignmentData: null | Recordable; //参数赋值
}
// 工作流表单校验
export type ValidateForms = Array<ValidateFlowForm>;
export interface ValidateFlowForm {
validate: boolean;
msgs: Array<ValidateFlowFormErrorMsg>;
result?: any;
formKey?: string;
isOldSystem?: boolean;
}
export interface ValidateFlowFormErrorMsg {
errors: Array<string>;
name: Array<string>;
}
// 前置任务 列表
export interface RelationTaskPage {
pageSize: number;
total: number;
list: Array<PredecessorTaskItem>;
}
export interface PredecessorTaskItem {
createTime: string;
currentSchedule: null;
originator: string;
schemaName: string;
taskId: string;
taskName: string;
processId: string;
}
export interface TaskItem {
taskId: string;
taskName: string;
processId: string;
}
// 任务数据
export interface SchemaTaskItem {
schemaId: string;
schemaName: string;
taskId: string;
taskName: string;
processId: string;
}
// 提交流程后返回数据格式
export type SubmittingProcessData = Array<{
provisionalApprover?: boolean;
isAppoint: boolean;
isMultiInstance: boolean;
taskId: string;
taskName: string;
selectIds: Array<string>;
}>;
// 下一节点审批人
export interface ApproveTask {
taskId: string;
taskName: string;
provisionalApprover?: boolean;
selectIds: Array<string>;
}
export interface BatchApproverUser {
taskId: string;
approvedUsers: Array<string>;
}
export interface BatchApproverInfo {
needStamp: boolean;
needPassword?: boolean;
}
export type BatchApproverUsersParams = Array<BatchApproverUser>;
// 审批数据
export interface PostApprovalData {
approvedType: number;
approvedContent: string;
formData: Recordable;
rejectNodeActivityId: string;
taskId: string;
circulateConfigs: Array<MemberConfig>;
stampId: string;
stampPassword: string;
approvedResult: string;
fileFolderIds: Array<string>;
isOldSystem: Object;
}
// 批量审批
export interface PostBatchApprovalData {
approvedType: number;
approvedContent: string;
taskIds: Array<string>;
stampId: string;
stampPassword?: string;
}
// 批量审批
export interface GetBatchApprovalInfo {
taskIds: string;
}
//驳回节点信息
export interface rejectNodeItem {
activityId: string;
activityName: string;
}
// 工作里调用系统表单
export interface WorkFlowFormParams {
formConfigChildren: Array<FormConfigItem>; // 工作流节点表单权限配置
formConfigKey: String; //唯一节点表单key
opinions?: Array<TaskApproveOpinion> | undefined; //意见簿意见
opinionsComponents?: Array<string> | undefined; //意见簿组件
isViewProcess: boolean;
uploadIds: Array<string>;
formModels: Recordable;
}
// 系统表单参数
export interface SystemComponentConfig {
functionalModule: string; //功能模块
functionName: string; //功能名称
functionFormName: string; //Form页面名称
}

View File

@ -0,0 +1,58 @@
import { FormType } from '/@/enums/workflowEnum';
export interface TableItem {
required: boolean;
view: boolean;
edit: boolean;
disabled: boolean;
isSaveTable?: boolean;
tableName: string;
fieldName: string;
fieldId: string;
key: string;
isSubTable: boolean;
showChildren: boolean;
type: string;
children: Array<TableItem>;
}
export interface FormSettingItem {
key: string; //formId_key
formType: FormType; //表单类型
formId: string; //表单ID 系统表单为文件夹名
formName: string; //表单名称
name?: string; //表单原始名称
enabledMark?: number; //禁用:0 禁用 1 启用
}
export interface FormConfigItem {
key: string; //formId_key
name?: string; //表单原始名称
formType: FormType; //表单类型
formId: string; //表单ID 系统表单为文件夹名
formName: string; //表单名称
showChildren: boolean;
requiredAll: boolean;
viewAll: boolean;
editAll: boolean;
children: Array<TableItem>;
}
// 表单设置
export interface FormSetting {
formConfigs: Array<FormSettingItem>;
}
// 功能表单
export interface formInitConfig {
enabled: boolean;
formType: FormType; //表单类型
formId: string; //表单ID 系统表单为文件夹名
formName: string; //表单名称
}
// 更新表单 表单数据
export interface UpdateFormConfigItem {
formKey: string;
formName: string;
formId: string;
formType: FormType;
nodeName: string;
status: boolean;
remark: string;
}

View File

@ -0,0 +1,86 @@
import {
AddOrRemoveType,
MultipleInstancesType,
InstanceCompletionConditions,
LevelEnum,
MemberType,
} from '/@/enums/workflowEnum';
import { ApiConfig } from './ParamSetting';
/**
* 人员(权限)[岗位 角色  用户]
*/
export type MemberListConfig = {
id: string;
name: string;
type: string;
};
// 节点
export type NodesConfig = {
id: string;
name: string;
checked?: boolean;
};
//表单配置
export type FormFiledConfig = {
key: string;
title: string;
children: Array<FormFiledConfig>;
disabled: boolean;
label?: string;
buttons?: Array<FormFiledConfig>;
};
//表单配置
export type FormFiled = {
key: string;
title: string;
children: Array<FormFiledConfig>;
disabled: boolean;
formId: string;
formField: string;
label?: string;
};
/**
* 上级领导配置
*/
interface LeaderConfig {
nodeId: string;
level: LevelEnum;
}
export interface MemberConfig {
memberType: MemberType;
id: string; //存储所选值Id
name: string; //存储所选值name
leaderConfig?: LeaderConfig; //上级领导配置
formFieldConfig?: {
//表单字段
nodeId: string;
formId: string;
formField: string;
formKey: string;
};
apiConfig?: ApiConfig;
}
export interface CountersignMemberConfig {
memberType: MemberType;
id: string; //存储所选值Id
name: string; //存储所选值name
leaderConfig?: LeaderConfig; //上级领导配置
formFieldConfig?: {
//表单字段
nodeId: string;
formId: string;
formField: string;
formKey: string;
};
checked: boolean; //会签节点是否
}
export interface CountersignConfig {
multipleInstancesType: MultipleInstancesType; //多实例类型
addOrRemove: AddOrRemoveType; //加签 或者 减签
finishType: InstanceCompletionConditions; //完成条件 多实例
percentage: number;
countersignList: Array<CountersignMemberConfig>; //会签人员
}

View File

@ -0,0 +1,286 @@
//流程配置json
import { InfoId } from './bpmnConfig';
import { FormConfigItem, formInitConfig, FormSettingItem } from './formSetting';
import { CountersignConfig, MemberConfig } from './memberSetting';
import { AssignmentConfig, TimeOutConfig } from './ParamSetting';
import { ApiConfig } from '/@/components/ApiConfig/src/interface';
import {
ApprovalOpinionDisplayType,
AuthType,
AutoAgreeRule,
ButtonType,
DesignatedApprover,
ElectronicSignatureVerification,
NoHandler,
NoticePolicyType,
OperationType,
ProcessStatus,
RecordType,
TaskPermissions,
RejectType,
CallActivityType,
FinishType,
ExecutionType,
MemberType,
ApproveType,
NodeEventExType,
} from '/@/enums/workflowEnum';
import { BpmnNodeKey } from '/@/enums/workflowEnum';
export interface ProcessJsonModel {
processConfig: ProcessConfig; //流程属性配置
//子节点配置
childNodeConfig: ChildNodeConfig;
}
export type ChildNodeItem =
| StartEventConfig
| UserTaskConfig
| ScriptTaskConfig
| GatewayConfig
| EndEventConfig;
export type ChildNodeConfig = Array<ChildNodeItem>;
// 专项菜单
export interface MenuConfig {
enabled: boolean;
code: string;
name: string;
system: undefined | string;
parentId: undefined | string;
icon: string;
order: undefined | number;
remark: string;
}
// 权限设置
interface AuthConfig {
authType: AuthType; //权限设置 0 所有 1 指定
authMemberConfigs?: MemberConfig[]; //必须authType === 1 权限指定的人员
}
//超时提醒
interface TimeoutConfig {
enabled: boolean; //是否提醒
hour: undefined | number; //超时时间
interval: undefined | number; //消息间隔
pushHits: undefined | number; //推送次数
pushMemberConfigs: MemberConfig[]; //推送人
}
//关联任务
export interface RelationProcessConfig {
id: string; //模板id
name: string; //模板名称
code: string; //模板编码
definitionKey?: string; //定义可以
processStatus?: ProcessStatus; //流程状态
processAuth?: TaskPermissions; //任务权限
}
// 命名规则
export interface NameRuleItem {
key: string;
title: string;
}
export type NameRule = Array<NameRuleItem>;
export type ProcessConfigParameter = Array<ProcessParameter>;
export interface ProcessConfig {
processId: string; //节点id
type: BpmnNodeKey; //节点类型
name: string; //节点名称
parentId: string; //父节点流程id
remark: string; //节点描述
code: string; //模板编码
category: undefined | string; //分类
nameRule?: string; //命名规则
nameRuleConfigs?: NameRule; // 命名规则列表
autoAgreeRule?: Array<AutoAgreeRule>; //自动同意规则
isPrevChooseNext: DesignatedApprover; //是否上一节点审批人指定下一节点审批人
noHandler: NoHandler; //无对应处理人
defaultFormList: Array<FormSettingItem>; //默认表单
appShow: boolean; //移动端是否显示
content?: string; //bpmn 设计 xml
authConfig: AuthConfig; //权限设置
menuConfig: MenuConfig; //是否启用菜单
formInitConfig: formInitConfig; //表单发起流程
timeoutRemidConfig: TimeoutConfig; //超时提醒配置
relationProcessConfigs: Array<RelationProcessConfig>; //关联任务
processParamConfigs: ProcessConfigParameter; //流程参数
xmlContent: String; //xml
}
// 参数操作
export interface ProcessParameter {
id: string;
name: string;
type: OperationType;
value: string;
apiConfig: ApiConfig;
}
// 输入参数
/**
* 开始节点配置
*/
export interface StartEventConfig extends BasicNodeConfig {
parentId: string; //父节点流程id
assignmentConfig: AssignmentConfig; //参数操作
formConfigs: Array<FormConfigItem>; // 表单配置
subProcessInitiator: string; //子流程开始节点发起人
}
/**
* 用户节点配置
*/
//按钮配置
export interface ButtonConfigItem {
approveType: ApproveType; //审批类型
buttonType: ButtonType; //按钮类型
buttonName: string; //按钮名称
buttonCode: string; //按钮编码
checked: boolean; //选中
scriptContent?: string; //脚本内容
scriptLanguage?: number; //脚本格式
apiConfig?: ApiConfig; //api配置
buttonOpera?: RejectType; //驳回类型
}
// 意见簿
export interface OpinionConfig {
enabled: boolean; //是否关联表单
showType: ApprovalOpinionDisplayType; //审批意见展示类型 0 显示所有 1 显示最终结果
signature: ElectronicSignatureVerification; //电子签章验证
component: Array<string>; //关联意见框组件
}
/**
* 用户任务配置
*/
export interface UserTaskConfig extends BasicNodeConfig {
parentId: string; //父节点流程id
currentProgress: undefined | number; //进度
autoAgreeRule: Array<AutoAgreeRule>; //自动同意规则
isPrevChooseNext: DesignatedApprover; //是否上一节点审批人指定下一节点审批人
noHandler: NoHandler; //无对应处理人
provisionalApprover: Boolean; //临时审批人
noticePolicyConfigs: NoticePolicyType[]; //通知策略
approverConfigs: MemberConfig[]; //审批人
// authMember: MemberConfig; //审批人
circulateConfigs: MemberConfig[]; //传阅人
countersignConfig: CountersignConfig; //会签
buttonConfigs: Array<ButtonConfigItem>;
opinionConfig: OpinionConfig;
formConfigs: Array<FormConfigItem>; // 表单配置
assignmentConfig: AssignmentConfig; //参数操作
timeOutHandle: TimeOutConfig; //超时处理
}
/**
* 脚本节点配置
*/
export interface ScriptTaskConfig extends BasicNodeConfig {
parentId: string; //父节点流程id
noticePolicyConfigs: NoticePolicyType[]; //通知策略
recordInfo: RecordType; //记录信息
script: {
enabled: boolean;
scriptFormat: string; //脚本格式
scriptContent: string; //脚本内容
};
api: {
enabled: boolean;
apiConfig: ApiConfig;
};
assignmentConfig: AssignmentConfig; //参数操作
}
/**
* 网关配置
*/
export interface GatewayConfig extends BasicNodeConfig {
parentId: string; //父节点流程id
}
/**
* 结束配置
*/
export interface EndEventConfig extends BasicNodeConfig {
parentId: string; //父节点流程id
noticePolicyConfigs: NoticePolicyType[]; //通知策略
}
/**
* 子流程配置
*/
export interface SubProcessConfig extends BasicNodeConfig {
parentId: string; //父节点流程id
//子流程发起人  (选择的是主流程的某个节点  所以存储的也是子流程节点的id
mainProcessNodeId: string;
}
/**
* 流程线配置
*/
export interface SequenceFlowConfig extends BasicNodeConfig {
parentId: string; //父节点流程id
conditionConfigs: ConditionConfig[]; //变量来源
}
/**
* 流转条件配置
*/
export interface ConditionConfig {
nodeId: string;
formId: string;
formField: string;
}
export interface CallActivityParams {
source: string;
target: string;
}
/**
* 外部流程
*/
export interface CallActivityConfig extends BasicNodeConfig {
parentId: string; //父节点流程id
schemaId: string; //被调用元素外部流程schemaId
schemaName: string; //被调用元素外部流程schemaName
callActivityType: CallActivityType.SINGLE; // 调用类型
finishType: FinishType.ALL; //完成条件
percentOf: undefined | Number; //百分比数值
executionType: ExecutionType; //执行类型
originatorType: MemberType; //发起人类型
originatorNode: string; //如果调用类型为单实例 子流程发起人
originatorConfig: string; //发起人表单数据配置
inParams: CallActivityParams[]; //输入参数
outParams: CallActivityParams[]; //输出参数
}
export type ValidateProcessConfigs = Array<{
nodeName: string; //节点名称
nodeType: BpmnNodeKey; //节点类型
msg: string;
validate: boolean;
}>;
export interface BasicNodeConfig {
id: string; //节点id
type: BpmnNodeKey; //节点类型
name: string; //节点名称
remark: string; //节点描述
startEventConfigs: NodeEventConfig[];
endEventConfigs: NodeEventConfig[];
}
export interface NodeEventConfig {
type: NodeEventExType; //节点类型:
apiConfig?: ApiConfig; //APi配置
liteflowId?: string; //流程引擎
}
export interface RootElement {
id: InfoId;
name: string;
$type: BpmnNodeKey;
incoming?: Array<RootElement>;
outgoing?: Array<RootElement>;
flowElements?: Array<RootElement>;
}
export type RootElements = Array<RootElement>;