project.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. <template>
  2. <div class="hc-page-box">
  3. <HcCard class="hc-card-table-box" :class="isTableInfo?'info':''">
  4. <HcCardItem class="hc-card-table-data">
  5. <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCurrentRow isCheck @selection-change="tableSelection" @row-click="tableRowClick">
  6. <template #action="{row}">
  7. <el-button type="primary" size="small" @click.stop="viewClick(row)">查看数据</el-button>
  8. </template>
  9. </HcTable>
  10. <template #action>
  11. <HcPages :pages="searchForm" @change="pageChange"/>
  12. </template>
  13. </HcCardItem>
  14. <HcCardItem class="hc-card-table-info" scrollbar>
  15. <template #header>
  16. <div class="hc-project-box">
  17. <div class="hc-project-icon">
  18. <HcIcon name="stack"/>
  19. </div>
  20. <div class="ml-2 project-name">{{tableRow.projectName}}</div>
  21. </div>
  22. </template>
  23. <template #extra>
  24. <div class="hc-close-icon" @click="closeClick">
  25. <HcIcon name="close" class="text-hover"/>
  26. </div>
  27. </template>
  28. <div class="hc-table-data-info">
  29. <div class="item">
  30. <div class="title">项目概况:</div>
  31. <div class="content">{{tableRow.projectGist}}</div>
  32. </div>
  33. <div class="item">
  34. <div class="title">建设工期:</div>
  35. <div class="content">{{tableRow.projectGist}}</div>
  36. </div>
  37. <div class="item">
  38. <div class="title">总里程:</div>
  39. <div class="content">120(KM)</div>
  40. </div>
  41. <div class="item">
  42. <div class="title">投资预算:</div>
  43. <div class="content">{{tableRow.estimatedAmount}}(万)</div>
  44. </div>
  45. <div class="item">
  46. <div class="title">开工时间:</div>
  47. <div class="content">{{tableRow.actualStartTime}}</div>
  48. </div>
  49. <div class="item">
  50. <div class="title">完工时间:</div>
  51. <div class="content">{{tableRow.actualEndTime}}</div>
  52. </div>
  53. </div>
  54. </HcCardItem>
  55. </HcCard>
  56. </div>
  57. </template>
  58. <script setup>
  59. import {ref, watch, onMounted} from "vue";
  60. import {useAppStore} from "~src/store";
  61. import {useRouter} from 'vue-router'
  62. //变量
  63. const router = useRouter()
  64. const useAppState = useAppStore()
  65. const projectId = ref(useAppState.getProjectId);
  66. //渲染完成
  67. onMounted(() => {
  68. const info = useAppState.getProjectContract || []
  69. projectContractData(info);
  70. })
  71. //监听
  72. watch(() => [
  73. useAppState.getProjectContract,
  74. ], ([projectContractArr]) => {
  75. projectContractData(projectContractArr || []);
  76. })
  77. const projectContractData = (arr) => {
  78. //console.log(arr)
  79. tableData.value = arr
  80. }
  81. //搜索内容
  82. const searchForm = ref({
  83. current: 1, size: 20, total: 0
  84. })
  85. //分页被点击
  86. const pageChange = ({current, size}) => {
  87. searchForm.value.current = current
  88. searchForm.value.size = size
  89. getTableData()
  90. }
  91. //表格数据
  92. const tableRef = ref(null)
  93. const tableColumn = ref([
  94. {key:'projectName', name: '项目名称', width: 600},
  95. {key:'key2', name: '入库时间'},
  96. {key:'key3', name: '案卷总量'},
  97. {key:'key4', name: '责任单位'},
  98. {key:'action', name: '操作', width: 120},
  99. ])
  100. const tableData = ref([])
  101. //获取数据
  102. const tableLoading = ref(false)
  103. const getTableData = async () => {
  104. }
  105. //多选
  106. const tableCheckedKeys = ref([]);
  107. const tableSelection = (rows) => {
  108. tableCheckedKeys.value = rows
  109. }
  110. const isTableInfo = ref(false)
  111. const tableRow = ref({})
  112. const tableRowClick = ({row}) => {
  113. tableRow.value = row
  114. isTableInfo.value = true
  115. }
  116. const closeClick = () => {
  117. isTableInfo.value = false
  118. }
  119. //查看
  120. const viewClick = (row) => {
  121. projectId.value = row?.id
  122. //设置缓存
  123. useAppState.setProjectInfo(row)
  124. useAppState.setProjectId(row?.id)
  125. //跳转
  126. // router.push({path: '/home/index'});
  127. router.push({path: '/using/stats'});//跳转到档案统计页面
  128. }
  129. </script>
  130. <style lang="scss" scoped>
  131. .hc-card-table-box {
  132. .hc-card-table-info {
  133. display: none;
  134. }
  135. &.info {
  136. .hc-card-table-data {
  137. height: calc(100% - 340px);
  138. }
  139. .hc-card-table-info {
  140. display: block;
  141. height: 320px;
  142. margin-top: 20px;
  143. .hc-project-box {
  144. position: relative;
  145. display: flex;
  146. align-items: center;
  147. font-size: 16px;
  148. .hc-project-icon {
  149. position: relative;
  150. display: flex;
  151. align-items: center;
  152. }
  153. }
  154. .hc-close-icon {
  155. color: initial;
  156. font-size: 18px;
  157. }
  158. .hc-table-data-info {
  159. position: relative;
  160. .item {
  161. position: relative;
  162. display: flex;
  163. .title {
  164. width: 90px;
  165. }
  166. .content {
  167. position: relative;
  168. flex: 1;
  169. }
  170. }
  171. .item + .item {
  172. margin-top: 10px;
  173. }
  174. }
  175. }
  176. }
  177. }
  178. </style>