mark-score.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. <template>
  2. <el-dialog :visible.sync="show" :title="`标记点评给 ${title}`" 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. title:{
  80. type: String,
  81. default: () => ''
  82. },
  83. },
  84. data() {
  85. return {
  86. show: false,
  87. curIndex: 0,
  88. type: 0,
  89. score: 0, //加扣分分数
  90. activeId: -1, //选中项
  91. itemTab: '',
  92. showType: false,
  93. stuName:'',
  94. list1: [{
  95. name: '全部',
  96. }, {
  97. name: '语文',
  98. }, {
  99. name: '数学'
  100. }, {
  101. name: '科技'
  102. }, {
  103. name: '音乐'
  104. }, {
  105. name: '美术'
  106. }, {
  107. name: '体育'
  108. }, {
  109. name: '思想'
  110. }, {
  111. name: '劳动'
  112. }],
  113. // 老师配置标签的时候,需要选择图标
  114. tagIcons: [
  115. 'a-001-pencil.png',
  116. 'a-010-astronomy.png',
  117. 'a-017-protractor.png',
  118. 'a-024-schoollocker.png',
  119. 'a-031-mortarboard.png',
  120. 'a-038-schoolbag.png',
  121. 'a-045-liquidglue.png',
  122. 'a-002-alarmclock.png',
  123. 'a-011-maths.png',
  124. 'a-018-squareruler.png',
  125. 'a-025-idea.png',
  126. 'a-032-certificate.png',
  127. 'a-039-ask.png',
  128. 'a-046-school.png',
  129. 'a-003-book.png',
  130. 'a-012-eraser.png',
  131. 'a-019-abacus.png',
  132. 'a-026-chemicals.png',
  133. 'a-033-medal.png',
  134. 'a-040-compass.png',
  135. 'a-047-books.png',
  136. 'a-004-notebook.png',
  137. 'a-013-schoolbell.png',
  138. 'a-020-physics.png',
  139. 'a-027-maths.png',
  140. 'a-034-diploma.png',
  141. 'a-041-clipboard.png',
  142. 'a-048-books.png',
  143. 'a-007-calendar.png',
  144. 'a-014-calculator.png',
  145. 'a-021-dna.png',
  146. 'a-028-paintpalette.png',
  147. 'a-035-trophy.png',
  148. 'a-042-computer.png',
  149. 'a-049-books.png',
  150. 'a-008-worldgrid.png',
  151. 'a-015-squareruler.png',
  152. 'a-022-schoollocker.png',
  153. 'a-029-atom.png',
  154. 'a-036-milkcarton.png',
  155. 'a-043-laptop.png',
  156. 'a-050-coffeemug.png',
  157. 'a-009-molecule.png',
  158. 'a-016-ruler.png',
  159. 'a-023-sharpener.png',
  160. 'a-030-eyeglasses.png',
  161. 'a-037-pen.png',
  162. 'a-044-microscope.png',
  163. ]
  164. }
  165. },
  166. watch: {
  167. show() {
  168. if (!this.show) {
  169. this.activeId = -1;
  170. this.score = 0;
  171. this.$emit('close')
  172. }
  173. }
  174. },
  175. mounted() {
  176. },
  177. methods: {
  178. change(e){
  179. this.curIndex = e
  180. this.$emit('change',e)
  181. },
  182. getStudentTabs() {
  183. this.$api.sendRequest({
  184. url: getStudentTabs,
  185. method: "post",
  186. data: {
  187. type: this.type
  188. },
  189. success: res => {
  190. console.log(res, "res");
  191. }
  192. })
  193. },
  194. // 外部访问使用
  195. open(id) {
  196. this.show = true;
  197. },
  198. toActive(index, item) {
  199. // 是否旧的选中项
  200. let always = this.activeId >= 0 && this.activeId == index;
  201. this.activeId = index;
  202. if (always) {
  203. this.score++;
  204. } else {
  205. this.score = 1;
  206. }
  207. this.itemTab = item
  208. },
  209. cancelAct() {
  210. if (this.score) {
  211. this.activeId = -1;
  212. this.score = 0;
  213. } else {
  214. this.show = false;
  215. this.$emit('close')
  216. }
  217. },
  218. submit() {
  219. let obj = {
  220. teacher_id: this.$store.state.teacher_id,
  221. stu_school_ids: this.stuList,
  222. tab_id: this.itemTab.tab_id,
  223. score: this.score
  224. }
  225. this.$api.sendRequest({
  226. url: '/mobile/studentTab/geiXueshengTianjiaBiaoqian',
  227. method: "post",
  228. data: obj,
  229. success: res => {
  230. if (res.code == 200) {
  231. uni.showToast({
  232. title: res.msg,
  233. 'icon': 'none',
  234. });
  235. this.show = false;
  236. this.activeId = -1;
  237. this.score = 0;
  238. this.$emit('close')
  239. }
  240. }
  241. })
  242. },
  243. }
  244. }
  245. </script>
  246. <style>
  247. /deep/ .content {
  248. background-image: url('https://zhxy.obs.cn-hz1.ctyun.cn:443/static/desk_bg/class_bj.jpg');
  249. background-size: auto;
  250. border: 1px solid #0d5396;
  251. }
  252. /deep/ .el-dialog__header {
  253. background: #022c5a80;
  254. border-bottom: 2px solid #051d37;
  255. }
  256. /deep/ .el-dialog__title {
  257. color: #fff;
  258. }
  259. /deep/ .el-dialog__body {
  260. padding: 0;
  261. }
  262. .no-select {
  263. opacity: .5;
  264. }
  265. </style>