生成线下用户

This commit is contained in:
fan 2020-03-30 15:28:13 +08:00
parent 779b958613
commit b229e9c08a
3 changed files with 100 additions and 1 deletions

View File

@ -178,3 +178,11 @@ export function getOnlineNmuber() {
method: 'get' method: 'get'
}); });
} }
// 生成线下环境用户
export function generateOfflineUser(data) {
return request({
url: `/api/user/generate/offline`,
method: 'post',
data: data
});
}

View File

@ -0,0 +1,82 @@
<template>
<el-dialog v-dialogDrag title="创建本地用户" :visible.sync="dialogVisible" width="30%" :before-close="doClose" center :close-on-click-modal="false">
<el-form ref="form" :model="addModel" label-width="130px" :rules="rules">
<el-form-item label="批量生成数量" prop="quantity">
<el-input-number v-model="addModel.quantity" size="mini" :min="1" :max="999" />
</el-form-item>
<el-form-item label="是否生成用户权限" prop="generatePermission">
<el-checkbox v-model="addModel.generatePermission" change="changeGeneratePermission" />
</el-form-item>
<el-form-item v-show="addModel.generatePermission" label="权限ID" prop="permissionId">
<el-input v-model="addModel.permissionId" size="mini" style="width:140px" />
</el-form-item>
<el-form-item v-show="addModel.generatePermission" label="权限月数" prop="monthNumber">
<el-input-number v-model="addModel.monthNumber" size="mini" :min="1" :max="999" />
</el-form-item>
<el-form-item v-show="addModel.generatePermission" label="权限数量" prop="permissionQuantity">
<el-input-number v-model="addModel.permissionQuantity" size="mini" :min="1" :max="999" />
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleCorrelation">{{ $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { generateOfflineUser } from '@/api/management/user';
export default {
name: 'CreateUser',
data() {
return {
dialogVisible: false,
addModel: {
quantity: 1,
generatePermission: false,
monthNumber: 1,
permissionId: '',
permissionQuantity: 1
},
mapDict: {},
mapList: []
};
},
computed: {
rules() {
const rules = {
quantity: [
{ required: true, message: '请输入批量生成用户数量', trigger: 'blur' }
],
permissionId: [
{ required: true, message: '请输入权限ID', trigger: 'blur' }
],
monthNumber: [
{ required: true, message: '请输入权限月数', trigger: 'blur' }
],
permissionQuantity: [
{ required: true, message: '请输入权限数量', trigger: 'blur' }
]
};
}
},
mounted() {
this.mapDict = {};
},
methods: {
doClose(done) {
this.dialogVisible = false;
},
doShow(data) {
this.dialogVisible = true;
},
changeGeneratePermission(val) {
},
handleCorrelation() {
}
}
};
</script>

View File

@ -3,6 +3,7 @@
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<dictionary-edit ref="edit" @reloadTable="reloadTable" /> <dictionary-edit ref="edit" @reloadTable="reloadTable" />
<correlation-map ref="correlationMap" /> <correlation-map ref="correlationMap" />
<create-user ref="createUser" />
</div> </div>
</template> </template>
@ -10,12 +11,14 @@
import { getUserList } from '@/api/management/user'; import { getUserList } from '@/api/management/user';
import DictionaryEdit from './edit'; import DictionaryEdit from './edit';
import CorrelationMap from './correlationMap'; import CorrelationMap from './correlationMap';
import CreateUser from './createUser';
export default { export default {
name: 'UserControl', name: 'UserControl',
components: { components: {
DictionaryEdit, DictionaryEdit,
CorrelationMap CorrelationMap,
CreateUser
}, },
data() { data() {
return { return {
@ -85,6 +88,9 @@ export default {
} }
] ]
} }
],
actions: [
{ text: '创建本地用户', btnCode: 'employee_auto', handler: this.createLocalUsers }
] ]
}, },
currentModel: {} currentModel: {}
@ -123,6 +129,9 @@ export default {
reloadTable() { reloadTable() {
this.queryList.reload(); this.queryList.reload();
},
createLocalUsers() {
this.$refs.createUser.doShow();
} }
} }
}; };