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