feat : 流程判断条件添加
This commit is contained in:
@@ -9,6 +9,7 @@ export const ValueType = {
|
|||||||
date: 'Date',
|
date: 'Date',
|
||||||
user: 'User',
|
user: 'User',
|
||||||
dept: 'Dept',
|
dept: 'Dept',
|
||||||
|
company: 'Company',
|
||||||
star: 'star',
|
star: 'star',
|
||||||
dateRange: 'DateRange'
|
dateRange: 'DateRange'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -111,7 +111,7 @@
|
|||||||
<el-switch inactive-text="不跳过" active-text="跳过" v-model="nodeProps.skipSelf"></el-switch>
|
<el-switch inactive-text="不跳过" active-text="跳过" v-model="nodeProps.skipSelf"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</span>
|
</span>
|
||||||
<el-form-item label="科创部矩阵" prop="dstiMatrix">
|
<el-form-item label="科创跳过" prop="dstiMatrix">
|
||||||
<el-switch inactive-text="审批" active-text="跳过"
|
<el-switch inactive-text="审批" active-text="跳过"
|
||||||
v-model="nodeProps.dstiMatrix"></el-switch>
|
v-model="nodeProps.dstiMatrix"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -123,7 +123,7 @@
|
|||||||
<el-switch inactive-text="不审批" active-text="审批" v-model="nodeProps.president"></el-switch>
|
<el-switch inactive-text="不审批" active-text="审批" v-model="nodeProps.president"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</span>
|
</span>
|
||||||
<el-form-item label="重复审批" prop="duplicateApproval">
|
<el-form-item label="重复跳过" prop="duplicateApproval">
|
||||||
<el-switch inactive-text="否" active-text="是"
|
<el-switch inactive-text="否" active-text="是"
|
||||||
v-model="nodeProps.duplicateApproval"></el-switch>
|
v-model="nodeProps.duplicateApproval"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-for="(group, index) in selectedNode.props.groups" :key="index + '_g'" class="group">
|
<div v-for="(group, index) in selectedNode.props.groups" :key="index + '_g'" class="group">
|
||||||
<div class="group-header">
|
<div class="group-header">
|
||||||
<span class="group-name">条件组 {{ groupNames[index] }}</span>
|
<!-- <span class="group-name">条件组 {{ groupNames[index] }}</span>-->
|
||||||
|
<span class="group-name">条件</span>
|
||||||
<div class="group-cp">
|
<div class="group-cp">
|
||||||
<span>组内条件关系:</span>
|
<!-- <span>组内条件关系:</span>-->
|
||||||
<el-switch v-model="group.groupType" active-color="#409EFF"
|
<!-- <el-switch v-model="group.groupType" active-color="#409EFF"-->
|
||||||
inactive-color="#c1c1c1" active-value="AND" inactive-value="OR"
|
<!-- inactive-color="#c1c1c1" active-value="AND" inactive-value="OR"-->
|
||||||
active-text="且" inactive-text="或"/>
|
<!-- active-text="且" inactive-text="或"/>-->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="group-operation">
|
<div class="group-operation">
|
||||||
@@ -24,13 +25,13 @@
|
|||||||
</el-checkbox>
|
</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-popover>
|
</el-popover>
|
||||||
<el-icon :size="18" class="group-icon" @click="delGroup(index)">
|
<!-- <el-icon :size="18" class="group-icon" @click="delGroup(index)">-->
|
||||||
<Close/>
|
<!-- <Close/>-->
|
||||||
</el-icon>
|
<!-- </el-icon>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="group-content">
|
<div class="group-content">
|
||||||
<p v-if="group.conditions.length === 0">点击右上角 + 为本条件组添加条件</p>
|
<p v-if="group.conditions.length === 0">点击右上角 + 添加条件</p>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<el-form ref="condition-form">
|
<el-form ref="condition-form">
|
||||||
<!--构建表达式-->
|
<!--构建表达式-->
|
||||||
@@ -44,7 +45,7 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
<span v-if="isSelect(condition.id)" style="margin-left: 10px">
|
<span v-if="isSelect(condition.id)" style="margin-left: 10px">
|
||||||
<el-select v-if="condition.compare === 'IN'" style="width: 280px;" clearable multiple size="small"
|
<el-select v-if="condition.compare === 'IN'" style="width: 280px;" clearable multiple size="small"
|
||||||
v-model="condition.value" placeholder="选择值" filterable >
|
v-model="condition.value" placeholder="选择值" filterable>
|
||||||
<el-option v-for="(option, oi) in getOptions(condition.id)" :key="oi" :label="option"
|
<el-option v-for="(option, oi) in getOptions(condition.id)" :key="oi" :label="option"
|
||||||
:value="option"></el-option>
|
:value="option"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
@@ -62,7 +63,8 @@
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="condition.valueType === ValueType.number">
|
<span v-else-if="condition.valueType === ValueType.number">
|
||||||
<el-select size="small" placeholder="判断符" style="width: 120px;" v-model="condition.compare" filterable clearable>
|
<el-select size="small" placeholder="判断符" style="width: 120px;" v-model="condition.compare" filterable
|
||||||
|
clearable>
|
||||||
<el-option :label="exp.label" :value="exp.value" :key="exp.value" v-for="exp in explains"></el-option>
|
<el-option :label="exp.label" :value="exp.value" :key="exp.value" v-for="exp in explains"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<span style="margin-left: 10px">
|
<span style="margin-left: 10px">
|
||||||
@@ -81,19 +83,22 @@
|
|||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="condition.valueType === ValueType.user">
|
<span v-else-if="condition.valueType === ValueType.company">
|
||||||
<span class="item-desc" style="margin-right: 20px">属于某部门 / 为某些人其中之一</span>
|
<span class="item-desc" style="margin-right: 20px">公司</span>
|
||||||
<el-button size="mini" :icon="Plus" type="primary" @click="selectUser(condition.value, 'user')"
|
<el-select placeholder="判断符" style="width: 120px;" v-model="condition.compare" filterable clearable>
|
||||||
round>选择人员/部门</el-button>
|
<el-option label="等于" value="="></el-option>
|
||||||
<org-items :modelValue="users"/>
|
<el-option label="不等于" value="!="></el-option>
|
||||||
|
</el-select>
|
||||||
|
<el-tree-select
|
||||||
|
v-model="condition.value[0]"
|
||||||
|
@node-click="(data)=>{
|
||||||
|
condition.value[1] = data.label
|
||||||
|
}"
|
||||||
|
:data="companyList"
|
||||||
|
check-strictly
|
||||||
|
style="width: 240px"
|
||||||
|
/>
|
||||||
</span>
|
</span>
|
||||||
<span v-else-if="condition.valueType === ValueType.dept">
|
|
||||||
<span class="item-desc" style="margin-right: 20px">为某部门 / 某部门下的部门</span>
|
|
||||||
<el-button size="mini" :icon="Plus" type="primary" @click="selectUser(condition.value, 'dept')"
|
|
||||||
round>选择部门</el-button>
|
|
||||||
<org-items :modelValue="users"/>
|
|
||||||
</span>
|
|
||||||
<span v-else-if="condition.valueType === ValueType.date"></span>
|
|
||||||
<el-icon class="delete-icon" @click="delSubCondition(group, cindex)">
|
<el-icon class="delete-icon" @click="delSubCondition(group, cindex)">
|
||||||
<Minus/>
|
<Minus/>
|
||||||
</el-icon>
|
</el-icon>
|
||||||
@@ -102,22 +107,20 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<org-picker title="请选择人员/部门" multiple ref="orgPicker" :v-model="users" @ok="selected"></org-picker>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import OrgPicker from "../common/UserPicker.vue";
|
|
||||||
import OrgItems from "../common/RoleItems.vue";
|
|
||||||
import {ValueType} from '@/views/workflow/form/ComponentsConfigExport.js'
|
import {ValueType} from '@/views/workflow/form/ComponentsConfigExport.js'
|
||||||
import {computed, ref} from 'vue'
|
import {computed, ref} from 'vue'
|
||||||
import {useProcessStore} from '@/stores/processStore.js'
|
import {useProcessStore} from '@/stores/processStore.js'
|
||||||
import Ellipsis from '../common/Ellipsis.vue'
|
import Ellipsis from '../common/Ellipsis.vue'
|
||||||
import {Plus, Minus} from '@element-plus/icons-vue'
|
import {getSubCompOpt} from '@/api/user/user.js';
|
||||||
|
|
||||||
const processStore = useProcessStore()
|
const processStore = useProcessStore()
|
||||||
|
|
||||||
const orgPicker = ref()
|
|
||||||
const users = ref([])
|
const users = ref([])
|
||||||
|
const companyList = ref([])
|
||||||
// const orgType = ref('user')
|
// const orgType = ref('user')
|
||||||
const showOrgSelect = ref(false)
|
const showOrgSelect = ref(false)
|
||||||
const groupNames = ref(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'])
|
const groupNames = ref(['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'])
|
||||||
@@ -186,19 +189,19 @@ const conditionValType = (type) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectUser = (value, orgType) => {
|
|
||||||
//选择用户,倒开组织选择器
|
|
||||||
// orgType.value = orgType
|
|
||||||
users.value = value
|
|
||||||
orgPicker.value.showUserPicker()
|
|
||||||
}
|
|
||||||
const filterConditionMosr = (list) => {
|
const filterConditionMosr = (list) => {
|
||||||
|
console.log(processFromPerms.value)
|
||||||
processFromPerms.value.forEach((item) => {
|
processFromPerms.value.forEach((item) => {
|
||||||
// console.log(item)
|
// console.log(item)
|
||||||
if (item.required && supportTypes.value.indexOf(item.valueType) > -1){
|
if (item.required && supportTypes.value.indexOf(item.valueType) > -1) {
|
||||||
list.push({title: item.title, id: item.id, valueType: item.valueType})
|
list.push({title: item.title, id: item.id, valueType: item.valueType})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
list.push({
|
||||||
|
title: '发起人公司',
|
||||||
|
id: 'subCompanyId',
|
||||||
|
valueType: ValueType.company
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const filterCondition = (item, list) => {
|
const filterCondition = (item, list) => {
|
||||||
@@ -255,6 +258,16 @@ const conditionChange = (index, group) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const getCompanyList = () => {
|
||||||
|
getSubCompOpt().then(res => {
|
||||||
|
companyList.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getCompanyList()
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -99,6 +99,9 @@ const content = computed(() => {
|
|||||||
case ValueType.string:
|
case ValueType.string:
|
||||||
subConditionStr = getOrdinaryConditionContent(subCondition)
|
subConditionStr = getOrdinaryConditionContent(subCondition)
|
||||||
break;
|
break;
|
||||||
|
case ValueType.company:
|
||||||
|
subConditionStr = `${subCondition.title}${subCondition.compare}${subCondition.value[1]?subCondition.value[1]:""}`
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
subConditions.push(subConditionStr)
|
subConditions.push(subConditionStr)
|
||||||
})
|
})
|
||||||
|
|||||||
168
vite.config.js
168
vite.config.js
@@ -1,8 +1,8 @@
|
|||||||
import { fileURLToPath, URL } from 'node:url'
|
import {fileURLToPath, URL} from 'node:url'
|
||||||
import { defineConfig } from 'vite'
|
import {defineConfig} from 'vite'
|
||||||
import AutoImport from 'unplugin-auto-import/vite'
|
import AutoImport from 'unplugin-auto-import/vite'
|
||||||
import Components from 'unplugin-vue-components/vite'
|
import Components from 'unplugin-vue-components/vite'
|
||||||
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
|
import {ElementPlusResolver} from 'unplugin-vue-components/resolvers'
|
||||||
import Icons from 'unplugin-icons/vite'
|
import Icons from 'unplugin-icons/vite'
|
||||||
import IconsResolver from 'unplugin-icons/resolver'
|
import IconsResolver from 'unplugin-icons/resolver'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
@@ -12,87 +12,89 @@ import viteSvgIcons from 'vite-plugin-svg-icons'
|
|||||||
import path from 'path'
|
import path from 'path'
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [
|
plugins: [
|
||||||
vue(),
|
vue(),
|
||||||
vueJsx(),
|
vueJsx(),
|
||||||
AutoImport({
|
AutoImport({
|
||||||
//自动导入vue相关函数
|
//自动导入vue相关函数
|
||||||
imports: ['vue','vue-router'],
|
imports: ['vue', 'vue-router'],
|
||||||
resolvers: [
|
resolvers: [
|
||||||
ElementPlusResolver(),
|
ElementPlusResolver(),
|
||||||
//自动导入图标组件
|
//自动导入图标组件
|
||||||
IconsResolver({
|
IconsResolver({
|
||||||
prefix: 'Icon',
|
prefix: 'Icon',
|
||||||
|
}),
|
||||||
|
],
|
||||||
}),
|
}),
|
||||||
],
|
Components({
|
||||||
}),
|
dirs: ['src/components', 'src/fvcomponents'],
|
||||||
Components({
|
resolvers: [
|
||||||
dirs: ['src/components', 'src/fvcomponents'],
|
// 自动注册图标组件
|
||||||
resolvers: [
|
IconsResolver({
|
||||||
// 自动注册图标组件
|
enabledRequirements: ['ep'],
|
||||||
IconsResolver({
|
}),
|
||||||
enabledRequirements: ['ep'],
|
//自动导入组件
|
||||||
|
ElementPlusResolver()
|
||||||
|
],
|
||||||
}),
|
}),
|
||||||
//自动导入组件
|
Icons({
|
||||||
ElementPlusResolver()
|
autoInstall: true,
|
||||||
],
|
}),
|
||||||
}),
|
viteSvgIcons({
|
||||||
Icons({
|
// 指定需要缓存的图标文件夹
|
||||||
autoInstall: true,
|
iconDirs: [path.resolve(__dirname, 'src/assets/svg')],
|
||||||
}),
|
// 指定symbolId格式
|
||||||
viteSvgIcons({
|
symbolId: 'icon-[dir]-[name]',
|
||||||
// 指定需要缓存的图标文件夹
|
}),
|
||||||
iconDirs: [path.resolve(__dirname, 'src/assets/svg')],
|
Inspect(),
|
||||||
// 指定symbolId格式
|
],
|
||||||
symbolId: 'icon-[dir]-[name]',
|
resolve: {
|
||||||
}),
|
alias: {
|
||||||
Inspect(),
|
'@': fileURLToPath(new URL('./src', import.meta.url))
|
||||||
],
|
}
|
||||||
resolve: {
|
},
|
||||||
alias: {
|
build: {
|
||||||
'@': fileURLToPath(new URL('./src', import.meta.url))
|
minify: 'esbuild',
|
||||||
|
terserOptions: {
|
||||||
|
compress: {
|
||||||
|
drop_console: false, // 生产环境移除log
|
||||||
|
drop_debugger: true // 生产环境禁用debugger
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
server: {
|
||||||
|
host: '0.0.0.0',
|
||||||
|
port: 8888,
|
||||||
|
strictPort: false,
|
||||||
|
open: true,
|
||||||
|
proxy: {
|
||||||
|
// '/api/workflow': {
|
||||||
|
// // target: 'http://frp.feashow.cn:31800/',
|
||||||
|
// target: 'http://clay.frp.feashow.cn/',
|
||||||
|
// // target: 'http://192.168.31.175:8000',
|
||||||
|
// changeOrigin: true,
|
||||||
|
// rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
|
// },
|
||||||
|
// '/api/admin': {
|
||||||
|
// // target: 'http://frp.feashow.cn:31800/',
|
||||||
|
// target: 'http://clay.frp.feashow.cn/',
|
||||||
|
// // target: 'http://192.168.31.175:8000',
|
||||||
|
// changeOrigin: true,
|
||||||
|
// rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
|
// },
|
||||||
|
'/api': {
|
||||||
|
// target: 'http://mosr.feashow.cn',
|
||||||
|
// target: 'http://kyglweb.scgzjy.com:8080/',
|
||||||
|
target: 'http://clay.frp.feashow.cn/',
|
||||||
|
// target: 'http://10.7.127.57:8000',
|
||||||
|
changeOrigin: true,
|
||||||
|
rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
|
},
|
||||||
|
'/api/notice-ws': {
|
||||||
|
target: 'ws://mosr.feashow.cn/api/notice-ws',
|
||||||
|
ws: true,
|
||||||
|
changeOrigin: true,
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
build: {
|
|
||||||
minify: 'esbuild',
|
|
||||||
terserOptions: {
|
|
||||||
compress: {
|
|
||||||
drop_console: false, // 生产环境移除log
|
|
||||||
drop_debugger: true // 生产环境禁用debugger
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
server: {
|
|
||||||
host: '0.0.0.0',
|
|
||||||
port: 8888,
|
|
||||||
strictPort: false,
|
|
||||||
open: true,
|
|
||||||
proxy: {
|
|
||||||
// '/api/workflow': {
|
|
||||||
// // target: 'http://frp.feashow.cn:31800/',
|
|
||||||
// target: 'http://clay.frp.feashow.cn/',
|
|
||||||
// // target: 'http://192.168.31.175:8000',
|
|
||||||
// changeOrigin: true,
|
|
||||||
// rewrite: (path) => path.replace(/^\/api/, '')
|
|
||||||
// },
|
|
||||||
// '/api/admin': {
|
|
||||||
// // target: 'http://frp.feashow.cn:31800/',
|
|
||||||
// target: 'http://clay.frp.feashow.cn/',
|
|
||||||
// // target: 'http://192.168.31.175:8000',
|
|
||||||
// changeOrigin: true,
|
|
||||||
// rewrite: (path) => path.replace(/^\/api/, '')
|
|
||||||
// },
|
|
||||||
'/api': {
|
|
||||||
// target: 'http://mosr.feashow.cn/',
|
|
||||||
target: 'http://10.7.127.57:8000',
|
|
||||||
changeOrigin: true,
|
|
||||||
rewrite: (path) => path.replace(/^\/api/, '')
|
|
||||||
},
|
|
||||||
'/api/notice-ws': {
|
|
||||||
target: 'ws://mosr.feashow.cn/api/notice-ws',
|
|
||||||
ws: true,
|
|
||||||
changeOrigin: true,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user