xinyb
2022-11-30 83ba69d69dcf76ff0aa5fc0ec0eb22b1a6d9e212
WebRoot/js/bootstrap/fileinput/js/fileinput.js
@@ -2894,7 +2894,8 @@
                    sourceEvent: e,
                    previewId: $modal.data('previewId'),
                    modal: $modal,
                    viewerIndex:self.viewerIndex//图片定位用 xin 2022-9-30 15:11:58
                    viewerIndex:self.viewerIndex,//图片定位用 xin 2022-9-30 15:11:58
                    NumberofSummary:self.NumberofSummary
                };
            };
            $modal.on(event + '.bs.modal', function (e) {
@@ -3067,7 +3068,7 @@
                $btnTogh = $modal.find('.btn-kv-toggleheader'), dir = navigate === 'prev' ? 'Left' : 'Right',
                slideIn = 'slideIn' + dir, slideOut = 'slideOut' + dir, parsed, zoomData = $frame.data('zoom'),
                $search = $modal.find('.btn-kv-search'),$left = $modal.find('.btn-kv-left'),$right = $modal.find('.btn-kv-right'),
                thumbsData = self.getFrames().toArray();
                thumbsData = self.getFrames().toArray(),NumberofSummary=self.NumberofSummary;
            if (zoomData) {
                zoomData = decodeURIComponent(zoomData);
                parsed = $zoomPreview.html().replace(self.zoomPlaceholder, '').setTokens({zoomData: zoomData});
@@ -3101,43 +3102,19 @@
                    }
                }
                body = body + '</ul>';
            }else{
                let json={};
                json.type = 'view';
                let image = $frame.data('key') || '';
                let i = image.split(";");
                if (i.length == 2) {
                    json.unid = i[0];
                    json.seq = i[1];
                }
                $.ajax({
                    url: '/attachmentOa/getAllowOa.do',
                    type: 'POST',
                    data: JSON.stringify(json),
                    dataType: 'json',
                    contentType: 'application/json',
                    success: function (res) {
                        if (res != null && res.code == 0) {
                            let data = res.data;
                            $modal.find('.kv-zoom-caption').html(data.fileName);
                            $modal.find('.kv-zoom-caption').attr('title',data.fileName);
                            $modal.find('.viewsNumber').html(data.totaViewNums);
                            $modal.find('.downNumber').html(data.totaDownNums);
                        } else {
                            // modal.find('.kv-zoom-caption').html('');
                            // modal.find('.kv-zoom-caption').attr('title','');
                            $modal.find('.viewsNumber').html(0);
                            $modal.find('.downNumber').html(0);
                        }
                        // top.layer.closeAll();
                    }, error: function (xmlHttpRequest, textStatus, errorThrown) {
                        layui.layer.alert(xmlHttpRequest.responseText);
                    }
                })
            }
            //显示次数 xin 2022-9-28 16:56:55(暂时注释)
            // $modal.find('.viewsNumber').html(viewsNumber);
            // $modal.find('.downNumber').html(downNumber);
            if(NumberofSummary){
                let seq = $frame.data('key') || '';
                seq = seq.split(';')[1];
                for (let s = 0; s < NumberofSummary.length; s++) {
                    if (seq == NumberofSummary[s].seq) {
                        //显示次数 xin 2022-9-28 16:56:55(暂时注释)
                        $modal.find('.viewsNumber').html(NumberofSummary[s].totaViewNums);
                        $modal.find('.downNumber').html(NumberofSummary[s].totaDownNums);
                        break;
                    }
                }
            }
            //标题太长,限制显示25个 xin 2022-9-28 15:45:48
            if(cap.length > 30){
                logTitle=cap.substring(0,30)+'...';
@@ -3275,6 +3252,7 @@
            }
            $h.initModal($modal);
            $h.setHtml($modal, self._getModalContent());
            self._zoomNumPreview();//更新次数
            self._setZoomContent($frame);
            $modal.data({backdrop: false, fileinputPluginId: self.$element.attr('id')});
            $modal.find('.kv-zoom-body').css('height', self.zoomModalHeight);
@@ -3282,6 +3260,48 @@
            self._initZoomButtons();
            self._resizeZoomDialog(false);//直接打开大图
        },
        _zoomNumPreview:function(){
            var self = this, thumbsData = self.getFrames().toArray();
            if (thumbsData) {//更新打开的附件次数
                let json = {};
                json.type = 'view';
                json.seqArray=[]
                for(let t=0;t<thumbsData.length;t++){
                    let image = $(thumbsData[t]).data('key') || '';
                    let i = image.split(";");
                    if (i.length == 2) {
                        json.unid = i[0];
                        json.seqArray.push(i[1]);
                    }
                }
                $.ajax({
                    url: '/attachmentOa/getAllowOa.do',
                    type: 'POST',
                    data: JSON.stringify(json),
                    dataType: 'json',
                    async: false,
                    contentType: 'application/json',
                    success: function (res) {
                        if (res != null && res.code == 0) {
                            self.NumberofSummary=res.data;
                            // $modal.find('.kv-zoom-caption').html(data.fileName);
                            // $modal.find('.kv-zoom-caption').attr('title',data.fileName);
                            // $modal.find('.viewsNumber').html(data.totaViewNums);
                            // $modal.find('.downNumber').html(data.totaDownNums);
                        } else {
                            self.NumberofSummary=null;
                            // modal.find('.kv-zoom-caption').html('');
                            // modal.find('.kv-zoom-caption').attr('title','');
                            // $modal.find('.viewsNumber').html(0);
                            // $modal.find('.downNumber').html(0);
                        }
                        // top.layer.closeAll();
                    }, error: function (xmlHttpRequest, textStatus, errorThrown) {
                        layui.layer.alert(xmlHttpRequest.responseText);
                    }
                })
            }
        },
        _zoomPreview: function ($btn) {
            var self = this, $frame;
            if (!$btn.length) {