|
|
|
<template>
|
|
|
|
<a-divider />
|
|
|
|
<div class="list-flex">
|
|
|
|
<div class="item-box" v-for="(item, index) in projects" :key="index">
|
|
|
|
<div class="one-level h-70 cursor-pointer flex items-center" @click="toDetail(item)">
|
|
|
|
<div class="icon"><img src="https://www.tall.wiki/staticrec/drag.svg" /></div>
|
|
|
|
<div class="detail">
|
|
|
|
<div class="name-box flex items-center">
|
|
|
|
<div class="name truncate">{{ item.name }}</div>
|
|
|
|
<div class="precent">50%</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="time">{{ dayjs(item.startTime).format('HH:mm:ss') }} 至 {{ dayjs(item.endTime).format('HH:mm:ss') }}</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="right" @click.stop="openMenu">
|
|
|
|
<RightOutlined v-if="!item.show" />
|
|
|
|
<DownOutlined v-else />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="two-box" v-for="(sonItem, sonIndex) in item.sonProjectList" :key="sonIndex">
|
|
|
|
<div class="two-flex">
|
|
|
|
<div class="two-level h-70 cursor-pointer flex items-center" @click="toDetail()">
|
|
|
|
<div class="icon"><img src="https://www.tall.wiki/staticrec/drag.svg" /></div>
|
|
|
|
<div class="detail">
|
|
|
|
<div class="name-box flex items-center">
|
|
|
|
<div class="name truncate">{{ sonItem.name }}</div>
|
|
|
|
<div class="precent">50%</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="time">{{ dayjs(sonItem.startTime).format('HH:mm:ss') }} 至 {{ dayjs(sonItem.endTime).format('HH:mm:ss') }}</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="right" @click.stop="openMenu">
|
|
|
|
<RightOutlined v-if="!sonItem.show" />
|
|
|
|
<DownOutlined v-else />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="three-box">
|
|
|
|
<div class="three-level h-70 cursor-pointer flex items-center" @click="toDetail()">
|
|
|
|
<div class="icon"><img src="https://www.tall.wiki/staticrec/drag.svg" /></div>
|
|
|
|
<div class="detail">
|
|
|
|
<div class="name-box flex items-center">
|
|
|
|
<div class="name truncate">项目名称</div>
|
|
|
|
<div class="precent">50%</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="time">11-21 00:00 至 11-21 23.59</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { reactive } from 'vue';
|
|
|
|
import { useStore } from 'vuex';
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
import { getProjects } from 'apis';
|
|
|
|
import { RightOutlined, DownOutlined } from '@ant-design/icons-vue';
|
|
|
|
|
|
|
|
const store = useStore();
|
|
|
|
const projects = reactive([]);
|
|
|
|
// const projectList = computed(() => store.state.projects.projects);
|
|
|
|
// watch( projectList, ( newVal, oldVal ) => { console.log( newVal + ":===" + oldVal ) })
|
|
|
|
// console.log('projectList', projectList)
|
|
|
|
|
|
|
|
// 获取项目列表
|
|
|
|
const getProjectsList = async (startTime, endTime) => {
|
|
|
|
try {
|
|
|
|
const data = await getProjects(startTime, endTime);
|
|
|
|
|
|
|
|
data.forEach(item => {
|
|
|
|
item.show = false;
|
|
|
|
|
|
|
|
if (item.sonsonProjectList) {
|
|
|
|
item.sonsonProjectList.forEach(sonItem => {
|
|
|
|
sonItem.show = false;
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
projects.push(item);
|
|
|
|
});
|
|
|
|
|
|
|
|
store.commit('projects/setProjects', data);
|
|
|
|
} catch (error) {
|
|
|
|
console.log(error);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
getProjectsList(dayjs().startOf('day').format('x'), dayjs().endOf('day').format('x'));
|
|
|
|
|
|
|
|
function toDetail(project) {
|
|
|
|
// 打开项目详情
|
|
|
|
// const { name, id, url } = project;
|
|
|
|
// url && (uni.$t.domain = url);
|
|
|
|
// this.$u.route('pages/project-webview/project-webview', {
|
|
|
|
// u: this.userId,
|
|
|
|
// p: id,
|
|
|
|
// pname: name,
|
|
|
|
// url: encodeURIComponent(url),
|
|
|
|
// });
|
|
|
|
|
|
|
|
const obj = {
|
|
|
|
u: project.userId,
|
|
|
|
p: project.id,
|
|
|
|
pname: project.name,
|
|
|
|
url: project.url,
|
|
|
|
};
|
|
|
|
|
|
|
|
store.commit('projects/setProject', obj);
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<script>
|
|
|
|
export default { name: 'Projects' };
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
.list-flex {
|
|
|
|
height: calc(100vh - 48px - 272px - 56px - 16px - 2px);
|
|
|
|
overflow-y: auto;
|
|
|
|
}
|
|
|
|
|
|
|
|
.ant-divider-horizontal {
|
|
|
|
height: 16px;
|
|
|
|
background: #eeeeee;
|
|
|
|
margin: 0;
|
|
|
|
}
|
|
|
|
.project-list {
|
|
|
|
padding: 16px 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
.h-70 {
|
|
|
|
height: 70px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.one-level {
|
|
|
|
padding: 0 16px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.two-level {
|
|
|
|
padding: 0 16px 0 32px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.three-level {
|
|
|
|
padding: 0 16px 0 48px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.item-box .icon {
|
|
|
|
margin-right: 8px;
|
|
|
|
width: 24px;
|
|
|
|
height: 24px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.detail {
|
|
|
|
width: calc(100% - 76px);
|
|
|
|
}
|
|
|
|
|
|
|
|
.name-box {
|
|
|
|
margin-bottom: 8px;
|
|
|
|
}
|
|
|
|
|
|
|
|
.name {
|
|
|
|
margin-right: 8px;
|
|
|
|
font-size: 14px;
|
|
|
|
line-height: 1;
|
|
|
|
font-weight: 600;
|
|
|
|
max-width: calc(100% - 56px);
|
|
|
|
color: #333333;
|
|
|
|
}
|
|
|
|
|
|
|
|
.precent {
|
|
|
|
width: 48px;
|
|
|
|
height: 18px;
|
|
|
|
line-height: 18px;
|
|
|
|
text-align: center;
|
|
|
|
border-radius: 18px;
|
|
|
|
background-color: rgba(24, 144, 255, 0.2);
|
|
|
|
color: #1890ff;
|
|
|
|
font-size: 12px;
|
|
|
|
font-weight: 600;
|
|
|
|
}
|
|
|
|
|
|
|
|
.time {
|
|
|
|
font-size: 12px;
|
|
|
|
color: #999999;
|
|
|
|
}
|
|
|
|
|
|
|
|
.right {
|
|
|
|
width: 14px;
|
|
|
|
margin-left: 30px;
|
|
|
|
}
|
|
|
|
|
|
|
|
::-webkit-scrollbar {
|
|
|
|
width: 0 !important;
|
|
|
|
}
|
|
|
|
</style>
|