mark-score.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  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="change"></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. change(e){
  174. this.curIndex = e
  175. this.$emit('change',e)
  176. },
  177. getStudentTabs() {
  178. this.$api.sendRequest({
  179. url: getStudentTabs,
  180. method: "post",
  181. data: {
  182. type: this.type
  183. },
  184. success: res => {
  185. console.log(res, "res");
  186. }
  187. })
  188. },
  189. // 外部访问使用
  190. open(id) {
  191. this.show = true;
  192. },
  193. toActive(index, item) {
  194. // 是否旧的选中项
  195. let always = this.activeId >= 0 && this.activeId == index;
  196. this.activeId = index;
  197. if (always) {
  198. this.score++;
  199. } else {
  200. this.score = 1;
  201. }
  202. this.itemTab = item
  203. },
  204. cancelAct() {
  205. if (this.score) {
  206. this.activeId = -1;
  207. this.score = 0;
  208. } else {
  209. this.show = false;
  210. this.$emit('close')
  211. }
  212. },
  213. submit() {
  214. let obj = {
  215. teacher_id: this.$store.state.teacher_id,
  216. stu_school_ids: this.stuList,
  217. tab_id: this.itemTab.tab_id,
  218. score: this.score
  219. }
  220. this.$api.sendRequest({
  221. url: '/mobile/studentTab/geiXueshengTianjiaBiaoqian',
  222. method: "post",
  223. data: obj,
  224. success: res => {
  225. if (res.code == 200) {
  226. uni.showToast({
  227. title: res.msg,
  228. 'icon': 'none',
  229. });
  230. this.show = false;
  231. this.activeId = -1;
  232. this.score = 0;
  233. this.$emit('close')
  234. }
  235. }
  236. })
  237. },
  238. }
  239. }
  240. </script>
  241. <style>
  242. /deep/ .content {
  243. background-image: url('https://zhxy.obs.cn-hz1.ctyun.cn:443/static/desk_bg/class_bj.jpg');
  244. background-size: auto;
  245. border: 1px solid #0d5396;
  246. }
  247. /deep/ .el-dialog__header {
  248. background: #022c5a80;
  249. border-bottom: 2px solid #051d37;
  250. }
  251. /deep/ .el-dialog__title {
  252. color: #fff;
  253. }
  254. /deep/ .el-dialog__body {
  255. padding: 0;
  256. }
  257. .no-select {
  258. opacity: .5;
  259. }
  260. </style>