|
|
@@ -40,8 +40,8 @@ import dialogInfo from './dialog_info.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'list',
|
|
|
- components: { dialogInfo },
|
|
|
- data () {
|
|
|
+ components: {dialogInfo},
|
|
|
+ data() {
|
|
|
return {
|
|
|
showInfo: false,
|
|
|
keyWords: '',
|
|
|
@@ -87,23 +87,23 @@ export default {
|
|
|
}]
|
|
|
},
|
|
|
page: {
|
|
|
- currentSize: 10,
|
|
|
- currentPage: 1,
|
|
|
+ current: 1,
|
|
|
+ size: 10,
|
|
|
total: 0
|
|
|
},
|
|
|
id: ''
|
|
|
}
|
|
|
},
|
|
|
- created () {
|
|
|
+ created() {
|
|
|
this.$bus.on('serachFile', (res) => {
|
|
|
this.onLoad(res)
|
|
|
})
|
|
|
},
|
|
|
methods: {
|
|
|
- onLoad (query = {}) {
|
|
|
+ onLoad(query = {}) {
|
|
|
this.page.current = this.page.currentPage
|
|
|
this.page.size = this.page.pageSize
|
|
|
- const data = { ...query, ...this.page }
|
|
|
+ const data = {...query, ...this.page}
|
|
|
this.loading = true
|
|
|
this.$api.database.fileList(data).then(res => {
|
|
|
this.loading = false
|
|
|
@@ -113,16 +113,16 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- currentChange (currentPage) {
|
|
|
+ currentChange(currentPage) {
|
|
|
this.page.current = currentPage
|
|
|
},
|
|
|
- sizeChange (pageSize) {
|
|
|
+ sizeChange(pageSize) {
|
|
|
this.page.size = pageSize
|
|
|
},
|
|
|
- refreshChange () {
|
|
|
+ refreshChange() {
|
|
|
this.onLoad(this.page, this.query)
|
|
|
},
|
|
|
- beforeOpen (done, type) {
|
|
|
+ beforeOpen(done, type) {
|
|
|
if (['view'].includes(type)) {
|
|
|
this.showInfo = true
|
|
|
console.log(this.showInfo)
|
|
|
@@ -130,28 +130,28 @@ export default {
|
|
|
} else if (type === 'edit') {
|
|
|
this.$router.push({
|
|
|
path: '/home/details',
|
|
|
- query: { id: this.form.id, type: '1' }
|
|
|
+ query: {id: this.form.id, type: '1'}
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
- rowDel (row) {
|
|
|
+ rowDel(row) {
|
|
|
this.$confirm('确定删除选择的项目?', {
|
|
|
confirmButtonText: '确定',
|
|
|
cancelButtonText: '取消',
|
|
|
type: 'warning'
|
|
|
})
|
|
|
- .then(() => {
|
|
|
- this.$api.database.fileRemove({ ids: row.id }).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.$message.success(res.msg)
|
|
|
- this.onLoad()
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg)
|
|
|
- }
|
|
|
+ .then(() => {
|
|
|
+ this.$api.database.fileRemove({ids: row.id}).then(res => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message.success(res.msg)
|
|
|
+ this.onLoad()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
})
|
|
|
- })
|
|
|
},
|
|
|
- choise (index) {
|
|
|
+ choise(index) {
|
|
|
this.active = index
|
|
|
}
|
|
|
}
|