新增前端vue
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.jeesite.modules.biz.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable;
|
||||
import com.jeesite.common.mybatis.annotation.JoinTable.Type;
|
||||
@@ -12,6 +13,8 @@ import com.jeesite.common.entity.DataEntity;
|
||||
import com.jeesite.common.mybatis.annotation.Column;
|
||||
import com.jeesite.common.mybatis.annotation.Table;
|
||||
import com.jeesite.common.mybatis.mapper.query.QueryType;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
@@ -20,6 +23,7 @@ import java.io.Serial;
|
||||
* @author gaoxq
|
||||
* @version 2025-11-26
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Table(name="biz_quick_login", alias="a", label="系统信息信息", columns={
|
||||
@Column(name="create_time", attrName="createTime", label="创建时间", isUpdate=false, isUpdateForce=true),
|
||||
@Column(name="id", attrName="id", label="自增主键", isPK=true),
|
||||
@@ -38,7 +42,8 @@ import java.io.Serial;
|
||||
@Column(name="f_flow_state", attrName="fflowState", label="流程任务状态", isUpdate=false, isQuery=false, isUpdateForce=true),
|
||||
}, orderBy="a.id DESC"
|
||||
)
|
||||
public class BizQuickLogin extends DataEntity<BizQuickLogin> {
|
||||
@Data
|
||||
public class BizQuickLogin extends DataEntity<BizQuickLogin> implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
@@ -65,137 +70,6 @@ public class BizQuickLogin extends DataEntity<BizQuickLogin> {
|
||||
super(id);
|
||||
}
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
@NotBlank(message="系统名称不能为空")
|
||||
@Size(min=0, max=100, message="系统名称长度不能超过 100 个字符")
|
||||
public String getSystemName() {
|
||||
return systemName;
|
||||
}
|
||||
|
||||
public void setSystemName(String systemName) {
|
||||
this.systemName = systemName;
|
||||
}
|
||||
|
||||
@NotBlank(message="首页地址不能为空")
|
||||
@Size(min=0, max=255, message="首页地址长度不能超过 255 个字符")
|
||||
public String getHomepageUrl() {
|
||||
return homepageUrl;
|
||||
}
|
||||
|
||||
public void setHomepageUrl(String homepageUrl) {
|
||||
this.homepageUrl = homepageUrl;
|
||||
}
|
||||
|
||||
@NotBlank(message="图标类名不能为空")
|
||||
@Size(min=0, max=50, message="图标类名长度不能超过 50 个字符")
|
||||
public String getIconClass() {
|
||||
return iconClass;
|
||||
}
|
||||
|
||||
public void setIconClass(String iconClass) {
|
||||
this.iconClass = iconClass;
|
||||
}
|
||||
|
||||
@NotBlank(message="图标颜色不能为空")
|
||||
@Size(min=0, max=20, message="图标颜色长度不能超过 20 个字符")
|
||||
public String getIconColor() {
|
||||
return iconColor;
|
||||
}
|
||||
|
||||
public void setIconColor(String iconColor) {
|
||||
this.iconColor = iconColor;
|
||||
}
|
||||
|
||||
@NotNull(message="排序序号不能为空")
|
||||
public Long getSortOrder() {
|
||||
return sortOrder;
|
||||
}
|
||||
|
||||
public void setSortOrder(Long sortOrder) {
|
||||
this.sortOrder = sortOrder;
|
||||
}
|
||||
|
||||
@NotBlank(message="图标背景色不能为空")
|
||||
@Size(min=0, max=52, message="图标背景色长度不能超过 52 个字符")
|
||||
public String getBgColor() {
|
||||
return bgColor;
|
||||
}
|
||||
|
||||
public void setBgColor(String bgColor) {
|
||||
this.bgColor = bgColor;
|
||||
}
|
||||
|
||||
@NotBlank(message="悬浮遮罩色不能为空")
|
||||
@Size(min=0, max=52, message="悬浮遮罩色长度不能超过 52 个字符")
|
||||
public String getMaskColor() {
|
||||
return maskColor;
|
||||
}
|
||||
|
||||
public void setMaskColor(String maskColor) {
|
||||
this.maskColor = maskColor;
|
||||
}
|
||||
|
||||
@NotNull(message="是否启用不能为空")
|
||||
public Long getIsEnabled() {
|
||||
return isEnabled;
|
||||
}
|
||||
|
||||
public void setIsEnabled(Long isEnabled) {
|
||||
this.isEnabled = isEnabled;
|
||||
}
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
@Size(min=0, max=50, message="租户id长度不能超过 50 个字符")
|
||||
public String getFtenantId() {
|
||||
return ftenantId;
|
||||
}
|
||||
|
||||
public void setFtenantId(String ftenantId) {
|
||||
this.ftenantId = ftenantId;
|
||||
}
|
||||
|
||||
@Size(min=0, max=50, message="流程id长度不能超过 50 个字符")
|
||||
public String getFflowId() {
|
||||
return fflowId;
|
||||
}
|
||||
|
||||
public void setFflowId(String fflowId) {
|
||||
this.fflowId = fflowId;
|
||||
}
|
||||
|
||||
@Size(min=0, max=50, message="流程任务主键长度不能超过 50 个字符")
|
||||
public String getFflowTaskId() {
|
||||
return fflowTaskId;
|
||||
}
|
||||
|
||||
public void setFflowTaskId(String fflowTaskId) {
|
||||
this.fflowTaskId = fflowTaskId;
|
||||
}
|
||||
|
||||
public Integer getFflowState() {
|
||||
return fflowState;
|
||||
}
|
||||
|
||||
public void setFflowState(Integer fflowState) {
|
||||
this.fflowState = fflowState;
|
||||
}
|
||||
|
||||
public Date getCreateTime_gte() {
|
||||
return sqlMap.getWhere().getValue("create_time", QueryType.GTE);
|
||||
}
|
||||
|
||||
@@ -18,8 +18,11 @@ import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.biz.entity.BizQuickLogin;
|
||||
import com.jeesite.modules.biz.service.BizQuickLoginService;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 系统信息Controller
|
||||
*
|
||||
* @author gaoxq
|
||||
* @version 2025-11-26
|
||||
*/
|
||||
@@ -27,72 +30,81 @@ import com.jeesite.modules.biz.service.BizQuickLoginService;
|
||||
@RequestMapping(value = "${adminPath}/biz/quickLogin")
|
||||
public class BizQuickLoginController extends BaseController {
|
||||
|
||||
private final BizQuickLoginService bizQuickLoginService;
|
||||
private final BizQuickLoginService bizQuickLoginService;
|
||||
|
||||
public BizQuickLoginController(BizQuickLoginService bizQuickLoginService) {
|
||||
this.bizQuickLoginService = bizQuickLoginService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@ModelAttribute
|
||||
public BizQuickLogin get(String id, boolean isNewRecord) {
|
||||
return bizQuickLoginService.get(id, isNewRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("biz:quickLogin:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(BizQuickLogin bizQuickLogin, Model model) {
|
||||
model.addAttribute("bizQuickLogin", bizQuickLogin);
|
||||
return "modules/biz/bizQuickLoginList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*/
|
||||
@RequiresPermissions("biz:quickLogin:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@ResponseBody
|
||||
public Page<BizQuickLogin> listData(BizQuickLogin bizQuickLogin, HttpServletRequest request, HttpServletResponse response) {
|
||||
bizQuickLogin.setPage(new Page<>(request, response));
|
||||
Page<BizQuickLogin> page = bizQuickLoginService.findPage(bizQuickLogin);
|
||||
return page;
|
||||
}
|
||||
public BizQuickLoginController(BizQuickLoginService bizQuickLoginService) {
|
||||
this.bizQuickLoginService = bizQuickLoginService;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
@RequiresPermissions("biz:quickLogin:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(BizQuickLogin bizQuickLogin, Model model) {
|
||||
model.addAttribute("bizQuickLogin", bizQuickLogin);
|
||||
return "modules/biz/bizQuickLoginForm";
|
||||
}
|
||||
/**
|
||||
* 获取数据
|
||||
*/
|
||||
@ModelAttribute
|
||||
public BizQuickLogin get(String id, boolean isNewRecord) {
|
||||
return bizQuickLoginService.get(id, isNewRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
*/
|
||||
@RequiresPermissions("biz:quickLogin:view")
|
||||
@RequestMapping(value = {"list", ""})
|
||||
public String list(BizQuickLogin bizQuickLogin, Model model) {
|
||||
model.addAttribute("bizQuickLogin", bizQuickLogin);
|
||||
return "modules/biz/bizQuickLoginList";
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询列表数据
|
||||
*/
|
||||
@RequiresPermissions("biz:quickLogin:view")
|
||||
@RequestMapping(value = "listData")
|
||||
@ResponseBody
|
||||
public Page<BizQuickLogin> listData(BizQuickLogin bizQuickLogin, HttpServletRequest request, HttpServletResponse response) {
|
||||
bizQuickLogin.setPage(new Page<>(request, response));
|
||||
Page<BizQuickLogin> page = bizQuickLoginService.findPage(bizQuickLogin);
|
||||
return page;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查看编辑表单
|
||||
*/
|
||||
@RequiresPermissions("biz:quickLogin:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(BizQuickLogin bizQuickLogin, Model model) {
|
||||
model.addAttribute("bizQuickLogin", bizQuickLogin);
|
||||
return "modules/biz/bizQuickLoginForm";
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
*/
|
||||
@RequiresPermissions("biz:quickLogin:edit")
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated BizQuickLogin bizQuickLogin) {
|
||||
bizQuickLoginService.save(bizQuickLogin);
|
||||
return renderResult(Global.TRUE, text("保存系统信息成功!"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@RequiresPermissions("biz:quickLogin:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public String delete(BizQuickLogin bizQuickLogin) {
|
||||
bizQuickLoginService.delete(bizQuickLogin);
|
||||
return renderResult(Global.TRUE, text("删除系统信息成功!"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取列表
|
||||
*/
|
||||
@RequestMapping(value = "listAll")
|
||||
@ResponseBody
|
||||
public List<BizQuickLogin> listAll(BizQuickLogin bizQuickLogin) {
|
||||
return bizQuickLoginService.findList(bizQuickLogin);
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存数据
|
||||
*/
|
||||
@RequiresPermissions("biz:quickLogin:edit")
|
||||
@PostMapping(value = "save")
|
||||
@ResponseBody
|
||||
public String save(@Validated BizQuickLogin bizQuickLogin) {
|
||||
bizQuickLoginService.save(bizQuickLogin);
|
||||
return renderResult(Global.TRUE, text("保存系统信息成功!"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数据
|
||||
*/
|
||||
@RequiresPermissions("biz:quickLogin:edit")
|
||||
@RequestMapping(value = "delete")
|
||||
@ResponseBody
|
||||
public String delete(BizQuickLogin bizQuickLogin) {
|
||||
bizQuickLoginService.delete(bizQuickLogin);
|
||||
return renderResult(Global.TRUE, text("删除系统信息成功!"));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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 });
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
// 声明应用列表TS类型(已删除fallbackIcon字段)
|
||||
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;
|
||||
@@ -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>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export default {
|
||||
dashboard: '控制面板',
|
||||
workbench: '我的工作',
|
||||
analysis: '仪表盘',
|
||||
analysis: '首页',
|
||||
about: '关于我们',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user