'设置banner图'

gst4base
JayChou 3 weeks ago
parent b0d9ffd4e4
commit 20452ecc0f
  1. 4
      jeecgboot-vue3-master/src/api/sys/setting.ts
  2. 246
      jeecgboot-vue3-master/src/views/setPath/index.vue
  3. 203
      jeecgboot-vue3-master/src/views/system/loginmini/MiniLogin.vue

@ -0,0 +1,4 @@
import { defHttp } from '/@/utils/http/axios';
export const getConfig = () => {
return defHttp.post({ url: '/sysconfiguration/sysConfiguration/findconfig' });
};

@ -1,90 +1,94 @@
<template>
<a-form ref="formRef" name="custom-validation" :model="formState" v-bind="layout" @finish="handleFinish"
@validate="handleValidate" @finishFailed="handleFinishFailed">
<a-form-item label="名称" name="name">
<a-input v-model:value="formState.name" />
</a-form-item>
<a-form-item label="新闻首页" name="newsPage">
<a-input v-model:value="formState.newsPage" />
</a-form-item>
<a-form-item label="备案号" name="recordNumber">
<a-textarea v-model:value="formState.recordNumber" placeholder="Basic usage" :rows="4" />
</a-form-item>
<a-form-item label="版权信息" name="copyright">
<a-textarea v-model:value="formState.copyright" placeholder="Basic usage" :rows="4" />
</a-form-item>
<a-form-item has-feedback label="LOGO" name="logo">
<j-image-upload v-model:value="formState.logo" />
</a-form-item>
<a-form-item class="h-item" has-feedback label="作品上传路径" name="composition">
<a-input v-model:value="formState.composition" type="text" autocomplete="off" />
<a-button :icon="h(FolderOpenOutlined)"
@click="openModal(true, { path: 'sadsad', target: 'composition' })">浏览</a-button>
</a-form-item>
<a-form-item class="h-item" has-feedback label="比赛证书上传路径" name="certificate">
<a-input v-model:value="formState.certificate" type="text" autocomplete="off" />
<a-button :icon="h(FolderOpenOutlined)"
@click="openModal(true, { path: 'sadsad', target: 'certificate' })">浏览</a-button>
</a-form-item>
<a-form-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" html-type="submit" @click="submit">保存</a-button>
</a-form-item>
</a-form>
<div class="px-10">
<Modal @register="register" @confirmPath="hanConPat" />
</div>
<a-form
ref="formRef"
name="custom-validation"
:model="formState"
v-bind="layout"
@finish="handleFinish"
@validate="handleValidate"
@finishFailed="handleFinishFailed"
>
<a-form-item label="名称" name="name">
<a-input v-model:value="formState.name" />
</a-form-item>
<a-form-item label="新闻首页" name="newsPage">
<a-input v-model:value="formState.newsPage" />
</a-form-item>
<a-form-item label="备案号" name="recordNumber">
<a-textarea v-model:value="formState.recordNumber" placeholder="Basic usage" :rows="4" />
</a-form-item>
<a-form-item label="版权信息" name="copyright">
<a-textarea v-model:value="formState.copyright" placeholder="Basic usage" :rows="4" />
</a-form-item>
<a-form-item has-feedback label="LOGO" name="logo">
<j-image-upload v-model:value="formState.logo" />
</a-form-item>
<a-form-item has-feedback label="banner" name="banner">
<j-image-upload v-model:value="formState.banner" />
</a-form-item>
<a-form-item class="h-item" has-feedback label="作品上传路径" name="composition">
<a-input v-model:value="formState.composition" type="text" autocomplete="off" />
<a-button :icon="h(FolderOpenOutlined)" @click="openModal(true, { path: 'sadsad', target: 'composition' })">浏览</a-button>
</a-form-item>
<a-form-item class="h-item" has-feedback label="比赛证书上传路径" name="certificate">
<a-input v-model:value="formState.certificate" type="text" autocomplete="off" />
<a-button :icon="h(FolderOpenOutlined)" @click="openModal(true, { path: 'sadsad', target: 'certificate' })">浏览</a-button>
</a-form-item>
<a-form-item :wrapper-col="{ span: 14, offset: 4 }">
<a-button type="primary" html-type="submit" @click="submit">保存</a-button>
</a-form-item>
</a-form>
<div class="px-10">
<Modal @register="register" @confirmPath="hanConPat" />
</div>
</template>
<script lang="ts" setup>
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
import { useModal } from '/@/components/Modal';
import Modal from './Modal.vue';
import { PlusOutlined } from '@ant-design/icons-vue';
import type { UploadProps } from 'ant-design-vue';
import { FolderOpenOutlined } from '@ant-design/icons-vue';
import { reactive, ref, h } from 'vue';
import type { Rule } from 'ant-design-vue/es/form';
import type { FormInstance } from 'ant-design-vue';
import { getDataListApi, updPathApi } from '/@/api/sys/user';
getDataListApi().then(res => {
import JImageUpload from '/@/components/Form/src/jeecg/components/JImageUpload.vue';
import { useModal } from '/@/components/Modal';
import Modal from './Modal.vue';
import { PlusOutlined } from '@ant-design/icons-vue';
import type { UploadProps } from 'ant-design-vue';
import { FolderOpenOutlined } from '@ant-design/icons-vue';
import { reactive, ref, h } from 'vue';
import type { Rule } from 'ant-design-vue/es/form';
import type { FormInstance } from 'ant-design-vue';
import { getDataListApi, updPathApi } from '/@/api/sys/user';
getDataListApi().then((res) => {
Object.assign(formState, res.records[0]);
})
});
const fileList = ref<UploadProps['fileList']>([]);
const fileList = ref<UploadProps['fileList']>([]);
const handleCancel = () => {
const handleCancel = () => {
previewVisible.value = false;
previewTitle.value = '';
};
const handlePreview = async (file: UploadProps['fileList'][number]) => {
};
const handlePreview = async (file: UploadProps['fileList'][number]) => {
if (!file.url && !file.preview) {
file.preview = (await getBase64(file.originFileObj)) as string;
file.preview = (await getBase64(file.originFileObj)) as string;
}
previewImage.value = file.url || file.preview;
previewVisible.value = true;
previewTitle.value = file.name || file.url.substring(file.url.lastIndexOf('/') + 1);
};
};
// LOGO upload
function getBase64(file: File) {
// LOGO upload
function getBase64(file: File) {
return new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = (error) => reject(error);
});
}
const previewVisible = ref(false);
const previewImage = ref('');
const previewTitle = ref('');
}
const previewVisible = ref(false);
const previewImage = ref('');
const previewTitle = ref('');
interface FormState {
interface FormState {
name: string;
logo: any;
newsPage: string;
@ -92,9 +96,10 @@ interface FormState {
copyright: string;
certificate: string;
composition: string;
}
const formRef = ref<FormInstance>();
const formState = reactive<FormState>({
banner: string;
}
const formRef = ref<FormInstance>();
const formState = reactive<FormState>({
name: '',
logo: previewImage.value,
newsPage: '',
@ -102,80 +107,81 @@ const formState = reactive<FormState>({
copyright: '',
certificate: '',
composition: '',
});
const checkAge = async (_rule: Rule, value: number) => {
banner: '',
});
const checkAge = async (_rule: Rule, value: number) => {
if (!value) {
return Promise.reject('Please input the age');
return Promise.reject('Please input the age');
}
if (!Number.isInteger(value)) {
return Promise.reject('Please input digits');
return Promise.reject('Please input digits');
} else {
if (value < 18) {
return Promise.reject('Age must be greater than 18');
} else {
return Promise.resolve();
}
if (value < 18) {
return Promise.reject('Age must be greater than 18');
} else {
return Promise.resolve();
}
}
};
};
function submit() {
updPathApi(formState).then(res => {
console.log(res, 'res');
})
}
const validatePass = async (_rule: Rule, value: string) => {
function submit() {
console.log(formState);
// return
updPathApi(formState).then((res) => {
console.log(res, 'res');
});
}
const validatePass = async (_rule: Rule, value: string) => {
if (value === '') {
return Promise.reject('Please input the password');
return Promise.reject('Please input the password');
} else {
if (formState.checkPass !== '') {
formRef.value.validateFields('checkPass');
}
return Promise.resolve();
if (formState.checkPass !== '') {
formRef.value.validateFields('checkPass');
}
return Promise.resolve();
}
};
const validatePass2 = async (_rule: Rule, value: string) => {
};
const validatePass2 = async (_rule: Rule, value: string) => {
if (value === '') {
return Promise.reject('Please input the password again');
return Promise.reject('Please input the password again');
} else if (value !== formState.pass) {
return Promise.reject("Two inputs don't match!");
return Promise.reject("Two inputs don't match!");
} else {
return Promise.resolve();
return Promise.resolve();
}
};
};
const layout = {
const layout = {
labelCol: { span: 4 },
wrapperCol: { span: 14 },
};
const handleFinish = (values: FormState) => {
};
const handleFinish = (values: FormState) => {
console.log(values, formState);
};
const handleFinishFailed = errors => {
};
const handleFinishFailed = (errors) => {
console.log(errors);
};
const resetForm = () => {
};
const resetForm = () => {
formRef.value.resetFields();
};
const handleValidate = (...args) => {
};
const handleValidate = (...args) => {
console.log(args);
};
};
//
const [register, { openModal }] = useModal();
function hanConPat(currentlySelecte, target) {
//
const [register, { openModal }] = useModal();
function hanConPat(currentlySelecte, target) {
formState[target] = currentlySelecte;
}
}
</script>
<style scoped lang="less">
.h-item {
.h-item {
.ant-input {
width: 90%;
width: 90%;
}
.ant-btn {
width: 10%;
width: 10%;
}
}
</style>
}
</style>

@ -1,9 +1,6 @@
<template>
<div :class="prefixCls" class="login-background-img">
<AppLocalePicker class="absolute top-4 right-4 enter-x xl:text-gray-600" :showText="false"/>
<AppLocalePicker class="absolute top-4 right-4 enter-x xl:text-gray-600" :showText="false" />
<AppDarkModeToggle class="absolute top-3 right-7 enter-x" />
<div class="aui-logo" v-if="!getIsMobile">
<div>
@ -19,30 +16,26 @@
<div class="aui-content">
<div class="aui-container">
<div class="aui-form">
<div class="aui-formBox">
<div class="aui-formWell">
<div class="login-title">{{ t('sys.login.signInFormTitle') }}</div>
<div class="aui-form-box">
<a-form ref="loginRef" :model="formData" v-if="activeIndex === 'accountLogin'" @keyup.enter.native="loginHandleClick">
<div class="aui-account">
<div class="aui-inputClear">
<a-form-item>
<div>账号</div>
<a-input class="fix-auto-fill" :placeholder="t('sys.login.userName')" v-model:value="formData.username" />
</a-form-item>
</div>
<div class="aui-inputClear">
<a-form-item>
<div>密码</div>
<a-input class="fix-auto-fill" type="password" :placeholder="t('sys.login.password')" v-model:value="formData.password" />
</a-form-item>
</div>
<div class="aui-inputClear">
<a-form-item>
<div>验证码</div>
<a-input class="fix-auto-fill" type="text" :placeholder="t('sys.login.inputCode')" v-model:value="formData.inputCode" />
@ -85,9 +78,10 @@
<div class="aui-formButton">
<div class="aui-flex">
<a-button :loading="loginLoading" class="aui-link-login aui-flex-box" type="primary" @click="loginHandleClick">
{{ t('sys.login.loginButton') }}</a-button>
{{ t('sys.login.loginButton') }}</a-button
>
</div>
<!-- <div class="aui-flex">
<!-- <div class="aui-flex">
<a class="aui-linek-code aui-flex-box" @click="codeHandleClick">{{ t('sys.login.qrSignInFormTitle') }}</a>
</div>-->
<!-- <div class="aui-flex">
@ -117,19 +111,19 @@
<a title="钉钉" @click="onThirdLogin('dingtalk')"><DingtalkCircleFilled /></a>
</div>
</div>-->
<div class="aui-flex-box" style="display: flex; align-items: center;justify-content: center;">
<div class="aui-third-login" style="margin: 0;margin-right: 40px;">
<div class="aui-flex-box" style="display: flex; align-items: center; justify-content: center">
<div class="aui-third-login" style="margin: 0; margin-right: 40px">
<!-- <a title="微信" @click="onThirdLogin('wechat_open')"><WechatFilled /></a> -->
<SvgIcon name="phone" :size="28"/>
<SvgIcon name="phone" :size="28" />
</div>
<div class="aui-third-login" style="margin: 0;margin-left: 40px;">
<div class="aui-third-login" style="margin: 0; margin-left: 40px">
<SvgIcon name="weiChart" :size="28" />
<!-- <a title="微信" @click="onThirdLogin('wechat_open')"><WechatFilled /></a> -->
</div>
</div>
</div>
<div style="display: flex;justify-content: center;margin-top: 20px;">
还没账号?&nbsp;&nbsp;<span style="color: #02DDDD;cursor: pointer;" @click="registerHandleClick">点击注册</span>
<div style="display: flex; justify-content: center; margin-top: 20px">
还没账号?&nbsp;&nbsp;<span style="color: #02dddd; cursor: pointer" @click="registerHandleClick">点击注册</span>
</div>
</a-form>
</div>
@ -164,15 +158,22 @@
import MiniRegister from './MiniRegister.vue';
import MiniCodelogin from './MiniCodelogin.vue';
// import logoImg from '/@/assets/loginmini/icon/jeecg_logo.png';
import logoImg from '/public/resource/img/comp/comp_logo.png';
// import logoImg from '/public/resource/img/comp/comp_logo.png';
import SvgIcon from '/@/components/Icon/src/SvgIcon.vue';
// import adTextImg from '/@/assets/loginmini/icon/jeecg_ad_text.png';
import { AppLocalePicker, AppDarkModeToggle } from '/@/components/Application';
import { useLocaleStore } from '/@/store/modules/locale';
import { useDesign } from "/@/hooks/web/useDesign";
import { useAppInject } from "/@/hooks/web/useAppInject";
import { useDesign } from '/@/hooks/web/useDesign';
import { useAppInject } from '/@/hooks/web/useAppInject';
import { GithubFilled, WechatFilled, DingtalkCircleFilled, createFromIconfontCN } from '@ant-design/icons-vue';
import { getConfig } from '/@/api/sys/setting';
const logoImg = ref('');
const getConfigEvent = async () => {
const res = await getConfig();
console.log(res, 'res');
logoImg.value = `${import.meta.env.VITE_GLOB_DOMAIN_URL}/${res.logo}`;
};
getConfigEvent();
const IconFont = createFromIconfontCN({
scriptUrl: '//at.alicdn.com/t/font_2316098_umqusozousr.js',
});
@ -393,7 +394,7 @@
*/
function handleSuccess(value) {
Object.assign(formData, value);
Object.assign(phoneFormData, { mobile: "", smscode: "" });
Object.assign(phoneFormData, { mobile: '', smscode: '' });
type.value = 'login';
activeIndex.value = 'accountLogin';
handleChangeCheckCode();
@ -437,7 +438,6 @@
right: 0px;
z-index: 9;
.card {
width: 100px;
height: 100px;
@ -463,13 +463,12 @@
font-family: Microsoft YaHei, Microsoft YaHei;
font-weight: 400;
font-size: 13px;
color: #FFFFFF;
color: #ffffff;
line-height: 17px;
text-align: center;
font-style: normal;
text-transform: none;
}
}
.bas {
@ -479,12 +478,11 @@
}
.bot {
background: #A7B2C6;
background: #a7b2c6;
border-bottom-left-radius: 20px;
}
}
:deep(.ant-input:focus) {
box-shadow: none;
}
@ -510,112 +508,115 @@
color: #aaa !important;
}
:deep(.jeecg-dark-switch){
position:absolute;
:deep(.jeecg-dark-switch) {
position: absolute;
margin-right: 10px;
}
.aui-link-login{
.aui-link-login {
height: 42px;
padding: 10px 15px;
font-size: 14px;
border-radius: 8px;
margin-top: 15px;
margin-bottom: 8px;
background: linear-gradient(90deg, rgba(102,249,205,1) 0%, rgba(2,221,221,1) 100%);
background: linear-gradient(90deg, rgba(102, 249, 205, 1) 0%, rgba(2, 221, 221, 1) 100%);
border: none;
}
.aui-phone-logo{
.aui-phone-logo {
position: absolute;
margin-left: 10px;
width: 60px;
top:2px;
top: 2px;
z-index: 4;
}
.top-3{
.top-3 {
top: 0.45rem;
}
</style>
<style lang="less">
@prefix-cls: ~'@{namespace}-mini-login';
@dark-bg: #293146;
@prefix-cls: ~'@{namespace}-mini-login';
@dark-bg: #293146;
html[data-theme='dark'] {
.@{prefix-cls} {
background-color: @dark-bg !important;
background-image: none;
html[data-theme='dark'] {
.@{prefix-cls} {
background-color: @dark-bg !important;
background-image: none;
&::before {
background-image: url(/@/assets/svg/login-bg-dark.svg);
}
.aui-inputClear{
background-color: #232a3b !important;
}
.ant-input,
.ant-input-password {
background-color: #232a3b !important;
}
&::before {
background-image: url(/@/assets/svg/login-bg-dark.svg);
}
.aui-inputClear {
background-color: #232a3b !important;
}
.ant-input,
.ant-input-password {
background-color: #232a3b !important;
}
.ant-btn:not(.ant-btn-link):not(.ant-btn-primary) {
border: 1px solid #4a5569 !important;
}
.ant-btn:not(.ant-btn-link):not(.ant-btn-primary) {
border: 1px solid #4a5569 !important;
}
&-form {
background: @dark-bg !important;
}
&-form {
background: @dark-bg !important;
}
.app-iconify {
color: #fff !important;
}
.aui-inputClear input,.aui-input-line input,.aui-choice{
color: #c9d1d9 !important;
}
.app-iconify {
color: #fff !important;
}
.aui-inputClear input,
.aui-input-line input,
.aui-choice {
color: #c9d1d9 !important;
}
.aui-formBox{
background-color: @dark-bg !important;
}
.aui-third-text span{
background-color: @dark-bg !important;
}
.aui-form-nav .aui-flex-box{
color: #c9d1d9 !important;
}
.aui-formBox {
background-color: @dark-bg !important;
}
.aui-third-text span {
background-color: @dark-bg !important;
}
.aui-form-nav .aui-flex-box {
color: #c9d1d9 !important;
}
.aui-formButton .aui-linek-code{
background: @dark-bg !important;
color: white !important;
}
.aui-code-line{
border-left: none !important;
}
.ant-checkbox-inner,.aui-success h3{
border-color: #c9d1d9;
.aui-formButton .aui-linek-code {
background: @dark-bg !important;
color: white !important;
}
.aui-code-line {
border-left: none !important;
}
.ant-checkbox-inner,
.aui-success h3 {
border-color: #c9d1d9;
}
}
}
input.fix-auto-fill,
.fix-auto-fill input {
-webkit-text-fill-color: #c9d1d9 !important;
box-shadow: inherit !important;
}
input.fix-auto-fill,
.fix-auto-fill input {
-webkit-text-fill-color: #c9d1d9 !important;
box-shadow: inherit !important;
}
&-sign-in-way {
.anticon {
font-size: 22px !important;
color: #888 !important;
cursor: pointer !important;
&-sign-in-way {
.anticon {
font-size: 22px !important;
color: #888 !important;
cursor: pointer !important;
&:hover {
color: @primary-color !important;
&:hover {
color: @primary-color !important;
}
}
}
.ant-divider-inner-text {
font-size: 12px !important;
color: @text-color-secondary !important;
}
.aui-third-login a {
background: transparent;
}
}
.ant-divider-inner-text {
font-size: 12px !important;
color: @text-color-secondary !important;
}
.aui-third-login a{
background: transparent;
}
}
</style>

Loading…
Cancel
Save