|
|
@ -36,6 +36,7 @@ import type { |
|
|
|
ITaskState, |
|
|
|
ITaskState, |
|
|
|
IDateType |
|
|
|
IDateType |
|
|
|
} from '../types' |
|
|
|
} from '../types' |
|
|
|
|
|
|
|
import {IRenderOption} from "../types"; |
|
|
|
|
|
|
|
|
|
|
|
export function useDependent(model: { [field: string]: any }): IJsonItem[] { |
|
|
|
export function useDependent(model: { [field: string]: any }): IJsonItem[] { |
|
|
|
const { t } = useI18n() |
|
|
|
const { t } = useI18n() |
|
|
@ -44,12 +45,12 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] { |
|
|
|
|
|
|
|
|
|
|
|
const dependentResult = nodeStore.getDependentResult |
|
|
|
const dependentResult = nodeStore.getDependentResult |
|
|
|
const TasksStateConfig = tasksState(t) |
|
|
|
const TasksStateConfig = tasksState(t) |
|
|
|
const projectList = ref([] as { label: string; value: number }[]) |
|
|
|
const projectList = ref([] as IRenderOption[]) |
|
|
|
const processCache = {} as { |
|
|
|
const processCache = {} as { |
|
|
|
[key: number]: { label: string; value: number }[] |
|
|
|
[key: number]: IRenderOption[] |
|
|
|
} |
|
|
|
} |
|
|
|
const taskCache = {} as { |
|
|
|
const taskCache = {} as { |
|
|
|
[key: number]: { label: string; value: number }[] |
|
|
|
[key: number]: IRenderOption[] |
|
|
|
} |
|
|
|
} |
|
|
|
const selectOptions = ref([] as IDependTaskOptions[]) |
|
|
|
const selectOptions = ref([] as IDependTaskOptions[]) |
|
|
|
|
|
|
|
|
|
|
@ -182,7 +183,8 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] { |
|
|
|
const result = await queryAllProjectListForDependent() |
|
|
|
const result = await queryAllProjectListForDependent() |
|
|
|
projectList.value = result.map((item: { code: number; name: string }) => ({ |
|
|
|
projectList.value = result.map((item: { code: number; name: string }) => ({ |
|
|
|
value: item.code, |
|
|
|
value: item.code, |
|
|
|
label: () => h(NEllipsis, null, item.name) |
|
|
|
label: () => h(NEllipsis, null, item.name), |
|
|
|
|
|
|
|
filterLabel: item.name |
|
|
|
})) |
|
|
|
})) |
|
|
|
return projectList |
|
|
|
return projectList |
|
|
|
} |
|
|
|
} |
|
|
@ -193,7 +195,8 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] { |
|
|
|
const result = await queryProcessDefinitionList(code) |
|
|
|
const result = await queryProcessDefinitionList(code) |
|
|
|
const processList = result.map((item: { code: number; name: string }) => ({ |
|
|
|
const processList = result.map((item: { code: number; name: string }) => ({ |
|
|
|
value: item.code, |
|
|
|
value: item.code, |
|
|
|
label: () => h(NEllipsis, null, item.name) |
|
|
|
label: () => h(NEllipsis, null, item.name), |
|
|
|
|
|
|
|
filterLabel: item.name |
|
|
|
})) |
|
|
|
})) |
|
|
|
processCache[code] = processList |
|
|
|
processCache[code] = processList |
|
|
|
|
|
|
|
|
|
|
@ -207,7 +210,8 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] { |
|
|
|
const result = await getTasksByDefinitionList(code, processCode) |
|
|
|
const result = await getTasksByDefinitionList(code, processCode) |
|
|
|
const taskList = result.map((item: { code: number; name: string }) => ({ |
|
|
|
const taskList = result.map((item: { code: number; name: string }) => ({ |
|
|
|
value: item.code, |
|
|
|
value: item.code, |
|
|
|
label: () => h(NEllipsis, null, item.name) |
|
|
|
label: () => h(NEllipsis, null, item.name), |
|
|
|
|
|
|
|
filterLabel: item.name |
|
|
|
})) |
|
|
|
})) |
|
|
|
taskList.unshift({ |
|
|
|
taskList.unshift({ |
|
|
|
value: 0, |
|
|
|
value: 0, |
|
|
@ -283,6 +287,11 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] { |
|
|
|
span: 24, |
|
|
|
span: 24, |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
filterable: true, |
|
|
|
filterable: true, |
|
|
|
|
|
|
|
filter: (query: string, option: IRenderOption) => { |
|
|
|
|
|
|
|
return option.filterLabel |
|
|
|
|
|
|
|
.toLowerCase() |
|
|
|
|
|
|
|
.includes(query.toLowerCase()) |
|
|
|
|
|
|
|
}, |
|
|
|
onUpdateValue: async (projectCode: number) => { |
|
|
|
onUpdateValue: async (projectCode: number) => { |
|
|
|
const item = model.dependTaskList[i].dependItemList[j] |
|
|
|
const item = model.dependTaskList[i].dependItemList[j] |
|
|
|
const options = selectOptions?.value[i] || {} |
|
|
|
const options = selectOptions?.value[i] || {} |
|
|
@ -315,6 +324,11 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] { |
|
|
|
name: t('project.node.process_name'), |
|
|
|
name: t('project.node.process_name'), |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
filterable: true, |
|
|
|
filterable: true, |
|
|
|
|
|
|
|
filter: (query: string, option: IRenderOption) => { |
|
|
|
|
|
|
|
return option.filterLabel |
|
|
|
|
|
|
|
.toLowerCase() |
|
|
|
|
|
|
|
.includes(query.toLowerCase()) |
|
|
|
|
|
|
|
}, |
|
|
|
onUpdateValue: async (processCode: number) => { |
|
|
|
onUpdateValue: async (processCode: number) => { |
|
|
|
const item = model.dependTaskList[i].dependItemList[j] |
|
|
|
const item = model.dependTaskList[i].dependItemList[j] |
|
|
|
selectOptions.value[i].dependItemList[j].depTaskCodeOptions = await getTaskList( |
|
|
|
selectOptions.value[i].dependItemList[j].depTaskCodeOptions = await getTaskList( |
|
|
@ -343,7 +357,12 @@ export function useDependent(model: { [field: string]: any }): IJsonItem[] { |
|
|
|
span: 24, |
|
|
|
span: 24, |
|
|
|
name: t('project.node.task_name'), |
|
|
|
name: t('project.node.task_name'), |
|
|
|
props: { |
|
|
|
props: { |
|
|
|
filterable: true |
|
|
|
filterable: true, |
|
|
|
|
|
|
|
filter: (query: string, option: IRenderOption) => { |
|
|
|
|
|
|
|
return option.filterLabel |
|
|
|
|
|
|
|
.toLowerCase() |
|
|
|
|
|
|
|
.includes(query.toLowerCase()) |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
options: |
|
|
|
options: |
|
|
|
selectOptions.value[i]?.dependItemList[j]?.depTaskCodeOptions || |
|
|
|
selectOptions.value[i]?.dependItemList[j]?.depTaskCodeOptions || |
|
|
|