Merge remote-tracking branch 'remotes/origin/test_thirdLogin' into test

This commit is contained in:
joylink_cuiweidong 2021-06-10 16:08:04 +08:00
commit ce78cb8e08
5 changed files with 228 additions and 5 deletions

View File

@ -173,6 +173,22 @@ export function getLoginUserList(params) {
});
}
/** 将权限分发包分发给指定账户 */
export function distributePackage(id, accountId) {
return request({
url: `/api/distribute/${id}/distribute/${accountId} `,
method: 'post'
});
}
/** 删除账户(逻辑删除) */
export function deleteUserInLogic(id) {
return request({
url: `/api/user/${id}`,
method: 'delete'
});
}
// 导入学生成绩
export function importStudentResults(projectCode, data) {
return request({

View File

@ -0,0 +1,182 @@
<template>
<el-dialog title="权限分发包分发" :visible.sync="dialogVisible" width="1200px" :before-close="doClose" center :close-on-click-modal="false">
<QueryListPage ref="queryListPage1" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-dialog>
</template>
<script>
// v-dialogDrag
import { getUserList, distributePackage } from '@/api/management/user';
import { getCompanyList } from '@/api/company';
export default {
name:'DistributePackage',
data() {
return {
packageId:'',
dialogVisible:false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
companyMap: {},
companyList: [],
countTypeList:[
{label:'个人账户', value:'1'},
{label:'企业账户', value:'2'},
{label:'企业账户下子账户', value:'3'}
],
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: this.$t('system.name')
},
id: {
type: 'text',
label: 'id'
},
roles: {
type: 'select',
label: this.$t('system.roles'),
config: {
data: this.$ConstSelect.roleList
}
},
nickname: {
type: 'text',
label: '昵称'
},
mobile: {
type: 'text',
label: '手机号'
},
email: {
type: 'text',
label: '邮箱'
},
companyId: {
type: 'select',
label: '组织',
config: {
data: []
}
},
type:{
type: 'select',
label: '类型',
config: {
data: []
}
}
}
},
queryList: {
query: getUserList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: 'id',
prop: 'id',
width: 80
},
{
title: this.$t('system.name'),
prop: 'name'
},
{
title: this.$t('system.nickname'),
prop: 'nickname'
},
{
title: '类型',
prop: 'type',
type: 'tag',
columnValue: (row) => { return this.getCountType(row.type); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('global.mobile'),
prop: 'mobile'
},
{
title: this.$t('global.email'),
prop: 'email'
},
{
title: '组织',
prop: 'companyId',
type: 'tag',
columnValue: (row) => { return this.getCompanyName(row.companyId); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('system.roles'),
prop: 'roles',
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label'], true); },
tagType: (row) => { return 'success'; }
},
{
type: 'button',
title: this.$t('global.operate'),
width: '90',
buttons: [
{
name: '选择',
handleClick: this.distributePackage
}
]
}
]
}
};
},
created() {
this.companyMap = {};
this.companyList = [];
getCompanyList().then(resp => {
if (resp && resp.data && resp.data.length) {
resp.data.forEach(item => {
this.companyMap[item.id] = item.name;
this.companyList.push({label: item.name, value: parseInt(item.id)});
});
this.queryForm.queryObject.companyId.config.data = this.companyList;
this.queryForm.queryObject.type.config.data = this.countTypeList;
}
}).catch((error) => {
console.error(error);
});
},
methods:{
doShow(data) {
this.packageId = data.id;
this.dialogVisible = true;
},
doClose() {
this.dialogVisible = false;
},
getCountType(type) {
const countType = this.countTypeList.find(each=>{ return each.value == type; });
return countType ? countType.label : '';
},
getCompanyName(companyId) {
return this.companyMap[companyId];
},
distributePackage(index, row) {
if (this.packageId) {
const accountId = row.id;
distributePackage(this.packageId, accountId).then(resp=> {
this.$message.success('权限分发包分发给指定账户成功!');
this.$emit('reloadTable');
this.doClose();
}).catch(() => {
this.$messageBox('权限分发包分发给指定账户失败');
});
}
}
}
};
</script>

View File

@ -4,6 +4,7 @@
<qr-code ref="qrCode" />
<qcode ref="qcode" />
<project-package ref="projectPackage" @createSuccess="createSuccess" />
<distribute-package ref="distributePackage" @reloadTable="reloadTable" />
</div>
</template>
@ -14,6 +15,7 @@ import { UrlConfig } from '@/scripts/ConstDic';
import QrCode from '@/components/QrCode';
import Qcode from './Qcode';
import ProjectPackage from './projectPackage';
import DistributePackage from './distributePackage';
import { getOrganizationList } from '@/api/management/organization';
// import { getPublishMapListOnline } from '@/api/jmap/map';
import { getAdminAndSuperAdminList } from '@/api/management/user';
@ -23,7 +25,8 @@ export default {
components: {
QrCode,
Qcode,
ProjectPackage
ProjectPackage,
DistributePackage
},
data() {
return {
@ -185,6 +188,13 @@ export default {
handleClick: this.handleBelongs,
type: '',
showControl: (row) => { return row.amount !== row.remains; }
},
{
name: '领取到',
handleClick: this.distributePackage,
type: '',
// row.amount !== row.remains
showControl: (row) => { return row.remains > 0 && row.status == '1'; }
}
// {
// name: '退',
@ -323,6 +333,9 @@ export default {
},
handleBelongs(index, row) {
this.$router.push({ path: `/orderauthor/rules/manage`, query: {distributeId: row.id}});
},
distributePackage(index, row) {
this.$refs.distributePackage.doShow(row);
}
}
};

View File

@ -90,10 +90,9 @@ export default {
self.doClose();
}).catch((error) => {
if (error.code == 10012) {
this.$message.error('此账户数据已存在!');
this.$messageBox('此账户数据已存在!');
} else {
this.$message.error('创建第三方账户失败!');
this.$messageBox('创建第三方账户失败!');
}
});
}

View File

@ -9,7 +9,7 @@
</template>
<script>
import { getUserList } from '@/api/management/user';
import { getUserList, deleteUserInLogic } from '@/api/management/user';
import { getCompanyList } from '@/api/company';
import DictionaryEdit from './edit';
import CreateUser from './createUser';
@ -144,6 +144,10 @@ export default {
{
name: '绑定组织管理员',
handleClick: this.handleBind
},
{
name: '删除',
handleClick: this.handleDelete
}
]
}
@ -200,6 +204,15 @@ export default {
handleBind(index, row) {
this.$refs.bindCompany.doShow(row);
},
handleDelete(index, row) {
deleteUserInLogic(row.id).then(resp=> {
//
this.$message.success('删除账户成功!');
this.reloadTable();
}).catch(() => {
this.$messageBox('删除账户失败');
});
},
create() {
this.reloadTable();
}