Compare commits
3 Commits
f124eeb48d
...
7e1dc44569
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7e1dc44569 | ||
![]() |
d27d68d8d0 | ||
0f8c188be6 |
13
components.d.ts
vendored
13
components.d.ts
vendored
@ -20,7 +20,6 @@ declare module '@vue/runtime-core' {
|
|||||||
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
|
ElBreadcrumbItem: typeof import('element-plus/es')['ElBreadcrumbItem']
|
||||||
ElButton: typeof import('element-plus/es')['ElButton']
|
ElButton: typeof import('element-plus/es')['ElButton']
|
||||||
ElCard: typeof import('element-plus/es')['ElCard']
|
ElCard: typeof import('element-plus/es')['ElCard']
|
||||||
ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
|
|
||||||
ElCol: typeof import('element-plus/es')['ElCol']
|
ElCol: typeof import('element-plus/es')['ElCol']
|
||||||
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
|
||||||
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
|
||||||
@ -38,24 +37,15 @@ declare module '@vue/runtime-core' {
|
|||||||
ElOption: typeof import('element-plus/es')['ElOption']
|
ElOption: typeof import('element-plus/es')['ElOption']
|
||||||
ElPagination: typeof import('element-plus/es')['ElPagination']
|
ElPagination: typeof import('element-plus/es')['ElPagination']
|
||||||
ElProgress: typeof import('element-plus/es')['ElProgress']
|
ElProgress: typeof import('element-plus/es')['ElProgress']
|
||||||
ElRadio: typeof import('element-plus/es')['ElRadio']
|
|
||||||
ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
|
|
||||||
ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
|
|
||||||
ElRate: typeof import('element-plus/es')['ElRate']
|
|
||||||
ElRow: typeof import('element-plus/es')['ElRow']
|
ElRow: typeof import('element-plus/es')['ElRow']
|
||||||
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
|
||||||
ElSelect: typeof import('element-plus/es')['ElSelect']
|
ElSelect: typeof import('element-plus/es')['ElSelect']
|
||||||
ElSlider: typeof import('element-plus/es')['ElSlider']
|
|
||||||
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
|
||||||
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
ElSwitch: typeof import('element-plus/es')['ElSwitch']
|
||||||
ElTable: typeof import('element-plus/es')['ElTable']
|
ElTable: typeof import('element-plus/es')['ElTable']
|
||||||
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
ElTableColumn: typeof import('element-plus/es')['ElTableColumn']
|
||||||
ElTabPane: typeof import('element-plus/es')['ElTabPane']
|
|
||||||
ElTabs: typeof import('element-plus/es')['ElTabs']
|
|
||||||
ElTag: typeof import('element-plus/es')['ElTag']
|
ElTag: typeof import('element-plus/es')['ElTag']
|
||||||
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
ElTooltip: typeof import('element-plus/es')['ElTooltip']
|
||||||
ElTree: typeof import('element-plus/es')['ElTree']
|
|
||||||
ElUpload: typeof import('element-plus/es')['ElUpload']
|
|
||||||
ErrorLog: typeof import('./src/components/ErrorLog/index.vue')['default']
|
ErrorLog: typeof import('./src/components/ErrorLog/index.vue')['default']
|
||||||
GithubCorner: typeof import('./src/components/GithubCorner/index.vue')['default']
|
GithubCorner: typeof import('./src/components/GithubCorner/index.vue')['default']
|
||||||
Hamburger: typeof import('./src/components/Hamburger/index.vue')['default']
|
Hamburger: typeof import('./src/components/Hamburger/index.vue')['default']
|
||||||
@ -82,7 +72,4 @@ declare module '@vue/runtime-core' {
|
|||||||
UploadExcel: typeof import('./src/components/UploadExcel/index.vue')['default']
|
UploadExcel: typeof import('./src/components/UploadExcel/index.vue')['default']
|
||||||
VueCountTo: typeof import('./src/components/vue-count-to/vue-countTo.vue')['default']
|
VueCountTo: typeof import('./src/components/vue-count-to/vue-countTo.vue')['default']
|
||||||
}
|
}
|
||||||
export interface ComponentCustomProperties {
|
|
||||||
vLoading: typeof import('element-plus/es')['ElLoadingDirective']
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
24
src/api/charge.js
Normal file
24
src/api/charge.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
function getCurrentTimestamp() {
|
||||||
|
return new Date().getTime();
|
||||||
|
}
|
||||||
|
|
||||||
|
const api = 'http://nbxt.oa.x-lf.cn'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取我参与的项目列表
|
||||||
|
*
|
||||||
|
* @param token 访问令牌
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const getChargeProjectList = (token)=> {
|
||||||
|
return axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `${api}/project/participate/get`,
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${token}`,
|
||||||
|
'Timestamp':getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
@ -48,14 +48,14 @@ export const getproject = (projectId, token) => {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取项目信息
|
* 获取我管理页面的项目列表(接口有问题)
|
||||||
* @param projectId 项目id
|
*
|
||||||
* @param token 访问令牌
|
* @param token 访问令牌
|
||||||
* @returns {Promise<AxiosResponse<any>> | *}
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
*/
|
*/
|
||||||
export const searchModel = (projectId ,token) => {
|
export const getManageList = (token) => {
|
||||||
return axios({
|
return axios({
|
||||||
url: api +"/module/get?projectId=" + projectId ,
|
url: api +"/project/child/get" ,
|
||||||
method: "get",
|
method: "get",
|
||||||
headers: {
|
headers: {
|
||||||
'Authorization': 'Bearer ' + token,
|
'Authorization': 'Bearer ' + token,
|
||||||
@ -69,3 +69,71 @@ export const searchModel = (projectId ,token) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 我管理的所有接口
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取我管理的页面的搜索
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @param token 访问令牌
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
export const getManageListById = (projectId, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api +'/project/get/' + projectId,
|
||||||
|
method: "get",
|
||||||
|
headers: {
|
||||||
|
'Authorization': 'Bearer ' + token,
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取我管理的页面的项目列表
|
||||||
|
*
|
||||||
|
* @param projectId 项目id
|
||||||
|
* @param token 访问令牌
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
export const getManageProjectList = (token) => {
|
||||||
|
return axios({
|
||||||
|
url: api +'/project/child/get' ,
|
||||||
|
method: "get",
|
||||||
|
headers: {
|
||||||
|
'Authorization': 'Bearer ' + token,
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取我管理的页面的子模块项目列表(接口没数据)
|
||||||
|
*
|
||||||
|
* @param token 访问令牌
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
export const getProjectList = (token) => {
|
||||||
|
return axios({
|
||||||
|
url: api +"/project/module/get" ,
|
||||||
|
method: "get",
|
||||||
|
headers: {
|
||||||
|
'Authorization': 'Bearer ' + token,
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
15
src/api/message.js
Normal file
15
src/api/message.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
|
||||||
|
|
||||||
|
function getCurrentTimestamp() {
|
||||||
|
return new Date().getTime();
|
||||||
|
}
|
||||||
|
export function login(data) {
|
||||||
|
return request({
|
||||||
|
url: '/message/get',
|
||||||
|
method: 'post',
|
||||||
|
data,
|
||||||
|
headers: {
|
||||||
|
'Timestamp':getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
843
src/api/request.js
Normal file
843
src/api/request.js
Normal file
@ -0,0 +1,843 @@
|
|||||||
|
import axios from "axios";
|
||||||
|
import getCurrentTimestamp from "@/js/methods.js";
|
||||||
|
|
||||||
|
const api = 'http://nbxt.oa.x-lf.cn'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 登录
|
||||||
|
* @param data (user,password)
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
const login = (data) => {
|
||||||
|
return axios({
|
||||||
|
url: api+"/auth/login",
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 注册
|
||||||
|
* @param data (username,password,address,phone,email,sex,age)
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
const register = (data) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/auth/register",
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退出登录
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const logout = (token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/auth/logout",
|
||||||
|
method: "get",
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改密码
|
||||||
|
* @param data (oldPassword,newPassword,confirmPassword)
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const changePassword = (data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/auth/password",
|
||||||
|
method: "put",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 忘记密码
|
||||||
|
* @param data (email,check(邮箱验证码),newPassword)
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
const forgetPassword = (data) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/auth/password/forget",
|
||||||
|
method: "put",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'content-type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 邮箱登录
|
||||||
|
* @param params 对象(包含邮箱email:string,验证码code:integer)
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
const authLoginWithEmail = (params) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/auth/login/email",
|
||||||
|
method: "get",
|
||||||
|
params: params,
|
||||||
|
headers: {
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 发送邮箱验证码
|
||||||
|
* @param email 邮箱(string)
|
||||||
|
* @returns {*}
|
||||||
|
*/
|
||||||
|
const authSendEmailCode = (email) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/auth/email/code",
|
||||||
|
method: "get",
|
||||||
|
params: email,
|
||||||
|
headers: {
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取全部用户信息
|
||||||
|
* @param data (page,limit,search,role)
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const userAllCurrent = (data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/user/current/all",
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer ' + token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取一个用户信息(敏感)
|
||||||
|
* @param params (id,username,email,phone)可以只传一个参数
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const userCurrent = (params, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/user/current",
|
||||||
|
method: "get",
|
||||||
|
params: params,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
// 'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增用户
|
||||||
|
* @param data (username,password,address,phone,email,sex,age)必须全部
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const userAdd = (data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/user/add",
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑用户
|
||||||
|
* @param data (id,address,phone,email,age,signature,sex,avatar,nickname,description
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const userEdit = (data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/user/edit",
|
||||||
|
method: "put",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除用户
|
||||||
|
* @param id
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const userDelete = (id, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/user/delete",
|
||||||
|
method: "delete",
|
||||||
|
params: {
|
||||||
|
id: id
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'content-type':'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 锁定用户
|
||||||
|
* @param data (id,isLock(1解锁))
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const userLock = (data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/user/lock",
|
||||||
|
method: "put",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取用户信息(非敏感)
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const userGetProfile = (token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/user/profile/get",
|
||||||
|
method: "get",
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户信息(普通用户)
|
||||||
|
* @param data (id,username,address,phone,email,sex,age,signature,avatar,nickname,description)
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const userEditProfile = (data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/user/profile/edit",
|
||||||
|
method: "put",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询角色
|
||||||
|
* @param id 可选,不填则是查询所有?
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const roleGet = (id, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/role/get",
|
||||||
|
method: "get",
|
||||||
|
params: id,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增角色
|
||||||
|
* @param data (name,displayName)示例(name:teacher, displayName:老师)必须
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const roleAdd = (data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/role/add",
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑角色
|
||||||
|
* @param data (id,name,displayName(中文))必须
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const roleEdit = (data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/role/edit",
|
||||||
|
method: "put",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除角色
|
||||||
|
* @param id
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const roleDelete = (id, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/role/delete",
|
||||||
|
method: "delete",
|
||||||
|
params: id,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 给角色添加用户
|
||||||
|
* @param data (rid,uid)
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const roleAddUser = (data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/role/user/add",
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改用户的角色
|
||||||
|
* @param data (uid,rid)
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const roleChangeUser = (data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/role/user/change",
|
||||||
|
method: "put",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 移除用户的角色
|
||||||
|
* @param uid
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const roleRemoveUser = (uid, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/role/user/remove",
|
||||||
|
method: "delete",
|
||||||
|
data: uid,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询轮播图(管理员)
|
||||||
|
* @param id 可选
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const infoGetHeaderImage = (id, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/info/header-image/get",
|
||||||
|
method: "get",
|
||||||
|
params: id,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑轮播图信息
|
||||||
|
* @param data (id,displayOrder(排序顺序),image(图片地址),title,description,isActive(是否启用))
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const infoEditHeaderImage = ( data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/info/header-image/edit",
|
||||||
|
method: "put",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增轮播图
|
||||||
|
* @param data (displayOrder,image,title,description,isActive)
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const infoAddHeaderImage = (data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/info/header-image/add",
|
||||||
|
method: "post",
|
||||||
|
data: data,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除轮播图
|
||||||
|
* @param id
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const infoDeleteHeaderImage = (id, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/info/header-image/del",
|
||||||
|
method: "delete",
|
||||||
|
params: id,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 展示轮播图,顺序或倒序
|
||||||
|
* @param showType 0倒序,1顺序
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const infoEditSettingHeaderImage = (showType, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/info/header-image/edit-setting",
|
||||||
|
method: "put",
|
||||||
|
data: showType,
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 展示我负责的项目
|
||||||
|
* @param data
|
||||||
|
* @param token
|
||||||
|
*/
|
||||||
|
const projectGet =(data, token) => {
|
||||||
|
const tags = data.tags
|
||||||
|
const isFinish = data.isFinish
|
||||||
|
// const principalUser = data.principalId
|
||||||
|
const encodedTags = tags.map(tag => encodeURIComponent(tag));
|
||||||
|
const encodedIsFinish = isFinish.map(is => encodeURIComponent(is))
|
||||||
|
const queryTags = `tags=${encodedTags.join('&tags=')}`;
|
||||||
|
const queryIsFinish = `isFinish=${encodedIsFinish.join('&isFinish=')}`;
|
||||||
|
return axios({
|
||||||
|
url:api+ `/project/get?${queryTags}&${queryIsFinish}`,
|
||||||
|
method: "get",
|
||||||
|
headers:{
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增项目
|
||||||
|
* @param token
|
||||||
|
* @param data
|
||||||
|
*/
|
||||||
|
const projectAdd =(token,data) => {
|
||||||
|
return axios({
|
||||||
|
url:api+ "/project/add",
|
||||||
|
method: "post",
|
||||||
|
data:data,
|
||||||
|
headers:{
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 展示游客查看的项目
|
||||||
|
*/
|
||||||
|
const projectGetCustom = (data) =>{
|
||||||
|
const tags = data.tags
|
||||||
|
const isFinish = data.isFinish
|
||||||
|
// const principalUser = data.principalId
|
||||||
|
const encodedTags = tags.map(tag => encodeURIComponent(tag));
|
||||||
|
const encodedIsFinish = isFinish.map(is => encodeURIComponent(is))
|
||||||
|
const queryTags = `tags=${encodedTags.join('&tags=')}`;
|
||||||
|
const queryIsFinish = `isFinish=${encodedIsFinish.join('&isFinish=')}`;
|
||||||
|
return axios({
|
||||||
|
url:`${api}/project/get/custom?id=${data.id}&${queryTags}&${queryIsFinish}`,
|
||||||
|
method: "get",
|
||||||
|
headers:{
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// projectGetCustom().interceptors.request.use(config => {
|
||||||
|
// let url = config.url
|
||||||
|
// if (config.params) {
|
||||||
|
// url += '?'
|
||||||
|
// const keys = Object.keys(config.params)
|
||||||
|
// for (const key of keys) {
|
||||||
|
// url += `${key}=${encodeURIComponent(config.params[key])}&`
|
||||||
|
// }
|
||||||
|
// url = url.substring(0, url.length-1)
|
||||||
|
// config.params = {}
|
||||||
|
// }
|
||||||
|
// config.url = url
|
||||||
|
// return config
|
||||||
|
// })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 展示全部消息
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
const messageGet = (token) => {
|
||||||
|
return axios({
|
||||||
|
url:api + "/message/get",
|
||||||
|
method:"get",
|
||||||
|
headers:{
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'content-type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 得到tag列表
|
||||||
|
* @param token
|
||||||
|
*/
|
||||||
|
const getTagsProjectList = () =>{
|
||||||
|
return axios({
|
||||||
|
url:api+ "/tags/project/list",
|
||||||
|
method: "get",
|
||||||
|
headers:{
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 得到tag列表
|
||||||
|
* @param data
|
||||||
|
* @param token
|
||||||
|
* 获取项目的所有子系统
|
||||||
|
*/
|
||||||
|
// const projectWorkGet = (data,token) => {
|
||||||
|
// return axios({
|
||||||
|
// url:api + "/project/work/get",
|
||||||
|
// method:"get",
|
||||||
|
// data:data,
|
||||||
|
// headers:{
|
||||||
|
// 'Authorization':'Bearer '+token,
|
||||||
|
// 'content-type': 'application/json;charset=utf-8',
|
||||||
|
// 'Timestamp': getCurrentTimestamp()
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// }
|
||||||
|
|
||||||
|
const projectWorkGet = (data,token) =>{
|
||||||
|
const tags = data.tags
|
||||||
|
const isFinish = data.isFinish
|
||||||
|
const encodedTags = tags.map(tag => encodeURIComponent(tag));
|
||||||
|
const encodedIsFinish = isFinish.map(is => encodeURIComponent(is))
|
||||||
|
const queryTags = `tags=${encodedTags.join('&tags=')}`;
|
||||||
|
const queryIsFinish = `isFinish=${encodedIsFinish.join('&isFinish=')}`;
|
||||||
|
return axios({
|
||||||
|
url:`${api}/project/work/get?${queryTags}&${queryIsFinish}`,
|
||||||
|
method: "get",
|
||||||
|
headers:{
|
||||||
|
'content-type': 'application/json;charset=utf-8',
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目id获取项目信息
|
||||||
|
* @param id 项目id
|
||||||
|
* @param token 访问令牌
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const projectGetById = (id, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/project/get/id?id=" + id,
|
||||||
|
method: "get",
|
||||||
|
headers: {
|
||||||
|
'Authorization': 'Bearer ' + token,
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const projectWorkAdd = (data, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/project/work/add" ,
|
||||||
|
method: "post",
|
||||||
|
data:data,
|
||||||
|
headers: {
|
||||||
|
'Authorization': 'Bearer ' + token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// data(id)
|
||||||
|
const projectDelete = (id, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/project/delete" ,
|
||||||
|
method: "delete",
|
||||||
|
params: {
|
||||||
|
id: id
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'Authorization': 'Bearer ' + token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据项目id获取子系统的所有信息
|
||||||
|
* @param projectId
|
||||||
|
* @param token
|
||||||
|
*/
|
||||||
|
const moduleGetByProjectId = (projectId, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/module/get?projectId=" + projectId,
|
||||||
|
method: "get",
|
||||||
|
// params: {
|
||||||
|
// projectId: projectId
|
||||||
|
// },
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据子系统id获取子模块信息
|
||||||
|
* @param sysId
|
||||||
|
* @param token
|
||||||
|
*/
|
||||||
|
const moduleGetBySysId = (sysId, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/module/get/min?sysId=" + sysId,
|
||||||
|
methods:"get",
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*const moduleGetByProjectId = (projectId, token) => {
|
||||||
|
return axios ({
|
||||||
|
url:api + "/module/get",
|
||||||
|
methods:"get",
|
||||||
|
params:projectId,
|
||||||
|
headers:{
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
'content-type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
const moduleDelete = (id, token) =>{
|
||||||
|
return axios({
|
||||||
|
url: api + "/module/delete/" + id,
|
||||||
|
method: "delete",
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp(),
|
||||||
|
'Authorization':'Bearer '+ token
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取模块/子系统信息
|
||||||
|
* @param id
|
||||||
|
* @param token
|
||||||
|
* @returns {Promise<axios.AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
const getModuleInfo = (id, token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/project/getwork/id",
|
||||||
|
method: 'get',
|
||||||
|
params: {
|
||||||
|
id: id
|
||||||
|
},
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
// 'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const getPrincipalUser = (token) => {
|
||||||
|
return axios({
|
||||||
|
url: api + "/project/pri",
|
||||||
|
method: 'get',
|
||||||
|
headers: {
|
||||||
|
'Authorization':'Bearer '+token,
|
||||||
|
// 'Content-Type': 'application/json;charset=utf-8',
|
||||||
|
'Timestamp': getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
|
||||||
|
login,
|
||||||
|
register,
|
||||||
|
logout,
|
||||||
|
changePassword,
|
||||||
|
forgetPassword,
|
||||||
|
authLoginWithEmail,
|
||||||
|
authSendEmailCode,
|
||||||
|
|
||||||
|
userAllCurrent,
|
||||||
|
userCurrent,
|
||||||
|
userAdd,
|
||||||
|
userEdit,
|
||||||
|
userDelete,
|
||||||
|
userLock,
|
||||||
|
userGetProfile,
|
||||||
|
userEditProfile,
|
||||||
|
|
||||||
|
roleGet,
|
||||||
|
roleEdit,
|
||||||
|
roleAdd,
|
||||||
|
roleDelete,
|
||||||
|
roleAddUser,
|
||||||
|
roleChangeUser,
|
||||||
|
roleRemoveUser,
|
||||||
|
|
||||||
|
infoGetHeaderImage,
|
||||||
|
infoEditHeaderImage,
|
||||||
|
infoAddHeaderImage,
|
||||||
|
infoDeleteHeaderImage,
|
||||||
|
infoEditSettingHeaderImage,
|
||||||
|
|
||||||
|
|
||||||
|
projectGet,
|
||||||
|
projectGetCustom,
|
||||||
|
projectAdd,
|
||||||
|
projectGetById,
|
||||||
|
projectWorkAdd,
|
||||||
|
getTagsProjectList,
|
||||||
|
projectWorkGet,
|
||||||
|
projectDelete,
|
||||||
|
|
||||||
|
|
||||||
|
moduleGetByProjectId,
|
||||||
|
moduleGetBySysId,
|
||||||
|
moduleDelete,
|
||||||
|
getModuleInfo,
|
||||||
|
|
||||||
|
messageGet,
|
||||||
|
getPrincipalUser
|
||||||
|
|
||||||
|
}
|
@ -2,7 +2,7 @@
|
|||||||
<div class="navbar">
|
<div class="navbar">
|
||||||
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"
|
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"
|
||||||
@toggleClick="toggleSidebar" />
|
@toggleClick="toggleSidebar" />
|
||||||
|
<!-- 面包屑导航 -->
|
||||||
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
|
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
|
||||||
|
|
||||||
<div class="right-menu">
|
<div class="right-menu">
|
||||||
|
@ -11,6 +11,7 @@ const Layout = ():RouteComponent => import('@/layout/index.vue');
|
|||||||
// import chartsRouter from './modules/charts';
|
// import chartsRouter from './modules/charts';
|
||||||
// import nestedRouter from './modules/nested';
|
// import nestedRouter from './modules/nested';
|
||||||
// import tableRouter from './modules/table';
|
// import tableRouter from './modules/table';
|
||||||
|
import manageRouter from './modules/manage';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constantRoutes
|
* constantRoutes
|
||||||
@ -113,110 +114,10 @@ export const constantRoutes:RouteRecordRaw[] = [
|
|||||||
* 注意:hidden、alwaysShow 属性配置移动到了meta中!!!
|
* 注意:hidden、alwaysShow 属性配置移动到了meta中!!!
|
||||||
*/
|
*/
|
||||||
export const asyncRoutes:RouteRecordRaw[] = [
|
export const asyncRoutes:RouteRecordRaw[] = [
|
||||||
// {
|
|
||||||
// path: '/permission',
|
|
||||||
// component: Layout,
|
|
||||||
// redirect: '/permission/page',
|
|
||||||
// name: 'Permission',
|
|
||||||
// meta: {
|
|
||||||
// alwaysShow: true, // will always show the root menu
|
|
||||||
// title: 'Permission',
|
|
||||||
// icon: 'lock',
|
|
||||||
// roles: ['admin', 'editor','teacher_user'] // you can set roles in root nav
|
|
||||||
// },
|
|
||||||
// children: [
|
|
||||||
// {
|
|
||||||
// path: 'page',
|
|
||||||
// component: () => import('@/views/permission/page.vue'),
|
|
||||||
// name: 'PagePermission',
|
|
||||||
// meta: {
|
|
||||||
// title: 'Page Permission',
|
|
||||||
// roles: ['admin','teacher_user'] // or you can only set roles in sub nav
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// path: 'directive',
|
|
||||||
// component: () => import('@/views/permission/directive.vue'),
|
|
||||||
// name: 'DirectivePermission',
|
|
||||||
// meta: {
|
|
||||||
// title: 'Directive Permission'
|
|
||||||
// // if do not set roles, means: this page does not require permission
|
|
||||||
// }
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// path: 'role',
|
|
||||||
// component: () => import('@/views/permission/role.vue'),
|
|
||||||
// name: 'RolePermission',
|
|
||||||
// meta: {
|
|
||||||
// title: 'Role Permission',
|
|
||||||
// roles: ['admin','teacher']
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// ]
|
|
||||||
// },
|
|
||||||
|
|
||||||
// 个人项目
|
|
||||||
{
|
|
||||||
path: '/myself',
|
manageRouter,
|
||||||
component: Layout,
|
|
||||||
redirect: 'noRedirect',
|
|
||||||
meta: {
|
|
||||||
alwaysShow: false, // 始终显示根菜单
|
|
||||||
title: '个人项目',
|
|
||||||
icon: 'nested',
|
|
||||||
roles: ['admin', 'teacher_user']
|
|
||||||
},
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: 'participate',
|
|
||||||
component: () => import('@/views/personal/project/participate.vue'),
|
|
||||||
name: 'participate',
|
|
||||||
meta: { title: '我负责的', icon: 'user', affix: true }
|
|
||||||
},
|
|
||||||
//我管理的以及子页面
|
|
||||||
{
|
|
||||||
path: 'manage',
|
|
||||||
component: () => import('@/views/personal/project/manage.vue'),
|
|
||||||
name: 'Manage',
|
|
||||||
meta: { title: '我管理的', icon: 'user', affix: true, },
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'childSysManage',
|
|
||||||
component: () => import('@/views/personal/project/childSystem/manage.vue'),
|
|
||||||
name: 'ChildSysManage',
|
|
||||||
meta: { title: '子系统', breadcrumb: true , hidden: true },
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'childModManage',
|
|
||||||
component: () => import('@/views/personal/project/childModel/manage.vue'),
|
|
||||||
name: 'ChildModManage',
|
|
||||||
meta: { title: '子模块', breadcrumb: true , hidden: true }
|
|
||||||
},
|
|
||||||
//我参与的以及子界面
|
|
||||||
{
|
|
||||||
path: 'charge',
|
|
||||||
component: () => import('@/views/personal/project/charge.vue'),
|
|
||||||
name: 'Charge',
|
|
||||||
meta: { title: '我参与的', icon: 'user', affix: true }
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'childSysCharge',
|
|
||||||
component: () => import('@/views/personal/project/childSystem/manage.vue'),
|
|
||||||
name: 'ChildSysCharge',
|
|
||||||
meta: { title: '子系统', breadcrumb: true , hidden: true },
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: 'childModCharge',
|
|
||||||
component: () => import('@/views/personal/project/childModel/manage.vue'),
|
|
||||||
name: 'ChildModCharge',
|
|
||||||
meta: { title: '子模块', breadcrumb: true , hidden: true }
|
|
||||||
},
|
|
||||||
]
|
|
||||||
}
|
|
||||||
,
|
|
||||||
|
|
||||||
|
|
||||||
// {
|
// {
|
||||||
|
81
src/router/modules/manage.ts
Normal file
81
src/router/modules/manage.ts
Normal file
@ -0,0 +1,81 @@
|
|||||||
|
|
||||||
|
|
||||||
|
const Layout = () => import('@/layout/index.vue')
|
||||||
|
|
||||||
|
const manageRouter = {
|
||||||
|
path: '/myslef',
|
||||||
|
component: Layout,
|
||||||
|
|
||||||
|
|
||||||
|
meta: {
|
||||||
|
alwaysShow: false, // 始终显示根菜单
|
||||||
|
title: '个人项目',
|
||||||
|
icon: 'nested',
|
||||||
|
roles: ['admin', 'teacher_user']
|
||||||
|
},
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: 'participate',
|
||||||
|
component: () => import('@/views/personal/project/participate.vue'),
|
||||||
|
name: 'participate',
|
||||||
|
meta: { title: '我负责的', icon: 'user', affix: true }
|
||||||
|
},
|
||||||
|
//我管理的以及子页面
|
||||||
|
|
||||||
|
{
|
||||||
|
path: 'manage',
|
||||||
|
component: () => import('@/views/personal/project/manage.vue'),
|
||||||
|
name: 'Manage',
|
||||||
|
meta: { title: '我管理的', icon: 'user', affix: true, },
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'childSysManage',
|
||||||
|
component: () => import('@/views/personal/project/childSystem/manage.vue'),
|
||||||
|
name: 'ChildSysManage',
|
||||||
|
meta: { title: '我管理的 / 子系统', breadcrumb: true , hidden: true },
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'childModManage',
|
||||||
|
component: () => import('@/views/personal/project/childModel/manage.vue'),
|
||||||
|
name: 'ChildModManage',
|
||||||
|
meta: { title: '我管理的 / 子系统 / 子模块', breadcrumb: true , hidden: true }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path:'manageDetail',
|
||||||
|
component:()=>import('@/views/personal/project/detail/manage.vue'),
|
||||||
|
name: 'ManageDetail',
|
||||||
|
meta: { title: '我管理的 / 子系统 / 子模块 / 详情', breadcrumb: true , hidden: true }
|
||||||
|
},
|
||||||
|
//我参与的以及子界面
|
||||||
|
{
|
||||||
|
path: 'charge',
|
||||||
|
component: () => import('@/views/personal/project/charge.vue'),
|
||||||
|
name: 'Charge',
|
||||||
|
meta: { title: '我参与的', icon: 'user', affix: true }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'childSysCharge',
|
||||||
|
component: () => import('@/views/personal/project/childSystem/charge.vue'),
|
||||||
|
name: 'ChildSysCharge',
|
||||||
|
meta: { title: '我参与的 / 子系统', breadcrumb: true , hidden: true ,affix:false},
|
||||||
|
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'childModCharge',
|
||||||
|
component: () => import('@/views/personal/project/childModel/charge.vue'),
|
||||||
|
name: 'ChildModCharge',
|
||||||
|
meta: { title: '我参与的 / 子系统 / 子模块', breadcrumb: true , hidden: true }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'chargeDetail',
|
||||||
|
component:()=>import('@/views/personal/project/detail/charge.vue'),
|
||||||
|
name: 'ChargeDetail',
|
||||||
|
meta: { title: '我参与的 / 子系统 / 子模块 /详情', breadcrumb: true , hidden: true }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default manageRouter
|
@ -5,7 +5,7 @@
|
|||||||
<template #header>
|
<template #header>
|
||||||
<span>消息</span>
|
<span>消息</span>
|
||||||
</template>
|
</template>
|
||||||
<div style="display:flex;flex-direction:row;justify-content: space-around ">
|
<div style="display:flex;flex-direction:row;justify-content: space-between ">
|
||||||
<div>
|
<div>
|
||||||
时间
|
时间
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@ -20,23 +20,23 @@
|
|||||||
style="margin-left:0.5vw"
|
style="margin-left:0.5vw"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<!-- <div>-->
|
||||||
状态
|
<!-- 状态-->
|
||||||
<el-select
|
<!-- <el-select-->
|
||||||
v-model="value"
|
<!-- v-model="value"-->
|
||||||
clearable
|
<!-- clearable-->
|
||||||
placeholder="Status"
|
<!-- placeholder="Status"-->
|
||||||
style="width: 240px;margin-left:0.5vw"
|
<!-- style="width: 240px;margin-left:0.5vw"-->
|
||||||
>
|
<!-- >-->
|
||||||
<el-option
|
<!-- <el-option-->
|
||||||
v-for="item in options"
|
<!-- v-for="item in options"-->
|
||||||
:key="item.value"
|
<!-- :key="item.value"-->
|
||||||
:label="item.label"
|
<!-- :label="item.label"-->
|
||||||
:value="item.value"
|
<!-- :value="item.value"-->
|
||||||
/>
|
<!-- />-->
|
||||||
</el-select>
|
<!-- </el-select>-->
|
||||||
|
|
||||||
</div>
|
<!-- </div>-->
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" style="width:80px">查询</el-button>
|
<el-button type="primary" style="width:80px">查询</el-button>
|
||||||
@ -58,14 +58,13 @@
|
|||||||
<div class="table-cell">
|
<div class="table-cell">
|
||||||
<div class="date" style="display:flex;flex-direction: column">
|
<div class="date" style="display:flex;flex-direction: column">
|
||||||
<span style="color:skyblue">{{row.name}}</span>
|
<span style="color:skyblue">{{row.name}}</span>
|
||||||
<span>{{ row.date }}</span>
|
<span>{{ row.text }}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-cell">
|
<div class="table-cell createdTime">
|
||||||
<div>address: {{ row.address }}</div>
|
<div>{{ row.createdAt }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="table-cell table-cell-right">
|
<div class="table-cell table-cell-right">
|
||||||
<el-button size="small" type="danger" @click="handleDelete(index, row)">Delete</el-button>
|
|
||||||
<el-button size="small" type="danger" @click="handleDelete(index, row);centerDialogVisible = true">Delete</el-button>
|
<el-button size="small" type="danger" @click="handleDelete(index, row);centerDialogVisible = true">Delete</el-button>
|
||||||
<el-dialog v-model="centerDialogVisible" title="删除" width="500" :modal="false">
|
<el-dialog v-model="centerDialogVisible" title="删除" width="500" :modal="false">
|
||||||
<span>
|
<span>
|
||||||
@ -158,42 +157,43 @@ const options = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
// 表格
|
// 表格
|
||||||
interface User {
|
interface Message {
|
||||||
date: string
|
id: number
|
||||||
|
createdAt: string
|
||||||
name: string
|
name: string
|
||||||
address: string
|
text: string
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleDelete = (index: number, row: User) => {
|
const handleDelete = (index: number, row: Message) => {
|
||||||
console.log(index, row);
|
console.log(index, row);
|
||||||
};
|
};
|
||||||
|
|
||||||
const tableData: User[] = [
|
const tableData: Message[] = [
|
||||||
{
|
{
|
||||||
date: '2016-05-03',
|
id:1 ,
|
||||||
|
createdAt: '2016-05-03',
|
||||||
name: 'Tom',
|
name: 'Tom',
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
text: 'No. 189, Grove St, Los Angeles'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
date: '2016-05-02',
|
id:1 ,
|
||||||
name: 'Tom',
|
createdAt: '2016-05-03',
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
name: 'Tom',
|
||||||
},
|
text: 'No. 189, Grove St, Los Angeles'
|
||||||
{
|
},
|
||||||
date: '2016-05-04',
|
{
|
||||||
name: 'Tom',
|
id:1 ,
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
createdAt: '2016-05-03',
|
||||||
},
|
name: 'Tom',
|
||||||
{
|
text: 'No. 189, Grove St, Los Angeles'
|
||||||
date: '2016-05-01',
|
},
|
||||||
name: 'Tom',
|
{
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
id:1 ,
|
||||||
},
|
createdAt: '2016-05-03',
|
||||||
{
|
name: 'Tom',
|
||||||
date: '2016-05-01',
|
text: 'No. 189, Grove St, Los Angeles'
|
||||||
name: 'Tom',
|
},
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
@ -216,16 +216,19 @@ const tableData: User[] = [
|
|||||||
.table-row {
|
.table-row {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 10px;
|
/*margin-bottom: 10px;*/
|
||||||
}
|
}
|
||||||
|
|
||||||
.table-cell {
|
.table-cell {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 5px;
|
padding: 10px;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
|
.createdTime{
|
||||||
|
margin-left: 50px;
|
||||||
|
}
|
||||||
.table-cell-right {
|
.table-cell-right {
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
margin-right:5vw;
|
margin-right:5vw;
|
||||||
|
@ -1,136 +1,173 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style=" width:100%">
|
<div style=" width:100%">
|
||||||
<el-card style="max-width: 100vw;margin: 1.5vw;">
|
<el-card style="max-width: 100vw;margin: 1.5vw;">
|
||||||
<template #header><strong >我参与的</strong></template>
|
<template #header><strong>我参与的</strong></template>
|
||||||
<div style="display:flex;flex-direction:row;justify-content: space-around ">
|
<div style="display:flex;flex-direction:row;justify-content: space-around ">
|
||||||
<div>
|
<div>
|
||||||
名称
|
名称
|
||||||
<el-input v-model="input" style="width: 240px;margin-left:0.5vw" placeholder="请输入" />
|
<el-input v-model="input" style="width: 240px;margin-left:0.5vw" placeholder="请输入" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
状态
|
状态
|
||||||
<el-input v-model="input" style="width: 240px;margin-left:0.5vw" placeholder="请输入" />
|
<el-input v-model="input" style="width: 240px;margin-left:0.5vw" placeholder="请输入" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" style="width:80px">查询</el-button>
|
<el-button type="primary" style="width:80px">查询</el-button>
|
||||||
<el-button style="width:80px">重置</el-button>
|
<el-button style="width:80px">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</el-card>
|
|
||||||
<el-card style="max-width: 100vw;height:60vh;margin:1.3vw">
|
|
||||||
<div style="display:flex;flex-direction: row;justify-content: space-between">
|
|
||||||
<el-button
|
|
||||||
text
|
|
||||||
type=''
|
|
||||||
>项目列表</el-button
|
|
||||||
>
|
|
||||||
</div>
|
|
||||||
<el-table
|
|
||||||
ref="multipleTableRef"
|
|
||||||
:data="tableData"
|
|
||||||
style="max-width: 100vw;"
|
|
||||||
@selection-change="handleSelectionChange"
|
|
||||||
>
|
|
||||||
<!-- <el-table-column type="selection" width="55" />-->
|
|
||||||
<el-table-column label="序号" width="120">
|
|
||||||
<template #default="scope">{{ scope.row.date }}</template>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column property="name" label="项目名称" width="120" />
|
|
||||||
<el-table-column property="address" label="工作量" show-overflow-tooltip />
|
|
||||||
<el-table-column property="address" label="周期" />
|
|
||||||
<el-table-column property="address" label="负责人" />
|
|
||||||
<el-table-column property="address" label="状态" />
|
|
||||||
<el-table-column property="address" label="子系统简介" />
|
|
||||||
<el-table-column property="address" label="截止时间" />
|
|
||||||
<el-table-column property="address" label="操作" >
|
|
||||||
<el-button
|
|
||||||
link
|
|
||||||
style="color:deepskyblue"
|
|
||||||
@click="toChildSystem"
|
|
||||||
>查看详情</el-button
|
|
||||||
>
|
|
||||||
</el-table-column>
|
|
||||||
</el-table>
|
|
||||||
<el-pagination
|
|
||||||
larger
|
|
||||||
background
|
|
||||||
layout="prev, pager, next"
|
|
||||||
:total="50"
|
|
||||||
class="mt-4"
|
|
||||||
style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh"
|
|
||||||
/>
|
|
||||||
</el-card>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</el-card>
|
||||||
|
<el-card style="max-width: 100vw;height:60vh;margin:1.3vw">
|
||||||
<script lang="ts" setup>
|
<div style="display:flex;flex-direction: row;justify-content: space-between">
|
||||||
import { ref } from 'vue';
|
<el-button text type=''>项目列表</el-button>
|
||||||
import { ElTable } from 'element-plus';
|
</div>
|
||||||
import { useRouter } from 'vue-router';
|
<el-table ref="multipleTableRef" :data="tableData" style="max-width: 100vw;"
|
||||||
|
@selection-change="handleSelectionChange">
|
||||||
|
<!-- <el-table-column type="selection" width="55" />-->
|
||||||
|
<el-table-column label="序号" width="120">
|
||||||
|
<template #default="scope">{{ scope.row.date }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column property="name" label="项目名称" width="120" />
|
||||||
|
<el-table-column property="address" label="工作量" show-overflow-tooltip />
|
||||||
|
<el-table-column property="address" label="周期" />
|
||||||
|
<el-table-column property="address" label="负责人" />
|
||||||
|
<el-table-column property="address" label="状态"/>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column property="address" label="项目简介" />
|
||||||
|
<el-table-column property="address" label="截止时间" />
|
||||||
|
<el-table-column property="address" label="操作">
|
||||||
|
<el-button link style="color:deepskyblue" @click="toChildSystem">查看详情</el-button>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination larger background layout="prev, pager, next" :total="50" class="mt-4"
|
||||||
|
style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh" />
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { ElTable } from 'element-plus';
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
import { getManageList } from '@/api/manage.js';
|
||||||
|
import { getToken } from '@/utils/auth';
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
// 路由跳转
|
// 路由跳转
|
||||||
const toChildSystem = () => {
|
const toChildSystem = () => {
|
||||||
router.push({ name: 'ChildSysManage' }); // 跳转到子系统详情页面
|
router.push({ name: 'ChildSysCharge' }); // 跳转到子系统详情页面
|
||||||
};
|
};
|
||||||
|
|
||||||
const input = ref('');
|
const input = ref('');
|
||||||
|
|
||||||
interface User {
|
|
||||||
date: string
|
|
||||||
name: string
|
|
||||||
address: string
|
|
||||||
|
|
||||||
|
interface User {
|
||||||
|
id: number
|
||||||
|
cycle: number
|
||||||
|
name: string
|
||||||
|
description: string
|
||||||
|
workLoad: number
|
||||||
|
card: string
|
||||||
|
isFinish: number
|
||||||
|
principalUser: string
|
||||||
|
dateline: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const multipleTableRef = ref<InstanceType<typeof ElTable>>();
|
||||||
|
const multipleSelection = ref<User[]>([]);
|
||||||
|
|
||||||
|
const handleSelectionChange = (val: User[]) => {
|
||||||
|
multipleSelection.value = val;
|
||||||
|
};
|
||||||
|
|
||||||
|
//获取数据
|
||||||
|
const project = getManageList(getToken());
|
||||||
|
|
||||||
|
//响应式
|
||||||
|
const tableData = ref<User[]>([
|
||||||
|
//测试用例
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
cycle: 2,
|
||||||
|
name: "项目2",
|
||||||
|
description: "xxxxxxx",
|
||||||
|
workLoad: 12,
|
||||||
|
card: "java",
|
||||||
|
isFinish: 2,
|
||||||
|
principalUser: "teacher_user",
|
||||||
|
dateline: "2021-12-31"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 4,
|
||||||
|
cycle: 2,
|
||||||
|
name: "项目2",
|
||||||
|
description: "xxxxxxx",
|
||||||
|
workLoad: 12,
|
||||||
|
card: "java",
|
||||||
|
isFinish: 2,
|
||||||
|
principalUser: "teacher_user",
|
||||||
|
dateline: "2021-12-31"
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
]);
|
||||||
|
|
||||||
|
|
||||||
|
// 处理接口数据
|
||||||
|
project.then(res => {
|
||||||
|
|
||||||
|
const data = res.data;
|
||||||
|
console.log(data);
|
||||||
|
if (data) {
|
||||||
|
const dataProject: User = {
|
||||||
|
id: 4,
|
||||||
|
cycle: 2,
|
||||||
|
name: "项目2",
|
||||||
|
description: "xxxxxxx",
|
||||||
|
workLoad: 12,
|
||||||
|
card: "java",
|
||||||
|
isFinish: 2,
|
||||||
|
principalUser: "teacher_user",
|
||||||
|
dateline: "2021-12-31"
|
||||||
|
};
|
||||||
|
// 使用 tableData.value 进行添加
|
||||||
|
tableData.value.push(dataProject);
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
console.log("没有数据");
|
||||||
}
|
}
|
||||||
|
})
|
||||||
const multipleTableRef = ref<InstanceType<typeof ElTable>>();
|
.catch(err => {
|
||||||
const multipleSelection = ref<User[]>([]);
|
console.log(err);
|
||||||
|
});
|
||||||
const handleSelectionChange = (val: User[]) => {
|
|
||||||
multipleSelection.value = val;
|
|
||||||
};
|
</script>
|
||||||
|
<style>
|
||||||
const tableData: User[] = [
|
.my-autocomplete li {
|
||||||
{
|
line-height: normal;
|
||||||
date: '2016-05-03',
|
padding: 7px;
|
||||||
name: 'Tom',
|
}
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
|
||||||
},
|
.my-autocomplete li .name {
|
||||||
{
|
text-overflow: ellipsis;
|
||||||
date: '2016-05-02',
|
overflow: hidden;
|
||||||
name: 'Tom',
|
}
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
|
||||||
},
|
.my-autocomplete li .addr {
|
||||||
{
|
font-size: 12px;
|
||||||
date: '2016-05-04',
|
color: #b4b4b4;
|
||||||
name: 'Tom',
|
}
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
|
||||||
},
|
.my-autocomplete li .highlighted .addr {
|
||||||
{
|
color: #ddd;
|
||||||
date: '2016-05-01',
|
}
|
||||||
name: 'Tom',
|
</style>
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
|
||||||
}
|
|
||||||
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
.my-autocomplete li {
|
|
||||||
line-height: normal;
|
|
||||||
padding: 7px;
|
|
||||||
}
|
|
||||||
.my-autocomplete li .name {
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
.my-autocomplete li .addr {
|
|
||||||
font-size: 12px;
|
|
||||||
color: #b4b4b4;
|
|
||||||
}
|
|
||||||
.my-autocomplete li .highlighted .addr {
|
|
||||||
color: #ddd;
|
|
||||||
}
|
|
||||||
</style>
|
|
@ -41,7 +41,9 @@
|
|||||||
<el-pagination larger background layout="prev, pager, next" :total="50" class="mt-4"
|
<el-pagination larger background layout="prev, pager, next" :total="50" class="mt-4"
|
||||||
style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh" />
|
style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh" />
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-alert >
|
||||||
|
<router-view />
|
||||||
|
</el-alert>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -49,8 +51,8 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { ElTable } from 'element-plus';
|
import { ElTable } from 'element-plus';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { searchModel } from '@/api/manage.js';
|
// import { searchModel } from '@/api/manage.js';
|
||||||
import { getToken } from '@/utils/auth';
|
// import { getToken } from '@/utils/auth';
|
||||||
|
|
||||||
//跳转到子模块
|
//跳转到子模块
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@ -84,36 +86,50 @@ const handleSelectionChange = (val: User[]) => {
|
|||||||
|
|
||||||
//搜索子系统
|
//搜索子系统
|
||||||
//获取数据
|
//获取数据
|
||||||
const searchSys = searchModel(1, getToken());
|
|
||||||
|
|
||||||
|
|
||||||
console.log(searchSys);
|
|
||||||
|
|
||||||
const tableData = ref<User[]>([]);
|
// console.log(searchSys);
|
||||||
|
|
||||||
|
const tableData = ref<User[]>([
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
cycle: 1,
|
||||||
|
description: '子系统1',
|
||||||
|
isDelete: 0,
|
||||||
|
isFinish: 1,
|
||||||
|
name: '子系统1',
|
||||||
|
principalId: 1,
|
||||||
|
projectId: 1,
|
||||||
|
status: true,
|
||||||
|
type: 1,
|
||||||
|
workLoad: 1
|
||||||
|
}
|
||||||
|
]);
|
||||||
//处理数据
|
//处理数据
|
||||||
searchSys.then(res => {
|
// searchSys.then(res => {
|
||||||
const data = res.data.data;
|
// const data = res.data.data;
|
||||||
console.log(data);
|
// console.log(data);
|
||||||
|
|
||||||
if (data) {
|
// if (data) {
|
||||||
tableData.value = data.map(item =>{
|
// tableData.value = data.map(item =>{
|
||||||
const addproject: User = {
|
// const addproject: User = {
|
||||||
id: item.id,
|
// id: item.id,
|
||||||
cycle: item.cycle,
|
// cycle: item.cycle,
|
||||||
description: item.description,
|
// description: item.description,
|
||||||
isDelete: item.isDelete,
|
// isDelete: item.isDelete,
|
||||||
isFinish: item.isFinish,
|
// isFinish: item.isFinish,
|
||||||
name: item.name,
|
// name: item.name,
|
||||||
principalId: item.principalId,
|
// principalId: item.principalId,
|
||||||
projectId: item.projectId,
|
// projectId: item.projectId,
|
||||||
status: item.status,
|
// status: item.status,
|
||||||
type: item.type,
|
// type: item.type,
|
||||||
workLoad: item.workLoad
|
// workLoad: item.workLoad
|
||||||
};
|
// };
|
||||||
|
|
||||||
tableData.value.push(addproject);
|
// tableData.value.push(addproject);
|
||||||
|
|
||||||
})
|
// })
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -121,16 +137,16 @@ searchSys.then(res => {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
}else{
|
// }else{
|
||||||
console.log("没有数据");
|
// console.log("没有数据");
|
||||||
|
|
||||||
}
|
// }
|
||||||
|
|
||||||
console.log(tableData.value);
|
// console.log(tableData.value);
|
||||||
|
|
||||||
}).catch(err => {
|
// }).catch(err => {
|
||||||
console.log(err);
|
// console.log(err);
|
||||||
});
|
// });
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -0,0 +1,143 @@
|
|||||||
|
<template>
|
||||||
|
<div style=" width:100%">
|
||||||
|
<el-card style="max-width: 100vw;margin: 1.5vw;">
|
||||||
|
<template #header><strong >子系统1</strong></template>
|
||||||
|
<div style="display:flex;flex-direction:row;justify-content: space-around ">
|
||||||
|
<div>
|
||||||
|
名称
|
||||||
|
<el-input v-model="input" style="width: 240px;margin-left:0.5vw" placeholder="请输入" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
状态
|
||||||
|
<el-input v-model="input" style="width: 240px;margin-left:0.5vw" placeholder="请输入" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" style="width:80px">查询</el-button>
|
||||||
|
<el-button style="width:80px">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-card>
|
||||||
|
<el-card style="max-width: 100vw;height:60vh;margin:1.3vw">
|
||||||
|
<div style="display:flex;flex-direction: row;justify-content: space-between">
|
||||||
|
<el-button
|
||||||
|
text
|
||||||
|
type=''
|
||||||
|
|
||||||
|
>子模块列表</el-button
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<el-button type="primary" style="width:80px">新增</el-button>
|
||||||
|
<el-button style="width:80px ;background-color: #bd3124;color: azure;">删除</el-button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<el-table
|
||||||
|
ref="multipleTableRef"
|
||||||
|
:data="tableData"
|
||||||
|
style="max-width: 100vw;"
|
||||||
|
@selection-change="handleSelectionChange"
|
||||||
|
>
|
||||||
|
<!-- <el-table-column type="selection" width="55" />-->
|
||||||
|
<el-table-column label="序号" width="120">
|
||||||
|
<template #default="scope">{{ scope.row.date }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column property="name" label="子模块名称" width="120" />
|
||||||
|
<el-table-column property="address" label="工作量" show-overflow-tooltip />
|
||||||
|
<el-table-column property="address" label="周期" />
|
||||||
|
<el-table-column property="address" label="负责人" />
|
||||||
|
<el-table-column property="address" label="状态" />
|
||||||
|
<el-table-column property="address" label="子系统简介" />
|
||||||
|
<el-table-column property="address" label="截止时间" />
|
||||||
|
<el-table-column property="address" label="操作" >
|
||||||
|
<el-button
|
||||||
|
link
|
||||||
|
style="color:deepskyblue"
|
||||||
|
@click="toDetail"
|
||||||
|
>查看详情</el-button
|
||||||
|
>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<el-pagination
|
||||||
|
larger
|
||||||
|
background
|
||||||
|
layout="prev, pager, next"
|
||||||
|
:total="50"
|
||||||
|
class="mt-4"
|
||||||
|
style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh"
|
||||||
|
/>
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { ElTable } from 'element-plus';
|
||||||
|
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
// 路由跳转
|
||||||
|
const toDetail = () => {
|
||||||
|
router.push({ name: 'ChargeDetail' }); // 跳转到子系统详情页面
|
||||||
|
};
|
||||||
|
|
||||||
|
interface User {
|
||||||
|
date: string
|
||||||
|
name: string
|
||||||
|
address: string
|
||||||
|
}
|
||||||
|
|
||||||
|
const multipleTableRef = ref<InstanceType<typeof ElTable>>();
|
||||||
|
const multipleSelection = ref<User[]>([]);
|
||||||
|
|
||||||
|
const handleSelectionChange = (val: User[]) => {
|
||||||
|
multipleSelection.value = val;
|
||||||
|
};
|
||||||
|
|
||||||
|
const input = ref('');
|
||||||
|
|
||||||
|
const tableData: User[] = [
|
||||||
|
{
|
||||||
|
date: '2016-05-03',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-02',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-04',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
date: '2016-05-01',
|
||||||
|
name: 'Tom',
|
||||||
|
address: 'No. 189, Grove St, Los Angeles'
|
||||||
|
}
|
||||||
|
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.my-autocomplete li {
|
||||||
|
line-height: normal;
|
||||||
|
padding: 7px;
|
||||||
|
}
|
||||||
|
.my-autocomplete li .name {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.my-autocomplete li .addr {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #b4b4b4;
|
||||||
|
}
|
||||||
|
.my-autocomplete li .highlighted .addr {
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
</style>
|
@ -51,7 +51,7 @@
|
|||||||
<el-button
|
<el-button
|
||||||
link
|
link
|
||||||
style="color:deepskyblue"
|
style="color:deepskyblue"
|
||||||
@click=""
|
@click="toDetail"
|
||||||
>查看详情</el-button
|
>查看详情</el-button
|
||||||
>
|
>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@ -65,7 +65,7 @@
|
|||||||
style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh"
|
style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh"
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<router-view/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -73,8 +73,16 @@
|
|||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
import { ElTable } from 'element-plus';
|
import { ElTable } from 'element-plus';
|
||||||
|
|
||||||
|
import { useRouter } from 'vue-router';
|
||||||
|
|
||||||
|
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
// 路由跳转
|
||||||
|
const toDetail = () => {
|
||||||
|
router.push({ name: 'ManageDetail' }); // 跳转到子系统详情页面
|
||||||
|
};
|
||||||
|
|
||||||
interface User {
|
interface User {
|
||||||
date: string
|
date: string
|
||||||
name: string
|
name: string
|
||||||
|
101
src/views/personal/project/detail/charge.vue
Normal file
101
src/views/personal/project/detail/charge.vue
Normal file
@ -0,0 +1,101 @@
|
|||||||
|
<template>
|
||||||
|
<div style=" width:100%;">
|
||||||
|
<el-card style="max-width: 100vw;">
|
||||||
|
<template #header><strong>子模块1</strong></template>
|
||||||
|
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card class="card">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-row v-for="item in projectItems" :key="item.label">
|
||||||
|
<el-col :span="24">
|
||||||
|
<div style="margin-top: 10%;"><strong>{{ item.label }}</strong> </div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-row v-for="item in projectItems" :key="item.label">
|
||||||
|
<el-col :span="24">
|
||||||
|
<div v-if="item.label !== '05.状态' && item.label !== '07.简介'" style="margin-top: 10%;">{{
|
||||||
|
item.value
|
||||||
|
}}</div>
|
||||||
|
<el-select v-if="item.label === '05.状态'" v-model="selectedStatus" placeholder="请选择状态"
|
||||||
|
style="width: 150px ;margin-top: 10%">
|
||||||
|
<el-option label="未开始" value="未开始"></el-option>
|
||||||
|
<el-option label="进行中" value="进行中"></el-option>
|
||||||
|
<el-option label="已完成" value="已完成"></el-option>
|
||||||
|
<el-option label="异常暂停" value="异常暂停"></el-option>
|
||||||
|
</el-select>
|
||||||
|
<textarea style="resize: none;margin-top: 10%;width: 150px;" v-if="item.label === '07.简介'"
|
||||||
|
v-model="item.value" rows="4" cols="50"></textarea>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
<div style="display: flex; justify-content: center;">
|
||||||
|
<el-button type="primary" style="width:80px">编辑</el-button>
|
||||||
|
<el-button style="width:80px ;background-color: #bd3124;color: azure;">删除</el-button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
const projectItems = ref([
|
||||||
|
{ label: '01.模块名称', value: '名称1' },
|
||||||
|
{ label: '02.模块周期', value: '3个月' },
|
||||||
|
{ label: '03.工作量', value: '100小时' },
|
||||||
|
{ label: '04.负责人', value: '张三' },
|
||||||
|
{ label: '05.状态', value: '进行中' },
|
||||||
|
{ label: '06.时间', value: '2024-01-01 12:00:00' },
|
||||||
|
{ label: '07.简介', value: '大王iu大概iudg拍高端屁股的怕耽搁u对爬过文档爬过无' },
|
||||||
|
]);
|
||||||
|
|
||||||
|
const selectedStatus = ref('进行中');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.my-autocomplete li {
|
||||||
|
line-height: normal;
|
||||||
|
padding: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li .name {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li .addr {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #b4b4b4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li .highlighted .addr {
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
width: 28%;
|
||||||
|
margin-left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
</style>
|
103
src/views/personal/project/detail/manage.vue
Normal file
103
src/views/personal/project/detail/manage.vue
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
<template>
|
||||||
|
<div style=" width:100%;">
|
||||||
|
<el-card style="max-width: 100vw;">
|
||||||
|
<template #header><strong>子模块1</strong></template>
|
||||||
|
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
|
||||||
|
<el-card class="card">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-row v-for="item in projectItems" :key="item.label">
|
||||||
|
<el-col :span="24">
|
||||||
|
<div style="margin-top: 10%;"><strong>{{ item.label }}</strong> </div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="12">
|
||||||
|
<el-row v-for="item in projectItems" :key="item.label">
|
||||||
|
<el-col :span="24">
|
||||||
|
<div v-if="item.label !== '05.状态' && item.label !== '07.简介'" style="margin-top: 10%;">{{
|
||||||
|
item.value
|
||||||
|
}}</div>
|
||||||
|
<el-select v-if="item.label === '05.状态'" v-model="selectedStatus" placeholder="请选择状态"
|
||||||
|
style="width: 150px ;margin-top: 10%">
|
||||||
|
<el-option label="未开始" value="未开始"></el-option>
|
||||||
|
<el-option label="进行中" value="进行中"></el-option>
|
||||||
|
<el-option label="已完成" value="已完成"></el-option>
|
||||||
|
<el-option label="异常暂停" value="异常暂停"></el-option>
|
||||||
|
</el-select>
|
||||||
|
<textarea style="resize: none;margin-top: 10%;width: 150px;" v-if="item.label === '07.简介'"
|
||||||
|
v-model="item.value" rows="4" cols="50"></textarea>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</el-card>
|
||||||
|
<div style="display: flex; justify-content: center;">
|
||||||
|
<el-button type="primary" style="width:80px">编辑</el-button>
|
||||||
|
<el-button style="width:80px ;background-color: #bd3124;color: azure;">删除</el-button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<el-alert >
|
||||||
|
<router-view />
|
||||||
|
</el-alert>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
|
||||||
|
import { ref } from 'vue';
|
||||||
|
|
||||||
|
const projectItems = ref([
|
||||||
|
{ label: '01.模块名称', value: '项目名称1' },
|
||||||
|
{ label: '02.模块周期', value: '3个月' },
|
||||||
|
{ label: '03.工作量', value: '100小时' },
|
||||||
|
{ label: '04.负责人', value: '张三' },
|
||||||
|
{ label: '05.状态', value: '进行中' },
|
||||||
|
{ label: '06.时间', value: '2024-01-01 12:00:00' },
|
||||||
|
{ label: '07.简介', value: '大王iu大概iudg拍高端屁股的怕耽搁u对爬过文档爬过无' },
|
||||||
|
]);
|
||||||
|
|
||||||
|
const selectedStatus = ref('进行中');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</script>
|
||||||
|
<style>
|
||||||
|
.my-autocomplete li {
|
||||||
|
line-height: normal;
|
||||||
|
padding: 7px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li .name {
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li .addr {
|
||||||
|
font-size: 12px;
|
||||||
|
color: #b4b4b4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li .highlighted .addr {
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card {
|
||||||
|
width: 28%;
|
||||||
|
margin-left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
</style>
|
@ -5,14 +5,14 @@
|
|||||||
<div style="display:flex;flex-direction:row;justify-content: space-around ">
|
<div style="display:flex;flex-direction:row;justify-content: space-around ">
|
||||||
<div>
|
<div>
|
||||||
名称
|
名称
|
||||||
<el-input v-model="input" style="width: 240px;margin-left:0.5vw" placeholder="请输入" />
|
<el-input v-model="input1" style="width: 240px;margin-left:0.5vw" placeholder="请输入" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
状态
|
状态
|
||||||
<el-input v-model="input" style="width: 240px;margin-left:0.5vw" placeholder="请输入" />
|
<el-input v-model="input2" style="width: 240px;margin-left:0.5vw" placeholder="请输入" />
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-button type="primary" style="width:80px">查询</el-button>
|
<el-button type="primary" style="width:80px" @click="search">查询</el-button>
|
||||||
<el-button style="width:80px">重置</el-button>
|
<el-button style="width:80px">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -25,52 +25,102 @@
|
|||||||
@selection-change="handleSelectionChange">
|
@selection-change="handleSelectionChange">
|
||||||
<!-- <el-table-column type="selection" width="55" />-->
|
<!-- <el-table-column type="selection" width="55" />-->
|
||||||
<el-table-column label="序号" width="120">
|
<el-table-column label="序号" width="120">
|
||||||
<template v-slot="{$index}">{{ $index+1 }}</template>
|
<template v-slot="{ $index }">{{ $index + 1 }}</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column property="name" label="项目名称" width="120" />
|
<el-table-column property="name" label="项目名称" width="120" />
|
||||||
<el-table-column property="workLoad" label="工作量" show-overflow-tooltip />
|
<el-table-column property="workLoad" label="工作量" show-overflow-tooltip />
|
||||||
<el-table-column property="cycle" label="周期" />
|
<el-table-column property="cycle" label="周期" />
|
||||||
<el-table-column property="principalUser" label="负责人" />
|
<el-table-column property="principalUser" label="负责人" />
|
||||||
<el-table-column property="isFinish" label="状态" />
|
<el-table-column property="isFinish" label="状态" />
|
||||||
<el-table-column property="description" label="子系统简介" />
|
|
||||||
<el-table-column property="id" label="截止时间" />
|
|
||||||
|
<el-table-column property="isFinish" label="文档(点击下载)">
|
||||||
|
<el-button link style="color:deepskyblue">接口文档</el-button>
|
||||||
|
<el-button link style="color:deepskyblue">需求文档</el-button>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column property="tags" label="标签">
|
||||||
|
<template v-slot="{ row }">
|
||||||
|
<span v-for="(tag, index) in row.tags" :key="index">{{ tag.toString() }} </span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column property="description" label="项目简介" >
|
||||||
|
<template v-slot="{row}">
|
||||||
|
<span v-for="(des, index) in row.description" :key="index">{{ des.toString() }} </span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column property="dateline" label="截止时间" />
|
||||||
<el-table-column property="name" label="操作">
|
<el-table-column property="name" label="操作">
|
||||||
<el-button link style="color:deepskyblue" @click="toChildSystem">查看详情</el-button>
|
<el-button link style="color:deepskyblue" @click="toChildSystem">查看详情</el-button>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination larger background layout="prev, pager, next" :total="50" class="mt-4"
|
<el-pagination larger background layout="prev, pager, next" :total="40" class="mt-4"
|
||||||
style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh" />
|
style="display: flex;flex-direction: row;justify-content: center;margin-top:5vh" />
|
||||||
</el-card>
|
</el-card>
|
||||||
|
<el-alert>
|
||||||
|
<router-view />
|
||||||
|
</el-alert>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref } from 'vue';
|
import { ref ,onMounted} from 'vue';
|
||||||
import { ElTable } from 'element-plus';
|
import { ElTable } from 'element-plus';
|
||||||
import { getproject } from '@/api/manage.js';
|
import { getManageListById } from '@/api/manage.js';
|
||||||
import { getToken } from '@/utils/auth';
|
import { getToken } from '@/utils/auth';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
|
import { getManageList } from '@/api/manage.js';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
// 路由跳转
|
// 路由跳转
|
||||||
const toChildSystem = () => {
|
const toChildSystem = () => {
|
||||||
router.push({ name: 'ChildSysManage' ,params:{ token : getToken()}}); // 跳转到子系统详情页面
|
router.push({ name: 'ChildSysManage' }); // 跳转到子系统详情页面
|
||||||
};
|
};
|
||||||
|
|
||||||
|
//页面加载直接获取数据
|
||||||
|
onMounted(() => {
|
||||||
|
getAllProject();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
interface User {
|
interface User {
|
||||||
id: number
|
id: number
|
||||||
|
total: number
|
||||||
cycle: number
|
cycle: number
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description: Array<any>
|
||||||
workLoad: number
|
workLoad: number
|
||||||
isFinish: number
|
status: string
|
||||||
principalUser: string
|
deadline: string
|
||||||
|
tags: Array<any>
|
||||||
|
files: Array<any>
|
||||||
|
isDelete: boolean
|
||||||
|
principal_id: number
|
||||||
|
updatedAt: string
|
||||||
|
createdAt: string
|
||||||
|
completeTime: string
|
||||||
|
beginTime: string
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 数组转出
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 获取输入框内容
|
||||||
|
const input1 = ref('');
|
||||||
|
const input2 = ref('');
|
||||||
|
|
||||||
|
|
||||||
const multipleTableRef = ref<InstanceType<typeof ElTable>>();
|
const multipleTableRef = ref<InstanceType<typeof ElTable>>();
|
||||||
const multipleSelection = ref<User[]>([]);
|
const multipleSelection = ref<User[]>([]);
|
||||||
|
|
||||||
@ -78,99 +128,102 @@ const handleSelectionChange = (val: User[]) => {
|
|||||||
multipleSelection.value = val;
|
multipleSelection.value = val;
|
||||||
};
|
};
|
||||||
|
|
||||||
// const tableData: User[] = [
|
// 在 Vue 组件中添加 parseData 函数
|
||||||
// {
|
const parseData = (data) => {
|
||||||
// date: '2016-05-03',
|
const description = JSON.parse(data.description);
|
||||||
// name: 'Tom',
|
const files = JSON.parse(data.files);
|
||||||
// address: 'No. 189, Grove St, Los Angeles'
|
const tags = JSON.parse(data.tags);
|
||||||
// },
|
|
||||||
// {
|
return {
|
||||||
// date: '2016-05-02',
|
id: data.id,
|
||||||
// name: 'Tom',
|
total:20,
|
||||||
// address: 'No. 189, Grove St, Los Angeles'
|
cycle: data.cycle,
|
||||||
// },
|
name: data.name,
|
||||||
// {
|
description: description,
|
||||||
// date: '2016-05-04',
|
workLoad: data.workLoad,
|
||||||
// name: 'Tom',
|
status: data.status,
|
||||||
// address: 'No. 189, Grove St, Los Angeles'
|
deadline: data.deadline,
|
||||||
// },
|
tags: tags,
|
||||||
// {
|
files: files,
|
||||||
// date: '2016-05-01',
|
isDelete: data.isDelete,
|
||||||
// name: 'Tom',
|
principal_id: data.principalId,
|
||||||
// address: 'No. 189, Grove St, Los Angeles'
|
updatedAt: data.updatedAt,
|
||||||
// }
|
createdAt: data.createdAt,
|
||||||
|
completeTime: data.completeTime,
|
||||||
|
beginTime: data.beginTime
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
//获取所有项目
|
||||||
|
const getAllProject = () => {
|
||||||
|
const project = getManageList(getToken());
|
||||||
|
|
||||||
|
|
||||||
|
// 处理接口数据
|
||||||
|
project.then(res => {
|
||||||
|
const data = res.data.data;
|
||||||
|
console.log(data);
|
||||||
|
if (data) {
|
||||||
|
const newData = data.map(item => parseData(item)); // 使用先前定义的函数处理数据
|
||||||
|
// 使用 tableData.value 进行添加
|
||||||
|
tableData.value = newData;
|
||||||
|
console.log(tableData.value);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} else {
|
||||||
|
console.log("没有数据");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// 查询
|
||||||
|
const search = () => {
|
||||||
|
//获取数据
|
||||||
|
const project = getManageListById(input1.value, getToken());
|
||||||
|
|
||||||
|
// 处理接口数据
|
||||||
|
project.then(res => {
|
||||||
|
|
||||||
|
const data = res.data.data;
|
||||||
|
console.log(data);
|
||||||
|
if (data) {
|
||||||
|
const newData = parseData(data); // 使用先前定义的函数处理数据
|
||||||
|
// 使用 tableData.value 进行添加
|
||||||
|
|
||||||
|
tableData.value.push(newData);
|
||||||
|
console.log(tableData.value);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
console.log("没有数据");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// ];
|
|
||||||
//获取数据
|
|
||||||
const project = getproject(2, getToken());
|
|
||||||
|
|
||||||
//响应式
|
//响应式
|
||||||
const tableData = ref<User[]>([
|
const tableData = ref<User[]>([
|
||||||
//测试用例
|
//测试用例
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
cycle: 2,
|
|
||||||
name: "shij",
|
|
||||||
description: "null",
|
|
||||||
workLoad: 1,
|
|
||||||
isFinish: 2,
|
|
||||||
principalUser: "teacher_user",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
cycle: 2,
|
|
||||||
name: "shij",
|
|
||||||
description: "null",
|
|
||||||
workLoad: 1,
|
|
||||||
isFinish: 2,
|
|
||||||
principalUser: "teacher_user",
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: 4,
|
|
||||||
cycle: 2,
|
|
||||||
name: "shij",
|
|
||||||
description: "null",
|
|
||||||
workLoad: 1,
|
|
||||||
isFinish: 2,
|
|
||||||
principalUser: "teacher_user",
|
|
||||||
},
|
|
||||||
|
|
||||||
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
|
||||||
// 处理接口数据
|
|
||||||
project.then(res => {
|
|
||||||
|
|
||||||
const data = res.data.data[0];
|
|
||||||
if (data) {
|
|
||||||
const dataProject: User = {
|
|
||||||
id: data.id,
|
|
||||||
cycle: data.cycle,
|
|
||||||
name: data.name,
|
|
||||||
description: data.description,
|
|
||||||
workLoad: data.workLoad,
|
|
||||||
isFinish: data.isFinish,
|
|
||||||
principalUser: data.principalUser
|
|
||||||
};
|
|
||||||
// 使用 tableData.value 进行访问
|
|
||||||
tableData.value.push(dataProject);
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
console.log("没有数据");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
.catch(err => {
|
|
||||||
console.log(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const input = ref('');
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,16 +106,56 @@
|
|||||||
<el-table-column property="address" label="工作时间" />
|
<el-table-column property="address" label="工作时间" />
|
||||||
<el-table-column property="address" label="操作" >
|
<el-table-column property="address" label="操作" >
|
||||||
<el-button size="small" text style="color:deepskyblue" @click="EditDialogVisible = true">修改</el-button>
|
<el-button size="small" text style="color:deepskyblue" @click="EditDialogVisible = true">修改</el-button>
|
||||||
<el-dialog v-model="EditDialogVisible" title="删除" width="500" :modal="false">
|
<!-- <el-dialog v-model="EditDialogVisible" title="删除" width="500" :modal="false">-->
|
||||||
<template #footer>
|
|
||||||
<div class="dialog-footer">
|
|
||||||
<el-button @click="EditDialogVisible = false">取消</el-button>
|
<el-dialog v-model="EditDialogVisible" width="500" center :modal="false" :show-close="false">
|
||||||
<el-button type="primary" @click="EditDialogVisible = false">
|
<template #header>
|
||||||
确认
|
<div style="display:flex;flex-direction: row;justify-content: flex-start;color:#409eff;font-size:large" >编辑日报</div>
|
||||||
</el-button>
|
<el-divider content-position="left" style="background:red"><el-icon><CaretTop /></el-icon></el-divider>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<!-- <div style="margin-top:-4vh ">-->
|
||||||
|
<!-- <span style="color:red">项目名称:</span>-->
|
||||||
|
<!-- <el-input-->
|
||||||
|
<!-- v-model="input"-->
|
||||||
|
<!-- style="width: 200px"-->
|
||||||
|
<!-- placeholder="请输入"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<div style="margin-top:-4vh ">
|
||||||
|
<span style="color:red"> 工作时间:</span>
|
||||||
|
<el-date-picker
|
||||||
|
v-model="value1"
|
||||||
|
type="date"
|
||||||
|
placeholder="请选择日期"
|
||||||
|
style="width: 200px"
|
||||||
|
:default-value="new Date(2010, 9, 1)"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div style="margin-top:2vh ;display:flex;flex-direction:row;">
|
||||||
|
<span style="color: red">日报内容:</span>
|
||||||
|
<el-input
|
||||||
|
v-model="textarea"
|
||||||
|
style="width: 300px;"
|
||||||
|
:rows="4"
|
||||||
|
type="textarea"
|
||||||
|
placeholder="请输入"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
<template #footer>
|
||||||
</el-dialog>
|
<div class="dialog-footer">
|
||||||
|
<el-button @click="EditDialogVisible = false">取消</el-button>
|
||||||
|
<el-button type="primary" @click="EditDialogVisible = false">
|
||||||
|
确认
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination
|
<el-pagination
|
||||||
|
Loading…
x
Reference in New Issue
Block a user