dgf před 8 roky
rodič
revize
e5b0252aba

+ 18 - 7
talkview/src/js/controller/messageController.js

@@ -8,11 +8,11 @@ angular.module('appMessage').controller('MessageController', ['$scope', '$filter
 
         $scope.initAppContent = function(appContentJson) {
             $scope.appContent = JSON.parse(appContentJson);
-        }
+        };
 
         $scope.addMessage = function() {
             scroll(document.body);
-        }
+        };
 
         $scope.showMessage = function(jsonStr) {
             console.log(jsonStr);
@@ -25,7 +25,18 @@ angular.module('appMessage').controller('MessageController', ['$scope', '$filter
             var msg = JSON.parse(jsonStr);
             $scope.sendmessages.push(msg);
             $scope.scrollHide();
-        }
+        };
+        $scope.OpenFile = function(item) {
+            // var item = { fileName: file };
+            console.log("1111111111");
+            return lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'OpenFile', JSON.stringify(item), $scope);
+        };
+        $scope.OpenDirectory = function(item) {
+            // var item = { fileName: file };
+            console.log(JSON.stringify(item));
+            return lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'OpenDirectory', JSON.stringify(item), $scope);
+
+        };
 
         $scope.showHistoryMessage = function(jsonStr) {
             console.log(jsonStr);
@@ -37,7 +48,7 @@ angular.module('appMessage').controller('MessageController', ['$scope', '$filter
             jsonStr = jsonStr.replace(/\f/g, "\\f");
             var msg = JSON.parse(jsonStr);
             $scope.historymessages.push(msg);
-        }
+        };
 
         $scope.getTime = function(item) {
             return $filter("date")(item.ts, "yyyy-MM-dd HH:mm:ss");
@@ -46,14 +57,14 @@ angular.module('appMessage').controller('MessageController', ['$scope', '$filter
         $scope.getMore = function() {
             lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'LoadHistoryMessages', '', $scope);
             $scope.count = false;
-        }
+        };
 
         $scope.scrollHide = function() {
             angular.element("#body").addClass("scrollGlue");
-        }
+        };
         $scope.scrollShow = function() {
             angular.element("#body").removeClass("scrollGlue");
-        }
+        };
 
     }])
     .animation(".animate", function() {

+ 2 - 2
talkview/src/js/directive/currentmessage.js

@@ -182,8 +182,8 @@
                     '<span>大小:' + getFileSize(content) + '</span>' +
                     '<div class="p-t-sm text-right">' +
                     '<span id="transinfo"><span style="color:green;" class="glyphicon glyphicon-ok"></span><span>传输完成</span></span>' +
-                    '<a class="text-primary" role="button"><span>打开</span></a>&nbsp&nbsp' +
-                    '<a class="text-primary" role="button"><span>打开文件夹</span></a>' +
+                    '<a class="text-primary" role="button"><span ng-click="OpenFile(content)">打开</span></a>&nbsp&nbsp' +
+                    '<a class="text-primary" role="button"><span ng-click="OpenDirectory(content)">打开文件夹</span></a>' +
                     '</div>' +
                     '</div>';
             } else if (scope.msg.contentType == 4) {

+ 25 - 2
talkview/src/js/directive/historymessages.js

@@ -56,6 +56,16 @@
                 return $filter("date")(item.ts, "yyyy-MM-dd HH:mm:ss");
             };
 
+            scope.OpenFile = function(item) {
+                // var item = { fileName: file };
+                return lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'OpenFile', JSON.stringify(item), scope);
+            };
+            scope.OpenDirectory = function(item) {
+                // var item = { fileName: file };
+                console.log(JSON.stringify(item));
+                return lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'OpenDirectory', JSON.stringify(item), scope);
+
+            };
             var replaceSystemFace = function(content) {
                 //匹配表情
                 var g = (/\/\:([\w]+)/).exec(content);
@@ -167,8 +177,8 @@
                     '<span>大小:' + getFileSize(content) + '</span>' +
                     '<div class="p-t-sm text-right">' +
                     '<span id="transinfo"><span style="color:green;" class="glyphicon glyphicon-ok"></span><span>传输完成</span></span>' +
-                    '<a class="text-primary" role="button"><span>打开</span></a>&nbsp&nbsp' +
-                    '<a class="text-primary" role="button"><span>打开文件夹</span></a>' +
+                    '<a class="text-primary" role="button"><span ng-click="OpenFile(item.content)">打开</span></a>&nbsp&nbsp' +
+                    '<a class="text-primary" role="button"><span ng-click="OpenDirectory(item.content)">打开文件夹</span></a>' +
                     '</div>' +
                     '</div>';
             } else if (scope.msg.contentType == 4) {
@@ -210,4 +220,17 @@
             }
         }
     }
+    /* @ngInject */
+    function ControllerController(scope) {
+        scope.OpenFile = function(item) {
+            // var item = { fileName: file };
+            return lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'OpenFile', JSON.stringify(item), scope);
+        };
+        scope.OpenDirectory = function(item) {
+            // var item = { fileName: file };
+            console.log(JSON.stringify(item));
+            return lxtalkClient.Invoke('{15180DEF-D508-45F7-BAEB-6486CD8752C8}', 'OpenDirectory', JSON.stringify(item), scope);
+
+        };
+    }
 })();