文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit 8fa8e105 by Wang Yuhang

分片默认展开

parent f25720f5
var baseURL = 'http://localhost:9100/api'
var baseURL = 'http://47.92.1.107/api'
export {
baseURL
......
......@@ -2,11 +2,11 @@
<div class="pieces-table-container">
<el-table
ref="multipleTable"
:data="tableData"
style="width: 100%"
default-expand-all
:data="tableData"
:row-class-name="tableRowClassName"
@selection-change="selectionChange"
@expand-change="expandChange"
>
<el-table-column v-if="showSelection" type="selection" width="55"></el-table-column>
<el-table-column prop="id" label="分片id" width="120"></el-table-column>
......@@ -68,12 +68,15 @@ export default {
computed: {
userId () { return this.$store.state.userInfo.userId }
},
beforeMount () {
async beforeMount () {
// 拉取分片信息
var self = this, params = { taskId: this.taskId }
var params = { taskId: this.taskId }, self = this
if (this.isCheck) params.isCheck = true
if (this.withExecutor) params.userId = this.userId
this.axios.get('/slice/getPieces', { params }).then(res => { self.tableData = res.data })
var res = await this.axios.get('/slice/getPieces', { params })
this.tableData = res.data
// 拉取文件信息
res.data.forEach(piece => { self.getFiles(piece.id) })
},
methods: {
selectionChange (val) {
......@@ -107,12 +110,6 @@ export default {
})
}
},
expandChange (row, expandedRows) { // expandedRows是一个数组里面是展开的行
// 已获取分片的任务列表
if (this.map[row.id]) return
// 未获取
this.getFiles(row.id)
},
getFiles (pieceId) {
var params = { pieceId }
if (this.withExecutor) params.executor = this.userId
......
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