evaluation copy.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449
  1. <template>
  2. <div
  3. class="pb_content"
  4. style="
  5. background: unset;
  6. overflow: auto;
  7. padding: 20px;
  8. margin: 0;
  9. box-sizing: border-box;
  10. "
  11. >
  12. <div>
  13. <div
  14. class="pb_content_body"
  15. style="
  16. background: #fff;
  17. padding: 0px 25px;
  18. box-sizing: border-box;
  19. border-radius: 5px;
  20. "
  21. >
  22. <div class="pb_head top">
  23. <span>评价体系设置</span>
  24. <div class="student_button">
  25. <el-button type="primary" class="bgColor" @click="dialogVisible = true">添加评价体系</el-button>
  26. </div>
  27. </div>
  28. <div class="student_head">
  29. <div class="student_search">
  30. <el-input placeholder="请输入名称"></el-input>
  31. <el-button type="primary" class="btn">查询</el-button>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="pb_content_body" style="height: 100%">
  36. <div class="e_box">
  37. <div class="e_card" v-for="(item,index) in 10" :key="index">
  38. <div class="e_card_picture">
  39. <img src="../../assets/e_picture.png" />
  40. </div>
  41. <div class="e_card_name">
  42. <span>教学课堂评价体系</span>
  43. </div>
  44. <div class="e_card_time">
  45. <span>2022-06-23 17:33:29</span>
  46. </div>
  47. <div class="e_card_btn">
  48. <span>查看</span>
  49. <span>删除</span>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="student_page">
  54. <el-pagination
  55. background
  56. layout="prev, pager, next"
  57. :page-size="10"
  58. :total="total"
  59. style="padding-bottom: 20px"
  60. @current-change="handleCurrentChange"
  61. ></el-pagination>
  62. </div>
  63. </div>
  64. </div>
  65. <el-dialog
  66. title="添加评价体系"
  67. :visible.sync="dialogVisible"
  68. :append-to-body="true"
  69. width="1000px"
  70. :before-close="handleClose"
  71. class="dialog_diy"
  72. >
  73. <div>
  74. <div class="e_add_top">
  75. <div class="e_add_title">
  76. <span>评价体系名称</span>
  77. <el-input v-model="eTitle" placeholder="请输入名称"></el-input>
  78. </div>
  79. <div class="e_add_btn">
  80. <el-button type="primary" @click="dialogVisible2 = true">添加一级标题</el-button>
  81. </div>
  82. </div>
  83. <div class="e_add_content">
  84. <div class="e_add_list" v-for="(item,index) in eJson" :key="index">
  85. <div class="e_add_list_title">
  86. <span v-if="item.name.length < 8">{{item.name}}</span>
  87. <el-tooltip
  88. v-else
  89. class="item"
  90. effect="dark"
  91. :content="item.name"
  92. placement="top-start"
  93. >
  94. <span>{{item.name}}</span>
  95. </el-tooltip>
  96. <img src="../../assets/delete.png" @click="deleteF(index)" alt />
  97. </div>
  98. <div class="e_add_list_body">
  99. <div class="e_add_list_child" v-for="(cItem,cIndex) in item.child" :key="cIndex">
  100. <span v-if="cItem.name.length<11">{{cItem.name}}</span>
  101. <el-tooltip
  102. v-else
  103. class="item"
  104. effect="dark"
  105. content="一级目录内容"
  106. placement="top-start"
  107. >
  108. <span>{{cItem.name}}</span>
  109. </el-tooltip>
  110. <img src="../../assets/delete.png" @click="deleteS(index,cIndex)" alt />
  111. </div>
  112. </div>
  113. <div class="e_add_list_btn" @click="addSDia(index)">添加二级标题</div>
  114. </div>
  115. </div>
  116. </div>
  117. <span slot="footer" class="dialog-footer">
  118. <el-button @click="dialogVisible = false">关 闭</el-button>
  119. <el-button @click="dialogVisible = false" type="primary">确 定</el-button>
  120. </span>
  121. </el-dialog>
  122. <el-dialog
  123. title="添加一级标题"
  124. :visible.sync="dialogVisible2"
  125. :append-to-body="true"
  126. width="400px"
  127. :before-close="handleClose"
  128. class="dialog_diy"
  129. >
  130. <div>
  131. <div class="e_add_title2">
  132. <span>名称</span>
  133. <el-input v-model="eName" placeholder="请输入一级标题名称"></el-input>
  134. </div>
  135. </div>
  136. <span slot="footer" class="dialog-footer">
  137. <el-button @click="dialogVisible2 = false">关 闭</el-button>
  138. <el-button @click="addFTitle" type="primary">确 定</el-button>
  139. </span>
  140. </el-dialog>
  141. <el-dialog
  142. title="添加二级标题"
  143. :visible.sync="dialogVisible3"
  144. :append-to-body="true"
  145. width="400px"
  146. :before-close="handleClose"
  147. class="dialog_diy"
  148. >
  149. <div>
  150. <div class="e_add_title2">
  151. <span>名称</span>
  152. <el-input v-model="esName" placeholder="请输入二级标题名称"></el-input>
  153. </div>
  154. </div>
  155. <span slot="footer" class="dialog-footer">
  156. <el-button @click="dialogVisible3 = false">关 闭</el-button>
  157. <el-button @click="addSName" type="primary">确 定</el-button>
  158. </span>
  159. </el-dialog>
  160. </div>
  161. </template>
  162. <script>
  163. export default {
  164. data() {
  165. return {
  166. page: 0,
  167. total: 0,
  168. dialogVisible: false,
  169. dialogVisible2: false,
  170. dialogVisible3: false,
  171. eTitle: "",
  172. eName: "",
  173. esName: "",
  174. eJson: [],
  175. };
  176. },
  177. methods: {
  178. guid() {
  179. var _num,
  180. i,
  181. _guid = "";
  182. for (i = 0; i < 32; i++) {
  183. _guid += Math.floor(Math.random() * 16).toString(16); //随机0 - 16 的数字 转变为16进制的字符串
  184. _num = Math.floor((i - 7) / 4); //计算 (i-7)除4
  185. if (_num > -1 && _num < 4 && i == 7 + 4 * _num) {
  186. //会使guid中间加 "-" 形式为xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  187. _guid += "-";
  188. }
  189. }
  190. return _guid;
  191. },
  192. handleCurrentChange(val) {
  193. this.page = val;
  194. },
  195. handleClose(done) {
  196. done();
  197. },
  198. addFTitle() {
  199. this.eJson.push({ id: this.guid(), child: [], name: this.eName });
  200. this.dialogVisible2 = false;
  201. this.eName = "";
  202. },
  203. addSDia(index) {
  204. this.sindex = index;
  205. this.dialogVisible3 = true;
  206. },
  207. addSName() {
  208. this.eJson[this.sindex].child.push({
  209. id: this.guid(),
  210. name: this.esName,
  211. });
  212. this.dialogVisible3 = false;
  213. this.esName = "";
  214. },
  215. deleteF(index) {
  216. if (this.eJson[index].child.length) {
  217. this.$message.error("请把所有子集删除了才可以删除!");
  218. return;
  219. }
  220. this.eJson.splice(index, 1);
  221. },
  222. deleteS(index, cIndex) {
  223. this.eJson[index].child.splice(cIndex, 1);
  224. },
  225. },
  226. };
  227. </script>
  228. <style scoped>
  229. .dialog_diy >>> .el-dialog__header {
  230. background: #3d67bc !important;
  231. padding: 15px 20px;
  232. }
  233. .dialog_diy >>> .el-dialog__title {
  234. color: #fff;
  235. }
  236. .dialog_diy >>> .el-dialog__headerbtn {
  237. top: 19px;
  238. }
  239. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
  240. color: #fff;
  241. }
  242. .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
  243. color: #fff;
  244. }
  245. .pb_head > span:nth-child(2) {
  246. font-size: 16px;
  247. margin-left: 80px;
  248. color: #ab582f;
  249. }
  250. .pb_head {
  251. margin: 0 !important;
  252. width: 100% !important;
  253. }
  254. .student_head {
  255. margin-top: 10px;
  256. padding-bottom: 15px;
  257. display: flex;
  258. justify-content: flex-end;
  259. }
  260. .student_search {
  261. display: flex;
  262. }
  263. .student_search > div:nth-child(1) {
  264. line-height: 35px;
  265. font-size: 14px;
  266. min-width: 60px;
  267. }
  268. .student_search >>> .el-input__inner {
  269. width: 190px;
  270. /* height: 35px; */
  271. margin-right: 10px;
  272. }
  273. .student_search .btn {
  274. background: rgb(34, 104, 189);
  275. border: none;
  276. }
  277. .student_button {
  278. display: flex;
  279. overflow: hidden;
  280. height: 40px;
  281. }
  282. .top {
  283. display: flex;
  284. justify-content: space-between;
  285. }
  286. .bgColor {
  287. background: #466b99;
  288. border: none;
  289. }
  290. .e_box {
  291. display: flex;
  292. flex-wrap: wrap;
  293. }
  294. .e_card {
  295. background: #fff;
  296. margin-right: 20px;
  297. width: 270px;
  298. display: flex;
  299. flex-direction: column;
  300. align-items: center;
  301. border-radius: 5px;
  302. margin-top: 10px;
  303. }
  304. .e_card_picture {
  305. margin: 20px 0;
  306. }
  307. .e_card_name {
  308. width: 100%;
  309. padding: 0 10px;
  310. box-sizing: border-box;
  311. margin-bottom: 5px;
  312. overflow: hidden;
  313. text-overflow: ellipsis;
  314. white-space: nowrap;
  315. }
  316. .e_card_time {
  317. width: 100%;
  318. padding: 0 10px;
  319. box-sizing: border-box;
  320. font-size: 15px;
  321. color: #c3c3c3;
  322. margin-bottom: 10px;
  323. }
  324. .e_card_btn {
  325. height: 40px;
  326. display: flex;
  327. align-items: center;
  328. width: 100%;
  329. background: rgb(244, 244, 244);
  330. }
  331. .e_card_btn span {
  332. flex: 1 1 auto;
  333. text-align: center;
  334. }
  335. .student_page {
  336. margin-top: 10px;
  337. }
  338. .e_add_top {
  339. display: flex;
  340. justify-content: space-between;
  341. }
  342. .e_add_title2 {
  343. display: flex;
  344. align-items: center;
  345. }
  346. .e_add_title2 span {
  347. width: 40px;
  348. }
  349. .e_add_title {
  350. display: flex;
  351. align-items: center;
  352. }
  353. .e_add_title span {
  354. width: 135px;
  355. }
  356. .e_add_title .el_input {
  357. width: 300px;
  358. }
  359. .e_add_btn {
  360. }
  361. .e_add_content {
  362. display: flex;
  363. width: 100%;
  364. overflow: auto;
  365. height: 750px;
  366. }
  367. .e_add_list {
  368. background: #f6f7fc;
  369. height: 700px;
  370. width: 240px;
  371. position: relative;
  372. margin: 20px 5px 0 0;
  373. flex-shrink: 0;
  374. }
  375. .e_add_list_title {
  376. font-size: 20px;
  377. width: 100%;
  378. box-sizing: border-box;
  379. padding: 15px 40px;
  380. text-align: center;
  381. border-bottom: 1px solid #eaeaea;
  382. position: relative;
  383. display: flex;
  384. align-items: center;
  385. justify-content: center;
  386. }
  387. .e_add_list_title span {
  388. overflow: hidden;
  389. white-space: nowrap;
  390. text-overflow: ellipsis;
  391. }
  392. .e_add_list_title img {
  393. position: absolute;
  394. right: 15px;
  395. width: 21px;
  396. cursor: pointer;
  397. top: 50%;
  398. transform: translateY(-50%);
  399. }
  400. .e_add_list_body {
  401. height: calc(100% - 107px);
  402. overflow: auto;
  403. }
  404. .e_add_list_child {
  405. width: 100%;
  406. display: flex;
  407. align-items: center;
  408. justify-content: center;
  409. position: relative;
  410. box-sizing: border-box;
  411. padding: 15px 40px;
  412. text-align: center;
  413. }
  414. .e_add_list_child span {
  415. overflow: hidden;
  416. white-space: nowrap;
  417. text-overflow: ellipsis;
  418. }
  419. .e_add_list_child img {
  420. position: absolute;
  421. right: 10px;
  422. width: 21px;
  423. cursor: pointer;
  424. top: 50%;
  425. transform: translateY(-50%);
  426. }
  427. .e_add_list_child + .e_add_list_child {
  428. border-top: 1px solid #eaeaea;
  429. }
  430. .e_add_list_btn {
  431. position: absolute;
  432. bottom: 0;
  433. height: 50px;
  434. background: rgb(120, 120, 254);
  435. width: 100%;
  436. color: #fff;
  437. font-size: 16px;
  438. text-align: center;
  439. line-height: 50px;
  440. cursor: pointer;
  441. }
  442. </style>