feat(project): 添加项目列表排序功能和调整界面布局

- 在项目列表中添加排序功能,支持按最后操作时间等字段排序
- 新增最后操作时间列显示项目更新时间
- 将操作列宽度从300调整为400以适应更多操作按钮
- 调整详情抽屉和表单的标签宽度从120px到150px
- 修复后端时间格式化问题,将更新时间格式调整为完整时间格式
- 优化数据库查询,添加更新时间字段到查询结果中
- 修复更新语句中合作伙伴代码和文件ID的更新逻辑
dev_1.0.0
chenhao 2026-01-07 20:41:53 +08:00
parent 59b045d457
commit 602d06aafc
5 changed files with 29 additions and 9 deletions

View File

@ -9,7 +9,7 @@
:with-header="true"
>
<div class="drawer-container">
<el-form ref="form" :model="form" label-width="120px">
<el-form ref="form" :model="form" label-width="150px">
<el-tabs v-model="activeTab">
<el-tab-pane label="项目信息" name="projectInfo">
<div class="tab-content">

View File

@ -2,7 +2,7 @@
<div>
<!-- 添加或修改项目管理对话框 -->
<el-dialog :title="title" :visible.sync="localVisible" width="80%" append-to-body :close-on-click-modal="false" @close="cancel">
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form ref="form" :model="form" :rules="rules" label-width="150px">
<el-tabs v-model="activeTab">
<el-tab-pane label="项目信息" name="projectInfo">
<div style="max-height: 60vh; overflow-y: auto; padding: 15px;">

View File

@ -154,7 +154,7 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange">
<el-table v-loading="loading" :data="projectList" @selection-change="handleSelectionChange" @sort-change="handleSortChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="项目编号" align="center" prop="projectCode" width="100" />
<el-table-column label="项目名称" align="center" prop="projectName" width="300">
@ -202,6 +202,11 @@
<span>{{ parseTime(scope.row.lastWorkUpdateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="最后操作时间" align="center" prop="updateTime" width="160" sortable="custom" :sort-orders="['descending', 'ascending']">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="收藏" align="center" prop="collect" width="60" fixed="right">
<template slot-scope="scope">
<el-checkbox v-model="scope.row.collect" true-label="1" false-label="0" @change="handleCollectChange(scope.row)" />
@ -213,7 +218,7 @@
<el-checkbox v-else v-model="scope.row.jointTrial" true-label="1" false-label="0" @change="handleJoinTrialChange(scope.row)"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="300" fixed="right">
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="400" fixed="right">
<template slot-scope="scope">
<el-button
size="mini"
@ -389,6 +394,18 @@ export default {
}
},
methods: {
handleSortChange(column) {
this.queryParams.orderByColumn = column.prop;
if (column.order === 'ascending') {
this.queryParams.isAsc = 'asc';
} else if (column.order === 'descending') {
this.queryParams.isAsc = 'desc';
} else {
this.queryParams.isAsc = null;
this.queryParams.orderByColumn = null;
}
this.getList();
},
/** 查询项目管理列表 */
getList() {
this.loading = true;

View File

@ -171,8 +171,8 @@ public class ProjectInfo extends BaseEntity
private Date updateTimeEnd;
private Date updateTime;
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@Excel(name = "更新时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date lastWorkUpdateTime;
private Date lastWorkUpdateTimeStart;
private Date lastWorkUpdateTimeEnd;

View File

@ -90,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
t3.user_name as hz_support_user_name,
t5.level,
t5.contact_email as partner_email,
t1.update_time ,
ifnull(t4.work_time,t1.update_time) as last_work_update_time
from project_info t1
left join agent_info t2 on t1.agent_code = t2.agent_code
@ -353,8 +354,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectGraspDegree != null">project_grasp_degree = #{projectGraspDegree},</if>
<if test="hzSupportUser != null">hz_support_user = #{hzSupportUser},</if>
<if test="operateInstitution != null">operate_institution = #{operateInstitution},</if>
partner_code = #{partnerCode},
file_id = #{fileId},
<if test="partnerName != null">partner_name = #{partnerName},</if>
<if test="partnerUserName != null">partner_user_name = #{partnerUserName},</if>
<if test="partnerEmail != null">partner_email=#{partnerEmail},</if>
@ -370,7 +370,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="projectDesc != null">project_desc = #{projectDesc},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="jointTrial != null and jointTrial != ''"> joint_trial = #{jointTrial},</if>
<if test="softwareInfo != null">software_info = #{softwareInfo},</if>
@ -380,6 +380,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="desktopVmOsVersion != null">desktop_vm_os_version = #{desktopVmOsVersion},</if>
<if test="vmSpecQuantity != null">vm_spec_quantity = #{vmSpecQuantity},</if>
<if test="jointTrialResult != null">joint_trial_result = #{jointTrialResult},</if>
partner_code = #{partnerCode},
file_id = #{fileId},
update_by = now()
</trim>
where id = #{id}
</update>