更新时间:2019-01-10 来源:黑马程序员 浏览量:
1 2 | import page_edit from '@ / module / cms / page / page_edit.vue'; { path : ' / cms / page / edit / : pageId' , name : '修改页面' , component : page_edit , hidden : true } , |
1 2 3 4 5 6 7 | < el‐table‐ column label = "操作" width = "80" > < template slot‐scope = "page" > < el‐ button size = "small" type = "text" @click = "edit(page.row.pageId)" > 编辑 < / el‐ button > < / template > < / el‐table‐ column > |
1 2 3 4 5 6 | / / 修改 edit : function ( pageId ) { this.$router.push ( { path : ' / cms / page / edit / ' + pageId , query : { page : this.params.page , siteId : this.params.siteId } } ) } |
1 2 3 | / * 页面查询 * / export const page_get = id = > { return http.requestQuickGet ( apiUrl + ' / cms / page / get / ' + id ) } |
1 2 3 4 5 6 7 8 | data ( ) { return { ...... / / 页面 id pageId : '' , ...... } } |
01 02 03 04 05 06 07 08 09 10 11 | created : function ( ) { / / 页面参数通过路由传入,这里通过this.$route.params来获取 this.pageId = this.$route.params.pageId; / / 根据主键查询页面信息 cmsApi.page_get ( this.pageId ) . then ( ( res ) = > { console. log ( res ) ; if ( res.success ) { this.pageForm = res.cmsPage; } } ) ; } |
1 2 3 4 | / * 页面修改, 采用put方法 * / export const page_edit = ( id , params ) = > { return http.requestPut ( apiUrl + ' / cms / page / edit / ' + id , params ) } |
1 | < el‐ button type = "primary" @click = "editSubmit" > 提交 < / el‐ button > |
01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 | editSubmit ( ) { this.$refs.pageForm.validate ( ( valid ) = > { if ( valid ) { this.$confirm ( '确认提交吗?' , '提示' , { } ) . then ( ( ) = > { cmsApi.page_edit ( this.pageId , this.pageForm ) . then ( ( res ) = > { console. log ( res ) ; if ( res.success ) { this.$ message ( { message : '修改成功' , type : 'success' } ) ; / / 自动返回 this.go_back ( ) ; } else { this.$ message . error ( '修改失败' ) ; } } ) ; } ) ; } } ) ; } |
【AI设计】北京143期毕业仅36天,全员拿下高薪offer!黑马AI设计连续6期100%高薪就业
2025-09-19【跨境电商运营】深圳跨境电商运营毕业22个工作日,就业率91%+,最高薪资达13500元
2025-09-19【AI运维】郑州运维1期就业班,毕业14个工作日,班级93%同学已拿到Offer, 一线均薪资 1W+
2025-09-19【AI鸿蒙开发】上海校区AI鸿蒙开发4期5期,距离毕业21天,就业率91%,平均薪资14046元
2025-09-19【AI大模型开发-Python】毕业33个工作日,就业率已达到94.55%,班均薪资20763元
2025-09-19【AI智能应用开发-Java】毕业5个工作日就业率98.18%,最高薪资 17.5k*13薪,全班平均薪资9244元
2025-09-19