|
|
@@ -5,12 +5,16 @@ import { FiveIotProjectDailyReportApi } from '@/api/pms/fiveconstructiondailyrep
|
|
|
import { rangeShortcuts } from '@/utils/formatTime'
|
|
|
import { useDebounceFn } from '@vueuse/core'
|
|
|
import { useTableComponents } from '@/components/ZmTable/useTableComponents'
|
|
|
+import { useUserStore } from '@/store/modules/user'
|
|
|
+import { resolveDailyReportDeptId } from '@/utils/dailyReportDept'
|
|
|
|
|
|
defineOptions({ name: 'FiveDailyReportSummary' })
|
|
|
|
|
|
const route = useRoute()
|
|
|
+const pageRouteName = route.name
|
|
|
const router = useRouter()
|
|
|
-const defaultDeptId = 388
|
|
|
+const TOP_DEPT_ID = 388
|
|
|
+const defaultDeptId = resolveDailyReportDeptId(useUserStore().getUser.deptId, TOP_DEPT_ID)
|
|
|
const { ZmTable, ZmTableColumn } = useTableComponents()
|
|
|
|
|
|
const summaryCards = [
|
|
|
@@ -87,6 +91,8 @@ const cardStatistics = ref({
|
|
|
const deptColumnLabel = computed(() => (selectedDeptType.value === '1' ? '项目部' : '队伍'))
|
|
|
|
|
|
const syncQueryFromRoute = () => {
|
|
|
+ if (route.name !== pageRouteName) return
|
|
|
+
|
|
|
const createTime = route.query.createTime
|
|
|
|
|
|
if (Array.isArray(createTime)) {
|
|
|
@@ -255,8 +261,9 @@ watch(
|
|
|
class="grid grid-cols-[auto_1fr] grid-rows-[48px_44px_1fr] gap-3 h-[calc(100vh-20px-var(--top-tool-height)-var(--tags-view-height)-var(--app-footer-height))]">
|
|
|
<DeptTreeSelect
|
|
|
v-model="query.deptId"
|
|
|
- :top-id="388"
|
|
|
- :deptId="defaultDeptId"
|
|
|
+ :top-id="TOP_DEPT_ID"
|
|
|
+ :dept-id="defaultDeptId"
|
|
|
+ :init-select="false"
|
|
|
:show-title="false"
|
|
|
class="row-span-3"
|
|
|
@node-click="handleDeptNodeClick" />
|