Evaluation.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <div style="height: 100vh; overflow-y: auto !important; background: #ffffff">
  3. <!-- <el-button type="primary" size="small" round @click="goBack()">返回</el-button> -->
  4. <el-row>
  5. <el-col :span="1">
  6. <div>&nbsp;</div>
  7. </el-col>
  8. <el-col :span="10">
  9. <div>
  10. <el-input
  11. class="xl_input"
  12. placeholder="请输入测试内容"
  13. v-model="queryKeyword"
  14. prefix-icon="el-icon-search"
  15. @input="queryLikeWord"
  16. clearable
  17. >
  18. </el-input>
  19. </div>
  20. </el-col>
  21. <el-col :span="11">
  22. <div>&nbsp;</div>
  23. </el-col>
  24. </el-row>
  25. <el-row>
  26. <el-col :span="1">
  27. <div>&nbsp;</div>
  28. </el-col>
  29. <el-col :span="22">
  30. <div class="my_tabs">
  31. <div
  32. class="tab_item"
  33. :class="{ is_active: 'first' == activeName }"
  34. @click="handleClick('first')"
  35. >
  36. 全部量表
  37. </div>
  38. <div
  39. class="tab_item"
  40. v-for="item in scaleTypeList"
  41. :key="item.id"
  42. :class="{ is_active: item.ename == activeName }"
  43. @click="handleClick(item.ename)"
  44. >
  45. {{ item.name }}
  46. </div>
  47. </div>
  48. </el-col>
  49. <el-col :span="1">
  50. <div>&nbsp;</div>
  51. </el-col>
  52. </el-row>
  53. <el-row>
  54. <el-col :span="1"> &nbsp; </el-col>
  55. <el-col :span="22">
  56. <div style="height: 70vh; overflow-y: auto !important">
  57. <div
  58. class="scale_item"
  59. v-for="(item, index) in scaleList"
  60. :key="index"
  61. @click="scaleDetail(item.flag)"
  62. >
  63. <img class="xl_img" :src="item.src" />
  64. <!-- <span>简明精神病量表</span> -->
  65. <div style="display: block">
  66. <span class="xl_title">{{ item.name }}</span>
  67. <span class="xl_content">
  68. {{ item.description }}
  69. </span>
  70. <div>
  71. <span class="xl_test">{{ item.testNum }}人测过</span>
  72. </div>
  73. </div>
  74. </div>
  75. </div>
  76. </el-col>
  77. </el-row>
  78. <el-row class="pagin_class">
  79. <el-col :span="24" style="text-align: center">
  80. <el-pagination
  81. @size-change="handleSizeChange"
  82. @current-change="handleCurrentChange"
  83. :current-page="pageNum"
  84. :page-size="pageSize"
  85. layout="total, prev, pager, next, jumper"
  86. :total="totolSize"
  87. >
  88. </el-pagination>
  89. </el-col>
  90. </el-row>
  91. </div>
  92. </template>
  93. <script>
  94. export default {
  95. data() {
  96. return {
  97. scaleTypeList: [],
  98. queryKeyword: "",
  99. totolSize: 6,
  100. pageNum: 1,
  101. pageSize: 6,
  102. activeName: "first",
  103. scaleList: [],
  104. };
  105. },
  106. mounted() {
  107. this.selectScaleType();
  108. //查询列表
  109. //this.queryList();
  110. },
  111. methods: {
  112. queryLikeWord() {
  113. this.pageNum = 1;
  114. this.queryList();
  115. },
  116. //查询量表分类接口
  117. selectScaleType() {
  118. let that = this;
  119. this.$http.get(`v1/category/getCategoryList`, {}, (res) => {
  120. that.scaleTypeList = res.data;
  121. that.queryList();
  122. });
  123. },
  124. //调用接口进行列表渲染
  125. queryList() {
  126. let that = this;
  127. //传输关键字
  128. //第几页
  129. //每页多少条
  130. //属于那种类型
  131. that.$http.post(
  132. `v1/scale/find`,
  133. {
  134. name: that.queryKeyword,
  135. pageNum: that.pageNum,
  136. pageSize: that.pageSize,
  137. //typeName: that.activeName,
  138. typeName: that.activeName === "first" ? "" : that.activeName,
  139. flag: "",
  140. role: 0,
  141. },
  142. (res) => {
  143. if (res.data.code == 200) {
  144. that.scaleList = res.data.data.content;
  145. for (let i = 0; i < that.scaleList.length; i++) {
  146. if (i % 3 === 1) {
  147. that.scaleList[i].src = require("../assets/newImage/xl1.png");
  148. } else if (i % 3 === 2) {
  149. that.scaleList[i].src = require("../assets/newImage/xl2.png");
  150. } else {
  151. that.scaleList[i].src = require("../assets/newImage/xl3.png");
  152. }
  153. }
  154. that.totolSize = res.data.data.totalElements;
  155. } else {
  156. this.$message.error("访问服务器失败!");
  157. }
  158. }
  159. );
  160. },
  161. goBack() {
  162. this.$router.go(-1);
  163. },
  164. handleClick(tab) {
  165. this.activeName = tab
  166. this.pageNum = 1;
  167. this.queryList();
  168. // console.log(this.activeName)
  169. // console.log(tab, event);
  170. },
  171. handleSizeChange(val) {
  172. this.queryList();
  173. },
  174. handleCurrentChange(val) {
  175. this.pageNum = val;
  176. this.queryList();
  177. },
  178. //页面跳转
  179. scaleDetail(val) {
  180. this.$router.push({ path: "/menu/ScaleDetail" });
  181. //将scaleId存起来在测试页面取到ID,然后调用查询接口进行详细信息显示
  182. sessionStorage.setItem("scaleFlag", val);
  183. },
  184. },
  185. };
  186. </script>
  187. <style scoped>
  188. .mainTable-top {
  189. margin-top: 5%;
  190. }
  191. .mainTable-tab {
  192. cursor: pointer;
  193. margin-left: 100px;
  194. margin-right: 100px;
  195. border-radius: 5px;
  196. border: 1px solid #000000;
  197. text-align: center;
  198. height: 150px;
  199. margin-bottom: 100px;
  200. }
  201. .mainTable-tab-p {
  202. padding-top: 40px;
  203. }
  204. .xl_input >>> .el-input__inner {
  205. border: 0;
  206. border-radius: 20px;
  207. background-color: #f4f4f4;
  208. }
  209. .xl_tabs {
  210. margin-top: 10px;
  211. }
  212. .xl_tabs >>> .el-tabs__nav-wrap::after {
  213. content: "";
  214. position: absolute;
  215. left: 0;
  216. bottom: 0;
  217. width: 100%;
  218. height: 2px;
  219. background-color: #ffffff !important;
  220. z-index: 1;
  221. }
  222. .xl_content {
  223. overflow: hidden;
  224. text-overflow: ellipsis;
  225. width: 65vw;
  226. height: 6.7vh;
  227. display: -webkit-box;
  228. -webkit-box-orient: vertical;
  229. -webkit-line-clamp: 2;
  230. word-break: break-all;
  231. min-width: 100px;
  232. font-size: 0.9vw;
  233. font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  234. font-weight: 400;
  235. color: #929292;
  236. }
  237. .xl_img {
  238. width: 7.6vw;
  239. height: 7.6vw;
  240. margin-right: 2.1vw;
  241. border-radius: 12px;
  242. }
  243. .xl_title {
  244. font-size: 1.2vw;
  245. font-family: Source Han Sans CN-Bold, Source Han Sans CN;
  246. font-weight: bold;
  247. color: #0f0f0f;
  248. display: block;
  249. margin-bottom: 1.4vh;
  250. }
  251. .xl_free {
  252. font-weight: 500;
  253. color: #f9476e;
  254. font-size: 11px;
  255. }
  256. .xl_test {
  257. font-size: 0.8vw;
  258. font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  259. font-weight: 400;
  260. color: #0f0f0f;
  261. }
  262. .xl_detail {
  263. cursor: pointer;
  264. font-size: 12px;
  265. font-weight: 500;
  266. color: #57acbb;
  267. line-height: 30px;
  268. }
  269. .xl_input {
  270. margin-top: 3vh;
  271. }
  272. .scale_item {
  273. display: flex;
  274. border-bottom: 1px solid #bbc5d4;
  275. padding: 2.2vh 0 2.2vh 2.2vh;
  276. align-items: center;
  277. cursor: pointer;
  278. transition: all 0.3s linear;
  279. }
  280. .scale_item:hover {
  281. background: #f5f5f5;
  282. }
  283. .pagin_class {
  284. margin-top: 3vh;
  285. }
  286. .my_tabs {
  287. display: flex;
  288. padding: 1.67vh 0;
  289. border-bottom: 1px solid #BBC5D4;
  290. }
  291. .tab_item {
  292. line-height: 4.8vh;
  293. border-radius: 30px 30px 30px 30px;
  294. opacity: 1;
  295. text-align: center;
  296. padding: 0 1.04vw;
  297. font-size: 1.45vw;
  298. font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  299. font-weight: 400;
  300. color: #0F0F0F;
  301. cursor: pointer;
  302. transition: all 0.1s linear;
  303. }
  304. .is_active {
  305. background: #1fd18e;
  306. color: #ffffff;
  307. }
  308. </style>