index.vue 29 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142
  1. <template>
  2. <div>
  3. <el-dialog
  4. title="评价资源"
  5. :visible.sync="dialogVisibleEva"
  6. :append-to-body="true"
  7. width="1000px"
  8. :before-close="handleClose"
  9. class="addNewPP2"
  10. >
  11. <div slot="title" class="header-title">
  12. <div class="titleNav">评价资源</div>
  13. </div>
  14. <div class="evaBox">
  15. <div class="evaTop">
  16. <div :class="type == 0 ? 'isTypeNav' : 'typeNav'" @click="setType(0)">
  17. 公共资源
  18. </div>
  19. <div :class="type == 1 ? 'isTypeNav' : 'typeNav'" @click="setType(1)">
  20. 个人资源
  21. </div>
  22. <div :class="type == 2 ? 'isTypeNav' : 'typeNav'" @click="setType(2)">
  23. 组织资源
  24. </div>
  25. <div class="search">
  26. <el-input
  27. v-model="evaName"
  28. placeholder="搜索资源"
  29. @change="getSource"
  30. ></el-input>
  31. </div>
  32. </div>
  33. <div class="choose">
  34. <div
  35. class="all_choose"
  36. v-for="(item, index) in CourseType[0]"
  37. :key="index"
  38. :style="{ margin: !CourseTypeJson[item.id].length && 0 }"
  39. v-if="
  40. item.name != '二级分类' ||
  41. typea != '' ||
  42. typeE.indexOf('3c73702a-aba9-11ee-b534-005056b86db5') != -1
  43. "
  44. >
  45. <span>{{ item.name }}:</span>
  46. <div class="typeCss">
  47. <div
  48. class="cName"
  49. @click="getCourse2(item.name, '', item.id, 1)"
  50. :class="typeE.indexOf(item.id) != -1 ? 'isCType' : ''"
  51. >
  52. 全部
  53. </div>
  54. <div
  55. v-for="(item1, index1) in ctype(item.id)"
  56. :key="index + '-' + index1"
  57. :label="item1.id"
  58. @click="getCourse2(item.name, item.id, item1.id, 2)"
  59. v-if="CourseTypeJson[item.id].length"
  60. >
  61. <div
  62. class="cName"
  63. :class="
  64. typea == item1.id || typeb == item1.id ? 'isCType' : ''
  65. "
  66. >
  67. {{ item1.name }}
  68. </div>
  69. </div>
  70. <div class="addType" @click="openAddDia(item.id)" v-show="false">
  71. <img
  72. src="../../../assets/icon/courseEvaTemplate/add.png"
  73. alt=""
  74. />
  75. </div>
  76. </div>
  77. </div>
  78. </div>
  79. <div v-loading="loading" :class="isHalf ? 'halfCEvaAllBox' : ''">
  80. <div :class="isHalf ? 'halfCEvaBox' : 'cEvaBox'">
  81. <div
  82. v-for="(item, index) in res"
  83. :key="index"
  84. v-show="res.length > 0"
  85. style="width: 100%; height: 100%"
  86. >
  87. <div
  88. class="cEvaItem"
  89. @click="getDetail(item.id, item.json)"
  90. :style="{
  91. backgroundColor:
  92. isHalf && isHoverId == item.id ? '#e7e7e7' : '',
  93. }"
  94. >
  95. <div class="cEvaTBox">
  96. <div v-if="type == 0" class="titleIcon">
  97. <img
  98. src="../../../assets/icon/courseEvaTemplate/one.png"
  99. alt=""
  100. />
  101. </div>
  102. <div v-if="type == 1" class="titleIcon">
  103. <img
  104. src="../../../assets/icon/courseEvaTemplate/two.png"
  105. alt=""
  106. />
  107. </div>
  108. <div v-if="type == 2" class="titleIcon">
  109. <img
  110. src="../../../assets/icon/courseEvaTemplate/three.png"
  111. alt=""
  112. />
  113. </div>
  114. <div class="cEvaTitle">
  115. {{ item.name }}
  116. </div>
  117. </div>
  118. <div :class="isHoverId == item.id ? 'iscEvaIcon' : 'cEvaIcon'">
  119. <el-tooltip
  120. class="item"
  121. effect="light"
  122. content="重命名"
  123. placement="bottom"
  124. >
  125. <div
  126. class="reName"
  127. @click.stop="reName(item.id, item.name)"
  128. ></div>
  129. </el-tooltip>
  130. <el-tooltip
  131. class="item"
  132. effect="light"
  133. content="设置分类"
  134. placement="bottom"
  135. >
  136. <div class="grouping" @click.stop="grouping(item.id)"></div>
  137. </el-tooltip>
  138. <el-tooltip
  139. class="item"
  140. effect="light"
  141. content="删除"
  142. placement="bottom"
  143. >
  144. <div class="delete" @click.stop="dCET(item.id)"></div>
  145. </el-tooltip>
  146. <el-tooltip
  147. class="item"
  148. effect="light"
  149. content="分享"
  150. placement="bottom"
  151. >
  152. <div class="share" @click.stop="share(item)"></div>
  153. </el-tooltip>
  154. </div>
  155. </div>
  156. </div>
  157. <div
  158. v-show="res.length == 0"
  159. class="cEvaItemBox"
  160. style="padding: 15px 30px; font-size: 18px"
  161. >
  162. 暂无内容
  163. </div>
  164. </div>
  165. <div :class="isHalf ? 'isHalfDiv1' : ''" v-if="isHalf">
  166. <div
  167. v-for="(eItem, eIndex) in json"
  168. :key="eIndex"
  169. class="elist_input_box"
  170. >
  171. <div class="elist_inptu_text">
  172. <span>评价维度:</span>
  173. <span>{{ eItem.value }}</span>
  174. </div>
  175. <div class="elist_inptu_text">
  176. <span>维度描述:</span>
  177. <span>{{ eItem.detail }}</span>
  178. </div>
  179. </div>
  180. <div style="width: 100%">
  181. <el-button type="primary" style="float: right" @click="confirm()"
  182. >使用</el-button
  183. >
  184. </div>
  185. </div>
  186. </div>
  187. <el-pagination
  188. @current-change="handleCurrentChange"
  189. :current-page="page"
  190. :page-size="pageSize"
  191. layout=" prev, pager, next"
  192. background
  193. :total="total"
  194. style="padding: 20px 10px; box-sizing: border-box"
  195. >
  196. </el-pagination>
  197. </div>
  198. <!-- <span slot="footer" class="dialog-footer">
  199. <el-button type="primary" @click="close()">确 认</el-button>
  200. <el-button @click="close()">关 闭</el-button>
  201. </span> -->
  202. </el-dialog>
  203. <el-dialog
  204. title="重命名"
  205. :visible.sync="uNamedialogVisible"
  206. :append-to-body="true"
  207. width="800px"
  208. :before-close="handleClose1"
  209. class="addNewPP2"
  210. >
  211. <div slot="title" class="header-title">
  212. <div class="titleNav">重命名</div>
  213. </div>
  214. <div class="addTypeChoose" style="justify-content: center">
  215. <div style="min-width: 100px">模板名称:</div>
  216. <el-input v-model="upNJson.name" style="width: 200px"></el-input>
  217. </div>
  218. <span slot="footer" class="dialog-footer">
  219. <el-button type="primary" @click="upCETName()">确 认</el-button>
  220. <el-button @click="close1()">关 闭</el-button>
  221. </span>
  222. </el-dialog>
  223. <el-dialog
  224. title="添加分类"
  225. :visible.sync="addTypeDialogVisible"
  226. :append-to-body="true"
  227. width="800px"
  228. :before-close="handleClose2"
  229. class="addNewPP2"
  230. >
  231. <div slot="title" class="header-title">
  232. <div class="titleNav">添加分类</div>
  233. </div>
  234. <div class="addTypeBox">
  235. <div
  236. class="addTypeChoose"
  237. v-if="addTypefId == '3f8eed32-aba9-11ee-b534-005056b86db5'"
  238. >
  239. <div style="min-width: 100px; margin-right: 15px">选择一级分类:</div>
  240. <el-select v-model="ftId" placeholder="请选择">
  241. <el-option
  242. v-for="(item, index) in ctype(
  243. '3c73702a-aba9-11ee-b534-005056b86db5'
  244. )"
  245. :key="index"
  246. :label="item.name"
  247. :value="item.id"
  248. >
  249. </el-option>
  250. </el-select>
  251. </div>
  252. <div class="addTypeChoose">
  253. <div style="min-width: 100px">分类名称:</div>
  254. <el-input v-model="typeName"></el-input>
  255. </div>
  256. </div>
  257. <span slot="footer" class="dialog-footer">
  258. <el-button type="primary" @click="addType">确 认</el-button>
  259. <el-button @click="close2()">关 闭</el-button>
  260. </span>
  261. </el-dialog>
  262. <el-dialog
  263. title="设置分类"
  264. :visible.sync="groupDialogVisible"
  265. :append-to-body="true"
  266. width="800px"
  267. :before-close="handleClose2"
  268. class="addNewPP2"
  269. >
  270. <div slot="title" class="header-title">
  271. <div class="titleNav">设置分类</div>
  272. </div>
  273. <div class="addTypeBox">
  274. <div class="addTypeChoose">
  275. <div style="min-width: 100px">选择一级分类:</div>
  276. <el-select
  277. v-model="setTypeJson.one"
  278. placeholder="请选择"
  279. @change="getTwoType(setTypeJson.one)"
  280. >
  281. <el-option
  282. v-for="(item, index) in ctype(
  283. '3c73702a-aba9-11ee-b534-005056b86db5'
  284. )"
  285. :key="index"
  286. :label="item.name"
  287. :value="item.id"
  288. >
  289. </el-option>
  290. </el-select>
  291. </div>
  292. <div class="addTypeChoose" v-if="setTypeJson.one != ''">
  293. <div style="min-width: 100px">选择二级分类:</div>
  294. <el-select v-model="setTypeJson.two" placeholder="请选择">
  295. <el-option
  296. v-for="(item1, index1) in twoJson"
  297. :key="index1"
  298. :label="item1.name"
  299. :value="item1.id"
  300. >
  301. </el-option>
  302. </el-select>
  303. </div>
  304. </div>
  305. <span slot="footer" class="dialog-footer">
  306. <el-button type="primary" @click="addTypeByCET">确 认</el-button>
  307. <el-button @click="close3()">关 闭</el-button>
  308. </span>
  309. </el-dialog>
  310. <el-dialog
  311. title="分享"
  312. :visible.sync="shareDialogVisible"
  313. :append-to-body="true"
  314. width="800px"
  315. :before-close="handleClose2"
  316. class="addNewPP2"
  317. >
  318. <div slot="title" class="header-title">
  319. <div class="titleNav">分享</div>
  320. </div>
  321. <div class="addTypeBox">
  322. <div class="addTypeChoose">
  323. <div style="min-width: 100px">选择资源:</div>
  324. <el-checkbox-group v-model="shareType" class="checkBoxCss">
  325. <el-checkbox label="0" v-if="type != 0">公共资源</el-checkbox>
  326. <el-checkbox label="1" v-if="type != 1">个人资源</el-checkbox>
  327. <el-checkbox label="2" v-if="type != 2">组织资源</el-checkbox>
  328. </el-checkbox-group>
  329. </div>
  330. </div>
  331. <span slot="footer" class="dialog-footer">
  332. <el-button type="primary" @click="shareTemplate">确 认</el-button>
  333. <el-button @click="close4()">关 闭</el-button>
  334. </span>
  335. </el-dialog>
  336. </div>
  337. </template>
  338. <script>
  339. export default {
  340. props: {
  341. dialogVisibleEva: {
  342. type: Boolean,
  343. default: false,
  344. },
  345. userid: {
  346. type: String,
  347. },
  348. oid: {
  349. type: String,
  350. },
  351. org: {
  352. type: String,
  353. },
  354. },
  355. watch: {
  356. dialogVisibleEva(newVal) {
  357. if (newVal) {
  358. this.getSource();
  359. }
  360. },
  361. },
  362. directives: {},
  363. data() {
  364. return {
  365. type: 0,
  366. evaName: "",
  367. CourseType: [],
  368. CourseTypeJson: {},
  369. courseTypeId: {},
  370. typea: "",
  371. typeb: "",
  372. typeE: [],
  373. page: 1,
  374. pageSize: 10,
  375. total: 0,
  376. array: [],
  377. loading: false,
  378. ppid: "",
  379. res: [],
  380. isHalf: false,
  381. json: [],
  382. uNamedialogVisible: false,
  383. upNJson: {
  384. id: "",
  385. name: "",
  386. },
  387. isHoverId: "",
  388. addTypeDialogVisible: false,
  389. addTypefId: "",
  390. typeName: "",
  391. ftId: "",
  392. setTypeJson: {
  393. one: "",
  394. two: "",
  395. },
  396. groupDialogVisible: false,
  397. twoJson: [],
  398. templateId: "",
  399. courseItem: {},
  400. shareDialogVisible: false,
  401. shareType: [],
  402. };
  403. },
  404. computed: {
  405. ctype() {
  406. return function (tid) {
  407. if (tid == "3c73702a-aba9-11ee-b534-005056b86db5") {
  408. return this.CourseTypeJson[tid];
  409. } else {
  410. if (this.ppid == "") {
  411. return this.CourseTypeJson[tid];
  412. } else {
  413. return this.CourseTypeJson[tid].filter((e) => {
  414. return e.ppid == this.ppid;
  415. });
  416. }
  417. }
  418. };
  419. },
  420. },
  421. methods: {
  422. handleCurrentChange(val) {
  423. //当页数发生改变的时候调用获取列表数据请求
  424. // console.log(`当前页: ${val}`);
  425. this.page = val;
  426. this.getSource();
  427. },
  428. getTwoType(id) {
  429. this.twoJson = [];
  430. var array = this.CourseTypeJson[
  431. "3f8eed32-aba9-11ee-b534-005056b86db5"
  432. ].filter((e) => {
  433. return e.ppid == id;
  434. });
  435. this.twoJson = array;
  436. this.$forceUpdate();
  437. },
  438. handleClose(done) {
  439. this.close();
  440. done();
  441. },
  442. handleClose1(done) {
  443. this.close1();
  444. done();
  445. },
  446. handleClose2(done) {
  447. done();
  448. },
  449. close() {
  450. this.type = 0;
  451. this.typea = "";
  452. this.typeb = "";
  453. this.typeE = [];
  454. this.$emit("update:dialogVisibleEva", false);
  455. },
  456. close1() {
  457. this.upNJson.id = "";
  458. this.upNJson.name = "";
  459. this.uNamedialogVisible = false;
  460. },
  461. close2() {
  462. this.ftId = "";
  463. this.typeName = "";
  464. this.addTypeDialogVisible = false;
  465. },
  466. close3() {
  467. this.setTypeJson.one = "";
  468. this.setTypeJson.two = "";
  469. this.groupDialogVisible = false;
  470. },
  471. close4() {
  472. this.courseItem = {};
  473. this.shareType = [];
  474. this.shareDialogVisible = false;
  475. },
  476. setType(t) {
  477. this.typea = "";
  478. this.typeb = "";
  479. this.typeE = [];
  480. this.type = t;
  481. this.getSource();
  482. },
  483. confirm() {
  484. if (this.json.length == 0) {
  485. this.$message.error("请选择评价模板!");
  486. }
  487. this.$confirm("是否使用此评价模板?将会覆盖掉现有的评价!", "提示", {
  488. confirmButtonText: "保存",
  489. cancelButtonText: "不保存",
  490. type: "warning",
  491. }).then(() => {
  492. this.$emit("updateEvaJson", this.json);
  493. this.close();
  494. });
  495. },
  496. selectAllType() {
  497. this.CourseType = [];
  498. this.CourseTypeJson = {};
  499. this.courseTypeId = {};
  500. this.$forceUpdate();
  501. let params = {
  502. org: this.org && this.org != "" ? this.org : "",
  503. oid: this.oid && this.oid != "" ? this.oid : "",
  504. };
  505. this.ajax
  506. .get(this.$store.state.api + "selectAllEvaType", params)
  507. .then((res) => {
  508. this.CourseType = res.data;
  509. for (var i = 0; i < res.data[0].length; i++) {
  510. if (res.data[0][i].id == "3c73702a-aba9-11ee-b534-005056b86db5") {
  511. res.data[0][i].name = "一级分类";
  512. } else if (
  513. res.data[0][i].id == "3f8eed32-aba9-11ee-b534-005056b86db5"
  514. ) {
  515. res.data[0][i].name = "二级分类";
  516. }
  517. if (!this.cid) {
  518. this.courseTypeId[res.data[0][i].id] = [];
  519. }
  520. if (!this.CourseTypeJson[res.data[0][i].id]) {
  521. this.CourseTypeJson[res.data[0][i].id] = [];
  522. }
  523. // if (res.data[2].length == 0 && res.data[3].length == 0) {
  524. for (var j = 0; j < res.data[1].length; j++) {
  525. if (res.data[0][i].id == res.data[1][j].pid) {
  526. this.CourseTypeJson[res.data[0][i].id].push(res.data[1][j]); // 去除公共分类
  527. }
  528. }
  529. // } else {
  530. if (res.data[2].length > 0) {
  531. for (var j = 0; j < res.data[2].length; j++) {
  532. if (res.data[0][i].id == res.data[2][j].pid) {
  533. this.CourseTypeJson[res.data[0][i].id].push(res.data[2][j]); // 去除公共分类
  534. }
  535. }
  536. }
  537. if (res.data[3].length > 0) {
  538. for (var j = 0; j < res.data[3].length; j++) {
  539. if (res.data[0][i].id == res.data[3][j].pid) {
  540. this.CourseTypeJson[res.data[0][i].id].push(res.data[3][j]); // 去除公共分类
  541. }
  542. }
  543. }
  544. // }
  545. }
  546. })
  547. .catch((err) => {
  548. console.error(err);
  549. });
  550. },
  551. getCourse2(typeName, ftypeId, typeid, type) {
  552. this.isHalf = false;
  553. this.isHoverId = "";
  554. this.json = [];
  555. this.page = 1;
  556. if (
  557. typeid == "3c73702a-aba9-11ee-b534-005056b86db5" ||
  558. ftypeId == "3c73702a-aba9-11ee-b534-005056b86db5"
  559. ) {
  560. this.typeb = "";
  561. if (type == 1) {
  562. if (this.typeE.indexOf(typeid) != -1) {
  563. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  564. } else {
  565. this.typeE.push(typeid);
  566. if (this.typea != "") {
  567. this.typea = "";
  568. }
  569. }
  570. this.ppid = "";
  571. } else {
  572. if (this.typea == typeid) {
  573. this.typea = "";
  574. } else {
  575. this.typea = typeid;
  576. if (this.typeE.indexOf(ftypeId) != -1) {
  577. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  578. }
  579. }
  580. this.ppid = typeid;
  581. }
  582. } else if (
  583. typeid == "3f8eed32-aba9-11ee-b534-005056b86db5" ||
  584. ftypeId == "3f8eed32-aba9-11ee-b534-005056b86db5"
  585. ) {
  586. if (type == 1) {
  587. if (this.typeE.indexOf(typeid) != -1) {
  588. this.typeE.splice(this.typeE.indexOf(typeid), 1);
  589. } else {
  590. this.typeE.push(typeid);
  591. if (this.typeb != "") {
  592. this.typeb = "";
  593. }
  594. }
  595. } else {
  596. if (this.typeb == typeid) {
  597. this.typeb = "";
  598. } else {
  599. this.typeb = typeid;
  600. if (this.typeE.indexOf(ftypeId) != -1) {
  601. this.typeE.splice(this.typeE.indexOf(ftypeId), 1);
  602. }
  603. }
  604. }
  605. }
  606. if (
  607. this.typea == "" &&
  608. this.typeE.indexOf("3c73702a-aba9-11ee-b534-005056b86db5") == -1
  609. ) {
  610. this.typeE = [];
  611. }
  612. this.getSource();
  613. },
  614. getSource() {
  615. this.loading = true;
  616. let params = {
  617. uid: this.userid,
  618. oid: this.oid,
  619. org: this.org,
  620. typea: this.typea != undefined ? this.typea : "",
  621. typeb: this.typeb != undefined ? this.typeb : "",
  622. typeE: this.typeE.join(","),
  623. cn: this.evaName,
  624. type: this.type,
  625. page: this.page,
  626. pageSize: this.pageSize,
  627. };
  628. this.ajax
  629. .get(this.$store.state.api + "selectCourseEvaT", params)
  630. .then((res) => {
  631. this.loading = false;
  632. this.res = res.data[0];
  633. this.total = res.data[0].length ? res.data[0][0].num : 0;
  634. })
  635. .catch((err) => {
  636. console.error(err);
  637. });
  638. },
  639. getDetail(id, json) {
  640. if (this.isHalf == false) {
  641. this.isHalf = true;
  642. this.isHoverId = id;
  643. this.json = JSON.parse(json);
  644. } else {
  645. this.isHalf = false;
  646. this.isHoverId = "";
  647. this.json = [];
  648. }
  649. },
  650. reName(id, name) {
  651. this.upNJson.id = id;
  652. this.upNJson.name = name;
  653. this.uNamedialogVisible = true;
  654. },
  655. grouping(id) {
  656. this.templateId = id;
  657. this.groupDialogVisible = true;
  658. },
  659. upCETName() {
  660. let params = {
  661. id: this.upNJson.id,
  662. n: this.upNJson.name,
  663. };
  664. this.ajax
  665. .get(this.$store.state.api + "updateCourseET", params)
  666. .then((res) => {
  667. this.$message.success("修改成功!");
  668. this.getSource();
  669. this.close1();
  670. })
  671. .catch((err) => {
  672. console.error(err);
  673. });
  674. },
  675. dCET(id) {
  676. let params = {
  677. id: id,
  678. };
  679. this.ajax
  680. .get(this.$store.state.api + "deleteCourseET", params)
  681. .then((res) => {
  682. this.$message.success("删除成功!");
  683. this.getSource();
  684. })
  685. .catch((err) => {
  686. console.error(err);
  687. });
  688. },
  689. openAddDia(fid) {
  690. this.addTypefId = fid;
  691. this.addTypeDialogVisible = true;
  692. },
  693. addType() {
  694. let params = {
  695. pid: this.addTypefId,
  696. ppid:
  697. this.addTypefId == "3c73702a-aba9-11ee-b534-005056b86db5"
  698. ? ""
  699. : this.ftId,
  700. n: this.typeName,
  701. uid: "0",
  702. oid: this.oid,
  703. };
  704. this.ajax
  705. .get(this.$store.state.api + "addCETType", params)
  706. .then((res) => {
  707. this.$message.success("添加成功!");
  708. this.selectAllType();
  709. this.addTypeDialogVisible = false;
  710. })
  711. .catch((err) => {
  712. console.error(err);
  713. });
  714. },
  715. addTypeByCET() {
  716. if (this.setTypeJson.two == "") {
  717. this.$message.warning("请选择二级分类,如没有二级分类请前往添加!");
  718. return;
  719. }
  720. let params = {
  721. cid: this.templateId,
  722. };
  723. this.ajax
  724. .get(this.$store.state.api + "deleteCETLabel", params)
  725. .then((res) => {
  726. for (var i = 0; i < 2; i++) {
  727. let tid = "";
  728. if (i == 0) {
  729. tid = this.setTypeJson.one;
  730. } else {
  731. tid = this.setTypeJson.two;
  732. }
  733. let params = [
  734. {
  735. cid: this.templateId,
  736. tid: tid,
  737. uid: this.userid,
  738. },
  739. ];
  740. this.ajax
  741. .post(this.$store.state.api + "addCETLabel", params)
  742. .then((res) => {
  743. this.$message({
  744. message: "设置成功",
  745. type: "success",
  746. });
  747. this.groupDialogVisible = false;
  748. this.getSource();
  749. })
  750. .catch((err) => {
  751. this.$message.error("网络不佳");
  752. console.error(err);
  753. });
  754. }
  755. })
  756. .catch((err) => {
  757. this.$message.error("网络不佳");
  758. console.error(err);
  759. });
  760. },
  761. share(item) {
  762. this.courseItem = item;
  763. this.shareDialogVisible = true;
  764. },
  765. shareTemplate() {
  766. if (this.shareType.length == 2) {
  767. for (var i = 0; i < this.shareType.length; i++) {
  768. this.addCETShare(parseInt(this.shareType[i]));
  769. }
  770. } else {
  771. this.addCETShare(parseInt(this.shareType[0]));
  772. }
  773. },
  774. addCETShare(t) {
  775. let params = [
  776. {
  777. uid: this.userid,
  778. n: this.courseItem.name,
  779. json: this.courseItem.json,
  780. t: t,
  781. oid: this.courseItem.oid,
  782. },
  783. ];
  784. this.ajax
  785. .post(this.$store.state.api + "addCETShare", params)
  786. .then((res) => {
  787. this.$message({
  788. message: "分享成功",
  789. type: "success",
  790. });
  791. this.close4();
  792. this.getSource();
  793. })
  794. .catch((err) => {
  795. this.$message.error("网络不佳");
  796. console.error(err);
  797. });
  798. },
  799. },
  800. mounted() {
  801. this.selectAllType();
  802. this.getSource();
  803. },
  804. };
  805. </script>
  806. <style scoped>
  807. .addNewPP2 >>> .el-dialog__body {
  808. padding: 5px 0;
  809. }
  810. .addNewPP2 >>> .el-dialog {
  811. margin-top: 5vh !important;
  812. }
  813. .addNewPP2 >>> .el-dialog__header {
  814. background: #0061ff;
  815. }
  816. .addNewPP2 >>> .el-dialog__headerbtn .el-dialog__close {
  817. color: #fff !important;
  818. font-size: 20px;
  819. }
  820. .titleNav {
  821. text-align: center;
  822. color: #fff;
  823. line-height: 25px;
  824. font-size: 20px;
  825. }
  826. .evaTop {
  827. display: flex;
  828. flex-direction: row;
  829. flex-wrap: nowrap;
  830. align-items: center;
  831. padding: 15px 0;
  832. justify-content: center;
  833. border-bottom: 1px solid #c6c6c6;
  834. box-sizing: border-box;
  835. position: relative;
  836. }
  837. .typeNav,
  838. .isTypeNav {
  839. margin: 0 15px;
  840. font-size: 20px;
  841. cursor: pointer;
  842. }
  843. .isTypeNav {
  844. color: #0061ff;
  845. }
  846. .search {
  847. position: absolute;
  848. top: 5px;
  849. right: 5px;
  850. }
  851. .typeCss {
  852. display: flex;
  853. flex-direction: row;
  854. flex-wrap: wrap;
  855. justify-content: flex-start;
  856. align-items: center;
  857. }
  858. .choose {
  859. display: flex;
  860. flex-direction: column;
  861. flex-wrap: nowrap;
  862. height: 100%;
  863. justify-content: space-evenly;
  864. align-items: flex-start;
  865. padding: 10px 0;
  866. border-bottom: 1px solid #c6c6c6;
  867. }
  868. .all_choose {
  869. display: flex;
  870. flex-direction: row;
  871. align-items: baseline;
  872. margin: 10px 0;
  873. width: calc(100% - 40px);
  874. padding: 0 0 0 40px;
  875. }
  876. .all_choose > span {
  877. min-width: 150px;
  878. display: block;
  879. letter-spacing: 14px;
  880. }
  881. .all_choose > span:nth-child(1) {
  882. font-weight: bold;
  883. font-size: 16px;
  884. }
  885. .cName {
  886. cursor: pointer;
  887. margin: 0 10px 5px 0;
  888. color: #b9b6b9;
  889. min-width: 90px;
  890. width: 90px;
  891. white-space: nowrap;
  892. overflow: hidden;
  893. text-overflow: ellipsis;
  894. font-size: 16px;
  895. }
  896. .isCType {
  897. color: #6282c2;
  898. }
  899. .halfCEvaAllBox {
  900. display: flex;
  901. flex-direction: row;
  902. flex-wrap: nowrap;
  903. align-items: flex-start;
  904. background: #f5f6f7;
  905. }
  906. .cEvaBox,
  907. .halfCEvaBox {
  908. background: #f5f6f7;
  909. }
  910. .halfCEvaBox {
  911. display: flex;
  912. flex-direction: column;
  913. flex-wrap: nowrap;
  914. align-content: center;
  915. justify-content: center;
  916. align-items: flex-start;
  917. width: 50% !important;
  918. border-right: 1px solid #e9eaea;
  919. }
  920. .cEvaItemBox,
  921. .isHalfDiv,
  922. .isHalfDiv1 {
  923. display: flex;
  924. flex-direction: column;
  925. flex-wrap: nowrap;
  926. justify-content: center;
  927. align-items: flex-start;
  928. width: 100%;
  929. }
  930. .isHalfDiv {
  931. width: 50% !important;
  932. border-right: 1px solid #e9eaea;
  933. }
  934. .isHalfDiv1 {
  935. width: 50% !important;
  936. border-left: 1px solid #e9eaea;
  937. padding: 30px;
  938. max-height: 500px;
  939. overflow: auto;
  940. height: 100%;
  941. }
  942. .cEvaItem {
  943. width: 100%;
  944. padding: 15px 30px;
  945. box-sizing: border-box;
  946. display: flex;
  947. flex-direction: row;
  948. flex-wrap: nowrap;
  949. justify-content: space-between;
  950. align-items: center;
  951. cursor: pointer;
  952. border-bottom: 1px solid #e9eaea;
  953. }
  954. .cEvaItem:hover {
  955. background: #e7e7e7;
  956. }
  957. .cEvaItem:hover > .cEvaIcon,
  958. .iscEvaIcon {
  959. display: flex !important;
  960. }
  961. .cEvaTBox {
  962. display: flex;
  963. flex-direction: row;
  964. flex-wrap: nowrap;
  965. align-items: center;
  966. }
  967. .titleIcon {
  968. width: 30px;
  969. min-width: 30px;
  970. height: 30px;
  971. margin-right: 5px;
  972. }
  973. .titleIcon > img {
  974. width: 100%;
  975. height: 100%;
  976. object-fit: contain;
  977. }
  978. .cEvaTitle {
  979. font-size: 16px;
  980. }
  981. .cEvaIcon,
  982. .iscEvaIcon {
  983. flex-direction: row;
  984. flex-wrap: nowrap;
  985. align-items: center;
  986. display: none;
  987. }
  988. .reName,
  989. .grouping,
  990. .delete,
  991. .share {
  992. width: 20px;
  993. height: 20px;
  994. margin: 0 5px;
  995. background-size: 100% 100%;
  996. background-repeat: no-repeat;
  997. cursor: pointer;
  998. }
  999. .reName {
  1000. background-image: url("../../../assets/icon/courseEvaTemplate/reName.png");
  1001. }
  1002. .reName:hover {
  1003. background-image: url("../../../assets/icon/courseEvaTemplate/reNameHover.png") !important;
  1004. }
  1005. .grouping {
  1006. background-image: url("../../../assets/icon/courseEvaTemplate/grouping.png");
  1007. }
  1008. .grouping:hover {
  1009. background-image: url("../../../assets/icon/courseEvaTemplate/groupingHover.png") !important;
  1010. }
  1011. .delete {
  1012. background-image: url("../../../assets/icon/courseEvaTemplate/delete.png");
  1013. }
  1014. .delete:hover {
  1015. background-image: url("../../../assets/icon/courseEvaTemplate/deleteHover.png") !important;
  1016. }
  1017. .share {
  1018. background-image: url("../../../assets/icon/courseEvaTemplate/share.png");
  1019. }
  1020. .share:hover {
  1021. background-image: url("../../../assets/icon/courseEvaTemplate/shareHover.png") !important;
  1022. }
  1023. .elist_input_box {
  1024. margin: 0 0 20px 0;
  1025. width: 100%;
  1026. display: flex;
  1027. flex-direction: column;
  1028. flex-wrap: nowrap;
  1029. align-items: flex-start;
  1030. justify-content: center;
  1031. }
  1032. .elist_input_box + .elist_input_box {
  1033. padding-top: 10px;
  1034. }
  1035. .elist_inptu_text {
  1036. font-size: 15px;
  1037. display: flex;
  1038. align-items: flex-start;
  1039. }
  1040. .elist_inptu_text + .elist_inptu_text {
  1041. margin-top: 5px;
  1042. }
  1043. .elist_inptu_text > span:nth-child(1) {
  1044. min-width: fit-content;
  1045. font-weight: 600;
  1046. }
  1047. .addType {
  1048. width: 20px;
  1049. height: 20px;
  1050. cursor: pointer;
  1051. margin: 0 0 5px 0;
  1052. }
  1053. .addType > img {
  1054. width: 100%;
  1055. height: 100%;
  1056. }
  1057. .addTypeBox {
  1058. display: flex;
  1059. flex-direction: column;
  1060. flex-wrap: nowrap;
  1061. align-items: center;
  1062. }
  1063. .addTypeChoose {
  1064. display: flex;
  1065. flex-direction: row;
  1066. flex-wrap: nowrap;
  1067. align-items: center;
  1068. margin: 15px 0;
  1069. }
  1070. .checkBoxCss,
  1071. .checkBoxCss >>> .el-checkbox {
  1072. display: flex;
  1073. flex-direction: row;
  1074. flex-wrap: nowrap;
  1075. align-items: center;
  1076. }
  1077. .checkBoxCss >>> .el-checkbox__label {
  1078. line-height: 0 !important;
  1079. }
  1080. </style>