Commit 83220be5 authored by 杨柠瑞's avatar 杨柠瑞

issues9

parent f639af49
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
<el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">搜索</el-button> <el-button class="filter-item" type="primary" v-waves icon="el-icon-search" @click="handleFilter">搜索</el-button>
<el-button class="filter-item" type="primary" :loading="downloadLoading" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button> <el-button class="filter-item" type="primary" :loading="downloadLoading" v-waves icon="el-icon-download" @click="handleDownload">导出</el-button>
<el-button class="filter-item" type="primary" v-waves icon="el-icon-plus" @click="openDialog('newData')">新建</el-button> <el-button class="filter-item" type="primary" v-waves icon="el-icon-plus" @click="openDialog('newData')">新建</el-button>
<el-button class="filter-item" type="primary" v-waves icon="el-icon-refresh" @click="refreshList">刷新</el-button>
</div> </div>
<!-- end 过滤 --> <!-- end 过滤 -->
...@@ -281,7 +282,7 @@ ...@@ -281,7 +282,7 @@
const tableName = self.schema['modelUnderscore'] const tableName = self.schema['modelUnderscore']
const filters = {} const filters = {}
filters[tableName] = {} filters[tableName] = {}
_.each(self.filters, function(filter) { _.each(_.cloneDeep(self.filters), function(filter) {
filters[tableName] = Object.assign(filters[tableName], filter) filters[tableName] = Object.assign(filters[tableName], filter)
}) })
delete filters[tableName]['placeholder'] delete filters[tableName]['placeholder']
...@@ -370,6 +371,11 @@ ...@@ -370,6 +371,11 @@
// 删除一条数据 // 删除一条数据
deleteData(data) { deleteData(data) {
const self = this const self = this
self.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
request(self.schema.modelUnderscorePlural + '/' + data.id + '/delete', { request(self.schema.modelUnderscorePlural + '/' + data.id + '/delete', {
method: 'POST', method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' } headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }
...@@ -382,6 +388,24 @@ ...@@ -382,6 +388,24 @@
self.getList() self.getList()
} }
}) })
}).catch(() => {
self.$message({
message: '已取消删除',
type: 'success'
})
})
},
refreshList() {
this.listQuery = {
page_no: 1,
page_size: 20,
sort_item: 'create_time',
sort_order: 'desc',
filters: {}
}
this.init()
this.getList()
}, },
handleFilter() { handleFilter() {
this.getList() this.getList()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment