MMSE3.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448
  1. <template>
  2. <div class="activeTask">
  3. <div style="float: right; padding: 20px 20px 0px 20px" @click.stop="screen()">
  4. <img src="../../assets/small-big.png" alt="" />
  5. </div>
  6. <el-card style="
  7. margin: 75px auto 0px;
  8. padding: 20px 50px;
  9. width: 80%;
  10. border-radius: 12px;
  11. background: rgba(255, 255, 255, 0.41);
  12. ">
  13. <p>
  14. {{ questionList[current].question }}
  15. </p>
  16. <div class="drawCnt">
  17. <img v-if="questionList[current].img != ''" :src="questionList[current].img" alt=""
  18. :class="{ mr50: current == 19 }" />
  19. <drawing-board ref="drawingBoard" v-if="current == 19" @canvasDown="canvasDownHandle"
  20. @canvasMove="canvasMoveHandle" @canvasUp="canvasUpHandle" @setColor="setColorHandle"
  21. @controlCanvas="controlCanvasHandle"></drawing-board>
  22. </div>
  23. <div class="answerGroup" style="text-align: center">
  24. <el-radio-group v-model="questionList[current].userAnswer" @change="answerHandle">
  25. <el-radio v-for="(item, index) in questionList[current].answerList"
  26. :key="index"
  27. :label="item.value">
  28. {{item.name }}
  29. </el-radio>
  30. </el-radio-group>
  31. </div>
  32. <el-row style="text-align: center; margin-top: 30px">
  33. <el-button :disabled="current <= 0" type="success" size="small" @click="preQuestion">上一题</el-button>
  34. <el-button :disabled="current >= 19" type="success" size="small" @click="nextQuestion">下一题</el-button>
  35. </el-row>
  36. </el-card>
  37. </div>
  38. </template>
  39. <script>
  40. import DrawingBoard from "@/components/drawingBoard";
  41. import { oSessionStorage } from "@/utils/utils";
  42. import screenfull from "screenfull";
  43. import drawingBoard from "../../components/drawingBoard.vue";
  44. export default {
  45. components: { drawingBoard },
  46. name: "MMSE3",
  47. comments: {
  48. DrawingBoard,
  49. },
  50. data() {
  51. return {
  52. current: 0,
  53. flag: 1,
  54. valueSum: 0,
  55. userId: "",
  56. result: {},
  57. radio1: "doc",
  58. dialogTableVisible: false,
  59. questionList: [
  60. {
  61. question: "今年是哪一年?",
  62. answerList: [
  63. { value: 0, name: "错误" },
  64. { value: 1, name: "正确" },
  65. ],
  66. img: "",
  67. userAnswer: -1,
  68. },
  69. {
  70. question: "现在是什么季节?",
  71. answerList: [
  72. { value: 0, name: "错误" },
  73. { value: 1, name: "正确" },
  74. ],
  75. img: "",
  76. userAnswer: -1,
  77. },
  78. {
  79. question: "现在是几月份?",
  80. answerList: [
  81. { value: 0, name: "错误" },
  82. { value: 1, name: "正确" },
  83. ],
  84. img: "",
  85. userAnswer: -1,
  86. },
  87. {
  88. question: "今天是星期几?",
  89. answerList: [
  90. { value: 0, name: "错误" },
  91. { value: 1, name: "正确" },
  92. ],
  93. img: "",
  94. userAnswer: -1,
  95. },
  96. {
  97. question: "今天是几号?",
  98. answerList: [
  99. { value: 0, name: "错误" },
  100. { value: 1, name: "正确" },
  101. ],
  102. img: "",
  103. userAnswer: -1,
  104. },
  105. {
  106. question: "这里是哪个市(省)?",
  107. answerList: [
  108. { value: 0, name: "错误" },
  109. { value: 1, name: "正确" },
  110. ],
  111. img: "",
  112. userAnswer: -1,
  113. },
  114. {
  115. question: "这里是什么区(县)?",
  116. answerList: [
  117. { value: 0, name: "错误" },
  118. { value: 1, name: "正确" },
  119. ],
  120. img: "",
  121. userAnswer: -1,
  122. },
  123. {
  124. question: "这里是什么街道(乡)?",
  125. answerList: [
  126. { value: 0, name: "错误" },
  127. { value: 1, name: "正确" },
  128. ],
  129. img: "",
  130. userAnswer: -1,
  131. },
  132. {
  133. question: "这儿是什么地方?",
  134. answerList: [
  135. { value: 0, name: "错误" },
  136. { value: 1, name: "正确" },
  137. ],
  138. img: "",
  139. userAnswer: -1,
  140. },
  141. {
  142. question: "我们现在是在第几层楼?",
  143. answerList: [
  144. { value: 0, name: "错误" },
  145. { value: 1, name: "正确" },
  146. ],
  147. img: "",
  148. userAnswer: -1,
  149. },
  150. {
  151. question:
  152. "现在我要说出三样东西的名称,在我讲完之后,请您重复说一遍并记住,因为我等一下要再问您的。",
  153. answerList: [
  154. { value: 0, name: "0分" },
  155. { value: 1, name: "1分" },
  156. { value: 2, name: "2分" },
  157. { value: 3, name: "3分" },
  158. ],
  159. img: "",
  160. userAnswer: -1,
  161. },
  162. {
  163. question: "现在请您算一算100减7得多少,然后从所得的数目再减去7,如此一直计算下去。把每一个答案都告诉我,直到我说“停”为止。",
  164. answerList: [
  165. { value: 0, name: "0分" },
  166. { value: 1, name: "1分" },
  167. { value: 2, name: "2分" },
  168. { value: 3, name: "3分" },
  169. { value: 4, name: "4分" },
  170. { value: 5, name: "5分" },
  171. ],
  172. img: "",
  173. userAnswer: -1,
  174. },
  175. {
  176. question: "现在请您说出,刚才我要您记住的三样东西是什么?(各1分共3分)",
  177. answerList: [
  178. { value: 0, name: "0分" },
  179. { value: 1, name: "1分" },
  180. { value: 2, name: "2分" },
  181. { value: 3, name: "3分" },
  182. ],
  183. img: "",
  184. userAnswer: -1,
  185. },
  186. {
  187. question: "请问这是什么?",
  188. answerList: [
  189. { value: 0, name: "错误" },
  190. { value: 1, name: "正确" },
  191. ],
  192. img: require("../../assets/congnitiveAblitity/watch.jpg"),
  193. userAnswer: -1,
  194. },
  195. {
  196. question: "请问这是什么?",
  197. answerList: [
  198. { value: 0, name: "错误" },
  199. { value: 1, name: "正确" },
  200. ],
  201. img: require("../../assets/congnitiveAblitity/pencil.jpg"),
  202. userAnswer: -1,
  203. },
  204. {
  205. question: "现在我要说一句话,请您清楚地重复一遍。这句话是:四十四只石狮子。",
  206. answerList: [
  207. { value: 0, name: "错误" },
  208. { value: 1, name: "正确" },
  209. ],
  210. img: "",
  211. userAnswer: -1,
  212. },
  213. {
  214. question: "我给您一张纸,请按我说的做:请用右手拿这张纸,再用双手把它对折,然后将纸放在您的大腿上。(每项1分共3分)",
  215. answerList: [
  216. { value: 0, name: "0分" },
  217. { value: 1, name: "1分" },
  218. { value: 2, name: "2分" },
  219. { value: 3, name: "3分" },
  220. ],
  221. img: "",
  222. userAnswer: -1,
  223. },
  224. {
  225. question: "请您念一念这句话,并按它的意思去做。“请您闭上眼睛”",
  226. answerList: [
  227. { value: 0, name: "错误" },
  228. { value: 1, name: "正确" },
  229. ],
  230. img: "",
  231. userAnswer: -1,
  232. },
  233. {
  234. question: "请您写一句完整的、有意义的句子。(要求:句子必须有主语、谓语,有意义)",
  235. answerList: [
  236. { value: 0, name: "错误" },
  237. { value: 1, name: "正确" },
  238. ],
  239. img: "",
  240. userAnswer: -1,
  241. },
  242. {
  243. question: "请您照着这个图案把它画下来。",
  244. answerList: [
  245. { value: 0, name: "错误" },
  246. { value: 1, name: "正确" },
  247. ],
  248. img: require("../../assets/congnitiveAblitity/polygon.jpg"),
  249. userAnswer: -1,
  250. },
  251. ],
  252. };
  253. },
  254. created() {
  255. this.subjectInfo = JSON.parse(oSessionStorage.getItem("subjectInfo"));
  256. this.userId = sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f");
  257. this.taskId = this.$route.query.taskId;
  258. screenfull.request();
  259. },
  260. methods: {
  261. screen() {
  262. screenfull.toggle();
  263. },
  264. // 选择答案
  265. answerHandle() {
  266. if (this.current < 19) {
  267. this.current++;
  268. } else {
  269. this.computeSum();
  270. }
  271. },
  272. // 上一题
  273. preQuestion() {
  274. this.current--;
  275. },
  276. // 下一题
  277. nextQuestion() {
  278. if (this.questionList[this.current].userAnswer == -1) {
  279. this.$message.warning("请先完成当前题目");
  280. } else {
  281. this.current++;
  282. }
  283. },
  284. computeSum() {
  285. if (
  286. sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f") == "" ||
  287. sessionStorage.getItem("b80bb7740288fda1f201890375a60c8f") == null
  288. ) {
  289. this.$message.error("请先登录!");
  290. return;
  291. } else {
  292. let valueOne = 0;
  293. let valueTwo = 0;
  294. let valueSix = 0;
  295. for (var item in this.questionList) {
  296. if (this.questionList[item].userAnswer == -1) {
  297. this.questionList[item].userAnswer = 0;
  298. }
  299. if (item < 5) {
  300. valueOne += this.questionList[item].userAnswer;
  301. }
  302. if (item >= 5 && item < 10) {
  303. valueTwo += this.questionList[item].userAnswer;
  304. }
  305. if (item >= 13 && item < 15) {
  306. valueSix += this.questionList[item].userAnswer;
  307. }
  308. this.valueSum += this.questionList[item].userAnswer;
  309. }
  310. this.result = {
  311. valueSum: this.valueSum,
  312. userId: this.userId,
  313. testPlanId: this.$route.query.testPlanId || "",
  314. data: [
  315. {
  316. key: "1",
  317. value: valueOne.toString(),
  318. },
  319. {
  320. key: "2",
  321. value: valueTwo.toString(),
  322. },
  323. {
  324. key: "3",
  325. value: this.questionList[10].userAnswer,
  326. },
  327. {
  328. key: "4",
  329. value: this.questionList[11].userAnswer,
  330. },
  331. {
  332. key: "5",
  333. value: this.questionList[12].userAnswer,
  334. },
  335. {
  336. key: "6",
  337. value: valueSix,
  338. },
  339. {
  340. key: "7",
  341. value: this.questionList[15].userAnswer,
  342. },
  343. {
  344. key: "8",
  345. value: this.questionList[16].userAnswer,
  346. },
  347. {
  348. key: "9",
  349. value: this.questionList[17].userAnswer,
  350. },
  351. {
  352. key: "10",
  353. value: this.questionList[18].userAnswer,
  354. },
  355. {
  356. key: "11",
  357. value: this.questionList[19].userAnswer,
  358. },
  359. ],
  360. };
  361. console.log(this.result);
  362. this.$http.post(`/cognize/MMSEV3`, this.result, (response) => {
  363. if (response.code == 200) {
  364. screenfull.exit();
  365. this.$message({
  366. message: "测试结束!",
  367. type: "success",
  368. });
  369. this.goTestResult(response.data)
  370. } else {
  371. this.$message({
  372. message: "保存失败!服务器异常",
  373. type: "error",
  374. });
  375. }
  376. });
  377. }
  378. },
  379. // 禁止操作
  380. disableHandle() {
  381. this.$message.warning("您暂时不需要操作,请耐心等待");
  382. },
  383. },
  384. destroyed() {
  385. clearInterval(this.t);
  386. },
  387. };
  388. </script>
  389. <style scoped>
  390. .activeTask {
  391. background: url(../../assets/congnitiveAblitity/zhixing.png) no-repeat center;
  392. background-size: cover;
  393. /* background: black; */
  394. position: fixed;
  395. top: 0;
  396. left: 0;
  397. right: 0;
  398. bottom: 0;
  399. overflow-y: scroll;
  400. touch-action: none;
  401. }
  402. .contral_group {
  403. position: fixed;
  404. bottom: 5%;
  405. left: 15%;
  406. transform: translateX(-50%);
  407. z-index: 100;
  408. }
  409. .cover {
  410. position: fixed;
  411. top: 0;
  412. right: 0;
  413. bottom: 0;
  414. left: 0;
  415. overflow: auto;
  416. z-index: 99;
  417. background: #ddd;
  418. opacity: 0.2;
  419. }
  420. .answerGroup {
  421. text-align: center;
  422. padding: 20px 10px;
  423. }
  424. .drawCnt {
  425. display: flex;
  426. justify-content: center;
  427. align-items: center;
  428. margin-bottom: 20px;
  429. }
  430. .mr50 {
  431. margin-right: 50px;
  432. }
  433. </style>