|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="amplify-main">
|
|
|
- <ProForm :items-options="items" :model="model"></ProForm>
|
|
|
+ <ProForm ref="proFormRef" :items-options="items"></ProForm>
|
|
|
<el-button type="primary" v-if="showSelectBatchButton" style="margin-left: 50px" @click="showDataSelectionDialog()">选择批次</el-button>
|
|
|
|
|
|
<el-dialog v-model="dataDialogVisible" title="选择数据批次" style="width: 70vw">
|
|
@@ -37,14 +37,15 @@ import { reactive, ref, computed, onMounted, defineEmits } from 'vue'
|
|
|
import ProForm from '@/components/ProForm/index.vue'
|
|
|
import { batchListDataApi } from '@/api/modules/demo/data'
|
|
|
import { getDictsApi } from '@/api/modules/system/dictData'
|
|
|
+import ProFrom from '@/components/ProForm/index.vue'
|
|
|
|
|
|
const emit = defineEmits(['updateData', 'updateModel', 'updateParams'])
|
|
|
-
|
|
|
+const proFormRef = ref<InstanceType<typeof ProFrom> | null>(null)
|
|
|
// 数据
|
|
|
-let model = {
|
|
|
- taskName: 'sss',
|
|
|
+const model = ref({
|
|
|
+ taskName: '',
|
|
|
transfer: null
|
|
|
-}
|
|
|
+})
|
|
|
|
|
|
const dataDialogVisible = ref(false)
|
|
|
let batchDataList = ref(reactive([] as any[]))
|
|
@@ -54,12 +55,14 @@ let tempDeselectedBatchDataList = ref(reactive([] as any[]))
|
|
|
let parameList = ref(reactive([] as any[]))
|
|
|
let queryBatchData = ref(reactive([] as any[]))
|
|
|
|
|
|
-const props = defineProps({ showSelectBatchButton: Boolean })
|
|
|
+const props = defineProps({ showSelectBatchButton: Boolean, dataList: Array, useData: Boolean })
|
|
|
|
|
|
onMounted(() => {
|
|
|
- batchListDataApi().then(res => {
|
|
|
- queryBatchData.value = reactive(res.data)
|
|
|
- })
|
|
|
+ !props.useData &&
|
|
|
+ batchListDataApi().then(res => {
|
|
|
+ queryBatchData.value = reactive(res.data)
|
|
|
+ })
|
|
|
+ props.useData && (queryBatchData.value = props.dataList) // && console.log('load data', props.dataList)
|
|
|
|
|
|
getDictsApi('expand_data_params').then(res => {
|
|
|
parameList.value = reactive(JSON.parse(res.data[0].remark))
|
|
@@ -75,9 +78,9 @@ onMounted(() => {
|
|
|
placeholder: '请输入' + item.name
|
|
|
}
|
|
|
})
|
|
|
- model[`${item.agName}`] = item.defaultValue
|
|
|
+ // model.value[`${item.agName}`] = item.defaultValue
|
|
|
})
|
|
|
- emit('updateModel', model)
|
|
|
+ emit('updateModel', proFormRef.value.formModel)
|
|
|
// Emit parameList 给父组件
|
|
|
emit('updateParams', parameList.value)
|
|
|
})
|
|
@@ -149,7 +152,7 @@ let items: ProForm.ItemsOptions[] = reactive([
|
|
|
compOptions: {
|
|
|
elTagName: 'input',
|
|
|
clearable: true,
|
|
|
- placeholder: '请输入用户名'
|
|
|
+ placeholder: '请输入任务名称'
|
|
|
}
|
|
|
},
|
|
|
{
|