index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. <!--奖励分设置-->
  2. <template>
  3. <div class="app-container rewardconfig">
  4. <p class="title-p">奖励分设置</p>
  5. <el-form class="form-content scrollbar-box" ref="form" :model="form" label-width="100px" :rules="rules">
  6. <el-form-item label="一个月无违规记录奖励分值:" prop="monthNoviolationScore" label-width="240px" style="margin-top:22px;">
  7. <el-input
  8. v-model="form.monthNoviolationScore"
  9. placeholder="请输入一个月无违规记录奖励分值"
  10. maxLength="5"
  11. clearable
  12. size="small">
  13. <template slot="append">分</template>
  14. </el-input>
  15. </el-form-item>
  16. <el-form-item label="模拟练习做题奖励分值:" prop="exerciseScore" label-width="240px">
  17. <el-input
  18. v-model="form.exerciseScore"
  19. placeholder="请输入模拟练习做题奖励分值"
  20. maxLength="5"
  21. clearable
  22. size="small">
  23. <template slot="append">分</template>
  24. </el-input>
  25. </el-form-item>
  26. <el-form-item label="模拟考试奖励分换算值:" prop="mockExam" label-width="240px">
  27. <el-input
  28. v-model="form.mockExam"
  29. placeholder="请输入模拟考试得分值"
  30. maxLength="5"
  31. clearable
  32. size="small">
  33. <template slot="prepend">1奖励分等于</template>
  34. <template slot="append">分</template>
  35. </el-input>
  36. </el-form-item>
  37. <el-form-item label="学习时长奖励分换算值:" prop="studyLen" label-width="240px">
  38. <el-input
  39. v-model="form.studyLen"
  40. placeholder="请输入学习时长奖励分换算值"
  41. maxLength="5"
  42. clearable
  43. size="small">
  44. <template slot="prepend">1奖励分等于</template>
  45. <template slot="append">分钟</template>
  46. </el-input>
  47. </el-form-item>
  48. <el-form-item label="完成签到考勤获得奖励分值:" prop="signGetScore" label-width="240px">
  49. <el-input
  50. v-model="form.signGetScore"
  51. placeholder="请输入完成签到考勤获得奖励分值"
  52. maxLength="5"
  53. clearable
  54. size="small">
  55. <template slot="append">分</template>
  56. </el-input>
  57. </el-form-item>
  58. <el-form-item label="完成离开考勤获得奖励分值:" prop="leaveGetScore" label-width="240px">
  59. <el-input
  60. v-model="form.leaveGetScore"
  61. placeholder="请输入完成离开考勤获得奖励分值"
  62. maxLength="5"
  63. clearable
  64. size="small">
  65. <template slot="append">分</template>
  66. </el-input>
  67. </el-form-item>
  68. </el-form>
  69. <div class="form-bottom-button-box"
  70. v-hasPermi="['exam:rewardconfig:edit']">
  71. <p class="null-p-button"></p>
  72. <el-button @click="getList">重 置</el-button>
  73. <el-button type="primary" @click="submitForm">保 存</el-button>
  74. <p class="null-p-button"></p>
  75. </div>
  76. </div>
  77. </template>
  78. <script>
  79. import { listRewardconfig, updateRewardconfig } from "@/api/exam/rewardconfig";
  80. export default {
  81. name: "Rewardconfig",
  82. data() {
  83. return {
  84. form:{},
  85. // 表单校验
  86. rules: {
  87. monthNoviolationScore: [
  88. { required: true, message: "请输入一个月无违规记录奖励分值", trigger: "blur" },
  89. { required: true, message: "请输入一个月无违规记录奖励分值", validator: this.spaceJudgment, trigger: "blur" },
  90. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  91. ],
  92. exerciseScore: [
  93. { required: true, message: "请输入模拟练习做题奖励分值", trigger: "blur" },
  94. { required: true, message: "请输入模拟练习做题奖励分值", validator: this.spaceJudgment, trigger: "blur" },
  95. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  96. ],
  97. mockExam: [
  98. { required: true, message: "请输入模拟考试奖励分换算值", trigger: "blur" },
  99. { required: true, message: "请输入模拟考试奖励分换算值", validator: this.spaceJudgment, trigger: "blur" },
  100. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  101. ],
  102. studyLen: [
  103. { required: true, message: "请输入学习时长奖励分换算值", trigger: "blur" },
  104. { required: true, message: "请输入学习时长奖励分换算值", validator: this.spaceJudgment, trigger: "blur" },
  105. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  106. ],
  107. signGetScore: [
  108. { required: true, message: "请输入完成签到考勤获得奖励分值", trigger: "blur" },
  109. { required: true, message: "请输入完成签到考勤获得奖励分值", validator: this.spaceJudgment, trigger: "blur" },
  110. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  111. ],
  112. leaveGetScore: [
  113. { required: true, message: "请输入完成离开考勤获得奖励分值", trigger: "blur" },
  114. { required: true, message: "请输入完成离开考勤获得奖励分值", validator: this.spaceJudgment, trigger: "blur" },
  115. { required: true, message: "只能输入数字", validator: this.isNum, trigger: "blur" },
  116. ],
  117. }
  118. };
  119. },
  120. created() {
  121. this.getList();
  122. },
  123. methods: {
  124. /** 查询数据 */
  125. getList() {
  126. listRewardconfig({}).then( response => {
  127. this.$set(this,'form',response.data[0])
  128. });
  129. },
  130. /** 提交按钮 */
  131. submitForm() {
  132. this.$refs["form"].validate(valid => {
  133. if (valid) {
  134. updateRewardconfig(this.form).then( response => {
  135. this.getList();
  136. this.msgSuccess("保存成功")
  137. });
  138. }
  139. });
  140. },
  141. }
  142. };
  143. </script>
  144. <style scoped lang="scss">
  145. .rewardconfig{
  146. display: flex!important;
  147. flex-direction: column;
  148. box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.1);
  149. padding:0 20px 0 20px!important;
  150. .title-p{
  151. margin:0;
  152. line-height:80px;
  153. font-size:18px;
  154. color:#0045AF;
  155. border-bottom:2px solid #E0E0E0;
  156. }
  157. .form-content{
  158. overflow-y: scroll;
  159. flex:1;
  160. .annotation-span{
  161. margin-left:20px;
  162. font-size:14px;
  163. font-weight:500;
  164. color:#999999;
  165. }
  166. }
  167. .form-bottom-button-box{
  168. height:80px;
  169. padding:20px;
  170. display: flex;
  171. .null-p-button{
  172. flex:1;
  173. }
  174. }
  175. }
  176. </style>