|
@@ -0,0 +1,3352 @@
|
|
|
+<template>
|
|
|
+ <div class="ai_body">
|
|
|
+ <div class="ai_body_dialog" ref="chatDialog">
|
|
|
+ <div class="dialog_content" v-for="item in array" :key="item.uid">
|
|
|
+ <div v-if="item.content" style="margin-left: auto;">
|
|
|
+ <div class="content content2" v-html="item.content"></div>
|
|
|
+ <div class="role">
|
|
|
+ <img src="../../../../assets/icon/new/role2.png" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top:20px;margin-bottom:20px ; margin-right: auto;" v-if="item.aiContent || item.loading">
|
|
|
+ <div class="role">
|
|
|
+ <img :src="item.fileid
|
|
|
+ ? item.fileid
|
|
|
+ : require('../../../../assets/icon/new/role1.png')
|
|
|
+ " />
|
|
|
+ </div>
|
|
|
+ <div element-loading-background="#f6f9ff" :style="{
|
|
|
+ minHeight: item.loading ? '50px' : 'unset',
|
|
|
+ minWidth: item.loading ? '50px' : 'unset'
|
|
|
+ }" class="content" v-loading="item.loading">
|
|
|
+ <span class="vditor-reset" v-html="item.aiContent"></span>
|
|
|
+ <span class="createTime" v-text="item.createtime"></span>
|
|
|
+ </div>
|
|
|
+ <div class="ai_btn_box" v-if="!pan(item.aiContent).length && !item.loading">
|
|
|
+ <img src="../../../../assets/icon/course/pasete.png" @click="onCopy(item.aiContent)" />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- 这里添加两个自定义 div -->
|
|
|
+ <div v-if="fileList.length == 0" style="display: flex;
|
|
|
+ justify-content: center;">
|
|
|
+ <div :class="['custom-div', { active: btnactive === 1 }]" @click="localTable()">
|
|
|
+ <p style="margin: 12px 0px 19px -23px;">从表单中选择</p>
|
|
|
+ <span class="custom-icon"></span>
|
|
|
+ </div>
|
|
|
+ <div :class="['custom-div', { active: btnactive === 2 }]" @click="triggerFileInput()">
|
|
|
+ <p style="margin: 12px 0px 19px -54px;">本地上传</p>
|
|
|
+ <span class="custom-icon"></span>
|
|
|
+ </div>
|
|
|
+ <input type="file" multiple="multiple" ref="fileInput" @change="beforeUploadInfo2" style="display: none;" />
|
|
|
+ </div>
|
|
|
+ <!-- 查看数据来源 -->
|
|
|
+ <el-dialog title="教师管理" :visible.sync="dialogTableVisible" :modal="true" append-to-body
|
|
|
+ :before-close="handleClose" class="dialog_diy">
|
|
|
+
|
|
|
+ <div class="dialog_contentArea">
|
|
|
+ <div class="student_head">
|
|
|
+ <div class="choose">
|
|
|
+ <div class="student_search">
|
|
|
+ <el-select v-model="typeCheck" placeholder="请选择类型" clearable @change="search">
|
|
|
+ <el-option v-for="(item, index) in typeArray" :key="index" :label="item.name"
|
|
|
+ :value="item.id"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="student_search" style="width:100px" v-if="stype == 1">
|
|
|
+
|
|
|
+ <el-select v-model="groupA" @change="search">
|
|
|
+ <el-option value="0" label="我的"></el-option>
|
|
|
+ <el-option value="2" label="他人"></el-option>
|
|
|
+ <el-option value="4" label="所有人"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="student_right">
|
|
|
+ <div class="head_left">
|
|
|
+ <div style="margin-right: 10px;position: relative;">
|
|
|
+ <el-input v-model="courseName" class="student_input" placeholder="请输入项目名称"></el-input>
|
|
|
+ <span class="serach_icon" @click="searchCourse"></span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-table ref="table" :data="course" border v-loading="isLoading" :key="1"
|
|
|
+ :header-cell-style="{ color: '#00000066', fontSize: '16px', fontWeight: 'unset' }"
|
|
|
+ :row-class-name="tableRowClassName2" v-if="stype == 1" class="tableClass">
|
|
|
+ <el-table-column type="selection" :selectable="selectable" width="55"></el-table-column>
|
|
|
+ <el-table-column label="序号" width="100px" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.$index + 1 }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="title" label="问卷名称" min-width="150" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="uname" label="创建者" min-width="80" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column v-if="typeArray.length" prop="typeN" label="问卷类型" min-width="80" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.typeN ? scope.row.typeN : '未设置类型' }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="worksCount" label="已提交数量" min-width="80" align="center">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="表单状态" min-width="80" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+
|
|
|
+ <div class="test_type2" style="width: fit-content;margin: 0 auto;" :class="getLookType(scope.row)">
|
|
|
+
|
|
|
+ <span>{{ getLook(scope.row) }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!--
|
|
|
+ <el-table-column label="操作" width="350px;display:none !important;">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button @click="goToCourse2(scope.row)" type="text" size="small" v-if="((scope.row.userid == userid) ||
|
|
|
+ (scope.row.course_teacher &&
|
|
|
+ scope.row.course_teacher.indexOf(userid) !== -1) || role == '1')">编辑</el-button>
|
|
|
+ <el-button @click="checkToTest(scope.row.courseId)" type="text" size="small">查看</el-button>
|
|
|
+ <el-button @click="copyTest(scope.row.courseId)" type="text" size="small">复制</el-button>
|
|
|
+ <el-button @click="shareTest(scope.row)" type="text" size="small" v-if="((scope.row.userid == userid) ||
|
|
|
+ (scope.row.course_teacher &&
|
|
|
+ scope.row.course_teacher.indexOf(userid) !== -1) || role == '1')">提醒</el-button>
|
|
|
+ <el-button @click="deleteCourse(scope.row.courseId)" type="text" size="small" style="color: #EE3E3E;"
|
|
|
+ v-if="((scope.row.userid == userid) ||
|
|
|
+ (scope.row.course_teacher &&
|
|
|
+ scope.row.course_teacher.indexOf(userid) !== -1) || role == '1')">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+-->
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="confirm_btn">
|
|
|
+ <el-button type="primary" @click="confirmSelection">确认</el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+ <div class="ai_body_select" v-if="false">
|
|
|
+ <div class="checkBox" v-if="checkBool">
|
|
|
+ <div class="task">
|
|
|
+ <div class="title">选择需要优化的任务:</div>
|
|
|
+ <div class="content">
|
|
|
+ <div class="span" @click="addAllTask()">
|
|
|
+ <div class="check">
|
|
|
+ <img :src="checkImg" alt="" v-if="checkArray.length !== course.length" />
|
|
|
+ <img :src="checkIsImg" alt="" v-else />
|
|
|
+ </div>
|
|
|
+ <span>全选</span>
|
|
|
+ </div>
|
|
|
+ <div class="span" v-for="(item, index) in course" :key="index" @click="addTask(index)">
|
|
|
+ <div class="check">
|
|
|
+ <img :src="checkImg" alt="" v-if="checkArray.indexOf(index) === -1" />
|
|
|
+ <img :src="checkIsImg" alt="" v-else />
|
|
|
+ </div>
|
|
|
+ <span>任务{{ index + 1 }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="part">
|
|
|
+ <div class="title">选择优化的部分:</div>
|
|
|
+ <div class="content">
|
|
|
+ <div class="span" v-for="(item, index) in partArray" :key="index" :class="{ active: part == item.name }"
|
|
|
+ @click="checkPart(item.name)">
|
|
|
+ {{ item.name }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span class="check" :class="{ isCheck: checkBool }" v-if="!checkArray.length && !part"
|
|
|
+ @click="checkBool = !checkBool">选择优化内容</span>
|
|
|
+ <span class="check" :class="{ isCheck: checkBool }" @click="checkBool = !checkBool" v-else>
|
|
|
+ <el-tooltip :content="taskName" placement="top" effect="dark">
|
|
|
+ <!-- content to trigger tooltip here -->
|
|
|
+ <span>{{ taskName }}</span>
|
|
|
+ </el-tooltip>
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <div class="ai_body_input">
|
|
|
+ <div class="ai_b_i_btnArea">
|
|
|
+ <span class="clear" @click.stop="clear()">
|
|
|
+ <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
+ <path fill-rule="evenodd" clip-rule="evenodd"
|
|
|
+ d="M2.5 3.125C2.5 2.77982 2.77982 2.5 3.125 2.5H16.875C17.2202 2.5 17.5 2.77982 17.5 3.125V8.02715C17.5 8.37233 17.2202 8.65215 16.875 8.65215C16.5298 8.65215 16.25 8.37233 16.25 8.02715V3.75H3.75V16.25H8.125C8.47018 16.25 8.75 16.5298 8.75 16.875C8.75 17.2202 8.47018 17.5 8.125 17.5H3.125C2.77982 17.5 2.5 17.2202 2.5 16.875V3.125Z" />
|
|
|
+ <path fill-rule="evenodd" clip-rule="evenodd"
|
|
|
+ d="M5.625 6.1521C5.625 5.80692 5.90482 5.5271 6.25 5.5271H13.125C13.4702 5.5271 13.75 5.80692 13.75 6.1521C13.75 6.49728 13.4702 6.7771 13.125 6.7771H6.25C5.90482 6.7771 5.625 6.49728 5.625 6.1521Z" />
|
|
|
+ <path fill-rule="evenodd" clip-rule="evenodd"
|
|
|
+ d="M5.625 9.2771C5.625 8.93192 5.90482 8.6521 6.25 8.6521H9.37496C9.72014 8.6521 9.99996 8.93192 9.99996 9.2771C9.99996 9.62228 9.72014 9.9021 9.37496 9.9021H6.25C5.90482 9.9021 5.625 9.62228 5.625 9.2771Z" />
|
|
|
+ <path fill-rule="evenodd" clip-rule="evenodd"
|
|
|
+ d="M12.465 11.507L15.9141 14.9048C16.1279 14.5365 16.25 14.1088 16.25 13.6521C16.25 12.2714 15.1307 11.1521 13.75 11.1521C13.2799 11.1521 12.8406 11.2815 12.465 11.507ZM15.0374 15.7957L11.5873 12.397C11.3726 12.7659 11.25 13.1944 11.25 13.6521C11.25 15.0328 12.3693 16.1521 13.75 16.1521C14.2211 16.1521 14.6613 16.0222 15.0374 15.7957ZM11.0797 11.0192C11.759 10.3303 12.7051 9.9021 13.75 9.9021C15.8211 9.9021 17.5 11.581 17.5 13.6521C17.5 14.6767 17.0882 15.6064 16.4226 16.2827C15.7431 16.9729 14.7961 17.4021 13.75 17.4021C11.6789 17.4021 10 15.7232 10 13.6521C10 12.6263 10.4127 11.6957 11.0797 11.0192Z" />
|
|
|
+ </svg>
|
|
|
+ <span>清屏</span>
|
|
|
+ </span>
|
|
|
+ <span class="clear" @click.stop="showjList = !showjList" v-if="jArray.length">
|
|
|
+ <span>查看</span>
|
|
|
+ </span>
|
|
|
+ <!-- <div style="margin-left: auto;">
|
|
|
+ <el-switch v-model="continuous"></el-switch>
|
|
|
+ <span @click.stop="continuous = !continuous">连续对话</span>
|
|
|
+ </div> -->
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div class="ai_b_i_roleListBox" ref="roleListRef" v-if="showRoleList && choseRoleList.length > 0">
|
|
|
+ <div :class="[
|
|
|
+ 'ai_b_i_rlb_item',
|
|
|
+ index == choseRoleItem ? 'ai_b_i_rlb_itemActive' : ''
|
|
|
+ ]" :ref="`roleItem${index}Ref`" v-for="(item, index) in choseRoleList" :key="item.id"
|
|
|
+ @mouseover="choseRoleItem = index" @click.stop="choseRole(item)">
|
|
|
+ <div class="ai_b_i_rlb_itemTop">
|
|
|
+ <img :src="item.headUrl
|
|
|
+ ? item.headUrl
|
|
|
+ : require('../../../../assets/icon/new/role1.png')
|
|
|
+ " alt="" />
|
|
|
+ <div class="ai_b_i_rlb_i_name">
|
|
|
+ <span>{{ item.assistantName }}</span>
|
|
|
+ <span>作者:{{ item.username }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="ai_b_i_rlb_itemBottom">
|
|
|
+ {{ item.prologue }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="ai_b_i_textListBox">
|
|
|
+ <div class="ai_b_i_tlb_left"></div>
|
|
|
+ <div class="ai_b_i_tlb_right"></div>
|
|
|
+ </div> -->
|
|
|
+ <!-- @input="inputChange" -->
|
|
|
+
|
|
|
+ <textarea @input="inputChange" class="ai_body_input_textarea" @keydown="textareaKeydown" :disabled="isVoice"
|
|
|
+ ref="textareaRef" v-model.trim="courseText"
|
|
|
+ :placeholder="isVoice ? isTalk ? '' : '点击按钮开始录音' : '在此输入您想了解的内容'"></textarea>
|
|
|
+
|
|
|
+ <span class="c_voiceBtn" v-if="!courseText && !isVoice" @click.stop="changeVoice(true)">
|
|
|
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
+ <path fill-rule="evenodd" clip-rule="evenodd"
|
|
|
+ d="M11.4583 14.0308C13.8381 14.0308 15.7551 12.0651 15.7551 9.62496V6.23588C15.7551 3.79574 13.8381 1.83008 11.4583 1.83008C9.07845 1.83008 7.16138 3.79574 7.16138 6.23588V9.62496C7.16138 12.0651 9.07845 14.0308 11.4583 14.0308ZM8.4835 6.23588C8.4835 4.54134 9.80561 3.18571 11.4583 3.18571C13.1109 3.18571 14.433 4.54134 14.433 6.23588V9.62496C14.433 11.3195 13.1109 12.6751 11.4583 12.6751C9.80561 12.6751 8.4835 11.3195 8.4835 9.62496V6.23588ZM18.3333 10.6405C18.3333 10.2677 18.0358 9.96264 17.6722 9.96264C17.3417 9.96264 17.0442 10.2338 17.0111 10.5727C16.5484 13.3178 14.2347 15.3852 11.4583 15.3852C8.68181 15.3852 6.36811 13.3178 5.90537 10.5727C5.87231 10.2338 5.57484 9.96264 5.24431 9.96264C4.88073 9.96264 4.58325 10.2677 4.58325 10.6405V10.7421C5.1121 13.9279 7.65717 16.4019 10.7972 16.7069V19.635H7.93254C7.54315 19.635 7.22748 19.9587 7.22748 20.358C7.22748 20.7572 7.54315 21.0809 7.93254 21.0809H14.9832C15.3726 21.0809 15.6883 20.7572 15.6883 20.358C15.6883 19.9587 15.3726 19.635 14.9832 19.635H12.1193V16.7069C15.2593 16.4019 17.8044 13.9279 18.3002 10.776C18.3002 10.7591 18.3085 10.7337 18.3167 10.7082L18.3167 10.7082L18.3167 10.7082C18.325 10.6828 18.3333 10.6574 18.3333 10.6405Z"
|
|
|
+ fill="black" fill-opacity="0.9" />
|
|
|
+ </svg>
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <span class="c_voiceBtn" style="right: 70px;" v-if="!courseText && isVoice && !isTalk"
|
|
|
+ @click.stop="changeVoice(false)">
|
|
|
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
+ <path fill-rule="evenodd" clip-rule="evenodd"
|
|
|
+ d="M2.75 3.4375C2.75 3.0578 3.0578 2.75 3.4375 2.75H18.5625C18.9422 2.75 19.25 3.0578 19.25 3.4375V18.5625C19.25 18.9422 18.9422 19.25 18.5625 19.25H3.4375C3.0578 19.25 2.75 18.9422 2.75 18.5625V3.4375ZM4.125 4.125V17.875H17.875V4.125H4.125Z"
|
|
|
+ fill="black" fill-opacity="0.9" />
|
|
|
+ <path fill-rule="evenodd" clip-rule="evenodd"
|
|
|
+ d="M6.875 6.875C6.875 6.4953 7.1828 6.1875 7.5625 6.1875H14.4375C14.8172 6.1875 15.125 6.4953 15.125 6.875V8.25C15.125 8.6297 14.8172 8.9375 14.4375 8.9375C14.0578 8.9375 13.75 8.6297 13.75 8.25V7.5625H11.6875V14.4375H12.375C12.7547 14.4375 13.0625 14.7453 13.0625 15.125C13.0625 15.5047 12.7547 15.8125 12.375 15.8125H9.625C9.2453 15.8125 8.9375 15.5047 8.9375 15.125C8.9375 14.7453 9.2453 14.4375 9.625 14.4375H10.3125V7.5625H8.25V8.25C8.25 8.6297 7.9422 8.9375 7.5625 8.9375C7.1828 8.9375 6.875 8.6297 6.875 8.25V6.875Z"
|
|
|
+ fill="black" fill-opacity="0.9" />
|
|
|
+ </svg>
|
|
|
+ </span>
|
|
|
+
|
|
|
+ <div :class="[
|
|
|
+ 'c_pub_button_confirm',
|
|
|
+ courseText ? '' : 'c_pub_button_confirmDisabled'
|
|
|
+ ]" v-if="!faloading && !isVoice" @click="addContent">
|
|
|
+ 发送
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div :class="['c_pub_button_confirmVoice']" v-if="!faloading && isVoice && !isTalk" @click="startVoice">
|
|
|
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
+ <path fill-rule="evenodd" clip-rule="evenodd"
|
|
|
+ d="M11.4583 14.0308C13.8381 14.0308 15.7551 12.0651 15.7551 9.62496V6.23588C15.7551 3.79574 13.8381 1.83008 11.4583 1.83008C9.07845 1.83008 7.16138 3.79574 7.16138 6.23588V9.62496C7.16138 12.0651 9.07845 14.0308 11.4583 14.0308ZM8.4835 6.23588C8.4835 4.54134 9.80561 3.18571 11.4583 3.18571C13.1109 3.18571 14.433 4.54134 14.433 6.23588V9.62496C14.433 11.3195 13.1109 12.6751 11.4583 12.6751C9.80561 12.6751 8.4835 11.3195 8.4835 9.62496V6.23588ZM18.3333 10.6405C18.3333 10.2677 18.0358 9.96264 17.6722 9.96264C17.3417 9.96264 17.0442 10.2338 17.0111 10.5727C16.5484 13.3178 14.2347 15.3852 11.4583 15.3852C8.68181 15.3852 6.36811 13.3178 5.90537 10.5727C5.87231 10.2338 5.57484 9.96264 5.24431 9.96264C4.88073 9.96264 4.58325 10.2677 4.58325 10.6405V10.7421C5.1121 13.9279 7.65717 16.4019 10.7972 16.7069V19.635H7.93254C7.54315 19.635 7.22748 19.9587 7.22748 20.358C7.22748 20.7572 7.54315 21.0809 7.93254 21.0809H14.9832C15.3726 21.0809 15.6883 20.7572 15.6883 20.358C15.6883 19.9587 15.3726 19.635 14.9832 19.635H12.1193V16.7069C15.2593 16.4019 17.8044 13.9279 18.3002 10.776C18.3002 10.7591 18.3085 10.7337 18.3167 10.7082L18.3167 10.7082L18.3167 10.7082C18.325 10.6828 18.3333 10.6574 18.3333 10.6405Z"
|
|
|
+ fill-opacity="0.9" />
|
|
|
+ </svg>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div :class="['c_pub_button_StopConfirmVoice']" v-if="!faloading && isVoice && isTalk" @click="stopVoice">
|
|
|
+ <svg width="22" height="22" viewBox="0 0 22 22" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
|
+ <path
|
|
|
+ d="M11 19.25C6.4625 19.25 2.75 15.5375 2.75 11C2.75 6.4625 6.4625 2.75 11 2.75C15.5375 2.75 19.25 6.4625 19.25 11C19.25 15.5375 15.5375 19.25 11 19.25ZM11 17.1875C14.4031 17.1875 17.1875 14.4031 17.1875 11C17.1875 7.59687 14.4031 4.8125 11 4.8125C7.59687 4.8125 4.8125 7.59687 4.8125 11C4.8125 14.4031 7.59687 17.1875 11 17.1875Z"
|
|
|
+ fill="#EE3E3E" />
|
|
|
+ <path
|
|
|
+ d="M12.75 8.25H9.25C8.69772 8.25 8.25 8.69772 8.25 9.25V12.75C8.25 13.3023 8.69772 13.75 9.25 13.75H12.75C13.3023 13.75 13.75 13.3023 13.75 12.75V9.25C13.75 8.69772 13.3023 8.25 12.75 8.25Z"
|
|
|
+ fill="#EE3E3E" />
|
|
|
+ </svg>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div v-if="!faloading && isVoice"></div>
|
|
|
+ <div class="c_pub_button_confirm" v-if="faloading && stopTalkToken" @click="stopSend">
|
|
|
+ 终止
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <iframe allow="camera *; microphone *;display-capture;midi;encrypted-media;"
|
|
|
+ src="https://beta.cloud.cocorobo.cn/browser/public/index.html" ref="iiframe" v-show="false"></iframe>
|
|
|
+ <!-- <div class="ai_body_input">
|
|
|
+ <textarea
|
|
|
+ style="padding-right: 85px;"
|
|
|
+ rows="3"
|
|
|
+ @keyup.enter="addContent"
|
|
|
+ class="binfo_input binfo_textarea"
|
|
|
+ cols
|
|
|
+ v-model.trim="courseText"
|
|
|
+ placeholder="在此输入您想了解的内容"
|
|
|
+ ></textarea>
|
|
|
+ <div
|
|
|
+ class="c_pub_button_confirm"
|
|
|
+ v-if="!loading && courseText"
|
|
|
+ @click="addContent"
|
|
|
+ >
|
|
|
+ 发送
|
|
|
+ </div>
|
|
|
+ <div class="c_pub_button_confirm" @click="promptTit" v-else>发送</div>
|
|
|
+ </div> -->
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+
|
|
|
+import checkImg from "../../../../assets/icon/sourceFile/check.png";
|
|
|
+import checkIsImg from "../../../../assets/icon/sourceFile/check_is.png";
|
|
|
+import { v4 as uuidv4 } from "uuid";
|
|
|
+import MarkdownIt from "markdown-it";
|
|
|
+import TurndownService from "turndown";
|
|
|
+const OpenCC = require("opencc-js");
|
|
|
+let converter = OpenCC.Converter({
|
|
|
+ from: "cn",
|
|
|
+ to: "hk"
|
|
|
+});
|
|
|
+
|
|
|
+export default {
|
|
|
+ props: {
|
|
|
+ courseId: {
|
|
|
+ type: String,
|
|
|
+ default: ""
|
|
|
+ },
|
|
|
+
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ stype: 1,
|
|
|
+ typeArray: [],
|
|
|
+ array: [],
|
|
|
+ jArray: [],
|
|
|
+ course: [],
|
|
|
+ courseText: "",
|
|
|
+ checkImg: checkImg,
|
|
|
+ checkIsImg: checkIsImg,
|
|
|
+ userid: this.$route.query.userid,
|
|
|
+ oid: this.$route.query.oid,
|
|
|
+ org: this.$route.query.org,
|
|
|
+ role: this.$route.query.role,
|
|
|
+ isLoading: false,
|
|
|
+ checkArray: [],
|
|
|
+ course: [{ title: "任务1" }, { title: "任务2" }, { title: "任务3" }],
|
|
|
+ partArray: [
|
|
|
+ { name: "全部内容" },
|
|
|
+ { name: "任务设计" },
|
|
|
+ { name: "评价设计" }
|
|
|
+ ],
|
|
|
+ part: "全部内容",
|
|
|
+ checkBool: false,
|
|
|
+ loading: false,
|
|
|
+ selectedForms: [],
|
|
|
+ textareaHeight: 50,
|
|
|
+ publicRoleList: [],
|
|
|
+ roleList: [],
|
|
|
+ page: 1,
|
|
|
+ pageSize: 20,
|
|
|
+ page2: 1,
|
|
|
+ pageSize2: 20,
|
|
|
+ textList: [
|
|
|
+ {
|
|
|
+ title: "项目式学习",
|
|
|
+ dataList: [
|
|
|
+ "请给我一些学生开展项目式学习可以使用的主题或问题参考,请说出学生将要解决的问题,以及学生要经历怎样的学习活动。",
|
|
|
+ "请将一个关于生态保护项目的项目式学习展开描述,你需要描述学生如何解决这个问题,你需要至少写出四个活动,这些活动需要按照前后逻辑关系排列。",
|
|
|
+ "请对驱动问题为“如何为学校建造一个富有特色的花坛?”的项目式学习进行子问题拆解,至少拆解为5个子问题,并根据子问题对应写出各环节的主要活动。"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "教学评价",
|
|
|
+ dataList: [
|
|
|
+ "如果需要给学生的社区服务进行评价,给出评价维度和至少3个等级的表现描述。",
|
|
|
+ "为6年级学生设计一份关于梧桐山研究报告的评估任务表,并给出参考的报告流程,至少包含8个步骤,并包括地图、图片和至少300个词。",
|
|
|
+ "创建一个给5年级学生使用的课堂小测试,包含5道多选题,评价学生对于太阳能这个概念的理解。你需要给出题目和正确答案。"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "教学设计",
|
|
|
+ dataList: [
|
|
|
+ "如果需要5年级学生感受“移步换景”的景观写作手法,你有什么合适的阅读材料推荐?你需要给出材料名称,以及材料的哪部分内容。",
|
|
|
+ "设计一个针对8年级学生且关于人类迁徙主题的地理课,并在课程中设计至少1项小组活动。",
|
|
|
+ "设计一个针对5年级学生的课程,课程综合科学和信息技术领域,解决生物与环境领域的生活问题,你需要给出完整的课程框架和活动。",
|
|
|
+ "如果3年级的学生不能理解光合作用的实现过程,需要你帮我设计一个支持他们理解的教学活动,需要包含活动的形式、实施材料和清单。",
|
|
|
+ "请基于贝叶斯定理为8年级学生出三道题目。",
|
|
|
+ "如果需要八年级学生了解尼罗河流域的文化发展史,你有哪些推荐的网站或参考书籍?"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "班级管理",
|
|
|
+ dataList: [
|
|
|
+ "创建一组给一年级学生使用的班级口号,要求大家注意卫生、保护环境,口号需要对仗工整,符合一年级学生的理解水平。",
|
|
|
+ " 设计一套用于6年级学生的班级管理规章制度,内容需要包括学习、纪律、卫生、思想品德方面。"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "课堂组织",
|
|
|
+ dataList: [
|
|
|
+ "请为“制作垃圾分类宣传单”的小组活动设计小组分工表,每个小组的成员为4-6人。",
|
|
|
+ "请给5年级“校园植物图鉴”社团课程设计一份小组合作公约,需包含小组成员信息、小组项目目标、填写日期,总长度不超过300字,并且提供至少3处学生自行填写的部分。",
|
|
|
+ "请用苏格拉底提问的方式,引导5年级学生拆解驱动问题:如何解决教室黑板反光的问题?其中需包含对于反光原因的分析与实验探究。"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "教师发展",
|
|
|
+ dataList: [
|
|
|
+ "教师需要理解项目式学习的理论基础和基础概念,你需要生成一份阅读清单,要求内容为中文书籍或文献。",
|
|
|
+ "设计一个教师进行个人学期总结的框架,需要体现在教学、教研、个人学习方面的进步。"
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ title: "代码分析",
|
|
|
+ dataList: [
|
|
|
+ "这段代码实现了什么效果?",
|
|
|
+ "请描述这段代码。",
|
|
|
+ "根据这段代码,给我一些修改意见。"
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ showTextList: false,
|
|
|
+ showRoleList: false,
|
|
|
+ choseRoleItem: 0,
|
|
|
+ choseTextItem: 0,
|
|
|
+ continuous: true,
|
|
|
+ showjList: false,
|
|
|
+ faloading: false,
|
|
|
+ fasource: null,
|
|
|
+ saveUid: "",
|
|
|
+ isVoice: false,
|
|
|
+ isTalk: false,
|
|
|
+ languageSetting: 0,
|
|
|
+ username: "",
|
|
|
+ options2: {
|
|
|
+ 1: "选择题",
|
|
|
+ // 2: "问答题",
|
|
|
+ 3: "问答题",
|
|
|
+ 4: "添加文档",
|
|
|
+ 5: "附件",
|
|
|
+ 6: "课程",
|
|
|
+ 7: "评分",
|
|
|
+ 8: "日期",
|
|
|
+ 9: "单选题",
|
|
|
+ 10: "多选题",
|
|
|
+ 11: "课程",
|
|
|
+ },
|
|
|
+ answerArray: [],
|
|
|
+ fileList: [],
|
|
|
+ fileId: [],
|
|
|
+ btnactive: null,
|
|
|
+ dialogTableVisible: false,
|
|
|
+ typeCheck: "",
|
|
|
+ groupA: "0",
|
|
|
+ courseName: "",
|
|
|
+ cid: '',
|
|
|
+ courseInfoList: [],
|
|
|
+ worksArray: [],
|
|
|
+ copyWorksArray: null,
|
|
|
+ stopTalkToken: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ courseId: {
|
|
|
+ immediate: true,
|
|
|
+ deep: true,
|
|
|
+ handler(newValue, oldValue) {
|
|
|
+ if (newValue) {
|
|
|
+ this.getChatList().then(_ => {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ console.log(this.$refs.chatDialog.scrollHeight);
|
|
|
+ this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ worksArray: {
|
|
|
+ immediate: false,
|
|
|
+ deep: true,
|
|
|
+ handler(newValue, oldValue) {
|
|
|
+ if (newValue.length && JSON.stringify(newValue) !== this.copyWorksArray) {
|
|
|
+ this.$emit("clearFileData");
|
|
|
+ this.fileId = [];
|
|
|
+ this.fileList = [];
|
|
|
+ this.copyWorksArray = JSON.stringify(newValue);
|
|
|
+ newValue.forEach(el => {
|
|
|
+ this.setJson(el);
|
|
|
+ });
|
|
|
+ // console.log("👈👉",newValue)
|
|
|
+ // this.setJson(newValue)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ delFileList(index) {
|
|
|
+ this.fileList.splice(index, 1)
|
|
|
+ },
|
|
|
+ // setJson(array){
|
|
|
+ // const getAnswer = (j) => {
|
|
|
+ // switch (j.type) {
|
|
|
+ // case 1:
|
|
|
+ // return j.json.array
|
|
|
+ // .filter((_, idx) => j.json.answer2.includes(idx))
|
|
|
+ // .map(item => `${item.img}${item.option}`)
|
|
|
+ // .join(',');
|
|
|
+ // case 3:
|
|
|
+ // case 6:
|
|
|
+ // case 7:
|
|
|
+ // case 8:
|
|
|
+ // case 11:
|
|
|
+ // return j.json.answer2;
|
|
|
+ // case 5:
|
|
|
+ // if (!Array.isArray(j.json.file) || j.json.file.length === 0) {
|
|
|
+ // return '无附件';
|
|
|
+ // }
|
|
|
+ // return j.json.file.map(file => `${file.name}(${file.url})`).join(',');
|
|
|
+ // default:
|
|
|
+ // return '';
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+
|
|
|
+ // this.answerArray = array.map(i => ({
|
|
|
+ // "用户名": i.name,
|
|
|
+ // "提交时间": i.time,
|
|
|
+ // "表单内容": i.array.map((j, index) => ({
|
|
|
+ // "序号": index + 1,
|
|
|
+ // "题目": j.json.title,
|
|
|
+ // "题目类型": this.options2[j.type],
|
|
|
+ // "答案": getAnswer(j)
|
|
|
+ // }))
|
|
|
+ // }))
|
|
|
+ // console.log(this.answerArray);
|
|
|
+
|
|
|
+ // // 将JSON对象转换为字符串
|
|
|
+ // const jsonString = JSON.stringify(this.answerArray, null, 2);
|
|
|
+
|
|
|
+ // // 创建Blob对象
|
|
|
+ // const blob = new Blob([jsonString], { type: "application/json" });
|
|
|
+ // blob.lastModifiedDate = new Date();
|
|
|
+ // blob.name = `表单数据.json`;
|
|
|
+
|
|
|
+ // // 如果仍需要上传文件,可以保留这行
|
|
|
+ // return this.uploadFile(blob);
|
|
|
+ // },
|
|
|
+ selectable(row, index) {
|
|
|
+ return row.worksCount > 0
|
|
|
+ },
|
|
|
+ confirmSelection() {
|
|
|
+ // 获取用户选择的表单
|
|
|
+ const selectedForms = this.$refs.table.selection; // 获取选中的行
|
|
|
+ console.log("用户选择的表单:", selectedForms); // 打印用户选择的表单
|
|
|
+ this.isLoading = true
|
|
|
+ setTimeout(()=>{
|
|
|
+ this.dialogTableVisible = false;
|
|
|
+ },1000)
|
|
|
+
|
|
|
+
|
|
|
+ // this.cid = selectedForms.reduce((lastArr, item) => {
|
|
|
+ // lastArr.push(item.courseId);
|
|
|
+ // return lastArr
|
|
|
+ // }, []).join(',');
|
|
|
+ this.cid = selectedForms.map(i => i.courseId).join(",")
|
|
|
+ this.getData(this.cid)
|
|
|
+ this.getChatList()
|
|
|
+ },
|
|
|
+ handleClose(done) {
|
|
|
+ done();
|
|
|
+ },
|
|
|
+ triggerFileInput() {
|
|
|
+ this.btnactive = 2
|
|
|
+ this.$refs.fileInput.click();
|
|
|
+ },
|
|
|
+ // 处理文件选择
|
|
|
+ handleFileChange(event) {
|
|
|
+ const file = event.target.files[0];
|
|
|
+ if (file) {
|
|
|
+ // 这里可以添加文件处理逻辑,例如上传文件
|
|
|
+ console.log("选择的文件:", file.name);
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+ beforeUploadInfo2(event, type, tindex) {
|
|
|
+ // const loading = this.openLoading();
|
|
|
+ let file = "";
|
|
|
+ let cfindex2 = 0;
|
|
|
+
|
|
|
+ for (var cfindex = 0; cfindex < event.target.files.length; cfindex++) {
|
|
|
+ // var file = event.target.files[0];
|
|
|
+ file = event.target.files[cfindex];
|
|
|
+ let fileName = file.name
|
|
|
+ let fileUid = file.uid
|
|
|
+ var credentials = {
|
|
|
+ accessKeyId: "AKIATLPEDU37QV5CHLMH",
|
|
|
+ secretAccessKey: "Q2SQw37HfolS7yeaR1Ndpy9Jl4E2YZKUuuy2muZR",
|
|
|
+ }; //秘钥形式的登录上传
|
|
|
+ window.AWS.config.update(credentials);
|
|
|
+ window.AWS.config.region = "cn-northwest-1"; //设置区域
|
|
|
+
|
|
|
+ var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
|
|
|
+ var _this = this;
|
|
|
+ var xianObj = ['CSV']
|
|
|
+
|
|
|
+ if (
|
|
|
+ xianObj.indexOf(
|
|
|
+ file.name
|
|
|
+ .split(".")
|
|
|
+ [file.name.split(".").length - 1].toLocaleUpperCase()
|
|
|
+ ) == -1
|
|
|
+ ) {
|
|
|
+ this.$message.error("请上传.csv文件!");
|
|
|
+ this.inputShow = true;
|
|
|
+ // var a = _this.$refs.upload1.uploadFiles;
|
|
|
+ // a.splice(a.length - 1, a.length);
|
|
|
+ // loading.close();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ _this.$forceUpdate();
|
|
|
+ if (file) {
|
|
|
+ var params = {
|
|
|
+ Key:
|
|
|
+ file.name.split(".")[0] +
|
|
|
+ new Date().getTime() +
|
|
|
+ "." +
|
|
|
+ file.name.split(".")[file.name.split(".").length - 1],
|
|
|
+ ContentType: file.type,
|
|
|
+ Body: file,
|
|
|
+ "Access-Control-Allow-Credentials": "*",
|
|
|
+ ACL: "public-read",
|
|
|
+ }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
|
|
|
+ var options = {
|
|
|
+ partSize: 2048 * 1024 * 1024,
|
|
|
+ queueSize: 2,
|
|
|
+ leavePartsOnError: true,
|
|
|
+ };
|
|
|
+ bucket
|
|
|
+ .upload(params, options)
|
|
|
+ .on("httpUploadProgress", function (evt) {
|
|
|
+ //这里可以写进度条
|
|
|
+ // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
|
|
|
+
|
|
|
+ // if(type == 14){
|
|
|
+ // _this.teacherinfoprogress = parseInt((evt.loaded / evt.total) * 100);
|
|
|
+ // _this.teacherinfoisFinishSize = (evt.loaded / 1024 / 1024).toFixed(2);
|
|
|
+ // }else if(type == 16){
|
|
|
+ // _this.mubiaoinfoprogress = parseInt((evt.loaded / evt.total) * 100);
|
|
|
+ // _this.mubiaoinfoisFinishSize = (evt.loaded / 1024 / 1024).toFixed(2);
|
|
|
+ // }else if(type == 17){
|
|
|
+ // _this.xuanzeinfoprogress = parseInt((evt.loaded / evt.total) * 100);
|
|
|
+ // _this.xuanzeinfoisFinishSize = (evt.loaded / 1024 / 1024).toFixed(2);
|
|
|
+ // }else if(type == 18){
|
|
|
+ // _this.pingjiainfoprogress[tindex] = parseInt((evt.loaded / evt.total) * 100);
|
|
|
+ // _this.pingjiainfoisFinishSize[tindex] = (evt.loaded / 1024 / 1024).toFixed(2);
|
|
|
+ // }else {
|
|
|
+ // _this.infoprogress = parseInt((evt.loaded / evt.total) * 100);
|
|
|
+ // _this.infoisFinishSize = (evt.loaded / 1024 / 1024).toFixed(2);
|
|
|
+ // }
|
|
|
+ _this.$forceUpdate();
|
|
|
+ })
|
|
|
+ .send(async function (err, data) {
|
|
|
+
|
|
|
+ // loading.close();
|
|
|
+
|
|
|
+ // if(type == 14){
|
|
|
+ // _this.teacherinfoprogress = 100;
|
|
|
+ // _this.teacherinfoisFinishSize = _this.teacherinfoisAllSize;
|
|
|
+ // }else if(type == 16){
|
|
|
+ // _this.mubiaoinfoprogress = 100;
|
|
|
+ // _this.mubiaoinfoisFinishSize = _this.mubiaoinfoisAllSize;
|
|
|
+ // }else if(type == 17){
|
|
|
+ // _this.xuanzeinfoprogress = 100;
|
|
|
+ // _this.xuanzeinfoisFinishSize = _this.xuanzeinfoisAllSize;
|
|
|
+ // }else if(type == 18){
|
|
|
+ // _this.pingjiainfoprogress[tindex] = 100;
|
|
|
+ // _this.pingjiainfoisFinishSize[tindex] = _this.pingjiainfoisAllSize[tindex];
|
|
|
+ // }else {
|
|
|
+ // _this.infoprogress = 100;
|
|
|
+ // _this.infoisFinishSize = _this.infoisAllSize;
|
|
|
+ // }
|
|
|
+
|
|
|
+ _this.$forceUpdate();
|
|
|
+ _this.inputShow = true;
|
|
|
+ // if (err) {
|
|
|
+ // cfindex2++;
|
|
|
+ // if (type == 14) {
|
|
|
+ // _this.teacherinfoisFinishSize = cfindex2;
|
|
|
+ // } else if (type == 16) {
|
|
|
+ // _this.mubiaoinfoisFinishSize = cfindex2;
|
|
|
+ // } else if (type == 17) {
|
|
|
+ // _this.xuanzeinfoisFinishSize = cfindex2;
|
|
|
+ // } else if (type == 18) {
|
|
|
+ // _this.pingjiainfoisFinishSize[tindex] = cfindex2;
|
|
|
+ // } else if (type == 19) {
|
|
|
+ // _this.knowinfoisFinishSize = cfindex2;
|
|
|
+ // } else if (type == 20) {
|
|
|
+ // _this.knowinfoisFinishSize2 = cfindex2;
|
|
|
+ // } else {
|
|
|
+ // _this.infoisFinishSize = cfindex2;
|
|
|
+ // }
|
|
|
+ // setTimeout(() => {
|
|
|
+ // if (
|
|
|
+ // cfindex2 == event.target.files.length ||
|
|
|
+ // cfindex2 > event.target.files.length
|
|
|
+ // ) {
|
|
|
+ // if (type == 14) {
|
|
|
+ // _this.teacherinfoproVisible = false;
|
|
|
+ // } else if (type == 16) {
|
|
|
+ // _this.mubiaoinfoproVisible = false;
|
|
|
+ // } else if (type == 17) {
|
|
|
+ // _this.xuanzeinfoproVisible = false;
|
|
|
+ // } else if (type == 18) {
|
|
|
+ // _this.pingjiainfoproVisible[tindex] = false;
|
|
|
+ // } else if (type == 19) {
|
|
|
+ // _this.knowinfoproVisible = false;
|
|
|
+ // } else if (type == 20) {
|
|
|
+ // _this.knowinfoproVisible2 = false;
|
|
|
+ // } else {
|
|
|
+ // _this.infoproVisible = false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+
|
|
|
+ // _this.$forceUpdate();
|
|
|
+ // }, 1000);
|
|
|
+ // // var a = _this.$refs.upload1.uploadFiles;
|
|
|
+ // // a.splice(a.length - 1, a.length);
|
|
|
+ // _this.$message.error("上传失败");
|
|
|
+ // } else {
|
|
|
+ // let fileid = await _this.createFileid(data.Location)
|
|
|
+ // if (fileid) {
|
|
|
+ // cfindex2++;
|
|
|
+ // if (type == 14) {
|
|
|
+ // _this.teacherinfoisFinishSize = cfindex2;
|
|
|
+ // } else if (type == 16) {
|
|
|
+ // _this.mubiaoinfoisFinishSize = cfindex2;
|
|
|
+ // } else if (type == 17) {
|
|
|
+ // _this.xuanzeinfoisFinishSize = cfindex2;
|
|
|
+ // } else if (type == 18) {
|
|
|
+ // _this.pingjiainfoisFinishSize[tindex] = cfindex2;
|
|
|
+ // } else if (type == 19) {
|
|
|
+ // _this.knowinfoisFinishSize = cfindex2;
|
|
|
+ // } else if (type == 20) {
|
|
|
+ // _this.knowinfoisFinishSize2 = cfindex2;
|
|
|
+ // } else {
|
|
|
+ // _this.infoisFinishSize = cfindex2;
|
|
|
+ // }
|
|
|
+ // if (
|
|
|
+ // cfindex2 == event.target.files.length ||
|
|
|
+ // cfindex2 > event.target.files.length
|
|
|
+ // ) {
|
|
|
+ // if (type == 14) {
|
|
|
+ // _this.teacherinfoproVisible = false;
|
|
|
+ // } else if (type == 16) {
|
|
|
+ // _this.mubiaoinfoproVisible = false;
|
|
|
+ // } else if (type == 17) {
|
|
|
+ // _this.xuanzeinfoproVisible = false;
|
|
|
+ // } else if (type == 18) {
|
|
|
+ // _this.pingjiainfoproVisible[tindex] = false;
|
|
|
+ // } else if (type == 19) {
|
|
|
+ // _this.knowinfoproVisible = false;
|
|
|
+ // } else if (type == 20) {
|
|
|
+ // _this.knowinfoproVisible2 = false;
|
|
|
+ // } else {
|
|
|
+ // _this.infoproVisible = false;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // _this.$forceUpdate();
|
|
|
+ // }
|
|
|
+ // if (fileid == 1) {
|
|
|
+ // _this.$message.error("此文件存在特殊符号无法转化成fileid请重新上传");
|
|
|
+ // return;
|
|
|
+ // }
|
|
|
+ // var imgA = [
|
|
|
+ // "png",
|
|
|
+ // "jpg",
|
|
|
+ // "jpeg",
|
|
|
+ // "bmp",
|
|
|
+ // "gif",
|
|
|
+ // "webp",
|
|
|
+ // "psd",
|
|
|
+ // "svg",
|
|
|
+ // "tiff",
|
|
|
+ // ];
|
|
|
+ // var fileA = [
|
|
|
+ // "PDF",
|
|
|
+ // "DOC",
|
|
|
+ // "DOCX",
|
|
|
+ // "DOCM",
|
|
|
+ // "DOTM",
|
|
|
+ // "DOTX",
|
|
|
+ // "PPTX",
|
|
|
+ // "PPSX",
|
|
|
+ // "PPT",
|
|
|
+ // "PPS",
|
|
|
+ // "PPTM",
|
|
|
+ // "POTM",
|
|
|
+ // "PPAM",
|
|
|
+ // "POTX",
|
|
|
+ // "PPSM",
|
|
|
+ // "XLSX",
|
|
|
+ // "XLS",
|
|
|
+ // ];
|
|
|
+ // var videoA = [
|
|
|
+ // "AVI",
|
|
|
+ // "NAVI",
|
|
|
+ // "MPEG",
|
|
|
+ // "ASF",
|
|
|
+ // "MOV",
|
|
|
+ // "WMV",
|
|
|
+ // "3GP",
|
|
|
+ // "RM",
|
|
|
+ // "RMVB",
|
|
|
+ // "FLV",
|
|
|
+ // "F4V",
|
|
|
+ // "H.264",
|
|
|
+ // "H.265",
|
|
|
+ // "REAL VIDEO",
|
|
|
+ // "MKV",
|
|
|
+ // "WebM",
|
|
|
+ // "HDDVD",
|
|
|
+ // "MP4",
|
|
|
+ // "MPG",
|
|
|
+ // "M4V",
|
|
|
+ // "MGV",
|
|
|
+ // "OGV",
|
|
|
+ // "QTM",
|
|
|
+ // "STR",
|
|
|
+ // "AMC",
|
|
|
+ // "DVX",
|
|
|
+ // "EVO",
|
|
|
+ // "DAT",
|
|
|
+ // "OGG",
|
|
|
+ // "OGM",
|
|
|
+ // ];
|
|
|
+ // let _type = 2;
|
|
|
+ // if (
|
|
|
+ // fileA.indexOf(
|
|
|
+ // data.Location.split(".")[
|
|
|
+ // data.Location.split(".").length - 1
|
|
|
+ // ].toLocaleUpperCase()
|
|
|
+ // ) != -1
|
|
|
+ // ) {
|
|
|
+ // _type = 3;
|
|
|
+ // } else if (
|
|
|
+ // videoA.indexOf(
|
|
|
+ // data.Location.split(".")[
|
|
|
+ // data.Location.split(".").length - 1
|
|
|
+ // ].toLocaleUpperCase()
|
|
|
+ // ) != -1
|
|
|
+ // ) {
|
|
|
+ // _type = 2;
|
|
|
+ // } else if (
|
|
|
+ // imgA.indexOf(
|
|
|
+ // data.Location.split(".")[
|
|
|
+ // data.Location.split(".").length - 1
|
|
|
+ // ].toLocaleLowerCase()
|
|
|
+ // ) != -1
|
|
|
+ // ) {
|
|
|
+ // _type = 13;
|
|
|
+ // } else {
|
|
|
+ // _type = 12;
|
|
|
+ // }
|
|
|
+ // if (type == 13) {
|
|
|
+ // _this.infoData.push({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // });
|
|
|
+ // _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData.unshift({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // })
|
|
|
+ // } else if (type == 14) {
|
|
|
+ // _this.teacherInfoData.push({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // });
|
|
|
+ // _this.infoData2.push({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // });
|
|
|
+ // _this.infoData.push({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // });
|
|
|
+ // _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData.unshift({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // })
|
|
|
+ // } else if (type == 15) {
|
|
|
+ // _this.infoData2.push({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // });
|
|
|
+ // _this.infoData.push({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // });
|
|
|
+ // _this.unitJson[0].chapterInfo[0].taskJson[0].chapterData.unshift({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // })
|
|
|
+ // } else if (type == 16) {
|
|
|
+ // _this.mubiaoInfoData.push({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // });
|
|
|
+ // } else if (type == 17) {
|
|
|
+ // _this.xuanzeInfoData.push({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // });
|
|
|
+ // } else if (type == 18) {
|
|
|
+ // if (!_this.pingjiaInfoData[tindex]) {
|
|
|
+ // _this.pingjiaInfoData[tindex] = []
|
|
|
+ // }
|
|
|
+ // _this.pingjiaInfoData[tindex].push({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // });
|
|
|
+ // } else if (type == 19) {
|
|
|
+ // _this.knowInfoData.push({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // });
|
|
|
+ // if (fileid != 1) {
|
|
|
+ // _this.knowFileids.push(fileid)
|
|
|
+ // }
|
|
|
+ // } else if (type == 20) {
|
|
|
+ // _this.knowInfoData2.push({
|
|
|
+ // name: fileName,
|
|
|
+ // url: data.Location,
|
|
|
+ // uid: fileUid,
|
|
|
+ // type: _type,
|
|
|
+ // fileid: fileid == 1 ? '' : fileid,
|
|
|
+ // });
|
|
|
+ // if (fileid != 1) {
|
|
|
+ // _this.knowFileids2.push(fileid)
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // console.log(data.Location);
|
|
|
+ // console.log(fileName, '----------', fileid);
|
|
|
+ // }
|
|
|
+ if (err) {
|
|
|
+ console.error("上传失败:", err);
|
|
|
+ } else {
|
|
|
+ console.log("上传成功:", data);
|
|
|
+ _this.fileList.push(data.Location);
|
|
|
+
|
|
|
+ _this.$emit("pushFileData", {
|
|
|
+ fileId: "",
|
|
|
+ name: fileName,
|
|
|
+ url: data.Location
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ selectTestType() {
|
|
|
+ this.isLoadingData = true
|
|
|
+ let params = {
|
|
|
+ oid: this.oid,
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "selectTestType", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.typeArray = res.data[0];
|
|
|
+ this.getData()
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ search() {
|
|
|
+ if (this.stype == 1) {
|
|
|
+ this.page = 1
|
|
|
+ this.getCourse();
|
|
|
+ } else if (this.stype == 2) {
|
|
|
+ this.page2 = 1
|
|
|
+ this.getCourse2();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ searchCourse() {
|
|
|
+ if (this.stype == 1) {
|
|
|
+ this.page = 1
|
|
|
+ this.getCourse();
|
|
|
+ } else if (this.stype == 2) {
|
|
|
+ this.page2 = 1
|
|
|
+ this.getCourse2();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ goToCourse2(item) {
|
|
|
+ if (item.worksCount > 0) {
|
|
|
+ this.$confirm("该表单已存在数据,如果修改题目可能会清空已提交数据,是否重新编辑?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.$router.push(
|
|
|
+ "/addTest?cid=" +
|
|
|
+ item.courseId +
|
|
|
+ "&userid=" +
|
|
|
+ this.userid +
|
|
|
+ "&oid=" +
|
|
|
+ this.oid +
|
|
|
+ "&org=" +
|
|
|
+ this.org +
|
|
|
+ "&type=2" +
|
|
|
+ "&role=" +
|
|
|
+ this.role
|
|
|
+ );
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ return;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$router.push(
|
|
|
+ "/addTest?cid=" +
|
|
|
+ item.courseId +
|
|
|
+ "&userid=" +
|
|
|
+ this.userid +
|
|
|
+ "&oid=" +
|
|
|
+ this.oid +
|
|
|
+ "&org=" +
|
|
|
+ this.org +
|
|
|
+ "&type=2" +
|
|
|
+ "&role=" +
|
|
|
+ this.role
|
|
|
+ );
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkToTest(cid) {
|
|
|
+ this.$router.push(
|
|
|
+ "/checkToTest?cid=" +
|
|
|
+ cid +
|
|
|
+ "&userid=" +
|
|
|
+ this.userid +
|
|
|
+ "&oid=" +
|
|
|
+ this.oid +
|
|
|
+ "&org=" +
|
|
|
+ this.org +
|
|
|
+ "&type=2" +
|
|
|
+ "&role=" +
|
|
|
+ this.role
|
|
|
+ );
|
|
|
+ },
|
|
|
+ getCourse() {
|
|
|
+
|
|
|
+ let params = {
|
|
|
+ type: this.groupA,
|
|
|
+ uid: this.userid,
|
|
|
+ oid: this.oid,
|
|
|
+ org: this.org,
|
|
|
+ typea: "",
|
|
|
+ typeb: "",
|
|
|
+ typec: "",
|
|
|
+ typed: "",
|
|
|
+ typef: this.typeCheck,
|
|
|
+ typeE: "",
|
|
|
+ cu: "",
|
|
|
+ cn: this.courseName,
|
|
|
+ page: this.page,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "selectTesttCourse", params)
|
|
|
+ .then((res) => {
|
|
|
+ console.log('API返回的数据', res.data);
|
|
|
+
|
|
|
+ this.isLoading = false;
|
|
|
+ this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
|
|
|
+ this.course = res.data[0];
|
|
|
+ for (var i = 0; i < this.course.length; i++) {
|
|
|
+ let a = ''
|
|
|
+ if (this.course[i].juriP) {
|
|
|
+ a = this.course[i].juriP
|
|
|
+ }
|
|
|
+ if (this.course[i].juriP2) {
|
|
|
+ if (a) {
|
|
|
+ a = this.course[i].juriP + ',' + this.course[i].juriP2
|
|
|
+ } else {
|
|
|
+ a = this.course[i].juriP2
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.course[i].juriP = a
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ this.isLoading = false;
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ copyTest(cid) {
|
|
|
+ let params = [{
|
|
|
+ cid: cid,
|
|
|
+ uid: this.userid
|
|
|
+ }]
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "copyTest", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.page = 1
|
|
|
+ if (this.role == "1") {
|
|
|
+ this.groupA = "0";
|
|
|
+ } else {
|
|
|
+ this.groupA = "0";
|
|
|
+ }
|
|
|
+ this.$message.success("复制成功")
|
|
|
+ this.clear()
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ shareTest(cid) {
|
|
|
+ this.scid = cid
|
|
|
+ this.dialogVisibleShare = true
|
|
|
+ },
|
|
|
+ deleteCourse(cid) {
|
|
|
+ // if (this.time()) {
|
|
|
+ this.$confirm("确定删除此表单吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.isLoading = true;
|
|
|
+ let params = [{
|
|
|
+ cid: cid,
|
|
|
+ }];
|
|
|
+ this.ajax
|
|
|
+ .post(this.$store.state.api + "deleteTestCourse", params)
|
|
|
+ .then((res) => {
|
|
|
+ this.isLoading = false;
|
|
|
+ this.$message.success("删除成功");
|
|
|
+ this.getCourse();
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ loading.close();
|
|
|
+ this.isLoading = false;
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ return;
|
|
|
+ });
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ localTable() {
|
|
|
+ this.btnactive = 1
|
|
|
+ this.isLoading = true
|
|
|
+ this.dialogTableVisible = true
|
|
|
+ this.getCourse();
|
|
|
+
|
|
|
+ },
|
|
|
+ // setJson(obj) {
|
|
|
+ // let array = obj.worksArray;
|
|
|
+ // let name = obj.name;
|
|
|
+ // if (array.length == 0) {
|
|
|
+ // console.log("没人提交1111")
|
|
|
+ // return this.$emit("pushFileData", {
|
|
|
+ // fileId: "",
|
|
|
+ // name: name,
|
|
|
+ // url: ""
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // console.log(data.Location);
|
|
|
+ // console.log("提交11111")
|
|
|
+ // _this.fileList.push(data.Location);
|
|
|
+ // _this.$emit("pushFileData", {
|
|
|
+ // fileId: "",
|
|
|
+ // name: name,
|
|
|
+ // url: data.Location
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // const getAnswer = j => {
|
|
|
+ // if (j.type === 1) {
|
|
|
+ // return j.json.array
|
|
|
+ // .filter((_, idx) => j.json.answer2.includes(idx))
|
|
|
+ // .map(item => `${item.img}${item.option}`)
|
|
|
+ // .join(",");
|
|
|
+ // } else if (
|
|
|
+ // j.type === 3 ||
|
|
|
+ // j.type === 6 ||
|
|
|
+ // j.type === 7 ||
|
|
|
+ // j.type === 8 ||
|
|
|
+ // j.type === 11
|
|
|
+ // ) {
|
|
|
+ // return typeof j.json.answer2 === "string"
|
|
|
+ // ? j.json.answer2.replace(/\n/g, " ")
|
|
|
+ // : j.json.answer2;
|
|
|
+ // } else if (j.type === 5) {
|
|
|
+ // if (!Array.isArray(j.json.file) || j.json.file.length === 0) {
|
|
|
+ // return "无附件";
|
|
|
+ // }
|
|
|
+ // return j.json.file
|
|
|
+ // .map(file => `${file.name}(${file.url})`)
|
|
|
+ // .join(",");
|
|
|
+ // } else {
|
|
|
+ // return "";
|
|
|
+ // }
|
|
|
+ // };
|
|
|
+
|
|
|
+ // // 获取所有题目类型和题目
|
|
|
+ // const questions = array[0].array.map((j, index) => ({
|
|
|
+ // 序号: index + 1,
|
|
|
+ // 题目类型: this.options2[j.type],
|
|
|
+ // 题目: j.json.title
|
|
|
+ // }));
|
|
|
+
|
|
|
+ // console.log(questions);
|
|
|
+ // // let csvContent = "data:text/csv;charset=utf-8,"
|
|
|
+ // // 构建CSV内容
|
|
|
+ // // let csvContent = "用户名 | 提交时间 | " + questions.map(q => `${q.序号}-${q.题目类型}-${q.题目}`).join(' | ') + "\n";
|
|
|
+ // let csvContent = "用户名,提交时间," + questions.map(q => `${q.序号}-${q.题目类型}-${q.题目}`).join(",") + "\n";
|
|
|
+
|
|
|
+ // // 添加每个用户的答案
|
|
|
+ // array.forEach(i => {
|
|
|
+ // let row = [i.name, i.time];
|
|
|
+ // i.array.forEach(j => {
|
|
|
+ // row.push(getAnswer(j));
|
|
|
+ // });
|
|
|
+ // // csvContent += row.join(' | ') + "\n";
|
|
|
+ // csvContent += row.join(",") + "\n";
|
|
|
+ // });
|
|
|
+
|
|
|
+ // // 创建Blob对象
|
|
|
+ // // const blob = new Blob([csvContent], { type: "text/plain;charset=utf-8" });
|
|
|
+ // // blob.lastModifiedDate = new Date();
|
|
|
+ // // blob.name = `${name}_表单数据.txt`;
|
|
|
+
|
|
|
+ // // 创建Blob对象
|
|
|
+ // const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8" });
|
|
|
+ // blob.lastModifiedDate = new Date();
|
|
|
+ // blob.name = `${name}_表单数据.csv`;
|
|
|
+
|
|
|
+ // // 如果仍需要上传文件,可以保留这行
|
|
|
+ // return this.uploadFile({ file: blob, name: name });
|
|
|
+ // },
|
|
|
+ uploadFile({ file, name }) {
|
|
|
+ var credentials = {
|
|
|
+ accessKeyId: "AKIATLPEDU37QV5CHLMH",
|
|
|
+ secretAccessKey: "Q2SQw37HfolS7yeaR1Ndpy9Jl4E2YZKUuuy2muZR"
|
|
|
+ }; //秘钥形式的登录上传
|
|
|
+ window.AWS.config.update(credentials);
|
|
|
+ window.AWS.config.region = "cn-northwest-1"; //设置区域
|
|
|
+
|
|
|
+ var bucket = new window.AWS.S3({ params: { Bucket: "ccrb" } }); //选择桶
|
|
|
+ var _this = this;
|
|
|
+
|
|
|
+ if (file) {
|
|
|
+ // this.loading = true;
|
|
|
+ var params = {
|
|
|
+ Key:
|
|
|
+ file.name.split(".")[0] +
|
|
|
+ new Date().getTime() +
|
|
|
+ "." +
|
|
|
+ file.name.split(".")[file.name.split(".").length - 1],
|
|
|
+ ContentType: file.type,
|
|
|
+ Body: file,
|
|
|
+ "Access-Control-Allow-Credentials": "*",
|
|
|
+ ACL: "public-read"
|
|
|
+ }; //key可以设置为桶的相抵路径,Body为文件, ACL最好要设置
|
|
|
+ var options = {
|
|
|
+ partSize: 2048 * 1024 * 1024,
|
|
|
+ queueSize: 2,
|
|
|
+ leavePartsOnError: true
|
|
|
+ };
|
|
|
+ bucket
|
|
|
+ .upload(params, options)
|
|
|
+ .on("httpUploadProgress", function (evt) {
|
|
|
+ //这里可以写进度条
|
|
|
+ _this.progressData.value = parseInt((evt.loaded * 100) / evt.total);
|
|
|
+ // console.log("Uploaded : " + parseInt((evt.loaded * 80) / evt.total) + '%');
|
|
|
+ })
|
|
|
+ .send(function (err, data) {
|
|
|
+ if (err) {
|
|
|
+ _this.$message.error("上传失败");
|
|
|
+ } else {
|
|
|
+ console.log(data.Location);
|
|
|
+ console.log("提交")
|
|
|
+ _this.fileList.push(data.Location);
|
|
|
+ console.log(_this.fileList);
|
|
|
+ _this.$emit("pushFileData", {
|
|
|
+ fileId: "",
|
|
|
+ name: name,
|
|
|
+ url: data.Location
|
|
|
+ });
|
|
|
+ // _this.ajax
|
|
|
+ // .put("https://gpt4.cocorobo.cn/upload_file_knowledge", {
|
|
|
+ // url: data.Location
|
|
|
+ // })
|
|
|
+ // .then(res => {
|
|
|
+ // let _data = res.data.FunctionResponse;
|
|
|
+ // if (_data.result && _data.result.id) {
|
|
|
+ // _this.fileId.push(_data.result.id);
|
|
|
+ // _this.$emit("pushFileData", { fileId: _data.result.id, name: name, url: data.Location })
|
|
|
+ // } else {
|
|
|
+ // console.error("获取fileId失败");
|
|
|
+ // }
|
|
|
+
|
|
|
+ // })
|
|
|
+ // .catch(e => {
|
|
|
+ // console.log(e);
|
|
|
+ // console.error("获取fileId失败");
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+
|
|
|
+ // console.log(data.Location)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getLang() {
|
|
|
+ let lang = "";
|
|
|
+ if (this.languageSetting == 0) {
|
|
|
+ lang = "Chinese.";
|
|
|
+ } else if (this.languageSetting == 1) {
|
|
|
+ lang = "Traditional Chinese.";
|
|
|
+ } else if (this.languageSetting == 2) {
|
|
|
+ lang = "English.";
|
|
|
+ }
|
|
|
+ return lang;
|
|
|
+ },
|
|
|
+ promptTit() {
|
|
|
+ if (!this.loading && !this.courseText) {
|
|
|
+ this.$message({
|
|
|
+ message: "请输入您想要了解的内容",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.$message({
|
|
|
+ message: "请回答完毕后再次发送",
|
|
|
+ type: "warning"
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ addContent() {
|
|
|
+ if(this.fileList.length == 0){
|
|
|
+ return this.$message.error("请选择表单")
|
|
|
+ } else if (this.courseText.trim().length == 0){
|
|
|
+ return this.$message.error("请输入内容");
|
|
|
+ }
|
|
|
+
|
|
|
+ let message = this.courseText;
|
|
|
+ if (this.courseText) {
|
|
|
+ let msg = ``;
|
|
|
+ if (this.answerArray.length) {
|
|
|
+ // msg += `
|
|
|
+ // ## 表单资料
|
|
|
+ // ${JSON.stringify(this.answerArray)}
|
|
|
+ // `;
|
|
|
+
|
|
|
+ // msg += `
|
|
|
+ // ## 要求
|
|
|
+ // 根据<参考资料>中的内容实现以下要求:${this.courseText}
|
|
|
+ // `;
|
|
|
+ msg += `## 要求
|
|
|
+根据上传文件中的内容实现以下要求:${this.courseText}`;
|
|
|
+ message = msg;
|
|
|
+ }
|
|
|
+ // 这里处理@的角色
|
|
|
+ let _atRoleList = [];
|
|
|
+ let _roleList = [...this.roleList, ...this.publicRoleList];
|
|
|
+ _roleList.forEach(i => {
|
|
|
+ if (message.indexOf(`@${i.assistantName}`) != -1) {
|
|
|
+ _atRoleList.push(i);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.faloading = true;
|
|
|
+ if (_atRoleList.length > 0) {
|
|
|
+ //有@角色
|
|
|
+ let _replaceText = `Role: 你是数据检索大师,可以利用file_search的方式完整的去分析文件内容 Language: Please use the same language as the user requirement, if the user speaks Chinese, the specific text of your answer should also be in Chinese.\n${message}`;
|
|
|
+ let _htmlText = message;
|
|
|
+ _atRoleList.forEach(_i => {
|
|
|
+ _replaceText = _replaceText.replaceAll(`@${_i.assistantName}`, ``);
|
|
|
+ _htmlText = _htmlText.replaceAll(
|
|
|
+ `@${_i.assistantName}`,
|
|
|
+ `<span class='aite-name'>@${_i.assistantName}</span>`
|
|
|
+ );
|
|
|
+ });
|
|
|
+
|
|
|
+ _atRoleList.forEach((_item, _index) => {
|
|
|
+ const _uid = uuidv4();
|
|
|
+ if (_index == 0) {
|
|
|
+ this.array.push({
|
|
|
+ loading: true,
|
|
|
+ role: "user",
|
|
|
+ content: _htmlText,
|
|
|
+ uid: _uid,
|
|
|
+ AI: "AI",
|
|
|
+ aiContent: "",
|
|
|
+ oldContent: "",
|
|
|
+ isShowSynchronization: false,
|
|
|
+ filename: _item.assistantName,
|
|
|
+ index: this.array.length,
|
|
|
+ is_mind_map: false,
|
|
|
+ fileid: _item.headUrl,
|
|
|
+ createtime: new Date().toLocaleString().replaceAll("/", "-")
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.array.push({
|
|
|
+ loading: true,
|
|
|
+ role: "user",
|
|
|
+ content: "",
|
|
|
+ uid: _uid,
|
|
|
+ AI: "AI",
|
|
|
+ aiContent: "",
|
|
|
+ oldContent: "",
|
|
|
+ isShowSynchronization: false,
|
|
|
+ filename: _item.assistantName,
|
|
|
+ index: this.array.length,
|
|
|
+ is_mind_map: false,
|
|
|
+ fileid: _item.headUrl,
|
|
|
+ createtime: new Date().toLocaleString().replaceAll("/", "-")
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
+ });
|
|
|
+
|
|
|
+ let params = {
|
|
|
+ assistant_id: _item.assistant_id,
|
|
|
+ userId: this.userid,
|
|
|
+ message: _replaceText,
|
|
|
+ session_name: `${this.courseId}-${this.userid}-test`,
|
|
|
+ uid: _uid,
|
|
|
+ file_ids: this.fileId ? this.fileId : [],
|
|
|
+ // model: "gpt-4o-mini"
|
|
|
+ model: "qwen-plus"
|
|
|
+ };
|
|
|
+
|
|
|
+ this.ajax
|
|
|
+ .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
|
|
|
+ .then(res => {
|
|
|
+ if (
|
|
|
+ converter(res.data.FunctionResponse.result) ==
|
|
|
+ converter("发送成功")
|
|
|
+ ) {
|
|
|
+ } else {
|
|
|
+ this.$message.warning(res.data.FunctionResponse.result);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ this.getAtAuContent(_uid);
|
|
|
+ this.saveUid = _uid;
|
|
|
+ });
|
|
|
+ this.courseText = "";
|
|
|
+ } else {
|
|
|
+ let _uuid = uuidv4();
|
|
|
+ this.array.push({
|
|
|
+ role: "user",
|
|
|
+ content: `${this.courseText}`,
|
|
|
+ uid: _uuid,
|
|
|
+ AI: "AI",
|
|
|
+ aiContent: "",
|
|
|
+ oldContent: "",
|
|
|
+ isShowSynchronization: false,
|
|
|
+ filename: "",
|
|
|
+ index: this.array.length,
|
|
|
+ is_mind_map: false,
|
|
|
+ createtime: new Date().toLocaleString().replaceAll("/", "-"),
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+
|
|
|
+ // let history = [];
|
|
|
+ // if (this.continuous) {
|
|
|
+ // this.array.forEach((i, index) => {
|
|
|
+ // if (i.content) history.push({ role: "user", content: index == this.array.length - 1 ? message : i.content });
|
|
|
+ // if (i.aiContent)
|
|
|
+ // history.push({ role: "assistant", content: i.aiContent });
|
|
|
+ // });
|
|
|
+ // } else {
|
|
|
+ // history.push({ role: "user", content: message });
|
|
|
+ // }
|
|
|
+ // history = history.filter(
|
|
|
+ // i =>
|
|
|
+ // i.content !=
|
|
|
+ // "您好,我是您的助手小可"
|
|
|
+ // );
|
|
|
+
|
|
|
+ // history = history.map(i => ({
|
|
|
+ // role: i.role,
|
|
|
+ // content: `${i.content}`
|
|
|
+ // }));
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
+ // });
|
|
|
+ // let params = JSON.stringify({
|
|
|
+ // // model: "gpt-3.5-turbo",
|
|
|
+ // // model: "gpt-4o-mini",
|
|
|
+ // model: "qwen-plus",
|
|
|
+ // temperature: 0,
|
|
|
+ // max_tokens: 4096,
|
|
|
+ // top_p: 1,
|
|
|
+ // frequency_penalty: 0,
|
|
|
+ // presence_penalty: 0,
|
|
|
+ // messages: history,
|
|
|
+ // uid: _uuid,
|
|
|
+ // mind_map_question: ""
|
|
|
+ // });
|
|
|
+ // this.courseText = "";
|
|
|
+
|
|
|
+ // this.ajax
|
|
|
+ // .post("https://gpt4.cocorobo.cn/chat", params)
|
|
|
+ // .then(res => {
|
|
|
+ // if (
|
|
|
+ // converter(res.data.FunctionResponse.result) ==
|
|
|
+ // converter("发送成功")
|
|
|
+ // ) {
|
|
|
+ // } else {
|
|
|
+ // this.$message.warning(res.data.FunctionResponse.result);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(e => {
|
|
|
+ // console.log(e);
|
|
|
+ // });
|
|
|
+ // this.getAiContent(_uuid);\
|
|
|
+ let params = {
|
|
|
+ prompt: message,
|
|
|
+ messages: [],
|
|
|
+ file: this.fileList ? this.fileList : []
|
|
|
+ };
|
|
|
+ this.stopTalkToken = this.ajax.setCancelSource()
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
+ });
|
|
|
+ this.courseText = "";
|
|
|
+ this.saveUid = _uuid;
|
|
|
+ this.ajax
|
|
|
+ // .post("https://gpt4.cocorobo.cn/ai_agent_park_chat_new", params)
|
|
|
+ .post("https://gpt4.cocorobo.cn/csvaimessage", params, this.stopTalkToken)
|
|
|
+ .then(res => {
|
|
|
+ // if (
|
|
|
+ // converter(res.data.FunctionResponse.result) ==
|
|
|
+ // converter("发送成功")
|
|
|
+ // ) {
|
|
|
+ // } else {
|
|
|
+ // this.$message.warning(res.data.FunctionResponse.result);
|
|
|
+ // }
|
|
|
+ let data = res.data.FunctionResponse;
|
|
|
+ const md = new MarkdownIt();
|
|
|
+ const text = md.render(data);
|
|
|
+ this.array.find(i => i.uid == _uuid).aiContent = text;
|
|
|
+ this.array.find(i => i.uid == _uuid).isalltext = true;
|
|
|
+ this.array.find(i => i.uid == _uuid).isShowSynchronization = true;
|
|
|
+ this.array.find(i => i.uid == _uuid).loading = false;
|
|
|
+ this.stopTalkToken = null;
|
|
|
+ this.faloading = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
+ });
|
|
|
+ if (this.courseId) {
|
|
|
+ this.insertChat(_uuid);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err);
|
|
|
+ this.faloading = false;
|
|
|
+ this.stopTalkToken = null;
|
|
|
+ });
|
|
|
+ // this.getAtAuContent(_uuid);
|
|
|
+ // this.saveUid = _uuid;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getData() {
|
|
|
+ if (this.cid) {
|
|
|
+ this.loading = true
|
|
|
+ let cidList = this.cid.split(',')
|
|
|
+ let promiseList = []
|
|
|
+ cidList.forEach(el => {
|
|
|
+ promiseList.push(this.getCourseData(el))
|
|
|
+ })
|
|
|
+ Promise.all(promiseList).then(res => {
|
|
|
+ console.log(this.courseInfoList)
|
|
|
+ console.log(res);
|
|
|
+ this.courseInfoList = res;
|
|
|
+ this.worksArray = this.courseInfoList;
|
|
|
+ this.loading = false
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ getCourseData(courseId) {
|
|
|
+ console.log("👉", courseId)
|
|
|
+ return new Promise((resolve) => {
|
|
|
+ let params = {
|
|
|
+ cid: courseId,
|
|
|
+ cn: "",
|
|
|
+ tim: "",
|
|
|
+ tea: ""
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "getTestWorksNoPageCopy", params)
|
|
|
+ .then(async (res) => {
|
|
|
+ let testJson = res.data[0][0]
|
|
|
+ let works = res.data[1]
|
|
|
+ let chapters = this.setJSON(this.setJson2(JSON.parse(JSON.stringify(JSON.parse(res.data[0][0].chapters)))))
|
|
|
+ console.log('chapters', chapters);
|
|
|
+
|
|
|
+ let courseCount11 = []
|
|
|
+ let array = []
|
|
|
+ let courseIds = []; // 初始化一个空数组来存储所有的courseId
|
|
|
+ for (let i = 0; i < works.length; i++) {
|
|
|
+ let cJson = this.setJSON(JSON.parse(JSON.stringify(JSON.parse(works[i].courseJson))))
|
|
|
+ if (JSON.stringify(cJson) == JSON.stringify(chapters)) {
|
|
|
+ let _json = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(works[i].courseJson))))
|
|
|
+ for (var ja = 0; ja < _json.length; ja++) {
|
|
|
+ let _json2 = _json[ja].json;
|
|
|
+ if (_json[ja].type == 6) {
|
|
|
+ let courseId = _json2.answer2;
|
|
|
+ courseIds.push(courseId); // 将type为6的courseId添加到数组中
|
|
|
+ }
|
|
|
+ if (_json[ja].type == 11) {
|
|
|
+ let _answer = _json2.answer2;
|
|
|
+ _answer.length ? courseCount11 = courseCount11.concat(_answer) : '';
|
|
|
+ _json[ja].json.courseId = _answer ? _answer : [];
|
|
|
+ courseIds = courseIds.concat(_answer); // 将type为11的courseId添加到数组中
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 将所有的courseId去重
|
|
|
+ courseIds = Array.from(new Set(courseIds));
|
|
|
+ // 使用一个数组来存储所有的courseId后,执行getCourseInfoTestAll
|
|
|
+ let courseTitles = {}; // 初始化一个空对象来存储所有的courseTitles
|
|
|
+ let params2 = [{
|
|
|
+ cid: courseIds.join(",")
|
|
|
+ }]
|
|
|
+
|
|
|
+ let data2 = await this.ajax.post(this.$store.state.api + 'getCourseInfoTestAll2', params2);
|
|
|
+ let result2 = data2.data[0];
|
|
|
+ result2.forEach(i => {
|
|
|
+ courseTitles[i.courseId] = i.title;
|
|
|
+ });
|
|
|
+
|
|
|
+ for (let i = 0; i < works.length; i++) {
|
|
|
+ let cJson = this.setJSON(JSON.parse(JSON.stringify(JSON.parse(works[i].courseJson))))
|
|
|
+ if (JSON.stringify(cJson) == JSON.stringify(chapters)) {
|
|
|
+ let _json = this.JSONSetting(JSON.parse(JSON.stringify(JSON.parse(works[i].courseJson))))
|
|
|
+
|
|
|
+ _json.forEach(item => {
|
|
|
+ if (item.type == 11) {
|
|
|
+ let cid = item.json.answer2
|
|
|
+ let _title = []
|
|
|
+ for (var i = 0; i < cid.length; i++) {
|
|
|
+ _title.push(courseTitles[cid[i]])
|
|
|
+ }
|
|
|
+ item.json.answer2 = _title.length ? _title.join(",") : '';
|
|
|
+ }
|
|
|
+ if (item.type == 6) {
|
|
|
+ let courseId = item.json.answer2;
|
|
|
+ item.json.answer2 = courseTitles[courseId] || '';
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 更新对应的_json对象的answer2
|
|
|
+ array.push({
|
|
|
+ courseid: works[i].courseid,
|
|
|
+ id: works[i].id,
|
|
|
+ userid: works[i].userid,
|
|
|
+ name: works[i].username ? works[i].username : '匿名',
|
|
|
+ time: works[i].time,
|
|
|
+ array: _json,
|
|
|
+ cut: 0,
|
|
|
+ uteaName: works[i].uteaName,
|
|
|
+ courseJson: JSON.parse(works[i].courseJson),
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let obj = { courseId: testJson.courseId, name: testJson.title, worksArray: array }
|
|
|
+ // this.courseInfoList.push(obj)
|
|
|
+ resolve(obj)
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ resolve();
|
|
|
+ console.error(err);
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ setJson2(json) {
|
|
|
+ let _json = json;
|
|
|
+ // this.type = _json[0].ttype;
|
|
|
+ let checkArray = _json.filter((item) => {
|
|
|
+ if (item.array) {
|
|
|
+ item.array = item.array.filter((item2) => {
|
|
|
+ if (item2.ttype == 1 && item2.json && !item2.json.answer2) {
|
|
|
+ item2.json.answer2 = [];
|
|
|
+ }
|
|
|
+ if (item2.array) {
|
|
|
+ item2.array = item2.array.filter((item3) => {
|
|
|
+ if (item3.ttype == 1 && item3.json && !item3.json.answer2) {
|
|
|
+ item3.json.answer2 = [];
|
|
|
+ }
|
|
|
+ return item3;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return (
|
|
|
+ (item2.ttype != 1 && item2.array.length > 0) || item2.ttype == 1
|
|
|
+ );
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (item.ttype == 1 && item.json && !item.json.answer2) {
|
|
|
+ item.json.answer2 = [];
|
|
|
+ }
|
|
|
+ return (item.ttype != 1 && item.array.length > 0) || item.ttype == 1;
|
|
|
+ });
|
|
|
+ return checkArray;
|
|
|
+
|
|
|
+ },
|
|
|
+ setJSON(json) {
|
|
|
+ return json.filter((item) => {
|
|
|
+ if (item.array) {
|
|
|
+ item.array = item.array.filter((item2) => {
|
|
|
+ if (item2.ttype == 1 && item2.json) {
|
|
|
+ delete item2.json.answer2
|
|
|
+ delete item2.json.score2
|
|
|
+ delete item2.json.file
|
|
|
+ }
|
|
|
+ if (item2.array) {
|
|
|
+ item2.array = item2.array.filter((item3) => {
|
|
|
+ if (item3.ttype == 1 && item3.json) {
|
|
|
+ delete item3.json.answer2
|
|
|
+ delete item3.json.score2
|
|
|
+ delete item3.json.file
|
|
|
+ }
|
|
|
+ return item3;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return item2;
|
|
|
+ });
|
|
|
+ } else if (item.ttype == 1 && item.json) {
|
|
|
+ delete item.json.answer2
|
|
|
+ delete item.json.score2
|
|
|
+ delete item.json.file
|
|
|
+ }
|
|
|
+ return item
|
|
|
+ });
|
|
|
+ },
|
|
|
+ JSONSetting(json) {
|
|
|
+ let _json = json
|
|
|
+ let array = []
|
|
|
+ _json.filter((item) => {
|
|
|
+ if (item.array) {
|
|
|
+ item.array = item.array.filter((item2) => {
|
|
|
+ if (item2.ttype == 1 && item2.json) {
|
|
|
+ array.push(item2)
|
|
|
+ }
|
|
|
+ if (item2.array) {
|
|
|
+ item2.array = item2.array.filter((item3) => {
|
|
|
+ if (item3.ttype == 1 && item3.json) {
|
|
|
+ array.push(item3)
|
|
|
+ }
|
|
|
+ return item3;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ return item2;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (item.ttype == 1 && item.json) {
|
|
|
+ array.push(item)
|
|
|
+ }
|
|
|
+ return item;
|
|
|
+ });
|
|
|
+ return array;
|
|
|
+ },
|
|
|
+ setJson(obj) {
|
|
|
+ let array = obj.worksArray;
|
|
|
+ let name = obj.name;
|
|
|
+ if (array.length == 0) {
|
|
|
+ return console.log("没人提交")
|
|
|
+ // return this.$emit("pushFileData", {
|
|
|
+ // fileId: "",
|
|
|
+ // name: name,
|
|
|
+ // url: ""
|
|
|
+ // });
|
|
|
+ }
|
|
|
+ const getAnswer = j => {
|
|
|
+ if (j.type === 1) {
|
|
|
+ return j.json.array
|
|
|
+ .filter((_, idx) => j.json.answer2.includes(idx))
|
|
|
+ .map(item => `${item.img}${item.option}`)
|
|
|
+ .join(",");
|
|
|
+ } else if (
|
|
|
+ j.type === 3 ||
|
|
|
+ j.type === 6 ||
|
|
|
+ j.type === 7 ||
|
|
|
+ j.type === 8 ||
|
|
|
+ j.type === 11
|
|
|
+ ) {
|
|
|
+ return typeof j.json.answer2 === "string"
|
|
|
+ ? j.json.answer2.replace(/\n/g, " ")
|
|
|
+ : j.json.answer2;
|
|
|
+ } else if (j.type === 5) {
|
|
|
+ if (!Array.isArray(j.json.file) || j.json.file.length === 0) {
|
|
|
+ return "无附件";
|
|
|
+ }
|
|
|
+ return j.json.file
|
|
|
+ .map(file => `${file.name}(${file.url})`)
|
|
|
+ .join(",");
|
|
|
+ } else {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 获取所有题目类型和题目
|
|
|
+ const questions = array[0].array.map((j, index) => ({
|
|
|
+ 序号: index + 1,
|
|
|
+ 题目类型: this.options2[j.type],
|
|
|
+ 题目: j.json.title
|
|
|
+ }));
|
|
|
+
|
|
|
+ console.log("我是questions", questions);
|
|
|
+ // let csvContent = "data:text/csv;charset=utf-8,"
|
|
|
+ // 构建CSV内容
|
|
|
+ // let csvContent = "用户名 | 提交时间 | " + questions.map(q => `${q.序号}-${q.题目类型}-${q.题目}`).join(' | ') + "\n";
|
|
|
+ let csvContent = "用户名,提交时间," + questions.map(q => `${q.序号}-${q.题目类型}-${q.题目}`).join(",") + "\n";
|
|
|
+
|
|
|
+ // 添加每个用户的答案
|
|
|
+ array.forEach(i => {
|
|
|
+ let row = [i.name, i.time];
|
|
|
+ i.array.forEach(j => {
|
|
|
+ row.push(getAnswer(j));
|
|
|
+ });
|
|
|
+ // csvContent += row.join(' | ') + "\n";
|
|
|
+ csvContent += row.join(",") + "\n";
|
|
|
+ });
|
|
|
+
|
|
|
+ // 创建Blob对象
|
|
|
+ // const blob = new Blob([csvContent], { type: "text/plain;charset=utf-8" });
|
|
|
+ // blob.lastModifiedDate = new Date();
|
|
|
+ // blob.name = `${name}_表单数据.txt`;
|
|
|
+
|
|
|
+ // 创建Blob对象
|
|
|
+ const blob = new Blob([csvContent], { type: "text/csv;charset=utf-8" });
|
|
|
+ blob.lastModifiedDate = new Date();
|
|
|
+ blob.name = `${name}_表单数据.csv`;
|
|
|
+
|
|
|
+ // 如果仍需要上传文件,可以保留这行
|
|
|
+ return this.uploadFile({ file: blob, name: name });
|
|
|
+ },
|
|
|
+ getAiContent(_uid) {
|
|
|
+ this.fasource = new EventSource(
|
|
|
+ `https://gpt4.cocorobo.cn/stream/${_uid}`
|
|
|
+ ); //http://gpt4.cocorobo.cn:8011/stream/ https://gpt4.cocorobo.cn/stream/
|
|
|
+ let _allText = "";
|
|
|
+ let _mdText = "";
|
|
|
+ const md = new MarkdownIt();
|
|
|
+ this.fasource.onmessage = _e => {
|
|
|
+ if (_e.data.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
+ //对话已经完成
|
|
|
+ _mdText = _mdText.replace("_", "");
|
|
|
+ this.fasource.close();
|
|
|
+ this.fasource = null;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
+ });
|
|
|
+ this.array.find(i => i.uid == _uid).aiContent = _mdText;
|
|
|
+ this.array.find(i => i.uid == _uid).isalltext = true;
|
|
|
+ this.array.find(i => i.uid == _uid).isShowSynchronization = true;
|
|
|
+ this.array.find(i => i.uid == _uid).loading = false;
|
|
|
+ // 这里保存对话
|
|
|
+ if (this.courseId) {
|
|
|
+ this.insertChat(_uid);
|
|
|
+ }
|
|
|
+ return;
|
|
|
+ } else {
|
|
|
+ //对话还在继续
|
|
|
+ let _text = "";
|
|
|
+ _text = _e.data.replaceAll("'", "");
|
|
|
+ if (_allText == "") {
|
|
|
+ _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
|
|
|
+ } else {
|
|
|
+ _allText += _text;
|
|
|
+ }
|
|
|
+ _mdText = _allText + "_";
|
|
|
+ _mdText = _mdText.replace(/\\n/g, "\n");
|
|
|
+ _mdText = _mdText.replace(/\\/g, "");
|
|
|
+ if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
|
|
|
+ //转化返回的回复流数据
|
|
|
+ _mdText = md.render(_mdText);
|
|
|
+ this.array.find(i => i.uid == _uid).aiContent = _mdText;
|
|
|
+ this.array.find(i => i.uid == _uid).loading = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
+ });
|
|
|
+ // 处理流数据
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ getAtAuContent(_uid) {
|
|
|
+ this.fasource = new EventSource(
|
|
|
+ `https://gpt4.cocorobo.cn/question/${_uid}`
|
|
|
+ ); //http://gpt4.cocorobo.cn:8011/question/ https://gpt4.cocorobo.cn/question/
|
|
|
+ let _allText = "";
|
|
|
+ let _mdText = "";
|
|
|
+ const md = new MarkdownIt();
|
|
|
+ this.fasource.onmessage = _e => {
|
|
|
+ let _eData = JSON.parse(_e.data);
|
|
|
+ if (_eData.content.replace("'", "").replace("'", "") == "[DONE]") {
|
|
|
+ let _result = [];
|
|
|
+ if ("result" in _eData) {
|
|
|
+ _result = _eData.result;
|
|
|
+ for (let i = 0; i < _result.length; i++) {
|
|
|
+ _mdText = _mdText.replace(_result[i].text, _result[i].fileName);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ _mdText = _mdText.replace("_", "");
|
|
|
+ this.array.find(i => i.uid == _uid).aiContent = _mdText;
|
|
|
+ this.array.find(i => i.uid == _uid).isalltext = true;
|
|
|
+ this.array.find(i => i.uid == _uid).isShowSynchronization = true;
|
|
|
+ this.array.find(i => i.uid == _uid).loading = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
+ });
|
|
|
+ this.fasource.close();
|
|
|
+ this.fasource = null;
|
|
|
+ if (this.courseId) {
|
|
|
+ this.insertChat(_uid);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ let _text = _eData.content.replace("'", "").replace("'", "");
|
|
|
+ if (_allText == "") {
|
|
|
+ _allText = _text.replace(/^\n+/, ""); //去掉回复消息中偶尔开头就存在的连续换行符
|
|
|
+ } else {
|
|
|
+ _allText += _text;
|
|
|
+ }
|
|
|
+ _mdText = _allText + "_";
|
|
|
+ _mdText = _mdText.replace(/\\n/g, "\n");
|
|
|
+ _mdText = _mdText.replace(/\\/g, "");
|
|
|
+ if (_allText.split("```").length % 2 == 0) _mdText += "\n```\n";
|
|
|
+ //转化返回的回复流数据
|
|
|
+ _mdText = md.render(_mdText);
|
|
|
+ this.array.find(i => i.uid == _uid).aiContent = _mdText;
|
|
|
+ this.array.find(i => i.uid == _uid).loading = false;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
+ });
|
|
|
+ // 处理流数据
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ async getUserName() {
|
|
|
+ let params = { uid: this.userid };
|
|
|
+ try {
|
|
|
+ let res = await this.ajax.get(this.$store.state.api + "getUser", params);
|
|
|
+ this.username = res.data[0][0].name;
|
|
|
+ } catch (err) {
|
|
|
+ console.error(err);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //保存消息
|
|
|
+ async insertChat(_uid) {
|
|
|
+ let _data = this.array.find(i => i.uid == _uid);
|
|
|
+ this.saveUid = ''
|
|
|
+ this.faloading = false
|
|
|
+ if (!this.username) {
|
|
|
+ await this.getUserName()
|
|
|
+ }
|
|
|
+ if (!_data) return;
|
|
|
+ let params = {
|
|
|
+ userId: this.userid,
|
|
|
+ userName: this.username,
|
|
|
+ groupId: "602def61-005d-11ee-91d8-005056b8q12w",
|
|
|
+ answer: _data.aiContent,
|
|
|
+ problem: _data.content,
|
|
|
+ file_id: _data.fileid ? _data.fileid : "",
|
|
|
+ alltext: _data.aiContent,
|
|
|
+ type: "chat",
|
|
|
+ filename: _data.filename,
|
|
|
+ session_name: `${this.courseId}-${this.userid}-test` //这是对话记录位置
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .post("https://gpt4.cocorobo.cn/insert_chat", params)
|
|
|
+ .then(res => { });
|
|
|
+ },
|
|
|
+ // 获取对应的聊天记录
|
|
|
+ getChatList() {
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ if (this.loading) return;
|
|
|
+ this.array = [];
|
|
|
+ this.loading = true;
|
|
|
+ let params = {
|
|
|
+ userid: this.userid,
|
|
|
+ groupid: "602def61-005d-11ee-91d8-005056b8q12w",
|
|
|
+ // session_name:``
|
|
|
+ session_name: `${this.courseId}-${this.userid}-test`
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .post("https://gpt4.cocorobo.cn/get_agent_park_chat", params)
|
|
|
+ .then(res => {
|
|
|
+ let _data = JSON.parse(res.data.FunctionResponse);
|
|
|
+ console.log("data", _data);
|
|
|
+ if (_data.length > 0) {
|
|
|
+ let _chatList = [];
|
|
|
+ for (let i = 0; i < _data.length; i++) {
|
|
|
+ _chatList.push({
|
|
|
+ loading: false,
|
|
|
+ role: "user",
|
|
|
+ content: _data[i].problem,
|
|
|
+ uid: _data[i].id,
|
|
|
+ AI: "AI",
|
|
|
+ aiContent: _data[i].answer,
|
|
|
+ oldContent: _data[i].answer,
|
|
|
+ isShowSynchronization: false,
|
|
|
+ filename: _data[i].filename,
|
|
|
+ index: i,
|
|
|
+ is_mind_map: false,
|
|
|
+ fileid: _data[i].fileid,
|
|
|
+ createtime: _data[i].createtime
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.array = _chatList;
|
|
|
+ this.loading = false;
|
|
|
+ } else {
|
|
|
+ let _uid = uuidv4();
|
|
|
+ let _chatList = [];
|
|
|
+ _chatList.push({
|
|
|
+ loading: false,
|
|
|
+ role: "",
|
|
|
+ content: "",
|
|
|
+ uid: _uid,
|
|
|
+ AI: "AI",
|
|
|
+ aiContent:
|
|
|
+ "选择需要分析的数据,我将为您分析:",
|
|
|
+ oldContent:
|
|
|
+ "选择需要分析的数据,我将为您分析:",
|
|
|
+ isShowSynchronization: false,
|
|
|
+ filename: "",
|
|
|
+ index: 0,
|
|
|
+ is_mind_map: false,
|
|
|
+ fileid: ""
|
|
|
+ });
|
|
|
+ this.array = _chatList;
|
|
|
+ if (this.courseId) {
|
|
|
+ this.insertChat(_uid);
|
|
|
+ }
|
|
|
+ //没有对话记录
|
|
|
+ this.loading = false;
|
|
|
+ }
|
|
|
+ resolve();
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ console.log(err);
|
|
|
+ this.$message.error("获取对话记录失败");
|
|
|
+ this.loading = false;
|
|
|
+ resolve();
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ addTask(index) {
|
|
|
+ if (this.checkArray.indexOf(index) !== -1) {
|
|
|
+ this.checkArray.splice(this.checkArray.indexOf(index), 1);
|
|
|
+ } else {
|
|
|
+ this.checkArray.push(index);
|
|
|
+ }
|
|
|
+ console.log(index);
|
|
|
+ },
|
|
|
+ addAllTask() {
|
|
|
+ if (this.checkArray.length === this.course.length) {
|
|
|
+ this.checkArray = [];
|
|
|
+ } else {
|
|
|
+ this.checkArray = [];
|
|
|
+ this.course.forEach((item, index) => {
|
|
|
+ this.checkArray.push(index);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
+ tableRowClassName2({ row, rowIndex }) {
|
|
|
+ if ((rowIndex + 1) % 2 === 0) {
|
|
|
+ return "rowClass";
|
|
|
+ } else {
|
|
|
+ return "rowClass";
|
|
|
+ }
|
|
|
+ },
|
|
|
+ checkPart(name) {
|
|
|
+ this.part = name;
|
|
|
+ },
|
|
|
+ inputChange() {
|
|
|
+ if (this.courseText.at(-1) == "@") {
|
|
|
+ // this.showRoleList = true;
|
|
|
+ }
|
|
|
+ if (this.courseText.at(-1) == "/") {
|
|
|
+ console.log("哇卡ka2");
|
|
|
+ }
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.textareaRef.style.height = "35px";
|
|
|
+ this.$refs.textareaRef.style.height =
|
|
|
+ this.$refs.textareaRef.scrollHeight + "px";
|
|
|
+ this.textareaHeight = this.$refs.textareaRef.style.height;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ textareaKeydown(_e) {
|
|
|
+ if (this.showRoleList && this.choseRoleList.length > 0) {
|
|
|
+ console.log(_e.keyCode);
|
|
|
+ switch (_e.keyCode) {
|
|
|
+ case 38: //小键盘上
|
|
|
+ _e.preventDefault();
|
|
|
+ if (this.choseRoleItem == 0) return;
|
|
|
+ this.choseRoleItem--;
|
|
|
+ // 修改滚动条高度
|
|
|
+ this.$refs.roleListRef.scrollTo({
|
|
|
+ top:
|
|
|
+ this.$refs[`roleItem${this.choseRoleItem}Ref`][0].offsetTop -
|
|
|
+ 10,
|
|
|
+ behavior: "smooth"
|
|
|
+ });
|
|
|
+ // this.$refs.roleListRef.scrollTop = this.choseRoleItem * 107;
|
|
|
+ break;
|
|
|
+ case 40: //小键盘下
|
|
|
+ _e.preventDefault();
|
|
|
+ if (this.choseRoleItem == this.choseRoleList.length - 1) return;
|
|
|
+ this.choseRoleItem++;
|
|
|
+ this.$refs.roleListRef.scrollTo({
|
|
|
+ top:
|
|
|
+ this.$refs[`roleItem${this.choseRoleItem}Ref`][0].offsetTop -
|
|
|
+ 10,
|
|
|
+ behavior: "smooth"
|
|
|
+ });
|
|
|
+ // this.$refs.roleListRef.scrollTop = this.choseRoleItem * 107;
|
|
|
+ break;
|
|
|
+ case 13: //回车
|
|
|
+ _e.preventDefault();
|
|
|
+ this.choseRole(this.choseRoleList[this.choseRoleItem]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ } else if (_e.key === "Enter") {
|
|
|
+ _e.preventDefault();
|
|
|
+ if (_e.shiftKey) {
|
|
|
+ this.courseText += "\n";
|
|
|
+ } else {
|
|
|
+ this.addContent();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ clear() {
|
|
|
+ this.$confirm("确定清空聊天记录吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(_ => {
|
|
|
+ this.loading = true;
|
|
|
+ let params = {
|
|
|
+ user_id: this.userid,
|
|
|
+ id: "602def61-005d-11ee-91d8-005056b8q12w",
|
|
|
+ session_name: `${this.courseId}-${this.userid}-test`
|
|
|
+ };
|
|
|
+
|
|
|
+ this.ajax
|
|
|
+ .post("https://gpt4.cocorobo.cn/delete_park_session", params)
|
|
|
+ .then(res => {
|
|
|
+ this.array = [];
|
|
|
+ this.$message.success("清除聊天记录成功");
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ .catch(err => {
|
|
|
+ this.loading = false;
|
|
|
+ this.$message.error("清除聊天记录失败");
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(_ => { });
|
|
|
+ },
|
|
|
+ getRoleList() {
|
|
|
+ this.roleList = [];
|
|
|
+ let params = {
|
|
|
+ userId: this.userid
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .post("https://gpt4.cocorobo.cn/get_ai_agent_assistant_list", params)
|
|
|
+ .then(res => {
|
|
|
+ let _data = res.data.FunctionResponse.result;
|
|
|
+ if (_data) {
|
|
|
+ this.roleList = JSON.parse(_data);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ // this.$message.error("获取角色列表失败");
|
|
|
+ this.roleList = [];
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getPublicRoleList() {
|
|
|
+ this.publicRoleList = [];
|
|
|
+ let params = {
|
|
|
+ userId: this.userid,
|
|
|
+ organizeid: this.oid
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .post(
|
|
|
+ "https://gpt4.cocorobo.cn/get_ai_agent_assistant_share_list",
|
|
|
+ params
|
|
|
+ )
|
|
|
+ .then(res => {
|
|
|
+ let _data = res.data.FunctionResponse.result;
|
|
|
+ if (_data) {
|
|
|
+ this.publicRoleList = JSON.parse(_data);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ this.publicRoleList = [];
|
|
|
+ console.log(e);
|
|
|
+ // console.log("获取公共角色失败", e);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ choseRole(item) {
|
|
|
+ let _lastAtIndex = this.courseText.lastIndexOf("@");
|
|
|
+ this.courseText = `${this.courseText.slice(0, _lastAtIndex)}@${item.assistantName
|
|
|
+ } `;
|
|
|
+ this.$refs.textareaRef.focus();
|
|
|
+ this.showRoleList = false;
|
|
|
+ },
|
|
|
+ onCopy(content) {
|
|
|
+ const turndownService = new TurndownService();
|
|
|
+ // 添加自定义规则来处理表格
|
|
|
+ turndownService.addRule("table", {
|
|
|
+ filter: "table",
|
|
|
+ replacement: (content, node) => {
|
|
|
+ const rows = node.querySelectorAll("tr");
|
|
|
+ let markdown = "";
|
|
|
+
|
|
|
+ rows.forEach(row => {
|
|
|
+ const cells = row.querySelectorAll("th, td");
|
|
|
+ const rowMarkdown = Array.from(cells)
|
|
|
+ .map(cell => cell.textContent)
|
|
|
+ .join(" | ");
|
|
|
+ markdown += `| ${rowMarkdown} |\n`;
|
|
|
+ if (cells && cells.length && cells[0].tagName == "TH") {
|
|
|
+ let a = Array.from(cells)
|
|
|
+ .map(cell => "")
|
|
|
+ .join(" --- |");
|
|
|
+ markdown += `| --- |${a}\n`;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ // 添加分隔行
|
|
|
+ // markdown = markdown.replace(/^/, '| --- |\n');
|
|
|
+ return markdown;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 创建临时textarea元素
|
|
|
+ const tempInput = document.createElement("textarea");
|
|
|
+
|
|
|
+ tempInput.value = turndownService.turndown(content); // 设置要复制的内容
|
|
|
+ // 隐藏元素
|
|
|
+ tempInput.style.position = "absolute";
|
|
|
+ tempInput.style.left = "-9999px";
|
|
|
+ // 将元素添加到DOM中
|
|
|
+ document.body.appendChild(tempInput);
|
|
|
+ // 选中元素内容
|
|
|
+ tempInput.select();
|
|
|
+ // 执行复制操作
|
|
|
+ document.execCommand("copy");
|
|
|
+ // 移除临时元素
|
|
|
+ document.body.removeChild(tempInput);
|
|
|
+ this.$message({
|
|
|
+ message: "复制成功",
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
+ },
|
|
|
+ stopSend() {
|
|
|
+ if (this.fasource) {
|
|
|
+ this.fasource.close();
|
|
|
+ if (this.array[this.array.length - 1].content == "wanSearch") {
|
|
|
+ this.array.pop();
|
|
|
+ }
|
|
|
+ this.array.find(i => i.uid == this.saveUid).loading = false;
|
|
|
+ this.faloading = false;
|
|
|
+ this.fasource = null;
|
|
|
+ this.insertChat(this.saveUid);
|
|
|
+ } else if (this.stopTalkToken) {
|
|
|
+ this.stopTalkToken.cancel("Request canceled by the user.");
|
|
|
+ this.array = this.array.filter(i => i.uid !== this.saveUid);
|
|
|
+ this.stopTalkToken = null;
|
|
|
+ this.faloading = false;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ changeVoice(flag) {
|
|
|
+ this.isVoice = flag;
|
|
|
+ },
|
|
|
+ startVoice() {
|
|
|
+ let iiframe = this.$refs["iiframe"];
|
|
|
+ iiframe.contentWindow.window.document.getElementById(
|
|
|
+ "languageOptions"
|
|
|
+ ).selectedIndex = 2; //普通话
|
|
|
+ iiframe.contentWindow.testdoContinuousPronunciationAssessment();
|
|
|
+ this.isTalk = true;
|
|
|
+ iiframe.contentWindow.onRecognizedResult = e => {
|
|
|
+ let _msg = e.privText;
|
|
|
+ console.log(_msg);
|
|
|
+ if (_msg) this.courseText += _msg;
|
|
|
+ };
|
|
|
+ },
|
|
|
+ stopVoice() {
|
|
|
+ try {
|
|
|
+ if (!this.isTalk) return this.$message.info("请先开始录音");
|
|
|
+ let iiframe = this.$refs["iiframe"];
|
|
|
+ iiframe.contentWindow.window.document
|
|
|
+ .getElementById("scenarioStopButton")
|
|
|
+ .click();
|
|
|
+ iiframe.contentWindow.onSessionStopped = (s, e) => {
|
|
|
+ this.isTalk = false;
|
|
|
+ if (this.courseText) {
|
|
|
+ this.addContent();
|
|
|
+ }
|
|
|
+ };
|
|
|
+ } catch (error) {
|
|
|
+ console.log(error);
|
|
|
+ this.isTalk = false;
|
|
|
+ if (this.courseText) {
|
|
|
+ this.addContent();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ pan() {
|
|
|
+ return content => {
|
|
|
+ try {
|
|
|
+ return JSON.parse(content);
|
|
|
+ } catch (error) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ getLook() {
|
|
|
+ return function (item) {
|
|
|
+ let content = "";
|
|
|
+ if (item.look == '1') {
|
|
|
+ content = '未发布'
|
|
|
+ }
|
|
|
+ let now = new Date().getTime()
|
|
|
+ let isTime = item.over_at && new Date(item.over_at).getTime()
|
|
|
+ if (item.over_at && item.look == '2' && now > isTime && ((item.isUserCount > 0 && item.isUserCount > item.worksPerson) || item.isUserCount == 0)) {
|
|
|
+ content = '逾期'
|
|
|
+ }
|
|
|
+
|
|
|
+ if (((item.over_at && item.look == '2' && isTime > now) || (!item.over_at && item.look == '2')) && ((item.isUserCount == 0 && item.worksPerson > 0) || (item.isUserCount > 0 && 0 < item.worksPerson && item.worksPerson < item.isUserCount))) {
|
|
|
+ content = '进行中'
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (((item.over_at && item.look == '2' && isTime > now) || (!item.over_at && item.look == '2')) && item.worksPerson == 0) {
|
|
|
+ content = '未进行'
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.look == '2' && (item.isUserCount > 0 && item.isUserCount <= item.worksPerson)) {
|
|
|
+ content = '已完成'
|
|
|
+ }
|
|
|
+ return content;
|
|
|
+ };
|
|
|
+ },
|
|
|
+ getLookType() {
|
|
|
+ return function (item) {
|
|
|
+ let content = "";
|
|
|
+ if (item.look == '1') {
|
|
|
+ // content = '未发布'
|
|
|
+ content = 'no'
|
|
|
+ }
|
|
|
+ let now = new Date().getTime()
|
|
|
+ let isTime = item.over_at && new Date(item.over_at).getTime()
|
|
|
+ if (item.over_at && item.look == '2' && now > isTime && ((item.isUserCount > 0 && item.isUserCount > item.worksPerson) || item.isUserCount == 0)) {
|
|
|
+ // content = '逾期'
|
|
|
+ content = 'noTime'
|
|
|
+ }
|
|
|
+
|
|
|
+ if (((item.over_at && item.look == '2' && isTime > now) || (!item.over_at && item.look == '2')) && ((item.isUserCount == 0 && item.worksPerson > 0) || (item.isUserCount > 0 && 0 < item.worksPerson && item.worksPerson < item.isUserCount))) {
|
|
|
+ // content = '进行中'
|
|
|
+ content = 'doing'
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (((item.over_at && item.look == '2' && isTime > now) || (!item.over_at && item.look == '2')) && item.worksPerson == 0) {
|
|
|
+ // content = '未进行'
|
|
|
+ content = 'nodo'
|
|
|
+ }
|
|
|
+
|
|
|
+ if (item.look == '2' && (item.isUserCount > 0 && item.isUserCount <= item.worksPerson)) {
|
|
|
+ // content = '已完成'
|
|
|
+ content = 'is'
|
|
|
+ }
|
|
|
+ return content;
|
|
|
+ };
|
|
|
+ },
|
|
|
+ courseTextLength() {
|
|
|
+ return this.courseText.length;
|
|
|
+ },
|
|
|
+ taskName() {
|
|
|
+ let task = "";
|
|
|
+ if (this.checkArray.length) {
|
|
|
+ task = "任务";
|
|
|
+ this.checkArray = this.checkArray.sort((a, b) => a - b);
|
|
|
+ let a = JSON.parse(JSON.stringify(this.checkArray));
|
|
|
+ for (let index = 0; index < a.length; index++) {
|
|
|
+ a[index]++;
|
|
|
+ }
|
|
|
+ task += a.join("/");
|
|
|
+ }
|
|
|
+ return task + " " + this.part;
|
|
|
+ },
|
|
|
+ choseRoleList() {
|
|
|
+ let result = [...this.roleList, ...this.publicRoleList];
|
|
|
+ const _index = this.courseText.lastIndexOf("@");
|
|
|
+ if (_index !== -1) {
|
|
|
+ let roleName = this.courseText.substring(_index + 1);
|
|
|
+ result = result.filter(i => i.assistantName.indexOf(roleName) != -1);
|
|
|
+ } else {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ this.choseRoleItem = 0;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ // this.getChatList().then(_ => {
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // console.log(this.$refs.chatDialog.scrollHeight);
|
|
|
+ // this.$refs.chatDialog.scrollTop = this.$refs.chatDialog.scrollHeight;
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ // if(this.worksArray.length){
|
|
|
+ // this.worksArray.forEach(el=>{
|
|
|
+ // this.setJson(el)
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ this.getRoleList();
|
|
|
+ this.getPublicRoleList();
|
|
|
+ // this.selectTestType();
|
|
|
+ // 添加初始消息
|
|
|
+ this.array.push({
|
|
|
+ uid: uuidv4(), // 生成唯一 ID
|
|
|
+ aiContent: "选择需要分析的数据,我将为您分析:", // 初始消息内容
|
|
|
+ content: "", // 用户内容为空
|
|
|
+ loading: false // 不加载
|
|
|
+ });
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.ai_body {
|
|
|
+ /* height: calc(100% - 158px - 46px);
|
|
|
+ width: 500px; */
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ /* margin: 0 auto; */
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ /* position: fixed; */
|
|
|
+ /* z-index: 999; */
|
|
|
+ background: #fff;
|
|
|
+ /* right: 30px; */
|
|
|
+ /* bottom: 10px; */
|
|
|
+ padding: 10px 20px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ /* box-shadow: 0 0 5px 2px #00000045;
|
|
|
+ border-radius: 5px; */
|
|
|
+}
|
|
|
+
|
|
|
+.binfo_input {
|
|
|
+ width: 100%;
|
|
|
+ margin: 0;
|
|
|
+ padding: 12px 14px;
|
|
|
+ display: block;
|
|
|
+ min-width: 0;
|
|
|
+ outline: none;
|
|
|
+ box-sizing: border-box;
|
|
|
+ background: none;
|
|
|
+ border: none;
|
|
|
+ border-radius: 4px;
|
|
|
+ background: #fff;
|
|
|
+ font-size: 14px;
|
|
|
+ resize: none;
|
|
|
+ font-family: "Microsoft YaHei";
|
|
|
+ min-height: 48px;
|
|
|
+ /* border: 1px solid #3682fc00; */
|
|
|
+ border: 1.5px solid #cad1dc;
|
|
|
+}
|
|
|
+
|
|
|
+.binfo_textarea {
|
|
|
+ border: 1.5px solid #cad1dc;
|
|
|
+ font-size: 14px;
|
|
|
+ resize: none;
|
|
|
+ /* background: #f6f6f6; */
|
|
|
+ font-family: "Microsoft YaHei";
|
|
|
+}
|
|
|
+
|
|
|
+.binfo_textarea::-webkit-scrollbar {
|
|
|
+ /*滚动条整体样式*/
|
|
|
+ width: 6px;
|
|
|
+ /*高宽分别对应横竖滚动条的尺寸*/
|
|
|
+ height: 6px;
|
|
|
+}
|
|
|
+
|
|
|
+/*定义滚动条轨道 内阴影+圆角*/
|
|
|
+.binfo_textarea::-webkit-scrollbar-track {
|
|
|
+ border-radius: 10px;
|
|
|
+ background-color: rgba(0, 0, 0, 0.1);
|
|
|
+}
|
|
|
+
|
|
|
+/*定义滑块 内阴影+圆角*/
|
|
|
+.binfo_textarea::-webkit-scrollbar-thumb {
|
|
|
+ border-radius: 10px;
|
|
|
+ -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);
|
|
|
+ background-color: rgba(0, 0, 0, 0.1);
|
|
|
+}
|
|
|
+
|
|
|
+.binfo_input:focus-visible {
|
|
|
+ border: 1.5px solid #3681fc !important;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_input {
|
|
|
+ position: relative;
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+ margin-top: auto;
|
|
|
+ width: 100%;
|
|
|
+ /* height: auto; */
|
|
|
+ /* max-height: 80vh; */
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: flex-end;
|
|
|
+ border-radius: 10px;
|
|
|
+ border: 1.5px solid #3681fc !important;
|
|
|
+ /* padding: 10px;
|
|
|
+ padding-top: 20px; */
|
|
|
+ /* overflow: auto; */
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_btnArea {
|
|
|
+ width: calc(100% - 10px);
|
|
|
+ position: absolute;
|
|
|
+ bottom: calc(100% + 5px);
|
|
|
+ height: 30px;
|
|
|
+ display: flex;
|
|
|
+ /* justify-content: space-between; */
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_btnArea>div {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_btnArea>div>span {
|
|
|
+ margin-left: 5px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_btnArea>.clear+.clear {
|
|
|
+ margin-left: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_btnArea>.clear {
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 5px 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ cursor: pointer;
|
|
|
+ border: solid 1px #3781fb;
|
|
|
+ border-radius: 15px;
|
|
|
+ display: flex;
|
|
|
+ font-size: 15px;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_btnArea>.clear>svg {
|
|
|
+ width: 17px;
|
|
|
+ height: 17px;
|
|
|
+ margin-right: 5px;
|
|
|
+ fill: black;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_btnArea>.clear:hover {
|
|
|
+ background-color: #ebf4fe;
|
|
|
+ color: #409eff;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_btnArea>.clear:hover>svg {
|
|
|
+ fill: #409eff;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_textListBox {
|
|
|
+ width: 100%;
|
|
|
+ height: 300px;
|
|
|
+ background-color: #fff;
|
|
|
+ position: absolute;
|
|
|
+ bottom: calc(100% + 5px);
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 10px;
|
|
|
+ overflow: auto;
|
|
|
+ border-radius: 8px;
|
|
|
+ border: 1px solid #e7e7e7;
|
|
|
+ box-shadow: 0 4px 10px 0 rgba(29, 57, 131, 0.08),
|
|
|
+ 1px 1px 20px 4px rgba(29, 57, 131, 0.05);
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_tlb_left {
|
|
|
+ width: 60px;
|
|
|
+ height: 100%;
|
|
|
+ background-color: red;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_tlb_right {
|
|
|
+ flex: 1;
|
|
|
+ height: 100%;
|
|
|
+ background-color: yellow;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_roleListBox {
|
|
|
+ width: 100%;
|
|
|
+ height: 300px;
|
|
|
+ background-color: #fff;
|
|
|
+ position: absolute;
|
|
|
+ bottom: calc(100% + 5px);
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 10px;
|
|
|
+ overflow: auto;
|
|
|
+ border-radius: 8px;
|
|
|
+ border: 1px solid #e7e7e7;
|
|
|
+ box-shadow: 0 4px 10px 0 rgba(29, 57, 131, 0.08),
|
|
|
+ 1px 1px 20px 4px rgba(29, 57, 131, 0.05);
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_rlb_item {
|
|
|
+ width: calc(100% - 20px);
|
|
|
+ height: auto;
|
|
|
+ padding: 10px;
|
|
|
+ background-color: #f3f7fd;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ border-radius: 8px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ transition: 0.3s;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_rlb_itemActive {
|
|
|
+ background-color: #d1d5db !important;
|
|
|
+}
|
|
|
+
|
|
|
+/* .ai_b_i_rlb_item:hover{
|
|
|
+ background-color: #d1d5db;
|
|
|
+} */
|
|
|
+
|
|
|
+.ai_b_i_rlb_itemTop {
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_rlb_itemTop>img {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ margin-right: 10px;
|
|
|
+ border-radius: 100%;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_rlb_itemTop>div {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_rlb_itemTop>div>span {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_rlb_itemTop>div>span:last-child {
|
|
|
+ font-size: 14px;
|
|
|
+ color: #999;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_rlb_itemBottom {
|
|
|
+ margin-top: 10px;
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_rlb_itemBottom>span {
|
|
|
+ width: 60px;
|
|
|
+ height: 30px;
|
|
|
+ border-radius: 15px;
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_input_textarea {
|
|
|
+ flex: 1;
|
|
|
+ margin: 10px 5px 10px 5px;
|
|
|
+ min-height: 35px;
|
|
|
+ height: 35px;
|
|
|
+ max-height: 100px;
|
|
|
+ border: none;
|
|
|
+ outline: none;
|
|
|
+ resize: none;
|
|
|
+ font-size: 16px;
|
|
|
+ overflow: auto;
|
|
|
+ padding-right: 100px;
|
|
|
+ background-color: #fff !important;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_input_textarea::-webkit-input-placeholder {
|
|
|
+ font-size: 16px;
|
|
|
+ /* 修改placeholder字体大小 */
|
|
|
+ color: grey;
|
|
|
+ /* 修改placeholder文字颜色 */
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_input_textarea::-moz-placeholder {
|
|
|
+ font-size: 16px;
|
|
|
+ /* 修改placeholder字体大小 */
|
|
|
+ color: grey;
|
|
|
+ /* 修改placeholder文字颜色 */
|
|
|
+ opacity: 1;
|
|
|
+ /* 修复Firefox的透明度问题 */
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_input_textarea::-moz-placeholder {
|
|
|
+ font-size: 16px;
|
|
|
+ /* 修改placeholder字体大小 */
|
|
|
+ color: grey;
|
|
|
+ /* 修改placeholder文字颜色 */
|
|
|
+ opacity: 1;
|
|
|
+ /* 修复Firefox的透明度问题 */
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_input_textarea::-ms-input-placeholder {
|
|
|
+ font-size: 16px;
|
|
|
+ /* 修改placeholder字体大小 */
|
|
|
+ color: grey;
|
|
|
+ /* 修改placeholder文字颜色 */
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_input_textarea::-webkit-scrollbar {
|
|
|
+ width: 6px;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_input_textarea::-webkit-scrollbar-track {
|
|
|
+ background: #d8d9dc;
|
|
|
+ border-radius: 2px;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_input_textarea::-webkit-scrollbar-thumb {
|
|
|
+ background: #c9c9c9;
|
|
|
+ border-radius: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_input_textarea::-webkit-scrollbar-thumb:hover {
|
|
|
+ background: #c9c9c9;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_diy {
|
|
|
+ position: fixed;
|
|
|
+ top: 45%;
|
|
|
+ left: 50%;
|
|
|
+ transform: translate(-50%, -50%) !important;
|
|
|
+ z-index: 1000;
|
|
|
+ width: 150vw;
|
|
|
+ height: 100vh;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_diy>>>.el-dialog__header {
|
|
|
+ background: #454545 !important;
|
|
|
+ padding: 15px 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_diy>>>.el-dialog__header>span {
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_diy .el-dialog__header .el-dialog__title {
|
|
|
+ color: #fff !important;
|
|
|
+ /* 替换为您想要的颜色 */
|
|
|
+ line-height: 14px;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+
|
|
|
+.c_pub_button_confirm {
|
|
|
+ /* position: absolute;
|
|
|
+ bottom: 13px;
|
|
|
+ right: 13px; */
|
|
|
+ /* margin-top: 10px; */
|
|
|
+ width: 60px;
|
|
|
+ margin-right: 5px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ position: absolute;
|
|
|
+ right: 10px;
|
|
|
+ bottom: 0px;
|
|
|
+ white-space: nowrap;
|
|
|
+ border-radius: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.c_pub_button_confirmVoice {
|
|
|
+ width: 30px;
|
|
|
+ height: 36px;
|
|
|
+ min-width: auto;
|
|
|
+ margin-right: 5px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ position: absolute;
|
|
|
+ right: 10px;
|
|
|
+ bottom: 0px;
|
|
|
+ white-space: nowrap;
|
|
|
+ border-radius: 10px;
|
|
|
+ background-color: #3681fc;
|
|
|
+ cursor: pointer;
|
|
|
+ padding: 0 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.c_pub_button_confirmVoice>svg {
|
|
|
+ fill: #fff;
|
|
|
+ width: 25px;
|
|
|
+ height: 25px;
|
|
|
+}
|
|
|
+
|
|
|
+.c_pub_button_StopConfirmVoice {
|
|
|
+ width: 30px;
|
|
|
+ height: 36px;
|
|
|
+ min-width: auto;
|
|
|
+ margin-right: 5px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ position: absolute;
|
|
|
+ right: 10px;
|
|
|
+ bottom: 0px;
|
|
|
+ white-space: nowrap;
|
|
|
+ border-radius: 10px;
|
|
|
+ background-color: #dde2e2;
|
|
|
+ cursor: pointer;
|
|
|
+ padding: 0 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.c_pub_button_StopConfirmVoice>svg {
|
|
|
+ width: 25px;
|
|
|
+ height: 25px;
|
|
|
+}
|
|
|
+
|
|
|
+.c_voiceBtn {
|
|
|
+ width: 25px;
|
|
|
+ height: 25px;
|
|
|
+ position: absolute;
|
|
|
+ right: 85px;
|
|
|
+ bottom: 0px;
|
|
|
+ margin-bottom: 17px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.c_voiceBtn>svg {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.c_pub_button_confirmDisabled {
|
|
|
+ background-color: #aeccfe;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_dialog {
|
|
|
+ padding: 10px 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ /* min-height: calc(20vh - 10px); */
|
|
|
+ /* height: calc(100%); */
|
|
|
+ overflow: auto;
|
|
|
+ margin-bottom: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_content {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_content>div {
|
|
|
+ display: flex;
|
|
|
+ align-items: flex-start;
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_content+.dialog_content {
|
|
|
+ margin: 15px 0;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_content>div .right {
|
|
|
+ flex-direction: row-reverse;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_content>div .right .role {
|
|
|
+ margin-right: 0;
|
|
|
+ margin-left: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_content>div .role {
|
|
|
+ min-width: 30px;
|
|
|
+ width: 30px;
|
|
|
+ height: 30px;
|
|
|
+ margin-right: 10px;
|
|
|
+ border-radius: 50%;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_content>div .role>img {
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ border-radius: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_content>div .content {
|
|
|
+ padding: 10px 10px;
|
|
|
+ border-radius: 2px 8px 8px 8px;
|
|
|
+ width: auto;
|
|
|
+ word-break: break-word;
|
|
|
+ box-sizing: border-box;
|
|
|
+ /* white-space: pre-line; */
|
|
|
+ max-width: calc(100% - 85px);
|
|
|
+ background: #f6f9ff;
|
|
|
+ /* overflow: hidden; */
|
|
|
+ margin: 0 10px;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.createTime {
|
|
|
+ width: 100%;
|
|
|
+ height: 20px;
|
|
|
+ position: absolute;
|
|
|
+ bottom: -25px;
|
|
|
+ left: 0;
|
|
|
+ font-size: 14px;
|
|
|
+ white-space: nowrap;
|
|
|
+ color: #919191;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_content>div .content2 {
|
|
|
+ background: #3681fc;
|
|
|
+ color: #fff;
|
|
|
+ border-radius: 8px 2px 8px 8px;
|
|
|
+ margin-left: auto;
|
|
|
+}
|
|
|
+
|
|
|
+.custom-div {
|
|
|
+ margin: 20px;
|
|
|
+ width: 154px;
|
|
|
+ height: 211px;
|
|
|
+ border: 2px solid #4398f1;
|
|
|
+ box-shadow: 0px 5px 10px rgba(128, 128, 128, 0.5);
|
|
|
+ cursor: pointer;
|
|
|
+ border-radius: 5px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ flex-direction: column;
|
|
|
+}
|
|
|
+
|
|
|
+.custom-div.active {
|
|
|
+ border: 2px solid blue;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog_contentArea {
|
|
|
+ max-height: 70vh;
|
|
|
+ /* 设置内容区域的最大高度 */
|
|
|
+ overflow-y: auto;
|
|
|
+ /* 允许垂直滚动 */
|
|
|
+ padding-left: 20px;
|
|
|
+ padding-right: 20px;
|
|
|
+}
|
|
|
+
|
|
|
+.custom-icon {
|
|
|
+ background: url('../../../../assets/icon/test/test_upload.png') no-repeat;
|
|
|
+ width: 142px;
|
|
|
+ height: 142px;
|
|
|
+ display: inline-block;
|
|
|
+ background-size: contain
|
|
|
+}
|
|
|
+
|
|
|
+.tableClass {
|
|
|
+ margin-top: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.is {
|
|
|
+ color: rgb(57, 204, 127);
|
|
|
+ background-color: rgba(57, 204, 127, .1);
|
|
|
+}
|
|
|
+
|
|
|
+.no {
|
|
|
+ color: rgb(235, 154, 96);
|
|
|
+ background-color: rgba(235, 154, 96, .1);
|
|
|
+}
|
|
|
+
|
|
|
+.noTime {
|
|
|
+ color: rgb(77, 77, 77);
|
|
|
+ background-color: rgba(77, 77, 77, .1);
|
|
|
+}
|
|
|
+
|
|
|
+.doing {
|
|
|
+ color: rgb(54, 116, 231);
|
|
|
+ background-color: rgba(54, 116, 231, .1);
|
|
|
+}
|
|
|
+
|
|
|
+.nodo {
|
|
|
+ color: rgb(97, 184, 255);
|
|
|
+ background-color: rgba(97, 184, 255, .1);
|
|
|
+}
|
|
|
+
|
|
|
+.test_type2 {
|
|
|
+ font-size: 14px;
|
|
|
+ border-radius: 5px;
|
|
|
+ /* border: 1.5px solid; */
|
|
|
+ padding: 3px 8px;
|
|
|
+}
|
|
|
+
|
|
|
+.confirm_btn {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ margin-top: 15px;
|
|
|
+}
|
|
|
+
|
|
|
+.student_head {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ align-items: baseline;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ padding: 0 0 0;
|
|
|
+}
|
|
|
+
|
|
|
+.choose {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: wrap;
|
|
|
+ align-content: space-between;
|
|
|
+ height: 100%;
|
|
|
+ justify-content: flex-start;
|
|
|
+ /* width: 60%; */
|
|
|
+ /* min-width: 868px; */
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.choose>div {
|
|
|
+ /* margin-left: 10px; */
|
|
|
+ width: 180px;
|
|
|
+ /* margin-top: 15px; */
|
|
|
+}
|
|
|
+
|
|
|
+.choose>div+div {
|
|
|
+ margin-left: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.choose>.clear {
|
|
|
+ width: 70px
|
|
|
+}
|
|
|
+
|
|
|
+.student_search {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ /* width: calc(100% / 3); */
|
|
|
+ width: 190px;
|
|
|
+}
|
|
|
+
|
|
|
+.head_left {
|
|
|
+ display: flex;
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+.student_input>>>.el-input__inner {
|
|
|
+ height: 40px;
|
|
|
+ width: 190px;
|
|
|
+ font-size: 13px;
|
|
|
+ padding: 0 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.serach_icon {
|
|
|
+ position: absolute;
|
|
|
+ right: 12px;
|
|
|
+ top: 50%;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ width: 13px;
|
|
|
+ height: 13px;
|
|
|
+ background: url("../../../../assets/icon/test/test_search.png") no-repeat;
|
|
|
+ background-size: 100% 100%;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select {
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.check {
|
|
|
+ background: #e7e7e7;
|
|
|
+ display: flex;
|
|
|
+ width: fit-content;
|
|
|
+ padding: 0 10px;
|
|
|
+ height: 30px;
|
|
|
+ border-radius: 21px;
|
|
|
+ font-size: 14px;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ color: #0061ff;
|
|
|
+ font-weight: 700;
|
|
|
+ margin: 10px 0;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.check::before {
|
|
|
+ content: "";
|
|
|
+ width: 15px;
|
|
|
+ height: 15px;
|
|
|
+ display: block;
|
|
|
+ background-image: url("../../../../assets/icon/course/aiPart.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.check::after {
|
|
|
+ content: "";
|
|
|
+ width: 15px;
|
|
|
+ height: 15px;
|
|
|
+ display: block;
|
|
|
+ background-image: url("../../../../assets/icon/course/aiPart_arrow.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.isCheck {
|
|
|
+ background: #0061ff;
|
|
|
+ display: flex;
|
|
|
+ width: fit-content;
|
|
|
+ padding: 0 10px;
|
|
|
+ height: 30px;
|
|
|
+ border-radius: 21px;
|
|
|
+ font-size: 14px;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ color: #fff;
|
|
|
+ font-weight: 700;
|
|
|
+ margin: 10px 0;
|
|
|
+ cursor: pointer;
|
|
|
+ max-width: 100%;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.isCheck>span {
|
|
|
+ width: calc(100% - 40px);
|
|
|
+ display: block;
|
|
|
+ overflow: hidden;
|
|
|
+ white-space: nowrap;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.isCheck::before {
|
|
|
+ content: "";
|
|
|
+ width: 15px;
|
|
|
+ height: 15px;
|
|
|
+ display: block;
|
|
|
+ background-image: url("../../../../assets/icon/course/aiPart_active.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.isCheck::after {
|
|
|
+ content: "";
|
|
|
+ width: 15px;
|
|
|
+ height: 15px;
|
|
|
+ display: block;
|
|
|
+ background-image: url("../../../../assets/icon/course/aiPart_arrow_active.png");
|
|
|
+ background-size: 100% 100%;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.checkBox {
|
|
|
+ position: absolute;
|
|
|
+ bottom: 40px;
|
|
|
+ border: 1px solid #e0eafb;
|
|
|
+ width: 100%;
|
|
|
+ height: 300px;
|
|
|
+ background: #fff;
|
|
|
+ border-radius: 5px;
|
|
|
+ padding: 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.checkBox>.task>.title,
|
|
|
+.ai_body_select>.checkBox>.part>.title {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 700;
|
|
|
+ margin-bottom: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.checkBox>.task {
|
|
|
+ height: calc(100% - 60px);
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.checkBox>.part {}
|
|
|
+
|
|
|
+.ai_body_select>.checkBox>.task>.content {
|
|
|
+ height: calc(100% - 40px);
|
|
|
+ overflow: auto;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.checkBox>.task>.content>.span+.span {
|
|
|
+ margin-top: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.checkBox>.task>.content>.span {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 14px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.checkBox>.task>.content>.span>.check {
|
|
|
+ width: 13px;
|
|
|
+ height: 13px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.checkBox>.task>.content>.span>.check>img {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.checkBox>.part>.content {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-size: 14px;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.checkBox>.part>.content>.span {
|
|
|
+ padding: 3px 6px;
|
|
|
+ border: 1px solid #e0eafb;
|
|
|
+ border-radius: 40px;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_body_select>.checkBox>.part>.content>.span.active {
|
|
|
+ color: #0061ff;
|
|
|
+ border-color: #0061ff;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_jListPanel {
|
|
|
+ width: 400px;
|
|
|
+ height: 100%;
|
|
|
+ top: 0;
|
|
|
+ right: 0;
|
|
|
+ position: fixed;
|
|
|
+ /* background-color: #000; */
|
|
|
+ z-index: 990;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_b_i_jListBox {
|
|
|
+ width: 100%;
|
|
|
+ max-height: 300px;
|
|
|
+ background-color: #fff;
|
|
|
+ position: absolute;
|
|
|
+ bottom: calc(100% + 5px);
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 10px;
|
|
|
+ overflow: auto;
|
|
|
+ border-radius: 8px;
|
|
|
+ border: 1px solid #e7e7e7;
|
|
|
+ box-shadow: 0 4px 10px 0 rgba(29, 57, 131, 0.08),
|
|
|
+ 1px 1px 20px 4px rgba(29, 57, 131, 0.05);
|
|
|
+ z-index: 999;
|
|
|
+}
|
|
|
+
|
|
|
+.jlist_box {
|
|
|
+ background: #f1f1f1;
|
|
|
+ border-radius: 5px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ padding: 8px 18px 8px 8px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ width: 100%;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+
|
|
|
+.jlist_box .cancel {
|
|
|
+ position: absolute;
|
|
|
+ top: 8px;
|
|
|
+ right: 5px;
|
|
|
+ cursor: pointer;
|
|
|
+ font-size: 14px;
|
|
|
+}
|
|
|
+
|
|
|
+.jlist_box>span {
|
|
|
+ display: -webkit-box;
|
|
|
+ -webkit-box-orient: vertical;
|
|
|
+ -webkit-line-clamp: 3;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+ overflow: hidden;
|
|
|
+ word-break: break-all;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_btn_box {
|
|
|
+ min-width: fit-content;
|
|
|
+ margin-top: auto;
|
|
|
+}
|
|
|
+
|
|
|
+.ai_btn_box>img {
|
|
|
+ cursor: pointer;
|
|
|
+ width: 15px;
|
|
|
+}
|
|
|
+
|
|
|
+.iconfont {
|
|
|
+ font-family: "iconfont" !important;
|
|
|
+ font-size: 50px;
|
|
|
+ font-style: normal;
|
|
|
+ -webkit-font-smoothing: antialiased;
|
|
|
+ -moz-osx-font-smoothing: grayscale;
|
|
|
+ color: blue
|
|
|
+}
|
|
|
+</style>
|