fix: form solts

This commit is contained in:
xingyu4j
2022-12-06 14:12:57 +08:00
parent 1bdde35dc9
commit f841ca11a5
9 changed files with 20 additions and 55 deletions

View File

@ -93,8 +93,8 @@
:rules="rules"
ref="formRef"
>
<template #cronExpression>
<Crontab v-model="cronExpression" :shortcuts="shortcuts" />
<template #cronExpression="form">
<Crontab v-model="form['cronExpression']" :shortcuts="shortcuts" />
</template>
</Form>
<!-- 对话框(详情) -->
@ -162,7 +162,6 @@ const dialogVisible = ref(false) // 是否显示弹出层
const dialogTitle = ref('edit') // 弹出层标题
const formRef = ref<FormExpose>() // 表单 Ref
const detailRef = ref() // 详情 Ref
const cronExpression = ref('')
const nextTimes = ref([])
const shortcuts = ref([
{
@ -179,7 +178,6 @@ const setDialogTile = (type: string) => {
// 新增操作
const handleCreate = () => {
cronExpression.value = ''
setDialogTile('create')
}
@ -193,7 +191,6 @@ const handleUpdate = async (rowId: number) => {
setDialogTile('update')
// 设置数据
const res = await JobApi.getJobApi(rowId)
cronExpression.value = res.cronExpression
unref(formRef)?.setValues(res)
}
@ -305,7 +302,6 @@ const submitForm = async () => {
// 提交请求
try {
const data = unref(formRef)?.formModel as JobApi.JobVO
data.cronExpression = cronExpression.value
if (actionType.value === 'create') {
await JobApi.createJobApi(data)
message.success(t('common.createSuccess'))