Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b738439408
@ -0,0 +1,62 @@
|
|||||||
|
<template>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-input v-model="deptName" class="mb-20px" clearable placeholder="请输入部门名称" style="width: 280px">
|
||||||
|
<template #prefix>
|
||||||
|
<Icon icon="ep:search" />
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-tree
|
||||||
|
ref="treeRef"
|
||||||
|
:data="deptList"
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
:props="defaultProps"
|
||||||
|
highlight-current
|
||||||
|
node-key="id"
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ElTree } from 'element-plus'
|
||||||
|
import * as DeptApi from '@/api/system/dept'
|
||||||
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
|
|
||||||
|
defineOptions({ name: 'SystemUserDeptTree' })
|
||||||
|
|
||||||
|
const deptName = ref('')
|
||||||
|
const deptList = ref<Tree[]>([]) // 树形结构
|
||||||
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||||
|
|
||||||
|
/** 获得部门树 */
|
||||||
|
const getTree = async () => {
|
||||||
|
const res = await DeptApi.getSimpleDeptList()
|
||||||
|
deptList.value = []
|
||||||
|
deptList.value.push(...handleTree(res))
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 基于名字过滤 */
|
||||||
|
const filterNode = (name: string, data: Tree) => {
|
||||||
|
if (!name) return true
|
||||||
|
return data.name.includes(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 处理部门被点击 */
|
||||||
|
const handleNodeClick = async (row: { [key: string]: any }) => {
|
||||||
|
emits('node-click', row)
|
||||||
|
}
|
||||||
|
const emits = defineEmits(['node-click'])
|
||||||
|
|
||||||
|
/** 监听deptName */
|
||||||
|
watch(deptName, (val) => {
|
||||||
|
treeRef.value!.filter(val)
|
||||||
|
})
|
||||||
|
|
||||||
|
/** 初始化 */
|
||||||
|
onMounted(async () => {
|
||||||
|
await getTree()
|
||||||
|
})
|
||||||
|
</script>
|
@ -64,6 +64,14 @@
|
|||||||
<el-option v-for="item in postOptions" :key="item.id" :label="item.name" :value="item.id" />
|
<el-option v-for="item in postOptions" :key="item.id" :label="item.name" :value="item.id" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item
|
||||||
|
v-if="userTaskForm.candidateStrategy == 30"
|
||||||
|
label="用户部门"
|
||||||
|
prop="candidateParam"
|
||||||
|
span="24"
|
||||||
|
>
|
||||||
|
<DeptTree @node-click="handleDeptNodeClick" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item
|
<el-form-item
|
||||||
v-if="userTaskForm.candidateStrategy == 30"
|
v-if="userTaskForm.candidateStrategy == 30"
|
||||||
label="指定用户"
|
label="指定用户"
|
||||||
@ -79,9 +87,9 @@
|
|||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in userOptions"
|
v-for="item in userOptions"
|
||||||
:key="item.id"
|
:key="item['id']"
|
||||||
:label="item.nickname"
|
:label="item['nickname']"
|
||||||
:value="item.id"
|
:value="item['id']"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -135,6 +143,7 @@ import * as PostApi from '@/api/system/post'
|
|||||||
import * as UserApi from '@/api/system/user'
|
import * as UserApi from '@/api/system/user'
|
||||||
import * as UserGroupApi from '@/api/bpm/userGroup'
|
import * as UserGroupApi from '@/api/bpm/userGroup'
|
||||||
import ProcessExpressionDialog from './ProcessExpressionDialog.vue'
|
import ProcessExpressionDialog from './ProcessExpressionDialog.vue'
|
||||||
|
import DeptTree from '@/components/bpmnProcessDesigner/package/penal/task/task-components/DeptTree_Task.vue'
|
||||||
|
|
||||||
defineOptions({ name: 'UserTask' })
|
defineOptions({ name: 'UserTask' })
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
@ -154,6 +163,33 @@ const postOptions = ref<PostApi.PostVO[]>([]) // 岗位列表
|
|||||||
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
||||||
const userGroupOptions = ref<UserGroupApi.UserGroupVO[]>([]) // 用户组列表
|
const userGroupOptions = ref<UserGroupApi.UserGroupVO[]>([]) // 用户组列表
|
||||||
|
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
id: undefined,
|
||||||
|
username: undefined,
|
||||||
|
mobile: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
deptName: undefined,
|
||||||
|
createTime: []
|
||||||
|
})
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
try {
|
||||||
|
const data = await UserApi.getUserPage(queryParams)
|
||||||
|
userOptions.value = data.list
|
||||||
|
// console.log('userOptions.value',userOptions.value)
|
||||||
|
} finally {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** 处理部门被点击 */
|
||||||
|
const handleDeptNodeClick = async (row) => {
|
||||||
|
console.log('row.id',row)
|
||||||
|
queryParams.deptId = row.id
|
||||||
|
await getList()
|
||||||
|
}
|
||||||
|
|
||||||
const resetTaskForm = () => {
|
const resetTaskForm = () => {
|
||||||
const businessObject = bpmnElement.value.businessObject
|
const businessObject = bpmnElement.value.businessObject
|
||||||
if (!businessObject) {
|
if (!businessObject) {
|
||||||
|
62
src/views/bpm/group/DeptTree_Group.vue
Normal file
62
src/views/bpm/group/DeptTree_Group.vue
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
<template>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-input v-model="deptName" class="mb-20px" clearable placeholder="请输入部门名称" style="width: 600PX">
|
||||||
|
<template #prefix>
|
||||||
|
<Icon icon="ep:search" />
|
||||||
|
</template>
|
||||||
|
</el-input>
|
||||||
|
</div>
|
||||||
|
<div class="head-container">
|
||||||
|
<el-tree
|
||||||
|
ref="treeRef"
|
||||||
|
:data="deptList"
|
||||||
|
:expand-on-click-node="false"
|
||||||
|
:filter-node-method="filterNode"
|
||||||
|
:props="defaultProps"
|
||||||
|
highlight-current
|
||||||
|
node-key="id"
|
||||||
|
@node-click="handleNodeClick"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ElTree } from 'element-plus'
|
||||||
|
import * as DeptApi from '@/api/system/dept'
|
||||||
|
import { defaultProps, handleTree } from '@/utils/tree'
|
||||||
|
|
||||||
|
defineOptions({ name: 'SystemUserDeptTree' })
|
||||||
|
|
||||||
|
const deptName = ref('')
|
||||||
|
const deptList = ref<Tree[]>([]) // 树形结构
|
||||||
|
const treeRef = ref<InstanceType<typeof ElTree>>()
|
||||||
|
|
||||||
|
/** 获得部门树 */
|
||||||
|
const getTree = async () => {
|
||||||
|
const res = await DeptApi.getSimpleDeptList()
|
||||||
|
deptList.value = []
|
||||||
|
deptList.value.push(...handleTree(res))
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 基于名字过滤 */
|
||||||
|
const filterNode = (name: string, data: Tree) => {
|
||||||
|
if (!name) return true
|
||||||
|
return data.name.includes(name)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 处理部门被点击 */
|
||||||
|
const handleNodeClick = async (row: { [key: string]: any }) => {
|
||||||
|
emits('node-click', row)
|
||||||
|
}
|
||||||
|
const emits = defineEmits(['node-click'])
|
||||||
|
|
||||||
|
/** 监听deptName */
|
||||||
|
watch(deptName, (val) => {
|
||||||
|
treeRef.value!.filter(val)
|
||||||
|
})
|
||||||
|
|
||||||
|
/** 初始化 */
|
||||||
|
onMounted(async () => {
|
||||||
|
await getTree()
|
||||||
|
})
|
||||||
|
</script>
|
@ -13,6 +13,9 @@
|
|||||||
<el-form-item label="描述">
|
<el-form-item label="描述">
|
||||||
<el-input v-model="formData.description" placeholder="请输入描述" type="textarea" />
|
<el-input v-model="formData.description" placeholder="请输入描述" type="textarea" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item label="部门">
|
||||||
|
<DeptTree @node-click="handleDeptNodeClick" />
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="成员" prop="userIds">
|
<el-form-item label="成员" prop="userIds">
|
||||||
<el-select v-model="formData.userIds" multiple placeholder="请选择成员">
|
<el-select v-model="formData.userIds" multiple placeholder="请选择成员">
|
||||||
<el-option
|
<el-option
|
||||||
@ -42,6 +45,7 @@
|
|||||||
</Dialog>
|
</Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import DeptTree from '@/views/bpm/group/DeptTree_Group.vue'
|
||||||
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
import { DICT_TYPE, getIntDictOptions } from '@/utils/dict'
|
||||||
import { CommonStatusEnum } from '@/utils/constants'
|
import { CommonStatusEnum } from '@/utils/constants'
|
||||||
import * as UserGroupApi from '@/api/bpm/userGroup'
|
import * as UserGroupApi from '@/api/bpm/userGroup'
|
||||||
@ -72,6 +76,33 @@ const formRules = reactive({
|
|||||||
const formRef = ref() // 表单 Ref
|
const formRef = ref() // 表单 Ref
|
||||||
const userList = ref<any[]>([]) // 用户列表
|
const userList = ref<any[]>([]) // 用户列表
|
||||||
|
|
||||||
|
const queryParams = reactive({
|
||||||
|
pageNo: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
id: undefined,
|
||||||
|
username: undefined,
|
||||||
|
mobile: undefined,
|
||||||
|
status: undefined,
|
||||||
|
deptId: undefined,
|
||||||
|
deptName: undefined,
|
||||||
|
createTime: []
|
||||||
|
})
|
||||||
|
/** 查询列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
try {
|
||||||
|
const data = await UserApi.getUserPage(queryParams)
|
||||||
|
userList.value = data.list
|
||||||
|
// console.log('userList',userList.value)
|
||||||
|
} finally {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/** 处理部门被点击 */
|
||||||
|
const handleDeptNodeClick = async (row) => {
|
||||||
|
console.log('row.id',row)
|
||||||
|
queryParams.deptId = row.id
|
||||||
|
await getList()
|
||||||
|
}
|
||||||
|
|
||||||
/** 打开弹窗 */
|
/** 打开弹窗 */
|
||||||
const open = async (type: string, id?: number) => {
|
const open = async (type: string, id?: number) => {
|
||||||
dialogVisible.value = true
|
dialogVisible.value = true
|
||||||
|
Loading…
Reference in New Issue
Block a user