新闻分页

This commit is contained in:
quantulr
2024-03-05 17:25:48 +08:00
parent 570c3f2112
commit 3afb373403
18 changed files with 2035 additions and 1886 deletions

View File

@ -4,4 +4,9 @@ export const listNews = (params) => request({
url: "/app/news/list",
method: "GET",
params
});
});
export const getNewsInfo = (id) => request({
url: `/app/news/${id}`,
method: "GET",
})

View File

@ -10,16 +10,25 @@
<li class="menu-item1">
<div
class="menu-item-tit"
:class="pagePath == '/' ? 'active' : ''"
:class="pagePath === '/' ? 'active' : ''"
@click="handlePath('/')"
>
{{ t("headerMenu.home") }}
</div>
</li>
<li class="menu-item1">
<div
class="menu-item-tit"
:class="pagePath === '/news' ? 'active' : ''"
@click="handlePath('/news')"
>
{{ t("headerMenu.news") }}
</div>
</li>
<li class="menu-item1 solution">
<div
class="menu-item-tit"
:class="pagePath.indexOf('/solution/') != -1 ? 'active' : ''"
:class="pagePath.indexOf('/solution/') !== -1 ? 'active' : ''"
>
{{ t("headerMenu.resolution") }}
</div>
@ -28,7 +37,7 @@
v-for="item in categoryList"
class="pointer"
:class="
pagePath == `/solution/${item.id}` ? 'x_blue _active' : ''
pagePath === `/solution/${item.id}` ? 'x_blue _active' : ''
"
@click="
handlePath(
@ -79,7 +88,7 @@
<li class="menu-item1">
<div
class="menu-item-tit"
:class="pagePath == '/innovate' ? 'active' : ''"
:class="pagePath === '/innovate' ? 'active' : ''"
@click="handlePath('/innovate')"
>
{{ t("headerMenu.innovation") }}
@ -88,7 +97,7 @@
<li class="menu-item1">
<div
class="menu-item-tit"
:class="pagePath == '/activity' ? 'active' : ''"
:class="pagePath === '/activity' ? 'active' : ''"
@click="handlePath('/activity')"
>
{{ t("headerMenu.activity") }}
@ -97,7 +106,7 @@
<li class="menu-item1">
<div
class="menu-item-tit"
:class="pagePath == '/about' ? 'active' : ''"
:class="pagePath === '/about' ? 'active' : ''"
@click="handlePath('/about')"
>
{{ t("headerMenu.aboutUs") }}
@ -107,7 +116,7 @@
<div
v-if="!userStore.token"
class="menu-item-tit"
:class="pagePath == '/login' ? 'active' : ''"
:class="pagePath === '/login' ? 'active' : ''"
@click="handlePath('/login')"
>
{{ t("headerMenu.loginRegister") }}
@ -137,7 +146,7 @@
<div
v-if="userStore.token"
class="menu-item-tit"
:class="pagePath == '/login' ? 'active' : ''"
:class="pagePath === '/login' ? 'active' : ''"
@click="handlePage"
>
{{ t("headerMenu.personalCenter") }}
@ -145,7 +154,7 @@
<div
v-if="userStore.token"
class="menu-item-tit"
:class="pagePath == '/login' ? 'active' : ''"
:class="pagePath === '/login' ? 'active' : ''"
@click="logout"
>
{{ t("headerMenu.logout") }}
@ -352,7 +361,7 @@ dt {
display: inline-block;
padding: 25px 0;
font-size: 16px;
font-family: Source Han Sans CN;
font-family: Source Han Sans CN, sans-serif;
font-weight: 400;
color: #000;
cursor: pointer;
@ -398,6 +407,7 @@ dt {
.webHead {
.site-title {
padding-top: 8px;
height: 80px;
display: flex;
justify-content: start;
@ -407,10 +417,10 @@ dt {
font-weight: bold;
.site-logo {
width: 30px;
height: 30px;
object-fit: cover;
margin-right: 4px;
width: 90px;
height: 82px;
object-fit: contain;
margin-right: 8px;
}
}

View File

@ -4,9 +4,9 @@ import webContact_zh from "@/i18n/message/webContact/zh";
import webContact_ru from "@/i18n/message/webContact/ru";
import activity_ru from "@/i18n/message/activity/ru";
import activity_zh from "@/i18n/message/activity/zh";
import { admin_ru, admin_zh } from "@/i18n/message/admin";
import { routes_ru, routes_zh } from "@/i18n/message/routes";
import { tagsView_ru, tagsView_zh } from "@/i18n/message/tagsView";
import {admin_ru, admin_zh} from "@/i18n/message/admin";
import {routes_ru, routes_zh} from "@/i18n/message/routes";
import {tagsView_ru, tagsView_zh} from "@/i18n/message/tagsView";
import common_zh from "@/i18n/message/common/zh";
import common_ru from "@/i18n/message/common/ru";
import dict_zh from "@/i18n/message/dict/zh";
@ -17,256 +17,258 @@ import home_zh from "@/i18n/message/home/zh";
import home_ru from "@/i18n/message/home/ru";
const messages = {
zh: {
admin: admin_zh,
routes: routes_zh,
tagsView: tagsView_zh,
common: common_zh,
dict: dict_zh,
tips: tips_zh,
home: home_zh,
headerMenu: {
hello: "你好,世界",
home: "首页",
about: "关于",
resolution: "解决方案",
innovation: "创新服务",
activity: "活动报名",
aboutUs: "关于我们",
loginRegister: "登录注册",
personalCenter: "个人中心",
logout: "退出登录",
switchSystem: "切换系统",
layoutSettings: "布局设置",
changeAvatar: "更换头像",
zh: {
admin: admin_zh,
routes: routes_zh,
tagsView: tagsView_zh,
common: common_zh,
dict: dict_zh,
tips: tips_zh,
home: home_zh,
headerMenu: {
hello: "你好,世界",
home: "首页",
about: "关于",
resolution: "解决方案",
innovation: "创新服务",
activity: "活动报名",
aboutUs: "关于我们",
loginRegister: "登录注册",
personalCenter: "个人中心",
logout: "退出登录",
switchSystem: "切换系统",
layoutSettings: "布局设置",
changeAvatar: "更换头像",
news: "新闻政策"
},
footer: {
copyRight: "中科云 版权所有",
// 皖ICP备18001784号
recordNumber: "皖公网安备 34011102000001号",
},
webSearch: webSearch_zh,
webContact: webContact_zh,
quantityOverview: {
company: "企业数量",
achievement: "成果数量",
lab: "实验室数量",
patent: "专利数量",
expert: "专家数量",
demand: "需求数量",
},
login: {
accountLogin: "账号密码登录",
forgetPassword: "忘记密码",
register: "注册",
login: "登录",
rememberAccount: "记住账号",
loginAgreement: "登录即同意",
agreement: "协议",
phone: "手机号",
verificationCode: "验证码",
getVerificationCode: "获取验证码",
password: "密码",
confirmPassword: "请再次输入密码",
otherLogin: "其他登录方式",
},
register: {
agree: "勾选即同意",
registerAgreement: "注册协议",
register: "注 册",
toLogin: "已有账号,去登录",
registering: "注 册 中...",
passwordInconsistent: "两次输入的密码不一致",
readAndCheck: "请阅读并勾选",
registerSuccess: "注册成功!",
registerSuccessDescription: "恭喜您已注册成功,您的账号",
},
map: {
expertMap: "专家分布地图",
companyMap: "企业分布地图",
patentMap: "专利分布地图",
achievementMap: "成果分布地图",
labMap: "实验室分布地图",
demandMap: "需求分布地图",
technologyMap: "技术分布地图",
area: "地区",
field: "领域",
noData: "暂无",
serviceSite: "全国服务站点",
more: "查看更多",
people: "人数",
},
activity: activity_zh,
innovation: {
intelligenceService: "情报服务",
intelligenceServiceDetails: "情报服务详情",
buyService: "购买服务",
},
solution: {
solution: "解决方案",
serviceCase: "服务案例",
serviceCaseDetails: "服务案例详情",
pageviews: "浏览量",
},
retrieve: {
retrievePassword: "找回密码",
changePasswordSuccess: "修改密码成功",
},
input: {
phone: "手机号",
password: "密码",
verificationCode: "验证码",
age: "年龄",
gender: "性别",
name: "姓名",
input: "请输入",
inputName: "请输入姓名",
inputPhone: "请输入手机号",
inputEmail: "请输入邮箱",
inputPassword: "请输入密码",
inputVerificationCode: "请输入验证码",
inputCompanyName: "请输入企业名称",
inputGender: "请选择性别",
inputAge: "请输入年龄",
inputKeyword: "请输入关键词",
phoneFormatError: "手机号格式不正确",
inputPasswordAgain: "请再次输入您的密码",
passwordInconsistent: "两次输入的密码不一致",
passwordLengthError: "用户密码长度必须介于 5 和 20 之间",
confirmPassword: "确认密码",
inputNewPassword: "请输入新密码",
},
gender: {
male: "男",
female: "女",
},
},
footer: {
copyRight: "中科云 版权所有",
// 皖ICP备18001784号
recordNumber: "皖公网安备 34011102000001号",
ru: {
admin: admin_ru,
routes: routes_ru,
tagsView: tagsView_ru,
common: common_ru,
dict: dict_ru,
tips: tips_ru,
home: home_ru,
headerMenu: {
hello: "Привет мир",
home: "Главная",
about: "О нас",
resolution: "Решение",
innovation: "Инновационные услуги",
activity: "Регистрация на мероприятие",
aboutUs: "О нас",
loginRegister: "Войти в систему",
personalCenter: "Личный кабинет",
logout: "Выйти из системы",
switchSystem: "Переключить систему",
layoutSettings: "Настройки макета",
changeAvatar: "Сменить аватар",
news: "Пресс-политика"
},
footer: {
copyRight: "Чжункейун Авторское право",
// 皖ICP备18001784号
recordNumber: "Государственная сеть безопасности Аньхой 34011102000001",
},
webSearch: webSearch_ru,
webContact: webContact_ru,
quantityOverview: {
company: "Количество компаний",
achievement: "Количество достижений",
lab: "Количество лабораторий",
patent: "Количество патентов",
expert: "Количество экспертов",
demand: "Количество потребностей",
},
login: {
accountLogin: "Вход в систему с помощью имени пользователя и пароля",
forgetPassword: "Забыли пароль",
register: "Регистрация",
login: "Войти в систему",
rememberAccount: "Запомнить аккаунт",
loginAgreement: "Вход в систему означает согласие",
agreement: "Соглашение",
phone: "Номер телефона",
verificationCode: "Код проверки",
getVerificationCode: "Получить код проверки",
password: "Пароль",
confirmPassword: "Пожалуйста, введите пароль еще раз",
otherLogin: "Другие способы входа в систему",
},
register: {
agree: "Выберите, чтобы согласиться",
registerAgreement: "Соглашение о регистрации",
register: "Регистрация",
toLogin: "Войти в систему",
registering: "Регистрация",
passwordInconsistent: "Пароли не совпадают",
readAndCheck: "Пожалуйста, прочтите и отметьте",
registerSuccess: "Регистрация успешна",
registerSuccessDescription: "Поздравляем, вы успешно зарегистрировались",
},
map: {
expertMap: "Карта распределения экспертов",
companyMap: "Карта распределения компаний",
patentMap: "Карта распределения патентов",
achievementMap: "Карта распределения достижений",
labMap: "Карта распределения лабораторий",
demandMap: "Карта распределения потребностей",
technologyMap: "Карта распределения технологий",
area: "Область",
field: "Область",
noData: "Нет данных",
serviceSite: "Сервисный сайт по всей стране",
more: "Подробнее",
// 人数
people: "человек",
},
activity: activity_ru,
innovation: {
intelligenceService: "Умные услуги",
intelligenceServiceDetails: "Детали умных услуг",
buyService: "Купить услугу",
},
solution: {
solution: "Решение",
serviceCase: "Сервисный случай",
serviceCaseDetails: "Детали сервисного случая",
pageviews: "Просмотры",
},
retrieve: {
retrievePassword: "Восстановить пароль",
changePasswordSuccess: "Изменение пароля успешно",
},
input: {
phone: "Номер телефона",
password: "Пароль",
verificationCode: "Код проверки",
age: "Возраст",
gender: "Пол",
name: "Имя",
input: "Пожалуйста, введите",
inputName: "Пожалуйста, введите имя",
inputPhone: "Пожалуйста, введите номер телефона",
inputEmail: "Пожалуйста, введите адрес электронной почты",
inputPassword: "Пожалуйста, введите пароль",
inputVerificationCode: "Пожалуйста, введите код проверки",
inputCompanyName: "Пожалуйста, введите название компании",
inputGender: "Пожалуйста, выберите пол",
inputAge: "Пожалуйста, введите возраст",
inputKeyword: "Пожалуйста, введите ключевое слово",
phoneFormatError: "Неверный формат номера телефона",
inputPasswordAgain: "Пожалуйста, введите пароль еще раз",
passwordInconsistent: "Пароли не совпадают",
passwordLengthError: "Длина пароля должна быть от 5 до 20 символов",
confirmPassword: "Пожалуйста, введите пароль еще раз",
inputNewPassword: "Пожалуйста, введите новый пароль",
},
gender: {
gender: "Пол",
male: "Мужской",
female: "Женский",
},
},
webSearch: webSearch_zh,
webContact: webContact_zh,
quantityOverview: {
company: "企业数量",
achievement: "成果数量",
lab: "实验室数量",
patent: "专利数量",
expert: "专家数量",
demand: "需求数量",
},
login: {
accountLogin: "账号密码登录",
forgetPassword: "忘记密码",
register: "注册",
login: "登录",
rememberAccount: "记住账号",
loginAgreement: "登录即同意",
agreement: "协议",
phone: "手机号",
verificationCode: "验证码",
getVerificationCode: "获取验证码",
password: "密码",
confirmPassword: "请再次输入密码",
otherLogin: "其他登录方式",
},
register: {
agree: "勾选即同意",
registerAgreement: "注册协议",
register: "注 册",
toLogin: "已有账号,去登录",
registering: "注 册 中...",
passwordInconsistent: "两次输入的密码不一致",
readAndCheck: "请阅读并勾选",
registerSuccess: "注册成功!",
registerSuccessDescription: "恭喜您已注册成功,您的账号",
},
map: {
expertMap: "专家分布地图",
companyMap: "企业分布地图",
patentMap: "专利分布地图",
achievementMap: "成果分布地图",
labMap: "实验室分布地图",
demandMap: "需求分布地图",
technologyMap: "技术分布地图",
area: "地区",
field: "领域",
noData: "暂无",
serviceSite: "全国服务站点",
more: "查看更多",
people: "人数",
},
activity: activity_zh,
innovation: {
intelligenceService: "情报服务",
intelligenceServiceDetails: "情报服务详情",
buyService: "购买服务",
},
solution: {
solution: "解决方案",
serviceCase: "服务案例",
serviceCaseDetails: "服务案例详情",
pageviews: "浏览量",
},
retrieve: {
retrievePassword: "找回密码",
changePasswordSuccess: "修改密码成功",
},
input: {
phone: "手机号",
password: "密码",
verificationCode: "验证码",
age: "年龄",
gender: "性别",
name: "姓名",
input: "请输入",
inputName: "请输入姓名",
inputPhone: "请输入手机号",
inputEmail: "请输入邮箱",
inputPassword: "请输入密码",
inputVerificationCode: "请输入验证码",
inputCompanyName: "请输入企业名称",
inputGender: "请选择性别",
inputAge: "请输入年龄",
inputKeyword: "请输入关键词",
phoneFormatError: "手机号格式不正确",
inputPasswordAgain: "请再次输入您的密码",
passwordInconsistent: "两次输入的密码不一致",
passwordLengthError: "用户密码长度必须介于 5 和 20 之间",
confirmPassword: "确认密码",
inputNewPassword: "请输入新密码",
},
gender: {
male: "男",
female: "女",
},
},
ru: {
admin: admin_ru,
routes: routes_ru,
tagsView: tagsView_ru,
common: common_ru,
dict: dict_ru,
tips: tips_ru,
home: home_ru,
headerMenu: {
hello: "Привет мир",
home: "Главная",
about: "О нас",
resolution: "Решение",
innovation: "Инновационные услуги",
activity: "Регистрация на мероприятие",
aboutUs: "О нас",
loginRegister: "Войти в систему",
personalCenter: "Личный кабинет",
logout: "Выйти из системы",
switchSystem: "Переключить систему",
layoutSettings: "Настройки макета",
changeAvatar: "Сменить аватар",
},
footer: {
copyRight: "Чжункейун Авторское право",
// 皖ICP备18001784号
recordNumber: "Государственная сеть безопасности Аньхой 34011102000001",
},
webSearch: webSearch_ru,
webContact: webContact_ru,
quantityOverview: {
company: "Количество компаний",
achievement: "Количество достижений",
lab: "Количество лабораторий",
patent: "Количество патентов",
expert: "Количество экспертов",
demand: "Количество потребностей",
},
login: {
accountLogin: "Вход в систему с помощью имени пользователя и пароля",
forgetPassword: "Забыли пароль",
register: "Регистрация",
login: "Войти в систему",
rememberAccount: "Запомнить аккаунт",
loginAgreement: "Вход в систему означает согласие",
agreement: "Соглашение",
phone: "Номер телефона",
verificationCode: "Код проверки",
getVerificationCode: "Получить код проверки",
password: "Пароль",
confirmPassword: "Пожалуйста, введите пароль еще раз",
otherLogin: "Другие способы входа в систему",
},
register: {
agree: "Выберите, чтобы согласиться",
registerAgreement: "Соглашение о регистрации",
register: "Регистрация",
toLogin: "Войти в систему",
registering: "Регистрация",
passwordInconsistent: "Пароли не совпадают",
readAndCheck: "Пожалуйста, прочтите и отметьте",
registerSuccess: "Регистрация успешна",
registerSuccessDescription: "Поздравляем, вы успешно зарегистрировались",
},
map: {
expertMap: "Карта распределения экспертов",
companyMap: "Карта распределения компаний",
patentMap: "Карта распределения патентов",
achievementMap: "Карта распределения достижений",
labMap: "Карта распределения лабораторий",
demandMap: "Карта распределения потребностей",
technologyMap: "Карта распределения технологий",
area: "Область",
field: "Область",
noData: "Нет данных",
serviceSite: "Сервисный сайт по всей стране",
more: "Подробнее",
// 人数
people: "человек",
},
activity: activity_ru,
innovation: {
intelligenceService: "Умные услуги",
intelligenceServiceDetails: "Детали умных услуг",
buyService: "Купить услугу",
},
solution: {
solution: "Решение",
serviceCase: "Сервисный случай",
serviceCaseDetails: "Детали сервисного случая",
pageviews: "Просмотры",
},
retrieve: {
retrievePassword: "Восстановить пароль",
changePasswordSuccess: "Изменение пароля успешно",
},
input: {
phone: "Номер телефона",
password: "Пароль",
verificationCode: "Код проверки",
age: "Возраст",
gender: "Пол",
name: "Имя",
input: "Пожалуйста, введите",
inputName: "Пожалуйста, введите имя",
inputPhone: "Пожалуйста, введите номер телефона",
inputEmail: "Пожалуйста, введите адрес электронной почты",
inputPassword: "Пожалуйста, введите пароль",
inputVerificationCode: "Пожалуйста, введите код проверки",
inputCompanyName: "Пожалуйста, введите название компании",
inputGender: "Пожалуйста, выберите пол",
inputAge: "Пожалуйста, введите возраст",
inputKeyword: "Пожалуйста, введите ключевое слово",
phoneFormatError: "Неверный формат номера телефона",
inputPasswordAgain: "Пожалуйста, введите пароль еще раз",
passwordInconsistent: "Пароли не совпадают",
passwordLengthError: "Длина пароля должна быть от 5 до 20 символов",
confirmPassword: "Пожалуйста, введите пароль еще раз",
inputNewPassword: "Пожалуйста, введите новый пароль",
},
gender: {
gender: "Пол",
male: "Мужской",
female: "Женский",
},
},
};
export default messages;

View File

@ -23,7 +23,7 @@ const table = {
cooperationMemo: "Совместный протокол",
customerConfirmSolution: "Подтверждение технического решения клиентом",
signServiceContract: "Подписание сервисного контракта (сумма контракта)",
endTopic: "Закрыть тему",
endTopic: "Закрыть тему (Полученная сумма)",
notEndTopic: "Тема не закрыта",
uploadFile: "Загрузить файл",
uploadTime: "Время загрузки",

View File

@ -23,7 +23,7 @@ const table = {
cooperationMemo: "合作备忘录",
customerConfirmSolution: "客户确认技术解决方案",
signServiceContract: "签署服务合同(合同额)",
endTopic: "结题",
endTopic: "结题(到款金额)",
notEndTopic: "未结题",
uploadFile: "上传文件",
uploadTime: "上传时间",

View File

@ -53,7 +53,7 @@
<script setup>
import variables from "@/assets/styles/variables.module.scss";
import logo from "@/assets/logo/logo.png";
import logoSmall from "@/assets/logo/logo_small.png";
import logoSmall from "@/assets/logo/咸海logo.png";
import useSettingsStore from "@/store/modules/settings";
import { useI18n } from "vue-i18n";

View File

@ -1,99 +1,101 @@
import router from "./router";
import { ElMessage } from "element-plus";
import {ElMessage} from "element-plus";
import NProgress from "nprogress";
import "nprogress/nprogress.css";
import { getToken } from "@/utils/auth";
import { isHttp } from "@/utils/validate";
import { isRelogin } from "@/utils/request";
import {getToken} from "@/utils/auth";
import {isHttp} from "@/utils/validate";
import {isRelogin} from "@/utils/request";
import useUserStore from "@/store/modules/user";
import useSettingsStore from "@/store/modules/settings";
import usePermissionStore from "@/store/modules/permission";
NProgress.configure({ showSpinner: false });
NProgress.configure({showSpinner: false});
const whiteList = [
"/login",
"/auth-redirect",
"/bind",
"/register",
"/",
"/solution/small",
"/solution/large",
"/solution/government",
"/solution/scientific",
"/innovate",
"/activity",
"/about",
"/login",
"/auth-redirect",
"/bind",
"/register",
"/news",
"/",
"/solution/small",
"/solution/large",
"/solution/government",
"/solution/scientific",
"/innovate",
"/activity",
"/about",
];
const whiteListReg = [
/\/solution\/detail\/[0-9]+/,
/\/solution\/[0-9]+/,
/\/innovate\/detail\/[0-9]+/,
/\/searchList\/[\S]+/,
/\/searchList\/[\S]+\/detail\/[0-9]+/,
/\/solution\/detail\/[0-9]+/,
/\/news\/detail\/[0-9]+/,
/\/solution\/[0-9]+/,
/\/innovate\/detail\/[0-9]+/,
/\/searchList\/[\S]+/,
/\/searchList\/[\S]+\/detail\/[0-9]+/,
];
router.beforeEach((to, from, next) => {
NProgress.start();
if (getToken()) {
to.meta.title && useSettingsStore().setTitle(to.meta.title);
/* has token*/
if (to.path === "/login") {
next({ path: "/" });
NProgress.done();
NProgress.start();
if (getToken()) {
to.meta.title && useSettingsStore().setTitle(to.meta.title);
/* has token*/
if (to.path === "/login") {
next({path: "/"});
NProgress.done();
} else {
if (useUserStore().roles.length === 0) {
isRelogin.show = true;
// 判断当前用户是否已拉取完user_info信息
useUserStore()
.getInfo()
.then(() => {
isRelogin.show = false;
// next({ ...to, replace: true });
usePermissionStore()
.generateRoutes(useUserStore().roleId)
.then((accessRoutes) => {
// console.log(accessRoutes);
// 根据roles权限生成可访问的路由表
accessRoutes.forEach((route) => {
if (!isHttp(route.path)) {
router.addRoute(route); // 动态添加可访问路由表
}
});
next({...to, replace: true}); // hack方法 确保addRoutes已完成
});
})
.catch((err) => {
console.log(err);
useUserStore()
.logOut()
.then(() => {
ElMessage.error(err);
next({path: "/"});
});
});
} else {
next();
}
}
} else {
if (useUserStore().roles.length === 0) {
isRelogin.show = true;
// 判断当前用户是否已拉取完user_info信息
useUserStore()
.getInfo()
.then(() => {
isRelogin.show = false;
// next({ ...to, replace: true });
usePermissionStore()
.generateRoutes(useUserStore().roleId)
.then((accessRoutes) => {
// console.log(accessRoutes);
// 根据roles权限生成可访问的路由表
accessRoutes.forEach((route) => {
if (!isHttp(route.path)) {
router.addRoute(route); // 动态添加可访问路由表
}
});
next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
});
})
.catch((err) => {
console.log(err);
useUserStore()
.logOut()
.then(() => {
ElMessage.error(err);
next({ path: "/" });
});
});
} else {
next();
}
// 没有token
if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入
next();
} else if (
whiteListReg.findIndex((el) => {
// console.log(el);
return el.test(to.path);
}) !== -1
) {
next();
} else {
next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页
NProgress.done();
}
}
} else {
// 没有token
if (whiteList.indexOf(to.path) !== -1) {
// 在免登录白名单,直接进入
next();
} else if (
whiteListReg.findIndex((el) => {
// console.log(el);
return el.test(to.path);
}) !== -1
) {
next();
} else {
next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页
NProgress.done();
}
}
});
router.afterEach(() => {
NProgress.done();
NProgress.done();
});

File diff suppressed because it is too large Load Diff

View File

@ -1,46 +1,47 @@
import Cookies from "js-cookie";
const useAppStore = defineStore("app", {
state: () => ({
sidebar: {
opened: Cookies.get("sidebarStatus")
? !!+Cookies.get("sidebarStatus")
: true,
withoutAnimation: false,
hide: false,
state: () => ({
sidebar: {
// opened: Cookies.get("sidebarStatus")
// ? !!+Cookies.get("sidebarStatus")
// : true,
opened: true,
withoutAnimation: false,
hide: false,
},
device: "desktop",
size: Cookies.get("size") || "default",
}),
actions: {
toggleSideBar(withoutAnimation) {
if (this.sidebar.hide) {
return false;
}
this.sidebar.opened = !this.sidebar.opened;
this.sidebar.withoutAnimation = withoutAnimation;
if (this.sidebar.opened) {
Cookies.set("sidebarStatus", 1);
} else {
Cookies.set("sidebarStatus", 0);
}
},
closeSideBar(withoutAnimation) {
Cookies.set("sidebarStatus", 0);
this.sidebar.opened = false;
this.sidebar.withoutAnimation = withoutAnimation;
},
toggleDevice(device) {
this.device = device;
},
setSize(size) {
this.size = size;
Cookies.set("size", size);
},
toggleSideBarHide(status) {
this.sidebar.hide = status;
},
},
device: "desktop",
size: Cookies.get("size") || "default",
}),
actions: {
toggleSideBar(withoutAnimation) {
if (this.sidebar.hide) {
return false;
}
this.sidebar.opened = !this.sidebar.opened;
this.sidebar.withoutAnimation = withoutAnimation;
if (this.sidebar.opened) {
Cookies.set("sidebarStatus", 1);
} else {
Cookies.set("sidebarStatus", 0);
}
},
closeSideBar(withoutAnimation) {
Cookies.set("sidebarStatus", 0);
this.sidebar.opened = false;
this.sidebar.withoutAnimation = withoutAnimation;
},
toggleDevice(device) {
this.device = device;
},
setSize(size) {
this.size = size;
Cookies.set("size", size);
},
toggleSideBarHide(status) {
this.sidebar.hide = status;
},
},
});
export default useAppStore;

View File

@ -161,7 +161,7 @@ if (route.query.id) {
<el-col :span="12">
<el-form-item
v-if="index === 2 || index === 3"
:label="t('admin.form.amount')"
:label="`${t('admin.form.amount')}${t('admin.table.tenThousandYuan')}`"
>
<el-input-number
v-model="updateStatusList[index].remark"

View File

@ -1,9 +1,9 @@
<template>
<el-form
ref="formRef"
:label-width="labelWidth + 'px'"
:model="modelValue"
:rules="rules"
ref="formRef"
:label-width="labelWidth + 'px'"
:model="modelValue"
:rules="rules"
>
<div v-if="showTitle" class="form_title">
{{ t("admin.form.basicInfo") }}
@ -46,8 +46,8 @@
<el-row v-if="isAdd">
<el-col :span="24">
<el-form-item
:label="/*身份证号:*/ t('admin.form.idCardNumber')"
prop="idCard"
:label="/*身份证号:*/ t('admin.form.idCardNumber')"
prop="idCard"
>
<el-input v-model="modelValue.idCard"></el-input>
</el-form-item>
@ -57,7 +57,7 @@
<el-row>
<el-col :span="24">
<el-form-item :label="t('admin.form.workLocation')" prop="wordAddress">
<el-input v-model="modelValue.wordAddress" />
<el-input v-model="modelValue.wordAddress"/>
</el-form-item>
</el-col>
</el-row>
@ -66,35 +66,35 @@
<el-col :span="24">
<el-form-item :label="t('admin.form.workExperience')" prop="experience">
<el-input
v-model="modelValue.experience"
:autosize="{ minRows: 2, maxRows: 10 }"
type="textarea"
v-model="modelValue.experience"
:autosize="{ minRows: 2, maxRows: 10 }"
type="textarea"
/>
</el-form-item>
</el-col>
</el-row>
<field-options ref="researchsFormRef" v-model="modelValue" />
<field-options ref="researchsFormRef" v-model="modelValue"/>
<InputBoxAdd
ref="keywordsFormRef"
v-model="modelValue"
:labelWidth="labelWidth"
fieldKey="keywords"
:placeholder="t('admin.form.inputKeywords')"
:title="t('admin.form.keywords')"
ref="keywordsFormRef"
v-model="modelValue"
:labelWidth="labelWidth"
fieldKey="keywords"
:placeholder="t('admin.form.inputKeywords')"
:title="t('admin.form.keywords')"
/>
<el-row v-if="isAdd">
<el-col :span="24">
<el-form-item :label="t('admin.form.idCard')">
<el-form-item :label="t('admin.form.idCard')" prop="idImage">
<el-row :gutter="20">
<el-col :span="8">
<el-form-item prop="idImage.0">
<ImageUpload
v-model="modelValue.idImage[0]"
:isShowTip="false"
:limit="1"
v-model="modelValue.idImage[0]"
:isShowTip="false"
:limit="1"
/>
</el-form-item>
<div style="text-align: center">
@ -105,9 +105,9 @@
<el-col :span="8">
<el-form-item prop="idImage.1">
<ImageUpload
v-model="modelValue.idImage[1]"
:isShowTip="false"
:limit="1"
v-model="modelValue.idImage[1]"
:isShowTip="false"
:limit="1"
/>
</el-form-item>
<div style="text-align: center">
@ -118,9 +118,9 @@
<el-col :span="8">
<el-form-item prop="idImage.2">
<ImageUpload
v-model="modelValue.idImage[2]"
:isShowTip="false"
:limit="1"
v-model="modelValue.idImage[2]"
:isShowTip="false"
:limit="1"
/>
</el-form-item>
<div style="text-align: center">
@ -136,14 +136,14 @@
<el-row v-if="isAdd">
<el-col :span="24">
<el-form-item
:label="t('admin.form.achievementBroker')"
prop="certificatePics"
:label="t('admin.form.achievementBroker')"
prop="certificatePics"
>
<el-row :gutter="20">
<el-col :span="8">
<image-upload
v-model="modelValue.certificatePics"
:isShowTip="false"
v-model="modelValue.certificatePics"
:isShowTip="false"
/>
</el-col>
</el-row>
@ -155,10 +155,10 @@
<script setup>
import InputBoxAdd from "../InputBoxAdd";
import FieldOptions from "../FieldOptions";
import { computed, reactive, ref } from "vue";
import { useI18n } from "vue-i18n";
import {computed, reactive, ref} from "vue";
import {useI18n} from "vue-i18n";
const { t } = useI18n();
const {t} = useI18n();
const formRef = ref();
const researchsFormRef = ref();
const keywordsFormRef = ref();
@ -206,11 +206,11 @@ const rules = reactive({
trigger: "blur",
},
],
mobile: [
phone: [
{
required: true,
message: computed(() =>
t("admin.form.placeholder", { type: t("admin.form.mobile") })
t("admin.form.placeholder", {type: t("admin.form.mobile")})
),
trigger: "blur",
},
@ -220,12 +220,20 @@ const rules = reactive({
// trigger: "blur",
// },
],
email: [
{
required: true,
message: computed(() =>
t("admin.form.placeholder", {type: t("admin.form.email")})
),
trigger: "blur",
},],
idCard: [
// {
// required: true,
// message: computed(() => t("admin.form.placeholder")),
// trigger: "blur",
// },
{
required: true,
message: computed(() => t("admin.form.placeholder")),
trigger: "blur",
},
],
wordAddress: [
{
@ -241,34 +249,41 @@ const rules = reactive({
trigger: "blur",
},
],
idImage: [
{
required: true,
trigger: "change",
message: computed(() => t("admin.validation.pleaseUpload")),
}
],
"idImage.0": [
// {
// required: true,
// message: computed(() => t("admin.validation.pleaseUpload")),
// trigger: ["blur", "change"],
// },
],
"idImage.1": [
// {
// required: true,
// message: computed(() => t("admin.validation.pleaseUpload")),
// trigger: ["blur", "change"],
// },
],
"idImage.2": [
// {
// required: true,
// message: computed(() => t("admin.validation.pleaseUpload")),
// trigger: ["blur", "change"],
// },
],
certificatePics: [
{
required: true,
message: computed(() => t("admin.validation.pleaseUpload")),
trigger: ["blur", "change"],
},
],
"idImage.1": [
{
required: true,
message: computed(() => t("admin.validation.pleaseUpload")),
trigger: ["blur", "change"],
},
],
"idImage.2": [
{
required: true,
message: computed(() => t("admin.validation.pleaseUpload")),
trigger: ["blur", "change"],
},
],
certificatePics: [
// {
// required: true,
// message: computed(() => t("admin.validation.pleaseUpload")),
// trigger: ["blur", "change"],
// },
],
});
const validateForm = async () => {

View File

@ -1,21 +1,21 @@
<template>
<el-form
ref="formRef"
:label-width="labelWidth + 'px'"
:model="modelValue"
:rules="rules"
ref="formRef"
:label-width="labelWidth + 'px'"
:model="modelValue"
:rules="rules"
>
<div v-if="showTitle" class="form_title">
{{ t("admin.form.basicInfo") }}
</div>
<el-row>
<el-col :span="24">
<el-form-item :label="t('admin.form.expertAvatar')">
<ImageUpload v-model="modelValue.image" :limit="1" />
</el-form-item>
</el-col>
</el-row>
<!--FIXME: <el-row>-->
<!-- <el-col :span="24">-->
<!-- <el-form-item :label="t('admin.form.expertAvatar')">-->
<!-- <ImageUpload v-model="modelValue.image" :limit="1" />-->
<!-- </el-form-item>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-row>
<el-col :span="12">
@ -88,15 +88,15 @@
<el-form-item :label="t('admin.form.country')" prop="country">
<el-select
v-model="modelValue.country"
:placeholder="
v-model="modelValue.country"
:placeholder="
t('admin.form.pleaseSelect', { type: t('admin.form.country') })
"
>
<el-option
v-for="option in countryOptions"
:label="option[locale]"
:value="option.key"
v-for="option in countryOptions"
:label="option[locale]"
:value="option.key"
/>
</el-select>
</el-form-item>
@ -129,18 +129,18 @@
<el-row>
<el-col :span="12">
<el-form-item
:label="t('admin.table.highestEducation')"
prop="education"
:label="t('admin.table.highestEducation')"
prop="education"
>
<el-select
v-model="modelValue.education"
:placeholder="t('admin.form.pleaseSelect')"
v-model="modelValue.education"
:placeholder="t('admin.form.pleaseSelect')"
>
<el-option
v-for="item in educationOptions"
:key="item.key"
:label="item[locale]"
:value="item.key"
v-for="item in educationOptions"
:key="item.key"
:label="item[locale]"
:value="item.key"
>
</el-option>
</el-select>
@ -170,10 +170,10 @@
<el-col :span="12">
<el-form-item :label="t('admin.form.workingTime')" prop="workTime">
<el-date-picker
v-model="modelValue.workTime"
:placeholder="t('admin.form.pleaseSelect')"
type="date"
value-format="YYYY-MM-DD"
v-model="modelValue.workTime"
:placeholder="t('admin.form.pleaseSelect')"
type="date"
value-format="YYYY-MM-DD"
>
</el-date-picker>
</el-form-item>
@ -184,52 +184,52 @@
{{ t("gender.male") }}
</el-radio>
<el-radio v-model="modelValue.gender" label="2"
>{{ t("gender.female") }}
>{{ t("gender.female") }}
</el-radio>
</el-form-item>
</el-col>
</el-row>
<FieldOptions
ref="fieldFormRef"
v-model="modelValue"
:labelWidth="labelWidth"
ref="fieldFormRef"
v-model="modelValue"
:labelWidth="labelWidth"
/>
<InputBoxAdd
ref="keywordsFormRef"
v-model="modelValue"
:labelWidth="labelWidth"
:placeholder="t('admin.form.inputKeywords')"
:title="t('admin.form.keywords')"
fieldKey="keywords"
ref="keywordsFormRef"
v-model="modelValue"
:labelWidth="labelWidth"
:placeholder="t('admin.form.inputKeywords')"
:title="t('admin.form.keywords')"
fieldKey="keywords"
/>
<InputBoxAdd
ref="researchsFormRef"
v-model="modelValue"
:labelWidth="labelWidth"
:placeholder="
ref="researchsFormRef"
v-model="modelValue"
:labelWidth="labelWidth"
:placeholder="
t('admin.form.placeholder', {
name: t('admin.form.researchDirection'),
})
"
:title="t('admin.form.researchDirection')"
fieldKey="researchs"
:title="t('admin.form.researchDirection')"
fieldKey="researchs"
/>
<el-row>
<el-col :span="24">
<el-form-item :label="t('admin.form.personalProfile')" prop="introduce">
<el-input
v-model="modelValue.introduce"
:placeholder="
v-model="modelValue.introduce"
:placeholder="
t(
'admin.validation.pleaseEnterResearchDirectionCoreTechnologyAndProductRepresentativePatentsAndPapersUndertakeTheNameAndAbstractOfScientificResearchProjects'
)
"
type="textarea"
:autosize="{ minRows: 6, maxRows: 8 }"
show-word-limit
type="textarea"
:autosize="{ minRows: 6, maxRows: 8 }"
show-word-limit
/>
</el-form-item>
</el-col>
@ -240,11 +240,11 @@
<script name="ExpertForm" setup>
import FieldOptions from "@/views/components/FieldOptions";
import InputBoxAdd from "@/views/components/InputBoxAdd";
import { countryOptions, educationOptions } from "@/utils/parameter";
import { useI18n } from "vue-i18n";
import { computed, toRefs } from "vue";
import {countryOptions, educationOptions} from "@/utils/parameter";
import {useI18n} from "vue-i18n";
import {computed, onActivated, reactive, ref, toRefs} from "vue";
const { t, locale } = useI18n();
const {t, locale} = useI18n();
const props = defineProps({
modelValue: Object,
@ -261,7 +261,7 @@ const props = defineProps({
default: 120,
},
});
const { modelValue, isAdd, showTitle, labelWidth } = toRefs(props);
const {modelValue, isAdd, showTitle, labelWidth} = toRefs(props);
const data = reactive({
rules: {
product: [
@ -373,7 +373,7 @@ const data = reactive({
{
required: true,
message: computed(() =>
t("admin.validation.required", { type: t("admin.form.workingTime") })
t("admin.validation.required", {type: t("admin.form.workingTime")})
),
trigger: ["change", "blur"],
},
@ -395,7 +395,7 @@ const data = reactive({
},
});
const { rules } = toRefs(data);
const {rules} = toRefs(data);
const researchOptions = ref([]);
const options = ref([]);
const formRef = ref();
@ -403,7 +403,8 @@ const cityFormRef = ref();
const fieldFormRef = ref();
const keywordsFormRef = ref();
const researchsFormRef = ref();
const setLaboratory = () => {};
const setLaboratory = () => {
};
const validateForm = async () => {
let formValid;
try {
@ -416,11 +417,11 @@ const validateForm = async () => {
const keywordsFormValid = await keywordsFormRef.value.validateForm(); // 关键词表单验证
const researchsFormValid = await researchsFormRef.value.validateForm(); // 研究方向表单验证
return (
formValid &&
// cityFormValid &&
fieldFormValid &&
keywordsFormValid &&
researchsFormValid
formValid &&
// cityFormValid &&
fieldFormValid &&
keywordsFormValid &&
researchsFormValid
);
// if (isAdd.value) {
// // const directionsFormValid = await directionsFormRef.value.validateForm();

View File

@ -10,15 +10,16 @@
<el-form-item
:label="`${title}:`"
:prop="fieldKey"
:rules="[
>
<!-- :rules="[
{
required: true,
type: 'array',
message: t('admin.validation.pleaseInputAndAdd'),
trigger: 'change',
},
]"
>
]"-->
<el-row type="flex" class="input-add-bar" justify="space-between">
<el-col :span="20">
<el-input v-model="dataVal" :placeholder="placeholder"></el-input>

View File

@ -1,9 +1,11 @@
<script setup>
import { reactive, ref, toRefs } from "vue";
import { listNews } from "@/api/website/home/news";
import {reactive, ref, toRefs} from "vue";
import {listNews} from "@/api/website/home/news";
import Pagination from "@/components/Pagination/index.vue";
import { useI18n } from "vue-i18n";
const { t, locale } = useI18n();
import {useI18n} from "vue-i18n";
import dayjs from "dayjs";
const {t, locale} = useI18n();
const file_base_url = `${import.meta.env.VITE_APP_BASE_API}/file`;
const total = ref(0);
const newsList = ref([]);
@ -12,12 +14,12 @@ const data = reactive({
latestNews: {},
queryParams: {
pageNum: 1,
pageSize: 8,
pageSize: 10,
classification: "0",
},
});
const { queryParams, latestNews } = toRefs(data);
const {queryParams, latestNews} = toRefs(data);
const getList = () => {
listNews(queryParams.value).then((resp) => {
newsList.value = resp.rows;
@ -26,7 +28,7 @@ const getList = () => {
};
const getLatestNews = () => {
listNews({ pageNum: 1, pageSize: 1 }).then((resp) => {
listNews({pageNum: 1, pageSize: 1}).then((resp) => {
if (resp.total) {
latestNews.value = resp.rows[0];
}
@ -44,13 +46,13 @@ getList();
<template>
<div class="news-container" style="height: 100%">
<div class="left">
<img class="cover-image" :src="`${file_base_url}${latestNews?.cover}`" />
<img class="cover-image" :src="`${file_base_url}${latestNews?.cover}`"/>
<p class="title">{{ latestNews?.title }}</p>
</div>
<div class="right">
<el-tabs
@tab-change="handleTabChange"
v-model="queryParams.classification"
@tab-change="handleTabChange"
v-model="queryParams.classification"
>
<el-tab-pane name="0" :label="t('home.news')"></el-tab-pane>
<el-tab-pane name="1" :label="t('home.policyAnalyzing')"></el-tab-pane>
@ -58,14 +60,21 @@ getList();
</el-tabs>
<ul class="news-list">
<li class="news-item" v-for="news in newsList" :key="news.id">
<span class="title">{{
locale === "zh" ? news.title : locale === "ru" ? news.titleRu : null
}}</span>
<span class="time">
{{ news.create_time }}
<a :href="`/news/detail/${news.id}`" target="_blank">
<span class="title">{{
locale === "zh" ? news.title : locale === "ru" ? news.titleRu : null
}}</span>
<span class="time">
{{ dayjs(news.createTime).format("YYYY-MM-DD") }}
</span>
</a>
</li>
</ul>
<pagination v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getList"/>
</div>
<!-- <div class="news-list">
@ -90,20 +99,26 @@ getList();
.news-container {
padding: 20px;
display: flex;
.left {
flex: 4;
height: 100%;
// display: flex;
// flex-direction: column;
// justify-content: center;
width: calc(50vw - 20px);
height: calc(100vh - 200px);
display: flex;
flex-direction: column;
.cover-image {
height: calc(100vh - 200px - 24px - 12px);
//flex: 1;
width: 100%;
aspect-ratio: 4/3;
//aspect-ratio: 4/3;
object-fit: cover;
}
.title {
height: 24px;
text-align: center;
font-size: 20px;
width: 100%;
font-weight: bold;
margin-top: 12px;
margin-bottom: 0;
@ -112,22 +127,33 @@ getList();
white-space: nowrap;
}
}
.right {
flex: 4;
width: calc(50vw - 20px);
margin-left: 12px;
height: 100%;
padding: 12px;
.news-list {
.news-item {
list-style: disc;
height: 40px;
display: flex;
align-items: center;
cursor: pointer;
.title {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
& > a {
height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
.title {
flex: 1;
width: 100px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.time {
color: gray;
font-size: 14px;
}
}
}
}

View File

@ -2,33 +2,33 @@
<div ref="fullPageRef" v-loading="loading" class="fullPage">
<div class="indicator">
<div
v-for="idx in 7"
:id="idx.toString()"
:key="idx"
:class="`${indicatorActiveIndex === idx ? 'active' : ''}`"
class="point"
@click="handleIndicatorClick(idx)"
v-for="idx in 7"
:id="idx.toString()"
:key="idx"
:class="`${indicatorActiveIndex === idx ? 'active' : ''}`"
class="point"
@click="handleIndicatorClick(idx)"
></div>
</div>
<div
ref="fullPageContainerRef"
:data-index="state.fullpage.current"
class="fullPageContainer"
@mousewheel="mouseWheelHandle"
ref="fullPageContainerRef"
:data-index="state.fullpage.current"
class="fullPageContainer"
@mousewheel="mouseWheelHandle"
>
<!-- @DOMMouseScroll="mouseWheelHandle" -->
<div
v-for="(item, $index) in state.boxList"
:key="$index"
:style="`z-index: ${item.zIndex};`"
class="section"
v-for="(item, $index) in state.boxList"
:key="$index"
:style="`z-index: ${item.zIndex};`"
class="section"
>
<!-- v-if="`index${state.fullpage.current}` == item.title" -->
<component
:is="item.comp"
v-if="Math.abs(state.fullpage.current - ($index + 1)) <= 1"
:map-index="mapIndex"
@changeMapIndex="mapIndex = $event"
:is="item.comp"
v-if="Math.abs(state.fullpage.current - ($index + 1)) <= 1"
:map-index="mapIndex"
@changeMapIndex="mapIndex = $event"
></component>
</div>
</div>
@ -52,12 +52,14 @@
</template>
<script setup>
import { computed, onMounted, reactive, ref, shallowRef } from "vue";
import {computed, onActivated, onMounted, reactive, ref, shallowRef} from "vue";
import index0 from "./comp/index0.vue";
import index1 from "./comp/index1.vue";
import index8 from "./comp/index8.vue";
import index9 from "@/views/website/home/comp/index9.vue";
import {useRoute} from "vue-router";
const route = useRoute()
const loading = ref(true);
setTimeout(() => {
loading.value = false;
@ -68,8 +70,8 @@ const mapIndex = ref(0); // 0-3
const mapRef = ref();
onMounted(() => {
fullPageContainerRef.value.addEventListener(
"DOMMouseScroll",
mouseWheelHandle
"DOMMouseScroll",
mouseWheelHandle
);
});
// onUnmounted(() => {
@ -193,14 +195,14 @@ const handleIndicatorClick = (idx) => {
console.log(idx);
let boxIndex;
let _mapIndex;
if (idx === 1) {
boxIndex = 1;
if (idx <= 2) {
boxIndex = idx;
_mapIndex = null;
} else if (idx <= 5) {
boxIndex = 2;
_mapIndex = idx - 2;
} else {
} else if (idx <= 6) {
boxIndex = 3;
_mapIndex = idx - 3;
} else {
boxIndex = 4;
_mapIndex = null;
}
@ -219,6 +221,13 @@ const handleIndicatorClick = (idx) => {
mapIndex.value = _mapIndex;
}
};
onMounted(() => {
// console.log(route.name)
if (route.name === "news-list") {
handleIndicatorClick(2)
}
})
</script>
<style lang="scss" scoped>

View File

@ -1,12 +1,12 @@
<template>
<div class="login">
<div class="content">
<img class="loginImg" src="@/assets/images/login.png" alt="" srcset="" />
<img class="loginImg" src="@/assets/images/login.png" alt="" srcset=""/>
<div class="login-form">
<el-tabs v-model="loginForm.mode" v-if="isLogin == 1">
<el-tab-pane
:label="t('login.accountLogin')"
name="102"
:label="t('login.accountLogin')"
name="102"
></el-tab-pane>
<!-- <el-tab-pane label="手机快捷登录" name="101"></el-tab-pane> -->
</el-tabs>
@ -14,31 +14,31 @@
<el-form ref="loginRef" :model="loginForm" :rules="loginRules">
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
type="text"
auto-complete="off"
:placeholder="t('input.inputPhone')"
v-model="loginForm.username"
type="text"
auto-complete="off"
:placeholder="t('input.inputPhone')"
>
<template #prefix>
<svg-icon
icon-class="user"
class="el-input__icon input-icon"
icon-class="user"
class="el-input__icon input-icon"
/>
</template>
</el-input>
</el-form-item>
<el-form-item prop="password" v-if="loginForm.mode == 102">
<el-input
v-model="loginForm.password"
type="password"
auto-complete="off"
:placeholder="t('input.inputPassword')"
@keyup.enter="handleLogin"
v-model="loginForm.password"
type="password"
auto-complete="off"
:placeholder="t('input.inputPassword')"
@keyup.enter="handleLogin"
>
<template #prefix>
<svg-icon
icon-class="password"
class="el-input__icon input-icon"
icon-class="password"
class="el-input__icon input-icon"
/>
</template>
</el-input>
@ -46,20 +46,20 @@
<el-form-item prop="captcha" v-if="loginForm.mode == 101">
<div class="captcha-row">
<el-input
v-model="loginForm.captcha"
auto-complete="off"
:placeholder="t('input.inputVerificationCode')"
style="width: 65%; align-items: center"
@keyup.enter="handleLogin"
v-model="loginForm.captcha"
auto-complete="off"
:placeholder="t('input.inputVerificationCode')"
style="width: 65%; align-items: center"
@keyup.enter="handleLogin"
>
<template #prefix>
<svg-icon
icon-class="validCode"
class="el-input__icon input-icon"
icon-class="validCode"
class="el-input__icon input-icon"
/>
</template>
</el-input>
<WebGetCode v-model:mobile="loginForm.username" />
<WebGetCode v-model:mobile="loginForm.username"/>
</div>
</el-form-item>
<el-form-item>
@ -69,12 +69,12 @@
</el-form-item>
<el-form-item style="width: 100%">
<el-button
class="x_btns"
:loading="loading"
size="default"
type="primary"
style="width: 100%"
@click.prevent="handleLogin"
class="x_btns"
:loading="loading"
size="default"
type="primary"
style="width: 100%"
@click.prevent="handleLogin"
>
<span v-if="!loading">
{{ t("login.login") }}
@ -86,54 +86,54 @@
<div style="overflow: hidden">
<div style="float: left" v-if="isLogin == 1">
<span
class="text_col pointer"
:to="'/login'"
@click="isLogin = 3"
>{{ t("login.forgetPassword") }}</span
class="text_col pointer"
:to="'/login'"
@click="isLogin = 3"
>{{ t("login.forgetPassword") }}</span
>
</div>
<div style="float: right" v-if="register">
<span
@click="isLogin = 2"
style="color: #0054ff"
class="pointer"
>{{ t("login.register") }}</span
@click="isLogin = 2"
style="color: #0054ff"
class="pointer"
>{{ t("login.register") }}</span
>
</div>
</div>
<el-form
v-if="isLogin == 1"
:model="registerForm"
status-icon
:rules="isCheckRules"
ref="isCheckRef"
v-if="isLogin == 1"
:model="registerForm"
status-icon
:rules="isCheckRules"
ref="isCheckRef"
>
<el-form-item prop="isCheck">
<div style="margin-top: 43px">
<div class="text_col" style="display: none">
<div>其他登录方式</div>
<img
class="pointer"
src="../../../assets/images/weixin.png"
alt=""
class="pointer"
src="../../../assets/images/weixin.png"
alt=""
/>
</div>
<el-checkbox
v-model="registerForm.isCheck"
style="margin-top: 43px"
v-model="registerForm.isCheck"
style="margin-top: 43px"
>
<span class="text_col">{{ t("login.loginAgreement") }}</span
><span style="color: #0054ff"
>{{ t("login.agreement") }}</span
>
>{{ t("login.agreement") }}</span
>
</el-checkbox>
</div>
</el-form-item>
</el-form>
</div>
<Register v-model:isLogin="isLogin" v-else-if="isLogin == 2" />
<Retrieve v-model:isLogin="isLogin" v-else-if="isLogin == 3" />
<Register v-model:isLogin="isLogin" v-else-if="isLogin == 2"/>
<Retrieve v-model:isLogin="isLogin" v-else-if="isLogin == 3"/>
</div>
</div>
@ -149,15 +149,15 @@ import Retrieve from "../retrieve";
import Register from "../register";
import WebGetCode from "@/components/webGetCode";
import useUserStore from "@/store/modules/user";
import { useRouter } from "vue-router";
import { useI18n } from "vue-i18n";
import { computed, reactive, ref } from "vue"; // const store = useStore();
import {useRouter} from "vue-router";
import {useI18n} from "vue-i18n";
import {computed, reactive, ref} from "vue"; // const store = useStore();
// const store = useStore();
const router = useRouter();
const userStore = useUserStore();
// const { proxy } = getCurrentInstance();
const { t } = useI18n();
const {t} = useI18n();
const isLogin = ref(1);
const loginForm = ref({
@ -203,7 +203,7 @@ const isCheck = (rule, value, callback) => {
}
};
const isCheckRules = {
isCheck: [{ required: true, validator: isCheck, trigger: "change" }],
isCheck: [{required: true, validator: isCheck, trigger: "change"}],
};
// const codeUrl = ref("");
@ -218,7 +218,7 @@ const handleLogin = async () => {
if (loginValid && isCheckValid) {
loading.value = true;
if (loginForm.value.rememberMe) {
Cookies.set("username", loginForm.value.username, { expires: 30 });
Cookies.set("username", loginForm.value.username, {expires: 30});
Cookies.set("password", loginForm.value.password, {
expires: 30,
});
@ -238,13 +238,13 @@ const handleLogin = async () => {
console.log("123435");
formData.mode = formData.mode - 0;
userStore
.login(formData)
.then(() => {
router.push({ path: redirect.value || "/identity/index" });
})
.catch(() => {
loading.value = false;
});
.login(formData)
.then(() => {
router.push({path: redirect.value || "/identity/index"});
})
.catch(() => {
loading.value = false;
});
}
});
});
@ -276,7 +276,7 @@ getCookie();
.content {
// padding: 0 250px;
// padding: 0 30px;
width: 1400px;
width: 100%;
margin: 0 auto;
flex: 1;
background: #b1ccff;
@ -285,8 +285,10 @@ getCookie();
justify-content: space-between;
.loginImg {
width: 705px;
height: 458px;
width: calc(100vw - 516px);
//width: 705px;
//height: 458px;
aspect-ratio: 705/458;
}
}

View File

@ -0,0 +1,65 @@
<script setup>
import {getNewsInfo} from "@/api/website/home/news";
import {useRoute} from "vue-router";
import {reactive, toRefs} from "vue";
import {useI18n} from "vue-i18n";
import WebFooter from "@/components/webFooter/index.vue";
const {t, locale} = useI18n();
const file_base_url = `${import.meta.env.VITE_APP_BASE_API}/file`;
const data = reactive({
news: {}
})
const {news} = toRefs(data)
const route = useRoute()
const getNews = () => {
const id = route.params.id
getNewsInfo(id).then((resp) => {
news.value = resp.data
})
}
getNews()
</script>
<template>
<div class="container">
<div class="news-body">
<img class="cover-image" :src="`${file_base_url}${news.cover}`"/>
<h1 class="title">{{locale === "zh" ? news.title : locale === "ru" ? news.titleRu : null }}</h1>
<p class="content">{{ locale === "zh" ? news.content : locale === "ru" ? news.contentRu : null}}</p>
</div>
<web-footer></web-footer>
</div>
</template>
<style scoped lang="scss">
.container {
background-color: #f2f6ff;
.news-body {
background-color: #ffffff;
width: 1000px;
margin: 0 auto;
.cover-image {
width: 100%;
aspect-ratio: 6/2;
object-fit: cover;
}
h1.title {
text-align: center;
font-weight: bold;
font-size: 28px;
}
p.content {
font-size: 16px;
line-height: 24px;
margin: 0;
padding: 24px;
}
}
}
</style>

View File

@ -32,8 +32,8 @@ export default defineConfig(({mode, command}) => {
// https://cn.vitejs.dev/config/#server-proxy
"/dev-api": {
// target: "http://101.34.131.16:1618",
target: "http://129.211.170.150/api",
// target: "http://192.168.0.200:1619",
// target: "http://129.211.170.150/api",
target: "http://192.168.0.200:1619",
// target: 'http://172.18.3.127:1618',
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, ""),