|
|
@ -15,12 +15,21 @@ |
|
|
|
* limitations under the License. |
|
|
|
* limitations under the License. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
import { defineComponent, PropType, toRefs, onMounted, ref, toRaw } from 'vue' |
|
|
|
import { |
|
|
|
|
|
|
|
defineComponent, |
|
|
|
|
|
|
|
PropType, |
|
|
|
|
|
|
|
toRefs, |
|
|
|
|
|
|
|
onMounted, |
|
|
|
|
|
|
|
ref, |
|
|
|
|
|
|
|
toRaw, |
|
|
|
|
|
|
|
Ref |
|
|
|
|
|
|
|
} from 'vue' |
|
|
|
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui' |
|
|
|
import { NForm, NFormItem, NInput, NSelect } from 'naive-ui' |
|
|
|
import { useForm } from '../use-form' |
|
|
|
import { useForm } from '../use-form' |
|
|
|
import Modal from '@/components/modal' |
|
|
|
import Modal from '@/components/modal' |
|
|
|
import { createTaskGroup, updateTaskGroup } from '@/service/modules/task-group' |
|
|
|
import { createTaskGroup, updateTaskGroup } from '@/service/modules/task-group' |
|
|
|
import { queryAllProjectList } from '@/service/modules/projects' |
|
|
|
import { queryAllProjectList } from '@/service/modules/projects' |
|
|
|
|
|
|
|
import { SelectMixedOption } from 'naive-ui/lib/select/src/interface' |
|
|
|
|
|
|
|
|
|
|
|
const props = { |
|
|
|
const props = { |
|
|
|
show: { |
|
|
|
show: { |
|
|
@ -42,12 +51,13 @@ const FormModal = defineComponent({ |
|
|
|
emits: ['confirm', 'cancel'], |
|
|
|
emits: ['confirm', 'cancel'], |
|
|
|
setup(props, { emit }) { |
|
|
|
setup(props, { emit }) { |
|
|
|
const { state, t } = useForm() |
|
|
|
const { state, t } = useForm() |
|
|
|
const projectOptions = ref([]) |
|
|
|
const projectOptions: Ref<Array<SelectMixedOption>> = ref([]) |
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
onMounted(() => { |
|
|
|
queryAllProjectList().then((res: any) => { |
|
|
|
queryAllProjectList().then((res: any[]) => { |
|
|
|
res.map((item) => { |
|
|
|
res.map((item) => { |
|
|
|
projectOptions.value.push({ label: item.name, value: item.code }) |
|
|
|
let option: SelectMixedOption = { label: item.name, value: item.code } |
|
|
|
|
|
|
|
projectOptions.value.push(option) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
if (props.status === 1) { |
|
|
|
if (props.status === 1) { |
|
|
@ -110,7 +120,7 @@ const FormModal = defineComponent({ |
|
|
|
> |
|
|
|
> |
|
|
|
<NSelect |
|
|
|
<NSelect |
|
|
|
options={projectOptions} |
|
|
|
options={projectOptions} |
|
|
|
v-model={[this.formData.projectCode, 'value']} |
|
|
|
v-model:value={this.formData.projectCode} |
|
|
|
placeholder={t( |
|
|
|
placeholder={t( |
|
|
|
'resource.task_group_option.please_select_project' |
|
|
|
'resource.task_group_option.please_select_project' |
|
|
|
)} |
|
|
|
)} |
|
|
@ -121,7 +131,7 @@ const FormModal = defineComponent({ |
|
|
|
path='groupSize' |
|
|
|
path='groupSize' |
|
|
|
> |
|
|
|
> |
|
|
|
<NInput |
|
|
|
<NInput |
|
|
|
v-model={[this.formData.groupSize, 'value']} |
|
|
|
v-model:value={this.formData.groupSize} |
|
|
|
placeholder={t( |
|
|
|
placeholder={t( |
|
|
|
'resource.task_group_option.please_enter_resource_pool_size' |
|
|
|
'resource.task_group_option.please_enter_resource_pool_size' |
|
|
|
)} |
|
|
|
)} |
|
|
|