BigRiskTable.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. <template>
  2. <div class="risk_table_container">
  3. <div class="risk_table_header">
  4. <div class="risk_table_header_tab">
  5. <el-button class="parallelogram-button" v-for="(item, index) in buttons" :key="index" :class="{ highlight: activeIndex === index }" @click="setActive(index)">
  6. <span class="text-container" :class="{ 'text-container-highlight': activeIndex === index }">{{ item.title }}</span>
  7. </el-button>
  8. </div>
  9. <div class="risk_table_header_back" @click="goBack"></div>
  10. </div>
  11. <div class="risk_table_search">
  12. <div class="title_content">
  13. <div class="title">
  14. <img src="../../../assets/img/Group 4645(1).png" alt="" />
  15. <span>风险情况</span>
  16. </div>
  17. <div class="select_search">
  18. <el-select v-model="selectSearchObj.value" placeholder="风险级别" popper-class="custom-select">
  19. <el-option v-for="item in riskTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
  20. </el-select>
  21. <el-select v-model="selectSearchObj.type" placeholder="风险类型" popper-class="custom-select">
  22. <el-option v-for="item in riskTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
  23. </el-select>
  24. <el-select v-model="selectSearchObj.value" placeholder="全部状态" popper-class="custom-select">
  25. <el-option v-for="item in riskTypeOptions" :key="item.value" :label="item.label" :value="item.value" />
  26. </el-select>
  27. </div>
  28. </div>
  29. <div class="line"></div>
  30. </div>
  31. <el-table :data="tableData" class="dialog_table" @row-click="handleRowClick">
  32. <el-table-column type="index" width="80" label="编号" />
  33. <el-table-column prop="date" label="风险名称" align="center" />
  34. <el-table-column prop="name" label="风险等级" align="center" />
  35. <el-table-column prop="name" label="报告单位" align="center" />
  36. <el-table-column prop="name" label="报告时间" align="center" />
  37. <el-table-column prop="name" label="发生地址" align="center" />
  38. <el-table-column prop="name" label="处置单位" align="center" />
  39. <el-table-column prop="name" label="病例数" align="center" />
  40. <el-table-column prop="name" label="重点场所" align="center" />
  41. <el-table-column prop="name" label="重点人群" align="center" />
  42. <el-table-column prop="name" label="最新状态" align="center" />
  43. </el-table>
  44. </div>
  45. </template>
  46. <script setup>
  47. import TowLevelTitle from '../../../components/TowLevelTitle'
  48. import { ref, watch, reactive, toRefs, onBeforeMount, onMounted } from 'vue'
  49. import { useRiskTableStore } from '@/store/riskTable.js'
  50. let riskTableStore = useRiskTableStore()
  51. import { useCommonStore } from '@/store/common.js'
  52. let commonStore = useCommonStore()
  53. const emit = defineEmits(['changeRiskView'])
  54. // const props = defineProps({
  55. // comeFrom: {}
  56. // })
  57. watch(
  58. () => riskTableStore.comeFrom,
  59. (newObj, oldObj) => {},
  60. {
  61. deep: true,
  62. immediate: true
  63. }
  64. )
  65. let buttons = ref([
  66. { id: 0, title: '当日', active: true },
  67. { id: 1, title: '当月', active: false },
  68. { id: 1, title: '当年', active: false }
  69. ])
  70. let activeIndex = ref(0) // 存储当前高亮按钮的索引
  71. function setActive(index) {
  72. // 切换高亮按钮,点击时高亮切换
  73. activeIndex.value = index
  74. }
  75. let selectSearchObj = ref({})
  76. const riskTypeOptions = ref([
  77. { value: 1, label: '风险个案' },
  78. { value: 2, label: '风险事件' },
  79. { value: 3, label: '风险信息' }
  80. ])
  81. const tableData = ref([
  82. {
  83. date: '浦东新区',
  84. name: '22',
  85. address: 'No. 189, Grove St, Los Angeles'
  86. },
  87. {
  88. date: '浦东新区',
  89. name: '22',
  90. address: 'No. 189, Grove St, Los Angeles'
  91. },
  92. {
  93. date: '浦东新区',
  94. name: '22',
  95. address: 'No. 189, Grove St, Los Angeles'
  96. },
  97. {
  98. date: '浦东新区',
  99. name: '22',
  100. address: 'No. 189, Grove St, Los Angeles'
  101. }
  102. ])
  103. function handleRowClick() {
  104. if (riskTableStore.getComeFrom() === '风险列表') {
  105. // commonStore.setActiveIndex(1)
  106. riskTableStore.setInitShow(false)
  107. riskTableStore.setBigRiskTableShow(false)
  108. riskTableStore.setDisposalShow(true)
  109. riskTableStore.setCurrentBackground(1)
  110. } else {
  111. commonStore.setActiveIndex(1)
  112. riskTableStore.setInitShow(false)
  113. riskTableStore.setBigRiskTableShow(false)
  114. riskTableStore.setDisposalShow(true)
  115. }
  116. if (riskTableStore.getComeFrom() === '风险概况') {
  117. riskTableStore.setCurrentBackground(1)
  118. } else if (riskTableStore.getComeFrom() === '个案处置') {
  119. riskTableStore.setCurrentBackground(2)
  120. } else if (riskTableStore.getComeFrom() === '信息报告') {
  121. riskTableStore.setCurrentBackground(3)
  122. }
  123. }
  124. function goBack() {
  125. if (riskTableStore.getComeFrom() === '风险列表') {
  126. // commonStore.setActiveIndex(0)
  127. riskTableStore.setInitShow(true)
  128. riskTableStore.setBigRiskTableShow(false)
  129. riskTableStore.setDisposalShow(false)
  130. } else {
  131. // commonStore.setActiveIndex(1)
  132. riskTableStore.setInitShow(false)
  133. riskTableStore.setBigRiskTableShow(false)
  134. riskTableStore.setDisposalShow(true)
  135. }
  136. if (riskTableStore.getComeFrom() === '风险概况') {
  137. riskTableStore.setCurrentBackground(1)
  138. } else if (riskTableStore.getComeFrom() === '个案处置') {
  139. riskTableStore.setCurrentBackground(2)
  140. } else if (riskTableStore.getComeFrom() === '信息报告') {
  141. riskTableStore.setCurrentBackground(3)
  142. }
  143. }
  144. </script>
  145. <style lang="scss" scoped>
  146. .risk_table_container {
  147. width: 1092px;
  148. height: 100%;
  149. // background-color: pink;
  150. .risk_table_header {
  151. width: 1092px;
  152. height: 42px;
  153. display: flex;
  154. align-items: center;
  155. justify-content: space-between;
  156. margin-bottom: 16px;
  157. .risk_table_header_tab {
  158. .parallelogram-button {
  159. margin: 0;
  160. display: inline-block;
  161. width: 100px;
  162. height: 40px;
  163. font-family: Alibaba PuHuiTi 3, Alibaba PuHuiTi 30;
  164. font-weight: normal;
  165. font-size: 16px;
  166. color: #e4ebf4;
  167. line-height: 19px;
  168. text-align: center;
  169. font-style: normal;
  170. text-transform: none;
  171. text-align: center;
  172. border: none;
  173. cursor: pointer;
  174. transform: skew(-10deg);
  175. /* 倾斜生成平行四边形 */
  176. background: url(../../../assets/img/risk_tab.png) no-repeat;
  177. background-size: 100% 100%;
  178. .text-container {
  179. transform: skew(10deg);
  180. }
  181. .text-container-highlight {
  182. }
  183. }
  184. .parallelogram-button.highlight {
  185. background: url(../../../assets/img/risk_tab_active.png) no-repeat;
  186. background-size: 100% 100%;
  187. }
  188. .parallelogram-button:hover {
  189. // background-color: #66b1ff;
  190. }
  191. }
  192. .risk_table_header_back {
  193. width: 132px;
  194. height: 34px;
  195. background: url(../../../assets/img/back.png) no-repeat;
  196. background-size: 100% 100%;
  197. display: flex;
  198. align-items: center;
  199. justify-content: center;
  200. font-family: YouSheBiaoTiHei, YouSheBiaoTiHei;
  201. font-weight: 400;
  202. font-size: 20px;
  203. color: #e0e5fa;
  204. }
  205. }
  206. .risk_table_search {
  207. // display: flex;
  208. height: 28px;
  209. width: 100%;
  210. margin-bottom: 14px;
  211. .title_content {
  212. width: 100%;
  213. display: flex;
  214. align-items: center;
  215. // margin-bottom:5px;
  216. .title {
  217. width: 100%;
  218. display: flex;
  219. align-items: center;
  220. width: 100%;
  221. font-family: Alibaba PuHuiTi 3, Alibaba PuHuiTi 30;
  222. font-weight: normal;
  223. font-size: 16px;
  224. color: #ffffff;
  225. line-height: 24px;
  226. text-shadow: 0px 0px 9px #158eff;
  227. text-align: left;
  228. font-style: normal;
  229. text-transform: none;
  230. > img {
  231. margin-right: 10px;
  232. }
  233. }
  234. .select_search {
  235. display: flex;
  236. gap: 7px;
  237. width: 915px;
  238. > .el-select {
  239. width: 177px;
  240. height: 24px;
  241. }
  242. }
  243. }
  244. .line {
  245. margin-top: 5px;
  246. width: 100%;
  247. height: 1px;
  248. background: linear-gradient(90deg, rgba(59, 220, 255, 0) 0%, rgba(59, 220, 255, 0.6) 34%, rgba(59, 220, 255, 0) 100%);
  249. border-radius: 0px 0px 0px 0px;
  250. }
  251. }
  252. }
  253. // 表格行间距
  254. :deep(.el-table__body) {
  255. -webkit-border-vertical-spacing: 6px;
  256. }
  257. :deep(.el-table__inner-wrapper:before) {
  258. height: 0;
  259. }
  260. </style>