Update index.vue

木子李·De 4 years ago
parent 670bdd74f7
commit f9d65cf426

@ -1,31 +1,32 @@
<template> <template>
<anji-crud ref="listPage" <anji-crud ref="listPage" :option="crudOption">
:option="crudOption">
<template v-slot:buttonLeftOnTable> <template v-slot:buttonLeftOnTable>
</template> </template>
<template slot="rowButton" <template slot="rowButton" slot-scope="props">
slot-scope="props"> <el-button type="text" @click="handleOpenDialogSetRoleForUser(props)"></el-button>
<el-button type="text"
@click="handleOpenDialogSetRoleForUser(props)">授予角色</el-button>
</template> </template>
<!--自定义的卡片插槽将在编辑详情页面出现在底部新卡片--> <!--自定义的卡片插槽将在编辑详情页面出现在底部新卡片-->
<template v-slot:pageSection> <template v-slot:pageSection>
<UserRole :login-name="loginName" <UserRole :login-name="loginName" :visib="dialogVisibleSetRoleForUser" @handleClose="dialogVisibleSetRoleForUser = false" />
:visib="dialogVisibleSetRoleForUser"
@handleClose="dialogVisibleSetRoleForUser = false" />
</template> </template>
</anji-crud> </anji-crud>
</template> </template>
<script> <script>
import { accessUserList, accessUserAdd, accessUserDeleteBatch, accessUserUpdate, accessUserDetail } from '@/api/accessUser' import {
accessUserList,
accessUserAdd,
accessUserDeleteBatch,
accessUserUpdate,
accessUserDetail,
} from '@/api/accessUser'
import UserRole from '@/views/accessUser/components/UserRole' import UserRole from '@/views/accessUser/components/UserRole'
export default { export default {
name: 'AccessUser', name: 'AccessUser',
components: { components: {
UserRole: UserRole, UserRole: UserRole,
}, },
data () { data() {
return { return {
// //
dialogVisibleSetRoleForUser: false, dialogVisibleSetRoleForUser: false,
@ -45,45 +46,45 @@ export default {
dictCode: 'ENABLE_FLAG', dictCode: 'ENABLE_FLAG',
}, },
label: '启用状态', label: '启用状态',
field: 'enableFlag' field: 'enableFlag',
}, },
{ {
inputType: 'input', inputType: 'input',
label: '登录名', label: '登录名',
field: 'loginName' field: 'loginName',
}, },
{ {
inputType: 'input', inputType: 'input',
label: '真实姓名', label: '真实姓名',
field: 'realName' field: 'realName',
}, },
{ {
inputType: 'input', inputType: 'input',
label: '手机号', label: '手机号',
field: 'phone' field: 'phone',
}, },
], ],
// //
buttons: { buttons: {
query: { query: {
api: accessUserList, api: accessUserList,
permission: 'AccessUser:PAGE' permission: 'userManage:query',
}, },
queryByPrimarykey: { queryByPrimarykey: {
api: accessUserDetail, api: accessUserDetail,
permission: 'AccessUser:detail' permission: 'userManage:query',
}, },
add: { add: {
api: accessUserAdd, api: accessUserAdd,
permission: 'AccessUser:insert' permission: 'userManage:insert',
}, },
delete: { delete: {
api: accessUserDeleteBatch, api: accessUserDeleteBatch,
permission: 'AccessUser:delete' permission: 'userManage:delete',
}, },
edit: { edit: {
api: accessUserUpdate, api: accessUserUpdate,
permission: 'AccessUser:update' permission: 'userManage:update',
}, },
}, },
// //
@ -104,7 +105,7 @@ export default {
inputType: 'input', inputType: 'input',
rules: [ rules: [
{ required: true, message: '登录名必填', trigger: 'blur' }, { required: true, message: '登录名必填', trigger: 'blur' },
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' } { min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' },
], ],
disabled: false, disabled: false,
}, },
@ -120,7 +121,7 @@ export default {
inputType: 'input', inputType: 'input',
rules: [ rules: [
{ required: true, message: '真实姓名必填', trigger: 'blur' }, { required: true, message: '真实姓名必填', trigger: 'blur' },
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' } { min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' },
], ],
disabled: false, disabled: false,
}, },
@ -133,7 +134,7 @@ export default {
inputType: 'input', inputType: 'input',
rules: [ rules: [
{ required: true, message: '密码必填', trigger: 'blur' }, { required: true, message: '密码必填', trigger: 'blur' },
{ min: 1, max: 128, message: '不超过128个字符', trigger: 'blur' } { min: 1, max: 128, message: '不超过128个字符', trigger: 'blur' },
], ],
disabled: false, disabled: false,
}, },
@ -144,7 +145,7 @@ export default {
editField: 'phone', editField: 'phone',
inputType: 'input', inputType: 'input',
rules: [ rules: [
{ min: 1, max: 16, message: '不超过16个字符', trigger: 'blur' } { min: 1, max: 16, message: '不超过16个字符', trigger: 'blur' },
], ],
disabled: false, disabled: false,
}, },
@ -155,7 +156,7 @@ export default {
editField: 'email', editField: 'email',
inputType: 'input', inputType: 'input',
rules: [ rules: [
{ min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' } { min: 1, max: 64, message: '不超过64个字符', trigger: 'blur' },
], ],
disabled: false, disabled: false,
}, },
@ -166,12 +167,12 @@ export default {
editField: 'remark', editField: 'remark',
inputType: 'input', inputType: 'input',
rules: [ rules: [
{ min: 1, max: 512, message: '不超过512个字符', trigger: 'blur' } { min: 1, max: 512, message: '不超过512个字符', trigger: 'blur' },
], ],
disabled: false, disabled: false,
}, },
{ {
label: '启用状态',//0-- 1-- DIC_NAME=ENABLE_FLAG label: '启用状态', //0-- 1-- DIC_NAME=ENABLE_FLAG
placeholder: '', placeholder: '',
field: 'enableFlag', field: 'enableFlag',
fieldTableRowRenderer: (row) => { fieldTableRowRenderer: (row) => {
@ -184,7 +185,7 @@ export default {
}, },
colorStyle: { colorStyle: {
0: 'table-danger', //keyeditField'': 'danger','': 'primary','绿': 'success','': 'warning','': 'info','''' 0: 'table-danger', //keyeditField'': 'danger','': 'primary','绿': 'success','': 'warning','': 'info',''''
1: 'table-success' 1: 'table-success',
}, },
rules: [ rules: [
{ required: true, message: '启用状态必填', trigger: 'blur' }, { required: true, message: '启用状态必填', trigger: 'blur' },
@ -197,8 +198,7 @@ export default {
field: 'lastLoginTime', field: 'lastLoginTime',
editField: 'lastLoginTime', editField: 'lastLoginTime',
inputType: 'input', inputType: 'input',
rules: [ rules: [],
],
disabled: true, disabled: true,
}, },
{ {
@ -208,7 +208,7 @@ export default {
editField: 'lastLoginIp', editField: 'lastLoginIp',
inputType: 'input', inputType: 'input',
rules: [ rules: [
{ min: 1, max: 16, message: '不超过16个字符', trigger: 'blur' } { min: 1, max: 16, message: '不超过16个字符', trigger: 'blur' },
], ],
disabled: true, disabled: true,
}, },
@ -257,13 +257,13 @@ export default {
} }
}, },
created () { }, created() {},
methods: { methods: {
handleOpenDialogSetRoleForUser (props) { handleOpenDialogSetRoleForUser(props) {
this.loginName = props.msg.loginName this.loginName = props.msg.loginName
this.dialogVisibleSetRoleForUser = true this.dialogVisibleSetRoleForUser = true
}, },
} },
} }
</script> </script>

Loading…
Cancel
Save