Compare commits

...

33 Commits

Author SHA1 Message Date
joylink_cuiweidong
aefa2c6fdd 成绩统计 代码调整 2022-04-14 17:18:26 +08:00
joylink_cuiweidong
fd9cca025c 学生单次考试成绩 页面添加 2022-04-13 17:26:50 +08:00
joylink_cuiweidong
2491552c8f 代码调整 2022-04-13 14:54:25 +08:00
joylink_cuiweidong
226595ea84 组件模块代码调整 2021-08-06 15:04:36 +08:00
joylink_cuiweidong
a9a08c74d3 代码调整 2021-08-06 09:36:53 +08:00
joylink_cuiweidong
2cb2247d7e 代码调整 2021-08-02 17:33:42 +08:00
fan
1d72d29dff 调整 2021-08-02 11:00:42 +08:00
fan
ce6512ef83 修改列车详细信息显示位置问题 2021-07-27 14:38:23 +08:00
fan
4ac7b46532 调整版本 2021-07-26 17:24:51 +08:00
fan
c9ce398e4c 接口代码 2021-07-20 11:19:11 +08:00
fan
90a539c4b7 接口调整 2021-07-20 09:04:06 +08:00
fan
7673c039ef 调整 2021-07-19 10:46:44 +08:00
fan
af076119ce Merge branch 'test_eg2d' of https://git.code.tencent.com/lian-cbtc/jl-client into test_eg2d 2021-07-16 14:41:00 +08:00
fan
e88db236d5 新绘图调整 2021-07-16 10:45:33 +08:00
yuan
9d0baa69d7 去掉删除按钮 2021-07-15 15:06:52 +08:00
yuan
8da25a588d Merge branch 'test' of git.code.tencent.com:lian-cbtc/jl-client into yly_eg2d 2021-07-15 11:21:24 +08:00
yuan
9c3deb02e6 发布模型列表 2021-07-15 11:20:20 +08:00
fan
066896bd4f 暂提 2021-07-14 11:24:00 +08:00
yuan
c59b0930a3 Merge branch 'test_eg2d' of git.code.tencent.com:lian-cbtc/jl-client into yly_eg2d 2021-07-14 09:22:04 +08:00
yuan
4bb31b119a Merge branch 'test' of git.code.tencent.com:lian-cbtc/jl-client into yly_eg2d 2021-07-14 09:20:57 +08:00
fan
53a71d0bab 暂提 2021-07-12 16:42:54 +08:00
fan
8db9414cfa 暂提 2021-07-12 16:40:41 +08:00
yuan
7e50c780ce Merge branch 'test' of git.code.tencent.com:lian-cbtc/jl-client into yly_eg2d 2021-07-12 09:20:53 +08:00
yuan
eb7b59078a Merge branch 'test' of git.code.tencent.com:lian-cbtc/jl-client into yly_eg2d 2021-07-09 10:32:21 +08:00
yuan
0bf309cc3d Merge branch 'test' of git.code.tencent.com:lian-cbtc/jl-client into yly_eg2d 2021-07-08 15:59:38 +08:00
yuan
9e83c0b8e9 commit 2021-07-08 15:59:33 +08:00
yuan
381a1af149 conflict fix 2021-07-08 14:17:21 +08:00
yuan
c0792b7f2f commit 2021-07-07 17:29:06 +08:00
yuan
4f9c70f3cb 发布&删除 2021-07-07 10:25:49 +08:00
yuan
ab0d193095 模型绘制页面 2021-07-07 09:14:31 +08:00
yuan
95d0cd03e0 模型编辑 2021-07-06 16:17:52 +08:00
yuan
d84a52912d Merge branch 'test' of git.code.tencent.com:lian-cbtc/jl-client into yly_eg2d 2021-07-06 09:53:50 +08:00
yuan
2bb04ad85f 增加模型草稿列表页 2021-07-06 09:53:39 +08:00
23 changed files with 1596 additions and 11 deletions

View File

@ -17,7 +17,8 @@
"svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml" "svgo": "svgo -f src/icons/svg --config=src/icons/svgo.yml"
}, },
"dependencies": { "dependencies": {
"axios": "0.18.0", "axios": "^0.21.1",
"bjjl-engine-2d": "^1.0.22",
"echarts": "^4.7.0", "echarts": "^4.7.0",
"element-ui": "^2.12.0", "element-ui": "^2.12.0",
"file-saver": "^1.3.3", "file-saver": "^1.3.3",
@ -35,7 +36,7 @@
"sessionstorage": "^0.1.0", "sessionstorage": "^0.1.0",
"stompjs": "^2.3.3", "stompjs": "^2.3.3",
"storejs": "^1.0.25", "storejs": "^1.0.25",
"three": "^0.107.0", "three": "^0.130.1",
"video.js": "^7.8.4", "video.js": "^7.8.4",
"vue": "^2.6.10", "vue": "^2.6.10",
"vue-i18n": "^8.12.0", "vue-i18n": "^8.12.0",
@ -70,7 +71,7 @@
"eslint-plugin-vue": "5.2.2", "eslint-plugin-vue": "5.2.2",
"file-loader": "^3.0.1", "file-loader": "^3.0.1",
"html-webpack-plugin": "3.2.0", "html-webpack-plugin": "3.2.0",
"node-sass": "^4.9.0", "node-sass": "^4.14.1",
"runjs": "^4.3.2", "runjs": "^4.3.2",
"sass-loader": "^7.1.0", "sass-loader": "^7.1.0",
"script-ext-html-webpack-plugin": "2.1.3", "script-ext-html-webpack-plugin": "2.1.3",

50
src/api/circuitryDraft.js Normal file
View File

@ -0,0 +1,50 @@
import request from '@/utils/request';
/** 查询用户所有电路数据 */
export function queryCircuitryDraftList() {
return request({
url: `/api/circuitryDraft/list/users`,
method: 'get'
});
}
/** 分页查询用户电路数据 */
export function queryCircuitryDraftListPaging(params) {
return request({
url: `/api/circuitryDraft/page/users`,
method: 'get',
params
});
}
/** 根据id获取数据 */
export function getCircuitryDraftDataById(id) {
return request({
url: `/api/circuitryDraft/${id}`,
method: 'get'
});
}
/** 创建草稿 */
export function createCircuitryDraft(data) {
return request({
url: `/api/circuitryDraft`,
method: 'post',
data
});
}
/** 更新草稿数据 */
export function updateCircuitryDraft(id, data) {
return request({
url: `/api/circuitryDraft/${id}/data`,
method: 'put',
data
});
}
/** 删除草稿 */
export function deleteCircuitryDarft(id) {
return request({
url: `/api/circuitryDraft/${id}`,
method: 'delete'
});
}

109
src/api/management/model.js Normal file
View File

@ -0,0 +1,109 @@
import request from '@/utils/request';
/** 新建用户草稿2d模型*/
export function createModelDraft(data) {
return request({
url: `/draft/model2d/`,
method: 'post',
data
});
}
/** 分页查询用户2d模型草稿*/
export function getModelDraftList(params) {
return request({
url: `/draft/model2d/paging`,
method: 'get',
params
});
}
/** 更新2d模型基本信息 */
export function updateModelDraftInfo(data) {
return request({
url: `/draft/model2d/${data.id}/basic`,
method: 'put',
data
});
}
/** 更新2d模型数据 */
export function updateModelDraftData(data) {
return request({
url: `/draft/model2d/${data.id}/data`,
method: 'put',
data
});
}
/** 根据id查询2d模型草稿数据 */
export function getModelDraftData(id) {
return request({
url: `/draft/model2d/${id}`,
method: 'get'
});
}
/** 发布模型 */
export function publishModelDraft(id) {
return request({
url: `/draft/model2d/${id}/publish`,
method: 'post'
});
}
/** 删除草稿模型 */
export function deleteModelDraft(id) {
return request({
url: `/draft/model2d/${id}`,
method: 'delete'
});
}
/** 分页查询模型数据 */
export function getModelList() {
return request({
url: `/api/model2d/paging`,
method: 'get'
});
}
/** 查询模型数据 */
export function getModelListUnpage() {
return request({
url: '/api/model2d/list',
method: 'get'
});
}
/** 查询某个模型所有历史版本数据 */
export function getModelVersions(code) {
return request({
url: `/api/model2d/${code}/versions`,
method: 'get'
});
}
/** 分页查询模型历史版本 */
export function getModelVersionsPaging(code) {
return request({
url: `/api/model2d/${code}/versions/paging`,
method: 'get'
});
}
/** 更新2d模型基础信息 */
export function updateModelBasicInfo(id) {
return request({
url: `/api/model2d/{id}/basic`,
method: 'put'
});
}
/** 回滚版本 */
export function setModelVersion(code, version) {
return request({
url: `/api/model2d/${code}/version/${version}`,
method: 'put'
});
}

View File

@ -66,3 +66,11 @@ export function getClassGradeList(examId, params) {
params params
}); });
} }
/** 查询组织学生单次考试成绩曲线 */
export function getClassGradeStatistic(orgId, examId) {
return request({
url: `/api/userExam/curve/${orgId}/${examId}`,
method: 'get'
});
}

View File

@ -82,6 +82,7 @@ export default {
configLine: 'Line management', configLine: 'Line management',
deviceManage: 'Device management', deviceManage: 'Device management',
iscsDraw: 'Iscs Draw', iscsDraw: 'Iscs Draw',
userModelDesign: 'Model Draw',
iscsSystem: 'Iscs System', iscsSystem: 'Iscs System',
studentManage: 'Student manage', studentManage: 'Student manage',
examDetail: 'Exam detail', examDetail: 'Exam detail',
@ -99,5 +100,7 @@ export default {
publishISCSManage:'publish ISCS Manage', publishISCSManage:'publish ISCS Manage',
voiceTraining: 'Voice Training', voiceTraining: 'Voice Training',
mapGroup: 'Map Group', mapGroup: 'Map Group',
drawingMange:'Drawing Mange' userModel: 'User Model',
drawingMange:'Drawing Mange',
newDraw: 'New Draw'
}; };

View File

@ -82,6 +82,7 @@ export default {
configLine: '线路管理', configLine: '线路管理',
deviceManage: '设备管理', deviceManage: '设备管理',
iscsDraw: 'Iscs绘制', iscsDraw: 'Iscs绘制',
userModelDesign: '模型绘制',
iscsSystem: 'Iscs系统', iscsSystem: 'Iscs系统',
studentManage: '学生管理', studentManage: '学生管理',
competitionManage: '竞赛管理', competitionManage: '竞赛管理',
@ -103,5 +104,7 @@ export default {
publishISCSManage:'发布ISCS管理', publishISCSManage:'发布ISCS管理',
voiceTraining: '语音训练', voiceTraining: '语音训练',
mapGroup: '地图分组', mapGroup: '地图分组',
drawingMange:'图纸管理' userModel: '模型管理',
drawingMange:'图纸管理',
newDraw: '新版绘制'
}; };

View File

@ -5,6 +5,7 @@ import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css'; import 'element-ui/lib/theme-chalk/index.css';
import '@/styles/index.scss'; // global css import '@/styles/index.scss'; // global css
import 'quill/dist/quill.snow.css'; import 'quill/dist/quill.snow.css';
import Engine2D from 'bjjl-engine-2d';
import LangStorage from '@/utils/lang'; import LangStorage from '@/utils/lang';
import App from './App'; import App from './App';
@ -37,6 +38,7 @@ export const i18n = new VueI18n({
messages messages
}); });
Vue.use(ElementUI, {i18n: (key, value) => i18n.t(key, value)}); Vue.use(ElementUI, {i18n: (key, value) => i18n.t(key, value)});
Vue.use(Engine2D);
new Vue({ new Vue({
el: '#app', el: '#app',

View File

@ -125,6 +125,8 @@ const PublishExamRule = () => import('@/views/publish/examRule/index');
const PublishExamRuleDraft = () => import('@/views/publish/examRule/draft/index'); const PublishExamRuleDraft = () => import('@/views/publish/examRule/draft/index');
const PublishIBP = () => import('@/views/publish/publishIBP/index'); const PublishIBP = () => import('@/views/publish/publishIBP/index');
const PublishISCS = () => import('@/views/publish/publishISCS/index'); const PublishISCS = () => import('@/views/publish/publishISCS/index');
const PublishModel = () => import('@/views/publish/userModel/index');
const PublishModelHistory = () => import('@/views/publish/userModel/history');
const TrainingPlatform = () => import('@/views/trainingPlatform/index'); const TrainingPlatform = () => import('@/views/trainingPlatform/index');
@ -165,6 +167,7 @@ const SortLesson = () => import('@/views/organization/draftLessonManage/sortLess
const StudentManage = () => import('@/views/organization/classManage/studentManage/index'); const StudentManage = () => import('@/views/organization/classManage/studentManage/index');
const DurationView = () => import('@/views/organization/classManage/durationView'); const DurationView = () => import('@/views/organization/classManage/durationView');
const GradeList = () => import('@/views/organization/examManage/gradeList'); const GradeList = () => import('@/views/organization/examManage/gradeList');
const GradeStatistics = () => import('@/views/organization/examManage/gradeStatistics');
const CreateRule = () => import('@/views/organization/ruleManage/createRule'); const CreateRule = () => import('@/views/organization/ruleManage/createRule');
const TotalGrade = () => import('@/views/organization/ruleManage/totalGrade'); const TotalGrade = () => import('@/views/organization/ruleManage/totalGrade');
const InfoLessonDetail = () => import('@/views/organization/lessonManage/lessonDetail'); const InfoLessonDetail = () => import('@/views/organization/lessonManage/lessonDetail');
@ -186,6 +189,11 @@ const UploadPdfList = () => import('@/views/uploadPdf/list');
const ThirdLogin = () => import('@/views/thirdLogin'); const ThirdLogin = () => import('@/views/thirdLogin');
const UserModelDesign = () => import('@/views/userModelDesign/draftList');
const UserModelEdit = () => import('@/views/userModelDesign/edit');
const NewDrawList = () => import('@/views/newDraw/list');
const NewDrawEdit = () => import('@/views/newDraw/edit');
// import { GenerateRouteProjectList } from '@/scripts/ProjectConfig'; // import { GenerateRouteProjectList } from '@/scripts/ProjectConfig';
// import { getSessionStorage } from '@/utils/auth'; // import { getSessionStorage } from '@/utils/auth';
@ -611,6 +619,11 @@ export const publicAsyncRoute = [
component: GradeList, component: GradeList,
hidden: true hidden: true
}, },
{
path: 'gradeStatistics',
component: GradeStatistics,
hidden: true
},
{ {
path: 'createRule', path: 'createRule',
component: CreateRule, component: CreateRule,
@ -911,6 +924,19 @@ export const asyncRouter = [
meta: { meta: {
i18n: 'router.mapGroup' i18n: 'router.mapGroup'
} }
},
{ // 发布模型管理
path: 'userModel',
component: PublishModel,
meta: {
i18n: 'router.userModel'
}
},
{ // 模型历史版本
path: 'userModel/history',
name: 'modelHistory',
component: PublishModelHistory,
hidden: true
} }
] ]
}, },
@ -1281,6 +1307,34 @@ export const asyncRouter = [
hidden: true hidden: true
} }
] ]
},
{
path: 'usermodel',
component: UserModelDesign,
meta: {
i18n: 'router.userModelDesign',
roles: [admin]
}
},
{
path: 'usermodel/:id/edit',
name: 'userModelEdit',
component: UserModelEdit,
hidden: true
},
{
path: 'newdraw',
component: NewDrawList,
meta: {
i18n: 'router.newDraw',
roles: [admin]
}
},
{
path: 'newdraw/:id/edit',
name: 'newDrawEdit',
component: NewDrawEdit,
hidden: true
} }
] ]
}, },

View File

@ -17,6 +17,7 @@ class CommandHandle {
this.definitionMap = { this.definitionMap = {
Center: {}, Center: {},
Local: {}, Local: {},
Depot_IL:{},
Common: { Common: {
Set_Fault:{operate: 'Set_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]}, Set_Fault:{operate: 'Set_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]},
Cancel_Fault: {operate:'Cancel_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]}, Cancel_Fault: {operate:'Cancel_Fault', paramList:[{name: 'code'}, {name: 'faultType'}]},

View File

@ -11,7 +11,7 @@
<el-input v-model="inputName" size="small" style="width: 200px;margin-right: 50px;margin-left: 10px;" placeholder="请输入筛选的名称" @change="changeInput" /> <el-input v-model="inputName" size="small" style="width: 200px;margin-right: 50px;margin-left: 10px;" placeholder="请输入筛选的名称" @change="changeInput" />
<el-button size="small" type="primary" @click="goToFilter">查找</el-button> <el-button size="small" type="primary" @click="goToFilter">查找</el-button>
</el-row> </el-row>
<el-table ref="filterTable" :data="filterTableData" border style="width: 100%" height="calc(100vh - 150px)"> <el-table ref="filterTable" :data="filterTableData" border style="width: 100%" height="calc(100vh - 190px)">
<el-table-column prop="name" label="试卷名称" /> <el-table-column prop="name" label="试卷名称" />
<el-table-column v-if="isGzbShow" prop="classNames" label="所属班级"> <el-table-column v-if="isGzbShow" prop="classNames" label="所属班级">
<template slot-scope="scope"> <template slot-scope="scope">

View File

@ -0,0 +1,57 @@
<template>
<el-dialog v-dialogDrag :visible.sync="visible" :title="title" width="300px" center :destroy-on-close="true">
<el-form ref="form" :model="formData" :rules="formRules" label-width="80px">
<el-form-item label="草稿名称" prop="name">
<el-input v-model="formData.name" size="mini" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="confirmHandler"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { createCircuitryDraft } from '@/api/circuitryDraft';
export default {
name: 'CreateModelDraftDialog',
data() {
return {
visible: false,
formData: { name: ''},
formRules: {
name: [{ required: true, message: '请输入草稿名称', trigger: 'blur' }]
}
};
},
computed: {
title() {
return '新建草稿';
}
},
methods: {
show() {
this.formData = { name: '' };
this.visible = true;
},
close() {
this.visible = false;
},
confirmHandler() {
this.$refs.form.validate(valid => {
if (valid) {
createCircuitryDraft(this.formData).then(resp => {
this.close();
this.$emit('close');
}).catch(() => {
this.$message.error('创建草稿失败!');
});
}
});
}
}
};
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,167 @@
<template>
<div style="background: #fff;">
<div style="text-align: right;">
<el-button type="text" @click="save">保存</el-button>
<el-button type="text" style="margin-right: 10px" @click="back">返回</el-button>
</div>
<div class="styleGroup">
<el-card type="border-card" class="elementCard">
<el-tabs v-model="enabledTab" class="eachElementPane" type="card">
<el-tab-pane id="drawSettingPane" label="绘图配置" name="drawSetting">
<el-form ref="form" :model="form" label-width="80px">
<el-form-item label="模型:">
<el-select v-model="form.code" size="mini" placeholder="请选择" @change="modelChange">
<el-option
v-for="item in model"
:key="item.code"
:label="item.name + '(' + item.code + ')'"
:value="item.code"
/>
</el-select>
</el-form-item>
<el-form-item label="位置:">
<el-input-number v-model="form.position[0]" size="mini" />
<el-input-number v-model="form.position[1]" size="mini" />
</el-form-item>
<el-form-item label="旋转:">
<el-input-number v-model="form.rotation" size="mini" :min="-360" :max="360" />
</el-form-item>
<el-form-item label="缩放:">
<el-input-number v-model="form.scale[0]" :precision="2" :step="0.1" size="mini" :min="0.1" />
<el-input-number v-model="form.scale[1]" :precision="2" :step="0.1" size="mini" :min="0.1" />
</el-form-item>
</el-form>
<div style="text-align: center;">
<el-button :disabled="!form.code" type="warning" size="mini" @click="updateCompose">修改</el-button>
<el-button :disabled="!form.code" type="danger" size="mini" @click="deleteCompose">删除</el-button>
</div>
</el-tab-pane>
<!-- styleList -->
<!-- shapeList -->
<!-- model 修改 -->
<!-- <el-tab-pane v-if="allowModifyList.length>0" id="modelModifyPane" label="模型修改" name="modelModify">
<el-tabs v-model="modifyElementTab" class="eachElementPane" @tab-click="handleTabClick">
<el-tab-pane v-for="(allowModify,index) in allowModifyList" :key="index" :label="allowModify.name" :name="allowModify.code">
<data-form ref="dataform" :form="element" :form-model="modifyElementForm" />
</el-tab-pane>
</el-tabs>
</el-tab-pane> -->
</el-tabs>
</el-card>
</div>
</div>
</template>
<script>
export default {
name: 'DrawForm',
props: {
model: {
type: Array,
default() {
return [];
}
}
},
data() {
return {
enabledTab:'drawSetting',
// modifyElementTab:'',
form: {
code: '',
type: '',
name: '',
position: [0, 0],
rotation: 0,
scale: [1, 1]
}
// allowModifyList:[],
// modifyElementForm:{
// code:'',
// shape:{},
// style:{}
// }
};
},
methods: {
selectChange({code, type, name, position, rotation, scale, shapeList}) {
this.form = {code, type, name, position, rotation, scale};
// this.allowModifyList = [];
// shapeList.forEach(shape=>{
// if (shape.editAttrList && shape.editAttrList.length > 0) {
// const formGroup = [];
// const list = [{name:'', type:'shape'}, {name:'', type:'style'}];
// list.forEach(eachType=>{
// // const styleList = elementConst[eachType.type]['formList'][eachType.type];
// formGroup.push({name:eachType.name, type: eachType.type});
// });
// // styleList:
// // const styleList = [];
// // const shapeList = [];
// // shape.editAttrList.forEach(each=>{
// // if (each.attrType == 'style') { styleList.push(each); } else { shapeList.push(each); }
// // });
// // styleList:styleList, shapeList:shapeList,
// // this.allowModifyList.push({code:shape.code, editAttrList:shape.editAttrList, formGroup:formGroup, name:shape.name});
// // name: "Polyline_0_0.78816"
// }
// });
// if (this.allowModifyList.length > 0) {
// const currentModify = this.allowModifyList[0];
// this.modifyElementTab = currentModify.code;
// this.modifyElementForm.code = currentModify.code;
// currentModify.editAttrList.forEach(editAttr=>{
// this.modifyElementForm[editAttr.attrType][editAttr.attrName] = '';
// });
// }
},
modelChange(code) {
const compose = this.model.find(item => item.code === code);
this.selectChange(compose);
},
updateCompose() {
this.$emit('updateCompose', this.form);
},
deleteCompose() {
this.$emit('deleteCompose', this.form);
this.form = {
code: '',
type: '',
name: '',
position: [0, 0],
rotation: 0,
scale: [1, 1]
};
},
save() {
this.$emit('save');
},
back() {
this.$router.go(-1);
},
handleTabClick() {
}
}
};
</script>
<style scoped>
.styleGroup{height:100%}
.styleGroup .elementCard {
height:100%;
width:400px;
}
#drawSettingPane,#modelModifyPane{height:100%;display: flex;flex-direction:column;}
/deep/ .el-form-item__content{
text-align: left;
}
</style>
<style>
#modelModifyPane .eachElementPane .el-tabs__nav .el-tabs__item.is-top.is-active{
padding: 0px 10px;
border-bottom: 2px solid !important;
}
</style>

140
src/views/newDraw/edit.vue Normal file
View File

@ -0,0 +1,140 @@
<template>
<div id="app" style="width: 100%;height: 100%;">
<!--<jl-model-builder type="测试类型" composeName="测试名称" :model="model" @save="save"></jl-model-builder>-->
<jl-picture-builder ref="jlPictureBuilder" :model="model" :compose-map="composeMap" @selectChange="selectChange" />
<div style="height: 300px;background: #fff;z-index: 999;position: absolute;top: 70px;left: 0;overflow:auto">
<div v-for="item in modelList" :key="item.code">
<el-button size="mini" style="margin: 5px" @click="addModel(item)">{{ item.name }}</el-button>
</div>
</div>
<draw-form
ref="drawForm"
:model="model"
style="position: absolute;right: 0;top: 60px;height: calc(100% - 60px);"
@updateCompose="updateCompose"
@deleteCompose="deleteCompose"
@save="save"
/>
</div>
</template>
<script>
import DrawForm from './drawForm';
import { getModelListUnpage } from '@/api/management/model';
import { getCircuitryDraftDataById, updateCircuitryDraft } from '@/api/circuitryDraft';
export default {
name: 'Edit',
components: {
DrawForm
},
data() {
return {
composeMap: {},
model: [],
modelList: []
};
},
async mounted() {
const res = await getCircuitryDraftDataById(this.$route.params.id);
const resp = await getModelListUnpage();
this.modelList = resp.data;
this.modelList.forEach(item => {
this.composeMap[item.code] = item;
});
if (res.data.drawData) {
const data = JSON.parse(res.data.drawData);
this.model = data.model || [];
this.$refs.jlPictureBuilder.setMap(this.model);
}
},
methods: {
test() {
this.$refs.jlPictureBuilder.update([]);
},
save(model) {
const data = {
id: this.$route.params.id,
// compose: Object.keys(this.composeMap)
drawData: JSON.stringify({ model:this.model })
};
updateCircuitryDraft(this.$route.params.id, data).then(resp => {
this.$message.success('保存草稿数据成功!');
}).catch(() => {
this.$message.error('保存草稿数据错误!');
});
},
addModel(model) {
// if (!this.composeMap[model.code]) {
// this.composeMap[model.code] = JSON.parse(model.jsonData);
// }
const addModel = {
code: this.getUID(model.code),
position: [100, 100],
type: model.code,
name: model.name,
rotation: 0,
scale: [1, 1],
modifyAttritubes:{}
// shapeList: this.composeMap[model.code].shapeList
};
this.model.push(addModel);
this.$refs.jlPictureBuilder.update([{model: addModel, action:{order:'&Add', shapeType: 'Compose'}}]);
},
// addModel(model) {
// this.addModelData = model;
// this.$refs.jlPictureBuilder.addingModel();
// },
// selectPoint(point) {
// if (!this.composeMap[this.addModelData.code]) {
// this.composeMap[this.addModelData.code] = JSON.parse(this.addModelData.jsonData);
// }
// const addModel = {
// code: this.getUID(this.addModelData.code),
// position: [point.x, point.y],
// type: this.addModelData.code,
// name: this.addModelData.name,
// rotation: 0,
// scale: [1, 1],
// shapeList: this.composeMap[model.code].shapeList
// };
// this.model.push(addModel);
// this.$refs.jlPictureBuilder.update([{model: addModel, action:{order:'&Add', shapeType: 'Compose'}}]);
// },
updateCompose(model) {
const updateModel = {
code: model.code,
position: model.position,
type: model.type,
name: model.name,
rotation: model.rotation,
scale: model.scale
// shapeList: this.composeMap[model.code].shapeList
};
const index = this.model.findIndex(item => item.code === model.code);
this.model.splice(index, 1, updateModel);
this.$refs.jlPictureBuilder.update([{model: updateModel, action:{order:'&UPT', shapeType: 'Compose'}}]);
},
deleteCompose(model) {
const index = this.model.findIndex(item => item.code === model.code);
this.model.splice(index, 1);
this.$refs.jlPictureBuilder.update([{model: model, action:{order:'&DEL', shapeType: 'Compose'}}]);
},
getUID (type, base = 0) {
return [(type || ''), base++, Math.random().toFixed(5)].join('_');
},
selectChange(compose) {
this.$refs.drawForm.selectChange(compose);
}
}
};
</script>
<style>
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
}
</style>

139
src/views/newDraw/list.vue Normal file
View File

@ -0,0 +1,139 @@
<template>
<div class="container">
<QueryListPage :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<create-dialog ref="createDialog" @close="closeCreate" />
</div>
</template>
<script>
import { queryCircuitryDraftListPaging, deleteCircuitryDarft } from '@/api/circuitryDraft';
import CreateDialog from './create';
export default {
name: 'UserModelDesign',
components: {
CreateDialog
},
data() {
return {
dialogs: {
createShow: false,
createMode: ''
},
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
code: {
type: 'text',
label: '地图编号'
},
name: {
type: 'text',
label: '地图名称'
}
}
},
queryList: {
query: this.queryModelDraftList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: '地图编号',
prop: 'id'
},
{
title: '地图名称',
prop: 'name'
},
{
title: '创建时间',
prop: 'createTime'
},
{
title: '修改时间',
prop: 'updateTime'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '350',
buttons: [
// {
// name: this.$t('global.edit'),
// handleClick: this.handleEdit
// },
{
name: '绘图',
handleClick: this.handleDraw
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [{ text: this.$t('global.add'), handler: this.handleCreate }]
},
pubdModel: ''
};
},
methods: {
queryModelDraftList(params) {
return queryCircuitryDraftListPaging(params);
},
handleCreate() {
this.$refs.createDialog.show();
},
closeCreate(e) {
this.reloadTable();
},
handleEdit(index, data) {
this.$refs.createDialog.show('edit', data);
},
handleDelete(idx, data) {
this.$confirm('确认删除?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
center: true
})
.then(
() => {
deleteCircuitryDarft(data.id).then(() => {
this.reloadTable();
});
},
() => {}
)
.catch(e => {
this.$message(e);
});
},
handleDraw(idx, data) {
this.$router.push({ path: `newdraw/${data.id}/edit` });
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style lang="scss" scoped>
.container {
padding: 20px;
}
</style>

View File

@ -0,0 +1,280 @@
<template>
<div>
<div class="title_content">{{ $route.query.name + ' 成绩统计' }}</div>
<el-button type="text" style="position: fixed;right: 20px;top: 70px;" @click="back">返回</el-button>
<div class="gradeStatisticPane">
<el-form
ref="queryForm"
size="small"
style="padding-top: 18px;"
>
<el-form-item prop="orgId" label="班级:" :required="false">
<el-select
ref="orgId"
v-model="orgId"
:clearable="false"
:placeholder="$t('global.choose')"
filterable
@change="onChange"
>
<el-option
v-for="option in classList"
:key="option['value']"
:label="option['label']"
:value="option['value']"
/>
</el-select>
</el-form-item>
</el-form>
</div>
<div class="statisticChart">
<div id="mychart1" class="statisticChartLeft" />
<div id="mychart2" class="statisticChartRight" />
</div>
</div>
</template>
<script>
import * as echarts from 'echarts';
import { getClassGradeStatistic } from '@/api/management/userexam';
import { getClassListUnPage } from '@/api/company';
import { getExamLessonDetail } from '@/api/management/exam';
import localStore from 'storejs';
export default {
name: 'GradeStatistics',
data() {
return {
orgId:'',
myChart1:null,
userNameList:[],
gradeList:[],
classList:[],
durationList:[],
fullPoint:0,
passingPoint:0,
duration:0,
title:{
show:true,
text:'成绩分布',
textAlign:'center',
left:'50%',
top:'5px',
textStyle:{
color:'#f00'
}
},
title1:{
show:true,
text:' 答题时长区间人数 ',
//
textAlign:'center',
left:'50%',
top:'5px',
textStyle:{
color:'#f00'
}
},
yAxis1:{
position:'left',
name:'人数',
nameLocation:'end',
minInterval:1,
nameTextStyle:{
align:'left',
fontSize:14
},
axisLine:{show:true}
},
yAxis:{
position:'left',
name:'分数',
nameLocation:'end',
min:0,
nameTextStyle:{
align:'left',
fontSize:14
},
axisLine:{show:true}
},
durationInterval:[]
};
},
async created() {
const resp = await getClassListUnPage();
resp.data && resp.data.forEach(item => {
this.classList.push({ value: item.id, label: item.name });
});
localStore.set(this.$route.path, { orgId: this.classList[0].value + '' });
this.orgId = this.classList[0].value;
const res = await getExamLessonDetail(this.$route.query.examId);
if (res.data) {
this.yAxis.max = res.data.fullPoint;
this.passingPoint = res.data.passingPoint;
this.duration = res.data.duration;
}
var chartDom1 = document.getElementById('mychart1');
this.myChart1 = echarts.init(chartDom1);
var chartDom2 = document.getElementById('mychart2');
this.myChart2 = echarts.init(chartDom2);
const eachInterval = this.duration / 6;
this.durationInterval = ['0-' + eachInterval,
eachInterval + '-' + eachInterval * 2,
eachInterval * 2 + '-' + eachInterval * 3,
eachInterval * 3 + '-' + eachInterval * 4,
eachInterval * 4 + '-' + eachInterval * 5,
eachInterval * 5 + '-' + eachInterval * 6
];
this.getClassGradeStatis();
},
methods: {
back() {
this.$router.go(-1);
},
getClassGradeStatis() {
if (this.orgId) {
this.userNameList = [];
this.gradeList = [];
// this.myChart1.restore();
getClassGradeStatistic(this.orgId, this.$route.query.examId).then(resp=>{
const results = resp.data;
if (results) {
const gradeList = results.results;
const countList = [0, 0, 0, 0, 0];
if (gradeList.length > 0) {
gradeList.forEach(each=>{
this.userNameList.push(each.username || '');
this.gradeList.push(each.score);
this.durationList.push(each.duration || 0);
countList[Math.floor((each.duration || 0) / (this.duration / 6))]++;
});
const option = {
title:this.title,
xAxis: {
type: 'category',
axisLabel:{
show :false
},
data:this.userNameList
},
tooltip:{
show:true,
trigger:'item'
},
yAxis: this.yAxis,
series: [
{
symbolSize: 10,
data:this.gradeList,
type: 'scatter'
}
]
};
const option1 = {
title1:this.title1,
xAxis: {
name:'时长区间/s',
type: 'category',
data: this.durationInterval
},
yAxis: this.yAxis1,
tooltip:{
show:true,
trigger:'axis'
},
series: [
{
data:countList,
type: 'bar'
}
]
};
option && this.myChart1 && this.myChart1.setOption(option);
option1 && this.myChart2 && this.myChart2.setOption(option1);
// debugger;
// id": "92",
// "userId": "92",
// "account": "d8h4pz",
// "username": ".",
// "examId": "92",
// "examName": ".",
// "score": 29.38,
// "usedTime": 727,
// "result": "dbw206",
// "duration": 429,
}
}
}).catch((error) => {
const option = {
title:this.title,
xAxis: {
type: 'category',
data:[]
},
yAxis:this.yAxis,
series: [
{
symbolSize: 20,
data:[],
type: 'scatter'
}
]
};
const option1 = {
title:this.title1,
xAxis: {
name:'时长区间/s',
type: 'category',
data: this.durationInterval
},
yAxis:this.yAxis1,
series: [
{
data:[],
type: 'bar'
}
]
};
option && this.myChart1 && this.myChart1.setOption(option);
option1 && this.myChart2 && this.myChart2.setOption(option1);
this.$message.error(error.message);
});
}
},
onChange(data) {
this.getClassGradeStatis();
}
}
};
</script>
<style scoped>
.title_content {
width: 100%;
margin: 20px 0 30px;
text-align: center;
font-size: 24px;
font-weight: bold;
}
.gradeStatisticPane{
margin: 0 auto;
width: 300px;
}
.statisticChart{
/* margin-left: 50%; */
/* transform: translateX(-50%); */
width:90%;
display: flex;
margin-left:5%;
}
.statisticChartLeft{
width: 50%;
display: inline-block;
height: 700px;
/* border:1px #ccc solid */
}
.statisticChartRight{
width: 50%;
display: inline-block;
height: 700px;
/* border:1px #ccc solid */
}
</style>

View File

@ -122,13 +122,18 @@ export default {
{ {
type: 'button', type: 'button',
title: this.$t('global.operate'), title: this.$t('global.operate'),
width: '250', width: '350',
buttons: [ buttons: [
{ {
name: '成绩查询', name: '成绩查询',
handleClick: this.handleQueryGrade, handleClick: this.handleQueryGrade,
type: 'primary' type: 'primary'
}, },
{
name: '成绩统计',
handleClick: this.handleGradeStatistics,
type: 'success'
},
{ {
name: '编辑', name: '编辑',
handleClick: this.handleEditExam, handleClick: this.handleEditExam,
@ -180,6 +185,9 @@ export default {
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) {
this.$router.push({ path: '/info/gradeStatistics', query: { examId: row.id, name: row.name } });
},
handleEditExam(index, row) { handleEditExam(index, row) {
this.$router.push({ path: `/info/examRule/draft/edit/${row.id}/0`, query: { source: 'org' } }); this.$router.push({ path: `/info/examRule/draft/edit/${row.id}/0`, query: { source: 'org' } });
}, },

View File

@ -26,7 +26,6 @@ export default {
reset: false, reset: false,
show: false, show: false,
queryObject: {} queryObject: {}
}, },
queryList: { queryList: {
query: this.queryFunction, query: this.queryFunction,

View File

@ -0,0 +1,75 @@
<template>
<el-dialog v-dialogDrag :visible.sync="visible" :title="title" center :destroy-on-close="true">
<el-form :model="formData" :rules="formRules" ref="form">
<!-- <el-form-item label="模型编号" prop="code">
<el-input v-model="formData.code"></el-input>
</el-form-item> -->
<el-form-item label="模型名称" prop="name">
<el-input v-model="formData.name"></el-input>
</el-form-item>
<el-form-item label="版本" prop="version">
<el-select v-model="formData.version">
<el-option
v-for="item in versionOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="confirmHandler"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { getModelVersions } from "@/api/management/model";
export default {
name: "EditModelInfo",
data() {
return {
visible: false,
title: "编辑模型",
formData: { code: "", name: "", type: "", version: "" },
versionOptions: [
{
label: "",
value: ""
}
],
formRules: {
// code: [{ required: true, message: "", trigger: "blur" }],
name: [{ required: true, message: "请输入模型名称", trigger: "blur" }]
}
};
},
mounted() {},
methods: {
initVersionInfo(code) {
getModelVersions(code).then(res => {
this.versionOptions = res.data.map(e => {
return {
label: e.version,
value: e.version
};
});
});
},
show(data) {
this.formData = data;
this.initVersionInfo(data.code);
this.visible = true;
},
close() {
this.visible = false;
this.$emit("close");
},
confirmHandler() {}
}
};
</script>
<style></style>

View File

@ -0,0 +1,95 @@
<template>
<div class="container">
<QueryListPage :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<div class="btn-area">
<el-button type="primary" @click="goBack">返回</el-button>
</div>
</div>
</template>
<script>
import { getModelVersionsPaging, setModelVersion } from "@/api/management/model";
export default {
name: "ModelHistory",
data() {
return {
pagerConfig: {
pageSize: "pageSize",
pageIndex: "pageNum"
},
queryForm: {
labelWidth: "80px",
reset: false,
show: false,
queryObject: {}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: "模型编号",
prop: "code"
// width:'300px'
},
{
title: "模型名称",
prop: "name"
// width:'200px'
},
{
title: "版本",
prop: "version"
// width:'200px'
},
{
title: "创建人ID",
prop: "createUserId"
},
{
title: "修改时间",
prop: "updateTime"
},
{
type: "button",
title: this.$t("global.operate"),
width: "100",
buttons: [
{
name: "应用",
handleClick: this.handleApply
}
]
}
]
}
};
},
methods: {
queryFunction() {
return getModelVersionsPaging(this.$route.query.code);
},
goBack() {
this.$router.go(-1)
},
handleApply(row, data) {
const {code, version} = {...data}
setModelVersion(code, version).then(resp=>{
this.$message.success(`成功切换为${version}版本`)
})
}
}
};
</script>
<style lang="scss" scoped>
.container {
padding: 10px;
.btn-area {
display: flex;
padding: 10px;
justify-content: center;
}
}
</style>

View File

@ -0,0 +1,105 @@
<template>
<div class="container">
<QueryListPage :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<edit-model-info ref="editDialog" @close="reloadTable" />
</div>
</template>
<script>
import { getModelList } from "@/api/management/model";
import EditModelInfo from "./components/editInfo";
export default {
name: "publishModel",
components: { EditModelInfo },
data() {
return {
pagerConfig: {
pageSize: "pageSize",
pageIndex: "pageNum"
},
queryForm: {
labelWidth: "80px",
reset: true,
queryObject: {
code: {
type: "text",
label: "模型编号"
},
name: {
type: "text",
label: "模型名称"
},
type: {
type: "text",
label: "模型类型"
}
}
},
queryList: {
query: this.queryPublishedModelList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: "模型编号",
prop: "code"
},
{
title: "模型名称",
prop: "name"
},{
title: '当前版本',
prop: "version"
},
{
title: "创建时间",
prop: "createTime"
},
{
title: "修改时间",
prop: "updateTime"
},
{
type: "button",
title: this.$t("global.operate"),
width: "350",
buttons: [
// {
// name: "",
// handleClick: this.handleEdit
// },
{
name: "发布历史",
handleClick: this.handleHistory
},
// {
// name: this.$t("global.delete"),
// handleClick: this.handleDelete,
// type: "danger"
// }
]
}
]
}
};
},
methods: {
queryPublishedModelList(params) {
return getModelList(params);
},
reloadTable() {
this.queryList.reload();
},
handleEdit(row, data) {
this.$refs.editDialog.show(data);
},
handleDelete(row, data) {},
handleHistory(row, data) {
console.log(data.code);
this.$router.push({ name: `modelHistory`, query: { code: data.code } });
}
}
};
</script>
<style lang="sass" scoped></style>

View File

@ -0,0 +1,71 @@
<template>
<el-dialog v-dialogDrag :visible.sync="visible" :title="title" center :destroy-on-close="true">
<el-form :model="formData" :rules="formRules" ref="form">
<el-form-item label="模型编号" prop="code">
<el-input v-model="formData.code"></el-input>
</el-form-item>
<el-form-item label="模型名称" prop="name">
<el-input v-model="formData.name"></el-input>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="close"> </el-button>
<el-button type="primary" @click="confirmHandler"> </el-button>
</div>
</el-dialog>
</template>
<script>
import { createModelDraft, updateModelDraftInfo } from "@/api/management/model";
export default {
name: "createModelDraftDialog",
data() {
return {
visible: false,
mode: "",
formData: { code: "", name: "", type: "", version: "" },
formRules: {
code: [{ required: true, message: "请输入模型编号", trigger: "blur" }],
name: [{ required: true, message: "请输入模型名称", trigger: "blur" }]
}
};
},
computed: {
submit() {
return this.mode === "edit" ? updateModelDraftInfo : createModelDraft;
},
title() {
return {
edit: "修改模型信息",
create: "新建模型"
}[this.mode];
}
},
methods: {
show(mode, data) {
this.mode = mode;
if (mode === "edit") {
this.formData = data;
} else {
this.formData = { code: "", name: "", type: "", version: "" };
}
this.visible = true;
},
close() {
this.visible = false;
this.$emit("close");
},
confirmHandler() {
this.$refs.form.validate(valid => {
if (valid) {
this.submit(this.formData).then(resp => {
this.close();
});
}
});
}
}
};
</script>
<style lang="scss" scoped></style>

View File

@ -0,0 +1,169 @@
<template>
<div class="container">
<QueryListPage :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<create-model-draft-dialog ref="createDialog" @close="closeCreate" />
<el-button @click="getList">queryPublishedModel</el-button>
</div>
</template>
<script>
import { getModelDraftList, publishModelDraft, deleteModelDraft, getModelList } from "@/api/management/model";
import createModelDraftDialog from "./components/create";
export default {
name: "userModelDesign",
components: { createModelDraftDialog },
data() {
return {
dialogs: {
createShow: false,
createMode: ""
},
pagerConfig: {
pageSize: "pageSize",
pageIndex: "pageNum"
},
queryForm: {
labelWidth: "80px",
reset: true,
queryObject: {
code: {
type: "text",
label: "模型编号"
},
name: {
type: "text",
label: "模型名称"
}
}
},
queryList: {
query: this.queryModelDraftList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: "模型编号",
prop: "code"
},
{
title: "模型名称",
prop: "name"
},
{
title: "创建时间",
prop: "createTime"
},
{
title: "修改时间",
prop: "updateTime"
},
{
type: "button",
title: this.$t("global.operate"),
width: "350",
buttons: [
{
name: this.$t("global.edit"),
handleClick: this.handleEdit
},
{
name: "绘图",
handleClick: this.handleDraw
},
{
name: "发布",
handleClick: this.handlePublish,
type: "success"
},
{
name: this.$t("global.delete"),
handleClick: this.handleDelete,
type: "danger"
}
]
}
],
actions: [{ text: this.$t("global.add"), handler: this.handleCreate }]
},
pubdModel: ''
};
},
methods: {
getList(){
getModelList().then(res=>{
console.log(res.data)
})
},
queryModelDraftList(params) {
return getModelDraftList(params);
},
handleCreate() {
this.$refs.createDialog.show("create");
},
closeCreate(e) {
this.reloadTable();
},
handleEdit(index, data) {
this.$refs.createDialog.show("edit", data);
},
handleDelete(idx, data) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
center: true
})
.then(
() => {
deleteModelDraft(data.id).then(() => {
this.reloadTable();
});
},
() => {}
)
.catch(e => {
this.$message(e);
});
},
handleDraw(idx, data) {
this.$router.push({ path: `usermodel/${data.id}/edit` });
},
handlePublish(idx, data) {
this.$confirm("确认发布?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
center: true
})
.then(
() => {
publishModelDraft(data.id).then(() => {
this.reloadTable();
});
},
() => {}
)
.catch(e => {
this.$message(e);
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>
<style lang="scss" scoped>
.container {
padding: 20px;
}
</style>

View File

@ -0,0 +1,49 @@
<template>
<jl-model-builder :id="id" :compose-name="name" :model="model" :type="type" @save="onSave" />
</template>
<script>
import { updateModelDraftData, getModelDraftData } from '@/api/management/model';
export default {
name: 'EditModel',
data() {
return {
name: '',
id: '',
type: '',
model: {}
};
},
mounted() {
this.id = this.$route.params.id;
this.initModelData();
},
methods: {
initModelData() {
getModelDraftData(this.id).then(res => {
const data = res.data;
this.name = data.name;
this.type = data.type || '';
this.model = data.jsonData ? JSON.parse(data.jsonData) : {};
});
},
onSave(payload) {
console.log(payload);
const data = {
id: this.id,
name: this.name,
jsonData: JSON.stringify(payload)
};
updateModelDraftData(data)
.then(resp => {
this.$message('保存成功');
})
.catch(e => {
this.$message('error', e);
});
}
}
};
</script>
<style lang="scss" scoped></style>