|
|
|
@ -51,40 +51,41 @@
|
|
|
|
|
const loading = ref(false)
|
|
|
|
|
const rowId = ref('')
|
|
|
|
|
const { createMessage } = useMessage()
|
|
|
|
|
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] = useForm({
|
|
|
|
|
labelWidth: 100,
|
|
|
|
|
schemas: formSchema,
|
|
|
|
|
showActionButtonGroup: false,
|
|
|
|
|
})
|
|
|
|
|
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(async (data) => {
|
|
|
|
|
resetFields()
|
|
|
|
|
setModalProps({ confirmLoading: false, loading: true })
|
|
|
|
|
updateFormField(updateSchema)
|
|
|
|
|
isUpdate.value = !!data?.isUpdate
|
|
|
|
|
if (unref(isUpdate)) {
|
|
|
|
|
// setModalProps({ confirmLoading: true });
|
|
|
|
|
rowId.value = data.record.id
|
|
|
|
|
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
|
|
|
|
|
// getFieldList()
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
setFieldsValue({
|
|
|
|
|
...res.data
|
|
|
|
|
})
|
|
|
|
|
// console.log('返回数据Form', getFieldsValue());
|
|
|
|
|
// setFieldsValue({ trainId: unref(res.data.trainId) });
|
|
|
|
|
const [registerForm, { resetFields, setFieldsValue, validate, updateSchema, getFieldsValue }] =
|
|
|
|
|
useForm({
|
|
|
|
|
labelWidth: 100,
|
|
|
|
|
schemas: formSchema,
|
|
|
|
|
showActionButtonGroup: false,
|
|
|
|
|
})
|
|
|
|
|
const [registerModal, { setModalProps, closeModal, updateFormField }] = useModalInner(
|
|
|
|
|
async (data) => {
|
|
|
|
|
resetFields()
|
|
|
|
|
setModalProps({ confirmLoading: false, loading: true })
|
|
|
|
|
updateFormField(updateSchema)
|
|
|
|
|
isUpdate.value = !!data?.isUpdate
|
|
|
|
|
if (unref(isUpdate)) {
|
|
|
|
|
// setModalProps({ confirmLoading: true });
|
|
|
|
|
rowId.value = data.record.id
|
|
|
|
|
const res: API.DataResult = await ApiInfo({ id: unref(rowId) })
|
|
|
|
|
// getFieldList()
|
|
|
|
|
if (res.succeeded) {
|
|
|
|
|
setFieldsValue({
|
|
|
|
|
...res.data,
|
|
|
|
|
})
|
|
|
|
|
// console.log('返回数据Form', getFieldsValue());
|
|
|
|
|
// setFieldsValue({ trainId: unref(res.data.trainId) });
|
|
|
|
|
}
|
|
|
|
|
// setModalProps({ confirmLoading: false });
|
|
|
|
|
} else {
|
|
|
|
|
setFieldsValue({ permissionIdentity: unref(2) })
|
|
|
|
|
}
|
|
|
|
|
// setModalProps({ confirmLoading: false });
|
|
|
|
|
} else {
|
|
|
|
|
setFieldsValue({ permissionIdentity: unref(2) })
|
|
|
|
|
}
|
|
|
|
|
setModalProps({ loading: false })
|
|
|
|
|
})
|
|
|
|
|
setModalProps({ loading: false })
|
|
|
|
|
},
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const getTitle = computed(() => (!unref(isUpdate) ? '新增航线信息' : '编辑航线信息'))
|
|
|
|
|
|
|
|
|
|
async function handleSave(exit) {
|
|
|
|
|
console.log(getFieldsValue())
|
|
|
|
|
return
|
|
|
|
|
try {
|
|
|
|
|
const values = await validate()
|
|
|
|
|
setModalProps({ confirmLoading: true, loading: true })
|
|
|
|
|