<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(false)" rt-disabled="vm.form.data.StateCode.Value == 1"
                    ng-show="(vm.form.type === 'Create' && vm.privilege.IsCreate) || (vm.form.type === 'Edit' && vm.privilege.IsWrite)">
                </rt-button>
                <rt-button id="btnSaveAndNew" rt-style="link" rt-title="保存并新建" rt-icon="floppy-o" ng-click="vm.form.newsave(true)" rt-disabled="vm.form.data.StateCode.Value == 1"
                    ng-show="(vm.form.type === 'Create' && vm.privilege.IsCreate) || (vm.form.type === 'Edit' && vm.privilege.IsWrite)">
                </rt-button>
                <rt-button id="btnDelete" rt-style="link" rt-title="删除" rt-icon="trash" ng-click="vm.form.del()" rt-disabled="vm.form.data.StateCode.Value == 1"
                    ng-show="vm.form.type === 'Edit' && vm.privilege.IsDelete">
                </rt-button>
                <rt-button id="btnActivate" rt-style="link" rt-title="激活" rt-icon="check" ng-click="vm.form.activate()" ng-show="vm.form.type === 'Edit' && vm.form.data.StateCode.Value == 1 && vm.privilege.IsActive">
                </rt-button>
                <rt-button id="btnDeactivate" rt-style="link" rt-title="停用" rt-icon="ban" ng-click="vm.form.deactivate()" rt-disabled="vm.form.data.StateCode.Value == 1"
                    ng-show="vm.form.type === 'Edit' && vm.form.data.StateCode.Value == 0 && vm.privilege.IsActive">
                </rt-button>
            </div>
        </div>
    </div>
    <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-input rt-type="text" rt-title="课程名称" rt-col="4" rt-required="true" rt-disabled="vm.form.data.StateCode.Value == 1" ng-model="vm.form.data.name"></rt-input>
                    </rt-section-row>
                    <rt-section-row>
                        <rt-lookup2 rt-title="课程类别" rt-disabled="vm.form.data.StateCode.Value == 1" ng-model="vm.form.data.lgm_course_categoryId"
                            rt-get-data-name="Course.GetCourseCategory" rt-order-by="name" rt-col-list="[{Code:'name',Name:'课程分类名称'}]"
                            rt-required="false" rt-col="4"></rt-lookup2>
                    </rt-section-row>

                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="课程封面" rt-col="4" rt-required="false" rt-disabled="true" ng-model="vm.coverImg.fileName"></rt-input>
                        <rt-button style="margin-left: 50px;" rt-type="file" rt-style="default" rt-title="选择文件" rt-disabled="vm.form.data.StateCode.Value == 1"
                            ng-file-select ng-file-change="vm.form.fileSelect($files,'cover')">
                        </rt-button>
                        <rt-button class="btn btn-default" rt-type="button" rt-title="删除附件" rt-disabled="vm.form.data.StateCode.Value == 1" ng-click="vm.form.deleteFile('cover')">
                        </rt-button>
                        <span style="color:red;font-size:12px;">封面图片的大小不超过100k</span>
                    </rt-section-row>
                    <rt-section-row ng-show="vm.coverImg.imageSrc">
                        <img ng-src="{{vm.coverImg.imageSrc}}" style="width: 245px;height: 160px; margin-left: 18.5%;" alt="课程封面">
                    </rt-section-row>
                    <rt-section-row ng-show="vm.coverImg.base64Content">
                        <img ng-src="{{vm.coverImg.base64Content}}" style="width: 245px;height: 160px; margin-left: 18.5%;"
                            alt="课程封面">
                    </rt-section-row>

                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="列表小图" rt-col="4" rt-required="false" rt-disabled="true" ng-model="vm.smallImg.fileName"></rt-input>
                        <rt-button style="margin-left: 50px;" rt-type="file" rt-style="default" rt-title="选择文件" rt-disabled="vm.form.data.StateCode.Value == 1"
                            ng-file-select ng-file-change="vm.form.fileSelect($files,'small')">
                        </rt-button>
                        <rt-button class="btn btn-default" rt-type="button" rt-title="删除附件" rt-disabled="vm.form.data.StateCode.Value == 1" ng-click="vm.form.deleteFile('small')">
                        </rt-button>
                        <span style="color:red;font-size:12px;">列表小图的大小不超过100k</span>
                    </rt-section-row>
                    <rt-section-row ng-show="vm.smallImg.imageSrc">
                        <img ng-src="{{vm.smallImg.imageSrc}}" style="width: 245px;height: 160px; margin-left: 18.5%;" alt="列表小图">
                    </rt-section-row>
                    <rt-section-row ng-show="vm.smallImg.base64Content">
                        <img ng-src="{{vm.smallImg.base64Content}}" style="width: 245px;height: 160px; margin-left: 18.5%;"
                            alt="列表小图">
                    </rt-section-row>

                    <rt-section-row>
                        <rt-input rt-type="text" rt-title="列表大图" rt-col="4" rt-required="false" rt-disabled="true" ng-model="vm.bigImg.fileName"></rt-input>
                        <rt-button style="margin-left: 50px;" rt-type="file" rt-style="default" rt-title="选择文件" rt-disabled="vm.form.data.StateCode.Value == 1"
                            ng-file-select ng-file-change="vm.form.fileSelect($files,'big')">
                        </rt-button>
                        <rt-button class="btn btn-default" rt-type="button" rt-title="删除附件" rt-disabled="vm.form.data.StateCode.Value == 1" ng-click="vm.form.deleteFile('big')">
                        </rt-button>
                        <span style="color:red;font-size:12px;">列表大图的大小不超过100k</span>
                    </rt-section-row>
                    <rt-section-row ng-show="vm.bigImg.imageSrc">
                        <img ng-src="{{vm.bigImg.imageSrc}}" style="width: 245px;height: 160px; margin-left: 18.5%;" alt="列表大图">
                    </rt-section-row>
                    <rt-section-row ng-show="vm.bigImg.base64Content">
                        <img ng-src="{{vm.bigImg.base64Content}}" style="width: 245px;height: 160px; margin-left: 18.5%;"
                            alt="列表大图">
                    </rt-section-row>

                    <rt-section-row>
                        <rt-textarea rt-title="课程简介" rt-required="false" rt-col="10" rt-row="2" rt-disabled="vm.form.data.StateCode.Value == 1" ng-model="vm.form.data.description"></rt-textarea>
                    </rt-section-row>
                </rt-section>
                <rt-section rt-title="状态">
                    <rt-section-row>
                        <rt-picklist rt-title="状态" rt-col="4" ng-model="vm.form.data.StateCode" rt-disabled="true" rt-options="vm.picklist.StateCode"></rt-picklist>
                    </rt-section-row>
                </rt-section>
            </div>
            <!--课程章节-->
            <div class="tab-pane" id="A2">
                <div ng-if="vm.form.type === 'Edit'" rt-include rt-template="Module/CourseChapter/courseChapterListView.html" rt-controller="courseChapterListController"
                    rt-include-params='{"relatedAttr": "lgm_courseId"}'></div>
            </div>
        </div>
        <!-- div[.tab-content] -->
    </div>
</rt-form>
<!-- rt-form -->