当前位置: 首页 > news >正文

新增页面保存后,跳转为详情页,同时关闭新增页。(即路由detail/1?type=1,变为detail/2/2?type=2id=2)

新增页面保存后,跳转为详情页,同时关闭新增页。

如若依系统,路由 detail/1?type=1,变为 detail/2/1?type=2&id=1

      refreshView() {// In order to make the cached page re-renderedthis.$store.dispatch('tagsView/delCachedView', this.$route).then(() => {const { fullPath } = this.$routethis.$nextTick(() => {this.$router.replace({path: '/redirect' + fullPath})})})},// 调用保存接口handleSave() {const params = this.handleParams()this.loading = truesaveApply(params).then(res => {if (res.code === 200) {const applyId = res.data?.id || nullthis.loading = falseif (this.routeType === '1') { // 新增页,保存后,需关闭新增页,跳转至详情页this.refreshView()// 调用全局挂载的方法,关闭当前页this.$store.dispatch('tagsView/delView', this.$route)this.$nextTick(() => {this.toDetail(applyId) // 跳转至详情页})} else {this.getDetail() // 详情页再次编辑,保存后直接刷新数据}} else {this.$message.error(res.msg)}}).catch(() => {}).finally(() => {this.loading = false})},


http://www.mrgr.cn/news/13304.html

相关文章:

  • Go学习笔记(一)语法
  • GNU/Linux - RSYSLOG
  • 移动端+PC端源码,智慧城管执法系统,后端框架:springboot,移动端:uniapp
  • Git实战精粹
  • RSA加密解密算法认识及signln_resolve
  • 初识redis:Zset有序集合
  • fastjson序列化时过滤字段的方法
  • C++ DAY2
  • XSS-labs靶场通关攻略(16-20)
  • 力扣229题详解:求众数 II 的多种解法与模拟面试问答
  • day-42 分割字符频率相等的最少子字符串
  • 怎么生成一个springboot的项目
  • Vue:组件化开发
  • 11 索引
  • 290. 单词规律【 力扣(LeetCode) 】
  • RAG与LLM原理及实践(14)---- Python + MinIO + Kafka进阶
  • 在英伟达,你既能成为百万富翁,也能被“折磨”
  • bash 脚本的执行方式
  • MATLAB 低版本Matlab-读取LAS格式点云文件并可视化(78)
  • 功能测试常用的测试用例大全