diff --git a/.env.development b/.env.development index 671bd08..6855adf 100644 --- a/.env.development +++ b/.env.development @@ -1,10 +1,10 @@ # 页面标题 -VUE_APP_TITLE = 若依管理系统 +VUE_APP_TITLE = 志愿者管理系统 # 开发环境配置 ENV = 'development' -# 若依管理系统/开发环境 +# 志愿者管理系统/开发环境 # VUE_APP_BASE_API = 'https://vue.ruoyi.vip/prod-api' # VUE_APP_BASE_API = 'http://192.168.0.108:9034' VUE_APP_BASE_API = 'http://39.101.188.84:9034' diff --git a/.env.production b/.env.production index 52cfbc7..2143b78 100644 --- a/.env.production +++ b/.env.production @@ -1,8 +1,8 @@ # 页面标题 -VUE_APP_TITLE = 若依管理系统 +VUE_APP_TITLE = 志愿者管理系统 # 生产环境配置 ENV = 'production' -# 若依管理系统/生产环境 +# 志愿者管理系统/生产环境 VUE_APP_BASE_API = 'http://39.101.188.84:9034' diff --git a/.env.staging b/.env.staging index 361859f..a38ef25 100644 --- a/.env.staging +++ b/.env.staging @@ -1,10 +1,10 @@ # 页面标题 -VUE_APP_TITLE = 若依管理系统 +VUE_APP_TITLE = 志愿者管理系统 NODE_ENV = production # 测试环境配置 ENV = 'staging' -# 若依管理系统/测试环境 +# 志愿者管理系统/测试环境 VUE_APP_BASE_API = '/stage-api' diff --git a/package.json b/package.json index f9ecdd5..7c32c0c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "ruoyi", "version": "3.8.6", - "description": "若依管理系统", + "description": "志愿者管理系统", "author": "若依", "license": "MIT", "scripts": { diff --git a/src/assets/styles/font.css b/src/assets/styles/font.css index 06972ad..0b92bdf 100644 --- a/src/assets/styles/font.css +++ b/src/assets/styles/font.css @@ -19,4 +19,8 @@ @font-face { font-family: "Alibaba PuHuiTi"; src: url("http://www.jichuanglanhai.com/demo/taicang-file/fonts/Alibaba-PuHuiTi-Regular.otf"); +} +@font-face { + font-family: "din-bold-2.ttf"; + src: url("http://www.jichuanglanhai.com/demo/taicang-file/fonts/din-bold-2.ttf"); } \ No newline at end of file diff --git a/src/assets/styles/myTable.scss b/src/assets/styles/myTable.scss index 7a893b6..c1012f8 100644 --- a/src/assets/styles/myTable.scss +++ b/src/assets/styles/myTable.scss @@ -33,10 +33,10 @@ } //详情 .info-box { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; + // display: flex; + // flex-direction: column; + // align-items: center; + // justify-content: center; .info-item { display: flex; // align-items: center; @@ -56,3 +56,82 @@ } } } +//搜索框 +.search { + display: flex; + align-items: center; + justify-content: space-between; +} +//卡片布局 +.book-main { + margin: 0; + padding: 0; + display: flex; + flex-wrap: wrap; + width: 100%; + li { + width: 19%; + height: 48.5%; + margin-right: calc(1% + (2% / 8)); + margin-bottom: 1%; + list-style: none; + background: #fff; + box-shadow: 0px 3px 15px 0px rgba(184, 184, 184, 0.22); + border-radius: 10px; + position: relative; + overflow: hidden; + .integral-num { + position: absolute; + top: 6%; + right: 10%; + font-size: 18px; + font-weight: bold; + color: #2aa984; + z-index: 10; + font-family: "din-bold-2.ttf"; + } + .operate { + height: 13%; + width: 100%; + display: flex; + justify-content: space-between; + align-content: center; + padding: 0 10px; + .integral { + flex: 1; + padding: 4px 0; + font-weight: 400; + font-family: "Alibaba-PuHuiTi-Regular"; + color: #4d4949; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + .exchange-btn { + padding: 4px 10px; + font-size: 14px; + cursor: pointer; + font-family: "Alibaba-PuHuiTi-Regular"; + font-weight: 400; + color: $--color-primary; + background: rgba(249, 86, 95, 0.1); + border-radius: 4px; + } + } + } + li:nth-of-type(5n) { + margin-right: 0; + } + + // li:nth-of-type(n + 2) { + // margin-bottom: 0; + // } +} +::v-deep .pagination-container { + height: 0 !important; + padding: 0 !important; + background: transparent !important; + .el-pagination { + top: 20px; + } +} diff --git a/src/assets/styles/sidebar.scss b/src/assets/styles/sidebar.scss index 85f1ec0..2a5c264 100644 --- a/src/assets/styles/sidebar.scss +++ b/src/assets/styles/sidebar.scss @@ -14,7 +14,8 @@ -webkit-transition: width 0.28s; transition: width 0.28s; width: $base-sidebar-width !important; - background-color: $base-menu-background; + // background-color: $base-menu-background; + background-color: transparent; height: 100%; // position: fixed; font-size: 0px; diff --git a/src/layout/components/MyHead/index.vue b/src/layout/components/MyHead/index.vue index dbc4c13..6714838 100644 --- a/src/layout/components/MyHead/index.vue +++ b/src/layout/components/MyHead/index.vue @@ -34,6 +34,21 @@ export default { computed: { ...mapGetters(["avatar", "name"]), }, + methods: { + async logout() { + this.$confirm("确定注销并退出系统吗?", "提示", { + confirmButtonText: "确定", + cancelButtonText: "取消", + type: "warning", + }) + .then(() => { + this.$store.dispatch("LogOut").then(() => { + location.href = "/index"; + }); + }) + .catch(() => {}); + }, + }, }; diff --git a/src/main.js b/src/main.js index db72ed0..cbd8500 100644 --- a/src/main.js +++ b/src/main.js @@ -1,76 +1,86 @@ -import Vue from 'vue' +import Vue from "vue"; -import Cookies from 'js-cookie' +import Cookies from "js-cookie"; -import Element from 'element-ui' -import './assets/styles/element-variables.scss' +import Element from "element-ui"; +import "./assets/styles/element-variables.scss"; import "@/utils/rem.js"; //计算rem基准 import API from "@/api/index.js"; -import '@/assets/styles/index.scss' // global css -import '@/assets/styles/ruoyi.scss' // ruoyi css -import App from './App' -import store from './store' -import router from './router' -import directive from './directive' // directive -import plugins from './plugins' // plugins -import { download } from '@/utils/request' +import "@/assets/styles/index.scss"; // global css +import "@/assets/styles/ruoyi.scss"; // ruoyi css +import App from "./App"; +import store from "./store"; +import router from "./router"; +import directive from "./directive"; // directive +import plugins from "./plugins"; // plugins +import { download } from "@/utils/request"; import moment from "moment"; import "moment/locale/zh-cn"; moment.locale("zh-cn"); Vue.prototype.$moment = moment; -import './assets/icons' // icon -import './permission' // permission control +import "./assets/icons"; // icon +import "./permission"; // permission control import { getDicts } from "@/api/system/dict/data"; import { getConfigKey } from "@/api/system/config"; -import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"; +import { + parseTime, + resetForm, + addDateRange, + selectDictLabel, + selectDictLabels, + handleTree, +} from "@/utils/ruoyi"; // 分页组件 import Pagination from "@/components/Pagination"; // 自定义表格工具组件 -import RightToolbar from "@/components/RightToolbar" +import RightToolbar from "@/components/RightToolbar"; // 富文本组件 -import Editor from "@/components/Editor" +import Editor from "@/components/Editor"; // 文件上传组件 -import FileUpload from "@/components/FileUpload" +import FileUpload from "@/components/FileUpload"; // 图片上传组件 -import ImageUpload from "@/components/ImageUpload" +import ImageUpload from "@/components/ImageUpload"; // 图片预览组件 -import ImagePreview from "@/components/ImagePreview" +import ImagePreview from "@/components/ImagePreview"; // 字典标签组件 -import DictTag from '@/components/DictTag' +import DictTag from "@/components/DictTag"; // 头部标签组件 -import VueMeta from 'vue-meta' +import VueMeta from "vue-meta"; // 字典数据组件 -import DictData from '@/components/DictData' +import DictData from "@/components/DictData"; +//列表搜索框 +import MyInput from "@/views/components/myInput"; // 全局方法挂载 -Vue.prototype.getDicts = getDicts -Vue.prototype.getConfigKey = getConfigKey -Vue.prototype.parseTime = parseTime -Vue.prototype.resetForm = resetForm -Vue.prototype.addDateRange = addDateRange -Vue.prototype.selectDictLabel = selectDictLabel -Vue.prototype.selectDictLabels = selectDictLabels -Vue.prototype.download = download -Vue.prototype.handleTree = handleTree -Vue.prototype.$api = API +Vue.prototype.getDicts = getDicts; +Vue.prototype.getConfigKey = getConfigKey; +Vue.prototype.parseTime = parseTime; +Vue.prototype.resetForm = resetForm; +Vue.prototype.addDateRange = addDateRange; +Vue.prototype.selectDictLabel = selectDictLabel; +Vue.prototype.selectDictLabels = selectDictLabels; +Vue.prototype.download = download; +Vue.prototype.handleTree = handleTree; +Vue.prototype.$api = API; // 全局组件挂载 -Vue.component('DictTag', DictTag) -Vue.component('Pagination', Pagination) -Vue.component('RightToolbar', RightToolbar) -Vue.component('Editor', Editor) -Vue.component('FileUpload', FileUpload) -Vue.component('ImageUpload', ImageUpload) -Vue.component('ImagePreview', ImagePreview) +Vue.component("DictTag", DictTag); +Vue.component("Pagination", Pagination); +Vue.component("RightToolbar", RightToolbar); +Vue.component("Editor", Editor); +Vue.component("FileUpload", FileUpload); +Vue.component("ImageUpload", ImageUpload); +Vue.component("ImagePreview", ImagePreview); +Vue.component("MyInput", MyInput); -Vue.use(directive) -Vue.use(plugins) -Vue.use(VueMeta) -DictData.install() +Vue.use(directive); +Vue.use(plugins); +Vue.use(VueMeta); +DictData.install(); /** * If you don't want to use mock-server @@ -82,14 +92,14 @@ DictData.install() */ Vue.use(Element, { - size: Cookies.get('size') || 'medium' // set element-ui default size -}) + size: Cookies.get("size") || "medium", // set element-ui default size +}); -Vue.config.productionTip = false +Vue.config.productionTip = false; new Vue({ - el: '#app', + el: "#app", router, store, - render: h => h(App) -}) + render: (h) => h(App), +}); diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index da6153d..2246238 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -1,9 +1,9 @@ -import auth from '@/plugins/auth' -import router, { constantRoutes, dynamicRoutes } from '@/router' -import { getRouters } from '@/api/menu' -import Layout from '@/layout/index' -import ParentView from '@/components/ParentView' -import InnerLink from '@/layout/components/InnerLink' +import auth from "@/plugins/auth"; +import router, { constantRoutes, dynamicRoutes } from "@/router"; +import { getRouters } from "@/api/menu"; +import Layout from "@/layout/index"; +import ParentView from "@/components/ParentView"; +import InnerLink from "@/layout/components/InnerLink"; const permission = { state: { @@ -11,124 +11,124 @@ const permission = { addRoutes: [], defaultRoutes: [], topbarRouters: [], - sidebarRouters: [] + sidebarRouters: [], }, mutations: { SET_ROUTES: (state, routes) => { - state.addRoutes = routes - state.routes = constantRoutes.concat(routes) + state.addRoutes = routes; + state.routes = constantRoutes.concat(routes); }, SET_DEFAULT_ROUTES: (state, routes) => { - state.defaultRoutes = constantRoutes.concat(routes) + state.defaultRoutes = constantRoutes.concat(routes); }, SET_TOPBAR_ROUTES: (state, routes) => { - state.topbarRouters = routes + state.topbarRouters = routes; }, SET_SIDEBAR_ROUTERS: (state, routes) => { // console.log(routes) - state.sidebarRouters = routes + state.sidebarRouters = routes; }, }, actions: { // 生成路由 GenerateRoutes({ commit }) { - return new Promise(resolve => { + return new Promise((resolve) => { // 向后端请求路由数据 - getRouters().then(res => { - const sdata = JSON.parse(JSON.stringify(res.data)) - const rdata = JSON.parse(JSON.stringify(res.data)) - const sidebarRoutes = filterAsyncRouter(sdata) - const rewriteRoutes = filterAsyncRouter(rdata, false, true) + getRouters().then((res) => { + const sdata = JSON.parse(JSON.stringify(res.data)); + const rdata = JSON.parse(JSON.stringify(res.data)); + const sidebarRoutes = filterAsyncRouter(sdata); + const rewriteRoutes = filterAsyncRouter(rdata, false, true); const asyncRoutes = filterDynamicRoutes(dynamicRoutes); - rewriteRoutes.push({ path: '*', redirect: '/404', hidden: true }) + rewriteRoutes.push({ path: "*", redirect: "/404", hidden: true }); router.addRoutes(asyncRoutes); - commit('SET_ROUTES', rewriteRoutes) - commit('SET_SIDEBAR_ROUTERS', constantRoutes.concat(sidebarRoutes)) - commit('SET_DEFAULT_ROUTES', sidebarRoutes) - commit('SET_TOPBAR_ROUTES', sidebarRoutes) - resolve(rewriteRoutes) - }) - }) - } - } -} + commit("SET_ROUTES", rewriteRoutes); + commit("SET_SIDEBAR_ROUTERS", constantRoutes.concat(sidebarRoutes)); + commit("SET_DEFAULT_ROUTES", sidebarRoutes); + commit("SET_TOPBAR_ROUTES", sidebarRoutes); + resolve(rewriteRoutes); + }); + }); + }, + }, +}; // 遍历后台传来的路由字符串,转换为组件对象 function filterAsyncRouter(asyncRouterMap, lastRouter = false, type = false) { - return asyncRouterMap.filter(route => { + return asyncRouterMap.filter((route) => { if (type && route.children) { - route.children = filterChildren(route.children) + route.children = filterChildren(route.children); } if (route.component) { // Layout ParentView 组件特殊处理 - if (route.component === 'Layout') { - route.component = Layout - } else if (route.component === 'ParentView') { - route.component = ParentView - } else if (route.component === 'InnerLink') { - route.component = InnerLink + if (route.component === "Layout") { + route.component = Layout; + } else if (route.component === "ParentView") { + route.component = ParentView; + } else if (route.component === "InnerLink") { + route.component = InnerLink; } else { - route.component = loadView(route.component) + route.component = loadView(route.component); } } if (route.children != null && route.children && route.children.length) { - route.children = filterAsyncRouter(route.children, route, type) + route.children = filterAsyncRouter(route.children, route, type); } else { - delete route['children'] - delete route['redirect'] + delete route["children"]; + delete route["redirect"]; } - return true - }) + return true; + }); } function filterChildren(childrenMap, lastRouter = false) { - var children = [] + var children = []; childrenMap.forEach((el, index) => { if (el.children && el.children.length) { - if (el.component === 'ParentView' && !lastRouter) { - el.children.forEach(c => { - c.path = el.path + '/' + c.path + if (el.component === "ParentView" && !lastRouter) { + el.children.forEach((c) => { + c.path = el.path + "/" + c.path; if (c.children && c.children.length) { - children = children.concat(filterChildren(c.children, c)) - return + children = children.concat(filterChildren(c.children, c)); + return; } - children.push(c) - }) - return + children.push(c); + }); + return; } } if (lastRouter) { - el.path = lastRouter.path + '/' + el.path + el.path = lastRouter.path + "/" + el.path; } - children = children.concat(el) - }) - return children + children = children.concat(el); + }); + return children; } // 动态路由遍历,验证是否具备权限 export function filterDynamicRoutes(routes) { - const res = [] - routes.forEach(route => { + const res = []; + routes.forEach((route) => { if (route.permissions) { if (auth.hasPermiOr(route.permissions)) { - res.push(route) + res.push(route); } } else if (route.roles) { if (auth.hasRoleOr(route.roles)) { - res.push(route) + res.push(route); } } - }) - return res + }); + return res; } export const loadView = (view) => { - if (process.env.NODE_ENV === 'development') { - return (resolve) => require([`@/views/${view}`], resolve) + if (process.env.NODE_ENV === "development") { + return (resolve) => require([`@/views/${view}`], resolve); } else { // 使用 import 实现生产环境的路由懒加载 - return () => import(`@/views/${view}`) + return () => import(`@/views/${view}`); } -} +}; -export default permission +export default permission; diff --git a/src/store/modules/user.js b/src/store/modules/user.js index ab0a6fe..eda05fc 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -1,96 +1,106 @@ -import { login, logout, getInfo } from '@/api/login' -import { getToken, setToken, removeToken } from '@/utils/auth' +import { login, logout, getInfo } from "@/api/login"; +import { getToken, setToken, removeToken } from "@/utils/auth"; const user = { state: { token: getToken(), - name: '', - avatar: '', + name: "", + avatar: "", roles: [], - permissions: [] + permissions: [], }, mutations: { SET_TOKEN: (state, token) => { - state.token = token + state.token = token; }, SET_NAME: (state, name) => { - state.name = name + state.name = name; }, SET_AVATAR: (state, avatar) => { - state.avatar = avatar + state.avatar = avatar; }, SET_ROLES: (state, roles) => { - state.roles = roles + state.roles = roles; }, SET_PERMISSIONS: (state, permissions) => { - state.permissions = permissions - } + state.permissions = permissions; + }, }, actions: { // 登录 Login({ commit }, userInfo) { - const username = userInfo.username.trim() - const password = userInfo.password - const code = userInfo.code - const uuid = userInfo.uuid + const username = userInfo.username.trim(); + const password = userInfo.password; + const code = userInfo.code; + const uuid = userInfo.uuid; return new Promise((resolve, reject) => { - login(username, password, code, uuid).then(res => { - setToken(res.token) - commit('SET_TOKEN', res.token) - resolve() - }).catch(error => { - reject(error) - }) - }) + login(username, password, code, uuid) + .then((res) => { + setToken(res.token); + commit("SET_TOKEN", res.token); + resolve(); + }) + .catch((error) => { + reject(error); + }); + }); }, // 获取用户信息 GetInfo({ commit, state }) { return new Promise((resolve, reject) => { - getInfo().then(res => { - const user = res.user - const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : process.env.VUE_APP_BASE_API + user.avatar; - if (res.roles && res.roles.length > 0) { // 验证返回的roles是否是一个非空数组 - commit('SET_ROLES', res.roles) - commit('SET_PERMISSIONS', res.permissions) - } else { - commit('SET_ROLES', ['ROLE_DEFAULT']) - } - commit('SET_NAME', user.userName) - commit('SET_AVATAR', avatar) - resolve(res) - }).catch(error => { - reject(error) - }) - }) + getInfo() + .then((res) => { + const user = res.user; + const avatar = + user.avatar == "" || user.avatar == null + ? require("@/assets/images/profile.jpg") + : process.env.VUE_APP_BASE_API + user.avatar; + if (res.roles && res.roles.length > 0) { + // 验证返回的roles是否是一个非空数组 + commit("SET_ROLES", res.roles); + commit("SET_PERMISSIONS", res.permissions); + } else { + commit("SET_ROLES", ["ROLE_DEFAULT"]); + } + commit("SET_NAME", user.nickName); + commit("SET_AVATAR", avatar); + resolve(res); + }) + .catch((error) => { + reject(error); + }); + }); }, // 退出系统 LogOut({ commit, state }) { return new Promise((resolve, reject) => { - logout(state.token).then(() => { - commit('SET_TOKEN', '') - commit('SET_ROLES', []) - commit('SET_PERMISSIONS', []) - removeToken() - resolve() - }).catch(error => { - reject(error) - }) - }) + logout(state.token) + .then(() => { + commit("SET_TOKEN", ""); + commit("SET_ROLES", []); + commit("SET_PERMISSIONS", []); + removeToken(); + resolve(); + }) + .catch((error) => { + reject(error); + }); + }); }, // 前端 登出 FedLogOut({ commit }) { - return new Promise(resolve => { - commit('SET_TOKEN', '') - removeToken() - resolve() - }) - } - } -} + return new Promise((resolve) => { + commit("SET_TOKEN", ""); + removeToken(); + resolve(); + }); + }, + }, +}; -export default user +export default user; diff --git a/src/views/components/myInput/index.vue b/src/views/components/myInput/index.vue index b7edb88..21aeeec 100644 --- a/src/views/components/myInput/index.vue +++ b/src/views/components/myInput/index.vue @@ -8,7 +8,7 @@ --> @@ -16,37 +16,36 @@ export default { data() { return { - input:'', - } + input: "", + }; }, - props:{ - placeholder:{ - type:String, - default:'请输入内容' - } + props: { + placeholder: { + type: String, + default: "请输入关键字", + }, }, - methods:{ - inputValue(){ - this.$emit('changeInput',this.input) + methods: { + inputValue() { + this.$emit("clickSearch", this.input); }, - changeValue(){ - this.$emit('changeValue',this.input) - } }, -} +}; - diff --git a/src/views/login.vue b/src/views/login.vue index 95cff50..e124a76 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -1,7 +1,12 @@ @@ -64,7 +87,7 @@ diff --git a/src/views/volunteer/addressGl/index.vue b/src/views/volunteer/addressGl/index.vue new file mode 100644 index 0000000..e744312 --- /dev/null +++ b/src/views/volunteer/addressGl/index.vue @@ -0,0 +1,9 @@ + + + + + diff --git a/src/views/volunteer/conversionRecord/index.vue b/src/views/volunteer/conversionRecord/index.vue index c6c5849..30b6c98 100644 --- a/src/views/volunteer/conversionRecord/index.vue +++ b/src/views/volunteer/conversionRecord/index.vue @@ -9,7 +9,11 @@