perf: task assign rule

This commit is contained in:
xingyu 2023-01-19 18:19:01 +08:00
parent fabdccd981
commit c9d1100eac
3 changed files with 10 additions and 26 deletions

View File

@ -52,7 +52,6 @@
"vue-i18n": "9.2.2", "vue-i18n": "9.2.2",
"vue-router": "^4.1.6", "vue-router": "^4.1.6",
"vue-types": "^5.0.2", "vue-types": "^5.0.2",
"vue3-treeselect": "^0.1.10",
"vxe-table": "^4.3.9", "vxe-table": "^4.3.9",
"web-storage-cache": "^1.1.1", "web-storage-cache": "^1.1.1",
"xe-utils": "^3.5.7" "xe-utils": "^3.5.7"

View File

@ -62,14 +62,14 @@
span="24" span="24"
v-if="formData.type === 20 || formData.type === 21" v-if="formData.type === 20 || formData.type === 21"
> >
<treeselect <el-tree-select
ref="treeRef"
v-model="formData.deptIds" v-model="formData.deptIds"
:options="deptTreeOptions" node-key="id"
multiple show-checkbox
flat :props="defaultProps"
:defaultExpandLevel="3" :data="deptTreeOptions"
placeholder="请选择指定部门" empty-text="加载中,请稍后"
:normalizer="normalizer"
/> />
</el-form-item> </el-form-item>
<el-form-item label="指定岗位" prop="postIds" span="24" v-if="formData.type === 22"> <el-form-item label="指定岗位" prop="postIds" span="24" v-if="formData.type === 22">
@ -127,18 +127,13 @@
</template> </template>
<script setup lang="ts" name="TaskAssignRule"> <script setup lang="ts" name="TaskAssignRule">
// import // import
import { onMounted, reactive, ref } from 'vue'
import { ElInput, ElTag, ElOption, ElSelect, ElForm, ElFormItem } from 'element-plus'
import type { FormInstance } from 'element-plus' import type { FormInstance } from 'element-plus'
// import // import
import Treeselect from 'vue3-treeselect'
import 'vue3-treeselect/dist/vue3-treeselect.css'
import { useXTable } from '@/hooks/web/useXTable'
import { allSchemas } from './taskAssignRule.data' import { allSchemas } from './taskAssignRule.data'
import * as TaskAssignRuleApi from '@/api/bpm/taskAssignRule' import * as TaskAssignRuleApi from '@/api/bpm/taskAssignRule'
import { listSimpleRolesApi } from '@/api/system/role' import { listSimpleRolesApi } from '@/api/system/role'
import { handleTree } from '@/utils/tree' import { handleTree, defaultProps } from '@/utils/tree'
import { listSimplePostsApi } from '@/api/system/post' import { listSimplePostsApi } from '@/api/system/post'
import { getListSimpleUsersApi } from '@/api/system/user' import { getListSimpleUsersApi } from '@/api/system/user'
import { listSimpleUserGroupsApi } from '@/api/bpm/userGroup' import { listSimpleUserGroupsApi } from '@/api/bpm/userGroup'
@ -168,7 +163,7 @@ const [registerTable] = useXTable({
allSchemas: allSchemas, allSchemas: allSchemas,
params: queryParams, params: queryParams,
getListApi: TaskAssignRuleApi.getTaskAssignRuleList, getListApi: TaskAssignRuleApi.getTaskAssignRuleList,
isList: false // TODO isList true isList: true
}) })
// //
const xForm = ref<FormInstance>() const xForm = ref<FormInstance>()
@ -267,14 +262,6 @@ const getAssignRuleOptionName = (type, option) => {
} }
return '未知(' + option + ')' return '未知(' + option + ')'
} }
//
const normalizer = (node) => {
return {
id: node.id,
label: node.name,
children: node.children
}
}
// ========== ========== // ========== ==========
onMounted(() => { onMounted(() => {

View File

@ -1,6 +1,4 @@
import { reactive } from 'vue' import { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
import { VxeCrudSchema, useVxeCrudSchemas } from '@/hooks/web/useVxeCrudSchemas'
import { DICT_TYPE } from '@/utils/dict'
// CrudSchema // CrudSchema
const crudSchemas = reactive<VxeCrudSchema>({ const crudSchemas = reactive<VxeCrudSchema>({