datav.vue 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607
  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">截止时间: {{ endDate }}</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" :datas="chartsData" />
  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. getEndDate()
  340. getProType()
  341. getProStation()
  342. searchChange()
  343. })
  344. //关闭引导提示
  345. const tourFinishClose = () => {
  346. console.log('关闭引导提示')
  347. setStore('isTourOpen', true)
  348. }
  349. //搜索表单
  350. const pageType = ref('1')
  351. const searchForm = ref({ year: '2024', month: -1, projectScheduleGrade: '-1', projectStage: null, projectType: null, projectScheduleType:'-1' })
  352. const yearArr = [{ id: '2024', name: '2024年' }, { id: '2023', name: '2023年' }, { id: '2022', name: '2022年' }]
  353. const pageTypeArr = [{ id: '1', name: '项目数据看板' }, { id: '2', name: '工作要点' }]
  354. const monthArr = ref([])
  355. const lagArr = [{ id: '1', name: '超进度项目' }, { id: '2', name: '常规项目' }, { id: '3', name: '滞后项目' }, { id: '-1', name: '所有' }]
  356. const levelArr = [{ id: '1', name: '一级' }, { id: '2', name: '二级' }, { id: '3', name: '三级' }, { id: '-1', name: '所有' }]
  357. const stageArr = ref([])
  358. const typeArr = ref([])
  359. const quarterArr = [{ id: '1', name: '一季度' }, { id: '2', name: '二季度' }, { id: '3', name: '三季度' }, { id: '4', name: '四季度' }]
  360. const getProType = async () => {
  361. let data = await getDictionaryData('projectType', true)
  362. data.forEach((ele)=>{
  363. typeArr.value.push({
  364. id:ele.value,
  365. name:ele.label,
  366. })
  367. })
  368. }
  369. const getProStation = async () => {
  370. let data = await getDictionaryData('projectStage', true)
  371. data.forEach((ele)=>{
  372. stageArr.value.push({
  373. id:ele.value,
  374. name:ele.label,
  375. })
  376. })
  377. }
  378. //获取截止时间
  379. const endDate = ref('2024年04月08日')
  380. const getEndDate = async ()=>{
  381. const { error, code, data } = await projectApi.dateEndDate()
  382. //处理数据
  383. if (!error && code === 200) {
  384. endDate.value = data
  385. } else {
  386. endDate.value = ''
  387. }
  388. }
  389. //项目
  390. //搜索条
  391. //页面类型改变
  392. const pageTypeChange = () => {
  393. }
  394. //搜索条件改变1
  395. const searchChange = ()=>{
  396. getDataProjectStat()
  397. getDataInvestStat()
  398. getScheduleStat()
  399. }
  400. //获取项目统计
  401. const projectStat = ref({
  402. projectTotal:0,
  403. planAllMoney:0,
  404. currentMoney:0,
  405. investRatio:0,
  406. total1:0,
  407. total2:0,
  408. total3:0,
  409. })
  410. //获取项目统计
  411. const getDataProjectStat = async ()=>{
  412. const { error, code, data } = await projectApi.dataProjectStat(searchForm.value)
  413. //处理数据
  414. if (!error && code === 200) {
  415. projectStat.value = getObjValue(data)
  416. } else {
  417. projectStat.value = {
  418. projectTotal:0,
  419. planAllMoney:0,
  420. currentMoney:0,
  421. investRatio:0,
  422. total1:0,
  423. total2:0,
  424. total3:0,
  425. }
  426. }
  427. }
  428. //获取投资数据
  429. const investStat = ref({
  430. oneFinished:0,
  431. oneUnFinished:0,
  432. twoFinished:0,
  433. twoUnFinished:0,
  434. threeFinished:0,
  435. threeUnFinished:0,
  436. fourFinished:0,
  437. fourUnFinished:0,
  438. })
  439. const chartsData = ref({})
  440. const getDataInvestStat = async ()=>{
  441. const { error, code, data } = await projectApi.dataInvestStat(searchForm.value)
  442. //处理数据
  443. if (!error && code === 200) {
  444. investStat.value = getObjValue(data)
  445. tableData1.value = getArrValue(data['list'])
  446. if (tableData1.value.length > 0) {
  447. chartsData.value = getObjValue(tableData1.value[0]['map'])
  448. }
  449. } else {
  450. investStat.value = {
  451. oneFinished:0,
  452. oneUnFinished:0,
  453. twoFinished:0,
  454. twoUnFinished:0,
  455. threeFinished:0,
  456. threeUnFinished:0,
  457. fourFinished:0,
  458. fourUnFinished:0,
  459. }
  460. tableData1.value = []
  461. }
  462. }
  463. //获取进度数据
  464. const scheduleStat = ref({
  465. oneFinished:0,
  466. oneUnFinished:0,
  467. twoFinished:0,
  468. twoUnFinished:0,
  469. threeFinished:0,
  470. threeUnFinished:0,
  471. fourFinished:0,
  472. fourUnFinished:0,
  473. })
  474. const getScheduleStat = async ()=>{
  475. const { error, code, data } = await projectApi.schedulestStat(searchForm.value)
  476. //处理数据
  477. if (!error && code === 200) {
  478. scheduleStat.value = getObjValue(data)
  479. tableData2.value = getArrValue(data['list'])
  480. } else {
  481. scheduleStat.value = {
  482. oneFinished:0,
  483. oneUnFinished:0,
  484. twoFinished:0,
  485. twoUnFinished:0,
  486. threeFinished:0,
  487. threeUnFinished:0,
  488. fourFinished:0,
  489. fourUnFinished:0,
  490. }
  491. tableData2.value = []
  492. }
  493. }
  494. //表格1
  495. const tableColumn1 = [
  496. { key: 'projectStageName', name: '项目阶段' }, { key: 'projectTypeName', name: '项目类型' },
  497. { key: 'planAllMoney', name: '计划总投资' }, { key: 'currentMoney', name: '实际已投资' },
  498. { key: 'unFinishedMoney', name: '未完成投资' },
  499. ]
  500. const tableData1 = ref([])
  501. //表格被点击
  502. const isDatavCharts = ref(true)
  503. const tableRowClick = (row) => {
  504. chartsData.value = getObjValue(row.map)
  505. //模拟改变图表
  506. isDatavCharts.value = false
  507. setTimeout(() => {
  508. isDatavCharts.value = true
  509. }, 100)
  510. }
  511. //滞后表格1
  512. const lagColumn1 = [
  513. { key: 'key1', name: '滞后等级' }, { key: 'key2', name: '项目名称' },
  514. { key: 'key3', name: '计划总投资' }, { key: 'key4', name: '实际已投资' },
  515. { key: 'key5', name: '未完成投资' },
  516. ]
  517. const lagData1 = ref([
  518. { key1: '一级', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
  519. { key1: '二级', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
  520. { key1: '三级', key2: 'xx', key3: '12000', key4: '12000', key5: 2000 },
  521. ])
  522. const lagRowClick = (row) => {
  523. console.log(row)
  524. //模拟改变图表
  525. isDatavCharts.value = false
  526. setTimeout(() => {
  527. isDatavCharts.value = true
  528. }, 100)
  529. }
  530. //表格2
  531. const tableColumn2 = [
  532. { key: 'projectStageName', name: '项目阶段' }, { key: 'projectTypeName', name: '项目类型' },
  533. { key: 'projectTotal', name: '项目数' }, { key: 'finishedTotal', name: '已完成项目数' },
  534. { key: 'unFinishedTotal', name: '未完成项目数' },
  535. ]
  536. const tableData2 = ref([])
  537. //滞后表格2
  538. const lagColumn2 = [
  539. { key: 'key1', name: '滞后等级' }, { key: 'key2', name: '项目名称' },
  540. { key: 'key3', name: '进度滞后季度' }, { key: 'key4', name: '进度滞后月份' },
  541. { key: 'key5', name: '进度百分比' },
  542. ]
  543. const lagData2 = ref([
  544. { key1: '一级', key2: 'xx', key3: '一季度', key4: '1月', key5: '38%' },
  545. { key1: '二级', key2: 'xx', key3: '二季度', key4: '2月', key5: '48%' },
  546. { key1: '三级', key2: 'xx', key3: '三季度', key4: '3月', key5: '58%' },
  547. ])
  548. //工作要点表格
  549. const workColumn = [
  550. { key: 'key1', name: '项目阶段' }, { key: 'key2', name: '目标任务' },
  551. { key: 'key3', name: '工作内容' }, { key: 'key4', name: '1月' },
  552. { key: 'key5', name: '2月' }, { key: 'key6', name: '3月' },
  553. { key: 'key7', name: '责任单位' },
  554. ]
  555. const workData = ref([
  556. { key1: 'xxxx', key2: 'xxxx', key3: 'xxxx', key4: 'xxxx', key5: 'xxxx', key6: 'xxxx', key7: 'xxxx' },
  557. { key1: 'xxxx', key2: 'xxxx', key3: 'xxxx', key4: 'xxxx', key5: 'xxxx', key6: 'xxxx', key7: 'xxxx' },
  558. { key1: 'xxxx', key2: 'xxxx', key3: 'xxxx', key4: 'xxxx', key5: 'xxxx', key6: 'xxxx', key7: 'xxxx' },
  559. ])
  560. //跳转到首页
  561. const toHomePage = () => {
  562. router.push({ name: store.page })
  563. }
  564. //监听浏览器窗口变化
  565. const windowResize = () => {
  566. window.addEventListener('resize', resizeEvent)
  567. }
  568. const resizeEvent = () => {
  569. window.requestAnimationFrame(() => {
  570. onWindowResize()
  571. })
  572. }
  573. //设置尺寸
  574. const onWindowResize = () => {
  575. const height = document.getElementById('hc-datav-header-body').offsetHeight
  576. document.getElementById('hc-datav-row-total-body').style.height = `calc(100% - ${height + 10}px)`
  577. }
  578. //被卸载
  579. onUnmounted(() => {
  580. window.removeEventListener('resize', resizeEvent)
  581. })
  582. </script>
  583. <style lang="scss">
  584. @import '~src/styles/view/datav';
  585. </style>