mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-11-13 14:13:47 +08:00
修复几个显示问题
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
-->
|
||||
<template>
|
||||
<a-drawer
|
||||
:title="formData.helpDocId ? '编辑' : '新建'"
|
||||
:title="formData.helpDocId ? '编辑系统手册' : '新建系统手册'"
|
||||
:visible="visibleFlag"
|
||||
:width="1000"
|
||||
:footerStyle="{ textAlign: 'right' }"
|
||||
@@ -29,7 +29,13 @@
|
||||
<a-form-item label="排序" name="sort">
|
||||
<a-input-number v-model:value="formData.sort" placeholder="值越小越靠前" />(值越小越靠前)
|
||||
</a-form-item>
|
||||
<a-form-item label="关联菜单">
|
||||
<a-form-item label="是否首页显示">
|
||||
<a-radio-group v-model:value="relateHomeFlag" button-style="solid">
|
||||
<a-radio-button :value="true">首页显示</a-radio-button>
|
||||
<a-radio-button :value="false">首页不用显示</a-radio-button>
|
||||
</a-radio-group>
|
||||
</a-form-item>
|
||||
<a-form-item label="关联菜单" v-if="!relateHomeFlag">
|
||||
<MenuTreeSelect v-model:value="formData.relationIdList" ref="menuTreeSelect" />
|
||||
</a-form-item>
|
||||
<a-form-item label="公告内容" name="contentHtml">
|
||||
@@ -69,7 +75,7 @@
|
||||
import HelpDocCatalogTreeSelect from './help-doc-catalog-tree-select.vue';
|
||||
import MenuTreeSelect from '/@/components/system/menu-tree-select/index.vue';
|
||||
import _ from 'lodash';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
const emits = defineEmits(['reloadList']);
|
||||
|
||||
@@ -99,6 +105,7 @@ import { smartSentry } from '/@/lib/smart-sentry';
|
||||
const formRef = ref();
|
||||
const contentRef = ref();
|
||||
const noticeFormVisibleModal = ref();
|
||||
const relateHomeFlag = ref(false);
|
||||
|
||||
const defaultFormData = {
|
||||
helpDocId: undefined,
|
||||
@@ -135,6 +142,11 @@ import { smartSentry } from '/@/lib/smart-sentry';
|
||||
}
|
||||
Object.assign(formData, result.data);
|
||||
formData.relationIdList = result.data.relationList ? result.data.relationList.map((e) => e.relationId) : [];
|
||||
if (formData.relationIdList.length === 1 && formData.relationIdList[0].relationId === 0) {
|
||||
relateHomeFlag.value = true;
|
||||
} else {
|
||||
relateHomeFlag.value = false;
|
||||
}
|
||||
} catch (err) {
|
||||
smartSentry.captureError(err);
|
||||
} finally {
|
||||
@@ -161,8 +173,18 @@ import { smartSentry } from '/@/lib/smart-sentry';
|
||||
try {
|
||||
SmartLoading.show();
|
||||
let param = _.cloneDeep(formData);
|
||||
let relationList = menuTreeSelect.value.getMenuListByIdList(formData.relationIdList);
|
||||
param.relationList = relationList.map((e) => Object.assign({}, { relationId: e.menuId, relationName: e.menuName }));
|
||||
// 首页显示的话,为0
|
||||
if (relateHomeFlag.value) {
|
||||
param.relationList = [
|
||||
{
|
||||
relationName: '首页',
|
||||
relationId: 0,
|
||||
},
|
||||
];
|
||||
} else {
|
||||
let relationList = menuTreeSelect.value.getMenuListByIdList(formData.relationIdList);
|
||||
param.relationList = relationList.map((e) => Object.assign({}, { relationId: e.menuId, relationName: e.menuName }));
|
||||
}
|
||||
|
||||
if (param.helpDocId) {
|
||||
await helpDocApi.update(param);
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
<div>
|
||||
关键字:
|
||||
<a-input style="width: 250px" v-model:value="queryForm.keywords" placeholder="姓名/手机号/登录账号" />
|
||||
|
||||
<a-button class="button-style" v-if="selectRoleId" type="primary" @click="queryRoleEmployee">搜索</a-button>
|
||||
<a-button class="button-style" v-if="selectRoleId" type="default" @click="resetQueryRoleEmployee">重置</a-button>
|
||||
</div>
|
||||
@@ -28,6 +27,7 @@
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a-table
|
||||
:loading="tableLoading"
|
||||
:dataSource="tableData"
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<a-col flex="200px">
|
||||
<RoleList ref="roleList" />
|
||||
</a-col>
|
||||
<a-col flex="1">
|
||||
<a-col flex="1" class="role-setting">
|
||||
<RoleSetting />
|
||||
</a-col>
|
||||
</a-row>
|
||||
@@ -42,4 +42,7 @@
|
||||
.height100 {
|
||||
height: 100%;
|
||||
}
|
||||
.role-setting{
|
||||
width:calc(100% - 250px)
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
height="60"
|
||||
frameborder="0"
|
||||
allowtransparency="true"
|
||||
src="//i.tianqi.com/index.php?c=code&id=12&icon=1&num=5&site=12"
|
||||
src="//i.tianqi.com/index.php?c=code&id=12&icon=1&num=3&site=12"
|
||||
></iframe>
|
||||
</div>
|
||||
</a-row>
|
||||
@@ -136,7 +136,7 @@
|
||||
margin-bottom: 10px;
|
||||
|
||||
.heart-sentence {
|
||||
width: calc(100% - 660px);
|
||||
width: calc(100% - 420px);
|
||||
h3 {
|
||||
color: rgba(0, 0, 0, 0.75);
|
||||
}
|
||||
@@ -146,7 +146,7 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.weather {
|
||||
width: 650px;
|
||||
width: 400px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,11 +70,12 @@
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
width:50%;
|
||||
width: 50%;
|
||||
> img {
|
||||
width: 112px;
|
||||
height: 112px;
|
||||
}
|
||||
|
||||
.qr-desc {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -89,6 +90,37 @@
|
||||
margin-right: 9px;
|
||||
}
|
||||
}
|
||||
|
||||
.qr-desc-marquee {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 11px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
text-align: center;
|
||||
color: #ffffff;
|
||||
|
||||
@keyframes marquee {
|
||||
0% {
|
||||
transform: translateX(0);
|
||||
}
|
||||
100% {
|
||||
transform: translateX(-220%);
|
||||
}
|
||||
}
|
||||
|
||||
.marquee {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
span {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
animation: marquee 15s linear infinite;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.login-title {
|
||||
|
||||
@@ -15,9 +15,8 @@
|
||||
<p>欢迎登录 SmartAdmin V2</p>
|
||||
<p class="desc">
|
||||
SmartAdmin 是由 河南·洛阳
|
||||
<a target="_blank" href="https://www.1024lab.net" style="color: white; weight: bolder; font-size: 15px; text-decoration: underline"
|
||||
>1024创新实验室(1024Lab)</a
|
||||
>
|
||||
<a target="_blank" href="https://www.1024lab.net"
|
||||
style="color: white; weight: bolder; font-size: 15px; text-decoration: underline">1024创新实验室(1024Lab)</a>
|
||||
使用SpringBoot2.x 和 Vue3.2 Setup语法糖、 Composition Api (同时支持JavaScript和TypeScript双版本) ,开发出的一套简洁、易用的中后台解决方案!
|
||||
<br />
|
||||
<br />
|
||||
@@ -29,8 +28,9 @@
|
||||
保持谦逊,保持学习,热爱代码,更热爱生活 !<br />
|
||||
永远年轻,永远前行 !<br />
|
||||
<span class="author">
|
||||
<a target="_blank" href="https://zhuoda.vip" style="color: white; font-size: 13px; text-decoration: underline">
|
||||
1024创新实验室-主任:卓大 ( 2022年 · 洛阳 )
|
||||
<a target="_blank" href="https://zhuoda.vip"
|
||||
style="color: white; font-size: 13px; text-decoration: underline">
|
||||
1024创新实验室-主任:卓大
|
||||
</a>
|
||||
</span>
|
||||
</span>
|
||||
@@ -43,7 +43,7 @@
|
||||
</div>
|
||||
<div class="app-qr">
|
||||
<img :src="xiaozhen" />
|
||||
<marquee class="qr-desc" scrolldelay="130"> 关注:小镇程序员,了解二三线城市程序员的代码与“钱途”,技术与生活,城市可能无法选择,但未来可以拼搏。</marquee>
|
||||
<div class="qr-desc-marquee"><div class="marquee"><span>关注:小镇程序员,了解二三线城市程序员的代码与“钱途”,技术与生活,城市可能无法选择,但未来可以拼搏。</span></div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -55,12 +55,8 @@
|
||||
<a-input v-model:value.trim="loginForm.loginName" placeholder="请输入用户名" />
|
||||
</a-form-item>
|
||||
<a-form-item name="password">
|
||||
<a-input-password
|
||||
v-model:value="loginForm.password"
|
||||
autocomplete="on"
|
||||
:type="showPassword ? 'text' : 'password'"
|
||||
placeholder="请输入密码"
|
||||
/>
|
||||
<a-input-password v-model:value="loginForm.password" autocomplete="on"
|
||||
:type="showPassword ? 'text' : 'password'" placeholder="请输入密码" />
|
||||
</a-form-item>
|
||||
<a-form-item name="captchaCode">
|
||||
<a-input class="captcha-input" v-model:value.trim="loginForm.captchaCode" placeholder="请输入验证码" />
|
||||
@@ -88,119 +84,117 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import { message } from 'ant-design-vue';
|
||||
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { loginApi } from '/@/api/system/login/login-api';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { LOGIN_DEVICE_ENUM } from '/@/constants/system/login-device-const';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import { saveTokenToCookie } from '/@/utils/cookie-util';
|
||||
import { message } from 'ant-design-vue';
|
||||
import { onMounted, onUnmounted, reactive, ref } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { loginApi } from '/@/api/system/login/login-api';
|
||||
import { SmartLoading } from '/@/components/framework/smart-loading';
|
||||
import { LOGIN_DEVICE_ENUM } from '/@/constants/system/login-device-const';
|
||||
import { useUserStore } from '/@/store/modules/system/user';
|
||||
import { saveTokenToCookie } from '/@/utils/cookie-util';
|
||||
|
||||
import gongzhonghao from '/@/assets/images/1024lab/1024lab-gzh.jpg';
|
||||
import zhuoda from '/@/assets/images/1024lab/zhuoda-wechat.jpg';
|
||||
import loginQR from '/@/assets/images/login/login-qr.png';
|
||||
import xiaozhen from '/@/assets/images/1024lab/xiaozhen-gzh.jpg';
|
||||
import gongzhonghao from '/@/assets/images/1024lab/1024lab-gzh.jpg';
|
||||
import zhuoda from '/@/assets/images/1024lab/zhuoda-wechat.jpg';
|
||||
import loginQR from '/@/assets/images/login/login-qr.png';
|
||||
import xiaozhen from '/@/assets/images/1024lab/xiaozhen-gzh.jpg';
|
||||
|
||||
import aliLogin from '/@/assets/images/login/ali-icon.png';
|
||||
import googleLogin from '/@/assets/images/login/google-icon.png';
|
||||
import qqLogin from '/@/assets/images/login/qq-icon.png';
|
||||
import weiboLogin from '/@/assets/images/login/weibo-icon.png';
|
||||
import aliLogin from '/@/assets/images/login/ali-icon.png';
|
||||
import googleLogin from '/@/assets/images/login/google-icon.png';
|
||||
import qqLogin from '/@/assets/images/login/qq-icon.png';
|
||||
import weiboLogin from '/@/assets/images/login/weibo-icon.png';
|
||||
|
||||
import { buildRoutes } from '/@/router/index';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
import { buildRoutes } from '/@/router/index';
|
||||
import { smartSentry } from '/@/lib/smart-sentry';
|
||||
|
||||
//--------------------- 登录表单 ---------------------------------
|
||||
//--------------------- 登录表单 ---------------------------------
|
||||
|
||||
const loginForm = reactive({
|
||||
loginName: 'admin',
|
||||
password: '',
|
||||
captchaCode: '',
|
||||
captchaUuid: '',
|
||||
loginDevice: LOGIN_DEVICE_ENUM.PC.value,
|
||||
});
|
||||
const rules = {
|
||||
loginName: [{ required: true, message: '用户名不能为空' }],
|
||||
password: [{ required: true, message: '密码不能为空' }],
|
||||
captchaCode: [{ required: true, message: '验证码不能为空' }],
|
||||
const loginForm = reactive({
|
||||
loginName: 'admin',
|
||||
password: '',
|
||||
captchaCode: '',
|
||||
captchaUuid: '',
|
||||
loginDevice: LOGIN_DEVICE_ENUM.PC.value,
|
||||
});
|
||||
const rules = {
|
||||
loginName: [{ required: true, message: '用户名不能为空' }],
|
||||
password: [{ required: true, message: '密码不能为空' }],
|
||||
captchaCode: [{ required: true, message: '验证码不能为空' }],
|
||||
};
|
||||
|
||||
const showPassword = ref(false);
|
||||
const router = useRouter();
|
||||
const formRef = ref();
|
||||
const rememberPwd = ref(false);
|
||||
|
||||
onMounted(() => {
|
||||
document.onkeyup = (e) => {
|
||||
if (e.keyCode == 13) {
|
||||
onLogin();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
const showPassword = ref(false);
|
||||
const router = useRouter();
|
||||
const formRef = ref();
|
||||
const rememberPwd = ref(false);
|
||||
onUnmounted(() => {
|
||||
document.onkeyup = null;
|
||||
});
|
||||
|
||||
onMounted(() => {
|
||||
document.onkeyup = (e) => {
|
||||
if (e.keyCode == 13) {
|
||||
onLogin();
|
||||
}
|
||||
};
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
document.onkeyup = null;
|
||||
});
|
||||
|
||||
//登录
|
||||
async function onLogin() {
|
||||
formRef.value.validate().then(async () => {
|
||||
try {
|
||||
SmartLoading.show();
|
||||
const res = await loginApi.login(loginForm);
|
||||
stopRefrestCaptchaInterval();
|
||||
saveTokenToCookie(res.data.token ? res.data.token : '');
|
||||
message.success('登录成功');
|
||||
//更新用户信息到pinia
|
||||
useUserStore().setUserLoginInfo(res.data);
|
||||
//构建系统的路由
|
||||
buildRoutes();
|
||||
router.push('/home');
|
||||
} catch (e) {
|
||||
if (e.data && e.data.code === 30001) {
|
||||
loginForm.captchaCode = '';
|
||||
getCaptcha();
|
||||
}
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//--------------------- 验证码 ---------------------------------
|
||||
|
||||
const captchaBase64Image = ref('');
|
||||
async function getCaptcha() {
|
||||
//登录
|
||||
async function onLogin() {
|
||||
formRef.value.validate().then(async () => {
|
||||
try {
|
||||
let captchaResult = await loginApi.getCaptcha();
|
||||
captchaBase64Image.value = captchaResult.data.captchaBase64Image;
|
||||
loginForm.captchaUuid = captchaResult.data.captchaUuid;
|
||||
beginRefrestCaptchaInterval(captchaResult.data.expireSeconds);
|
||||
SmartLoading.show();
|
||||
const res = await loginApi.login(loginForm);
|
||||
stopRefrestCaptchaInterval();
|
||||
saveTokenToCookie(res.data.token ? res.data.token : '');
|
||||
message.success('登录成功');
|
||||
//更新用户信息到pinia
|
||||
useUserStore().setUserLoginInfo(res.data);
|
||||
//构建系统的路由
|
||||
buildRoutes();
|
||||
router.push('/home');
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
if (e.data && e.data.code === 30001) {
|
||||
loginForm.captchaCode = '';
|
||||
getCaptcha();
|
||||
}
|
||||
smartSentry.captureError(e);
|
||||
} finally {
|
||||
SmartLoading.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
let refrestCaptchaInterval = null;
|
||||
function beginRefrestCaptchaInterval(expireSeconds) {
|
||||
if (refrestCaptchaInterval === null) {
|
||||
refrestCaptchaInterval = setInterval(getCaptcha, (expireSeconds - 5) * 1000);
|
||||
}
|
||||
}
|
||||
//--------------------- 验证码 ---------------------------------
|
||||
|
||||
function stopRefrestCaptchaInterval() {
|
||||
if (refrestCaptchaInterval != null) {
|
||||
clearInterval(refrestCaptchaInterval);
|
||||
refrestCaptchaInterval = null;
|
||||
}
|
||||
const captchaBase64Image = ref('');
|
||||
async function getCaptcha() {
|
||||
try {
|
||||
let captchaResult = await loginApi.getCaptcha();
|
||||
captchaBase64Image.value = captchaResult.data.captchaBase64Image;
|
||||
loginForm.captchaUuid = captchaResult.data.captchaUuid;
|
||||
beginRefrestCaptchaInterval(captchaResult.data.expireSeconds);
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(getCaptcha);
|
||||
let refrestCaptchaInterval = null;
|
||||
function beginRefrestCaptchaInterval(expireSeconds) {
|
||||
if (refrestCaptchaInterval === null) {
|
||||
refrestCaptchaInterval = setInterval(getCaptcha, (expireSeconds - 5) * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
function stopRefrestCaptchaInterval() {
|
||||
if (refrestCaptchaInterval != null) {
|
||||
clearInterval(refrestCaptchaInterval);
|
||||
refrestCaptchaInterval = null;
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(getCaptcha);
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
@import './login.less';
|
||||
</style>
|
||||
<style lang="less" scoped>@import './login.less';</style>
|
||||
|
||||
Reference in New Issue
Block a user