获取子模块

This commit is contained in:
GUjiYN 2024-03-16 16:56:40 +08:00
parent eaa3039faf
commit b49493c795
6 changed files with 287 additions and 303 deletions

View File

@ -506,7 +506,7 @@ const infoEditSettingHeaderImage = (showType, token) => {
*/ */
const projectGet =(token,url) => { const projectGet =(token,url) => {
return axios({ return axios({
url:api+ "/project/get"+url, url:api+ "/project/get",
method: "get", method: "get",
headers:{ headers:{
'Authorization':'Bearer '+token, 'Authorization':'Bearer '+token,
@ -625,7 +625,7 @@ const projectWorkGet = (data,token) =>{
const queryTags = `tags=${encodedTags.join('&tags=')}`; const queryTags = `tags=${encodedTags.join('&tags=')}`;
const queryIsFinish = `isFinish=${encodedIsFinish.join('&isFinish=')}`; const queryIsFinish = `isFinish=${encodedIsFinish.join('&isFinish=')}`;
return axios({ return axios({
url:`${api}/project/work/get?${queryTags}&${queryIsFinish}`, url:`${api}/project/work/get?${queryTags}&${queryIsFinish}&is=1`,
method: "get", method: "get",
headers:{ headers:{
'content-type': 'application/json;charset=utf-8', '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({ return axios({
url:api + "/module/get", url: api + "/module/get/min?sysId=" + sysId,
methods:"get", method:"get",
params:projectId,
headers: { headers: {
'Authorization':'Bearer '+token, 'Authorization':'Bearer '+token,
'content-type': 'application/json;charset=utf-8', 'Content-Type': 'application/json;charset=utf-8',
'Timestamp': getCurrentTimestamp() 'Timestamp': getCurrentTimestamp()
} }
}) })
}*/ }
export default { export default {
login, login,
@ -730,7 +736,7 @@ export default {
projectWorkGet, projectWorkGet,
moduleGetByProjectId, moduleGetByProjectId,
moduleGetBySysId,
messageGet, messageGet,

View File

@ -11,7 +11,8 @@ const router = createRouter({
{ {
path: "/", path: "/",
component: () => import ('../views/HomePage/Main.vue') component: () => import ('../views/HomePage/Main.vue')
},{ },
{
path: '/Project', path: '/Project',
name: 'Project', name: 'Project',
component: () => import('@/views/ProjectPage/ProjectList.vue') component: () => import('@/views/ProjectPage/ProjectList.vue')

View File

@ -8,7 +8,7 @@
<a-form-item <a-form-item
:rules="[{ required: true, message: '请输入您的用户名!' }]" :rules="[{ required: true, message: '请输入您的用户名!' }]"
label="用户名" label="用户名"
name="username" name="user"
style="margin-top: 20px; margin-left: 1vw" 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"/> <a-input v-model:value="formState.user" class="h-10 w-64 border-gray-300 rounded-md" type="text"/>

View File

@ -22,10 +22,10 @@
</div> </div>
</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"> <a-card class="relative bg-blue-400 w-72 h-36 text-white rounded-xl">
<div class="flex space-x-9"> <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> <p class="absolute right-4 top-4">负责人: </p>
</div> </div>
<div class="flex flex-col mt-8"> <div class="flex flex-col mt-8">
@ -48,56 +48,6 @@
</button> </button>
</div> </div>
</a-card> </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>
</div> </div>
<!--新增子模块对话框--> <!--新增子模块对话框-->
@ -133,10 +83,26 @@
</template> </template>
<script setup> <script setup>
import {CaretUpOutlined, CheckOutlined} from '@ant-design/icons-vue'; 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) const AddModule = ref(false)
function showAddModal(){ function showAddModal(){
AddModule.value = true; 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> </script>

View File

@ -29,7 +29,9 @@
</div> </div>
<div class="mt-12 ml-12 flex space-x-16 h-full"> <div class="mt-12 ml-12 flex space-x-16 h-full">
<div class="flex space-x-9"> <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"> <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> <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"> <div class="flex mt-7 space-x-3">
@ -37,9 +39,13 @@
<p class="text-xl text-green-400 font-bold">10</p> <p class="text-xl text-green-400 font-bold">10</p>
</div> </div>
<div class="ml-auto mr-10"> <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')"> <button v-if="showButton[index]"
<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"> 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"
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/> @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> </svg>
</button> </button>
</div> </div>
@ -64,7 +70,8 @@ const tagsData = ref([]);
const selectTags = ref([false, false, false, false]); 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
}) })
@ -119,8 +126,7 @@ const handleClickAll=(checked)=>{
const handleChange = (tag, checked) => { const handleChange = (tag, checked) => {
if (checked) { if (checked) {
tagAll.value = false tagAll.value = false
} } else {
else{
let flag = true let flag = true
selectTags.value.forEach((item, index) => { selectTags.value.forEach((item, index) => {
if (item) { if (item) {
@ -134,7 +140,6 @@ const handleChange = (tag, checked) => {
}; };
// //
const handleAdd = () => { const handleAdd = () => {
console.log('新增') console.log('新增')
@ -142,9 +147,6 @@ const handleAdd=()=>{
} }
// tag // tag
onMounted( onMounted(
() => { () => {

View File

@ -21,16 +21,22 @@
</div> </div>
<div class="flex flex-row justify-start space-x-5 container"> <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"> <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 absolute left-0 bottom-0 min-h-[30%] w-full bg-white">
<div class="flex flex-col"> <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-6 mt-4 text-3xl font-bold tracking-tight text-gray-900">01</p>
<p class="ml-3 text-xl">{{ ChildSystem.name }}</p> <p class="ml-3 text-xl">{{ ChildSystem.name }}</p>
</div> </div>
<div class="ml-auto mr-10"> <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)" > <button v-if="showButton[index]"
<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"> 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"
<path d="M1 5h12m0 0L9 1m4 4L9 9" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"/> @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> </svg>
</button> </button>
</div> </div>
@ -41,10 +47,13 @@
</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="新增子系统">
<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>
<a-form-item class="my-4" label="状态:"> <a-form-item class="my-4" label="状态:">
<a-select <a-select
ref="select" ref="select"
@ -58,11 +67,17 @@
</a-form-item> </a-form-item>
</div> </div>
<div class="flex space-x-5"> <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-form-item class="my-4" label="工作量:"><a-input class="ml-[15px] h-8 w-36 border-gray-300 rounded-md"/></a-form-item> <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>
<div class="flex space-x-5"> <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-form-item class="my-4" label="系统描述:">
<a-textarea :rows="1" class="w-36 h-8"/> <a-textarea :rows="1" class="w-36 h-8"/>
</a-form-item> </a-form-item>
@ -79,24 +94,19 @@ import router from "@/router/index.js";
const showButton = reactive([]); const showButton = reactive([]);
const AddModule = ref(false) const AddModule = ref(false)
const token = window.localStorage.getItem('token') const token = window.localStorage.getItem('token')
const id = window.localStorage.getItem('id')
function showAddModal() { function showAddModal() {
AddModule.value = true; AddModule.value = true;
} }
const ChildProjects = ref([]); // 使ref const params = new URLSearchParams(window.location.search);
const getId = params.get('id');
const ChildSystems = ref([]); const ChildSystems = ref([]);
const data =reactive({
tags:[],
isFinish:[0,1,2,-1]
})
onMounted(() => { onMounted(() => {
request.projectWorkGet(data, token).then((res) => { request.moduleGetByProjectId(getId, token).then((res) => {
ChildProjects.value = res.data.data; console.log("childSystems:", res)
})
request.moduleGetByProjectId(id, token).then((res) => {
console.log("childModules:", res)
ChildSystems.value = res.data.data ChildSystems.value = res.data.data
}) })
}) })
@ -104,7 +114,6 @@ onMounted(() => {
function EnterChildModule(ChildSystem) { function EnterChildModule(ChildSystem) {
console.log(ChildSystem.id) console.log(ChildSystem.id)
window.localStorage.setItem('id',ChildSystem.id) router.push('/WorkLoad/I_Manage/ChildModule?id=' + ChildSystem.id)
router.push('/WorkLoad/I_Manage/ChildModule')
} }
</script> </script>