Commit c9d1100eacd139c625433aa15e7d5f62e511a211
1 parent
fabdccd9
perf: task assign rule
Showing
3 changed files
with
10 additions
and
26 deletions
yudao-ui-admin-vue3/package.json
| @@ -52,7 +52,6 @@ | @@ -52,7 +52,6 @@ | ||
| 52 | "vue-i18n": "9.2.2", | 52 | "vue-i18n": "9.2.2", |
| 53 | "vue-router": "^4.1.6", | 53 | "vue-router": "^4.1.6", |
| 54 | "vue-types": "^5.0.2", | 54 | "vue-types": "^5.0.2", |
| 55 | - "vue3-treeselect": "^0.1.10", | ||
| 56 | "vxe-table": "^4.3.9", | 55 | "vxe-table": "^4.3.9", |
| 57 | "web-storage-cache": "^1.1.1", | 56 | "web-storage-cache": "^1.1.1", |
| 58 | "xe-utils": "^3.5.7" | 57 | "xe-utils": "^3.5.7" |
yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/index.vue
| @@ -62,14 +62,14 @@ | @@ -62,14 +62,14 @@ | ||
| 62 | span="24" | 62 | span="24" |
| 63 | v-if="formData.type === 20 || formData.type === 21" | 63 | v-if="formData.type === 20 || formData.type === 21" |
| 64 | > | 64 | > |
| 65 | - <treeselect | 65 | + <el-tree-select |
| 66 | + ref="treeRef" | ||
| 66 | v-model="formData.deptIds" | 67 | v-model="formData.deptIds" |
| 67 | - :options="deptTreeOptions" | ||
| 68 | - multiple | ||
| 69 | - flat | ||
| 70 | - :defaultExpandLevel="3" | ||
| 71 | - placeholder="请选择指定部门" | ||
| 72 | - :normalizer="normalizer" | 68 | + node-key="id" |
| 69 | + show-checkbox | ||
| 70 | + :props="defaultProps" | ||
| 71 | + :data="deptTreeOptions" | ||
| 72 | + empty-text="加载中,请稍后" | ||
| 73 | /> | 73 | /> |
| 74 | </el-form-item> | 74 | </el-form-item> |
| 75 | <el-form-item label="指定岗位" prop="postIds" span="24" v-if="formData.type === 22"> | 75 | <el-form-item label="指定岗位" prop="postIds" span="24" v-if="formData.type === 22"> |
| @@ -127,18 +127,13 @@ | @@ -127,18 +127,13 @@ | ||
| 127 | </template> | 127 | </template> |
| 128 | <script setup lang="ts" name="TaskAssignRule"> | 128 | <script setup lang="ts" name="TaskAssignRule"> |
| 129 | // 全局相关的 import | 129 | // 全局相关的 import |
| 130 | -import { onMounted, reactive, ref } from 'vue' | ||
| 131 | -import { ElInput, ElTag, ElOption, ElSelect, ElForm, ElFormItem } from 'element-plus' | ||
| 132 | import type { FormInstance } from 'element-plus' | 130 | import type { FormInstance } from 'element-plus' |
| 133 | 131 | ||
| 134 | // 业务相关的 import | 132 | // 业务相关的 import |
| 135 | -import Treeselect from 'vue3-treeselect' | ||
| 136 | -import 'vue3-treeselect/dist/vue3-treeselect.css' | ||
| 137 | -import { useXTable } from '@/hooks/web/useXTable' | ||
| 138 | import { allSchemas } from './taskAssignRule.data' | 133 | import { allSchemas } from './taskAssignRule.data' |
| 139 | import * as TaskAssignRuleApi from '@/api/bpm/taskAssignRule' | 134 | import * as TaskAssignRuleApi from '@/api/bpm/taskAssignRule' |
| 140 | import { listSimpleRolesApi } from '@/api/system/role' | 135 | import { listSimpleRolesApi } from '@/api/system/role' |
| 141 | -import { handleTree } from '@/utils/tree' | 136 | +import { handleTree, defaultProps } from '@/utils/tree' |
| 142 | import { listSimplePostsApi } from '@/api/system/post' | 137 | import { listSimplePostsApi } from '@/api/system/post' |
| 143 | import { getListSimpleUsersApi } from '@/api/system/user' | 138 | import { getListSimpleUsersApi } from '@/api/system/user' |
| 144 | import { listSimpleUserGroupsApi } from '@/api/bpm/userGroup' | 139 | import { listSimpleUserGroupsApi } from '@/api/bpm/userGroup' |
| @@ -168,7 +163,7 @@ const [registerTable] = useXTable({ | @@ -168,7 +163,7 @@ const [registerTable] = useXTable({ | ||
| 168 | allSchemas: allSchemas, | 163 | allSchemas: allSchemas, |
| 169 | params: queryParams, | 164 | params: queryParams, |
| 170 | getListApi: TaskAssignRuleApi.getTaskAssignRuleList, | 165 | getListApi: TaskAssignRuleApi.getTaskAssignRuleList, |
| 171 | - isList: false // TODO 如果 isList 改成 true 时,进入页面不会加载数据 | 166 | + isList: true |
| 172 | }) | 167 | }) |
| 173 | // 修改任务责任表单 | 168 | // 修改任务责任表单 |
| 174 | const xForm = ref<FormInstance>() | 169 | const xForm = ref<FormInstance>() |
| @@ -267,14 +262,6 @@ const getAssignRuleOptionName = (type, option) => { | @@ -267,14 +262,6 @@ const getAssignRuleOptionName = (type, option) => { | ||
| 267 | } | 262 | } |
| 268 | return '未知(' + option + ')' | 263 | return '未知(' + option + ')' |
| 269 | } | 264 | } |
| 270 | -// 格式化部门的下拉框 | ||
| 271 | -const normalizer = (node) => { | ||
| 272 | - return { | ||
| 273 | - id: node.id, | ||
| 274 | - label: node.name, | ||
| 275 | - children: node.children | ||
| 276 | - } | ||
| 277 | -} | ||
| 278 | 265 | ||
| 279 | // ========== 初始化 ========== | 266 | // ========== 初始化 ========== |
| 280 | onMounted(() => { | 267 | onMounted(() => { |
yudao-ui-admin-vue3/src/views/bpm/taskAssignRule/taskAssignRule.data.ts
| 1 | -import { reactive } from 'vue' | ||
| 2 | -import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas' | ||
| 3 | -import { DICT_TYPE } from '@/utils/dict' | 1 | +import { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas' |
| 4 | 2 | ||
| 5 | // CrudSchema | 3 | // CrudSchema |
| 6 | const crudSchemas = reactive<VxeCrudSchema>({ | 4 | const crudSchemas = reactive<VxeCrudSchema>({ |