小编Sra*_*aaz的帖子

Perl:Win32 :: OLE和Microsoft Outlook - 有效地通过电子邮件附件进行迭代

我是一个实习生,对此很新...

我的老板每周一收到一封带有两个附件的电子邮件,他必须将其变成维基代码并将其放在我们的内部网站上.由于要转移的信息量,该过程每周一大约需要20分钟.我被要求简化这个过程.

我有代码将解析文件并将其分解为组件,我有代码从他的收件箱中获取所有附件.

我面临的问题是我的脚本从最早的电子邮件开始.这不是一个大问题,但它导致脚本运行的时间比需要的长得多.

#!/usr/bin/perl
use Cwd;
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Outlook';
use Win32::OLE::Variant;

my $OL = Win32::OLE->GetActiveObject('Outlook.Application') || Win32::OLE->new('Outlook.Application', 'Quit');
my $NameSpace = $OL->GetNameSpace("MAPI");
my $Folder = $NameSpace->GetDefaultFolder(olFolderInbox);
my $dir = cwd . "\\";
$dir =~ s/\//\\/g;
my $atch1, $file1, $atch2, $file2;

print ref($Folder->{Items}) . "\n";

foreach my $msg (in $Folder->{Items}){
    #print $msg->{CreationTime} . "\n";
    foreach my $atch (in $msg->{Attachments}){
        if($atch->{FileName} =~ m/.xls$/i){
            if($atch->{FileName} =~ /Name of attachment1/i){
                $atch1 = $atch;
                $file1 = $dir . "file1.xls"; …
Run Code Online (Sandbox Code Playgroud)

email perl automation ole attachment

5
推荐指数
1
解决办法
5318
查看次数

ng-repeat 位于 ng-repeat 内部,元素作为兄弟姐妹

我想列出使用 angularjs 创建一个这样的列表:

  • 家长 1
  • 组1
  • 儿童1
  • 儿童2
  • 儿童3
  • 儿童4
  • 组2
  • 儿童1
  • 儿童2

    -

  • 家长2
  • 组1
  • 儿童1
  • 儿童2
  • 组2
  • 儿童1

我有一些格式与此类似的数据。

$scope.parents = [{
    name:'Parent 1',
    groups: [{
        name:'Group1',
        children:[{name:'Child1'},{name:'Child2'},{name:'Child3'},{name:'Child4'}]
    },{
        name:'Group2',
        children:[{name:'Child1'},{name:'Child2'}]
    }]
 },{
    name:'Parent 2',
    groups: [{
        name:'Group1',
        children:[{name:'Child1'},{name:'Child2'}]
    },{
        name:'Group2',
        children:[{name:'Child1'}]
    }]
 },
 ...
];
Run Code Online (Sandbox Code Playgroud)

我无法找出用角度循环子数组的方法。我的 HTML 目前看起来像这样。

<ul ng-repeat="parent in parents">
    <li class="bold italic">{{parent.name}}</li>
    <li ng-repeat="group in parent.groups" class="bold">{{group.name}}</li>
</ul>
Run Code Online (Sandbox Code Playgroud)

我目前计划做这样的事情,然后用 css 修复它,但我很好奇是否有一种正确的方法可以用 Angular 来做到这一点,而不必将列表放在列表中。

<ul ng-repeat="parent in parents">
    <li class="bold italic">{{parent.name}}</li>
    <ul ng-repeat="group in parent.groups"> …
Run Code Online (Sandbox Code Playgroud)

javascript angularjs angularjs-ng-repeat

2
推荐指数
1
解决办法
1074
查看次数