# Conflicts:
#	src/jmapNew/config/skinCode/nanjing_02.js
#	src/jmapNew/shape/Responder/index.js
This commit is contained in:
joylink_cuiweidong 2021-01-12 17:27:25 +08:00
commit 1e2e8c2609
16 changed files with 211 additions and 119 deletions

View File

@ -839,8 +839,17 @@ class SkinCode extends defaultStyle {
this[deviceType.Responder] = { this[deviceType.Responder] = {
block: { block: {
mapStyle: {
FB: { fill: '#fff' },
VB: { fill: '#666' },
IB: { fill: '#666' }
}
},
delta: {
fill: '#fff'
}, },
text: { text: {
textFill: '#fff'
} }
}; };

View File

@ -4,6 +4,7 @@
import Group from 'zrender/src/container/Group'; import Group from 'zrender/src/container/Group';
import Rect from 'zrender/src/graphic/shape/Rect'; import Rect from 'zrender/src/graphic/shape/Rect';
import Text from 'zrender/src/graphic/Text'; import Text from 'zrender/src/graphic/Text';
import Polygon from 'zrender/src/graphic/shape/Polygon';
export default class Responder extends Group { export default class Responder extends Group {
constructor(model, style) { constructor(model, style) {
@ -15,21 +16,27 @@ export default class Responder extends Group {
this.style = style; this.style = style;
this.isShowShape = true; this.isShowShape = true;
this.z = model.zIndex || 1; this.z = model.zIndex || 1;
if (model.previewOrMapDraw) {
this.create(); this.create();
this.setState(model);
}
} }
create() { create() {
const model = this.model; const model = this.model;
const responderStyle = this.style.Responder;
const blockX = model.position.x; const blockX = model.position.x;
const blockY = model.position.y; const blockY = model.position.y;
const blockWidth = this.style.Responder.block.width || 5; const blockWidth = responderStyle.block.width || 5;
const blockHeight = this.style.Responder.block.height || 12; const blockHeight = responderStyle.block.height || 12;
const blockStroke = this.style.Responder.block.stroke || '#000'; const blockStroke = responderStyle.block.stroke || '#000';
const blockFill = this.style.Responder.block.fill || '#fff'; const blockStyle = responderStyle.block.mapStyle[model.type] || { fill: '#000'};
const textX = model.position.x + model.offset.x; const textX = model.position.x + model.textOffset.x;
const textY = model.position.y + model.offset.y; const textY = model.position.y + model.textOffset.y;
const textName = `${model.type}-${model.name}`; const textName = `${model.type}-${model.name}`;
const textColor = this.style.Responder.text.stroke || '#fff'; const textFill = responderStyle.text.textFill || '#fff';
const deltaFill = responderStyle.delta.fill || '#fff';
const padding = 1.2;
this.block = new Rect({ this.block = new Rect({
zlevel: this.model.zlevel, zlevel: this.model.zlevel,
@ -42,17 +49,10 @@ export default class Responder extends Group {
}, },
style: { style: {
stroke: blockStroke, stroke: blockStroke,
fill: blockFill ...blockStyle
} }
}); });
if (model.rotate) {
const origin = [blockX, blockY];
const rotation = -Math.PI / 180 * Number(model.rotate);
this.transformRotation(this.block, origin, rotation);
}
this.add(this.block);
this.text = new Text({ this.text = new Text({
zlevel: this.zlevel, zlevel: this.zlevel,
z: this.z + 1, z: this.z + 1,
@ -62,22 +62,68 @@ export default class Responder extends Group {
text: textName, text: textName,
fontFamily: this.style.fontFamily, fontFamily: this.style.fontFamily,
fontSize: this.style.fontSize, fontSize: this.style.fontSize,
textFill: textColor, textFill: textFill,
textAlign: 'right' textAlign: 'right'
} }
}); });
this.delta1 = new Polygon({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
points: [
[blockX + blockWidth / 2, blockY + blockWidth],
[blockX + padding, blockY + padding],
[blockX + blockWidth - padding, blockY + padding]
]
},
style: {
fill: deltaFill
}
});
this.delta2 = new Polygon({
zlevel: this.zlevel,
z: this.z + 1,
shape: {
points: [
[blockX + blockWidth / 2, blockY + blockHeight - blockWidth],
[blockX + padding, blockY + blockHeight - padding],
[blockX + blockWidth - padding, blockY + blockHeight - padding]
]
},
style: {
fill: deltaFill
}
});
if (model.rotate) {
const origin = [blockX, blockY];
const rotation = -Math.PI / 180 * Number(model.rotate);
[this.block, this.delta1, this.delta2].forEach(el => {
this.transformRotation(el, origin, rotation);
});
}
if (model.textRotate) { if (model.textRotate) {
const origin = [textX, textY]; const origin = [textX, textY];
const rotation = -Math.PI / 180 * Number(model.textRotate); const rotation = -Math.PI / 180 * Number(model.textRotate);
this.transformRotation(this.text, origin, rotation); this.transformRotation(this.text, origin, rotation);
} }
this.add(this.text); [this.block, this.delta1, this.delta2, this.text].forEach(el => {
this.add(el);
});
} }
setState(model) { setState(model) {
if (!this.isShowShape) return; if (!this.isShowShape) return;
const responderStyle = this.style.Responder;
const style = responderStyle.block.mapStyle[model.type] || { fill: '#000'};
this.block.setStyle(style);
[this.delta1, this.delta2].forEach(el => {
model.type == 'IB' ? el.show() : el.hide();
});
} }
// 整体图片 // 整体图片

View File

@ -263,6 +263,7 @@ export function parser(data, skinCode, showConfig) {
mapDevice[elem.code] = createDevice(deviceType.DirectionRod, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.DirectionRod, elem, propConvert, showConfig);
}, this); }, this);
if (!data.responderList) { data.responderList = []; };
zrUtil.each(data.responderList || [], elem => { zrUtil.each(data.responderList || [], elem => {
mapDevice[elem.code] = createDevice(deviceType.Responder, elem, propConvert, showConfig); mapDevice[elem.code] = createDevice(deviceType.Responder, elem, propConvert, showConfig);
}, this); }, this);

View File

@ -11,7 +11,7 @@
<span style="display:block;" @click="handleDetail">{{ $t('global.personalDetails') }}</span> <span style="display:block;" @click="handleDetail">{{ $t('global.personalDetails') }}</span>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item v-if="companyAdmin"> <el-dropdown-item v-if="companyAdmin">
<span style="display:block;" @click="handleOrganization">{{ $t('global.organization') }}</span> <span style="display:block;" @click="handleOrganization">教学管理</span>
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item> <el-dropdown-item>
<span style="display:block;" @click="logout">{{ $t('global.exit') }}</span> <span style="display:block;" @click="logout">{{ $t('global.exit') }}</span>

View File

@ -537,7 +537,7 @@ const map = {
}, },
responderList: (state) => { responderList: (state) => {
if (state.map) { if (state.map) {
return state.map.responderList || []; return state.map.responderList;
} else { } else {
return []; return [];
} }

View File

@ -16,7 +16,7 @@
<div class="btn-buy"> <div class="btn-buy">
<!-- <el-button v-if="!isLocal" type="success" :disabled="disabled" @click="buy">{{ $t('global.buy') }}</el-button> --> <!-- <el-button v-if="!isLocal" type="success" :disabled="disabled" @click="buy">{{ $t('global.buy') }}</el-button> -->
<el-button v-if="hasPermssion && !isComprehensive && !isLocal" type="primary" :disabled="disabled" @click="distribute">{{ $t('global.distributePermission') }}</el-button> <el-button v-if="hasPermssion && !isComprehensive && !isLocal" type="primary" :disabled="disabled" @click="distribute">{{ $t('global.distributePermission') }}</el-button>
<el-button v-show="isStartDemon" :disabled="disabled" type="primary" @click="start">{{ $t('demonstration.startSimulation') }}</el-button> <el-button :disabled="disabled" type="primary" @click="start">{{ $t('demonstration.startSimulation') }}</el-button>
</div> </div>
</div> </div>
</template> </template>
@ -78,9 +78,6 @@ export default {
isComprehensive() { isComprehensive() {
return this.courseModel.prdType === '03'; return this.courseModel.prdType === '03';
}, },
isStartDemon() {
return (this.hasPermssion || this.tryTime > 0);
},
mapId() { mapId() {
return this.$route.query.mapId; return this.$route.query.mapId;
}, },
@ -173,7 +170,11 @@ export default {
this.$router.push({ path: `/jointTrainingNew`, query: query }); this.$router.push({ path: `/jointTrainingNew`, query: query });
launchFullscreen(); launchFullscreen();
}).catch(error => { }).catch(error => {
if (error.code == 10003) {
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
} else {
this.$messageBox(this.$t('error.createSimulationFailed') + error.message); this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
}
this.disabled = false; this.disabled = false;
}); });
}, },
@ -188,6 +189,11 @@ export default {
this.$router.push({ path: `/displayIscs/system`, query: query }); this.$router.push({ path: `/displayIscs/system`, query: query });
} }
} catch (error) { } catch (error) {
if (error.code == 10003) {
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
} else {
this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
}
this.disabled = false; this.disabled = false;
} }
}, },
@ -200,7 +206,11 @@ export default {
} }
this.$router.push({ path: `/displayBigScreen/${this.courseModel.mapId}`, query: query }); this.$router.push({ path: `/displayBigScreen/${this.courseModel.mapId}`, query: query });
}).catch(error => { }).catch(error => {
if (error.code == 10003) {
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
} else {
this.$messageBox(this.$t('error.createSimulationFailed') + error.message); this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
}
this.disabled = false; this.disabled = false;
}); });
}, },
@ -220,7 +230,11 @@ export default {
this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query }); this.$router.push({ path: `${UrlConfig.displayNew}/demon`, query: query });
launchFullscreen(); launchFullscreen();
}).catch(error=>{ }).catch(error=>{
if (error.code == 10003) {
this.$messageBox(this.$t('error.createSimulationFailed') + ':您的仿真权限不足!');
} else {
this.$messageBox(this.$t('error.createSimulationFailed') + error.message); this.$messageBox(this.$t('error.createSimulationFailed') + error.message);
}
this.disabled = false; this.disabled = false;
}); });
}, },

View File

@ -48,7 +48,7 @@ export default {
name: '', name: '',
rotate: 0, rotate: 0,
textRotate: 0, textRotate: 0,
offset: { textOffset: {
x: 0, x: 0,
y: 0 y: 0
}, },
@ -56,6 +56,7 @@ export default {
x: 0, x: 0,
y: 0 y: 0
}, },
offset: 0,
sectionCode: '', sectionCode: '',
stationCode: '' stationCode: ''
}, },
@ -72,6 +73,9 @@ export default {
rotate: [ rotate: [
{ required: true, message: '请输入应答器旋转角度', trigger: 'blur' } { required: true, message: '请输入应答器旋转角度', trigger: 'blur' }
], ],
offset: [
{ type: 'number', required: true, message: '请输入应答器文字旋转角度', trigger: 'blur', min: 0 }
],
textRotate: [ textRotate: [
{ required: true, message: '请输入应答器文字旋转角度', trigger: 'blur' } { required: true, message: '请输入应答器文字旋转角度', trigger: 'blur' }
], ],
@ -87,10 +91,10 @@ export default {
'position.y': [ 'position.y': [
{ required: true, message: '请输入应答器坐标y', trigger: 'blur' } { required: true, message: '请输入应答器坐标y', trigger: 'blur' }
], ],
'offset.x': [ 'textOffset.x': [
{ required: true, message: '请输入应答器偏移x', trigger: 'blur' } { required: true, message: '请输入应答器偏移x', trigger: 'blur' }
], ],
'offset.y': [ 'textOffset.y': [
{ required: true, message: '请输入应答器偏移y', trigger: 'blur' } { required: true, message: '请输入应答器偏移y', trigger: 'blur' }
] ]
} }
@ -115,14 +119,15 @@ export default {
{ prop: 'code', label: '应答器编码', type: 'select', optionLabel: 'code', optionValue: 'code', options: this.responderList, deviceChange: this.deviceChange }, { prop: 'code', label: '应答器编码', type: 'select', optionLabel: 'code', optionValue: 'code', options: this.responderList, deviceChange: this.deviceChange },
{ prop: 'name', label: '应答器名称', type: 'input' }, { prop: 'name', label: '应答器名称', type: 'input' },
{ prop: 'type', label: `应答器类型`, type: 'select', optionLabel: 'name', optionValue: 'value', options: this.responderTypeList }, { prop: 'type', label: `应答器类型`, type: 'select', optionLabel: 'name', optionValue: 'value', options: this.responderTypeList },
{ prop: 'offset', label: '区段偏移值', type: 'number' },
{ prop: 'position', label: '坐标', type: 'coordinate', width: '120px', children: [ { prop: 'position', label: '坐标', type: 'coordinate', width: '120px', children: [
{ prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false }, { prop: 'position.x', firstLevel: 'position', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
{ prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false } { prop: 'position.y', firstLevel: 'position', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
] }, ] },
{ prop: 'rotate', label: '应答器旋转', type: 'number' }, { prop: 'rotate', label: '应答器旋转', type: 'number' },
{ prop: 'offset', label: '文字偏移', type: 'coordinate', width: '120px', children: [ { prop: 'textOffset', label: '文字偏移', type: 'coordinate', width: '120px', children: [
{ prop: 'offset.x', firstLevel: 'offset', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false }, { prop: 'textOffset.x', firstLevel: 'textOffset', secondLevel: 'x', label: 'x:', type: 'number', labelWidth: '25px', disabled: false },
{ prop: 'offset.y', firstLevel: 'offset', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false } { prop: 'textOffset.y', firstLevel: 'textOffset', secondLevel: 'y', label: 'y:', type: 'number', labelWidth: '25px', disabled: false }
] }, ] },
{ prop:'textRotate', label: '文字旋转', type: 'number' }, { prop:'textRotate', label: '文字旋转', type: 'number' },
{ prop: 'sectionCode', label: '关联区段', type: 'select', optionLabel: 'code', optionValue: 'code', options: this.sectionList }, { prop: 'sectionCode', label: '关联区段', type: 'select', optionLabel: 'code', optionValue: 'code', options: this.sectionList },

View File

@ -21,7 +21,7 @@ export function buildModelBySection(section, model, list) {
x: vx, x: vx,
y: vy y: vy
}, },
offset: { textOffset: {
x: 0, x: 0,
y: 0 y: 0
}, },

View File

@ -1,22 +1,10 @@
<template> <template>
<div> <div>
<div class="back_box"> <div class="back_box">
<el-button v-if="companyAdmin" :loading="loadingStudentInfo" type="text" class="uploadDemo" style="margin-top: 10px;">
<input
id="importResults"
ref="files"
type="file"
class="file_box"
accept=".json, application/json, .csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
@change="importResults"
>
导入学生信息
</el-button>
<el-button type="text" @click="exportTemplate">学生信息导入模板</el-button>
<el-button type="text" @click="goBack">返回</el-button> <el-button type="text" @click="goBack">返回</el-button>
</div> </div>
<el-tabs v-model="activeName" type="card"> <el-tabs v-model="activeName" type="card">
<el-tab-pane label="部门管理" name="first"> <el-tab-pane label="组织" name="first">
<div style="font-size: 22px;text-align: center;">{{ $store.state.user.companyName }}</div> <div style="font-size: 22px;text-align: center;">{{ $store.state.user.companyName }}</div>
<div style="position: relative;transform: translateX(-50%);left: 50%;padding: 20px;width: 500px;"> <div style="position: relative;transform: translateX(-50%);left: 50%;padding: 20px;width: 500px;">
<el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick"> <el-tree :data="data" :props="defaultProps" @node-click="handleNodeClick">
@ -29,11 +17,11 @@
</el-tree> </el-tree>
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="成员管理" name="second"> <el-tab-pane label="成员" name="second">
<el-row> <el-row>
<el-col :span="21" :offset="1"> <el-col :span="19" style="padding-left: 20px;">
<span>班级</span> <span>班级</span>
<el-select v-model="classId" size="small" placeholder="班级"> <el-select v-model="classId" size="mini" placeholder="班级">
<el-option <el-option
v-for="item in classList" v-for="item in classList"
:key="item.departmentId" :key="item.departmentId"
@ -42,8 +30,20 @@
/> />
</el-select> </el-select>
</el-col> </el-col>
<el-col :span="2"> <el-col :span="5">
<el-button type="primary" size="small" @click="onSubmit">查询</el-button> <el-button v-if="companyAdmin" :loading="loadingStudentInfo" type="primary" size="mini" class="uploadDemo" style="margin-top: 10px;">
<input
id="importResults"
ref="files"
type="file"
class="file_box"
accept=".json, application/json, .csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel"
@change="importResults"
>
导入学生信息
</el-button>
<el-button type="primary" size="mini" @click="exportTemplate">学生信息导入模板</el-button>
<el-button type="primary" size="mini" @click="onSubmit">查询</el-button>
</el-col> </el-col>
</el-row> </el-row>
<el-table :data="tableData" border style="width: 100%;margin-top: 10px;" :max-height="height"> <el-table :data="tableData" border style="width: 100%;margin-top: 10px;" :max-height="height">
@ -69,7 +69,7 @@
/> />
</div> </div>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="成绩导出" name="third"> <el-tab-pane label="成绩" name="third">
<grade-export refs="gradeExport" :class-list="classList" :height="height" /> <grade-export refs="gradeExport" :class-list="classList" :height="height" />
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -247,29 +247,24 @@ export default {
for (const index in wb.Sheets) { for (const index in wb.Sheets) {
const dataList = convertSheetToList(wb.Sheets[index], true); const dataList = convertSheetToList(wb.Sheets[index], true);
if (dataList.length) { if (dataList.length) {
const depart = dataList[2][0].trim(); const depart = dataList[1][0].trim();
const parentDepart = dataList[1][0].trim(); const parentDepart = dataList[0][0].trim();
studentData.depart = depart; studentData.depart = depart;
studentData.parentDepart = parentDepart; studentData.parentDepart = parentDepart;
for ( let i = 2; i <= dataList[0].length; i++) { for ( let i = 2; i <= dataList[0].length; i++) {
const serialNumber = dataList[0][i]; const studentId = dataList[0][i];
const studentId = dataList[1][i]; const name = dataList[1][i];
const name = dataList[2][i];
const reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g'); const reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
const studentIdJudge = !!studentId && !reg.test(studentId); const studentIdJudge = !!studentId && !reg.test(studentId);
const serialNumberJudge = serialNumber == (i - 1); if (studentIdJudge && name) {
console.log(studentIdJudge, serialNumberJudge); students.push({account:dataList[0][i], name: dataList[1][i]});
if (studentIdJudge && serialNumberJudge && name) {
students.push({account:dataList[1][i], name: dataList[2][i]});
} else { } else {
if (!serialNumber && !studentId && !name) { if (!studentId && !name) {
break; break;
} else if (!name) { } else if (!name) {
throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据学生姓名为空!`); throw new Error(`学号为:《${studentId}》的数据学生姓名为空!`);
} else if (!studentIdJudge) { } else if (!studentIdJudge) {
throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据学号格式不正确!`); throw new Error(`,学号为:《${studentId}》的数据学号格式不正确!`);
} else if (!serialNumberJudge) {
throw new Error(`序号为:《${serialNumber}》,学号为:《${studentId}》的数据序号顺序不正确!`);
} }
} }
} }
@ -305,10 +300,10 @@ export default {
}, },
exportTemplate() { exportTemplate() {
const wb = XLSX.utils.book_new(); const wb = XLSX.utils.book_new();
const data1 = [{A: '', B: '年级一', C:'班级二'}]; const data1 = [{ A: 'XXXX级', B:'XX班'}];
const data2 = [{A: '序号', B: '学号', C:'姓名'}]; const data2 = [{A: '学号', B:'姓名'}];
const data3 = [{A: '1', B: '00001', C:'张三'}]; const data3 = [{A: '00001', B:'张三'}];
const data4 = [{A: '2', B: '00002', C:'李四'}]; const data4 = [{A: '00002', B:'李四'}];
const data = [...data1, ...data2, ...data3, ...data4]; const data = [...data1, ...data2, ...data3, ...data4];
const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true}); const ws = XLSX.utils.json_to_sheet(data, {skipHeader:true});
ws['!cols'] = [ ws['!cols'] = [
@ -331,7 +326,7 @@ export default {
padding-right: 20px; padding-right: 20px;
height: 40px; height: 40px;
z-index: 36; z-index: 36;
width: 320px; width: 40px;
text-align: center; text-align: center;
position: absolute; position: absolute;
right: 0; right: 0;

View File

@ -35,7 +35,7 @@ import { getPublishLessonList } from '@/api/jmap/lesson';
import RuleFrom from './rule'; import RuleFrom from './rule';
import ExamFrom from './examFrom'; import ExamFrom from './examFrom';
import { getPublishMapInfo } from '@/api/jmap/map'; import { getPublishMapInfo } from '@/api/jmap/map';
import { getExamLessonDetail, setCourseList, setCourseListGzb } from '@/api/management/exam'; import { getExamLessonDetail, setCourseList } from '@/api/management/exam';
import { UrlConfig } from '@/scripts/ConstDic'; import { UrlConfig } from '@/scripts/ConstDic';
import { getSessionStorage } from '@/utils/auth'; import { getSessionStorage } from '@/utils/auth';
@ -71,9 +71,6 @@ export default {
}, },
isFastCreate() { isFastCreate() {
return this.display == 1 && this.$route.params.mode != 'edit' && Number(this.$route.params.ruleId); return this.display == 1 && this.$route.params.mode != 'edit' && Number(this.$route.params.ruleId);
},
isGzbShow() {
return getSessionStorage('project').startsWith('gzb');
} }
}, },
watch: { watch: {
@ -103,6 +100,7 @@ export default {
}); });
}, },
async definition(data) { async definition(data) {
console.log(data, '====');
this.course = data; this.course = data;
this.formData = {}; this.formData = {};
this.display = 2; this.display = 2;
@ -140,11 +138,7 @@ export default {
}; };
let res = {}; let res = {};
try { try {
if (this.isGzbShow) {
res = await setCourseListGzb(result);
} else {
res = await setCourseList(result); res = await setCourseList(result);
}
this.$message.success({ message: res.message }); this.$message.success({ message: res.message });
this.$store.dispatch('exam/setRuleList', []); // this.$store.dispatch('exam/setRuleList', []); //
const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleManage}`; const path = `${this.$route.path.match(/(\/.*)\/examRule/)[1]}${UrlConfig.examRuleManage}`;

View File

@ -25,7 +25,7 @@
</template> </template>
<script> <script>
import { getExamLessonDetail, setCourseList, setCourseListGzb } from '@/api/management/exam'; import { getExamLessonDetail, setCourseList } from '@/api/management/exam';
import { UrlConfig, getTrainingOperateTypeMap } from '@/scripts/ConstDic'; import { UrlConfig, getTrainingOperateTypeMap } from '@/scripts/ConstDic';
import editRule from './editRule'; import editRule from './editRule';
import LangStorage from '@/utils/lang'; import LangStorage from '@/utils/lang';
@ -72,9 +72,6 @@ export default {
}; };
}, },
computed: { computed: {
isGzbShow() {
return getSessionStorage('project').startsWith('gzb');
}
}, },
watch: { watch: {
}, },
@ -135,7 +132,7 @@ export default {
examDefinitionRulesVOList: this.ruleList, // examDefinitionRulesVOList: this.ruleList, //
fullPoint: Number(this.course.fullMark), // fullPoint: Number(this.course.fullMark), //
lessonId: this.course.region, // id lessonId: this.course.region, // id
classes: this.isGzbShow ? this.course.classes.map(ele => { return {id: ele}; }) : [], classes: this.course.classes.map(ele => { return {id: ele}; }),
name: this.course.name, // name: this.course.name, //
passingPoint: Number(this.course.passMark), // passingPoint: Number(this.course.passMark), //
remarks: this.course.desc, // remarks: this.course.desc, //
@ -154,12 +151,7 @@ export default {
}, },
async save(data) { async save(data) {
try { try {
let res = {}; const res = await setCourseList(data);
if (this.isGzbShow) {
res = await setCourseListGzb(data);
} else {
res = await setCourseList(data);
}
this.$message.success({ message: res.message }); this.$message.success({ message: res.message });
this.$store.dispatch('exam/setCourseDetail', this.formDetail); // form this.$store.dispatch('exam/setCourseDetail', this.formDetail); // form
this.$store.dispatch('exam/setRuleList', []); // this.$store.dispatch('exam/setRuleList', []); //

View File

@ -12,6 +12,12 @@
import { addCompany, updateCompany } from '@/api/company'; import { addCompany, updateCompany } from '@/api/company';
export default { export default {
name: 'Add', name: 'Add',
props: {
projectListNew:{
type: Array,
required: true
}
},
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
@ -19,7 +25,8 @@ export default {
address: '', address: '',
name: '', name: '',
phone: '', phone: '',
id: '' id: '',
projectCode: ''
}, },
update: false update: false
}; };
@ -31,7 +38,8 @@ export default {
items: [ items: [
{ prop: 'name', label: '名称', type: 'text' }, { prop: 'name', label: '名称', type: 'text' },
{ prop: 'phone', label: '电话', type: 'text' }, { prop: 'phone', label: '电话', type: 'text' },
{ prop: 'address', label: '地址', type: 'text' } { prop: 'address', label: '地址', type: 'text' },
{ prop: 'projectCode', label: '关联项目', type: 'select', options: this.projectListNew}
] ]
}; };
return form; return form;
@ -47,12 +55,15 @@ export default {
], ],
address:[ address:[
{ required: true, message: '请输入公司地址', trigger: 'blur'} { required: true, message: '请输入公司地址', trigger: 'blur'}
],
projectCode: [
{ required: true, message: '请选择关联项目', trigger: 'change'}
] ]
}; };
return crules; return crules;
}, },
title() { title() {
return this.update ? '添加单位' : '修改单位'; return this.update ? '修改单位' : '添加单位';
} }
}, },
methods: { methods: {
@ -65,19 +76,22 @@ export default {
id: data.id, id: data.id,
name: data.name, name: data.name,
phone: data.phone, phone: data.phone,
address: data.address address: data.address,
}; projectCode: data.projectCode
} else {
this.formModel = {
address: '',
name: '',
phone: '',
id: ''
}; };
} }
}, },
handleClose() { handleClose() {
this.dialogVisible = false; this.dialogVisible = false;
this.update = false;
this.formModel = {
address: '',
name: '',
phone: '',
id: '',
projectCode: ''
};
this.$refs.dataform.resetFields();
}, },
doSave() { doSave() {
this.$refs.dataform.validateForm(() => { this.$refs.dataform.validateForm(() => {

View File

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" /> <QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<edit-company ref="editCompany" @reloadTable="reloadTable" /> <edit-company ref="editCompany" :project-list-new="projectListNew" @reloadTable="reloadTable" />
<qr-code ref="qrCode" /> <qr-code ref="qrCode" />
</div> </div>
</template> </template>
@ -10,6 +10,7 @@
import { getCompanyListPaging, deleteCompany } from '@/api/company'; import { getCompanyListPaging, deleteCompany } from '@/api/company';
import EditCompany from './add'; import EditCompany from './add';
import QrCode from '@/components/QrCode'; import QrCode from '@/components/QrCode';
import { ProjectList } from '@/scripts/ProjectConfig';
export default { export default {
name: 'CompanyManage', name: 'CompanyManage',
components: { components: {
@ -28,6 +29,8 @@ export default {
queryObject: { queryObject: {
} }
}, },
projectMap: {},
projectListNew: [],
queryList: { queryList: {
query: getCompanyListPaging, query: getCompanyListPaging,
selectCheckShow: false, selectCheckShow: false,
@ -45,6 +48,13 @@ export default {
title: '单位地址', title: '单位地址',
prop: 'address' prop: 'address'
}, },
{
title: '关联项目',
prop: 'projectCode',
type: 'tag',
columnValue: (row) => { return this.projectMap[row.projectCode]; },
tagType: (row) => { return 'success'; }
},
{ {
title: '单位管理人员', title: '单位管理人员',
prop: 'managerNames', prop: 'managerNames',
@ -81,6 +91,12 @@ export default {
currentModel: {} currentModel: {}
}; };
}, },
created() {
ProjectList.forEach(elem => {
this.projectMap[elem.value.toUpperCase()] = elem.label;
this.projectListNew.push({value: elem.value.toUpperCase(), label: elem.label});
});
},
methods: { methods: {
handlerAddCompany() { handlerAddCompany() {
this.$refs.editCompany.doShow(); this.$refs.editCompany.doShow();
@ -103,8 +119,12 @@ export default {
this.$router.go(-1); this.$router.go(-1);
}, },
handleGenerateQrCode(index, row) { handleGenerateQrCode(index, row) {
let state = 2;
if (process.env.NODE_ENV === 'production') {
state = 1;
}
const param = { const param = {
url: `companyName=${row.name}&&companyId=${row.id}`, url: `https://joylink.club/oss/joylink/company?state=${state}_${row.id}`,
title: '单位二维码' title: '单位二维码'
}; };
this.$refs.qrCode.doShow(param); this.$refs.qrCode.doShow(param);

View File

@ -46,10 +46,10 @@ export default {
}, },
rules() { rules() {
const crules = { const crules = {
name: [ // name: [
{ required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' }, // { required: true, message: this.$t('rules.pleaseInputName'), trigger: 'blur' },
{ min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' } // { min: 1, max: 25, message: this.$t('rules.strLength1To25'), trigger: 'blur' }
], // ],
roles: [ roles: [
{ required: true, message: this.$t('rules.pleaseSelectPermission'), trigger: 'change' } { required: true, message: this.$t('rules.pleaseSelectPermission'), trigger: 'change' }
] ]

View File

@ -4,7 +4,7 @@
<div slot="header" class="lessonHeader"> <div slot="header" class="lessonHeader">
{{ $t('global.lessonSystem') }} {{ $t('global.lessonSystem') }}
</div> </div>
<el-button size="mini" type="primary" style="position: absolute;right: 10px;top: 10px;" @click="draftLessonManage">草稿课程管理</el-button> <el-button v-if="isCompanyAdmin || isAdmin" size="mini" type="primary" style="position: absolute;right: 10px;top: 10px;" @click="draftLessonManage">草稿课程管理</el-button>
</el-card> </el-card>
<el-card v-loading="loading"> <el-card v-loading="loading">
<el-table :data="tableData" border style="width: 100%"> <el-table :data="tableData" border style="width: 100%">
@ -18,9 +18,9 @@
<el-table-column :label="this.$t('global.operate')"> <el-table-column :label="this.$t('global.operate')">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="primary" @click="goLesson(scope.row)">{{ $t('teach.enterTheCourse') }}</el-button> <el-button size="mini" type="primary" @click="goLesson(scope.row)">{{ $t('teach.enterTheCourse') }}</el-button>
<el-button v-if="((isLessonCreator && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="primary" @click="handleEdit(scope.row)">编辑</el-button> <el-button v-if="((isCompanyAdmin && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="primary" @click="handleEdit(scope.row)">编辑</el-button>
<el-button v-if="((isLessonCreator && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="warning" @click="handleSoldOut(scope.row)">下架</el-button> <el-button v-if="((isCompanyAdmin && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="warning" @click="handleSoldOut(scope.row)">下架</el-button>
<el-button v-if="((isLessonCreator && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="danger" @click="handleDelete(scope.row)">删除课程</el-button> <el-button v-if="((isCompanyAdmin && userId === scope.row.creatorId) || isAdmin) && !scope.row.systemFault" size="mini" type="danger" @click="handleDelete(scope.row)">删除课程</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -50,7 +50,8 @@ export default {
loading: false, loading: false,
project: '', project: '',
mapId: '', mapId: '',
prdType: '' prdType: '',
cityCode: ''
}; };
}, },
computed: { computed: {
@ -60,8 +61,8 @@ export default {
userId() { userId() {
return this.$store.state.user.id; return this.$store.state.user.id;
}, },
isLessonCreator() { isCompanyAdmin() {
return this.$store.state.user.roles.includes(lessonCreater); return this.$store.state.user.companyId && this.$store.state.user.companyAdmin;
}, },
isAdmin() { isAdmin() {
return this.$store.state.user.roles.includes(admin) || this.$store.state.user.roles.includes(superAdmin); return this.$store.state.user.roles.includes(admin) || this.$store.state.user.roles.includes(superAdmin);
@ -84,6 +85,7 @@ export default {
this.mapId = resp.data.mapId; this.mapId = resp.data.mapId;
this.prdType = resp.data.prdType; this.prdType = resp.data.prdType;
this.tableData = resp.data.lessonList; this.tableData = resp.data.lessonList;
this.cityCode = resp.data.cityCode;
} else { } else {
this.tableData = []; this.tableData = [];
} }
@ -129,7 +131,7 @@ export default {
}); });
}, },
draftLessonManage() { draftLessonManage() {
const query = {mapId: this.mapId, prdType: this.prdType, cityCode: this.$route.query.cityCode}; const query = {mapId: this.mapId, prdType: this.prdType, cityCode: this.cityCode};
this.$router.push({ path: `/trainingPlatform/draftTeach/${this.$route.params.subSystem}`, query: query }); this.$router.push({ path: `/trainingPlatform/draftTeach/${this.$route.params.subSystem}`, query: query });
}, },
handleDelete(row) { handleDelete(row) {

View File

@ -113,7 +113,7 @@ export default {
break; break;
case 'Lesson': case 'Lesson':
this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`); this.setLocalRoute(`${UrlConfig.trainingPlatform.teachHome}/${obj.id}`);
router = { path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}?cityCode=${this.filterSelect}`}; router = { path: `${UrlConfig.trainingPlatform.teachHome}/${obj.id}`};
this.toNextPage(isReplace, router); this.toNextPage(isReplace, router);
break; break;
case 'Simulation': case 'Simulation':
@ -206,7 +206,7 @@ export default {
}, },
nodeCollapse(obj, node, ele) { nodeCollapse(obj, node, ele) {
const key = obj.key; const key = obj.key;
this.expandList = this.expandList.filter(item => item !== key); this.expandList = this.expandList.filter(item => (item !== key && !item.startsWith(`${key}-`)));
localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId + this.project, this.expandList); localStore.set('trainIngPlatformExpandList' + this.filterSelect + this.userId + this.project, this.expandList);
}, },
getExpandList(filterSelect) { getExpandList(filterSelect) {