Browse Source

经典案例功能修改

master
李鹏飞 6 years ago
parent
commit
94a1f15b95
  1. 22
      src/views/modules/case/typicalcase-add-or-update.vue
  2. 2
      src/views/modules/case/typicalcase-list.vue

22
src/views/modules/case/typicalcase-add-or-update.vue

@ -178,6 +178,8 @@ export default {
},
uploadUrl: '',
dataForm: {
id: '',
state: 1,
caseTitle: '',
caseNumber: 0,
mainPicture: '',
@ -188,6 +190,10 @@ export default {
requiredFlag: false
}
},
mounted () {
this.dataForm.id = this.$route.query.id
this.init()
},
computed: {
dataRule () {
return {
@ -333,8 +339,24 @@ export default {
this.visible = true
this.$nextTick(() => {
this.$refs['dataForm'].resetFields()
if (this.dataForm.id) {
this.getInfo()
}
})
},
//
getInfo () {
this.$http.get(`/cloudAnalysis/typicalcase/${this.dataForm.id}`).then(({ data: res }) => {
if (res.code !== 0) {
return this.$message.error(res.msg)
}
this.dataForm = {
...this.dataForm,
...res.data
}
}).catch(() => {})
this.requiredFlag = true
},
//
dataFormSubmitHandle: debounce(function () {
this.$refs['dataForm'].validate((valid) => {

2
src/views/modules/case/typicalcase-list.vue

@ -115,7 +115,7 @@ export default {
},
methods: {
detailHandle (id) {
this.$parent.selectComponent = 'CaseInfoDetailView'
this.$parent.selectComponent = 'CaseInfoAdd'
this.$router.push({ path: '/case-typicalcase', query: { id: id } })
},
formatState: function (row, column) {

Loading…
Cancel
Save