<template>
  <div class="addwrapper">
    <div class="addhead">
      <div class="leftimg">
        <img class="img" :src="projectInfo.picUrl"/>
      </div>
      <div class="imgfor">
        <div class="forz">{{ projectInfo.name || "-" }}</div>
        <div class="fort">
          <div class="fort1">项目经理：{{ projectInfo.manager || "-" }}</div>
          <div class="fort2">
            起止时间：{{ projectInfo.beginTime || "-" }} 至
            {{ projectInfo.endTime || "-" }}
          </div>
        </div>
      </div>
      <div class="right">
        <!-- <img class="img1" src="../../assets/images/leveladd/ma.png" />
        <div class="line"></div>
        <img class="img2" src="../../assets/images/projectadd/ending.png" />
        <div class="pub">结束项目</div>
        <div class="line"></div>
        <img
          style="margin-right: 15px"
          class="img2"
          src="../../assets/images/leveladd/more.png"
        />
        <div class="more">
          <span style="color: #7096e3; cursor: pointer">更多</span>
          <div class="moreArrow"></div>
          <div class="moreItems">
            <div class="sammo">撤回</div>
            <div class="sammo">复制</div>
          </div>
        </div>
        <div class="line"></div> -->
        <router-link to="/templatelibrary"
        >
          <div style="display: flex">
            <img class="img2" src="../../assets/images/leveladd/back.png"/>
            <div class="return">返回</div>
          </div>
        </router-link
        >
      </div>
    </div>
    <div class="split"></div>
    <div class="bom clearfix">
      <a-tabs
        class="tab"
        v-model:activeKey="activeKey"
        size="large"
        :tabBarStyle="{ marginLeft: '10px' }"
      >
        <a-tab-pane key="1" tab="任务">
          <div class="taskBox" style="flex: 1">
            <div class="split"></div>
            <div class="onerow">
              <div class="taskmain">任务大纲</div>
              <!-- <button class="btn" @click="showFaceIn">批量面授报名</button> -->
              <router-link
                class="edit"
                :to="{ path: `/temTask`, query: { projectId: projectTemplateId } }"
              >
                <img
                  class="editimg"
                  src="../../assets/images/projectadd/edit1.png"
                />
                <span class="editext">编辑</span>
              </router-link>
            </div>
            <!-- <div class="taskSyllabus">
                <a-collapse v-model:activeKey="taskSyllabusActive" accordion>
                  <template #expandIcon="{ isActive }">
                    <img
                      class="editimg"
                      src="../../assets/images/projectadd/edit.png"
                    />
                    <span class="editext">编辑</span>
                  </router-link>
                </div> -->
            <div class="taskSyllabus">
              <a-collapse v-model:activeKey="taskSyllabusActive" accordion>
                <template #expandIcon="{ isActive }">
                  <img
                    :style="{
                      width: isActive ? 9.1 : 8.1,
                      height: isActive ? 8.1 : 9.1,
                      'margin-right': isActive ? '12px' : '13px',
                    }"
                    :src="
                      isActive
                        ? require('../../assets/images/projectadd/open.png')
                        : require('../../assets/images/projectadd/close.png')
                    "
                  />
                  <div></div>
                </template>
                <a-collapse-panel
                  v-for="(value, index) in taskSyllabus"
                  :key="index"
                  :header="value.text"
                >
                  <div
                    class="course"
                    v-for="(item, key) in value.children"
                    :key="key"
                  >
                    <!-- :style="{width:item.course==='在线'?'28px':
                            height:item.course==='在线'?'27px':}" -->
                    <div class="first">
                      <div class="icon">
                        <div
                          style="
                            width: 31px;
                            height: 28px;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                          "
                        >
                          <img
                            :src="
                              item.course === '在线'
                                ? require('../../assets/images/leveladd/zai.png')
                                : item.course === '面授'
                                ? require('../../assets/images/leveladd/mian.png')
                                : item.course === '案例'
                                ? require('../../assets/images/leveladd/an.png')
                                : item.course === '作业'
                                ? require('../../assets/images/leveladd/zuo.png')
                                : item.course === '考试'
                                ? require('../../assets/images/leveladd/kao.png')
                                : item.course === '直播'
                                ? require('../../assets/images/leveladd/zhi.png')
                                : item.course === '外链'
                                ? require('../../assets/images/leveladd/wai.png')
                                : item.course === '讨论'
                                ? require('../../assets/images/leveladd/tao.png')
                                : item.course === '活动'
                                ? require('../../assets/images/leveladd/huo.png')
                                : item.course === '测评'
                                ? require('../../assets/images/leveladd/ce.png')
                                : item.course === '评估'
                                ? require('../../assets/images/leveladd/diao.png')
                                : item.course === '投票'
                                ? require('../../assets/images/leveladd/tou.png')
                                : null
                            "
                          />
                        </div>
                      </div>
                      <div>
                        <div class="iconame">「{{ item.course }}」</div>
                        <div class="icontext" :title="item.name">
                          {{ item.name }}
                        </div>
                      </div>
                    </div>
                    <div class="type">
                      <div :class="item.classify ? 'typename1' : 'typename'">
                        <span v-if="item.classify">必修</span>
                        <span v-else>选修</span>
                      </div>
                    </div>
                    <div class="time">
                      <div class="timetext">开始时间</div>
                      <div class="timetext">
                        {{ item.beginTime ? item.beginTime : "-" }}
                      </div>
                    </div>
                    <div class="progress">
                      <div class="progresstext">
                        {{ item.complete }}/{{ item.total }}人
                      </div>
                      <div style="display: flex">
                        <a-progress
                          :showInfo="false"
                          :percent="item.percent"
                          strokeColor="#FFC067"
                          trailColor="rgba(253, 209, 98, 0.2)"
                        />
                        <span class="progresstext" style="margin-left: 10px"
                        >{{ item.percent }}%</span
                        >
                      </div>
                    </div>
                    <div class="operations">
                      <div
                        class="operation"
                        style="cursor: pointer"
                        :style="{
                          display: item.course === '面授' ? 'flex' : 'none',
                        }"
                        @click="showFS"
                      >
                        <!-- 学员 -->
                      </div>
                      <div
                        class="operation"
                        style="cursor: pointer"
                        @click="showAA"
                        :style="{
                          display:
                            item.course === '直播' || item.course === '活动'
                              ? 'flex'
                              : 'none',
                        }"
                      >
                        <!-- 考勤 -->
                      </div>
                      <div
                        class="operation"
                        style="cursor: pointer"
                        :style="{
                          display:
                            item.course === '直播' ||
                            item.course === '活动' ||
                            item.course === '面授'
                              ? 'flex'
                              : 'none',
                        }"
                      >
                        <!-- 二维码 -->
                      </div>
                      <div
                        class="operation"
                        style="cursor: pointer; margin-right: 35px"
                        @click="
                          item.course === '在线' ||
                          item.course === '案例' ||
                          item.course === '外链' ||
                          item.course === '讨论' ||
                          item.course === '直播' ||
                          item.course === '评估' ||
                          item.course === '投票' ||
                          item.course === '活动'
                            ? showTime(item.course, item.name)
                            : item.course === '考试' || item.course === '测评'
                            ? showTest(item.course, item.name)
                            : item.course === '面授'
                            ? showFace(item.course)
                            : item.course === '作业'
                            ? showWork(item.course)
                            : null
                        "
                      >
                        <!-- 管理 -->
                      </div>
                    </div>
                  </div>
                </a-collapse-panel>
              </a-collapse>
              <!-- 无数据创建任务 -->
              <div
                class="taskbox"
                style="
                  background: linear-gradient(180deg, #ddeaff, #f0f8fe);
                  display: none;
                "
              >
                <div class="leftt">
                  <img src="../../assets/images/taskpage/left2.png"/>
                </div>
                <div class="photo">
                  <img src="../../assets/images/taskpage/picture8.png"/>
                </div>
                <div class="rightt">
                  <img src="../../assets/images/taskpage/right2.png"/>
                </div>
                <div class="centerbox" style="color: rgba(78, 166, 255, 1)">
                  创建任务
                </div>
                <div class="centermain">点击创建项目任务</div>
              </div>
              <!-- 无数据创建任务 -->
            </div>
            <div style="display: flex; height: 20px"></div>
          </div>
        </a-tab-pane>
        <a-tab-pane key="2" tab="公告" force-render>
          <div class="split"></div>
          <a-tabs v-model:activeKey="activeKeyNotice">
            <a-tab-pane key="11" tab="公告">
              <div class="notice">
                <div class="ntc_body">
                  <div class="ntc_switch">
                    <a-switch
                      size="small"
                      v-model:checked="checked"
                      @click="changeopclo"
                    />
                    <div v-if="checked == true" class="opclo">
                      <span>关闭</span>
                    </div>
                    <div v-if="checked == false" class="opclo">
                      <span>开启</span>
                    </div>
                  </div>
                  <div v-if="checked == true" class="ntc_content">
                    <div class="ntcc_tit">当前公告内容：</div>
                    <div class="textarea">
                      {{ noticeContent == "" ? "暂无公告" : noticeContent }}
                      <div v-if="editFlag == false" class="btnarea">
                        <div>&nbsp;</div>
                        <div class="area_btn" @click="editNotice">
                          <div class="btnText">编辑</div>
                        </div>
                      </div>
                    </div>

                    <template v-if="editFlag == true">
                      <div>&nbsp;</div>
                      <div class="ntcc_tit">编辑公告：</div>
                      <div class="textarea">
                        <a-textarea
                          v-model:value="projectInfo.notice"
                          placeholder="公告信息最多输入150个字。"
                          :maxlength="textnum"
                          allow-clear
                        />
                        <div class="btnarea">
                          <div>&nbsp;</div>
                          <div class="area_btn" @click="addNotice">
                            <div class="pub"></div>
                            <div class="btnText">发布</div>
                          </div>
                        </div>
                      </div>
                    </template>
                  </div>
                </div>
              </div>
            </a-tab-pane>
          </a-tabs>
        </a-tab-pane>

        <a-tab-pane key="3" tab="项目积分">
          <div class="split"></div>
          <div class="projectscore">
            <div class="pjc_tit">
              <span>获取规则</span>
            </div>
            <hr color="#E8E8E8"/>
            <div class="pjc_body">
              <div class="groupright">
                <div class="spandiv"><span class="spantext">规则</span></div>
                <div v-if="edit" class="btns">
                  <div class="btn1" @click="edit = !edit">
                    <img src="../../assets/images/projectadd/edit1.png"/>
                    <span class="btn1text">编辑</span>
                  </div>
                </div>
                <div v-else class="btns">
                  <div class="btn1" @click="editRule">
                    <span class="btn1text">保存</span>
                  </div>
                </div>
              </div>

              <div v-if="edit" class="pjcb_content">
                <div class="content content1">
                  <span>当前设计下，学员可以获得 </span
                  ><span class="scoretext">{{ scoresum }}</span
                ><span>积分</span>
                </div>
                <div class="content content2">
                  <span>完成【必修/选修】获得 </span
                  ><span class="scoretext">{{ score1 }} </span><span>积分</span>
                </div>
                <div class="content">
                  <span>完成作业成绩不低于 </span
                  ><span class="scoretext">{{ done2 }}</span
                ><span>分获得</span> <span class="scoretext">{{ done3 }}</span
                ><span>积分</span>
                </div>
                <div class="content">
                  <span>前</span><span class="scoretext">{{ four1 }}</span
                ><span>名学完在线课程获得</span>
                  <span class="scoretext">{{ four2 }}</span
                  ><span style="margin-right: 50px">积分</span> <span>前</span
                ><span class="scoretext">{{ four3 }}</span
                ><span>名提交作业且成绩不低于</span>
                  <span class="scoretext">{{ four4 }}</span
                  ><span>分获得</span> <span class="scoretext">{{ four5 }}</span
                ><span>积分</span>
                </div>
                <div class="content">
                  <span>考试成绩高于</span
                  ><span class="scoretext">{{ five1 }}</span
                ><span>分获得</span> <span class="scoretext">{{ five2 }}</span
                ><span>积分</span>
                </div>
                <div class="content">
                  <span>考勤正常学员获得 </span
                  ><span class="scoretext">{{ six1 }}</span
                ><span>积分</span>
                </div>
                <div class="content">
                  <span>成为小组长获得</span
                  ><span class="scoretext">{{ seven1 }}</span
                ><span style="margin-right: 50px">积分</span>
                  <span>优秀学员可获得</span>
                  <span class="scoretext">{{ seven2 }}</span
                  ><span>积分</span>
                </div>
              </div>
              <div v-else class="pjcb_content">
                <div class="content content1">
                  <span>当前设计下，学员可以获得 </span
                  ><span class="scoretext">{{ scoresum }}</span
                ><span>积分</span>
                </div>
                <div class="content content2">
                  <span>完成【必修/选修】获得 </span
                  ><span
                ><a-input
                  v-model:value="score1"
                  :bordered="false"
                  @change="getScore"
                /> </span
                ><span>积分</span>
                </div>
                <div class="content">
                  <span>完成作业成绩不低于 </span
                  >
                  <a-input v-model:value="done2" :bordered="false"/>
                  <span
                  >分获得</span
                  >
                  <a-input v-model:value="done3" :bordered="false"/>
                  <span
                  >积分</span
                  >
                </div>
                <div class="content">
                  <span>前</span
                  >
                  <a-input v-model:value="four1" :bordered="false"/>
                  <span
                  >名学完在线课程获得</span
                  >
                  <a-input v-model:value="four2" :bordered="false"/>
                  <span
                    style="margin-right: 50px"
                  >积分</span
                  >
                  <span>前</span
                  >
                  <a-input v-model:value="four3" :bordered="false"/>
                  <span
                  >名提交作业且成绩不低于</span
                  >
                  <a-input v-model:value="four4" :bordered="false"/>
                  <span
                  >分获得</span
                  >
                  <a-input v-model:value="four5" :bordered="false"/>
                  <span
                  >积分</span
                  >
                </div>
                <div class="content">
                  <span>考试成绩高于</span
                  >
                  <a-input v-model:value="five1" :bordered="false"/>
                  <span
                  >分获得</span
                  >
                  <a-input v-model:value="five2" :bordered="false"/>
                  <span
                  >积分</span
                  >
                </div>
                <div class="content">
                  <span>考勤正常学员获得 </span
                  >
                  <a-input v-model:value="six1" :bordered="false"/>
                  <span
                  >积分</span
                  >
                </div>
                <div class="content">
                  <span>成为小组长获得</span
                  >
                  <a-input v-model:value="seven1" :bordered="false"/>
                  <span
                    style="margin-right: 50px"
                  >积分</span
                  >
                  <span>优秀学员可获得</span>
                  <a-input v-model:value="seven2" :bordered="false"/>
                  <span
                  >积分</span
                  >
                </div>
              </div>
            </div>
          </div>
        </a-tab-pane>


        <a-tab-pane key="4" tab="设置">
          <div class="split"></div>
          <a-tabs>
            <a-tab-pane key="1" tab="编辑">
              <div class="content7">
                <!-- <div class="set_tit">
              <span>基本信息</span>
            </div> -->

                <!-- <div class="line"></div> -->
                <div class="set_body">
                  <!-- <div class="edit" @click="showEditProj">
                <div class="img"></div>
                <div class="ed">编辑</div>
              </div> -->
                  <div class="edit" @click="toEdit">
                    <div class="img"></div>
                    <div class="ed">编辑</div>
                  </div>
                  <div class="set_content">
                    <div class="setc_name"><span>项目名称：</span></div>
                    <div class="setc_main">
                      <span style="color: #999999">{{ projectInfo.name }}</span>
                    </div>
                  </div>
                  <div class="set_content">
                    <div class="setc_name"><span>封面图：</span></div>
                    <div class="setc_main">
                      <img
                        style="width: 151px; height: 84px"
                        :src="projectInfo.picUrl"
                        alt=""
                      />
                    </div>
                  </div>
                  <div class="set_content">
                    <div class="setc_name"><span>项目时间：</span></div>
                    <div class="setc_main">
                      <span style="color: #999999"
                      >{{ projectInfo.beginTime }} ～
                        {{ projectInfo.endTime }}</span
                      >
                    </div>
                  </div>
                  <div class="set_content">
                    <div class="setc_name"><span>项目经理：</span></div>
                    <div class="setc_main">
                      <span style="color: #999999">{{
                          projectInfo.manager
                        }}</span>
                    </div>
                  </div>
                  <div class="set_content">
                    <div class="setc_name"><span>资源归属：</span></div>
                    <div class="setc_main">
                      <span style="color: #999999">{{
                          (projectInfo.sourceBelongFullName || '') + projectInfo.sourceBelongName
                        }}</span>
                    </div>
                  </div>
                  <div class="set_content">
                    <div class="setc_name"><span>项目级别：</span></div>
                    <div class="setc_main">
                      <ProjectLevel :value="projectInfo.level" :tag="true"></ProjectLevel>
                    </div>
                  </div>
                  <div class="set_content">
                    <div class="setc_name"><span>培训体系：</span></div>
                    <div class="setc_main">
                      <TrainClass :value="projectInfo.systemId" :tag="true"></TrainClass>
                    </div>
                  </div>
                  <div class="set_content">
                    <div class="setc_name"><span>同步学习记录：</span></div>
                    <div class="setc_main">
                      <a-radio v-model:checked="projectInfo.courseSyncFlag" :disabled="true"
                      ><span style="color: #333333"
                      >同步课程学习记录（如学员在课程库中拥有课程的学习记录，自动免修该课程）</span
                      ></a-radio
                      >
                    </div>
                  </div>
                  <div class="set_content">
                    <div class="setc_name"><span>是否BOEU实施：</span></div>
                    <div class="setc_main">
                      <a-radio v-model:checked="projectInfo.boeFlag" :disabled="true"
                      ><span style="color: #333333">BOEU实施</span></a-radio
                      >
                    </div>
                  </div>
                  <div class="set_content" v-if="projectInfo.remark ">
                    <div class="setc_name"><span>项目说明：</span></div>
                    <div class="setc_main">
                      <span style="color: #999999">{{
                          projectInfo.remark
                        }}</span>
                    </div>
                  </div>
                </div>
              </div>
            </a-tab-pane>

            <a-tab-pane key="13" tab="共享文档">
              <div class="sametab">
                <div class="Gcon">
                  <div class="pad"></div>
                  <div class="Gin">
                    <div class="headone">
                      <div class="box"></div>
                      <div class="onetitle">上传共享文档</div>
                      <div class="oneedi">
                        <a-switch
                          size="small"
                          v-model:checked="attachSwitch"
                          @change="checkedClose"
                        ></a-switch>
                      </div>
                    </div>
                    <div class="btnbox" style="margin: 20px">
                      <a-upload
                        v-if="attachSwitch == true"
                        v-model:file-list="fileList"
                        name="file"
                        :action="uploadAction"
                        @change="handleChange2"
                      >
                        <span
                          class="xkbtn"
                          style="cursor: pointer; font-size: 17px"
                        >上传</span
                        >
                        <img
                          src="@/assets/images/basicinfo/cloud.png"
                          style="cursor: pointer; width: 24px; height: 24px; margin-left: 8px;margin-bottom: 3px;"
                          alt=""
                        />
                      </a-upload>
                      <div
                        v-if="attachSwitch == true"
                        class="btnbox"
                        style="margin: 20px"
                      >
                        <span style="color: #999999">
                          支持：pdf.ppt.pptx.doc.docx.xls.xlsx.jpeg.png.gif.zip
                        </span>
                      </div>
                      <div
                        v-for="item in fileList"
                        :key="item.uid"
                        style="margin-bottom: 30px;"
                        class="docListStyle"
                      >
                        <!-- <img
                          src="@/assets/images/basicinfo/download.png"
                          style="
                            cursor: pointer;
                            width: 40px;
                            height: 40px;
                            margin-right: 40px;
                          "
                          alt=""
                        /> -->
                        <img v-if="
                              item.name.indexOf('jpg') !== -1 ||
                              item.name.indexOf('jpeg') !== -1 ||
                              item.name.indexOf('png') !== -1
                            "
                             style="width: 27px;height: 32px;margin-right: 40px;"
                             src="@/assets/images/coursewareManage/pngpic.png"/>
                        <div v-else>
                          <img v-if="item.name.indexOf('doc') !== -1"
                               style="width: 27px;height: 32px;margin-right: 40px;"
                               src="@/assets/images/coursewareManage/docpic.png"/>
                          <div v-else>
                            <img v-if="item.name.indexOf('xls') !== -1"
                                 style="width: 27px;height: 32px;margin-right: 40px;"
                                 src="@/assets/images/coursewareManage/xlspic.png"/>
                            <div v-else>
                              <img v-if="item.name.indexOf('ppt') !== -1"
                                   style="width: 27px;height: 32px;margin-right: 40px;"
                                   src="@/assets/images/coursewareManage/pptpic.png"/>
                              <div v-else>
                                <img v-if="item.name.indexOf('pdf') !== -1"
                                     style="width: 27px;height: 32px;margin-right: 40px;"
                                     src="@/assets/images/coursewareManage/pdfpic.png"/>
                                <div v-else>
                                  <img v-if="item.name.indexOf('zip') !== -1"
                                       style="width: 27px;height: 32px;margin-right: 40px;"
                                       src="@/assets/images/coursewareManage/zippic.png"/>
                                  <img v-else style="width: 27px;height: 32px;margin-right: 40px;"
                                       src="@/assets/images/coursewareManage/docpic.png"/>
                                </div>
                              </div>
                            </div>
                          </div>
                        </div>

                        <span
                          style="font: oblique bold 16px Sans-serif;width:300px;display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;">{{
                            item.name
                          }}</span>
                        <a
                          href="javascript:void(0);"
                          @click="downloadFile(item.response ? item.response.data : '')"
                          style="margin-left: 5px">下载</a>
                        <span
                          style="color: #4ea6ff; cursor: pointer"
                          @click="deFile(item.uid)"
                        >删除</span
                        >
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </a-tab-pane>


          </a-tabs>
        </a-tab-pane>
      </a-tabs>
      <a-modal
        style="padding: 0"
        :closable="sh"
        v-model:visible="visible"
        :footer="null"
        centered="true"
      >
        <div class="con">
          <div class="header">
            <div class="inhe">
              <div class="mod"></div>
              <div class="tz">调整关卡</div>
              <div class="mg"></div>
            </div>
          </div>
          <div class="mid">
            <div class="inher">
              <div class="cur">当前关卡：</div>
              <div class="select">
                <a-select
                  v-model:value="projectName"
                  style="width: 100%"
                  placeholder="请选择关卡"
                  :options="projectNameList4"
                  @change="selectProjectName4"
                  allowClear
                ></a-select>
              </div>
              <div class="btn">
                <button class="sameb btn1">取消</button>
                <button class="sameb btn2">确定</button>
              </div>
            </div>
          </div>
        </div>
      </a-modal
      >
    </div>
  </div>
</template>

<script>
import {
  ref,
  reactive,
  defineComponent,
  toRefs,
  onMounted,
  computed,
} from "vue";
import {message} from "ant-design-vue";
import * as api from "@/api/indexTemplate";
import {useRoute, useRouter} from "vue-router";
import {scoreRule, setScoreRule} from "@/api/indexTaskadd";
import ProjectLevel from "@/components/project/ProjectLevel";
import TrainClass from "@/components/project/TrainClass";

export default defineComponent({
  name: "LibraryAdd",
  components: {
    ProjectLevel,
    TrainClass,
  },
  setup() {
    const state = reactive({
      templateInfo:{},
      //任务大纲列表
      taskSyllabus: [
        // {
        //   text: "阶段1腾飞班阶段1",
        //   children: [
        //     {
        //       course: "在线",
        //       name: "时间管理",
        //       classify: "选修",
        //       beginTime: "2022-09-10 14:03",
        //       total: 50, //总人数
        //       complete: 20, //完成人数
        //       percent: 40,
        //     },
        //     {
        //       course: "直播",
        //       name: "管理直播间",
        //       classify: "必修",
        //       beginTime: "2022-09-12 14:03",
        //       total: 50, //总人数
        //       complete: 10, //完成人数
        //       percent: 20,
        //     },
        //     {
        //       course: "面授",
        //       name: "管理面授课",
        //       classify: "必修",
        //       beginTime: "2022-09-16 14:03",
        //       total: 80, //总人数
        //       complete: 0, //完成人数
        //       percent: 0,
        //     },
        //     {
        //       course: "活动",
        //       name: "管理活动",
        //       classify: "必修",
        //       beginTime: "2022-09-16 14:03",
        //       total: 50, //总人数
        //       complete: 40, //完成人数
        //       percent: 80,
        //     },
        //     {
        //       course: "作业",
        //       name: "管理者作业",
        //       classify: "选修",
        //       beginTime: "2022-09-16 14:03",
        //       total: 50, //总人数
        //       complete: 30, //完成人数
        //       percent: 60,
        //     },
        //     {
        //       course: "考试",
        //       name: "管理者考试",
        //       classify: "必修",
        //       beginTime: "2022-09-16 14:03",
        //       total: 50, //总人数
        //       complete: 50, //完成人数
        //       percent: 100,
        //     },
        //     {
        //       course: "案例",
        //       name: "管理直播间",
        //       classify: "必修",
        //       beginTime: "2022-09-16 14:03",
        //       total: 50, //总人数
        //       complete: 10, //完成人数
        //       percent: 20,
        //     },
        //     {
        //       course: "外链",
        //       name: "管理直播间",
        //       classify: "必修",
        //       beginTime: "2022-09-16 14:03",
        //       total: 50, //总人数
        //       complete: 10, //完成人数
        //       percent: 20,
        //     },
        //   ],
        // },
      ],
      // 模板编辑列表
      managerOptions: [
        {value: "李俊国"},
        {value: "将小米"},
        {value: "刘孟君"},
      ],
      sourceBelongOptions: [
        {value: "项目一"},
        {value: "项目二"},
        {value: "项目三"},
      ],
      levelOptions: [
        {value: "集团级"},
        {value: "组织级"},
        {value: "现地级"},
        {value: "部门级"},
      ],
      systemOptions: [
        {value: "集团级"},
        {value: "组织级"},
        {value: "现地级"},
        {value: "部门级"},
      ],
      taskSyllabusActive: 0,
      //在线管理等页面传递参数
      showTimeText: "",
      //考试、测评页面传递参数
      showTestText: "",
      activeKey: ref("1"),
      // value: ref(" "),
      checked: true,
      checked2: false,
      checked3: false,
      docChecked: true,
      value3: false,
      value4: false,
      hideshow: true,
      score1: null,
      done2: null,
      done3: null,
      four1: null,
      four2: null,
      four3: null,
      four4: null,
      four5: null,
      five1: null,
      five2: null,
      six1: null,
      seven1: null,
      seven2: null,
      edit: true,
      fileList: [],
      attachSwitch: true,
      // 共享文档列表
      docList: [
        {
          name: "测试文档1.doc",
          src: "",
        },
        {
          name: "测试文档2.doc",
          src: "",
        },
        {
          name: "测试文档3.doc",
          src: "",
        },
      ],
      isEdit: false, // 是否处于编辑状态
      // 基本信息
      projectInfo: {},
      noticeContent: "",
      editFlag: false,
      uploadAction: process.env.VUE_APP_BASE_API + '/file/uploadunlimit'
    });
    const value = ref("");
    const textnum = "150";
    const routered = useRouter();
    const {query: {projectTemplateId}} = useRoute();
    const changeopclo = () => {
      state.projectInfo.noticeFlag = state.checked ? 1 : 0;
      api
        .templateEdit(state.projectInfo)
        .then((res) => {
          console.log(res);
        })
        .catch((err) => {
          console.log(err);
        });
    };

    const changecheck2 = () => {
      state.checked2 = !state.checked2;
    };
    const scoresum = computed(() => {
      // console.log(Object.prototype.toString.call(Number(state.score1)));
      // if (Object.prototype.toString.call(state.score1) !== "[object Number]") {
      //   message.destroy();
      //   return message.warning("请输入合法数字");
      // }
      return (
        Number(state.score1) +
        Number(state.done3) +
        Number(state.four2) +
        Number(state.four5) +
        Number(state.five2) +
        Number(state.six1) +
        Number(state.seven1) +
        Number(state.seven2)
      );
    });
    const changecheck3 = () => {
      state.checked3 = !state.checked3;
    };
    const cancelEdit = () => {
      state.isEdit = false;
      getDetail();
    };
    const confirmEdit = () => {
      state.isEdit = false;
      getDetail();
    };
    const editNotice = () => {
      state.editFlag = true;
    };

    const checkType = (type) => {
      let typeRules = [
        "",
        "在线",
        "面授",
        "案例",
        "作业",
        "考试",
        "直播",
        "外链",
        "讨论",
        "活动",
        "测评",
        "评估",
        "投票",
      ];
      return typeRules[type];
    };
    onMounted(() => {
      getDetail();
      getScoreRule();
    });
    // 获取详情
    const getDetail = () => {
      api.templateEditDetail(projectTemplateId).then((res) => {
        state.templateInfo = res.data.data
        state.taskSyllabus = [];
        state.projectInfo = res.data.data.projectTemplateInfo;
        state.noticeContent = state.projectInfo.notice;
        state.checked = state.projectInfo.noticeFlag == 1;
        console.log(
          "res.data.data.projectTemplateInfo",
          res.data.data.projectTemplateInfo
        );
        try {
          state.fileList = JSON.parse(
            res.data.data.projectTemplateInfo.attach
          );
        } catch {
          state.fileList = [];
        }
        state.attachSwitch = res.data.data.projectTemplateInfo.attachSwitch == 1;
        let data = res.data.data.stageList;
        console.log("data=====", data);
        for (let i in data) {
          console.log("what ------ > ", i, data);
          // if (data[i].taskTemplateList.length !== 0) {
          if (!data[i].name) {
            continue;
          }
          state.taskSyllabus.push({
            text: data[i].name ? data[i].name : "无阶段任务",
            children: [],
          });
          //  }

          for (let j in data[i].taskTemplateList) {
            state.taskSyllabus[i].children.push({
              course: checkType(data[i].taskTemplateList[j].type),
              name: data[i].taskTemplateList[j].name,
              classify: data[i].taskTemplateList[j].flag,
              beginTime: "",
              total: 0, //总人数
              complete: 0, //完成人数
              percent: 0,
            });
          }
        }
      })
    };

    // 发布公告
    const addNotice = () => {
      // state.projectInfo.notice=
      if (!state.projectInfo.notice) {
        return message.warning("请输入公告内容");
      }
      api
        .templateEdit(state.projectInfo)
        .then((res) => {
          state.noticeContent = state.projectInfo.notice;
          message.success("公告发布成功");
          console.log(res);
        })
        .catch((err) => {
          message.error("公告发布失败" + err);
          console.log(err);
        });
      state.editFlag = false;
    };

    // 删除阶段
    const stateDel = (id) => {
      api
        .deleteStage(id)
        .then((res) => {
          message.success("删除阶段成功");
          console.log(res);
        })
        .catch((err) => {
          message.error("删除阶段失败" + err);
          console.log(err);
        });
    };

    // 删除任务
    const taskDel = (id) => {
      api
        .deleteTask(id)
        .then((res) => {
          message.success("删除任务成功");
          console.log(res);
        })
        .catch((err) => {
          message.error("删除任务失败" + err);
          console.log(err);
        });
    };
    const toEdit = () => {
      routered.push({
        path: "/templateAdd",
        query: {
          projectTemplateId: projectTemplateId,
        },
      });
    };

    // 新建或编辑阶段
    const stateEdit = () => {
      let obj = {
        name: "",
        projectTemplateId: localStorage.getItem("projectTemplateId"),
        remark: "",
        stageId: 0,
      };
      api
        .editStagek(obj)
        .then((res) => {
          message.success("编辑阶段成功");
          console.log(res);
        })
        .catch((err) => {
          message.error("编辑阶段失败" + err);
          console.log(err);
        });
    };
    //新建或编辑阶段任务
    const taskEdit = () => {
      let obj = {
        courseId: 0,
        duration: 0,
        flag: true,
        name: "",
        projectTaskId: 0,
        projectTemplateId: localStorage.getItem("projectTemplateId"),
        stageId: 0,
        type: 0
      };
      api
        .editTask(obj)
        .then((res) => {
          message.success("编辑任务成功");
          console.log(res);
        })
        .catch((err) => {
          message.error("编辑任务失败" + err);
          console.log(err);
        });
    };
    const getScoreRule = () => {
      scoreRule({
        projectId: projectTemplateId,
      })
        .then((res) => {
          let result = res.data.data;
          //Write operation failed: computed value is readonly 总积分

          state.scoresum = Number(result[0].pointsCount) + Number(result[1].pointsCount) + Number(result[2].pointsCount) + Number(result[3].pointsCount) + Number(result[4].pointsCount) + Number(result[5].pointsCount) + Number(result[6].pointsCount) + Number(result[7].pointsCount)

          state.score1 = result[0].pointsCount;

          state.done2 = result[1].typeDescConfig;
          state.done3 = result[1].pointsCount;

          state.four1 = result[2].typeDescConfig;
          state.four2 = result[2].pointsCount;

          state.four3 = result[3].typeDescConfig.slice(0,result[3].typeDescConfig.indexOf(';'));
          state.four4 = result[3].typeDescConfig.slice(result[3].typeDescConfig.indexOf(';')+1);
          state.four5 = result[3].pointsCount;

          state.five1 = result[4].typeDescConfig;
          state.five2 = result[4].pointsCount;

          state.six1 = result[5].pointsCount;

          state.seven1 = result[6].pointsCount;

          state.seven2 = result[7].pointsCount;

        })
        .catch((err) => {
          console.log("获取项目积分规则失败了", err);
        });
    };
    const handleChange2 = ({file, fileList}) => {
      console.log(fileList);
      let list = [];
      if (file.status !== "uploading") {
        console.log("上传的list", fileList);
        console.log(file);
        list = state.fileList;
        console.log("list", list);
        let str = JSON.stringify(fileList);
        console.log("str", str);
        console.table({
          name: state.projectInfo.name,
          category: state.projectInfo.category,
          picUrl: state.projectInfo.picUrl,
          manager: state.projectInfo.manager,
          managerId: state.projectInfo.managerId || 0,
          sourceBelongId: state.projectInfo.sourceBelongId,
          level: state.projectInfo.level,
          systemId: state.projectInfo.systemId,
          boeFlag: state.projectInfo.boeFlag ? 1 : 0,
          courseSyncFlag: state.projectInfo.courseSyncFlag ? 1 : 0,
          notice: state.projectInfo.notice,
          noticeFlag: state.projectInfo.noticeFlag,
          projectTemplateId: localStorage.getItem("projectTemplateId"),
          remark: state.projectInfo.remark,
          status: state.projectInfo.status,
          attach: str,
        });
        //要编辑项目
        api
          .templateEdit({
            name: state.projectInfo.name,
            category: state.projectInfo.category,
            picUrl: state.projectInfo.picUrl,
            manager: state.projectInfo.manager,
            managerId: state.projectInfo.managerId || 0,
            sourceBelongId: state.projectInfo.sourceBelongId,
            level: state.projectInfo.level,
            systemId: state.projectInfo.systemId,
            boeFlag: state.projectInfo.boeFlag ? 1 : 0,
            courseSyncFlag: state.projectInfo.courseSyncFlag ? 1 : 0,
            notice: state.projectInfo.notice,
            noticeFlag: state.projectInfo.noticeFlag,
            projectTemplateId: localStorage.getItem("projectTemplateId"),
            remark: state.projectInfo.remark,
            status: state.projectInfo.status,
            attach: str,
          })
          .then((res) => {
            console.log("上传成功", res);
          })
          .catch((err) => {
            console.log("上传失败了", err);
          });
      }

      if (file.status === "done") {
        message.success(`${file.name} 文件上传成功`);
      } else if (file.status === "error") {
        message.error(`${file.name} 文件上传失败.`);
      }
    };

    // 删除图片按钮
    const deFile = (id) => {
      console.log(id);
      let index = state.fileList.findIndex((item) => {
        item.uid == id;
      });
      state.fileList.splice(index, 1);
      let str = JSON.stringify(state.fileList);

      api
        .templateEdit({
          sourceBelongId: state.projectInfo.sourceBelongId,
          projectTemplateId: localStorage.getItem("projectTemplateId"),
          attach: str,
        })
        .then((res) => {
          console.log(res)
          message.destroy();
          message.success("删除成功");
          return
        })
        .catch((err) => {
          console.log(err)
          message.destroy();
          message.warning("删除失败");
          return
        });
    };

    // 设置上传图片开关
    const checkedClose = (data, a) => {
      console.log(data, a);
      console.log("模板id：" + projectTemplateId);
      console.log("开关数据：" + JSON.stringify(data) + "====" + JSON.stringify(a))
      state.attachSwitch = data;

      // 更新开关状态
      api
        .templateEdit({
          sourceBelongId: state.projectInfo.sourceBelongId,
          projectTemplateId: projectTemplateId,
          attachSwitch: state.attachSwitch ? 1 : -1,
        })
        .then((res) => {
          console.log("开关更新成功", res);
        })
        .catch((err) => {
          console.log("开关更新失败", err);
        });
    };

    //设置积分规则
    const editRule = () => {
      let obj = {
        projectId: projectTemplateId,
        datas:[
          {
            "type": 1,
            "pointsCount": Number(state.score1),
            "typeDesc": "完成【必修/选修】获得%p积分",
            "typeDescConfig": ""
          },
          {
            "type": 2,
            "pointsCount": Number(state.done3),
            "typeDesc": "完成作业成绩不低于%d分获得%p积分",
            "typeDescConfig": state.done2
          },
          {
            "type": 3,
            "pointsCount": Number(state.four2),
            "typeDesc": "前%d名学完在线课程获得%p积分",
            "typeDescConfig": state.four1
          },
          {
            "type": 4,
            "pointsCount": Number(state.four5),
            "typeDesc": "前%d名提交作业且成绩不低于%d分获得%p积分",
            "typeDescConfig":  state.four3 + ';' + state.four4
          },
          {
            "type": 5,
            "pointsCount": Number(state.five2),
            "typeDesc": "考试成绩高于%d分获得%p积分",
            "typeDescConfig": state.five1
          },
          {
            "type": 6,
            "pointsCount": Number(state.six1),
            "typeDesc": "考勤正常学员获得%p积分",
            "typeDescConfig": ""
          },
          {
            "type": 7,
            "pointsCount": Number(state.seven1),
            "typeDesc": "成为小组长获得%p积分",
            "typeDescConfig": ""
          },
          {
            "type": 8,
            "pointsCount": Number(state.seven2),
            "typeDesc": "优秀学员可获得%p积分",
            "typeDescConfig": ""
          }
        ]
      };
      console.log(obj);
      setScoreRule(obj)
        .then((res) => {
          console.log(res.data, "修改成功");
          message.destroy();
          return message.success("修改积分规则成功");
        })
        .catch((err) => {
          console.log(err.data);
          message.destroy();
          return message.warning("修改积分规则失败");
        });
      // scoreRule({
      //   projectId: props.projectId,
      // });

      state.edit = true;
    };

    // 共享文档文件下载
    const downloadFile = (url) => {
      console.log(url)
      window.open(
        window.location.protocol +
          process.env.VUE_APP_BOE_API_URL +
          process.env.VUE_APP_FILE_PATH +
          url
      );
      // if(url){
      //   const filename = '操作指南'
      //   const x = new XMLHttpRequest()
      //   x.open('GET', url, true)
      //   x.responseType = 'blob'
      //   x.onload = () => {
      //     // 会创建一个 DOMString，其中包含一个表示参数中给出的对象的URL。这个 URL 的生命周期和创建它的窗口中的 document 绑定。这个新的URL 对象表示指定的 File 对象或 Blob 对象。
      //     const url = window.URL.createObjectURL(x.response)
      //     const a = document.createElement('a')
      //     a.href = url
      //     a.download = filename
      //     a.click()
      //   }
      //   x.send()
      // }
    }

    return {
      ...toRefs(state),
      value,
      projectTemplateId,
      textnum,
      changeopclo,
      changecheck2,
      changecheck3,
      cancelEdit,
      confirmEdit,
      addNotice,
      stateDel,
      taskDel,
      stateEdit,
      taskEdit,
      toEdit,
      getScoreRule,
      editRule,
      handleChange2,
      scoresum,
      checkedClose,
      editNotice,
      deFile,
      downloadFile
    };
  },
});
</script>
<style lang="scss">
.content7 {
  margin-top: 20px;

  .set_tit {
    margin-left: 34px;
    font-size: 18px;
    font-weight: 500;
    color: #232425;
  }

  .line {
    width: 100%;
    height: 1px;
    background-color: #e8e8e8;
    margin-top: 10px;
  }

  .set_body {
    margin-left: 34px;
    margin-right: 34px;
    position: relative;

    .edit {
      position: absolute;
      width: 100px;
      height: 40px;
      background: #4ea6ff;
      border-radius: 8px;
      display: flex;
      align-items: center;
      justify-content: center;
      right: 0;
      cursor: pointer;

      .img {
        width: 18px;
        height: 18px;
        background-image: url(../../assets/images/basicinfo/edit.png);
        background-size: 100%;
        margin-right: 7px;
      }

      .ed {
        font-size: 14px;
        font-weight: 400;
        color: #ffffff;
      }
    }

    .set_content {
      margin: 32px auto;
      display: flex;

      // justify-content: end;
      .setc_name {
        width: 150px;
        display: flex;
        justify-content: end;
      }

      .setc_main {
        flex: 1;
        margin-left: 12px;
      }
    }
  }
}

.sametab {
  // margin-left: 30px;
  // margin-right: 30px;
  margin-top: 30px;
  width: 100%;
  // background-color: green;
  .Gcon {
    display: flex;

    .pad {
      height: 100%;
      width: 40px;
    }

    .Gin {
      // background-color: #bfa;
      margin-top: 30px;

      .headone {
        // background-color: red;
        display: flex;
        text-align: center;

        .box {
          width: 4px;
          height: 20px;
          background-color: #4ea6ff;
          border-radius: 2px;
        }

        .onetitle {
          margin-left: 15px;
          color: #333333;
          font-size: 14px;
        }

        .oneedi {
          margin-left: 15px;
          color: #4ea6ff;
          cursor: pointer;
        }

        .twobtn {
          display: flex;

          .btnone {
            width: 42px;
            height: 24px;
            border: 1px solid rgba(64, 158, 255, 1);
            border-radius: 4px;
            color: rgba(64, 158, 255, 1);
            margin-left: 20px;
            cursor: pointer;
          }

          .btntwo {
            width: 42px;
            height: 24px;
            border: 1px solid rgba(64, 158, 255, 1);
            border-radius: 4px;
            color: #ffffff;
            margin-left: 20px;
            background: #4ea6ff;
            cursor: pointer;
          }
        }
      }

      .btnbox {
        .ant-upload-list {
          display: none !important;
        }
      }

      .onemain {
        margin-top: 20px;
        margin-left: 55px;
        color: #6f6f6f;
        font-size: 14px;

        .checkcon {
          position: relative;

          .in {
            position: absolute;
            // margin-top: 10px;
            left: 0;
            top: 3px;
          }

          .yulan {
            // color: yellow;
            margin-left: 22px;
            // display: inline-block;
          }

          .yulan2 {
            margin-left: 22px;
          }

          .ant-input-number {
            height: 24px;
            width: 24px;
            margin: 10px;
            border-radius: 4px;
            border: 1px solid #6d7584;

            .ant-input-number-input {
              width: 100%;
              height: 100%;
              font-size: 14px;
              padding: 0;
              color: #4ea6ff;
              text-align: center;
            }
          }
        }
      }

      .twomain {
        margin-left: 20px;
        margin-top: 20px;

        .ant-switch-checked {
          background-color: #5dc988;
        }

        .info {
          margin-left: 10px;
          color: #6f6f6f;
          font-size: 14px;
          // margin-top: 10px;
        }

        .infor {
          margin-left: 38px;
          margin-top: 10px;
          color: #c7cbd2;
          font-size: 14px;
        }

        .chooseshow {
          // background-color: red;
          margin-left: 38px;
          margin-top: 12px;

          .fane {
            color: #6f6f6f;
            font-size: 14px;
          }
        }

        .choo {
          display: none;
        }

        .btm {
          margin-left: 38px;
          margin-top: 20px;

          .bmo {
            color: #6f6f6f;
            font-size: 14px;
          }

          .bmt {
            color: #c7cbd2;
            font-size: 14px;
            margin-top: 3px;
          }

          .chosecon {
            display: flex;
            margin-top: 6px;
            margin-bottom: 20px;

            .chose {
              position: relative;

              .inl {
                position: absolute;
                top: 2px;
              }

              .sh {
                margin-left: 23px;
                color: #6f6f6f;
              }
            }
          }
        }
      }
    }
  }

  .Lhead {
    display: flex;

    .btns {
      display: flex;
      margin-left: 20px;
      // flex-wrap: wrap;
      .btn {
        padding: 0px 26px 0px 26px;
        height: 38px;
        background: rgba(64, 158, 255, 0);
        border-radius: 8px;
        border: 1px solid rgba(64, 158, 255, 1);
        display: flex;
        align-items: center;
        justify-content: center;
        margin-right: 14px;
        flex-shrink: 0;
        cursor: pointer;

        .search {
          background-size: 100%;
        }

        .btnText {
          font-size: 14px;
          font-weight: 400;
          color: rgba(64, 158, 255, 1);
          line-height: 36px;
          margin-left: 5px;
        }
      }

      .btn1 {
        .search {
          width: 15px;
          height: 17px;
          background-image: url("../../assets/images/courseManage/search1.png");
        }
      }

      .btn2 {
        .search {
          width: 16px;
          height: 18px;
          background-image: url("../../assets/images/courseManage/reset1.png");
        }
      }

      .btn3 {
        margin-right: 0px;

        .search {
          width: 17px;
          height: 18px;
          background-image: url("../../assets/images/courseManage/add1.png");
        }
      }

      .btn1:hover {
        background: rgba(64, 158, 255, 1);

        .search {
          background-image: url("../../assets/images/courseManage/search0.png");
        }

        .btnText {
          color: #ffffff;
        }
      }

      .btn2:hover {
        background: rgba(64, 158, 255, 1);

        .search {
          background-image: url("../../assets/images/courseManage/reset0.png");
        }

        .btnText {
          color: #ffffff;
        }
      }

      .btn3:hover {
        background: rgba(64, 158, 255, 1);

        .search {
          background-image: url("../../assets/images/courseManage/add0.png");
        }

        .btnText {
          color: #ffffff;
        }
      }
    }
  }

  .Lbom {
    position: relative;
    margin-bottom: 20px;

    .item {
      width: 100%;
      height: 200px;
      // background-color: green;
      margin-top: 40px;
      border-radius: 8px;
      border: 1px solid #f0f4fe;

      .itemhead {
        height: 50px;
        width: 100%;
        background-color: #f0f4fe;
        display: flex;
        align-items: center;
        position: relative;

        .lev {
          margin-left: 27px;
          margin-right: 16px;
          line-height: 100%;
          color: #4ea6ff;
          font-size: 16px;
        }

        .lin {
          width: 1px;
          height: 35%;
          background-color: #c7cbd2;
        }

        .nam {
          margin-left: 16px;
          color: #4f5156;
          line-height: 100%;
          font-size: 16px;
        }

        .count {
          position: absolute;
          line-height: 100%;
          color: #4f5156;
          font-size: 14px;
          right: 40px;

          span:nth-child(2) {
            color: #63ca8c;
          }
        }
      }

      .itembomm {
        display: flex;
        align-items: center;
        height: 150px;

        .it {
          // margin-left: 110px;
          // margin-right: 110px;
          width: 13%;
          text-align: center;

          .on {
            font-size: 30px;
          }

          .ittext {
            color: #4f5156;
            margin-top: 16px;
            margin-left: -5px;
          }
        }

        .linee {
          background-color: #ecf2fb;
          width: 1px;
          height: 55%;
        }

        .itright {
          position: absolute;
          right: 45px;
          display: flex;

          .te {
            color: #4ea6ff;
            font-size: 14px;
            cursor: pointer;
          }

          .more {
            position: relative;
            height: 30px;
            display: flex;

            .moreArrow {
              width: 13px;
              height: 7px;
              display: inline-block;
              background-image: url("../../assets/images/navtop/down.png");
              background-size: 100%;
              margin: 2px;
              margin-left: 7px;
              margin-top: 6px;
            }

            .moreItems {
              width: 80px;
              height: 70px;
              display: none;
              background: #ffffff;
              box-shadow: 2px 3px 9px 3px rgba(0, 0, 0, 0.05);
              border-radius: 3px;
              border: 0px solid #dcdcdc;
              position: absolute;
              left: 0px;
              top: 20px;
              z-index: 100;

              .roleItem {
                font-size: 14px;
                font-weight: 400;
                color: rgba(79, 81, 86, 1);
                line-height: 36px;
                display: flex;
                justify-content: center;
                cursor: pointer;
              }

              .roleItem:hover {
                color: #4ea6ff;
              }
            }
          }

          .more:hover .moreArrow {
            background-image: url("../../assets/images/navtop/up.png");
          }

          .more:hover .moreItems {
            display: block;
          }
        }
      }

      .show {
        color: blue;
      }

      .noshow {
        display: none;
      }
    }

    .create {
      margin-top: 40px;

      .taskbox {
        width: 412px;
        height: 160px;
        border-radius: 10px;
        position: relative;
        // margin-left: 68px;
        margin-bottom: 40px;
        cursor: pointer;

        .leftt {
          position: absolute;
          top: 18px;
          left: 0;
        }

        .photo {
          position: absolute;
          top: 42px;
          left: 37px;
        }

        .rightt {
          position: absolute;
          top: 69px;
          right: 26px;
        }

        .centerbox {
          position: absolute;
          top: 52px;
          left: 145px;
          font-size: 20px;
          font-weight: 700;
          //line-height: 36px;
        }

        .centermain {
          color: rgba(135, 139, 146, 1);
          font-size: 14px;
          position: absolute;
          left: 144px;
          bottom: 49px;
        }
      }
    }
  }
}

.editBtn {
  float: right;
  margin-right: 150px;
  color: #4ea6ff;
  cursor: pointer;
}

.clearfix:before,
.clearfix:after {
  content: " ";
  display: block;
  clear: both;
}

.addwrapper {
  width: 100%;
  height: 100%;
  // background-color: green;
  .addhead {
    width: 100%;
    height: 130px;
    // background-color: lightgreen;
    display: flex;
    align-items: center;
    position: relative;

    .leftimg {
      width: 151px;
      height: 100px;
      border: 10px solid #e7f2ff;
      border-radius: 8px;
      margin-left: 20px;

      .img {
        width: 100%;
        height: 100%;
      }
    }

    .imgfor {
      margin-left: 32px;
      color: #333333;

      .forz {
        font-size: 16px;
        font-weight: 500;
      }

      .fort {
        font-weight: 400;
        font-size: 14px;
        margin-top: 20px;
      }
    }

    @media screen and (max-width: 1030px) {
      .imgfor {
        margin-left: 20px;
      }
    }

    .right {
      // width: 500px;
      height: 100%;
      // background-color: red;
      position: absolute;
      right: 0;
      display: flex;
      align-items: center;

      .img1 {
        width: 24px;
        height: 24px;
        margin-right: 50px;
      }

      .line {
        height: 65%;
        width: 1px;
        background-color: #e8effa;
        margin-right: 28px;
      }

      .img2 {
        width: 42px;
        height: 42px;
        margin-right: 22px;
      }

      .pub {
        // color: #ffb64e;
        color: #65a4f8;
        font-size: 14px;
        margin-top: 5px;
        margin-right: 30px;
        cursor: pointer;
      }

      .return {
        color: #4ea6ff;
        font-size: 14px;
        margin-top: 10px;
        margin-right: 60px;
      }

      .more {
        color: #7895dd;
        position: relative;
        margin-right: 30px;
        height: 30px;
        display: flex;
        align-items: center;

        .moreArrow {
          width: 13px;
          height: 7px;
          display: inline-block;
          background-image: url("../../assets/images/navtop/down.png");
          background-size: 100%;
          margin: 2px;
          margin-left: 15px;
        }

        .moreItems {
          width: 110px;
          height: 80px;
          display: none;
          background: #ffffff;
          box-shadow: 2px 3px 9px 3px rgba(0, 0, 0, 0.05);
          // border-radius: 3px;
          border: 0px solid #dcdcdc;
          position: absolute;
          left: -48px;
          top: 30px;
          z-index: 100;
          cursor: pointer;

          .sammo {
            text-align: center;
            margin-top: 12px;
            cursor: pointer;
          }

          .sammo:hover {
            color: #4ea6ff;
          }
        }

        .moreItems:hover {
          display: block;
        }
      }

      @media screen and (max-width: 1240px) {
        .line {
          margin-right: 10px;
        }
        .img1 {
          margin-right: 15px;
        }
        .img2 {
          margin-right: 10px;
        }
        .return {
          margin-right: 10px;
        }
        .pub {
          margin-right: 10px;
        }
        .more {
          margin-right: 10px;
        }
      }

      .more:hover .moreArrow {
        background-image: url("../../assets/images/navtop/up.png");
      }

      .more:hover .moreItems {
        display: block;
      }
    }
  }

  .bom {
    .ant-tabs-top > .ant-tabs-nav::before,
    .ant-tabs-bottom > .ant-tabs-nav::before,
    .ant-tabs-top > div > .ant-tabs-nav::before,
    .ant-tabs-bottom > div > .ant-tabs-nav::before {
      border-bottom: 0px;
    }

    .ant-tabs-nav-wrap {
      margin-left: 30px;
      margin-top: 10px;
    }

    .split {
      width: 100%;
      height: 20px;
      background-color: #edf0f5;
    }

    .docListStyle {
      display: flex;
      width: 500px !important;
      align-items: center;
      justify-content: space-between;
    }

    .taskBox {
      .onerow {
        //width: 100%;
        display: flex;
        height: 40px;
        position: relative;
        margin-top: 15px;
        margin-left: 38px;
        //margin-right: 38px;
        .taskmain {
          font-size: 18px;
          padding-top: 7px;
          color: #000000;
        }

        .btn {
          position: absolute;
          top: 0;
          right: 168px;
          background-color: #4ea6ff;
          width: 130px;
          height: 40px;
          border-radius: 8px;
          border: 1px solid #4ea6ff;
          color: #ffffff;
          cursor: pointer;
        }

        .edit {
          position: absolute;
          right: 38px;
          top: 0;
          color: #fff;
          width: 100px;
          height: 40px;
          border: 1px solid #4ea6ff;
          background: #4ea6ff;
          border-radius: 8px;

          .editimg {
            width: 15px;
            height: 15px;
            margin-top: -2px;
            margin-left: 25px;
            margin-right: 5px;
          }

          .editext {
            line-height: 40px;
          }
        }

        // .edit:hover {
        //   color: #ffffff;
        //   background-color: #4ea6ff;
        //   cursor: pointer;

        //   .editimg {
        //     background-image: url("../../assets/images/projectadd/edit1.png");
        //   }
        // }
      }

      .taskSyllabus {
        // flex: 1;
        overflow-x: auto;

        .ant-collapse {
          border: 0px;
          background-color: rgba(255, 255, 255, 0);
          min-width: 1040px;
        }

        .ant-collapse-content > .ant-collapse-content-box {
          padding-top: 0px;
          padding-bottom: 0px;
        }

        .ant-collapse > .ant-collapse-item {
          border: 0px;
        }

        .ant-collapse-header {
          display: flex;
          height: 49px;
          background-color: #eff4fc;
          align-items: center;
          margin-top: 20px;
          margin-left: 38px;
          margin-right: 40px;
          font-size: 16px;
          font-weight: 400;
          color: #4ea6ff;
          line-height: 36px;

          .ant-collapse-arrow {
            margin-left: 15px !important;
          }
        }

        .ant-collapse-content {
          border-top: 0px;
        }
      }

      .course {
        //width: 100%;
        flex-shrink: 0;
        margin-right: 24px;

        display: flex;
        flex-wrap: wrap;
        align-items: center;
        padding: 25px 0px;
        margin-left: 22px;

        //margin: 0 12px;
        border: 1px solid #f2f6fc;
        border-top: 0px;

        .first {
          //position: relative;
          display: flex;
          flex-grow: 1;
          align-items: center;
          //height: 71px;
          margin-left: 12px;
          margin-right: 50px;
          width: 120px;

          .iconame {
            //position: absolute;
            color: #4f5156;
            font-size: 16px;
            margin-left: 4px;
          }

          .icontext {
            //positipn: absolute;
            color: #999ba3;
            font-size: 14px;
            margin-left: 12px;
            width: 120px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
          }
        }

        .type {
          //height: 71px;
          display: flex;
          flex-grow: 1;
          align-items: center;
          margin-right: 50px;

          .typename {
            width: 63px;
            height: 23px;
            color: #5dc988;
            font-size: 14px;
            background-color: #f2f6fc;
            border-radius: 4px;
            text-align: center;
          }

          .typename1 {
            width: 63px;
            height: 23px;
            color: #f0f4fe;
            font-size: 14px;
            background-color: #5dc988;
            border-radius: 4px;
            text-align: center;
          }
        }

        .time {
          //height: 71px;
          flex-grow: 1;
          margin-right: 50px;
          width: 100px;

          .timetext {
            font-size: 14px;
            color: #999ba3;
          }
        }

        .progress {
          width: 168px;
          margin-left: 10px;
          margin-right: 50px;
          flex-grow: 1;

          .progresstext {
            color: #ffc067;
            font-size: 14px;
          }
        }

        .operations {
          display: flex;
          width: 200px;
          //flex-grow: 1;
          .operation {
            color: #4ea6ff;
            font-size: 14px;
            padding: 10px;
            margin-left: auto;
          }
        }
      }

      .taskbox {
        width: 412px;
        height: 160px;
        border-radius: 10px;
        position: relative;
        margin-left: 68px;
        margin-bottom: 40px;
        margin-top: 32px;
        cursor: pointer;

        .leftt {
          position: absolute;
          top: 18px;
          left: 0;
        }

        .photo {
          position: absolute;
          top: 42px;
          left: 37px;
        }

        .rightt {
          position: absolute;
          top: 69px;
          right: 26px;
        }

        .centerbox {
          position: absolute;
          top: 52px;
          left: 145px;
          font-size: 20px;
          font-weight: 700;
          //line-height: 36px;
        }

        .centermain {
          color: rgba(135, 139, 146, 1);
          font-size: 14px;
          position: absolute;
          left: 144px;
          bottom: 49px;
        }
      }
    }

    .notice {
      .ntc_tit {
        padding-top: 22px;
        margin-left: 34px;
        font-size: 18px;
        font-weight: 500;
        color: #232425;
      }

      .ntc_body {
        margin-left: 35px;
        margin-right: 34px;

        .ntc_switch {
          display: flex;
          margin: 32px 0px;

          .opclo {
            margin-left: 9px;
          }
        }

        .ntc_content {
          .ntcc_tit {
            margin-bottom: 16px;
          }

          .textarea {
            display: flex;
            flex-direction: column;

            .btnarea {
              display: flex;
              justify-content: flex-end;
            }

            .area_btn {
              width: 100px;
              // padding: 0px 26px 0px 26px;
              height: 38px;
              margin-top: 24px;
              background: rgb(64, 158, 255);
              border-radius: 8px;
              border: 1px solid rgba(64, 158, 255, 1);
              display: flex;
              align-items: center;
              justify-content: center;
              flex-shrink: 0;
              cursor: pointer;

              .pub {
                width: 15px;
                height: 15px;
                background-image: url(@/assets/images/coursewareManage/export1.png);
                background-size: 100% 100%;
              }

              .btnText {
                font-size: 14px;
                font-weight: 400;
                color: rgb(255, 255, 255);
                line-height: 36px;
                margin-left: 5px;
              }
            }
          }
        }
      }
    }

    .projectscore {
      padding-top: 22px;

      .pjc_tit {
        margin-left: 34px;
        font-size: 18px;
        font-weight: 500;
        color: #232425;
      }

      .pjc_body {
        margin-left: 34px;
        margin-right: 34px;

        .groupright {
          display: flex;
          justify-content: space-between;
          align-items: center;

          .btn1 {
            width: 100px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 16px;
            border: 1px solid #4ea6ff;
            border-radius: 8px;
            background: #4ea6ff;
            cursor: pointer;

            .btn1text {
              color: #ffffff;
              margin-left: 5px;
              font-size: 14px;
            }
          }

          .btn2 {
            width: 100px;
            height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 32px;
            border: 1px solid #4ea6ff;
            border-radius: 8px;
            cursor: pointer;
            background: #ffffff;

            .btn2text {
              color: #4ea6ff;
              margin-left: 5px;
              font-size: 14px;
            }
          }
        }

        .pjcb_content {
          border: 1px solid #4ea6ff;
          padding: 20px;
          margin-top: 10px;

          .ant-input {
            width: 46px;
            font-size: 16px;
            color: #4ea6ff;
          }

          .scoretext {
            color: #4ea6ff;
            font-size: 16px;
            margin-left: 3px;
            margin-right: 4px;
          }

          .pjcb_content :last-child {
            margin-bottom: 0px;
          }

          .content {
            align-items: center;
            height: 50px;
            display: flex;
          }

          margin-bottom: 130px;
        }
      }
    }

    .setting {
      padding-top: 22px;

      .set_tit {
        margin-left: 34px;
        font-size: 18px;
        font-weight: 500;
        color: #232425;
      }

      .set_body {
        margin-left: 34px;
        margin-right: 34px;

        .set_content {
          margin: 32px auto;
          display: flex;
          // justify-content: end;
          .setc_name {
            width: 150px;
            display: flex;
            justify-content: end;
          }

          .setc_main {
            flex: 1;
            margin-left: 12px;
          }
        }
      }
    }
  }
}
</style>
