|
@@ -104,10 +104,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
|
-import { defineComponent, reactive, ref, toRefs } from "vue";
|
|
|
+import { defineComponent, reactive, ref, toRefs,watch } from "vue";
|
|
|
import { InfoCircleOutlined } from "@ant-design/icons-vue";
|
|
|
import { useForm } from "@ant-design-vue/use";
|
|
|
-import { useRouter } from "vue-router";
|
|
|
+import useApp from "@/hooks/useApp";
|
|
|
import store from "@/store";
|
|
|
import { MutationType } from "@/store/modules/app/_type";
|
|
|
import ImageUpload from "@/components/image-upload/index.vue";
|
|
@@ -129,7 +129,7 @@ const StepOne = defineComponent({
|
|
|
},
|
|
|
emits: ["next"],
|
|
|
setup(props, { emit }) {
|
|
|
- const router = useRouter();
|
|
|
+ const { route, router } = useApp();
|
|
|
|
|
|
const state = reactive({
|
|
|
officials: ref<IGZHItem[]>([]),
|
|
@@ -177,7 +177,11 @@ const StepOne = defineComponent({
|
|
|
},
|
|
|
],
|
|
|
});
|
|
|
-
|
|
|
+ watch( (props as any)?.content,(newProps, oldProps) => {
|
|
|
+ if (route.query && route.query.id) {
|
|
|
+ state.forms = Object.assign(state.forms, (props as any)?.content ?? {});
|
|
|
+ }
|
|
|
+ });
|
|
|
const { validate, validateInfos } = useForm(state.forms, formsRules);
|
|
|
|
|
|
const initConfigData = async () => {
|