scourse.vue 36 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431
  1. <template>
  2. <div class="pb_content" style="height: auto; width: 94%; margin: 10px auto;background: unset;">
  3. <div style="width:100%;padding:0 21px;background:#fff;border-radius: 5px;box-sizing: border-box;">
  4. <div class="pb_head top">
  5. <div>
  6. <span>{{ orgArray.indexOf(org) != -1 || oidArray.indexOf(oid) != -1 ? "师生项目" : "项目管理" }}</span>
  7. <!-- <span class="subClick" @click="
  8. goTo('/works?userid=' + userid + '&oid=' + oid + '&org=' + org)
  9. ">评价管理</span> -->
  10. </div>
  11. <div class="student_button">
  12. <!-- <el-button type="primary" class="bgColor" @click="openCourse">协同编辑</el-button> -->
  13. <!-- <el-button type="primary" class="bgColor" @click="goToCourse()">添加项目</el-button> -->
  14. <button class="r_pub_button_course" @click="goToCourse()">
  15. <span>添加项目</span>
  16. </button>
  17. </div>
  18. </div>
  19. <div class="reBox">
  20. <div class="reTop">
  21. <!-- <div>分类筛选</div> -->
  22. <div class="reTopCh">
  23. <el-select v-model="groupA" @change="search" v-if="role != '1'">
  24. <el-option value="3" label="全部项目"></el-option>
  25. <el-option value="0" label="我的项目"></el-option>
  26. <el-option value="1" label="协同项目"></el-option>
  27. <el-option value="2" label="他人项目" v-if="oid != '1c3b9def-8fbe-11ed-b13d-005056b86db5'"></el-option>
  28. </el-select>
  29. <el-select v-model="groupA" @change="search" v-else>
  30. <el-option value="4" label="全部项目"></el-option>
  31. </el-select>
  32. <div class="searchI">
  33. <!-- @click="getCourse" -->
  34. <div class="search">
  35. <img src="../../assets/icon/search.png" alt="" />
  36. </div>
  37. <input class="sInput" type="text" placeholder="请输入关键字" v-model="courseName" @input="searchCourse()" />
  38. </div>
  39. <el-button type="primary" class="bgColor" style="margin-left: 10px;" @click="clear">重置</el-button>
  40. </div>
  41. </div>
  42. <div class="choose">
  43. <!-- <div class="student_search">
  44. <span>项目筛选</span>
  45. <el-select v-model="groupA" @change="search">
  46. <el-option value="0" label="我的项目"></el-option>
  47. <el-option value="1" label="他人项目"></el-option>
  48. </el-select>
  49. </div> -->
  50. <div class="all_choose" v-for="(item, index) in CourseType[0]" :key="index"
  51. v-if="CourseTypeJson[item.id].length">
  52. <span>{{ item.name }}</span>
  53. <el-select v-model="courseTypeId[item.id]" placeholder="请选择" @change="getTypeName">
  54. <el-option label="全部" value="1">全部</el-option>
  55. <el-option v-for="item1 in CourseTypeJson[item.id]" :key="item1.id" :label="item1.name" :value="item1.id">
  56. </el-option>
  57. </el-select>
  58. </div>
  59. <!-- <div @click="clear" class="clear" v-if="CourseType.length">重置</div> -->
  60. </div>
  61. </div>
  62. </div>
  63. <div class="pb_content_body" style="height: 100%;width: 100%;background: #e6eaf0;margin: 0 auto;">
  64. <div class="student_head" v-if="false">
  65. <div class="choose">
  66. <div class="student_search">
  67. <span>项目筛选</span>
  68. <el-select v-model="groupA" @change="search" v-if="role != '1'">
  69. <el-option value="3" label="全部项目"></el-option>
  70. <el-option value="0" label="我的项目"></el-option>
  71. <el-option value="1" label="协同项目"></el-option>
  72. <el-option value="2" label="他人项目" v-if="oid != '1c3b9def-8fbe-11ed-b13d-005056b86db5'"></el-option>
  73. </el-select>
  74. <el-select v-model="groupA" @change="search" v-else>
  75. <el-option value="4" label="全部项目"></el-option>
  76. </el-select>
  77. </div>
  78. <div class="all_choose" v-for="(item, index) in CourseType[0]" :key="index"
  79. v-if="CourseTypeJson[item.id].length">
  80. <span v-if="CourseTypeJson[item.id].length">{{ item.name }}</span>
  81. <el-select v-if="CourseTypeJson[item.id].length" v-model="courseTypeId[item.id]" placeholder="请选择"
  82. @change="getTypeName">
  83. <el-option label="全部" value="1">全部</el-option>
  84. <el-option v-for="item1 in CourseTypeJson[item.id]" :key="item1.id" :label="item1.name" :value="item1.id">
  85. </el-option>
  86. </el-select>
  87. </div>
  88. <div @click="clear" class="clear" v-if="CourseType.length">重置</div>
  89. </div>
  90. <div class="student_right">
  91. <div class="head_left">
  92. <el-input v-model="courseName" class="student_input" placeholder="请输入项目名称"></el-input>
  93. <el-button class="course_button" @click="searchCourse">查询</el-button>
  94. </div>
  95. </div>
  96. </div>
  97. <div class="student_table" v-loading="isLoading">
  98. <div class="course_box">
  99. <div class="out_box" v-for="(item, index) in course" :key="index">
  100. <div class="myCourse" v-if="item.userid == userid">
  101. 我的项目
  102. </div>
  103. <div class="myCourse" style="background:#4187f0" v-else-if="!item.course_teacher ||
  104. (item.course_teacher &&
  105. item.course_teacher.indexOf(userid) == -1)">
  106. 他人项目
  107. </div>
  108. <div class="xtCourse" v-else>协同项目</div>
  109. <div class="tup">
  110. <img :src="item.cover != null && item.cover != ''
  111. ? JSON.parse(item.cover).length > 0
  112. ? JSON.parse(item.cover)[0].url
  113. : mr
  114. : mr
  115. " alt />
  116. </div>
  117. <div class="bottom_box">
  118. <div> <el-tooltip :content="item.title" popper-class="text_tooltip" placement="top" effect="dark">
  119. <span>{{ item.title }}</span>
  120. </el-tooltip></div>
  121. <div class="kc_t">
  122. <span>{{ item.uname }}</span>
  123. </div>
  124. <div class="kc_time">
  125. <span style="color: #4b4b4b">创建日期:</span>{{ item.time }}
  126. </div>
  127. <div class="kc_time">
  128. <span style="color: #4b4b4b">修改日期:</span>{{ item.utime }}
  129. </div>
  130. </div>
  131. <div class="three_bottom">
  132. <div @click="goToCourse2(item.courseId)" v-if="((item.userid == userid) ||
  133. (item.course_teacher &&
  134. item.course_teacher.indexOf(userid) !== -1) || role == '1')">编辑</div>
  135. <div @click="get(item.courseId)">预览</div>
  136. <!-- 项目进展 -->
  137. <div @click="getA(item.courseId)">进展</div>
  138. <!-- <div @click="jump(item.courseId)">评论</div> -->
  139. <div @click="copyCourse(item.courseId)">复制</div>
  140. <div v-if="(item.userid == userid || role == '1')" @click="deleteCourse(item.courseId)">
  141. 删除
  142. </div>
  143. </div>
  144. </div>
  145. <div class="course_empty" v-if="course.length == 0">暂无数据</div>
  146. </div>
  147. </div>
  148. </div>
  149. <div class="line"></div>
  150. <div class="student_page">
  151. <el-pagination background layout="prev, pager, next" :page-size="pageSize" :total="total"
  152. v-if="page && course.length" style="padding-bottom: 20px" @current-change="handleCurrentChange"></el-pagination>
  153. </div>
  154. <el-dialog :visible.sync="dialogVisible1" size="tiny">
  155. <img width="100%" :src="dialogImageUrl" alt />
  156. </el-dialog>
  157. <el-dialog title="查看提问" :visible.sync="dialogVisible" :append-to-body="true" width="750px" :before-close="handleClose"
  158. class="dialog_diy">
  159. <div>
  160. <div class="a_addBox">
  161. <CourseProblem :problemCourse="problemCourse"></CourseProblem>
  162. </div>
  163. </div>
  164. <span slot="footer" class="dialog-footer">
  165. <el-button @click="dialogVisible = false">关 闭</el-button>
  166. </span>
  167. </el-dialog>
  168. <el-dialog title="查看协同项目" :visible.sync="dialogVisibleCourse" :append-to-body="true" width="850px"
  169. :before-close="handleClose" class="dialog_diy">
  170. <div class="ct_box">
  171. <div class="out_box" v-for="(item, index) in courseTeam" :key="index" style="margin-left: 15px">
  172. <div class="tup">
  173. <img :src="item.cover != null && item.cover != ''
  174. ? JSON.parse(item.cover).length > 0
  175. ? JSON.parse(item.cover)[0].url
  176. : mr
  177. : mr
  178. " alt />
  179. </div>
  180. <div class="bottom_box">
  181. <div>{{ item.title }}</div>
  182. <div class="kc_t">创建人:{{ item.uname }}</div>
  183. <div class="kc_time">{{ item.time }}</div>
  184. </div>
  185. <div class="three_bottom">
  186. <!-- <div @click="jump(item.courseId)">查看内容</div> -->
  187. <div @click="
  188. goTo(
  189. '/studentAddCourse?cid=' +
  190. item.courseId +
  191. '&userid=' +
  192. userid +
  193. '&oid=' +
  194. oid +
  195. '&org=' +
  196. org +
  197. '&role=' +
  198. role
  199. )
  200. ">
  201. 编辑
  202. </div>
  203. </div>
  204. </div>
  205. <div class="course_empty" v-if="courseTeam.length == 0">暂无数据</div>
  206. </div>
  207. <span slot="footer" class="dialog-footer">
  208. <el-button @click="dialogVisibleCourse = false">关 闭</el-button>
  209. </span>
  210. </el-dialog>
  211. </div>
  212. </template>
  213. <script>
  214. import "../../common/aws-sdk-2.235.1.min";
  215. import EditorBar from "../../components/tools/wangEnduit";
  216. import CourseProblem from "./components/courseProblem";
  217. export default {
  218. components: { EditorBar, CourseProblem },
  219. data() {
  220. return {
  221. itemCount: 1,
  222. courseTitle: "",
  223. courseText: "",
  224. courseTime: "",
  225. isLoading: false,
  226. fileList: [],
  227. fileList1: [],
  228. homeworkList: [{ name: "" }],
  229. formLabelWidth: "100px",
  230. dialogVisible: false,
  231. dialogVisible1: false,
  232. dialogVisibleCourse: false,
  233. dialogImageUrl: "",
  234. group: "",
  235. userid: this.$route.query.userid,
  236. oid: this.$route.query.oid,
  237. org: this.$route.query.org,
  238. role: this.$route.query.role,
  239. orgArray: ["150e3120-9195-11ed-b13d-005056b86db5"],
  240. oidArray: [],
  241. Juri: "",
  242. groupList: [],
  243. JuriList: [],
  244. page: 1,
  245. total: 0,
  246. pageSize: 20,
  247. tableData: [],
  248. now: "",
  249. courseDetail: {},
  250. addCourse: {},
  251. groupA: "3",
  252. classX: "",
  253. course: [],
  254. courseName: "",
  255. mr: require("../../assets/icon/kc1.png"),
  256. CourseType: [],
  257. CourseTypeJson: {},
  258. courseTypeId: {},
  259. courseTypeSon: [],
  260. isChoose: 0,
  261. problemCourse: null, //查看提问的项目
  262. courseTeam: [],
  263. };
  264. },
  265. methods: {
  266. change(val) {
  267. console.log(val);
  268. },
  269. time() {
  270. if (!this.now) {
  271. this.now = new Date().getTime();
  272. return true;
  273. } else {
  274. let time = new Date().getTime();
  275. if (time - this.now > 3000) {
  276. this.now = time;
  277. return true;
  278. } else {
  279. return false;
  280. }
  281. }
  282. },
  283. addHomeworkBox() {
  284. this.homeworkList.push({ name: "" });
  285. this.itemCount++;
  286. },
  287. reduceHomeworkBox() {
  288. var a = this.homeworkList;
  289. a.splice(a.length - 1);
  290. this.itemCount--;
  291. },
  292. goTo(path) {
  293. this.$router.push(path);
  294. },
  295. goToCourse(courseId) {
  296. if (courseId) {
  297. this.$router.push(
  298. "/studentAddCourse?cid=" +
  299. courseId +
  300. "&userid=" +
  301. this.userid +
  302. "&oid=" +
  303. this.oid +
  304. "&org=" +
  305. this.org +
  306. "&role=" +
  307. this.role
  308. );
  309. } else {
  310. this.$router.push(
  311. "/studentAddCourse?userid=" +
  312. this.userid +
  313. "&oid=" +
  314. this.oid +
  315. "&org=" +
  316. this.org +
  317. "&role=" +
  318. this.role
  319. );
  320. }
  321. // this.$router.push(path);
  322. },
  323. goToCourse2(cid) {
  324. this.$router.push(
  325. "/studentAddCourse?cid=" +
  326. cid +
  327. "&userid=" +
  328. this.userid +
  329. "&oid=" +
  330. this.oid +
  331. "&org=" +
  332. this.org +
  333. "&type=2" +
  334. "&role=" +
  335. this.role
  336. );
  337. },
  338. tableRowClassName({ row, rowIndex }) {
  339. if ((rowIndex + 1) % 2 === 0) {
  340. return "even_row";
  341. } else {
  342. return "";
  343. }
  344. },
  345. jump(cid) {
  346. // window.open(
  347. // "//pbl.cocorobo.cn/pbl-student-table/dist/#/courseDetail?courseId=" +
  348. // cid +
  349. // "&userid=" +
  350. // this.userid
  351. // );
  352. window.parent.postMessage({ cid: cid, screenType: "2s" }, "*");
  353. },
  354. get(cid) {
  355. window.parent.postMessage({ cid: cid, screenType: "3s" }, "*");
  356. },
  357. getA(cid) {
  358. this.$router.push("/courseProgress?cid=" + cid + "&userid=" +
  359. this.userid +
  360. "&oid=" +
  361. this.oid +
  362. "&org=" +
  363. this.org)
  364. },
  365. handle_remove(file, fileList) {
  366. var _tmp = this.fileList;
  367. for (var i = 0, len = _tmp.length; i < len; i++) {
  368. if (_tmp[i].uid == file.uid) {
  369. _tmp.splice(i, 1);
  370. break;
  371. }
  372. this.fileList = _tmp;
  373. }
  374. },
  375. handle_remove1(file, fileList) {
  376. var _tmp = this.fileList1;
  377. for (var i = 0, len = _tmp.length; i < len; i++) {
  378. if (_tmp[i].uid == file.uid) {
  379. _tmp.splice(i, 1);
  380. break;
  381. }
  382. this.fileList1 = _tmp;
  383. }
  384. },
  385. handleCurrentChange(val) {
  386. // console.log(`当前页: ${val}`);
  387. this.page = val;
  388. this.getCourse();
  389. },
  390. init() { },
  391. handleClose(done) {
  392. done();
  393. },
  394. handleRemove(file, fileList) {
  395. console.log(file, fileList);
  396. },
  397. handlePictureCardPreview(file) {
  398. this.dialogImageUrl = file.url;
  399. this.dialogVisible1 = true;
  400. },
  401. onExceed() {
  402. this.$message.error("项目海报仅支持上传一张,请删除后再进行上传");
  403. },
  404. //uuid生成
  405. guid() {
  406. return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(
  407. /[xy]/g,
  408. function (c) {
  409. var r = (Math.random() * 16) | 0,
  410. v = c == "x" ? r : (r & 0x3) | 0x8;
  411. return v.toString(16);
  412. }
  413. );
  414. },
  415. time() {
  416. if (!this.now) {
  417. this.now = new Date().getTime();
  418. return true;
  419. } else {
  420. let time = new Date().getTime();
  421. if (time - this.now > 3000) {
  422. this.now = time;
  423. return true;
  424. } else {
  425. return false;
  426. }
  427. }
  428. },
  429. searchCourse() {
  430. this.page = 1;
  431. this.getCourse();
  432. },
  433. clear() {
  434. if (this.CourseType.length) {
  435. for (var i = 0; i < this.CourseType[0].length; i++) {
  436. this.courseTypeId[this.CourseType[0][i].id] = "";
  437. }
  438. }
  439. this.courseName = ''
  440. this.getCourse();
  441. },
  442. getCourse() {
  443. var typeE = [];
  444. var typea, typeb, typec, typed, typef;
  445. if (this.isChoose == 1) {
  446. for (var i = 0; i < this.CourseType[0].length; i++) {
  447. if (this.courseTypeId[this.CourseType[0][i].id] == "1") {
  448. typeE.push(this.CourseType[0][i].id);
  449. } else if (this.courseTypeId[this.CourseType[0][i].id] != "") {
  450. if (this.CourseType[0][i].name == "年级") {
  451. typea = this.courseTypeId[this.CourseType[0][i].id];
  452. } else if (this.CourseType[0][i].name == "专栏") {
  453. typeb = this.courseTypeId[this.CourseType[0][i].id];
  454. } else if (this.CourseType[0][i].name == "栏目") {
  455. typeb = this.courseTypeId[this.CourseType[0][i].id];
  456. } else if (this.CourseType[0][i].name == "学院") {
  457. typeb = this.courseTypeId[this.CourseType[0][i].id];
  458. } else if (this.CourseType[0][i].name == "新技能") {
  459. typec = this.courseTypeId[this.CourseType[0][i].id];
  460. } else if (this.CourseType[0][i].name == "赛道") {
  461. typed = this.courseTypeId[this.CourseType[0][i].id];
  462. } else if (this.CourseType[0][i].name == "学科") {
  463. typed = this.courseTypeId[this.CourseType[0][i].id];
  464. } else if (this.CourseType[0][i].name == "项目类型") {
  465. typed = this.courseTypeId[this.CourseType[0][i].id];
  466. } else if (this.CourseType[0][i].name == "主题") {
  467. typef = this.courseTypeId[this.CourseType[0][i].id];
  468. }
  469. this.courseTypeSon.push(
  470. this.courseTypeId[this.CourseType[0][i].id]
  471. );
  472. }
  473. }
  474. }
  475. this.isLoading = true;
  476. let params = {
  477. type: this.groupA,
  478. uid: this.userid,
  479. oid: this.oid,
  480. org: this.org,
  481. typea: typea != undefined ? typea : "",
  482. typeb: typeb != undefined ? typeb : "",
  483. typec: typec != undefined ? typec : "",
  484. typed: typed != undefined ? typed : "",
  485. typef: typef != undefined ? typef : "",
  486. typeE: typeE.join(","),
  487. cu: "",
  488. cn: this.courseName,
  489. page: this.page,
  490. pageSize: this.pageSize,
  491. };
  492. this.ajax
  493. .get(this.$store.state.api + "selectStudentCourseNew222", params)
  494. .then((res) => {
  495. this.isLoading = false;
  496. this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  497. this.course = res.data[0];
  498. })
  499. .catch((err) => {
  500. console.error(err);
  501. });
  502. },
  503. getTypeName() {
  504. this.$forceUpdate();
  505. this.page = 1;
  506. this.isChoose = 1;
  507. this.getCourse();
  508. },
  509. // searchCourse() {
  510. // this.isLoading = true;
  511. // let params = {
  512. // cu: "",
  513. // cn: this.courseName,
  514. // page: this.page,
  515. // };
  516. // this.ajax
  517. // .get(this.$store.state.api + "searchCourse", params)
  518. // .then((res) => {
  519. // this.isLoading = false;
  520. // this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
  521. // this.course = res.data[0];
  522. // })
  523. // .catch((err) => {
  524. // this.isLoading = false;
  525. // console.error(err);
  526. // });
  527. // },
  528. deleteCourse(cid) {
  529. // if (this.time()) {
  530. this.$confirm("确定删除此项目吗?", "提示", {
  531. confirmButtonText: "确定",
  532. cancelButtonText: "取消",
  533. type: "warning",
  534. })
  535. .then(() => {
  536. this.isLoading = true;
  537. let params = {
  538. cid: cid,
  539. };
  540. this.ajax
  541. .get(this.$store.state.api + "deleteStudentCourse", params)
  542. .then((res) => {
  543. this.isLoading = false;
  544. this.$message.success("删除成功");
  545. this.getCourse();
  546. })
  547. .catch((err) => {
  548. console.error(err);
  549. });
  550. })
  551. .catch(() => {
  552. loading.close();
  553. this.isLoading = false;
  554. return;
  555. });
  556. // }
  557. },
  558. selectAllType() {
  559. let params = {
  560. org: this.org && this.org != "" ? this.org : "",
  561. oid: this.oid && this.oid != "" ? this.oid : "",
  562. };
  563. this.ajax
  564. .get(this.$store.state.api + "selectAllTypeS", params)
  565. .then((res) => {
  566. this.CourseType = res.data;
  567. for (var i = 0; i < res.data[0].length; i++) {
  568. if (res.data[0][i].id == "34629ce3-d02f-11ec-8c78-005056b86db5") {
  569. res.data[0][i].name = "赛道";
  570. } else if (res.data[0][i].id == "2f8beae3-d030-11ec-8c78-005056b86db5") {
  571. res.data[0][i].name = "主题";
  572. } else if (res.data[0][i].id == "34628934-d02f-11ec-8c78-005056b86db5") {
  573. res.data[0][i].name = "年级";
  574. }
  575. if (!this.cid) {
  576. this.courseTypeId[res.data[0][i].id] = '';
  577. }
  578. if (!this.CourseTypeJson[res.data[0][i].id]) {
  579. this.CourseTypeJson[res.data[0][i].id] = [];
  580. }
  581. if (this.oid == "1c3b9def-8fbe-11ed-b13d-005056b86db5") {
  582. if (res.data[0][i].id == "34629ce3-d02f-11ec-8c78-005056b86db5") {
  583. this.CourseType[0][i].name = "项目类型";
  584. }
  585. } else if (this.org == '150e3120-9195-11ed-b13d-005056b86db5') {
  586. } else {
  587. if (res.data[0][i].name == "赛道") {
  588. this.CourseType[0][i].name = "学科";
  589. }
  590. }
  591. if (res.data[2].length == 0 && res.data[3].length == 0) {
  592. // for (var j = 0; j < res.data[1].length; j++) {
  593. // if (res.data[0][i].id == res.data[1][j].pid) {
  594. // this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  595. // }
  596. // }
  597. if (this.org == '150e3120-9195-11ed-b13d-005056b86db5') {
  598. for (var j = 0; j < res.data[1].length; j++) {
  599. if (res.data[0][i].id == res.data[1][j].pid) {
  600. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  601. }
  602. }
  603. } else {
  604. // this.CourseType = []
  605. for (var j = 0; j < res.data[1].length; j++) {
  606. if (res.data[0][i].id == res.data[1][j].pid) {
  607. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  608. }
  609. }
  610. }
  611. } else {
  612. if (res.data[2].length > 0) {
  613. for (var j = 0; j < res.data[2].length; j++) {
  614. if (res.data[0][i].id == res.data[2][j].pid) {
  615. this.CourseTypeJson[res.data[0][i].id].push(res.data[2][j]); // 去除公共分类
  616. }
  617. }
  618. }
  619. if (res.data[3].length > 0) {
  620. for (var j = 0; j < res.data[3].length; j++) {
  621. if (res.data[0][i].id == res.data[3][j].pid) {
  622. this.CourseTypeJson[res.data[0][i].id].push(res.data[3][j]); // 去除公共分类
  623. }
  624. }
  625. }
  626. }
  627. }
  628. })
  629. .catch((err) => {
  630. console.error(err);
  631. });
  632. },
  633. selectType() {
  634. this.ajax
  635. .get(this.$store.state.api + "selectStudentType")
  636. .then((res) => {
  637. this.CourseType = res.data;
  638. for (var i = 0; i < res.data[0].length; i++) {
  639. if (!this.cid) {
  640. this.courseTypeId[res.data[0][i].id] = "";
  641. }
  642. if (this.oid == "69893dca-1d47-11ed-8c78-005056b86db5") {
  643. if (res.data[0][i].name == "栏目") {
  644. this.CourseType[0][i].name = "主题";
  645. }
  646. }
  647. for (var j = 0; j < res.data[1].length; j++) {
  648. if (res.data[0][i].id == res.data[1][j].pid) {
  649. if (!this.CourseTypeJson[res.data[0][i].id]) {
  650. this.CourseTypeJson[res.data[0][i].id] = [];
  651. }
  652. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); //去除公共分类
  653. }
  654. }
  655. }
  656. this.selectTypeByOid();
  657. this.selectTypeByOrg();
  658. })
  659. .catch((err) => {
  660. console.error(err);
  661. });
  662. },
  663. selectTypeByOid() {
  664. let params = {
  665. oid: this.oid,
  666. };
  667. this.ajax
  668. .get(this.$store.state.api + "selectStudentTypeByOid", params)
  669. .then((res) => {
  670. for (var i = 0; i < res.data[0].length; i++) {
  671. for (var j = 0; j < res.data[1].length; j++) {
  672. if (res.data[0][i].id == res.data[1][j].pid) {
  673. if (!this.CourseTypeJson[res.data[0][i].id]) {
  674. this.CourseTypeJson[res.data[0][i].id] = [];
  675. }
  676. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  677. }
  678. }
  679. }
  680. this.$forceUpdate();
  681. })
  682. .catch((err) => {
  683. console.error(err);
  684. });
  685. },
  686. selectTypeByOrg() {
  687. let params = {
  688. oid: this.org,
  689. };
  690. this.ajax
  691. .get(this.$store.state.api + "selectStudentTypeByOid", params)
  692. .then((res) => {
  693. for (var i = 0; i < res.data[0].length; i++) {
  694. for (var j = 0; j < res.data[1].length; j++) {
  695. if (res.data[0][i].id == res.data[1][j].pid) {
  696. if (!this.CourseTypeJson[res.data[0][i].id]) {
  697. this.CourseTypeJson[res.data[0][i].id] = [];
  698. }
  699. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]);
  700. }
  701. }
  702. }
  703. this.$forceUpdate();
  704. })
  705. .catch((err) => {
  706. console.error(err);
  707. });
  708. },
  709. openCourse() {
  710. this.dialogVisibleCourse = true;
  711. this.getTeamCourse();
  712. },
  713. getTeamCourse() {
  714. let params = {
  715. uid: this.userid,
  716. oid: this.oid,
  717. };
  718. this.ajax
  719. .get(this.$store.state.api + "selectCourseTeam", params)
  720. .then((res) => {
  721. this.courseTeam = res.data[0];
  722. })
  723. .catch((err) => {
  724. console.error(err);
  725. });
  726. },
  727. search() {
  728. this.page = 1;
  729. this.getCourse();
  730. },
  731. checkProblem(res) {
  732. this.problemCourse = res;
  733. this.dialogVisible = true;
  734. },
  735. copyCourse(cid) {
  736. let params = [{
  737. cid: cid,
  738. uid: this.userid
  739. }]
  740. this.ajax
  741. .post(this.$store.state.api + "copySCourse", params)
  742. .then((res) => {
  743. this.page = 1
  744. if (this.role == "1") {
  745. this.groupA = "4";
  746. } else {
  747. this.groupA = "3";
  748. }
  749. this.$message.success("复制成功")
  750. this.clear()
  751. })
  752. .catch((err) => {
  753. console.error(err);
  754. });
  755. }
  756. },
  757. created() {
  758. if (this.role == '1') {
  759. this.groupA = '4'
  760. }
  761. this.page = 1;
  762. this.selectAllType();
  763. this.getCourse();
  764. },
  765. };
  766. </script>
  767. <style scoped>
  768. @media screen and (max-width: 1380px) {
  769. .out_box {
  770. width: calc(100% / 4 - (15px * 3) / 4) !important;
  771. }
  772. .out_box:nth-child(5n) {
  773. margin-right: 15px !important;
  774. }
  775. .out_box:nth-child(4n) {
  776. margin-right: 0 !important;
  777. }
  778. }
  779. @media screen and (max-width: 1080px) {
  780. .out_box {
  781. width: calc(100% / 3 - (15px * 2) / 3) !important;
  782. }
  783. .out_box:nth-child(5n) {
  784. margin-right: 15px !important;
  785. }
  786. .out_box:nth-child(4n) {
  787. margin-right: 15px !important;
  788. }
  789. .out_box:nth-child(3n) {
  790. margin-right: 0 !important;
  791. }
  792. }
  793. .dialog_diy>>>.el-dialog__header {
  794. background: #3d67bc !important;
  795. padding: 15px 20px;
  796. }
  797. .dialog_diy>>>.el-dialog__title {
  798. color: #fff;
  799. }
  800. .dialog_diy>>>.el-dialog__headerbtn {
  801. top: 19px;
  802. }
  803. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close {
  804. color: #fff;
  805. }
  806. .dialog_diy>>>.el-dialog__headerbtn .el-dialog__close:hover {
  807. color: #fff;
  808. }
  809. .student_head>>>.el-button--primary {
  810. background-color: #2268bc;
  811. }
  812. .xls_button {
  813. font-size: 14px;
  814. cursor: pointer;
  815. text-decoration: underline;
  816. color: rgb(34, 104, 188);
  817. }
  818. .student_head {
  819. display: flex;
  820. justify-content: space-between;
  821. align-items: baseline;
  822. flex-direction: row;
  823. flex-wrap: wrap;
  824. padding: 0 5px;
  825. box-sizing: border-box;
  826. width: 100%;
  827. }
  828. .top {
  829. display: flex;
  830. justify-content: space-between;
  831. width: 100% !important;
  832. box-sizing: border-box;
  833. margin: 0px auto;
  834. padding: 10px 5px;
  835. height: 54px;
  836. }
  837. .bgColor {
  838. background: #0061FF;
  839. }
  840. .student_search {
  841. display: flex;
  842. align-items: center;
  843. /* width: calc(100% / 3); */
  844. width: 190px;
  845. }
  846. .student_search span {
  847. margin: 0 10px 0 0;
  848. min-width: 65px;
  849. }
  850. .student_button {
  851. display: flex;
  852. overflow: hidden;
  853. height: 40px;
  854. }
  855. .upload-demo {
  856. display: flex;
  857. flex-direction: column;
  858. align-items: end;
  859. /* position: relative; */
  860. width: 100px;
  861. overflow: hidden;
  862. }
  863. .student_table {
  864. padding: 20px 0;
  865. height: 100%;
  866. /* overflow: auto; */
  867. min-height: 360px;
  868. }
  869. .student_empty {
  870. display: flex;
  871. justify-content: center;
  872. align-items: center;
  873. }
  874. .el-table>>>.even_row {
  875. background-color: #f1f1f1;
  876. }
  877. .time {
  878. font-size: 13px;
  879. color: #999;
  880. }
  881. .course_button {
  882. padding: 10px 20px;
  883. }
  884. .course_button_box {
  885. display: flex;
  886. margin-top: 5px;
  887. justify-content: space-between;
  888. }
  889. .course_rate {
  890. margin-top: 5px;
  891. }
  892. .course_view {
  893. display: flex;
  894. align-items: center;
  895. margin: 5px 0 0 0;
  896. }
  897. .course_view i {
  898. background-image: url("../../assets/liulan.png");
  899. width: 25px;
  900. height: 25px;
  901. background-size: 100% 100%;
  902. /* margin-top: 1px; */
  903. line-height: 25px;
  904. vertical-align: text-top;
  905. background-repeat: no-repeat;
  906. }
  907. .image {
  908. width: 100%;
  909. height: 150px;
  910. display: block;
  911. }
  912. .course_box {
  913. display: flex;
  914. flex-wrap: wrap;
  915. }
  916. .student_page {
  917. width: 95%;
  918. margin: 0 auto;
  919. }
  920. .course_create_box {
  921. font-size: 18px;
  922. }
  923. .course_name {
  924. margin-top: 10px;
  925. }
  926. .course_name span {
  927. margin-bottom: 10px;
  928. display: block;
  929. }
  930. .homework_box {
  931. display: flex;
  932. align-items: center;
  933. flex-wrap: wrap;
  934. }
  935. .course_homework {
  936. width: 130px;
  937. display: flex;
  938. justify-content: center;
  939. flex-direction: column;
  940. align-items: center;
  941. margin: 0 10px 10px 0;
  942. }
  943. .course_type {
  944. margin-top: 10px;
  945. display: flex;
  946. }
  947. .course_type1 span {
  948. margin-bottom: 10px;
  949. display: block;
  950. }
  951. .course_type2 {
  952. margin-left: 20px;
  953. }
  954. .course_type2 span {
  955. margin-bottom: 10px;
  956. display: block;
  957. }
  958. .course_empty {
  959. color: rgb(110, 110, 110);
  960. width: 100%;
  961. height: 100%;
  962. display: flex;
  963. align-items: center;
  964. justify-content: center;
  965. }
  966. .el_cards>>>.el-card__body {
  967. height: 100%;
  968. }
  969. .courseBtnBox {
  970. display: flex;
  971. flex-direction: column;
  972. justify-content: space-between;
  973. height: calc(100% - 170px);
  974. padding: 10px;
  975. }
  976. .wordUpload {
  977. display: flex;
  978. }
  979. .wordUpload>.buttonUp {
  980. margin-right: 5px;
  981. }
  982. .out_box {
  983. display: flex;
  984. flex-direction: column;
  985. flex-wrap: nowrap;
  986. width: calc(100% / 5 - (15px * 4) / 5);
  987. /* width: 280px; */
  988. background: #fff;
  989. margin-right: 15px;
  990. /* border: 1px solid #ccc; */
  991. height: fit-content;
  992. box-sizing: border-box;
  993. border-radius: 0px 0px 5px 5px;
  994. /* overflow: hidden; */
  995. margin-bottom: 15px;
  996. position: relative;
  997. border-radius: 8px;
  998. box-sizing: border-box;
  999. overflow: hidden;
  1000. border: 1px solid #3682fc00;
  1001. }
  1002. .out_box:hover {
  1003. border: 1px solid #3681FC;
  1004. }
  1005. .out_box:nth-child(5n) {
  1006. margin-right: 0;
  1007. }
  1008. .bottom_box {
  1009. display: flex;
  1010. padding: 10px;
  1011. flex-direction: column;
  1012. box-sizing: border-box;
  1013. height: 121px;
  1014. flex-wrap: nowrap;
  1015. justify-content: space-evenly;
  1016. }
  1017. .bottom_box>div:nth-child(1) {
  1018. width: 100%;
  1019. /* overflow: hidden;
  1020. text-overflow: ellipsis;
  1021. white-space: nowrap;
  1022. font-weight: bold; */
  1023. display: flex;
  1024. align-items: center;
  1025. justify-content: space-between;
  1026. }
  1027. .bottom_box>div:nth-child(1)>span:nth-child(1) {
  1028. max-width: 100%;
  1029. overflow: hidden;
  1030. text-overflow: ellipsis;
  1031. white-space: nowrap;
  1032. font-weight: bold;
  1033. }
  1034. .bottom_box>div:nth-child(1)>span:nth-child(2) {
  1035. min-width: fit-content;
  1036. font-size: 14px;
  1037. color: #8c8c8c;
  1038. }
  1039. .tup {
  1040. width: 100%;
  1041. height: 180px;
  1042. margin: 0 auto;
  1043. overflow: hidden;
  1044. display: flex;
  1045. align-items: center;
  1046. padding: 10px;
  1047. box-sizing: border-box;
  1048. }
  1049. .tup>img {
  1050. width: 100%;
  1051. height: 100%;
  1052. object-fit: cover;
  1053. }
  1054. .kc_time {
  1055. margin-top: 8px;
  1056. font-size: 14px;
  1057. color: #717C8D;
  1058. }
  1059. .kc_time+.kc_time {
  1060. margin-top: 0;
  1061. }
  1062. .kc_t {
  1063. margin-top: 5px;
  1064. width: 100%;
  1065. white-space: nowrap;
  1066. overflow: hidden;
  1067. text-overflow: ellipsis;
  1068. display: flex;
  1069. align-items: center;
  1070. justify-content: space-between;
  1071. }
  1072. .kc_t>span:nth-child(1) {
  1073. max-width: 100%;
  1074. overflow: hidden;
  1075. text-overflow: ellipsis;
  1076. white-space: nowrap;
  1077. }
  1078. .kc_t>span:nth-child(2) {
  1079. min-width: fit-content;
  1080. font-size: 14px;
  1081. color: #8c8c8c;
  1082. }
  1083. .three_bottom {
  1084. display: flex;
  1085. flex-direction: row;
  1086. justify-content: space-around;
  1087. height: 45px;
  1088. align-items: center;
  1089. background: #fff;
  1090. font-size: 14px;
  1091. border-top: 1px solid #ddd;
  1092. box-sizing: border-box;
  1093. }
  1094. .three_bottom>div {
  1095. cursor: pointer;
  1096. width: 100%;
  1097. text-align: center;
  1098. }
  1099. .three_bottom>div+div {
  1100. border-left: 1px solid #ddd;
  1101. }
  1102. .three_bottom>div:hover {
  1103. color: #3681FC;
  1104. font-weight: bold;
  1105. }
  1106. .three_bottom .deleteB {
  1107. color: #E96E6E;
  1108. }
  1109. .three_bottom .deleteB:hover {
  1110. color: #E96E6E;
  1111. font-weight: bold;
  1112. }
  1113. .head_left {
  1114. display: flex;
  1115. }
  1116. .student_input>>>.el-input__inner {
  1117. height: 40px;
  1118. width: 190px;
  1119. font-size: 13px;
  1120. padding: 0 10px;
  1121. }
  1122. .course_button {
  1123. color: #fff;
  1124. background: #0061FF;
  1125. width: 75px;
  1126. height: 40px;
  1127. padding: 0 !important;
  1128. font-size: 12px;
  1129. line-height: 40px;
  1130. }
  1131. .all_choose {
  1132. margin: 12px 10px 10px 0;
  1133. height: 20%;
  1134. display: flex;
  1135. flex-direction: row;
  1136. align-items: center;
  1137. /* max-width: calc(100% / 3 - 50px); */
  1138. width: fit-content;
  1139. }
  1140. .all_choose>span {
  1141. min-width: 75px;
  1142. display: block;
  1143. margin-right: 10px;
  1144. text-align-last: justify;
  1145. }
  1146. .choose {
  1147. display: flex;
  1148. flex-direction: row;
  1149. flex-wrap: wrap;
  1150. align-content: space-between;
  1151. height: 100%;
  1152. justify-content: flex-start;
  1153. width: 100%;
  1154. /* min-width: 868px; */
  1155. align-items: center;
  1156. }
  1157. /* .choose>div:nth-child(2) {
  1158. margin-left: 1%;
  1159. width: 32.33333%;
  1160. }
  1161. .choose>div:nth-child(3) {
  1162. margin-left: 1%;
  1163. width: 32.33333%;
  1164. }
  1165. .choose>div:nth-child(5) {
  1166. margin: 5px 0 0 1%;
  1167. } */
  1168. .choose>div:nth-child(4)>span {
  1169. /* width: 74px !important;
  1170. min-width: 74px; */
  1171. }
  1172. .choose>div:nth-child(4)>>>.el-select {
  1173. /* width: 217.5px;
  1174. min-width: 215.06px; */
  1175. }
  1176. .clear {
  1177. width: 70px;
  1178. max-width: 70px;
  1179. height: 35px;
  1180. background: #2268bc;
  1181. color: #fff;
  1182. text-align: center;
  1183. border-radius: 5px;
  1184. line-height: 35px;
  1185. cursor: pointer;
  1186. /* margin-left: 20px; */
  1187. }
  1188. .ct_box {
  1189. height: 500px;
  1190. overflow: auto;
  1191. display: flex;
  1192. flex-wrap: wrap;
  1193. }
  1194. .myCourse {
  1195. position: absolute;
  1196. background: #3c3c3c;
  1197. width: 70px;
  1198. height: 30px;
  1199. border-radius: 5px;
  1200. color: #fff;
  1201. font-size: 14px;
  1202. text-align: center;
  1203. line-height: 30px;
  1204. top: 5px;
  1205. left: 5px;
  1206. }
  1207. .xtCourse {
  1208. position: absolute;
  1209. background: #0061FF;
  1210. width: 70px;
  1211. height: 30px;
  1212. border-radius: 5px;
  1213. color: #fff;
  1214. font-size: 14px;
  1215. text-align: center;
  1216. line-height: 30px;
  1217. top: 5px;
  1218. left: 5px;
  1219. }
  1220. .subClick {
  1221. font-size: 16px;
  1222. cursor: pointer;
  1223. margin-left: 10px;
  1224. /* color: #ab582f; */
  1225. color: #409eff;
  1226. }
  1227. .more {
  1228. position: relative;
  1229. }
  1230. .more:hover div {
  1231. display: block;
  1232. color: #000;
  1233. }
  1234. .more div {
  1235. position: absolute;
  1236. bottom: 0px;
  1237. transform: translate(-50%, 100%);
  1238. background: #f5f4f4;
  1239. padding: 10px 20px;
  1240. z-index: 99;
  1241. width: 40px;
  1242. border-radius: 5px;
  1243. box-shadow: 0 0 3px 3px #80808020;
  1244. display: none;
  1245. }
  1246. .more div>span+span {
  1247. margin-top: 10px;
  1248. }
  1249. .more div>span {
  1250. display: block;
  1251. width: 100%;
  1252. text-align: center;
  1253. }
  1254. .more div>span:hover {
  1255. color: #79a2ff;
  1256. }
  1257. .line {
  1258. width: 100%;
  1259. height: 15px;
  1260. background: #e6eaf0;
  1261. }
  1262. .reBox {
  1263. width: 100%;
  1264. /* padding-left: 20px; */
  1265. margin: 0 auto;
  1266. box-sizing: border-box;
  1267. overflow: hidden;
  1268. padding: 10px 15px 0;
  1269. }
  1270. .reTop {
  1271. padding: 0 0 5px;
  1272. /* padding: 20px 0 0 0; */
  1273. /* border-bottom: 1px solid #eee; */
  1274. display: flex;
  1275. flex-direction: row;
  1276. flex-wrap: nowrap;
  1277. align-items: center;
  1278. justify-content: space-between;
  1279. }
  1280. .reTop>div:nth-child(1) {
  1281. font-weight: bold;
  1282. /* width: 40px; */
  1283. /* border-bottom: 1px solid #205cc6; */
  1284. /* padding-bottom: 20px; */
  1285. color: #205cc6;
  1286. /* font-size: 20px; */
  1287. }
  1288. .reTop .reTopCh {
  1289. display: flex;
  1290. }
  1291. .reTop .searchI {
  1292. display: flex;
  1293. flex-direction: row;
  1294. align-items: center;
  1295. border: 1px solid #ccced3;
  1296. width: 250px;
  1297. border-radius: 8px;
  1298. padding: 5px 0;
  1299. /* margin-bottom: 10px; */
  1300. background: #fafafa;
  1301. margin: 0 0 0 10px;
  1302. }
  1303. .search {
  1304. width: 20px;
  1305. padding: 0 5px;
  1306. display: flex;
  1307. align-items: center;
  1308. }
  1309. .search>img {
  1310. width: 100%;
  1311. height: 100%;
  1312. }
  1313. .sInput {
  1314. border: none;
  1315. width: 85%;
  1316. background: #fafafa;
  1317. }
  1318. .sInput:focus-visible {
  1319. outline: none;
  1320. }</style>