|
|
@@ -84,14 +84,15 @@
|
|
|
const tipType = 'title='; //'data-toggle="tooltip" data-html="true" data-placement="left" data-original-title=';
|
|
|
html.push(`<td file-id="${att.id}"><div class="d-flex"><a href="javascript:void(0)" ${tipType}"${tipHtml}" class="pl-0 col-11" file-id=${att.id}>${att.filename}${att.fileext}</a></div></td>`);
|
|
|
html.push(`<td>${att[fileInfo.user_name]}</td>`);
|
|
|
- const canDel = setting.readOnly ? false : att[fileInfo.user_id] === userID && (!setting.checked || att.extra_upload);
|
|
|
- const moveHtml = setting.moveUrl ? `<a href="javascript: void(0);" class="ml-1 text-primary" name="att-move" file-id="${att.id}" ${tipType}"移动"><i class="fa fa-exchange fa-fw"></i></a>` : '';
|
|
|
- const editHtml = setting.saveUrl ? `<a href="javascript: void(0);" class="ml-1 text-primary" name="att-edit" file-id="${att.id}" ${tipType}"重命名"><i class="fa fa-pencil fa-fw"></i></a>` : '';
|
|
|
+ const canDel = setting.readOnly ? false : (att[fileInfo.user_id] === userID || setting.editfile) && (!setting.checked || att.extra_upload);
|
|
|
+ const moveHtml = canDel && setting.moveUrl ? `<a href="javascript: void(0);" class="ml-1 text-primary" name="att-move" file-id="${att.id}" ${tipType}"移动"><i class="fa fa-exchange fa-fw"></i></a>` : '';
|
|
|
+ const editHtml = canDel && setting.saveUrl ? `<a href="javascript: void(0);" class="ml-1 text-primary" name="att-edit" file-id="${att.id}" ${tipType}"重命名"><i class="fa fa-pencil fa-fw"></i></a>` : '';
|
|
|
+ const delHtml = canDel ? `<a class="ml-1 text-danger" href="javascript:void(0)" name="att-delete" file-id="${att.id}"><i class="fa fa-close" ${tipType}"删除"></i></a>` : '';
|
|
|
html.push('<td width="80">',
|
|
|
`<a class="ml-1" href="javascript:void(0)" ${tipType}"定位" name="att-locate" file-id="${att.id}"><i class="fa fa-crosshairs"></i></a>`,
|
|
|
att.viewpath ? `<a class="ml-1" href="${att.viewpath}" ${tipType}"预览" target="_blank"><i class="fa fa-eye"></i></a>` : '',
|
|
|
`<a class="ml-1" href="javascript:void(0)" ${tipType}"下载" onclick="AliOss.downloadFile('${att.filepath}', '${att.filename}${att.fileext}')"><i class="fa fa-download"></i></a>`,
|
|
|
- canDel ? `<a class="ml-1 text-danger" href="javascript:void(0)" name="att-delete" file-id="${att.id}"><i class="fa fa-close" ${tipType}"删除"></i></a>` : '', moveHtml, editHtml,
|
|
|
+ delHtml, moveHtml, editHtml,
|
|
|
'</td>');
|
|
|
html.push('</tr>');
|
|
|
return html.join('');
|
|
|
@@ -253,7 +254,7 @@
|
|
|
const oxi = nodeIndexes[this.file[setting.masterKey]];
|
|
|
if (oxi) {
|
|
|
const oxii = findFileIndex(oxi, this.file.id);
|
|
|
- if (oxii) oxi.splice(oxii, 1);
|
|
|
+ if (oxii >= 0) oxi.splice(oxii, 1);
|
|
|
}
|
|
|
if (!nodeIndexes[data[setting.masterKey]]) {
|
|
|
nodeIndexes[data[setting.masterKey]] = [this.file];
|
|
|
@@ -261,6 +262,7 @@
|
|
|
nodeIndexes[data[setting.masterKey]].unshift(this.file);
|
|
|
}
|
|
|
this.file[setting.masterKey] = data[setting.masterKey];
|
|
|
+ setting.getRelaNode(this.file);
|
|
|
}
|
|
|
};
|
|
|
const findFile = setting.fileIdType === 'string'
|