提交 5cf77944 authored 作者: liuluyu's avatar liuluyu

更新代码格式

上级 42364432
...@@ -90,14 +90,6 @@ ...@@ -90,14 +90,6 @@
const planFormStore = usePlanFormStore(); const planFormStore = usePlanFormStore();
const isInitialized = ref(false); const isInitialized = ref(false);
// const formData = ref({
// id: '',
// executeStatus: '',
// actualStartTime: null,
// actualEndTime: null,
// executeEcord: '',
// attachments: [],
// });
const formData = reactive({ const formData = reactive({
id: '', id: '',
executeStatus: '', executeStatus: '',
...@@ -107,9 +99,9 @@ ...@@ -107,9 +99,9 @@
attachments: [] as any[], attachments: [] as any[],
}); });
// accept external formData prop from parent modal
const props = defineProps({ const props = defineProps({
formData: { initialData: {
// 改名:不使用 formData 作为 prop 名
type: Object, type: Object,
default: () => ({}), default: () => ({}),
}, },
...@@ -117,7 +109,7 @@ ...@@ -117,7 +109,7 @@
// sync incoming prop into internal reactive formData // sync incoming prop into internal reactive formData
watch( watch(
() => props.formData, () => props.initialData,
(v) => { (v) => {
if (v && Object.keys(v).length > 0) { if (v && Object.keys(v).length > 0) {
Object.assign(formData, v); Object.assign(formData, v);
...@@ -192,11 +184,6 @@ ...@@ -192,11 +184,6 @@
await nextTick(); await nextTick();
planFormStore.updateFormDataCache(newFormData); planFormStore.updateFormDataCache(newFormData);
isInitialized.value = true; isInitialized.value = true;
// Object.assign(formData, newFormData);
// planFormStore.updateFormDataCache(newFormData);
// isInitialized.value = true;
// console.log('[v0] 表单初始化成功,数据:', newFormData);
} }
} catch (error: any) { } catch (error: any) {
console.error('初始化表单数据失败:', error); console.error('初始化表单数据失败:', error);
...@@ -287,7 +274,6 @@ ...@@ -287,7 +274,6 @@
if (response) { if (response) {
// message.success('保存成功'); // message.success('保存成功');
// 更新缓存 // 更新缓存
planFormStore.updateFormDataCache(formData); planFormStore.updateFormDataCache(formData);
} }
......
...@@ -65,7 +65,6 @@ ...@@ -65,7 +65,6 @@
const loading = ref(false); const loading = ref(false);
const submitting = ref(false); const submitting = ref(false);
const formData = ref<Record<string, any>>({}); const formData = ref<Record<string, any>>({});
const idsystoken = ref('');
const [registerForm, { setFieldsValue, setProps, getFieldsValue, resetFields, validate }] = useForm({ const [registerForm, { setFieldsValue, setProps, getFieldsValue, resetFields, validate }] = useForm({
labelWidth: 150, labelWidth: 150,
......
...@@ -253,12 +253,6 @@ ...@@ -253,12 +253,6 @@
const visible = ref(false); const visible = ref(false);
const formRef = ref(); const formRef = ref();
// const exeRules = ref([
// { value: 1, label: '事件触发' },
// { value: 2, label: '周期执行' },
// { value: 3, label: '一次性执行' },
// ]);
const formModel = reactive({ const formModel = reactive({
projectName: '', projectName: '',
projectType: '', projectType: '',
...@@ -347,7 +341,6 @@ ...@@ -347,7 +341,6 @@
resetForm(); resetForm();
closeModal(); closeModal();
} catch (e) { } catch (e) {
} finally { } finally {
setModalProps({ confirmLoading: false }); setModalProps({ confirmLoading: false });
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论