lsc 7 months ago
parent
commit
30f0cfef76
1 changed files with 192 additions and 195 deletions
  1. 192 195
      src/components/pages/aiAddCourse/addCourse.vue

+ 192 - 195
src/components/pages/aiAddCourse/addCourse.vue

@@ -1003,113 +1003,98 @@
                       <!-- <img src="../../../assets/icon/new/c_none.png" alt /> -->
                       <span>暂时还没有内容,快去检索吧</span>
                     </div>
-                    <div v-else class="add_chapters_box"
-                      style="display: flex; flex-direction: column;height:100%;overflow: auto;">
-                      <!-- @scroll="panFind" -->
-                      <div class="chapter_upload" v-for="(item1, index1) in knowInfoData3" :key="item1.id" @click="
-                            getChapterData(
-                              $event,
-                              index1,
-                              item1.type
-                            )
-                            ">
-                        <div class="chapter_upload_o" style="
-                                    position: relative;
-                                    display: flex;
-                                    align-items: center;
-                                  ">
-                          <div class="chapter_upload_check file-loading-class"
-                            :class="{ checked: knowFileids3.indexOf(item1.url) != -1 }"
-                            @click="checkKnowInfoData3(item1.url)"></div>
+                    <div v-else class="add_chapters_box" style="display: flex; flex-direction: column;height:100%;overflow: auto;padding: 0;">
+                      <div class="chapter_upload">
+                        <div class="chapter_upload_o" style="position: relative; display: flex; align-items: center; padding: 0 10px;">
+                          <div class="chapter_upload_check" style="min-width: 50px; background: unset;text-align: center; font-size: 14px;">选中</div>
                           <div class="chapter_upload_l" style="padding: 1px 0 0 10px">
-                            <div v-if="item1.type == 2" class="chapter_upload_l_i2"></div>
-                            <div v-if="item1.type == 3" class="chapter_upload_l_i3" style="margin-left: 1px">
-                            </div>
-                            <div v-if="item1.type == 6" class="chapter_upload_l_i6" style="margin-left: 1px">
-                            </div>
-                            <!-- <div v-if="item1.type == 7" class="chapter_upload_l_i8" style="margin-left: 1px"></div> -->
-                            <div v-if="item1.type == 8" class="chapter_upload_l_i8" style="margin-left: 1px">
-                            </div>
-                            <div v-if="item1.type == 14" class="chapter_upload_l_i14" style="margin-left: 1px">
+                            <div class="chapter_upload_l_i2" style="background: unset"></div>
+                          </div>
+                          <div class="chapter_upload_n" style="width: 100%; margin-top:0">
+                            <div class="chapter_upload_box" style="color: #000">文件名</div>
+                          </div>
+                          <div class="chapter_upload_type">文件类型</div>
+                          <div class="chapter_upload_ic" style="min-width: 80px;justify-content: center; font-size: 14px;">操作</div>
+                        </div>
+                      </div>
+                      <!-- @scroll="panFind" -->
+                      <div class="chapter_upload_box_file">
+                        <div class="chapter_upload" v-for="(item1, index1) in knowInfoData3" :key="item1.id" @click="
+                              getChapterData(
+                                $event,
+                                index1,
+                                item1.type
+                              )
+                              ">
+                          <div class="chapter_upload_o" style="
+                                      position: relative;
+                                      display: flex;
+                                      align-items: center;
+                                      padding: 0 10px;
+                                      ">
+                            <div class="chapter_upload_check file-loading-class"
+                              :class="{ checked: knowFileids3.indexOf(item1.url) != -1 }"
+                              @click="checkKnowInfoData3(item1.url)" style="min-width: 50px;text-align: center;background-size: 15px 15px;background-repeat: no-repeat;background-position: center;"></div>
+                            <div class="chapter_upload_l" style="padding: 1px 0 0 10px">
+                              <div v-if="item1.type == 2" class="chapter_upload_l_i2"></div>
+                              <div v-if="item1.type == 3" class="chapter_upload_l_i3" style="margin-left: 1px">
+                              </div>
+                              <div v-if="item1.type == 6" class="chapter_upload_l_i6" style="margin-left: 1px">
+                              </div>
+                              <!-- <div v-if="item1.type == 7" class="chapter_upload_l_i8" style="margin-left: 1px"></div> -->
+                              <div v-if="item1.type == 8" class="chapter_upload_l_i8" style="margin-left: 1px">
+                              </div>
+                              <div v-if="item1.type == 14" class="chapter_upload_l_i14" style="margin-left: 1px">
+                              </div>
+                              <div v-if="item1.type == 12" class="chapter_upload_l_i12" style="margin-left: 1px">
+                              </div>
+                              <div v-if="item1.type == 13" class="chapter_upload_l_i13" style="margin-left: 1px">
+                              </div>
                             </div>
-                            <div v-if="item1.type == 12" class="chapter_upload_l_i12" style="margin-left: 1px">
+                            <div class="chapter_upload_n" style="width: 100%">
+                              <el-tooltip :content="item1.name" placement="top" effect="dark">
+                                <!-- content to trigger tooltip here -->
+                                <div v-if="
+                              item1.type == 2 ||
+                              item1.type == 3 ||
+                              item1.type == 12 ||
+                              item1.type == 13 ||
+                              item1.type == 7
+                            " @click.stop="
+                              checkChpater3($event, index1, item1)
+                              " class="chapter_upload_box" >{{ item1.name }}</div>
+                                <div v-if="item1.type == 6" class="chapter_upload_box" @click="
+                                          selectAttText(index1)
+                                          " >{{ item1.name }}</div>
+                                <div v-if="item1.type == 8" class="chapter_upload_box" @click="selectLine(index1)" >{{ item1.title ? item1.title : '链接' }}</div>
+                                <div v-if="item1.type == 14" class="chapter_upload_box" @click="
+                                          openUpdateSource(index1)
+                                          " >{{ item1.title ? item1.title : '链接' }}</div>
+                              </el-tooltip>
                             </div>
-                            <div v-if="item1.type == 13" class="chapter_upload_l_i13" style="margin-left: 1px">
+                            <div class="chapter_upload_type">
+                              {{ getFileType(item1.name) }}
                             </div>
-                          </div>
-                          <div class="chapter_upload_n">
-                            <el-tooltip :content="item1.name" placement="top" effect="dark">
-                              <!-- content to trigger tooltip here -->
-                              <input readonly="true" v-if="
-                            item1.type == 2 ||
-                            item1.type == 3 ||
-                            item1.type == 12 ||
-                            item1.type == 13 ||
-                            item1.type == 7
-                          " :placeholder="item1.name" @click.stop="
-                            checkChpater3($event, index1, item1)
-                            " style="
-                                        border: none;
-                                        outline: none;
-                                        width: 80%;
-                                        minwidth: 215px;
-                                        z-index: 99;
-                                        font-size: 14px;
-                                        white-space: nowrap;
-                                        overflow: hidden;
-                                        text-overflow: ellipsis;
-                                      " />
-                              <input :placeholder="item1.name" v-if="item1.type == 6" style="
-                                        border: none;
-                                        outline: none;
-                                        width: 80%;
-                                        white-space: nowrap;
-                                        overflow: hidden;
-                                        text-overflow: ellipsis;
-                                      " readonly="true" @click="
-                                        selectAttText(index1)
-                                        " />
-                              <input :placeholder="item1.title ? item1.title : '链接'
-                            " v-if="item1.type == 8" style="
-                                        border: none;
-                                        outline: none;
-                                        width: 80%;
-                                        white-space: nowrap;
-                                        overflow: hidden;
-                                        text-overflow: ellipsis;
-                                      " readonly="true" @click="selectLine(index1)" />
-                              <input :placeholder="item1.title ? item1.title : '链接'
-                            " v-if="item1.type == 14" style="
-                                        border: none;
-                                        outline: none;
-                                        width: 80%;
-                                        white-space: nowrap;
-                                        overflow: hidden;
-                                        text-overflow: ellipsis;
-                                      " readonly="true" @click="
-                                        openUpdateSource(index1)
-                                        " />
-                            </el-tooltip>
-                          </div>
-                          <div class="chapter_upload_ic">
-                            <div class="chapter_upload_noSee" v-if="item1.type == 12"></div>
-                            <div class="chapter_upload_ic_check" v-if="item1.type == 3" @click.stop="
-                            checkChpater3($event, index1, item1)
-                            ">
+                            <div class="chapter_upload_ic" style="min-width: 80px;justify-content: center;">
+                              <div class="chapter_upload_noSee" v-if="item1.type == 12"></div>
+                              <div class="chapter_upload_ic_check" style="margin: 0" v-if="item1.type == 3" @click.stop="
+                              checkChpater3($event, index1, item1)
+                              ">
+                                <div></div>
+                              </div>
+                              <!-- <div class="chapter_upload_ic_r" @click.stop="
+                              deleteKnowInfoData3(
+                                $event,
+                                index1
+                              )
+                              ">
                               <div></div>
+                            </div> -->
                             </div>
-                            <!-- <div class="chapter_upload_ic_r" @click.stop="
-                            deleteKnowInfoData3(
-                              $event,
-                              index1
-                            )
-                            ">
-                            <div></div>
-                          </div> -->
                           </div>
                         </div>
                       </div>
-                    </div>
+                      </div>
                   </div>
                   <div style="margin: 0 5px; min-width: fit-content">
                     <button class="c_pub_button_confirm" @click="useUrl">
@@ -1130,111 +1115,97 @@
                       <!-- <img src="../../../assets/icon/new/c_none.png" alt /> -->
                       <span>暂时还没有内容,快去添加吧</span>
                     </div>
-                    <div v-else class="add_chapters_box"
-                      style="display: flex; flex-direction: column;height:100%;overflow: auto;" ref="rightKnow">
-                      <div class="chapter_upload" v-for="(item1, index1) in knowInfoData2" :key="item1.id" @click="
-                              getChapterData(
-                                $event,
-                                index1,
-                                item1.type
-                              )
-                              ">
-                        <div class="chapter_upload_o" style="
-                                      position: relative;
-                                      display: flex;
-                                      align-items: center;
-                                    ">
-                          <div class="chapter_upload_check file-loading-class"
-                            :class="{ checked: knowFileids2.indexOf(item1.fileid) != -1 }"
-                            @click="checkKnowInfoData2(item1.fileid)" v-loading="!item1.fileid"></div>
+                    <div v-else class="add_chapters_box" style="display: flex; flex-direction: column;height:100%;overflow: auto;padding: 0;" ref="rightKnow">
+                      <div class="chapter_upload">
+                        <div class="chapter_upload_o" style="position: relative; display: flex; align-items: center; padding: 0 10px;">
+                          <div class="chapter_upload_check" style="min-width: 50px; background: unset;text-align: center; font-size: 14px;">选中</div>
                           <div class="chapter_upload_l" style="padding: 1px 0 0 10px">
-                            <div v-if="item1.type == 2" class="chapter_upload_l_i2"></div>
-                            <div v-if="item1.type == 3" class="chapter_upload_l_i3" style="margin-left: 1px">
-                            </div>
-                            <div v-if="item1.type == 6" class="chapter_upload_l_i6" style="margin-left: 1px">
-                            </div>
-                            <!-- <div v-if="item1.type == 7" class="chapter_upload_l_i8" style="margin-left: 1px"></div> -->
-                            <div v-if="item1.type == 8" class="chapter_upload_l_i8" style="margin-left: 1px">
-                            </div>
-                            <div v-if="item1.type == 14" class="chapter_upload_l_i14" style="margin-left: 1px">
-                            </div>
-                            <div v-if="item1.type == 12" class="chapter_upload_l_i12" style="margin-left: 1px">
-                            </div>
-                            <div v-if="item1.type == 13" class="chapter_upload_l_i13" style="margin-left: 1px">
-                            </div>
+                            <div class="chapter_upload_l_i2" style="background: unset"></div>
                           </div>
-                          <div class="chapter_upload_n">
-                            <el-tooltip :content="item1.name" placement="top" effect="dark">
-                              <!-- content to trigger tooltip here -->
-                              <input readonly="true" v-if="
-                              item1.type == 2 ||
-                              item1.type == 3 ||
-                              item1.type == 12 ||
-                              item1.type == 13 ||
-                              item1.type == 7
-                            " :placeholder="item1.name" @click.stop="
-                              checkChpater3($event, index1, item1)
-                              " style="
-                                          border: none;
-                                          outline: none;
-                                          width: 80%;
-                                          minwidth: 215px;
-                                          z-index: 99;
-                                          font-size: 14px;
-                                          white-space: nowrap;
-                                          overflow: hidden;
-                                          text-overflow: ellipsis;
-                                        " />
-                              <input :placeholder="item1.name" v-if="item1.type == 6" style="
-                                          border: none;
-                                          outline: none;
-                                          width: 80%;
-                                          white-space: nowrap;
-                                          overflow: hidden;
-                                          text-overflow: ellipsis;
-                                        " readonly="true" @click="
-                                          selectAttText(index1)
-                                          " />
-                              <input :placeholder="item1.title ? item1.title : '链接'
-                              " v-if="item1.type == 8" style="
-                                          border: none;
-                                          outline: none;
-                                          width: 80%;
-                                          white-space: nowrap;
-                                          overflow: hidden;
-                                          text-overflow: ellipsis;
-                                        " readonly="true" @click="selectLine(index1)" />
-                              <input :placeholder="item1.title ? item1.title : '链接'
-                              " v-if="item1.type == 14" style="
-                                          border: none;
-                                          outline: none;
-                                          width: 80%;
-                                          white-space: nowrap;
-                                          overflow: hidden;
-                                          text-overflow: ellipsis;
-                                        " readonly="true" @click="
-                                          openUpdateSource(index1)
-                                          " />
-                            </el-tooltip>
+                          <div class="chapter_upload_n" style="width: 100%; margin-top:0">
+                            <div class="chapter_upload_box" style="color: #000">文件名</div>
                           </div>
-                          <div class="chapter_upload_ic">
-                            <div class="chapter_upload_noSee" v-if="item1.type == 12"></div>
-                            <div class="chapter_upload_ic_check" v-if="item1.type == 3" @click.stop="
-                              checkChpater3($event, index1, item1)
-                              ">
-                              <div></div>
+                          <div class="chapter_upload_type">文件类型</div>
+                          <div class="chapter_upload_ic" style="min-width: 80px;justify-content: center; font-size: 14px;">操作</div>
+                        </div>
+                      </div>
+                      <div class="chapter_upload_box_file">
+                        <div class="chapter_upload" v-for="(item1, index1) in knowInfoData2" :key="item1.id" @click="
+                                getChapterData(
+                                  $event,
+                                  index1,
+                                  item1.type
+                                )
+                                ">
+                          <div class="chapter_upload_o" style="
+                                        position: relative;
+                                        display: flex;
+                                        align-items: center;
+                                        padding: 0 10px;
+                                      ">
+                            <div class="chapter_upload_check file-loading-class"
+                              :class="{ checked: knowFileids2.indexOf(item1.fileid) != -1 }"
+                              @click="checkKnowInfoData2(item1.fileid)" v-loading="!item1.fileid" style="min-width: 50px;text-align: center;background-size: 15px 15px;background-repeat: no-repeat;background-position: center;"></div>
+                            <div class="chapter_upload_l" style="padding: 1px 0 0 10px">
+                              <div v-if="item1.type == 2" class="chapter_upload_l_i2"></div>
+                              <div v-if="item1.type == 3" class="chapter_upload_l_i3" style="margin-left: 1px">
+                              </div>
+                              <div v-if="item1.type == 6" class="chapter_upload_l_i6" style="margin-left: 1px">
+                              </div>
+                              <!-- <div v-if="item1.type == 7" class="chapter_upload_l_i8" style="margin-left: 1px"></div> -->
+                              <div v-if="item1.type == 8" class="chapter_upload_l_i8" style="margin-left: 1px">
+                              </div>
+                              <div v-if="item1.type == 14" class="chapter_upload_l_i14" style="margin-left: 1px">
+                              </div>
+                              <div v-if="item1.type == 12" class="chapter_upload_l_i12" style="margin-left: 1px">
+                              </div>
+                              <div v-if="item1.type == 13" class="chapter_upload_l_i13" style="margin-left: 1px">
+                              </div>
                             </div>
-                            <div class="chapter_upload_ic_r" @click.stop="
-                              deleteKnowInfoData2(
-                                $event,
-                                index1
-                              )
-                              ">
-                              <div></div>
+                            <div class="chapter_upload_n" style="width: 100%">
+                              <el-tooltip :content="item1.name" placement="top" effect="dark">
+                                <!-- content to trigger tooltip here -->
+                                <div v-if="
+                                item1.type == 2 ||
+                                item1.type == 3 ||
+                                item1.type == 12 ||
+                                item1.type == 13 ||
+                                item1.type == 7
+                              " @click.stop="
+                                checkChpater3($event, index1, item1)
+                                "  class="chapter_upload_box">{{ item1.name }}</div>
+                                <div v-if="item1.type == 6" class="chapter_upload_box" @click="
+                                            selectAttText(index1)
+                                            ">{{ item1.name }}</div>
+                                <div v-if="item1.type == 8" class="chapter_upload_box" @click="selectLine(index1)">{{ item1.title ? item1.title : '链接' }}</div>
+                                <div v-if="item1.type == 14" class="chapter_upload_box" @click="
+                                            openUpdateSource(index1)
+                                            ">{{ item1.title ? item1.title : '链接' }}</div>
+                              </el-tooltip>
+                            </div>
+                            <div class="chapter_upload_type">
+                              {{ getFileType(item1.name) }}
+                            </div>
+                            <div class="chapter_upload_ic" style="min-width: 80px;justify-content: center;">
+                              <div class="chapter_upload_noSee" v-if="item1.type == 12"></div>
+                              <div class="chapter_upload_ic_check" v-if="item1.type == 3" @click.stop="
+                                checkChpater3($event, index1, item1)
+                                ">
+                                <div></div>
+                              </div>
+                              <div class="chapter_upload_ic_r" @click.stop="
+                                deleteKnowInfoData2(
+                                  $event,
+                                  index1
+                                )
+                                ">
+                                <div></div>
+                              </div>
                             </div>
                           </div>
                         </div>
                       </div>
+                      
                     </div>
                   </div>
                 </div>
@@ -8440,6 +8411,19 @@ export default {
         }
       }
     },
+    getFileType(){
+      return function (name) {
+        let fileType = ['作业', '教案'];
+        
+        for (let type of fileType) {
+          if (converter(name).includes(type)) {
+            return type; // 判断name中是否包含对应的文件类型
+          }
+        }
+        
+        return '其他';
+      };
+    },
   },
   watch: {
     unitIndex(newValue, oldValue) {
@@ -27061,6 +27045,19 @@ ${msg}
   align-items: center;
 }
 
+.chapter_upload_type{
+  min-width: 80px;
+  text-align: center;
+  font-size: 14px;
+}
+
+.chapter_upload_box_file{
+  height: calc(100% - 45px);
+  overflow: auto;
+  border-top: 1px solid #e7ebf1;
+  box-sizing: border-box;
+}
+
 .chapter_upload_ic_l {
   width: 50px;
   height: 50px;