|
|
@@ -1,25 +1,26 @@
|
|
|
<template>
|
|
|
<basic-container class='margin'>
|
|
|
<avue-crud
|
|
|
- :option="option"
|
|
|
- :data="data"
|
|
|
- ref="crud"
|
|
|
- v-model="form"
|
|
|
- :before-open="beforeOpen"
|
|
|
- @row-del="rowDel"
|
|
|
- @row-save="rowSave"
|
|
|
- @row-update="rowUpdate"
|
|
|
- @on-load="onLoad">
|
|
|
+ :option="option"
|
|
|
+ :data="data"
|
|
|
+ ref="crud"
|
|
|
+ v-model="form"
|
|
|
+ :before-open="beforeOpen"
|
|
|
+ @row-del="rowDel"
|
|
|
+ @row-save="rowSave"
|
|
|
+ @row-update="rowUpdate"
|
|
|
+ @on-load="onLoad">
|
|
|
</avue-crud>
|
|
|
</basic-container>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import BasicContainer from '@/components/basic-container/main.vue'
|
|
|
+
|
|
|
export default {
|
|
|
name: 'Index',
|
|
|
- components: { BasicContainer },
|
|
|
- data () {
|
|
|
+ components: {BasicContainer},
|
|
|
+ data() {
|
|
|
return {
|
|
|
taskShow: false,
|
|
|
form: {},
|
|
|
@@ -60,10 +61,73 @@ export default {
|
|
|
prop: 'noticeType'
|
|
|
}
|
|
|
]
|
|
|
- }
|
|
|
+ },
|
|
|
+ page: {
|
|
|
+ pageSize: 10,
|
|
|
+ currentPage: 1,
|
|
|
+ total: 10,
|
|
|
+ type: 1
|
|
|
+ },
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ onLoad() {
|
|
|
+ this.loading = true
|
|
|
+ this.page.current = this.page.currentPage
|
|
|
+ this.page.size = this.page.pageSize
|
|
|
+ this.$api.task.taskList(this.page).then(res => {
|
|
|
+ this.loading = false
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.data = res.data.records
|
|
|
+ this.page.total = res.data.total
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ beforeOpen(done, type) {
|
|
|
+ if (type === 'edit') {
|
|
|
+ this.$confirm('确定恢复所选择的文件?', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$api.recycle.recycleBack({recycleBinId: this.form.id}).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.onLoad()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ currentChange(currentPage) {
|
|
|
+ this.page.currentPage = currentPage
|
|
|
+ },
|
|
|
+ sizeChange(pageSize) {
|
|
|
+ this.page.size = pageSize
|
|
|
+ },
|
|
|
+ refreshChange() {
|
|
|
+ this.onLoad()
|
|
|
+ },
|
|
|
+ rowDel(row) {
|
|
|
+ this.$confirm('确定彻底删除所选择的文件?', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$api.recycle.recycleRemove({ids: row.id}).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.onLoad()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|