新增前端vue

This commit is contained in:
2025-11-26 19:08:26 +08:00
parent 3ac807e5d9
commit 4e90603dfe
6 changed files with 117 additions and 221 deletions

View File

@@ -26,6 +26,9 @@ export interface BizQuickLogin extends BasicModel<BizQuickLogin> {
fflowState?: number; // 流程任务状态
}
export const bizQuickLoginListAll = (params?: BizQuickLogin | any) =>
defHttp.get<BizQuickLogin[]>({ url: adminPath + '/biz/quickLogin/listAll', params });
export const bizQuickLoginList = (params?: BizQuickLogin | any) =>
defHttp.get<BizQuickLogin>({ url: adminPath + '/biz/quickLogin/list', params });

View File

@@ -11,7 +11,7 @@
v-model:value="searchKey"
placeholder="搜索应用系统..."
class="search-input"
size="middle"
size="large"
>
<template #prefix>
<SearchOutlined class="search-icon" />
@@ -26,22 +26,22 @@
v-for="(app, index) in filteredAppList"
:key="index"
class="app-card"
@click="openAppUrl(app.url)"
@click="openAppUrl(app.homepageUrl)"
>
<!-- 图片图标容器 -->
<div class="app-icon-wrapper" :style="{ backgroundColor: app.bgColor }">
<img
:src="app.icon"
:alt="app.name"
:src="app.iconClass"
:alt="app.systemName"
class="app-icon"
@error="handleImgError($event)"
/>
</div>
<!-- 应用名称 -->
<div class="app-name">{{ app.name }}</div>
<div class="app-name">{{ app.systemName }}</div>
<!-- 悬浮遮罩层 -->
<div class="app-hover-mask" :style="{ background: app.maskColor }">
<span class="hover-text">打开 {{ app.name }}</span>
<span class="hover-text">打开 {{ app.systemName }}</span>
</div>
</div>
@@ -56,20 +56,12 @@
</template>
<script setup lang="ts">
import { ref, computed } from 'vue';
import { ref, computed, onMounted } from 'vue';
import { Input } from 'ant-design-vue';
import { LoginOutlined, SearchOutlined } from '@ant-design/icons-vue';
import { BizQuickLogin, bizQuickLoginListAll } from '@jeesite/biz/api/biz/quickLogin';
// TSfallbackIcon
interface AppItem {
name: string;
icon: string; //
url: string;
bgColor: string; //
maskColor: string; //
}
const appList = ref<AppItem[]>([]);
const appList = ref<BizQuickLogin[]>([]);
//
const searchKey = ref('');
@@ -78,10 +70,25 @@ const searchKey = ref('');
const filteredAppList = computed(() => {
if (!searchKey.value) return appList.value;
return appList.value.filter(app =>
app.name.toLowerCase().includes(searchKey.value.toLowerCase())
app.systemName.toLowerCase().includes(searchKey.value.toLowerCase())
);
});
const fetchAppList = async () => {
try {
//
const result = await bizQuickLoginListAll();
appList.value = result || []; // null
} catch (error) {
console.error('获取应用列表失败:', error);
appList.value = []; //
}
};
onMounted(() => {
fetchAppList();
});
// URL
const openAppUrl = (url: string) => {
if (!url) return;
@@ -95,7 +102,7 @@ const openAppUrl = (url: string) => {
const handleImgError = (e: Event) => {
const img = e.target as HTMLImageElement;
//
img.src = 'http://crontab.club:30012/cApi/images/login-brand.png';
img.src = '';
};
</script>
@@ -157,7 +164,7 @@ const handleImgError = (e: Event) => {
/* 核心:滚动容器 */
.app-scroll-container {
max-height: 400px;
max-height: 45vh;
overflow-y: auto;
padding-right: 4px;
scroll-behavior: smooth;

View File

@@ -1,8 +1,8 @@
<template>
<div class="mb-4">
<Home class="enter-y" />
<div class="mb-4">
<QuickLogin class="enter-y" />
</div>
</template>
<script lang="ts" setup name="Analysis">
import Home from './components/Home.vue';
import QuickLogin from './components/QuickLogin.vue';
</script>

View File

@@ -1,6 +1,6 @@
export default {
dashboard: '控制面板',
workbench: '我的工作',
analysis: '仪表盘',
analysis: '首页',
about: '关于我们',
};