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) { export function getDimUserList(params) {
return request({ 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) { export function deleteBackProjectConfig(id) {
return request({ return request({

View File

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

View File

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

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <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" /> <dialog-detail ref="detail" />
<preview-answer ref="previewAnswer" :question-id="questionId" /> <preview-answer ref="previewAnswer" :question-id="questionId" />
</div> </div>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -36,17 +36,31 @@
移出 移出
</el-button> </el-button>
</span> </span>
<span v-if="node.data.type === 'ORG'" @click.stop>
<el-button
type="text"
size="small"
@click="() => addNode(node,data)"
>
添加
</el-button>
</span>
</span> </span>
</el-tree> </el-tree>
</el-card> </el-card>
<selectUserRole ref="selectUserRole" @add="addTreeUser" />
</div> </div>
</template> </template>
<script> <script>
import { getOrgTreeById, deleteDepartUserRelation } from '@/api/company'; import { getOrgTreeById, deleteDepartUserRelation } from '@/api/company';
import localStore from 'storejs'; import localStore from 'storejs';
import selectUserRole from './selectUserRole.vue';
export default { export default {
name: 'OrgDetail', name: 'OrgDetail',
components: {
selectUserRole
},
data() { data() {
return { return {
filterText: '', filterText: '',
@ -71,6 +85,12 @@ export default {
localStore.set('orgDetail-treeKey-' + this.$route.query.orgId, this.expandedKeys); localStore.set('orgDetail-treeKey-' + this.$route.query.orgId, this.expandedKeys);
}, },
methods: { methods: {
addTreeUser(data, parentId) {
this.$refs.tree && this.$refs.tree.append(data, parentId);
},
addNode(node, data) {
this.$refs.selectUserRole.doShow(data);
},
initData() { initData() {
getOrgTreeById(this.$route.query.orgId).then(resp => { getOrgTreeById(this.$route.query.orgId).then(resp => {
this.treeData = []; 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', pageSize: 'pageSize',
pageIndex: 'pageNum' pageIndex: 'pageNum'
}, },
projectCode:'',
deviceTypeList:ConstConfig.ConstSelect.projectDeviceTypeList, deviceTypeList:ConstConfig.ConstSelect.projectDeviceTypeList,
projectList: [ projectList: [
{label:'西铁院', value: 'XTY'}, {label:'西铁院', value: 'XTY'},
@ -54,22 +55,6 @@ export default {
{label: '长兴技校', value: 'RICHOR_CXJS'}, {label: '长兴技校', value: 'RICHOR_CXJS'},
{label: '京津冀联盟', value: 'JJJLM'} {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: { queryForm: {
labelWidth: '120px', labelWidth: '120px',
reset: true, reset: true,
@ -148,12 +133,8 @@ export default {
currentModel: {} currentModel: {}
}; };
}, },
computed: {
projectCode() {
return this.projectMap[getSessionStorage('project')];
}
},
created() { created() {
this.projectCode = getSessionStorage('project') || '';
}, },
methods: { methods: {
beforeQuery(params) { beforeQuery(params) {

View File

@ -65,20 +65,6 @@
<el-form-item label="文件地址:" prop="ossUrl" class="inlineBlock"> <el-form-item label="文件地址:" prop="ossUrl" class="inlineBlock">
<el-input v-model="formModel.ossUrl" style="width: 210px;" size="small" /> <el-input v-model="formModel.ossUrl" style="width: 210px;" size="small" />
</el-form-item> </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> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button> <el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
@ -87,9 +73,7 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import {queryMapListByUser} from '@/api/jmap/map';
import { updateFrontProjectConfig, getUploadUrl } from '@/api/projectConfig'; import { updateFrontProjectConfig, getUploadUrl } from '@/api/projectConfig';
import { queryMapFunctionList } from '@/api/trainingPlatform';
export default { export default {
name:'FrontProjectConfig', name:'FrontProjectConfig',
data() { data() {
@ -98,8 +82,6 @@ export default {
loginProLogoImg:'', loginProLogoImg:'',
row:null, row:null,
loading: false, loading: false,
mapList:[],
functionList:[],
formModel:{ formModel:{
loginProtitle:'', // loginProtitle:'', //
loginOrgTitle:'', // loginOrgTitle:'', //
@ -123,11 +105,7 @@ export default {
judgeRoute:'', // judgeRoute:'', //
baseApiUrl:'', // api baseApiUrl:'', // api
baseSite:'', // baseSite:'', //
ossUrl:'', // oss ossUrl:'' // oss
containDevice:false, //
deviceRelatedMap:'', //
deviceRelatedFunction:'' //
} }
}; };
@ -154,14 +132,6 @@ export default {
return '修改前端配置'; return '修改前端配置';
} }
}, },
created() {
queryMapListByUser().then(resp => {
this.mapList = resp.data;
}).catch(e => {
this.loading = false;
this.$message.error('获取地图列表失败!');
});
},
methods:{ methods:{
doShow(row) { doShow(row) {
this.dialogVisible = true; this.dialogVisible = true;
@ -195,12 +165,6 @@ export default {
this.formModel.baseSite = viewSetting.baseSite || ''; this.formModel.baseSite = viewSetting.baseSite || '';
this.formModel.ossUrl = viewSetting.ossUrl || ''; 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() { handleClose() {
@ -227,11 +191,7 @@ export default {
judgeRoute:'', // judgeRoute:'', //
baseApiUrl:'', // api baseApiUrl:'', // api
baseSite:'', // baseSite:'', //
ossUrl:'', // oss ossUrl:'' // oss
containDevice:false, //
deviceRelatedMap:'', //
deviceRelatedFunction:'' //
}; };
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
@ -306,14 +266,6 @@ export default {
// directoryMINIO // directoryMINIO
// fileName // fileName
// method // 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-form-item label="项目描述:" prop="description">
<el-input v-model="formModel.description" style="width: 260px;" /> <el-input v-model="formModel.description" style="width: 260px;" />
</el-form-item> </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> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button> <el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
@ -18,17 +28,23 @@
</el-dialog> </el-dialog>
</template> </template>
<script> <script>
import {queryMapListByUser} from '@/api/jmap/map';
import { saveBackProjectConfig, updateBackProjectConfig, checkBackProjectExist} from '@/api/projectConfig'; import { saveBackProjectConfig, updateBackProjectConfig, checkBackProjectExist} from '@/api/projectConfig';
import { queryMapFunctionList } from '@/api/trainingPlatform';
export default { export default {
name: 'AddProject', name: 'AddProject',
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
mapList:[],
functionList:[],
formModel: { formModel: {
id: '', id: '',
code: '', // code: '', //
name: '', // name: '', //
description: '' // description: '', //
mapId:'', //
functionId:'' //
}, },
loading: false loading: false
}; };
@ -44,6 +60,14 @@ export default {
], ],
description: [ description: [
{ required: true, message: '请输入项目描述', trigger: 'blur' } { 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; return crules;
@ -52,6 +76,14 @@ export default {
return this.formModel.id ? '修改项目' : '创建项目'; return this.formModel.id ? '修改项目' : '创建项目';
} }
}, },
created() {
queryMapListByUser().then(resp => {
this.mapList = resp.data;
}).catch(e => {
this.loading = false;
this.$message.error('获取地图列表失败!');
});
},
methods:{ methods:{
doShow(row) { doShow(row) {
this.dialogVisible = true; this.dialogVisible = true;
@ -60,18 +92,32 @@ export default {
this.formModel.code = row.code; this.formModel.code = row.code;
this.formModel.name = row.name; this.formModel.name = row.name;
this.formModel.description = row.description; 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 { } else {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
}); });
} }
}, },
getRelatedFunctionList(mapId) {
queryMapFunctionList({mapId: mapId}).then(resp => {
this.functionList = resp.data;
console.log(resp);
}).catch(() => {
this.$message.error('获取地图功能列表失败!');
});
},
handleClose() { handleClose() {
this.formModel = { this.formModel = {
id: '', id: '',
code: '', // code: '', //
name: '', // name: '', //
description: '' // description: '', //
mapId:'', //
functionId:'' //
}; };
this.$refs.ruleForm.resetFields(); this.$refs.ruleForm.resetFields();
this.dialogVisible = false; this.dialogVisible = false;
@ -85,17 +131,8 @@ export default {
// code // code
checkBackProjectExist({code:data.code}).then(res=>{ checkBackProjectExist({code:data.code}).then(res=>{
if (!res.data) { if (!res.data) {
if (data.id) { // if (data.id) {
// // } else {
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; delete data.id;
// //
saveBackProjectConfig(data).then(resp => { saveBackProjectConfig(data).then(resp => {
@ -106,10 +143,19 @@ export default {
this.$message.error(error.message); this.$message.error(error.message);
this.loading = false; this.loading = false;
}); });
} // }
} else { } else {
//
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('此项目已存在,请修改项目编码'); });
// 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-user ref="createUser" />
<create-single-user ref="createSingleUser" @reloadTable="reloadTable" /> <create-single-user ref="createSingleUser" @reloadTable="reloadTable" />
<bind-company ref="bindCompany" :company-list="companyList" @create="create" /> <bind-company ref="bindCompany" :company-list="companyList" @create="create" />
<CompanyRelation ref="companyRelation" :company-map="companyMap" />
</div> </div>
</template> </template>
@ -15,6 +16,7 @@ import DictionaryEdit from './edit';
import CreateUser from './createUser'; import CreateUser from './createUser';
import CreateSingleUser from './createSingleUser'; import CreateSingleUser from './createSingleUser';
import BindCompany from './bindCompany'; import BindCompany from './bindCompany';
import CompanyRelation from './companyRelation';
import {adminResetUserPassword} from '@/api/management/user'; import {adminResetUserPassword} from '@/api/management/user';
export default { export default {
@ -23,7 +25,8 @@ export default {
DictionaryEdit, DictionaryEdit,
CreateUser, CreateUser,
CreateSingleUser, CreateSingleUser,
BindCompany BindCompany,
CompanyRelation
}, },
data() { data() {
return { return {
@ -145,7 +148,7 @@ export default {
tagType: (row) => { return 'success'; } tagType: (row) => { return 'success'; }
}, },
{ {
title: this.$t('system.roles'), title: '权限',
prop: 'roles', prop: 'roles',
type: 'tagMore', type: 'tagMore',
columnValue: (row) => { return this.$convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label'], true); }, columnValue: (row) => { return this.$convertField(row.roles, this.$ConstSelect.roleList, ['value', 'label'], true); },
@ -160,9 +163,13 @@ export default {
name: this.$t('global.edit'), name: this.$t('global.edit'),
handleClick: this.handleUserEdit handleClick: this.handleUserEdit
}, },
// {
// name: '',
// handleClick: this.handleBind
// },
{ {
name: '绑定组织管理员', name: '组织关系',
handleClick: this.handleBind handleClick: this.handleRelation
}, },
{ {
name: '重置密码', name: '重置密码',
@ -222,11 +229,14 @@ export default {
this.$refs.createSingleUser.doShow(); this.$refs.createSingleUser.doShow();
}, },
companyManage() { companyManage() {
this.$router.push({ path: `/system/companyManage`}); this.$router.push({ path: `/systemManagement/systemDataManagement/companyManage`});
}, },
handleBind(index, row) { handleBind(index, row) {
this.$refs.bindCompany.doShow(row); this.$refs.bindCompany.doShow(row);
}, },
handleRelation(index, row) {
this.$refs.companyRelation.doShow(row);
},
resetPassword(index, row) { resetPassword(index, row) {
this.$confirm('操作会将改用户密码重置为初始密码,是否继续', this.$t('global.tips'), { this.$confirm('操作会将改用户密码重置为初始密码,是否继续', this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'), confirmButtonText: this.$t('global.confirm'),