|
@@ -5,25 +5,34 @@
|
|
|
|
|
|
|
|
<a-modal
|
|
<a-modal
|
|
|
v-model:visible="visible"
|
|
v-model:visible="visible"
|
|
|
- @ok="handleOk"
|
|
|
|
|
- @cancel="handleCancel"
|
|
|
|
|
|
|
+ :mask-closable="false"
|
|
|
|
|
+ :closable="false"
|
|
|
|
|
+ :hide-cancel="is_init_model"
|
|
|
|
|
+ :hide-ok="is_init_model"
|
|
|
modal-class="dynamicform-config-container-modal"
|
|
modal-class="dynamicform-config-container-modal"
|
|
|
body-class="dynamicform-config-container-body"
|
|
body-class="dynamicform-config-container-body"
|
|
|
>
|
|
>
|
|
|
<template #title> <img class="chujuan-logo-img" :src="logo" /> {{ $t('wendangchujuan.dynamic_title') }} </template>
|
|
<template #title> <img class="chujuan-logo-img" :src="logo" /> {{ $t('wendangchujuan.dynamic_title') }} </template>
|
|
|
|
|
|
|
|
<!-- <DynamicFormWraper ref="confForm" /> -->
|
|
<!-- <DynamicFormWraper ref="confForm" /> -->
|
|
|
- <DynamicFormBasic ref="confForm" :form_params="user_input_form" />
|
|
|
|
|
|
|
+ <DynamicFormBasic
|
|
|
|
|
+ ref="confForm"
|
|
|
|
|
+ :is_init_model="is_init_model"
|
|
|
|
|
+ :form_params="user_input_form"
|
|
|
|
|
+ @submitForm="submitForm"
|
|
|
|
|
+ @toCancel="toCancel"
|
|
|
|
|
+ />
|
|
|
</a-modal>
|
|
</a-modal>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
<script setup>
|
|
|
-import { ref } from 'vue';
|
|
|
|
|
|
|
+import { ref, onMounted, computed } from 'vue';
|
|
|
|
|
|
|
|
import logo from '../../assets/1.png';
|
|
import logo from '../../assets/1.png';
|
|
|
|
|
|
|
|
// import DynamicFormWraper from '../form-dynamic/DynamicFormWraper.vue';
|
|
// import DynamicFormWraper from '../form-dynamic/DynamicFormWraper.vue';
|
|
|
import DynamicFormBasic from './dynamicformbasic.vue';
|
|
import DynamicFormBasic from './dynamicformbasic.vue';
|
|
|
|
|
+import { Message } from '@arco-design/web-vue';
|
|
|
|
|
|
|
|
const props = defineProps({
|
|
const props = defineProps({
|
|
|
user_input_form: Array
|
|
user_input_form: Array
|
|
@@ -33,22 +42,40 @@ const emits = defineEmits(['confirm']);
|
|
|
|
|
|
|
|
const confForm = ref(null);
|
|
const confForm = ref(null);
|
|
|
const visible = ref(false);
|
|
const visible = ref(false);
|
|
|
-
|
|
|
|
|
|
|
+// const ok_text = computed(() => {
|
|
|
|
|
+// return is_init_model.value ? '开始对话' : '确认';
|
|
|
|
|
+// });
|
|
|
|
|
+const is_init_model = ref(false); //是否是初始的配置
|
|
|
const handleClick = () => {
|
|
const handleClick = () => {
|
|
|
visible.value = true;
|
|
visible.value = true;
|
|
|
|
|
+ is_init_model.value = false;
|
|
|
};
|
|
};
|
|
|
-const handleOk = () => {
|
|
|
|
|
- const target = confForm.value;
|
|
|
|
|
- if (target && typeof target.getValues === 'function') {
|
|
|
|
|
- const data = target.getValues();
|
|
|
|
|
- emits('confirm', data);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// const handleOk = () => {
|
|
|
|
|
+// const target = confForm.value;
|
|
|
|
|
+// if (target && typeof target.getValues === 'function') {
|
|
|
|
|
+// const data = target.getValues();
|
|
|
|
|
+// console.log('data', data);
|
|
|
|
|
+// emits('confirm', data);
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
|
|
+// visible.value = false;
|
|
|
|
|
+// };
|
|
|
|
|
+const toCancel = () => {
|
|
|
visible.value = false;
|
|
visible.value = false;
|
|
|
};
|
|
};
|
|
|
-const handleCancel = () => {
|
|
|
|
|
|
|
+const submitForm = (data) => {
|
|
|
|
|
+ console.log(data, 111);
|
|
|
|
|
+ emits('confirm', data);
|
|
|
visible.value = false;
|
|
visible.value = false;
|
|
|
|
|
+ is_init_model.value = false;
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+onMounted(() => {
|
|
|
|
|
+ if (props.user_input_form.length) {
|
|
|
|
|
+ visible.value = true;
|
|
|
|
|
+ is_init_model.value = true;
|
|
|
|
|
+ }
|
|
|
|
|
+});
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
@@ -65,7 +92,7 @@ const handleCancel = () => {
|
|
|
|
|
|
|
|
<style>
|
|
<style>
|
|
|
.dynamicform-config-container-modal.arco-modal {
|
|
.dynamicform-config-container-modal.arco-modal {
|
|
|
- width: 50%;
|
|
|
|
|
|
|
+ width: 40%;
|
|
|
}
|
|
}
|
|
|
.dynamicform-config-container-body.arco-modal-body {
|
|
.dynamicform-config-container-body.arco-modal-body {
|
|
|
padding: 30px;
|
|
padding: 30px;
|
|
@@ -76,4 +103,13 @@ const handleCancel = () => {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
height: 80vh;
|
|
height: 80vh;
|
|
|
}
|
|
}
|
|
|
|
|
+.dynamicform-config-container-modal.arco-modal .arco-modal-header {
|
|
|
|
|
+ background-color: #f3f3f3;
|
|
|
|
|
+}
|
|
|
|
|
+.dynamicform-config-container-modal.arco-modal .arco-modal-header .arco-modal-title {
|
|
|
|
|
+ justify-content: flex-start;
|
|
|
|
|
+}
|
|
|
|
|
+.dynamicform-config-container-modal.arco-modal .arco-modal-footer .arco-btn {
|
|
|
|
|
+ display: none;
|
|
|
|
|
+}
|
|
|
</style>
|
|
</style>
|