获取子模块修复bug
This commit is contained in:
parent
61fd50f2c6
commit
6fb9ef8a5a
|
@ -687,6 +687,25 @@ const moduleGetByProjectId = (projectId, token) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据子系统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) => {
|
/*const moduleGetByProjectId = (projectId, token) => {
|
||||||
return axios ({
|
return axios ({
|
||||||
url:api + "/module/get",
|
url:api + "/module/get",
|
||||||
|
@ -742,7 +761,7 @@ export default {
|
||||||
projectWorkGet,
|
projectWorkGet,
|
||||||
|
|
||||||
moduleGetByProjectId,
|
moduleGetByProjectId,
|
||||||
|
moduleGetBySysId,
|
||||||
|
|
||||||
messageGet,
|
messageGet,
|
||||||
|
|
||||||
|
|
|
@ -89,6 +89,11 @@ const router = createRouter({
|
||||||
path: '/WorkLoad/I_Manage/ChildSystem',
|
path: '/WorkLoad/I_Manage/ChildSystem',
|
||||||
name: 'WorkLoad/I_Manage/ChildSystem',
|
name: 'WorkLoad/I_Manage/ChildSystem',
|
||||||
component: () => import('@/views/WorkLoadPage/I_Manage_ChildSystem.vue')
|
component: () => import('@/views/WorkLoadPage/I_Manage_ChildSystem.vue')
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: '/WorkLoad/I_Manage/Childsystem',
|
||||||
|
name: 'WorkLoad/I_Manage/ChildSystem',
|
||||||
|
component: () => import('@/views/WorkLoadPage/Childsystem.vue')
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
@ -51,7 +51,7 @@
|
||||||
</div>
|
</div>
|
||||||
</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="新增子模块" @ok="handleAdd">
|
||||||
<a-form>
|
<a-form>
|
||||||
<div class="flex space-x-5">
|
<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>
|
||||||
|
@ -83,7 +83,7 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import {CaretUpOutlined, CheckOutlined} from '@ant-design/icons-vue';
|
import {CaretUpOutlined, CheckOutlined} from '@ant-design/icons-vue';
|
||||||
import {onMounted, ref} from 'vue';
|
import {onMounted, reactive, ref} from 'vue';
|
||||||
import request from "@/js/request.js";
|
import request from "@/js/request.js";
|
||||||
|
|
||||||
const AddModule = ref(false)
|
const AddModule = ref(false)
|
||||||
|
@ -92,7 +92,17 @@ function showAddModal(){
|
||||||
}
|
}
|
||||||
//根据子系统id获取子模块
|
//根据子系统id获取子模块
|
||||||
const token = window.localStorage.getItem('token')
|
const token = window.localStorage.getItem('token')
|
||||||
const ChildModules = ref([]);
|
const ChildModules = ref({
|
||||||
|
data:[{
|
||||||
|
name:'',
|
||||||
|
id:-1,
|
||||||
|
isFinish:'',
|
||||||
|
workLoad:'',
|
||||||
|
description:'',
|
||||||
|
cycle:'',
|
||||||
|
principalUser: ''
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
const sysId = params.get('id');
|
const sysId = params.get('id');
|
||||||
|
@ -104,5 +114,30 @@ onMounted(() => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const formData = reactive({
|
||||||
|
name: "",
|
||||||
|
status: "",
|
||||||
|
cycle: "",
|
||||||
|
workLoad: "",
|
||||||
|
description: "",
|
||||||
|
isFinish:'',
|
||||||
|
type:1, //0代表子系统,1代表子模块
|
||||||
|
principalId:'',
|
||||||
|
projectId: '',
|
||||||
|
// pid: ''
|
||||||
|
});
|
||||||
|
|
||||||
|
const handleAdd = () => {
|
||||||
|
// 获取表单数据
|
||||||
|
// console.log(2222)
|
||||||
|
formData.projectId = ChildModules.data[0].id
|
||||||
|
console.log("formData:",formData)
|
||||||
|
request.projectWorkAdd(formData,token).then((res)=>{
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
|
||||||
|
// 关闭模态框
|
||||||
|
AddModule.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
</script>
|
</script>
|
119
src/views/WorkLoadPage/Childsystem.vue
Normal file
119
src/views/WorkLoadPage/Childsystem.vue
Normal file
|
@ -0,0 +1,119 @@
|
||||||
|
<template>
|
||||||
|
<div class="container ml-6">
|
||||||
|
<a-breadcrumb class="mt-6 ml-6">
|
||||||
|
<a-breadcrumb-item><a href="/WorkLoad/I_Manage">我管理的项目</a></a-breadcrumb-item>
|
||||||
|
<a-breadcrumb-item><a href="">子系统</a></a-breadcrumb-item>
|
||||||
|
</a-breadcrumb>
|
||||||
|
<div class="flex absolute right-8 mt-6 space-x-4">
|
||||||
|
<button class="rounded-lg bg-green-400 hover:bg-green-500 p-1.5 text-white">编辑</button>
|
||||||
|
<button class="rounded-lg bg-red-500 hover:bg-red-600 p-1.5 text-white" @click="showAddModal">新增子系统</button>
|
||||||
|
</div>
|
||||||
|
<div class="mt-12 ml-8 flex space-x-16 h-full">
|
||||||
|
<div class="flex flex-col space-y-6 border-r border-gray-200 w-80 h-full p-8">
|
||||||
|
<p class="text-lg">项目名称:梁溪区纪委大数据管理平台{{ ChildSystems.name }}</p>
|
||||||
|
<p>项目周期:3个月</p>
|
||||||
|
<p>项目开始时间:</p>
|
||||||
|
<p>项目完成时间:</p>
|
||||||
|
<div class="space-y-2">
|
||||||
|
<p>工作量:</p>
|
||||||
|
<p>20人/天</p>
|
||||||
|
</div>
|
||||||
|
</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">
|
||||||
|
<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"/>
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</a-card>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--新增子系统对话框-->
|
||||||
|
<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-select
|
||||||
|
ref="select"
|
||||||
|
style="width: 145px;margin-left: 1.7vw"
|
||||||
|
@focus="focus"
|
||||||
|
>
|
||||||
|
<a-select-option value="jack">进行中</a-select-option>
|
||||||
|
<a-select-option value="lucy">未开始</a-select-option>
|
||||||
|
<a-select-option value="disabled">已完成</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</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>
|
||||||
|
</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-textarea :rows="1" class="w-36 h-8"/>
|
||||||
|
</a-form-item>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</a-form>
|
||||||
|
</a-modal>
|
||||||
|
</template>
|
||||||
|
<script setup>
|
||||||
|
import {onMounted, reactive, ref} from "vue";
|
||||||
|
import request from "@/js/request.js";
|
||||||
|
import router from "@/router/index.js";
|
||||||
|
|
||||||
|
const showButton = reactive([]);
|
||||||
|
const AddModule = ref(false)
|
||||||
|
const token = window.localStorage.getItem('token')
|
||||||
|
|
||||||
|
function showAddModal() {
|
||||||
|
AddModule.value = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
const getId = params.get('id');
|
||||||
|
|
||||||
|
const ChildSystems = ref([]);
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
request.moduleGetByProjectId(getId, token).then((res) => {
|
||||||
|
console.log("childSystems:", res)
|
||||||
|
ChildSystems.value = res.data.data
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
function EnterChildModule(ChildSystem) {
|
||||||
|
console.log(ChildSystem.id)
|
||||||
|
router.push('/WorkLoad/I_Manage/ChildModule?id=' + ChildSystem.id)
|
||||||
|
}
|
||||||
|
</script>
|
|
@ -41,7 +41,7 @@
|
||||||
<div class="ml-auto mr-10">
|
<div class="ml-auto mr-10">
|
||||||
<button v-if="showButton[index]"
|
<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"
|
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)">
|
@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"
|
<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">
|
xmlns="http://www.w3.org/2000/svg">
|
||||||
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"
|
||||||
|
@ -71,7 +71,6 @@ const selectTags = ref([false, false, false, false]);
|
||||||
const data = reactive({
|
const data = reactive({
|
||||||
tags: [],
|
tags: [],
|
||||||
isFinish: [0, 1, 2, -1],
|
isFinish: [0, 1, 2, -1],
|
||||||
is: 1
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user