Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Captain.B 2020-05-07 16:14:24 +08:00
commit cdf3a260e5
11 changed files with 152 additions and 95 deletions

View File

@ -27,7 +27,7 @@ public class UserRoleController {
@GetMapping("/list/ws/{workspaceId}/{userId}") @GetMapping("/list/ws/{workspaceId}/{userId}")
@RequiresRoles(value = {RoleConstants.ADMIN,RoleConstants.ORG_ADMIN}, logical = Logical.OR) @RequiresRoles(value = {RoleConstants.ADMIN,RoleConstants.ORG_ADMIN}, logical = Logical.OR)
public List<Role> getWorkspaceMemberRole(@PathVariable String workspaceId, @PathVariable String userId) { public List<Role> getWorkspaceMemberRoles(@PathVariable String workspaceId, @PathVariable String userId) {
return userRoleService.getWorkspaceMemberRoles(workspaceId, userId); return userRoleService.getWorkspaceMemberRoles(workspaceId, userId);
} }
} }

View File

@ -0,0 +1,35 @@
<template>
<div>
<ms-tag v-for="(role, index) in roles"
:key="index"
:effect="effect"
:type="type"
:content="role.name"/>
</div>
</template>
<script>
import MsTag from "./MsTag";
export default {
name: "MsRolesTag",
components: {MsTag},
props: {
type: {
type: String,
default: 'primary',
},
roles: {
type: Array
},
effect: {
type: String,
default: 'dark',
}
}
}
</script>
<style scoped>
</style>

View File

@ -31,7 +31,7 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button type="primary" onkeydown="return false;" @click="submit('form')" size="medium"> <el-button type="primary" @keydown.enter.native.prevent @click="submit('form')" size="medium">
{{$t('commons.save')}} {{$t('commons.save')}}
</el-button> </el-button>
</div> </div>

View File

@ -11,17 +11,15 @@
<el-table-column prop="phone" :label="$t('commons.phone')"/> <el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column prop="roles" :label="$t('commons.role')" width="140"> <el-table-column prop="roles" :label="$t('commons.role')" width="140">
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark"> <ms-roles-tag :roles="scope.row.roles"/>
{{ role.name }}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column> <el-table-column>
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini" <el-button @click="edit(scope.row)" @keydown.enter.native.prevent type="primary" icon="el-icon-edit"
circle/> size="mini" circle/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini" <el-button @click="del(scope.row)" @keydown.enter.native.prevent type="danger" icon="el-icon-delete"
circle/> size="mini" circle/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -58,8 +56,9 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="submitForm('form')" @keydown.enter.native.prevent type="primary"
@click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -92,8 +91,9 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="updateOrgMember('updateUserForm')" @keydown.enter.native.prevent type="primary"
@click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -105,10 +105,11 @@
import {TokenKey} from "../../../../common/js/constants"; import {TokenKey} from "../../../../common/js/constants";
import MsTablePagination from "../../common/pagination/TablePagination"; import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader"; import MsTableHeader from "../../common/components/MsTableHeader";
import MsRolesTag from "../../common/components/MsRolesTag";
export default { export default {
name: "MsOrganizationMember", name: "MsOrganizationMember",
components: {MsCreateBox, MsTablePagination, MsTableHeader}, components: {MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag},
created() { created() {
this.initTableData(); this.initTableData();
}, },

View File

@ -16,10 +16,10 @@
</el-table-column> </el-table-column>
<el-table-column> <el-table-column>
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini" <el-button @click="edit(scope.row)" @keydown.enter.native.prevent type="primary" icon="el-icon-edit"
circle/> size="mini" circle/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini" <el-button @click="del(scope.row)" @keydown.enter.native.prevent type="danger" icon="el-icon-delete"
circle/> size="mini" circle/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -38,8 +38,9 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="submit('form')" @keydown.enter.native.prevent type="primary"
@click="submit('form')" size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -55,26 +56,26 @@
<el-table-column prop="phone" :label="$t('commons.phone')"/> <el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column :label="$t('commons.role')" width="120"> <el-table-column :label="$t('commons.role')" width="120">
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark" type="success"> <ms-roles-tag :roles="scope.row.roles" type="success"/>
{{ role.name }}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('commons.operating')"> <el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-button @click="editMember(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" <el-button @click="editMember(scope.row)" @keydown.enter.native.prevent type="primary" icon="el-icon-edit"
size="mini" circle/> size="mini" circle/>
<el-button @click="delMember(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" <el-button @click="delMember(scope.row)" @keydown.enter.native.prevent type="danger" icon="el-icon-delete"
size="mini" circle/> size="mini" circle/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<ms-table-pagination :change="dialogSearch" :current-page.sync="dialogCurrentPage" :page-size.sync="dialogPageSize" <ms-table-pagination :change="dialogSearch" :current-page.sync="dialogCurrentPage"
:page-size.sync="dialogPageSize"
:total="dialogTotal"/> :total="dialogTotal"/>
</el-dialog> </el-dialog>
<!-- add workspace member dialog --> <!-- add workspace member dialog -->
<el-dialog :title="$t('member.create')" :visible.sync="dialogWsMemberAddVisible" width="30%" :destroy-on-close="true" <el-dialog :title="$t('member.create')" :visible.sync="dialogWsMemberAddVisible" width="30%"
:destroy-on-close="true"
@close="closeFunc"> @close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px" <el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px"
size="small"> size="small">
@ -105,14 +106,16 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="submitForm('form')" @keydown.enter.native.prevent type="primary"
@click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<!-- update workspace member dialog --> <!-- update workspace member dialog -->
<el-dialog :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible" width="30%" :destroy-on-close="true" <el-dialog :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible" width="30%"
:destroy-on-close="true"
@close="closeFunc"> @close="closeFunc">
<el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm"> <el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id"> <el-form-item label="ID" prop="id">
@ -141,8 +144,9 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="updateOrgMember('updateUserForm')" @keydown.enter.native.prevent type="primary"
@click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -156,10 +160,11 @@
import {TokenKey} from "../../../../common/js/constants"; import {TokenKey} from "../../../../common/js/constants";
import MsTablePagination from "../../common/pagination/TablePagination"; import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader"; import MsTableHeader from "../../common/components/MsTableHeader";
import MsRolesTag from "../../common/components/MsRolesTag";
export default { export default {
name: "MsOrganizationWorkspace", name: "MsOrganizationWorkspace",
components: {MsCreateBox, MsTablePagination, MsTableHeader}, components: {MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag},
mounted() { mounted() {
this.list(); this.list();
}, },

View File

@ -27,8 +27,10 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<el-dialog :title="$t('member.modify_personal_info')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" @close="closeFunc"> <el-dialog :title="$t('member.modify_personal_info')" :visible.sync="updateVisible" width="30%"
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule" ref="updateUserForm"> :destroy-on-close="true" @close="closeFunc">
<el-form :model="form" label-position="right" label-width="100px" size="small" :rules="rule"
ref="updateUserForm">
<el-form-item label="ID" prop="id"> <el-form-item label="ID" prop="id">
<el-input v-model="form.id" autocomplete="off" :disabled="true"/> <el-input v-model="form.id" autocomplete="off" :disabled="true"/>
</el-form-item> </el-form-item>
@ -44,8 +46,9 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="updateUser('updateUserForm')" @keydown.enter.native.prevent type="primary"
@click="updateUser('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -68,7 +71,7 @@
rule: { rule: {
name: [ name: [
{required: true, message: this.$t('member.input_name'), trigger: 'blur'}, {required: true, message: this.$t('member.input_name'), trigger: 'blur'},
{ min: 2, max: 10, message: this.$t('commons.input_limit', [2, 10]), trigger: 'blur' }, {min: 2, max: 10, message: this.$t('commons.input_limit', [2, 10]), trigger: 'blur'},
{ {
required: true, required: true,
pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/, pattern: /^[\u4e00-\u9fa5_a-zA-Z0-9.·-]+$/,
@ -85,7 +88,7 @@
} }
], ],
email: [ email: [
{ required: true, message: this.$t('member.input_email'), trigger: 'blur' }, {required: true, message: this.$t('member.input_email'), trigger: 'blur'},
{ {
required: true, required: true,
pattern: /^([A-Za-z0-9_\-.])+@([A-Za-z0-9]+\.)+[A-Za-z]{2,6}$/, pattern: /^([A-Za-z0-9_\-.])+@([A-Za-z0-9]+\.)+[A-Za-z]{2,6}$/,
@ -112,7 +115,7 @@
updateUser(updateUserForm) { updateUser(updateUserForm) {
this.$refs[updateUserForm].validate(valide => { this.$refs[updateUserForm].validate(valide => {
if (valide) { if (valide) {
this.result = this.$post(this.updatePath, this.form,response => { this.result = this.$post(this.updatePath, this.form, response => {
this.$success(this.$t('commons.modify_success')); this.$success(this.$t('commons.modify_success'));
localStorage.setItem(TokenKey, JSON.stringify(response.data)); localStorage.setItem(TokenKey, JSON.stringify(response.data));
this.updateVisible = false; this.updateVisible = false;

View File

@ -19,10 +19,10 @@
</el-table-column> </el-table-column>
<el-table-column :label="$t('commons.operating')"> <el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini" <el-button @click="edit(scope.row)" @keydown.enter.native.prevent type="primary" icon="el-icon-edit"
circle/> size="mini" circle/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini" <el-button @click="del(scope.row)" @keydown.enter.native.prevent type="danger" icon="el-icon-delete"
circle/> size="mini" circle/>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -41,16 +41,14 @@
<el-table-column prop="phone" :label="$t('commons.phone')"/> <el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column :label="$t('commons.role')" width="140"> <el-table-column :label="$t('commons.role')" width="140">
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark"> <ms-roles-tag :roles="scope.row.roles"/>
{{ role.name }}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('commons.operating')"> <el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-button @click="editMember(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" <el-button @click="editMember(scope.row)" @keydown.enter.native.prevent type="primary" icon="el-icon-edit"
size="mini" circle/> size="mini" circle/>
<el-button @click="delMember(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" <el-button @click="delMember(scope.row)" @keydown.enter.native.prevent type="danger" icon="el-icon-delete"
size="mini" circle/> size="mini" circle/>
</template> </template>
</el-table-column> </el-table-column>
@ -74,8 +72,9 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="createOrganization('createOrganization')" @keydown.enter.native.prevent type="primary"
@click="createOrganization('createOrganization')" size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -95,9 +94,9 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="updateOrganization('updateOrganizationForm')" @keydown.enter.native.prevent type="primary"
@click="updateOrganization('updateOrganizationForm')" size="medium">{{$t('organization.modify')}}
size="medium">{{$t('organization.modify')}}</el-button> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -135,8 +134,9 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="submitForm('form')" @keydown.enter.native.prevent type="primary"
@click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -172,8 +172,9 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="updateOrgMember('updateUserForm')" @keydown.enter.native.prevent type="primary"
@click="updateOrgMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -185,10 +186,11 @@
import MsCreateBox from "../CreateBox"; import MsCreateBox from "../CreateBox";
import MsTablePagination from "../../common/pagination/TablePagination"; import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader"; import MsTableHeader from "../../common/components/MsTableHeader";
import MsRolesTag from "../../common/components/MsRolesTag";
export default { export default {
name: "MsOrganization", name: "MsOrganization",
components: {MsCreateBox, MsTablePagination, MsTableHeader}, components: {MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag},
data() { data() {
return { return {
queryPath: '/organization/list', queryPath: '/organization/list',

View File

@ -50,7 +50,7 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button> <el-button type="primary" @keydown.enter.native.prevent @click="submit('form')" size="medium">{{$t('commons.save')}}</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -78,7 +78,7 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" @click="updateWorkspace('updateForm')" onkeydown="return false;" <el-button type="primary" @click="updateWorkspace('updateForm')" @keydown.enter.native.prevent
size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}</el-button>
</span> </span>
</template> </template>
@ -96,16 +96,14 @@
<el-table-column prop="phone" :label="$t('commons.phone')"/> <el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column :label="$t('commons.role')" width="120"> <el-table-column :label="$t('commons.role')" width="120">
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark" type="success"> <ms-roles-tag :roles="scope.row.roles" type="success"/>
{{ role.name }}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column :label="$t('commons.operating')"> <el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-button @click="editMember(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" <el-button @click="editMember(scope.row)" @keydown.enter.native.prevent type="primary" icon="el-icon-edit"
size="mini" circle/> size="mini" circle/>
<el-button @click="delMember(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" <el-button @click="delMember(scope.row)" @keydown.enter.native.prevent type="danger" icon="el-icon-delete"
size="mini" circle/> size="mini" circle/>
</template> </template>
</el-table-column> </el-table-column>
@ -116,7 +114,8 @@
</el-dialog> </el-dialog>
<!-- add workspace member dialog --> <!-- add workspace member dialog -->
<el-dialog :title="$t('member.create')" :visible.sync="dialogWsMemberAddVisible" width="30%" :destroy-on-close="true" <el-dialog :title="$t('member.create')" :visible.sync="dialogWsMemberAddVisible" width="30%"
:destroy-on-close="true"
@close="closeFunc"> @close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px" <el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px"
size="small"> size="small">
@ -147,13 +146,16 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" @click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button> <el-button type="primary" @keydown.enter.native.prevent @click="submitForm('form')" size="medium">
{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<!-- update workspace member dialog --> <!-- update workspace member dialog -->
<el-dialog :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible" width="30%" :destroy-on-close="true" <el-dialog :title="$t('member.modify')" :visible.sync="dialogWsMemberUpdateVisible" width="30%"
:destroy-on-close="true"
@close="closeFunc"> @close="closeFunc">
<el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm"> <el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id"> <el-form-item label="ID" prop="id">
@ -182,8 +184,9 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" @click="updateOrgMember('updateUserForm')" onkeydown="return false;" <el-button type="primary" @click="updateOrgMember('updateUserForm')" @keydown.enter.native.prevent
size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
@ -197,10 +200,11 @@
import {Message} from "element-ui"; import {Message} from "element-ui";
import MsTablePagination from "../../common/pagination/TablePagination"; import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader"; import MsTableHeader from "../../common/components/MsTableHeader";
import MsRolesTag from "../../common/components/MsRolesTag";
export default { export default {
name: "MsSystemWorkspace", name: "MsSystemWorkspace",
components: {MsCreateBox, MsTablePagination, MsTableHeader}, components: {MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag},
mounted() { mounted() {
this.list(); this.list();
}, },

View File

@ -122,9 +122,10 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="createTestResourcePool('createTestResourcePoolForm')" @keydown.enter.native.prevent
@click="createTestResourcePool('createTestResourcePoolForm')" type="primary"
size="medium">{{$t('commons.create')}}</el-button> size="medium">{{$t('commons.create')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -202,9 +203,10 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="updateTestResourcePool('updateTestResourcePoolForm')" @keydown.enter.native.prevent
@click="updateTestResourcePool('updateTestResourcePoolForm')" type="primary"
size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>

View File

@ -59,8 +59,8 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="createUser('createUserForm')" @keydown.enter.native.prevent type="primary"
@click="createUser('createUserForm')" size="medium">创建</el-button> size="medium">{{$t('commons.save')}}</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -83,8 +83,9 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="updateUser('updateUserForm')" @keydown.enter.native.prevent type="primary"
@click="updateUser('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>

View File

@ -11,16 +11,16 @@
<el-table-column prop="phone" :label="$t('commons.phone')"/> <el-table-column prop="phone" :label="$t('commons.phone')"/>
<el-table-column prop="roles" :label="$t('commons.role')" width="120"> <el-table-column prop="roles" :label="$t('commons.role')" width="120">
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-tag v-for="(role, index) in scope.row.roles" :key="index" size="mini" effect="dark" type="success"> <ms-roles-tag :roles="scope.row.roles" type="success"/>
{{ role.name }}
</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column> <el-table-column>
<template v-slot:default="scope"> <template v-slot:default="scope">
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini" <el-button @click="edit(scope.row)" type="primary" icon="el-icon-edit" size="mini"
@keydown.enter.native.prevent
circle v-permission="['test_manager']"/> circle v-permission="['test_manager']"/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini" <el-button @click="del(scope.row)" type="danger" icon="el-icon-delete" size="mini"
@keydown.enter.native.prevent
circle v-permission="['test_manager']"/> circle v-permission="['test_manager']"/>
</template> </template>
</el-table-column> </el-table-column>
@ -29,7 +29,8 @@
:total="total"/> :total="total"/>
</el-card> </el-card>
<el-dialog :title="$t('member.create')" :visible.sync="createVisible" width="30%" :destroy-on-close="true" @close="closeFunc"> <el-dialog :title="$t('member.create')" :visible.sync="createVisible" width="30%" :destroy-on-close="true"
@close="closeFunc">
<el-form :model="form" ref="form" :rules="rules" label-position="right" label-width="100px" size="small"> <el-form :model="form" ref="form" :rules="rules" label-position="right" label-width="100px" size="small">
<el-form-item :label="$t('commons.member')" prop="userIds"> <el-form-item :label="$t('commons.member')" prop="userIds">
<el-select v-model="form.userIds" multiple :placeholder="$t('member.please_choose_member')" <el-select v-model="form.userIds" multiple :placeholder="$t('member.please_choose_member')"
@ -57,13 +58,15 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="submitForm('form')" @keydown.enter.native.prevent type="primary"
@click="submitForm('form')" size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
<el-dialog :title="$t('member.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true" @close="closeFunc"> <el-dialog :title="$t('member.modify')" :visible.sync="updateVisible" width="30%" :destroy-on-close="true"
@close="closeFunc">
<el-form :model="form" label-position="right" label-width="100px" size="small" ref="updateUserForm"> <el-form :model="form" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id"> <el-form-item label="ID" prop="id">
<el-input v-model="form.id" autocomplete="off" :disabled="true"/> <el-input v-model="form.id" autocomplete="off" :disabled="true"/>
@ -90,8 +93,9 @@
</el-form> </el-form>
<template v-slot:footer> <template v-slot:footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button type="primary" onkeydown="return false;" <el-button @click="updateWorkspaceMember('updateUserForm')" @keydown.enter.native.prevent type="primary"
@click="updateWorkspaceMember('updateUserForm')" size="medium">{{$t('commons.save')}}</el-button> size="medium">{{$t('commons.save')}}
</el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -104,11 +108,11 @@
import {TokenKey} from "../../../../common/js/constants"; import {TokenKey} from "../../../../common/js/constants";
import MsTablePagination from "../../common/pagination/TablePagination"; import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader"; import MsTableHeader from "../../common/components/MsTableHeader";
import MsTag from "../../common/components/MsTag"; import MsRolesTag from "../../common/components/MsRolesTag";
export default { export default {
name: "MsMember", name: "MsMember",
components: {MsCreateBox, MsTablePagination, MsTableHeader, MsTag}, components: {MsCreateBox, MsTablePagination, MsTableHeader, MsRolesTag},
data() { data() {
return { return {
result: {}, result: {},