|
@@ -786,6 +786,17 @@ $(document).ready(function() {
|
|
|
$('body').on('click', '[name=del-file]', function() {
|
|
|
attObj.deleteAtt(parseInt(this.getAttribute('file_id')));
|
|
|
});
|
|
|
+ $('body').on('click', 'a[file_id]', function() {
|
|
|
+ const file_id = parseInt(this.getAttribute('file_id'));
|
|
|
+ const file = attObj.atts.find(x => { return x.id === file_id; });
|
|
|
+ if (!file) return;
|
|
|
+
|
|
|
+ if (file.viewpath) {
|
|
|
+ window.open(file.viewpath, '_blank');
|
|
|
+ } else {
|
|
|
+ AliOss.downloadFile(file.filepath, `${file.filename}${file.fileext}`)
|
|
|
+ }
|
|
|
+ });
|
|
|
$('.page-select').click(function() {
|
|
|
const content = this.getAttribute('content');
|
|
|
if (content === 'pre') {
|