获取子模块
This commit is contained in:
parent
eaa3039faf
commit
b49493c795
|
@ -506,7 +506,7 @@ const infoEditSettingHeaderImage = (showType, token) => {
|
|||
*/
|
||||
const projectGet =(token,url) => {
|
||||
return axios({
|
||||
url:api+ "/project/get"+url,
|
||||
url:api+ "/project/get",
|
||||
method: "get",
|
||||
headers:{
|
||||
'Authorization':'Bearer '+token,
|
||||
|
@ -625,7 +625,7 @@ const projectWorkGet = (data,token) =>{
|
|||
const queryTags = `tags=${encodedTags.join('&tags=')}`;
|
||||
const queryIsFinish = `isFinish=${encodedIsFinish.join('&isFinish=')}`;
|
||||
return axios({
|
||||
url:`${api}/project/work/get?${queryTags}&${queryIsFinish}`,
|
||||
url:`${api}/project/work/get?${queryTags}&${queryIsFinish}&is=1`,
|
||||
method: "get",
|
||||
headers:{
|
||||
'content-type': 'application/json;charset=utf-8',
|
||||
|
@ -675,18 +675,24 @@ const moduleGetByProjectId = (projectId, token) => {
|
|||
}
|
||||
|
||||
|
||||
/*const moduleGetByProjectId = (projectId, token) => {
|
||||
/**
|
||||
* 根据子系统id获取子模块信息
|
||||
* @param sysId
|
||||
* @param token
|
||||
*/
|
||||
const moduleGetBySysId = (sysId, token) => {
|
||||
return axios({
|
||||
url:api + "/module/get",
|
||||
methods:"get",
|
||||
params:projectId,
|
||||
url: api + "/module/get/min?sysId=" + sysId,
|
||||
method:"get",
|
||||
headers: {
|
||||
'Authorization':'Bearer '+token,
|
||||
'content-type': 'application/json;charset=utf-8',
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
'Timestamp': getCurrentTimestamp()
|
||||
}
|
||||
})
|
||||
}*/
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
|
||||
login,
|
||||
|
@ -730,7 +736,7 @@ export default {
|
|||
projectWorkGet,
|
||||
|
||||
moduleGetByProjectId,
|
||||
|
||||
moduleGetBySysId,
|
||||
|
||||
messageGet,
|
||||
|
||||
|
|
|
@ -11,7 +11,8 @@ const router = createRouter({
|
|||
{
|
||||
path: "/",
|
||||
component: () => import ('../views/HomePage/Main.vue')
|
||||
},{
|
||||
},
|
||||
{
|
||||
path: '/Project',
|
||||
name: 'Project',
|
||||
component: () => import('@/views/ProjectPage/ProjectList.vue')
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<a-form-item
|
||||
:rules="[{ required: true, message: '请输入您的用户名!' }]"
|
||||
label="用户名"
|
||||
name="username"
|
||||
name="user"
|
||||
style="margin-top: 20px; margin-left: 1vw"
|
||||
>
|
||||
<a-input v-model:value="formState.user" class="h-10 w-64 border-gray-300 rounded-md" type="text"/>
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex space-x-9">
|
||||
<div v-for="(ChildModule, index) in ChildModules" :key="index" class="flex space-x-9">
|
||||
<a-card class="relative bg-blue-400 w-72 h-36 text-white rounded-xl">
|
||||
<div class="flex space-x-9">
|
||||
<p class="absolute left-4 top-4">登录注册模块</p>
|
||||
<p class="absolute left-4 top-4">{{ChildModule.name}}</p>
|
||||
<p class="absolute right-4 top-4">负责人: 无</p>
|
||||
</div>
|
||||
<div class="flex flex-col mt-8">
|
||||
|
@ -48,56 +48,6 @@
|
|||
</button>
|
||||
</div>
|
||||
</a-card>
|
||||
<a-card class="relative bg-teal-400 w-72 h-36 text-white rounded-xl">
|
||||
<div class="flex space-x-9">
|
||||
<p class="absolute left-4 top-4">用户管理模块</p>
|
||||
<p class="absolute right-4 top-4">负责人: 无</p>
|
||||
</div>
|
||||
<div class="flex flex-col mt-8">
|
||||
<p class="text-green-100">剩余 5 天</p>
|
||||
<CaretUpOutlined class="absolute bottom-[32%] ml-2"/>
|
||||
</div>
|
||||
<div class="left-0 absolute bottom-0 h-[35%] w-full bg-white flex justify-center items-center space-x-3">
|
||||
<div class="text-teal-300 flex absolute left-5">
|
||||
<CheckOutlined class="mt-1"/>
|
||||
<p >进行中</p>
|
||||
</div>
|
||||
<div class="flex absolute right-16">
|
||||
<p class="text-teal-300 font-bold text-2xl">2</p>
|
||||
<p class="text-teal-300 mt-2">人/天</p>
|
||||
</div>
|
||||
<button class="absolute right-8 w-6 h-6 flex items-center justify-center bg-teal-400 text-black rounded-full transition duration-300 ease-in-out transform hover:scale-105" @click="$router.push('/WorkLoad/I_Manage/UserManageModule')">
|
||||
<svg aria-hidden="true" class="rtl:rotate-180 w-4 h-4 text-white" fill="none" viewBox="0 0 14 10" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</a-card>
|
||||
<a-card class="relative bg-rose-400 w-72 h-36 text-white rounded-xl">
|
||||
<div class="flex space-x-9">
|
||||
<p class="absolute left-4 top-4">权限管理模块</p>
|
||||
<p class="absolute right-4 top-4">负责人: 无</p>
|
||||
</div>
|
||||
<div class="flex flex-col mt-8">
|
||||
<p class="text-green-100">剩余 1 天</p>
|
||||
<CaretUpOutlined class="absolute bottom-[32%] ml-2"/>
|
||||
</div>
|
||||
<div class="left-0 absolute bottom-0 h-[35%] w-full bg-white flex justify-center items-center space-x-3">
|
||||
<div class="text-rose-400 flex absolute left-5">
|
||||
<CheckOutlined class="mt-1"/>
|
||||
<p >进行中</p>
|
||||
</div>
|
||||
<div class="flex absolute right-16">
|
||||
<p class="text-rose-400 font-bold text-2xl">2</p>
|
||||
<p class="text-rose-400 mt-2">人/天</p>
|
||||
</div>
|
||||
<button class="absolute right-8 w-6 h-6 flex items-center justify-center bg-rose-400 text-black rounded-full transition duration-300 ease-in-out transform hover:scale-105" @click="$router.push('/WorkLoad/I_Manage/AuthorityManageModule')">
|
||||
<svg aria-hidden="true" class="rtl:rotate-180 w-4 h-4 text-white" fill="none" viewBox="0 0 14 10" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</a-card>
|
||||
</div>
|
||||
</div>
|
||||
<!--新增子模块对话框-->
|
||||
|
@ -133,10 +83,26 @@
|
|||
</template>
|
||||
<script setup>
|
||||
import {CaretUpOutlined, CheckOutlined} from '@ant-design/icons-vue';
|
||||
import {ref} from 'vue';
|
||||
import {onMounted, ref} from 'vue';
|
||||
import request from "@/js/request.js";
|
||||
|
||||
const AddModule = ref(false)
|
||||
function showAddModal(){
|
||||
AddModule.value = true;
|
||||
}
|
||||
//根据子系统id获取子模块
|
||||
const token = window.localStorage.getItem('token')
|
||||
const ChildModules = ref([]);
|
||||
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const sysId = params.get('id');
|
||||
|
||||
onMounted(() => {
|
||||
request.moduleGetBySysId(sysId, token).then((res) => {
|
||||
console.log("ChildModules:", res)
|
||||
ChildModules.value = res.data.data
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
</script>
|
|
@ -29,7 +29,9 @@
|
|||
</div>
|
||||
<div class="mt-12 ml-12 flex space-x-16 h-full">
|
||||
<div class="flex space-x-9">
|
||||
<a-card v-for="(ChildProject, index) in ChildProjects" :key="index" class="transition-transform transform-gpu hover:scale-105 relative w-[450px] h-64 rounded-none bg-cover bg-center bg-[url('@/assert/images/img23.jpg')]" @mouseleave="showButton[index]=false" @mouseover="showButton[index]=true">
|
||||
<a-card v-for="(ChildProject, index) in ChildProjects" :key="index"
|
||||
class="transition-transform transform-gpu hover:scale-105 relative w-[450px] h-64 rounded-none bg-cover bg-center bg-[url('@/assert/images/img23.jpg')]"
|
||||
@mouseleave="showButton[index]=false" @mouseover="showButton[index]=true">
|
||||
<div class="flex absolute left-0 bottom-0 min-h-[30%] w-full bg-white">
|
||||
<p class="ml-6 mt-4 text-2xl font-bold tracking-tight text-gray-900">{{ ChildProject.name }}</p>
|
||||
<div class="flex mt-7 space-x-3">
|
||||
|
@ -37,9 +39,13 @@
|
|||
<p class="text-xl text-green-400 font-bold">10天</p>
|
||||
</div>
|
||||
<div class="ml-auto mr-10">
|
||||
<button v-if="showButton[index]" class="mt-8 w-6 h-6 flex items-center justify-center bg-green-400 text-black rounded-full transition duration-300 ease-in-out transform hover:scale-105" @click="$router.push('/WorkLoad/I_Manage/ChildSystem')">
|
||||
<svg aria-hidden="true" class="rtl:rotate-180 w-4 h-4 text-white" fill="none" viewBox="0 0 14 10" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<button v-if="showButton[index]"
|
||||
class="mt-8 w-6 h-6 flex items-center justify-center bg-green-400 text-black rounded-full transition duration-300 ease-in-out transform hover:scale-105"
|
||||
@click="$router.push('/WorkLoad/I_Manage/ChildSystem?id=' + ChildProject.id)">
|
||||
<svg aria-hidden="true" class="rtl:rotate-180 w-4 h-4 text-white" fill="none" viewBox="0 0 14 10"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
||||
stroke-width="2"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -64,7 +70,8 @@ const tagsData = ref([]);
|
|||
const selectTags = ref([false, false, false, false]);
|
||||
const data = reactive({
|
||||
tags: [],
|
||||
isFinish:[0,1,2,-1]
|
||||
isFinish: [0, 1, 2, -1],
|
||||
is: 1
|
||||
})
|
||||
|
||||
|
||||
|
@ -119,8 +126,7 @@ const handleClickAll=(checked)=>{
|
|||
const handleChange = (tag, checked) => {
|
||||
if (checked) {
|
||||
tagAll.value = false
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
let flag = true
|
||||
selectTags.value.forEach((item, index) => {
|
||||
if (item) {
|
||||
|
@ -134,7 +140,6 @@ const handleChange = (tag, checked) => {
|
|||
};
|
||||
|
||||
|
||||
|
||||
// 有关新增
|
||||
const handleAdd = () => {
|
||||
console.log('新增')
|
||||
|
@ -142,9 +147,6 @@ const handleAdd=()=>{
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 当组件挂载时 请求tag数据
|
||||
onMounted(
|
||||
() => {
|
||||
|
|
|
@ -21,16 +21,22 @@
|
|||
</div>
|
||||
<div class="flex flex-row justify-start space-x-5 container">
|
||||
<div v-for="(ChildSystem, index) in ChildSystems" :key="index" class="flex flex-row justify-start space-x-5">
|
||||
<a-card class="transition-transform transform-gpu hover:scale-105 relative w-[260px] h-[300px] bg-cover bg-center bg-[url('@/assert/images/img44.jpg')]" @mouseleave="showButton[index]=false" @mouseover="showButton[index]=true">
|
||||
<a-card
|
||||
class="transition-transform transform-gpu hover:scale-105 relative w-[260px] h-[300px] bg-cover bg-center bg-[url('@/assert/images/img44.jpg')]"
|
||||
@mouseleave="showButton[index]=false" @mouseover="showButton[index]=true">
|
||||
<div class="flex absolute left-0 bottom-0 min-h-[30%] w-full bg-white">
|
||||
<div class="flex flex-col">
|
||||
<p class="ml-6 mt-4 text-3xl font-bold tracking-tight text-gray-900">01</p>
|
||||
<p class="ml-3 text-xl">{{ ChildSystem.name }}</p>
|
||||
</div>
|
||||
<div class="ml-auto mr-10">
|
||||
<button v-if="showButton[index]" class="mt-8 w-6 h-6 flex items-center justify-center bg-green-400 text-black rounded-full transition duration-300 ease-in-out transform hover:scale-105" @click="EnterChildModule(ChildSystem)" >
|
||||
<svg aria-hidden="true" class="rtl:rotate-180 w-4 h-4 text-white" fill="none" viewBox="0 0 14 10" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/>
|
||||
<button v-if="showButton[index]"
|
||||
class="mt-8 w-6 h-6 flex items-center justify-center bg-green-400 text-black rounded-full transition duration-300 ease-in-out transform hover:scale-105"
|
||||
@click="EnterChildModule(ChildSystem)">
|
||||
<svg aria-hidden="true" class="rtl:rotate-180 w-4 h-4 text-white" fill="none" viewBox="0 0 14 10"
|
||||
xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round"
|
||||
stroke-linejoin="round" stroke-width="2"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
|
@ -41,10 +47,13 @@
|
|||
</div>
|
||||
</div>
|
||||
<!--新增子系统对话框-->
|
||||
<a-modal v-model:open="AddModule" :okButtonProps="{ style: { backgroundColor: '#347def',color: 'white'} }" cancel-text="取消" ok-text="确定" title="新增子系统">
|
||||
<a-modal v-model:open="AddModule" :okButtonProps="{ style: { backgroundColor: '#347def',color: 'white'} }"
|
||||
cancel-text="取消" ok-text="确定" title="新增子系统">
|
||||
<a-form>
|
||||
<div class="flex space-x-5">
|
||||
<a-form-item class="my-4" label="子系统名称:"><a-input class="h-8 w-36 border-gray-300 rounded-md"/></a-form-item>
|
||||
<a-form-item class="my-4" label="子系统名称:">
|
||||
<a-input class="h-8 w-36 border-gray-300 rounded-md"/>
|
||||
</a-form-item>
|
||||
<a-form-item class="my-4" label="状态:">
|
||||
<a-select
|
||||
ref="select"
|
||||
|
@ -58,11 +67,17 @@
|
|||
</a-form-item>
|
||||
</div>
|
||||
<div class="flex space-x-5">
|
||||
<a-form-item class="my-4" label="周期:"><a-input class="ml-[43px] h-8 w-36 border-gray-300 rounded-md"/></a-form-item>
|
||||
<a-form-item class="my-4" label="工作量:"><a-input class="ml-[15px] h-8 w-36 border-gray-300 rounded-md"/></a-form-item>
|
||||
<a-form-item class="my-4" label="周期:">
|
||||
<a-input class="ml-[43px] h-8 w-36 border-gray-300 rounded-md"/>
|
||||
</a-form-item>
|
||||
<a-form-item class="my-4" label="工作量:">
|
||||
<a-input class="ml-[15px] h-8 w-36 border-gray-300 rounded-md"/>
|
||||
</a-form-item>
|
||||
</div>
|
||||
<div class="flex space-x-5">
|
||||
<a-form-item class="my-4" label="负责人:"><a-input class="ml-[30px] h-8 w-36 border-gray-300 rounded-md"/></a-form-item>
|
||||
<a-form-item class="my-4" label="负责人:">
|
||||
<a-input class="ml-[30px] h-8 w-36 border-gray-300 rounded-md"/>
|
||||
</a-form-item>
|
||||
<a-form-item class="my-4" label="系统描述:">
|
||||
<a-textarea :rows="1" class="w-36 h-8"/>
|
||||
</a-form-item>
|
||||
|
@ -79,24 +94,19 @@ import router from "@/router/index.js";
|
|||
const showButton = reactive([]);
|
||||
const AddModule = ref(false)
|
||||
const token = window.localStorage.getItem('token')
|
||||
const id = window.localStorage.getItem('id')
|
||||
|
||||
function showAddModal() {
|
||||
AddModule.value = true;
|
||||
}
|
||||
|
||||
const ChildProjects = ref([]); // 使用ref创建响应式数据
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const getId = params.get('id');
|
||||
|
||||
const ChildSystems = ref([]);
|
||||
const data =reactive({
|
||||
tags:[],
|
||||
isFinish:[0,1,2,-1]
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
request.projectWorkGet(data, token).then((res) => {
|
||||
ChildProjects.value = res.data.data;
|
||||
})
|
||||
request.moduleGetByProjectId(id, token).then((res) => {
|
||||
console.log("childModules:", res)
|
||||
request.moduleGetByProjectId(getId, token).then((res) => {
|
||||
console.log("childSystems:", res)
|
||||
ChildSystems.value = res.data.data
|
||||
})
|
||||
})
|
||||
|
@ -104,7 +114,6 @@ onMounted(() => {
|
|||
|
||||
function EnterChildModule(ChildSystem) {
|
||||
console.log(ChildSystem.id)
|
||||
window.localStorage.setItem('id',ChildSystem.id)
|
||||
router.push('/WorkLoad/I_Manage/ChildModule')
|
||||
router.push('/WorkLoad/I_Manage/ChildModule?id=' + ChildSystem.id)
|
||||
}
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user