项目排序
This commit is contained in:
parent
8e52fc7266
commit
4f3aa4b8ae
|
@ -15,7 +15,12 @@
|
||||||
and w.id = #{proRequest.workspaceId}
|
and w.id = #{proRequest.workspaceId}
|
||||||
</if>
|
</if>
|
||||||
</where>
|
</where>
|
||||||
order by p.update_time desc
|
<if test="proRequest.orders != null and proRequest.orders.size() > 0">
|
||||||
|
order by
|
||||||
|
<foreach collection="proRequest.orders" separator="," item="order">
|
||||||
|
p.${order.name} ${order.type}
|
||||||
|
</foreach>
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
<select id="getProjectIdByWorkspaceId" resultType="java.lang.String">
|
<select id="getProjectIdByWorkspaceId" resultType="java.lang.String">
|
||||||
select id
|
select id
|
||||||
|
|
|
@ -3,9 +3,12 @@ package io.metersphere.controller.request;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
public class ProjectRequest {
|
public class ProjectRequest {
|
||||||
private String workspaceId;
|
private String workspaceId;
|
||||||
private String name;
|
private String name;
|
||||||
|
private List<OrderRequest> orders;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,6 +10,7 @@ import io.metersphere.base.mapper.LoadTestMapper;
|
||||||
import io.metersphere.base.mapper.ProjectMapper;
|
import io.metersphere.base.mapper.ProjectMapper;
|
||||||
import io.metersphere.base.mapper.ext.*;
|
import io.metersphere.base.mapper.ext.*;
|
||||||
import io.metersphere.commons.exception.MSException;
|
import io.metersphere.commons.exception.MSException;
|
||||||
|
import io.metersphere.commons.utils.ServiceUtils;
|
||||||
import io.metersphere.commons.utils.SessionUtils;
|
import io.metersphere.commons.utils.SessionUtils;
|
||||||
import io.metersphere.controller.request.ProjectRequest;
|
import io.metersphere.controller.request.ProjectRequest;
|
||||||
import io.metersphere.dto.ProjectDTO;
|
import io.metersphere.dto.ProjectDTO;
|
||||||
|
@ -81,6 +82,7 @@ public class ProjectService {
|
||||||
if (StringUtils.isNotBlank(request.getName())) {
|
if (StringUtils.isNotBlank(request.getName())) {
|
||||||
request.setName(StringUtils.wrapIfMissing(request.getName(), "%"));
|
request.setName(StringUtils.wrapIfMissing(request.getName(), "%"));
|
||||||
}
|
}
|
||||||
|
request.setOrders(ServiceUtils.getDefaultOrder(request.getOrders()));
|
||||||
return extProjectMapper.getProjectWithWorkspace(request);
|
return extProjectMapper.getProjectWithWorkspace(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="search" @create="create"
|
<ms-table-header :is-tester-permission="true" :condition.sync="condition" @search="search" @create="create"
|
||||||
:create-tip="btnTips" :title="title"/>
|
:create-tip="btnTips" :title="title"/>
|
||||||
</template>
|
</template>
|
||||||
<el-table :data="items" style="width: 100%">
|
<el-table :data="items" style="width: 100%" @sort-change="sort">
|
||||||
<el-table-column prop="name" :label="$t('commons.name')">
|
<el-table-column prop="name" :label="$t('commons.name')">
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
<el-link type="info" @click="link(scope.row)">{{ scope.row.name }}</el-link>
|
<el-link type="info" @click="link(scope.row)">{{ scope.row.name }}</el-link>
|
||||||
|
@ -15,6 +15,8 @@
|
||||||
<el-table-column prop="description" :label="$t('commons.description')"/>
|
<el-table-column prop="description" :label="$t('commons.description')"/>
|
||||||
<!--<el-table-column prop="workspaceName" :label="$t('project.owning_workspace')"/>-->
|
<!--<el-table-column prop="workspaceName" :label="$t('project.owning_workspace')"/>-->
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
sortable
|
||||||
|
prop="createTime"
|
||||||
:label="$t('commons.create_time')"
|
:label="$t('commons.create_time')"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
|
@ -22,6 +24,8 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
sortable
|
||||||
|
prop="updateTime"
|
||||||
:label="$t('commons.update_time')"
|
:label="$t('commons.update_time')"
|
||||||
show-overflow-tooltip>
|
show-overflow-tooltip>
|
||||||
<template v-slot:default="scope">
|
<template v-slot:default="scope">
|
||||||
|
@ -67,7 +71,7 @@
|
||||||
import MsTableHeader from "../common/components/MsTableHeader";
|
import MsTableHeader from "../common/components/MsTableHeader";
|
||||||
import MsTableOperator from "../common/components/MsTableOperator";
|
import MsTableOperator from "../common/components/MsTableOperator";
|
||||||
import MsDialogFooter from "../common/components/MsDialogFooter";
|
import MsDialogFooter from "../common/components/MsDialogFooter";
|
||||||
import {getCurrentUser} from "../../../common/js/utils";
|
import {_sort, getCurrentUser} from "../../../common/js/utils";
|
||||||
import MsContainer from "../common/components/MsContainer";
|
import MsContainer from "../common/components/MsContainer";
|
||||||
import MsMainContainer from "../common/components/MsMainContainer";
|
import MsMainContainer from "../common/components/MsMainContainer";
|
||||||
|
|
||||||
|
@ -228,7 +232,11 @@
|
||||||
path: '/api/test/list/' + row.id
|
path: '/api/test/list/' + row.id
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
sort(column) {
|
||||||
|
_sort(column, this.condition);
|
||||||
|
this.list();
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue