@utogether/udp-core 2.0.0-beta.27 → 2.0.0-beta.28
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.
- package/dist/{403-gdcH0-Bo.js → 403-CyoOD-Ik.js} +1 -1
- package/dist/{404-Se2SF97M.js → 404-Ch_OHTw0.js} +1 -1
- package/dist/{500-B6j9AqLo.js → 500-Cf9am7HK.js} +1 -1
- package/dist/{AuthorityInfo-CQ8ydZvr.js → AuthorityInfo-BJ427cqG.js} +1 -1
- package/dist/{AuthorityInfo.vue_vue_type_style_index_0_lang-C4NRvS8p.js → AuthorityInfo.vue_vue_type_style_index_0_lang-D9y7AwbB.js} +11 -12
- package/dist/{Company-BzSVBSC4.js → Company-qo-lKPkv.js} +3 -3
- package/dist/{CompanyPanel-DBjZB4aJ.js → CompanyPanel-DkKWAKvY.js} +7 -7
- package/dist/{Department-BkgseHo8.js → Department-CHUQByKX.js} +3 -3
- package/dist/{DepartmentPanel-Sen93_2M.js → DepartmentPanel-C742dfOO.js} +27 -28
- package/dist/{DesignPanel-pqDcwaFC.js → DesignPanel-D9oE5R7m.js} +1 -1
- package/dist/{DesignPanel.vue_vue_type_style_index_0_lang-BjtYyEw7.js → DesignPanel.vue_vue_type_style_index_0_lang-hYldVEbo.js} +192 -108
- package/dist/{DictView-CJLG4LlE.js → DictView-CrFXprP9.js} +1 -1
- package/dist/{InvOrganization-D0Jq1IAa.js → InvOrganization-Cz8SzIgs.js} +6 -7
- package/dist/{Org-CO_1WT39.js → Org-Bzt6yKox.js} +9 -10
- package/dist/{Preview-DLI4Bwel.js → Preview-jonigfMQ.js} +1 -1
- package/dist/{ReportDefine-Cw46OnJ_.js → ReportDefine-BpiM5Ovq.js} +1 -1
- package/dist/{ReportDesign-D4sHTXT7.js → ReportDesign-fp09cXJ7.js} +24 -25
- package/dist/{ReportQuery-DtOCvQSN.js → ReportQuery-52ZP1PYP.js} +1 -1
- package/dist/{ReportQueryFrom-QjL-ETPq.js → ReportQueryFrom-DSYavJb1.js} +1 -1
- package/dist/{ReportQueryFrom.vue_vue_type_style_index_0_lang-Dj9ne87n.js → ReportQueryFrom.vue_vue_type_style_index_0_lang-DBGYEp0u.js} +4 -4
- package/dist/{ReportTemplate-BxAgc_Aj.js → ReportTemplate-CA_UW0eD.js} +3 -3
- package/dist/{Role-Df77BBD-.js → Role-DqOt8Bk0.js} +3 -3
- package/dist/{RoleAssign-BrunouML.js → RoleAssign-BdxhefhQ.js} +3 -3
- package/dist/{RolePanel-HLA7XBlN.js → RolePanel-2gZ3H0ET.js} +1 -1
- package/dist/{RolePanel-DSVwqhiD.js → RolePanel-BsNd0svJ.js} +1 -1
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CN0rUxKz.js → RolePanel.vue_vue_type_script_setup_true_lang-DLOwgF99.js} +9 -9
- package/dist/{RolePanel.vue_vue_type_script_setup_true_lang-CKlbqRa5.js → RolePanel.vue_vue_type_script_setup_true_lang-DmzD9kab.js} +26 -27
- package/dist/{ScrollPanel.vue_vue_type_style_index_0_lang-D_FeSXKv.js → ScrollPanel.vue_vue_type_style_index_0_lang-B9ptUMeI.js} +7 -7
- package/dist/{Staff-BeL1xcRf.js → Staff-D3L8fEoY.js} +3 -3
- package/dist/{StaffInfo-CIfnltyX.js → StaffInfo-DYRw6ZYJ.js} +1 -1
- package/dist/{StaffInfo.vue_vue_type_script_setup_true_lang-DbLFwWfG.js → StaffInfo.vue_vue_type_script_setup_true_lang-xqEOQnMs.js} +1 -1
- package/dist/{StaffPanel-BV2CHWac.js → StaffPanel-DkrNH6Px.js} +1 -1
- package/dist/{StaffPanel.vue_vue_type_script_setup_true_lang-CvT-Vp2G.js → StaffPanel.vue_vue_type_script_setup_true_lang-BPBMnliy.js} +8 -9
- package/dist/{SysUser-DPfNvthk.js → SysUser-Bl1-cIpJ.js} +2 -2
- package/dist/{SysUserPanel-CoLKYlQE.js → SysUserPanel-yxNLaBwt.js} +1 -1
- package/dist/{SysUserPanel.vue_vue_type_script_setup_true_lang-lcO3Cjbq.js → SysUserPanel.vue_vue_type_script_setup_true_lang-BDcsgSl5.js} +11 -12
- package/dist/{SystemMenu-sdj1dRDA.js → SystemMenu-C4_Arn12.js} +9 -10
- package/dist/{UserInfo-CTX4hhFl.js → UserInfo-QcNwJCUR.js} +1 -1
- package/dist/{UserInfo.vue_vue_type_style_index_0_lang-ClhCd_8z.js → UserInfo.vue_vue_type_style_index_0_lang-DLIeUphX.js} +5 -6
- package/dist/{childView-BDmWwJO5.js → childView-B23DEO2u.js} +1 -1
- package/dist/{childView-Dx3ACtHa.js → childView-saDZQv9x.js} +1 -1
- package/dist/{childView.vue_vue_type_style_index_0_lang-CfKq_0FN.js → childView.vue_vue_type_style_index_0_lang-RsKR6CAC.js} +14 -15
- package/dist/{childView.vue_vue_type_style_index_0_lang-DxZNtkhd.js → childView.vue_vue_type_style_index_0_lang-ZFEfavUY.js} +11 -12
- package/dist/{code-rule-cvN4gYC_.js → code-rule-2_Ihx_by.js} +12 -13
- package/dist/core.es.js +21 -19
- package/dist/{cron-task-B0TkxFdp.js → cron-task-BFOPJQIk.js} +3 -4
- package/dist/{frameView-5cy5BSgS.js → frameView-f7Ya0Knj.js} +1 -1
- package/dist/img/minicolors.png +0 -0
- package/dist/{index-C5WRTwvI.js → index-BpdTDaTk.js} +811 -604
- package/dist/{layout-home-DrARg-3o.js → layout-home-v3DPJ7rB.js} +12 -13
- package/dist/{layoutView-25v_ngk5.js → layoutView-DZHoQDH1.js} +186 -187
- package/dist/{log-in-Bmz5Uhbt.js → log-in-BPAMJTwH.js} +4 -5
- package/dist/{log-out-B-8m3oNj.js → log-out-DZACF0jg.js} +8 -9
- package/dist/{login-Cmp2RvvW.js → login-B8cwozax.js} +22 -23
- package/dist/{lov-view-BATtzw2X.js → lov-view-Ba7Y7xy0.js} +4 -5
- package/dist/{menuInfo-BIvrE7nm.js → menuInfo-BpRKFYK8.js} +1 -1
- package/dist/{menuInfo.vue_vue_type_style_index_0_lang-B6USomit.js → menuInfo.vue_vue_type_style_index_0_lang-DJ5sUC6m.js} +17 -18
- package/dist/{pda-app-CzHVyeEa.js → pda-app-C0jJecrL.js} +7 -8
- package/dist/{resource-Y5lGB38n.js → resource-BG22Cw4P.js} +4 -4
- package/dist/su-welcome-DaxhbrC6.js +879 -0
- package/dist/{sys-config-CqO03LeC.js → sys-config-CG2fMtak.js} +22 -23
- package/dist/udp-core.css +1 -1
- package/dist/{useNav-C-rCgubt.js → useNav-_u2UAQWk.js} +24 -24
- package/index.ts +54 -51
- package/package.json +21 -21
- package/src/api/http.ts +10 -4
- package/src/api/index.ts +51 -51
- package/src/api/user.ts +64 -64
- package/src/components/udp/content/index.vue +93 -93
- package/src/components/udp/form-upload/form-upload.vue +496 -496
- package/src/components/udp/grid/index.vue +643 -544
- package/src/components/udp/index.ts +2 -1
- package/src/components/udp/modal-form/index.vue +326 -0
- package/src/components/udp/utils.ts +420 -420
- package/src/layout/components/lay-navbar/index.vue +240 -240
- package/src/layout/components/lay-search/components/SearchModal.vue +185 -185
- package/src/layout/components/lay-sidebar/mixNav.vue +261 -261
- package/src/layout/components/lay-sidebar/sidebarItem.vue +199 -195
- package/src/layout/components/lay-sidebar/vertical.vue +92 -92
- package/src/layout/layoutView.vue +1 -0
- package/src/main.ts +111 -111
- package/src/plugins/i18n/zh.ts +5 -1
- package/src/plugins/vxe-table/index.ts +116 -116
- package/src/router/index.ts +158 -156
- package/src/router/utils.ts +434 -430
- package/src/store/modules/permission.ts +1 -1
- package/src/store/modules/system.ts +193 -193
- package/src/style/print-lock.css +380 -375
- package/src/style/suprint.css +990 -985
- package/src/utils/authority/index.ts +46 -46
- package/src/utils/dataFormat/index.ts +309 -222
- package/src/utils/udp/http/index.ts +19 -11
- package/src/views/uhome/components/home-todo.vue +15 -3
- package/src/views/uhome/dynamic-card.vue +31 -31
- package/src/views/uhome/su-welcome.vue +310 -310
- package/src/views/ulogin/login.vue +292 -292
- package/src/views/urpt/design/DesignPanel.vue +538 -507
- package/src/views/urpt/design/print-data.ts +39 -59
- package/dist/await-to-js.es5-Bv3Eu4mi.js +0 -10
- package/dist/su-welcome-CXA6OzBw.js +0 -878
|
@@ -1,310 +1,310 @@
|
|
|
1
|
-
<!--
|
|
2
|
-
* @Author: levi7754 levi7754@163.com
|
|
3
|
-
* @Date: 2023-11-02 10:04:05
|
|
4
|
-
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
-
* @LastEditTime: 2026-02-02 14:31:54
|
|
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 v-if="systemLayout.UserProfile" 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 v-if="getRole() !== '系统管理员'" 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
|
-
<el-row v-if="has2upversion">
|
|
42
|
-
<dynamic-card :list="dataList" />
|
|
43
|
-
</el-row>
|
|
44
|
-
<el-row class="m-2" :gutter="10">
|
|
45
|
-
<el-col v-if="systemLayout.FavorityMenu" :lg="24" :md="24" class="">
|
|
46
|
-
<commonMenu />
|
|
47
|
-
</el-col>
|
|
48
|
-
<el-col v-if="systemLayout.ToDo" :lg="24" :md="24" class="">
|
|
49
|
-
<el-card>
|
|
50
|
-
<template #header>
|
|
51
|
-
<div class="font-bold">
|
|
52
|
-
<span>流程审批</span>
|
|
53
|
-
</div>
|
|
54
|
-
</template>
|
|
55
|
-
|
|
56
|
-
<div>
|
|
57
|
-
<homeTodo />
|
|
58
|
-
</div>
|
|
59
|
-
</el-card>
|
|
60
|
-
</el-col>
|
|
61
|
-
|
|
62
|
-
<el-col v-if="systemLayout.LoginInfo" :xl="16" :lg="12" :md="24">
|
|
63
|
-
<el-card class="mb-2">
|
|
64
|
-
<template #header>
|
|
65
|
-
<div class="font-bold">
|
|
66
|
-
<span>个人动态</span>
|
|
67
|
-
</div>
|
|
68
|
-
</template>
|
|
69
|
-
<div class="p-3">
|
|
70
|
-
<ul class="p-0 w-full h-full">
|
|
71
|
-
<li v-for="item in logList" :key="item.id" class="w-full list-none p-2 border-b border-gray-200">
|
|
72
|
-
<div class="flex">
|
|
73
|
-
<div>
|
|
74
|
-
<el-avatar class="text-base">{{ firstName }}</el-avatar>
|
|
75
|
-
</div>
|
|
76
|
-
<div class="ml-3">
|
|
77
|
-
<div>
|
|
78
|
-
<span class="text-blue-600 mr-3">{{ item.browser }}</span>
|
|
79
|
-
<span>{{ item.browserVersion || item.platformVersion }}</span>
|
|
80
|
-
</div>
|
|
81
|
-
<div class="text-gray-400 text-sm">{{ item.loginTime }}</div>
|
|
82
|
-
</div>
|
|
83
|
-
</div>
|
|
84
|
-
</li>
|
|
85
|
-
</ul>
|
|
86
|
-
</div>
|
|
87
|
-
</el-card>
|
|
88
|
-
</el-col>
|
|
89
|
-
|
|
90
|
-
<!-- 右侧 -->
|
|
91
|
-
<el-col v-if="systemLayout.Calendar" :xl="8" :lg="12" :md="24" class="">
|
|
92
|
-
<el-card class="mb-2">
|
|
93
|
-
<template #header>
|
|
94
|
-
<div class="font-bold">
|
|
95
|
-
<span>日历</span>
|
|
96
|
-
</div>
|
|
97
|
-
</template>
|
|
98
|
-
<div class="p-1">
|
|
99
|
-
<ut-calendar :holidays="holidays" :statutory-holiday="statutoryHoliday" />
|
|
100
|
-
</div>
|
|
101
|
-
</el-card>
|
|
102
|
-
</el-col>
|
|
103
|
-
</el-row>
|
|
104
|
-
|
|
105
|
-
<!-- 重置密码 -->
|
|
106
|
-
<ut-modal-form
|
|
107
|
-
v-if="showModal"
|
|
108
|
-
:record="data"
|
|
109
|
-
:items="passwordItems()"
|
|
110
|
-
:width="360"
|
|
111
|
-
:height="250"
|
|
112
|
-
:modal-options="{ showClose: false }"
|
|
113
|
-
:show-cancle-button="false"
|
|
114
|
-
data-status="update"
|
|
115
|
-
:title="$t('message.udp.passwordReset')"
|
|
116
|
-
url="/uums/user/updatePwd"
|
|
117
|
-
method="put"
|
|
118
|
-
@close="showModal = false"
|
|
119
|
-
@confirm="logout()"
|
|
120
|
-
/>
|
|
121
|
-
</div>
|
|
122
|
-
</template>
|
|
123
|
-
|
|
124
|
-
<script setup lang="ts">
|
|
125
|
-
import { ref, onMounted, computed, onBeforeMount } from 'vue';
|
|
126
|
-
import { cookies, lunarCalendar, storageLocal, getDictChildren } from '@utogether/utils';
|
|
127
|
-
import CryptoJS from 'crypto-js';
|
|
128
|
-
import to from 'await-to-js';
|
|
129
|
-
import dayjs from 'dayjs';
|
|
130
|
-
import { useSystemStoreHook } from '../../store/modules/system';
|
|
131
|
-
import commonMenu from './components/common-menu.vue';
|
|
132
|
-
import homeTodo from './components/home-todo.vue';
|
|
133
|
-
import dynamicCard from './dynamic-card.vue';
|
|
134
|
-
import { kSYSCONFIG, kPASSWORD, kCRYPTO } from '../../contant';
|
|
135
|
-
import pkg from '../../../package.json';
|
|
136
|
-
import { getServiceApi } from '../../api';
|
|
137
|
-
|
|
138
|
-
import { useNav } from '../../layout/hooks/useNav';
|
|
139
|
-
|
|
140
|
-
defineOptions({ name: 'UdpWelcome' });
|
|
141
|
-
|
|
142
|
-
const systemHook = useSystemStoreHook();
|
|
143
|
-
|
|
144
|
-
const logList = ref([]);
|
|
145
|
-
const dataList = ref([]);
|
|
146
|
-
|
|
147
|
-
const showModal = ref(false);
|
|
148
|
-
const data = ref<IRecord>({});
|
|
149
|
-
|
|
150
|
-
const systemLayout = ref({ UserProfile: false, ToDo: false, FavorityMenu: false, Calendar: false, LoginInfo: false });
|
|
151
|
-
|
|
152
|
-
const firstName = computed(() => {
|
|
153
|
-
return systemHook.getUserInfo.name?.slice(0, 1);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
const { passwordItems, logout } = useNav();
|
|
157
|
-
|
|
158
|
-
const has2upversion = ref(pkg.version.substring(0, 1) === '2');
|
|
159
|
-
|
|
160
|
-
let intervalId = null;
|
|
161
|
-
// 角色
|
|
162
|
-
const getRole = () => {
|
|
163
|
-
const isAdmin = systemHook.isAdminRole;
|
|
164
|
-
if (isAdmin) {
|
|
165
|
-
return '系统管理员';
|
|
166
|
-
} else {
|
|
167
|
-
return systemHook.getUserInfo?.sysRoles?.map(m => m.roleName).join(',');
|
|
168
|
-
}
|
|
169
|
-
};
|
|
170
|
-
|
|
171
|
-
// 组织
|
|
172
|
-
const getOrg = () => {
|
|
173
|
-
const isAdmin = systemHook.isAdminRole;
|
|
174
|
-
if (isAdmin) {
|
|
175
|
-
return '【系统管理员】拥有所有组织';
|
|
176
|
-
} else {
|
|
177
|
-
return systemHook.getOrglist?.map(m => m.orgName).join(',');
|
|
178
|
-
}
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
// 获取时间段
|
|
182
|
-
const getCurrentPeriod = () => {
|
|
183
|
-
const hour = Number(dayjs().format('HH'));
|
|
184
|
-
return hour < 12 ? '上午好' : hour < 18 ? '下午好' : '晚上好';
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
const getLunarDay = () => {
|
|
188
|
-
const time = new Date();
|
|
189
|
-
const lunarday = lunarCalendar.solar2lunar(time.getFullYear(), time.getMonth() + 1, time.getDate()) as IRecord;
|
|
190
|
-
const { gzYear, IMonthCn, IDayCn, cMonth, cDay, ncWeek } = lunarday;
|
|
191
|
-
return `${cMonth}月${cDay}日 ${gzYear}${IMonthCn}${IDayCn} ${ncWeek}`;
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
const getUserLog = () => {
|
|
195
|
-
const url = '/upfm/v1/userMonitor';
|
|
196
|
-
const query = { pageSize: 8, pageNum: 1, employeeName: systemHook.getUserInfo?.name };
|
|
197
|
-
getServiceApi()
|
|
198
|
-
.get(url, query)
|
|
199
|
-
.then((res: IResponseData) => {
|
|
200
|
-
logList.value = res?.list || [];
|
|
201
|
-
});
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
const getLayoutList = async () => {
|
|
205
|
-
const api = getServiceApi();
|
|
206
|
-
const [err, res]: any = await to(
|
|
207
|
-
api.get('/upfm/sysHomeConfig', { pageSize: 1000, pageNum: 1, enabled: '1', isRoleFilter: 'Y' })
|
|
208
|
-
);
|
|
209
|
-
if (err) return;
|
|
210
|
-
systemLayout;
|
|
211
|
-
res?.list.forEach(m => {
|
|
212
|
-
if (m.type === 'custom') {
|
|
213
|
-
console.log(m);
|
|
214
|
-
dataList.value.push(m);
|
|
215
|
-
} else {
|
|
216
|
-
systemLayout.value[m.code] = !!m.code;
|
|
217
|
-
}
|
|
218
|
-
});
|
|
219
|
-
};
|
|
220
|
-
|
|
221
|
-
const getInitPassword = async () => {
|
|
222
|
-
const passWord = CryptoJS.AES.decrypt(cookies.get(kPASSWORD), kCRYPTO).toString(CryptoJS.enc.Utf8);
|
|
223
|
-
const dict = getDictChildren('SU.DEFAULT_PASSWORD')?.find(f => f.dictCode === 'default');
|
|
224
|
-
if (dict && dict.dictName === passWord) {
|
|
225
|
-
// 密码和默认密码一致,提示修改密码
|
|
226
|
-
data.value = {
|
|
227
|
-
id: systemHook.getUserInfo.id,
|
|
228
|
-
oldUserPwd: passWord
|
|
229
|
-
};
|
|
230
|
-
showModal.value = true;
|
|
231
|
-
window.clearInterval(intervalId);
|
|
232
|
-
} else if (dict && dict.dictName !== passWord) {
|
|
233
|
-
// 密码已重置
|
|
234
|
-
window.clearInterval(intervalId);
|
|
235
|
-
}
|
|
236
|
-
};
|
|
237
|
-
|
|
238
|
-
onBeforeMount(() => {
|
|
239
|
-
const sysConfig = storageLocal.getItem(kSYSCONFIG);
|
|
240
|
-
if (sysConfig.initialPasswordModification === 'Y') {
|
|
241
|
-
const passWord = CryptoJS.AES.decrypt(cookies.get(kPASSWORD), kCRYPTO).toString(CryptoJS.enc.Utf8);
|
|
242
|
-
const dict = getDictChildren('SU.DEFAULT_PASSWORD')?.find(f => f.dictCode === 'default');
|
|
243
|
-
if (!dict || dict?.dictName === passWord) {
|
|
244
|
-
intervalId = setInterval(() => {
|
|
245
|
-
getInitPassword();
|
|
246
|
-
}, 1000);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
});
|
|
250
|
-
|
|
251
|
-
onMounted(() => {
|
|
252
|
-
getUserLog();
|
|
253
|
-
if (pkg.version.substring(0, 1) === '2') {
|
|
254
|
-
getLayoutList();
|
|
255
|
-
} else {
|
|
256
|
-
systemLayout.value = { UserProfile: false, ToDo: false, FavorityMenu: false, Calendar: false, LoginInfo: true };
|
|
257
|
-
}
|
|
258
|
-
});
|
|
259
|
-
|
|
260
|
-
// 假期设置
|
|
261
|
-
const holidays = [
|
|
262
|
-
{
|
|
263
|
-
2023: { 12: { 30: '班', 31: '班' } }
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
2024: {
|
|
267
|
-
1: { 1: '假' },
|
|
268
|
-
2: {
|
|
269
|
-
4: '班',
|
|
270
|
-
10: '假',
|
|
271
|
-
11: '假',
|
|
272
|
-
12: '假',
|
|
273
|
-
13: '假',
|
|
274
|
-
14: '假',
|
|
275
|
-
15: '假',
|
|
276
|
-
16: '假',
|
|
277
|
-
17: '假',
|
|
278
|
-
18: '班'
|
|
279
|
-
},
|
|
280
|
-
4: { 4: '假', 5: '假', 6: '假', 7: '班', 28: '班' },
|
|
281
|
-
5: { 1: '假', 2: '假', 3: '假', 4: '假', 5: '假', 11: '班' },
|
|
282
|
-
6: { 8: '假', 9: '假', 10: '假' },
|
|
283
|
-
9: { 15: '假', 16: '假', 17: '假', 14: '班', 29: '班' },
|
|
284
|
-
10: { 1: '假', 2: '假', 3: '假', 4: '假', 5: '假', 6: '假', 7: '假', 12: '班' }
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
];
|
|
288
|
-
// 法定假日;
|
|
289
|
-
const statutoryHoliday = [
|
|
290
|
-
{ name: '元旦', date: '2024-01-01' },
|
|
291
|
-
{ name: '春节', date: '2024-02-10' },
|
|
292
|
-
{ name: '清明节', date: '2024-04-04' },
|
|
293
|
-
{ name: '劳动节', date: '2024-05-01' },
|
|
294
|
-
{ name: '端午节', date: '2024-06-10' },
|
|
295
|
-
{ name: '中秋节', date: '2024-09-17' },
|
|
296
|
-
{ name: '国庆节', date: '2024-10-01' }
|
|
297
|
-
];
|
|
298
|
-
</script>
|
|
299
|
-
|
|
300
|
-
<style lang="scss" scoped>
|
|
301
|
-
.ut-home {
|
|
302
|
-
.el-avatar--large {
|
|
303
|
-
--el-avatar-size: 72px;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
::v-deep(.el-card__body) {
|
|
307
|
-
padding: 0 !important;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
</style>
|
|
1
|
+
<!--
|
|
2
|
+
* @Author: levi7754 levi7754@163.com
|
|
3
|
+
* @Date: 2023-11-02 10:04:05
|
|
4
|
+
* @LastEditors: levi7754 levi7754@163.com
|
|
5
|
+
* @LastEditTime: 2026-02-02 14:31:54
|
|
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 v-if="systemLayout.UserProfile" 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 v-if="getRole() !== '系统管理员'" 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
|
+
<el-row v-if="has2upversion">
|
|
42
|
+
<dynamic-card :list="dataList" />
|
|
43
|
+
</el-row>
|
|
44
|
+
<el-row class="m-2" :gutter="10">
|
|
45
|
+
<el-col v-if="systemLayout.FavorityMenu" :lg="24" :md="24" class="">
|
|
46
|
+
<commonMenu />
|
|
47
|
+
</el-col>
|
|
48
|
+
<el-col v-if="systemLayout.ToDo" :lg="24" :md="24" class="">
|
|
49
|
+
<el-card>
|
|
50
|
+
<template #header>
|
|
51
|
+
<div class="font-bold">
|
|
52
|
+
<span>流程审批</span>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<div>
|
|
57
|
+
<homeTodo />
|
|
58
|
+
</div>
|
|
59
|
+
</el-card>
|
|
60
|
+
</el-col>
|
|
61
|
+
|
|
62
|
+
<el-col v-if="systemLayout.LoginInfo" :xl="16" :lg="12" :md="24">
|
|
63
|
+
<el-card class="mb-2">
|
|
64
|
+
<template #header>
|
|
65
|
+
<div class="font-bold">
|
|
66
|
+
<span>个人动态</span>
|
|
67
|
+
</div>
|
|
68
|
+
</template>
|
|
69
|
+
<div class="p-3">
|
|
70
|
+
<ul class="p-0 w-full h-full">
|
|
71
|
+
<li v-for="item in logList" :key="item.id" class="w-full list-none p-2 border-b border-gray-200">
|
|
72
|
+
<div class="flex">
|
|
73
|
+
<div>
|
|
74
|
+
<el-avatar class="text-base">{{ firstName }}</el-avatar>
|
|
75
|
+
</div>
|
|
76
|
+
<div class="ml-3">
|
|
77
|
+
<div>
|
|
78
|
+
<span class="text-blue-600 mr-3">{{ item.browser }}</span>
|
|
79
|
+
<span>{{ item.browserVersion || item.platformVersion }}</span>
|
|
80
|
+
</div>
|
|
81
|
+
<div class="text-gray-400 text-sm">{{ item.loginTime }}</div>
|
|
82
|
+
</div>
|
|
83
|
+
</div>
|
|
84
|
+
</li>
|
|
85
|
+
</ul>
|
|
86
|
+
</div>
|
|
87
|
+
</el-card>
|
|
88
|
+
</el-col>
|
|
89
|
+
|
|
90
|
+
<!-- 右侧 -->
|
|
91
|
+
<el-col v-if="systemLayout.Calendar" :xl="8" :lg="12" :md="24" class="">
|
|
92
|
+
<el-card class="mb-2">
|
|
93
|
+
<template #header>
|
|
94
|
+
<div class="font-bold">
|
|
95
|
+
<span>日历</span>
|
|
96
|
+
</div>
|
|
97
|
+
</template>
|
|
98
|
+
<div class="p-1">
|
|
99
|
+
<ut-calendar :holidays="holidays" :statutory-holiday="statutoryHoliday" />
|
|
100
|
+
</div>
|
|
101
|
+
</el-card>
|
|
102
|
+
</el-col>
|
|
103
|
+
</el-row>
|
|
104
|
+
|
|
105
|
+
<!-- 重置密码 -->
|
|
106
|
+
<ut-modal-form
|
|
107
|
+
v-if="showModal"
|
|
108
|
+
:record="data"
|
|
109
|
+
:items="passwordItems()"
|
|
110
|
+
:width="360"
|
|
111
|
+
:height="250"
|
|
112
|
+
:modal-options="{ showClose: false }"
|
|
113
|
+
:show-cancle-button="false"
|
|
114
|
+
data-status="update"
|
|
115
|
+
:title="$t('message.udp.passwordReset')"
|
|
116
|
+
url="/uums/user/updatePwd"
|
|
117
|
+
method="put"
|
|
118
|
+
@close="showModal = false"
|
|
119
|
+
@confirm="logout()"
|
|
120
|
+
/>
|
|
121
|
+
</div>
|
|
122
|
+
</template>
|
|
123
|
+
|
|
124
|
+
<script setup lang="ts">
|
|
125
|
+
import { ref, onMounted, computed, onBeforeMount } from 'vue';
|
|
126
|
+
import { cookies, lunarCalendar, storageLocal, getDictChildren } from '@utogether/utils';
|
|
127
|
+
import CryptoJS from 'crypto-js';
|
|
128
|
+
import to from 'await-to-js';
|
|
129
|
+
import dayjs from 'dayjs';
|
|
130
|
+
import { useSystemStoreHook } from '../../store/modules/system';
|
|
131
|
+
import commonMenu from './components/common-menu.vue';
|
|
132
|
+
import homeTodo from './components/home-todo.vue';
|
|
133
|
+
import dynamicCard from './dynamic-card.vue';
|
|
134
|
+
import { kSYSCONFIG, kPASSWORD, kCRYPTO } from '../../contant';
|
|
135
|
+
import pkg from '../../../package.json';
|
|
136
|
+
import { getServiceApi } from '../../api';
|
|
137
|
+
|
|
138
|
+
import { useNav } from '../../layout/hooks/useNav';
|
|
139
|
+
|
|
140
|
+
defineOptions({ name: 'UdpWelcome' });
|
|
141
|
+
|
|
142
|
+
const systemHook = useSystemStoreHook();
|
|
143
|
+
|
|
144
|
+
const logList = ref([]);
|
|
145
|
+
const dataList = ref([]);
|
|
146
|
+
|
|
147
|
+
const showModal = ref(false);
|
|
148
|
+
const data = ref<IRecord>({});
|
|
149
|
+
|
|
150
|
+
const systemLayout = ref({ UserProfile: false, ToDo: false, FavorityMenu: false, Calendar: false, LoginInfo: false });
|
|
151
|
+
|
|
152
|
+
const firstName = computed(() => {
|
|
153
|
+
return systemHook.getUserInfo.name?.slice(0, 1);
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
const { passwordItems, logout } = useNav();
|
|
157
|
+
|
|
158
|
+
const has2upversion = ref(pkg.version.substring(0, 1) === '2');
|
|
159
|
+
|
|
160
|
+
let intervalId = null;
|
|
161
|
+
// 角色
|
|
162
|
+
const getRole = () => {
|
|
163
|
+
const isAdmin = systemHook.isAdminRole;
|
|
164
|
+
if (isAdmin) {
|
|
165
|
+
return '系统管理员';
|
|
166
|
+
} else {
|
|
167
|
+
return systemHook.getUserInfo?.sysRoles?.map(m => m.roleName).join(',');
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
// 组织
|
|
172
|
+
const getOrg = () => {
|
|
173
|
+
const isAdmin = systemHook.isAdminRole;
|
|
174
|
+
if (isAdmin) {
|
|
175
|
+
return '【系统管理员】拥有所有组织';
|
|
176
|
+
} else {
|
|
177
|
+
return systemHook.getOrglist?.map(m => m.orgName).join(',');
|
|
178
|
+
}
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
// 获取时间段
|
|
182
|
+
const getCurrentPeriod = () => {
|
|
183
|
+
const hour = Number(dayjs().format('HH'));
|
|
184
|
+
return hour < 12 ? '上午好' : hour < 18 ? '下午好' : '晚上好';
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
const getLunarDay = () => {
|
|
188
|
+
const time = new Date();
|
|
189
|
+
const lunarday = lunarCalendar.solar2lunar(time.getFullYear(), time.getMonth() + 1, time.getDate()) as IRecord;
|
|
190
|
+
const { gzYear, IMonthCn, IDayCn, cMonth, cDay, ncWeek } = lunarday;
|
|
191
|
+
return `${cMonth}月${cDay}日 ${gzYear}${IMonthCn}${IDayCn} ${ncWeek}`;
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
const getUserLog = () => {
|
|
195
|
+
const url = '/upfm/v1/userMonitor';
|
|
196
|
+
const query = { pageSize: 8, pageNum: 1, employeeName: systemHook.getUserInfo?.name };
|
|
197
|
+
getServiceApi()
|
|
198
|
+
.get(url, query)
|
|
199
|
+
.then((res: IResponseData) => {
|
|
200
|
+
logList.value = res?.list || [];
|
|
201
|
+
});
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
const getLayoutList = async () => {
|
|
205
|
+
const api = getServiceApi();
|
|
206
|
+
const [err, res]: any = await to(
|
|
207
|
+
api.get('/upfm/sysHomeConfig', { pageSize: 1000, pageNum: 1, enabled: '1', isRoleFilter: 'Y' })
|
|
208
|
+
);
|
|
209
|
+
if (err) return;
|
|
210
|
+
systemLayout;
|
|
211
|
+
res?.list.forEach(m => {
|
|
212
|
+
if (m.type === 'custom') {
|
|
213
|
+
console.log(m);
|
|
214
|
+
dataList.value.push(m);
|
|
215
|
+
} else {
|
|
216
|
+
systemLayout.value[m.code] = !!m.code;
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
};
|
|
220
|
+
|
|
221
|
+
const getInitPassword = async () => {
|
|
222
|
+
const passWord = CryptoJS.AES.decrypt(cookies.get(kPASSWORD), kCRYPTO).toString(CryptoJS.enc.Utf8);
|
|
223
|
+
const dict = getDictChildren('SU.DEFAULT_PASSWORD')?.find(f => f.dictCode === 'default');
|
|
224
|
+
if (dict && dict.dictName === passWord) {
|
|
225
|
+
// 密码和默认密码一致,提示修改密码
|
|
226
|
+
data.value = {
|
|
227
|
+
id: systemHook.getUserInfo.id,
|
|
228
|
+
oldUserPwd: passWord
|
|
229
|
+
};
|
|
230
|
+
showModal.value = true;
|
|
231
|
+
window.clearInterval(intervalId);
|
|
232
|
+
} else if (dict && dict.dictName !== passWord) {
|
|
233
|
+
// 密码已重置
|
|
234
|
+
window.clearInterval(intervalId);
|
|
235
|
+
}
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
onBeforeMount(() => {
|
|
239
|
+
const sysConfig = storageLocal.getItem(kSYSCONFIG);
|
|
240
|
+
if (sysConfig.initialPasswordModification === 'Y') {
|
|
241
|
+
const passWord = CryptoJS.AES.decrypt(cookies.get(kPASSWORD), kCRYPTO).toString(CryptoJS.enc.Utf8);
|
|
242
|
+
const dict = getDictChildren('SU.DEFAULT_PASSWORD')?.find(f => f.dictCode === 'default');
|
|
243
|
+
if (!dict || dict?.dictName === passWord) {
|
|
244
|
+
intervalId = setInterval(() => {
|
|
245
|
+
getInitPassword();
|
|
246
|
+
}, 1000);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
onMounted(() => {
|
|
252
|
+
getUserLog();
|
|
253
|
+
if (pkg.version.substring(0, 1) === '2') {
|
|
254
|
+
getLayoutList();
|
|
255
|
+
} else {
|
|
256
|
+
systemLayout.value = { UserProfile: false, ToDo: false, FavorityMenu: false, Calendar: false, LoginInfo: true };
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// 假期设置
|
|
261
|
+
const holidays = [
|
|
262
|
+
{
|
|
263
|
+
2023: { 12: { 30: '班', 31: '班' } }
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
2024: {
|
|
267
|
+
1: { 1: '假' },
|
|
268
|
+
2: {
|
|
269
|
+
4: '班',
|
|
270
|
+
10: '假',
|
|
271
|
+
11: '假',
|
|
272
|
+
12: '假',
|
|
273
|
+
13: '假',
|
|
274
|
+
14: '假',
|
|
275
|
+
15: '假',
|
|
276
|
+
16: '假',
|
|
277
|
+
17: '假',
|
|
278
|
+
18: '班'
|
|
279
|
+
},
|
|
280
|
+
4: { 4: '假', 5: '假', 6: '假', 7: '班', 28: '班' },
|
|
281
|
+
5: { 1: '假', 2: '假', 3: '假', 4: '假', 5: '假', 11: '班' },
|
|
282
|
+
6: { 8: '假', 9: '假', 10: '假' },
|
|
283
|
+
9: { 15: '假', 16: '假', 17: '假', 14: '班', 29: '班' },
|
|
284
|
+
10: { 1: '假', 2: '假', 3: '假', 4: '假', 5: '假', 6: '假', 7: '假', 12: '班' }
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
];
|
|
288
|
+
// 法定假日;
|
|
289
|
+
const statutoryHoliday = [
|
|
290
|
+
{ name: '元旦', date: '2024-01-01' },
|
|
291
|
+
{ name: '春节', date: '2024-02-10' },
|
|
292
|
+
{ name: '清明节', date: '2024-04-04' },
|
|
293
|
+
{ name: '劳动节', date: '2024-05-01' },
|
|
294
|
+
{ name: '端午节', date: '2024-06-10' },
|
|
295
|
+
{ name: '中秋节', date: '2024-09-17' },
|
|
296
|
+
{ name: '国庆节', date: '2024-10-01' }
|
|
297
|
+
];
|
|
298
|
+
</script>
|
|
299
|
+
|
|
300
|
+
<style lang="scss" scoped>
|
|
301
|
+
.ut-home {
|
|
302
|
+
.el-avatar--large {
|
|
303
|
+
--el-avatar-size: 72px;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
::v-deep(.el-card__body) {
|
|
307
|
+
padding: 0 !important;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
</style>
|