<rt-form id="{{vm.form.name}}" name="{{vm.form.name}}" novalidate>
    <div class="row rt-margin-bottom-before-box">
        <div class="col-sm-2">
            <button class="btn btn-link" type="button" id="btnClose" ng-click="vm.form.hide()">
                <i class="fa fa-sign-out"></i> 关闭
            </button>
        </div>
        <!-- div[.col-sm-2] -->
        <div class="col-sm-10">
            <div class="pull-right">
                <rt-button id="btnSave" rt-style="link" rt-title="发送" rt-icon="floppy-o" ng-click="vm.form.newSave()" ng-show="(vm.form.type === 'Create' && vm.privilege.IsCreate)">
                </rt-button>
            </div>
        </div>
        <!-- div[.col-sm-10] -->
    </div>
    <!-- div[.row] -->
    <div class="nav-tabs-custom">
        <ul class="nav nav-tabs">
            <li class="active">
                <a href="#A1" onclick="return false;" data-toggle="tab">资料</a>
            </li>
            <li ng-if="vm.form.type === 'Edit'">
                <a href="#A2" onclick="return false;" data-toggle="tab">评论</a>
            </li>
        </ul>

        <div class="tab-content">
            <div class="tab-pane active" id="A1">
                <rt-section rt-title="基本信息">
                    <rt-section-row>
                        <rt-datetime rt-type="datetime" rt-title="创建时间" rt-disabled="true" rt-col="4" ng-model="vm.form.data.CreatedOn" ng-show="vm.form.type === 'Edit'"></rt-datetime>
                    </rt-section-row>
                    <!--当编辑页时显示-->
                    <rt-section-row ng-if="vm.form.type === 'Edit'">
                        <rt-input rt-type="text" rt-title="年度第几周" ng-if="vm.form.type === 'Edit'" rt-disabled="vm.form.type === 'Edit'" rt-col="4"
                            ng-model="vm.form.data.weeknum"></rt-input>
                    </rt-section-row>
                    <rt-section-row ng-if="vm.form.type === 'Edit'">
                        <rt-textarea rt-type="text" rt-title="本周计划" ng-if="vm.form.type === 'Edit'" rt-disabled="vm.form.type === 'Edit'" rt-col="10"
                            rt-row="5" ng-model="vm.form.data.current_work"></rt-textarea>
                    </rt-section-row>
                    <!--当编辑页时显示End-->
                    <!--当新增页时显示-->
                    <rt-section-row ng-if="vm.form.type !== 'Edit'">
                        <rt-input rt-type="text" rt-title="年度第几周" rt-disabled="true" rt-col="4" ng-model="vm.currentweeknum"></rt-input>
                    </rt-section-row>
                    <rt-section-row ng-if="vm.form.type !== 'Edit'">
                        <rt-textarea rt-type="text" rt-title="本周计划" rt-disabled="true" rt-col="10" rt-row="5" ng-model="vm.current_work"></rt-textarea>
                    </rt-section-row>
                    <!--当新增页时显示End-->
                    <rt-section-row>
                        <rt-textarea rt-type="text" rt-title="本周完成工作" rt-disabled="vm.form.type === 'Edit'" rt-col="10" rt-row="5" ng-model="vm.form.data.finish_work"></rt-textarea>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-textarea rt-type="text" rt-title="本周工作总结" rt-disabled="vm.form.type === 'Edit'" rt-col="10" rt-row="5" ng-model="vm.form.data.summary"></rt-textarea>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-textarea rt-type="text" rt-title="下周工作计划" rt-disabled="vm.form.type === 'Edit'" rt-col="10" rt-row="5" ng-model="vm.form.data.schedule"></rt-textarea>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-textarea rt-type="text" rt-title="协调与帮助" rt-disabled="vm.form.type === 'Edit'" rt-col="10" rt-row="5" ng-model="vm.form.data.coordinate_work"></rt-textarea>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-textarea rt-title="备注" rt-disabled="vm.form.type === 'Edit'" rt-col="10" rt-row="5" ng-model="vm.form.data.remark"></rt-textarea>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="阅读人数" ng-if="vm.form.type === 'Edit'" rt-disabled="vm.form.type === 'Edit'" rt-col="4"
                            ng-model="vm.form.times"></rt-input>
                    </rt-section-row>
                </rt-section>
                <rt-section rt-title="发送" ng-show="vm.form.type === 'Create'">
                    <p style="white-space:normal;">
                        <span ng-repeat="row in vm.form.readerList">
                            <span class="rt-avatar" ng-style="{{vm.form.getAvatarColor($index)}};" ng-click="vm.form.deleteReaderList($index)">{{row.OwnerId.Name.length
                                <=3?row.OwnerId.Name:row.OwnerId.Name.substring(0,3)}}</span>
                                    <span class="rt-avatar-line">-----</span>
                            </span>
                            <span class="rt-avatar-add">
                                <i class="icon ion-ios-plus-outline" style="font-size: 4em !important;" ng-click="addApprover()"></i>
                            </span>
                    </p>
                </rt-section>

                <rt-section rt-title="已读人列表" ng-show="vm.form.type === 'Edit'">
                    <rt-data-grid-no-page rt-page-record-count="vm.page.recordCount" rt-page-index="vm.page.index" rt-page-size="vm.page.size"
                        rt-get-data="vm.view.search()" rt-sort-field="vm.view.sortField" rt-rows="vm.data" rt-selected-ids="vm.view.selectedIds"
                        rt-auto-height="vm.view.autoHeight">
                        <table class="table table-condensed table-hover">
                            <tbody>
                                <tr ng-repeat="row in vm.form.readed">
                                    <!-- @@ 视图列表值 -->
                                    <td>{{row.ReadByName}}</td>
                                </tr>
                            </tbody>
                        </table>
                    </rt-data-grid-no-page>
                    <!-- rt-data-grid  -->
                </rt-section>

                <rt-section rt-title="附件">
                    <button style=" margin-left: 100px;" class="btn btn-default" ng-file-select ng-file-change="vm.form.fileSelect($files)" multiple="multiple"
                        ng-if="vm.form.type === 'Create'">选择文件
                    </button>

                    <button type="button" class="btn btn-default" ng-click="vm.form.deleteFile()" ng-if="vm.form.type === 'Create'">删除附件
                    </button>

                    <rt-data-grid-no-page rt-page-record-count="vm.page.recordCount" rt-page-index="vm.page.index" rt-page-size="vm.page.size"
                        rt-get-data="vm.view.search()" rt-sort-field="vm.view.sortField" rt-rows="vm.data" rt-selected-ids="vm.view.selectedIds"
                        rt-auto-height="vm.view.autoHeight">
                        <table class="table table-condensed table-hover">
                            <thead>
                                <tr>
                                    <th>
                                        <rt-header-checkbox></rt-header-checkbox>
                                    </th>
                                    <!-- @@ 视图表头 -->
                                    <th rt-field-code="name">附件名称（点击可下载）</th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr ng-repeat="row in vm.form.attachmentList">
                                    <td>
                                        <rt-data-checkbox value="{{row.Id}}" />
                                    </td>
                                    <!-- @@ 视图列表值 -->
                                    <td>
                                        <button type="button" class="btn btn-link" ng-click="vm.form.downloadFile(row.Id)"> {{row.FileName}}
                                        </button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </rt-data-grid-no-page>
                    <!-- rt-data-grid  -->
                </rt-section>
            </div>

            <div class="tab-pane" id="A2">
                <rt-data-grid rt-page-record-count="vm.form.recordCount" rt-page-index="vm.pageIndex" rt-page-size="vm.pageSize" rt-get-data="vm.search()"
                    rt-rows="vm.form.commentList" rt-auto-height=" {{tableMaxHeight}}" ng-if="vm.form.recordCount">
                    <div class="media bg-comment">
                        <div class="comment-item" ng-repeat="row in vm.form.commentList track by $index">
                            <div class="media-left media-middle">
                                <span class="rt-avatar" ng-style="{{vm.form.getAvatarColor($index)}};">{{row.CreatedByName.length
                                    <=4?row.CreatedByName:row.CreatedByName.substring(0,4)}} </span>
                            </div>
                            <div class="media-body" style="word-break: break-word;">
                                <div>
                                    <span style="margin-right: 3em;color: #3C8DBC;">{{row.CreatedByName}}</span>
                                    <span class="rt-text-weak-02">{{row.lastModifiedOn | date:'yyyy-MM-dd HH:mm:ss'}}</span>
                                    <span style="float:right;">
                                        <i ng-class="{true: 'ion-ios-star',false:'ion-ios-star-outline'}[row.score_value>=2]" style="color:gold;font-size:16px;"
                                            ng-click="vm.StarClick1(1)"></i>&nbsp;&nbsp;
                                        <i ng-class="{true: 'ion-ios-star',false:'ion-ios-star-outline'}[row.score_value>=4]" style="color:gold;font-size:16px;"
                                            ng-click="vm.StarClick1(2)"></i>&nbsp;&nbsp;
                                        <i ng-class="{true: 'ion-ios-star',false:'ion-ios-star-outline'}[row.score_value>=6]" style="color:gold;font-size:16px;"
                                            ng-click="vm.StarClick1(3)"></i>&nbsp;&nbsp;
                                        <i ng-class="{true: 'ion-ios-star',false:'ion-ios-star-outline'}[row.score_value>=8]" style="color:gold;font-size:16px;"
                                            ng-click="vm.StarClick1(4)"></i>&nbsp;&nbsp;
                                        <i ng-class="{true: 'ion-ios-star',false:'ion-ios-star-outline'}[row.score_value>=10]" style="color:gold;font-size:16px;"
                                            ng-click="vm.StarClick1(5)"></i>
                                    </span>
                                </div>
                                <p>{{row.text}}</p>
                            </div>
                        </div>
                    </div>
                </rt-data-grid>
                <rt-section-row class="row">
                    <label class="col-sm-1 control-label">评分</label>
                    <div class="col-sm-3">
                        <i ng-class="{true: 'ion-ios-star',false:'ion-ios-star-outline'}[vm.score>=2]" style="color:gold;font-size:20px;cursor: pointer;"
                            ng-click="vm.StarClick1(1)"></i>&nbsp;&nbsp;
                        <i ng-class="{true: 'ion-ios-star',false:'ion-ios-star-outline'}[vm.score>=4]" style="color:gold;font-size:20px;cursor: pointer;"
                            ng-click="vm.StarClick1(2)"></i>&nbsp;&nbsp;
                        <i ng-class="{true: 'ion-ios-star',false:'ion-ios-star-outline'}[vm.score>=6]" style="color:gold;font-size:20px;cursor: pointer;"
                            ng-click="vm.StarClick1(3)"></i>&nbsp;&nbsp;
                        <i ng-class="{true: 'ion-ios-star',false:'ion-ios-star-outline'}[vm.score>=8]" style="color:gold;font-size:20px;cursor: pointer;"
                            ng-click="vm.StarClick1(4)"></i>&nbsp;&nbsp;
                        <i ng-class="{true: 'ion-ios-star',false:'ion-ios-star-outline'}[vm.score>=10]" style="color:gold;font-size:20px;cursor: pointer;"
                            ng-click="vm.StarClick1(5)"></i>
                    </div>
                </rt-section-row>

                <rt-section-row>
                    <textarea class="form-control" rt-type="text" placeholder="请输入评论内容" rows="5" rt-required="false" ng-model="vm.text"></textarea>
                    <div style="text-align: right;">
                        <button class="btn btn-primary" style="margin-top:10px;" ng-disabled="!vm.isComment" ng-click="vm.commentClick()">发送</button>
                    </div>
                </rt-section-row>
            </div>
        </div>

    </div>
</rt-form>
<!-- rt-form -->