mark-score.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270
  1. <template>
  2. <el-dialog :visible.sync="show" title="标记点评给 马东/徐策 等5人" custom-class="content"
  3. style="background-color: #00142f63;backdrop-filter: blur(4px);" width="600px">
  4. <view class="ui-flex-column">
  5. <!-- <view class="ui-p" style="background: #022c5a80;border-bottom: 2px solid #051d37;">
  6. <text class="txt-white"> </text>
  7. </view> -->
  8. <view class="ui-flex-row">
  9. <view class="ui-flex-1 ui-flex-align-center ui-flex-row">
  10. <view class="ui-pl20">
  11. <view class="ui-flex-row ui-border-radius-20" @click="showType=true"
  12. style="background-color: #1C63A8;padding: 4px 8px;">
  13. <text class="txt-white f26 ui-mr10">全部类型</text>
  14. <u-icon color="#fff" name="list-dot"></u-icon>
  15. </view>
  16. </view>
  17. </view>
  18. <view style="width: 220px;" class="ui-p">
  19. <u-subsection :list="['表扬', '需改进']" mode="button" bgColor="#1b63a8" inactiveColor="#aec3ee"
  20. :current="curIndex" @change="curIndex=$event"></u-subsection>
  21. </view>
  22. <view class="ui-flex-1"></view>
  23. </view>
  24. <view style="background: #0000003b;">
  25. <u-tabs :list="list1" :scrollable="false" :activeStyle="{
  26. color: '#fff',
  27. fontWeight: 'bold',
  28. transform: 'scale(1.2)'
  29. }" :inactiveStyle="{
  30. color: '#959595',
  31. transform: 'scale(1)'
  32. }"></u-tabs>
  33. </view>
  34. <scroll-view scroll-y style="height: 400px;" show-scrollbar>
  35. <u-grid :col="6" :border="false">
  36. <u-grid-item @click="toActive(index,item)" v-for="(item, index) in list" :key="index" class="ui-p"
  37. :class="{'no-select' : activeId >= 0 && activeId != index}">
  38. <u--image :src="item.img" width="46px" height="46px"></u--image>
  39. <view class="ui-pt10">
  40. <text class="grid-text txt-white f28">{{item.tab_name}}</text>
  41. </view>
  42. <u-badge v-if="activeId == index" absolute :offset="[0,10]" :value="score"></u-badge>
  43. </u-grid-item>
  44. </u-grid>
  45. </scroll-view>
  46. <view class="ui-p ui-flex" style="background-color: #1b63a870;justify-content: end;">
  47. <view class="ui-flex" style="width: 250px;">
  48. <u-button size="small" plain :text="score ? '取消选择' : '关闭点评'" @click="cancelAct"
  49. style="background-color: #0d4980;" class="ui-mr10"></u-button>
  50. <u-button size="small" :disabled="!score" type="primary" @click="submit" text="提交点评"></u-button>
  51. </view>
  52. </view>
  53. </view>
  54. <el-drawer append-to-body :visible.sync="showType" direction="ltr">
  55. <view class="ui-p" style="width: 400px;">
  56. <text>这里展示学生标签记录、以及类型切换</text>
  57. </view>
  58. <u-cell-group>
  59. <u-cell icon="setting-fill" isLink title="个人设置"></u-cell>
  60. <u-cell icon="integral-fill" isLink title="会员等级" value="新版本"></u-cell>
  61. </u-cell-group>
  62. </el-drawer>
  63. </el-dialog>
  64. </template>
  65. <script>
  66. import {
  67. getStudentTabs
  68. } from "@/common/api/studentTab.js"
  69. export default {
  70. props: {
  71. list: {
  72. type: Array,
  73. default: () => []
  74. },
  75. stuList: {
  76. type: Array,
  77. default: () => []
  78. }
  79. },
  80. data() {
  81. return {
  82. show: false,
  83. curIndex: 0,
  84. type: 0,
  85. score: 0, //加扣分分数
  86. activeId: -1, //选中项
  87. itemTab: '',
  88. showType: false,
  89. list1: [{
  90. name: '全部',
  91. }, {
  92. name: '语文',
  93. }, {
  94. name: '数学'
  95. }, {
  96. name: '科技'
  97. }, {
  98. name: '音乐'
  99. }, {
  100. name: '美术'
  101. }, {
  102. name: '体育'
  103. }, {
  104. name: '思想'
  105. }, {
  106. name: '劳动'
  107. }],
  108. // 老师配置标签的时候,需要选择图标
  109. tagIcons: [
  110. 'a-001-pencil.png',
  111. 'a-010-astronomy.png',
  112. 'a-017-protractor.png',
  113. 'a-024-schoollocker.png',
  114. 'a-031-mortarboard.png',
  115. 'a-038-schoolbag.png',
  116. 'a-045-liquidglue.png',
  117. 'a-002-alarmclock.png',
  118. 'a-011-maths.png',
  119. 'a-018-squareruler.png',
  120. 'a-025-idea.png',
  121. 'a-032-certificate.png',
  122. 'a-039-ask.png',
  123. 'a-046-school.png',
  124. 'a-003-book.png',
  125. 'a-012-eraser.png',
  126. 'a-019-abacus.png',
  127. 'a-026-chemicals.png',
  128. 'a-033-medal.png',
  129. 'a-040-compass.png',
  130. 'a-047-books.png',
  131. 'a-004-notebook.png',
  132. 'a-013-schoolbell.png',
  133. 'a-020-physics.png',
  134. 'a-027-maths.png',
  135. 'a-034-diploma.png',
  136. 'a-041-clipboard.png',
  137. 'a-048-books.png',
  138. 'a-007-calendar.png',
  139. 'a-014-calculator.png',
  140. 'a-021-dna.png',
  141. 'a-028-paintpalette.png',
  142. 'a-035-trophy.png',
  143. 'a-042-computer.png',
  144. 'a-049-books.png',
  145. 'a-008-worldgrid.png',
  146. 'a-015-squareruler.png',
  147. 'a-022-schoollocker.png',
  148. 'a-029-atom.png',
  149. 'a-036-milkcarton.png',
  150. 'a-043-laptop.png',
  151. 'a-050-coffeemug.png',
  152. 'a-009-molecule.png',
  153. 'a-016-ruler.png',
  154. 'a-023-sharpener.png',
  155. 'a-030-eyeglasses.png',
  156. 'a-037-pen.png',
  157. 'a-044-microscope.png',
  158. ]
  159. }
  160. },
  161. watch: {
  162. show() {
  163. if (!this.show) {
  164. this.activeId = -1;
  165. this.score = 0;
  166. this.$emit('close')
  167. }
  168. }
  169. },
  170. mounted() {
  171. },
  172. methods: {
  173. getStudentTabs() {
  174. this.$api.sendRequest({
  175. url: getStudentTabs,
  176. method: "post",
  177. data: {
  178. type: this.type
  179. },
  180. success: res => {
  181. console.log(res, "res");
  182. }
  183. })
  184. },
  185. // 外部访问使用
  186. open(id) {
  187. this.show = true;
  188. },
  189. toActive(index, item) {
  190. // 是否旧的选中项
  191. let always = this.activeId >= 0 && this.activeId == index;
  192. this.activeId = index;
  193. if (always) {
  194. this.score++;
  195. } else {
  196. this.score = 1;
  197. }
  198. this.itemTab = item
  199. },
  200. cancelAct() {
  201. if (this.score) {
  202. this.activeId = -1;
  203. this.score = 0;
  204. } else {
  205. this.show = false;
  206. this.$emit('close')
  207. }
  208. },
  209. submit() {
  210. let obj = {
  211. teacher_id: this.$store.state.teacher_id,
  212. stu_school_ids: this.stuList,
  213. tab_id: this.itemTab.tab_id,
  214. score: this.score
  215. }
  216. this.$api.sendRequest({
  217. url: '/mobile/studentTab/geiXueshengTianjiaBiaoqian',
  218. method: "post",
  219. data: obj,
  220. success: res => {
  221. if (res.code == 200) {
  222. uni.showToast({
  223. title: res.msg,
  224. 'icon': 'none',
  225. });
  226. this.show = false;
  227. this.activeId = -1;
  228. this.score = 0;
  229. this.$emit('close')
  230. }
  231. }
  232. })
  233. },
  234. }
  235. }
  236. </script>
  237. <style>
  238. /deep/ .content {
  239. background-image: url('https://zhxy.obs.cn-hz1.ctyun.cn:443/static/desk_bg/class_bj.jpg');
  240. background-size: auto;
  241. border: 1px solid #0d5396;
  242. }
  243. /deep/ .el-dialog__header {
  244. background: #022c5a80;
  245. border-bottom: 2px solid #051d37;
  246. }
  247. /deep/ .el-dialog__title {
  248. color: #fff;
  249. }
  250. /deep/ .el-dialog__body {
  251. padding: 0;
  252. }
  253. .no-select {
  254. opacity: .5;
  255. }
  256. </style>