我参与的部分基本完成(接口数据还差几个)
This commit is contained in:
parent
fd4592489c
commit
b30cc287e8
2
components.d.ts
vendored
2
components.d.ts
vendored
@ -23,6 +23,7 @@ declare module '@vue/runtime-core' {
|
|||||||
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']
|
||||||
|
ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
|
||||||
ElDialog: typeof import('element-plus/es')['ElDialog']
|
ElDialog: typeof import('element-plus/es')['ElDialog']
|
||||||
ElDivider: typeof import('element-plus/es')['ElDivider']
|
ElDivider: typeof import('element-plus/es')['ElDivider']
|
||||||
ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
ElDropdown: typeof import('element-plus/es')['ElDropdown']
|
||||||
@ -44,6 +45,7 @@ declare module '@vue/runtime-core' {
|
|||||||
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']
|
||||||
|
ElTableRow: typeof import('element-plus/es')['ElTableRow']
|
||||||
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']
|
||||||
ErrorLog: typeof import('./src/components/ErrorLog/index.vue')['default']
|
ErrorLog: typeof import('./src/components/ErrorLog/index.vue')['default']
|
||||||
|
@ -22,6 +22,55 @@ export const getParticipateProjectList = (token)=> {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 获取我参与的项目的子系统列表
|
||||||
|
* @param projectId 项目ID
|
||||||
|
* @param token 访问令牌
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
export const getParticipateSystemList = ( projectId,token)=> {
|
||||||
|
return axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `${api}/module/get?projectId=${projectId}`,
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${token}`,
|
||||||
|
'Timestamp':getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取我参与的项目的子模块列表
|
||||||
|
* @param SysId 项目ID
|
||||||
|
* @param token 访问令牌
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
export const getParticipateModuleList = ( SysId,token)=> {
|
||||||
|
return axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `${api}/module/get/min?sysId=${SysId}`,
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${token}`,
|
||||||
|
'Timestamp':getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 获取我参与的项目的子模块的详细信息
|
||||||
|
* @param ModId 项目ID
|
||||||
|
* @param token 访问令牌
|
||||||
|
* @returns {Promise<AxiosResponse<any>> | *}
|
||||||
|
*/
|
||||||
|
export const getParticipateDetail = ( ModId,token)=> {
|
||||||
|
return axios({
|
||||||
|
method: 'get',
|
||||||
|
url: `${api}/project/module/id?id=${ModId}`,
|
||||||
|
headers: {
|
||||||
|
'Authorization': `Bearer ${token}`,
|
||||||
|
'Timestamp':getCurrentTimestamp()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,136 +1,216 @@
|
|||||||
<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 >项目1</strong></template>
|
<template #header><strong>项目{{ projectid }}</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="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" @click="reset()">重置</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="toChildModel"
|
|
||||||
>查看详情</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">
|
||||||
|
<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.$index + 1 }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column property="name" label="子系统名称" width="120" />
|
||||||
|
<el-table-column property="workLoad" label="工作量" show-overflow-tooltip />
|
||||||
|
<el-table-column property="cycle" label="周期" />
|
||||||
|
<el-table-column property="principalUser" label="负责人" />
|
||||||
|
<el-table-column property="status" label="状态" />
|
||||||
|
<el-table-column property="description" label="子系统简介">
|
||||||
|
<template #default="{ row }">
|
||||||
|
<span>{{ row.description.description }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column property="createdAt" label="创建时间" />
|
||||||
|
<el-table-column property="address" label="操作" #default="{row}">
|
||||||
|
<el-button link style="color:deepskyblue" @click="toChildModel(row.id)">查看详情</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>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
</div>
|
||||||
import { ref } from 'vue';
|
</template>
|
||||||
import { ElTable } from 'element-plus';
|
|
||||||
import { useRouter } from 'vue-router';
|
|
||||||
|
|
||||||
//跳转到子模块
|
<script lang="ts" setup>
|
||||||
const router = useRouter();
|
import { ref } from 'vue';
|
||||||
|
|
||||||
const toChildModel = () => {
|
import { ElTable } from 'element-plus';
|
||||||
router.push({name:'ChildModParticipate'})
|
import { useRouter, useRoute } from 'vue-router';
|
||||||
};
|
import { getToken } from '@/utils/auth';
|
||||||
|
import { getParticipateSystemList } from '@/api/participate.js';
|
||||||
|
|
||||||
const input = ref('');
|
|
||||||
|
|
||||||
interface User {
|
//取值
|
||||||
date: string
|
const route = useRoute();
|
||||||
name: string
|
const projectid = route.query.projectId ? route.query.projectId : 1 ;
|
||||||
address: string
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//跳转到子模块
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const toChildModel = (SysId: number) => {
|
||||||
|
router.push({ name: 'ChildModParticipate' , query: { SysId: SysId } })
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
interface User {
|
||||||
|
id: number
|
||||||
|
createdAt: string
|
||||||
|
cycle: number
|
||||||
|
description: { description: string }
|
||||||
|
isDeleted: number
|
||||||
|
name: string
|
||||||
|
principalId: number
|
||||||
|
projectId: number
|
||||||
|
workLoad: number
|
||||||
|
status: string
|
||||||
|
principalUser:string
|
||||||
|
}
|
||||||
|
|
||||||
|
const multipleTableRef = ref<InstanceType<typeof ElTable>>();
|
||||||
|
const multipleSelection = ref<User[]>([]);
|
||||||
|
|
||||||
|
const handleSelectionChange = (val: User[]) => {
|
||||||
|
multipleSelection.value = val;
|
||||||
|
};
|
||||||
|
|
||||||
|
const tableData = ref<User[]>([
|
||||||
|
{
|
||||||
|
id: 1,
|
||||||
|
createdAt: '2022-01-01',
|
||||||
|
cycle: 1,
|
||||||
|
description: { description: '子系统1的简介' },
|
||||||
|
isDeleted: 0,
|
||||||
|
|
||||||
|
|
||||||
|
name: '子系统1',
|
||||||
|
principalId: 1,
|
||||||
|
projectId: 1,
|
||||||
|
workLoad: 1,
|
||||||
|
status: '待定',
|
||||||
|
principalUser: '等数据ing'
|
||||||
}
|
}
|
||||||
|
]);
|
||||||
|
const initialTableData = ref<User[]>([]);
|
||||||
|
|
||||||
const multipleTableRef = ref<InstanceType<typeof ElTable>>();
|
const parseData = (data) => {
|
||||||
const multipleSelection = ref<User[]>([]);
|
const description = JSON.parse(data.description);
|
||||||
|
|
||||||
const handleSelectionChange = (val: User[]) => {
|
|
||||||
multipleSelection.value = val;
|
|
||||||
};
|
|
||||||
|
|
||||||
const tableData: User[] = [
|
|
||||||
{
|
|
||||||
date: '2016-05-03',
|
return {
|
||||||
name: 'Tom',
|
id: data.id,
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
createdAt: data.createdAt,
|
||||||
},
|
cycle: data.cycle,
|
||||||
{
|
description: description,
|
||||||
date: '2016-05-02',
|
isDeleted: data.isDeleted,
|
||||||
name: 'Tom',
|
name: data.name,
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
principalId: data.principalId,
|
||||||
},
|
projectId: data.projectId,
|
||||||
{
|
workLoad: data.workLoad,
|
||||||
date: '2016-05-04',
|
status:"待定",
|
||||||
name: 'Tom',
|
principalUser:"等数据ing"
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
}
|
||||||
},
|
}
|
||||||
{
|
|
||||||
date: '2016-05-01',
|
//获取子系统列表
|
||||||
name: 'Tom',
|
const fetchData = () => {
|
||||||
address: 'No. 189, Grove St, Los Angeles'
|
//调用接口
|
||||||
|
const project = getParticipateSystemList(<number>projectid-1, getToken());
|
||||||
|
|
||||||
|
project.then((res) => {
|
||||||
|
const data = res.data.data;
|
||||||
|
console.log(data);
|
||||||
|
|
||||||
|
if (data) {
|
||||||
|
const dataProject = data.map(item => parseData(item));
|
||||||
|
|
||||||
|
tableData.value = [...dataProject, ...tableData.value];
|
||||||
|
console.log(tableData.value);
|
||||||
|
initialTableData.value = tableData.value.slice();
|
||||||
}
|
}
|
||||||
|
|
||||||
];
|
}).catch(err => {
|
||||||
|
console.log(err);
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
fetchData();
|
||||||
|
|
||||||
|
// 统一检索函数
|
||||||
|
const search = () => {
|
||||||
|
const keyword = input1.value.trim().toLowerCase();
|
||||||
|
const status = input2.value.trim().toLowerCase();
|
||||||
|
|
||||||
|
// 如果搜索关键词和状态都为空,则恢复初始数据
|
||||||
|
if (keyword === '' && status === '') {
|
||||||
|
tableData.value = initialTableData.value.slice();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据关键词和状态进行检索
|
||||||
|
tableData.value = initialTableData.value.filter(item => {
|
||||||
|
const matchKeyword = (keyword === '' || item.name.toLowerCase().includes(keyword));
|
||||||
|
const matchStatus = (status === '' || item.status.toLowerCase().includes(status));
|
||||||
|
return matchKeyword && matchStatus;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const input1 = ref('');
|
||||||
|
const input2 = ref('');
|
||||||
|
|
||||||
|
// 重置检索条件
|
||||||
|
const reset = () => {
|
||||||
|
input1.value = '';
|
||||||
|
input2.value = '';
|
||||||
|
tableData.value = initialTableData.value.slice(); // 恢复初始数据
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
.my-autocomplete li {
|
|
||||||
line-height: normal;
|
</script>
|
||||||
padding: 7px;
|
<style>
|
||||||
}
|
.my-autocomplete li {
|
||||||
.my-autocomplete li .name {
|
line-height: normal;
|
||||||
text-overflow: ellipsis;
|
padding: 7px;
|
||||||
overflow: hidden;
|
}
|
||||||
}
|
|
||||||
.my-autocomplete li .addr {
|
.my-autocomplete li .name {
|
||||||
font-size: 12px;
|
text-overflow: ellipsis;
|
||||||
color: #b4b4b4;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.my-autocomplete li .highlighted .addr {
|
|
||||||
color: #ddd;
|
.my-autocomplete li .addr {
|
||||||
}
|
font-size: 12px;
|
||||||
</style>
|
color: #b4b4b4;
|
||||||
|
}
|
||||||
|
|
||||||
|
.my-autocomplete li .highlighted .addr {
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,140 +1,198 @@
|
|||||||
<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 >子系统1</strong></template>
|
<template #header><strong>子系统{{ SysId }}</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="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" @click="reset()">重置</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<el-card style="max-width: 100vw;height:60vh;margin:1.3vw">
|
<el-card style="max-width: 100vw;height:60vh;margin:1.3vw">
|
||||||
<div style="display:flex;flex-direction: row;justify-content: space-between">
|
<div style="display:flex;flex-direction: row;justify-content: space-between">
|
||||||
<el-button
|
<el-button text type=''>子模块列表</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="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>
|
</div>
|
||||||
</template>
|
<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="{ row }">{{ row.id }}</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column property="name" label="子模块名称" width="120" />
|
||||||
|
<el-table-column property="workLoad" label="工作量" show-overflow-tooltip />
|
||||||
|
<el-table-column property="address" label="周期" />
|
||||||
|
<el-table-column property="principalUser" label="负责人" />
|
||||||
|
<el-table-column property="status" label="状态" />
|
||||||
|
<el-table-column property="description" label="子模块简介" #default="{ row }">
|
||||||
|
<span>{{ row.description.description }}</span>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column property="address" label="截止时间" />
|
||||||
|
<el-table-column property="address" label="操作" #default="{ row }">
|
||||||
|
<el-button link style="color:deepskyblue" @click="toDetail(row.id)">查看详情</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>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
</div>
|
||||||
import { ref } from 'vue';
|
</template>
|
||||||
import { ElTable } from 'element-plus';
|
|
||||||
|
|
||||||
import { useRouter } from 'vue-router';
|
<script lang="ts" setup>
|
||||||
|
import { ref } from 'vue';
|
||||||
|
import { ElTable } from 'element-plus';
|
||||||
|
import { getParticipateModuleList } from '@/api/participate';
|
||||||
|
import { useRouter, useRoute } from 'vue-router';
|
||||||
|
import { getToken } from '@/utils/auth';
|
||||||
|
|
||||||
|
|
||||||
const router = useRouter();
|
|
||||||
|
|
||||||
// 路由跳转
|
const router = useRouter();
|
||||||
const toDetail = () => {
|
//取值
|
||||||
router.push({ name: 'ParticipateDetail' }); // 跳转到子系统详情页面
|
const route = useRoute()
|
||||||
};
|
const SysId = route.query.SysId;
|
||||||
|
|
||||||
interface User {
|
// 路由跳转
|
||||||
date: string
|
const toDetail = (ModId) => {
|
||||||
name: string
|
router.push({ name: 'ParticipateDetail', query: { ModId: ModId } }); // 跳转到子系统详情页面
|
||||||
address: string
|
};
|
||||||
|
|
||||||
|
interface User {
|
||||||
|
beginTime: string;
|
||||||
|
childSystemName: string;
|
||||||
|
completeTime: string;
|
||||||
|
cycle: string;
|
||||||
|
description: { description: string };
|
||||||
|
id: number;
|
||||||
|
isDelete: number
|
||||||
|
isFinishi: string
|
||||||
|
name: string;
|
||||||
|
pid: string
|
||||||
|
principalId: number
|
||||||
|
principalUser: string
|
||||||
|
projectId: number
|
||||||
|
status: string
|
||||||
|
type: string
|
||||||
|
workLoad: number
|
||||||
|
}
|
||||||
|
|
||||||
|
const multipleTableRef = ref<InstanceType<typeof ElTable>>();
|
||||||
|
const multipleSelection = ref<User[]>([]);
|
||||||
|
|
||||||
|
const handleSelectionChange = (val: User[]) => {
|
||||||
|
multipleSelection.value = val;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//列表
|
||||||
|
const tableData = ref<User[]>([]);
|
||||||
|
const initialTableData = ref<User[]>([]);
|
||||||
|
const parseData = (data) => {
|
||||||
|
const descripation = JSON.parse(data.description);
|
||||||
|
|
||||||
|
return {
|
||||||
|
beginTime: data.beginTime,
|
||||||
|
childSystemName: data.childSystemName,
|
||||||
|
completeTime: data.completeTime,
|
||||||
|
cycle: data.cycle,
|
||||||
|
description: descripation,
|
||||||
|
id: data.id,
|
||||||
|
isDelete: data.isDelete,
|
||||||
|
isFinishi: data.isFinishi,
|
||||||
|
name: data.name,
|
||||||
|
pid: data.pid,
|
||||||
|
principalId: data.principalId,
|
||||||
|
principalUser: data.principalUser,
|
||||||
|
projectId: data.projectId,
|
||||||
|
status: '待完成',
|
||||||
|
type: data.type,
|
||||||
|
workLoad: data.workLoad
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const multipleTableRef = ref<InstanceType<typeof ElTable>>();
|
//接口获取内容
|
||||||
const multipleSelection = ref<User[]>([]);
|
const fetchData = () => {
|
||||||
|
const project = getParticipateModuleList(SysId, getToken());
|
||||||
|
console.log(project);
|
||||||
|
|
||||||
const handleSelectionChange = (val: User[]) => {
|
project.then((res) => {
|
||||||
multipleSelection.value = val;
|
const data = res.data.data
|
||||||
};
|
console.log(data);
|
||||||
|
|
||||||
const input = ref('');
|
if (data) {
|
||||||
|
const newData = data.map((item) => parseData(item));
|
||||||
|
tableData.value = [...newData, ...tableData.value]
|
||||||
|
|
||||||
const tableData: User[] = [
|
|
||||||
{
|
initialTableData.value = tableData.value.slice();
|
||||||
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'
|
|
||||||
}
|
}
|
||||||
|
}).catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
|
||||||
];
|
}
|
||||||
|
|
||||||
|
fetchData();
|
||||||
|
|
||||||
|
// 统一检索函数
|
||||||
|
const search = () => {
|
||||||
|
const keyword = input1.value.trim().toLowerCase();
|
||||||
|
const status = input2.value.trim().toLowerCase();
|
||||||
|
|
||||||
|
// 如果搜索关键词和状态都为空,则恢复初始数据
|
||||||
|
if (keyword === '' && status === '') {
|
||||||
|
tableData.value = initialTableData.value.slice();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 根据关键词和状态进行检索
|
||||||
|
tableData.value = initialTableData.value.filter(item => {
|
||||||
|
const matchKeyword = (keyword === '' || item.name.toLowerCase().includes(keyword));
|
||||||
|
const matchStatus = (status === '' || item.status.toLowerCase().includes(status));
|
||||||
|
return matchKeyword && matchStatus;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
const input1 = ref('');
|
||||||
|
const input2 = ref('');
|
||||||
|
|
||||||
|
// 重置检索条件
|
||||||
|
const reset = () => {
|
||||||
|
input1.value = '';
|
||||||
|
input2.value = '';
|
||||||
|
tableData.value = initialTableData.value.slice(); // 恢复初始数据
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style>
|
||||||
.my-autocomplete li {
|
.my-autocomplete li {
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
padding: 7px;
|
padding: 7px;
|
||||||
}
|
}
|
||||||
.my-autocomplete li .name {
|
|
||||||
text-overflow: ellipsis;
|
.my-autocomplete li .name {
|
||||||
overflow: hidden;
|
text-overflow: ellipsis;
|
||||||
}
|
overflow: hidden;
|
||||||
.my-autocomplete li .addr {
|
}
|
||||||
font-size: 12px;
|
|
||||||
color: #b4b4b4;
|
.my-autocomplete li .addr {
|
||||||
}
|
font-size: 12px;
|
||||||
.my-autocomplete li .highlighted .addr {
|
color: #b4b4b4;
|
||||||
color: #ddd;
|
}
|
||||||
}
|
|
||||||
</style>
|
.my-autocomplete li .highlighted .addr {
|
||||||
|
color: #ddd;
|
||||||
|
}
|
||||||
|
</style>
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style=" width:100%;">
|
<div style=" width:100%;">
|
||||||
<el-card style="max-width: 100vw;">
|
<el-card style="max-width: 100vw;">
|
||||||
<template #header><strong>子模块1</strong></template>
|
<template #header><strong>子模块{{ id }}</strong></template>
|
||||||
|
|
||||||
|
|
||||||
</el-card>
|
</el-card>
|
||||||
@ -26,6 +26,7 @@
|
|||||||
<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-option label="已完成" value="已完成"></el-option>
|
<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>
|
</el-select>
|
||||||
<textarea style="resize: none;margin-top: 10%;width: 150px;" v-if="item.label === '07.简介'"
|
<textarea style="resize: none;margin-top: 10%;width: 150px;" v-if="item.label === '07.简介'"
|
||||||
@ -40,12 +41,20 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
|
||||||
|
import { getToken } from '@/utils/auth';
|
||||||
import { ref } from 'vue';
|
import { ref } from 'vue';
|
||||||
|
import { useRoute } from 'vue-router';
|
||||||
|
import { getParticipateDetail } from '@/api/participate';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const projectItems = ref([
|
const projectItems = ref([
|
||||||
{ label: '01.模块名称', value: '名称1' },
|
{ label: '01.模块名称', value: '名称1' },
|
||||||
@ -54,11 +63,57 @@ const projectItems = ref([
|
|||||||
{ label: '04.负责人', value: '张三' },
|
{ label: '04.负责人', value: '张三' },
|
||||||
{ label: '05.状态', value: '进行中' },
|
{ label: '05.状态', value: '进行中' },
|
||||||
{ label: '06.时间', value: '2024-01-01 12:00:00' },
|
{ label: '06.时间', value: '2024-01-01 12:00:00' },
|
||||||
{ label: '07.简介', value: '大王iu大概iudg拍高端屁股的怕耽搁u对爬过文档爬过无' },
|
{ label: '07.简介', value: '测试ing' },
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const selectedStatus = ref('进行中');
|
const selectedStatus = ref('进行中');
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const id = route.query.ModId;
|
||||||
|
|
||||||
|
//修改表单内数据
|
||||||
|
const parseData = (data) => {
|
||||||
|
|
||||||
|
|
||||||
|
projectItems.value.forEach(item => {
|
||||||
|
if (item.label === '01.模块名称') {
|
||||||
|
item.value = data.name;
|
||||||
|
} else if (item.label === '02.模块周期') {
|
||||||
|
item.value = data.cycle ? data.cycle : '未知';
|
||||||
|
} else if (item.label === '03.工作量') {
|
||||||
|
item.value = data.workLoad + "人/天";
|
||||||
|
} else if (item.label === '04.负责人') {
|
||||||
|
item.value = data.principalUser;
|
||||||
|
} else if (item.label === '05.状态') {
|
||||||
|
item.value = data.status ? data.status : '未知';
|
||||||
|
} else if (item.label === '06.时间') {
|
||||||
|
item.value = data.deadLine ? data.deadLine : '2024-01-01 12:00:00';
|
||||||
|
} else if (item.label === '07.简介') {
|
||||||
|
item.value = data.description;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//接收接口数据
|
||||||
|
|
||||||
|
const fetchData = () => {
|
||||||
|
const project = getParticipateDetail(id, getToken());
|
||||||
|
|
||||||
|
|
||||||
|
project.then(res => {
|
||||||
|
const data = res.data.data;
|
||||||
|
console.log(data);
|
||||||
|
if (data) {
|
||||||
|
parseData(data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
fetchData();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,9 +23,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<el-table ref="multipleTableRef" :data="tableData" style="max-width: 100vw;"
|
<el-table ref="multipleTableRef" :data="tableData" style="max-width: 100vw;"
|
||||||
@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 #default="{row}">{{ row.id }}</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 />
|
||||||
@ -52,8 +52,11 @@
|
|||||||
|
|
||||||
<el-table-column property="description" label="项目简介" />
|
<el-table-column property="description" label="项目简介" />
|
||||||
<el-table-column property="deadline" label="截止时间" />
|
<el-table-column property="deadline" label="截止时间" />
|
||||||
<el-table-column property="address" label="操作">
|
<el-table-column property="address" label="操作" #default="{ row }">
|
||||||
<el-button link style="color:deepskyblue" @click="toChildSystem">查看详情</el-button>
|
|
||||||
|
<el-button link style="color:deepskyblue" @click="toChildSystem( row.id)">查看详情</el-button>
|
||||||
|
|
||||||
|
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<el-pagination larger background layout="prev, pager, next" :total="total" class="mt-4" :page-size="pageSize"
|
<el-pagination larger background layout="prev, pager, next" :total="total" class="mt-4" :page-size="pageSize"
|
||||||
@ -110,7 +113,7 @@ const tableData = ref<User[]>([
|
|||||||
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 4,
|
id: 2,
|
||||||
cycle: 2,
|
cycle: 2,
|
||||||
name: "项目2",
|
name: "项目2",
|
||||||
description: "xxxxxxx",
|
description: "xxxxxxx",
|
||||||
@ -177,8 +180,8 @@ const fetchData = () => {
|
|||||||
fetchData();
|
fetchData();
|
||||||
|
|
||||||
// 处理路由跳转
|
// 处理路由跳转
|
||||||
const toChildSystem = () => {
|
const toChildSystem = (id) => {
|
||||||
router.push({ name: 'ChildSysParticipate' });
|
router.push({ name: 'ChildSysParticipate' ,query: { projectId: id } });
|
||||||
};
|
};
|
||||||
|
|
||||||
// 监听表格行选择事件
|
// 监听表格行选择事件
|
||||||
|
Loading…
x
Reference in New Issue
Block a user