From 3e0c75d258fdcd9bf1c47ead8fc390e96e996843 Mon Sep 17 00:00:00 2001
From: 田源 <lastanimals@163.com>
Date: 星期一, 04 十一月 2024 15:15:45 +0800
Subject: [PATCH] 整合代码
---
Source/plt-web/plt-web-ui/src/page/index/logo.vue | 9 ++++++++-
Source/plt-web/plt-web-ui/src/views/wel/index.vue | 48 ++++++++++++++++++++++++------------------------
2 files changed, 32 insertions(+), 25 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/page/index/logo.vue b/Source/plt-web/plt-web-ui/src/page/index/logo.vue
index cedb042..a89e19e 100644
--- a/Source/plt-web/plt-web-ui/src/page/index/logo.vue
+++ b/Source/plt-web/plt-web-ui/src/page/index/logo.vue
@@ -17,7 +17,7 @@
<span>
<img class="imgSpan" :src=imgurl>
</span>
- <span> {{ website.indexTitle }}</span>
+ <span class="indexTitle"> {{ website.indexTitle }}</span>
</span>
</template>
</transition-group>
@@ -99,4 +99,11 @@
top: 15px;
left: 12px;
}
+.indexTitle{
+ //background-image: linear-gradient(120deg, #54b6d0 16%, #3f8bdb, #3f8bdb);
+ background-image: linear-gradient(-225deg, #5D9FFF 0%, #B8DCFF 48%, #6BBBFF 100%);
+ background-clip: text;
+ color: transparent;
+ font-weight: 700;
+}
</style>
diff --git a/Source/plt-web/plt-web-ui/src/views/wel/index.vue b/Source/plt-web/plt-web-ui/src/views/wel/index.vue
index a650939..b6b7d3d 100644
--- a/Source/plt-web/plt-web-ui/src/views/wel/index.vue
+++ b/Source/plt-web/plt-web-ui/src/views/wel/index.vue
@@ -111,37 +111,37 @@
getLogHandler() {
this.loading = true;
- const logTypes = ["4", "1", "3"]; // 鎿嶄綔鏃ュ織銆佺櫥褰曟棩蹇椼�佹巿鏉冩棩蹇楃殑 logType
- const logNames = ["鎿嶄綔鏃ュ織缁熻", "鐧诲綍鏃ュ織缁熻", "鎺堟潈鏃ュ織缁熻"]; // 瀵瑰簲鐨勬棩蹇楀悕绉�
- const textList = ["褰撳墠鐧诲綍鏃ュ織鎬昏褰曟暟", "褰撳墠鎺堟潈鏃ュ織鎬昏褰曟暟", "褰撳墠鎿嶄綔鏃ュ織鎬昏褰曟暟"];
- const color = ['rgb(27, 201, 142)', 'rgb(230, 71, 88)', 'rgb(178, 159, 255)']
- const router = ['/LogOperateMain?logType=4&roleType=2', '/LogInfoMain?logType=1&roleType=2', '/LogAuthorizeMain?logType=3&roleType=2']
+
+ // 鏃ュ織璇锋眰鍜屽睍绀虹殑鐩稿叧鐨勯厤缃�
+ const logConfig = [
+ { logType: "4", logName: "鎿嶄綔鏃ュ織缁熻", text: "褰撳墠鎿嶄綔鏃ュ織鎬昏褰曟暟", color: 'rgb(27, 201, 142)', router: '/LogOperateMain?logType=4&roleType=2' },
+ { logType: "1", logName: "鐧诲綍鏃ュ織缁熻", text: "褰撳墠鐧诲綍鏃ュ織鎬昏褰曟暟", color: 'rgb(230, 71, 88)', router: '/LogInfoMain?logType=1&roleType=2' },
+ { logType: "3", logName: "鎺堟潈鏃ュ織缁熻", text: "褰撳墠鎺堟潈鏃ュ織鎬昏褰曟暟", color: 'rgb(178, 159, 255)', router: '/LogAuthorizeMain?logType=3&roleType=2' }
+ ];
+
const roleType = "2";
- const requests = logTypes.map(logType => getLogListByContion(1, -1, {logType, roleType}));
+ const requests = logConfig.map(config => getLogListByContion(1, -1, { logType: config.logType, roleType }));
Promise.all(requests).then(responses => {
- // console.log('responses', responses);
- // 璁$畻鎬诲拰
- const allcount = responses.reduce((sum, res) => sum + (res.data.total || 0), 0);
+ // 璁$畻涓変釜鏃ュ織鐨勬�诲拰
+ const totalCount = responses.reduce((sum, res) => sum + (res.data.total || 0), 0);
- this.topOption.data = responses.map((res, index) => {
- return {
- title: logNames[index],
- text: textList[index],
- color: color[index],
- subtitle: '瀹炴椂',
- count: res.data.total,
- allcount: '鏃ュ織鎬绘暟锛�' + allcount,
- key: '鏃ュ織',
- click: () => {
- this.$router.push({path:router[index]});
- },
- };
- });
+ this.topOption.data = responses.map((res, index) => ({
+ title: logConfig[index].logName,
+ text: logConfig[index].text,
+ color: logConfig[index].color,
+ subtitle: '瀹炴椂',
+ count: res.data.total,
+ allcount: `鏃ュ織鎬绘暟锛�${totalCount}`,
+ key: '鏃ュ織',
+ click: () => this.$router.push({ path: logConfig[index].router }),
+ }));
+
this.loading = false;
}).catch(error => {
- console.error("An error occurred:", error);
+ this.$message.error(error);
+ this.loading = false;
});
}
},
--
Gitblit v1.9.3