|
1 | 1 | <template lang="pug"> |
2 | 2 | div(:class="$style.songList") |
3 | | - div(v-if="list.length" :class="$style.list") |
4 | | - div(:class="$style.thead") |
5 | | - table |
6 | | - thead |
7 | | - tr |
8 | | - th.nobreak.center(style="width: 37px;") |
9 | | - material-checkbox(id="search_select_all" v-model="isSelectAll" @change="handleSelectAllData" |
10 | | - :indeterminate="isIndeterminate" :title="isSelectAll && !isIndeterminate ? '全不选' : '全选'") |
11 | | - th.nobreak(style="width: 25%;") 歌曲名 |
12 | | - th.nobreak(style="width: 20%;") 歌手 |
13 | | - th.nobreak(style="width: 22%;") 专辑 |
14 | | - th.nobreak(style="width: 18%;") 操作 |
15 | | - th.nobreak(style="width: 10%;") 时长 |
16 | | - div.scroll(:class="$style.tbody" ref="dom_scrollContent") |
17 | | - table |
18 | | - tbody |
19 | | - tr(v-for='(item, index) in list' :key='item.songmid' @click="handleDoubleClick(index)") |
20 | | - td.nobreak.center(style="width: 37px;" @click.stop) |
21 | | - material-checkbox(:id="index.toString()" v-model="selectdList" @change="handleChangeSelect" :value="item") |
22 | | - td.break(style="width: 25%;") |
23 | | - | {{item.name}} |
24 | | - span.badge.badge-info(v-if="item._types['320k']") 高品质 |
25 | | - span.badge.badge-success(v-if="item._types.ape || item._types.flac") 无损 |
26 | | - td.break(style="width: 20%;") {{item.singer}} |
27 | | - td.break(style="width: 22%;") {{item.albumName}} |
28 | | - td(style="width: 18%;") |
29 | | - material-list-buttons(:index="index" :search-btn="true" :play-btn="item.source == 'kw' || (!isAPITemp && item.source != 'tx')" :download-btn="item.source == 'kw' || (!isAPITemp && item.source != 'tx')" :remove-btn="false" @btn-click="handleListBtnClick") |
30 | | - //- button.btn-info(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k'] || item._types.flac" @click.stop='openDownloadModal(index)') 下载 |
31 | | - //- button.btn-secondary(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k']" @click.stop='testPlay(index)') 试听 |
32 | | - //- button.btn-success(type='button' v-if="(item._types['128k'] || item._types['192k'] || item._types['320k']) && userInfo" @click.stop='showListModal(index)') + |
33 | | - td(style="width: 10%;") {{item.interval || '--/--'}} |
34 | | - div(:class="$style.pagination") |
35 | | - material-pagination(:count="total" :limit="limit" :page="page" @btn-click="handleTogglePage") |
36 | | - div(v-else :class="$style.noitem") |
37 | | - p(v-html="noItem") |
| 3 | + transition(enter-active-class="animated fadeIn" leave-active-class="animated fadeOut") |
| 4 | + div(v-if="list.length" :class="$style.list") |
| 5 | + div(:class="$style.thead") |
| 6 | + table |
| 7 | + thead |
| 8 | + tr |
| 9 | + th.nobreak.center(style="width: 37px;") |
| 10 | + material-checkbox(id="search_select_all" v-model="isSelectAll" @change="handleSelectAllData" |
| 11 | + :indeterminate="isIndeterminate" :title="isSelectAll && !isIndeterminate ? '全不选' : '全选'") |
| 12 | + th.nobreak(style="width: 25%;") 歌曲名 |
| 13 | + th.nobreak(style="width: 20%;") 歌手 |
| 14 | + th.nobreak(style="width: 22%;") 专辑 |
| 15 | + th.nobreak(style="width: 18%;") 操作 |
| 16 | + th.nobreak(style="width: 10%;") 时长 |
| 17 | + div.scroll(:class="$style.tbody" ref="dom_scrollContent") |
| 18 | + table |
| 19 | + tbody |
| 20 | + tr(v-for='(item, index) in list' :key='item.songmid' @click="handleDoubleClick(index)") |
| 21 | + td.nobreak.center(style="width: 37px;" @click.stop) |
| 22 | + material-checkbox(:id="index.toString()" v-model="selectdList" @change="handleChangeSelect" :value="item") |
| 23 | + td.break(style="width: 25%;") |
| 24 | + | {{item.name}} |
| 25 | + span.badge.badge-info(v-if="item._types['320k']") 高品质 |
| 26 | + span.badge.badge-success(v-if="item._types.ape || item._types.flac") 无损 |
| 27 | + td.break(style="width: 20%;") {{item.singer}} |
| 28 | + td.break(style="width: 22%;") {{item.albumName}} |
| 29 | + td(style="width: 18%;") |
| 30 | + material-list-buttons(:index="index" :search-btn="true" :play-btn="item.source == 'kw' || (!isAPITemp && item.source != 'tx')" :download-btn="item.source == 'kw' || (!isAPITemp && item.source != 'tx')" :remove-btn="false" @btn-click="handleListBtnClick") |
| 31 | + //- button.btn-info(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k'] || item._types.flac" @click.stop='openDownloadModal(index)') 下载 |
| 32 | + //- button.btn-secondary(type='button' v-if="item._types['128k'] || item._types['192k'] || item._types['320k']" @click.stop='testPlay(index)') 试听 |
| 33 | + //- button.btn-success(type='button' v-if="(item._types['128k'] || item._types['192k'] || item._types['320k']) && userInfo" @click.stop='showListModal(index)') + |
| 34 | + td(style="width: 10%;") {{item.interval || '--/--'}} |
| 35 | + div(:class="$style.pagination") |
| 36 | + material-pagination(:count="total" :limit="limit" :page="page" @btn-click="handleTogglePage") |
| 37 | + div(v-else :class="$style.noitem") |
| 38 | + p(v-html="noItem") |
38 | 39 | material-flow-btn(:show="isShowEditBtn && (source == 'kw' || !isAPITemp)" :remove-btn="false" @btn-click="handleFlowBtnClick") |
39 | 40 | </template> |
40 | 41 |
|
@@ -111,6 +112,7 @@ export default { |
111 | 112 | }, |
112 | 113 | list(n) { |
113 | 114 | this.resetSelect() |
| 115 | + if (!this.list.length) return |
114 | 116 | this.$nextTick(() => scrollTo(this.$refs.dom_scrollContent, 0)) |
115 | 117 | }, |
116 | 118 | }, |
@@ -143,6 +145,7 @@ export default { |
143 | 145 | }, |
144 | 146 | handleSelectAllData(isSelect) { |
145 | 147 | this.selectdList = isSelect ? [...this.list] : [] |
| 148 | + this.$emit('input', [...this.selectdList]) |
146 | 149 | }, |
147 | 150 | resetSelect() { |
148 | 151 | this.selectdList = false |
@@ -183,6 +186,7 @@ export default { |
183 | 186 | } |
184 | 187 | .thead { |
185 | 188 | flex: none; |
| 189 | + background-color: @color-theme_2; |
186 | 190 | } |
187 | 191 | .tbody { |
188 | 192 | flex: auto; |
@@ -220,4 +224,12 @@ export default { |
220 | 224 | } |
221 | 225 | } |
222 | 226 |
|
| 227 | +each(@themes, { |
| 228 | + :global(#container.@{value}) { |
| 229 | + .thead { |
| 230 | + background-color: ~'@color-@{value}-theme_2'; |
| 231 | + } |
| 232 | + } |
| 233 | +}) |
| 234 | +
|
223 | 235 | </style> |
0 commit comments