ScaleListResult.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389
  1. <template>
  2. <div class="main_right_height">
  3. <div class="">
  4. <div class="">
  5. <TopDes :flag="true" topDesFont="量表报告查看"></TopDes>
  6. <el-row class="mainTable-top-two">
  7. <el-col :span="1">
  8. <div>&nbsp;</div>
  9. </el-col>
  10. <el-col :span="10" class="search_card">
  11. <div>
  12. <el-input
  13. class="xl_input"
  14. placeholder="请输入搜索内容"
  15. v-model="queryKeyword"
  16. prefix-icon="el-icon-search"
  17. @input="queryLikeWord"
  18. clearable
  19. >
  20. </el-input>
  21. </div>
  22. </el-col>
  23. <el-col :span="11">
  24. <div>&nbsp;</div>
  25. </el-col>
  26. </el-row>
  27. <el-row :gutter="20">
  28. <el-col
  29. v-for="(item, index) in dataList"
  30. :key="index"
  31. @click="detailP(item.id)"
  32. :span="6"
  33. :offset="1"
  34. style="margin-right: 20px"
  35. >
  36. <div class="card" @click="queryDetail(item.id)">
  37. <img src="../assets/newImage/xl1.png" alt="" class="img_card" />
  38. <div style="display: block; margin-left: 1vw">
  39. <!-- <h3 class="h3_card">{{ item.name }}</h3> -->
  40. <h3 class="h3_card" :title="item.name">{{ formatTitle(item.name)}}</h3>
  41. <div class="time_card">
  42. {{ formatData(item.testDate) }}
  43. </div>
  44. <div class="desc_card">
  45. {{ formatDesc(item.description) }}
  46. </div>
  47. </div>
  48. </div>
  49. </el-col>
  50. </el-row>
  51. <el-row> </el-row>
  52. <!-- <ul>
  53. <li
  54. v-for="(item, index) in dataList"
  55. :key="index"
  56. @click="detailP(item.id)"
  57. >
  58. <img src="../assets/newImage/xl1.png" alt="" />
  59. <div style="display: block">
  60. <h2>{{ item.name }}</h2>
  61. <div class="content">
  62. {{ item.testDate }}
  63. </div>
  64. <div class="goDetail">
  65. <a href="javascript:;"> 查看详情></a>
  66. </div>
  67. </div>
  68. </li>
  69. </ul> -->
  70. </div>
  71. <div class="pageNationBox">
  72. <el-pagination
  73. background
  74. layout="total,prev, pager, next"
  75. :total="total"
  76. :page-size="pageSize"
  77. :current-page="pageNum"
  78. @current-change="handleCurrentChange"
  79. >
  80. </el-pagination>
  81. </div>
  82. </div>
  83. </div>
  84. </template>
  85. <script>
  86. export default {
  87. data() {
  88. return {
  89. queryKeyword: "",
  90. pageSize: 8,
  91. pageNum: 1,
  92. dataList: [],
  93. total: 0,
  94. userBid: "",
  95. institutionNo: "",
  96. persionDetailData: null,
  97. identifier: "",
  98. };
  99. },
  100. //页面初始化函数
  101. created() {},
  102. mounted() {
  103. this.identifier = sessionStorage.getItem("num");
  104. this.init();
  105. },
  106. methods: {
  107. goBack() {
  108. this.$router.go(-1);
  109. },
  110. queryDetail(id) {
  111. sessionStorage.setItem("back_page", "2");
  112. this.getAnswerQuestionPaymentSuccess(id);
  113. },
  114. getAnswerQuestionPaymentSuccess(id) {
  115. sessionStorage.setItem("back_page", "2");
  116. let _this = this;
  117. this.$router.push({
  118. path: "/persionDetailSCl",
  119. params: {
  120. id: id,
  121. },
  122. query: {
  123. // phone: this.userBid,
  124. id: id,
  125. come: 1,
  126. testPlanId: '',
  127. },
  128. });
  129. // _this.$http.post(`v1/record/find/${id}`, {}, (res) => {
  130. // if (res.data.code == 200 && res.data.data) {
  131. // _this.resultJsonParams = res.data.data;
  132. // // let sleep = JSON.parse(
  133. // // _this.resultJsonParams.userRecordEntity.testResult
  134. // // );
  135. // // sleep = sleep[0].newTableContext.result[0].improvementSuggestions;
  136. // // if (_this.scale_flag === "20210910163158") {
  137. // // _this.askEnd(sleep);
  138. // // this.inputFlag = 0;
  139. // // }
  140. // // if (_this.scale_flag === "20220805135201") {
  141. // // _this.askEnd(sleep);
  142. // // this.inputFlag = 0;
  143. // // }
  144. // // let testResult = JSON.parse(res.data.userRecordEntity.testResult)[0]
  145. // // .version;
  146. // let testResult = JSON.parse(
  147. // res.data.data.userRecordEntity.testResult
  148. // )[0].version;
  149. // if (testResult == 2) {
  150. // _this.$router.push({
  151. // name: "scaleResultSCl",
  152. // params: { tableData: _this.resultJsonParams },
  153. // });
  154. // } else {
  155. // _this.$router.push({
  156. // name: "scaleResult",
  157. // params: { tableData: _this.resultJsonParams },
  158. // });
  159. // }
  160. // }
  161. // });
  162. },
  163. queryLikeWord() {
  164. this.pageNum = 1;
  165. this.init();
  166. },
  167. handleCurrentChange(val) {
  168. this.pageNum = val;
  169. this.init();
  170. },
  171. init() {
  172. let that = this;
  173. that.$http.post(
  174. `v1/record/find`,
  175. {
  176. pageNum: that.pageNum,
  177. pageSize: that.pageSize,
  178. scaleName: that.queryKeyword,
  179. // startDate: that.startDate,
  180. // endDate: that.endDate,
  181. identifier: that.identifier,
  182. },
  183. (res) => {
  184. if (res.data.code == 200) {
  185. that.dataList = res.data.data.data;
  186. that.total = res.data.data.allNum;
  187. } else {
  188. this.$message.error("访问服务器失败!");
  189. }
  190. }
  191. );
  192. },
  193. formatData(str) {
  194. str = str.replace(/年/g, "-");
  195. str = str.replace(/月/g, "-");
  196. str = str.replace(/日/g, " ");
  197. str = str.replace(/时/g, ":");
  198. str = str.replace(/分/g, ":");
  199. str = str.replace(/秒/g, "");
  200. return str;
  201. },
  202. formatDesc(str) {
  203. return str.length < 30 ? str : str.substring(0, 30) + "...";
  204. },
  205. formatTitle(str) {
  206. return str.length < 8 ? str : str.substring(0, 8) + "...";
  207. },
  208. },
  209. };
  210. </script>
  211. <style scoped>
  212. .wrap {
  213. width: 1280px;
  214. margin: 0 auto;
  215. }
  216. .cardList ul {
  217. display: flex;
  218. min-height: 562px;
  219. justify-content: flex-start;
  220. flex-wrap: wrap;
  221. }
  222. .cardList ul li {
  223. width: 180px;
  224. height: 221px;
  225. background: rgb(255, 255, 255);
  226. box-shadow: 0px 3px 6px rgb(87, 172, 187);
  227. border-radius: 4px;
  228. margin: 30px 35px;
  229. cursor: pointer;
  230. }
  231. @media screen and (max-width: 1024px) {
  232. .cardList ul li {
  233. margin: 30px 10px;
  234. }
  235. .wrap {
  236. width: 100%;
  237. margin: 0;
  238. }
  239. }
  240. .cardList ul li img {
  241. width: 180px;
  242. height: 112px;
  243. }
  244. .cardList ul li h2 {
  245. width: 142px;
  246. font-size: 18px;
  247. font-family: PingFang SC;
  248. font-weight: 500;
  249. line-height: 25px;
  250. color: #333333;
  251. margin-left: 9px;
  252. overflow: hidden;
  253. text-overflow: ellipsis;
  254. white-space: nowrap;
  255. }
  256. .cardList ul li p {
  257. font-size: 16px;
  258. color: #666666;
  259. }
  260. .cardList ul li .content {
  261. font-size: 12px;
  262. font-family: PingFang SC;
  263. font-weight: 400;
  264. line-height: 20px;
  265. color: #999999;
  266. margin-left: 9px;
  267. }
  268. .goDetail {
  269. margin: 5px 0 10px 9px;
  270. }
  271. .goDetail a {
  272. font-size: 14px;
  273. font-family: PingFang SC;
  274. font-weight: 400;
  275. line-height: 20px;
  276. color: #57acbb;
  277. }
  278. .pageNationBox {
  279. margin-bottom: 30px;
  280. padding: 20px 10px;
  281. text-align: center;
  282. }
  283. .view-text {
  284. /**
  285. 思路:
  286. 1.设置inline-block属相
  287. 2.强制不换行
  288. 3.固定高度
  289. 4.隐藏超出部分
  290. 5.显示“……”
  291. */
  292. display: inline-block;
  293. word-break: keep-all;
  294. white-space: nowrap;
  295. width: 960px;
  296. overflow: hidden;
  297. text-overflow: ellipsis;
  298. }
  299. .imgSiz {
  300. width: 120px;
  301. height: 75px;
  302. margin-right: 15px;
  303. }
  304. .main_right_height {
  305. background: #ffffff;
  306. display: block !important;
  307. overflow: hidden;
  308. }
  309. .time_card {
  310. font-size: 0.8vw;
  311. font-family: PingFang SC;
  312. font-weight: 500;
  313. line-height: 1.6;
  314. color: rgb(171, 168, 168);
  315. overflow: hidden;
  316. text-overflow: ellipsis;
  317. white-space: nowrap;
  318. }
  319. .xl_input >>> .el-input__inner {
  320. width: 35.4vw;
  321. line-height: 64px;
  322. background: #eaeaea;
  323. border-radius: 30px 30px 30px 30px;
  324. opacity: 1;
  325. box-sizing: border-box;
  326. font-weight: 400;
  327. color: #929292;
  328. }
  329. .search_card {
  330. margin-bottom: 20px;
  331. }
  332. .card {
  333. display: flex;
  334. box-sizing: border-box;
  335. width: 24.6vw;
  336. /* height: 20.37vh; */
  337. padding: 1.38vh;
  338. background: #eaeaea;
  339. opacity: 1;
  340. border-radius: 0.83vw;
  341. margin-bottom: 1.48vh;
  342. cursor: pointer;
  343. }
  344. .card .img_card {
  345. display: block;
  346. width: 9.9vw;
  347. height: 9.9vw;
  348. background: #ffffff;
  349. border-radius: 1vw;
  350. opacity: 1;
  351. border: 1px solid #f5f5f5;
  352. }
  353. .h3_card {
  354. font-size: 1.1vw;
  355. font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  356. font-weight: 400;
  357. color: #0f0f0f;
  358. letter-spacing: 0.2vw;
  359. margin: 1vh 0 0.5vh;
  360. }
  361. .desc_card {
  362. width: 100%;
  363. margin-top: 2vh;
  364. font-size: 0.9vw;
  365. font-family: Source Han Sans CN-Normal, Source Han Sans CN;
  366. font-weight: 400;
  367. color: #0f0f0f;
  368. letter-spacing: 0.4vw;
  369. }
  370. </style>