index.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. <template>
  2. <div class="sensitive-words flex">
  3. <div class="table-box">
  4. <pageSearch ref="searchTableRef" :searchConfig="searchConfig" @handleSure="handerSearch" />
  5. <overdueStatistics></overdueStatistics>
  6. <industryOverdueStatistics></industryOverdueStatistics>
  7. <statisticalChartPie class="mt20"></statisticalChartPie>
  8. <statisticalChartBar class="mt20"></statisticalChartBar>
  9. <pageContent
  10. ref="tableListRef"
  11. :total="total"
  12. v-loading="loading"
  13. :contentConfig="contentConfig"
  14. :pageList="tableData"
  15. >
  16. <!-- 通报完成情况 -->
  17. <!-- 已完成发布数量(件) -->
  18. <template #beenPublishCount="scope">
  19. <el-link @click="handleUnitdetail(scope.row.unitName)" type="primary">{{
  20. scope.row.beenPublishCount
  21. }}</el-link>
  22. </template>
  23. <!-- 已完成接收数量(件) -->
  24. <template #beenReceiveCount="scope">
  25. <el-link @click="handleUnitdetail(scope.row.unitName)" type="primary">{{
  26. scope.row.beenReceiveCount
  27. }}</el-link>
  28. </template>
  29. <!-- 已完成处置反馈数量(件) -->
  30. <template #beenFeedbackCount="scope">
  31. <el-link @click="handleUnitdetail(scope.row.unitName)" type="primary">{{
  32. scope.row.beenFeedbackCount
  33. }}</el-link>
  34. </template>
  35. <!-- 已完成处置处理数量(件) -->
  36. <template #beenHandleCount="scope">
  37. <el-link @click="handleUnitdetail(scope.row.unitName)" type="primary">{{
  38. scope.row.beenHandleCount
  39. }}</el-link>
  40. </template>
  41. <!-- 已结案(件) -->
  42. <template #beenClosedCount="scope">
  43. <el-link @click="handleUnitdetail(scope.row.unitName)" type="primary">{{
  44. scope.row.beenClosedCount
  45. }}</el-link>
  46. </template>
  47. <!-- 通报未完成情况 -->
  48. <!-- 未完成接收数量(件) -->
  49. <template #notReceiveCount="scope">
  50. <el-link @click="handleUnitdetail(scope.row.unitName)" type="primary">{{
  51. scope.row.notReceiveCount
  52. }}</el-link>
  53. </template>
  54. <!-- 未完成处置反馈数量(件) -->
  55. <template #notFeedbackCount="scope">
  56. <el-link @click="handleUnitdetail(scope.row.unitName)" type="primary">{{
  57. scope.row.notFeedbackCount
  58. }}</el-link>
  59. </template>
  60. <!-- 未完成处置处理数量(件) -->
  61. <template #notHandleCount="scope">
  62. <el-link @click="handleUnitdetail(scope.row.unitName)" type="primary">{{
  63. scope.row.notHandleCount
  64. }}</el-link>
  65. </template>
  66. <!-- 通报未完成情况 -->
  67. <!-- 正常接收(件)-->
  68. <template #noOverdueCount="scope">
  69. <el-link @click="handleUnitdetail(scope.row.unitName)" type="primary">{{
  70. scope.row.noOverdueCount
  71. }}</el-link>
  72. </template>
  73. <!-- 接收超期(件) -->
  74. <template #receiveOverdueCount="scope">
  75. <el-link @click="handleUnitdetail(scope.row.unitName)" type="primary">{{
  76. scope.row.receiveOverdueCount
  77. }}</el-link>
  78. </template>
  79. <!-- 处理超期(件) -->
  80. <template #handleOverdueCount="scope">
  81. <el-link @click="handleUnitdetail(scope.row.unitName)" type="primary">{{
  82. scope.row.handleOverdueCount
  83. }}</el-link>
  84. </template>
  85. <!-- 处置完成超期(件) -->
  86. <template #closedOverdueCount="scope">
  87. <el-link @click="handleUnitdetail(scope.row.unitName)" type="primary">{{
  88. scope.row.closedOverdueCount
  89. }}</el-link>
  90. </template>
  91. </pageContent>
  92. </div>
  93. </div>
  94. </template>
  95. <script setup lang="ts">
  96. import contentConfig from './config/content.config';
  97. import pageContent from './components/pageContent.vue';
  98. import searchConfig from './config/search.config';
  99. import pageSearch from './components/pageSearch.vue';
  100. import overdueStatistics from './components/overdueStatistics.vue';
  101. import industryOverdueStatistics from './components/industryOverdueStatistics.vue';
  102. import statisticalChartPie from './components/statisticalChartPie.vue';
  103. import statisticalChartBar from './components/statisticalChartBar.vue';
  104. import { useRouter } from 'vue-router';
  105. import useSystemStore from '@/store/main';
  106. import { nextTick, onMounted } from 'vue';
  107. import {
  108. bj_notification_type,
  109. overdueStatus,
  110. notificationStatus,
  111. bj_lssuing_unit,
  112. categoryOnm,
  113. isFeedback,
  114. takeMeasures,
  115. } from '@/plugins/dictData';
  116. const router = useRouter();
  117. // 使用pinia数据
  118. const systemStore = useSystemStore();
  119. const { pageList, resDate, searchObj } = storeToRefs(systemStore);
  120. const statisticsItemData = ref<any>();
  121. watch(
  122. [() => pageList, () => searchObj.value],
  123. ([newPageList, newSearchObj], [oldPageList, oldSearchObj]) => {
  124. // console.log(newSearchObj);
  125. // statisticsItemData.value = resDate.value;
  126. },
  127. { deep: true }
  128. );
  129. const total = ref(0);
  130. const pageSize = ref([10, 20, 30]);
  131. const tableData = ref([]);
  132. const tableListRef: any = ref<InstanceType<typeof pageContent>>();
  133. const activeTab = ref('1');
  134. const searchTableRef: any = ref<InstanceType<typeof pageSearch>>();
  135. // 操作弹框
  136. import usePageModal from '@/components/components/hooks/usePageDetails';
  137. const { modalRef } = usePageModal();
  138. const loading = ref(false);
  139. const handleUnitdetail = async (id?: string) => {
  140. router.push({
  141. path: '/notificationAnalysis/situationOverdueStatisticsDetail',
  142. query: { id: id },
  143. });
  144. };
  145. // 查询回调 请求参数 并去获取图表及统计
  146. const handerSearch = async data => {
  147. console.log('data', data);
  148. };
  149. onMounted(() => {});
  150. const handleDownload = async () => {
  151. ElMessageBox.confirm(`确定要导出所选数据信息?`, '提示', {
  152. confirmButtonText: '确定',
  153. cancelButtonText: '取消',
  154. distinguishCancelAndClose: true,
  155. })
  156. .then(async () => {
  157. const isLoading = ElLoading.service({
  158. lock: true,
  159. text: 'Loading',
  160. background: 'rgba(0, 0, 0, 0.7)',
  161. });
  162. let data: any = {};
  163. // 获取表格数据
  164. // data = cfgSelection.value;
  165. try {
  166. // 创建 Blob 对象
  167. const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
  168. // 获取列名
  169. const headers = [
  170. { key: 'uuid', label: '目标设备码' },
  171. { key: 'client_ip', label: '目标设备IP' },
  172. { key: 'type', label: '适用平台' },
  173. { key: 'remark', label: '目标设备名称' },
  174. ];
  175. const headerRow = headers.map(header => header.label).join(',');
  176. // 构造 CSV 内容
  177. const csvContent = [
  178. headerRow,
  179. ...data.map((row: any) => headers.map(header => row[header.key]).join(',')),
  180. ].join('\n');
  181. // 构造文件名
  182. const filename = `${timestamp}.csv`; // 指定下载文件的名称;
  183. // 创建 Blob 对象
  184. const blob = new Blob([csvContent], { type: 'text/csv;charset=utf-8' });
  185. // 创建下载链接
  186. const url = URL.createObjectURL(blob);
  187. const a = document.createElement('a');
  188. a.href = url;
  189. a.download = filename;
  190. a.click();
  191. URL.revokeObjectURL(url); // 释放 URL 对象
  192. } finally {
  193. isLoading.close();
  194. }
  195. })
  196. .catch(() => {});
  197. };
  198. // 筛选-状态赋值 bj_notification_status
  199. async function searchItem() {
  200. searchConfig.formItems.forEach(item => {
  201. if (item.prop === 'deliveryUnit') {
  202. item.options = bj_lssuing_unit;
  203. }
  204. if (item.prop === 'releasedUnit') {
  205. item.options = bj_lssuing_unit;
  206. }
  207. if (item.prop === 'notificationStatus') {
  208. item.options = notificationStatus;
  209. }
  210. if (item.prop === 'overdueStatus') {
  211. item.options = overdueStatus;
  212. }
  213. if (item.prop === 'notificationType') {
  214. item.options = bj_notification_type;
  215. }
  216. if (item.prop === 'conm') {
  217. item.options = categoryOnm;
  218. }
  219. if (item.prop === 'wfir') {
  220. item.options = isFeedback;
  221. }
  222. if (item.prop === 'takeMeasures') {
  223. item.options = takeMeasures;
  224. }
  225. });
  226. }
  227. searchItem();
  228. </script>
  229. <style scoped lang="scss">
  230. .sensitive-words {
  231. height: calc(100vh - 95px);
  232. margin-top: 0;
  233. overflow-y: auto;
  234. overflow-x: hidden;
  235. scrollbar-width: none; /* 可选:隐藏滚动条 */
  236. &::-webkit-scrollbar {
  237. display: none;
  238. }
  239. }
  240. .status {
  241. cursor: pointer;
  242. position: relative;
  243. .status-tip {
  244. position: absolute;
  245. top: 2px;
  246. left: 60px;
  247. }
  248. }
  249. .dialog-tip {
  250. text-align: center;
  251. }
  252. .table-box {
  253. width: 55%;
  254. display: flex;
  255. flex-direction: column;
  256. flex: 3;
  257. }
  258. :deep .el-tabs__item.is-active {
  259. color: #fff;
  260. background-color: #409eff;
  261. }
  262. :deep .el-tabs__header {
  263. padding-left: 20px;
  264. background-color: #fff;
  265. }
  266. </style>