Commit 25070427c95e59247bd1157abbe81ca76264fd92

Authored by sqy
1 parent 5728b3e0

'修改antdv的按需引入组件的方式,解决不能打包的问题'

... ... @@ -4,8 +4,9 @@
4 4 -->
5 5
6 6 <template>
7   - <div class="anticon" :class="getAppLogoClass" @click="goHome">
8   - <img :src="getLogo" />
  7 + <div class="application" :class="getAppLogoClass">
  8 + <img v-if="getLogo" :src="getLogo" />
  9 + <img v-else src="/src/assets/images/logo.png" />
9 10 <span
10 11 class="ml-2 md:opacity-100"
11 12 :class="getTitleClass"
... ... @@ -19,10 +20,8 @@
19 20 <script lang="ts" setup>
20 21 import { computed, unref } from 'vue';
21 22 import { useGlobSetting } from '/@/hooks/setting';
22   - import { useGo } from '/@/hooks/web/usePage';
23 23 import { useMenuSetting } from '/@/hooks/setting/useMenuSetting';
24 24 import { useDesign } from '/@/hooks/web/useDesign';
25   - import { PageEnum } from '/@/enums/pageEnum';
26 25 import { useUserStore } from '/@/store/modules/user';
27 26 const props = defineProps({
28 27 /**
... ... @@ -43,7 +42,6 @@
43 42 const { getCollapsedShowTitle } = useMenuSetting();
44 43 const userStore = useUserStore();
45 44 const { title } = useGlobSetting();
46   - const go = useGo();
47 45
48 46 const getAppLogoClass = computed(() => [
49 47 prefixCls,
... ... @@ -56,12 +54,8 @@
56 54 'xs:opacity-0': !props.alwaysShowTitle,
57 55 },
58 56 ]);
59   -
60   - function goHome() {
61   - go(userStore.getUserInfo.homePath || PageEnum.BASE_HOME);
62   - }
63 57 const getLogo = computed(() => {
64   - return userStore.platInfo?.logo ?? '/src/assets/images/logo.png';
  58 + return userStore.platInfo?.logo;
65 59 });
66 60 const getTitle = computed(() => {
67 61 // 设置icon
... ...
... ... @@ -21,43 +21,18 @@
21 21 </transition>
22 22 </template>
23 23 </RouterView>
24   - <!-- <BasicModal
25   - @register="register"
26   - v-bind="$attrs"
27   - :mask="true"
28   - :showCancelBtn="false"
29   - :showOkBtn="false"
30   - :canFullscreen="false"
31   - :closable="false"
32   - :maskStyle="maskColor"
33   - :height="600"
34   - :width="1500"
35   - :maskClosable="false"
36   - title="请您修改初始密码"
37   - :helpMessage="['请您修改初始密码']"
38   - :keyboard="false"
39   - >
40   - <PasswordDialog />
41   - </BasicModal> -->
  24 +
42 25 <FrameLayout v-if="getCanEmbedIFramePage" />
43 26 </template>
44 27
45 28 <script lang="ts">
46   - import { computed, defineComponent, unref, onMounted } from 'vue';
47   - // import PasswordDialog from '/@/views/system/password/index.vue';
48   -
  29 + import { computed, defineComponent, unref } from 'vue';
49 30 import FrameLayout from '/@/layouts/iframe/index.vue';
50   -
51 31 import { useRootSetting } from '/@/hooks/setting/useRootSetting';
52   -
53 32 import { useTransitionSetting } from '/@/hooks/setting/useTransitionSetting';
54 33 import { useMultipleTabSetting } from '/@/hooks/setting/useMultipleTabSetting';
55 34 import { getTransitionName } from './transition';
56   -
57 35 import { useMultipleTabStore } from '/@/store/modules/multipleTab';
58   - // import { BasicModal, useModal } from '/@/components/Modal';
59   - // import { USER_INFO_KEY } from '/@/enums/cacheEnum';
60   - // import { getAuthCache } from '/@/utils/auth';
61 36 export default defineComponent({
62 37 name: 'PageLayout',
63 38 components: { FrameLayout },
... ... @@ -78,17 +53,6 @@
78 53 return tabStore.getCachedTabList;
79 54 });
80 55
81   - // const [register, { openModal }] = useModal();
82   - // const maskColor = ref({ backgroundColor: 'grey' });
83   - // const statusModel = ref(false);
84   - onMounted(() => {
85   - // const userInfo = getAuthCache(USER_INFO_KEY);
86   - // if (userInfo.needSetPwd == true) {
87   - // statusModel.value = true;
88   - // openModal(statusModel.value);
89   - // }
90   - });
91   -
92 56 return {
93 57 getTransitionName,
94 58 openCache,
... ... @@ -96,8 +60,6 @@
96 60 getBasicTransition,
97 61 getCaches,
98 62 getCanEmbedIFramePage,
99   - // register,
100   - // maskColor,
101 63 };
102 64 },
103 65 });
... ...
... ... @@ -14,13 +14,7 @@ import { setupStore } from '/@/store';
14 14 import { setupGlobDirectives } from '/@/directives';
15 15 import { setupI18n } from '/@/locales/setupI18n';
16 16 import { registerGlobComp } from '/@/components/registerGlobComp';
17   -// Do not introduce on-demand in local development?
18   -// In the local development for introduce on-demand, the number of browser requests will increase by about 20%.
19   -// Which may slow down the browser refresh.
20   -// Therefore, all are introduced in local development, and only introduced on demand in the production environment
21   -if (import.meta.env.DEV) {
22   - import('ant-design-vue/dist/antd.less');
23   -}
  17 +import 'ant-design-vue/dist/antd.less';
24 18
25 19 async function bootstrap() {
26 20 const app = createApp(App);
... ...
... ... @@ -108,17 +108,7 @@
108 108
109 109 <script lang="ts">
110 110 import { defineComponent, ref, computed, onMounted } from 'vue';
111   - import {
112   - Card,
113   - AnchorLink,
114   - List,
115   - ListItem,
116   - ListItemMeta,
117   - Avatar,
118   - CardMeta,
119   - Descriptions,
120   - DescriptionsItem,
121   - } from 'ant-design-vue';
  111 + import { Card, Anchor, List, Avatar, Descriptions } from 'ant-design-vue';
122 112 import { useUserStore } from '/@/store/modules/user';
123 113 import { getEnterPriseDetail } from '/@/api/oem';
124 114 import { notifyMyGetrPageApi } from '/@/api/stationnotification/stationnotifyApi';
... ... @@ -128,21 +118,19 @@
128 118 import { columns } from './props';
129 119 import { isAdmin } from '/@/enums/roleEnum';
130 120 import { getTenantExpireTimeList } from '/@/api/dashboard';
131   - import 'ant-design-vue/es/anchor-link/style/index';
132   -
133 121 export default defineComponent({
134 122 components: {
135 123 Card,
136   - AnchorLink,
  124 + CardMeta: Card.Meta,
  125 + AnchorLink: Anchor.Link,
137 126 List,
138   - ListItem,
139   - ListItemMeta,
  127 + ListItem: List.Item,
  128 + ListItemMeta: List.Item.Meta,
  129 + Descriptions,
  130 + DescriptionsItem: Descriptions.Item,
140 131 Avatar,
141 132 Time,
142   - CardMeta,
143 133 BasicTable,
144   - Descriptions,
145   - DescriptionsItem,
146 134 },
147 135 props: {
148 136 role: {
... ... @@ -222,13 +210,13 @@
222 210 return {
223 211 activeKey,
224 212 tabListTitle,
225   - onTabChange,
226 213 helpDoc,
227 214 getQrCode,
228 215 getContacts,
229 216 getAddress,
230 217 getTel,
231 218 dataSource,
  219 + onTabChange,
232 220 go,
233 221 registerTable,
234 222 isAdmin,
... ... @@ -238,7 +226,7 @@
238 226 });
239 227 </script>
240 228
241   -<style lang="less" scoped>
  229 +<style scoped>
242 230 .noticeTitle:hover {
243 231 border-bottom: 1px solid #ccc;
244 232 }
... ...
... ... @@ -26,7 +26,7 @@
26 26 import { defineComponent, ref } from 'vue';
27 27 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
28 28
29   - import { Tabs, TabPane } from 'ant-design-vue';
  29 + import { Tabs } from 'ant-design-vue';
30 30 import Detail from '../tabs/Detail.vue';
31 31 import RealTimeData from '../tabs/RealTimeData.vue';
32 32 import Alarm from '../tabs/Alarm.vue';
... ... @@ -37,13 +37,12 @@
37 37 components: {
38 38 BasicDrawer,
39 39 Tabs,
40   - TabPane,
  40 + TabPane: Tabs.TabPane,
41 41 Detail,
42 42 RealTimeData,
43 43 Alarm,
44 44 ChildDevice,
45 45 },
46   -
47 46 emits: ['reload', 'register'],
48 47 setup() {
49 48 const activeKey = ref('1');
... ...
... ... @@ -39,10 +39,9 @@
39 39 import { createOrEditDevice } from '/@/api/device/deviceManager';
40 40 import DeviceStep1 from '../step/DeviceStep1.vue';
41 41 import DeviceStep2 from '../step/DeviceStep2.vue';
42   - import { Steps, Step } from 'ant-design-vue';
  42 + import { Steps } from 'ant-design-vue';
43 43 import { useMessage } from '/@/hooks/web/useMessage';
44 44 import { credentialTypeEnum } from '../../config/data';
45   - import 'ant-design-vue/es/step/style/index';
46 45
47 46 export default defineComponent({
48 47 name: 'DeviceModal',
... ... @@ -51,7 +50,7 @@
51 50 DeviceStep1,
52 51 DeviceStep2,
53 52 Steps,
54   - Step,
  53 + Step: Steps.Step,
55 54 },
56 55 props: {
57 56 userData: { type: Object },
... ...
... ... @@ -97,7 +97,7 @@
97 97 <script lang="ts">
98 98 import { defineComponent, ref, computed, watch } from 'vue';
99 99 import { BasicModal, useModalInner } from '/@/components/Modal';
100   - import { Tabs, TabPane } from 'ant-design-vue';
  100 + import { Tabs } from 'ant-design-vue';
101 101 import { deviceConfigGetDetail } from '/@/api/device/deviceConfigApi';
102 102 import { BasicForm, useForm } from '/@/components/Form/index';
103 103 import {
... ... @@ -117,11 +117,10 @@
117 117 import { formSchema as enableClearSchema } from './step/cpns/enablerule/config';
118 118 import { formSchema as detailClearSchema } from './step/cpns/detailtemplate/config';
119 119 import { formSchema as echoFormClearSchema } from './step/cpns/alarmruleconditions/cpns/config';
120   - import 'ant-design-vue/es/tab-pane/style/index.css';
121 120
122 121 export default defineComponent({
123 122 name: 'ConfigDrawer',
124   - components: { Tabs, TabPane, BasicModal, BasicForm },
  123 + components: { Tabs, TabPane: Tabs.TabPane, BasicModal, BasicForm },
125 124 emits: ['success', 'register'],
126 125 setup() {
127 126 const activeKey = ref('1');
... ...
... ... @@ -11,17 +11,16 @@
11 11 </template>
12 12
13 13 <script lang="ts">
14   - import { Tabs, TabPane } from 'ant-design-vue';
  14 + import { Tabs } from 'ant-design-vue';
15 15 import { defineComponent } from 'vue';
16 16 import SmsLog from './item/SmsLog.vue';
17 17 import EmailLog from './item/EmailLog.vue';
18 18 import { achieveList } from './data';
19   - import 'ant-design-vue/es/tab-pane/style/index.css';
20 19
21 20 export default defineComponent({
22 21 components: {
23 22 Tabs,
24   - TabPane,
  23 + TabPane: Tabs.TabPane,
25 24 SmsLog,
26 25 EmailLog,
27 26 },
... ...
... ... @@ -2,9 +2,9 @@
2 2 <div class="platform flex">
3 3 <Card class="tab-card" :bordered="false">
4 4 <Tabs v-model:activeKey="activeKey" tab-position="left">
5   - <TabPane key="企业信息" tab="企业信息" />
6   - <TabPane key="平台定制" tab="平台定制" />
7   - <TabPane key="APP定制" tab="APP定制" />
  5 + <Tabs.TabPane key="企业信息" tab="企业信息" />
  6 + <Tabs.TabPane key="平台定制" tab="平台定制" />
  7 + <Tabs.TabPane key="APP定制" tab="APP定制" />
8 8 </Tabs>
9 9 </Card>
10 10
... ... @@ -18,7 +18,7 @@
18 18 </template>
19 19
20 20 <script lang="ts" setup>
21   - import { Tabs, TabPane, Card } from 'ant-design-vue';
  21 + import { Tabs, Card } from 'ant-design-vue';
22 22 import { ref } from 'vue';
23 23 import EnterpriseInfo from './cpns/EnterpriseInfo.vue';
24 24 import CVIDraw from './cpns/CVIDraw.vue';
... ...