Merge remote-tracking branch 'remotes/origin/test_dispaly' into test
This commit is contained in:
commit
36adbaeda1
@ -144,3 +144,10 @@ export function setDeviceConfig(data) {
|
||||
data: data
|
||||
});
|
||||
}
|
||||
/** 获取所有项目 */
|
||||
export function getAllProject() {
|
||||
return request({
|
||||
url: `/api/project/all `,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
|
@ -70,6 +70,9 @@ export default {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.menus {
|
||||
height: 100%;
|
||||
}
|
||||
.menus .pop-menu {
|
||||
background: #F0F0F0;
|
||||
}
|
||||
|
@ -70,6 +70,9 @@ export default {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.menus {
|
||||
height: 100%;
|
||||
}
|
||||
.menus .pop-menu {
|
||||
background: #F0F0F0;
|
||||
}
|
||||
|
@ -276,6 +276,11 @@ export default {
|
||||
{ value: 'user', label: '个人'},
|
||||
{ value: 'org', label: '组织'}
|
||||
],
|
||||
permissionSubTypeList: [ // 权限分发主体类型
|
||||
{ value: 'user', label: '个人'},
|
||||
{ value: 'org', label: '组织'},
|
||||
{ value: 'project', label: '项目'}
|
||||
],
|
||||
trainingType: [
|
||||
// 实训类型
|
||||
{ enlabel: 'single operation', label: '单操', value: 'SINGLE' },
|
||||
|
110
src/views/authorityTransfer/distributeOrg.vue
Normal file
110
src/views/authorityTransfer/distributeOrg.vue
Normal file
@ -0,0 +1,110 @@
|
||||
<template>
|
||||
<el-dialog title="权限分发到指定组织" :visible.sync="dialogVisible" width="1000px" :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>
|
||||
|
||||
import { setDistributeToSubject } from '@/api/authorityTransfer';
|
||||
import { getCompanyList } from '@/api/company';
|
||||
export default {
|
||||
name:'DistributeOrg',
|
||||
data() {
|
||||
return {
|
||||
packageId:'',
|
||||
dialogVisible:false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
columnNum: 5,
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: this.$t('system.name')
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
queryList: {
|
||||
query: this.getTableData,
|
||||
selectCheckShow: false,
|
||||
paginationHiden: true,
|
||||
height: '420',
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('system.name'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
prop: 'createTime',
|
||||
width: '160'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '90',
|
||||
buttons: [
|
||||
{
|
||||
name: '选择',
|
||||
handleClick: this.distributePackage
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods:{
|
||||
getTableData(obj) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getCompanyList().then(resp => {
|
||||
const list = [];
|
||||
resp.data && resp.data.forEach(item => {
|
||||
if (item.name.includes(obj.name || '')) {
|
||||
list.push(item);
|
||||
}
|
||||
});
|
||||
resolve({
|
||||
code: 200,
|
||||
message: '成功',
|
||||
data: list
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
reject();
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
doShow(data) {
|
||||
this.packageId = data.id;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
distributePackage(index, row) {
|
||||
if (this.packageId) {
|
||||
const accountId = row.id;
|
||||
const subjectType = 'org'; // 组织
|
||||
setDistributeToSubject(this.packageId, subjectType, accountId).then(resp=> {
|
||||
this.$message.success('权限分发给指定组织成功!');
|
||||
this.$emit('reloadTable');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$messageBox('权限分发给指定组织失败');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -171,14 +171,13 @@ export default {
|
||||
distributePackage(index, row) {
|
||||
if (this.packageId) {
|
||||
const accountId = row.id;
|
||||
// const subjectType = row.type == '1' ? 'user' : 'org';
|
||||
const subjectType = 'user'; // 都是用户
|
||||
const subjectType = 'user'; // 用户
|
||||
setDistributeToSubject(this.packageId, subjectType, accountId).then(resp=> {
|
||||
this.$message.success('权限分发给指定账户成功!');
|
||||
this.$message.success('权限分发给指定用户成功!');
|
||||
this.$emit('reloadTable');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$messageBox('权限分发给指定账户失败');
|
||||
this.$messageBox('权限分发给指定用户失败');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
105
src/views/authorityTransfer/distributeProject.vue
Normal file
105
src/views/authorityTransfer/distributeProject.vue
Normal file
@ -0,0 +1,105 @@
|
||||
<template>
|
||||
<el-dialog title="权限分发到指定项目" :visible.sync="dialogVisible" width="1000px" :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>
|
||||
|
||||
import { setDistributeToSubject } from '@/api/authorityTransfer';
|
||||
import { getAllProject } from '@/api/project';
|
||||
export default {
|
||||
name:'DistributeProject',
|
||||
data() {
|
||||
return {
|
||||
packageId:'',
|
||||
dialogVisible:false,
|
||||
pagerConfig: {
|
||||
pageSize: 'pageSize',
|
||||
pageIndex: 'pageNum'
|
||||
},
|
||||
queryForm: {
|
||||
labelWidth: '80px',
|
||||
reset: true,
|
||||
columnNum: 5,
|
||||
queryObject: {
|
||||
name: {
|
||||
type: 'text',
|
||||
label: this.$t('system.name')
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
queryList: {
|
||||
query: this.getTableData,
|
||||
selectCheckShow: false,
|
||||
paginationHiden: true,
|
||||
height: '420',
|
||||
indexShow: true,
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('system.name'),
|
||||
prop: 'name'
|
||||
},
|
||||
{
|
||||
type: 'button',
|
||||
title: this.$t('global.operate'),
|
||||
width: '90',
|
||||
buttons: [
|
||||
{
|
||||
name: '选择',
|
||||
handleClick: this.distributePackage
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
},
|
||||
methods:{
|
||||
getTableData(obj) {
|
||||
return new Promise((resolve, reject) => {
|
||||
getAllProject().then(resp => {
|
||||
const list = [];
|
||||
resp.data && resp.data.forEach(item => {
|
||||
if (item.name.includes(obj.name || '')) {
|
||||
list.push(item);
|
||||
}
|
||||
});
|
||||
resolve({
|
||||
code: 200,
|
||||
message: '成功',
|
||||
data: list
|
||||
});
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
reject();
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
doShow(data) {
|
||||
this.packageId = data.id;
|
||||
this.dialogVisible = true;
|
||||
},
|
||||
doClose() {
|
||||
this.dialogVisible = false;
|
||||
},
|
||||
distributePackage(index, row) {
|
||||
if (this.packageId) {
|
||||
const accountId = row.id;
|
||||
const subjectType = 'project'; // 项目
|
||||
setDistributeToSubject(this.packageId, subjectType, accountId).then(resp=> {
|
||||
this.$message.success('权限分发给指定项目成功!');
|
||||
this.$emit('reloadTable');
|
||||
this.doClose();
|
||||
}).catch(() => {
|
||||
this.$messageBox('权限分发给指定项目失败');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
@ -3,6 +3,8 @@
|
||||
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
|
||||
<qr-code ref="qrCode" />
|
||||
<distribute-package ref="distributePackage" @reloadTable="reloadTable" />
|
||||
<distribute-org ref="distributeOrg" @reloadTable="reloadTable" />
|
||||
<distributeProject ref="distributeProject" @reloadTable="reloadTable" />
|
||||
<Detail ref="detail" />
|
||||
</div>
|
||||
</template>
|
||||
@ -12,6 +14,8 @@ import { admin } from '@/router/index';
|
||||
import { getDistributeList, getDistributeQrCode } from '@/api/authorityTransfer';
|
||||
import QrCode from '@/components/QrCode';
|
||||
import DistributePackage from './distributePackage';
|
||||
import DistributeOrg from './distributeOrg';
|
||||
import DistributeProject from './distributeProject';
|
||||
import Detail from './detail';
|
||||
|
||||
export default {
|
||||
@ -19,7 +23,9 @@ export default {
|
||||
components: {
|
||||
QrCode,
|
||||
Detail,
|
||||
DistributePackage
|
||||
DistributePackage,
|
||||
DistributeOrg,
|
||||
DistributeProject
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@ -106,9 +112,19 @@ export default {
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '领取到',
|
||||
name: '领取到用户',
|
||||
handleClick: this.distributePackage,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '领取到组织',
|
||||
handleClick: this.distributeOrg,
|
||||
type: ''
|
||||
},
|
||||
{
|
||||
name: '领取到项目',
|
||||
handleClick: this.distributeProject,
|
||||
type: ''
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -146,6 +162,12 @@ export default {
|
||||
},
|
||||
distributePackage(index, row) {
|
||||
this.$refs.distributePackage.doShow(row);
|
||||
},
|
||||
distributeOrg(index, row) {
|
||||
this.$refs.distributeOrg.doShow(row);
|
||||
},
|
||||
distributeProject(index, row) {
|
||||
this.$refs.distributeProject.doShow(row);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -69,7 +69,7 @@ export default {
|
||||
prop: 'subjectType',
|
||||
width: '80',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.subjectType, 'subTypeList'); },
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.subjectType, 'permissionSubTypeList'); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
@ -166,7 +166,7 @@ export default {
|
||||
this.$ConstSelect.EffectiveTypeList.forEach(elem => {
|
||||
this.queryForm.queryObject.status.config.data.push(elem);
|
||||
});
|
||||
this.$ConstSelect.subTypeList.forEach(elem => {
|
||||
this.$ConstSelect.permissionSubTypeList.forEach(elem => {
|
||||
this.queryForm.queryObject.subType.config.data.push(elem);
|
||||
});
|
||||
},
|
||||
|
@ -56,7 +56,7 @@ export default {
|
||||
prop: 'subjectType',
|
||||
width: '80',
|
||||
type: 'tag',
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.subjectType, 'subTypeList'); },
|
||||
columnValue: (row) => { return this.$ConstSelect.translate(row.subjectType, 'permissionSubTypeList'); },
|
||||
tagType: (row) => { return ''; }
|
||||
},
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user