# Conflicts:
#	src/router/index.js
#	src/views/lesson/lessoncategory/edit/lesson/index.vue
This commit is contained in:
joylink_cuiweidong 2019-10-31 16:11:29 +08:00
commit 24a56a9695
69 changed files with 2052 additions and 2611 deletions

File diff suppressed because one or more lines are too long

View File

@ -29,7 +29,7 @@ class IbpPan {
initIbpPage(opts) {
const width = opts.config.width;
const height = opts.config.height;
this.isAllowDragging=false;
this.isAllowDragging = false;
this.$ibpZr = zrender.init(opts.dom, Object.assign({ renderer, devicePixelRatio, width, height }, opts.config));
this.$options = new Options(Object.assign({ scaleRate: 1, offsetX: 0, offsetY: 0 }, opts.options || {})); // 缩放
this.$mouseController = new MouseController(this);
@ -186,7 +186,6 @@ class IbpPan {
}
setDeviceStatus(list) {
const deviceList = Object.values(this.ibpDevice);
console.log(list, deviceList);
deviceList.forEach(elem =>{
(list || []).forEach(it =>{
if (elem.model.linkDevice === it.code) {

View File

@ -18,14 +18,22 @@ import JointTraining from '@/views/jointTraining/index';
import Error401 from '@/views/error-page/401';
import Errpr404 from '@/views/error-page/404';
import SkinCode from '@/views/system/skinCode/index';
import SkinCodeDraft from '@/views/system/skinCode/draft';
import MapProduct from '@/views/system/product/index';
import Dictionary from '@/views/system/dictionary/index';
import DictionaryDetail from '@/views/system/dictionaryDetail/index';
import UserControl from '@/views/system/userControl/index';
import UserTraining from '@/views/system/userTraining/index';
import UserExam from '@/views/system/userExam/index';
import UserSimulation from '@/views/system/userSimulation/index';
import ExistingSimulation from '@/views/system/existingSimulation/index';
import CacheControl from '@/views/system/cacheControl/index';
import Trainingrecord from '@/views/system/trainingrecord/index';
import SystemGenerate from '@/views/system/systemGenerate/index';
import IbpDraw from '@/views/system/ibpDraw/index';
import Mapedit from '@/views/mapdraft/index';
import Trainingrecord from '@/views/lesson/trainingrecord/index';
import TrainingrecordManage from '@/views/lesson/trainingrecord/manage/index';
import TrainingrecordManage from '@/views/lesson/trainingrecordmanage/index';
import Taskmanage from '@/views/lesson/taskmanage/list';
import TrainingRuleList from '@/views/lesson/trainingRule/list';
import TrainingRuleEdit from '@/views/lesson/trainingRule/detail/index';
@ -76,7 +84,6 @@ import RunplanView from '@/views/publish/runPlanEveryDay/runPlanView';
import PublishExamRule from '@/views/publish/examRule/index';
import PublishExamRuleDraft from '@/views/publish/examRule/draft/index';
import IbpEdit from '@/views/ibp/ibpDraft/ibpEdit/index';
import TrainingPlatform from '@/views/trainingPlatform/index';
import Commodity from '@/views/orderauthor/commodity/index';
@ -92,21 +99,10 @@ import PermissionCreate from '@/views/orderauthor/permission/create/index';
import UserRules from '@/views/orderauthor/rules/index';
import UserRulesDetail from '@/views/orderauthor/rules/detail';
import Dictionary from '@/views/management/dictionary/index';
import DictionaryDetail from '@/views/management/dictionaryDetail/index';
import UserControl from '@/views/management/userControl/index';
import UserTraining from '@/views/management/userTraining/index';
import UserExam from '@/views/management/userExam/index';
import UserSimulation from '@/views/management/userSimulation/index';
import ExistingSimulation from '@/views/management/existingSimulation/index';
import CacheControl from '@/views/management/cacheControl/index';
import LessonApproval from '@/views/approval/lesson/index';
import ScriptApproval from '@/views/approval/script/index';
import RunPlanApproval from '@/views/approval/runPlan/index';
import SystemGenerate from '@/views/systemGenerate/index';
import { loginTitle } from '@/scripts/ConstDic';
import { getSessionStorage } from '@/utils/auth';
@ -312,22 +308,12 @@ export const asyncRouter = [
meta: {
}
},
{
path: 'map/draw/:mapId/:view',
component: Mapedit,
hidden: true
},
{
path: 'lesson/edit/:type',
component: LessonEdit,
hidden: true
},
{
{ // 运行图设计
path: 'runPlan/detail/:mapId',
component: PlanMonitorDetail,
hidden: true
},
{
{ // 剧本
path: 'script/home/:mapId',
component: ScriptmanageHome,
meta: {
@ -335,13 +321,37 @@ export const asyncRouter = [
},
hidden: true
},
{
{ // 课程列表
path: 'lesson/home/:mapId',
// /:skinCode
component: LessonHome,
hidden: true
},
{
{ // 操作定义
path: 'lesson/trainingRule',
component: TrainingRuleList,
hidden: true
},
{ // 操作定义步骤
path: 'lesson/trainingRule/detail',
hidden: true,
component: TrainingRuleEdit
},
{ // 任务管理
path: 'lesson/taskManage',
component: Taskmanage,
hidden: true
},
{ // 实训管理
path: 'lesson/trainingManage',
component: Trainingmanage,
hidden: true
},
{ // 创建课程
path: 'lesson/edit/:type',
component: LessonEdit,
hidden: true
},
{ // 课程详情
path: 'lesson/details',
component: LessonDetail,
hidden: true,
@ -358,32 +368,7 @@ export const asyncRouter = [
component: TrainingrecordManage,
hidden: true
},
{
path: 'lesson/taskManage',
component: Taskmanage,
hidden: true
},
{
path: 'lesson/trainingRule',
component: TrainingRuleList,
hidden: true
},
{
path: 'lesson/trainingRule/detail',
hidden: true,
component: TrainingRuleEdit
},
{
path: 'lesson/trainingManage',
component: Trainingmanage,
hidden: true
},
{
path: 'lesson/training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
},
{
{ // 地图预览
path: 'mapPreview/:mapId',
component: MapPreview,
hidden: true
@ -416,38 +401,15 @@ export const asyncRouter = [
meta: {
}
},
{
{ // 地图绘制
path: 'map/draw/:mapId/:view',
component: Mapedit,
hidden: true
},
{
path: 'lesson/edit/:type',
component: LessonEdit,
hidden: true
},
{
{ // 运行图设计
path: 'runPlan/detail/:mapId',
component: PlanMonitorDetail,
hidden: true
},
{
path: 'script/home/:mapId',
component: ScriptmanageHome,
meta: {
i18n: 'router.scriptManage'
},
hidden: true
},
{
path: 'lesson/home/:mapId',
component: LessonHome,
hidden: true
},
{
path: 'lesson/training/:trainingId/:trainingName',
component: TrainingrecordManage,
hidden: true
}
]
}
@ -507,17 +469,17 @@ export const asyncRouter = [
meta: {
},
children: [
{
{ // 仿真详情
path: 'detail/:subSystem',
component: DemonstrationDetail,
hidden: true
},
{
{ // 教学系统 课程列表
path: 'teachHome/:subSystem',
component: TeachHome,
hidden: true
},
{
{ // 课程详情
path: 'teach/:subSystem',
component: TeachDetail,
hidden: true
@ -774,21 +736,9 @@ export const asyncRouter = [
roles: [admin, userDesign]
},
children: [
{
path: 'skinCode',
component: SkinCode,
meta: {
i18n: 'router.skinManage'
}
},
{
path: 'skinCode/draft/:mode/:skinCodeId',
hidden: true,
component: SkinCodeDraft
},
{
path: 'ibp/edit',
component: IbpEdit,
component: IbpDraw,
meta: {
i18n: 'router.ibpDraw'
}

View File

@ -3,9 +3,9 @@ export function getBaseUrl() {
let BASE_API;
if (process.env.NODE_ENV === 'development') {
// BASE_API = 'https://joylink.club/jlcloud';
// BASE_API = 'https://test.joylink.club/jlcloud';
BASE_API = 'https://test.joylink.club/jlcloud';
// BASE_API = 'http://192.168.3.5:9000'; // 袁琪
BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.6:9000'; // 旭强
// BASE_API = 'http://192.168.3.41:9000'; // 王兴杰
} else {
BASE_API = process.env.VUE_APP_BASE_API;

View File

@ -1,82 +0,0 @@
<template>
<transition name="el-zoom-in-center">
<div class="mapPaint">
<div class="map-view">
<ibp-plate ref="ibpPlate" :size="size" />
</div>
<div class="map-draft">
<ibp-operate ref="ibpOperate" @ibpChange="ibpChange" />
</div>
</div>
</transition>
</template>
<script>
import IbpPlate from '@/views/ibp/index';
import IbpOperate from './ibpOperate/index';
export default {
name: 'IbpView',
components: {
IbpPlate,
IbpOperate
},
data() {
return {
size: {
width: this.$store.state.app.width-521,
height: this.$store.state.app.height - 60
}
};
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 });
}
},
created() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 });
},
mounted() {
this.$refs.ibpPlate.show();
this.$refs.ibpPlate.drawIbpInit();
},
beforeDestroy() {
},
methods: {
ibpChange(stationCode) {
this.$refs.ibpPlate.show(stationCode);
this.$refs.ibpPlate.drawIbpInit();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.map-draft{
/deep/{
.v-modal{
opacity: 0;
}
}
}
.map-view {
float: left;
width: 60%;
}
.mapPaint{
height: 100%;
overflow: hidden;
}
.map-draft {
float: right;
width: 520px;
// /deep/ .el-scrollbar__view {
// width: 510px !important;
// height: calc(100% - 40px);
// }
}
</style>

View File

@ -1,213 +0,0 @@
<template>
<div>
<div :id="ibpId" :style="{ width: this.canvasWidth +'px', height: this.canvasHeight +'px',background:'#000' }" class="ibp-canvas" v-loading="loading" />
<el-button v-if="showBackButton" class="ibp-button" type="primary" @click="back">{{$t('global.back')}}</el-button>
</div>
</template>
<script>
import Vue from 'vue';
import IbpPan from '@/ibp/ibpPan';
import { parser } from '@/ibp/utils/parser';
import ibpData from '@/ibp/constant/ibpData';
import { mapGetters } from 'vuex';
import { exitFullscreen } from '@/utils/screen';
import { putJointTrainingSimulationUser } from '@/api/chat';
import { handlerIbpEvent } from '@/api/simulation';
import { IbpOperation } from '@/scripts/ConstDic'
export default {
name: 'Ibp',
props: {
size: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
width: this.$store.state.config.width,
height: this.$store.state.config.height,
dataZoom: {
offsetX: '0',
offsetY: '0',
scaleRate: '1'
},
config: {
scaleRate: '1',
origin: {
x: 0,
y: 0
}
},
showBackButton: true,
initTime: '',
started: false,
loading: false,
stationCode: '',
};
},
computed: {
...mapGetters([
'canvasWidth',
'canvasHeight'
]),
ibpId() {
return ['ibp', (Math.random().toFixed(5)) * 100000].join('_');
},
},
watch: {
'$store.state.config.canvasSizeCount': function (val) {
this.reSize();
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
'$store.state.training.initTime': function (initTime) {
this.initTime = initTime;
if (this.$ibp) {
this.initClockTime(initTime);
}
},
'$store.state.training.started': function (started) {
this.started = started;
if (this.$ibp) {
this.setClockStart(started);
}
},
'$store.state.socket.equipmentStatus': function (val) {
if (val.length) {
this.statusMessage(val);
}
},
},
mounted() {
this.setWindowSize();
},
beforeDestroy() {
this.ibpDestroy();
},
methods: {
show (deviceCode,ibpPart) {
if (!deviceCode) {
return;
}
this.stationCode = deviceCode;
document.getElementById(this.ibpId).oncontextmenu = function (e) {
return false;
};
let offsetX = 0;
if (ibpPart === 'left'){
offsetX = 0;
}else if (ibpPart === 'right'){
offsetX = 1920;
}
this.ibpDestroy();
this.loading = true;
const data = parser(ibpData[deviceCode], {width: this.canvasWidth, height: this.canvasHeight});
this.$ibp = new IbpPan({
dom: document.getElementById(this.ibpId),
config: {
renderer: 'canvas',
width: this.canvasWidth,
height: this.canvasHeight
},
options: {
scaleRate: 1,
offsetX: offsetX,
offsetY: 0
},
methods: {
viewLoaded: this.handleViewLoaded,
}
});
Vue.prototype.$ibp = this.$ibp;
this.$ibp.on('contextmenu', this.onContextMenu, this);
if (this.$route.query.group) {
this.$ibp.on('selected', this.onSelected, this);
}
this.setMap(data,ibpData[deviceCode]);
this.$store.dispatch('ibp/setIbpData', ibpData[deviceCode]);
this.initClockTime(this.initTime);
window.document.oncontextmenu = function () {
return false;
};
},
setMap(data,oldData) {
this.$ibp.setMap(oldData, data);
},
//
onSelected(em) {
if (em.deviceModel.mean) {
const params = { operate:IbpOperation[em.deviceModel.mean].operate,stationCode:this.stationCode };
handlerIbpEvent(this.$route.query.group,params);
}
},
//
onContextMenu(em) {
this.$store.dispatch('ibp/setUpdateDeviceData', em.eventTarget.model);
},
//
drawIbpInit() {
this.$ibp&&this.$ibp.drawIbpInit();
this.showBackButton = false;
},
//
initClockTime(initTime) {
this.$ibp.initClockTime(initTime);
},
//
setClockStart(started) {
this.$ibp.setClockStart(started);
},
reSize() {
this.$nextTick(() => {
this.width = this.$store.state.config.width;
this.height = this.$store.state.config.height;
this.$ibp && this.$ibp.resize({ width: this.width, height: this.height });
});
},
setWindowSize() {
this.$nextTick(() => {
const width = this.size ? this.size.width : this.$store.state.app.width;
const height = this.size ? this.size.height : this.$store.state.app.height;
this.$store.dispatch('config/resize', { width: width, height: height });
});
},
back() {
this.group = this.$route.query.group;
this.$store.dispatch('training/over').then(() => {
putJointTrainingSimulationUser(this.group).then(() => {
this.$router.push({ path: `/trainroom`, query: { group: this.group } });
exitFullscreen();
});
});
},
ibpDestroy() {
if (this.$ibp) {
this.$ibp.dispose();
this.$ibp = '';
Vue.prototype.$ibp = '';
}
},
handleViewLoaded() {
this.loading = false;
},
statusMessage(val) {
this.$ibp && this.$ibp.setDeviceStatus(val);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.ibp-button{
position: absolute;
float: right;
right: 20px;
bottom: 15px;
}
.ibp-canvas{
}
</style>

View File

@ -0,0 +1,213 @@
<template>
<div>
<div :id="ibpId" v-loading="loading" :style="{ width: this.canvasWidth +'px', height: this.canvasHeight +'px',background:'#000' }" class="ibp-canvas" />
<el-button v-if="showBackButton" class="ibp-button" type="primary" @click="back">{{ $t('global.back') }}</el-button>
</div>
</template>
<script>
import Vue from 'vue';
import IbpPan from '@/ibp/ibpPan';
import { parser } from '@/ibp/utils/parser';
import ibpData from '@/ibp/constant/ibpData';
import { mapGetters } from 'vuex';
import { exitFullscreen } from '@/utils/screen';
import { putJointTrainingSimulationUser } from '@/api/chat';
import { handlerIbpEvent } from '@/api/simulation';
import { IbpOperation } from '@/scripts/ConstDic';
export default {
name: 'Ibp',
props: {
size: {
type: Object,
default() {
return null;
}
}
},
data() {
return {
width: this.$store.state.config.width,
height: this.$store.state.config.height,
dataZoom: {
offsetX: '0',
offsetY: '0',
scaleRate: '1'
},
config: {
scaleRate: '1',
origin: {
x: 0,
y: 0
}
},
showBackButton: true,
initTime: '',
started: false,
loading: false,
stationCode: ''
};
},
computed: {
...mapGetters([
'canvasWidth',
'canvasHeight'
]),
ibpId() {
return ['ibp', (Math.random().toFixed(5)) * 100000].join('_');
}
},
watch: {
'$store.state.config.canvasSizeCount': function (val) {
this.reSize();
},
'$store.state.app.windowSizeCount': function() {
this.setWindowSize();
},
'$store.state.training.initTime': function (initTime) {
this.initTime = initTime;
if (this.$ibp) {
this.initClockTime(initTime);
}
},
'$store.state.training.started': function (started) {
this.started = started;
if (this.$ibp) {
this.setClockStart(started);
}
},
'$store.state.socket.equipmentStatus': function (val) {
if (val.length) {
this.statusMessage(val);
}
}
},
mounted() {
this.setWindowSize();
},
beforeDestroy() {
this.ibpDestroy();
},
methods: {
show (deviceCode, ibpPart) {
if (!deviceCode) {
return;
}
this.stationCode = deviceCode;
document.getElementById(this.ibpId).oncontextmenu = function (e) {
return false;
};
let offsetX = 0;
if (ibpPart === 'left') {
offsetX = 0;
} else if (ibpPart === 'right') {
offsetX = 1920;
}
this.ibpDestroy();
this.loading = true;
const data = parser(ibpData[deviceCode], {width: this.canvasWidth, height: this.canvasHeight});
this.$ibp = new IbpPan({
dom: document.getElementById(this.ibpId),
config: {
renderer: 'canvas',
width: this.canvasWidth,
height: this.canvasHeight
},
options: {
scaleRate: 1,
offsetX: offsetX,
offsetY: 0
},
methods: {
viewLoaded: this.handleViewLoaded
}
});
Vue.prototype.$ibp = this.$ibp;
this.$ibp.on('contextmenu', this.onContextMenu, this);
if (this.$route.query.group) {
this.$ibp.on('selected', this.onSelected, this);
}
this.setMap(data, ibpData[deviceCode]);
this.$store.dispatch('ibp/setIbpData', ibpData[deviceCode]);
this.initClockTime(this.initTime);
window.document.oncontextmenu = function () {
return false;
};
},
setMap(data, oldData) {
this.$ibp.setMap(oldData, data);
},
//
onSelected(em) {
if (em.deviceModel.mean) {
const params = { operate:IbpOperation[em.deviceModel.mean].operate, stationCode:this.stationCode };
handlerIbpEvent(this.$route.query.group, params);
}
},
//
onContextMenu(em) {
this.$store.dispatch('ibp/setUpdateDeviceData', em.eventTarget.model);
},
//
drawIbpInit() {
this.$ibp && this.$ibp.drawIbpInit();
this.showBackButton = false;
},
//
initClockTime(initTime) {
this.$ibp.initClockTime(initTime);
},
//
setClockStart(started) {
this.$ibp.setClockStart(started);
},
reSize() {
this.$nextTick(() => {
this.width = this.$store.state.config.width;
this.height = this.$store.state.config.height;
this.$ibp && this.$ibp.resize({ width: this.width, height: this.height });
});
},
setWindowSize() {
this.$nextTick(() => {
const width = this.size ? this.size.width : this.$store.state.app.width;
const height = this.size ? this.size.height : this.$store.state.app.height;
this.$store.dispatch('config/resize', { width: width, height: height });
});
},
back() {
this.group = this.$route.query.group;
this.$store.dispatch('training/over').then(() => {
putJointTrainingSimulationUser(this.group).then(() => {
this.$router.push({ path: `/trainroom`, query: { group: this.group } });
exitFullscreen();
});
});
},
ibpDestroy() {
if (this.$ibp) {
this.$ibp.dispose();
this.$ibp = '';
Vue.prototype.$ibp = '';
}
},
handleViewLoaded() {
this.loading = false;
},
statusMessage(val) {
this.$ibp && this.$ibp.setDeviceStatus(val);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.ibp-button{
position: absolute;
float: right;
right: 20px;
bottom: 15px;
}
.ibp-canvas{
}
</style>

View File

@ -33,7 +33,7 @@ import JoinFaultChoose from '@/views/display/demon/faultChoose';
import JoinRunPlanLoad from '@/views/display/demon/runPlanLoad';
import JoinRunPlanView from '@/views/display/demon/runPlanView';
import menuSystemTime from '@/views/display/menuSystemTime';
import IbpPlate from '@/views/ibp/index';
import IbpPlate from '@/views/ibpsystem/index';
import { mapGetters } from 'vuex';
import { OperateMode, TrainingMode } from '@/scripts/ConstDic';
import { checkLoginLine } from '@/api/login';

View File

@ -1,160 +0,0 @@
<template>
<el-card v-loading="loading" class="map-list-main">
<div slot="header" class="clearfix">
<span>{{ $t(`lesson.trainingList`) }}</span>
</div>
<div style="{width: 150px}">
<el-input v-model="filterText" :placeholder="$t(`lesson.filterPlaceholder`)" clearable />
</div>
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{ height: (height-270) +'px' }">
<el-tree
ref="tree"
:data="treeData"
:props="defaultProps"
node-key="id"
:default-expanded-keys="defaultShowKeys"
:filter-node-method="filterNode"
expand-on-click-node
highlight-current
:span="22"
@node-contextmenu="showContextMenu"
@node-click="clickEvent"
>
<div slot-scope="{ node: nodeScop }">
<span v-if="nodeScop.data.type == 'skin'" class="el-icon-news">&nbsp;{{ nodeScop.label }}</span>
<span v-else-if="nodeScop.data.type == 'prd'" class="el-icon-tickets">&nbsp;{{ nodeScop.label }}</span>
<span
v-else-if="nodeScop.data.type == 'trainingType'"
class="el-icon-document"
>&nbsp;{{ nodeScop.label }}</span>
<span
v-else-if="nodeScop.data.type == 'training'"
class="el-icon-edit-outline"
>&nbsp;{{ nodeScop.label }}</span>
</div>
</el-tree>
</el-scrollbar>
<operate-menu ref="menu" :point="point" :node="node" @refresh="refresh" @trainingShow="trainingShow" />
</el-card>
</template>
<script>
import { DeviceMenu } from '@/scripts/ConstDic';
import { getTrainingTree } from '@/api/jmap/training';
import { trainingNotify } from '@/api/simulation';
import OperateMenu from './category/operateMenu';
import { UrlConfig } from '@/router/index';
import localStore from 'storejs';
export default {
name: 'TrainingOperate',
components: {
OperateMenu
},
data() {
return {
loading: true,
defaultShowKeys: [],
filterText: '',
treeData: [],
defaultProps: {
children: 'children',
label: 'name'
},
point: {
x: 0,
y: 0
},
node: {
}
};
},
computed: {
height() {
return this.$store.state.app.height - 50;
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val);
}
},
mounted() {
this.refresh();
},
methods: {
filterNode(value, data) {
if (!value) return true;
return data.name.indexOf(value) !== -1;
},
clickEvent(obj, node, data) {
this.$store.dispatch('menuOperation/setPopMenu', { position: null, menu: null });
if (obj && obj.type === 'Training') {
this.resize();
trainingNotify({ trainingId: obj.id }).then(resp => {
this.group = resp.data;
this.$router.push({ path: `${UrlConfig.design.lessonTraining}/${obj.id}/${obj.name}`, query: { group: resp.data } });
}).catch(error => {
this.$messageBox(`${this.$t('error.createSimulationFailed')}: ${error.message}`);
});
}
},
showContextMenu(e, obj, node, vueElem) {
if (obj && obj.type === 'TrainingType' || obj.type === 'Training') {
e.preventDefault();
this.point = {
x: e.clientX,
y: e.clientY
};
this.node = node;
const menu = DeviceMenu.Training;
this.$store.dispatch('menuOperation/setPopMenu', { position: this.point, menu: menu });
}
},
getParent(node) {
while (node && node.data.type != 'Skin') {
node = node.parent;
}
return node || {};
},
trainingShow() {
this.$emit('trainingStart', { id: this.node.data.id, lessonId: this.getParent(this.node).data.id });
},
refresh() {
this.loading = true;
getTrainingTree().then(response => {
this.treeData = response.data;
this.defaultShowKeys = [this.$route.params.trainingId];
this.$nextTick(() => {
this.loading = false;
this.$refs.tree.setCurrentKey(this.$route.params.trainingId); // value node-key
if (this.filterText) {
this.$refs.tree.filter(this.filterText);
}
});
}).catch(() => {
this.loading = false;
this.$messageBox(this.$t('error.refreshFailed'));
});
},
resize() {
this.widthLeft = Number(localStore.get('LeftWidth')) || this.widthLeft;
const width = this.$store.state.app.width - 521 - this.widthLeft;
const height = this.$store.state.app.height - 90;
this.$store.dispatch('config/resize', { width: width, height: height });
}
}
};
</script>
<style>
.el-tree {
overflow-x: hidden;
}
.map-list-main {
text-align: center;
}
.el-tree-node.is-current>.el-tree-node__content {
background-color: #e4e3e3 !important;
}
</style>

View File

@ -1,137 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<dictionary-edit ref="create" type="ADD" @reloadTable="reloadTable" />
<dictionary-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { list, del } from '@/api/management/dictionary';
import DictionaryEdit from '@/views/management/dictionary/edit';
export default {
name: 'Dictionary',
components: {
DictionaryEdit
},
data() {
return {
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
code: {
type: 'text',
label: this.$t('system.code')
},
name: {
type: 'text',
label: this.$t('system.name')
},
status: {
type: 'select',
label: this.$t('system.status'),
config: {
data: this.$ConstSelect.Status
}
}
}
},
queryList: {
query: list,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('system.code'),
prop: 'code'
},
{
title: this.$t('system.name'),
prop: 'name'
},
{
title: this.$t('system.status'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
},
{
title: this.$t('system.remarks'),
prop: 'remarks'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.detail'),
handleClick: this.handleViewDetail
},
{
name: this.$t('global.edit'),
handleClick: this.handleEdit
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.handleAdd }
// { text: '', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
]
},
currentModel: {}
};
},
methods: {
handleViewDetail(index, row) {
this.$router.push({ path: `/system/dictionary/detail`, query: { id: row.id } });
},
handleEdit(index, row) {
this.$refs.edit.show(row.id);
},
handleAdd() {
this.$refs.create.show();
},
handleBatchDelete() {
},
handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
del(row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>

View File

@ -1,167 +0,0 @@
<template>
<div>
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<div class="draft">
<el-button-group>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
</el-button-group>
</div>
<dictionary-detail-edit ref="create" type="ADD" :dic-id="dicId" @reloadTable="reloadTable" />
<dictionary-detail-edit ref="edit" type="EDIT" :dic-id="dicId" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { list, del } from '@/api/management/dictionaryDetail';
import { getData } from '@/api/management/dictionary';
import DictionaryDetailEdit from '@/views/management/dictionaryDetail/edit';
export default {
name: 'DictionaryDetail',
components: {
DictionaryDetailEdit
},
data() {
return {
dicId: '',
dic: {},
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
code: {
type: 'text',
label: this.$t('global.code')
},
name: {
type: 'text',
label: this.$t('global.name')
},
status: {
type: 'select',
label: this.$t('global.status'),
config: {
data: this.$ConstSelect.Status
}
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('global.code'),
prop: 'code'
},
{
title: this.$t('global.name'),
prop: 'name'
},
{
title: this.$t('global.status'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
},
{
title: this.$t('global.remarks'),
prop: 'remarks'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.edit'),
handleClick: this.handleEdit
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), btnCode: 'employee_insert', handler: this.handleAdd }
// { text: '', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
]
},
currentModel: {}
};
},
// computed: {
// turnbackBarTitle() {
// return this.dic.name + '(' + this.dic.code + ')'
// }
// },
created() {
this.dicId = this.$route.query.id;
getData(this.dicId).then(response => {
this.dic = response.data;
});
},
methods: {
queryFunction(params) {
return list(this.dicId, params);
},
handleEdit(index, row) {
this.$refs.edit.show(row.id);
},
handleAdd() {
this.$refs.create.show();
},
handleBatchDelete() {
},
handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
del(this.dicId, row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
reloadTable() {
this.queryList.reload();
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.draft {
width: 400px;
text-align: center;
margin: 20px auto;
}
</style>

View File

@ -2,37 +2,13 @@
<el-dialog v-dialogDrag :title="title" :visible.sync="dialogShow" :before-close="handleCancel" :close-on-click-modal="false">
<el-form ref="form" :model="form" :rules="rules" label-width="140px">
<el-form-item :label="$t('publish.trainingType')" prop="course">
<el-select
v-model="form.course"
:placeholder="$t('publish.selectTypeScope')"
:disabled="editOk"
style="width:240px;"
@change="changeCourse(form.course)"
>
<el-option
v-for="nor in options"
:key="nor.id"
:label="nor.name"
:value="nor.code"
:disabled="nor.disabled"
/>
<el-select v-model="form.course" :placeholder="$t('publish.selectTypeScope')" :disabled="editOk" style="width:240px;" @change="changeCourse(form.course)">
<el-option v-for="nor in options" :key="nor.id" :label="nor.name" :value="nor.code" :disabled="nor.disabled" />
</el-select>
</el-form-item>
<el-form-item :label="$t('publish.operationType')">
<el-select
v-model="form.operateType"
clearable
:placeholder="$t('publish.selectScope')"
:disabled="editOk"
@change="changeOperation(form.operateType)"
>
<el-option
v-for="nor in operationTypeList"
:key="nor.id"
:label="nor.name"
:value="nor.code"
:disabled="nor.disabled"
/>
<el-select v-model="form.operateType" clearable :placeholder="$t('publish.selectScope')" :disabled="editOk" @change="changeOperation(form.operateType)">
<el-option v-for="nor in operationTypeList" :key="nor.id" :label="nor.name" :value="nor.code" :disabled="nor.disabled" />
</el-select>
</el-form-item>
<el-form-item :label="$t('publish.questionNumbers')" prop="number">
@ -254,7 +230,7 @@ export default {
this.changeOperationDisabled(); //
});
}
this.form.operateType='';
this.form.operateType = '';
const resp = await getLessonTypeNum(param);
if (resp.code == 200) {
this.topicNum = resp.data;

View File

@ -1,27 +1,16 @@
<template>
<div class="exam-rule">
<el-scrollbar wrap-class="scrollbar-wrapper" :style="{height: height + 'px'}">
<el-form ref="form" :model="form" :rules="rules" label-width="120px" class="demo-form">
<el-form-item :label="$t('publish.testName')" prop="name">
<el-input v-model="form.name" :placeholder="$t('publish.inputTestName')" />
</el-form-item>
<el-form-item :label="$t('publish.testScope')" prop="region">
<el-select
v-model="form.region"
:placeholder="$t('publish.selectTestScope')"
style="width: 100%;"
:disabled="isEdit || selectDisable"
>
<el-select v-model="form.region" :placeholder="$t('publish.selectTestScope')" style="width: 100%;" :disabled="isEdit || selectDisable">
<el-option v-for="nor in options" :key="nor.id" :label="nor.name" :value="nor.id" />
</el-select>
</el-form-item>
<el-form-item :label="$t('publish.testDuration')" prop="duration">
<el-input
v-model="form.duration"
placeholder="90"
style="float: left; width: calc(100% - 80px);"
:disabled="isEdit"
/>
<el-input v-model="form.duration" placeholder="90" style="float: left; width: calc(100% - 80px);" :disabled="isEdit" />
<span style="width:80px; display: block;float: left; text-align: center;">&nbsp;{{ $t('publish.durationMinutes') }}</span>
</el-form-item>
<el-form-item :label="$t('publish.testDate')">
@ -71,7 +60,6 @@
<el-button type="primary" @click="submitForm" v-else>{{ $t('error.nextStep') }}</el-button>
</el-form-item> -->
</el-form>
</el-scrollbar>
</div>
</template>
@ -81,12 +69,6 @@ import { getExamLessonDetail, updateExamRules } from '@/api/management/exam';
export default {
name: 'ExamFrom',
props: {
height: {
type: Number,
default: 800
}
},
data() {
var fullMark = (rule, value, callback) => {
if (!value) {
@ -284,7 +266,7 @@ export default {
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.exam-rule {
overflow-y: auto;
height: 100%;
}
.line {

View File

@ -1,9 +1,9 @@
<template>
<!-- <el-card> -->
<!-- <div v-if="lessonName" slot="header" style="text-align: center;">
<div class="joylink-card" :class="lessonName ? 'card-box' : ''">
<div v-if="lessonName" class="card-title">
<b>{{ $t('publish.lessonName') }} {{ lessonName }}</b>
</div> -->
<div class="exam-box">
</div>
<div class="exam-box" :style="{ 'height': lessonName ? 'calc(100% - 47px)' : '' }">
<el-steps class="steps" :active="display">
<el-step :title="$t('publish.testDefinitionMaking')" icon="el-icon-edit" />
<el-step :title="$t('publish.examRuleMaking')" icon="el-icon-setting" />
@ -26,7 +26,7 @@
</el-button-group>
</div>
</div>
<!-- </el-card> -->
</div>
</template>
<script>
@ -44,7 +44,7 @@ export default {
return {
display: 1,
course: {},
// lessonName: '',
lessonName: '',
formData: {}
};
},
@ -69,11 +69,11 @@ export default {
loadInitData() {
getPublishLessonList().then(response => {
this.OrganizationList = response.data;
// this.OrganizationList.forEach(elem => {
// if (elem.id == this.$route.params.lessonId) {
// this.lessonName = elem.name;
// }
// });
this.OrganizationList.forEach(elem => {
if (elem.id == this.$route.params.lessonId) {
this.lessonName = elem.name;
}
});
});
},
definition(data) {
@ -109,9 +109,21 @@ export default {
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.joylink-card{
.card-title{
text-align: center;
height: 47px;
line-height: 47px;
border-bottom: 1px solid #e6e6e6;
}
}
.card-box{
overflow: hidden;
height: 100%;
}
.exam-box {
padding-top: 10px;
height: 100%;
overflow: auto;
/deep/ {
.el-step__icon.is-icon {

View File

@ -1,8 +1,8 @@
<template>
<div class="exam-rule">
<span>{{$t('publish.fullScoreTips')}} {{ course.fullMark }} {{$t('publish.scorePoints')}}</span>
<el-button class="addList" size="small" @click="handleAdd">{{$t('publish.addRules')}}</el-button>
<el-table :data="ruleList" border show-summary style="width: 100%" :height="height">
<span>{{ $t('publish.fullScoreTips') }} {{ course.fullMark }} {{ $t('publish.scorePoints') }}</span>
<el-button class="addList" size="small" @click="handleAdd">{{ $t('publish.addRules') }}</el-button>
<el-table :data="ruleList" border show-summary style="width: 100%; min-height: 300px;">
<el-table-column prop="name" :label="$t('publish.trainingType')" />
<el-table-column prop="num" :label="$t('publish.questionsNumber')" width="100" />
<el-table-column prop="point" :label="$t('publish.eachScore')" width="100" />
@ -14,10 +14,6 @@
</template>
</el-table-column>
</el-table>
<!-- <div class="btn-footer">
<el-button @click="regulation">上一步</el-button>
<el-button type="primary" @click="creatOk">新增</el-button>
</div> -->
<edit-rule
ref="addRule"
:course-id="courseId"
@ -43,10 +39,6 @@ export default {
course: {
type: Object,
default: null
},
height: {
type: Number,
default: 800
}
},
data() {

View File

@ -1,20 +1,14 @@
<template>
<el-card>
<div v-if="lessonName" slot="header" style="text-align: center;">
<div class="joylink-card">
<div v-if="lessonName" class="card-title">
<b>{{ $t('publish.lessonName') }} {{ lessonName }}</b>
</div>
<div :style="{ height: height +'px' }">
<el-scrollbar wrap-class="scrollbar-wrapper" style="">
<QueryListPage
ref="queryListPage"
:pager-config="pagerConfig"
:query-form="queryForm"
:query-list="queryList"
style="height: 100%;"
/>
<div :style="{ 'height': lessonName ? 'calc(100% - 47px)' : '100%' }">
<el-scrollbar wrap-class="scrollbar-wrapper">
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</el-scrollbar>
</div>
</el-card>
</div>
</template>
<script>
@ -182,11 +176,6 @@ export default {
}
};
},
computed: {
height() {
return /\/exam\//.test(`${this.$route.path}`)? this.$store.state.app.height - 92: this.$store.state.app.height - 65;
}
},
created() {
this.loadInitData();
},
@ -324,6 +313,15 @@ export default {
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.joylink-card {
height: 100%;
}
.card-title{
text-align: center;
height: 47px;
line-height: 47px;
border-bottom: 1px solid #e6e6e6;
}
/deep/ {
.is-always-shadow {
box-shadow: none;

View File

@ -2,7 +2,7 @@
<el-dialog v-dialogDrag title="复制地图为" :visible.sync="dialogVisible" width="30%" center>
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
@ -19,6 +19,7 @@ export default {
name: '',
copyOtherData: false
},
loading: false,
mapId: '',
form:{
labelWidth: '100px',
@ -46,10 +47,18 @@ export default {
this.mapId = row.id;
},
doSave() {
if (this.loading) {
return;
}
this.loading = true;
copyMapAs(this.mapId, this.formModel).then(resp =>{
this.$message.success('复制地图成功!');
this.loading = false;
this.dialogVisible = false;
this.$emit('refresh');
}).catch(() => {
this.loading = false;
this.$messageBox(`复制地图失败!`);
});
}
}

View File

@ -24,7 +24,7 @@
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button v-loading="loading" type="primary" @click="doSave">{{ $t('global.confirm') }}</el-button>
<el-button @click="dialogVisible = false">{{ $t('global.cancel') }}</el-button>
</span>
</el-dialog>
@ -45,6 +45,7 @@ export default {
project: false,
projectCode: ''
},
loading: false,
projectCodeShow: false,
booleanValue: {
t: true,
@ -63,10 +64,17 @@ export default {
doSave() {
this.$refs['form'].validate((valid) => {
if (valid) {
if (this.loading) {
return;
}
this.loading = true;
setMapProject(this.formModel).then(resp =>{
this.$message.success('设置归属项目成功!');
this.loading = false;
this.dialogVisible = false;
this.$emit('refresh');
}).catch( ()=>{
this.$messageBox(`设置归属项目失败!`);
});
} else {
return false;

View File

@ -0,0 +1,138 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<dictionary-edit ref="create" type="ADD" @reloadTable="reloadTable" />
<dictionary-edit ref="edit" type="EDIT" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { list, del } from '@/api/management/dictionary';
import DictionaryEdit from '@/views/system/dictionary/edit';
export default {
name: 'Dictionary',
components: {
DictionaryEdit
},
data() {
return {
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
code: {
type: 'text',
label: this.$t('system.code')
},
name: {
type: 'text',
label: this.$t('system.name')
},
status: {
type: 'select',
label: this.$t('system.status'),
config: {
data: this.$ConstSelect.Status
}
}
}
},
queryList: {
query: list,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('system.code'),
prop: 'code'
},
{
title: this.$t('system.name'),
prop: 'name'
},
{
title: this.$t('system.status'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
},
{
title: this.$t('system.remarks'),
prop: 'remarks'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.detail'),
handleClick: this.handleViewDetail
},
{
name: this.$t('global.edit'),
handleClick: this.handleEdit
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.handleAdd }
// { text: '', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
]
},
currentModel: {}
};
},
methods: {
handleViewDetail(index, row) {
this.$router.push({ path: `/system/dictionary/detail`, query: { id: row.id } });
},
handleEdit(index, row) {
this.$refs.edit.show(row.id);
},
handleAdd() {
this.$refs.create.show();
},
handleBatchDelete() {
},
handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
del(row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>

View File

@ -0,0 +1,167 @@
<template>
<div>
<!-- <turnback-bar :title="turnbackBarTitle"></turnback-bar> -->
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
<div class="draft">
<el-button-group>
<el-button type="primary" @click="turnback">{{ $t('global.back') }}</el-button>
</el-button-group>
</div>
<dictionary-detail-edit ref="create" type="ADD" :dic-id="dicId" @reloadTable="reloadTable" />
<dictionary-detail-edit ref="edit" type="EDIT" :dic-id="dicId" @reloadTable="reloadTable" />
</div>
</template>
<script>
import { list, del } from '@/api/management/dictionaryDetail';
import { getData } from '@/api/management/dictionary';
import DictionaryDetailEdit from '@/views/system/dictionaryDetail/edit';
export default {
name: 'DictionaryDetail',
components: {
DictionaryDetailEdit
},
data() {
return {
dicId: '',
dic: {},
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
code: {
type: 'text',
label: this.$t('global.code')
},
name: {
type: 'text',
label: this.$t('global.name')
},
status: {
type: 'select',
label: this.$t('global.status'),
config: {
data: this.$ConstSelect.Status
}
}
}
},
queryList: {
query: this.queryFunction,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('global.code'),
prop: 'code'
},
{
title: this.$t('global.name'),
prop: 'name'
},
{
title: this.$t('global.status'),
prop: 'status',
type: 'tag',
columnValue: (row) => { return this.$ConstSelect.translate(row.status, 'Status'); },
tagType: (row) => { if (row.status === '0') { return 'danger'; } else { return 'success'; } }
},
{
title: this.$t('global.remarks'),
prop: 'remarks'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.edit'),
handleClick: this.handleEdit
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), btnCode: 'employee_insert', handler: this.handleAdd }
// { text: '', btnCode: 'employee_delete', handler: this.handleBatchDelete, type: 'danger' }
]
},
currentModel: {}
};
},
// computed: {
// turnbackBarTitle() {
// return this.dic.name + '(' + this.dic.code + ')'
// }
// },
created() {
this.dicId = this.$route.query.id;
getData(this.dicId).then(response => {
this.dic = response.data;
});
},
methods: {
queryFunction(params) {
return list(this.dicId, params);
},
handleEdit(index, row) {
this.$refs.edit.show(row.id);
},
handleAdd() {
this.$refs.create.show();
},
handleBatchDelete() {
},
handleDelete(index, row) {
this.$confirm(this.$t('system.wellDelType'), this.$t('global.tips'), {
confirmButtonText: this.$t('global.confirm'),
cancelButtonText: this.$t('global.cancel'),
type: 'warning'
}).then(() => {
del(this.dicId, row.id).then(response => {
this.$message.success(this.$t('system.deleteSuccess'));
this.reloadTable();
}).catch(() => {
this.reloadTable();
this.$messageBox(this.$t('error.deleteFailed'));
});
});
},
reloadTable() {
this.queryList.reload();
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.draft {
width: 400px;
text-align: center;
margin: 20px auto;
}
</style>

View File

@ -0,0 +1,82 @@
<template>
<transition name="el-zoom-in-center">
<div class="mapPaint">
<div class="map-view">
<ibp-plate ref="ibpPlate" :size="size" />
</div>
<div class="map-draft">
<ibp-operate ref="ibpOperate" @ibpChange="ibpChange" />
</div>
</div>
</transition>
</template>
<script>
import IbpPlate from '@/views/ibpsystem/index';
import IbpOperate from './ibpOperate/index';
export default {
name: 'IbpView',
components: {
IbpPlate,
IbpOperate
},
data() {
return {
size: {
width: this.$store.state.app.width - 521,
height: this.$store.state.app.height - 60
}
};
},
watch: {
'$store.state.app.windowSizeCount': function() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 });
}
},
created() {
this.$store.dispatch('config/resize', { width: this.$store.state.app.width - 521, height: this.$store.state.app.height - 60 });
},
mounted() {
this.$refs.ibpPlate.show();
this.$refs.ibpPlate.drawIbpInit();
},
beforeDestroy() {
},
methods: {
ibpChange(stationCode) {
this.$refs.ibpPlate.show(stationCode);
this.$refs.ibpPlate.drawIbpInit();
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
@import "src/styles/mixin.scss";
.map-draft{
/deep/{
.v-modal{
opacity: 0;
}
}
}
.map-view {
float: left;
width: 60%;
}
.mapPaint{
height: 100%;
overflow: hidden;
}
.map-draft {
float: right;
width: 520px;
// /deep/ .el-scrollbar__view {
// width: 510px !important;
// height: calc(100% - 40px);
// }
}
</style>

View File

@ -1,202 +0,0 @@
<template>
<div class="card-box">
<el-steps class="steps" :active="display">
<el-step :title="title" icon="el-icon-edit-outline" />
<el-step icon="el-icon-upload" />
</el-steps>
<el-card class="forms">
<div style="padding-top: 40px; padding-bottom: 20px;">
<data-form ref="dataform" :form="form" :form-model="formModel" :rules="rules" />
</div>
</el-card>
<div class="draft">
<el-button-group>
<el-button v-if="isAdd" type="primary" style="margin-left: 120px" @click="create">{{ $t('global.create') }}</el-button>
<el-button v-if="isEdit" type="warning" style="margin-left: 120px" @click="update">{{ $t('global.update') }}</el-button>
<el-button type="primary" @click="turnback">{{ $t('global.return') }}</el-button>
</el-button-group>
</div>
</div>
</template>
<script>
import { addSkinCode, querySkinCode, updateSkinCode, querySkinCodeExistByCode } from '@/api/management/mapskin';
export default {
name: 'DictionaryDetailEdit',
data() {
return {
display: 1,
formModel: {
id: '',
code: '',
name: '',
origin: { x: 0, y: 0 },
scaling: '1',
linkWidth: 0,
zoneWidth: 0,
watermarkShow: false
}
};
},
computed: {
title() {
if (this.isAdd) {
return this.$t('map.addMapSkin');
}
if (this.isEdit) {
return this.$t('map.updateMapSkin');
}
return '';
},
isAdd() {
return this.$route.params.mode.toUpperCase() == 'add'.toUpperCase();
},
isEdit() {
return this.$route.params.mode.toUpperCase() == 'edit'.toUpperCase();
},
isDisabled() {
return this.isEdit;
},
form() {
const form = {
labelWidth: '140px',
items: [
{ prop: 'code', label: this.$t('map.skinCoding'), type: 'text', required: false, disabled: this.isDisabled },
{ prop: 'name', label: this.$t('map.skinDesignation'), type: 'text', required: false },
{ prop: 'origin', label: this.$t('map.coordinatesOrigin'), type: 'point', required: false },
{ prop: 'scaling', label: this.$t('map.scaling'), type: 'number', required: false, message: this.$t('rules.maxScaling') }
]
};
return form;
},
rules() {
const baseRules = {
code: [
{ required: true, message: this.$t('rules.skinCodingInput'), trigger: 'blur' }
],
name: [
{ required: true, message: this.$t('rules.skinDesignationInput'), trigger: 'blur' }
],
origin: [
{ required: true, message: this.$t('rules.coordinatesOriginInput'), trigger: 'blur' }
],
scaling: [
{ required: true, message: this.$t('rules.scalingInput'), trigger: 'blur' },
{
validator(rule, value, callback) {
if (Number(value) >= 1 && Number(value) <= 8) {
callback();
} else {
callback(new Error(this.$t('rules.scalingInputPrompt')));
}
},
trigger: 'blur'
}
]
};
return baseRules;
}
},
mounted() {
this.initLoadPage();
},
methods: {
initLoadPage() {
//
this.display = 1;
this.formModel = {
id: '',
code: '',
name: '',
origin: { x: 0, y: 0 },
scaling: '1'
};
if (this.isEdit) {
querySkinCode(this.$route.params.skinCodeId).then(response => {
this.formModel = response.data;
});
}
//
this.$nextTick(() => {
this.$refs.dataform.resetForm();
});
},
create() {
this.formModel.id = '';
this.$refs.dataform.validateForm(() => {
querySkinCodeExistByCode(this.formModel.code).then(resp => {
addSkinCode(this.formModel).then(response => {
this.turnback();
this.$message.success(this.$t('tip.creatingSuccessful'));
}).catch(() => {
this.$messageBox(this.$t('tip.creatingFailed'));
});
}).catch(() => {
this.$messageBox(this.$t('tip.skinCodingExist'));
});
});
},
update() {
this.formModel.id = this.$route.params.skinCodeId;
this.$refs.dataform.validateForm(() => {
updateSkinCode(this.formModel).then(response => {
this.turnback();
this.$message.success(this.$t('tip.updateSuccessfully'));
}).catch(() => {
this.$messageBox(this.$t('tip.updateFailed'));
});
});
},
turnback() {
this.$router.go(-1);
}
}
};
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
.steps {
width: 940px;
margin: 0 auto;
margin-top: 20px;
height: 100%;
/deep/ {
.el-step__icon.is-icon {
width: 95px;
}
}
}
.forms {
width: 800px;
margin: 0 auto;
margin-top: 20px;
/deep/ {
.el-select {
float: left;
width: calc(600px);
}
.el-form-item__content>.el-input>.el-input__inner {
float: left;
width: calc(600px);
}
.el-input-number {
float: left;
width: calc(250px);
}
}
}
.draft {
width: 300px;
margin: 20px auto;
}
</style>

View File

@ -1,124 +0,0 @@
<template>
<div>
<QueryListPage ref="queryListPage" :pager-config="pagerConfig" :query-form="queryForm" :query-list="queryList" />
</div>
</template>
<script>
import { UrlConfig } from '@/router/index';
import { getSkinCodePageList, delSkinCode } from '@/api/management/mapskin';
import { getSkinCodeList } from '@/api/management/mapskin';
export default {
name: 'SkinCode',
data() {
return {
prdTypeList: [],
skinCodeList: [],
pagerConfig: {
pageSize: 'pageSize',
pageIndex: 'pageNum'
},
queryForm: {
labelWidth: '80px',
reset: true,
queryObject: {
name: {
type: 'text',
label: this.$t('map.skinDesignation')
},
code: {
type: 'text',
label: this.$t('map.skinCoding')
}
}
},
queryList: {
query: getSkinCodePageList,
selectCheckShow: false,
indexShow: true,
columns: [
{
title: this.$t('map.skinCoding'),
prop: 'code'
},
{
title: this.$t('map.skinDesignation'),
prop: 'name'
},
{
title: this.$t('map.coordinatesOrigin'),
prop: 'origin',
type: 'tag',
columnValue: (row) => { return `(${row.origin.x}, ${row.origin.y})`; },
tagType: () => { return ''; }
},
{
title: this.$t('map.scalingColon'),
prop: 'scaling'
},
{
type: 'button',
title: this.$t('global.operate'),
width: '250',
buttons: [
{
name: this.$t('global.edit'),
handleClick: this.handleEdit,
type: ''
},
{
name: this.$t('global.delete'),
handleClick: this.handleDelete,
type: 'danger'
}
]
}
],
actions: [
{ text: this.$t('global.add'), handler: this.handleAdd }
]
}
};
},
created() {
this.loadInitData();
},
methods: {
loadInitData() {
this.prdTypeList = [];
this.$Dictionary.productPostType().then(list => {
this.prdTypeList = list;
});
this.skinCodeList = [];
getSkinCodeList().then(response => {
this.skinCodeList = response.data;
});
},
handleAdd() {
this.$router.push(`${UrlConfig.map.skinCodeDraft}/add/null`);
},
handleEdit(index, row) {
this.$router.push(`${UrlConfig.map.skinCodeDraft}/edit/${row.id}`);
},
handleDelete(index, row) {
this.$confirm(this.$t('tip.skinDeleteConfirmation'), this.$t('tip.hint'), {
confirmButtonText: this.$t('tip.confirm'),
cancelButtonText: this.$t('tip.cancel'),
type: 'warning'
}).then(() => {
delSkinCode(row.id).then(() => {
this.$message.success(this.$t('tip.skinDeleteSuccessfully'),);
}).catch(() => {
this.$messageBox(this.$t('tip.skinDeleteFailed'));
});
}).catch(() => {
});
},
reloadTable() {
this.queryList.reload();
}
}
};
</script>