右侧抽屉显示任务详情,暂时未对数据做过滤

This commit is contained in:
ngfchl
2022-10-08 15:59:38 +08:00
parent 919470bba3
commit d0eeeafbae

View File

@@ -167,6 +167,8 @@
@selection-change="tableSelected" @selection-change="tableSelected"
:menu-config="tableMenu" :menu-config="tableMenu"
@menu-click="contextMenuClickEvent" @menu-click="contextMenuClickEvent"
@cell-dblclick="showDetails"
{# @cell-click="detailClick"#}
:data="mainData.torrents" :data="mainData.torrents"
:loading="loading" :loading="loading"
height="700" size="mini" height="700" size="mini"
@@ -271,6 +273,28 @@
<el-tag size="medium" color="#696969" <el-tag size="medium" color="#696969"
v-text="'上传速度:' + renderSize(server_state.up_info_speed) + '/S'"></el-tag> v-text="'上传速度:' + renderSize(server_state.up_info_speed) + '/S'"></el-tag>
</div> </div>
<div>
<el-drawer
style="margin-bottom: 35px !important;position: fixed;z-index:99999;"
:title="torrent.name"
:visible.sync="details"
direction="rtl"
:modal="false"
:wrapperClosable="false"
:destroy-on-close="true"
:close-on-press-escape="true"
:close="closeDrawer"
:with-header="false"
show-header-overflow show-overflow="tooltip"
size="40%">
<el-descriptions :title="torrent.name" border size="mini" colon :column="1">
<el-descriptions-item v-for="(value,key,index) in torrent"
:label="key">
<span v-text="value"></span>
</el-descriptions-item>
</el-descriptions>
</el-drawer>
</div>
</div> </div>
@@ -319,21 +343,22 @@
categoryForm: false, categoryForm: false,
refresh: false, refresh: false,
downloader_id: 0, downloader_id: 0,
details: false,
torrent: { torrent: {
name: '', {#name: '',#}
category: '', {#category: '',#}
size: '', {#size: '',#}
downloaded: '', {#downloaded: '',#}
uploaded: '', {#uploaded: '',#}
dlspeed: '', {#dlspeed: '',#}
upspeed: '', {#upspeed: '',#}
progress: '', {#progress: '',#}
ratio: '', {#ratio: '',#}
seeding_time: '', {#seeding_time: '',#}
state: '', {#state: '',#}
last_activity: '', {#last_activity: '',#}
added_on: '', {#added_on: '',#}
tracker: '', {#tracker: '',#}
}, },
customColors: [ customColors: [
{color: '#f56c6c', percentage: 20}, {color: '#f56c6c', percentage: 20},
@@ -476,14 +501,23 @@
this.$nextTick(() => { this.$nextTick(() => {
// 将表格和工具栏进行关联 // 将表格和工具栏进行关联
const $table = this.$refs.dataTable const $table = this.$refs.dataTable
console.log(this.$refs) {#console.log(this.$refs)#}
console.log($table) {#console.log($table)#}
$table.connect(this.$refs.xToolbar) $table.connect(this.$refs.xToolbar)
}) })
this.get_downloaders() this.get_downloaders()
}, },
watch: {}, watch: {},
methods: { methods: {
showDetails({row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event}) {
console.log(row)
this.torrent = row
this.details = true
},
closeDrawer() {
this.details = false
this.torrent = {}
},
clearFilters() { clearFilters() {
//清除筛选 //清除筛选
this.$refs.dataTable.clearFilter() this.$refs.dataTable.clearFilter()
@@ -652,8 +686,10 @@
handleTracker({row, column, cellValue, index}) { handleTracker({row, column, cellValue, index}) {
// 格式化输出tracker所属的站点 // 格式化输出tracker所属的站点
let site = this.tracker_list.find(site => cellValue.includes(site.tracker)) let site = this.tracker_list.find(site => cellValue.includes(site.tracker))
{#console.log(site)#} {#console.log(row)#}
return site ? site.name : cellValue {#console.log(cellValue.includes('joy'))#}
{#return cellValue#}
return null != site ? site.name : cellValue
}, },
handleState({row, column, cellValue, index}) { handleState({row, column, cellValue, index}) {
return download_state[cellValue] return download_state[cellValue]