diff --git a/src/views/publicService/docCenter/components/rightTable.vue b/src/views/publicService/docCenter/components/rightTable.vue index 0397f00..579c596 100644 --- a/src/views/publicService/docCenter/components/rightTable.vue +++ b/src/views/publicService/docCenter/components/rightTable.vue @@ -761,17 +761,22 @@ export default { return } - if ( - this.acthType == 2 || - this.authType == 'otherShare' || - this.authType == 'myShare' - ) { + if (this.acthType == 2 || this.authType == 'otherShare') { // 判断选择的文件中 有没有auth 为1的 为1时仅可查看 不能下载 const hasAuth1 = this.selectedRows.some((row) => row.auth == 1) // 如果有多个则把多个的序号拼接起来 const auth1Indexes = this.selectedRows .filter((row) => row.auth == 1) - .map((row, index) => index + 1) + .map((row) => { + // 找到该行在 tableData 中的索引 + const tableIndex = this.tableData.findIndex( + (item) => item.id === row.id, + ) + // 返回表格中的序号(索引+1) + return tableIndex !== -1 ? tableIndex + 1 : null + }) + .filter((index) => index !== null) + .sort((a, b) => a - b) if (hasAuth1) { this.$modal.msgWarning( `序号为${auth1Indexes.join(