子系统新增

This commit is contained in:
妖姐 2024-03-16 17:13:13 +08:00
parent b49493c795
commit 2af8bdb875
3 changed files with 49 additions and 60 deletions

View File

@ -506,7 +506,7 @@ const infoEditSettingHeaderImage = (showType, token) => {
*/
const projectGet =(token,url) => {
return axios({
url:api+ "/project/get",
url:api+ "/project/get"+url,
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}&is=1`,
url:`${api}/project/work/get?${queryTags}&${queryIsFinish}`,
method: "get",
headers:{
'content-type': 'application/json;charset=utf-8',
@ -675,24 +675,18 @@ const moduleGetByProjectId = (projectId, token) => {
}
/**
* 根据子系统id获取子模块信息
* @param sysId
* @param token
*/
const moduleGetBySysId = (sysId, token) => {
return axios({
url: api + "/module/get/min?sysId=" + sysId,
method:"get",
headers: {
/*const moduleGetByProjectId = (projectId, token) => {
return axios ({
url:api + "/module/get",
methods:"get",
params:projectId,
headers:{
'Authorization':'Bearer '+token,
'Content-Type': 'application/json;charset=utf-8',
'content-type': 'application/json;charset=utf-8',
'Timestamp': getCurrentTimestamp()
}
})
}
}*/
export default {
login,
@ -736,7 +730,7 @@ export default {
projectWorkGet,
moduleGetByProjectId,
moduleGetBySysId,
messageGet,

View File

@ -114,8 +114,8 @@
</div>
<template >
<a-tag v-for="(project, index) in projects" :color="color[index]">
{{ project.tag }}
<a-tag v-for="(tag, index) in project.tags" :color="color[index]">
{{ tag }}
</a-tag>
<a-button type="text" shape="circle" :icon="ArrowRightOutlined"></a-button>
</template>
@ -145,7 +145,10 @@ import {
const color = ['pink','red','green','orange','cyan','blue','purple']
const showButton = reactive([]);
const projects = ref([]);
const projects = ref([
]);
const id =ref(1)
const data = reactive({
id:'',
@ -168,6 +171,7 @@ function getAllProject(){
request.projectGetCustom(data).then((res)=>{
projects.value = res.data.data;
console.log('查询到的所有项目',projects.value)
})
// loading.value = true;
// console.log('zmhuisss',loading.value)

View File

@ -8,9 +8,9 @@
<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="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 class="text-lg">项目名称梁溪区纪委大数据管理平台{{ChildSystems.name}}</p>
<p>项目周期3个月</p>
<p>项目开始时间</p>
<p>项目完成时间</p>
@ -21,22 +21,16 @@
</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>
<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>
@ -47,13 +41,10 @@
</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"
@ -67,24 +58,18 @@
</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-textarea :rows="1" class="w-36 h-8"/>
<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>
</a-modal >
</template>
<script setup>
import {onMounted, reactive, ref} from "vue";
@ -94,26 +79,32 @@ import router from "@/router/index.js";
const showButton = reactive([]);
const AddModule = ref(false)
const token = window.localStorage.getItem('token')
function showAddModal() {
const id = window.localStorage.getItem('id')
function showAddModal(){
AddModule.value = true;
}
const params = new URLSearchParams(window.location.search);
const getId = params.get('id');
const ChildProjects = ref([]); // 使ref
const ChildSystems = ref([]);
const data =reactive({
tags:[],
isFinish:[0,1,2,-1]
})
onMounted(() => {
request.moduleGetByProjectId(getId, token).then((res) => {
console.log("childSystems:", res)
request.projectWorkGet(data, token).then((res) => {
ChildProjects.value = res.data.data;
})
request.moduleGetByProjectId(id, token).then((res) => {
console.log("childModules:", res)
ChildSystems.value = res.data.data
})
})
function EnterChildModule(ChildSystem) {
console.log(ChildSystem.id)
router.push('/WorkLoad/I_Manage/ChildModule?id=' + ChildSystem.id)
function EnterChildModule(ChildSystem){
console.log(ChildSystem.id)
window.localStorage.setItem('id',ChildSystem.id)
router.push('/WorkLoad/I_Manage/ChildModule')
}
</script>