diff --git a/haiwei-admin/src/main/resources/static/board/doc.js b/haiwei-admin/src/main/resources/static/board/doc.js index b0c2508..daab489 100644 --- a/haiwei-admin/src/main/resources/static/board/doc.js +++ b/haiwei-admin/src/main/resources/static/board/doc.js @@ -8,7 +8,8 @@ new Vue({ label: 'label' }, treeId: null, - tableData: [] + tableData: [], + tableIds:[], }; }, mounted() { @@ -17,32 +18,51 @@ new Vue({ methods: { handleNodeClick(data) { $.post(ctx + 'manage/base_file/fileList', {name: data.value}, (e) => { - console.log(e) this.tableData = e.data.map((e, i) => { return { no: i, name: e.fileName, date: e.createTime, people: e.customName, + objid:e.objid } }) }) this.treeId = data.id + this.treeName = data.value }, handleEdit(index, row) { console.log(index, row); }, handleDelete(index, row) { - console.log(index, row); + this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + $.post(ctx + 'manage/base_file/remove', {ids: row.objid}, (e) => { + this.$message({ + type: 'success', + message: '删除成功!', + }); + this.handleNodeClick({value:this.treeName}) + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消删除' + }); + }); }, handleSelectionChange(val) { - console.log(val); + this.tableIds = val.map(e=>e.objid).toString() + console.log(this.tableIds); }, addTree() { $.modal.open('设备智能驾驶舱', ctx + 'manage/base_customer/add'); }, delTree() { - this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { + this.$confirm('此操作将永久删除该账户, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' @@ -64,8 +84,25 @@ new Vue({ addTable() { $.modal.open('设备智能驾驶舱', ctx + 'manage/base_file/add'); }, - delTable(e) { - console.log(1) + delTable() { + this.$confirm('此操作将永久删除选中的文件, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + $.post(ctx + 'manage/base_file/remove', {ids: this.tableIds}, (e) => { + this.$message({ + type: 'success', + message: '删除成功!', + }); + this.handleNodeClick({value:this.treeName}) + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '已取消删除' + }); + }); }, getTree() { diff --git a/haiwei-admin/src/main/resources/templates/board/doc.html b/haiwei-admin/src/main/resources/templates/board/doc.html index e939ca3..80984f5 100644 --- a/haiwei-admin/src/main/resources/templates/board/doc.html +++ b/haiwei-admin/src/main/resources/templates/board/doc.html @@ -86,10 +86,10 @@