Commit 7a291eb9 by yancanhua

fix: 前端页面调整

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