datav.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590
  1. <template>
  2. <div class="hc-datav-main hc-full">
  3. <img class="hc-datav-bg" :src="bgPng" alt="bg">
  4. <div id="hc-datav-header-body" class="relative">
  5. <div class="hc-datav-header">
  6. <img id="datav-header-bg" :src="png2" alt="头部图">
  7. <div class="header-title hc-flex-center w-full">
  8. <div ref="nameRef" class="name hc-flex" @click="toHomePage">
  9. <i class="i-solar-graph-outline" />
  10. 项目数据看板
  11. </div>
  12. </div>
  13. <div class="hc-datav-search-select hc-flex w-full">
  14. <div ref="searchRef" class="relative">
  15. <HcDatavSelect v-model="searchForm.year" :datas="yearArr" />
  16. <HcDatavSelect v-model="pageType" :datas="pageTypeArr" :clearable="false" @change="pageTypeChange" />
  17. <template v-if="pageType === '1'">
  18. <HcDatavSelect v-model="searchForm.month" :datas="monthArr" placeholder="选择月份" @change="searchChange" />
  19. <HcDatavSelect v-model="searchForm.projectScheduleType" :datas="lagArr" @change="searchChange" />
  20. <HcDatavSelect v-if="searchForm.projectScheduleType === '3'" v-model="searchForm.projectScheduleGrade" :datas="levelArr" placeholder="滞后等级" @change="searchChange" />
  21. </template>
  22. <HcDatavSelect v-model="searchForm.projectStage" :datas="stageArr" placeholder="项目阶段" @change="searchChange" />
  23. <HcDatavSelect v-if="pageType === '1'" v-model="searchForm.projectType" :datas="typeArr" placeholder="项目类型" @change="searchChange" />
  24. <HcDatavSelect v-else v-model="searchForm.quarter" :datas="quarterArr" placeholder="选择季度" />
  25. </div>
  26. <div class="date flex-1">截止时间:2024年04月08日</div>
  27. </div>
  28. </div>
  29. <div class="hc-datav-total relative p-[14px]">
  30. <el-row v-if="pageType === '1'" :gutter="24">
  31. <el-col :span="6">
  32. <HcDatavCard title="项目总量" :num="projectStat.projectTotal" unit="" color="#D5DEFF" />
  33. </el-col>
  34. <el-col :span="6">
  35. <HcDatavCard title="计划总投资额" :num="projectStat.planAllMoney" unit="亿" color="#EEB500" />
  36. </el-col>
  37. <el-col :span="6">
  38. <HcDatavCard :num="projectStat.currentMoney" unit="亿" color="#0DD70C">
  39. <template #title>
  40. <span style="color: #FE0301;">目前</span>
  41. <span>实际完成投资额</span>
  42. </template>
  43. </HcDatavCard>
  44. </el-col>
  45. <el-col :span="6">
  46. <HcDatavCard title="投资完成比例" :num="projectStat.investRatio" unit="%" color="#1DC98B" />
  47. </el-col>
  48. </el-row>
  49. <el-row v-else :gutter="24">
  50. <el-col :span="6" />
  51. <el-col :span="6">
  52. <HcDatavCard>
  53. <div class="hc-diy-datav-card hc-full hc-flex-center">
  54. <span class="num vertical-sub text-[60px] font-bold" style="color: #ECCF6D">8</span>
  55. <span class="text text-[28px] font-bold">个方面</span>
  56. </div>
  57. </HcDatavCard>
  58. </el-col>
  59. <el-col :span="6">
  60. <HcDatavCard>
  61. <div class="hc-diy-datav-card hc-full hc-flex-center">
  62. <span class="num vertical-sub text-[60px] font-bold" style="color: #0BD70E">30</span>
  63. <span class="text text-[28px] font-bold">项任务</span>
  64. </div>
  65. </HcDatavCard>
  66. </el-col>
  67. <el-col :span="6" />
  68. </el-row>
  69. </div>
  70. <div class="hc-datav-divider" />
  71. </div>
  72. <div id="hc-datav-row-total-body" class="hc-datav-row-total relative p-[14px]">
  73. <el-row v-if="pageType === '1'" :gutter="24" class="h-full">
  74. <el-col :span="8" class="h-full">
  75. <div class="hc-datav-row-column h-full">
  76. <div class="title">投资数据</div>
  77. <div class="notes">
  78. <span>(已完成/</span>
  79. <span class="red">未完成</span>
  80. <span>)</span>
  81. </div>
  82. <div class="gird-card-box relative mt-4">
  83. <hc-row :gutter="20">
  84. <hc-col :span="12">
  85. <div class="gird-card hc-flex p-[14px]">
  86. <div class="upper-num a1 hc-flex-center h-[52px] w-[52px] text-[30px]">Ⅰ</div>
  87. <div class="content relative ml-[12px] h-[52px] flex-1">
  88. <div class="name mb-[10px] text-center text-[16px]">一季度</div>
  89. <div class="data text-center text-[24px]">
  90. <span class="num font-bold">{{ investStat?.oneFinished || 0 }}</span>
  91. <span class="line">/</span>
  92. <span class="red font-bold">{{ investStat?.oneUnFinished || 0 }}</span>
  93. <span class="unit ml-[5px] text-[14px]">(亿)</span>
  94. </div>
  95. </div>
  96. </div>
  97. </hc-col>
  98. <hc-col :span="12">
  99. <div class="gird-card hc-flex p-[14px]">
  100. <div class="upper-num a2 hc-flex-center h-[52px] w-[52px] text-[30px]">Ⅱ</div>
  101. <div class="content relative ml-[12px] h-[52px] flex-1">
  102. <div class="name mb-[10px] text-center text-[16px]">二季度</div>
  103. <div class="data text-center text-[24px]">
  104. <span class="num font-bold">{{ investStat?.twoFinished || 0 }}</span>
  105. <span class="line">/</span>
  106. <span class="red font-bold">{{ investStat?.twoUnFinished || 0 }}</span>
  107. <span class="unit ml-[5px] text-[14px]">(亿)</span>
  108. </div>
  109. </div>
  110. </div>
  111. </hc-col>
  112. <hc-col :span="12">
  113. <div class="gird-card hc-flex p-[14px]">
  114. <div class="upper-num a3 hc-flex-center h-[52px] w-[52px] text-[30px]">Ⅲ</div>
  115. <div class="content relative ml-[12px] h-[52px] flex-1">
  116. <div class="name mb-[10px] text-center text-[16px]">三季度</div>
  117. <div class="data text-center text-[24px]">
  118. <span class="num font-bold">{{ investStat?.threeFinished || 0 }}</span>
  119. <span class="line">/</span>
  120. <span class="red font-bold">{{ investStat?.threeUnFinished || 0 }}</span>
  121. <span class="unit ml-[5px] text-[14px]">(亿)</span>
  122. </div>
  123. </div>
  124. </div>
  125. </hc-col>
  126. <hc-col :span="12">
  127. <div class="gird-card hc-flex p-[14px]">
  128. <div class="upper-num a4 hc-flex-center h-[52px] w-[52px] text-[30px]">Ⅳ</div>
  129. <div class="content relative ml-[12px] h-[52px] flex-1">
  130. <div class="name mb-[10px] text-center text-[16px]">四季度</div>
  131. <div class="data text-center text-[24px]">
  132. <span class="num font-bold">{{ investStat?.fourFinished || 0 }}</span>
  133. <span class="line">/</span>
  134. <span class="red font-bold">{{ investStat?.fourUnFinished || 0 }}</span>
  135. <span class="unit ml-[5px] text-[14px]">(亿)</span>
  136. </div>
  137. </div>
  138. </div>
  139. </hc-col>
  140. </hc-row>
  141. </div>
  142. <div class="hc-datav-divider" />
  143. <div v-if="searchForm.projectScheduleType !== '3'" class="hc-datav-table relative">
  144. <HcDatavTable :column="tableColumn1" :datas="tableData1" is-current @row-click="tableRowClick">
  145. <template #planAllMoney="{ row }">
  146. <span style="color: #06A3FF;" class="font-bold">{{ row.planAllMoney }}</span>
  147. </template>
  148. <template #currentMoney="{ row }">
  149. <span style="color: #10C90F;" class="font-bold">{{ row.currentMoney }}</span>
  150. </template>
  151. <template #unFinishedMoney="{ row }">
  152. <span style="color: #D7A70D;" class="font-bold">{{ row.unFinishedMoney }}</span>
  153. </template>
  154. </HcDatavTable>
  155. </div>
  156. <div v-else class="hc-datav-table relative">
  157. <HcDatavTable :column="lagColumn1" :datas="lagData1" is-current @row-click="lagRowClick">
  158. <template #key3="{ row }">
  159. <span style="color: #06A3FF;" class="font-bold">{{ row.key3 }}</span>
  160. </template>
  161. <template #key4="{ row }">
  162. <span style="color: #10C90F;" class="font-bold">{{ row.key4 }}</span>
  163. </template>
  164. <template #key5="{ row }">
  165. <span style="color: #D7A70D;" class="font-bold">{{ row.key5 }}</span>
  166. </template>
  167. </HcDatavTable>
  168. </div>
  169. </div>
  170. </el-col>
  171. <el-col :span="8" class="h-full">
  172. <div class="hc-datav-row-charts relative text-center">
  173. <div class="row-charts relative inline-block h-[335px] w-[520px]">
  174. <div class="title-box a1">
  175. <span>常规项目</span>
  176. <span class="num">{{ projectStat.total1 }}</span>
  177. </div>
  178. <div class="title-box a2">
  179. <span>超进度项目</span>
  180. <span class="num">{{ projectStat.total2 }}</span>
  181. </div>
  182. <div class="title-box a3">
  183. <span>滞后项目</span>
  184. <span class="num">{{ projectStat.total3 }}</span>
  185. </div>
  186. </div>
  187. </div>
  188. <div class="hc-datav-row-line relative">
  189. <div class="title">项目数据</div>
  190. <div class="hc-full relative">
  191. <HcDatavCharts v-if="isDatavCharts" />
  192. </div>
  193. </div>
  194. </el-col>
  195. <el-col :span="8" class="h-full">
  196. <div class="hc-datav-row-column h-full">
  197. <div class="title">进度数据</div>
  198. <div class="notes">
  199. <span>(已完成/</span>
  200. <span class="red">未完成</span>
  201. <span>)</span>
  202. </div>
  203. <div class="gird-card-box relative mt-4">
  204. <hc-row :gutter="20">
  205. <hc-col :span="12">
  206. <div class="gird-card hc-flex p-[14px]">
  207. <div class="upper-num a1 hc-flex-center h-[52px] w-[52px] text-[30px]">Ⅰ</div>
  208. <div class="content relative ml-[12px] h-[52px] flex-1">
  209. <div class="name mb-[10px] text-center text-[16px]">一季度</div>
  210. <div class="data text-center text-[24px]">
  211. <span class="num font-bold">{{ scheduleStat?.oneFinished || 0 }}</span>
  212. <span class="line">/</span>
  213. <span class="red font-bold">{{ scheduleStat?.oneUnFinished || 0 }}</span>
  214. </div>
  215. </div>
  216. </div>
  217. </hc-col>
  218. <hc-col :span="12">
  219. <div class="gird-card hc-flex p-[14px]">
  220. <div class="upper-num a2 hc-flex-center h-[52px] w-[52px] text-[30px]">Ⅱ</div>
  221. <div class="content relative ml-[12px] h-[52px] flex-1">
  222. <div class="name mb-[10px] text-center text-[16px]">二季度</div>
  223. <div class="data text-center text-[24px]">
  224. <span class="num font-bold">{{ scheduleStat?.twoFinished || 0 }}</span>
  225. <span class="line">/</span>
  226. <span class="red font-bold">{{ scheduleStat?.twoUnFinished || 0 }}</span>
  227. </div>
  228. </div>
  229. </div>
  230. </hc-col>
  231. <hc-col :span="12">
  232. <div class="gird-card hc-flex p-[14px]">
  233. <div class="upper-num a3 hc-flex-center h-[52px] w-[52px] text-[30px]">Ⅲ</div>
  234. <div class="content relative ml-[12px] h-[52px] flex-1">
  235. <div class="name mb-[10px] text-center text-[16px]">三季度</div>
  236. <div class="data text-center text-[24px]">
  237. <span class="num font-bold">{{ scheduleStat?.threeFinished || 0 }}</span>
  238. <span class="line">/</span>
  239. <span class="red font-bold">{{ scheduleStat?.threeUnFinished || 0 }}</span>
  240. </div>
  241. </div>
  242. </div>
  243. </hc-col>
  244. <hc-col :span="12">
  245. <div class="gird-card hc-flex p-[14px]">
  246. <div class="upper-num a4 hc-flex-center h-[52px] w-[52px] text-[30px]">Ⅳ</div>
  247. <div class="content relative ml-[12px] h-[52px] flex-1">
  248. <div class="name mb-[10px] text-center text-[16px]">四季度</div>
  249. <div class="data text-center text-[24px]">
  250. <span class="num font-bold">{{ scheduleStat?.fourFinished || 0 }}</span>
  251. <span class="line">/</span>
  252. <span class="red font-bold">{{ scheduleStat?.fourUnFinished || 0 }}</span>
  253. </div>
  254. </div>
  255. </div>
  256. </hc-col>
  257. </hc-row>
  258. </div>
  259. <div class="hc-datav-divider" />
  260. <div v-if="searchForm.projectScheduleType !== '3'" class="hc-datav-table relative">
  261. <HcDatavTable :column="tableColumn2" :datas="tableData2">
  262. <template #projectTotal="{ row }">
  263. <span style="color: #D8A70F;" class="font-bold">{{ row.projectTotal }}</span>
  264. </template>
  265. <template #finishedTotal="{ row }">
  266. <span style="color: #0BD70E;" class="font-bold">{{ row.finishedTotal }}</span>
  267. </template>
  268. <template #unFinishedTotal="{ row }">
  269. <span style="color: #FF0000;" class="font-bold">{{ row.unFinishedTotal }}</span>
  270. </template>
  271. </HcDatavTable>
  272. </div>
  273. <div v-else class="hc-datav-table relative">
  274. <HcDatavTable :column="lagColumn2" :datas="lagData2">
  275. <template #key3="{ row }">
  276. <span style="color: #D8A70F;" class="font-bold">{{ row.key3 }}</span>
  277. </template>
  278. <template #key4="{ row }">
  279. <span style="color: #0BD70E;" class="font-bold">{{ row.key4 }}</span>
  280. </template>
  281. <template #key5="{ row }">
  282. <span style="color: #FF0000;" class="font-bold">{{ row.key5 }}</span>
  283. </template>
  284. </HcDatavTable>
  285. </div>
  286. </div>
  287. </el-col>
  288. </el-row>
  289. <div v-else class="hc-datav-row-column work h-full">
  290. <div class="title">工作要点</div>
  291. <div class="hc-datav-table relative" style="height: 100%;">
  292. <HcDatavTable :column="workColumn" :datas="workData" />
  293. </div>
  294. </div>
  295. </div>
  296. <el-tour v-model="tourOpen" @close="tourFinishClose">
  297. <el-tour-step :target="nameRef" title="操作提示" description="点击这里,进入数据分析工具" />
  298. <el-tour-step :target="searchRef" title="操作提示" description="这里进行数据筛选查询" />
  299. </el-tour>
  300. </div>
  301. </template>
  302. <script setup>
  303. import { onMounted, onUnmounted, ref } from 'vue'
  304. import router from '~src/router/index'
  305. import { useAppStore } from '~src/store'
  306. import { getStore, setStore } from 'hc-vue3-ui'
  307. import bgPng from '~src/assets/images/datav-bg.png'
  308. import png2 from '~src/assets/images/datav-2.png'
  309. import HcDatavSelect from './modules/select.vue'
  310. import HcDatavCard from './modules/card.vue'
  311. import HcDatavTable from './modules/table.vue'
  312. import HcDatavCharts from './modules/charts.vue'
  313. import { getArrValue, getObjValue, isNullES } from 'js-fast-way'
  314. import { getDictionaryData } from '~src/utils/tools'
  315. import projectApi from '~api/datav/projectdata'
  316. const store = useAppStore()
  317. //引导
  318. const nameRef = ref(null)
  319. const searchRef = ref(null)
  320. const tourOpen = ref(false)
  321. onMounted(() => {
  322. const isTourOpen = getStore('isTourOpen')
  323. if (isNullES(isTourOpen)) {
  324. setTimeout(() => {
  325. tourOpen.value = true
  326. }, 500)
  327. }
  328. //窗口大小改变
  329. windowResize()
  330. setTimeout(() => {
  331. onWindowResize()
  332. }, 100)
  333. //生成月份
  334. let newMonthArr = [{ id: -1, name: '所有' }]
  335. for (let i = 0; i < 12; i++) {
  336. newMonthArr.push({ id: i + 1, name: `${i + 1}月` })
  337. }
  338. monthArr.value = newMonthArr
  339. getProType()
  340. getProStation()
  341. searchChange()
  342. })
  343. //关闭引导提示
  344. const tourFinishClose = () => {
  345. console.log('关闭引导提示')
  346. setStore('isTourOpen', true)
  347. }
  348. //搜索表单
  349. const pageType = ref('1')
  350. const searchForm = ref({ year: '2024', month: -1, projectScheduleGrade: '-1', projectStage: null, projectType: null, projectScheduleType:'-1' })
  351. const yearArr = [{ id: '2024', name: '2024年' }, { id: '2023', name: '2023年' }, { id: '2022', name: '2022年' }]
  352. const pageTypeArr = [{ id: '1', name: '项目数据看板' }, { id: '2', name: '工作要点' }]
  353. const monthArr = ref([])
  354. const lagArr = [{ id: '1', name: '超进度项目' }, { id: '2', name: '常规项目' }, { id: '3', name: '滞后项目' }, { id: '-1', name: '所有' }]
  355. const levelArr = [{ id: '1', name: '一级' }, { id: '2', name: '二级' }, { id: '3', name: '三级' }, { id: '-1', name: '所有' }]
  356. const stageArr = ref([])
  357. const typeArr = ref([])
  358. const quarterArr = [{ id: '1', name: '一季度' }, { id: '2', name: '二季度' }, { id: '3', name: '三季度' }, { id: '4', name: '四季度' }]
  359. const getProType = async () => {
  360. let data = await getDictionaryData('projectType', true)
  361. data.forEach((ele)=>{
  362. typeArr.value.push({
  363. id:ele.value,
  364. name:ele.label,
  365. })
  366. })
  367. }
  368. const getProStation = async () => {
  369. let data = await getDictionaryData('projectStage', true)
  370. data.forEach((ele)=>{
  371. stageArr.value.push({
  372. id:ele.value,
  373. name:ele.label,
  374. })
  375. })
  376. }
  377. //项目
  378. //搜索条
  379. //页面类型改变
  380. const pageTypeChange = () => {
  381. }
  382. //搜索条件改变1
  383. const searchChange = ()=>{
  384. getDataProjectStat()
  385. getDataInvestStat()
  386. getScheduleStat()
  387. }
  388. //获取项目统计
  389. const projectStat = ref({
  390. projectTotal:0,
  391. planAllMoney:0,
  392. currentMoney:0,
  393. investRatio:0,
  394. total1:0,
  395. total2:0,
  396. total3:0,
  397. })
  398. //获取项目统计
  399. const getDataProjectStat = async ()=>{
  400. const { error, code, data } = await projectApi.dataProjectStat(searchForm.value)
  401. //处理数据
  402. if (!error && code === 200) {
  403. projectStat.value = getObjValue(data)
  404. } else {
  405. projectStat.value = {
  406. projectTotal:0,
  407. planAllMoney:0,
  408. currentMoney:0,
  409. investRatio:0,
  410. total1:0,
  411. total2:0,
  412. total3:0,
  413. }
  414. }
  415. }
  416. //获取投资数据
  417. const investStat = ref({
  418. oneFinished:0,
  419. oneUnFinished:0,
  420. twoFinished:0,
  421. twoUnFinished:0,
  422. threeFinished:0,
  423. threeUnFinished:0,
  424. fourFinished:0,
  425. fourUnFinished:0,
  426. })
  427. const getDataInvestStat = async ()=>{
  428. const { error, code, data } = await projectApi.dataInvestStat(searchForm.value)
  429. //处理数据
  430. if (!error && code === 200) {
  431. investStat.value = getObjValue(data)
  432. tableData1.value = getArrValue(data['list'])
  433. } else {
  434. investStat.value = {
  435. oneFinished:0,
  436. oneUnFinished:0,
  437. twoFinished:0,
  438. twoUnFinished:0,
  439. threeFinished:0,
  440. threeUnFinished:0,
  441. fourFinished:0,
  442. fourUnFinished:0,
  443. }
  444. tableData1.value = []
  445. }
  446. }
  447. //获取进度数据
  448. const scheduleStat = ref({
  449. oneFinished:0,
  450. oneUnFinished:0,
  451. twoFinished:0,
  452. twoUnFinished:0,
  453. threeFinished:0,
  454. threeUnFinished:0,
  455. fourFinished:0,
  456. fourUnFinished:0,
  457. })
  458. const getScheduleStat = async ()=>{
  459. const { error, code, data } = await projectApi.schedulestStat(searchForm.value)
  460. //处理数据
  461. if (!error && code === 200) {
  462. scheduleStat.value = getObjValue(data)
  463. tableData2.value = getArrValue(data['list'])
  464. } else {
  465. scheduleStat.value = {
  466. oneFinished:0,
  467. oneUnFinished:0,
  468. twoFinished:0,
  469. twoUnFinished:0,
  470. threeFinished:0,
  471. threeUnFinished:0,
  472. fourFinished:0,
  473. fourUnFinished:0,
  474. }
  475. tableData2.value = []
  476. }
  477. }
  478. //表格1
  479. const tableColumn1 = [
  480. { key: 'projectStageName', name: '项目阶段' }, { key: 'projectTypeName', name: '项目类型' },
  481. { key: 'planAllMoney', name: '计划总投资' }, { key: 'currentMoney', name: '实际已投资' },
  482. { key: 'unFinishedMoney', name: '未完成投资' },
  483. ]
  484. const tableData1 = ref([])
  485. //表格被点击
  486. const isDatavCharts = ref(true)
  487. const tableRowClick = (row) => {
  488. console.log(row)
  489. //模拟改变图表
  490. isDatavCharts.value = false
  491. setTimeout(() => {
  492. isDatavCharts.value = true
  493. }, 100)
  494. }
  495. //滞后表格1
  496. const lagColumn1 = [
  497. { key: 'key1', name: '滞后等级' }, { key: 'key2', name: '项目名称' },
  498. { key: 'key3', name: '计划总投资' }, { key: 'key4', name: '实际已投资' },
  499. { key: 'key5', name: '未完成投资' },
  500. ]
  501. const lagData1 = ref([
  502. { key1: '一级', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
  503. { key1: '二级', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
  504. { key1: '三级', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
  505. ])
  506. const lagRowClick = (row) => {
  507. console.log(row)
  508. //模拟改变图表
  509. isDatavCharts.value = false
  510. setTimeout(() => {
  511. isDatavCharts.value = true
  512. }, 100)
  513. }
  514. //表格2
  515. const tableColumn2 = [
  516. { key: 'projectStageName', name: '项目阶段' }, { key: 'projectTypeName', name: '项目类型' },
  517. { key: 'projectTotal', name: '项目数' }, { key: 'finishedTotal', name: '已完成项目数' },
  518. { key: 'unFinishedTotal', name: '未完成项目数' },
  519. ]
  520. const tableData2 = ref([])
  521. //滞后表格2
  522. const lagColumn2 = [
  523. { key: 'key1', name: '滞后等级' }, { key: 'key2', name: '项目名称' },
  524. { key: 'key3', name: '进度滞后季度' }, { key: 'key4', name: '进度滞后月份' },
  525. { key: 'key5', name: '进度百分比' },
  526. ]
  527. const lagData2 = ref([
  528. { key1: '一级', key2: 'xx', key3: '一季度', key4: '1月', key5: '38%' },
  529. { key1: '二级', key2: 'xx', key3: '二季度', key4: '2月', key5: '48%' },
  530. { key1: '三级', key2: 'xx', key3: '三季度', key4: '3月', key5: '58%' },
  531. ])
  532. //工作要点表格
  533. const workColumn = [
  534. { key: 'key1', name: '项目阶段' }, { key: 'key2', name: '目标任务' },
  535. { key: 'key3', name: '工作内容' }, { key: 'key4', name: '1月' },
  536. { key: 'key5', name: '2月' }, { key: 'key6', name: '3月' },
  537. { key: 'key7', name: '责任单位' },
  538. ]
  539. const workData = ref([
  540. { key1: 'xxxx', key2: 'xxxx', key3: 'xxxx', key4: 'xxxx', key5: 'xxxx', key6: 'xxxx', key7: 'xxxx' },
  541. { key1: 'xxxx', key2: 'xxxx', key3: 'xxxx', key4: 'xxxx', key5: 'xxxx', key6: 'xxxx', key7: 'xxxx' },
  542. { key1: 'xxxx', key2: 'xxxx', key3: 'xxxx', key4: 'xxxx', key5: 'xxxx', key6: 'xxxx', key7: 'xxxx' },
  543. ])
  544. //跳转到首页
  545. const toHomePage = () => {
  546. router.push({ name: store.page })
  547. }
  548. //监听浏览器窗口变化
  549. const windowResize = () => {
  550. window.addEventListener('resize', resizeEvent)
  551. }
  552. const resizeEvent = () => {
  553. window.requestAnimationFrame(() => {
  554. onWindowResize()
  555. })
  556. }
  557. //设置尺寸
  558. const onWindowResize = () => {
  559. const height = document.getElementById('hc-datav-header-body').offsetHeight
  560. document.getElementById('hc-datav-row-total-body').style.height = `calc(100% - ${height + 10}px)`
  561. }
  562. //被卸载
  563. onUnmounted(() => {
  564. window.removeEventListener('resize', resizeEvent)
  565. })
  566. </script>
  567. <style lang="scss">
  568. @import '~src/styles/view/datav';
  569. </style>