diff --git a/auto-imports.d.ts b/auto-imports.d.ts index 8139ac9..24e619c 100644 --- a/auto-imports.d.ts +++ b/auto-imports.d.ts @@ -2,4 +2,5 @@ export {} declare global { const ElMessage: typeof import('element-plus/es')['ElMessage'] + const ElMessageBox: typeof import('element-plus/es')['ElMessageBox'] } diff --git a/src/api/manage.js b/src/api/manage.js index b09b6af..94ba1e7 100644 --- a/src/api/manage.js +++ b/src/api/manage.js @@ -50,16 +50,18 @@ export const getproject = (projectId, token) => { /** * 获取我管理页面的项目列表(接口有问题) * + * @param pageSize 页面大小 * @param token 访问令牌 * @returns {Promise> | *} */ -export const getManageList = (token) => { +export const getManageList = (params ,token ,) => { + + const {pageSize ,is ,page} = params; return axios({ - url: api +"/project/child/get" , + url: `${api}/project/child/get?is=${is}&pageSize=${pageSize}&page=${page}` , method: "get", headers: { 'Authorization': 'Bearer ' + token, - 'Timestamp': getCurrentTimestamp() @@ -72,25 +74,7 @@ export const getManageList = (token) => { // 我管理的所有接口 -/** - * 获取我管理的页面的搜索 - * - * @param projectId 项目id - * @param token 访问令牌 - * @returns {Promise> | *} - */ -export const getManageListById = (projectId, token) => { - return axios({ - url: api +'/project/get/' + projectId, - method: "get", - headers: { - 'Authorization': 'Bearer ' + token, - 'Timestamp': getCurrentTimestamp() - } - }) - -} /** * 获取我管理的页面的项目列表 * @@ -116,24 +100,6 @@ export const getManageProjectList = (token) => { -/** - * 获取我管理的页面的子模块项目列表 - * - * @param token 访问令牌 - * @returns {Promise> | *} - */ -export const getProjectList = (token) => { - return axios({ - url: api +"/project/module/get" , - method: "get", - headers: { - 'Authorization': 'Bearer ' + token, - 'Timestamp': getCurrentTimestamp() - } - - - }) -} /** * 获取我管理的页面的子系统项目列表 * @param projectId 项目id @@ -188,6 +154,46 @@ export const getProjectModDetail = (id,token) => { }) } +//功能接口 + + +//删除项目 + +/** + * 选择项目删除 + * @param id 项目id + * @param token 访问令牌 + * @returns {Promise> | *} + */ +export const deleteProject = (id,token) => { + return axios({ + url: api +"/project/delete?id=" + id , + method: "delete", + headers: { + 'Authorization': 'Bearer ' + token, + 'Timestamp': getCurrentTimestamp() + } + + + }) +} +// 添加项目接口 +/** + * 添加项目 + * @param data 要添加的项目数据 + * @returns {Promise>} 返回API响应 + */ +export const addProject = (data ,token) => { + return axios({ + url: api + "/project/add", // 替换为实际的项目API端点 + method: "post", // 使用POST方法添加项目 + headers: { + 'Authorization': 'Bearer ' + token, + 'Timestamp': getCurrentTimestamp() + }, + data: data // 将要添加的项目数据传递给API + }); + } diff --git a/src/utils/validate.ts b/src/utils/validate.ts index da6633c..a7b4833 100644 --- a/src/utils/validate.ts +++ b/src/utils/validate.ts @@ -15,7 +15,7 @@ export function isExternal(path) { * @returns {Boolean} */ export function validUsername(str) { - const valid_map = ['admin', 'editor', 'teacher_user', 'teacher_demo', 'demo', 'xiao_lfeng', 'yangna']; + const valid_map = ['console_user', 'developer_user', 'principal_user']; return valid_map.indexOf(str.trim()) >= 0; } diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 7f54039..9e33c0e 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -113,8 +113,8 @@ export default defineComponent({ }; return { loginForm: { - username: 'teacher_user', - password: '123456' + username: 'principal_user', + password: 'jsl_nbxt' }, loginRules: { username: [{ required: true, trigger: 'blur', validator: validateUsername }], diff --git a/src/views/personal/project/childSystem/manage.vue b/src/views/personal/project/childSystem/manage.vue index 8ae5475..08fc903 100644 --- a/src/views/personal/project/childSystem/manage.vue +++ b/src/views/personal/project/childSystem/manage.vue @@ -28,17 +28,17 @@ - - - - + + + + - + 查看详情 @@ -64,21 +64,22 @@ import { getProjectSysList } from '@/api/manage'; const router = useRouter(); const toChildModel = (id) => { - router.push({ name: 'ChildModManage' , query: { id: id } }) + router.push({ name: 'ChildModManage' , query: { id: 3 } }) }; const input = ref(''); interface User { - id: number - principalId: number - projectId: number - name: string - cycle: number - workLoad: number - description: { description: string } - isDelete: number - createdAt: string + cycle:number + deadLine:string + description: {description :string} + id:number + isDelete:number + name:string + principalName:string + projectId:number + status:string + workLoad:number } const multipleTableRef = ref>(); @@ -108,27 +109,29 @@ const initialTableData = ref([]); const description = JSON.parse(data.description); return{ - id: data.id, - cycle: data.cycle, - description: description, - isDelete: data.isDelete, - - name: data.name, - principalId: data.principalId, - projectId: data.projectId, - workLoad: data.workLoad, - createdAt: data.createdAt + cycle:data.cycle, + deadLine:data.deadLine, + description:description, + id:data.id, + isDelete:data.isDelete, + name:data.name, + principalName:data.principalName, + projectId:data.projectId, + status:data.status, + workLoad:data.workLoad, } } const fetchData = () => { - const project = getProjectSysList(projectId,getToken()); + + const project = getProjectSysList( projectId ? Number(projectId) - 1 : 0,getToken()); //处理数据 project.then(res=>{ const data = res.data.data - - // console.log(data) + console.log(data); + + if(data){ const newData = data.map(item=>parseData(item)) console.log(newData); diff --git a/src/views/personal/project/childSystem/participate.vue b/src/views/personal/project/childSystem/participate.vue index acb2f10..444657a 100644 --- a/src/views/personal/project/childSystem/participate.vue +++ b/src/views/personal/project/childSystem/participate.vue @@ -30,7 +30,7 @@ - +