fix:创建方案弹窗
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
width="100%"
|
||||
wrapClassName="my-concept-full-modal"
|
||||
>
|
||||
<concept-layout :testType="testType" @closeConceptModal="closeModal" />
|
||||
|
||||
<concept-layout :sn="tempalteSn" :testType="testType" @closeConceptModal="closeConcept" @closeModal="closeModal" />
|
||||
</a-modal>
|
||||
|
||||
</template>
|
||||
@@ -22,14 +23,21 @@ import { Modal } from 'ant-design-vue'
|
||||
const modalVisible = ref(false);
|
||||
|
||||
const testType = ref(1)
|
||||
const openModal = (type) => {
|
||||
|
||||
const tempalteSn = ref('')
|
||||
|
||||
const openModal = (type, sn) => {
|
||||
console.log('sn', sn);
|
||||
|
||||
tempalteSn.value = sn
|
||||
|
||||
if(type) {
|
||||
testType.value = type
|
||||
}
|
||||
modalVisible.value = true;
|
||||
};
|
||||
|
||||
const closeModal = () => {
|
||||
const closeConcept = () => {
|
||||
Modal.confirm({
|
||||
title: '确定退出?',
|
||||
content: '退出后当前方案配置无法恢复!',
|
||||
@@ -37,13 +45,16 @@ const closeModal = () => {
|
||||
okText: '确 定',
|
||||
class: 'custom-modal custom-modal-title-confirm-notice',
|
||||
onOk: () => {
|
||||
modalVisible.value = false;
|
||||
|
||||
closeModal();
|
||||
},
|
||||
onCancel: () => {}
|
||||
})
|
||||
};
|
||||
|
||||
|
||||
const closeModal = () => {
|
||||
modalVisible.value = false;
|
||||
}
|
||||
defineExpose({
|
||||
openModal,
|
||||
});
|
||||
|
||||
@@ -417,7 +417,7 @@ const getConceptInfo = () => {
|
||||
}
|
||||
|
||||
if(ruleFormSet.testType === 3) {
|
||||
|
||||
params.concept_indexes = [];
|
||||
params.concepts = testThreeConcepts.value.map(item => item.data);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,13 +34,17 @@ import { defineEmits, ref } from 'vue'
|
||||
import ConceptTemplate from './ConceptTemplate.vue'
|
||||
import ConceptConfig from './ConceptConfig.vue'
|
||||
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
import { Modal, message } from 'ant-design-vue'
|
||||
|
||||
import { postTemplates } from '../api'
|
||||
|
||||
const props = defineProps(["testType"]);
|
||||
const props = defineProps(["testType", "sn"]);
|
||||
|
||||
const emits = defineEmits(["closeConceptModal"]);
|
||||
const emits = defineEmits(["closeConceptModal", "closeModal"]);
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
const quitConcept = () => {
|
||||
emits('closeConceptModal')
|
||||
@@ -59,19 +63,19 @@ const onSubmit = async(params) => {
|
||||
okText: '确 定',
|
||||
class: 'custom-modal custom-modal-title-confirm-notice',
|
||||
onOk: async() => {
|
||||
return
|
||||
|
||||
const res = await postTemplates(sn, params)
|
||||
const res = await postTemplates(props.sn, params)
|
||||
|
||||
console.log('res', res);
|
||||
if(res.code === 200) {
|
||||
if(res.code === 0) {
|
||||
console.log('成功了');
|
||||
|
||||
emits('closeModal')
|
||||
|
||||
// router.push({
|
||||
// path: "/survey/planet/design",
|
||||
// query: { sn: data.sn },
|
||||
// });
|
||||
router.push({
|
||||
path: "/survey/planet/design",
|
||||
query: { sn: res.data.sn },
|
||||
});
|
||||
}
|
||||
},
|
||||
onCancel: () => {}
|
||||
|
||||
@@ -160,7 +160,7 @@ function checkConceptType(arr) {
|
||||
|
||||
// 失焦校验
|
||||
const onBlur = () => {
|
||||
console.log('proos', props.allItem);
|
||||
console.log('props', props.allItem);
|
||||
// return
|
||||
const names = props.allItem.map(item => item.data.concept_name);
|
||||
|
||||
|
||||
@@ -420,7 +420,7 @@ function createProfessionalSurvey(record) {
|
||||
return createSurveySellRef.value.openModal();
|
||||
}
|
||||
else if ([36, 37, 38].includes(record.code)) {
|
||||
return conceptTestingRef.value.openModal();
|
||||
return conceptTestingRef.value.openModal(0, record.sn);
|
||||
}
|
||||
else{
|
||||
Modal.confirm({
|
||||
|
||||
@@ -565,11 +565,11 @@ export default defineComponent({
|
||||
} else if (+record.type === 1) {
|
||||
createSurveySellRef.value.openModal();
|
||||
} else if (record.type === 300) {
|
||||
conceptTestingRef.value.openModal(1);
|
||||
conceptTestingRef.value.openModal(1, record.sn);
|
||||
} else if (record.type === 301) {
|
||||
conceptTestingRef.value.openModal(2);
|
||||
conceptTestingRef.value.openModal(2, record.sn);
|
||||
} else if (record.type === 302) {
|
||||
conceptTestingRef.value.openModal(3);
|
||||
conceptTestingRef.value.openModal(3, record.sn);
|
||||
} else {
|
||||
groupInfo.value.sn = "";
|
||||
groupInfo.value.group_id = 0;
|
||||
|
||||
Reference in New Issue
Block a user