<rt-form id="{{vm.form.name}}" name="{{vm.form.name}}" novalidate>
    <style>
        .panel-footer {
            background-color: #f5f5f5;
            border-top: 1px solid #ddd;
            border-bottom-right-radius: 3px;
            border-bottom-left-radius: 3px;
            margin-top: -89px;
            padding: 10px 15px 1px;
        }

        .com-primary {
            background-color: #3c8dbc;
            border-color: #367fa9;
            margin-top: -35px;
            color: #fff;
        }

        #comm {
            font-family: inherit;
            font-size: inherit;
            line-height: inherit;
            width: 86%;
            margin-left: 4%;
            resize: none;
        }
    </style>
    <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>
                <!--<rt-button id="btnDelete"-->
                <!--rt-style="link"-->
                <!--rt-title="删除"-->
                <!--rt-icon="trash"-->
                <!--ng-click="vm.form.del()"-->
                <!--ng-show="vm.form.type === 'Edit' && vm.privilege.IsDelete">-->
                <!--</rt-button>-->
            </div>
        </div>
        <!-- div[.col-sm-10] -->
    </div>
    <!-- div[.row] -->
    <div class="nav-tabs-custom">
        <!-- @@表单 -->
        <ul class="nav nav-tabs" ng-if="vm.form.type === 'Edit'">
            <li class="active">
                <a href="#A1" onclick="return false;" data-toggle="tab">资料</a>
            </li>
            <li>
                <a href="#A2" onclick="return false;" data-toggle="tab">评论</a>
            </li>
        </ul>
        <!-- ui[.nav] -->
        <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-textarea rt-type="text" rt-title="今日计划" rt-disabled="vm.form.type === 'Edit'" rt-col="10" rt-row="5" ng-model="vm.form.data.current_work"></rt-textarea>
                    </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>
                    <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.unfinished_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.coordinate_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.schedule"></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[#1, .tab-pane] -->
            <div class="tab-pane" id="A2">
                <rt-section rt-title="评论" ng-show="vm.form.type === 'Edit'">
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="btn-group">
                                <button class="btn btn-link" ng-click="vm.sendstatus=2;">
                                    <i class="fa fa-plus"></i> 显示发送框
                                </button>
                                <button class="btn btn-link" ng-click="vm.sendstatus=1;">
                                    <i class="fa fa-trash"></i> 隐藏发送框
                                </button>
                                <button class="btn btn-link" ng-if="vm.form.commentList.length==0">
                                    (暂无评论)
                                </button>
                                <button class="btn btn-link" ng-if="vm.form.commentList.length>0">
                                    (共有{{vm.form.commentList.length}}条评论)
                                </button>
                            </div>
                            <!-- div[.btn-group] -->
                        </div>
                        <!-- div[.col-sm-12]-->
                    </div>
                    <table class="table table-hover" ng-if="vm.form.commentList.length>0" style="margin-bottom: 89px;">
                        <thead>
                            <tr>
                                <th class="rt-text-align" style="width: 20%;">评论人</th>
                                <th class="rt-text-align" style="width: 20%;">评论时间</th>
                                <th class="rt-text-align" style="width: 60%;">评论内容</th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr ng-repeat="row in vm.form.commentList track by row.post_commentId">
                                <td class="rt-text-align" style="width: 20%;">{{row.CreatedByName}}</td>
                                <td class="rt-text-align" style="width: 20%;">{{row.CreatedOn | date:'yyyy-MM-dd HH:mm'}}</td>
                                <td class="rt-text-align" style="white-space: normal;width: 60%;">{{row.text}}</td>
                            </tr>
                        </tbody>
                    </table>
                </rt-section>
            </div>
            <!-- div[#2, .tab-pane] -->

        </div>
        <!-- div[.tab-content] -->
    </div>
    <!-- div[.panel-body] -->
    <div class="nav-tabs-custom" ng-show="vm.form.type === 'Edit' && vm.sendstatus===2">
        <rt-section-row>
            <textarea id="comm" rt-type="text" placeholder="请输入评论内容" rt-col="10" rt-row="2" rt-required="false" ng-model="vm.sendComment"></textarea>
            <button class="btn com-primary" ng-disabled="!vm.isComment" ng-click="vm.form.sendComment()">发送</button>
        </rt-section-row>
    </div>
</rt-form>
<!-- rt-form -->