Ben Lin
2024-07-04 68d75a540ec8b3168c3af956ea00b898036d92cd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<template>
  <div class="error-page">
  <PageWrapper>
    <template #headerContent>
      <WorkbenchHeader />
    </template>
    <div class="lg:flex">
      <div class="lg:w-7/10 w-full !mr-4 enter-y">
        <SiteAnalysis class="!my-4 enter-y" :loading="loading" />
      </div>
      <div class="lg:w-3/10 w-full !mr-4 enter-y">
        <QuickNav :loading="loading" class="!my-4 enter-y" />
      </div>
    </div>
    <div class="lg">
      <Card :tab-list="tabListTitle" v-bind="$attrs" :active-tab-key="activeKey">
        <VisitAnalysisBar :loading="loading" class="!my-4 enter-y" />
      </Card>
    </div>
  </PageWrapper>
  <PasswordModal @register="registerModal" />
</div>
</template>
<script lang="ts" setup>
  import { onMounted, ref,h } from 'vue';
  import { PageWrapper } from '/@/components/Page';
  import PasswordModal from '../../tigerprojects/system/password/PasswordModal.vue';
  import { Card } from 'ant-design-vue';
  import WorkbenchHeader from './components/WorkbenchHeader.vue';
  import SiteAnalysis from './components/SiteAnalysis.vue';
  import QuickNav from './components/QuickNav.vue';
  import VisitAnalysisBar from './components/VisitAnalysisBar.vue';
  import { useModal } from '/@/components/Modal';
import { useUserStore } from '/@/store/modules/user';
import { useMessage } from '/@/hooks/web/useMessage';
import { useI18n } from 'vue-i18n';
import { nextTick } from 'vue';
 
  const loading = ref(true);
  const { createConfirm } = useMessage();
  const { t } = useI18n();
  const [registerModal, { openModal }] = useModal();
  const activeKey = ref('tab1');
  const tabListTitle = [
    {
      key: 'tab1',
      tab: '每日进出库存',
    },
    // {
    //   key: 'tab2',
    //   tab: '访问量',
    // },
  ];
  onMounted(async () => {
    nextTick(()=>{
      var ischangepwd = useUserStore().getUserInfo.changepwd
      console.log(ischangepwd)
    if(ischangepwd){
          //提示去修改密码
          createConfirm({
          iconType: 'warning',
          title: () => h('span', t('提示')),
          content: () => h('span', t('当前未初始密码,是否去修改密码')),
          onOk: async () => {
            openModal(true, {
              passwordOld: useUserStore().getUserInfo.userId as string,
            });
          },
        })
 
        }
    })
  });
  setTimeout(() => {
    loading.value = false;
  }, 1500);
</script>