@utogether/udp-core 1.0.1-beta.9 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/build/plugins.ts +37 -39
  2. package/dist/{403-BOzKHdlm.js → 403-B1rIjAAu.js} +6 -6
  3. package/dist/{404-uwgt4Nll.js → 404-mBqc2y4t.js} +4 -4
  4. package/dist/{500-4HBf6V9m.js → 500-BoI45Zdh.js} +2 -2
  5. package/dist/{AuthorityInfo-DvbIh1vT.js → AuthorityInfo-B08NBIIn.js} +1 -1
  6. package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-BlCPvwXU.js → AuthorityInfo.vue_vue_type_style_index_0_lang-BLP1SaiH.js} +3 -3
  7. package/dist/{Company-D7Q9BFmr.js → Company-JGGyWEWH.js} +3 -3
  8. package/dist/{CompanyPanel-C0-PJlrt.js → CompanyPanel-BQ_cCmDx.js} +7 -7
  9. package/dist/{Department-h2hlXACv.js → Department-z2iO6hwM.js} +10 -10
  10. package/dist/{DepartmentPanel-B6hDEQpG.js → DepartmentPanel-BtQe7zwU.js} +108 -78
  11. package/dist/{DesignPanel-cS58-1v9.js → DesignPanel-7mhtVWas.js} +1 -1
  12. package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-LdvLC8VU.js → DesignPanel.vue_vue_type_style_index_0_lang-4EsHemj_.js} +6 -6
  13. package/dist/{DictView-T3TmpBa8.js → DictView-CjchV2Yk.js} +15 -16
  14. package/dist/InvOrganization-Pn1O_XP0.js +74 -0
  15. package/dist/{Org-CnCBDGKF.js → Org-BqytV_vi.js} +1 -1
  16. package/dist/{Preview-BaktKXB1.js → Preview-CLpUUMay.js} +2 -2
  17. package/dist/{ReportDefine-5Rb0PO9A.js → ReportDefine-Cz1KtEUF.js} +1 -1
  18. package/dist/{ReportDesign-DYdkVREA.js → ReportDesign-BaORYud4.js} +13 -13
  19. package/dist/{ReportQuery-BwhzIXMt.js → ReportQuery-CPCPXiXz.js} +1 -1
  20. package/dist/{ReportQueryFrom-PHtWwlOe.js → ReportQueryFrom-C_AcrfkJ.js} +1 -1
  21. package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-BE5yZNPM.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-Bm67ejay.js} +1 -1
  22. package/dist/{ReportTemplate-DaadVXIi.js → ReportTemplate-CFiNMz79.js} +11 -11
  23. package/dist/{Role-Dtg3nAmG.js → Role-B-XDoJd5.js} +3 -3
  24. package/dist/{RoleAssign-DEGtLssH.js → RoleAssign-BolW8YVs.js} +8 -8
  25. package/dist/{RolePanel-DpUzfE_o.js → RolePanel-2kfs5tw9.js} +1 -1
  26. package/dist/{RolePanel-CT7BTPmy.js → RolePanel-HilSuYns.js} +1 -1
  27. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-Xyo0YEI0.js → RolePanel.vue_vue_type_script_setup_true_lang-CE4gApUY.js} +7 -7
  28. package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-Dg2A6DJu.js → RolePanel.vue_vue_type_script_setup_true_lang-DPzgfAyV.js} +13 -13
  29. package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-CyutzDZS.js → ScrollPanel.vue_vue_type_style_index_0_lang-CCTH4RkH.js} +4 -4
  30. package/dist/{Staff-_NlAGkrh.js → Staff-BTk3whFC.js} +3 -3
  31. package/dist/{StaffInfo-DVgUvVgd.js → StaffInfo-d3AuSzlA.js} +1 -1
  32. package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-C8hmlFgX.js → StaffInfo.vue_vue_type_script_setup_true_lang-eOL4VlfE.js} +5 -5
  33. package/dist/{StaffPanel-DKNZE3IE.js → StaffPanel-DV-D4jjz.js} +1 -1
  34. package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-4sFq3CEo.js +135 -0
  35. package/dist/{SysUser-kQUf7XKz.js → SysUser-BnjYytws.js} +2 -2
  36. package/dist/{SysUserPanel-C191uX3U.js → SysUserPanel-CBoyD-Qi.js} +1 -1
  37. package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-PrTlTZR-.js +341 -0
  38. package/dist/{SystemMenu-DwuSvHnj.js → SystemMenu-kYB_ZaUt.js} +36 -36
  39. package/dist/{UserInfo-DIsInFld.js → UserInfo-4dx97VBL.js} +1 -1
  40. package/dist/{UserInfo.vue_vue_type_style_index_0_lang-CnvGdbej.js → UserInfo.vue_vue_type_style_index_0_lang-BpbC_ZDm.js} +10 -10
  41. package/dist/{childView-3Bs2UBEw.js → childView-CHPNfTEb.js} +1 -1
  42. package/dist/{childView-BawyULD7.js → childView-CKA_JgVZ.js} +1 -1
  43. package/dist/{childView.vue_vue_type_style_index_0_lang-YpWF-p2F.js → childView.vue_vue_type_style_index_0_lang-Bym2fQRd.js} +7 -7
  44. package/dist/childView.vue_vue_type_style_index_0_lang-W7bCtXeu.js +177 -0
  45. package/dist/{code-rule-DVaYcn8S.js → code-rule-CbxuZg0-.js} +40 -38
  46. package/dist/core.es.js +18 -12
  47. package/dist/{cron-task-xuzP-BpE.js → cron-task-nTOpqQYf.js} +7 -7
  48. package/dist/flow-task-B07st2aD.js +10 -0
  49. package/dist/{frameView-Cudt06qS.js → frameView-Z1tPUyCh.js} +1 -1
  50. package/dist/index-C3q8HoJM.js +4650 -0
  51. package/dist/{layoutView-BlFTV2jX.js → layoutView--MGA9zUB.js} +1766 -1760
  52. package/dist/{log-in-e7D5Ss1P.js → log-in-CSYJDA6m.js} +36 -29
  53. package/dist/log-out-DiwGCg7p.js +130 -0
  54. package/dist/login-C6Y0ajDp.js +251 -0
  55. package/dist/{login-log-kqKzKTto.js → login-log-C0V-_l3F.js} +5 -3
  56. package/dist/{lov-view-B2HaxyMs.js → lov-view-Cmv7wZZ9.js} +6 -6
  57. package/dist/{menuInfo-BxCTJ1VW.js → menuInfo-UeutJpOa.js} +1 -1
  58. package/dist/{menuInfo.vue_vue_type_style_index_0_lang-CLOPNeUW.js → menuInfo.vue_vue_type_style_index_0_lang-CWX4Mu67.js} +118 -98
  59. package/dist/{pda-app-DPsAFNiw.js → pda-app-B6w99SJo.js} +10 -10
  60. package/dist/{resource-Dibb7t8u.js → resource-BybJvUv0.js} +4 -4
  61. package/dist/{su-welcome-DejR0KkM.js → su-welcome-C1bmxHoY.js} +119 -121
  62. package/dist/sys-config-BnmIDnCj.js +370 -0
  63. package/dist/udp-core.css +1 -9
  64. package/dist/utogether-MlnyYtNS.js +4 -0
  65. package/index.ts +49 -40
  66. package/package.json +18 -18
  67. package/src/App.vue +65 -65
  68. package/src/api/http.ts +1 -4
  69. package/src/api/index.ts +4 -2
  70. package/src/api/user.ts +2 -2
  71. package/src/components/SuCharts/src/UserInfo.vue +78 -78
  72. package/src/components/SuScrollTree/ScrollPanel.vue +1 -6
  73. package/src/components/udp/content/index.vue +88 -0
  74. package/src/components/udp/{form.vue → form/form.vue} +13 -16
  75. package/src/components/udp/{grid.vue → grid/index.vue} +56 -27
  76. package/src/components/udp/index.ts +4 -9
  77. package/src/components/udp/ut-stamp-badge/index.vue +271 -0
  78. package/src/components/udp/utils.ts +66 -105
  79. package/src/layout/components/lay-navbar/index.vue +8 -6
  80. package/src/layout/components/lay-panel/index.vue +150 -150
  81. package/src/layout/components/lay-search/index.vue +25 -25
  82. package/src/layout/components/lay-select-org/index.vue +4 -9
  83. package/src/layout/components/lay-setting/index.vue +503 -510
  84. package/src/layout/components/lay-sidebar/horizontal.vue +8 -6
  85. package/src/layout/components/lay-sidebar/mixNav.vue +260 -258
  86. package/src/layout/components/lay-sidebar/sidebar-logo.vue +101 -98
  87. package/src/layout/components/lay-tag/index.vue +24 -51
  88. package/src/layout/hooks/useDataThemeChange.ts +1 -1
  89. package/src/layout/hooks/useNav.ts +176 -173
  90. package/src/layout/hooks/useTag.ts +227 -233
  91. package/src/layout/types.ts +93 -92
  92. package/src/main.ts +115 -119
  93. package/src/plugins/i18n/en.ts +302 -302
  94. package/src/plugins/i18n/module/u-workflow.ts +1 -1
  95. package/src/plugins/i18n/zh.ts +21 -6
  96. package/src/plugins/vxe-table/index.ts +116 -53
  97. package/src/plugins/vxe-table/render.tsx +945 -956
  98. package/src/router/index.ts +17 -17
  99. package/src/router/modules/flow.ts +35 -0
  100. package/src/router/modules/home.ts +32 -32
  101. package/src/router/modules/remaining.ts +58 -58
  102. package/src/router/utils.ts +420 -377
  103. package/src/store/modules/app.ts +2 -4
  104. package/src/store/modules/epTheme.ts +48 -49
  105. package/src/store/modules/multiTags.ts +15 -14
  106. package/src/store/modules/permission.ts +25 -15
  107. package/src/store/modules/system.ts +1 -3
  108. package/src/style/button.scss +85 -85
  109. package/src/style/login.css +1 -1
  110. package/src/style/vxetable.scss +61 -2
  111. package/src/utils/dataFormat/index.ts +223 -223
  112. package/src/utils/index.ts +3 -1
  113. package/src/utils/lifecycle.ts +39 -20
  114. package/src/utils/propTypes.ts +1 -6
  115. package/src/utils/storage/index.ts +2 -2
  116. package/src/utils/udp/http/index.ts +24 -11
  117. package/src/utils/udp/http/types.d.ts +3 -10
  118. package/src/views/login/login-view.vue +4 -18
  119. package/src/views/organization/company/CompanyPanel.vue +259 -259
  120. package/src/views/organization/department/Department.vue +58 -58
  121. package/src/views/organization/department/DepartmentPanel.vue +303 -283
  122. package/src/views/organization/inv-org/InvOrganization.vue +22 -7
  123. package/src/views/organization/staff/StaffInfo.vue +127 -133
  124. package/src/views/organization/staff/StaffPanel.vue +162 -145
  125. package/src/views/system/cron/cron-task.vue +2 -12
  126. package/src/views/system/menu/SystemMenu.vue +185 -183
  127. package/src/views/system/menu/menuInfo.vue +384 -363
  128. package/src/views/system/role/UserInfo.vue +195 -195
  129. package/src/views/system/role-assign/RoleAssign.vue +57 -57
  130. package/src/views/system/role-assign/RolePanel.vue +139 -139
  131. package/src/views/system/sys/sys-config.vue +69 -20
  132. package/src/views/system/sysUser/SysUserPanel.vue +97 -28
  133. package/src/views/uapp/pda/pda-app.vue +208 -208
  134. package/src/views/udev/coderule/code-rule.vue +132 -121
  135. package/src/views/udev/dict/DictView.vue +2 -2
  136. package/src/views/udev/dict/childView.vue +183 -222
  137. package/src/views/udev/lov/childView.vue +1 -7
  138. package/src/views/udev/lov/lov-view.vue +91 -91
  139. package/src/views/uhome/components/menu-favorite.vue +314 -331
  140. package/src/views/uhome/su-welcome.vue +319 -339
  141. package/src/views/ulogin/login.vue +325 -321
  142. package/src/views/upms/interface/log-in.vue +100 -106
  143. package/src/views/upms/interface/log-out.vue +104 -107
  144. package/src/views/upms/user/login-log.vue +54 -60
  145. package/src/views/urpt/design/DesignPanel.vue +507 -507
  146. package/src/views/urpt/design/Preview.vue +1 -0
  147. package/src/views/urpt/design/ReportDesign.vue +2 -4
  148. package/src/views/utask/flow-task.vue +18 -0
  149. package/types/global.d.ts +231 -236
  150. package/dist/InvOrganization-BVuOhzbt.js +0 -66
  151. package/dist/StaffPanel.vue_vue_type_script_setup_true_lang-BOOO6Cek.js +0 -111
  152. package/dist/SysUserPanel.vue_vue_type_script_setup_true_lang-SwNbAEvW.js +0 -294
  153. package/dist/childView.vue_vue_type_style_index_0_lang-DWIFCX3X.js +0 -187
  154. package/dist/index-CKnq5xIa.js +0 -2623
  155. package/dist/log-out--RRncZhN.js +0 -120
  156. package/dist/login-CpKykfdf.js +0 -253
  157. package/dist/sys-config-DiySRWns.js +0 -277
  158. package/dist/utogether-Dct_14Zk.js +0 -182
  159. package/src/components/udp/count-down.vue +0 -536
  160. package/src/components/udp/flip-down/FlipCard/flip-card.vue +0 -251
  161. package/src/components/udp/flip-down/FlipCard/interfaces.ts +0 -4
  162. package/src/components/udp/flip-down/FlipClock/flip-clock.vue +0 -113
  163. package/src/components/udp/form-upload.vue +0 -482
  164. package/src/components/udp/lov.vue +0 -388
  165. package/src/components/udp/modal-form.vue +0 -189
  166. package/src/components/udp/modal-grid.vue +0 -288
  167. package/src/components/udp/upload.vue +0 -423
  168. package/src/utils/udp/useRender.ts +0 -431
@@ -1,339 +1,319 @@
1
- <!--
2
- * @Author: levi7754 levi7754@163.com
3
- * @Date: 2023-11-02 10:04:05
4
- * @LastEditors: levi7754 levi7754@163.com
5
- * @LastEditTime: 2025-08-06 14:47:34
6
- * @FilePath: /front-web-mes/src/views/uhome/su-welcome.vue
7
- * @Description: 欢迎页面
8
- -->
9
- <template>
10
- <div class="ut-home m-3">
11
- <!-- 顶部 -->
12
- <div class="h-32 mb-4 p-4 flex justify-between items-center bg-white home-page">
13
- <div class="flex flex-row items-center flex-[2]">
14
- <div>
15
- <el-avatar size="large" class="text-4xl font-bold bg-[var(--el-color-primary)]">{{
16
- firstName
17
- }}</el-avatar>
18
- </div>
19
- <div class="ml-4 text-xs flex-[2]">
20
- <div class="flex justify-center items-center">
21
- <span> {{ getCurrentPeriod() }}, {{ systemHook.getUserInfo?.name || '' }},欢迎回来! </span>
22
- <div
23
- class="flex flex-[2] justify-center items-center font-bold"
24
- style="color: var(--el-color-primary)"
25
- >
26
- 星光不问赶路人,岁月不负有心人,以梦为马,不负韶华!
27
- </div>
28
- </div>
29
- <div class="py-2 text-gray-500 flex">
30
- <span class="inline-block"> 所属角色: </span>
31
- <div class="w-2/3">{{ getRole() }}</div>
32
- </div>
33
- <div class="text-gray-500 flex">
34
- <span class="inline-block"> 所属组织: </span>
35
- <div class="w-2/3">{{ getOrg() }}</div>
36
- </div>
37
- </div>
38
- </div>
39
- <div class="flex flex-col">
40
- <span class="text-4xl">
41
- <ut-flip-down :show-days="false" :show-labels="false" />
42
- </span>
43
- <div class="mt-1 ml-3">{{ getLunarDay() }}</div>
44
- </div>
45
- </div>
46
- <!-- 底部 -->
47
- <el-row class="m-2" :gutter="10">
48
- <el-col v-spinning="loading" :lg="24" :md="24" class="">
49
- <el-card class="mb-2">
50
- <template #header>
51
- <div class="flex items-center justify-between dark:bg-black">
52
- <span class="font-bold">常用菜单</span>
53
- <span class="text-xs text-gray-400 cursor-pointer" @click="onFavoriteMenu">
54
- <span>更多</span>
55
- <i class="vxe-icon-arrow-right" />
56
- </span>
57
- </div>
58
- </template>
59
-
60
- <div class="default:bg-white dark:bg-black">
61
- <el-empty
62
- v-if="!menuList.length"
63
- :image-size="100"
64
- description="快来添加常用菜单吧!"
65
- class="p-0 pb-3"
66
- />
67
- <ul
68
- class="p-0 w-full h-full grid grid-rows-1 grid-cols-8 u-dashed-menu"
69
- :class="{ 'grid-rows-2': menuList.length > 8 }"
70
- >
71
- <li
72
- v-for="(item, idx) in menuList"
73
- :key="item.id"
74
- class="text-center list-none bg-white"
75
- @click="onClickMenu(item)"
76
- >
77
- <div class="h-20 flex justify-center items-center flex-col">
78
- <div
79
- class="rounded-full w-10 h-10 flex items-center justify-center"
80
- :style="{ backgroundColor: getColor(idx) }"
81
- >
82
- <iconify-icon-offline
83
- :icon="item.icon || `ri:${icons[idx]}-line`"
84
- class="text-2xl text-white"
85
- />
86
- </div>
87
- <span class="text-xs mt-2">{{ item.menuName }}</span>
88
- </div>
89
- </li>
90
- </ul>
91
- </div>
92
- <div />
93
- </el-card>
94
- </el-col>
95
-
96
- <el-col :xl="16" :lg="12" :md="24">
97
- <el-card class="mb-2">
98
- <template #header>
99
- <div class="font-bold">
100
- <span>个人动态</span>
101
- </div>
102
- </template>
103
- <div class="p-3">
104
- <ul class="p-0 w-full h-full">
105
- <li
106
- v-for="item in logList"
107
- :key="item.id"
108
- class="w-full list-none p-2 border-b border-gray-200"
109
- >
110
- <div class="flex">
111
- <div>
112
- <el-avatar class="text-base">{{ firstName }}</el-avatar>
113
- </div>
114
- <div class="ml-3">
115
- <div>
116
- <span class="text-blue-600 mr-3">{{ item.browser }}</span>
117
- <span>{{ item.browserVersion || item.platformVersion }}</span>
118
- </div>
119
- <div class="text-gray-400 text-sm">{{ item.loginTime }}</div>
120
- </div>
121
- </div>
122
- </li>
123
- </ul>
124
- </div>
125
- </el-card>
126
- </el-col>
127
-
128
- <!-- 右侧 -->
129
- <el-col :xl="8" :lg="12" :md="24" class="">
130
- <el-card class="mb-2">
131
- <template #header>
132
- <div class="font-bold">
133
- <span>日历</span>
134
- </div>
135
- </template>
136
- <div class="p-1">
137
- <ut-calendar :holidays="holidays" :statutory-holiday="statutoryHoliday" />
138
- </div>
139
- </el-card>
140
- </el-col>
141
- </el-row>
142
- <menu-favorite
143
- v-if="showFavorite"
144
- :data-source="menuList"
145
- :user-name="systemHook.getUserInfo.userName"
146
- :icons="icons"
147
- @close="showFavorite = false"
148
- @success="getMenuList"
149
- />
150
- </div>
151
- </template>
152
-
153
- <script setup lang="ts">
154
- import { ref, onMounted, computed } from 'vue';
155
- import { useRouter } from 'vue-router';
156
- import dayjs from 'dayjs';
157
- import { lunarCalendar, cookies } from '@utogether/utils';
158
- import { useSystemStoreHook } from '../../store/modules/system';
159
- import { getServiceApi } from '../../api';
160
- import { kLOGINER } from '../../contant';
161
- import menuFavorite from './components/menu-favorite.vue';
162
- defineOptions({ name: 'SuHome' });
163
-
164
- const systemHook = useSystemStoreHook();
165
- const router = useRouter();
166
-
167
- const menuList = ref([]);
168
- const logList = ref([]);
169
- const showFavorite = ref(false);
170
- const loading = ref(false);
171
-
172
- const firstName = computed(() => {
173
- return systemHook.getUserInfo.name?.slice(0, 1);
174
- });
175
-
176
- // 角色
177
- const getRole = () => {
178
- const isAdmin = systemHook.isAdminRole;
179
- if (isAdmin) {
180
- return '系统管理员';
181
- } else {
182
- return systemHook.getUserInfo?.sysRoles?.map(m => m.roleName).join(',');
183
- }
184
- };
185
-
186
- // 组织
187
- const getOrg = () => {
188
- const isAdmin = systemHook.isAdminRole;
189
- if (isAdmin) {
190
- return '【系统管理员】拥有所有组织';
191
- } else {
192
- if (getRole() === '项目组管理员') {
193
- return '【项目组管理员】拥有所有组织';
194
- }
195
- return systemHook.getOrglist?.map(m => m.orgName).join(',');
196
- }
197
- };
198
-
199
- // 获取时间段
200
- const getCurrentPeriod = () => {
201
- const hour = Number(dayjs().format('HH'));
202
- return hour < 12 ? '上午好' : hour < 18 ? '下午好' : '晚上好';
203
- };
204
-
205
- const getLunarDay = () => {
206
- const time = new Date();
207
- const lunarday = lunarCalendar.solar2lunar(
208
- time.getFullYear(),
209
- time.getMonth() + 1,
210
- time.getDate()
211
- ) as IRecord;
212
- const { gzYear, IMonthCn, IDayCn, cMonth, cDay, ncWeek } = lunarday;
213
- return `${cMonth}月${cDay}日 ${gzYear}${IMonthCn}${IDayCn} ${ncWeek}`;
214
- };
215
-
216
- /** 查询收藏菜单功能 */
217
- const getMenuList = () => {
218
- const url = '/upfm/v1/menuFavority';
219
- loading.value = true;
220
- const query = { pageSize: 20, pageNum: 1, userName: cookies.get(kLOGINER) };
221
- getServiceApi()
222
- .get(url, query)
223
- .then((res: IResponseData) => {
224
- menuList.value = res?.list || [];
225
- })
226
- .finally(() => {
227
- loading.value = false;
228
- });
229
- };
230
-
231
- const onClickMenu = item => {
232
- router.push(item.menuPath);
233
- };
234
-
235
- const getUserLog = () => {
236
- const url = '/upfm/v1/userMonitor';
237
- const query = { pageSize: 8, pageNum: 1, employeeName: systemHook.getUserInfo?.name };
238
- getServiceApi()
239
- .get(url, query)
240
- .then((res: IResponseData) => {
241
- logList.value = res?.list || [];
242
- });
243
- };
244
-
245
- const onFavoriteMenu = () => {
246
- showFavorite.value = true;
247
- };
248
-
249
- onMounted(() => {
250
- getMenuList();
251
- getUserLog();
252
- });
253
-
254
- const getColor = idx => {
255
- const colorSet = ['#409eff', '#67c23a', '#13c2c2', '#e85f33', 'orange'];
256
- return colorSet[idx % 5];
257
- };
258
-
259
- const icons = [
260
- 'community',
261
- 'shield-star',
262
- 'group',
263
- 'settings',
264
- 'star',
265
- 'train',
266
- 'send-plane',
267
- 'rocket',
268
- 'device',
269
- 'compass',
270
- 'map-pin',
271
- 'keynote',
272
- 'article',
273
- 'tv',
274
- 'database-2',
275
- 'calendar'
276
- ];
277
-
278
- // 假期设置
279
- const holidays = [
280
- {
281
- 2023: { 12: { 30: '班', 31: '班' } }
282
- },
283
- {
284
- 2024: {
285
- 1: { 1: '假' },
286
- 2: {
287
- 4: '班',
288
- 10: '',
289
- 11: '',
290
- 12: '',
291
- 13: '',
292
- 14: '',
293
- 15: '',
294
- 16: '',
295
- 17: '假',
296
- 18: '班'
297
- },
298
- 4: { 4: '假', 5: '假', 6: '假', 7: '班', 28: '班' },
299
- 5: { 1: '假', 2: '假', 3: '假', 4: '假', 5: '假', 11: '班' },
300
- 6: { 8: '假', 9: '假', 10: '假' },
301
- 9: { 15: '假', 16: '假', 17: '假', 14: '班', 29: '班' },
302
- 10: { 1: '假', 2: '假', 3: '假', 4: '假', 5: '假', 6: '假', 7: '假', 12: '班' }
303
- }
304
- }
305
- ];
306
- // 法定假日;
307
- const statutoryHoliday = [
308
- { name: '元旦', date: '2024-01-01' },
309
- { name: '春节', date: '2024-02-10' },
310
- { name: '清明节', date: '2024-04-04' },
311
- { name: '劳动节', date: '2024-05-01' },
312
- { name: '端午节', date: '2024-06-10' },
313
- { name: '中秋节', date: '2024-09-17' },
314
- { name: '国庆节', date: '2024-10-01' }
315
- ];
316
- </script>
317
-
318
- <style lang="scss" scoped>
319
- .ut-home {
320
- .el-avatar--large {
321
- --el-avatar-size: 72px;
322
- }
323
-
324
- ::v-deep(.el-card__body) {
325
- padding: 0 !important;
326
- }
327
- }
328
-
329
- // .u-dashed-menu {
330
- // li {
331
- // box-shadow: 1px 0 0 0 #e8e8e8, 0 1px 0 0 #e8e8e8, 1px 1px 0 0 #e8e8e8, 1px 0 0 0 #e8e8e8 inset,
332
- // 0 1px 0 0 #e8e8e8 inset;
333
- // }
334
-
335
- // li:hover {
336
- // box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
337
- // }
338
- // }
339
- </style>
1
+ <!--
2
+ * @Author: levi7754 levi7754@163.com
3
+ * @Date: 2023-11-02 10:04:05
4
+ * @LastEditors: levi7754 levi7754@163.com
5
+ * @LastEditTime: 2025-12-02 18:28:17
6
+ * @FilePath: /front-web-mes/src/views/uhome/su-welcome.vue
7
+ * @Description: 欢迎页面
8
+ -->
9
+ <template>
10
+ <div class="ut-home m-3">
11
+ <!-- 顶部 -->
12
+ <div class="h-32 mb-4 p-4 flex justify-between items-center bg-white home-page">
13
+ <div class="flex flex-row items-center flex-[2]">
14
+ <div>
15
+ <el-avatar size="large" class="text-4xl font-bold bg-[var(--el-color-primary)]">{{ firstName }}</el-avatar>
16
+ </div>
17
+ <div class="ml-4 text-xs flex-[2]">
18
+ <div class="flex justify-center items-center">
19
+ <span> {{ getCurrentPeriod() }}, {{ systemHook.getUserInfo?.name || '' }},欢迎回来! </span>
20
+ <div class="flex flex-[2] justify-center items-center font-bold" style="color: var(--el-color-primary)">
21
+ 星光不问赶路人,岁月不负有心人,以梦为马,不负韶华!
22
+ </div>
23
+ </div>
24
+ <div class="py-2 text-gray-500 flex">
25
+ <span class="inline-block"> 所属角色: </span>
26
+ <div class="w-2/3">{{ getRole() }}</div>
27
+ </div>
28
+ <div class="text-gray-500 flex">
29
+ <span class="inline-block"> 所属组织: </span>
30
+ <div class="w-2/3">{{ getOrg() }}</div>
31
+ </div>
32
+ </div>
33
+ </div>
34
+ <div class="flex flex-col">
35
+ <span class="text-4xl">
36
+ <ut-flip-down :show-days="false" :show-labels="false" />
37
+ </span>
38
+ <div class="mt-1 ml-3">{{ getLunarDay() }}</div>
39
+ </div>
40
+ </div>
41
+ <!-- 底部 -->
42
+ <el-row class="m-2" :gutter="10">
43
+ <el-col v-spinning="loading" :lg="24" :md="24" class="">
44
+ <el-card class="mb-2">
45
+ <template #header>
46
+ <div class="flex items-center justify-between dark:bg-black">
47
+ <span class="font-bold">常用菜单</span>
48
+ <span class="text-xs text-gray-400 cursor-pointer" @click="onFavoriteMenu">
49
+ <span>更多</span>
50
+ <i class="vxe-icon-arrow-right" />
51
+ </span>
52
+ </div>
53
+ </template>
54
+
55
+ <div class="default:bg-white dark:bg-black">
56
+ <el-empty v-if="!menuList.length" :image-size="100" description="快来添加常用菜单吧!" class="p-0 pb-3" />
57
+ <ul
58
+ class="p-0 w-full h-full grid grid-rows-1 grid-cols-8 u-dashed-menu"
59
+ :class="{ 'grid-rows-2': menuList.length > 8 }"
60
+ >
61
+ <li
62
+ v-for="(item, idx) in menuList"
63
+ :key="item.id"
64
+ class="text-center list-none bg-white"
65
+ @click="onClickMenu(item)"
66
+ >
67
+ <div class="h-20 flex justify-center items-center flex-col">
68
+ <div
69
+ class="rounded-full w-10 h-10 flex items-center justify-center"
70
+ :style="{ backgroundColor: getColor(idx) }"
71
+ >
72
+ <iconify-icon-offline :icon="item.icon || `ri:${icons[idx]}-line`" class="text-2xl text-white" />
73
+ </div>
74
+ <span class="text-xs mt-2">{{ item.menuName }}</span>
75
+ </div>
76
+ </li>
77
+ </ul>
78
+ </div>
79
+ <div />
80
+ </el-card>
81
+ </el-col>
82
+
83
+ <el-col :xl="16" :lg="12" :md="24">
84
+ <el-card class="mb-2">
85
+ <template #header>
86
+ <div class="font-bold">
87
+ <span>个人动态</span>
88
+ </div>
89
+ </template>
90
+ <div class="p-3">
91
+ <ul class="p-0 w-full h-full">
92
+ <li v-for="item in logList" :key="item.id" class="w-full list-none p-2 border-b border-gray-200">
93
+ <div class="flex">
94
+ <div>
95
+ <el-avatar class="text-base">{{ firstName }}</el-avatar>
96
+ </div>
97
+ <div class="ml-3">
98
+ <div>
99
+ <span class="text-blue-600 mr-3">{{ item.browser }}</span>
100
+ <span>{{ item.browserVersion || item.platformVersion }}</span>
101
+ </div>
102
+ <div class="text-gray-400 text-sm">{{ item.loginTime }}</div>
103
+ </div>
104
+ </div>
105
+ </li>
106
+ </ul>
107
+ </div>
108
+ </el-card>
109
+ </el-col>
110
+
111
+ <!-- 右侧 -->
112
+ <el-col :xl="8" :lg="12" :md="24" class="">
113
+ <el-card class="mb-2">
114
+ <template #header>
115
+ <div class="font-bold">
116
+ <span>日历</span>
117
+ </div>
118
+ </template>
119
+ <div class="p-1">
120
+ <ut-calendar :holidays="holidays" :statutory-holiday="statutoryHoliday" />
121
+ </div>
122
+ </el-card>
123
+ </el-col>
124
+ </el-row>
125
+ <menu-favorite
126
+ v-if="showFavorite"
127
+ :data-source="menuList"
128
+ :user-name="systemHook.getUserInfo.userName"
129
+ :icons="icons"
130
+ @close="showFavorite = false"
131
+ @success="getMenuList"
132
+ />
133
+ </div>
134
+ </template>
135
+
136
+ <script setup lang="ts">
137
+ import { ref, onMounted, computed } from 'vue';
138
+ import { useRouter } from 'vue-router';
139
+ import dayjs from 'dayjs';
140
+ import { lunarCalendar, cookies } from '@utogether/utils';
141
+ import { useSystemStoreHook } from '../../store/modules/system';
142
+ import { getServiceApi } from '../../api';
143
+ import { kLOGINER } from '../../contant';
144
+ import menuFavorite from './components/menu-favorite.vue';
145
+
146
+ defineOptions({ name: 'UdpWelcome' });
147
+
148
+ const systemHook = useSystemStoreHook();
149
+ const router = useRouter();
150
+
151
+ const menuList = ref([]);
152
+ const logList = ref([]);
153
+ const showFavorite = ref(false);
154
+ const loading = ref(false);
155
+
156
+ const firstName = computed(() => {
157
+ return systemHook.getUserInfo.name?.slice(0, 1);
158
+ });
159
+
160
+ // 角色
161
+ const getRole = () => {
162
+ const isAdmin = systemHook.isAdminRole;
163
+ if (isAdmin) {
164
+ return '系统管理员';
165
+ } else {
166
+ return systemHook.getUserInfo?.sysRoles?.map(m => m.roleName).join(',');
167
+ }
168
+ };
169
+
170
+ // 组织
171
+ const getOrg = () => {
172
+ const isAdmin = systemHook.isAdminRole;
173
+ if (isAdmin) {
174
+ return '【系统管理员】拥有所有组织';
175
+ } else {
176
+ if (getRole() === '项目组管理员') {
177
+ return '【项目组管理员】拥有所有组织';
178
+ }
179
+ return systemHook.getOrglist?.map(m => m.orgName).join(',');
180
+ }
181
+ };
182
+
183
+ // 获取时间段
184
+ const getCurrentPeriod = () => {
185
+ const hour = Number(dayjs().format('HH'));
186
+ return hour < 12 ? '上午好' : hour < 18 ? '下午好' : '晚上好';
187
+ };
188
+
189
+ const getLunarDay = () => {
190
+ const time = new Date();
191
+ const lunarday = lunarCalendar.solar2lunar(time.getFullYear(), time.getMonth() + 1, time.getDate()) as IRecord;
192
+ const { gzYear, IMonthCn, IDayCn, cMonth, cDay, ncWeek } = lunarday;
193
+ return `${cMonth}月${cDay}日 ${gzYear}${IMonthCn}${IDayCn} ${ncWeek}`;
194
+ };
195
+
196
+ /** 查询收藏菜单功能 */
197
+ const getMenuList = () => {
198
+ const url = '/upfm/v1/menuFavority';
199
+ loading.value = true;
200
+ const query = { pageSize: 20, pageNum: 1, userName: cookies.get(kLOGINER) };
201
+ getServiceApi()
202
+ .get(url, query)
203
+ .then((res: IResponseData) => {
204
+ menuList.value = res?.list || [];
205
+ })
206
+ .finally(() => {
207
+ loading.value = false;
208
+ });
209
+ };
210
+
211
+ const onClickMenu = item => {
212
+ router.push(item.menuPath);
213
+ };
214
+
215
+ const getUserLog = () => {
216
+ const url = '/upfm/v1/userMonitor';
217
+ const query = { pageSize: 8, pageNum: 1, employeeName: systemHook.getUserInfo?.name };
218
+ getServiceApi()
219
+ .get(url, query)
220
+ .then((res: IResponseData) => {
221
+ logList.value = res?.list || [];
222
+ });
223
+ };
224
+
225
+ const onFavoriteMenu = () => {
226
+ showFavorite.value = true;
227
+ };
228
+
229
+ onMounted(() => {
230
+ getMenuList();
231
+ getUserLog();
232
+ });
233
+
234
+ const getColor = idx => {
235
+ const colorSet = ['#409eff', '#67c23a', '#13c2c2', '#e85f33', 'orange'];
236
+ return colorSet[idx % 5];
237
+ };
238
+
239
+ const icons = [
240
+ 'community',
241
+ 'shield-star',
242
+ 'group',
243
+ 'settings',
244
+ 'star',
245
+ 'train',
246
+ 'send-plane',
247
+ 'rocket',
248
+ 'device',
249
+ 'compass',
250
+ 'map-pin',
251
+ 'keynote',
252
+ 'article',
253
+ 'tv',
254
+ 'database-2',
255
+ 'calendar'
256
+ ];
257
+
258
+ // 假期设置
259
+ const holidays = [
260
+ {
261
+ 2023: { 12: { 30: '', 31: '班' } }
262
+ },
263
+ {
264
+ 2024: {
265
+ 1: { 1: '' },
266
+ 2: {
267
+ 4: '',
268
+ 10: '',
269
+ 11: '',
270
+ 12: '',
271
+ 13: '',
272
+ 14: '',
273
+ 15: '',
274
+ 16: '',
275
+ 17: '',
276
+ 18: '班'
277
+ },
278
+ 4: { 4: '假', 5: '假', 6: '假', 7: '班', 28: '班' },
279
+ 5: { 1: '假', 2: '假', 3: '假', 4: '假', 5: '假', 11: '班' },
280
+ 6: { 8: '假', 9: '假', 10: '假' },
281
+ 9: { 15: '假', 16: '假', 17: '假', 14: '班', 29: '班' },
282
+ 10: { 1: '假', 2: '假', 3: '假', 4: '假', 5: '假', 6: '假', 7: '假', 12: '班' }
283
+ }
284
+ }
285
+ ];
286
+ // 法定假日;
287
+ const statutoryHoliday = [
288
+ { name: '元旦', date: '2024-01-01' },
289
+ { name: '春节', date: '2024-02-10' },
290
+ { name: '清明节', date: '2024-04-04' },
291
+ { name: '劳动节', date: '2024-05-01' },
292
+ { name: '端午节', date: '2024-06-10' },
293
+ { name: '中秋节', date: '2024-09-17' },
294
+ { name: '国庆节', date: '2024-10-01' }
295
+ ];
296
+ </script>
297
+
298
+ <style lang="scss" scoped>
299
+ .ut-home {
300
+ .el-avatar--large {
301
+ --el-avatar-size: 72px;
302
+ }
303
+
304
+ ::v-deep(.el-card__body) {
305
+ padding: 0 !important;
306
+ }
307
+ }
308
+
309
+ // .u-dashed-menu {
310
+ // li {
311
+ // box-shadow: 1px 0 0 0 #e8e8e8, 0 1px 0 0 #e8e8e8, 1px 1px 0 0 #e8e8e8, 1px 0 0 0 #e8e8e8 inset,
312
+ // 0 1px 0 0 #e8e8e8 inset;
313
+ // }
314
+
315
+ // li:hover {
316
+ // box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
317
+ // }
318
+ // }
319
+ </style>