Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
e6b2a577cb
|
@ -30,6 +30,9 @@
|
||||||
<select id="getMemberList" resultType="io.metersphere.base.domain.User">
|
<select id="getMemberList" resultType="io.metersphere.base.domain.User">
|
||||||
SELECT `user`.* FROM user_role JOIN `user` ON user_role.user_id = `user`.id
|
SELECT `user`.* FROM user_role JOIN `user` ON user_role.user_id = `user`.id
|
||||||
WHERE user_role.source_id = #{member.workspaceId} AND user_role.role_id = #{member.roleId}
|
WHERE user_role.source_id = #{member.workspaceId} AND user_role.role_id = #{member.roleId}
|
||||||
|
<if test="member.name != null">
|
||||||
|
AND `user`.name like CONCAT('%', #{member.name},'%')
|
||||||
|
</if>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
|
@ -3,9 +3,11 @@ package io.metersphere.controller;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
import io.metersphere.base.domain.Project;
|
import io.metersphere.base.domain.Project;
|
||||||
|
import io.metersphere.commons.constants.RoleConstants;
|
||||||
import io.metersphere.commons.utils.PageUtils;
|
import io.metersphere.commons.utils.PageUtils;
|
||||||
import io.metersphere.commons.utils.Pager;
|
import io.metersphere.commons.utils.Pager;
|
||||||
import io.metersphere.service.ProjectService;
|
import io.metersphere.service.ProjectService;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
@ -24,22 +26,26 @@ public class ProjectController {
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/add")
|
@PostMapping("/add")
|
||||||
|
@RequiresRoles(RoleConstants.TEST_MANAGER)
|
||||||
public Project addProject(@RequestBody Project project) {
|
public Project addProject(@RequestBody Project project) {
|
||||||
return projectService.addProject(project);
|
return projectService.addProject(project);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/list/{goPage}/{pageSize}")
|
@PostMapping("/list/{goPage}/{pageSize}")
|
||||||
|
@RequiresRoles(RoleConstants.TEST_MANAGER)
|
||||||
public Pager<List<Project>> getProjectList(@PathVariable int goPage, @PathVariable int pageSize) {
|
public Pager<List<Project>> getProjectList(@PathVariable int goPage, @PathVariable int pageSize) {
|
||||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||||
return PageUtils.setPageInfo(page, projectService.getProjectList());
|
return PageUtils.setPageInfo(page, projectService.getProjectList());
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/delete/{projectId}")
|
@GetMapping("/delete/{projectId}")
|
||||||
|
@RequiresRoles(RoleConstants.TEST_MANAGER)
|
||||||
public void deleteProject(@PathVariable(value = "projectId") String projectId) {
|
public void deleteProject(@PathVariable(value = "projectId") String projectId) {
|
||||||
projectService.deleteProject(projectId);
|
projectService.deleteProject(projectId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
|
@RequiresRoles(RoleConstants.TEST_MANAGER)
|
||||||
public void updateProject(@RequestBody Project Project) {
|
public void updateProject(@RequestBody Project Project) {
|
||||||
projectService.updateProject(Project);
|
projectService.updateProject(Project);
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ public class UserController {
|
||||||
* 获取成员用户
|
* 获取成员用户
|
||||||
*/
|
*/
|
||||||
@PostMapping("/member/list/{goPage}/{pageSize}")
|
@PostMapping("/member/list/{goPage}/{pageSize}")
|
||||||
@RequiresRoles(RoleConstants.TEST_MANAGER)
|
//@RequiresRoles(RoleConstants.TEST_MANAGER)
|
||||||
public Pager<List<User>> getMemberList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryMemberRequest request) {
|
public Pager<List<User>> getMemberList(@PathVariable int goPage, @PathVariable int pageSize, @RequestBody QueryMemberRequest request) {
|
||||||
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||||
return PageUtils.setPageInfo(page, userService.getMemberList(request));
|
return PageUtils.setPageInfo(page, userService.getMemberList(request));
|
||||||
|
@ -81,7 +81,7 @@ public class UserController {
|
||||||
* 添加成员
|
* 添加成员
|
||||||
*/
|
*/
|
||||||
@PostMapping("/member/add")
|
@PostMapping("/member/add")
|
||||||
@RequiresRoles(RoleConstants.TEST_MANAGER)
|
//@RequiresRoles(RoleConstants.TEST_MANAGER)
|
||||||
public void addMember(@RequestBody AddMemberRequest request) {
|
public void addMember(@RequestBody AddMemberRequest request) {
|
||||||
userService.addMember(request);
|
userService.addMember(request);
|
||||||
}
|
}
|
||||||
|
@ -90,7 +90,7 @@ public class UserController {
|
||||||
* 删除成员
|
* 删除成员
|
||||||
*/
|
*/
|
||||||
@GetMapping("/member/delete/{workspaceId}/{userId}")
|
@GetMapping("/member/delete/{workspaceId}/{userId}")
|
||||||
@RequiresRoles(RoleConstants.TEST_MANAGER)
|
//@RequiresRoles(RoleConstants.TEST_MANAGER)
|
||||||
public void deleteMember(@PathVariable String workspaceId, @PathVariable String userId) {
|
public void deleteMember(@PathVariable String workspaceId, @PathVariable String userId) {
|
||||||
userService.deleteMember(workspaceId, userId);
|
userService.deleteMember(workspaceId, userId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,13 @@
|
||||||
package io.metersphere.controller;
|
package io.metersphere.controller;
|
||||||
|
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.github.pagehelper.PageHelper;
|
||||||
import io.metersphere.base.domain.Workspace;
|
import io.metersphere.base.domain.Workspace;
|
||||||
|
import io.metersphere.commons.constants.RoleConstants;
|
||||||
|
import io.metersphere.commons.utils.PageUtils;
|
||||||
|
import io.metersphere.commons.utils.Pager;
|
||||||
import io.metersphere.service.WorkspaceService;
|
import io.metersphere.service.WorkspaceService;
|
||||||
|
import org.apache.shiro.authz.annotation.RequiresRoles;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
@ -13,18 +19,30 @@ public class WorkspaceController {
|
||||||
@Resource
|
@Resource
|
||||||
private WorkspaceService workspaceService;
|
private WorkspaceService workspaceService;
|
||||||
|
|
||||||
@PostMapping("save")
|
@PostMapping("add")
|
||||||
public Workspace saveWorkspace(@RequestBody Workspace workspace) {
|
@RequiresRoles(RoleConstants.ORG_ADMIN)
|
||||||
|
public Workspace addWorkspace(@RequestBody Workspace workspace) {
|
||||||
|
return workspaceService.saveWorkspace(workspace);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("update")
|
||||||
|
@RequiresRoles(RoleConstants.ORG_ADMIN)
|
||||||
|
public Workspace updateWorkspace(@RequestBody Workspace workspace) {
|
||||||
|
workspaceService.checkOwner(workspace.getId());
|
||||||
return workspaceService.saveWorkspace(workspace);
|
return workspaceService.saveWorkspace(workspace);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("delete/{workspaceId}")
|
@GetMapping("delete/{workspaceId}")
|
||||||
|
@RequiresRoles(RoleConstants.ORG_ADMIN)
|
||||||
public void saveWorkspace(@PathVariable String workspaceId) {
|
public void saveWorkspace(@PathVariable String workspaceId) {
|
||||||
|
workspaceService.checkOwner(workspaceId);
|
||||||
workspaceService.deleteWorkspace(workspaceId);
|
workspaceService.deleteWorkspace(workspaceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostMapping("list")
|
@PostMapping("list/{goPage}/{pageSize}")
|
||||||
public List<Workspace> getWorkspaceList() {
|
@RequiresRoles(RoleConstants.ORG_ADMIN)
|
||||||
return workspaceService.getWorkspaceList();
|
public Pager<List<Workspace>> getWorkspaceList(@PathVariable int goPage, @PathVariable int pageSize) {
|
||||||
|
Page<Object> page = PageHelper.startPage(goPage, pageSize, true);
|
||||||
|
return PageUtils.setPageInfo(page, workspaceService.getWorkspaceList());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,26 @@ package io.metersphere.controller.request.member;
|
||||||
import io.metersphere.commons.constants.RoleConstants;
|
import io.metersphere.commons.constants.RoleConstants;
|
||||||
|
|
||||||
public class QueryMemberRequest {
|
public class QueryMemberRequest {
|
||||||
|
private String name;
|
||||||
private String workspaceId;
|
private String workspaceId;
|
||||||
private String roleId = RoleConstants.TEST_MANAGER;
|
private String roleId = RoleConstants.TEST_MANAGER;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getRoleId() {
|
||||||
|
return roleId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRoleId(String roleId) {
|
||||||
|
this.roleId = roleId;
|
||||||
|
}
|
||||||
|
|
||||||
public String getWorkspaceId() {
|
public String getWorkspaceId() {
|
||||||
return workspaceId;
|
return workspaceId;
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,4 +45,9 @@ public class WorkspaceService {
|
||||||
public void deleteWorkspace(String workspaceId) {
|
public void deleteWorkspace(String workspaceId) {
|
||||||
workspaceMapper.deleteByPrimaryKey(workspaceId);
|
workspaceMapper.deleteByPrimaryKey(workspaceId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void checkOwner(String workspaceId) {
|
||||||
|
// TODO 验证当前用户是否拥有当前此空间权限
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,10 @@
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<el-row type="flex" justify="space-between" align="middle">
|
<el-row type="flex" justify="space-between" align="middle">
|
||||||
<span class="title">项目</span>
|
<span class="title">
|
||||||
|
项目
|
||||||
|
<ms-create-box :tips="btnTips" :exec="create"/>
|
||||||
|
</span>
|
||||||
<span class="search">
|
<span class="search">
|
||||||
<el-input type="text" size="small" placeholder="根据名称搜索" prefix-icon="el-icon-search"
|
<el-input type="text" size="small" placeholder="根据名称搜索" prefix-icon="el-icon-search"
|
||||||
maxlength="60" v-model="condition" clearable/>
|
maxlength="60" v-model="condition" clearable/>
|
||||||
|
@ -21,8 +24,24 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="22" :offset="1">
|
||||||
|
<div class="table-page">
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page.sync="currentPage"
|
||||||
|
:page-sizes="[5, 10, 20, 50, 100]"
|
||||||
|
:page-size="pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total">
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<ms-create-box :tips="btnTips" :exec="create"/>
|
|
||||||
|
|
||||||
<el-dialog title="创建项目" :visible.sync="createVisible">
|
<el-dialog title="创建项目" :visible.sync="createVisible">
|
||||||
<el-form :model="form" :rules="rules" ref="form" label-position="left" label-width="100px" size="small">
|
<el-form :model="form" :rules="rules" ref="form" label-position="left" label-width="100px" size="small">
|
||||||
|
@ -56,6 +75,9 @@
|
||||||
condition: "",
|
condition: "",
|
||||||
items: [],
|
items: [],
|
||||||
form: {},
|
form: {},
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 5,
|
||||||
|
total: 0,
|
||||||
rules: {
|
rules: {
|
||||||
name: [
|
name: [
|
||||||
{required: true, message: '请输入项目名称', trigger: 'blur'},
|
{required: true, message: '请输入项目名称', trigger: 'blur'},
|
||||||
|
@ -113,10 +135,19 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
list() {
|
list() {
|
||||||
this.$post("/project/list/1/10", {}, (response) => {
|
let url = "/project/list/" + this.currentPage + '/' + this.pageSize;
|
||||||
|
this.$post(url, {}, (response) => {
|
||||||
this.items = response.data;
|
this.items = response.data;
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
handleSizeChange(size) {
|
||||||
|
this.pageSize = size;
|
||||||
|
this.list();
|
||||||
|
},
|
||||||
|
handleCurrentChange(current) {
|
||||||
|
this.currentPage = current;
|
||||||
|
this.list();
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
<ms-create-box :tips="btnTips" :exec="create"/>
|
<ms-create-box :tips="btnTips" :exec="create"/>
|
||||||
</span>
|
</span>
|
||||||
<span class="search">
|
<span class="search">
|
||||||
<el-input type="text" size="small" placeholder="根据名称搜索" prefix-icon="el-icon-search"
|
<el-input type="text" size="small" placeholder="根据用户名搜索" prefix-icon="el-icon-search"
|
||||||
maxlength="60" v-model="condition" @change="search" clearable/>
|
maxlength="60" v-model="condition" @change="search" clearable/>
|
||||||
</span>
|
</span>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -42,16 +42,20 @@
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-dialog title="添加成员" :visible.sync="createVisible" width="30%">
|
<el-dialog title="添加成员" :visible.sync="createVisible" width="30%">
|
||||||
<el-form :model="form" :rules="rules" ref="form" label-position="left" label-width="100px" size="small">
|
<el-form :model="form" ref="form" :rules="rules" label-position="left" label-width="100px" size="small">
|
||||||
<el-form-item label="名称" prop="name">
|
<el-form-item label="成员" prop="userIds">
|
||||||
<el-input v-model="form.name" autocomplete="off"/>
|
<el-select v-model="form.userIds" multiple placeholder="请选择成员" class="select-width">
|
||||||
</el-form-item>
|
<el-option
|
||||||
<el-form-item label="描述">
|
v-for="item in form.userList"
|
||||||
<el-input type="textarea" v-model="form.description"></el-input>
|
:key="item.id"
|
||||||
|
:label="item.name"
|
||||||
|
:value="item.id">
|
||||||
|
</el-option>
|
||||||
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submit('form')" size="medium">创建</el-button>
|
<el-button type="primary" @click="submitForm('form')" size="medium">保存</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
|
@ -59,7 +63,6 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import MsCreateBox from "./CreateBox";
|
import MsCreateBox from "./CreateBox";
|
||||||
// import {Message} from "element-ui";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Member",
|
name: "Member",
|
||||||
|
@ -73,6 +76,11 @@
|
||||||
queryPath: "/user/member/list",
|
queryPath: "/user/member/list",
|
||||||
condition: "",
|
condition: "",
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
rules: {
|
||||||
|
userIds: [
|
||||||
|
{required: true, message: '请选择成员', trigger: ['blur', 'change']}
|
||||||
|
]
|
||||||
|
},
|
||||||
multipleSelection: [],
|
multipleSelection: [],
|
||||||
currentWorkspaceId: "0a2430b1-a818-4b9b-bc04-c1229c472896",
|
currentWorkspaceId: "0a2430b1-a818-4b9b-bc04-c1229c472896",
|
||||||
currentPage: 1,
|
currentPage: 1,
|
||||||
|
@ -85,6 +93,7 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
initTableData() {
|
initTableData() {
|
||||||
|
this.loading = true;
|
||||||
let param = {
|
let param = {
|
||||||
name: this.condition,
|
name: this.condition,
|
||||||
workspaceId: this.currentWorkspaceId
|
workspaceId: this.currentWorkspaceId
|
||||||
|
@ -98,13 +107,15 @@
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(response.message);
|
this.$message.error(response.message);
|
||||||
}
|
}
|
||||||
|
this.loading = false;
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
buildPagePath(path) {
|
buildPagePath(path) {
|
||||||
return path + "/" + this.currentPage + "/" + this.pageSize;
|
return path + "/" + this.currentPage + "/" + this.pageSize;
|
||||||
},
|
},
|
||||||
search() {
|
search() {
|
||||||
|
this.initTableData();
|
||||||
},
|
},
|
||||||
handleSizeChange(size) {
|
handleSizeChange(size) {
|
||||||
this.pageSize = size;
|
this.pageSize = size;
|
||||||
|
@ -118,14 +129,17 @@
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
|
this.loading = true;
|
||||||
this.$get('/user/member/delete/' + this.currentWorkspaceId + '/' + row.id).then(() => {
|
this.$get('/user/member/delete/' + this.currentWorkspaceId + '/' + row.id).then(() => {
|
||||||
this.initTableData();
|
this.initTableData();
|
||||||
|
this.loading = false;
|
||||||
});
|
});
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '删除成功!'
|
message: '删除成功!'
|
||||||
});
|
});
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
|
this.loading = false;
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
message: '已取消删除'
|
message: '已取消删除'
|
||||||
|
@ -133,8 +147,42 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
create() {
|
create() {
|
||||||
|
this.loading = true;
|
||||||
|
this.$get('/user/list').then(response => {
|
||||||
|
if (response.data.success) {
|
||||||
this.createVisible = true;
|
this.createVisible = true;
|
||||||
this.form = {};
|
this.form = {userList: response.data.data};
|
||||||
|
} else {
|
||||||
|
this.$message.error(response.message);
|
||||||
|
}
|
||||||
|
this.loading = false;
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '获取用户列表失败'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
submitForm(formName) {
|
||||||
|
this.loading = true;
|
||||||
|
this.$refs[formName].validate((valid) => {
|
||||||
|
if (valid) {
|
||||||
|
let param = {
|
||||||
|
userIds: this.form.userIds,
|
||||||
|
workspaceId: this.currentWorkspaceId
|
||||||
|
};
|
||||||
|
this.$post("user/member/add", param).then(() => {
|
||||||
|
this.initTableData();
|
||||||
|
this.createVisible = false;
|
||||||
|
this.loading = false;
|
||||||
|
}).catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -145,10 +193,6 @@
|
||||||
width: 240px;
|
width: 240px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.edit {
|
|
||||||
opacity: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.el-table__row:hover .edit {
|
.el-table__row:hover .edit {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
@ -158,4 +202,8 @@
|
||||||
margin-right: -9px;
|
margin-right: -9px;
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.select-width {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<el-row type="flex" justify="space-between" align="middle">
|
<el-row type="flex" justify="space-between" align="middle">
|
||||||
<span class="title">组织</span>
|
<span class="title">组织
|
||||||
|
<ms-create-box :tips="btnTips" :exec="create"/>
|
||||||
|
</span>
|
||||||
<span class="search">
|
<span class="search">
|
||||||
<el-input type="text" size="small" placeholder="根据名称搜索" prefix-icon="el-icon-search"
|
<el-input type="text" size="small" placeholder="根据名称搜索" prefix-icon="el-icon-search"
|
||||||
maxlength="60" v-model="condition" clearable/>
|
maxlength="60" v-model="condition" clearable/>
|
||||||
|
@ -23,7 +25,6 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<ms-create-box :tips="btnTips" :exec="create"/>
|
|
||||||
<el-dialog title="创建组织" :visible.sync="createVisible" width="30%" @closed="closeFunc" :destroy-on-close="true">
|
<el-dialog title="创建组织" :visible.sync="createVisible" width="30%" @closed="closeFunc" :destroy-on-close="true">
|
||||||
<el-form :model="form" label-position="left" label-width="100px" size="small" :rules="rule" ref="createOrganization">
|
<el-form :model="form" label-position="left" label-width="100px" size="small" :rules="rule" ref="createOrganization">
|
||||||
<el-form-item label="名称" prop="name">
|
<el-form-item label="名称" prop="name">
|
||||||
|
|
|
@ -5,9 +5,9 @@
|
||||||
<font-awesome-icon class="icon account" :icon="['far', 'address-card']" size="lg"/>
|
<font-awesome-icon class="icon account" :icon="['far', 'address-card']" size="lg"/>
|
||||||
<span>账号</span>
|
<span>账号</span>
|
||||||
</template>
|
</template>
|
||||||
<el-menu-item index="/setting/user" v-permission="['admin','test_user']">用户</el-menu-item>
|
<el-menu-item index="/setting/user">用户</el-menu-item>
|
||||||
<el-menu-item index="/setting/testresourcepool" v-permission="['test_user']">测试资源池</el-menu-item>
|
<el-menu-item index="/setting/testresourcepool">测试资源池</el-menu-item>
|
||||||
<el-menu-item index="/setting/organization" v-permission="['org_admin']">组织</el-menu-item>
|
<el-menu-item index="/setting/organization">组织</el-menu-item>
|
||||||
<el-menu-item index="/setting/workspace">工作空间</el-menu-item>
|
<el-menu-item index="/setting/workspace">工作空间</el-menu-item>
|
||||||
<el-menu-item>API Keys</el-menu-item>
|
<el-menu-item>API Keys</el-menu-item>
|
||||||
</el-submenu>
|
</el-submenu>
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<el-row type="flex" justify="space-between" align="middle">
|
<el-row type="flex" justify="space-between" align="middle">
|
||||||
<span class="title">测试资源池</span>
|
<span class="title">测试资源池
|
||||||
|
<ms-create-box :tips="btnTips" :exec="create"/>
|
||||||
|
</span>
|
||||||
<span class="search">
|
<span class="search">
|
||||||
<el-input type="text" size="small" placeholder="根据名称搜索" prefix-icon="el-icon-search"
|
<el-input type="text" size="small" placeholder="根据名称搜索" prefix-icon="el-icon-search"
|
||||||
maxlength="60" v-model="condition" clearable/>
|
maxlength="60" v-model="condition" clearable/>
|
||||||
|
@ -34,7 +36,6 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<ms-create-box :tips="btnTips" :exec="create"/>
|
|
||||||
<el-dialog title="创建资源池" :visible.sync="createVisible" width="30%" @closed="closeFunc" :destroy-on-close="true">
|
<el-dialog title="创建资源池" :visible.sync="createVisible" width="30%" @closed="closeFunc" :destroy-on-close="true">
|
||||||
<el-form :model="form" label-position="left" label-width="100px" size="small" :rules="rule" ref="createTestResourcePoolForm">
|
<el-form :model="form" label-position="left" label-width="100px" size="small" :rules="rule" ref="createTestResourcePoolForm">
|
||||||
<el-form-item label="名称" prop="name">
|
<el-form-item label="名称" prop="name">
|
||||||
|
|
|
@ -4,7 +4,9 @@
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<el-row type="flex" justify="space-between" align="middle">
|
<el-row type="flex" justify="space-between" align="middle">
|
||||||
<span class="title">用户</span>
|
<span class="title">用户
|
||||||
|
<ms-create-box :tips="btnTips" :exec="create"/>
|
||||||
|
</span>
|
||||||
<span class="search">
|
<span class="search">
|
||||||
<el-input type="text" size="small" placeholder="根据ID,名称搜索" prefix-icon="el-icon-search" maxlength="60" v-model="condition" clearable/>
|
<el-input type="text" size="small" placeholder="根据ID,名称搜索" prefix-icon="el-icon-search" maxlength="60" v-model="condition" clearable/>
|
||||||
</span>
|
</span>
|
||||||
|
@ -36,7 +38,6 @@
|
||||||
</el-table>
|
</el-table>
|
||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<ms-create-box :tips="btnTips" :exec="create"/>
|
|
||||||
<el-dialog title="创建用户" :visible.sync="createVisible" width="30%" @closed="closeFunc" :destroy-on-close="true">
|
<el-dialog title="创建用户" :visible.sync="createVisible" width="30%" @closed="closeFunc" :destroy-on-close="true">
|
||||||
<el-form :model="form" label-position="left" label-width="100px" size="small" :rules="rule" ref="createUserForm">
|
<el-form :model="form" label-position="left" label-width="100px" size="small" :rules="rule" ref="createUserForm">
|
||||||
<el-form-item label="ID" prop="id">
|
<el-form-item label="ID" prop="id">
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
<el-card>
|
<el-card>
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<el-row type="flex" justify="space-between" align="middle">
|
<el-row type="flex" justify="space-between" align="middle">
|
||||||
<span class="title">工作空间</span>
|
<span class="title">
|
||||||
|
工作空间
|
||||||
|
<ms-create-box :tips="btnTips" :exec="create"/>
|
||||||
|
</span>
|
||||||
<span class="search">
|
<span class="search">
|
||||||
<el-input type="text" size="small" placeholder="根据名称搜索" prefix-icon="el-icon-search"
|
<el-input type="text" size="small" placeholder="根据名称搜索" prefix-icon="el-icon-search"
|
||||||
maxlength="60" v-model="condition" clearable/>
|
maxlength="60" v-model="condition" clearable/>
|
||||||
|
@ -20,8 +23,25 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
<div>
|
||||||
|
<el-row>
|
||||||
|
<el-col :span="22" :offset="1">
|
||||||
|
<div class="table-page">
|
||||||
|
<el-pagination
|
||||||
|
@size-change="handleSizeChange"
|
||||||
|
@current-change="handleCurrentChange"
|
||||||
|
:current-page.sync="currentPage"
|
||||||
|
:page-sizes="[5, 10, 20, 50, 100]"
|
||||||
|
:page-size="pageSize"
|
||||||
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
|
:total="total">
|
||||||
|
</el-pagination>
|
||||||
|
</div>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
<ms-create-box :tips="btnTips" :exec="create"/>
|
|
||||||
<el-dialog title="创建工作空间" :visible.sync="createVisible" width="30%">
|
<el-dialog title="创建工作空间" :visible.sync="createVisible" width="30%">
|
||||||
<el-form :model="form" :rules="rules" ref="form" label-position="left" label-width="100px" size="small">
|
<el-form :model="form" :rules="rules" ref="form" label-position="left" label-width="100px" size="small">
|
||||||
<el-form-item label="名称" prop="name">
|
<el-form-item label="名称" prop="name">
|
||||||
|
@ -57,12 +77,16 @@
|
||||||
this.$refs[formName].validate((valid) => {
|
this.$refs[formName].validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
this.$post("/workspace/save", this.form, () => {
|
let saveType = 'add';
|
||||||
|
if (this.form.id) {
|
||||||
|
saveType = 'update'
|
||||||
|
}
|
||||||
|
this.$post("/workspace/" + saveType, this.form, () => {
|
||||||
this.createVisible = false;
|
this.createVisible = false;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
this.list();
|
this.list();
|
||||||
Message.success('保存成功');
|
Message.success('保存成功');
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -96,10 +120,22 @@
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
list() {
|
list() {
|
||||||
this.$post('/workspace/list', {}, response => {
|
let url = '/workspace/list/' + this.currentPage + '/' + this.pageSize;
|
||||||
this.items = response.data;
|
this.$post(url, {}, response => {
|
||||||
|
let data = response.data;
|
||||||
|
|
||||||
|
this.items = data.listObject;
|
||||||
|
this.total = data.itemCount;
|
||||||
})
|
})
|
||||||
}
|
},
|
||||||
|
handleSizeChange(size) {
|
||||||
|
this.pageSize = size;
|
||||||
|
this.list();
|
||||||
|
},
|
||||||
|
handleCurrentChange(current) {
|
||||||
|
this.currentPage = current;
|
||||||
|
this.list();
|
||||||
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -108,6 +144,9 @@
|
||||||
btnTips: "添加工作空间",
|
btnTips: "添加工作空间",
|
||||||
condition: "",
|
condition: "",
|
||||||
items: [],
|
items: [],
|
||||||
|
currentPage: 1,
|
||||||
|
pageSize: 5,
|
||||||
|
total: 0,
|
||||||
form: {
|
form: {
|
||||||
// name: "",
|
// name: "",
|
||||||
// description: ""
|
// description: ""
|
||||||
|
|
Loading…
Reference in New Issue