项目完善,bug修改

main
‘wangjiuyun 2024-10-16 17:32:16 +08:00
parent 7c2b45327f
commit d365e61242
20 changed files with 343 additions and 279 deletions

View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = PMS:新光线平台
VUE_APP_TITLE = 新光线平台
# 开发环境配置
ENV = 'development'

View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = PMS:新光线平台
VUE_APP_TITLE = 新光线平台
# 生产环境配置
ENV = 'production'

View File

@ -1,5 +1,5 @@
# 页面标题
VUE_APP_TITLE = PMS:新光线平台
VUE_APP_TITLE = 新光线平台
NODE_ENV = production

View File

@ -1,8 +1,8 @@
{
"name": "ruoyi",
"version": "3.8.8",
"description": "PMS:新光线平台",
"author": "PMS:新光线平台",
"description": "新光线平台",
"author": "新光线平台",
"license": "MIT",
"scripts": {
"dev": "vue-cli-service serve",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -247,13 +247,6 @@ body {
.search-item.short {
width: 24%;
}
.table-container {
flex: 1 1 auto;
height: 0;
.el-scrollbar {
min-height: 50px;
}
}
.page {
width: 100%;
@ -292,30 +285,6 @@ body {
background: rgba(0, 0, 0, 0);
border-radius: 0.1rem;
}
// tablecell
.el-table__body {
.cell {
font-size: 14px;
}
}
//
.el-table th > .cell {
display: inline-block;
white-space: nowrap;
word-break: keep-all;
text-overflow: unset;
}
//
:deep(.el-table__empty-block) {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
// .el-table__empty-text {
// color: #ffffff;
// }
}
:deep(.el-form-item__content) {

View File

@ -1,16 +1,16 @@
<template>
<div class="custom-table" ref="tableContainer">
{{ computedTableHeight }}
<el-table
ref="elTableRef"
:data="tableData"
:max-height="computedTableHeight"
v-bind="$attrs"
@selection-change="handleSelectionChange"
:border="border"
:highlight-current-row="highligt"
@row-click="rowClick"
:row-key="rowKey"
:maxHeight="maxHeight"
:height="tableHeight"
>
<el-table-column v-if="showSelection" type="selection" width="55" />
<el-table-column v-if="showIndex" type="index" width="50" label="序号" />
@ -27,7 +27,7 @@
<template v-if="column.type === 'multiButton'">
<div class="button-group">
<el-button
v-for="(data,index) in scope.row[column.prop]"
v-for="(data, index) in scope.row[column.prop]"
:key="index"
type="text"
size="small"
@ -142,6 +142,10 @@ export default {
type: String,
default: "id",
},
tableHeight: {
type: String,
default: "100%",
},
},
data() {
return {
@ -165,21 +169,6 @@ export default {
this.currentPage = val;
this.$emit("current-change", val);
},
updateTableHeight() {
this.$nextTick(() => {
if (this.tableContainer) {
const parentElement = this.tableContainer.parentElement;
const parentHeight = parentElement.clientHeight;
const tableTop =
this.tableContainer.getBoundingClientRect().top -
parentElement.getBoundingClientRect().top;
const paginationHeight = this.showPagination
? this.paginationContainer.offsetHeight + 30
: 0; // margin-top
this.computedTableHeight = parentHeight - tableTop - paginationHeight;
}
});
},
setCurrentRow(row) {
this.$refs.elTableRef.setCurrentRow(row);
},
@ -190,13 +179,13 @@ export default {
this.$refs.elTableRef?.toggleRowSelection(row, selected);
},
},
mounted() {
this.updateTableHeight();
window.addEventListener("resize", this.updateTableHeight);
},
beforeDestroy() {
window.removeEventListener("resize", this.updateTableHeight);
updated() {
if (this.$refs.elTableRef && this.$refs.elTableRef.doLayout) {
this.$refs.elTableRef.doLayout();
}
},
mounted() {},
beforeDestroy() {},
};
</script>
@ -218,29 +207,36 @@ export default {
::v-deep .el-table {
--el-table-text-align: center;
width: 100%;
flex: none;
}
::v-deep .el-table th {
text-align: center;
}
::v-deep .el-table .cell {
::v-deep .el-table .cell {
text-align: center;
}
/* 如果操作列需要特殊处理,可以添加以下样式 */
::v-deep .operation-column .cell {
::v-deep .operation-column .cell {
text-align: center;
display: flex;
justify-content: center;
}
::v-deep .el-table__inner-wrapper::before {
::v-deep .el-table__inner-wrapper::before {
display: none;
}
::v-deep .el-table-column--selection {
::v-deep .el-table-column--selection {
text-align: center;
}
.button-group ::v-deep .el-button {
.button-group ::v-deep .el-button {
margin: 0;
}
::v-deep .el-table__fixed {
background-color: #fff;
}
::v-deep .el-table {
max-height: 99%;
}
</style>

View File

@ -205,4 +205,7 @@ export default {
.dialog-footer .el-button:first-child {
margin-left: 0;
}
::v-deep .el-table {
max-height:360px !important;
}
</style>

View File

@ -10,20 +10,20 @@
</template>
<script>
import iframeToggle from "./IframeToggle/index"
import iframeToggle from "./IframeToggle/index";
export default {
name: 'AppMain',
name: "AppMain",
components: { iframeToggle },
computed: {
cachedViews() {
return this.$store.state.tagsView.cachedViews
return this.$store.state.tagsView.cachedViews;
},
key() {
return this.$route.path
}
}
}
return this.$route.path;
},
},
};
</script>
<style lang="scss" scoped>
@ -38,11 +38,14 @@ export default {
.fixed-header + .app-main {
padding-top: 50px;
}
::v-deep .el-table {
max-height: calc(100vh - 350px);
overflow: auto;
}
.hasTagsView {
.app-main {
/* 84 = navbar + tags-view = 50 + 34 */
min-height: calc(100vh - 84px);
min-height: calc(100vh - 100px);
}
.fixed-header + .app-main {
@ -60,8 +63,8 @@ export default {
}
::-webkit-scrollbar {
width: 6px;
height: 6px;
width: 15px;
height: 15px;
}
::-webkit-scrollbar-track {
@ -70,6 +73,6 @@ export default {
::-webkit-scrollbar-thumb {
background-color: #c0c0c0;
border-radius: 3px;
border-radius: 5px;
}
</style>

View File

@ -26,15 +26,18 @@
</template>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
<div class="avatar-wrapper">
<div class="avatar-wrapper df aic">
<span>
{{ $store.state.user.nickName }}
</span>
<img :src="avatar" class="user-avatar">
<i class="el-icon-caret-bottom" />
</div>
<el-dropdown-menu slot="dropdown">
<!-- <router-link to="/user/profile">
<router-link to="/user/profile">
<el-dropdown-item>个人中心</el-dropdown-item>
</router-link>
<el-dropdown-item @click.native="setting = true">
<!--<el-dropdown-item @click.native="setting = true">
<span>布局设置</span>
</el-dropdown-item> -->
<el-dropdown-item divided @click.native="logout">
@ -72,7 +75,7 @@ export default {
...mapGetters([
'sidebar',
'avatar',
'device'
'device',
]),
setting: {
get() {
@ -112,7 +115,7 @@ export default {
<style lang="scss" scoped>
.navbar {
height: 50px;
height: 56px;
overflow: hidden;
position: relative;
background: #fff;
@ -178,6 +181,7 @@ export default {
.avatar-wrapper {
margin-top: 5px;
position: relative;
gap:10px;
.user-avatar {
cursor: pointer;

View File

@ -74,20 +74,20 @@ export const constantRoutes = [
// }
// ]
},
// {
// path: '/user',
// component: Layout,
// hidden: true,
// redirect: 'noredirect',
// children: [
// {
// path: 'profile',
// component: () => import('@/views/system/user/profile/index'),
// name: 'Profile',
// meta: { title: '个人中心', icon: 'user' }
// }
// ]
// }
{
path: '/user',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: 'profile',
component: () => import('@/views/system/user/profile/index'),
name: 'Profile',
meta: { title: '个人中心', icon: 'user' }
}
]
}
]
// 动态路由,基于用户权限动态去加载

View File

@ -46,6 +46,12 @@ export const projectApi = {
url: `/business/project/team/${id}`,
method: 'delete',
}),
projectHasLogData: (data) => request({
url: `/business/project/updateCheck`,
method: 'POST',
data: data,
}),
}
// 工作日志

View File

@ -6,7 +6,7 @@
:rules="loginRules"
class="login-form"
>
<h3 class="title">PMS:新光线平台</h3>
<h3 class="title">新光线平台</h3>
<el-form-item prop="username">
<el-input
v-model="loginForm.username"
@ -96,8 +96,8 @@ export default {
return {
codeUrl: "",
loginForm: {
username: "admin",
password: "admin123",
username: "",
password: "",
rememberMe: false,
code: "",
uuid: "",

View File

@ -114,105 +114,113 @@
>新增成员</el-button
>
</div>
<CustomTable
:columns="columns"
:tableData="tableData"
:show-selection="false"
:show-index="true"
:show-pagination="false"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
>
<template slot="userName" slot-scope="{ row }">
<el-input
v-if="row.isNew"
v-model="row.userName"
placeholder="选择人员"
readonly
@click.native="openSelectUser(row)"
/>
<span v-else>{{ row.userName }}</span>
</template>
<template slot="post" slot-scope="{ row }">
<el-select
v-if="
(row.isEditing === true && row.teamId == row.teamId) || row.isNew
"
v-model="row.postId"
placeholder="请选择职位"
>
<el-option
v-for="post in postOptions"
:key="post.dictValue"
:label="post.dictLabel"
:value="post.dictValue"
<div class="f1">
<CustomTable
:columns="columns"
:tableData="tableData"
:show-selection="false"
:show-index="true"
:show-pagination="false"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
style="height: 100%;"
>
<template slot="userName" slot-scope="{ row }">
<el-input
v-if="row.isNew"
v-model="row.userName"
placeholder="选择人员"
readonly
@click.native="openSelectUser(row)"
/>
</el-select>
<span v-else>{{
postOptions.find((post) => post.dictValue === row.postId)
? postOptions.find((post) => post.dictValue === row.postId)
.dictLabel
: ""
}}</span>
</template>
<template slot="operation" slot-scope="{ row }">
<div class="operation-buttons">
<template v-if="row.isNew">
<el-button
text
type="text"
size="mini"
@click="confirmAddUser(row)"
>确认</el-button
>
<el-button
text
type="text"
size="mini"
@click="cancelAddUser(row)"
>取消</el-button
>
</template>
<template v-else-if="row.isEditing && row.teamId == row.teamId">
<el-button text type="text" size="mini" @click="saveUserEdit(row)"
>保存</el-button
>
<el-button
text
type="text"
size="mini"
@click="cancelUserEdit(row)"
>取消</el-button
>
</template>
<template v-else>
<el-button
type="text"
size="mini"
v-hasPermi="['project:detail:editUser']"
@click="editUser(row)"
>编辑</el-button
>
<el-button
type="text"
size="mini"
v-hasPermi="['project:detail:workLog']"
@click="showTimesheet(row)"
>工作日志</el-button
>
<el-button
type="text"
size="mini"
v-hasPermi="['project:detail:deleteUser']"
@click="confirmDelete(row)"
>删除</el-button
>
</template>
</div>
</template>
</CustomTable>
<span v-else>{{ row.userName }}</span>
</template>
<template slot="post" slot-scope="{ row }">
<el-select
v-if="
(row.isEditing === true && row.teamId == row.teamId) ||
row.isNew
"
v-model="row.postId"
placeholder="请选择职位"
>
<el-option
v-for="post in postOptions"
:key="post.dictValue"
:label="post.dictLabel"
:value="post.dictValue"
/>
</el-select>
<span v-else>{{
postOptions.find((post) => post.dictValue === row.postId)
? postOptions.find((post) => post.dictValue === row.postId)
.dictLabel
: ""
}}</span>
</template>
<template slot="operation" slot-scope="{ row }">
<div class="operation-buttons">
<template v-if="row.isNew">
<el-button
text
type="text"
size="mini"
@click="confirmAddUser(row)"
>确认</el-button
>
<el-button
text
type="text"
size="mini"
@click="cancelAddUser(row)"
>取消</el-button
>
</template>
<template v-else-if="row.isEditing && row.teamId == row.teamId">
<el-button
text
type="text"
size="mini"
@click="saveUserEdit(row)"
>保存</el-button
>
<el-button
text
type="text"
size="mini"
@click="cancelUserEdit(row)"
>取消</el-button
>
</template>
<template v-else>
<el-button
type="text"
size="mini"
v-hasPermi="['project:detail:editUser']"
@click="editUser(row)"
>编辑</el-button
>
<el-button
type="text"
size="mini"
v-hasPermi="['project:detail:workLog']"
@click="showTimesheet(row)"
>工作日志</el-button
>
<el-button
type="text"
size="mini"
v-hasPermi="['project:detail:deleteUser']"
@click="confirmDelete(row)"
>删除</el-button
>
</template>
</div>
</template>
</CustomTable>
</div>
</div>
<SelectUser
:dialogVisible="showSelectUser"
:multi-select="false"
@ -320,8 +328,8 @@ export default {
}
},
updateIsEdit() {
if (this.formData.projectId) this.isEditing = true;
else this.isEditing = false;
// if (this.formData.projectId) this.isEditing = true;
// else this.isEditing = false;
},
validateDates(rule, value, callback) {
if (this.formData.startDate && this.formData.endDate) {
@ -338,28 +346,45 @@ export default {
},
saveProject() {
if (!this.$refs.formRef) return;
this.$refs.formRef.validate(async (valid) => {
if (valid) {
const projectDataToSave = {
...this.formData,
startDate: this.formData.startDate
? new Date(this.formData.startDate).getTime()
? new Date(this.formData.startDate+' 00:00:00').getTime()
: null,
endDate: this.formData.endDate
? new Date(this.formData.endDate).getTime()
? new Date(this.formData.endDate+' 23:59:59').getTime()
: null,
};
if (!this.formData.projectId) {
const res = await projectApi.addProject(projectDataToSave);
this.formData.projectId = res.data.projectId;
this.formData.projectCode = res.data.projectCode;
this.$modal.msgSuccess("操作成功");
} else {
await projectApi.updateProject(projectDataToSave);
const hasLog = await projectApi.projectHasLogData({
projectId: this.formData.projectId,
startDate: this.formData.startDate + " 00:00:00",
endDate: this.formData.endDate + " 23:59:59",
});
if (!hasLog.data) {
this.$modal
.confirm(
`检测到项目时间范围外的日志记录,修改项目时间将导致这些日志被删除。请确认是否继续修改?`
)
.then(async () => {
await projectApi.updateProject(projectDataToSave);
});
} else {
await projectApi.updateProject(projectDataToSave);
this.$modal.msgSuccess("操作成功");
}
}
this.$modal.msgSuccess("项目保存成功");
} else {
this.$modal.msgError("请检查表单填写是否正确");
this.$modal.msgSuccess("操作成功");
}
});
},
@ -425,7 +450,7 @@ export default {
},
cancelUserEdit(row) {
row.isEditing = false;
row.postId=row.originalPost
row.postId = row.originalPost;
},
openSelectUser(row) {
this.currentEditingRow = row;
@ -483,7 +508,11 @@ export default {
showTimesheet(row) {
this.$router.push({
path: "/",
query: { userId: row.userId, projectId: this.formData.projectId,nickName:row.userName },
query: {
userId: row.userId,
projectId: this.formData.projectId,
nickName: row.userName,
},
});
},
confirmDelete(row) {
@ -585,7 +614,7 @@ export default {
<style lang="scss" scoped>
.project-management {
padding: 20px;
padding: 30px;
background-color: white;
height: 88vh;
box-sizing: border-box;
@ -595,7 +624,7 @@ export default {
}
.custom-form {
width: 80%;
width: 100%;
margin-bottom: 20px;
}
@ -646,7 +675,10 @@ export default {
flex-direction: column;
}
.userBox {
width: 80%;
width: 100%;
display: flex;
flex-direction: column;
flex: 1;
}
.table-actions {
width: 100%;

View File

@ -20,6 +20,7 @@
</el-form-item>
<el-form-item label="项目状态" class="form-item">
<el-select v-model="searchForm.projectState" placeholder="项目状态">
<el-option label="全部" value="" />
<el-option label="未启动" value="0" />
<el-option label="进行中" value="1" />
<el-option label="已完成" value="2" />
@ -41,38 +42,39 @@
>+ 新建项目</el-button
>
</div>
<CustomTable
:columns="columns"
:tableData="tableData"
:total="total"
:show-selection="false"
:show-index="true"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
>
<template slot="operation" slot-scope="{ row }">
<div class="operation-buttons">
<el-button
@click="handleEdit(row)"
type="text"
size="mini"
icon="el-icon-edit"
v-hasPermi="['project:list:eidt']"
>编辑</el-button
>
<el-button
type="text"
size="mini"
icon="el-icon-delete"
@click="handleDelete(row)"
v-hasPermi="['project:list:delete']"
>删除</el-button
>
</div>
</template>
</CustomTable>
<div class="f1 df">
<CustomTable
:columns="columns"
:tableData="tableData"
:total="total"
:show-selection="false"
:show-index="true"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
tableHeight="600"
>
<template slot="operation" slot-scope="{ row }">
<div class="operation-buttons">
<el-button
@click="handleEdit(row)"
type="text"
size="mini"
icon="el-icon-edit"
v-hasPermi="['project:list:eidt']"
>编辑</el-button
>
<el-button
type="text"
size="mini"
icon="el-icon-delete"
@click="handleDelete(row)"
v-hasPermi="['project:list:delete']"
>删除</el-button
>
</div>
</template>
</CustomTable>
</div>
<SelectUser
:dialogVisible="userSelectDialogVisible"
:multiSelect="false"
@ -184,11 +186,9 @@ export default {
},
handleDelete(row) {
this.currentDeleteItem = row;
this.$modal
.confirm(`是否确认删项目"${row.projectName}"`)
.then(() => {
return this.confirmDelete(row.menuId);
})
this.$modal.confirm(`是否确认删项目"${row.projectName}"`).then(() => {
return this.confirmDelete(row.menuId);
});
},
async confirmDelete() {
await projectApi.deleteProject(this.currentDeleteItem.projectId);
@ -242,6 +242,8 @@ export default {
height: 88vh;
box-sizing: border-box;
overflow: hidden;
display: flex;
flex-direction: column;
}
.search-bar {

View File

@ -2,6 +2,7 @@
<div class="project-progress-container">
<!-- 左侧固定列表格 -->
<div class="content flex-col">
<div class="shadowBox"></div>
<div class="flex-row aic mb20">
<h2 class="textC">项目执行表</h2>
<div class="date-range-container">
@ -26,6 +27,7 @@
:showPagination="false"
:showSummary="true"
:summaryMethod="getFixedColumnsSummaries"
tableHeight="600"
></CustomTable>
</div>
</div>
@ -220,6 +222,7 @@ export default {
height: 88vh;
background-color: white;
padding: 30px;
position: relative;
}
.content {
width: 100%;
@ -231,7 +234,7 @@ export default {
margin-bottom: 20px;
}
::v-deep .el-table {
height: 100% !important;
max-height: calc(100vh - 260px) !important;
}
::v-deep .el-table__header th {
background-color: #4a4a4a;
@ -285,9 +288,9 @@ export default {
}
/* 调整合计行的样式 */
::v-deep .el-table__footer-wrapper {
bottom: 0;
position: absolute;
font-weight: bold;
// bottom: 0;
// position: absolute;
// font-weight: bold;
color: #606266;
}
@ -319,5 +322,15 @@ export default {
}
::v-deep .el-table__fixed {
box-shadow: 5px 20px 20px rgba(7, 7, 7, 0.5) !important;
}
.shadowBox {
// position: absolute;
// box-shadow: 2px 10px 10px 2px rgba(7, 7, 7, 0.8) !important;
// width: 1px;
// height: 95%;
// left: 450px;
// z-index: 100;
}
</style>

View File

@ -34,6 +34,7 @@
:showPagination="false"
:showSummary="true"
:summaryMethod="getFixedColumnsSummaries"
:tableHeight="600"
></CustomTable>
</div>
</div>

View File

@ -1,7 +1,7 @@
<template>
<div class="register">
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form">
<h3 class="title">PMS:新光线平台</h3>
<h3 class="title">新光线平台</h3>
<el-form-item prop="username">
<el-input v-model="registerForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />

View File

@ -10,10 +10,7 @@
@click="toggleCollapse"
class="collapse-button"
>
<el-icon :size="20">
<!-- <ArrowLeft v-if="!isCollapsed" />
<ArrowRight v-else /> -->
</el-icon>
{{ !isCollapsed ? "收起" : "展开" }}
</el-button>
</div>
</div>
@ -25,13 +22,18 @@
{ prop: 'workTime', label: '工时(天)', align: 'center' },
]"
:tableData="projectList"
:rowClick="handleProjectClick"
:rowClick="
(row) => {
handleProjectClick(row, 1);
}
"
:show-summary="true"
:summary-method="getSummaries"
sum-text="合计工时h"
sum-text="合计工时("
:showPagination="false"
:highligt="true"
ref="projectRef"
style="height: 100%"
/>
</div>
</div>
@ -136,13 +138,19 @@
type="number"
v-model="logForm.workTime"
:max="logForm.max"
:placeholder="`剩余工时${logForm.max}`"
:placeholder="
projectInfo.userId == $store.state.user.id
? `可填报工时:${logForm.max}人天`
: ''
"
:disabled="!(projectInfo.userId == $store.state.user.id)"
:step="0.1"
min="0"
></el-input>
<el-button
type="text"
v-if="projectInfo.userId == $store.state.user.id"
>{{ `当天剩余可分配工时 ${logForm.max}` }}</el-button
>{{ `当天剩余可分配工时${logForm.max}` }}</el-button
>
</el-form-item>
<el-form-item label="工作内容">
@ -193,13 +201,14 @@ export default {
max: 1,
loggerId: "",
},
routeQuery: this.$route.query,
};
},
methods: {
toggleCollapse() {
this.isCollapsed = !this.isCollapsed;
},
async handleProjectClick(row) {
async handleProjectClick(row, first) {
if (!row.projectId) {
return;
}
@ -220,9 +229,9 @@ export default {
userId: this.projectInfo.userId,
});
this.logData = res2.data;
this.initDateColor();
this.initDateColor(first);
},
initDateColor() {
initDateColor(first) {
this.logData.map((item) => {
var ele = document.getElementById(item.date.split(" ")[0]);
if (ele) {
@ -233,6 +242,12 @@ export default {
}
}
});
if (document.getElementsByClassName("is-selected")[0] && first == 1) {
document.getElementsByClassName("is-selected")[0].className = document
.getElementsByClassName("is-selected")[0]
.className.replace("is-selected", "");
}
},
async openLogDialog(data) {
if (!this.projectInfo.projectId) {
@ -247,7 +262,10 @@ export default {
clickedDate.getTime() > currentDate.getTime() &&
clickedDate.getTime() < new Date(this.projectInfo.endDate).getTime()
) {
this.$modal.msgWarning("不可编辑未来日期");
if (this.projectInfo.userId == this.$store.state.user.id)
this.$modal.msgWarning("不可编辑未来日期");
else this.$modal.msgWarning("不可查看未来日期");
return;
}
@ -305,7 +323,7 @@ export default {
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = "合计工时(h";
sums[index] = "合计工时(";
return;
}
const values = data.map((item) => Number(item[column.property]));
@ -337,6 +355,9 @@ export default {
) {
this.$modal.msgWarning("工时只允许一位小数");
return;
} else if (this.logForm.workTime <= 0) {
this.$modal.msgWarning("工时不能小于等于0");
return;
}
let state =
new Date(this.logForm.loggerDate).getTime() ==
@ -363,6 +384,7 @@ export default {
async fetchUserProjects() {
try {
const response = await workLogApi.userProject(this.projectInfo.userId);
console.log(12333, this.projectList);
this.projectList = response.data;
if (this.projectList.length) {
let arr = [];
@ -371,28 +393,38 @@ export default {
(ele) => ele.projectId == this.$route.query.projectId
);
if (this.$route.query.projectId && arr.length) {
this.handleProjectClick(arr[0]);
this.handleProjectClick(arr[0], 1);
this.$refs.projectRef.setCurrentRow(arr[0]);
this.projectList = arr;
} else {
this.handleProjectClick(this.projectList[0]);
this.handleProjectClick(this.projectList[0], 1);
this.$refs.projectRef.setCurrentRow(this.projectList[0]);
}
}
} catch (error) {}
},
init() {
if (this.$route.query.userId) {
this.projectInfo.userId = this.$route.query.userId;
this.projectInfo.nickName = this.$route.query.nickName;
} else {
let userInfo = this.$store.state.user;
this.projectInfo.userId = userInfo.id;
this.projectInfo.nickName = userInfo.nickName;
}
//
this.fetchUserProjects();
},
},
watch: {
$route(to, from) {
if (!this.$route.query.userId) {
this.init();
}
},
},
mounted() {
if (this.$route.query.userId) {
this.projectInfo.userId = this.$route.query.userId;
this.projectInfo.nickName = this.$route.query.nickName;
} else {
let userInfo = this.$store.state.user;
this.projectInfo.userId = userInfo.id;
this.projectInfo.nickName = userInfo.nickName;
}
//
this.fetchUserProjects();
this.init();
},
};
</script>
@ -405,6 +437,7 @@ export default {
}
.project-list {
height: 88vh;
width: 300px;
border-right: 1px solid #dcdfe6;
transition: all 0.3s;
@ -481,8 +514,8 @@ export default {
.project-info-calendar .calendar-view ::v-deep .el-calendar-day {
height: 65px; /* 增加日期单元格高度(原高度 + 5px */
padding-top: 5px;
padding: 5px;
// padding-top: 5px;
padding: 3px;
}
.project-info-calendar .calendar-view ::v-deep .el-calendar-day.disabled {
@ -519,7 +552,9 @@ export default {
::v-deep .el-table {
width: 100% !important;
}
::v-deep .log-form .el-date-editor {
width: 100% !important;
}
::v-deep .el-table__body-wrapper {
overflow-x: hidden;
}

View File

@ -7,7 +7,7 @@ function resolve(dir) {
const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || 'PMS:新光线平台' // 网页标题
const name = process.env.VUE_APP_TITLE || '新光线平台' // 网页标题
const port = process.env.port || process.env.npm_config_port || 80 // 端口