Merge branch 'test_dispaly' of https://git.code.tencent.com/lian-cbtc/jl-client into test_dispaly1

This commit is contained in:
fan 2022-11-28 10:46:30 +08:00
commit a69ef7590e
17 changed files with 685 additions and 402 deletions

View File

@ -17,6 +17,32 @@ export function getUserList(params) {
});
}
/** 查询所有用户列表*/
export function getManageUserList(params) {
return request({
url: `/api/manage/user/list`,
method: 'get',
params: params
});
}
/** 根据用户查询用户角色列表*/
export function getUserRolesList(uid) {
return request({
url: `/api/manage/${uid}/roles`,
method: 'get'
});
}
/** 绑定用户角色*/
export function getBindUserRoles(data) {
return request({
url: `/api/manage/bind/org`,
method: 'post',
data
});
}
/** 模糊查询用户 昵称、名称、手机号*/
export function getDimUserList(params) {
return request({

View File

@ -25,6 +25,14 @@ export function getBackProjectConfigById(id) {
});
}
/** 通过code获取后端项目配置 */
export function getBackProjectConfigByCode(code) {
return request({
url: `/api/project/code/{code}`,
method: 'get'
});
}
/** 删除后端项目配置 */
export function deleteBackProjectConfig(id) {
return request({

View File

@ -17,6 +17,12 @@ export default {
{ label: '销售用户', value: '06' }
],
schoolRoleList: [
{ label: '管理员', value: 'Admin' },
{ label: '教师', value: 'Teacher' },
{ label: '学生', value: 'Student' }
],
examResultList: [
{ label: '未计算', value: '01' },
{ label: '通过', value: '02' },

View File

@ -3,8 +3,7 @@ const user = {
homeProLogoWidth:0,
loginProLogo:'',
homeTitle:'',
caseShow:true,
deviceRelated:{}
caseShow:true
},
mutations: {
setHomeProLogoWidth: (state, homeProLogoWidth) => {
@ -18,9 +17,6 @@ const user = {
},
setCaseShow: (state, caseShow) => {
state.caseShow = caseShow;
},
setDeviceRelated: (state, deviceRelated) => {
state.deviceRelated = deviceRelated;
}
},
actions: {
@ -35,11 +31,7 @@ const user = {
},
setCaseShow({ commit }, caseShow) {
commit('setCaseShow', caseShow);
},
setDeviceRelated({ commit }, deviceRelated) {
commit('setDeviceRelated', deviceRelated);
}
}
};

View File

@ -1,6 +1,6 @@
<template>
<div>
<query-list-page ref="user" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<query-list-page ref="user" :card-padding="10" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<dialog-detail ref="detail" />
<preview-answer ref="previewAnswer" :question-id="questionId" />
</div>

View File

@ -2,10 +2,10 @@
<div style="width: 100%;height: 100%;">
<QueryListPage
ref="classQueryListPage"
:card-padding="10"
:query-form="classQueryForm"
:pager-config="pagerConfig"
:query-list="classQueryList"
style="width:96%;margin: 0 auto;"
/>
<create-class ref="createClass" @refresh="classRefresh" />
</div>

View File

@ -1,253 +1,253 @@
<template>
<div style="width: 100%;height: 100%;">
<QueryListPage
ref="examQueryListPage"
:query-form="examQueryForm"
:pager-config="pagerConfig"
:query-list="examQueryList"
style="width:96%;margin: 0 auto;"
/>
</div>
<div style="width: 100%;">
<QueryListPage
ref="examQueryListPage"
:card-padding="10"
:query-form="examQueryForm"
:pager-config="pagerConfig"
:query-list="examQueryList"
/>
</div>
</template>
<script>
import config from '@/scripts/ConstConfig'
import { getPapaerListOfOrg, lockPaper, unlockPaper, deletePaper } from '@/api/management/exam'
import { getPublishMapListOnline } from '@/api/jmap/map'
import config from '@/scripts/ConstConfig';
import { getPapaerListOfOrg, lockPaper, unlockPaper, deletePaper } from '@/api/management/exam';
import { getPublishMapListOnline } from '@/api/jmap/map';
const { paperStateArr, paperStateQueryArr } = config.ConstSelect
const { paperStateArr, paperStateQueryArr } = config.ConstSelect;
export default {
name: 'ExamManage',
data() {
return {
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum',
},
mapIdList: [],
examQueryForm: {
leftSpan: 14,
textAlign: 'right',
labelWidth: '90px',
reset: true,
columnNum: 3,
queryObject: {
name: {
type: 'text',
label: '试卷名称:',
},
findState: {
type: 'select',
label: '状态:',
value: 1,
config: {
data: paperStateQueryArr.map((v, i) => ({ value: i + 1, label: v })),
},
noClearable: true,
},
},
},
examQueryList: {
query: obj => getPapaerListOfOrg({ ...obj, orgId: this.orgId }),
selectCheckShow: false,
indexShow: false,
columns: [
{
title: '试卷名称',
prop: 'name',
},
{
title: '简介',
prop: 'profile',
},
{
title: '状态',
prop: 'state',
type: 'tag',
width: '80',
columnValue: row => {
return paperStateArr[row.state - 1]
},
tagType: row => '',
},
{
title: '开始时间',
prop: 'startTime',
},
{
title: '截止时间',
prop: 'endTime',
},
{
title: '满分',
prop: 'fullScore',
width: '80',
},
{
title: '及格分',
prop: 'passScore',
width: '80',
},
{
title: '时长',
prop: 'validDuration',
type: 'tag',
width: '80',
columnValue: row => row.validDuration,
tagType: row => {},
},
{
title: '创建人',
prop: 'creatorName',
width: '150',
formatter: row => row.creatorInfo.name,
},
{
type: 'button',
title: this.$t('global.operate'),
width: '350',
buttons: [
{
name: '成绩查询',
handleClick: this.handleQueryGrade,
type: 'primary',
},
{
name: '成绩统计',
handleClick: this.handleGradeStatistics,
type: 'success',
},
{
name: '编辑',
handleClick: this.handleEdit,
type: 'primary',
showControl: row => {
return row.creatorId == this.userId && row.state === 1
},
},
{
name: '封存',
handleClick: this.handleLock,
type: 'warning',
showControl: row => {
return row.creatorId == this.userId && row.state === 1
},
},
{
name: '解封',
handleClick: this.handleUnlock,
type: 'danger',
showControl: row => {
return row.creatorId == this.userId && row.state === 2
},
},
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger',
showControl: row => {
return row.creatorId == this.userId && row.state === 1
},
},
],
},
],
actions: [{ text: '新建试卷', handler: this.examCreate }],
},
}
},
computed: {
userId() {
return this.$store.state.user.id
},
orgId() {
return this.$store.state.user.companyId
},
},
created() {
this.mapIdList = []
getPublishMapListOnline().then(response => {
this.mapIdList = response.data
})
},
methods: {
handleQueryGrade(index, row) {
this.$router.push({ path: '/info/gradeList', query: { examId: row.id, name: row.name } })
},
handleGradeStatistics(index, row) {
this.$router.push({ path: '/info/gradeStatistics', query: { examId: row.id, name: row.name } })
},
handleEdit(index, row) {
this.$router.push({ path: `/info/examRule/draft/edit/${row.id}`, query: { source: 'org' } })
},
examCreate() {
this.$router.push({ path: `/info/examRule/draft/add/0`, query: { source: 'org' } })
},
handleLock(index, data) {
lockPaper(data.id)
.then(res => {
this.examRefresh()
this.$message.success('封存试卷成功!')
})
.catch(error => {
this.$message.error('封存试卷失败:' + error.message)
})
},
handleUnlock(index, data) {
this.$confirm('该操作将解封试卷,是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning',
})
.then(() => {
unlockPaper(data.id)
.then(res => {
this.examRefresh()
this.$message({
type: 'success',
message: '解封试卷成功!',
})
})
.catch(res => {
if (res.code == '10004') {
this.$message({ type: 'error', message: '解封失败:试卷已被使用,无法解封!' })
} else if (res.code == '10003') {
this.$message({ type: 'warning', message: '解封失败:无权限解封!' })
} else {
this.$message({ type: 'error', message: '解封试卷失败!' })
}
})
})
.catch(() => {})
},
handleDelete(index, data) {
this.$confirm('确定删除该试卷吗?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning',
})
.then(() => deletePaper(data.id))
.then(resp => {
this.examRefresh()
this.$message({
type: 'success',
message: '删除成功!',
})
})
.catch(res => {
if (res.code && res.code !== 200) {
this.$message({ type: 'error', message: res.message })
}
})
},
examRefresh() {
this.$nextTick(() => {
this.$refs.examQueryListPage.refresh(true)
})
},
},
}
name: 'ExamManage',
data() {
return {
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
mapIdList: [],
examQueryForm: {
leftSpan: 14,
textAlign: 'right',
labelWidth: '90px',
reset: true,
columnNum: 3,
queryObject: {
name: {
type: 'text',
label: '试卷名称:'
},
findState: {
type: 'select',
label: '状态:',
value: 1,
config: {
data: paperStateQueryArr.map((v, i) => ({ value: i + 1, label: v }))
},
noClearable: true
}
}
},
examQueryList: {
query: obj => getPapaerListOfOrg({ ...obj, orgId: this.orgId }),
selectCheckShow: false,
indexShow: false,
columns: [
{
title: '试卷名称',
prop: 'name'
},
{
title: '简介',
prop: 'profile'
},
{
title: '状态',
prop: 'state',
type: 'tag',
width: '80',
columnValue: row => {
return paperStateArr[row.state - 1];
},
tagType: row => ''
},
{
title: '开始时间',
prop: 'startTime'
},
{
title: '截止时间',
prop: 'endTime'
},
{
title: '满分',
prop: 'fullScore',
width: '80'
},
{
title: '及格分',
prop: 'passScore',
width: '80'
},
{
title: '时长',
prop: 'validDuration',
type: 'tag',
width: '80',
columnValue: row => row.validDuration,
tagType: row => {}
},
{
title: '创建人',
prop: 'creatorName',
width: '150',
formatter: row => row.creatorInfo.name
},
{
type: 'button',
title: this.$t('global.operate'),
width: '350',
buttons: [
{
name: '成绩查询',
handleClick: this.handleQueryGrade,
type: 'primary'
},
{
name: '成绩统计',
handleClick: this.handleGradeStatistics,
type: 'success'
},
{
name: '编辑',
handleClick: this.handleEdit,
type: 'primary',
showControl: row => {
return row.creatorId == this.userId && row.state === 1;
}
},
{
name: '封存',
handleClick: this.handleLock,
type: 'warning',
showControl: row => {
return row.creatorId == this.userId && row.state === 1;
}
},
{
name: '解封',
handleClick: this.handleUnlock,
type: 'danger',
showControl: row => {
return row.creatorId == this.userId && row.state === 2;
}
},
{
name: '删除',
handleClick: this.handleDelete,
type: 'danger',
showControl: row => {
return row.creatorId == this.userId && row.state === 1;
}
}
]
}
],
actions: [{ text: '新建试卷', handler: this.examCreate }]
}
};
},
computed: {
userId() {
return this.$store.state.user.id;
},
orgId() {
return this.$store.state.user.companyId;
}
},
created() {
this.mapIdList = [];
getPublishMapListOnline().then(response => {
this.mapIdList = response.data;
});
},
methods: {
handleQueryGrade(index, row) {
this.$router.push({ path: '/info/gradeList', query: { examId: row.id, name: row.name } });
},
handleGradeStatistics(index, row) {
this.$router.push({ path: '/info/gradeStatistics', query: { examId: row.id, name: row.name } });
},
handleEdit(index, row) {
this.$router.push({ path: `/info/examRule/draft/edit/${row.id}`, query: { source: 'org' } });
},
examCreate() {
this.$router.push({ path: `/info/examRule/draft/add/0`, query: { source: 'org' } });
},
handleLock(index, data) {
lockPaper(data.id)
.then(res => {
this.examRefresh();
this.$message.success('封存试卷成功!');
})
.catch(error => {
this.$message.error('封存试卷失败:' + error.message);
});
},
handleUnlock(index, data) {
this.$confirm('该操作将解封试卷,是否继续?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
})
.then(() => {
unlockPaper(data.id)
.then(res => {
this.examRefresh();
this.$message({
type: 'success',
message: '解封试卷成功!'
});
})
.catch(res => {
if (res.code == '10004') {
this.$message({ type: 'error', message: '解封失败:试卷已被使用,无法解封!' });
} else if (res.code == '10003') {
this.$message({ type: 'warning', message: '解封失败:无权限解封!' });
} else {
this.$message({ type: 'error', message: '解封试卷失败!' });
}
});
})
.catch(() => {});
},
handleDelete(index, data) {
this.$confirm('确定删除该试卷吗?', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
})
.then(() => deletePaper(data.id))
.then(resp => {
this.examRefresh();
this.$message({
type: 'success',
message: '删除成功!'
});
})
.catch(res => {
if (res.code && res.code !== 200) {
this.$message({ type: 'error', message: res.message });
}
});
},
examRefresh() {
this.$nextTick(() => {
this.$refs.examQueryListPage.refresh(true);
});
}
}
};
</script>
<style scoped></style>

View File

@ -1,28 +1,25 @@
<template>
<div>
<div class="title_content">{{ companyName + '教学管理' }}</div>
<div class="lessonManageInfo">
<el-menu class="lessonManageMenu" default-active="2-1">
<el-menu-item index="1" @click="clickMenu">
<img :src="classIcon" class="teachMenu">
<span class="teachMenuTitle" :style="{color: $route.path.includes('classManage')?'#5BDBFF': '#000'}">班级管理</span>
</el-menu-item>
<el-menu-item index="7" @click="clickMenu">
<img :src="ruleIcon" class="teachMenu">
<span class="teachMenuTitle" :style="{color: $route.path.includes('trainingManage')?'#5BDBFF': '#000'}">实训管理</span>
</el-menu-item>
<el-menu-item index="8" @click="clickMenu">
<img :src="lessonIcon" class="teachMenu">
<span class="teachMenuTitle" :style="{color: $route.path.includes('theoryManage')?'#5BDBFF': '#000'}">理论题目管理</span>
</el-menu-item>
<el-menu-item index="3" @click="clickMenu">
<img :src="examIcon" class="teachMenu">
<span slot="title" class="teachMenuTitle" :style="{color: $route.path.includes('examManage')?'#5BDBFF': '#000'}">考试管理</span>
</el-menu-item>
<div class="mianBox">
<div class="lessonManageInfo" :style="{width: widthLeft+'px'}">
<el-menu
:default-active="defaultIndex"
class="el-menu-vertical-demo lessonManageMenu"
background-color="#545c64"
text-color="#fff"
router
active-text-color="#ffd04b"
>
<template>
<el-menu-item v-for="(item, i) in menuList" :key="i" :index="item.path">
<img :src="item.imgUrl" class="teachMenu">
<span>{{ item.name }}</span>
</el-menu-item>
</template>
</el-menu>
<div class="lessonManageOther">
<router-view />
</div>
<drap-left :width-left="widthLeft" @drapWidth="drapWidth" />
</div>
<div class="lessonManageOther" :style="{width: rightWidth, height: rightHeight}">
<router-view />
</div>
</div>
</template>
@ -32,9 +29,13 @@ import ClassIcon from '@/assets/teachManage/class.png';
import LessonIcon from '@/assets/teachManage/lesson.png';
import ExamIcon from '@/assets/teachManage/exam.png';
import RuleIcon from '@/assets/teachManage/rule.png';
import drapLeft from '@/views/components/drapLeft/index';
export default {
name: 'Organization',
components: {
drapLeft
},
data() {
return {
classIcon: ClassIcon,
@ -44,41 +45,62 @@ export default {
mapIdList: [],
lessonList: [],
classList: []
classList: [],
widthLeft: 200,
defaultIndex: '/teaching/organization/classManage',
menuList: [
{name: '班级管理', path: '/teaching/organization/classManage', imgUrl: ClassIcon},
{name: '实训管理', path: '/teaching/organization/trainingManage', imgUrl: RuleIcon},
{name: '理论题目管理', path: '/teaching/organization/theoryManage', imgUrl: LessonIcon},
{name: '考试管理', path: '/teaching/organization/examManage', imgUrl: ExamIcon}
]
};
},
computed: {
companyName() {
return this.$store.state.user.companyName;
},
rightWidth() {
return `calc(100% - ${this.widthLeft}px)`;
},
rightHeight() {
return (this.height - 110) + 'px';
},
height() {
return this.$store.state.app.height;
}
},
watch: {
'$route'(val) {
this.defaultIndex = val.path;
}
},
mounted() {
this.defaultIndex = this.$route.path;
},
methods:{
clickMenu(val) {
if (val.index === '1') {
this.$router.replace('/teaching/organization/classManage');
} else if (val.index === '3') {
this.$router.replace('/teaching/organization/examManage');
} else if (val.index === '4') {
this.$router.replace('/teaching/organization/ruleManage');
} else if (val.index === '7') {
this.$router.replace('/teaching/organization/trainingManage'); //
} else if (val.index === '8') {
this.$router.replace('/teaching/organization/theoryManage');
}
drapWidth(width) {
this.widthLeft = Number(width);
}
}
};
</script>
<style scoped>
.back_box {height: 20px;z-index: 36;width: 40px;text-align: center;position: absolute;right: 20px;top: -20px;}
.title_content {width: 100%;margin: 20px 0 30px;text-align: center;font-size: 28px;font-weight: bold;}
.teachMenu{width: 18px;height: 18px;margin-right: 8px;}
.lessonIcon{font-size: 16px;}
.teachMenuTitle{font-size: 18px;}
.lessonManageBack{position: fixed;right: 20px;top: 70px;}
.lessonManageOther{width: calc(100% - 200px);margin-left: 200px;}
.lessonManageInfo{width: 96%;margin: 0 auto;overflow: hidden;}
.lessonManageMenu{width: 200px;float: left;}
.lessonManageOther{
border: 1px solid #DCDFE6;
margin: 10px;
padding: 10px;
overflow: auto;
}
.lessonManageMenu{
height: 100%;
}
.mianBox {
width: 100%;
height: 100%;
display: flex;
}
</style>

View File

@ -2,10 +2,10 @@
<div style="width: 100%;height: 100%">
<QueryListPage
ref="ruleQueryListPage"
:card-padding="10"
:query-form="ruleQueryForm"
:pager-config="pagerConfig"
:query-list="ruleQueryList"
style="width:96%;margin: 0 auto;"
/>
<apply-class ref="applyClass" @refresh="refresh" />
</div>

View File

@ -55,7 +55,6 @@ export default {
selectCheckShow: false,
paginationHiden: true,
indexShow: true,
height: 500,
columns: [
{
title: this.$t('trainingManage.name'),

View File

@ -36,17 +36,31 @@
移出
</el-button>
</span>
<span v-if="node.data.type === 'ORG'" @click.stop>
<el-button
type="text"
size="small"
@click="() => addNode(node,data)"
>
添加
</el-button>
</span>
</span>
</el-tree>
</el-card>
<selectUserRole ref="selectUserRole" @add="addTreeUser" />
</div>
</template>
<script>
import { getOrgTreeById, deleteDepartUserRelation } from '@/api/company';
import localStore from 'storejs';
import selectUserRole from './selectUserRole.vue';
export default {
name: 'OrgDetail',
components: {
selectUserRole
},
data() {
return {
filterText: '',
@ -71,6 +85,12 @@ export default {
localStore.set('orgDetail-treeKey-' + this.$route.query.orgId, this.expandedKeys);
},
methods: {
addTreeUser(data, parentId) {
this.$refs.tree && this.$refs.tree.append(data, parentId);
},
addNode(node, data) {
this.$refs.selectUserRole.doShow(data);
},
initData() {
getOrgTreeById(this.$route.query.orgId).then(resp => {
this.treeData = [];

View File

@ -0,0 +1,117 @@
<template>
<el-dialog v-dialogDrag title="绑定组织成员" :visible.sync="dialogVisible" width="30%" :before-close="doClose" center :close-on-click-modal="false">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doConfirm">{{ $t('global.confirm') }}</el-button>
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { getBindUserRoles, getManageUserList } from '@/api/management/user';
import ConstConfig from '@/scripts/ConstConfig';
export default {
name:'SelectUserRole',
props: {
},
data() {
return {
dialogVisible: false,
userList: [],
formModel: {
keyId: '',
orgName: '',
orgId: '',
uid: '',
role:''
}
};
},
computed: {
form() {
const form = {
labelWidth: '150px',
items: [
{ prop: 'orgName', label: '组织', type: 'text', disabled:true, rightWidth:true },
{ prop: 'uid', label: '用户', type: 'select', options: this.userList},
{ prop: 'role', label: '角色', type: 'select', options: ConstConfig.ConstSelect.schoolRoleList}
]
};
return form;
},
rules() {
const crules = {
uid: [
{ required: true, message: '请选择用户', trigger: 'change' }
],
role: [
{ required: true, message: '请选择角色', trigger: 'change' }
]
};
return crules;
}
},
created() {
getManageUserList().then(resp => {
if (resp && resp.data && resp.data.length) {
resp.data.forEach(item => {
this.userList.push({label: item.name, value: item.id});
});
}
}).catch((error) => {
console.error(error);
});
},
methods:{
doShow(row) {
this.dialogVisible = true;
this.formModel.orgName = row.name;
this.formModel.orgId = row.id;
this.formModel.uid = '';
this.formModel.role = '';
this.formModel.keyId = row.keyId;
},
doClose() {
this.dialogVisible = false;
this.formModel = {
keyId: '',
orgName: '',
orgId: '',
uid: '',
role:''
};
},
getUserName(id) {
let name = '';
const findItem = this.userList.find(item => {
return item.value == id;
});
if (findItem) {
name = findItem.label;
}
return name;
},
doConfirm() {
this.$refs.dataform.validateForm(() => {
const formModel = Object.assign({}, this.formModel);
delete formModel.orgName;
getBindUserRoles(formModel).then(res=>{
const nodeData = {
keyId: this.formModel.keyId + 'USER' + this.formModel.uid,
name: this.getUserName(this.formModel.uid),
orgRole: this.formModel.role,
type: 'USER',
userId: this.formModel.uid
};
this.$emit('add', nodeData, this.formModel.keyId);
this.doClose();
}).catch((error) => {
this.$message.error('绑定组织成员失败: ' + error.message);
});
});
}
}
};
</script>

View File

@ -37,6 +37,7 @@ export default {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
projectCode:'',
deviceTypeList:ConstConfig.ConstSelect.projectDeviceTypeList,
projectList: [
{label:'西铁院', value: 'XTY'},
@ -54,22 +55,6 @@ export default {
{label: '长兴技校', value: 'RICHOR_CXJS'},
{label: '京津冀联盟', value: 'JJJLM'}
],
projectMap: {
designxty: 'XTY',
designgzb: 'GZB',
designheb: 'HEB',
designsdy: 'SDY',
designrichorjoint: 'RICHOR_JOINT',
designsrsandbox: 'SR_SANDBOX',
designjxgm: 'JXGM',
designygy: 'RICHOR_YGY',
designsay: 'SAY',
designunittecsty: 'UNITTEC_STY',
designrichorhhcj: 'RICHOR_HHCJ',
designteaching: 'TEACHING',
designrichorcxjs: 'RICHOR_CXJS'
},
queryForm: {
labelWidth: '120px',
reset: true,
@ -148,12 +133,8 @@ export default {
currentModel: {}
};
},
computed: {
projectCode() {
return this.projectMap[getSessionStorage('project')];
}
},
created() {
this.projectCode = getSessionStorage('project') || '';
},
methods: {
beforeQuery(params) {

View File

@ -65,20 +65,6 @@
<el-form-item label="文件地址:" prop="ossUrl" class="inlineBlock">
<el-input v-model="formModel.ossUrl" style="width: 210px;" size="small" />
</el-form-item>
<el-form-item label="是否包含设备:" prop="containDevice" class="inlineBlock">
<el-switch v-model="formModel.containDevice" />
</el-form-item>
<el-form-item v-if="formModel.containDevice" label="设备关联地图:" prop="deviceRelatedMap" class="inlineBlock" style="margin-left:170px">
<el-select v-model="formModel.deviceRelatedMap" filterable placeholder="请选择" size="small" style="width: 210px;" @change="getRelatedFunctionList">
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item v-if="formModel.containDevice" label="设备关联功能:" prop="deviceRelatedFunction">
<el-select v-model="formModel.deviceRelatedFunction" filterable placeholder="请选择" size="small" style="width: 210px;">
<el-option v-for="item in functionList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
@ -87,9 +73,7 @@
</el-dialog>
</template>
<script>
import {queryMapListByUser} from '@/api/jmap/map';
import { updateFrontProjectConfig, getUploadUrl } from '@/api/projectConfig';
import { queryMapFunctionList } from '@/api/trainingPlatform';
export default {
name:'FrontProjectConfig',
data() {
@ -98,8 +82,6 @@ export default {
loginProLogoImg:'',
row:null,
loading: false,
mapList:[],
functionList:[],
formModel:{
loginProtitle:'', //
loginOrgTitle:'', //
@ -123,11 +105,7 @@ export default {
judgeRoute:'', //
baseApiUrl:'', // api
baseSite:'', //
ossUrl:'', // oss
containDevice:false, //
deviceRelatedMap:'', //
deviceRelatedFunction:'' //
ossUrl:'' // oss
}
};
@ -154,14 +132,6 @@ export default {
return '修改前端配置';
}
},
created() {
queryMapListByUser().then(resp => {
this.mapList = resp.data;
}).catch(e => {
this.loading = false;
this.$message.error('获取地图列表失败!');
});
},
methods:{
doShow(row) {
this.dialogVisible = true;
@ -195,12 +165,6 @@ export default {
this.formModel.baseSite = viewSetting.baseSite || '';
this.formModel.ossUrl = viewSetting.ossUrl || '';
this.formModel.containDevice = viewSetting.containDevice || false;
this.formModel.deviceRelatedMap = viewSetting.deviceRelatedMap || '';
this.formModel.deviceRelatedFunction = viewSetting.deviceRelatedFunction || '';
if (this.formModel.deviceRelatedMap) { this.getRelatedFunctionList(this.formModel.deviceRelatedMap); }
}
},
handleClose() {
@ -227,11 +191,7 @@ export default {
judgeRoute:'', //
baseApiUrl:'', // api
baseSite:'', //
ossUrl:'', // oss
containDevice:false, //
deviceRelatedMap:'', //
deviceRelatedFunction:'' //
ossUrl:'' // oss
};
this.$refs.ruleForm.resetFields();
@ -306,14 +266,6 @@ export default {
// directoryMINIO
// fileName
// method
},
getRelatedFunctionList(mapId) {
queryMapFunctionList({mapId: mapId}).then(resp => {
this.functionList = resp.data;
console.log(resp);
}).catch(() => {
this.$message.error('获取地图功能列表失败!');
});
}
}
};

View File

@ -10,6 +10,16 @@
<el-form-item label="项目描述:" prop="description">
<el-input v-model="formModel.description" style="width: 260px;" />
</el-form-item>
<el-form-item label="实训室关联地图:" prop="mapId">
<el-select v-model="formModel.mapId" filterable placeholder="请选择" size="small" style="width: 260px;" @change="getRelatedFunctionList">
<el-option v-for="item in mapList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
<el-form-item label="实训室关联功能:" prop="functionId">
<el-select v-model="formModel.functionId" filterable placeholder="请选择" size="small" style="width: 260px;">
<el-option v-for="item in functionList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
@ -18,17 +28,23 @@
</el-dialog>
</template>
<script>
import {queryMapListByUser} from '@/api/jmap/map';
import { saveBackProjectConfig, updateBackProjectConfig, checkBackProjectExist} from '@/api/projectConfig';
import { queryMapFunctionList } from '@/api/trainingPlatform';
export default {
name: 'AddProject',
data() {
return {
dialogVisible: false,
mapList:[],
functionList:[],
formModel: {
id: '',
code: '', //
name: '', //
description: '' //
description: '', //
mapId:'', //
functionId:'' //
},
loading: false
};
@ -44,6 +60,14 @@ export default {
],
description: [
{ required: true, message: '请输入项目描述', trigger: 'blur' }
],
mapId: [
{ required: true, message: '请选择实训室关联地图', trigger: 'blur' },
{ required: true, message: '请选择实训室关联地图', trigger: 'change' }
],
functionId: [
{ required: true, message: '请选择实训室关联功能', trigger: 'blur' },
{ required: true, message: '请选择实训室关联功能', trigger: 'change' }
]
};
return crules;
@ -52,6 +76,14 @@ export default {
return this.formModel.id ? '修改项目' : '创建项目';
}
},
created() {
queryMapListByUser().then(resp => {
this.mapList = resp.data;
}).catch(e => {
this.loading = false;
this.$message.error('获取地图列表失败!');
});
},
methods:{
doShow(row) {
this.dialogVisible = true;
@ -60,18 +92,32 @@ export default {
this.formModel.code = row.code;
this.formModel.name = row.name;
this.formModel.description = row.description;
const mapId = row.mapId;
this.formModel.mapId = mapId.toString();
if (this.formModel.mapId) { this.getRelatedFunctionList(mapId); }
this.formModel.functionId = row.functionId;
} else {
this.$nextTick(() => {
this.$refs.ruleForm.resetFields();
});
}
},
getRelatedFunctionList(mapId) {
queryMapFunctionList({mapId: mapId}).then(resp => {
this.functionList = resp.data;
console.log(resp);
}).catch(() => {
this.$message.error('获取地图功能列表失败!');
});
},
handleClose() {
this.formModel = {
id: '',
code: '', //
name: '', //
description: '' //
description: '', //
mapId:'', //
functionId:'' //
};
this.$refs.ruleForm.resetFields();
this.dialogVisible = false;
@ -85,31 +131,31 @@ export default {
// code
checkBackProjectExist({code:data.code}).then(res=>{
if (!res.data) {
if (data.id) {
//
updateBackProjectConfig(data).then(resp => {
this.$message.success('修改项目成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
} else {
delete data.id;
//
saveBackProjectConfig(data).then(resp => {
this.$message.success('创建项目成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
}
// if (data.id) {
// } else {
delete data.id;
//
saveBackProjectConfig(data).then(resp => {
this.$message.success('创建项目成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
// }
} else {
this.loading = false;
this.$message.error('此项目已存在,请修改项目编码');
//
updateBackProjectConfig(data).then(resp => {
this.$message.success('修改项目成功!');
this.handleClose();
this.$emit('reloadTable');
}).catch(error => {
this.$message.error(error.message);
this.loading = false;
});
// this.loading = false;
// this.$message.error(',');
}
});
}

View File

@ -0,0 +1,104 @@
<template>
<el-dialog v-dialogDrag title="组织关系列表" :visible.sync="dialogVisible" width="50%" :before-close="doClose" center :close-on-click-modal="false">
<QueryListPage ref="queryListPage1" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<span slot="footer" class="dialog-footer">
<el-button @click="doClose">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { getUserRolesList } from '@/api/management/user';
export default {
name:'CompanyRelation',
props: {
companyMap: {
type: Object,
default() {
return {};
}
}
},
data() {
return {
dialogVisible: false,
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
show: false
},
queryList: {
query: this.getUserRolesList,
paginationHiden: true,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '用户名称',
prop: 'name',
width: 80
},
{
title: '组织',
prop: 'orgId',
type: 'tag',
columnValue: (row) => { return this.getCompanyName(row.orgId); },
tagType: (row) => { return 'success'; }
},
{
title: '根组织',
prop: 'rootOrgId',
type: 'tag',
columnValue: (row) => { return this.getCompanyName(row.rootOrgId); },
tagType: (row) => { return 'success'; }
},
{
title: this.$t('system.roles'),
prop: 'role',
type: 'tag',
columnValue: (row) => { return this.$convertField(row.role, this.$ConstSelect.schoolRoleList, ['value', 'label']); },
tagType: (row) => { return 'success'; }
}
]
},
userId: '',
userName: ''
};
},
methods:{
getCompanyName(companyId) {
return this.companyMap[companyId];
},
getUserRolesList() {
return new Promise((resolve, reject) => {
getUserRolesList(this.userId).then(res => {
res.data && res.data.forEach(item => {
item.name = this.userName;
});
resolve(res);
}).catch(err => {
console.log(err);
reject(err);
});
});
},
doShow(row) {
this.dialogVisible = true;
this.userId = row.id;
this.userName = row.name || '';
this.reloadTable();
},
reloadTable() {
if (this.queryList && this.queryList.reload) {
this.queryList.reload();
}
},
doClose() {
this.dialogVisible = false;
this.userId = '';
}
}
};
</script>

View File

@ -5,6 +5,7 @@
<create-user ref="createUser" />
<create-single-user ref="createSingleUser" @reloadTable="reloadTable" />
<bind-company ref="bindCompany" :company-list="companyList" @create="create" />
<CompanyRelation ref="companyRelation" :company-map="companyMap" />
</div>
</template>
@ -15,6 +16,7 @@ import DictionaryEdit from './edit';
import CreateUser from './createUser';
import CreateSingleUser from './createSingleUser';
import BindCompany from './bindCompany';
import CompanyRelation from './companyRelation';
import {adminResetUserPassword} from '@/api/management/user';
export default {
@ -23,7 +25,8 @@ export default {
DictionaryEdit,
CreateUser,
CreateSingleUser,
BindCompany
BindCompany,
CompanyRelation
},
data() {
return {
@ -145,7 +148,7 @@ export default {
tagType: (row) => { return 'success'; }
},
{
title: this.$t('system.roles'),
title: '权限',
prop: 'roles',
type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label'], true); },
@ -160,9 +163,13 @@ export default {
name: this.$t('global.edit'),
handleClick: this.handleUserEdit
},
// {
// name: '',
// handleClick: this.handleBind
// },
{
name: '绑定组织管理员',
handleClick: this.handleBind
name: '组织关系',
handleClick: this.handleRelation
},
{
name: '重置密码',
@ -222,11 +229,14 @@ export default {
this.$refs.createSingleUser.doShow();
},
companyManage() {
this.$router.push({ path: `/system/companyManage`});
this.$router.push({ path: `/systemManagement/systemDataManagement/companyManage`});
},
handleBind(index, row) {
this.$refs.bindCompany.doShow(row);
},
handleRelation(index, row) {
this.$refs.companyRelation.doShow(row);
},
resetPassword(index, row) {
this.$confirm('操作会将改用户密码重置为初始密码,是否继续', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),