Merge branch 'dev' of http://123.132.248.154:10000/HC_YFZX/vue-vben-admin into dev
commit
290c425b87
|
|
@ -0,0 +1,60 @@
|
|||
// WFSchemeInfo 流程模版基本信息
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
import {SchemeListParams,GetSchemeModel,AddParams,
|
||||
DeleteParams,UpdateParams,StateParams,HistoryParams,GetHistoryModel,SchemeParams,DetailParams} from './model/wfSchemeInfoModel'
|
||||
enum Api {
|
||||
// 流程模板基本信息
|
||||
LoadPage = '/api/WFSchemeInfo/LoadPage',
|
||||
Add = '/api/WFSchemeInfo/Add',
|
||||
Update = '/api/WFSchemeInfo/Update',
|
||||
Delete = '/api/WFSchemeInfo/Delete',
|
||||
UpDateState = '/api/WFSchemeInfo/UpDateState',
|
||||
GetDetail='/api/WFSchemeInfo/Get',
|
||||
// 流程模板详细信息
|
||||
LoadHistoryPage= '/api/WFScheme/LoadPage',
|
||||
UpdateScheme='/api/WFSchemeInfo/UpdateScheme',
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: getLoadPage 模板列表
|
||||
*/
|
||||
export function getLoadPage(params?: SchemeListParams) {
|
||||
return defHttp.get<GetSchemeModel>({ url: Api.LoadPage, params });
|
||||
}
|
||||
export function getDetail(params?: DetailParams){
|
||||
return defHttp.get({ url: Api.GetDetail, params });
|
||||
}
|
||||
/**
|
||||
* @description: postAdd
|
||||
*/
|
||||
export function postAdd( params?:AddParams) {
|
||||
return defHttp.post(
|
||||
{
|
||||
url: Api.Add,
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
export function update(params:UpdateParams) {
|
||||
return defHttp.post({
|
||||
url: Api.Update+"?id="+params.schemeinfo.id,
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function del(params:DeleteParams) {
|
||||
return defHttp.post({ url: Api.Delete + "?id=" + params.id });
|
||||
}
|
||||
|
||||
export function updateState(params:StateParams){
|
||||
return defHttp.post({ url: Api.UpDateState + "?id=" + params.id +"&state="+params.state});
|
||||
}
|
||||
|
||||
export function getLoadHistoryPage(params?:HistoryParams){
|
||||
return defHttp.get<GetHistoryModel>({url:Api.LoadHistoryPage,params})
|
||||
}
|
||||
export function updateScheme(params:SchemeParams){
|
||||
return defHttp.post({ url: Api.UpdateScheme + "?id=" + params.id +"&schemeId="+params.schemeId});
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
/**
|
||||
* @description: 字典明细接口区分参数
|
||||
*/
|
||||
export interface CodeParams {
|
||||
code: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 字典明细添加参数
|
||||
*/
|
||||
export interface AddParams {
|
||||
itemName: string;
|
||||
itemValue: string;
|
||||
sortCode: number;
|
||||
enabledMark: number;
|
||||
description: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 字典明细更新参数
|
||||
*/
|
||||
export interface UpdateParams {
|
||||
itemDetailId:string;
|
||||
itemName: string;
|
||||
itemValue: string;
|
||||
sortCode: number;
|
||||
enabledMark: number;
|
||||
description: string;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 分类明细删除参数
|
||||
*/
|
||||
export interface DeleteParams {
|
||||
id: string ;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取分类明细返回值
|
||||
*/
|
||||
export interface GetSysDataItemDetailModel {
|
||||
itemDetailId: string;
|
||||
itemId: string;
|
||||
parentId: string;
|
||||
itemCode: string;
|
||||
itemName: string;
|
||||
itemValue: string;
|
||||
quickQuery: string;
|
||||
simpleSpelling: string;
|
||||
isDefault: string;
|
||||
sortCode: number;
|
||||
deleteMark: number;
|
||||
enabledMark: number;
|
||||
description: string;
|
||||
createDate: string;
|
||||
createUserName: string;
|
||||
modifyDate: string;
|
||||
modifyUserId: string;
|
||||
modifyUserName: string;
|
||||
}
|
||||
|
|
@ -0,0 +1,166 @@
|
|||
/**
|
||||
* @description: 流程模板基本信息参数
|
||||
*/
|
||||
export interface SchemeListParams {
|
||||
key: string;
|
||||
page: number;
|
||||
limit: number;
|
||||
category: string;
|
||||
ids?: string;
|
||||
}
|
||||
/**
|
||||
* @description: 获取流程模板详情参数
|
||||
*/
|
||||
export interface DetailParams {
|
||||
code: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 流程模板添加参数
|
||||
*/
|
||||
export interface AddParams {
|
||||
schemeinfo: {
|
||||
id: string,
|
||||
code: string,
|
||||
name: string,
|
||||
category: string,
|
||||
color: string,
|
||||
icon: string,
|
||||
schemeId: string,
|
||||
enabledMark: 0,
|
||||
mark: 0,
|
||||
isInApp: 0,
|
||||
authType: 0,
|
||||
description: string,
|
||||
type: 0,
|
||||
createDate: string,
|
||||
createUserId: string,
|
||||
createUserName: string
|
||||
},
|
||||
schemeAuthList: [
|
||||
{
|
||||
id: string,
|
||||
schemeInfoId: string,
|
||||
objName: string,
|
||||
objId: string,
|
||||
objType: 0
|
||||
}
|
||||
],
|
||||
scheme: {
|
||||
id: string,
|
||||
schemeInfoId: string,
|
||||
type: 0,
|
||||
createDate: string,
|
||||
createUserId: string,
|
||||
createUserName: string,
|
||||
content: string
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 字典明细更新参数
|
||||
*/
|
||||
export interface UpdateParams {
|
||||
schemeinfo: {
|
||||
id: string,
|
||||
code: string,
|
||||
name: string,
|
||||
category: string,
|
||||
color: string,
|
||||
icon: string,
|
||||
schemeId: string,
|
||||
enabledMark: 0,
|
||||
mark: 0,
|
||||
isInApp: 0,
|
||||
authType: 0,
|
||||
description: string,
|
||||
type: 0,
|
||||
createDate: string,
|
||||
createUserId: string,
|
||||
createUserName: string
|
||||
},
|
||||
schemeAuthList: [
|
||||
{
|
||||
id: string,
|
||||
schemeInfoId: string,
|
||||
objName: string,
|
||||
objId: string,
|
||||
objType: 0
|
||||
}
|
||||
],
|
||||
scheme: {
|
||||
id: string,
|
||||
schemeInfoId: string,
|
||||
type: 0,
|
||||
createDate: string,
|
||||
createUserId: string,
|
||||
createUserName: string,
|
||||
content: string
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description: 分类明细删除参数
|
||||
*/
|
||||
export interface DeleteParams {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface StateParams {
|
||||
id: string;
|
||||
state: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 获取分类明细返回值
|
||||
*/
|
||||
export interface GetSchemeModel {
|
||||
itemDetailId: string;
|
||||
itemId: string;
|
||||
parentId: string;
|
||||
itemCode: string;
|
||||
itemName: string;
|
||||
itemValue: string;
|
||||
quickQuery: string;
|
||||
simpleSpelling: string;
|
||||
isDefault: string;
|
||||
sortCode: number;
|
||||
deleteMark: number;
|
||||
enabledMark: number;
|
||||
description: string;
|
||||
createDate: string;
|
||||
createUserName: string;
|
||||
modifyDate: string;
|
||||
modifyUserId: string;
|
||||
modifyUserName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: 历史记录查询参数
|
||||
*/
|
||||
export interface HistoryParams {
|
||||
key: string;
|
||||
page: number;
|
||||
limit: number;
|
||||
id?: string;
|
||||
}
|
||||
/**
|
||||
* @description: 历史记录返回值
|
||||
*/
|
||||
export interface GetHistoryModel {
|
||||
id: string,
|
||||
schemeInfoId: string,
|
||||
type: number,
|
||||
createDate: string,
|
||||
createUserId: string,
|
||||
createUserName: string,
|
||||
content: string
|
||||
}
|
||||
/**
|
||||
* @description: 切换版本
|
||||
*/
|
||||
export interface SchemeParams {
|
||||
id: string,
|
||||
schemeId: string
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
// sysDataItemDetail 字典明细接口api
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
import {CodeParams,AddParams,UpdateParams ,DeleteParams,GetSysDataItemDetailModel} from './model/sysDataItemDetailModel'
|
||||
enum Api {
|
||||
Load = '/api/SysDataItemDetail/Load',
|
||||
Add = '/api/SysDataItemDetail/Add',
|
||||
Update = '/api/SysDataItemDetail/Update',
|
||||
Delete = '/api/SysDataItemDetail/Delete',
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: postAdd
|
||||
*/
|
||||
export function postAdd(code:CodeParams, params:AddParams) {
|
||||
return defHttp.post(
|
||||
{
|
||||
url: Api.Add + "?code=" + code,
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description: getLoad
|
||||
*/
|
||||
export function getLoad(params: CodeParams) {
|
||||
return defHttp.get<GetSysDataItemDetailModel>({ url: Api.Load, params });
|
||||
}
|
||||
|
||||
export function update(params?:UpdateParams) {
|
||||
console.log(params)
|
||||
return defHttp.post({
|
||||
url: Api.Update,
|
||||
params
|
||||
});
|
||||
}
|
||||
|
||||
export function del(params:DeleteParams) {
|
||||
return defHttp.post({ url: Api.Delete + "?id=" + params.id });
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,10 +1,3 @@
|
|||
/*
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-13 13:04:15
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-02-05 16:06:58
|
||||
* @Description:
|
||||
*/
|
||||
import { defHttp } from '@/utils/http/axios';
|
||||
import { LoginParams, LoginResultModel, GetUserInfoModel } from './model/userModel';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
/*
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-03-01 15:55:24
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-02 16:08:00
|
||||
* @Description:
|
||||
*/
|
||||
import { withInstall } from '@/utils';
|
||||
|
||||
import bWflowViewer from './src/bWflowViewer.vue'
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-25 10:05:50
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-01-26 09:52:37
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<template v-for="item in btnList">
|
||||
|
|
|
|||
|
|
@ -5,20 +5,22 @@
|
|||
'connection.added',
|
||||
'connection.removed',
|
||||
'connection.changed'
|
||||
]" @element-click="elementClick" @init-finished="initModeler" @event="handlerEvent" @save="onSaveProcess" />
|
||||
]" @connection-added="connectionAdded" @connection-removed="connectionRemoved"
|
||||
@connection-changed="connectionChanged" @element-click="elementClick" @init-finished="initModeler"
|
||||
@event="handlerEvent" @save="onSaveProcess" />
|
||||
<!-- 属性面板 -->
|
||||
<bmpn-process-penal :element="data.element" :bpmn-modeler="data.modeler" :prefix="data.controlForm.prefix" class="process-panel" />
|
||||
<bmpn-process-penal :element="data.element" :bpmn-modeler="data.modeler" :prefix="data.controlForm.prefix"
|
||||
class="process-panel" ref=processPanel :schemeCode="props.schemeCode"/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { h, reactive, onMounted, defineProps, computed, defineEmits } from 'vue';
|
||||
import { h, reactive, onMounted, defineProps, computed, defineEmits, inject,ref } from 'vue';
|
||||
import './package/theme/index.scss';
|
||||
// 流程面板和属性面板
|
||||
import { BpmnProcessDesigner, BmpnProcessPenal } from './package/index';
|
||||
import 'highlight.js/styles/atom-one-dark-reasonable.css';
|
||||
const emit = defineEmits(['save']);
|
||||
|
||||
// Vue.use(vuePlugin);
|
||||
const props = defineProps({
|
||||
bpmnXml: {
|
||||
|
|
@ -28,10 +30,13 @@
|
|||
designerForm: {
|
||||
type: Object,
|
||||
required: true
|
||||
},
|
||||
schemeCode:{
|
||||
type:String,
|
||||
}
|
||||
})
|
||||
const data = reactive({
|
||||
height: document.documentElement.clientHeight - 94.5 + "px;",
|
||||
height: document.documentElement.clientHeight - 144.5 + "px;",
|
||||
xmlString: props.bpmnXml,
|
||||
modeler: null,
|
||||
controlForm: {
|
||||
|
|
@ -44,8 +49,33 @@
|
|||
headerButtonSize: 'small',
|
||||
// additionalModel: [CustomContentPadProvider, CustomPaletteProvider]
|
||||
},
|
||||
element:null,
|
||||
element: null,
|
||||
})
|
||||
const processPanel = ref < any > ()
|
||||
async function getFlow() {
|
||||
let panel = await processPanel.value.getPanel()
|
||||
return panel
|
||||
}
|
||||
async function validateFlow(){
|
||||
let res = await processPanel.value.validatePanel()
|
||||
return res
|
||||
}
|
||||
defineExpose({
|
||||
getFlow,
|
||||
validateFlow
|
||||
})
|
||||
function connectionAdded(node) {
|
||||
console.log(node)
|
||||
console.log('connectionAdded')
|
||||
}
|
||||
function connectionRemoved(node) {
|
||||
console.log(node)
|
||||
console.log('connectionRemoved')
|
||||
}
|
||||
function connectionChanged(node) {
|
||||
console.log(node)
|
||||
console.log('connectionChanged')
|
||||
}
|
||||
function elementClick(element) {
|
||||
data.element = element;
|
||||
}
|
||||
|
|
@ -108,7 +138,8 @@
|
|||
-webkit-border-radius: 4px;
|
||||
}
|
||||
}
|
||||
.process-panel{
|
||||
|
||||
.process-panel {
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -3,12 +3,10 @@
|
|||
<div class="my-process-designer__header">
|
||||
<slot name="control-header"></slot>
|
||||
<template v-if="!$slots['control-header']">
|
||||
|
||||
<div slot="content">
|
||||
<a-button :type="headerButtonType" :icon="h(SaveOutlined)" @click="onSave" class="ml-2">保存流程
|
||||
</a-button>
|
||||
<a-button :type="headerButtonType" @click="previewProcessXML" class="ml-2">预览XML</a-button>
|
||||
<a-button :type="headerButtonType" @click="previewProcessJson" class="ml-2">预览JSON</a-button>
|
||||
<!-- <a-button :type="headerButtonType" :icon="h(SaveOutlined)" @click="onSave" class="ml-2">保存流程 </a-button> -->
|
||||
<!-- <a-button :type="headerButtonType" @click="previewProcessXML" class="ml-2">预览XML</a-button> -->
|
||||
<!-- <a-button :type="headerButtonType" @click="previewProcessJson" class="ml-2">预览JSON</a-button> -->
|
||||
<a-space>
|
||||
<a-tooltip placement="bottom" class="ml-2" title="缩小视图">
|
||||
<a-button :disabled="defaultZoom <= 0.3" :icon="h(ZoomOutOutlined)" @click="processZoomOut()"></a-button>
|
||||
|
|
@ -114,12 +112,10 @@
|
|||
|
||||
onMounted(() => {
|
||||
initBpmnModeler();
|
||||
console.log(props.value)
|
||||
createNewDiagram(props.value);
|
||||
})
|
||||
function onSave() {
|
||||
return new Promise((resolve, reject) => {
|
||||
console.log(process.bpmnModeler)
|
||||
if (process.bpmnModeler == null) {
|
||||
reject();
|
||||
}
|
||||
|
|
@ -140,7 +136,6 @@
|
|||
},
|
||||
],
|
||||
});
|
||||
console.log(process.bpmnModeler)
|
||||
emit("init-finished", process.bpmnModeler);
|
||||
initModelListeners();
|
||||
}
|
||||
|
|
@ -150,7 +145,6 @@
|
|||
// 注册需要的监听事件, 将. 替换为 - , 避免解析异常
|
||||
props.events.forEach(event => {
|
||||
EventBus.on(event, function (eventObj) {
|
||||
console.log(eventObj)
|
||||
provide('wfdesign',eventObj)
|
||||
let eventName = event.replace(/\./g, "-");
|
||||
let element = eventObj ? eventObj.element : null;
|
||||
|
|
@ -338,3 +332,8 @@
|
|||
});
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
::v-deep .bjs-container a{
|
||||
visibility: hidden;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,10 +1,3 @@
|
|||
/*
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-03-04 13:39:52
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-05 16:07:51
|
||||
* @Description:
|
||||
*/
|
||||
const hljs = require("highlight.js/lib/core");
|
||||
hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml"));
|
||||
hljs.registerLanguage("json", require("highlight.js/lib/languages/json"));
|
||||
|
|
|
|||
|
|
@ -1,68 +1,60 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-03-05 17:09:44
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-07 14:52:13
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div :class="prefixCls" :style="{ width: `${props.width}px` }">
|
||||
<a-tabs v-model:activeKey="activeKey">
|
||||
<a-tab-pane key="1" tab="流程属性">
|
||||
<shcemeinfo-config ref="shcemeinfo" :disabled="true"></shcemeinfo-config>
|
||||
<a-tabs v-model:activeKey="configActiveName">
|
||||
<a-tab-pane :tab="data.wfNodeName" key="1">
|
||||
<start-event-option ref="startRef" :element="data.currentWfNode"
|
||||
:class="data.currentWfNode.type=='bpmn:StartEvent' ? '' : 'hidden'"></start-event-option>
|
||||
<user-task-option ref="taskRef" :element="data.currentWfNode"
|
||||
:class="data.currentWfNode.type=='bpmn:Task' ? '' : 'hidden'">
|
||||
</user-task-option>
|
||||
<end-event-option ref="endRef" :element="data.currentWfNode"
|
||||
:class="data.currentWfNode.type=='bpmn:EndEvent' ? '' : 'hidden'"></end-event-option>
|
||||
<subprocess-option ref="subprocessRef" :element="data.currentWfNode"
|
||||
:class="data.currentWfNode.type=='bpmn:SubProcess' ? '' : 'hidden'"></subprocess-option>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="2" tab="发起权限" force-render>
|
||||
<auth-config ref="auth"></auth-config>
|
||||
<a-tab-pane tab="流程属性" key="2">
|
||||
<shcemeinfo-config ref="shcemeinfoRef" :disabled="true" :schemeInfo="detailInfo.schemeInfo"></shcemeinfo-config>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="3" tab="开始节点">
|
||||
<start-event-option ref="start" :element="data.elementData"></start-event-option>
|
||||
</a-tab-pane>
|
||||
<a-tab-pane key="4" tab="审核节点">
|
||||
<user-task-option ref="task"></user-task-option>
|
||||
<a-tab-pane key="3" tab="发起权限" force-render>
|
||||
<auth-config ref="authRef"></auth-config>
|
||||
</a-tab-pane>
|
||||
|
||||
</a-tabs>
|
||||
<!-- <el-tabs v-model="configActiveName" :stretch="true">
|
||||
<el-tab-pane :label="$t(wfNodeName[currentWfNode.type])" name="tab01" v-if="currentWfNode != undefined">
|
||||
<component :disabled="true" ref="wfcongfig" :is="`${currentWfNode.type}Option`"></component>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="流程属性" name="tab02">
|
||||
<shcemeinfo-config ref="shcemeinfo" :disabled="true"></shcemeinfo-config>
|
||||
</el-tab-pane>
|
||||
</el-tabs> -->
|
||||
<!-- <Tabs v-model:activeKey="configActiveName">
|
||||
<Tabs.TabPane :label="$t(wfNodeName[currentWfNode.type])" name="tab01" v-if="currentWfNode != undefined">
|
||||
<component :disabled="true" ref="wfcongfig" :is="`${currentWfNode.type}Option`"></component>
|
||||
</Tabs.TabPane>
|
||||
<Tabs.TabPane label="流程属性" name="tab02">
|
||||
<shcemeinfo-config ref="shcemeinfo" :disabled="true"></shcemeinfo-config>
|
||||
</Tabs.TabPane>
|
||||
</Tabs> -->
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { h, reactive, onMounted, defineProps, computed, defineEmits, provide, watch, ref } from 'vue';
|
||||
import { h, reactive, onMounted, defineProps, computed, defineEmits, provide, watch, ref, inject } from 'vue';
|
||||
import { SaveOutlined, ZoomOutOutlined, ZoomInOutlined, RotateLeftOutlined, RotateRightOutlined, ClearOutlined } from '@ant-design/icons-vue';
|
||||
import { Tabs } from 'ant-design-vue';
|
||||
import { PageWrapper } from '@/components/Page';
|
||||
import { useDesign } from '@/hooks/web/useDesign';
|
||||
import { lr_AESEncrypt } from '../utils.ts'
|
||||
const { prefixCls } = useDesign('process-property');
|
||||
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
import { getDetail } from '@/api/sys/WFSchemeInfo'
|
||||
|
||||
// 流程属性
|
||||
import shcemeinfoConfig from './shcemeInfo/index.vue'
|
||||
// 发起权限
|
||||
import authConfig from './auth/index.vue'
|
||||
// 开始节点
|
||||
import startEventOption from './startEvent/index.vue'
|
||||
import StartEventOption from './startEvent/index.vue'
|
||||
// 审核节点
|
||||
import userTaskOption from './userTask/index.vue'
|
||||
// 结束节点
|
||||
import endEventOption from './config/endEvent.vue'
|
||||
import endEventOption from './endEvent/index.vue'
|
||||
// 网关和
|
||||
import gatewayAndOption from './config/gatewayAnd.vue'
|
||||
// 网关包容
|
||||
import gatewayInclusiveOption from './config/gatewayInclusive.vue'
|
||||
// 网关Xor
|
||||
import gatewayXorOption from './config/gatewayXor.vue'
|
||||
// 脚本任务
|
||||
import scriptTaskOption from './config/scriptTask.vue'
|
||||
import subprocessOption from './config/subprocess.vue'
|
||||
// 子流程
|
||||
import subprocessOption from './subprocess/index.vue'
|
||||
// 线
|
||||
import mylineOption from './config/myline.vue'
|
||||
/**
|
||||
* 侧边栏
|
||||
|
|
@ -80,54 +72,259 @@
|
|||
type: Number,
|
||||
default: 520
|
||||
},
|
||||
idEditDisabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
element: Object
|
||||
element: Object,
|
||||
schemeCode: String,
|
||||
})
|
||||
|
||||
provide('prefix', props.prefix)
|
||||
provide('width', props.width)
|
||||
const activeKey = ref("4")
|
||||
const startRef = ref < any > ()
|
||||
const shcemeinfoRef = ref < any > ()
|
||||
const authRef = ref < any > ()
|
||||
const taskRef = ref < any > ()
|
||||
const endRef = ref < any > ()
|
||||
const subprocessRef = ref < any > ()
|
||||
|
||||
const configActiveName = ref('2')
|
||||
const data = reactive({
|
||||
configActiveName: 'tab02',
|
||||
currentWfNode: undefined,
|
||||
wfNodeName: {
|
||||
startEvent: '开始节点',
|
||||
endEvent: '结束节点',
|
||||
gatewayAnd: '并行网关',
|
||||
gatewayInclusive: '包含网关',
|
||||
gatewayXor: '排他网关',
|
||||
scriptTask: '脚本节点',
|
||||
userTask: '审核节点',
|
||||
subprocess: '子流程',
|
||||
myline: '线条'
|
||||
},
|
||||
elementData:{}
|
||||
wfNodeName: ""
|
||||
})
|
||||
watch(
|
||||
() => props.element,
|
||||
(newVal, oldVal) => {
|
||||
data.elementData = newVal
|
||||
var typeName = newVal.type.replace('bpmn:', '')
|
||||
if (newVal.type == "bpmn:Process") {
|
||||
data.currentWfNode = {
|
||||
type: newVal.type
|
||||
}
|
||||
configActiveName.value = '2'
|
||||
} else {
|
||||
data.currentWfNode = newVal
|
||||
configActiveName.value = '1'
|
||||
switch (typeName) {
|
||||
case 'StartEvent':
|
||||
data.wfNodeName = "开始节点"
|
||||
data.currentWfNode = {
|
||||
id: newVal.id,
|
||||
type: newVal.type
|
||||
}
|
||||
break;
|
||||
case 'EndEvent':
|
||||
data.wfNodeName = "结束节点"
|
||||
data.currentWfNode = {
|
||||
id: newVal.id,
|
||||
type: newVal.type
|
||||
}
|
||||
break;
|
||||
case 'Task':
|
||||
data.wfNodeName = "审核节点"
|
||||
data.currentWfNode = {
|
||||
id: newVal.id,
|
||||
type: newVal.type
|
||||
}
|
||||
break;
|
||||
case 'SubProcess':
|
||||
data.wfNodeName = "子流程"
|
||||
data.currentWfNode = {
|
||||
id: newVal.id,
|
||||
type: newVal.type
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
)
|
||||
const achieveList = ref([
|
||||
{
|
||||
key: '1',
|
||||
name: '文章',
|
||||
component: 'startEventOption',
|
||||
},
|
||||
{
|
||||
key: '2',
|
||||
name: '应用',
|
||||
component: 'startEventOption',
|
||||
},
|
||||
])
|
||||
const tabs = {
|
||||
startEventOption,
|
||||
startEventOption,
|
||||
};
|
||||
const detailInfo = reactive({
|
||||
schemeInfo: {},
|
||||
startInfor: {},
|
||||
endInfo: {},
|
||||
authInfo: {},
|
||||
subprocessInfo: {},
|
||||
taskInfo: {},
|
||||
})
|
||||
async function getDetailInfo() {
|
||||
let data = await getDetail({ code: props.schemeCode })
|
||||
let scheme = JSON.parse(data.scheme.content);
|
||||
let baseinfo = {
|
||||
id: data.schemeinfo.id,
|
||||
code: data.schemeinfo.code,
|
||||
name: data.schemeinfo.name,
|
||||
category: data.schemeinfo.category,
|
||||
enabledMark: data.schemeinfo.enabledMark,
|
||||
mark: data.schemeinfo.mark,
|
||||
isInApp: data.schemeinfo.isInApp,
|
||||
description: data.schemeinfo.description,
|
||||
icon: data.schemeinfo.icon,
|
||||
color: data.schemeinfo.color,
|
||||
schemeId: data.schemeinfo.schemeId,
|
||||
|
||||
undoType: scheme.undoType,
|
||||
undoDbCode: scheme.undoDbCode,
|
||||
undoDbSQL: scheme.undoDbSQL,
|
||||
undoIOCName: scheme.undoIOCName,
|
||||
undoUrl: scheme.undoUrl,
|
||||
|
||||
deleteType: scheme.deleteType,
|
||||
deleteDbCode: scheme.deleteDbCode,
|
||||
deleteDbSQL: scheme.deleteDbSQL,
|
||||
deleteIOCName: scheme.deleteIOCName,
|
||||
deleteUrl: scheme.deleteUrl,
|
||||
|
||||
|
||||
deleteDraftType: scheme.deleteDraftType,
|
||||
deleteDraftDbCode: scheme.deleteDraftDbCode,
|
||||
deleteDraftDbSQL: scheme.deleteDraftDbSQL,
|
||||
deleteDraftIOCName: scheme.deleteDraftIOCName,
|
||||
deleteDraftUrl: scheme.deleteDraftUrl
|
||||
};
|
||||
|
||||
let wfData = scheme.wfData
|
||||
|
||||
let auth = {
|
||||
authType: data.schemeinfo.authType,
|
||||
authData: data.schemeAuthList.map(t => {
|
||||
return {
|
||||
id: t.objId,
|
||||
name: t.objName,
|
||||
type: t.objType
|
||||
}
|
||||
})
|
||||
}
|
||||
shcemeinfoRef.value.setForm(baseinfo)
|
||||
authRef.value.setForm(auth)
|
||||
console.log(wfData)
|
||||
}
|
||||
|
||||
function scriptTaskNodeInit(node) {
|
||||
node.executeType = '1'
|
||||
node.sqlDb = ''
|
||||
node.sqlStr = ''
|
||||
node.sqlStrRevoke = ''
|
||||
node.apiUrl = ''
|
||||
node.apiUrlRevoke = ''
|
||||
node.ioc = ''
|
||||
node.iocRevoke = ''
|
||||
|
||||
}
|
||||
function mylineNodeInit(node) {
|
||||
const wfdata = this.handleGetWFData();
|
||||
const fromNode = wfdata.find(t => t.id == node.from)
|
||||
node.lineConditions = ''
|
||||
if (fromNode.type == 'userTask') {
|
||||
if (fromNode.btnlist.findIndex(t => t.code == 'agree' && !t.hidden) != -1) {
|
||||
node.lineConditions = 'agree' // 流转条件
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function validatePanel() {
|
||||
let res = await shcemeinfoRef.value.validateForm();
|
||||
return res
|
||||
}
|
||||
async function getPanel() {
|
||||
// 1.获取流程配置基础属性
|
||||
let baseinfo = await shcemeinfoRef.value.getForm();
|
||||
// 2.获取流程权限信息
|
||||
let auth = await authRef.value.getForm();
|
||||
if (startRef.value == undefined) {
|
||||
return createMessage.warn('请设置开始节点');
|
||||
}
|
||||
if (endRef.value == undefined) {
|
||||
return createMessage.warn('请设置结束节点');
|
||||
}
|
||||
let startFrom = await startRef.value.getForm();
|
||||
let endFrom = await endRef.value.getForm();
|
||||
if (endFrom.id == '') {
|
||||
return createMessage.warn('请设置结束节点');
|
||||
}
|
||||
let wfData = []
|
||||
wfData.push(startFrom)
|
||||
wfData.push(endFrom)
|
||||
let taskFrom = await !(taskRef.value) ? {} : taskRef.value.getForm();
|
||||
let subprocessFrom = await !(subprocessRef.value) ? {} : subprocessRef.value.getForm();
|
||||
if(subprocessFrom != undefined){
|
||||
wfData.push(subprocessFrom)
|
||||
}
|
||||
if(subprocessFrom != undefined){
|
||||
wfData.push(taskFrom)
|
||||
}
|
||||
// 3.流程节点信息
|
||||
wfData.forEach(node => {
|
||||
if (node.type == 'myline' && !node.isInit) {
|
||||
node.isInit = true
|
||||
node.lineConditions = ''
|
||||
const fromNode = this.wfData.find(t => t.id == node.from)
|
||||
if (fromNode.type == 'userTask') {
|
||||
if (fromNode.btnlist.findIndex(t => t.code == 'agree' && !t.hidden) != -1) {
|
||||
node.lineConditions = 'agree' // 流转条件
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
let scheme = {
|
||||
wfData: wfData,
|
||||
|
||||
undoType: baseinfo.undoType,
|
||||
undoDbCode: baseinfo.undoDbCode,
|
||||
undoDbSQL: baseinfo.undoDbSQL,
|
||||
undoIOCName: baseinfo.undoIOCName,
|
||||
undoUrl: baseinfo.undoUrl,
|
||||
|
||||
deleteType: baseinfo.deleteType,
|
||||
deleteDbCode: baseinfo.deleteDbCode,
|
||||
deleteDbSQL: baseinfo.deleteDbSQL,
|
||||
deleteIOCName: baseinfo.deleteIOCName,
|
||||
deleteUrl: baseinfo.deleteUrl,
|
||||
|
||||
|
||||
deleteDraftType: baseinfo.deleteDraftType,
|
||||
deleteDraftDbCode: baseinfo.deleteDraftDbCode,
|
||||
deleteDraftDbSQL: baseinfo.deleteDraftDbSQL,
|
||||
deleteDraftIOCName: baseinfo.deleteDraftIOCName,
|
||||
deleteDraftUrl: baseinfo.deleteDraftUrl,
|
||||
|
||||
};
|
||||
let dto = {
|
||||
schemeinfo: {
|
||||
id:baseinfo.id,
|
||||
code: baseinfo.code,
|
||||
name: baseinfo.name,
|
||||
category: baseinfo.category,
|
||||
enabledMark: baseinfo.enabledMark,
|
||||
mark: baseinfo.mark,
|
||||
isInApp: baseinfo.isInApp,
|
||||
authType: auth.authType,
|
||||
description: baseinfo.description,
|
||||
icon: baseinfo.icon,
|
||||
color: baseinfo.color,
|
||||
schemeId: baseinfo.schemeId,
|
||||
},
|
||||
schemeAuthList: auth.authType == 1 ? [] : auth.authData.map(t => {
|
||||
return {
|
||||
objId: t.id,
|
||||
objName: t.name,
|
||||
objType: t.type
|
||||
};
|
||||
}),
|
||||
scheme: {
|
||||
content: lr_AESEncrypt(JSON.stringify(scheme), "learun")
|
||||
}
|
||||
}
|
||||
console.log(dto)
|
||||
return dto
|
||||
}
|
||||
defineExpose({
|
||||
getPanel,
|
||||
validatePanel
|
||||
})
|
||||
onMounted(() => {
|
||||
if (props.schemeCode) {
|
||||
getDetailInfo()
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
|
|
@ -147,4 +344,8 @@
|
|||
::v-deep .ant-tabs-content-holder {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,13 +1,6 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-03-05 17:09:44
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-07 15:37:16
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="auth-config">
|
||||
<a-tabs v-model:activeKey="f_AuthType" type="card" size="small">
|
||||
<a-tabs v-model:activeKey="authType" type="card" size="small">
|
||||
<a-tab-pane key="1" tab="所有成员">
|
||||
<a-alert message="权限说明" description="所有人员指不限制流程模版的发起人员,表示每个人都能发起该流程模版。" type="info" show-icon />
|
||||
</a-tab-pane>
|
||||
|
|
@ -51,7 +44,7 @@
|
|||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref, onMounted, nextTick, unref } from 'vue';
|
||||
const f_AuthType = ref("1")
|
||||
let authType = ref("1")
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import type { UnwrapRef } from 'vue';
|
||||
import SelectPos from '@/components/SelectPos/index.vue';
|
||||
|
|
@ -72,7 +65,7 @@
|
|||
},
|
||||
|
||||
];
|
||||
const dataSource = [
|
||||
let dataSource = ref([
|
||||
{
|
||||
id: 0,
|
||||
name: "王五",
|
||||
|
|
@ -83,7 +76,7 @@
|
|||
name: "王五",
|
||||
type: "管理员",
|
||||
},
|
||||
]
|
||||
])
|
||||
const data = reactive({
|
||||
postOpen: false,
|
||||
roleOpen: false,
|
||||
|
|
@ -116,6 +109,20 @@
|
|||
function accountHandleOk() {
|
||||
console.log(accountRef.value.getRow())
|
||||
}
|
||||
function setForm(data){
|
||||
authType.value = data.authType
|
||||
dataSource.value =data.authData
|
||||
}
|
||||
function getForm() {
|
||||
return {
|
||||
authType: authType.value,
|
||||
authData: dataSource.value
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
getForm,
|
||||
setForm
|
||||
})
|
||||
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
|
|
|
|||
|
|
@ -1,32 +0,0 @@
|
|||
<!-- 开始节点配置 -->
|
||||
<template>
|
||||
<el-form
|
||||
class="l-form-config"
|
||||
label-width="88px"
|
||||
label-position="left"
|
||||
size="mini"
|
||||
>
|
||||
<el-form-item label="节点标识">
|
||||
<el-input v-model="node.id" readonly ></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:'end-event-option',
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
node(){
|
||||
return this.wfdesign.currentWfNode;
|
||||
}
|
||||
},
|
||||
inject: ["wfdesign"]
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -1,77 +0,0 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-02-29 13:56:45
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-02-29 14:34:53
|
||||
* @Description:
|
||||
-->
|
||||
<!-- 开始节点配置 -->
|
||||
<template>
|
||||
<el-form
|
||||
class="l-form-config"
|
||||
label-width="88px"
|
||||
label-position="left"
|
||||
size="mini">
|
||||
<el-form-item label="节点标识">
|
||||
<el-input v-model="node.id" readonly ></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="是否异步">
|
||||
<el-switch :disabled="disabled" v-model="node.isAsync">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程模版">
|
||||
<l-select :disabled="disabled" v-model="node.wfschemeId" :options="list">
|
||||
</l-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="流程版本">
|
||||
<l-select :disabled="disabled" v-model="node.wfVersionId" :options="verisons">
|
||||
</l-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// const api = window.$api.workflow.scheme
|
||||
|
||||
export default {
|
||||
name:'subprocess-option',
|
||||
props:{
|
||||
disabled:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
}
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
}
|
||||
},
|
||||
asyncComputed:{
|
||||
list:{
|
||||
async get(){
|
||||
const data = []
|
||||
// const data = await this.$awaitWraper(api.getList())
|
||||
const res = data || []
|
||||
return res.filter(t=>t.f_Id != this.wfdesign.schemeinfoId).map(t=>{return {label:t.f_Name,value:t.f_Id}})
|
||||
}
|
||||
},
|
||||
verisons:{
|
||||
async get(){
|
||||
let res = []
|
||||
if(!this.$validatenull(this.node.wfschemeId)){
|
||||
// res = await this.$awaitWraper(api.getHistoryList(this.node.wfschemeId))
|
||||
}
|
||||
return (res || []).map(t=>{return { label:this.lr_dateFormat(t.f_CreateDate),value:t.f_Id }})
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
node(){
|
||||
return this.wfdesign.currentWfNode;
|
||||
}
|
||||
},
|
||||
inject: ["wfdesign"]
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
<!-- 开始节点配置 -->
|
||||
<template>
|
||||
<div class="end-event">
|
||||
<a-form ref="formRef" :model="node" labelAlign="left" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form-item label="节点标识">
|
||||
<a-input v-model:value="node.id" placeholder="请输入" readonly />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref, onMounted, nextTick, unref, h, watch, defineProps } from 'vue';
|
||||
|
||||
const node = reactive({
|
||||
id: ""
|
||||
})
|
||||
const props = defineProps({
|
||||
element: Object
|
||||
})
|
||||
watch(
|
||||
() => props.element,
|
||||
(newVal, oldVal) => {
|
||||
if(newVal.type == "bpmn:EndEvent"){
|
||||
node.id = newVal.id
|
||||
node.type = newVal.type
|
||||
}
|
||||
}
|
||||
)
|
||||
const labelCol = { span: 7 };
|
||||
const wrapperCol = { span: 17 };
|
||||
function getForm() {
|
||||
return node
|
||||
}
|
||||
defineExpose({
|
||||
getForm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -1,42 +1,42 @@
|
|||
<template>
|
||||
<div class="shceme-info">
|
||||
<a-form ref="formRef" :rules="rules" :model="formState" labelAlign="left" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form-item label="模板编号" name="f_Code">
|
||||
<a-input v-model:value="formState.f_Code" placeholder="请输入" />
|
||||
<a-form ref="formRef" :rules="rules" :model="formState" labelAlign="left" :label-col="labelCol"
|
||||
:wrapper-col="wrapperCol">
|
||||
<a-form-item label="模板编号" name="code">
|
||||
<a-input v-model:value="formState.code" placeholder="请输入" />
|
||||
</a-form-item>
|
||||
<a-form-item label="模板名称" name="f_Name">
|
||||
<a-input v-model:value="formState.f_Name" placeholder="请输入" />
|
||||
<a-form-item label="模板名称" name="name">
|
||||
<a-input v-model:value="formState.name" placeholder="请输入" />
|
||||
</a-form-item>
|
||||
<a-form-item label="模板图标" name="f_Icon">
|
||||
<IconPicker :value="formState.f_Icon" />
|
||||
<a-form-item label="模板图标" name="icon">
|
||||
<IconPicker v-model:value="formState.icon" />
|
||||
</a-form-item>
|
||||
<a-form-item label="图标颜色" name="f_Color">
|
||||
<a-input type="color" v-model="formState.f_Color" placeholder="请输入"></a-input>
|
||||
<a-form-item label="图标颜色" name="color">
|
||||
<a-input type="color" v-model="formState.color" placeholder="请输入"></a-input>
|
||||
</a-form-item>
|
||||
<a-form-item label="模板分类" name="f_Category">
|
||||
<a-select v-model:value="formState.f_Category" placeholder="please select your zone">
|
||||
<a-select-option value="shanghai">Zone one</a-select-option>
|
||||
<a-select-option value="beijing">Zone two</a-select-option>
|
||||
<a-form-item label="模板分类" name="category">
|
||||
<a-select v-model:value="formState.category" placeholder="请选择" :options="data.optionsType"
|
||||
:field-names="{ label: 'itemName', value: 'itemDetailId' }">
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="我的任务创建">
|
||||
<a-radio-group v-model:value="formState.f_Mark" name="radioGroup">
|
||||
<a-radio-group v-model:value="formState.mark" name="radioGroup">
|
||||
<a-radio v-for="item in data.optionsNotOrOk" :value="item.value">{{item.label}}</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="移动端创建">
|
||||
<a-radio-group v-model:value="formState.f_IsInApp" name="radioGroup">
|
||||
<a-radio-group v-model:value="formState.isInApp" name="radioGroup">
|
||||
<a-radio v-for="item in data.optionsNotOrOk" :value="item.value">{{item.label}}</a-radio>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-textarea v-model:value="formState.f_Description" placeholder="请填写备注"
|
||||
<a-textarea v-model:value="formState.description" placeholder="请填写备注"
|
||||
:auto-size="{ minRows: 5, maxRows: 8 }" />
|
||||
|
||||
|
||||
<a-divider plain="true">撤销操作</a-divider>
|
||||
<a-tabs v-model:activeKey="formState.undoType" type="card" size="small" centered="true">
|
||||
<a-tab-pane key="1" tab="执行SQL">
|
||||
<a-space direction="vertical" size="middle" class="site-space-compact-wrapper">
|
||||
<a-space direction="vertical" size="middle" class="site-space-compact-wrapper">
|
||||
<a-space-compact block>
|
||||
<a-select v-model:value="formState.undoDbCode" placeholder="请选择执行SQL数据库">
|
||||
<a-select-option value="shanghai">Zone one</a-select-option>
|
||||
|
|
@ -145,25 +145,27 @@
|
|||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { Dayjs } from 'dayjs';
|
||||
import { reactive, ref, toRaw } from 'vue';
|
||||
import { reactive, ref, toRaw, onMounted, defineProps } from 'vue';
|
||||
import type { UnwrapRef } from 'vue';
|
||||
import type { Rule } from 'ant-design-vue/es/form';
|
||||
import { IconPicker } from '/@/components/Icon';
|
||||
import { getLoad } from '@/api/sys/sysDataItemDetail';
|
||||
const formRef = ref();
|
||||
const labelCol = { span: 7 };
|
||||
const wrapperCol = { span: 17 };
|
||||
const activeKey = ref('1')
|
||||
const data = reactive({
|
||||
optionsNotOrOk: [{ label: '允许', value: 1 }, { label: '不允许', value: 2 }],
|
||||
|
||||
optionsType: [],
|
||||
})
|
||||
const formState = reactive({
|
||||
f_Code: '',
|
||||
f_Name: '',
|
||||
f_Category: '',
|
||||
f_Mark: 1,
|
||||
f_IsInApp: 2,
|
||||
f_Description: '',
|
||||
let formState = ref({
|
||||
code: '',
|
||||
name: '',
|
||||
category: '',
|
||||
enabledMark: 1,
|
||||
mark: 1,
|
||||
isInApp: 2,
|
||||
description: '',
|
||||
|
||||
titleRules: '',
|
||||
|
||||
|
|
@ -184,37 +186,68 @@
|
|||
deleteDraftDbSQL: '',
|
||||
deleteDraftIOCName: '',
|
||||
deleteDraftUrl: '',
|
||||
f_Icon: '',
|
||||
f_Color: '#409EFF',
|
||||
icon: 'ant-design:appstore-outlined',
|
||||
color: '#409EFF',
|
||||
});
|
||||
const rules: Record<string, Rule[]> = {
|
||||
f_Code: [
|
||||
code: [
|
||||
{ required: true, message: '请输入模板编号' },
|
||||
// { validator: lr_existDbFiled, keyValue: () => { return data.formData.f_Id }, tableName: 'lr_wf_schemeinfo', keyName: 'f_Id', trigger: 'blur' }
|
||||
],
|
||||
f_Name: [
|
||||
name: [
|
||||
{ required: true, message: '请输入模板名称' }
|
||||
],
|
||||
f_Category: [
|
||||
category: [
|
||||
{ required: true, message: '请选择模板分类' }
|
||||
],
|
||||
f_Icon: [
|
||||
icon: [
|
||||
{ required: true, message: '请选择图标' }
|
||||
],
|
||||
f_Color: [
|
||||
color: [
|
||||
{ required: true, message: '请选择颜色' }
|
||||
],
|
||||
};
|
||||
async function fetch() {
|
||||
let list = await getLoad({ code: 'FlowSort' });
|
||||
data.optionsType = list
|
||||
|
||||
}
|
||||
async function validateForm() {
|
||||
let res = await formRef.value
|
||||
.validate()
|
||||
.then((values) => {
|
||||
return true
|
||||
})
|
||||
.catch((error: ValidateErrorEntity<FormState>) => {
|
||||
return false
|
||||
});
|
||||
return res
|
||||
}
|
||||
function setForm(data) {
|
||||
formState.value = data
|
||||
}
|
||||
function getForm() {
|
||||
return formState.value
|
||||
}
|
||||
defineExpose({
|
||||
setForm,
|
||||
getForm,
|
||||
validateForm
|
||||
})
|
||||
onMounted(() => {
|
||||
fetch();
|
||||
});
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.site-space-compact-wrapper {
|
||||
width: 100%;
|
||||
|
||||
.ant-select {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .ant-tabs {
|
||||
padding: 0!important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -86,22 +86,6 @@
|
|||
<a-space v-if="node.formType!=1">
|
||||
<a-button @click="handleAddAuthField" width="100%" type="dashed" danger :icon="h(PlusOutlined)">添加字段</a-button>
|
||||
</a-space>
|
||||
<!-- <a-table :columns="data.columns" :data-source="node.authField" bordered :pagination="false">
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="['name', 'type'].includes(column.dataIndex)">
|
||||
<div>
|
||||
<a-input
|
||||
v-model:value="text"
|
||||
style="margin: -5px 0"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'operation'">
|
||||
<a>删除</a>
|
||||
</template>
|
||||
</template>
|
||||
</a-table> -->
|
||||
|
||||
</a-form>
|
||||
</div>
|
||||
</template>
|
||||
|
|
@ -110,7 +94,7 @@
|
|||
import { reactive, defineProps, computed, inject, ref, watch, h } from 'vue'
|
||||
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons-vue'
|
||||
const labelCol = { span: 7 };
|
||||
const wrapperCol = { span: 17 };
|
||||
const wrapperCol = { span: 17 };
|
||||
const props = defineProps({
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
|
|
@ -173,9 +157,10 @@
|
|||
watch(
|
||||
() => props.element,
|
||||
(newVal, oldVal) => {
|
||||
data.elementData = newVal
|
||||
node.id = data.elementData.id
|
||||
node.type = data.elementData.type
|
||||
if(newVal.type == "bpmn:StartEvent"){
|
||||
node.id = newVal.id
|
||||
node.type = newVal.type
|
||||
}
|
||||
}
|
||||
)
|
||||
watch(
|
||||
|
|
@ -191,124 +176,6 @@
|
|||
}
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
async function custmerformChange(val) {
|
||||
this.$set(this.node, 'formRelationId', '')
|
||||
if (val == null) {
|
||||
this.node.authFields = [];
|
||||
this.node.formVerison = ''
|
||||
return;
|
||||
}
|
||||
if (this.$validatenull(this.wfdesign.custmerformSchemes[val.f_SchemeId])) {
|
||||
// const {f_SchemeInfoId,f_Scheme,f_Id} = (await this.$awaitWraper(apiForm.getHistory(val.f_SchemeId))) || {}
|
||||
this.wfdesign.custmerformSchemes[f_Id] = { f_Scheme }
|
||||
if (this.node.formCode == f_SchemeInfoId) {
|
||||
this.loadFormScheme(f_Scheme)
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.loadFormScheme(this.wfdesign.custmerformSchemes[val.f_SchemeId].f_Scheme);
|
||||
}
|
||||
this.node.formVerison = val.f_SchemeId
|
||||
}
|
||||
async function custmerformVerisonChange(val) {
|
||||
this.$set(this.node, 'formRelationId', '')
|
||||
if (this.$validatenull(val)) {
|
||||
this.node.authFields = []
|
||||
return
|
||||
}
|
||||
if (this.$validatenull(this.wfdesign.custmerformSchemes[val.value])) {
|
||||
// const {f_Scheme,f_Id} = (await this.$awaitWraper(apiForm.getHistory(val.value))) || {}
|
||||
this.wfdesign.custmerformSchemes[f_Id] = { f_Scheme }
|
||||
if (this.node.formVerison == f_Id) {
|
||||
|
||||
this.loadFormScheme(f_Scheme)
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.loadFormScheme(this.wfdesign.custmerformSchemes[val.value].f_Scheme);
|
||||
}
|
||||
}
|
||||
function loadFormScheme(strScheme) {
|
||||
const scheme = JSON.parse(strScheme)
|
||||
const fields = []
|
||||
const rfields = []
|
||||
scheme.formInfo.tabList.forEach(tab => {
|
||||
tab.components.forEach(component => {
|
||||
if (['guid'].includes(component.type)) {
|
||||
rfields.push({ label: component.label, value: component.prop })
|
||||
}
|
||||
|
||||
if (!['gridtable', 'divider'].includes(component.type) && component.display) {
|
||||
fields.push({
|
||||
prop: component.prop,
|
||||
field: component.field,
|
||||
label: component.label,
|
||||
table: component.table,
|
||||
required: component.required,
|
||||
isEdit: true,
|
||||
isLook: true
|
||||
})
|
||||
}
|
||||
else if (['gridtable'].includes(component.type)) {
|
||||
fields.push({
|
||||
prop: `${component.prop}_add`,
|
||||
label: `${component.label || '表格'}-添加按钮`,
|
||||
required: false,
|
||||
isEdit: true,
|
||||
isLook: false,
|
||||
type: 'grid'
|
||||
})
|
||||
fields.push({
|
||||
prop: `${component.prop}_remove`,
|
||||
label: `${component.label || '表格'}-删除按钮`,
|
||||
required: false,
|
||||
isEdit: true,
|
||||
isLook: false,
|
||||
type: 'grid'
|
||||
})
|
||||
|
||||
fields.push({
|
||||
prop: `${component.prop}_required`,
|
||||
label: `${component.label || '表格'}-数据`,
|
||||
required: component.required,
|
||||
isEdit: false,
|
||||
isLook: false,
|
||||
type: 'gridrequired'
|
||||
})
|
||||
fields.push(...component.children.filter(t => t.display).map(t => {
|
||||
return {
|
||||
gridprop: component.prop,
|
||||
prop: t.prop,
|
||||
field: t.field,
|
||||
label: `${component.label || '表格'}-${t.label}`,
|
||||
table: component.table,
|
||||
required: t.required,
|
||||
isEdit: true,
|
||||
isLook: true
|
||||
}
|
||||
}))
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
this.node.formRelations = rfields
|
||||
this.node.authFields = fields
|
||||
|
||||
}
|
||||
function handleFormTypeChange() {
|
||||
this.node.formCode = ''
|
||||
this.node.formUrl = ''
|
||||
this.node.formAppUrl = ''
|
||||
this.node.authFields = []
|
||||
this.node.formRelations = []
|
||||
|
||||
this.$set(this.node, 'formRelationId', '')
|
||||
|
||||
}
|
||||
function handleAddAuthField() {
|
||||
node.authFields.push({
|
||||
field: '',
|
||||
|
|
@ -322,6 +189,12 @@
|
|||
node.authFields = node.authFields.filter(item => item.field !== key);
|
||||
}
|
||||
|
||||
function getForm() {
|
||||
return node
|
||||
}
|
||||
defineExpose({
|
||||
getForm
|
||||
})
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.site-space-compact-wrapper {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,60 @@
|
|||
<!-- 开始节点配置 -->
|
||||
<template>
|
||||
<div class="subprocess">
|
||||
<a-form ref="formRef" :model="node" labelAlign="left" :label-col="labelCol" :wrapper-col="wrapperCol">
|
||||
<a-form-item label="节点标识">
|
||||
<a-input v-model:value="node.id" placeholder="请输入" readonly />
|
||||
</a-form-item>
|
||||
<a-form-item label="是否异步">
|
||||
<a-switch v-model:checked="node.isAsync" />
|
||||
</a-form-item>
|
||||
<a-form-item label="流程模版">
|
||||
<a-select v-model:value="node.wfschemeId" :options="data.list">
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
<a-form-item label="流程版本">
|
||||
<a-select v-model:value="node.wfVersionId" :options="data.verisons">
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, defineProps, computed, inject, ref, watch, h } from 'vue'
|
||||
const labelCol = { span: 7 };
|
||||
const wrapperCol = { span: 17 };
|
||||
const props = defineProps({
|
||||
element: Object
|
||||
})
|
||||
const node = reactive({
|
||||
id: '',
|
||||
isAsync: false,
|
||||
wfschemeId: '',
|
||||
wfVersionId: '',
|
||||
})
|
||||
watch(
|
||||
() => props.element,
|
||||
(newVal, oldVal) => {
|
||||
if (newVal.type == "bpmn:SubProcess") {
|
||||
node.id = newVal.id
|
||||
node.type = newVal.type
|
||||
}
|
||||
}
|
||||
)
|
||||
const data = reactive({
|
||||
list: [],
|
||||
verisons: []
|
||||
})
|
||||
function getForm() {
|
||||
if (node.id != '') {
|
||||
return node
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
getForm
|
||||
})
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -1,673 +0,0 @@
|
|||
<!-- 开始节点配置 -->
|
||||
<template>
|
||||
<el-form label-width="96px" label-position="left" size="mini">
|
||||
<el-collapse v-model="activeNames" accordion>
|
||||
<el-collapse-item :title="$t('基础配置')" name="1">
|
||||
<div style="padding:0 16px;">
|
||||
<el-form-item label="节点标识">
|
||||
<el-input v-model="node.id" readonly></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="继承表单">
|
||||
<el-switch :disabled="disabled" v-model="node.isInherit">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="允许加签">
|
||||
<el-switch :disabled="disabled" v-model="node.isAddSign">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="允许转移">
|
||||
<el-switch :disabled="disabled" v-model="node.isTransfer">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="允许批量审核">
|
||||
<el-switch :disabled="disabled" v-model="node.isBatchAudit">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item label="自动同意规则">
|
||||
<l-select multiple :disabled="disabled" v-model="node.autoAgree" :options="atuoAgreeOptions">
|
||||
</l-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="无对应处理人">
|
||||
<l-select :disabled="disabled" v-model="node.noAuditor" :options="noAuditorOptions">
|
||||
</l-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="驳回策略">
|
||||
<l-radio :disabled="disabled" v-model="node.rejectType"
|
||||
:options="[{value:'1',label:'驳回节点固定'},{value:'2',label:'能驳回到任何执行过节点'}]">
|
||||
</l-radio>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="通知策略">
|
||||
<l-checkbox :disabled="disabled" v-model="node.messageType"
|
||||
:options="[{value:'1',label:'短信'},{value:'2',label:'邮箱'},{value:'3',label:'微信'},{value:'4',label:'站内消息'}]">
|
||||
</l-checkbox>
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
</el-collapse-item>
|
||||
<el-collapse-item :title="$t('审核人员设置')" name="2">
|
||||
<el-button-group style="padding:0 0 8px 8px" v-if="!disabled">
|
||||
<el-button size="mini" @click="handlePostClick(false)">{{$t('岗位')}}</el-button>
|
||||
<el-button size="mini" @click="handleRoleClick(false)">{{$t('角色')}}</el-button>
|
||||
<el-button size="mini" @click="handleUserClick(false)">{{$t('用户')}}</el-button>
|
||||
<el-button size="mini" @click="handleLevelClick(false)">{{$t('上下级')}}</el-button>
|
||||
<el-button size="mini" @click="handleNodeAuditorClick(false)">{{$t('节点执行人')}}</el-button>
|
||||
<el-button size="mini" @click="handleAuditorSqlClick(false)">{{$t('表字段')}}</el-button>
|
||||
</el-button-group>
|
||||
<l-table height="notset" :isShowNum="false" :columns="userColumns" :dataSource="node.auditUsers">
|
||||
<template v-slot:type="scope">
|
||||
{{typeFormat(scope.row.type)}}
|
||||
</template>
|
||||
<template v-slot:condition="scope">
|
||||
<l-select :disabled="disabled" size="mini" v-if="scope.row.type == '2'"
|
||||
:options="conditionOptions" v-model="scope.row.condition"></l-select>
|
||||
</template>
|
||||
<l-table-btns v-if="!disabled" :isFixed="false" :btns="tableBtns" @click="handleTableBtnClick">
|
||||
</l-table-btns>
|
||||
</l-table>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item :title="$t('传阅人员设置')" name="3">
|
||||
<el-button-group style="padding:0 0 8px 8px" v-if="!disabled">
|
||||
<el-button size="mini" @click="handlePostClick(true)">{{$t('岗位')}}</el-button>
|
||||
<el-button size="mini" @click="handleRoleClick(true)">{{$t('角色')}}</el-button>
|
||||
<el-button size="mini" @click="handleUserClick(true)">{{$t('用户')}}</el-button>
|
||||
<el-button size="mini" @click="handleLevelClick(true)">{{$t('上下级')}}</el-button>
|
||||
<el-button size="mini" @click="handleNodeAuditorClick(true)">{{$t('节点执行人')}}</el-button>
|
||||
<el-button size="mini" @click="handleAuditorSqlClick(true)">{{$t('表字段')}}</el-button>
|
||||
</el-button-group>
|
||||
<l-table height="notset" :isShowNum="false" :columns="userColumns" :dataSource="node.lookUsers">
|
||||
<template v-slot:type="scope">
|
||||
{{typeFormat(scope.row.type)}}
|
||||
</template>
|
||||
<template v-slot:condition="scope">
|
||||
<l-select :disabled="disabled" size="mini" v-if="scope.row.type == '2'"
|
||||
:options="conditionOptions" v-model="scope.row.condition"></l-select>
|
||||
</template>
|
||||
<l-table-btns v-if="!disabled" :isFixed="false" :btns="tableBtns" @click="handleTableBtnClick2">
|
||||
</l-table-btns>
|
||||
</l-table>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item v-if="!node.isInherit" :title="$t('表单设置')" name="4">
|
||||
<div style="padding:0 16px;">
|
||||
<div style="text-align: center;margin-bottom:16px;">
|
||||
<el-radio-group :disabled="disabled" v-model="node.formType" size="mini"
|
||||
@change="handleFormTypeChange">
|
||||
<el-radio-button label="1">自定义表单</el-radio-button>
|
||||
<el-radio-button label="2">系统表单</el-radio-button>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
<div v-show="node.formType === '1'">
|
||||
<el-form-item label-width="0px">
|
||||
<l-custmerform-select v-model="node.formCode" @change="custmerformChange"
|
||||
:disabled="disabled">
|
||||
</l-custmerform-select>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0px">
|
||||
<l-select v-model="node.formVerison" :disabled="disabled" :options="formVerisons"
|
||||
@change="custmerformVerisonChange" placeholder="请选择表单版本">
|
||||
</l-select>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0px">
|
||||
<l-select v-model="node.formRelationId" :disabled="disabled" :options="node.formRelations"
|
||||
placeholder="请选择流程关联字段">
|
||||
</l-select>
|
||||
</el-form-item>
|
||||
|
||||
</div>
|
||||
<div v-show="node.formType === '2'">
|
||||
<el-form-item label-width="0px">
|
||||
<el-input v-model="node.formUrl" placeholder="请输入PC端表单地址" :readonly="disabled">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label-width="0px">
|
||||
<el-input v-model="node.formAppUrl" placeholder="请输入APP端表单地址" :readonly="disabled">
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-divider>表单字段权限</el-divider>
|
||||
<template v-if="node.formType === '1'">
|
||||
<l-table height="notset" :isShowNum="false" :columns="columns" :dataSource="node.authFields"
|
||||
ref="authField">
|
||||
<template v-slot:required="scope">
|
||||
<el-switch v-model="scope.row.required"
|
||||
:disabled="disabled || scope.row.type == 'grid'">
|
||||
</el-switch>
|
||||
</template>
|
||||
<template v-slot:isEdit="scope">
|
||||
<el-switch v-model="scope.row.isEdit"
|
||||
:disabled="disabled || scope.row.type == 'gridrequired'">
|
||||
</el-switch>
|
||||
</template>
|
||||
<template v-slot:isLook="scope">
|
||||
<el-switch v-model="scope.row.isLook"
|
||||
:disabled="disabled || scope.row.type == 'grid' || scope.row.type == 'gridrequired'">
|
||||
</el-switch>
|
||||
</template>
|
||||
</l-table>
|
||||
</template>
|
||||
<template v-else>
|
||||
<l-edit-table addBtnText="添加字段" :dataSource="node.authFields" :isShowNum="false"
|
||||
:isAddBtn="!disabled" :isRemoveBtn="!disabled" @addRow="handleAddAuthField"
|
||||
@deleteRow="handleDeleteAuthField">
|
||||
<el-table-column prop="label" label="名称" minWidth="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input :readonly="disabled" size="mini" v-model="scope.row.label"
|
||||
placeholder="请输入名称"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="field" label="字段" minWidth="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input :readonly="disabled" size="mini" v-model="scope.row.field"
|
||||
placeholder="请输入字段"></el-input>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="required" label="必填" width="64">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.required" :disabled="disabled">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isEdit" label="编辑" width="64">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isEdit" :disabled="disabled">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="isLook" label="查看" width="64">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isLook" :disabled="disabled">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</l-edit-table>
|
||||
</template>
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item :title="$t('按钮设置')" name="5">
|
||||
<l-edit-table addBtnText="添加按钮" :dataSource="node.btnlist" :isShowNum="false"
|
||||
:hasDeleteBtn="hasBtnsDeleteBtn" :isAddBtn="!disabled" :isRemoveBtn="!disabled"
|
||||
@addRow="handleAddBtns" @deleteRow="handleDeleteBtns">
|
||||
<el-table-column prop="name" label="名称" minWidth="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input :readonly="disabled" v-if="!scope.row.isSys" size="mini" v-model="scope.row.name"
|
||||
placeholder="请输入名称"></el-input>
|
||||
<span v-else>{{scope.row.name}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="code" label="编码" minWidth="100">
|
||||
<template slot-scope="scope">
|
||||
<el-input :readonly="disabled" v-if="!scope.row.isSys" size="mini" v-model="scope.row.code"
|
||||
placeholder="请输入编码"></el-input>
|
||||
<span v-else>{{scope.row.code}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="hidden" label="隐藏" width="64">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.hidden" :disabled="disabled">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="isSign" label="签章" width="64">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.isSign" :disabled="disabled">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" prop="isNextAuditor" label="下一审核人" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-if="scope.row.code != 'disagree'" v-model="scope.row.isNextAuditor"
|
||||
:disabled="disabled">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</l-edit-table>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item :title="$t('会签设置')" name="6">
|
||||
<div style="padding:0 16px">
|
||||
<el-form-item label="是否会签">
|
||||
<el-switch v-model="node.isCountersign" :disabled="disabled">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<template v-if="node.isCountersign">
|
||||
<el-form-item label="审核方式">
|
||||
<l-radio :disabled="disabled" v-model="node.countersignType"
|
||||
:options="[{value:'1',label:'并行'},{value:'2',label:'串行'}]">
|
||||
</l-radio>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="node.countersignType == '1'" label="是否等待">
|
||||
<!--并行才有这个设置-->
|
||||
<el-switch v-model="node.isCountersignAll" :disabled="disabled">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="node.countersignType == '1'" label="通过百分比">
|
||||
<el-input-number :disabled="disabled" :min="1" :max="100" v-model="node.countersignAllType">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="再次审核">
|
||||
<l-radio :disabled="disabled" v-model="node.countersignAgian"
|
||||
:options="[{value:'1',label:'已同意不需要审核'},{value:'2',label:'已同意需要审核'}]">
|
||||
</l-radio>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item :title="$t('超时设置')" name="7">
|
||||
<div style="padding:0 16px">
|
||||
<el-form-item label="超时通知">
|
||||
<el-switch :disabled="disabled" v-model="node.isOvertimeMessage">
|
||||
</el-switch>
|
||||
</el-form-item>
|
||||
<template v-if="node.isOvertimeMessage">
|
||||
|
||||
<el-form-item label="第一次通知(时)">
|
||||
<el-input-number :disabled="disabled" :min="1" v-model="node.overtimeMessageStart">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="通知间隔(时)">
|
||||
<el-input-number :disabled="disabled" :min="1" v-model="node.overtimeMessageInterval">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="超时流转时间(时)">
|
||||
<el-input-number :disabled="disabled" :min="1" v-model="node.overtimeGo">
|
||||
</el-input-number>
|
||||
</el-form-item>
|
||||
<el-form-item label="超时通知策略">
|
||||
<l-checkbox :disabled="disabled" v-model="node.overtimeMessageType"
|
||||
:options="[{value:'1',label:'短信'},{value:'2',label:'邮箱'},{value:'3',label:'微信'},{value:'4',label:'站内消息'}]">
|
||||
</l-checkbox>
|
||||
</el-form-item>
|
||||
</template>
|
||||
|
||||
</div>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
|
||||
|
||||
<l-dialog :title="$t('添加岗位')" :visible.sync="selectPostVisible" :height="480" width="1024px"
|
||||
@ok="handlePostSelectOk" @closed="handlePostSelectClosed">
|
||||
<l-post-select-panel ref="postSelectPanel"></l-post-select-panel>
|
||||
</l-dialog>
|
||||
|
||||
<l-dialog :title="$t('添加角色')" :visible.sync="selectRoleVisible" :height="480" width="800px"
|
||||
@ok="handleRoleSelectOk" @closed="handleRoleSelectClosed">
|
||||
<l-role-select-panel ref="roleSelectPanel"></l-role-select-panel>
|
||||
</l-dialog>
|
||||
|
||||
|
||||
<l-dialog :title="$t('添加用户')" :visible.sync="selectUserVisible" :height="480" width="1024px"
|
||||
@ok="handleUserSelectOk" @closed="handleUserSelectClosed">
|
||||
<l-user-select-panel ref="userSelectPanel"></l-user-select-panel>
|
||||
</l-dialog>
|
||||
|
||||
<!--上下级选择-->
|
||||
<l-dialog :title="$t('上下级选择')" :visible.sync="levelVisible" :height="200" width="500px" @ok="handleLevelOk"
|
||||
@closed="handleLevelClosed">
|
||||
<!-- <auditor-level-form ref="auditorLevelForm"></auditor-level-form> -->
|
||||
</l-dialog>
|
||||
|
||||
<!--流程节点选择-->
|
||||
<l-dialog :title="$t('流程节点选择')" :visible.sync="nodeAuditorVisible" :height="200" width="500px"
|
||||
@ok="handleNodeAuditorOk" @closed="handleNodeAuditorClosed" @opened="handleNodeAuditorOpened">
|
||||
<!-- <node-auditor-form ref="nodeAuditorForm"></node-auditor-form> -->
|
||||
</l-dialog>
|
||||
|
||||
<!--流程节点选择-->
|
||||
<l-dialog :title="$t('数据表字段选择')" :visible.sync="auditorSqlVisible" width="500px" :height="300"
|
||||
@ok="handleAuditorSqlOk" @closed="handleAuditorSqlClosed">
|
||||
<!-- <auditor-sql-form ref="auditorSqlForm"></auditor-sql-form> -->
|
||||
</l-dialog>
|
||||
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
// const apiForm = window.$api.custmerForm.scheme
|
||||
|
||||
// import auditorLevelForm from './auditorLevel.vue'
|
||||
// import nodeAuditorForm from './auditorNode.vue'
|
||||
// import auditorSqlForm from './auditorSql.vue'
|
||||
|
||||
export default {
|
||||
name: 'user-task-option',
|
||||
props: {
|
||||
disabled: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
// auditorLevelForm,
|
||||
// nodeAuditorForm,
|
||||
// auditorSqlForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
activeNames: ['1'],
|
||||
columns: [
|
||||
{ label: '名称', prop: 'label', minWidth: '100' },
|
||||
{ label: '字段', prop: 'field', minWidth: '100' },
|
||||
{ label: '必填', prop: 'required', width: '64', align: 'center' },
|
||||
{ label: '编辑', prop: 'isEdit', width: '64', align: 'center' },
|
||||
{ label: '查看', prop: 'isLook', width: '64', align: 'center' },
|
||||
],
|
||||
tableBtns: [
|
||||
{ prop: 'Delete', label: '删除' }
|
||||
],
|
||||
atuoAgreeOptions: [{ value: '1', label: '处理人就是提交人' }, { value: '2', label: '处理人和上一步的处理人相同' }, { value: '3', label: '处理人审批过' }],
|
||||
noAuditorOptions: [{ value: '1', label: '超级管理员处理' }, { value: '2', label: '跳过此步骤' }, { value: '3', label: '不能提交' }],
|
||||
userColumns: [
|
||||
{ label: '类型', prop: 'type', width: '64' },
|
||||
{ label: '名称', prop: 'name', minWidth: '100' },
|
||||
{ label: '附加条件', prop: 'condition', minWidth: '100' }
|
||||
],
|
||||
|
||||
conditionOptions: [{ value: '1', label: '同一个部门' }, { value: '2', label: '同一个公司' }, { value: '3', label: '发起人上级' }, { value: '4', label: '发起人下级' }],
|
||||
|
||||
selectPostVisible: false,
|
||||
selectRoleVisible: false,
|
||||
selectUserVisible: false,
|
||||
levelVisible: false,
|
||||
nodeAuditorVisible: false,
|
||||
auditorSqlVisible: false,
|
||||
|
||||
isLooker: false,
|
||||
|
||||
}
|
||||
},
|
||||
asyncComputed: {
|
||||
formVerisons: {
|
||||
async get() {
|
||||
let res = []
|
||||
if (!this.$validatenull(this.node.formCode) && this.node.formType == '1') {
|
||||
// res = await this.$awaitWraper(apiForm.getHistoryList(this.node.formCode))
|
||||
}
|
||||
return (res || []).map(t => { return { label: this.lr_dateFormat(t.f_CreateDate), value: t.f_Id } })
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
node() {
|
||||
return this.wfdesign.currentWfNode;
|
||||
}
|
||||
},
|
||||
inject: ["wfdesign"],
|
||||
methods: {
|
||||
async custmerformChange(val) {
|
||||
this.$set(this.node, 'formRelationId', '')
|
||||
if (val == null) {
|
||||
this.node.authFields = [];
|
||||
this.node.formVerison = ''
|
||||
return;
|
||||
}
|
||||
if (this.$validatenull(this.wfdesign.custmerformSchemes[val.f_SchemeId])) {
|
||||
// const {f_SchemeInfoId,f_Scheme,f_Id} = (await this.$awaitWraper(apiForm.getHistory(val.f_SchemeId))) || {}
|
||||
const { f_SchemeInfoId, f_Scheme, f_Id } = {}
|
||||
this.wfdesign.custmerformSchemes[f_Id] = { f_Scheme }
|
||||
if (this.node.formCode == f_SchemeInfoId) {
|
||||
this.loadFormScheme(f_Scheme)
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.loadFormScheme(this.wfdesign.custmerformSchemes[val.f_SchemeId].f_Scheme);
|
||||
}
|
||||
this.node.formVerison = val.f_SchemeId
|
||||
},
|
||||
async custmerformVerisonChange(val) {
|
||||
this.$set(this.node, 'formRelationId', '')
|
||||
if (this.$validatenull(val)) {
|
||||
this.node.authFields = []
|
||||
return
|
||||
}
|
||||
if (this.$validatenull(this.wfdesign.custmerformSchemes[val.value])) {
|
||||
// const {f_Scheme,f_Id} = (await this.$awaitWraper(apiForm.getHistory(val.value))) || {}
|
||||
const { f_Scheme, f_Id } = {}
|
||||
this.wfdesign.custmerformSchemes[f_Id] = { f_Scheme }
|
||||
if (this.node.formVerison == f_Id) {
|
||||
this.loadFormScheme(f_Scheme)
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.loadFormScheme(this.wfdesign.custmerformSchemes[val.value].f_Scheme);
|
||||
}
|
||||
},
|
||||
loadFormScheme(strScheme) {
|
||||
const scheme = JSON.parse(strScheme)
|
||||
const fields = []
|
||||
const rfields = []
|
||||
scheme.formInfo.tabList.forEach(tab => {
|
||||
tab.components.forEach(component => {
|
||||
if (['guid'].includes(component.type)) {
|
||||
rfields.push({ label: component.label, value: component.prop })
|
||||
}
|
||||
|
||||
if (!['gridtable', 'divider'].includes(component.type) && component.display) {
|
||||
fields.push({
|
||||
prop: component.prop,
|
||||
field: component.field,
|
||||
label: component.label,
|
||||
table: component.table,
|
||||
required: component.required,
|
||||
isEdit: true,
|
||||
isLook: true
|
||||
})
|
||||
}
|
||||
else if (['gridtable'].includes(component.type)) {
|
||||
fields.push({
|
||||
prop: `${component.prop}_add`,
|
||||
label: `${component.label || '表格'}-添加按钮`,
|
||||
required: false,
|
||||
isEdit: true,
|
||||
isLook: false,
|
||||
type: 'grid'
|
||||
})
|
||||
fields.push({
|
||||
prop: `${component.prop}_remove`,
|
||||
label: `${component.label || '表格'}-删除按钮`,
|
||||
required: false,
|
||||
isEdit: true,
|
||||
isLook: false,
|
||||
type: 'grid'
|
||||
})
|
||||
|
||||
fields.push({
|
||||
prop: `${component.prop}_required`,
|
||||
label: `${component.label || '表格'}-数据`,
|
||||
required: component.required,
|
||||
isEdit: false,
|
||||
isLook: false,
|
||||
type: 'gridrequired'
|
||||
})
|
||||
fields.push(...component.children.filter(t => t.display).map(t => {
|
||||
return {
|
||||
gridprop: component.prop,
|
||||
prop: t.prop,
|
||||
field: t.field,
|
||||
label: `${component.label || '表格'}-${t.label}`,
|
||||
table: component.table,
|
||||
required: t.required,
|
||||
isEdit: true,
|
||||
isLook: true
|
||||
}
|
||||
}))
|
||||
}
|
||||
})
|
||||
})
|
||||
this.node.formRelations = rfields
|
||||
this.node.authFields = fields
|
||||
|
||||
},
|
||||
handleFormTypeChange() {
|
||||
this.node.formCode = ''
|
||||
this.node.formUrl = ''
|
||||
this.node.formAppUrl = ''
|
||||
this.node.authFields = []
|
||||
this.node.formRelations = []
|
||||
|
||||
this.$set(this.node, 'formRelationId', '')
|
||||
|
||||
},
|
||||
handleAddAuthField() {
|
||||
this.node.authFields.push({
|
||||
field: '',
|
||||
label: '',
|
||||
required: true,
|
||||
isEdit: true,
|
||||
isLook: true
|
||||
})
|
||||
},
|
||||
handleDeleteAuthField(row) {
|
||||
this.node.authFields.splice(row.index, 1);
|
||||
},
|
||||
|
||||
handleTableBtnClick(btn) {
|
||||
this.node.auditUsers.splice(btn.rowIndex, 1);
|
||||
},
|
||||
handleTableBtnClick2(btn) {
|
||||
this.node.lookUsers.splice(btn.rowIndex, 1);
|
||||
},
|
||||
|
||||
typeFormat(type) {
|
||||
switch (type) {
|
||||
case '1':
|
||||
return '岗位'
|
||||
case '2':
|
||||
return '角色'
|
||||
case '3':
|
||||
return '用户'
|
||||
case '4':
|
||||
return '上下级'
|
||||
case '5':
|
||||
return '节点'
|
||||
case '6':
|
||||
return '表字段'
|
||||
}
|
||||
},
|
||||
addTableData(selectData) {
|
||||
if (this.isLooker) {
|
||||
let addData2 = selectData.filter(t => this.node.lookUsers.findIndex(t2 => t2.id == t.id && t2.type == t.type) == -1);
|
||||
this.node.lookUsers = this.node.lookUsers.concat(addData2);
|
||||
}
|
||||
else {
|
||||
let addData = selectData.filter(t => this.node.auditUsers.findIndex(t2 => t2.id == t.id && t2.type == t.type) == -1);
|
||||
this.node.auditUsers = this.node.auditUsers.concat(addData);
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
handlePostClick(isLooker) {
|
||||
this.selectPostVisible = true;
|
||||
this.isLooker = isLooker;
|
||||
},
|
||||
handlePostSelectClosed() {
|
||||
this.$refs.postSelectPanel.resetForm();
|
||||
},
|
||||
handlePostSelectOk() {
|
||||
let selectData = this.$refs.postSelectPanel.getForm().map(t => { return { type: '1', id: t.f_PostId, name: t.name } });
|
||||
this.addTableData(selectData);
|
||||
this.selectPostVisible = false;
|
||||
},
|
||||
|
||||
handleRoleClick(isLooker) {
|
||||
this.selectRoleVisible = true;
|
||||
this.isLooker = isLooker;
|
||||
},
|
||||
handleRoleSelectClosed() {
|
||||
this.$refs.roleSelectPanel.resetForm();
|
||||
},
|
||||
handleRoleSelectOk() {
|
||||
let selectData = this.$refs.roleSelectPanel.getForm().map(t => { return { type: '2', id: t.f_RoleId, name: t.f_FullName, condition: '' } });
|
||||
this.addTableData(selectData);
|
||||
this.selectRoleVisible = false;
|
||||
},
|
||||
|
||||
handleUserClick(isLooker) {
|
||||
this.selectUserVisible = true;
|
||||
this.isLooker = isLooker;
|
||||
},
|
||||
handleUserSelectClosed() {
|
||||
this.$refs.userSelectPanel.resetForm();
|
||||
},
|
||||
handleUserSelectOk() {
|
||||
let selectData = this.$refs.userSelectPanel.getForm().map(t => { return { type: '3', id: t.f_UserId, name: t.name } });
|
||||
this.addTableData(selectData);
|
||||
this.selectUserVisible = false;
|
||||
},
|
||||
|
||||
|
||||
handleLevelClick(isLooker) {
|
||||
this.levelVisible = true;
|
||||
this.isLooker = isLooker;
|
||||
},
|
||||
handleLevelClosed() {
|
||||
this.$refs.auditorLevelForm.resetForm();
|
||||
},
|
||||
handleLevelOk() {
|
||||
this.$refs.auditorLevelForm.validateForm(() => {
|
||||
let data = this.$refs.auditorLevelForm.getForm();
|
||||
this.addTableData([data]);
|
||||
this.levelVisible = false;
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
handleNodeAuditorClick(isLooker) {
|
||||
this.nodeAuditorVisible = true;
|
||||
this.isLooker = isLooker;
|
||||
},
|
||||
handleNodeAuditorOk() {
|
||||
this.$refs.nodeAuditorForm.validateForm(() => {
|
||||
let data = this.$refs.nodeAuditorForm.getForm();
|
||||
this.addTableData([data]);
|
||||
this.nodeAuditorVisible = false;
|
||||
});
|
||||
},
|
||||
handleNodeAuditorClosed() {
|
||||
this.$refs.nodeAuditorForm.resetForm();
|
||||
},
|
||||
handleNodeAuditorOpened() {
|
||||
let wfdata = this.wfdesign.handleGetWFData();
|
||||
this.$refs.nodeAuditorForm.setForm(wfdata.filter(t => t.type = 'userTask' && t.id != this.node.id));
|
||||
},
|
||||
|
||||
|
||||
handleAuditorSqlClick(isLooker) {
|
||||
this.auditorSqlVisible = true;
|
||||
this.isLooker = isLooker;
|
||||
},
|
||||
handleAuditorSqlOk() {
|
||||
this.$refs.auditorSqlForm.validateForm(() => {
|
||||
let data = this.$refs.auditorSqlForm.getForm();
|
||||
data.name = `${data.table}【${data.auditorField}】`
|
||||
this.addTableData([data]);
|
||||
this.auditorSqlVisible = false;
|
||||
});
|
||||
},
|
||||
handleAuditorSqlClosed() {
|
||||
this.$refs.auditorSqlForm.resetForm();
|
||||
},
|
||||
|
||||
hasBtnsDeleteBtn(row) {
|
||||
if (row.isSys) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
},
|
||||
handleAddBtns() {
|
||||
this.node.btnlist.push({ code: '', name: '', hidden: false, isNextAuditor: false, isSign: false })
|
||||
},
|
||||
handleDeleteBtns(row) {
|
||||
this.node.btnlist.splice(row.index, 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-03-05 17:09:44
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-07 16:14:52
|
||||
* @Description:
|
||||
-->
|
||||
<!-- 开始节点配置 -->
|
||||
<template>
|
||||
<div class="user-task">
|
||||
|
|
@ -48,41 +41,133 @@
|
|||
<a-collapse-panel key="2" header="审核人员设置">
|
||||
<a-space>
|
||||
<a-radio-group size="small">
|
||||
<a-radio-button value="1" @click="handlePostClick">岗位</a-radio-button>
|
||||
<a-radio-button value="2" @click="handleRoleClick">角色</a-radio-button>
|
||||
<a-radio-button value="3" @click="handleAccountClick">用户</a-radio-button>
|
||||
<a-radio-button value="3" @click="handleLevelClick">上下级</a-radio-button>
|
||||
<a-radio-button value="3" @click="handleNodeAuditorClick">节点执行人</a-radio-button>
|
||||
<a-radio-button value="3" @click="handleAuditorSqlClick">表字段</a-radio-button>
|
||||
<a-radio-button value="1" @click="handlePostClick(false)">岗位</a-radio-button>
|
||||
<a-radio-button value="2" @click="handleRoleClick(false)">角色</a-radio-button>
|
||||
<a-radio-button value="3" @click="handleAccountClick(false)">用户</a-radio-button>
|
||||
<a-radio-button value="3" @click="handleLevelClick(false)">上下级</a-radio-button>
|
||||
<a-radio-button value="3" @click="handleNodeAuditorClick(false)">节点执行人</a-radio-button>
|
||||
<a-radio-button value="3" @click="handleAuditorSqlClick(false)">表字段</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-space>
|
||||
<a-table size="small" :columns="columns" :data-source="dataSource" bordered :pagination="false">
|
||||
<a-table size="small" :columns="data.userColumns" :data-source="node.auditUsers" bordered
|
||||
:pagination="false">
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="['name', 'type'].includes(column.dataIndex)">
|
||||
<div>
|
||||
{{ text }}
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="['condition'].includes(column.dataIndex)">
|
||||
<div>
|
||||
<a-select v-model:value="record[column.dataIndex]" :options="data.conditionOptions">
|
||||
</a-select>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'operation'">
|
||||
<a-popconfirm v-if="dataSource.length" title="Sure to delete?"
|
||||
@confirm="onDelete(record.key)">
|
||||
<a>Delete</a>
|
||||
</a-popconfirm>
|
||||
<delete-outlined two-tone-color='#eb2f96' @click='onDelete(record.name,false)' />
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-collapse-panel>
|
||||
<a-collapse-panel key="3" header="This is panel header 3">
|
||||
<p>{{ text }}</p>
|
||||
<a-collapse-panel key="3" header="传阅人员设置">
|
||||
<a-space>
|
||||
<a-radio-group size="small">
|
||||
<a-radio-button value="1" @click="handlePostClick(true)">岗位</a-radio-button>
|
||||
<a-radio-button value="2" @click="handleRoleClick(true)">角色</a-radio-button>
|
||||
<a-radio-button value="3" @click="handleAccountClick(true)">用户</a-radio-button>
|
||||
<a-radio-button value="3" @click="handleLevelClick(true)">上下级</a-radio-button>
|
||||
<a-radio-button value="3" @click="handleNodeAuditorClick(true)">节点执行人</a-radio-button>
|
||||
<a-radio-button value="3" @click="handleAuditorSqlClick(true)">表字段</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-space>
|
||||
<a-table size="small" :columns="data.userColumns" :data-source="node.lookUsers" bordered
|
||||
:pagination="false">
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="['name', 'type'].includes(column.dataIndex)">
|
||||
<div>
|
||||
{{ text }}
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="['condition'].includes(column.dataIndex)">
|
||||
<div>
|
||||
<a-select v-model:value="record[column.dataIndex]" :options="data.conditionOptions">
|
||||
</a-select>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'operation'">
|
||||
<delete-outlined two-tone-color='#eb2f96' @click='onDelete(record.name,true)' />
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
</a-collapse-panel>
|
||||
<a-collapse-panel key="4" header="This is panel header 3">
|
||||
<p>{{ text }}</p>
|
||||
<a-collapse-panel key="4" header="按钮设置">
|
||||
<a-table size="small" :columns="data.columns" :data-source="node.btnlist" bordered
|
||||
:pagination="false">
|
||||
<template #bodyCell="{ column, text, record }">
|
||||
<template v-if="['name', 'code'].includes(column.dataIndex)">
|
||||
<div>
|
||||
<a-input v-model:value="record[column.dataIndex]" placeholder="请输入" />
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="['isNextAuditor', 'isSign','hidden'].includes(column.dataIndex)">
|
||||
<div>
|
||||
<a-switch v-model:checked="record[column.dataIndex]" />
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="column.dataIndex === 'operation'">
|
||||
<delete-outlined two-tone-color='#eb2f96' @click='handleDeleteBtns(record.code)' />
|
||||
</template>
|
||||
</template>
|
||||
</a-table>
|
||||
<a-divider plain="true"></a-divider>
|
||||
<a-space>
|
||||
<a-button @click="handleAddBtns" width="100%" type="dashed" danger :icon="h(PlusOutlined)">
|
||||
添加字段</a-button>
|
||||
</a-space>
|
||||
</a-collapse-panel>
|
||||
<a-collapse-panel key="5" header="This is panel header 3">
|
||||
<p>{{ text }}</p>
|
||||
<a-collapse-panel key="5" header="会签设置">
|
||||
<a-form-item label="是否会签">
|
||||
<a-switch v-model:checked="node.isCountersign" />
|
||||
</a-form-item>
|
||||
<template v-if="node.isCountersign">
|
||||
<a-form-item label="审核方式">
|
||||
<a-radio-group v-model:value="node.countersignType" name="checkboxgroup"
|
||||
:options="[{value:'1',label:'并行'},{value:'2',label:'串行'}]" />
|
||||
</a-form-item>
|
||||
<template v-if="node.countersignType == 1">
|
||||
<a-form-item label="是否等待">
|
||||
<a-switch v-model:checked="node.isCountersignAll" />
|
||||
</a-form-item>
|
||||
<a-form-item label="通过百分比">
|
||||
<a-input-number id="inputNumber" v-model:value="node.countersignAllType" :min="1"
|
||||
:max="100" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
<a-form-item label="再次审核">
|
||||
<a-radio-group v-model:value="node.countersignAgian" name="checkboxgroup"
|
||||
:options="[{value:'1',label:'已同意不需要审核'},{value:'2',label:'已同意需要审核'}]" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
</a-collapse-panel>
|
||||
<a-collapse-panel key="6" header="This is panel header 3">
|
||||
<p>{{ text }}</p>
|
||||
<a-collapse-panel key="6" header="超时设置">
|
||||
<a-form-item label="超时通知">
|
||||
<a-switch v-model:checked="node.isOvertimeMessage" />
|
||||
</a-form-item>
|
||||
<template v-if="node.isOvertimeMessage">
|
||||
<a-form-item label="第一次通知(时)">
|
||||
<a-input-number id="inputNumber" v-model:value="node.overtimeMessageStart" :min="1" />
|
||||
</a-form-item>
|
||||
<a-form-item label="通知间隔(时)">
|
||||
<a-input-number id="inputNumber" v-model:value="node.overtimeMessageInterval" :min="1" />
|
||||
</a-form-item>
|
||||
<a-form-item label="超时流转时间(时)">
|
||||
<a-input-number id="inputNumber" v-model:value="node.overtimeGo" :min="1" />
|
||||
</a-form-item>
|
||||
<a-form-item label="超时通知策略">
|
||||
<a-checkbox-group v-model:value="node.overtimeMessageType" name="checkboxgroup"
|
||||
:options="[{value:'1',label:'短信'},{value:'2',label:'邮箱'},{value:'3',label:'微信'},{value:'4',label:'站内消息'}]" />
|
||||
</a-form-item>
|
||||
</template>
|
||||
</a-collapse-panel>
|
||||
</a-collapse>
|
||||
|
||||
|
|
@ -103,13 +188,14 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { reactive, ref, onMounted, nextTick, unref } from 'vue';
|
||||
import { reactive, ref, onMounted, nextTick, unref, h, watch, defineProps } from 'vue';
|
||||
import { BasicTree, TreeItem } from '@/components/Tree';
|
||||
import SelectPos from '@/components/SelectPos/index.vue';
|
||||
import SelectRole from '@/components/SelectRole/index.vue';
|
||||
import SelectAccount from '@/components/SelectAccount/index.vue';
|
||||
import AuditorLevel from './src/auditorLevel.vue'
|
||||
import { getOrgPositonTree, userOrgs } from '@/api/demo/system';
|
||||
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons-vue'
|
||||
const labelCol = { span: 7 };
|
||||
const wrapperCol = { span: 17 };
|
||||
const data = reactive({
|
||||
|
|
@ -118,12 +204,46 @@
|
|||
postOpen: false,
|
||||
roleOpen: false,
|
||||
accountOpen: false,
|
||||
levelOpen:false,
|
||||
levelOpen: false,
|
||||
userColumns: [
|
||||
{ title: '类型', dataIndex: 'type' },
|
||||
{ title: '名称', dataIndex: 'name' },
|
||||
{ title: '附加条件', dataIndex: 'condition', width: 130 },
|
||||
{ title: '操作', dataIndex: 'operation' }
|
||||
],
|
||||
columns: [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '编码',
|
||||
dataIndex: 'code',
|
||||
},
|
||||
{
|
||||
title: '隐藏',
|
||||
dataIndex: 'hidden',
|
||||
},
|
||||
{
|
||||
title: '签章',
|
||||
dataIndex: 'isSign',
|
||||
},
|
||||
{
|
||||
title: '下一审批人',
|
||||
dataIndex: 'isNextAuditor',
|
||||
},
|
||||
{
|
||||
title: '',
|
||||
dataIndex: 'operation',
|
||||
}
|
||||
|
||||
],
|
||||
isLooker: false,
|
||||
conditionOptions: [{ value: '1', label: '同一个部门' }, { value: '2', label: '同一个公司' }, { value: '3', label: '发起人上级' }, { value: '4', label: '发起人下级' }],
|
||||
})
|
||||
const node = reactive({
|
||||
id: "edb713be-7a25-44a2-8048-1f9abc638680",
|
||||
type: "userTask",
|
||||
id: "",
|
||||
type: "",
|
||||
isAddSign: false,
|
||||
isTransfer: false,
|
||||
isBatchAudit: false,
|
||||
|
|
@ -171,61 +291,62 @@
|
|||
overtimeMessageInterval: 1,
|
||||
overtimeGo: 12,
|
||||
isInherit: true,
|
||||
isInit: true
|
||||
isInit: true,
|
||||
|
||||
})
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'type',
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
dataIndex: 'operation',
|
||||
},
|
||||
|
||||
];
|
||||
const dataSource = [
|
||||
{
|
||||
id: 0,
|
||||
name: "王五",
|
||||
type: "管理员",
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
name: "王五",
|
||||
type: "管理员",
|
||||
},
|
||||
]
|
||||
|
||||
|
||||
const props = defineProps({
|
||||
element: Object
|
||||
})
|
||||
watch(
|
||||
() => props.element,
|
||||
(newVal, oldVal) => {
|
||||
if (newVal.type == "bpmn:Task") {
|
||||
node.id = newVal.id
|
||||
node.type = newVal.type
|
||||
}
|
||||
}
|
||||
)
|
||||
// 岗位
|
||||
const posRef = ref < any > ()
|
||||
|
||||
function handlePostClick() {
|
||||
function handlePostClick(isLooker) {
|
||||
data.postOpen = true;
|
||||
data.isLooker = isLooker;
|
||||
}
|
||||
function postHandleOk() {
|
||||
console.log(posRef.value.getRow())
|
||||
|
||||
}
|
||||
// 角色
|
||||
const roleRef = ref < any > ()
|
||||
|
||||
function handleRoleClick() {
|
||||
function handleRoleClick(isLooker) {
|
||||
data.isLooker = isLooker;
|
||||
data.roleOpen = true;
|
||||
}
|
||||
function roleHandleOk() {
|
||||
console.log(roleRef.value.getRow())
|
||||
var list = roleRef.value.getRow()
|
||||
list.forEach(element => {
|
||||
if (data.isLooker) {
|
||||
// 传阅人员
|
||||
node.lookUsers.push({
|
||||
name: element.name,
|
||||
type: '角色',
|
||||
condition: ''
|
||||
})
|
||||
} else {
|
||||
// 审核人员
|
||||
node.auditUsers.push({
|
||||
name: element.name,
|
||||
type: '角色',
|
||||
condition: ''
|
||||
})
|
||||
}
|
||||
});
|
||||
data.roleOpen = false;
|
||||
}
|
||||
// 用户
|
||||
const accountRef = ref < any > ()
|
||||
|
||||
function handleAccountClick() {
|
||||
function handleAccountClick(isLooker) {
|
||||
data.isLooker = isLooker;
|
||||
data.accountOpen = true;
|
||||
}
|
||||
function accountHandleOk() {
|
||||
|
|
@ -233,17 +354,44 @@
|
|||
}
|
||||
// 上下级
|
||||
const levelRef = ref < any > ()
|
||||
function handleLevelClick() {
|
||||
function handleLevelClick(isLooker) {
|
||||
data.isLooker = isLooker;
|
||||
data.levelOpen = true;
|
||||
}
|
||||
function levelHandleOk() {
|
||||
console.log(levelRef.value.getRow())
|
||||
}
|
||||
|
||||
// 审核人员设置
|
||||
function onDelete(key, isLook) {
|
||||
if (isLook) {
|
||||
node.lookUsers = node.lookUsers.filter(item => item.name !== key);
|
||||
} else {
|
||||
node.auditUsers = node.auditUsers.filter(item => item.name !== key);
|
||||
}
|
||||
}
|
||||
// 按钮设置
|
||||
function handleAddBtns() {
|
||||
node.btnlist.push({ code: '', name: '', hidden: false, isNextAuditor: false, isSign: false })
|
||||
}
|
||||
function handleDeleteBtns(key) {
|
||||
node.btnlist = node.btnlist.filter(item => item.code !== key);
|
||||
}
|
||||
function getForm() {
|
||||
if(node.id!=''){
|
||||
return node
|
||||
}
|
||||
}
|
||||
defineExpose({
|
||||
getForm
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
::v-deep .ant-select-single {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.site-space-compact-wrapper {
|
||||
width: 100%;
|
||||
|
||||
|
|
@ -272,4 +420,16 @@
|
|||
::v-deep .ant-table-content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
::v-deep .ant-collapse-content-box {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::v-deep .ant-collapse .ant-collapse-content>.ant-collapse-content-box {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
::v-deep .ant-collapse>.ant-collapse-item>.ant-collapse-header {
|
||||
padding: 12px 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,3 +1,4 @@
|
|||
import CryptoJS from 'crypto-js/crypto-js';
|
||||
// 创建监听器实例
|
||||
export function createListenerObject(options, isTask, prefix) {
|
||||
const listenerObj = Object.create(null);
|
||||
|
|
@ -67,3 +68,28 @@ export function uuid(length = 8, chars) {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export function lr_AESKey(key){
|
||||
const length = key.length
|
||||
if(length <32){
|
||||
for(let i=0,len =32 - length;i<len;i++){
|
||||
key += "0"
|
||||
}
|
||||
return key
|
||||
}
|
||||
else{
|
||||
return key.substring(0, 32)
|
||||
}
|
||||
}
|
||||
// AES加解密算法
|
||||
export function lr_AESEncrypt(source, key) {
|
||||
key = CryptoJS.enc.Utf8.parse(lr_AESKey(key))//32位
|
||||
let iv = CryptoJS.enc.Utf8.parse("1234567890000000")//16位
|
||||
//let srcs = CryptoJS.enc.Utf8.parse(source)
|
||||
let encrypted = CryptoJS.AES.encrypt(source, key, {
|
||||
iv: iv,
|
||||
mode: CryptoJS.mode.CBC,
|
||||
padding: CryptoJS.pad.Pkcs7
|
||||
})
|
||||
return encrypted.toString()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-03-07 10:43:34
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-07 10:49:15
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="m-4 mr-0 overflow-hidden bg-white">
|
||||
<BasicTree title="部门列表" toolbar treeWrapperClassName="h-[calc(100%-35px)] overflow-auto" loadData
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
/*
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-03-07 10:43:34
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-07 10:48:39
|
||||
* @Description:
|
||||
*/
|
||||
import { getAllRoleList, isAccountExist } from '@/api/demo/system';
|
||||
import { BasicColumn, FormSchema } from '@/components/Table';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-03-07 10:43:34
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-07 10:56:46
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<!-- <PageWrapper dense contentFullHeight fixedHeight contentClass="flex"> -->
|
||||
<div class="select-account">
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-03-07 10:00:26
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-07 15:37:30
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<BasicTree ref="asyncExpandTreeRef" title="部门和职级列表" toolbar treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-03-07 10:00:26
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-07 10:50:39
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<BasicTable @register="registerTable" :searchInfo="searchInfo"> </BasicTable>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
/*
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-13 13:04:15
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-01-19 14:50:22
|
||||
* @Description:
|
||||
*/
|
||||
/**
|
||||
* @description: Request result set
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
/*
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-13 13:04:15
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-06 10:56:44
|
||||
* @Description:
|
||||
*/
|
||||
import 'uno.css';
|
||||
import '@/design/index.less';
|
||||
import '@/components/VxeTable/src/css/index.scss';
|
||||
|
|
|
|||
|
|
@ -1,18 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-17 15:24:04
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-01-18 08:41:32
|
||||
* @Description:
|
||||
-->
|
||||
<!--
|
||||
* @Author: 滕嵩
|
||||
* @Date: 2024-01-25 08:59:36
|
||||
* @LastEditors: 滕嵩
|
||||
* @LastEditTime: 2024-01-25 10:55:02
|
||||
* @FilePath: \vue-vben-admin\src\mars\components\mars-work\main-view.vue
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<ConfigProvider :locale="locale">
|
||||
<div class="mars-main-view" id="mars-main-view">
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-17 15:24:04
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-01-18 08:40:39
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<KeepAlive>
|
||||
<div :style="{ height: height + 'px' }">
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
/*
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-13 13:04:15
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-01-25 09:30:23
|
||||
* @Description:
|
||||
*/
|
||||
import type { AppRouteRecordRaw, AppRouteModule } from '@/router/types';
|
||||
|
||||
import { PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '@/router/routes/basic';
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
/*
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-13 13:04:15
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-01 14:24:28
|
||||
* @Description:
|
||||
*/
|
||||
import type { AppRouteModule } from '@/router/types';
|
||||
|
||||
import { LAYOUT } from '@/router/constant';
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
/*
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-13 13:04:15
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-01-22 08:55:09
|
||||
* @Description:
|
||||
*/
|
||||
import { isObject, isString } from '@/utils/is';
|
||||
|
||||
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
||||
|
|
|
|||
|
|
@ -1,11 +1,3 @@
|
|||
/*
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-13 13:04:15
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-01-22 08:55:09
|
||||
* @FilePath: \费县天空地大屏正式代码e:\新架构\vue-vben-admin\src\utils\http\axios\helper.ts
|
||||
* @Description:
|
||||
*/
|
||||
import { isObject, isString } from '@/utils/is';
|
||||
|
||||
const DATE_TIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-16 13:48:53
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-01-17 16:53:26
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div id="mars3dContainer" class="mars3d-container"></div>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-27 10:58:29
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-01-27 14:15:31
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="分配角色" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" >
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-29 08:58:01
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-01-30 08:44:07
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="分配部门和职级" @ok="handleSubmit">
|
||||
<BasicTree ref="asyncExpandTreeRef" title="部门和职级列表" toolbar treeWrapperClassName="h-[calc(100%-35px)] overflow-auto"
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
isUpdate: true,
|
||||
});
|
||||
}
|
||||
async function editMenu(node: Recordable) {
|
||||
async function editMenu(node) {
|
||||
var query = {
|
||||
id: node.id
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-02-01 09:07:48
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-02-01 16:55:15
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
|
||||
<BasicTable @register="registerTable" :searchInfo="searchInfo"/>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-29 08:58:01
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-01-30 13:39:08
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div>
|
||||
<BasicModal v-bind="$attrs" @register="registerModal" title="分配菜单" @ok="handleSubmit">
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-02-26 13:22:28
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-02-26 13:23:09
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
流程发起
|
||||
</template>
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" showFooter title="历史记录" width="60%" @ok="handleSubmit">
|
||||
<BasicTable @register="registerTable" :searchInfo="searchInfo">
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<TableAction :actions="[
|
||||
{
|
||||
icon: 'clarity:info-standard-line',
|
||||
tooltip: '查看历史记录',
|
||||
onClick: handleHistory.bind(null, record),
|
||||
}
|
||||
]" />
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</BasicTable>
|
||||
</BasicDrawer>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, unref, reactive, onMounted, h } from 'vue';
|
||||
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
|
||||
import { getLoadHistoryPage,updateScheme } from '@/api/sys/WFSchemeInfo';
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { Tag, Switch } from 'ant-design-vue';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
defineOptions({ name: 'HistoryDrawer' });
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const rowId = ref('');
|
||||
const searchInfo = reactive < Recordable > ({});
|
||||
const schemeId = ref('')
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
searchInfo.id = data.record.id
|
||||
schemeId.value = data.record.schemeId
|
||||
reload()
|
||||
});
|
||||
const [registerTable, { reload, getPaginationRef, }] = useTable({
|
||||
api: getLoadHistoryPage,
|
||||
columns: [
|
||||
{
|
||||
title: '创建人',
|
||||
dataIndex: 'createUserName',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createDate',
|
||||
},
|
||||
{
|
||||
title: '状态',
|
||||
dataIndex: 'type',
|
||||
customRender: ({ record }) => {
|
||||
if (record.type == 1) {
|
||||
const color = 'green';
|
||||
const text = '正式';
|
||||
return h(Tag, { color: color }, () => text);
|
||||
} else {
|
||||
const color = 'blue';
|
||||
const text = '草稿';
|
||||
return h(Tag, { color: color }, () => text);
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '当前版本',
|
||||
dataIndex: 'enabledMark',
|
||||
width: 80,
|
||||
customRender: ({ record }) => {
|
||||
if (!record.type) {
|
||||
const color = 'blue';
|
||||
const text = '草稿';
|
||||
return h(Tag, { color: color }, () => text);
|
||||
} else {
|
||||
return h(Switch, {
|
||||
checked: record.id === schemeId.value,
|
||||
onChange(checked) {
|
||||
const { createMessage } = useMessage();
|
||||
updateScheme({ schemeId: record.id, id: searchInfo.id })
|
||||
.then((data) => {
|
||||
createMessage.success(data.message);
|
||||
schemeId.value = record.id
|
||||
reload()
|
||||
})
|
||||
.catch((err) => {
|
||||
createMessage.error(err.message);
|
||||
})
|
||||
.finally(() => {
|
||||
record.pendingStatus = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
useSearchForm: false,
|
||||
showTableSetting: false,
|
||||
tableSetting: { fullScreen: true },
|
||||
showIndexColumn: false,
|
||||
maxHeight: 680,
|
||||
rowKey: 'id',
|
||||
handleSearchInfoFn(info) {
|
||||
return info;
|
||||
},
|
||||
actionColumn: {
|
||||
width: 100,
|
||||
title: '操作',
|
||||
dataIndex: 'action',
|
||||
// slots: { customRender: 'action' },
|
||||
},
|
||||
});
|
||||
function handleHistory(record) {
|
||||
|
||||
}
|
||||
onMounted(() => {
|
||||
});
|
||||
async function handleSubmit() {
|
||||
try {
|
||||
const values = await validate();
|
||||
let query = values
|
||||
// 调用接口
|
||||
if (!unref(isUpdate)) {
|
||||
const data = await addRole(query);
|
||||
} else {
|
||||
const data = await updateRole(query);
|
||||
}
|
||||
|
||||
|
||||
setModalProps({ confirmLoading: true });
|
||||
// TODO custom api
|
||||
closeModal();
|
||||
emit('success');
|
||||
} finally {
|
||||
setModalProps({ confirmLoading: false });
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-02-27 09:06:43
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-02-27 10:49:01
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<BasicDrawer v-bind="$attrs" @register="registerDrawer" showFooter :title="getTitle" width="500px" @ok="handleSubmit">
|
||||
<BasicForm @register="registerForm" />
|
||||
|
|
@ -16,14 +9,14 @@
|
|||
import { formSchema } from './scheme.data';
|
||||
import { BasicDrawer, useDrawerInner } from '@/components/Drawer';
|
||||
|
||||
import { getMenuList, addMenu, editMenu, addButton, editButton } from '@/api/demo/system';
|
||||
import { postAdd, update } from '@/api/sys/sysDataItemDetail';
|
||||
|
||||
defineOptions({ name: 'SchemeDrawer' });
|
||||
|
||||
const emit = defineEmits(['success', 'register']);
|
||||
|
||||
const isUpdate = ref(true);
|
||||
|
||||
const detail = ref({})
|
||||
const [registerForm, { resetFields, setFieldsValue, updateSchema, validate }] = useForm({
|
||||
labelWidth: 90,
|
||||
baseColProps: { span: 24 },
|
||||
|
|
@ -32,24 +25,17 @@
|
|||
});
|
||||
|
||||
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
|
||||
console.log(data)
|
||||
resetFields();
|
||||
setDrawerProps({ confirmLoading: false });
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
|
||||
if (unref(isUpdate)) {
|
||||
detail.value = data.record
|
||||
setFieldsValue({
|
||||
...data.record,
|
||||
});
|
||||
}
|
||||
const treeData = await getMenuList();
|
||||
updateSchema({
|
||||
field: 'parentId',
|
||||
componentProps: { treeData },
|
||||
});
|
||||
updateSchema({
|
||||
field: 'moduleId',
|
||||
componentProps: { treeData },
|
||||
});
|
||||
});
|
||||
|
||||
const getTitle = computed(() => (!unref(isUpdate) ? '新增' : '编辑'));
|
||||
|
|
@ -58,28 +44,18 @@
|
|||
try {
|
||||
const values = await validate();
|
||||
setDrawerProps({ confirmLoading: true });
|
||||
// TODO custom api
|
||||
console.log(values)
|
||||
if (values.type == '1') {
|
||||
console.log("新增菜单")
|
||||
delete values.type
|
||||
// 新增菜单
|
||||
if (!unref(isUpdate)) {
|
||||
const data = await addMenu(values);
|
||||
} else {
|
||||
const data = await editMenu(values);
|
||||
}
|
||||
if (isUpdate.value) {
|
||||
var querys = detail.value
|
||||
querys.description = values.description
|
||||
querys.enabledMark = values.enabledMark
|
||||
querys.itemName = values.itemName
|
||||
querys.itemValue = values.itemValue
|
||||
querys.sortCode = values.sortCode
|
||||
const data = await update(querys);
|
||||
closeDrawer();
|
||||
emit('success');
|
||||
} else {
|
||||
console.log("新增按钮")
|
||||
// 新增按钮
|
||||
delete values.type
|
||||
if (!unref(isUpdate)) {
|
||||
const data = await addButton(values);
|
||||
} else {
|
||||
const data = await editButton(values);
|
||||
}
|
||||
const data = await postAdd('FlowSort', values);
|
||||
closeDrawer();
|
||||
emit('success');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,48 +1,43 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-02-27 09:06:43
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-05 16:00:45
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<div class="m-4 mr-0 overflow-hidden bg-white">
|
||||
<BasicTree ref="asyncExpandTreeRef" title="流程分类" toolbar search
|
||||
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto" loadData :actionList="actionList"
|
||||
:renderIcon="createIcon" :clickRowToExpand="false" :treeData="treeData" :fieldNames="{ key: 'id', title: 'name' }"
|
||||
:defaultExpandAll="true" @select="handleSelect" />
|
||||
treeWrapperClassName="h-[calc(100%-35px)] overflow-auto" loadData :actionList="actionList"
|
||||
:renderIcon="createIcon" :clickRowToExpand="false" :treeData="treeData"
|
||||
:fieldNames="{ key: 'itemDetailId', title: 'itemName' }" :defaultExpandAll="true" @select="handleSelect" />
|
||||
<BasicModal @register="register" title="删除" :helpMessage="['提示1', '提示2']" @ok="handleSubmit">
|
||||
确认要删除流程分类吗?
|
||||
</BasicModal>
|
||||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, ref, h, nextTick, unref } from 'vue';
|
||||
import { onMounted, ref, h, nextTick, unref, createVNode } from 'vue';
|
||||
import { BasicTree, TreeItem, TreeActionItem } from '@/components/Tree';
|
||||
import { getMenuList, deleteMenu } from '@/api/demo/system';
|
||||
import { PlusOutlined, FormOutlined, DeleteOutlined } from '@ant-design/icons-vue';
|
||||
import { Card, Row, Col, Spin } from 'ant-design-vue';
|
||||
import { getLoad, del } from '@/api/sys/sysDataItemDetail';
|
||||
import { PlusOutlined, FormOutlined, DeleteOutlined, ExclamationCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { Card, Row, Col, Spin, Modal } from 'ant-design-vue';
|
||||
import { BasicModal, useModal } from '@/components/Modal';
|
||||
import { router } from '@/router';
|
||||
const [register, { closeModal, openModal }] = useModal();
|
||||
defineOptions({ name: 'DeptTree' });
|
||||
|
||||
const emit = defineEmits(['select', 'edit']);
|
||||
const emit = defineEmits(['select', 'edit', 'success']);
|
||||
|
||||
const treeData = ref < TreeItem[] > ([]);
|
||||
let selectItemId = ref('')
|
||||
const asyncExpandTreeRef = ref < Nullable < TreeActionType >> (null);
|
||||
const treeLoading = ref(false);
|
||||
async function handleSubmit() {
|
||||
var query = [selectItemId.value]
|
||||
const data = await deleteMenu(query);
|
||||
closeModal();
|
||||
|
||||
var query = {
|
||||
id: selectItemId.value
|
||||
}
|
||||
console.log(query)
|
||||
const data = await del(query);
|
||||
emit('success')
|
||||
}
|
||||
|
||||
async function fetch() {
|
||||
treeLoading.value = true;
|
||||
treeData.value = (await getMenuList()) as unknown as TreeItem[];
|
||||
treeData.value = (await getLoad({ code: 'FlowSort' })) as unknown as TreeItem[];
|
||||
// 展开全部
|
||||
nextTick(() => {
|
||||
treeLoading.value = false;
|
||||
|
|
@ -51,12 +46,19 @@
|
|||
}
|
||||
|
||||
function handleSelect(keys) {
|
||||
emit('select', keys[0]);
|
||||
var itemDetailId = keys[0]
|
||||
var itemName
|
||||
treeData.value.forEach(element => {
|
||||
if (itemDetailId == element.itemDetailId) {
|
||||
itemName = element.itemName
|
||||
}
|
||||
});
|
||||
emit('select', itemName);
|
||||
}
|
||||
const btnList = router.currentRoute.value.meta.elements
|
||||
const actionList: TreeActionItem[] = []
|
||||
btnList.forEach(element => {
|
||||
if(element.domId=='btnAdd'){
|
||||
if (element.domId == 'btnAdd') {
|
||||
actionList.push({
|
||||
render: (node) => {
|
||||
return h(PlusOutlined, {
|
||||
|
|
@ -67,13 +69,19 @@
|
|||
});
|
||||
},
|
||||
})
|
||||
}else if (element.domId == 'btnEdit') {
|
||||
} else if (element.domId == 'btnEdit') {
|
||||
actionList.push({
|
||||
render: (node) => {
|
||||
let data = {}
|
||||
treeData.value.forEach(element => {
|
||||
if (element.itemDetailId == node.itemDetailId) {
|
||||
data = element
|
||||
}
|
||||
});
|
||||
return h(FormOutlined, {
|
||||
class: 'ml-2',
|
||||
onClick: () => {
|
||||
emit('edit', node);
|
||||
emit('edit', data);
|
||||
},
|
||||
});
|
||||
},
|
||||
|
|
@ -84,9 +92,21 @@
|
|||
return h(DeleteOutlined, {
|
||||
class: 'ml-2',
|
||||
onClick: () => {
|
||||
selectItemId.value = node.id
|
||||
openModal(true, {
|
||||
isUpdate: false,
|
||||
selectItemId.value = node.itemDetailId
|
||||
Modal.confirm({
|
||||
title: '删除?',
|
||||
icon: createVNode(ExclamationCircleOutlined),
|
||||
content: '你确定要删除当前流程分类吗',
|
||||
okText: '确定',
|
||||
okType: 'danger',
|
||||
cancelText: '取消',
|
||||
onOk() {
|
||||
console.log('OK');
|
||||
handleSubmit()
|
||||
},
|
||||
onCancel() {
|
||||
console.log('Cancel');
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<PageWrapper dense contentFullHeight fixedHeight contentClass="flex">
|
||||
<SchemeTree ref="childRef" class="w-1/4 xl:w-1/5" @select="handleSelect" @edit="editMenu" @add='handleCreate'/>
|
||||
<SchemeTree ref="childRef" class="w-1/4 xl:w-1/5" @select="handleSelect" @edit="classifyEdit" @add='handleCreate' @success="handleSuccess"/>
|
||||
<BasicTable class="w-3/4 xl:w-4/5" @register="registerTable" @fetch-success="onFetchSuccess"
|
||||
:searchInfo="searchInfo">
|
||||
<template #toolbar>
|
||||
|
|
@ -9,20 +9,19 @@
|
|||
</template>
|
||||
<template #bodyCell="{ column, record }">
|
||||
<template v-if="column.key === 'action'">
|
||||
<TableAction
|
||||
:actions="[
|
||||
<TableAction :actions="[
|
||||
{
|
||||
icon: 'clarity:info-standard-line',
|
||||
tooltip: '查看历史记录',
|
||||
onClick: handleView.bind(null, record),
|
||||
onClick: handleHistory.bind(null, record),
|
||||
}
|
||||
]"
|
||||
/>
|
||||
]" />
|
||||
</template>
|
||||
</template>
|
||||
|
||||
</BasicTable>
|
||||
<SchemeDrawer @register="registerDrawer" @success="handleSuccess" />
|
||||
<HistoryDrawer @register="registerHistoryDrawer" @success="handleSuccess" />
|
||||
</PageWrapper>
|
||||
|
||||
</template>
|
||||
|
|
@ -30,17 +29,19 @@
|
|||
import { reactive, nextTick, ref } from 'vue';
|
||||
|
||||
import { BasicTable, useTable, TableAction } from '@/components/Table';
|
||||
import { getMenuList, getButtonList, getMenuDetail, deleteButton } from '@/api/demo/system';
|
||||
import { getButtonList, getMenuDetail, deleteButton } from '@/api/demo/system';
|
||||
import { getLoadPage } from '@/api/sys/WFSchemeInfo';
|
||||
|
||||
import { PageWrapper } from '@/components/Page';
|
||||
import SchemeTree from './SchemeTree.vue';
|
||||
|
||||
import { useDrawer } from '@/components/Drawer';
|
||||
import SchemeDrawer from './SchemeDrawer.vue';
|
||||
|
||||
import HistoryDrawer from './HistoryDrawer.vue'
|
||||
import { columns, searchFormSchema } from './scheme.data';
|
||||
import PermissionBtn from '@/components/PermissionBtn/index.vue'
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
const { createConfirm,createMessage } = useMessage();
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
|
||||
import { useGo } from '@/hooks/web/usePage';
|
||||
const go = useGo();
|
||||
|
|
@ -48,12 +49,13 @@
|
|||
defineOptions({ name: 'SchemeManagement' });
|
||||
const searchInfo = reactive < Recordable > ({});
|
||||
|
||||
const [registerHistoryDrawer, { openDrawer:openHistoryDrawer }] = useDrawer();
|
||||
const [registerDrawer, { openDrawer }] = useDrawer();
|
||||
const [registerTable, { reload, expandAll, getSelectRows,clearSelectedRowKeys }] = useTable({
|
||||
const [registerTable, { reload, expandAll, getSelectRows, clearSelectedRowKeys }] = useTable({
|
||||
title: '模板列表',
|
||||
api: getButtonList,
|
||||
api: getLoadPage,
|
||||
columns,
|
||||
rowKey:'id',
|
||||
rowKey: 'id',
|
||||
formConfig: {
|
||||
labelWidth: 120,
|
||||
schemas: searchFormSchema,
|
||||
|
|
@ -87,37 +89,35 @@
|
|||
function handleView(record: Recordable) {
|
||||
go('/dashboard/scheme_preview/' + record.id);
|
||||
}
|
||||
// 查看历史记录
|
||||
function handleHistory(record){
|
||||
console.log(record)
|
||||
openHistoryDrawer(true,{
|
||||
record
|
||||
})
|
||||
}
|
||||
function handleEdit() {
|
||||
let rows = getSelectRows();
|
||||
if(rows.length == 0){
|
||||
return createMessage.warn('请选择一个按钮进行编辑');
|
||||
if (rows.length == 0) {
|
||||
return createMessage.warn('请选择一个模板进行编辑');
|
||||
}
|
||||
const record = rows[0]
|
||||
record.type = '2'
|
||||
go('/dashboard/scheme_preview/add?code='+record.code);
|
||||
}
|
||||
async function classifyEdit(record) {
|
||||
openDrawer(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
});
|
||||
}
|
||||
async function editMenu(node: Recordable) {
|
||||
var query = {
|
||||
id: node.id
|
||||
}
|
||||
const record = await getMenuDetail(query);
|
||||
record.type = '1'
|
||||
openDrawer(true, {
|
||||
record,
|
||||
isUpdate: true,
|
||||
});
|
||||
}
|
||||
function handleSelect(ModuleId = '') {
|
||||
searchInfo.ModuleId = ModuleId;
|
||||
function handleSelect(category = '') {
|
||||
searchInfo.category = category;
|
||||
clearSelectedRowKeys()
|
||||
reload();
|
||||
}
|
||||
async function handleDelete(record: Recordable) {
|
||||
let rows = getSelectRows();
|
||||
if(rows.length == 0){
|
||||
if (rows.length == 0) {
|
||||
return createMessage.warn('请选择一个按钮进行删除');
|
||||
}
|
||||
const query = [rows[0].id]
|
||||
|
|
@ -146,7 +146,7 @@
|
|||
console.log(domId)
|
||||
switch (domId) {
|
||||
case 'btnAdd':
|
||||
go('/dashboard/scheme_preview/add');
|
||||
go('/dashboard/scheme_preview/add');
|
||||
break;
|
||||
case 'btnEdit':
|
||||
handleEdit()
|
||||
|
|
|
|||
|
|
@ -1,104 +1,54 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-03-01 14:18:39
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-05 10:18:49
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
<!-- <process-viewer :key="`designer-${processView.index}`" :xml="processView.xmlData" :style="{height: '400px'}" /> -->
|
||||
<process-designer :key="designerOpen" style="border:1px solid rgba(0, 0, 0, 0.1);" ref="modelDesigner"
|
||||
v-loading="designerData.loading" :bpmnXml="designerData.bpmnXml" :designerForm="designerData.form"
|
||||
@save="onSaveDesigner" />
|
||||
<div class="preview-box">
|
||||
<div class="btn-box">
|
||||
<a-button type="primary" :icon="h(SaveOutlined)" @click="onSave" class="ml-2">保存流程 </a-button>
|
||||
</div>
|
||||
<process-designer :key="designerOpen" style="border:1px solid rgba(0, 0, 0, 0.1);" ref="modelDesigner"
|
||||
v-loading="designerData.loading" :bpmnXml="designerData.bpmnXml" :designerForm="designerData.form" :schemeCode="schemeCode"
|
||||
@save="onSaveDesigner" />
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts" setup>
|
||||
import { h, ref, provide, reactive, onMounted, defineProps, computed, defineEmits } from 'vue';
|
||||
import ProcessDesigner from '@/components/ProcessDesigner/index.vue';
|
||||
// import ProcessViewer from '@/components/ProcessViewer/index.vue'
|
||||
|
||||
export default {
|
||||
name: "Model",
|
||||
components: {
|
||||
ProcessDesigner,
|
||||
// ProcessViewer,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
designerOpen: false,
|
||||
designerData: {
|
||||
loading: false,
|
||||
bpmnXml: '',
|
||||
modelId: null,
|
||||
form: {
|
||||
processName: null,
|
||||
processKey: null
|
||||
}
|
||||
},
|
||||
designerModelId: null,
|
||||
processView: {
|
||||
title: '',
|
||||
open: false,
|
||||
index: undefined,
|
||||
xmlData: "",
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
},
|
||||
created() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
/** 查看流程图 */
|
||||
handleProcessView(row) {
|
||||
let modelId = row.modelId;
|
||||
this.processView.title = "流程图";
|
||||
this.processView.index = modelId;
|
||||
// 发送请求,获取xml
|
||||
getBpmnXml(modelId).then(response => {
|
||||
this.processView.xmlData = response.data;
|
||||
})
|
||||
this.processView.open = true;
|
||||
},
|
||||
/** 设计按钮操作 */
|
||||
handleDesigner(row) {
|
||||
this.designerData.bpmnXml = '';
|
||||
this.designerData.title = "流程设计 - " + row.modelName;
|
||||
// this.designerData.modelId = row.modelId;
|
||||
// this.designerData.form = {
|
||||
// processName: row.modelName,
|
||||
// processKey: row.modelKey
|
||||
// }
|
||||
// if (row.modelId) {
|
||||
// this.designerData.loading = true;
|
||||
// getBpmnXml(row.modelId).then(response => {
|
||||
// this.designerData.bpmnXml = response.data || '';
|
||||
// this.designerData.loading = false;
|
||||
// this.designerOpen = true;
|
||||
// })
|
||||
// }
|
||||
},
|
||||
onSaveDesigner(bpmnXml) {
|
||||
console.log(bpmnXml)
|
||||
// this.bpmnXml = bpmnXml;
|
||||
// let dataBody = {
|
||||
// modelId: this.designerData.modelId,
|
||||
// bpmnXml: this.bpmnXml
|
||||
// }
|
||||
// this.$confirm("是否将此模型保存为新版本?", "提示", {
|
||||
// distinguishCancelAndClose: true,
|
||||
// confirmButtonText: '是',
|
||||
// cancelButtonText: '否'
|
||||
// }).then(() => {
|
||||
// this.confirmSave(dataBody, true)
|
||||
// }).catch(action => {
|
||||
// if (action === 'cancel') {
|
||||
// this.confirmSave(dataBody, false)
|
||||
// }
|
||||
// })
|
||||
},
|
||||
import { SaveOutlined, ZoomOutOutlined, ZoomInOutlined, RotateLeftOutlined, RotateRightOutlined, ClearOutlined } from '@ant-design/icons-vue';
|
||||
import { postAdd ,update} from '@/api/sys/WFSchemeInfo'
|
||||
import { useRoute } from 'vue-router'
|
||||
const route = useRoute()
|
||||
const schemeCode = route.query.code
|
||||
const designerOpen = ref(false)
|
||||
const designerData = reactive({
|
||||
loading: false,
|
||||
bpmnXml: '',
|
||||
modelId: null,
|
||||
form: {
|
||||
processName: null,
|
||||
processKey: null
|
||||
}
|
||||
};
|
||||
})
|
||||
const modelDesigner = ref < any > ()
|
||||
async function onSave() {
|
||||
let validateData = await modelDesigner.value.validateFlow()
|
||||
if (validateData) {
|
||||
let formData = await modelDesigner.value.getFlow()
|
||||
formData.scheme.type = 1
|
||||
if(!schemeCode){
|
||||
let data = await postAdd(formData)
|
||||
}else{
|
||||
let data = await update(formData)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
.preview-box {
|
||||
.btn-box {
|
||||
padding: 10px;
|
||||
justify-content: flex-end;
|
||||
display: flex;
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,12 +1,14 @@
|
|||
import { BasicColumn, FormSchema } from '@/components/Table';
|
||||
import { h } from 'vue';
|
||||
import { Tag } from 'ant-design-vue';
|
||||
import { Tag,Switch } from 'ant-design-vue';
|
||||
import Icon from '@/components/Icon/Icon.vue';
|
||||
|
||||
import {updateState} from '@/api/sys/WFSchemeInfo'
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
const { createConfirm, createMessage } = useMessage();
|
||||
export const columns: BasicColumn[] = [
|
||||
{
|
||||
title: '编号',
|
||||
dataIndex: 'domId',
|
||||
dataIndex: 'code',
|
||||
},
|
||||
{
|
||||
title: '名称',
|
||||
|
|
@ -14,11 +16,50 @@ export const columns: BasicColumn[] = [
|
|||
},
|
||||
{
|
||||
title: '分类',
|
||||
dataIndex: 'name',
|
||||
dataIndex: 'category',
|
||||
},
|
||||
{
|
||||
title: '排序',
|
||||
dataIndex: 'sort',
|
||||
title: '状态',
|
||||
dataIndex: 'enabledMark',
|
||||
width: 80,
|
||||
customRender: ({ record }) => {
|
||||
if (!record.type) {
|
||||
const color = 'blue';
|
||||
const text = '草稿';
|
||||
return h(Tag, { color: color }, () => text);
|
||||
} else {
|
||||
return h(Switch, {
|
||||
checked: record.enabledMark === 1,
|
||||
checkedChildren: '启用',
|
||||
unCheckedChildren: '停用',
|
||||
loading: record.pendingStatus,
|
||||
onChange(checked) {
|
||||
record.pendingStatus = true;
|
||||
const newStatus = checked ? 1 : 0;
|
||||
const { createMessage } = useMessage();
|
||||
updateState({ id: record.id, state: newStatus })
|
||||
.then((data) => {
|
||||
record.enabledMark = newStatus;
|
||||
createMessage.success(data.message);
|
||||
})
|
||||
.catch((err) => {
|
||||
createMessage.error(err.message);
|
||||
})
|
||||
.finally(() => {
|
||||
record.pendingStatus = false;
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '创建人',
|
||||
dataIndex: 'createUserName',
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createDate',
|
||||
},
|
||||
|
||||
];
|
||||
|
|
@ -38,30 +79,30 @@ export const searchFormSchema: FormSchema[] = [
|
|||
|
||||
export const formSchema: FormSchema[] = [
|
||||
{
|
||||
field: 'id',
|
||||
field: 'itemDetailId',
|
||||
label: '名称',
|
||||
component: 'Input',
|
||||
ifShow:false
|
||||
},
|
||||
{
|
||||
field: 'name',
|
||||
field: 'itemName',
|
||||
label: '名称',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'value',
|
||||
field: 'itemValue',
|
||||
label: '值',
|
||||
component: 'Input',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
field: 'sortNo',
|
||||
field: 'sortCode',
|
||||
label: '排序',
|
||||
component: 'InputNumber',
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
field: 'enabledMark',
|
||||
label: '是否有效',
|
||||
component: 'RadioButtonGroup',
|
||||
defaultValue: 1,
|
||||
|
|
@ -73,8 +114,9 @@ export const formSchema: FormSchema[] = [
|
|||
},
|
||||
},
|
||||
{
|
||||
field: 'remark',
|
||||
field: 'description',
|
||||
label: '备注',
|
||||
component: 'InputTextArea',
|
||||
},
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,3 @@
|
|||
<!--
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-02-26 13:22:28
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-05 15:59:12
|
||||
* @Description:
|
||||
-->
|
||||
<template>
|
||||
流程任务
|
||||
</template>
|
||||
|
|
@ -1,10 +1,3 @@
|
|||
/*
|
||||
* @Author: 刘妍
|
||||
* @Date: 2024-01-13 13:04:15
|
||||
* @LastEditors: Do not edit
|
||||
* @LastEditTime: 2024-03-08 09:45:39
|
||||
* @Description:
|
||||
*/
|
||||
import { defineApplicationConfig } from '@vben/vite-config';
|
||||
import { mars3dPlugin } from 'vite-plugin-mars3d';
|
||||
import path, { resolve } from 'path';
|
||||
|
|
|
|||
Loading…
Reference in New Issue