This commit is contained in:
shiziyuan9527 2020-09-24 15:16:33 +08:00
commit 56491903de
1 changed files with 301 additions and 288 deletions

View File

@ -50,7 +50,8 @@
</el-card>
<!--Create user-->
<el-dialog :close-on-click-modal="false" :title="$t('user.create')" :visible.sync="createVisible" width="35%" @closed="handleClose"
<el-dialog :close-on-click-modal="false" :title="$t('user.create')" :visible.sync="createVisible" width="35%"
@closed="handleClose"
:destroy-on-close="true">
<el-form :model="form" label-position="right" label-width="120px" size="small" :rules="rule" ref="createUserForm">
<el-form-item label="ID" prop="id">
@ -81,10 +82,11 @@
:label="$t('role.' + item.id)"
:value="item.id"
>
{{$t('role.' + item.id)}}
{{ $t('role.' + item.id) }}
</el-option>
</el-select>
<el-button @click.prevent="removeRole(role)" style="margin-left: 20px;" v-if="form.roles.length > 1">{{$t('commons.delete')}}
<el-button @click.prevent="removeRole(role)" style="margin-left: 20px;" v-if="form.roles.length > 1">
{{ $t('commons.delete') }}
</el-button>
</el-form-item>
<div v-if="role.id === 'org_admin'">
@ -151,7 +153,9 @@
<el-form-item>
<template>
<el-button type="success" style="width: 100%;" @click="addRole('createUserForm')" :disabled="btnAddRole">{{$t('role.add')}}</el-button>
<el-button type="success" style="width: 100%;" @click="addRole('createUserForm')" :disabled="btnAddRole">
{{ $t('role.add') }}
</el-button>
</template>
</el-form-item>
</el-form>
@ -163,7 +167,8 @@
</el-dialog>
<!--Modify user information in system settings-->
<el-dialog :close-on-click-modal="false" :title="$t('user.modify')" :visible.sync="updateVisible" width="35%" :destroy-on-close="true"
<el-dialog :close-on-click-modal="false" :title="$t('user.modify')" :visible.sync="updateVisible" width="35%"
:destroy-on-close="true"
@close="handleClose" v-loading="result.loading">
<el-form :model="form" label-position="right" label-width="120px" size="small" :rules="rule" ref="updateUserForm">
<el-form-item label="ID" prop="id">
@ -191,7 +196,8 @@
:value="item.id">
</el-option>
</el-select>
<el-button @click.prevent="removeRole(role)" style="margin-left: 20px;" v-if="form.roles.length > 1">{{$t('commons.delete')}}
<el-button @click.prevent="removeRole(role)" style="margin-left: 20px;" v-if="form.roles.length > 1">
{{ $t('commons.delete') }}
</el-button>
</el-form-item>
<div v-if="role.id === 'org_admin'">
@ -257,7 +263,9 @@
</div>
<el-form-item>
<template>
<el-button type="success" style="width: 100%;" @click="addRole('updateUserForm')" :disabled="btnAddRole">{{$t('role.add')}}</el-button>
<el-button type="success" style="width: 100%;" @click="addRole('updateUserForm')" :disabled="btnAddRole">
{{ $t('role.add') }}
</el-button>
</template>
</el-form-item>
</el-form>
@ -268,7 +276,8 @@
</template>
</el-dialog>
<!--Changing user password in system settings-->
<el-dialog :close-on-click-modal="false" :title="$t('member.edit_password')" :visible.sync="editPasswordVisible" width="30%"
<el-dialog :close-on-click-modal="false" :title="$t('member.edit_password')" :visible.sync="editPasswordVisible"
width="30%"
:destroy-on-close="true" @close="handleClose" left>
<el-form :model="ruleForm" label-position="right" label-width="120px" size="small" :rules="rule"
ref="editPasswordForm" class="demo-ruleForm">
@ -290,16 +299,17 @@
</template>
<script>
import MsCreateBox from "../CreateBox";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsTableOperator from "../../common/components/MsTableOperator";
import MsDialogFooter from "../../common/components/MsDialogFooter";
import MsTableOperatorButton from "../../common/components/MsTableOperatorButton";
import {listenGoBack, removeGoBackListener} from "@/common/js/utils";
import MsRolesTag from "../../common/components/MsRolesTag";
import MsCreateBox from "../CreateBox";
import MsTablePagination from "../../common/pagination/TablePagination";
import MsTableHeader from "../../common/components/MsTableHeader";
import MsTableOperator from "../../common/components/MsTableOperator";
import MsDialogFooter from "../../common/components/MsDialogFooter";
import MsTableOperatorButton from "../../common/components/MsTableOperatorButton";
import {hasRole, listenGoBack, removeGoBackListener} from "@/common/js/utils";
import MsRolesTag from "../../common/components/MsRolesTag";
import {ROLE_ADMIN} from "@/common/js/constants";
export default {
export default {
name: "MsUser",
components: {
MsCreateBox,
@ -482,6 +492,9 @@
})
},
search() {
if (!hasRole(ROLE_ADMIN)) {
return;
}
this.result = this.$post(this.buildPagePath(this.queryPath), this.condition, response => {
let data = response.data;
this.total = data.itemCount;
@ -580,7 +593,7 @@
})
}
}
}
}
</script>
<style scoped>