|
@@ -9,9 +9,11 @@
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
import type { TableFieldInfo, TablePaginationSetting } from '@/types/table'
|
|
import type { TableFieldInfo, TablePaginationSetting } from '@/types/table'
|
|
|
import type { HeaderCardProps, ReqConfig } from '@/types/dataAnalysis'
|
|
import type { HeaderCardProps, ReqConfig } from '@/types/dataAnalysis'
|
|
|
|
|
+import { MessageBox } from '@element-plus/icons-vue'
|
|
|
|
|
+import { ElMessageBox } from 'element-plus'
|
|
|
|
|
|
|
|
-import { reactive, ref, toRaw } from 'vue'
|
|
|
|
|
-import { resetTimeToMidnight } from '@/utils/common'
|
|
|
|
|
|
|
+import { onMounted, reactive, ref, toRaw } from 'vue'
|
|
|
|
|
+import { resetTimeToMidnight, shortcutsDate } from '@/utils/common'
|
|
|
import { useRequest } from '@/hooks/useRequest'
|
|
import { useRequest } from '@/hooks/useRequest'
|
|
|
import { useCommonStore } from '@/stores/useCommon'
|
|
import { useCommonStore } from '@/stores/useCommon'
|
|
|
import { useAnalysis } from '@/hooks/useAnalysis'
|
|
import { useAnalysis } from '@/hooks/useAnalysis'
|
|
@@ -21,6 +23,10 @@ import Table from '@/components/table/CustomTable.vue'
|
|
|
import HeaderCard from '@/components/dataAnalysis/HeaderCard.vue'
|
|
import HeaderCard from '@/components/dataAnalysis/HeaderCard.vue'
|
|
|
import axiosInstance from '@/utils/axios/axiosInstance'
|
|
import axiosInstance from '@/utils/axios/axiosInstance'
|
|
|
|
|
|
|
|
|
|
+type HeaderRef = InstanceType<typeof HeaderCard>
|
|
|
|
|
+
|
|
|
|
|
+const headerRef = ref<HeaderRef>()
|
|
|
|
|
+
|
|
|
const { watchPageChange } = usePage()
|
|
const { watchPageChange } = usePage()
|
|
|
|
|
|
|
|
const { updateReqConfig } = useAnalysis()
|
|
const { updateReqConfig } = useAnalysis()
|
|
@@ -33,6 +39,9 @@ const isSinglePf = true
|
|
|
|
|
|
|
|
const loading = ref(true) // 加载状态
|
|
const loading = ref(true) // 加载状态
|
|
|
|
|
|
|
|
|
|
+const initStartDate = shortcutsDate[0].value()[0]
|
|
|
|
|
+const initEndDate = shortcutsDate[1].value()[1]
|
|
|
|
|
+
|
|
|
// 数据详情表格信息
|
|
// 数据详情表格信息
|
|
|
const keepDataTableInfo = reactive<{
|
|
const keepDataTableInfo = reactive<{
|
|
|
paginationConfig: TablePaginationSetting
|
|
paginationConfig: TablePaginationSetting
|
|
@@ -50,8 +59,8 @@ const keepDataTableInfo = reactive<{
|
|
|
otherOptions: {
|
|
otherOptions: {
|
|
|
pf: selectInfo.pf,
|
|
pf: selectInfo.pf,
|
|
|
gid: selectInfo.gid,
|
|
gid: selectInfo.gid,
|
|
|
- startTime: resetTimeToMidnight(new Date()),
|
|
|
|
|
- endTime: resetTimeToMidnight(new Date()),
|
|
|
|
|
|
|
+ startTime: resetTimeToMidnight(initStartDate),
|
|
|
|
|
+ endTime: resetTimeToMidnight(initEndDate),
|
|
|
type: 1
|
|
type: 1
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -167,6 +176,7 @@ const headerCardInfo: HeaderCardProps = {
|
|
|
*/
|
|
*/
|
|
|
const getTableData = () => {
|
|
const getTableData = () => {
|
|
|
loading.value = true
|
|
loading.value = true
|
|
|
|
|
+
|
|
|
axiosInstance
|
|
axiosInstance
|
|
|
.post(keepDataTableInfo.requestConfig.url, {
|
|
.post(keepDataTableInfo.requestConfig.url, {
|
|
|
...keepDataTableInfo.requestConfig.otherOptions
|
|
...keepDataTableInfo.requestConfig.otherOptions
|
|
@@ -213,6 +223,7 @@ watchPageChange(() => [keepDataTableInfo.requestConfig], backupReq, getTableData
|
|
|
<div class="KeepViewBox">
|
|
<div class="KeepViewBox">
|
|
|
<div class="header">
|
|
<div class="header">
|
|
|
<HeaderCard
|
|
<HeaderCard
|
|
|
|
|
+ ref="headerRef"
|
|
|
:title="headerCardInfo.title"
|
|
:title="headerCardInfo.title"
|
|
|
:open-date-select="headerCardInfo.openDateSelect"
|
|
:open-date-select="headerCardInfo.openDateSelect"
|
|
|
@change-date="changeDate"
|
|
@change-date="changeDate"
|