Commit 7a291eb9 by yancanhua

fix: 前端页面调整

1 parent 7cdea073
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
</a-form-item> </a-form-item>
<div class="footer-submit"> <div class="footer-submit">
<a-button type="primary" class="mr-10" @click="submitForm">保存</a-button> <a-button type="primary" class="mr-10" @click="submitForm">保存</a-button>
<a-button @click="$goBack()">取消</a-button> <a-button @click="handleCancelExit()">取消</a-button>
</div> </div>
</a-form> </a-form>
</a-spin> </a-spin>
...@@ -184,6 +184,11 @@ export default class PreferenceForm extends FormComponent<Venue> { ...@@ -184,6 +184,11 @@ export default class PreferenceForm extends FormComponent<Venue> {
onValidFailure(errorMessage: any) { onValidFailure(errorMessage: any) {
console.error('错误信息:', errorMessage); console.error('错误信息:', errorMessage);
} }
handleCancelExit() {
this.$emit('cancelExit');
}
} }
</script> </script>
...@@ -199,5 +204,4 @@ export default class PreferenceForm extends FormComponent<Venue> { ...@@ -199,5 +204,4 @@ export default class PreferenceForm extends FormComponent<Venue> {
.flex-form .ant-form-item { .flex-form .ant-form-item {
width: 33.33333%; width: 33.33333%;
} }
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<div class="titleBox"> <div class="titleBox">
{{ actionState == 'EDIT' ? '编辑收车偏好' : '车商基础信息' }} {{ actionState == 'EDIT' ? '编辑收车偏好' : '车商基础信息' }}
<a-button style="float: right;" @click="$goBack()">返回列表</a-button> <a-button style="float: right;" @click="handleCancelExit()">返回列表</a-button>
</div> </div>
<a-card :bordered="false" size="small"> <a-card :bordered="false" size="small">
<a-descriptions :column="3" size="small" layout="vertical"> <a-descriptions :column="3" size="small" layout="vertical">
...@@ -74,8 +74,12 @@ ...@@ -74,8 +74,12 @@
</div> </div>
</a-card> </a-card>
<div v-if="actionState == 'EDIT'" style="width: 100%;"> <div v-if="actionState == 'EDIT'" style="width: 100%;">
<PreferenceForm ref="preferenceFormRef" :preferenceFormData="pageData" /> <PreferenceForm ref="preferenceFormRef" :preferenceFormData="pageData" @cancelExit="handleCancelExit()" />
</div> </div>
<!-- 退出提示弹窗 -->
<a-modal v-model:open="exitVisible" title="提示" width="480px" @ok="handleExit">
<p style="height: 32px;line-height: 32px;">本次编辑未保存,是否确定退出?</p>
</a-modal>
</div> </div>
</template> </template>
...@@ -96,6 +100,7 @@ import TitleTipIcon from "@/components/icons/TitleTipIcon.vue"; ...@@ -96,6 +100,7 @@ import TitleTipIcon from "@/components/icons/TitleTipIcon.vue";
export default class ViewPreference extends Vue { export default class ViewPreference extends Vue {
actionState: string = 'VIEW'//VIEW查看状态 EDIT编辑状态 actionState: string = 'VIEW'//VIEW查看状态 EDIT编辑状态
pageData: object = {} //页面显示数据 pageData: object = {} //页面显示数据
exitVisible: boolean = false //退出提示弹窗是否显示
created() { created() {
const { preferenceId, action } = this.$route.query; const { preferenceId, action } = this.$route.query;
this.actionState = action || 'VIEW'; this.actionState = action || 'VIEW';
...@@ -103,6 +108,19 @@ export default class ViewPreference extends Vue { ...@@ -103,6 +108,19 @@ export default class ViewPreference extends Vue {
this.pageData = response.data || {}; this.pageData = response.data || {};
}) })
} }
handleCancelExit() {
if (this.actionState == 'EDIT') {
this.exitVisible = true;
} else {
this.$goBack()
}
}
handleExit() {
this.exitVisible = false;
this.$goBack()
}
} }
</script> </script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!