You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

468 lines
9.0 KiB

  1. <template>
  2. <view v-if="ready" class="box" style="padding-top: 0; ">
  3. <view class="contents">
  4. <view class="progress">
  5. <view class="shade" :style="{width:100/total*(num+1)+'%'}"></view>
  6. <p></p>
  7. <b>{{total}}</b>
  8. </view>
  9. <view class="topic">
  10. <view class="title">
  11. <p><span>{{num+1}}</span></p>
  12. <div> {{ data[num].Assessment }} <span> ( {{data[num].scorePre}}分 ) </span></div>
  13. </view>
  14. <view class="topicCon">
  15. <h1>{{data[num].ConductRequirements}}</h1>
  16. <p>{{data[num].CRRemark}}</p>
  17. <ul>
  18. <li><b>{{data[num].gradetitle}}</b><span>({{data[num].gradenum}})</span></li>
  19. <p>{{data[num].ScoringCriteria}}</p>
  20. </ul>
  21. </view>
  22. <view class="footer">
  23. <ol>
  24. <li>分值:<span class="scorenum">{{data[num].MaxScore}}</span></li>
  25. <li>
  26. <!-- <input type="text" class="inputvalue" id="inputvalue" value=""+{{data[num].Score}}+""> -->
  27. <l-input
  28. @input="setValue('', $event)"
  29. :value="getValue('')"
  30. class="inputvalue"
  31. id="inputvalue"
  32. style="min-height: 48rpx;text-align: center;border-bottom: none;padding-right: 45%;"
  33. type="number"
  34. />
  35. </li>
  36. </ol>
  37. <view class="buttons">
  38. <p class="last" @click="action('last')" v-if="lastIf">上一题</p>
  39. <view style="width: 10px;"></view>
  40. <p class="next" @click="action('next')" v-if="nextIf">下一题</p>
  41. </view>
  42. <view class="lookButton" >
  43. <p @click="action('seeTotal')" v-if="seeTotalIf">查看总分</p>
  44. </view>
  45. </view>
  46. </view>
  47. </view>
  48. </view>
  49. </template>
  50. <script>
  51. /*
  52. * 版 本 Learun-ADMS V7.0.3 力软敏捷开发框架(http://www.learun.cn)
  53. * Copyright (c) 2013-2020 上海力软信息技术有限公司
  54. * 创建人:超级管理员
  55. * 日 期:2020-10-20 09:37
  56. * 描 述:班级工作记事
  57. */
  58. /**
  59. * 本段代码由移动端代码生成器输出,移动端须 2.2.0 版本及以上可以使用
  60. * 请在移动端 /pages.json 中的 pages 字段中添加一条记录:
  61. * { "path": "pages/partyevaluatzp/single", "style": { "navigationBarTitleText": "表单详情页" } }
  62. *
  63. * (navigationBarTitleText 字段为本页面的标题文本,可以修改)
  64. * (必须自行操作该步骤,力软代码生成器不会自动帮您修改 /pages.json 文件)
  65. */
  66. import get from 'lodash/get'
  67. import set from 'lodash/set'
  68. import moment from 'moment'
  69. import customPageMixins from '@/common/custompage.js'
  70. export default {
  71. mixins: [customPageMixins],
  72. data() {
  73. return {
  74. // 页面相关参数
  75. Id: null,
  76. ready: false,
  77. seeTotalIf:false,
  78. lastIf:true,
  79. nextIf:true,
  80. //题目数据
  81. data:[],
  82. //题目分值数据
  83. valList:[],
  84. //题目总数量
  85. total:0,
  86. //当前题目
  87. num:0,
  88. }
  89. },
  90. async onLoad({ Id }) {
  91. await this.init(Id)
  92. },
  93. methods: {
  94. // 页面初始化
  95. async init(Id) {
  96. this.LOADING('加载数据中...')
  97. this.Id = Id
  98. //请求题目数据
  99. const result = await this.HTTP_GET(
  100. 'learun/adms/evaluatingindicator/getevaluationdataforxz',
  101. {
  102. Id:this.Id,
  103. Assessed: this.GET_GLOBAL('loginUser').account
  104. },
  105. '加载数据时出错'
  106. )
  107. if (!result) { return }
  108. this.data=result
  109. this.total=result.length
  110. result.forEach((item)=>{this.valList.push(item.Score)})
  111. //计算显示按钮
  112. await this.calcShowBtn()
  113. this.ready = true
  114. this.HIDE_LOADING()
  115. },
  116. //计算显示按钮
  117. async calcShowBtn(){
  118. if(this.num < this.total-1){
  119. this.nextIf=true;
  120. this.seeTotalIf=false;
  121. }else{
  122. this.nextIf=false;
  123. this.seeTotalIf=true;
  124. }
  125. if(this.num <= 0){
  126. this.lastIf=false;
  127. }else{
  128. this.lastIf=true;
  129. }
  130. },
  131. // 点击 「查看总分」、「上一题」、「下一题」、 按钮
  132. async action(type) {
  133. switch (type) {
  134. case 'seeTotal':
  135. if(this.getValue() == ""){
  136. this.TOAST("分数不能为空!");
  137. return
  138. }
  139. if(this.getValue() > this.data[this.num].MaxScore){
  140. this.TOAST("分数不能大于最大值!");
  141. return
  142. }
  143. this.NAV_TO(`./AnswerTotalXZ?Id=${this.Id}&sumScore=${this.sum(this.valList)}&data=${JSON.stringify(this.data)}`)
  144. break
  145. case 'last':
  146. this.num--
  147. await this.calcShowBtn()
  148. break
  149. case 'next':
  150. if(this.getValue() == ""){
  151. this.TOAST("分数不能为空!");
  152. return
  153. }
  154. if(this.getValue() > this.data[this.num].MaxScore){
  155. this.TOAST("分数不能大于最大值!");
  156. return
  157. }
  158. this.num++
  159. await this.calcShowBtn()
  160. break
  161. default: break
  162. }
  163. },
  164. // 获取表单值
  165. getValue(path) {
  166. return this.data[this.num].Score;
  167. }, // 设置表单值
  168. setValue(path, val) {
  169. this.data[this.num].Score=val;
  170. this.valList[this.num]=val;
  171. // console.log(this.data);
  172. // console.log(this.valList);
  173. },
  174. // 计算数组和
  175. sum(arr) {
  176. var s = 0;
  177. for (var i=arr.length-1; i>=0; i--) {
  178. s += Number(arr[i]);
  179. }
  180. return s;
  181. },
  182. }
  183. }
  184. </script>
  185. <style lang="less">
  186. uni-page-body{
  187. height: 100%;
  188. }
  189. ul,
  190. ol,
  191. li {
  192. list-style: none;
  193. padding: 0;
  194. margin: 0;
  195. }
  196. .box{
  197. height: 100%;
  198. width: 100%;
  199. background: url(../../common/images/content.png);
  200. background-repeat: no-repeat;
  201. background-size: 100% 100%;
  202. }
  203. .contents {
  204. position: relative;
  205. top: 300rpx;
  206. width: 93%;
  207. margin: 0 auto;
  208. }
  209. .progress {
  210. height: 65rpx;
  211. position: relative;
  212. }
  213. .progress p {
  214. height: 15rpx;
  215. width: 100%;
  216. background-color: #EFEFEF;
  217. position: absolute;
  218. top: 50%;
  219. left: 50%;
  220. transform: translate(-50%, -50%);
  221. opacity: .3;
  222. }
  223. .progress .shade {
  224. height: 25rpx;
  225. width: 10%;
  226. position: absolute;
  227. top: 50%;
  228. left: 0%;
  229. transform: translate(0%, -50%);
  230. background: url(../../common/images/jd.png);
  231. background-size: 100% 100%;
  232. border-radius: 100rpx;
  233. }
  234. .progress b {
  235. position: absolute;
  236. width: 95rpx;
  237. height: 60rpx;
  238. border-top-left-radius: 100rpx;
  239. border-bottom-left-radius: 100rpx;
  240. background-color: #f4df81;
  241. background-image: linear-gradient(#f4df81, #d19f31);
  242. top: 0;
  243. right: -3.7%;
  244. display: flex;
  245. justify-content: center;
  246. align-items: center;
  247. color: #FFFFFF;
  248. font-size: 36rpx;
  249. }
  250. .topic {
  251. position: relative;
  252. background-color: #FFFFFF;
  253. border-radius: 50rpx;
  254. margin-top: 70rpx;
  255. }
  256. .title>div {
  257. height: 75rpx;
  258. width: 75%;
  259. margin: 0 auto;
  260. background: #FFFFFF;
  261. border-radius: 40rpx;
  262. line-height: 75rpx;
  263. font-size: 24rpx;
  264. color: #404040;
  265. text-align: center;
  266. font-weight: 800;
  267. position: absolute;
  268. top: -4%;
  269. left: 52%;
  270. transform: translate(-50%, 0%);
  271. box-shadow: #d6d4d4 0rpx 12rpx 40rpx 10rpx; //边框阴影
  272. }
  273. .title>div span {
  274. color: #a6a6a6;
  275. }
  276. .title>p {
  277. background-color: #FFFFFF;
  278. height: 115rpx;
  279. width: 115rpx;
  280. border-radius: 50%;
  281. position: absolute;
  282. top: -7%;
  283. left: 70rpx;
  284. z-index: 90;
  285. display: flex;
  286. justify-content: center;
  287. align-items: center;
  288. box-shadow: #d6d4d4 0rpx 12rpx 40rpx 10rpx; //边框阴影
  289. }
  290. .title>p span {
  291. display: flex;
  292. justify-content: center;
  293. align-items: center;
  294. height: 80rpx;
  295. width: 80rpx;
  296. border: 12rpx solid #e17465;
  297. border-radius: 50%;
  298. font-size: 40rpx;
  299. }
  300. .topicCon {
  301. padding-top: 90rpx;
  302. margin-bottom: 20rpx;
  303. padding: 0 50rpx;
  304. padding-top: 100rpx;
  305. }
  306. .topicCon h1 {
  307. font-size: 36rpx;
  308. color: #404040;
  309. }
  310. .topicCon p {
  311. font-size: 28rpx;
  312. color: #404040;
  313. line-height: 2;
  314. }
  315. .topicCon ul {
  316. background: #efefef;
  317. border-radius: 16rpx;
  318. padding: 30rpx;
  319. margin-top: 40rpx;
  320. }
  321. .topicCon ul li b {
  322. font-size: 24rpx;
  323. color: #404040;
  324. font-weight: 800;
  325. margin-right: 20rpx;
  326. }
  327. .topicCon ul li span {
  328. font-size: 28rpx;
  329. color: #404040;
  330. }
  331. .topicCon ul p {
  332. font-size: 24rpx;
  333. color: #404040;
  334. }
  335. .footer {
  336. border-top: 4rpx solid #efefef;
  337. padding: 50rpx;
  338. }
  339. .footer ol {
  340. border: 2rpx solid #c8c8c8;
  341. border-radius: 16rpx;
  342. display: flex;
  343. justify-content: flex-start;
  344. align-items: center;
  345. height: 80rpx;
  346. color: #404040;
  347. font-size: 24rpx;
  348. margin-bottom: 40rpx;
  349. }
  350. .footer ol li {
  351. height: 50rpx;
  352. width: 100%;
  353. display: flex;
  354. align-items: center;
  355. justify-content: center;
  356. }
  357. .footer ol li span {
  358. color: #be1211;
  359. }
  360. .footer ol li:first-child {
  361. width: 30%;
  362. border-right: 2rpx solid #c8c8c8;
  363. }
  364. .footer ol li input {
  365. width: 100%;
  366. height: 40rpx;
  367. border: none;
  368. font-size: 32rpx;
  369. text-align: center;
  370. outline: none;
  371. padding: 0;
  372. margin: 0;
  373. }
  374. .buttons {
  375. display: flex;
  376. justify-content: space-around;
  377. align-items: center;
  378. height: 80rpx;
  379. margin-top: 35rpx;
  380. margin-bottom: 20rpx;
  381. }
  382. .buttons p {
  383. border: 4rpx solid #e1bb53;
  384. border-radius: 50rpx;
  385. font-size: 36rpx;
  386. color: #FFFFFF;
  387. width: 40%;
  388. height: 72rpx;
  389. display: flex;
  390. justify-content: space-around;
  391. align-items: center;
  392. color: #e1bb53;
  393. flex: 1;
  394. }
  395. .buttons p:hover {
  396. background-color: #e1bb53;
  397. color: #FFFFFF;
  398. }
  399. .lookButton p {
  400. background-color: #e1bb53;
  401. margin: 0 auto;
  402. color: #FFFFFF;
  403. border-radius: 50rpx;
  404. font-size: 36rpx;
  405. color: #FFFFFF;
  406. //width: 80%;
  407. height: 80rpx;
  408. text-align: center;
  409. line-height: 80rpx;
  410. // display: none;
  411. }
  412. .homebuttom {
  413. background-color: #e1bb53;
  414. color: #FFFFFF !important;
  415. }
  416. </style>