页面上的部分查询

This commit is contained in:
Captain.B 2020-04-10 11:25:42 +08:00
parent c3738739ba
commit ed9d972bee
1 changed files with 31 additions and 17 deletions

View File

@ -9,7 +9,7 @@
</span>
<span class="search">
<el-input type="text" size="small" :placeholder="$t('workspace.search_by_name')"
prefix-icon="el-icon-search"
prefix-icon="el-icon-search" @change="search"
maxlength="60" v-model="condition" clearable/>
</span>
</el-row>
@ -20,13 +20,16 @@
<el-table-column prop="description" :label="$t('commons.description')"/>
<el-table-column :label="$t('commons.member')">
<template v-slot:default="scope">
<el-button type="text" class="member-size" @click="cellClick(scope.row)">{{scope.row.memberSize}}</el-button>
<el-button type="text" class="member-size" @click="cellClick(scope.row)">{{scope.row.memberSize}}
</el-button>
</template>
</el-table-column>
<el-table-column>
<template v-slot:default="scope">
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini" circle/>
<el-button @click="edit(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini"
circle/>
<el-button @click="del(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini"
circle/>
</template>
</el-table-column>
</el-table>
@ -93,8 +96,10 @@
</el-table-column>
<el-table-column :label="$t('commons.operating')">
<template v-slot:default="scope">
<el-button @click="editMember(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit" size="mini" circle/>
<el-button @click="delMember(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete" size="mini" circle/>
<el-button @click="editMember(scope.row)" onkeydown="return false;" type="primary" icon="el-icon-edit"
size="mini" circle/>
<el-button @click="delMember(scope.row)" onkeydown="return false;" type="danger" icon="el-icon-delete"
size="mini" circle/>
</template>
</el-table-column>
</el-table>
@ -118,10 +123,13 @@
</el-dialog>
<!-- add workspace member dialog -->
<el-dialog :title="$t('member.create')" :visible.sync="addMemberVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px" size="small">
<el-dialog :title="$t('member.create')" :visible.sync="addMemberVisible" width="30%" :destroy-on-close="true"
@close="closeFunc">
<el-form :model="memberForm" ref="form" :rules="wsMemberRule" label-position="right" label-width="100px"
size="small">
<el-form-item :label="$t('commons.member')" prop="userIds">
<el-select v-model="memberForm.userIds" multiple :placeholder="$t('member.please_choose_member')" class="select-width">
<el-select v-model="memberForm.userIds" multiple :placeholder="$t('member.please_choose_member')"
class="select-width">
<el-option
v-for="item in memberForm.userList"
:key="item.id"
@ -133,7 +141,8 @@
</el-select>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')" class="select-width">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')"
class="select-width">
<el-option
v-for="item in memberForm.roles"
:key="item.id"
@ -152,7 +161,8 @@
</el-dialog>
<!-- update workspace member dialog -->
<el-dialog :title="$t('member.modify')" :visible.sync="updateMemberVisible" width="30%" :destroy-on-close="true" @close="closeFunc">
<el-dialog :title="$t('member.modify')" :visible.sync="updateMemberVisible" width="30%" :destroy-on-close="true"
@close="closeFunc">
<el-form :model="memberForm" label-position="right" label-width="100px" size="small" ref="updateUserForm">
<el-form-item label="ID" prop="id">
<el-input v-model="memberForm.id" autocomplete="off" :disabled="true"/>
@ -167,7 +177,8 @@
<el-input v-model="memberForm.phone" autocomplete="off"/>
</el-form-item>
<el-form-item :label="$t('commons.role')" prop="roleIds">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')" class="select-width">
<el-select v-model="memberForm.roleIds" multiple :placeholder="$t('role.please_choose_role')"
class="select-width">
<el-option
v-for="item in memberForm.allroles"
:key="item.id"
@ -253,6 +264,9 @@
});
},
search() {
this.list();
},
list() {
let url = '/workspace/list/' + this.currentPage + '/' + this.pageSize;
let lastOrganizationId = this.currentUser.lastOrganizationId;
@ -300,7 +314,7 @@
this.$set(this.memberForm, "roles", response.data);
})
},
cellClick(row){
cellClick(row) {
// currentRow
this.currentWorkspaceRow = row;
this.memberVisible = true;
@ -346,7 +360,7 @@
roleIds: this.memberForm.roleIds,
workspaceId: this.currentWorkspaceRow.id
};
this.result = this.$post("user/ws/member/add", param,() => {
this.result = this.$post("user/ws/member/add", param, () => {
this.cellClick(this.currentWorkspaceRow);
this.addMemberVisible = false;
})
@ -394,7 +408,7 @@
roleIds: this.memberForm.roleIds,
workspaceId: this.currentWorkspaceRow.id
}
this.result = this.$post("/workspace/member/update", param,() => {
this.result = this.$post("/workspace/member/update", param, () => {
this.$message({
type: 'success',
message: this.$t('commons.modify_success')
@ -472,8 +486,8 @@
}
.member-size {
text-decoration:underline;
cursor:pointer;
text-decoration: underline;
cursor: pointer;
}
.member-title {