|
@@ -122,7 +122,8 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-table v-show="audioData.form.type !== 2" ref="table" :data="audioData.tableData" :row-key="rowKey"
|
|
|
- @selection-change="handleSelectionChange" @select="handleSelectChange" v-loading="audioData.loading">
|
|
|
+ @selection-change="handleSelectionChange" @select="handleSelectChange" @select-all="handleSelectAllChange"
|
|
|
+ v-loading="audioData.loading">
|
|
|
<el-table-column type="selection" width="55" key="selection" />
|
|
|
<el-table-column label="ID" prop="id" align="center" key="id" show-overflow-tooltip />
|
|
|
<el-table-column label="音频名称" prop="name" align="center" key="name" show-overflow-tooltip />
|
|
@@ -329,12 +330,24 @@ const handleSelectionChange = (e) => {
|
|
|
|
|
|
// 取消勾选
|
|
|
const handleSelectChange = (arr, row) => {
|
|
|
- if(arr.findIndex(i => i.id === row.id) === -1) {
|
|
|
+ if (arr.findIndex(i => i.id === row.id) === -1) {
|
|
|
let index = data.selectionList.findIndex(i => i.audioId === row.id)
|
|
|
data.selectionList.splice(index, 1)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+const handleSelectAllChange = (e) => {
|
|
|
+ if (e.length === 0) {
|
|
|
+ for (let i = 0; i < audioData.tableData.length; i++) {
|
|
|
+ for (let j = 0; j < data.selectionList.length; j++) {
|
|
|
+ if (audioData.tableData[i].id === data.selectionList[j].audioId) {
|
|
|
+ data.selectionList.splice(j, 1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
// 单选
|
|
|
const handleChooseAudio = (e) => {
|
|
|
data.form.audioList = []
|