File was renamed from src/views/onlineStudy/video/type.vue |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import VideoTypeAPI from '@/api/video-type' |
| | | import StudyTypeAPI from '@/api/study-type' |
| | | export default { |
| | | name: 'type', |
| | | data () { |
| | |
| | | }, |
| | | methods: { |
| | | remove (id) { |
| | | VideoTypeAPI.remove(id).then(res => { |
| | | StudyTypeAPI.remove(id).then(res => { |
| | | if (res.code === 1) { |
| | | this.$message.success('删除成功') |
| | | } |
| | |
| | | this.$refs['form'].validate((valid) => { |
| | | if (valid) { |
| | | if (this.form.id) { |
| | | VideoTypeAPI.update(this.form).then(res => { |
| | | StudyTypeAPI.update(this.form).then(res => { |
| | | if (res.code === 1) { |
| | | this.$message.success('修改成功') |
| | | this.open = false |
| | |
| | | } |
| | | }) |
| | | } else { |
| | | VideoTypeAPI.add(this.form).then(res => { |
| | | StudyTypeAPI.add(this.form).then(res => { |
| | | if (res.code === 1) { |
| | | this.$message.success('添加成功') |
| | | this.open = false |
| | |
| | | this.open = true |
| | | }, |
| | | page () { |
| | | VideoTypeAPI.page(this.searchForm).then(res => { |
| | | StudyTypeAPI.page(this.searchForm).then(res => { |
| | | if (res.code === 1) { |
| | | this.tableData = res.response |
| | | } |