Compare commits
92 Commits
Lvtianfang
...
dev
Author | SHA1 | Date |
---|---|---|
|
2e1b24c63d | 2 months ago |
|
7705b2bc6b | 1 year ago |
|
8bcc4e6577 | 1 year ago |
|
08b10cfa3f | 1 year ago |
|
e36ee3fa73 | 2 years ago |
|
f78e8558a9 | 2 years ago |
![]() |
e57278676e | 2 years ago |
![]() |
6a16ccdd2f | 2 years ago |
![]() |
b68bde385a | 2 years ago |
![]() |
bffde87473 | 2 years ago |
![]() |
fdaef58223 | 2 years ago |
![]() |
ff3a569359 | 2 years ago |
|
f6138673dd | 2 years ago |
|
e2c005172a | 2 years ago |
|
b198991798 | 2 years ago |
|
c71713430d | 2 years ago |
|
9d04d89cfe | 2 years ago |
|
a35b36b3d1 | 2 years ago |
|
0aaf46eadd | 2 years ago |
|
63abc2ccb2 | 2 years ago |
|
7ce2aa5c25 | 2 years ago |
|
e9fd59ce78 | 2 years ago |
|
c9974b189d | 2 years ago |
|
0b2a0d18db | 2 years ago |
|
c4566552cb | 2 years ago |
|
ec5b188ca3 | 2 years ago |
|
cf5e70ebed | 2 years ago |
|
729fcf43d3 | 2 years ago |
|
43f9c1d6e6 | 2 years ago |
|
14572b90b2 | 2 years ago |
|
b82c619962 | 2 years ago |
|
71f09d8a60 | 2 years ago |
|
8a39702ed3 | 2 years ago |
|
b03092cc27 | 2 years ago |
|
ef682d309d | 2 years ago |
|
69d5023052 | 2 years ago |
|
89d7b5447e | 2 years ago |
|
c0ceaf34ac | 2 years ago |
|
d307454d8b | 2 years ago |
|
da1d123b4c | 2 years ago |
|
ce66d5f364 | 2 years ago |
|
ae9a3b46f9 | 2 years ago |
|
436566e291 | 2 years ago |
|
2154786275 | 2 years ago |
|
ffcca22e3d | 2 years ago |
|
8d2cbc07ff | 2 years ago |
|
9a09703913 | 2 years ago |
|
cb7573e9d6 | 2 years ago |
|
9e108f10d5 | 2 years ago |
|
8d3fe49568 | 2 years ago |
|
230e86d90c | 2 years ago |
|
83ace37d56 | 2 years ago |
|
54905edfae | 2 years ago |
|
accaa9a17c | 2 years ago |
|
33b60a0ee3 | 2 years ago |
|
2502805e06 | 2 years ago |
|
ab47afa61c | 2 years ago |
|
8dcb3ca748 | 2 years ago |
|
1415c5df6a | 2 years ago |
|
022d2925d2 | 2 years ago |
|
90e4edc5dc | 2 years ago |
|
e3bf8d5e0c | 2 years ago |
|
3108898d36 | 2 years ago |
|
87055237da | 2 years ago |
|
4e40e4d856 | 2 years ago |
|
6b15ae13da | 2 years ago |
|
d666ca3b12 | 2 years ago |
|
9e90b47b90 | 2 years ago |
|
287509f12e | 2 years ago |
|
3d6ca6deba | 2 years ago |
|
19302b43cd | 2 years ago |
|
b583d3fc1a | 2 years ago |
|
26e6d01f63 | 2 years ago |
|
1248c424d0 | 2 years ago |
|
a40a9f5162 | 2 years ago |
|
37a475562b | 2 years ago |
|
beccaa030e | 2 years ago |
|
f42151b513 | 2 years ago |
|
76aa444030 | 2 years ago |
|
fecc4ba507 | 2 years ago |
|
9c77ad1ee0 | 2 years ago |
|
5758e256ad | 2 years ago |
|
95699a7748 | 2 years ago |
|
184ca04b36 | 2 years ago |
|
6041c7e184 | 2 years ago |
|
f6b1e98ecf | 2 years ago |
|
4694a94d9b | 2 years ago |
|
b98e7e80ea | 2 years ago |
|
89bfb8af34 | 2 years ago |
|
ed6a89c4d9 | 2 years ago |
|
0877733b3f | 2 years ago |
|
0a0a83b224 | 2 years ago |
@ -1,13 +1,13 @@
|
||||
# 页面标题
|
||||
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'
|
||||
VUE_APP_BASE_API = 'http://localhost:9034/api/'
|
||||
# VUE_APP_BASE_API = 'http:///192.168.0.119:9034'
|
||||
|
||||
# 路由懒加载
|
||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||
|
@ -1,8 +1,10 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 若依管理系统
|
||||
VUE_APP_TITLE = 苏州园区志愿服务活动区块链平台
|
||||
|
||||
# 生产环境配置
|
||||
ENV = 'production'
|
||||
|
||||
# 若依管理系统/生产环境
|
||||
VUE_APP_BASE_API = 'http://39.101.188.84:9034'
|
||||
# 苏州园区志愿服务活动区块链平台/生产环境
|
||||
# VUE_APP_BASE_API = 'http://39.101.188.84:9034/api'
|
||||
|
||||
VUE_APP_BASE_API = 'https://zyzqkl.sipac.gov.cn/api'
|
||||
|
@ -1,10 +1,10 @@
|
||||
# 页面标题
|
||||
VUE_APP_TITLE = 若依管理系统
|
||||
VUE_APP_TITLE = 苏州园区志愿服务活动区块链平台
|
||||
|
||||
NODE_ENV = production
|
||||
|
||||
# 测试环境配置
|
||||
ENV = 'staging'
|
||||
|
||||
# 若依管理系统/测试环境
|
||||
# 苏州园区志愿服务活动区块链平台/测试环境
|
||||
VUE_APP_BASE_API = '/stage-api'
|
||||
|
@ -1,59 +1,60 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
import request from "@/utils/request";
|
||||
import { encrypt } from "@/utils/jsencrypt";
|
||||
// 登录方法
|
||||
export function login(username, password, code, uuid) {
|
||||
password = encrypt(password);
|
||||
const data = {
|
||||
username,
|
||||
password,
|
||||
code,
|
||||
uuid
|
||||
}
|
||||
uuid,
|
||||
};
|
||||
return request({
|
||||
url: '/login',
|
||||
url: "/login",
|
||||
headers: {
|
||||
isToken: false
|
||||
isToken: false,
|
||||
},
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 注册方法
|
||||
export function register(data) {
|
||||
return request({
|
||||
url: '/register',
|
||||
url: "/register",
|
||||
headers: {
|
||||
isToken: false
|
||||
isToken: false,
|
||||
},
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 获取用户详细信息
|
||||
export function getInfo() {
|
||||
return request({
|
||||
url: '/getInfo',
|
||||
method: 'get'
|
||||
})
|
||||
url: "/getInfo",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 退出方法
|
||||
export function logout() {
|
||||
return request({
|
||||
url: '/logout',
|
||||
method: 'post'
|
||||
})
|
||||
url: "/logout",
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
|
||||
// 获取验证码
|
||||
export function getCodeImg() {
|
||||
return request({
|
||||
url: '/captchaImage',
|
||||
url: "/captchaImage",
|
||||
headers: {
|
||||
isToken: false
|
||||
isToken: false,
|
||||
},
|
||||
method: 'get',
|
||||
timeout: 20000
|
||||
})
|
||||
}
|
||||
method: "get",
|
||||
timeout: 20000,
|
||||
});
|
||||
}
|
||||
|
@ -1,60 +1,67 @@
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 查询字典类型列表
|
||||
export function listType(query) {
|
||||
return request({
|
||||
url: '/system/dict/type/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
url: "/system/dict/type/list",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
export function listType2(query) {
|
||||
return request({
|
||||
url: "/system/dict/type/personList",
|
||||
method: "get",
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
// 查询字典类型详细
|
||||
export function getType(dictId) {
|
||||
return request({
|
||||
url: '/system/dict/type/' + dictId,
|
||||
method: 'get'
|
||||
})
|
||||
url: "/system/dict/type/" + dictId,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
||||
// 新增字典类型
|
||||
export function addType(data) {
|
||||
return request({
|
||||
url: '/system/dict/type',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
url: "/system/dict/type",
|
||||
method: "post",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 修改字典类型
|
||||
export function updateType(data) {
|
||||
return request({
|
||||
url: '/system/dict/type',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
url: "/system/dict/type",
|
||||
method: "put",
|
||||
data: data,
|
||||
});
|
||||
}
|
||||
|
||||
// 删除字典类型
|
||||
export function delType(dictId) {
|
||||
return request({
|
||||
url: '/system/dict/type/' + dictId,
|
||||
method: 'delete'
|
||||
})
|
||||
url: "/system/dict/type/" + dictId,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
// 刷新字典缓存
|
||||
export function refreshCache() {
|
||||
return request({
|
||||
url: '/system/dict/type/refreshCache',
|
||||
method: 'delete'
|
||||
})
|
||||
url: "/system/dict/type/refreshCache",
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
|
||||
// 获取字典选择框列表
|
||||
export function optionselect() {
|
||||
return request({
|
||||
url: '/system/dict/type/optionselect',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
url: "/system/dict/type/optionselect",
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
|
@ -1,71 +1,84 @@
|
||||
import request from '@/utils/request'
|
||||
import request from "@/utils/request";
|
||||
|
||||
// 获取活动list列表
|
||||
export function activityList(data) {
|
||||
return request({
|
||||
url: '/zhiyuanzhe/activity/list',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
return request({
|
||||
url: "/zhiyuanzhe/activity/list",
|
||||
method: "get",
|
||||
params: data,
|
||||
});
|
||||
}
|
||||
// 添加活动
|
||||
export function activityAdd(data) {
|
||||
return request({
|
||||
url: '/zhiyuanzhe/activity',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: "/zhiyuanzhe/activity",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
// 修改活动
|
||||
export function activityUpdate(data) {
|
||||
return request({
|
||||
url: '/zhiyuanzhe/activity',
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
return request({
|
||||
url: "/zhiyuanzhe/activity",
|
||||
method: "put",
|
||||
data,
|
||||
});
|
||||
}
|
||||
//删除活动
|
||||
//删除活动
|
||||
export function activityDelete(ids) {
|
||||
return request({
|
||||
url: `/zhiyuanzhe/activity/${ids}`,
|
||||
method: 'delete',
|
||||
})
|
||||
return request({
|
||||
url: `/zhiyuanzhe/activity/${ids}`,
|
||||
method: "delete",
|
||||
});
|
||||
}
|
||||
//查询单个活动详情
|
||||
export function activityGet(id) {
|
||||
return request({
|
||||
url: `/zhiyuanzhe/activity/${id}`,
|
||||
method: 'get',
|
||||
})
|
||||
return request({
|
||||
url: `/zhiyuanzhe/activity/${id}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
//查看人员标签列表
|
||||
export function peopleList(data) {
|
||||
return request({
|
||||
url: '/zhiyuanzhe/tags/list',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
return request({
|
||||
url: "/zhiyuanzhe/tags/list",
|
||||
method: "get",
|
||||
params: data,
|
||||
});
|
||||
}
|
||||
//人员标签详情
|
||||
export function peopleGet(id) {
|
||||
return request({
|
||||
url: `/zhiyuanzhe/tags/${id}`,
|
||||
method: 'get',
|
||||
})
|
||||
return request({
|
||||
url: `/zhiyuanzhe/tags/${id}`,
|
||||
method: "get",
|
||||
});
|
||||
}
|
||||
//查看参与报名列表
|
||||
export function canyuList(data) {
|
||||
return request({
|
||||
url: '/zhiyuanzhe/zyzreport/list',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
return request({
|
||||
url: "/zhiyuanzhe/zyzreport/list",
|
||||
method: "get",
|
||||
params: data,
|
||||
});
|
||||
}
|
||||
//新增邀请
|
||||
export function yaoqingAdd(data) {
|
||||
return request({
|
||||
url: '/zhiyuanzhe/invite',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
return request({
|
||||
url: `/zhiyuanzhe/activity/inviteTwo/${data}`,
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
export function postStatus(data) {
|
||||
return request({
|
||||
url: "/zhiyuanzhe/activity/enrollApproval",
|
||||
method: "post",
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export function getTagsInfo(id) {
|
||||
return request({
|
||||
url: "/zhiyuanzhe/activity/findByActivityUserId/" + id,
|
||||
method: "post",
|
||||
});
|
||||
}
|
||||
|
After Width: | Height: | Size: 861 B |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 509 KiB After Width: | Height: | Size: 223 KiB |
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 72 KiB |
After Width: | Height: | Size: 19 KiB |
After Width: | Height: | Size: 524 KiB |
@ -1,56 +1,122 @@
|
||||
import router from './router'
|
||||
import store from './store'
|
||||
import { Message } from 'element-ui'
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
import { getToken } from '@/utils/auth'
|
||||
import { isRelogin } from '@/utils/request'
|
||||
import router from "./router";
|
||||
import store from "./store";
|
||||
import { Message } from "element-ui";
|
||||
import NProgress from "nprogress";
|
||||
import "nprogress/nprogress.css";
|
||||
import { getToken } from "@/utils/auth";
|
||||
import { isRelogin } from "@/utils/request";
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
NProgress.configure({ showSpinner: false });
|
||||
|
||||
const whiteList = ['/login', '/register']
|
||||
const whiteList = ["/login", "/register", "/3dmodel"];
|
||||
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start()
|
||||
NProgress.start();
|
||||
let { isFromVolunteer, tel } = to.query;
|
||||
if (isFromVolunteer || tel) {
|
||||
let userName;
|
||||
if (tel) {
|
||||
userName = atob(tel); //志愿者
|
||||
} else {
|
||||
userName = "15937192537"; //管理员
|
||||
}
|
||||
|
||||
if (!getToken()) {
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
// 没有token
|
||||
// 在免登录白名单,直接进入
|
||||
store.commit("SET_IS_MENU_HEADER", false); //不显示左侧菜单,头部标题
|
||||
next();
|
||||
} else {
|
||||
// next(`/login?redirect=${encodeURIComponent(to.fullPath)}`); // 否则全部重定向到登录页
|
||||
store
|
||||
.dispatch("Login", {
|
||||
username: userName,
|
||||
password: "123456",
|
||||
})
|
||||
.then(() => {
|
||||
to.meta.title && store.dispatch("settings/setTitle", to.meta.title);
|
||||
/* has token*/
|
||||
if (to.path === "/login") {
|
||||
next({ path: "/" });
|
||||
NProgress.done();
|
||||
} else {
|
||||
store.commit(
|
||||
"SET_IS_MENU_HEADER",
|
||||
isFromVolunteer ? false : true
|
||||
);
|
||||
if (store.getters.roles.length === 0) {
|
||||
isRelogin.show = true;
|
||||
// 判断当前用户是否已拉取完user_info信息
|
||||
store
|
||||
.dispatch("GetInfo")
|
||||
.then(() => {
|
||||
isRelogin.show = false;
|
||||
store.dispatch("GenerateRoutes").then((accessRoutes) => {
|
||||
// 根据roles权限生成可访问的路由表
|
||||
router.addRoutes(accessRoutes); // 动态添加可访问路由表
|
||||
next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
store.dispatch("LogOut").then(() => {
|
||||
Message.error(err);
|
||||
next({ path: "/" });
|
||||
});
|
||||
});
|
||||
} else {
|
||||
next();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (getToken()) {
|
||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||
to.meta.title && store.dispatch("settings/setTitle", to.meta.title);
|
||||
/* has token*/
|
||||
if (to.path === '/login') {
|
||||
next({ path: '/' })
|
||||
NProgress.done()
|
||||
if (to.path === "/login") {
|
||||
next({ path: "/" });
|
||||
NProgress.done();
|
||||
} else {
|
||||
store.commit("SET_IS_MENU_HEADER", isFromVolunteer ? false : true);
|
||||
if (store.getters.roles.length === 0) {
|
||||
isRelogin.show = true
|
||||
isRelogin.show = true;
|
||||
// 判断当前用户是否已拉取完user_info信息
|
||||
store.dispatch('GetInfo').then(() => {
|
||||
isRelogin.show = false
|
||||
store.dispatch('GenerateRoutes').then(accessRoutes => {
|
||||
// 根据roles权限生成可访问的路由表
|
||||
router.addRoutes(accessRoutes) // 动态添加可访问路由表
|
||||
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
|
||||
})
|
||||
}).catch(err => {
|
||||
store.dispatch('LogOut').then(() => {
|
||||
Message.error(err)
|
||||
next({ path: '/' })
|
||||
})
|
||||
store
|
||||
.dispatch("GetInfo")
|
||||
.then(() => {
|
||||
isRelogin.show = false;
|
||||
store.dispatch("GenerateRoutes").then((accessRoutes) => {
|
||||
// 根据roles权限生成可访问的路由表
|
||||
router.addRoutes(accessRoutes); // 动态添加可访问路由表
|
||||
next({ ...to, replace: true }); // hack方法 确保addRoutes已完成
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
store.dispatch("LogOut").then(() => {
|
||||
Message.error(err);
|
||||
next({ path: "/" });
|
||||
});
|
||||
});
|
||||
} else {
|
||||
next()
|
||||
next();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// 没有token
|
||||
if (whiteList.indexOf(to.path) !== -1) {
|
||||
// 没有token
|
||||
// 在免登录白名单,直接进入
|
||||
next()
|
||||
store.commit("SET_IS_MENU_HEADER", false); //不显示左侧菜单,头部标题
|
||||
next();
|
||||
} else {
|
||||
next(`/login?redirect=${encodeURIComponent(to.fullPath)}`) // 否则全部重定向到登录页
|
||||
NProgress.done()
|
||||
// next(`/login?redirect=${encodeURIComponent(to.fullPath)}`); // 否则全部重定向到登录页
|
||||
NProgress.done();
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
|
||||
router.afterEach(() => {
|
||||
NProgress.done()
|
||||
})
|
||||
NProgress.done();
|
||||
});
|
||||
|
@ -1,19 +1,22 @@
|
||||
const getters = {
|
||||
sidebar: state => state.app.sidebar,
|
||||
size: state => state.app.size,
|
||||
device: state => state.app.device,
|
||||
dict: state => state.dict.dict,
|
||||
visitedViews: state => state.tagsView.visitedViews,
|
||||
cachedViews: state => state.tagsView.cachedViews,
|
||||
token: state => state.user.token,
|
||||
avatar: state => state.user.avatar,
|
||||
name: state => state.user.name,
|
||||
introduction: state => state.user.introduction,
|
||||
roles: state => state.user.roles,
|
||||
permissions: state => state.user.permissions,
|
||||
permission_routes: state => state.permission.routes,
|
||||
topbarRouters:state => state.permission.topbarRouters,
|
||||
defaultRoutes:state => state.permission.defaultRoutes,
|
||||
sidebarRouters:state => state.permission.sidebarRouters,
|
||||
}
|
||||
export default getters
|
||||
sidebar: (state) => state.app.sidebar,
|
||||
size: (state) => state.app.size,
|
||||
device: (state) => state.app.device,
|
||||
dict: (state) => state.dict.dict,
|
||||
visitedViews: (state) => state.tagsView.visitedViews,
|
||||
cachedViews: (state) => state.tagsView.cachedViews,
|
||||
token: (state) => state.user.token,
|
||||
avatar: (state) => state.user.avatar,
|
||||
name: (state) => state.user.name,
|
||||
userId: (state) => state.user.userId,
|
||||
introduction: (state) => state.user.introduction,
|
||||
roles: (state) => state.user.roles,
|
||||
permissions: (state) => state.user.permissions,
|
||||
permission_routes: (state) => state.permission.routes,
|
||||
topbarRouters: (state) => state.permission.topbarRouters,
|
||||
defaultRoutes: (state) => state.permission.defaultRoutes,
|
||||
sidebarRouters: (state) => state.permission.sidebarRouters,
|
||||
integral: (state) => state.permission.integral,
|
||||
isMenuHeader: (state) => state.user.isMenuHeader,
|
||||
};
|
||||
export default getters;
|
||||
|
@ -1,96 +1,115 @@
|
||||
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: "",
|
||||
userId: "",
|
||||
avatar: "",
|
||||
roles: [],
|
||||
permissions: []
|
||||
permissions: [],
|
||||
isMenuHeader: true, //是否显示左边菜单和头部标题
|
||||
},
|
||||
|
||||
mutations: {
|
||||
SET_IS_MENU_HEADER: (state, isTrue) => {
|
||||
state.isMenuHeader = isTrue;
|
||||
},
|
||||
SET_TOKEN: (state, token) => {
|
||||
state.token = token
|
||||
state.token = token;
|
||||
},
|
||||
SET_NAME: (state, name) => {
|
||||
state.name = name
|
||||
state.name = name;
|
||||
},
|
||||
SET_USER_ID: (state, userId) => {
|
||||
state.userId = userId;
|
||||
},
|
||||
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_USER_ID", user.userId);
|
||||
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;
|
||||
|
@ -0,0 +1,86 @@
|
||||
<!--
|
||||
* @Author: 张涛
|
||||
* @Date: 2023-10-31 17:28:25
|
||||
* @LastEditors: 张涛
|
||||
* @LastEditTime: 2023-11-01 10:50:27
|
||||
* @FilePath: \volunteer-pc\src\views\3dmodel.vue
|
||||
-->
|
||||
<template>
|
||||
<div class="page">
|
||||
<!-- src="http://localhost/3dmodel/star.obj" -->
|
||||
<!-- src="https://www.jichuanglanhai.com/demo/3dmodel/2.obj" -->
|
||||
<model-obj
|
||||
ref="model"
|
||||
src="https://www.jichuanglanhai.com/demo/3dmodel/star.obj"
|
||||
:rotation="rotation"
|
||||
:position="position"
|
||||
:scale="scale"
|
||||
:lights="lights"
|
||||
@on-load="onLoad"
|
||||
:controls-options="{}"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { ModelObj } from "vue-3d-model";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
ModelObj,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
rotation: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
z: 0,
|
||||
},
|
||||
position: {
|
||||
x: 0,
|
||||
y: 0,
|
||||
z: 0,
|
||||
},
|
||||
scale: {
|
||||
x: 0.5,
|
||||
y: 0.5,
|
||||
z: 0.5,
|
||||
},
|
||||
lights: [
|
||||
{
|
||||
type: "HemisphereLight",
|
||||
position: { x: 0, y: 1, z: 0 },
|
||||
skyColor: 0xffd700,
|
||||
groundColor: 0xffd700,
|
||||
intensity: 0.2,
|
||||
},
|
||||
{
|
||||
type: "DirectionalLight",
|
||||
position: { x: 1, y: 1, z: 1 },
|
||||
color: 0xffffff,
|
||||
intensity: 0.8,
|
||||
},
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {},
|
||||
methods: {
|
||||
onLoad() {
|
||||
this.rotate();
|
||||
},
|
||||
rotate() {
|
||||
this.rotation.y += 0.01;
|
||||
|
||||
requestAnimationFrame(this.rotate);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.page {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
</style>
|
@ -0,0 +1,82 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="80px"
|
||||
class="user-address"
|
||||
>
|
||||
<el-form-item label="姓名" prop="consigneeName">
|
||||
<el-input v-model="form.consigneeName"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="手机号" prop="consigneePhonenumber">
|
||||
<el-input v-model="form.consigneePhonenumber"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="详细地址" prop="address">
|
||||
<el-input v-model="form.address" type="textarea" :rows="3"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleSubmit()">提 交</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserProfile, updateUserProfile } from "@/api/system/user.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {},
|
||||
rules: {
|
||||
consigneeName: [
|
||||
{ required: true, message: "请输入姓名", trigger: "blur" },
|
||||
],
|
||||
consigneePhonenumber: [
|
||||
{ required: true, message: "请输入手机号", trigger: "blur" },
|
||||
],
|
||||
address: [
|
||||
{ required: true, message: "请输入详细地址", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getUserInfo();
|
||||
},
|
||||
methods: {
|
||||
getUserInfo() {
|
||||
getUserProfile().then((res) => {
|
||||
this.form = res.data;
|
||||
console.log(this.form, res);
|
||||
});
|
||||
},
|
||||
handleSubmit() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
updateUserProfile(this.form).then(() => {
|
||||
this.$modal.msgSuccess("提交成功");
|
||||
});
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.app-container {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.user-address {
|
||||
padding: 30px 15px 0 15px;
|
||||
width: 500px;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 0 6px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
</style>
|
@ -0,0 +1,748 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-dialog
|
||||
:visible.sync="dialogVisible"
|
||||
width="50%"
|
||||
@close="closeDetail"
|
||||
:destroy-on-close="true"
|
||||
>
|
||||
<div slot="title">
|
||||
<div class="titleText">查看详情</div>
|
||||
</div>
|
||||
<div class="center-content">
|
||||
<header>
|
||||
<div class="icons"></div>
|
||||
<span>活动信息</span>
|
||||
</header>
|
||||
<div class="mainsEvents">
|
||||
<div class="itemE">
|
||||
<div>活动名称:</div>
|
||||
<div>{{ detailData.name }}</div>
|
||||
</div>
|
||||
<div class="itemE">
|
||||
<div>活动地址:</div>
|
||||
<div>{{ detailData.address }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mainsEvents">
|
||||
<div class="itemE">
|
||||
<div>活动举办方:</div>
|
||||
<div>{{ detailData.publisher }}</div>
|
||||
</div>
|
||||
<div class="itemE">
|
||||
<div>活动标签:</div>
|
||||
<div class="mainTag mainTag-label">
|
||||
<div
|
||||
v-for="(item, index) in detailDatalist"
|
||||
:key="index"
|
||||
v-show="item != ''"
|
||||
>
|
||||
{{ item }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mainsTitle">
|
||||
<div>活动内容:</div>
|
||||
<div>{{ detailData.content }}</div>
|
||||
</div>
|
||||
<div class="mainsTitle">
|
||||
<div>活动时间:</div>
|
||||
<div>{{ detailData.activityTime }}至{{ detailData.endTime }}</div>
|
||||
</div>
|
||||
|
||||
<!-- 人员匹配度 -->
|
||||
<header>
|
||||
<div class="icons icons1"></div>
|
||||
<span>人员匹配度</span>
|
||||
</header>
|
||||
<div v-loading="load1">
|
||||
<div class="mainPeople" v-if="personList.length > 0">
|
||||
<div
|
||||
class="subMan"
|
||||
v-for="(item, index) in personList"
|
||||
:key="index"
|
||||
>
|
||||
<div class="leftSub">
|
||||
<div
|
||||
class="leftAvatar"
|
||||
:style="`background-image:url('${require('../../../../assets/images/profile.jpg')}')`"
|
||||
></div>
|
||||
<div class="leftName">
|
||||
<div>{{ item.nickName }}</div>
|
||||
<div class="mainTag">
|
||||
<div
|
||||
v-show="item != ''"
|
||||
v-for="(item, index) in item.arrlist"
|
||||
:key="index"
|
||||
>
|
||||
{{ item }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rightSub">
|
||||
<div class="numPercen">
|
||||
<span>匹配度:</span>
|
||||
<span>{{ item.degreeOfMatch }}%</span>
|
||||
</div>
|
||||
<div class="itemBtn" style="justify-content: center">
|
||||
<div class="look" @click="looks1(item.tagsId)">查看</div>
|
||||
<div
|
||||
class="looks"
|
||||
style="margin: 0 0 0 10px"
|
||||
@click="invite(item)"
|
||||
v-if="detailData.status == 1 && item.status == 0"
|
||||
>
|
||||
邀请
|
||||
</div>
|
||||
<div class="looks" style="margin: 0 0 0 10px" v-else>
|
||||
已邀请
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="noneStyle">暂无数据</div>
|
||||
</div>
|
||||
|
||||
<div class="titlePagin">
|
||||
<el-pagination
|
||||
small
|
||||
layout="prev, pager, next"
|
||||
:total="personTotal"
|
||||
:current-page.sync="personParams.pageNum"
|
||||
@current-change="changePersonSize"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
<!-- 参与报名 -->
|
||||
<header>
|
||||
<div class="icons icons2"></div>
|
||||
<span>参与报名</span>
|
||||
</header>
|
||||
<div v-loading="load2">
|
||||
<div class="mainPeople" v-if="participationList.length > 0">
|
||||
<div
|
||||
class="subMan"
|
||||
v-for="(item, index) in participationList"
|
||||
:key="index"
|
||||
>
|
||||
<div class="leftSub">
|
||||
<div
|
||||
class="leftAvatar"
|
||||
:style="`background-image:url('${require('../../../../assets/images/profile.jpg')}')`"
|
||||
></div>
|
||||
<div class="leftName">
|
||||
<div>{{ item.nickName }}</div>
|
||||
<div class="mainTag">
|
||||
<div
|
||||
v-show="item != ''"
|
||||
v-for="(item, indx) in item.arrlist"
|
||||
:key="indx"
|
||||
>
|
||||
{{ item }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rightSub">
|
||||
<div class="numPercen">
|
||||
<span>匹配度:</span>
|
||||
<span>{{ item.degreeOfMatch }}%</span>
|
||||
</div>
|
||||
<div class="btn-list">
|
||||
<div
|
||||
class="btn-text"
|
||||
@click="looks1(item.tagsId)"
|
||||
style="color: #188ffe"
|
||||
>
|
||||
查看
|
||||
</div>
|
||||
<div
|
||||
class="btn-text"
|
||||
style="color: #49b28f"
|
||||
@click="handleStatus(item.id, 3, index)"
|
||||
v-show="item.status != 4"
|
||||
>
|
||||
{{
|
||||
item.status == 2
|
||||
? "同意"
|
||||
: item.status == 3
|
||||
? "已同意"
|
||||
: "未知"
|
||||
}}
|
||||
</div>
|
||||
<div
|
||||
class="btn-text"
|
||||
style="color: #e16a70"
|
||||
@click="handleStatus(item.id, 4, index)"
|
||||
v-show="item.status != 3"
|
||||
>
|
||||
{{
|
||||
item.status == 2
|
||||
? "拒绝"
|
||||
: item.status == 4
|
||||
? "已拒绝"
|
||||
: "未知"
|
||||
}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="noneStyle">暂无数据</div>
|
||||
</div>
|
||||
|
||||
<div class="titlePagin">
|
||||
<el-pagination
|
||||
small
|
||||
layout="prev, pager, next"
|
||||
:total="participationTotal"
|
||||
:current-page.sync="participationParams.pageNum"
|
||||
>
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 查看该人员的详情 -->
|
||||
<el-dialog
|
||||
:visible.sync="peopelDetail"
|
||||
width="40%"
|
||||
@close="cancel"
|
||||
:destroy-on-close="true"
|
||||
>
|
||||
<div slot="title">
|
||||
<div class="titleText">查看人员详情</div>
|
||||
</div>
|
||||
<div class="center-content">
|
||||
<el-descriptions class="margin-top" :column="2" border>
|
||||
<el-descriptions-item
|
||||
v-for="(item, index) in beforeData"
|
||||
:key="index"
|
||||
>
|
||||
<template slot="label"> {{ item.name }} </template>
|
||||
{{ item.value }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
activityGet,
|
||||
peopleList,
|
||||
canyuList,
|
||||
peopleGet,
|
||||
yaoqingAdd,
|
||||
postStatus,
|
||||
getTagsInfo,
|
||||
} from "@/api/volunteer/hdgl";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
beforeData: [
|
||||
{
|
||||
name: "年龄",
|
||||
label: "ageRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "文化程度",
|
||||
label: "educationRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "小区",
|
||||
label: "housingRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "行业类型",
|
||||
label: "industryRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "兴趣爱好",
|
||||
label: "interestRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "国籍",
|
||||
label: "nationalityRange",
|
||||
value: "",
|
||||
},
|
||||
|
||||
{
|
||||
name: "政治面貌",
|
||||
label: "politicalRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "专业类型",
|
||||
label: "professionalRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "院校",
|
||||
label: "schoolRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "性别",
|
||||
label: "sexRange",
|
||||
value: "",
|
||||
},
|
||||
],
|
||||
dialogVisible: false,
|
||||
detailData: {},
|
||||
detailDatalist: [],
|
||||
load1: true,
|
||||
personList: [],
|
||||
personTotal: 0,
|
||||
personParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
ageRange: "",
|
||||
educationRange: "",
|
||||
housingRange: "",
|
||||
industryRange: "",
|
||||
interestRange: "",
|
||||
nationalityRange: "",
|
||||
politicalRange: "",
|
||||
professionalRange: "",
|
||||
schoolRange: "",
|
||||
sexRange: "",
|
||||
},
|
||||
load2: true,
|
||||
participationList: [],
|
||||
participationTotal: 0,
|
||||
participationParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
activityId: "",
|
||||
},
|
||||
peopelDetail: false,
|
||||
arr: [
|
||||
"ageRange",
|
||||
"sexRange",
|
||||
"politicalRange",
|
||||
"educationRange",
|
||||
"housingRange",
|
||||
"industryRange",
|
||||
"interestRange",
|
||||
"professionalRange",
|
||||
"schoolRange",
|
||||
"nationalityRange",
|
||||
],
|
||||
e: {},
|
||||
};
|
||||
},
|
||||
props: {},
|
||||
created() {},
|
||||
methods: {
|
||||
/**报名 同意不同意 */
|
||||
handleStatus(id, status, index, indx) {
|
||||
let _this = this;
|
||||
if (
|
||||
this.participationList[index].status == 3 ||
|
||||
this.participationList[index].status == 4
|
||||
)
|
||||
return;
|
||||
let data = {
|
||||
id,
|
||||
status,
|
||||
};
|
||||
this.$modal
|
||||
.confirm(`你确认要${status == 3 ? "同意" : "拒绝"}改活动吗?`)
|
||||
.then(function () {
|
||||
postStatus(data).then((res) => {
|
||||
_this.participationList[index].status = status;
|
||||
});
|
||||
});
|
||||
},
|
||||
open(e) {
|
||||
console.log(e);
|
||||
this.e = e;
|
||||
activityGet(e).then((res) => {
|
||||
this.detailData = res.data;
|
||||
this.detailDatalist = this.labelgenerate(this.detailData);
|
||||
this.participationParams.activityId = this.detailData.id;
|
||||
this.getPersonData();
|
||||
this.getParticipationData();
|
||||
this.dialogVisible = true;
|
||||
});
|
||||
},
|
||||
//标签生成
|
||||
labelgenerate(data) {
|
||||
let result = [];
|
||||
this.arr.forEach((item) => {
|
||||
for (let itemB in data) {
|
||||
if (item == itemB) {
|
||||
//多选后值是数组类型 =》string
|
||||
if (data[itemB]) {
|
||||
data[itemB] = data[itemB].split(",");
|
||||
} else {
|
||||
data[itemB] = [];
|
||||
}
|
||||
result = [...result, ...data[itemB]];
|
||||
}
|
||||
}
|
||||
});
|
||||
return result;
|
||||
},
|
||||
//关闭详情
|
||||
closeDetail() {
|
||||
this.detailData = {};
|
||||
this.detailDatalist = [];
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
getPersonData() {
|
||||
//查看人员匹配度列表
|
||||
this.load1 = true;
|
||||
this.detailData;
|
||||
this.personList = this.detailData.unregisteredUsers;
|
||||
if (this.personList.length > 0) {
|
||||
this.personList.forEach((item) => {
|
||||
item.arrlist = this.labelgenerate(item);
|
||||
});
|
||||
}
|
||||
this.load1 = false;
|
||||
},
|
||||
getParticipationData() {
|
||||
this.load2 = true;
|
||||
//查看参与报名列表
|
||||
this.detailData;
|
||||
this.participationList = this.detailData.enrolledUsers;
|
||||
if (this.participationList.length > 0) {
|
||||
this.participationList.forEach((item) => {
|
||||
item.arrlist = this.labelgenerate(item);
|
||||
});
|
||||
}
|
||||
this.load2 = false;
|
||||
},
|
||||
//更改人员匹配度页码
|
||||
changePersonSize(e) {
|
||||
this.personParams.pageNum = e;
|
||||
this.getPersonData();
|
||||
},
|
||||
//更改参与报名匹配度页码
|
||||
changeParticipationSize(e) {
|
||||
this.participationParams.pageNum = e;
|
||||
this.getParticipationData();
|
||||
},
|
||||
looks1(e) {
|
||||
getTagsInfo(e).then((res) => {
|
||||
this.beforeData.forEach((value, index) => {
|
||||
for (let key in res.data) {
|
||||
if (value.label == key) {
|
||||
this.beforeData[index].value = res.data[key].toString();
|
||||
}
|
||||
}
|
||||
});
|
||||
this.peopelDetail = true;
|
||||
});
|
||||
},
|
||||
looks2(item) {
|
||||
this.beforeData.forEach((value, index) => {
|
||||
for (let key in item) {
|
||||
if (value.label == key) {
|
||||
this.beforeData[index].value = item[key].toString();
|
||||
}
|
||||
}
|
||||
});
|
||||
this.peopelDetail = true;
|
||||
},
|
||||
invite(e) {
|
||||
console.log(e);
|
||||
this.$modal
|
||||
.confirm("是否确认邀请该人参加活动?")
|
||||
.then(() => {
|
||||
yaoqingAdd(e.id).then(() => {
|
||||
this.$modal.msgSuccess("邀请成功");
|
||||
|
||||
activityGet(this.e).then((res) => {
|
||||
this.detailData = res.data;
|
||||
for (let key1 in this.personParams) {
|
||||
for (let key2 in this.detailData) {
|
||||
if (key1 == key2) {
|
||||
this.personParams[key1] = this.detailData[key2];
|
||||
}
|
||||
}
|
||||
}
|
||||
this.detailDatalist = this.labelgenerate(this.detailData);
|
||||
if (this.personParams.sexRange == "") {
|
||||
this.personParams.sexRange = "男,女";
|
||||
}
|
||||
this.participationParams.activityId = this.detailData.id;
|
||||
this.getPersonData();
|
||||
this.getParticipationData();
|
||||
this.dialogVisible = true;
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
cancel() {
|
||||
this.peopelDetail = false;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .margin-top td {
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
}
|
||||
::v-deep .margin-top th {
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
width: 20%;
|
||||
}
|
||||
.titlePagin {
|
||||
margin: 12px 0;
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
::v-deep .titlePagin .el-pagination {
|
||||
padding: 0;
|
||||
}
|
||||
.mainTag-label {
|
||||
// position: absolute;
|
||||
width: 300px;
|
||||
left: 80px;
|
||||
}
|
||||
.mainTag {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
flex-direction: row; /* 从左往右排列 */
|
||||
& > div {
|
||||
margin-bottom: 5px;
|
||||
margin-right: 5px;
|
||||
background-color: rgba(248, 65, 77, 0.06);
|
||||
padding: 3px 5px;
|
||||
color: #e16a70;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
::v-deep .el-dialog {
|
||||
border-radius: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
::v-deep .el-dialog__header {
|
||||
padding: 10px;
|
||||
padding-left: 15px;
|
||||
background: #f7f5f5;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
}
|
||||
::v-deep .el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
::v-deep .el-dialog__footer {
|
||||
padding: 0;
|
||||
}
|
||||
::v-deep .el-dialog__headerbtn {
|
||||
top: 12px;
|
||||
}
|
||||
.titleText {
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
font-weight: bold;
|
||||
color: #4c4949;
|
||||
padding-left: 15px;
|
||||
font-size: 16px;
|
||||
position: relative;
|
||||
&::before {
|
||||
position: absolute;
|
||||
top: 3.8px;
|
||||
left: 0;
|
||||
content: "";
|
||||
width: 5px;
|
||||
height: 15px;
|
||||
background: #f8414d;
|
||||
}
|
||||
}
|
||||
.center-content {
|
||||
padding: 20px 30px;
|
||||
header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 14px;
|
||||
.icons {
|
||||
height: 14px;
|
||||
width: 14px;
|
||||
background-image: url("../../../../assets/images/hdxx.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.icons1 {
|
||||
background-image: url("../../../../assets/images/rypp.png");
|
||||
}
|
||||
.icons2 {
|
||||
background-image: url("../../../../assets/images/baoming1.png");
|
||||
}
|
||||
span {
|
||||
margin-left: 10px;
|
||||
color: #4c4949;
|
||||
font-weight: bold;
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
}
|
||||
}
|
||||
.mainsEvents {
|
||||
// height: 35px;
|
||||
display: flex;
|
||||
// align-items: center;
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
margin-bottom: 20px;
|
||||
|
||||
.itemE {
|
||||
position: relative;
|
||||
width: 50%;
|
||||
display: flex;
|
||||
& > div:nth-of-type(1) {
|
||||
display: flex;
|
||||
// align-items: center;
|
||||
color: #4c4949;
|
||||
width: 24%;
|
||||
}
|
||||
& > div:nth-last-of-type(2) {
|
||||
color: #807a7a;
|
||||
}
|
||||
}
|
||||
}
|
||||
.mainsTitle {
|
||||
margin-bottom: 12px;
|
||||
display: flex;
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
& > div:nth-of-type(1) {
|
||||
color: #807a7a;
|
||||
width: 12%;
|
||||
}
|
||||
& > div:nth-of-type(2) {
|
||||
width: 50%;
|
||||
color: #606266;
|
||||
white-space: nowrap; /* 不换行 */
|
||||
overflow: hidden; /* 超出部分隐藏 */
|
||||
text-overflow: ellipsis; /* 溢出显示省略号 */
|
||||
}
|
||||
}
|
||||
.noneStyle {
|
||||
height: 200px;
|
||||
margin-bottom: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: "Alibaba-PuHuiTi-Medium.otf";
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
}
|
||||
.mainPeople {
|
||||
overflow: auto;
|
||||
// height: 200px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 12px;
|
||||
.subMan {
|
||||
width: 100%;
|
||||
min-height: 95px;
|
||||
background: #fafafa;
|
||||
border: 1px solid #f5edeb;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
margin-bottom: 10px;
|
||||
.leftSub {
|
||||
width: 84%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.leftAvatar {
|
||||
width: 20%;
|
||||
min-height: 95px;
|
||||
background-size: 100% 100%;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.leftName {
|
||||
width: 80%;
|
||||
|
||||
margin-left: 15px;
|
||||
& > div:nth-of-type(1) {
|
||||
font-family: "Alibaba-PuHuiTi-Medium.otf";
|
||||
color: #4c4949;
|
||||
font-size: 18px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
& > div:nth-of-type(2) {
|
||||
margin-bottom: -15px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.rightSub {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
.numPercen {
|
||||
display: flex;
|
||||
// align-items: flex-end;
|
||||
align-items: center;
|
||||
& > span:nth-of-type(1) {
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
font-weight: 400;
|
||||
color: #8a8585;
|
||||
margin-right: 10px;
|
||||
}
|
||||
& > span:nth-of-type(2) {
|
||||
font-family: "youshebiaotihei";
|
||||
color: #49b28f;
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
.itemBtn {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
.look {
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
color: #188ffe;
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
padding: 5px 10px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
.looks {
|
||||
background: #fff;
|
||||
border-radius: 4px;
|
||||
color: #49b28f;
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
padding: 5px 10px;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
::-webkit-scrollbar {
|
||||
width: 5px;
|
||||
}
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: #e5d3d4;
|
||||
}
|
||||
::-webkit-scrollbar-track {
|
||||
background: #f4f1f1;
|
||||
}
|
||||
.btn-list {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.btn-text {
|
||||
margin-right: 4px;
|
||||
cursor: pointer;
|
||||
padding: 3px 6px;
|
||||
background: #fff;
|
||||
font-size: 13px;
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,72 @@
|
||||
<!--
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: JC9527
|
||||
* @Date: 2023-09-18 10:08:30
|
||||
* @LastEditors: JC9527
|
||||
* @LastEditTime: 2023-09-22 14:36:35
|
||||
-->
|
||||
<template>
|
||||
<div class="plan-management">
|
||||
<div class="plan-bottomBox">
|
||||
<component :is="defaultRouter" :value="input" ref="myComponents"></component>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import inviteView from '../../components/invite.vue'
|
||||
import recommendView from '../../components/recommend.vue'
|
||||
export default {
|
||||
components:{inviteView,recommendView},
|
||||
data() {
|
||||
return {
|
||||
input: '',
|
||||
activeName: 'recommendView',
|
||||
defaultRouter:'recommendView',
|
||||
isClick:false,
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
// 输入框的值
|
||||
changeInput(value){
|
||||
this.input = value;
|
||||
this.isClick = true;
|
||||
},
|
||||
// 监听输入框是否清空
|
||||
changeValue(value){
|
||||
if(this.isClick && value == ''){
|
||||
this.$refs.myComponents.getList('1')
|
||||
this.isClick = false;
|
||||
}
|
||||
},
|
||||
handleClick() {
|
||||
this.defaultRouter = this.activeName
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
console.log(this.$store.getters.userId);
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.plan-management {
|
||||
padding: 0 20px 10px 20px;
|
||||
background-color: #fff;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border-radius: 10px 10px 0 0;
|
||||
box-shadow: 0px 0px 15px 0px rgba(229,212,212,0.58);
|
||||
.plan-topBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20px 0 0 0;
|
||||
::v-deep .el-tabs--top {
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
.plan-bottomBox {
|
||||
margin-top: 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,73 @@
|
||||
<!--
|
||||
* @Descripttion:
|
||||
* @version:
|
||||
* @Author: JC9527
|
||||
* @Date: 2023-09-18 10:08:30
|
||||
* @LastEditors: JC9527
|
||||
* @LastEditTime: 2023-09-22 14:36:35
|
||||
-->
|
||||
<template>
|
||||
<div class="plan-management">
|
||||
<div class="plan-bottomBox">
|
||||
<component :is="defaultRouter" :value="input" ref="myComponents"></component>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import inviteView from '../../components/invite.vue'
|
||||
import recommendView from '../../components/recommend.vue'
|
||||
import myInput from "@/views/components/myInput/index.vue"
|
||||
export default {
|
||||
components:{inviteView,recommendView,myInput},
|
||||
data() {
|
||||
return {
|
||||
input: '',
|
||||
activeName: 'inviteView',
|
||||
defaultRouter:'inviteView',
|
||||
isClick:false,
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
// 输入框的值
|
||||
changeInput(value){
|
||||
this.input = value;
|
||||
this.isClick = true;
|
||||
},
|
||||
// 监听输入框是否清空
|
||||
changeValue(value){
|
||||
if(this.isClick && value == ''){
|
||||
this.$refs.myComponents.getList('1')
|
||||
this.isClick = false;
|
||||
}
|
||||
},
|
||||
handleClick() {
|
||||
this.defaultRouter = this.activeName
|
||||
}
|
||||
},
|
||||
async created() {
|
||||
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.plan-management {
|
||||
padding: 0 20px 10px 20px;
|
||||
background-color: #fff;
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
border-radius: 10px 10px 0 0;
|
||||
box-shadow: 0px 0px 15px 0px rgba(229,212,212,0.58);
|
||||
.plan-topBox {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20px 0 0 0;
|
||||
::v-deep .el-tabs--top {
|
||||
height: 40px;
|
||||
}
|
||||
}
|
||||
.plan-bottomBox {
|
||||
margin-top: 30px;
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,379 @@
|
||||
<template>
|
||||
<div class="app-container" ref="apps">
|
||||
<div class="titleInput" ref="titleInput">
|
||||
<el-input
|
||||
placeholder="请输入姓名"
|
||||
v-model="afterParams.nickName"
|
||||
class="input-with-select"
|
||||
>
|
||||
<el-button
|
||||
slot="append"
|
||||
icon="el-icon-search"
|
||||
@click="search"
|
||||
></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
<div v-loading="loads">
|
||||
<div class="peopleContent" v-if="arrList.length > 0">
|
||||
<div class="subMan" v-for="(item, index) in arrList" :key="index">
|
||||
<div class="leftSub">
|
||||
<div
|
||||
class="leftAvatar"
|
||||
:style="`background-image:url('${require('../../../../assets/images/profile.jpg')}')`"
|
||||
></div>
|
||||
<div class="leftName">
|
||||
<div>{{item.nickName}}</div>
|
||||
<div class="mainTag">
|
||||
<!-- <div>{{ item.ageRange }}</div>
|
||||
<div>
|
||||
{{ item.sexRange }}
|
||||
</div>
|
||||
<div>{{ item.educationRange }}</div> -->
|
||||
<div
|
||||
v-show="itema != ''"
|
||||
v-for="(itema, index) in item.arrlist"
|
||||
:key="index"
|
||||
>
|
||||
{{ itema }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="rightSub">
|
||||
<div class="lookDetail" @click="looks(item.id)">查看</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="noneStyle">暂无数据</div>
|
||||
</div>
|
||||
|
||||
<div class="pagination" ref="pagination">
|
||||
<my-pagination :total="total" @pagesChange="pagesChange"></my-pagination>
|
||||
</div>
|
||||
<!-- 查看该人员的详情 -->
|
||||
<el-dialog
|
||||
:visible.sync="peopelDetail"
|
||||
width="40%"
|
||||
@close="cancel"
|
||||
:destroy-on-close="true"
|
||||
>
|
||||
<div slot="title">
|
||||
<div class="titleText">查看人员详情</div>
|
||||
</div>
|
||||
<div class="center-content">
|
||||
<el-descriptions class="margin-top" :column="2" border>
|
||||
<el-descriptions-item
|
||||
v-for="(item, index) in beforeData"
|
||||
:key="index"
|
||||
>
|
||||
<template slot="label"> {{ item.name }} </template>
|
||||
{{ item.value }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { peopleList, peopleGet } from "@/api/volunteer/hdgl";
|
||||
import myPagination from "@/views/components/myPagination/index.vue";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
arrList: [],
|
||||
form: {
|
||||
pageSize: 10,
|
||||
pageNum: 1,
|
||||
},
|
||||
afterParams: {
|
||||
nickName: "",
|
||||
},
|
||||
total: 0,
|
||||
loads: false,
|
||||
//=========
|
||||
peopelDetail: false,
|
||||
beforeData: [
|
||||
{
|
||||
name: "年龄",
|
||||
label: "ageRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "文化程度",
|
||||
label: "educationRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "小区",
|
||||
label: "housingRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "行业类型",
|
||||
label: "industryRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "兴趣爱好",
|
||||
label: "interestRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "国籍",
|
||||
label: "nationalityRange",
|
||||
value: "",
|
||||
},
|
||||
|
||||
{
|
||||
name: "政治面貌",
|
||||
label: "politicalRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "专业类型",
|
||||
label: "professionalRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "院校",
|
||||
label: "schoolRange",
|
||||
value: "",
|
||||
},
|
||||
{
|
||||
name: "性别",
|
||||
label: "sexRange",
|
||||
value: "",
|
||||
},
|
||||
],
|
||||
arr: [
|
||||
"ageRange",
|
||||
"sexRange",
|
||||
"politicalRange",
|
||||
"educationRange",
|
||||
"housingRange",
|
||||
"industryRange",
|
||||
"interestRange",
|
||||
"professionalRange",
|
||||
"schoolRange",
|
||||
"nationalityRange",
|
||||
],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
cancel() {
|
||||
this.peopelDetail = false;
|
||||
},
|
||||
looks(e) {
|
||||
peopleGet(e).then((res) => {
|
||||
this.beforeData.forEach((value, index) => {
|
||||
for (let key in res.data) {
|
||||
if (value.label == key) {
|
||||
this.beforeData[index].value = res.data[key];
|
||||
}
|
||||
}
|
||||
});
|
||||
this.peopelDetail = true;
|
||||
});
|
||||
},
|
||||
search() {
|
||||
this.form = { ...this.form, ...this.afterParams };
|
||||
this.getList();
|
||||
this.afterParams.nickName = ""
|
||||
|
||||
},
|
||||
//标签生成
|
||||
labelgenerate(data = {}) {
|
||||
let arrlist = [];
|
||||
for (let key3 of this.arr) {
|
||||
for (let key4 in data) {
|
||||
if (key3 == key4) {
|
||||
let a = data[key3];
|
||||
arrlist.push(a);
|
||||
}
|
||||
}
|
||||
}
|
||||
return arrlist;
|
||||
},
|
||||
getList() {
|
||||
this.loads = true;
|
||||
peopleList(this.form).then((res) => {
|
||||
this.arrList = res.rows;
|
||||
console.log(this.arrList);
|
||||
if (this.arrList.length > 0) {
|
||||
this.arrList.forEach((item) => {
|
||||
item.arrlist = this.labelgenerate(item);
|
||||
});
|
||||
}
|
||||
this.total = res.total;
|
||||
this.loads = false;
|
||||
});
|
||||
},
|
||||
pagesChange(e) {
|
||||
this.form.pageNum = e.pageNum;
|
||||
this.form.pageSize = e.pageSize;
|
||||
this.getList();
|
||||
},
|
||||
},
|
||||
components: {
|
||||
myPagination,
|
||||
},
|
||||
|
||||
mounted() {},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.noneStyle {
|
||||
height: 490px;
|
||||
margin-bottom: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-family: "Alibaba-PuHuiTi-Medium.otf";
|
||||
color: #606266;
|
||||
font-size: 14px;
|
||||
}
|
||||
.center-content {
|
||||
padding: 20px 30px;
|
||||
}
|
||||
::v-deep .margin-top td {
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
}
|
||||
::v-deep .margin-top th {
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
width: 20%;
|
||||
}
|
||||
::v-deep .el-dialog {
|
||||
border-radius: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
::v-deep .el-dialog__header {
|
||||
padding: 10px;
|
||||
padding-left: 15px;
|
||||
background: #f7f5f5;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
}
|
||||
::v-deep .el-dialog__body {
|
||||
padding: 0;
|
||||
}
|
||||
::v-deep .el-dialog__footer {
|
||||
padding: 0;
|
||||
}
|
||||
::v-deep .el-dialog__headerbtn {
|
||||
top: 12px;
|
||||
}
|
||||
.titleText {
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
font-weight: bold;
|
||||
color: #4c4949;
|
||||
padding-left: 15px;
|
||||
font-size: 16px;
|
||||
position: relative;
|
||||
&::before {
|
||||
position: absolute;
|
||||
top: 3.8px;
|
||||
left: 0;
|
||||
content: "";
|
||||
width: 5px;
|
||||
height: 15px;
|
||||
background: #f8414d;
|
||||
}
|
||||
}
|
||||
::v-deep .titleInput .el-input__inner {
|
||||
border-right: none;
|
||||
}
|
||||
::v-deep .titleInput .el-input-group__append {
|
||||
background: #f8414d;
|
||||
border: none;
|
||||
color: #fff;
|
||||
}
|
||||
.titleInput {
|
||||
width: 30%;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.mainTag {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
font-family: "Alibaba-PuHuiTi-Regular";
|
||||
& > div {
|
||||
margin-bottom: 5px;
|
||||
margin-right: 5px;
|
||||
background-color: rgba(248, 65, 77, 0.06);
|
||||
padding: 3px 5px;
|
||||
color: #e16a70;
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
.peopleContent {
|
||||
// height: 490px;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
align-content: flex-start;
|
||||
overflow-y: auto;
|
||||
|
||||
.subMan {
|
||||
width: 49.2%;
|
||||
height: 20.4%;
|
||||
background: #fafafa;
|
||||
border: 1px solid #f5edeb;
|
||||
border-radius: 10px;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 17px;
|
||||
padding: 15px;
|
||||
.leftSub {
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
.leftAvatar {
|
||||
min-height: 100px;
|
||||
min-width: 100px;
|
||||
background-size: 100% 100%;
|
||||
border-radius: 10px;
|
||||
}
|
||||
.leftName {
|
||||
margin-left: 15px;
|
||||
& > div:nth-of-type(1) {
|
||||
font-family: "Alibaba-PuHuiTi-Medium.otf";
|
||||
color: #4c4949;
|
||||
font-size: 18px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
& > div:nth-of-type(2) {
|
||||
margin-bottom: -10px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.rightSub {
|
||||
flex: 1.5;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.lookDetail {
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
background: #ffffff;
|
||||
box-shadow: 0px 0px 15px 0px rgba(77, 161, 254, 0.17);
|
||||
border-radius: 50%;
|
||||
font-family: "Alibaba-PuHuiTi-Medium.otf";
|
||||
font-weight: 400;
|
||||
color: #188ffe;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
user-select: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
@ -0,0 +1,486 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<!-- <el-form-item label="字典名称" prop="dictType">
|
||||
<el-select v-model="queryParams.dictType">
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.dictId"
|
||||
:label="item.dictName"
|
||||
:value="item.dictType"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="字典标签" prop="dictLabel">
|
||||
<el-input
|
||||
v-model="queryParams.dictLabel"
|
||||
placeholder="请输入字典标签"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="数据状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
>新增</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:dict:export']"
|
||||
>导出</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-close"
|
||||
size="mini"
|
||||
@click="handleClose"
|
||||
>关闭</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="字典编码" align="center" prop="dictCode" />
|
||||
<el-table-column label="字典标签" align="center" prop="dictLabel">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
v-if="
|
||||
(scope.row.listClass == '' || scope.row.listClass == 'default') &&
|
||||
(scope.row.cssClass == '' || scope.row.cssClass == null)
|
||||
"
|
||||
>{{ scope.row.dictLabel }}</span
|
||||
>
|
||||
<el-tag
|
||||
v-else
|
||||
:type="scope.row.listClass == 'primary' ? '' : scope.row.listClass"
|
||||
:class="scope.row.cssClass"
|
||||
>{{ scope.row.dictLabel }}</el-tag
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字典键值" align="center" prop="dictValue" />
|
||||
<el-table-column label="字典排序" align="center" prop="dictSort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.sys_normal_disable"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
prop="remark"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dict:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:dict:remove']"
|
||||
>删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="字典类型">
|
||||
<el-input v-model="form.dictType" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据标签" prop="dictLabel">
|
||||
<el-input v-model="form.dictLabel" placeholder="请输入数据标签" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据键值" prop="dictValue">
|
||||
<el-input v-model="form.dictValue" placeholder="请输入数据键值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="样式属性" prop="cssClass">
|
||||
<el-input v-model="form.cssClass" placeholder="请输入样式属性" />
|
||||
</el-form-item>
|
||||
<el-form-item label="显示排序" prop="dictSort">
|
||||
<el-input-number
|
||||
v-model="form.dictSort"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="回显样式" prop="listClass">
|
||||
<el-select v-model="form.listClass">
|
||||
<el-option
|
||||
v-for="item in listClassOptions"
|
||||
:key="item.value"
|
||||
:label="item.label + '(' + item.value + ')'"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listData,
|
||||
getData,
|
||||
delData,
|
||||
addData,
|
||||
updateData,
|
||||
} from "@/api/system/dict/data";
|
||||
import {
|
||||
optionselect as getDictOptionselect,
|
||||
getType,
|
||||
} from "@/api/system/dict/type";
|
||||
|
||||
export default {
|
||||
name: "Data",
|
||||
dicts: ["sys_normal_disable"],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 字典表格数据
|
||||
dataList: [],
|
||||
// 默认字典类型
|
||||
defaultDictType: "",
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 数据标签回显样式
|
||||
listClassOptions: [
|
||||
{
|
||||
value: "default",
|
||||
label: "默认",
|
||||
},
|
||||
{
|
||||
value: "primary",
|
||||
label: "主要",
|
||||
},
|
||||
{
|
||||
value: "success",
|
||||
label: "成功",
|
||||
},
|
||||
{
|
||||
value: "info",
|
||||
label: "信息",
|
||||
},
|
||||
{
|
||||
value: "warning",
|
||||
label: "警告",
|
||||
},
|
||||
{
|
||||
value: "danger",
|
||||
label: "危险",
|
||||
},
|
||||
],
|
||||
// 类型数据字典
|
||||
typeOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
dictName: undefined,
|
||||
dictType: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
dictLabel: [
|
||||
{ required: true, message: "数据标签不能为空", trigger: "blur" },
|
||||
],
|
||||
dictValue: [
|
||||
{ required: true, message: "数据键值不能为空", trigger: "blur" },
|
||||
],
|
||||
dictSort: [
|
||||
{ required: true, message: "数据顺序不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
const dictId = this.$route.params && this.$route.params.dictId;
|
||||
this.getType(dictId);
|
||||
this.getTypeList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询字典类型详细 */
|
||||
getType(dictId) {
|
||||
getType(dictId).then((response) => {
|
||||
this.queryParams.dictType = response.data.dictType;
|
||||
this.defaultDictType = response.data.dictType;
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 查询字典类型列表 */
|
||||
getTypeList() {
|
||||
getDictOptionselect().then((response) => {
|
||||
this.typeOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 查询字典数据列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listData(this.queryParams).then((response) => {
|
||||
this.dataList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
dictCode: undefined,
|
||||
dictLabel: undefined,
|
||||
dictValue: undefined,
|
||||
cssClass: undefined,
|
||||
listClass: "default",
|
||||
dictSort: 0,
|
||||
status: "0",
|
||||
remark: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 返回按钮操作 */
|
||||
handleClose() {
|
||||
const obj = { path: "/volunteer/userbq/dictGl" };
|
||||
this.$tab.closeOpenPage(obj);
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.dictType = this.defaultDictType;
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加字典数据";
|
||||
this.form.dictType = this.queryParams.dictType;
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.dictCode);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const dictCode = row.dictCode || this.ids;
|
||||
getData(dictCode).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改字典数据";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.dictCode != undefined) {
|
||||
updateData(this.form).then((response) => {
|
||||
this.$store.dispatch(
|
||||
"dict/removeDict",
|
||||
this.queryParams.dictType
|
||||
);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addData(this.form).then((response) => {
|
||||
this.$store.dispatch(
|
||||
"dict/removeDict",
|
||||
this.queryParams.dictType
|
||||
);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const dictCodes = row.dictCode || this.ids;
|
||||
this.$modal
|
||||
.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?')
|
||||
.then(function () {
|
||||
return delData(dictCodes);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.$store.dispatch("dict/removeDict", this.queryParams.dictType);
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"system/dict/data/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`data_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -0,0 +1,439 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="字典名称" prop="dictName">
|
||||
<el-input
|
||||
v-model="queryParams.dictName"
|
||||
placeholder="请输入字典名称"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="字典类型" prop="dictType">
|
||||
<el-input
|
||||
v-model="queryParams.dictType"
|
||||
placeholder="请输入字典类型"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="字典状态"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="创建时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item> -->
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:dict:add']"
|
||||
>新增</el-button>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:dict:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:dict:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:dict:export']"
|
||||
>导出</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-refresh"
|
||||
size="mini"
|
||||
@click="handleRefreshCache"
|
||||
v-hasPermi="['system:dict:remove']"
|
||||
>刷新缓存</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="typeList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="字典编号" align="center" prop="dictId" />
|
||||
<el-table-column
|
||||
label="字典名称"
|
||||
align="center"
|
||||
prop="dictName"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<router-link
|
||||
:to="'/volunteer/zyzsjgl/zdgl/' + scope.row.dictId"
|
||||
class="link-type"
|
||||
>
|
||||
<span>{{ scope.row.dictName }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="字典类型"
|
||||
align="center"
|
||||
:show-overflow-tooltip="true"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<router-link
|
||||
:to="'/volunteer/zyzsjgl/zdgl/' + scope.row.dictId"
|
||||
class="link-type"
|
||||
>
|
||||
<span>{{ scope.row.dictType }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.sys_normal_disable"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
prop="remark"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<router-link
|
||||
:to="'/volunteer/zyzsjgl/zdgl/' + scope.row.dictId"
|
||||
class="link-type"
|
||||
>
|
||||
<el-button size="mini" type="text" icon="el-icon-edit"
|
||||
>修改</el-button
|
||||
>
|
||||
</router-link>
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dict:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:dict:remove']"
|
||||
>删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="字典名称" prop="dictName">
|
||||
<el-input v-model="form.dictName" placeholder="请输入字典名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="字典类型" prop="dictType">
|
||||
<el-input v-model="form.dictType" placeholder="请输入字典类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listType2,
|
||||
getType,
|
||||
delType,
|
||||
addType,
|
||||
updateType,
|
||||
refreshCache,
|
||||
} from "@/api/system/dict/type";
|
||||
import delgdata from "./data.vue";
|
||||
export default {
|
||||
name: "Dict",
|
||||
dicts: ["sys_normal_disable"],
|
||||
components: { delgdata },
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 字典表格数据
|
||||
typeList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
dictName: undefined,
|
||||
dictType: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
dictName: [
|
||||
{ required: true, message: "字典名称不能为空", trigger: "blur" },
|
||||
],
|
||||
dictType: [
|
||||
{ required: true, message: "字典类型不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询字典类型列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listType2(this.addDateRange(this.queryParams, this.dateRange)).then(
|
||||
(response) => {
|
||||
this.typeList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
dictId: undefined,
|
||||
dictName: undefined,
|
||||
dictType: undefined,
|
||||
status: undefined,
|
||||
remark: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加字典类型";
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.dictId);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const dictId = row.dictId || this.ids;
|
||||
getType(dictId).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改字典类型";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.dictId != undefined) {
|
||||
updateType(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addType(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const dictIds = row.dictId || this.ids;
|
||||
this.$modal
|
||||
.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?')
|
||||
.then(function () {
|
||||
return delType(dictIds);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"system/dict/type/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`type_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
/** 刷新缓存按钮操作 */
|
||||
handleRefreshCache() {
|
||||
refreshCache().then(() => {
|
||||
this.$modal.msgSuccess("刷新成功");
|
||||
this.$store.dispatch("dict/cleanDict");
|
||||
});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
@ -0,0 +1,490 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="字典名称" prop="dictType">
|
||||
<el-select v-model="queryParams.dictType">
|
||||
<el-option
|
||||
v-for="item in typeOptions"
|
||||
:key="item.dictId"
|
||||
:label="item.dictName"
|
||||
:value="item.dictType"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="字典标签" prop="dictLabel">
|
||||
<el-input
|
||||
v-model="queryParams.dictLabel"
|
||||
placeholder="请输入字典标签"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="数据状态"
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-search"
|
||||
size="mini"
|
||||
@click="handleQuery"
|
||||
>搜索</el-button
|
||||
>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
|
||||
>重置</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['system:dict:add']"
|
||||
>新增</el-button>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['system:dict:edit']"
|
||||
>修改</el-button>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['system:dict:remove']"
|
||||
>删除</el-button>
|
||||
</el-col> -->
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['system:dict:export']"
|
||||
>导出</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-close"
|
||||
size="mini"
|
||||
@click="handleClose"
|
||||
>关闭</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="dataList"
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="字典编码" align="center" prop="dictCode" />
|
||||
<el-table-column label="字典标签" align="center" prop="dictLabel">
|
||||
<template slot-scope="scope">
|
||||
<span
|
||||
v-if="
|
||||
(scope.row.listClass == '' || scope.row.listClass == 'default') &&
|
||||
(scope.row.cssClass == '' || scope.row.cssClass == null)
|
||||
"
|
||||
>{{ scope.row.dictLabel }}</span
|
||||
>
|
||||
<el-tag
|
||||
v-else
|
||||
:type="scope.row.listClass == 'primary' ? '' : scope.row.listClass"
|
||||
:class="scope.row.cssClass"
|
||||
>{{ scope.row.dictLabel }}</el-tag
|
||||
>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="字典键值" align="center" prop="dictValue" />
|
||||
<el-table-column label="字典排序" align="center" prop="dictSort" />
|
||||
<el-table-column label="状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag
|
||||
:options="dict.type.sys_normal_disable"
|
||||
:value="scope.row.status"
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="备注"
|
||||
align="center"
|
||||
prop="remark"
|
||||
:show-overflow-tooltip="true"
|
||||
/>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
align="center"
|
||||
prop="createTime"
|
||||
width="180"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.createTime) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
class-name="small-padding fixed-width"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dict:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
<!-- <el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:dict:remove']"
|
||||
>删除</el-button> -->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改参数配置对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="字典类型">
|
||||
<el-input v-model="form.dictType" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据标签" prop="dictLabel">
|
||||
<el-input v-model="form.dictLabel" placeholder="请输入数据标签" />
|
||||
</el-form-item>
|
||||
<el-form-item label="数据键值" prop="dictValue">
|
||||
<el-input v-model="form.dictValue" placeholder="请输入数据键值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="样式属性" prop="cssClass">
|
||||
<el-input v-model="form.cssClass" placeholder="请输入样式属性" />
|
||||
</el-form-item>
|
||||
<el-form-item label="显示排序" prop="dictSort">
|
||||
<el-input-number
|
||||
v-model="form.dictSort"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="回显样式" prop="listClass">
|
||||
<el-select v-model="form.listClass">
|
||||
<el-option
|
||||
v-for="item in listClassOptions"
|
||||
:key="item.value"
|
||||
:label="item.label + '(' + item.value + ')'"
|
||||
:value="item.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-radio-group v-model="form.status">
|
||||
<el-radio
|
||||
v-for="dict in dict.type.sys_normal_disable"
|
||||
:key="dict.value"
|
||||
:label="dict.value"
|
||||
>{{ dict.label }}</el-radio
|
||||
>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input
|
||||
v-model="form.remark"
|
||||
type="textarea"
|
||||
placeholder="请输入内容"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listData,
|
||||
getData,
|
||||
delData,
|
||||
addData,
|
||||
updateData,
|
||||
} from "@/api/system/dict/data";
|
||||
import {
|
||||
optionselect as getDictOptionselect,
|
||||
getType,
|
||||
} from "@/api/system/dict/type";
|
||||
|
||||
export default {
|
||||
name: "Data",
|
||||
dicts: ["sys_normal_disable"],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 字典表格数据
|
||||
dataList: [],
|
||||
// 默认字典类型
|
||||
defaultDictType: "",
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 数据标签回显样式
|
||||
listClassOptions: [
|
||||
{
|
||||
value: "default",
|
||||
label: "默认",
|
||||
},
|
||||
{
|
||||
value: "primary",
|
||||
label: "主要",
|
||||
},
|
||||
{
|
||||
value: "success",
|
||||
label: "成功",
|
||||
},
|
||||
{
|
||||
value: "info",
|
||||
label: "信息",
|
||||
},
|
||||
{
|
||||
value: "warning",
|
||||
label: "警告",
|
||||
},
|
||||
{
|
||||
value: "danger",
|
||||
label: "危险",
|
||||
},
|
||||
],
|
||||
// 类型数据字典
|
||||
typeOptions: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
dictName: undefined,
|
||||
dictType: undefined,
|
||||
status: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
dictLabel: [
|
||||
{ required: true, message: "数据标签不能为空", trigger: "blur" },
|
||||
],
|
||||
dictValue: [
|
||||
{ required: true, message: "数据键值不能为空", trigger: "blur" },
|
||||
],
|
||||
dictSort: [
|
||||
{ required: true, message: "数据顺序不能为空", trigger: "blur" },
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
const dictId = this.$route.params && this.$route.params.dictId;
|
||||
this.getType(dictId);
|
||||
this.getTypeList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询字典类型详细 */
|
||||
getType(dictId) {
|
||||
getType(dictId).then((response) => {
|
||||
this.queryParams.dictType = response.data.dictType;
|
||||
this.defaultDictType = response.data.dictType;
|
||||
this.getList();
|
||||
});
|
||||
},
|
||||
/** 查询字典类型列表 */
|
||||
getTypeList() {
|
||||
getDictOptionselect().then((response) => {
|
||||
this.typeOptions = response.data;
|
||||
});
|
||||
},
|
||||
/** 查询字典数据列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listData(this.queryParams).then((response) => {
|
||||
this.dataList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
dictCode: undefined,
|
||||
dictLabel: undefined,
|
||||
dictValue: undefined,
|
||||
cssClass: undefined,
|
||||
listClass: "default",
|
||||
dictSort: 0,
|
||||
status: "0",
|
||||
remark: undefined,
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 返回按钮操作 */
|
||||
handleClose() {
|
||||
const obj = { path: "/volunteer/zyzsjgl/zdgl" };
|
||||
this.$tab.closeOpenPage(obj);
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.dictType = this.defaultDictType;
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加字典数据";
|
||||
this.form.dictType = this.queryParams.dictType;
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map((item) => item.dictCode);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const dictCode = row.dictCode || this.ids;
|
||||
getData(dictCode).then((response) => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改字典数据";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.dictCode != undefined) {
|
||||
updateData(this.form).then((response) => {
|
||||
this.$store.dispatch(
|
||||
"dict/removeDict",
|
||||
this.queryParams.dictType
|
||||
);
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addData(this.form).then((response) => {
|
||||
this.$store.dispatch(
|
||||
"dict/removeDict",
|
||||
this.queryParams.dictType
|
||||
);
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const dictCodes = row.dictCode || this.ids;
|
||||
this.$modal
|
||||
.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?')
|
||||
.then(function () {
|
||||
return delData(dictCodes);
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.$store.dispatch("dict/removeDict", this.queryParams.dictType);
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download(
|
||||
"system/dict/data/export",
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`data_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|